jsoneditor/dist/jsoneditor.min.js

44 lines
468 KiB
JavaScript
Raw Normal View History

/*!
* jsoneditor.js
*
* @brief
* JSONEditor is a web-based tool to view, edit, and format JSON.
* It shows data a clear, editable treeview.
*
* Supported browsers: Chrome, Firefox, Safari, Opera, Internet Explorer 8+
*
* @license
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy
* of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*
2015-01-25 22:11:56 +08:00
* Copyright (c) 2011-2015 Jos de Jong, http://jsoneditoronline.org
*
* @author Jos de Jong, <wjosdejong@gmail.com>
2015-03-01 04:17:03 +08:00
* @version 4.0.0
* @date 2015-03-02
2013-05-04 05:26:09 +08:00
*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):"object"==typeof exports?exports.JSONEditor=t():e.JSONEditor=t()}(this,function(){return function(e){function t(n){if(i[n])return i[n].exports;var o=i[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var i={};return t.m=e,t.c=i,t.p="",t(0)}([function(e,t,i){function n(e,t,i){if(!(this instanceof n))throw new Error('JSONEditor constructor called without "new".');var o=s.getInternetExplorerVersion();if(-1!=o&&9>o)throw new Error("Unsupported browser, IE9 or newer required. Please install the newest version of your browser.");arguments.length&&this._create(e,t,i)}var o=i(1),r=i(2),s=i(3);n.modes={},n.prototype._create=function(e,t,i){this.container=e,this.options=t||{},this.json=i||{};var n=this.options.mode||"tree";this.setMode(n)},n.prototype._delete=function(){},n.prototype.set=function(e){this.json=e},n.prototype.get=function(){return this.json},n.prototype.setText=function(e){this.json=s.parse(e)},n.prototype.getText=function(){return JSON.stringify(this.json)},n.prototype.setName=function(e){this.options||(this.options={}),this.options.name=e},n.prototype.getName=function(){return this.options&&this.options.name},n.prototype.setMode=function(e){var t,i,o=this.container,r=s.extend({},this.options);r.mode=e;var a=n.modes[e];if(!a)throw new Error('Unknown mode "'+r.mode+'"');try{var l="text"==a.data;if(i=this.getName(),t=this[l?"getText":"get"](),this._delete(),s.clear(this),s.extend(this,a.mixin),this.create(o,r),this.setName(i),this[l?"setText":"set"](t),"function"==typeof a.load)try{a.load.call(this)}catch(c){}}catch(c){this._onError(c)}},n.prototype._onError=function(e){if("function"==typeof this.onError&&(s.log("WARNING: JSONEditor.onError is deprecated. Use options.error instead."),this.onError(e)),!this.options||"function"!=typeof this.options.error)throw e;this.options.error(e)},n.registerMode=function(e){var t,i;if(s.isArray(e))for(t=0;t<e.length;t++)n.registerMode(e[t]);else{if(!("mode"in e))throw new Error('Property "mode" missing');if(!("mixin"in e))throw new Error('Property "mixin" missing');if(!("data"in e))throw new Error('Property "data" missing');var o=e.mode;if(o in n.modes)throw new Error('Mode "'+o+'" already registered');if("function"!=typeof e.mixin.create)throw new Error('Required function "create" missing on mixin');var r=["setMode","registerMode","modes"];for(t=0;t<r.length;t++)if(i=r[t],i in e.mixin)throw new Error('Reserved property "'+i+'" not allowed in mixin');n.modes[o]=e}},n.registerMode(o),n.registerMode(r),e.exports=n},function(e,t,i){var n=i(6),o=i(7),r=i(8),s=i(9),a=i(5),l=i(3),c={};c.create=function(e,t){if(!e)throw new Error("No container element provided.");this.container=e,this.dom={},this.highlighter=new n,this.selection=void 0,this._setOptions(t),this.options.history&&"view"!==this.options.mode&&(this.history=new o(this)),this._createFrame(),this._createTable()},c._delete=function(){this.frame&&this.container&&this.frame.parentNode==this.container&&this.container.removeChild(this.frame)},c._setOptions=function(e){if(this.options={search:!0,history:!0,mode:"tree",name:void 0},e)for(var t in e)e.hasOwnProperty(t)&&(this.options[t]=e[t])};var h=void 0,u=null;c.set=function(e,t){if(t&&(l.log('Warning: second parameter "name" is deprecated. Use setName(name) instead.'),this.options.name=t),e instanceof Function||void 0===e)this.clear();else{this.content.removeChild(this.table);var i={field:this.options.name,value:e},n=new s(this,i);this._setRoot(n);var o=!1;this.node.expand(o),this.content.appendChild(this.table)}this.history&&this.history.clear()},c.get=function(){return h&&h.blur(),this.node?this.node.getValue():void 0},c.getText=function(){return JSON.stringify(this.get())},c.setText=function(e){this.set(l.parse(e))},c.setName=function(e){this.options.name=e,this.node&&this.node.updateField(this.options.name)},c.getName=function(){return this.options.name},c.focus=function(){var e=this.content.querySelecto
}))},n.prototype.collapse=function(e){this.childs&&(this.hideChilds(),e!==!1&&this.childs.forEach(function(t){t.collapse(e)}),this.dom.expand&&(this.dom.expand.className="collapsed"),this.expanded=!1)},n.prototype.showChilds=function(){var e=this.childs;if(e&&this.expanded){var t=this.dom.tr,i=t?t.parentNode:void 0;if(i){var n=this.getAppend(),o=t.nextSibling;o?i.insertBefore(n,o):i.appendChild(n),this.childs.forEach(function(e){i.insertBefore(e.getDom(),n),e.showChilds()})}}},n.prototype.hide=function(){var e=this.dom.tr,t=e?e.parentNode:void 0;t&&t.removeChild(e),this.hideChilds()},n.prototype.hideChilds=function(){var e=this.childs;if(e&&this.expanded){var t=this.getAppend();t.parentNode&&t.parentNode.removeChild(t),this.childs.forEach(function(e){e.hide()})}},n.prototype.appendChild=function(e){if(this._hasChilds()){if(e.setParent(this),e.fieldEditable="object"==this.type,"array"==this.type&&(e.index=this.childs.length),this.childs.push(e),this.expanded){var t=e.getDom(),i=this.getAppend(),n=i?i.parentNode:void 0;i&&n&&n.insertBefore(t,i),e.showChilds()}this.updateDom({updateIndexes:!0}),e.updateDom({recurse:!0})}},n.prototype.moveBefore=function(e,t){if(this._hasChilds()){var i=this.dom.tr?this.dom.tr.parentNode:void 0;if(i){var n=document.createElement("tr");n.style.height=i.clientHeight+"px",i.appendChild(n)}e.parent&&e.parent.removeChild(e),t instanceof a?this.appendChild(e):this.insertBefore(e,t),i&&i.removeChild(n)}},n.prototype.moveTo=function(e,t){if(e.parent==this){var i=this.childs.indexOf(e);t>i&&t++}var n=this.childs[t]||this.append;this.moveBefore(e,n)},n.prototype.insertBefore=function(e,t){if(this._hasChilds()){if(t==this.append)e.setParent(this),e.fieldEditable="object"==this.type,this.childs.push(e);else{var i=this.childs.indexOf(t);if(-1==i)throw new Error("Node not found");e.setParent(this),e.fieldEditable="object"==this.type,this.childs.splice(i,0,e)}if(this.expanded){var n=e.getDom(),o=t.getDom(),r=o?o.parentNode:void 0;o&&r&&r.insertBefore(n,o),e.showChilds()}this.updateDom({updateIndexes:!0}),e.updateDom({recurse:!0})}},n.prototype.insertAfter=function(e,t){if(this._hasChilds()){var i=this.childs.indexOf(t),n=this.childs[i+1];n?this.insertBefore(e,n):this.appendChild(e)}},n.prototype.search=function(e){var t,i=[],n=e?e.toLowerCase():void 0;if(delete this.searchField,delete this.searchValue,void 0!=this.field){var o=String(this.field).toLowerCase();t=o.indexOf(n),-1!=t&&(this.searchField=!0,i.push({node:this,elem:"field"})),this._updateDomField()}if(this._hasChilds()){if(this.childs){var r=[];this.childs.forEach(function(t){r=r.concat(t.search(e))}),i=i.concat(r)}if(void 0!=n){var s=!1;0==r.length?this.collapse(s):this.expand(s)}}else{if(void 0!=this.value){var a=String(this.value).toLowerCase();t=a.indexOf(n),-1!=t&&(this.searchValue=!0,i.push({node:this,elem:"value"}))}this._updateDomValue()}return i},n.prototype.scrollTo=function(e){if(!this.dom.tr||!this.dom.tr.parentNode)for(var t=this.parent,i=!1;t;)t.expand(i),t=t.parent;this.dom.tr&&this.dom.tr.parentNode&&this.editor.scrollTo(this.dom.tr.offsetTop,e)},n.focusElement=void 0,n.prototype.focus=function(e){if(n.focusElement=e,this.dom.tr&&this.dom.tr.parentNode){var t=this.dom;switch(e){case"drag":t.drag?t.drag.focus():t.menu.focus();break;case"menu":t.menu.focus();break;case"expand":this._hasChilds()?t.expand.focus():t.field&&this.fieldEditable?(t.field.focus(),s.selectContentEditable(t.field)):t.value&&!this._hasChilds()?(t.value.focus(),s.selectContentEditable(t.value)):t.menu.focus();break;case"field":t.field&&this.fieldEditable?(t.field.focus(),s.selectContentEditable(t.field)):t.value&&!this._hasChilds()?(t.value.focus(),s.selectContentEditable(t.value)):this._hasChilds()?t.expand.focus():t.menu.focus();break;case"value":default:t.value&&!this._hasChilds()?(t.value.focus(),s.selectContentEditable(t.value)):t.field&&this.fieldEditable?(t.field.focus(),s.selectContentEditable(t.field)):this._hasChilds()?t.expand.focus():t.menu.focus()}}},n.select=function(e){setTimeout(function(){s.selectContentEditable(e)},0)},n.prototype.blur=functio
if(e===i)r&&this.push.apply(this,o);else{var s=Math.min(t,i-e),a=e+s,l=a+r-s,c=i-a,h=i-s;if(a>l)for(var d=0;c>d;++d)this[l+d]=this[a+d];else if(l>a)for(d=c;d--;)this[l+d]=this[a+d];if(r&&e===h)this.length=h,this.push.apply(this,o);else for(this.length=h+r,d=0;r>d;++d)this[e+d]=o[d]}return n};Array.isArray||(Array.isArray=function(e){return"[object Array]"==d(e)});var p=Object("a"),m="a"!=p[0]||!(0 in p);if(Array.prototype.forEach||(Array.prototype.forEach=function(e){var t=R(this),i=m&&"[object String]"==d(this)?this.split(""):t,n=arguments[1],o=-1,r=i.length>>>0;if("[object Function]"!=d(e))throw new TypeError;for(;++o<r;)o in i&&e.call(n,i[o],o,t)}),Array.prototype.map||(Array.prototype.map=function(e){var t=R(this),i=m&&"[object String]"==d(this)?this.split(""):t,n=i.length>>>0,o=Array(n),r=arguments[1];if("[object Function]"!=d(e))throw new TypeError(e+" is not a function");for(var s=0;n>s;s++)s in i&&(o[s]=e.call(r,i[s],s,t));return o}),Array.prototype.filter||(Array.prototype.filter=function(e){var t,i=R(this),n=m&&"[object String]"==d(this)?this.split(""):i,o=n.length>>>0,r=[],s=arguments[1];if("[object Function]"!=d(e))throw new TypeError(e+" is not a function");for(var a=0;o>a;a++)a in n&&(t=n[a],e.call(s,t,a,i)&&r.push(t));return r}),Array.prototype.every||(Array.prototype.every=function(e){var t=R(this),i=m&&"[object String]"==d(this)?this.split(""):t,n=i.length>>>0,o=arguments[1];if("[object Function]"!=d(e))throw new TypeError(e+" is not a function");for(var r=0;n>r;r++)if(r in i&&!e.call(o,i[r],r,t))return!1;return!0}),Array.prototype.some||(Array.prototype.some=function(e){var t=R(this),i=m&&"[object String]"==d(this)?this.split(""):t,n=i.length>>>0,o=arguments[1];if("[object Function]"!=d(e))throw new TypeError(e+" is not a function");for(var r=0;n>r;r++)if(r in i&&e.call(o,i[r],r,t))return!0;return!1}),Array.prototype.reduce||(Array.prototype.reduce=function(e){var t=R(this),i=m&&"[object String]"==d(this)?this.split(""):t,n=i.length>>>0;if("[object Function]"!=d(e))throw new TypeError(e+" is not a function");if(!n&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var o,r=0;if(arguments.length>=2)o=arguments[1];else for(;;){if(r in i){o=i[r++];break}if(++r>=n)throw new TypeError("reduce of empty array with no initial value")}for(;n>r;r++)r in i&&(o=e.call(void 0,o,i[r],r,t));return o}),Array.prototype.reduceRight||(Array.prototype.reduceRight=function(e){var t=R(this),i=m&&"[object String]"==d(this)?this.split(""):t,n=i.length>>>0;if("[object Function]"!=d(e))throw new TypeError(e+" is not a function");if(!n&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var o,r=n-1;if(arguments.length>=2)o=arguments[1];else for(;;){if(r in i){o=i[r--];break}if(--r<0)throw new TypeError("reduceRight of empty array with no initial value")}do r in this&&(o=e.call(void 0,o,i[r],r,t));while(r--);return o}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(e){var t=m&&"[object String]"==d(this)?this.split(""):R(this),n=t.length>>>0;if(!n)return-1;var o=0;for(arguments.length>1&&(o=i(arguments[1])),o=o>=0?o:Math.max(0,n+o);n>o;o++)if(o in t&&t[o]===e)return o;return-1}),Array.prototype.lastIndexOf&&-1==[0,1].lastIndexOf(0,-3)||(Array.prototype.lastIndexOf=function(e){var t=m&&"[object String]"==d(this)?this.split(""):R(this),n=t.length>>>0;if(!n)return-1;var o=n-1;for(arguments.length>1&&(o=Math.min(o,i(arguments[1]))),o=o>=0?o:n-Math.abs(o);o>=0;o--)if(o in t&&e===t[o])return o;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(e){return e.__proto__||(e.constructor?e.constructor.prototype:h)}),!Object.getOwnPropertyDescriptor){var v="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(e,t){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError(v+e);if(g(e,t)){var i,n,o;if(i={enumerable:!0,configurable:!0},a){var l=e.__proto__;e.__proto__=h;var n=r(e,t),o=s(e,t);if(e.__proto__=l,n||o)return n&&(i.get=n),o&&(i.set=o),i}return i.valu
},this.setClassName=function(e){n.addCssClass(this.getElement(),e)},this.show=function(e,t,i){null!=e&&this.setText(e),null!=t&&null!=i&&this.setPosition(t,i),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth}}).call(i.prototype),t.Tooltip=i}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],function(e,t){"use strict";function i(e){function t(){var t=u.getDocumentPosition().row,n=l.$annotations[t];if(!n)return i();var o=a.session.getLength();if(t==o){var s=a.renderer.pixelToScreenCoordinates(0,u.y).row,h=u.$pos;if(s>a.session.documentToScreenRow(h.row,h.column))return i()}if(d!=n)if(d=n.text.join("<br/>"),c.setHtml(d),c.show(),a.on("mousewheel",i),e.$tooltipFollowsMouse)r(u);else{var g=l.$cells[a.session.documentToScreenRow(t,0)].element,f=g.getBoundingClientRect(),p=c.getElement().style;p.left=f.right+"px",p.top=f.bottom+"px"}}function i(){h&&(h=clearTimeout(h)),d&&(c.hide(),d=null,a.removeEventListener("mousewheel",i))}function r(e){c.setPosition(e.x,e.y)}var a=e.editor,l=a.renderer.$gutterLayer,c=new n(a.container);e.editor.setDefaultHandler("guttermousedown",function(t){if(a.isFocused()&&0==t.getButton()){var i=l.getRegion(t);if("foldWidgets"!=i){var n=t.getDocumentPosition().row,o=a.session.selection;if(t.getShiftKey())o.selectTo(n,0);else{if(2==t.domEvent.detail)return a.selectAll(),t.preventDefault();e.$clickSelection=a.selection.getLineRange(n)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}}});var h,u,d;e.editor.setDefaultHandler("guttermousemove",function(n){var s=n.domEvent.target||n.domEvent.srcElement;return o.hasCssClass(s,"ace_fold-widget")?i():(d&&e.$tooltipFollowsMouse&&r(n),u=n,void(h||(h=setTimeout(function(){h=null,u&&!e.isMousePressed?t():i()},50))))}),s.addListener(a.renderer.$gutter,"mouseout",function(){u=null,d&&!h&&(h=setTimeout(function(){h=null,i()},50))}),a.on("changeSession",i)}function n(e){a.call(this,e)}var o=e("../lib/dom"),r=e("../lib/oop"),s=e("../lib/event"),a=e("../tooltip").Tooltip;r.inherits(n,a),function(){this.setPosition=function(e,t){var i=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight,o=this.getWidth(),r=this.getHeight();e+=15,t+=15,e+o>i&&(e-=e+o-i),t+r>n&&(t-=20+r),a.prototype.setPosition.call(this,e,t)}}.call(n.prototype),t.GutterHandler=i}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t){"use strict";var i=e("../lib/event"),n=e("../lib/useragent"),o=t.MouseEvent=function(e,t){this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){i.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){i.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var e=this.editor,t=e.getSelectionRange();if(t.isEmpty())this.$inSelection=!1;else{var i=this.getDocumentPosition();this.$inSelection=t.contains(i.row,i.column)}return this.$inSelection},this.getButton=function(){return i.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=n.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(o.prototype)}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],func
r[0].length==t||this.session.$useEmacsStyleLineStart||(n.column+=r[0].length),this.moveCursorToPosition(n)},this.moveCursorLineEnd=function(){var e=this.lead,t=this.session.getDocumentLastRowColumnPosition(e.row,e.column);if(this.lead.column==t.column){var i=this.session.getLine(t.row);if(t.column==i.length){var n=i.search(/\s+$/);n>0&&(t.column=n)}}this.moveCursorTo(t.row,t.column)},this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var e,t=this.lead.row,i=this.lead.column,n=this.doc.getLine(t),o=n.substring(i);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var r=this.session.getFoldAt(t,i,1);return r?void this.moveCursorTo(r.end.row,r.end.column):((e=this.session.nonTokenRe.exec(o))&&(i+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,o=n.substring(i)),i>=n.length?(this.moveCursorTo(t,n.length),this.moveCursorRight(),void(t<this.doc.getLength()-1&&this.moveCursorWordRight())):((e=this.session.tokenRe.exec(o))&&(i+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),void this.moveCursorTo(t,i)))},this.moveCursorLongWordLeft=function(){var e,t=this.lead.row,i=this.lead.column;if(e=this.session.getFoldAt(t,i,-1))return void this.moveCursorTo(e.start.row,e.start.column);var o=this.session.getFoldStringAt(t,i,-1);null==o&&(o=this.doc.getLine(t).substring(0,i));var r,s=n.stringReverse(o);return this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,(r=this.session.nonTokenRe.exec(s))&&(i-=this.session.nonTokenRe.lastIndex,s=s.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),0>=i?(this.moveCursorTo(t,0),this.moveCursorLeft(),void(t>0&&this.moveCursorWordLeft())):((r=this.session.tokenRe.exec(s))&&(i-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),void this.moveCursorTo(t,i))},this.$shortWordEndIndex=function(e){var t,i,n=0,o=/\s/,r=this.session.tokenRe;if(r.lastIndex=0,t=this.session.tokenRe.exec(e))n=this.session.tokenRe.lastIndex;else{for(;(i=e[n])&&o.test(i);)n++;if(1>n)for(r.lastIndex=0;(i=e[n])&&!r.test(i);)if(r.lastIndex=0,n++,o.test(i)){if(n>2){n--;break}for(;(i=e[n])&&o.test(i);)n++;if(n>2)break}}return r.lastIndex=0,n},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,i=this.doc.getLine(e),n=i.substring(t),o=this.session.getFoldAt(e,t,1);if(o)return this.moveCursorTo(o.end.row,o.end.column);if(t==i.length){var r=this.doc.getLength();do e++,n=this.doc.getLine(e);while(r>e&&/^\s*$/.test(n));/^\s+/.test(n)||(n=""),t=0}var s=this.$shortWordEndIndex(n);this.moveCursorTo(e,t+s)},this.moveCursorShortWordLeft=function(){var e,t=this.lead.row,i=this.lead.column;if(e=this.session.getFoldAt(t,i,-1))return this.moveCursorTo(e.start.row,e.start.column);var o=this.session.getLine(t).substring(0,i);if(0===i){do t--,o=this.doc.getLine(t);while(t>0&&/^\s*$/.test(o));i=o.length,/\s+$/.test(o)||(o="")}var r=n.stringReverse(o),s=this.$shortWordEndIndex(r);return this.moveCursorTo(t,i-s)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(e,t){var i=this.session.documentToScreenPosition(this.lead.row,this.lead.column);0===t&&(this.$desiredColumn?i.column=this.$desiredColumn:this.$desiredColumn=i.column);var n=this.session.screenToDocumentPosition(i.row+e,i.column);0!==e&&0===t&&n.row===this.lead.row&&n.column===this.lead.column&&this.session.lineWidgets&&this.session.lineWidgets[n.row]&&n.row++,this.moveCursorTo(n.row,n.column+t,0===t)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,i){var n=this.session.getFoldAt(e,t,1);n&&(e=n.start.row,t=n.start.column),this.$keepDesiredColumnOnChange=!0,this.lead.setPosition(e,t),this.$keepDesiredColumnOnCha
}),ace.define("ace/token_iterator",["require","exports","module"],function(e,t){"use strict";var i=function(e,t,i){this.$session=e,this.$row=t,this.$rowTokens=e.getTokens(t);var n=e.getTokenAt(t,i);this.$tokenIndex=n?n.index:-1};(function(){this.stepBackward=function(){for(this.$tokenIndex-=1;this.$tokenIndex<0;){if(this.$row-=1,this.$row<0)return this.$row=0,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=this.$rowTokens.length-1}return this.$rowTokens[this.$tokenIndex]},this.stepForward=function(){this.$tokenIndex+=1;for(var e;this.$tokenIndex>=this.$rowTokens.length;){if(this.$row+=1,e||(e=this.$session.getLength()),this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,i=e[t].start;if(void 0!==i)return i;for(i=0;t>0;)t-=1,i+=e[t].value.length;return i}}).call(i.prototype),t.TokenIterator=i}),ace.define("ace/mode/text",["require","exports","module","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"],function(e,t){"use strict";var i=e("../tokenizer").Tokenizer,n=e("./text_highlight_rules").TextHighlightRules,o=e("./behaviour").Behaviour,r=e("../unicode"),s=e("../lib/lang"),a=e("../token_iterator").TokenIterator,l=e("../range").Range,c=function(){this.HighlightRules=n,this.$behaviour=new o};(function(){this.tokenRe=new RegExp("^["+r.packages.L+r.packages.Mn+r.packages.Mc+r.packages.Nd+r.packages.Pc+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+r.packages.L+r.packages.Mn+r.packages.Mc+r.packages.Nd+r.packages.Pc+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules,this.$tokenizer=new i(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(e,t,i,n){function o(e){for(var t=i;n>=t;t++)e(r.getLine(t),t)}var r=t.doc,a=!0,l=!0,c=1/0,h=t.getTabSize(),u=!1;if(this.lineCommentStart){if(Array.isArray(this.lineCommentStart))var d=this.lineCommentStart.map(s.escapeRegExp).join("|"),g=this.lineCommentStart[0];else var d=s.escapeRegExp(this.lineCommentStart),g=this.lineCommentStart;d=new RegExp("^(\\s*)(?:"+d+") ?"),u=t.getUseSoftTabs();var f=function(e,t){var i=e.match(d);if(i){var n=i[1].length,o=i[0].length;A(e,n,o)||" "!=i[0][o-1]||o--,r.removeInLine(t,n,o)}},p=g+" ",m=function(e,t){(!a||/\S/.test(e))&&(A(e,c,c)?r.insertInLine({row:t,column:c},p):r.insertInLine({row:t,column:c},g))},v=function(e){return d.test(e)},A=function(e,t,i){for(var n=0;t--&&" "==e.charAt(t);)n++;if(n%h!=0)return!1;for(var n=0;" "==e.charAt(i++);)n++;return h>2?n%h!=h-1:n%h==0}}else{if(!this.blockComment)return!1;var g=this.blockComment.start,w=this.blockComment.end,d=new RegExp("^(\\s*)(?:"+s.escapeRegExp(g)+")"),C=new RegExp("(?:"+s.escapeRegExp(w)+")\\s*$"),m=function(e,t){v(e,t)||(!a||/\S/.test(e))&&(r.insertInLine({row:t,column:e.length},w),r.insertInLine({row:t,column:c},g))},f=function(e,t){var i;(i=e.match(C))&&r.removeInLine(t,e.length-i[0].length,e.length),(i=e.match(d))&&r.removeInLine(t,i[1].length,i[0].length)},v=function(e,i){if(d.test(e))return!0;for(var n=t.getTokens(i),o=0;o<n.length;o++)if("comment"===n[o].type)return!0}}var E=1/0;o(function(e,t){var i=e.search(/\S/);-1!==i?(c>i&&(c=i),l&&!v(e,t)&&(l=!1)):E>e.length&&(E=e.length)}),1/0==c&&(c=E,a=!1,l=!1),u&&c%h!=0&&(c=Math.floor(c/h)*h),o(l?f:m)},this.toggleBlockComment=function(e,t,i,n){var o=this.blockComment;if(o){!o.start&&o[0]&&(o=o[0]);var r,s,c=new a(t,n.row,n.column),h=c.getCurrentToken(),u=(t.selection,t.selection.toOrientedRange());if(h&&/comment/.test(h.type)){for(var d,g;h&&/comment/.test(h.type);){var f=h.value.indexOf(o.start);if(-1!=f){var p=c.getCurrentTokenRow(),m=c.getCurrentTokenColumn()+f;d=new l(p,m,p,m
var a="...";if(!o.isMultiLine()){if(a=this.getTextRange(o),a.length<4)return;a=a.trim().substring(0,2)+".."}this.addFold(a,o)},this.getCommentFoldRange=function(e,t,i){var o=new s(this,e,t),r=o.getCurrentToken();if(r&&/^comment|string/.test(r.type)){var a=new n,l=new RegExp(r.type.replace(/\..*/,"\\."));if(1!=i){do r=o.stepBackward();while(r&&l.test(r.type));o.stepForward()}if(a.start.row=o.getCurrentTokenRow(),a.start.column=o.getCurrentTokenColumn()+2,o=new s(this,e,t),-1!=i){do r=o.stepForward();while(r&&l.test(r.type));r=o.stepBackward()}else r=o.getCurrentToken();return a.end.row=o.getCurrentTokenRow(),a.end.column=o.getCurrentTokenColumn()+r.value.length-2,a}},this.foldAll=function(e,t,i){void 0==i&&(i=1e5);var n=this.foldWidgets;if(n){t=t||this.getLength(),e=e||0;for(var o=e;t>o;o++)if(null==n[o]&&(n[o]=this.getFoldWidget(o)),"start"==n[o]){var r=this.getFoldWidgetRange(o);if(r&&r.isMultiLine()&&r.end.row<=t&&r.start.row>=e){o=r.end.row;try{var s=this.addFold("...",r);s&&(s.collapseChildren=i)}catch(a){}}}}},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(e){if(!this.$foldStyles[e])throw new Error("invalid fold style: "+e+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=e){this.$foldStyle=e,"manual"==e&&this.unfold();var t=this.$foldMode;this.$setFolding(null),this.$setFolding(t)}},this.$setFolding=function(e){if(this.$foldMode!=e){if(this.$foldMode=e,this.removeListener("change",this.$updateFoldWidgets),this._emit("changeAnnotation"),!e||"manual"==this.$foldStyle)return void(this.foldWidgets=null);this.foldWidgets=[],this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle),this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets)}},this.getParentFoldRangeData=function(e,t){var i=this.foldWidgets;if(!i||t&&i[e])return{};for(var n,o=e-1;o>=0;){var r=i[o];if(null==r&&(r=i[o]=this.getFoldWidget(o)),"start"==r){var s=this.getFoldWidgetRange(o);if(n||(n=s),s&&s.end.row>=e)break}o--}return{range:-1!==o&&s,firstRange:n}},this.onFoldWidgetClick=function(e,t){t=t.domEvent;var i={children:t.shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey},n=this.$toggleFoldWidget(e,i);if(!n){var o=t.target||t.srcElement;o&&/ace_fold-widget/.test(o.className)&&(o.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(this.getFoldWidget){var i=this.getFoldWidget(e),n=this.getLine(e),o="end"===i?-1:1,r=this.getFoldAt(e,-1===o?0:n.length,o);if(r)return void(t.children||t.all?this.removeFold(r):this.expandFold(r));var s=this.getFoldWidgetRange(e,!0);if(s&&!s.isMultiLine()&&(r=this.getFoldAt(s.start.row,s.start.column,1),r&&s.isEqual(r.range)))return void this.removeFold(r);if(t.siblings){var a=this.getParentFoldRangeData(e);if(a.range)var l=a.range.start.row+1,c=a.range.end.row;this.foldAll(l,c,t.all?1e4:0)}else t.children?(c=s?s.end.row:this.getLength(),this.foldAll(e+1,s.end.row,t.all?1e4:0)):s&&(t.all&&(s.collapseChildren=1e4),this.addFold("...",s));return s}},this.toggleFoldWidget=function(){var e=this.selection.getCursor().row;e=this.getRowFoldStart(e);var t=this.$toggleFoldWidget(e,{});if(!t){var i=this.getParentFoldRangeData(e,!0);if(t=i.range||i.firstRange){e=t.start.row;var n=this.getFoldAt(e,this.getLine(e).length,1);n?this.removeFold(n):this.addFold("...",t)}}},this.updateFoldWidgets=function(e){var t=e.data,i=t.range,n=i.start.row,o=i.end.row-n;if(0===o)this.foldWidgets[n]=null;else if("removeText"==t.action||"removeLines"==t.action)this.foldWidgets.splice(n,o+1,null);else{var r=Array(o+1);r.unshift(n,1),this.foldWidgets.splice.apply(this.foldWidgets,r)}}}var n=e("../range").Range,o=e("./fold_line").FoldLine,r=e("./fold").Fold,s=e("../token_iterator").TokenIterator;t.Folding=i}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(e,t){"use strict";function i(){this.findMatchingBracket=function(e,t){if(0==e.column)return null;var i=t||this.getLine(e.
},this.setOptions=function(e){this.$options=e},this.find=function(e){var t=this.$matchIterator(e,this.$options);if(!t)return!1;var i=null;return t.forEach(function(e,t,n){if(e.start)i=e;else{var r=e.offset+(n||0);i=new o(t,r,t,r+e.length)}return!0}),i},this.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var n=t.range,r=n?e.getLines(n.start.row,n.end.row):e.doc.getAllLines(),s=[],a=t.re;if(t.$isMultiLine){var l,c=a.length,h=r.length-c;e:for(var u=a.offset||0;h>=u;u++){for(var d=0;c>d;d++)if(-1==r[u+d].search(a[d]))continue e;var g=r[u],f=r[u+c-1],p=g.length-g.match(a[0])[0].length,m=f.match(a[c-1])[0].length;l&&l.end.row===u&&l.end.column>p||(s.push(l=new o(u,p,u+c-1,m)),c>2&&(u=u+c-2))}}else for(var v=0;v<r.length;v++)for(var A=i.getMatchOffsets(r[v],a),d=0;d<A.length;d++){var w=A[d];s.push(new o(v,w.offset,v,w.offset+w.length))}if(n){for(var C=n.start.column,E=n.start.column,v=0,d=s.length-1;d>v&&s[v].start.column<C&&s[v].start.row==n.start.row;)v++;for(;d>v&&s[d].end.column>E&&s[d].end.row==n.end.row;)d--;for(s=s.slice(v,d+1),v=0,d=s.length;d>v;v++)s[v].start.row+=n.start.row,s[v].end.row+=n.start.row}return s},this.replace=function(e,t){var i=this.$options,n=this.$assembleRegExp(i);if(i.$isMultiLine)return t;if(n){var o=n.exec(e);if(!o||o[0].length!=e.length)return null;if(t=e.replace(n,t),i.preserveCase){t=t.split("");for(var r=Math.min(e.length,e.length);r--;){var s=e[r];t[r]=s&&s.toLowerCase()!=s?t[r].toUpperCase():t[r].toLowerCase()}t=t.join("")}return t}},this.$matchIterator=function(e,t){var n=this.$assembleRegExp(t);if(!n)return!1;var r,s=this,a=t.backwards;if(t.$isMultiLine)var l=n.length,c=function(t,i,s){var a=t.search(n[0]);if(-1!=a){for(var c=1;l>c;c++)if(t=e.getLine(i+c),-1==t.search(n[c]))return;var h=t.match(n[l-1])[0].length,u=new o(i,a,i+l-1,h);return 1==n.offset?(u.start.row--,u.start.column=Number.MAX_VALUE):s&&(u.start.column+=s),r(u)?!0:void 0}};else if(a)var c=function(e,t,o){for(var s=i.getMatchOffsets(e,n),a=s.length-1;a>=0;a--)if(r(s[a],t,o))return!0};else var c=function(e,t,o){for(var s=i.getMatchOffsets(e,n),a=0;a<s.length;a++)if(r(s[a],t,o))return!0};return{forEach:function(i){r=i,s.$lineIterator(e,t).forEach(c)}}},this.$assembleRegExp=function(e,t){if(e.needle instanceof RegExp)return e.re=e.needle;var n=e.needle;if(!e.needle)return e.re=!1;e.regExp||(n=i.escapeRegExp(n)),e.wholeWord&&(n="\\b"+n+"\\b");var o=e.caseSensitive?"gm":"gmi";if(e.$isMultiLine=!t&&/[\n\r]/.test(n),e.$isMultiLine)return e.re=this.$assembleMultilineRegExp(n,o);try{var r=new RegExp(n,o)}catch(s){r=!1}return e.re=r},this.$assembleMultilineRegExp=function(e,t){for(var i=e.replace(/\r\n|\r|\n/g,"$\n^").split("\n"),n=[],o=0;o<i.length;o++)try{n.push(new RegExp(i[o],t))}catch(r){return!1}return""==i[0]?(n.shift(),n.offset=1):n.offset=0,n},this.$lineIterator=function(e,t){var i=1==t.backwards,n=0!=t.skipCurrent,o=t.range,r=t.start;r||(r=o?o[i?"end":"start"]:e.selection.getRange()),r.start&&(r=r[n!=i?"end":"start"]);var s=o?o.start.row:0,a=o?o.end.row:e.getLength()-1,l=i?function(i){var n=r.row,o=e.getLine(n).substring(0,r.column);if(!i(o,n)){for(n--;n>=s;n--)if(i(e.getLine(n),n))return;if(0!=t.wrap)for(n=a,s=r.row;n>=s;n--)if(i(e.getLine(n),n))return}}:function(i){var n=r.row,o=e.getLine(n).substr(r.column);if(!i(o,n,r.column)){for(n+=1;a>=n;n++)if(i(e.getLine(n),n))return;if(0!=t.wrap)for(n=s,a=r.row;a>=n;n++)if(i(e.getLine(n),n))return}};return{forEach:l}}}).call(r.prototype),t.Search=r}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t){"use strict";function i(e,t){this.platform=t||(r.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=!0}function n(e,t){i.call(this,e,t),this.$singleCommand=!1}var o=e("../lib/keys"),r=e("../lib/useragent"),s=o.KEY_MODS;n.prototype=i.prototype,function(){this.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),this.commands[e.name]=e,e.bindKey&&this._buildKeyHash(e)},this.removeCommand=function(e,t){var i=e&&("strin
else if(t.$mode.getMatching)var n=t.$mode.getMatching(e.session);n&&(t.$bracketHighlight=t.addMarker(n,"ace_bracket","text"))}},50)}},this.$highlightTags=function(){if(!this.$highlightTagPending){var e=this;this.$highlightTagPending=!0,setTimeout(function(){e.$highlightTagPending=!1;var t=e.session;if(t&&t.bgTokenizer){var i=e.getCursorPosition(),n=new v(e.session,i.row,i.column),o=n.getCurrentToken();if(!o||-1===o.type.indexOf("tag-name"))return t.removeMarker(t.$tagHighlight),void(t.$tagHighlight=null);var r=o.value,s=0,a=n.stepBackward();if("<"==a.value){do a=o,o=n.stepForward(),o&&o.value===r&&-1!==o.type.indexOf("tag-name")&&("<"===a.value?s++:"</"===a.value&&s--);while(o&&s>=0)}else{do o=a,a=n.stepBackward(),o&&o.value===r&&-1!==o.type.indexOf("tag-name")&&("<"===a.value?s++:"</"===a.value&&s--);while(a&&0>=s);n.stepForward()}if(!o)return t.removeMarker(t.$tagHighlight),void(t.$tagHighlight=null);var l=n.getCurrentTokenRow(),c=n.getCurrentTokenColumn(),h=new d(l,c,l,c+o.value.length);t.$tagHighlight&&0!==h.compareRange(t.$backMarkers[t.$tagHighlight].range)&&(t.removeMarker(t.$tagHighlight),t.$tagHighlight=null),h&&!t.$tagHighlight&&(t.$tagHighlight=t.addMarker(h,"ace_bracket","text"))}},50)}},this.focus=function(){var e=this;setTimeout(function(){e.textInput.focus()}),this.textInput.focus()},this.isFocused=function(){return this.textInput.isFocused()},this.blur=function(){this.textInput.blur()},this.onFocus=function(e){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",e))},this.onBlur=function(e){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",e))},this.$cursorChange=function(){this.renderer.updateCursor()},this.onDocumentChange=function(e){var t,i=e.data,n=i.range;t=n.start.row==n.end.row&&"insertLines"!=i.action&&"removeLines"!=i.action?n.end.row:1/0,this.renderer.updateLines(n.start.row,t,this.session.$useWrapMode),this._signal("change",e),this.$cursorChange(),this.$updateHighlightActiveLine()},this.onTokenizerUpdate=function(e){var t=e.data;this.renderer.updateLines(t.first,t.last)},this.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},this.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},this.onCursorChange=function(){this.$cursorChange(),this.$blockScrolling||this.renderer.scrollCursorIntoView(),this.$highlightBrackets(),this.$highlightTags(),this.$updateHighlightActiveLine(),this._signal("changeSelection")},this.$updateHighlightActiveLine=function(){var e,t=this.getSession();if(this.$highlightActiveLine&&("line"==this.$selectionStyle&&this.selection.isMultiLine()||(e=this.getCursorPosition()),!this.renderer.$maxLines||1!==this.session.getLength()||this.renderer.$minLines>1||(e=!1)),t.$highlightLineMarker&&!e)t.removeMarker(t.$highlightLineMarker.id),t.$highlightLineMarker=null;else if(!t.$highlightLineMarker&&e){var i=new d(e.row,e.column,e.row,1/0);i.id=t.addMarker(i,"ace_active-line","screenLine"),t.$highlightLineMarker=i}else e&&(t.$highlightLineMarker.start.row=e.row,t.$highlightLineMarker.end.row=e.row,t.$highlightLineMarker.start.column=e.column,t._signal("changeBackMarker"))},this.onSelectionChange=function(){var e=this.session;if(e.$selectionMarker&&e.removeMarker(e.$selectionMarker),e.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var t=this.selection.getRange(),i=this.getSelectionStyle();e.$selectionMarker=e.addMarker(t,"ace_selection",i)}var n=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(n),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(!t.isEmpty()&&!t.isMultiLine()){var i=t.start.column-1,n=t.end.column+1,o=e.getLine(t.start.row),r=o.length,s=o.substring(Math.max(i,0),Math.min(n,r));if(!(i>=0&&/^[\w\d]/.test(s)||r>=n&&/[\w\d]$/.test(s))&&(s=o.substring(t.start.column,t.end.column),/^[\w\d]+$/.test(s))){var a=this.$search.$assembleRegExp({wh
},this.getRegion=function(e){var t=this.$padding||this.$computePadding(),i=this.element.getBoundingClientRect();return e.x<t.left+i.left?"markers":this.$showFoldWidgets&&e.x>i.right-t.right?"foldWidgets":void 0}}).call(s.prototype),t.Gutter=s}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(e,t){"use strict";var i=e("../range").Range,n=e("../lib/dom"),o=function(e){this.element=n.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)};(function(){this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setMarkers=function(e){this.markers=e},this.update=function(e){var e=e||this.config;if(e){this.config=e;var t=[];for(var i in this.markers){var n=this.markers[i];if(n.range){var o=n.range.clipRows(e.firstRow,e.lastRow);if(!o.isEmpty())if(o=o.toScreenRange(this.session),n.renderer){var r=this.$getTop(o.start.row,e),s=this.$padding+o.start.column*e.characterWidth;n.renderer(t,o,s,r,e)}else"fullLine"==n.type?this.drawFullLineMarker(t,o,n.clazz,e):"screenLine"==n.type?this.drawScreenLineMarker(t,o,n.clazz,e):o.isMultiLine()?"text"==n.type?this.drawTextMarker(t,o,n.clazz,e):this.drawMultiLineMarker(t,o,n.clazz,e):this.drawSingleLineMarker(t,o,n.clazz+" ace_start",e)}else n.update(t,this,this.session,e)}this.element.innerHTML=t.join("")}},this.$getTop=function(e,t){return(e-t.firstRowScreen)*t.lineHeight},this.drawTextMarker=function(e,t,n,o,r){var s=t.start.row,a=new i(s,t.start.column,s,this.session.getScreenLastRowColumn(s));for(this.drawSingleLineMarker(e,a,n+" ace_start",o,1,r),s=t.end.row,a=new i(s,0,s,t.end.column),this.drawSingleLineMarker(e,a,n,o,0,r),s=t.start.row+1;s<t.end.row;s++)a.start.row=s,a.end.row=s,a.end.column=this.session.getScreenLastRowColumn(s),this.drawSingleLineMarker(e,a,n,o,1,r)},this.drawMultiLineMarker=function(e,t,i,n,o){var r=this.$padding,s=n.lineHeight,a=this.$getTop(t.start.row,n),l=r+t.start.column*n.characterWidth;o=o||"",e.push("<div class='",i," ace_start' style='","height:",s,"px;","right:0;","top:",a,"px;","left:",l,"px;",o,"'></div>"),a=this.$getTop(t.end.row,n);var c=t.end.column*n.characterWidth;e.push("<div class='",i,"' style='","height:",s,"px;","width:",c,"px;","top:",a,"px;","left:",r,"px;",o,"'></div>"),s=(t.end.row-t.start.row-1)*n.lineHeight,0>s||(a=this.$getTop(t.start.row+1,n),e.push("<div class='",i,"' style='","height:",s,"px;","right:0;","top:",a,"px;","left:",r,"px;",o,"'></div>"))},this.drawSingleLineMarker=function(e,t,i,n,o,r){var s=n.lineHeight,a=(t.end.column+(o||0)-t.start.column)*n.characterWidth,l=this.$getTop(t.start.row,n),c=this.$padding+t.start.column*n.characterWidth;e.push("<div class='",i,"' style='","height:",s,"px;","width:",a,"px;","top:",l,"px;","left:",c,"px;",r||"","'></div>")},this.drawFullLineMarker=function(e,t,i,n,o){var r=this.$getTop(t.start.row,n),s=n.lineHeight;t.start.row!=t.end.row&&(s+=this.$getTop(t.end.row,n)-r),e.push("<div class='",i,"' style='","height:",s,"px;","top:",r,"px;","left:0;right:0;",o||"","'></div>")},this.drawScreenLineMarker=function(e,t,i,n,o){var r=this.$getTop(t.start.row,n),s=n.lineHeight;e.push("<div class='",i,"' style='","height:",s,"px;","top:",r,"px;","left:0;right:0;",o||"","'></div>")}}).call(o.prototype),t.Marker=o}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/lib/event_emitter"],function(e,t){"use strict";var i=e("../lib/oop"),n=e("../lib/dom"),o=e("../lib/lang"),r=(e("../lib/useragent"),e("../lib/event_emitter").EventEmitter),s=function(e){this.element=n.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this)};(function(){i.implement(this,r),this.EOF_CHAR="¶",this.EOL_CHAR_LF="¬",this.EOL_CHAR_CRLF="¤",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="→",this.SPACE_CHAR="·",this.$padding=0,this.$updateEolChar=function(){var e="\n"==this.session.doc.getNewLineCharacter()?this.EOL_CHAR_LF:
2015-02-28 05:21:31 +08:00
n.importCssString(p,"ace_editor");var m=function(e,t){var i=this;this.container=e||n.createElement("div"),this.$keepTextAreaAtCursor=!r.isOldIE,n.addCssClass(this.container,"ace_editor"),this.setTheme(t),this.$gutter=n.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.scroller=n.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=n.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new s(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new a(this.content);var f=this.$textLayer=new l(this.content);this.canvas=f.element,this.$markerFront=new a(this.content),this.$cursorLayer=new c(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new u(this.container,this),this.scrollBarH=new h(this.container,this),this.scrollBarV.addEventListener("scroll",function(e){i.$scrollAnimation||i.session.setScrollTop(e.data-i.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(e){i.$scrollAnimation||i.session.setScrollLeft(e.data-i.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new g(this.container,500),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.addEventListener("changeCharacterSize",function(e){i.updateCharacterSize(),i.onResize(!0,i.gutterWidth,i.$size.width,i.$size.height),i._signal("changeCharacterSize",e)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$loop=new d(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),o.resetOptions(this),o._emit("renderer",this)};(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,i.implement(this,f),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin()},this.setSession=function(e){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=e,e&&this.scrollMargin.top&&e.getScrollTop()<=0&&e.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(e),this.$markerBack.setSession(e),this.$markerFront.setSession(e),this.$gutterLayer.setSession(e),this.$textLayer.setSession(e),e&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},this.updateLines=function(e,t,i){if(void 0===t&&(t=1/0),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRow<t&&(this.$changedLines.lastRow=t)):this.$changedLines={firstRow:e,lastRow:t},this.$changedLines.lastRow<this.layerConfig.firstRow){if(!i)return;this.$changedLines.lastRow=this.layerConfig.lastRow}this.$changedLines.firstRow>this.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar()},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop
}},this.onUpdate=function(e){var t=e.data,n=t.range;if(n.start.row===n.end.row&&n.start.row===this.pos.row&&!this.$updating){this.$updating=!0;var o="insertText"===t.action?n.end.column-n.start.column:n.start.column-n.end.column;if(n.start.column>=this.pos.column&&n.start.column<=this.pos.column+this.length+1){var r=n.start.column-this.pos.column;if(this.length+=o,!this.session.$fromUndo){if("insertText"===t.action)for(var s=this.others.length-1;s>=0;s--){var a=this.others[s],l={row:a.row,column:a.column+r};a.row===n.start.row&&n.start.column<a.column&&(l.column+=o),this.doc.insert(l,t.text)}else if("removeText"===t.action)for(var s=this.others.length-1;s>=0;s--){var a=this.others[s],l={row:a.row,column:a.column+r};a.row===n.start.row&&n.start.column<a.column&&(l.column+=o),this.doc.remove(new i(l.row,l.column,l.row,l.column-o))}n.start.column===this.pos.column&&"insertText"===t.action?setTimeout(function(){this.pos.setPosition(this.pos.row,this.pos.column-o);for(var e=0;e<this.others.length;e++){var t=this.others[e],i={row:t.row,column:t.column-o};t.row===n.start.row&&n.start.column<t.column&&(i.column+=o),t.setPosition(i.row,i.column)}}.bind(this),0):n.start.column===this.pos.column&&"removeText"===t.action&&setTimeout(function(){for(var e=0;e<this.others.length;e++){var t=this.others[e];t.row===n.start.row&&n.start.column<t.column&&t.setPosition(t.row,t.column-o)}}.bind(this),0)}this.pos._emit("change",{value:this.pos});for(var s=0;s<this.others.length;s++)this.others[s]._emit("change",{value:this.others[s]})}this.$updating=!1}},this.onCursorChange=function(e){if(!this.$updating&&this.session){var t=this.session.selection.getCursor();t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(this.hideOtherMarkers(),this._emit("cursorLeave",e))}},this.detach=function(){this.session.removeMarker(this.markerId),this.hideOtherMarkers(),this.doc.removeEventListener("change",this.$onUpdate),this.session.selection.removeEventListener("changeCursor",this.$onCursorChange),this.pos.detach();for(var e=0;e<this.others.length;e++)this.others[e].detach();this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(-1===this.$undoStackDepth)throw Error("Canceling placeholders only supported with undo manager attached to session.");for(var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,i=0;t>i;i++)e.undo(!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}}).call(r.prototype),t.PlaceHolder=r}),ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t){function i(e,t){return e.row==t.row&&e.column==t.column}function n(e){var t=e.domEvent,n=t.altKey,s=t.shiftKey,a=t.ctrlKey,l=e.getAccelKey(),c=e.getButton();if(a&&r.isMac&&(c=t.button),e.editor.inMultiSelectMode&&2==c)return void e.editor.textInput.onContextMenu(e.domEvent);if(!a&&!n&&!l)return void(0===c&&e.editor.inMultiSelectMode&&e.editor.exitMultiSelectMode());if(0===c){var h,u=e.editor,d=u.selection,g=u.inMultiSelectMode,f=e.getDocumentPosition(),p=d.getCursor(),m=e.inSelection()||d.isEmpty()&&i(f,p),v=e.x,A=e.y,w=function(e){v=e.clientX,A=e.clientY},C=u.session,E=u.renderer.pixelToScreenCoordinates(v,A),F=E;if(u.$mouseHandler.$enableJumpToDef)a&&n||l&&n?h="add":n&&(h="block");else if(l&&!n){if(h="add",!g&&s)return}else n&&(h="block");if(h&&r.isMac&&t.ctrlKey&&u.$mouseHandler.cancelContextMenu(),"add"==h){if(!g&&m)return;if(!g){var y=d.toOrientedRange();u.addSelectionMarker(y)}var b=d.rangeList.rangeAtPoint(f);u.$blockScrolling++,u.inVirtualSelectionMode=!0,s&&(b=null,y=d.ranges[0],u.removeSelectionMarker(y)),u.once("mouseup",function(){var e=d.toOrientedRange();b&&e.isEmpty()&&i(b.cursor,e.cursor)?d.substractPoint(e.cursor):(s?d.substractPoint(y.cursor):y&&(u.removeSelectionMarker(y),d.addRange(y)),d.addRange(e)),u.$blockScrolling--,u.inVirtualSelectionMode=!1})}else if("block"==h){e.stop(),u.inVirtualSelectionMode=!0;var x,S=[],$=function(){var e
var p=e.renderer.$cursorLayer.getPixelPosition(s).left;f.style.left=p+e.renderer.gutterWidth-5+"px",d.el.className="error_widget_wrapper",g.className="error_widget "+c.className,g.innerHTML=c.text.join("<br>"),g.appendChild(r.createElement("div"));var m=function(e,t,i){return 0!==t||"esc"!==i&&"return"!==i?void 0:(d.destroy(),{command:"null"})};d.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(m),i.widgetManager.removeLineWidget(d),e.off("changeSelection",d.destroy),e.off("changeSession",d.destroy),e.off("mouseup",d.destroy),e.off("change",d.destroy))},e.keyBinding.addKeyboardHandler(m),e.on("changeSelection",d.destroy),e.on("changeSession",d.destroy),e.on("mouseup",d.destroy),e.on("change",d.destroy),e.session.widgetManager.addLineWidget(d),d.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:d.el.offsetHeight})},r.importCssString(" .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; } ","")}),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],function(e,t){"use strict";e("./lib/fixoldbrowsers");var i=e("./lib/dom"),n=e("./lib/event"),o=e("./editor").Editor,r=e("./edit_session").EditSession,s=e("./undomanager").UndoManager,a=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),t.config=e("./config"),t.acequire=e,t.edit=function(e){if("string"==typeof e){var r=e;if(e=document.getElementById(r),!e)throw new Error("ace.edit can't find div #"+r)}if(e&&e.env&&e.env.editor instanceof o)return e.env.editor;var s="";if(e&&/input|textarea/i.test(e.tagName)){var l=e;s=l.value,e=i.createElement("pre"),l.parentNode.replaceChild(e,l)}else s=i.getInnerText(e),e.innerHTML="";var c=t.createEditSession(s),h=new o(new a(e));h.setSession(c);var u={document:c,editor:h,onResize:h.resize.bind(h,null)};return l&&(u.textarea=l),n.addListener(window,"resize",u.onResize),h.on("destroy",function(){n.removeListener(window,"resize",u.onResize),u.editor.container.env=null}),h.container.env=h.env=u,h},t.createEditSession=function(e,t){var i=new r(e,t);return i.setUndoManager(new s),i},t.EditSession=r,t.UndoManager=s}),function(){ace.acequire(["ace/ace"],function(e){e&&e.config.init(!0),window.ace||(window.ace=e);for(var t in e)e.hasOwnProperty(t)&&(window.ace[t]=e[t])})}(),e.exports=window.ace.acequire("ace/ace")},function(e,t,i){ace.define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t){"use strict";var i=e("../lib/oop"),n=e("./text_highlight_rules").TextHighlightRules,o=function(){this.$rules={start:[{token:"variable",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'},{token:"string",regex:'"',next:"string"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d
case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},e.rules=[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],e.conditions={INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}},e}();return e.lexer=t,e}();t.parser=o,t.parse=function(){return o.parse.apply(o,arguments)},t.main=function(n){if(!n[1])throw new Error("Usage: "+n[0]+" FILE");if("undefined"!=typeof e)var o=i(!function(){var e=new Error('Cannot find module "fs"');throw e.code="MODULE_NOT_FOUND",e}()).readFileSync(i(19).join(e.cwd(),n[1]),"utf8");else var r=i(!function(){var e=new Error('Cannot find module "file"');throw e.code="MODULE_NOT_FOUND",e}()).path(i(!function(){var e=new Error('Cannot find module "file"');throw e.code="MODULE_NOT_FOUND",e}()).cwd()),o=r.join(n[1]).read({charset:"utf-8"});return t.parser.parse(o)},"undefined"!=typeof n&&i.c[0]===n&&t.main("undefined"!=typeof e?e.argv.slice(1):i(!function(){var e=new Error('Cannot find module "system"');throw e.code="MODULE_NOT_FOUND",e}()).args)}).call(t,i(20),i(18)(e))},function(e,t,i){function n(e,t){function i(e,t,o){o.forEach(function(o){if("separator"==o.type){var r=document.createElement("div");r.className="separator",a=document.createElement("li"),a.appendChild(r),e.appendChild(a)}else{var s={},a=document.createElement("li");e.appendChild(a);var l=document.createElement("button");if(l.className=o.className,s.button=l,o.title&&(l.title=o.title),o.click&&(l.onclick=function(){n.hide(),o.click()}),a.appendChild(l),o.submenu){var c=document.createElement("div");c.className="icon",l.appendChild(c),l.appendChild(document.createTextNode(o.text));var h;if(o.click){l.className+=" default";var u=document.createElement("button");s.buttonExpand=u,u.className="expand",u.innerHTML='<div class="expand"></div>',a.appendChild(u),o.submenuTitle&&(u.title=o.submenuTitle),h=u}else{var d=document.createElement("div");d.className="expand",l.appendChild(d),h=l}h.onclick=function(){n._onExpandItem(s),h.focus()};var g=[];s.subItems=g;var f=document.createElement("ul");s.ul=f,f.className="menu",f.style.height="0",a.appendChild(f),i(f,g,o.submenu)}else l.innerHTML='<div class="icon"></div>'+o.text;t.push(s)}})}this.dom={};var n=this,o=this.dom;this.anchor=void 0,this.items=e,this.eventListeners={},this.selection=void 0,this.visibleSubmenu=void 0,this.onClose=t?t.close:void 0;var r=document.createElement("div");r.className="jsoneditor-contextmenu",o.menu=r;var s=document.createElement("ul");s.className="menu",r.appendChild(s),o.list=s,o.items=[];var a=document.createElement("button");o.focusButton=a;var l=document.createElement("li");l.style.overflow="hidden",l.style.height="0",l.appendChild(a),s.appendChild(l),i(s,this.dom.items,e),this.maxHeight=0,e.forEach(function(t){var i=24*(e.length+(t.submenu?t.submenu.length:0));n.maxHeight=Math.max(n.maxHeight,i)})}var o=i(3);n.prototype._getVisibleButtons=function(){var e=[],t=this;return this.dom.items.forEach(function(i){e.push(i.button),i.buttonExpand&&e.push(i.buttonExpand),i.subItems&&i==t.expandedItem&&i.subItems.forEach(function(t){e.push(t.button),t.buttonExpand&&e.push(t.buttonExpand)})}),e},n.visibleMenu=void 0,n.prototype.show=function(e){this.hide();var t=window.innerHeight,i=window.pageYOffset||document.scrollTop||0,r=t+i,s=e.offsetHeight,a=this.maxHeight,l=o.getAbsoluteLeft(e),c=o.getAbsoluteTop(e);r>c+s+a?(this.dom.menu.style.left=l+"px",this.dom.menu.style.top=c+s+"px",this.dom.menu.style.bottom=""):(this.dom.menu.style.left=l+"px",this.dom.menu.style.top="",this.dom.menu.style.bottom=t-c+"px"),document.body.appendChild(this.dom.menu);var h=this,u=this.dom.list;this.eventListeners.mousedown=o.addEventListener(document,"mousedown",function(e){var t=e.target;t==u||h._isChildOf(t,u)||(h.hide(),e.stopPropa
},function(e){e.exports=function(){throw new Error("define cannot be used indirect")}},function(e){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t,i){(function(e){function i(e,t){for(var i=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),i++):i&&(e.splice(n,1),i--)}if(t)for(;i--;i)e.unshift("..");return e}function n(e,t){if(e.filter)return e.filter(t);for(var i=[],n=0;n<e.length;n++)t(e[n],n,e)&&i.push(e[n]);return i}var o=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,r=function(e){return o.exec(e).slice(1)};t.resolve=function(){for(var t="",o=!1,r=arguments.length-1;r>=-1&&!o;r--){var s=r>=0?arguments[r]:e.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(t=s+"/"+t,o="/"===s.charAt(0))}return t=i(n(t.split("/"),function(e){return!!e}),!o).join("/"),(o?"/":"")+t||"."},t.normalize=function(e){var o=t.isAbsolute(e),r="/"===s(e,-1);return e=i(n(e.split("/"),function(e){return!!e}),!o).join("/"),e||o||(e="."),e&&r&&(e+="/"),(o?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(n(e,function(e){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},t.relative=function(e,i){function n(e){for(var t=0;t<e.length&&""===e[t];t++);for(var i=e.length-1;i>=0&&""===e[i];i--);return t>i?[]:e.slice(t,i-t+1)}e=t.resolve(e).substr(1),i=t.resolve(i).substr(1);for(var o=n(e.split("/")),r=n(i.split("/")),s=Math.min(o.length,r.length),a=s,l=0;s>l;l++)if(o[l]!==r[l]){a=l;break}for(var c=[],l=a;l<o.length;l++)c.push("..");return c=c.concat(r.slice(a)),c.join("/")},t.sep="/",t.delimiter=":",t.dirname=function(e){var t=r(e),i=t[0],n=t[1];return i||n?(n&&(n=n.substr(0,n.length-1)),i+n):"."},t.basename=function(e,t){var i=r(e)[2];return t&&i.substr(-1*t.length)===t&&(i=i.substr(0,i.length-t.length)),i},t.extname=function(e){return r(e)[3]};var s="b"==="ab".substr(-1)?function(e,t,i){return e.substr(t,i)}:function(e,t,i){return 0>t&&(t=e.length+t),e.substr(t,i)}}).call(t,i(20))},function(e){function t(){}var i=e.exports={};i.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.MutationObserver,i="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};var n=[];if(t){var o=document.createElement("div"),r=new MutationObserver(function(){var e=n.slice();n.length=0,e.forEach(function(e){e()})});return r.observe(o,{attributes:!0}),function(e){n.length||o.setAttribute("yes","no"),n.push(e)}}return i?(window.addEventListener("message",function(e){var t=e.source;if((t===window||null===t)&&"process-tick"===e.data&&(e.stopPropagation(),n.length>0)){var i=n.shift();i()}},!0),function(e){n.push(e),window.postMessage("process-tick","*")}):function(e){setTimeout(e,0)}}(),i.title="browser",i.browser=!0,i.env={},i.argv=[],i.on=t,i.addListener=t,i.once=t,i.off=t,i.removeListener=t,i.removeAllListeners=t,i.emit=t,i.binding=function(){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(){throw new Error("process.chdir is not supported")}},function(e,t){(function(t){function i(){if(t.Blob)try{return new Blob(["asdf"],{type:"text/plain"}),Blob}catch(e){}var i=t.WebKitBlobBuilder||t.MozBlobBuilder||t.MSBlobBuilder;return function(e,t){var n=new i,o=t.endings,r=t.type;if(o)for(var s=0,a=e.length;a>s;++s)n.append(e[s],o);else for(var s=0,a=e.length;a>s;++s)n.append(e[s]);return r?n.getBlob(r):n.getBlob()}}e.exports=i()}).call(t,function(){return this}())}])});
//# sourceMappingURL=jsoneditor.map