!function(e,t){"object"==typeofexports&&"object"==typeofmodule?module.exports=t():"function"==typeofdefine&&define.amd?define([],t):"object"==typeofexports?exports.JSONEditor=t():e.JSONEditor=t()}(this,function(){returnfunction(e){functiont(i){if(n[i])returnn[i].exports;varo=n[i]={exports:{},id:i,loaded:!1};returne[i].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}varn={};returnt.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";functioni(e,t,n){if(!(thisinstanceofi))thrownewError('JSONEditor constructor called without "new".');varo=a.getInternetExplorerVersion();if(-1!=o&&o<9)thrownewError("Unsupported browser, IE9 or newer required. Please install the newest version of your browser.");if(t&&(t.error&&(console.warn('Option "error" has been renamed to "onError"'),t.onError=t.error,deletet.error),t.change&&(console.warn('Option "change" has been renamed to "onChange"'),t.onChange=t.change,deletet.change),t.editable&&(console.warn('Option "editable" has been renamed to "onEditable"'),t.onEditable=t.editable,deletet.editable),t)){varr=["ajv","schema","schemaRefs","templates","ace","theme","autocomplete","onChange","onEditable","onError","onModeChange","escapeUnicode","history","search","mode","modes","name","indentation","sortObjectKeys","navigationBar","statusBar"];Object.keys(t).forEach(function(e){-1===r.indexOf(e)&&console.warn('Unknown option "'+e+'". This option will be ignored')})}arguments.length&&this._create(e,t,n)}varo;try{o=n(!function(){vare=newError('Cannot find module "ajv"');throwe.code="MODULE_NOT_FOUND",e}())}catch(e){}varr=n(1),s=n(14),a=n(4);i.modes={},i.prototype.DEBOUNCE_INTERVAL=150,i.prototype._create=function(e,t,n){this.container=e,this.options=t||{},this.json=n||{};vari=this.options.mode||this.options.modes&&this.options.modes[0]||"tree";this.setMode(i)},i.prototype.destroy=function(){},i.prototype.set=function(e){this.json=e},i.prototype.get=function(){returnthis.json},i.prototype.setText=function(e){this.json=a.parse(e)},i.prototype.getText=function(){returnJSON.stringify(this.json)},i.prototype.setName=function(e){this.options||(this.options={}),this.options.name=e},i.prototype.getName=function(){returnthis.options&&this.options.name},i.prototype.setMode=function(e){vart,n,o=this.container,r=a.extend({},this.options),s=r.mode;r.mode=e;varl=i.modes[e];if(!l)thrownewError('Unknown mode "'+r.mode+'"');try{varc="text"==l.data;if(n=this.getName(),t=this[c?"getText":"get"](),this.destroy(),a.clear(this),a.extend(this,l.mixin),this.create(o,r),this.setName(n),this[c?"setText":"set"](t),"function"==typeofl.load)try{l.load.call(this)}catch(e){console.error(e)}if("function"==typeofr.onModeChange&&e!==s)try{r.onModeChange(e,s)}catch(e){console.error(e)}}catch(e){this._onError(e)}},i.prototype.getMode=function(){returnthis.options.mode},i.prototype._onError=function(e){if(!this.options||"function"!=typeofthis.options.onError)throwe;this.options.onError(e)},i.prototype.setSchema=function(e,t){if(e){varn;try{n=this.options.ajv||o({allErrors:!0,verbose:!0})}catch(e){console.warn("Failed to create an instance of Ajv, JSON Schema validation is not available. Please use a JSONEditor bundle including Ajv, or pass an instance of Ajv as via the configuration option `ajv`.")}if(n){if(t){for(variint)n.removeSchema(i),t[i]&&n.addSchema(t[i],i);this.options.schemaRefs=t}this.validateSchema=n.compile(e),this.options.schema=e,this.validate()}this.refresh()}elsethis.validateSchema=null,this.options.schema=null,this.options.schemaRefs=null,this.validate(),this.refresh()},i.prototype.validate=function(){},i.prototype.refresh=function(){},i.registerMode=function(e){vart,n;if(a.isArray(e))for(t=0;t<e.length;t++)i.registerMode(e[t]);else{if(!("mode"ine))thrownewError('Property "mode" missing');if(!("mixin"ine))thrownewError('Property "mixin" missing');if(!("data"ine))thrownewError('Property "data" missing');varo=e.mode;if(oini.modes)thrownewError('Mode "'+o+'" already registered');if("function"!=typeofe.mixin.create)thrownewError('Requiredfunction"crea
;for(vars=0;s<this.enum.length;s++)this.dom.select.option=document.createElement("option"),this.dom.select.option.value=this.enum[s],this.dom.select.option.innerHTML=this.enum[s],this.dom.select.option.value==this.value&&(this.dom.select.option.selected=!0),this.dom.select.appendChild(this.dom.select.option);this.dom.tdSelect=document.createElement("td"),this.dom.tdSelect.className="jsoneditor-tree",this.dom.tdSelect.appendChild(this.dom.select),this.dom.tdValue.parentNode.insertBefore(this.dom.tdSelect,this.dom.tdValue)}!this.schema||this.schema.hasOwnProperty("oneOf")||this.schema.hasOwnProperty("anyOf")||this.schema.hasOwnProperty("allOf")?deletethis.valueFieldHTML:(this.valueFieldHTML=this.dom.tdValue.innerHTML,this.dom.tdValue.style.visibility="hidden",this.dom.tdValue.innerHTML="")}elsethis.dom.tdSelect&&(this.dom.tdSelect.parentNode.removeChild(this.dom.tdSelect),deletethis.dom.tdSelect,deletethis.dom.select,this.dom.tdValue.innerHTML=this.valueFieldHTML,this.dom.tdValue.style.visibility="",deletethis.valueFieldHTML);a.stripFormatting(e)}},i.prototype._updateDomField=function(){vare=this.dom.field;if(e){""==String(this.field)&&"array"!=this.parent.type?a.addClassName(e,"jsoneditor-empty"):a.removeClassName(e,"jsoneditor-empty"),this.searchFieldActive?a.addClassName(e,"jsoneditor-highlight-active"):a.removeClassName(e,"jsoneditor-highlight-active"),this.searchField?a.addClassName(e,"jsoneditor-highlight"):a.removeClassName(e,"jsoneditor-highlight"),a.stripFormatting(e)}},i.prototype._getDomField=function(e){if(this.dom.field&&this.fieldEditable&&(this.fieldInnerText=a.getInnerText(this.dom.field)),void0!=this.fieldInnerText)try{vart=this._unescapeHTML(this.fieldInnerText);t!==this.field&&(this.field=t,this._debouncedOnChangeField())}catch(t){if(this.field=void0,!0!==e)throwt}},i.prototype.validate=function(){vare=[];if("object"===this.type){for(vart={},n=[],i=0;i<this.childs.length;i++){varo=this.childs[i];t.hasOwnProperty(o.field)&&n.push(o.field),t[o.field]=!0}n.length>0&&(e=this.childs.filter(function(e){return-1!==n.indexOf(e.field)}).map(function(e){return{node:e,error:{message:'duplicate key "'+e.field+'"'}}}))}if(this.childs)for(vari=0;i<this.childs.length;i++){varr=this.childs[i].validate();r.length>0&&(e=e.concat(r))}returne},i.prototype.clearDom=function(){this.dom={}},i.prototype.getDom=function(){vare=this.dom;if(e.tr)returne.tr;if(this._updateEditability(),e.tr=document.createElement("tr"),e.tr.node=this,"tree"===this.editor.options.mode){vart=document.createElement("td");if(this.editable.field&&this.parent){varn=document.createElement("button");n.type="button",e.drag=n,n.className="jsoneditor-dragarea",n.title="Drag to move this field (Alt+Shift+Arrows)",t.appendChild(n)}e.tr.appendChild(t);vari=document.createElement("td"),o=document.createElement("button");o.type="button",e.menu=o,o.className="jsoneditor-contextmenu",o.title="Click to open the actions menu (Ctrl+M)",i.appendChild(e.menu),e.tr.appendChild(i)}varr=document.createElement("td");returne.tr.appendChild(r),e.tree=this._createDomTree(),r.appendChild(e.tree),this.updateDom({updateIndexes:!0}),e.tr},i.onDragStart=function(e,t){if(!Array.isArray(e))returni.onDragStart([e],t);if(0!==e.length){varn=e[0],o=e[e.length-1],r=i.getNodeFromTarget(t.target),s=o._nextSibling(),l=n.editor,c=a.getAbsoluteTop(r.dom.tr)-a.getAbsoluteTop(n.dom.tr);l.mousemove||(l.mousemove=a.addEventListener(window,"mousemove",function(t){i.onDrag(e,t)})),l.mouseup||(l.mouseup=a.addEventListener(window,"mouseup",function(t){i.onDragEnd(e,t)})),l.highlighter.lock(),l.drag={oldCursor:document.body.style.cursor,oldSelection:l.getSelection(),oldBeforeNode:s,mouseX:t.pageX,offsetY:c,level:n.getLevel()},document.body.style.cursor="move",t.preventDefault()}},i.onDrag=function(e,t){if(!Array.isArray(e))returni.onDrag([e],t);if(0!==e.length){varn,o,r,s,c,d,h,u,p,f,m,g,v,y,b=e[0].editor,w=t.pageY-b.drag.offsetY,x=t.pageX,_=!1,E=e[0];if(n=E.dom.tr,p=a.getAbsoluteTop(n),g=n.offsetHeight,w<p){o=n;do{o=o.previousSibling,h=i.getNodeFromTarget(o),f=o?a.getAbsolu