!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;varr=i[n]={exports:{},id:n,loaded:!1};returne[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}vari={};returnt.m=e,t.c=i,t.p="",t(0)}([function(e,t,i){"use strict";functionn(e,t,i){if(!(thisinstanceofn))thrownewError('JSONEditor constructor called without "new".');varr=a.getInternetExplorerVersion();if(-1!=r&&r<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)){varo=["ajv","schema","schemaRefs","templates","ace","theme","autocomplete","onChange","onEditable","onError","onModeChange","escapeUnicode","history","search","mode","modes","name","indentation","sortObjectKeys","navigationBar","statusBar","languages","language"];Object.keys(t).forEach(function(e){-1===o.indexOf(e)&&console.warn('Unknown option "'+e+'". This option will be ignored')})}arguments.length&&this._create(e,t,i)}varr;try{r=i(1)}catch(e){}varo=i(51),s=i(65),a=i(54);n.modes={},n.prototype.DEBOUNCE_INTERVAL=150,n.prototype._create=function(e,t,i){this.container=e,this.options=t||{},this.json=i||{};varn=this.options.mode||this.options.modes&&this.options.modes[0]||"tree";this.setMode(n)},n.prototype.destroy=function(){},n.prototype.set=function(e){this.json=e},n.prototype.get=function(){returnthis.json},n.prototype.setText=function(e){this.json=a.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,r=this.container,o=a.extend({},this.options),s=o.mode;o.mode=e;varl=n.modes[e];if(!l)thrownewError('Unknown mode "'+o.mode+'"');try{varc="text"==l.data;if(i=this.getName(),t=this[c?"getText":"get"](),this.destroy(),a.clear(this),a.extend(this,l.mixin),this.create(r,o),this.setName(i),this[c?"setText":"set"](t),"function"==typeofl.load)try{l.load.call(this)}catch(e){console.error(e)}if("function"==typeofo.onModeChange&&e!==s)try{o.onModeChange(e,s)}catch(e){console.error(e)}}catch(e){this._onError(e)}},n.prototype.getMode=function(){returnthis.options.mode},n.prototype._onError=function(e){if(!this.options||"function"!=typeofthis.options.onError)throwe;this.options.onError(e)},n.prototype.setSchema=function(e,t){if(e){vari;try{i=this.options.ajv||r({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(i){if(t){for(varnint)i.removeSchema(n),t[n]&&i.addSchema(t[n],n);this.options.schemaRefs=t}this.validateSchema=i.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()},n.prototype.validate=function(){},n.prototype.refresh=function(){},n.registerMode=function(e){vart,i;if(a.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');varr=e.mode;if(rinn.modes)thrownewError('Mode "'+r+'" already registered');if("function"!=typeofe.mixin.create)thrownewError('Required function "create" missing on mixin');varo=["setMode","registerMode","modes"];fo
;Array.isArray(c.token)?1==c.token.length||1==u?c.token=c.token[0]:u-1!=c.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:c,groupCount:u-1}),c.token=c.token[0]):(c.tokenArray=c.token,c.token=null,c.onMatch=this.$arrayTokens):"function"!=typeofc.token||c.onMatch||(c.onMatch=u>1?this.$applyToken:c.token),u>1&&(/\\\d/.test(c.regex)?h=c.regex.replace(/\\([0-9]+)/g,function(e,t){return"\\"+(parseInt(t,10)+r+1)}):(u=1,h=this.removeCapturingGroups(c.regex)),c.splitRegex||"string"==typeofc.token||a.push(c)),o[r]=l,r+=u,n.push(h),c.onMatch||(c.onMatch=null)}}n.length||(o[0]=0,n.push("$")),a.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,s)},this),this.regExps[t]=newRegExp("("+n.join(")|(")+")|($)",s)}};(function(){this.$setMaxTokenCount=function(e){r=0|e},this.$applyToken=function(e){vart=this.splitRegex.exec(e).slice(1),i=this.token.apply(this,t);if("string"==typeofi)return[{type:i,value:e}];for(varn=[],r=0,o=i.length;r<o;r++)t[r]&&(n[n.length]={type:i[r],value:t[r]});returnn},this.$arrayTokens=function(e){if(!e)return[];vart=this.splitRegex.exec(e);if(!t)return"text";for(vari=[],n=this.tokenArray,r=0,o=n.length;r<o;r++)t[r+1]&&(i[i.length]={type:n[r],value:t[r+1]});returni},this.removeCapturingGroups=function(e){returne.replace(/\[(?:\\.|[^\]])*?\]|\\.|\(\?[:=!]|(\()/g,function(e,t){returnt?"(?:":e})},this.createSplitterRegexp=function(e,t){if(-1!=e.indexOf("(?=")){vari=0,n=!1,r={};e.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,function(e,t,o,s,a,l){returnn?n="]"!=a:a?n=!0:s?(i==r.stack&&(r.end=l+1,r.stack=-1),i--):o&&(i++,1!=o.length&&(r.stack=i,r.start=l)),e}),null!=r.end&&/^\)*$/.test(e.substr(r.end))&&(e=e.substring(0,r.start)+e.substr(r.end))}return"^"!=e.charAt(0)&&(e="^"+e),"$"!=e.charAt(e.length-1)&&(e+="$"),newRegExp(e,(t||"").replace("g",""))},this.getLineTokens=function(e,t){if(t&&"string"!=typeoft){vari=t.slice(0);t=i[0],"#tmp"===t&&(i.shift(),t=i.shift())}elsevari=[];varn=t||"start",o=this.states[n];o||(n="start",o=this.states[n]);vars=this.matchMappings[n],a=this.regExps[n];a.lastIndex=0;for(varl,c=[],h=0,u=0,d={type:null,value:""};l=a.exec(e);){varf=s.defaultToken,p=null,m=l[0],g=a.lastIndex;if(g-m.length>h){varv=e.substring(h,g-m.length);d.type==f?d.value+=v:(d.type&&c.push(d),d={type:f,value:v})}for(varw=0;w<l.length-2;w++)if(void0!==l[w+1]){p=o[s[w]],f=p.onMatch?p.onMatch(m,n,i,e):p.token,p.next&&(n="string"==typeofp.next?p.next:p.next(n,i),o=this.states[n],o||(this.reportError("state doesn't exist",n),n="start",o=this.states[n]),s=this.matchMappings[n],h=g,a=this.regExps[n],a.lastIndex=g),p.consumeLineEnd&&(h=g);break}if(m)if("string"==typeoff)p&&!1===p.merge||d.type!==f?(d.type&&c.push(d),d={type:f,value:m}):d.value+=m;elseif(f){d.type&&c.push(d),d={type:null,value:""};for(varw=0;w<f.length;w++)c.push(f[w])}if(h==e.length)break;if(h=g,u++>r){for(u>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});h<e.length;)d.type&&c.push(d),d={value:e.substring(h,h+=2e3),type:"overflow"};n="start",i=[];break}}returnd.type&&c.push(d),i.length>1&&i[0]!==n&&i.unshift("#tmp",n),{tokens:c,state:i.length?i:n}},this.reportError=n.reportError}).call(o.prototype),t.Tokenizer=o}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(e,t,i){"use strict";varn=e("../lib/lang"),r=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(t)for(variine){for(varn=e[i],r=0;r<n.length;r++){varo=n[r];(o.next||o.onMatch)&&("string"==typeofo.next&&0!==o.next.indexOf(t)&&(o.next=t+o.next),o.nextState&&0!==o.nextState.indexOf(t)&&(o.nextState=t+o.nextState))}this.$rules[t+i]=n}elsefor(variine)this.$rules[i]=e[i]},this.getRules=function(){returnthis.$rules},this.embedRules=function(e,t,i,r,o){vars="function"==typeofe?(newe).getRules():e;if(r)for(vara=0;a<r.length;a++)r[a]=t+r[a];else{r=[];for(varlins)r.push(t+l)}if(this.addRules(s,t),i)for(varc=Array.prototype[o?"push":"unshift"],
n(e.end,t)}functiono(e,t){0==e.row&&(e.column+=t.column),e.row+=t.row}functions(e,t){o(e.start,t),o(e.end,t)}vara=(e("../range").Range,e("../range_list").RangeList),l=e("../lib/oop"),c=t.Fold=function(e,t){this.foldLine=null,this.placeholder=t,this.range=e,this.start=e.start,this.end=e.end,this.sameRow=e.start.row==e.end.row,this.subFolds=this.ranges=[]};l.inherits(c,a),function(){this.toString=function(){return'"'+this.placeholder+'" '+this.range.toString()},this.setFoldLine=function(e){this.foldLine=e,this.subFolds.forEach(function(t){t.setFoldLine(e)})},this.clone=function(){vare=this.range.clone(),t=newc(e,this.placeholder);returnthis.subFolds.forEach(function(e){t.subFolds.push(e.clone())}),t.collapseChildren=this.collapseChildren,t},this.addSubFold=function(e){if(!this.range.isEqual(e)){if(!this.range.containsRange(e))thrownewError("A fold can't intersect already existing fold"+e.range+this.range);r(e,this.start);for(vart=e.start.row,i=e.start.column,n=0,o=-1;n<this.subFolds.length&&1==(o=this.subFolds[n].range.compare(t,i));n++);vars=this.subFolds[n];if(0==o)returns.addSubFold(e);for(vart=e.range.end.row,i=e.range.end.column,a=n,o=-1;a<this.subFolds.length&&1==(o=this.subFolds[a].range.compare(t,i));a++);this.subFolds[a];if(0==o)thrownewError("A fold can't intersect already existing fold"+e.range+this.range);this.subFolds.splice(n,a-n,e);returne.setFoldLine(this.foldLine),e}},this.restoreRange=function(e){returns(e,this.start)}}.call(c.prototype)}),ace.define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator"],function(e,t,i){"use strict";functionn(){this.getFoldAt=function(e,t,i){varn=this.getFoldLine(e);if(!n)returnnull;for(varr=n.folds,o=0;o<r.length;o++){vars=r[o];if(s.range.contains(e,t)){if(1==i&&s.range.isEnd(e,t))continue;if(-1==i&&s.range.isStart(e,t))continue;returns}}},this.getFoldsInRange=function(e){vart=e.start,i=e.end,n=this.$foldData,r=[];t.column+=1,i.column-=1;for(varo=0;o<n.length;o++){vars=n[o].range.compareRange(e);if(2!=s){if(-2==s)break;for(vara=n[o].folds,l=0;l<a.length;l++){varc=a[l];if(-2==(s=c.range.compareRange(e)))break;if(2!=s){if(42==s)break;r.push(c)}}}}returnt.column-=1,i.column+=1,r},this.getFoldsInRangeList=function(e){if(Array.isArray(e)){vart=[];e.forEach(function(e){t=t.concat(this.getFoldsInRange(e))},this)}elsevart=this.getFoldsInRange(e);returnt},this.getAllFolds=function(){for(vare=[],t=this.$foldData,i=0;i<t.length;i++)for(varn=0;n<t[i].folds.length;n++)e.push(t[i].folds[n]);returne},this.getFoldStringAt=function(e,t,i,n){if(!(n=n||this.getFoldLine(e)))returnnull;for(varr,o,s={end:{column:0}},a=0;a<n.folds.length;a++){o=n.folds[a];varl=o.range.compareEnd(e,t);if(-1==l){r=this.getLine(o.start.row).substring(s.end.column,o.start.column);break}if(0===l)returnnull;s=o}returnr||(r=this.getLine(o.start.row).substring(s.end.column)),-1==i?r.substring(0,t-s.end.column):1==i?r.substring(t-s.end.column):r},this.getFoldLine=function(e,t){vari=this.$foldData,n=0;for(t&&(n=i.indexOf(t)),-1==n&&(n=0),n;n<i.length;n++){varr=i[n];if(r.start.row<=e&&r.end.row>=e)returnr;if(r.end.row>e)returnnull}returnnull},this.getNextFoldLine=function(e,t){vari=this.$foldData,n=0;for(t&&(n=i.indexOf(t)),-1==n&&(n=0),n;n<i.length;n++){varr=i[n];if(r.end.row>=e)returnr}returnnull},this.getFoldedRowCount=function(e,t){for(vari=this.$foldData,n=t-e+1,r=0;r<i.length;r++){varo=i[r],s=o.end.row,a=o.start.row;if(s>=t){a<t&&(a>=e?n-=t-a:n=0);break}s>=e&&(n-=a>=e?s-a:s-e+1)}returnn},this.$addFoldLine=function(e){returnthis.$foldData.push(e),this.$foldData.sort(function(e,t){returne.start.row-t.start.row}),e},this.addFold=function(e,t){vari,n=this.$foldData,r=!1;einstanceofs?i=e:(i=news(t,e),i.collapseChildren=t.collapseChildren),this.$clipRangeToDocument(i.range);vara=i.start.row,l=i.start.column,c=i.end.row,h=i.end.column;if(!(a<c||a==c&&l<=h-2))thrownewError("The range has to be at least 2 characters width");varu=this.getFoldAt(a,l,1),d=this.getFoldAt(c,h,-1)