File "layouts-editor.min.js"

Full Path: /home/arielcor/public_html/wp-content/plugins/visual-portfolio/gutenberg/layouts-editor.min.js
File size: 850.8 KB
MIME-type: text/plain
Charset: utf-8

/*! For license information please see layouts-editor.js.LICENSE.txt */
!function(){var e={6657:function(e,t,n){e=n.nmd(e),function(){var e=function(){return this}();e||"undefined"==typeof window||(e=window);var t=function(e,n,i){"string"==typeof e?(2==arguments.length&&(i=n),t.modules[e]||(t.payloads[e]=i,t.modules[e]=null)):t.original?t.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace())};t.modules={},t.payloads={};var n,i=function(e,t,n){if("string"==typeof t){var i=s(e,t);if(null!=i)return n&&n(),i}else if("[object Array]"===Object.prototype.toString.call(t)){for(var r=[],a=0,l=t.length;a<l;++a){var c=s(e,t[a]);if(null==c&&o.original)return;r.push(c)}return n&&n.apply(null,r)||!0}},o=function(e,t){var n=i("",e,t);return null==n&&o.original?o.original.apply(this,arguments):n},r=function(e,t){if(-1!==t.indexOf("!")){var n=t.split("!");return r(e,n[0])+"!"+r(e,n[1])}if("."==t.charAt(0))for(t=e.split("/").slice(0,-1).join("/")+"/"+t;-1!==t.indexOf(".")&&i!=t;){var i=t;t=t.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}return t},s=function(e,n){n=r(e,n);var o=t.modules[n];if(!o){if("function"==typeof(o=t.payloads[n])){var s={},a={id:n,uri:"",exports:s,packaged:!0};s=o((function(e,t){return i(n,e,t)}),s,a)||a.exports,t.modules[n]=s,delete t.payloads[n]}o=t.modules[n]=s||o}return o};n=e,"ace"&&(e.ace||(e.ace={}),n=e.ace),n.define&&n.define.packaged||(t.original=n.define,n.define=t,n.define.packaged=!0),n.require&&n.require.packaged||(o.original=n.require,n.require=o,n.require.packaged=!0)}(),ace.define("ace/lib/fixoldbrowsers",["require","exports","module"],(function(e,t,n){"use strict";"undefined"==typeof Element||Element.prototype.remove||Object.defineProperty(Element.prototype,"remove",{enumerable:!1,writable:!0,configurable:!0,value:function(){this.parentNode&&this.parentNode.removeChild(this)}})})),ace.define("ace/lib/useragent",["require","exports","module"],(function(e,t,n){"use strict";t.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},t.getOS=function(){return t.isMac?t.OS.MAC:t.isLinux?t.OS.LINUX:t.OS.WINDOWS};var i="object"==typeof navigator?navigator:{},o=(/mac|win|linux/i.exec(i.platform)||["other"])[0].toLowerCase(),r=i.userAgent||"",s=i.appName||"";t.isWin="win"==o,t.isMac="mac"==o,t.isLinux="linux"==o,t.isIE="Microsoft Internet Explorer"==s||s.indexOf("MSAppHost")>=0?parseFloat((r.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((r.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=r.match(/ Gecko\/\d+/),t.isOpera="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(r.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(r.split(" Chrome/")[1])||void 0,t.isEdge=parseFloat(r.split(" Edge/")[1])||void 0,t.isAIR=r.indexOf("AdobeAIR")>=0,t.isAndroid=r.indexOf("Android")>=0,t.isChromeOS=r.indexOf(" CrOS ")>=0,t.isIOS=/iPad|iPhone|iPod/.test(r)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIOS||t.isAndroid})),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],(function(e,t,n){"use strict";var i,o=e("./useragent");t.buildDom=function e(t,n,i){if("string"==typeof t&&t){var o=document.createTextNode(t);return n&&n.appendChild(o),o}if(!Array.isArray(t))return t&&t.appendChild&&n&&n.appendChild(t),t;if("string"!=typeof t[0]||!t[0]){for(var r=[],s=0;s<t.length;s++){var a=e(t[s],n,i);a&&r.push(a)}return r}var l=document.createElement(t[0]),c=t[1],u=1;for(c&&"object"==typeof c&&!Array.isArray(c)&&(u=2),s=u;s<t.length;s++)e(t[s],l,i);return 2==u&&Object.keys(c).forEach((function(e){var t=c[e];"class"===e?l.className=Array.isArray(t)?t.join(" "):t:"function"==typeof t||"value"==e||"$"==e[0]?l[e]=t:"ref"===e?i&&(i[t]=l):"style"===e?"string"==typeof t&&(l.style.cssText=t):null!=t&&l.setAttribute(e,t)})),n&&n.appendChild(l),l},t.getDocumentHead=function(e){return e||(e=document),e.head||e.getElementsByTagName("head")[0]||e.documentElement},t.createElement=function(e,t){return document.createElementNS?document.createElementNS(t||"http://www.w3.org/1999/xhtml",e):document.createElement(e)},t.removeChildren=function(e){e.innerHTML=""},t.createTextNode=function(e,t){return(t?t.ownerDocument:document).createTextNode(e)},t.createFragment=function(e){return(e?e.ownerDocument:document).createDocumentFragment()},t.hasCssClass=function(e,t){return-1!==(e.className+"").split(/\s+/g).indexOf(t)},t.addCssClass=function(e,n){t.hasCssClass(e,n)||(e.className+=" "+n)},t.removeCssClass=function(e,t){for(var n=e.className.split(/\s+/g);;){var i=n.indexOf(t);if(-1==i)break;n.splice(i,1)}e.className=n.join(" ")},t.toggleCssClass=function(e,t){for(var n=e.className.split(/\s+/g),i=!0;;){var o=n.indexOf(t);if(-1==o)break;i=!1,n.splice(o,1)}return i&&n.push(t),e.className=n.join(" "),i},t.setCssClass=function(e,n,i){i?t.addCssClass(e,n):t.removeCssClass(e,n)},t.hasCssString=function(e,t){var n,i=0;if(n=(t=t||document).querySelectorAll("style"))for(;i<n.length;)if(n[i++].id===e)return!0};var r=[];function s(){var e=r;r=null,e&&e.forEach((function(e){a(e[0],e[1])}))}function a(e,n,o){if("undefined"!=typeof document){if(r)if(o)s();else if(!1===o)return r.push([e,n]);if(!i){var a=o;o&&o.getRootNode&&(a=o.getRootNode())&&a!=o||(a=document);var l=a.ownerDocument||a;if(n&&t.hasCssString(n,a))return null;n&&(e+="\n/*# sourceURL=ace/css/"+n+" */");var c=t.createElement("style");c.appendChild(l.createTextNode(e)),n&&(c.id=n),a==l&&(a=t.getDocumentHead(l)),a.insertBefore(c,a.firstChild)}}}if(t.useStrictCSP=function(e){i=e,0==e?s():r||(r=[])},t.importCssString=a,t.importCssStylsheet=function(e,n){t.buildDom(["link",{rel:"stylesheet",href:e}],t.getDocumentHead(n))},t.scrollbarWidth=function(e){var n=t.createElement("ace_inner");n.style.width="100%",n.style.minWidth="0px",n.style.height="200px",n.style.display="block";var i=t.createElement("ace_outer"),o=i.style;o.position="absolute",o.left="-10000px",o.overflow="hidden",o.width="200px",o.minWidth="0px",o.height="150px",o.display="block",i.appendChild(n);var r=e.documentElement;r.appendChild(i);var s=n.offsetWidth;o.overflow="scroll";var a=n.offsetWidth;return s==a&&(a=i.clientWidth),r.removeChild(i),s-a},t.computedStyle=function(e,t){return window.getComputedStyle(e,"")||{}},t.setStyle=function(e,t,n){e[t]!==n&&(e[t]=n)},t.HAS_CSS_ANIMATION=!1,t.HAS_CSS_TRANSFORMS=!1,t.HI_DPI=!o.isWin||"undefined"!=typeof window&&window.devicePixelRatio>=1.5,o.isChromeOS&&(t.HI_DPI=!1),"undefined"!=typeof document){var l=document.createElement("div");t.HI_DPI&&void 0!==l.style.transform&&(t.HAS_CSS_TRANSFORMS=!0),o.isEdge||void 0===l.style.animationName||(t.HAS_CSS_ANIMATION=!0),l=null}t.HAS_CSS_TRANSFORMS?t.translate=function(e,t,n){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(n)+"px)"}:t.translate=function(e,t,n){e.style.top=Math.round(n)+"px",e.style.left=Math.round(t)+"px"}})),ace.define("ace/lib/oop",["require","exports","module"],(function(e,t,n){"use strict";t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},t.implement=function(e,n){t.mixin(e,n)}})),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],(function(e,t,n){"use strict";var i=e("./oop"),o=function(){var e,t,n={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8,control:1},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}};for(t in n.FUNCTION_KEYS)e=n.FUNCTION_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);for(t in n.PRINTABLE_KEYS)e=n.PRINTABLE_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);return i.mixin(n,n.MODIFIER_KEYS),i.mixin(n,n.PRINTABLE_KEYS),i.mixin(n,n.FUNCTION_KEYS),n.enter=n.return,n.escape=n.esc,n.del=n.delete,n[173]="-",function(){for(var e=["cmd","ctrl","alt","shift"],t=Math.pow(2,e.length);t--;)n.KEY_MODS[t]=e.filter((function(e){return t&n.KEY_MODS[e]})).join("-")+"-"}(),n.KEY_MODS[0]="",n.KEY_MODS[-1]="input-",n}();i.mixin(t,o),t.keyCodeToString=function(e){var t=o[e];return"string"!=typeof t&&(t=String.fromCharCode(e)),t.toLowerCase()}})),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],(function(e,t,n){"use strict";var i,o=e("./keys"),r=e("./useragent"),s=null,a=0;function l(){return null==i&&function(){i=!1;try{document.createComment("").addEventListener("test",(function(){}),{get passive(){i={passive:!1}}})}catch(e){}}(),i}function c(e,t,n){this.elem=e,this.type=t,this.callback=n}c.prototype.destroy=function(){h(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var u=t.addListener=function(e,t,n,i){e.addEventListener(t,n,l()),i&&i.$toDestroy.push(new c(e,t,n))},h=t.removeListener=function(e,t,n){e.removeEventListener(t,n,l())};t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation&&e.stopPropagation()},t.preventDefault=function(e){e.preventDefault&&e.preventDefault()},t.getButton=function(e){return"dblclick"==e.type?0:"contextmenu"==e.type||r.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.button},t.capture=function(e,t,n){var i=e&&e.ownerDocument||document;function o(e){t&&t(e),n&&n(e),h(i,"mousemove",t),h(i,"mouseup",o),h(i,"dragstart",o)}return u(i,"mousemove",t),u(i,"mouseup",o),u(i,"dragstart",o),o},t.addMouseWheelListener=function(e,t,n){"onmousewheel"in e?u(e,"mousewheel",(function(e){void 0!==e.wheelDeltaX?(e.wheelX=-e.wheelDeltaX/8,e.wheelY=-e.wheelDeltaY/8):(e.wheelX=0,e.wheelY=-e.wheelDelta/8),t(e)}),n):"onwheel"in e?u(e,"wheel",(function(e){switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=.35*e.deltaX||0,e.wheelY=.35*e.deltaY||0;break;case e.DOM_DELTA_LINE:case e.DOM_DELTA_PAGE:e.wheelX=5*(e.deltaX||0),e.wheelY=5*(e.deltaY||0)}t(e)}),n):u(e,"DOMMouseScroll",(function(e){e.axis&&e.axis==e.HORIZONTAL_AXIS?(e.wheelX=5*(e.detail||0),e.wheelY=0):(e.wheelX=0,e.wheelY=5*(e.detail||0)),t(e)}),n)},t.addMultiMouseDownListener=function(e,n,i,o,s){var a,l,c,h=0,d={2:"dblclick",3:"tripleclick",4:"quadclick"};function p(e){if(0!==t.getButton(e)?h=0:e.detail>1?++h>4&&(h=1):h=1,r.isIE){var s=Math.abs(e.clientX-a)>5||Math.abs(e.clientY-l)>5;c&&!s||(h=1),c&&clearTimeout(c),c=setTimeout((function(){c=null}),n[h-1]||600),1==h&&(a=e.clientX,l=e.clientY)}if(e._clicks=h,i[o]("mousedown",e),h>4)h=0;else if(h>1)return i[o](d[h],e)}Array.isArray(e)||(e=[e]),e.forEach((function(e){u(e,"mousedown",p,s)}))};var d=function(e){return 0|(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)};function p(e,t,n){var i=d(t);if(!r.isMac&&s){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(i|=8),s.altGr){if(3==(3&i))return;s.altGr=0}if(18===n||17===n){var l="location"in t?t.location:t.keyLocation;17===n&&1===l?1==s[n]&&(a=t.timeStamp):18===n&&3===i&&2===l&&t.timeStamp-a<50&&(s.altGr=!0)}}if(n in o.MODIFIER_KEYS&&(n=-1),i||13!==n||3!==(l="location"in t?t.location:t.keyLocation)||(e(t,i,-n),!t.defaultPrevented)){if(r.isChromeOS&&8&i){if(e(t,i,n),t.defaultPrevented)return;i&=-9}return!!(i||n in o.FUNCTION_KEYS||n in o.PRINTABLE_KEYS)&&e(t,i,n)}}function f(){s=Object.create(null)}if(t.getModifierString=function(e){return o.KEY_MODS[d(e)]},t.addCommandKeyListener=function(e,n,i){if(r.isOldGecko||r.isOpera&&!("KeyboardEvent"in window)){var o=null;u(e,"keydown",(function(e){o=e.keyCode}),i),u(e,"keypress",(function(e){return p(n,e,o)}),i)}else{var a=null;u(e,"keydown",(function(e){s[e.keyCode]=(s[e.keyCode]||0)+1;var t=p(n,e,e.keyCode);return a=e.defaultPrevented,t}),i),u(e,"keypress",(function(e){a&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),a=null)}),i),u(e,"keyup",(function(e){s[e.keyCode]=null}),i),s||(f(),u(window,"focus",f))}},"object"==typeof window&&window.postMessage&&!r.isOldIE){var g=1;t.nextTick=function(e,n){n=n||window;var i="zero-timeout-message-"+g++,o=function(r){r.data==i&&(t.stopPropagation(r),h(n,"message",o),e())};u(n,"message",o),n.postMessage(i,"*")}}t.$idleBlocked=!1,t.onIdle=function(e,n){return setTimeout((function n(){t.$idleBlocked?setTimeout(n,100):e()}),n)},t.$idleBlockId=null,t.blockIdle=function(e){t.$idleBlockId&&clearTimeout(t.$idleBlockId),t.$idleBlocked=!0,t.$idleBlockId=setTimeout((function(){t.$idleBlocked=!1}),e||100)},t.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}})),ace.define("ace/range",["require","exports","module"],(function(e,t,n){"use strict";var i=function(e,t,n,i){this.start={row:e,column:t},this.end={row:n,column:i}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return 0==this.compare(e,t)},this.compareRange=function(e){var t,n=e.end,i=e.start;return 1==(t=this.compare(n.row,n.column))?1==(t=this.compare(i.row,i.column))?2:0==t?1:0:-1==t?-2:-1==(t=this.compare(i.row,i.column))?-1:1==t?42:0},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},this.intersects=function(e){var t=this.compareRange(e);return-1==t||0==t||1==t},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){"object"==typeof e?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){"object"==typeof e?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)&&!this.isStart(e,t)},this.insideStart=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)},this.insideEnd=function(e,t){return 0==this.compare(e,t)&&!this.isStart(e,t)},this.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?e<this.start.row?-1:e>this.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0:t<this.start.column?-1:t>this.end.column?1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var n={row:t+1,column:0};else this.end.row<e&&(n={row:e,column:0});if(this.start.row>t)var o={row:t+1,column:0};else this.start.row<e&&(o={row:e,column:0});return i.fromPoints(o||this.start,n||this.end)},this.extend=function(e,t){var n=this.compare(e,t);if(0==n)return this;if(-1==n)var o={row:e,column:t};else var r={row:e,column:t};return i.fromPoints(o||this.start,r||this.end)},this.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},this.isMultiLine=function(){return this.start.row!==this.end.row},this.clone=function(){return i.fromPoints(this.start,this.end)},this.collapseRows=function(){return 0==this.end.column?new i(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new i(this.start.row,0,this.end.row,0)},this.toScreenRange=function(e){var t=e.documentToScreenPosition(this.start),n=e.documentToScreenPosition(this.end);return new i(t.row,t.column,n.row,n.column)},this.moveBy=function(e,t){this.start.row+=e,this.start.column+=t,this.end.row+=e,this.end.column+=t}}).call(i.prototype),i.fromPoints=function(e,t){return new i(e.row,e.column,t.row,t.column)},i.comparePoints=function(e,t){return e.row-t.row||e.column-t.column},i.comparePoints=function(e,t){return e.row-t.row||e.column-t.column},t.Range=i})),ace.define("ace/lib/lang",["require","exports","module"],(function(e,t,n){"use strict";t.last=function(e){return e[e.length-1]},t.stringReverse=function(e){return e.split("").reverse().join("")},t.stringRepeat=function(e,t){for(var n="";t>0;)1&t&&(n+=e),(t>>=1)&&(e+=e);return n};var i=/^\s\s*/,o=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(i,"")},t.stringTrimRight=function(e){return e.replace(o,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){for(var t=[],n=0,i=e.length;n<i;n++)e[n]&&"object"==typeof e[n]?t[n]=this.copyObject(e[n]):t[n]=e[n];return t},t.deepCopy=function e(t){if("object"!=typeof t||!t)return t;var n;if(Array.isArray(t)){n=[];for(var i=0;i<t.length;i++)n[i]=e(t[i]);return n}if("[object Object]"!==Object.prototype.toString.call(t))return t;for(var i in n={},t)n[i]=e(t[i]);return n},t.arrayToMap=function(e){for(var t={},n=0;n<e.length;n++)t[e[n]]=1;return t},t.createMap=function(e){var t=Object.create(null);for(var n in e)t[n]=e[n];return t},t.arrayRemove=function(e,t){for(var n=0;n<=e.length;n++)t===e[n]&&e.splice(n,1)},t.escapeRegExp=function(e){return e.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},t.escapeHTML=function(e){return(""+e).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},t.getMatchOffsets=function(e,t){var n=[];return e.replace(t,(function(e){n.push({offset:arguments[arguments.length-2],length:e.length})})),n},t.deferredCall=function(e){var t=null,n=function(){t=null,e()},i=function(e){return i.cancel(),t=setTimeout(n,e||0),i};return i.schedule=i,i.call=function(){return this.cancel(),e(),i},i.cancel=function(){return clearTimeout(t),t=null,i},i.isPending=function(){return t},i},t.delayedCall=function(e,t){var n=null,i=function(){n=null,e()},o=function(e){null==n&&(n=setTimeout(i,e||t))};return o.delay=function(e){n&&clearTimeout(n),n=setTimeout(i,e||t)},o.schedule=o,o.call=function(){this.cancel(),e()},o.cancel=function(){n&&clearTimeout(n),n=null},o.isPending=function(){return n},o}})),ace.define("ace/clipboard",["require","exports","module"],(function(e,t,n){"use strict";var i;n.exports={lineMode:!1,pasteCancelled:function(){return!!(i&&i>Date.now()-50)||(i=!1)},cancel:function(){i=Date.now()}}})),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],(function(e,t,n){"use strict";var i=e("../lib/event"),o=e("../lib/useragent"),r=e("../lib/dom"),s=e("../lib/lang"),a=e("../clipboard"),l=o.isChrome<18,c=o.isIE,u=o.isChrome>63,h=400,d=e("../lib/keys"),p=d.KEY_MODS,f=o.isIOS,g=f?/\s/:/\n/,m=o.isMobile;t.TextInput=function(e,t){var n=r.createElement("textarea");n.className="ace_text-input",n.setAttribute("wrap","off"),n.setAttribute("autocorrect","off"),n.setAttribute("autocapitalize","off"),n.setAttribute("spellcheck",!1),n.style.opacity="0",e.insertBefore(n,e.firstChild);var v=!1,b=!1,w=!1,y=!1,x="";m||(n.style.fontSize="1px");var C=!1,S=!1,k="",$=0,E=0,_=0;try{var L=document.activeElement===n}catch(e){}i.addListener(n,"blur",(function(e){S||(t.onBlur(e),L=!1)}),t),i.addListener(n,"focus",(function(e){if(!S){if(L=!0,o.isEdge)try{if(!document.hasFocus())return}catch(e){}t.onFocus(e),o.isEdge?setTimeout(A):A()}}),t),this.$focusScroll=!1,this.focus=function(){if(x||u||"browser"==this.$focusScroll)return n.focus({preventScroll:!0});var e=n.style.top;n.style.position="fixed",n.style.top="0px";try{var t=0!=n.getBoundingClientRect().top}catch(e){return}var i=[];if(t)for(var o=n.parentElement;o&&1==o.nodeType;)i.push(o),o.setAttribute("ace_nocontext",!0),o=!o.parentElement&&o.getRootNode?o.getRootNode().host:o.parentElement;n.focus({preventScroll:!0}),t&&i.forEach((function(e){e.removeAttribute("ace_nocontext")})),setTimeout((function(){n.style.position="","0px"==n.style.top&&(n.style.top=e)}),0)},this.blur=function(){n.blur()},this.isFocused=function(){return L},t.on("beforeEndOperation",(function(){var e=t.curOp,i=e&&e.command&&e.command.name;if("insertstring"!=i){var o=i&&(e.docChanged||e.selectionChanged);w&&o&&(k=n.value="",B()),A()}}));var A=f?function(e){if(L&&(!v||e)&&!y){e||(e="");var i="\n ab"+e+"cde fg\n";i!=n.value&&(n.value=k=i);var o=4+(e.length||(t.selection.isEmpty()?0:1));4==$&&E==o||n.setSelectionRange(4,o),$=4,E=o}}:function(){if(!w&&!y&&(L||M)){w=!0;var e=0,i=0,o="";if(t.session){var r=t.selection,s=r.getRange(),a=r.cursor.row;if(e=s.start.column,i=s.end.column,o=t.session.getLine(a),s.start.row!=a){var l=t.session.getLine(a-1);e=s.start.row<a-1?0:e,i+=l.length+1,o=l+"\n"+o}else if(s.end.row!=a){var c=t.session.getLine(a+1);i=s.end.row>a+1?c.length:i,i+=o.length+1,o=o+"\n"+c}else m&&a>0&&(o="\n"+o,i+=1,e+=1);o.length>h&&(e<h&&i<h?o=o.slice(0,h):(o="\n",e==i?e=i=0:(e=0,i=1)))}var u=o+"\n\n";if(u!=k&&(n.value=k=u,$=E=u.length),M&&($=n.selectionStart,E=n.selectionEnd),E!=i||$!=e||n.selectionEnd!=E)try{n.setSelectionRange(e,i),$=e,E=i}catch(e){}w=!1}};this.resetSelection=A,L&&t.onFocus();var R=null;this.setInputHandler=function(e){R=e},this.getInputHandler=function(){return R};var M=!1,O=function(e,i){if(M&&(M=!1),b)return A(),e&&t.onPaste(e),b=!1,"";for(var r=n.selectionStart,s=n.selectionEnd,a=$,l=k.length-E,c=e,u=e.length-r,h=e.length-s,d=0;a>0&&k[d]==e[d];)d++,a--;for(c=c.slice(d),d=1;l>0&&k.length-d>$-1&&k[k.length-d]==e[e.length-d];)d++,l--;u-=d-1,h-=d-1;var p=c.length-d+1;if(p<0&&(a=-p,p=0),c=c.slice(0,p),!(i||c||u||a||l||h))return"";y=!0;var f=!1;return o.isAndroid&&". "==c&&(c="  ",f=!0),c&&!a&&!l&&!u&&!h||C?t.onTextInput(c):t.onTextInput(c,{extendLeft:a,extendRight:l,restoreStart:u,restoreEnd:h}),y=!1,k=e,$=r,E=s,_=h,f?"\n":c},T=function(e){if(w)return z();if(e&&e.inputType){if("historyUndo"==e.inputType)return t.execCommand("undo");if("historyRedo"==e.inputType)return t.execCommand("redo")}var i=n.value,o=O(i,!0);(i.length>500||g.test(o)||m&&$<1&&$==E)&&A()},I=function(e,t,n){var i=e.clipboardData||window.clipboardData;if(i&&!l){var o=c||n?"Text":"text/plain";try{return t?!1!==i.setData(o,t):i.getData(o)}catch(e){if(!n)return I(e,t,!0)}}},P=function(e,o){var r=t.getCopyText();if(!r)return i.preventDefault(e);I(e,r)?(f&&(A(r),v=r,setTimeout((function(){v=!1}),10)),o?t.onCut():t.onCopy(),i.preventDefault(e)):(v=!0,n.value=r,n.select(),setTimeout((function(){v=!1,A(),o?t.onCut():t.onCopy()})))},D=function(e){P(e,!0)},F=function(e){P(e,!1)},N=function(e){var r=I(e);a.pasteCancelled()||("string"==typeof r?(r&&t.onPaste(r,e),o.isIE&&setTimeout(A),i.preventDefault(e)):(n.value="",b=!0))};i.addCommandKeyListener(n,t.onCommandKey.bind(t),t),i.addListener(n,"select",(function(e){w||(v?v=!1:function(e){return 0===e.selectionStart&&e.selectionEnd>=k.length&&e.value===k&&k&&e.selectionEnd!==E}(n)?(t.selectAll(),A()):m&&n.selectionStart!=$&&A())}),t),i.addListener(n,"input",T,t),i.addListener(n,"cut",D,t),i.addListener(n,"copy",F,t),i.addListener(n,"paste",N,t),"oncut"in n&&"oncopy"in n&&"onpaste"in n||i.addListener(e,"keydown",(function(e){if((!o.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:F(e);break;case 86:N(e);break;case 88:D(e)}}),t);var z=function(){if(w&&t.onCompositionUpdate&&!t.$readOnly){if(C)return j();if(w.useTextareaForIME)t.onCompositionUpdate(n.value);else{var e=n.value;O(e),w.markerRange&&(w.context&&(w.markerRange.start.column=w.selectionStart=w.context.compositionStartOffset),w.markerRange.end.column=w.markerRange.start.column+E-w.selectionStart+_)}}},B=function(e){t.onCompositionEnd&&!t.$readOnly&&(w=!1,t.onCompositionEnd(),t.off("mousedown",j),e&&T())};function j(){S=!0,n.blur(),n.focus(),S=!1}var W,H=s.delayedCall(z,50).schedule.bind(null,null);function V(){clearTimeout(W),W=setTimeout((function(){x&&(n.style.cssText=x,x=""),t.renderer.$isMousePressed=!1,t.renderer.$keepTextAreaAtCursor&&t.renderer.$moveTextAreaToCursor()}),0)}i.addListener(n,"compositionstart",(function(e){if(!w&&t.onCompositionStart&&!t.$readOnly&&(w={},!C)){e.data&&(w.useTextareaForIME=!1),setTimeout(z,0),t._signal("compositionStart"),t.on("mousedown",j);var i=t.getSelectionRange();i.end.row=i.start.row,i.end.column=i.start.column,w.markerRange=i,w.selectionStart=$,t.onCompositionStart(w),w.useTextareaForIME?(k=n.value="",$=0,E=0):(n.msGetInputContext&&(w.context=n.msGetInputContext()),n.getInputContext&&(w.context=n.getInputContext()))}}),t),i.addListener(n,"compositionupdate",z,t),i.addListener(n,"keyup",(function(e){27==e.keyCode&&n.value.length<n.selectionStart&&(w||(k=n.value),$=E=-1,A()),H()}),t),i.addListener(n,"keydown",H,t),i.addListener(n,"compositionend",B,t),this.getElement=function(){return n},this.setCommandMode=function(e){C=e,n.readOnly=!1},this.setReadOnly=function(e){C||(n.readOnly=e)},this.setCopyWithEmptySelection=function(e){},this.onContextMenu=function(e){M=!0,A(),t._emit("nativecontextmenu",{target:t,domEvent:e}),this.moveToMouse(e,!0)},this.moveToMouse=function(e,s){x||(x=n.style.cssText),n.style.cssText=(s?"z-index:100000;":"")+(o.isIE?"opacity:0.1;":"")+"text-indent: -"+($+E)*t.renderer.characterWidth*.5+"px;";var a=t.container.getBoundingClientRect(),l=r.computedStyle(t.container),c=a.top+(parseInt(l.borderTopWidth)||0),u=a.left+(parseInt(a.borderLeftWidth)||0),h=a.bottom-c-n.clientHeight-2,d=function(e){r.translate(n,e.clientX-u-2,Math.min(e.clientY-c-2,h))};d(e),"mousedown"==e.type&&(t.renderer.$isMousePressed=!0,clearTimeout(W),o.isWin&&i.capture(t.container,d,V))},this.onContextMenuClose=V;var U=function(e){t.textInput.onContextMenu(e),V()};i.addListener(n,"mouseup",U,t),i.addListener(n,"mousedown",(function(e){e.preventDefault(),V()}),t),i.addListener(t.renderer.scroller,"contextmenu",U,t),i.addListener(n,"contextmenu",U,t),f&&function(e,t,n){var i=null,o=!1;n.addEventListener("keydown",(function(e){i&&clearTimeout(i),o=!0}),!0),n.addEventListener("keyup",(function(e){i=setTimeout((function(){o=!1}),100)}),!0);var r=function(e){if(document.activeElement===n&&!(o||w||t.$mouseHandler.isMousePressed||v)){var i=n.selectionStart,r=n.selectionEnd,s=null,a=0;if(0==i?s=d.up:1==i?s=d.home:r>E&&"\n"==k[r]?s=d.end:i<$&&" "==k[i-1]?(s=d.left,a=p.option):i<$||i==$&&E!=$&&i==r?s=d.left:r>E&&k.slice(0,r).split("\n").length>2?s=d.down:r>E&&" "==k[r-1]?(s=d.right,a=p.option):(r>E||r==E&&E!=$&&i==r)&&(s=d.right),i!==r&&(a|=p.shift),s){if(!t.onCommandKey({},a,s)&&t.commands){s=d.keyCodeToString(s);var l=t.commands.findKeyCommand(a,s);l&&t.execCommand(l)}$=i,E=r,A("")}}};document.addEventListener("selectionchange",r),t.on("destroy",(function(){document.removeEventListener("selectionchange",r)}))}(0,t,n)},t.$setUserAgentForTests=function(e,t){m=e,f=t}})),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],(function(e,t,n){"use strict";var i=e("../lib/useragent");function o(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e)),["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach((function(t){e[t]=this[t]}),this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}function r(e,t){if(e.start.row==e.end.row)var n=2*t.column-e.start.column-e.end.column;else if(e.start.row!=e.end.row-1||e.start.column||e.end.column)n=2*t.row-e.start.row-e.end.row;else n=t.column-4;return n<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}(function(){this.onMouseDown=function(e){var t=e.inSelection(),n=e.getDocumentPosition();this.mousedownEvent=e;var o=this.editor,r=e.getButton();return 0!==r?((o.getSelectionRange().isEmpty()||1==r)&&o.selection.moveToPosition(n),void(2==r&&(o.textInput.onContextMenu(e.domEvent),i.isMozilla||e.preventDefault()))):(this.mousedownEvent.time=Date.now(),!t||o.isFocused()||(o.focus(),!this.$focusTimeout||this.$clickSelection||o.inMultiSelectMode)?(this.captureMouse(e),this.startSelect(n,e.domEvent._clicks>1),e.preventDefault()):(this.setState("focusWait"),void this.captureMouse(e)))},this.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(e):t||n.selection.moveToPosition(e),t||this.select(),n.renderer.scroller.setCapture&&n.renderer.scroller.setCapture(),n.setStyle("ace_selecting"),this.setState("select"))},this.select=function(){var e,t=this.editor,n=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var i=this.$clickSelection.comparePoint(n);if(-1==i)e=this.$clickSelection.end;else if(1==i)e=this.$clickSelection.start;else{var o=r(this.$clickSelection,n);n=o.cursor,e=o.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(n),t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,n=this.editor,i=n.renderer.screenToTextCoordinates(this.x,this.y),o=n.selection[e](i.row,i.column);if(this.$clickSelection){var s=this.$clickSelection.comparePoint(o.start),a=this.$clickSelection.comparePoint(o.end);if(-1==s&&a<=0)t=this.$clickSelection.end,o.end.row==i.row&&o.end.column==i.column||(i=o.start);else if(1==a&&s>=0)t=this.$clickSelection.start,o.start.row==i.row&&o.start.column==i.column||(i=o.end);else if(-1==s&&1==a)i=o.end,t=o.start;else{var l=r(this.$clickSelection,i);i=l.cursor,t=l.anchor}n.selection.setSelectionAnchor(t.row,t.column)}n.selection.selectToPosition(i),n.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e,t,n,i,o=(e=this.mousedownEvent.x,t=this.mousedownEvent.y,n=this.x,i=this.y,Math.sqrt(Math.pow(n-e,2)+Math.pow(i-t,2))),r=Date.now();(o>0||r-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var t=e.getDocumentPosition(),n=this.editor,i=n.session.getBracketRange(t);i?(i.isEmpty()&&(i.start.column--,i.end.column++),this.setState("select")):(i=n.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=i,this.select()},this.onTripleClick=function(e){var t=e.getDocumentPosition(),n=this.editor;this.setState("selectByLines");var i=n.getSelectionRange();i.isMultiLine()&&i.contains(t.row,t.column)?(this.$clickSelection=n.selection.getLineRange(i.start.row),this.$clickSelection.end=n.selection.getLineRange(i.end.row).end):this.$clickSelection=n.selection.getLineRange(t.row),this.select()},this.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var n=this.$lastScroll,i=e.domEvent.timeStamp,o=i-n.t,r=o?e.wheelX/o:n.vx,s=o?e.wheelY/o:n.vy;o<550&&(r=(r+n.vx)/2,s=(s+n.vy)/2);var a=Math.abs(r/s),l=!1;return a>=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(l=!0),a<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(l=!0),l?n.allowed=i:i-n.allowed<550&&(Math.abs(r)<=1.5*Math.abs(n.vx)&&Math.abs(s)<=1.5*Math.abs(n.vy)?(l=!0,n.allowed=i):n.allowed=0),n.t=i,n.vx=r,n.vy=s,l?(t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}}}).call(o.prototype),t.DefaultHandlers=o})),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],(function(e,t,n){"use strict";e("./lib/oop");var i=e("./lib/dom");function o(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}(function(){this.$init=function(){return this.$element=i.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(e){this.getElement().textContent=e},this.setHtml=function(e){this.getElement().innerHTML=e},this.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},this.setClassName=function(e){i.addCssClass(this.getElement(),e)},this.show=function(e,t,n){null!=e&&this.setText(e),null!=t&&null!=n&&this.setPosition(t,n),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},this.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)}}).call(o.prototype),t.Tooltip=o})),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],(function(e,t,n){"use strict";var i=e("../lib/dom"),o=e("../lib/oop"),r=e("../lib/event"),s=e("../tooltip").Tooltip;function a(e){s.call(this,e)}o.inherits(a,s),function(){this.setPosition=function(e,t){var n=window.innerWidth||document.documentElement.clientWidth,i=window.innerHeight||document.documentElement.clientHeight,o=this.getWidth(),r=this.getHeight();(e+=15)+o>n&&(e-=e+o-n),(t+=15)+r>i&&(t-=20+r),s.prototype.setPosition.call(this,e,t)}}.call(a.prototype),t.GutterHandler=function(e){var t,n,o,s=e.editor,l=s.renderer.$gutterLayer,c=new a(s.container);function u(){t&&(t=clearTimeout(t)),o&&(c.hide(),o=null,s._signal("hideGutterTooltip",c),s.off("mousewheel",u))}function h(e){c.setPosition(e.x,e.y)}e.editor.setDefaultHandler("guttermousedown",(function(t){if(s.isFocused()&&0==t.getButton()&&"foldWidgets"!=l.getRegion(t)){var n=t.getDocumentPosition().row,i=s.session.selection;if(t.getShiftKey())i.selectTo(n,0);else{if(2==t.domEvent.detail)return s.selectAll(),t.preventDefault();e.$clickSelection=s.selection.getLineRange(n)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}})),e.editor.setDefaultHandler("guttermousemove",(function(r){var a=r.domEvent.target||r.domEvent.srcElement;if(i.hasCssClass(a,"ace_fold-widget"))return u();o&&e.$tooltipFollowsMouse&&h(r),n=r,t||(t=setTimeout((function(){t=null,n&&!e.isMousePressed?function(){var t=n.getDocumentPosition().row,i=l.$annotations[t];if(!i)return u();if(t==s.session.getLength()){var r=s.renderer.pixelToScreenCoordinates(0,n.y).row,a=n.$pos;if(r>s.session.documentToScreenRow(a.row,a.column))return u()}if(o!=i)if(o=i.text.join("<br/>"),c.setHtml(o),c.show(),s._signal("showGutterTooltip",c),s.on("mousewheel",u),e.$tooltipFollowsMouse)h(n);else{var d=n.domEvent.target.getBoundingClientRect(),p=c.getElement().style;p.left=d.right+"px",p.top=d.bottom+"px"}}():u()}),50))})),r.addListener(s.renderer.$gutter,"mouseout",(function(e){n=null,o&&!t&&(t=setTimeout((function(){t=null,u()}),50))}),s),s.on("changeSession",u)}})),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],(function(e,t,n){"use strict";var i=e("../lib/event"),o=e("../lib/useragent"),r=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.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY)),this.$pos},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var e=this.editor.getSelectionRange();if(e.isEmpty())this.$inSelection=!1;else{var t=this.getDocumentPosition();this.$inSelection=e.contains(t.row,t.column)}return this.$inSelection},this.getButton=function(){return i.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=o.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(r.prototype)})),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],(function(e,t,n){"use strict";var i=e("../lib/dom"),o=e("../lib/event"),r=e("../lib/useragent");function s(e){var t=e.editor,n=i.createElement("div");n.style.cssText="top:-100px;position:absolute;z-index:2147483647;opacity:0.5",n.textContent=" ",["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach((function(t){e[t]=this[t]}),this),t.on("mousedown",this.onMouseDown.bind(e));var s,l,c,u,h,d,p,f,g,m,v,b=t.container,w=0;function y(){var e=d;(function(e,n){var i=Date.now(),o=!n||e.row!=n.row,r=!n||e.column!=n.column;!m||o||r?(t.moveCursorToPosition(e),m=i,v={x:l,y:c}):a(v.x,v.y,l,c)>5?m=null:i-m>=200&&(t.renderer.scrollCursorIntoView(),m=null)})(d=t.renderer.screenToTextCoordinates(l,c),e),function(e,n){var i=Date.now(),o=t.renderer.layerConfig.lineHeight,r=t.renderer.layerConfig.characterWidth,s=t.renderer.scroller.getBoundingClientRect(),a={x:{left:l-s.left,right:s.right-l},y:{top:c-s.top,bottom:s.bottom-c}},u=Math.min(a.x.left,a.x.right),h=Math.min(a.y.top,a.y.bottom),d={row:e.row,column:e.column};u/r<=2&&(d.column+=a.x.left<a.x.right?-3:2),h/o<=1&&(d.row+=a.y.top<a.y.bottom?-1:1);var p=e.row!=d.row,f=e.column!=d.column,m=!n||e.row!=n.row;p||f&&!m?g?i-g>=200&&t.renderer.scrollCursorIntoView(d):g=i:g=null}(d,e)}function x(){h=t.selection.toOrientedRange(),s=t.session.addMarker(h,"ace_selection",t.getSelectionStyle()),t.clearSelection(),t.isFocused()&&t.renderer.$cursorLayer.setBlinking(!1),clearInterval(u),y(),u=setInterval(y,20),w=0,o.addListener(document,"mousemove",k)}function C(){clearInterval(u),t.session.removeMarker(s),s=null,t.selection.fromOrientedRange(h),t.isFocused()&&!f&&t.$resetCursorStyle(),h=null,d=null,w=0,g=null,m=null,o.removeListener(document,"mousemove",k)}this.onDragStart=function(e){if(this.cancelDrag||!b.draggable){var i=this;return setTimeout((function(){i.startSelect(),i.captureMouse(e)}),0),e.preventDefault()}h=t.getSelectionRange();var o=e.dataTransfer;o.effectAllowed=t.getReadOnly()?"copy":"copyMove",t.container.appendChild(n),o.setDragImage&&o.setDragImage(n,0,0),setTimeout((function(){t.container.removeChild(n)})),o.clearData(),o.setData("Text",t.session.getTextRange()),f=!0,this.setState("drag")},this.onDragEnd=function(e){if(b.draggable=!1,f=!1,this.setState(null),!t.getReadOnly()){var n=e.dataTransfer.dropEffect;p||"move"!=n||t.session.remove(t.getSelectionRange()),t.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(!t.getReadOnly()&&$(e.dataTransfer))return l=e.clientX,c=e.clientY,s||x(),w++,e.dataTransfer.dropEffect=p=E(e),o.preventDefault(e)},this.onDragOver=function(e){if(!t.getReadOnly()&&$(e.dataTransfer))return l=e.clientX,c=e.clientY,s||(x(),w++),null!==S&&(S=null),e.dataTransfer.dropEffect=p=E(e),o.preventDefault(e)},this.onDragLeave=function(e){if(--w<=0&&s)return C(),p=null,o.preventDefault(e)},this.onDrop=function(e){if(d){var n=e.dataTransfer;if(f)switch(p){case"move":h=h.contains(d.row,d.column)?{start:d,end:d}:t.moveText(h,d);break;case"copy":h=t.moveText(h,d,!0)}else{var i=n.getData("Text");h={start:d,end:t.session.insert(d,i)},t.focus(),p=null}return C(),o.preventDefault(e)}},o.addListener(b,"dragstart",this.onDragStart.bind(e),t),o.addListener(b,"dragend",this.onDragEnd.bind(e),t),o.addListener(b,"dragenter",this.onDragEnter.bind(e),t),o.addListener(b,"dragover",this.onDragOver.bind(e),t),o.addListener(b,"dragleave",this.onDragLeave.bind(e),t),o.addListener(b,"drop",this.onDrop.bind(e),t);var S=null;function k(){null==S&&(S=setTimeout((function(){null!=S&&s&&C()}),20))}function $(e){var t=e.types;return!t||Array.prototype.some.call(t,(function(e){return"text/plain"==e||"Text"==e}))}function E(e){var t=["copy","copymove","all","uninitialized"],n=r.isMac?e.altKey:e.ctrlKey,i="uninitialized";try{i=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var o="none";return n&&t.indexOf(i)>=0?o="copy":["move","copymove","linkmove","all","uninitialized"].indexOf(i)>=0?o="move":t.indexOf(i)>=0&&(o="copy"),o}}function a(e,t,n,i){return Math.sqrt(Math.pow(n-e,2)+Math.pow(i-t,2))}(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor;e.container.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var t=r.isWin?"default":"move";e.renderer.setCursorStyle(t),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;r.isIE&&"dragReady"==this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>3&&t.dragDrop(),"dragWait"===this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,n=e.inSelection(),i=e.getButton();if(1===(e.domEvent.detail||1)&&0===i&&n){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var o=e.domEvent.target||e.domEvent.srcElement;"unselectable"in o&&(o.unselectable="on"),t.getDragDelay()?(r.isWebKit&&(this.cancelDrag=!0,t.container.draggable=!0),this.setState("dragWait")):this.startDrag(),this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(s.prototype),t.DragdropHandler=s})),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],(function(e,t,n){"use strict";var i=e("./mouse_event").MouseEvent,o=e("../lib/event"),r=e("../lib/dom");t.addTouchListeners=function(e,t){var n,s,a,l,c,u,h,d,p,f="scroll",g=0,m=0,v=0,b=0;function w(){var e,n,i;p||(e=window.navigator&&window.navigator.clipboard,n=!1,i=function(i){var o,s,a=i.target.getAttribute("action");if("more"==a||!n)return n=!n,o=t.getCopyText(),s=t.session.getUndoManager().hasUndo(),void p.replaceChild(r.buildDom(n?["span",!o&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],o&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],o&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],e&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],s&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPallete"},"Pallete"]]:["span"]),p.firstChild);"paste"==a?e.readText().then((function(e){t.execCommand(a,e)})):a&&("cut"!=a&&"copy"!=a||(e?e.writeText(t.getCopyText()):document.execCommand("copy")),t.execCommand(a)),p.firstChild.style.display="none",n=!1,"openCommandPallete"!=a&&t.focus()},p=r.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(e){f="menu",e.stopPropagation(),e.preventDefault(),t.textInput.focus()},ontouchend:function(e){e.stopPropagation(),e.preventDefault(),i(e)},onclick:i},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],t.container));var o=t.selection.cursor,s=t.renderer.textToScreenCoordinates(o.row,o.column),a=t.renderer.textToScreenCoordinates(0,0).pageX,l=t.renderer.scrollLeft,c=t.container.getBoundingClientRect();p.style.top=s.pageY-c.top-3+"px",s.pageX-c.left<c.width-70?(p.style.left="",p.style.right="10px"):(p.style.right="",p.style.left=a+l-c.left+"px"),p.style.display="",p.firstChild.style.display="none",t.on("input",y)}function y(e){p&&(p.style.display="none"),t.off("input",y)}function x(){c=null,clearTimeout(c);var e=t.selection.getRange(),n=e.contains(h.row,h.column);!e.isEmpty()&&n||(t.selection.moveToPosition(h),t.selection.selectWord()),f="wait",w()}o.addListener(e,"contextmenu",(function(e){d&&t.textInput.getElement().focus()}),t),o.addListener(e,"touchstart",(function(e){var o=e.touches;if(c||o.length>1)return clearTimeout(c),c=null,a=-1,void(f="zoom");d=t.$mouseHandler.isMousePressed=!0;var r=t.renderer.layerConfig.lineHeight,u=t.renderer.layerConfig.lineHeight,p=e.timeStamp;l=p;var w=o[0],y=w.clientX,C=w.clientY;Math.abs(n-y)+Math.abs(s-C)>r&&(a=-1),n=e.clientX=y,s=e.clientY=C,v=b=0;var S=new i(e,t);if(h=S.getDocumentPosition(),p-a<500&&1==o.length&&!g)m++,e.preventDefault(),e.button=0,function(){c=null,clearTimeout(c),t.selection.moveToPosition(h);var e=m>=2?t.selection.getLineRange(h.row):t.session.getBracketRange(h);e&&!e.isEmpty()?t.selection.setRange(e):t.selection.selectWord(),f="wait"}();else{m=0;var k=t.selection.cursor,$=t.selection.isEmpty()?k:t.selection.anchor,E=t.renderer.$cursorLayer.getPixelPosition(k,!0),_=t.renderer.$cursorLayer.getPixelPosition($,!0),L=t.renderer.scroller.getBoundingClientRect(),A=t.renderer.layerConfig.offset,R=t.renderer.scrollLeft,M=function(e,t){return(e/=u)*e+(t=t/r-.75)*t};if(e.clientX<L.left)return void(f="zoom");var O=M(e.clientX-L.left-E.left+R,e.clientY-L.top-E.top+A),T=M(e.clientX-L.left-_.left+R,e.clientY-L.top-_.top+A);O<3.5&&T<3.5&&(f=O>T?"cursor":"anchor"),f=T<3.5?"anchor":O<3.5?"cursor":"scroll",c=setTimeout(x,450)}a=p}),t),o.addListener(e,"touchend",(function(e){d=t.$mouseHandler.isMousePressed=!1,u&&clearInterval(u),"zoom"==f?(f="",g=0):c?(t.selection.moveToPosition(h),g=0,w()):"scroll"==f?(g+=60,u=setInterval((function(){g--<=0&&(clearInterval(u),u=null),Math.abs(v)<.01&&(v=0),Math.abs(b)<.01&&(b=0),g<20&&(v*=.9),g<20&&(b*=.9);var e=t.session.getScrollTop();t.renderer.scrollBy(10*v,10*b),e==t.session.getScrollTop()&&(g=0)}),10),y()):w(),clearTimeout(c),c=null}),t),o.addListener(e,"touchmove",(function(e){c&&(clearTimeout(c),c=null);var o=e.touches;if(!(o.length>1||"zoom"==f)){var r=o[0],a=n-r.clientX,u=s-r.clientY;if("wait"==f){if(!(a*a+u*u>4))return e.preventDefault();f="cursor"}n=r.clientX,s=r.clientY,e.clientX=r.clientX,e.clientY=r.clientY;var h=e.timeStamp,d=h-l;if(l=h,"scroll"==f){var p=new i(e,t);p.speed=1,p.wheelX=a,p.wheelY=u,10*Math.abs(a)<Math.abs(u)&&(a=0),10*Math.abs(u)<Math.abs(a)&&(u=0),0!=d&&(v=a/d,b=u/d),t._emit("mousewheel",p),p.propagationStopped||(v=b=0)}else{var g=new i(e,t).getDocumentPosition();"cursor"==f?t.selection.moveCursorToPosition(g):"anchor"==f&&t.selection.setSelectionAnchor(g.row,g.column),t.renderer.scrollCursorIntoView(g),e.preventDefault()}}}),t)}})),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],(function(e,t,n){"use strict";var i=e("./dom");t.get=function(e,t){var n=new XMLHttpRequest;n.open("GET",e,!0),n.onreadystatechange=function(){4===n.readyState&&t(n.responseText)},n.send(null)},t.loadScript=function(e,t){var n=i.getDocumentHead(),o=document.createElement("script");o.src=e,n.appendChild(o),o.onload=o.onreadystatechange=function(e,n){!n&&o.readyState&&"loaded"!=o.readyState&&"complete"!=o.readyState||(o=o.onload=o.onreadystatechange=null,n||t())}},t.qualifyURL=function(e){var t=document.createElement("a");return t.href=e,t.href}})),ace.define("ace/lib/event_emitter",["require","exports","module"],(function(e,t,n){"use strict";var i={},o=function(){this.propagationStopped=!0},r=function(){this.defaultPrevented=!0};i._emit=i._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var n=this._eventRegistry[e]||[],i=this._defaultHandlers[e];if(n.length||i){"object"==typeof t&&t||(t={}),t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=o),t.preventDefault||(t.preventDefault=r),n=n.slice();for(var s=0;s<n.length&&(n[s](t,this),!t.propagationStopped);s++);return i&&!t.defaultPrevented?i(t,this):void 0}},i._signal=function(e,t){var n=(this._eventRegistry||{})[e];if(n){n=n.slice();for(var i=0;i<n.length;i++)n[i](t,this)}},i.once=function(e,t){var n=this;if(this.on(e,(function i(){n.off(e,i),t.apply(null,arguments)})),!t)return new Promise((function(e){t=e}))},i.setDefaultHandler=function(e,t){var n=this._defaultHandlers;if(n||(n=this._defaultHandlers={_disabled_:{}}),n[e]){var i=n[e],o=n._disabled_[e];o||(n._disabled_[e]=o=[]),o.push(i);var r=o.indexOf(t);-1!=r&&o.splice(r,1)}n[e]=t},i.removeDefaultHandler=function(e,t){var n=this._defaultHandlers;if(n){var i=n._disabled_[e];if(n[e]==t)i&&this.setDefaultHandler(e,i.pop());else if(i){var o=i.indexOf(t);-1!=o&&i.splice(o,1)}}},i.on=i.addEventListener=function(e,t,n){this._eventRegistry=this._eventRegistry||{};var i=this._eventRegistry[e];return i||(i=this._eventRegistry[e]=[]),-1==i.indexOf(t)&&i[n?"unshift":"push"](t),t},i.off=i.removeListener=i.removeEventListener=function(e,t){this._eventRegistry=this._eventRegistry||{};var n=this._eventRegistry[e];if(n){var i=n.indexOf(t);-1!==i&&n.splice(i,1)}},i.removeAllListeners=function(e){e||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[e]=void 0),this._defaultHandlers&&(this._defaultHandlers[e]=void 0)},t.EventEmitter=i})),ace.define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],(function(e,t,n){var i=e("./oop"),o=e("./event_emitter").EventEmitter,r={setOptions:function(e){Object.keys(e).forEach((function(t){this.setOption(t,e[t])}),this)},getOptions:function(e){var t={};if(e)Array.isArray(e)||(t=e,e=Object.keys(t));else{var n=this.$options;e=Object.keys(n).filter((function(e){return!n[e].hidden}))}return e.forEach((function(e){t[e]=this.getOption(e)}),this),t},setOption:function(e,t){if(this["$"+e]!==t){var n=this.$options[e];if(!n)return s('misspelled option "'+e+'"');if(n.forwardTo)return this[n.forwardTo]&&this[n.forwardTo].setOption(e,t);n.handlesSet||(this["$"+e]=t),n&&n.set&&n.set.call(this,t)}},getOption:function(e){var t=this.$options[e];return t?t.forwardTo?this[t.forwardTo]&&this[t.forwardTo].getOption(e):t&&t.get?t.get.call(this):this["$"+e]:s('misspelled option "'+e+'"')}};function s(e){"undefined"!=typeof console&&console.warn&&console.warn.apply(console,arguments)}function a(e,t){var n=new Error(e);n.data=t,"object"==typeof console&&console.error&&console.error(n),setTimeout((function(){throw n}))}var l=function(){this.$defaultOptions={}};(function(){i.implement(this,o),this.defineOptions=function(e,t,n){return e.$options||(this.$defaultOptions[t]=e.$options={}),Object.keys(n).forEach((function(t){var i=n[t];"string"==typeof i&&(i={forwardTo:i}),i.name||(i.name=t),e.$options[i.name]=i,"initialValue"in i&&(e["$"+i.name]=i.initialValue)})),i.implement(e,r),this},this.resetOptions=function(e){Object.keys(e.$options).forEach((function(t){var n=e.$options[t];"value"in n&&e.setOption(t,n.value)}))},this.setDefaultValue=function(e,t,n){if(!e){for(e in this.$defaultOptions)if(this.$defaultOptions[e][t])break;if(!this.$defaultOptions[e][t])return!1}var i=this.$defaultOptions[e]||(this.$defaultOptions[e]={});i[t]&&(i.forwardTo?this.setDefaultValue(i.forwardTo,t,n):i[t].value=n)},this.setDefaultValues=function(e,t){Object.keys(t).forEach((function(n){this.setDefaultValue(e,n,t[n])}),this)},this.warn=s,this.reportError=a}).call(l.prototype),t.AppConfig=l})),ace.define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/lib/net","ace/lib/dom","ace/lib/app_config"],(function(e,t,i){var o=e("./lib/lang"),r=(e("./lib/oop"),e("./lib/net")),s=e("./lib/dom"),a=e("./lib/app_config").AppConfig;i.exports=t=new a;var l=function(){return this||"undefined"!=typeof window&&window}(),c={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1,useStrictCSP:null};t.get=function(e){if(!c.hasOwnProperty(e))throw new Error("Unknown config key: "+e);return c[e]},t.set=function(e,t){if(c.hasOwnProperty(e))c[e]=t;else if(0==this.setDefaultValue("",e,t))throw new Error("Unknown config key: "+e);"useStrictCSP"==e&&s.useStrictCSP(t)},t.all=function(){return o.copyObject(c)},t.$modes={},t.moduleUrl=function(e,t){if(c.$moduleUrls[e])return c.$moduleUrls[e];var n=e.split("/"),i="snippets"==(t=t||n[n.length-2]||"")?"/":"-",o=n[n.length-1];if("worker"==t&&"-"==i){var r=new RegExp("^"+t+"[\\-_]|[\\-_]"+t+"$","g");o=o.replace(r,"")}(!o||o==t)&&n.length>1&&(o=n[n.length-2]);var s=c[t+"Path"];return null==s?s=c.basePath:"/"==i&&(t=i=""),s&&"/"!=s.slice(-1)&&(s+="/"),s+t+i+o+this.get("suffix")},t.setModuleUrl=function(e,t){return c.$moduleUrls[e]=t},t.$loading={},t.loadModule=function(n,i){var o,s;Array.isArray(n)&&(s=n[0],n=n[1]);try{o=e(n)}catch(e){}if(o&&!t.$loading[n])return i&&i(o);if(t.$loading[n]||(t.$loading[n]=[]),t.$loading[n].push(i),!(t.$loading[n].length>1)){var a=function(){e([n],(function(e){t._emit("load.module",{name:n,module:e});var i=t.$loading[n];t.$loading[n]=null,i.forEach((function(t){t&&t(e)}))}))};if(!t.get("packaged"))return a();r.loadScript(t.moduleUrl(n,s),a),u()}};var u=function(){c.basePath||c.workerPath||c.modePath||c.themePath||Object.keys(c.$moduleUrls).length||(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),u=function(){})};function h(o){if(l&&l.document){c.packaged=o||e.packaged||i.packaged||l.define&&n.amdD.packaged;for(var r,s={},a="",u=document.currentScript||document._currentScript,h=(u&&u.ownerDocument||document).getElementsByTagName("script"),d=0;d<h.length;d++){var p=h[d],f=p.src||p.getAttribute("src");if(f){for(var g=p.attributes,m=0,v=g.length;m<v;m++){var b=g[m];0===b.name.indexOf("data-ace-")&&(s[(r=b.name.replace(/^data-ace-/,""),r.replace(/-(.)/g,(function(e,t){return t.toUpperCase()})))]=b.value)}var w=f.match(/^(.*)\/ace(\-\w+)?\.js(\?|$)/);w&&(a=w[1])}}for(var y in a&&(s.base=s.base||a,s.packaged=!0),s.basePath=s.base,s.workerPath=s.workerPath||s.base,s.modePath=s.modePath||s.base,s.themePath=s.themePath||s.base,delete s.base,s)void 0!==s[y]&&t.set(y,s[y])}}h(!0),t.init=h,t.version="1.4.14"})),ace.define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event","ace/mouse/dragdrop_handler","ace/mouse/touch_handler","ace/config"],(function(e,t,n){"use strict";var i=e("../lib/event"),o=e("../lib/useragent"),r=e("./default_handlers").DefaultHandlers,s=e("./default_gutter_handler").GutterHandler,a=e("./mouse_event").MouseEvent,l=e("./dragdrop_handler").DragdropHandler,c=e("./touch_handler").addTouchListeners,u=e("../config"),h=function(e){var t=this;this.editor=e,new r(this),new s(this),new l(this);var n=function(t){(!document.hasFocus||!document.hasFocus()||!e.isFocused()&&document.activeElement==(e.textInput&&e.textInput.getElement()))&&window.focus(),e.focus()},a=e.renderer.getMouseEventTarget();i.addListener(a,"click",this.onMouseEvent.bind(this,"click"),e),i.addListener(a,"mousemove",this.onMouseMove.bind(this,"mousemove"),e),i.addMultiMouseDownListener([a,e.renderer.scrollBarV&&e.renderer.scrollBarV.inner,e.renderer.scrollBarH&&e.renderer.scrollBarH.inner,e.textInput&&e.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent",e),i.addMouseWheelListener(e.container,this.onMouseWheel.bind(this,"mousewheel"),e),c(e.container,e);var u=e.renderer.$gutter;i.addListener(u,"mousedown",this.onMouseEvent.bind(this,"guttermousedown"),e),i.addListener(u,"click",this.onMouseEvent.bind(this,"gutterclick"),e),i.addListener(u,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick"),e),i.addListener(u,"mousemove",this.onMouseEvent.bind(this,"guttermousemove"),e),i.addListener(a,"mousedown",n,e),i.addListener(u,"mousedown",n,e),o.isIE&&e.renderer.scrollBarV&&(i.addListener(e.renderer.scrollBarV.element,"mousedown",n,e),i.addListener(e.renderer.scrollBarH.element,"mousedown",n,e)),e.on("mousemove",(function(n){if(!t.state&&!t.$dragDelay&&t.$dragEnabled){var i=e.renderer.screenToTextCoordinates(n.x,n.y),o=e.session.selection.getRange(),r=e.renderer;!o.isEmpty()&&o.insideStart(i.row,i.column)?r.setCursorStyle("default"):r.setCursorStyle("")}}),e)};(function(){this.onMouseEvent=function(e,t){this.editor.session&&this.editor._emit(e,new a(t,this.editor))},this.onMouseMove=function(e,t){var n=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;n&&n.length&&this.editor._emit(e,new a(t,this.editor))},this.onMouseWheel=function(e,t){var n=new a(t,this.editor);n.speed=2*this.$scrollSpeed,n.wheelX=t.wheelX,n.wheelY=t.wheelY,this.editor._emit(e,n)},this.setState=function(e){this.state=e},this.captureMouse=function(e,t){this.x=e.x,this.y=e.y,this.isMousePressed=!0;var n=this.editor,r=this.editor.renderer;r.$isMousePressed=!0;var s=this,l=function(e){if(e){if(o.isWebKit&&!e.which&&s.releaseMouse)return s.releaseMouse();s.x=e.clientX,s.y=e.clientY,t&&t(e),s.mouseEvent=new a(e,s.editor),s.$mouseMoved=!0}},c=function(e){n.off("beforeEndOperation",h),clearInterval(d),n.session&&u(),s[s.state+"End"]&&s[s.state+"End"](e),s.state="",s.isMousePressed=r.$isMousePressed=!1,r.$keepTextAreaAtCursor&&r.$moveTextAreaToCursor(),s.$onCaptureMouseMove=s.releaseMouse=null,e&&s.onMouseEvent("mouseup",e),n.endOperation()},u=function(){s[s.state]&&s[s.state](),s.$mouseMoved=!1};if(o.isOldIE&&"dblclick"==e.domEvent.type)return setTimeout((function(){c(e)}));var h=function(e){s.releaseMouse&&n.curOp.command.name&&n.curOp.selectionChanged&&(s[s.state+"End"]&&s[s.state+"End"](),s.state="",s.releaseMouse())};n.on("beforeEndOperation",h),n.startOperation({command:{name:"mouse"}}),s.$onCaptureMouseMove=l,s.releaseMouse=i.capture(this.editor.container,l,c);var d=setInterval(u,20)},this.releaseMouse=null,this.cancelContextMenu=function(){var e=function(t){t&&t.domEvent&&"contextmenu"!=t.domEvent.type||(this.editor.off("nativecontextmenu",e),t&&t.domEvent&&i.stopEvent(t.domEvent))}.bind(this);setTimeout(e,10),this.editor.on("nativecontextmenu",e)},this.destroy=function(){this.releaseMouse&&this.releaseMouse()}}).call(h.prototype),u.defineOptions(h.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:o.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),t.MouseHandler=h})),ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],(function(e,t,n){"use strict";var i=e("../lib/dom");t.FoldHandler=function(e){e.on("click",(function(t){var n=t.getDocumentPosition(),o=e.session,r=o.getFoldAt(n.row,n.column,1);r&&(t.getAccelKey()?o.removeFold(r):o.expandFold(r),t.stop());var s=t.domEvent&&t.domEvent.target;s&&i.hasCssClass(s,"ace_inline_button")&&i.hasCssClass(s,"ace_toggle_wrap")&&(o.setOption("wrap",!o.getUseWrapMode()),e.renderer.scrollCursorIntoView())})),e.on("gutterclick",(function(t){if("foldWidgets"==e.renderer.$gutterLayer.getRegion(t)){var n=t.getDocumentPosition().row,i=e.session;i.foldWidgets&&i.foldWidgets[n]&&e.session.onFoldWidgetClick(n,t),e.isFocused()||e.focus(),t.stop()}})),e.on("gutterdblclick",(function(t){if("foldWidgets"==e.renderer.$gutterLayer.getRegion(t)){var n=t.getDocumentPosition().row,i=e.session,o=i.getParentFoldRangeData(n,!0),r=o.range||o.firstRange;if(r){n=r.start.row;var s=i.getFoldAt(n,i.getLine(n).length,1);s?i.removeFold(s):(i.addFold("...",r),e.renderer.scrollCursorIntoView({row:r.start.row,column:0}))}t.stop()}}))}})),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],(function(e,t,n){"use strict";var i=e("../lib/keys"),o=e("../lib/event"),r=function(e){this.$editor=e,this.$data={editor:e},this.$handlers=[],this.setDefaultHandler(e.commands)};(function(){this.setDefaultHandler=function(e){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=e,this.addKeyboardHandler(e,0)},this.setKeyboardHandler=function(e){var t=this.$handlers;if(t[t.length-1]!=e){for(;t[t.length-1]&&t[t.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(t[t.length-1]);this.addKeyboardHandler(e,1)}},this.addKeyboardHandler=function(e,t){if(e){"function"!=typeof e||e.handleKeyboard||(e.handleKeyboard=e);var n=this.$handlers.indexOf(e);-1!=n&&this.$handlers.splice(n,1),null==t?this.$handlers.push(e):this.$handlers.splice(t,0,e),-1==n&&e.attach&&e.attach(this.$editor)}},this.removeKeyboardHandler=function(e){var t=this.$handlers.indexOf(e);return-1!=t&&(this.$handlers.splice(t,1),e.detach&&e.detach(this.$editor),!0)},this.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},this.getStatusText=function(){var e=this.$data,t=e.editor;return this.$handlers.map((function(n){return n.getStatusText&&n.getStatusText(t,e)||""})).filter(Boolean).join(" ")},this.$callKeyboardHandlers=function(e,t,n,i){for(var r,s=!1,a=this.$editor.commands,l=this.$handlers.length;l--&&!((r=this.$handlers[l].handleKeyboard(this.$data,e,t,n,i))&&r.command&&((s="null"==r.command||a.exec(r.command,this.$editor,r.args,i))&&i&&-1!=e&&1!=r.passEvent&&1!=r.command.passEvent&&o.stopEvent(i),s)););return s||-1!=e||(r={command:"insertstring"},s=a.exec("insertstring",this.$editor,t)),s&&this.$editor._signal&&this.$editor._signal("keyboardActivity",r),s},this.onCommandKey=function(e,t,n){var o=i.keyCodeToString(n);return this.$callKeyboardHandlers(t,o,n,e)},this.onTextInput=function(e){return this.$callKeyboardHandlers(-1,e)}}).call(r.prototype),t.KeyBinding=r})),ace.define("ace/lib/bidiutil",["require","exports","module"],(function(e,t,n){"use strict";var i=0,o=0,r=!1,s=!1,a=!1,l=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],c=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],u=11,h=18,d=[h,h,h,h,h,h,h,h,h,6,5,6,8,5,h,h,h,h,h,h,h,h,h,h,h,h,h,h,5,5,5,6,8,4,4,u,u,u,4,4,4,4,4,10,9,10,9,9,2,2,2,2,2,2,2,2,2,2,9,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,h,h,h,h,h,h,5,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,9,4,u,u,u,u,4,4,4,4,0,4,4,h,4,4,u,u,2,2,4,0,4,4,4,2,0,4,4,4,4,4],p=[8,8,8,8,8,8,8,8,8,8,8,h,h,h,0,1,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,8,5,13,14,15,16,17,9,u,u,u,u,u,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,9,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,8];function f(e,t,n){if(!(o<e))if(1!=e||1!=i||s)for(var r,a,l,c,u=n.length,h=0;h<u;){if(t[h]>=e){for(r=h+1;r<u&&t[r]>=e;)r++;for(a=h,l=r-1;a<l;a++,l--)c=n[a],n[a]=n[l],n[l]=c;h=r}h++}else n.reverse()}function g(e,t,n,o){var l,c,d,p,f=t[o];switch(f){case 0:case 1:r=!1;case 4:case 3:return f;case 2:return r?3:2;case 7:return r=!0,1;case 8:return 4;case 9:return o<1||o+1>=t.length||2!=(l=n[o-1])&&3!=l||2!=(c=t[o+1])&&3!=c?4:(r&&(c=3),c==l?c:4);case 10:return 2==(l=o>0?n[o-1]:5)&&o+1<t.length&&2==t[o+1]?2:4;case u:if(o>0&&2==n[o-1])return 2;if(r)return 4;for(p=o+1,d=t.length;p<d&&t[p]==u;)p++;return p<d&&2==t[p]?2:4;case 12:for(d=t.length,p=o+1;p<d&&12==t[p];)p++;if(p<d){var g=e[o],m=g>=1425&&g<=2303||64286==g;if(l=t[p],m&&(1==l||7==l))return 1}return o<1||5==(l=t[o-1])?4:n[o-1];case 5:return r=!1,s=!0,i;case 6:return a=!0,4;case 13:case 14:case 16:case 17:case 15:r=!1;case h:return 4}}function m(e){var t=e.charCodeAt(0),n=t>>8;return 0==n?t>191?0:d[t]:5==n?/[\u0591-\u05f4]/.test(e)?1:0:6==n?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?12:/[\u0660-\u0669\u066b-\u066c]/.test(e)?3:1642==t?u:/[\u06f0-\u06f9]/.test(e)?2:7:32==n&&t<=8287?p[255&t]:254==n&&t>=65136?7:4}t.L=0,t.R=1,t.EN=2,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.RLE=7,t.DOT="·",t.doBidiReorder=function(e,n,u){if(e.length<2)return{};var d=e.split(""),p=new Array(d.length),v=new Array(d.length),b=[];i=u?1:0,function(e,t,n,u){var h=i?c:l,d=null,p=null,f=null,v=0,b=null,w=-1,y=null,x=null,C=[];if(!u)for(y=0,u=[];y<n;y++)u[y]=m(e[y]);for(o=i,r=!1,s=!1,a=!1,x=0;x<n;x++){if(d=v,C[x]=p=g(e,u,C,x),b=240&(v=h[d][p]),v&=15,t[x]=f=h[v][5],b>0)if(16==b){for(y=w;y<x;y++)t[y]=1;w=-1}else w=-1;if(h[v][6])-1==w&&(w=x);else if(w>-1){for(y=w;y<x;y++)t[y]=f;w=-1}5==u[x]&&(t[x]=0),o|=f}if(a)for(y=0;y<n;y++)if(6==u[y]){t[y]=i;for(var S=y-1;S>=0&&8==u[S];S--)t[S]=i}}(d,b,d.length,n);for(var w=0;w<p.length;p[w]=w,w++);for(f(2,b,p),f(1,b,p),w=0;w<p.length-1;w++)3===n[w]?b[w]=t.AN:1===b[w]&&(n[w]>7&&n[w]<13||4===n[w]||n[w]===h)?b[w]=t.ON_R:w>0&&"ل"===d[w-1]&&/\u0622|\u0623|\u0625|\u0627/.test(d[w])&&(b[w-1]=b[w]=t.R_H,w++);for(d[d.length-1]===t.DOT&&(b[d.length-1]=t.B),"‫"===d[0]&&(b[0]=t.RLE),w=0;w<p.length;w++)v[w]=b[p[w]];return{logicalFromVisual:p,bidiLevels:v}},t.hasBidiCharacters=function(e,t){for(var n=!1,i=0;i<e.length;i++)t[i]=m(e.charAt(i)),n||1!=t[i]&&7!=t[i]&&3!=t[i]||(n=!0);return n},t.getVisualFromLogicalIdx=function(e,t){for(var n=0;n<t.logicalFromVisual.length;n++)if(t.logicalFromVisual[n]==e)return n;return 0}})),ace.define("ace/bidihandler",["require","exports","module","ace/lib/bidiutil","ace/lib/lang"],(function(e,t,n){"use strict";var i=e("./lib/bidiutil"),o=e("./lib/lang"),r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/,s=function(e){this.session=e,this.bidiMap={},this.currentRow=null,this.bidiUtil=i,this.charWidths=[],this.EOL="¬",this.showInvisibles=!0,this.isRtlDir=!1,this.$isRtl=!1,this.line="",this.wrapIndent=0,this.EOF="¶",this.RLE="‫",this.contentWidth=0,this.fontMetrics=null,this.rtlLineOffset=0,this.wrapOffset=0,this.isMoveLeftOperation=!1,this.seenBidi=r.test(e.getValue())};(function(){this.isBidiRow=function(e,t,n){return!!this.seenBidi&&(e!==this.currentRow&&(this.currentRow=e,this.updateRowLine(t,n),this.updateBidiMap()),this.bidiMap.bidiLevels)},this.onChange=function(e){this.seenBidi?this.currentRow=null:"insert"==e.action&&r.test(e.lines.join("\n"))&&(this.seenBidi=!0,this.currentRow=null)},this.getDocumentRow=function(){var e=0,t=this.session.$screenRowCache;if(t.length){var n=this.session.$getRowCacheIndex(t,this.currentRow);n>=0&&(e=this.session.$docRowCache[n])}return e},this.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var n,i=this.session.$getRowCacheIndex(t,this.currentRow);this.currentRow-e>0&&(n=this.session.$getRowCacheIndex(t,this.currentRow-e-1))===i;)i=n,e++;else e=this.currentRow;return e},this.updateRowLine=function(e,t){void 0===e&&(e=this.getDocumentRow());var n=e===this.session.getLength()-1?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var r=this.session.$wrapData[e];r&&(void 0===t&&(t=this.getSplitIndex()),t>0&&r.length?(this.wrapIndent=r.indent,this.wrapOffset=this.wrapIndent*this.charWidths[i.L],this.line=t<r.length?this.line.substring(r[t-1],r[t]):this.line.substring(r[r.length-1])):this.line=this.line.substring(0,r[t])),t==r.length&&(this.line+=this.showInvisibles?n:i.DOT)}else this.line+=this.showInvisibles?n:i.DOT;var s,a=this.session,l=0;this.line=this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g,(function(e,t){return"\t"===e||a.isFullWidth(e.charCodeAt(0))?(s="\t"===e?a.getScreenTabSize(t+l):2,l+=s-1,o.stringRepeat(i.DOT,s)):e})),this.isRtlDir&&(this.fontMetrics.$main.textContent=this.line.charAt(this.line.length-1)==i.DOT?this.line.substr(0,this.line.length-1):this.line,this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width)},this.updateBidiMap=function(){var e=[];i.hasBidiCharacters(this.line,e)||this.isRtlDir?this.bidiMap=i.doBidiReorder(this.line,e,this.isRtlDir):this.bidiMap={}},this.markAsDirty=function(){this.currentRow=null},this.updateCharacterWidths=function(e){if(this.characterWidth!==e.$characterSize.width){this.fontMetrics=e;var t=this.characterWidth=e.$characterSize.width,n=e.$measureCharWidth("ה");this.charWidths[i.L]=this.charWidths[i.EN]=this.charWidths[i.ON_R]=t,this.charWidths[i.R]=this.charWidths[i.AN]=n,this.charWidths[i.R_H]=.45*n,this.charWidths[i.B]=this.charWidths[i.RLE]=0,this.currentRow=null}},this.setShowInvisibles=function(e){this.showInvisibles=e,this.currentRow=null},this.setEolChar=function(e){this.EOL=e},this.setContentWidth=function(e){this.contentWidth=e},this.isRtlLine=function(e){return!!this.$isRtl||(null!=e?this.session.getLine(e).charAt(0)==this.RLE:this.isRtlDir)},this.setRtlDirection=function(e,t){for(var n=e.getCursorPosition(),i=e.selection.getSelectionAnchor().row;i<=n.row;i++)t||e.session.getLine(i).charAt(0)!==e.session.$bidiHandler.RLE?t&&e.session.getLine(i).charAt(0)!==e.session.$bidiHandler.RLE&&e.session.doc.insert({column:0,row:i},e.session.$bidiHandler.RLE):e.session.doc.removeInLine(i,0,1)},this.getPosLeft=function(e){e-=this.wrapIndent;var t=this.line.charAt(0)===this.RLE?1:0,n=e>t?this.session.getOverwrite()?e:e-1:t,o=i.getVisualFromLogicalIdx(n,this.bidiMap),r=this.bidiMap.bidiLevels,s=0;!this.session.getOverwrite()&&e<=t&&r[o]%2!=0&&o++;for(var a=0;a<o;a++)s+=this.charWidths[r[a]];return!this.session.getOverwrite()&&e>t&&r[o]%2==0&&(s+=this.charWidths[r[o]]),this.wrapIndent&&(s+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(s+=this.rtlLineOffset),s},this.getSelections=function(e,t){var n,i=this.bidiMap,o=i.bidiLevels,r=[],s=0,a=Math.min(e,t)-this.wrapIndent,l=Math.max(e,t)-this.wrapIndent,c=!1,u=!1,h=0;this.wrapIndent&&(s+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var d,p=0;p<o.length;p++)d=i.logicalFromVisual[p],n=o[p],(c=d>=a&&d<l)&&!u?h=s:!c&&u&&r.push({left:h,width:s-h}),s+=this.charWidths[n],u=c;if(c&&p===o.length&&r.push({left:h,width:s-h}),this.isRtlDir)for(var f=0;f<r.length;f++)r[f].left+=this.rtlLineOffset;return r},this.offsetToCol=function(e){this.isRtlDir&&(e-=this.rtlLineOffset);var t=0,n=(e=Math.max(e,0),0),i=0,o=this.bidiMap.bidiLevels,r=this.charWidths[o[i]];for(this.wrapIndent&&(e-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);e>n+r/2;){if(n+=r,i===o.length-1){r=0;break}r=this.charWidths[o[++i]]}return i>0&&o[i-1]%2!=0&&o[i]%2==0?(e<n&&i--,t=this.bidiMap.logicalFromVisual[i]):i>0&&o[i-1]%2==0&&o[i]%2!=0?t=1+(e>n?this.bidiMap.logicalFromVisual[i]:this.bidiMap.logicalFromVisual[i-1]):this.isRtlDir&&i===o.length-1&&0===r&&o[i-1]%2==0||!this.isRtlDir&&0===i&&o[i]%2!=0?t=1+this.bidiMap.logicalFromVisual[i]:(i>0&&o[i-1]%2!=0&&0!==r&&i--,t=this.bidiMap.logicalFromVisual[i]),0===t&&this.isRtlDir&&t++,t+this.wrapIndent}}).call(s.prototype),t.BidiHandler=s})),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],(function(e,t,n){"use strict";var i=e("./lib/oop"),o=e("./lib/lang"),r=e("./lib/event_emitter").EventEmitter,s=e("./range").Range,a=function(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var t=this;this.cursor.on("change",(function(e){t.$cursorChanged=!0,t.$silent||t._emit("changeCursor"),t.$isEmpty||t.$silent||t._emit("changeSelection"),t.$keepDesiredColumnOnChange||e.old.column==e.value.column||(t.$desiredColumn=null)})),this.anchor.on("change",(function(){t.$anchorChanged=!0,t.$isEmpty||t.$silent||t._emit("changeSelection")}))};(function(){i.implement(this,r),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},this.getAnchor=this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},this.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?s.fromPoints(t,t):this.isBackwards()?s.fromPoints(t,e):s.fromPoints(e,t)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(e,t){var n=t?e.end:e.start,i=t?e.start:e.end;this.$setSelection(n.row,n.column,i.row,i.column)},this.$setSelection=function(e,t,n,i){if(!this.$silent){var o=this.$isEmpty,r=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(n,i),this.$isEmpty=!s.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||o!=this.$isEmpty||r)&&this._emit("changeSelection")}},this.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},this.selectTo=function(e,t){this.$moveSelection((function(){this.moveCursorTo(e,t)}))},this.selectToPosition=function(e){this.$moveSelection((function(){this.moveCursorToPosition(e)}))},this.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(e,t){if(void 0===t){var n=e||this.lead;e=n.row,t=n.column}return this.session.getWordRange(e,t)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},this.getLineRange=function(e,t){var n,i="number"==typeof e?e:this.lead.row,o=this.session.getFoldLine(i);return o?(i=o.start.row,n=o.end.row):n=i,!0===t?new s(i,0,n,this.session.getLine(n).length):new s(i,0,n+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(e,t,n){var i=e.column,o=e.column+t;return n<0&&(i=e.column-t,o=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(i,o).split(" ").length-1==t},this.moveCursorLeft=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(e.start.row,e.start.column);else if(0===t.column)t.row>0&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else{var n=this.session.getTabSize();this.wouldMoveIntoSoftTab(t,n,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(e.end.row,e.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row<this.doc.getLength()-1&&this.moveCursorTo(this.lead.row+1,0);else{var n=this.session.getTabSize();t=this.lead,this.wouldMoveIntoSoftTab(t,n,1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,n):this.moveCursorBy(0,1)}},this.moveCursorLineStart=function(){var e=this.lead.row,t=this.lead.column,n=this.session.documentToScreenRow(e,t),i=this.session.screenToDocumentPosition(n,0),o=this.session.getDisplayLine(e,null,i.row,i.column).match(/^\s*/);o[0].length==t||this.session.$useEmacsStyleLineStart||(i.column+=o[0].length),this.moveCursorToPosition(i)},this.moveCursorLineEnd=function(){var e=this.lead,t=this.session.getDocumentLastRowColumnPosition(e.row,e.column);if(this.lead.column==t.column){var n=this.session.getLine(t.row);if(t.column==n.length){var i=n.search(/\s+$/);i>0&&(t.column=i)}}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=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),i=n.substring(t);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var o=this.session.getFoldAt(e,t,1);if(o)this.moveCursorTo(o.end.row,o.end.column);else{if(this.session.nonTokenRe.exec(i)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,i=n.substring(t)),t>=n.length)return this.moveCursorTo(e,n.length),this.moveCursorRight(),void(e<this.doc.getLength()-1&&this.moveCursorWordRight());this.session.tokenRe.exec(i)&&(t+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(e,t)}},this.moveCursorLongWordLeft=function(){var e,t=this.lead.row,n=this.lead.column;if(e=this.session.getFoldAt(t,n,-1))this.moveCursorTo(e.start.row,e.start.column);else{var i=this.session.getFoldStringAt(t,n,-1);null==i&&(i=this.doc.getLine(t).substring(0,n));var r=o.stringReverse(i);if(this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.nonTokenRe.exec(r)&&(n-=this.session.nonTokenRe.lastIndex,r=r.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),n<=0)return this.moveCursorTo(t,0),this.moveCursorLeft(),void(t>0&&this.moveCursorWordLeft());this.session.tokenRe.exec(r)&&(n-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,n)}},this.$shortWordEndIndex=function(e){var t,n=0,i=/\s/,o=this.session.tokenRe;if(o.lastIndex=0,this.session.tokenRe.exec(e))n=this.session.tokenRe.lastIndex;else{for(;(t=e[n])&&i.test(t);)n++;if(n<1)for(o.lastIndex=0;(t=e[n])&&!o.test(t);)if(o.lastIndex=0,n++,i.test(t)){if(n>2){n--;break}for(;(t=e[n])&&i.test(t);)n++;if(n>2)break}}return o.lastIndex=0,n},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),i=n.substring(t),o=this.session.getFoldAt(e,t,1);if(o)return this.moveCursorTo(o.end.row,o.end.column);if(t==n.length){var r=this.doc.getLength();do{e++,i=this.doc.getLine(e)}while(e<r&&/^\s*$/.test(i));/^\s+/.test(i)||(i=""),t=0}var s=this.$shortWordEndIndex(i);this.moveCursorTo(e,t+s)},this.moveCursorShortWordLeft=function(){var e,t=this.lead.row,n=this.lead.column;if(e=this.session.getFoldAt(t,n,-1))return this.moveCursorTo(e.start.row,e.start.column);var i=this.session.getLine(t).substring(0,n);if(0===n){do{t--,i=this.doc.getLine(t)}while(t>0&&/^\s*$/.test(i));n=i.length,/\s+$/.test(i)||(i="")}var r=o.stringReverse(i),s=this.$shortWordEndIndex(r);return this.moveCursorTo(t,n-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 n,i=this.session.documentToScreenPosition(this.lead.row,this.lead.column);if(0===t&&(0!==e&&(this.session.$bidiHandler.isBidiRow(i.row,this.lead.row)?(n=this.session.$bidiHandler.getPosLeft(i.column),i.column=Math.round(n/this.session.$bidiHandler.charWidths[0])):n=i.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?i.column=this.$desiredColumn:this.$desiredColumn=i.column),0!=e&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var o=this.session.lineWidgets[this.lead.row];e<0?e-=o.rowsAbove||0:e>0&&(e+=o.rowCount-(o.rowsAbove||0))}var r=this.session.screenToDocumentPosition(i.row+e,i.column,n);0!==e&&0===t&&r.row===this.lead.row&&(r.column,this.lead.column),this.moveCursorTo(r.row,r.column+t,0===t)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,n){var i=this.session.getFoldAt(e,t,1);i&&(e=i.start.row,t=i.start.column),this.$keepDesiredColumnOnChange=!0;var o=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(o.charAt(t))&&o.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?t-=1:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},this.moveCursorToScreen=function(e,t,n){var i=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(i.row,i.column,n)},this.detach=function(){this.lead.detach(),this.anchor.detach()},this.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},this.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var n=this.getCursor();return s.fromPoints(t,n)}catch(e){return s.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},this.toJSON=function(){if(this.rangeCount)var e=this.ranges.map((function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t}));else(e=this.getRange()).isBackwards=this.isBackwards();return e},this.fromJSON=function(e){if(null==e.start){if(this.rangeList&&e.length>1){this.toSingleRange(e[0]);for(var t=e.length;t--;){var n=s.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(n.cursor=n.start),this.addRange(n,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0}}).call(a.prototype),t.Selection=a})),ace.define("ace/tokenizer",["require","exports","module","ace/config"],(function(e,t,n){"use strict";var i=e("./config"),o=2e3,r=function(e){for(var t in this.states=e,this.regExps={},this.matchMappings={},this.states){for(var n=this.states[t],i=[],o=0,r=this.matchMappings[t]={defaultToken:"text"},s="g",a=[],l=0;l<n.length;l++){var c=n[l];if(c.defaultToken&&(r.defaultToken=c.defaultToken),c.caseInsensitive&&(s="gi"),null!=c.regex){c.regex instanceof RegExp&&(c.regex=c.regex.toString().slice(1,-1));var u=c.regex,h=new RegExp("(?:("+u+")|(.))").exec("a").length-2;Array.isArray(c.token)?1==c.token.length||1==h?c.token=c.token[0]:h-1!=c.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:c,groupCount:h-1}),c.token=c.token[0]):(c.tokenArray=c.token,c.token=null,c.onMatch=this.$arrayTokens):"function"!=typeof c.token||c.onMatch||(c.onMatch=h>1?this.$applyToken:c.token),h>1&&(/\\\d/.test(c.regex)?u=c.regex.replace(/\\([0-9]+)/g,(function(e,t){return"\\"+(parseInt(t,10)+o+1)})):(h=1,u=this.removeCapturingGroups(c.regex)),c.splitRegex||"string"==typeof c.token||a.push(c)),r[o]=l,o+=h,i.push(u),c.onMatch||(c.onMatch=null)}}i.length||(r[0]=0,i.push("$")),a.forEach((function(e){e.splitRegex=this.createSplitterRegexp(e.regex,s)}),this),this.regExps[t]=new RegExp("("+i.join(")|(")+")|($)",s)}};(function(){this.$setMaxTokenCount=function(e){o=0|e},this.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),n=this.token.apply(this,t);if("string"==typeof n)return[{type:n,value:e}];for(var i=[],o=0,r=n.length;o<r;o++)t[o]&&(i[i.length]={type:n[o],value:t[o]});return i},this.$arrayTokens=function(e){if(!e)return[];var t=this.splitRegex.exec(e);if(!t)return"text";for(var n=[],i=this.tokenArray,o=0,r=i.length;o<r;o++)t[o+1]&&(n[n.length]={type:i[o],value:t[o+1]});return n},this.removeCapturingGroups=function(e){return e.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!<]|(\()/g,(function(e,t){return t?"(?:":e}))},this.createSplitterRegexp=function(e,t){if(-1!=e.indexOf("(?=")){var n=0,i=!1,o={};e.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,(function(e,t,r,s,a,l){return i?i="]"!=a:a?i=!0:s?(n==o.stack&&(o.end=l+1,o.stack=-1),n--):r&&(n++,1!=r.length&&(o.stack=n,o.start=l)),e})),null!=o.end&&/^\)*$/.test(e.substr(o.end))&&(e=e.substring(0,o.start)+e.substr(o.end))}return"^"!=e.charAt(0)&&(e="^"+e),"$"!=e.charAt(e.length-1)&&(e+="$"),new RegExp(e,(t||"").replace("g",""))},this.getLineTokens=function(e,t){if(t&&"string"!=typeof t){var n=t.slice(0);"#tmp"===(t=n[0])&&(n.shift(),t=n.shift())}else n=[];var i=t||"start",r=this.states[i];r||(i="start",r=this.states[i]);var s=this.matchMappings[i],a=this.regExps[i];a.lastIndex=0;for(var l,c=[],u=0,h=0,d={type:null,value:""};l=a.exec(e);){var p=s.defaultToken,f=null,g=l[0],m=a.lastIndex;if(m-g.length>u){var v=e.substring(u,m-g.length);d.type==p?d.value+=v:(d.type&&c.push(d),d={type:p,value:v})}for(var b=0;b<l.length-2;b++)if(void 0!==l[b+1]){p=(f=r[s[b]]).onMatch?f.onMatch(g,i,n,e):f.token,f.next&&(i="string"==typeof f.next?f.next:f.next(i,n),(r=this.states[i])||(this.reportError("state doesn't exist",i),i="start",r=this.states[i]),s=this.matchMappings[i],u=m,(a=this.regExps[i]).lastIndex=m),f.consumeLineEnd&&(u=m);break}if(g)if("string"==typeof p)f&&!1===f.merge||d.type!==p?(d.type&&c.push(d),d={type:p,value:g}):d.value+=g;else if(p)for(d.type&&c.push(d),d={type:null,value:""},b=0;b<p.length;b++)c.push(p[b]);if(u==e.length)break;if(u=m,h++>o){for(h>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});u<e.length;)d.type&&c.push(d),d={value:e.substring(u,u+=500),type:"overflow"};i="start",n=[];break}}return d.type&&c.push(d),n.length>1&&n[0]!==i&&n.unshift("#tmp",i),{tokens:c,state:n.length?n:i}},this.reportError=i.reportError}).call(r.prototype),t.Tokenizer=r})),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],(function(e,t,n){"use strict";var i=e("../lib/lang"),o=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(t)for(var n in e){for(var i=e[n],o=0;o<i.length;o++){var r=i[o];(r.next||r.onMatch)&&("string"==typeof r.next&&0!==r.next.indexOf(t)&&(r.next=t+r.next),r.nextState&&0!==r.nextState.indexOf(t)&&(r.nextState=t+r.nextState))}this.$rules[t+n]=i}else for(var n in e)this.$rules[n]=e[n]},this.getRules=function(){return this.$rules},this.embedRules=function(e,t,n,o,r){var s="function"==typeof e?(new e).getRules():e;if(o)for(var a=0;a<o.length;a++)o[a]=t+o[a];else for(var l in o=[],s)o.push(t+l);if(this.addRules(s,t),n){var c=Array.prototype[r?"push":"unshift"];for(a=0;a<o.length;a++)c.apply(this.$rules[o[a]],i.deepCopy(n))}this.$embeds||(this.$embeds=[]),this.$embeds.push(t)},this.getEmbeds=function(){return this.$embeds};var e=function(e,t){return("start"!=e||t.length)&&t.unshift(this.nextState,e),this.nextState},t=function(e,t){return t.shift(),t.shift()||"start"};this.normalizeRules=function(){var n=0,i=this.$rules;Object.keys(i).forEach((function o(r){var s=i[r];s.processed=!0;for(var a=0;a<s.length;a++){var l=s[a],c=null;Array.isArray(l)&&(c=l,l={}),!l.regex&&l.start&&(l.regex=l.start,l.next||(l.next=[]),l.next.push({defaultToken:l.token},{token:l.token+".end",regex:l.end||l.start,next:"pop"}),l.token=l.token+".start",l.push=!0);var u=l.next||l.push;if(u&&Array.isArray(u)){var h=l.stateName;h||("string"!=typeof(h=l.token)&&(h=h[0]||""),i[h]&&(h+=n++)),i[h]=u,l.next=h,o(h)}else"pop"==u&&(l.next=t);if(l.push&&(l.nextState=l.next||l.push,l.next=e,delete l.push),l.rules)for(var d in l.rules)i[d]?i[d].push&&i[d].push.apply(i[d],l.rules[d]):i[d]=l.rules[d];var p="string"==typeof l?l:l.include;if(p&&(c=Array.isArray(p)?p.map((function(e){return i[e]})):i[p]),c){var f=[a,1].concat(c);l.noEscape&&(f=f.filter((function(e){return!e.next}))),s.splice.apply(s,f),a--}l.keywordMap&&(l.token=this.createKeywordMapper(l.keywordMap,l.defaultToken||"text",l.caseInsensitive),delete l.defaultToken)}}),this)},this.createKeywordMapper=function(e,t,n,i){var o=Object.create(null);return this.$keywordList=[],Object.keys(e).forEach((function(t){for(var r=e[t].split(i||"|"),s=r.length;s--;){var a=r[s];this.$keywordList.push(a),n&&(a=a.toLowerCase()),o[a]=t}}),this),e=null,n?function(e){return o[e.toLowerCase()]||t}:function(e){return o[e]||t}},this.getKeywords=function(){return this.$keywords}}).call(o.prototype),t.TextHighlightRules=o})),ace.define("ace/mode/behaviour",["require","exports","module"],(function(e,t,n){"use strict";var i=function(){this.$behaviours={}};(function(){this.add=function(e,t,n){switch(void 0){case this.$behaviours:this.$behaviours={};case this.$behaviours[e]:this.$behaviours[e]={}}this.$behaviours[e][t]=n},this.addBehaviours=function(e){for(var t in e)for(var n in e[t])this.add(t,n,e[t][n])},this.remove=function(e){this.$behaviours&&this.$behaviours[e]&&delete this.$behaviours[e]},this.inherit=function(e,t){if("function"==typeof e)var n=(new e).getBehaviours(t);else n=e.getBehaviours(t);this.addBehaviours(n)},this.getBehaviours=function(e){if(e){for(var t={},n=0;n<e.length;n++)this.$behaviours[e[n]]&&(t[e[n]]=this.$behaviours[e[n]]);return t}return this.$behaviours}}).call(i.prototype),t.Behaviour=i})),ace.define("ace/token_iterator",["require","exports","module","ace/range"],(function(e,t,n){"use strict";var i=e("./range").Range,o=function(e,t,n){this.$session=e,this.$row=t,this.$rowTokens=e.getTokens(t);var i=e.getTokenAt(t,n);this.$tokenIndex=i?i.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(){var e;for(this.$tokenIndex+=1;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,n=e[t].start;if(void 0!==n)return n;for(n=0;t>0;)n+=e[t-=1].value.length;return n},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new i(this.$row,t,this.$row,t+e.value.length)}}).call(o.prototype),t.TokenIterator=o})),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],(function(e,t,n){"use strict";var i,o=e("../../lib/oop"),r=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,a=e("../../lib/lang"),l=["text","paren.rparen","rparen","paren","punctuation.operator"],c=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],u={},h={'"':'"',"'":"'"},d=function(e){var t=-1;if(e.multiSelect&&(t=e.selection.index,u.rangeCount!=e.multiSelect.rangeCount&&(u={rangeCount:e.multiSelect.rangeCount})),u[t])return i=u[t];i=u[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},p=function(e,t,n,i){var o=e.end.row-e.start.row;return{text:n+t+i,selection:[0,e.start.column+1,o,e.end.column+(o?0:1)]}},f=function(e){this.add("braces","insertion",(function(t,n,o,r,s){var l=o.getCursorPosition(),c=r.doc.getLine(l.row);if("{"==s){d(o);var u=o.getSelectionRange(),h=r.doc.getTextRange(u);if(""!==h&&"{"!==h&&o.getWrapBehavioursEnabled())return p(u,h,"{","}");if(f.isSaneInsertion(o,r))return/[\]\}\)]/.test(c[l.column])||o.inMultiSelectMode||e&&e.braces?(f.recordAutoInsert(o,r,"}"),{text:"{}",selection:[1,1]}):(f.recordMaybeInsert(o,r,"{"),{text:"{",selection:[1,1]})}else if("}"==s){if(d(o),"}"==c.substring(l.column,l.column+1)&&null!==r.$findOpeningBracket("}",{column:l.column+1,row:l.row})&&f.isAutoInsertedClosing(l,c,s))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}else{if("\n"==s||"\r\n"==s){d(o);var g="";if(f.isMaybeInsertedClosing(l,c)&&(g=a.stringRepeat("}",i.maybeInsertedBrackets),f.clearMaybeInsertedClosing()),"}"===c.substring(l.column,l.column+1)){var m=r.findMatchingBracket({row:l.row,column:l.column+1},"}");if(!m)return null;var v=this.$getIndent(r.getLine(m.row))}else{if(!g)return void f.clearMaybeInsertedClosing();v=this.$getIndent(c)}var b=v+r.getTabString();return{text:"\n"+b+"\n"+v+g,selection:[1,b.length,1,b.length]}}f.clearMaybeInsertedClosing()}})),this.add("braces","deletion",(function(e,t,n,o,r){var s=o.doc.getTextRange(r);if(!r.isMultiLine()&&"{"==s){if(d(n),"}"==o.doc.getLine(r.start.row).substring(r.end.column,r.end.column+1))return r.end.column++,r;i.maybeInsertedBrackets--}})),this.add("parens","insertion",(function(e,t,n,i,o){if("("==o){d(n);var r=n.getSelectionRange(),s=i.doc.getTextRange(r);if(""!==s&&n.getWrapBehavioursEnabled())return p(r,s,"(",")");if(f.isSaneInsertion(n,i))return f.recordAutoInsert(n,i,")"),{text:"()",selection:[1,1]}}else if(")"==o){d(n);var a=n.getCursorPosition(),l=i.doc.getLine(a.row);if(")"==l.substring(a.column,a.column+1)&&null!==i.$findOpeningBracket(")",{column:a.column+1,row:a.row})&&f.isAutoInsertedClosing(a,l,o))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}})),this.add("parens","deletion",(function(e,t,n,i,o){var r=i.doc.getTextRange(o);if(!o.isMultiLine()&&"("==r&&(d(n),")"==i.doc.getLine(o.start.row).substring(o.start.column+1,o.start.column+2)))return o.end.column++,o})),this.add("brackets","insertion",(function(e,t,n,i,o){if("["==o){d(n);var r=n.getSelectionRange(),s=i.doc.getTextRange(r);if(""!==s&&n.getWrapBehavioursEnabled())return p(r,s,"[","]");if(f.isSaneInsertion(n,i))return f.recordAutoInsert(n,i,"]"),{text:"[]",selection:[1,1]}}else if("]"==o){d(n);var a=n.getCursorPosition(),l=i.doc.getLine(a.row);if("]"==l.substring(a.column,a.column+1)&&null!==i.$findOpeningBracket("]",{column:a.column+1,row:a.row})&&f.isAutoInsertedClosing(a,l,o))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}})),this.add("brackets","deletion",(function(e,t,n,i,o){var r=i.doc.getTextRange(o);if(!o.isMultiLine()&&"["==r&&(d(n),"]"==i.doc.getLine(o.start.row).substring(o.start.column+1,o.start.column+2)))return o.end.column++,o})),this.add("string_dquotes","insertion",(function(e,t,n,i,o){var r=i.$mode.$quotes||h;if(1==o.length&&r[o]){if(this.lineCommentStart&&-1!=this.lineCommentStart.indexOf(o))return;d(n);var s=o,a=n.getSelectionRange(),l=i.doc.getTextRange(a);if(!(""===l||1==l.length&&r[l])&&n.getWrapBehavioursEnabled())return p(a,l,s,s);if(!l){var c=n.getCursorPosition(),u=i.doc.getLine(c.row),f=u.substring(c.column-1,c.column),g=u.substring(c.column,c.column+1),m=i.getTokenAt(c.row,c.column),v=i.getTokenAt(c.row,c.column+1);if("\\"==f&&m&&/escape/.test(m.type))return null;var b,w=m&&/string|escape/.test(m.type),y=!v||/string|escape/.test(v.type);if(g==s)(b=w!==y)&&/string\.end/.test(v.type)&&(b=!1);else{if(w&&!y)return null;if(w&&y)return null;var x=i.$mode.tokenRe;x.lastIndex=0;var C=x.test(f);x.lastIndex=0;var S=x.test(f);if(C||S)return null;if(g&&!/[\s;,.})\]\\]/.test(g))return null;var k=u[c.column-2];if(f==s&&(k==s||x.test(k)))return null;b=!0}return{text:b?s+s:"",selection:[1,1]}}}})),this.add("string_dquotes","deletion",(function(e,t,n,i,o){var r=i.$mode.$quotes||h,s=i.doc.getTextRange(o);if(!o.isMultiLine()&&r.hasOwnProperty(s)&&(d(n),i.doc.getLine(o.start.row).substring(o.start.column+1,o.start.column+2)==s))return o.end.column++,o}))};f.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),i=new s(t,n.row,n.column);if(!this.$matchTokenType(i.getCurrentToken()||"text",l)){if(/[)}\]]/.test(e.session.getLine(n.row)[n.column]))return!0;var o=new s(t,n.row,n.column+1);if(!this.$matchTokenType(o.getCurrentToken()||"text",l))return!1}return i.stepForward(),i.getCurrentTokenRow()!==n.row||this.$matchTokenType(i.getCurrentToken()||"text",c)},f.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},f.recordAutoInsert=function(e,t,n){var o=e.getCursorPosition(),r=t.doc.getLine(o.row);this.isAutoInsertedClosing(o,r,i.autoInsertedLineEnd[0])||(i.autoInsertedBrackets=0),i.autoInsertedRow=o.row,i.autoInsertedLineEnd=n+r.substr(o.column),i.autoInsertedBrackets++},f.recordMaybeInsert=function(e,t,n){var o=e.getCursorPosition(),r=t.doc.getLine(o.row);this.isMaybeInsertedClosing(o,r)||(i.maybeInsertedBrackets=0),i.maybeInsertedRow=o.row,i.maybeInsertedLineStart=r.substr(0,o.column)+n,i.maybeInsertedLineEnd=r.substr(o.column),i.maybeInsertedBrackets++},f.isAutoInsertedClosing=function(e,t,n){return i.autoInsertedBrackets>0&&e.row===i.autoInsertedRow&&n===i.autoInsertedLineEnd[0]&&t.substr(e.column)===i.autoInsertedLineEnd},f.isMaybeInsertedClosing=function(e,t){return i.maybeInsertedBrackets>0&&e.row===i.maybeInsertedRow&&t.substr(e.column)===i.maybeInsertedLineEnd&&t.substr(0,e.column)==i.maybeInsertedLineStart},f.popAutoInsertedClosing=function(){i.autoInsertedLineEnd=i.autoInsertedLineEnd.substr(1),i.autoInsertedBrackets--},f.clearMaybeInsertedClosing=function(){i&&(i.maybeInsertedBrackets=0,i.maybeInsertedRow=-1)},o.inherits(f,r),t.CstyleBehaviour=f})),ace.define("ace/unicode",["require","exports","module"],(function(e,t,n){"use strict";for(var i=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],o=0,r=[],s=0;s<i.length;s+=2)r.push(o+=i[s]),i[s+1]&&r.push(45,o+=i[s+1]);t.wordChars=String.fromCharCode.apply(null,r)})),ace.define("ace/mode/text",["require","exports","module","ace/config","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour/cstyle","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"],(function(e,t,n){"use strict";var i=e("../config"),o=e("../tokenizer").Tokenizer,r=e("./text_highlight_rules").TextHighlightRules,s=e("./behaviour/cstyle").CstyleBehaviour,a=e("../unicode"),l=e("../lib/lang"),c=e("../token_iterator").TokenIterator,u=e("../range").Range,h=function(){this.HighlightRules=r};(function(){this.$defaultBehaviour=new s,this.tokenRe=new RegExp("^["+a.wordChars+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+a.wordChars+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules(this.$highlightRuleConfig),this.$tokenizer=new o(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(e,t,n,i){var o=t.doc,r=!0,s=!0,a=1/0,c=t.getTabSize(),u=!1;if(this.lineCommentStart){Array.isArray(this.lineCommentStart)?(g=this.lineCommentStart.map(l.escapeRegExp).join("|"),p=this.lineCommentStart[0]):(g=l.escapeRegExp(this.lineCommentStart),p=this.lineCommentStart),g=new RegExp("^(\\s*)(?:"+g+") ?"),u=t.getUseSoftTabs(),b=function(e,t){var n=e.match(g);if(n){var i=n[1].length,r=n[0].length;d(e,i,r)||" "!=n[0][r-1]||r--,o.removeInLine(t,i,r)}};var h=p+" ",d=(v=function(e,t){r&&!/\S/.test(e)||(d(e,a,a)?o.insertInLine({row:t,column:a},h):o.insertInLine({row:t,column:a},p))},w=function(e,t){return g.test(e)},function(e,t,n){for(var i=0;t--&&" "==e.charAt(t);)i++;if(i%c!=0)return!1;for(i=0;" "==e.charAt(n++);)i++;return c>2?i%c!=c-1:i%c==0})}else{if(!this.blockComment)return!1;var p=this.blockComment.start,f=this.blockComment.end,g=new RegExp("^(\\s*)(?:"+l.escapeRegExp(p)+")"),m=new RegExp("(?:"+l.escapeRegExp(f)+")\\s*$"),v=function(e,t){w(e,t)||r&&!/\S/.test(e)||(o.insertInLine({row:t,column:e.length},f),o.insertInLine({row:t,column:a},p))},b=function(e,t){var n;(n=e.match(m))&&o.removeInLine(t,e.length-n[0].length,e.length),(n=e.match(g))&&o.removeInLine(t,n[1].length,n[0].length)},w=function(e,n){if(g.test(e))return!0;for(var i=t.getTokens(n),o=0;o<i.length;o++)if("comment"===i[o].type)return!0}}function y(e){for(var t=n;t<=i;t++)e(o.getLine(t),t)}var x=1/0;y((function(e,t){var n=e.search(/\S/);-1!==n?(n<a&&(a=n),s&&!w(e,t)&&(s=!1)):x>e.length&&(x=e.length)})),a==1/0&&(a=x,r=!1,s=!1),u&&a%c!=0&&(a=Math.floor(a/c)*c),y(s?b:v)},this.toggleBlockComment=function(e,t,n,i){var o=this.blockComment;if(o){!o.start&&o[0]&&(o=o[0]);var r,s,a=(g=new c(t,i.row,i.column)).getCurrentToken(),l=(t.selection,t.selection.toOrientedRange());if(a&&/comment/.test(a.type)){for(var h,d;a&&/comment/.test(a.type);){if(-1!=(m=a.value.indexOf(o.start))){var p=g.getCurrentTokenRow(),f=g.getCurrentTokenColumn()+m;h=new u(p,f,p,f+o.start.length);break}a=g.stepBackward()}var g;for(a=(g=new c(t,i.row,i.column)).getCurrentToken();a&&/comment/.test(a.type);){var m;if(-1!=(m=a.value.indexOf(o.end))){p=g.getCurrentTokenRow(),f=g.getCurrentTokenColumn()+m,d=new u(p,f,p,f+o.end.length);break}a=g.stepForward()}d&&t.remove(d),h&&(t.remove(h),r=h.start.row,s=-o.start.length)}else s=o.start.length,r=n.start.row,t.insert(n.end,o.end),t.insert(n.start,o.start);l.start.row==r&&(l.start.column+=s),l.end.row==r&&(l.end.column+=s),t.selection.fromOrientedRange(l)}},this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.autoOutdent=function(e,t,n){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){for(var t in this.$embeds=[],this.$modes={},e)if(e[t]){var n=e[t],o=n.prototype.$id,r=i.$modes[o];r||(i.$modes[o]=r=new n),i.$modes[t]||(i.$modes[t]=r),this.$embeds.push(t),this.$modes[t]=r}var s=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(t=0;t<s.length;t++)!function(e){var n=s[t],i=e[n];e[s[t]]=function(){return this.$delegator(n,arguments,i)}}(this)},this.$delegator=function(e,t,n){var i=t[0]||"start";if("string"!=typeof i){if(Array.isArray(i[2])){var o=i[2][i[2].length-1];if(s=this.$modes[o])return s[e].apply(s,[i[1]].concat([].slice.call(t,1)))}i=i[0]||"start"}for(var r=0;r<this.$embeds.length;r++)if(this.$modes[this.$embeds[r]]){var s,a=i.split(this.$embeds[r]);if(!a[0]&&a[1])return t[0]=a[1],(s=this.$modes[this.$embeds[r]])[e].apply(s,t)}var l=n.apply(this,t);return n?l:void 0},this.transformAction=function(e,t,n,i,o){if(this.$behaviour){var r=this.$behaviour.getBehaviours();for(var s in r)if(r[s][t]){var a=r[s][t].apply(this,arguments);if(a)return a}}},this.getKeywords=function(e){if(!this.completionKeywords){var t=this.$tokenizer.rules,n=[];for(var i in t)for(var o=t[i],r=0,s=o.length;r<s;r++)if("string"==typeof o[r].token)/keyword|support|storage/.test(o[r].token)&&n.push(o[r].regex);else if("object"==typeof o[r].token)for(var a=0,l=o[r].token.length;a<l;a++)/keyword|support|storage/.test(o[r].token[a])&&(i=o[r].regex.match(/\(.+?\)/g)[a],n.push(i.substr(1,i.length-2)));this.completionKeywords=n}return e?n.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(e,t,n,i){return(this.$keywordList||this.$createKeywordList()).map((function(e){return{name:e,value:e,score:0,meta:"keyword"}}))},this.$id="ace/mode/text"}).call(h.prototype),t.Mode=h})),ace.define("ace/apply_delta",["require","exports","module"],(function(e,t,n){"use strict";t.applyDelta=function(e,t,n){var i=t.start.row,o=t.start.column,r=e[i]||"";switch(t.action){case"insert":if(1===t.lines.length)e[i]=r.substring(0,o)+t.lines[0]+r.substring(o);else{var s=[i,1].concat(t.lines);e.splice.apply(e,s),e[i]=r.substring(0,o)+e[i],e[i+t.lines.length-1]+=r.substring(o)}break;case"remove":var a=t.end.column,l=t.end.row;i===l?e[i]=r.substring(0,o)+r.substring(a):e.splice(i,l-i+1,r.substring(0,o)+e[l].substring(a))}}})),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],(function(e,t,n){"use strict";var i=e("./lib/oop"),o=e("./lib/event_emitter").EventEmitter,r=t.Anchor=function(e,t,n){this.$onChange=this.onChange.bind(this),this.attach(e),void 0===n?this.setPosition(t.row,t.column):this.setPosition(t,n)};(function(){function e(e,t,n){var i=n?e.column<=t.column:e.column<t.column;return e.row<t.row||e.row==t.row&&i}i.implement(this,o),this.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},this.getDocument=function(){return this.document},this.$insertRight=!1,this.onChange=function(t){if(!(t.start.row==t.end.row&&t.start.row!=this.row||t.start.row>this.row)){var n=function(t,n,i){var o="insert"==t.action,r=(o?1:-1)*(t.end.row-t.start.row),s=(o?1:-1)*(t.end.column-t.start.column),a=t.start,l=o?a:t.end;return e(n,a,i)?{row:n.row,column:n.column}:e(l,n,!i)?{row:n.row+r,column:n.column+(n.row==l.row?s:0)}:{row:a.row,column:a.column}}(t,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)}},this.setPosition=function(e,t,n){var i;if(i=n?{row:e,column:t}:this.$clipPositionToDocument(e,t),this.row!=i.row||this.column!=i.column){var o={row:this.row,column:this.column};this.row=i.row,this.column=i.column,this._signal("change",{old:o,value:i})}},this.detach=function(){this.document.off("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n}}).call(r.prototype)})),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],(function(e,t,n){"use strict";var i=e("./lib/oop"),o=e("./apply_delta").applyDelta,r=e("./lib/event_emitter").EventEmitter,s=e("./range").Range,a=e("./anchor").Anchor,l=function(e){this.$lines=[""],0===e.length?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){i.implement(this,r),this.setValue=function(e){var t=this.getLength()-1;this.remove(new s(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new a(this,e,t)},0==="aaa".split(/a/).length?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return"\r\n"==e||"\r"==e||"\n"==e},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{(t=this.getLines(e.start.row,e.end.row))[0]=(t[0]||"").substring(e.start.column);var n=t.length-1;e.end.row-e.start.row==n&&(t[n]=t[n].substring(0,e.end.column))}return t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var n=this.clippedPos(e.row,e.column),i=this.pos(e.row,e.column+t.length);return this.applyDelta({start:n,end:i,action:"insert",lines:[t]},!0),this.clonePos(i)},this.clippedPos=function(e,t){var n=this.getLength();void 0===e?e=n:e<0?e=0:e>=n&&(e=n-1,t=void 0);var i=this.getLine(e);return null==t&&(t=i.length),{row:e,column:t=Math.min(Math.max(t,0),i.length)}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,t){var n=0;(e=Math.min(Math.max(e,0),this.getLength()))<this.getLength()?(t=t.concat([""]),n=0):(t=[""].concat(t),e--,n=this.$lines[e].length),this.insertMergedLines({row:e,column:n},t)},this.insertMergedLines=function(e,t){var n=this.clippedPos(e.row,e.column),i={row:n.row+t.length-1,column:(1==t.length?n.column:0)+t[t.length-1].length};return this.applyDelta({start:n,end:i,action:"insert",lines:t}),this.clonePos(i)},this.remove=function(e){var t=this.clippedPos(e.start.row,e.start.column),n=this.clippedPos(e.end.row,e.end.column);return this.applyDelta({start:t,end:n,action:"remove",lines:this.getLinesForRange({start:t,end:n})}),this.clonePos(t)},this.removeInLine=function(e,t,n){var i=this.clippedPos(e,t),o=this.clippedPos(e,n);return this.applyDelta({start:i,end:o,action:"remove",lines:this.getLinesForRange({start:i,end:o})},!0),this.clonePos(i)},this.removeFullLines=function(e,t){e=Math.min(Math.max(0,e),this.getLength()-1);var n=(t=Math.min(Math.max(0,t),this.getLength()-1))==this.getLength()-1&&e>0,i=t<this.getLength()-1,o=n?e-1:e,r=n?this.getLine(o).length:0,a=i?t+1:t,l=i?0:this.getLine(a).length,c=new s(o,r,a,l),u=this.$lines.slice(e,t+1);return this.applyDelta({start:c.start,end:c.end,action:"remove",lines:this.getLinesForRange(c)}),u},this.removeNewLine=function(e){e<this.getLength()-1&&e>=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){return e instanceof s||(e=s.fromPoints(e.start,e.end)),0===t.length&&e.isEmpty()?e.start:t==this.getTextRange(e)?e.end:(this.remove(e),t?this.insert(e.start,t):e.start)},this.applyDeltas=function(e){for(var t=0;t<e.length;t++)this.applyDelta(e[t])},this.revertDeltas=function(e){for(var t=e.length-1;t>=0;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var n="insert"==e.action;(n?e.lines.length<=1&&!e.lines[0]:!s.comparePoints(e.start,e.end))||(n&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(o(this.$lines,e,t),this._signal("change",e)))},this.$safeApplyDelta=function(e){var t=this.$lines.length;("remove"==e.action&&e.start.row<t&&e.end.row<t||"insert"==e.action&&e.start.row<=t)&&this.applyDelta(e)},this.$splitAndapplyLargeDelta=function(e,t){for(var n=e.lines,i=n.length-t+1,o=e.start.row,r=e.start.column,s=0,a=0;s<i;s=a){a+=t-1;var l=n.slice(s,a);l.push(""),this.applyDelta({start:this.pos(o+s,r),end:this.pos(o+a,r=0),action:e.action,lines:l},!0)}e.lines=n.slice(s),e.start.row=o+s,e.start.column=r,this.applyDelta(e,!0)},this.revertDelta=function(e){this.$safeApplyDelta({start:this.clonePos(e.start),end:this.clonePos(e.end),action:"insert"==e.action?"remove":"insert",lines:e.lines.slice()})},this.indexToPosition=function(e,t){for(var n=this.$lines||this.getAllLines(),i=this.getNewLineCharacter().length,o=t||0,r=n.length;o<r;o++)if((e-=n[o].length+i)<0)return{row:o,column:e+n[o].length+i};return{row:r-1,column:e+n[r-1].length+i}},this.positionToIndex=function(e,t){for(var n=this.$lines||this.getAllLines(),i=this.getNewLineCharacter().length,o=0,r=Math.min(e.row,n.length),s=t||0;s<r;++s)o+=n[s].length+i;return o+e.column}}).call(l.prototype),t.Document=l})),ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],(function(e,t,n){"use strict";var i=e("./lib/oop"),o=e("./lib/event_emitter").EventEmitter,r=function(e,t){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=e;var n=this;this.$worker=function(){if(n.running){for(var e=new Date,t=n.currentLine,i=-1,o=n.doc,r=t;n.lines[t];)t++;var s=o.getLength(),a=0;for(n.running=!1;t<s;){n.$tokenizeRow(t),i=t;do{t++}while(n.lines[t]);if(++a%5==0&&new Date-e>20){n.running=setTimeout(n.$worker,20);break}}n.currentLine=t,-1==i&&(i=t),r<=i&&n.fireUpdateEvent(r,i)}}};(function(){i.implement(this,o),this.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(e,t){var n={first:e,last:t};this._signal("update",{data:n})},this.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.lines[t]=null;else if("remove"==e.action)this.lines.splice(t,n+1,null),this.states.splice(t,n+1,null);else{var i=Array(n+1);i.unshift(t,1),this.lines.splice.apply(this.lines,i),this.states.splice.apply(this.states,i)}this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},this.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},this.$tokenizeRow=function(e){var t=this.doc.getLine(e),n=this.states[e-1],i=this.tokenizer.getLineTokens(t,n,e);return this.states[e]+""!=i.state+""?(this.states[e]=i.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=i.tokens}}).call(r.prototype),t.BackgroundTokenizer=r})),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],(function(e,t,n){"use strict";var i=e("./lib/lang"),o=(e("./lib/oop"),e("./range").Range),r=function(e,t,n){this.setRegexp(e),this.clazz=t,this.type=n||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(e){this.regExp+""!=e+""&&(this.regExp=e,this.cache=[])},this.update=function(e,t,n,r){if(this.regExp)for(var s=r.firstRow,a=r.lastRow,l=s;l<=a;l++){var c=this.cache[l];null==c&&((c=i.getMatchOffsets(n.getLine(l),this.regExp)).length>this.MAX_RANGES&&(c=c.slice(0,this.MAX_RANGES)),c=c.map((function(e){return new o(l,e.offset,l,e.offset+e.length)})),this.cache[l]=c.length?c:"");for(var u=c.length;u--;)t.drawSingleLineMarker(e,c[u].toScreenRange(n),this.clazz,r)}}}).call(r.prototype),t.SearchHighlight=r})),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],(function(e,t,n){"use strict";var i=e("../range").Range;function o(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t];var n=t[t.length-1];this.range=new i(t[0].start.row,t[0].start.column,n.end.row,n.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach((function(e){e.setFoldLine(this)}),this)}(function(){this.shiftRow=function(e){this.start.row+=e,this.end.row+=e,this.folds.forEach((function(t){t.start.row+=e,t.end.row+=e}))},this.addFold=function(e){if(e.sameRow){if(e.start.row<this.startRow||e.endRow>this.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(e),this.folds.sort((function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)})),this.range.compareEnd(e.start.row,e.start.column)>0?(this.end.row=e.end.row,this.end.column=e.end.column):this.range.compareStart(e.end.row,e.end.column)<0&&(this.start.row=e.start.row,this.start.column=e.start.column)}else if(e.start.row==this.end.row)this.folds.push(e),this.end.row=e.end.row,this.end.column=e.end.column;else{if(e.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},this.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},this.walk=function(e,t,n){var i,o,r=0,s=this.folds,a=!0;null==t&&(t=this.end.row,n=this.end.column);for(var l=0;l<s.length;l++){if(-1==(o=(i=s[l]).range.compareStart(t,n)))return void e(null,t,n,r,a);if(!e(null,i.start.row,i.start.column,r,a)&&e(i.placeholder,i.start.row,i.start.column,r)||0===o)return;a=!i.sameRow,r=i.end.column}e(null,t,n,r,a)},this.getNextFoldTo=function(e,t){for(var n,i,o=0;o<this.folds.length;o++){if(-1==(i=(n=this.folds[o]).range.compareEnd(e,t)))return{fold:n,kind:"after"};if(0===i)return{fold:n,kind:"inside"}}return null},this.addRemoveChars=function(e,t,n){var i,o,r=this.getNextFoldTo(e,t);if(r)if(i=r.fold,"inside"==r.kind&&i.start.column!=t&&i.start.row!=e)window.console&&window.console.log(e,t,i);else if(i.start.row==e){var s=(o=this.folds).indexOf(i);for(0===s&&(this.start.column+=n);s<o.length;s++){if((i=o[s]).start.column+=n,!i.sameRow)return;i.end.column+=n}this.end.column+=n}},this.split=function(e,t){var n=this.getNextFoldTo(e,t);if(!n||"inside"==n.kind)return null;var i=n.fold,r=this.folds,s=this.foldData,a=r.indexOf(i),l=r[a-1];this.end.row=l.end.row,this.end.column=l.end.column;var c=new o(s,r=r.splice(a,r.length-a));return s.splice(s.indexOf(this)+1,0,c),c},this.merge=function(e){for(var t=e.folds,n=0;n<t.length;n++)this.addFold(t[n]);var i=this.foldData;i.splice(i.indexOf(e),1)},this.toString=function(){var e=[this.range.toString()+": ["];return this.folds.forEach((function(t){e.push("  "+t.toString())})),e.push("]"),e.join("\n")},this.idxToPosition=function(e){for(var t=0,n=0;n<this.folds.length;n++){var i=this.folds[n];if((e-=i.start.column-t)<0)return{row:i.start.row,column:i.start.column+e};if((e-=i.placeholder.length)<0)return i.start;t=i.end.column}return{row:this.end.row,column:this.end.column+e}}}).call(o.prototype),t.FoldLine=o})),ace.define("ace/range_list",["require","exports","module","ace/range"],(function(e,t,n){"use strict";var i=e("./range").Range.comparePoints,o=function(){this.ranges=[],this.$bias=1};(function(){this.comparePoints=i,this.pointIndex=function(e,t,n){for(var o=this.ranges,r=n||0;r<o.length;r++){var s=o[r],a=i(e,s.end);if(!(a>0)){var l=i(e,s.start);return 0===a?t&&0!==l?-r-2:r:l>0||0===l&&!t?r:-r-1}}return-r-1},this.add=function(e){var t=!e.isEmpty(),n=this.pointIndex(e.start,t);n<0&&(n=-n-1);var i=this.pointIndex(e.end,t,n);return i<0?i=-i-1:i++,this.ranges.splice(n,i-n,e)},this.addList=function(e){for(var t=[],n=e.length;n--;)t.push.apply(t,this.add(e[n]));return t},this.substractPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges.splice(t,1)},this.merge=function(){for(var e,t=[],n=this.ranges,o=(n=n.sort((function(e,t){return i(e.start,t.start)})))[0],r=1;r<n.length;r++){e=o,o=n[r];var s=i(e.end,o.start);s<0||(0!=s||e.isEmpty()||o.isEmpty())&&(i(e.end,o.end)<0&&(e.end.row=o.end.row,e.end.column=o.end.column),n.splice(r,1),t.push(o),o=e,r--)}return this.ranges=n,t},this.contains=function(e,t){return this.pointIndex({row:e,column:t})>=0},this.containsPoint=function(e){return this.pointIndex(e)>=0},this.rangeAtPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges[t]},this.clipRows=function(e,t){var n=this.ranges;if(n[0].start.row>t||n[n.length-1].start.row<e)return[];var i=this.pointIndex({row:e,column:0});i<0&&(i=-i-1);var o=this.pointIndex({row:t,column:0},i);o<0&&(o=-o-1);for(var r=[],s=i;s<o;s++)r.push(n[s]);return r},this.removeAll=function(){return this.ranges.splice(0,this.ranges.length)},this.attach=function(e){this.session&&this.detach(),this.session=e,this.onChange=this.$onChange.bind(this),this.session.on("change",this.onChange)},this.detach=function(){this.session&&(this.session.removeListener("change",this.onChange),this.session=null)},this.$onChange=function(e){for(var t=e.start,n=e.end,i=t.row,o=n.row,r=this.ranges,s=0,a=r.length;s<a&&!((u=r[s]).end.row>=i);s++);if("insert"==e.action){for(var l=o-i,c=-t.column+n.column;s<a&&!((u=r[s]).start.row>i);s++)if(u.start.row==i&&u.start.column>=t.column&&(u.start.column==t.column&&this.$bias<=0||(u.start.column+=c,u.start.row+=l)),u.end.row==i&&u.end.column>=t.column){if(u.end.column==t.column&&this.$bias<0)continue;u.end.column==t.column&&c>0&&s<a-1&&u.end.column>u.start.column&&u.end.column==r[s+1].start.column&&(u.end.column-=c),u.end.column+=c,u.end.row+=l}}else for(l=i-o,c=t.column-n.column;s<a&&!((u=r[s]).start.row>o);s++)u.end.row<o&&(i<u.end.row||i==u.end.row&&t.column<u.end.column)?(u.end.row=i,u.end.column=t.column):u.end.row==o?u.end.column<=n.column?(l||u.end.column>t.column)&&(u.end.column=t.column,u.end.row=t.row):(u.end.column+=c,u.end.row+=l):u.end.row>o&&(u.end.row+=l),u.start.row<o&&(i<u.start.row||i==u.start.row&&t.column<u.start.column)?(u.start.row=i,u.start.column=t.column):u.start.row==o?u.start.column<=n.column?(l||u.start.column>t.column)&&(u.start.column=t.column,u.start.row=t.row):(u.start.column+=c,u.start.row+=l):u.start.row>o&&(u.start.row+=l);if(0!=l&&s<a)for(;s<a;s++){var u;(u=r[s]).start.row+=l,u.end.row+=l}}}).call(o.prototype),t.RangeList=o})),ace.define("ace/edit_session/fold",["require","exports","module","ace/range_list","ace/lib/oop"],(function(e,t,n){"use strict";var i=e("../range_list").RangeList,o=e("../lib/oop"),r=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=[]};function s(e,t){e.row-=t.row,0==e.row&&(e.column-=t.column)}function a(e,t){0==e.row&&(e.column+=t.column),e.row+=t.row}o.inherits(r,i),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(){var e=this.range.clone(),t=new r(e,this.placeholder);return this.subFolds.forEach((function(e){t.subFolds.push(e.clone())})),t.collapseChildren=this.collapseChildren,t},this.addSubFold=function(e){if(!this.range.isEqual(e)){var t,n;t=e,n=this.start,s(t.start,n),s(t.end,n);for(var i=e.start.row,o=e.start.column,r=0,a=-1;r<this.subFolds.length&&1==(a=this.subFolds[r].range.compare(i,o));r++);var l=this.subFolds[r],c=0;if(0==a){if(l.range.containsRange(e))return l.addSubFold(e);c=1}i=e.range.end.row,o=e.range.end.column;var u=r;for(a=-1;u<this.subFolds.length&&1==(a=this.subFolds[u].range.compare(i,o));u++);0==a&&u++;for(var h=this.subFolds.splice(r,u-r,e),d=0==a?h.length-1:h.length,p=c;p<d;p++)e.addSubFold(h[p]);return e.setFoldLine(this.foldLine),e}},this.restoreRange=function(e){return function(e,t){a(e.start,t),a(e.end,t)}(e,this.start)}}.call(r.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,n){"use strict";var i=e("../range").Range,o=e("./fold_line").FoldLine,r=e("./fold").Fold,s=e("../token_iterator").TokenIterator;t.Folding=function(){this.getFoldAt=function(e,t,n){var i=this.getFoldLine(e);if(!i)return null;for(var o=i.folds,r=0;r<o.length;r++){var s=o[r].range;if(s.contains(e,t)){if(1==n&&s.isEnd(e,t)&&!s.isEmpty())continue;if(-1==n&&s.isStart(e,t)&&!s.isEmpty())continue;return o[r]}}},this.getFoldsInRange=function(e){var t=e.start,n=e.end,i=this.$foldData,o=[];t.column+=1,n.column-=1;for(var r=0;r<i.length;r++){var s=i[r].range.compareRange(e);if(2!=s){if(-2==s)break;for(var a=i[r].folds,l=0;l<a.length;l++){var c=a[l];if(-2==(s=c.range.compareRange(e)))break;if(2!=s){if(42==s)break;o.push(c)}}}}return t.column-=1,n.column+=1,o},this.getFoldsInRangeList=function(e){if(Array.isArray(e)){var t=[];e.forEach((function(e){t=t.concat(this.getFoldsInRange(e))}),this)}else t=this.getFoldsInRange(e);return t},this.getAllFolds=function(){for(var e=[],t=this.$foldData,n=0;n<t.length;n++)for(var i=0;i<t[n].folds.length;i++)e.push(t[n].folds[i]);return e},this.getFoldStringAt=function(e,t,n,i){if(!(i=i||this.getFoldLine(e)))return null;for(var o,r,s={end:{column:0}},a=0;a<i.folds.length;a++){var l=(r=i.folds[a]).range.compareEnd(e,t);if(-1==l){o=this.getLine(r.start.row).substring(s.end.column,r.start.column);break}if(0===l)return null;s=r}return o||(o=this.getLine(r.start.row).substring(s.end.column)),-1==n?o.substring(0,t-s.end.column):1==n?o.substring(t-s.end.column):o},this.getFoldLine=function(e,t){var n=this.$foldData,i=0;for(t&&(i=n.indexOf(t)),-1==i&&(i=0);i<n.length;i++){var o=n[i];if(o.start.row<=e&&o.end.row>=e)return o;if(o.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var n=this.$foldData,i=0;for(t&&(i=n.indexOf(t)),-1==i&&(i=0);i<n.length;i++){var o=n[i];if(o.end.row>=e)return o}return null},this.getFoldedRowCount=function(e,t){for(var n=this.$foldData,i=t-e+1,o=0;o<n.length;o++){var r=n[o],s=r.end.row,a=r.start.row;if(s>=t){a<t&&(a>=e?i-=t-a:i=0);break}s>=e&&(i-=a>=e?s-a:s-e+1)}return i},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort((function(e,t){return e.start.row-t.start.row})),e},this.addFold=function(e,t){var n,i=this.$foldData,s=!1;e instanceof r?n=e:(n=new r(t,e)).collapseChildren=t.collapseChildren,this.$clipRangeToDocument(n.range);var a=n.start.row,l=n.start.column,c=n.end.row,u=n.end.column,h=this.getFoldAt(a,l,1),d=this.getFoldAt(c,u,-1);if(h&&d==h)return h.addSubFold(n);h&&!h.range.isStart(a,l)&&this.removeFold(h),d&&!d.range.isEnd(c,u)&&this.removeFold(d);var p=this.getFoldsInRange(n.range);p.length>0&&(this.removeFolds(p),n.collapseChildren||p.forEach((function(e){n.addSubFold(e)})));for(var f=0;f<i.length;f++){var g=i[f];if(c==g.start.row){g.addFold(n),s=!0;break}if(a==g.end.row){if(g.addFold(n),s=!0,!n.sameRow){var m=i[f+1];if(m&&m.start.row==c){g.merge(m);break}}break}if(c<=g.start.row)break}return s||(g=this.$addFoldLine(new o(this.$foldData,n))),this.$useWrapMode?this.$updateWrapData(g.start.row,g.start.row):this.$updateRowLengthCache(g.start.row,g.start.row),this.$modified=!0,this._signal("changeFold",{data:n,action:"add"}),n},this.addFolds=function(e){e.forEach((function(e){this.addFold(e)}),this)},this.removeFold=function(e){var t=e.foldLine,n=t.start.row,i=t.end.row,o=this.$foldData,r=t.folds;if(1==r.length)o.splice(o.indexOf(t),1);else if(t.range.isEnd(e.end.row,e.end.column))r.pop(),t.end.row=r[r.length-1].end.row,t.end.column=r[r.length-1].end.column;else if(t.range.isStart(e.start.row,e.start.column))r.shift(),t.start.row=r[0].start.row,t.start.column=r[0].start.column;else if(e.sameRow)r.splice(r.indexOf(e),1);else{var s=t.split(e.start.row,e.start.column);(r=s.folds).shift(),s.start.row=r[0].start.row,s.start.column=r[0].start.column}this.$updating||(this.$useWrapMode?this.$updateWrapData(n,i):this.$updateRowLengthCache(n,i)),this.$modified=!0,this._signal("changeFold",{data:e,action:"remove"})},this.removeFolds=function(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n]);t.forEach((function(e){this.removeFold(e)}),this),this.$modified=!0},this.expandFold=function(e){this.removeFold(e),e.subFolds.forEach((function(t){e.restoreRange(t),this.addFold(t)}),this),e.collapseChildren>0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach((function(e){this.expandFold(e)}),this)},this.unfold=function(e,t){var n,o;if(null==e)n=new i(0,0,this.getLength(),0),null==t&&(t=!0);else if("number"==typeof e)n=new i(e,0,e,this.getLine(e).length);else if("row"in e)n=i.fromPoints(e,e);else{if(Array.isArray(e))return o=[],e.forEach((function(e){o=o.concat(this.unfold(e))}),this),o;n=e}for(var r=o=this.getFoldsInRangeList(n);1==o.length&&i.comparePoints(o[0].start,n.start)<0&&i.comparePoints(o[0].end,n.end)>0;)this.expandFolds(o),o=this.getFoldsInRangeList(n);if(0!=t?this.removeFolds(o):this.expandFolds(o),r.length)return r},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var n=this.getFoldLine(e,t);return n?n.end.row:e},this.getRowFoldStart=function(e,t){var n=this.getFoldLine(e,t);return n?n.start.row:e},this.getFoldDisplayLine=function(e,t,n,i,o){null==i&&(i=e.start.row),null==o&&(o=0),null==t&&(t=e.end.row),null==n&&(n=this.getLine(t).length);var r=this.doc,s="";return e.walk((function(e,t,n,a){if(!(t<i)){if(t==i){if(n<o)return;a=Math.max(o,a)}s+=null!=e?e:r.getLine(t).substring(a,n)}}),t,n),s},this.getDisplayLine=function(e,t,n,i){var o,r=this.getFoldLine(e);return r?this.getFoldDisplayLine(r,e,t,n,i):(o=this.doc.getLine(e)).substring(i||0,t||o.length)},this.$cloneFoldData=function(){var e=[];return e=this.$foldData.map((function(t){var n=t.folds.map((function(e){return e.clone()}));return new o(e,n)}))},this.toggleFold=function(e){var t,n,i=this.selection.getRange();if(i.isEmpty()){var o=i.start;if(t=this.getFoldAt(o.row,o.column))return void this.expandFold(t);(n=this.findMatchingBracket(o))?1==i.comparePoint(n)?i.end=n:(i.start=n,i.start.column++,i.end.column--):(n=this.findMatchingBracket({row:o.row,column:o.column+1}))?(1==i.comparePoint(n)?i.end=n:i.start=n,i.start.column++):i=this.getCommentFoldRange(o.row,o.column)||i}else{var r=this.getFoldsInRange(i);if(e&&r.length)return void this.expandFolds(r);1==r.length&&(t=r[0])}if(t||(t=this.getFoldAt(i.start.row,i.start.column)),t&&t.range.toString()==i.toString())this.expandFold(t);else{var s="...";if(!i.isMultiLine()){if((s=this.getTextRange(i)).length<4)return;s=s.trim().substring(0,2)+".."}this.addFold(s,i)}},this.getCommentFoldRange=function(e,t,n){var o=new s(this,e,t),r=o.getCurrentToken(),a=r&&r.type;if(r&&/^comment|string/.test(a)){"comment"==(a=a.match(/comment|string/)[0])&&(a+="|doc-start");var l=new RegExp(a),c=new i;if(1!=n){do{r=o.stepBackward()}while(r&&l.test(r.type));o.stepForward()}if(c.start.row=o.getCurrentTokenRow(),c.start.column=o.getCurrentTokenColumn()+2,o=new s(this,e,t),-1!=n){var u=-1;do{if(r=o.stepForward(),-1==u){var h=this.getState(o.$row);l.test(h)||(u=o.$row)}else if(o.$row>u)break}while(r&&l.test(r.type));r=o.stepBackward()}else r=o.getCurrentToken();return c.end.row=o.getCurrentTokenRow(),c.end.column=o.getCurrentTokenColumn()+r.value.length-2,c}},this.foldAll=function(e,t,n,i){null==n&&(n=1e5);var o=this.foldWidgets;if(o){t=t||this.getLength();for(var r=e=e||0;r<t;r++)if(null==o[r]&&(o[r]=this.getFoldWidget(r)),"start"==o[r]&&(!i||i(r))){var s=this.getFoldWidgetRange(r);s&&s.isMultiLine()&&s.end.row<=t&&s.start.row>=e&&(r=s.end.row,s.collapseChildren=n,this.addFold("...",s))}}},this.foldToLevel=function(e){for(this.foldAll();e-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var e=this;this.foldAll(null,null,null,(function(t){for(var n=e.getTokens(t),i=0;i<n.length;i++){var o=n[i];if("text"!=o.type||!/^\s+$/.test(o.value))return!!/comment/.test(o.type)}}))},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){this.$foldMode!=e&&(this.$foldMode=e,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),e&&"manual"!=this.$foldStyle?(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.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)):this.foldWidgets=null)},this.getParentFoldRangeData=function(e,t){var n=this.foldWidgets;if(!n||t&&n[e])return{};for(var i,o=e-1;o>=0;){var r=n[o];if(null==r&&(r=n[o]=this.getFoldWidget(o)),"start"==r){var s=this.getFoldWidgetRange(o);if(i||(i=s),s&&s.end.row>=e)break}o--}return{range:-1!==o&&s,firstRange:i}},this.onFoldWidgetClick=function(e,t){var n={children:(t=t.domEvent).shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};if(!this.$toggleFoldWidget(e,n)){var i=t.target||t.srcElement;i&&/ace_fold-widget/.test(i.className)&&(i.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(this.getFoldWidget){var n=this.getFoldWidget(e),i=this.getLine(e),o="end"===n?-1:1,r=this.getFoldAt(e,-1===o?0:i.length,o);if(r)return t.children||t.all?this.removeFold(r):this.expandFold(r),r;var s=this.getFoldWidgetRange(e,!0);if(s&&!s.isMultiLine()&&(r=this.getFoldAt(s.start.row,s.start.column,1))&&s.isEqual(r.range))return this.removeFold(r),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,c,t.all?1e4:0)):s&&(t.all&&(s.collapseChildren=1e4),this.addFold("...",s));return s}},this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var n=this.$toggleFoldWidget(t,{});if(!n){var i=this.getParentFoldRangeData(t,!0);if(n=i.range||i.firstRange){t=n.start.row;var o=this.getFoldAt(t,this.getLine(t).length,1);o?this.removeFold(o):this.addFold("...",n)}}},this.updateFoldWidgets=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.foldWidgets[t]=null;else if("remove"==e.action)this.foldWidgets.splice(t,n+1,null);else{var i=Array(n+1);i.unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,i)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}})),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],(function(e,t,n){"use strict";var i=e("../token_iterator").TokenIterator,o=e("../range").Range;t.BracketMatch=function(){this.findMatchingBracket=function(e,t){if(0==e.column)return null;var n=t||this.getLine(e.row).charAt(e.column-1);if(""==n)return null;var i=n.match(/([\(\[\{])|([\)\]\}])/);return i?i[1]?this.$findClosingBracket(i[1],e):this.$findOpeningBracket(i[2],e):null},this.getBracketRange=function(e){var t,n=this.getLine(e.row),i=!0,r=n.charAt(e.column-1),s=r&&r.match(/([\(\[\{])|([\)\]\}])/);if(s||(r=n.charAt(e.column),e={row:e.row,column:e.column+1},s=r&&r.match(/([\(\[\{])|([\)\]\}])/),i=!1),!s)return null;if(s[1]){if(!(a=this.$findClosingBracket(s[1],e)))return null;t=o.fromPoints(e,a),i||(t.end.column++,t.start.column--),t.cursor=t.end}else{var a;if(!(a=this.$findOpeningBracket(s[2],e)))return null;t=o.fromPoints(a,e),i||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.getMatchingBracketRanges=function(e){var t=this.getLine(e.row),n=t.charAt(e.column-1),i=n&&n.match(/([\(\[\{])|([\)\]\}])/);if(i||(n=t.charAt(e.column),e={row:e.row,column:e.column+1},i=n&&n.match(/([\(\[\{])|([\)\]\}])/)),!i)return null;var r=new o(e.row,e.column-1,e.row,e.column),s=i[1]?this.$findClosingBracket(i[1],e):this.$findOpeningBracket(i[2],e);return s?[r,new o(s.row,s.column,s.row,s.column+1)]:[r]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(e,t,n){var o=this.$brackets[e],r=1,s=new i(this,t.row,t.column),a=s.getCurrentToken();if(a||(a=s.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-s.getCurrentTokenColumn()-2,c=a.value;;){for(;l>=0;){var u=c.charAt(l);if(u==o){if(0==(r-=1))return{row:s.getCurrentTokenRow(),column:l+s.getCurrentTokenColumn()}}else u==e&&(r+=1);l-=1}do{a=s.stepBackward()}while(a&&!n.test(a.type));if(null==a)break;l=(c=a.value).length-1}return null}},this.$findClosingBracket=function(e,t,n){var o=this.$brackets[e],r=1,s=new i(this,t.row,t.column),a=s.getCurrentToken();if(a||(a=s.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-s.getCurrentTokenColumn();;){for(var c=a.value,u=c.length;l<u;){var h=c.charAt(l);if(h==o){if(0==(r-=1))return{row:s.getCurrentTokenRow(),column:l+s.getCurrentTokenColumn()}}else h==e&&(r+=1);l+=1}do{a=s.stepForward()}while(a&&!n.test(a.type));if(null==a)break;l=0}return null}}}})),ace.define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/bidihandler","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/document","ace/background_tokenizer","ace/search_highlight","ace/edit_session/folding","ace/edit_session/bracket_match"],(function(e,t,n){"use strict";var i=e("./lib/oop"),o=e("./lib/lang"),r=e("./bidihandler").BidiHandler,s=e("./config"),a=e("./lib/event_emitter").EventEmitter,l=e("./selection").Selection,c=e("./mode/text").Mode,u=e("./range").Range,h=e("./document").Document,d=e("./background_tokenizer").BackgroundTokenizer,p=e("./search_highlight").SearchHighlight,f=function(e,t){this.$breakpoints=[],this.$decorations=[],this.$frontMarkers={},this.$backMarkers={},this.$markerId=1,this.$undoSelect=!0,this.$foldData=[],this.id="session"+ ++f.$uid,this.$foldData.toString=function(){return this.join("\n")},this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),"object"==typeof e&&e.getLine||(e=new h(e)),this.setDocument(e),this.selection=new l(this),this.$bidiHandler=new r(this),s.resetOptions(this),this.setMode(t),s._signal("session",this)};f.$uid=0,function(){i.implement(this,a),this.setDocument=function(e){this.doc&&this.doc.off("change",this.$onChange),this.doc=e,e.on("change",this.$onChange),this.bgTokenizer&&this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},this.getDocument=function(){return this.doc},this.$resetRowCache=function(e){if(!e)return this.$docRowCache=[],void(this.$screenRowCache=[]);var t=this.$docRowCache.length,n=this.$getRowCacheIndex(this.$docRowCache,e)+1;t>n&&(this.$docRowCache.splice(n,t),this.$screenRowCache.splice(n,t))},this.$getRowCacheIndex=function(e,t){for(var n=0,i=e.length-1;n<=i;){var o=n+i>>1,r=e[o];if(t>r)n=o+1;else{if(!(t<r))return o;i=o-1}}return n-1},this.resetCaches=function(){this.$modified=!0,this.$wrapData=[],this.$rowLengthCache=[],this.$resetRowCache(0),this.bgTokenizer&&this.bgTokenizer.start(0)},this.onChangeFold=function(e){var t=e.data;this.$resetRowCache(t.start.row)},this.onChange=function(e){this.$modified=!0,this.$bidiHandler.onChange(e),this.$resetRowCache(e.start.row);var t=this.$updateInternalDataOnChange(e);!this.$fromUndo&&this.$undoManager&&(t&&t.length&&(this.$undoManager.add({action:"removeFolds",folds:t},this.mergeUndoDeltas),this.mergeUndoDeltas=!0),this.$undoManager.add(e,this.mergeUndoDeltas),this.mergeUndoDeltas=!0,this.$informUndoManager.schedule()),this.bgTokenizer&&this.bgTokenizer.$updateOnChange(e),this._signal("change",e)},this.setValue=function(e){this.doc.setValue(e),this.selection.moveTo(0,0),this.$resetRowCache(0),this.setUndoManager(this.$undoManager),this.getUndoManager().reset()},this.getValue=this.toString=function(){return this.doc.getValue()},this.getSelection=function(){return this.selection},this.getState=function(e){return this.bgTokenizer.getState(e)},this.getTokens=function(e){return this.bgTokenizer.getTokens(e)},this.getTokenAt=function(e,t){var n,i=this.bgTokenizer.getTokens(e),o=0;if(null==t){var r=i.length-1;o=this.getLine(e).length}else for(r=0;r<i.length&&!((o+=i[r].value.length)>=t);r++);return(n=i[r])?(n.index=r,n.start=o-n.value.length,n):null},this.setUndoManager=function(e){if(this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel(),e){var t=this;e.addSession(this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=o.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?o.stringRepeat(" ",this.getTabSize()):"\t"},this.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(e){this.setOption("tabSize",e)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize==0},this.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(e){this.setOption("overwrite",e)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t<e.length;t++)this.$breakpoints[e[t]]="ace_breakpoint";this._signal("changeBreakpoint",{})},this.clearBreakpoints=function(){this.$breakpoints=[],this._signal("changeBreakpoint",{})},this.setBreakpoint=function(e,t){void 0===t&&(t="ace_breakpoint"),t?this.$breakpoints[e]=t:delete this.$breakpoints[e],this._signal("changeBreakpoint",{})},this.clearBreakpoint=function(e){delete this.$breakpoints[e],this._signal("changeBreakpoint",{})},this.addMarker=function(e,t,n,i){var o=this.$markerId++,r={range:e,type:n||"line",renderer:"function"==typeof n?n:null,clazz:t,inFront:!!i,id:o};return i?(this.$frontMarkers[o]=r,this._signal("changeFrontMarker")):(this.$backMarkers[o]=r,this._signal("changeBackMarker")),o},this.addDynamicMarker=function(e,t){if(e.update){var n=this.$markerId++;return e.id=n,e.inFront=!!t,t?(this.$frontMarkers[n]=e,this._signal("changeFrontMarker")):(this.$backMarkers[n]=e,this._signal("changeBackMarker")),e}},this.removeMarker=function(e){var t=this.$frontMarkers[e]||this.$backMarkers[e];t&&(delete(t.inFront?this.$frontMarkers:this.$backMarkers)[e],this._signal(t.inFront?"changeFrontMarker":"changeBackMarker"))},this.getMarkers=function(e){return e?this.$frontMarkers:this.$backMarkers},this.highlight=function(e){if(!this.$searchHighlight){var t=new p(null,"ace_selected-word","text");this.$searchHighlight=this.addDynamicMarker(t)}this.$searchHighlight.setRegexp(e)},this.highlightLines=function(e,t,n,i){"number"!=typeof t&&(n=t,t=e),n||(n="ace_step");var o=new u(e,0,t,1/0);return o.id=this.addMarker(o,n,"fullLine",i),o},this.setAnnotations=function(e){this.$annotations=e,this._signal("changeAnnotation",{})},this.getAnnotations=function(){return this.$annotations||[]},this.clearAnnotations=function(){this.setAnnotations([])},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r?\n)/m);this.$autoNewLine=t?t[1]:"\n"},this.getWordRange=function(e,t){var n=this.getLine(e),i=!1;if(t>0&&(i=!!n.charAt(t-1).match(this.tokenRe)),i||(i=!!n.charAt(t).match(this.tokenRe)),i)var o=this.tokenRe;else o=/^\s+$/.test(n.slice(t-1,t+1))?/\s/:this.nonTokenRe;var r=t;if(r>0){do{r--}while(r>=0&&n.charAt(r).match(o));r++}for(var s=t;s<n.length&&n.charAt(s).match(o);)s++;return new u(e,r,e,s)},this.getAWordRange=function(e,t){for(var n=this.getWordRange(e,t),i=this.getLine(n.end.row);i.charAt(n.end.column).match(/[ \t]/);)n.end.column+=1;return n},this.setNewLineMode=function(e){this.doc.setNewLineMode(e)},this.getNewLineMode=function(){return this.doc.getNewLineMode()},this.setUseWorker=function(e){this.setOption("useWorker",e)},this.getUseWorker=function(){return this.$useWorker},this.onReloadTokenizer=function(e){var t=e.data;this.bgTokenizer.start(t.first),this._signal("tokenizerUpdate",e)},this.$modes=s.$modes,this.$mode=null,this.$modeId=null,this.setMode=function(e,t){if(e&&"object"==typeof e){if(e.getTokenizer)return this.$onChangeMode(e);var n=e,i=n.path}else i=e||"ace/mode/text";if(this.$modes["ace/mode/text"]||(this.$modes["ace/mode/text"]=new c),this.$modes[i]&&!n)return this.$onChangeMode(this.$modes[i]),void(t&&t());this.$modeId=i,s.loadModule(["mode",i],function(e){if(this.$modeId!==i)return t&&t();this.$modes[i]&&!n?this.$onChangeMode(this.$modes[i]):e&&e.Mode&&(e=new e.Mode(n),n||(this.$modes[i]=e,e.$id=i),this.$onChangeMode(e)),t&&t()}.bind(this)),this.$mode||this.$onChangeMode(this.$modes["ace/mode/text"],!0)},this.$onChangeMode=function(e,t){if(t||(this.$modeId=e.$id),this.$mode!==e){var n=this.$mode;this.$mode=e,this.$stopWorker(),this.$useWorker&&this.$startWorker();var i=e.getTokenizer();if(void 0!==i.on){var o=this.onReloadTokenizer.bind(this);i.on("update",o)}if(this.bgTokenizer)this.bgTokenizer.setTokenizer(i);else{this.bgTokenizer=new d(i);var r=this;this.bgTokenizer.on("update",(function(e){r._signal("tokenizerUpdate",e)}))}this.bgTokenizer.setDocument(this.getDocument()),this.tokenRe=e.tokenRe,this.nonTokenRe=e.nonTokenRe,t||(e.attachToSession&&e.attachToSession(this),this.$options.wrapMethod.set.call(this,this.$wrapMethod),this.$setFolding(e.foldingRules),this.bgTokenizer.start(0),this._emit("changeMode",{oldMode:n,mode:e}))}},this.$stopWorker=function(){this.$worker&&(this.$worker.terminate(),this.$worker=null)},this.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this)}catch(e){s.warn("Could not load worker",e),this.$worker=null}},this.getMode=function(){return this.$mode},this.$scrollTop=0,this.setScrollTop=function(e){this.$scrollTop===e||isNaN(e)||(this.$scrollTop=e,this._signal("changeScrollTop",e))},this.getScrollTop=function(){return this.$scrollTop},this.$scrollLeft=0,this.setScrollLeft=function(e){this.$scrollLeft===e||isNaN(e)||(this.$scrollLeft=e,this._signal("changeScrollLeft",e))},this.getScrollLeft=function(){return this.$scrollLeft},this.getScreenWidth=function(){return this.$computeWidth(),this.lineWidgets?Math.max(this.getLineWidgetMaxWidth(),this.screenWidth):this.screenWidth},this.getLineWidgetMaxWidth=function(){if(null!=this.lineWidgetsWidth)return this.lineWidgetsWidth;var e=0;return this.lineWidgets.forEach((function(t){t&&t.screenWidth>e&&(e=t.screenWidth)})),this.lineWidgetWidth=e},this.$computeWidth=function(e){if(this.$modified||e){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var t=this.doc.getAllLines(),n=this.$rowLengthCache,i=0,o=0,r=this.$foldData[o],s=r?r.start.row:1/0,a=t.length,l=0;l<a;l++){if(l>s){if((l=r.end.row+1)>=a)break;s=(r=this.$foldData[o++])?r.start.row:1/0}null==n[l]&&(n[l]=this.$getStringScreenWidth(t[l])[0]),n[l]>i&&(i=n[l])}this.screenWidth=i}},this.getLine=function(e){return this.doc.getLine(e)},this.getLines=function(e,t){return this.doc.getLines(e,t)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},this.insert=function(e,t){return this.doc.insert(e,t)},this.remove=function(e){return this.doc.remove(e)},this.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},this.undoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=e.length-1;-1!=n;n--){var i=e[n];"insert"==i.action||"remove"==i.action?this.doc.revertDelta(i):i.folds&&this.addFolds(i.folds)}!t&&this.$undoSelect&&(e.selectionBefore?this.selection.fromJSON(e.selectionBefore):this.selection.setRange(this.$getUndoSelection(e,!0))),this.$fromUndo=!1}},this.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=0;n<e.length;n++){var i=e[n];"insert"!=i.action&&"remove"!=i.action||this.doc.$safeApplyDelta(i)}!t&&this.$undoSelect&&(e.selectionAfter?this.selection.fromJSON(e.selectionAfter):this.selection.setRange(this.$getUndoSelection(e,!1))),this.$fromUndo=!1}},this.setUndoSelect=function(e){this.$undoSelect=e},this.$getUndoSelection=function(e,t){function n(e){return t?"insert"!==e.action:"insert"===e.action}for(var i,o,r=0;r<e.length;r++){var s=e[r];s.start&&(i?n(s)?(o=s.start,-1==i.compare(o.row,o.column)&&i.setStart(o),o=s.end,1==i.compare(o.row,o.column)&&i.setEnd(o)):(o=s.start,-1==i.compare(o.row,o.column)&&(i=u.fromPoints(s.start,s.start))):i=n(s)?u.fromPoints(s.start,s.end):u.fromPoints(s.start,s.start))}return i},this.replace=function(e,t){return this.doc.replace(e,t)},this.moveText=function(e,t,n){var i=this.getTextRange(e),o=this.getFoldsInRange(e),r=u.fromPoints(t,t);if(!n){this.remove(e);var s=e.start.row-e.end.row;(c=s?-e.end.column:e.start.column-e.end.column)&&(r.start.row==e.end.row&&r.start.column>e.end.column&&(r.start.column+=c),r.end.row==e.end.row&&r.end.column>e.end.column&&(r.end.column+=c)),s&&r.start.row>=e.end.row&&(r.start.row+=s,r.end.row+=s)}if(r.end=this.insert(r.start,i),o.length){var a=e.start,l=r.start,c=(s=l.row-a.row,l.column-a.column);this.addFolds(o.map((function(e){return(e=e.clone()).start.row==a.row&&(e.start.column+=c),e.end.row==a.row&&(e.end.column+=c),e.start.row+=s,e.end.row+=s,e})))}return r},this.indentRows=function(e,t,n){n=n.replace(/\t/g,this.getTabString());for(var i=e;i<=t;i++)this.doc.insertInLine({row:i,column:0},n)},this.outdentRows=function(e){for(var t=e.collapseRows(),n=new u(0,0,0,0),i=this.getTabSize(),o=t.start.row;o<=t.end.row;++o){var r=this.getLine(o);n.start.row=o,n.end.row=o;for(var s=0;s<i&&" "==r.charAt(s);++s);s<i&&"\t"==r.charAt(s)?(n.start.column=s,n.end.column=s+1):(n.start.column=0,n.end.column=s),this.remove(n)}},this.$moveLines=function(e,t,n){if(e=this.getRowFoldStart(e),t=this.getRowFoldEnd(t),n<0){if((o=this.getRowFoldStart(e+n))<0)return 0;var i=o-e}else if(n>0){var o;if((o=this.getRowFoldEnd(t+n))>this.doc.getLength()-1)return 0;i=o-t}else e=this.$clipRowToDocument(e),i=(t=this.$clipRowToDocument(t))-e+1;var r=new u(e,0,t,Number.MAX_VALUE),s=this.getFoldsInRange(r).map((function(e){return(e=e.clone()).start.row+=i,e.end.row+=i,e})),a=0==n?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+i,a),s.length&&this.addFolds(s),i},this.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},this.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},this.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},this.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},this.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},this.$clipPositionToDocument=function(e,t){if(t=Math.max(0,t),e<0)e=0,t=0;else{var n=this.doc.getLength();e>=n?(e=n-1,t=this.doc.getLine(n-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},this.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(e){if(e!=this.$useWrapMode){if(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),e){var t=this.getLength();this.$wrapData=Array(t),this.$updateWrapData(0,t-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(e,t){this.$wrapLimitRange.min===e&&this.$wrapLimitRange.max===t||(this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},this.adjustWrapLimit=function(e,t){var n=this.$wrapLimitRange;n.max<0&&(n={min:t,max:t});var i=this.$constrainWrapLimit(e,n.min,n.max);return i!=this.$wrapLimit&&i>1&&(this.$wrapLimit=i,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},this.$constrainWrapLimit=function(e,t,n){return t&&(e=Math.max(t,e)),n&&(e=Math.min(n,e)),e},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,n=e.action,i=e.start,o=e.end,r=i.row,s=o.row,a=s-r,l=null;if(this.$updating=!0,0!=a)if("remove"===n){this[t?"$wrapData":"$rowLengthCache"].splice(r,a);var c=this.$foldData;l=this.getFoldsInRange(e),this.removeFolds(l);var u=0;if(g=this.getFoldLine(o.row)){g.addRemoveChars(o.row,o.column,i.column-o.column),g.shiftRow(-a);var h=this.getFoldLine(r);h&&h!==g&&(h.merge(g),g=h),u=c.indexOf(g)+1}for(;u<c.length;u++)(g=c[u]).start.row>=o.row&&g.shiftRow(-a);s=r}else{var d=Array(a);d.unshift(r,0);var p=t?this.$wrapData:this.$rowLengthCache;if(p.splice.apply(p,d),c=this.$foldData,u=0,g=this.getFoldLine(r)){var f=g.range.compareInside(i.row,i.column);0==f?(g=g.split(i.row,i.column))&&(g.shiftRow(a),g.addRemoveChars(s,0,o.column-i.column)):-1==f&&(g.addRemoveChars(r,0,o.column-i.column),g.shiftRow(a)),u=c.indexOf(g)+1}for(;u<c.length;u++){var g;(g=c[u]).start.row>=r&&g.shiftRow(a)}}else a=Math.abs(e.start.column-e.end.column),"remove"===n&&(l=this.getFoldsInRange(e),this.removeFolds(l),a=-a),(g=this.getFoldLine(r))&&g.addRemoveChars(r,i.column,a);return t&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,t?this.$updateWrapData(r,s):this.$updateRowLengthCache(r,s),l},this.$updateRowLengthCache=function(e,t,n){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},this.$updateWrapData=function(n,i){var o,r,s=this.doc.getAllLines(),a=this.getTabSize(),l=this.$wrapData,c=this.$wrapLimit,u=n;for(i=Math.min(i,s.length-1);u<=i;)(r=this.getFoldLine(u,r))?(o=[],r.walk(function(n,i,r,a){var l;if(null!=n){(l=this.$getDisplayTokens(n,o.length))[0]=e;for(var c=1;c<l.length;c++)l[c]=t}else l=this.$getDisplayTokens(s[i].substring(a,r),o.length);o=o.concat(l)}.bind(this),r.end.row,s[r.end.row].length+1),l[r.start.row]=this.$computeWrapSplits(o,c,a),u=r.end.row+1):(o=this.$getDisplayTokens(s[u]),l[u]=this.$computeWrapSplits(o,c,a),u++)};var e=3,t=4;function n(e){return!(e<4352)&&(e>=4352&&e<=4447||e>=4515&&e<=4519||e>=4602&&e<=4607||e>=9001&&e<=9002||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||e>=12288&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12589||e>=12593&&e<=12686||e>=12688&&e<=12730||e>=12736&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=13054||e>=13056&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=55216&&e<=55238||e>=55243&&e<=55291||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510)}this.$computeWrapSplits=function(n,i,o){if(0==n.length)return[];var r=[],s=n.length,a=0,l=0,c=this.$wrapAsCode,u=this.$indentedSoftWrap,h=i<=Math.max(2*o,8)||!1===u?0:Math.floor(i/2);function d(e){for(var t=e-a,i=a;i<e;i++){var s=n[i];12!==s&&2!==s||(t-=1)}r.length||(p=function(){var e=0;if(0===h)return e;if(u)for(var t=0;t<n.length;t++){var i=n[t];if(10==i)e+=1;else{if(11!=i){if(12==i)continue;break}e+=o}}return c&&!1!==u&&(e+=o),Math.min(e,h)}(),r.indent=p),l+=t,r.push(l),a=e}for(var p=0;s-a>i-p;){var f=a+i-p;if(n[f-1]>=10&&n[f]>=10)d(f);else if(n[f]!=e&&n[f]!=t){for(var g=Math.max(f-(i-(i>>2)),a-1);f>g&&n[f]<e;)f--;if(c){for(;f>g&&n[f]<e;)f--;for(;f>g&&9==n[f];)f--}else for(;f>g&&n[f]<10;)f--;f>g?d(++f):(2==n[f=a+i]&&f--,d(f-p))}else{for(;f!=a-1&&n[f]!=e;f--);if(f>a){d(f);continue}for(f=a+i;f<n.length&&n[f]==t;f++);if(f==n.length)break;d(f)}}return r},this.$getDisplayTokens=function(e,t){var i,o=[];t=t||0;for(var r=0;r<e.length;r++){var s=e.charCodeAt(r);if(9==s){i=this.getScreenTabSize(o.length+t),o.push(11);for(var a=1;a<i;a++)o.push(12)}else 32==s?o.push(10):s>39&&s<48||s>57&&s<64?o.push(9):s>=4352&&n(s)?o.push(1,2):o.push(1)}return o},this.$getStringScreenWidth=function(e,t,i){if(0==t)return[0,0];var o,r;for(null==t&&(t=1/0),i=i||0,r=0;r<e.length&&(9==(o=e.charCodeAt(r))?i+=this.getScreenTabSize(i):o>=4352&&n(o)?i+=2:i+=1,!(i>t));r++);return[i,r]},this.lineWidgets=null,this.getRowLength=function(e){var t=1;return this.lineWidgets&&(t+=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0),this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+t:t},this.getRowLineCount=function(e){return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1:1},this.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE),n=this.$wrapData[t.row];return n.length&&n[0]<t.column?n.indent:0}return 0},this.getScreenLastRowColumn=function(e){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE);return this.documentToScreenColumn(t.row,t.column)},this.getDocumentLastRowColumn=function(e,t){var n=this.documentToScreenRow(e,t);return this.getScreenLastRowColumn(n)},this.getDocumentLastRowColumnPosition=function(e,t){var n=this.documentToScreenRow(e,t);return this.screenToDocumentPosition(n,Number.MAX_VALUE/10)},this.getRowSplitData=function(e){return this.$useWrapMode?this.$wrapData[e]:void 0},this.getScreenTabSize=function(e){return this.$tabSize-(e%this.$tabSize|0)},this.screenToDocumentRow=function(e,t){return this.screenToDocumentPosition(e,t).row},this.screenToDocumentColumn=function(e,t){return this.screenToDocumentPosition(e,t).column},this.screenToDocumentPosition=function(e,t,n){if(e<0)return{row:0,column:0};var i,o,r=0,s=0,a=0,l=0,c=this.$screenRowCache,u=this.$getRowCacheIndex(c,e),h=c.length;if(h&&u>=0){a=c[u],r=this.$docRowCache[u];var d=e>c[h-1]}else d=!h;for(var p=this.getLength()-1,f=this.getNextFoldLine(r),g=f?f.start.row:1/0;a<=e&&!(a+(l=this.getRowLength(r))>e||r>=p);)a+=l,++r>g&&(r=f.end.row+1,g=(f=this.getNextFoldLine(r,f))?f.start.row:1/0),d&&(this.$docRowCache.push(r),this.$screenRowCache.push(a));if(f&&f.start.row<=r)i=this.getFoldDisplayLine(f),r=f.start.row;else{if(a+l<=e||r>p)return{row:p,column:this.getLine(p).length};i=this.getLine(r),f=null}var m=0,v=Math.floor(e-a);if(this.$useWrapMode){var b=this.$wrapData[r];b&&(o=b[v],v>0&&b.length&&(m=b.indent,s=b[v-1]||b[b.length-1],i=i.substring(s)))}return void 0!==n&&this.$bidiHandler.isBidiRow(a+v,r,v)&&(t=this.$bidiHandler.offsetToCol(n)),s+=this.$getStringScreenWidth(i,t-m)[1],this.$useWrapMode&&s>=o&&(s=o-1),f?f.idxToPosition(s):{row:r,column:s}},this.documentToScreenPosition=function(e,t){if(void 0===t)var n=this.$clipPositionToDocument(e.row,e.column);else n=this.$clipPositionToDocument(e,t);e=n.row,t=n.column;var i,o=0,r=null;(i=this.getFoldAt(e,t,1))&&(e=i.start.row,t=i.start.column);var s,a=0,l=this.$docRowCache,c=this.$getRowCacheIndex(l,e),u=l.length;if(u&&c>=0){a=l[c],o=this.$screenRowCache[c];var h=e>l[u-1]}else h=!u;for(var d=this.getNextFoldLine(a),p=d?d.start.row:1/0;a<e;){if(a>=p){if((s=d.end.row+1)>e)break;p=(d=this.getNextFoldLine(s,d))?d.start.row:1/0}else s=a+1;o+=this.getRowLength(a),a=s,h&&(this.$docRowCache.push(a),this.$screenRowCache.push(o))}var f="";d&&a>=p?(f=this.getFoldDisplayLine(d,e,t),r=d.start.row):(f=this.getLine(e).substring(0,t),r=e);var g=0;if(this.$useWrapMode){var m=this.$wrapData[r];if(m){for(var v=0;f.length>=m[v];)o++,v++;f=f.substring(m[v-1]||0,f.length),g=v>0?m.indent:0}}return this.lineWidgets&&this.lineWidgets[a]&&this.lineWidgets[a].rowsAbove&&(o+=this.lineWidgets[a].rowsAbove),{row:o,column:g+this.$getStringScreenWidth(f)[0]}},this.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},this.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},this.getScreenLength=function(){var e=0,t=null;if(this.$useWrapMode)for(var n=this.$wrapData.length,i=0,o=(a=0,(t=this.$foldData[a++])?t.start.row:1/0);i<n;){var r=this.$wrapData[i];e+=r?r.length+1:1,++i>o&&(i=t.end.row+1,o=(t=this.$foldData[a++])?t.start.row:1/0)}else{e=this.getLength();for(var s=this.$foldData,a=0;a<s.length;a++)e-=(t=s[a]).end.row-t.start.row}return this.lineWidgets&&(e+=this.$getWidgetScreenLength()),e},this.$setFontMetrics=function(e){this.$enableVarChar&&(this.$getStringScreenWidth=function(t,n,i){if(0===n)return[0,0];var o,r;for(n||(n=1/0),i=i||0,r=0;r<t.length&&!((i+="\t"===(o=t.charAt(r))?this.getScreenTabSize(i):e.getCharacterWidth(o))>n);r++);return[i,r]})},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker(),this.removeAllListeners(),this.doc&&this.doc.off("change",this.$onChange),this.selection.detach()},this.isFullWidth=n}.call(f.prototype),e("./edit_session/folding").Folding.call(f.prototype),e("./edit_session/bracket_match").BracketMatch.call(f.prototype),s.defineOptions(f.prototype,"session",{wrap:{set:function(e){if(e&&"off"!=e?"free"==e?e=!0:"printMargin"==e?e=-1:"string"==typeof e&&(e=parseInt(e,10)||!1):e=!1,this.$wrap!=e)if(this.$wrap=e,e){var t="number"==typeof e?e:null;this.setWrapLimitRange(t,t),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?-1==this.$wrap?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(e){(e="auto"==e?"text"!=this.$mode.type:"text"!=e)!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){(e=parseInt(e))>0&&this.$tabSize!==e&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:!0},overwrite:{set:function(e){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:!0}}),t.EditSession=f})),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],(function(e,t,n){"use strict";var i=e("./lib/lang"),o=e("./lib/oop"),r=e("./range").Range,s=function(){this.$options={}};(function(){this.set=function(e){return o.mixin(this.$options,e),this},this.getOptions=function(){return i.copyObject(this.$options)},this.setOptions=function(e){this.$options=e},this.find=function(e){var t=this.$options,n=this.$matchIterator(e,t);if(!n)return!1;var i=null;return n.forEach((function(e,n,o,s){return i=new r(e,n,o,s),!(n==s&&t.start&&t.start.start&&0!=t.skipCurrent&&i.isEqual(t.start)&&(i=null,1))})),i},this.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var n=t.range,o=n?e.getLines(n.start.row,n.end.row):e.doc.getAllLines(),s=[],a=t.re;if(t.$isMultiLine){var l,c=a.length,u=o.length-c;e:for(var h=a.offset||0;h<=u;h++){for(var d=0;d<c;d++)if(-1==o[h+d].search(a[d]))continue e;var p=o[h],f=o[h+c-1],g=p.length-p.match(a[0])[0].length,m=f.match(a[c-1])[0].length;l&&l.end.row===h&&l.end.column>g||(s.push(l=new r(h,g,h+c-1,m)),c>2&&(h=h+c-2))}}else for(var v=0;v<o.length;v++){var b=i.getMatchOffsets(o[v],a);for(d=0;d<b.length;d++){var w=b[d];s.push(new r(v,w.offset,v,w.offset+w.length))}}if(n){var y=n.start.column,x=n.start.column;for(v=0,d=s.length-1;v<d&&s[v].start.column<y&&s[v].start.row==n.start.row;)v++;for(;v<d&&s[d].end.column>x&&s[d].end.row==n.end.row;)d--;for(s=s.slice(v,d+1),v=0,d=s.length;v<d;v++)s[v].start.row+=n.start.row,s[v].end.row+=n.start.row}return s},this.replace=function(e,t){var n=this.$options,i=this.$assembleRegExp(n);if(n.$isMultiLine)return t;if(i){var o=i.exec(e);if(!o||o[0].length!=e.length)return null;if(t=e.replace(i,t),n.preserveCase){t=t.split("");for(var r=Math.min(e.length,e.length);r--;){var s=e[r];s&&s.toLowerCase()!=s?t[r]=t[r].toUpperCase():t[r]=t[r].toLowerCase()}t=t.join("")}return t}},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=function(e,t){function n(e){return/\w/.test(e)||t.regExp?"\\b":""}return n(e[0])+e+n(e[e.length-1])}(n,e));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(e){r=!1}return e.re=r},this.$assembleMultilineRegExp=function(e,t){for(var n=e.replace(/\r\n|\r|\n/g,"$\n^").split("\n"),i=[],o=0;o<n.length;o++)try{i.push(new RegExp(n[o],t))}catch(e){return!1}return i},this.$matchIterator=function(e,t){var n=this.$assembleRegExp(t);if(!n)return!1;var i=1==t.backwards,o=0!=t.skipCurrent,r=t.range,s=t.start;s||(s=r?r[i?"end":"start"]:e.selection.getRange()),s.start&&(s=s[o!=i?"end":"start"]);var a=r?r.start.row:0,l=r?r.end.row:e.getLength()-1;if(i)var c=function(e){var n=s.row;if(!h(n,s.column,e)){for(n--;n>=a;n--)if(h(n,Number.MAX_VALUE,e))return;if(0!=t.wrap)for(n=l,a=s.row;n>=a;n--)if(h(n,Number.MAX_VALUE,e))return}};else c=function(e){var n=s.row;if(!h(n,s.column,e)){for(n+=1;n<=l;n++)if(h(n,0,e))return;if(0!=t.wrap)for(n=a,l=s.row;n<=l;n++)if(h(n,0,e))return}};if(t.$isMultiLine)var u=n.length,h=function(t,o,r){var s=i?t-u+1:t;if(!(s<0||s+u>e.getLength())){var a=e.getLine(s),l=a.search(n[0]);if(!(!i&&l<o||-1===l)){for(var c=1;c<u;c++)if(-1==(a=e.getLine(s+c)).search(n[c]))return;var h=a.match(n[u-1])[0].length;if(!(i&&h>o))return!!r(s,l,s+u-1,h)||void 0}}};else h=i?function(t,i,o){var r,s=e.getLine(t),a=[],l=0;for(n.lastIndex=0;r=n.exec(s);){var c=r[0].length;if(l=r.index,!c){if(l>=s.length)break;n.lastIndex=l+=1}if(r.index+c>i)break;a.push(r.index,c)}for(var u=a.length-1;u>=0;u-=2){var h=a[u-1];if(o(t,h,t,h+(c=a[u])))return!0}}:function(t,i,o){var r,s,a=e.getLine(t);for(n.lastIndex=i;s=n.exec(a);){var l=s[0].length;if(o(t,r=s.index,t,r+l))return!0;if(!l&&(n.lastIndex=r+=1,r>=a.length))return!1}};return{forEach:c}}}).call(s.prototype),t.Search=s})),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],(function(e,t,n){"use strict";var i=e("../lib/keys"),o=e("../lib/useragent"),r=i.KEY_MODS;function s(e,t){this.platform=t||(o.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=!0}function a(e,t){s.call(this,e,t),this.$singleCommand=!1}a.prototype=s.prototype,function(){function e(e){return"object"==typeof e&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}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 n=e&&("string"==typeof e?e:e.name);e=this.commands[n],t||delete this.commands[n];var i=this.commandKeyBinding;for(var o in i){var r=i[o];if(r==e)delete i[o];else if(Array.isArray(r)){var s=r.indexOf(e);-1!=s&&(r.splice(s,1),1==r.length&&(i[o]=r[0]))}}},this.bindKey=function(e,t,n){if("object"==typeof e&&e&&(null==n&&(n=e.position),e=e[this.platform]),e)return"function"==typeof t?this.addCommand({exec:t,bindKey:e,name:t.name||e}):void e.split("|").forEach((function(e){var i="";if(-1!=e.indexOf(" ")){var o=e.split(/\s+/);e=o.pop(),o.forEach((function(e){var t=this.parseKeys(e),n=r[t.hashId]+t.key;i+=(i?" ":"")+n,this._addCommandToBinding(i,"chainKeys")}),this),i+=" "}var s=this.parseKeys(e),a=r[s.hashId]+s.key;this._addCommandToBinding(i+a,t,n)}),this)},this._addCommandToBinding=function(t,n,i){var o,r=this.commandKeyBinding;if(n)if(!r[t]||this.$singleCommand)r[t]=n;else{Array.isArray(r[t])?-1!=(o=r[t].indexOf(n))&&r[t].splice(o,1):r[t]=[r[t]],"number"!=typeof i&&(i=e(n));var s=r[t];for(o=0;o<s.length&&!(e(s[o])>i);o++);s.splice(o,0,n)}else delete r[t]},this.addCommands=function(e){e&&Object.keys(e).forEach((function(t){var n=e[t];if(n){if("string"==typeof n)return this.bindKey(n,t);"function"==typeof n&&(n={exec:n}),"object"==typeof n&&(n.name||(n.name=t),this.addCommand(n))}}),this)},this.removeCommands=function(e){Object.keys(e).forEach((function(t){this.removeCommand(e[t])}),this)},this.bindKeys=function(e){Object.keys(e).forEach((function(t){this.bindKey(t,e[t])}),this)},this._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},this.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter((function(e){return e})),n=t.pop(),o=i[n];if(i.FUNCTION_KEYS[o])n=i.FUNCTION_KEYS[o].toLowerCase();else{if(!t.length)return{key:n,hashId:-1};if(1==t.length&&"shift"==t[0])return{key:n.toUpperCase(),hashId:-1}}for(var r=0,s=t.length;s--;){var a=i.KEY_MODS[t[s]];if(null==a)return"undefined"!=typeof console&&console.error("invalid modifier "+t[s]+" in "+e),!1;r|=a}return{key:n,hashId:r}},this.findKeyCommand=function(e,t){var n=r[e]+t;return this.commandKeyBinding[n]},this.handleKeyboard=function(e,t,n,i){if(!(i<0)){var o=r[t]+n,s=this.commandKeyBinding[o];return e.$keyChain&&(e.$keyChain+=" "+o,s=this.commandKeyBinding[e.$keyChain]||s),!s||"chainKeys"!=s&&"chainKeys"!=s[s.length-1]?(e.$keyChain&&(t&&4!=t||1!=n.length?(-1==t||i>0)&&(e.$keyChain=""):e.$keyChain=e.$keyChain.slice(0,-o.length-1)),{command:s}):(e.$keyChain=e.$keyChain||o,{command:"null"})}},this.getStatusText=function(e,t){return t.$keyChain||""}}.call(s.prototype),t.HashHandler=s,t.MultiHashHandler=a})),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],(function(e,t,n){"use strict";var i=e("../lib/oop"),o=e("../keyboard/hash_handler").MultiHashHandler,r=e("../lib/event_emitter").EventEmitter,s=function(e,t){o.call(this,t,e),this.byName=this.commands,this.setDefaultHandler("exec",(function(e){return e.command.exec(e.editor,e.args||{})}))};i.inherits(s,o),function(){i.implement(this,r),this.exec=function(e,t,n){if(Array.isArray(e)){for(var i=e.length;i--;)if(this.exec(e[i],t,n))return!0;return!1}if("string"==typeof e&&(e=this.commands[e]),!e)return!1;if(t&&t.$readOnly&&!e.readOnly)return!1;if(0!=this.$checkCommandState&&e.isAvailable&&!e.isAvailable(t))return!1;var o={editor:t,command:e,args:n};return o.returnValue=this._emit("exec",o),this._signal("afterExec",o),!1!==o.returnValue},this.toggleRecording=function(e){if(!this.$inReplay)return e&&e._emit("changeStatus"),this.recording?(this.macro.pop(),this.off("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(e){this.macro.push([e.command,e.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},this.replay=function(e){if(!this.$inReplay&&this.macro){if(this.recording)return this.toggleRecording(e);try{this.$inReplay=!0,this.macro.forEach((function(t){"string"==typeof t?this.exec(t,e):this.exec(t[0],e,t[1])}),this)}finally{this.$inReplay=!1}}},this.trimMacro=function(e){return e.map((function(e){return"string"!=typeof e[0]&&(e[0]=e[0].name),e[1]||(e=e[0]),e}))}}.call(s.prototype),t.CommandManager=s})),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],(function(e,t,n){"use strict";var i=e("../lib/lang"),o=e("../config"),r=e("../range").Range;function s(e,t){return{win:e,mac:t}}t.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:s("Ctrl-,","Command-,"),exec:function(e){o.loadModule("ace/ext/settings_menu",(function(t){t.init(e),e.showSettingsMenu()}))},readOnly:!0},{name:"goToNextError",description:"Go to next error",bindKey:s("Alt-E","F4"),exec:function(e){o.loadModule("./ext/error_marker",(function(t){t.showErrorMarker(e,1)}))},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",description:"Go to previous error",bindKey:s("Alt-Shift-E","Shift-F4"),exec:function(e){o.loadModule("./ext/error_marker",(function(t){t.showErrorMarker(e,-1)}))},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:s("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:s(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:s("Ctrl-L","Command-L"),exec:function(e,t){"number"!=typeof t||isNaN(t)||e.gotoLine(t),e.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:s("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:s("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",description:"Toggle fold widget",bindKey:s("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:s("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:s(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:s(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:s("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:s("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:s("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:s("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:s("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:s("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:s("Ctrl-F","Command-F"),exec:function(e){o.loadModule("ace/ext/searchbox",(function(t){t.Search(e)}))},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:s("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:s("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:s("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:s("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:s("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:s("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:s("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:s("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:s("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:s("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:s("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:s("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:s("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:s("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:s("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:s("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:s("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:s("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:s("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:s("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:s(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:s("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:s(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:s("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:s("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:s("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:s("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:s("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:s("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:s("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:s(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(e){},readOnly:!0},{name:"cut",description:"Cut",exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty()?e.selection.getLineRange():e.selection.getRange();e._emit("cut",t),t.isEmpty()||e.session.remove(t),e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(e,t){e.$handlePaste(t)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:s("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:s("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:s("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:s("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:s("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:s("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:s("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:s("Ctrl-H","Command-Option-F"),exec:function(e){o.loadModule("ace/ext/searchbox",(function(t){t.Search(e,!0)}))}},{name:"undo",description:"Undo",bindKey:s("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",description:"Redo",bindKey:s("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:s("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:s("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:s("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:s("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:s("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:s("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:s("Shift-Delete",null),exec:function(e){if(!e.selection.isEmpty())return!1;e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:s("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:s("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:s("Ctrl-Shift-Backspace",null),exec:function(e){var t=e.selection.getRange();t.start.column=0,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:s("Ctrl-Shift-Delete",null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:s("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:s("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:s("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:s("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:s("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:s("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(e,t){e.insert(i.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:s(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:s("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:s("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:s("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:s(null,null),exec:function(e){e.autoIndent()},multiSelectAction:"forEachLine",scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:s("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0,t.end.row++,e.selection.setRange(t,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",description:"Join lines",bindKey:s(null,null),exec:function(e){for(var t=e.selection.isBackwards(),n=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),o=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),s=e.session.doc.getLine(n.row).length,a=e.session.doc.getTextRange(e.selection.getRange()).replace(/\n\s*/," ").length,l=e.session.doc.getLine(n.row),c=n.row+1;c<=o.row+1;c++){var u=i.stringTrimLeft(i.stringTrimRight(e.session.doc.getLine(c)));0!==u.length&&(u=" "+u),l+=u}o.row+1<e.session.doc.getLength()-1&&(l+=e.session.doc.getNewLineCharacter()),e.clearSelection(),e.session.doc.replace(new r(n.row,0,o.row+2,0),l),a>0?(e.selection.moveCursorTo(n.row,n.column),e.selection.selectTo(n.row,n.column+a)):(s=e.session.doc.getLine(n.row).length>s?s+1:s,e.selection.moveCursorTo(n.row,s))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:s(null,null),exec:function(e){var t=e.session.doc.getLength()-1,n=e.session.doc.getLine(t).length,i=e.selection.rangeList.ranges,o=[];i.length<1&&(i=[e.selection.getRange()]);for(var s=0;s<i.length;s++)s==i.length-1&&(i[s].end.row===t&&i[s].end.column===n||o.push(new r(i[s].end.row,i[s].end.column,t,n))),0===s?0===i[s].start.row&&0===i[s].start.column||o.push(new r(0,0,i[s].start.row,i[s].start.column)):o.push(new r(i[s-1].end.row,i[s-1].end.column,i[s].start.row,i[s].start.column));for(e.exitMultiSelectMode(),e.clearSelection(),s=0;s<o.length;s++)e.selection.addRange(o[s],!1)},readOnly:!0,scrollIntoView:"none"},{name:"addLineAfter",description:"Add new line after the current line",exec:function(e){e.selection.clearSelection(),e.navigateLineEnd(),e.insert("\n")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"addLineBefore",description:"Add new line before the current line",exec:function(e){e.selection.clearSelection();var t=e.getCursorPosition();e.selection.moveTo(t.row-1,Number.MAX_VALUE),e.insert("\n"),0===t.row&&e.navigateUp()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"openCommandPallete",description:"Open command pallete",bindKey:s("F1","F1"),exec:function(e){e.prompt({$type:"commands"})},readOnly:!0},{name:"modeSelect",description:"Change language mode...",bindKey:s(null,null),exec:function(e){e.prompt({$type:"modes"})},readOnly:!0}];for(var a=1;a<9;a++)t.commands.push({name:"foldToLevel"+a,description:"Fold To Level "+a,level:a,exec:function(e){e.session.foldToLevel(this.level)},scrollIntoView:"center",readOnly:!0})})),ace.define("ace/editor",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands","ace/config","ace/token_iterator","ace/clipboard"],(function(e,t,n){"use strict";e("./lib/fixoldbrowsers");var i=e("./lib/oop"),o=e("./lib/dom"),r=e("./lib/lang"),s=e("./lib/useragent"),a=e("./keyboard/textinput").TextInput,l=e("./mouse/mouse_handler").MouseHandler,c=e("./mouse/fold_handler").FoldHandler,u=e("./keyboard/keybinding").KeyBinding,h=e("./edit_session").EditSession,d=e("./search").Search,p=e("./range").Range,f=e("./lib/event_emitter").EventEmitter,g=e("./commands/command_manager").CommandManager,m=e("./commands/default_commands").commands,v=e("./config"),b=e("./token_iterator").TokenIterator,w=e("./clipboard"),y=function(e,t,n){this.$toDestroy=[];var i=e.getContainerElement();this.container=i,this.renderer=e,this.id="editor"+ ++y.$uid,this.commands=new g(s.isMac?"mac":"win",m),"object"==typeof document&&(this.textInput=new a(e.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new l(this),new c(this)),this.keyBinding=new u(this),this.$search=(new d).set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=r.delayedCall(function(){this._signal("input",{}),this.session&&this.session.bgTokenizer&&this.session.bgTokenizer.scheduleStart()}.bind(this)),this.on("change",(function(e,t){t._$emitInputEvent.schedule(31)})),this.setSession(t||n&&n.session||new h("")),v.resetOptions(this),n&&this.setOptions(n),v._signal("editor",this)};y.$uid=0,function(){i.implement(this,f),this.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0),this.$opResetTimer=r.delayedCall(this.endOperation.bind(this,!0)),this.on("change",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.docChanged=!0}.bind(this),!0),this.on("changeSelection",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.selectionChanged=!0}.bind(this),!0)},this.curOp=null,this.prevOp={},this.startOperation=function(e){if(this.curOp){if(!e||this.curOp.command)return;this.prevOp=this.curOp}e||(this.previousCommand=null,e={}),this.$opResetTimer.schedule(),this.curOp=this.session.curOp={command:e.command||{},args:e.args,scrollTop:this.renderer.scrollTop},this.curOp.selectionBefore=this.selection.toJSON()},this.endOperation=function(e){if(this.curOp&&this.session){if(e&&!1===e.returnValue||!this.session)return this.curOp=null;if(1==e&&this.curOp.command&&"mouse"==this.curOp.command.name)return;if(this._signal("beforeEndOperation"),!this.curOp)return;var t=this.curOp.command,n=t&&t.scrollIntoView;if(n){switch(n){case"center-animate":n="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var i=this.selection.getRange(),o=this.renderer.layerConfig;(i.start.row>=o.lastRow||i.end.row<=o.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==n&&this.renderer.animateScrolling(this.curOp.scrollTop)}var r=this.selection.toJSON();this.curOp.selectionAfter=r,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(r),this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(e){if(this.$mergeUndoDeltas){var t=this.prevOp,n=this.$mergeableCommands,i=t.command&&e.command.name==t.command.name;if("insertstring"==e.command.name){var o=e.args;void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),i=i&&this.mergeNextCommand&&(!/\s/.test(o)||/\s/.test(t.args)),this.mergeNextCommand=!0}else i=i&&-1!==n.indexOf(e.command.name);"always"!=this.$mergeUndoDeltas&&Date.now()-this.sequenceStartTime>2e3&&(i=!1),i?this.session.mergeUndoDeltas=!0:-1!==n.indexOf(e.command.name)&&(this.sequenceStartTime=Date.now())}},this.setKeyboardHandler=function(e,t){if(e&&"string"==typeof e&&"ace"!=e){this.$keybindingId=e;var n=this;v.loadModule(["keybinding",e],(function(i){n.$keybindingId==e&&n.keyBinding.setKeyboardHandler(i&&i.handler),t&&t()}))}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(e),t&&t()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(e){if(this.session!=e){this.curOp&&this.endOperation(),this.curOp={};var t=this.session;if(t){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var n=this.session.getSelection();n.off("changeCursor",this.$onCursorChange),n.off("changeSelection",this.$onSelectionChange)}this.session=e,e?(this.$onDocumentChange=this.onDocumentChange.bind(this),e.on("change",this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(e)),this._signal("changeSession",{session:e,oldSession:t}),this.curOp=null,t&&t._signal("changeEditor",{oldEditor:this}),e&&e._signal("changeEditor",{editor:this}),e&&e.bgTokenizer&&e.bgTokenizer.scheduleStart()}},this.getSession=function(){return this.session},this.setValue=function(e,t){return this.session.doc.setValue(e),t?1==t?this.navigateFileEnd():-1==t&&this.navigateFileStart():this.selectAll(),e},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(e){this.renderer.onResize(e)},this.setTheme=function(e,t){this.renderer.setTheme(e,t)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(e){this.renderer.setStyle(e)},this.unsetStyle=function(e){this.renderer.unsetStyle(e)},this.getFontSize=function(){return this.getOption("fontSize")||o.computedStyle(this.container).fontSize},this.setFontSize=function(e){this.setOption("fontSize",e)},this.$highlightBrackets=function(){if(!this.$highlightPending){var e=this;this.$highlightPending=!0,setTimeout((function(){e.$highlightPending=!1;var t=e.session;if(t&&t.bgTokenizer){t.$bracketHighlight&&(t.$bracketHighlight.markerIds.forEach((function(e){t.removeMarker(e)})),t.$bracketHighlight=null);var n=t.getMatchingBracketRanges(e.getCursorPosition());if(!n&&t.$mode.getMatching&&(n=t.$mode.getMatching(e.session)),n){var i="ace_bracket";Array.isArray(n)?1==n.length&&(i="ace_error_bracket"):n=[n],2==n.length&&(0==p.comparePoints(n[0].end,n[1].start)?n=[p.fromPoints(n[0].start,n[1].end)]:0==p.comparePoints(n[0].start,n[1].end)&&(n=[p.fromPoints(n[1].start,n[0].end)])),t.$bracketHighlight={ranges:n,markerIds:n.map((function(e){return t.addMarker(e,i,"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 n=e.getCursorPosition(),i=new b(e.session,n.row,n.column),o=i.getCurrentToken();if(!o||!/\b(?:tag-open|tag-name)/.test(o.type))return t.removeMarker(t.$tagHighlight),void(t.$tagHighlight=null);if(-1===o.type.indexOf("tag-open")||(o=i.stepForward())){var r=o.value,s=o.value,a=0,l=i.stepBackward();if("<"===l.value)do{l=o,(o=i.stepForward())&&(-1!==o.type.indexOf("tag-name")?r===(s=o.value)&&("<"===l.value?a++:"</"===l.value&&a--):r===s&&"/>"===o.value&&a--)}while(o&&a>=0);else{do{if(o=l,l=i.stepBackward(),o)if(-1!==o.type.indexOf("tag-name"))r===o.value&&("<"===l.value?a++:"</"===l.value&&a--);else if("/>"===o.value){for(var c=0,u=l;u;){if(-1!==u.type.indexOf("tag-name")&&u.value===r){a--;break}if("<"===u.value)break;u=i.stepBackward(),c++}for(var h=0;h<c;h++)i.stepForward()}}while(l&&a<=0);i.stepForward()}if(!o)return t.removeMarker(t.$tagHighlight),void(t.$tagHighlight=null);var d=i.getCurrentTokenRow(),f=i.getCurrentTokenColumn(),g=new p(d,f,d,f+o.value.length),m=t.$backMarkers[t.$tagHighlight];t.$tagHighlight&&null!=m&&0!==g.compareRange(m.range)&&(t.removeMarker(t.$tagHighlight),t.$tagHighlight=null),t.$tagHighlight||(t.$tagHighlight=t.addMarker(g,"ace_bracket","text"))}}}),50)}},this.focus=function(){var e=this;setTimeout((function(){e.isFocused()||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.$highlightBrackets(),this.$highlightTags(),this.$updateHighlightActiveLine()},this.onDocumentChange=function(e){var t=this.session.$useWrapMode,n=e.start.row==e.end.row?e.end.row:1/0;this.renderer.updateLines(e.start.row,n,t),this._signal("change",e),this.$cursorChange()},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._signal("changeSelection")},this.$updateHighlightActiveLine=function(){var e,t=this.getSession();if(this.$highlightActiveLine&&("line"==this.$selectionStyle&&this.selection.isMultiLine()||(e=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(e=!1),!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 n=new p(e.row,e.column,e.row,1/0);n.id=t.addMarker(n,"ace_active-line","screenLine"),t.$highlightLineMarker=n}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(e){var t=this.session;if(t.$selectionMarker&&t.removeMarker(t.$selectionMarker),t.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var n=this.selection.getRange(),i=this.getSelectionStyle();t.$selectionMarker=t.addMarker(n,"ace_selection",i)}var o=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(o),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(!t.isEmpty()&&!t.isMultiLine()){var n=t.start.column,i=t.end.column,o=e.getLine(t.start.row),r=o.substring(n,i);if(!(r.length>5e3)&&/[\w\d]/.test(r)){var s=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:r}),a=o.substring(n-1,i+1);if(s.test(a))return s}}},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(e){this.renderer.updateText(),this._emit("changeMode",e)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var e=this.getSelectedText(),t=this.session.doc.getNewLineCharacter(),n=!1;if(!e&&this.$copyWithEmptySelection){n=!0;for(var i=this.selection.getAllRanges(),o=0;o<i.length;o++){var r=i[o];o&&i[o-1].start.row==r.start.row||(e+=this.session.getLine(r.start.row)+t)}}var s={text:e};return this._signal("copy",s),w.lineMode=!!n&&s.text,s.text},this.onCopy=function(){this.commands.exec("copy",this)},this.onCut=function(){this.commands.exec("cut",this)},this.onPaste=function(e,t){var n={text:e,event:t};this.commands.exec("paste",this,n)},this.$handlePaste=function(e){"string"==typeof e&&(e={text:e}),this._signal("paste",e);var t=e.text,n=t===w.lineMode,i=this.session;if(!this.inMultiSelectMode||this.inVirtualSelectionMode)n?i.insert({row:this.selection.lead.row,column:0},t):this.insert(t);else if(n)this.selection.rangeList.ranges.forEach((function(e){i.insert({row:e.start.row,column:0},t)}));else{var o=t.split(/\r\n|\r|\n/),r=this.selection.rangeList.ranges,s=!(2!=o.length||o[0]&&o[1]);if(o.length!=r.length||s)return this.commands.exec("insertstring",this,t);for(var a=r.length;a--;){var l=r[a];l.isEmpty()||i.remove(l),i.insert(l.start,o[a])}}},this.execCommand=function(e,t){return this.commands.exec(e,this,t)},this.insert=function(e,t){var n=this.session,i=n.getMode(),o=this.getCursorPosition();if(this.getBehavioursEnabled()&&!t){var r=i.transformAction(n.getState(o.row),"insertion",this,n,e);r&&(e!==r.text&&(this.inVirtualSelectionMode||(this.session.mergeUndoDeltas=!1,this.mergeNextCommand=!1)),e=r.text)}if("\t"==e&&(e=this.session.getTabString()),this.selection.isEmpty())this.session.getOverwrite()&&-1==e.indexOf("\n")&&((s=new p.fromPoints(o,o)).end.column+=e.length,this.session.remove(s));else{var s=this.getSelectionRange();o=this.session.remove(s),this.clearSelection()}if("\n"==e||"\r\n"==e){var a=n.getLine(o.row);if(o.column>a.search(/\S|$/)){var l=a.substr(o.column).search(/\S|$/);n.doc.removeInLine(o.row,o.column,o.column+l)}}this.clearSelection();var c=o.column,u=n.getState(o.row),h=(a=n.getLine(o.row),i.checkOutdent(u,a,e));if(n.insert(o,e),r&&r.selection&&(2==r.selection.length?this.selection.setSelectionRange(new p(o.row,c+r.selection[0],o.row,c+r.selection[1])):this.selection.setSelectionRange(new p(o.row+r.selection[0],r.selection[1],o.row+r.selection[2],r.selection[3]))),this.$enableAutoIndent){if(n.getDocument().isNewLine(e)){var d=i.getNextLineIndent(u,a.slice(0,o.column),n.getTabString());n.insert({row:o.row+1,column:0},d)}h&&i.autoOutdent(u,n,o.row)}},this.autoIndent=function(){var e,t,n=this.session,i=n.getMode();if(this.selection.isEmpty())e=0,t=n.doc.getLength()-1;else{var o=this.getSelectionRange();e=o.start.row,t=o.end.row}for(var r,s,a,l="",c="",u="",h=n.getTabString(),d=e;d<=t;d++)d>0&&(l=n.getState(d-1),c=n.getLine(d-1),u=i.getNextLineIndent(l,c,h)),r=n.getLine(d),u!==(s=i.$getIndent(r))&&(s.length>0&&(a=new p(d,0,d,s.length),n.remove(a)),u.length>0&&n.insert({row:d,column:0},u)),i.autoOutdent(l,n,d)},this.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:"insertstring"}});var n=this.applyComposition.bind(this,e,t);this.selection.rangeCount?this.forEachSelection(n):n(),this.endOperation()},this.applyComposition=function(e,t){var n;(t.extendLeft||t.extendRight)&&((n=this.selection.getRange()).start.column-=t.extendLeft,n.end.column+=t.extendRight,n.start.column<0&&(n.start.row--,n.start.column+=this.session.getLine(n.start.row).length+1),this.selection.setRange(n),e||n.isEmpty()||this.remove()),!e&&this.selection.isEmpty()||this.insert(e,!0),(t.restoreStart||t.restoreEnd)&&((n=this.selection.getRange()).start.column-=t.restoreStart,n.end.column-=t.restoreEnd,this.selection.setRange(n))},this.onCommandKey=function(e,t,n){return this.keyBinding.onCommandKey(e,t,n)},this.setOverwrite=function(e){this.session.setOverwrite(e)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(e){this.setOption("scrollSpeed",e)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(e){this.setOption("dragDelay",e)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(e){this.setOption("selectionStyle",e)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(e){this.setOption("readOnly",e)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(e){this.selection.isEmpty()&&("left"==e?this.selection.selectLeft():this.selection.selectRight());var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var n=this.session,i=n.getState(t.start.row),o=n.getMode().transformAction(i,"deletion",this,n,t);if(0===t.end.column){var r=n.getTextRange(t);if("\n"==r[r.length-1]){var s=n.getLine(t.end.row);/^\s+$/.test(s)&&(t.end.column=s.length)}}o&&(t=o)}this.session.remove(t),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var e=this.getSelectionRange();e.start.column==e.end.column&&e.start.row==e.end.row&&(e.end.column=0,e.end.row++),this.session.remove(e),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var e=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(e)},this.transposeLetters=function(){if(this.selection.isEmpty()){var e=this.getCursorPosition(),t=e.column;if(0!==t){var n,i,o=this.session.getLine(e.row);t<o.length?(n=o.charAt(t)+o.charAt(t-1),i=new p(e.row,t-1,e.row,t+1)):(n=o.charAt(t-1)+o.charAt(t-2),i=new p(e.row,t-2,e.row,t)),this.session.replace(i,n),this.session.selection.moveToPosition(i.end)}}},this.toLowerCase=function(){var e=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var t=this.getSelectionRange(),n=this.session.getTextRange(t);this.session.replace(t,n.toLowerCase()),this.selection.setSelectionRange(e)},this.toUpperCase=function(){var e=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var t=this.getSelectionRange(),n=this.session.getTextRange(t);this.session.replace(t,n.toUpperCase()),this.selection.setSelectionRange(e)},this.indent=function(){var e=this.session,t=this.getSelectionRange();if(!(t.start.row<t.end.row)){if(t.start.column<t.end.column){var n=e.getTextRange(t);if(!/^\s+$/.test(n))return u=this.$getSelectedRows(),void e.indentRows(u.first,u.last,"\t")}var i=e.getLine(t.start.row),o=t.start,s=e.getTabSize(),a=e.documentToScreenColumn(o.row,o.column);if(this.session.getUseSoftTabs())var l=s-a%s,c=r.stringRepeat(" ",l);else{for(l=a%s;" "==i[t.start.column-1]&&l;)t.start.column--,l--;this.selection.setSelectionRange(t),c="\t"}return this.insert(c)}var u=this.$getSelectedRows();e.indentRows(u.first,u.last,"\t")},this.blockIndent=function(){var e=this.$getSelectedRows();this.session.indentRows(e.first,e.last,"\t")},this.blockOutdent=function(){var e=this.session.getSelection();this.session.outdentRows(e.getRange())},this.sortLines=function(){for(var e=this.$getSelectedRows(),t=this.session,n=[],i=e.first;i<=e.last;i++)n.push(t.getLine(i));n.sort((function(e,t){return e.toLowerCase()<t.toLowerCase()?-1:e.toLowerCase()>t.toLowerCase()?1:0}));var o=new p(0,0,0,0);for(i=e.first;i<=e.last;i++){var r=t.getLine(i);o.start.row=i,o.end.row=i,o.end.column=r.length,t.replace(o,n[i-e.first])}},this.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},this.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),n=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,n,e)},this.getNumberAt=function(e,t){var n=/[\-]?[0-9]+(?:\.[0-9]+)?/g;n.lastIndex=0;for(var i=this.session.getLine(e);n.lastIndex<t;){var o=n.exec(i);if(o.index<=t&&o.index+o[0].length>=t)return{value:o[0],start:o.index,end:o.index+o[0].length}}return null},this.modifyNumber=function(e){var t=this.selection.getCursor().row,n=this.selection.getCursor().column,i=new p(t,n-1,t,n),o=this.session.getTextRange(i);if(!isNaN(parseFloat(o))&&isFinite(o)){var r=this.getNumberAt(t,n);if(r){var s=r.value.indexOf(".")>=0?r.start+r.value.indexOf(".")+1:r.end,a=r.start+r.value.length-s,l=parseFloat(r.value);l*=Math.pow(10,a),s!==r.end&&n<s?e*=Math.pow(10,r.end-n-1):e*=Math.pow(10,r.end-n),l+=e;var c=(l/=Math.pow(10,a)).toFixed(a),u=new p(t,r.start,t,r.end);this.session.replace(u,c),this.moveCursorTo(t,Math.max(r.start+1,n+c.length-r.value.length))}}else this.toggleWord()},this.$toggleWordPairs=[["first","last"],["true","false"],["yes","no"],["width","height"],["top","bottom"],["right","left"],["on","off"],["x","y"],["get","set"],["max","min"],["horizontal","vertical"],["show","hide"],["add","remove"],["up","down"],["before","after"],["even","odd"],["in","out"],["inside","outside"],["next","previous"],["increase","decrease"],["attach","detach"],["&&","||"],["==","!="]],this.toggleWord=function(){var e=this.selection.getCursor().row,t=this.selection.getCursor().column;this.selection.selectWord();var n=this.getSelectedText(),i=this.selection.getWordRange().start.column,o=n.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/),s=t-i-1;s<0&&(s=0);var a=0,l=0,c=this;n.match(/[A-Za-z0-9_]+/)&&o.forEach((function(t,o){l=a+t.length,s>=a&&s<=l&&(n=t,c.selection.clearSelection(),c.moveCursorTo(e,a+i),c.selection.selectTo(e,l+i)),a=l}));for(var u,h=this.$toggleWordPairs,d=0;d<h.length;d++)for(var p=h[d],f=0;f<=1;f++){var g=+!f,m=n.match(new RegExp("^\\s?_?("+r.escapeRegExp(p[f])+")\\s?$","i"));m&&n.match(new RegExp("([_]|^|\\s)("+r.escapeRegExp(m[1])+")($|\\s)","g"))&&(u=n.replace(new RegExp(r.escapeRegExp(p[f]),"i"),(function(e){var t=p[g];return e.toUpperCase()==e?t=t.toUpperCase():e.charAt(0).toUpperCase()==e.charAt(0)&&(t=t.substr(0,0)+p[g].charAt(0).toUpperCase()+t.substr(1)),t})),this.insert(u),u="")}},this.removeLines=function(){var e=this.$getSelectedRows();this.session.removeFullLines(e.first,e.last),this.clearSelection()},this.duplicateSelection=function(){var e=this.selection,t=this.session,n=e.getRange(),i=e.isBackwards();if(n.isEmpty()){var o=n.start.row;t.duplicateLines(o,o)}else{var r=i?n.start:n.end,s=t.insert(r,t.getTextRange(n),!1);n.start=r,n.end=s,e.setSelectionRange(n,i)}},this.moveLinesDown=function(){this.$moveLines(1,!1)},this.moveLinesUp=function(){this.$moveLines(-1,!1)},this.moveText=function(e,t,n){return this.session.moveText(e,t,n)},this.copyLinesUp=function(){this.$moveLines(-1,!0)},this.copyLinesDown=function(){this.$moveLines(1,!0)},this.$moveLines=function(e,t){var n,i,o=this.selection;if(!o.inMultiSelectMode||this.inVirtualSelectionMode){var r=o.toOrientedRange();n=this.$getSelectedRows(r),i=this.session.$moveLines(n.first,n.last,t?0:e),t&&-1==e&&(i=0),r.moveBy(i,0),o.fromOrientedRange(r)}else{var s=o.rangeList.ranges;o.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var a=0,l=0,c=s.length,u=0;u<c;u++){var h=u;s[u].moveBy(a,0);for(var d=(n=this.$getSelectedRows(s[u])).first,p=n.last;++u<c;){l&&s[u].moveBy(l,0);var f=this.$getSelectedRows(s[u]);if(t&&f.first!=p)break;if(!t&&f.first>p+1)break;p=f.last}for(u--,a=this.session.$moveLines(d,p,t?0:e),t&&-1==e&&(h=u+1);h<=u;)s[h].moveBy(a,0),h++;t||(a=0),l+=a}o.fromOrientedRange(o.ranges[0]),o.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},this.onCompositionStart=function(e){this.renderer.showComposition(e)},this.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()},this.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(e,t){var n=this.renderer,i=this.renderer.layerConfig,o=e*Math.floor(i.height/i.lineHeight);!0===t?this.selection.$moveSelection((function(){this.moveCursorBy(o,0)})):!1===t&&(this.selection.moveCursorBy(o,0),this.selection.clearSelection());var r=n.scrollTop;n.scrollBy(0,o*i.lineHeight),null!=t&&n.scrollCursorIntoView(null,.5),n.animateScrolling(r)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(e){this.renderer.scrollToRow(e)},this.scrollToLine=function(e,t,n,i){this.renderer.scrollToLine(e,t,n,i)},this.centerSelection=function(){var e=this.getSelectionRange(),t={row:Math.floor(e.start.row+(e.end.row-e.start.row)/2),column:Math.floor(e.start.column+(e.end.column-e.start.column)/2)};this.renderer.alignCursor(t,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.selection.selectAll()},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},this.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},this.jumpToMatching=function(e,t){var n=this.getCursorPosition(),i=new b(this.session,n.row,n.column),o=i.getCurrentToken(),r=o||i.stepForward();if(r){var s,a,l=!1,c={},u=n.column-r.start,h={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(r.value.match(/[{}()\[\]]/g)){for(;u<r.value.length&&!l;u++)if(h[r.value[u]])switch(a=h[r.value[u]]+"."+r.type.replace("rparen","lparen"),isNaN(c[a])&&(c[a]=0),r.value[u]){case"(":case"[":case"{":c[a]++;break;case")":case"]":case"}":c[a]--,-1===c[a]&&(s="bracket",l=!0)}}else-1!==r.type.indexOf("tag-name")&&(isNaN(c[r.value])&&(c[r.value]=0),"<"===o.value?c[r.value]++:"</"===o.value&&c[r.value]--,-1===c[r.value]&&(s="tag",l=!0));l||(o=r,r=i.stepForward(),u=0)}while(r&&!l);if(s){var d,f;if("bracket"===s)(d=this.session.getBracketRange(n))||(f=(d=new p(i.getCurrentTokenRow(),i.getCurrentTokenColumn()+u-1,i.getCurrentTokenRow(),i.getCurrentTokenColumn()+u-1)).start,(t||f.row===n.row&&Math.abs(f.column-n.column)<2)&&(d=this.session.getBracketRange(f)));else if("tag"===s){if(!r||-1===r.type.indexOf("tag-name"))return;var g=r.value;if(0===(d=new p(i.getCurrentTokenRow(),i.getCurrentTokenColumn()-2,i.getCurrentTokenRow(),i.getCurrentTokenColumn()-2)).compare(n.row,n.column)){l=!1;do{r=o,(o=i.stepBackward())&&(-1!==o.type.indexOf("tag-close")&&d.setEnd(i.getCurrentTokenRow(),i.getCurrentTokenColumn()+1),r.value===g&&-1!==r.type.indexOf("tag-name")&&("<"===o.value?c[g]++:"</"===o.value&&c[g]--,0===c[g]&&(l=!0)))}while(o&&!l)}r&&r.type.indexOf("tag-name")&&(f=d.start).row==n.row&&Math.abs(f.column-n.column)<2&&(f=d.end)}(f=d&&d.cursor||f)&&(e?d&&t?this.selection.setRange(d):d&&d.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(f.row,f.column):this.selection.moveTo(f.row,f.column))}}},this.gotoLine=function(e,t,n){this.selection.clearSelection(),this.session.unfold({row:e-1,column:t||0}),this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(e-1,t||0),this.isRowFullyVisible(e-1)||this.scrollToLine(e-1,!0,n)},this.navigateTo=function(e,t){this.selection.moveTo(e,t)},this.navigateUp=function(e){if(this.selection.isMultiLine()&&!this.selection.isBackwards()){var t=this.selection.anchor.getPosition();return this.moveCursorToPosition(t)}this.selection.clearSelection(),this.selection.moveCursorBy(-e||-1,0)},this.navigateDown=function(e){if(this.selection.isMultiLine()&&this.selection.isBackwards()){var t=this.selection.anchor.getPosition();return this.moveCursorToPosition(t)}this.selection.clearSelection(),this.selection.moveCursorBy(e||1,0)},this.navigateLeft=function(e){if(this.selection.isEmpty())for(e=e||1;e--;)this.selection.moveCursorLeft();else{var t=this.getSelectionRange().start;this.moveCursorToPosition(t)}this.clearSelection()},this.navigateRight=function(e){if(this.selection.isEmpty())for(e=e||1;e--;)this.selection.moveCursorRight();else{var t=this.getSelectionRange().end;this.moveCursorToPosition(t)}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},this.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(e,t){t&&this.$search.set(t);var n=this.$search.find(this.session),i=0;return n?(this.$tryReplace(n,e)&&(i=1),this.selection.setSelectionRange(n),this.renderer.scrollSelectionIntoView(n.start,n.end),i):i},this.replaceAll=function(e,t){t&&this.$search.set(t);var n=this.$search.findAll(this.session),i=0;if(!n.length)return i;var o=this.getSelectionRange();this.selection.moveTo(0,0);for(var r=n.length-1;r>=0;--r)this.$tryReplace(n[r],e)&&i++;return this.selection.setSelectionRange(o),i},this.$tryReplace=function(e,t){var n=this.session.getTextRange(e);return null!==(t=this.$search.replace(n,t))?(e.end=this.session.replace(e,t),e):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(e,t,n){t||(t={}),"string"==typeof e||e instanceof RegExp?t.needle=e:"object"==typeof e&&i.mixin(t,e);var o=this.selection.getRange();null==t.needle&&((e=this.session.getTextRange(o)||this.$search.$options.needle)||(o=this.session.getWordRange(o.start.row,o.start.column),e=this.session.getTextRange(o)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:o});var r=this.$search.find(this.session);return t.preventScroll?r:r?(this.revealRange(r,n),r):(t.backwards?o.start=o.end:o.end=o.start,void this.selection.setRange(o))},this.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},this.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},this.revealRange=function(e,t){this.session.unfold(e),this.selection.setSelectionRange(e);var n=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),!1!==t&&this.renderer.animateScrolling(n)},this.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach((function(e){e.destroy()})),this.$toDestroy=null),this.$mouseHandler&&this.$mouseHandler.destroy(),this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy(),this._$emitInputEvent&&this._$emitInputEvent.cancel(),this.removeAllListeners()},this.setAutoScrollEditorIntoView=function(e){if(e){var t,n=this,i=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var o=this.$scrollAnchor;o.style.cssText="position:absolute",this.container.insertBefore(o,this.container.firstChild);var r=this.on("changeSelection",(function(){i=!0})),s=this.renderer.on("beforeRender",(function(){i&&(t=n.renderer.container.getBoundingClientRect())})),a=this.renderer.on("afterRender",(function(){if(i&&t&&(n.isFocused()||n.searchBox&&n.searchBox.isFocused())){var e=n.renderer,r=e.$cursorLayer.$pixelPos,s=e.layerConfig,a=r.top-s.offset;null!=(i=r.top>=0&&a+t.top<0||!(r.top<s.height&&r.top+t.top+s.lineHeight>window.innerHeight)&&null)&&(o.style.top=a+"px",o.style.left=r.left+"px",o.style.height=s.lineHeight+"px",o.scrollIntoView(i)),i=t=null}}));this.setAutoScrollEditorIntoView=function(e){e||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",r),this.renderer.off("afterRender",a),this.renderer.off("beforeRender",s))}}},this.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;t&&(t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&"wide"!=e,o.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e)))},this.prompt=function(e,t,n){var i=this;v.loadModule("./ext/prompt",(function(o){o.prompt(i,e,t,n)}))}}.call(y.prototype),v.defineOptions(y.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){this.textInput.setReadOnly(e),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:!1},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},enableAutoIndent:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(e){this.renderer.$gutterLayer.setShowLineNumbers(e),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),e&&this.$relativeLineNumbers?x.attach(this):x.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(e){this.$showLineNumbers&&e?x.attach(this):x.detach(this)}},placeholder:{set:function(e){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var e=this.session&&(this.renderer.$composition||this.getValue());if(e&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),o.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(e||this.renderer.placeholderNode)!e&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"");else{this.renderer.on("afterRender",this.$updatePlaceholder),o.addCssClass(this.container,"ace_hasPlaceholder");var t=o.createElement("div");t.className="ace_placeholder",t.textContent=this.$placeholder||"",this.renderer.placeholderNode=t,this.renderer.content.appendChild(this.renderer.placeholderNode)}}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var x={getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?"·":""))+""},getWidth:function(e,t,n){return Math.max(t.toString().length,(n.lastRow+1).toString().length,2)*n.characterWidth},update:function(e,t){t.renderer.$loop.schedule(t.renderer.CHANGE_GUTTER)},attach:function(e){e.renderer.$gutterLayer.$renderer=this,e.on("changeSelection",this.update),this.update(null,e)},detach:function(e){e.renderer.$gutterLayer.$renderer==this&&(e.renderer.$gutterLayer.$renderer=null),e.off("changeSelection",this.update),this.update(null,e)}};t.Editor=y})),ace.define("ace/undomanager",["require","exports","module","ace/range"],(function(e,t,n){"use strict";var i=function(){this.$maxRev=0,this.$fromUndo=!1,this.reset()};(function(){this.addSession=function(e){this.$session=e},this.add=function(e,t,n){this.$fromUndo||e!=this.$lastDelta&&(this.$keepRedoStack||(this.$redoStack.length=0),!1!==t&&this.lastDeltas||(this.lastDeltas=[],this.$undoStack.push(this.lastDeltas),e.id=this.$rev=++this.$maxRev),"remove"!=e.action&&"insert"!=e.action||(this.$lastDelta=e),this.lastDeltas.push(e))},this.addSelection=function(e,t){this.selections.push({value:e,rev:t||this.$rev})},this.startNewGroup=function(){return this.lastDeltas=null,this.$rev},this.markIgnored=function(e,t){null==t&&(t=this.$rev+1);for(var n=this.$undoStack,i=n.length;i--;){var o=n[i][0];if(o.id<=e)break;o.id<t&&(o.ignore=!0)}this.lastDeltas=null},this.getSelection=function(e,t){for(var n=this.selections,i=n.length;i--;){var o=n[i];if(o.rev<e)return t&&(o=n[i+1]),o}},this.getRevision=function(){return this.$rev},this.getDeltas=function(e,t){null==t&&(t=this.$rev+1);for(var n=this.$undoStack,i=null,o=0,r=n.length;r--;){var s=n[r][0];if(s.id<t&&!i&&(i=r+1),s.id<=e){o=r+1;break}}return n.slice(o,i)},this.getChangedRanges=function(e,t){null==t&&(t=this.$rev+1)},this.getChangedLines=function(e,t){null==t&&(t=this.$rev+1)},this.undo=function(e,t){this.lastDeltas=null;var n=this.$undoStack;if(function(e,t){for(var n=t;n--;){var i=e[n];if(i&&!i[0].ignore){for(;n<t-1;){var o=u(e[n],e[n+1]);e[n]=o[0],e[n+1]=o[1],n++}return!0}}}(n,n.length)){e||(e=this.$session),this.$redoStackBaseRev!==this.$rev&&this.$redoStack.length&&(this.$redoStack=[]),this.$fromUndo=!0;var i=n.pop(),o=null;return i&&(o=e.undoChanges(i,t),this.$redoStack.push(i),this.$syncRev()),this.$fromUndo=!1,o}},this.redo=function(e,t){if(this.lastDeltas=null,e||(e=this.$session),this.$fromUndo=!0,this.$redoStackBaseRev!=this.$rev){var n=this.getDeltas(this.$redoStackBaseRev,this.$rev+1);!function(e,t){for(var n=0;n<t.length;n++)for(var i=t[n],o=0;o<i.length;o++)g(e,i[o])}(this.$redoStack,n),this.$redoStackBaseRev=this.$rev,this.$redoStack.forEach((function(e){e[0].id=++this.$maxRev}),this)}var i=this.$redoStack.pop(),o=null;return i&&(o=e.redoChanges(i,t),this.$undoStack.push(i),this.$syncRev()),this.$fromUndo=!1,o},this.$syncRev=function(){var e=this.$undoStack,t=e[e.length-1],n=t&&t[0].id||0;this.$redoStackBaseRev=n,this.$rev=n},this.reset=function(){this.lastDeltas=null,this.$lastDelta=null,this.$undoStack=[],this.$redoStack=[],this.$rev=0,this.mark=0,this.$redoStackBaseRev=this.$rev,this.selections=[]},this.canUndo=function(){return this.$undoStack.length>0},this.canRedo=function(){return this.$redoStack.length>0},this.bookmark=function(e){null==e&&(e=this.$rev),this.mark=e},this.isAtBookmark=function(){return this.$rev===this.mark},this.toJSON=function(){},this.fromJSON=function(){},this.hasUndo=this.canUndo,this.hasRedo=this.canRedo,this.isClean=this.isAtBookmark,this.markClean=this.bookmark,this.$prettyPrint=function(e){return e?a(e):a(this.$undoStack)+"\n---\n"+a(this.$redoStack)}}).call(i.prototype);var o=e("./range").Range,r=o.comparePoints;function s(e){return{row:e.row,column:e.column}}function a(e){if(e=e||this,Array.isArray(e))return e.map(a).join("\n");var t="";return e.action?(t="insert"==e.action?"+":"-",t+="["+e.lines+"]"):e.value&&(t=Array.isArray(e.value)?e.value.map(l).join("\n"):l(e.value)),e.start&&(t+=l(e)),(e.id||e.rev)&&(t+="\t("+(e.id||e.rev)+")"),t}function l(e){return e.start.row+":"+e.start.column+"=>"+e.end.row+":"+e.end.column}function c(e,t){var n="insert"==e.action,i="insert"==t.action;if(n&&i)if(r(t.start,e.end)>=0)d(t,e,-1);else{if(!(r(t.start,e.start)<=0))return null;d(e,t,1)}else if(n&&!i)if(r(t.start,e.end)>=0)d(t,e,-1);else{if(!(r(t.end,e.start)<=0))return null;d(e,t,-1)}else if(!n&&i)if(r(t.start,e.start)>=0)d(t,e,1);else{if(!(r(t.start,e.start)<=0))return null;d(e,t,1)}else if(!n&&!i)if(r(t.start,e.start)>=0)d(t,e,1);else{if(!(r(t.end,e.start)<=0))return null;d(e,t,-1)}return[t,e]}function u(e,t){for(var n=e.length;n--;)for(var i=0;i<t.length;i++)if(!c(e[n],t[i])){for(;n<e.length;){for(;i--;)c(t[i],e[n]);i=t.length,n++}return[e,t]}return e.selectionBefore=t.selectionBefore=e.selectionAfter=t.selectionAfter=null,[t,e]}function h(e,t){var n="insert"==e.action,i="insert"==t.action;if(n&&i)r(e.start,t.start)<0?d(t,e,1):d(e,t,1);else if(n&&!i)r(e.start,t.end)>=0?d(e,t,-1):(r(e.start,t.start)<=0||d(e,o.fromPoints(t.start,e.start),-1),d(t,e,1));else if(!n&&i)r(t.start,e.end)>=0?d(t,e,-1):(r(t.start,e.start)<=0||d(t,o.fromPoints(e.start,t.start),-1),d(e,t,1));else if(!n&&!i)if(r(t.start,e.end)>=0)d(t,e,-1);else{var s,a;if(!(r(t.end,e.start)<=0))return r(e.start,t.start)<0&&(s=e,e=f(e,t.start)),r(e.end,t.end)>0&&(a=f(e,t.end)),p(t.end,e.start,e.end,-1),a&&!s&&(e.lines=a.lines,e.start=a.start,e.end=a.end,a=e),[t,s,a].filter(Boolean);d(e,t,-1)}return[t,e]}function d(e,t,n){p(e.start,t.start,t.end,n),p(e.end,t.start,t.end,n)}function p(e,t,n,i){e.row==(1==i?t:n).row&&(e.column+=i*(n.column-t.column)),e.row+=i*(n.row-t.row)}function f(e,t){var n=e.lines,i=e.end;e.end=s(t);var o=e.end.row-e.start.row,r=n.splice(o,n.length),a=o?t.column:t.column-e.start.column;return n.push(r[0].substring(0,a)),r[0]=r[0].substr(a),{start:s(t),end:i,lines:r,action:e.action}}function g(e,t){t=function(e){return{start:s(e.start),end:s(e.end),action:e.action,lines:e.lines.slice()}}(t);for(var n=e.length;n--;){for(var i=e[n],o=0;o<i.length;o++){var r=h(i[o],t);t=r[0],2!=r.length&&(r[2]?(i.splice(o+1,1,r[1],r[2]),o++):r[1]||(i.splice(o,1),o--))}i.length||e.splice(n,1)}return e}o.comparePoints,t.UndoManager=i})),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],(function(e,t,n){"use strict";var i=e("../lib/dom"),o=function(e,t){this.element=e,this.canvasHeight=t||5e5,this.element.style.height=2*this.canvasHeight+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0};(function(){this.moveContainer=function(e){i.translate(this.element,0,-e.firstRowScreen*e.lineHeight%this.canvasHeight-e.offset*this.$offsetCoefficient)},this.pageChanged=function(e,t){return Math.floor(e.firstRowScreen*e.lineHeight/this.canvasHeight)!==Math.floor(t.firstRowScreen*t.lineHeight/this.canvasHeight)},this.computeLineTop=function(e,t,n){var i=t.firstRowScreen*t.lineHeight,o=Math.floor(i/this.canvasHeight);return n.documentToScreenRow(e,0)*t.lineHeight-o*this.canvasHeight},this.computeLineHeight=function(e,t,n){return t.lineHeight*n.getRowLineCount(e)},this.getLength=function(){return this.cells.length},this.get=function(e){return this.cells[e]},this.shift=function(){this.$cacheCell(this.cells.shift())},this.pop=function(){this.$cacheCell(this.cells.pop())},this.push=function(e){if(Array.isArray(e)){this.cells.push.apply(this.cells,e);for(var t=i.createFragment(this.element),n=0;n<e.length;n++)t.appendChild(e[n].element);this.element.appendChild(t)}else this.cells.push(e),this.element.appendChild(e.element)},this.unshift=function(e){if(Array.isArray(e)){this.cells.unshift.apply(this.cells,e);for(var t=i.createFragment(this.element),n=0;n<e.length;n++)t.appendChild(e[n].element);this.element.firstChild?this.element.insertBefore(t,this.element.firstChild):this.element.appendChild(t)}else this.cells.unshift(e),this.element.insertAdjacentElement("afterbegin",e.element)},this.last=function(){return this.cells.length?this.cells[this.cells.length-1]:null},this.$cacheCell=function(e){e&&(e.element.remove(),this.cellCache.push(e))},this.createCell=function(e,t,n,o){var r=this.cellCache.pop();if(!r){var s=i.createElement("div");o&&o(s),this.element.appendChild(s),r={element:s,text:"",row:e}}return r.row=e,r}}).call(o.prototype),t.Lines=o})),ace.define("ace/layer/gutter",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/layer/lines"],(function(e,t,n){"use strict";var i=e("../lib/dom"),o=e("../lib/oop"),r=e("../lib/lang"),s=e("../lib/event_emitter").EventEmitter,a=e("./lines").Lines,l=function(e){this.element=i.createElement("div"),this.element.className="ace_layer ace_gutter-layer",e.appendChild(this.element),this.setShowFoldWidgets(this.$showFoldWidgets),this.gutterWidth=0,this.$annotations=[],this.$updateAnnotations=this.$updateAnnotations.bind(this),this.$lines=new a(this.element),this.$lines.$offsetCoefficient=1};function c(e){var t=document.createTextNode("");e.appendChild(t);var n=i.createElement("span");return e.appendChild(n),e}(function(){o.implement(this,s),this.setSession=function(e){this.session&&this.session.off("change",this.$updateAnnotations),this.session=e,e&&e.on("change",this.$updateAnnotations)},this.addGutterDecoration=function(e,t){window.console&&console.warn&&console.warn("deprecated use session.addGutterDecoration"),this.session.addGutterDecoration(e,t)},this.removeGutterDecoration=function(e,t){window.console&&console.warn&&console.warn("deprecated use session.removeGutterDecoration"),this.session.removeGutterDecoration(e,t)},this.setAnnotations=function(e){this.$annotations=[];for(var t=0;t<e.length;t++){var n=e[t],i=n.row,o=this.$annotations[i];o||(o=this.$annotations[i]={text:[]});var s=n.text;s=s?r.escapeHTML(s):n.html||"",-1===o.text.indexOf(s)&&o.text.push(s);var a=n.type;"error"==a?o.className=" ace_error":"warning"==a&&" ace_error"!=o.className?o.className=" ace_warning":"info"!=a||o.className||(o.className=" ace_info")}},this.$updateAnnotations=function(e){if(this.$annotations.length){var t=e.start.row,n=e.end.row-t;if(0===n);else if("remove"==e.action)this.$annotations.splice(t,n+1,null);else{var i=new Array(n+1);i.unshift(t,1),this.$annotations.splice.apply(this.$annotations,i)}}},this.update=function(e){this.config=e;var t=this.session,n=e.firstRow,i=Math.min(e.lastRow+e.gutterOffset,t.getLength()-1);this.oldLastRow=i,this.config=e,this.$lines.moveContainer(e),this.$updateCursorRow();for(var o=t.getNextFoldLine(n),r=o?o.start.row:1/0,s=null,a=-1,l=n;;){if(l>r&&(l=o.end.row+1,r=(o=t.getNextFoldLine(l,o))?o.start.row:1/0),l>i){for(;this.$lines.getLength()>a+1;)this.$lines.pop();break}(s=this.$lines.get(++a))?s.row=l:(s=this.$lines.createCell(l,e,this.session,c),this.$lines.push(s)),this.$renderCell(s,e,o,l),l++}this._signal("afterRender"),this.$updateGutterWidth(e)},this.$updateGutterWidth=function(e){var t=this.session,n=t.gutterRenderer||this.$renderer,i=t.$firstLineNumber,o=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||t.$useWrapMode)&&(o=t.getLength()+i-1);var r=n?n.getWidth(t,o,e):o.toString().length*e.characterWidth,s=this.$padding||this.$computePadding();(r+=s.left+s.right)===this.gutterWidth||isNaN(r)||(this.gutterWidth=r,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",r))},this.$updateCursorRow=function(){if(this.$highlightGutterLine){var e=this.session.selection.getCursor();this.$cursorRow!==e.row&&(this.$cursorRow=e.row)}},this.updateLineHighlight=function(){if(this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!this.$cursorCell||this.$cursorCell.row!=e){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var t=this.$lines.cells;this.$cursorCell=null;for(var n=0;n<t.length;n++){var i=t[n];if(i.row>=this.$cursorRow){if(i.row>this.$cursorRow){var o=this.session.getFoldLine(this.$cursorRow);if(!(n>0&&o&&o.start.row==t[n-1].row))break;i=t[n-1]}i.element.className="ace_gutter-active-line "+i.element.className,this.$cursorCell=i;break}}}}},this.scrollLines=function(e){var t=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var n=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),i=this.oldLastRow;if(this.oldLastRow=n,!t||i<e.firstRow)return this.update(e);if(n<t.firstRow)return this.update(e);if(t.firstRow<e.firstRow)for(var o=this.session.getFoldedRowCount(t.firstRow,e.firstRow-1);o>0;o--)this.$lines.shift();if(i>n)for(o=this.session.getFoldedRowCount(n+1,i);o>0;o--)this.$lines.pop();e.firstRow<t.firstRow&&this.$lines.unshift(this.$renderLines(e,e.firstRow,t.firstRow-1)),n>i&&this.$lines.push(this.$renderLines(e,i+1,n)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},this.$renderLines=function(e,t,n){for(var i=[],o=t,r=this.session.getNextFoldLine(o),s=r?r.start.row:1/0;o>s&&(o=r.end.row+1,s=(r=this.session.getNextFoldLine(o,r))?r.start.row:1/0),!(o>n);){var a=this.$lines.createCell(o,e,this.session,c);this.$renderCell(a,e,r,o),i.push(a),o++}return i},this.$renderCell=function(e,t,n,o){var r=e.element,s=this.session,a=r.childNodes[0],l=r.childNodes[1],c=s.$firstLineNumber,u=s.$breakpoints,h=s.$decorations,d=s.gutterRenderer||this.$renderer,p=this.$showFoldWidgets&&s.foldWidgets,f=n?n.start.row:Number.MAX_VALUE,g="ace_gutter-cell ";if(this.$highlightGutterLine&&(o==this.$cursorRow||n&&o<this.$cursorRow&&o>=f&&this.$cursorRow<=n.end.row)&&(g+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),u[o]&&(g+=u[o]),h[o]&&(g+=h[o]),this.$annotations[o]&&(g+=this.$annotations[o].className),r.className!=g&&(r.className=g),p){var m=p[o];null==m&&(m=p[o]=s.getFoldWidget(o))}if(m){g="ace_fold-widget ace_"+m,"start"==m&&o==f&&o<n.end.row?g+=" ace_closed":g+=" ace_open",l.className!=g&&(l.className=g);var v=t.lineHeight+"px";i.setStyle(l.style,"height",v),i.setStyle(l.style,"display","inline-block")}else l&&i.setStyle(l.style,"display","none");var b=(d?d.getText(s,o):o+c).toString();return b!==a.data&&(a.data=b),i.setStyle(e.element.style,"height",this.$lines.computeLineHeight(o,t,s)+"px"),i.setStyle(e.element.style,"top",this.$lines.computeLineTop(o,t,s)+"px"),e.text=b,e},this.$fixedWidth=!1,this.$highlightGutterLine=!0,this.$renderer="",this.setHighlightGutterLine=function(e){this.$highlightGutterLine=e},this.$showLineNumbers=!0,this.$renderer="",this.setShowLineNumbers=function(e){this.$renderer=!e&&{getWidth:function(){return 0},getText:function(){return""}}},this.getShowLineNumbers=function(){return this.$showLineNumbers},this.$showFoldWidgets=!0,this.setShowFoldWidgets=function(e){e?i.addCssClass(this.element,"ace_folding-enabled"):i.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=e,this.$padding=null},this.getShowFoldWidgets=function(){return this.$showFoldWidgets},this.$computePadding=function(){if(!this.element.firstChild)return{left:0,right:0};var e=i.computedStyle(this.element.firstChild);return this.$padding={},this.$padding.left=(parseInt(e.borderLeftWidth)||0)+(parseInt(e.paddingLeft)||0)+1,this.$padding.right=(parseInt(e.borderRightWidth)||0)+(parseInt(e.paddingRight)||0),this.$padding},this.getRegion=function(e){var t=this.$padding||this.$computePadding(),n=this.element.getBoundingClientRect();return e.x<t.left+n.left?"markers":this.$showFoldWidgets&&e.x>n.right-t.right?"foldWidgets":void 0}}).call(l.prototype),t.Gutter=l})),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],(function(e,t,n){"use strict";var i=e("../range").Range,o=e("../lib/dom"),r=function(e){this.element=o.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.elt=function(e,t){var n=-1!=this.i&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=t,n.className=e},this.update=function(e){if(e){var t;for(var n in this.config=e,this.i=0,this.markers){var i=this.markers[n];if(i.range){var o=i.range.clipRows(e.firstRow,e.lastRow);if(!o.isEmpty())if(o=o.toScreenRange(this.session),i.renderer){var r=this.$getTop(o.start.row,e),s=this.$padding+o.start.column*e.characterWidth;i.renderer(t,o,s,r,e)}else"fullLine"==i.type?this.drawFullLineMarker(t,o,i.clazz,e):"screenLine"==i.type?this.drawScreenLineMarker(t,o,i.clazz,e):o.isMultiLine()?"text"==i.type?this.drawTextMarker(t,o,i.clazz,e):this.drawMultiLineMarker(t,o,i.clazz,e):this.drawSingleLineMarker(t,o,i.clazz+" ace_start ace_br15",e)}else i.update(t,this,this.session,e)}if(-1!=this.i)for(;this.i<this.element.childElementCount;)this.element.removeChild(this.element.lastChild)}},this.$getTop=function(e,t){return(e-t.firstRowScreen)*t.lineHeight},this.drawTextMarker=function(e,t,n,o,r){for(var s=this.session,a=t.start.row,l=t.end.row,c=a,u=0,h=0,d=s.getScreenLastRowColumn(c),p=new i(c,t.start.column,c,h);c<=l;c++)p.start.row=p.end.row=c,p.start.column=c==a?t.start.column:s.getRowWrapIndent(c),p.end.column=d,u=h,h=d,d=c+1<l?s.getScreenLastRowColumn(c+1):c==l?0:t.end.column,this.drawSingleLineMarker(e,p,n+(c==a?" ace_start":"")+" ace_br"+((c==a||c==a+1&&t.start.column?1:0)|(u<h?2:0)|(h>d?4:0)|(c==l?8:0)),o,c==l?0:1,r)},this.drawMultiLineMarker=function(e,t,n,i,o){var r=this.$padding,s=i.lineHeight,a=this.$getTop(t.start.row,i),l=r+t.start.column*i.characterWidth;if(o=o||"",this.session.$bidiHandler.isBidiRow(t.start.row)?((c=t.clone()).end.row=c.start.row,c.end.column=this.session.getLine(c.start.row).length,this.drawBidiSingleLineMarker(e,c,n+" ace_br1 ace_start",i,null,o)):this.elt(n+" ace_br1 ace_start","height:"+s+"px;right:0;top:"+a+"px;left:"+l+"px;"+(o||"")),this.session.$bidiHandler.isBidiRow(t.end.row)){var c;(c=t.clone()).start.row=c.end.row,c.start.column=0,this.drawBidiSingleLineMarker(e,c,n+" ace_br12",i,null,o)}else{a=this.$getTop(t.end.row,i);var u=t.end.column*i.characterWidth;this.elt(n+" ace_br12","height:"+s+"px;width:"+u+"px;top:"+a+"px;left:"+r+"px;"+(o||""))}if(!((s=(t.end.row-t.start.row-1)*i.lineHeight)<=0)){a=this.$getTop(t.start.row+1,i);var h=(t.start.column?1:0)|(t.end.column?0:8);this.elt(n+(h?" ace_br"+h:""),"height:"+s+"px;right:0;top:"+a+"px;left:"+r+"px;"+(o||""))}},this.drawSingleLineMarker=function(e,t,n,i,o,r){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,n,i,o,r);var s=i.lineHeight,a=(t.end.column+(o||0)-t.start.column)*i.characterWidth,l=this.$getTop(t.start.row,i),c=this.$padding+t.start.column*i.characterWidth;this.elt(n,"height:"+s+"px;width:"+a+"px;top:"+l+"px;left:"+c+"px;"+(r||""))},this.drawBidiSingleLineMarker=function(e,t,n,i,o,r){var s=i.lineHeight,a=this.$getTop(t.start.row,i),l=this.$padding;this.session.$bidiHandler.getSelections(t.start.column,t.end.column).forEach((function(e){this.elt(n,"height:"+s+"px;width:"+e.width+(o||0)+"px;top:"+a+"px;left:"+(l+e.left)+"px;"+(r||""))}),this)},this.drawFullLineMarker=function(e,t,n,i,o){var r=this.$getTop(t.start.row,i),s=i.lineHeight;t.start.row!=t.end.row&&(s+=this.$getTop(t.end.row,i)-r),this.elt(n,"height:"+s+"px;top:"+r+"px;left:0;right:0;"+(o||""))},this.drawScreenLineMarker=function(e,t,n,i,o){var r=this.$getTop(t.start.row,i),s=i.lineHeight;this.elt(n,"height:"+s+"px;top:"+r+"px;left:0;right:0;"+(o||""))}}).call(r.prototype),t.Marker=r})),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"],(function(e,t,n){"use strict";var i=e("../lib/oop"),o=e("../lib/dom"),r=e("../lib/lang"),s=e("./lines").Lines,a=e("../lib/event_emitter").EventEmitter,l=function(e){this.dom=o,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new s(this.element)};(function(){i.implement(this,a),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.MAX_LINE_LENGTH=1e4,this.$updateEolChar=function(){var e=this.session.doc,t="\n"==e.getNewLineCharacter()&&"windows"!=e.getNewLineMode()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=t)return this.EOL_CHAR=t,!0},this.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(e){this._signal("changeCharacterSize",e)}.bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(e){this.session=e,e&&this.$computeTabString()},this.showInvisibles=!1,this.showSpaces=!1,this.showTabs=!1,this.showEOL=!1,this.setShowInvisibles=function(e){return this.showInvisibles!=e&&(this.showInvisibles=e,"string"==typeof e?(this.showSpaces=/tab/i.test(e),this.showTabs=/space/i.test(e),this.showEOL=/eol/i.test(e)):this.showSpaces=this.showTabs=this.showEOL=e,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(e){return this.displayIndentGuides!=e&&(this.displayIndentGuides=e,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var t=this.$tabStrings=[0],n=1;n<e+1;n++)this.showTabs?((i=this.dom.createElement("span")).className="ace_invisible ace_invisible_tab",i.textContent=r.stringRepeat(this.TAB_CHAR,n),t.push(i)):t.push(this.dom.createTextNode(r.stringRepeat(" ",n),this.element));if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var i,o="ace_indent-guide",s=this.showSpaces?" ace_invisible ace_invisible_space":"",a=this.showSpaces?r.stringRepeat(this.SPACE_CHAR,this.tabSize):r.stringRepeat(" ",this.tabSize),l=this.showTabs?" ace_invisible ace_invisible_tab":"",c=this.showTabs?r.stringRepeat(this.TAB_CHAR,this.tabSize):a;(i=this.dom.createElement("span")).className=o+s,i.textContent=a,this.$tabStrings[" "]=i,(i=this.dom.createElement("span")).className=o+l,i.textContent=c,this.$tabStrings["\t"]=i}},this.updateLines=function(e,t,n){if(this.config.lastRow!=e.lastRow||this.config.firstRow!=e.firstRow)return this.update(e);this.config=e;for(var i=Math.max(t,e.firstRow),o=Math.min(n,e.lastRow),r=this.element.childNodes,s=0,a=e.firstRow;a<i;a++){if(l=this.session.getFoldLine(a)){if(l.containsRow(i)){i=l.start.row;break}a=l.end.row}s++}for(var l,c=!1,u=(a=i,(l=this.session.getNextFoldLine(a))?l.start.row:1/0);a>u&&(a=l.end.row+1,u=(l=this.session.getNextFoldLine(a,l))?l.start.row:1/0),!(a>o);){var h=r[s++];if(h){this.dom.removeChildren(h),this.$renderLine(h,a,a==u&&l),c&&(h.style.top=this.$lines.computeLineTop(a,e,this.session)+"px");var d=e.lineHeight*this.session.getRowLength(a)+"px";h.style.height!=d&&(c=!0,h.style.height=d)}a++}if(c)for(;s<this.$lines.cells.length;){var p=this.$lines.cells[s++];p.element.style.top=this.$lines.computeLineTop(p.row,e,this.session)+"px"}},this.scrollLines=function(e){var t=this.config;if(this.config=e,this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var n=e.lastRow,i=t?t.lastRow:-1;if(!t||i<e.firstRow)return this.update(e);if(n<t.firstRow)return this.update(e);if(!t||t.lastRow<e.firstRow)return this.update(e);if(e.lastRow<t.firstRow)return this.update(e);if(t.firstRow<e.firstRow)for(var o=this.session.getFoldedRowCount(t.firstRow,e.firstRow-1);o>0;o--)this.$lines.shift();if(t.lastRow>e.lastRow)for(o=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);o>0;o--)this.$lines.pop();e.firstRow<t.firstRow&&this.$lines.unshift(this.$renderLinesFragment(e,e.firstRow,t.firstRow-1)),e.lastRow>t.lastRow&&this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow))},this.$renderLinesFragment=function(e,t,n){for(var i=[],r=t,s=this.session.getNextFoldLine(r),a=s?s.start.row:1/0;r>a&&(r=s.end.row+1,a=(s=this.session.getNextFoldLine(r,s))?s.start.row:1/0),!(r>n);){var l=this.$lines.createCell(r,e,this.session),c=l.element;this.dom.removeChildren(c),o.setStyle(c.style,"height",this.$lines.computeLineHeight(r,e,this.session)+"px"),o.setStyle(c.style,"top",this.$lines.computeLineTop(r,e,this.session)+"px"),this.$renderLine(c,r,r==a&&s),this.$useLineGroups()?c.className="ace_line_group":c.className="ace_line",i.push(l),r++}return i},this.update=function(e){this.$lines.moveContainer(e),this.config=e;for(var t=e.firstRow,n=e.lastRow,i=this.$lines;i.getLength();)i.pop();i.push(this.$renderLinesFragment(e,t,n))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(e,t,n,i){for(var o,s=this,a=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,l=this.dom.createFragment(this.element),c=0;o=a.exec(i);){var u=o[1],h=o[2],d=o[3],p=o[4],f=o[5];if(s.showSpaces||!h){var g=c!=o.index?i.slice(c,o.index):"";if(c=o.index+o[0].length,g&&l.appendChild(this.dom.createTextNode(g,this.element)),u){var m=s.session.getScreenTabSize(t+o.index);l.appendChild(s.$tabStrings[m].cloneNode(!0)),t+=m-1}else h?s.showSpaces?((b=this.dom.createElement("span")).className="ace_invisible ace_invisible_space",b.textContent=r.stringRepeat(s.SPACE_CHAR,h.length),l.appendChild(b)):l.appendChild(this.com.createTextNode(h,this.element)):d?((b=this.dom.createElement("span")).className="ace_invisible ace_invisible_space ace_invalid",b.textContent=r.stringRepeat(s.SPACE_CHAR,d.length),l.appendChild(b)):p?(t+=1,(b=this.dom.createElement("span")).style.width=2*s.config.characterWidth+"px",b.className=s.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",b.textContent=s.showSpaces?s.SPACE_CHAR:p,l.appendChild(b)):f&&(t+=1,(b=this.dom.createElement("span")).style.width=2*s.config.characterWidth+"px",b.className="ace_cjk",b.textContent=f,l.appendChild(b))}}if(l.appendChild(this.dom.createTextNode(c?i.slice(c):i,this.element)),this.$textToken[n.type])e.appendChild(l);else{var v="ace_"+n.type.replace(/\./g," ace_"),b=this.dom.createElement("span");"fold"==n.type&&(b.style.width=n.value.length*this.config.characterWidth+"px"),b.className=v,b.appendChild(l),e.appendChild(b)}return t+i.length},this.renderIndentGuide=function(e,t,n){var i=t.search(this.$indentGuideRe);if(i<=0||i>=n)return t;if(" "==t[0]){for(var o=(i-=i%this.tabSize)/this.tabSize,r=0;r<o;r++)e.appendChild(this.$tabStrings[" "].cloneNode(!0));return t.substr(i)}if("\t"==t[0]){for(r=0;r<i;r++)e.appendChild(this.$tabStrings["\t"].cloneNode(!0));return t.substr(i)}return t},this.$createLineElement=function(e){var t=this.dom.createElement("div");return t.className="ace_line",t.style.height=this.config.lineHeight+"px",t},this.$renderWrappedLine=function(e,t,n){var i=0,o=0,s=n[0],a=0,l=this.$createLineElement();e.appendChild(l);for(var c=0;c<t.length;c++){var u=t[c],h=u.value;if(0==c&&this.displayIndentGuides){if(i=h.length,!(h=this.renderIndentGuide(l,h,s)))continue;i-=h.length}if(i+h.length<s)a=this.$renderToken(l,a,u,h),i+=h.length;else{for(;i+h.length>=s;)a=this.$renderToken(l,a,u,h.substring(0,s-i)),h=h.substring(s-i),i=s,l=this.$createLineElement(),e.appendChild(l),l.appendChild(this.dom.createTextNode(r.stringRepeat(" ",n.indent),this.element)),a=0,s=n[++o]||Number.MAX_VALUE;0!=h.length&&(i+=h.length,a=this.$renderToken(l,a,u,h))}}n[n.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(l,a,null,"",!0)},this.$renderSimpleLine=function(e,t){var n=0,i=t[0],o=i.value;this.displayIndentGuides&&(o=this.renderIndentGuide(e,o)),o&&(n=this.$renderToken(e,n,i,o));for(var r=1;r<t.length;r++){if(n+(o=(i=t[r]).value).length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,n,i,o);n=this.$renderToken(e,n,i,o)}},this.$renderOverflowMessage=function(e,t,n,i,o){n&&this.$renderToken(e,t,n,i.slice(0,this.MAX_LINE_LENGTH-t));var r=this.dom.createElement("span");r.className="ace_inline_button ace_keyword ace_toggle_wrap",r.textContent=o?"<hide>":"<click to see more...>",e.appendChild(r)},this.$renderLine=function(e,t,n){if(n||0==n||(n=this.session.getFoldLine(t)),n)var i=this.$getFoldLineTokens(t,n);else i=this.session.getTokens(t);var o=e;if(i.length){var r=this.session.getRowSplitData(t);r&&r.length?(this.$renderWrappedLine(e,i,r),o=e.lastChild):(o=e,this.$useLineGroups()&&(o=this.$createLineElement(),e.appendChild(o)),this.$renderSimpleLine(o,i))}else this.$useLineGroups()&&(o=this.$createLineElement(),e.appendChild(o));if(this.showEOL&&o){n&&(t=n.end.row);var s=this.dom.createElement("span");s.className="ace_invisible ace_invisible_eol",s.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,o.appendChild(s)}},this.$getFoldLineTokens=function(e,t){var n=this.session,i=[],o=n.getTokens(e);return t.walk((function(e,t,r,s,a){null!=e?i.push({type:"fold",value:e}):(a&&(o=n.getTokens(t)),o.length&&function(e,t,n){for(var o=0,r=0;r+e[o].value.length<t;)if(r+=e[o].value.length,++o==e.length)return;for(r!=t&&((s=e[o].value.substring(t-r)).length>n-t&&(s=s.substring(0,n-t)),i.push({type:e[o].type,value:s}),r=t+s.length,o+=1);r<n&&o<e.length;){var s;(s=e[o].value).length+r>n?i.push({type:e[o].type,value:s.substring(0,n-r)}):i.push(e[o]),r+=s.length,o+=1}}(o,s,r))}),t.end.row,this.session.getLine(t.end.row).length),i},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){}}).call(l.prototype),t.Text=l})),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],(function(e,t,n){"use strict";var i=e("../lib/dom"),o=function(e){this.element=i.createElement("div"),this.element.className="ace_layer ace_cursor-layer",e.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),i.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)};(function(){this.$updateOpacity=function(e){for(var t=this.cursors,n=t.length;n--;)i.setStyle(t[n].style,"opacity",e?"":"0")},this.$startCssAnimation=function(){for(var e=this.cursors,t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=!0,setTimeout(function(){this.$isAnimating&&i.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},this.$stopCssAnimation=function(){this.$isAnimating=!1,i.removeCssClass(this.element,"ace_animate-blinking")},this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setBlinking=function(e){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},this.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},this.setSmoothBlinking=function(e){e!=this.smoothBlinking&&(this.smoothBlinking=e,i.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.restartTimer())},this.addCursor=function(){var e=i.createElement("div");return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},this.removeCursor=function(){if(this.cursors.length>1){var e=this.cursors.pop();return e.parentNode.removeChild(e),e}},this.hideCursor=function(){this.isVisible=!1,i.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,i.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var e=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,i.removeCssClass(this.element,"ace_smooth-blinking")),e(!0),this.isBlinking&&this.blinkInterval&&this.isVisible)if(this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout(function(){this.$isSmoothBlinking&&i.addCssClass(this.element,"ace_smooth-blinking")}.bind(this))),i.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var t=function(){this.timeoutId=setTimeout((function(){e(!1)}),.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval((function(){e(!0),t()}),this.blinkInterval),t()}else this.$stopCssAnimation()},this.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e||(e=this.session.selection.getCursor());var n=this.session.documentToScreenPosition(e);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,e.row)?this.session.$bidiHandler.getPosLeft(n.column):n.column*this.config.characterWidth),top:(n.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight}},this.isCursorInView=function(e,t){return e.top>=0&&e.top<t.maxHeight},this.update=function(e){this.config=e;var t=this.session.$selectionMarkers,n=0,o=0;void 0!==t&&0!==t.length||(t=[{cursor:null}]),n=0;for(var r=t.length;n<r;n++){var s=this.getPixelPosition(t[n].cursor,!0);if(!((s.top>e.height+e.offset||s.top<0)&&n>1)){var a=this.cursors[o++]||this.addCursor(),l=a.style;this.drawCursor?this.drawCursor(a,s,e,t[n],this.session):this.isCursorInView(s,e)?(i.setStyle(l,"display","block"),i.translate(a,s.left,s.top),i.setStyle(l,"width",Math.round(e.characterWidth)+"px"),i.setStyle(l,"height",e.lineHeight+"px")):i.setStyle(l,"display","none")}}for(;this.cursors.length>o;)this.removeCursor();var c=this.session.getOverwrite();this.$setOverwrite(c),this.$pixelPos=s,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(e){e!=this.overwrite&&(this.overwrite=e,e?i.addCssClass(this.element,"ace_overwrite-cursors"):i.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(o.prototype),t.Cursor=o})),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],(function(e,t,n){"use strict";var i=e("./lib/oop"),o=e("./lib/dom"),r=e("./lib/event"),s=e("./lib/event_emitter").EventEmitter,a=32768,l=function(e){this.element=o.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=o.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,r.addListener(this.element,"scroll",this.onScroll.bind(this)),r.addListener(this.element,"mousedown",r.preventDefault)};(function(){i.implement(this,s),this.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1}}).call(l.prototype);var c=function(e,t){l.call(this,e),this.scrollTop=0,this.scrollHeight=0,t.$scrollbarWidth=this.width=o.scrollbarWidth(e.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px",this.$minWidth=0};i.inherits(c,l),function(){this.classSuffix="-v",this.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,1!=this.coeff){var e=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(e){this.element.style.height=e+"px"},this.setInnerHeight=this.setScrollHeight=function(e){this.scrollHeight=e,e>a?(this.coeff=a/e,e=a):1!=this.coeff&&(this.coeff=1),this.inner.style.height=e+"px"},this.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)}}.call(c.prototype);var u=function(e,t){l.call(this,e),this.scrollLeft=0,this.height=t.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};i.inherits(u,l),function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(e){this.element.style.width=e+"px"},this.setInnerWidth=function(e){this.inner.style.width=e+"px"},this.setScrollWidth=function(e){this.inner.style.width=e+"px"},this.setScrollLeft=function(e){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)}}.call(u.prototype),t.ScrollBar=c,t.ScrollBarV=c,t.ScrollBarH=u,t.VScrollBar=c,t.HScrollBar=u})),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],(function(e,t,n){"use strict";var i=e("./lib/event"),o=function(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=t||window;var n=this;this._flush=function(e){n.pending=!1;var t=n.changes;if(t&&(i.blockIdle(100),n.changes=0,n.onRender(t)),n.changes){if(n.$recursionLimit--<0)return;n.schedule()}else n.$recursionLimit=2}};(function(){this.schedule=function(e){this.changes=this.changes|e,this.changes&&!this.pending&&(i.nextFrame(this._flush),this.pending=!0)},this.clear=function(e){var t=this.changes;return this.changes=0,t}}).call(o.prototype),t.RenderLoop=o})),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],(function(e,t,n){var i=e("../lib/oop"),o=e("../lib/dom"),r=e("../lib/lang"),s=e("../lib/event"),a=e("../lib/useragent"),l=e("../lib/event_emitter").EventEmitter,c=256,u="function"==typeof ResizeObserver,h=200,d=t.FontMetrics=function(e){this.el=o.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=o.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=o.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),this.$measureNode.textContent=r.stringRepeat("X",c),this.$characterSize={width:0,height:0},u?this.$addObserver():this.checkForSizeChanges()};(function(){i.implement(this,l),this.$characterSize={width:0,height:0},this.$setMeasureNodeStyles=function(e,t){e.width=e.height="auto",e.left=e.top="0px",e.visibility="hidden",e.position="absolute",e.whiteSpace="pre",a.isIE<8?e["font-family"]="inherit":e.font="inherit",e.overflow=t?"hidden":"visible"},this.checkForSizeChanges=function(e){if(void 0===e&&(e=this.$measureSizes()),e&&(this.$characterSize.width!==e.width||this.$characterSize.height!==e.height)){this.$measureNode.style.fontWeight="bold";var t=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=e,this.charSizes=Object.create(null),this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height,this._emit("changeCharacterSize",{data:e})}},this.$addObserver=function(){var e=this;this.$observer=new window.ResizeObserver((function(t){e.checkForSizeChanges()})),this.$observer.observe(this.$measureNode)},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var e=this;return this.$pollSizeChangesTimer=s.onIdle((function t(){e.checkForSizeChanges(),s.onIdle(t,500)}),500)},this.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(e){var t={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/c};return 0===t.width||0===t.height?null:t},this.$measureCharWidth=function(e){return this.$main.textContent=r.stringRepeat(e,c),this.$main.getBoundingClientRect().width/c},this.getCharacterWidth=function(e){var t=this.charSizes[e];return void 0===t&&(t=this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width),t},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},this.$getZoom=function e(t){return t&&t.parentElement?(window.getComputedStyle(t).zoom||1)*e(t.parentElement):1},this.$initTransformMeasureNodes=function(){var e=function(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]};this.els=o.buildDom([e(0,0),e(h,0),e(0,h),e(h,h)],this.el)},this.transformCoordinates=function(e,t){function n(e,t,n){var i=e[1]*t[0]-e[0]*t[1];return[(-t[1]*n[0]+t[0]*n[1])/i,(+e[1]*n[0]-e[0]*n[1])/i]}function i(e,t){return[e[0]-t[0],e[1]-t[1]]}function o(e,t){return[e[0]+t[0],e[1]+t[1]]}function r(e,t){return[e*t[0],e*t[1]]}function s(e){var t=e.getBoundingClientRect();return[t.left,t.top]}e&&(e=r(1/this.$getZoom(this.el),e)),this.els||this.$initTransformMeasureNodes();var a=s(this.els[0]),l=s(this.els[1]),c=s(this.els[2]),u=s(this.els[3]),d=n(i(u,l),i(u,c),i(o(l,c),o(u,a))),p=r(1+d[0],i(l,a)),f=r(1+d[1],i(c,a));if(t){var g=t,m=d[0]*g[0]/h+d[1]*g[1]/h+1,v=o(r(g[0],p),r(g[1],f));return o(r(1/m/h,v),a)}var b=i(e,a),w=n(i(p,r(d[0],b)),i(f,r(d[1],b)),b);return r(h,w)}}).call(d.prototype)})),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/lib/useragent"],(function(e,t,n){"use strict";var i=e("./lib/oop"),o=e("./lib/dom"),r=e("./config"),s=e("./layer/gutter").Gutter,a=e("./layer/marker").Marker,l=e("./layer/text").Text,c=e("./layer/cursor").Cursor,u=e("./scrollbar").HScrollBar,h=e("./scrollbar").VScrollBar,d=e("./renderloop").RenderLoop,p=e("./layer/font_metrics").FontMetrics,f=e("./lib/event_emitter").EventEmitter,g='.ace_br1 {border-top-left-radius    : 3px;}.ace_br2 {border-top-right-radius   : 3px;}.ace_br3 {border-top-left-radius    : 3px; border-top-right-radius:    3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius    : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius   : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius    : 3px; border-top-right-radius:    3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius    : 3px; border-bottom-left-radius:  3px;}.ace_br10{border-top-right-radius   : 3px; border-bottom-left-radius:  3px;}.ace_br11{border-top-left-radius    : 3px; border-top-right-radius:    3px; border-bottom-left-radius:  3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius:  3px;}.ace_br13{border-top-left-radius    : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius:  3px;}.ace_br14{border-top-right-radius   : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius:  3px;}.ace_br15{border-top-left-radius    : 3px; border-top-right-radius:    3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_editor {position: relative;overflow: hidden;padding: 0;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;box-sizing: border-box;min-width: 100%;contain: style size layout;font-variant-ligatures: no-common-ligatures;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;contain: style size layout;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {position: absolute;top: 0;left: 0;right: 0;padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {contain: strict;position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;contain: strict;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: transparent;color: inherit;z-index: 1000;opacity: 1;}.ace_composition_placeholder { color: transparent }.ace_composition_marker { border-bottom: 1px solid;position: absolute;border-radius: 0;margin-top: 1px;}[ace_nocontext=true] {transform: none!important;filter: none!important;clip-path: none!important;mask : none!important;contain: none!important;perspective: none!important;mix-blend-mode: initial!important;z-index: auto;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;height: 1000000px;contain: style size layout;}.ace_text-layer {font: inherit !important;position: absolute;height: 1000000px;width: 1000000px;contain: style size layout;}.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {contain: style size layout;position: absolute;top: 0;left: 0;right: 0;}.ace_hidpi .ace_text-layer,.ace_hidpi .ace_gutter-layer,.ace_hidpi .ace_content,.ace_hidpi .ace_gutter {contain: strict;will-change: transform;}.ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group {contain: strict;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {opacity: 0;}.ace_smooth-blinking .ace_cursor {transition: opacity 0.18s;}.ace_animate-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: step-end;animation-name: blink-ace-animate;animation-iteration-count: infinite;}.ace_animate-blinking.ace_smooth-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: ease-in-out;animation-name: blink-ace-animate-smooth;}@keyframes blink-ace-animate {from, to { opacity: 1; }60% { opacity: 0; }}@keyframes blink-ace-animate-smooth {from, to { opacity: 1; }45% { opacity: 1; }60% { opacity: 0; }85% { opacity: 0; }}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_error_bracket {position: absolute;border-bottom: 1px solid #DE5555;border-radius: 0;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;box-sizing: border-box;}.ace_line .ace_fold {box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block;   }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_inline_button {border: 1px solid lightgray;display: inline-block;margin: -1px 8px;padding: 0 5px;pointer-events: auto;cursor: pointer;}.ace_inline_button:hover {border-color: gray;background: rgba(200,200,200,0.2);display: inline-block;pointer-events: auto;}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}.ace_mobile-menu {position: absolute;line-height: 1.5;border-radius: 4px;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;background: white;box-shadow: 1px 3px 2px grey;border: 1px solid #dcdcdc;color: black;}.ace_dark > .ace_mobile-menu {background: #333;color: #ccc;box-shadow: 1px 3px 2px grey;border: 1px solid #444;}.ace_mobile-button {padding: 2px;cursor: pointer;overflow: hidden;}.ace_mobile-button:hover {background-color: #eee;opacity:1;}.ace_mobile-button:active {background-color: #ddd;}.ace_placeholder {font-family: arial;transform: scale(0.9);transform-origin: left;white-space: pre;opacity: 0.7;margin: 0 10px;}',m=e("./lib/useragent"),v=m.isIE;o.importCssString(g,"ace_editor.css",!1);var b=function(e,t){var n=this;this.container=e||o.createElement("div"),o.addCssClass(this.container,"ace_editor"),o.HI_DPI&&o.addCssClass(this.container,"ace_hidpi"),this.setTheme(t),null==r.get("useStrictCSP")&&r.set("useStrictCSP",!1),this.$gutter=o.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=o.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=o.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 i=this.$textLayer=new l(this.content);this.canvas=i.element,this.$markerFront=new a(this.content),this.$cursorLayer=new c(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new h(this.container,this),this.scrollBarH=new u(this.container,this),this.scrollBarV.on("scroll",(function(e){n.$scrollAnimation||n.session.setScrollTop(e.data-n.scrollMargin.top)})),this.scrollBarH.on("scroll",(function(e){n.$scrollAnimation||n.session.setScrollLeft(e.data-n.scrollMargin.left)})),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new p(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",(function(e){n.updateCharacterSize(),n.onResize(!0,n.gutterWidth,n.$size.width,n.$size.height),n._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.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!m.isIOS,this.$loop=new d(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),r.resetOptions(this),r._signal("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(),o.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},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.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},this.updateLines=function(e,t,n){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(!n)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.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(e){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(e,t,n,i){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=e?1:0;var o=this.container;i||(i=o.clientHeight||o.scrollHeight),n||(n=o.clientWidth||o.scrollWidth);var r=this.$updateCachedSize(e,t,n,i);if(!this.$size.scrollerHeight||!n&&!i)return this.resizing=0;e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(r|this.$changes,!0):this.$loop.schedule(r|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null}},this.$updateCachedSize=function(e,t,n,i){i-=this.$extraHeight||0;var r=0,s=this.$size,a={width:s.width,height:s.height,scrollerHeight:s.scrollerHeight,scrollerWidth:s.scrollerWidth};if(i&&(e||s.height!=i)&&(s.height=i,r|=this.CHANGE_SIZE,s.scrollerHeight=s.height,this.$horizScroll&&(s.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",r|=this.CHANGE_SCROLL),n&&(e||s.width!=n)){r|=this.CHANGE_SIZE,s.width=n,null==t&&(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,o.setStyle(this.scrollBarH.element.style,"left",t+"px"),o.setStyle(this.scroller.style,"left",t+this.margin.left+"px"),s.scrollerWidth=Math.max(0,n-t-this.scrollBarV.getWidth()-this.margin.h),o.setStyle(this.$gutter.style,"left",this.margin.left+"px");var l=this.scrollBarV.getWidth()+"px";o.setStyle(this.scrollBarH.element.style,"right",l),o.setStyle(this.scroller.style,"right",l),o.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)&&(r|=this.CHANGE_FULL)}return s.$dirty=!n||!i,r&&this._signal("resize",a),r},this.onGutterResize=function(e){var t=this.$showGutter?e:0;t!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,t,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()||this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},this.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-2*this.$padding,t=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(e){this.setOption("animatedScroll",e)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(e){this.setOption("showInvisibles",e),this.session.$bidiHandler.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(e){this.setOption("displayIndentGuides",e)},this.setShowPrintMargin=function(e){this.setOption("showPrintMargin",e)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(e){this.setOption("printMarginColumn",e)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(e){return this.setOption("showGutter",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updatePrintMargin=function(){if(this.$showPrintMargin||this.$printMarginEl){if(!this.$printMarginEl){var e=o.createElement("div");e.className="ace_layer ace_print-margin-layer",this.$printMarginEl=o.createElement("div"),this.$printMarginEl.className="ace_print-margin",e.appendChild(this.$printMarginEl),this.content.insertBefore(e,this.content.firstChild)}var t=this.$printMarginEl.style;t.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",t.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&-1==this.session.$wrap&&this.adjustWrapLimit()}},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var e=this.textarea.style,t=this.$composition;if(this.$keepTextAreaAtCursor||t){var n=this.$cursorLayer.$pixelPos;if(n){t&&t.markerRange&&(n=this.$cursorLayer.getPixelPosition(t.markerRange.start,!0));var i=this.layerConfig,r=n.top,s=n.left;r-=i.offset;var a=t&&t.useTextareaForIME?this.lineHeight:v?0:1;if(r<0||r>i.height-a)o.translate(this.textarea,0,0);else{var l=1,c=this.$size.height-a;if(t)if(t.useTextareaForIME){var u=this.textarea.value;l=this.characterWidth*this.session.$getStringScreenWidth(u)[0]}else r+=this.lineHeight+2;else r+=this.lineHeight;(s-=this.scrollLeft)>this.$size.scrollerWidth-l&&(s=this.$size.scrollerWidth-l),s+=this.gutterWidth+this.margin.left,o.setStyle(e,"height",a+"px"),o.setStyle(e,"width",l+"px"),o.translate(this.textarea,Math.min(s,this.$size.scrollerWidth-l),Math.min(r,c))}}}else o.translate(this.textarea,-100,0)}},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},this.getLastFullyVisibleRow=function(){var e=this.layerConfig,t=e.lastRow;return this.session.documentToScreenRow(t,0)*e.lineHeight-this.session.getScrollTop()>e.height-e.lineHeight?t-1:t},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(e){this.$padding=e,this.$textLayer.setPadding(e),this.$cursorLayer.setPadding(e),this.$markerFront.setPadding(e),this.$markerBack.setPadding(e),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},this.setScrollMargin=function(e,t,n,i){var o=this.scrollMargin;o.top=0|e,o.bottom=0|t,o.right=0|i,o.left=0|n,o.v=o.top+o.bottom,o.h=o.left+o.right,o.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-o.top),this.updateFull()},this.setMargin=function(e,t,n,i){var o=this.margin;o.top=0|e,o.bottom=0|t,o.right=0|i,o.left=0|n,o.v=o.top+o.bottom,o.h=o.left+o.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(e){this.setOption("hScrollBarAlwaysVisible",e)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(e){this.setOption("vScrollBarAlwaysVisible",e)},this.$updateScrollBarV=function(){var e=this.layerConfig.maxHeight,t=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>e-t&&(e=this.scrollTop+t,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(e+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(e,t){if(this.$changes&&(e|=this.$changes,this.$changes=0),this.session&&this.container.offsetWidth&&!this.$frozen&&(e||t)){if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",e),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var n=this.layerConfig;if(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL){if(e|=this.$computeLayerConfig()|this.$loop.clear(),n.firstRow!=this.layerConfig.firstRow&&n.firstRowScreen==this.layerConfig.firstRowScreen){var i=this.scrollTop+(n.firstRow-this.layerConfig.firstRow)*this.lineHeight;i>0&&(this.scrollTop=i,e|=this.CHANGE_SCROLL,e|=this.$computeLayerConfig()|this.$loop.clear())}n=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),o.translate(this.content,-this.scrollLeft,-n.offset);var r=n.width+2*this.$padding+"px",s=n.minHeight+"px";o.setStyle(this.content.style,"width",r),o.setStyle(this.content.style,"height",s)}if(e&this.CHANGE_H_SCROLL&&(o.translate(this.content,-this.scrollLeft,-n.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"),e&this.CHANGE_FULL)return this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender",e);if(e&this.CHANGE_SCROLL)return this.$changedLines=null,e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(n):this.$textLayer.scrollLines(n),this.$showGutter&&(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES?this.$gutterLayer.update(n):this.$gutterLayer.scrollLines(n)),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender",e);e&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n)):e&this.CHANGE_LINES?(this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(n):e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER?this.$showGutter&&this.$gutterLayer.update(n):e&this.CHANGE_CURSOR&&this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(n),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(n),this.$moveTextAreaToCursor()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(n),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(n),this._signal("afterRender",e)}else this.$changes|=e},this.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,n=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(n+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&n>this.$maxPixelHeight&&(n=this.$maxPixelHeight);var i=!(n<=2*this.lineHeight)&&e>t;if(n!=this.desiredHeight||this.$size.height!=this.desiredHeight||i!=this.$vScroll){i!=this.$vScroll&&(this.$vScroll=i,this.scrollBarV.setVisible(i));var o=this.container.clientWidth;this.container.style.height=n+"px",this.$updateCachedSize(!0,this.$gutterWidth,o,n),this.desiredHeight=n,this._signal("autosize")}},this.$computeLayerConfig=function(){var e=this.session,t=this.$size,n=t.height<=2*this.lineHeight,i=this.session.getScreenLength()*this.lineHeight,o=this.$getLongestLine(),r=!n&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-o-2*this.$padding<0),s=this.$horizScroll!==r;s&&(this.$horizScroll=r,this.scrollBarH.setVisible(r));var a=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var l=t.scrollerHeight+this.lineHeight,c=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;i+=c;var u=this.scrollMargin;this.session.setScrollTop(Math.max(-u.top,Math.min(this.scrollTop,i-t.scrollerHeight+u.bottom))),this.session.setScrollLeft(Math.max(-u.left,Math.min(this.scrollLeft,o+2*this.$padding-t.scrollerWidth+u.right)));var h=!n&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-i+c<0||this.scrollTop>u.top),d=a!==h;d&&(this.$vScroll=h,this.scrollBarV.setVisible(h));var p,f,g=this.scrollTop%this.lineHeight,m=Math.ceil(l/this.lineHeight)-1,v=Math.max(0,Math.round((this.scrollTop-g)/this.lineHeight)),b=v+m,w=this.lineHeight;v=e.screenToDocumentRow(v,0);var y=e.getFoldLine(v);y&&(v=y.start.row),p=e.documentToScreenRow(v,0),f=e.getRowLength(v)*w,b=Math.min(e.screenToDocumentRow(b,0),e.getLength()-1),l=t.scrollerHeight+e.getRowLength(b)*w+f,g=this.scrollTop-p*w;var x=0;return(this.layerConfig.width!=o||s)&&(x=this.CHANGE_H_SCROLL),(s||d)&&(x|=this.$updateCachedSize(!0,this.gutterWidth,t.width,t.height),this._signal("scrollbarVisibilityChanged"),d&&(o=this.$getLongestLine())),this.layerConfig={width:o,padding:this.$padding,firstRow:v,firstRowScreen:p,lastRow:b,lineHeight:w,characterWidth:this.characterWidth,minHeight:l,maxHeight:i,offset:g,gutterOffset:w?Math.max(0,Math.ceil((g+t.height-t.scrollerHeight)/w)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(o-this.$padding),x},this.$updateLines=function(){if(this.$changedLines){var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow;this.$changedLines=null;var n=this.layerConfig;if(!(e>n.lastRow+1||t<n.firstRow))return t===1/0?(this.$showGutter&&this.$gutterLayer.update(n),void this.$textLayer.update(n)):(this.$textLayer.updateLines(n,e,t),!0)}},this.$getLongestLine=function(){var e=this.session.getScreenWidth();return this.showInvisibles&&!this.session.$useWrapMode&&(e+=1),this.$textLayer&&e>this.$textLayer.MAX_LINE_LENGTH&&(e=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))},this.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},this.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},this.addGutterDecoration=function(e,t){this.$gutterLayer.addGutterDecoration(e,t)},this.removeGutterDecoration=function(e,t){this.$gutterLayer.removeGutterDecoration(e,t)},this.updateBreakpoints=function(e){this.$loop.schedule(this.CHANGE_GUTTER)},this.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e),this.$loop.schedule(this.CHANGE_GUTTER)},this.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},this.hideCursor=function(){this.$cursorLayer.hideCursor()},this.showCursor=function(){this.$cursorLayer.showCursor()},this.scrollSelectionIntoView=function(e,t,n){this.scrollCursorIntoView(e,n),this.scrollCursorIntoView(t,n)},this.scrollCursorIntoView=function(e,t,n){if(0!==this.$size.scrollerHeight){var i=this.$cursorLayer.getPixelPosition(e),o=i.left,r=i.top,s=n&&n.top||0,a=n&&n.bottom||0,l=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;l+s>r?(t&&l+s>r+this.lineHeight&&(r-=t*this.$size.scrollerHeight),0===r&&(r=-this.scrollMargin.top),this.session.setScrollTop(r)):l+this.$size.scrollerHeight-a<r+this.lineHeight&&(t&&l+this.$size.scrollerHeight-a<r-this.lineHeight&&(r+=t*this.$size.scrollerHeight),this.session.setScrollTop(r+this.lineHeight+a-this.$size.scrollerHeight));var c=this.scrollLeft;c>o?(o<this.$padding+2*this.layerConfig.characterWidth&&(o=-this.scrollMargin.left),this.session.setScrollLeft(o)):c+this.$size.scrollerWidth<o+this.characterWidth?this.session.setScrollLeft(Math.round(o+this.characterWidth-this.$size.scrollerWidth)):c<=this.$padding&&o-c<this.characterWidth&&this.session.setScrollLeft(0)}},this.getScrollTop=function(){return this.session.getScrollTop()},this.getScrollLeft=function(){return this.session.getScrollLeft()},this.getScrollTopRow=function(){return this.scrollTop/this.lineHeight},this.getScrollBottomRow=function(){return Math.max(0,Math.floor((this.scrollTop+this.$size.scrollerHeight)/this.lineHeight)-1)},this.scrollToRow=function(e){this.session.setScrollTop(e*this.lineHeight)},this.alignCursor=function(e,t){"number"==typeof e&&(e={row:e,column:0});var n=this.$cursorLayer.getPixelPosition(e),i=this.$size.scrollerHeight-this.lineHeight,o=n.top-i*(t||0);return this.session.setScrollTop(o),o},this.STEPS=8,this.$calcSteps=function(e,t){var n,i,o=0,r=this.STEPS,s=[];for(o=0;o<r;++o)s.push((n=o/this.STEPS,i=e,(t-e)*(Math.pow(n-1,3)+1)+i));return s},this.scrollToLine=function(e,t,n,i){var o=this.$cursorLayer.getPixelPosition({row:e,column:0}).top;t&&(o-=this.$size.scrollerHeight/2);var r=this.scrollTop;this.session.setScrollTop(o),!1!==n&&this.animateScrolling(r,i)},this.animateScrolling=function(e,t){var n=this.scrollTop;if(this.$animatedScroll){var i=this;if(e!=n){if(this.$scrollAnimation){var o=this.$scrollAnimation.steps;if(o.length&&(e=o[0])==n)return}var r=i.$calcSteps(e,n);this.$scrollAnimation={from:e,to:n,steps:r},clearInterval(this.$timer),i.session.setScrollTop(r.shift()),i.session.$scrollTop=n,this.$timer=setInterval((function(){if(!i.session)return clearInterval(i.$timer);r.length?(i.session.setScrollTop(r.shift()),i.session.$scrollTop=n):null!=n?(i.session.$scrollTop=-1,i.session.setScrollTop(n),n=null):(i.$timer=clearInterval(i.$timer),i.$scrollAnimation=null,t&&t())}),10)}}},this.scrollToY=function(e){this.scrollTop!==e&&(this.$loop.schedule(this.CHANGE_SCROLL),this.scrollTop=e)},this.scrollToX=function(e){this.scrollLeft!==e&&(this.scrollLeft=e),this.$loop.schedule(this.CHANGE_H_SCROLL)},this.scrollTo=function(e,t){this.session.setScrollTop(t),this.session.setScrollLeft(e)},this.scrollBy=function(e,t){t&&this.session.setScrollTop(this.session.getScrollTop()+t),e&&this.session.setScrollLeft(this.session.getScrollLeft()+e)},this.isScrollableBy=function(e,t){return t<0&&this.session.getScrollTop()>=1-this.scrollMargin.top||t>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||e>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0},this.pixelToScreenCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var i=this.$fontMetrics.transformCoordinates([e,t]);e=i[1]-this.gutterWidth-this.margin.left,t=i[0]}else n=this.scroller.getBoundingClientRect();var o=e+this.scrollLeft-n.left-this.$padding,r=o/this.characterWidth,s=Math.floor((t+this.scrollTop-n.top)/this.lineHeight),a=this.$blockCursor?Math.floor(r):Math.round(r);return{row:s,column:a,side:r-a>0?1:-1,offsetX:o}},this.screenToTextCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var i=this.$fontMetrics.transformCoordinates([e,t]);e=i[1]-this.gutterWidth-this.margin.left,t=i[0]}else n=this.scroller.getBoundingClientRect();var o=e+this.scrollLeft-n.left-this.$padding,r=o/this.characterWidth,s=this.$blockCursor?Math.floor(r):Math.round(r),a=Math.floor((t+this.scrollTop-n.top)/this.lineHeight);return this.session.screenToDocumentPosition(a,Math.max(s,0),o)},this.textToScreenCoordinates=function(e,t){var n=this.scroller.getBoundingClientRect(),i=this.session.documentToScreenPosition(e,t),o=this.$padding+(this.session.$bidiHandler.isBidiRow(i.row,e)?this.session.$bidiHandler.getPosLeft(i.column):Math.round(i.column*this.characterWidth)),r=i.row*this.lineHeight;return{pageX:n.left+o-this.scrollLeft,pageY:n.top+r-this.scrollTop}},this.visualizeFocus=function(){o.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){o.removeCssClass(this.container,"ace_focus")},this.showComposition=function(e){this.$composition=e,e.cssText||(e.cssText=this.textarea.style.cssText),null==e.useTextareaForIME&&(e.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(o.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):e.markerId=this.session.addMarker(e.markerRange,"ace_composition_marker","text")},this.setCompositionText=function(e){var t=this.session.selection.cursor;this.addToken(e,"composition_placeholder",t.row,t.column),this.$moveTextAreaToCursor()},this.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),o.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var e=this.session.selection.cursor;this.removeExtraToken(e.row,e.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},this.addToken=function(e,t,n,i){var o=this.session;o.bgTokenizer.lines[n]=null;var r={type:t,value:e},s=o.getTokens(n);if(null==i)s.push(r);else for(var a=0,l=0;l<s.length;l++){var c=s[l];if(i<=(a+=c.value.length)){var u=c.value.length-(a-i),h=c.value.slice(0,u),d=c.value.slice(u);s.splice(l,1,{type:c.type,value:h},r,{type:c.type,value:d});break}}this.updateLines(n,n)},this.removeExtraToken=function(e,t){this.updateLines(e,e)},this.setTheme=function(e,t){var n=this;if(this.$themeId=e,n._dispatchEvent("themeChange",{theme:e}),e&&"string"!=typeof e)s(e);else{var i=e||this.$options.theme.initialValue;r.loadModule(["theme",i],s)}function s(i){if(n.$themeId!=e)return t&&t();if(!i||!i.cssClass)throw new Error("couldn't load module "+e+" or it didn't call define");i.$id&&(n.$themeId=i.$id),o.importCssString(i.cssText,i.cssClass,n.container),n.theme&&o.removeCssClass(n.container,n.theme.cssClass);var r="padding"in i?i.padding:"padding"in(n.theme||{})?4:n.$padding;n.$padding&&r!=n.$padding&&n.setPadding(r),n.$theme=i.cssClass,n.theme=i,o.addCssClass(n.container,i.cssClass),o.setCssClass(n.container,"ace_dark",i.isDark),n.$size&&(n.$size.width=0,n.$updateSizeAsync()),n._dispatchEvent("themeLoaded",{theme:i}),t&&t()}},this.getTheme=function(){return this.$themeId},this.setStyle=function(e,t){o.setCssClass(this.container,e,!1!==t)},this.unsetStyle=function(e){o.removeCssClass(this.container,e)},this.setCursorStyle=function(e){o.setStyle(this.scroller.style,"cursor",e)},this.setMouseCursor=function(e){o.setStyle(this.scroller.style,"cursor",e)},this.attachToShadowRoot=function(){o.importCssString(g,"ace_editor.css",this.container)},this.destroy=function(){this.freeze(),this.$fontMetrics.destroy(),this.$cursorLayer.destroy(),this.removeAllListeners(),this.container.textContent=""}}).call(b.prototype),r.defineOptions(b.prototype,"renderer",{animatedScroll:{initialValue:!1},showInvisibles:{set:function(e){this.$textLayer.setShowInvisibles(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!1},showPrintMargin:{set:function(){this.$updatePrintMargin()},initialValue:!0},printMarginColumn:{set:function(){this.$updatePrintMargin()},initialValue:80},printMargin:{set:function(e){"number"==typeof e&&(this.$printMarginColumn=e),this.$showPrintMargin=!!e,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(e){this.$gutter.style.display=e?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},fadeFoldWidgets:{set:function(e){o.setCssClass(this.$gutter,"ace_fade-fold-widgets",e)},initialValue:!1},showFoldWidgets:{set:function(e){this.$gutterLayer.setShowFoldWidgets(e),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(e){this.$textLayer.setDisplayIndentGuides(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightGutterLine:{set:function(e){this.$gutterLayer.setHighlightGutterLine(e),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(e){this.$hScrollBarAlwaysVisible&&this.$horizScroll||this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(e){this.$vScrollBarAlwaysVisible&&this.$vScroll||this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(e){"number"==typeof e&&(e+="px"),this.container.style.fontSize=e,this.updateFontSize()},initialValue:12},fontFamily:{set:function(e){this.container.style.fontFamily=e,this.updateFontSize()}},maxLines:{set:function(e){this.updateFull()}},minLines:{set:function(e){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(e){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(e){e=+e||0,this.$scrollPastEnd!=e&&(this.$scrollPastEnd=e,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(e){this.$gutterLayer.$fixedWidth=!!e,this.$loop.schedule(this.CHANGE_GUTTER)}},theme:{set:function(e){this.setTheme(e)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!m.isMobile&&!m.isIE}}),t.VirtualRenderer=b})),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],(function(e,t,n){"use strict";var i=e("../lib/oop"),o=e("../lib/net"),r=e("../lib/event_emitter").EventEmitter,s=e("../config");function a(e){if("undefined"==typeof Worker)return{postMessage:function(){},terminate:function(){}};if(s.get("loadWorkerFromBlob")){var t=function(e){var t="importScripts('"+o.qualifyURL(e)+"');";try{return new Blob([t],{type:"application/javascript"})}catch(e){var n=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder);return n.append(t),n.getBlob("application/javascript")}}(e),n=(window.URL||window.webkitURL).createObjectURL(t);return new Worker(n)}return new Worker(e)}var l=function(e){e.postMessage||(e=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=e,this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.onMessage=this.onMessage.bind(this),this.callbackId=1,this.callbacks={},this.$worker.onmessage=this.onMessage};(function(){i.implement(this,r),this.$createWorkerFromOldConfig=function(t,n,i,o,r){if(e.nameToUrl&&!e.toUrl&&(e.toUrl=e.nameToUrl),s.get("packaged")||!e.toUrl)o=o||s.moduleUrl(n,"worker");else{var l=this.$normalizePath;o=o||l(e.toUrl("ace/worker/worker.js",null,"_"));var c={};t.forEach((function(t){c[t]=l(e.toUrl(t,null,"_").replace(/(\.js)?(\?.*)?$/,""))}))}return this.$worker=a(o),r&&this.send("importScripts",r),this.$worker.postMessage({init:!0,tlns:c,module:n,classname:i}),this.$worker},this.onMessage=function(e){var t=e.data;switch(t.type){case"event":this._signal(t.name,{data:t.data});break;case"call":var n=this.callbacks[t.id];n&&(n(t.data),delete this.callbacks[t.id]);break;case"error":this.reportError(t.data);break;case"log":window.console&&console.log&&console.log.apply(console,t.data)}},this.reportError=function(e){window.console&&console.error&&console.error(e)},this.$normalizePath=function(e){return o.qualifyURL(e)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(e,t){this.$worker.postMessage({command:e,args:t})},this.call=function(e,t,n){if(n){var i=this.callbackId++;this.callbacks[i]=n,t.push(i)}this.send(e,t)},this.emit=function(e,t){try{t.data&&t.data.err&&(t.data.err={message:t.data.err.message,stack:t.data.err.stack,code:t.data.err.code}),this.$worker.postMessage({event:e,data:{data:t.data}})}catch(e){console.error(e.stack)}},this.attachToDocument=function(e){this.$doc&&this.terminate(),this.$doc=e,this.call("setValue",[e.getValue()]),e.on("change",this.changeListener)},this.changeListener=function(e){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),"insert"==e.action?this.deltaQueue.push(e.start,e.lines):this.deltaQueue.push(e.start,e.end)},this.$sendDeltaQueue=function(){var e=this.deltaQueue;e&&(this.deltaQueue=null,e.length>50&&e.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:e}))}}).call(l.prototype),t.UIWorkerClient=function(e,t,n){var i=null,o=!1,a=Object.create(r),c=[],u=new l({messageBuffer:c,terminate:function(){},postMessage:function(e){c.push(e),i&&(o?setTimeout(h):h())}});u.setEmitSync=function(e){o=e};var h=function(){var e=c.shift();e.command?i[e.command].apply(i,e.args):e.event&&a._signal(e.event,e.data)};return a.postMessage=function(e){u.onMessage({data:e})},a.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},a.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},s.loadModule(["worker",t],(function(e){for(i=new e[n](a);c.length;)h()})),u},t.WorkerClient=l,t.createWorker=a})),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],(function(e,t,n){"use strict";var i=e("./range").Range,o=e("./lib/event_emitter").EventEmitter,r=e("./lib/oop"),s=function(e,t,n,i,o,r){var s=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=o,this.othersClass=r,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=i,this.$onCursorChange=function(){setTimeout((function(){s.onCursorChange()}))},this.$pos=n;var a=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=a.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)};(function(){r.implement(this,o),this.setup=function(){var e=this,t=this.doc,n=this.session;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var o=this.pos;o.$insertRight=!0,o.detach(),o.markerId=n.addMarker(new i(o.row,o.column,o.row,o.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach((function(n){var i=t.createAnchor(n.row,n.column);i.$insertRight=!0,i.detach(),e.others.push(i)})),n.setUndoSelect(!1)},this.showOtherMarkers=function(){if(!this.othersActive){var e=this.session,t=this;this.othersActive=!0,this.others.forEach((function(n){n.markerId=e.addMarker(new i(n.row,n.column,n.row,n.column+t.length),t.othersClass,null,!1)}))}},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e<this.others.length;e++)this.session.removeMarker(this.others[e].markerId)}},this.onUpdate=function(e){if(this.$updating)return this.updateAnchors(e);var t=e;if(t.start.row===t.end.row&&t.start.row===this.pos.row){this.$updating=!0;var n="insert"===e.action?t.end.column-t.start.column:t.start.column-t.end.column,o=t.start.column>=this.pos.column&&t.start.column<=this.pos.column+this.length+1,r=t.start.column-this.pos.column;if(this.updateAnchors(e),o&&(this.length+=n),o&&!this.session.$fromUndo)if("insert"===e.action)for(var s=this.others.length-1;s>=0;s--){var a={row:(l=this.others[s]).row,column:l.column+r};this.doc.insertMergedLines(a,e.lines)}else if("remove"===e.action)for(s=this.others.length-1;s>=0;s--){var l;a={row:(l=this.others[s]).row,column:l.column+r},this.doc.remove(new i(a.row,a.column,a.row,a.column-n))}this.$updating=!1,this.updateMarkers()}},this.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()},this.updateMarkers=function(){if(!this.$updating){var e=this,t=this.session,n=function(n,o){t.removeMarker(n.markerId),n.markerId=t.addMarker(new i(n.row,n.column,n.row,n.column+e.length),o,null,!1)};n(this.pos,this.mainClass);for(var o=this.others.length;o--;)n(this.others[o],this.othersClass)}},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.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.off("change",this.$onUpdate),this.session.selection.off("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(-1!==this.$undoStackDepth){for(var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,n=0;n<t;n++)e.undo(this.session,!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}}}).call(s.prototype),t.PlaceHolder=s})),ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],(function(e,t,n){var i=e("../lib/event"),o=e("../lib/useragent");function r(e,t){return e.row==t.row&&e.column==t.column}t.onMouseDown=function(e){var t=e.domEvent,n=t.altKey,s=t.shiftKey,a=t.ctrlKey,l=e.getAccelKey(),c=e.getButton();if(a&&o.isMac&&(c=t.button),e.editor.inMultiSelectMode&&2==c)e.editor.textInput.onContextMenu(e.domEvent);else if(a||n||l){if(0===c){var u,h=e.editor,d=h.selection,p=h.inMultiSelectMode,f=e.getDocumentPosition(),g=d.getCursor(),m=e.inSelection()||d.isEmpty()&&r(f,g),v=e.x,b=e.y,w=h.session,y=h.renderer.pixelToScreenCoordinates(v,b),x=y;if(h.$mouseHandler.$enableJumpToDef)a&&n||l&&n?u=s?"block":"add":n&&h.$blockSelectEnabled&&(u="block");else if(l&&!n){if(u="add",!p&&s)return}else n&&h.$blockSelectEnabled&&(u="block");if(u&&o.isMac&&t.ctrlKey&&h.$mouseHandler.cancelContextMenu(),"add"==u){if(!p&&m)return;if(!p){var C=d.toOrientedRange();h.addSelectionMarker(C)}var S=d.rangeList.rangeAtPoint(f);h.inVirtualSelectionMode=!0,s&&(S=null,C=d.ranges[0]||C,h.removeSelectionMarker(C)),h.once("mouseup",(function(){var e=d.toOrientedRange();S&&e.isEmpty()&&r(S.cursor,e.cursor)?d.substractPoint(e.cursor):(s?d.substractPoint(C.cursor):C&&(h.removeSelectionMarker(C),d.addRange(C)),d.addRange(e)),h.inVirtualSelectionMode=!1}))}else if("block"==u){var k;e.stop(),h.inVirtualSelectionMode=!0;var $=[],E=function(){var e=h.renderer.pixelToScreenCoordinates(v,b),t=w.screenToDocumentPosition(e.row,e.column,e.offsetX);r(x,e)&&r(t,d.lead)||(x=e,h.selection.moveToPosition(t),h.renderer.scrollCursorIntoView(),h.removeSelectionMarkers($),$=d.rectangularRangeBlock(x,y),h.$mouseHandler.$clickSelection&&1==$.length&&$[0].isEmpty()&&($[0]=h.$mouseHandler.$clickSelection.clone()),$.forEach(h.addSelectionMarker,h),h.updateSelectionMarkers())};p&&!l?d.toSingleRange():!p&&l&&(k=d.toOrientedRange(),h.addSelectionMarker(k)),s?y=w.documentToScreenPosition(d.lead):d.moveToPosition(f),x={row:-1,column:-1};var _=E;i.capture(h.container,(function(e){v=e.clientX,b=e.clientY}),(function(e){E(),clearInterval(L),h.removeSelectionMarkers($),$.length||($=[d.toOrientedRange()]),k&&(h.removeSelectionMarker(k),d.toSingleRange(k));for(var t=0;t<$.length;t++)d.addRange($[t]);h.inVirtualSelectionMode=!1,h.$mouseHandler.$clickSelection=null}));var L=setInterval((function(){_()}),20);return e.preventDefault()}}}else 0===c&&e.editor.inMultiSelectMode&&e.editor.exitMultiSelectMode()}})),ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"],(function(e,t,n){t.defaultCommands=[{name:"addCursorAbove",description:"Add cursor above",exec:function(e){e.selectMoreLines(-1)},bindKey:{win:"Ctrl-Alt-Up",mac:"Ctrl-Alt-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelow",description:"Add cursor below",exec:function(e){e.selectMoreLines(1)},bindKey:{win:"Ctrl-Alt-Down",mac:"Ctrl-Alt-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorAboveSkipCurrent",description:"Add cursor above (skip current)",exec:function(e){e.selectMoreLines(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Up",mac:"Ctrl-Alt-Shift-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelowSkipCurrent",description:"Add cursor below (skip current)",exec:function(e){e.selectMoreLines(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Down",mac:"Ctrl-Alt-Shift-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreBefore",description:"Select more before",exec:function(e){e.selectMore(-1)},bindKey:{win:"Ctrl-Alt-Left",mac:"Ctrl-Alt-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreAfter",description:"Select more after",exec:function(e){e.selectMore(1)},bindKey:{win:"Ctrl-Alt-Right",mac:"Ctrl-Alt-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextBefore",description:"Select next before",exec:function(e){e.selectMore(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Left",mac:"Ctrl-Alt-Shift-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextAfter",description:"Select next after",exec:function(e){e.selectMore(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Right",mac:"Ctrl-Alt-Shift-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"toggleSplitSelectionIntoLines",description:"Split into lines",exec:function(e){e.multiSelect.rangeCount>1?e.multiSelect.joinSelections():e.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(e){e.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(e){e.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(e){e.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],t.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(e){e.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(e){return e&&e.inMultiSelectMode}}];var i=e("../keyboard/hash_handler").HashHandler;t.keyboardHandler=new i(t.multiSelectCommands)})),ace.define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"],(function(e,t,n){var i=e("./range_list").RangeList,o=e("./range").Range,r=e("./selection").Selection,s=e("./mouse/multi_select_handler").onMouseDown,a=e("./lib/event"),l=e("./lib/lang"),c=e("./commands/multi_select_commands");t.commands=c.defaultCommands.concat(c.multiSelectCommands);var u=new(0,e("./search").Search),h=e("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(h.prototype),function(){this.ranges=null,this.rangeList=null,this.addRange=function(e,t){if(e){if(!this.inMultiSelectMode&&0===this.rangeCount){var n=this.toOrientedRange();if(this.rangeList.add(n),this.rangeList.add(e),2!=this.rangeList.ranges.length)return this.rangeList.removeAll(),t||this.fromOrientedRange(e);this.rangeList.removeAll(),this.rangeList.add(n),this.$onAddRange(n)}e.cursor||(e.cursor=e.end);var i=this.rangeList.add(e);return this.$onAddRange(e),i.length&&this.$onRemoveRange(i),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),t||this.fromOrientedRange(e)}},this.toSingleRange=function(e){e=e||this.ranges[0];var t=this.rangeList.removeAll();t.length&&this.$onRemoveRange(t),e&&this.fromOrientedRange(e)},this.substractPoint=function(e){var t=this.rangeList.substractPoint(e);if(t)return this.$onRemoveRange(t),t[0]},this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();e.length&&this.$onRemoveRange(e)},this.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(e),this._signal("addRange",{range:e})},this.$onRemoveRange=function(e){if(this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t),this.rangeCount=0}for(var n=e.length;n--;){var i=this.ranges.indexOf(e[n]);this.ranges.splice(i,1)}this._signal("removeRange",{ranges:e}),0===this.rangeCount&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),(t=t||this.ranges[0])&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new i,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var e=this.ranges.length?this.ranges:[this.getRange()],t=[],n=0;n<e.length;n++){var i=e[n],r=i.start.row,s=i.end.row;if(r===s)t.push(i.clone());else{for(t.push(new o(r,i.start.column,r,this.session.getLine(r).length));++r<s;)t.push(this.getLineRange(r,!0));t.push(new o(s,0,s,i.end.column))}0!=n||this.isBackwards()||(t=t.reverse())}for(this.toSingleRange(),n=t.length;n--;)this.addRange(t[n])},this.joinSelections=function(){var e=this.rangeList.ranges,t=e[e.length-1],n=o.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)},this.toggleBlockSelection=function(){if(this.rangeCount>1){var e=this.rangeList.ranges,t=e[e.length-1],n=o.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{var i=this.session.documentToScreenPosition(this.cursor),r=this.session.documentToScreenPosition(this.anchor);this.rectangularRangeBlock(i,r).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,n){var i=[],r=e.column<t.column;if(r)var s=e.column,a=t.column,l=e.offsetX,c=t.offsetX;else s=t.column,a=e.column,l=t.offsetX,c=e.offsetX;var u,h,d,p=e.row<t.row;if(p)var f=e.row,g=t.row;else f=t.row,g=e.row;s<0&&(s=0),f<0&&(f=0),f==g&&(n=!0);for(var m=f;m<=g;m++){var v=o.fromPoints(this.session.screenToDocumentPosition(m,s,l),this.session.screenToDocumentPosition(m,a,c));if(v.isEmpty()){if(u&&(d=u,(h=v.end).row==d.row&&h.column==d.column))break;u=v.end}v.cursor=r?v.start:v.end,i.push(v)}if(p&&i.reverse(),!n){for(var b=i.length-1;i[b].isEmpty()&&b>0;)b--;if(b>0)for(var w=0;i[w].isEmpty();)w++;for(var y=b;y>=w;y--)i[y].isEmpty()&&i.splice(y,1)}return i}}.call(r.prototype);var d=e("./editor").Editor;function p(e){e.$multiselectOnSessionChange||(e.$onAddRange=e.$onAddRange.bind(e),e.$onRemoveRange=e.$onRemoveRange.bind(e),e.$onMultiSelect=e.$onMultiSelect.bind(e),e.$onSingleSelect=e.$onSingleSelect.bind(e),e.$multiselectOnSessionChange=t.onSessionChange.bind(e),e.$checkMultiselectChange=e.$checkMultiselectChange.bind(e),e.$multiselectOnSessionChange(e),e.on("changeSession",e.$multiselectOnSessionChange),e.on("mousedown",s),e.commands.addCommands(c.defaultCommands),function(e){if(e.textInput){var t=e.textInput.getElement(),n=!1;a.addListener(t,"keydown",(function(t){var o=18==t.keyCode&&!(t.ctrlKey||t.shiftKey||t.metaKey);e.$blockSelectEnabled&&o?n||(e.renderer.setMouseCursor("crosshair"),n=!0):n&&i()}),e),a.addListener(t,"keyup",i,e),a.addListener(t,"blur",i,e)}function i(t){n&&(e.renderer.setMouseCursor(""),n=!1)}}(e))}(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(e){e.cursor||(e.cursor=e.end);var t=this.getSelectionStyle();return e.marker=this.session.addMarker(e,"ace_selection",t),this.session.$selectionMarkers.push(e),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,e},this.removeSelectionMarker=function(e){if(e.marker){this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);-1!=t&&this.session.$selectionMarkers.splice(t,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(e){for(var t=this.session.$selectionMarkers,n=e.length;n--;){var i=e[n];if(i.marker){this.session.removeMarker(i.marker);var o=t.indexOf(i);-1!=o&&t.splice(o,1)}}this.session.selectionMarkerCount=t.length},this.$onAddRange=function(e){this.addSelectionMarker(e.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(e){this.removeSelectionMarkers(e.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(e){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(c.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(e){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(c.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(e){var t=e.command,n=e.editor;if(n.multiSelect){if(t.multiSelectAction)"forEach"==t.multiSelectAction?i=n.forEachSelection(t,e.args):"forEachLine"==t.multiSelectAction?i=n.forEachSelection(t,e.args,!0):"single"==t.multiSelectAction?(n.exitMultiSelectMode(),i=t.exec(n,e.args||{})):i=t.multiSelectAction(n,e.args||{});else{var i=t.exec(n,e.args||{});n.multiSelect.addRange(n.multiSelect.toOrientedRange()),n.multiSelect.mergeOverlappingRanges()}return i}},this.forEachSelection=function(e,t,n){if(!this.inVirtualSelectionMode){var i,o=n&&n.keepOrder,s=1==n||n&&n.$byLines,a=this.session,l=this.selection,c=l.rangeList,u=(o?l:c).ranges;if(!u.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var h=l._eventRegistry;l._eventRegistry={};var d=new r(a);this.inVirtualSelectionMode=!0;for(var p=u.length;p--;){if(s)for(;p>0&&u[p].start.row==u[p-1].end.row;)p--;d.fromOrientedRange(u[p]),d.index=p,this.selection=a.selection=d;var f=e.exec?e.exec(this,t||{}):e(this,t||{});i||void 0===f||(i=f),d.toOrientedRange(u[p])}d.detach(),this.selection=a.selection=l,this.inVirtualSelectionMode=!1,l._eventRegistry=h,l.mergeOverlappingRanges(),l.ranges[0]&&l.fromOrientedRange(l.ranges[0]);var g=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),g&&g.from==g.to&&this.renderer.animateScrolling(g.from),i}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var t=this.multiSelect.rangeList.ranges,n=[],i=0;i<t.length;i++)n.push(this.session.getTextRange(t[i]));var o=this.session.getDocument().getNewLineCharacter();(e=n.join(o)).length==(n.length-1)*o.length&&(e="")}else this.selection.isEmpty()||(e=this.session.getTextRange(this.getSelectionRange()));return e},this.$checkMultiselectChange=function(e,t){if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var n=this.multiSelect.ranges[0];if(this.multiSelect.isEmpty()&&t==this.multiSelect.anchor)return;var i=t==this.multiSelect.anchor?n.cursor==n.start?n.end:n.start:n.cursor;i.row!=t.row||this.session.$clipPositionToDocument(i.row,i.column).column!=t.column?this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()):this.multiSelect.mergeOverlappingRanges()}},this.findAll=function(e,t,n){if((t=t||{}).needle=e||t.needle,null==t.needle){var i=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange();t.needle=this.session.getTextRange(i)}this.$search.set(t);var o=this.$search.findAll(this.session);if(!o.length)return 0;var r=this.multiSelect;n||r.toSingleRange(o[0]);for(var s=o.length;s--;)r.addRange(o[s],!0);return i&&r.rangeList.rangeAtPoint(i.start)&&r.addRange(i,!0),o.length},this.selectMoreLines=function(e,t){var n=this.selection.toOrientedRange(),i=n.cursor==n.end,r=this.session.documentToScreenPosition(n.cursor);this.selection.$desiredColumn&&(r.column=this.selection.$desiredColumn);var s,a=this.session.screenToDocumentPosition(r.row+e,r.column);if(n.isEmpty())c=a;else var l=this.session.documentToScreenPosition(i?n.end:n.start),c=this.session.screenToDocumentPosition(l.row+e,l.column);if(i?(s=o.fromPoints(a,c)).cursor=s.start:(s=o.fromPoints(c,a)).cursor=s.end,s.desiredColumn=r.column,this.selection.inMultiSelectMode){if(t)var u=n.cursor}else this.selection.addRange(n);this.selection.addRange(s),u&&this.selection.substractPoint(u)},this.transposeSelections=function(e){for(var t=this.session,n=t.multiSelect,i=n.ranges,o=i.length;o--;)if((a=i[o]).isEmpty()){var r=t.getWordRange(a.start.row,a.start.column);a.start.row=r.start.row,a.start.column=r.start.column,a.end.row=r.end.row,a.end.column=r.end.column}n.mergeOverlappingRanges();var s=[];for(o=i.length;o--;){var a=i[o];s.unshift(t.getTextRange(a))}for(e<0?s.unshift(s.pop()):s.push(s.shift()),o=i.length;o--;)r=(a=i[o]).clone(),t.replace(a,s[o]),a.start.row=r.start.row,a.start.column=r.start.column;n.fromOrientedRange(n.ranges[0])},this.selectMore=function(e,t,n){var i=this.session,o=i.multiSelect.toOrientedRange();if(!o.isEmpty()||((o=i.getWordRange(o.start.row,o.start.column)).cursor=-1==e?o.start:o.end,this.multiSelect.addRange(o),!n)){var r=i.getTextRange(o),s=function(e,t,n){return u.$options.wrap=!0,u.$options.needle=t,u.$options.backwards=-1==n,u.find(e)}(i,r,e);s&&(s.cursor=-1==e?s.start:s.end,this.session.unfold(s),this.multiSelect.addRange(s),this.renderer.scrollCursorIntoView(null,.5)),t&&this.multiSelect.substractPoint(o.cursor)}},this.alignCursors=function(){var e=this.session,t=e.multiSelect,n=t.ranges,i=-1,r=n.filter((function(e){if(e.cursor.row==i)return!0;i=e.cursor.row}));if(n.length&&r.length!=n.length-1){r.forEach((function(e){t.substractPoint(e.cursor)}));var s=0,a=1/0,c=n.map((function(t){var n=t.cursor,i=e.getLine(n.row).substr(n.column).search(/\S/g);return-1==i&&(i=0),n.column>s&&(s=n.column),i<a&&(a=i),i}));n.forEach((function(t,n){var i=t.cursor,r=s-i.column,u=c[n]-a;r>u?e.insert(i,l.stringRepeat(" ",r-u)):e.remove(new o(i.row,i.column,i.row,i.column-r+u)),t.start.column=t.end.column=s,t.start.row=t.end.row=i.row,t.cursor=t.end})),t.fromOrientedRange(n[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var u=this.selection.getRange(),h=u.start.row,d=u.end.row,p=h==d;if(p){var f,g=this.session.getLength();do{f=this.session.getLine(d)}while(/[=:]/.test(f)&&++d<g);do{f=this.session.getLine(h)}while(/[=:]/.test(f)&&--h>0);h<0&&(h=0),d>=g&&(d=g-1)}var m=this.session.removeFullLines(h,d);m=this.$reAlignText(m,p),this.session.insert({row:h,column:0},m.join("\n")+"\n"),p||(u.start.column=0,u.end.column=m[m.length-1].length),this.selection.setRange(u)}},this.$reAlignText=function(e,t){var n,i,o,r=!0,s=!0;return e.map((function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?null==n?(n=t[1].length,i=t[2].length,o=t[3].length,t):(n+i+o!=t[1].length+t[2].length+t[3].length&&(s=!1),n!=t[1].length&&(r=!1),n>t[1].length&&(n=t[1].length),i<t[2].length&&(i=t[2].length),o>t[3].length&&(o=t[3].length),t):[e]})).map(t?c:r?s?function(e){return e[2]?a(n+i-e[2].length)+e[2]+a(o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}:c:function(e){return e[2]?a(n)+e[2]+a(o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]});function a(e){return l.stringRepeat(" ",e)}function c(e){return e[2]?a(n)+e[2]+a(i-e[2].length+o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}}}).call(d.prototype),t.onSessionChange=function(e){var t=e.session;t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect;var n=e.oldSession;n&&(n.multiSelect.off("addRange",this.$onAddRange),n.multiSelect.off("removeRange",this.$onRemoveRange),n.multiSelect.off("multiSelect",this.$onMultiSelect),n.multiSelect.off("singleSelect",this.$onSingleSelect),n.multiSelect.lead.off("change",this.$checkMultiselectChange),n.multiSelect.anchor.off("change",this.$checkMultiselectChange)),t&&(t.multiSelect.on("addRange",this.$onAddRange),t.multiSelect.on("removeRange",this.$onRemoveRange),t.multiSelect.on("multiSelect",this.$onMultiSelect),t.multiSelect.on("singleSelect",this.$onSingleSelect),t.multiSelect.lead.on("change",this.$checkMultiselectChange),t.multiSelect.anchor.on("change",this.$checkMultiselectChange)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},t.MultiSelect=p,e("./config").defineOptions(d.prototype,"editor",{enableMultiselect:{set:function(e){p(this),e?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",s)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",s))},value:!0},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:!0}})})),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],(function(e,t,n){"use strict";var i=e("../../range").Range,o=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,n){var i=e.getLine(n);return this.foldingStartMarker.test(i)?"start":"markbeginend"==t&&this.foldingStopMarker&&this.foldingStopMarker.test(i)?"end":""},this.getFoldWidgetRange=function(e,t,n){return null},this.indentationBlock=function(e,t,n){var o=/\S/,r=e.getLine(t),s=r.search(o);if(-1!=s){for(var a=n||r.length,l=e.getLength(),c=t,u=t;++t<l;){var h=e.getLine(t).search(o);if(-1!=h){if(h<=s){var d=e.getTokenAt(t,0);if(!d||"string"!==d.type)break}u=t}}if(u>c){var p=e.getLine(u).length;return new i(c,a,u,p)}}},this.openingBracketBlock=function(e,t,n,o,r){var s={row:n,column:o+1},a=e.$findClosingBracket(t,s,r);if(a){var l=e.foldWidgets[a.row];return null==l&&(l=e.getFoldWidget(a.row)),"start"==l&&a.row>s.row&&(a.row--,a.column=e.getLine(a.row).length),i.fromPoints(s,a)}},this.closingBracketBlock=function(e,t,n,o,r){var s={row:n,column:o},a=e.$findOpeningBracket(t,s);if(a)return a.column++,s.column--,i.fromPoints(a,s)}}).call(o.prototype)})),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],(function(e,t,n){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.$id="ace/theme/textmate",e("../lib/dom").importCssString(t.cssText,t.cssClass,!1)})),ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],(function(e,t,n){"use strict";var i=e("./lib/dom");function o(e){this.session=e,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}(function(){this.getRowLength=function(e){var t;return t=this.lineWidgets&&this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0,this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.$getWidgetScreenLength=function(){var e=0;return this.lineWidgets.forEach((function(t){t&&t.rowCount&&!t.hidden&&(e+=t.rowCount)})),e},this.$onChangeEditor=function(e){this.attach(e.editor)},this.attach=function(e){e&&e.widgetManager&&e.widgetManager!=this&&e.widgetManager.detach(),this.editor!=e&&(this.detach(),this.editor=e,e&&(e.widgetManager=this,e.renderer.on("beforeRender",this.measureWidgets),e.renderer.on("afterRender",this.renderWidgets)))},this.detach=function(e){var t=this.editor;if(t){this.editor=null,t.widgetManager=null,t.renderer.off("beforeRender",this.measureWidgets),t.renderer.off("afterRender",this.renderWidgets);var n=this.session.lineWidgets;n&&n.forEach((function(e){e&&e.el&&e.el.parentNode&&(e._inDocument=!1,e.el.parentNode.removeChild(e.el))}))}},this.updateOnFold=function(e,t){var n=t.lineWidgets;if(n&&e.action){for(var i=e.data,o=i.start.row,r=i.end.row,s="add"==e.action,a=o+1;a<r;a++)n[a]&&(n[a].hidden=s);n[r]&&(s?n[o]?n[r].hidden=s:n[o]=n[r]:(n[o]==n[r]&&(n[o]=void 0),n[r].hidden=s))}},this.updateOnChange=function(e){var t=this.session.lineWidgets;if(t){var n=e.start.row,i=e.end.row-n;if(0===i);else if("remove"==e.action){var o=t.splice(n+1,i);!t[n]&&o[o.length-1]&&(t[n]=o.pop()),o.forEach((function(e){e&&this.removeLineWidget(e)}),this),this.$updateRows()}else{var r=new Array(i);t[n]&&null!=t[n].column&&e.start.column>t[n].column&&n++,r.unshift(n,0),t.splice.apply(t,r),this.$updateRows()}}},this.$updateRows=function(){var e=this.session.lineWidgets;if(e){var t=!0;e.forEach((function(e,n){if(e)for(t=!1,e.row=n;e.$oldWidget;)e.$oldWidget.row=n,e=e.$oldWidget})),t&&(this.session.lineWidgets=null)}},this.$registerLineWidget=function(e){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var t=this.session.lineWidgets[e.row];return t&&(e.$oldWidget=t,t.el&&t.el.parentNode&&(t.el.parentNode.removeChild(t.el),t._inDocument=!1)),this.session.lineWidgets[e.row]=e,e},this.addLineWidget=function(e){if(this.$registerLineWidget(e),e.session=this.session,!this.editor)return e;var t=this.editor.renderer;e.html&&!e.el&&(e.el=i.createElement("div"),e.el.innerHTML=e.html),e.el&&(i.addCssClass(e.el,"ace_lineWidgetContainer"),e.el.style.position="absolute",e.el.style.zIndex=5,t.container.appendChild(e.el),e._inDocument=!0,e.coverGutter||(e.el.style.zIndex=3),null==e.pixelHeight&&(e.pixelHeight=e.el.offsetHeight)),null==e.rowCount&&(e.rowCount=e.pixelHeight/t.layerConfig.lineHeight);var n=this.session.getFoldAt(e.row,0);if(e.$fold=n,n){var o=this.session.lineWidgets;e.row!=n.end.row||o[n.start.row]?e.hidden=!0:o[n.start.row]=e}return this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows(),this.renderWidgets(null,t),this.onWidgetChanged(e),e},this.removeLineWidget=function(e){if(e._inDocument=!1,e.session=null,e.el&&e.el.parentNode&&e.el.parentNode.removeChild(e.el),e.editor&&e.editor.destroy)try{e.editor.destroy()}catch(e){}if(this.session.lineWidgets){var t=this.session.lineWidgets[e.row];if(t==e)this.session.lineWidgets[e.row]=e.$oldWidget,e.$oldWidget&&this.onWidgetChanged(e.$oldWidget);else for(;t;){if(t.$oldWidget==e){t.$oldWidget=e.$oldWidget;break}t=t.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows()},this.getWidgetsAtRow=function(e){for(var t=this.session.lineWidgets,n=t&&t[e],i=[];n;)i.push(n),n=n.$oldWidget;return i},this.onWidgetChanged=function(e){this.session._changedWidgets.push(e),this.editor&&this.editor.renderer.updateFull()},this.measureWidgets=function(e,t){var n=this.session._changedWidgets,i=t.layerConfig;if(n&&n.length){for(var o=1/0,r=0;r<n.length;r++){var s=n[r];if(s&&s.el&&s.session==this.session){if(!s._inDocument){if(this.session.lineWidgets[s.row]!=s)continue;s._inDocument=!0,t.container.appendChild(s.el)}s.h=s.el.offsetHeight,s.fixedWidth||(s.w=s.el.offsetWidth,s.screenWidth=Math.ceil(s.w/i.characterWidth));var a=s.h/i.lineHeight;s.coverLine&&(a-=this.session.getRowLineCount(s.row))<0&&(a=0),s.rowCount!=a&&(s.rowCount=a,s.row<o&&(o=s.row))}}o!=1/0&&(this.session._emit("changeFold",{data:{start:{row:o}}}),this.session.lineWidgetWidth=null),this.session._changedWidgets=[]}},this.renderWidgets=function(e,t){var n=t.layerConfig,i=this.session.lineWidgets;if(i){for(var o=Math.min(this.firstRow,n.firstRow),r=Math.max(this.lastRow,n.lastRow,i.length);o>0&&!i[o];)o--;this.firstRow=n.firstRow,this.lastRow=n.lastRow,t.$cursorLayer.config=n;for(var s=o;s<=r;s++){var a=i[s];if(a&&a.el)if(a.hidden)a.el.style.top=-100-(a.pixelHeight||0)+"px";else{a._inDocument||(a._inDocument=!0,t.container.appendChild(a.el));var l=t.$cursorLayer.getPixelPosition({row:s,column:0},!0).top;a.coverLine||(l+=n.lineHeight*this.session.getRowLineCount(a.row)),a.el.style.top=l-n.offset+"px";var c=a.coverGutter?0:t.gutterWidth;a.fixedWidth||(c-=t.scrollLeft),a.el.style.left=c+"px",a.fullWidth&&a.screenWidth&&(a.el.style.minWidth=n.width+2*n.padding+"px"),a.fixedWidth?a.el.style.right=t.scrollBar.getWidth()+"px":a.el.style.right=""}}}}}).call(o.prototype),t.LineWidgets=o})),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],(function(e,t,n){"use strict";var i=e("../line_widgets").LineWidgets,o=e("../lib/dom"),r=e("../range").Range;t.showErrorMarker=function(e,t){var n=e.session;n.widgetManager||(n.widgetManager=new i(n),n.widgetManager.attach(e));var s=e.getCursorPosition(),a=s.row,l=n.widgetManager.getWidgetsAtRow(a).filter((function(e){return"errorMarker"==e.type}))[0];l?l.destroy():a-=t;var c,u=function(e,t,n){var i=e.getAnnotations().sort(r.comparePoints);if(i.length){var o=function(e,t,n){for(var i=0,o=e.length-1;i<=o;){var r=i+o>>1,s=n(t,e[r]);if(s>0)i=r+1;else{if(!(s<0))return r;o=r-1}}return-(i+1)}(i,{row:t,column:-1},r.comparePoints);o<0&&(o=-o-1),o>=i.length?o=n>0?0:i.length-1:0===o&&n<0&&(o=i.length-1);var s=i[o];if(s&&n){if(s.row===t){do{s=i[o+=n]}while(s&&s.row===t);if(!s)return i.slice()}var a=[];t=s.row;do{a[n<0?"unshift":"push"](s),s=i[o+=n]}while(s&&s.row==t);return a.length&&a}}}(n,a,t);if(u){var h=u[0];s.column=(h.pos&&"number"!=typeof h.column?h.pos.sc:h.column)||0,s.row=h.row,c=e.renderer.$gutterLayer.$annotations[s.row]}else{if(l)return;c={text:["Looks good!"],className:"ace_ok"}}e.session.unfold(s.row),e.selection.moveToPosition(s);var d={row:s.row,fixedWidth:!0,coverGutter:!0,el:o.createElement("div"),type:"errorMarker"},p=d.el.appendChild(o.createElement("div")),f=d.el.appendChild(o.createElement("div"));f.className="error_widget_arrow "+c.className;var g=e.renderer.$cursorLayer.getPixelPosition(s).left;f.style.left=g+e.renderer.gutterWidth-5+"px",d.el.className="error_widget_wrapper",p.className="error_widget "+c.className,p.innerHTML=c.text.join("<br>"),p.appendChild(o.createElement("div"));var m=function(e,t,n){if(0===t&&("esc"===n||"return"===n))return d.destroy(),{command:"null"}};d.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(m),n.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})},o.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;    }","error_marker.css",!1)})),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/range","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,i){"use strict";e("./lib/fixoldbrowsers");var o=e("./lib/dom"),r=e("./lib/event"),s=e("./range").Range,a=e("./editor").Editor,l=e("./edit_session").EditSession,c=e("./undomanager").UndoManager,u=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.require=e,t.define=n.amdD,t.edit=function(e,n){if("string"==typeof e){var i=e;if(!(e=document.getElementById(i)))throw new Error("ace.edit can't find div #"+i)}if(e&&e.env&&e.env.editor instanceof a)return e.env.editor;var s="";if(e&&/input|textarea/i.test(e.tagName)){var l=e;s=l.value,e=o.createElement("pre"),l.parentNode.replaceChild(e,l)}else e&&(s=e.textContent,e.innerHTML="");var c=t.createEditSession(s),h=new a(new u(e),c,n),d={document:c,editor:h,onResize:h.resize.bind(h,null)};return l&&(d.textarea=l),r.addListener(window,"resize",d.onResize),h.on("destroy",(function(){r.removeListener(window,"resize",d.onResize),d.editor.container.env=null})),h.container.env=h.env=d,h},t.createEditSession=function(e,t){var n=new l(e,t);return n.setUndoManager(new c),n},t.Range=s,t.Editor=a,t.EditSession=l,t.UndoManager=c,t.VirtualRenderer=u,t.version=t.config.version})),ace.require(["ace/ace"],(function(t){for(var n in t&&(t.config.init(!0),t.define=ace.define),window.ace||(window.ace=t),t)t.hasOwnProperty(n)&&(window.ace[n]=t[n]);window.ace.default=window.ace,e&&(e.exports=window.ace)}))},5900:function(e,t,n){e=n.nmd(e),ace.define("ace/snippets",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/range_list","ace/keyboard/hash_handler","ace/tokenizer","ace/clipboard","ace/editor"],(function(e,t,n){"use strict";var i=e("./lib/dom"),o=e("./lib/oop"),r=e("./lib/event_emitter").EventEmitter,s=e("./lib/lang"),a=e("./range").Range,l=e("./range_list").RangeList,c=e("./keyboard/hash_handler").HashHandler,u=e("./tokenizer").Tokenizer,h=e("./clipboard"),d={CURRENT_WORD:function(e){return e.session.getTextRange(e.session.getWordRange())},SELECTION:function(e,t,n){var i=e.session.getTextRange();return n?i.replace(/\n\r?([ \t]*\S)/g,"\n"+n+"$1"):i},CURRENT_LINE:function(e){return e.session.getLine(e.getCursorPosition().row)},PREV_LINE:function(e){return e.session.getLine(e.getCursorPosition().row-1)},LINE_INDEX:function(e){return e.getCursorPosition().row},LINE_NUMBER:function(e){return e.getCursorPosition().row+1},SOFT_TABS:function(e){return e.session.getUseSoftTabs()?"YES":"NO"},TAB_SIZE:function(e){return e.session.getTabSize()},CLIPBOARD:function(e){return h.getText&&h.getText()},FILENAME:function(e){return/[^/\\]*$/.exec(this.FILEPATH(e))[0]},FILENAME_BASE:function(e){return/[^/\\]*$/.exec(this.FILEPATH(e))[0].replace(/\.[^.]*$/,"")},DIRECTORY:function(e){return this.FILEPATH(e).replace(/[^/\\]*$/,"")},FILEPATH:function(e){return"/not implemented.txt"},WORKSPACE_NAME:function(){return"Unknown"},FULLNAME:function(){return"Unknown"},BLOCK_COMMENT_START:function(e){var t=e.session.$mode||{};return t.blockComment&&t.blockComment.start||""},BLOCK_COMMENT_END:function(e){var t=e.session.$mode||{};return t.blockComment&&t.blockComment.end||""},LINE_COMMENT:function(e){return(e.session.$mode||{}).lineCommentStart||""},CURRENT_YEAR:p.bind(null,{year:"numeric"}),CURRENT_YEAR_SHORT:p.bind(null,{year:"2-digit"}),CURRENT_MONTH:p.bind(null,{month:"numeric"}),CURRENT_MONTH_NAME:p.bind(null,{month:"long"}),CURRENT_MONTH_NAME_SHORT:p.bind(null,{month:"short"}),CURRENT_DATE:p.bind(null,{day:"2-digit"}),CURRENT_DAY_NAME:p.bind(null,{weekday:"long"}),CURRENT_DAY_NAME_SHORT:p.bind(null,{weekday:"short"}),CURRENT_HOUR:p.bind(null,{hour:"2-digit",hour12:!1}),CURRENT_MINUTE:p.bind(null,{minute:"2-digit"}),CURRENT_SECOND:p.bind(null,{second:"2-digit"})};function p(e){var t=(new Date).toLocaleString("en-us",e);return 1==t.length?"0"+t:t}d.SELECTED_TEXT=d.SELECTION;var f=function(){this.snippetMap={},this.snippetNameMap={}};(function(){o.implement(this,r),this.getTokenizer=function(){return f.$tokenizer||this.createTokenizer()},this.createTokenizer=function(){function e(e){return e=e.substr(1),/^\d+$/.test(e)?[{tabstopId:parseInt(e,10)}]:[{text:e}]}function t(e){return"(?:[^\\\\"+e+"]|\\\\.)"}var n={regex:"/("+t("/")+"+)/",onMatch:function(e,t,n){var i=n[0];return i.fmtString=!0,i.guard=e.slice(1,-1),i.flag="",""},next:"formatString"};return f.$tokenizer=new u({start:[{regex:/\\./,onMatch:function(e,t,n){var i=e[1];return("}"==i&&n.length||-1!="`$\\".indexOf(i))&&(e=i),[e]}},{regex:/}/,onMatch:function(e,t,n){return[n.length?n.shift():e]}},{regex:/\$(?:\d+|\w+)/,onMatch:e},{regex:/\$\{[\dA-Z_a-z]+/,onMatch:function(t,n,i){var o=e(t.substr(1));return i.unshift(o[0]),o},next:"snippetVar"},{regex:/\n/,token:"newline",merge:!1}],snippetVar:[{regex:"\\|"+t("\\|")+"*\\|",onMatch:function(e,t,n){var i=e.slice(1,-1).replace(/\\[,|\\]|,/g,(function(e){return 2==e.length?e[1]:"\0"})).split("\0").map((function(e){return{value:e}}));return n[0].choices=i,[i[0]]},next:"start"},n,{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"start"}],formatString:[{regex:/:/,onMatch:function(e,t,n){return n.length&&n[0].expectElse?(n[0].expectElse=!1,n[0].ifEnd={elseEnd:n[0]},[n[0].ifEnd]):":"}},{regex:/\\./,onMatch:function(e,t,n){var i=e[1];return"}"==i&&n.length||-1!="`$\\".indexOf(i)?e=i:"n"==i?e="\n":"t"==i?e="\t":-1!="ulULE".indexOf(i)&&(e={changeCase:i,local:i>"a"}),[e]}},{regex:"/\\w*}",onMatch:function(e,t,n){var i=n.shift();return i&&(i.flag=e.slice(1,-1)),this.next=i&&i.tabstopId?"start":"",[i||e]},next:"start"},{regex:/\$(?:\d+|\w+)/,onMatch:function(e,t,n){return[{text:e.slice(1)}]}},{regex:/\${\w+/,onMatch:function(e,t,n){var i={text:e.slice(2)};return n.unshift(i),[i]},next:"formatStringVar"},{regex:/\n/,token:"newline",merge:!1},{regex:/}/,onMatch:function(e,t,n){var i=n.shift();return this.next=i&&i.tabstopId?"start":"",[i||e]},next:"start"}],formatStringVar:[{regex:/:\/\w+}/,onMatch:function(e,t,n){return n[0].formatFunction=e.slice(2,-1),[n.shift()]},next:"formatString"},n,{regex:/:[\?\-+]?/,onMatch:function(e,t,n){"+"==e[1]&&(n[0].ifEnd=n[0]),"?"==e[1]&&(n[0].expectElse=!0)},next:"formatString"},{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"formatString"}]})},this.tokenizeTmSnippet=function(e,t){return this.getTokenizer().getLineTokens(e,t).tokens.map((function(e){return e.value||e}))},this.getVariableValue=function(e,t,n){if(/^\d+$/.test(t))return(this.variables.__||{})[t]||"";if(/^[A-Z]\d+$/.test(t))return(this.variables[t[0]+"__"]||{})[t.substr(1)]||"";if(t=t.replace(/^TM_/,""),!this.variables.hasOwnProperty(t))return"";var i=this.variables[t];return"function"==typeof i&&(i=this.variables[t](e,t,n)),null==i?"":i},this.variables=d,this.tmStrFormat=function(e,t,n){if(!t.fmt)return e;var i=t.flag||"",o=t.guard;o=new RegExp(o,i.replace(/[^gim]/g,""));var r="string"==typeof t.fmt?this.tokenizeTmSnippet(t.fmt,"formatString"):t.fmt,s=this,a=e.replace(o,(function(){var e=s.variables.__;s.variables.__=[].slice.call(arguments);for(var t=s.resolveVariables(r,n),i="E",o=0;o<t.length;o++){var a=t[o];if("object"==typeof a)if(t[o]="",a.changeCase&&a.local){var l=t[o+1];l&&"string"==typeof l&&("u"==a.changeCase?t[o]=l[0].toUpperCase():t[o]=l[0].toLowerCase(),t[o+1]=l.substr(1))}else a.changeCase&&(i=a.changeCase);else"U"==i?t[o]=a.toUpperCase():"L"==i&&(t[o]=a.toLowerCase())}return s.variables.__=e,t.join("")}));return a},this.tmFormatFunction=function(e,t,n){return"upcase"==t.formatFunction?e.toUpperCase():"downcase"==t.formatFunction?e.toLowerCase():e},this.resolveVariables=function(e,t){for(var n=[],i="",o=!0,r=0;r<e.length;r++){var s=e[r];if("string"!=typeof s){if(s){if(o=!1,s.fmtString){var a=e.indexOf(s,r+1);-1==a&&(a=e.length),s.fmt=e.slice(r+1,a),r=a}if(s.text){var l=this.getVariableValue(t,s.text,i)+"";s.fmtString&&(l=this.tmStrFormat(l,s,t)),s.formatFunction&&(l=this.tmFormatFunction(l,s,t)),l&&!s.ifEnd?(n.push(l),c(s)):!l&&s.ifEnd&&c(s.ifEnd)}else s.elseEnd?c(s.elseEnd):(null!=s.tabstopId||null!=s.changeCase)&&n.push(s)}}else n.push(s),"\n"==s?(o=!0,i=""):o&&(i=/^\t*/.exec(s)[0],o=/\S/.test(s))}function c(t){var n=e.indexOf(t,r+1);-1!=n&&(r=n)}return n},this.insertSnippetForSelection=function(e,t){var n=e.getCursorPosition(),i=e.session.getLine(n.row),o=e.session.getTabString(),r=i.match(/^\s*/)[0];n.column<r.length&&(r=r.slice(0,n.column)),t=t.replace(/\r/g,"");var s=this.tokenizeTmSnippet(t);s=(s=this.resolveVariables(s,e)).map((function(e){return"\n"==e?e+r:"string"==typeof e?e.replace(/\t/g,o):e}));var a=[];s.forEach((function(e,t){if("object"==typeof e){var n=e.tabstopId,i=a[n];if(i||((i=a[n]=[]).index=n,i.value="",i.parents={}),-1===i.indexOf(e)){e.choices&&!i.choices&&(i.choices=e.choices),i.push(e);var o=s.indexOf(e,t+1);if(-1!==o){var r=s.slice(t+1,o);r.some((function(e){return"object"==typeof e}))&&!i.value?i.value=r:!r.length||i.value&&"string"==typeof i.value||(i.value=r.join(""))}}}})),a.forEach((function(e){e.length=0}));var l={};function c(e){for(var t=[],n=0;n<e.length;n++){var i=e[n];if("object"==typeof i){if(l[i.tabstopId])continue;i=t[e.lastIndexOf(i,n-1)]||{tabstopId:i.tabstopId}}t[n]=i}return t}for(var u=0;u<s.length;u++){var h=s[u];if("object"==typeof h){var d=h.tabstopId,p=a[d],f=s.indexOf(h,u+1);if(l[d])l[d]===h&&(delete l[d],Object.keys(l).forEach((function(e){p.parents[e]=!0})));else{l[d]=h;var m=p.value;"string"!=typeof m?m=c(m):h.fmt&&(m=this.tmStrFormat(m,h,e)),s.splice.apply(s,[u+1,Math.max(0,f-u)].concat(m,h)),-1===p.indexOf(h)&&p.push(h)}}}var v=0,b=0,w="";s.forEach((function(e){if("string"==typeof e){var t=e.split("\n");t.length>1?(b=t[t.length-1].length,v+=t.length-1):b+=e.length,w+=e}else e&&(e.start?e.end={row:v,column:b}:e.start={row:v,column:b})}));var y=e.getSelectionRange(),x=e.session.replace(y,w),C=new g(e),S=e.inVirtualSelectionMode&&e.selection.index;C.addTabstops(a,y.start,x,S)},this.insertSnippet=function(e,t){var n=this;if(e.inVirtualSelectionMode)return n.insertSnippetForSelection(e,t);e.forEachSelection((function(){n.insertSnippetForSelection(e,t)}),null,{keepOrder:!0}),e.tabstopManager&&e.tabstopManager.tabNext()},this.$getScope=function(e){var t=e.session.$mode.$id||"";if("html"===(t=t.split("/").pop())||"php"===t){"php"!==t||e.session.$mode.inlinePhp||(t="html");var n=e.getCursorPosition(),i=e.session.getState(n.row);"object"==typeof i&&(i=i[0]),i.substring&&("js-"==i.substring(0,3)?t="javascript":"css-"==i.substring(0,4)?t="css":"php-"==i.substring(0,4)&&(t="php"))}return t},this.getActiveScopes=function(e){var t=this.$getScope(e),n=[t],i=this.snippetMap;return i[t]&&i[t].includeScopes&&n.push.apply(n,i[t].includeScopes),n.push("_"),n},this.expandWithTab=function(e,t){var n=this,i=e.forEachSelection((function(){return n.expandSnippetForSelection(e,t)}),null,{keepOrder:!0});return i&&e.tabstopManager&&e.tabstopManager.tabNext(),i},this.expandSnippetForSelection=function(e,t){var n,i=e.getCursorPosition(),o=e.session.getLine(i.row),r=o.substring(0,i.column),s=o.substr(i.column),a=this.snippetMap;return this.getActiveScopes(e).some((function(e){var t=a[e];return t&&(n=this.findMatchingSnippet(t,r,s)),!!n}),this),!!n&&(t&&t.dryRun||(e.session.doc.removeInLine(i.row,i.column-n.replaceBefore.length,i.column+n.replaceAfter.length),this.variables.M__=n.matchBefore,this.variables.T__=n.matchAfter,this.insertSnippetForSelection(e,n.content),this.variables.M__=this.variables.T__=null),!0)},this.findMatchingSnippet=function(e,t,n){for(var i=e.length;i--;){var o=e[i];if((!o.startRe||o.startRe.test(t))&&(!o.endRe||o.endRe.test(n))&&(o.startRe||o.endRe))return o.matchBefore=o.startRe?o.startRe.exec(t):[""],o.matchAfter=o.endRe?o.endRe.exec(n):[""],o.replaceBefore=o.triggerRe?o.triggerRe.exec(t)[0]:"",o.replaceAfter=o.endTriggerRe?o.endTriggerRe.exec(n)[0]:"",o}},this.snippetMap={},this.snippetNameMap={},this.register=function(e,t){var n=this.snippetMap,i=this.snippetNameMap,o=this;function r(e){return e&&!/^\^?\(.*\)\$?$|^\\b$/.test(e)&&(e="(?:"+e+")"),e||""}function a(e,t,n){return e=r(e),t=r(t),n?(e=t+e)&&"$"!=e[e.length-1]&&(e+="$"):(e+=t)&&"^"!=e[0]&&(e="^"+e),new RegExp(e)}function l(e){e.scope||(e.scope=t||"_"),t=e.scope,n[t]||(n[t]=[],i[t]={});var r=i[t];if(e.name){var l=r[e.name];l&&o.unregister(l),r[e.name]=e}n[t].push(e),e.prefix&&(e.tabTrigger=e.prefix),!e.content&&e.body&&(e.content=Array.isArray(e.body)?e.body.join("\n"):e.body),e.tabTrigger&&!e.trigger&&(!e.guard&&/^\w/.test(e.tabTrigger)&&(e.guard="\\b"),e.trigger=s.escapeRegExp(e.tabTrigger)),(e.trigger||e.guard||e.endTrigger||e.endGuard)&&(e.startRe=a(e.trigger,e.guard,!0),e.triggerRe=new RegExp(e.trigger),e.endRe=a(e.endTrigger,e.endGuard,!0),e.endTriggerRe=new RegExp(e.endTrigger))}e||(e=[]),Array.isArray(e)?e.forEach(l):Object.keys(e).forEach((function(t){l(e[t])})),this._signal("registerSnippets",{scope:t})},this.unregister=function(e,t){var n=this.snippetMap,i=this.snippetNameMap;function o(e){var o=i[e.scope||t];if(o&&o[e.name]){delete o[e.name];var r=n[e.scope||t],s=r&&r.indexOf(e);s>=0&&r.splice(s,1)}}e.content?o(e):Array.isArray(e)&&e.forEach(o)},this.parseSnippetFile=function(e){e=e.replace(/\r/g,"");for(var t,n=[],i={},o=/^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm;t=o.exec(e);){if(t[1])try{i=JSON.parse(t[1]),n.push(i)}catch(e){}if(t[4])i.content=t[4].replace(/^\t/gm,""),n.push(i),i={};else{var r=t[2],s=t[3];if("regex"==r){var a=/\/((?:[^\/\\]|\\.)*)|$/g;i.guard=a.exec(s)[1],i.trigger=a.exec(s)[1],i.endTrigger=a.exec(s)[1],i.endGuard=a.exec(s)[1]}else"snippet"==r?(i.tabTrigger=s.match(/^\S*/)[0],i.name||(i.name=s)):r&&(i[r]=s)}}return n},this.getSnippetByName=function(e,t){var n,i=this.snippetNameMap;return this.getActiveScopes(t).some((function(t){var o=i[t];return o&&(n=o[e]),!!n}),this),n}}).call(f.prototype);var g=function(e){if(e.tabstopManager)return e.tabstopManager;e.tabstopManager=this,this.$onChange=this.onChange.bind(this),this.$onChangeSelection=s.delayedCall(this.onChangeSelection.bind(this)).schedule,this.$onChangeSession=this.onChangeSession.bind(this),this.$onAfterExec=this.onAfterExec.bind(this),this.attach(e)};(function(){this.attach=function(e){this.index=0,this.ranges=[],this.tabstops=[],this.$openTabstops=null,this.selectedTabstop=null,this.editor=e,this.editor.on("change",this.$onChange),this.editor.on("changeSelection",this.$onChangeSelection),this.editor.on("changeSession",this.$onChangeSession),this.editor.commands.on("afterExec",this.$onAfterExec),this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler)},this.detach=function(){this.tabstops.forEach(this.removeTabstopMarkers,this),this.ranges=null,this.tabstops=null,this.selectedTabstop=null,this.editor.removeListener("change",this.$onChange),this.editor.removeListener("changeSelection",this.$onChangeSelection),this.editor.removeListener("changeSession",this.$onChangeSession),this.editor.commands.removeListener("afterExec",this.$onAfterExec),this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.tabstopManager=null,this.editor=null},this.onChange=function(e){for(var t="r"==e.action[0],n=this.selectedTabstop||{},i=n.parents||{},o=(this.tabstops||[]).slice(),r=0;r<o.length;r++){var s=o[r],a=s==n||i[s.index];if(s.rangeList.$bias=a?0:1,"remove"==e.action&&s!==n){var l=s.parents&&s.parents[n.index],c=s.rangeList.pointIndex(e.start,l);c=c<0?-c-1:c+1;var u=s.rangeList.pointIndex(e.end,l);u=u<0?-u-1:u-1;for(var h=s.rangeList.ranges.slice(c,u),d=0;d<h.length;d++)this.removeRange(h[d])}s.rangeList.$onChange(e)}var p=this.editor.session;this.$inChange||!t||1!=p.getLength()||p.getValue()||this.detach()},this.updateLinkedFields=function(){var e=this.selectedTabstop;if(e&&e.hasLinkedRanges&&e.firstNonLinked){this.$inChange=!0;for(var n=this.editor.session,i=n.getTextRange(e.firstNonLinked),o=0;o<e.length;o++){var r=e[o];if(r.linked){var s=r.original,a=t.snippetManager.tmStrFormat(i,s,this.editor);n.replace(r,a)}}this.$inChange=!1}},this.onAfterExec=function(e){e.command&&!e.command.readOnly&&this.updateLinkedFields()},this.onChangeSelection=function(){if(this.editor){for(var e=this.editor.selection.lead,t=this.editor.selection.anchor,n=this.editor.selection.isEmpty(),i=0;i<this.ranges.length;i++)if(!this.ranges[i].linked){var o=this.ranges[i].contains(e.row,e.column),r=n||this.ranges[i].contains(t.row,t.column);if(o&&r)return}this.detach()}},this.onChangeSession=function(){this.detach()},this.tabNext=function(e){var t=this.tabstops.length,n=this.index+(e||1);(n=Math.min(Math.max(n,1),t))==t&&(n=0),this.selectTabstop(n),0===n&&this.detach()},this.selectTabstop=function(e){this.$openTabstops=null;var t=this.tabstops[this.index];if(t&&this.addTabstopMarkers(t),this.index=e,(t=this.tabstops[this.index])&&t.length){this.selectedTabstop=t;var n=t.firstNonLinked||t;if(t.choices&&(n.cursor=n.start),this.editor.inVirtualSelectionMode)this.editor.selection.fromOrientedRange(n);else{var i=this.editor.multiSelect;i.toSingleRange(n);for(var o=0;o<t.length;o++)t.hasLinkedRanges&&t[o].linked||i.addRange(t[o].clone(),!0)}this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler),this.selectedTabstop&&this.selectedTabstop.choices&&this.editor.execCommand("startAutocomplete",{matches:this.selectedTabstop.choices})}},this.addTabstops=function(e,t,n){var i=this.useLink||!this.editor.getOption("enableMultiselect");if(this.$openTabstops||(this.$openTabstops=[]),!e[0]){var o=a.fromPoints(n,n);v(o.start,t),v(o.end,t),e[0]=[o],e[0].index=0}var r=[this.index+1,0],s=this.ranges;e.forEach((function(e,n){for(var o=this.$openTabstops[n]||e,c=0;c<e.length;c++){var u=e[c],h=a.fromPoints(u.start,u.end||u.start);m(h.start,t),m(h.end,t),h.original=u,h.tabstop=o,s.push(h),o!=e?o.unshift(h):o[c]=h,u.fmtString||o.firstNonLinked&&i?(h.linked=!0,o.hasLinkedRanges=!0):o.firstNonLinked||(o.firstNonLinked=h)}o.firstNonLinked||(o.hasLinkedRanges=!1),o===e&&(r.push(o),this.$openTabstops[n]=o),this.addTabstopMarkers(o),o.rangeList=o.rangeList||new l,o.rangeList.$bias=0,o.rangeList.addList(o)}),this),r.length>2&&(this.tabstops.length&&r.push(r.splice(2,1)[0]),this.tabstops.splice.apply(this.tabstops,r))},this.addTabstopMarkers=function(e){var t=this.editor.session;e.forEach((function(e){e.markerId||(e.markerId=t.addMarker(e,"ace_snippet-marker","text"))}))},this.removeTabstopMarkers=function(e){var t=this.editor.session;e.forEach((function(e){t.removeMarker(e.markerId),e.markerId=null}))},this.removeRange=function(e){var t=e.tabstop.indexOf(e);-1!=t&&e.tabstop.splice(t,1),-1!=(t=this.ranges.indexOf(e))&&this.ranges.splice(t,1),-1!=(t=e.tabstop.rangeList.ranges.indexOf(e))&&e.tabstop.splice(t,1),this.editor.session.removeMarker(e.markerId),e.tabstop.length||(-1!=(t=this.tabstops.indexOf(e.tabstop))&&this.tabstops.splice(t,1),this.tabstops.length||this.detach())},this.keyboardHandler=new c,this.keyboardHandler.bindKeys({Tab:function(e){t.snippetManager&&t.snippetManager.expandWithTab(e)||(e.tabstopManager.tabNext(1),e.renderer.scrollCursorIntoView())},"Shift-Tab":function(e){e.tabstopManager.tabNext(-1),e.renderer.scrollCursorIntoView()},Esc:function(e){e.tabstopManager.detach()}})}).call(g.prototype);var m=function(e,t){0==e.row&&(e.column+=t.column),e.row+=t.row},v=function(e,t){e.row==t.row&&(e.column-=t.column),e.row-=t.row};i.importCssString(".ace_snippet-marker {    -moz-box-sizing: border-box;    box-sizing: border-box;    background: rgba(194, 193, 208, 0.09);    border: 1px dotted rgba(211, 208, 235, 0.62);    position: absolute;}","snippets.css",!1),t.snippetManager=new f;var b=e("./editor").Editor;(function(){this.insertSnippet=function(e,n){return t.snippetManager.insertSnippet(this,e,n)},this.expandSnippet=function(e){return t.snippetManager.expandWithTab(this,e)}}).call(b.prototype)})),ace.define("ace/autocomplete/popup",["require","exports","module","ace/virtual_renderer","ace/editor","ace/range","ace/lib/event","ace/lib/lang","ace/lib/dom"],(function(e,t,n){"use strict";var i=e("../virtual_renderer").VirtualRenderer,o=e("../editor").Editor,r=e("../range").Range,s=e("../lib/event"),a=e("../lib/lang"),l=e("../lib/dom"),c=function(e){var t=new i(e);t.$maxLines=4;var n=new o(t);return n.setHighlightActiveLine(!1),n.setShowPrintMargin(!1),n.renderer.setShowGutter(!1),n.renderer.setHighlightGutterLine(!1),n.$mouseHandler.$focusTimeout=0,n.$highlightTagPending=!0,n};l.importCssString(".ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {    background-color: #CAD6FA;    z-index: 1;}.ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {    background-color: #3a674e;}.ace_editor.ace_autocomplete .ace_line-hover {    border: 1px solid #abbffe;    margin-top: -1px;    background: rgba(233,233,253,0.4);    position: absolute;    z-index: 2;}.ace_dark.ace_editor.ace_autocomplete .ace_line-hover {    border: 1px solid rgba(109, 150, 13, 0.8);    background: rgba(58, 103, 78, 0.62);}.ace_completion-meta {    opacity: 0.5;    margin: 0.9em;}.ace_completion-message {    color: blue;}.ace_editor.ace_autocomplete .ace_completion-highlight{    color: #2d69c7;}.ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{    color: #93ca12;}.ace_editor.ace_autocomplete {    width: 300px;    z-index: 200000;    border: 1px lightgray solid;    position: fixed;    box-shadow: 2px 3px 5px rgba(0,0,0,.2);    line-height: 1.4;    background: #fefefe;    color: #111;}.ace_dark.ace_editor.ace_autocomplete {    border: 1px #484747 solid;    box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.51);    line-height: 1.4;    background: #25282c;    color: #c1c1c1;}","autocompletion.css",!1),t.AcePopup=function(e){var t=l.createElement("div"),n=new c(t);e&&e.appendChild(t),t.style.display="none",n.renderer.content.style.cursor="default",n.renderer.setStyle("ace_autocomplete"),n.setOption("displayIndentGuides",!1),n.setOption("dragDelay",150);var i,o=function(){};n.focus=o,n.$isFocused=!0,n.renderer.$cursorLayer.restartTimer=o,n.renderer.$cursorLayer.element.style.opacity=0,n.renderer.$maxLines=8,n.renderer.$keepTextAreaAtCursor=!1,n.setHighlightActiveLine(!1),n.session.highlight(""),n.session.$searchHighlight.clazz="ace_highlight-marker",n.on("mousedown",(function(e){var t=e.getDocumentPosition();n.selection.moveToPosition(t),h.start.row=h.end.row=t.row,e.stop()}));var u=new r(-1,0,-1,1/0),h=new r(-1,0,-1,1/0);h.id=n.session.addMarker(h,"ace_active-line","fullLine"),n.setSelectOnHover=function(e){e?u.id&&(n.session.removeMarker(u.id),u.id=null):u.id=n.session.addMarker(u,"ace_line-hover","fullLine")},n.setSelectOnHover(!1),n.on("mousemove",(function(e){if(i){if(i.x!=e.x||i.y!=e.y){(i=e).scrollTop=n.renderer.scrollTop;var t=i.getDocumentPosition().row;u.start.row!=t&&(u.id||n.setRow(t),p(t))}}else i=e})),n.renderer.on("beforeRender",(function(){if(i&&-1!=u.start.row){i.$pos=null;var e=i.getDocumentPosition().row;u.id||n.setRow(e),p(e,!0)}})),n.renderer.on("afterRender",(function(){var e=n.getRow(),t=n.renderer.$textLayer,i=t.element.childNodes[e-t.config.firstRow];i!==t.selectedNode&&t.selectedNode&&l.removeCssClass(t.selectedNode,"ace_selected"),t.selectedNode=i,i&&l.addCssClass(i,"ace_selected")}));var d=function(){p(-1)},p=function(e,t){e!==u.start.row&&(u.start.row=u.end.row=e,t||n.session._emit("changeBackMarker"),n._emit("changeHoverMarker"))};n.getHoveredRow=function(){return u.start.row},s.addListener(n.container,"mouseout",d),n.on("hide",d),n.on("changeSelection",d),n.session.doc.getLength=function(){return n.data.length},n.session.doc.getLine=function(e){var t=n.data[e];return"string"==typeof t?t:t&&t.value||""};var f=n.session.bgTokenizer;return f.$tokenizeRow=function(e){var t=n.data[e],i=[];if(!t)return i;"string"==typeof t&&(t={value:t});var o=t.caption||t.value||t.name;function r(e,n){e&&i.push({type:(t.className||"")+(n||""),value:e})}for(var s=o.toLowerCase(),a=(n.filterText||"").toLowerCase(),l=0,c=0,u=0;u<=a.length;u++)if(u!=c&&(t.matchMask&1<<u||u==a.length)){var h=a.slice(c,u);c=u;var d=s.indexOf(h,l);if(-1==d)continue;r(o.slice(l,d),""),l=d+h.length,r(o.slice(d,l),"completion-highlight")}return r(o.slice(l,o.length),""),t.meta&&i.push({type:"completion-meta",value:t.meta}),t.message&&i.push({type:"completion-message",value:t.message}),i},f.$updateOnChange=o,f.start=o,n.session.$computeWidth=function(){return this.screenWidth=0},n.isOpen=!1,n.isTopdown=!1,n.autoSelect=!0,n.filterText="",n.data=[],n.setData=function(e,t){n.filterText=t||"",n.setValue(a.stringRepeat("\n",e.length),-1),n.data=e||[],n.setRow(0)},n.getData=function(e){return n.data[e]},n.getRow=function(){return h.start.row},n.setRow=function(e){e=Math.max(this.autoSelect?0:-1,Math.min(this.data.length,e)),h.start.row!=e&&(n.selection.clearSelection(),h.start.row=h.end.row=e||0,n.session._emit("changeBackMarker"),n.moveCursorTo(e||0,0),n.isOpen&&n._signal("select"))},n.on("changeSelection",(function(){n.isOpen&&n.setRow(n.selection.lead.row),n.renderer.scrollCursorIntoView()})),n.hide=function(){this.container.style.display="none",this._signal("hide"),n.isOpen=!1},n.show=function(e,t,o){var r=this.container,s=window.innerHeight,a=window.innerWidth,l=this.renderer,c=l.$maxLines*t*1.4,u=e.top+this.$borderSize;u>s/2&&!o&&u+t+c>s?(l.$maxPixelHeight=u-2*this.$borderSize,r.style.top="",r.style.bottom=s-u+"px",n.isTopdown=!1):(u+=t,l.$maxPixelHeight=s-u-.2*t,r.style.top=u+"px",r.style.bottom="",n.isTopdown=!0),r.style.display="";var h=e.left;h+r.offsetWidth>a&&(h=a-r.offsetWidth),r.style.left=h+"px",this._signal("show"),i=null,n.isOpen=!0},n.goTo=function(e){var t=this.getRow(),n=this.session.getLength()-1;switch(e){case"up":t=t<=0?n:t-1;break;case"down":t=t>=n?-1:t+1;break;case"start":t=0;break;case"end":t=n}this.setRow(t)},n.getTextLeftOffset=function(){return this.$borderSize+this.renderer.$padding+this.$imageSize},n.$imageSize=0,n.$borderSize=1,n},t.$singleLineEditor=c})),ace.define("ace/autocomplete/util",["require","exports","module"],(function(e,t,n){"use strict";t.parForEach=function(e,t,n){var i=0,o=e.length;0===o&&n();for(var r=0;r<o;r++)t(e[r],(function(e,t){++i===o&&n(e,t)}))};var i=/[a-zA-Z_0-9\$\-\u00A2-\u2000\u2070-\uFFFF]/;t.retrievePrecedingIdentifier=function(e,t,n){n=n||i;for(var o=[],r=t-1;r>=0&&n.test(e[r]);r--)o.push(e[r]);return o.reverse().join("")},t.retrieveFollowingIdentifier=function(e,t,n){n=n||i;for(var o=[],r=t;r<e.length&&n.test(e[r]);r++)o.push(e[r]);return o},t.getCompletionPrefix=function(e){var t,n=e.getCursorPosition(),i=e.session.getLine(n.row);return e.completers.forEach(function(e){e.identifierRegexps&&e.identifierRegexps.forEach(function(e){!t&&e&&(t=this.retrievePrecedingIdentifier(i,n.column,e))}.bind(this))}.bind(this)),t||this.retrievePrecedingIdentifier(i,n.column)}})),ace.define("ace/autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/popup","ace/autocomplete/util","ace/lib/lang","ace/lib/dom","ace/snippets","ace/config"],(function(e,t,n){"use strict";var i=e("./keyboard/hash_handler").HashHandler,o=e("./autocomplete/popup").AcePopup,r=e("./autocomplete/util"),s=e("./lib/lang"),a=e("./lib/dom"),l=e("./snippets").snippetManager,c=e("./config"),u=function(){this.autoInsert=!1,this.autoSelect=!0,this.exactMatch=!1,this.gatherCompletionsId=0,this.keyboardHandler=new i,this.keyboardHandler.bindKeys(this.commands),this.blurListener=this.blurListener.bind(this),this.changeListener=this.changeListener.bind(this),this.mousedownListener=this.mousedownListener.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this),this.changeTimer=s.delayedCall(function(){this.updateCompletions(!0)}.bind(this)),this.tooltipTimer=s.delayedCall(this.updateDocTooltip.bind(this),50)};(function(){this.$init=function(){return this.popup=new o(document.body||document.documentElement),this.popup.on("click",function(e){this.insertMatch(),e.stop()}.bind(this)),this.popup.focus=this.editor.focus.bind(this.editor),this.popup.on("show",this.tooltipTimer.bind(null,null)),this.popup.on("select",this.tooltipTimer.bind(null,null)),this.popup.on("changeHoverMarker",this.tooltipTimer.bind(null,null)),this.popup},this.getPopup=function(){return this.popup||this.$init()},this.openPopup=function(e,t,n){this.popup||this.$init(),this.popup.autoSelect=this.autoSelect,this.popup.setData(this.completions.filtered,this.completions.filterText),e.keyBinding.addKeyboardHandler(this.keyboardHandler);var i=e.renderer;if(this.popup.setRow(this.autoSelect?0:-1),n)n&&!t&&this.detach();else{this.popup.setTheme(e.getTheme()),this.popup.setFontSize(e.getFontSize());var o=i.layerConfig.lineHeight,r=i.$cursorLayer.getPixelPosition(this.base,!0);r.left-=this.popup.getTextLeftOffset();var s=e.container.getBoundingClientRect();r.top+=s.top-i.layerConfig.offset,r.left+=s.left-e.renderer.scrollLeft,r.left+=i.gutterWidth,this.popup.show(r,o)}this.changeTimer.cancel()},this.detach=function(){this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.off("changeSelection",this.changeListener),this.editor.off("blur",this.blurListener),this.editor.off("mousedown",this.mousedownListener),this.editor.off("mousewheel",this.mousewheelListener),this.changeTimer.cancel(),this.hideDocTooltip(),this.gatherCompletionsId+=1,this.popup&&this.popup.isOpen&&this.popup.hide(),this.base&&this.base.detach(),this.activated=!1,this.completions=this.base=null},this.changeListener=function(e){var t=this.editor.selection.lead;(t.row!=this.base.row||t.column<this.base.column)&&this.detach(),this.activated?this.changeTimer.schedule():this.detach()},this.blurListener=function(e){var t=document.activeElement,n=this.editor.textInput.getElement(),i=e.relatedTarget&&this.tooltipNode&&this.tooltipNode.contains(e.relatedTarget),o=this.popup&&this.popup.container;t==n||t.parentNode==o||i||t==this.tooltipNode||e.relatedTarget==n||this.detach()},this.mousedownListener=function(e){this.detach()},this.mousewheelListener=function(e){this.detach()},this.goTo=function(e){this.popup.goTo(e)},this.insertMatch=function(e,t){if(e||(e=this.popup.getData(this.popup.getRow())),!e)return!1;var n=this.completions;if(this.editor.startOperation({command:{name:"insertMatch"}}),e.completer&&e.completer.insertMatch)e.completer.insertMatch(this.editor,e);else{if(n.filterText)for(var i,o=this.editor.selection.getAllRanges(),r=0;i=o[r];r++)i.start.column-=n.filterText.length,this.editor.session.remove(i);e.snippet?l.insertSnippet(this.editor,e.snippet):this.editor.execCommand("insertstring",e.value||e)}this.completions==n&&this.detach(),this.editor.endOperation()},this.commands={Up:function(e){e.completer.goTo("up")},Down:function(e){e.completer.goTo("down")},"Ctrl-Up|Ctrl-Home":function(e){e.completer.goTo("start")},"Ctrl-Down|Ctrl-End":function(e){e.completer.goTo("end")},Esc:function(e){e.completer.detach()},Return:function(e){return e.completer.insertMatch()},"Shift-Return":function(e){e.completer.insertMatch(null,{deleteSuffix:!0})},Tab:function(e){var t=e.completer.insertMatch();if(t||e.tabstopManager)return t;e.completer.goTo("down")},PageUp:function(e){e.completer.popup.gotoPageUp()},PageDown:function(e){e.completer.popup.gotoPageDown()}},this.gatherCompletions=function(e,t){var n=e.getSession(),i=e.getCursorPosition(),o=r.getCompletionPrefix(e);this.base=n.doc.createAnchor(i.row,i.column-o.length),this.base.$insertRight=!0;var s=[],a=e.completers.length;return e.completers.forEach((function(l,c){l.getCompletions(e,n,i,o,(function(n,i){!n&&i&&(s=s.concat(i)),t(null,{prefix:r.getCompletionPrefix(e),matches:s,finished:0==--a})}))})),!0},this.showPopup=function(e,t){this.editor&&this.detach(),this.activated=!0,this.editor=e,e.completer!=this&&(e.completer&&e.completer.detach(),e.completer=this),e.on("changeSelection",this.changeListener),e.on("blur",this.blurListener),e.on("mousedown",this.mousedownListener),e.on("mousewheel",this.mousewheelListener),this.updateCompletions(!1,t)},this.updateCompletions=function(e,t){if(e&&this.base&&this.completions){var n=this.editor.getCursorPosition(),i=this.editor.session.getTextRange({start:this.base,end:n});if(i==this.completions.filterText)return;return this.completions.setFilter(i),this.completions.filtered.length&&(1!=this.completions.filtered.length||this.completions.filtered[0].value!=i||this.completions.filtered[0].snippet)?void this.openPopup(this.editor,i,e):this.detach()}if(t&&t.matches)return n=this.editor.getSelectionRange().start,this.base=this.editor.session.doc.createAnchor(n.row,n.column),this.base.$insertRight=!0,this.completions=new h(t.matches),this.openPopup(this.editor,"",e);var o=this.gatherCompletionsId,r=function(e){if(e.finished)return this.detach()}.bind(this),s=function(t){var n=t.prefix,i=t.matches;this.completions=new h(i),this.exactMatch&&(this.completions.exactMatch=!0),this.completions.setFilter(n);var o=this.completions.filtered;return o.length&&(1!=o.length||o[0].value!=n||o[0].snippet)?this.autoInsert&&1==o.length&&t.finished?this.insertMatch(o[0]):void this.openPopup(this.editor,n,e):r(t)}.bind(this),a=!0,l=null;if(this.gatherCompletions(this.editor,function(e,t){var n=t.prefix,i=t&&t.matches;if(!i||!i.length)return r(t);0===n.indexOf(t.prefix)&&o==this.gatherCompletionsId&&(a?l=t:s(t))}.bind(this)),a=!1,l){var c=l;l=null,s(c)}},this.cancelContextMenu=function(){this.editor.$mouseHandler.cancelContextMenu()},this.updateDocTooltip=function(){var e=this.popup,t=e.data,n=t&&(t[e.getHoveredRow()]||t[e.getRow()]),i=null;return n&&this.editor&&this.popup.isOpen?(this.editor.completers.some((function(e){return e.getDocTooltip&&(i=e.getDocTooltip(n)),i})),i||"string"==typeof n||(i=n),"string"==typeof i&&(i={docText:i}),i&&(i.docHTML||i.docText)?void this.showDocTooltip(i):this.hideDocTooltip()):this.hideDocTooltip()},this.showDocTooltip=function(e){this.tooltipNode||(this.tooltipNode=a.createElement("div"),this.tooltipNode.className="ace_tooltip ace_doc-tooltip",this.tooltipNode.style.margin=0,this.tooltipNode.style.pointerEvents="auto",this.tooltipNode.tabIndex=-1,this.tooltipNode.onblur=this.blurListener.bind(this),this.tooltipNode.onclick=this.onTooltipClick.bind(this));var t=this.tooltipNode;e.docHTML?t.innerHTML=e.docHTML:e.docText&&(t.textContent=e.docText),t.parentNode||document.body.appendChild(t);var n=this.popup,i=n.container.getBoundingClientRect();t.style.top=n.container.style.top,t.style.bottom=n.container.style.bottom,t.style.display="block",window.innerWidth-i.right<320?i.left<320?n.isTopdown?(t.style.top=i.bottom+"px",t.style.left=i.left+"px",t.style.right="",t.style.bottom=""):(t.style.top=n.container.offsetTop-t.offsetHeight+"px",t.style.left=i.left+"px",t.style.right="",t.style.bottom=""):(t.style.right=window.innerWidth-i.left+"px",t.style.left=""):(t.style.left=i.right+1+"px",t.style.right="")},this.hideDocTooltip=function(){if(this.tooltipTimer.cancel(),this.tooltipNode){var e=this.tooltipNode;this.editor.isFocused()||document.activeElement!=e||this.editor.focus(),this.tooltipNode=null,e.parentNode&&e.parentNode.removeChild(e)}},this.onTooltipClick=function(e){for(var t=e.target;t&&t!=this.tooltipNode;){if("A"==t.nodeName&&t.href){t.rel="noreferrer",t.target="_blank";break}t=t.parentNode}},this.destroy=function(){if(this.detach(),this.popup){this.popup.destroy();var e=this.popup.container;e&&e.parentNode&&e.parentNode.removeChild(e)}this.editor&&this.editor.completer==this&&this.editor.completer,this.popup=null}}).call(u.prototype),u.for=function(e){return e.completer||(c.get("sharedPopups")?(u.$shared||(u.$sharedInstance=new u),e.completer=u.$sharedInstance):(e.completer=new u,e.once("destroy",(function(e,t){t.completer.destroy()})))),e.completer},u.startCommand={name:"startAutocomplete",exec:function(e,t){var n=u.for(e);n.autoInsert=!1,n.autoSelect=!0,n.showPopup(e,t),n.cancelContextMenu()},bindKey:"Ctrl-Space|Ctrl-Shift-Space|Alt-Space"};var h=function(e,t){this.all=e,this.filtered=e,this.filterText=t||"",this.exactMatch=!1};(function(){this.setFilter=function(e){if(e.length>this.filterText&&0===e.lastIndexOf(this.filterText,0))var t=this.filtered;else t=this.all;this.filterText=e,t=(t=this.filterCompletions(t,this.filterText)).sort((function(e,t){return t.exactMatch-e.exactMatch||t.$score-e.$score||(e.caption||e.value).localeCompare(t.caption||t.value)}));var n=null;t=t.filter((function(e){var t=e.snippet||e.caption||e.value;return t!==n&&(n=t,!0)})),this.filtered=t},this.filterCompletions=function(e,t){var n=[],i=t.toUpperCase(),o=t.toLowerCase();e:for(var r,s=0;r=e[s];s++){var a=r.caption||r.value||r.snippet;if(a){var l,c,u=-1,h=0,d=0;if(this.exactMatch){if(t!==a.substr(0,t.length))continue e}else{var p=a.toLowerCase().indexOf(o);if(p>-1)d=p;else for(var f=0;f<t.length;f++){var g=a.indexOf(o[f],u+1),m=a.indexOf(i[f],u+1);if((l=g>=0&&(m<0||g<m)?g:m)<0)continue e;(c=l-u-1)>0&&(-1===u&&(d+=10),d+=c,h|=1<<f),u=l}}r.matchMask=h,r.exactMatch=d?0:1,r.$score=(r.score||0)-d,n.push(r)}}return n}}).call(h.prototype),t.Autocomplete=u,t.FilteredList=h})),ace.define("ace/autocomplete/text_completer",["require","exports","module","ace/range"],(function(e,t,n){var i=e("../range").Range,o=/[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/;t.getCompletions=function(e,t,n,r,s){var a=function(e,t){var n=function(e,t){return e.getTextRange(i.fromPoints({row:0,column:0},t)).split(o).length-1}(e,t),r=e.getValue().split(o),s=Object.create(null),a=r[n];return r.forEach((function(e,t){if(e&&e!==a){var i=Math.abs(n-t),o=r.length-i;s[e]?s[e]=Math.max(o,s[e]):s[e]=o}})),s}(t,n);s(null,Object.keys(a).map((function(e){return{caption:e,value:e,score:a[e],meta:"local"}})))}})),ace.define("ace/ext/language_tools",["require","exports","module","ace/snippets","ace/autocomplete","ace/config","ace/lib/lang","ace/autocomplete/util","ace/autocomplete/text_completer","ace/editor","ace/config"],(function(e,t,n){"use strict";var i=e("../snippets").snippetManager,o=e("../autocomplete").Autocomplete,r=e("../config"),s=e("../lib/lang"),a=e("../autocomplete/util"),l=e("../autocomplete/text_completer"),c={getCompletions:function(e,t,n,i,o){if(t.$mode.completer)return t.$mode.completer.getCompletions(e,t,n,i,o);var r=e.session.getState(n.row);o(null,t.$mode.getCompletions(r,t,n,i))}},u={getCompletions:function(e,t,n,o,r){var s=[],a=t.getTokenAt(n.row,n.column);a&&a.type.match(/(tag-name|tag-open|tag-whitespace|attribute-name|attribute-value)\.xml$/)?s.push("html-tag"):s=i.getActiveScopes(e);var l=i.snippetMap,c=[];s.forEach((function(e){for(var t=l[e]||[],n=t.length;n--;){var i=t[n],o=i.name||i.tabTrigger;o&&c.push({caption:o,snippet:i.content,meta:i.tabTrigger&&!i.name?i.tabTrigger+"⇥ ":"snippet",type:"snippet"})}}),this),r(null,c)},getDocTooltip:function(e){"snippet"!=e.type||e.docHTML||(e.docHTML=["<b>",s.escapeHTML(e.caption),"</b>","<hr></hr>",s.escapeHTML(e.snippet)].join(""))}},h=[u,l,c];t.setCompleters=function(e){h.length=0,e&&h.push.apply(h,e)},t.addCompleter=function(e){h.push(e)},t.textCompleter=l,t.keyWordCompleter=c,t.snippetCompleter=u;var d={name:"expandSnippet",exec:function(e){return i.expandWithTab(e)},bindKey:"Tab"},p=function(e,t){f(t.session.$mode)},f=function(e){"string"==typeof e&&(e=r.$modes[e]),e&&(i.files||(i.files={}),g(e.$id,e.snippetFileId),e.modes&&e.modes.forEach(f))},g=function(e,t){t&&e&&!i.files[e]&&(i.files[e]={},r.loadModule(t,(function(t){t&&(i.files[e]=t,!t.snippets&&t.snippetText&&(t.snippets=i.parseSnippetFile(t.snippetText)),i.register(t.snippets||[],t.scope),t.includeScopes&&(i.snippetMap[t.scope].includeScopes=t.includeScopes,t.includeScopes.forEach((function(e){f("ace/mode/"+e)}))))})))},m=function(e){var t=e.editor,n=t.completer&&t.completer.activated;if("backspace"===e.command.name)n&&!a.getCompletionPrefix(t)&&t.completer.detach();else if("insertstring"===e.command.name&&a.getCompletionPrefix(t)&&!n){var i=o.for(t);i.autoInsert=!1,i.showPopup(t)}},v=e("../editor").Editor;e("../config").defineOptions(v.prototype,"editor",{enableBasicAutocompletion:{set:function(e){e?(this.completers||(this.completers=Array.isArray(e)?e:h),this.commands.addCommand(o.startCommand)):this.commands.removeCommand(o.startCommand)},value:!1},enableLiveAutocompletion:{set:function(e){e?(this.completers||(this.completers=Array.isArray(e)?e:h),this.commands.on("afterExec",m)):this.commands.removeListener("afterExec",m)},value:!1},enableSnippets:{set:function(e){e?(this.commands.addCommand(d),this.on("changeMode",p),p(0,this)):(this.commands.removeCommand(d),this.off("changeMode",p))},value:!1}})})),ace.require(["ace/ext/language_tools"],(function(t){e&&(e.exports=t)}))},3606:function(e,t,n){e=n.nmd(e),ace.define("ace/split",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/editor","ace/virtual_renderer","ace/edit_session"],(function(e,t,n){"use strict";var i=e("./lib/oop"),o=(e("./lib/lang"),e("./lib/event_emitter").EventEmitter),r=e("./editor").Editor,s=e("./virtual_renderer").VirtualRenderer,a=e("./edit_session").EditSession,l=function(e,t,n){this.BELOW=1,this.BESIDE=0,this.$container=e,this.$theme=t,this.$splits=0,this.$editorCSS="",this.$editors=[],this.$orientation=this.BESIDE,this.setSplits(n||1),this.$cEditor=this.$editors[0],this.on("focus",function(e){this.$cEditor=e}.bind(this))};(function(){i.implement(this,o),this.$createEditor=function(){var e=document.createElement("div");e.className=this.$editorCSS,e.style.cssText="position: absolute; top:0px; bottom:0px",this.$container.appendChild(e);var t=new r(new s(e,this.$theme));return t.on("focus",function(){this._emit("focus",t)}.bind(this)),this.$editors.push(t),t.setFontSize(this.$fontSize),t},this.setSplits=function(e){var t;if(e<1)throw"The number of splits have to be > 0!";if(e!=this.$splits){if(e>this.$splits){for(;this.$splits<this.$editors.length&&this.$splits<e;)t=this.$editors[this.$splits],this.$container.appendChild(t.container),t.setFontSize(this.$fontSize),this.$splits++;for(;this.$splits<e;)this.$createEditor(),this.$splits++}else for(;this.$splits>e;)t=this.$editors[this.$splits-1],this.$container.removeChild(t.container),this.$splits--;this.resize()}},this.getSplits=function(){return this.$splits},this.getEditor=function(e){return this.$editors[e]},this.getCurrentEditor=function(){return this.$cEditor},this.focus=function(){this.$cEditor.focus()},this.blur=function(){this.$cEditor.blur()},this.setTheme=function(e){this.$editors.forEach((function(t){t.setTheme(e)}))},this.setKeyboardHandler=function(e){this.$editors.forEach((function(t){t.setKeyboardHandler(e)}))},this.forEach=function(e,t){this.$editors.forEach(e,t)},this.$fontSize="",this.setFontSize=function(e){this.$fontSize=e,this.forEach((function(t){t.setFontSize(e)}))},this.$cloneSession=function(e){var t=new a(e.getDocument(),e.getMode()),n=e.getUndoManager();return t.setUndoManager(n),t.setTabSize(e.getTabSize()),t.setUseSoftTabs(e.getUseSoftTabs()),t.setOverwrite(e.getOverwrite()),t.setBreakpoints(e.getBreakpoints()),t.setUseWrapMode(e.getUseWrapMode()),t.setUseWorker(e.getUseWorker()),t.setWrapLimitRange(e.$wrapLimitRange.min,e.$wrapLimitRange.max),t.$foldData=e.$cloneFoldData(),t},this.setSession=function(e,t){var n;n=null==t?this.$cEditor:this.$editors[t];var i=this.$editors.some((function(t){return t.session===e}));return i&&(e=this.$cloneSession(e)),n.setSession(e),e},this.getOrientation=function(){return this.$orientation},this.setOrientation=function(e){this.$orientation!=e&&(this.$orientation=e,this.resize())},this.resize=function(){var e,t=this.$container.clientWidth,n=this.$container.clientHeight;if(this.$orientation==this.BESIDE)for(var i=t/this.$splits,o=0;o<this.$splits;o++)(e=this.$editors[o]).container.style.width=i+"px",e.container.style.top="0px",e.container.style.left=o*i+"px",e.container.style.height=n+"px",e.resize();else{var r=n/this.$splits;for(o=0;o<this.$splits;o++)(e=this.$editors[o]).container.style.width=t+"px",e.container.style.top=o*r+"px",e.container.style.left="0px",e.container.style.height=r+"px",e.resize()}}}).call(l.prototype),t.Split=l})),ace.define("ace/ext/split",["require","exports","module","ace/split"],(function(e,t,n){"use strict";n.exports=e("../split")})),ace.require(["ace/ext/split"],(function(t){e&&(e.exports=t)}))},6006:function(e,t,n){e=n.nmd(e),ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],(function(e,t,n){"use strict";var i=e("../lib/oop"),o=(e("../lib/lang"),e("./text_highlight_rules").TextHighlightRules),r=t.supportType="align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-shadow|box-sizing|caption-side|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|max-zoom|min-height|min-width|min-zoom|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|user-select|user-zoom|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index",s=t.supportFunction="rgb|rgba|url|attr|counter|counters",a=t.supportConstant="absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero|zoom",l=t.supportConstantColor="aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen",c=t.supportConstantFonts="arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace",u=t.numRe="\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))",h=t.pseudoElements="(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b",d=t.pseudoClasses="(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b",p=function(){var e=this.createKeywordMapper({"support.function":s,"support.constant":a,"support.type":r,"support.constant.color":l,"support.constant.fonts":c},"text",!0);this.$rules={start:[{include:["strings","url","comments"]},{token:"paren.lparen",regex:"\\{",next:"ruleset"},{token:"paren.rparen",regex:"\\}"},{token:"string",regex:"@(?!viewport)",next:"media"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"keyword",regex:"%"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant.numeric",regex:u},{token:"constant",regex:"[a-z0-9-_]+"},{caseInsensitive:!0}],media:[{include:["strings","url","comments"]},{token:"paren.lparen",regex:"\\{",next:"start"},{token:"paren.rparen",regex:"\\}",next:"start"},{token:"string",regex:";",next:"start"},{token:"keyword",regex:"(?:media|supports|document|charset|import|namespace|media|supports|document|page|font|keyframes|viewport|counter-style|font-feature-values|swash|ornaments|annotation|stylistic|styleset|character-variant)"}],comments:[{token:"comment",regex:"\\/\\*",push:[{token:"comment",regex:"\\*\\/",next:"pop"},{defaultToken:"comment"}]}],ruleset:[{regex:"-(webkit|ms|moz|o)-",token:"text"},{token:"punctuation.operator",regex:"[:;]"},{token:"paren.rparen",regex:"\\}",next:"start"},{include:["strings","url","comments"]},{token:["constant.numeric","keyword"],regex:"("+u+")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vmax|vmin|vm|vw|%)"},{token:"constant.numeric",regex:u},{token:"constant.numeric",regex:"#[a-f0-9]{6}"},{token:"constant.numeric",regex:"#[a-f0-9]{3}"},{token:["punctuation","entity.other.attribute-name.pseudo-element.css"],regex:h},{token:["punctuation","entity.other.attribute-name.pseudo-class.css"],regex:d},{include:"url"},{token:e,regex:"\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"},{caseInsensitive:!0}],url:[{token:"support.function",regex:"(?:url(:?-prefix)?|domain|regexp)\\(",push:[{token:"support.function",regex:"\\)",next:"pop"},{defaultToken:"string"}]}],strings:[{token:"string.start",regex:"'",push:[{token:"string.end",regex:"'|$",next:"pop"},{include:"escapes"},{token:"constant.language.escape",regex:/\\$/,consumeLineEnd:!0},{defaultToken:"string"}]},{token:"string.start",regex:'"',push:[{token:"string.end",regex:'"|$',next:"pop"},{include:"escapes"},{token:"constant.language.escape",regex:/\\$/,consumeLineEnd:!0},{defaultToken:"string"}]}],escapes:[{token:"constant.language.escape",regex:/\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/}]},this.normalizeRules()};i.inherits(p,o),t.CssHighlightRules=p})),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],(function(e,t,n){"use strict";var i=e("../range").Range,o=function(){};(function(){this.checkOutdent=function(e,t){return!!/^\s+$/.test(e)&&/^\s*\}/.test(t)},this.autoOutdent=function(e,t){var n=e.getLine(t).match(/^(\s*\})/);if(!n)return 0;var o=n[1].length,r=e.findMatchingBracket({row:t,column:o});if(!r||r.row==t)return 0;var s=this.$getIndent(e.getLine(r.row));e.replace(new i(t,0,t,o-1),s)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(o.prototype),t.MatchingBraceOutdent=o})),ace.define("ace/mode/css_completions",["require","exports","module"],(function(e,t,n){"use strict";var i={background:{"#$0":1},"background-color":{"#$0":1,transparent:1,fixed:1},"background-image":{"url('/$0')":1},"background-repeat":{repeat:1,"repeat-x":1,"repeat-y":1,"no-repeat":1,inherit:1},"background-position":{bottom:2,center:2,left:2,right:2,top:2,inherit:2},"background-attachment":{scroll:1,fixed:1},"background-size":{cover:1,contain:1},"background-clip":{"border-box":1,"padding-box":1,"content-box":1},"background-origin":{"border-box":1,"padding-box":1,"content-box":1},border:{"solid $0":1,"dashed $0":1,"dotted $0":1,"#$0":1},"border-color":{"#$0":1},"border-style":{solid:2,dashed:2,dotted:2,double:2,groove:2,hidden:2,inherit:2,inset:2,none:2,outset:2,ridged:2},"border-collapse":{collapse:1,separate:1},bottom:{px:1,em:1,"%":1},clear:{left:1,right:1,both:1,none:1},color:{"#$0":1,"rgb(#$00,0,0)":1},cursor:{default:1,pointer:1,move:1,text:1,wait:1,help:1,progress:1,"n-resize":1,"ne-resize":1,"e-resize":1,"se-resize":1,"s-resize":1,"sw-resize":1,"w-resize":1,"nw-resize":1},display:{none:1,block:1,inline:1,"inline-block":1,"table-cell":1},"empty-cells":{show:1,hide:1},float:{left:1,right:1,none:1},"font-family":{Arial:2,"Comic Sans MS":2,Consolas:2,"Courier New":2,Courier:2,Georgia:2,Monospace:2,"Sans-Serif":2,"Segoe UI":2,Tahoma:2,"Times New Roman":2,"Trebuchet MS":2,Verdana:1},"font-size":{px:1,em:1,"%":1},"font-weight":{bold:1,normal:1},"font-style":{italic:1,normal:1},"font-variant":{normal:1,"small-caps":1},height:{px:1,em:1,"%":1},left:{px:1,em:1,"%":1},"letter-spacing":{normal:1},"line-height":{normal:1},"list-style-type":{none:1,disc:1,circle:1,square:1,decimal:1,"decimal-leading-zero":1,"lower-roman":1,"upper-roman":1,"lower-greek":1,"lower-latin":1,"upper-latin":1,georgian:1,"lower-alpha":1,"upper-alpha":1},margin:{px:1,em:1,"%":1},"margin-right":{px:1,em:1,"%":1},"margin-left":{px:1,em:1,"%":1},"margin-top":{px:1,em:1,"%":1},"margin-bottom":{px:1,em:1,"%":1},"max-height":{px:1,em:1,"%":1},"max-width":{px:1,em:1,"%":1},"min-height":{px:1,em:1,"%":1},"min-width":{px:1,em:1,"%":1},overflow:{hidden:1,visible:1,auto:1,scroll:1},"overflow-x":{hidden:1,visible:1,auto:1,scroll:1},"overflow-y":{hidden:1,visible:1,auto:1,scroll:1},padding:{px:1,em:1,"%":1},"padding-top":{px:1,em:1,"%":1},"padding-right":{px:1,em:1,"%":1},"padding-bottom":{px:1,em:1,"%":1},"padding-left":{px:1,em:1,"%":1},"page-break-after":{auto:1,always:1,avoid:1,left:1,right:1},"page-break-before":{auto:1,always:1,avoid:1,left:1,right:1},position:{absolute:1,relative:1,fixed:1,static:1},right:{px:1,em:1,"%":1},"table-layout":{fixed:1,auto:1},"text-decoration":{none:1,underline:1,"line-through":1,blink:1},"text-align":{left:1,right:1,center:1,justify:1},"text-transform":{capitalize:1,uppercase:1,lowercase:1,none:1},top:{px:1,em:1,"%":1},"vertical-align":{top:1,bottom:1},visibility:{hidden:1,visible:1},"white-space":{nowrap:1,normal:1,pre:1,"pre-line":1,"pre-wrap":1},width:{px:1,em:1,"%":1},"word-spacing":{normal:1},filter:{"alpha(opacity=$0100)":1},"text-shadow":{"$02px 2px 2px #777":1},"text-overflow":{"ellipsis-word":1,clip:1,ellipsis:1},"-moz-border-radius":1,"-moz-border-radius-topright":1,"-moz-border-radius-bottomright":1,"-moz-border-radius-topleft":1,"-moz-border-radius-bottomleft":1,"-webkit-border-radius":1,"-webkit-border-top-right-radius":1,"-webkit-border-top-left-radius":1,"-webkit-border-bottom-right-radius":1,"-webkit-border-bottom-left-radius":1,"-moz-box-shadow":1,"-webkit-box-shadow":1,transform:{"rotate($00deg)":1,"skew($00deg)":1},"-moz-transform":{"rotate($00deg)":1,"skew($00deg)":1},"-webkit-transform":{"rotate($00deg)":1,"skew($00deg)":1}},o=function(){};(function(){this.completionsDefined=!1,this.defineCompletions=function(){if(document){var e=document.createElement("c").style;for(var t in e)if("string"==typeof e[t]){var n=t.replace(/[A-Z]/g,(function(e){return"-"+e.toLowerCase()}));i.hasOwnProperty(n)||(i[n]=1)}}this.completionsDefined=!0},this.getCompletions=function(e,t,n,i){if(this.completionsDefined||this.defineCompletions(),"ruleset"===e||"ace/mode/scss"==t.$mode.$id){var o=t.getLine(n.row).substr(0,n.column);return/:[^;]+$/.test(o)?(/([\w\-]+):[^:]*$/.test(o),this.getPropertyValueCompletions(e,t,n,i)):this.getPropertyCompletions(e,t,n,i)}return[]},this.getPropertyCompletions=function(e,t,n,o){return Object.keys(i).map((function(e){return{caption:e,snippet:e+": $0;",meta:"property",score:1e6}}))},this.getPropertyValueCompletions=function(e,t,n,o){var r=t.getLine(n.row).substr(0,n.column),s=(/([\w\-]+):[^:]*$/.exec(r)||{})[1];if(!s)return[];var a=[];return s in i&&"object"==typeof i[s]&&(a=Object.keys(i[s])),a.map((function(e){return{caption:e,snippet:e,meta:"property value",score:1e6}}))}}).call(o.prototype),t.CssCompletions=o})),ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"],(function(e,t,n){"use strict";var i=e("../../lib/oop"),o=(e("../behaviour").Behaviour,e("./cstyle").CstyleBehaviour),r=e("../../token_iterator").TokenIterator,s=function(){this.inherit(o),this.add("colon","insertion",(function(e,t,n,i,o){if(":"===o&&n.selection.isEmpty()){var s=n.getCursorPosition(),a=new r(i,s.row,s.column),l=a.getCurrentToken();if(l&&l.value.match(/\s+/)&&(l=a.stepBackward()),l&&"support.type"===l.type){var c=i.doc.getLine(s.row);if(":"===c.substring(s.column,s.column+1))return{text:"",selection:[1,1]};if(/^(\s+[^;]|\s*$)/.test(c.substring(s.column)))return{text:":;",selection:[1,1]}}}})),this.add("colon","deletion",(function(e,t,n,i,o){var s=i.doc.getTextRange(o);if(!o.isMultiLine()&&":"===s){var a=n.getCursorPosition(),l=new r(i,a.row,a.column),c=l.getCurrentToken();if(c&&c.value.match(/\s+/)&&(c=l.stepBackward()),c&&"support.type"===c.type&&";"===i.doc.getLine(o.start.row).substring(o.end.column,o.end.column+1))return o.end.column++,o}})),this.add("semicolon","insertion",(function(e,t,n,i,o){if(";"===o&&n.selection.isEmpty()){var r=n.getCursorPosition();if(";"===i.doc.getLine(r.row).substring(r.column,r.column+1))return{text:"",selection:[1,1]}}})),this.add("!important","insertion",(function(e,t,n,i,o){if("!"===o&&n.selection.isEmpty()){var r=n.getCursorPosition(),s=i.doc.getLine(r.row);if(/^\s*(;|}|$)/.test(s.substring(r.column)))return{text:"!important",selection:[10,10]}}}))};i.inherits(s,o),t.CssBehaviour=s})),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],(function(e,t,n){"use strict";var i=e("../../lib/oop"),o=e("../../range").Range,r=e("./fold_mode").FoldMode,s=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};i.inherits(s,r),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var i=e.getLine(n);if(this.singleLineBlockCommentRe.test(i)&&!this.startRegionRe.test(i)&&!this.tripleStarBlockCommentRe.test(i))return"";var o=this._getFoldWidgetBase(e,t,n);return!o&&this.startRegionRe.test(i)?"start":o},this.getFoldWidgetRange=function(e,t,n,i){var o,r=e.getLine(n);if(this.startRegionRe.test(r))return this.getCommentRegionBlock(e,r,n);if(o=r.match(this.foldingStartMarker)){var s=o.index;if(o[1])return this.openingBracketBlock(e,o[1],n,s);var a=e.getCommentFoldRange(n,s+o[0].length,1);return a&&!a.isMultiLine()&&(i?a=this.getSectionRange(e,n):"all"!=t&&(a=null)),a}return"markbegin"!==t&&(o=r.match(this.foldingStopMarker))?(s=o.index+o[0].length,o[1]?this.closingBracketBlock(e,o[1],n,s):e.getCommentFoldRange(n,s,-1)):void 0},this.getSectionRange=function(e,t){for(var n=e.getLine(t),i=n.search(/\S/),r=t,s=n.length,a=t+=1,l=e.getLength();++t<l;){var c=(n=e.getLine(t)).search(/\S/);if(-1!==c){if(i>c)break;var u=this.getFoldWidgetRange(e,"all",t);if(u){if(u.start.row<=r)break;if(u.isMultiLine())t=u.end.row;else if(i==c)break}a=t}}return new o(r,s,a,e.getLine(a).length)},this.getCommentRegionBlock=function(e,t,n){for(var i=t.search(/\s*$/),r=e.getLength(),s=n,a=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,l=1;++n<r;){t=e.getLine(n);var c=a.exec(t);if(c&&(c[1]?l--:l++,!l))break}if(n>s)return new o(s,i,n,t.length)}}.call(s.prototype)})),ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"],(function(e,t,n){"use strict";var i=e("../lib/oop"),o=e("./text").Mode,r=e("./css_highlight_rules").CssHighlightRules,s=e("./matching_brace_outdent").MatchingBraceOutdent,a=e("../worker/worker_client").WorkerClient,l=e("./css_completions").CssCompletions,c=e("./behaviour/css").CssBehaviour,u=e("./folding/cstyle").FoldMode,h=function(){this.HighlightRules=r,this.$outdent=new s,this.$behaviour=new c,this.$completer=new l,this.foldingRules=new u};i.inherits(h,o),function(){this.foldingRules="cStyle",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var i=this.$getIndent(t),o=this.getTokenizer().getLineTokens(t,e).tokens;return o.length&&"comment"==o[o.length-1].type||t.match(/^.*\{\s*$/)&&(i+=n),i},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.getCompletions=function(e,t,n,i){return this.$completer.getCompletions(e,t,n,i)},this.createWorker=function(e){var t=new a(["ace"],"ace/mode/css_worker","Worker");return t.attachToDocument(e.getDocument()),t.on("annotate",(function(t){e.setAnnotations(t.data)})),t.on("terminate",(function(){e.clearAnnotations()})),t},this.$id="ace/mode/css",this.snippetFileId="ace/snippets/css"}.call(h.prototype),t.Mode=h})),ace.require(["ace/mode/css"],(function(t){e&&(e.exports=t)}))},3765:function(e,t,n){e=n.nmd(e),ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],(function(e,t,n){"use strict";var i=e("../lib/oop"),o=e("./text_highlight_rules").TextHighlightRules,r=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},r.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:!0}]}};i.inherits(r,o),r.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},r.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},r.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=r})),ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],(function(e,t,n){"use strict";var i=e("../lib/oop"),o=e("./doc_comment_highlight_rules").DocCommentHighlightRules,r=e("./text_highlight_rules").TextHighlightRules,s="[a-zA-Z\\$_¡-￿][a-zA-Z\\d\\$_¡-￿]*",a=function(e){var t=this.createKeywordMapper({"variable.language":"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document",keyword:"const|yield|import|get|set|async|await|break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|__parent__|__count__|escape|unescape|with|__proto__|class|enum|extends|super|export|implements|private|public|interface|package|protected|static","storage.type":"const|let|var|function","constant.language":"null|Infinity|NaN|undefined","support.function":"alert","constant.language.boolean":"true|false"},"identifier"),n="\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|u{[0-9a-fA-F]{1,6}}|[0-2][0-7]{0,2}|3[0-7][0-7]?|[4-7][0-7]?|.)";this.$rules={no_regex:[o.getStartRule("doc-start"),c("no_regex"),{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/},{token:"constant.numeric",regex:/(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/},{token:["storage.type","punctuation.operator","support.function","punctuation.operator","entity.name.function","text","keyword.operator"],regex:"("+s+")(\\.)(prototype)(\\.)("+s+")(\\s*)(=)",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+s+")(\\.)("+s+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+s+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+s+")(\\.)("+s+")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","entity.name.function","text","paren.lparen"],regex:"(function)(\\s+)("+s+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","paren.lparen"],regex:"("+s+")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:"keyword",regex:"from(?=\\s*('|\"))"},{token:"keyword",regex:"(?:case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void)\\b",next:"start"},{token:["support.constant"],regex:/that\b/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/},{token:t,regex:s},{token:"punctuation.operator",regex:/[.](?![.])/,next:"property"},{token:"storage.type",regex:/=>/,next:"start"},{token:"keyword.operator",regex:/--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,next:"start"},{token:"punctuation.operator",regex:/[?:,;.]/,next:"start"},{token:"paren.lparen",regex:/[\[({]/,next:"start"},{token:"paren.rparen",regex:/[\])}]/},{token:"comment",regex:/^#!.*$/}],property:[{token:"text",regex:"\\s+"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+s+")(\\.)("+s+")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",next:"function_arguments"},{token:"punctuation.operator",regex:/[.](?![.])/},{token:"support.function",regex:/(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/},{token:"support.function.dom",regex:/(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:"support.constant",regex:/(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/},{token:"identifier",regex:s},{regex:"",token:"empty",next:"no_regex"}],start:[o.getStartRule("doc-start"),c("start"),{token:"string.regexp",regex:"\\/",next:"regex"},{token:"text",regex:"\\s+|^$",next:"start"},{token:"empty",regex:"",next:"no_regex"}],regex:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/[sxngimy]*",next:"no_regex"},{token:"invalid",regex:/\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/},{token:"constant.language.delimiter",regex:/\|/},{token:"constant.language.escape",regex:/\[\^?/,next:"regex_character_class"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp"}],regex_character_class:[{token:"regexp.charclass.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:"]",next:"regex"},{token:"constant.language.escape",regex:"-"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp.charachterclass"}],function_arguments:[{token:"variable.parameter",regex:s},{token:"punctuation.operator",regex:"[, ]+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],qqstring:[{token:"constant.language.escape",regex:n},{token:"string",regex:"\\\\$",consumeLineEnd:!0},{token:"string",regex:'"|$',next:"no_regex"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:n},{token:"string",regex:"\\\\$",consumeLineEnd:!0},{token:"string",regex:"'|$",next:"no_regex"},{defaultToken:"string"}]},e&&e.noES6||(this.$rules.no_regex.unshift({regex:"[{}]",onMatch:function(e,t,n){if(this.next="{"==e?this.nextState:"","{"==e&&n.length)n.unshift("start",t);else if("}"==e&&n.length&&(n.shift(),this.next=n.shift(),-1!=this.next.indexOf("string")||-1!=this.next.indexOf("jsx")))return"paren.quasi.end";return"{"==e?"paren.lparen":"paren.rparen"},nextState:"start"},{token:"string.quasi.start",regex:/`/,push:[{token:"constant.language.escape",regex:n},{token:"paren.quasi.start",regex:/\${/,push:"start"},{token:"string.quasi.end",regex:/`/,next:"pop"},{defaultToken:"string.quasi"}]}),e&&0==e.jsx||l.call(this)),this.embedRules(o,"doc-",[o.getEndRule("no_regex")]),this.normalizeRules()};function l(){var e=s.replace("\\d","\\d\\-"),t={onMatch:function(e,t,n){var i="/"==e.charAt(1)?2:1;return 1==i?(t!=this.nextState?n.unshift(this.next,this.nextState,0):n.unshift(this.next),n[2]++):2==i&&t==this.nextState&&(n[1]--,(!n[1]||n[1]<0)&&(n.shift(),n.shift())),[{type:"meta.tag.punctuation."+(1==i?"":"end-")+"tag-open.xml",value:e.slice(0,i)},{type:"meta.tag.tag-name.xml",value:e.substr(i)}]},regex:"</?"+e,next:"jsxAttributes",nextState:"jsx"};this.$rules.start.unshift(t);var n={regex:"{",token:"paren.quasi.start",push:"start"};this.$rules.jsx=[n,t,{include:"reference"},{defaultToken:"string"}],this.$rules.jsxAttributes=[{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",onMatch:function(e,t,n){return t==n[0]&&n.shift(),2==e.length&&(n[0]==this.nextState&&n[1]--,(!n[1]||n[1]<0)&&n.splice(0,2)),this.next=n[0]||"start",[{type:this.token,value:e}]},nextState:"jsx"},n,c("jsxAttributes"),{token:"entity.other.attribute-name.xml",regex:e},{token:"keyword.operator.attribute-equals.xml",regex:"="},{token:"text.tag-whitespace.xml",regex:"\\s+"},{token:"string.attribute-value.xml",regex:"'",stateName:"jsx_attr_q",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',stateName:"jsx_attr_qq",push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},t],this.$rules.reference=[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}]}function c(e){return[{token:"comment",regex:/\/\*/,next:[o.getTagRule(),{token:"comment",regex:"\\*\\/",next:e||"pop"},{defaultToken:"comment",caseInsensitive:!0}]},{token:"comment",regex:"\\/\\/",next:[o.getTagRule(),{token:"comment",regex:"$|^",next:e||"pop"},{defaultToken:"comment",caseInsensitive:!0}]}]}i.inherits(a,r),t.JavaScriptHighlightRules=a})),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],(function(e,t,n){"use strict";var i=e("../range").Range,o=function(){};(function(){this.checkOutdent=function(e,t){return!!/^\s+$/.test(e)&&/^\s*\}/.test(t)},this.autoOutdent=function(e,t){var n=e.getLine(t).match(/^(\s*\})/);if(!n)return 0;var o=n[1].length,r=e.findMatchingBracket({row:t,column:o});if(!r||r.row==t)return 0;var s=this.$getIndent(e.getLine(r.row));e.replace(new i(t,0,t,o-1),s)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(o.prototype),t.MatchingBraceOutdent=o})),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],(function(e,t,n){"use strict";var i=e("../../lib/oop"),o=e("../../range").Range,r=e("./fold_mode").FoldMode,s=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};i.inherits(s,r),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var i=e.getLine(n);if(this.singleLineBlockCommentRe.test(i)&&!this.startRegionRe.test(i)&&!this.tripleStarBlockCommentRe.test(i))return"";var o=this._getFoldWidgetBase(e,t,n);return!o&&this.startRegionRe.test(i)?"start":o},this.getFoldWidgetRange=function(e,t,n,i){var o,r=e.getLine(n);if(this.startRegionRe.test(r))return this.getCommentRegionBlock(e,r,n);if(o=r.match(this.foldingStartMarker)){var s=o.index;if(o[1])return this.openingBracketBlock(e,o[1],n,s);var a=e.getCommentFoldRange(n,s+o[0].length,1);return a&&!a.isMultiLine()&&(i?a=this.getSectionRange(e,n):"all"!=t&&(a=null)),a}return"markbegin"!==t&&(o=r.match(this.foldingStopMarker))?(s=o.index+o[0].length,o[1]?this.closingBracketBlock(e,o[1],n,s):e.getCommentFoldRange(n,s,-1)):void 0},this.getSectionRange=function(e,t){for(var n=e.getLine(t),i=n.search(/\S/),r=t,s=n.length,a=t+=1,l=e.getLength();++t<l;){var c=(n=e.getLine(t)).search(/\S/);if(-1!==c){if(i>c)break;var u=this.getFoldWidgetRange(e,"all",t);if(u){if(u.start.row<=r)break;if(u.isMultiLine())t=u.end.row;else if(i==c)break}a=t}}return new o(r,s,a,e.getLine(a).length)},this.getCommentRegionBlock=function(e,t,n){for(var i=t.search(/\s*$/),r=e.getLength(),s=n,a=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,l=1;++n<r;){t=e.getLine(n);var c=a.exec(t);if(c&&(c[1]?l--:l++,!l))break}if(n>s)return new o(s,i,n,t.length)}}.call(s.prototype)})),ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],(function(e,t,n){"use strict";var i=e("../lib/oop"),o=e("./text").Mode,r=e("./javascript_highlight_rules").JavaScriptHighlightRules,s=e("./matching_brace_outdent").MatchingBraceOutdent,a=e("../worker/worker_client").WorkerClient,l=e("./behaviour/cstyle").CstyleBehaviour,c=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=r,this.$outdent=new s,this.$behaviour=new l,this.foldingRules=new c};i.inherits(u,o),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.$quotes={'"':'"',"'":"'","`":"`"},this.getNextLineIndent=function(e,t,n){var i=this.$getIndent(t),o=this.getTokenizer().getLineTokens(t,e),r=o.tokens,s=o.state;if(r.length&&"comment"==r[r.length-1].type)return i;if("start"==e||"no_regex"==e)(a=t.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/))&&(i+=n);else if("doc-start"==e){if("start"==s||"no_regex"==s)return"";var a;(a=t.match(/^\s*(\/?)\*/))&&(a[1]&&(i+=" "),i+="* ")}return i},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new a(["ace"],"ace/mode/javascript_worker","JavaScriptWorker");return t.attachToDocument(e.getDocument()),t.on("annotate",(function(t){e.setAnnotations(t.data)})),t.on("terminate",(function(){e.clearAnnotations()})),t},this.$id="ace/mode/javascript",this.snippetFileId="ace/snippets/javascript"}.call(u.prototype),t.Mode=u})),ace.require(["ace/mode/javascript"],(function(t){e&&(e.exports=t)}))},1727:function(e,t,n){e=n.nmd(e),ace.define("ace/snippets/css",["require","exports","module"],(function(e,t,n){"use strict";t.snippetText="snippet .\n\t${1} {\n\t\t${2}\n\t}\nsnippet !\n\t !important\nsnippet bdi:m+\n\t-moz-border-image: url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${7:stretch};\nsnippet bdi:m\n\t-moz-border-image: ${1};\nsnippet bdrz:m\n\t-moz-border-radius: ${1};\nsnippet bxsh:m+\n\t-moz-box-shadow: ${1:0} ${2:0} ${3:0} #${4:000};\nsnippet bxsh:m\n\t-moz-box-shadow: ${1};\nsnippet bdi:w+\n\t-webkit-border-image: url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${7:stretch};\nsnippet bdi:w\n\t-webkit-border-image: ${1};\nsnippet bdrz:w\n\t-webkit-border-radius: ${1};\nsnippet bxsh:w+\n\t-webkit-box-shadow: ${1:0} ${2:0} ${3:0} #${4:000};\nsnippet bxsh:w\n\t-webkit-box-shadow: ${1};\nsnippet @f\n\t@font-face {\n\t\tfont-family: ${1};\n\t\tsrc: url(${2});\n\t}\nsnippet @i\n\t@import url(${1});\nsnippet @m\n\t@media ${1:print} {\n\t\t${2}\n\t}\nsnippet bg+\n\tbackground: #${1:FFF} url(${2}) ${3:0} ${4:0} ${5:no-repeat};\nsnippet bga\n\tbackground-attachment: ${1};\nsnippet bga:f\n\tbackground-attachment: fixed;\nsnippet bga:s\n\tbackground-attachment: scroll;\nsnippet bgbk\n\tbackground-break: ${1};\nsnippet bgbk:bb\n\tbackground-break: bounding-box;\nsnippet bgbk:c\n\tbackground-break: continuous;\nsnippet bgbk:eb\n\tbackground-break: each-box;\nsnippet bgcp\n\tbackground-clip: ${1};\nsnippet bgcp:bb\n\tbackground-clip: border-box;\nsnippet bgcp:cb\n\tbackground-clip: content-box;\nsnippet bgcp:nc\n\tbackground-clip: no-clip;\nsnippet bgcp:pb\n\tbackground-clip: padding-box;\nsnippet bgc\n\tbackground-color: #${1:FFF};\nsnippet bgc:t\n\tbackground-color: transparent;\nsnippet bgi\n\tbackground-image: url(${1});\nsnippet bgi:n\n\tbackground-image: none;\nsnippet bgo\n\tbackground-origin: ${1};\nsnippet bgo:bb\n\tbackground-origin: border-box;\nsnippet bgo:cb\n\tbackground-origin: content-box;\nsnippet bgo:pb\n\tbackground-origin: padding-box;\nsnippet bgpx\n\tbackground-position-x: ${1};\nsnippet bgpy\n\tbackground-position-y: ${1};\nsnippet bgp\n\tbackground-position: ${1:0} ${2:0};\nsnippet bgr\n\tbackground-repeat: ${1};\nsnippet bgr:n\n\tbackground-repeat: no-repeat;\nsnippet bgr:x\n\tbackground-repeat: repeat-x;\nsnippet bgr:y\n\tbackground-repeat: repeat-y;\nsnippet bgr:r\n\tbackground-repeat: repeat;\nsnippet bgz\n\tbackground-size: ${1};\nsnippet bgz:a\n\tbackground-size: auto;\nsnippet bgz:ct\n\tbackground-size: contain;\nsnippet bgz:cv\n\tbackground-size: cover;\nsnippet bg\n\tbackground: ${1};\nsnippet bg:ie\n\tfilter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='${1}',sizingMethod='${2:crop}');\nsnippet bg:n\n\tbackground: none;\nsnippet bd+\n\tborder: ${1:1px} ${2:solid} #${3:000};\nsnippet bdb+\n\tborder-bottom: ${1:1px} ${2:solid} #${3:000};\nsnippet bdbc\n\tborder-bottom-color: #${1:000};\nsnippet bdbi\n\tborder-bottom-image: url(${1});\nsnippet bdbi:n\n\tborder-bottom-image: none;\nsnippet bdbli\n\tborder-bottom-left-image: url(${1});\nsnippet bdbli:c\n\tborder-bottom-left-image: continue;\nsnippet bdbli:n\n\tborder-bottom-left-image: none;\nsnippet bdblrz\n\tborder-bottom-left-radius: ${1};\nsnippet bdbri\n\tborder-bottom-right-image: url(${1});\nsnippet bdbri:c\n\tborder-bottom-right-image: continue;\nsnippet bdbri:n\n\tborder-bottom-right-image: none;\nsnippet bdbrrz\n\tborder-bottom-right-radius: ${1};\nsnippet bdbs\n\tborder-bottom-style: ${1};\nsnippet bdbs:n\n\tborder-bottom-style: none;\nsnippet bdbw\n\tborder-bottom-width: ${1};\nsnippet bdb\n\tborder-bottom: ${1};\nsnippet bdb:n\n\tborder-bottom: none;\nsnippet bdbk\n\tborder-break: ${1};\nsnippet bdbk:c\n\tborder-break: close;\nsnippet bdcl\n\tborder-collapse: ${1};\nsnippet bdcl:c\n\tborder-collapse: collapse;\nsnippet bdcl:s\n\tborder-collapse: separate;\nsnippet bdc\n\tborder-color: #${1:000};\nsnippet bdci\n\tborder-corner-image: url(${1});\nsnippet bdci:c\n\tborder-corner-image: continue;\nsnippet bdci:n\n\tborder-corner-image: none;\nsnippet bdf\n\tborder-fit: ${1};\nsnippet bdf:c\n\tborder-fit: clip;\nsnippet bdf:of\n\tborder-fit: overwrite;\nsnippet bdf:ow\n\tborder-fit: overwrite;\nsnippet bdf:r\n\tborder-fit: repeat;\nsnippet bdf:sc\n\tborder-fit: scale;\nsnippet bdf:sp\n\tborder-fit: space;\nsnippet bdf:st\n\tborder-fit: stretch;\nsnippet bdi\n\tborder-image: url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${7:stretch};\nsnippet bdi:n\n\tborder-image: none;\nsnippet bdl+\n\tborder-left: ${1:1px} ${2:solid} #${3:000};\nsnippet bdlc\n\tborder-left-color: #${1:000};\nsnippet bdli\n\tborder-left-image: url(${1});\nsnippet bdli:n\n\tborder-left-image: none;\nsnippet bdls\n\tborder-left-style: ${1};\nsnippet bdls:n\n\tborder-left-style: none;\nsnippet bdlw\n\tborder-left-width: ${1};\nsnippet bdl\n\tborder-left: ${1};\nsnippet bdl:n\n\tborder-left: none;\nsnippet bdlt\n\tborder-length: ${1};\nsnippet bdlt:a\n\tborder-length: auto;\nsnippet bdrz\n\tborder-radius: ${1};\nsnippet bdr+\n\tborder-right: ${1:1px} ${2:solid} #${3:000};\nsnippet bdrc\n\tborder-right-color: #${1:000};\nsnippet bdri\n\tborder-right-image: url(${1});\nsnippet bdri:n\n\tborder-right-image: none;\nsnippet bdrs\n\tborder-right-style: ${1};\nsnippet bdrs:n\n\tborder-right-style: none;\nsnippet bdrw\n\tborder-right-width: ${1};\nsnippet bdr\n\tborder-right: ${1};\nsnippet bdr:n\n\tborder-right: none;\nsnippet bdsp\n\tborder-spacing: ${1};\nsnippet bds\n\tborder-style: ${1};\nsnippet bds:ds\n\tborder-style: dashed;\nsnippet bds:dtds\n\tborder-style: dot-dash;\nsnippet bds:dtdtds\n\tborder-style: dot-dot-dash;\nsnippet bds:dt\n\tborder-style: dotted;\nsnippet bds:db\n\tborder-style: double;\nsnippet bds:g\n\tborder-style: groove;\nsnippet bds:h\n\tborder-style: hidden;\nsnippet bds:i\n\tborder-style: inset;\nsnippet bds:n\n\tborder-style: none;\nsnippet bds:o\n\tborder-style: outset;\nsnippet bds:r\n\tborder-style: ridge;\nsnippet bds:s\n\tborder-style: solid;\nsnippet bds:w\n\tborder-style: wave;\nsnippet bdt+\n\tborder-top: ${1:1px} ${2:solid} #${3:000};\nsnippet bdtc\n\tborder-top-color: #${1:000};\nsnippet bdti\n\tborder-top-image: url(${1});\nsnippet bdti:n\n\tborder-top-image: none;\nsnippet bdtli\n\tborder-top-left-image: url(${1});\nsnippet bdtli:c\n\tborder-corner-image: continue;\nsnippet bdtli:n\n\tborder-corner-image: none;\nsnippet bdtlrz\n\tborder-top-left-radius: ${1};\nsnippet bdtri\n\tborder-top-right-image: url(${1});\nsnippet bdtri:c\n\tborder-top-right-image: continue;\nsnippet bdtri:n\n\tborder-top-right-image: none;\nsnippet bdtrrz\n\tborder-top-right-radius: ${1};\nsnippet bdts\n\tborder-top-style: ${1};\nsnippet bdts:n\n\tborder-top-style: none;\nsnippet bdtw\n\tborder-top-width: ${1};\nsnippet bdt\n\tborder-top: ${1};\nsnippet bdt:n\n\tborder-top: none;\nsnippet bdw\n\tborder-width: ${1};\nsnippet bd\n\tborder: ${1};\nsnippet bd:n\n\tborder: none;\nsnippet b\n\tbottom: ${1};\nsnippet b:a\n\tbottom: auto;\nsnippet bxsh+\n\tbox-shadow: ${1:0} ${2:0} ${3:0} #${4:000};\nsnippet bxsh\n\tbox-shadow: ${1};\nsnippet bxsh:n\n\tbox-shadow: none;\nsnippet bxz\n\tbox-sizing: ${1};\nsnippet bxz:bb\n\tbox-sizing: border-box;\nsnippet bxz:cb\n\tbox-sizing: content-box;\nsnippet cps\n\tcaption-side: ${1};\nsnippet cps:b\n\tcaption-side: bottom;\nsnippet cps:t\n\tcaption-side: top;\nsnippet cl\n\tclear: ${1};\nsnippet cl:b\n\tclear: both;\nsnippet cl:l\n\tclear: left;\nsnippet cl:n\n\tclear: none;\nsnippet cl:r\n\tclear: right;\nsnippet cp\n\tclip: ${1};\nsnippet cp:a\n\tclip: auto;\nsnippet cp:r\n\tclip: rect(${1:0} ${2:0} ${3:0} ${4:0});\nsnippet c\n\tcolor: #${1:000};\nsnippet ct\n\tcontent: ${1};\nsnippet ct:a\n\tcontent: attr(${1});\nsnippet ct:cq\n\tcontent: close-quote;\nsnippet ct:c\n\tcontent: counter(${1});\nsnippet ct:cs\n\tcontent: counters(${1});\nsnippet ct:ncq\n\tcontent: no-close-quote;\nsnippet ct:noq\n\tcontent: no-open-quote;\nsnippet ct:n\n\tcontent: normal;\nsnippet ct:oq\n\tcontent: open-quote;\nsnippet coi\n\tcounter-increment: ${1};\nsnippet cor\n\tcounter-reset: ${1};\nsnippet cur\n\tcursor: ${1};\nsnippet cur:a\n\tcursor: auto;\nsnippet cur:c\n\tcursor: crosshair;\nsnippet cur:d\n\tcursor: default;\nsnippet cur:ha\n\tcursor: hand;\nsnippet cur:he\n\tcursor: help;\nsnippet cur:m\n\tcursor: move;\nsnippet cur:p\n\tcursor: pointer;\nsnippet cur:t\n\tcursor: text;\nsnippet d\n\tdisplay: ${1};\nsnippet d:mib\n\tdisplay: -moz-inline-box;\nsnippet d:mis\n\tdisplay: -moz-inline-stack;\nsnippet d:b\n\tdisplay: block;\nsnippet d:cp\n\tdisplay: compact;\nsnippet d:ib\n\tdisplay: inline-block;\nsnippet d:itb\n\tdisplay: inline-table;\nsnippet d:i\n\tdisplay: inline;\nsnippet d:li\n\tdisplay: list-item;\nsnippet d:n\n\tdisplay: none;\nsnippet d:ri\n\tdisplay: run-in;\nsnippet d:tbcp\n\tdisplay: table-caption;\nsnippet d:tbc\n\tdisplay: table-cell;\nsnippet d:tbclg\n\tdisplay: table-column-group;\nsnippet d:tbcl\n\tdisplay: table-column;\nsnippet d:tbfg\n\tdisplay: table-footer-group;\nsnippet d:tbhg\n\tdisplay: table-header-group;\nsnippet d:tbrg\n\tdisplay: table-row-group;\nsnippet d:tbr\n\tdisplay: table-row;\nsnippet d:tb\n\tdisplay: table;\nsnippet ec\n\tempty-cells: ${1};\nsnippet ec:h\n\tempty-cells: hide;\nsnippet ec:s\n\tempty-cells: show;\nsnippet exp\n\texpression()\nsnippet fl\n\tfloat: ${1};\nsnippet fl:l\n\tfloat: left;\nsnippet fl:n\n\tfloat: none;\nsnippet fl:r\n\tfloat: right;\nsnippet f+\n\tfont: ${1:1em} ${2:Arial},${3:sans-serif};\nsnippet fef\n\tfont-effect: ${1};\nsnippet fef:eb\n\tfont-effect: emboss;\nsnippet fef:eg\n\tfont-effect: engrave;\nsnippet fef:n\n\tfont-effect: none;\nsnippet fef:o\n\tfont-effect: outline;\nsnippet femp\n\tfont-emphasize-position: ${1};\nsnippet femp:a\n\tfont-emphasize-position: after;\nsnippet femp:b\n\tfont-emphasize-position: before;\nsnippet fems\n\tfont-emphasize-style: ${1};\nsnippet fems:ac\n\tfont-emphasize-style: accent;\nsnippet fems:c\n\tfont-emphasize-style: circle;\nsnippet fems:ds\n\tfont-emphasize-style: disc;\nsnippet fems:dt\n\tfont-emphasize-style: dot;\nsnippet fems:n\n\tfont-emphasize-style: none;\nsnippet fem\n\tfont-emphasize: ${1};\nsnippet ff\n\tfont-family: ${1};\nsnippet ff:c\n\tfont-family: ${1:'Monotype Corsiva','Comic Sans MS'},cursive;\nsnippet ff:f\n\tfont-family: ${1:Capitals,Impact},fantasy;\nsnippet ff:m\n\tfont-family: ${1:Monaco,'Courier New'},monospace;\nsnippet ff:ss\n\tfont-family: ${1:Helvetica,Arial},sans-serif;\nsnippet ff:s\n\tfont-family: ${1:Georgia,'Times New Roman'},serif;\nsnippet fza\n\tfont-size-adjust: ${1};\nsnippet fza:n\n\tfont-size-adjust: none;\nsnippet fz\n\tfont-size: ${1};\nsnippet fsm\n\tfont-smooth: ${1};\nsnippet fsm:aw\n\tfont-smooth: always;\nsnippet fsm:a\n\tfont-smooth: auto;\nsnippet fsm:n\n\tfont-smooth: never;\nsnippet fst\n\tfont-stretch: ${1};\nsnippet fst:c\n\tfont-stretch: condensed;\nsnippet fst:e\n\tfont-stretch: expanded;\nsnippet fst:ec\n\tfont-stretch: extra-condensed;\nsnippet fst:ee\n\tfont-stretch: extra-expanded;\nsnippet fst:n\n\tfont-stretch: normal;\nsnippet fst:sc\n\tfont-stretch: semi-condensed;\nsnippet fst:se\n\tfont-stretch: semi-expanded;\nsnippet fst:uc\n\tfont-stretch: ultra-condensed;\nsnippet fst:ue\n\tfont-stretch: ultra-expanded;\nsnippet fs\n\tfont-style: ${1};\nsnippet fs:i\n\tfont-style: italic;\nsnippet fs:n\n\tfont-style: normal;\nsnippet fs:o\n\tfont-style: oblique;\nsnippet fv\n\tfont-variant: ${1};\nsnippet fv:n\n\tfont-variant: normal;\nsnippet fv:sc\n\tfont-variant: small-caps;\nsnippet fw\n\tfont-weight: ${1};\nsnippet fw:b\n\tfont-weight: bold;\nsnippet fw:br\n\tfont-weight: bolder;\nsnippet fw:lr\n\tfont-weight: lighter;\nsnippet fw:n\n\tfont-weight: normal;\nsnippet f\n\tfont: ${1};\nsnippet h\n\theight: ${1};\nsnippet h:a\n\theight: auto;\nsnippet l\n\tleft: ${1};\nsnippet l:a\n\tleft: auto;\nsnippet lts\n\tletter-spacing: ${1};\nsnippet lh\n\tline-height: ${1};\nsnippet lisi\n\tlist-style-image: url(${1});\nsnippet lisi:n\n\tlist-style-image: none;\nsnippet lisp\n\tlist-style-position: ${1};\nsnippet lisp:i\n\tlist-style-position: inside;\nsnippet lisp:o\n\tlist-style-position: outside;\nsnippet list\n\tlist-style-type: ${1};\nsnippet list:c\n\tlist-style-type: circle;\nsnippet list:dclz\n\tlist-style-type: decimal-leading-zero;\nsnippet list:dc\n\tlist-style-type: decimal;\nsnippet list:d\n\tlist-style-type: disc;\nsnippet list:lr\n\tlist-style-type: lower-roman;\nsnippet list:n\n\tlist-style-type: none;\nsnippet list:s\n\tlist-style-type: square;\nsnippet list:ur\n\tlist-style-type: upper-roman;\nsnippet lis\n\tlist-style: ${1};\nsnippet lis:n\n\tlist-style: none;\nsnippet mb\n\tmargin-bottom: ${1};\nsnippet mb:a\n\tmargin-bottom: auto;\nsnippet ml\n\tmargin-left: ${1};\nsnippet ml:a\n\tmargin-left: auto;\nsnippet mr\n\tmargin-right: ${1};\nsnippet mr:a\n\tmargin-right: auto;\nsnippet mt\n\tmargin-top: ${1};\nsnippet mt:a\n\tmargin-top: auto;\nsnippet m\n\tmargin: ${1};\nsnippet m:4\n\tmargin: ${1:0} ${2:0} ${3:0} ${4:0};\nsnippet m:3\n\tmargin: ${1:0} ${2:0} ${3:0};\nsnippet m:2\n\tmargin: ${1:0} ${2:0};\nsnippet m:0\n\tmargin: 0;\nsnippet m:a\n\tmargin: auto;\nsnippet mah\n\tmax-height: ${1};\nsnippet mah:n\n\tmax-height: none;\nsnippet maw\n\tmax-width: ${1};\nsnippet maw:n\n\tmax-width: none;\nsnippet mih\n\tmin-height: ${1};\nsnippet miw\n\tmin-width: ${1};\nsnippet op\n\topacity: ${1};\nsnippet op:ie\n\tfilter: progid:DXImageTransform.Microsoft.Alpha(Opacity=${1:100});\nsnippet op:ms\n\t-ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=${1:100})';\nsnippet orp\n\torphans: ${1};\nsnippet o+\n\toutline: ${1:1px} ${2:solid} #${3:000};\nsnippet oc\n\toutline-color: ${1:#000};\nsnippet oc:i\n\toutline-color: invert;\nsnippet oo\n\toutline-offset: ${1};\nsnippet os\n\toutline-style: ${1};\nsnippet ow\n\toutline-width: ${1};\nsnippet o\n\toutline: ${1};\nsnippet o:n\n\toutline: none;\nsnippet ovs\n\toverflow-style: ${1};\nsnippet ovs:a\n\toverflow-style: auto;\nsnippet ovs:mq\n\toverflow-style: marquee;\nsnippet ovs:mv\n\toverflow-style: move;\nsnippet ovs:p\n\toverflow-style: panner;\nsnippet ovs:s\n\toverflow-style: scrollbar;\nsnippet ovx\n\toverflow-x: ${1};\nsnippet ovx:a\n\toverflow-x: auto;\nsnippet ovx:h\n\toverflow-x: hidden;\nsnippet ovx:s\n\toverflow-x: scroll;\nsnippet ovx:v\n\toverflow-x: visible;\nsnippet ovy\n\toverflow-y: ${1};\nsnippet ovy:a\n\toverflow-y: auto;\nsnippet ovy:h\n\toverflow-y: hidden;\nsnippet ovy:s\n\toverflow-y: scroll;\nsnippet ovy:v\n\toverflow-y: visible;\nsnippet ov\n\toverflow: ${1};\nsnippet ov:a\n\toverflow: auto;\nsnippet ov:h\n\toverflow: hidden;\nsnippet ov:s\n\toverflow: scroll;\nsnippet ov:v\n\toverflow: visible;\nsnippet pb\n\tpadding-bottom: ${1};\nsnippet pl\n\tpadding-left: ${1};\nsnippet pr\n\tpadding-right: ${1};\nsnippet pt\n\tpadding-top: ${1};\nsnippet p\n\tpadding: ${1};\nsnippet p:4\n\tpadding: ${1:0} ${2:0} ${3:0} ${4:0};\nsnippet p:3\n\tpadding: ${1:0} ${2:0} ${3:0};\nsnippet p:2\n\tpadding: ${1:0} ${2:0};\nsnippet p:0\n\tpadding: 0;\nsnippet pgba\n\tpage-break-after: ${1};\nsnippet pgba:aw\n\tpage-break-after: always;\nsnippet pgba:a\n\tpage-break-after: auto;\nsnippet pgba:l\n\tpage-break-after: left;\nsnippet pgba:r\n\tpage-break-after: right;\nsnippet pgbb\n\tpage-break-before: ${1};\nsnippet pgbb:aw\n\tpage-break-before: always;\nsnippet pgbb:a\n\tpage-break-before: auto;\nsnippet pgbb:l\n\tpage-break-before: left;\nsnippet pgbb:r\n\tpage-break-before: right;\nsnippet pgbi\n\tpage-break-inside: ${1};\nsnippet pgbi:a\n\tpage-break-inside: auto;\nsnippet pgbi:av\n\tpage-break-inside: avoid;\nsnippet pos\n\tposition: ${1};\nsnippet pos:a\n\tposition: absolute;\nsnippet pos:f\n\tposition: fixed;\nsnippet pos:r\n\tposition: relative;\nsnippet pos:s\n\tposition: static;\nsnippet q\n\tquotes: ${1};\nsnippet q:en\n\tquotes: '\\201C' '\\201D' '\\2018' '\\2019';\nsnippet q:n\n\tquotes: none;\nsnippet q:ru\n\tquotes: '\\00AB' '\\00BB' '\\201E' '\\201C';\nsnippet rz\n\tresize: ${1};\nsnippet rz:b\n\tresize: both;\nsnippet rz:h\n\tresize: horizontal;\nsnippet rz:n\n\tresize: none;\nsnippet rz:v\n\tresize: vertical;\nsnippet r\n\tright: ${1};\nsnippet r:a\n\tright: auto;\nsnippet tbl\n\ttable-layout: ${1};\nsnippet tbl:a\n\ttable-layout: auto;\nsnippet tbl:f\n\ttable-layout: fixed;\nsnippet tal\n\ttext-align-last: ${1};\nsnippet tal:a\n\ttext-align-last: auto;\nsnippet tal:c\n\ttext-align-last: center;\nsnippet tal:l\n\ttext-align-last: left;\nsnippet tal:r\n\ttext-align-last: right;\nsnippet ta\n\ttext-align: ${1};\nsnippet ta:c\n\ttext-align: center;\nsnippet ta:l\n\ttext-align: left;\nsnippet ta:r\n\ttext-align: right;\nsnippet td\n\ttext-decoration: ${1};\nsnippet td:l\n\ttext-decoration: line-through;\nsnippet td:n\n\ttext-decoration: none;\nsnippet td:o\n\ttext-decoration: overline;\nsnippet td:u\n\ttext-decoration: underline;\nsnippet te\n\ttext-emphasis: ${1};\nsnippet te:ac\n\ttext-emphasis: accent;\nsnippet te:a\n\ttext-emphasis: after;\nsnippet te:b\n\ttext-emphasis: before;\nsnippet te:c\n\ttext-emphasis: circle;\nsnippet te:ds\n\ttext-emphasis: disc;\nsnippet te:dt\n\ttext-emphasis: dot;\nsnippet te:n\n\ttext-emphasis: none;\nsnippet th\n\ttext-height: ${1};\nsnippet th:a\n\ttext-height: auto;\nsnippet th:f\n\ttext-height: font-size;\nsnippet th:m\n\ttext-height: max-size;\nsnippet th:t\n\ttext-height: text-size;\nsnippet ti\n\ttext-indent: ${1};\nsnippet ti:-\n\ttext-indent: -9999px;\nsnippet tj\n\ttext-justify: ${1};\nsnippet tj:a\n\ttext-justify: auto;\nsnippet tj:d\n\ttext-justify: distribute;\nsnippet tj:ic\n\ttext-justify: inter-cluster;\nsnippet tj:ii\n\ttext-justify: inter-ideograph;\nsnippet tj:iw\n\ttext-justify: inter-word;\nsnippet tj:k\n\ttext-justify: kashida;\nsnippet tj:t\n\ttext-justify: tibetan;\nsnippet to+\n\ttext-outline: ${1:0} ${2:0} #${3:000};\nsnippet to\n\ttext-outline: ${1};\nsnippet to:n\n\ttext-outline: none;\nsnippet tr\n\ttext-replace: ${1};\nsnippet tr:n\n\ttext-replace: none;\nsnippet tsh+\n\ttext-shadow: ${1:0} ${2:0} ${3:0} #${4:000};\nsnippet tsh\n\ttext-shadow: ${1};\nsnippet tsh:n\n\ttext-shadow: none;\nsnippet tt\n\ttext-transform: ${1};\nsnippet tt:c\n\ttext-transform: capitalize;\nsnippet tt:l\n\ttext-transform: lowercase;\nsnippet tt:n\n\ttext-transform: none;\nsnippet tt:u\n\ttext-transform: uppercase;\nsnippet tw\n\ttext-wrap: ${1};\nsnippet tw:no\n\ttext-wrap: none;\nsnippet tw:n\n\ttext-wrap: normal;\nsnippet tw:s\n\ttext-wrap: suppress;\nsnippet tw:u\n\ttext-wrap: unrestricted;\nsnippet t\n\ttop: ${1};\nsnippet t:a\n\ttop: auto;\nsnippet va\n\tvertical-align: ${1};\nsnippet va:bl\n\tvertical-align: baseline;\nsnippet va:b\n\tvertical-align: bottom;\nsnippet va:m\n\tvertical-align: middle;\nsnippet va:sub\n\tvertical-align: sub;\nsnippet va:sup\n\tvertical-align: super;\nsnippet va:tb\n\tvertical-align: text-bottom;\nsnippet va:tt\n\tvertical-align: text-top;\nsnippet va:t\n\tvertical-align: top;\nsnippet v\n\tvisibility: ${1};\nsnippet v:c\n\tvisibility: collapse;\nsnippet v:h\n\tvisibility: hidden;\nsnippet v:v\n\tvisibility: visible;\nsnippet whsc\n\twhite-space-collapse: ${1};\nsnippet whsc:ba\n\twhite-space-collapse: break-all;\nsnippet whsc:bs\n\twhite-space-collapse: break-strict;\nsnippet whsc:k\n\twhite-space-collapse: keep-all;\nsnippet whsc:l\n\twhite-space-collapse: loose;\nsnippet whsc:n\n\twhite-space-collapse: normal;\nsnippet whs\n\twhite-space: ${1};\nsnippet whs:n\n\twhite-space: normal;\nsnippet whs:nw\n\twhite-space: nowrap;\nsnippet whs:pl\n\twhite-space: pre-line;\nsnippet whs:pw\n\twhite-space: pre-wrap;\nsnippet whs:p\n\twhite-space: pre;\nsnippet wid\n\twidows: ${1};\nsnippet w\n\twidth: ${1};\nsnippet w:a\n\twidth: auto;\nsnippet wob\n\tword-break: ${1};\nsnippet wob:ba\n\tword-break: break-all;\nsnippet wob:bs\n\tword-break: break-strict;\nsnippet wob:k\n\tword-break: keep-all;\nsnippet wob:l\n\tword-break: loose;\nsnippet wob:n\n\tword-break: normal;\nsnippet wos\n\tword-spacing: ${1};\nsnippet wow\n\tword-wrap: ${1};\nsnippet wow:no\n\tword-wrap: none;\nsnippet wow:n\n\tword-wrap: normal;\nsnippet wow:s\n\tword-wrap: suppress;\nsnippet wow:u\n\tword-wrap: unrestricted;\nsnippet z\n\tz-index: ${1};\nsnippet z:a\n\tz-index: auto;\nsnippet zoo\n\tzoom: 1;\n",t.scope="css"})),ace.require(["ace/snippets/css"],(function(t){e&&(e.exports=t)}))},6826:function(e,t,n){e=n.nmd(e),ace.define("ace/snippets/javascript",["require","exports","module"],(function(e,t,n){"use strict";t.snippetText='# Prototype\nsnippet proto\n\t${1:class_name}.prototype.${2:method_name} = function(${3:first_argument}) {\n\t\t${4:// body...}\n\t};\n# Function\nsnippet fun\n\tfunction ${1?:function_name}(${2:argument}) {\n\t\t${3:// body...}\n\t}\n# Anonymous Function\nregex /((=)\\s*|(:)\\s*|(\\()|\\b)/f/(\\))?/\nsnippet f\n\tfunction${M1?: ${1:functionName}}($2) {\n\t\t${0:$TM_SELECTED_TEXT}\n\t}${M2?;}${M3?,}${M4?)}\n# Immediate function\ntrigger \\(?f\\(\nendTrigger \\)?\nsnippet f(\n\t(function(${1}) {\n\t\t${0:${TM_SELECTED_TEXT:/* code */}}\n\t}(${1}));\n# if\nsnippet if\n\tif (${1:true}) {\n\t\t${0}\n\t}\n# if ... else\nsnippet ife\n\tif (${1:true}) {\n\t\t${2}\n\t} else {\n\t\t${0}\n\t}\n# tertiary conditional\nsnippet ter\n\t${1:/* condition */} ? ${2:a} : ${3:b}\n# switch\nsnippet switch\n\tswitch (${1:expression}) {\n\t\tcase \'${3:case}\':\n\t\t\t${4:// code}\n\t\t\tbreak;\n\t\t${5}\n\t\tdefault:\n\t\t\t${2:// code}\n\t}\n# case\nsnippet case\n\tcase \'${1:case}\':\n\t\t${2:// code}\n\t\tbreak;\n\t${3}\n\n# while (...) {...}\nsnippet wh\n\twhile (${1:/* condition */}) {\n\t\t${0:/* code */}\n\t}\n# try\nsnippet try\n\ttry {\n\t\t${0:/* code */}\n\t} catch (e) {}\n# do...while\nsnippet do\n\tdo {\n\t\t${2:/* code */}\n\t} while (${1:/* condition */});\n# Object Method\nsnippet :f\nregex /([,{[])|^\\s*/:f/\n\t${1:method_name}: function(${2:attribute}) {\n\t\t${0}\n\t}${3:,}\n# setTimeout function\nsnippet setTimeout\nregex /\\b/st|timeout|setTimeo?u?t?/\n\tsetTimeout(function() {${3:$TM_SELECTED_TEXT}}, ${1:10});\n# Get Elements\nsnippet gett\n\tgetElementsBy${1:TagName}(\'${2}\')${3}\n# Get Element\nsnippet get\n\tgetElementBy${1:Id}(\'${2}\')${3}\n# console.log (Firebug)\nsnippet cl\n\tconsole.log(${1});\n# return\nsnippet ret\n\treturn ${1:result}\n# for (property in object ) { ... }\nsnippet fori\n\tfor (var ${1:prop} in ${2:Things}) {\n\t\t${0:$2[$1]}\n\t}\n# hasOwnProperty\nsnippet has\n\thasOwnProperty(${1})\n# docstring\nsnippet /**\n\t/**\n\t * ${1:description}\n\t *\n\t */\nsnippet @par\nregex /^\\s*\\*\\s*/@(para?m?)?/\n\t@param {${1:type}} ${2:name} ${3:description}\nsnippet @ret\n\t@return {${1:type}} ${2:description}\n# JSON.parse\nsnippet jsonp\n\tJSON.parse(${1:jstr});\n# JSON.stringify\nsnippet jsons\n\tJSON.stringify(${1:object});\n# self-defining function\nsnippet sdf\n\tvar ${1:function_name} = function(${2:argument}) {\n\t\t${3:// initial code ...}\n\n\t\t$1 = function($2) {\n\t\t\t${4:// main code}\n\t\t};\n\t}\n# singleton\nsnippet sing\n\tfunction ${1:Singleton} (${2:argument}) {\n\t\t// the cached instance\n\t\tvar instance;\n\n\t\t// rewrite the constructor\n\t\t$1 = function $1($2) {\n\t\t\treturn instance;\n\t\t};\n\t\t\n\t\t// carry over the prototype properties\n\t\t$1.prototype = this;\n\n\t\t// the instance\n\t\tinstance = new $1();\n\n\t\t// reset the constructor pointer\n\t\tinstance.constructor = $1;\n\n\t\t${3:// code ...}\n\n\t\treturn instance;\n\t}\n# class\nsnippet class\nregex /^\\s*/clas{0,2}/\n\tvar ${1:class} = function(${20}) {\n\t\t$40$0\n\t};\n\t\n\t(function() {\n\t\t${60:this.prop = ""}\n\t}).call(${1:class}.prototype);\n\t\n\texports.${1:class} = ${1:class};\n# \nsnippet for-\n\tfor (var ${1:i} = ${2:Things}.length; ${1:i}--; ) {\n\t\t${0:${2:Things}[${1:i}];}\n\t}\n# for (...) {...}\nsnippet for\n\tfor (var ${1:i} = 0; $1 < ${2:Things}.length; $1++) {\n\t\t${3:$2[$1]}$0\n\t}\n# for (...) {...} (Improved Native For-Loop)\nsnippet forr\n\tfor (var ${1:i} = ${2:Things}.length - 1; $1 >= 0; $1--) {\n\t\t${3:$2[$1]}$0\n\t}\n\n\n#modules\nsnippet def\n\tdefine(function(require, exports, module) {\n\t"use strict";\n\tvar ${1/.*\\///} = require("${1}");\n\t\n\t$TM_SELECTED_TEXT\n\t});\nsnippet req\nguard ^\\s*\n\tvar ${1/.*\\///} = require("${1}");\n\t$0\nsnippet requ\nguard ^\\s*\n\tvar ${1/.*\\/(.)/\\u$1/} = require("${1}").${1/.*\\/(.)/\\u$1/};\n\t$0\n',t.scope="javascript"})),ace.require(["ace/snippets/javascript"],(function(t){e&&(e.exports=t)}))},8253:function(e,t,n){e=n.nmd(e),ace.require(["ace/snippets/text"],(function(t){e&&(e.exports=t)}))},5720:function(e,t,n){"use strict";var i=n(1098);function o(){var e={},t=0,n=0,i=0;return{add:function(o,r){r||(r=o,o=0),o>n?n=o:o<i&&(i=o),e[o]||(e[o]=[]),e[o].push(r),t++},process:function(){for(var t=i;t<=n;t++)for(var o=e[t],r=0;r<o.length;r++)(0,o[r])()},size:function(){return t}}}e.exports=function(e){var t=(e=e||{}).reporter,n=i.getOption(e,"async",!0),r=i.getOption(e,"auto",!0);r&&!n&&(t&&t.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true."),n=!0);var s,a=o(),l=!1;function c(){for(l=!0;a.size();){var e=a;a=o(),e.process()}l=!1}function u(){s=setTimeout(c,0)}return{add:function(e,t){!l&&r&&n&&0===a.size()&&u(),a.add(e,t)},force:function(e){l||(void 0===e&&(e=n),s&&(clearTimeout(s),s=null),e?u():c())}}}},1098:function(e){"use strict";(e.exports={}).getOption=function(e,t,n){var i=e[t];return null==i&&void 0!==n?n:i}},7708:function(e,t){var n;!function(){"use strict";var i=function(){function e(){}function t(e,t){for(var n=t.length,i=0;i<n;++i)o(e,t[i])}e.prototype=Object.create(null);var n={}.hasOwnProperty,i=/\s+/;function o(e,o){if(o){var r=typeof o;"string"===r?function(e,t){for(var n=t.split(i),o=n.length,r=0;r<o;++r)e[n[r]]=!0}(e,o):Array.isArray(o)?t(e,o):"object"===r?function(e,t){if(t.toString===Object.prototype.toString)for(var i in t)n.call(t,i)&&(e[i]=!!t[i]);else e[t.toString()]=!0}(e,o):"number"===r&&function(e,t){e[t]=!0}(e,o)}}return function(){for(var n=arguments.length,i=Array(n),o=0;o<n;o++)i[o]=arguments[o];var r=new e;t(r,i);var s=[];for(var a in r)r[a]&&s.push(a);return s.join(" ")}}();e.exports?(i.default=i,e.exports=i):void 0===(n=function(){return i}.apply(t,[]))||(e.exports=n)}()},6362:function(e,t,n){"use strict";var i=n(5535),o={};function r(e,t,n,i,o,r,s,a){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,i,o,r,s,a],u=0;(l=new Error(t.replace(/%s/g,(function(){return c[u++]})))).name="Invariant Violation"}throw l.framesToPop=1,l}}var s="mixins";e.exports=function(e,t,n){var a=[],l={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",UNSAFE_componentWillMount:"DEFINE_MANY",UNSAFE_componentWillReceiveProps:"DEFINE_MANY",UNSAFE_componentWillUpdate:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},c={getDerivedStateFromProps:"DEFINE_MANY_MERGED"},u={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n<t.length;n++)d(e,t[n])},childContextTypes:function(e,t){e.childContextTypes=i({},e.childContextTypes,t)},contextTypes:function(e,t){e.contextTypes=i({},e.contextTypes,t)},getDefaultProps:function(e,t){e.getDefaultProps?e.getDefaultProps=f(e.getDefaultProps,t):e.getDefaultProps=t},propTypes:function(e,t){e.propTypes=i({},e.propTypes,t)},statics:function(e,t){!function(e,t){if(t)for(var n in t){var i=t[n];if(t.hasOwnProperty(n)){if(r(!(n in u),'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n),n in e)return r("DEFINE_MANY_MERGED"===(c.hasOwnProperty(n)?c[n]:null),"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),void(e[n]=f(e[n],i));e[n]=i}}}(e,t)},autobind:function(){}};function h(e,t){var n=l.hasOwnProperty(t)?l[t]:null;w.hasOwnProperty(t)&&r("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&r("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function d(e,n){if(n){r("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),r(!t(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var i=e.prototype,o=i.__reactAutoBindPairs;for(var a in n.hasOwnProperty(s)&&u.mixins(e,n.mixins),n)if(n.hasOwnProperty(a)&&a!==s){var c=n[a],d=i.hasOwnProperty(a);if(h(d,a),u.hasOwnProperty(a))u[a](e,c);else{var p=l.hasOwnProperty(a);if("function"!=typeof c||p||d||!1===n.autobind)if(d){var m=l[a];r(p&&("DEFINE_MANY_MERGED"===m||"DEFINE_MANY"===m),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",m,a),"DEFINE_MANY_MERGED"===m?i[a]=f(i[a],c):"DEFINE_MANY"===m&&(i[a]=g(i[a],c))}else i[a]=c;else o.push(a,c),i[a]=c}}}}function p(e,t){for(var n in r(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects."),t)t.hasOwnProperty(n)&&(r(void 0===e[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),e[n]=t[n]);return e}function f(e,t){return function(){var n=e.apply(this,arguments),i=t.apply(this,arguments);if(null==n)return i;if(null==i)return n;var o={};return p(o,n),p(o,i),o}}function g(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function m(e,t){return t.bind(e)}var v={componentDidMount:function(){this.__isMounted=!0}},b={componentWillUnmount:function(){this.__isMounted=!1}},w={replaceState:function(e,t){this.updater.enqueueReplaceState(this,e,t)},isMounted:function(){return!!this.__isMounted}},y=function(){};return i(y.prototype,e.prototype,w),function(e){var t=function(e,i,s){this.__reactAutoBindPairs.length&&function(e){for(var t=e.__reactAutoBindPairs,n=0;n<t.length;n+=2){var i=t[n],o=t[n+1];e[i]=m(e,o)}}(this),this.props=e,this.context=i,this.refs=o,this.updater=s||n,this.state=null;var a=this.getInitialState?this.getInitialState():null;r("object"==typeof a&&!Array.isArray(a),"%s.getInitialState(): must return an object or null",t.displayName||"ReactCompositeComponent"),this.state=a};for(var i in t.prototype=new y,t.prototype.constructor=t,t.prototype.__reactAutoBindPairs=[],a.forEach(d.bind(null,t)),d(t,v),d(t,e),d(t,b),t.getDefaultProps&&(t.defaultProps=t.getDefaultProps()),r(t.prototype.render,"createClass(...): Class specification must implement a `render` method."),l)t.prototype[i]||(t.prototype[i]=null);return t}}},1e3:function(e,t,n){"use strict";var i=n(7363),o=n(6362);if(void 0===i)throw Error("create-react-class could not find the React object. If you are using script tags, make sure that React is being loaded before create-react-class.");var r=(new i.Component).updater;e.exports=o(i.Component,i.isValidElement,r)},5788:function(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,i){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(i)for(var r=0;r<this.length;r++){var s=this[r][0];null!=s&&(o[s]=!0)}for(var a=0;a<e.length;a++){var l=[].concat(e[a]);i&&o[l[0]]||(n&&(l[2]?l[2]="".concat(n," and ").concat(l[2]):l[2]=n),t.push(l))}},t}},9476:function(e,t,n){var i,o;!function(r,s){"use strict";void 0===(o="function"==typeof(i=s)?i.call(t,n,t,e):i)||(e.exports=o)}(window,(function(){"use strict";var e=function(){var e=window.Element.prototype;if(e.matches)return"matches";if(e.matchesSelector)return"matchesSelector";for(var t=["webkit","moz","ms","o"],n=0;n<t.length;n++){var i=t[n]+"MatchesSelector";if(e[i])return i}}();return function(t,n){return t[e](n)}}))},9005:function(e){var t=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},n=-1;t.Diff=function(e,t){return[e,t]},t.prototype.diff_main=function(e,n,i,o){void 0===o&&(o=this.Diff_Timeout<=0?Number.MAX_VALUE:(new Date).getTime()+1e3*this.Diff_Timeout);var r=o;if(null==e||null==n)throw new Error("Null input. (diff_main)");if(e==n)return e?[new t.Diff(0,e)]:[];void 0===i&&(i=!0);var s=i,a=this.diff_commonPrefix(e,n),l=e.substring(0,a);e=e.substring(a),n=n.substring(a),a=this.diff_commonSuffix(e,n);var c=e.substring(e.length-a);e=e.substring(0,e.length-a),n=n.substring(0,n.length-a);var u=this.diff_compute_(e,n,s,r);return l&&u.unshift(new t.Diff(0,l)),c&&u.push(new t.Diff(0,c)),this.diff_cleanupMerge(u),u},t.prototype.diff_compute_=function(e,i,o,r){var s;if(!e)return[new t.Diff(1,i)];if(!i)return[new t.Diff(n,e)];var a=e.length>i.length?e:i,l=e.length>i.length?i:e,c=a.indexOf(l);if(-1!=c)return s=[new t.Diff(1,a.substring(0,c)),new t.Diff(0,l),new t.Diff(1,a.substring(c+l.length))],e.length>i.length&&(s[0][0]=s[2][0]=n),s;if(1==l.length)return[new t.Diff(n,e),new t.Diff(1,i)];var u=this.diff_halfMatch_(e,i);if(u){var h=u[0],d=u[1],p=u[2],f=u[3],g=u[4],m=this.diff_main(h,p,o,r),v=this.diff_main(d,f,o,r);return m.concat([new t.Diff(0,g)],v)}return o&&e.length>100&&i.length>100?this.diff_lineMode_(e,i,r):this.diff_bisect_(e,i,r)},t.prototype.diff_lineMode_=function(e,i,o){var r=this.diff_linesToChars_(e,i);e=r.chars1,i=r.chars2;var s=r.lineArray,a=this.diff_main(e,i,!1,o);this.diff_charsToLines_(a,s),this.diff_cleanupSemantic(a),a.push(new t.Diff(0,""));for(var l=0,c=0,u=0,h="",d="";l<a.length;){switch(a[l][0]){case 1:u++,d+=a[l][1];break;case n:c++,h+=a[l][1];break;case 0:if(c>=1&&u>=1){a.splice(l-c-u,c+u),l=l-c-u;for(var p=this.diff_main(h,d,!1,o),f=p.length-1;f>=0;f--)a.splice(l,0,p[f]);l+=p.length}u=0,c=0,h="",d=""}l++}return a.pop(),a},t.prototype.diff_bisect_=function(e,i,o){for(var r=e.length,s=i.length,a=Math.ceil((r+s)/2),l=a,c=2*a,u=new Array(c),h=new Array(c),d=0;d<c;d++)u[d]=-1,h[d]=-1;u[l+1]=0,h[l+1]=0;for(var p=r-s,f=p%2!=0,g=0,m=0,v=0,b=0,w=0;w<a&&!((new Date).getTime()>o);w++){for(var y=-w+g;y<=w-m;y+=2){for(var x=l+y,C=(_=y==-w||y!=w&&u[x-1]<u[x+1]?u[x+1]:u[x-1]+1)-y;_<r&&C<s&&e.charAt(_)==i.charAt(C);)_++,C++;if(u[x]=_,_>r)m+=2;else if(C>s)g+=2;else if(f&&($=l+p-y)>=0&&$<c&&-1!=h[$]&&_>=(k=r-h[$]))return this.diff_bisectSplit_(e,i,_,C,o)}for(var S=-w+v;S<=w-b;S+=2){for(var k,$=l+S,E=(k=S==-w||S!=w&&h[$-1]<h[$+1]?h[$+1]:h[$-1]+1)-S;k<r&&E<s&&e.charAt(r-k-1)==i.charAt(s-E-1);)k++,E++;if(h[$]=k,k>r)b+=2;else if(E>s)v+=2;else if(!f){var _;if((x=l+p-S)>=0&&x<c&&-1!=u[x])if(C=l+(_=u[x])-x,_>=(k=r-k))return this.diff_bisectSplit_(e,i,_,C,o)}}}return[new t.Diff(n,e),new t.Diff(1,i)]},t.prototype.diff_bisectSplit_=function(e,t,n,i,o){var r=e.substring(0,n),s=t.substring(0,i),a=e.substring(n),l=t.substring(i),c=this.diff_main(r,s,!1,o),u=this.diff_main(a,l,!1,o);return c.concat(u)},t.prototype.diff_linesToChars_=function(e,t){var n=[],i={};function o(e){for(var t="",o=0,s=-1,a=n.length;s<e.length-1;){-1==(s=e.indexOf("\n",o))&&(s=e.length-1);var l=e.substring(o,s+1);(i.hasOwnProperty?i.hasOwnProperty(l):void 0!==i[l])?t+=String.fromCharCode(i[l]):(a==r&&(l=e.substring(o),s=e.length),t+=String.fromCharCode(a),i[l]=a,n[a++]=l),o=s+1}return t}n[0]="";var r=4e4,s=o(e);return r=65535,{chars1:s,chars2:o(t),lineArray:n}},t.prototype.diff_charsToLines_=function(e,t){for(var n=0;n<e.length;n++){for(var i=e[n][1],o=[],r=0;r<i.length;r++)o[r]=t[i.charCodeAt(r)];e[n][1]=o.join("")}},t.prototype.diff_commonPrefix=function(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var n=0,i=Math.min(e.length,t.length),o=i,r=0;n<o;)e.substring(r,o)==t.substring(r,o)?r=n=o:i=o,o=Math.floor((i-n)/2+n);return o},t.prototype.diff_commonSuffix=function(e,t){if(!e||!t||e.charAt(e.length-1)!=t.charAt(t.length-1))return 0;for(var n=0,i=Math.min(e.length,t.length),o=i,r=0;n<o;)e.substring(e.length-o,e.length-r)==t.substring(t.length-o,t.length-r)?r=n=o:i=o,o=Math.floor((i-n)/2+n);return o},t.prototype.diff_commonOverlap_=function(e,t){var n=e.length,i=t.length;if(0==n||0==i)return 0;n>i?e=e.substring(n-i):n<i&&(t=t.substring(0,n));var o=Math.min(n,i);if(e==t)return o;for(var r=0,s=1;;){var a=e.substring(o-s),l=t.indexOf(a);if(-1==l)return r;s+=l,0!=l&&e.substring(o-s)!=t.substring(0,s)||(r=s,s++)}},t.prototype.diff_halfMatch_=function(e,t){if(this.Diff_Timeout<=0)return null;var n=e.length>t.length?e:t,i=e.length>t.length?t:e;if(n.length<4||2*i.length<n.length)return null;var o=this;function r(e,t,n){for(var i,r,s,a,l=e.substring(n,n+Math.floor(e.length/4)),c=-1,u="";-1!=(c=t.indexOf(l,c+1));){var h=o.diff_commonPrefix(e.substring(n),t.substring(c)),d=o.diff_commonSuffix(e.substring(0,n),t.substring(0,c));u.length<d+h&&(u=t.substring(c-d,c)+t.substring(c,c+h),i=e.substring(0,n-d),r=e.substring(n+h),s=t.substring(0,c-d),a=t.substring(c+h))}return 2*u.length>=e.length?[i,r,s,a,u]:null}var s,a,l,c,u,h=r(n,i,Math.ceil(n.length/4)),d=r(n,i,Math.ceil(n.length/2));return h||d?(s=d?h&&h[4].length>d[4].length?h:d:h,e.length>t.length?(a=s[0],l=s[1],c=s[2],u=s[3]):(c=s[0],u=s[1],a=s[2],l=s[3]),[a,l,c,u,s[4]]):null},t.prototype.diff_cleanupSemantic=function(e){for(var i=!1,o=[],r=0,s=null,a=0,l=0,c=0,u=0,h=0;a<e.length;)0==e[a][0]?(o[r++]=a,l=u,c=h,u=0,h=0,s=e[a][1]):(1==e[a][0]?u+=e[a][1].length:h+=e[a][1].length,s&&s.length<=Math.max(l,c)&&s.length<=Math.max(u,h)&&(e.splice(o[r-1],0,new t.Diff(n,s)),e[o[r-1]+1][0]=1,r--,a=--r>0?o[r-1]:-1,l=0,c=0,u=0,h=0,s=null,i=!0)),a++;for(i&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),a=1;a<e.length;){if(e[a-1][0]==n&&1==e[a][0]){var d=e[a-1][1],p=e[a][1],f=this.diff_commonOverlap_(d,p),g=this.diff_commonOverlap_(p,d);f>=g?(f>=d.length/2||f>=p.length/2)&&(e.splice(a,0,new t.Diff(0,p.substring(0,f))),e[a-1][1]=d.substring(0,d.length-f),e[a+1][1]=p.substring(f),a++):(g>=d.length/2||g>=p.length/2)&&(e.splice(a,0,new t.Diff(0,d.substring(0,g))),e[a-1][0]=1,e[a-1][1]=p.substring(0,p.length-g),e[a+1][0]=n,e[a+1][1]=d.substring(g),a++),a++}a++}},t.prototype.diff_cleanupSemanticLossless=function(e){function n(e,n){if(!e||!n)return 6;var i=e.charAt(e.length-1),o=n.charAt(0),r=i.match(t.nonAlphaNumericRegex_),s=o.match(t.nonAlphaNumericRegex_),a=r&&i.match(t.whitespaceRegex_),l=s&&o.match(t.whitespaceRegex_),c=a&&i.match(t.linebreakRegex_),u=l&&o.match(t.linebreakRegex_),h=c&&e.match(t.blanklineEndRegex_),d=u&&n.match(t.blanklineStartRegex_);return h||d?5:c||u?4:r&&!a&&l?3:a||l?2:r||s?1:0}for(var i=1;i<e.length-1;){if(0==e[i-1][0]&&0==e[i+1][0]){var o=e[i-1][1],r=e[i][1],s=e[i+1][1],a=this.diff_commonSuffix(o,r);if(a){var l=r.substring(r.length-a);o=o.substring(0,o.length-a),r=l+r.substring(0,r.length-a),s=l+s}for(var c=o,u=r,h=s,d=n(o,r)+n(r,s);r.charAt(0)===s.charAt(0);){o+=r.charAt(0),r=r.substring(1)+s.charAt(0),s=s.substring(1);var p=n(o,r)+n(r,s);p>=d&&(d=p,c=o,u=r,h=s)}e[i-1][1]!=c&&(c?e[i-1][1]=c:(e.splice(i-1,1),i--),e[i][1]=u,h?e[i+1][1]=h:(e.splice(i+1,1),i--))}i++}},t.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,t.whitespaceRegex_=/\s/,t.linebreakRegex_=/[\r\n]/,t.blanklineEndRegex_=/\n\r?\n$/,t.blanklineStartRegex_=/^\r?\n\r?\n/,t.prototype.diff_cleanupEfficiency=function(e){for(var i=!1,o=[],r=0,s=null,a=0,l=!1,c=!1,u=!1,h=!1;a<e.length;)0==e[a][0]?(e[a][1].length<this.Diff_EditCost&&(u||h)?(o[r++]=a,l=u,c=h,s=e[a][1]):(r=0,s=null),u=h=!1):(e[a][0]==n?h=!0:u=!0,s&&(l&&c&&u&&h||s.length<this.Diff_EditCost/2&&l+c+u+h==3)&&(e.splice(o[r-1],0,new t.Diff(n,s)),e[o[r-1]+1][0]=1,r--,s=null,l&&c?(u=h=!0,r=0):(a=--r>0?o[r-1]:-1,u=h=!1),i=!0)),a++;i&&this.diff_cleanupMerge(e)},t.prototype.diff_cleanupMerge=function(e){e.push(new t.Diff(0,""));for(var i,o=0,r=0,s=0,a="",l="";o<e.length;)switch(e[o][0]){case 1:s++,l+=e[o][1],o++;break;case n:r++,a+=e[o][1],o++;break;case 0:r+s>1?(0!==r&&0!==s&&(0!==(i=this.diff_commonPrefix(l,a))&&(o-r-s>0&&0==e[o-r-s-1][0]?e[o-r-s-1][1]+=l.substring(0,i):(e.splice(0,0,new t.Diff(0,l.substring(0,i))),o++),l=l.substring(i),a=a.substring(i)),0!==(i=this.diff_commonSuffix(l,a))&&(e[o][1]=l.substring(l.length-i)+e[o][1],l=l.substring(0,l.length-i),a=a.substring(0,a.length-i))),o-=r+s,e.splice(o,r+s),a.length&&(e.splice(o,0,new t.Diff(n,a)),o++),l.length&&(e.splice(o,0,new t.Diff(1,l)),o++),o++):0!==o&&0==e[o-1][0]?(e[o-1][1]+=e[o][1],e.splice(o,1)):o++,s=0,r=0,a="",l=""}""===e[e.length-1][1]&&e.pop();var c=!1;for(o=1;o<e.length-1;)0==e[o-1][0]&&0==e[o+1][0]&&(e[o][1].substring(e[o][1].length-e[o-1][1].length)==e[o-1][1]?(e[o][1]=e[o-1][1]+e[o][1].substring(0,e[o][1].length-e[o-1][1].length),e[o+1][1]=e[o-1][1]+e[o+1][1],e.splice(o-1,1),c=!0):e[o][1].substring(0,e[o+1][1].length)==e[o+1][1]&&(e[o-1][1]+=e[o+1][1],e[o][1]=e[o][1].substring(e[o+1][1].length)+e[o+1][1],e.splice(o+1,1),c=!0)),o++;c&&this.diff_cleanupMerge(e)},t.prototype.diff_xIndex=function(e,t){var i,o=0,r=0,s=0,a=0;for(i=0;i<e.length&&(1!==e[i][0]&&(o+=e[i][1].length),e[i][0]!==n&&(r+=e[i][1].length),!(o>t));i++)s=o,a=r;return e.length!=i&&e[i][0]===n?a:a+(t-s)},t.prototype.diff_prettyHtml=function(e){for(var t=[],i=/&/g,o=/</g,r=/>/g,s=/\n/g,a=0;a<e.length;a++){var l=e[a][0],c=e[a][1].replace(i,"&amp;").replace(o,"&lt;").replace(r,"&gt;").replace(s,"&para;<br>");switch(l){case 1:t[a]='<ins style="background:#e6ffe6;">'+c+"</ins>";break;case n:t[a]='<del style="background:#ffe6e6;">'+c+"</del>";break;case 0:t[a]="<span>"+c+"</span>"}}return t.join("")},t.prototype.diff_text1=function(e){for(var t=[],n=0;n<e.length;n++)1!==e[n][0]&&(t[n]=e[n][1]);return t.join("")},t.prototype.diff_text2=function(e){for(var t=[],i=0;i<e.length;i++)e[i][0]!==n&&(t[i]=e[i][1]);return t.join("")},t.prototype.diff_levenshtein=function(e){for(var t=0,i=0,o=0,r=0;r<e.length;r++){var s=e[r][0],a=e[r][1];switch(s){case 1:i+=a.length;break;case n:o+=a.length;break;case 0:t+=Math.max(i,o),i=0,o=0}}return t+Math.max(i,o)},t.prototype.diff_toDelta=function(e){for(var t=[],i=0;i<e.length;i++)switch(e[i][0]){case 1:t[i]="+"+encodeURI(e[i][1]);break;case n:t[i]="-"+e[i][1].length;break;case 0:t[i]="="+e[i][1].length}return t.join("\t").replace(/%20/g," ")},t.prototype.diff_fromDelta=function(e,i){for(var o=[],r=0,s=0,a=i.split(/\t/g),l=0;l<a.length;l++){var c=a[l].substring(1);switch(a[l].charAt(0)){case"+":try{o[r++]=new t.Diff(1,decodeURI(c))}catch(e){throw new Error("Illegal escape in diff_fromDelta: "+c)}break;case"-":case"=":var u=parseInt(c,10);if(isNaN(u)||u<0)throw new Error("Invalid number in diff_fromDelta: "+c);var h=e.substring(s,s+=u);"="==a[l].charAt(0)?o[r++]=new t.Diff(0,h):o[r++]=new t.Diff(n,h);break;default:if(a[l])throw new Error("Invalid diff operation in diff_fromDelta: "+a[l])}}if(s!=e.length)throw new Error("Delta length ("+s+") does not equal source text length ("+e.length+").");return o},t.prototype.match_main=function(e,t,n){if(null==e||null==t||null==n)throw new Error("Null input. (match_main)");return n=Math.max(0,Math.min(n,e.length)),e==t?0:e.length?e.substring(n,n+t.length)==t?n:this.match_bitap_(e,t,n):-1},t.prototype.match_bitap_=function(e,t,n){if(t.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var i=this.match_alphabet_(t),o=this;function r(e,i){var r=e/t.length,s=Math.abs(n-i);return o.Match_Distance?r+s/o.Match_Distance:s?1:r}var s=this.Match_Threshold,a=e.indexOf(t,n);-1!=a&&(s=Math.min(r(0,a),s),-1!=(a=e.lastIndexOf(t,n+t.length))&&(s=Math.min(r(0,a),s)));var l,c,u=1<<t.length-1;a=-1;for(var h,d=t.length+e.length,p=0;p<t.length;p++){for(l=0,c=d;l<c;)r(p,n+c)<=s?l=c:d=c,c=Math.floor((d-l)/2+l);d=c;var f=Math.max(1,n-c+1),g=Math.min(n+c,e.length)+t.length,m=Array(g+2);m[g+1]=(1<<p)-1;for(var v=g;v>=f;v--){var b=i[e.charAt(v-1)];if(m[v]=0===p?(m[v+1]<<1|1)&b:(m[v+1]<<1|1)&b|(h[v+1]|h[v])<<1|1|h[v+1],m[v]&u){var w=r(p,v-1);if(w<=s){if(s=w,!((a=v-1)>n))break;f=Math.max(1,2*n-a)}}}if(r(p+1,n)>s)break;h=m}return a},t.prototype.match_alphabet_=function(e){for(var t={},n=0;n<e.length;n++)t[e.charAt(n)]=0;for(n=0;n<e.length;n++)t[e.charAt(n)]|=1<<e.length-n-1;return t},t.prototype.patch_addContext_=function(e,n){if(0!=n.length){if(null===e.start2)throw Error("patch not initialized");for(var i=n.substring(e.start2,e.start2+e.length1),o=0;n.indexOf(i)!=n.lastIndexOf(i)&&i.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)o+=this.Patch_Margin,i=n.substring(e.start2-o,e.start2+e.length1+o);o+=this.Patch_Margin;var r=n.substring(e.start2-o,e.start2);r&&e.diffs.unshift(new t.Diff(0,r));var s=n.substring(e.start2+e.length1,e.start2+e.length1+o);s&&e.diffs.push(new t.Diff(0,s)),e.start1-=r.length,e.start2-=r.length,e.length1+=r.length+s.length,e.length2+=r.length+s.length}},t.prototype.patch_make=function(e,i,o){var r,s;if("string"==typeof e&&"string"==typeof i&&void 0===o)r=e,(s=this.diff_main(r,i,!0)).length>2&&(this.diff_cleanupSemantic(s),this.diff_cleanupEfficiency(s));else if(e&&"object"==typeof e&&void 0===i&&void 0===o)s=e,r=this.diff_text1(s);else if("string"==typeof e&&i&&"object"==typeof i&&void 0===o)r=e,s=i;else{if("string"!=typeof e||"string"!=typeof i||!o||"object"!=typeof o)throw new Error("Unknown call format to patch_make.");r=e,s=o}if(0===s.length)return[];for(var a=[],l=new t.patch_obj,c=0,u=0,h=0,d=r,p=r,f=0;f<s.length;f++){var g=s[f][0],m=s[f][1];switch(c||0===g||(l.start1=u,l.start2=h),g){case 1:l.diffs[c++]=s[f],l.length2+=m.length,p=p.substring(0,h)+m+p.substring(h);break;case n:l.length1+=m.length,l.diffs[c++]=s[f],p=p.substring(0,h)+p.substring(h+m.length);break;case 0:m.length<=2*this.Patch_Margin&&c&&s.length!=f+1?(l.diffs[c++]=s[f],l.length1+=m.length,l.length2+=m.length):m.length>=2*this.Patch_Margin&&c&&(this.patch_addContext_(l,d),a.push(l),l=new t.patch_obj,c=0,d=p,u=h)}1!==g&&(u+=m.length),g!==n&&(h+=m.length)}return c&&(this.patch_addContext_(l,d),a.push(l)),a},t.prototype.patch_deepCopy=function(e){for(var n=[],i=0;i<e.length;i++){var o=e[i],r=new t.patch_obj;r.diffs=[];for(var s=0;s<o.diffs.length;s++)r.diffs[s]=new t.Diff(o.diffs[s][0],o.diffs[s][1]);r.start1=o.start1,r.start2=o.start2,r.length1=o.length1,r.length2=o.length2,n[i]=r}return n},t.prototype.patch_apply=function(e,t){if(0==e.length)return[t,[]];e=this.patch_deepCopy(e);var i=this.patch_addPadding(e);t=i+t+i,this.patch_splitMax(e);for(var o=0,r=[],s=0;s<e.length;s++){var a,l,c=e[s].start2+o,u=this.diff_text1(e[s].diffs),h=-1;if(u.length>this.Match_MaxBits?-1!=(a=this.match_main(t,u.substring(0,this.Match_MaxBits),c))&&(-1==(h=this.match_main(t,u.substring(u.length-this.Match_MaxBits),c+u.length-this.Match_MaxBits))||a>=h)&&(a=-1):a=this.match_main(t,u,c),-1==a)r[s]=!1,o-=e[s].length2-e[s].length1;else if(r[s]=!0,o=a-c,u==(l=-1==h?t.substring(a,a+u.length):t.substring(a,h+this.Match_MaxBits)))t=t.substring(0,a)+this.diff_text2(e[s].diffs)+t.substring(a+u.length);else{var d=this.diff_main(u,l,!1);if(u.length>this.Match_MaxBits&&this.diff_levenshtein(d)/u.length>this.Patch_DeleteThreshold)r[s]=!1;else{this.diff_cleanupSemanticLossless(d);for(var p,f=0,g=0;g<e[s].diffs.length;g++){var m=e[s].diffs[g];0!==m[0]&&(p=this.diff_xIndex(d,f)),1===m[0]?t=t.substring(0,a+p)+m[1]+t.substring(a+p):m[0]===n&&(t=t.substring(0,a+p)+t.substring(a+this.diff_xIndex(d,f+m[1].length))),m[0]!==n&&(f+=m[1].length)}}}}return[t=t.substring(i.length,t.length-i.length),r]},t.prototype.patch_addPadding=function(e){for(var n=this.Patch_Margin,i="",o=1;o<=n;o++)i+=String.fromCharCode(o);for(o=0;o<e.length;o++)e[o].start1+=n,e[o].start2+=n;var r=e[0],s=r.diffs;if(0==s.length||0!=s[0][0])s.unshift(new t.Diff(0,i)),r.start1-=n,r.start2-=n,r.length1+=n,r.length2+=n;else if(n>s[0][1].length){var a=n-s[0][1].length;s[0][1]=i.substring(s[0][1].length)+s[0][1],r.start1-=a,r.start2-=a,r.length1+=a,r.length2+=a}return 0==(s=(r=e[e.length-1]).diffs).length||0!=s[s.length-1][0]?(s.push(new t.Diff(0,i)),r.length1+=n,r.length2+=n):n>s[s.length-1][1].length&&(a=n-s[s.length-1][1].length,s[s.length-1][1]+=i.substring(0,a),r.length1+=a,r.length2+=a),i},t.prototype.patch_splitMax=function(e){for(var i=this.Match_MaxBits,o=0;o<e.length;o++)if(!(e[o].length1<=i)){var r=e[o];e.splice(o--,1);for(var s=r.start1,a=r.start2,l="";0!==r.diffs.length;){var c=new t.patch_obj,u=!0;for(c.start1=s-l.length,c.start2=a-l.length,""!==l&&(c.length1=c.length2=l.length,c.diffs.push(new t.Diff(0,l)));0!==r.diffs.length&&c.length1<i-this.Patch_Margin;){var h=r.diffs[0][0],d=r.diffs[0][1];1===h?(c.length2+=d.length,a+=d.length,c.diffs.push(r.diffs.shift()),u=!1):h===n&&1==c.diffs.length&&0==c.diffs[0][0]&&d.length>2*i?(c.length1+=d.length,s+=d.length,u=!1,c.diffs.push(new t.Diff(h,d)),r.diffs.shift()):(d=d.substring(0,i-c.length1-this.Patch_Margin),c.length1+=d.length,s+=d.length,0===h?(c.length2+=d.length,a+=d.length):u=!1,c.diffs.push(new t.Diff(h,d)),d==r.diffs[0][1]?r.diffs.shift():r.diffs[0][1]=r.diffs[0][1].substring(d.length))}l=(l=this.diff_text2(c.diffs)).substring(l.length-this.Patch_Margin);var p=this.diff_text1(r.diffs).substring(0,this.Patch_Margin);""!==p&&(c.length1+=p.length,c.length2+=p.length,0!==c.diffs.length&&0===c.diffs[c.diffs.length-1][0]?c.diffs[c.diffs.length-1][1]+=p:c.diffs.push(new t.Diff(0,p))),u||e.splice(++o,0,c)}}},t.prototype.patch_toText=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=e[n];return t.join("")},t.prototype.patch_fromText=function(e){var i=[];if(!e)return i;for(var o=e.split("\n"),r=0,s=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;r<o.length;){var a=o[r].match(s);if(!a)throw new Error("Invalid patch string: "+o[r]);var l=new t.patch_obj;for(i.push(l),l.start1=parseInt(a[1],10),""===a[2]?(l.start1--,l.length1=1):"0"==a[2]?l.length1=0:(l.start1--,l.length1=parseInt(a[2],10)),l.start2=parseInt(a[3],10),""===a[4]?(l.start2--,l.length2=1):"0"==a[4]?l.length2=0:(l.start2--,l.length2=parseInt(a[4],10)),r++;r<o.length;){var c=o[r].charAt(0);try{var u=decodeURI(o[r].substring(1))}catch(e){throw new Error("Illegal escape in patch_fromText: "+u)}if("-"==c)l.diffs.push(new t.Diff(n,u));else if("+"==c)l.diffs.push(new t.Diff(1,u));else if(" "==c)l.diffs.push(new t.Diff(0,u));else{if("@"==c)break;if(""!==c)throw new Error('Invalid patch mode "'+c+'" in: '+u)}r++}}return i},(t.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0}).prototype.toString=function(){for(var e,t=["@@ -"+(0===this.length1?this.start1+",0":1==this.length1?this.start1+1:this.start1+1+","+this.length1)+" +"+(0===this.length2?this.start2+",0":1==this.length2?this.start2+1:this.start2+1+","+this.length2)+" @@\n"],i=0;i<this.diffs.length;i++){switch(this.diffs[i][0]){case 1:e="+";break;case n:e="-";break;case 0:e=" "}t[i+1]=e+encodeURI(this.diffs[i][1])+"\n"}return t.join("").replace(/%20/g," ")},e.exports=t,e.exports.diff_match_patch=t,e.exports.DIFF_DELETE=n,e.exports.DIFF_INSERT=1,e.exports.DIFF_EQUAL=0},6259:function(e){"use strict";var t=e.exports={};t.isIE=function(e){return!(-1===(t=navigator.userAgent.toLowerCase()).indexOf("msie")&&-1===t.indexOf("trident")&&-1===t.indexOf(" edge/")||e&&e!==function(){var e=3,t=document.createElement("div"),n=t.getElementsByTagName("i");do{t.innerHTML="\x3c!--[if gt IE "+ ++e+"]><i></i><![endif]--\x3e"}while(n[0]);return e>4?e:void 0}());var t},t.isLegacyOpera=function(){return!!window.opera}},5808:function(e){"use strict";(e.exports={}).forEach=function(e,t){for(var n=0;n<e.length;n++){var i=t(e[n]);if(i)return i}}},9191:function(e,t,n){"use strict";var i=n(6259);e.exports=function(e){var t=(e=e||{}).reporter,n=e.batchProcessor,o=e.stateHandler.getState;if(!t)throw new Error("Missing required dependency: reporter.");function r(t){var n=e.important?" !important; ":"; ";return(t.join(n)+n).trim()}function s(e){return o(e).object}return{makeDetectable:function(e,s,a){a||(a=s,s=e,e=null),(e=e||{}).debug,i.isIE(8)?a(s):function(s,a){var l=r(["display: block","position: absolute","top: 0","left: 0","width: 100%","height: 100%","border: none","padding: 0","margin: 0","opacity: 0","z-index: -1000","pointer-events: none"]),c=!1,u=window.getComputedStyle(s),h=s.offsetWidth,d=s.offsetHeight;function p(){function n(){if("static"===u.position){s.style.setProperty("position","relative",e.important?"important":"");var n=function(t,n,i,o){var r=i[o];"auto"!==r&&"0"!==function(e){return e.replace(/[^-\d\.]/g,"")}(r)&&(t.warn("An element that is positioned static has style."+o+"="+r+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+o+" will be set to 0. Element: ",n),n.style.setProperty(o,"0",e.important?"important":""))};n(t,s,u,"top"),n(t,s,u,"right"),n(t,s,u,"bottom"),n(t,s,u,"left")}}""!==u.position&&(n(),c=!0);var r=document.createElement("object");r.style.cssText=l,r.tabIndex=-1,r.type="text/html",r.setAttribute("aria-hidden","true"),r.onload=function(){c||n(),function e(t,n){if(!t.contentDocument){var i=o(t);return i.checkForObjectDocumentTimeoutId&&window.clearTimeout(i.checkForObjectDocumentTimeoutId),void(i.checkForObjectDocumentTimeoutId=setTimeout((function(){i.checkForObjectDocumentTimeoutId=0,e(t,n)}),100))}n(t.contentDocument)}(this,(function(e){a(s)}))},i.isIE()||(r.data="about:blank"),o(s)&&(s.appendChild(r),o(s).object=r,i.isIE()&&(r.data="about:blank"))}o(s).startSize={width:h,height:d},n?n.add(p):p()}(s,a)},addListener:function(e,t){function n(){t(e)}if(i.isIE(8))o(e).object={proxy:n},e.attachEvent("onresize",n);else{var r=s(e);if(!r)throw new Error("Element is not detectable by this strategy.");r.contentDocument.defaultView.addEventListener("resize",n)}},uninstall:function(e){if(o(e)){var t=s(e);t&&(i.isIE(8)?e.detachEvent("onresize",t.proxy):e.removeChild(t),o(e).checkForObjectDocumentTimeoutId&&window.clearTimeout(o(e).checkForObjectDocumentTimeoutId),delete o(e).object)}}}}},7787:function(e,t,n){"use strict";var i=n(5808).forEach;e.exports=function(e){var t=(e=e||{}).reporter,n=e.batchProcessor,o=e.stateHandler.getState,r=(e.stateHandler.hasState,e.idHandler);if(!n)throw new Error("Missing required dependency: batchProcessor");if(!t)throw new Error("Missing required dependency: reporter.");var s=function(){var e=document.createElement("div");e.style.cssText=c(["position: absolute","width: 1000px","height: 1000px","visibility: hidden","margin: 0","padding: 0"]);var t=document.createElement("div");t.style.cssText=c(["position: absolute","width: 500px","height: 500px","overflow: scroll","visibility: none","top: -1500px","left: -1500px","visibility: hidden","margin: 0","padding: 0"]),t.appendChild(e),document.body.insertBefore(t,document.body.firstChild);var n=500-t.clientWidth,i=500-t.clientHeight;return document.body.removeChild(t),{width:n,height:i}}(),a="erd_scroll_detection_container";function l(e){!function(e,t,n){if(!e.getElementById(t)){var i=n+"_animation",o="/* Created by the element-resize-detector library. */\n";o+="."+n+" > div::-webkit-scrollbar { "+c(["display: none"])+" }\n\n",o+=".erd_scroll_detection_container_animation_active { "+c(["-webkit-animation-duration: 0.1s","animation-duration: 0.1s","-webkit-animation-name: "+i,"animation-name: "+i])+" }\n",o+="@-webkit-keyframes "+i+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }\n",function(n,i){i=i||function(t){e.head.appendChild(t)};var o=e.createElement("style");o.innerHTML=n,o.id=t,i(o)}(o+="@keyframes "+i+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }")}}(e,"erd_scroll_detection_scrollbar_style",a)}function c(t){var n=e.important?" !important; ":"; ";return(t.join(n)+n).trim()}function u(e,n,i){if(e.addEventListener)e.addEventListener(n,i);else{if(!e.attachEvent)return t.error("[scroll] Don't know how to add event listeners.");e.attachEvent("on"+n,i)}}function h(e,n,i){if(e.removeEventListener)e.removeEventListener(n,i);else{if(!e.detachEvent)return t.error("[scroll] Don't know how to remove event listeners.");e.detachEvent("on"+n,i)}}function d(e){return o(e).container.childNodes[0].childNodes[0].childNodes[0]}function p(e){return o(e).container.childNodes[0].childNodes[0].childNodes[1]}return l(window.document),{makeDetectable:function(e,l,h){function f(){if(e.debug){var n=Array.prototype.slice.call(arguments);if(n.unshift(r.get(l),"Scroll: "),t.log.apply)t.log.apply(null,n);else for(var i=0;i<n.length;i++)t.log(n[i])}}function g(e){var t=o(e).container.childNodes[0],n=window.getComputedStyle(t);return!n.width||-1===n.width.indexOf("px")}function m(){var e=window.getComputedStyle(l),t={};return t.position=e.position,t.width=l.offsetWidth,t.height=l.offsetHeight,t.top=e.top,t.right=e.right,t.bottom=e.bottom,t.left=e.left,t.widthCSS=e.width,t.heightCSS=e.height,t}function v(){if(f("storeStyle invoked."),o(l)){var e=m();o(l).style=e}else f("Aborting because element has been uninstalled")}function b(e,t,n){o(e).lastWidth=t,o(e).lastHeight=n}function w(){return 2*s.width+1}function y(){return 2*s.height+1}function x(e){return e+10+w()}function C(e){return e+10+y()}function S(e,t,n){var i=d(e),o=p(e),r=x(t),s=C(n),a=function(e){return 2*e+w()}(t),l=function(e){return 2*e+y()}(n);i.scrollLeft=r,i.scrollTop=s,o.scrollLeft=a,o.scrollTop=l}function k(){var e=o(l).container;if(!e){(e=document.createElement("div")).className=a,e.style.cssText=c(["visibility: hidden","display: inline","width: 0px","height: 0px","z-index: -1","overflow: hidden","margin: 0","padding: 0"]),o(l).container=e,function(e){e.className+=" "+a+"_animation_active"}(e),l.appendChild(e);var t=function(){o(l).onRendered&&o(l).onRendered()};u(e,"animationstart",t),o(l).onAnimationStart=t}return e}function $(){if(f("Injecting elements"),o(l)){!function(){var n=o(l).style;if("static"===n.position){l.style.setProperty("position","relative",e.important?"important":"");var i=function(e,t,n,i){var o=n[i];"auto"!==o&&"0"!==function(e){return e.replace(/[^-\d\.]/g,"")}(o)&&(e.warn("An element that is positioned static has style."+i+"="+o+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+i+" will be set to 0. Element: ",t),t.style[i]=0)};i(t,l,n,"top"),i(t,l,n,"right"),i(t,l,n,"bottom"),i(t,l,n,"left")}}();var n=o(l).container;n||(n=k());var i,r,h,d,p=s.width,g=s.height,m=c(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden","width: 100%","height: 100%","left: 0px","top: 0px"]),v=c(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden"].concat(["left: "+(i=(i=-(1+p))?i+"px":"0"),"top: "+(r=(r=-(1+g))?r+"px":"0"),"right: "+(d=(d=-p)?d+"px":"0"),"bottom: "+(h=(h=-g)?h+"px":"0")])),b=c(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),w=c(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),y=c(["position: absolute","left: 0","top: 0"]),x=c(["position: absolute","width: 200%","height: 200%"]),C=document.createElement("div"),S=document.createElement("div"),$=document.createElement("div"),E=document.createElement("div"),_=document.createElement("div"),L=document.createElement("div");C.dir="ltr",C.style.cssText=m,C.className=a,S.className=a,S.style.cssText=v,$.style.cssText=b,E.style.cssText=y,_.style.cssText=w,L.style.cssText=x,$.appendChild(E),_.appendChild(L),S.appendChild($),S.appendChild(_),C.appendChild(S),n.appendChild(C),u($,"scroll",A),u(_,"scroll",R),o(l).onExpandScroll=A,o(l).onShrinkScroll=R}else f("Aborting because element has been uninstalled");function A(){var e=o(l);e&&e.onExpand?e.onExpand():f("Aborting expand scroll handler: element has been uninstalled")}function R(){var e=o(l);e&&e.onShrink?e.onShrink():f("Aborting shrink scroll handler: element has been uninstalled")}}function E(){function s(t,n,i){var o=function(e){return d(e).childNodes[0]}(t),r=x(n),s=C(i);o.style.setProperty("width",r+"px",e.important?"important":""),o.style.setProperty("height",s+"px",e.important?"important":"")}function a(i){var a=l.offsetWidth,u=l.offsetHeight,h=a!==o(l).lastWidth||u!==o(l).lastHeight;f("Storing current size",a,u),b(l,a,u),n.add(0,(function(){if(h)if(o(l))if(c()){if(e.debug){var n=l.offsetWidth,i=l.offsetHeight;n===a&&i===u||t.warn(r.get(l),"Scroll: Size changed before updating detector elements.")}s(l,a,u)}else f("Aborting because element container has not been initialized");else f("Aborting because element has been uninstalled")})),n.add(1,(function(){o(l)?c()?S(l,a,u):f("Aborting because element container has not been initialized"):f("Aborting because element has been uninstalled")})),h&&i&&n.add(2,(function(){o(l)?c()?i():f("Aborting because element container has not been initialized"):f("Aborting because element has been uninstalled")}))}function c(){return!!o(l).container}function u(){f("notifyListenersIfNeeded invoked");var e=o(l);return void 0===o(l).lastNotifiedWidth&&e.lastWidth===e.startSize.width&&e.lastHeight===e.startSize.height?f("Not notifying: Size is the same as the start size, and there has been no notification yet."):e.lastWidth===e.lastNotifiedWidth&&e.lastHeight===e.lastNotifiedHeight?f("Not notifying: Size already notified"):(f("Current size not notified, notifying..."),e.lastNotifiedWidth=e.lastWidth,e.lastNotifiedHeight=e.lastHeight,void i(o(l).listeners,(function(e){e(l)})))}function h(){f("Scroll detected."),g(l)?f("Scroll event fired while unrendered. Ignoring..."):a(u)}if(f("registerListenersAndPositionElements invoked."),o(l)){o(l).onRendered=function(){if(f("startanimation triggered."),g(l))f("Ignoring since element is still unrendered...");else{f("Element rendered.");var e=d(l),t=p(l);0!==e.scrollLeft&&0!==e.scrollTop&&0!==t.scrollLeft&&0!==t.scrollTop||(f("Scrollbars out of sync. Updating detector elements..."),a(u))}},o(l).onExpand=h,o(l).onShrink=h;var m=o(l).style;s(l,m.width,m.height)}else f("Aborting because element has been uninstalled")}function _(){if(f("finalizeDomMutation invoked."),o(l)){var e=o(l).style;b(l,e.width,e.height),S(l,e.width,e.height)}else f("Aborting because element has been uninstalled")}function L(){h(l)}function A(){var e;f("Installing..."),o(l).listeners=[],e=m(),o(l).startSize={width:e.width,height:e.height},f("Element start size",o(l).startSize),n.add(0,v),n.add(1,$),n.add(2,E),n.add(3,_),n.add(4,L)}h||(h=l,l=e,e=null),e=e||{},f("Making detectable..."),function(e){return!function(e){var t=e.getRootNode&&e.getRootNode().contains(e);return e===e.ownerDocument.body||e.ownerDocument.body.contains(e)||t}(e)||null===window.getComputedStyle(e)}(l)?(f("Element is detached"),k(),f("Waiting until element is attached..."),o(l).onRendered=function(){f("Element is now attached"),A()}):A()},addListener:function(e,t){if(!o(e).listeners.push)throw new Error("Cannot add listener to an element that is not detectable.");o(e).listeners.push(t)},uninstall:function(e){var t=o(e);t&&(t.onExpandScroll&&h(d(e),"scroll",t.onExpandScroll),t.onShrinkScroll&&h(p(e),"scroll",t.onShrinkScroll),t.onAnimationStart&&h(t.container,"animationstart",t.onAnimationStart),t.container&&e.removeChild(t.container))},initDocument:l}}},1830:function(e,t,n){"use strict";var i=n(5808).forEach,o=n(6489),r=n(5943),s=n(8003),a=n(4906),l=n(2780),c=n(6259),u=n(5720),h=n(380),d=n(9191),p=n(7787);function f(e){return Array.isArray(e)||void 0!==e.length}function g(e){if(Array.isArray(e))return e;var t=[];return i(e,(function(e){t.push(e)})),t}function m(e){return e&&1===e.nodeType}function v(e,t,n){var i=e[t];return null==i&&void 0!==n?n:i}e.exports=function(e){var t;if((e=e||{}).idHandler)t={get:function(t){return e.idHandler.get(t,!0)},set:e.idHandler.set};else{var n=s(),b=a({idGenerator:n,stateHandler:h});t=b}var w=e.reporter;w||(w=l(!1===w));var y=v(e,"batchProcessor",u({reporter:w})),x={};x.callOnAdd=!!v(e,"callOnAdd",!0),x.debug=!!v(e,"debug",!1);var C,S=r(t),k=o({stateHandler:h}),$=v(e,"strategy","object"),E=v(e,"important",!1),_={reporter:w,batchProcessor:y,stateHandler:h,idHandler:t,important:E};if("scroll"===$&&(c.isLegacyOpera()?(w.warn("Scroll strategy is not supported on legacy Opera. Changing to object strategy."),$="object"):c.isIE(9)&&(w.warn("Scroll strategy is not supported on IE9. Changing to object strategy."),$="object")),"scroll"===$)C=p(_);else{if("object"!==$)throw new Error("Invalid strategy name: "+$);C=d(_)}var L={};return{listenTo:function(e,n,o){function r(e){var t=S.get(e);i(t,(function(t){t(e)}))}function s(e,t,n){S.add(t,n),e&&n(t)}if(o||(o=n,n=e,e={}),!n)throw new Error("At least one element required.");if(!o)throw new Error("Listener required.");if(m(n))n=[n];else{if(!f(n))return w.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");n=g(n)}var a=0,l=v(e,"callOnAdd",x.callOnAdd),c=v(e,"onReady",(function(){})),u=v(e,"debug",x.debug);i(n,(function(e){h.getState(e)||(h.initState(e),t.set(e));var d=t.get(e);if(u&&w.log("Attaching listener to element",d,e),!k.isDetectable(e))return u&&w.log(d,"Not detectable."),k.isBusy(e)?(u&&w.log(d,"System busy making it detectable"),s(l,e,o),L[d]=L[d]||[],void L[d].push((function(){++a===n.length&&c()}))):(u&&w.log(d,"Making detectable..."),k.markBusy(e,!0),C.makeDetectable({debug:u,important:E},e,(function(e){if(u&&w.log(d,"onElementDetectable"),h.getState(e)){k.markAsDetectable(e),k.markBusy(e,!1),C.addListener(e,r),s(l,e,o);var t=h.getState(e);if(t&&t.startSize){var p=e.offsetWidth,f=e.offsetHeight;t.startSize.width===p&&t.startSize.height===f||r(e)}L[d]&&i(L[d],(function(e){e()}))}else u&&w.log(d,"Element uninstalled before being detectable.");delete L[d],++a===n.length&&c()})));u&&w.log(d,"Already detecable, adding listener."),s(l,e,o),a++})),a===n.length&&c()},removeListener:S.removeListener,removeAllListeners:S.removeAllListeners,uninstall:function(e){if(!e)return w.error("At least one element is required.");if(m(e))e=[e];else{if(!f(e))return w.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");e=g(e)}i(e,(function(e){S.removeAllListeners(e),C.uninstall(e),h.cleanState(e)}))},initDocument:function(e){C.initDocument&&C.initDocument(e)}}}},6489:function(e){"use strict";e.exports=function(e){var t=e.stateHandler.getState;return{isDetectable:function(e){var n=t(e);return n&&!!n.isDetectable},markAsDetectable:function(e){t(e).isDetectable=!0},isBusy:function(e){return!!t(e).busy},markBusy:function(e,n){t(e).busy=!!n}}}},8003:function(e){"use strict";e.exports=function(){var e=1;return{generate:function(){return e++}}}},4906:function(e){"use strict";e.exports=function(e){var t=e.idGenerator,n=e.stateHandler.getState;return{get:function(e){var t=n(e);return t&&void 0!==t.id?t.id:null},set:function(e){var i=n(e);if(!i)throw new Error("setId required the element to have a resize detection state.");var o=t.generate();return i.id=o,o}}}},5943:function(e){"use strict";e.exports=function(e){var t={};function n(n){var i=e.get(n);return void 0===i?[]:t[i]||[]}return{get:n,add:function(n,i){var o=e.get(n);t[o]||(t[o]=[]),t[o].push(i)},removeListener:function(e,t){for(var i=n(e),o=0,r=i.length;o<r;++o)if(i[o]===t){i.splice(o,1);break}},removeAllListeners:function(e){var t=n(e);t&&(t.length=0)}}}},2780:function(e){"use strict";e.exports=function(e){function t(){}var n={log:t,warn:t,error:t};if(!e&&window.console){var i=function(e,t){e[t]=function(){var e=console[t];if(e.apply)e.apply(console,arguments);else for(var n=0;n<arguments.length;n++)e(arguments[n])}};i(n,"log"),i(n,"warn"),i(n,"error")}return n}},380:function(e){"use strict";function t(e){return e._erd}e.exports={initState:function(e){return e._erd={},t(e)},getState:t,cleanState:function(e){delete e._erd}}},3323:function(e,t,n){var i,o;"undefined"!=typeof window&&window,void 0===(o="function"==typeof(i=function(){"use strict";function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var n=this._events=this._events||{},i=n[e]=n[e]||[];return-1==i.indexOf(t)&&i.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var n=this._onceEvents=this._onceEvents||{};return(n[e]=n[e]||{})[t]=!0,this}},t.off=function(e,t){var n=this._events&&this._events[e];if(n&&n.length){var i=n.indexOf(t);return-1!=i&&n.splice(i,1),this}},t.emitEvent=function(e,t){var n=this._events&&this._events[e];if(n&&n.length){n=n.slice(0),t=t||[];for(var i=this._onceEvents&&this._onceEvents[e],o=0;o<n.length;o++){var r=n[o];i&&i[r]&&(this.off(e,r),delete i[r]),r.apply(this,t)}return this}},t.allOff=function(){delete this._events,delete this._onceEvents},e})?i.call(t,n,t,e):i)||(e.exports=o)},4664:function(e,t,n){var i,o;!function(r,s){i=[n(9476)],o=function(e){return function(e,t){"use strict";var n={extend:function(e,t){for(var n in t)e[n]=t[n];return e},modulo:function(e,t){return(e%t+t)%t}},i=Array.prototype.slice;n.makeArray=function(e){return Array.isArray(e)?e:null==e?[]:"object"==typeof e&&"number"==typeof e.length?i.call(e):[e]},n.removeFrom=function(e,t){var n=e.indexOf(t);-1!=n&&e.splice(n,1)},n.getParent=function(e,n){for(;e.parentNode&&e!=document.body;)if(e=e.parentNode,t(e,n))return e},n.getQueryElement=function(e){return"string"==typeof e?document.querySelector(e):e},n.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},n.filterFindElements=function(e,i){e=n.makeArray(e);var o=[];return e.forEach((function(e){if(e instanceof HTMLElement)if(i){t(e,i)&&o.push(e);for(var n=e.querySelectorAll(i),r=0;r<n.length;r++)o.push(n[r])}else o.push(e)})),o},n.debounceMethod=function(e,t,n){n=n||100;var i=e.prototype[t],o=t+"Timeout";e.prototype[t]=function(){var e=this[o];clearTimeout(e);var t=arguments,r=this;this[o]=setTimeout((function(){i.apply(r,t),delete r[o]}),n)}},n.docReady=function(e){var t=document.readyState;"complete"==t||"interactive"==t?setTimeout(e):document.addEventListener("DOMContentLoaded",e)},n.toDashed=function(e){return e.replace(/(.)([A-Z])/g,(function(e,t,n){return t+"-"+n})).toLowerCase()};var o=e.console;return n.htmlInit=function(t,i){n.docReady((function(){var r=n.toDashed(i),s="data-"+r,a=document.querySelectorAll("["+s+"]"),l=document.querySelectorAll(".js-"+r),c=n.makeArray(a).concat(n.makeArray(l)),u=s+"-options",h=e.jQuery;c.forEach((function(e){var n,r=e.getAttribute(s)||e.getAttribute(u);try{n=r&&JSON.parse(r)}catch(t){return void(o&&o.error("Error parsing "+s+" on "+e.className+": "+t))}var a=new t(e,n);h&&h.data(e,i,a)}))}))},n}(r,e)}.apply(t,i),void 0===o||(e.exports=o)}(window)},8768:function(e,t,n){var i,o;window,void 0===(o="function"==typeof(i=function(){"use strict";function e(e){var t=parseFloat(e);return-1==e.indexOf("%")&&!isNaN(t)&&t}var t="undefined"==typeof console?function(){}:function(e){console.error(e)},n=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],i=n.length;function o(e){var n=getComputedStyle(e);return n||t("Style returned "+n+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),n}var r,s=!1;function a(t){if(function(){if(!s){s=!0;var t=document.createElement("div");t.style.width="200px",t.style.padding="1px 2px 3px 4px",t.style.borderStyle="solid",t.style.borderWidth="1px 2px 3px 4px",t.style.boxSizing="border-box";var n=document.body||document.documentElement;n.appendChild(t);var i=o(t);r=200==Math.round(e(i.width)),a.isBoxSizeOuter=r,n.removeChild(t)}}(),"string"==typeof t&&(t=document.querySelector(t)),t&&"object"==typeof t&&t.nodeType){var l=o(t);if("none"==l.display)return function(){for(var e={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},t=0;t<i;t++)e[n[t]]=0;return e}();var c={};c.width=t.offsetWidth,c.height=t.offsetHeight;for(var u=c.isBorderBox="border-box"==l.boxSizing,h=0;h<i;h++){var d=n[h],p=l[d],f=parseFloat(p);c[d]=isNaN(f)?0:f}var g=c.paddingLeft+c.paddingRight,m=c.paddingTop+c.paddingBottom,v=c.marginLeft+c.marginRight,b=c.marginTop+c.marginBottom,w=c.borderLeftWidth+c.borderRightWidth,y=c.borderTopWidth+c.borderBottomWidth,x=u&&r,C=e(l.width);!1!==C&&(c.width=C+(x?0:g+w));var S=e(l.height);return!1!==S&&(c.height=S+(x?0:m+y)),c.innerWidth=c.width-(g+w),c.innerHeight=c.height-(m+y),c.outerWidth=c.width+v,c.outerHeight=c.height+b,c}}return a})?i.call(t,n,t,e):i)||(e.exports=o)},9271:function(e){e.exports={control:function(e,t){var n=Object.assign(e,{cursor:"pointer",minHeight:30});return n=t.isFocused&&!t.isDisabled?Object.assign(n,{borderColor:"#007cba"}):Object.assign(n,{borderColor:"#7e8993","&:hover":{borderColor:"#7e8993"}}),t.isFocused&&(n=Object.assign(n,{boxShadow:"0 0 0 1px #007cba","&:hover":{borderColor:"#007cba"}})),n},valueContainer:function(e){return Object.assign(e,{padding:"0 8px"})},input:function(e){return Object.assign(e,{margin:0,height:30,paddingTop:0,paddingBottom:0,input:{boxShadow:"none !important"}})},dropdownIndicator:function(e){return Object.assign(e,{padding:5,color:"#555555","&:hover":{color:"#555555"},svg:{width:17,height:17}})},clearIndicator:function(e){return Object.assign(e,{padding:5,svg:{width:15,height:15}})},indicatorSeparator:function(){return!1},multiValue:function(e){return Object.assign(e,{padding:"3px 4px",margin:4,marginLeft:0,borderRadius:15,backgroundColor:"#ddd"})},multiValueLabel:function(e){return Object.assign(e,{padding:0,color:"#32373c",fontSize:"90%"})},multiValueRemove:function(e){return Object.assign(e,{padding:0,marginLeft:5,marginTop:1,width:16,height:16,borderRadius:8,backgroundColor:"#555d66",color:"#ddd",justifyContent:"center",":hover":{backgroundColor:"#e02e2e",color:"#fff"},svg:{width:12,height:12}})},option:function(e,t){var n=Object.assign(e,{display:"flex",alignItems:"center",padding:"4px 10px"});return t.isFocused&&(n=Object.assign(n,{backgroundColor:"#efefef"})),t.isSelected&&(n=Object.assign(n,{backgroundColor:"#007cba"})),n},menu:function(e){return Object.assign(e,{zIndex:2})}}},9483:function(e,t,n){"use strict";var i=n(8740),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function l(e){return i.isMemo(e)?s:a[e.$$typeof]||o}a[i.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[i.Memo]=s;var c=Object.defineProperty,u=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,f=Object.prototype;e.exports=function e(t,n,i){if("string"!=typeof n){if(f){var o=p(n);o&&o!==f&&e(t,o,i)}var s=u(n);h&&(s=s.concat(h(n)));for(var a=l(t),g=l(n),m=0;m<s.length;++m){var v=s[m];if(!(r[v]||i&&i[v]||g&&g[v]||a&&a[v])){var b=d(n,v);try{c(t,v,b)}catch(e){}}}}return t}},1818:function(e,t){var n,i,o;!function(r){if("undefined"!=typeof window){var s,a=0,l=!1,c=!1,u="message".length,h="[iFrameSizer]",d=h.length,p=null,f=window.requestAnimationFrame,g={max:1,scroll:1,bodyScroll:1,documentElementScroll:1},m={},v=null,b={autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){E("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}},w={};window.jQuery&&((s=window.jQuery).fn?s.fn.iFrameResize||(s.fn.iFrameResize=function(e){return this.filter("iframe").each((function(t,n){B(n,e)})).end()}):$("","Unable to bind to jQuery, it is not fully loaded.")),i=[],(o="function"==typeof(n=V)?n.apply(t,i):n)===r||(e.exports=o),window.iFrameResize=window.iFrameResize||V()}function y(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function x(e,t,n){e.addEventListener(t,n,!1)}function C(e,t,n){e.removeEventListener(t,n,!1)}function S(e){return m[e]?m[e].log:l}function k(e,t){_("log",e,t,S(e))}function $(e,t){_("info",e,t,S(e))}function E(e,t){_("warn",e,t,!0)}function _(e,t,n,i){!0===i&&"object"==typeof window.console&&console[e](function(e){return h+"["+function(e){var t="Host page: "+e;return window.top!==window.self&&(t=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+e:"Nested host page: "+e),t}(e)+"]"}(t),n)}function L(e){function t(){n("Height"),n("Width"),F((function(){D(L),T(R),c("onResized",L)}),L,"init")}function n(e){var t=Number(m[R]["max"+e]),n=Number(m[R]["min"+e]),i=e.toLowerCase(),o=Number(L[i]);k(R,"Checking "+i+" is in range "+n+"-"+t),o<n&&(o=n,k(R,"Set "+i+" to min value")),o>t&&(o=t,k(R,"Set "+i+" to max value")),L[i]=""+o}function i(e){return _.substr(_.indexOf(":")+u+e)}function o(e,t){var n,i;n=function(){var n,i;N("Send Page Info","pageInfo:"+(n=document.body.getBoundingClientRect(),i=L.iframe.getBoundingClientRect(),JSON.stringify({iframeHeight:i.height,iframeWidth:i.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(i.top-n.top,10),offsetLeft:parseInt(i.left-n.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})),e,t)},w[i=t]||(w[i]=setTimeout((function(){w[i]=null,n()}),32))}function r(e){var t=e.getBoundingClientRect();return O(R),{x:Math.floor(Number(t.left)+Number(p.x)),y:Math.floor(Number(t.top)+Number(p.y))}}function s(e){var t=e?r(L.iframe):{x:0,y:0},n={x:Number(L.width)+t.x,y:Number(L.height)+t.y};k(R,"Reposition requested from iFrame (offset x:"+t.x+" y:"+t.y+")"),window.top!==window.self?window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](n.x,n.y):E(R,"Unable to scroll to requested position, window.parentIFrame not found"):(p=n,a(),k(R,"--"))}function a(){!1!==c("onScroll",p)?T(R):I()}function l(e){var t={};if(0===Number(L.width)&&0===Number(L.height)){var n=i(9).split(":");t={x:n[1],y:n[0]}}else t={x:L.width,y:L.height};c(e,{iframe:L.iframe,screenX:Number(t.x),screenY:Number(t.y),type:L.type})}function c(e,t){return A(R,e,t)}var f,g,v,b,y,S,_=e.data,L={},R=null;"[iFrameResizerChild]Ready"===_?function(){for(var e in m)N("iFrame requested init",z(e),m[e].iframe,e)}():h===(""+_).substr(0,d)&&_.substr(d).split(":")[0]in m?(b=(v=_.substr(d).split(":"))[1]?parseInt(v[1],10):0,y=m[v[0]]&&m[v[0]].iframe,S=getComputedStyle(y),L={iframe:y,id:v[0],height:b+function(e){return"border-box"!==e.boxSizing?0:(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}(S)+function(e){return"border-box"!==e.boxSizing?0:(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}(S),width:v[2],type:v[3]},R=L.id,m[R]&&(m[R].loaded=!0),(g=L.type in{true:1,false:1,undefined:1})&&k(R,"Ignoring init message from meta parent page"),!g&&function(e){var t=!0;return m[e]||(t=!1,E(L.type+" No settings for "+e+". Message was: "+_)),t}(R)&&(k(R,"Received: "+_),f=!0,null===L.iframe&&(E(R,"IFrame ("+L.id+") not found"),f=!1),f&&function(){var t,n=e.origin,i=m[R]&&m[R].checkOrigin;if(i&&""+n!="null"&&!(i.constructor===Array?function(){var e=0,t=!1;for(k(R,"Checking connection is from allowed list of origins: "+i);e<i.length;e++)if(i[e]===n){t=!0;break}return t}():(t=m[R]&&m[R].remoteHost,k(R,"Checking connection is from: "+t),n===t)))throw new Error("Unexpected message received from: "+n+" for "+L.iframe.id+". Message was: "+e.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(m[R]&&m[R].firstRun&&m[R]&&(m[R].firstRun=!1),L.type){case"close":M(L.iframe);break;case"message":d=i(6),k(R,"onMessage passed: {iframe: "+L.iframe.id+", message: "+d+"}"),c("onMessage",{iframe:L.iframe,message:JSON.parse(d)}),k(R,"--");break;case"mouseenter":l("onMouseEnter");break;case"mouseleave":l("onMouseLeave");break;case"autoResize":m[R].autoResize=JSON.parse(i(9));break;case"scrollTo":s(!1);break;case"scrollToOffset":s(!0);break;case"pageInfo":o(m[R]&&m[R].iframe,R),function(){function e(e,i){function r(){m[n]?o(m[n].iframe,n):t()}["scroll","resize"].forEach((function(t){k(n,e+t+" listener for sendPageInfo"),i(window,t,r)}))}function t(){e("Remove ",C)}var n=R;e("Add ",x),m[n]&&(m[n].stopPageInfo=t)}();break;case"pageInfoStop":m[R]&&m[R].stopPageInfo&&(m[R].stopPageInfo(),delete m[R].stopPageInfo);break;case"inPageLink":n=i(9).split("#")[1]||"",u=decodeURIComponent(n),(h=document.getElementById(u)||document.getElementsByName(u)[0])?(e=r(h),k(R,"Moving to in page link (#"+n+") at x: "+e.x+" y: "+e.y),p={x:e.x,y:e.y},a(),k(R,"--")):window.top!==window.self?window.parentIFrame?window.parentIFrame.moveToAnchor(n):k(R,"In page link #"+n+" not found and window.parentIFrame not found"):k(R,"In page link #"+n+" not found");break;case"reset":P(L);break;case"init":t(),c("onInit",L.iframe);break;default:0===Number(L.width)&&0===Number(L.height)?E("Unsupported message received ("+L.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):t()}var e,n,u,h,d}())):$(R,"Ignored: "+_)}function A(e,t,n){var i=null,o=null;if(m[e]){if("function"!=typeof(i=m[e][t]))throw new TypeError(t+" on iFrame["+e+"] is not a function");o=i(n)}return o}function R(e){var t=e.id;delete m[t]}function M(e){var t=e.id;if(!1!==A(t,"onClose",t)){k(t,"Removing iFrame: "+t);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){E(e)}A(t,"onClosed",t),k(t,"--"),R(e)}else k(t,"Close iframe cancelled by onClose event")}function O(e){null===p&&k(e,"Get page position: "+(p={x:window.pageXOffset!==r?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==r?window.pageYOffset:document.documentElement.scrollTop}).x+","+p.y)}function T(e){null!==p&&(window.scrollTo(p.x,p.y),k(e,"Set page position: "+p.x+","+p.y),I())}function I(){p=null}function P(e){k(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame")),O(e.id),F((function(){D(e),N("reset","reset",e.iframe,e.id)}),e,"reset")}function D(e){function t(t){c||"0"!==e[t]||(c=!0,k(i,"Hidden iFrame detected, creating visibility listener"),function(){function e(){Object.keys(m).forEach((function(e){!function(e){function t(t){return"0px"===(m[e]&&m[e].iframe.style[t])}m[e]&&null!==m[e].iframe.offsetParent&&(t("height")||t("width"))&&N("Visibility change","resize",m[e].iframe,e)}(e)}))}function t(t){k("window","Mutation observed: "+t[0].target+" "+t[0].type),j(e,16)}var n,i=y();i&&(n=document.querySelector("body"),new i(t).observe(n,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}))}())}function n(n){!function(t){e.id?(e.iframe.style[t]=e[t]+"px",k(e.id,"IFrame ("+i+") "+t+" set to "+e[t]+"px")):k("undefined","messageData id not set")}(n),t(n)}var i=e.iframe.id;m[i]&&(m[i].sizeHeight&&n("height"),m[i].sizeWidth&&n("width"))}function F(e,t,n){n!==t.type&&f&&!window.jasmine?(k(t.id,"Requesting animation frame"),f(e)):e()}function N(e,t,n,i,o){var r,s=!1;i=i||n.id,m[i]&&(n&&"contentWindow"in n&&null!==n.contentWindow?(r=m[i]&&m[i].targetOrigin,k(i,"["+e+"] Sending msg to iframe["+i+"] ("+t+") targetOrigin: "+r),n.contentWindow.postMessage(h+t,r)):E(i,"["+e+"] IFrame("+i+") not found"),o&&m[i]&&m[i].warningTimeout&&(m[i].msgTimeout=setTimeout((function(){!m[i]||m[i].loaded||s||(s=!0,E(i,"IFrame has not responded within "+m[i].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}),m[i].warningTimeout)))}function z(e){return e+":"+m[e].bodyMarginV1+":"+m[e].sizeWidth+":"+m[e].log+":"+m[e].interval+":"+m[e].enablePublicMethods+":"+m[e].autoResize+":"+m[e].bodyMargin+":"+m[e].heightCalculationMethod+":"+m[e].bodyBackground+":"+m[e].bodyPadding+":"+m[e].tolerance+":"+m[e].inPageLinks+":"+m[e].resizeFrom+":"+m[e].widthCalculationMethod+":"+m[e].mouseEvents}function B(e,t){function n(e){var t=e.split("Callback");if(2===t.length){var n="on"+t[0].charAt(0).toUpperCase()+t[0].slice(1);this[n]=this[e],delete this[e],E(i,"Deprecated: '"+e+"' has been renamed '"+n+"'. The old method will be removed in the next major version.")}}var i=function(n){var i;return""===n&&(e.id=(i=t&&t.id||b.id+a++,null!==document.getElementById(i)&&(i+=a++),n=i),l=(t||{}).log,k(n,"Added missing iframe ID: "+n+" ("+e.src+")")),n}(e.id);i in m&&"iFrameResizer"in e?E(i,"Ignored iFrame, already setup."):(function(t){var o;t=t||{},m[i]={firstRun:!0,iframe:e,remoteHost:e.src&&e.src.split("/").slice(0,3).join("/")},function(e){if("object"!=typeof e)throw new TypeError("Options is not an object")}(t),Object.keys(t).forEach(n,t),function(e){for(var t in b)Object.prototype.hasOwnProperty.call(b,t)&&(m[i][t]=Object.prototype.hasOwnProperty.call(e,t)?e[t]:b[t])}(t),m[i]&&(m[i].targetOrigin=!0===m[i].checkOrigin?""===(o=m[i].remoteHost)||null!==o.match(/^(about:blank|javascript:|file:\/\/)/)?"*":o:"*")}(t),function(){switch(k(i,"IFrame scrolling "+(m[i]&&m[i].scrolling?"enabled":"disabled")+" for "+i),e.style.overflow=!1===(m[i]&&m[i].scrolling)?"hidden":"auto",m[i]&&m[i].scrolling){case"omit":break;case!0:e.scrolling="yes";break;case!1:e.scrolling="no";break;default:e.scrolling=m[i]?m[i].scrolling:"no"}}(),function(){function t(t){var n=m[i][t];1/0!==n&&0!==n&&(e.style[t]=function(e){return"number"==typeof e}(n)?n+"px":n,k(i,"Set "+t+" = "+e.style[t]))}function n(e){if(m[i]["min"+e]>m[i]["max"+e])throw new Error("Value for min"+e+" can not be greater than max"+e)}n("Height"),n("Width"),t("maxHeight"),t("minHeight"),t("maxWidth"),t("minWidth")}(),"number"!=typeof(m[i]&&m[i].bodyMargin)&&"0"!==(m[i]&&m[i].bodyMargin)||(m[i].bodyMarginV1=m[i].bodyMargin,m[i].bodyMargin=m[i].bodyMargin+"px"),function(t){var n=y();n&&function(t){e.parentNode&&new t((function(t){t.forEach((function(t){Array.prototype.slice.call(t.removedNodes).forEach((function(t){t===e&&M(e)}))}))})).observe(e.parentNode,{childList:!0})}(n),x(e,"load",(function(){var n,o;N("iFrame.onload",t,e,r,!0),n=m[i]&&m[i].firstRun,o=m[i]&&m[i].heightCalculationMethod in g,!n&&o&&P({iframe:e,height:0,width:0,type:"init"})})),N("init",t,e,r,!0)}(z(i)),m[i]&&(m[i].iframe.iFrameResizer={close:M.bind(null,m[i].iframe),removeListeners:R.bind(null,m[i].iframe),resize:N.bind(null,"Window resize","resize",m[i].iframe),moveToAnchor:function(e){N("Move to anchor","moveToAnchor:"+e,m[i].iframe,i)},sendMessage:function(e){N("Send Message","message:"+(e=JSON.stringify(e)),m[i].iframe,i)}}))}function j(e,t){null===v&&(v=setTimeout((function(){v=null,e()}),t))}function W(){"hidden"!==document.visibilityState&&(k("document","Trigger event: Visiblity change"),j((function(){H("Tab Visable","resize")}),16))}function H(e,t){Object.keys(m).forEach((function(n){(function(e){return m[e]&&"parent"===m[e].resizeFrom&&m[e].autoResize&&!m[e].firstRun})(n)&&N(e,t,m[n].iframe,n)}))}function V(){function e(e,n){n&&(function(){if(!n.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==n.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+n.tagName+">")}(),B(n,e),t.push(n))}var t;return function(){var e,t=["moz","webkit","o","ms"];for(e=0;e<t.length&&!f;e+=1)f=window[t[e]+"RequestAnimationFrame"];f?f=f.bind(window):k("setup","RequestAnimationFrame not supported")}(),x(window,"message",L),x(window,"resize",(function(){k("window","Trigger event: resize"),j((function(){H("Window resize","resize")}),16)})),x(document,"visibilitychange",W),x(document,"-webkit-visibilitychange",W),function(n,i){switch(t=[],function(e){e&&e.enablePublicMethods&&E("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}(n),typeof i){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(i||"iframe"),e.bind(r,n));break;case"object":e(n,i);break;default:throw new TypeError("Unexpected data type ("+typeof i+")")}return t}}}()},3706:function(e,t,n){var i,o;!function(r,s){"use strict";i=[n(3323)],o=function(e){return function(e,t){var n=e.jQuery,i=e.console;function o(e,t){for(var n in t)e[n]=t[n];return e}var r=Array.prototype.slice;function s(e,t,a){if(!(this instanceof s))return new s(e,t,a);var l,c=e;"string"==typeof e&&(c=document.querySelectorAll(e)),c?(this.elements=(l=c,Array.isArray(l)?l:"object"==typeof l&&"number"==typeof l.length?r.call(l):[l]),this.options=o({},this.options),"function"==typeof t?a=t:o(this.options,t),a&&this.on("always",a),this.getImages(),n&&(this.jqDeferred=new n.Deferred),setTimeout(this.check.bind(this))):i.error("Bad element for imagesLoaded "+(c||e))}s.prototype=Object.create(t.prototype),s.prototype.options={},s.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},s.prototype.addElementImages=function(e){"IMG"==e.nodeName&&this.addImage(e),!0===this.options.background&&this.addElementBackgroundImages(e);var t=e.nodeType;if(t&&a[t]){for(var n=e.querySelectorAll("img"),i=0;i<n.length;i++){var o=n[i];this.addImage(o)}if("string"==typeof this.options.background){var r=e.querySelectorAll(this.options.background);for(i=0;i<r.length;i++){var s=r[i];this.addElementBackgroundImages(s)}}}};var a={1:!0,9:!0,11:!0};function l(e){this.img=e}function c(e,t){this.url=e,this.element=t,this.img=new Image}return s.prototype.addElementBackgroundImages=function(e){var t=getComputedStyle(e);if(t)for(var n=/url\((['"])?(.*?)\1\)/gi,i=n.exec(t.backgroundImage);null!==i;){var o=i&&i[2];o&&this.addBackground(o,e),i=n.exec(t.backgroundImage)}},s.prototype.addImage=function(e){var t=new l(e);this.images.push(t)},s.prototype.addBackground=function(e,t){var n=new c(e,t);this.images.push(n)},s.prototype.check=function(){var e=this;function t(t,n,i){setTimeout((function(){e.progress(t,n,i)}))}this.progressedCount=0,this.hasAnyBroken=!1,this.images.length?this.images.forEach((function(e){e.once("progress",t),e.check()})):this.complete()},s.prototype.progress=function(e,t,n){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded,this.emitEvent("progress",[this,e,t]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,e),this.progressedCount==this.images.length&&this.complete(),this.options.debug&&i&&i.log("progress: "+n,e,t)},s.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(e,[this]),this.emitEvent("always",[this]),this.jqDeferred){var t=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[t](this)}},l.prototype=Object.create(t.prototype),l.prototype.check=function(){this.getIsImageComplete()?this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.proxyImage.src=this.img.src)},l.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},l.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.img,t])},l.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},l.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},l.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},l.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},c.prototype=Object.create(l.prototype),c.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url,this.getIsImageComplete()&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},c.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},c.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.element,t])},s.makeJQueryPlugin=function(t){(t=t||e.jQuery)&&((n=t).fn.imagesLoaded=function(e,t){return new s(this,e,t).jqDeferred.promise(n(this))})},s.makeJQueryPlugin(),s}(r,e)}.apply(t,i),void 0===o||(e.exports=o)}("undefined"!=typeof window?window:this)},2456:function(e){"use strict";e.exports=function(e,t,n,i,o,r,s,a){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,i,o,r,s,a],u=0;(l=new Error(t.replace(/%s/g,(function(){return c[u++]})))).name="Invariant Violation"}throw l.framesToPop=1,l}}},2114:function(e,t,n){var i,o="__lodash_hash_undefined__",r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/,a=/^\./,l=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,c=/\\(\\)?/g,u=/^\[object .+?Constructor\]$/,h="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,d="object"==typeof self&&self&&self.Object===Object&&self,p=h||d||Function("return this")(),f=Array.prototype,g=Function.prototype,m=Object.prototype,v=p["__core-js_shared__"],b=(i=/[^.]+$/.exec(v&&v.keys&&v.keys.IE_PROTO||""))?"Symbol(src)_1."+i:"",w=g.toString,y=m.hasOwnProperty,x=m.toString,C=RegExp("^"+w.call(y).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),S=p.Symbol,k=f.splice,$=I(p,"Map"),E=I(Object,"create"),_=S?S.prototype:void 0,L=_?_.toString:void 0;function A(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function R(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function M(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function O(e,t){for(var n=e.length;n--;)if(N(e[n][0],t))return n;return-1}function T(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map}function I(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){if(!B(e)||b&&b in e)return!1;var t=function(e){var t=B(e)?x.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?C:u;return t.test(function(e){if(null!=e){try{return w.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}(n)?n:void 0}A.prototype.clear=function(){this.__data__=E?E(null):{}},A.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},A.prototype.get=function(e){var t=this.__data__;if(E){var n=t[e];return n===o?void 0:n}return y.call(t,e)?t[e]:void 0},A.prototype.has=function(e){var t=this.__data__;return E?void 0!==t[e]:y.call(t,e)},A.prototype.set=function(e,t){return this.__data__[e]=E&&void 0===t?o:t,this},R.prototype.clear=function(){this.__data__=[]},R.prototype.delete=function(e){var t=this.__data__,n=O(t,e);return!(n<0||(n==t.length-1?t.pop():k.call(t,n,1),0))},R.prototype.get=function(e){var t=this.__data__,n=O(t,e);return n<0?void 0:t[n][1]},R.prototype.has=function(e){return O(this.__data__,e)>-1},R.prototype.set=function(e,t){var n=this.__data__,i=O(n,e);return i<0?n.push([e,t]):n[i][1]=t,this},M.prototype.clear=function(){this.__data__={hash:new A,map:new($||R),string:new A}},M.prototype.delete=function(e){return T(this,e).delete(e)},M.prototype.get=function(e){return T(this,e).get(e)},M.prototype.has=function(e){return T(this,e).has(e)},M.prototype.set=function(e,t){return T(this,e).set(e,t),this};var P=F((function(e){e=function(e){return null==e?"":function(e){if("string"==typeof e)return e;if(j(e))return L?L.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(e);var t=[];return a.test(e)&&t.push(""),e.replace(l,(function(e,n,i,o){t.push(i?o.replace(c,"$1"):n||e)})),t}));function D(e){if("string"==typeof e||j(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function F(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var i=arguments,o=t?t.apply(this,i):i[0],r=n.cache;if(r.has(o))return r.get(o);var s=e.apply(this,i);return n.cache=r.set(o,s),s};return n.cache=new(F.Cache||M),n}function N(e,t){return e===t||e!=e&&t!=t}F.Cache=M;var z=Array.isArray;function B(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function j(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==x.call(e)}e.exports=function(e,t,n){var i=null==e?void 0:function(e,t){t=function(e,t){if(z(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!j(e))||s.test(e)||!r.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:function(e){return z(e)?e:P(e)}(t);for(var n=0,i=t.length;null!=e&&n<i;)e=e[D(t[n++])];return n&&n==i?e:void 0}(e,t);return void 0===i?n:i}},4327:function(e,t,n){e=n.nmd(e);var i="__lodash_hash_undefined__",o=9007199254740991,r="[object Arguments]",s="[object Array]",a="[object Boolean]",l="[object Date]",c="[object Error]",u="[object Function]",h="[object Map]",d="[object Number]",p="[object Object]",f="[object Promise]",g="[object RegExp]",m="[object Set]",v="[object String]",b="[object WeakMap]",w="[object ArrayBuffer]",y="[object DataView]",x=/^\[object .+?Constructor\]$/,C=/^(?:0|[1-9]\d*)$/,S={};S["[object Float32Array]"]=S["[object Float64Array]"]=S["[object Int8Array]"]=S["[object Int16Array]"]=S["[object Int32Array]"]=S["[object Uint8Array]"]=S["[object Uint8ClampedArray]"]=S["[object Uint16Array]"]=S["[object Uint32Array]"]=!0,S[r]=S[s]=S[w]=S[a]=S[y]=S[l]=S[c]=S[u]=S[h]=S[d]=S[p]=S[g]=S[m]=S[v]=S[b]=!1;var k="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,$="object"==typeof self&&self&&self.Object===Object&&self,E=k||$||Function("return this")(),_=t&&!t.nodeType&&t,L=_&&e&&!e.nodeType&&e,A=L&&L.exports===_,R=A&&k.process,M=function(){try{return R&&R.binding&&R.binding("util")}catch(e){}}(),O=M&&M.isTypedArray;function T(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1}function I(e){var t=-1,n=Array(e.size);return e.forEach((function(e,i){n[++t]=[i,e]})),n}function P(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var D,F,N,z=Array.prototype,B=Function.prototype,j=Object.prototype,W=E["__core-js_shared__"],H=B.toString,V=j.hasOwnProperty,U=(D=/[^.]+$/.exec(W&&W.keys&&W.keys.IE_PROTO||""))?"Symbol(src)_1."+D:"",G=j.toString,K=RegExp("^"+H.call(V).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),q=A?E.Buffer:void 0,Y=E.Symbol,X=E.Uint8Array,Q=j.propertyIsEnumerable,J=z.splice,Z=Y?Y.toStringTag:void 0,ee=Object.getOwnPropertySymbols,te=q?q.isBuffer:void 0,ne=(F=Object.keys,N=Object,function(e){return F(N(e))}),ie=Le(E,"DataView"),oe=Le(E,"Map"),re=Le(E,"Promise"),se=Le(E,"Set"),ae=Le(E,"WeakMap"),le=Le(Object,"create"),ce=Oe(ie),ue=Oe(oe),he=Oe(re),de=Oe(se),pe=Oe(ae),fe=Y?Y.prototype:void 0,ge=fe?fe.valueOf:void 0;function me(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function ve(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function be(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function we(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new be;++t<n;)this.add(e[t])}function ye(e){var t=this.__data__=new ve(e);this.size=t.size}function xe(e,t){for(var n=e.length;n--;)if(Te(e[n][0],t))return n;return-1}function Ce(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Z&&Z in Object(e)?function(e){var t=V.call(e,Z),n=e[Z];try{e[Z]=void 0;var i=!0}catch(e){}var o=G.call(e);return i&&(t?e[Z]=n:delete e[Z]),o}(e):function(e){return G.call(e)}(e)}function Se(e){return Be(e)&&Ce(e)==r}function ke(e,t,n,i,o){return e===t||(null==e||null==t||!Be(e)&&!Be(t)?e!=e&&t!=t:function(e,t,n,i,o,u){var f=Pe(e),b=Pe(t),x=f?s:Re(e),C=b?s:Re(t),S=(x=x==r?p:x)==p,k=(C=C==r?p:C)==p,$=x==C;if($&&De(e)){if(!De(t))return!1;f=!0,S=!1}if($&&!S)return u||(u=new ye),f||je(e)?$e(e,t,n,i,o,u):function(e,t,n,i,o,r,s){switch(n){case y:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case w:return!(e.byteLength!=t.byteLength||!r(new X(e),new X(t)));case a:case l:case d:return Te(+e,+t);case c:return e.name==t.name&&e.message==t.message;case g:case v:return e==t+"";case h:var u=I;case m:var p=1&i;if(u||(u=P),e.size!=t.size&&!p)return!1;var f=s.get(e);if(f)return f==t;i|=2,s.set(e,t);var b=$e(u(e),u(t),i,o,r,s);return s.delete(e),b;case"[object Symbol]":if(ge)return ge.call(e)==ge.call(t)}return!1}(e,t,x,n,i,o,u);if(!(1&n)){var E=S&&V.call(e,"__wrapped__"),_=k&&V.call(t,"__wrapped__");if(E||_){var L=E?e.value():e,A=_?t.value():t;return u||(u=new ye),o(L,A,n,i,u)}}return!!$&&(u||(u=new ye),function(e,t,n,i,o,r){var s=1&n,a=Ee(e),l=a.length;if(l!=Ee(t).length&&!s)return!1;for(var c=l;c--;){var u=a[c];if(!(s?u in t:V.call(t,u)))return!1}var h=r.get(e);if(h&&r.get(t))return h==t;var d=!0;r.set(e,t),r.set(t,e);for(var p=s;++c<l;){var f=e[u=a[c]],g=t[u];if(i)var m=s?i(g,f,u,t,e,r):i(f,g,u,e,t,r);if(!(void 0===m?f===g||o(f,g,n,i,r):m)){d=!1;break}p||(p="constructor"==u)}if(d&&!p){var v=e.constructor,b=t.constructor;v==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof b&&b instanceof b||(d=!1)}return r.delete(e),r.delete(t),d}(e,t,n,i,o,u))}(e,t,n,i,ke,o))}function $e(e,t,n,i,o,r){var s=1&n,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var c=r.get(e);if(c&&r.get(t))return c==t;var u=-1,h=!0,d=2&n?new we:void 0;for(r.set(e,t),r.set(t,e);++u<a;){var p=e[u],f=t[u];if(i)var g=s?i(f,p,u,t,e,r):i(p,f,u,e,t,r);if(void 0!==g){if(g)continue;h=!1;break}if(d){if(!T(t,(function(e,t){if(s=t,!d.has(s)&&(p===e||o(p,e,n,i,r)))return d.push(t);var s}))){h=!1;break}}else if(p!==f&&!o(p,f,n,i,r)){h=!1;break}}return r.delete(e),r.delete(t),h}function Ee(e){return function(e,t,n){var i=t(e);return Pe(e)?i:function(e,t){for(var n=-1,i=t.length,o=e.length;++n<i;)e[o+n]=t[n];return e}(i,n(e))}(e,We,Ae)}function _e(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map}function Le(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!ze(e)||function(e){return!!U&&U in e}(e))&&(Fe(e)?K:x).test(Oe(e))}(n)?n:void 0}me.prototype.clear=function(){this.__data__=le?le(null):{},this.size=0},me.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},me.prototype.get=function(e){var t=this.__data__;if(le){var n=t[e];return n===i?void 0:n}return V.call(t,e)?t[e]:void 0},me.prototype.has=function(e){var t=this.__data__;return le?void 0!==t[e]:V.call(t,e)},me.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=le&&void 0===t?i:t,this},ve.prototype.clear=function(){this.__data__=[],this.size=0},ve.prototype.delete=function(e){var t=this.__data__,n=xe(t,e);return!(n<0||(n==t.length-1?t.pop():J.call(t,n,1),--this.size,0))},ve.prototype.get=function(e){var t=this.__data__,n=xe(t,e);return n<0?void 0:t[n][1]},ve.prototype.has=function(e){return xe(this.__data__,e)>-1},ve.prototype.set=function(e,t){var n=this.__data__,i=xe(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this},be.prototype.clear=function(){this.size=0,this.__data__={hash:new me,map:new(oe||ve),string:new me}},be.prototype.delete=function(e){var t=_e(this,e).delete(e);return this.size-=t?1:0,t},be.prototype.get=function(e){return _e(this,e).get(e)},be.prototype.has=function(e){return _e(this,e).has(e)},be.prototype.set=function(e,t){var n=_e(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this},we.prototype.add=we.prototype.push=function(e){return this.__data__.set(e,i),this},we.prototype.has=function(e){return this.__data__.has(e)},ye.prototype.clear=function(){this.__data__=new ve,this.size=0},ye.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ye.prototype.get=function(e){return this.__data__.get(e)},ye.prototype.has=function(e){return this.__data__.has(e)},ye.prototype.set=function(e,t){var n=this.__data__;if(n instanceof ve){var i=n.__data__;if(!oe||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new be(i)}return n.set(e,t),this.size=n.size,this};var Ae=ee?function(e){return null==e?[]:(e=Object(e),function(t,n){for(var i=-1,o=null==t?0:t.length,r=0,s=[];++i<o;){var a=t[i];l=a,Q.call(e,l)&&(s[r++]=a)}var l;return s}(ee(e)))}:function(){return[]},Re=Ce;function Me(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||C.test(e))&&e>-1&&e%1==0&&e<t}function Oe(e){if(null!=e){try{return H.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Te(e,t){return e===t||e!=e&&t!=t}(ie&&Re(new ie(new ArrayBuffer(1)))!=y||oe&&Re(new oe)!=h||re&&Re(re.resolve())!=f||se&&Re(new se)!=m||ae&&Re(new ae)!=b)&&(Re=function(e){var t=Ce(e),n=t==p?e.constructor:void 0,i=n?Oe(n):"";if(i)switch(i){case ce:return y;case ue:return h;case he:return f;case de:return m;case pe:return b}return t});var Ie=Se(function(){return arguments}())?Se:function(e){return Be(e)&&V.call(e,"callee")&&!Q.call(e,"callee")},Pe=Array.isArray,De=te||function(){return!1};function Fe(e){if(!ze(e))return!1;var t=Ce(e);return t==u||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ne(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}function ze(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Be(e){return null!=e&&"object"==typeof e}var je=O?function(e){return function(t){return e(t)}}(O):function(e){return Be(e)&&Ne(e.length)&&!!S[Ce(e)]};function We(e){return function(e){return null!=e&&Ne(e.length)&&!Fe(e)}(e)?function(e,t){var n=Pe(e),i=!n&&Ie(e),o=!n&&!i&&De(e),r=!n&&!i&&!o&&je(e),s=n||i||o||r,a=s?function(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}(e.length,String):[],l=a.length;for(var c in e)!t&&!V.call(e,c)||s&&("length"==c||o&&("offset"==c||"parent"==c)||r&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Me(c,l))||a.push(c);return a}(e):function(e){if(!function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||j)}(e))return ne(e);var t=[];for(var n in Object(e))V.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}e.exports=function(e,t){return ke(e,t)}},7128:function(e,t,n){var i=n(1095)(n(4366),"DataView");e.exports=i},8431:function(e,t,n){var i=n(2514),o=n(5485),r=n(243),s=n(8454),a=n(3984);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}l.prototype.clear=i,l.prototype.delete=o,l.prototype.get=r,l.prototype.has=s,l.prototype.set=a,e.exports=l},3472:function(e,t,n){var i=n(9801),o=n(2442),r=n(8146),s=n(4612),a=n(6275);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}l.prototype.clear=i,l.prototype.delete=o,l.prototype.get=r,l.prototype.has=s,l.prototype.set=a,e.exports=l},6588:function(e,t,n){var i=n(1095)(n(4366),"Map");e.exports=i},460:function(e,t,n){var i=n(4917),o=n(6890),r=n(9413),s=n(3583),a=n(9399);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}l.prototype.clear=i,l.prototype.delete=o,l.prototype.get=r,l.prototype.has=s,l.prototype.set=a,e.exports=l},9019:function(e,t,n){var i=n(1095)(n(4366),"Promise");e.exports=i},6202:function(e,t,n){var i=n(1095)(n(4366),"Set");e.exports=i},9245:function(e,t,n){var i=n(3472),o=n(8276),r=n(2342),s=n(8062),a=n(1857),l=n(8969);function c(e){var t=this.__data__=new i(e);this.size=t.size}c.prototype.clear=o,c.prototype.delete=r,c.prototype.get=s,c.prototype.has=a,c.prototype.set=l,e.exports=c},7206:function(e,t,n){var i=n(4366).Symbol;e.exports=i},7729:function(e,t,n){var i=n(4366).Uint8Array;e.exports=i},3975:function(e,t,n){var i=n(1095)(n(4366),"WeakMap");e.exports=i},8998:function(e){e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},718:function(e){e.exports=function(e,t){for(var n=-1,i=null==e?0:e.length;++n<i&&!1!==t(e[n],n,e););return e}},7422:function(e){e.exports=function(e,t){for(var n=-1,i=null==e?0:e.length,o=0,r=[];++n<i;){var s=e[n];t(s,n,e)&&(r[o++]=s)}return r}},558:function(e,t,n){var i=n(7498),o=n(3255),r=n(1304),s=n(8448),a=n(2049),l=n(7592),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=r(e),u=!n&&o(e),h=!n&&!u&&s(e),d=!n&&!u&&!h&&l(e),p=n||u||h||d,f=p?i(e.length,String):[],g=f.length;for(var m in e)!t&&!c.call(e,m)||p&&("length"==m||h&&("offset"==m||"parent"==m)||d&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||a(m,g))||f.push(m);return f}},3994:function(e){e.exports=function(e,t){for(var n=-1,i=null==e?0:e.length,o=Array(i);++n<i;)o[n]=t(e[n],n,e);return o}},6873:function(e){e.exports=function(e,t){for(var n=-1,i=t.length,o=e.length;++n<i;)e[o+n]=t[n];return e}},489:function(e,t,n){var i=n(8203),o=n(3114),r=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var s=e[t];r.call(e,t)&&o(s,n)&&(void 0!==n||t in e)||i(e,t,n)}},5509:function(e,t,n){var i=n(3114);e.exports=function(e,t){for(var n=e.length;n--;)if(i(e[n][0],t))return n;return-1}},4760:function(e,t,n){var i=n(6965),o=n(3115);e.exports=function(e,t){return e&&i(t,o(t),e)}},9555:function(e,t,n){var i=n(6965),o=n(8134);e.exports=function(e,t){return e&&i(t,o(t),e)}},8203:function(e,t,n){var i=n(3612);e.exports=function(e,t,n){"__proto__"==t&&i?i(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},677:function(e,t,n){var i=n(9245),o=n(718),r=n(489),s=n(4760),a=n(9555),l=n(8043),c=n(4367),u=n(1711),h=n(8135),d=n(5582),p=n(782),f=n(8657),g=n(4512),m=n(7051),v=n(7074),b=n(1304),w=n(8448),y=n(9331),x=n(1716),C=n(7351),S=n(3115),k=n(8134),$="[object Arguments]",E="[object Function]",_="[object Object]",L={};L[$]=L["[object Array]"]=L["[object ArrayBuffer]"]=L["[object DataView]"]=L["[object Boolean]"]=L["[object Date]"]=L["[object Float32Array]"]=L["[object Float64Array]"]=L["[object Int8Array]"]=L["[object Int16Array]"]=L["[object Int32Array]"]=L["[object Map]"]=L["[object Number]"]=L[_]=L["[object RegExp]"]=L["[object Set]"]=L["[object String]"]=L["[object Symbol]"]=L["[object Uint8Array]"]=L["[object Uint8ClampedArray]"]=L["[object Uint16Array]"]=L["[object Uint32Array]"]=!0,L["[object Error]"]=L[E]=L["[object WeakMap]"]=!1,e.exports=function e(t,n,A,R,M,O){var T,I=1&n,P=2&n,D=4&n;if(A&&(T=M?A(t,R,M,O):A(t)),void 0!==T)return T;if(!x(t))return t;var F=b(t);if(F){if(T=g(t),!I)return c(t,T)}else{var N=f(t),z=N==E||"[object GeneratorFunction]"==N;if(w(t))return l(t,I);if(N==_||N==$||z&&!M){if(T=P||z?{}:v(t),!I)return P?h(t,a(T,t)):u(t,s(T,t))}else{if(!L[N])return M?t:{};T=m(t,N,I)}}O||(O=new i);var B=O.get(t);if(B)return B;O.set(t,T),C(t)?t.forEach((function(i){T.add(e(i,n,A,i,t,O))})):y(t)&&t.forEach((function(i,o){T.set(o,e(i,n,A,o,t,O))}));var j=F?void 0:(D?P?p:d:P?k:S)(t);return o(j||t,(function(i,o){j&&(i=t[o=i]),r(T,o,e(i,n,A,o,t,O))})),T}},9920:function(e,t,n){var i=n(1716),o=Object.create,r=function(){function e(){}return function(t){if(!i(t))return{};if(o)return o(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=r},1725:function(e,t,n){var i=n(6873),o=n(1542);e.exports=function e(t,n,r,s,a){var l=-1,c=t.length;for(r||(r=o),a||(a=[]);++l<c;){var u=t[l];n>0&&r(u)?n>1?e(u,n-1,r,s,a):i(a,u):s||(a[a.length]=u)}return a}},2457:function(e,t,n){var i=n(3378),o=n(9998);e.exports=function(e,t){for(var n=0,r=(t=i(t,e)).length;null!=e&&n<r;)e=e[o(t[n++])];return n&&n==r?e:void 0}},3921:function(e,t,n){var i=n(6873),o=n(1304);e.exports=function(e,t,n){var r=t(e);return o(e)?r:i(r,n(e))}},7807:function(e,t,n){var i=n(7206),o=n(3187),r=n(2778),s=i?i.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?o(e):r(e)}},9353:function(e,t,n){var i=n(7807),o=n(8667);e.exports=function(e){return o(e)&&"[object Arguments]"==i(e)}},4219:function(e,t,n){var i=n(8657),o=n(8667);e.exports=function(e){return o(e)&&"[object Map]"==i(e)}},2254:function(e,t,n){var i=n(5220),o=n(4528),r=n(1716),s=n(8255),a=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,u=l.toString,h=c.hasOwnProperty,d=RegExp("^"+u.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!r(e)||o(e))&&(i(e)?d:a).test(s(e))}},4548:function(e,t,n){var i=n(8657),o=n(8667);e.exports=function(e){return o(e)&&"[object Set]"==i(e)}},3723:function(e,t,n){var i=n(7807),o=n(5543),r=n(8667),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,e.exports=function(e){return r(e)&&o(e.length)&&!!s[i(e)]}},571:function(e,t,n){var i=n(2563),o=n(7548),r=Object.prototype.hasOwnProperty;e.exports=function(e){if(!i(e))return o(e);var t=[];for(var n in Object(e))r.call(e,n)&&"constructor"!=n&&t.push(n);return t}},8048:function(e,t,n){var i=n(1716),o=n(2563),r=n(6191),s=Object.prototype.hasOwnProperty;e.exports=function(e){if(!i(e))return r(e);var t=o(e),n=[];for(var a in e)("constructor"!=a||!t&&s.call(e,a))&&n.push(a);return n}},6307:function(e,t,n){var i=n(3967),o=n(5212),r=n(9125);e.exports=function(e,t){return r(o(e,t,i),e+"")}},6986:function(e,t,n){var i=n(5464),o=n(3612),r=n(3967),s=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:i(t),writable:!0})}:r;e.exports=s},2323:function(e){e.exports=function(e,t,n){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var r=Array(o);++i<o;)r[i]=e[i+t];return r}},7498:function(e){e.exports=function(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}},9697:function(e,t,n){var i=n(7206),o=n(3994),r=n(1304),s=n(2570),a=i?i.prototype:void 0,l=a?a.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(r(t))return o(t,e)+"";if(s(t))return l?l.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},4182:function(e,t,n){var i=n(9135),o=/^\s+/;e.exports=function(e){return e?e.slice(0,i(e)+1).replace(o,""):e}},6618:function(e){e.exports=function(e){return function(t){return e(t)}}},4730:function(e,t,n){var i=n(3378),o=n(561),r=n(7468),s=n(9998);e.exports=function(e,t){return t=i(t,e),null==(e=r(e,t))||delete e[s(o(t))]}},3378:function(e,t,n){var i=n(1304),o=n(8225),r=n(2140),s=n(31);e.exports=function(e,t){return i(e)?e:o(e,t)?[e]:r(s(e))}},1126:function(e,t,n){var i=n(7729);e.exports=function(e){var t=new e.constructor(e.byteLength);return new i(t).set(new i(e)),t}},8043:function(e,t,n){e=n.nmd(e);var i=n(4366),o=t&&!t.nodeType&&t,r=o&&e&&!e.nodeType&&e,s=r&&r.exports===o?i.Buffer:void 0,a=s?s.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,i=a?a(n):new e.constructor(n);return e.copy(i),i}},7296:function(e,t,n){var i=n(1126);e.exports=function(e,t){var n=t?i(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},2587:function(e){var t=/\w*$/;e.exports=function(e){var n=new e.constructor(e.source,t.exec(e));return n.lastIndex=e.lastIndex,n}},66:function(e,t,n){var i=n(7206),o=i?i.prototype:void 0,r=o?o.valueOf:void 0;e.exports=function(e){return r?Object(r.call(e)):{}}},2237:function(e,t,n){var i=n(1126);e.exports=function(e,t){var n=t?i(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},4367:function(e){e.exports=function(e,t){var n=-1,i=e.length;for(t||(t=Array(i));++n<i;)t[n]=e[n];return t}},6965:function(e,t,n){var i=n(489),o=n(8203);e.exports=function(e,t,n,r){var s=!n;n||(n={});for(var a=-1,l=t.length;++a<l;){var c=t[a],u=r?r(n[c],e[c],c,n,e):void 0;void 0===u&&(u=e[c]),s?o(n,c,u):i(n,c,u)}return n}},1711:function(e,t,n){var i=n(6965),o=n(461);e.exports=function(e,t){return i(e,o(e),t)}},8135:function(e,t,n){var i=n(6965),o=n(8530);e.exports=function(e,t){return i(e,o(e),t)}},8510:function(e,t,n){var i=n(4366)["__core-js_shared__"];e.exports=i},6772:function(e,t,n){var i=n(6307),o=n(965);e.exports=function(e){return i((function(t,n){var i=-1,r=n.length,s=r>1?n[r-1]:void 0,a=r>2?n[2]:void 0;for(s=e.length>3&&"function"==typeof s?(r--,s):void 0,a&&o(n[0],n[1],a)&&(s=r<3?void 0:s,r=1),t=Object(t);++i<r;){var l=n[i];l&&e(t,l,i,s)}return t}))}},6985:function(e,t,n){var i=n(1928);e.exports=function(e){return i(e)?void 0:e}},3612:function(e,t,n){var i=n(1095),o=function(){try{var e=i(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},929:function(e,t,n){var i=n(7159),o=n(5212),r=n(9125);e.exports=function(e){return r(o(e,void 0,i),e+"")}},4891:function(e,t,n){var i="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=i},5582:function(e,t,n){var i=n(3921),o=n(461),r=n(3115);e.exports=function(e){return i(e,r,o)}},782:function(e,t,n){var i=n(3921),o=n(8530),r=n(8134);e.exports=function(e){return i(e,r,o)}},3872:function(e,t,n){var i=n(2754);e.exports=function(e,t){var n=e.__data__;return i(t)?n["string"==typeof t?"string":"hash"]:n.map}},1095:function(e,t,n){var i=n(2254),o=n(4781);e.exports=function(e,t){var n=o(e,t);return i(n)?n:void 0}},9743:function(e,t,n){var i=n(8033)(Object.getPrototypeOf,Object);e.exports=i},3187:function(e,t,n){var i=n(7206),o=Object.prototype,r=o.hasOwnProperty,s=o.toString,a=i?i.toStringTag:void 0;e.exports=function(e){var t=r.call(e,a),n=e[a];try{e[a]=void 0;var i=!0}catch(e){}var o=s.call(e);return i&&(t?e[a]=n:delete e[a]),o}},461:function(e,t,n){var i=n(7422),o=n(2616),r=Object.prototype.propertyIsEnumerable,s=Object.getOwnPropertySymbols,a=s?function(e){return null==e?[]:(e=Object(e),i(s(e),(function(t){return r.call(e,t)})))}:o;e.exports=a},8530:function(e,t,n){var i=n(6873),o=n(9743),r=n(461),s=n(2616),a=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)i(t,r(e)),e=o(e);return t}:s;e.exports=a},8657:function(e,t,n){var i=n(7128),o=n(6588),r=n(9019),s=n(6202),a=n(3975),l=n(7807),c=n(8255),u="[object Map]",h="[object Promise]",d="[object Set]",p="[object WeakMap]",f="[object DataView]",g=c(i),m=c(o),v=c(r),b=c(s),w=c(a),y=l;(i&&y(new i(new ArrayBuffer(1)))!=f||o&&y(new o)!=u||r&&y(r.resolve())!=h||s&&y(new s)!=d||a&&y(new a)!=p)&&(y=function(e){var t=l(e),n="[object Object]"==t?e.constructor:void 0,i=n?c(n):"";if(i)switch(i){case g:return f;case m:return u;case v:return h;case b:return d;case w:return p}return t}),e.exports=y},4781:function(e){e.exports=function(e,t){return null==e?void 0:e[t]}},2514:function(e,t,n){var i=n(9535);e.exports=function(){this.__data__=i?i(null):{},this.size=0}},5485:function(e){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},243:function(e,t,n){var i=n(9535),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(i){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(t,e)?t[e]:void 0}},8454:function(e,t,n){var i=n(9535),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return i?void 0!==t[e]:o.call(t,e)}},3984:function(e,t,n){var i=n(9535);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=i&&void 0===t?"__lodash_hash_undefined__":t,this}},4512:function(e){var t=Object.prototype.hasOwnProperty;e.exports=function(e){var n=e.length,i=new e.constructor(n);return n&&"string"==typeof e[0]&&t.call(e,"index")&&(i.index=e.index,i.input=e.input),i}},7051:function(e,t,n){var i=n(1126),o=n(7296),r=n(2587),s=n(66),a=n(2237);e.exports=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return i(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return o(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return a(e,n);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(e);case"[object RegExp]":return r(e);case"[object Symbol]":return s(e)}}},7074:function(e,t,n){var i=n(9920),o=n(9743),r=n(2563);e.exports=function(e){return"function"!=typeof e.constructor||r(e)?{}:i(o(e))}},1542:function(e,t,n){var i=n(7206),o=n(3255),r=n(1304),s=i?i.isConcatSpreadable:void 0;e.exports=function(e){return r(e)||o(e)||!!(s&&e&&e[s])}},2049:function(e){var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var i=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==i||"symbol"!=i&&t.test(e))&&e>-1&&e%1==0&&e<n}},965:function(e,t,n){var i=n(3114),o=n(3347),r=n(2049),s=n(1716);e.exports=function(e,t,n){if(!s(n))return!1;var a=typeof t;return!!("number"==a?o(n)&&r(t,n.length):"string"==a&&t in n)&&i(n[t],e)}},8225:function(e,t,n){var i=n(1304),o=n(2570),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;e.exports=function(e,t){if(i(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!o(e))||s.test(e)||!r.test(e)||null!=t&&e in Object(t)}},2754:function(e){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},4528:function(e,t,n){var i,o=n(8510),r=(i=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+i:"";e.exports=function(e){return!!r&&r in e}},2563:function(e){var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},9801:function(e){e.exports=function(){this.__data__=[],this.size=0}},2442:function(e,t,n){var i=n(5509),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=i(t,e);return!(n<0||(n==t.length-1?t.pop():o.call(t,n,1),--this.size,0))}},8146:function(e,t,n){var i=n(5509);e.exports=function(e){var t=this.__data__,n=i(t,e);return n<0?void 0:t[n][1]}},4612:function(e,t,n){var i=n(5509);e.exports=function(e){return i(this.__data__,e)>-1}},6275:function(e,t,n){var i=n(5509);e.exports=function(e,t){var n=this.__data__,o=i(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},4917:function(e,t,n){var i=n(8431),o=n(3472),r=n(6588);e.exports=function(){this.size=0,this.__data__={hash:new i,map:new(r||o),string:new i}}},6890:function(e,t,n){var i=n(3872);e.exports=function(e){var t=i(this,e).delete(e);return this.size-=t?1:0,t}},9413:function(e,t,n){var i=n(3872);e.exports=function(e){return i(this,e).get(e)}},3583:function(e,t,n){var i=n(3872);e.exports=function(e){return i(this,e).has(e)}},9399:function(e,t,n){var i=n(3872);e.exports=function(e,t){var n=i(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},2415:function(e,t,n){var i=n(6210);e.exports=function(e){var t=i(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},9535:function(e,t,n){var i=n(1095)(Object,"create");e.exports=i},7548:function(e,t,n){var i=n(8033)(Object.keys,Object);e.exports=i},6191:function(e){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},8820:function(e,t,n){e=n.nmd(e);var i=n(4891),o=t&&!t.nodeType&&t,r=o&&e&&!e.nodeType&&e,s=r&&r.exports===o&&i.process,a=function(){try{return r&&r.require&&r.require("util").types||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=a},2778:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},8033:function(e){e.exports=function(e,t){return function(n){return e(t(n))}}},5212:function(e,t,n){var i=n(8998),o=Math.max;e.exports=function(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var r=arguments,s=-1,a=o(r.length-t,0),l=Array(a);++s<a;)l[s]=r[t+s];s=-1;for(var c=Array(t+1);++s<t;)c[s]=r[s];return c[t]=n(l),i(e,this,c)}}},7468:function(e,t,n){var i=n(2457),o=n(2323);e.exports=function(e,t){return t.length<2?e:i(e,o(t,0,-1))}},4366:function(e,t,n){var i=n(4891),o="object"==typeof self&&self&&self.Object===Object&&self,r=i||o||Function("return this")();e.exports=r},9125:function(e,t,n){var i=n(6986),o=n(2929)(i);e.exports=o},2929:function(e){var t=Date.now;e.exports=function(e){var n=0,i=0;return function(){var o=t(),r=16-(o-i);if(i=o,r>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},8276:function(e,t,n){var i=n(3472);e.exports=function(){this.__data__=new i,this.size=0}},2342:function(e){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},8062:function(e){e.exports=function(e){return this.__data__.get(e)}},1857:function(e){e.exports=function(e){return this.__data__.has(e)}},8969:function(e,t,n){var i=n(3472),o=n(6588),r=n(460);e.exports=function(e,t){var n=this.__data__;if(n instanceof i){var s=n.__data__;if(!o||s.length<199)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new r(s)}return n.set(e,t),this.size=n.size,this}},2140:function(e,t,n){var i=n(2415),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,s=i((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o,(function(e,n,i,o){t.push(i?o.replace(r,"$1"):n||e)})),t}));e.exports=s},9998:function(e,t,n){var i=n(2570);e.exports=function(e){if("string"==typeof e||i(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},8255:function(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},9135:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},3182:function(e,t,n){var i=n(489),o=n(6965),r=n(6772),s=n(3347),a=n(2563),l=n(3115),c=Object.prototype.hasOwnProperty,u=r((function(e,t){if(a(t)||s(t))o(t,l(t),e);else for(var n in t)c.call(t,n)&&i(e,n,t[n])}));e.exports=u},5464:function(e){e.exports=function(e){return function(){return e}}},3645:function(e,t,n){var i=n(1716),o=n(9244),r=n(1666),s=Math.max,a=Math.min;e.exports=function(e,t,n){var l,c,u,h,d,p,f=0,g=!1,m=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function b(t){var n=l,i=c;return l=c=void 0,f=t,h=e.apply(i,n)}function w(e){return f=e,d=setTimeout(x,t),g?b(e):h}function y(e){var n=e-p;return void 0===p||n>=t||n<0||m&&e-f>=u}function x(){var e=o();if(y(e))return C(e);d=setTimeout(x,function(e){var n=t-(e-p);return m?a(n,u-(e-f)):n}(e))}function C(e){return d=void 0,v&&l?b(e):(l=c=void 0,h)}function S(){var e=o(),n=y(e);if(l=arguments,c=this,p=e,n){if(void 0===d)return w(p);if(m)return clearTimeout(d),d=setTimeout(x,t),b(p)}return void 0===d&&(d=setTimeout(x,t)),h}return t=r(t)||0,i(n)&&(g=!!n.leading,u=(m="maxWait"in n)?s(r(n.maxWait)||0,t):u,v="trailing"in n?!!n.trailing:v),S.cancel=function(){void 0!==d&&clearTimeout(d),f=0,l=p=c=d=void 0},S.flush=function(){return void 0===d?h:C(o())},S}},3114:function(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},7159:function(e,t,n){var i=n(1725);e.exports=function(e){return null!=e&&e.length?i(e,1):[]}},3967:function(e){e.exports=function(e){return e}},3255:function(e,t,n){var i=n(9353),o=n(8667),r=Object.prototype,s=r.hasOwnProperty,a=r.propertyIsEnumerable,l=i(function(){return arguments}())?i:function(e){return o(e)&&s.call(e,"callee")&&!a.call(e,"callee")};e.exports=l},1304:function(e){var t=Array.isArray;e.exports=t},3347:function(e,t,n){var i=n(5220),o=n(5543);e.exports=function(e){return null!=e&&o(e.length)&&!i(e)}},8448:function(e,t,n){e=n.nmd(e);var i=n(4366),o=n(298),r=t&&!t.nodeType&&t,s=r&&e&&!e.nodeType&&e,a=s&&s.exports===r?i.Buffer:void 0,l=(a?a.isBuffer:void 0)||o;e.exports=l},5220:function(e,t,n){var i=n(7807),o=n(1716);e.exports=function(e){if(!o(e))return!1;var t=i(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},5543:function(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},9331:function(e,t,n){var i=n(4219),o=n(6618),r=n(8820),s=r&&r.isMap,a=s?o(s):i;e.exports=a},1716:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},8667:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},1928:function(e,t,n){var i=n(7807),o=n(9743),r=n(8667),s=Function.prototype,a=Object.prototype,l=s.toString,c=a.hasOwnProperty,u=l.call(Object);e.exports=function(e){if(!r(e)||"[object Object]"!=i(e))return!1;var t=o(e);if(null===t)return!0;var n=c.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==u}},7351:function(e,t,n){var i=n(4548),o=n(6618),r=n(8820),s=r&&r.isSet,a=s?o(s):i;e.exports=a},2570:function(e,t,n){var i=n(7807),o=n(8667);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==i(e)}},7592:function(e,t,n){var i=n(3723),o=n(6618),r=n(8820),s=r&&r.isTypedArray,a=s?o(s):i;e.exports=a},3115:function(e,t,n){var i=n(558),o=n(571),r=n(3347);e.exports=function(e){return r(e)?i(e):o(e)}},8134:function(e,t,n){var i=n(558),o=n(8048),r=n(3347);e.exports=function(e){return r(e)?i(e,!0):o(e)}},561:function(e){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},6210:function(e,t,n){var i=n(460);function o(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var i=arguments,o=t?t.apply(this,i):i[0],r=n.cache;if(r.has(o))return r.get(o);var s=e.apply(this,i);return n.cache=r.set(o,s)||r,s};return n.cache=new(o.Cache||i),n}o.Cache=i,e.exports=o},9244:function(e,t,n){var i=n(4366);e.exports=function(){return i.Date.now()}},5164:function(e,t,n){var i=n(3994),o=n(677),r=n(4730),s=n(3378),a=n(6965),l=n(6985),c=n(929),u=n(782),h=c((function(e,t){var n={};if(null==e)return n;var c=!1;t=i(t,(function(t){return t=s(t,e),c||(c=t.length>1),t})),a(e,u(e),n),c&&(n=o(n,7,l));for(var h=t.length;h--;)r(n,t[h]);return n}));e.exports=h},2616:function(e){e.exports=function(){return[]}},298:function(e){e.exports=function(){return!1}},1666:function(e,t,n){var i=n(4182),o=n(1716),r=n(2570),s=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(r(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=i(e);var n=a.test(e);return n||l.test(e)?c(e.slice(2),n?2:8):s.test(e)?NaN:+e}},31:function(e,t,n){var i=n(9697);e.exports=function(e){return null==e?"":i(e)}},3021:function(e,t,n){var i,o,r;window,o=[n(2579),n(8768)],void 0===(r="function"==typeof(i=function(e,t){"use strict";var n=e.create("masonry");n.compatOptions.fitWidth="isFitWidth";var i=n.prototype;return i._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns(),this.colYs=[];for(var e=0;e<this.cols;e++)this.colYs.push(0);this.maxY=0,this.horizontalColIndex=0},i.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var e=this.items[0],n=e&&e.element;this.columnWidth=n&&t(n).outerWidth||this.containerWidth}var i=this.columnWidth+=this.gutter,o=this.containerWidth+this.gutter,r=o/i,s=i-o%i;r=Math[s&&s<1?"round":"floor"](r),this.cols=Math.max(r,1)},i.getContainerWidth=function(){var e=this._getOption("fitWidth")?this.element.parentNode:this.element,n=t(e);this.containerWidth=n&&n.innerWidth},i._getItemLayoutPosition=function(e){e.getSize();var t=e.size.outerWidth%this.columnWidth,n=Math[t&&t<1?"round":"ceil"](e.size.outerWidth/this.columnWidth);n=Math.min(n,this.cols);for(var i=this[this.options.horizontalOrder?"_getHorizontalColPosition":"_getTopColPosition"](n,e),o={x:this.columnWidth*i.col,y:i.y},r=i.y+e.size.outerHeight,s=n+i.col,a=i.col;a<s;a++)this.colYs[a]=r;return o},i._getTopColPosition=function(e){var t=this._getTopColGroup(e),n=Math.min.apply(Math,t);return{col:t.indexOf(n),y:n}},i._getTopColGroup=function(e){if(e<2)return this.colYs;for(var t=[],n=this.cols+1-e,i=0;i<n;i++)t[i]=this._getColGroupY(i,e);return t},i._getColGroupY=function(e,t){if(t<2)return this.colYs[e];var n=this.colYs.slice(e,e+t);return Math.max.apply(Math,n)},i._getHorizontalColPosition=function(e,t){var n=this.horizontalColIndex%this.cols;n=e>1&&n+e>this.cols?0:n;var i=t.size.outerWidth&&t.size.outerHeight;return this.horizontalColIndex=i?n+e:this.horizontalColIndex,{col:n,y:this._getColGroupY(n,e)}},i._manageStamp=function(e){var n=t(e),i=this._getElementOffset(e),o=this._getOption("originLeft")?i.left:i.right,r=o+n.outerWidth,s=Math.floor(o/this.columnWidth);s=Math.max(0,s);var a=Math.floor(r/this.columnWidth);a-=r%this.columnWidth?0:1,a=Math.min(this.cols-1,a);for(var l=(this._getOption("originTop")?i.top:i.bottom)+n.outerHeight,c=s;c<=a;c++)this.colYs[c]=Math.max(l,this.colYs[c])},i._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var e={height:this.maxY};return this._getOption("fitWidth")&&(e.width=this._getContainerFitWidth()),e},i._getContainerFitWidth=function(){for(var e=0,t=this.cols;--t&&0===this.colYs[t];)e++;return(this.cols-e)*this.columnWidth-this.gutter},i.needsResizeLayout=function(){var e=this.containerWidth;return this.getContainerWidth(),e!=this.containerWidth},n})?i.apply(t,o):i)||(e.exports=r)},5535:function(e){"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach((function(e){i[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(e){return!1}}()?Object.assign:function(e,r){for(var s,a,l=o(e),c=1;c<arguments.length;c++){for(var u in s=Object(arguments[c]))n.call(s,u)&&(l[u]=s[u]);if(t){a=t(s);for(var h=0;h<a.length;h++)i.call(s,a[h])&&(l[a[h]]=s[a[h]])}}return l}},809:function(e,t,n){var i,o,r;window,o=[n(3323),n(8768)],void 0===(r="function"==typeof(i=function(e,t){"use strict";var n=document.documentElement.style,i="string"==typeof n.transition?"transition":"WebkitTransition",o="string"==typeof n.transform?"transform":"WebkitTransform",r={WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[i],s={transform:o,transition:i,transitionDuration:i+"Duration",transitionProperty:i+"Property",transitionDelay:i+"Delay"};function a(e,t){e&&(this.element=e,this.layout=t,this.position={x:0,y:0},this._create())}var l=a.prototype=Object.create(e.prototype);l.constructor=a,l._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},l.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},l.getSize=function(){this.size=t(this.element)},l.css=function(e){var t=this.element.style;for(var n in e)t[s[n]||n]=e[n]},l.getPosition=function(){var e=getComputedStyle(this.element),t=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop"),i=e[t?"left":"right"],o=e[n?"top":"bottom"],r=parseFloat(i),s=parseFloat(o),a=this.layout.size;-1!=i.indexOf("%")&&(r=r/100*a.width),-1!=o.indexOf("%")&&(s=s/100*a.height),r=isNaN(r)?0:r,s=isNaN(s)?0:s,r-=t?a.paddingLeft:a.paddingRight,s-=n?a.paddingTop:a.paddingBottom,this.position.x=r,this.position.y=s},l.layoutPosition=function(){var e=this.layout.size,t={},n=this.layout._getOption("originLeft"),i=this.layout._getOption("originTop"),o=n?"paddingLeft":"paddingRight",r=n?"left":"right",s=n?"right":"left",a=this.position.x+e[o];t[r]=this.getXValue(a),t[s]="";var l=i?"paddingTop":"paddingBottom",c=i?"top":"bottom",u=i?"bottom":"top",h=this.position.y+e[l];t[c]=this.getYValue(h),t[u]="",this.css(t),this.emitEvent("layout",[this])},l.getXValue=function(e){var t=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&!t?e/this.layout.size.width*100+"%":e+"px"},l.getYValue=function(e){var t=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&t?e/this.layout.size.height*100+"%":e+"px"},l._transitionTo=function(e,t){this.getPosition();var n=this.position.x,i=this.position.y,o=e==this.position.x&&t==this.position.y;if(this.setPosition(e,t),!o||this.isTransitioning){var r=e-n,s=t-i,a={};a.transform=this.getTranslate(r,s),this.transition({to:a,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})}else this.layoutPosition()},l.getTranslate=function(e,t){return"translate3d("+(e=this.layout._getOption("originLeft")?e:-e)+"px, "+(t=this.layout._getOption("originTop")?t:-t)+"px, 0)"},l.goTo=function(e,t){this.setPosition(e,t),this.layoutPosition()},l.moveTo=l._transitionTo,l.setPosition=function(e,t){this.position.x=parseFloat(e),this.position.y=parseFloat(t)},l._nonTransition=function(e){for(var t in this.css(e.to),e.isCleaning&&this._removeStyles(e.to),e.onTransitionEnd)e.onTransitionEnd[t].call(this)},l.transition=function(e){if(parseFloat(this.layout.options.transitionDuration)){var t=this._transn;for(var n in e.onTransitionEnd)t.onEnd[n]=e.onTransitionEnd[n];for(n in e.to)t.ingProperties[n]=!0,e.isCleaning&&(t.clean[n]=!0);e.from&&(this.css(e.from),this.element.offsetHeight),this.enableTransition(e.to),this.css(e.to),this.isTransitioning=!0}else this._nonTransition(e)};var c="opacity,"+o.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()}));l.enableTransition=function(){if(!this.isTransitioning){var e=this.layout.options.transitionDuration;e="number"==typeof e?e+"ms":e,this.css({transitionProperty:c,transitionDuration:e,transitionDelay:this.staggerDelay||0}),this.element.addEventListener(r,this,!1)}},l.onwebkitTransitionEnd=function(e){this.ontransitionend(e)},l.onotransitionend=function(e){this.ontransitionend(e)};var u={"-webkit-transform":"transform"};l.ontransitionend=function(e){if(e.target===this.element){var t=this._transn,n=u[e.propertyName]||e.propertyName;delete t.ingProperties[n],function(e){for(var t in e)return!1;return!0}(t.ingProperties)&&this.disableTransition(),n in t.clean&&(this.element.style[e.propertyName]="",delete t.clean[n]),n in t.onEnd&&(t.onEnd[n].call(this),delete t.onEnd[n]),this.emitEvent("transitionEnd",[this])}},l.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(r,this,!1),this.isTransitioning=!1},l._removeStyles=function(e){var t={};for(var n in e)t[n]="";this.css(t)};var h={transitionProperty:"",transitionDuration:"",transitionDelay:""};return l.removeTransitionStyles=function(){this.css(h)},l.stagger=function(e){e=isNaN(e)?0:e,this.staggerDelay=e+"ms"},l.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},l.remove=function(){i&&parseFloat(this.layout.options.transitionDuration)?(this.once("transitionEnd",(function(){this.removeElem()})),this.hide()):this.removeElem()},l.reveal=function(){delete this.isHidden,this.css({display:""});var e=this.layout.options,t={};t[this.getHideRevealTransitionEndProperty("visibleStyle")]=this.onRevealTransitionEnd,this.transition({from:e.hiddenStyle,to:e.visibleStyle,isCleaning:!0,onTransitionEnd:t})},l.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},l.getHideRevealTransitionEndProperty=function(e){var t=this.layout.options[e];if(t.opacity)return"opacity";for(var n in t)return n},l.hide=function(){this.isHidden=!0,this.css({display:""});var e=this.layout.options,t={};t[this.getHideRevealTransitionEndProperty("hiddenStyle")]=this.onHideTransitionEnd,this.transition({from:e.visibleStyle,to:e.hiddenStyle,isCleaning:!0,onTransitionEnd:t})},l.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},l.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},a})?i.apply(t,o):i)||(e.exports=r)},2579:function(e,t,n){var i,o;!function(r,s){"use strict";i=[n(3323),n(8768),n(4664),n(809)],o=function(e,t,n,i){return function(e,t,n,i,o){var r=e.console,s=e.jQuery,a=function(){},l=0,c={};function u(e,t){var n=i.getQueryElement(e);if(n){this.element=n,s&&(this.$element=s(this.element)),this.options=i.extend({},this.constructor.defaults),this.option(t);var o=++l;this.element.outlayerGUID=o,c[o]=this,this._create(),this._getOption("initLayout")&&this.layout()}else r&&r.error("Bad element for "+this.constructor.namespace+": "+(n||e))}u.namespace="outlayer",u.Item=o,u.defaults={containerStyle:{position:"relative"},initLayout:!0,originLeft:!0,originTop:!0,resize:!0,resizeContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}};var h=u.prototype;function d(e){function t(){e.apply(this,arguments)}return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t}i.extend(h,t.prototype),h.option=function(e){i.extend(this.options,e)},h._getOption=function(e){var t=this.constructor.compatOptions[e];return t&&void 0!==this.options[t]?this.options[t]:this.options[e]},u.compatOptions={initLayout:"isInitLayout",horizontal:"isHorizontal",layoutInstant:"isLayoutInstant",originLeft:"isOriginLeft",originTop:"isOriginTop",resize:"isResizeBound",resizeContainer:"isResizingContainer"},h._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),i.extend(this.element.style,this.options.containerStyle),this._getOption("resize")&&this.bindResize()},h.reloadItems=function(){this.items=this._itemize(this.element.children)},h._itemize=function(e){for(var t=this._filterFindItemElements(e),n=this.constructor.Item,i=[],o=0;o<t.length;o++){var r=new n(t[o],this);i.push(r)}return i},h._filterFindItemElements=function(e){return i.filterFindElements(e,this.options.itemSelector)},h.getItemElements=function(){return this.items.map((function(e){return e.element}))},h.layout=function(){this._resetLayout(),this._manageStamps();var e=this._getOption("layoutInstant"),t=void 0!==e?e:!this._isLayoutInited;this.layoutItems(this.items,t),this._isLayoutInited=!0},h._init=h.layout,h._resetLayout=function(){this.getSize()},h.getSize=function(){this.size=n(this.element)},h._getMeasurement=function(e,t){var i,o=this.options[e];o?("string"==typeof o?i=this.element.querySelector(o):o instanceof HTMLElement&&(i=o),this[e]=i?n(i)[t]:o):this[e]=0},h.layoutItems=function(e,t){e=this._getItemsForLayout(e),this._layoutItems(e,t),this._postLayout()},h._getItemsForLayout=function(e){return e.filter((function(e){return!e.isIgnored}))},h._layoutItems=function(e,t){if(this._emitCompleteOnItems("layout",e),e&&e.length){var n=[];e.forEach((function(e){var i=this._getItemLayoutPosition(e);i.item=e,i.isInstant=t||e.isLayoutInstant,n.push(i)}),this),this._processLayoutQueue(n)}},h._getItemLayoutPosition=function(){return{x:0,y:0}},h._processLayoutQueue=function(e){this.updateStagger(),e.forEach((function(e,t){this._positionItem(e.item,e.x,e.y,e.isInstant,t)}),this)},h.updateStagger=function(){var e=this.options.stagger;if(null!=e)return this.stagger=function(e){if("number"==typeof e)return e;var t=e.match(/(^\d*\.?\d*)(\w*)/),n=t&&t[1],i=t&&t[2];return n.length?(n=parseFloat(n))*(p[i]||1):0}(e),this.stagger;this.stagger=0},h._positionItem=function(e,t,n,i,o){i?e.goTo(t,n):(e.stagger(o*this.stagger),e.moveTo(t,n))},h._postLayout=function(){this.resizeContainer()},h.resizeContainer=function(){if(this._getOption("resizeContainer")){var e=this._getContainerSize();e&&(this._setContainerMeasure(e.width,!0),this._setContainerMeasure(e.height,!1))}},h._getContainerSize=a,h._setContainerMeasure=function(e,t){if(void 0!==e){var n=this.size;n.isBorderBox&&(e+=t?n.paddingLeft+n.paddingRight+n.borderLeftWidth+n.borderRightWidth:n.paddingBottom+n.paddingTop+n.borderTopWidth+n.borderBottomWidth),e=Math.max(e,0),this.element.style[t?"width":"height"]=e+"px"}},h._emitCompleteOnItems=function(e,t){var n=this;function i(){n.dispatchEvent(e+"Complete",null,[t])}var o=t.length;if(t&&o){var r=0;t.forEach((function(t){t.once(e,s)}))}else i();function s(){++r==o&&i()}},h.dispatchEvent=function(e,t,n){var i=t?[t].concat(n):n;if(this.emitEvent(e,i),s)if(this.$element=this.$element||s(this.element),t){var o=s.Event(t);o.type=e,this.$element.trigger(o,n)}else this.$element.trigger(e,n)},h.ignore=function(e){var t=this.getItem(e);t&&(t.isIgnored=!0)},h.unignore=function(e){var t=this.getItem(e);t&&delete t.isIgnored},h.stamp=function(e){(e=this._find(e))&&(this.stamps=this.stamps.concat(e),e.forEach(this.ignore,this))},h.unstamp=function(e){(e=this._find(e))&&e.forEach((function(e){i.removeFrom(this.stamps,e),this.unignore(e)}),this)},h._find=function(e){if(e)return"string"==typeof e&&(e=this.element.querySelectorAll(e)),i.makeArray(e)},h._manageStamps=function(){this.stamps&&this.stamps.length&&(this._getBoundingRect(),this.stamps.forEach(this._manageStamp,this))},h._getBoundingRect=function(){var e=this.element.getBoundingClientRect(),t=this.size;this._boundingRect={left:e.left+t.paddingLeft+t.borderLeftWidth,top:e.top+t.paddingTop+t.borderTopWidth,right:e.right-(t.paddingRight+t.borderRightWidth),bottom:e.bottom-(t.paddingBottom+t.borderBottomWidth)}},h._manageStamp=a,h._getElementOffset=function(e){var t=e.getBoundingClientRect(),i=this._boundingRect,o=n(e);return{left:t.left-i.left-o.marginLeft,top:t.top-i.top-o.marginTop,right:i.right-t.right-o.marginRight,bottom:i.bottom-t.bottom-o.marginBottom}},h.handleEvent=i.handleEvent,h.bindResize=function(){e.addEventListener("resize",this),this.isResizeBound=!0},h.unbindResize=function(){e.removeEventListener("resize",this),this.isResizeBound=!1},h.onresize=function(){this.resize()},i.debounceMethod(u,"onresize",100),h.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},h.needsResizeLayout=function(){var e=n(this.element);return this.size&&e&&e.innerWidth!==this.size.innerWidth},h.addItems=function(e){var t=this._itemize(e);return t.length&&(this.items=this.items.concat(t)),t},h.appended=function(e){var t=this.addItems(e);t.length&&(this.layoutItems(t,!0),this.reveal(t))},h.prepended=function(e){var t=this._itemize(e);if(t.length){var n=this.items.slice(0);this.items=t.concat(n),this._resetLayout(),this._manageStamps(),this.layoutItems(t,!0),this.reveal(t),this.layoutItems(n)}},h.reveal=function(e){if(this._emitCompleteOnItems("reveal",e),e&&e.length){var t=this.updateStagger();e.forEach((function(e,n){e.stagger(n*t),e.reveal()}))}},h.hide=function(e){if(this._emitCompleteOnItems("hide",e),e&&e.length){var t=this.updateStagger();e.forEach((function(e,n){e.stagger(n*t),e.hide()}))}},h.revealItemElements=function(e){var t=this.getItems(e);this.reveal(t)},h.hideItemElements=function(e){var t=this.getItems(e);this.hide(t)},h.getItem=function(e){for(var t=0;t<this.items.length;t++){var n=this.items[t];if(n.element==e)return n}},h.getItems=function(e){e=i.makeArray(e);var t=[];return e.forEach((function(e){var n=this.getItem(e);n&&t.push(n)}),this),t},h.remove=function(e){var t=this.getItems(e);this._emitCompleteOnItems("remove",t),t&&t.length&&t.forEach((function(e){e.remove(),i.removeFrom(this.items,e)}),this)},h.destroy=function(){var e=this.element.style;e.height="",e.position="",e.width="",this.items.forEach((function(e){e.destroy()})),this.unbindResize();var t=this.element.outlayerGUID;delete c[t],delete this.element.outlayerGUID,s&&s.removeData(this.element,this.constructor.namespace)},u.data=function(e){var t=(e=i.getQueryElement(e))&&e.outlayerGUID;return t&&c[t]},u.create=function(e,t){var n=d(u);return n.defaults=i.extend({},u.defaults),i.extend(n.defaults,t),n.compatOptions=i.extend({},u.compatOptions),n.namespace=e,n.data=u.data,n.Item=d(o),i.htmlInit(n,e),s&&s.bridget&&s.bridget(e,n),n};var p={ms:1,s:1e3};return u.Item=o,u}(r,e,t,n,i)}.apply(t,i),void 0===o||(e.exports=o)}(window)},9739:function(e,t,n){"use strict";var i=n(6669);function o(){}function r(){}r.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,r,s){if(s!==i){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:r,resetWarningCache:o};return n.PropTypes=n,n}},7329:function(e,t,n){e.exports=n(9739)()},6669:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},7352:function(e,t,n){"use strict";var i,o=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var s=n(6657),a=n(7329),l=n(7363),c=n(4327),u=n(6104),h=(0,u.getAceInstance)(),d=function(e){function t(t){var n=e.call(this,t)||this;return u.editorEvents.forEach((function(e){n[e]=n[e].bind(n)})),n.debounce=u.debounce,n}return o(t,e),t.prototype.isInShadow=function(e){for(var t=e&&e.parentNode;t;){if("[object ShadowRoot]"===t.toString())return!0;t=t.parentNode}return!1},t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.className,i=t.onBeforeLoad,o=t.onValidate,r=t.mode,s=t.focus,a=t.theme,l=t.fontSize,c=t.value,d=t.defaultValue,p=t.showGutter,f=t.wrapEnabled,g=t.showPrintMargin,m=t.scrollMargin,v=void 0===m?[0,0,0,0]:m,b=t.keyboardHandler,w=t.onLoad,y=t.commands,x=t.annotations,C=t.markers,S=t.placeholder;this.editor=h.edit(this.refEditor),i&&i(h);for(var k=Object.keys(this.props.editorProps),$=0;$<k.length;$++)this.editor[k[$]]=this.props.editorProps[k[$]];this.props.debounceChangePeriod&&(this.onChange=this.debounce(this.onChange,this.props.debounceChangePeriod)),this.editor.renderer.setScrollMargin(v[0],v[1],v[2],v[3]),this.isInShadow(this.refEditor)&&this.editor.renderer.attachToShadowRoot(),this.editor.getSession().setMode("string"==typeof r?"ace/mode/"+r:r),a&&""!==a&&this.editor.setTheme("ace/theme/"+a),this.editor.setFontSize("number"==typeof l?l+"px":l),this.editor.getSession().setValue(d||c||""),this.props.navigateToFileEnd&&this.editor.navigateFileEnd(),this.editor.renderer.setShowGutter(p),this.editor.getSession().setUseWrapMode(f),this.editor.setShowPrintMargin(g),this.editor.on("focus",this.onFocus),this.editor.on("blur",this.onBlur),this.editor.on("copy",this.onCopy),this.editor.on("paste",this.onPaste),this.editor.on("change",this.onChange),this.editor.on("input",this.onInput),S&&this.updatePlaceholder(),this.editor.getSession().selection.on("changeSelection",this.onSelectionChange),this.editor.getSession().selection.on("changeCursor",this.onCursorChange),o&&this.editor.getSession().on("changeAnnotation",(function(){var t=e.editor.getSession().getAnnotations();e.props.onValidate(t)})),this.editor.session.on("changeScrollTop",this.onScroll),this.editor.getSession().setAnnotations(x||[]),C&&C.length>0&&this.handleMarkers(C);var E=this.editor.$options;u.editorOptions.forEach((function(t){E.hasOwnProperty(t)?e.editor.setOption(t,e.props[t]):e.props[t]&&console.warn("ReactAce: editor option "+t+" was activated but not found. Did you need to import a related tool or did you possibly mispell the option?")})),this.handleOptions(this.props),Array.isArray(y)&&y.forEach((function(t){"string"==typeof t.exec?e.editor.commands.bindKey(t.bindKey,t.exec):e.editor.commands.addCommand(t)})),b&&this.editor.setKeyboardHandler("ace/keyboard/"+b),n&&(this.refEditor.className+=" "+n),w&&w(this.editor),this.editor.resize(),s&&this.editor.focus()},t.prototype.componentDidUpdate=function(e){for(var t=e,n=this.props,i=0;i<u.editorOptions.length;i++){var o=u.editorOptions[i];n[o]!==t[o]&&this.editor.setOption(o,n[o])}if(n.className!==t.className){var r=this.refEditor.className.trim().split(" ");t.className.trim().split(" ").forEach((function(e){var t=r.indexOf(e);r.splice(t,1)})),this.refEditor.className=" "+n.className+" "+r.join(" ")}if(this.editor&&null!=n.value&&this.editor.getValue()!==n.value){this.silent=!0;var s=this.editor.session.selection.toJSON();this.editor.setValue(n.value,n.cursorStart),this.editor.session.selection.fromJSON(s),this.silent=!1}n.placeholder!==t.placeholder&&this.updatePlaceholder(),n.mode!==t.mode&&this.editor.getSession().setMode("string"==typeof n.mode?"ace/mode/"+n.mode:n.mode),n.theme!==t.theme&&this.editor.setTheme("ace/theme/"+n.theme),n.keyboardHandler!==t.keyboardHandler&&(n.keyboardHandler?this.editor.setKeyboardHandler("ace/keyboard/"+n.keyboardHandler):this.editor.setKeyboardHandler(null)),n.fontSize!==t.fontSize&&this.editor.setFontSize("number"==typeof n.fontSize?n.fontSize+"px":n.fontSize),n.wrapEnabled!==t.wrapEnabled&&this.editor.getSession().setUseWrapMode(n.wrapEnabled),n.showPrintMargin!==t.showPrintMargin&&this.editor.setShowPrintMargin(n.showPrintMargin),n.showGutter!==t.showGutter&&this.editor.renderer.setShowGutter(n.showGutter),c(n.setOptions,t.setOptions)||this.handleOptions(n),c(n.annotations,t.annotations)||this.editor.getSession().setAnnotations(n.annotations||[]),!c(n.markers,t.markers)&&Array.isArray(n.markers)&&this.handleMarkers(n.markers),c(n.scrollMargin,t.scrollMargin)||this.handleScrollMargins(n.scrollMargin),e.height===this.props.height&&e.width===this.props.width||this.editor.resize(),this.props.focus&&!e.focus&&this.editor.focus()},t.prototype.handleScrollMargins=function(e){void 0===e&&(e=[0,0,0,0]),this.editor.renderer.setScrollMargin(e[0],e[1],e[2],e[3])},t.prototype.componentWillUnmount=function(){this.editor.destroy(),this.editor=null},t.prototype.onChange=function(e){if(this.props.onChange&&!this.silent){var t=this.editor.getValue();this.props.onChange(t,e)}},t.prototype.onSelectionChange=function(e){if(this.props.onSelectionChange){var t=this.editor.getSelection();this.props.onSelectionChange(t,e)}},t.prototype.onCursorChange=function(e){if(this.props.onCursorChange){var t=this.editor.getSelection();this.props.onCursorChange(t,e)}},t.prototype.onInput=function(e){this.props.onInput&&this.props.onInput(e),this.props.placeholder&&this.updatePlaceholder()},t.prototype.onFocus=function(e){this.props.onFocus&&this.props.onFocus(e,this.editor)},t.prototype.onBlur=function(e){this.props.onBlur&&this.props.onBlur(e,this.editor)},t.prototype.onCopy=function(e){var t=e.text;this.props.onCopy&&this.props.onCopy(t)},t.prototype.onPaste=function(e){var t=e.text;this.props.onPaste&&this.props.onPaste(t)},t.prototype.onScroll=function(){this.props.onScroll&&this.props.onScroll(this.editor)},t.prototype.handleOptions=function(e){for(var t=Object.keys(e.setOptions),n=0;n<t.length;n++)this.editor.setOption(t[n],e.setOptions[t[n]])},t.prototype.handleMarkers=function(e){var t=this,n=this.editor.getSession().getMarkers(!0);for(var i in n)n.hasOwnProperty(i)&&this.editor.getSession().removeMarker(n[i].id);for(var i in n=this.editor.getSession().getMarkers(!1))n.hasOwnProperty(i)&&"ace_active-line"!==n[i].clazz&&"ace_selected-word"!==n[i].clazz&&this.editor.getSession().removeMarker(n[i].id);e.forEach((function(e){var n=e.startRow,i=e.startCol,o=e.endRow,r=e.endCol,a=e.className,l=e.type,c=e.inFront,u=void 0!==c&&c,h=new s.Range(n,i,o,r);t.editor.getSession().addMarker(h,a,l,u)}))},t.prototype.updatePlaceholder=function(){var e=this.editor,t=this.props.placeholder,n=!e.session.getValue().length,i=e.renderer.placeholderNode;!n&&i?(e.renderer.scroller.removeChild(e.renderer.placeholderNode),e.renderer.placeholderNode=null):n&&!i?((i=e.renderer.placeholderNode=document.createElement("div")).textContent=t||"",i.className="ace_comment ace_placeholder",i.style.padding="0 9px",i.style.position="absolute",i.style.zIndex="3",e.renderer.scroller.appendChild(i)):n&&i&&(i.textContent=t)},t.prototype.updateRef=function(e){this.refEditor=e},t.prototype.render=function(){var e=this.props,t=e.name,n=e.width,i=e.height,o=e.style,s=r({width:n,height:i},o);return l.createElement("div",{ref:this.updateRef,id:t,style:s})},t.propTypes={mode:a.oneOfType([a.string,a.object]),focus:a.bool,theme:a.string,name:a.string,className:a.string,height:a.string,width:a.string,fontSize:a.oneOfType([a.number,a.string]),showGutter:a.bool,onChange:a.func,onCopy:a.func,onPaste:a.func,onFocus:a.func,onInput:a.func,onBlur:a.func,onScroll:a.func,value:a.string,defaultValue:a.string,onLoad:a.func,onSelectionChange:a.func,onCursorChange:a.func,onBeforeLoad:a.func,onValidate:a.func,minLines:a.number,maxLines:a.number,readOnly:a.bool,highlightActiveLine:a.bool,tabSize:a.number,showPrintMargin:a.bool,cursorStart:a.number,debounceChangePeriod:a.number,editorProps:a.object,setOptions:a.object,style:a.object,scrollMargin:a.array,annotations:a.array,markers:a.array,keyboardHandler:a.string,wrapEnabled:a.bool,enableSnippets:a.bool,enableBasicAutocompletion:a.oneOfType([a.bool,a.array]),enableLiveAutocompletion:a.oneOfType([a.bool,a.array]),navigateToFileEnd:a.bool,commands:a.array,placeholder:a.string},t.defaultProps={name:"ace-editor",focus:!1,mode:"",theme:"",height:"500px",width:"500px",fontSize:12,enableSnippets:!1,showGutter:!0,onChange:null,onPaste:null,onLoad:null,onScroll:null,minLines:null,maxLines:null,readOnly:!1,highlightActiveLine:!0,showPrintMargin:!0,tabSize:4,cursorStart:1,editorProps:{},style:{},scrollMargin:[0,0,0,0],setOptions:{},wrapEnabled:!1,enableBasicAutocompletion:!1,enableLiveAutocompletion:!1,placeholder:null,navigateToFileEnd:!0},t}(l.Component);t.default=d},9062:function(e,t,n){"use strict";var i,o=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var r=n(7329),s=n(7363),a=n(8284),l=n(9005),c=function(e){function t(t){var n=e.call(this,t)||this;return n.state={value:n.props.value},n.onChange=n.onChange.bind(n),n.diff=n.diff.bind(n),n}return o(t,e),t.prototype.componentDidUpdate=function(){var e=this.props.value;e!==this.state.value&&this.setState({value:e})},t.prototype.onChange=function(e){this.setState({value:e}),this.props.onChange&&this.props.onChange(e)},t.prototype.diff=function(){var e=new l,t=this.state.value[0],n=this.state.value[1];if(0===t.length&&0===n.length)return[];var i=e.diff_main(t,n);e.diff_cleanupSemantic(i);var o=this.generateDiffedLines(i);return this.setCodeMarkers(o)},t.prototype.generateDiffedLines=function(e){var t={left:[],right:[]},n={left:1,right:1};return e.forEach((function(e){var i=e[0],o=e[1],r=o.split("\n").length-1;if(0!==o.length){var s=o[0],a=o[o.length-1],l=0;switch(i){case 0:n.left+=r,n.right+=r;break;case-1:"\n"===s&&(n.left++,r--),0===(l=r)&&t.right.push({startLine:n.right,endLine:n.right}),"\n"===a&&(l-=1),t.left.push({startLine:n.left,endLine:n.left+l}),n.left+=r;break;case 1:"\n"===s&&(n.right++,r--),0===(l=r)&&t.left.push({startLine:n.left,endLine:n.left}),"\n"===a&&(l-=1),t.right.push({startLine:n.right,endLine:n.right+l}),n.right+=r;break;default:throw new Error("Diff type was not defined.")}}})),t},t.prototype.setCodeMarkers=function(e){void 0===e&&(e={left:[],right:[]});for(var t=[],n={left:[],right:[]},i=0;i<e.left.length;i++){var o={startRow:e.left[i].startLine-1,endRow:e.left[i].endLine,type:"text",className:"codeMarker"};n.left.push(o)}for(i=0;i<e.right.length;i++)o={startRow:e.right[i].startLine-1,endRow:e.right[i].endLine,type:"text",className:"codeMarker"},n.right.push(o);return t[0]=n.left,t[1]=n.right,t},t.prototype.render=function(){var e=this.diff();return s.createElement(a.default,{name:this.props.name,className:this.props.className,focus:this.props.focus,orientation:this.props.orientation,splits:this.props.splits,mode:this.props.mode,theme:this.props.theme,height:this.props.height,width:this.props.width,fontSize:this.props.fontSize,showGutter:this.props.showGutter,onChange:this.onChange,onPaste:this.props.onPaste,onLoad:this.props.onLoad,onScroll:this.props.onScroll,minLines:this.props.minLines,maxLines:this.props.maxLines,readOnly:this.props.readOnly,highlightActiveLine:this.props.highlightActiveLine,showPrintMargin:this.props.showPrintMargin,tabSize:this.props.tabSize,cursorStart:this.props.cursorStart,editorProps:this.props.editorProps,style:this.props.style,scrollMargin:this.props.scrollMargin,setOptions:this.props.setOptions,wrapEnabled:this.props.wrapEnabled,enableBasicAutocompletion:this.props.enableBasicAutocompletion,enableLiveAutocompletion:this.props.enableLiveAutocompletion,value:this.state.value,markers:e})},t.propTypes={cursorStart:r.number,editorProps:r.object,enableBasicAutocompletion:r.bool,enableLiveAutocompletion:r.bool,focus:r.bool,fontSize:r.number,height:r.string,highlightActiveLine:r.bool,maxLines:r.number,minLines:r.number,mode:r.string,name:r.string,className:r.string,onLoad:r.func,onPaste:r.func,onScroll:r.func,onChange:r.func,orientation:r.string,readOnly:r.bool,scrollMargin:r.array,setOptions:r.object,showGutter:r.bool,showPrintMargin:r.bool,splits:r.number,style:r.object,tabSize:r.number,theme:r.string,value:r.array,width:r.string,wrapEnabled:r.bool},t.defaultProps={cursorStart:1,editorProps:{},enableBasicAutocompletion:!1,enableLiveAutocompletion:!1,focus:!1,fontSize:12,height:"500px",highlightActiveLine:!0,maxLines:null,minLines:null,mode:"",name:"ace-editor",onLoad:null,onScroll:null,onPaste:null,onChange:null,orientation:"beside",readOnly:!1,scrollMargin:[0,0,0,0],setOptions:{},showGutter:!0,showPrintMargin:!0,splits:2,style:{},tabSize:4,theme:"github",value:["",""],width:"500px",wrapEnabled:!0},t}(s.Component);t.default=c},6104:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getAceInstance=t.debounce=t.editorEvents=t.editorOptions=void 0,t.editorOptions=["minLines","maxLines","readOnly","highlightActiveLine","tabSize","enableBasicAutocompletion","enableLiveAutocompletion","enableSnippets"],t.editorEvents=["onChange","onFocus","onInput","onBlur","onCopy","onPaste","onSelectionChange","onCursorChange","onScroll","handleOptions","updateRef"],t.getAceInstance=function(){var e;return"undefined"==typeof window?(n.g.window={},e=n(6657),delete n.g.window):window.ace?(e=window.ace).acequire=window.ace.require||window.ace.acequire:e=n(6657),e},t.debounce=function(e,t){var n=null;return function(){var i=this,o=arguments;clearTimeout(n),n=setTimeout((function(){e.apply(i,o)}),t)}}},8521:function(e,t,n){"use strict";var i=n(7352);n(9062).default,n(8284).default,t.ZP=i.default},8284:function(e,t,n){"use strict";var i,o=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var s=n(6104),a=(0,s.getAceInstance)(),l=n(6657),c=n(3606),u=n(7329),h=n(7363),d=n(4327),p=n(2114),f=function(e){function t(t){var n=e.call(this,t)||this;return s.editorEvents.forEach((function(e){n[e]=n[e].bind(n)})),n.debounce=s.debounce,n}return o(t,e),t.prototype.isInShadow=function(e){for(var t=e&&e.parentNode;t;){if("[object ShadowRoot]"===t.toString())return!0;t=t.parentNode}return!1},t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.className,i=t.onBeforeLoad,o=t.mode,r=t.focus,l=t.theme,u=t.fontSize,h=t.value,d=t.defaultValue,f=t.cursorStart,g=t.showGutter,m=t.wrapEnabled,v=t.showPrintMargin,b=t.scrollMargin,w=void 0===b?[0,0,0,0]:b,y=t.keyboardHandler,x=t.onLoad,C=t.commands,S=t.annotations,k=t.markers,$=t.splits;this.editor=a.edit(this.refEditor),this.isInShadow(this.refEditor)&&this.editor.renderer.attachToShadowRoot(),this.editor.setTheme("ace/theme/"+l),i&&i(a);var E=Object.keys(this.props.editorProps),_=new c.Split(this.editor.container,"ace/theme/"+l,$);this.editor.env.split=_,this.splitEditor=_.getEditor(0),this.split=_,this.editor.setShowPrintMargin(!1),this.editor.renderer.setShowGutter(!1);var L=this.splitEditor.$options;this.props.debounceChangePeriod&&(this.onChange=this.debounce(this.onChange,this.props.debounceChangePeriod)),_.forEach((function(t,n){for(var i=0;i<E.length;i++)t[E[i]]=e.props.editorProps[E[i]];var r=p(d,n),c=p(h,n,"");t.session.setUndoManager(new a.UndoManager),t.setTheme("ace/theme/"+l),t.renderer.setScrollMargin(w[0],w[1],w[2],w[3]),t.getSession().setMode("ace/mode/"+o),t.setFontSize(u),t.renderer.setShowGutter(g),t.getSession().setUseWrapMode(m),t.setShowPrintMargin(v),t.on("focus",e.onFocus),t.on("blur",e.onBlur),t.on("input",e.onInput),t.on("copy",e.onCopy),t.on("paste",e.onPaste),t.on("change",e.onChange),t.getSession().selection.on("changeSelection",e.onSelectionChange),t.getSession().selection.on("changeCursor",e.onCursorChange),t.session.on("changeScrollTop",e.onScroll),t.setValue(void 0===r?c:r,f);var b=p(S,n,[]),x=p(k,n,[]);for(t.getSession().setAnnotations(b),x&&x.length>0&&e.handleMarkers(x,t),i=0;i<s.editorOptions.length;i++){var $=s.editorOptions[i];L.hasOwnProperty($)?t.setOption($,e.props[$]):e.props[$]&&console.warn("ReaceAce: editor option "+$+" was activated but not found. Did you need to import a related tool or did you possibly mispell the option?")}e.handleOptions(e.props,t),Array.isArray(C)&&C.forEach((function(e){"string"==typeof e.exec?t.commands.bindKey(e.bindKey,e.exec):t.commands.addCommand(e)})),y&&t.setKeyboardHandler("ace/keyboard/"+y)})),n&&(this.refEditor.className+=" "+n),r&&this.splitEditor.focus();var A=this.editor.env.split;A.setOrientation("below"===this.props.orientation?A.BELOW:A.BESIDE),A.resize(!0),x&&x(A)},t.prototype.componentDidUpdate=function(e){var t=this,n=e,i=this.props,o=this.editor.env.split;if(i.splits!==n.splits&&o.setSplits(i.splits),i.orientation!==n.orientation&&o.setOrientation("below"===i.orientation?o.BELOW:o.BESIDE),o.forEach((function(e,o){i.mode!==n.mode&&e.getSession().setMode("ace/mode/"+i.mode),i.keyboardHandler!==n.keyboardHandler&&(i.keyboardHandler?e.setKeyboardHandler("ace/keyboard/"+i.keyboardHandler):e.setKeyboardHandler(null)),i.fontSize!==n.fontSize&&e.setFontSize(i.fontSize),i.wrapEnabled!==n.wrapEnabled&&e.getSession().setUseWrapMode(i.wrapEnabled),i.showPrintMargin!==n.showPrintMargin&&e.setShowPrintMargin(i.showPrintMargin),i.showGutter!==n.showGutter&&e.renderer.setShowGutter(i.showGutter);for(var r=0;r<s.editorOptions.length;r++){var a=s.editorOptions[r];i[a]!==n[a]&&e.setOption(a,i[a])}d(i.setOptions,n.setOptions)||t.handleOptions(i,e);var l=p(i.value,o,"");if(e.getValue()!==l){t.silent=!0;var c=e.session.selection.toJSON();e.setValue(l,i.cursorStart),e.session.selection.fromJSON(c),t.silent=!1}var u=p(i.annotations,o,[]),h=p(n.annotations,o,[]);d(u,h)||e.getSession().setAnnotations(u);var f=p(i.markers,o,[]),g=p(n.markers,o,[]);!d(f,g)&&Array.isArray(f)&&t.handleMarkers(f,e)})),i.className!==n.className){var r=this.refEditor.className.trim().split(" ");n.className.trim().split(" ").forEach((function(e){var t=r.indexOf(e);r.splice(t,1)})),this.refEditor.className=" "+i.className+" "+r.join(" ")}i.theme!==n.theme&&o.setTheme("ace/theme/"+i.theme),i.focus&&!n.focus&&this.splitEditor.focus(),i.height===this.props.height&&i.width===this.props.width||this.editor.resize()},t.prototype.componentWillUnmount=function(){this.editor.destroy(),this.editor=null},t.prototype.onChange=function(e){if(this.props.onChange&&!this.silent){var t=[];this.editor.env.split.forEach((function(e){t.push(e.getValue())})),this.props.onChange(t,e)}},t.prototype.onSelectionChange=function(e){if(this.props.onSelectionChange){var t=[];this.editor.env.split.forEach((function(e){t.push(e.getSelection())})),this.props.onSelectionChange(t,e)}},t.prototype.onCursorChange=function(e){if(this.props.onCursorChange){var t=[];this.editor.env.split.forEach((function(e){t.push(e.getSelection())})),this.props.onCursorChange(t,e)}},t.prototype.onFocus=function(e){this.props.onFocus&&this.props.onFocus(e)},t.prototype.onInput=function(e){this.props.onInput&&this.props.onInput(e)},t.prototype.onBlur=function(e){this.props.onBlur&&this.props.onBlur(e)},t.prototype.onCopy=function(e){this.props.onCopy&&this.props.onCopy(e)},t.prototype.onPaste=function(e){this.props.onPaste&&this.props.onPaste(e)},t.prototype.onScroll=function(){this.props.onScroll&&this.props.onScroll(this.editor)},t.prototype.handleOptions=function(e,t){for(var n=Object.keys(e.setOptions),i=0;i<n.length;i++)t.setOption(n[i],e.setOptions[n[i]])},t.prototype.handleMarkers=function(e,t){var n=t.getSession().getMarkers(!0);for(var i in n)n.hasOwnProperty(i)&&t.getSession().removeMarker(n[i].id);for(var i in n=t.getSession().getMarkers(!1))n.hasOwnProperty(i)&&t.getSession().removeMarker(n[i].id);e.forEach((function(e){var n=e.startRow,i=e.startCol,o=e.endRow,r=e.endCol,s=e.className,a=e.type,c=e.inFront,u=void 0!==c&&c,h=new l.Range(n,i,o,r);t.getSession().addMarker(h,s,a,u)}))},t.prototype.updateRef=function(e){this.refEditor=e},t.prototype.render=function(){var e=this.props,t=e.name,n=e.width,i=e.height,o=e.style,s=r({width:n,height:i},o);return h.createElement("div",{ref:this.updateRef,id:t,style:s})},t.propTypes={className:u.string,debounceChangePeriod:u.number,defaultValue:u.arrayOf(u.string),focus:u.bool,fontSize:u.oneOfType([u.number,u.string]),height:u.string,mode:u.string,name:u.string,onBlur:u.func,onChange:u.func,onCopy:u.func,onFocus:u.func,onInput:u.func,onLoad:u.func,onPaste:u.func,onScroll:u.func,orientation:u.string,showGutter:u.bool,splits:u.number,theme:u.string,value:u.arrayOf(u.string),width:u.string,onSelectionChange:u.func,onCursorChange:u.func,onBeforeLoad:u.func,minLines:u.number,maxLines:u.number,readOnly:u.bool,highlightActiveLine:u.bool,tabSize:u.number,showPrintMargin:u.bool,cursorStart:u.number,editorProps:u.object,setOptions:u.object,style:u.object,scrollMargin:u.array,annotations:u.array,markers:u.array,keyboardHandler:u.string,wrapEnabled:u.bool,enableBasicAutocompletion:u.oneOfType([u.bool,u.array]),enableLiveAutocompletion:u.oneOfType([u.bool,u.array]),commands:u.array},t.defaultProps={name:"ace-editor",focus:!1,orientation:"beside",splits:2,mode:"",theme:"",height:"500px",width:"500px",value:[],fontSize:12,showGutter:!0,onChange:null,onPaste:null,onLoad:null,onScroll:null,minLines:null,maxLines:null,readOnly:!1,highlightActiveLine:!0,showPrintMargin:!0,tabSize:4,cursorStart:1,editorProps:{},style:{},scrollMargin:[0,0,0,0],setOptions:{},wrapEnabled:!1,enableBasicAutocompletion:!1,enableLiveAutocompletion:!1},t}(h.Component);t.default=f},1967:function(e,t){"use strict";var n="function"==typeof Symbol&&Symbol.for,i=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,r=n?Symbol.for("react.fragment"):60107,s=n?Symbol.for("react.strict_mode"):60108,a=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,h=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,f=n?Symbol.for("react.suspense_list"):60120,g=n?Symbol.for("react.memo"):60115,m=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.block"):60121,b=n?Symbol.for("react.fundamental"):60117,w=n?Symbol.for("react.responder"):60118,y=n?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case i:switch(e=e.type){case u:case h:case r:case a:case s:case p:return e;default:switch(e=e&&e.$$typeof){case c:case d:case m:case g:case l:return e;default:return t}}case o:return t}}}function C(e){return x(e)===h}t.AsyncMode=u,t.ConcurrentMode=h,t.ContextConsumer=c,t.ContextProvider=l,t.Element=i,t.ForwardRef=d,t.Fragment=r,t.Lazy=m,t.Memo=g,t.Portal=o,t.Profiler=a,t.StrictMode=s,t.Suspense=p,t.isAsyncMode=function(e){return C(e)||x(e)===u},t.isConcurrentMode=C,t.isContextConsumer=function(e){return x(e)===c},t.isContextProvider=function(e){return x(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},t.isForwardRef=function(e){return x(e)===d},t.isFragment=function(e){return x(e)===r},t.isLazy=function(e){return x(e)===m},t.isMemo=function(e){return x(e)===g},t.isPortal=function(e){return x(e)===o},t.isProfiler=function(e){return x(e)===a},t.isStrictMode=function(e){return x(e)===s},t.isSuspense=function(e){return x(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===h||e===a||e===s||e===p||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===g||e.$$typeof===l||e.$$typeof===c||e.$$typeof===d||e.$$typeof===b||e.$$typeof===w||e.$$typeof===y||e.$$typeof===v)},t.typeOf=x},8740:function(e,t,n){"use strict";e.exports=n(1967)},3883:function(e,t,n){var i="undefined"!=typeof window,o=i?window.Masonry||n(3021):null,r=i?n(3706):null,s=n(3182),a=n(1830),l=n(3645),c=n(5164),u=n(7329),h=n(7363),d=n(1e3),p={enableResizableChildren:u.bool,disableImagesLoaded:u.bool,onImagesLoaded:u.func,updateOnEachImageLoad:u.bool,options:u.object,imagesLoadedOptions:u.object,elementType:u.string,onLayoutComplete:u.func,onRemoveComplete:u.func},f=d({masonry:!1,erd:void 0,latestKnownDomChildren:[],displayName:"MasonryComponent",imagesLoadedCancelRef:void 0,propTypes:p,getDefaultProps:function(){return{enableResizableChildren:!1,disableImagesLoaded:!1,updateOnEachImageLoad:!1,options:{},imagesLoadedOptions:{},className:"",elementType:"div",onLayoutComplete:function(){},onRemoveComplete:function(){}}},initializeMasonry:function(e){this.masonry&&!e||(this.masonry=new o(this.masonryContainer,this.props.options),this.props.onLayoutComplete&&this.masonry.on("layoutComplete",this.props.onLayoutComplete),this.props.onRemoveComplete&&this.masonry.on("removeComplete",this.props.onRemoveComplete),this.latestKnownDomChildren=this.getCurrentDomChildren())},getCurrentDomChildren:function(){var e=this.masonryContainer,t=this.props.options.itemSelector?e.querySelectorAll(this.props.options.itemSelector):e.children;return Array.prototype.slice.call(t)},diffDomChildren:function(){var e=!1,t=this.latestKnownDomChildren.filter((function(e){return!!e.parentNode}));t.length!==this.latestKnownDomChildren.length&&(e=!0);var n=this.getCurrentDomChildren(),i=t.filter((function(e){return!~n.indexOf(e)})),o=n.filter((function(e){return!~t.indexOf(e)})),r=0,s=o.filter((function(e){var t=r===n.indexOf(e);return t&&r++,t})),a=o.filter((function(e){return-1===s.indexOf(e)})),l=[];return 0===i.length&&(l=t.filter((function(e,t){return t!==n.indexOf(e)}))),this.latestKnownDomChildren=n,{old:t,new:n,removed:i,appended:a,prepended:s,moved:l,forceItemReload:e}},performLayout:function(){var e=this.diffDomChildren(),t=e.forceItemReload||e.moved.length>0;e.removed.length>0&&(this.props.enableResizableChildren&&e.removed.forEach(this.erd.removeAllListeners,this.erd),this.masonry.remove(e.removed),t=!0),e.appended.length>0&&(this.masonry.appended(e.appended),0===e.prepended.length&&(t=!0),this.props.enableResizableChildren&&e.appended.forEach(this.listenToElementResize,this)),e.prepended.length>0&&(this.masonry.prepended(e.prepended),this.props.enableResizableChildren&&e.prepended.forEach(this.listenToElementResize,this)),t&&this.masonry.reloadItems(),this.masonry.layout()},derefImagesLoaded:function(){this.imagesLoadedCancelRef(),this.imagesLoadedCancelRef=void 0},imagesLoaded:function(){if(!this.props.disableImagesLoaded){this.imagesLoadedCancelRef&&this.derefImagesLoaded();var e=this.props.updateOnEachImageLoad?"progress":"always",t=l(function(e){this.props.onImagesLoaded&&this.props.onImagesLoaded(e),this.masonry.layout()}.bind(this),100),n=r(this.masonryContainer,this.props.imagesLoadedOptions).on(e,t);this.imagesLoadedCancelRef=function(){n.off(e,t),t.cancel()}}},initializeResizableChildren:function(){this.props.enableResizableChildren&&(this.erd=a({strategy:"scroll"}),this.latestKnownDomChildren.forEach(this.listenToElementResize,this))},listenToElementResize:function(e){this.erd.listenTo(e,function(){this.masonry.layout()}.bind(this))},destroyErd:function(){this.erd&&this.latestKnownDomChildren.forEach(this.erd.uninstall,this.erd)},componentDidMount:function(){this.initializeMasonry(),this.initializeResizableChildren(),this.imagesLoaded()},componentDidUpdate:function(){this.performLayout(),this.imagesLoaded()},componentWillUnmount:function(){this.destroyErd(),this.props.onLayoutComplete&&this.masonry.off("layoutComplete",this.props.onLayoutComplete),this.props.onRemoveComplete&&this.masonry.off("removeComplete",this.props.onRemoveComplete),this.imagesLoadedCancelRef&&this.derefImagesLoaded(),this.masonry.destroy()},setRef:function(e){this.masonryContainer=e},render:function(){var e=c(this.props,Object.keys(p));return h.createElement(this.props.elementType,s({},e,{ref:this.setRef}),this.props.children)}});e.exports=f,e.exports.default=f},4508:function(){const{addFilter:e}=wp.hooks;e("vpf.editor.controls-render-data","vpf/editor/controls-render-data/images-categories-suggestions",(e=>{if("images"===e.name){const t=[];e.attributes.images&&e.attributes.images.length&&e.attributes.images.forEach((e=>{e.categories&&e.categories.length&&e.categories.forEach((e=>{-1===t.indexOf(e)&&t.push(e)}))})),t.length&&e.image_controls&&e.image_controls.categories&&e.image_controls.categories.options&&(e.image_controls.categories.options=t.map((e=>({label:e,value:e}))))}return e}))},3180:function(){const{__:e}=wp.i18n,{addFilter:t}=wp.hooks,{useSelect:n}=wp.data,{TextControl:i,TextareaControl:o}=wp.components;function r(t){var r,s,a;const{data:l,textSource:c,img:u,name:h,index:d}=t,{imgData:p}=n((e=>{const{getMedia:t}=e("core");return{imgData:u.id?t(u.id):null}}),[u]);let f="",g="";switch(c){case"title":f=(null==p||null===(r=p.title)||void 0===r?void 0:r.raw)||"",g=e("Loaded automatically from the image Title","visual-portfolio");break;case"caption":f=(null==p||null===(s=p.caption)||void 0===s?void 0:s.raw)||"",g=e("Loaded automatically from the image Caption","visual-portfolio");break;case"alt":f=(null==p?void 0:p.alt_text)||"",g=e("Loaded automatically from the image Alt","visual-portfolio");break;case"description":f=(null==p||null===(a=p.description)||void 0===a?void 0:a.raw)||"",g=e("Loaded automatically from the image Description","visual-portfolio")}const m="title"===h?i:o;return wp.element.createElement(m,{className:"vpf-control-wrap vpf-control-wrap-".concat("title"===h?"text":"textarea"),key:"".concat(u.id||u.imgThumbnailUrl||u.imgUrl,"-").concat(d,"-").concat(h),label:l.label,value:f,help:g,disabled:!0})}t("vpf.editor.gallery-controls-render","vpf/editor/gallery-controls-render/title-and-description-render-by-source",((e,t,n,i)=>{const{attributes:o,img:s}=n,{name:a,index:l}=i;return("title"===a&&o.images_titles_source&&"custom"!==o.images_titles_source||"description"===a&&o.images_descriptions_source&&"custom"!==o.images_descriptions_source)&&(e=wp.element.createElement(r,{data:t,textSource:o["images_".concat(a,"s_source")],img:s,name:a,index:l})),e}))},1927:function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function t(t){for(var i=1;i<arguments.length;i++){var o=null!=arguments[i]?arguments[i]:{};i%2?e(Object(o),!0).forEach((function(e){n(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{addFilter:i}=wp.hooks;i("vpf.editor.changed-attributes","vpf/editor/changed-attributes/live-reload",(e=>{if(!e.$framePortfolio)return e;let n=!1;return Object.keys(e.attributes).forEach((t=>{const i=e.attributes[t];switch(t){case"tiles_type":case"masonry_columns":case"masonry_images_aspect_ratio":case"grid_columns":case"grid_images_aspect_ratio":case"justified_row_height":case"justified_row_height_tolerance":case"justified_max_rows_count":case"justified_last_row":case"slider_effect":case"slider_speed":case"slider_autoplay":case"slider_autoplay_hover_pause":case"slider_centered_slides":case"slider_loop":case"slider_free_mode":case"slider_free_mode_sticky":case"slider_bullets_dynamic":case"items_gap":case"items_gap_vertical":e.$framePortfolio.attr("data-vp-".concat(t.replace(/_/g,"-")),i),e.$framePortfolio.vpf("init");break;case"items_style_default__align":case"items_style_fade__align":case"items_style_fly__align":case"items_style_emerge__align":{let t="";["left","center","right","top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"].forEach((e=>{t+="".concat(t?" ":"","vp-portfolio__item-align-").concat(e)})),e.$framePortfolio.find(".vp-portfolio__item-overlay").removeClass(t).addClass("vp-portfolio__item-align-".concat(i));break}case"list_name":break;default:n=n||e.reload}})),t(t({},e),{},{reload:n})}))},71:function(e,t,n){"use strict";var i=n(5788),o=n.n(i)()((function(e){return e[1]}));o.push([e.id,'.visual-portfolio-gutenberg-preview{position:relative;min-height:40px;overflow:hidden}.visual-portfolio-gutenberg-preview iframe{position:absolute;width:100%;max-width:none !important;margin:0}.visual-portfolio-gutenberg-preview-loading{min-height:150px}.visual-portfolio-gutenberg-preview-loading::after{position:absolute;top:0;right:0;bottom:0;left:0;display:block;content:"";background-color:rgba(139,139,150,.1)}.visual-portfolio-gutenberg-preview-loading iframe{opacity:0}.visual-portfolio-gutenberg-preview-loading>.visual-portfolio-gutenberg-preview-inner{position:absolute}.visual-portfolio-gutenberg-preview-loading>.components-spinner{position:absolute;top:50%;left:50%;z-index:10;margin:0;transform:translateX(-50%) translateY(-50%)}',""]),t.Z=o},3379:function(e){"use strict";var t=[];function n(e){for(var n=-1,i=0;i<t.length;i++)if(t[i].identifier===e){n=i;break}return n}function i(e,i){for(var r={},s=[],a=0;a<e.length;a++){var l=e[a],c=i.base?l[0]+i.base:l[0],u=r[c]||0,h="".concat(c," ").concat(u);r[c]=u+1;var d=n(h),p={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==d)t[d].references++,t[d].updater(p);else{var f=o(p,i);i.byIndex=a,t.splice(a,0,{identifier:h,updater:f,references:1})}s.push(h)}return s}function o(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,o){var r=i(e=e||[],o=o||{});return function(e){e=e||[];for(var s=0;s<r.length;s++){var a=n(r[s]);t[a].references--}for(var l=i(e,o),c=0;c<r.length;c++){var u=n(r[c]);0===t[u].references&&(t[u].updater(),t.splice(u,1))}r=l}}},569:function(e){"use strict";var t={};e.exports=function(e,n){var i=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}},9216:function(e){"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},3565:function(e,t,n){"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},7795:function(e){"use strict";e.exports=function(e){var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var i="";n.supports&&(i+="@supports (".concat(n.supports,") {")),n.media&&(i+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(i+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),i+=n.css,o&&(i+="}"),n.media&&(i+="}"),n.supports&&(i+="}");var r=n.sourceMap;r&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),t.styleTagTransform(i,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},4589:function(e){"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},7363:function(e){"use strict";e.exports=React}},t={};function n(i){var o=t[i];if(void 0!==o)return o.exports;var r=t[i]={id:i,loaded:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}n.amdD=function(){throw new Error("define cannot be used indirect")},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},function(){"use strict";var e={};n.r(e),n.d(e,{getPortfolioLayouts:function(){return A}});var t={};n.r(t),n.d(t,{apiFetch:function(){return R},setPortfolioLayouts:function(){return M}});var i={};n.r(i),n.d(i,{API_FETCH:function(){return T}});var o={};n.r(o),n.d(o,{getPortfolioLayouts:function(){return I}});var r={};n.r(r),n.d(r,{get:function(){return hu}});var s={};n.r(s),n.d(s,{get:function(){return pu}});var a={};n.r(a),n.d(a,{getBlockData:function(){return xu}});var l={};n.r(l),n.d(l,{apiFetch:function(){return Cu},setBlockData:function(){return Su},updateBlockData:function(){return ku}});var c={};function u(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e){r(e)}}function a(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))}function h(e,t){var n,i,o,r,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,i=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){s.label=r[1];break}if(6===r[0]&&s.label<o[1]){s.label=o[1],o=r;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(r);break}o[2]&&s.ops.pop(),s.trys.pop();continue}r=t.call(e,s)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}n.r(c),n.d(c,{API_FETCH:function(){return Eu}});(function(){(console.warn||console.log).apply(console,arguments)}).bind("[clipboard-polyfill]");var d,p,f,g,m="undefined"==typeof navigator?void 0:navigator,v=null==m?void 0:m.clipboard,b=(null===(d=null==v?void 0:v.read)||void 0===d||d.bind(v),null===(p=null==v?void 0:v.readText)||void 0===p||p.bind(v),null===(f=null==v?void 0:v.write)||void 0===f||f.bind(v),null===(g=null==v?void 0:v.writeText)||void 0===g?void 0:g.bind(v)),w="undefined"==typeof window?void 0:window,y=(null==w||w.ClipboardItem,w);var x=function(){this.success=!1};function C(e,t,n){for(var i in e.success=!0,t){var o=t[i],r=n.clipboardData;r.setData(i,o),"text/plain"===i&&r.getData(i)!==o&&(e.success=!1)}n.preventDefault()}function S(e){var t=new x,n=C.bind(this,t,e);document.addEventListener("copy",n);try{document.execCommand("copy")}finally{document.removeEventListener("copy",n)}return t.success}function k(e,t){$(e);var n=S(t);return E(),n}function $(e){var t=document.getSelection();if(t){var n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}}function E(){var e=document.getSelection();e&&e.removeAllRanges()}function _(e){return u(this,void 0,void 0,(function(){var t;return h(this,(function(n){if(t="text/plain"in e,"undefined"==typeof ClipboardEvent&&void 0!==y.clipboardData&&void 0!==y.clipboardData.setData){if(!t)throw new Error("No `text/plain` value was specified.");if(i=e["text/plain"],y.clipboardData.setData("Text",i))return[2,!0];throw new Error("Copying failed, possibly because the user rejected it.")}var i;return S(e)||navigator.userAgent.indexOf("Edge")>-1||k(document.body,e)||function(e){var t=document.createElement("div");t.setAttribute("style","-webkit-user-select: text !important"),t.textContent="temporary element",document.body.appendChild(t);var n=k(t,e);return document.body.removeChild(t),n}(e)||function(e){var t=document.createElement("div");t.setAttribute("style","-webkit-user-select: text !important");var n=t;t.attachShadow&&(n=t.attachShadow({mode:"open"}));var i=document.createElement("span");i.innerText=e,n.appendChild(i),document.body.appendChild(t),$(i);var o=document.execCommand("copy");return E(),document.body.removeChild(t),o}(e["text/plain"])?[2,!0]:[2,!1]}))}))}function L(e){return u(this,void 0,void 0,(function(){return h(this,(function(t){if(b)return[2,b(e)];if(!_(function(e){var t={};return t["text/plain"]=e,t}(e)))throw new Error("writeText() failed");return[2]}))}))}function A(e){return e.layouts}function R(e){return{type:"API_FETCH",request:e}}function M(e){return{type:"SET_PORTFOLIO_LAYOUTS",layouts:e}}const{apiFetch:O}=wp;function T(e){let{request:t}=e;return O(t).catch((e=>!(!e||!e.error||"no_layouts_found"!==e.error_code)&&{response:[],error:!1,success:!0})).then((e=>!!(e&&e.success&&e.response)&&e.response))}function*I(){return M(yield R({path:"/visual-portfolio/v1/get_layouts/"}))}const P=wp.components.ColorPicker,{Component:D}=wp.element,{__:F}=wp.i18n,{Dropdown:N,Tooltip:z,BaseControl:B}=wp.components,{ColorPalette:j}=wp.blockEditor;class W extends D{constructor(){super(...arguments),this.state={keyForPalette:this.props.value,keyForPicker:this.props.value}}render(){const{value:e,onChange:t,alpha:n=!1,colorPalette:i=!0,hint:o=F("Custom Color Picker","visual-portfolio"),afterDropdownContent:r}=this.props;return wp.element.createElement(N,{position:"bottom left",className:"vpf-component-color-picker__dropdown",contentClassName:"vpf-component-color-picker__dropdown-content",renderToggle:t=>{let{isOpen:n,onToggle:i}=t;return wp.element.createElement(z,{text:o},wp.element.createElement("button",{type:"button","aria-expanded":n,className:"vpf-component-color-toggle",onClick:i,"aria-label":o,style:{color:e||""}},wp.element.createElement("span",null)))},renderContent:()=>wp.element.createElement("div",{className:"vpf-component-color-picker"},wp.element.createElement(P,{color:e||"",onChangeComplete:e=>{let n;if(void 0===e.rgb||1===e.rgb.a)n=e.hex;else{const{r:t,g:i,b:o,a:r}=e.rgb;n="rgba(".concat(t,", ").concat(i,", ").concat(o,", ").concat(r,")")}t(n||""),this.setState({keyForPalette:n})},disableAlpha:!n,key:this.state.keyForPicker}),i?wp.element.createElement(B,{label:F("Color Palette","visual-portfolio"),className:"vpf-component-color-picker-palette"},wp.element.createElement(j,{value:e||"",onChange:e=>{t(e||""),this.setState({keyForPicker:e})},disableCustomColors:!0,key:this.state.keyForPalette})):"",r||"")})}}function H(){return H=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},H.apply(this,arguments)}const{Component:V}=wp.element;function U(e){if(e&&e.hasChildNodes()){const t=[];for(let n=0;n<e.childNodes.length;n+=1)t.push(U(e.childNodes[n]));return{classList:e.classList,nodeName:e.nodeName,children:t}}return!1}class G extends V{constructor(){super(...arguments),this.state={nodes:!1},this.onFrameLoad=this.onFrameLoad.bind(this),this.maybeFindIframe=this.maybeFindIframe.bind(this),this.updateTreeData=this.updateTreeData.bind(this)}componentDidMount(){this.maybeFindIframe()}componentDidUpdate(){this.maybeFindIframe()}componentWillUnmount(){this.iframePreview&&this.iframePreview.removeEventListener("load",this.onFrameLoad)}onFrameLoad(){this.iframePreview.contentWindow&&(this.frameJQuery=this.iframePreview.contentWindow.jQuery,this.frameJQuery&&(this.$framePortfolio=this.frameJQuery(".vp-portfolio")),this.updateTreeData())}maybeFindIframe(){if(this.iframePreview)return;const{clientId:e}=this.props,t=document.querySelector("#block-".concat(e," iframe"));t&&(this.iframePreview=t,this.iframePreview.addEventListener("load",this.onFrameLoad),this.onFrameLoad())}updateTreeData(){this.$framePortfolio&&this.setState({nodes:U(this.$framePortfolio[0])})}render(){return this.iframePreview?wp.element.createElement("div",{className:"vpf-component-classes-tree"},wp.element.createElement(G.TreeItem,{node:this.state.nodes,skipNodeByClass:/vp-portfolio__item-popup/,collapseByClass:/^(vp-portfolio__preloader-wrap|vp-portfolio__filter-wrap|vp-portfolio__sort-wrap|vp-portfolio__items-wrap|vp-portfolio__pagination-wrap)$/,skipClass:/vp-uid-/})):null}}G.TreeItem=class extends V{constructor(){super(...arguments),this.state={isCollapsed:null},this.isCollapsed=this.isCollapsed.bind(this)}isCollapsed(){const{node:e,collapseByClass:t}=this.props;let{isCollapsed:n}=this.state;return null===n&&e&&e.classList&&e.classList.length&&e.classList.forEach((e=>{t&&t.test(e)&&(n=!0)})),n}render(){const{node:e,skipNodeByClass:t,skipClass:n}=this.props;if(!e||!e.children.length)return null;const i=[];let o=!1;return e.classList&&e.classList.length&&e.classList.forEach((e=>{n&&n.test(e)||i.push(e),t&&t.test(e)&&(o=!0)})),o?null:wp.element.createElement("ul",null,wp.element.createElement("li",{className:"vpf-component-classes-tree-node ".concat(this.isCollapsed()?"":"is-collapsed")},wp.element.createElement("div",null,e.children.length?wp.element.createElement("button",{type:"button",className:"vpf-component-classes-tree-node-collapse",onClick:()=>this.setState({isCollapsed:!this.isCollapsed()})}):"","<",e.nodeName.toLowerCase(),i.length?wp.element.createElement(wp.element.Fragment,null,' class="',i.map((e=>wp.element.createElement("button",{key:e,type:"button",className:"vpf-component-classes-tree-node-class",onClick:()=>{L(e)}},e))),'" '):"",">")),e.children.length&&this.isCollapsed()?e.children.map((e=>e?wp.element.createElement("li",{className:"vpf-component-classes-tree-child"},wp.element.createElement(G.TreeItem,H({},this.props,{node:e}))):null)):"")}};const{Component:K}=wp.element,{__:q}=wp.i18n,{__experimentalGetSettings:Y,dateI18n:X}=wp.date,{Dropdown:Q,Button:J,DatePicker:Z}=wp.components;class ee extends K{render(){const{value:e,onChange:t}=this.props,n=Y().formats.datetime||"F j, Y";return wp.element.createElement(Q,{renderToggle:t=>{let{onToggle:i}=t;return wp.element.createElement(J,{isSecondary:!0,isSmall:!0,onClick:i},e?X(n,e):q("Select Date","visual-portfolio"))},renderContent:()=>wp.element.createElement("div",{className:"components-datetime vpf-component-date-picker"},wp.element.createElement(Z,{currentDate:e,onChange:t}),e?wp.element.createElement(J,{isSecondary:!0,isSmall:!0,onClick:()=>{t("")}},q("Reset Date","visual-portfolio")):"")})}}var te=n(7708),ne=n.n(te);function ie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ie(Object(n),!0).forEach((function(t){re(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ie(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function re(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{jQuery:se,ajaxurl:ae,VPGutenbergVariables:le}=window,{Component:ce,RawHTML:ue}=wp.element,{Button:he,Spinner:de}=wp.components,pe={};class fe extends ce{constructor(){super(...arguments);const{callback:e}=this.props;this.state={options:oe({},this.props.options),ajaxStatus:!!e},pe[this.props.controlName]=oe({},this.props.options),this.requestAjax=this.requestAjax.bind(this)}componentDidMount(){const{callback:e}=this.props;e&&this.requestAjax({},(e=>{e.options&&this.setState({options:e.options})}))}requestAjax(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const{controlName:i,attributes:o}=this.props;if(this.isAJAXinProgress)return;this.isAJAXinProgress=!0,n&&this.setState({ajaxStatus:"progress"});const r=oe({action:"vp_dynamic_control_callback",nonce:le.nonce,vp_control_name:i,vp_attributes:o},e);se.ajax({url:ae,method:"POST",dataType:"json",data:r,complete:e=>{const o=e.responseJSON;t&&o.response&&(o.response.options&&(pe[i]=oe(oe({},pe[i]),o.response.options)),t(o.response)),n&&this.setState({ajaxStatus:!0}),this.isAJAXinProgress=!1}})}render(){const{controlName:e,value:t,onChange:n,isSetupWizard:i}=this.props,{options:o,ajaxStatus:r}=this.state;return r&&"progress"===r?wp.element.createElement("div",{className:"vpf-component-icon-selector"},wp.element.createElement(de,null)):wp.element.createElement("div",{className:"vpf-component-icon-selector","data-control-name":e},Object.keys(o||{}).map((e=>{const r=o[e];let{icon:s}=r;return i&&(r.image_preview_wizard?s='<img src="'.concat(r.image_preview_wizard,'" alt="').concat(r.title,' Preview">'):r.icon_wizard&&(s=r.icon_wizard)),wp.element.createElement(he,{key:"icon-selector-".concat(r.title,"-").concat(r.value),onClick:()=>n(r.value),className:ne()("vpf-component-icon-selector-item",t===r.value?"vpf-component-icon-selector-item-active":"",r.className)},s?wp.element.createElement(ue,null,s):"",r.title?wp.element.createElement("span",null,r.title):"")})))}}var ge=n(8521);n(6006),n(3765),n(1727),n(6826),n(8253),n(5900);const{Component:me}=wp.element;class ve extends me{constructor(){super(...arguments),this.state={codePlaceholder:this.props.codePlaceholder},this.maybeRemovePlaceholder=this.maybeRemovePlaceholder.bind(this)}componentDidMount(){this.maybeRemovePlaceholder()}maybeRemovePlaceholder(){const{value:e}=this.props,{codePlaceholder:t}=this.state;e&&t&&this.setState({codePlaceholder:""})}render(){const{value:e,onChange:t,mode:n,maxLines:i,minLines:o}=this.props,{codePlaceholder:r}=this.state;return wp.element.createElement(ge.ZP,{className:"vpf-component-code-editor",theme:"textmate",onLoad:e=>{e.renderer.setScrollMargin(16,16,16,16),e.renderer.setPadding(16)},fontSize:12,showPrintMargin:!0,showGutter:!0,highlightActiveLine:!1,width:"100%",setOptions:{enableBasicAutocompletion:!0,enableLiveAutocompletion:!0,enableSnippets:!0,showLineNumbers:!0,printMargin:!1,tabSize:2},editorProps:{$blockScrolling:1/0},value:e||r,onChange:e=>{t(e===r?"":e),this.maybeRemovePlaceholder()},mode:n,maxLines:i,minLines:o})}}var be=n(3883),we=n.n(be);const{useEffect:ye}=wp.element;function xe(e){let{children:t}=e;return ye((()=>{const e=document.createElement("style");return e.innerHTML=t,document.body.appendChild(e),()=>document.body.removeChild(e)}),[t]),null}const{Component:Ce}=wp.element,{Button:Se,Modal:ke}=wp.components;class $e extends Ce{constructor(){super(...arguments),this.state={isOpened:!1}}render(){const{children:e,modalTitle:t,buttonLabel:n,size:i}=this.props,{isOpened:o}=this.state;return wp.element.createElement(wp.element.Fragment,null,wp.element.createElement(Se,{isSecondary:!0,onClick:()=>this.setState({isOpened:!o})},n),o?wp.element.createElement(ke,{title:t,onRequestClose:()=>this.setState({isOpened:!o}),className:ne()("vpf-component-modal",i?"vpf-component-modal-size-".concat(i):"")},e):"")}}const{__:Ee}=wp.i18n,{Component:_e}=wp.element,{Button:Le}=wp.components;class Ae extends _e{constructor(){super(...arguments),this.renderPreview=this.renderPreview.bind(this)}renderPreview(e){const t=e.split(/[:|]/),n='[data-tiles-preview="'.concat(e,'"]');let i="";void 0===t[t.length-1]||t[t.length-1]||t.pop();const o=parseInt(t[0],10)||1;if(t.shift(),i+="".concat(n," .vpf-tiles-preview-item-wrap { width: ").concat(100/o,"%; }"),t&&t.length)for(let e=0;e<t.length;e+=1){const r=t[e].split(","),s=parseFloat(r[0])||1,a=parseFloat(r[1])||1;let l=".vpf-tiles-preview-item-wrap";1<t.length&&(l+=":nth-of-type(".concat(t.length,"n+").concat(e+1,")")),s&&1!==s&&(i+="".concat(n," ").concat(l," { width: ").concat(100*s/o,"%; }")),i+="".concat(n," ").concat(l," .vpf-tiles-preview-item::after { padding-top: ").concat(100*a,"%; }")}return wp.element.createElement(wp.element.Fragment,null,wp.element.createElement(we(),{elementType:"div","data-tiles-preview":e,options:{transitionDuration:0}},Array(...Array(4*o)).map((e=>wp.element.createElement("div",{key:e,className:"vpf-tiles-preview-item-wrap"},wp.element.createElement("div",{className:"vpf-tiles-preview-item"}))))),wp.element.createElement(xe,null,i))}render(){const{value:e,options:t,onChange:n}=this.props;return wp.element.createElement("div",{className:"vpf-component-tiles-selector"},wp.element.createElement($e,{modalTitle:Ee("Tiles","visual-portfolio"),buttonLabel:Ee("Edit Tiles","visual-portfolio")},wp.element.createElement("div",{className:"vpf-component-tiles-selector-items"},t.map((t=>wp.element.createElement(Le,{key:t.value,onClick:()=>n(t.value),className:ne()("vpf-tiles-preview-button",e===t.value?"vpf-tiles-preview-button-active":"")},this.renderPreview(t.value)))))),wp.element.createElement("div",{className:"vpf-tiles-preview-button"},this.renderPreview(e)))}}const{Button:Re,Tooltip:Me}=wp.components;function Oe(e){const{extended:t,value:n,onChange:i}=e;let o=["left","center","right"];return t&&(o=["top-left","top-center","top-right",...o,"bottom-left","bottom-center","bottom-right"]),wp.element.createElement("div",{className:"vpf-component-align-control"},o.map((e=>{const t=e.split("-").map((e=>e.slice(0,1).toUpperCase()+e.slice(1))).join(" ");return wp.element.createElement(Me,{key:"align-".concat(e),text:t},wp.element.createElement(Re,{className:ne()("vpf-component-align-control-".concat(e),n===e?"vpf-component-align-control-active":""),onClick:()=>{i(e)}},wp.element.createElement("span",null),wp.element.createElement("span",null),wp.element.createElement("span",null)))})))}const{__:Te}=wp.i18n,{Component:Ie}=wp.element,{SelectControl:Pe,TextControl:De}=wp.components,Fe={"":Te("Auto","visual-portfolio"),"16:9":Te("Wide 16:9","visual-portfolio"),"21:9":Te("Ultra Wide 21:9","visual-portfolio"),"4:3":Te("TV 4:3","visual-portfolio"),"3:2":Te("Classic Film 3:2","visual-portfolio"),custom:Te("Custom","visual-portfolio")};class Ne extends Ie{constructor(){super(...arguments),this.state={isCustom:void 0===Fe[this.props.value]},this.updatePart=this.updatePart.bind(this)}parseParts(e){let t="",n="";if(e&&/:/g.test(e)){const i=e.split(":");t=i[0],n=i[1]}return[t,n]}updatePart(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{value:n,onChange:i}=this.props,o=this.parseParts(n);e&&o[0]&&o[1]&&(t?o[0]=e:o[1]=e,i("".concat(o[0],":").concat(o[1])))}render(){const{value:e,onChange:t}=this.props,{isCustom:n}=this.state,i=this.parseParts(e);return wp.element.createElement("div",{className:"vpf-component-aspect-ratio"},wp.element.createElement(Pe,{value:n?"custom":e,onChange:n=>{"custom"===n?(this.setState({isCustom:!0}),e||t("3:4")):(this.setState({isCustom:!1}),t(n))},options:Object.keys(Fe).map((e=>({label:Fe[e],value:e})))}),n?wp.element.createElement("div",{className:"vpf-component-aspect-ratio-custom"},wp.element.createElement(De,{label:Te("Width","visual-portfolio"),type:"number",value:i[0],onChange:e=>this.updatePart(e,!0)}),wp.element.createElement(De,{label:Te("Height","visual-portfolio"),type:"number",value:i[1],onChange:e=>this.updatePart(e,!1)})):"")}}function ze(e,t,n,i){var o,r=!1,s=0;function a(){o&&clearTimeout(o)}function l(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var h=this,d=Date.now()-s;function p(){s=Date.now(),n.apply(h,c)}function f(){o=void 0}r||(i&&!o&&p(),a(),void 0===i&&d>e?p():!0!==t&&(o=setTimeout(i?f:p,void 0===i?e-d:e)))}return"boolean"!=typeof t&&(i=n,n=t,t=void 0),l.cancel=function(){a(),r=!0},l}function Be(e,t,n){return void 0===n?ze(e,t,!1):ze(e,n,!1!==t)}var je=function(e){var t=[],n=null,i=function(){for(var i=arguments.length,o=new Array(i),r=0;r<i;r++)o[r]=arguments[r];t=o,n||(n=requestAnimationFrame((function(){n=null,e.apply(void 0,t)})))};return i.cancel=function(){n&&(cancelAnimationFrame(n),n=null)},i};function We(){return We=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},We.apply(this,arguments)}var He=n(7363),Ve=n.n(He),Ue=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){return e.parentNode&&e.parentNode.removeChild(e)})),this.tags=[],this.ctr=0},e}(),Ge=Math.abs,Ke=String.fromCharCode,qe=Object.assign;function Ye(e){return e.trim()}function Xe(e,t,n){return e.replace(t,n)}function Qe(e,t){return e.indexOf(t)}function Je(e,t){return 0|e.charCodeAt(t)}function Ze(e,t,n){return e.slice(t,n)}function et(e){return e.length}function tt(e){return e.length}function nt(e,t){return t.push(e),e}var it=1,ot=1,rt=0,st=0,at=0,lt="";function ct(e,t,n,i,o,r,s){return{value:e,root:t,parent:n,type:i,props:o,children:r,line:it,column:ot,length:s,return:""}}function ut(e,t){return qe(ct("",null,null,"",null,null,0),e,{length:-e.length},t)}function ht(){return at=st>0?Je(lt,--st):0,ot--,10===at&&(ot=1,it--),at}function dt(){return at=st<rt?Je(lt,st++):0,ot++,10===at&&(ot=1,it++),at}function pt(){return Je(lt,st)}function ft(){return st}function gt(e,t){return Ze(lt,e,t)}function mt(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function vt(e){return it=ot=1,rt=et(lt=e),st=0,[]}function bt(e){return lt="",e}function wt(e){return Ye(gt(st-1,Ct(91===e?e+2:40===e?e+1:e)))}function yt(e){for(;(at=pt())&&at<33;)dt();return mt(e)>2||mt(at)>3?"":" "}function xt(e,t){for(;--t&&dt()&&!(at<48||at>102||at>57&&at<65||at>70&&at<97););return gt(e,ft()+(t<6&&32==pt()&&32==dt()))}function Ct(e){for(;dt();)switch(at){case e:return st;case 34:case 39:34!==e&&39!==e&&Ct(at);break;case 40:41===e&&Ct(e);break;case 92:dt()}return st}function St(e,t){for(;dt()&&e+at!==57&&(e+at!==84||47!==pt()););return"/*"+gt(t,st-1)+"*"+Ke(47===e?e:dt())}function kt(e){for(;!mt(pt());)dt();return gt(e,st)}var $t="-ms-",Et="-moz-",_t="-webkit-",Lt="comm",At="rule",Rt="decl",Mt="@keyframes";function Ot(e,t){for(var n="",i=tt(e),o=0;o<i;o++)n+=t(e[o],o,e,t)||"";return n}function Tt(e,t,n,i){switch(e.type){case"@import":case Rt:return e.return=e.return||e.value;case Lt:return"";case Mt:return e.return=e.value+"{"+Ot(e.children,i)+"}";case At:e.value=e.props.join(",")}return et(n=Ot(e.children,i))?e.return=e.value+"{"+n+"}":""}function It(e,t){switch(function(e,t){return(((t<<2^Je(e,0))<<2^Je(e,1))<<2^Je(e,2))<<2^Je(e,3)}(e,t)){case 5103:return _t+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return _t+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return _t+e+Et+e+$t+e+e;case 6828:case 4268:return _t+e+$t+e+e;case 6165:return _t+e+$t+"flex-"+e+e;case 5187:return _t+e+Xe(e,/(\w+).+(:[^]+)/,"-webkit-box-$1$2-ms-flex-$1$2")+e;case 5443:return _t+e+$t+"flex-item-"+Xe(e,/flex-|-self/,"")+e;case 4675:return _t+e+$t+"flex-line-pack"+Xe(e,/align-content|flex-|-self/,"")+e;case 5548:return _t+e+$t+Xe(e,"shrink","negative")+e;case 5292:return _t+e+$t+Xe(e,"basis","preferred-size")+e;case 6060:return _t+"box-"+Xe(e,"-grow","")+_t+e+$t+Xe(e,"grow","positive")+e;case 4554:return _t+Xe(e,/([^-])(transform)/g,"$1-webkit-$2")+e;case 6187:return Xe(Xe(Xe(e,/(zoom-|grab)/,_t+"$1"),/(image-set)/,_t+"$1"),e,"")+e;case 5495:case 3959:return Xe(e,/(image-set\([^]*)/,_t+"$1$`$1");case 4968:return Xe(Xe(e,/(.+:)(flex-)?(.*)/,"-webkit-box-pack:$3-ms-flex-pack:$3"),/s.+-b[^;]+/,"justify")+_t+e+e;case 4095:case 3583:case 4068:case 2532:return Xe(e,/(.+)-inline(.+)/,_t+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(et(e)-1-t>6)switch(Je(e,t+1)){case 109:if(45!==Je(e,t+4))break;case 102:return Xe(e,/(.+:)(.+)-([^]+)/,"$1-webkit-$2-$3$1"+Et+(108==Je(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Qe(e,"stretch")?It(Xe(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==Je(e,t+1))break;case 6444:switch(Je(e,et(e)-3-(~Qe(e,"!important")&&10))){case 107:return Xe(e,":",":"+_t)+e;case 101:return Xe(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+_t+(45===Je(e,14)?"inline-":"")+"box$3$1"+_t+"$2$3$1"+$t+"$2box$3")+e}break;case 5936:switch(Je(e,t+11)){case 114:return _t+e+$t+Xe(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return _t+e+$t+Xe(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return _t+e+$t+Xe(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return _t+e+$t+e+e}return e}function Pt(e){return bt(Dt("",null,null,null,[""],e=vt(e),0,[0],e))}function Dt(e,t,n,i,o,r,s,a,l){for(var c=0,u=0,h=s,d=0,p=0,f=0,g=1,m=1,v=1,b=0,w="",y=o,x=r,C=i,S=w;m;)switch(f=b,b=dt()){case 40:if(108!=f&&58==S.charCodeAt(h-1)){-1!=Qe(S+=Xe(wt(b),"&","&\f"),"&\f")&&(v=-1);break}case 34:case 39:case 91:S+=wt(b);break;case 9:case 10:case 13:case 32:S+=yt(f);break;case 92:S+=xt(ft()-1,7);continue;case 47:switch(pt()){case 42:case 47:nt(Nt(St(dt(),ft()),t,n),l);break;default:S+="/"}break;case 123*g:a[c++]=et(S)*v;case 125*g:case 59:case 0:switch(b){case 0:case 125:m=0;case 59+u:p>0&&et(S)-h&&nt(p>32?zt(S+";",i,n,h-1):zt(Xe(S," ","")+";",i,n,h-2),l);break;case 59:S+=";";default:if(nt(C=Ft(S,t,n,c,u,o,a,w,y=[],x=[],h),r),123===b)if(0===u)Dt(S,t,C,C,y,r,h,a,x);else switch(d){case 100:case 109:case 115:Dt(e,C,C,i&&nt(Ft(e,C,C,0,0,o,a,w,o,y=[],h),x),o,x,h,a,i?y:x);break;default:Dt(S,C,C,C,[""],x,0,a,x)}}c=u=p=0,g=v=1,w=S="",h=s;break;case 58:h=1+et(S),p=f;default:if(g<1)if(123==b)--g;else if(125==b&&0==g++&&125==ht())continue;switch(S+=Ke(b),b*g){case 38:v=u>0?1:(S+="\f",-1);break;case 44:a[c++]=(et(S)-1)*v,v=1;break;case 64:45===pt()&&(S+=wt(dt())),d=pt(),u=h=et(w=S+=kt(ft())),b++;break;case 45:45===f&&2==et(S)&&(g=0)}}return r}function Ft(e,t,n,i,o,r,s,a,l,c,u){for(var h=o-1,d=0===o?r:[""],p=tt(d),f=0,g=0,m=0;f<i;++f)for(var v=0,b=Ze(e,h+1,h=Ge(g=s[f])),w=e;v<p;++v)(w=Ye(g>0?d[v]+" "+b:Xe(b,/&\f/g,d[v])))&&(l[m++]=w);return ct(e,t,n,0===o?At:a,l,c,u)}function Nt(e,t,n){return ct(e,t,n,Lt,Ke(at),Ze(e,2,-2),0)}function zt(e,t,n,i){return ct(e,t,n,Rt,Ze(e,0,i),Ze(e,i+1,-1),i)}var Bt=function(e,t,n){for(var i=0,o=0;i=o,o=pt(),38===i&&12===o&&(t[n]=1),!mt(o);)dt();return gt(e,st)},jt=new WeakMap,Wt=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,i=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||jt.get(n))&&!i){jt.set(e,!0);for(var o=[],r=function(e,t){return bt(function(e,t){var n=-1,i=44;do{switch(mt(i)){case 0:38===i&&12===pt()&&(t[n]=1),e[n]+=Bt(st-1,t,n);break;case 2:e[n]+=wt(i);break;case 4:if(44===i){e[++n]=58===pt()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=Ke(i)}}while(i=dt());return e}(vt(e),t))}(t,o),s=n.props,a=0,l=0;a<r.length;a++)for(var c=0;c<s.length;c++,l++)e.props[l]=o[a]?r[a].replace(/&\f/g,s[c]):s[c]+" "+r[a]}}},Ht=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}},Vt=[function(e,t,n,i){if(e.length>-1&&!e.return)switch(e.type){case Rt:e.return=It(e.value,e.length);break;case Mt:return Ot([ut(e,{value:Xe(e.value,"@","@"+_t)})],i);case At:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return Ot([ut(e,{props:[Xe(t,/:(read-\w+)/,":-moz-$1")]})],i);case"::placeholder":return Ot([ut(e,{props:[Xe(t,/:(plac\w+)/,":-webkit-input-$1")]}),ut(e,{props:[Xe(t,/:(plac\w+)/,":-moz-$1")]}),ut(e,{props:[Xe(t,/:(plac\w+)/,$t+"input-$1")]})],i)}return""}))}}],Ut=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var i,o,r=e.stylisPlugins||Vt,s={},a=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)s[t[n]]=!0;a.push(e)}));var l,c,u,h,d=[Tt,(h=function(e){l.insert(e)},function(e){e.root||(e=e.return)&&h(e)})],p=(c=[Wt,Ht].concat(r,d),u=tt(c),function(e,t,n,i){for(var o="",r=0;r<u;r++)o+=c[r](e,t,n,i)||"";return o});o=function(e,t,n,i){l=n,Ot(Pt(e?e+"{"+t.styles+"}":t.styles),p),i&&(f.inserted[t.name]=!0)};var f={key:t,sheet:new Ue({key:t,container:i,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:s,registered:{},insert:o};return f.sheet.hydrate(a),f};function Gt(e,t,n){var i="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):i+=n+" "})),i}var Kt=function(e,t,n){var i=e.key+"-"+t.name;if(!1===n&&void 0===e.registered[i]&&(e.registered[i]=t.styles),void 0===e.inserted[t.name]){var o=t;do{e.insert(t===o?"."+i:"",o,e.sheet,!0),o=o.next}while(void 0!==o)}},qt=function(e){for(var t,n=0,i=0,o=e.length;o>=4;++i,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(i)|(255&e.charCodeAt(++i))<<8|(255&e.charCodeAt(++i))<<16|(255&e.charCodeAt(++i))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(i+2))<<16;case 2:n^=(255&e.charCodeAt(i+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(i)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},Yt={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Xt=/[A-Z]|^ms/g,Qt=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Jt=function(e){return 45===e.charCodeAt(1)},Zt=function(e){return null!=e&&"boolean"!=typeof e},en=function(e){var t=Object.create(null);return function(e){return void 0===t[e]&&(t[e]=Jt(n=e)?n:n.replace(Xt,"-$&").toLowerCase()),t[e];var n}}(),tn=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Qt,(function(e,t,n){return on={name:t,styles:n,next:on},t}))}return 1===Yt[e]||Jt(e)||"number"!=typeof t||0===t?t:t+"px"};function nn(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return on={name:n.name,styles:n.styles,next:on},n.name;if(void 0!==n.styles){var i=n.next;if(void 0!==i)for(;void 0!==i;)on={name:i.name,styles:i.styles,next:on},i=i.next;return n.styles+";"}return function(e,t,n){var i="";if(Array.isArray(n))for(var o=0;o<n.length;o++)i+=nn(e,t,n[o])+";";else for(var r in n){var s=n[r];if("object"!=typeof s)null!=t&&void 0!==t[s]?i+=r+"{"+t[s]+"}":Zt(s)&&(i+=en(r)+":"+tn(r,s)+";");else if(!Array.isArray(s)||"string"!=typeof s[0]||null!=t&&void 0!==t[s[0]]){var a=nn(e,t,s);switch(r){case"animation":case"animationName":i+=en(r)+":"+a+";";break;default:i+=r+"{"+a+"}"}}else for(var l=0;l<s.length;l++)Zt(s[l])&&(i+=en(r)+":"+tn(r,s[l])+";")}return i}(e,t,n);case"function":if(void 0!==e){var o=on,r=n(e);return on=o,nn(e,t,r)}}if(null==t)return n;var s=t[n];return void 0!==s?s:n}var on,rn=/label:\s*([^\s;\n{]+)\s*(;|$)/g,sn=function(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var i=!0,o="";on=void 0;var r=e[0];null==r||void 0===r.raw?(i=!1,o+=nn(n,t,r)):o+=r[0];for(var s=1;s<e.length;s++)o+=nn(n,t,e[s]),i&&(o+=r[s]);rn.lastIndex=0;for(var a,l="";null!==(a=rn.exec(o));)l+="-"+a[1];return{name:qt(o)+l,styles:o,next:on}},an={}.hasOwnProperty,ln=(0,He.createContext)("undefined"!=typeof HTMLElement?Ut({key:"css"}):null),cn=(ln.Provider,function(e){return(0,He.forwardRef)((function(t,n){var i=(0,He.useContext)(ln);return e(t,i,n)}))}),un=(0,He.createContext)({}),hn="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",dn=function(e,t){var n={};for(var i in t)an.call(t,i)&&(n[i]=t[i]);return n[hn]=e,n},pn=function(){return null},fn=cn((function(e,t,n){var i=e.css;"string"==typeof i&&void 0!==t.registered[i]&&(i=t.registered[i]);var o=e[hn],r=[i],s="";"string"==typeof e.className?s=Gt(t.registered,r,e.className):null!=e.className&&(s=e.className+" ");var a=sn(r,void 0,(0,He.useContext)(un));Kt(t,a,"string"==typeof o),s+=t.key+"-"+a.name;var l={};for(var c in e)an.call(e,c)&&"css"!==c&&c!==hn&&(l[c]=e[c]);l.ref=n,l.className=s;var u=(0,He.createElement)(o,l),h=(0,He.createElement)(pn,null);return(0,He.createElement)(He.Fragment,null,h,u)}));n(9483);var gn=function(e,t){var n=arguments;if(null==t||!an.call(t,"css"))return He.createElement.apply(void 0,n);var i=n.length,o=new Array(i);o[0]=fn,o[1]=dn(e,t);for(var r=2;r<i;r++)o[r]=n[r];return He.createElement.apply(null,o)};function mn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return sn(t)}var vn=function e(t){for(var n=t.length,i=0,o="";i<n;i++){var r=t[i];if(null!=r){var s=void 0;switch(typeof r){case"boolean":break;case"object":if(Array.isArray(r))s=e(r);else for(var a in s="",r)r[a]&&a&&(s&&(s+=" "),s+=a);break;default:s=r}s&&(o&&(o+=" "),o+=s)}}return o};function bn(e,t,n){var i=[],o=Gt(e,i,n);return i.length<2?n:o+t(i)}var wn=function(){return null},yn=cn((function(e,t){var n=function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];var o=sn(n,t.registered);return Kt(t,o,!1),t.key+"-"+o.name},i={css:n,cx:function(){for(var e=arguments.length,i=new Array(e),o=0;o<e;o++)i[o]=arguments[o];return bn(t.registered,n,vn(i))},theme:(0,He.useContext)(un)},o=e.children(i),r=(0,He.createElement)(wn,null);return(0,He.createElement)(He.Fragment,null,r,o)}));function xn(e,t){if(null==e)return{};var n,i,o=function(e,t){if(null==e)return{};var n,i,o={},r=Object.keys(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Cn(e){return Cn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Cn(e)}function Sn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kn(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function $n(e,t,n){return t&&kn(e.prototype,t),n&&kn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function En(e,t){return En=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},En(e,t)}function _n(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&En(e,t)}function Ln(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var An=ReactDOM;function Rn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function On(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mn(Object(n),!0).forEach((function(t){Rn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Tn(e){return Tn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Tn(e)}function In(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Pn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=Tn(e);if(t){var o=Tn(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return In(this,n)}}var Dn=["className","clearValue","cx","getStyles","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Fn=function(){};function Nn(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function zn(e,t,n){var i=[n];if(t&&e)for(var o in t)t.hasOwnProperty(o)&&t[o]&&i.push("".concat(Nn(e,o)));return i.filter((function(e){return e})).map((function(e){return String(e).trim()})).join(" ")}var Bn=function(e){return t=e,Array.isArray(t)?e.filter(Boolean):"object"===Cn(e)&&null!==e?[e]:[];var t},jn=function(e){return e.className,e.clearValue,e.cx,e.getStyles,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme,On({},xn(e,Dn))};function Wn(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function Hn(e){return Wn(e)?window.pageYOffset:e.scrollTop}function Vn(e,t){Wn(e)?window.scrollTo(0,t):e.scrollTop=t}function Un(e,t,n,i){return n*((e=e/i-1)*e*e+1)+t}function Gn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Fn,o=Hn(e),r=t-o,s=10,a=0;function l(){var t=Un(a+=s,o,r,n);Vn(e,t),a<n?window.requestAnimationFrame(l):i(e)}l()}function Kn(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}var qn=!1,Yn={get passive(){return qn=!0}},Xn="undefined"!=typeof window?window:{};Xn.addEventListener&&Xn.removeEventListener&&(Xn.addEventListener("p",Fn,Yn),Xn.removeEventListener("p",Fn,!1));var Qn=qn;function Jn(e){return null!=e}function Zn(e,t,n){return e?t:n}function ei(e){var t=e.maxHeight,n=e.menuEl,i=e.minHeight,o=e.placement,r=e.shouldScroll,s=e.isFixedPosition,a=e.theme.spacing,l=function(e){var t=getComputedStyle(e),n="absolute"===t.position,i=/(auto|scroll)/;if("fixed"===t.position)return document.documentElement;for(var o=e;o=o.parentElement;)if(t=getComputedStyle(o),(!n||"static"!==t.position)&&i.test(t.overflow+t.overflowY+t.overflowX))return o;return document.documentElement}(n),c={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return c;var u=l.getBoundingClientRect().height,h=n.getBoundingClientRect(),d=h.bottom,p=h.height,f=h.top,g=n.offsetParent.getBoundingClientRect().top,m=window.innerHeight,v=Hn(l),b=parseInt(getComputedStyle(n).marginBottom,10),w=parseInt(getComputedStyle(n).marginTop,10),y=g-w,x=m-f,C=y+v,S=u-v-f,k=d-m+v+b,$=v+f-w,E=160;switch(o){case"auto":case"bottom":if(x>=p)return{placement:"bottom",maxHeight:t};if(S>=p&&!s)return r&&Gn(l,k,E),{placement:"bottom",maxHeight:t};if(!s&&S>=i||s&&x>=i)return r&&Gn(l,k,E),{placement:"bottom",maxHeight:s?x-b:S-b};if("auto"===o||s){var _=t,L=s?y:C;return L>=i&&(_=Math.min(L-b-a.controlHeight,t)),{placement:"top",maxHeight:_}}if("bottom"===o)return r&&Vn(l,k),{placement:"bottom",maxHeight:t};break;case"top":if(y>=p)return{placement:"top",maxHeight:t};if(C>=p&&!s)return r&&Gn(l,$,E),{placement:"top",maxHeight:t};if(!s&&C>=i||s&&y>=i){var A=t;return(!s&&C>=i||s&&y>=i)&&(A=s?y-w:C-w),r&&Gn(l,$,E),{placement:"top",maxHeight:A}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(o,'".'))}return c}var ti=function(e){return"auto"===e?"bottom":e},ni=(0,He.createContext)({getPortalPlacement:null}),ii=function(e){_n(n,e);var t=Pn(n);function n(){var e;Sn(this,n);for(var i=arguments.length,o=new Array(i),r=0;r<i;r++)o[r]=arguments[r];return(e=t.call.apply(t,[this].concat(o))).state={maxHeight:e.props.maxMenuHeight,placement:null},e.context=void 0,e.getPlacement=function(t){var n=e.props,i=n.minMenuHeight,o=n.maxMenuHeight,r=n.menuPlacement,s=n.menuPosition,a=n.menuShouldScrollIntoView,l=n.theme;if(t){var c="fixed"===s,u=ei({maxHeight:o,menuEl:t,minHeight:i,placement:r,shouldScroll:a&&!c,isFixedPosition:c,theme:l}),h=e.context.getPortalPlacement;h&&h(u),e.setState(u)}},e.getUpdatedProps=function(){var t=e.props.menuPlacement,n=e.state.placement||ti(t);return On(On({},e.props),{},{placement:n,maxHeight:e.state.maxHeight})},e}return $n(n,[{key:"render",value:function(){return(0,this.props.children)({ref:this.getPlacement,placerProps:this.getUpdatedProps()})}}]),n}(He.Component);ii.contextType=ni;var oi=function(e){var t=e.theme,n=t.spacing.baseUnit;return{color:t.colors.neutral40,padding:"".concat(2*n,"px ").concat(3*n,"px"),textAlign:"center"}},ri=oi,si=oi,ai=function(e){var t=e.children,n=e.className,i=e.cx,o=e.getStyles,r=e.innerProps;return gn("div",We({css:o("noOptionsMessage",e),className:i({"menu-notice":!0,"menu-notice--no-options":!0},n)},r),t)};ai.defaultProps={children:"No options"};var li=function(e){var t=e.children,n=e.className,i=e.cx,o=e.getStyles,r=e.innerProps;return gn("div",We({css:o("loadingMessage",e),className:i({"menu-notice":!0,"menu-notice--loading":!0},n)},r),t)};li.defaultProps={children:"Loading..."};var ci,ui,hi,di=function(e){_n(n,e);var t=Pn(n);function n(){var e;Sn(this,n);for(var i=arguments.length,o=new Array(i),r=0;r<i;r++)o[r]=arguments[r];return(e=t.call.apply(t,[this].concat(o))).state={placement:null},e.getPortalPlacement=function(t){var n=t.placement;n!==ti(e.props.menuPlacement)&&e.setState({placement:n})},e}return $n(n,[{key:"render",value:function(){var e=this.props,t=e.appendTo,n=e.children,i=e.className,o=e.controlElement,r=e.cx,s=e.innerProps,a=e.menuPlacement,l=e.menuPosition,c=e.getStyles,u="fixed"===l;if(!t&&!u||!o)return null;var h=this.state.placement||ti(a),d=function(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}(o),p=u?0:window.pageYOffset,f=d[h]+p,g=gn("div",We({css:c("menuPortal",{offset:f,position:l,rect:d}),className:r({"menu-portal":!0},i)},s),n);return gn(ni.Provider,{value:{getPortalPlacement:this.getPortalPlacement}},t?(0,An.createPortal)(g,t):g)}}]),n}(He.Component),pi=["size"],fi={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},gi=function(e){var t=e.size,n=xn(e,pi);return gn("svg",We({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:fi},n))},mi=function(e){return gn(gi,We({size:20},e),gn("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},vi=function(e){return gn(gi,We({size:20},e),gn("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},bi=function(e){var t=e.isFocused,n=e.theme,i=n.spacing.baseUnit,o=n.colors;return{label:"indicatorContainer",color:t?o.neutral60:o.neutral20,display:"flex",padding:2*i,transition:"color 150ms",":hover":{color:t?o.neutral80:o.neutral40}}},wi=bi,yi=bi,xi=function(){var e=mn.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}(ci||(ui=["\n  0%, 80%, 100% { opacity: 0; }\n  40% { opacity: 1; }\n"],hi||(hi=ui.slice(0)),ci=Object.freeze(Object.defineProperties(ui,{raw:{value:Object.freeze(hi)}})))),Ci=function(e){var t=e.delay,n=e.offset;return gn("span",{css:mn({animation:"".concat(xi," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},Si=function(e){var t=e.className,n=e.cx,i=e.getStyles,o=e.innerProps,r=e.isRtl;return gn("div",We({css:i("loadingIndicator",e),className:n({indicator:!0,"loading-indicator":!0},t)},o),gn(Ci,{delay:0,offset:r}),gn(Ci,{delay:160,offset:!0}),gn(Ci,{delay:320,offset:!r}))};Si.defaultProps={size:4};var ki=["data"],$i=["innerRef","isDisabled","isHidden","inputClassName"],Ei={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},_i={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":On({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Ei)},Li=function(e){return On({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},Ei)},Ai=function(e){var t=e.children,n=e.innerProps;return gn("div",n,t)},Ri={ClearIndicator:function(e){var t=e.children,n=e.className,i=e.cx,o=e.getStyles,r=e.innerProps;return gn("div",We({css:o("clearIndicator",e),className:i({indicator:!0,"clear-indicator":!0},n)},r),t||gn(mi,null))},Control:function(e){var t=e.children,n=e.cx,i=e.getStyles,o=e.className,r=e.isDisabled,s=e.isFocused,a=e.innerRef,l=e.innerProps,c=e.menuIsOpen;return gn("div",We({ref:a,css:i("control",e),className:n({control:!0,"control--is-disabled":r,"control--is-focused":s,"control--menu-is-open":c},o)},l),t)},DropdownIndicator:function(e){var t=e.children,n=e.className,i=e.cx,o=e.getStyles,r=e.innerProps;return gn("div",We({css:o("dropdownIndicator",e),className:i({indicator:!0,"dropdown-indicator":!0},n)},r),t||gn(vi,null))},DownChevron:vi,CrossIcon:mi,Group:function(e){var t=e.children,n=e.className,i=e.cx,o=e.getStyles,r=e.Heading,s=e.headingProps,a=e.innerProps,l=e.label,c=e.theme,u=e.selectProps;return gn("div",We({css:o("group",e),className:i({group:!0},n)},a),gn(r,We({},s,{selectProps:u,theme:c,getStyles:o,cx:i}),l),gn("div",null,t))},GroupHeading:function(e){var t=e.getStyles,n=e.cx,i=e.className,o=jn(e);o.data;var r=xn(o,ki);return gn("div",We({css:t("groupHeading",e),className:n({"group-heading":!0},i)},r))},IndicatorsContainer:function(e){var t=e.children,n=e.className,i=e.cx,o=e.innerProps,r=e.getStyles;return gn("div",We({css:r("indicatorsContainer",e),className:i({indicators:!0},n)},o),t)},IndicatorSeparator:function(e){var t=e.className,n=e.cx,i=e.getStyles,o=e.innerProps;return gn("span",We({},o,{css:i("indicatorSeparator",e),className:n({"indicator-separator":!0},t)}))},Input:function(e){var t=e.className,n=e.cx,i=e.getStyles,o=e.value,r=jn(e),s=r.innerRef,a=r.isDisabled,l=r.isHidden,c=r.inputClassName,u=xn(r,$i);return gn("div",{className:n({"input-container":!0},t),css:i("input",e),"data-value":o||""},gn("input",We({className:n({input:!0},c),ref:s,style:Li(l),disabled:a},u)))},LoadingIndicator:Si,Menu:function(e){var t=e.children,n=e.className,i=e.cx,o=e.getStyles,r=e.innerRef,s=e.innerProps;return gn("div",We({css:o("menu",e),className:i({menu:!0},n),ref:r},s),t)},MenuList:function(e){var t=e.children,n=e.className,i=e.cx,o=e.getStyles,r=e.innerProps,s=e.innerRef,a=e.isMulti;return gn("div",We({css:o("menuList",e),className:i({"menu-list":!0,"menu-list--is-multi":a},n),ref:s},r),t)},MenuPortal:di,LoadingMessage:li,NoOptionsMessage:ai,MultiValue:function(e){var t=e.children,n=e.className,i=e.components,o=e.cx,r=e.data,s=e.getStyles,a=e.innerProps,l=e.isDisabled,c=e.removeProps,u=e.selectProps,h=i.Container,d=i.Label,p=i.Remove;return gn(yn,null,(function(i){var f=i.css,g=i.cx;return gn(h,{data:r,innerProps:On({className:g(f(s("multiValue",e)),o({"multi-value":!0,"multi-value--is-disabled":l},n))},a),selectProps:u},gn(d,{data:r,innerProps:{className:g(f(s("multiValueLabel",e)),o({"multi-value__label":!0},n))},selectProps:u},t),gn(p,{data:r,innerProps:On({className:g(f(s("multiValueRemove",e)),o({"multi-value__remove":!0},n)),"aria-label":"Remove ".concat(t||"option")},c),selectProps:u}))}))},MultiValueContainer:Ai,MultiValueLabel:Ai,MultiValueRemove:function(e){var t=e.children,n=e.innerProps;return gn("div",We({role:"button"},n),t||gn(mi,{size:14}))},Option:function(e){var t=e.children,n=e.className,i=e.cx,o=e.getStyles,r=e.isDisabled,s=e.isFocused,a=e.isSelected,l=e.innerRef,c=e.innerProps;return gn("div",We({css:o("option",e),className:i({option:!0,"option--is-disabled":r,"option--is-focused":s,"option--is-selected":a},n),ref:l,"aria-disabled":r},c),t)},Placeholder:function(e){var t=e.children,n=e.className,i=e.cx,o=e.getStyles,r=e.innerProps;return gn("div",We({css:o("placeholder",e),className:i({placeholder:!0},n)},r),t)},SelectContainer:function(e){var t=e.children,n=e.className,i=e.cx,o=e.getStyles,r=e.innerProps,s=e.isDisabled,a=e.isRtl;return gn("div",We({css:o("container",e),className:i({"--is-disabled":s,"--is-rtl":a},n)},r),t)},SingleValue:function(e){var t=e.children,n=e.className,i=e.cx,o=e.getStyles,r=e.isDisabled,s=e.innerProps;return gn("div",We({css:o("singleValue",e),className:i({"single-value":!0,"single-value--is-disabled":r},n)},s),t)},ValueContainer:function(e){var t=e.children,n=e.className,i=e.cx,o=e.innerProps,r=e.isMulti,s=e.getStyles,a=e.hasValue;return gn("div",We({css:s("valueContainer",e),className:i({"value-container":!0,"value-container--is-multi":r,"value-container--has-value":a},n)},o),t)}};function Mi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function Oi(e,t){if(e){if("string"==typeof e)return Mi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mi(e,t):void 0}}function Ti(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,o,r=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(i=n.next()).done)&&(r.push(i.value),!t||r.length!==t);s=!0);}catch(e){a=!0,o=e}finally{try{s||null==n.return||n.return()}finally{if(a)throw o}}return r}}(e,t)||Oi(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Ii=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Pi(e){var t=e.defaultInputValue,n=void 0===t?"":t,i=e.defaultMenuIsOpen,o=void 0!==i&&i,r=e.defaultValue,s=void 0===r?null:r,a=e.inputValue,l=e.menuIsOpen,c=e.onChange,u=e.onInputChange,h=e.onMenuClose,d=e.onMenuOpen,p=e.value,f=xn(e,Ii),g=Ti((0,He.useState)(void 0!==a?a:n),2),m=g[0],v=g[1],b=Ti((0,He.useState)(void 0!==l?l:o),2),w=b[0],y=b[1],x=Ti((0,He.useState)(void 0!==p?p:s),2),C=x[0],S=x[1],k=(0,He.useCallback)((function(e,t){"function"==typeof c&&c(e,t),S(e)}),[c]),$=(0,He.useCallback)((function(e,t){var n;"function"==typeof u&&(n=u(e,t)),v(void 0!==n?n:e)}),[u]),E=(0,He.useCallback)((function(){"function"==typeof d&&d(),y(!0)}),[d]),_=(0,He.useCallback)((function(){"function"==typeof h&&h(),y(!1)}),[h]),L=void 0!==a?a:m,A=void 0!==l?l:w,R=void 0!==p?p:C;return On(On({},f),{},{inputValue:L,menuIsOpen:A,onChange:k,onInputChange:$,onMenuClose:_,onMenuOpen:E,value:R})}function Di(e){return function(e){if(Array.isArray(e))return Mi(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Oi(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Fi=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function Ni(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!((i=e[n])===(o=t[n])||Fi(i)&&Fi(o)))return!1;var i,o;return!0}for(var zi={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},Bi=function(e){return gn("span",We({css:zi},e))},ji={guidance:function(e){var t=e.isSearchable,n=e.isMulti,i=e.isDisabled,o=e.tabSelectsValue;switch(e.context){case"menu":return"Use Up and Down to choose options".concat(i?"":", press Enter to select the currently focused option",", press Escape to exit the menu").concat(o?", press Tab to select the option and exit the menu":"",".");case"input":return"".concat(e["aria-label"]||"Select"," is focused ").concat(t?",type to refine list":"",", press Down to open the menu, ").concat(n?" press left to focus selected values":"");case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var t=e.action,n=e.label,i=void 0===n?"":n,o=e.labels,r=e.isDisabled;switch(t){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(i,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return"option ".concat(i,r?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,i=e.options,o=e.label,r=void 0===o?"":o,s=e.selectValue,a=e.isDisabled,l=e.isSelected,c=function(e,t){return e&&e.length?"".concat(e.indexOf(t)+1," of ").concat(e.length):""};if("value"===t&&s)return"value ".concat(r," focused, ").concat(c(s,n),".");if("menu"===t){var u=a?" disabled":"",h="".concat(l?"selected":"focused").concat(u);return"option ".concat(r," ").concat(h,", ").concat(c(i,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},Wi=function(e){var t=e.ariaSelection,n=e.focusedOption,i=e.focusedValue,o=e.focusableOptions,r=e.isFocused,s=e.selectValue,a=e.selectProps,l=e.id,c=a.ariaLiveMessages,u=a.getOptionLabel,h=a.inputValue,d=a.isMulti,p=a.isOptionDisabled,f=a.isSearchable,g=a.menuIsOpen,m=a.options,v=a.screenReaderStatus,b=a.tabSelectsValue,w=a["aria-label"],y=a["aria-live"],x=(0,He.useMemo)((function(){return On(On({},ji),c||{})}),[c]),C=(0,He.useMemo)((function(){var e,n="";if(t&&x.onChange){var i=t.option,o=t.options,r=t.removedValue,a=t.removedValues,l=t.value,c=r||i||(e=l,Array.isArray(e)?null:e),h=c?u(c):"",d=o||a||void 0,f=d?d.map(u):[],g=On({isDisabled:c&&p(c,s),label:h,labels:f},t);n=x.onChange(g)}return n}),[t,x,p,s,u]),S=(0,He.useMemo)((function(){var e="",t=n||i,o=!!(n&&s&&s.includes(n));if(t&&x.onFocus){var r={focused:t,label:u(t),isDisabled:p(t,s),isSelected:o,options:m,context:t===n?"menu":"value",selectValue:s};e=x.onFocus(r)}return e}),[n,i,u,p,x,m,s]),k=(0,He.useMemo)((function(){var e="";if(g&&m.length&&x.onFilter){var t=v({count:o.length});e=x.onFilter({inputValue:h,resultsMessage:t})}return e}),[o,h,g,x,m,v]),$=(0,He.useMemo)((function(){var e="";if(x.guidance){var t=i?"value":g?"menu":"input";e=x.guidance({"aria-label":w,context:t,isDisabled:n&&p(n,s),isMulti:d,isSearchable:f,tabSelectsValue:b})}return e}),[w,n,i,d,p,f,g,x,s,b]),E="".concat(S," ").concat(k," ").concat($),_=gn(He.Fragment,null,gn("span",{id:"aria-selection"},C),gn("span",{id:"aria-context"},E)),L="initial-input-focus"===(null==t?void 0:t.action);return gn(He.Fragment,null,gn(Bi,{id:l},L&&_),gn(Bi,{"aria-live":y,"aria-atomic":"false","aria-relevant":"additions text"},r&&!L&&_))},Hi=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],Vi=new RegExp("["+Hi.map((function(e){return e.letters})).join("")+"]","g"),Ui={},Gi=0;Gi<Hi.length;Gi++)for(var Ki=Hi[Gi],qi=0;qi<Ki.letters.length;qi++)Ui[Ki.letters[qi]]=Ki.base;var Yi=function(e){return e.replace(Vi,(function(e){return Ui[e]}))},Xi=function(e,t){var n;void 0===t&&(t=Ni);var i,o=[],r=!1;return function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];return r&&n===this&&t(s,o)||(i=e.apply(this,s),r=!0,n=this,o=s),i}}(Yi),Qi=function(e){return e.replace(/^\s+|\s+$/g,"")},Ji=function(e){return"".concat(e.label," ").concat(e.value)},Zi=["innerRef"];function eo(e){var t=e.innerRef,n=xn(e,Zi);return gn("input",We({ref:t},n,{css:mn({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var to=["boxSizing","height","overflow","paddingRight","position"],no={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function io(e){e.preventDefault()}function oo(e){e.stopPropagation()}function ro(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;0===e?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function so(){return"ontouchstart"in window||navigator.maxTouchPoints}var ao=!("undefined"==typeof window||!window.document||!window.document.createElement),lo=0,co={capture:!1,passive:!1},uo=function(){return document.activeElement&&document.activeElement.blur()},ho={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function po(e){var t=e.children,n=e.lockEnabled,i=e.captureEnabled,o=function(e){var t=e.isEnabled,n=e.onBottomArrive,i=e.onBottomLeave,o=e.onTopArrive,r=e.onTopLeave,s=(0,He.useRef)(!1),a=(0,He.useRef)(!1),l=(0,He.useRef)(0),c=(0,He.useRef)(null),u=(0,He.useCallback)((function(e,t){if(null!==c.current){var l=c.current,u=l.scrollTop,h=l.scrollHeight,d=l.clientHeight,p=c.current,f=t>0,g=h-d-u,m=!1;g>t&&s.current&&(i&&i(e),s.current=!1),f&&a.current&&(r&&r(e),a.current=!1),f&&t>g?(n&&!s.current&&n(e),p.scrollTop=h,m=!0,s.current=!0):!f&&-t>u&&(o&&!a.current&&o(e),p.scrollTop=0,m=!0,a.current=!0),m&&function(e){e.preventDefault(),e.stopPropagation()}(e)}}),[n,i,o,r]),h=(0,He.useCallback)((function(e){u(e,e.deltaY)}),[u]),d=(0,He.useCallback)((function(e){l.current=e.changedTouches[0].clientY}),[]),p=(0,He.useCallback)((function(e){var t=l.current-e.changedTouches[0].clientY;u(e,t)}),[u]),f=(0,He.useCallback)((function(e){if(e){var t=!!Qn&&{passive:!1};e.addEventListener("wheel",h,t),e.addEventListener("touchstart",d,t),e.addEventListener("touchmove",p,t)}}),[p,d,h]),g=(0,He.useCallback)((function(e){e&&(e.removeEventListener("wheel",h,!1),e.removeEventListener("touchstart",d,!1),e.removeEventListener("touchmove",p,!1))}),[p,d,h]);return(0,He.useEffect)((function(){if(t){var e=c.current;return f(e),function(){g(e)}}}),[t,f,g]),function(e){c.current=e}}({isEnabled:void 0===i||i,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}),r=function(e){var t=e.isEnabled,n=e.accountForScrollbars,i=void 0===n||n,o=(0,He.useRef)({}),r=(0,He.useRef)(null),s=(0,He.useCallback)((function(e){if(ao){var t=document.body,n=t&&t.style;if(i&&to.forEach((function(e){var t=n&&n[e];o.current[e]=t})),i&&lo<1){var r=parseInt(o.current.paddingRight,10)||0,s=document.body?document.body.clientWidth:0,a=window.innerWidth-s+r||0;Object.keys(no).forEach((function(e){var t=no[e];n&&(n[e]=t)})),n&&(n.paddingRight="".concat(a,"px"))}t&&so()&&(t.addEventListener("touchmove",io,co),e&&(e.addEventListener("touchstart",ro,co),e.addEventListener("touchmove",oo,co))),lo+=1}}),[i]),a=(0,He.useCallback)((function(e){if(ao){var t=document.body,n=t&&t.style;lo=Math.max(lo-1,0),i&&lo<1&&to.forEach((function(e){var t=o.current[e];n&&(n[e]=t)})),t&&so()&&(t.removeEventListener("touchmove",io,co),e&&(e.removeEventListener("touchstart",ro,co),e.removeEventListener("touchmove",oo,co)))}}),[i]);return(0,He.useEffect)((function(){if(t){var e=r.current;return s(e),function(){a(e)}}}),[t,s,a]),function(e){r.current=e}}({isEnabled:n});return gn(He.Fragment,null,n&&gn("div",{onClick:uo,css:ho}),t((function(e){o(e),r(e)})))}var fo=function(e){return e.label},go=function(e){return e.value},mo={clearIndicator:yi,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},control:function(e){var t=e.isDisabled,n=e.isFocused,i=e.theme,o=i.colors,r=i.borderRadius,s=i.spacing;return{label:"control",alignItems:"center",backgroundColor:t?o.neutral5:o.neutral0,borderColor:t?o.neutral10:n?o.primary:o.neutral20,borderRadius:r,borderStyle:"solid",borderWidth:1,boxShadow:n?"0 0 0 1px ".concat(o.primary):void 0,cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:s.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms","&:hover":{borderColor:n?o.primary:o.neutral30}}},dropdownIndicator:wi,group:function(e){var t=e.theme.spacing;return{paddingBottom:2*t.baseUnit,paddingTop:2*t.baseUnit}},groupHeading:function(e){var t=e.theme.spacing;return{label:"group",color:"#999",cursor:"default",display:"block",fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*t.baseUnit,paddingRight:3*t.baseUnit,textTransform:"uppercase"}},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e){var t=e.isDisabled,n=e.theme,i=n.spacing.baseUnit,o=n.colors;return{label:"indicatorSeparator",alignSelf:"stretch",backgroundColor:t?o.neutral10:o.neutral20,marginBottom:2*i,marginTop:2*i,width:1}},input:function(e){var t=e.isDisabled,n=e.value,i=e.theme,o=i.spacing,r=i.colors;return On({margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,visibility:t?"hidden":"visible",color:r.neutral80,transform:n?"translateZ(0)":""},_i)},loadingIndicator:function(e){var t=e.isFocused,n=e.size,i=e.theme,o=i.colors,r=i.spacing.baseUnit;return{label:"loadingIndicator",color:t?o.neutral60:o.neutral20,display:"flex",padding:2*r,transition:"color 150ms",alignSelf:"center",fontSize:n,lineHeight:1,marginRight:n,textAlign:"center",verticalAlign:"middle"}},loadingMessage:si,menu:function(e){var t,n=e.placement,i=e.theme,o=i.borderRadius,r=i.spacing,s=i.colors;return Ln(t={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(n),"100%"),Ln(t,"backgroundColor",s.neutral0),Ln(t,"borderRadius",o),Ln(t,"boxShadow","0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)"),Ln(t,"marginBottom",r.menuGutter),Ln(t,"marginTop",r.menuGutter),Ln(t,"position","absolute"),Ln(t,"width","100%"),Ln(t,"zIndex",1),t},menuList:function(e){var t=e.maxHeight,n=e.theme.spacing.baseUnit;return{maxHeight:t,overflowY:"auto",paddingBottom:n,paddingTop:n,position:"relative",WebkitOverflowScrolling:"touch"}},menuPortal:function(e){var t=e.rect,n=e.offset,i=e.position;return{left:t.left,position:i,top:n,width:t.width,zIndex:1}},multiValue:function(e){var t=e.theme,n=t.spacing,i=t.borderRadius;return{label:"multiValue",backgroundColor:t.colors.neutral10,borderRadius:i/2,display:"flex",margin:n.baseUnit/2,minWidth:0}},multiValueLabel:function(e){var t=e.theme,n=t.borderRadius,i=t.colors,o=e.cropWithEllipsis;return{borderRadius:n/2,color:i.neutral80,fontSize:"85%",overflow:"hidden",padding:3,paddingLeft:6,textOverflow:o||void 0===o?"ellipsis":void 0,whiteSpace:"nowrap"}},multiValueRemove:function(e){var t=e.theme,n=t.spacing,i=t.borderRadius,o=t.colors;return{alignItems:"center",borderRadius:i/2,backgroundColor:e.isFocused?o.dangerLight:void 0,display:"flex",paddingLeft:n.baseUnit,paddingRight:n.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}}},noOptionsMessage:ri,option:function(e){var t=e.isDisabled,n=e.isFocused,i=e.isSelected,o=e.theme,r=o.spacing,s=o.colors;return{label:"option",backgroundColor:i?s.primary:n?s.primary25:"transparent",color:t?s.neutral20:i?s.neutral0:"inherit",cursor:"default",display:"block",fontSize:"inherit",padding:"".concat(2*r.baseUnit,"px ").concat(3*r.baseUnit,"px"),width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",":active":{backgroundColor:t?void 0:i?s.primary:s.primary50}}},placeholder:function(e){var t=e.theme,n=t.spacing;return{label:"placeholder",color:t.colors.neutral50,gridArea:"1 / 1 / 2 / 3",marginLeft:n.baseUnit/2,marginRight:n.baseUnit/2}},singleValue:function(e){var t=e.isDisabled,n=e.theme,i=n.spacing,o=n.colors;return{label:"singleValue",color:t?o.neutral40:o.neutral80,gridArea:"1 / 1 / 2 / 3",marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},valueContainer:function(e){var t=e.theme.spacing,n=e.isMulti,i=e.hasValue,o=e.selectProps.controlShouldRenderValue;return{alignItems:"center",display:n&&i&&o?"flex":"grid",flex:1,flexWrap:"wrap",padding:"".concat(t.baseUnit/2,"px ").concat(2*t.baseUnit,"px"),WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"}}},vo={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},bo={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Kn(),captureMenuScroll:!Kn(),closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var n=On({ignoreCase:!0,ignoreAccents:!0,stringify:Ji,trim:!0,matchFrom:"any"},undefined),i=n.ignoreCase,o=n.ignoreAccents,r=n.stringify,s=n.trim,a=n.matchFrom,l=s?Qi(t):t,c=s?Qi(r(e)):r(e);return i&&(l=l.toLowerCase(),c=c.toLowerCase()),o&&(l=Xi(l),c=Yi(c)),"start"===a?c.substr(0,l.length)===l:c.indexOf(l)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:fo,getOptionValue:go,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0};function wo(e,t,n,i){return{type:"option",data:t,isDisabled:$o(e,t,n),isSelected:Eo(e,t,n),label:So(e,t),value:ko(e,t),index:i}}function yo(e,t){return e.options.map((function(n,i){if("options"in n){var o=n.options.map((function(n,i){return wo(e,n,t,i)})).filter((function(t){return Co(e,t)}));return o.length>0?{type:"group",data:n,options:o,index:i}:void 0}var r=wo(e,n,t,i);return Co(e,r)?r:void 0})).filter(Jn)}function xo(e){return e.reduce((function(e,t){return"group"===t.type?e.push.apply(e,Di(t.options.map((function(e){return e.data})))):e.push(t.data),e}),[])}function Co(e,t){var n=e.inputValue,i=void 0===n?"":n,o=t.data,r=t.isSelected,s=t.label,a=t.value;return(!Lo(e)||!r)&&_o(e,{label:s,value:a,data:o},i)}var So=function(e,t){return e.getOptionLabel(t)},ko=function(e,t){return e.getOptionValue(t)};function $o(e,t,n){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,n)}function Eo(e,t,n){if(n.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,n);var i=ko(e,t);return n.some((function(t){return ko(e,t)===i}))}function _o(e,t,n){return!e.filterOption||e.filterOption(t,n)}var Lo=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},Ao=1,Ro=function(e){_n(n,e);var t=Pn(n);function n(e){var i;return Sn(this,n),(i=t.call(this,e)).state={ariaSelection:null,focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.instancePrefix="",i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.controlRef=null,i.getControlRef=function(e){i.controlRef=e},i.focusedOptionRef=null,i.getFocusedOptionRef=function(e){i.focusedOptionRef=e},i.menuListRef=null,i.getMenuListRef=function(e){i.menuListRef=e},i.inputRef=null,i.getInputRef=function(e){i.inputRef=e},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(e,t){var n=i.props,o=n.onChange,r=n.name;t.name=r,i.ariaOnChange(e,t),o(e,t)},i.setValue=function(e,t,n){var o=i.props,r=o.closeMenuOnSelect,s=o.isMulti,a=o.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:a}),r&&(i.setState({inputIsHiddenAfterUpdate:!s}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(e,{action:t,option:n})},i.selectOption=function(e){var t=i.props,n=t.blurInputOnSelect,o=t.isMulti,r=t.name,s=i.state.selectValue,a=o&&i.isOptionSelected(e,s),l=i.isOptionDisabled(e,s);if(a){var c=i.getOptionValue(e);i.setValue(s.filter((function(e){return i.getOptionValue(e)!==c})),"deselect-option",e)}else{if(l)return void i.ariaOnChange(e,{action:"select-option",option:e,name:r});o?i.setValue([].concat(Di(s),[e]),"select-option",e):i.setValue(e,"select-option")}n&&i.blurInput()},i.removeValue=function(e){var t=i.props.isMulti,n=i.state.selectValue,o=i.getOptionValue(e),r=n.filter((function(e){return i.getOptionValue(e)!==o})),s=Zn(t,r,r[0]||null);i.onChange(s,{action:"remove-value",removedValue:e}),i.focusInput()},i.clearValue=function(){var e=i.state.selectValue;i.onChange(Zn(i.props.isMulti,[],null),{action:"clear",removedValues:e})},i.popValue=function(){var e=i.props.isMulti,t=i.state.selectValue,n=t[t.length-1],o=t.slice(0,t.length-1),r=Zn(e,o,o[0]||null);i.onChange(r,{action:"pop-value",removedValue:n})},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return zn.apply(void 0,[i.props.classNamePrefix].concat(t))},i.getOptionLabel=function(e){return So(i.props,e)},i.getOptionValue=function(e){return ko(i.props,e)},i.getStyles=function(e,t){var n=mo[e](t);n.boxSizing="border-box";var o=i.props.styles[e];return o?o(n,t):n},i.getElementId=function(e){return"".concat(i.instancePrefix,"-").concat(e)},i.getComponents=function(){return e=i.props,On(On({},Ri),e.components);var e},i.buildCategorizedOptions=function(){return yo(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return xo(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(e,t){i.setState({ariaSelection:On({value:e},t)})},i.onMenuMouseDown=function(e){0===e.button&&(e.stopPropagation(),e.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(e){i.blockOptionHover=!1},i.onControlMouseDown=function(e){var t=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&i.onMenuClose():t&&i.openMenu("first"):(t&&(i.openAfterFocus=!0),i.focusInput()),"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&e.preventDefault()},i.onDropdownIndicatorMouseDown=function(e){if(!(e&&"mousedown"===e.type&&0!==e.button||i.props.isDisabled)){var t=i.props,n=t.isMulti,o=t.menuIsOpen;i.focusInput(),o?(i.setState({inputIsHiddenAfterUpdate:!n}),i.onMenuClose()):i.openMenu("first"),e.preventDefault(),e.stopPropagation()}},i.onClearIndicatorMouseDown=function(e){e&&"mousedown"===e.type&&0!==e.button||(i.clearValue(),e.preventDefault(),e.stopPropagation(),i.openAfterFocus=!1,"touchend"===e.type?i.focusInput():setTimeout((function(){return i.focusInput()})))},i.onScroll=function(e){"boolean"==typeof i.props.closeMenuOnScroll?e.target instanceof HTMLElement&&Wn(e.target)&&i.props.onMenuClose():"function"==typeof i.props.closeMenuOnScroll&&i.props.closeMenuOnScroll(e)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(e){var t=e.touches,n=t&&t.item(0);n&&(i.initialTouchX=n.clientX,i.initialTouchY=n.clientY,i.userIsDragging=!1)},i.onTouchMove=function(e){var t=e.touches,n=t&&t.item(0);if(n){var o=Math.abs(n.clientX-i.initialTouchX),r=Math.abs(n.clientY-i.initialTouchY);i.userIsDragging=o>5||r>5}},i.onTouchEnd=function(e){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(e.target)&&i.menuListRef&&!i.menuListRef.contains(e.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(e){i.userIsDragging||i.onControlMouseDown(e)},i.onClearIndicatorTouchEnd=function(e){i.userIsDragging||i.onClearIndicatorMouseDown(e)},i.onDropdownIndicatorTouchEnd=function(e){i.userIsDragging||i.onDropdownIndicatorMouseDown(e)},i.handleInputChange=function(e){var t=i.props.inputValue,n=e.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(n,{action:"input-change",prevInputValue:t}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(e){i.props.onFocus&&i.props.onFocus(e),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(e){var t=i.props.inputValue;i.menuListRef&&i.menuListRef.contains(document.activeElement)?i.inputRef.focus():(i.props.onBlur&&i.props.onBlur(e),i.onInputChange("",{action:"input-blur",prevInputValue:t}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1}))},i.onOptionHover=function(e){i.blockOptionHover||i.state.focusedOption===e||i.setState({focusedOption:e})},i.shouldHideSelectedOptions=function(){return Lo(i.props)},i.onKeyDown=function(e){var t=i.props,n=t.isMulti,o=t.backspaceRemovesValue,r=t.escapeClearsValue,s=t.inputValue,a=t.isClearable,l=t.isDisabled,c=t.menuIsOpen,u=t.onKeyDown,h=t.tabSelectsValue,d=t.openMenuOnFocus,p=i.state,f=p.focusedOption,g=p.focusedValue,m=p.selectValue;if(!(l||"function"==typeof u&&(u(e),e.defaultPrevented))){switch(i.blockOptionHover=!0,e.key){case"ArrowLeft":if(!n||s)return;i.focusValue("previous");break;case"ArrowRight":if(!n||s)return;i.focusValue("next");break;case"Delete":case"Backspace":if(s)return;if(g)i.removeValue(g);else{if(!o)return;n?i.popValue():a&&i.clearValue()}break;case"Tab":if(i.isComposing)return;if(e.shiftKey||!c||!h||!f||d&&i.isOptionSelected(f,m))return;i.selectOption(f);break;case"Enter":if(229===e.keyCode)break;if(c){if(!f)return;if(i.isComposing)return;i.selectOption(f);break}return;case"Escape":c?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:s}),i.onMenuClose()):a&&r&&i.clearValue();break;case" ":if(s)return;if(!c){i.openMenu("first");break}if(!f)return;i.selectOption(f);break;case"ArrowUp":c?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":c?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!c)return;i.focusOption("pageup");break;case"PageDown":if(!c)return;i.focusOption("pagedown");break;case"Home":if(!c)return;i.focusOption("first");break;case"End":if(!c)return;i.focusOption("last");break;default:return}e.preventDefault()}},i.instancePrefix="react-select-"+(i.props.instanceId||++Ao),i.state.selectValue=Bn(e.value),i}return $n(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput()}},{key:"componentDidUpdate",value:function(e){var t,n,i,o,r,s=this.props,a=s.isDisabled,l=s.menuIsOpen,c=this.state.isFocused;(c&&!a&&e.isDisabled||c&&l&&!e.menuIsOpen)&&this.focusInput(),c&&a&&!e.isDisabled&&this.setState({isFocused:!1},this.onMenuClose),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(t=this.menuListRef,n=this.focusedOptionRef,i=t.getBoundingClientRect(),o=n.getBoundingClientRect(),r=n.offsetHeight/3,o.bottom+r>i.bottom?Vn(t,Math.min(n.offsetTop+n.clientHeight-t.offsetHeight+r,t.scrollHeight)):o.top-r<i.top&&Vn(t,Math.max(n.offsetTop-r,0)),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(e,t){this.props.onInputChange(e,t)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(e){var t=this,n=this.state,i=n.selectValue,o=n.isFocused,r=this.buildFocusableOptions(),s="first"===e?0:r.length-1;if(!this.props.isMulti){var a=r.indexOf(i[0]);a>-1&&(s=a)}this.scrollToFocusedOptionOnUpdate=!(o&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:r[s]},(function(){return t.onMenuOpen()}))}},{key:"focusValue",value:function(e){var t=this.state,n=t.selectValue,i=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var o=n.indexOf(i);i||(o=-1);var r=n.length-1,s=-1;if(n.length){switch(e){case"previous":s=0===o?0:-1===o?r:o-1;break;case"next":o>-1&&o<r&&(s=o+1)}this.setState({inputIsHidden:-1!==s,focusedValue:n[s]})}}}},{key:"focusOption",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state.focusedOption,i=this.getFocusableOptions();if(i.length){var o=0,r=i.indexOf(n);n||(r=-1),"up"===e?o=r>0?r-1:i.length-1:"down"===e?o=(r+1)%i.length:"pageup"===e?(o=r-t)<0&&(o=0):"pagedown"===e?(o=r+t)>i.length-1&&(o=i.length-1):"last"===e&&(o=i.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:i[o],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(vo):On(On({},vo),this.props.theme):vo}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,i=this.getValue,o=this.selectOption,r=this.setValue,s=this.props,a=s.isMulti,l=s.isRtl,c=s.options;return{clearValue:e,cx:t,getStyles:n,getValue:i,hasValue:this.hasValue(),isMulti:a,isRtl:l,options:c,selectOption:o,selectProps:s,setValue:r,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return $o(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return Eo(this.props,e,t)}},{key:"filterOption",value:function(e,t){return _o(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,i=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:i})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,i=e.inputId,o=e.inputValue,r=e.tabIndex,s=e.form,a=e.menuIsOpen,l=this.getComponents().Input,c=this.state,u=c.inputIsHidden,h=c.ariaSelection,d=this.commonProps,p=i||this.getElementId("input"),f=On(On({"aria-autocomplete":"list","aria-expanded":a,"aria-haspopup":!0,"aria-controls":this.getElementId("listbox"),"aria-owns":this.getElementId("listbox"),"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],role:"combobox"},!n&&{"aria-readonly":!0}),this.hasValue()?"initial-input-focus"===(null==h?void 0:h.action)&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return n?He.createElement(l,We({},d,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:p,innerRef:this.getInputRef,isDisabled:t,isHidden:u,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:r,form:s,type:"text",value:o},f)):He.createElement(eo,We({id:p,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Fn,onFocus:this.onInputFocus,disabled:t,tabIndex:r,inputMode:"none",form:s,value:""},f))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.getComponents(),n=t.MultiValue,i=t.MultiValueContainer,o=t.MultiValueLabel,r=t.MultiValueRemove,s=t.SingleValue,a=t.Placeholder,l=this.commonProps,c=this.props,u=c.controlShouldRenderValue,h=c.isDisabled,d=c.isMulti,p=c.inputValue,f=c.placeholder,g=this.state,m=g.selectValue,v=g.focusedValue,b=g.isFocused;if(!this.hasValue()||!u)return p?null:He.createElement(a,We({},l,{key:"placeholder",isDisabled:h,isFocused:b,innerProps:{id:this.getElementId("placeholder")}}),f);if(d)return m.map((function(t,s){var a=t===v,c="".concat(e.getOptionLabel(t),"-").concat(e.getOptionValue(t));return He.createElement(n,We({},l,{components:{Container:i,Label:o,Remove:r},isFocused:a,isDisabled:h,key:c,index:s,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault(),e.stopPropagation()}},data:t}),e.formatOptionLabel(t,"value"))}));if(p)return null;var w=m[0];return He.createElement(s,We({},l,{data:w,isDisabled:h}),this.formatOptionLabel(w,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,n=this.props,i=n.isDisabled,o=n.isLoading,r=this.state.isFocused;if(!this.isClearable()||!e||i||!this.hasValue()||o)return null;var s={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return He.createElement(e,We({},t,{innerProps:s,isFocused:r}))}},{key:"renderLoadingIndicator",value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,n=this.props,i=n.isDisabled,o=n.isLoading,r=this.state.isFocused;return e&&o?He.createElement(e,We({},t,{innerProps:{"aria-hidden":"true"},isDisabled:i,isFocused:r})):null}},{key:"renderIndicatorSeparator",value:function(){var e=this.getComponents(),t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var i=this.commonProps,o=this.props.isDisabled,r=this.state.isFocused;return He.createElement(n,We({},i,{isDisabled:o,isFocused:r}))}},{key:"renderDropdownIndicator",value:function(){var e=this.getComponents().DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,i=this.state.isFocused,o={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return He.createElement(e,We({},t,{innerProps:o,isDisabled:n,isFocused:i}))}},{key:"renderMenu",value:function(){var e=this,t=this.getComponents(),n=t.Group,i=t.GroupHeading,o=t.Menu,r=t.MenuList,s=t.MenuPortal,a=t.LoadingMessage,l=t.NoOptionsMessage,c=t.Option,u=this.commonProps,h=this.state.focusedOption,d=this.props,p=d.captureMenuScroll,f=d.inputValue,g=d.isLoading,m=d.loadingMessage,v=d.minMenuHeight,b=d.maxMenuHeight,w=d.menuIsOpen,y=d.menuPlacement,x=d.menuPosition,C=d.menuPortalTarget,S=d.menuShouldBlockScroll,k=d.menuShouldScrollIntoView,$=d.noOptionsMessage,E=d.onMenuScrollToTop,_=d.onMenuScrollToBottom;if(!w)return null;var L,A=function(t,n){var i=t.type,o=t.data,r=t.isDisabled,s=t.isSelected,a=t.label,l=t.value,d=h===o,p=r?void 0:function(){return e.onOptionHover(o)},f=r?void 0:function(){return e.selectOption(o)},g="".concat(e.getElementId("option"),"-").concat(n),m={id:g,onClick:f,onMouseMove:p,onMouseOver:p,tabIndex:-1};return He.createElement(c,We({},u,{innerProps:m,data:o,isDisabled:r,isSelected:s,key:g,label:a,type:i,value:l,isFocused:d,innerRef:d?e.getFocusedOptionRef:void 0}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())L=this.getCategorizedOptions().map((function(t){if("group"===t.type){var o=t.data,r=t.options,s=t.index,a="".concat(e.getElementId("group"),"-").concat(s),l="".concat(a,"-heading");return He.createElement(n,We({},u,{key:a,data:o,options:r,Heading:i,headingProps:{id:l,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map((function(e){return A(e,"".concat(s,"-").concat(e.index))})))}if("option"===t.type)return A(t,"".concat(t.index))}));else if(g){var R=m({inputValue:f});if(null===R)return null;L=He.createElement(a,u,R)}else{var M=$({inputValue:f});if(null===M)return null;L=He.createElement(l,u,M)}var O={minMenuHeight:v,maxMenuHeight:b,menuPlacement:y,menuPosition:x,menuShouldScrollIntoView:k},T=He.createElement(ii,We({},u,O),(function(t){var n=t.ref,i=t.placerProps,s=i.placement,a=i.maxHeight;return He.createElement(o,We({},u,O,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove,id:e.getElementId("listbox")},isLoading:g,placement:s}),He.createElement(po,{captureEnabled:p,onTopArrive:E,onBottomArrive:_,lockEnabled:S},(function(t){return He.createElement(r,We({},u,{innerRef:function(n){e.getMenuListRef(n),t(n)},isLoading:g,maxHeight:a,focusedOption:h}),L)})))}));return C||"fixed"===x?He.createElement(s,We({},u,{appendTo:C,controlElement:this.controlRef,menuPlacement:y,menuPosition:x}),T):T}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,i=t.isDisabled,o=t.isMulti,r=t.name,s=this.state.selectValue;if(r&&!i){if(o){if(n){var a=s.map((function(t){return e.getOptionValue(t)})).join(n);return He.createElement("input",{name:r,type:"hidden",value:a})}var l=s.length>0?s.map((function(t,n){return He.createElement("input",{key:"i-".concat(n),name:r,type:"hidden",value:e.getOptionValue(t)})})):He.createElement("input",{name:r,type:"hidden"});return He.createElement("div",null,l)}var c=s[0]?this.getOptionValue(s[0]):"";return He.createElement("input",{name:r,type:"hidden",value:c})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,n=t.ariaSelection,i=t.focusedOption,o=t.focusedValue,r=t.isFocused,s=t.selectValue,a=this.getFocusableOptions();return He.createElement(Wi,We({},e,{id:this.getElementId("live-region"),ariaSelection:n,focusedOption:i,focusedValue:o,isFocused:r,selectValue:s,focusableOptions:a}))}},{key:"render",value:function(){var e=this.getComponents(),t=e.Control,n=e.IndicatorsContainer,i=e.SelectContainer,o=e.ValueContainer,r=this.props,s=r.className,a=r.id,l=r.isDisabled,c=r.menuIsOpen,u=this.state.isFocused,h=this.commonProps=this.getCommonProps();return He.createElement(i,We({},h,{className:s,innerProps:{id:a,onKeyDown:this.onKeyDown},isDisabled:l,isFocused:u}),this.renderLiveRegion(),He.createElement(t,We({},h,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:l,isFocused:u,menuIsOpen:c}),He.createElement(o,We({},h,{isDisabled:l}),this.renderPlaceholderOrValue(),this.renderInput()),He.createElement(n,We({},h,{isDisabled:l}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,i=t.clearFocusValueOnUpdate,o=t.inputIsHiddenAfterUpdate,r=t.ariaSelection,s=t.isFocused,a=t.prevWasFocused,l=e.options,c=e.value,u=e.menuIsOpen,h=e.inputValue,d=e.isMulti,p=Bn(c),f={};if(n&&(c!==n.value||l!==n.options||u!==n.menuIsOpen||h!==n.inputValue)){var g=u?function(e,t){return xo(yo(e,t))}(e,p):[],m=i?function(e,t){var n=e.focusedValue,i=e.selectValue.indexOf(n);if(i>-1){if(t.indexOf(n)>-1)return n;if(i<t.length)return t[i]}return null}(t,p):null,v=function(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}(t,g);f={selectValue:p,focusedOption:v,focusedValue:m,clearFocusValueOnUpdate:!1}}var b=null!=o&&e!==n?{inputIsHidden:o,inputIsHiddenAfterUpdate:void 0}:{},w=r,y=s&&a;return s&&!y&&(w={value:Zn(d,p,p[0]||null),options:p,action:"initial-input-focus"},y=!a),"initial-input-focus"===(null==r?void 0:r.action)&&(w=null),On(On(On({},f),b),{},{prevProps:e,ariaSelection:w,prevWasFocused:y})}}]),n}(He.Component);Ro.defaultProps=bo;var Mo=(0,He.forwardRef)((function(e,t){var n=Pi(e);return He.createElement(Ro,We({ref:t},n))})),Oo=(He.Component,Mo),To=["defaultOptions","cacheOptions","loadOptions","options","isLoading","onInputChange","filterOption"],Io=(0,He.forwardRef)((function(e,t){var n=function(e){var t=e.defaultOptions,n=void 0!==t&&t,i=e.cacheOptions,o=void 0!==i&&i,r=e.loadOptions;e.options;var s=e.isLoading,a=void 0!==s&&s,l=e.onInputChange,c=e.filterOption,u=void 0===c?null:c,h=xn(e,To),d=h.inputValue,p=(0,He.useRef)(void 0),f=(0,He.useRef)(!1),g=Ti((0,He.useState)(Array.isArray(n)?n:void 0),2),m=g[0],v=g[1],b=Ti((0,He.useState)(void 0!==d?d:""),2),w=b[0],y=b[1],x=Ti((0,He.useState)(!0===n),2),C=x[0],S=x[1],k=Ti((0,He.useState)(void 0),2),$=k[0],E=k[1],_=Ti((0,He.useState)([]),2),L=_[0],A=_[1],R=Ti((0,He.useState)(!1),2),M=R[0],O=R[1],T=Ti((0,He.useState)({}),2),I=T[0],P=T[1],D=Ti((0,He.useState)(void 0),2),F=D[0],N=D[1],z=Ti((0,He.useState)(void 0),2),B=z[0],j=z[1];o!==B&&(P({}),j(o)),n!==F&&(v(Array.isArray(n)?n:void 0),N(n)),(0,He.useEffect)((function(){return f.current=!0,function(){f.current=!1}}),[]);var W=(0,He.useCallback)((function(e,t){if(!r)return t();var n=r(e,t);n&&"function"==typeof n.then&&n.then(t,(function(){return t()}))}),[r]);(0,He.useEffect)((function(){!0===n&&W(w,(function(e){f.current&&(v(e||[]),S(!!p.current))}))}),[]);var H=(0,He.useCallback)((function(e,t){var n=function(e,t,n){if(n){var i=n(e,t);if("string"==typeof i)return i}return e}(e,t,l);if(!n)return p.current=void 0,y(""),E(""),A([]),S(!1),void O(!1);if(o&&I[n])y(n),E(n),A(I[n]),S(!1),O(!1);else{var i=p.current={};y(n),S(!0),O(!$),W(n,(function(e){f&&i===p.current&&(p.current=void 0,S(!1),E(n),A(e||[]),O(!1),P(e?On(On({},I),{},Ln({},n,e)):I))}))}}),[o,W,$,I,l]),V=M?[]:w&&$?L:m||[];return On(On({},h),{},{options:V,isLoading:C||a,onInputChange:H,filterOption:u})}(e),i=Pi(n);return He.createElement(Ro,We({ref:t},i))})),Po=Io,Do=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],Fo=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=String(e).toLowerCase(),o=String(n.getOptionValue(t)).toLowerCase(),r=String(n.getOptionLabel(t)).toLowerCase();return o===i||r===i},No={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,t,n,i){return!(!e||t.some((function(t){return Fo(e,t,i)}))||n.some((function(t){return Fo(e,t,i)})))},getNewOptionData:function(e,t){return{label:t,value:e,__isNew__:!0}}},zo=(0,He.forwardRef)((function(e,t){var n=function(e){var t=e.allowCreateWhileLoading,n=void 0!==t&&t,i=e.createOptionPosition,o=void 0===i?"last":i,r=e.formatCreateLabel,s=void 0===r?No.formatCreateLabel:r,a=e.isValidNewOption,l=void 0===a?No.isValidNewOption:a,c=e.getNewOptionData,u=void 0===c?No.getNewOptionData:c,h=e.onCreateOption,d=e.options,p=void 0===d?[]:d,f=e.onChange,g=xn(e,Do),m=g.getOptionValue,v=void 0===m?go:m,b=g.getOptionLabel,w=void 0===b?fo:b,y=g.inputValue,x=g.isLoading,C=g.isMulti,S=g.value,k=g.name,$=(0,He.useMemo)((function(){return l(y,Bn(S),p,{getOptionValue:v,getOptionLabel:w})?u(y,s(y)):void 0}),[s,u,w,v,y,l,p,S]),E=(0,He.useMemo)((function(){return!n&&x||!$?p:"first"===o?[$].concat(Di(p)):[].concat(Di(p),[$])}),[n,o,x,$,p]),_=(0,He.useCallback)((function(e,t){if("select-option"!==t.action)return f(e,t);var n=Array.isArray(e)?e:[e];if(n[n.length-1]!==$)f(e,t);else if(h)h(y);else{var i=u(y,y),o={action:"create-option",name:k,option:i};f(Zn(C,[].concat(Di(Bn(S)),[i]),i),o)}}),[u,y,C,k,$,h,f,S]);return On(On({},g),{},{options:E,onChange:_})}(Pi(e));return He.createElement(Ro,We({ref:t},n))})),Bo=zo,jo=n(9271),Wo=n.n(jo);function Ho(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&i.push.apply(i,Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),i.forEach((function(t){Ln(e,t,n[t])}))}return e}function Vo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Uo(e,t){if(t&&("object"===Cn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Vo(e)}function Go(e){return Go=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Go(e)}var Ko=n(2456),qo=n.n(Ko),Yo=n(7329),Xo=n.n(Yo),Qo=function(){function e(){Sn(this,e),Ln(this,"refs",{})}return $n(e,[{key:"add",value:function(e,t){this.refs[e]||(this.refs[e]=[]),this.refs[e].push(t)}},{key:"remove",value:function(e,t){var n=this.getIndex(e,t);-1!==n&&this.refs[e].splice(n,1)}},{key:"isActive",value:function(){return this.active}},{key:"getActive",value:function(){var e=this;return this.refs[this.active.collection].find((function(t){return t.node.sortableInfo.index==e.active.index}))}},{key:"getIndex",value:function(e,t){return this.refs[e].indexOf(t)}},{key:"getOrderedRefs",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.active.collection;return this.refs[e].sort(Jo)}}]),e}();function Jo(e,t){return e.node.sortableInfo.index-t.node.sortableInfo.index}function Zo(e,t){return Object.keys(e).reduce((function(n,i){return-1===t.indexOf(i)&&(n[i]=e[i]),n}),{})}var er={end:["touchend","touchcancel","mouseup"],move:["touchmove","mousemove"],start:["touchstart","mousedown"]},tr=function(){if("undefined"==typeof window||"undefined"==typeof document)return"";var e=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],t=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||""===e.OLink&&["","o"])[1];return"ms"===t?"ms":t&&t.length?t[0].toUpperCase()+t.substr(1):""}();function nr(e,t){Object.keys(t).forEach((function(n){e.style[n]=t[n]}))}function ir(e,t){e.style["".concat(tr,"Transform")]=null==t?"":"translate3d(".concat(t.x,"px,").concat(t.y,"px,0)")}function or(e,t){e.style["".concat(tr,"TransitionDuration")]=null==t?"":"".concat(t,"ms")}function rr(e,t){for(;e;){if(t(e))return e;e=e.parentNode}return null}function sr(e,t,n){return Math.max(e,Math.min(n,t))}function ar(e){return"px"===e.substr(-2)?parseFloat(e):0}function lr(e){var t=window.getComputedStyle(e);return{bottom:ar(t.marginBottom),left:ar(t.marginLeft),right:ar(t.marginRight),top:ar(t.marginTop)}}function cr(e,t){var n=t.displayName||t.name;return n?"".concat(e,"(").concat(n,")"):e}function ur(e,t){var n=e.getBoundingClientRect();return{top:n.top+t.top,left:n.left+t.left}}function hr(e){return e.touches&&e.touches.length?{x:e.touches[0].pageX,y:e.touches[0].pageY}:e.changedTouches&&e.changedTouches.length?{x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY}:{x:e.pageX,y:e.pageY}}function dr(e){return e.touches&&e.touches.length||e.changedTouches&&e.changedTouches.length}function pr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{left:0,top:0};if(e){var i={left:n.left+e.offsetLeft,top:n.top+e.offsetTop};return e.parentNode===t?i:pr(e.parentNode,t,i)}}function fr(e,t,n){return e<n&&e>t?e-1:e>n&&e<t?e+1:e}function gr(e){var t=e.lockOffset,n=e.width,i=e.height,o=t,r=t,s="px";if("string"==typeof t){var a=/^[+-]?\d*(?:\.\d*)?(px|%)$/.exec(t);qo()(null!==a,'lockOffset value should be a number or a string of a number followed by "px" or "%". Given %s',t),o=parseFloat(t),r=parseFloat(t),s=a[1]}return qo()(isFinite(o)&&isFinite(r),"lockOffset value should be a finite. Given %s",t),"%"===s&&(o=o*n/100,r=r*i/100),{x:o,y:r}}function mr(e){var t=e.height,n=e.width,i=e.lockOffset,o=Array.isArray(i)?i:[i,i];qo()(2===o.length,"lockOffset prop of SortableContainer should be a single value or an array of exactly two values. Given %s",i);var r=Ti(o,2),s=r[0],a=r[1];return[gr({height:t,lockOffset:s,width:n}),gr({height:t,lockOffset:a,width:n})]}function vr(e){return e instanceof HTMLElement?function(e){var t=window.getComputedStyle(e),n=/(auto|scroll)/;return["overflow","overflowX","overflowY"].find((function(e){return n.test(t[e])}))}(e)?e:vr(e.parentNode):null}function br(e){var t=window.getComputedStyle(e);return"grid"===t.display?{x:ar(t.gridColumnGap),y:ar(t.gridRowGap)}:{x:0,y:0}}var wr="BUTTON",yr="INPUT",xr="OPTION",Cr="TEXTAREA",Sr="SELECT";function kr(e){var t="input, textarea, select, canvas, [contenteditable]",n=e.querySelectorAll(t),i=e.cloneNode(!0);return Di(i.querySelectorAll(t)).forEach((function(e,t){"file"!==e.type&&(e.value=n[t].value),"radio"===e.type&&e.name&&(e.name="__sortableClone__".concat(e.name)),"CANVAS"===e.tagName&&n[t].width>0&&n[t].height>0&&e.getContext("2d").drawImage(n[t],0,0)})),i}function $r(e){return null!=e.sortableHandle}var Er=function(){function e(t,n){Sn(this,e),this.container=t,this.onScrollCallback=n}return $n(e,[{key:"clear",value:function(){null!=this.interval&&(clearInterval(this.interval),this.interval=null)}},{key:"update",value:function(e){var t=this,n=e.translate,i=e.minTranslate,o=e.maxTranslate,r=e.width,s=e.height,a={x:0,y:0},l={x:1,y:1},c=this.container,u=c.scrollTop,h=c.scrollLeft,d=c.scrollHeight,p=c.scrollWidth,f=0===u,g=d-u-c.clientHeight==0,m=0===h,v=p-h-c.clientWidth==0;n.y>=o.y-s/2&&!g?(a.y=1,l.y=10*Math.abs((o.y-s/2-n.y)/s)):n.x>=o.x-r/2&&!v?(a.x=1,l.x=10*Math.abs((o.x-r/2-n.x)/r)):n.y<=i.y+s/2&&!f?(a.y=-1,l.y=10*Math.abs((n.y-s/2-i.y)/s)):n.x<=i.x+r/2&&!m&&(a.x=-1,l.x=10*Math.abs((n.x-r/2-i.x)/r)),this.interval&&(this.clear(),this.isAutoScrolling=!1),0===a.x&&0===a.y||(this.interval=setInterval((function(){t.isAutoScrolling=!0;var e={left:l.x*a.x,top:l.y*a.y};t.container.scrollTop+=e.top,t.container.scrollLeft+=e.left,t.onScrollCallback(e)}),5))}}]),e}(),_r={axis:Xo().oneOf(["x","y","xy"]),contentWindow:Xo().any,disableAutoscroll:Xo().bool,distance:Xo().number,getContainer:Xo().func,getHelperDimensions:Xo().func,helperClass:Xo().string,helperContainer:Xo().oneOfType([Xo().func,"undefined"==typeof HTMLElement?Xo().any:Xo().instanceOf(HTMLElement)]),hideSortableGhost:Xo().bool,keyboardSortingTransitionDuration:Xo().number,lockAxis:Xo().string,lockOffset:Xo().oneOfType([Xo().number,Xo().string,Xo().arrayOf(Xo().oneOfType([Xo().number,Xo().string]))]),lockToContainerEdges:Xo().bool,onSortEnd:Xo().func,onSortMove:Xo().func,onSortOver:Xo().func,onSortStart:Xo().func,pressDelay:Xo().number,pressThreshold:Xo().number,keyCodes:Xo().shape({lift:Xo().arrayOf(Xo().number),drop:Xo().arrayOf(Xo().number),cancel:Xo().arrayOf(Xo().number),up:Xo().arrayOf(Xo().number),down:Xo().arrayOf(Xo().number)}),shouldCancelStart:Xo().func,transitionDuration:Xo().number,updateBeforeSortStart:Xo().func,useDragHandle:Xo().bool,useWindowAsScrollContainer:Xo().bool},Lr={lift:[32],drop:[32],cancel:[27],up:[38,37],down:[40,39]},Ar={axis:"y",disableAutoscroll:!1,distance:0,getHelperDimensions:function(e){var t=e.node;return{height:t.offsetHeight,width:t.offsetWidth}},hideSortableGhost:!0,lockOffset:"50%",lockToContainerEdges:!1,pressDelay:0,pressThreshold:5,keyCodes:Lr,shouldCancelStart:function(e){return-1!==[yr,Cr,Sr,xr,wr].indexOf(e.target.tagName)||!!rr(e.target,(function(e){return"true"===e.contentEditable}))},transitionDuration:300,useWindowAsScrollContainer:!1},Rr=Object.keys(_r);function Mr(e){qo()(!(e.distance&&e.pressDelay),"Attempted to set both `pressDelay` and `distance` on SortableContainer, you may only use one or the other, not both at the same time.")}function Or(e,t){try{var n=e()}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,value)}var Tr=(0,He.createContext)({manager:{}});function Ir(e){var t,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(e){var t;Sn(this,n),Ln(Vo(Vo(t=Uo(this,Go(n).call(this,e)))),"state",{}),Ln(Vo(Vo(t)),"handleStart",(function(e){var n=t.props,i=n.distance,o=n.shouldCancelStart;if(2!==e.button&&!o(e)){t.touched=!0,t.position=hr(e);var r=rr(e.target,(function(e){return null!=e.sortableInfo}));if(r&&r.sortableInfo&&t.nodeIsChild(r)&&!t.state.sorting){var s=t.props.useDragHandle,a=r.sortableInfo,l=a.index,c=a.collection;if(a.disabled)return;if(s&&!rr(e.target,$r))return;t.manager.active={collection:c,index:l},dr(e)||"A"!==e.target.tagName||e.preventDefault(),i||(0===t.props.pressDelay?t.handlePress(e):t.pressTimer=setTimeout((function(){return t.handlePress(e)}),t.props.pressDelay))}}})),Ln(Vo(Vo(t)),"nodeIsChild",(function(e){return e.sortableInfo.manager===t.manager})),Ln(Vo(Vo(t)),"handleMove",(function(e){var n=t.props,i=n.distance,o=n.pressThreshold;if(!t.state.sorting&&t.touched&&!t._awaitingUpdateBeforeSortStart){var r=hr(e),s={x:t.position.x-r.x,y:t.position.y-r.y},a=Math.abs(s.x)+Math.abs(s.y);t.delta=s,i||o&&!(a>=o)?i&&a>=i&&t.manager.isActive()&&t.handlePress(e):(clearTimeout(t.cancelTimer),t.cancelTimer=setTimeout(t.cancel,0))}})),Ln(Vo(Vo(t)),"handleEnd",(function(){t.touched=!1,t.cancel()})),Ln(Vo(Vo(t)),"cancel",(function(){var e=t.props.distance;t.state.sorting||(e||clearTimeout(t.pressTimer),t.manager.active=null)})),Ln(Vo(Vo(t)),"handlePress",(function(e){try{var n=t.manager.getActive(),i=function(){if(n){var i=function(){var n=d.sortableInfo.index,i=lr(d),o=br(t.container),c=t.scrollContainer.getBoundingClientRect(),g=s({index:n,node:d,collection:p});if(t.node=d,t.margin=i,t.gridGap=o,t.width=g.width,t.height=g.height,t.marginOffset={x:t.margin.left+t.margin.right+t.gridGap.x,y:Math.max(t.margin.top,t.margin.bottom,t.gridGap.y)},t.boundingClientRect=d.getBoundingClientRect(),t.containerBoundingRect=c,t.index=n,t.newIndex=n,t.axis={x:r.indexOf("x")>=0,y:r.indexOf("y")>=0},t.offsetEdge=pr(d,t.container),t.initialOffset=hr(f?Ho({},e,{pageX:t.boundingClientRect.left,pageY:t.boundingClientRect.top}):e),t.initialScroll={left:t.scrollContainer.scrollLeft,top:t.scrollContainer.scrollTop},t.initialWindowScroll={left:window.pageXOffset,top:window.pageYOffset},t.helper=t.helperContainer.appendChild(kr(d)),nr(t.helper,{boxSizing:"border-box",height:"".concat(t.height,"px"),left:"".concat(t.boundingClientRect.left-i.left,"px"),pointerEvents:"none",position:"fixed",top:"".concat(t.boundingClientRect.top-i.top,"px"),width:"".concat(t.width,"px")}),f&&t.helper.focus(),l&&(t.sortableGhost=d,nr(d,{opacity:0,visibility:"hidden"})),t.minTranslate={},t.maxTranslate={},f){var m=h?{top:0,left:0,width:t.contentWindow.innerWidth,height:t.contentWindow.innerHeight}:t.containerBoundingRect,v=m.top,b=m.left,w=m.width,y=v+m.height,x=b+w;t.axis.x&&(t.minTranslate.x=b-t.boundingClientRect.left,t.maxTranslate.x=x-(t.boundingClientRect.left+t.width)),t.axis.y&&(t.minTranslate.y=v-t.boundingClientRect.top,t.maxTranslate.y=y-(t.boundingClientRect.top+t.height))}else t.axis.x&&(t.minTranslate.x=(h?0:c.left)-t.boundingClientRect.left-t.width/2,t.maxTranslate.x=(h?t.contentWindow.innerWidth:c.left+c.width)-t.boundingClientRect.left-t.width/2),t.axis.y&&(t.minTranslate.y=(h?0:c.top)-t.boundingClientRect.top-t.height/2,t.maxTranslate.y=(h?t.contentWindow.innerHeight:c.top+c.height)-t.boundingClientRect.top-t.height/2);a&&a.split(" ").forEach((function(e){return t.helper.classList.add(e)})),t.listenerNode=e.touches?e.target:t.contentWindow,f?(t.listenerNode.addEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.addEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.addEventListener("keydown",t.handleKeyDown)):(er.move.forEach((function(e){return t.listenerNode.addEventListener(e,t.handleSortMove,!1)})),er.end.forEach((function(e){return t.listenerNode.addEventListener(e,t.handleSortEnd,!1)}))),t.setState({sorting:!0,sortingIndex:n}),u&&u({node:d,index:n,collection:p,isKeySorting:f,nodes:t.manager.getOrderedRefs(),helper:t.helper},e),f&&t.keyMove(0)},o=t.props,r=o.axis,s=o.getHelperDimensions,a=o.helperClass,l=o.hideSortableGhost,c=o.updateBeforeSortStart,u=o.onSortStart,h=o.useWindowAsScrollContainer,d=n.node,p=n.collection,f=t.manager.isKeySorting,g=function(){if("function"==typeof c){t._awaitingUpdateBeforeSortStart=!0;var n=Or((function(){var t=d.sortableInfo.index;return Promise.resolve(c({collection:p,index:t,node:d,isKeySorting:f},e)).then((function(){}))}),(function(e,n){if(t._awaitingUpdateBeforeSortStart=!1,e)throw n;return n}));if(n&&n.then)return n.then((function(){}))}}();return g&&g.then?g.then(i):i()}}();return Promise.resolve(i&&i.then?i.then((function(){})):void 0)}catch(e){return Promise.reject(e)}})),Ln(Vo(Vo(t)),"handleSortMove",(function(e){var n=t.props.onSortMove;"function"==typeof e.preventDefault&&e.cancelable&&e.preventDefault(),t.updateHelperPosition(e),t.animateNodes(),t.autoscroll(),n&&n(e)})),Ln(Vo(Vo(t)),"handleSortEnd",(function(e){var n=t.props,i=n.hideSortableGhost,o=n.onSortEnd,r=t.manager,s=r.active.collection,a=r.isKeySorting,l=t.manager.getOrderedRefs();t.listenerNode&&(a?(t.listenerNode.removeEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("keydown",t.handleKeyDown)):(er.move.forEach((function(e){return t.listenerNode.removeEventListener(e,t.handleSortMove)})),er.end.forEach((function(e){return t.listenerNode.removeEventListener(e,t.handleSortEnd)})))),t.helper.parentNode.removeChild(t.helper),i&&t.sortableGhost&&nr(t.sortableGhost,{opacity:"",visibility:""});for(var c=0,u=l.length;c<u;c++){var h=l[c],d=h.node;h.edgeOffset=null,h.boundingClientRect=null,ir(d,null),or(d,null),h.translate=null}t.autoScroller.clear(),t.manager.active=null,t.manager.isKeySorting=!1,t.setState({sorting:!1,sortingIndex:null}),"function"==typeof o&&o({collection:s,newIndex:t.newIndex,oldIndex:t.index,isKeySorting:a,nodes:l},e),t.touched=!1})),Ln(Vo(Vo(t)),"autoscroll",(function(){var e=t.props.disableAutoscroll,n=t.manager.isKeySorting;if(e)t.autoScroller.clear();else{if(n){var i=Ho({},t.translate),o=0,r=0;return t.axis.x&&(i.x=Math.min(t.maxTranslate.x,Math.max(t.minTranslate.x,t.translate.x)),o=t.translate.x-i.x),t.axis.y&&(i.y=Math.min(t.maxTranslate.y,Math.max(t.minTranslate.y,t.translate.y)),r=t.translate.y-i.y),t.translate=i,ir(t.helper,t.translate),t.scrollContainer.scrollLeft+=o,void(t.scrollContainer.scrollTop+=r)}t.autoScroller.update({height:t.height,maxTranslate:t.maxTranslate,minTranslate:t.minTranslate,translate:t.translate,width:t.width})}})),Ln(Vo(Vo(t)),"onAutoScroll",(function(e){t.translate.x+=e.left,t.translate.y+=e.top,t.animateNodes()})),Ln(Vo(Vo(t)),"handleKeyDown",(function(e){var n=e.keyCode,i=t.props,o=i.shouldCancelStart,r=i.keyCodes,s=Ho({},Lr,void 0===r?{}:r);t.manager.active&&!t.manager.isKeySorting||!(t.manager.active||s.lift.includes(n)&&!o(e)&&t.isValidSortingTarget(e))||(e.stopPropagation(),e.preventDefault(),s.lift.includes(n)&&!t.manager.active?t.keyLift(e):s.drop.includes(n)&&t.manager.active?t.keyDrop(e):s.cancel.includes(n)?(t.newIndex=t.manager.active.index,t.keyDrop(e)):s.up.includes(n)?t.keyMove(-1):s.down.includes(n)&&t.keyMove(1))})),Ln(Vo(Vo(t)),"keyLift",(function(e){var n=e.target,i=rr(n,(function(e){return null!=e.sortableInfo})).sortableInfo,o=i.index,r=i.collection;t.initialFocusedNode=n,t.manager.isKeySorting=!0,t.manager.active={index:o,collection:r},t.handlePress(e)})),Ln(Vo(Vo(t)),"keyMove",(function(e){var n=t.manager.getOrderedRefs(),i=n[n.length-1].node.sortableInfo.index,o=t.newIndex+e,r=t.newIndex;if(!(o<0||o>i)){t.prevIndex=r,t.newIndex=o;var s=fr(t.newIndex,t.prevIndex,t.index),a=n.find((function(e){return e.node.sortableInfo.index===s})),l=a.node,c=t.containerScrollDelta,u=a.boundingClientRect||ur(l,c),h=a.translate||{x:0,y:0},d=u.top+h.y-c.top,p=u.left+h.x-c.left,f=r<o,g=f&&t.axis.x?l.offsetWidth-t.width:0,m=f&&t.axis.y?l.offsetHeight-t.height:0;t.handleSortMove({pageX:p+g,pageY:d+m,ignoreTransition:0===e})}})),Ln(Vo(Vo(t)),"keyDrop",(function(e){t.handleSortEnd(e),t.initialFocusedNode&&t.initialFocusedNode.focus()})),Ln(Vo(Vo(t)),"handleKeyEnd",(function(e){t.manager.active&&t.keyDrop(e)})),Ln(Vo(Vo(t)),"isValidSortingTarget",(function(e){var n=t.props.useDragHandle,i=e.target,o=rr(i,(function(e){return null!=e.sortableInfo}));return o&&o.sortableInfo&&!o.sortableInfo.disabled&&(n?$r(i):i.sortableInfo)}));var i=new Qo;return Mr(e),t.manager=i,t.wrappedInstance=(0,He.createRef)(),t.sortableContextValue={manager:i},t.events={end:t.handleEnd,move:t.handleMove,start:t.handleStart},t}return _n(n,t),$n(n,[{key:"componentDidMount",value:function(){var e=this,t=this.props.useWindowAsScrollContainer,n=this.getContainer();Promise.resolve(n).then((function(n){e.container=n,e.document=e.container.ownerDocument||document;var i=e.props.contentWindow||e.document.defaultView||window;e.contentWindow="function"==typeof i?i():i,e.scrollContainer=t?e.document.scrollingElement||e.document.documentElement:vr(e.container)||e.container,e.autoScroller=new Er(e.scrollContainer,e.onAutoScroll),Object.keys(e.events).forEach((function(t){return er[t].forEach((function(n){return e.container.addEventListener(n,e.events[t],!1)}))})),e.container.addEventListener("keydown",e.handleKeyDown)}))}},{key:"componentWillUnmount",value:function(){var e=this;this.helper&&this.helper.parentNode&&this.helper.parentNode.removeChild(this.helper),this.container&&(Object.keys(this.events).forEach((function(t){return er[t].forEach((function(n){return e.container.removeEventListener(n,e.events[t])}))})),this.container.removeEventListener("keydown",this.handleKeyDown))}},{key:"updateHelperPosition",value:function(e){var t=this.props,n=t.lockAxis,i=t.lockOffset,o=t.lockToContainerEdges,r=t.transitionDuration,s=t.keyboardSortingTransitionDuration,a=void 0===s?r:s,l=this.manager.isKeySorting,c=e.ignoreTransition,u=hr(e),h={x:u.x-this.initialOffset.x,y:u.y-this.initialOffset.y};if(h.y-=window.pageYOffset-this.initialWindowScroll.top,h.x-=window.pageXOffset-this.initialWindowScroll.left,this.translate=h,o){var d=Ti(mr({height:this.height,lockOffset:i,width:this.width}),2),p=d[0],f=d[1],g={x:this.width/2-p.x,y:this.height/2-p.y},m={x:this.width/2-f.x,y:this.height/2-f.y};h.x=sr(this.minTranslate.x+g.x,this.maxTranslate.x-m.x,h.x),h.y=sr(this.minTranslate.y+g.y,this.maxTranslate.y-m.y,h.y)}"x"===n?h.y=0:"y"===n&&(h.x=0),l&&a&&!c&&or(this.helper,a),ir(this.helper,h)}},{key:"animateNodes",value:function(){var e=this.props,t=e.transitionDuration,n=e.hideSortableGhost,i=e.onSortOver,o=this.containerScrollDelta,r=this.windowScrollDelta,s=this.manager.getOrderedRefs(),a=this.offsetEdge.left+this.translate.x+o.left,l=this.offsetEdge.top+this.translate.y+o.top,c=this.manager.isKeySorting,u=this.newIndex;this.newIndex=null;for(var h=0,d=s.length;h<d;h++){var p=s[h].node,f=p.sortableInfo.index,g=p.offsetWidth,m=p.offsetHeight,v={height:this.height>m?m/2:this.height/2,width:this.width>g?g/2:this.width/2},b=c&&f>this.index&&f<=u,w=c&&f<this.index&&f>=u,y={x:0,y:0},x=s[h].edgeOffset;x||(x=pr(p,this.container),s[h].edgeOffset=x,c&&(s[h].boundingClientRect=ur(p,o)));var C=h<s.length-1&&s[h+1],S=h>0&&s[h-1];C&&!C.edgeOffset&&(C.edgeOffset=pr(C.node,this.container),c&&(C.boundingClientRect=ur(C.node,o))),f!==this.index?(t&&or(p,t),this.axis.x?this.axis.y?w||f<this.index&&(a+r.left-v.width<=x.left&&l+r.top<=x.top+v.height||l+r.top+v.height<=x.top)?(y.x=this.width+this.marginOffset.x,x.left+y.x>this.containerBoundingRect.width-v.width&&C&&(y.x=C.edgeOffset.left-x.left,y.y=C.edgeOffset.top-x.top),null===this.newIndex&&(this.newIndex=f)):(b||f>this.index&&(a+r.left+v.width>=x.left&&l+r.top+v.height>=x.top||l+r.top+v.height>=x.top+m))&&(y.x=-(this.width+this.marginOffset.x),x.left+y.x<this.containerBoundingRect.left+v.width&&S&&(y.x=S.edgeOffset.left-x.left,y.y=S.edgeOffset.top-x.top),this.newIndex=f):b||f>this.index&&a+r.left+v.width>=x.left?(y.x=-(this.width+this.marginOffset.x),this.newIndex=f):(w||f<this.index&&a+r.left<=x.left+v.width)&&(y.x=this.width+this.marginOffset.x,null==this.newIndex&&(this.newIndex=f)):this.axis.y&&(b||f>this.index&&l+r.top+v.height>=x.top?(y.y=-(this.height+this.marginOffset.y),this.newIndex=f):(w||f<this.index&&l+r.top<=x.top+v.height)&&(y.y=this.height+this.marginOffset.y,null==this.newIndex&&(this.newIndex=f))),ir(p,y),s[h].translate=y):n&&(this.sortableGhost=p,nr(p,{opacity:0,visibility:"hidden"}))}null==this.newIndex&&(this.newIndex=this.index),c&&(this.newIndex=u);var k=c?this.prevIndex:u;i&&this.newIndex!==k&&i({collection:this.manager.active.collection,index:this.index,newIndex:this.newIndex,oldIndex:k,isKeySorting:c,nodes:s,helper:this.helper})}},{key:"getWrappedInstance",value:function(){return qo()(i.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableContainer() call"),this.wrappedInstance.current}},{key:"getContainer",value:function(){var e=this.props.getContainer;return"function"!=typeof e?(0,An.findDOMNode)(this):e(i.withRef?this.getWrappedInstance():void 0)}},{key:"render",value:function(){var t=i.withRef?this.wrappedInstance:null;return(0,He.createElement)(Tr.Provider,{value:this.sortableContextValue},(0,He.createElement)(e,We({ref:t},Zo(this.props,Rr))))}},{key:"helperContainer",get:function(){var e=this.props.helperContainer;return"function"==typeof e?e():this.props.helperContainer||this.document.body}},{key:"containerScrollDelta",get:function(){return this.props.useWindowAsScrollContainer?{left:0,top:0}:{left:this.scrollContainer.scrollLeft-this.initialScroll.left,top:this.scrollContainer.scrollTop-this.initialScroll.top}}},{key:"windowScrollDelta",get:function(){return{left:this.contentWindow.pageXOffset-this.initialWindowScroll.left,top:this.contentWindow.pageYOffset-this.initialWindowScroll.top}}}]),n}(He.Component),Ln(t,"displayName",cr("sortableList",e)),Ln(t,"defaultProps",Ar),Ln(t,"propTypes",_r),n}var Pr={index:Xo().number.isRequired,collection:Xo().oneOfType([Xo().number,Xo().string]),disabled:Xo().bool},Dr=Object.keys(Pr);function Fr(){return Fr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Fr.apply(this,arguments)}function Nr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function zr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Nr(Object(n),!0).forEach((function(t){Br(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Br(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{Option:jr}=Ri,{jQuery:Wr,ajaxurl:Hr,VPGutenbergVariables:Vr}=window,{__:Ur}=wp.i18n,{Component:Gr}=wp.element,Kr={},qr=Ir(Oo),Yr=Ir(Bo),Xr=Ir(Po),Qr=function(e){var t,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(){var e,t;Sn(this,n);for(var i=arguments.length,o=new Array(i),r=0;r<i;r++)o[r]=arguments[r];return Ln(Vo(Vo(t=Uo(this,(e=Go(n)).call.apply(e,[this].concat(o))))),"wrappedInstance",(0,He.createRef)()),t}return _n(n,t),$n(n,[{key:"componentDidMount",value:function(){(0,An.findDOMNode)(this).sortableHandle=!0}},{key:"getWrappedInstance",value:function(){return qo()(i.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableHandle() call"),this.wrappedInstance.current}},{key:"render",value:function(){var t=i.withRef?this.wrappedInstance:null;return(0,He.createElement)(e,We({ref:t},this.props))}}]),n}(He.Component),Ln(t,"displayName",cr("sortableHandle",e)),n}((e=>wp.element.createElement(Ri.MultiValueLabel,e))),Jr=function(e){var t,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(){var e,t;Sn(this,n);for(var i=arguments.length,o=new Array(i),r=0;r<i;r++)o[r]=arguments[r];return Ln(Vo(Vo(t=Uo(this,(e=Go(n)).call.apply(e,[this].concat(o))))),"wrappedInstance",(0,He.createRef)()),t}return _n(n,t),$n(n,[{key:"componentDidMount",value:function(){this.register()}},{key:"componentDidUpdate",value:function(e){this.node&&(e.index!==this.props.index&&(this.node.sortableInfo.index=this.props.index),e.disabled!==this.props.disabled&&(this.node.sortableInfo.disabled=this.props.disabled)),e.collection!==this.props.collection&&(this.unregister(e.collection),this.register())}},{key:"componentWillUnmount",value:function(){this.unregister()}},{key:"register",value:function(){var e=this.props,t=e.collection,n=e.disabled,i=e.index,o=(0,An.findDOMNode)(this);o.sortableInfo={collection:t,disabled:n,index:i,manager:this.context.manager},this.node=o,this.ref={node:o},this.context.manager.add(t,this.ref)}},{key:"unregister",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.collection;this.context.manager.remove(e,this.ref)}},{key:"getWrappedInstance",value:function(){return qo()(i.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableElement() call"),this.wrappedInstance.current}},{key:"render",value:function(){var t=i.withRef?this.wrappedInstance:null;return(0,He.createElement)(e,We({ref:t},Zo(this.props,Dr)))}}]),n}(He.Component),Ln(t,"displayName",cr("sortableElement",e)),Ln(t,"contextType",Tr),Ln(t,"propTypes",Pr),Ln(t,"defaultProps",{collection:0}),n}((e=>{const t=zr(zr({},e.innerProps),{},{onMouseDown:e=>{e.preventDefault(),e.stopPropagation()}});return wp.element.createElement(Ri.MultiValue,Fr({},e,{innerProps:t}))}));class Zr extends Gr{constructor(){super(...arguments);const{callback:e}=this.props;this.state={options:{},ajaxStatus:!!e},this.getOptions=this.getOptions.bind(this),this.getDefaultValue=this.getDefaultValue.bind(this),this.findValueData=this.findValueData.bind(this),this.requestAjax=this.requestAjax.bind(this),this.requestAjaxDebounce=Be(300,je(this.requestAjax))}componentDidMount(){const{callback:e}=this.props;e&&this.requestAjax({},(e=>{e.options&&this.setState({options:e.options})}))}getOptions(){const{controlName:e}=this.props;return Kr[e]?Kr[e]:Object.keys(this.state.options).length?this.state.options:this.props.options}getDefaultValue(){const{value:e,isMultiple:t}=this.props;let n=null;if(t){if(!e&&"string"!=typeof e||!e.length)return n;n=[],e.forEach((e=>{n.push(this.findValueData(e))}))}else{if(!e&&"string"!=typeof e)return n;n=this.findValueData(e)}return n}findValueData(e){let t={value:e,label:e};const n=this.getOptions();return n&&Object.keys(n).forEach((i=>{const o=n[i];i===e&&("string"==typeof o?t.label=o:t=o)})),t}requestAjax(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const{controlName:i,attributes:o}=this.props;if(this.isAJAXinProgress)return;this.isAJAXinProgress=!0,n&&this.setState({ajaxStatus:"progress"});const r=zr({action:"vp_dynamic_control_callback",nonce:Vr.nonce,vp_control_name:i,vp_attributes:o},e);Wr.ajax({url:Hr,method:"POST",dataType:"json",data:r,complete:e=>{const o=e.responseJSON;t&&o.response&&(o.response.options&&(Kr[i]=zr(zr({},Kr[i]),o.response.options)),t(o.response)),n&&this.setState({ajaxStatus:!0}),this.isAJAXinProgress=!1}})}prepareOptions(e){return Object.keys(e||{}).map((t=>{const n=e[t];let i={value:t,label:e[t]};return"object"==typeof n&&(i=zr({},n)),i}))}render(){const{onChange:e,isMultiple:t,isSearchable:n,isCreatable:i,callback:o}=this.props,{ajaxStatus:r}=this.state,s=!!o&&n,a=r&&"progress"===r,l={className:"vpf-component-select",styles:Wo(),components:{Option(e){const{data:t}=e;return wp.element.createElement(jr,e,void 0!==t.img?wp.element.createElement("div",{className:"vpf-component-select-option-img"},t.img?wp.element.createElement("img",{src:t.img,alt:t.label}):""):"",wp.element.createElement("span",{className:"vpf-component-select-option-label"},t.label),t.category?wp.element.createElement("div",{className:"vpf-component-select-option-category"},t.category):"")}},value:this.getDefaultValue(),options:this.prepareOptions(this.getOptions()),onChange(n){if(t)if(Array.isArray(n)){const t=[];n.forEach((e=>{t.push(e?e.value:"")})),e(t)}else e([]);else e(n?n.value:"")},isMulti:t,isSearchable:n,isLoading:a,isClearable:!1,placeholder:Ur(n?"Type to search...":"Select...","visual-portfolio")};return t&&(l.useDragHandle=!0,l.axis="xy",l.onSortEnd=e=>{let{oldIndex:t,newIndex:n}=e;const i=(o=this.getDefaultValue(),r=t,s=n,(o=o.slice()).splice(0>s?o.length+s:s,0,o.splice(r,1)[0]),o);var o,r,s;l.onChange(i)},l.distance=4,l.getHelperDimensions=e=>{let{node:t}=e;return t.getBoundingClientRect()},l.components.MultiValue=Jr,l.components.MultiValueLabel=Qr,l.closeMenuOnSelect=!1),i?(l.placeholder=Ur("Type and press Enter...","visual-portfolio"),l.isSearchable=!0,t?wp.element.createElement(Yr,l):wp.element.createElement(Bo,l)):s?(l.loadOptions=(e,t)=>{this.requestAjaxDebounce({q:e},(e=>{const n=[];e&&e.options&&Object.keys(e.options).forEach((t=>{n.push(e.options[t])})),t(n.length?n:null)}),!1)},l.cacheOptions=!0,l.defaultOptions=l.options,delete l.options,delete l.isLoading,t?wp.element.createElement(Xr,l):wp.element.createElement(Po,l)):t?wp.element.createElement(qr,l):wp.element.createElement(Oo,l)}}function es(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ts(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?es(Object(n),!0).forEach((function(t){ns(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):es(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ns(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const is="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function os(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function rs(e){return"nodeType"in e}function ss(e){var t,n;return e?os(e)?e:rs(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function as(e){const{Document:t}=ss(e);return e instanceof t}function ls(e){return!os(e)&&e instanceof ss(e).HTMLElement}function cs(e){return e?os(e)?e.document:rs(e)?as(e)?e:ls(e)?e.ownerDocument:document:document:document}const us=is?He.useLayoutEffect:He.useEffect;function hs(e){const t=(0,He.useRef)(e);return us((()=>{t.current=e})),(0,He.useCallback)((function(){return null==t.current?void 0:t.current(...arguments)}),[])}function ds(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[e];const n=(0,He.useRef)(e);return us((()=>{n.current!==e&&(n.current=e)}),t),n}function ps(e,t){const n=(0,He.useRef)();return(0,He.useMemo)((()=>{const t=e(n.current);return n.current=t,t}),[...t])}function fs(e){const t=hs(e),n=(0,He.useRef)(null),i=(0,He.useCallback)((e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e}),[]);return[n,i]}function gs(e){const t=(0,He.useRef)();return(0,He.useEffect)((()=>{t.current=e}),[e]),t.current}let ms={};function vs(e,t){return(0,He.useMemo)((()=>{if(t)return t;const n=null==ms[e]?0:ms[e]+1;return ms[e]=n,"".concat(e,"-").concat(n)}),[e,t])}function bs(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return i.reduce(((t,n)=>{const i=Object.entries(n);for(const[n,o]of i){const i=t[n];null!=i&&(t[n]=i+e*o)}return t}),ts({},t))}}const ws=bs(1),ys=bs(-1);function xs(e){if(!e)return!1;const{KeyboardEvent:t}=ss(e.target);return t&&e instanceof t}function Cs(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=ss(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const Ss=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d(".concat(t?Math.round(t):0,"px, ").concat(n?Math.round(n):0,"px, 0)")}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX(".concat(t,") scaleY(").concat(n,")")}},Transform:{toString(e){if(e)return[Ss.Translate.toString(e),Ss.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:i}=e;return"".concat(t," ").concat(n,"ms ").concat(i)}}}),ks="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function $s(e){return e.matches(ks)?e:e.querySelector(ks)}const Es={display:"none"};function _s(e){let{id:t,value:n}=e;return Ve().createElement("div",{id:t,style:Es},n)}const Ls={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};function As(e){let{id:t,announcement:n}=e;return Ve().createElement("div",{id:t,style:Ls,role:"status","aria-live":"assertive","aria-atomic":!0},n)}const Rs=["transform"],Ms=["id","accessibility","autoScroll","children","sensors","collisionDetection","measuring","modifiers"];function Os(e,t){if(null==e)return{};var n,i,o=function(e,t){if(null==e)return{};var n,i,o={},r=Object.keys(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Ts(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Is(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ts(Object(n),!0).forEach((function(t){Ps(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ts(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ps(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ds=(0,He.createContext)(null),Fs={draggable:"\n    To pick up a draggable item, press the space bar.\n    While dragging, use the arrow keys to move the item.\n    Press space again to drop the item in its new position, or press escape to cancel.\n  "},Ns={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function zs(e){let{announcements:t=Ns,container:n,hiddenTextDescribedById:i,screenReaderInstructions:o=Fs}=e;const{announce:r,announcement:s}=function(){const[e,t]=(0,He.useState)("");return{announce:(0,He.useCallback)((e=>{null!=e&&t(e)}),[]),announcement:e}}(),a=vs("DndLiveRegion"),[l,c]=(0,He.useState)(!1);if((0,He.useEffect)((()=>{c(!0)}),[]),function(e){const t=(0,He.useContext)(Ds);(0,He.useEffect)((()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)}),[e,t])}((0,He.useMemo)((()=>({onDragStart(e){let{active:n}=e;r(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:i}=e;t.onDragMove&&r(t.onDragMove({active:n,over:i}))},onDragOver(e){let{active:n,over:i}=e;r(t.onDragOver({active:n,over:i}))},onDragEnd(e){let{active:n,over:i}=e;r(t.onDragEnd({active:n,over:i}))},onDragCancel(e){let{active:n,over:i}=e;r(t.onDragCancel({active:n,over:i}))}})),[r,t])),!l)return null;const u=Ve().createElement(Ve().Fragment,null,Ve().createElement(_s,{id:i,value:o.draggable}),Ve().createElement(As,{id:a,announcement:s}));return n?(0,An.createPortal)(u,n):u}var Bs;function js(){}function Ws(e,t){return(0,He.useMemo)((()=>({sensor:e,options:null!=t?t:{}})),[e,t])}function Hs(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,He.useMemo)((()=>[...t].filter((e=>null!=e))),[...t])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(Bs||(Bs={}));const Vs=Object.freeze({x:0,y:0});function Us(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return n-i}function Gs(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return i-n}function Ks(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const qs=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const o=Ks(t,t.left,t.top),r=[];for(const e of i){const{id:t}=e,i=n.get(t);if(i){const n=(s=Ks(i),a=o,Math.sqrt(Math.pow(s.x-a.x,2)+Math.pow(s.y-a.y,2)));r.push({id:t,data:{droppableContainer:e,value:n}})}}var s,a;return r.sort(Us)};function Ys(e,t){const n=Math.max(t.top,e.top),i=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),r=Math.min(t.top+t.height,e.top+e.height),s=o-i,a=r-n;if(i<o&&n<r){const n=t.width*t.height,i=e.width*e.height,o=s*a;return Number((o/(n+i-o)).toFixed(4))}return 0}const Xs=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const o=[];for(const e of i){const{id:i}=e,r=n.get(i);if(r){const n=Ys(r,t);n>0&&o.push({id:i,data:{droppableContainer:e,value:n}})}}return o.sort(Gs)};function Qs(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Vs}function Js(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return i.reduce(((t,n)=>Is(Is({},t),{},{top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x})),Is({},t))}}const Zs=Js(1);const ea={ignoreTransform:!1};function ta(e,t){void 0===t&&(t=ea);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{getComputedStyle:t}=ss(e),{transform:i,transformOrigin:o}=t(e);i&&(n=function(e,t,n){const i=function(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}(t);if(!i)return e;const{scaleX:o,scaleY:r,x:s,y:a}=i,l=e.left-s-(1-o)*parseFloat(n),c=e.top-a-(1-r)*parseFloat(n.slice(n.indexOf(" ")+1)),u=o?e.width/o:e.width,h=r?e.height/r:e.height;return{width:u,height:h,top:c,right:l+u,bottom:c+h,left:l}}(n,i,o))}const{top:i,left:o,width:r,height:s,bottom:a,right:l}=n;return{top:i,left:o,width:r,height:s,bottom:a,right:l}}function na(e){return ta(e,{ignoreTransform:!0})}function ia(e,t){const n=[];return e?function i(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(as(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!ls(o)||function(e){return e instanceof ss(e).SVGElement}(o))return n;if(n.includes(o))return n;const{getComputedStyle:r}=ss(o),s=r(o);return o!==e&&function(e,t){void 0===t&&(t=ss(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((e=>{const i=t[e];return"string"==typeof i&&n.test(i)}))}(o,s)&&n.push(o),function(e,t){return void 0===t&&(t=ss(e).getComputedStyle(e)),"fixed"===t.position}(o,s)?n:i(o.parentNode)}(e):n}function oa(e){const[t]=ia(e,1);return null!=t?t:null}function ra(e){return is&&e?os(e)?e:rs(e)?as(e)||e===cs(e).scrollingElement?window:ls(e)?e:null:null:null}function sa(e){return os(e)?e.scrollX:e.scrollLeft}function aa(e){return os(e)?e.scrollY:e.scrollTop}function la(e){return{x:sa(e),y:aa(e)}}var ca;function ua(e){return!(!is||!e)&&e===document.scrollingElement}function ha(e){const t={x:0,y:0},n=ua(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},i={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=i.y,isRight:e.scrollLeft>=i.x,maxScroll:i,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(ca||(ca={}));const da={x:.2,y:.2};function pa(e,t,n,i,o){let{top:r,left:s,right:a,bottom:l}=n;void 0===i&&(i=10),void 0===o&&(o=da);const{isTop:c,isBottom:u,isLeft:h,isRight:d}=ha(e),p={x:0,y:0},f={x:0,y:0},g=t.height*o.y,m=t.width*o.x;return!c&&r<=t.top+g?(p.y=ca.Backward,f.y=i*Math.abs((t.top+g-r)/g)):!u&&l>=t.bottom-g&&(p.y=ca.Forward,f.y=i*Math.abs((t.bottom-g-l)/g)),!d&&a>=t.right-m?(p.x=ca.Forward,f.x=i*Math.abs((t.right-m-a)/m)):!h&&s<=t.left+m&&(p.x=ca.Backward,f.x=i*Math.abs((t.left+m-s)/m)),{direction:p,speed:f}}function fa(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:i,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:i,bottom:o,width:e.clientWidth,height:e.clientHeight}}function ga(e){return e.reduce(((e,t)=>ws(e,la(t))),Vs)}const ma=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+sa(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+aa(t)),0)}]];class va{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=ia(t),i=ga(n);this.rect=Is({},e),this.width=e.width,this.height=e.height;for(const[e,t,o]of ma)for(const r of t)Object.defineProperty(this,r,{get:()=>{const t=o(n),s=i[e]-t;return this.rect[r]+s},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ba{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)}))},this.target=e}add(e,t,n){var i;null==(i=this.target)||i.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function wa(e,t){const n=Math.abs(e.x),i=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+i**2)>t:"x"in t&&"y"in t?n>t.x&&i>t.y:"x"in t?n>t.x:"y"in t&&i>t.y}var ya,xa,Ca;function Sa(e){e.preventDefault()}function ka(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(ya||(ya={})),(Ca=xa||(xa={})).Space="Space",Ca.Down="ArrowDown",Ca.Right="ArrowRight",Ca.Left="ArrowLeft",Ca.Up="ArrowUp",Ca.Esc="Escape",Ca.Enter="Enter";const $a={start:[xa.Space,xa.Enter],cancel:[xa.Esc],end:[xa.Space,xa.Enter]},Ea=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case xa.Right:return Is(Is({},n),{},{x:n.x+25});case xa.Left:return Is(Is({},n),{},{x:n.x-25});case xa.Down:return Is(Is({},n),{},{y:n.y+25});case xa.Up:return Is(Is({},n),{},{y:n.y-25})}};class _a{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new ba(cs(t)),this.windowListeners=new ba(ss(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ya.Resize,this.handleCancel),this.windowListeners.add(ya.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(ya.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=ta),!e)return;const{top:n,left:i,bottom:o,right:r}=t(e);oa(e)&&(o<=0||r<=0||n>=window.innerHeight||i>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(Vs)}handleKeyDown(e){if(xs(e)){const{active:t,context:n,options:i}=this.props,{keyboardCodes:o=$a,coordinateGetter:r=Ea,scrollBehavior:s="smooth"}=i,{code:a}=e;if(o.end.includes(a))return void this.handleEnd(e);if(o.cancel.includes(a))return void this.handleCancel(e);const{collisionRect:l}=n.current,c=l?{x:l.left,y:l.top}:Vs;this.referenceCoordinates||(this.referenceCoordinates=c);const u=r(e,{active:t,context:n.current,currentCoordinates:c});if(u){const t=ys(u,c),i={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:r,isRight:a,isLeft:l,isBottom:c,maxScroll:h,minScroll:d}=ha(n),p=fa(n),f={x:Math.min(o===xa.Right?p.right-p.width/2:p.right,Math.max(o===xa.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(o===xa.Down?p.bottom-p.height/2:p.bottom,Math.max(o===xa.Down?p.top:p.top+p.height/2,u.y))},g=o===xa.Right&&!a||o===xa.Left&&!l,m=o===xa.Down&&!c||o===xa.Up&&!r;if(g&&f.x!==u.x){const e=n.scrollLeft+t.x,r=o===xa.Right&&e<=h.x||o===xa.Left&&e>=d.x;if(r&&!t.y)return void n.scrollTo({left:e,behavior:s});i.x=r?n.scrollLeft-e:o===xa.Right?n.scrollLeft-h.x:n.scrollLeft-d.x,i.x&&n.scrollBy({left:-i.x,behavior:s});break}if(m&&f.y!==u.y){const e=n.scrollTop+t.y,r=o===xa.Down&&e<=h.y||o===xa.Up&&e>=d.y;if(r&&!t.x)return void n.scrollTo({top:e,behavior:s});i.y=r?n.scrollTop-e:o===xa.Down?n.scrollTop-h.y:n.scrollTop-d.y,i.y&&n.scrollBy({top:-i.y,behavior:s});break}}this.handleMove(e,ws(ys(u,this.referenceCoordinates),i))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function La(e){return Boolean(e&&"distance"in e)}function Aa(e){return Boolean(e&&"delay"in e)}_a.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:i=$a,onActivation:o}=t,{active:r}=n;const{code:s}=e.nativeEvent;if(i.start.includes(s)){const t=r.activatorNode.current;return!(t&&e.target!==t||(e.preventDefault(),null==o||o({event:e.nativeEvent}),0))}return!1}}];class Ra{constructor(e,t,n){var i;void 0===n&&(n=function(e){const{EventTarget:t}=ss(e);return e instanceof t?e:cs(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:o}=e,{target:r}=o;this.props=e,this.events=t,this.document=cs(r),this.documentListeners=new ba(this.document),this.listeners=new ba(n),this.windowListeners=new ba(ss(r)),this.initialCoordinates=null!=(i=Cs(o))?i:Vs,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),this.windowListeners.add(ya.Resize,this.handleCancel),this.windowListeners.add(ya.DragStart,Sa),this.windowListeners.add(ya.VisibilityChange,this.handleCancel),this.windowListeners.add(ya.ContextMenu,Sa),this.documentListeners.add(ya.Keydown,this.handleKeydown),t){if(La(t))return;if(Aa(t))return void(this.timeoutId=setTimeout(this.handleStart,t.delay))}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(ya.Click,ka,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ya.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:i,props:o}=this,{onMove:r,options:{activationConstraint:s}}=o;if(!i)return;const a=null!=(t=Cs(e))?t:Vs,l=ys(i,a);if(!n&&s){if(Aa(s))return wa(l,s.tolerance)?this.handleCancel():void 0;if(La(s))return null!=s.tolerance&&wa(l,s.tolerance)?this.handleCancel():wa(l,s.distance)?this.handleStart():void 0}e.cancelable&&e.preventDefault(),r(a)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===xa.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Ma={move:{name:"pointermove"},end:{name:"pointerup"}};class Oa extends Ra{constructor(e){const{event:t}=e,n=cs(t.target);super(e,Ma,n)}}Oa.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return!(!n.isPrimary||0!==n.button||(null==i||i({event:n}),0))}}];const Ta={move:{name:"mousemove"},end:{name:"mouseup"}};var Ia;!function(e){e[e.RightClick=2]="RightClick"}(Ia||(Ia={})),class extends Ra{constructor(e){super(e,Ta,cs(e.event.target))}}.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return n.button!==Ia.RightClick&&(null==i||i({event:n}),!0)}}];const Pa={move:{name:"touchmove"},end:{name:"touchend"}};var Da,Fa;(class extends Ra{constructor(e){super(e,Pa)}static setup(){return window.addEventListener(Pa.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Pa.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;const{touches:o}=n;return!(o.length>1||(null==i||i({event:n}),0))}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(Da||(Da={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Fa||(Fa={}));const Na={x:{[ca.Backward]:!1,[ca.Forward]:!1},y:{[ca.Backward]:!1,[ca.Forward]:!1}};var za,Ba;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(za||(za={})),function(e){e.Optimized="optimized"}(Ba||(Ba={}));const ja=new Map;function Wa(e,t){return ps((n=>e?n||("function"==typeof t?t(e):e):null),[t,e])}function Ha(e){let{callback:t,disabled:n}=e;const i=hs(t),o=(0,He.useMemo)((()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(i)}),[n]);return(0,He.useEffect)((()=>()=>null==o?void 0:o.disconnect()),[o]),o}function Va(e){return new va(ta(e),e)}function Ua(e,t,n){void 0===t&&(t=Va);const[i,o]=(0,He.useReducer)((function(i){if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=i?i:n)?o:null;const r=t(e);return JSON.stringify(i)===JSON.stringify(r)?i:r}),null),r=function(e){let{callback:t,disabled:n}=e;const i=hs(t),o=(0,He.useMemo)((()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(i)}),[i,n]);return(0,He.useEffect)((()=>()=>null==o?void 0:o.disconnect()),[o]),o}({callback(t){if(e)for(const n of t){const{type:t,target:i}=n;if("childList"===t&&i instanceof HTMLElement&&i.contains(e)){o();break}}}}),s=Ha({callback:o});return us((()=>{o(),e?(null==s||s.observe(e),null==r||r.observe(document.body,{childList:!0,subtree:!0})):(null==s||s.disconnect(),null==r||r.disconnect())}),[e]),i}const Ga=[];function Ka(e,t){void 0===t&&(t=[]);const n=(0,He.useRef)(null);return(0,He.useEffect)((()=>{n.current=null}),t),(0,He.useEffect)((()=>{const t=e!==Vs;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)}),[e]),n.current?ys(e,n.current):Vs}function qa(e){return(0,He.useMemo)((()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null),[e])}const Ya=[];const Xa=[{sensor:Oa,options:{}},{sensor:_a,options:{}}],Qa={current:{}},Ja={draggable:{measure:na},droppable:{measure:na,strategy:za.WhileDragging,frequency:Ba.Optimized},dragOverlay:{measure:ta}};class Za extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter((e=>{let{disabled:t}=e;return!t}))}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const el={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Za,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:js},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ja,measureDroppableContainers:js,windowRect:null,measuringScheduled:!1},tl={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:js,draggableNodes:new Map,over:null,measureDroppableContainers:js},nl=(0,He.createContext)(tl),il=(0,He.createContext)(el);function ol(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Za}}}function rl(e,t){switch(t.type){case Bs.DragStart:return Is(Is({},e),{},{draggable:Is(Is({},e.draggable),{},{initialCoordinates:t.initialCoordinates,active:t.active})});case Bs.DragMove:return e.draggable.active?Is(Is({},e),{},{draggable:Is(Is({},e.draggable),{},{translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}})}):e;case Bs.DragEnd:case Bs.DragCancel:return Is(Is({},e),{},{draggable:Is(Is({},e.draggable),{},{active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}})});case Bs.RegisterDroppable:{const{element:n}=t,{id:i}=n,o=new Za(e.droppable.containers);return o.set(i,n),Is(Is({},e),{},{droppable:Is(Is({},e.droppable),{},{containers:o})})}case Bs.SetDroppableDisabled:{const{id:n,key:i,disabled:o}=t,r=e.droppable.containers.get(n);if(!r||i!==r.key)return e;const s=new Za(e.droppable.containers);return s.set(n,Is(Is({},r),{},{disabled:o})),Is(Is({},e),{},{droppable:Is(Is({},e.droppable),{},{containers:s})})}case Bs.UnregisterDroppable:{const{id:n,key:i}=t,o=e.droppable.containers.get(n);if(!o||i!==o.key)return e;const r=new Za(e.droppable.containers);return r.delete(n),Is(Is({},e),{},{droppable:Is(Is({},e.droppable),{},{containers:r})})}default:return e}}function sl(e){let{disabled:t}=e;const{active:n,activatorEvent:i,draggableNodes:o}=(0,He.useContext)(nl),r=gs(i),s=gs(null==n?void 0:n.id);return(0,He.useEffect)((()=>{if(!t&&!i&&r&&null!=s){if(!xs(r))return;if(document.activeElement===r.target)return;const e=o.get(s);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame((()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=$s(e);if(t){t.focus();break}}}))}}),[i,t,o,s,r]),null}const al=(0,He.createContext)(Is(Is({},Vs),{},{scaleX:1,scaleY:1}));var ll;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(ll||(ll={}));const cl=(0,He.memo)((function(e){var t,n,i,o;let{id:r,accessibility:s,autoScroll:a=!0,children:l,sensors:c=Xa,collisionDetection:u=Xs,measuring:h,modifiers:d}=e,p=Os(e,Ms);const f=(0,He.useReducer)(rl,void 0,ol),[g,m]=f,[v,b]=function(){const[e]=(0,He.useState)((()=>new Set)),t=(0,He.useCallback)((t=>(e.add(t),()=>e.delete(t))),[e]),n=(0,He.useCallback)((t=>{let{type:n,event:i}=t;e.forEach((e=>{var t;return null==(t=e[n])?void 0:t.call(e,i)}))}),[e]);return[n,t]}(),[w,y]=(0,He.useState)(ll.Uninitialized),x=w===ll.Initialized,{draggable:{active:C,nodes:S,translate:k},droppable:{containers:$}}=g,E=C?S.get(C):null,_=(0,He.useRef)({initial:null,translated:null}),L=(0,He.useMemo)((()=>{var e;return null!=C?{id:C,data:null!=(e=null==E?void 0:E.data)?e:Qa,rect:_}:null}),[C,E]),A=(0,He.useRef)(null),[R,M]=(0,He.useState)(null),[O,T]=(0,He.useState)(null),I=ds(p,Object.values(p)),P=vs("DndDescribedBy",r),D=(0,He.useMemo)((()=>$.getEnabled()),[$]),F=function(e){return(0,He.useMemo)((()=>({draggable:Is(Is({},Ja.draggable),null==e?void 0:e.draggable),droppable:Is(Is({},Ja.droppable),null==e?void 0:e.droppable),dragOverlay:Is(Is({},Ja.dragOverlay),null==e?void 0:e.dragOverlay)})),[null==e?void 0:e.draggable,null==e?void 0:e.droppable,null==e?void 0:e.dragOverlay])}(h),{droppableRects:N,measureDroppableContainers:z,measuringScheduled:B}=function(e,t){let{dragging:n,dependencies:i,config:o}=t;const[r,s]=(0,He.useState)(null),a=null!=r,{frequency:l,measure:c,strategy:u}=o,h=(0,He.useRef)(e),d=function(){switch(u){case za.Always:return!1;case za.BeforeDragging:return n;default:return!n}}(),p=ds(d),f=(0,He.useCallback)((function(e){void 0===e&&(e=[]),p.current||s((t=>t?t.concat(e):e))}),[p]),g=(0,He.useRef)(null),m=ps((t=>{if(d&&!n)return ja;const i=r;if(!t||t===ja||h.current!==e||null!=i){const t=new Map;for(let n of e){if(!n)continue;if(i&&i.length>0&&!i.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,o=e?new va(c(e),e):null;n.rect.current=o,o&&t.set(n.id,o)}return t}return t}),[e,r,n,d,c]);return(0,He.useEffect)((()=>{h.current=e}),[e]),(0,He.useEffect)((()=>{d||requestAnimationFrame((()=>f()))}),[n,d]),(0,He.useEffect)((()=>{a&&s(null)}),[a]),(0,He.useEffect)((()=>{d||"number"!=typeof l||null!==g.current||(g.current=setTimeout((()=>{f(),g.current=null}),l))}),[l,d,f,...i]),{droppableRects:m,measureDroppableContainers:f,measuringScheduled:a}}(D,{dragging:x,dependencies:[k.x,k.y],config:F.droppable}),j=function(e,t){const n=null!==t?e.get(t):void 0,i=n?n.node.current:null;return ps((e=>{var n;return null===t?null:null!=(n=null!=i?i:e)?n:null}),[i,t])}(S,C),W=(0,He.useMemo)((()=>O?Cs(O):null),[O]),H=function(){const e=!1===(null==R?void 0:R.autoScrollEnabled),t="object"==typeof a?!1===a.enabled:!1===a,n=x&&!e&&!t;return"object"==typeof a?Is(Is({},a),{},{enabled:n}):{enabled:n}}(),V=function(e,t){return Wa(e,t)}(j,F.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:i,config:o=!0}=e;const r=(0,He.useRef)(!1),{x:s,y:a}="boolean"==typeof o?{x:o,y:o}:o;us((()=>{if(!s&&!a||!t)return void(r.current=!1);if(r.current||!i)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const o=Qs(n(e),i);if(s||(o.x=0),a||(o.y=0),r.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const t=oa(e);t&&t.scrollBy({top:o.y,left:o.x})}}),[t,s,a,i,n])}({activeNode:C?S.get(C):null,config:H.layoutShiftCompensation,initialRect:V,measure:F.draggable.measure});const U=Ua(j,F.draggable.measure,V),G=Ua(j?j.parentElement:null),K=(0,He.useRef)({activatorEvent:null,active:null,activeNode:j,collisionRect:null,collisions:null,droppableRects:N,draggableNodes:S,draggingNode:null,draggingNodeRect:null,droppableContainers:$,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),q=$.getNodeFor(null==(t=K.current.over)?void 0:t.id),Y=function(e){let{measure:t}=e;const[n,i]=(0,He.useState)(null),o=(0,He.useCallback)((e=>{for(const{target:n}of e)if(ls(n)){i((e=>{const i=t(n);return e?Is(Is({},e),{},{width:i.width,height:i.height}):i}));break}}),[t]),r=Ha({callback:o}),s=(0,He.useCallback)((e=>{const n=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ls(t)?t:e}(e);null==r||r.disconnect(),n&&(null==r||r.observe(n)),i(n?t(n):null)}),[t,r]),[a,l]=fs(s);return(0,He.useMemo)((()=>({nodeRef:a,rect:n,setRef:l})),[n,a,l])}({measure:F.dragOverlay.measure}),X=null!=(n=Y.nodeRef.current)?n:j,Q=x?null!=(i=Y.rect)?i:U:null,J=Boolean(Y.nodeRef.current&&Y.rect),Z=Qs(ee=J?null:U,Wa(ee));var ee;const te=qa(X?ss(X):null),ne=function(e){const t=(0,He.useRef)(e),n=ps((n=>e?n&&n!==Ga&&e&&t.current&&e.parentNode===t.current.parentNode?n:ia(e):Ga),[e]);return(0,He.useEffect)((()=>{t.current=e}),[e]),n}(x?null!=q?q:j:null),ie=function(e,t){void 0===t&&(t=ta);const[n]=e,i=qa(n?ss(n):null),[o,r]=(0,He.useReducer)((function(){return e.length?e.map((e=>ua(e)?i:new va(t(e),e))):Ya}),Ya),s=Ha({callback:r});return e.length>0&&o===Ya&&r(),us((()=>{e.length?e.forEach((e=>null==s?void 0:s.observe(e))):(null==s||s.disconnect(),r())}),[e]),o}(ne),oe=function(e,t){let{transform:n}=t,i=Os(t,Rs);return null!=e&&e.length?e.reduce(((e,t)=>t(Is({transform:e},i))),n):n}(d,{transform:{x:k.x-Z.x,y:k.y-Z.y,scaleX:1,scaleY:1},activatorEvent:O,active:L,activeNodeRect:U,containerNodeRect:G,draggingNodeRect:Q,over:K.current.over,overlayNodeRect:Y.rect,scrollableAncestors:ne,scrollableAncestorRects:ie,windowRect:te}),re=W?ws(W,k):null,se=function(e){const[t,n]=(0,He.useState)(null),i=(0,He.useRef)(e),o=(0,He.useCallback)((e=>{const t=ra(e.target);t&&n((e=>e?(e.set(t,la(t)),new Map(e)):null))}),[]);return(0,He.useEffect)((()=>{const t=i.current;if(e!==t){r(t);const s=e.map((e=>{const t=ra(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,la(t)]):null})).filter((e=>null!=e));n(s.length?new Map(s):null),i.current=e}return()=>{r(e),r(t)};function r(e){e.forEach((e=>{const t=ra(e);null==t||t.removeEventListener("scroll",o)}))}}),[o,e]),(0,He.useMemo)((()=>e.length?t?Array.from(t.values()).reduce(((e,t)=>ws(e,t)),Vs):ga(e):Vs),[e,t])}(ne),ae=Ka(se),le=Ka(se,[U]),ce=ws(oe,ae),ue=Q?Zs(Q,oe):null,he=L&&ue?u({active:L,collisionRect:ue,droppableRects:N,droppableContainers:D,pointerCoordinates:re}):null,de=function(e,t){if(!e||0===e.length)return null;const[n]=e;return n.id}(he),[pe,fe]=(0,He.useState)(null),ge=function(e,t,n){return Is(Is({},e),{},{scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1})}(J?oe:ws(oe,le),null!=(o=null==pe?void 0:pe.rect)?o:null,U),me=(0,He.useCallback)(((e,t)=>{let{sensor:n,options:i}=t;if(null==A.current)return;const o=S.get(A.current);if(!o)return;const r=e.nativeEvent,s=new n({active:A.current,activeNode:o,event:r,options:i,context:K,onStart(e){const t=A.current;if(null==t)return;const n=S.get(t);if(!n)return;const{onDragStart:i}=I.current,o={active:{id:t,data:n.data,rect:_}};(0,An.unstable_batchedUpdates)((()=>{null==i||i(o),y(ll.Initializing),m({type:Bs.DragStart,initialCoordinates:e,active:t}),v({type:"onDragStart",event:o})}))},onMove(e){m({type:Bs.DragMove,coordinates:e})},onEnd:a(Bs.DragEnd),onCancel:a(Bs.DragCancel)});function a(e){return async function(){const{active:t,collisions:n,over:i,scrollAdjustedTranslate:o}=K.current;let s=null;if(t&&o){const{cancelDrop:a}=I.current;s={activatorEvent:r,active:t,collisions:n,delta:o,over:i},e===Bs.DragEnd&&"function"==typeof a&&await Promise.resolve(a(s))&&(e=Bs.DragCancel)}A.current=null,(0,An.unstable_batchedUpdates)((()=>{m({type:e}),y(ll.Uninitialized),fe(null),M(null),T(null);const t=e===Bs.DragEnd?"onDragEnd":"onDragCancel";if(s){const e=I.current[t];null==e||e(s),v({type:t,event:s})}}))}}(0,An.unstable_batchedUpdates)((()=>{M(s),T(e.nativeEvent)}))}),[S]),ve=(0,He.useCallback)(((e,t)=>(n,i)=>{const o=n.nativeEvent,r=S.get(i);if(null!==A.current||!r||o.dndKit||o.defaultPrevented)return;const s={active:r};!0===e(n,t.options,s)&&(o.dndKit={capturedBy:t.sensor},A.current=i,me(n,t))}),[S,me]),be=function(e,t){return(0,He.useMemo)((()=>e.reduce(((e,n)=>{const{sensor:i}=n;return[...e,...i.activators.map((e=>({eventName:e.eventName,handler:t(e.handler,n)})))]}),[])),[e,t])}(c,ve);!function(e){(0,He.useEffect)((()=>{if(!is)return;const t=e.map((e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()}));return()=>{for(const e of t)null==e||e()}}),e.map((e=>{let{sensor:t}=e;return t})))}(c),us((()=>{U&&w===ll.Initializing&&y(ll.Initialized)}),[U,w]),(0,He.useEffect)((()=>{const{onDragMove:e}=I.current,{active:t,activatorEvent:n,collisions:i,over:o}=K.current;if(!t||!n)return;const r={active:t,activatorEvent:n,collisions:i,delta:{x:ce.x,y:ce.y},over:o};(0,An.unstable_batchedUpdates)((()=>{null==e||e(r),v({type:"onDragMove",event:r})}))}),[ce.x,ce.y]),(0,He.useEffect)((()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:i,scrollAdjustedTranslate:o}=K.current;if(!e||null==A.current||!t||!o)return;const{onDragOver:r}=I.current,s=i.get(de),a=s&&s.rect.current?{id:s.id,rect:s.rect.current,data:s.data,disabled:s.disabled}:null,l={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:a};(0,An.unstable_batchedUpdates)((()=>{fe(a),null==r||r(l),v({type:"onDragOver",event:l})}))}),[de]),us((()=>{K.current={activatorEvent:O,active:L,activeNode:j,collisionRect:ue,collisions:he,droppableRects:N,draggableNodes:S,draggingNode:X,draggingNodeRect:Q,droppableContainers:$,over:pe,scrollableAncestors:ne,scrollAdjustedTranslate:ce},_.current={initial:Q,translated:ue}}),[L,j,he,ue,S,X,Q,N,$,pe,ne,ce]),function(e){let{acceleration:t,activator:n=Da.Pointer,canScroll:i,draggingRect:o,enabled:r,interval:s=5,order:a=Fa.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:u,delta:h,threshold:d}=e;const p=function(e){let{delta:t,disabled:n}=e;const i=gs(t);return ps((e=>{if(n||!i||!e)return Na;const o=Math.sign(t.x-i.x),r=Math.sign(t.y-i.y);return{x:{[ca.Backward]:e.x[ca.Backward]||-1===o,[ca.Forward]:e.x[ca.Forward]||1===o},y:{[ca.Backward]:e.y[ca.Backward]||-1===r,[ca.Forward]:e.y[ca.Forward]||1===r}}}),[n,t,i])}({delta:h,disabled:!r}),[f,g]=function(){const e=(0,He.useRef)(null);return[(0,He.useCallback)(((t,n)=>{e.current=setInterval(t,n)}),[]),(0,He.useCallback)((()=>{null!==e.current&&(clearInterval(e.current),e.current=null)}),[])]}(),m=(0,He.useRef)({x:0,y:0}),v=(0,He.useRef)({x:0,y:0}),b=(0,He.useMemo)((()=>{switch(n){case Da.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Da.DraggableRect:return o}}),[n,o,l]),w=(0,He.useRef)(null),y=(0,He.useCallback)((()=>{const e=w.current;if(!e)return;const t=m.current.x*v.current.x,n=m.current.y*v.current.y;e.scrollBy(t,n)}),[]),x=(0,He.useMemo)((()=>a===Fa.TreeOrder?[...c].reverse():c),[a,c]);(0,He.useEffect)((()=>{if(r&&c.length&&b){for(const e of x){if(!1===(null==i?void 0:i(e)))continue;const n=c.indexOf(e),o=u[n];if(!o)continue;const{direction:r,speed:a}=pa(e,o,b,t,d);for(const e of["x","y"])p[e][r[e]]||(a[e]=0,r[e]=0);if(a.x>0||a.y>0)return g(),w.current=e,f(y,s),m.current=a,void(v.current=r)}m.current={x:0,y:0},v.current={x:0,y:0},g()}else g()}),[t,y,i,g,r,s,JSON.stringify(b),JSON.stringify(p),f,c,x,u,JSON.stringify(d)])}(Is(Is({},H),{},{delta:k,draggingRect:ue,pointerCoordinates:re,scrollableAncestors:ne,scrollableAncestorRects:ie}));const we=(0,He.useMemo)((()=>({active:L,activeNode:j,activeNodeRect:U,activatorEvent:O,collisions:he,containerNodeRect:G,dragOverlay:Y,draggableNodes:S,droppableContainers:$,droppableRects:N,over:pe,measureDroppableContainers:z,scrollableAncestors:ne,scrollableAncestorRects:ie,measuringConfiguration:F,measuringScheduled:B,windowRect:te})),[L,j,U,O,he,G,Y,S,$,N,pe,z,ne,ie,F,B,te]),ye=(0,He.useMemo)((()=>({activatorEvent:O,activators:be,active:L,activeNodeRect:U,ariaDescribedById:{draggable:P},dispatch:m,draggableNodes:S,over:pe,measureDroppableContainers:z})),[O,be,L,U,m,P,S,pe,z]);return Ve().createElement(Ds.Provider,{value:b},Ve().createElement(nl.Provider,{value:ye},Ve().createElement(il.Provider,{value:we},Ve().createElement(al.Provider,{value:ge},l)),Ve().createElement(sl,{disabled:!1===(null==s?void 0:s.restoreFocus)})),Ve().createElement(zs,Is(Is({},s),{},{hiddenTextDescribedById:P})))})),ul=(0,He.createContext)(null),hl="button";const dl={timeout:25};function pl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function fl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pl(Object(n),!0).forEach((function(t){gl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function gl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ml(e,t,n){const i=e.slice();return i.splice(n<0?i.length+n:n,0,i.splice(t,1)[0]),i}function vl(e,t){return e.reduce(((e,n,i)=>{const o=t.get(n);return o&&(e[i]=o),e}),Array(e.length))}function bl(e){return null!==e&&e>=0}const wl=e=>{let{rects:t,activeIndex:n,overIndex:i,index:o}=e;const r=ml(t,i,n),s=t[o],a=r[o];return a&&s?{x:a.left-s.left,y:a.top-s.top,scaleX:a.width/s.width,scaleY:a.height/s.height}:null},yl={scaleX:1,scaleY:1},xl=e=>{var t;let{activeIndex:n,activeNodeRect:i,index:o,rects:r,overIndex:s}=e;const a=null!=(t=r[n])?t:i;if(!a)return null;if(o===n){const e=r[s];return e?fl({x:0,y:n<s?e.top+e.height-(a.top+a.height):e.top-a.top},yl):null}const l=function(e,t,n){const i=e[t],o=e[t-1],r=e[t+1];return i?n<t?o?i.top-(o.top+o.height):r?r.top-(i.top+i.height):0:r?r.top-(i.top+i.height):o?i.top-(o.top+o.height):0:0}(r,o,n);return fl(o>n&&o<=s?{x:0,y:-a.height-l}:o<n&&o>=s?{x:0,y:a.height+l}:{x:0,y:0},yl)},Cl="Sortable",Sl=Ve().createContext({activeIndex:-1,containerId:Cl,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:wl,disabled:{draggable:!1,droppable:!1}});function kl(e){let{children:t,id:n,items:i,strategy:o=wl,disabled:r=!1}=e;const{active:s,dragOverlay:a,droppableRects:l,over:c,measureDroppableContainers:u,measuringScheduled:h}=(0,He.useContext)(il),d=vs(Cl,n),p=Boolean(null!==a.rect),f=(0,He.useMemo)((()=>i.map((e=>"object"==typeof e&&"id"in e?e.id:e))),[i]),g=null!=s,m=s?f.indexOf(s.id):-1,v=c?f.indexOf(c.id):-1,b=(0,He.useRef)(f),w=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(f,b.current),y=-1!==v&&-1===m||w,x=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(r);us((()=>{w&&g&&!h&&u(f)}),[w,f,g,u,h]),(0,He.useEffect)((()=>{b.current=f}),[f]);const C=(0,He.useMemo)((()=>({activeIndex:m,containerId:d,disabled:x,disableTransforms:y,items:f,overIndex:v,useDragOverlay:p,sortedRects:vl(f,l),strategy:o})),[m,d,x.draggable,x.droppable,y,f,v,l,p,o]);return Ve().createElement(Sl.Provider,{value:C},t)}const $l=e=>{let{id:t,items:n,activeIndex:i,overIndex:o}=e;return ml(n,i,o).indexOf(t)},El=e=>{let{containerId:t,isSorting:n,wasDragging:i,index:o,items:r,newIndex:s,previousItems:a,previousContainerId:l,transition:c}=e;return!(!c||!i||a!==r&&o===s||!n&&(s===o||t!==l))},_l={duration:200,easing:"ease"},Ll="transform",Al=Ss.Transition.toString({property:Ll,duration:0,easing:"linear"}),Rl={roleDescription:"sortable"};function Ml(e){let{animateLayoutChanges:t=El,attributes:n,disabled:i,data:o,getNewIndex:r=$l,id:s,strategy:a,resizeObserverConfig:l,transition:c=_l}=e;const{items:u,containerId:h,activeIndex:d,disabled:p,disableTransforms:f,sortedRects:g,overIndex:m,useDragOverlay:v,strategy:b}=(0,He.useContext)(Sl),w=function(e,t){var n,i;return"boolean"==typeof e?{draggable:e,droppable:!1}:{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(i=null==e?void 0:e.droppable)?i:t.droppable}}(i,p),y=u.indexOf(s),x=(0,He.useMemo)((()=>fl({sortable:{containerId:h,index:y,items:u}},o)),[h,o,y,u]),C=(0,He.useMemo)((()=>u.slice(u.indexOf(s))),[u,s]),{rect:S,node:k,isOver:$,setNodeRef:E}=function(e){let{data:t,disabled:n=!1,id:i,resizeObserverConfig:o}=e;const r=vs("Droppable"),{active:s,dispatch:a,over:l,measureDroppableContainers:c}=(0,He.useContext)(nl),u=(0,He.useRef)({disabled:n}),h=(0,He.useRef)(!1),d=(0,He.useRef)(null),p=(0,He.useRef)(null),{disabled:f,updateMeasurementsFor:g,timeout:m}=Is(Is({},dl),o),v=ds(null!=g?g:i),b=Ha({callback:(0,He.useCallback)((()=>{h.current?(null!=p.current&&clearTimeout(p.current),p.current=setTimeout((()=>{c(Array.isArray(v.current)?v.current:[v.current]),p.current=null}),m)):h.current=!0}),[m]),disabled:f||!s}),w=(0,He.useCallback)(((e,t)=>{b&&(t&&(b.unobserve(t),h.current=!1),e&&b.observe(e))}),[b]),[y,x]=fs(w),C=ds(t);return(0,He.useEffect)((()=>{b&&y.current&&(b.disconnect(),h.current=!1,b.observe(y.current))}),[y,b]),us((()=>(a({type:Bs.RegisterDroppable,element:{id:i,key:r,disabled:n,node:y,rect:d,data:C}}),()=>a({type:Bs.UnregisterDroppable,key:r,id:i}))),[i]),(0,He.useEffect)((()=>{n!==u.current.disabled&&(a({type:Bs.SetDroppableDisabled,id:i,key:r,disabled:n}),u.current.disabled=n)}),[i,r,n,a]),{active:s,rect:d,isOver:(null==l?void 0:l.id)===i,node:y,over:l,setNodeRef:x}}({id:s,data:x,disabled:w.droppable,resizeObserverConfig:fl({updateMeasurementsFor:C},l)}),{active:_,activatorEvent:L,activeNodeRect:A,attributes:R,setNodeRef:M,listeners:O,isDragging:T,over:I,setActivatorNodeRef:P,transform:D}=function(e){let{id:t,data:n,disabled:i=!1,attributes:o}=e;const r=vs("Droppable"),{activators:s,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:h,over:d}=(0,He.useContext)(nl),{role:p=hl,roleDescription:f="draggable",tabIndex:g=0}=null!=o?o:{},m=(null==l?void 0:l.id)===t,v=(0,He.useContext)(m?al:ul),[b,w]=fs(),[y,x]=fs(),C=function(e,t){return(0,He.useMemo)((()=>e.reduce(((e,n)=>{let{eventName:i,handler:o}=n;return e[i]=e=>{o(e,t)},e}),{})),[e,t])}(s,t),S=ds(n);return us((()=>(h.set(t,{id:t,key:r,node:b,activatorNode:y,data:S}),()=>{const e=h.get(t);e&&e.key===r&&h.delete(t)})),[h,t]),{active:l,activatorEvent:a,activeNodeRect:c,attributes:(0,He.useMemo)((()=>({role:p,tabIndex:g,"aria-disabled":i,"aria-pressed":!(!m||p!==hl)||void 0,"aria-roledescription":f,"aria-describedby":u.draggable})),[i,p,g,m,f,u.draggable]),isDragging:m,listeners:i?void 0:C,node:b,over:d,setNodeRef:w,setActivatorNodeRef:x,transform:v}}({id:s,data:x,attributes:fl(fl({},Rl),n),disabled:w.draggable}),F=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,He.useMemo)((()=>e=>{t.forEach((t=>t(e)))}),t)}(E,M),N=Boolean(_),z=N&&!f&&bl(d)&&bl(m),B=!v&&T,j=B&&z?D:null,W=z?null!=j?j:(null!=a?a:b)({rects:g,activeNodeRect:A,activeIndex:d,overIndex:m,index:y}):null,H=bl(d)&&bl(m)?r({id:s,items:u,activeIndex:d,overIndex:m}):y,V=null==_?void 0:_.id,U=(0,He.useRef)({activeId:V,items:u,newIndex:H,containerId:h}),G=u!==U.current.items,K=t({active:_,containerId:h,isDragging:T,isSorting:N,id:s,index:y,items:u,newIndex:U.current.newIndex,previousItems:U.current.items,previousContainerId:U.current.containerId,transition:c,wasDragging:null!=U.current.activeId}),q=function(e){let{disabled:t,index:n,node:i,rect:o}=e;const[r,s]=(0,He.useState)(null),a=(0,He.useRef)(n);return us((()=>{if(!t&&n!==a.current&&i.current){const e=o.current;if(e){const t=ta(i.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&s(n)}}n!==a.current&&(a.current=n)}),[t,n,i,o]),(0,He.useEffect)((()=>{r&&requestAnimationFrame((()=>{s(null)}))}),[r]),r}({disabled:!K,index:y,node:k,rect:S});return(0,He.useEffect)((()=>{N&&U.current.newIndex!==H&&(U.current.newIndex=H),h!==U.current.containerId&&(U.current.containerId=h),u!==U.current.items&&(U.current.items=u)}),[N,H,h,u]),(0,He.useEffect)((()=>{if(V===U.current.activeId)return;if(V&&!U.current.activeId)return void(U.current.activeId=V);const e=setTimeout((()=>{U.current.activeId=V}),50);return()=>clearTimeout(e)}),[V]),{active:_,activeIndex:d,attributes:R,data:x,rect:S,index:y,newIndex:H,items:u,isOver:$,isSorting:N,isDragging:T,listeners:O,node:k,overIndex:m,over:I,setNodeRef:F,setActivatorNodeRef:P,setDroppableNodeRef:E,setDraggableNodeRef:M,transform:null!=q?q:W,transition:q||G&&U.current.newIndex===y?Al:B&&!xs(L)||!c?void 0:N||K?Ss.Transition.toString(fl(fl({},c),{},{property:Ll})):void 0}}function Ol(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Tl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ol(Object(n),!0).forEach((function(t){Il(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ol(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Il(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pl(){return Pl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Pl.apply(this,arguments)}xa.Down,xa.Right,xa.Up,xa.Left,n(4508),n(3180);const{__:Dl,_n:Fl,sprintf:Nl}=wp.i18n,{applyFilters:zl}=wp.hooks,{useSelect:Bl}=wp.data,{useState:jl}=wp.element,{TextControl:Wl,Button:Hl,Modal:Vl,FocalPointPicker:Ul}=wp.components,{MediaUpload:Gl,MediaUploadCheck:Kl}=wp.blockEditor,{VPGutenbergVariables:ql}=window,Yl=["image"];function Xl(e){const t={id:e.id,imgUrl:e.url,imgThumbnailUrl:e.url};return e.mime&&"image/gif"===e.mime||(e.sizes&&e.sizes.large&&e.sizes.large.url?t.imgThumbnailUrl=e.sizes.large.url:e.sizes&&e.sizes.medium&&e.sizes.medium.url?t.imgThumbnailUrl=e.sizes.medium.url:e.sizes&&e.sizes.thumbnail&&e.sizes.thumbnail.url&&(t.imgThumbnailUrl=e.sizes.thumbnail.url)),e.title&&(t.title=e.title),e.description&&(t.description=e.description),t}function Ql(e,t){const n=[],i=t&&Object.keys(t).length?t.map((e=>e.id)):[];return e&&e.length&&e.forEach((e=>{let o=!1;if(i.length){const n=i.indexOf(e.id);-1<n&&t[n]&&(o=t[n])}const r=o||Xl(e);n.push(r)})),n}const Jl=function(e){var t,n,i,o;const{showFocalPoint:r,focalPoint:s,imgId:a,imgUrl:l,onChangeFocalPoint:c,onChangeImage:u}=e,[h,d]=jl(!1),[p,f]=jl(!1),{imageData:g}=Bl((e=>{const{getMedia:t}=e("core");if(!a)return{};const n=t(a);return n?{imageData:n}:{}}),[h,a]);return wp.element.createElement(Kl,null,wp.element.createElement("div",{className:"vpf-component-gallery-control-item-modal-image-info editor-post-featured-image ".concat(h?"vpf-component-gallery-control-item-modal-image-info-sticky-bottom":"")},r?wp.element.createElement(Ul,{url:(null==g?void 0:g.source_url)||l,value:s,dimensions:{width:(null==g||null===(t=g.media_details)||void 0===t?void 0:t.width)||80,height:(null==g||null===(n=g.media_details)||void 0===n?void 0:n.height)||80},onChange:e=>{c(e)}}):null,wp.element.createElement(Gl,{onSelect:e=>{const t=Xl(e);u(t)},allowedTypes:Yl,render:e=>{let{open:t}=e;return wp.element.createElement(Hl,{onClick:t,isSecondary:!0},Dl("Replace Image","visual-portfolio"))}}),wp.element.createElement(Hl,{onClick:()=>{u(!1)},isLink:!0,isDestructive:!0},Dl("Remove Image from Gallery","visual-portfolio")),wp.element.createElement("div",{className:"vpf-component-gallery-control-item-modal-image-additional-info"},wp.element.createElement(Hl,{onClick:()=>{d(!h)},isLink:!0},Dl(h?"Hide Additional Info":"Show Additional Info","visual-portfolio"),wp.element.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},wp.element.createElement("path",{d:"M8 4L14 10L8 16",stroke:"currentColor",fill:"none",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",transform:"rotate(".concat(h?"-":"","90 10 10)")}))),h?wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("div",null,wp.element.createElement("strong",null,Dl("File name:","visual-portfolio"))," ",(null==g?void 0:g.source_url.split("/").pop())||"-",wp.element.createElement("br",null)," ",wp.element.createElement("strong",null,Dl("File type:","visual-portfolio"))," ",(null==g?void 0:g.mime_type)||"-",wp.element.createElement("br",null)," ",wp.element.createElement("strong",null,Dl("File size:","@text_domain"))," ",null!=g&&null!==(i=g.media_details)&&void 0!==i&&i.filesize?function(e){const t=Math.floor(Math.log(e)/Math.log(1024));return"".concat(1*(e/1024**t).toFixed(2)," ").concat(["B","KB","MB","GB","TB"][t])}(g.media_details.filesize):"-",null!=g&&null!==(o=g.media_details)&&void 0!==o&&o.width?wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("br",null)," ",wp.element.createElement("strong",null,Dl("Dimensions:","@text_domain"))," ",g.media_details.width," by ",g.media_details.height," pixels"):null),wp.element.createElement("div",null,wp.element.createElement(Wl,{label:Dl("File URL:","visual-portfolio"),value:(null==g?void 0:g.source_url)||"",readOnly:!0}),wp.element.createElement(Hl,{onClick:()=>{navigator.clipboard.writeText((null==g?void 0:g.source_url)||"").then((()=>{f(!0)}))},isSecondary:!0,isSmall:!0},Dl("Copy URL to Clipboard","visual-portfolio")),p?wp.element.createElement("span",{className:"vpf-component-gallery-control-item-modal-image-additional-info-copied"},Dl("Copied!","visual-portfolio")):null),null!=g&&g.link?wp.element.createElement("div",null,wp.element.createElement("a",{href:null==g?void 0:g.link,target:"_blank",rel:"noreferrer"},Dl("View attachment page","visual-portfolio"))," | ",wp.element.createElement("a",{href:"".concat(ql.admin_url,"post.php?post=").concat(g.id,"&action=edit"),target:"_blank",rel:"noreferrer"},Dl("Edit more details","visual-portfolio"))):null):null)))},Zl=function(e){const{img:t,items:n,index:i,onChange:o,imageControls:r,controlName:s,focalPoint:a,clientId:l,isSetupWizard:c}=e,u=i-1,{attributes:h,listeners:d,setNodeRef:p,transform:f,transition:g,isDragging:m,isSorting:v}=Ml({id:e.id}),b={transform:Ss.Translate.toString(f),transition:v?g:""},[w,y]=jl(!1),x=()=>y(!1);return wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("div",Pl({className:ne()("vpf-component-gallery-control-item",m?"vpf-component-gallery-control-item-dragging":""),ref:p,style:b},h,d),wp.element.createElement(Hl,{className:"vpf-component-gallery-control-item-button",onClick:()=>y(!0),"aria-expanded":w},wp.element.createElement("img",{src:t.imgThumbnailUrl||t.imgUrl,alt:t.alt||t.imgThumbnailUrl||t.imgUrl,loading:"lazy"}),wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},wp.element.createElement("circle",{cx:"12",cy:"12",r:"3"}),wp.element.createElement("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"}))),wp.element.createElement(Hl,{className:"vpf-component-gallery-control-item-remove",onClick:()=>{const e=[...n];e[u]&&(e.splice(u,1),o(e))}},wp.element.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},wp.element.createElement("path",{d:"M3.5 5.5H7.5M16.5 5.5H12.5M12.5 5.5V2.5H7.5V5.5M12.5 5.5H7.5M5 8.5L6 17H14L15 8.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"transparent"})))),w?wp.element.createElement(Vl,{title:Dl("Image Settings","visual-portfolio"),onRequestClose:e=>{e.relatedTarget&&e.relatedTarget.classList&&e.relatedTarget.classList.contains("media-modal")||x()}},wp.element.createElement("div",{className:"vpf-component-gallery-control-item-modal"},a&&t.id?wp.element.createElement(Jl,{showFocalPoint:a,focalPoint:t.focalPoint,imgId:t.id,imgUrl:t.imgThumbnailUrl||t.imgUrl,onChangeFocalPoint:e=>{const t=[...n];t[u]&&(t[u]=Tl(Tl({},t[u]),{},{focalPoint:e}),o(t))},onChangeImage:e=>{const t=[...n];t[u]&&(!1===e?(t.splice(u,1),o(t),x()):(t[u]=Tl(Tl({},t[u]),e),o(t)))}}):"",wp.element.createElement("div",null,Object.keys(r).map((i=>{const a=[],h="".concat(s,"[").concat(u,"].").concat(i);return r[i].condition.length&&r[i].condition.forEach((e=>{const t=Tl({},e);t.control&&/SELF/g.test(t.control)&&(t.control=t.control.replace(/SELF/g,"".concat(s,"[").concat(u,"]"))),a.push(t)})),zl("vpf.editor.gallery-controls-render",wp.element.createElement(Vc.Control,Pl({key:"".concat(t.id||t.imgThumbnailUrl||t.imgUrl,"-").concat(u,"-").concat(i),attributes:e.attributes,onChange:e=>{const t=[...n];t[u]&&(t[u]=Tl(Tl({},t[u]),{},{[i]:e}),o(t))}},r[i],{name:h,value:t[i],condition:a,clientId:l,isSetupWizard:c})),r[i],e,{name:i,fullName:h,index:u,condition:a})}))))):null)},ec=function(e){const{items:t,onChange:n,onSortEnd:i,imageControls:o,controlName:r,attributes:s,focalPoint:a,isSetupWizard:l}=e,c=Hs(Ws(Oa,{activationConstraint:{distance:5}})),[u,h]=jl(!l),[d,p]=jl(18),f=[];t&&t.length&&t.forEach(((e,t)=>{t<d&&f.push({id:t+1,data:e})}));const g=wp.element.createElement(Gl,{multiple:"add",onSelect:e=>{n(Ql(e,t))},allowedTypes:Yl,value:!(!t||!t.length)&&t.map((e=>e.id)),render:e=>{let{open:n}=e;return u||t&&t.length||(h(!0),n()),wp.element.createElement(Hl,{className:"vpf-component-gallery-control-item-fullwidth vpf-component-gallery-control-item-add",onClick:e=>{e.stopPropagation(),n()}},wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",height:"20",width:"20",role:"img","aria-hidden":"true",focusable:"false"},t&&t.length?wp.element.createElement("path",{d:"M9 14h10l-3.45-4.5-2.3 3-1.55-2Zm-1 4q-.825 0-1.412-.587Q6 16.825 6 16V4q0-.825.588-1.413Q7.175 2 8 2h12q.825 0 1.413.587Q22 3.175 22 4v12q0 .825-.587 1.413Q20.825 18 20 18Zm0-2h12V4H8v12Zm-4 6q-.825 0-1.412-.587Q2 20.825 2 20V6h2v14h14v2ZM8 4v12V4Z"}):wp.element.createElement("path",{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"})),wp.element.createElement("span",null,t&&t.length?Dl("Edit Gallery","visual-portfolio"):Dl("Add Images","visual-portfolio")))}});return wp.element.createElement("div",{className:"vpf-component-gallery-control-items"},t&&t.length&&9<t.length?g:null,wp.element.createElement(cl,{sensors:c,collisionDetection:qs,onDragEnd:e=>{const{active:t,over:n}=e;t.id!==n.id&&i(t.id-1,n.id-1)}},wp.element.createElement(kl,{items:f,strategy:wl},f.map((e=>{let{data:i,id:c}=e;return wp.element.createElement(Zl,{key:"vpf-component-gallery-control-items-sortable-".concat(c),index:c,id:c,img:i,items:t,onChange:n,imageControls:o,controlName:r,attributes:s,focalPoint:a,isSetupWizard:l})})))),t&&t.length?wp.element.createElement("span",{className:"vpf-component-gallery-control-item-fullwidth vpf-component-gallery-control-item-pagination"},wp.element.createElement("span",null,Nl(Fl("Showing %s of %s Image","Showing %s of %s Images",t.length,"visual-portfolio"),d>t.length?t.length:d,t.length)),t.length>d?wp.element.createElement("div",{className:"vpf-component-gallery-control-item-pagination-buttons"},wp.element.createElement(Hl,{isSecondary:!0,isSmall:!0,onClick:()=>{p(d+18)}},Dl("Show More","visual-portfolio")),wp.element.createElement(Hl,{isLink:!0,isSmall:!0,onClick:()=>{p(t.length)}},Dl("Show All","visual-portfolio"))):null):null,g)};function tc(e){const{imageControls:t,attributes:n,name:i,value:o,onChange:r,focalPoint:s,isSetupWizard:a}=e,l=o.filter((e=>e.id));return wp.element.createElement("div",{className:"vpf-component-gallery-control"},wp.element.createElement(Gl,{onSelect:e=>{r(Ql(e))},allowedTypes:Yl,multiple:"add",value:l&&Object.keys(l).length?l.map((e=>e.id)):[],render:()=>wp.element.createElement(ec,{items:l,onChange:r,imageControls:t,controlName:i,attributes:n,focalPoint:s,isSetupWizard:a,onSortEnd:(e,t)=>{const n=ml(l,e,t);r(n)}})}))}function nc(){return nc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},nc.apply(this,arguments)}const{Component:ic}=wp.element;class oc extends ic{render(){const{title:e,children:t,contentBefore:n="",contentAfter:i=""}=this.props;return wp.element.createElement("div",{className:"vpf-pro-note-wrapper"},n,wp.element.createElement("div",{className:"vpf-pro-note"},e?wp.element.createElement("h3",null,e):"",t?wp.element.createElement("div",null,t):""),i)}}function rc(e,t){let n=t[e];if(void 0===n&&/[\[\.]/g.test(e)){const i=e.split("."),o=[];if(i&&i.length&&(i.forEach((e=>{if(/[\[]/g.test(e)){const t=e.split(/[\[\]]/g);t&&t.length&&t.forEach((e=>{""!==e&&("".concat(parseInt(e,10))===e?o.push(parseInt(e,10)):o.push(e))}))}else o.push(e)})),o.length)){let e=t;o.forEach((t=>{e=e&&void 0!==e[t]?e[t]:void 0})),n=e}}return n}function sc(e,t,n){let i=!0;switch(t){case"==":i=e==n;break;case"===":i=e===n;break;case"!=":i=e!=n;break;case"!==":i=e!==n;break;case"*=":i=-1!==e.indexOf(n);break;case">=":i=e>=n;break;case"<=":i=e<=n;break;case">":i=e>n;break;case"<":i=e<n;break;case"&&":case"AND":i=e&&n;break;case"||":case"OR":i=e||n;break;default:i=e}return i}function ac(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"AND",i="AND"===n;const o=i?"OR":"AND";return e.forEach((e=>{if(Array.isArray(e)&&!e.control)i=sc(i,n,ac(e,t,o));else if(e.control){let o=rc(e.control,t);const r=e.operator||"==";let s=void 0!==e.value?e.value:"true";"true"===o?o=!0:"false"===o&&(o=!1),"true"===s?s=!0:"false"===s&&(s=!1),i=sc(i,n,sc(o,r,s))}})),i}oc.Button=class extends ic{render(){const{children:e}=this.props;return wp.element.createElement("a",nc({className:"vpf-pro-note-button"},this.props),e)}};const lc={},cc={};function uc(e){if(lc[e])return lc[e];let t={};if("object"==typeof e)return Object.keys(e).forEach((n=>{t[uc(n)]=uc(e[n])})),t;if(t=e,"string"==typeof t)try{t=t.replace(/--/gm,"_u002d__u002d_"),t=encodeURIComponent(t)}catch(e){console.warn(e)}return lc[e]=t,t}function hc(e){if(cc[e])return cc[e];let t={};if("object"==typeof e)return Object.keys(e).forEach((n=>{t[hc(n)]=hc(e[n])})),t;if(t=e,"string"==typeof t)try{t=decodeURIComponent(t),t=t.replace(/_u002d__u002d_/gm,"--")}catch(e){console.warn(e)}return cc[e]=t,t}function dc(){return dc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},dc.apply(this,arguments)}const{Component:pc}=wp.element,{Button:fc}=wp.components,gc=function(e){let{id:t,element:n,sourceOptions:i,items:o,props:r}=e;const{allowDisablingOptions:s,onChange:a}=r,{attributes:l,listeners:c,setNodeRef:u,transform:h,transition:d,isDragging:p,isSorting:f}=Ml({id:t}),g={transform:Ss.Translate.toString(h),transition:f?d:""},m=i[n];return wp.element.createElement("li",{className:ne()("vpf-component-sortable-item",p?"vpf-component-sortable-item-dragging":""),ref:u,style:g},wp.element.createElement("span",dc({},l,c),wp.element.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},wp.element.createElement("path",{d:"M10 4.99976H8V6.99976H10V4.99976Z",fill:"currentColor"}),wp.element.createElement("path",{d:"M10 10.9998H8V12.9998H10V10.9998Z",fill:"currentColor"}),wp.element.createElement("path",{d:"M10 16.9998H8V18.9998H10V16.9998Z",fill:"currentColor"}),wp.element.createElement("path",{d:"M16 4.99976H14V6.99976H16V4.99976Z",fill:"currentColor"}),wp.element.createElement("path",{d:"M16 10.9998H14V12.9998H16V10.9998Z",fill:"currentColor"}),wp.element.createElement("path",{d:"M16 16.9998H14V18.9998H16V16.9998Z",fill:"currentColor"}))),m,s?wp.element.createElement(fc,{className:"vpf-component-sortable-delete",onClick:()=>{const e=[...o],t=o.indexOf(n);e.splice(t,1),a(e)}},wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2"},wp.element.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20 12H4"}))):null)},mc=function(e){let{items:t,sourceOptions:n,classes:i,onSortEnd:o,props:r}=e;const s=Hs(Ws(Oa));return wp.element.createElement("ul",{className:i},wp.element.createElement(cl,{sensors:s,collisionDetection:qs,onDragEnd:e=>{const{active:n,over:i}=e;n.id!==i.id&&o(t.indexOf(n.id),t.indexOf(i.id))}},wp.element.createElement(kl,{items:t,strategy:xl},t.map((e=>wp.element.createElement(gc,{key:"item-".concat(e),id:e,element:e,sourceOptions:n,props:r,items:t}))))))};class vc extends pc{render(){const{options:e,defaultOptions:t,allowDisablingOptions:n,onChange:i}=this.props;let{value:o}=this.props;o=void 0!==o?o:t;const r=Object.keys(e).filter((e=>!o.includes(e))),s=ne()("vpf-component-sortable",0<r.length?"vpf-dragging-has-disabled-options":"");return wp.element.createElement("div",null,wp.element.createElement(mc,{items:o,sourceOptions:e,classes:s,props:this.props,onSortEnd:(e,t)=>{const n=ml(o,e,t);i(n)}}),0<r.length?wp.element.createElement("ul",{className:"vpf-component-sortable-disabled"},r.map((t=>wp.element.createElement("li",{key:"disabled-item-".concat(t)},n?wp.element.createElement(fc,{className:"vpf-component-sortable-add",onClick:()=>{const e=[...o];e.push(t),i(e)}},wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2"},wp.element.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"}))):null,e[t])))):null)}}function bc(){return bc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},bc.apply(this,arguments)}function wc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function yc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{__:xc}=wp.i18n,{Component:Cc,RawHTML:Sc,useState:kc,useEffect:$c,useRef:Ec}=wp.element,{applyFilters:_c}=wp.hooks,{PanelBody:Lc,Tooltip:Ac,Notice:Rc,BaseControl:Mc,ButtonGroup:Oc,Button:Tc,TextControl:Ic,TextareaControl:Pc,CheckboxControl:Dc,RadioControl:Fc,ToggleControl:Nc,RangeControl:zc}=wp.components,{controls:Bc,controls_categories:jc}=window.VPGutenbergVariables,Wc={};class Hc extends Cc{render(){const{category:e,categoryToggle:t=!0,attributes:n,setAttributes:i,controls:o,clientId:r,isSetupWizard:s,showPanel:a=!0}=this.props;if(!n)return null;if(/^content-source-/g.test(e)&&"content-source-general"!==e&&"content-source-".concat(n.content_source)!==e)return null;const l=o||Bc,c=[];Object.keys(l).forEach((t=>{const o=l[t];if(e&&(!o.category||e!==o.category))return;const a=_c("vpf.editor.controls-render-data",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wc(Object(n),!0).forEach((function(t){yc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({attributes:n,setAttributes:i,onChange:e=>{const t=_c("vpf.editor.controls-on-change",{[o.name]:e},o,e,n);i(t)}},o));Hc.AllowRender(a,s)&&c.push(_c("vpf.editor.controls-render",wp.element.createElement(Hc.Control,bc({key:"control-".concat(o.name,"-").concat(o.label)},a,{clientId:r,isSetupWizard:s})),a,this.props))}));let u=!!t&&e,h=!1,d=!1,p=!t;return t&&void 0!==jc[e]&&(u=jc[e].title,h=jc[e].icon||!1,d=!!jc[e].is_pro,void 0===Wc[e]&&(Wc[e]=jc[e].is_opened||!1),p=Wc[e]),s?c.length?wp.element.createElement("div",{className:"vpf-setup-wizard-panel"},c):"":a?c.length?wp.element.createElement(Lc,{title:!!u&&wp.element.createElement(wp.element.Fragment,null,h?wp.element.createElement("span",{className:"vpf-control-category-title-icon"},wp.element.createElement(Sc,null,h)):null,wp.element.createElement("span",null,u),d?wp.element.createElement("span",{className:"vpf-control-category-title-pro"},xc("PRO","visual-portfolio")):""),initialOpen:p,onToggle:()=>{Wc[e]=!p}},c):"":c.length?c:""}}Hc.Control=function(e){const{attributes:t,onChange:n,isSetupWizard:i}=e,o=Ec(),[r,s]=kc(""),a=rc(e.name,t);if($c((()=>{if(e.group&&o.current){const t=o.current.parentElement.parentElement;let n=t.previousElementSibling,i=t.nextElementSibling;for(;n&&n.classList.contains("vpf-control-group-separator");)n=n.previousElementSibling;for(;i&&i.classList.contains("vpf-control-group-separator");)i=i.nextElementSibling;const a=n&&n.classList.contains("vpf-control-group-".concat(e.group))||i&&i.classList.contains("vpf-control-group-".concat(e.group)),l=n&&!n.classList.contains("vpf-control-group-".concat(e.group))&&n.classList.contains("vpf-control-wrap"),c=i&&!i.classList.contains("vpf-control-group-".concat(e.group))&&n.classList.contains("vpf-control-wrap");let u="";a&&(l?u="start":c&&(u="end")),r!==u&&s(u)}}),[o,e.group,a]),!Hc.AllowRender(e,i))return null;let l="",c=e.label,u="",h=e.description?wp.element.createElement(Sc,{className:"components-base-control__help"},e.description):null,d=ne()("vpf-control-wrap","vpf-control-wrap-".concat(e.type));switch(e.group&&(d=ne()(d,"vpf-control-with-group","vpf-control-group-".concat(e.group),!!r&&"vpf-control-group-position-".concat(r))),e.type){case"html":l=wp.element.createElement(Sc,null,e.default);break;case"select":case"select2":l=wp.element.createElement(Zr,{controlName:e.name,callback:e.value_callback,attributes:t,value:a,options:e.options||{},onChange:e=>n(e),isSearchable:e.searchable,isMultiple:e.multiple,isCreatable:e.creatable||e.tags});break;case"buttons":l=wp.element.createElement(Oc,null,Object.keys(e.options||{}).map((t=>wp.element.createElement(Tc,{isSmall:!0,isPrimary:a===t,isPressed:a===t,key:t,onClick:()=>n(t)},e.options[t]))));break;case"icons_selector":l=wp.element.createElement(fe,{controlName:e.name,callback:e.value_callback,attributes:t,value:a,options:e.options,onChange:e=>n(e),isSetupWizard:i});break;case"tiles_selector":l=wp.element.createElement(Ae,{value:a,options:e.options,onChange:e=>n(e)});break;case"elements_selector":l=wp.element.createElement(au,{value:a,locations:e.locations,options:e.options,onChange:e=>n(e),props:e});break;case"align":l=wp.element.createElement(Oe,{value:a,extended:e.extended,onChange:e=>n(e)});break;case"aspect_ratio":l=wp.element.createElement(Ne,{value:a,onChange:e=>n(e)});break;case"gallery":l=wp.element.createElement(tc,{imageControls:e.image_controls,focalPoint:e.focal_point,attributes:t,name:e.name,value:a,onChange:e=>n(e),isSetupWizard:i});break;case"code_editor":l=wp.element.createElement(ve,{value:e.encode?hc(a):a,mode:e.mode,maxLines:e.max_lines,minLines:e.min_lines,codePlaceholder:e.code_placeholder,onChange:t=>n(e.encode?uc(t):t)}),e.allow_modal&&(u=wp.element.createElement($e,{modalTitle:xc("Custom CSS","visual-portfolio"),buttonLabel:xc("Open in Modal","visual-portfolio"),size:"md"},wp.element.createElement(Mc,{label:e.label,help:!!e.description&&wp.element.createElement(Sc,null,e.description),className:ne()("vpf-control-wrap","vpf-control-wrap-".concat(e.type))},wp.element.createElement("div",null,l)),e.classes_tree?wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("p",null,xc("Classes Tree:","visual-portfolio")),wp.element.createElement(G,e)):""));break;case"range":l=wp.element.createElement(zc,{min:e.min,max:e.max,step:e.step,value:parseFloat(a),onChange:e=>n(parseFloat(e))});break;case"toggle":l=wp.element.createElement(Nc,{checked:a,label:e.alongside,onChange:e=>n(e)});break;case"checkbox":l=wp.element.createElement(Dc,{checked:a,label:e.alongside,onChange:e=>n(e)});break;case"radio":l=wp.element.createElement(Fc,{label:c,selected:a,options:Object.keys(e.options||{}).map((t=>({label:e.options[t],value:t}))),onChange:e=>n(e)}),c=!1;break;case"color":l=wp.element.createElement(W,{value:a,alpha:e.alpha,onChange:e=>n(e)});break;case"date":l=wp.element.createElement(ee,{value:a,onChange:e=>n(e)});break;case"textarea":l=wp.element.createElement(Pc,{label:c,value:a,onChange:e=>n(e)}),c=!1;break;case"url":l=wp.element.createElement(Ic,{label:c,type:"url",value:a,onChange:e=>n(e)}),c=!1;break;case"number":l=wp.element.createElement(Ic,{label:c,type:"number",min:e.min,max:e.max,step:e.step,value:parseFloat(a),onChange:e=>n(parseFloat(e))}),c=!1;break;case"hidden":l=wp.element.createElement(Ic,{type:"hidden",value:a,onChange:e=>n(e)});break;case"notice":l=h?wp.element.createElement(Rc,{status:e.status,isDismissible:!1},h):"",h=!1;break;case"pro_note":l=wp.element.createElement(oc,{title:c},h||"",wp.element.createElement(oc.Button,{target:"_blank",rel:"noopener noreferrer",href:"https://visualportfolio.co/pricing/?utm_source=plugin&utm_medium=block_settings&utm_campaign=".concat(e.name,"&utm_content=2.21.2")},xc("Go Pro","visual-portfolio"))),c=!1,h=!1;break;case"sortable":l=wp.element.createElement(vc,{label:c,controlName:e.name,attributes:t,value:a,options:e.options||{},defaultVal:e.default||{},allowDisablingOptions:e.allow_disabling_options||!1,onChange:e=>n(e)});break;default:l=wp.element.createElement(Ic,{label:c,value:a,onChange:e=>n(e)}),c=!1}e.hint&&(l=wp.element.createElement(Ac,{text:e.hint,position:e.hint_place},wp.element.createElement("div",null,l)));const p=_c("vpf.editor.controls-render-inner-data",{renderControl:l,renderControlHelp:h,renderControlAfter:u},{props:e,controlVal:a});return wp.element.createElement(wp.element.Fragment,null,"start"===r?wp.element.createElement("div",{className:"vpf-control-group-separator"}):null,wp.element.createElement(Mc,{label:c,className:d},wp.element.createElement("div",{ref:o},p.renderControl),p.renderControlHelp),p.renderControlAfter,"end"===r?wp.element.createElement("div",{className:"vpf-control-group-separator"}):null)},Hc.AllowRender=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!(e.skip||e.condition&&e.condition.length&&!ac(e.condition,e.attributes)||t&&!e.setup_wizard)};var Vc=Hc;function Uc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Gc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Uc(Object(n),!0).forEach((function(t){Kc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Uc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Kc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qc(){return qc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},qc.apply(this,arguments)}const{__:Yc}=wp.i18n,{Component:Xc,useState:Qc}=wp.element,{PanelBody:Jc,Button:Zc,DropdownMenu:eu,Dropdown:tu,Modal:nu,Toolbar:iu,ToolbarButton:ou}=wp.components,ru={left:wp.element.createElement("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",role:"img","aria-hidden":"true",focusable:"false"},wp.element.createElement("path",{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})),center:wp.element.createElement("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",role:"img","aria-hidden":"true",focusable:"false"},wp.element.createElement("path",{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"})),right:wp.element.createElement("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",role:"img","aria-hidden":"true",focusable:"false"},wp.element.createElement("path",{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})),between:wp.element.createElement("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",role:"img","aria-hidden":"true",focusable:"false"},wp.element.createElement("path",{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"}))};function su(e){const{location:t,locationData:n,value:i,onChange:o,options:r,optionName:s,parentProps:a}=e,[l,c]=Qc(!1);return wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("button",{type:"button","aria-expanded":l,className:"vpf-component-elements-selector-control-location-options-item",onClick:()=>c(!0)},r[s]?r[s].title:s,wp.element.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},wp.element.createElement("path",{d:"M11 4L17 10M17 10L11 16M17 10H3",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))),l?wp.element.createElement(nu,{title:"".concat(r[s]?r[s].title:s," ").concat(Yc("Settings","visual-portfolio")),onRequestClose:e=>{e.relatedTarget&&e.relatedTarget.classList&&e.relatedTarget.classList.contains("media-modal")||c(!1)},className:"vpf-component-elements-selector-modal"},r[s]&&r[s].category?wp.element.createElement(Vc,qc({},a.props,{category:r[s].category,categoryToggle:!1})):null,"items"!==s?wp.element.createElement(Jc,null,wp.element.createElement(Zc,{isLink:!0,style:{color:"red",marginTop:"5px"},onClick:()=>{window.confirm(Yc("Are you sure you want to remove the element?","visual-portfolio"))&&o(Gc(Gc({},i),{},{[t]:Gc(Gc({},i[t]),{},{elements:n.elements.filter((e=>e!==s))})}))}},Yc("Remove","visual-portfolio")," ".concat(r[s]?r[s].title:s))):null):null)}class au extends Xc{constructor(){super(...arguments),this.getLocationData=this.getLocationData.bind(this),this.renderLocation=this.renderLocation.bind(this),this.renderAlignSettings=this.renderAlignSettings.bind(this)}getLocationData(e){const{options:t,locations:n,value:i}=this.props,o=n[e]&&n[e].title||!1,r=i[e]&&i[e].elements?i[e].elements:[],s=!(!i[e]||!i[e].align)&&i[e].align,a=n[e]&&n[e].align?n[e].align:[],l={};return Object.keys(t).forEach((n=>{const i=t[n];i.allowed_locations&&-1===i.allowed_locations.indexOf(e)||-1!==r.indexOf(n)||(l[n]=i)})),{title:o,elements:r,align:s,availableAlign:a,availableElements:l}}renderAlignSettings(e){const{value:t,onChange:n}=this.props,i=this.getLocationData(e),o=[];return i.availableAlign.length&&i.availableAlign.forEach((r=>{o.push(wp.element.createElement(ou,{key:r,icon:ru[r],label:"".concat(r.charAt(0).toUpperCase()+r.slice(1)),onClick:()=>n(Gc(Gc({},t),{},{[e]:Gc(Gc({},t[e]),{},{align:r})})),isActive:!!i.align&&i.align===r}))})),o.length?wp.element.createElement(tu,{position:"bottom left",className:"vpf-component-elements-selector-align__dropdown",contentClassName:"vpf-component-elements-selector-align__dropdown-content",renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return wp.element.createElement("button",{type:"button","aria-expanded":t,className:"vpf-component-elements-selector-control-location-options-item",onClick:n},i.align&&ru[i.align]?ru[i.align]:ru.center)},renderContent:()=>wp.element.createElement(iu,{label:"Elements Selector"},o)}):null}renderLocation(e){const{value:t,onChange:n,options:i}=this.props,o=this.getLocationData(e),{availableElements:r}=o;return wp.element.createElement("div",{key:e,className:"vpf-component-elements-selector-control-location"},o.title?wp.element.createElement("div",{className:"vpf-component-elements-selector-control-location-title"},o.title):null,o.availableAlign.length&&o.elements.length?wp.element.createElement("div",{className:"vpf-component-elements-selector-control-location-align"},this.renderAlignSettings(e)):null,wp.element.createElement("div",{className:ne()("vpf-component-elements-selector-control-location-options",o.align?"vpf-component-elements-selector-control-location-options-".concat(o.align):"")},o.elements.length?o.elements.map((r=>wp.element.createElement(su,{key:r,location:e,locationData:o,value:t,onChange:n,options:i,optionName:r,parentProps:this.props}))):null,Object.keys(r).length?wp.element.createElement(eu,{className:"vpf-component-elements-selector-control-location-options-add-button",popoverProps:{position:"bottom center"},icon:wp.element.createElement("svg",{width:"20",height:"20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",role:"img","aria-hidden":"true",focusable:"false"},wp.element.createElement("path",{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"})),controls:Object.keys(r).map((i=>({title:wp.element.createElement(wp.element.Fragment,null,r[i].title,r[i].is_pro?wp.element.createElement("span",{className:"vpf-component-elements-selector-control-location-options-title-pro"},Yc("PRO","visual-portfolio")):""),onClick(){if(r[i].is_pro)return;const s=[...o.elements];-1===s.indexOf(i)&&(s.push(i),n(Gc(Gc({},t),{},{[e]:Gc(Gc({},t[e]),{},{elements:s})})))}})))}):""))}render(){const{locations:e}=this.props;return wp.element.createElement("div",{className:"vpf-component-elements-selector-control"},Object.keys(e).map((e=>this.renderLocation(e))))}}const{Component:lu}=wp.element,{Spinner:cu}=wp.components;class uu extends lu{render(){return wp.element.createElement("div",{className:"vpf-component-spinner"},wp.element.createElement(cu,null))}}function hu(){return{ColorPicker:W,ClassesTree:G,ControlsRender:Vc,VPDatePicker:ee,ElementsSelector:au,IconsSelector:fe,VpfSelectControl:Zr,SpinnerComponent:uu,ToggleModal:$e}}const{registerStore:du}=wp.data;function pu(){return{conditionCheck:ac,controlGetValue:rc}}du("visual-portfolio/components",{selectors:r,reducer:e=>e});const{registerStore:fu}=wp.data;fu("visual-portfolio/utils",{selectors:s,reducer:e=>e});const{registerStore:gu}=wp.data;function mu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function vu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mu(Object(n),!0).forEach((function(t){bu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function bu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}gu("visual-portfolio",{reducer:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{layouts:[]},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"SET_PORTFOLIO_LAYOUTS"===t.type?(!e.layouts.length&&t.layouts&&t.layouts.length&&(e.layouts=t.layouts),e):e},selectors:e,actions:t,controls:i,resolvers:o});const{VPSavedLayoutVariables:wu}=window;const{VPSavedLayoutVariables:yu}=window;function xu(e){return e.data||yu.data}function Cu(e){return{type:"API_FETCH",request:e}}function Su(e){return{type:"SET_BLOCK_DATA",data:e}}function ku(e){return{type:"UPDATE_BLOCK_DATA",data:e}}const{apiFetch:$u}=wp;function Eu(e){let{request:t}=e;return $u(t).then((e=>!!(e&&e.success&&e.response)&&e.response))}const{registerStore:_u}=wp.data;_u("visual-portfolio/saved-layout-data",{reducer:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{data:wu.data},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(t.type){case"SET_BLOCK_DATA":if(t.data)return e?vu(vu({},e),{},{data:t.data}):t;break;case"UPDATE_BLOCK_DATA":if(t.data&&e)return vu(vu({},e),{},{data:vu(vu({},e.data),t.data)})}return e},selectors:a,actions:l,controls:c});const{useEffect:Lu,useState:Au,useRef:Ru,useCallback:Mu}=wp.element;function Ou(e){const{step:t,children:n}=e,i=Ru(),[o,r]=Au(t),[s,a]=Au(0),l=Mu((()=>{let e=0;i.current.childNodes.forEach((t=>{const n=window.getComputedStyle(t),i=parseFloat(n.marginTop)+parseFloat(n.marginBottom);e+=Math.ceil(t.offsetHeight+i)})),a("".concat(e,"px"))}),[i]);return Lu((()=>{t!==o&&r(t)}),[t]),Lu((()=>{l()}),[o]),Lu((()=>{const e=i.current,t=ze(100,(()=>{l()})),n=new MutationObserver(t);return n.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0,attributeOldValue:!0,characterDataOldValue:!0}),()=>{n.disconnect()}}),[i.current]),void 0!==n[o]?wp.element.createElement("div",{ref:i,className:ne()("vpf-component-steps-wizard",t!==o&&"vpf-component-steps-wizard-animate-".concat(o>t?"left":"right")),style:s?{height:s}:{}},n[o]):null}Ou.Step=function(e){const{children:t}=e;return t};var Tu=Ou;function Iu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Pu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Iu(Object(n),!0).forEach((function(t){Du(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Iu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Du(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fu(){return Fu=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Fu.apply(this,arguments)}const{useEffect:Nu,useState:zu}=wp.element,{__:Bu}=wp.i18n,{ToggleControl:ju,Button:Wu}=wp.components,{plugin_name:Hu}=window.VPGutenbergVariables,Vu=parseInt(window.VPGutenbergVariables.items_count_notice_limit,10);function Uu(e,t){return wp.element.createElement(Vc,Fu({},e,{category:t,isSetupWizard:!0}))}function Gu(e,t){var n;const{layout_elements:i}=t,o="filter"===e?"top":"bottom";return void 0!==i[o]&&(null===(n=i[o])||void 0===n?void 0:n.elements.includes(e))}function Ku(e,t){var n;const{layout_elements:i}=t,o="filter"===e?"top":"bottom";if(void 0===i[o]||null===(n=i[o])||void 0===n||!n.elements)return i;const r=JSON.parse(JSON.stringify(i));return Gu(e,t)?r[o].elements=[]:r[o].elements=[e],r}function qu(e){const{attributes:t,setAttributes:n}=e,{align:i,content_source:o,items_click_action:r,layout:s,images:a}=t,[l,c]=zu(0),[u,h]=zu(!1);return Nu((()=>{i||o||n({align:"wide"})}),[]),Nu((()=>{if(o){let e={};switch(o){case"images":a&&a.length&&(e=Pu(Pu({},e),{},{items_count:-1,items_click_action:"popup_gallery"}),"slider"!==s&&a.length>Vu&&(e=Pu(Pu({},e),{},{items_count:Vu,layout_elements:{top:{elements:[],align:"center"},items:{elements:["items"]},bottom:{elements:["pagination"],align:"center"}},pagination:"infinite",pagination_hide_on_end:!0})));break;case"post-based":case"social-stream":e=Pu(Pu({},e),{},{layout_elements:{top:{elements:[],align:"center"},items:{elements:["items"]},bottom:{elements:["pagination"],align:"center"}}})}n(e),h(!0)}}),[o,a]),wp.element.createElement("div",{className:"vpf-setup-wizard vpf-setup-wizard-step-".concat(l)},wp.element.createElement(Tu,{step:l},wp.element.createElement(Tu.Step,null,wp.element.createElement("div",{className:"vpf-setup-wizard-title"},Hu),wp.element.createElement("div",{className:"vpf-setup-wizard-description",dangerouslySetInnerHTML:{__html:Bu("Set the common settings in the setup wizard,<br />more options will be available in the block settings.<br />Select the Content Source first:","visual-portfolio")}}),Uu(e,"content-source"),Uu(e,"content-source-images")),wp.element.createElement(Tu.Step,null,wp.element.createElement("div",{className:"vpf-setup-wizard-title"},Bu("Items Style","visual-portfolio")),wp.element.createElement("div",{className:"vpf-setup-wizard-description",dangerouslySetInnerHTML:{__html:Bu("Select one of the featured styles to get started.<br />More style settings will be available in the block settings.","visual-portfolio")}}),Uu(e,"items-style")),wp.element.createElement(Tu.Step,null,wp.element.createElement("div",{className:"vpf-setup-wizard-title"},Bu("Additional Settings","visual-portfolio")),wp.element.createElement("div",{className:"vpf-setup-wizard-layout-elements"},wp.element.createElement("div",null,wp.element.createElement(ju,{label:Bu("Filter","visual-portfolio"),checked:Gu("filter",t),onChange:()=>{n({layout_elements:Ku("filter",t)})}})),wp.element.createElement("div",null,wp.element.createElement(ju,{label:Bu("Pagination","visual-portfolio"),checked:Gu("pagination",t),onChange:()=>{n({layout_elements:Ku("pagination",t)})}})),wp.element.createElement("div",null,wp.element.createElement(ju,{label:Bu("Popup Gallery","visual-portfolio"),checked:"popup_gallery"===r,onChange:()=>{n({items_click_action:"popup_gallery"===r?"url":"popup_gallery"})}}))))),wp.element.createElement("div",{className:"vpf-setup-wizard-pagination"},o?wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("div",{className:"vpf-setup-wizard-pagination-button"},wp.element.createElement(Wu,{isLink:!0,onClick:()=>{0===l?n({setup_wizard:"",content_source:t.contentSource||"images"}):c(l-1)}},Bu(0===l?"Skip Setup":"Previous Step","visual-portfolio"))),wp.element.createElement("div",{className:"vpf-setup-wizard-pagination-progress"},wp.element.createElement("div",{style:{width:"".concat(Math.max(15,Math.min(100,100*l/2.5)),"%")}})),wp.element.createElement("div",{className:"vpf-setup-wizard-pagination-button vpf-setup-wizard-pagination-button-end"},wp.element.createElement(Wu,{isPrimary:!0,disabled:!u,onClick:()=>{2===l?n({setup_wizard:""}):c(l+1)}},Bu("Continue","visual-portfolio"),wp.element.createElement("svg",{width:"14",height:"14",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{marginLeft:"5px"}},wp.element.createElement("path",{d:"M3 10H17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),wp.element.createElement("path",{d:"M11 4L17 10L11 16",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}))))):null))}var Yu=n(3379),Xu=n.n(Yu),Qu=n(7795),Ju=n.n(Qu),Zu=n(569),eh=n.n(Zu),th=n(3565),nh=n.n(th),ih=n(9216),oh=n.n(ih),rh=n(4589),sh=n.n(rh),ah=n(71),lh={};lh.styleTagTransform=sh(),lh.setAttributes=nh(),lh.insert=eh().bind(null,"head"),lh.domAPI=Ju(),lh.insertStyleElement=oh(),Xu()(ah.Z,lh),ah.Z&&ah.Z.locals&&ah.Z.locals;var ch=n(1818),uh=n.n(ch);n(1927);const{controls:hh}=window.VPGutenbergVariables;function dh(e){let t="",n="";if(void 0!==e.block_id&&e.block_id?n=e.block_id:void 0!==e.id&&e.id&&(n=e.id),!n)return t;if(n=".vp-id-".concat(n),Object.keys(hh).forEach((i=>{const o=hh[i];let r=void 0!==o.style&&o.style;r&&void 0!==o.condition&&o.condition.length&&(r=ac(o.condition,e)),r&&o.style.forEach((i=>{let r=e[o.name];if(o.type&&"aspect_ratio"===o.type&&r){const e=r.split(":");e[0]&&e[1]&&(r="".concat(e[1]/e[0]*100,"%"))}t+=function(e,t,n){let i="";return e&&void 0!==t&&""!==t&&null!==t&&void 0!==n.property?(void 0!==n.mask&&(t=n.mask.replace("$",t)),void 0!==n.element&&/\$/g.test(n.element)?e=n.element.replace("$",e):e+=void 0!==n.element?" ".concat(n.element):"",i="".concat(e," { ").concat(n.property,": ").concat(t,"; } "),i):i}(n,r,i)}))})),void 0!==e.custom_css&&e.custom_css){let i=e.custom_css;i=hc(i),i=i.replace(/selector/g,n),i=i.replace(/<\//g,"&lt;/"),t+=i}return t}const{jQuery:ph,VPAdminGutenbergVariables:fh,VPGutenbergVariables:{controls:gh}}=window,{applyFilters:mh}=wp.hooks,{Component:vh,Fragment:bh,createRef:wh}=wp.element,{withSelect:yh}=wp.data,{Spinner:xh}=wp.components;let Ch=1;var Sh=yh((e=>{const{__experimentalGetPreviewDeviceType:t}=e("core/edit-post")||{},{getCurrentPost:n}=e("core/editor")||{};return{previewDeviceType:t?t():"desktop",postType:n?n().type:"standard",postId:n?n().id:"widgets"}}))(class extends vh{constructor(){super(...arguments),this.state={loading:!0,uniqueId:"vpf-preview-".concat(Ch),currentIframeHeight:0,latestIframeHeight:0},Ch+=1,this.frameRef=wh(),this.formRef=wh(),this.maybePreviewTypeChanged=this.maybePreviewTypeChanged.bind(this),this.maybeAttributesChanged=this.maybeAttributesChanged.bind(this),this.onFrameLoad=this.onFrameLoad.bind(this),this.maybeReload=this.maybeReload.bind(this),this.maybeReloadDebounce=Be(300,je(this.maybeReload.bind(this))),this.maybeResizePreviews=this.maybeResizePreviews.bind(this),this.maybeResizePreviewsThrottle=ze(100,je(this.maybeResizePreviews)),this.updateIframeHeight=this.updateIframeHeight.bind(this),this.updateIframeHeightThrottle=ze(100,je(this.updateIframeHeight)),this.printInput=this.printInput.bind(this)}componentDidMount(){const e=this,{clientId:t}=e.props;uh()({interval:10,warningTimeout:6e4,checkOrigin:!1,onMessage(e){let{message:n}=e;"clicked"===n&&(wp.data.dispatch("core/block-editor").selectBlock(t),window.focus())},onResized(t){let{height:n}=t;e.updateIframeHeightThrottle("".concat(n,"px"))}},e.frameRef.current),e.frameRef.current.addEventListener("load",e.onFrameLoad),window.addEventListener("resize",e.maybeResizePreviewsThrottle),e.maybeReload()}componentDidUpdate(e){this.maybePreviewTypeChanged(e),this.maybeAttributesChanged(e)}componentWillUnmount(){this.frameRef.current.removeEventListener("load",this.onFrameLoad),window.removeEventListener("resize",this.maybeResizePreviewsThrottle),this.frameRef.current.iframeResizer&&(this.frameRef.current.iframeResizer.close(),this.frameRef.current.iframeResizer.removeListeners())}onFrameLoad(e){this.frameWindow=e.target.contentWindow,this.frameJQuery=e.target.contentWindow.jQuery,this.frameJQuery&&(this.$framePortfolio=this.frameJQuery(".vp-portfolio"),this.maybeResizePreviews(),this.frameTimeout&&clearTimeout(this.frameTimeout),this.frameTimeout=setTimeout((()=>{this.setState({loading:!1})}),300))}maybePreviewTypeChanged(e){e.previewDeviceType!==this.props.previewDeviceType&&this.maybeResizePreviews()}maybeAttributesChanged(e){if(this.busyReload)return;this.busyReload=!0;const{attributes:t}=this.props,{attributes:n}=e,i=this.frameRef.current,o={};if(Object.keys(t).forEach((e=>{const i=t[e];void 0!==n[e]&&n[e]===i||(o[e]=i)})),Object.keys(o).length){let e=!1;Object.keys(o).forEach((t=>{const n=void 0!==hh[i=t]&&void 0!==hh[i].style&&hh[i].style.length;var i;const o=gh[t]&&gh[t].reload_iframe;e=e||!n&&o}));const n=mh("vpf.editor.changed-attributes",{attributes:o,reload:e,$frame:this.frameRef.current,frameWindow:this.frameWindow,frameJQuery:this.frameJQuery,$framePortfolio:this.$framePortfolio});n.reload||(n.frameWindow&&n.frameWindow.vp_preview_post_data&&(n.frameWindow.vp_preview_post_data[n.name]=n.value),i.iFrameResizer&&t.block_id&&i.iFrameResizer.sendMessage({name:"dynamic-css",blockId:t.block_id,styles:dh(t)})),n.reload&&this.maybeReloadDebounce(),this.busyReload=!1}else this.busyReload=!1}maybeReload(){let e=0;this.frameRef.current&&(e=this.state.currentIframeHeight),this.setState({loading:!0,latestIframeHeight:e}),this.formRef.current.submit()}maybeResizePreviews(){const e=ph(".editor-styles-wrapper").width();if(!e||!this.frameRef.current)return;const t=this.frameRef.current,n=ph(t),i=n.closest(".visual-portfolio-gutenberg-preview").width();n.css({width:e}),t.iFrameResizer&&(t.iFrameResizer.sendMessage({name:"resize",width:i}),t.iFrameResizer.resize())}updateIframeHeight(e){this.setState({currentIframeHeight:e})}printInput(e,t){const n={type:"text",name:e,value:t,readOnly:!0};if("number"==typeof t)n.type="number";else if("boolean"==typeof t)n.type="number",n.value=t?1:0;else{if("object"==typeof t&&null!==t)return wp.element.createElement(wp.element.Fragment,null,Object.keys(t).map((n=>wp.element.createElement(bh,{key:"".concat(e,"[").concat(n,"]")},this.printInput("".concat(e,"[").concat(n,"]"),t[n])))));n.value=n.value||""}return wp.element.createElement("input",n)}render(){const{attributes:e,postType:t,postId:n}=this.props,{loading:i,uniqueId:o,currentIframeHeight:r,latestIframeHeight:s}=this.state,{id:a,content_source:l}=e;return wp.element.createElement("div",{className:ne()("visual-portfolio-gutenberg-preview",i?"visual-portfolio-gutenberg-preview-loading":""),style:{height:i?s:r}},wp.element.createElement("div",{className:"visual-portfolio-gutenberg-preview-inner"},wp.element.createElement("form",{action:fh.preview_url,target:o,method:"POST",style:{display:"none"},ref:this.formRef},wp.element.createElement("input",{type:"hidden",name:"vp_preview_frame",value:"true",readOnly:!0}),wp.element.createElement("input",{type:"hidden",name:"vp_preview_type",value:"gutenberg",readOnly:!0}),wp.element.createElement("input",{type:"hidden",name:"vp_preview_post_type",value:t,readOnly:!0}),wp.element.createElement("input",{type:"hidden",name:"vp_preview_post_id",value:n,readOnly:!0}),wp.element.createElement("input",{type:"hidden",name:"vp_preview_nonce",value:fh.nonce,readOnly:!0}),"saved"===l?wp.element.createElement("input",{type:"text",name:"vp_id",value:a,readOnly:!0}):wp.element.createElement(wp.element.Fragment,null,Object.keys(e).map((t=>{const n=e[t];return wp.element.createElement(bh,{key:"vp_".concat(t)},this.printInput("vp_".concat(t),n))})))),wp.element.createElement("iframe",{title:"vp-preview",id:o,name:o,allowtransparency:"true",ref:this.frameRef})),i?wp.element.createElement(xh,null):"")}});function kh(){return kh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},kh.apply(this,arguments)}const{useEffect:$h}=wp.element,{useBlockProps:Eh,InspectorControls:_h}=wp.blockEditor,{plugin_url:Lh,controls_categories:Ah}=window.VPGutenbergVariables;function Rh(e){const{attributes:t,setAttributes:n}=e,{block_id:i,content_source:o,setup_wizard:r,preview_image_example:s,layout:a,ghostkitClassname:l}=t;$h((()=>{r||i&&o||n({setup_wizard:"true"})}),[]);let c="";if(l&&(c=ne()(c,l)),"true"===s)return wp.element.createElement("div",{className:"vpf-example-preview"},wp.element.createElement("img",{src:"".concat(Lh,"/assets/admin/images/example-").concat(a,".png"),alt:"Preview of ".concat(a," layout")}));const u=Eh({className:c});return wp.element.createElement("div",u,"true"===r?wp.element.createElement(qu,e):wp.element.createElement(wp.element.Fragment,null,wp.element.createElement(_h,null,function(e){const{attributes:t}=e;let{content_source:n}=t;return"portfolio"===n&&(n=""),wp.element.createElement(wp.element.Fragment,null,wp.element.createElement(Vc,kh({category:"content-source"},e)),n?wp.element.createElement(wp.element.Fragment,null,Object.keys(Ah).map((t=>"content-source"===t?null:wp.element.createElement(Vc,kh({key:t,category:t},e))))):null)}(e)),wp.element.createElement(Sh,e)))}function Mh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Oh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mh(Object(n),!0).forEach((function(t){Th(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Th(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ih(){return Ih=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Ih.apply(this,arguments)}const{jQuery:Ph}=window,{registerBlockType:Dh,createBlock:Fh}=wp.blocks,{registerPlugin:Nh}=wp.plugins,{__:zh,sprintf:Bh}=wp.i18n,{apiFetch:jh}=wp,{applyFilters:Wh}=wp.hooks,{Component:Hh,useState:Vh}=wp.element,{PanelBody:Uh,Button:Gh}=wp.components,{withSelect:Kh,withDispatch:qh}=wp.data,{InspectorControls:Yh}=wp.blockEditor,{compose:Xh}=wp.compose,{plugin_name:Qh}=window.VPGutenbergVariables;let Jh;function Zh(e){const[t,n]=Vh(!1);return wp.element.createElement("div",{className:"vpf-layout-shortcode-copy"},wp.element.createElement("strong",null,e.label,":"),wp.element.createElement("div",null,wp.element.createElement("pre",null,e.content),wp.element.createElement(Gh,{isSmall:!0,onClick:()=>{L(e.content),n(!0),clearTimeout(Jh),Jh=setTimeout((()=>{n(!1)}),450)}},wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16"},wp.element.createElement("path",{d:"M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z"}),wp.element.createElement("path",{d:"M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z"})),t?wp.element.createElement("div",{className:"vpf-layout-shortcode-copied"},zh("Copied!","visual-portfolio")):null)))}const ed=Xh([Kh((e=>{const t=e("visual-portfolio/saved-layout-data").getBlockData();return{postId:e("core/editor").getCurrentPostId(),blockData:t}})),qh((e=>({updateBlockData(t){e("visual-portfolio/saved-layout-data").updateBlockData(t)}})))])(class extends Hh{constructor(){super(...arguments),this.state={additionalShortcodes:!1}}render(){const{postId:e,blockData:t,updateBlockData:n,clientId:i}=this.props,{additionalShortcodes:o}=this.state;let r=[{label:zh("This Saved Layout","visual-portfolio"),content:'[visual_portfolio id="'.concat(e,'"]')},{label:zh("Filter","visual-portfolio"),content:'[visual_portfolio_filter id="'.concat(e,'" type="minimal" align="center" show_count="false" text_all="All"]'),isOptional:!0},{label:zh("Sort","visual-portfolio"),content:'[visual_portfolio_sort id="'.concat(e,'" type="minimal" align="center"]'),isOptional:!0}];return r=Wh("vpf.layouts-editor.shortcodes-list",r,this),wp.element.createElement(wp.element.Fragment,null,wp.element.createElement(Yh,null,wp.element.createElement(Uh,{title:zh("Shortcodes","visual-portfolio")},wp.element.createElement("p",null,zh("To output this saved layout and its components you can use the following shortcodes:")),r.map((e=>e.isOptional?null:wp.element.createElement(Zh,Ih({key:"shortcode-".concat(e.label)},e)))),o?wp.element.createElement(wp.element.Fragment,null,r.map((e=>e.isOptional?wp.element.createElement(Zh,Ih({key:"shortcode-".concat(e.label)},e)):null)),Wh("vpf.layouts-editor.shortcodes","",this)):wp.element.createElement(Gh,{isLink:!0,onClick:()=>{this.setState({additionalShortcodes:!o})}},zh("Show Additional Shortcodes","visual-portfolio")))),wp.element.createElement(Rh,{attributes:Oh(Oh({},t),{},{block_id:t.id||i}),setAttributes:e=>{n(e)},clientId:i}))}});Dh("visual-portfolio/saved-editor",{title:Bh(zh("%s Editor","visual-portfolio"),Qh),description:Bh(zh("Edit saved %s layouts.","visual-portfolio"),Qh),icon:{foreground:"#2540CC",src:wp.element.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},wp.element.createElement("mask",{id:"mask0","mask-type":"alpha",maskUnits:"userSpaceOnUse",x:"9",y:"8",width:"5",height:"6"},wp.element.createElement("path",{d:"M11.1409 14L13.0565 8.49994H11.2789L9.55397 14H11.1409Z",fill:"url(#paint0_linear)"})),wp.element.createElement("g",{mask:"url(#mask0)"},wp.element.createElement("path",{d:"M11.1409 14L13.0565 8.49994H11.2789L9.55397 14H11.1409Z",fill:"currentColor"})),wp.element.createElement("path",{d:"M8.90795 14L6.9923 8.49994H8.76989L10.4948 14H8.90795Z",fill:"currentColor"}),wp.element.createElement("path",{d:"M19 16.2222C19 16.6937 18.8104 17.1459 18.4728 17.4793C18.1352 17.8127 17.6774 18 17.2 18H2.8C2.32261 18 1.86477 17.8127 1.52721 17.4793C1.18964 17.1459 1 16.6937 1 16.2222V3.77778C1 3.30628 1.18964 2.8541 1.52721 2.5207C1.86477 2.1873 2.32261 2 2.8 2H7.3L9.1 4.66667H17.2C17.6774 4.66667 18.1352 4.85397 18.4728 5.18737C18.8104 5.52076 19 5.97295 19 6.44444V16.2222Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"transparent"}),wp.element.createElement("defs",null,wp.element.createElement("linearGradient",{id:"paint0_linear",x1:"12.191",y1:"8.49994",x2:"7.44436",y2:"15.1301",gradientUnits:"userSpaceOnUse"},wp.element.createElement("stop",null),wp.element.createElement("stop",{offset:"1",stopOpacity:"0"}))))},category:"common",supports:{html:!1,className:!1,customClassName:!1,anchor:!1,inserter:!1},edit:ed,save:()=>null}),Nh("vpf-saved-layouts-editor",{render:Xh(Kh((e=>{const{isSavingPost:t,isAutosavingPost:n,getCurrentPostId:i,getEditorSettings:o}=e("core/editor"),{getSelectedBlock:r,getBlocks:s}=e("core/block-editor"),{getEditorMode:a}=e("core/edit-post"),{getBlockData:l}=e("visual-portfolio/saved-layout-data");return{isSavingPost:t(),isAutosavingPost:n(),selectedBlock:r(),editorSettings:o(),editorMode:a(),blocks:s(),postId:i(),blockData:l()}})),qh((e=>{const{selectBlock:t,insertBlocks:n,resetBlocks:i}=e("core/block-editor"),{editPost:o}=e("core/editor"),{switchEditorMode:r}=e("core/edit-post");return{selectBlock:t,insertBlocks:n,resetBlocks:i,editPost:o,switchEditorMode:r}})))(class extends Hh{componentDidMount(){const{isSavingPost:e,isAutosavingPost:t}=this.props;this.defaultBlockData=!1,this.editorRefreshTimeout=!1,this.wasSavingPost=e,this.wasAutosavingPost=t,this.update()}componentDidUpdate(){this.update()}update(){this.changeToVisualMode(),this.addBlock(),this.alwaysSelectBlock(),this.checkIfPostEdited(),this.saveMetaOnPostUpdate()}changeToVisualMode(){const{editorSettings:e,editorMode:t,switchEditorMode:n}=this.props;e.richEditingEnabled&&"text"===t&&n()}addBlock(){if(this.blocksRestoreBusy)return;const{resetBlocks:e,insertBlocks:t,blocks:n}=this.props;1===n.length&&n[0]&&"visual-portfolio/saved-editor"===n[0].name||(this.blocksRestoreBusy=!0,e([]),t(Fh("visual-portfolio/saved-editor")),this.blocksRestoreBusy=!1)}alwaysSelectBlock(){const{selectedBlock:e,blocks:t,selectBlock:n}=this.props;if(e&&"visual-portfolio/saved-editor"===e.name)return;if(Ph(".editor-post-title__block.is-selected, .editor-post-title.is-selected").length)return;let i="";t.forEach((e=>{"visual-portfolio/saved-editor"===e.name&&(i=e.clientId)})),i&&n(i)}checkIfPostEdited(){const{isSavingPost:e,isAutosavingPost:t,blockData:n,editPost:i}=this.props;n&&Object.keys(n).length&&(e||t||!this.defaultBlockData?this.defaultBlockData=JSON.stringify(n):(clearTimeout(this.editorRefreshTimeout),this.editorRefreshTimeout=setTimeout((()=>{this.defaultBlockData!==JSON.stringify(n)&&i({edited:new Date})}),150)))}saveMetaOnPostUpdate(){const{isSavingPost:e,isAutosavingPost:t,postId:n,blockData:i}=this.props,o=this.wasSavingPost&&!e&&!this.wasAutosavingPost;if(this.wasSavingPost=e,this.wasAutosavingPost=t,o){const e={};Object.keys(i).forEach((t=>{e["vp_".concat(t)]=i[t]})),jh({path:"/visual-portfolio/v1/update_layout/",method:"POST",data:{data:e,post_id:n}}).catch((e=>{console.log(e)}))}}render(){return null}})})}()}();