!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(n){if(i[n])returni[n].exports;varo=i[n]={exports:{},id:n,loaded:!1};returne[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}vari={};returnt.m=e,t.c=i,t.p="",t(0)}([function(e,t,i){functionn(e,t,i){if(!(thisinstanceofn))thrownewError('JSONEditor constructor called without "new".');varo=r.getInternetExplorerVersion();if(-1!=o&&9>o)thrownewError("Unsupported browser, IE9 or newer required. Please install the newest version of your browser.");arguments.length&&this._create(e,t,i)}varo=i(1),s=i(2),r=i(3);n.modes={},n.prototype._create=function(e,t,i){this.container=e,this.options=t||{},this.json=i||{};varn=this.options.mode||"tree";this.setMode(n)},n.prototype._delete=function(){},n.prototype.set=function(e){this.json=e},n.prototype.get=function(){returnthis.json},n.prototype.setText=function(e){this.json=r.parse(e)},n.prototype.getText=function(){returnJSON.stringify(this.json)},n.prototype.setName=function(e){this.options||(this.options={}),this.options.name=e},n.prototype.getName=function(){returnthis.options&&this.options.name},n.prototype.setMode=function(e){vart,i,o=this.container,s=r.extend({},this.options);s.mode=e;vara=n.modes[e];if(!a)thrownewError('Unknown mode "'+s.mode+'"');try{vard="text"==a.data;if(i=this.getName(),t=this[d?"getText":"get"](),this._delete(),r.clear(this),r.extend(this,a.mixin),this.create(o,s),this.setName(i),this[d?"setText":"set"](t),"function"==typeofa.load)try{a.load.call(this)}catch(h){}}catch(h){this._onError(h)}},n.prototype._onError=function(e){if("function"==typeofthis.onError&&(r.log("WARNING: JSONEditor.onError is deprecated. Use options.error instead."),this.onError(e)),!this.options||"function"!=typeofthis.options.error)throwe;this.options.error(e)},n.registerMode=function(e){vart,i;if(r.isArray(e))for(t=0;t<e.length;t++)n.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(oinn.modes)thrownewError('Mode "'+o+'" already registered');if("function"!=typeofe.mixin.create)thrownewError('Required function "create" missing on mixin');vars=["setMode","registerMode","modes"];for(t=0;t<s.length;t++)if(i=s[t],iine.mixin)thrownewError('Reserved property "'+i+'" not allowed in mixin');n.modes[o]=e}},n.registerMode(o),n.registerMode(s),e.exports=n},function(e,t,i){varn=i(4),o=i(5),s=i(6),r=i(7),a=i(8),d=i(3),h={};h.create=function(e,t){if(!e)thrownewError("No container element provided.");this.container=e,this.dom={},this.highlighter=newn,this.selection=void0,this._setOptions(t),this.options.history&&"view"!==this.options.mode&&(this.history=newo(this)),this._createFrame(),this._createTable()},h._delete=function(){this.frame&&this.container&&this.frame.parentNode==this.container&&this.container.removeChild(this.frame)},h._setOptions=function(e){if(this.options={search:!0,history:!0,mode:"tree",name:void0},e)for(vartine)e.hasOwnProperty(t)&&(this.options[t]=e[t])};varl=void0,c=null;h.set=function(e,t){if(t&&(d.log('Warning: second parameter "name" is deprecated. Use setName(name) instead.'),this.options.name=t),einstanceofFunction||void0===e)this.clear();else{this.content.removeChild(this.table);vari={field:this.options.name,value:e},n=newr(this,i);this._setRoot(n);varo=!1;this.node.expand(o),this.content.appendChild(this.table)}this.history&&this.history.clear()},h.get=function(){returnl&&l.blur(),this.node?this.node.getValue():void0},h.getText=function(){returnJSON.stringify(this.get())},h.setText=function(e){this.set(d.parse(e))},h.setName=function(e){this.options.name=e,this.node&&this.node.updateField(this.options.name)},h.getName=function(){returnthis.options.name},h.clear=function(){this.node&&(this.node.collapse(
e.parent&&e.parent.removeChild(e);vari=e.clone();e.clearDom(),t?this.insertBefore(i,t):this.appendChild(i)}},n.prototype.removeChild=function(e){if(this.childs){vart=this.childs.indexOf(e);if(-1!=t){e.hide(),deletee.searchField,deletee.searchValue;vari=this.childs.splice(t,1)[0];returnthis.updateDom({updateIndexes:!0}),i}}returnvoid0},n.prototype._remove=function(e){this.removeChild(e)},n.prototype.changeType=function(e){vart=this.type;if(t!=e){if("string"!=e&&"auto"!=e||"string"!=t&&"auto"!=t){vari,n=this.dom.tr?this.dom.tr.parentNode:void0;i=this.expanded?this.getAppend():this.getDom();varo=i&&i.parentNode?i.nextSibling:void0;this.hide(),this.clearDom(),this.type=e,"object"==e?(this.childs||(this.childs=[]),this.childs.forEach(function(e){e.clearDom(),deletee.index,e.fieldEditable=!0,void0==e.field&&(e.field="")}),("string"==t||"auto"==t)&&(this.expanded=!0)):"array"==e?(this.childs||(this.childs=[]),this.childs.forEach(function(e,t){e.clearDom(),e.fieldEditable=!1,e.index=t}),("string"==t||"auto"==t)&&(this.expanded=!0)):this.expanded=!1,n&&(o?n.insertBefore(this.getDom(),o):n.appendChild(this.getDom())),this.showChilds()}elsethis.type=e;("auto"==e||"string"==e)&&(this.value="string"==e?String(this.value):this._stringCast(String(this.value)),this.focus()),this.updateDom({updateIndexes:!0})}},n.prototype._getDomValue=function(e){if(this.dom.value&&"array"!=this.type&&"object"!=this.type&&(this.valueInnerText=r.getInnerText(this.dom.value)),void0!=this.valueInnerText)try{vart;if("string"==this.type)t=this._unescapeHTML(this.valueInnerText);else{vari=this._unescapeHTML(this.valueInnerText);t=this._stringCast(i)}if(t!==this.value){varn=this.value;this.value=t,this.editor._onAction("editValue",{node:this,oldValue:n,newValue:t,oldSelection:this.editor.selection,newSelection:this.editor.getSelection()})}}catch(o){if(this.value=void0,1!=e)throwo}},n.prototype._updateDomValue=function(){vare=this.dom.value;if(e){vart=this.value,i="auto"==this.type?r.type(t):this.type,n="string"==i&&r.isUrl(t),o="";o=n&&!this.editable.value?"":"string"==i?"green":"number"==i?"red":"boolean"==i?"darkorange":this._hasChilds()?"":null===t?"#004ED0":"black",e.style.color=o;vars=""==String(this.value)&&"array"!=this.type&&"object"!=this.type;if(s?r.addClassName(e,"empty"):r.removeClassName(e,"empty"),n?r.addClassName(e,"url"):r.removeClassName(e,"url"),"array"==i||"object"==i){vara=this.childs?this.childs.length:0;e.title=this.type+" containing "+a+" items"}else"string"==i&&r.isUrl(t)?this.editable.value&&(e.title="Ctrl+Click or Ctrl+Enter to open url in new window"):e.title="";this.searchValueActive?r.addClassName(e,"highlight-active"):r.removeClassName(e,"highlight-active"),this.searchValue?r.addClassName(e,"highlight"):r.removeClassName(e,"highlight"),r.stripFormatting(e)}},n.prototype._updateDomField=function(){vare=this.dom.field;if(e){vart=""==String(this.field)&&"array"!=this.parent.type;t?r.addClassName(e,"empty"):r.removeClassName(e,"empty"),this.searchFieldActive?r.addClassName(e,"highlight-active"):r.removeClassName(e,"highlight-active"),this.searchField?r.addClassName(e,"highlight"):r.removeClassName(e,"highlight"),r.stripFormatting(e)}},n.prototype._getDomField=function(e){if(this.dom.field&&this.fieldEditable&&(this.fieldInnerText=r.getInnerText(this.dom.field)),void0!=this.fieldInnerText)try{vart=this._unescapeHTML(this.fieldInnerText);if(t!==this.field){vari=this.field;this.field=t,this.editor._onAction("editField",{node:this,oldValue:i,newValue:t,oldSelection:this.editor.selection,newSelection:this.editor.getSelection()})}}catch(n){if(this.field=void0,1!=e)thrown}},n.prototype.clearDom=function(){this.dom={}},n.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){vari=document.createElement("button");e.drag=i,i.className="dragarea",i.title="Drag to move this field (Alt+Shift+Arrows)",t.appendChild(i)}e.tr.a