From 44a83c8043067dfd67615aaeb38e6ed44269eec1 Mon Sep 17 00:00:00 2001 From: RichDom2185 Date: Sat, 17 Aug 2024 07:50:17 +0000 Subject: [PATCH] deploy: d0b0454483df7d58472611462e1acfa0a375b714 --- .../{index-DrGynO-Z.js => index-C2XKFhaE.js} | 350 +++++++++--------- index.html | 2 +- 2 files changed, 176 insertions(+), 176 deletions(-) rename assets/{index-DrGynO-Z.js => index-C2XKFhaE.js} (80%) diff --git a/assets/index-DrGynO-Z.js b/assets/index-C2XKFhaE.js similarity index 80% rename from assets/index-DrGynO-Z.js rename to assets/index-C2XKFhaE.js index 89baa16..0120974 100644 --- a/assets/index-DrGynO-Z.js +++ b/assets/index-C2XKFhaE.js @@ -1,4 +1,4 @@ -function _mergeNamespaces(i,s){for(var o=0;oa[rt]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const rt of document.querySelectorAll('link[rel="modulepreload"]'))a(rt);new MutationObserver(rt=>{for(const et of rt)if(et.type==="childList")for(const ot of et.addedNodes)ot.tagName==="LINK"&&ot.rel==="modulepreload"&&a(ot)}).observe(document,{childList:!0,subtree:!0});function o(rt){const et={};return rt.integrity&&(et.integrity=rt.integrity),rt.referrerPolicy&&(et.referrerPolicy=rt.referrerPolicy),rt.crossOrigin==="use-credentials"?et.credentials="include":rt.crossOrigin==="anonymous"?et.credentials="omit":et.credentials="same-origin",et}function a(rt){if(rt.ep)return;rt.ep=!0;const et=o(rt);fetch(rt.href,et)}})();var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function getAugmentedNamespace(i){if(i.__esModule)return i;var s=i.default;if(typeof s=="function"){var o=function a(){return this instanceof a?Reflect.construct(s,arguments,this.constructor):s.apply(this,arguments)};o.prototype=s.prototype}else o={};return Object.defineProperty(o,"__esModule",{value:!0}),Object.keys(i).forEach(function(a){var rt=Object.getOwnPropertyDescriptor(i,a);Object.defineProperty(o,a,rt.get?rt:{enumerable:!0,get:function(){return i[a]}})}),o}var jsxRuntime={exports:{}},reactJsxRuntime_production_min={},react={exports:{}},react_production_min={};/** +function _mergeNamespaces(i,s){for(var o=0;oa[rt]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const rt of document.querySelectorAll('link[rel="modulepreload"]'))a(rt);new MutationObserver(rt=>{for(const tt of rt)if(tt.type==="childList")for(const ot of tt.addedNodes)ot.tagName==="LINK"&&ot.rel==="modulepreload"&&a(ot)}).observe(document,{childList:!0,subtree:!0});function o(rt){const tt={};return rt.integrity&&(tt.integrity=rt.integrity),rt.referrerPolicy&&(tt.referrerPolicy=rt.referrerPolicy),rt.crossOrigin==="use-credentials"?tt.credentials="include":rt.crossOrigin==="anonymous"?tt.credentials="omit":tt.credentials="same-origin",tt}function a(rt){if(rt.ep)return;rt.ep=!0;const tt=o(rt);fetch(rt.href,tt)}})();var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function getAugmentedNamespace(i){if(i.__esModule)return i;var s=i.default;if(typeof s=="function"){var o=function a(){return this instanceof a?Reflect.construct(s,arguments,this.constructor):s.apply(this,arguments)};o.prototype=s.prototype}else o={};return Object.defineProperty(o,"__esModule",{value:!0}),Object.keys(i).forEach(function(a){var rt=Object.getOwnPropertyDescriptor(i,a);Object.defineProperty(o,a,rt.get?rt:{enumerable:!0,get:function(){return i[a]}})}),o}var jsxRuntime={exports:{}},reactJsxRuntime_production_min={},react={exports:{}},react_production_min={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ function _mergeNamespaces(i,s){for(var o=0;o0?charat(characters,--position$1):0,column--,character===10&&(column=1,line--),character}function next(){return character=position$12||token$1(character)>3?"":" "}function escaping(i,s){for(;--s&&next()&&!(character<48||character>102||character>57&&character<65||character>70&&character<97););return slice(i,caret()+(s<6&&peek$1()==32&&next()==32))}function delimiter(i){for(;next();)switch(character){case i:return position$1;case 34:case 39:i!==34&&i!==39&&delimiter(character);break;case 40:i===41&&delimiter(i);break;case 92:next();break}return position$1}function commenter(i,s){for(;next()&&i+character!==57;)if(i+character===84&&peek$1()===47)break;return"/*"+slice(s,position$1-1)+"*"+from(i===47?i:next())}function identifier(i){for(;!token$1(peek$1());)next();return slice(i,position$1)}function compile(i){return dealloc(parse$2("",null,null,null,[""],i=alloc(i),0,[0],i))}function parse$2(i,s,o,a,rt,et,ot,at,nt){for(var it=0,j=0,_=ot,$=0,tt=0,st=0,lt=1,ct=1,ht=1,ut=0,pt="",mt=rt,gt=et,dt=a,St=pt;ct;)switch(st=ut,ut=next()){case 40:if(st!=108&&charat(St,_-1)==58){indexof(St+=replace(delimit(ut),"&","&\f"),"&\f")!=-1&&(ht=-1);break}case 34:case 39:case 91:St+=delimit(ut);break;case 9:case 10:case 13:case 32:St+=whitespace(st);break;case 92:St+=escaping(caret()-1,7);continue;case 47:switch(peek$1()){case 42:case 47:append$1(comment(commenter(next(),caret()),s,o),nt);break;default:St+="/"}break;case 123*lt:at[it++]=strlen(St)*ht;case 125*lt:case 59:case 0:switch(ut){case 0:case 125:ct=0;case 59+j:ht==-1&&(St=replace(St,/\f/g,"")),tt>0&&strlen(St)-_&&append$1(tt>32?declaration(St+";",a,o,_-1):declaration(replace(St," ","")+";",a,o,_-2),nt);break;case 59:St+=";";default:if(append$1(dt=ruleset(St,s,o,it,j,rt,at,pt,mt=[],gt=[],_),et),ut===123)if(j===0)parse$2(St,s,dt,dt,mt,et,_,at,gt);else switch($===99&&charat(St,3)===110?100:$){case 100:case 108:case 109:case 115:parse$2(i,dt,dt,a&&append$1(ruleset(i,dt,dt,0,0,rt,at,pt,rt,mt=[],_),gt),rt,gt,_,at,a?mt:gt);break;default:parse$2(St,dt,dt,dt,[""],gt,0,at,gt)}}it=j=tt=0,lt=ht=1,pt=St="",_=ot;break;case 58:_=1+strlen(St),tt=st;default:if(lt<1){if(ut==123)--lt;else if(ut==125&<++==0&&prev()==125)continue}switch(St+=from(ut),ut*lt){case 38:ht=j>0?1:(St+="\f",-1);break;case 44:at[it++]=(strlen(St)-1)*ht,ht=1;break;case 64:peek$1()===45&&(St+=delimit(next())),$=peek$1(),j=_=strlen(pt=St+=identifier(caret())),ut++;break;case 45:st===45&&strlen(St)==2&&(lt=0)}}return et}function ruleset(i,s,o,a,rt,et,ot,at,nt,it,j){for(var _=rt-1,$=rt===0?et:[""],tt=sizeof($),st=0,lt=0,ct=0;st0?$[ht]+" "+ut:replace(ut,/&\f/g,$[ht])))&&(nt[ct++]=pt);return node(i,s,o,rt===0?RULESET:at,nt,it,j)}function comment(i,s,o){return node(i,s,o,COMMENT,from(char()),substr(i,2,-2),0)}function declaration(i,s,o,a){return node(i,s,o,DECLARATION,substr(i,0,a),substr(i,a+1,-1),a)}function serialize(i,s){for(var o="",a=sizeof(i),rt=0;rt6)switch(charat(i,s+1)){case 109:if(charat(i,s+4)!==45)break;case 102:return replace(i,/(.+:)(.+)-([^]+)/,"$1"+WEBKIT+"$2-$3$1"+MOZ+(charat(i,s+3)==108?"$3":"$2-$3"))+i;case 115:return~indexof(i,"stretch")?prefix(replace(i,"stretch","fill-available"),s)+i:i}break;case 4949:if(charat(i,s+1)!==115)break;case 6444:switch(charat(i,strlen(i)-3-(~indexof(i,"!important")&&10))){case 107:return replace(i,":",":"+WEBKIT)+i;case 101:return replace(i,/(.+:)([^;!]+)(;|!.+)?/,"$1"+WEBKIT+(charat(i,14)===45?"inline-":"")+"box$3$1"+WEBKIT+"$2$3$1"+MS+"$2box$3")+i}break;case 5936:switch(charat(i,s+11)){case 114:return WEBKIT+i+MS+replace(i,/[svh]\w+-[tblr]{2}/,"tb")+i;case 108:return WEBKIT+i+MS+replace(i,/[svh]\w+-[tblr]{2}/,"tb-rl")+i;case 45:return WEBKIT+i+MS+replace(i,/[svh]\w+-[tblr]{2}/,"lr")+i}return WEBKIT+i+MS+i+i}return i}var prefixer=function(s,o,a,rt){if(s.length>-1&&!s.return)switch(s.type){case DECLARATION:s.return=prefix(s.value,s.length);break;case KEYFRAMES:return serialize([copy(s,{value:replace(s.value,"@","@"+WEBKIT)})],rt);case RULESET:if(s.length)return combine(s.props,function(et){switch(match(et,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return serialize([copy(s,{props:[replace(et,/:(read-\w+)/,":"+MOZ+"$1")]})],rt);case"::placeholder":return serialize([copy(s,{props:[replace(et,/:(plac\w+)/,":"+WEBKIT+"input-$1")]}),copy(s,{props:[replace(et,/:(plac\w+)/,":"+MOZ+"$1")]}),copy(s,{props:[replace(et,/:(plac\w+)/,MS+"input-$1")]})],rt)}return""})}},defaultStylisPlugins=[prefixer],createCache=function(s){var o=s.key;if(o==="css"){var a=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(a,function(lt){var ct=lt.getAttribute("data-emotion");ct.indexOf(" ")!==-1&&(document.head.appendChild(lt),lt.setAttribute("data-s",""))})}var rt=s.stylisPlugins||defaultStylisPlugins,et={},ot,at=[];ot=s.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+o+' "]'),function(lt){for(var ct=lt.getAttribute("data-emotion").split(" "),ht=1;ht0?charat(characters,--position$1):0,column--,character===10&&(column=1,line--),character}function next(){return character=position$12||token$1(character)>3?"":" "}function escaping(i,s){for(;--s&&next()&&!(character<48||character>102||character>57&&character<65||character>70&&character<97););return slice(i,caret()+(s<6&&peek$1()==32&&next()==32))}function delimiter(i){for(;next();)switch(character){case i:return position$1;case 34:case 39:i!==34&&i!==39&&delimiter(character);break;case 40:i===41&&delimiter(i);break;case 92:next();break}return position$1}function commenter(i,s){for(;next()&&i+character!==57;)if(i+character===84&&peek$1()===47)break;return"/*"+slice(s,position$1-1)+"*"+from(i===47?i:next())}function identifier(i){for(;!token$1(peek$1());)next();return slice(i,position$1)}function compile(i){return dealloc(parse$2("",null,null,null,[""],i=alloc(i),0,[0],i))}function parse$2(i,s,o,a,rt,tt,ot,at,nt){for(var it=0,j=0,_=ot,$=0,et=0,st=0,lt=1,ct=1,ht=1,ut=0,pt="",mt=rt,gt=tt,dt=a,St=pt;ct;)switch(st=ut,ut=next()){case 40:if(st!=108&&charat(St,_-1)==58){indexof(St+=replace(delimit(ut),"&","&\f"),"&\f")!=-1&&(ht=-1);break}case 34:case 39:case 91:St+=delimit(ut);break;case 9:case 10:case 13:case 32:St+=whitespace(st);break;case 92:St+=escaping(caret()-1,7);continue;case 47:switch(peek$1()){case 42:case 47:append$1(comment(commenter(next(),caret()),s,o),nt);break;default:St+="/"}break;case 123*lt:at[it++]=strlen(St)*ht;case 125*lt:case 59:case 0:switch(ut){case 0:case 125:ct=0;case 59+j:ht==-1&&(St=replace(St,/\f/g,"")),et>0&&strlen(St)-_&&append$1(et>32?declaration(St+";",a,o,_-1):declaration(replace(St," ","")+";",a,o,_-2),nt);break;case 59:St+=";";default:if(append$1(dt=ruleset(St,s,o,it,j,rt,at,pt,mt=[],gt=[],_),tt),ut===123)if(j===0)parse$2(St,s,dt,dt,mt,tt,_,at,gt);else switch($===99&&charat(St,3)===110?100:$){case 100:case 108:case 109:case 115:parse$2(i,dt,dt,a&&append$1(ruleset(i,dt,dt,0,0,rt,at,pt,rt,mt=[],_),gt),rt,gt,_,at,a?mt:gt);break;default:parse$2(St,dt,dt,dt,[""],gt,0,at,gt)}}it=j=et=0,lt=ht=1,pt=St="",_=ot;break;case 58:_=1+strlen(St),et=st;default:if(lt<1){if(ut==123)--lt;else if(ut==125&<++==0&&prev()==125)continue}switch(St+=from(ut),ut*lt){case 38:ht=j>0?1:(St+="\f",-1);break;case 44:at[it++]=(strlen(St)-1)*ht,ht=1;break;case 64:peek$1()===45&&(St+=delimit(next())),$=peek$1(),j=_=strlen(pt=St+=identifier(caret())),ut++;break;case 45:st===45&&strlen(St)==2&&(lt=0)}}return tt}function ruleset(i,s,o,a,rt,tt,ot,at,nt,it,j){for(var _=rt-1,$=rt===0?tt:[""],et=sizeof($),st=0,lt=0,ct=0;st0?$[ht]+" "+ut:replace(ut,/&\f/g,$[ht])))&&(nt[ct++]=pt);return node(i,s,o,rt===0?RULESET:at,nt,it,j)}function comment(i,s,o){return node(i,s,o,COMMENT,from(char()),substr(i,2,-2),0)}function declaration(i,s,o,a){return node(i,s,o,DECLARATION,substr(i,0,a),substr(i,a+1,-1),a)}function serialize(i,s){for(var o="",a=sizeof(i),rt=0;rt6)switch(charat(i,s+1)){case 109:if(charat(i,s+4)!==45)break;case 102:return replace(i,/(.+:)(.+)-([^]+)/,"$1"+WEBKIT+"$2-$3$1"+MOZ+(charat(i,s+3)==108?"$3":"$2-$3"))+i;case 115:return~indexof(i,"stretch")?prefix(replace(i,"stretch","fill-available"),s)+i:i}break;case 4949:if(charat(i,s+1)!==115)break;case 6444:switch(charat(i,strlen(i)-3-(~indexof(i,"!important")&&10))){case 107:return replace(i,":",":"+WEBKIT)+i;case 101:return replace(i,/(.+:)([^;!]+)(;|!.+)?/,"$1"+WEBKIT+(charat(i,14)===45?"inline-":"")+"box$3$1"+WEBKIT+"$2$3$1"+MS+"$2box$3")+i}break;case 5936:switch(charat(i,s+11)){case 114:return WEBKIT+i+MS+replace(i,/[svh]\w+-[tblr]{2}/,"tb")+i;case 108:return WEBKIT+i+MS+replace(i,/[svh]\w+-[tblr]{2}/,"tb-rl")+i;case 45:return WEBKIT+i+MS+replace(i,/[svh]\w+-[tblr]{2}/,"lr")+i}return WEBKIT+i+MS+i+i}return i}var prefixer=function(s,o,a,rt){if(s.length>-1&&!s.return)switch(s.type){case DECLARATION:s.return=prefix(s.value,s.length);break;case KEYFRAMES:return serialize([copy(s,{value:replace(s.value,"@","@"+WEBKIT)})],rt);case RULESET:if(s.length)return combine(s.props,function(tt){switch(match(tt,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return serialize([copy(s,{props:[replace(tt,/:(read-\w+)/,":"+MOZ+"$1")]})],rt);case"::placeholder":return serialize([copy(s,{props:[replace(tt,/:(plac\w+)/,":"+WEBKIT+"input-$1")]}),copy(s,{props:[replace(tt,/:(plac\w+)/,":"+MOZ+"$1")]}),copy(s,{props:[replace(tt,/:(plac\w+)/,MS+"input-$1")]})],rt)}return""})}},defaultStylisPlugins=[prefixer],createCache=function(s){var o=s.key;if(o==="css"){var a=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(a,function(lt){var ct=lt.getAttribute("data-emotion");ct.indexOf(" ")!==-1&&(document.head.appendChild(lt),lt.setAttribute("data-s",""))})}var rt=s.stylisPlugins||defaultStylisPlugins,tt={},ot,at=[];ot=s.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+o+' "]'),function(lt){for(var ct=lt.getAttribute("data-emotion").split(" "),ht=1;ht=4;++a,rt-=4)o=i.charCodeAt(a)&255|(i.charCodeAt(++a)&255)<<8|(i.charCodeAt(++a)&255)<<16|(i.charCodeAt(++a)&255)<<24,o=(o&65535)*1540483477+((o>>>16)*59797<<16),o^=o>>>24,s=(o&65535)*1540483477+((o>>>16)*59797<<16)^(s&65535)*1540483477+((s>>>16)*59797<<16);switch(rt){case 3:s^=(i.charCodeAt(a+2)&255)<<16;case 2:s^=(i.charCodeAt(a+1)&255)<<8;case 1:s^=i.charCodeAt(a)&255,s=(s&65535)*1540483477+((s>>>16)*59797<<16)}return s^=s>>>13,s=(s&65535)*1540483477+((s>>>16)*59797<<16),((s^s>>>15)>>>0).toString(36)}var unitlessKeys={animationIterationCount:1,aspectRatio: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},isDevelopment$1=!1,hyphenateRegex=/[A-Z]|^ms/g,animationRegex=/_EMO_([^_]+?)_([^]*?)_EMO_/g,isCustomProperty=function(s){return s.charCodeAt(1)===45},isProcessableValue=function(s){return s!=null&&typeof s!="boolean"},processStyleName=memoize$3(function(i){return isCustomProperty(i)?i:i.replace(hyphenateRegex,"-$&").toLowerCase()}),processStyleValue=function(s,o){switch(s){case"animation":case"animationName":if(typeof o=="string")return o.replace(animationRegex,function(a,rt,et){return cursor={name:rt,styles:et,next:cursor},rt})}return unitlessKeys[s]!==1&&!isCustomProperty(s)&&typeof o=="number"&&o!==0?o+"px":o},noComponentSelectorMessage="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function handleInterpolation(i,s,o){if(o==null)return"";var a=o;if(a.__emotion_styles!==void 0)return a;switch(typeof o){case"boolean":return"";case"object":{var rt=o;if(rt.anim===1)return cursor={name:rt.name,styles:rt.styles,next:cursor},rt.name;var et=o;if(et.styles!==void 0){var ot=et.next;if(ot!==void 0)for(;ot!==void 0;)cursor={name:ot.name,styles:ot.styles,next:cursor},ot=ot.next;var at=et.styles+";";return at}return createStringFromObject(i,s,o)}case"function":{if(i!==void 0){var nt=cursor,it=o(i);return cursor=nt,handleInterpolation(i,s,it)}break}}var j=o;if(s==null)return j;var _=s[j];return _!==void 0?_:j}function createStringFromObject(i,s,o){var a="";if(Array.isArray(o))for(var rt=0;rt=4;++a,rt-=4)o=i.charCodeAt(a)&255|(i.charCodeAt(++a)&255)<<8|(i.charCodeAt(++a)&255)<<16|(i.charCodeAt(++a)&255)<<24,o=(o&65535)*1540483477+((o>>>16)*59797<<16),o^=o>>>24,s=(o&65535)*1540483477+((o>>>16)*59797<<16)^(s&65535)*1540483477+((s>>>16)*59797<<16);switch(rt){case 3:s^=(i.charCodeAt(a+2)&255)<<16;case 2:s^=(i.charCodeAt(a+1)&255)<<8;case 1:s^=i.charCodeAt(a)&255,s=(s&65535)*1540483477+((s>>>16)*59797<<16)}return s^=s>>>13,s=(s&65535)*1540483477+((s>>>16)*59797<<16),((s^s>>>15)>>>0).toString(36)}var unitlessKeys={animationIterationCount:1,aspectRatio: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},isDevelopment$1=!1,hyphenateRegex=/[A-Z]|^ms/g,animationRegex=/_EMO_([^_]+?)_([^]*?)_EMO_/g,isCustomProperty=function(s){return s.charCodeAt(1)===45},isProcessableValue=function(s){return s!=null&&typeof s!="boolean"},processStyleName=memoize$3(function(i){return isCustomProperty(i)?i:i.replace(hyphenateRegex,"-$&").toLowerCase()}),processStyleValue=function(s,o){switch(s){case"animation":case"animationName":if(typeof o=="string")return o.replace(animationRegex,function(a,rt,tt){return cursor={name:rt,styles:tt,next:cursor},rt})}return unitlessKeys[s]!==1&&!isCustomProperty(s)&&typeof o=="number"&&o!==0?o+"px":o},noComponentSelectorMessage="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function handleInterpolation(i,s,o){if(o==null)return"";var a=o;if(a.__emotion_styles!==void 0)return a;switch(typeof o){case"boolean":return"";case"object":{var rt=o;if(rt.anim===1)return cursor={name:rt.name,styles:rt.styles,next:cursor},rt.name;var tt=o;if(tt.styles!==void 0){var ot=tt.next;if(ot!==void 0)for(;ot!==void 0;)cursor={name:ot.name,styles:ot.styles,next:cursor},ot=ot.next;var at=tt.styles+";";return at}return createStringFromObject(i,s,o)}case"function":{if(i!==void 0){var nt=cursor,it=o(i);return cursor=nt,handleInterpolation(i,s,it)}break}}var j=o;if(s==null)return j;var _=s[j];return _!==void 0?_:j}function createStringFromObject(i,s,o){var a="";if(Array.isArray(o))for(var rt=0;rt>>1,Wt=Mt[Kt];if(0>>1;Ktrt(Zt,Bt))qtrt(hr,Zt)?(Mt[Kt]=hr,Mt[qt]=Bt,Kt=qt):(Mt[Kt]=Zt,Mt[Ht]=Bt,Kt=Ht);else if(qtrt(hr,Bt))Mt[Kt]=hr,Mt[qt]=Bt,Kt=qt;else break e}}return Dt}function rt(Mt,Dt){var Bt=Mt.sortIndex-Dt.sortIndex;return Bt!==0?Bt:Mt.id-Dt.id}if(typeof performance=="object"&&typeof performance.now=="function"){var et=performance;i.unstable_now=function(){return et.now()}}else{var ot=Date,at=ot.now();i.unstable_now=function(){return ot.now()-at}}var nt=[],it=[],j=1,_=null,$=3,tt=!1,st=!1,lt=!1,ct=typeof setTimeout=="function"?setTimeout:null,ht=typeof clearTimeout=="function"?clearTimeout:null,ut=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function pt(Mt){for(var Dt=o(it);Dt!==null;){if(Dt.callback===null)a(it);else if(Dt.startTime<=Mt)a(it),Dt.sortIndex=Dt.expirationTime,s(nt,Dt);else break;Dt=o(it)}}function mt(Mt){if(lt=!1,pt(Mt),!st)if(o(nt)!==null)st=!0,It(gt);else{var Dt=o(it);Dt!==null&&Ot(mt,Dt.startTime-Mt)}}function gt(Mt,Dt){st=!1,lt&&(lt=!1,ht(xt),xt=-1),tt=!0;var Bt=$;try{for(pt(Dt),_=o(nt);_!==null&&(!(_.expirationTime>Dt)||Mt&&!Ct());){var Kt=_.callback;if(typeof Kt=="function"){_.callback=null,$=_.priorityLevel;var Wt=Kt(_.expirationTime<=Dt);Dt=i.unstable_now(),typeof Wt=="function"?_.callback=Wt:_===o(nt)&&a(nt),pt(Dt)}else a(nt);_=o(nt)}if(_!==null)var zt=!0;else{var Ht=o(it);Ht!==null&&Ot(mt,Ht.startTime-Dt),zt=!1}return zt}finally{_=null,$=Bt,tt=!1}}var dt=!1,St=null,xt=-1,yt=5,_t=-1;function Ct(){return!(i.unstable_now()-_tMt||125Kt?(Mt.sortIndex=Bt,s(it,Mt),o(nt)===null&&Mt===o(it)&&(lt?(ht(xt),xt=-1):lt=!0,Ot(mt,Bt-Kt))):(Mt.sortIndex=Wt,s(nt,Mt),st||tt||(st=!0,It(gt))),Mt},i.unstable_shouldYield=Ct,i.unstable_wrapCallback=function(Mt){var Dt=$;return function(){var Bt=$;$=Dt;try{return Mt.apply(this,arguments)}finally{$=Bt}}}})(scheduler_production_min);scheduler.exports=scheduler_production_min;var schedulerExports=scheduler.exports;/** + */(function(i){function s(Mt,Dt){var Bt=Mt.length;Mt.push(Dt);e:for(;0>>1,Wt=Mt[Kt];if(0>>1;Ktrt(Zt,Bt))qtrt(hr,Zt)?(Mt[Kt]=hr,Mt[qt]=Bt,Kt=qt):(Mt[Kt]=Zt,Mt[Ht]=Bt,Kt=Ht);else if(qtrt(hr,Bt))Mt[Kt]=hr,Mt[qt]=Bt,Kt=qt;else break e}}return Dt}function rt(Mt,Dt){var Bt=Mt.sortIndex-Dt.sortIndex;return Bt!==0?Bt:Mt.id-Dt.id}if(typeof performance=="object"&&typeof performance.now=="function"){var tt=performance;i.unstable_now=function(){return tt.now()}}else{var ot=Date,at=ot.now();i.unstable_now=function(){return ot.now()-at}}var nt=[],it=[],j=1,_=null,$=3,et=!1,st=!1,lt=!1,ct=typeof setTimeout=="function"?setTimeout:null,ht=typeof clearTimeout=="function"?clearTimeout:null,ut=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function pt(Mt){for(var Dt=o(it);Dt!==null;){if(Dt.callback===null)a(it);else if(Dt.startTime<=Mt)a(it),Dt.sortIndex=Dt.expirationTime,s(nt,Dt);else break;Dt=o(it)}}function mt(Mt){if(lt=!1,pt(Mt),!st)if(o(nt)!==null)st=!0,It(gt);else{var Dt=o(it);Dt!==null&&Ot(mt,Dt.startTime-Mt)}}function gt(Mt,Dt){st=!1,lt&&(lt=!1,ht(xt),xt=-1),et=!0;var Bt=$;try{for(pt(Dt),_=o(nt);_!==null&&(!(_.expirationTime>Dt)||Mt&&!Ct());){var Kt=_.callback;if(typeof Kt=="function"){_.callback=null,$=_.priorityLevel;var Wt=Kt(_.expirationTime<=Dt);Dt=i.unstable_now(),typeof Wt=="function"?_.callback=Wt:_===o(nt)&&a(nt),pt(Dt)}else a(nt);_=o(nt)}if(_!==null)var zt=!0;else{var Ht=o(it);Ht!==null&&Ot(mt,Ht.startTime-Dt),zt=!1}return zt}finally{_=null,$=Bt,et=!1}}var dt=!1,St=null,xt=-1,yt=5,_t=-1;function Ct(){return!(i.unstable_now()-_tMt||125Kt?(Mt.sortIndex=Bt,s(it,Mt),o(nt)===null&&Mt===o(it)&&(lt?(ht(xt),xt=-1):lt=!0,Ot(mt,Bt-Kt))):(Mt.sortIndex=Wt,s(nt,Mt),st||et||(st=!0,It(gt))),Mt},i.unstable_shouldYield=Ct,i.unstable_wrapCallback=function(Mt){var Dt=$;return function(){var Bt=$;$=Dt;try{return Mt.apply(this,arguments)}finally{$=Bt}}}})(scheduler_production_min);scheduler.exports=scheduler_production_min;var schedulerExports=scheduler.exports;/** * @license React * react-dom.production.min.js * @@ -316,16 +316,16 @@ function _mergeNamespaces(i,s){for(var o=0;o"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ja=Object.prototype.hasOwnProperty,ka=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,la={},ma={};function oa(i){return ja.call(ma,i)?!0:ja.call(la,i)?!1:ka.test(i)?ma[i]=!0:(la[i]=!0,!1)}function pa(i,s,o,a){if(o!==null&&o.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return a?!1:o!==null?!o.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function qa(i,s,o,a){if(s===null||typeof s>"u"||pa(i,s,o,a))return!0;if(a)return!1;if(o!==null)switch(o.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function v$1(i,s,o,a,rt,et,ot){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=a,this.attributeNamespace=rt,this.mustUseProperty=o,this.propertyName=i,this.type=s,this.sanitizeURL=et,this.removeEmptyString=ot}var z={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){z[i]=new v$1(i,0,!1,i,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var s=i[0];z[s]=new v$1(s,1,!1,i[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(i){z[i]=new v$1(i,2,!1,i.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){z[i]=new v$1(i,2,!1,i,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){z[i]=new v$1(i,3,!1,i.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(i){z[i]=new v$1(i,3,!0,i,null,!1,!1)});["capture","download"].forEach(function(i){z[i]=new v$1(i,4,!1,i,null,!1,!1)});["cols","rows","size","span"].forEach(function(i){z[i]=new v$1(i,6,!1,i,null,!1,!1)});["rowSpan","start"].forEach(function(i){z[i]=new v$1(i,5,!1,i.toLowerCase(),null,!1,!1)});var ra=/[\-:]([a-z])/g;function sa(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var s=i.replace(ra,sa);z[s]=new v$1(s,1,!1,i,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var s=i.replace(ra,sa);z[s]=new v$1(s,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(i){var s=i.replace(ra,sa);z[s]=new v$1(s,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(i){z[i]=new v$1(i,1,!1,i.toLowerCase(),null,!1,!1)});z.xlinkHref=new v$1("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(i){z[i]=new v$1(i,1,!1,i.toLowerCase(),null,!0,!0)});function ta(i,s,o,a){var rt=z.hasOwnProperty(s)?z[s]:null;(rt!==null?rt.type!==0:a||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ja=Object.prototype.hasOwnProperty,ka=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,la={},ma={};function oa(i){return ja.call(ma,i)?!0:ja.call(la,i)?!1:ka.test(i)?ma[i]=!0:(la[i]=!0,!1)}function pa(i,s,o,a){if(o!==null&&o.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return a?!1:o!==null?!o.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function qa(i,s,o,a){if(s===null||typeof s>"u"||pa(i,s,o,a))return!0;if(a)return!1;if(o!==null)switch(o.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function v$1(i,s,o,a,rt,tt,ot){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=a,this.attributeNamespace=rt,this.mustUseProperty=o,this.propertyName=i,this.type=s,this.sanitizeURL=tt,this.removeEmptyString=ot}var z={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){z[i]=new v$1(i,0,!1,i,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var s=i[0];z[s]=new v$1(s,1,!1,i[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(i){z[i]=new v$1(i,2,!1,i.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){z[i]=new v$1(i,2,!1,i,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){z[i]=new v$1(i,3,!1,i.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(i){z[i]=new v$1(i,3,!0,i,null,!1,!1)});["capture","download"].forEach(function(i){z[i]=new v$1(i,4,!1,i,null,!1,!1)});["cols","rows","size","span"].forEach(function(i){z[i]=new v$1(i,6,!1,i,null,!1,!1)});["rowSpan","start"].forEach(function(i){z[i]=new v$1(i,5,!1,i.toLowerCase(),null,!1,!1)});var ra=/[\-:]([a-z])/g;function sa(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var s=i.replace(ra,sa);z[s]=new v$1(s,1,!1,i,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var s=i.replace(ra,sa);z[s]=new v$1(s,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(i){var s=i.replace(ra,sa);z[s]=new v$1(s,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(i){z[i]=new v$1(i,1,!1,i.toLowerCase(),null,!1,!1)});z.xlinkHref=new v$1("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(i){z[i]=new v$1(i,1,!1,i.toLowerCase(),null,!0,!0)});function ta(i,s,o,a){var rt=z.hasOwnProperty(s)?z[s]:null;(rt!==null?rt.type!==0:a||!(2at||rt[ot]!==et[at]){var nt=` -`+rt[ot].replace(" at new "," at ");return i.displayName&&nt.includes("")&&(nt=nt.replace("",i.displayName)),nt}while(1<=ot&&0<=at);break}}}finally{Na=!1,Error.prepareStackTrace=o}return(i=i?i.displayName||i.name:"")?Ma(i):""}function Pa(i){switch(i.tag){case 5:return Ma(i.type);case 16:return Ma("Lazy");case 13:return Ma("Suspense");case 19:return Ma("SuspenseList");case 0:case 2:case 15:return i=Oa(i.type,!1),i;case 11:return i=Oa(i.type.render,!1),i;case 1:return i=Oa(i.type,!0),i;default:return""}}function Qa(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case ya:return"Fragment";case wa:return"Portal";case Aa:return"Profiler";case za:return"StrictMode";case Ea:return"Suspense";case Fa:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case Ca:return(i.displayName||"Context")+".Consumer";case Ba:return(i._context.displayName||"Context")+".Provider";case Da:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case Ga:return s=i.displayName||null,s!==null?s:Qa(i.type)||"Memo";case Ha:s=i._payload,i=i._init;try{return Qa(i(s))}catch{}}return null}function Ra(i){var s=i.type;switch(i.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=s.render,i=i.displayName||i.name||"",s.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Qa(s);case 8:return s===za?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function Sa(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Ta(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Ua(i){var s=Ta(i)?"checked":"value",o=Object.getOwnPropertyDescriptor(i.constructor.prototype,s),a=""+i[s];if(!i.hasOwnProperty(s)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var rt=o.get,et=o.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return rt.call(this)},set:function(ot){a=""+ot,et.call(this,ot)}}),Object.defineProperty(i,s,{enumerable:o.enumerable}),{getValue:function(){return a},setValue:function(ot){a=""+ot},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function Va(i){i._valueTracker||(i._valueTracker=Ua(i))}function Wa(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var o=s.getValue(),a="";return i&&(a=Ta(i)?i.checked?"true":"false":i.value),i=a,i!==o?(s.setValue(i),!0):!1}function Xa(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function Ya(i,s){var o=s.checked;return A({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:o??i._wrapperState.initialChecked})}function Za(i,s){var o=s.defaultValue==null?"":s.defaultValue,a=s.checked!=null?s.checked:s.defaultChecked;o=Sa(s.value!=null?s.value:o),i._wrapperState={initialChecked:a,initialValue:o,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function ab(i,s){s=s.checked,s!=null&&ta(i,"checked",s,!1)}function bb(i,s){ab(i,s);var o=Sa(s.value),a=s.type;if(o!=null)a==="number"?(o===0&&i.value===""||i.value!=o)&&(i.value=""+o):i.value!==""+o&&(i.value=""+o);else if(a==="submit"||a==="reset"){i.removeAttribute("value");return}s.hasOwnProperty("value")?cb(i,s.type,o):s.hasOwnProperty("defaultValue")&&cb(i,s.type,Sa(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(i.defaultChecked=!!s.defaultChecked)}function db(i,s,o){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var a=s.type;if(!(a!=="submit"&&a!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+i._wrapperState.initialValue,o||s===i.value||(i.value=s),i.defaultValue=s}o=i.name,o!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,o!==""&&(i.name=o)}function cb(i,s,o){(s!=="number"||Xa(i.ownerDocument)!==i)&&(o==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+o&&(i.defaultValue=""+o))}var eb=Array.isArray;function fb(i,s,o,a){if(i=i.options,s){s={};for(var rt=0;rt"+s.valueOf().toString()+"",s=mb.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;s.firstChild;)i.appendChild(s.firstChild)}});function ob(i,s){if(s){var o=i.firstChild;if(o&&o===i.lastChild&&o.nodeType===3){o.nodeValue=s;return}}i.textContent=s}var pb={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qb=["Webkit","ms","Moz","O"];Object.keys(pb).forEach(function(i){qb.forEach(function(s){s=s+i.charAt(0).toUpperCase()+i.substring(1),pb[s]=pb[i]})});function rb(i,s,o){return s==null||typeof s=="boolean"||s===""?"":o||typeof s!="number"||s===0||pb.hasOwnProperty(i)&&pb[i]?(""+s).trim():s+"px"}function sb(i,s){i=i.style;for(var o in s)if(s.hasOwnProperty(o)){var a=o.indexOf("--")===0,rt=rb(o,s[o],a);o==="float"&&(o="cssFloat"),a?i.setProperty(o,rt):i[o]=rt}}var tb=A({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ub(i,s){if(s){if(tb[i]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(p$1(137,i));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(p$1(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(p$1(61))}if(s.style!=null&&typeof s.style!="object")throw Error(p$1(62))}}function vb(i,s){if(i.indexOf("-")===-1)return typeof s.is=="string";switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var wb=null;function xb(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var yb=null,zb=null,Ab=null;function Bb(i){if(i=Cb(i)){if(typeof yb!="function")throw Error(p$1(280));var s=i.stateNode;s&&(s=Db(s),yb(i.stateNode,i.type,s))}}function Eb(i){zb?Ab?Ab.push(i):Ab=[i]:zb=i}function Fb(){if(zb){var i=zb,s=Ab;if(Ab=zb=null,Bb(i),s)for(i=0;i>>=0,i===0?32:31-(pc(i)/qc|0)|0}var rc=64,sc=4194304;function tc(i){switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function uc(i,s){var o=i.pendingLanes;if(o===0)return 0;var a=0,rt=i.suspendedLanes,et=i.pingedLanes,ot=o&268435455;if(ot!==0){var at=ot&~rt;at!==0?a=tc(at):(et&=ot,et!==0&&(a=tc(et)))}else ot=o&~rt,ot!==0?a=tc(ot):et!==0&&(a=tc(et));if(a===0)return 0;if(s!==0&&s!==a&&!(s&rt)&&(rt=a&-a,et=s&-s,rt>=et||rt===16&&(et&4194240)!==0))return s;if(a&4&&(a|=o&16),s=i.entangledLanes,s!==0)for(i=i.entanglements,s&=a;0o;o++)s.push(i);return s}function Ac(i,s,o){i.pendingLanes|=s,s!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,s=31-oc(s),i[s]=o}function Bc(i,s){var o=i.pendingLanes&~s;i.pendingLanes=s,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=s,i.mutableReadLanes&=s,i.entangledLanes&=s,s=i.entanglements;var a=i.eventTimes;for(i=i.expirationTimes;0=be),ee=" ",fe=!1;function ge(i,s){switch(i){case"keyup":return $d.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function he(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var ie=!1;function je(i,s){switch(i){case"compositionend":return he(s);case"keypress":return s.which!==32?null:(fe=!0,ee);case"textInput":return i=s.data,i===ee&&fe?null:i;default:return null}}function ke(i,s){if(ie)return i==="compositionend"||!ae&&ge(i,s)?(i=nd(),md=ld=kd=null,ie=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1=s)return{node:o,offset:s-i};i=a}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=Je(o)}}function Le(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?Le(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function Me(){for(var i=window,s=Xa();s instanceof i.HTMLIFrameElement;){try{var o=typeof s.contentWindow.location.href=="string"}catch{o=!1}if(o)i=s.contentWindow;else break;s=Xa(i.document)}return s}function Ne(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}function Oe(i){var s=Me(),o=i.focusedElem,a=i.selectionRange;if(s!==o&&o&&o.ownerDocument&&Le(o.ownerDocument.documentElement,o)){if(a!==null&&Ne(o)){if(s=a.start,i=a.end,i===void 0&&(i=s),"selectionStart"in o)o.selectionStart=s,o.selectionEnd=Math.min(i,o.value.length);else if(i=(s=o.ownerDocument||document)&&s.defaultView||window,i.getSelection){i=i.getSelection();var rt=o.textContent.length,et=Math.min(a.start,rt);a=a.end===void 0?et:Math.min(a.end,rt),!i.extend&&et>a&&(rt=a,a=et,et=rt),rt=Ke(o,et);var ot=Ke(o,a);rt&&ot&&(i.rangeCount!==1||i.anchorNode!==rt.node||i.anchorOffset!==rt.offset||i.focusNode!==ot.node||i.focusOffset!==ot.offset)&&(s=s.createRange(),s.setStart(rt.node,rt.offset),i.removeAllRanges(),et>a?(i.addRange(s),i.extend(ot.node,ot.offset)):(s.setEnd(ot.node,ot.offset),i.addRange(s)))}}for(s=[],i=o;i=i.parentNode;)i.nodeType===1&&s.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o=document.documentMode,Qe=null,Re=null,Se=null,Te=!1;function Ue(i,s,o){var a=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Te||Qe==null||Qe!==Xa(a)||(a=Qe,"selectionStart"in a&&Ne(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Se&&Ie(Se,a)||(Se=a,a=oe(Re,"onSelect"),0Tf||(i.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G(i,s){Tf++,Sf[Tf]=i.current,i.current=s}var Vf={},H=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(i,s){var o=i.type.contextTypes;if(!o)return Vf;var a=i.stateNode;if(a&&a.__reactInternalMemoizedUnmaskedChildContext===s)return a.__reactInternalMemoizedMaskedChildContext;var rt={},et;for(et in o)rt[et]=s[et];return a&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=s,i.__reactInternalMemoizedMaskedChildContext=rt),rt}function Zf(i){return i=i.childContextTypes,i!=null}function $f(){E(Wf),E(H)}function ag(i,s,o){if(H.current!==Vf)throw Error(p$1(168));G(H,s),G(Wf,o)}function bg(i,s,o){var a=i.stateNode;if(s=s.childContextTypes,typeof a.getChildContext!="function")return o;a=a.getChildContext();for(var rt in a)if(!(rt in s))throw Error(p$1(108,Ra(i)||"Unknown",rt));return A({},o,a)}function cg(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Vf,Xf=H.current,G(H,i),G(Wf,Wf.current),!0}function dg(i,s,o){var a=i.stateNode;if(!a)throw Error(p$1(169));o?(i=bg(i,s,Xf),a.__reactInternalMemoizedMergedChildContext=i,E(Wf),E(H),G(H,i)):E(Wf),G(Wf,o)}var eg=null,fg=!1,gg=!1;function hg(i){eg===null?eg=[i]:eg.push(i)}function ig(i){fg=!0,hg(i)}function jg(){if(!gg&&eg!==null){gg=!0;var i=0,s=C;try{var o=eg;for(C=1;i>=ot,rt-=ot,rg=1<<32-oc(s)+rt|o<xt?(yt=St,St=null):yt=St.sibling;var _t=$(ht,St,pt[xt],mt);if(_t===null){St===null&&(St=yt);break}i&&St&&_t.alternate===null&&s(ht,St),ut=et(_t,ut,xt),dt===null?gt=_t:dt.sibling=_t,dt=_t,St=yt}if(xt===pt.length)return o(ht,St),I&&tg(ht,xt),gt;if(St===null){for(;xtxt?(yt=St,St=null):yt=St.sibling;var Ct=$(ht,St,_t.value,mt);if(Ct===null){St===null&&(St=yt);break}i&&St&&Ct.alternate===null&&s(ht,St),ut=et(Ct,ut,xt),dt===null?gt=Ct:dt.sibling=Ct,dt=Ct,St=yt}if(_t.done)return o(ht,St),I&&tg(ht,xt),gt;if(St===null){for(;!_t.done;xt++,_t=pt.next())_t=_(ht,_t.value,mt),_t!==null&&(ut=et(_t,ut,xt),dt===null?gt=_t:dt.sibling=_t,dt=_t);return I&&tg(ht,xt),gt}for(St=a(ht,St);!_t.done;xt++,_t=pt.next())_t=tt(St,ht,xt,_t.value,mt),_t!==null&&(i&&_t.alternate!==null&&St.delete(_t.key===null?xt:_t.key),ut=et(_t,ut,xt),dt===null?gt=_t:dt.sibling=_t,dt=_t);return i&&St.forEach(function(Et){return s(ht,Et)}),I&&tg(ht,xt),gt}function ct(ht,ut,pt,mt){if(typeof pt=="object"&&pt!==null&&pt.type===ya&&pt.key===null&&(pt=pt.props.children),typeof pt=="object"&&pt!==null){switch(pt.$$typeof){case va:e:{for(var gt=pt.key,dt=ut;dt!==null;){if(dt.key===gt){if(gt=pt.type,gt===ya){if(dt.tag===7){o(ht,dt.sibling),ut=rt(dt,pt.props.children),ut.return=ht,ht=ut;break e}}else if(dt.elementType===gt||typeof gt=="object"&>!==null&>.$$typeof===Ha&&Ng(gt)===dt.type){o(ht,dt.sibling),ut=rt(dt,pt.props),ut.ref=Lg(ht,dt,pt),ut.return=ht,ht=ut;break e}o(ht,dt);break}else s(ht,dt);dt=dt.sibling}pt.type===ya?(ut=Tg(pt.props.children,ht.mode,mt,pt.key),ut.return=ht,ht=ut):(mt=Rg(pt.type,pt.key,pt.props,null,ht.mode,mt),mt.ref=Lg(ht,ut,pt),mt.return=ht,ht=mt)}return ot(ht);case wa:e:{for(dt=pt.key;ut!==null;){if(ut.key===dt)if(ut.tag===4&&ut.stateNode.containerInfo===pt.containerInfo&&ut.stateNode.implementation===pt.implementation){o(ht,ut.sibling),ut=rt(ut,pt.children||[]),ut.return=ht,ht=ut;break e}else{o(ht,ut);break}else s(ht,ut);ut=ut.sibling}ut=Sg(pt,ht.mode,mt),ut.return=ht,ht=ut}return ot(ht);case Ha:return dt=pt._init,ct(ht,ut,dt(pt._payload),mt)}if(eb(pt))return st(ht,ut,pt,mt);if(Ka(pt))return lt(ht,ut,pt,mt);Mg(ht,pt)}return typeof pt=="string"&&pt!==""||typeof pt=="number"?(pt=""+pt,ut!==null&&ut.tag===6?(o(ht,ut.sibling),ut=rt(ut,pt),ut.return=ht,ht=ut):(o(ht,ut),ut=Qg(pt,ht.mode,mt),ut.return=ht,ht=ut),ot(ht)):o(ht,ut)}return ct}var Ug=Og(!0),Vg=Og(!1),Wg=Uf(null),Xg=null,Yg=null,Zg=null;function $g(){Zg=Yg=Xg=null}function ah(i){var s=Wg.current;E(Wg),i._currentValue=s}function bh(i,s,o){for(;i!==null;){var a=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,a!==null&&(a.childLanes|=s)):a!==null&&(a.childLanes&s)!==s&&(a.childLanes|=s),i===o)break;i=i.return}}function ch(i,s){Xg=i,Zg=Yg=null,i=i.dependencies,i!==null&&i.firstContext!==null&&(i.lanes&s&&(dh=!0),i.firstContext=null)}function eh(i){var s=i._currentValue;if(Zg!==i)if(i={context:i,memoizedValue:s,next:null},Yg===null){if(Xg===null)throw Error(p$1(308));Yg=i,Xg.dependencies={lanes:0,firstContext:i}}else Yg=Yg.next=i;return s}var fh=null;function gh(i){fh===null?fh=[i]:fh.push(i)}function hh(i,s,o,a){var rt=s.interleaved;return rt===null?(o.next=o,gh(s)):(o.next=rt.next,rt.next=o),s.interleaved=o,ih(i,a)}function ih(i,s){i.lanes|=s;var o=i.alternate;for(o!==null&&(o.lanes|=s),o=i,i=i.return;i!==null;)i.childLanes|=s,o=i.alternate,o!==null&&(o.childLanes|=s),o=i,i=i.return;return o.tag===3?o.stateNode:null}var jh=!1;function kh(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function lh(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function mh(i,s){return{eventTime:i,lane:s,tag:0,payload:null,callback:null,next:null}}function nh(i,s,o){var a=i.updateQueue;if(a===null)return null;if(a=a.shared,K&2){var rt=a.pending;return rt===null?s.next=s:(s.next=rt.next,rt.next=s),a.pending=s,ih(i,o)}return rt=a.interleaved,rt===null?(s.next=s,gh(a)):(s.next=rt.next,rt.next=s),a.interleaved=s,ih(i,o)}function oh(i,s,o){if(s=s.updateQueue,s!==null&&(s=s.shared,(o&4194240)!==0)){var a=s.lanes;a&=i.pendingLanes,o|=a,s.lanes=o,Cc(i,o)}}function ph(i,s){var o=i.updateQueue,a=i.alternate;if(a!==null&&(a=a.updateQueue,o===a)){var rt=null,et=null;if(o=o.firstBaseUpdate,o!==null){do{var ot={eventTime:o.eventTime,lane:o.lane,tag:o.tag,payload:o.payload,callback:o.callback,next:null};et===null?rt=et=ot:et=et.next=ot,o=o.next}while(o!==null);et===null?rt=et=s:et=et.next=s}else rt=et=s;o={baseState:a.baseState,firstBaseUpdate:rt,lastBaseUpdate:et,shared:a.shared,effects:a.effects},i.updateQueue=o;return}i=o.lastBaseUpdate,i===null?o.firstBaseUpdate=s:i.next=s,o.lastBaseUpdate=s}function qh(i,s,o,a){var rt=i.updateQueue;jh=!1;var et=rt.firstBaseUpdate,ot=rt.lastBaseUpdate,at=rt.shared.pending;if(at!==null){rt.shared.pending=null;var nt=at,it=nt.next;nt.next=null,ot===null?et=it:ot.next=it,ot=nt;var j=i.alternate;j!==null&&(j=j.updateQueue,at=j.lastBaseUpdate,at!==ot&&(at===null?j.firstBaseUpdate=it:at.next=it,j.lastBaseUpdate=nt))}if(et!==null){var _=rt.baseState;ot=0,j=it=nt=null,at=et;do{var $=at.lane,tt=at.eventTime;if((a&$)===$){j!==null&&(j=j.next={eventTime:tt,lane:0,tag:at.tag,payload:at.payload,callback:at.callback,next:null});e:{var st=i,lt=at;switch($=s,tt=o,lt.tag){case 1:if(st=lt.payload,typeof st=="function"){_=st.call(tt,_,$);break e}_=st;break e;case 3:st.flags=st.flags&-65537|128;case 0:if(st=lt.payload,$=typeof st=="function"?st.call(tt,_,$):st,$==null)break e;_=A({},_,$);break e;case 2:jh=!0}}at.callback!==null&&at.lane!==0&&(i.flags|=64,$=rt.effects,$===null?rt.effects=[at]:$.push(at))}else tt={eventTime:tt,lane:$,tag:at.tag,payload:at.payload,callback:at.callback,next:null},j===null?(it=j=tt,nt=_):j=j.next=tt,ot|=$;if(at=at.next,at===null){if(at=rt.shared.pending,at===null)break;$=at,at=$.next,$.next=null,rt.lastBaseUpdate=$,rt.shared.pending=null}}while(!0);if(j===null&&(nt=_),rt.baseState=nt,rt.firstBaseUpdate=it,rt.lastBaseUpdate=j,s=rt.shared.interleaved,s!==null){rt=s;do ot|=rt.lane,rt=rt.next;while(rt!==s)}else et===null&&(rt.shared.lanes=0);rh|=ot,i.lanes=ot,i.memoizedState=_}}function sh(i,s,o){if(i=s.effects,s.effects=null,i!==null)for(s=0;so?o:4,i(!0);var a=Gh.transition;Gh.transition={};try{i(!1),s()}finally{C=o,Gh.transition=a}}function wi(){return Uh().memoizedState}function xi(i,s,o){var a=yi(i);if(o={lane:a,action:o,hasEagerState:!1,eagerState:null,next:null},zi(i))Ai(s,o);else if(o=hh(i,s,o,a),o!==null){var rt=R();gi(o,i,a,rt),Bi(o,s,a)}}function ii(i,s,o){var a=yi(i),rt={lane:a,action:o,hasEagerState:!1,eagerState:null,next:null};if(zi(i))Ai(s,rt);else{var et=i.alternate;if(i.lanes===0&&(et===null||et.lanes===0)&&(et=s.lastRenderedReducer,et!==null))try{var ot=s.lastRenderedState,at=et(ot,o);if(rt.hasEagerState=!0,rt.eagerState=at,He(at,ot)){var nt=s.interleaved;nt===null?(rt.next=rt,gh(s)):(rt.next=nt.next,nt.next=rt),s.interleaved=rt;return}}catch{}finally{}o=hh(i,s,rt,a),o!==null&&(rt=R(),gi(o,i,a,rt),Bi(o,s,a))}}function zi(i){var s=i.alternate;return i===M||s!==null&&s===M}function Ai(i,s){Jh=Ih=!0;var o=i.pending;o===null?s.next=s:(s.next=o.next,o.next=s),i.pending=s}function Bi(i,s,o){if(o&4194240){var a=s.lanes;a&=i.pendingLanes,o|=a,s.lanes=o,Cc(i,o)}}var Rh={readContext:eh,useCallback:P,useContext:P,useEffect:P,useImperativeHandle:P,useInsertionEffect:P,useLayoutEffect:P,useMemo:P,useReducer:P,useRef:P,useState:P,useDebugValue:P,useDeferredValue:P,useTransition:P,useMutableSource:P,useSyncExternalStore:P,useId:P,unstable_isNewReconciler:!1},Oh={readContext:eh,useCallback:function(i,s){return Th().memoizedState=[i,s===void 0?null:s],i},useContext:eh,useEffect:mi,useImperativeHandle:function(i,s,o){return o=o!=null?o.concat([i]):null,ki(4194308,4,pi.bind(null,s,i),o)},useLayoutEffect:function(i,s){return ki(4194308,4,i,s)},useInsertionEffect:function(i,s){return ki(4,2,i,s)},useMemo:function(i,s){var o=Th();return s=s===void 0?null:s,i=i(),o.memoizedState=[i,s],i},useReducer:function(i,s,o){var a=Th();return s=o!==void 0?o(s):s,a.memoizedState=a.baseState=s,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:s},a.queue=i,i=i.dispatch=xi.bind(null,M,i),[a.memoizedState,i]},useRef:function(i){var s=Th();return i={current:i},s.memoizedState=i},useState:hi,useDebugValue:ri,useDeferredValue:function(i){return Th().memoizedState=i},useTransition:function(){var i=hi(!1),s=i[0];return i=vi.bind(null,i[1]),Th().memoizedState=i,[s,i]},useMutableSource:function(){},useSyncExternalStore:function(i,s,o){var a=M,rt=Th();if(I){if(o===void 0)throw Error(p$1(407));o=o()}else{if(o=s(),Q===null)throw Error(p$1(349));Hh&30||di(a,s,o)}rt.memoizedState=o;var et={value:o,getSnapshot:s};return rt.queue=et,mi(ai.bind(null,a,et,i),[i]),a.flags|=2048,bi(9,ci.bind(null,a,et,o,s),void 0,null),o},useId:function(){var i=Th(),s=Q.identifierPrefix;if(I){var o=sg,a=rg;o=(a&~(1<<32-oc(a)-1)).toString(32)+o,s=":"+s+"R"+o,o=Kh++,0<\/script>",i=i.removeChild(i.firstChild)):typeof a.is=="string"?i=ot.createElement(o,{is:a.is}):(i=ot.createElement(o),o==="select"&&(ot=i,a.multiple?ot.multiple=!0:a.size&&(ot.size=a.size))):i=ot.createElementNS(i,o),i[Of]=s,i[Pf]=a,zj(i,s,!1,!1),s.stateNode=i;e:{switch(ot=vb(o,a),o){case"dialog":D("cancel",i),D("close",i),rt=a;break;case"iframe":case"object":case"embed":D("load",i),rt=a;break;case"video":case"audio":for(rt=0;rtGj&&(s.flags|=128,a=!0,Dj(et,!1),s.lanes=4194304)}else{if(!a)if(i=Ch(ot),i!==null){if(s.flags|=128,a=!0,o=i.updateQueue,o!==null&&(s.updateQueue=o,s.flags|=4),Dj(et,!0),et.tail===null&&et.tailMode==="hidden"&&!ot.alternate&&!I)return S(s),null}else 2*B()-et.renderingStartTime>Gj&&o!==1073741824&&(s.flags|=128,a=!0,Dj(et,!1),s.lanes=4194304);et.isBackwards?(ot.sibling=s.child,s.child=ot):(o=et.last,o!==null?o.sibling=ot:s.child=ot,et.last=ot)}return et.tail!==null?(s=et.tail,et.rendering=s,et.tail=s.sibling,et.renderingStartTime=B(),s.sibling=null,o=L.current,G(L,a?o&1|2:o&1),s):(S(s),null);case 22:case 23:return Hj(),a=s.memoizedState!==null,i!==null&&i.memoizedState!==null!==a&&(s.flags|=8192),a&&s.mode&1?fj&1073741824&&(S(s),s.subtreeFlags&6&&(s.flags|=8192)):S(s),null;case 24:return null;case 25:return null}throw Error(p$1(156,s.tag))}function Ij(i,s){switch(wg(s),s.tag){case 1:return Zf(s.type)&&$f(),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return zh(),E(Wf),E(H),Eh(),i=s.flags,i&65536&&!(i&128)?(s.flags=i&-65537|128,s):null;case 5:return Bh(s),null;case 13:if(E(L),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(p$1(340));Ig()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return E(L),null;case 4:return zh(),null;case 10:return ah(s.type._context),null;case 22:case 23:return Hj(),null;case 24:return null;default:return null}}var Jj=!1,U=!1,Kj=typeof WeakSet=="function"?WeakSet:Set,V=null;function Lj(i,s){var o=i.ref;if(o!==null)if(typeof o=="function")try{o(null)}catch(a){W(i,s,a)}else o.current=null}function Mj(i,s,o){try{o()}catch(a){W(i,s,a)}}var Nj=!1;function Oj(i,s){if(Cf=dd,i=Me(),Ne(i)){if("selectionStart"in i)var o={start:i.selectionStart,end:i.selectionEnd};else e:{o=(o=i.ownerDocument)&&o.defaultView||window;var a=o.getSelection&&o.getSelection();if(a&&a.rangeCount!==0){o=a.anchorNode;var rt=a.anchorOffset,et=a.focusNode;a=a.focusOffset;try{o.nodeType,et.nodeType}catch{o=null;break e}var ot=0,at=-1,nt=-1,it=0,j=0,_=i,$=null;t:for(;;){for(var tt;_!==o||rt!==0&&_.nodeType!==3||(at=ot+rt),_!==et||a!==0&&_.nodeType!==3||(nt=ot+a),_.nodeType===3&&(ot+=_.nodeValue.length),(tt=_.firstChild)!==null;)$=_,_=tt;for(;;){if(_===i)break t;if($===o&&++it===rt&&(at=ot),$===et&&++j===a&&(nt=ot),(tt=_.nextSibling)!==null)break;_=$,$=_.parentNode}_=tt}o=at===-1||nt===-1?null:{start:at,end:nt}}else o=null}o=o||{start:0,end:0}}else o=null;for(Df={focusedElem:i,selectionRange:o},dd=!1,V=s;V!==null;)if(s=V,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,V=i;else for(;V!==null;){s=V;try{var st=s.alternate;if(s.flags&1024)switch(s.tag){case 0:case 11:case 15:break;case 1:if(st!==null){var lt=st.memoizedProps,ct=st.memoizedState,ht=s.stateNode,ut=ht.getSnapshotBeforeUpdate(s.elementType===s.type?lt:Ci(s.type,lt),ct);ht.__reactInternalSnapshotBeforeUpdate=ut}break;case 3:var pt=s.stateNode.containerInfo;pt.nodeType===1?pt.textContent="":pt.nodeType===9&&pt.documentElement&&pt.removeChild(pt.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p$1(163))}}catch(mt){W(s,s.return,mt)}if(i=s.sibling,i!==null){i.return=s.return,V=i;break}V=s.return}return st=Nj,Nj=!1,st}function Pj(i,s,o){var a=s.updateQueue;if(a=a!==null?a.lastEffect:null,a!==null){var rt=a=a.next;do{if((rt.tag&i)===i){var et=rt.destroy;rt.destroy=void 0,et!==void 0&&Mj(s,o,et)}rt=rt.next}while(rt!==a)}}function Qj(i,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var o=s=s.next;do{if((o.tag&i)===i){var a=o.create;o.destroy=a()}o=o.next}while(o!==s)}}function Rj(i){var s=i.ref;if(s!==null){var o=i.stateNode;switch(i.tag){case 5:i=o;break;default:i=o}typeof s=="function"?s(i):s.current=i}}function Sj(i){var s=i.alternate;s!==null&&(i.alternate=null,Sj(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&(delete s[Of],delete s[Pf],delete s[of],delete s[Qf],delete s[Rf])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function Tj(i){return i.tag===5||i.tag===3||i.tag===4}function Uj(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Tj(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Vj(i,s,o){var a=i.tag;if(a===5||a===6)i=i.stateNode,s?o.nodeType===8?o.parentNode.insertBefore(i,s):o.insertBefore(i,s):(o.nodeType===8?(s=o.parentNode,s.insertBefore(i,o)):(s=o,s.appendChild(i)),o=o._reactRootContainer,o!=null||s.onclick!==null||(s.onclick=Bf));else if(a!==4&&(i=i.child,i!==null))for(Vj(i,s,o),i=i.sibling;i!==null;)Vj(i,s,o),i=i.sibling}function Wj(i,s,o){var a=i.tag;if(a===5||a===6)i=i.stateNode,s?o.insertBefore(i,s):o.appendChild(i);else if(a!==4&&(i=i.child,i!==null))for(Wj(i,s,o),i=i.sibling;i!==null;)Wj(i,s,o),i=i.sibling}var X=null,Xj=!1;function Yj(i,s,o){for(o=o.child;o!==null;)Zj(i,s,o),o=o.sibling}function Zj(i,s,o){if(lc&&typeof lc.onCommitFiberUnmount=="function")try{lc.onCommitFiberUnmount(kc,o)}catch{}switch(o.tag){case 5:U||Lj(o,s);case 6:var a=X,rt=Xj;X=null,Yj(i,s,o),X=a,Xj=rt,X!==null&&(Xj?(i=X,o=o.stateNode,i.nodeType===8?i.parentNode.removeChild(o):i.removeChild(o)):X.removeChild(o.stateNode));break;case 18:X!==null&&(Xj?(i=X,o=o.stateNode,i.nodeType===8?Kf(i.parentNode,o):i.nodeType===1&&Kf(i,o),bd(i)):Kf(X,o.stateNode));break;case 4:a=X,rt=Xj,X=o.stateNode.containerInfo,Xj=!0,Yj(i,s,o),X=a,Xj=rt;break;case 0:case 11:case 14:case 15:if(!U&&(a=o.updateQueue,a!==null&&(a=a.lastEffect,a!==null))){rt=a=a.next;do{var et=rt,ot=et.destroy;et=et.tag,ot!==void 0&&(et&2||et&4)&&Mj(o,s,ot),rt=rt.next}while(rt!==a)}Yj(i,s,o);break;case 1:if(!U&&(Lj(o,s),a=o.stateNode,typeof a.componentWillUnmount=="function"))try{a.props=o.memoizedProps,a.state=o.memoizedState,a.componentWillUnmount()}catch(at){W(o,s,at)}Yj(i,s,o);break;case 21:Yj(i,s,o);break;case 22:o.mode&1?(U=(a=U)||o.memoizedState!==null,Yj(i,s,o),U=a):Yj(i,s,o);break;default:Yj(i,s,o)}}function ak(i){var s=i.updateQueue;if(s!==null){i.updateQueue=null;var o=i.stateNode;o===null&&(o=i.stateNode=new Kj),s.forEach(function(a){var rt=bk.bind(null,i,a);o.has(a)||(o.add(a),a.then(rt,rt))})}}function ck(i,s){var o=s.deletions;if(o!==null)for(var a=0;art&&(rt=ot),a&=~et}if(a=rt,a=B()-a,a=(120>a?120:480>a?480:1080>a?1080:1920>a?1920:3e3>a?3e3:4320>a?4320:1960*lk(a/1960))-a,10i?16:i,wk===null)var a=!1;else{if(i=wk,wk=null,xk=0,K&6)throw Error(p$1(331));var rt=K;for(K|=4,V=i.current;V!==null;){var et=V,ot=et.child;if(V.flags&16){var at=et.deletions;if(at!==null){for(var nt=0;ntB()-fk?Kk(i,0):rk|=o),Dk(i,s)}function Yk(i,s){s===0&&(i.mode&1?(s=sc,sc<<=1,!(sc&130023424)&&(sc=4194304)):s=1);var o=R();i=ih(i,s),i!==null&&(Ac(i,s,o),Dk(i,o))}function uj(i){var s=i.memoizedState,o=0;s!==null&&(o=s.retryLane),Yk(i,o)}function bk(i,s){var o=0;switch(i.tag){case 13:var a=i.stateNode,rt=i.memoizedState;rt!==null&&(o=rt.retryLane);break;case 19:a=i.stateNode;break;default:throw Error(p$1(314))}a!==null&&a.delete(s),Yk(i,o)}var Vk;Vk=function(i,s,o){if(i!==null)if(i.memoizedProps!==s.pendingProps||Wf.current)dh=!0;else{if(!(i.lanes&o)&&!(s.flags&128))return dh=!1,yj(i,s,o);dh=!!(i.flags&131072)}else dh=!1,I&&s.flags&1048576&&ug(s,ng,s.index);switch(s.lanes=0,s.tag){case 2:var a=s.type;ij(i,s),i=s.pendingProps;var rt=Yf(s,H.current);ch(s,o),rt=Nh(null,s,a,i,rt,o);var et=Sh();return s.flags|=1,typeof rt=="object"&&rt!==null&&typeof rt.render=="function"&&rt.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,Zf(a)?(et=!0,cg(s)):et=!1,s.memoizedState=rt.state!==null&&rt.state!==void 0?rt.state:null,kh(s),rt.updater=Ei,s.stateNode=rt,rt._reactInternals=s,Ii(s,a,i,o),s=jj(null,s,a,!0,et,o)):(s.tag=0,I&&et&&vg(s),Xi(null,s,rt,o),s=s.child),s;case 16:a=s.elementType;e:{switch(ij(i,s),i=s.pendingProps,rt=a._init,a=rt(a._payload),s.type=a,rt=s.tag=Zk(a),i=Ci(a,i),rt){case 0:s=cj(null,s,a,i,o);break e;case 1:s=hj(null,s,a,i,o);break e;case 11:s=Yi(null,s,a,i,o);break e;case 14:s=$i(null,s,a,Ci(a.type,i),o);break e}throw Error(p$1(306,a,""))}return s;case 0:return a=s.type,rt=s.pendingProps,rt=s.elementType===a?rt:Ci(a,rt),cj(i,s,a,rt,o);case 1:return a=s.type,rt=s.pendingProps,rt=s.elementType===a?rt:Ci(a,rt),hj(i,s,a,rt,o);case 3:e:{if(kj(s),i===null)throw Error(p$1(387));a=s.pendingProps,et=s.memoizedState,rt=et.element,lh(i,s),qh(s,a,null,o);var ot=s.memoizedState;if(a=ot.element,et.isDehydrated)if(et={element:a,isDehydrated:!1,cache:ot.cache,pendingSuspenseBoundaries:ot.pendingSuspenseBoundaries,transitions:ot.transitions},s.updateQueue.baseState=et,s.memoizedState=et,s.flags&256){rt=Ji(Error(p$1(423)),s),s=lj(i,s,a,o,rt);break e}else if(a!==rt){rt=Ji(Error(p$1(424)),s),s=lj(i,s,a,o,rt);break e}else for(yg=Lf(s.stateNode.containerInfo.firstChild),xg=s,I=!0,zg=null,o=Vg(s,null,a,o),s.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(Ig(),a===rt){s=Zi(i,s,o);break e}Xi(i,s,a,o)}s=s.child}return s;case 5:return Ah(s),i===null&&Eg(s),a=s.type,rt=s.pendingProps,et=i!==null?i.memoizedProps:null,ot=rt.children,Ef(a,rt)?ot=null:et!==null&&Ef(a,et)&&(s.flags|=32),gj(i,s),Xi(i,s,ot,o),s.child;case 6:return i===null&&Eg(s),null;case 13:return oj(i,s,o);case 4:return yh(s,s.stateNode.containerInfo),a=s.pendingProps,i===null?s.child=Ug(s,null,a,o):Xi(i,s,a,o),s.child;case 11:return a=s.type,rt=s.pendingProps,rt=s.elementType===a?rt:Ci(a,rt),Yi(i,s,a,rt,o);case 7:return Xi(i,s,s.pendingProps,o),s.child;case 8:return Xi(i,s,s.pendingProps.children,o),s.child;case 12:return Xi(i,s,s.pendingProps.children,o),s.child;case 10:e:{if(a=s.type._context,rt=s.pendingProps,et=s.memoizedProps,ot=rt.value,G(Wg,a._currentValue),a._currentValue=ot,et!==null)if(He(et.value,ot)){if(et.children===rt.children&&!Wf.current){s=Zi(i,s,o);break e}}else for(et=s.child,et!==null&&(et.return=s);et!==null;){var at=et.dependencies;if(at!==null){ot=et.child;for(var nt=at.firstContext;nt!==null;){if(nt.context===a){if(et.tag===1){nt=mh(-1,o&-o),nt.tag=2;var it=et.updateQueue;if(it!==null){it=it.shared;var j=it.pending;j===null?nt.next=nt:(nt.next=j.next,j.next=nt),it.pending=nt}}et.lanes|=o,nt=et.alternate,nt!==null&&(nt.lanes|=o),bh(et.return,o,s),at.lanes|=o;break}nt=nt.next}}else if(et.tag===10)ot=et.type===s.type?null:et.child;else if(et.tag===18){if(ot=et.return,ot===null)throw Error(p$1(341));ot.lanes|=o,at=ot.alternate,at!==null&&(at.lanes|=o),bh(ot,o,s),ot=et.sibling}else ot=et.child;if(ot!==null)ot.return=et;else for(ot=et;ot!==null;){if(ot===s){ot=null;break}if(et=ot.sibling,et!==null){et.return=ot.return,ot=et;break}ot=ot.return}et=ot}Xi(i,s,rt.children,o),s=s.child}return s;case 9:return rt=s.type,a=s.pendingProps.children,ch(s,o),rt=eh(rt),a=a(rt),s.flags|=1,Xi(i,s,a,o),s.child;case 14:return a=s.type,rt=Ci(a,s.pendingProps),rt=Ci(a.type,rt),$i(i,s,a,rt,o);case 15:return bj(i,s,s.type,s.pendingProps,o);case 17:return a=s.type,rt=s.pendingProps,rt=s.elementType===a?rt:Ci(a,rt),ij(i,s),s.tag=1,Zf(a)?(i=!0,cg(s)):i=!1,ch(s,o),Gi(s,a,rt),Ii(s,a,rt,o),jj(null,s,a,!0,i,o);case 19:return xj(i,s,o);case 22:return dj(i,s,o)}throw Error(p$1(156,s.tag))};function Fk(i,s){return ac(i,s)}function $k(i,s,o,a){this.tag=i,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bg(i,s,o,a){return new $k(i,s,o,a)}function aj(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Zk(i){if(typeof i=="function")return aj(i)?1:0;if(i!=null){if(i=i.$$typeof,i===Da)return 11;if(i===Ga)return 14}return 2}function Pg(i,s){var o=i.alternate;return o===null?(o=Bg(i.tag,s,i.key,i.mode),o.elementType=i.elementType,o.type=i.type,o.stateNode=i.stateNode,o.alternate=i,i.alternate=o):(o.pendingProps=s,o.type=i.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=i.flags&14680064,o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,s=i.dependencies,o.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},o.sibling=i.sibling,o.index=i.index,o.ref=i.ref,o}function Rg(i,s,o,a,rt,et){var ot=2;if(a=i,typeof i=="function")aj(i)&&(ot=1);else if(typeof i=="string")ot=5;else e:switch(i){case ya:return Tg(o.children,rt,et,s);case za:ot=8,rt|=8;break;case Aa:return i=Bg(12,o,s,rt|2),i.elementType=Aa,i.lanes=et,i;case Ea:return i=Bg(13,o,s,rt),i.elementType=Ea,i.lanes=et,i;case Fa:return i=Bg(19,o,s,rt),i.elementType=Fa,i.lanes=et,i;case Ia:return pj(o,rt,et,s);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case Ba:ot=10;break e;case Ca:ot=9;break e;case Da:ot=11;break e;case Ga:ot=14;break e;case Ha:ot=16,a=null;break e}throw Error(p$1(130,i==null?i:typeof i,""))}return s=Bg(ot,o,s,rt),s.elementType=i,s.type=a,s.lanes=et,s}function Tg(i,s,o,a){return i=Bg(7,i,a,s),i.lanes=o,i}function pj(i,s,o,a){return i=Bg(22,i,a,s),i.elementType=Ia,i.lanes=o,i.stateNode={isHidden:!1},i}function Qg(i,s,o){return i=Bg(6,i,null,s),i.lanes=o,i}function Sg(i,s,o){return s=Bg(4,i.children!==null?i.children:[],i.key,s),s.lanes=o,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}function al(i,s,o,a,rt){this.tag=s,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zc(0),this.expirationTimes=zc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zc(0),this.identifierPrefix=a,this.onRecoverableError=rt,this.mutableSourceEagerHydrationData=null}function bl(i,s,o,a,rt,et,ot,at,nt){return i=new al(i,s,o,at,nt),s===1?(s=1,et===!0&&(s|=8)):s=0,et=Bg(3,null,null,s),i.current=et,et.stateNode=i,et.memoizedState={element:a,isDehydrated:o,cache:null,transitions:null,pendingSuspenseBoundaries:null},kh(et),i}function cl(i,s,o){var a=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE)}catch(i){console.error(i)}}checkDCE(),reactDom.exports=reactDom_production_min;var reactDomExports=reactDom.exports,[PortalContextProvider,usePortalContext]=createContext$2({strict:!1,name:"PortalContext"}),PORTAL_CLASSNAME="chakra-portal",PORTAL_SELECTOR=".chakra-portal",Container=i=>jsxRuntimeExports.jsx("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:i.zIndex,top:0,left:0,right:0},children:i.children}),DefaultPortal=i=>{const{appendToParentPortal:s,children:o}=i,[a,rt]=reactExports.useState(null),et=reactExports.useRef(null),[,ot]=reactExports.useState({});reactExports.useEffect(()=>ot({}),[]);const at=usePortalContext(),nt=usePortalManager();useSafeLayoutEffect$1(()=>{if(!a)return;const j=a.ownerDocument,_=s?at??j.body:j.body;if(!_)return;et.current=j.createElement("div"),et.current.className=PORTAL_CLASSNAME,_.appendChild(et.current),ot({});const $=et.current;return()=>{_.contains($)&&_.removeChild($)}},[a]);const it=nt!=null&&nt.zIndex?jsxRuntimeExports.jsx(Container,{zIndex:nt==null?void 0:nt.zIndex,children:o}):o;return et.current?reactDomExports.createPortal(jsxRuntimeExports.jsx(PortalContextProvider,{value:et.current,children:it}),et.current):jsxRuntimeExports.jsx("span",{ref:j=>{j&&rt(j)}})},ContainerPortal=i=>{const{children:s,containerRef:o,appendToParentPortal:a}=i,rt=o.current,et=rt??(typeof window<"u"?document.body:void 0),ot=reactExports.useMemo(()=>{const nt=rt==null?void 0:rt.ownerDocument.createElement("div");return nt&&(nt.className=PORTAL_CLASSNAME),nt},[rt]),[,at]=reactExports.useState({});return useSafeLayoutEffect$1(()=>at({}),[]),useSafeLayoutEffect$1(()=>{if(!(!ot||!et))return et.appendChild(ot),()=>{et.removeChild(ot)}},[ot,et]),et&&ot?reactDomExports.createPortal(jsxRuntimeExports.jsx(PortalContextProvider,{value:a?ot:null,children:s}),ot):null};function Portal(i){const s={appendToParentPortal:!0,...i},{containerRef:o,...a}=s;return o?jsxRuntimeExports.jsx(ContainerPortal,{containerRef:o,...a}):jsxRuntimeExports.jsx(DefaultPortal,{...a})}Portal.className=PORTAL_CLASSNAME;Portal.selector=PORTAL_SELECTOR;Portal.displayName="Portal";function useTheme(){const i=reactExports.useContext(ThemeContext);if(!i)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `` or ``");return i}var ColorModeContext=reactExports.createContext({});ColorModeContext.displayName="ColorModeContext";function useColorMode(){const i=reactExports.useContext(ColorModeContext);if(i===void 0)throw new Error("useColorMode must be used within a ColorModeProvider");return i}var classNames={light:"chakra-ui-light",dark:"chakra-ui-dark"};function getColorModeUtils(i={}){const{preventTransition:s=!0}=i,o={setDataset:a=>{const rt=s?o.preventTransition():void 0;document.documentElement.dataset.theme=a,document.documentElement.style.colorScheme=a,rt==null||rt()},setClassName(a){document.body.classList.add(a?classNames.dark:classNames.light),document.body.classList.remove(a?classNames.light:classNames.dark)},query(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme(a){var rt;return((rt=o.query().matches)!=null?rt:a==="dark")?"dark":"light"},addListener(a){const rt=o.query(),et=ot=>{a(ot.matches?"dark":"light")};return typeof rt.addListener=="function"?rt.addListener(et):rt.addEventListener("change",et),()=>{typeof rt.removeListener=="function"?rt.removeListener(et):rt.removeEventListener("change",et)}},preventTransition(){const a=document.createElement("style");return a.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(a),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.head.removeChild(a)})})}}};return o}var STORAGE_KEY="chakra-ui-color-mode";function createLocalStorageManager(i){return{ssr:!1,type:"localStorage",get(s){if(!(globalThis!=null&&globalThis.document))return s;let o;try{o=localStorage.getItem(i)||s}catch{}return o||s},set(s){try{localStorage.setItem(i,s)}catch{}}}}var localStorageManager=createLocalStorageManager(STORAGE_KEY),noop$2=()=>{};function getTheme(i,s){return i.type==="cookie"&&i.ssr?i.get(s):s}function ColorModeProvider(i){const{value:s,children:o,options:{useSystemColorMode:a,initialColorMode:rt,disableTransitionOnChange:et}={},colorModeManager:ot=localStorageManager}=i,at=rt==="dark"?"dark":"light",[nt,it]=reactExports.useState(()=>getTheme(ot,at)),[j,_]=reactExports.useState(()=>getTheme(ot)),{getSystemTheme:$,setClassName:tt,setDataset:st,addListener:lt}=reactExports.useMemo(()=>getColorModeUtils({preventTransition:et}),[et]),ct=rt==="system"&&!nt?j:nt,ht=reactExports.useCallback(mt=>{const gt=mt==="system"?$():mt;it(gt),tt(gt==="dark"),st(gt),ot.set(gt)},[ot,$,tt,st]);useSafeLayoutEffect$1(()=>{rt==="system"&&_($())},[]),reactExports.useEffect(()=>{const mt=ot.get();if(mt){ht(mt);return}if(rt==="system"){ht("system");return}ht(at)},[ot,at,rt,ht]);const ut=reactExports.useCallback(()=>{ht(ct==="dark"?"light":"dark")},[ct,ht]);reactExports.useEffect(()=>{if(a)return lt(ht)},[a,lt,ht]);const pt=reactExports.useMemo(()=>({colorMode:s??ct,toggleColorMode:s?noop$2:ut,setColorMode:s?noop$2:ht,forced:s!==void 0}),[ct,ut,ht,s]);return jsxRuntimeExports.jsx(ColorModeContext.Provider,{value:pt,children:o})}ColorModeProvider.displayName="ColorModeProvider";var VALID_VALUES=new Set(["dark","light","system"]);function normalize$1(i){let s=i;return VALID_VALUES.has(s)||(s="light"),s}function getScriptSrc(i={}){const{initialColorMode:s="light",type:o="localStorage",storageKey:a="chakra-ui-color-mode"}=i,rt=normalize$1(s),et=o==="cookie",ot=`(function(){try{var a=function(o){var l="(prefers-color-scheme: dark)",v=window.matchMedia(l).matches?"dark":"light",e=o==="system"?v:o,d=document.documentElement,m=document.body,i="chakra-ui-light",n="chakra-ui-dark",s=e==="dark";return m.classList.add(s?n:i),m.classList.remove(s?i:n),d.style.colorScheme=e,d.dataset.theme=e,e},u=a,h="${rt}",r="${a}",t=document.cookie.match(new RegExp("(^| )".concat(r,"=([^;]+)"))),c=t?t[2]:null;c?a(c):document.cookie="".concat(r,"=").concat(a(h),"; max-age=31536000; path=/")}catch(a){}})(); +`),tt=a.stack.split(` +`),ot=rt.length-1,at=tt.length-1;1<=ot&&0<=at&&rt[ot]!==tt[at];)at--;for(;1<=ot&&0<=at;ot--,at--)if(rt[ot]!==tt[at]){if(ot!==1||at!==1)do if(ot--,at--,0>at||rt[ot]!==tt[at]){var nt=` +`+rt[ot].replace(" at new "," at ");return i.displayName&&nt.includes("")&&(nt=nt.replace("",i.displayName)),nt}while(1<=ot&&0<=at);break}}}finally{Na=!1,Error.prepareStackTrace=o}return(i=i?i.displayName||i.name:"")?Ma(i):""}function Pa(i){switch(i.tag){case 5:return Ma(i.type);case 16:return Ma("Lazy");case 13:return Ma("Suspense");case 19:return Ma("SuspenseList");case 0:case 2:case 15:return i=Oa(i.type,!1),i;case 11:return i=Oa(i.type.render,!1),i;case 1:return i=Oa(i.type,!0),i;default:return""}}function Qa(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case ya:return"Fragment";case wa:return"Portal";case Aa:return"Profiler";case za:return"StrictMode";case Ea:return"Suspense";case Fa:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case Ca:return(i.displayName||"Context")+".Consumer";case Ba:return(i._context.displayName||"Context")+".Provider";case Da:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case Ga:return s=i.displayName||null,s!==null?s:Qa(i.type)||"Memo";case Ha:s=i._payload,i=i._init;try{return Qa(i(s))}catch{}}return null}function Ra(i){var s=i.type;switch(i.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=s.render,i=i.displayName||i.name||"",s.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Qa(s);case 8:return s===za?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function Sa(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Ta(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Ua(i){var s=Ta(i)?"checked":"value",o=Object.getOwnPropertyDescriptor(i.constructor.prototype,s),a=""+i[s];if(!i.hasOwnProperty(s)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var rt=o.get,tt=o.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return rt.call(this)},set:function(ot){a=""+ot,tt.call(this,ot)}}),Object.defineProperty(i,s,{enumerable:o.enumerable}),{getValue:function(){return a},setValue:function(ot){a=""+ot},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function Va(i){i._valueTracker||(i._valueTracker=Ua(i))}function Wa(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var o=s.getValue(),a="";return i&&(a=Ta(i)?i.checked?"true":"false":i.value),i=a,i!==o?(s.setValue(i),!0):!1}function Xa(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function Ya(i,s){var o=s.checked;return A({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:o??i._wrapperState.initialChecked})}function Za(i,s){var o=s.defaultValue==null?"":s.defaultValue,a=s.checked!=null?s.checked:s.defaultChecked;o=Sa(s.value!=null?s.value:o),i._wrapperState={initialChecked:a,initialValue:o,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function ab(i,s){s=s.checked,s!=null&&ta(i,"checked",s,!1)}function bb(i,s){ab(i,s);var o=Sa(s.value),a=s.type;if(o!=null)a==="number"?(o===0&&i.value===""||i.value!=o)&&(i.value=""+o):i.value!==""+o&&(i.value=""+o);else if(a==="submit"||a==="reset"){i.removeAttribute("value");return}s.hasOwnProperty("value")?cb(i,s.type,o):s.hasOwnProperty("defaultValue")&&cb(i,s.type,Sa(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(i.defaultChecked=!!s.defaultChecked)}function db(i,s,o){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var a=s.type;if(!(a!=="submit"&&a!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+i._wrapperState.initialValue,o||s===i.value||(i.value=s),i.defaultValue=s}o=i.name,o!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,o!==""&&(i.name=o)}function cb(i,s,o){(s!=="number"||Xa(i.ownerDocument)!==i)&&(o==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+o&&(i.defaultValue=""+o))}var eb=Array.isArray;function fb(i,s,o,a){if(i=i.options,s){s={};for(var rt=0;rt"+s.valueOf().toString()+"",s=mb.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;s.firstChild;)i.appendChild(s.firstChild)}});function ob(i,s){if(s){var o=i.firstChild;if(o&&o===i.lastChild&&o.nodeType===3){o.nodeValue=s;return}}i.textContent=s}var pb={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qb=["Webkit","ms","Moz","O"];Object.keys(pb).forEach(function(i){qb.forEach(function(s){s=s+i.charAt(0).toUpperCase()+i.substring(1),pb[s]=pb[i]})});function rb(i,s,o){return s==null||typeof s=="boolean"||s===""?"":o||typeof s!="number"||s===0||pb.hasOwnProperty(i)&&pb[i]?(""+s).trim():s+"px"}function sb(i,s){i=i.style;for(var o in s)if(s.hasOwnProperty(o)){var a=o.indexOf("--")===0,rt=rb(o,s[o],a);o==="float"&&(o="cssFloat"),a?i.setProperty(o,rt):i[o]=rt}}var tb=A({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ub(i,s){if(s){if(tb[i]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(p$1(137,i));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(p$1(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(p$1(61))}if(s.style!=null&&typeof s.style!="object")throw Error(p$1(62))}}function vb(i,s){if(i.indexOf("-")===-1)return typeof s.is=="string";switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var wb=null;function xb(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var yb=null,zb=null,Ab=null;function Bb(i){if(i=Cb(i)){if(typeof yb!="function")throw Error(p$1(280));var s=i.stateNode;s&&(s=Db(s),yb(i.stateNode,i.type,s))}}function Eb(i){zb?Ab?Ab.push(i):Ab=[i]:zb=i}function Fb(){if(zb){var i=zb,s=Ab;if(Ab=zb=null,Bb(i),s)for(i=0;i>>=0,i===0?32:31-(pc(i)/qc|0)|0}var rc=64,sc=4194304;function tc(i){switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function uc(i,s){var o=i.pendingLanes;if(o===0)return 0;var a=0,rt=i.suspendedLanes,tt=i.pingedLanes,ot=o&268435455;if(ot!==0){var at=ot&~rt;at!==0?a=tc(at):(tt&=ot,tt!==0&&(a=tc(tt)))}else ot=o&~rt,ot!==0?a=tc(ot):tt!==0&&(a=tc(tt));if(a===0)return 0;if(s!==0&&s!==a&&!(s&rt)&&(rt=a&-a,tt=s&-s,rt>=tt||rt===16&&(tt&4194240)!==0))return s;if(a&4&&(a|=o&16),s=i.entangledLanes,s!==0)for(i=i.entanglements,s&=a;0o;o++)s.push(i);return s}function Ac(i,s,o){i.pendingLanes|=s,s!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,s=31-oc(s),i[s]=o}function Bc(i,s){var o=i.pendingLanes&~s;i.pendingLanes=s,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=s,i.mutableReadLanes&=s,i.entangledLanes&=s,s=i.entanglements;var a=i.eventTimes;for(i=i.expirationTimes;0=be),ee=" ",fe=!1;function ge(i,s){switch(i){case"keyup":return $d.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function he(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var ie=!1;function je(i,s){switch(i){case"compositionend":return he(s);case"keypress":return s.which!==32?null:(fe=!0,ee);case"textInput":return i=s.data,i===ee&&fe?null:i;default:return null}}function ke(i,s){if(ie)return i==="compositionend"||!ae&&ge(i,s)?(i=nd(),md=ld=kd=null,ie=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1=s)return{node:o,offset:s-i};i=a}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=Je(o)}}function Le(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?Le(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function Me(){for(var i=window,s=Xa();s instanceof i.HTMLIFrameElement;){try{var o=typeof s.contentWindow.location.href=="string"}catch{o=!1}if(o)i=s.contentWindow;else break;s=Xa(i.document)}return s}function Ne(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}function Oe(i){var s=Me(),o=i.focusedElem,a=i.selectionRange;if(s!==o&&o&&o.ownerDocument&&Le(o.ownerDocument.documentElement,o)){if(a!==null&&Ne(o)){if(s=a.start,i=a.end,i===void 0&&(i=s),"selectionStart"in o)o.selectionStart=s,o.selectionEnd=Math.min(i,o.value.length);else if(i=(s=o.ownerDocument||document)&&s.defaultView||window,i.getSelection){i=i.getSelection();var rt=o.textContent.length,tt=Math.min(a.start,rt);a=a.end===void 0?tt:Math.min(a.end,rt),!i.extend&&tt>a&&(rt=a,a=tt,tt=rt),rt=Ke(o,tt);var ot=Ke(o,a);rt&&ot&&(i.rangeCount!==1||i.anchorNode!==rt.node||i.anchorOffset!==rt.offset||i.focusNode!==ot.node||i.focusOffset!==ot.offset)&&(s=s.createRange(),s.setStart(rt.node,rt.offset),i.removeAllRanges(),tt>a?(i.addRange(s),i.extend(ot.node,ot.offset)):(s.setEnd(ot.node,ot.offset),i.addRange(s)))}}for(s=[],i=o;i=i.parentNode;)i.nodeType===1&&s.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o=document.documentMode,Qe=null,Re=null,Se=null,Te=!1;function Ue(i,s,o){var a=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Te||Qe==null||Qe!==Xa(a)||(a=Qe,"selectionStart"in a&&Ne(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Se&&Ie(Se,a)||(Se=a,a=oe(Re,"onSelect"),0Tf||(i.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G(i,s){Tf++,Sf[Tf]=i.current,i.current=s}var Vf={},H=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(i,s){var o=i.type.contextTypes;if(!o)return Vf;var a=i.stateNode;if(a&&a.__reactInternalMemoizedUnmaskedChildContext===s)return a.__reactInternalMemoizedMaskedChildContext;var rt={},tt;for(tt in o)rt[tt]=s[tt];return a&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=s,i.__reactInternalMemoizedMaskedChildContext=rt),rt}function Zf(i){return i=i.childContextTypes,i!=null}function $f(){E(Wf),E(H)}function ag(i,s,o){if(H.current!==Vf)throw Error(p$1(168));G(H,s),G(Wf,o)}function bg(i,s,o){var a=i.stateNode;if(s=s.childContextTypes,typeof a.getChildContext!="function")return o;a=a.getChildContext();for(var rt in a)if(!(rt in s))throw Error(p$1(108,Ra(i)||"Unknown",rt));return A({},o,a)}function cg(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Vf,Xf=H.current,G(H,i),G(Wf,Wf.current),!0}function dg(i,s,o){var a=i.stateNode;if(!a)throw Error(p$1(169));o?(i=bg(i,s,Xf),a.__reactInternalMemoizedMergedChildContext=i,E(Wf),E(H),G(H,i)):E(Wf),G(Wf,o)}var eg=null,fg=!1,gg=!1;function hg(i){eg===null?eg=[i]:eg.push(i)}function ig(i){fg=!0,hg(i)}function jg(){if(!gg&&eg!==null){gg=!0;var i=0,s=C;try{var o=eg;for(C=1;i>=ot,rt-=ot,rg=1<<32-oc(s)+rt|o<xt?(yt=St,St=null):yt=St.sibling;var _t=$(ht,St,pt[xt],mt);if(_t===null){St===null&&(St=yt);break}i&&St&&_t.alternate===null&&s(ht,St),ut=tt(_t,ut,xt),dt===null?gt=_t:dt.sibling=_t,dt=_t,St=yt}if(xt===pt.length)return o(ht,St),I&&tg(ht,xt),gt;if(St===null){for(;xtxt?(yt=St,St=null):yt=St.sibling;var Ct=$(ht,St,_t.value,mt);if(Ct===null){St===null&&(St=yt);break}i&&St&&Ct.alternate===null&&s(ht,St),ut=tt(Ct,ut,xt),dt===null?gt=Ct:dt.sibling=Ct,dt=Ct,St=yt}if(_t.done)return o(ht,St),I&&tg(ht,xt),gt;if(St===null){for(;!_t.done;xt++,_t=pt.next())_t=_(ht,_t.value,mt),_t!==null&&(ut=tt(_t,ut,xt),dt===null?gt=_t:dt.sibling=_t,dt=_t);return I&&tg(ht,xt),gt}for(St=a(ht,St);!_t.done;xt++,_t=pt.next())_t=et(St,ht,xt,_t.value,mt),_t!==null&&(i&&_t.alternate!==null&&St.delete(_t.key===null?xt:_t.key),ut=tt(_t,ut,xt),dt===null?gt=_t:dt.sibling=_t,dt=_t);return i&&St.forEach(function(Et){return s(ht,Et)}),I&&tg(ht,xt),gt}function ct(ht,ut,pt,mt){if(typeof pt=="object"&&pt!==null&&pt.type===ya&&pt.key===null&&(pt=pt.props.children),typeof pt=="object"&&pt!==null){switch(pt.$$typeof){case va:e:{for(var gt=pt.key,dt=ut;dt!==null;){if(dt.key===gt){if(gt=pt.type,gt===ya){if(dt.tag===7){o(ht,dt.sibling),ut=rt(dt,pt.props.children),ut.return=ht,ht=ut;break e}}else if(dt.elementType===gt||typeof gt=="object"&>!==null&>.$$typeof===Ha&&Ng(gt)===dt.type){o(ht,dt.sibling),ut=rt(dt,pt.props),ut.ref=Lg(ht,dt,pt),ut.return=ht,ht=ut;break e}o(ht,dt);break}else s(ht,dt);dt=dt.sibling}pt.type===ya?(ut=Tg(pt.props.children,ht.mode,mt,pt.key),ut.return=ht,ht=ut):(mt=Rg(pt.type,pt.key,pt.props,null,ht.mode,mt),mt.ref=Lg(ht,ut,pt),mt.return=ht,ht=mt)}return ot(ht);case wa:e:{for(dt=pt.key;ut!==null;){if(ut.key===dt)if(ut.tag===4&&ut.stateNode.containerInfo===pt.containerInfo&&ut.stateNode.implementation===pt.implementation){o(ht,ut.sibling),ut=rt(ut,pt.children||[]),ut.return=ht,ht=ut;break e}else{o(ht,ut);break}else s(ht,ut);ut=ut.sibling}ut=Sg(pt,ht.mode,mt),ut.return=ht,ht=ut}return ot(ht);case Ha:return dt=pt._init,ct(ht,ut,dt(pt._payload),mt)}if(eb(pt))return st(ht,ut,pt,mt);if(Ka(pt))return lt(ht,ut,pt,mt);Mg(ht,pt)}return typeof pt=="string"&&pt!==""||typeof pt=="number"?(pt=""+pt,ut!==null&&ut.tag===6?(o(ht,ut.sibling),ut=rt(ut,pt),ut.return=ht,ht=ut):(o(ht,ut),ut=Qg(pt,ht.mode,mt),ut.return=ht,ht=ut),ot(ht)):o(ht,ut)}return ct}var Ug=Og(!0),Vg=Og(!1),Wg=Uf(null),Xg=null,Yg=null,Zg=null;function $g(){Zg=Yg=Xg=null}function ah(i){var s=Wg.current;E(Wg),i._currentValue=s}function bh(i,s,o){for(;i!==null;){var a=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,a!==null&&(a.childLanes|=s)):a!==null&&(a.childLanes&s)!==s&&(a.childLanes|=s),i===o)break;i=i.return}}function ch(i,s){Xg=i,Zg=Yg=null,i=i.dependencies,i!==null&&i.firstContext!==null&&(i.lanes&s&&(dh=!0),i.firstContext=null)}function eh(i){var s=i._currentValue;if(Zg!==i)if(i={context:i,memoizedValue:s,next:null},Yg===null){if(Xg===null)throw Error(p$1(308));Yg=i,Xg.dependencies={lanes:0,firstContext:i}}else Yg=Yg.next=i;return s}var fh=null;function gh(i){fh===null?fh=[i]:fh.push(i)}function hh(i,s,o,a){var rt=s.interleaved;return rt===null?(o.next=o,gh(s)):(o.next=rt.next,rt.next=o),s.interleaved=o,ih(i,a)}function ih(i,s){i.lanes|=s;var o=i.alternate;for(o!==null&&(o.lanes|=s),o=i,i=i.return;i!==null;)i.childLanes|=s,o=i.alternate,o!==null&&(o.childLanes|=s),o=i,i=i.return;return o.tag===3?o.stateNode:null}var jh=!1;function kh(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function lh(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function mh(i,s){return{eventTime:i,lane:s,tag:0,payload:null,callback:null,next:null}}function nh(i,s,o){var a=i.updateQueue;if(a===null)return null;if(a=a.shared,K&2){var rt=a.pending;return rt===null?s.next=s:(s.next=rt.next,rt.next=s),a.pending=s,ih(i,o)}return rt=a.interleaved,rt===null?(s.next=s,gh(a)):(s.next=rt.next,rt.next=s),a.interleaved=s,ih(i,o)}function oh(i,s,o){if(s=s.updateQueue,s!==null&&(s=s.shared,(o&4194240)!==0)){var a=s.lanes;a&=i.pendingLanes,o|=a,s.lanes=o,Cc(i,o)}}function ph(i,s){var o=i.updateQueue,a=i.alternate;if(a!==null&&(a=a.updateQueue,o===a)){var rt=null,tt=null;if(o=o.firstBaseUpdate,o!==null){do{var ot={eventTime:o.eventTime,lane:o.lane,tag:o.tag,payload:o.payload,callback:o.callback,next:null};tt===null?rt=tt=ot:tt=tt.next=ot,o=o.next}while(o!==null);tt===null?rt=tt=s:tt=tt.next=s}else rt=tt=s;o={baseState:a.baseState,firstBaseUpdate:rt,lastBaseUpdate:tt,shared:a.shared,effects:a.effects},i.updateQueue=o;return}i=o.lastBaseUpdate,i===null?o.firstBaseUpdate=s:i.next=s,o.lastBaseUpdate=s}function qh(i,s,o,a){var rt=i.updateQueue;jh=!1;var tt=rt.firstBaseUpdate,ot=rt.lastBaseUpdate,at=rt.shared.pending;if(at!==null){rt.shared.pending=null;var nt=at,it=nt.next;nt.next=null,ot===null?tt=it:ot.next=it,ot=nt;var j=i.alternate;j!==null&&(j=j.updateQueue,at=j.lastBaseUpdate,at!==ot&&(at===null?j.firstBaseUpdate=it:at.next=it,j.lastBaseUpdate=nt))}if(tt!==null){var _=rt.baseState;ot=0,j=it=nt=null,at=tt;do{var $=at.lane,et=at.eventTime;if((a&$)===$){j!==null&&(j=j.next={eventTime:et,lane:0,tag:at.tag,payload:at.payload,callback:at.callback,next:null});e:{var st=i,lt=at;switch($=s,et=o,lt.tag){case 1:if(st=lt.payload,typeof st=="function"){_=st.call(et,_,$);break e}_=st;break e;case 3:st.flags=st.flags&-65537|128;case 0:if(st=lt.payload,$=typeof st=="function"?st.call(et,_,$):st,$==null)break e;_=A({},_,$);break e;case 2:jh=!0}}at.callback!==null&&at.lane!==0&&(i.flags|=64,$=rt.effects,$===null?rt.effects=[at]:$.push(at))}else et={eventTime:et,lane:$,tag:at.tag,payload:at.payload,callback:at.callback,next:null},j===null?(it=j=et,nt=_):j=j.next=et,ot|=$;if(at=at.next,at===null){if(at=rt.shared.pending,at===null)break;$=at,at=$.next,$.next=null,rt.lastBaseUpdate=$,rt.shared.pending=null}}while(!0);if(j===null&&(nt=_),rt.baseState=nt,rt.firstBaseUpdate=it,rt.lastBaseUpdate=j,s=rt.shared.interleaved,s!==null){rt=s;do ot|=rt.lane,rt=rt.next;while(rt!==s)}else tt===null&&(rt.shared.lanes=0);rh|=ot,i.lanes=ot,i.memoizedState=_}}function sh(i,s,o){if(i=s.effects,s.effects=null,i!==null)for(s=0;so?o:4,i(!0);var a=Gh.transition;Gh.transition={};try{i(!1),s()}finally{C=o,Gh.transition=a}}function wi(){return Uh().memoizedState}function xi(i,s,o){var a=yi(i);if(o={lane:a,action:o,hasEagerState:!1,eagerState:null,next:null},zi(i))Ai(s,o);else if(o=hh(i,s,o,a),o!==null){var rt=R();gi(o,i,a,rt),Bi(o,s,a)}}function ii(i,s,o){var a=yi(i),rt={lane:a,action:o,hasEagerState:!1,eagerState:null,next:null};if(zi(i))Ai(s,rt);else{var tt=i.alternate;if(i.lanes===0&&(tt===null||tt.lanes===0)&&(tt=s.lastRenderedReducer,tt!==null))try{var ot=s.lastRenderedState,at=tt(ot,o);if(rt.hasEagerState=!0,rt.eagerState=at,He(at,ot)){var nt=s.interleaved;nt===null?(rt.next=rt,gh(s)):(rt.next=nt.next,nt.next=rt),s.interleaved=rt;return}}catch{}finally{}o=hh(i,s,rt,a),o!==null&&(rt=R(),gi(o,i,a,rt),Bi(o,s,a))}}function zi(i){var s=i.alternate;return i===M||s!==null&&s===M}function Ai(i,s){Jh=Ih=!0;var o=i.pending;o===null?s.next=s:(s.next=o.next,o.next=s),i.pending=s}function Bi(i,s,o){if(o&4194240){var a=s.lanes;a&=i.pendingLanes,o|=a,s.lanes=o,Cc(i,o)}}var Rh={readContext:eh,useCallback:P,useContext:P,useEffect:P,useImperativeHandle:P,useInsertionEffect:P,useLayoutEffect:P,useMemo:P,useReducer:P,useRef:P,useState:P,useDebugValue:P,useDeferredValue:P,useTransition:P,useMutableSource:P,useSyncExternalStore:P,useId:P,unstable_isNewReconciler:!1},Oh={readContext:eh,useCallback:function(i,s){return Th().memoizedState=[i,s===void 0?null:s],i},useContext:eh,useEffect:mi,useImperativeHandle:function(i,s,o){return o=o!=null?o.concat([i]):null,ki(4194308,4,pi.bind(null,s,i),o)},useLayoutEffect:function(i,s){return ki(4194308,4,i,s)},useInsertionEffect:function(i,s){return ki(4,2,i,s)},useMemo:function(i,s){var o=Th();return s=s===void 0?null:s,i=i(),o.memoizedState=[i,s],i},useReducer:function(i,s,o){var a=Th();return s=o!==void 0?o(s):s,a.memoizedState=a.baseState=s,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:s},a.queue=i,i=i.dispatch=xi.bind(null,M,i),[a.memoizedState,i]},useRef:function(i){var s=Th();return i={current:i},s.memoizedState=i},useState:hi,useDebugValue:ri,useDeferredValue:function(i){return Th().memoizedState=i},useTransition:function(){var i=hi(!1),s=i[0];return i=vi.bind(null,i[1]),Th().memoizedState=i,[s,i]},useMutableSource:function(){},useSyncExternalStore:function(i,s,o){var a=M,rt=Th();if(I){if(o===void 0)throw Error(p$1(407));o=o()}else{if(o=s(),Q===null)throw Error(p$1(349));Hh&30||di(a,s,o)}rt.memoizedState=o;var tt={value:o,getSnapshot:s};return rt.queue=tt,mi(ai.bind(null,a,tt,i),[i]),a.flags|=2048,bi(9,ci.bind(null,a,tt,o,s),void 0,null),o},useId:function(){var i=Th(),s=Q.identifierPrefix;if(I){var o=sg,a=rg;o=(a&~(1<<32-oc(a)-1)).toString(32)+o,s=":"+s+"R"+o,o=Kh++,0<\/script>",i=i.removeChild(i.firstChild)):typeof a.is=="string"?i=ot.createElement(o,{is:a.is}):(i=ot.createElement(o),o==="select"&&(ot=i,a.multiple?ot.multiple=!0:a.size&&(ot.size=a.size))):i=ot.createElementNS(i,o),i[Of]=s,i[Pf]=a,zj(i,s,!1,!1),s.stateNode=i;e:{switch(ot=vb(o,a),o){case"dialog":D("cancel",i),D("close",i),rt=a;break;case"iframe":case"object":case"embed":D("load",i),rt=a;break;case"video":case"audio":for(rt=0;rtGj&&(s.flags|=128,a=!0,Dj(tt,!1),s.lanes=4194304)}else{if(!a)if(i=Ch(ot),i!==null){if(s.flags|=128,a=!0,o=i.updateQueue,o!==null&&(s.updateQueue=o,s.flags|=4),Dj(tt,!0),tt.tail===null&&tt.tailMode==="hidden"&&!ot.alternate&&!I)return S(s),null}else 2*B()-tt.renderingStartTime>Gj&&o!==1073741824&&(s.flags|=128,a=!0,Dj(tt,!1),s.lanes=4194304);tt.isBackwards?(ot.sibling=s.child,s.child=ot):(o=tt.last,o!==null?o.sibling=ot:s.child=ot,tt.last=ot)}return tt.tail!==null?(s=tt.tail,tt.rendering=s,tt.tail=s.sibling,tt.renderingStartTime=B(),s.sibling=null,o=L.current,G(L,a?o&1|2:o&1),s):(S(s),null);case 22:case 23:return Hj(),a=s.memoizedState!==null,i!==null&&i.memoizedState!==null!==a&&(s.flags|=8192),a&&s.mode&1?fj&1073741824&&(S(s),s.subtreeFlags&6&&(s.flags|=8192)):S(s),null;case 24:return null;case 25:return null}throw Error(p$1(156,s.tag))}function Ij(i,s){switch(wg(s),s.tag){case 1:return Zf(s.type)&&$f(),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return zh(),E(Wf),E(H),Eh(),i=s.flags,i&65536&&!(i&128)?(s.flags=i&-65537|128,s):null;case 5:return Bh(s),null;case 13:if(E(L),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(p$1(340));Ig()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return E(L),null;case 4:return zh(),null;case 10:return ah(s.type._context),null;case 22:case 23:return Hj(),null;case 24:return null;default:return null}}var Jj=!1,U=!1,Kj=typeof WeakSet=="function"?WeakSet:Set,V=null;function Lj(i,s){var o=i.ref;if(o!==null)if(typeof o=="function")try{o(null)}catch(a){W(i,s,a)}else o.current=null}function Mj(i,s,o){try{o()}catch(a){W(i,s,a)}}var Nj=!1;function Oj(i,s){if(Cf=dd,i=Me(),Ne(i)){if("selectionStart"in i)var o={start:i.selectionStart,end:i.selectionEnd};else e:{o=(o=i.ownerDocument)&&o.defaultView||window;var a=o.getSelection&&o.getSelection();if(a&&a.rangeCount!==0){o=a.anchorNode;var rt=a.anchorOffset,tt=a.focusNode;a=a.focusOffset;try{o.nodeType,tt.nodeType}catch{o=null;break e}var ot=0,at=-1,nt=-1,it=0,j=0,_=i,$=null;t:for(;;){for(var et;_!==o||rt!==0&&_.nodeType!==3||(at=ot+rt),_!==tt||a!==0&&_.nodeType!==3||(nt=ot+a),_.nodeType===3&&(ot+=_.nodeValue.length),(et=_.firstChild)!==null;)$=_,_=et;for(;;){if(_===i)break t;if($===o&&++it===rt&&(at=ot),$===tt&&++j===a&&(nt=ot),(et=_.nextSibling)!==null)break;_=$,$=_.parentNode}_=et}o=at===-1||nt===-1?null:{start:at,end:nt}}else o=null}o=o||{start:0,end:0}}else o=null;for(Df={focusedElem:i,selectionRange:o},dd=!1,V=s;V!==null;)if(s=V,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,V=i;else for(;V!==null;){s=V;try{var st=s.alternate;if(s.flags&1024)switch(s.tag){case 0:case 11:case 15:break;case 1:if(st!==null){var lt=st.memoizedProps,ct=st.memoizedState,ht=s.stateNode,ut=ht.getSnapshotBeforeUpdate(s.elementType===s.type?lt:Ci(s.type,lt),ct);ht.__reactInternalSnapshotBeforeUpdate=ut}break;case 3:var pt=s.stateNode.containerInfo;pt.nodeType===1?pt.textContent="":pt.nodeType===9&&pt.documentElement&&pt.removeChild(pt.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p$1(163))}}catch(mt){W(s,s.return,mt)}if(i=s.sibling,i!==null){i.return=s.return,V=i;break}V=s.return}return st=Nj,Nj=!1,st}function Pj(i,s,o){var a=s.updateQueue;if(a=a!==null?a.lastEffect:null,a!==null){var rt=a=a.next;do{if((rt.tag&i)===i){var tt=rt.destroy;rt.destroy=void 0,tt!==void 0&&Mj(s,o,tt)}rt=rt.next}while(rt!==a)}}function Qj(i,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var o=s=s.next;do{if((o.tag&i)===i){var a=o.create;o.destroy=a()}o=o.next}while(o!==s)}}function Rj(i){var s=i.ref;if(s!==null){var o=i.stateNode;switch(i.tag){case 5:i=o;break;default:i=o}typeof s=="function"?s(i):s.current=i}}function Sj(i){var s=i.alternate;s!==null&&(i.alternate=null,Sj(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&(delete s[Of],delete s[Pf],delete s[of],delete s[Qf],delete s[Rf])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function Tj(i){return i.tag===5||i.tag===3||i.tag===4}function Uj(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Tj(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Vj(i,s,o){var a=i.tag;if(a===5||a===6)i=i.stateNode,s?o.nodeType===8?o.parentNode.insertBefore(i,s):o.insertBefore(i,s):(o.nodeType===8?(s=o.parentNode,s.insertBefore(i,o)):(s=o,s.appendChild(i)),o=o._reactRootContainer,o!=null||s.onclick!==null||(s.onclick=Bf));else if(a!==4&&(i=i.child,i!==null))for(Vj(i,s,o),i=i.sibling;i!==null;)Vj(i,s,o),i=i.sibling}function Wj(i,s,o){var a=i.tag;if(a===5||a===6)i=i.stateNode,s?o.insertBefore(i,s):o.appendChild(i);else if(a!==4&&(i=i.child,i!==null))for(Wj(i,s,o),i=i.sibling;i!==null;)Wj(i,s,o),i=i.sibling}var X=null,Xj=!1;function Yj(i,s,o){for(o=o.child;o!==null;)Zj(i,s,o),o=o.sibling}function Zj(i,s,o){if(lc&&typeof lc.onCommitFiberUnmount=="function")try{lc.onCommitFiberUnmount(kc,o)}catch{}switch(o.tag){case 5:U||Lj(o,s);case 6:var a=X,rt=Xj;X=null,Yj(i,s,o),X=a,Xj=rt,X!==null&&(Xj?(i=X,o=o.stateNode,i.nodeType===8?i.parentNode.removeChild(o):i.removeChild(o)):X.removeChild(o.stateNode));break;case 18:X!==null&&(Xj?(i=X,o=o.stateNode,i.nodeType===8?Kf(i.parentNode,o):i.nodeType===1&&Kf(i,o),bd(i)):Kf(X,o.stateNode));break;case 4:a=X,rt=Xj,X=o.stateNode.containerInfo,Xj=!0,Yj(i,s,o),X=a,Xj=rt;break;case 0:case 11:case 14:case 15:if(!U&&(a=o.updateQueue,a!==null&&(a=a.lastEffect,a!==null))){rt=a=a.next;do{var tt=rt,ot=tt.destroy;tt=tt.tag,ot!==void 0&&(tt&2||tt&4)&&Mj(o,s,ot),rt=rt.next}while(rt!==a)}Yj(i,s,o);break;case 1:if(!U&&(Lj(o,s),a=o.stateNode,typeof a.componentWillUnmount=="function"))try{a.props=o.memoizedProps,a.state=o.memoizedState,a.componentWillUnmount()}catch(at){W(o,s,at)}Yj(i,s,o);break;case 21:Yj(i,s,o);break;case 22:o.mode&1?(U=(a=U)||o.memoizedState!==null,Yj(i,s,o),U=a):Yj(i,s,o);break;default:Yj(i,s,o)}}function ak(i){var s=i.updateQueue;if(s!==null){i.updateQueue=null;var o=i.stateNode;o===null&&(o=i.stateNode=new Kj),s.forEach(function(a){var rt=bk.bind(null,i,a);o.has(a)||(o.add(a),a.then(rt,rt))})}}function ck(i,s){var o=s.deletions;if(o!==null)for(var a=0;art&&(rt=ot),a&=~tt}if(a=rt,a=B()-a,a=(120>a?120:480>a?480:1080>a?1080:1920>a?1920:3e3>a?3e3:4320>a?4320:1960*lk(a/1960))-a,10i?16:i,wk===null)var a=!1;else{if(i=wk,wk=null,xk=0,K&6)throw Error(p$1(331));var rt=K;for(K|=4,V=i.current;V!==null;){var tt=V,ot=tt.child;if(V.flags&16){var at=tt.deletions;if(at!==null){for(var nt=0;ntB()-fk?Kk(i,0):rk|=o),Dk(i,s)}function Yk(i,s){s===0&&(i.mode&1?(s=sc,sc<<=1,!(sc&130023424)&&(sc=4194304)):s=1);var o=R();i=ih(i,s),i!==null&&(Ac(i,s,o),Dk(i,o))}function uj(i){var s=i.memoizedState,o=0;s!==null&&(o=s.retryLane),Yk(i,o)}function bk(i,s){var o=0;switch(i.tag){case 13:var a=i.stateNode,rt=i.memoizedState;rt!==null&&(o=rt.retryLane);break;case 19:a=i.stateNode;break;default:throw Error(p$1(314))}a!==null&&a.delete(s),Yk(i,o)}var Vk;Vk=function(i,s,o){if(i!==null)if(i.memoizedProps!==s.pendingProps||Wf.current)dh=!0;else{if(!(i.lanes&o)&&!(s.flags&128))return dh=!1,yj(i,s,o);dh=!!(i.flags&131072)}else dh=!1,I&&s.flags&1048576&&ug(s,ng,s.index);switch(s.lanes=0,s.tag){case 2:var a=s.type;ij(i,s),i=s.pendingProps;var rt=Yf(s,H.current);ch(s,o),rt=Nh(null,s,a,i,rt,o);var tt=Sh();return s.flags|=1,typeof rt=="object"&&rt!==null&&typeof rt.render=="function"&&rt.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,Zf(a)?(tt=!0,cg(s)):tt=!1,s.memoizedState=rt.state!==null&&rt.state!==void 0?rt.state:null,kh(s),rt.updater=Ei,s.stateNode=rt,rt._reactInternals=s,Ii(s,a,i,o),s=jj(null,s,a,!0,tt,o)):(s.tag=0,I&&tt&&vg(s),Xi(null,s,rt,o),s=s.child),s;case 16:a=s.elementType;e:{switch(ij(i,s),i=s.pendingProps,rt=a._init,a=rt(a._payload),s.type=a,rt=s.tag=Zk(a),i=Ci(a,i),rt){case 0:s=cj(null,s,a,i,o);break e;case 1:s=hj(null,s,a,i,o);break e;case 11:s=Yi(null,s,a,i,o);break e;case 14:s=$i(null,s,a,Ci(a.type,i),o);break e}throw Error(p$1(306,a,""))}return s;case 0:return a=s.type,rt=s.pendingProps,rt=s.elementType===a?rt:Ci(a,rt),cj(i,s,a,rt,o);case 1:return a=s.type,rt=s.pendingProps,rt=s.elementType===a?rt:Ci(a,rt),hj(i,s,a,rt,o);case 3:e:{if(kj(s),i===null)throw Error(p$1(387));a=s.pendingProps,tt=s.memoizedState,rt=tt.element,lh(i,s),qh(s,a,null,o);var ot=s.memoizedState;if(a=ot.element,tt.isDehydrated)if(tt={element:a,isDehydrated:!1,cache:ot.cache,pendingSuspenseBoundaries:ot.pendingSuspenseBoundaries,transitions:ot.transitions},s.updateQueue.baseState=tt,s.memoizedState=tt,s.flags&256){rt=Ji(Error(p$1(423)),s),s=lj(i,s,a,o,rt);break e}else if(a!==rt){rt=Ji(Error(p$1(424)),s),s=lj(i,s,a,o,rt);break e}else for(yg=Lf(s.stateNode.containerInfo.firstChild),xg=s,I=!0,zg=null,o=Vg(s,null,a,o),s.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(Ig(),a===rt){s=Zi(i,s,o);break e}Xi(i,s,a,o)}s=s.child}return s;case 5:return Ah(s),i===null&&Eg(s),a=s.type,rt=s.pendingProps,tt=i!==null?i.memoizedProps:null,ot=rt.children,Ef(a,rt)?ot=null:tt!==null&&Ef(a,tt)&&(s.flags|=32),gj(i,s),Xi(i,s,ot,o),s.child;case 6:return i===null&&Eg(s),null;case 13:return oj(i,s,o);case 4:return yh(s,s.stateNode.containerInfo),a=s.pendingProps,i===null?s.child=Ug(s,null,a,o):Xi(i,s,a,o),s.child;case 11:return a=s.type,rt=s.pendingProps,rt=s.elementType===a?rt:Ci(a,rt),Yi(i,s,a,rt,o);case 7:return Xi(i,s,s.pendingProps,o),s.child;case 8:return Xi(i,s,s.pendingProps.children,o),s.child;case 12:return Xi(i,s,s.pendingProps.children,o),s.child;case 10:e:{if(a=s.type._context,rt=s.pendingProps,tt=s.memoizedProps,ot=rt.value,G(Wg,a._currentValue),a._currentValue=ot,tt!==null)if(He(tt.value,ot)){if(tt.children===rt.children&&!Wf.current){s=Zi(i,s,o);break e}}else for(tt=s.child,tt!==null&&(tt.return=s);tt!==null;){var at=tt.dependencies;if(at!==null){ot=tt.child;for(var nt=at.firstContext;nt!==null;){if(nt.context===a){if(tt.tag===1){nt=mh(-1,o&-o),nt.tag=2;var it=tt.updateQueue;if(it!==null){it=it.shared;var j=it.pending;j===null?nt.next=nt:(nt.next=j.next,j.next=nt),it.pending=nt}}tt.lanes|=o,nt=tt.alternate,nt!==null&&(nt.lanes|=o),bh(tt.return,o,s),at.lanes|=o;break}nt=nt.next}}else if(tt.tag===10)ot=tt.type===s.type?null:tt.child;else if(tt.tag===18){if(ot=tt.return,ot===null)throw Error(p$1(341));ot.lanes|=o,at=ot.alternate,at!==null&&(at.lanes|=o),bh(ot,o,s),ot=tt.sibling}else ot=tt.child;if(ot!==null)ot.return=tt;else for(ot=tt;ot!==null;){if(ot===s){ot=null;break}if(tt=ot.sibling,tt!==null){tt.return=ot.return,ot=tt;break}ot=ot.return}tt=ot}Xi(i,s,rt.children,o),s=s.child}return s;case 9:return rt=s.type,a=s.pendingProps.children,ch(s,o),rt=eh(rt),a=a(rt),s.flags|=1,Xi(i,s,a,o),s.child;case 14:return a=s.type,rt=Ci(a,s.pendingProps),rt=Ci(a.type,rt),$i(i,s,a,rt,o);case 15:return bj(i,s,s.type,s.pendingProps,o);case 17:return a=s.type,rt=s.pendingProps,rt=s.elementType===a?rt:Ci(a,rt),ij(i,s),s.tag=1,Zf(a)?(i=!0,cg(s)):i=!1,ch(s,o),Gi(s,a,rt),Ii(s,a,rt,o),jj(null,s,a,!0,i,o);case 19:return xj(i,s,o);case 22:return dj(i,s,o)}throw Error(p$1(156,s.tag))};function Fk(i,s){return ac(i,s)}function $k(i,s,o,a){this.tag=i,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bg(i,s,o,a){return new $k(i,s,o,a)}function aj(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Zk(i){if(typeof i=="function")return aj(i)?1:0;if(i!=null){if(i=i.$$typeof,i===Da)return 11;if(i===Ga)return 14}return 2}function Pg(i,s){var o=i.alternate;return o===null?(o=Bg(i.tag,s,i.key,i.mode),o.elementType=i.elementType,o.type=i.type,o.stateNode=i.stateNode,o.alternate=i,i.alternate=o):(o.pendingProps=s,o.type=i.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=i.flags&14680064,o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,s=i.dependencies,o.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},o.sibling=i.sibling,o.index=i.index,o.ref=i.ref,o}function Rg(i,s,o,a,rt,tt){var ot=2;if(a=i,typeof i=="function")aj(i)&&(ot=1);else if(typeof i=="string")ot=5;else e:switch(i){case ya:return Tg(o.children,rt,tt,s);case za:ot=8,rt|=8;break;case Aa:return i=Bg(12,o,s,rt|2),i.elementType=Aa,i.lanes=tt,i;case Ea:return i=Bg(13,o,s,rt),i.elementType=Ea,i.lanes=tt,i;case Fa:return i=Bg(19,o,s,rt),i.elementType=Fa,i.lanes=tt,i;case Ia:return pj(o,rt,tt,s);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case Ba:ot=10;break e;case Ca:ot=9;break e;case Da:ot=11;break e;case Ga:ot=14;break e;case Ha:ot=16,a=null;break e}throw Error(p$1(130,i==null?i:typeof i,""))}return s=Bg(ot,o,s,rt),s.elementType=i,s.type=a,s.lanes=tt,s}function Tg(i,s,o,a){return i=Bg(7,i,a,s),i.lanes=o,i}function pj(i,s,o,a){return i=Bg(22,i,a,s),i.elementType=Ia,i.lanes=o,i.stateNode={isHidden:!1},i}function Qg(i,s,o){return i=Bg(6,i,null,s),i.lanes=o,i}function Sg(i,s,o){return s=Bg(4,i.children!==null?i.children:[],i.key,s),s.lanes=o,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}function al(i,s,o,a,rt){this.tag=s,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zc(0),this.expirationTimes=zc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zc(0),this.identifierPrefix=a,this.onRecoverableError=rt,this.mutableSourceEagerHydrationData=null}function bl(i,s,o,a,rt,tt,ot,at,nt){return i=new al(i,s,o,at,nt),s===1?(s=1,tt===!0&&(s|=8)):s=0,tt=Bg(3,null,null,s),i.current=tt,tt.stateNode=i,tt.memoizedState={element:a,isDehydrated:o,cache:null,transitions:null,pendingSuspenseBoundaries:null},kh(tt),i}function cl(i,s,o){var a=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE)}catch(i){console.error(i)}}checkDCE(),reactDom.exports=reactDom_production_min;var reactDomExports=reactDom.exports,[PortalContextProvider,usePortalContext]=createContext$2({strict:!1,name:"PortalContext"}),PORTAL_CLASSNAME="chakra-portal",PORTAL_SELECTOR=".chakra-portal",Container=i=>jsxRuntimeExports.jsx("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:i.zIndex,top:0,left:0,right:0},children:i.children}),DefaultPortal=i=>{const{appendToParentPortal:s,children:o}=i,[a,rt]=reactExports.useState(null),tt=reactExports.useRef(null),[,ot]=reactExports.useState({});reactExports.useEffect(()=>ot({}),[]);const at=usePortalContext(),nt=usePortalManager();useSafeLayoutEffect$1(()=>{if(!a)return;const j=a.ownerDocument,_=s?at??j.body:j.body;if(!_)return;tt.current=j.createElement("div"),tt.current.className=PORTAL_CLASSNAME,_.appendChild(tt.current),ot({});const $=tt.current;return()=>{_.contains($)&&_.removeChild($)}},[a]);const it=nt!=null&&nt.zIndex?jsxRuntimeExports.jsx(Container,{zIndex:nt==null?void 0:nt.zIndex,children:o}):o;return tt.current?reactDomExports.createPortal(jsxRuntimeExports.jsx(PortalContextProvider,{value:tt.current,children:it}),tt.current):jsxRuntimeExports.jsx("span",{ref:j=>{j&&rt(j)}})},ContainerPortal=i=>{const{children:s,containerRef:o,appendToParentPortal:a}=i,rt=o.current,tt=rt??(typeof window<"u"?document.body:void 0),ot=reactExports.useMemo(()=>{const nt=rt==null?void 0:rt.ownerDocument.createElement("div");return nt&&(nt.className=PORTAL_CLASSNAME),nt},[rt]),[,at]=reactExports.useState({});return useSafeLayoutEffect$1(()=>at({}),[]),useSafeLayoutEffect$1(()=>{if(!(!ot||!tt))return tt.appendChild(ot),()=>{tt.removeChild(ot)}},[ot,tt]),tt&&ot?reactDomExports.createPortal(jsxRuntimeExports.jsx(PortalContextProvider,{value:a?ot:null,children:s}),ot):null};function Portal(i){const s={appendToParentPortal:!0,...i},{containerRef:o,...a}=s;return o?jsxRuntimeExports.jsx(ContainerPortal,{containerRef:o,...a}):jsxRuntimeExports.jsx(DefaultPortal,{...a})}Portal.className=PORTAL_CLASSNAME;Portal.selector=PORTAL_SELECTOR;Portal.displayName="Portal";function useTheme(){const i=reactExports.useContext(ThemeContext);if(!i)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `` or ``");return i}var ColorModeContext=reactExports.createContext({});ColorModeContext.displayName="ColorModeContext";function useColorMode(){const i=reactExports.useContext(ColorModeContext);if(i===void 0)throw new Error("useColorMode must be used within a ColorModeProvider");return i}var classNames={light:"chakra-ui-light",dark:"chakra-ui-dark"};function getColorModeUtils(i={}){const{preventTransition:s=!0}=i,o={setDataset:a=>{const rt=s?o.preventTransition():void 0;document.documentElement.dataset.theme=a,document.documentElement.style.colorScheme=a,rt==null||rt()},setClassName(a){document.body.classList.add(a?classNames.dark:classNames.light),document.body.classList.remove(a?classNames.light:classNames.dark)},query(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme(a){var rt;return((rt=o.query().matches)!=null?rt:a==="dark")?"dark":"light"},addListener(a){const rt=o.query(),tt=ot=>{a(ot.matches?"dark":"light")};return typeof rt.addListener=="function"?rt.addListener(tt):rt.addEventListener("change",tt),()=>{typeof rt.removeListener=="function"?rt.removeListener(tt):rt.removeEventListener("change",tt)}},preventTransition(){const a=document.createElement("style");return a.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(a),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.head.removeChild(a)})})}}};return o}var STORAGE_KEY="chakra-ui-color-mode";function createLocalStorageManager(i){return{ssr:!1,type:"localStorage",get(s){if(!(globalThis!=null&&globalThis.document))return s;let o;try{o=localStorage.getItem(i)||s}catch{}return o||s},set(s){try{localStorage.setItem(i,s)}catch{}}}}var localStorageManager=createLocalStorageManager(STORAGE_KEY),noop$2=()=>{};function getTheme(i,s){return i.type==="cookie"&&i.ssr?i.get(s):s}function ColorModeProvider(i){const{value:s,children:o,options:{useSystemColorMode:a,initialColorMode:rt,disableTransitionOnChange:tt}={},colorModeManager:ot=localStorageManager}=i,at=rt==="dark"?"dark":"light",[nt,it]=reactExports.useState(()=>getTheme(ot,at)),[j,_]=reactExports.useState(()=>getTheme(ot)),{getSystemTheme:$,setClassName:et,setDataset:st,addListener:lt}=reactExports.useMemo(()=>getColorModeUtils({preventTransition:tt}),[tt]),ct=rt==="system"&&!nt?j:nt,ht=reactExports.useCallback(mt=>{const gt=mt==="system"?$():mt;it(gt),et(gt==="dark"),st(gt),ot.set(gt)},[ot,$,et,st]);useSafeLayoutEffect$1(()=>{rt==="system"&&_($())},[]),reactExports.useEffect(()=>{const mt=ot.get();if(mt){ht(mt);return}if(rt==="system"){ht("system");return}ht(at)},[ot,at,rt,ht]);const ut=reactExports.useCallback(()=>{ht(ct==="dark"?"light":"dark")},[ct,ht]);reactExports.useEffect(()=>{if(a)return lt(ht)},[a,lt,ht]);const pt=reactExports.useMemo(()=>({colorMode:s??ct,toggleColorMode:s?noop$2:ut,setColorMode:s?noop$2:ht,forced:s!==void 0}),[ct,ut,ht,s]);return jsxRuntimeExports.jsx(ColorModeContext.Provider,{value:pt,children:o})}ColorModeProvider.displayName="ColorModeProvider";var VALID_VALUES=new Set(["dark","light","system"]);function normalize$1(i){let s=i;return VALID_VALUES.has(s)||(s="light"),s}function getScriptSrc(i={}){const{initialColorMode:s="light",type:o="localStorage",storageKey:a="chakra-ui-color-mode"}=i,rt=normalize$1(s),tt=o==="cookie",ot=`(function(){try{var a=function(o){var l="(prefers-color-scheme: dark)",v=window.matchMedia(l).matches?"dark":"light",e=o==="system"?v:o,d=document.documentElement,m=document.body,i="chakra-ui-light",n="chakra-ui-dark",s=e==="dark";return m.classList.add(s?n:i),m.classList.remove(s?i:n),d.style.colorScheme=e,d.dataset.theme=e,e},u=a,h="${rt}",r="${a}",t=document.cookie.match(new RegExp("(^| )".concat(r,"=([^;]+)"))),c=t?t[2]:null;c?a(c):document.cookie="".concat(r,"=").concat(a(h),"; max-age=31536000; path=/")}catch(a){}})(); `,at=`(function(){try{var a=function(c){var v="(prefers-color-scheme: dark)",h=window.matchMedia(v).matches?"dark":"light",r=c==="system"?h:c,o=document.documentElement,s=document.body,l="chakra-ui-light",d="chakra-ui-dark",i=r==="dark";return s.classList.add(i?d:l),s.classList.remove(i?l:d),o.style.colorScheme=r,o.dataset.theme=r,r},n=a,m="${rt}",e="${a}",t=localStorage.getItem(e);t?a(t):localStorage.setItem(e,a(m))}catch(a){}})(); - `;return`!${et?ot:at}`.trim()}function ColorModeScript(i={}){const{nonce:s}=i;return jsxRuntimeExports.jsx("script",{id:"chakra-script",nonce:s,dangerouslySetInnerHTML:{__html:getScriptSrc(i)}})}function useChakra(){const i=useColorMode(),s=useTheme();return{...i,theme:s}}function getTokenValue(i,s,o){var a,rt;if(s==null)return s;const et=ot=>{var at,nt;return(nt=(at=i.__cssMap)==null?void 0:at[ot])==null?void 0:nt.value};return(rt=(a=et(s))!=null?a:et(o))!=null?rt:o}function getToken(i,s,o){const a=Array.isArray(s)?s:[s],rt=Array.isArray(o)?o:[o];return et=>{const ot=rt.filter(Boolean),at=a.map((nt,it)=>{var j;const _=`${i}.${nt}`;return getTokenValue(et,_,(j=ot[it])!=null?j:nt)});return Array.isArray(s)?at:at[0]}}var cx=(...i)=>i.filter(Boolean).join(" ");function isObject$2(i){const s=typeof i;return i!=null&&(s==="object"||s==="function")&&!Array.isArray(i)}function runIfFn$2(i,...s){return isFunction$4(i)?i(...s):i}var isFunction$4=i=>typeof i=="function",dataAttr=i=>i?"":void 0,ariaAttr=i=>i?!0:void 0;function callAllHandlers$1(...i){return function(o){i.some(a=>(a==null||a(o),o==null?void 0:o.defaultPrevented))}}function callAll(...i){return function(o){i.forEach(a=>{a==null||a(o)})}}var lodash_mergewith={exports:{}};lodash_mergewith.exports;(function(i,s){var o=200,a="__lodash_hash_undefined__",rt=800,et=16,ot=9007199254740991,at="[object Arguments]",nt="[object Array]",it="[object AsyncFunction]",j="[object Boolean]",_="[object Date]",$="[object Error]",tt="[object Function]",st="[object GeneratorFunction]",lt="[object Map]",ct="[object Number]",ht="[object Null]",ut="[object Object]",pt="[object Proxy]",mt="[object RegExp]",gt="[object Set]",dt="[object String]",St="[object Undefined]",xt="[object WeakMap]",yt="[object ArrayBuffer]",_t="[object DataView]",Ct="[object Float32Array]",Et="[object Float64Array]",kt="[object Int8Array]",Tt="[object Int16Array]",$t="[object Int32Array]",It="[object Uint8Array]",Ot="[object Uint8ClampedArray]",Mt="[object Uint16Array]",Dt="[object Uint32Array]",Bt=/[\\^$.*+?()[\]{}|]/g,Kt=/^\[object .+?Constructor\]$/,Wt=/^(?:0|[1-9]\d*)$/,zt={};zt[Ct]=zt[Et]=zt[kt]=zt[Tt]=zt[$t]=zt[It]=zt[Ot]=zt[Mt]=zt[Dt]=!0,zt[at]=zt[nt]=zt[yt]=zt[j]=zt[_t]=zt[_]=zt[$]=zt[tt]=zt[lt]=zt[ct]=zt[ut]=zt[mt]=zt[gt]=zt[dt]=zt[xt]=!1;var Ht=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,Zt=typeof self=="object"&&self&&self.Object===Object&&self,qt=Ht||Zt||Function("return this")(),hr=s&&!s.nodeType&&s,fr=hr&&!0&&i&&!i.nodeType&&i,mr=fr&&fr.exports===hr,gr=mr&&Ht.process,tr=function(){try{var Nt=fr&&fr.require&&fr.require("util").types;return Nt||gr&&gr.binding&&gr.binding("util")}catch{}}(),rr=tr&&tr.isTypedArray;function Qt(Nt,nr,cr){switch(cr.length){case 0:return Nt.call(nr);case 1:return Nt.call(nr,cr[0]);case 2:return Nt.call(nr,cr[0],cr[1]);case 3:return Nt.call(nr,cr[0],cr[1],cr[2])}return Nt.apply(nr,cr)}function xr(Nt,nr){for(var cr=-1,Vr=Array(Nt);++cr-1}function io(Nt,nr){var cr=this.__data__,Vr=Is(cr,Nt);return Vr<0?(++this.size,cr.push([Nt,nr])):cr[Vr][1]=nr,this}ls.prototype.clear=Ns,ls.prototype.delete=ms,ls.prototype.get=no,ls.prototype.has=Vs,ls.prototype.set=io;function us(Nt){var nr=-1,cr=Nt==null?0:Nt.length;for(this.clear();++nr1?cr[Wr-1]:void 0,vn=Wr>2?cr[2]:void 0;for(sn=Nt.length>3&&typeof sn=="function"?(Wr--,sn):void 0,vn&&ys(cr[0],cr[1],vn)&&(sn=Wr<3?void 0:sn,Wr=1),nr=Object(nr);++Vr-1&&Nt%1==0&&Nt0){if(++nr>=rt)return arguments[0]}else nr=0;return Nt.apply(void 0,arguments)}}function vt(Nt){if(Nt!=null){try{return Mn.call(Nt)}catch{}try{return Nt+""}catch{}}return""}function Rt(Nt,nr){return Nt===nr||Nt!==Nt&&nr!==nr}var Ft=gn(function(){return arguments}())?gn:function(Nt){return hn(Nt)&&pn.call(Nt,"callee")&&!Lr.call(Nt,"callee")},Ut=Array.isArray;function sr(Nt){return Nt!=null&&Br(Nt.length)&&!Fr(Nt)}function vr(Nt){return hn(Nt)&&sr(Nt)}var wr=Hr||ir;function Fr(Nt){if(!ln(Nt))return!1;var nr=gs(Nt);return nr==tt||nr==st||nr==it||nr==pt}function Br(Nt){return typeof Nt=="number"&&Nt>-1&&Nt%1==0&&Nt<=ot}function ln(Nt){var nr=typeof Nt;return Nt!=null&&(nr=="object"||nr=="function")}function hn(Nt){return Nt!=null&&typeof Nt=="object"}function jn(Nt){if(!hn(Nt)||gs(Nt)!=ut)return!1;var nr=er(Nt);if(nr===null)return!0;var cr=pn.call(nr,"constructor")&&nr.constructor;return typeof cr=="function"&&cr instanceof cr&&Mn.call(cr)==_r}var Ts=rr?Sr(rr):Qn;function Cs(Nt){return br(Nt,Ls(Nt))}function Ls(Nt){return sr(Nt)?oo(Nt):Jn(Nt)}var yo=$r(function(Nt,nr,cr,Vr){mo(Nt,nr,cr,Vr)});function kn(Nt){return function(){return Nt}}function Tn(Nt){return Nt}function ir(){return!1}i.exports=yo})(lodash_mergewith,lodash_mergewith.exports);var lodash_mergewithExports=lodash_mergewith.exports;const mergeWith=getDefaultExportFromCjs(lodash_mergewithExports);var isImportant=i=>/!(important)?$/.test(i),withoutImportant=i=>typeof i=="string"?i.replace(/!(important)?$/,"").trim():i,tokenToCSSVar=(i,s)=>o=>{const a=String(s),rt=isImportant(a),et=withoutImportant(a),ot=i?`${i}.${et}`:et;let at=isObject$2(o.__cssMap)&&ot in o.__cssMap?o.__cssMap[ot].varRef:s;return at=withoutImportant(at),rt?`${at} !important`:at};function createTransform(i){const{scale:s,transform:o,compose:a}=i;return(et,ot)=>{var at;const nt=tokenToCSSVar(s,et)(ot);let it=(at=o==null?void 0:o(nt,ot))!=null?at:nt;return a&&(it=a(it,ot)),it}}var pipe$2=(...i)=>s=>i.reduce((o,a)=>a(o),s);function toConfig(i,s){return o=>{const a={property:o,scale:i};return a.transform=createTransform({scale:i,transform:s}),a}}var getRtl=({rtl:i,ltr:s})=>o=>o.direction==="rtl"?i:s;function logical(i){const{property:s,scale:o,transform:a}=i;return{scale:o,property:getRtl(s),transform:o?createTransform({scale:o,compose:a}):a}}var transformTemplate=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function getTransformTemplate(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...transformTemplate].join(" ")}function getTransformGpuTemplate(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...transformTemplate].join(" ")}var filterTemplate={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},backdropFilterTemplate={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function getRingTemplate(i){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":i,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}var flexDirectionTemplate={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},directionMap={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},valueSet=new Set(Object.values(directionMap)),globalSet=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),trimSpace=i=>i.trim();function parseGradient(i,s){if(i==null||globalSet.has(i))return i;if(!(isCSSFunction(i)||globalSet.has(i)))return`url('${i}')`;const rt=/(^[a-z-A-Z]+)\((.*)\)/g.exec(i),et=rt==null?void 0:rt[1],ot=rt==null?void 0:rt[2];if(!et||!ot)return i;const at=et.includes("-gradient")?et:`${et}-gradient`,[nt,...it]=ot.split(",").map(trimSpace).filter(Boolean);if((it==null?void 0:it.length)===0)return i;const j=nt in directionMap?directionMap[nt]:nt;it.unshift(j);const _=it.map($=>{if(valueSet.has($))return $;const tt=$.indexOf(" "),[st,lt]=tt!==-1?[$.substr(0,tt),$.substr(tt+1)]:[$],ct=isCSSFunction(lt)?lt:lt&<.split(" "),ht=`colors.${st}`,ut=ht in s.__cssMap?s.__cssMap[ht].varRef:st;return ct?[ut,...Array.isArray(ct)?ct:[ct]].join(" "):ut});return`${at}(${_.join(", ")})`}var isCSSFunction=i=>typeof i=="string"&&i.includes("(")&&i.includes(")"),gradientTransform=(i,s)=>parseGradient(i,s??{});function isCssVar(i){return/^var\(--.+\)$/.test(i)}var analyzeCSSValue=i=>{const s=parseFloat(i.toString()),o=i.toString().replace(String(s),"");return{unitless:!o,value:s,unit:o}},wrap=i=>s=>`${i}(${s})`,transformFunctions={filter(i){return i!=="auto"?i:filterTemplate},backdropFilter(i){return i!=="auto"?i:backdropFilterTemplate},ring(i){return getRingTemplate(transformFunctions.px(i))},bgClip(i){return i==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:i}},transform(i){return i==="auto"?getTransformTemplate():i==="auto-gpu"?getTransformGpuTemplate():i},vh(i){return i==="$100vh"?"var(--chakra-vh)":i},px(i){if(i==null)return i;const{unitless:s}=analyzeCSSValue(i);return s||typeof i=="number"?`${i}px`:i},fraction(i){return typeof i!="number"||i>1?i:`${i*100}%`},float(i,s){const o={left:"right",right:"left"};return s.direction==="rtl"?o[i]:i},degree(i){if(isCssVar(i)||i==null)return i;const s=typeof i=="string"&&!i.endsWith("deg");return typeof i=="number"||s?`${i}deg`:i},gradient:gradientTransform,blur:wrap("blur"),opacity:wrap("opacity"),brightness:wrap("brightness"),contrast:wrap("contrast"),dropShadow:wrap("drop-shadow"),grayscale:wrap("grayscale"),hueRotate:i=>wrap("hue-rotate")(transformFunctions.degree(i)),invert:wrap("invert"),saturate:wrap("saturate"),sepia:wrap("sepia"),bgImage(i){return i==null||isCSSFunction(i)||globalSet.has(i)?i:`url(${i})`},outline(i){const s=String(i)==="0"||String(i)==="none";return i!==null&&s?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:i}},flexDirection(i){var s;const{space:o,divide:a}=(s=flexDirectionTemplate[i])!=null?s:{},rt={flexDirection:i};return o&&(rt[o]=1),a&&(rt[a]=1),rt}},t$1={borderWidths:toConfig("borderWidths"),borderStyles:toConfig("borderStyles"),colors:toConfig("colors"),borders:toConfig("borders"),gradients:toConfig("gradients",transformFunctions.gradient),radii:toConfig("radii",transformFunctions.px),space:toConfig("space",pipe$2(transformFunctions.vh,transformFunctions.px)),spaceT:toConfig("space",pipe$2(transformFunctions.vh,transformFunctions.px)),degreeT(i){return{property:i,transform:transformFunctions.degree}},prop(i,s,o){return{property:i,scale:s,...s&&{transform:createTransform({scale:s,transform:o})}}},propT(i,s){return{property:i,transform:s}},sizes:toConfig("sizes",pipe$2(transformFunctions.vh,transformFunctions.px)),sizesT:toConfig("sizes",pipe$2(transformFunctions.vh,transformFunctions.fraction)),shadows:toConfig("shadows"),logical,blur:toConfig("blur",transformFunctions.blur)},background={background:t$1.colors("background"),backgroundColor:t$1.colors("backgroundColor"),backgroundImage:t$1.gradients("backgroundImage"),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:transformFunctions.bgClip},bgSize:t$1.prop("backgroundSize"),bgPosition:t$1.prop("backgroundPosition"),bg:t$1.colors("background"),bgColor:t$1.colors("backgroundColor"),bgPos:t$1.prop("backgroundPosition"),bgRepeat:t$1.prop("backgroundRepeat"),bgAttachment:t$1.prop("backgroundAttachment"),bgGradient:t$1.gradients("backgroundImage"),bgClip:{transform:transformFunctions.bgClip}};Object.assign(background,{bgImage:background.backgroundImage,bgImg:background.backgroundImage});var border={border:t$1.borders("border"),borderWidth:t$1.borderWidths("borderWidth"),borderStyle:t$1.borderStyles("borderStyle"),borderColor:t$1.colors("borderColor"),borderRadius:t$1.radii("borderRadius"),borderTop:t$1.borders("borderTop"),borderBlockStart:t$1.borders("borderBlockStart"),borderTopLeftRadius:t$1.radii("borderTopLeftRadius"),borderStartStartRadius:t$1.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:t$1.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:t$1.radii("borderTopRightRadius"),borderStartEndRadius:t$1.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:t$1.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:t$1.borders("borderRight"),borderInlineEnd:t$1.borders("borderInlineEnd"),borderBottom:t$1.borders("borderBottom"),borderBlockEnd:t$1.borders("borderBlockEnd"),borderBottomLeftRadius:t$1.radii("borderBottomLeftRadius"),borderBottomRightRadius:t$1.radii("borderBottomRightRadius"),borderLeft:t$1.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:t$1.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:t$1.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:t$1.borders(["borderLeft","borderRight"]),borderInline:t$1.borders("borderInline"),borderY:t$1.borders(["borderTop","borderBottom"]),borderBlock:t$1.borders("borderBlock"),borderTopWidth:t$1.borderWidths("borderTopWidth"),borderBlockStartWidth:t$1.borderWidths("borderBlockStartWidth"),borderTopColor:t$1.colors("borderTopColor"),borderBlockStartColor:t$1.colors("borderBlockStartColor"),borderTopStyle:t$1.borderStyles("borderTopStyle"),borderBlockStartStyle:t$1.borderStyles("borderBlockStartStyle"),borderBottomWidth:t$1.borderWidths("borderBottomWidth"),borderBlockEndWidth:t$1.borderWidths("borderBlockEndWidth"),borderBottomColor:t$1.colors("borderBottomColor"),borderBlockEndColor:t$1.colors("borderBlockEndColor"),borderBottomStyle:t$1.borderStyles("borderBottomStyle"),borderBlockEndStyle:t$1.borderStyles("borderBlockEndStyle"),borderLeftWidth:t$1.borderWidths("borderLeftWidth"),borderInlineStartWidth:t$1.borderWidths("borderInlineStartWidth"),borderLeftColor:t$1.colors("borderLeftColor"),borderInlineStartColor:t$1.colors("borderInlineStartColor"),borderLeftStyle:t$1.borderStyles("borderLeftStyle"),borderInlineStartStyle:t$1.borderStyles("borderInlineStartStyle"),borderRightWidth:t$1.borderWidths("borderRightWidth"),borderInlineEndWidth:t$1.borderWidths("borderInlineEndWidth"),borderRightColor:t$1.colors("borderRightColor"),borderInlineEndColor:t$1.colors("borderInlineEndColor"),borderRightStyle:t$1.borderStyles("borderRightStyle"),borderInlineEndStyle:t$1.borderStyles("borderInlineEndStyle"),borderTopRadius:t$1.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:t$1.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:t$1.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:t$1.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(border,{rounded:border.borderRadius,roundedTop:border.borderTopRadius,roundedTopLeft:border.borderTopLeftRadius,roundedTopRight:border.borderTopRightRadius,roundedTopStart:border.borderStartStartRadius,roundedTopEnd:border.borderStartEndRadius,roundedBottom:border.borderBottomRadius,roundedBottomLeft:border.borderBottomLeftRadius,roundedBottomRight:border.borderBottomRightRadius,roundedBottomStart:border.borderEndStartRadius,roundedBottomEnd:border.borderEndEndRadius,roundedLeft:border.borderLeftRadius,roundedRight:border.borderRightRadius,roundedStart:border.borderInlineStartRadius,roundedEnd:border.borderInlineEndRadius,borderStart:border.borderInlineStart,borderEnd:border.borderInlineEnd,borderTopStartRadius:border.borderStartStartRadius,borderTopEndRadius:border.borderStartEndRadius,borderBottomStartRadius:border.borderEndStartRadius,borderBottomEndRadius:border.borderEndEndRadius,borderStartRadius:border.borderInlineStartRadius,borderEndRadius:border.borderInlineEndRadius,borderStartWidth:border.borderInlineStartWidth,borderEndWidth:border.borderInlineEndWidth,borderStartColor:border.borderInlineStartColor,borderEndColor:border.borderInlineEndColor,borderStartStyle:border.borderInlineStartStyle,borderEndStyle:border.borderInlineEndStyle});var color$1={color:t$1.colors("color"),textColor:t$1.colors("color"),fill:t$1.colors("fill"),stroke:t$1.colors("stroke")},effect={boxShadow:t$1.shadows("boxShadow"),mixBlendMode:!0,blendMode:t$1.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:t$1.prop("backgroundBlendMode"),opacity:!0};Object.assign(effect,{shadow:effect.boxShadow});var filter$2={filter:{transform:transformFunctions.filter},blur:t$1.blur("--chakra-blur"),brightness:t$1.propT("--chakra-brightness",transformFunctions.brightness),contrast:t$1.propT("--chakra-contrast",transformFunctions.contrast),hueRotate:t$1.propT("--chakra-hue-rotate",transformFunctions.hueRotate),invert:t$1.propT("--chakra-invert",transformFunctions.invert),saturate:t$1.propT("--chakra-saturate",transformFunctions.saturate),dropShadow:t$1.propT("--chakra-drop-shadow",transformFunctions.dropShadow),backdropFilter:{transform:transformFunctions.backdropFilter},backdropBlur:t$1.blur("--chakra-backdrop-blur"),backdropBrightness:t$1.propT("--chakra-backdrop-brightness",transformFunctions.brightness),backdropContrast:t$1.propT("--chakra-backdrop-contrast",transformFunctions.contrast),backdropHueRotate:t$1.propT("--chakra-backdrop-hue-rotate",transformFunctions.hueRotate),backdropInvert:t$1.propT("--chakra-backdrop-invert",transformFunctions.invert),backdropSaturate:t$1.propT("--chakra-backdrop-saturate",transformFunctions.saturate)},flexbox={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:transformFunctions.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:t$1.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:t$1.space("gap"),rowGap:t$1.space("rowGap"),columnGap:t$1.space("columnGap")};Object.assign(flexbox,{flexDir:flexbox.flexDirection});var grid={gridGap:t$1.space("gridGap"),gridColumnGap:t$1.space("gridColumnGap"),gridRowGap:t$1.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0},interactivity={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:transformFunctions.outline},outlineOffset:!0,outlineColor:t$1.colors("outlineColor")},layout$1={width:t$1.sizesT("width"),inlineSize:t$1.sizesT("inlineSize"),height:t$1.sizes("height"),blockSize:t$1.sizes("blockSize"),boxSize:t$1.sizes(["width","height"]),minWidth:t$1.sizes("minWidth"),minInlineSize:t$1.sizes("minInlineSize"),minHeight:t$1.sizes("minHeight"),minBlockSize:t$1.sizes("minBlockSize"),maxWidth:t$1.sizes("maxWidth"),maxInlineSize:t$1.sizes("maxInlineSize"),maxHeight:t$1.sizes("maxHeight"),maxBlockSize:t$1.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,aspectRatio:!0,hideFrom:{scale:"breakpoints",transform:(i,s)=>{var o,a,rt;return{[`@media screen and (min-width: ${(rt=(a=(o=s.__breakpoints)==null?void 0:o.get(i))==null?void 0:a.minW)!=null?rt:i})`]:{display:"none"}}}},hideBelow:{scale:"breakpoints",transform:(i,s)=>{var o,a,rt;return{[`@media screen and (max-width: ${(rt=(a=(o=s.__breakpoints)==null?void 0:o.get(i))==null?void 0:a._minW)!=null?rt:i})`]:{display:"none"}}}},verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:t$1.propT("float",transformFunctions.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(layout$1,{w:layout$1.width,h:layout$1.height,minW:layout$1.minWidth,maxW:layout$1.maxWidth,minH:layout$1.minHeight,maxH:layout$1.maxHeight,overscroll:layout$1.overscrollBehavior,overscrollX:layout$1.overscrollBehaviorX,overscrollY:layout$1.overscrollBehaviorY});var list$2={listStyleType:!0,listStylePosition:!0,listStylePos:t$1.prop("listStylePosition"),listStyleImage:!0,listStyleImg:t$1.prop("listStyleImage")};function get$3(i,s,o,a){const rt=typeof s=="string"?s.split("."):[s];for(a=0;a{const s=new WeakMap;return(a,rt,et,ot)=>{if(typeof a>"u")return i(a,rt,et);s.has(a)||s.set(a,new Map);const at=s.get(a);if(at.has(rt))return at.get(rt);const nt=i(a,rt,et,ot);return at.set(rt,nt),nt}},memoizedGet$1=memoize$2(get$3),srOnly={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},srFocusable={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},getWithPriority=(i,s,o)=>{const a={},rt=memoizedGet$1(i,s,{});for(const et in rt)et in o&&o[et]!=null||(a[et]=rt[et]);return a},others={srOnly:{transform(i){return i===!0?srOnly:i==="focusable"?srFocusable:{}}},layerStyle:{processResult:!0,transform:(i,s,o)=>getWithPriority(s,`layerStyles.${i}`,o)},textStyle:{processResult:!0,transform:(i,s,o)=>getWithPriority(s,`textStyles.${i}`,o)},apply:{processResult:!0,transform:(i,s,o)=>getWithPriority(s,i,o)}},position={position:!0,pos:t$1.prop("position"),zIndex:t$1.prop("zIndex","zIndices"),inset:t$1.spaceT("inset"),insetX:t$1.spaceT(["left","right"]),insetInline:t$1.spaceT("insetInline"),insetY:t$1.spaceT(["top","bottom"]),insetBlock:t$1.spaceT("insetBlock"),top:t$1.spaceT("top"),insetBlockStart:t$1.spaceT("insetBlockStart"),bottom:t$1.spaceT("bottom"),insetBlockEnd:t$1.spaceT("insetBlockEnd"),left:t$1.spaceT("left"),insetInlineStart:t$1.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:t$1.spaceT("right"),insetInlineEnd:t$1.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(position,{insetStart:position.insetInlineStart,insetEnd:position.insetInlineEnd});var ring={ring:{transform:transformFunctions.ring},ringColor:t$1.colors("--chakra-ring-color"),ringOffset:t$1.prop("--chakra-ring-offset-width"),ringOffsetColor:t$1.colors("--chakra-ring-offset-color"),ringInset:t$1.prop("--chakra-ring-inset")},space={margin:t$1.spaceT("margin"),marginTop:t$1.spaceT("marginTop"),marginBlockStart:t$1.spaceT("marginBlockStart"),marginRight:t$1.spaceT("marginRight"),marginInlineEnd:t$1.spaceT("marginInlineEnd"),marginBottom:t$1.spaceT("marginBottom"),marginBlockEnd:t$1.spaceT("marginBlockEnd"),marginLeft:t$1.spaceT("marginLeft"),marginInlineStart:t$1.spaceT("marginInlineStart"),marginX:t$1.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:t$1.spaceT("marginInline"),marginY:t$1.spaceT(["marginTop","marginBottom"]),marginBlock:t$1.spaceT("marginBlock"),padding:t$1.space("padding"),paddingTop:t$1.space("paddingTop"),paddingBlockStart:t$1.space("paddingBlockStart"),paddingRight:t$1.space("paddingRight"),paddingBottom:t$1.space("paddingBottom"),paddingBlockEnd:t$1.space("paddingBlockEnd"),paddingLeft:t$1.space("paddingLeft"),paddingInlineStart:t$1.space("paddingInlineStart"),paddingInlineEnd:t$1.space("paddingInlineEnd"),paddingX:t$1.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:t$1.space("paddingInline"),paddingY:t$1.space(["paddingTop","paddingBottom"]),paddingBlock:t$1.space("paddingBlock")};Object.assign(space,{m:space.margin,mt:space.marginTop,mr:space.marginRight,me:space.marginInlineEnd,marginEnd:space.marginInlineEnd,mb:space.marginBottom,ml:space.marginLeft,ms:space.marginInlineStart,marginStart:space.marginInlineStart,mx:space.marginX,my:space.marginY,p:space.padding,pt:space.paddingTop,py:space.paddingY,px:space.paddingX,pb:space.paddingBottom,pl:space.paddingLeft,ps:space.paddingInlineStart,paddingStart:space.paddingInlineStart,pr:space.paddingRight,pe:space.paddingInlineEnd,paddingEnd:space.paddingInlineEnd});var textDecoration={textDecorationColor:t$1.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:t$1.shadows("textShadow")},transform={clipPath:!0,transform:t$1.propT("transform",transformFunctions.transform),transformOrigin:!0,translateX:t$1.spaceT("--chakra-translate-x"),translateY:t$1.spaceT("--chakra-translate-y"),skewX:t$1.degreeT("--chakra-skew-x"),skewY:t$1.degreeT("--chakra-skew-y"),scaleX:t$1.prop("--chakra-scale-x"),scaleY:t$1.prop("--chakra-scale-y"),scale:t$1.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:t$1.degreeT("--chakra-rotate")},transition$1={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:t$1.prop("transitionDuration","transition.duration"),transitionProperty:t$1.prop("transitionProperty","transition.property"),transitionTimingFunction:t$1.prop("transitionTimingFunction","transition.easing")},typography$1={fontFamily:t$1.prop("fontFamily","fonts"),fontSize:t$1.prop("fontSize","fontSizes",transformFunctions.px),fontWeight:t$1.prop("fontWeight","fontWeights"),lineHeight:t$1.prop("lineHeight","lineHeights"),letterSpacing:t$1.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,textIndent:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,isTruncated:{transform(i){if(i===!0)return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},scroll={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:t$1.spaceT("scrollMargin"),scrollMarginTop:t$1.spaceT("scrollMarginTop"),scrollMarginBottom:t$1.spaceT("scrollMarginBottom"),scrollMarginLeft:t$1.spaceT("scrollMarginLeft"),scrollMarginRight:t$1.spaceT("scrollMarginRight"),scrollMarginX:t$1.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:t$1.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:t$1.spaceT("scrollPadding"),scrollPaddingTop:t$1.spaceT("scrollPaddingTop"),scrollPaddingBottom:t$1.spaceT("scrollPaddingBottom"),scrollPaddingLeft:t$1.spaceT("scrollPaddingLeft"),scrollPaddingRight:t$1.spaceT("scrollPaddingRight"),scrollPaddingX:t$1.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:t$1.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function resolveReference(i){return isObject$2(i)&&i.reference?i.reference:String(i)}var toExpression=(i,...s)=>s.map(resolveReference).join(` ${i} `).replace(/calc/g,""),add$1=(...i)=>`calc(${toExpression("+",...i)})`,subtract$1=(...i)=>`calc(${toExpression("-",...i)})`,multiply$1=(...i)=>`calc(${toExpression("*",...i)})`,divide$1=(...i)=>`calc(${toExpression("/",...i)})`,negate$1=i=>{const s=resolveReference(i);return s!=null&&!Number.isNaN(parseFloat(s))?String(s).startsWith("-")?String(s).slice(1):`-${s}`:multiply$1(s,-1)},calc$1=Object.assign(i=>({add:(...s)=>calc$1(add$1(i,...s)),subtract:(...s)=>calc$1(subtract$1(i,...s)),multiply:(...s)=>calc$1(multiply$1(i,...s)),divide:(...s)=>calc$1(divide$1(i,...s)),negate:()=>calc$1(negate$1(i)),toString:()=>i.toString()}),{add:add$1,subtract:subtract$1,multiply:multiply$1,divide:divide$1,negate:negate$1});function replaceWhiteSpace$1(i,s="-"){return i.replace(/\s+/g,s)}function escape$1(i){const s=replaceWhiteSpace$1(i.toString());return escapeSymbol(escapeDot(s))}function escapeDot(i){return i.includes("\\.")?i:!Number.isInteger(parseFloat(i.toString()))?i.replace(".","\\."):i}function escapeSymbol(i){return i.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function addPrefix$1(i,s=""){return[s,i].filter(Boolean).join("-")}function toVarReference(i,s){return`var(${i}${s?`, ${s}`:""})`}function toVarDefinition(i,s=""){return escape$1(`--${addPrefix$1(i,s)}`)}function cssVar$1(i,s,o){const a=toVarDefinition(i,o);return{variable:a,reference:toVarReference(a,s)}}function defineCssVars(i,s){const o={};for(const a of s){if(Array.isArray(a)){const[rt,et]=a;o[rt]=cssVar$1(`${i}-${rt}`,et);continue}o[a]=cssVar$1(`${i}-${a}`)}return o}function getLastItem(i){const s=i==null?0:i.length;return s?i[s-1]:void 0}function analyzeCSSValue2(i){const s=parseFloat(i.toString()),o=i.toString().replace(String(s),"");return{unitless:!o,value:s,unit:o}}function px$1(i){if(i==null)return i;const{unitless:s}=analyzeCSSValue2(i);return s||typeof i=="number"?`${i}px`:i}var sortByBreakpointValue=(i,s)=>parseInt(i[1],10)>parseInt(s[1],10)?1:-1,sortBps=i=>Object.fromEntries(Object.entries(i).sort(sortByBreakpointValue));function normalize(i){const s=sortBps(i);return Object.assign(Object.values(s),s)}function keys(i){const s=Object.keys(sortBps(i));return new Set(s)}function subtract2(i){var s;if(!i)return i;i=(s=px$1(i))!=null?s:i;const o=-.02;return typeof i=="number"?`${i+o}`:i.replace(/(\d+\.?\d*)/u,a=>`${parseFloat(a)+o}`)}function toMediaQueryString(i,s){const o=["@media screen"];return i&&o.push("and",`(min-width: ${px$1(i)})`),s&&o.push("and",`(max-width: ${px$1(s)})`),o.join(" ")}function analyzeBreakpoints(i){var s;if(!i)return null;i.base=(s=i.base)!=null?s:"0px";const o=normalize(i),a=Object.entries(i).sort(sortByBreakpointValue).map(([ot,at],nt,it)=>{var j;let[,_]=(j=it[nt+1])!=null?j:[];return _=parseFloat(_)>0?subtract2(_):void 0,{_minW:subtract2(at),breakpoint:ot,minW:at,maxW:_,maxWQuery:toMediaQueryString(null,_),minWQuery:toMediaQueryString(at),minMaxQuery:toMediaQueryString(at,_)}}),rt=keys(i),et=Array.from(rt.values());return{keys:rt,normalized:o,isResponsive(ot){const at=Object.keys(ot);return at.length>0&&at.every(nt=>rt.has(nt))},asObject:sortBps(i),asArray:normalize(i),details:a,get(ot){return a.find(at=>at.breakpoint===ot)},media:[null,...o.map(ot=>toMediaQueryString(ot)).slice(1)],toArrayValue(ot){if(!isObject$2(ot))throw new Error("toArrayValue: value must be an object");const at=et.map(nt=>{var it;return(it=ot[nt])!=null?it:null});for(;getLastItem(at)===null;)at.pop();return at},toObjectValue(ot){if(!Array.isArray(ot))throw new Error("toObjectValue: value must be an array");return ot.reduce((at,nt,it)=>{const j=et[it];return j!=null&&nt!=null&&(at[j]=nt),at},{})}}}var state={hover:(i,s)=>`${i}:hover ${s}, ${i}[data-hover] ${s}`,focus:(i,s)=>`${i}:focus ${s}, ${i}[data-focus] ${s}`,focusVisible:(i,s)=>`${i}:focus-visible ${s}`,focusWithin:(i,s)=>`${i}:focus-within ${s}`,active:(i,s)=>`${i}:active ${s}, ${i}[data-active] ${s}`,disabled:(i,s)=>`${i}:disabled ${s}, ${i}[data-disabled] ${s}`,invalid:(i,s)=>`${i}:invalid ${s}, ${i}[data-invalid] ${s}`,checked:(i,s)=>`${i}:checked ${s}, ${i}[data-checked] ${s}`,indeterminate:(i,s)=>`${i}:indeterminate ${s}, ${i}[aria-checked=mixed] ${s}, ${i}[data-indeterminate] ${s}`,readOnly:(i,s)=>`${i}:read-only ${s}, ${i}[readonly] ${s}, ${i}[data-read-only] ${s}`,expanded:(i,s)=>`${i}:read-only ${s}, ${i}[aria-expanded=true] ${s}, ${i}[data-expanded] ${s}`,placeholderShown:(i,s)=>`${i}:placeholder-shown ${s}`},toGroup=i=>merge(s=>i(s,"&"),"[role=group]","[data-group]",".group"),toPeer=i=>merge(s=>i(s,"~ &"),"[data-peer]",".peer"),merge=(i,...s)=>s.map(i).join(", "),pseudoSelectors={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty",_expanded:"&[aria-expanded=true], &[data-expanded]",_checked:"&[aria-checked=true], &[data-checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_firstLetter:"&::first-letter",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate]",_groupHover:toGroup(state.hover),_peerHover:toPeer(state.hover),_groupFocus:toGroup(state.focus),_peerFocus:toPeer(state.focus),_groupFocusVisible:toGroup(state.focusVisible),_peerFocusVisible:toPeer(state.focusVisible),_groupActive:toGroup(state.active),_peerActive:toPeer(state.active),_groupDisabled:toGroup(state.disabled),_peerDisabled:toPeer(state.disabled),_groupInvalid:toGroup(state.invalid),_peerInvalid:toPeer(state.invalid),_groupChecked:toGroup(state.checked),_peerChecked:toPeer(state.checked),_groupFocusWithin:toGroup(state.focusWithin),_peerFocusWithin:toPeer(state.focusWithin),_peerPlaceholderShown:toPeer(state.placeholderShown),_placeholder:"&::placeholder",_placeholderShown:"&:placeholder-shown",_fullScreen:"&:fullscreen",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]",_horizontal:"&[data-orientation=horizontal]",_vertical:"&[data-orientation=vertical]"},pseudoPropNames=Object.keys(pseudoSelectors);function tokenToCssVar(i,s){return cssVar$1(String(i).replace(/\./g,"-"),void 0,s)}function createThemeVars(i,s){let o={};const a={};for(const[rt,et]of Object.entries(i)){const{isSemantic:ot,value:at}=et,{variable:nt,reference:it}=tokenToCssVar(rt,s==null?void 0:s.cssVarPrefix);if(!ot){if(rt.startsWith("space")){const $=rt.split("."),[tt,...st]=$,lt=`${tt}.-${st.join(".")}`,ct=calc$1.negate(at),ht=calc$1.negate(it);a[lt]={value:ct,var:nt,varRef:ht}}o[nt]=at,a[rt]={value:at,var:nt,varRef:it};continue}const j=$=>{const st=[String(rt).split(".")[0],$].join(".");if(!i[st])return $;const{reference:ct}=tokenToCssVar(st,s==null?void 0:s.cssVarPrefix);return ct},_=isObject$2(at)?at:{default:at};o=mergeWith(o,Object.entries(_).reduce(($,[tt,st])=>{var lt,ct;if(!st)return $;const ht=j(`${st}`);if(tt==="default")return $[nt]=ht,$;const ut=(ct=(lt=pseudoSelectors)==null?void 0:lt[tt])!=null?ct:tt;return $[ut]={[nt]:ht},$},{})),a[rt]={value:it,var:nt,varRef:it}}return{cssVars:o,cssMap:a}}function omit$2(i,s=[]){const o=Object.assign({},i);for(const a of s)a in o&&delete o[a];return o}function pick$1(i,s){const o={};for(const a of s)a in i&&(o[a]=i[a]);return o}function isObject5(i){return typeof i=="object"&&i!=null&&!Array.isArray(i)}function walkObject(i,s,o={}){const{stop:a,getKey:rt}=o;function et(ot,at=[]){var nt;if(isObject5(ot)||Array.isArray(ot)){const it={};for(const[j,_]of Object.entries(ot)){const $=(nt=rt==null?void 0:rt(j))!=null?nt:j,tt=[...at,$];if(a!=null&&a(ot,tt))return s(ot,at);it[$]=et(_,tt)}return it}return s(ot,at)}return et(i)}var tokens=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","gradients","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur","breakpoints"];function extractTokens(i){return pick$1(i,tokens)}function extractSemanticTokens(i){return i.semanticTokens}function omitVars(i){const{__cssMap:s,__cssVars:o,__breakpoints:a,...rt}=i;return rt}var isSemanticCondition=i=>pseudoPropNames.includes(i)||i==="default";function flattenTokens({tokens:i,semanticTokens:s}){const o={};return walkObject(i,(a,rt)=>{a!=null&&(o[rt.join(".")]={isSemantic:!1,value:a})}),walkObject(s,(a,rt)=>{a!=null&&(o[rt.join(".")]={isSemantic:!0,value:a})},{stop:a=>Object.keys(a).every(isSemanticCondition)}),o}function toCSSVar(i){var s;const o=omitVars(i),a=extractTokens(o),rt=extractSemanticTokens(o),et=flattenTokens({tokens:a,semanticTokens:rt}),ot=(s=o.config)==null?void 0:s.cssVarPrefix,{cssMap:at,cssVars:nt}=createThemeVars(et,{cssVarPrefix:ot});return Object.assign(o,{__cssVars:{...{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},...nt},__cssMap:at,__breakpoints:analyzeBreakpoints(o.breakpoints)}),o}var systemProps=mergeWith({},background,border,color$1,flexbox,layout$1,filter$2,ring,interactivity,grid,others,position,effect,space,scroll,typography$1,textDecoration,transform,list$2,transition$1),layoutSystem=Object.assign({},space,layout$1,flexbox,grid,position),layoutPropNames=Object.keys(layoutSystem),propNames=[...Object.keys(systemProps),...pseudoPropNames],styleProps={...systemProps,...pseudoSelectors},isStyleProp=i=>i in styleProps,expandResponsive=i=>s=>{if(!s.__breakpoints)return i;const{isResponsive:o,toArrayValue:a,media:rt}=s.__breakpoints,et={};for(const ot in i){let at=runIfFn$2(i[ot],s);if(at==null)continue;if(at=isObject$2(at)&&o(at)?a(at):at,!Array.isArray(at)){et[ot]=at;continue}const nt=at.slice(0,rt.length).length;for(let it=0;iti.startsWith("--")&&typeof s=="string"&&!isCssVar2(s),resolveTokenValue=(i,s)=>{var o,a;if(s==null)return s;const rt=nt=>{var it,j;return(j=(it=i.__cssMap)==null?void 0:it[nt])==null?void 0:j.varRef},et=nt=>{var it;return(it=rt(nt))!=null?it:nt},[ot,at]=splitByComma(s);return s=(a=(o=rt(ot))!=null?o:et(at))!=null?a:et(s),s};function getCss(i){const{configs:s={},pseudos:o={},theme:a}=i,rt=(et,ot=!1)=>{var at,nt,it;const j=runIfFn$2(et,a),_=expandResponsive(j)(a);let $={};for(let tt in _){const st=_[tt];let lt=runIfFn$2(st,a);tt in o&&(tt=o[tt]),isCSSVariableTokenValue(tt,lt)&&(lt=resolveTokenValue(a,lt));let ct=s[tt];if(ct===!0&&(ct={property:tt}),isObject$2(lt)){$[tt]=(at=$[tt])!=null?at:{},$[tt]=mergeWith({},$[tt],rt(lt,!0));continue}let ht=(it=(nt=ct==null?void 0:ct.transform)==null?void 0:nt.call(ct,lt,a,j))!=null?it:lt;ht=ct!=null&&ct.processResult?rt(ht,!0):ht;const ut=runIfFn$2(ct==null?void 0:ct.property,a);if(!ot&&(ct!=null&&ct.static)){const pt=runIfFn$2(ct.static,a);$=mergeWith({},$,pt)}if(ut&&Array.isArray(ut)){for(const pt of ut)$[pt]=ht;continue}if(ut){ut==="&"&&isObject$2(ht)?$=mergeWith({},$,ht):$[ut]=ht;continue}if(isObject$2(ht)){$=mergeWith({},$,ht);continue}$[tt]=ht}return $};return rt}var css=i=>s=>getCss({theme:s,pseudos:pseudoSelectors,configs:systemProps})(i);function defineStyle(i){return i}function defineStyleConfig(i){return i}function createMultiStyleConfigHelpers(i){return{definePartsStyle(s){return s},defineMultiStyleConfig(s){return{parts:i,...s}}}}function normalize2(i,s){if(Array.isArray(i))return i;if(isObject$2(i))return s(i);if(i!=null)return[i]}function getNextIndex(i,s){for(let o=s+1;o{mergeWith(it,{[pt]:$?ut[pt]:{[ht]:ut[pt]}})});continue}if(!tt){$?mergeWith(it,ut):it[ht]=ut;continue}it[ht]=ut}}return it}}function resolveStyleConfig(i){return s=>{var o;const{variant:a,size:rt,theme:et}=s,ot=createResolver(et);return mergeWith({},runIfFn$2((o=i.baseStyle)!=null?o:{},s),ot(i,"sizes",rt,s),ot(i,"variants",a,s))}}function omitThemingProps(i){return omit$2(i,["styleConfig","size","variant","colorScheme"])}var requiredChakraThemeKeys=["borders","breakpoints","colors","components","config","direction","fonts","fontSizes","fontWeights","letterSpacings","lineHeights","radii","shadows","sizes","space","styles","transition","zIndices"];function isChakraTheme(i){return isObject$2(i)?requiredChakraThemeKeys.every(s=>Object.prototype.hasOwnProperty.call(i,s)):!1}var transitionProperty={common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},transitionTimingFunction={"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},transitionDuration={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},transition={property:transitionProperty,easing:transitionTimingFunction,duration:transitionDuration},transition_default=transition,zIndices={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},z_index_default=zIndices,borders$1={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},borders_default=borders$1,breakpoints$1={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},breakpoints_default=breakpoints$1,colors={transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},linkedin:{50:"#E8F4F9",100:"#CFEDFB",200:"#9BDAF3",300:"#68C7EC",400:"#34B3E4",500:"#00A0DC",600:"#008CC9",700:"#0077B5",800:"#005E93",900:"#004471"},facebook:{50:"#E8F4F9",100:"#D9DEE9",200:"#B7C2DA",300:"#6482C0",400:"#4267B2",500:"#385898",600:"#314E89",700:"#29487D",800:"#223B67",900:"#1E355B"},messenger:{50:"#D0E6FF",100:"#B9DAFF",200:"#A2CDFF",300:"#7AB8FF",400:"#2E90FF",500:"#0078FF",600:"#0063D1",700:"#0052AC",800:"#003C7E",900:"#002C5C"},whatsapp:{50:"#dffeec",100:"#b9f5d0",200:"#90edb3",300:"#65e495",400:"#3cdd78",500:"#22c35e",600:"#179848",700:"#0c6c33",800:"#01421c",900:"#001803"},twitter:{50:"#E5F4FD",100:"#C8E9FB",200:"#A8DCFA",300:"#83CDF7",400:"#57BBF5",500:"#1DA1F2",600:"#1A94DA",700:"#1681BF",800:"#136B9E",900:"#0D4D71"},telegram:{50:"#E3F2F9",100:"#C5E4F3",200:"#A2D4EC",300:"#7AC1E4",400:"#47A9DA",500:"#0088CC",600:"#007AB8",700:"#006BA1",800:"#005885",900:"#003F5E"}},colors_default=colors,radii={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},radius_default=radii,shadows={xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},shadows_default=shadows,blur={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},blur_default=blur,typography={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},typography_default=typography,spacing={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},largeSizes={max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"},container={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},sizes$m={...spacing,...largeSizes,container},sizes_default=sizes$m,foundations={breakpoints:breakpoints_default,zIndices:z_index_default,radii:radius_default,blur:blur_default,colors:colors_default,...typography_default,sizes:sizes_default,shadows:shadows_default,space:spacing,borders:borders_default,transition:transition_default},{defineMultiStyleConfig:defineMultiStyleConfig$p,definePartsStyle:definePartsStyle$p}=createMultiStyleConfigHelpers(["stepper","step","title","description","indicator","separator","icon","number"]),$size$4=cssVar$1("stepper-indicator-size"),$iconSize=cssVar$1("stepper-icon-size"),$titleFontSize=cssVar$1("stepper-title-font-size"),$descFontSize=cssVar$1("stepper-description-font-size"),$accentColor=cssVar$1("stepper-accent-color"),baseStyle$F=definePartsStyle$p(({colorScheme:i})=>({stepper:{display:"flex",justifyContent:"space-between",gap:"4","&[data-orientation=vertical]":{flexDirection:"column",alignItems:"flex-start"},"&[data-orientation=horizontal]":{flexDirection:"row",alignItems:"center"},[$accentColor.variable]:`colors.${i}.500`,_dark:{[$accentColor.variable]:`colors.${i}.200`}},title:{fontSize:$titleFontSize.reference,fontWeight:"medium"},description:{fontSize:$descFontSize.reference,color:"chakra-subtle-text"},number:{fontSize:$titleFontSize.reference},step:{flexShrink:0,position:"relative",display:"flex",gap:"2","&[data-orientation=horizontal]":{alignItems:"center"},flex:"1","&:last-of-type:not([data-stretch])":{flex:"initial"}},icon:{flexShrink:0,width:$iconSize.reference,height:$iconSize.reference},indicator:{flexShrink:0,borderRadius:"full",width:$size$4.reference,height:$size$4.reference,display:"flex",justifyContent:"center",alignItems:"center","&[data-status=active]":{borderWidth:"2px",borderColor:$accentColor.reference},"&[data-status=complete]":{bg:$accentColor.reference,color:"chakra-inverse-text"},"&[data-status=incomplete]":{borderWidth:"2px"}},separator:{bg:"chakra-border-color",flex:"1","&[data-status=complete]":{bg:$accentColor.reference},"&[data-orientation=horizontal]":{width:"100%",height:"2px",marginStart:"2"},"&[data-orientation=vertical]":{width:"2px",position:"absolute",height:"100%",maxHeight:`calc(100% - ${$size$4.reference} - 8px)`,top:`calc(${$size$4.reference} + 4px)`,insetStart:`calc(${$size$4.reference} / 2 - 1px)`}}})),stepperTheme=defineMultiStyleConfig$p({baseStyle:baseStyle$F,sizes:{xs:definePartsStyle$p({stepper:{[$size$4.variable]:"sizes.4",[$iconSize.variable]:"sizes.3",[$titleFontSize.variable]:"fontSizes.xs",[$descFontSize.variable]:"fontSizes.xs"}}),sm:definePartsStyle$p({stepper:{[$size$4.variable]:"sizes.6",[$iconSize.variable]:"sizes.4",[$titleFontSize.variable]:"fontSizes.sm",[$descFontSize.variable]:"fontSizes.xs"}}),md:definePartsStyle$p({stepper:{[$size$4.variable]:"sizes.8",[$iconSize.variable]:"sizes.5",[$titleFontSize.variable]:"fontSizes.md",[$descFontSize.variable]:"fontSizes.sm"}}),lg:definePartsStyle$p({stepper:{[$size$4.variable]:"sizes.10",[$iconSize.variable]:"sizes.6",[$titleFontSize.variable]:"fontSizes.lg",[$descFontSize.variable]:"fontSizes.md"}})},defaultProps:{size:"md",colorScheme:"blue"}});function anatomy(i,s={}){let o=!1;function a(){if(!o){o=!0;return}throw new Error("[anatomy] .part(...) should only be called once. Did you mean to use .extend(...) ?")}function rt(...j){a();for(const _ of j)s[_]=nt(_);return anatomy(i,s)}function et(...j){for(const _ of j)_ in s||(s[_]=nt(_));return anatomy(i,s)}function ot(){return Object.fromEntries(Object.entries(s).map(([_,$])=>[_,$.selector]))}function at(){return Object.fromEntries(Object.entries(s).map(([_,$])=>[_,$.className]))}function nt(j){const tt=`chakra-${(["container","root"].includes(j??"")?[i]:[i,j]).filter(Boolean).join("__")}`;return{className:tt,selector:`.${tt}`,toString:()=>j}}return{parts:rt,toPart:nt,extend:et,selectors:ot,classnames:at,get keys(){return Object.keys(s)},__type:{}}}var accordionAnatomy=anatomy("accordion").parts("root","container","button","panel").extend("icon"),alertAnatomy=anatomy("alert").parts("title","description","container").extend("icon","spinner"),avatarAnatomy=anatomy("avatar").parts("label","badge","container").extend("excessLabel","group"),breadcrumbAnatomy=anatomy("breadcrumb").parts("link","item","container").extend("separator");anatomy("button").parts();var checkboxAnatomy=anatomy("checkbox").parts("control","icon","container").extend("label");anatomy("progress").parts("track","filledTrack").extend("label");var drawerAnatomy=anatomy("drawer").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),editableAnatomy=anatomy("editable").parts("preview","input","textarea"),formAnatomy=anatomy("form").parts("container","requiredIndicator","helperText"),formErrorAnatomy=anatomy("formError").parts("text","icon"),inputAnatomy=anatomy("input").parts("addon","field","element","group"),listAnatomy=anatomy("list").parts("container","item","icon"),menuAnatomy=anatomy("menu").parts("button","list","item").extend("groupTitle","icon","command","divider"),modalAnatomy=anatomy("modal").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),numberInputAnatomy=anatomy("numberinput").parts("root","field","stepperGroup","stepper");anatomy("pininput").parts("field");var popoverAnatomy=anatomy("popover").parts("content","header","body","footer").extend("popper","arrow","closeButton"),progressAnatomy=anatomy("progress").parts("label","filledTrack","track"),radioAnatomy=anatomy("radio").parts("container","control","label"),selectAnatomy=anatomy("select").parts("field","icon"),sliderAnatomy=anatomy("slider").parts("container","track","thumb","filledTrack","mark"),statAnatomy=anatomy("stat").parts("container","label","helpText","number","icon"),switchAnatomy=anatomy("switch").parts("container","track","thumb","label"),tableAnatomy=anatomy("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),tabsAnatomy=anatomy("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),tagAnatomy=anatomy("tag").parts("container","label","closeButton"),cardAnatomy=anatomy("card").parts("container","header","body","footer");anatomy("stepper").parts("stepper","step","title","description","indicator","separator","icon","number");function guard(i,s,o){return Math.min(Math.max(i,o),s)}class ColorError extends Error{constructor(s){super(`Failed to parse color: "${s}"`)}}var ColorError$1=ColorError;function parseToRgba(i){if(typeof i!="string")throw new ColorError$1(i);if(i.trim().toLowerCase()==="transparent")return[0,0,0,0];let s=i.trim();s=namedColorRegex.test(i)?nameToHex(i):i;const o=reducedHexRegex.exec(s);if(o){const ot=Array.from(o).slice(1);return[...ot.slice(0,3).map(at=>parseInt(r$1(at,2),16)),parseInt(r$1(ot[3]||"f",2),16)/255]}const a=hexRegex.exec(s);if(a){const ot=Array.from(a).slice(1);return[...ot.slice(0,3).map(at=>parseInt(at,16)),parseInt(ot[3]||"ff",16)/255]}const rt=rgbaRegex.exec(s);if(rt){const ot=Array.from(rt).slice(1);return[...ot.slice(0,3).map(at=>parseInt(at,10)),parseFloat(ot[3]||"1")]}const et=hslaRegex.exec(s);if(et){const[ot,at,nt,it]=Array.from(et).slice(1).map(parseFloat);if(guard(0,100,at)!==at)throw new ColorError$1(i);if(guard(0,100,nt)!==nt)throw new ColorError$1(i);return[...hslToRgb(ot,at,nt),Number.isNaN(it)?1:it]}throw new ColorError$1(i)}function hash(i){let s=5381,o=i.length;for(;o;)s=s*33^i.charCodeAt(--o);return(s>>>0)%2341}const colorToInt=i=>parseInt(i.replace(/_/g,""),36),compressedColorMap="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((i,s)=>{const o=colorToInt(s.substring(0,3)),a=colorToInt(s.substring(3)).toString(16);let rt="";for(let et=0;et<6-a.length;et++)rt+="0";return i[o]=`${rt}${a}`,i},{});function nameToHex(i){const s=i.toLowerCase().trim(),o=compressedColorMap[hash(s)];if(!o)throw new ColorError$1(i);return`#${o}`}const r$1=(i,s)=>Array.from(Array(s)).map(()=>i).join(""),reducedHexRegex=new RegExp(`^#${r$1("([a-f0-9])",3)}([a-f0-9])?$`,"i"),hexRegex=new RegExp(`^#${r$1("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),rgbaRegex=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${r$1(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),hslaRegex=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,namedColorRegex=/^[a-z]+$/i,roundColor=i=>Math.round(i*255),hslToRgb=(i,s,o)=>{let a=o/100;if(s===0)return[a,a,a].map(roundColor);const rt=(i%360+360)%360/60,et=(1-Math.abs(2*a-1))*(s/100),ot=et*(1-Math.abs(rt%2-1));let at=0,nt=0,it=0;rt>=0&&rt<1?(at=et,nt=ot):rt>=1&&rt<2?(at=ot,nt=et):rt>=2&&rt<3?(nt=et,it=ot):rt>=3&&rt<4?(nt=ot,it=et):rt>=4&&rt<5?(at=ot,it=et):rt>=5&&rt<6&&(at=et,it=ot);const j=a-et/2,_=at+j,$=nt+j,tt=it+j;return[_,$,tt].map(roundColor)};function rgba$1(i,s,o,a){return`rgba(${guard(0,255,i).toFixed()}, ${guard(0,255,s).toFixed()}, ${guard(0,255,o).toFixed()}, ${parseFloat(guard(0,1,a).toFixed(3))})`}function transparentize$1(i,s){const[o,a,rt,et]=parseToRgba(i);return rgba$1(o,a,rt,et-s)}function toHex(i){const[s,o,a,rt]=parseToRgba(i);let et=ot=>{const at=guard(0,255,ot).toString(16);return at.length===1?`0${at}`:at};return`#${et(s)}${et(o)}${et(a)}${rt<1?et(Math.round(rt*255)):""}`}function dlv_es_default(i,s,o,a,rt){for(s=s.split?s.split("."):s,a=0;aObject.keys(i).length===0,getColor=(i,s,o)=>{const a=dlv_es_default(i,`colors.${s}`,s);try{return toHex(a),a}catch{return o??"#000000"}},getBrightness=i=>{const[s,o,a]=parseToRgba(i);return(s*299+o*587+a*114)/1e3},tone=i=>s=>{const o=getColor(s,i);return getBrightness(o)<128?"dark":"light"},isDark=i=>s=>tone(i)(s)==="dark",transparentize=(i,s)=>o=>{const a=getColor(o,i);return transparentize$1(a,1-s)};function generateStripe(i="1rem",s="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient( + `;return`!${tt?ot:at}`.trim()}function ColorModeScript(i={}){const{nonce:s}=i;return jsxRuntimeExports.jsx("script",{id:"chakra-script",nonce:s,dangerouslySetInnerHTML:{__html:getScriptSrc(i)}})}function useChakra(){const i=useColorMode(),s=useTheme();return{...i,theme:s}}function getTokenValue(i,s,o){var a,rt;if(s==null)return s;const tt=ot=>{var at,nt;return(nt=(at=i.__cssMap)==null?void 0:at[ot])==null?void 0:nt.value};return(rt=(a=tt(s))!=null?a:tt(o))!=null?rt:o}function getToken(i,s,o){const a=Array.isArray(s)?s:[s],rt=Array.isArray(o)?o:[o];return tt=>{const ot=rt.filter(Boolean),at=a.map((nt,it)=>{var j;const _=`${i}.${nt}`;return getTokenValue(tt,_,(j=ot[it])!=null?j:nt)});return Array.isArray(s)?at:at[0]}}var cx=(...i)=>i.filter(Boolean).join(" ");function isObject$2(i){const s=typeof i;return i!=null&&(s==="object"||s==="function")&&!Array.isArray(i)}function runIfFn$2(i,...s){return isFunction$4(i)?i(...s):i}var isFunction$4=i=>typeof i=="function",dataAttr=i=>i?"":void 0,ariaAttr=i=>i?!0:void 0;function callAllHandlers$1(...i){return function(o){i.some(a=>(a==null||a(o),o==null?void 0:o.defaultPrevented))}}function callAll(...i){return function(o){i.forEach(a=>{a==null||a(o)})}}var lodash_mergewith={exports:{}};lodash_mergewith.exports;(function(i,s){var o=200,a="__lodash_hash_undefined__",rt=800,tt=16,ot=9007199254740991,at="[object Arguments]",nt="[object Array]",it="[object AsyncFunction]",j="[object Boolean]",_="[object Date]",$="[object Error]",et="[object Function]",st="[object GeneratorFunction]",lt="[object Map]",ct="[object Number]",ht="[object Null]",ut="[object Object]",pt="[object Proxy]",mt="[object RegExp]",gt="[object Set]",dt="[object String]",St="[object Undefined]",xt="[object WeakMap]",yt="[object ArrayBuffer]",_t="[object DataView]",Ct="[object Float32Array]",Et="[object Float64Array]",kt="[object Int8Array]",Tt="[object Int16Array]",$t="[object Int32Array]",It="[object Uint8Array]",Ot="[object Uint8ClampedArray]",Mt="[object Uint16Array]",Dt="[object Uint32Array]",Bt=/[\\^$.*+?()[\]{}|]/g,Kt=/^\[object .+?Constructor\]$/,Wt=/^(?:0|[1-9]\d*)$/,zt={};zt[Ct]=zt[Et]=zt[kt]=zt[Tt]=zt[$t]=zt[It]=zt[Ot]=zt[Mt]=zt[Dt]=!0,zt[at]=zt[nt]=zt[yt]=zt[j]=zt[_t]=zt[_]=zt[$]=zt[et]=zt[lt]=zt[ct]=zt[ut]=zt[mt]=zt[gt]=zt[dt]=zt[xt]=!1;var Ht=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,Zt=typeof self=="object"&&self&&self.Object===Object&&self,qt=Ht||Zt||Function("return this")(),hr=s&&!s.nodeType&&s,fr=hr&&!0&&i&&!i.nodeType&&i,mr=fr&&fr.exports===hr,gr=mr&&Ht.process,tr=function(){try{var Nt=fr&&fr.require&&fr.require("util").types;return Nt||gr&&gr.binding&&gr.binding("util")}catch{}}(),rr=tr&&tr.isTypedArray;function Qt(Nt,nr,cr){switch(cr.length){case 0:return Nt.call(nr);case 1:return Nt.call(nr,cr[0]);case 2:return Nt.call(nr,cr[0],cr[1]);case 3:return Nt.call(nr,cr[0],cr[1],cr[2])}return Nt.apply(nr,cr)}function xr(Nt,nr){for(var cr=-1,Vr=Array(Nt);++cr-1}function io(Nt,nr){var cr=this.__data__,Vr=Is(cr,Nt);return Vr<0?(++this.size,cr.push([Nt,nr])):cr[Vr][1]=nr,this}ls.prototype.clear=Ns,ls.prototype.delete=ms,ls.prototype.get=no,ls.prototype.has=Vs,ls.prototype.set=io;function us(Nt){var nr=-1,cr=Nt==null?0:Nt.length;for(this.clear();++nr1?cr[Wr-1]:void 0,vn=Wr>2?cr[2]:void 0;for(sn=Nt.length>3&&typeof sn=="function"?(Wr--,sn):void 0,vn&&ys(cr[0],cr[1],vn)&&(sn=Wr<3?void 0:sn,Wr=1),nr=Object(nr);++Vr-1&&Nt%1==0&&Nt0){if(++nr>=rt)return arguments[0]}else nr=0;return Nt.apply(void 0,arguments)}}function vt(Nt){if(Nt!=null){try{return Mn.call(Nt)}catch{}try{return Nt+""}catch{}}return""}function Rt(Nt,nr){return Nt===nr||Nt!==Nt&&nr!==nr}var Ft=gn(function(){return arguments}())?gn:function(Nt){return hn(Nt)&&pn.call(Nt,"callee")&&!Lr.call(Nt,"callee")},Ut=Array.isArray;function sr(Nt){return Nt!=null&&Br(Nt.length)&&!Fr(Nt)}function vr(Nt){return hn(Nt)&&sr(Nt)}var wr=Hr||ir;function Fr(Nt){if(!ln(Nt))return!1;var nr=gs(Nt);return nr==et||nr==st||nr==it||nr==pt}function Br(Nt){return typeof Nt=="number"&&Nt>-1&&Nt%1==0&&Nt<=ot}function ln(Nt){var nr=typeof Nt;return Nt!=null&&(nr=="object"||nr=="function")}function hn(Nt){return Nt!=null&&typeof Nt=="object"}function jn(Nt){if(!hn(Nt)||gs(Nt)!=ut)return!1;var nr=er(Nt);if(nr===null)return!0;var cr=pn.call(nr,"constructor")&&nr.constructor;return typeof cr=="function"&&cr instanceof cr&&Mn.call(cr)==_r}var Ts=rr?Sr(rr):Qn;function Cs(Nt){return br(Nt,Ls(Nt))}function Ls(Nt){return sr(Nt)?oo(Nt):Jn(Nt)}var yo=$r(function(Nt,nr,cr,Vr){mo(Nt,nr,cr,Vr)});function kn(Nt){return function(){return Nt}}function Tn(Nt){return Nt}function ir(){return!1}i.exports=yo})(lodash_mergewith,lodash_mergewith.exports);var lodash_mergewithExports=lodash_mergewith.exports;const mergeWith=getDefaultExportFromCjs(lodash_mergewithExports);var isImportant=i=>/!(important)?$/.test(i),withoutImportant=i=>typeof i=="string"?i.replace(/!(important)?$/,"").trim():i,tokenToCSSVar=(i,s)=>o=>{const a=String(s),rt=isImportant(a),tt=withoutImportant(a),ot=i?`${i}.${tt}`:tt;let at=isObject$2(o.__cssMap)&&ot in o.__cssMap?o.__cssMap[ot].varRef:s;return at=withoutImportant(at),rt?`${at} !important`:at};function createTransform(i){const{scale:s,transform:o,compose:a}=i;return(tt,ot)=>{var at;const nt=tokenToCSSVar(s,tt)(ot);let it=(at=o==null?void 0:o(nt,ot))!=null?at:nt;return a&&(it=a(it,ot)),it}}var pipe$2=(...i)=>s=>i.reduce((o,a)=>a(o),s);function toConfig(i,s){return o=>{const a={property:o,scale:i};return a.transform=createTransform({scale:i,transform:s}),a}}var getRtl=({rtl:i,ltr:s})=>o=>o.direction==="rtl"?i:s;function logical(i){const{property:s,scale:o,transform:a}=i;return{scale:o,property:getRtl(s),transform:o?createTransform({scale:o,compose:a}):a}}var transformTemplate=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function getTransformTemplate(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...transformTemplate].join(" ")}function getTransformGpuTemplate(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...transformTemplate].join(" ")}var filterTemplate={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},backdropFilterTemplate={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function getRingTemplate(i){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":i,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}var flexDirectionTemplate={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},directionMap={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},valueSet=new Set(Object.values(directionMap)),globalSet=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),trimSpace=i=>i.trim();function parseGradient(i,s){if(i==null||globalSet.has(i))return i;if(!(isCSSFunction(i)||globalSet.has(i)))return`url('${i}')`;const rt=/(^[a-z-A-Z]+)\((.*)\)/g.exec(i),tt=rt==null?void 0:rt[1],ot=rt==null?void 0:rt[2];if(!tt||!ot)return i;const at=tt.includes("-gradient")?tt:`${tt}-gradient`,[nt,...it]=ot.split(",").map(trimSpace).filter(Boolean);if((it==null?void 0:it.length)===0)return i;const j=nt in directionMap?directionMap[nt]:nt;it.unshift(j);const _=it.map($=>{if(valueSet.has($))return $;const et=$.indexOf(" "),[st,lt]=et!==-1?[$.substr(0,et),$.substr(et+1)]:[$],ct=isCSSFunction(lt)?lt:lt&<.split(" "),ht=`colors.${st}`,ut=ht in s.__cssMap?s.__cssMap[ht].varRef:st;return ct?[ut,...Array.isArray(ct)?ct:[ct]].join(" "):ut});return`${at}(${_.join(", ")})`}var isCSSFunction=i=>typeof i=="string"&&i.includes("(")&&i.includes(")"),gradientTransform=(i,s)=>parseGradient(i,s??{});function isCssVar(i){return/^var\(--.+\)$/.test(i)}var analyzeCSSValue=i=>{const s=parseFloat(i.toString()),o=i.toString().replace(String(s),"");return{unitless:!o,value:s,unit:o}},wrap=i=>s=>`${i}(${s})`,transformFunctions={filter(i){return i!=="auto"?i:filterTemplate},backdropFilter(i){return i!=="auto"?i:backdropFilterTemplate},ring(i){return getRingTemplate(transformFunctions.px(i))},bgClip(i){return i==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:i}},transform(i){return i==="auto"?getTransformTemplate():i==="auto-gpu"?getTransformGpuTemplate():i},vh(i){return i==="$100vh"?"var(--chakra-vh)":i},px(i){if(i==null)return i;const{unitless:s}=analyzeCSSValue(i);return s||typeof i=="number"?`${i}px`:i},fraction(i){return typeof i!="number"||i>1?i:`${i*100}%`},float(i,s){const o={left:"right",right:"left"};return s.direction==="rtl"?o[i]:i},degree(i){if(isCssVar(i)||i==null)return i;const s=typeof i=="string"&&!i.endsWith("deg");return typeof i=="number"||s?`${i}deg`:i},gradient:gradientTransform,blur:wrap("blur"),opacity:wrap("opacity"),brightness:wrap("brightness"),contrast:wrap("contrast"),dropShadow:wrap("drop-shadow"),grayscale:wrap("grayscale"),hueRotate:i=>wrap("hue-rotate")(transformFunctions.degree(i)),invert:wrap("invert"),saturate:wrap("saturate"),sepia:wrap("sepia"),bgImage(i){return i==null||isCSSFunction(i)||globalSet.has(i)?i:`url(${i})`},outline(i){const s=String(i)==="0"||String(i)==="none";return i!==null&&s?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:i}},flexDirection(i){var s;const{space:o,divide:a}=(s=flexDirectionTemplate[i])!=null?s:{},rt={flexDirection:i};return o&&(rt[o]=1),a&&(rt[a]=1),rt}},t$1={borderWidths:toConfig("borderWidths"),borderStyles:toConfig("borderStyles"),colors:toConfig("colors"),borders:toConfig("borders"),gradients:toConfig("gradients",transformFunctions.gradient),radii:toConfig("radii",transformFunctions.px),space:toConfig("space",pipe$2(transformFunctions.vh,transformFunctions.px)),spaceT:toConfig("space",pipe$2(transformFunctions.vh,transformFunctions.px)),degreeT(i){return{property:i,transform:transformFunctions.degree}},prop(i,s,o){return{property:i,scale:s,...s&&{transform:createTransform({scale:s,transform:o})}}},propT(i,s){return{property:i,transform:s}},sizes:toConfig("sizes",pipe$2(transformFunctions.vh,transformFunctions.px)),sizesT:toConfig("sizes",pipe$2(transformFunctions.vh,transformFunctions.fraction)),shadows:toConfig("shadows"),logical,blur:toConfig("blur",transformFunctions.blur)},background={background:t$1.colors("background"),backgroundColor:t$1.colors("backgroundColor"),backgroundImage:t$1.gradients("backgroundImage"),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:transformFunctions.bgClip},bgSize:t$1.prop("backgroundSize"),bgPosition:t$1.prop("backgroundPosition"),bg:t$1.colors("background"),bgColor:t$1.colors("backgroundColor"),bgPos:t$1.prop("backgroundPosition"),bgRepeat:t$1.prop("backgroundRepeat"),bgAttachment:t$1.prop("backgroundAttachment"),bgGradient:t$1.gradients("backgroundImage"),bgClip:{transform:transformFunctions.bgClip}};Object.assign(background,{bgImage:background.backgroundImage,bgImg:background.backgroundImage});var border={border:t$1.borders("border"),borderWidth:t$1.borderWidths("borderWidth"),borderStyle:t$1.borderStyles("borderStyle"),borderColor:t$1.colors("borderColor"),borderRadius:t$1.radii("borderRadius"),borderTop:t$1.borders("borderTop"),borderBlockStart:t$1.borders("borderBlockStart"),borderTopLeftRadius:t$1.radii("borderTopLeftRadius"),borderStartStartRadius:t$1.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:t$1.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:t$1.radii("borderTopRightRadius"),borderStartEndRadius:t$1.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:t$1.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:t$1.borders("borderRight"),borderInlineEnd:t$1.borders("borderInlineEnd"),borderBottom:t$1.borders("borderBottom"),borderBlockEnd:t$1.borders("borderBlockEnd"),borderBottomLeftRadius:t$1.radii("borderBottomLeftRadius"),borderBottomRightRadius:t$1.radii("borderBottomRightRadius"),borderLeft:t$1.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:t$1.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:t$1.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:t$1.borders(["borderLeft","borderRight"]),borderInline:t$1.borders("borderInline"),borderY:t$1.borders(["borderTop","borderBottom"]),borderBlock:t$1.borders("borderBlock"),borderTopWidth:t$1.borderWidths("borderTopWidth"),borderBlockStartWidth:t$1.borderWidths("borderBlockStartWidth"),borderTopColor:t$1.colors("borderTopColor"),borderBlockStartColor:t$1.colors("borderBlockStartColor"),borderTopStyle:t$1.borderStyles("borderTopStyle"),borderBlockStartStyle:t$1.borderStyles("borderBlockStartStyle"),borderBottomWidth:t$1.borderWidths("borderBottomWidth"),borderBlockEndWidth:t$1.borderWidths("borderBlockEndWidth"),borderBottomColor:t$1.colors("borderBottomColor"),borderBlockEndColor:t$1.colors("borderBlockEndColor"),borderBottomStyle:t$1.borderStyles("borderBottomStyle"),borderBlockEndStyle:t$1.borderStyles("borderBlockEndStyle"),borderLeftWidth:t$1.borderWidths("borderLeftWidth"),borderInlineStartWidth:t$1.borderWidths("borderInlineStartWidth"),borderLeftColor:t$1.colors("borderLeftColor"),borderInlineStartColor:t$1.colors("borderInlineStartColor"),borderLeftStyle:t$1.borderStyles("borderLeftStyle"),borderInlineStartStyle:t$1.borderStyles("borderInlineStartStyle"),borderRightWidth:t$1.borderWidths("borderRightWidth"),borderInlineEndWidth:t$1.borderWidths("borderInlineEndWidth"),borderRightColor:t$1.colors("borderRightColor"),borderInlineEndColor:t$1.colors("borderInlineEndColor"),borderRightStyle:t$1.borderStyles("borderRightStyle"),borderInlineEndStyle:t$1.borderStyles("borderInlineEndStyle"),borderTopRadius:t$1.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:t$1.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:t$1.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:t$1.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(border,{rounded:border.borderRadius,roundedTop:border.borderTopRadius,roundedTopLeft:border.borderTopLeftRadius,roundedTopRight:border.borderTopRightRadius,roundedTopStart:border.borderStartStartRadius,roundedTopEnd:border.borderStartEndRadius,roundedBottom:border.borderBottomRadius,roundedBottomLeft:border.borderBottomLeftRadius,roundedBottomRight:border.borderBottomRightRadius,roundedBottomStart:border.borderEndStartRadius,roundedBottomEnd:border.borderEndEndRadius,roundedLeft:border.borderLeftRadius,roundedRight:border.borderRightRadius,roundedStart:border.borderInlineStartRadius,roundedEnd:border.borderInlineEndRadius,borderStart:border.borderInlineStart,borderEnd:border.borderInlineEnd,borderTopStartRadius:border.borderStartStartRadius,borderTopEndRadius:border.borderStartEndRadius,borderBottomStartRadius:border.borderEndStartRadius,borderBottomEndRadius:border.borderEndEndRadius,borderStartRadius:border.borderInlineStartRadius,borderEndRadius:border.borderInlineEndRadius,borderStartWidth:border.borderInlineStartWidth,borderEndWidth:border.borderInlineEndWidth,borderStartColor:border.borderInlineStartColor,borderEndColor:border.borderInlineEndColor,borderStartStyle:border.borderInlineStartStyle,borderEndStyle:border.borderInlineEndStyle});var color$1={color:t$1.colors("color"),textColor:t$1.colors("color"),fill:t$1.colors("fill"),stroke:t$1.colors("stroke")},effect={boxShadow:t$1.shadows("boxShadow"),mixBlendMode:!0,blendMode:t$1.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:t$1.prop("backgroundBlendMode"),opacity:!0};Object.assign(effect,{shadow:effect.boxShadow});var filter$2={filter:{transform:transformFunctions.filter},blur:t$1.blur("--chakra-blur"),brightness:t$1.propT("--chakra-brightness",transformFunctions.brightness),contrast:t$1.propT("--chakra-contrast",transformFunctions.contrast),hueRotate:t$1.propT("--chakra-hue-rotate",transformFunctions.hueRotate),invert:t$1.propT("--chakra-invert",transformFunctions.invert),saturate:t$1.propT("--chakra-saturate",transformFunctions.saturate),dropShadow:t$1.propT("--chakra-drop-shadow",transformFunctions.dropShadow),backdropFilter:{transform:transformFunctions.backdropFilter},backdropBlur:t$1.blur("--chakra-backdrop-blur"),backdropBrightness:t$1.propT("--chakra-backdrop-brightness",transformFunctions.brightness),backdropContrast:t$1.propT("--chakra-backdrop-contrast",transformFunctions.contrast),backdropHueRotate:t$1.propT("--chakra-backdrop-hue-rotate",transformFunctions.hueRotate),backdropInvert:t$1.propT("--chakra-backdrop-invert",transformFunctions.invert),backdropSaturate:t$1.propT("--chakra-backdrop-saturate",transformFunctions.saturate)},flexbox={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:transformFunctions.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:t$1.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:t$1.space("gap"),rowGap:t$1.space("rowGap"),columnGap:t$1.space("columnGap")};Object.assign(flexbox,{flexDir:flexbox.flexDirection});var grid={gridGap:t$1.space("gridGap"),gridColumnGap:t$1.space("gridColumnGap"),gridRowGap:t$1.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0},interactivity={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:transformFunctions.outline},outlineOffset:!0,outlineColor:t$1.colors("outlineColor")},layout$1={width:t$1.sizesT("width"),inlineSize:t$1.sizesT("inlineSize"),height:t$1.sizes("height"),blockSize:t$1.sizes("blockSize"),boxSize:t$1.sizes(["width","height"]),minWidth:t$1.sizes("minWidth"),minInlineSize:t$1.sizes("minInlineSize"),minHeight:t$1.sizes("minHeight"),minBlockSize:t$1.sizes("minBlockSize"),maxWidth:t$1.sizes("maxWidth"),maxInlineSize:t$1.sizes("maxInlineSize"),maxHeight:t$1.sizes("maxHeight"),maxBlockSize:t$1.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,aspectRatio:!0,hideFrom:{scale:"breakpoints",transform:(i,s)=>{var o,a,rt;return{[`@media screen and (min-width: ${(rt=(a=(o=s.__breakpoints)==null?void 0:o.get(i))==null?void 0:a.minW)!=null?rt:i})`]:{display:"none"}}}},hideBelow:{scale:"breakpoints",transform:(i,s)=>{var o,a,rt;return{[`@media screen and (max-width: ${(rt=(a=(o=s.__breakpoints)==null?void 0:o.get(i))==null?void 0:a._minW)!=null?rt:i})`]:{display:"none"}}}},verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:t$1.propT("float",transformFunctions.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(layout$1,{w:layout$1.width,h:layout$1.height,minW:layout$1.minWidth,maxW:layout$1.maxWidth,minH:layout$1.minHeight,maxH:layout$1.maxHeight,overscroll:layout$1.overscrollBehavior,overscrollX:layout$1.overscrollBehaviorX,overscrollY:layout$1.overscrollBehaviorY});var list$2={listStyleType:!0,listStylePosition:!0,listStylePos:t$1.prop("listStylePosition"),listStyleImage:!0,listStyleImg:t$1.prop("listStyleImage")};function get$3(i,s,o,a){const rt=typeof s=="string"?s.split("."):[s];for(a=0;a{const s=new WeakMap;return(a,rt,tt,ot)=>{if(typeof a>"u")return i(a,rt,tt);s.has(a)||s.set(a,new Map);const at=s.get(a);if(at.has(rt))return at.get(rt);const nt=i(a,rt,tt,ot);return at.set(rt,nt),nt}},memoizedGet$1=memoize$2(get$3),srOnly={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},srFocusable={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},getWithPriority=(i,s,o)=>{const a={},rt=memoizedGet$1(i,s,{});for(const tt in rt)tt in o&&o[tt]!=null||(a[tt]=rt[tt]);return a},others={srOnly:{transform(i){return i===!0?srOnly:i==="focusable"?srFocusable:{}}},layerStyle:{processResult:!0,transform:(i,s,o)=>getWithPriority(s,`layerStyles.${i}`,o)},textStyle:{processResult:!0,transform:(i,s,o)=>getWithPriority(s,`textStyles.${i}`,o)},apply:{processResult:!0,transform:(i,s,o)=>getWithPriority(s,i,o)}},position={position:!0,pos:t$1.prop("position"),zIndex:t$1.prop("zIndex","zIndices"),inset:t$1.spaceT("inset"),insetX:t$1.spaceT(["left","right"]),insetInline:t$1.spaceT("insetInline"),insetY:t$1.spaceT(["top","bottom"]),insetBlock:t$1.spaceT("insetBlock"),top:t$1.spaceT("top"),insetBlockStart:t$1.spaceT("insetBlockStart"),bottom:t$1.spaceT("bottom"),insetBlockEnd:t$1.spaceT("insetBlockEnd"),left:t$1.spaceT("left"),insetInlineStart:t$1.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:t$1.spaceT("right"),insetInlineEnd:t$1.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(position,{insetStart:position.insetInlineStart,insetEnd:position.insetInlineEnd});var ring={ring:{transform:transformFunctions.ring},ringColor:t$1.colors("--chakra-ring-color"),ringOffset:t$1.prop("--chakra-ring-offset-width"),ringOffsetColor:t$1.colors("--chakra-ring-offset-color"),ringInset:t$1.prop("--chakra-ring-inset")},space={margin:t$1.spaceT("margin"),marginTop:t$1.spaceT("marginTop"),marginBlockStart:t$1.spaceT("marginBlockStart"),marginRight:t$1.spaceT("marginRight"),marginInlineEnd:t$1.spaceT("marginInlineEnd"),marginBottom:t$1.spaceT("marginBottom"),marginBlockEnd:t$1.spaceT("marginBlockEnd"),marginLeft:t$1.spaceT("marginLeft"),marginInlineStart:t$1.spaceT("marginInlineStart"),marginX:t$1.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:t$1.spaceT("marginInline"),marginY:t$1.spaceT(["marginTop","marginBottom"]),marginBlock:t$1.spaceT("marginBlock"),padding:t$1.space("padding"),paddingTop:t$1.space("paddingTop"),paddingBlockStart:t$1.space("paddingBlockStart"),paddingRight:t$1.space("paddingRight"),paddingBottom:t$1.space("paddingBottom"),paddingBlockEnd:t$1.space("paddingBlockEnd"),paddingLeft:t$1.space("paddingLeft"),paddingInlineStart:t$1.space("paddingInlineStart"),paddingInlineEnd:t$1.space("paddingInlineEnd"),paddingX:t$1.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:t$1.space("paddingInline"),paddingY:t$1.space(["paddingTop","paddingBottom"]),paddingBlock:t$1.space("paddingBlock")};Object.assign(space,{m:space.margin,mt:space.marginTop,mr:space.marginRight,me:space.marginInlineEnd,marginEnd:space.marginInlineEnd,mb:space.marginBottom,ml:space.marginLeft,ms:space.marginInlineStart,marginStart:space.marginInlineStart,mx:space.marginX,my:space.marginY,p:space.padding,pt:space.paddingTop,py:space.paddingY,px:space.paddingX,pb:space.paddingBottom,pl:space.paddingLeft,ps:space.paddingInlineStart,paddingStart:space.paddingInlineStart,pr:space.paddingRight,pe:space.paddingInlineEnd,paddingEnd:space.paddingInlineEnd});var textDecoration={textDecorationColor:t$1.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:t$1.shadows("textShadow")},transform={clipPath:!0,transform:t$1.propT("transform",transformFunctions.transform),transformOrigin:!0,translateX:t$1.spaceT("--chakra-translate-x"),translateY:t$1.spaceT("--chakra-translate-y"),skewX:t$1.degreeT("--chakra-skew-x"),skewY:t$1.degreeT("--chakra-skew-y"),scaleX:t$1.prop("--chakra-scale-x"),scaleY:t$1.prop("--chakra-scale-y"),scale:t$1.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:t$1.degreeT("--chakra-rotate")},transition$1={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:t$1.prop("transitionDuration","transition.duration"),transitionProperty:t$1.prop("transitionProperty","transition.property"),transitionTimingFunction:t$1.prop("transitionTimingFunction","transition.easing")},typography$1={fontFamily:t$1.prop("fontFamily","fonts"),fontSize:t$1.prop("fontSize","fontSizes",transformFunctions.px),fontWeight:t$1.prop("fontWeight","fontWeights"),lineHeight:t$1.prop("lineHeight","lineHeights"),letterSpacing:t$1.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,textIndent:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,isTruncated:{transform(i){if(i===!0)return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},scroll={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:t$1.spaceT("scrollMargin"),scrollMarginTop:t$1.spaceT("scrollMarginTop"),scrollMarginBottom:t$1.spaceT("scrollMarginBottom"),scrollMarginLeft:t$1.spaceT("scrollMarginLeft"),scrollMarginRight:t$1.spaceT("scrollMarginRight"),scrollMarginX:t$1.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:t$1.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:t$1.spaceT("scrollPadding"),scrollPaddingTop:t$1.spaceT("scrollPaddingTop"),scrollPaddingBottom:t$1.spaceT("scrollPaddingBottom"),scrollPaddingLeft:t$1.spaceT("scrollPaddingLeft"),scrollPaddingRight:t$1.spaceT("scrollPaddingRight"),scrollPaddingX:t$1.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:t$1.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function resolveReference(i){return isObject$2(i)&&i.reference?i.reference:String(i)}var toExpression=(i,...s)=>s.map(resolveReference).join(` ${i} `).replace(/calc/g,""),add$1=(...i)=>`calc(${toExpression("+",...i)})`,subtract$1=(...i)=>`calc(${toExpression("-",...i)})`,multiply$1=(...i)=>`calc(${toExpression("*",...i)})`,divide$1=(...i)=>`calc(${toExpression("/",...i)})`,negate$1=i=>{const s=resolveReference(i);return s!=null&&!Number.isNaN(parseFloat(s))?String(s).startsWith("-")?String(s).slice(1):`-${s}`:multiply$1(s,-1)},calc$1=Object.assign(i=>({add:(...s)=>calc$1(add$1(i,...s)),subtract:(...s)=>calc$1(subtract$1(i,...s)),multiply:(...s)=>calc$1(multiply$1(i,...s)),divide:(...s)=>calc$1(divide$1(i,...s)),negate:()=>calc$1(negate$1(i)),toString:()=>i.toString()}),{add:add$1,subtract:subtract$1,multiply:multiply$1,divide:divide$1,negate:negate$1});function replaceWhiteSpace$1(i,s="-"){return i.replace(/\s+/g,s)}function escape$1(i){const s=replaceWhiteSpace$1(i.toString());return escapeSymbol(escapeDot(s))}function escapeDot(i){return i.includes("\\.")?i:!Number.isInteger(parseFloat(i.toString()))?i.replace(".","\\."):i}function escapeSymbol(i){return i.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function addPrefix$1(i,s=""){return[s,i].filter(Boolean).join("-")}function toVarReference(i,s){return`var(${i}${s?`, ${s}`:""})`}function toVarDefinition(i,s=""){return escape$1(`--${addPrefix$1(i,s)}`)}function cssVar$1(i,s,o){const a=toVarDefinition(i,o);return{variable:a,reference:toVarReference(a,s)}}function defineCssVars(i,s){const o={};for(const a of s){if(Array.isArray(a)){const[rt,tt]=a;o[rt]=cssVar$1(`${i}-${rt}`,tt);continue}o[a]=cssVar$1(`${i}-${a}`)}return o}function getLastItem(i){const s=i==null?0:i.length;return s?i[s-1]:void 0}function analyzeCSSValue2(i){const s=parseFloat(i.toString()),o=i.toString().replace(String(s),"");return{unitless:!o,value:s,unit:o}}function px$1(i){if(i==null)return i;const{unitless:s}=analyzeCSSValue2(i);return s||typeof i=="number"?`${i}px`:i}var sortByBreakpointValue=(i,s)=>parseInt(i[1],10)>parseInt(s[1],10)?1:-1,sortBps=i=>Object.fromEntries(Object.entries(i).sort(sortByBreakpointValue));function normalize(i){const s=sortBps(i);return Object.assign(Object.values(s),s)}function keys(i){const s=Object.keys(sortBps(i));return new Set(s)}function subtract2(i){var s;if(!i)return i;i=(s=px$1(i))!=null?s:i;const o=-.02;return typeof i=="number"?`${i+o}`:i.replace(/(\d+\.?\d*)/u,a=>`${parseFloat(a)+o}`)}function toMediaQueryString(i,s){const o=["@media screen"];return i&&o.push("and",`(min-width: ${px$1(i)})`),s&&o.push("and",`(max-width: ${px$1(s)})`),o.join(" ")}function analyzeBreakpoints(i){var s;if(!i)return null;i.base=(s=i.base)!=null?s:"0px";const o=normalize(i),a=Object.entries(i).sort(sortByBreakpointValue).map(([ot,at],nt,it)=>{var j;let[,_]=(j=it[nt+1])!=null?j:[];return _=parseFloat(_)>0?subtract2(_):void 0,{_minW:subtract2(at),breakpoint:ot,minW:at,maxW:_,maxWQuery:toMediaQueryString(null,_),minWQuery:toMediaQueryString(at),minMaxQuery:toMediaQueryString(at,_)}}),rt=keys(i),tt=Array.from(rt.values());return{keys:rt,normalized:o,isResponsive(ot){const at=Object.keys(ot);return at.length>0&&at.every(nt=>rt.has(nt))},asObject:sortBps(i),asArray:normalize(i),details:a,get(ot){return a.find(at=>at.breakpoint===ot)},media:[null,...o.map(ot=>toMediaQueryString(ot)).slice(1)],toArrayValue(ot){if(!isObject$2(ot))throw new Error("toArrayValue: value must be an object");const at=tt.map(nt=>{var it;return(it=ot[nt])!=null?it:null});for(;getLastItem(at)===null;)at.pop();return at},toObjectValue(ot){if(!Array.isArray(ot))throw new Error("toObjectValue: value must be an array");return ot.reduce((at,nt,it)=>{const j=tt[it];return j!=null&&nt!=null&&(at[j]=nt),at},{})}}}var state={hover:(i,s)=>`${i}:hover ${s}, ${i}[data-hover] ${s}`,focus:(i,s)=>`${i}:focus ${s}, ${i}[data-focus] ${s}`,focusVisible:(i,s)=>`${i}:focus-visible ${s}`,focusWithin:(i,s)=>`${i}:focus-within ${s}`,active:(i,s)=>`${i}:active ${s}, ${i}[data-active] ${s}`,disabled:(i,s)=>`${i}:disabled ${s}, ${i}[data-disabled] ${s}`,invalid:(i,s)=>`${i}:invalid ${s}, ${i}[data-invalid] ${s}`,checked:(i,s)=>`${i}:checked ${s}, ${i}[data-checked] ${s}`,indeterminate:(i,s)=>`${i}:indeterminate ${s}, ${i}[aria-checked=mixed] ${s}, ${i}[data-indeterminate] ${s}`,readOnly:(i,s)=>`${i}:read-only ${s}, ${i}[readonly] ${s}, ${i}[data-read-only] ${s}`,expanded:(i,s)=>`${i}:read-only ${s}, ${i}[aria-expanded=true] ${s}, ${i}[data-expanded] ${s}`,placeholderShown:(i,s)=>`${i}:placeholder-shown ${s}`},toGroup=i=>merge(s=>i(s,"&"),"[role=group]","[data-group]",".group"),toPeer=i=>merge(s=>i(s,"~ &"),"[data-peer]",".peer"),merge=(i,...s)=>s.map(i).join(", "),pseudoSelectors={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty",_expanded:"&[aria-expanded=true], &[data-expanded]",_checked:"&[aria-checked=true], &[data-checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_firstLetter:"&::first-letter",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate]",_groupHover:toGroup(state.hover),_peerHover:toPeer(state.hover),_groupFocus:toGroup(state.focus),_peerFocus:toPeer(state.focus),_groupFocusVisible:toGroup(state.focusVisible),_peerFocusVisible:toPeer(state.focusVisible),_groupActive:toGroup(state.active),_peerActive:toPeer(state.active),_groupDisabled:toGroup(state.disabled),_peerDisabled:toPeer(state.disabled),_groupInvalid:toGroup(state.invalid),_peerInvalid:toPeer(state.invalid),_groupChecked:toGroup(state.checked),_peerChecked:toPeer(state.checked),_groupFocusWithin:toGroup(state.focusWithin),_peerFocusWithin:toPeer(state.focusWithin),_peerPlaceholderShown:toPeer(state.placeholderShown),_placeholder:"&::placeholder",_placeholderShown:"&:placeholder-shown",_fullScreen:"&:fullscreen",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]",_horizontal:"&[data-orientation=horizontal]",_vertical:"&[data-orientation=vertical]"},pseudoPropNames=Object.keys(pseudoSelectors);function tokenToCssVar(i,s){return cssVar$1(String(i).replace(/\./g,"-"),void 0,s)}function createThemeVars(i,s){let o={};const a={};for(const[rt,tt]of Object.entries(i)){const{isSemantic:ot,value:at}=tt,{variable:nt,reference:it}=tokenToCssVar(rt,s==null?void 0:s.cssVarPrefix);if(!ot){if(rt.startsWith("space")){const $=rt.split("."),[et,...st]=$,lt=`${et}.-${st.join(".")}`,ct=calc$1.negate(at),ht=calc$1.negate(it);a[lt]={value:ct,var:nt,varRef:ht}}o[nt]=at,a[rt]={value:at,var:nt,varRef:it};continue}const j=$=>{const st=[String(rt).split(".")[0],$].join(".");if(!i[st])return $;const{reference:ct}=tokenToCssVar(st,s==null?void 0:s.cssVarPrefix);return ct},_=isObject$2(at)?at:{default:at};o=mergeWith(o,Object.entries(_).reduce(($,[et,st])=>{var lt,ct;if(!st)return $;const ht=j(`${st}`);if(et==="default")return $[nt]=ht,$;const ut=(ct=(lt=pseudoSelectors)==null?void 0:lt[et])!=null?ct:et;return $[ut]={[nt]:ht},$},{})),a[rt]={value:it,var:nt,varRef:it}}return{cssVars:o,cssMap:a}}function omit$2(i,s=[]){const o=Object.assign({},i);for(const a of s)a in o&&delete o[a];return o}function pick$1(i,s){const o={};for(const a of s)a in i&&(o[a]=i[a]);return o}function isObject5(i){return typeof i=="object"&&i!=null&&!Array.isArray(i)}function walkObject(i,s,o={}){const{stop:a,getKey:rt}=o;function tt(ot,at=[]){var nt;if(isObject5(ot)||Array.isArray(ot)){const it={};for(const[j,_]of Object.entries(ot)){const $=(nt=rt==null?void 0:rt(j))!=null?nt:j,et=[...at,$];if(a!=null&&a(ot,et))return s(ot,at);it[$]=tt(_,et)}return it}return s(ot,at)}return tt(i)}var tokens=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","gradients","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur","breakpoints"];function extractTokens(i){return pick$1(i,tokens)}function extractSemanticTokens(i){return i.semanticTokens}function omitVars(i){const{__cssMap:s,__cssVars:o,__breakpoints:a,...rt}=i;return rt}var isSemanticCondition=i=>pseudoPropNames.includes(i)||i==="default";function flattenTokens({tokens:i,semanticTokens:s}){const o={};return walkObject(i,(a,rt)=>{a!=null&&(o[rt.join(".")]={isSemantic:!1,value:a})}),walkObject(s,(a,rt)=>{a!=null&&(o[rt.join(".")]={isSemantic:!0,value:a})},{stop:a=>Object.keys(a).every(isSemanticCondition)}),o}function toCSSVar(i){var s;const o=omitVars(i),a=extractTokens(o),rt=extractSemanticTokens(o),tt=flattenTokens({tokens:a,semanticTokens:rt}),ot=(s=o.config)==null?void 0:s.cssVarPrefix,{cssMap:at,cssVars:nt}=createThemeVars(tt,{cssVarPrefix:ot});return Object.assign(o,{__cssVars:{...{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},...nt},__cssMap:at,__breakpoints:analyzeBreakpoints(o.breakpoints)}),o}var systemProps=mergeWith({},background,border,color$1,flexbox,layout$1,filter$2,ring,interactivity,grid,others,position,effect,space,scroll,typography$1,textDecoration,transform,list$2,transition$1),layoutSystem=Object.assign({},space,layout$1,flexbox,grid,position),layoutPropNames=Object.keys(layoutSystem),propNames=[...Object.keys(systemProps),...pseudoPropNames],styleProps={...systemProps,...pseudoSelectors},isStyleProp=i=>i in styleProps,expandResponsive=i=>s=>{if(!s.__breakpoints)return i;const{isResponsive:o,toArrayValue:a,media:rt}=s.__breakpoints,tt={};for(const ot in i){let at=runIfFn$2(i[ot],s);if(at==null)continue;if(at=isObject$2(at)&&o(at)?a(at):at,!Array.isArray(at)){tt[ot]=at;continue}const nt=at.slice(0,rt.length).length;for(let it=0;iti.startsWith("--")&&typeof s=="string"&&!isCssVar2(s),resolveTokenValue=(i,s)=>{var o,a;if(s==null)return s;const rt=nt=>{var it,j;return(j=(it=i.__cssMap)==null?void 0:it[nt])==null?void 0:j.varRef},tt=nt=>{var it;return(it=rt(nt))!=null?it:nt},[ot,at]=splitByComma(s);return s=(a=(o=rt(ot))!=null?o:tt(at))!=null?a:tt(s),s};function getCss(i){const{configs:s={},pseudos:o={},theme:a}=i,rt=(tt,ot=!1)=>{var at,nt,it;const j=runIfFn$2(tt,a),_=expandResponsive(j)(a);let $={};for(let et in _){const st=_[et];let lt=runIfFn$2(st,a);et in o&&(et=o[et]),isCSSVariableTokenValue(et,lt)&&(lt=resolveTokenValue(a,lt));let ct=s[et];if(ct===!0&&(ct={property:et}),isObject$2(lt)){$[et]=(at=$[et])!=null?at:{},$[et]=mergeWith({},$[et],rt(lt,!0));continue}let ht=(it=(nt=ct==null?void 0:ct.transform)==null?void 0:nt.call(ct,lt,a,j))!=null?it:lt;ht=ct!=null&&ct.processResult?rt(ht,!0):ht;const ut=runIfFn$2(ct==null?void 0:ct.property,a);if(!ot&&(ct!=null&&ct.static)){const pt=runIfFn$2(ct.static,a);$=mergeWith({},$,pt)}if(ut&&Array.isArray(ut)){for(const pt of ut)$[pt]=ht;continue}if(ut){ut==="&"&&isObject$2(ht)?$=mergeWith({},$,ht):$[ut]=ht;continue}if(isObject$2(ht)){$=mergeWith({},$,ht);continue}$[et]=ht}return $};return rt}var css=i=>s=>getCss({theme:s,pseudos:pseudoSelectors,configs:systemProps})(i);function defineStyle(i){return i}function defineStyleConfig(i){return i}function createMultiStyleConfigHelpers(i){return{definePartsStyle(s){return s},defineMultiStyleConfig(s){return{parts:i,...s}}}}function normalize2(i,s){if(Array.isArray(i))return i;if(isObject$2(i))return s(i);if(i!=null)return[i]}function getNextIndex(i,s){for(let o=s+1;o{mergeWith(it,{[pt]:$?ut[pt]:{[ht]:ut[pt]}})});continue}if(!et){$?mergeWith(it,ut):it[ht]=ut;continue}it[ht]=ut}}return it}}function resolveStyleConfig(i){return s=>{var o;const{variant:a,size:rt,theme:tt}=s,ot=createResolver(tt);return mergeWith({},runIfFn$2((o=i.baseStyle)!=null?o:{},s),ot(i,"sizes",rt,s),ot(i,"variants",a,s))}}function omitThemingProps(i){return omit$2(i,["styleConfig","size","variant","colorScheme"])}var requiredChakraThemeKeys=["borders","breakpoints","colors","components","config","direction","fonts","fontSizes","fontWeights","letterSpacings","lineHeights","radii","shadows","sizes","space","styles","transition","zIndices"];function isChakraTheme(i){return isObject$2(i)?requiredChakraThemeKeys.every(s=>Object.prototype.hasOwnProperty.call(i,s)):!1}var transitionProperty={common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},transitionTimingFunction={"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},transitionDuration={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},transition={property:transitionProperty,easing:transitionTimingFunction,duration:transitionDuration},transition_default=transition,zIndices={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},z_index_default=zIndices,borders$1={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},borders_default=borders$1,breakpoints$1={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},breakpoints_default=breakpoints$1,colors={transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},linkedin:{50:"#E8F4F9",100:"#CFEDFB",200:"#9BDAF3",300:"#68C7EC",400:"#34B3E4",500:"#00A0DC",600:"#008CC9",700:"#0077B5",800:"#005E93",900:"#004471"},facebook:{50:"#E8F4F9",100:"#D9DEE9",200:"#B7C2DA",300:"#6482C0",400:"#4267B2",500:"#385898",600:"#314E89",700:"#29487D",800:"#223B67",900:"#1E355B"},messenger:{50:"#D0E6FF",100:"#B9DAFF",200:"#A2CDFF",300:"#7AB8FF",400:"#2E90FF",500:"#0078FF",600:"#0063D1",700:"#0052AC",800:"#003C7E",900:"#002C5C"},whatsapp:{50:"#dffeec",100:"#b9f5d0",200:"#90edb3",300:"#65e495",400:"#3cdd78",500:"#22c35e",600:"#179848",700:"#0c6c33",800:"#01421c",900:"#001803"},twitter:{50:"#E5F4FD",100:"#C8E9FB",200:"#A8DCFA",300:"#83CDF7",400:"#57BBF5",500:"#1DA1F2",600:"#1A94DA",700:"#1681BF",800:"#136B9E",900:"#0D4D71"},telegram:{50:"#E3F2F9",100:"#C5E4F3",200:"#A2D4EC",300:"#7AC1E4",400:"#47A9DA",500:"#0088CC",600:"#007AB8",700:"#006BA1",800:"#005885",900:"#003F5E"}},colors_default=colors,radii={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},radius_default=radii,shadows={xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},shadows_default=shadows,blur={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},blur_default=blur,typography={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},typography_default=typography,spacing={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},largeSizes={max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"},container={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},sizes$m={...spacing,...largeSizes,container},sizes_default=sizes$m,foundations={breakpoints:breakpoints_default,zIndices:z_index_default,radii:radius_default,blur:blur_default,colors:colors_default,...typography_default,sizes:sizes_default,shadows:shadows_default,space:spacing,borders:borders_default,transition:transition_default},{defineMultiStyleConfig:defineMultiStyleConfig$p,definePartsStyle:definePartsStyle$p}=createMultiStyleConfigHelpers(["stepper","step","title","description","indicator","separator","icon","number"]),$size$4=cssVar$1("stepper-indicator-size"),$iconSize=cssVar$1("stepper-icon-size"),$titleFontSize=cssVar$1("stepper-title-font-size"),$descFontSize=cssVar$1("stepper-description-font-size"),$accentColor=cssVar$1("stepper-accent-color"),baseStyle$F=definePartsStyle$p(({colorScheme:i})=>({stepper:{display:"flex",justifyContent:"space-between",gap:"4","&[data-orientation=vertical]":{flexDirection:"column",alignItems:"flex-start"},"&[data-orientation=horizontal]":{flexDirection:"row",alignItems:"center"},[$accentColor.variable]:`colors.${i}.500`,_dark:{[$accentColor.variable]:`colors.${i}.200`}},title:{fontSize:$titleFontSize.reference,fontWeight:"medium"},description:{fontSize:$descFontSize.reference,color:"chakra-subtle-text"},number:{fontSize:$titleFontSize.reference},step:{flexShrink:0,position:"relative",display:"flex",gap:"2","&[data-orientation=horizontal]":{alignItems:"center"},flex:"1","&:last-of-type:not([data-stretch])":{flex:"initial"}},icon:{flexShrink:0,width:$iconSize.reference,height:$iconSize.reference},indicator:{flexShrink:0,borderRadius:"full",width:$size$4.reference,height:$size$4.reference,display:"flex",justifyContent:"center",alignItems:"center","&[data-status=active]":{borderWidth:"2px",borderColor:$accentColor.reference},"&[data-status=complete]":{bg:$accentColor.reference,color:"chakra-inverse-text"},"&[data-status=incomplete]":{borderWidth:"2px"}},separator:{bg:"chakra-border-color",flex:"1","&[data-status=complete]":{bg:$accentColor.reference},"&[data-orientation=horizontal]":{width:"100%",height:"2px",marginStart:"2"},"&[data-orientation=vertical]":{width:"2px",position:"absolute",height:"100%",maxHeight:`calc(100% - ${$size$4.reference} - 8px)`,top:`calc(${$size$4.reference} + 4px)`,insetStart:`calc(${$size$4.reference} / 2 - 1px)`}}})),stepperTheme=defineMultiStyleConfig$p({baseStyle:baseStyle$F,sizes:{xs:definePartsStyle$p({stepper:{[$size$4.variable]:"sizes.4",[$iconSize.variable]:"sizes.3",[$titleFontSize.variable]:"fontSizes.xs",[$descFontSize.variable]:"fontSizes.xs"}}),sm:definePartsStyle$p({stepper:{[$size$4.variable]:"sizes.6",[$iconSize.variable]:"sizes.4",[$titleFontSize.variable]:"fontSizes.sm",[$descFontSize.variable]:"fontSizes.xs"}}),md:definePartsStyle$p({stepper:{[$size$4.variable]:"sizes.8",[$iconSize.variable]:"sizes.5",[$titleFontSize.variable]:"fontSizes.md",[$descFontSize.variable]:"fontSizes.sm"}}),lg:definePartsStyle$p({stepper:{[$size$4.variable]:"sizes.10",[$iconSize.variable]:"sizes.6",[$titleFontSize.variable]:"fontSizes.lg",[$descFontSize.variable]:"fontSizes.md"}})},defaultProps:{size:"md",colorScheme:"blue"}});function anatomy(i,s={}){let o=!1;function a(){if(!o){o=!0;return}throw new Error("[anatomy] .part(...) should only be called once. Did you mean to use .extend(...) ?")}function rt(...j){a();for(const _ of j)s[_]=nt(_);return anatomy(i,s)}function tt(...j){for(const _ of j)_ in s||(s[_]=nt(_));return anatomy(i,s)}function ot(){return Object.fromEntries(Object.entries(s).map(([_,$])=>[_,$.selector]))}function at(){return Object.fromEntries(Object.entries(s).map(([_,$])=>[_,$.className]))}function nt(j){const et=`chakra-${(["container","root"].includes(j??"")?[i]:[i,j]).filter(Boolean).join("__")}`;return{className:et,selector:`.${et}`,toString:()=>j}}return{parts:rt,toPart:nt,extend:tt,selectors:ot,classnames:at,get keys(){return Object.keys(s)},__type:{}}}var accordionAnatomy=anatomy("accordion").parts("root","container","button","panel").extend("icon"),alertAnatomy=anatomy("alert").parts("title","description","container").extend("icon","spinner"),avatarAnatomy=anatomy("avatar").parts("label","badge","container").extend("excessLabel","group"),breadcrumbAnatomy=anatomy("breadcrumb").parts("link","item","container").extend("separator");anatomy("button").parts();var checkboxAnatomy=anatomy("checkbox").parts("control","icon","container").extend("label");anatomy("progress").parts("track","filledTrack").extend("label");var drawerAnatomy=anatomy("drawer").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),editableAnatomy=anatomy("editable").parts("preview","input","textarea"),formAnatomy=anatomy("form").parts("container","requiredIndicator","helperText"),formErrorAnatomy=anatomy("formError").parts("text","icon"),inputAnatomy=anatomy("input").parts("addon","field","element","group"),listAnatomy=anatomy("list").parts("container","item","icon"),menuAnatomy=anatomy("menu").parts("button","list","item").extend("groupTitle","icon","command","divider"),modalAnatomy=anatomy("modal").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),numberInputAnatomy=anatomy("numberinput").parts("root","field","stepperGroup","stepper");anatomy("pininput").parts("field");var popoverAnatomy=anatomy("popover").parts("content","header","body","footer").extend("popper","arrow","closeButton"),progressAnatomy=anatomy("progress").parts("label","filledTrack","track"),radioAnatomy=anatomy("radio").parts("container","control","label"),selectAnatomy=anatomy("select").parts("field","icon"),sliderAnatomy=anatomy("slider").parts("container","track","thumb","filledTrack","mark"),statAnatomy=anatomy("stat").parts("container","label","helpText","number","icon"),switchAnatomy=anatomy("switch").parts("container","track","thumb","label"),tableAnatomy=anatomy("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),tabsAnatomy=anatomy("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),tagAnatomy=anatomy("tag").parts("container","label","closeButton"),cardAnatomy=anatomy("card").parts("container","header","body","footer");anatomy("stepper").parts("stepper","step","title","description","indicator","separator","icon","number");function guard(i,s,o){return Math.min(Math.max(i,o),s)}class ColorError extends Error{constructor(s){super(`Failed to parse color: "${s}"`)}}var ColorError$1=ColorError;function parseToRgba(i){if(typeof i!="string")throw new ColorError$1(i);if(i.trim().toLowerCase()==="transparent")return[0,0,0,0];let s=i.trim();s=namedColorRegex.test(i)?nameToHex(i):i;const o=reducedHexRegex.exec(s);if(o){const ot=Array.from(o).slice(1);return[...ot.slice(0,3).map(at=>parseInt(r$1(at,2),16)),parseInt(r$1(ot[3]||"f",2),16)/255]}const a=hexRegex.exec(s);if(a){const ot=Array.from(a).slice(1);return[...ot.slice(0,3).map(at=>parseInt(at,16)),parseInt(ot[3]||"ff",16)/255]}const rt=rgbaRegex.exec(s);if(rt){const ot=Array.from(rt).slice(1);return[...ot.slice(0,3).map(at=>parseInt(at,10)),parseFloat(ot[3]||"1")]}const tt=hslaRegex.exec(s);if(tt){const[ot,at,nt,it]=Array.from(tt).slice(1).map(parseFloat);if(guard(0,100,at)!==at)throw new ColorError$1(i);if(guard(0,100,nt)!==nt)throw new ColorError$1(i);return[...hslToRgb(ot,at,nt),Number.isNaN(it)?1:it]}throw new ColorError$1(i)}function hash(i){let s=5381,o=i.length;for(;o;)s=s*33^i.charCodeAt(--o);return(s>>>0)%2341}const colorToInt=i=>parseInt(i.replace(/_/g,""),36),compressedColorMap="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((i,s)=>{const o=colorToInt(s.substring(0,3)),a=colorToInt(s.substring(3)).toString(16);let rt="";for(let tt=0;tt<6-a.length;tt++)rt+="0";return i[o]=`${rt}${a}`,i},{});function nameToHex(i){const s=i.toLowerCase().trim(),o=compressedColorMap[hash(s)];if(!o)throw new ColorError$1(i);return`#${o}`}const r$1=(i,s)=>Array.from(Array(s)).map(()=>i).join(""),reducedHexRegex=new RegExp(`^#${r$1("([a-f0-9])",3)}([a-f0-9])?$`,"i"),hexRegex=new RegExp(`^#${r$1("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),rgbaRegex=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${r$1(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),hslaRegex=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,namedColorRegex=/^[a-z]+$/i,roundColor=i=>Math.round(i*255),hslToRgb=(i,s,o)=>{let a=o/100;if(s===0)return[a,a,a].map(roundColor);const rt=(i%360+360)%360/60,tt=(1-Math.abs(2*a-1))*(s/100),ot=tt*(1-Math.abs(rt%2-1));let at=0,nt=0,it=0;rt>=0&&rt<1?(at=tt,nt=ot):rt>=1&&rt<2?(at=ot,nt=tt):rt>=2&&rt<3?(nt=tt,it=ot):rt>=3&&rt<4?(nt=ot,it=tt):rt>=4&&rt<5?(at=ot,it=tt):rt>=5&&rt<6&&(at=tt,it=ot);const j=a-tt/2,_=at+j,$=nt+j,et=it+j;return[_,$,et].map(roundColor)};function rgba$1(i,s,o,a){return`rgba(${guard(0,255,i).toFixed()}, ${guard(0,255,s).toFixed()}, ${guard(0,255,o).toFixed()}, ${parseFloat(guard(0,1,a).toFixed(3))})`}function transparentize$1(i,s){const[o,a,rt,tt]=parseToRgba(i);return rgba$1(o,a,rt,tt-s)}function toHex(i){const[s,o,a,rt]=parseToRgba(i);let tt=ot=>{const at=guard(0,255,ot).toString(16);return at.length===1?`0${at}`:at};return`#${tt(s)}${tt(o)}${tt(a)}${rt<1?tt(Math.round(rt*255)):""}`}function dlv_es_default(i,s,o,a,rt){for(s=s.split?s.split("."):s,a=0;aObject.keys(i).length===0,getColor=(i,s,o)=>{const a=dlv_es_default(i,`colors.${s}`,s);try{return toHex(a),a}catch{return o??"#000000"}},getBrightness=i=>{const[s,o,a]=parseToRgba(i);return(s*299+o*587+a*114)/1e3},tone=i=>s=>{const o=getColor(s,i);return getBrightness(o)<128?"dark":"light"},isDark=i=>s=>tone(i)(s)==="dark",transparentize=(i,s)=>o=>{const a=getColor(o,i);return transparentize$1(a,1-s)};function generateStripe(i="1rem",s="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient( 45deg, ${s} 25%, transparent 25%, @@ -334,12 +334,12 @@ Error generating stack: `+et.message+` ${s} 75%, transparent 75%, transparent - )`,backgroundSize:`${i} ${i}`}}var randomHex=()=>`#${Math.floor(Math.random()*16777215).toString(16).padEnd(6,"0")}`;function randomColor(i){const s=randomHex();return!i||isEmptyObject(i)?s:i.string&&i.colors?randomColorFromList(i.string,i.colors):i.string&&!i.colors?randomColorFromString(i.string):i.colors&&!i.string?randomFromList(i.colors):s}function randomColorFromString(i){let s=0;if(i.length===0)return s.toString();for(let a=0;a>a*8&255;o+=`00${rt.toString(16)}`.substr(-2)}return o}function randomColorFromList(i,s){let o=0;if(i.length===0)return s[0];for(let a=0;ao.colorMode==="dark"?s:i}function orient(i){const{orientation:s,vertical:o,horizontal:a}=i;return s?s==="vertical"?o:a:{}}function toRef(i){return isObject$2(i)&&i.reference?i.reference:String(i)}var toExpr=(i,...s)=>s.map(toRef).join(` ${i} `).replace(/calc/g,""),add=(...i)=>`calc(${toExpr("+",...i)})`,subtract=(...i)=>`calc(${toExpr("-",...i)})`,multiply=(...i)=>`calc(${toExpr("*",...i)})`,divide=(...i)=>`calc(${toExpr("/",...i)})`,negate=i=>{const s=toRef(i);return s!=null&&!Number.isNaN(parseFloat(s))?String(s).startsWith("-")?String(s).slice(1):`-${s}`:multiply(s,-1)},calc=Object.assign(i=>({add:(...s)=>calc(add(i,...s)),subtract:(...s)=>calc(subtract(i,...s)),multiply:(...s)=>calc(multiply(i,...s)),divide:(...s)=>calc(divide(i,...s)),negate:()=>calc(negate(i)),toString:()=>i.toString()}),{add,subtract,multiply,divide,negate});function isDecimal(i){return!Number.isInteger(parseFloat(i.toString()))}function replaceWhiteSpace(i,s="-"){return i.replace(/\s+/g,s)}function escape(i){const s=replaceWhiteSpace(i.toString());return s.includes("\\.")?i:isDecimal(i)?s.replace(".","\\."):i}function addPrefix(i,s=""){return[s,escape(i)].filter(Boolean).join("-")}function toVarRef(i,s){return`var(${escape(i)}${s?`, ${s}`:""})`}function toVar(i,s=""){return`--${addPrefix(i,s)}`}function cssVar(i,s){const o=toVar(i,void 0);return{variable:o,reference:toVarRef(o,getFallback(void 0))}}function getFallback(i){return typeof i=="string"?i:i==null?void 0:i.reference}var{defineMultiStyleConfig:defineMultiStyleConfig$o,definePartsStyle:definePartsStyle$o}=createMultiStyleConfigHelpers(switchAnatomy.keys),$width=cssVar("switch-track-width"),$height$1=cssVar("switch-track-height"),$diff=cssVar("switch-track-diff"),diffValue=calc.subtract($width,$height$1),$translateX=cssVar("switch-thumb-x"),$bg$f=cssVar("switch-bg"),baseStyleTrack$2=i=>{const{colorScheme:s}=i;return{borderRadius:"full",p:"0.5",width:[$width.reference],height:[$height$1.reference],transitionProperty:"common",transitionDuration:"fast",[$bg$f.variable]:"colors.gray.300",_dark:{[$bg$f.variable]:"colors.whiteAlpha.400"},_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_checked:{[$bg$f.variable]:`colors.${s}.500`,_dark:{[$bg$f.variable]:`colors.${s}.200`}},bg:$bg$f.reference}},baseStyleThumb$1={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[$height$1.reference],height:[$height$1.reference],_checked:{transform:`translateX(${$translateX.reference})`}},baseStyle$E=definePartsStyle$o(i=>({container:{[$diff.variable]:diffValue,[$translateX.variable]:$diff.reference,_rtl:{[$translateX.variable]:calc($diff).negate().toString()}},track:baseStyleTrack$2(i),thumb:baseStyleThumb$1})),sizes$l={sm:definePartsStyle$o({container:{[$width.variable]:"1.375rem",[$height$1.variable]:"sizes.3"}}),md:definePartsStyle$o({container:{[$width.variable]:"1.875rem",[$height$1.variable]:"sizes.4"}}),lg:definePartsStyle$o({container:{[$width.variable]:"2.875rem",[$height$1.variable]:"sizes.6"}})},switchTheme=defineMultiStyleConfig$o({baseStyle:baseStyle$E,sizes:sizes$l,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:defineMultiStyleConfig$n,definePartsStyle:definePartsStyle$n}=createMultiStyleConfigHelpers(tableAnatomy.keys),baseStyle$D=definePartsStyle$n({table:{fontVariantNumeric:"lining-nums tabular-nums",borderCollapse:"collapse",width:"full"},th:{fontFamily:"heading",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"wider",textAlign:"start"},td:{textAlign:"start"},caption:{mt:4,fontFamily:"heading",textAlign:"center",fontWeight:"medium"}}),numericStyles={"&[data-is-numeric=true]":{textAlign:"end"}},variantSimple=definePartsStyle$n(i=>{const{colorScheme:s}=i;return{th:{color:mode("gray.600","gray.400")(i),borderBottom:"1px",borderColor:mode(`${s}.100`,`${s}.700`)(i),...numericStyles},td:{borderBottom:"1px",borderColor:mode(`${s}.100`,`${s}.700`)(i),...numericStyles},caption:{color:mode("gray.600","gray.100")(i)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),variantStripe=definePartsStyle$n(i=>{const{colorScheme:s}=i;return{th:{color:mode("gray.600","gray.400")(i),borderBottom:"1px",borderColor:mode(`${s}.100`,`${s}.700`)(i),...numericStyles},td:{borderBottom:"1px",borderColor:mode(`${s}.100`,`${s}.700`)(i),...numericStyles},caption:{color:mode("gray.600","gray.100")(i)},tbody:{tr:{"&:nth-of-type(odd)":{"th, td":{borderBottomWidth:"1px",borderColor:mode(`${s}.100`,`${s}.700`)(i)},td:{background:mode(`${s}.100`,`${s}.700`)(i)}}}},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),variants$e={simple:variantSimple,striped:variantStripe,unstyled:{}},sizes$k={sm:definePartsStyle$n({th:{px:"4",py:"1",lineHeight:"4",fontSize:"xs"},td:{px:"4",py:"2",fontSize:"sm",lineHeight:"4"},caption:{px:"4",py:"2",fontSize:"xs"}}),md:definePartsStyle$n({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:definePartsStyle$n({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},tableTheme=defineMultiStyleConfig$n({baseStyle:baseStyle$D,variants:variants$e,sizes:sizes$k,defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),$fg$5=cssVar$1("tabs-color"),$bg$e=cssVar$1("tabs-bg"),$border$3=cssVar$1("tabs-border-color"),{defineMultiStyleConfig:defineMultiStyleConfig$m,definePartsStyle:definePartsStyle$m}=createMultiStyleConfigHelpers(tabsAnatomy.keys),baseStyleRoot$1=i=>{const{orientation:s}=i;return{display:s==="vertical"?"flex":"block"}},baseStyleTab=i=>{const{isFitted:s}=i;return{flex:s?1:void 0,transitionProperty:"common",transitionDuration:"normal",_focusVisible:{zIndex:1,boxShadow:"outline"},_disabled:{cursor:"not-allowed",opacity:.4}}},baseStyleTablist=i=>{const{align:s="start",orientation:o}=i;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[s],flexDirection:o==="vertical"?"column":"row"}},baseStyleTabpanel={p:4},baseStyle$C=definePartsStyle$m(i=>({root:baseStyleRoot$1(i),tab:baseStyleTab(i),tablist:baseStyleTablist(i),tabpanel:baseStyleTabpanel})),sizes$j={sm:definePartsStyle$m({tab:{py:1,px:4,fontSize:"sm"}}),md:definePartsStyle$m({tab:{fontSize:"md",py:2,px:4}}),lg:definePartsStyle$m({tab:{fontSize:"lg",py:3,px:4}})},variantLine=definePartsStyle$m(i=>{const{colorScheme:s,orientation:o}=i,a=o==="vertical",rt=a?"borderStart":"borderBottom",et=a?"marginStart":"marginBottom";return{tablist:{[rt]:"2px solid",borderColor:"inherit"},tab:{[rt]:"2px solid",borderColor:"transparent",[et]:"-2px",_selected:{[$fg$5.variable]:`colors.${s}.600`,_dark:{[$fg$5.variable]:`colors.${s}.300`},borderColor:"currentColor"},_active:{[$bg$e.variable]:"colors.gray.200",_dark:{[$bg$e.variable]:"colors.whiteAlpha.300"}},_disabled:{_active:{bg:"none"}},color:$fg$5.reference,bg:$bg$e.reference}}}),variantEnclosed=definePartsStyle$m(i=>{const{colorScheme:s}=i;return{tab:{borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px",[$border$3.variable]:"transparent",_selected:{[$fg$5.variable]:`colors.${s}.600`,[$border$3.variable]:"colors.white",_dark:{[$fg$5.variable]:`colors.${s}.300`,[$border$3.variable]:"colors.gray.800"},borderColor:"inherit",borderBottomColor:$border$3.reference},color:$fg$5.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),variantEnclosedColored=definePartsStyle$m(i=>{const{colorScheme:s}=i;return{tab:{border:"1px solid",borderColor:"inherit",[$bg$e.variable]:"colors.gray.50",_dark:{[$bg$e.variable]:"colors.whiteAlpha.50"},mb:"-1px",_notLast:{marginEnd:"-1px"},_selected:{[$bg$e.variable]:"colors.white",[$fg$5.variable]:`colors.${s}.600`,_dark:{[$bg$e.variable]:"colors.gray.800",[$fg$5.variable]:`colors.${s}.300`},borderColor:"inherit",borderTopColor:"currentColor",borderBottomColor:"transparent"},color:$fg$5.reference,bg:$bg$e.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),variantSoftRounded=definePartsStyle$m(i=>{const{colorScheme:s,theme:o}=i;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:getColor(o,`${s}.700`),bg:getColor(o,`${s}.100`)}}}}),variantSolidRounded=definePartsStyle$m(i=>{const{colorScheme:s}=i;return{tab:{borderRadius:"full",fontWeight:"semibold",[$fg$5.variable]:"colors.gray.600",_dark:{[$fg$5.variable]:"inherit"},_selected:{[$fg$5.variable]:"colors.white",[$bg$e.variable]:`colors.${s}.600`,_dark:{[$fg$5.variable]:"colors.gray.800",[$bg$e.variable]:`colors.${s}.300`}},color:$fg$5.reference,bg:$bg$e.reference}}}),variantUnstyled$2=definePartsStyle$m({}),variants$d={line:variantLine,enclosed:variantEnclosed,"enclosed-colored":variantEnclosedColored,"soft-rounded":variantSoftRounded,"solid-rounded":variantSolidRounded,unstyled:variantUnstyled$2},tabsTheme=defineMultiStyleConfig$m({baseStyle:baseStyle$C,sizes:sizes$j,variants:variants$d,defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),vars=defineCssVars("badge",["bg","color","shadow"]),baseStyle$B={px:1,textTransform:"uppercase",fontSize:"xs",borderRadius:"sm",fontWeight:"bold",bg:vars.bg.reference,color:vars.color.reference,boxShadow:vars.shadow.reference},variantSolid$3=i=>{const{colorScheme:s,theme:o}=i,a=transparentize(`${s}.500`,.6)(o);return{[vars.bg.variable]:`colors.${s}.500`,[vars.color.variable]:"colors.white",_dark:{[vars.bg.variable]:a,[vars.color.variable]:"colors.whiteAlpha.800"}}},variantSubtle$1=i=>{const{colorScheme:s,theme:o}=i,a=transparentize(`${s}.200`,.16)(o);return{[vars.bg.variable]:`colors.${s}.100`,[vars.color.variable]:`colors.${s}.800`,_dark:{[vars.bg.variable]:a,[vars.color.variable]:`colors.${s}.200`}}},variantOutline$2=i=>{const{colorScheme:s,theme:o}=i,a=transparentize(`${s}.200`,.8)(o);return{[vars.color.variable]:`colors.${s}.500`,_dark:{[vars.color.variable]:a},[vars.shadow.variable]:`inset 0 0 0px 1px ${vars.color.reference}`}},variants$c={solid:variantSolid$3,subtle:variantSubtle$1,outline:variantOutline$2},badgeTheme={baseStyle:baseStyle$B,variants:variants$c,defaultProps:{variant:"subtle",colorScheme:"gray"}},{defineMultiStyleConfig:defineMultiStyleConfig$l,definePartsStyle:definePartsStyle$l}=createMultiStyleConfigHelpers(tagAnatomy.keys),$bg$d=cssVar$1("tag-bg"),$color=cssVar$1("tag-color"),$shadow$3=cssVar$1("tag-shadow"),$minH=cssVar$1("tag-min-height"),$minW=cssVar$1("tag-min-width"),$fontSize$1=cssVar$1("tag-font-size"),$paddingX=cssVar$1("tag-padding-inline"),baseStyleContainer$4={fontWeight:"medium",lineHeight:1.2,outline:0,[$color.variable]:vars.color.reference,[$bg$d.variable]:vars.bg.reference,[$shadow$3.variable]:vars.shadow.reference,color:$color.reference,bg:$bg$d.reference,boxShadow:$shadow$3.reference,borderRadius:"md",minH:$minH.reference,minW:$minW.reference,fontSize:$fontSize$1.reference,px:$paddingX.reference,_focusVisible:{[$shadow$3.variable]:"shadows.outline"}},baseStyleLabel$4={lineHeight:1.2,overflow:"visible"},baseStyleCloseButton$3={fontSize:"lg",w:"5",h:"5",transitionProperty:"common",transitionDuration:"normal",borderRadius:"full",marginStart:"1.5",marginEnd:"-1",opacity:.5,_disabled:{opacity:.4},_focusVisible:{boxShadow:"outline",bg:"rgba(0, 0, 0, 0.14)"},_hover:{opacity:.8},_active:{opacity:1}},baseStyle$A=definePartsStyle$l({container:baseStyleContainer$4,label:baseStyleLabel$4,closeButton:baseStyleCloseButton$3}),sizes$i={sm:definePartsStyle$l({container:{[$minH.variable]:"sizes.5",[$minW.variable]:"sizes.5",[$fontSize$1.variable]:"fontSizes.xs",[$paddingX.variable]:"space.2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:definePartsStyle$l({container:{[$minH.variable]:"sizes.6",[$minW.variable]:"sizes.6",[$fontSize$1.variable]:"fontSizes.sm",[$paddingX.variable]:"space.2"}}),lg:definePartsStyle$l({container:{[$minH.variable]:"sizes.8",[$minW.variable]:"sizes.8",[$fontSize$1.variable]:"fontSizes.md",[$paddingX.variable]:"space.3"}})},variants$b={subtle:definePartsStyle$l(i=>{var s;return{container:(s=badgeTheme.variants)==null?void 0:s.subtle(i)}}),solid:definePartsStyle$l(i=>{var s;return{container:(s=badgeTheme.variants)==null?void 0:s.solid(i)}}),outline:definePartsStyle$l(i=>{var s;return{container:(s=badgeTheme.variants)==null?void 0:s.outline(i)}})},tagTheme=defineMultiStyleConfig$l({variants:variants$b,baseStyle:baseStyle$A,sizes:sizes$i,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}}),{definePartsStyle:definePartsStyle$k,defineMultiStyleConfig:defineMultiStyleConfig$k}=createMultiStyleConfigHelpers(inputAnatomy.keys),$height=cssVar$1("input-height"),$fontSize=cssVar$1("input-font-size"),$padding$1=cssVar$1("input-padding"),$borderRadius=cssVar$1("input-border-radius"),baseStyle$z=definePartsStyle$k({addon:{height:$height.reference,fontSize:$fontSize.reference,px:$padding$1.reference,borderRadius:$borderRadius.reference},field:{width:"100%",height:$height.reference,fontSize:$fontSize.reference,px:$padding$1.reference,borderRadius:$borderRadius.reference,minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),size={lg:{[$fontSize.variable]:"fontSizes.lg",[$padding$1.variable]:"space.4",[$borderRadius.variable]:"radii.md",[$height.variable]:"sizes.12"},md:{[$fontSize.variable]:"fontSizes.md",[$padding$1.variable]:"space.4",[$borderRadius.variable]:"radii.md",[$height.variable]:"sizes.10"},sm:{[$fontSize.variable]:"fontSizes.sm",[$padding$1.variable]:"space.3",[$borderRadius.variable]:"radii.sm",[$height.variable]:"sizes.8"},xs:{[$fontSize.variable]:"fontSizes.xs",[$padding$1.variable]:"space.2",[$borderRadius.variable]:"radii.sm",[$height.variable]:"sizes.6"}},sizes$h={lg:definePartsStyle$k({field:size.lg,group:size.lg}),md:definePartsStyle$k({field:size.md,group:size.md}),sm:definePartsStyle$k({field:size.sm,group:size.sm}),xs:definePartsStyle$k({field:size.xs,group:size.xs})};function getDefaults(i){const{focusBorderColor:s,errorBorderColor:o}=i;return{focusBorderColor:s||mode("blue.500","blue.300")(i),errorBorderColor:o||mode("red.500","red.300")(i)}}var variantOutline$1=definePartsStyle$k(i=>{const{theme:s}=i,{focusBorderColor:o,errorBorderColor:a}=getDefaults(i);return{field:{border:"1px solid",borderColor:"inherit",bg:"inherit",_hover:{borderColor:mode("gray.300","whiteAlpha.400")(i)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:getColor(s,a),boxShadow:`0 0 0 1px ${getColor(s,a)}`},_focusVisible:{zIndex:1,borderColor:getColor(s,o),boxShadow:`0 0 0 1px ${getColor(s,o)}`}},addon:{border:"1px solid",borderColor:mode("inherit","whiteAlpha.50")(i),bg:mode("gray.100","whiteAlpha.300")(i)}}}),variantFilled=definePartsStyle$k(i=>{const{theme:s}=i,{focusBorderColor:o,errorBorderColor:a}=getDefaults(i);return{field:{border:"2px solid",borderColor:"transparent",bg:mode("gray.100","whiteAlpha.50")(i),_hover:{bg:mode("gray.200","whiteAlpha.100")(i)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:getColor(s,a)},_focusVisible:{bg:"transparent",borderColor:getColor(s,o)}},addon:{border:"2px solid",borderColor:"transparent",bg:mode("gray.100","whiteAlpha.50")(i)}}}),variantFlushed=definePartsStyle$k(i=>{const{theme:s}=i,{focusBorderColor:o,errorBorderColor:a}=getDefaults(i);return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:getColor(s,a),boxShadow:`0px 1px 0px 0px ${getColor(s,a)}`},_focusVisible:{borderColor:getColor(s,o),boxShadow:`0px 1px 0px 0px ${getColor(s,o)}`}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}}),variantUnstyled$1=definePartsStyle$k({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}}),variants$a={outline:variantOutline$1,filled:variantFilled,flushed:variantFlushed,unstyled:variantUnstyled$1},inputTheme=defineMultiStyleConfig$k({baseStyle:baseStyle$z,sizes:sizes$h,variants:variants$a,defaultProps:{size:"md",variant:"outline"}}),_a$4,baseStyle$y={...(_a$4=inputTheme.baseStyle)==null?void 0:_a$4.field,paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"},_a2$2,_b$2,variants$9={outline:i=>{var s,o;return(o=(s=inputTheme.variants)==null?void 0:s.outline(i).field)!=null?o:{}},flushed:i=>{var s,o;return(o=(s=inputTheme.variants)==null?void 0:s.flushed(i).field)!=null?o:{}},filled:i=>{var s,o;return(o=(s=inputTheme.variants)==null?void 0:s.filled(i).field)!=null?o:{}},unstyled:(_b$2=(_a2$2=inputTheme.variants)==null?void 0:_a2$2.unstyled.field)!=null?_b$2:{}},_a3,_b2,_c$1,_d$1,_e$1,_f$1,_g$1,_h$1,sizes$g={xs:(_b2=(_a3=inputTheme.sizes)==null?void 0:_a3.xs.field)!=null?_b2:{},sm:(_d$1=(_c$1=inputTheme.sizes)==null?void 0:_c$1.sm.field)!=null?_d$1:{},md:(_f$1=(_e$1=inputTheme.sizes)==null?void 0:_e$1.md.field)!=null?_f$1:{},lg:(_h$1=(_g$1=inputTheme.sizes)==null?void 0:_g$1.lg.field)!=null?_h$1:{}},textareaTheme={baseStyle:baseStyle$y,sizes:sizes$g,variants:variants$9,defaultProps:{size:"md",variant:"outline"}},$bg$c=cssVar("tooltip-bg"),$fg$4=cssVar("tooltip-fg"),$arrowBg$1=cssVar("popper-arrow-bg"),baseStyle$x={bg:$bg$c.reference,color:$fg$4.reference,[$bg$c.variable]:"colors.gray.700",[$fg$4.variable]:"colors.whiteAlpha.900",_dark:{[$bg$c.variable]:"colors.gray.300",[$fg$4.variable]:"colors.gray.900"},[$arrowBg$1.variable]:$bg$c.reference,px:"2",py:"0.5",borderRadius:"sm",fontWeight:"medium",fontSize:"sm",boxShadow:"md",maxW:"xs",zIndex:"tooltip"},tooltipTheme={baseStyle:baseStyle$x},{defineMultiStyleConfig:defineMultiStyleConfig$j,definePartsStyle:definePartsStyle$j}=createMultiStyleConfigHelpers(progressAnatomy.keys),filledStyle=i=>{const{colorScheme:s,theme:o,isIndeterminate:a,hasStripe:rt}=i,et=mode(generateStripe(),generateStripe("1rem","rgba(0,0,0,0.1)"))(i),ot=mode(`${s}.500`,`${s}.200`)(i),at=`linear-gradient( + )`,backgroundSize:`${i} ${i}`}}var randomHex=()=>`#${Math.floor(Math.random()*16777215).toString(16).padEnd(6,"0")}`;function randomColor(i){const s=randomHex();return!i||isEmptyObject(i)?s:i.string&&i.colors?randomColorFromList(i.string,i.colors):i.string&&!i.colors?randomColorFromString(i.string):i.colors&&!i.string?randomFromList(i.colors):s}function randomColorFromString(i){let s=0;if(i.length===0)return s.toString();for(let a=0;a>a*8&255;o+=`00${rt.toString(16)}`.substr(-2)}return o}function randomColorFromList(i,s){let o=0;if(i.length===0)return s[0];for(let a=0;ao.colorMode==="dark"?s:i}function orient(i){const{orientation:s,vertical:o,horizontal:a}=i;return s?s==="vertical"?o:a:{}}function toRef(i){return isObject$2(i)&&i.reference?i.reference:String(i)}var toExpr=(i,...s)=>s.map(toRef).join(` ${i} `).replace(/calc/g,""),add=(...i)=>`calc(${toExpr("+",...i)})`,subtract=(...i)=>`calc(${toExpr("-",...i)})`,multiply=(...i)=>`calc(${toExpr("*",...i)})`,divide=(...i)=>`calc(${toExpr("/",...i)})`,negate=i=>{const s=toRef(i);return s!=null&&!Number.isNaN(parseFloat(s))?String(s).startsWith("-")?String(s).slice(1):`-${s}`:multiply(s,-1)},calc=Object.assign(i=>({add:(...s)=>calc(add(i,...s)),subtract:(...s)=>calc(subtract(i,...s)),multiply:(...s)=>calc(multiply(i,...s)),divide:(...s)=>calc(divide(i,...s)),negate:()=>calc(negate(i)),toString:()=>i.toString()}),{add,subtract,multiply,divide,negate});function isDecimal(i){return!Number.isInteger(parseFloat(i.toString()))}function replaceWhiteSpace(i,s="-"){return i.replace(/\s+/g,s)}function escape(i){const s=replaceWhiteSpace(i.toString());return s.includes("\\.")?i:isDecimal(i)?s.replace(".","\\."):i}function addPrefix(i,s=""){return[s,escape(i)].filter(Boolean).join("-")}function toVarRef(i,s){return`var(${escape(i)}${s?`, ${s}`:""})`}function toVar(i,s=""){return`--${addPrefix(i,s)}`}function cssVar(i,s){const o=toVar(i,void 0);return{variable:o,reference:toVarRef(o,getFallback(void 0))}}function getFallback(i){return typeof i=="string"?i:i==null?void 0:i.reference}var{defineMultiStyleConfig:defineMultiStyleConfig$o,definePartsStyle:definePartsStyle$o}=createMultiStyleConfigHelpers(switchAnatomy.keys),$width=cssVar("switch-track-width"),$height$1=cssVar("switch-track-height"),$diff=cssVar("switch-track-diff"),diffValue=calc.subtract($width,$height$1),$translateX=cssVar("switch-thumb-x"),$bg$f=cssVar("switch-bg"),baseStyleTrack$2=i=>{const{colorScheme:s}=i;return{borderRadius:"full",p:"0.5",width:[$width.reference],height:[$height$1.reference],transitionProperty:"common",transitionDuration:"fast",[$bg$f.variable]:"colors.gray.300",_dark:{[$bg$f.variable]:"colors.whiteAlpha.400"},_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_checked:{[$bg$f.variable]:`colors.${s}.500`,_dark:{[$bg$f.variable]:`colors.${s}.200`}},bg:$bg$f.reference}},baseStyleThumb$1={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[$height$1.reference],height:[$height$1.reference],_checked:{transform:`translateX(${$translateX.reference})`}},baseStyle$E=definePartsStyle$o(i=>({container:{[$diff.variable]:diffValue,[$translateX.variable]:$diff.reference,_rtl:{[$translateX.variable]:calc($diff).negate().toString()}},track:baseStyleTrack$2(i),thumb:baseStyleThumb$1})),sizes$l={sm:definePartsStyle$o({container:{[$width.variable]:"1.375rem",[$height$1.variable]:"sizes.3"}}),md:definePartsStyle$o({container:{[$width.variable]:"1.875rem",[$height$1.variable]:"sizes.4"}}),lg:definePartsStyle$o({container:{[$width.variable]:"2.875rem",[$height$1.variable]:"sizes.6"}})},switchTheme=defineMultiStyleConfig$o({baseStyle:baseStyle$E,sizes:sizes$l,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:defineMultiStyleConfig$n,definePartsStyle:definePartsStyle$n}=createMultiStyleConfigHelpers(tableAnatomy.keys),baseStyle$D=definePartsStyle$n({table:{fontVariantNumeric:"lining-nums tabular-nums",borderCollapse:"collapse",width:"full"},th:{fontFamily:"heading",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"wider",textAlign:"start"},td:{textAlign:"start"},caption:{mt:4,fontFamily:"heading",textAlign:"center",fontWeight:"medium"}}),numericStyles={"&[data-is-numeric=true]":{textAlign:"end"}},variantSimple=definePartsStyle$n(i=>{const{colorScheme:s}=i;return{th:{color:mode("gray.600","gray.400")(i),borderBottom:"1px",borderColor:mode(`${s}.100`,`${s}.700`)(i),...numericStyles},td:{borderBottom:"1px",borderColor:mode(`${s}.100`,`${s}.700`)(i),...numericStyles},caption:{color:mode("gray.600","gray.100")(i)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),variantStripe=definePartsStyle$n(i=>{const{colorScheme:s}=i;return{th:{color:mode("gray.600","gray.400")(i),borderBottom:"1px",borderColor:mode(`${s}.100`,`${s}.700`)(i),...numericStyles},td:{borderBottom:"1px",borderColor:mode(`${s}.100`,`${s}.700`)(i),...numericStyles},caption:{color:mode("gray.600","gray.100")(i)},tbody:{tr:{"&:nth-of-type(odd)":{"th, td":{borderBottomWidth:"1px",borderColor:mode(`${s}.100`,`${s}.700`)(i)},td:{background:mode(`${s}.100`,`${s}.700`)(i)}}}},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),variants$e={simple:variantSimple,striped:variantStripe,unstyled:{}},sizes$k={sm:definePartsStyle$n({th:{px:"4",py:"1",lineHeight:"4",fontSize:"xs"},td:{px:"4",py:"2",fontSize:"sm",lineHeight:"4"},caption:{px:"4",py:"2",fontSize:"xs"}}),md:definePartsStyle$n({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:definePartsStyle$n({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},tableTheme=defineMultiStyleConfig$n({baseStyle:baseStyle$D,variants:variants$e,sizes:sizes$k,defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),$fg$5=cssVar$1("tabs-color"),$bg$e=cssVar$1("tabs-bg"),$border$3=cssVar$1("tabs-border-color"),{defineMultiStyleConfig:defineMultiStyleConfig$m,definePartsStyle:definePartsStyle$m}=createMultiStyleConfigHelpers(tabsAnatomy.keys),baseStyleRoot$1=i=>{const{orientation:s}=i;return{display:s==="vertical"?"flex":"block"}},baseStyleTab=i=>{const{isFitted:s}=i;return{flex:s?1:void 0,transitionProperty:"common",transitionDuration:"normal",_focusVisible:{zIndex:1,boxShadow:"outline"},_disabled:{cursor:"not-allowed",opacity:.4}}},baseStyleTablist=i=>{const{align:s="start",orientation:o}=i;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[s],flexDirection:o==="vertical"?"column":"row"}},baseStyleTabpanel={p:4},baseStyle$C=definePartsStyle$m(i=>({root:baseStyleRoot$1(i),tab:baseStyleTab(i),tablist:baseStyleTablist(i),tabpanel:baseStyleTabpanel})),sizes$j={sm:definePartsStyle$m({tab:{py:1,px:4,fontSize:"sm"}}),md:definePartsStyle$m({tab:{fontSize:"md",py:2,px:4}}),lg:definePartsStyle$m({tab:{fontSize:"lg",py:3,px:4}})},variantLine=definePartsStyle$m(i=>{const{colorScheme:s,orientation:o}=i,a=o==="vertical",rt=a?"borderStart":"borderBottom",tt=a?"marginStart":"marginBottom";return{tablist:{[rt]:"2px solid",borderColor:"inherit"},tab:{[rt]:"2px solid",borderColor:"transparent",[tt]:"-2px",_selected:{[$fg$5.variable]:`colors.${s}.600`,_dark:{[$fg$5.variable]:`colors.${s}.300`},borderColor:"currentColor"},_active:{[$bg$e.variable]:"colors.gray.200",_dark:{[$bg$e.variable]:"colors.whiteAlpha.300"}},_disabled:{_active:{bg:"none"}},color:$fg$5.reference,bg:$bg$e.reference}}}),variantEnclosed=definePartsStyle$m(i=>{const{colorScheme:s}=i;return{tab:{borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px",[$border$3.variable]:"transparent",_selected:{[$fg$5.variable]:`colors.${s}.600`,[$border$3.variable]:"colors.white",_dark:{[$fg$5.variable]:`colors.${s}.300`,[$border$3.variable]:"colors.gray.800"},borderColor:"inherit",borderBottomColor:$border$3.reference},color:$fg$5.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),variantEnclosedColored=definePartsStyle$m(i=>{const{colorScheme:s}=i;return{tab:{border:"1px solid",borderColor:"inherit",[$bg$e.variable]:"colors.gray.50",_dark:{[$bg$e.variable]:"colors.whiteAlpha.50"},mb:"-1px",_notLast:{marginEnd:"-1px"},_selected:{[$bg$e.variable]:"colors.white",[$fg$5.variable]:`colors.${s}.600`,_dark:{[$bg$e.variable]:"colors.gray.800",[$fg$5.variable]:`colors.${s}.300`},borderColor:"inherit",borderTopColor:"currentColor",borderBottomColor:"transparent"},color:$fg$5.reference,bg:$bg$e.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),variantSoftRounded=definePartsStyle$m(i=>{const{colorScheme:s,theme:o}=i;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:getColor(o,`${s}.700`),bg:getColor(o,`${s}.100`)}}}}),variantSolidRounded=definePartsStyle$m(i=>{const{colorScheme:s}=i;return{tab:{borderRadius:"full",fontWeight:"semibold",[$fg$5.variable]:"colors.gray.600",_dark:{[$fg$5.variable]:"inherit"},_selected:{[$fg$5.variable]:"colors.white",[$bg$e.variable]:`colors.${s}.600`,_dark:{[$fg$5.variable]:"colors.gray.800",[$bg$e.variable]:`colors.${s}.300`}},color:$fg$5.reference,bg:$bg$e.reference}}}),variantUnstyled$2=definePartsStyle$m({}),variants$d={line:variantLine,enclosed:variantEnclosed,"enclosed-colored":variantEnclosedColored,"soft-rounded":variantSoftRounded,"solid-rounded":variantSolidRounded,unstyled:variantUnstyled$2},tabsTheme=defineMultiStyleConfig$m({baseStyle:baseStyle$C,sizes:sizes$j,variants:variants$d,defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),vars=defineCssVars("badge",["bg","color","shadow"]),baseStyle$B={px:1,textTransform:"uppercase",fontSize:"xs",borderRadius:"sm",fontWeight:"bold",bg:vars.bg.reference,color:vars.color.reference,boxShadow:vars.shadow.reference},variantSolid$3=i=>{const{colorScheme:s,theme:o}=i,a=transparentize(`${s}.500`,.6)(o);return{[vars.bg.variable]:`colors.${s}.500`,[vars.color.variable]:"colors.white",_dark:{[vars.bg.variable]:a,[vars.color.variable]:"colors.whiteAlpha.800"}}},variantSubtle$1=i=>{const{colorScheme:s,theme:o}=i,a=transparentize(`${s}.200`,.16)(o);return{[vars.bg.variable]:`colors.${s}.100`,[vars.color.variable]:`colors.${s}.800`,_dark:{[vars.bg.variable]:a,[vars.color.variable]:`colors.${s}.200`}}},variantOutline$2=i=>{const{colorScheme:s,theme:o}=i,a=transparentize(`${s}.200`,.8)(o);return{[vars.color.variable]:`colors.${s}.500`,_dark:{[vars.color.variable]:a},[vars.shadow.variable]:`inset 0 0 0px 1px ${vars.color.reference}`}},variants$c={solid:variantSolid$3,subtle:variantSubtle$1,outline:variantOutline$2},badgeTheme={baseStyle:baseStyle$B,variants:variants$c,defaultProps:{variant:"subtle",colorScheme:"gray"}},{defineMultiStyleConfig:defineMultiStyleConfig$l,definePartsStyle:definePartsStyle$l}=createMultiStyleConfigHelpers(tagAnatomy.keys),$bg$d=cssVar$1("tag-bg"),$color=cssVar$1("tag-color"),$shadow$3=cssVar$1("tag-shadow"),$minH=cssVar$1("tag-min-height"),$minW=cssVar$1("tag-min-width"),$fontSize$1=cssVar$1("tag-font-size"),$paddingX=cssVar$1("tag-padding-inline"),baseStyleContainer$4={fontWeight:"medium",lineHeight:1.2,outline:0,[$color.variable]:vars.color.reference,[$bg$d.variable]:vars.bg.reference,[$shadow$3.variable]:vars.shadow.reference,color:$color.reference,bg:$bg$d.reference,boxShadow:$shadow$3.reference,borderRadius:"md",minH:$minH.reference,minW:$minW.reference,fontSize:$fontSize$1.reference,px:$paddingX.reference,_focusVisible:{[$shadow$3.variable]:"shadows.outline"}},baseStyleLabel$4={lineHeight:1.2,overflow:"visible"},baseStyleCloseButton$3={fontSize:"lg",w:"5",h:"5",transitionProperty:"common",transitionDuration:"normal",borderRadius:"full",marginStart:"1.5",marginEnd:"-1",opacity:.5,_disabled:{opacity:.4},_focusVisible:{boxShadow:"outline",bg:"rgba(0, 0, 0, 0.14)"},_hover:{opacity:.8},_active:{opacity:1}},baseStyle$A=definePartsStyle$l({container:baseStyleContainer$4,label:baseStyleLabel$4,closeButton:baseStyleCloseButton$3}),sizes$i={sm:definePartsStyle$l({container:{[$minH.variable]:"sizes.5",[$minW.variable]:"sizes.5",[$fontSize$1.variable]:"fontSizes.xs",[$paddingX.variable]:"space.2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:definePartsStyle$l({container:{[$minH.variable]:"sizes.6",[$minW.variable]:"sizes.6",[$fontSize$1.variable]:"fontSizes.sm",[$paddingX.variable]:"space.2"}}),lg:definePartsStyle$l({container:{[$minH.variable]:"sizes.8",[$minW.variable]:"sizes.8",[$fontSize$1.variable]:"fontSizes.md",[$paddingX.variable]:"space.3"}})},variants$b={subtle:definePartsStyle$l(i=>{var s;return{container:(s=badgeTheme.variants)==null?void 0:s.subtle(i)}}),solid:definePartsStyle$l(i=>{var s;return{container:(s=badgeTheme.variants)==null?void 0:s.solid(i)}}),outline:definePartsStyle$l(i=>{var s;return{container:(s=badgeTheme.variants)==null?void 0:s.outline(i)}})},tagTheme=defineMultiStyleConfig$l({variants:variants$b,baseStyle:baseStyle$A,sizes:sizes$i,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}}),{definePartsStyle:definePartsStyle$k,defineMultiStyleConfig:defineMultiStyleConfig$k}=createMultiStyleConfigHelpers(inputAnatomy.keys),$height=cssVar$1("input-height"),$fontSize=cssVar$1("input-font-size"),$padding$1=cssVar$1("input-padding"),$borderRadius=cssVar$1("input-border-radius"),baseStyle$z=definePartsStyle$k({addon:{height:$height.reference,fontSize:$fontSize.reference,px:$padding$1.reference,borderRadius:$borderRadius.reference},field:{width:"100%",height:$height.reference,fontSize:$fontSize.reference,px:$padding$1.reference,borderRadius:$borderRadius.reference,minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),size={lg:{[$fontSize.variable]:"fontSizes.lg",[$padding$1.variable]:"space.4",[$borderRadius.variable]:"radii.md",[$height.variable]:"sizes.12"},md:{[$fontSize.variable]:"fontSizes.md",[$padding$1.variable]:"space.4",[$borderRadius.variable]:"radii.md",[$height.variable]:"sizes.10"},sm:{[$fontSize.variable]:"fontSizes.sm",[$padding$1.variable]:"space.3",[$borderRadius.variable]:"radii.sm",[$height.variable]:"sizes.8"},xs:{[$fontSize.variable]:"fontSizes.xs",[$padding$1.variable]:"space.2",[$borderRadius.variable]:"radii.sm",[$height.variable]:"sizes.6"}},sizes$h={lg:definePartsStyle$k({field:size.lg,group:size.lg}),md:definePartsStyle$k({field:size.md,group:size.md}),sm:definePartsStyle$k({field:size.sm,group:size.sm}),xs:definePartsStyle$k({field:size.xs,group:size.xs})};function getDefaults(i){const{focusBorderColor:s,errorBorderColor:o}=i;return{focusBorderColor:s||mode("blue.500","blue.300")(i),errorBorderColor:o||mode("red.500","red.300")(i)}}var variantOutline$1=definePartsStyle$k(i=>{const{theme:s}=i,{focusBorderColor:o,errorBorderColor:a}=getDefaults(i);return{field:{border:"1px solid",borderColor:"inherit",bg:"inherit",_hover:{borderColor:mode("gray.300","whiteAlpha.400")(i)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:getColor(s,a),boxShadow:`0 0 0 1px ${getColor(s,a)}`},_focusVisible:{zIndex:1,borderColor:getColor(s,o),boxShadow:`0 0 0 1px ${getColor(s,o)}`}},addon:{border:"1px solid",borderColor:mode("inherit","whiteAlpha.50")(i),bg:mode("gray.100","whiteAlpha.300")(i)}}}),variantFilled=definePartsStyle$k(i=>{const{theme:s}=i,{focusBorderColor:o,errorBorderColor:a}=getDefaults(i);return{field:{border:"2px solid",borderColor:"transparent",bg:mode("gray.100","whiteAlpha.50")(i),_hover:{bg:mode("gray.200","whiteAlpha.100")(i)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:getColor(s,a)},_focusVisible:{bg:"transparent",borderColor:getColor(s,o)}},addon:{border:"2px solid",borderColor:"transparent",bg:mode("gray.100","whiteAlpha.50")(i)}}}),variantFlushed=definePartsStyle$k(i=>{const{theme:s}=i,{focusBorderColor:o,errorBorderColor:a}=getDefaults(i);return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:getColor(s,a),boxShadow:`0px 1px 0px 0px ${getColor(s,a)}`},_focusVisible:{borderColor:getColor(s,o),boxShadow:`0px 1px 0px 0px ${getColor(s,o)}`}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}}),variantUnstyled$1=definePartsStyle$k({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}}),variants$a={outline:variantOutline$1,filled:variantFilled,flushed:variantFlushed,unstyled:variantUnstyled$1},inputTheme=defineMultiStyleConfig$k({baseStyle:baseStyle$z,sizes:sizes$h,variants:variants$a,defaultProps:{size:"md",variant:"outline"}}),_a$4,baseStyle$y={...(_a$4=inputTheme.baseStyle)==null?void 0:_a$4.field,paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"},_a2$2,_b$2,variants$9={outline:i=>{var s,o;return(o=(s=inputTheme.variants)==null?void 0:s.outline(i).field)!=null?o:{}},flushed:i=>{var s,o;return(o=(s=inputTheme.variants)==null?void 0:s.flushed(i).field)!=null?o:{}},filled:i=>{var s,o;return(o=(s=inputTheme.variants)==null?void 0:s.filled(i).field)!=null?o:{}},unstyled:(_b$2=(_a2$2=inputTheme.variants)==null?void 0:_a2$2.unstyled.field)!=null?_b$2:{}},_a3,_b2,_c$1,_d$1,_e$1,_f$1,_g$1,_h$1,sizes$g={xs:(_b2=(_a3=inputTheme.sizes)==null?void 0:_a3.xs.field)!=null?_b2:{},sm:(_d$1=(_c$1=inputTheme.sizes)==null?void 0:_c$1.sm.field)!=null?_d$1:{},md:(_f$1=(_e$1=inputTheme.sizes)==null?void 0:_e$1.md.field)!=null?_f$1:{},lg:(_h$1=(_g$1=inputTheme.sizes)==null?void 0:_g$1.lg.field)!=null?_h$1:{}},textareaTheme={baseStyle:baseStyle$y,sizes:sizes$g,variants:variants$9,defaultProps:{size:"md",variant:"outline"}},$bg$c=cssVar("tooltip-bg"),$fg$4=cssVar("tooltip-fg"),$arrowBg$1=cssVar("popper-arrow-bg"),baseStyle$x={bg:$bg$c.reference,color:$fg$4.reference,[$bg$c.variable]:"colors.gray.700",[$fg$4.variable]:"colors.whiteAlpha.900",_dark:{[$bg$c.variable]:"colors.gray.300",[$fg$4.variable]:"colors.gray.900"},[$arrowBg$1.variable]:$bg$c.reference,px:"2",py:"0.5",borderRadius:"sm",fontWeight:"medium",fontSize:"sm",boxShadow:"md",maxW:"xs",zIndex:"tooltip"},tooltipTheme={baseStyle:baseStyle$x},{defineMultiStyleConfig:defineMultiStyleConfig$j,definePartsStyle:definePartsStyle$j}=createMultiStyleConfigHelpers(progressAnatomy.keys),filledStyle=i=>{const{colorScheme:s,theme:o,isIndeterminate:a,hasStripe:rt}=i,tt=mode(generateStripe(),generateStripe("1rem","rgba(0,0,0,0.1)"))(i),ot=mode(`${s}.500`,`${s}.200`)(i),at=`linear-gradient( to right, transparent 0%, ${getColor(o,ot)} 50%, transparent 100% - )`;return{...!a&&rt&&et,...a?{bgImage:at}:{bgColor:ot}}},baseStyleLabel$3={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},baseStyleTrack$1=i=>({bg:mode("gray.100","whiteAlpha.300")(i)}),baseStyleFilledTrack$1=i=>({transitionProperty:"common",transitionDuration:"slow",...filledStyle(i)}),baseStyle$w=definePartsStyle$j(i=>({label:baseStyleLabel$3,filledTrack:baseStyleFilledTrack$1(i),track:baseStyleTrack$1(i)})),sizes$f={xs:definePartsStyle$j({track:{h:"1"}}),sm:definePartsStyle$j({track:{h:"2"}}),md:definePartsStyle$j({track:{h:"3"}}),lg:definePartsStyle$j({track:{h:"4"}})},progressTheme=defineMultiStyleConfig$j({sizes:sizes$f,baseStyle:baseStyle$w,defaultProps:{size:"md",colorScheme:"blue"}}),isFunction$3=i=>typeof i=="function";function runIfFn$1(i,...s){return isFunction$3(i)?i(...s):i}var{definePartsStyle:definePartsStyle$i,defineMultiStyleConfig:defineMultiStyleConfig$i}=createMultiStyleConfigHelpers(checkboxAnatomy.keys),$size$3=cssVar$1("checkbox-size"),baseStyleControl$1=i=>{const{colorScheme:s}=i;return{w:$size$3.reference,h:$size$3.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:mode(`${s}.500`,`${s}.200`)(i),borderColor:mode(`${s}.500`,`${s}.200`)(i),color:mode("white","gray.900")(i),_hover:{bg:mode(`${s}.600`,`${s}.300`)(i),borderColor:mode(`${s}.600`,`${s}.300`)(i)},_disabled:{borderColor:mode("gray.200","transparent")(i),bg:mode("gray.200","whiteAlpha.300")(i),color:mode("gray.500","whiteAlpha.500")(i)}},_indeterminate:{bg:mode(`${s}.500`,`${s}.200`)(i),borderColor:mode(`${s}.500`,`${s}.200`)(i),color:mode("white","gray.900")(i)},_disabled:{bg:mode("gray.100","whiteAlpha.100")(i),borderColor:mode("gray.100","transparent")(i)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:mode("red.500","red.300")(i)}}},baseStyleContainer$3={_disabled:{cursor:"not-allowed"}},baseStyleLabel$2={userSelect:"none",_disabled:{opacity:.4}},baseStyleIcon$6={transitionProperty:"transform",transitionDuration:"normal"},baseStyle$v=definePartsStyle$i(i=>({icon:baseStyleIcon$6,container:baseStyleContainer$3,control:runIfFn$1(baseStyleControl$1,i),label:baseStyleLabel$2})),sizes$e={sm:definePartsStyle$i({control:{[$size$3.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:definePartsStyle$i({control:{[$size$3.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:definePartsStyle$i({control:{[$size$3.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},checkboxTheme=defineMultiStyleConfig$i({baseStyle:baseStyle$v,sizes:sizes$e,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:defineMultiStyleConfig$h,definePartsStyle:definePartsStyle$h}=createMultiStyleConfigHelpers(radioAnatomy.keys),baseStyleControl=i=>{var s;const o=(s=runIfFn$1(checkboxTheme.baseStyle,i))==null?void 0:s.control;return{...o,borderRadius:"full",_checked:{...o==null?void 0:o._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},baseStyle$u=definePartsStyle$h(i=>{var s,o,a,rt;return{label:(o=(s=checkboxTheme).baseStyle)==null?void 0:o.call(s,i).label,container:(rt=(a=checkboxTheme).baseStyle)==null?void 0:rt.call(a,i).container,control:baseStyleControl(i)}}),sizes$d={md:definePartsStyle$h({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:definePartsStyle$h({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:definePartsStyle$h({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},radioTheme=defineMultiStyleConfig$h({baseStyle:baseStyle$u,sizes:sizes$d,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:defineMultiStyleConfig$g,definePartsStyle:definePartsStyle$g}=createMultiStyleConfigHelpers(selectAnatomy.keys),$bg$b=cssVar$1("select-bg"),_a$3,baseStyleField$1={...(_a$3=inputTheme.baseStyle)==null?void 0:_a$3.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:$bg$b.reference,[$bg$b.variable]:"colors.white",_dark:{[$bg$b.variable]:"colors.gray.700"},"> option, > optgroup":{bg:$bg$b.reference}},baseStyleIcon$5={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},baseStyle$t=definePartsStyle$g({field:baseStyleField$1,icon:baseStyleIcon$5}),iconSpacing={paddingInlineEnd:"8"},_a2$1,_b$1,_c,_d,_e,_f,_g,_h,sizes$c={lg:{...(_a2$1=inputTheme.sizes)==null?void 0:_a2$1.lg,field:{...(_b$1=inputTheme.sizes)==null?void 0:_b$1.lg.field,...iconSpacing}},md:{...(_c=inputTheme.sizes)==null?void 0:_c.md,field:{...(_d=inputTheme.sizes)==null?void 0:_d.md.field,...iconSpacing}},sm:{...(_e=inputTheme.sizes)==null?void 0:_e.sm,field:{...(_f=inputTheme.sizes)==null?void 0:_f.sm.field,...iconSpacing}},xs:{...(_g=inputTheme.sizes)==null?void 0:_g.xs,field:{...(_h=inputTheme.sizes)==null?void 0:_h.xs.field,...iconSpacing},icon:{insetEnd:"1"}}},selectTheme=defineMultiStyleConfig$g({baseStyle:baseStyle$t,sizes:sizes$c,variants:inputTheme.variants,defaultProps:inputTheme.defaultProps}),$startColor=cssVar$1("skeleton-start-color"),$endColor=cssVar$1("skeleton-end-color"),baseStyle$s={[$startColor.variable]:"colors.gray.100",[$endColor.variable]:"colors.gray.400",_dark:{[$startColor.variable]:"colors.gray.800",[$endColor.variable]:"colors.gray.600"},background:$startColor.reference,borderColor:$endColor.reference,opacity:.7,borderRadius:"sm"},skeletonTheme={baseStyle:baseStyle$s},$bg$a=cssVar$1("skip-link-bg"),baseStyle$r={borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[$bg$a.variable]:"colors.white",_dark:{[$bg$a.variable]:"colors.gray.700"},bg:$bg$a.reference}},skipLinkTheme={baseStyle:baseStyle$r},{defineMultiStyleConfig:defineMultiStyleConfig$f,definePartsStyle:definePartsStyle$f}=createMultiStyleConfigHelpers(sliderAnatomy.keys),$thumbSize=cssVar$1("slider-thumb-size"),$trackSize=cssVar$1("slider-track-size"),$bg$9=cssVar$1("slider-bg"),baseStyleContainer$2=i=>{const{orientation:s}=i;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...orient({orientation:s,vertical:{h:"100%"},horizontal:{w:"100%"}})}},baseStyleTrack=i=>({...orient({orientation:i.orientation,horizontal:{h:$trackSize.reference},vertical:{w:$trackSize.reference}}),overflow:"hidden",borderRadius:"sm",[$bg$9.variable]:"colors.gray.200",_dark:{[$bg$9.variable]:"colors.whiteAlpha.200"},_disabled:{[$bg$9.variable]:"colors.gray.300",_dark:{[$bg$9.variable]:"colors.whiteAlpha.300"}},bg:$bg$9.reference}),baseStyleThumb=i=>{const{orientation:s}=i;return{...orient({orientation:s,vertical:{left:"50%",transform:"translateX(-50%)",_active:{transform:"translateX(-50%) scale(1.15)"}},horizontal:{top:"50%",transform:"translateY(-50%)",_active:{transform:"translateY(-50%) scale(1.15)"}}}),w:$thumbSize.reference,h:$thumbSize.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{bg:"gray.300"}}},baseStyleFilledTrack=i=>{const{colorScheme:s}=i;return{width:"inherit",height:"inherit",[$bg$9.variable]:`colors.${s}.500`,_dark:{[$bg$9.variable]:`colors.${s}.200`},bg:$bg$9.reference}},baseStyle$q=definePartsStyle$f(i=>({container:baseStyleContainer$2(i),track:baseStyleTrack(i),thumb:baseStyleThumb(i),filledTrack:baseStyleFilledTrack(i)})),sizeLg=definePartsStyle$f({container:{[$thumbSize.variable]:"sizes.4",[$trackSize.variable]:"sizes.1"}}),sizeMd=definePartsStyle$f({container:{[$thumbSize.variable]:"sizes.3.5",[$trackSize.variable]:"sizes.1"}}),sizeSm=definePartsStyle$f({container:{[$thumbSize.variable]:"sizes.2.5",[$trackSize.variable]:"sizes.0.5"}}),sizes$b={lg:sizeLg,md:sizeMd,sm:sizeSm},sliderTheme=defineMultiStyleConfig$f({baseStyle:baseStyle$q,sizes:sizes$b,defaultProps:{size:"md",colorScheme:"blue"}}),$size$2=cssVar("spinner-size"),baseStyle$p={width:[$size$2.reference],height:[$size$2.reference]},sizes$a={xs:{[$size$2.variable]:"sizes.3"},sm:{[$size$2.variable]:"sizes.4"},md:{[$size$2.variable]:"sizes.6"},lg:{[$size$2.variable]:"sizes.8"},xl:{[$size$2.variable]:"sizes.12"}},spinnerTheme={baseStyle:baseStyle$p,sizes:sizes$a,defaultProps:{size:"md"}},{defineMultiStyleConfig:defineMultiStyleConfig$e,definePartsStyle:definePartsStyle$e}=createMultiStyleConfigHelpers(statAnatomy.keys),baseStyleLabel$1={fontWeight:"medium"},baseStyleHelpText={opacity:.8,marginBottom:"2"},baseStyleNumber={verticalAlign:"baseline",fontWeight:"semibold"},baseStyleIcon$4={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},baseStyle$o=definePartsStyle$e({container:{},label:baseStyleLabel$1,helpText:baseStyleHelpText,number:baseStyleNumber,icon:baseStyleIcon$4}),sizes$9={md:definePartsStyle$e({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},statTheme=defineMultiStyleConfig$e({baseStyle:baseStyle$o,sizes:sizes$9,defaultProps:{size:"md"}}),$bg$8=cssVar$1("kbd-bg"),baseStyle$n={[$bg$8.variable]:"colors.gray.100",_dark:{[$bg$8.variable]:"colors.whiteAlpha.100"},bg:$bg$8.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"},kbdTheme={baseStyle:baseStyle$n},baseStyle$m={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},linkTheme={baseStyle:baseStyle$m},{defineMultiStyleConfig:defineMultiStyleConfig$d,definePartsStyle:definePartsStyle$d}=createMultiStyleConfigHelpers(listAnatomy.keys),baseStyleIcon$3={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},baseStyle$l=definePartsStyle$d({icon:baseStyleIcon$3}),listTheme=defineMultiStyleConfig$d({baseStyle:baseStyle$l}),{defineMultiStyleConfig:defineMultiStyleConfig$c,definePartsStyle:definePartsStyle$c}=createMultiStyleConfigHelpers(menuAnatomy.keys),$bg$7=cssVar$1("menu-bg"),$shadow$2=cssVar$1("menu-shadow"),baseStyleList={[$bg$7.variable]:"#fff",[$shadow$2.variable]:"shadows.sm",_dark:{[$bg$7.variable]:"colors.gray.700",[$shadow$2.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:1,borderRadius:"md",borderWidth:"1px",bg:$bg$7.reference,boxShadow:$shadow$2.reference},baseStyleItem={py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[$bg$7.variable]:"colors.gray.100",_dark:{[$bg$7.variable]:"colors.whiteAlpha.100"}},_active:{[$bg$7.variable]:"colors.gray.200",_dark:{[$bg$7.variable]:"colors.whiteAlpha.200"}},_expanded:{[$bg$7.variable]:"colors.gray.100",_dark:{[$bg$7.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:$bg$7.reference},baseStyleGroupTitle={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},baseStyleIcon$2={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},baseStyleCommand={opacity:.6},baseStyleDivider={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},baseStyleButton$1={transitionProperty:"common",transitionDuration:"normal"},baseStyle$k=definePartsStyle$c({button:baseStyleButton$1,list:baseStyleList,item:baseStyleItem,groupTitle:baseStyleGroupTitle,icon:baseStyleIcon$2,command:baseStyleCommand,divider:baseStyleDivider}),menuTheme=defineMultiStyleConfig$c({baseStyle:baseStyle$k}),{defineMultiStyleConfig:defineMultiStyleConfig$b,definePartsStyle:definePartsStyle$b}=createMultiStyleConfigHelpers(modalAnatomy.keys),$bg$6=cssVar$1("modal-bg"),$shadow$1=cssVar$1("modal-shadow"),baseStyleOverlay$1={bg:"blackAlpha.600",zIndex:"modal"},baseStyleDialogContainer$1=i=>{const{isCentered:s,scrollBehavior:o}=i;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:s?"center":"flex-start",overflow:o==="inside"?"hidden":"auto",overscrollBehaviorY:"none"}},baseStyleDialog$1=i=>{const{isCentered:s,scrollBehavior:o}=i;return{borderRadius:"md",color:"inherit",my:s?"auto":"16",mx:s?"auto":void 0,zIndex:"modal",maxH:o==="inside"?"calc(100% - 7.5rem)":void 0,[$bg$6.variable]:"colors.white",[$shadow$1.variable]:"shadows.lg",_dark:{[$bg$6.variable]:"colors.gray.700",[$shadow$1.variable]:"shadows.dark-lg"},bg:$bg$6.reference,boxShadow:$shadow$1.reference}},baseStyleHeader$2={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},baseStyleCloseButton$2={position:"absolute",top:"2",insetEnd:"3"},baseStyleBody$2=i=>{const{scrollBehavior:s}=i;return{px:"6",py:"2",flex:"1",overflow:s==="inside"?"auto":void 0}},baseStyleFooter$2={px:"6",py:"4"},baseStyle$j=definePartsStyle$b(i=>({overlay:baseStyleOverlay$1,dialogContainer:runIfFn$1(baseStyleDialogContainer$1,i),dialog:runIfFn$1(baseStyleDialog$1,i),header:baseStyleHeader$2,closeButton:baseStyleCloseButton$2,body:runIfFn$1(baseStyleBody$2,i),footer:baseStyleFooter$2}));function getSize$3(i){return definePartsStyle$b(i==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:i}})}var sizes$8={xs:getSize$3("xs"),sm:getSize$3("sm"),md:getSize$3("md"),lg:getSize$3("lg"),xl:getSize$3("xl"),"2xl":getSize$3("2xl"),"3xl":getSize$3("3xl"),"4xl":getSize$3("4xl"),"5xl":getSize$3("5xl"),"6xl":getSize$3("6xl"),full:getSize$3("full")},modalTheme=defineMultiStyleConfig$b({baseStyle:baseStyle$j,sizes:sizes$8,defaultProps:{size:"md"}}),{defineMultiStyleConfig:defineMultiStyleConfig$a,definePartsStyle:definePartsStyle$a}=createMultiStyleConfigHelpers(numberInputAnatomy.keys),$stepperWidth=cssVar("number-input-stepper-width"),$inputPadding=cssVar("number-input-input-padding"),inputPaddingValue=calc($stepperWidth).add("0.5rem").toString(),$bg$5=cssVar("number-input-bg"),$fg$3=cssVar("number-input-color"),$border$2=cssVar("number-input-border-color"),baseStyleRoot={[$stepperWidth.variable]:"sizes.6",[$inputPadding.variable]:inputPaddingValue},baseStyleField=i=>{var s,o;return(o=(s=runIfFn$1(inputTheme.baseStyle,i))==null?void 0:s.field)!=null?o:{}},baseStyleStepperGroup={width:$stepperWidth.reference},baseStyleStepper={borderStart:"1px solid",borderStartColor:$border$2.reference,color:$fg$3.reference,bg:$bg$5.reference,[$fg$3.variable]:"colors.chakra-body-text",[$border$2.variable]:"colors.chakra-border-color",_dark:{[$fg$3.variable]:"colors.whiteAlpha.800",[$border$2.variable]:"colors.whiteAlpha.300"},_active:{[$bg$5.variable]:"colors.gray.200",_dark:{[$bg$5.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}},baseStyle$i=definePartsStyle$a(i=>{var s;return{root:baseStyleRoot,field:(s=runIfFn$1(baseStyleField,i))!=null?s:{},stepperGroup:baseStyleStepperGroup,stepper:baseStyleStepper}});function getSize$2(i){var s,o,a;const rt=(s=inputTheme.sizes)==null?void 0:s[i],et={lg:"md",md:"md",sm:"sm",xs:"sm"},ot=(a=(o=rt.field)==null?void 0:o.fontSize)!=null?a:"md",at=typography_default.fontSizes[ot];return definePartsStyle$a({field:{...rt.field,paddingInlineEnd:$inputPadding.reference,verticalAlign:"top"},stepper:{fontSize:calc(at).multiply(.75).toString(),_first:{borderTopEndRadius:et[i]},_last:{borderBottomEndRadius:et[i],mt:"-1px",borderTopWidth:1}}})}var sizes$7={xs:getSize$2("xs"),sm:getSize$2("sm"),md:getSize$2("md"),lg:getSize$2("lg")},numberInputTheme=defineMultiStyleConfig$a({baseStyle:baseStyle$i,sizes:sizes$7,variants:inputTheme.variants,defaultProps:inputTheme.defaultProps}),_a$2,baseStyle$h={...(_a$2=inputTheme.baseStyle)==null?void 0:_a$2.field,textAlign:"center"},sizes$6={lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}},_a2,_b,variants$8={outline:i=>{var s,o,a;return(a=(o=runIfFn$1((s=inputTheme.variants)==null?void 0:s.outline,i))==null?void 0:o.field)!=null?a:{}},flushed:i=>{var s,o,a;return(a=(o=runIfFn$1((s=inputTheme.variants)==null?void 0:s.flushed,i))==null?void 0:o.field)!=null?a:{}},filled:i=>{var s,o,a;return(a=(o=runIfFn$1((s=inputTheme.variants)==null?void 0:s.filled,i))==null?void 0:o.field)!=null?a:{}},unstyled:(_b=(_a2=inputTheme.variants)==null?void 0:_a2.unstyled.field)!=null?_b:{}},pinInputTheme={baseStyle:baseStyle$h,sizes:sizes$6,variants:variants$8,defaultProps:inputTheme.defaultProps},{defineMultiStyleConfig:defineMultiStyleConfig$9,definePartsStyle:definePartsStyle$9}=createMultiStyleConfigHelpers(popoverAnatomy.keys),$popperBg=cssVar("popper-bg"),$arrowBg=cssVar("popper-arrow-bg"),$arrowShadowColor=cssVar("popper-arrow-shadow-color"),baseStylePopper={zIndex:10},baseStyleContent={[$popperBg.variable]:"colors.white",bg:$popperBg.reference,[$arrowBg.variable]:$popperBg.reference,[$arrowShadowColor.variable]:"colors.gray.200",_dark:{[$popperBg.variable]:"colors.gray.700",[$arrowShadowColor.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},baseStyleHeader$1={px:3,py:2,borderBottomWidth:"1px"},baseStyleBody$1={px:3,py:2},baseStyleFooter$1={px:3,py:2,borderTopWidth:"1px"},baseStyleCloseButton$1={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},baseStyle$g=definePartsStyle$9({popper:baseStylePopper,content:baseStyleContent,header:baseStyleHeader$1,body:baseStyleBody$1,footer:baseStyleFooter$1,closeButton:baseStyleCloseButton$1}),popoverTheme=defineMultiStyleConfig$9({baseStyle:baseStyle$g}),{definePartsStyle:definePartsStyle$8,defineMultiStyleConfig:defineMultiStyleConfig$8}=createMultiStyleConfigHelpers(drawerAnatomy.keys),$bg$4=cssVar$1("drawer-bg"),$bs=cssVar$1("drawer-box-shadow");function getSize$1(i){return definePartsStyle$8(i==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:i}})}var baseStyleOverlay={bg:"blackAlpha.600",zIndex:"modal"},baseStyleDialogContainer={display:"flex",zIndex:"modal",justifyContent:"center"},baseStyleDialog=i=>{const{isFullHeight:s}=i;return{...s&&{height:"100vh"},zIndex:"modal",maxH:"100vh",color:"inherit",[$bg$4.variable]:"colors.white",[$bs.variable]:"shadows.lg",_dark:{[$bg$4.variable]:"colors.gray.700",[$bs.variable]:"shadows.dark-lg"},bg:$bg$4.reference,boxShadow:$bs.reference}},baseStyleHeader={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},baseStyleCloseButton={position:"absolute",top:"2",insetEnd:"3"},baseStyleBody={px:"6",py:"2",flex:"1",overflow:"auto"},baseStyleFooter={px:"6",py:"4"},baseStyle$f=definePartsStyle$8(i=>({overlay:baseStyleOverlay,dialogContainer:baseStyleDialogContainer,dialog:runIfFn$1(baseStyleDialog,i),header:baseStyleHeader,closeButton:baseStyleCloseButton,body:baseStyleBody,footer:baseStyleFooter})),sizes$5={xs:getSize$1("xs"),sm:getSize$1("md"),md:getSize$1("lg"),lg:getSize$1("2xl"),xl:getSize$1("4xl"),full:getSize$1("full")},drawerTheme=defineMultiStyleConfig$8({baseStyle:baseStyle$f,sizes:sizes$5,defaultProps:{size:"xs"}}),{definePartsStyle:definePartsStyle$7,defineMultiStyleConfig:defineMultiStyleConfig$7}=createMultiStyleConfigHelpers(editableAnatomy.keys),baseStylePreview={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},baseStyleInput={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},baseStyleTextarea={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},baseStyle$e=definePartsStyle$7({preview:baseStylePreview,input:baseStyleInput,textarea:baseStyleTextarea}),editableTheme=defineMultiStyleConfig$7({baseStyle:baseStyle$e}),{definePartsStyle:definePartsStyle$6,defineMultiStyleConfig:defineMultiStyleConfig$6}=createMultiStyleConfigHelpers(formAnatomy.keys),$fg$2=cssVar$1("form-control-color"),baseStyleRequiredIndicator={marginStart:"1",[$fg$2.variable]:"colors.red.500",_dark:{[$fg$2.variable]:"colors.red.300"},color:$fg$2.reference},baseStyleHelperText={mt:"2",[$fg$2.variable]:"colors.gray.600",_dark:{[$fg$2.variable]:"colors.whiteAlpha.600"},color:$fg$2.reference,lineHeight:"normal",fontSize:"sm"},baseStyle$d=definePartsStyle$6({container:{width:"100%",position:"relative"},requiredIndicator:baseStyleRequiredIndicator,helperText:baseStyleHelperText}),formTheme=defineMultiStyleConfig$6({baseStyle:baseStyle$d}),{definePartsStyle:definePartsStyle$5,defineMultiStyleConfig:defineMultiStyleConfig$5}=createMultiStyleConfigHelpers(formErrorAnatomy.keys),$fg$1=cssVar$1("form-error-color"),baseStyleText={[$fg$1.variable]:"colors.red.500",_dark:{[$fg$1.variable]:"colors.red.300"},color:$fg$1.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},baseStyleIcon$1={marginEnd:"0.5em",[$fg$1.variable]:"colors.red.500",_dark:{[$fg$1.variable]:"colors.red.300"},color:$fg$1.reference},baseStyle$c=definePartsStyle$5({text:baseStyleText,icon:baseStyleIcon$1}),formErrorTheme=defineMultiStyleConfig$5({baseStyle:baseStyle$c}),baseStyle$b={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},formLabelTheme={baseStyle:baseStyle$b},baseStyle$a={fontFamily:"heading",fontWeight:"bold"},sizes$4={"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},headingTheme={baseStyle:baseStyle$a,sizes:sizes$4,defaultProps:{size:"xl"}},{defineMultiStyleConfig:defineMultiStyleConfig$4,definePartsStyle:definePartsStyle$4}=createMultiStyleConfigHelpers(breadcrumbAnatomy.keys),$decor=cssVar$1("breadcrumb-link-decor"),baseStyleLink={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",outline:"none",color:"inherit",textDecoration:$decor.reference,[$decor.variable]:"none","&:not([aria-current=page])":{cursor:"pointer",_hover:{[$decor.variable]:"underline"},_focusVisible:{boxShadow:"outline"}}},baseStyle$9=definePartsStyle$4({link:baseStyleLink}),breadcrumbTheme=defineMultiStyleConfig$4({baseStyle:baseStyle$9}),baseStyle$8={lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},variantGhost=i=>{const{colorScheme:s,theme:o}=i;if(s==="gray")return{color:mode("gray.800","whiteAlpha.900")(i),_hover:{bg:mode("gray.100","whiteAlpha.200")(i)},_active:{bg:mode("gray.200","whiteAlpha.300")(i)}};const a=transparentize(`${s}.200`,.12)(o),rt=transparentize(`${s}.200`,.24)(o);return{color:mode(`${s}.600`,`${s}.200`)(i),bg:"transparent",_hover:{bg:mode(`${s}.50`,a)(i)},_active:{bg:mode(`${s}.100`,rt)(i)}}},variantOutline=i=>{const{colorScheme:s}=i,o=mode("gray.200","whiteAlpha.300")(i);return{border:"1px solid",borderColor:s==="gray"?o:"currentColor",".chakra-button__group[data-attached][data-orientation=horizontal] > &:not(:last-of-type)":{marginEnd:"-1px"},".chakra-button__group[data-attached][data-orientation=vertical] > &:not(:last-of-type)":{marginBottom:"-1px"},...runIfFn$1(variantGhost,i)}},accessibleColorMap={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},variantSolid$2=i=>{var s;const{colorScheme:o}=i;if(o==="gray"){const nt=mode("gray.100","whiteAlpha.200")(i);return{bg:nt,color:mode("gray.800","whiteAlpha.900")(i),_hover:{bg:mode("gray.200","whiteAlpha.300")(i),_disabled:{bg:nt}},_active:{bg:mode("gray.300","whiteAlpha.400")(i)}}}const{bg:a=`${o}.500`,color:rt="white",hoverBg:et=`${o}.600`,activeBg:ot=`${o}.700`}=(s=accessibleColorMap[o])!=null?s:{},at=mode(a,`${o}.200`)(i);return{bg:at,color:mode(rt,"gray.800")(i),_hover:{bg:mode(et,`${o}.300`)(i),_disabled:{bg:at}},_active:{bg:mode(ot,`${o}.400`)(i)}}},variantLink=i=>{const{colorScheme:s}=i;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:mode(`${s}.500`,`${s}.200`)(i),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:mode(`${s}.700`,`${s}.500`)(i)}}},variantUnstyled={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},variants$7={ghost:variantGhost,outline:variantOutline,solid:variantSolid$2,link:variantLink,unstyled:variantUnstyled},sizes$3={lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},buttonTheme={baseStyle:baseStyle$8,variants:variants$7,sizes:sizes$3,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:definePartsStyle$3,defineMultiStyleConfig:defineMultiStyleConfig$3}=createMultiStyleConfigHelpers(cardAnatomy.keys),$bg$3=cssVar$1("card-bg"),$padding=cssVar$1("card-padding"),$shadow=cssVar$1("card-shadow"),$radius=cssVar$1("card-radius"),$border$1=cssVar$1("card-border-width","0"),$borderColor=cssVar$1("card-border-color"),baseStyle$7=definePartsStyle$3({container:{[$bg$3.variable]:"colors.chakra-body-bg",backgroundColor:$bg$3.reference,boxShadow:$shadow.reference,borderRadius:$radius.reference,color:"chakra-body-text",borderWidth:$border$1.reference,borderColor:$borderColor.reference},body:{padding:$padding.reference,flex:"1 1 0%"},header:{padding:$padding.reference},footer:{padding:$padding.reference}}),sizes$2={sm:definePartsStyle$3({container:{[$radius.variable]:"radii.base",[$padding.variable]:"space.3"}}),md:definePartsStyle$3({container:{[$radius.variable]:"radii.md",[$padding.variable]:"space.5"}}),lg:definePartsStyle$3({container:{[$radius.variable]:"radii.xl",[$padding.variable]:"space.7"}})},variants$6={elevated:definePartsStyle$3({container:{[$shadow.variable]:"shadows.base",_dark:{[$bg$3.variable]:"colors.gray.700"}}}),outline:definePartsStyle$3({container:{[$border$1.variable]:"1px",[$borderColor.variable]:"colors.chakra-border-color"}}),filled:definePartsStyle$3({container:{[$bg$3.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{[$padding.variable]:0},header:{[$padding.variable]:0},footer:{[$padding.variable]:0}}},cardTheme=defineMultiStyleConfig$3({baseStyle:baseStyle$7,variants:variants$6,sizes:sizes$2,defaultProps:{variant:"elevated",size:"md"}}),$size$1=cssVar("close-button-size"),$bg$2=cssVar("close-button-bg"),baseStyle$6={w:[$size$1.reference],h:[$size$1.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[$bg$2.variable]:"colors.blackAlpha.100",_dark:{[$bg$2.variable]:"colors.whiteAlpha.100"}},_active:{[$bg$2.variable]:"colors.blackAlpha.200",_dark:{[$bg$2.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:$bg$2.reference},sizes$1={lg:{[$size$1.variable]:"sizes.10",fontSize:"md"},md:{[$size$1.variable]:"sizes.8",fontSize:"xs"},sm:{[$size$1.variable]:"sizes.6",fontSize:"2xs"}},closeButtonTheme={baseStyle:baseStyle$6,sizes:sizes$1,defaultProps:{size:"md"}},{variants:variants$5,defaultProps}=badgeTheme,baseStyle$5={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm",bg:vars.bg.reference,color:vars.color.reference,boxShadow:vars.shadow.reference},codeTheme={baseStyle:baseStyle$5,variants:variants$5,defaultProps},baseStyle$4={w:"100%",mx:"auto",maxW:"prose",px:"4"},containerTheme={baseStyle:baseStyle$4},baseStyle$3={opacity:.6,borderColor:"inherit"},variantSolid$1={borderStyle:"solid"},variantDashed={borderStyle:"dashed"},variants$4={solid:variantSolid$1,dashed:variantDashed},dividerTheme={baseStyle:baseStyle$3,variants:variants$4,defaultProps:{variant:"solid"}},{definePartsStyle:definePartsStyle$2,defineMultiStyleConfig:defineMultiStyleConfig$2}=createMultiStyleConfigHelpers(accordionAnatomy.keys),baseStyleContainer$1={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},baseStyleButton={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},baseStylePanel={pt:"2",px:"4",pb:"5"},baseStyleIcon={fontSize:"1.25em"},baseStyle$2=definePartsStyle$2({container:baseStyleContainer$1,button:baseStyleButton,panel:baseStylePanel,icon:baseStyleIcon}),accordionTheme=defineMultiStyleConfig$2({baseStyle:baseStyle$2}),{definePartsStyle:definePartsStyle$1,defineMultiStyleConfig:defineMultiStyleConfig$1}=createMultiStyleConfigHelpers(alertAnatomy.keys),$fg=cssVar$1("alert-fg"),$bg$1=cssVar$1("alert-bg"),baseStyle$1=definePartsStyle$1({container:{bg:$bg$1.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:$fg.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:$fg.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function getBg(i){const{theme:s,colorScheme:o}=i,a=transparentize(`${o}.200`,.16)(s);return{light:`colors.${o}.100`,dark:a}}var variantSubtle=definePartsStyle$1(i=>{const{colorScheme:s}=i,o=getBg(i);return{container:{[$fg.variable]:`colors.${s}.600`,[$bg$1.variable]:o.light,_dark:{[$fg.variable]:`colors.${s}.200`,[$bg$1.variable]:o.dark}}}}),variantLeftAccent=definePartsStyle$1(i=>{const{colorScheme:s}=i,o=getBg(i);return{container:{[$fg.variable]:`colors.${s}.600`,[$bg$1.variable]:o.light,_dark:{[$fg.variable]:`colors.${s}.200`,[$bg$1.variable]:o.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:$fg.reference}}}),variantTopAccent=definePartsStyle$1(i=>{const{colorScheme:s}=i,o=getBg(i);return{container:{[$fg.variable]:`colors.${s}.600`,[$bg$1.variable]:o.light,_dark:{[$fg.variable]:`colors.${s}.200`,[$bg$1.variable]:o.dark},pt:"2",borderTopWidth:"4px",borderTopColor:$fg.reference}}}),variantSolid=definePartsStyle$1(i=>{const{colorScheme:s}=i;return{container:{[$fg.variable]:"colors.white",[$bg$1.variable]:`colors.${s}.600`,_dark:{[$fg.variable]:"colors.gray.900",[$bg$1.variable]:`colors.${s}.200`},color:$fg.reference}}}),variants$3={subtle:variantSubtle,"left-accent":variantLeftAccent,"top-accent":variantTopAccent,solid:variantSolid},alertTheme=defineMultiStyleConfig$1({baseStyle:baseStyle$1,variants:variants$3,defaultProps:{variant:"subtle",colorScheme:"blue"}}),{definePartsStyle,defineMultiStyleConfig}=createMultiStyleConfigHelpers(avatarAnatomy.keys),$border=cssVar$1("avatar-border-color"),$bg=cssVar$1("avatar-bg"),$fs=cssVar$1("avatar-font-size"),$size=cssVar$1("avatar-size"),baseStyleBadge={borderRadius:"full",border:"0.2em solid",borderColor:$border.reference,[$border.variable]:"white",_dark:{[$border.variable]:"colors.gray.800"}},baseStyleExcessLabel={bg:$bg.reference,fontSize:$fs.reference,width:$size.reference,height:$size.reference,lineHeight:"1",[$bg.variable]:"colors.gray.200",_dark:{[$bg.variable]:"colors.whiteAlpha.400"}},baseStyleContainer=i=>{const{name:s,theme:o}=i,a=s?randomColor({string:s}):"colors.gray.400",rt=isDark(a)(o);let et="white";return rt||(et="gray.800"),{bg:$bg.reference,fontSize:$fs.reference,color:et,borderColor:$border.reference,verticalAlign:"top",width:$size.reference,height:$size.reference,"&:not([data-loaded])":{[$bg.variable]:a},[$border.variable]:"colors.white",_dark:{[$border.variable]:"colors.gray.800"}}},baseStyleLabel={fontSize:$fs.reference,lineHeight:"1"},baseStyle=definePartsStyle(i=>({badge:runIfFn$1(baseStyleBadge,i),excessLabel:runIfFn$1(baseStyleExcessLabel,i),container:runIfFn$1(baseStyleContainer,i),label:baseStyleLabel}));function getSize(i){const s=i!=="100%"?sizes_default[i]:void 0;return definePartsStyle({container:{[$size.variable]:s??i,[$fs.variable]:`calc(${s??i} / 2.5)`},excessLabel:{[$size.variable]:s??i,[$fs.variable]:`calc(${s??i} / 2.5)`}})}var sizes={"2xs":getSize(4),xs:getSize(6),sm:getSize(8),md:getSize(12),lg:getSize(16),xl:getSize(24),"2xl":getSize(32),full:getSize("100%")},avatarTheme=defineMultiStyleConfig({baseStyle,sizes,defaultProps:{size:"md"}}),components={Accordion:accordionTheme,Alert:alertTheme,Avatar:avatarTheme,Badge:badgeTheme,Breadcrumb:breadcrumbTheme,Button:buttonTheme,Checkbox:checkboxTheme,CloseButton:closeButtonTheme,Code:codeTheme,Container:containerTheme,Divider:dividerTheme,Drawer:drawerTheme,Editable:editableTheme,Form:formTheme,FormError:formErrorTheme,FormLabel:formLabelTheme,Heading:headingTheme,Input:inputTheme,Kbd:kbdTheme,Link:linkTheme,List:listTheme,Menu:menuTheme,Modal:modalTheme,NumberInput:numberInputTheme,PinInput:pinInputTheme,Popover:popoverTheme,Progress:progressTheme,Radio:radioTheme,Select:selectTheme,Skeleton:skeletonTheme,SkipLink:skipLinkTheme,Slider:sliderTheme,Spinner:spinnerTheme,Stat:statTheme,Switch:switchTheme,Table:tableTheme,Tabs:tabsTheme,Tag:tagTheme,Textarea:textareaTheme,Tooltip:tooltipTheme,Card:cardTheme,Stepper:stepperTheme},semanticTokens={colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-inverse-text":{_light:"white",_dark:"gray.800"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-subtle-text":{_light:"gray.600",_dark:"gray.400"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},styles={global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color"}}},direction="ltr",config$1={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},theme$1={semanticTokens,direction,...foundations,components,styles,config:config$1};function isFunction$2(i){return typeof i=="function"}function pipe$1(...i){return s=>i.reduce((o,a)=>a(o),s)}var createExtendTheme=i=>function(...o){let a=[...o],rt=o[o.length-1];return isChakraTheme(rt)&&a.length>1?a=a.slice(0,a.length-1):rt=i,pipe$1(...a.map(et=>ot=>isFunction$2(et)?et(ot):mergeThemeOverride(ot,et)))(rt)},extendTheme=createExtendTheme(theme$1);function mergeThemeOverride(...i){return mergeWith({},...i,mergeThemeCustomizer)}function mergeThemeCustomizer(i,s,o,a){if((isFunction$2(i)||isFunction$2(s))&&Object.prototype.hasOwnProperty.call(a,o))return(...rt)=>{const et=isFunction$2(i)?i(...rt):i,ot=isFunction$2(s)?s(...rt):s;return mergeWith({},et,ot,mergeThemeCustomizer)}}function canUseDOM$1(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var isBrowser$1=canUseDOM$1();function omit$1(i,s){const o={};return Object.keys(i).forEach(a=>{s.includes(a)||(o[a]=i[a])}),o}function get$2(i,s,o,a){const rt=typeof s=="string"?s.split("."):[s];for(a=0;a{const s=new WeakMap;return(a,rt,et,ot)=>{if(typeof a>"u")return i(a,rt,et);s.has(a)||s.set(a,new Map);const at=s.get(a);if(at.has(rt))return at.get(rt);const nt=i(a,rt,et,ot);return at.set(rt,nt),nt}},memoizedGet=memoize$1(get$2);function objectFilter(i,s){const o={};return Object.keys(i).forEach(a=>{const rt=i[a];s(rt,a,i)&&(o[a]=rt)}),o}var filterUndefined=i=>objectFilter(i,s=>s!=null);function isFunction$1(i){return typeof i=="function"}function runIfFn(i,...s){return isFunction$1(i)?i(...s):i}function callAllHandlers(...i){return function(o){i.some(a=>(a==null||a(o),o==null?void 0:o.defaultPrevented))}}var hasElementType=typeof Element<"u",hasMap=typeof Map=="function",hasSet=typeof Set=="function",hasArrayBuffer=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function equal$1(i,s){if(i===s)return!0;if(i&&s&&typeof i=="object"&&typeof s=="object"){if(i.constructor!==s.constructor)return!1;var o,a,rt;if(Array.isArray(i)){if(o=i.length,o!=s.length)return!1;for(a=o;a--!==0;)if(!equal$1(i[a],s[a]))return!1;return!0}var et;if(hasMap&&i instanceof Map&&s instanceof Map){if(i.size!==s.size)return!1;for(et=i.entries();!(a=et.next()).done;)if(!s.has(a.value[0]))return!1;for(et=i.entries();!(a=et.next()).done;)if(!equal$1(a.value[1],s.get(a.value[0])))return!1;return!0}if(hasSet&&i instanceof Set&&s instanceof Set){if(i.size!==s.size)return!1;for(et=i.entries();!(a=et.next()).done;)if(!s.has(a.value[0]))return!1;return!0}if(hasArrayBuffer&&ArrayBuffer.isView(i)&&ArrayBuffer.isView(s)){if(o=i.length,o!=s.length)return!1;for(a=o;a--!==0;)if(i[a]!==s[a])return!1;return!0}if(i.constructor===RegExp)return i.source===s.source&&i.flags===s.flags;if(i.valueOf!==Object.prototype.valueOf&&typeof i.valueOf=="function"&&typeof s.valueOf=="function")return i.valueOf()===s.valueOf();if(i.toString!==Object.prototype.toString&&typeof i.toString=="function"&&typeof s.toString=="function")return i.toString()===s.toString();if(rt=Object.keys(i),o=rt.length,o!==Object.keys(s).length)return!1;for(a=o;a--!==0;)if(!Object.prototype.hasOwnProperty.call(s,rt[a]))return!1;if(hasElementType&&i instanceof Element)return!1;for(a=o;a--!==0;)if(!((rt[a]==="_owner"||rt[a]==="__v"||rt[a]==="__o")&&i.$$typeof)&&!equal$1(i[rt[a]],s[rt[a]]))return!1;return!0}return i!==i&&s!==s}var reactFastCompare=function(s,o){try{return equal$1(s,o)}catch(a){if((a.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw a}};const isEqual$2=getDefaultExportFromCjs(reactFastCompare);function useStyleConfigImpl(i,s={}){var o;const{styleConfig:a,...rt}=s,{theme:et,colorMode:ot}=useChakra(),at=i?memoizedGet(et,`components.${i}`):void 0,nt=a||at,it=mergeWith({theme:et,colorMode:ot},(o=nt==null?void 0:nt.defaultProps)!=null?o:{},filterUndefined(omit$1(rt,["children"]))),j=reactExports.useRef({});if(nt){const $=resolveStyleConfig(nt)(it);isEqual$2(j.current,$)||(j.current=$)}return j.current}function useStyleConfig(i,s={}){return useStyleConfigImpl(i,s)}function useMultiStyleConfig(i,s={}){return useStyleConfigImpl(i,s)}var allPropNames=new Set([...propNames,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),validHTMLProps=new Set(["htmlWidth","htmlHeight","htmlSize","htmlTranslate"]);function shouldForwardProp(i){return validHTMLProps.has(i)||!allPropNames.has(i)}function assignAfter(i,...s){if(i==null)throw new TypeError("Cannot convert undefined or null to object");const o={...i};for(const a of s)if(a!=null)for(const rt in a)Object.prototype.hasOwnProperty.call(a,rt)&&(rt in o&&delete o[rt],o[rt]=a[rt]);return o}function compact(i){const s=Object.assign({},i);for(let o in s)s[o]===void 0&&delete s[o];return s}var reactPropsRegex=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,isPropValid=memoize$3(function(i){return reactPropsRegex.test(i)||i.charCodeAt(0)===111&&i.charCodeAt(1)===110&&i.charCodeAt(2)<91}),testOmitPropsOnStringTag=isPropValid,testOmitPropsOnComponent=function(s){return s!=="theme"},getDefaultShouldForwardProp=function(s){return typeof s=="string"&&s.charCodeAt(0)>96?testOmitPropsOnStringTag:testOmitPropsOnComponent},composeShouldForwardProps=function(s,o,a){var rt;if(o){var et=o.shouldForwardProp;rt=s.__emotion_forwardProp&&et?function(ot){return s.__emotion_forwardProp(ot)&&et(ot)}:et}return typeof rt!="function"&&a&&(rt=s.__emotion_forwardProp),rt},isDevelopment=!1,Insertion=function(s){var o=s.cache,a=s.serialized,rt=s.isStringTag;return registerStyles(o,a,rt),useInsertionEffectAlwaysWithSyncFallback(function(){return insertStyles(o,a,rt)}),null},createStyled=function i(s,o){var a=s.__emotion_real===s,rt=a&&s.__emotion_base||s,et,ot;o!==void 0&&(et=o.label,ot=o.target);var at=composeShouldForwardProps(s,o,a),nt=at||getDefaultShouldForwardProp(rt),it=!nt("as");return function(){var j=arguments,_=a&&s.__emotion_styles!==void 0?s.__emotion_styles.slice(0):[];if(et!==void 0&&_.push("label:"+et+";"),j[0]==null||j[0].raw===void 0)_.push.apply(_,j);else{_.push(j[0][0]);for(var $=j.length,tt=1;tt<$;tt++)_.push(j[tt],j[0][tt])}var st=withEmotionCache(function(lt,ct,ht){var ut=it&<.as||rt,pt="",mt=[],gt=lt;if(lt.theme==null){gt={};for(var dt in lt)gt[dt]=lt[dt];gt.theme=reactExports.useContext(ThemeContext)}typeof lt.className=="string"?pt=getRegisteredStyles(ct.registered,mt,lt.className):lt.className!=null&&(pt=lt.className+" ");var St=serializeStyles(_.concat(mt),ct.registered,gt);pt+=ct.key+"-"+St.name,ot!==void 0&&(pt+=" "+ot);var xt=it&&at===void 0?getDefaultShouldForwardProp(ut):nt,yt={};for(var _t in lt)it&&_t==="as"||xt(_t)&&(yt[_t]=lt[_t]);return yt.className=pt,ht&&(yt.ref=ht),reactExports.createElement(reactExports.Fragment,null,reactExports.createElement(Insertion,{cache:ct,serialized:St,isStringTag:typeof ut=="string"}),reactExports.createElement(ut,yt))});return st.displayName=et!==void 0?et:"Styled("+(typeof rt=="string"?rt:rt.displayName||rt.name||"Component")+")",st.defaultProps=s.defaultProps,st.__emotion_real=st,st.__emotion_base=rt,st.__emotion_styles=_,st.__emotion_forwardProp=at,Object.defineProperty(st,"toString",{value:function(){return ot===void 0&&isDevelopment?"NO_COMPONENT_SELECTOR":"."+ot}}),st.withComponent=function(lt,ct){return i(lt,_extends$1({},o,ct,{shouldForwardProp:composeShouldForwardProps(st,ct,!0)})).apply(void 0,_)},st}},tags=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],newStyled=createStyled.bind();tags.forEach(function(i){newStyled[i]=newStyled(i)});var _a$1,emotion_styled=(_a$1=newStyled.default)!=null?_a$1:newStyled,toCSSObject=({baseStyle:i})=>s=>{const{theme:o,css:a,__css:rt,sx:et,...ot}=s,at=objectFilter(ot,(_,$)=>isStyleProp($)),nt=runIfFn(i,s),it=assignAfter({},rt,nt,filterUndefined(at),et),j=css(it)(s.theme);return a?[j,a]:j};function styled(i,s){const{baseStyle:o,...a}=s??{};a.shouldForwardProp||(a.shouldForwardProp=shouldForwardProp);const rt=toCSSObject({baseStyle:o}),et=emotion_styled(i,a)(rt);return React$4.forwardRef(function(nt,it){const{colorMode:j,forced:_}=useColorMode();return React$4.createElement(et,{ref:it,"data-theme":_?j:void 0,...nt})})}function factory(){const i=new Map;return new Proxy(styled,{apply(s,o,a){return styled(...a)},get(s,o){return i.has(o)||i.set(o,styled(o)),i.get(o)}})}var chakra=factory();function forwardRef(i){return reactExports.forwardRef(i)}function createContext$1(i={}){const{strict:s=!0,errorMessage:o="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:a}=i,rt=reactExports.createContext(void 0);rt.displayName=a;function et(){var ot;const at=reactExports.useContext(rt);if(!at&&s){const nt=new Error(o);throw nt.name="ContextError",(ot=Error.captureStackTrace)==null||ot.call(Error,nt,et),nt}return at}return[rt.Provider,et,rt]}function ThemeProvider(i){const{cssVarsRoot:s,theme:o,children:a}=i,rt=reactExports.useMemo(()=>toCSSVar(o),[o]);return jsxRuntimeExports.jsxs(ThemeProvider$1,{theme:rt,children:[jsxRuntimeExports.jsx(CSSVars,{root:s}),a]})}function CSSVars({root:i=":host, :root"}){const s=[i,"[data-theme]"].join(",");return jsxRuntimeExports.jsx(Global,{styles:o=>({[s]:o.__cssVars})})}createContext$1({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `` "});function createStylesContext(i){return createContext$1({name:`${i}StylesContext`,errorMessage:`useStyles: "styles" is undefined. Seems you forgot to wrap the components in "<${i} />" `})}function GlobalStyle(){const{colorMode:i}=useColorMode();return jsxRuntimeExports.jsx(Global,{styles:s=>{const o=memoizedGet(s,"styles.global"),a=runIfFn(o,{theme:s,colorMode:i});return a?css(a)(s):void 0}})}var EnvironmentContext=reactExports.createContext({getDocument(){return document},getWindow(){return window}});EnvironmentContext.displayName="EnvironmentContext";function EnvironmentProvider(i){const{children:s,environment:o,disabled:a}=i,rt=reactExports.useRef(null),et=reactExports.useMemo(()=>o||{getDocument:()=>{var at,nt;return(nt=(at=rt.current)==null?void 0:at.ownerDocument)!=null?nt:document},getWindow:()=>{var at,nt;return(nt=(at=rt.current)==null?void 0:at.ownerDocument.defaultView)!=null?nt:window}},[o]),ot=!a||!o;return jsxRuntimeExports.jsxs(EnvironmentContext.Provider,{value:et,children:[s,ot&&jsxRuntimeExports.jsx("span",{id:"__chakra_env",hidden:!0,ref:rt})]})}EnvironmentProvider.displayName="EnvironmentProvider";var ChakraProvider$1=i=>{const{children:s,colorModeManager:o,portalZIndex:a,resetScope:rt,resetCSS:et=!0,theme:ot={},environment:at,cssVarsRoot:nt,disableEnvironment:it,disableGlobalStyle:j}=i,_=jsxRuntimeExports.jsx(EnvironmentProvider,{environment:at,disabled:it,children:s});return jsxRuntimeExports.jsx(ThemeProvider,{theme:ot,cssVarsRoot:nt,children:jsxRuntimeExports.jsxs(ColorModeProvider,{colorModeManager:o,options:ot.config,children:[et?jsxRuntimeExports.jsx(CSSReset,{scope:rt}):jsxRuntimeExports.jsx(CSSPolyfill,{}),!j&&jsxRuntimeExports.jsx(GlobalStyle,{}),a?jsxRuntimeExports.jsx(PortalManager,{zIndex:a,children:_}):_]})})},findById=(i,s)=>i.find(o=>o.id===s);function findToast(i,s){const o=getToastPosition(i,s),a=o?i[o].findIndex(rt=>rt.id===s):-1;return{position:o,index:a}}function getToastPosition(i,s){for(const[o,a]of Object.entries(i))if(findById(a,s))return o}function getToastStyle(i){const s=i.includes("right"),o=i.includes("left");let a="center";return s&&(a="flex-end"),o&&(a="flex-start"),{display:"flex",flexDirection:"column",alignItems:a}}function getToastListStyle(i){const o=i==="top"||i==="bottom"?"0 auto":void 0,a=i.includes("top")?"env(safe-area-inset-top, 0px)":void 0,rt=i.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,et=i.includes("left")?void 0:"env(safe-area-inset-right, 0px)",ot=i.includes("right")?void 0:"env(safe-area-inset-left, 0px)";return{position:"fixed",zIndex:"var(--toast-z-index, 5500)",pointerEvents:"none",display:"flex",flexDirection:"column",margin:o,top:a,bottom:rt,right:et,left:ot}}function useCallbackRef$2(i,s=[]){const o=reactExports.useRef(i);return reactExports.useEffect(()=>{o.current=i}),reactExports.useCallback((...a)=>{var rt;return(rt=o.current)==null?void 0:rt.call(o,...a)},s)}function useTimeout(i,s){const o=useCallbackRef$2(i);reactExports.useEffect(()=>{if(s==null)return;let a=null;return a=window.setTimeout(()=>{o()},s),()=>{a&&window.clearTimeout(a)}},[s,o])}function useUpdateEffect(i,s){const o=reactExports.useRef(!1),a=reactExports.useRef(!1);reactExports.useEffect(()=>{if(o.current&&a.current)return i();a.current=!0},s),reactExports.useEffect(()=>(o.current=!0,()=>{o.current=!1}),[])}const MotionConfigContext=reactExports.createContext({transformPagePoint:i=>i,isStatic:!1,reducedMotion:"never"}),MotionContext=reactExports.createContext({}),PresenceContext=reactExports.createContext(null),isBrowser=typeof window<"u",useIsomorphicLayoutEffect$1=isBrowser?reactExports.useLayoutEffect:reactExports.useEffect,LazyContext=reactExports.createContext({strict:!1}),camelToDash=i=>i.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),optimizedAppearDataId="framerAppearId",optimizedAppearDataAttribute="data-"+camelToDash(optimizedAppearDataId),MotionGlobalConfig={skipAnimations:!1,useManualTiming:!1};function createRenderStep(i){let s=new Set,o=new Set,a=!1,rt=!1;const et=new WeakSet;let ot={delta:0,timestamp:0,isProcessing:!1};function at(it){et.has(it)&&(nt.schedule(it),i()),it(ot)}const nt={schedule:(it,j=!1,_=!1)=>{const tt=_&&a?s:o;return j&&et.add(it),tt.has(it)||tt.add(it),it},cancel:it=>{o.delete(it),et.delete(it)},process:it=>{if(ot=it,a){rt=!0;return}a=!0,[s,o]=[o,s],o.clear(),s.forEach(at),a=!1,rt&&(rt=!1,nt.process(it))}};return nt}const stepsOrder=["read","resolveKeyframes","update","preRender","render","postRender"],maxElapsed=40;function createRenderBatcher(i,s){let o=!1,a=!0;const rt={delta:0,timestamp:0,isProcessing:!1},et=()=>o=!0,ot=stepsOrder.reduce((ht,ut)=>(ht[ut]=createRenderStep(et),ht),{}),{read:at,resolveKeyframes:nt,update:it,preRender:j,render:_,postRender:$}=ot,tt=()=>{const ht=performance.now();o=!1,rt.delta=a?1e3/60:Math.max(Math.min(ht-rt.timestamp,maxElapsed),1),rt.timestamp=ht,rt.isProcessing=!0,at.process(rt),nt.process(rt),it.process(rt),j.process(rt),_.process(rt),$.process(rt),rt.isProcessing=!1,o&&s&&(a=!1,i(tt))},st=()=>{o=!0,a=!0,rt.isProcessing||i(tt)};return{schedule:stepsOrder.reduce((ht,ut)=>{const pt=ot[ut];return ht[ut]=(mt,gt=!1,dt=!1)=>(o||st(),pt.schedule(mt,gt,dt)),ht},{}),cancel:ht=>{for(let ut=0;ut{_&&_.update(o,nt)});const tt=o[optimizedAppearDataAttribute],st=reactExports.useRef(!!tt&&!window.MotionHandoffIsComplete&&((et=window.MotionHasOptimisedAnimation)===null||et===void 0?void 0:et.call(window,tt)));return useIsomorphicLayoutEffect$1(()=>{_&&(_.updateFeatures(),microtask.render(_.render),st.current&&_.animationState&&_.animationState.animateChanges())}),reactExports.useEffect(()=>{_&&(!st.current&&_.animationState&&_.animationState.animateChanges(),st.current=!1,scheduleHandoffComplete||(scheduleHandoffComplete=!0,queueMicrotask(completeHandoff)))}),_}function completeHandoff(){window.MotionHandoffIsComplete=!0}function createProjectionNode$1(i,s,o,a){const{layoutId:rt,layout:et,drag:ot,dragConstraints:at,layoutScroll:nt,layoutRoot:it}=s;i.projection=new o(i.latestValues,s["data-framer-portal-id"]?void 0:getClosestProjectingNode(i.parent)),i.projection.setOptions({layoutId:rt,layout:et,alwaysMeasureLayout:!!ot||at&&isRefObject(at),visualElement:i,animationType:typeof et=="string"?et:"both",initialPromotionConfig:a,layoutScroll:nt,layoutRoot:it})}function getClosestProjectingNode(i){if(i)return i.options.allowProjection!==!1?i.projection:getClosestProjectingNode(i.parent)}function useMotionRef(i,s,o){return reactExports.useCallback(a=>{a&&i.mount&&i.mount(a),s&&(a?s.mount(a):s.unmount()),o&&(typeof o=="function"?o(a):isRefObject(o)&&(o.current=a))},[s])}function isVariantLabel(i){return typeof i=="string"||Array.isArray(i)}function isAnimationControls(i){return i!==null&&typeof i=="object"&&typeof i.start=="function"}const variantPriorityOrder=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],variantProps=["initial",...variantPriorityOrder];function isControllingVariants(i){return isAnimationControls(i.animate)||variantProps.some(s=>isVariantLabel(i[s]))}function isVariantNode(i){return!!(isControllingVariants(i)||i.variants)}function getCurrentTreeVariants(i,s){if(isControllingVariants(i)){const{initial:o,animate:a}=i;return{initial:o===!1||isVariantLabel(o)?o:void 0,animate:isVariantLabel(a)?a:void 0}}return i.inherit!==!1?s:{}}function useCreateMotionContext(i){const{initial:s,animate:o}=getCurrentTreeVariants(i,reactExports.useContext(MotionContext));return reactExports.useMemo(()=>({initial:s,animate:o}),[variantLabelsAsDependency(s),variantLabelsAsDependency(o)])}function variantLabelsAsDependency(i){return Array.isArray(i)?i.join(" "):i}const featureProps={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},featureDefinitions={};for(const i in featureProps)featureDefinitions[i]={isEnabled:s=>featureProps[i].some(o=>!!s[o])};function loadFeatures(i){for(const s in i)featureDefinitions[s]={...featureDefinitions[s],...i[s]}}const LayoutGroupContext=reactExports.createContext({}),motionComponentSymbol=Symbol.for("motionComponentSymbol"),noop$1=i=>i;let invariant=noop$1;function createMotionComponent({preloadedFeatures:i,createVisualElement:s,useRender:o,useVisualState:a,Component:rt}){i&&loadFeatures(i);function et(at,nt){let it;const j={...reactExports.useContext(MotionConfigContext),...at,layoutId:useLayoutId(at)},{isStatic:_}=j,$=useCreateMotionContext(at),tt=a(at,_);if(!_&&isBrowser){useStrictMode();const st=getProjectionFunctionality(j);it=st.MeasureLayout,$.visualElement=useVisualElement(rt,tt,j,s,st.ProjectionNode)}return jsxRuntimeExports.jsxs(MotionContext.Provider,{value:$,children:[it&&$.visualElement?jsxRuntimeExports.jsx(it,{visualElement:$.visualElement,...j}):null,o(rt,at,useMotionRef(tt,$.visualElement,nt),tt,_,$.visualElement)]})}const ot=reactExports.forwardRef(et);return ot[motionComponentSymbol]=rt,ot}function useLayoutId({layoutId:i}){const s=reactExports.useContext(LayoutGroupContext).id;return s&&i!==void 0?s+"-"+i:i}function useStrictMode(i,s){reactExports.useContext(LazyContext).strict}function getProjectionFunctionality(i){const{drag:s,layout:o}=featureDefinitions;if(!s&&!o)return{};const a={...s,...o};return{MeasureLayout:s!=null&&s.isEnabled(i)||o!=null&&o.isEnabled(i)?a.MeasureLayout:void 0,ProjectionNode:a.ProjectionNode}}function createMotionProxy(i){function s(a,rt={}){return createMotionComponent(i(a,rt))}if(typeof Proxy>"u")return s;const o=new Map;return new Proxy(s,{get:(a,rt)=>(o.has(rt)||o.set(rt,s(rt)),o.get(rt))})}const lowercaseSVGElements=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function isSVGComponent(i){return typeof i!="string"||i.includes("-")?!1:!!(lowercaseSVGElements.indexOf(i)>-1||/[A-Z]/u.test(i))}const scaleCorrectors={};function addScaleCorrector(i){Object.assign(scaleCorrectors,i)}const transformPropOrder=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],transformProps=new Set(transformPropOrder);function isForcedMotionValue(i,{layout:s,layoutId:o}){return transformProps.has(i)||i.startsWith("origin")||(s||o!==void 0)&&(!!scaleCorrectors[i]||i==="opacity")}const isMotionValue=i=>!!(i&&i.getVelocity),getValueAsType=(i,s)=>s&&typeof i=="number"?s.transform(i):i,clamp=(i,s,o)=>o>s?s:otypeof i=="number",parse:parseFloat,transform:i=>i},alpha={...number,transform:i=>clamp(0,1,i)},scale={...number,default:1},sanitize=i=>Math.round(i*1e5)/1e5,floatRegex=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,colorRegex=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,singleColorRegex=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function isString$1(i){return typeof i=="string"}function isNullish(i){return i==null}const createUnitType=i=>({test:s=>isString$1(s)&&s.endsWith(i)&&s.split(" ").length===1,parse:parseFloat,transform:s=>`${s}${i}`}),degrees=createUnitType("deg"),percent=createUnitType("%"),px=createUnitType("px"),vh=createUnitType("vh"),vw=createUnitType("vw"),progressPercentage={...percent,parse:i=>percent.parse(i)/100,transform:i=>percent.transform(i*100)},int={...number,transform:Math.round},numberValueTypes={borderWidth:px,borderTopWidth:px,borderRightWidth:px,borderBottomWidth:px,borderLeftWidth:px,borderRadius:px,radius:px,borderTopLeftRadius:px,borderTopRightRadius:px,borderBottomRightRadius:px,borderBottomLeftRadius:px,width:px,maxWidth:px,height:px,maxHeight:px,size:px,top:px,right:px,bottom:px,left:px,padding:px,paddingTop:px,paddingRight:px,paddingBottom:px,paddingLeft:px,margin:px,marginTop:px,marginRight:px,marginBottom:px,marginLeft:px,rotate:degrees,rotateX:degrees,rotateY:degrees,rotateZ:degrees,scale,scaleX:scale,scaleY:scale,scaleZ:scale,skew:degrees,skewX:degrees,skewY:degrees,distance:px,translateX:px,translateY:px,translateZ:px,x:px,y:px,z:px,perspective:px,transformPerspective:px,opacity:alpha,originX:progressPercentage,originY:progressPercentage,originZ:px,zIndex:int,backgroundPositionX:px,backgroundPositionY:px,fillOpacity:alpha,strokeOpacity:alpha,numOctaves:int},translateAlias={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},numTransforms=transformPropOrder.length;function buildTransform(i,s,o){let a="",rt=!0;for(let et=0;ets=>typeof s=="string"&&s.startsWith(i),isCSSVariableName=checkStringStartsWith("--"),startsAsVariableToken=checkStringStartsWith("var(--"),isCSSVariableToken=i=>startsAsVariableToken(i)?singleCssVariableRegex.test(i.split("/*")[0].trim()):!1,singleCssVariableRegex=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function buildHTMLStyles(i,s,o){const{style:a,vars:rt,transformOrigin:et}=i;let ot=!1,at=!1;for(const nt in s){const it=s[nt];if(transformProps.has(nt)){ot=!0;continue}else if(isCSSVariableName(nt)){rt[nt]=it;continue}else{const j=getValueAsType(it,numberValueTypes[nt]);nt.startsWith("origin")?(at=!0,et[nt]=j):a[nt]=j}}if(s.transform||(ot||o?a.transform=buildTransform(s,i.transform,o):a.transform&&(a.transform="none")),at){const{originX:nt="50%",originY:it="50%",originZ:j=0}=et;a.transformOrigin=`${nt} ${it} ${j}`}}const createHtmlRenderState=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function copyRawValuesOnly(i,s,o){for(const a in s)!isMotionValue(s[a])&&!isForcedMotionValue(a,o)&&(i[a]=s[a])}function useInitialMotionValues({transformTemplate:i},s){return reactExports.useMemo(()=>{const o=createHtmlRenderState();return buildHTMLStyles(o,s,i),Object.assign({},o.vars,o.style)},[s])}function useStyle(i,s){const o=i.style||{},a={};return copyRawValuesOnly(a,o,i),Object.assign(a,useInitialMotionValues(i,s)),a}function useHTMLProps(i,s){const o={},a=useStyle(i,s);return i.drag&&i.dragListener!==!1&&(o.draggable=!1,a.userSelect=a.WebkitUserSelect=a.WebkitTouchCallout="none",a.touchAction=i.drag===!0?"none":`pan-${i.drag==="x"?"y":"x"}`),i.tabIndex===void 0&&(i.onTap||i.onTapStart||i.whileTap)&&(o.tabIndex=0),o.style=a,o}const validMotionProps=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function isValidMotionProp(i){return i.startsWith("while")||i.startsWith("drag")&&i!=="draggable"||i.startsWith("layout")||i.startsWith("onTap")||i.startsWith("onPan")||i.startsWith("onLayout")||validMotionProps.has(i)}let shouldForward=i=>!isValidMotionProp(i);function loadExternalIsValidProp(i){i&&(shouldForward=s=>s.startsWith("on")?!isValidMotionProp(s):i(s))}try{loadExternalIsValidProp(require("@emotion/is-prop-valid").default)}catch{}function filterProps(i,s,o){const a={};for(const rt in i)rt==="values"&&typeof i.values=="object"||(shouldForward(rt)||o===!0&&isValidMotionProp(rt)||!s&&!isValidMotionProp(rt)||i.draggable&&rt.startsWith("onDrag"))&&(a[rt]=i[rt]);return a}function calcOrigin$1(i,s,o){return typeof i=="string"?i:px.transform(s+o*i)}function calcSVGTransformOrigin(i,s,o){const a=calcOrigin$1(s,i.x,i.width),rt=calcOrigin$1(o,i.y,i.height);return`${a} ${rt}`}const dashKeys={offset:"stroke-dashoffset",array:"stroke-dasharray"},camelKeys={offset:"strokeDashoffset",array:"strokeDasharray"};function buildSVGPath(i,s,o=1,a=0,rt=!0){i.pathLength=1;const et=rt?dashKeys:camelKeys;i[et.offset]=px.transform(-a);const ot=px.transform(s),at=px.transform(o);i[et.array]=`${ot} ${at}`}function buildSVGAttrs(i,{attrX:s,attrY:o,attrScale:a,originX:rt,originY:et,pathLength:ot,pathSpacing:at=1,pathOffset:nt=0,...it},j,_){if(buildHTMLStyles(i,it,_),j){i.style.viewBox&&(i.attrs.viewBox=i.style.viewBox);return}i.attrs=i.style,i.style={};const{attrs:$,style:tt,dimensions:st}=i;$.transform&&(st&&(tt.transform=$.transform),delete $.transform),st&&(rt!==void 0||et!==void 0||tt.transform)&&(tt.transformOrigin=calcSVGTransformOrigin(st,rt!==void 0?rt:.5,et!==void 0?et:.5)),s!==void 0&&($.x=s),o!==void 0&&($.y=o),a!==void 0&&($.scale=a),ot!==void 0&&buildSVGPath($,ot,at,nt,!1)}const createSvgRenderState=()=>({...createHtmlRenderState(),attrs:{}}),isSVGTag=i=>typeof i=="string"&&i.toLowerCase()==="svg";function useSVGProps(i,s,o,a){const rt=reactExports.useMemo(()=>{const et=createSvgRenderState();return buildSVGAttrs(et,s,isSVGTag(a),i.transformTemplate),{...et.attrs,style:{...et.style}}},[s]);if(i.style){const et={};copyRawValuesOnly(et,i.style,i),rt.style={...et,...rt.style}}return rt}function createUseRender(i=!1){return(o,a,rt,{latestValues:et},ot)=>{const nt=(isSVGComponent(o)?useSVGProps:useHTMLProps)(a,et,ot,o),it=filterProps(a,typeof o=="string",i),j=o!==reactExports.Fragment?{...it,...nt,ref:rt}:{},{children:_}=a,$=reactExports.useMemo(()=>isMotionValue(_)?_.get():_,[_]);return reactExports.createElement(o,{...j,children:$})}}function renderHTML(i,{style:s,vars:o},a,rt){Object.assign(i.style,s,rt&&rt.getProjectionStyles(a));for(const et in o)i.style.setProperty(et,o[et])}const camelCaseAttributes=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function renderSVG(i,s,o,a){renderHTML(i,s,void 0,a);for(const rt in s.attrs)i.setAttribute(camelCaseAttributes.has(rt)?rt:camelToDash(rt),s.attrs[rt])}function scrapeMotionValuesFromProps$1(i,s,o){var a;const{style:rt}=i,et={};for(const ot in rt)(isMotionValue(rt[ot])||s.style&&isMotionValue(s.style[ot])||isForcedMotionValue(ot,i)||((a=o==null?void 0:o.getValue(ot))===null||a===void 0?void 0:a.liveStyle)!==void 0)&&(et[ot]=rt[ot]);return o&&rt&&typeof rt.willChange=="string"&&(o.applyWillChange=!1),et}function scrapeMotionValuesFromProps(i,s,o){const a=scrapeMotionValuesFromProps$1(i,s,o);for(const rt in i)if(isMotionValue(i[rt])||isMotionValue(s[rt])){const et=transformPropOrder.indexOf(rt)!==-1?"attr"+rt.charAt(0).toUpperCase()+rt.substring(1):rt;a[et]=i[rt]}return a}function getValueState(i){const s=[{},{}];return i==null||i.values.forEach((o,a)=>{s[0][a]=o.get(),s[1][a]=o.getVelocity()}),s}function resolveVariantFromProps(i,s,o,a){if(typeof s=="function"){const[rt,et]=getValueState(a);s=s(o!==void 0?o:i.custom,rt,et)}if(typeof s=="string"&&(s=i.variants&&i.variants[s]),typeof s=="function"){const[rt,et]=getValueState(a);s=s(o!==void 0?o:i.custom,rt,et)}return s}function useConstant(i){const s=reactExports.useRef(null);return s.current===null&&(s.current=i()),s.current}const isKeyframesTarget=i=>Array.isArray(i),isCustomValue=i=>!!(i&&typeof i=="object"&&i.mix&&i.toValue),resolveFinalValueInKeyframes=i=>isKeyframesTarget(i)?i[i.length-1]||0:i;function resolveMotionValue(i){const s=isMotionValue(i)?i.get():i;return isCustomValue(s)?s.toValue():s}const acceleratedValues=new Set(["opacity","clipPath","filter","transform"]);function getWillChangeName(i){if(transformProps.has(i))return"transform";if(acceleratedValues.has(i))return camelToDash(i)}function addUniqueItem(i,s){i.indexOf(s)===-1&&i.push(s)}function removeItem(i,s){const o=i.indexOf(s);o>-1&&i.splice(o,1)}function makeState({applyWillChange:i=!1,scrapeMotionValuesFromProps:s,createRenderState:o,onMount:a},rt,et,ot,at){const nt={latestValues:makeLatestValues(rt,et,ot,at?!1:i,s),renderState:o()};return a&&(nt.mount=it=>a(rt,it,nt)),nt}const makeUseVisualState=i=>(s,o)=>{const a=reactExports.useContext(MotionContext),rt=reactExports.useContext(PresenceContext),et=()=>makeState(i,s,a,rt,o);return o?et():useConstant(et)};function addWillChange(i,s){const o=getWillChangeName(s);o&&addUniqueItem(i,o)}function forEachDefinition(i,s,o){const a=Array.isArray(s)?s:[s];for(let rt=0;rt{for(const ut in ct){let pt=ct[ut];if(Array.isArray(pt)){const mt=st?pt.length-1:0;pt=pt[mt]}pt!==null&&(ot[ut]=pt)}for(const ut in ht)ot[ut]=ht[ut]}),nt&&(_&&j!==!1&&!isAnimationControls(_)&&forEachDefinition(i,_,ct=>{for(const ht in ct)addWillChange(at,ht)}),at.length&&(ot.willChange=at.join(","))),ot}const{schedule:frame,cancel:cancelFrame,state:frameData,steps}=createRenderBatcher(typeof requestAnimationFrame<"u"?requestAnimationFrame:noop$1,!0),svgMotionConfig={useVisualState:makeUseVisualState({scrapeMotionValuesFromProps,createRenderState:createSvgRenderState,onMount:(i,s,{renderState:o,latestValues:a})=>{frame.read(()=>{try{o.dimensions=typeof s.getBBox=="function"?s.getBBox():s.getBoundingClientRect()}catch{o.dimensions={x:0,y:0,width:0,height:0}}}),frame.render(()=>{buildSVGAttrs(o,a,isSVGTag(s.tagName),i.transformTemplate),renderSVG(s,o)})}})},htmlMotionConfig={useVisualState:makeUseVisualState({applyWillChange:!0,scrapeMotionValuesFromProps:scrapeMotionValuesFromProps$1,createRenderState:createHtmlRenderState})};function createDomMotionConfig(i,{forwardMotionProps:s=!1},o,a){return{...isSVGComponent(i)?svgMotionConfig:htmlMotionConfig,preloadedFeatures:o,useRender:createUseRender(s),createVisualElement:a,Component:i}}function addDomEvent(i,s,o,a={passive:!0}){return i.addEventListener(s,o,a),()=>i.removeEventListener(s,o)}const isPrimaryPointer=i=>i.pointerType==="mouse"?typeof i.button!="number"||i.button<=0:i.isPrimary!==!1;function extractEventInfo(i,s="page"){return{point:{x:i[`${s}X`],y:i[`${s}Y`]}}}const addPointerInfo=i=>s=>isPrimaryPointer(s)&&i(s,extractEventInfo(s));function addPointerEvent(i,s,o,a){return addDomEvent(i,s,addPointerInfo(o),a)}const combineFunctions=(i,s)=>o=>s(i(o)),pipe=(...i)=>i.reduce(combineFunctions);function createLock(i){let s=null;return()=>{const o=()=>{s=null};return s===null?(s=i,o):!1}}const globalHorizontalLock=createLock("dragHorizontal"),globalVerticalLock=createLock("dragVertical");function getGlobalLock(i){let s=!1;if(i==="y")s=globalVerticalLock();else if(i==="x")s=globalHorizontalLock();else{const o=globalHorizontalLock(),a=globalVerticalLock();o&&a?s=()=>{o(),a()}:(o&&o(),a&&a())}return s}function isDragActive(){const i=getGlobalLock(!0);return i?(i(),!1):!0}class Feature{constructor(s){this.isMounted=!1,this.node=s}update(){}}function addHoverEvent(i,s){const o=s?"pointerenter":"pointerleave",a=s?"onHoverStart":"onHoverEnd",rt=(et,ot)=>{if(et.pointerType==="touch"||isDragActive())return;const at=i.getProps();i.animationState&&at.whileHover&&i.animationState.setActive("whileHover",s);const nt=at[a];nt&&frame.postRender(()=>nt(et,ot))};return addPointerEvent(i.current,o,rt,{passive:!i.getProps()[a]})}class HoverGesture extends Feature{mount(){this.unmount=pipe(addHoverEvent(this.node,!0),addHoverEvent(this.node,!1))}unmount(){}}class FocusGesture extends Feature{constructor(){super(...arguments),this.isActive=!1}onFocus(){let s=!1;try{s=this.node.current.matches(":focus-visible")}catch{s=!0}!s||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=pipe(addDomEvent(this.node.current,"focus",()=>this.onFocus()),addDomEvent(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const isNodeOrChild=(i,s)=>s?i===s?!0:isNodeOrChild(i,s.parentElement):!1;function fireSyntheticPointerEvent(i,s){if(!s)return;const o=new PointerEvent("pointer"+i);s(o,extractEventInfo(o))}class PressGesture extends Feature{constructor(){super(...arguments),this.removeStartListeners=noop$1,this.removeEndListeners=noop$1,this.removeAccessibleListeners=noop$1,this.startPointerPress=(s,o)=>{if(this.isPressing)return;this.removeEndListeners();const a=this.node.getProps(),et=addPointerEvent(window,"pointerup",(at,nt)=>{if(!this.checkPressEnd())return;const{onTap:it,onTapCancel:j,globalTapTarget:_}=this.node.getProps(),$=!_&&!isNodeOrChild(this.node.current,at.target)?j:it;$&&frame.update(()=>$(at,nt))},{passive:!(a.onTap||a.onPointerUp)}),ot=addPointerEvent(window,"pointercancel",(at,nt)=>this.cancelPress(at,nt),{passive:!(a.onTapCancel||a.onPointerCancel)});this.removeEndListeners=pipe(et,ot),this.startPress(s,o)},this.startAccessiblePress=()=>{const s=et=>{if(et.key!=="Enter"||this.isPressing)return;const ot=at=>{at.key!=="Enter"||!this.checkPressEnd()||fireSyntheticPointerEvent("up",(nt,it)=>{const{onTap:j}=this.node.getProps();j&&frame.postRender(()=>j(nt,it))})};this.removeEndListeners(),this.removeEndListeners=addDomEvent(this.node.current,"keyup",ot),fireSyntheticPointerEvent("down",(at,nt)=>{this.startPress(at,nt)})},o=addDomEvent(this.node.current,"keydown",s),a=()=>{this.isPressing&&fireSyntheticPointerEvent("cancel",(et,ot)=>this.cancelPress(et,ot))},rt=addDomEvent(this.node.current,"blur",a);this.removeAccessibleListeners=pipe(o,rt)}}startPress(s,o){this.isPressing=!0;const{onTapStart:a,whileTap:rt}=this.node.getProps();rt&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),a&&frame.postRender(()=>a(s,o))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!isDragActive()}cancelPress(s,o){if(!this.checkPressEnd())return;const{onTapCancel:a}=this.node.getProps();a&&frame.postRender(()=>a(s,o))}mount(){const s=this.node.getProps(),o=addPointerEvent(s.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(s.onTapStart||s.onPointerStart)}),a=addDomEvent(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=pipe(o,a)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const observerCallbacks=new WeakMap,observers=new WeakMap,fireObserverCallback=i=>{const s=observerCallbacks.get(i.target);s&&s(i)},fireAllObserverCallbacks=i=>{i.forEach(fireObserverCallback)};function initIntersectionObserver({root:i,...s}){const o=i||document;observers.has(o)||observers.set(o,{});const a=observers.get(o),rt=JSON.stringify(s);return a[rt]||(a[rt]=new IntersectionObserver(fireAllObserverCallbacks,{root:i,...s})),a[rt]}function observeIntersection(i,s,o){const a=initIntersectionObserver(s);return observerCallbacks.set(i,o),a.observe(i),()=>{observerCallbacks.delete(i),a.unobserve(i)}}const thresholdNames={some:0,all:1};class InViewFeature extends Feature{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:s={}}=this.node.getProps(),{root:o,margin:a,amount:rt="some",once:et}=s,ot={root:o?o.current:void 0,rootMargin:a,threshold:typeof rt=="number"?rt:thresholdNames[rt]},at=nt=>{const{isIntersecting:it}=nt;if(this.isInView===it||(this.isInView=it,et&&!it&&this.hasEnteredView))return;it&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",it);const{onViewportEnter:j,onViewportLeave:_}=this.node.getProps(),$=it?j:_;$&&$(nt)};return observeIntersection(this.node.current,ot,at)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:s,prevProps:o}=this.node;["amount","margin","root"].some(hasViewportOptionChanged(s,o))&&this.startObserver()}unmount(){}}function hasViewportOptionChanged({viewport:i={}},{viewport:s={}}={}){return o=>i[o]!==s[o]}const gestureAnimations={inView:{Feature:InViewFeature},tap:{Feature:PressGesture},focus:{Feature:FocusGesture},hover:{Feature:HoverGesture}};function shallowCompare(i,s){if(!Array.isArray(s))return!1;const o=s.length;if(o!==i.length)return!1;for(let a=0;ai*1e3,millisecondsToSeconds=i=>i/1e3,underDampedSpring={type:"spring",stiffness:500,damping:25,restSpeed:10},criticallyDampedSpring=i=>({type:"spring",stiffness:550,damping:i===0?2*Math.sqrt(550):30,restSpeed:10}),keyframesTransition={type:"keyframes",duration:.8},ease={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},getDefaultTransition=(i,{keyframes:s})=>s.length>2?keyframesTransition:transformProps.has(i)?i.startsWith("scale")?criticallyDampedSpring(s[1]):underDampedSpring:ease;function isTransitionDefined({when:i,delay:s,delayChildren:o,staggerChildren:a,staggerDirection:rt,repeat:et,repeatType:ot,repeatDelay:at,from:nt,elapsed:it,...j}){return!!Object.keys(j).length}function getValueTransition(i,s){return i[s]||i.default||i}const isNotNull=i=>i!==null;function getFinalKeyframe(i,{repeat:s,repeatType:o="loop"},a){const rt=i.filter(isNotNull),et=s&&o!=="loop"&&s%2===1?0:rt.length-1;return!et||a===void 0?rt[et]:a}const isZeroValueString=i=>/^0[^.\s]+$/u.test(i);function isNone(i){return typeof i=="number"?i===0:i!==null?i==="none"||i==="0"||isZeroValueString(i):!0}const isNumericalString=i=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(i),splitCSSVariableRegex=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function parseCSSVariable(i){const s=splitCSSVariableRegex.exec(i);if(!s)return[,];const[,o,a,rt]=s;return[`--${o??a}`,rt]}function getVariableValue(i,s,o=1){const[a,rt]=parseCSSVariable(i);if(!a)return;const et=window.getComputedStyle(s).getPropertyValue(a);if(et){const ot=et.trim();return isNumericalString(ot)?parseFloat(ot):ot}return isCSSVariableToken(rt)?getVariableValue(rt,s,o+1):rt}const positionalKeys=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),isNumOrPxType=i=>i===number||i===px,getPosFromMatrix=(i,s)=>parseFloat(i.split(", ")[s]),getTranslateFromMatrix=(i,s)=>(o,{transform:a})=>{if(a==="none"||!a)return 0;const rt=a.match(/^matrix3d\((.+)\)$/u);if(rt)return getPosFromMatrix(rt[1],s);{const et=a.match(/^matrix\((.+)\)$/u);return et?getPosFromMatrix(et[1],i):0}},transformKeys=new Set(["x","y","z"]),nonTranslationalTransformKeys=transformPropOrder.filter(i=>!transformKeys.has(i));function removeNonTranslationalTransform(i){const s=[];return nonTranslationalTransformKeys.forEach(o=>{const a=i.getValue(o);a!==void 0&&(s.push([o,a.get()]),a.set(o.startsWith("scale")?1:0))}),s}const positionalValues={width:({x:i},{paddingLeft:s="0",paddingRight:o="0"})=>i.max-i.min-parseFloat(s)-parseFloat(o),height:({y:i},{paddingTop:s="0",paddingBottom:o="0"})=>i.max-i.min-parseFloat(s)-parseFloat(o),top:(i,{top:s})=>parseFloat(s),left:(i,{left:s})=>parseFloat(s),bottom:({y:i},{top:s})=>parseFloat(s)+(i.max-i.min),right:({x:i},{left:s})=>parseFloat(s)+(i.max-i.min),x:getTranslateFromMatrix(4,13),y:getTranslateFromMatrix(5,14)};positionalValues.translateX=positionalValues.x;positionalValues.translateY=positionalValues.y;const testValueType=i=>s=>s.test(i),auto={test:i=>i==="auto",parse:i=>i},dimensionValueTypes=[number,px,percent,degrees,vw,vh,auto],findDimensionValueType=i=>dimensionValueTypes.find(testValueType(i)),toResolve=new Set;let isScheduled=!1,anyNeedsMeasurement=!1;function measureAllKeyframes(){if(anyNeedsMeasurement){const i=Array.from(toResolve).filter(a=>a.needsMeasurement),s=new Set(i.map(a=>a.element)),o=new Map;s.forEach(a=>{const rt=removeNonTranslationalTransform(a);rt.length&&(o.set(a,rt),a.render())}),i.forEach(a=>a.measureInitialState()),s.forEach(a=>{a.render();const rt=o.get(a);rt&&rt.forEach(([et,ot])=>{var at;(at=a.getValue(et))===null||at===void 0||at.set(ot)})}),i.forEach(a=>a.measureEndState()),i.forEach(a=>{a.suspendedScrollY!==void 0&&window.scrollTo(0,a.suspendedScrollY)})}anyNeedsMeasurement=!1,isScheduled=!1,toResolve.forEach(i=>i.complete()),toResolve.clear()}function readAllKeyframes(){toResolve.forEach(i=>{i.readKeyframes(),i.needsMeasurement&&(anyNeedsMeasurement=!0)})}function flushKeyframeResolvers(){readAllKeyframes(),measureAllKeyframes()}class KeyframeResolver{constructor(s,o,a,rt,et,ot=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...s],this.onComplete=o,this.name=a,this.motionValue=rt,this.element=et,this.isAsync=ot}scheduleResolve(){this.isScheduled=!0,this.isAsync?(toResolve.add(this),isScheduled||(isScheduled=!0,frame.read(readAllKeyframes),frame.resolveKeyframes(measureAllKeyframes))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:s,name:o,element:a,motionValue:rt}=this;for(let et=0;eto=>!!(isString$1(o)&&singleColorRegex.test(o)&&o.startsWith(i)||s&&!isNullish(o)&&Object.prototype.hasOwnProperty.call(o,s)),splitColor=(i,s,o)=>a=>{if(!isString$1(a))return a;const[rt,et,ot,at]=a.match(floatRegex);return{[i]:parseFloat(rt),[s]:parseFloat(et),[o]:parseFloat(ot),alpha:at!==void 0?parseFloat(at):1}},clampRgbUnit=i=>clamp(0,255,i),rgbUnit={...number,transform:i=>Math.round(clampRgbUnit(i))},rgba={test:isColorString("rgb","red"),parse:splitColor("red","green","blue"),transform:({red:i,green:s,blue:o,alpha:a=1})=>"rgba("+rgbUnit.transform(i)+", "+rgbUnit.transform(s)+", "+rgbUnit.transform(o)+", "+sanitize(alpha.transform(a))+")"};function parseHex(i){let s="",o="",a="",rt="";return i.length>5?(s=i.substring(1,3),o=i.substring(3,5),a=i.substring(5,7),rt=i.substring(7,9)):(s=i.substring(1,2),o=i.substring(2,3),a=i.substring(3,4),rt=i.substring(4,5),s+=s,o+=o,a+=a,rt+=rt),{red:parseInt(s,16),green:parseInt(o,16),blue:parseInt(a,16),alpha:rt?parseInt(rt,16)/255:1}}const hex={test:isColorString("#"),parse:parseHex,transform:rgba.transform},hsla={test:isColorString("hsl","hue"),parse:splitColor("hue","saturation","lightness"),transform:({hue:i,saturation:s,lightness:o,alpha:a=1})=>"hsla("+Math.round(i)+", "+percent.transform(sanitize(s))+", "+percent.transform(sanitize(o))+", "+sanitize(alpha.transform(a))+")"},color={test:i=>rgba.test(i)||hex.test(i)||hsla.test(i),parse:i=>rgba.test(i)?rgba.parse(i):hsla.test(i)?hsla.parse(i):hex.parse(i),transform:i=>isString$1(i)?i:i.hasOwnProperty("red")?rgba.transform(i):hsla.transform(i)};function test(i){var s,o;return isNaN(i)&&isString$1(i)&&(((s=i.match(floatRegex))===null||s===void 0?void 0:s.length)||0)+(((o=i.match(colorRegex))===null||o===void 0?void 0:o.length)||0)>0}const NUMBER_TOKEN="number",COLOR_TOKEN="color",VAR_TOKEN="var",VAR_FUNCTION_TOKEN="var(",SPLIT_TOKEN="${}",complexRegex=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function analyseComplexValue(i){const s=i.toString(),o=[],a={color:[],number:[],var:[]},rt=[];let et=0;const at=s.replace(complexRegex,nt=>(color.test(nt)?(a.color.push(et),rt.push(COLOR_TOKEN),o.push(color.parse(nt))):nt.startsWith(VAR_FUNCTION_TOKEN)?(a.var.push(et),rt.push(VAR_TOKEN),o.push(nt)):(a.number.push(et),rt.push(NUMBER_TOKEN),o.push(parseFloat(nt))),++et,SPLIT_TOKEN)).split(SPLIT_TOKEN);return{values:o,split:at,indexes:a,types:rt}}function parseComplexValue(i){return analyseComplexValue(i).values}function createTransformer(i){const{split:s,types:o}=analyseComplexValue(i),a=s.length;return rt=>{let et="";for(let ot=0;ottypeof i=="number"?0:i;function getAnimatableNone$1(i){const s=parseComplexValue(i);return createTransformer(i)(s.map(convertNumbersToZero))}const complex={test,parse:parseComplexValue,createTransformer,getAnimatableNone:getAnimatableNone$1},maxDefaults=new Set(["brightness","contrast","saturate","opacity"]);function applyDefaultFilter(i){const[s,o]=i.slice(0,-1).split("(");if(s==="drop-shadow")return i;const[a]=o.match(floatRegex)||[];if(!a)return i;const rt=o.replace(a,"");let et=maxDefaults.has(s)?1:0;return a!==o&&(et*=100),s+"("+et+rt+")"}const functionRegex=/\b([a-z-]*)\(.*?\)/gu,filter$1={...complex,getAnimatableNone:i=>{const s=i.match(functionRegex);return s?s.map(applyDefaultFilter).join(" "):i}},defaultValueTypes={...numberValueTypes,color,backgroundColor:color,outlineColor:color,fill:color,stroke:color,borderColor:color,borderTopColor:color,borderRightColor:color,borderBottomColor:color,borderLeftColor:color,filter:filter$1,WebkitFilter:filter$1},getDefaultValueType=i=>defaultValueTypes[i];function getAnimatableNone(i,s){let o=getDefaultValueType(i);return o!==filter$1&&(o=complex),o.getAnimatableNone?o.getAnimatableNone(s):void 0}const invalidTemplates=new Set(["auto","none","0"]);function makeNoneKeyframesAnimatable(i,s,o){let a=0,rt;for(;a{o.getValue(nt).set(it)}),this.resolveNoneKeyframes()}}function memo(i){let s;return()=>(s===void 0&&(s=i()),s)}let now;function clearTime(){now=void 0}const time={now:()=>(now===void 0&&time.set(frameData.isProcessing||MotionGlobalConfig.useManualTiming?frameData.timestamp:performance.now()),now),set:i=>{now=i,queueMicrotask(clearTime)}},isAnimatable=(i,s)=>s==="zIndex"?!1:!!(typeof i=="number"||Array.isArray(i)||typeof i=="string"&&(complex.test(i)||i==="0")&&!i.startsWith("url("));function hasKeyframesChanged(i){const s=i[0];if(i.length===1)return!0;for(let o=0;oMAX_RESOLVE_DELAY?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&flushKeyframeResolvers(),this._resolved}onKeyframesResolved(s,o){this.resolvedAt=time.now(),this.hasAttemptedResolve=!0;const{name:a,type:rt,velocity:et,delay:ot,onComplete:at,onUpdate:nt,isGenerator:it}=this.options;if(!it&&!canAnimate(s,a,rt,et))if(ot)this.options.duration=0;else{nt==null||nt(getFinalKeyframe(s,this.options,o)),at==null||at(),this.resolveFinishedPromise();return}const j=this.initPlayback(s,o);j!==!1&&(this._resolved={keyframes:s,finalKeyframe:o,...j},this.onPostResolved())}onPostResolved(){}then(s,o){return this.currentFinishedPromise.then(s,o)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(s=>{this.resolveFinishedPromise=s})}}function velocityPerSecond(i,s){return s?i*(1e3/s):0}const velocitySampleDuration=5;function calcGeneratorVelocity(i,s,o){const a=Math.max(s-velocitySampleDuration,0);return velocityPerSecond(o-i(a),s-a)}const safeMin=.001,minDuration=.01,maxDuration$1=10,minDamping=.05,maxDamping=1;function findSpring({duration:i=800,bounce:s=.25,velocity:o=0,mass:a=1}){let rt,et,ot=1-s;ot=clamp(minDamping,maxDamping,ot),i=clamp(minDuration,maxDuration$1,millisecondsToSeconds(i)),ot<1?(rt=it=>{const j=it*ot,_=j*i,$=j-o,tt=calcAngularFreq(it,ot),st=Math.exp(-_);return safeMin-$/tt*st},et=it=>{const _=it*ot*i,$=_*o+o,tt=Math.pow(ot,2)*Math.pow(it,2)*i,st=Math.exp(-_),lt=calcAngularFreq(Math.pow(it,2),ot);return(-rt(it)+safeMin>0?-1:1)*(($-tt)*st)/lt}):(rt=it=>{const j=Math.exp(-it*i),_=(it-o)*i+1;return-safeMin+j*_},et=it=>{const j=Math.exp(-it*i),_=(o-it)*(i*i);return j*_});const at=5/i,nt=approximateRoot(rt,et,at);if(i=secondsToMilliseconds(i),isNaN(nt))return{stiffness:100,damping:10,duration:i};{const it=Math.pow(nt,2)*a;return{stiffness:it,damping:ot*2*Math.sqrt(a*it),duration:i}}}const rootIterations=12;function approximateRoot(i,s,o){let a=o;for(let rt=1;rti[o]!==void 0)}function getSpringOptions(i){let s={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...i};if(!isSpringType(i,physicsKeys)&&isSpringType(i,durationKeys)){const o=findSpring(i);s={...s,...o,mass:1},s.isResolvedFromDuration=!0}return s}function spring({keyframes:i,restDelta:s,restSpeed:o,...a}){const rt=i[0],et=i[i.length-1],ot={done:!1,value:rt},{stiffness:at,damping:nt,mass:it,duration:j,velocity:_,isResolvedFromDuration:$}=getSpringOptions({...a,velocity:-millisecondsToSeconds(a.velocity||0)}),tt=_||0,st=nt/(2*Math.sqrt(at*it)),lt=et-rt,ct=millisecondsToSeconds(Math.sqrt(at/it)),ht=Math.abs(lt)<5;o||(o=ht?.01:2),s||(s=ht?.005:.5);let ut;if(st<1){const pt=calcAngularFreq(ct,st);ut=mt=>{const gt=Math.exp(-st*ct*mt);return et-gt*((tt+st*ct*lt)/pt*Math.sin(pt*mt)+lt*Math.cos(pt*mt))}}else if(st===1)ut=pt=>et-Math.exp(-ct*pt)*(lt+(tt+ct*lt)*pt);else{const pt=ct*Math.sqrt(st*st-1);ut=mt=>{const gt=Math.exp(-st*ct*mt),dt=Math.min(pt*mt,300);return et-gt*((tt+st*ct*lt)*Math.sinh(dt)+pt*lt*Math.cosh(dt))/pt}}return{calculatedDuration:$&&j||null,next:pt=>{const mt=ut(pt);if($)ot.done=pt>=j;else{let gt=0;st<1&&(gt=pt===0?secondsToMilliseconds(tt):calcGeneratorVelocity(ut,pt,mt));const dt=Math.abs(gt)<=o,St=Math.abs(et-mt)<=s;ot.done=dt&&St}return ot.value=ot.done?et:mt,ot}}}function inertia({keyframes:i,velocity:s=0,power:o=.8,timeConstant:a=325,bounceDamping:rt=10,bounceStiffness:et=500,modifyTarget:ot,min:at,max:nt,restDelta:it=.5,restSpeed:j}){const _=i[0],$={done:!1,value:_},tt=xt=>at!==void 0&&xtnt,st=xt=>at===void 0?nt:nt===void 0||Math.abs(at-xt)-lt*Math.exp(-xt/a),pt=xt=>ht+ut(xt),mt=xt=>{const yt=ut(xt),_t=pt(xt);$.done=Math.abs(yt)<=it,$.value=$.done?ht:_t};let gt,dt;const St=xt=>{tt($.value)&&(gt=xt,dt=spring({keyframes:[$.value,st($.value)],velocity:calcGeneratorVelocity(pt,xt,$.value),damping:rt,stiffness:et,restDelta:it,restSpeed:j}))};return St(0),{calculatedDuration:null,next:xt=>{let yt=!1;return!dt&>===void 0&&(yt=!0,mt(xt),St(xt)),gt!==void 0&&xt>=gt?dt.next(xt-gt):(!yt&&mt(xt),$)}}}const calcBezier=(i,s,o)=>(((1-3*o+3*s)*i+(3*o-6*s))*i+3*s)*i,subdivisionPrecision=1e-7,subdivisionMaxIterations=12;function binarySubdivide(i,s,o,a,rt){let et,ot,at=0;do ot=s+(o-s)/2,et=calcBezier(ot,a,rt)-i,et>0?o=ot:s=ot;while(Math.abs(et)>subdivisionPrecision&&++atbinarySubdivide(et,0,1,i,o);return et=>et===0||et===1?et:calcBezier(rt(et),s,a)}const easeIn=cubicBezier(.42,0,1,1),easeOut=cubicBezier(0,0,.58,1),easeInOut=cubicBezier(.42,0,.58,1),isEasingArray=i=>Array.isArray(i)&&typeof i[0]!="number",mirrorEasing=i=>s=>s<=.5?i(2*s)/2:(2-i(2*(1-s)))/2,reverseEasing=i=>s=>1-i(1-s),circIn=i=>1-Math.sin(Math.acos(i)),circOut=reverseEasing(circIn),circInOut=mirrorEasing(circIn),backOut=cubicBezier(.33,1.53,.69,.99),backIn=reverseEasing(backOut),backInOut=mirrorEasing(backIn),anticipate=i=>(i*=2)<1?.5*backIn(i):.5*(2-Math.pow(2,-10*(i-1))),easingLookup={linear:noop$1,easeIn,easeInOut,easeOut,circIn,circInOut,circOut,backIn,backInOut,backOut,anticipate},easingDefinitionToFunction=i=>{if(Array.isArray(i)){invariant(i.length===4);const[s,o,a,rt]=i;return cubicBezier(s,o,a,rt)}else if(typeof i=="string")return invariant(easingLookup[i]!==void 0),easingLookup[i];return i},progress=(i,s,o)=>{const a=s-i;return a===0?1:(o-i)/a},mixNumber$1=(i,s,o)=>i+(s-i)*o;function hueToRgb(i,s,o){return o<0&&(o+=1),o>1&&(o-=1),o<1/6?i+(s-i)*6*o:o<1/2?s:o<2/3?i+(s-i)*(2/3-o)*6:i}function hslaToRgba({hue:i,saturation:s,lightness:o,alpha:a}){i/=360,s/=100,o/=100;let rt=0,et=0,ot=0;if(!s)rt=et=ot=o;else{const at=o<.5?o*(1+s):o+s-o*s,nt=2*o-at;rt=hueToRgb(nt,at,i+1/3),et=hueToRgb(nt,at,i),ot=hueToRgb(nt,at,i-1/3)}return{red:Math.round(rt*255),green:Math.round(et*255),blue:Math.round(ot*255),alpha:a}}function mixImmediate(i,s){return o=>o>0?s:i}const mixLinearColor=(i,s,o)=>{const a=i*i,rt=o*(s*s-a)+a;return rt<0?0:Math.sqrt(rt)},colorTypes=[hex,rgba,hsla],getColorType=i=>colorTypes.find(s=>s.test(i));function asRGBA(i){const s=getColorType(i);if(!s)return!1;let o=s.parse(i);return s===hsla&&(o=hslaToRgba(o)),o}const mixColor=(i,s)=>{const o=asRGBA(i),a=asRGBA(s);if(!o||!a)return mixImmediate(i,s);const rt={...o};return et=>(rt.red=mixLinearColor(o.red,a.red,et),rt.green=mixLinearColor(o.green,a.green,et),rt.blue=mixLinearColor(o.blue,a.blue,et),rt.alpha=mixNumber$1(o.alpha,a.alpha,et),rgba.transform(rt))},invisibleValues=new Set(["none","hidden"]);function mixVisibility(i,s){return invisibleValues.has(i)?o=>o<=0?i:s:o=>o>=1?s:i}function mixNumber(i,s){return o=>mixNumber$1(i,s,o)}function getMixer(i){return typeof i=="number"?mixNumber:typeof i=="string"?isCSSVariableToken(i)?mixImmediate:color.test(i)?mixColor:mixComplex:Array.isArray(i)?mixArray:typeof i=="object"?color.test(i)?mixColor:mixObject:mixImmediate}function mixArray(i,s){const o=[...i],a=o.length,rt=i.map((et,ot)=>getMixer(et)(et,s[ot]));return et=>{for(let ot=0;ot{for(const et in a)o[et]=a[et](rt);return o}}function matchOrder(i,s){var o;const a=[],rt={color:0,var:0,number:0};for(let et=0;et{const o=complex.createTransformer(s),a=analyseComplexValue(i),rt=analyseComplexValue(s);return a.indexes.var.length===rt.indexes.var.length&&a.indexes.color.length===rt.indexes.color.length&&a.indexes.number.length>=rt.indexes.number.length?invisibleValues.has(i)&&!rt.values.length||invisibleValues.has(s)&&!a.values.length?mixVisibility(i,s):pipe(mixArray(matchOrder(a,rt),rt.values),o):mixImmediate(i,s)};function mix(i,s,o){return typeof i=="number"&&typeof s=="number"&&typeof o=="number"?mixNumber$1(i,s,o):getMixer(i)(i,s)}function createMixers(i,s,o){const a=[],rt=o||mix,et=i.length-1;for(let ot=0;ots[0];if(et===2&&i[0]===i[1])return()=>s[1];i[0]>i[et-1]&&(i=[...i].reverse(),s=[...s].reverse());const ot=createMixers(s,a,rt),at=ot.length,nt=it=>{let j=0;if(at>1)for(;jnt(clamp(i[0],i[et-1],it)):nt}function fillOffset(i,s){const o=i[i.length-1];for(let a=1;a<=s;a++){const rt=progress(0,s,a);i.push(mixNumber$1(o,1,rt))}}function defaultOffset(i){const s=[0];return fillOffset(s,i.length-1),s}function convertOffsetToTimes(i,s){return i.map(o=>o*s)}function defaultEasing(i,s){return i.map(()=>s||easeInOut).splice(0,i.length-1)}function keyframes({duration:i=300,keyframes:s,times:o,ease:a="easeInOut"}){const rt=isEasingArray(a)?a.map(easingDefinitionToFunction):easingDefinitionToFunction(a),et={done:!1,value:s[0]},ot=convertOffsetToTimes(o&&o.length===s.length?o:defaultOffset(s),i),at=interpolate(ot,s,{ease:Array.isArray(rt)?rt:defaultEasing(s,rt)});return{calculatedDuration:i,next:nt=>(et.value=at(nt),et.done=nt>=i,et)}}const maxGeneratorDuration=2e4;function calcGeneratorDuration(i){let s=0;const o=50;let a=i.next(s);for(;!a.done&&s=maxGeneratorDuration?1/0:s}const frameloopDriver=i=>{const s=({timestamp:o})=>i(o);return{start:()=>frame.update(s,!0),stop:()=>cancelFrame(s),now:()=>frameData.isProcessing?frameData.timestamp:time.now()}},generators={decay:inertia,inertia,tween:keyframes,keyframes,spring},percentToProgress=i=>i/100;class MainThreadAnimation extends BaseAnimation{constructor(s){super(s),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:nt}=this.options;nt&&nt()};const{name:o,motionValue:a,element:rt,keyframes:et}=this.options,ot=(rt==null?void 0:rt.KeyframeResolver)||KeyframeResolver,at=(nt,it)=>this.onKeyframesResolved(nt,it);this.resolver=new ot(et,at,o,a,rt),this.resolver.scheduleResolve()}initPlayback(s){const{type:o="keyframes",repeat:a=0,repeatDelay:rt=0,repeatType:et,velocity:ot=0}=this.options,at=generators[o]||keyframes;let nt,it;at!==keyframes&&typeof s[0]!="number"&&(nt=pipe(percentToProgress,mix(s[0],s[1])),s=[0,100]);const j=at({...this.options,keyframes:s});et==="mirror"&&(it=at({...this.options,keyframes:[...s].reverse(),velocity:-ot})),j.calculatedDuration===null&&(j.calculatedDuration=calcGeneratorDuration(j));const{calculatedDuration:_}=j,$=_+rt,tt=$*(a+1)-rt;return{generator:j,mirroredGenerator:it,mapPercentToKeyframes:nt,calculatedDuration:_,resolvedDuration:$,totalDuration:tt}}onPostResolved(){const{autoplay:s=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!s?this.pause():this.state=this.pendingPlayState}tick(s,o=!1){const{resolved:a}=this;if(!a){const{keyframes:xt}=this.options;return{done:!0,value:xt[xt.length-1]}}const{finalKeyframe:rt,generator:et,mirroredGenerator:ot,mapPercentToKeyframes:at,keyframes:nt,calculatedDuration:it,totalDuration:j,resolvedDuration:_}=a;if(this.startTime===null)return et.next(0);const{delay:$,repeat:tt,repeatType:st,repeatDelay:lt,onUpdate:ct}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,s):this.speed<0&&(this.startTime=Math.min(s-j/this.speed,this.startTime)),o?this.currentTime=s:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(s-this.startTime)*this.speed;const ht=this.currentTime-$*(this.speed>=0?1:-1),ut=this.speed>=0?ht<0:ht>j;this.currentTime=Math.max(ht,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=j);let pt=this.currentTime,mt=et;if(tt){const xt=Math.min(this.currentTime,j)/_;let yt=Math.floor(xt),_t=xt%1;!_t&&xt>=1&&(_t=1),_t===1&&yt--,yt=Math.min(yt,tt+1),!!(yt%2)&&(st==="reverse"?(_t=1-_t,lt&&(_t-=lt/_)):st==="mirror"&&(mt=ot)),pt=clamp(0,1,_t)*_}const gt=ut?{done:!1,value:nt[0]}:mt.next(pt);at&&(gt.value=at(gt.value));let{done:dt}=gt;!ut&&it!==null&&(dt=this.speed>=0?this.currentTime>=j:this.currentTime<=0);const St=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&dt);return St&&rt!==void 0&&(gt.value=getFinalKeyframe(nt,this.options,rt)),ct&&ct(gt.value),St&&this.finish(),gt}get duration(){const{resolved:s}=this;return s?millisecondsToSeconds(s.calculatedDuration):0}get time(){return millisecondsToSeconds(this.currentTime)}set time(s){s=secondsToMilliseconds(s),this.currentTime=s,this.holdTime!==null||this.speed===0?this.holdTime=s:this.driver&&(this.startTime=this.driver.now()-s/this.speed)}get speed(){return this.playbackSpeed}set speed(s){const o=this.playbackSpeed!==s;this.playbackSpeed=s,o&&(this.time=millisecondsToSeconds(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:s=frameloopDriver,onPlay:o,startTime:a}=this.options;this.driver||(this.driver=s(et=>this.tick(et))),o&&o();const rt=this.driver.now();this.holdTime!==null?this.startTime=rt-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=rt):this.startTime=a??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var s;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(s=this.currentTime)!==null&&s!==void 0?s:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:s}=this.options;s&&s()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(s){return this.startTime=0,this.tick(s,!0)}}const isBezierDefinition=i=>Array.isArray(i)&&typeof i[0]=="number";function isWaapiSupportedEasing(i){return!!(!i||typeof i=="string"&&i in supportedWaapiEasing||isBezierDefinition(i)||Array.isArray(i)&&i.every(isWaapiSupportedEasing))}const cubicBezierAsString=([i,s,o,a])=>`cubic-bezier(${i}, ${s}, ${o}, ${a})`,supportedWaapiEasing={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:cubicBezierAsString([0,.65,.55,1]),circOut:cubicBezierAsString([.55,0,1,.45]),backIn:cubicBezierAsString([.31,.01,.66,-.59]),backOut:cubicBezierAsString([.33,1.53,.69,.99])};function mapEasingToNativeEasingWithDefault(i){return mapEasingToNativeEasing(i)||supportedWaapiEasing.easeOut}function mapEasingToNativeEasing(i){if(i)return isBezierDefinition(i)?cubicBezierAsString(i):Array.isArray(i)?i.map(mapEasingToNativeEasingWithDefault):supportedWaapiEasing[i]}function animateStyle(i,s,o,{delay:a=0,duration:rt=300,repeat:et=0,repeatType:ot="loop",ease:at,times:nt}={}){const it={[s]:o};nt&&(it.offset=nt);const j=mapEasingToNativeEasing(at);return Array.isArray(j)&&(it.easing=j),i.animate(it,{delay:a,duration:rt,easing:Array.isArray(j)?"linear":j,fill:"both",iterations:et+1,direction:ot==="reverse"?"alternate":"normal"})}const supportsWaapi=memo(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),sampleDelta=10,maxDuration=2e4;function requiresPregeneratedKeyframes(i){return i.type==="spring"||!isWaapiSupportedEasing(i.ease)}function pregenerateKeyframes(i,s){const o=new MainThreadAnimation({...s,keyframes:i,repeat:0,delay:0,isGenerator:!0});let a={done:!1,value:i[0]};const rt=[];let et=0;for(;!a.done&&etthis.onKeyframesResolved(ot,at),o,a,rt),this.resolver.scheduleResolve()}initPlayback(s,o){var a;let{duration:rt=300,times:et,ease:ot,type:at,motionValue:nt,name:it,startTime:j}=this.options;if(!(!((a=nt.owner)===null||a===void 0)&&a.current))return!1;if(requiresPregeneratedKeyframes(this.options)){const{onComplete:$,onUpdate:tt,motionValue:st,element:lt,...ct}=this.options,ht=pregenerateKeyframes(s,ct);s=ht.keyframes,s.length===1&&(s[1]=s[0]),rt=ht.duration,et=ht.times,ot=ht.ease,at="keyframes"}const _=animateStyle(nt.owner.current,it,s,{...this.options,duration:rt,times:et,ease:ot});return _.startTime=j??this.calcStartTime(),this.pendingTimeline?(_.timeline=this.pendingTimeline,this.pendingTimeline=void 0):_.onfinish=()=>{const{onComplete:$}=this.options;nt.set(getFinalKeyframe(s,this.options,o)),$&&$(),this.cancel(),this.resolveFinishedPromise()},{animation:_,duration:rt,times:et,type:at,ease:ot,keyframes:s}}get duration(){const{resolved:s}=this;if(!s)return 0;const{duration:o}=s;return millisecondsToSeconds(o)}get time(){const{resolved:s}=this;if(!s)return 0;const{animation:o}=s;return millisecondsToSeconds(o.currentTime||0)}set time(s){const{resolved:o}=this;if(!o)return;const{animation:a}=o;a.currentTime=secondsToMilliseconds(s)}get speed(){const{resolved:s}=this;if(!s)return 1;const{animation:o}=s;return o.playbackRate}set speed(s){const{resolved:o}=this;if(!o)return;const{animation:a}=o;a.playbackRate=s}get state(){const{resolved:s}=this;if(!s)return"idle";const{animation:o}=s;return o.playState}get startTime(){const{resolved:s}=this;if(!s)return null;const{animation:o}=s;return o.startTime}attachTimeline(s){if(!this._resolved)this.pendingTimeline=s;else{const{resolved:o}=this;if(!o)return noop$1;const{animation:a}=o;a.timeline=s,a.onfinish=null}return noop$1}play(){if(this.isStopped)return;const{resolved:s}=this;if(!s)return;const{animation:o}=s;o.playState==="finished"&&this.updateFinishedPromise(),o.play()}pause(){const{resolved:s}=this;if(!s)return;const{animation:o}=s;o.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:s}=this;if(!s)return;const{animation:o,keyframes:a,duration:rt,type:et,ease:ot,times:at}=s;if(o.playState==="idle"||o.playState==="finished")return;if(this.time){const{motionValue:it,onUpdate:j,onComplete:_,element:$,...tt}=this.options,st=new MainThreadAnimation({...tt,keyframes:a,duration:rt,type:et,ease:ot,times:at,isGenerator:!0}),lt=secondsToMilliseconds(this.time);it.setWithVelocity(st.sample(lt-sampleDelta).value,st.sample(lt).value,sampleDelta)}const{onStop:nt}=this.options;nt&&nt(),this.cancel()}complete(){const{resolved:s}=this;s&&s.animation.finish()}cancel(){const{resolved:s}=this;s&&s.animation.cancel()}static supports(s){const{motionValue:o,name:a,repeatDelay:rt,repeatType:et,damping:ot,type:at}=s;return supportsWaapi()&&a&&acceleratedValues.has(a)&&o&&o.owner&&o.owner.current instanceof HTMLElement&&!o.owner.getProps().onUpdate&&!rt&&et!=="mirror"&&ot!==0&&at!=="inertia"}}function observeTimeline(i,s){let o;const a=()=>{const{currentTime:rt}=s,ot=(rt===null?0:rt.value)/100;o!==ot&&i(ot),o=ot};return frame.update(a,!0),()=>cancelFrame(a)}const supportsScrollTimeline=memo(()=>window.ScrollTimeline!==void 0);class GroupPlaybackControls{constructor(s){this.stop=()=>this.runAll("stop"),this.animations=s.filter(Boolean)}then(s,o){return Promise.all(this.animations).then(s).catch(o)}getAll(s){return this.animations[0][s]}setAll(s,o){for(let a=0;a{if(supportsScrollTimeline()&&a.attachTimeline)a.attachTimeline(s);else return a.pause(),observeTimeline(rt=>{a.time=a.duration*rt},s)});return()=>{o.forEach((a,rt)=>{a&&a(),this.animations[rt].stop()})}}get time(){return this.getAll("time")}set time(s){this.setAll("time",s)}get speed(){return this.getAll("speed")}set speed(s){this.setAll("speed",s)}get startTime(){return this.getAll("startTime")}get duration(){let s=0;for(let o=0;oo[s]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const animateMotionValue=(i,s,o,a={},rt,et,ot)=>at=>{const nt=getValueTransition(a,i)||{},it=nt.delay||a.delay||0;let{elapsed:j=0}=a;j=j-secondsToMilliseconds(it);let _={keyframes:Array.isArray(o)?o:[null,o],ease:"easeOut",velocity:s.getVelocity(),...nt,delay:-j,onUpdate:tt=>{s.set(tt),nt.onUpdate&&nt.onUpdate(tt)},onComplete:()=>{at(),nt.onComplete&&nt.onComplete(),ot&&ot()},onStop:ot,name:i,motionValue:s,element:et?void 0:rt};isTransitionDefined(nt)||(_={..._,...getDefaultTransition(i,_)}),_.duration&&(_.duration=secondsToMilliseconds(_.duration)),_.repeatDelay&&(_.repeatDelay=secondsToMilliseconds(_.repeatDelay)),_.from!==void 0&&(_.keyframes[0]=_.from);let $=!1;if((_.type===!1||_.duration===0&&!_.repeatDelay)&&(_.duration=0,_.delay===0&&($=!0)),$&&!et&&s.get()!==void 0){const tt=getFinalKeyframe(_.keyframes,nt);if(tt!==void 0)return frame.update(()=>{_.onUpdate(tt),_.onComplete()}),new GroupPlaybackControls([])}return!et&&AcceleratedAnimation.supports(_)?new AcceleratedAnimation(_):new MainThreadAnimation(_)};class SubscriptionManager{constructor(){this.subscriptions=[]}add(s){return addUniqueItem(this.subscriptions,s),()=>removeItem(this.subscriptions,s)}notify(s,o,a){const rt=this.subscriptions.length;if(rt)if(rt===1)this.subscriptions[0](s,o,a);else for(let et=0;et!isNaN(parseFloat(i));class MotionValue{constructor(s,o={}){this.version="11.3.28",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(a,rt=!0)=>{const et=time.now();this.updatedAt!==et&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(a),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),rt&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(s),this.owner=o.owner}setCurrent(s){this.current=s,this.updatedAt=time.now(),this.canTrackVelocity===null&&s!==void 0&&(this.canTrackVelocity=isFloat(this.current))}setPrevFrameValue(s=this.current){this.prevFrameValue=s,this.prevUpdatedAt=this.updatedAt}onChange(s){return this.on("change",s)}on(s,o){this.events[s]||(this.events[s]=new SubscriptionManager);const a=this.events[s].add(o);return s==="change"?()=>{a(),frame.read(()=>{this.events.change.getSize()||this.stop()})}:a}clearListeners(){for(const s in this.events)this.events[s].clear()}attach(s,o){this.passiveEffect=s,this.stopPassiveEffect=o}set(s,o=!0){!o||!this.passiveEffect?this.updateAndNotify(s,o):this.passiveEffect(s,this.updateAndNotify)}setWithVelocity(s,o,a){this.set(o),this.prev=void 0,this.prevFrameValue=s,this.prevUpdatedAt=this.updatedAt-a}jump(s,o=!0){this.updateAndNotify(s),this.prev=s,this.prevUpdatedAt=this.prevFrameValue=void 0,o&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const s=time.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||s-this.updatedAt>MAX_VELOCITY_DELTA)return 0;const o=Math.min(this.updatedAt-this.prevUpdatedAt,MAX_VELOCITY_DELTA);return velocityPerSecond(parseFloat(this.current)-parseFloat(this.prevFrameValue),o)}start(s){return this.stop(),new Promise(o=>{this.hasAnimated=!0,this.animation=s(o),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function motionValue(i,s){return new MotionValue(i,s)}function setMotionValue(i,s,o){i.hasValue(s)?i.getValue(s).set(o):i.addValue(s,motionValue(o))}function setTarget(i,s){const o=resolveVariant(i,s);let{transitionEnd:a={},transition:rt={},...et}=o||{};et={...et,...a};for(const ot in et){const at=resolveFinalValueInKeyframes(et[ot]);setMotionValue(i,ot,at)}}function getOptimisedAppearId(i){return i.getProps()[optimizedAppearDataAttribute]}class WillChangeMotionValue extends MotionValue{constructor(){super(...arguments),this.output=[],this.counts=new Map}add(s){const o=getWillChangeName(s);if(!o)return;const a=this.counts.get(o)||0;this.counts.set(o,a+1),a===0&&(this.output.push(o),this.update());let rt=!1;return()=>{if(rt)return;rt=!0;const et=this.counts.get(o)-1;this.counts.set(o,et),et===0&&(removeItem(this.output,o),this.update())}}update(){this.set(this.output.length?this.output.join(", "):"auto")}}function isWillChangeMotionValue(i){return!!(isMotionValue(i)&&i.add)}function addValueToWillChange(i,s){var o;if(!i.applyWillChange)return;let a=i.getValue("willChange");if(!a&&!(!((o=i.props.style)===null||o===void 0)&&o.willChange)&&(a=new WillChangeMotionValue("auto"),i.addValue("willChange",a)),isWillChangeMotionValue(a))return a.add(s)}function shouldBlockAnimation({protectedKeys:i,needsAnimating:s},o){const a=i.hasOwnProperty(o)&&s[o]!==!0;return s[o]=!1,a}function animateTarget(i,s,{delay:o=0,transitionOverride:a,type:rt}={}){var et;let{transition:ot=i.getDefaultTransition(),transitionEnd:at,...nt}=s;a&&(ot=a);const it=[],j=rt&&i.animationState&&i.animationState.getState()[rt];for(const _ in nt){const $=i.getValue(_,(et=i.latestValues[_])!==null&&et!==void 0?et:null),tt=nt[_];if(tt===void 0||j&&shouldBlockAnimation(j,_))continue;const st={delay:o,...getValueTransition(ot||{},_)};let lt=!1;if(window.MotionHandoffAnimation){const ht=getOptimisedAppearId(i);if(ht){const ut=window.MotionHandoffAnimation(ht,_,frame);ut!==null&&(st.startTime=ut,lt=!0)}}$.start(animateMotionValue(_,$,tt,i.shouldReduceMotion&&transformProps.has(_)?{type:!1}:st,i,lt,addValueToWillChange(i,_)));const ct=$.animation;ct&&it.push(ct)}return at&&Promise.all(it).then(()=>{frame.update(()=>{at&&setTarget(i,at)})}),it}function animateVariant(i,s,o={}){var a;const rt=resolveVariant(i,s,o.type==="exit"?(a=i.presenceContext)===null||a===void 0?void 0:a.custom:void 0);let{transition:et=i.getDefaultTransition()||{}}=rt||{};o.transitionOverride&&(et=o.transitionOverride);const ot=rt?()=>Promise.all(animateTarget(i,rt,o)):()=>Promise.resolve(),at=i.variantChildren&&i.variantChildren.size?(it=0)=>{const{delayChildren:j=0,staggerChildren:_,staggerDirection:$}=et;return animateChildren(i,s,j+it,_,$,o)}:()=>Promise.resolve(),{when:nt}=et;if(nt){const[it,j]=nt==="beforeChildren"?[ot,at]:[at,ot];return it().then(()=>j())}else return Promise.all([ot(),at(o.delay)])}function animateChildren(i,s,o=0,a=0,rt=1,et){const ot=[],at=(i.variantChildren.size-1)*a,nt=rt===1?(it=0)=>it*a:(it=0)=>at-it*a;return Array.from(i.variantChildren).sort(sortByTreeOrder).forEach((it,j)=>{it.notify("AnimationStart",s),ot.push(animateVariant(it,s,{...et,delay:o+nt(j)}).then(()=>it.notify("AnimationComplete",s)))}),Promise.all(ot)}function sortByTreeOrder(i,s){return i.sortNodePosition(s)}function animateVisualElement(i,s,o={}){i.notify("AnimationStart",s);let a;if(Array.isArray(s)){const rt=s.map(et=>animateVariant(i,et,o));a=Promise.all(rt)}else if(typeof s=="string")a=animateVariant(i,s,o);else{const rt=typeof s=="function"?resolveVariant(i,s,o.custom):s;a=Promise.all(animateTarget(i,rt,o))}return a.then(()=>{i.notify("AnimationComplete",s)})}const reversePriorityOrder=[...variantPriorityOrder].reverse(),numAnimationTypes=variantPriorityOrder.length;function animateList(i){return s=>Promise.all(s.map(({animation:o,options:a})=>animateVisualElement(i,o,a)))}function createAnimationState(i){let s=animateList(i),o=createState(),a=!0;const rt=nt=>(it,j)=>{var _;const $=resolveVariant(i,j,nt==="exit"?(_=i.presenceContext)===null||_===void 0?void 0:_.custom:void 0);if($){const{transition:tt,transitionEnd:st,...lt}=$;it={...it,...lt,...st}}return it};function et(nt){s=nt(i)}function ot(nt){const it=i.getProps(),j=i.getVariantContext(!0)||{},_=[],$=new Set;let tt={},st=1/0;for(let ct=0;ctst&&mt,yt=!1;const _t=Array.isArray(pt)?pt:[pt];let Ct=_t.reduce(rt(ht),{});gt===!1&&(Ct={});const{prevResolvedValues:Et={}}=ut,kt={...Et,...Ct},Tt=$t=>{xt=!0,$.has($t)&&(yt=!0,$.delete($t)),ut.needsAnimating[$t]=!0;const It=i.getValue($t);It&&(It.liveStyle=!1)};for(const $t in kt){const It=Ct[$t],Ot=Et[$t];if(tt.hasOwnProperty($t))continue;let Mt=!1;isKeyframesTarget(It)&&isKeyframesTarget(Ot)?Mt=!shallowCompare(It,Ot):Mt=It!==Ot,Mt?It!=null?Tt($t):$.add($t):It!==void 0&&$.has($t)?Tt($t):ut.protectedKeys[$t]=!0}ut.prevProp=pt,ut.prevResolvedValues=Ct,ut.isActive&&(tt={...tt,...Ct}),a&&i.blockInitialAnimation&&(xt=!1),xt&&(!dt||yt)&&_.push(..._t.map($t=>({animation:$t,options:{type:ht}})))}if($.size){const ct={};$.forEach(ht=>{const ut=i.getBaseTarget(ht),pt=i.getValue(ht);pt&&(pt.liveStyle=!0),ct[ht]=ut??null}),_.push({animation:ct})}let lt=!!_.length;return a&&(it.initial===!1||it.initial===it.animate)&&!i.manuallyAnimateOnMount&&(lt=!1),a=!1,lt?s(_):Promise.resolve()}function at(nt,it){var j;if(o[nt].isActive===it)return Promise.resolve();(j=i.variantChildren)===null||j===void 0||j.forEach($=>{var tt;return(tt=$.animationState)===null||tt===void 0?void 0:tt.setActive(nt,it)}),o[nt].isActive=it;const _=ot(nt);for(const $ in o)o[$].protectedKeys={};return _}return{animateChanges:ot,setActive:at,setAnimateFunction:et,getState:()=>o,reset:()=>{o=createState(),a=!0}}}function checkVariantsDidChange(i,s){return typeof s=="string"?s!==i:Array.isArray(s)?!shallowCompare(s,i):!1}function createTypeState(i=!1){return{isActive:i,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function createState(){return{animate:createTypeState(!0),whileInView:createTypeState(),whileHover:createTypeState(),whileTap:createTypeState(),whileDrag:createTypeState(),whileFocus:createTypeState(),exit:createTypeState()}}class AnimationFeature extends Feature{constructor(s){super(s),s.animationState||(s.animationState=createAnimationState(s))}updateAnimationControlsSubscription(){const{animate:s}=this.node.getProps();isAnimationControls(s)&&(this.unmountControls=s.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:s}=this.node.getProps(),{animate:o}=this.node.prevProps||{};s!==o&&this.updateAnimationControlsSubscription()}unmount(){var s;this.node.animationState.reset(),(s=this.unmountControls)===null||s===void 0||s.call(this)}}let id$1=0;class ExitAnimationFeature extends Feature{constructor(){super(...arguments),this.id=id$1++}update(){if(!this.node.presenceContext)return;const{isPresent:s,onExitComplete:o}=this.node.presenceContext,{isPresent:a}=this.node.prevPresenceContext||{};if(!this.node.animationState||s===a)return;const rt=this.node.animationState.setActive("exit",!s);o&&!s&&rt.then(()=>o(this.id))}mount(){const{register:s}=this.node.presenceContext||{};s&&(this.unmount=s(this.id))}unmount(){}}const animations={animation:{Feature:AnimationFeature},exit:{Feature:ExitAnimationFeature}},distance=(i,s)=>Math.abs(i-s);function distance2D(i,s){const o=distance(i.x,s.x),a=distance(i.y,s.y);return Math.sqrt(o**2+a**2)}class PanSession{constructor(s,o,{transformPagePoint:a,contextWindow:rt,dragSnapToOrigin:et=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const _=getPanInfo(this.lastMoveEventInfo,this.history),$=this.startEvent!==null,tt=distance2D(_.offset,{x:0,y:0})>=3;if(!$&&!tt)return;const{point:st}=_,{timestamp:lt}=frameData;this.history.push({...st,timestamp:lt});const{onStart:ct,onMove:ht}=this.handlers;$||(ct&&ct(this.lastMoveEvent,_),this.startEvent=this.lastMoveEvent),ht&&ht(this.lastMoveEvent,_)},this.handlePointerMove=(_,$)=>{this.lastMoveEvent=_,this.lastMoveEventInfo=transformPoint($,this.transformPagePoint),frame.update(this.updatePoint,!0)},this.handlePointerUp=(_,$)=>{this.end();const{onEnd:tt,onSessionEnd:st,resumeAnimation:lt}=this.handlers;if(this.dragSnapToOrigin&<&<(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const ct=getPanInfo(_.type==="pointercancel"?this.lastMoveEventInfo:transformPoint($,this.transformPagePoint),this.history);this.startEvent&&tt&&tt(_,ct),st&&st(_,ct)},!isPrimaryPointer(s))return;this.dragSnapToOrigin=et,this.handlers=o,this.transformPagePoint=a,this.contextWindow=rt||window;const ot=extractEventInfo(s),at=transformPoint(ot,this.transformPagePoint),{point:nt}=at,{timestamp:it}=frameData;this.history=[{...nt,timestamp:it}];const{onSessionStart:j}=o;j&&j(s,getPanInfo(at,this.history)),this.removeListeners=pipe(addPointerEvent(this.contextWindow,"pointermove",this.handlePointerMove),addPointerEvent(this.contextWindow,"pointerup",this.handlePointerUp),addPointerEvent(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(s){this.handlers=s}end(){this.removeListeners&&this.removeListeners(),cancelFrame(this.updatePoint)}}function transformPoint(i,s){return s?{point:s(i.point)}:i}function subtractPoint(i,s){return{x:i.x-s.x,y:i.y-s.y}}function getPanInfo({point:i},s){return{point:i,delta:subtractPoint(i,lastDevicePoint(s)),offset:subtractPoint(i,startDevicePoint(s)),velocity:getVelocity(s,.1)}}function startDevicePoint(i){return i[0]}function lastDevicePoint(i){return i[i.length-1]}function getVelocity(i,s){if(i.length<2)return{x:0,y:0};let o=i.length-1,a=null;const rt=lastDevicePoint(i);for(;o>=0&&(a=i[o],!(rt.timestamp-a.timestamp>secondsToMilliseconds(s)));)o--;if(!a)return{x:0,y:0};const et=millisecondsToSeconds(rt.timestamp-a.timestamp);if(et===0)return{x:0,y:0};const ot={x:(rt.x-a.x)/et,y:(rt.y-a.y)/et};return ot.x===1/0&&(ot.x=0),ot.y===1/0&&(ot.y=0),ot}const SCALE_PRECISION=1e-4,SCALE_MIN=1-SCALE_PRECISION,SCALE_MAX=1+SCALE_PRECISION,TRANSLATE_PRECISION=.01,TRANSLATE_MIN=0-TRANSLATE_PRECISION,TRANSLATE_MAX=0+TRANSLATE_PRECISION;function calcLength(i){return i.max-i.min}function isNear(i,s,o){return Math.abs(i-s)<=o}function calcAxisDelta(i,s,o,a=.5){i.origin=a,i.originPoint=mixNumber$1(s.min,s.max,i.origin),i.scale=calcLength(o)/calcLength(s),i.translate=mixNumber$1(o.min,o.max,i.origin)-i.originPoint,(i.scale>=SCALE_MIN&&i.scale<=SCALE_MAX||isNaN(i.scale))&&(i.scale=1),(i.translate>=TRANSLATE_MIN&&i.translate<=TRANSLATE_MAX||isNaN(i.translate))&&(i.translate=0)}function calcBoxDelta(i,s,o,a){calcAxisDelta(i.x,s.x,o.x,a?a.originX:void 0),calcAxisDelta(i.y,s.y,o.y,a?a.originY:void 0)}function calcRelativeAxis(i,s,o){i.min=o.min+s.min,i.max=i.min+calcLength(s)}function calcRelativeBox(i,s,o){calcRelativeAxis(i.x,s.x,o.x),calcRelativeAxis(i.y,s.y,o.y)}function calcRelativeAxisPosition(i,s,o){i.min=s.min-o.min,i.max=i.min+calcLength(s)}function calcRelativePosition(i,s,o){calcRelativeAxisPosition(i.x,s.x,o.x),calcRelativeAxisPosition(i.y,s.y,o.y)}function applyConstraints(i,{min:s,max:o},a){return s!==void 0&&io&&(i=a?mixNumber$1(o,i,a.max):Math.min(i,o)),i}function calcRelativeAxisConstraints(i,s,o){return{min:s!==void 0?i.min+s:void 0,max:o!==void 0?i.max+o-(i.max-i.min):void 0}}function calcRelativeConstraints(i,{top:s,left:o,bottom:a,right:rt}){return{x:calcRelativeAxisConstraints(i.x,o,rt),y:calcRelativeAxisConstraints(i.y,s,a)}}function calcViewportAxisConstraints(i,s){let o=s.min-i.min,a=s.max-i.max;return s.max-s.mina?o=progress(s.min,s.max-a,i.min):a>rt&&(o=progress(i.min,i.max-rt,s.min)),clamp(0,1,o)}function rebaseAxisConstraints(i,s){const o={};return s.min!==void 0&&(o.min=s.min-i.min),s.max!==void 0&&(o.max=s.max-i.min),o}const defaultElastic=.35;function resolveDragElastic(i=defaultElastic){return i===!1?i=0:i===!0&&(i=defaultElastic),{x:resolveAxisElastic(i,"left","right"),y:resolveAxisElastic(i,"top","bottom")}}function resolveAxisElastic(i,s,o){return{min:resolvePointElastic(i,s),max:resolvePointElastic(i,o)}}function resolvePointElastic(i,s){return typeof i=="number"?i:i[s]||0}const createAxisDelta=()=>({translate:0,scale:1,origin:0,originPoint:0}),createDelta=()=>({x:createAxisDelta(),y:createAxisDelta()}),createAxis=()=>({min:0,max:0}),createBox=()=>({x:createAxis(),y:createAxis()});function eachAxis(i){return[i("x"),i("y")]}function convertBoundingBoxToBox({top:i,left:s,right:o,bottom:a}){return{x:{min:s,max:o},y:{min:i,max:a}}}function convertBoxToBoundingBox({x:i,y:s}){return{top:s.min,right:i.max,bottom:s.max,left:i.min}}function transformBoxPoints(i,s){if(!s)return i;const o=s({x:i.left,y:i.top}),a=s({x:i.right,y:i.bottom});return{top:o.y,left:o.x,bottom:a.y,right:a.x}}function isIdentityScale(i){return i===void 0||i===1}function hasScale({scale:i,scaleX:s,scaleY:o}){return!isIdentityScale(i)||!isIdentityScale(s)||!isIdentityScale(o)}function hasTransform(i){return hasScale(i)||has2DTranslate(i)||i.z||i.rotate||i.rotateX||i.rotateY||i.skewX||i.skewY}function has2DTranslate(i){return is2DTranslate(i.x)||is2DTranslate(i.y)}function is2DTranslate(i){return i&&i!=="0%"}function scalePoint(i,s,o){const a=i-o,rt=s*a;return o+rt}function applyPointDelta(i,s,o,a,rt){return rt!==void 0&&(i=scalePoint(i,rt,a)),scalePoint(i,o,a)+s}function applyAxisDelta(i,s=0,o=1,a,rt){i.min=applyPointDelta(i.min,s,o,a,rt),i.max=applyPointDelta(i.max,s,o,a,rt)}function applyBoxDelta(i,{x:s,y:o}){applyAxisDelta(i.x,s.translate,s.scale,s.originPoint),applyAxisDelta(i.y,o.translate,o.scale,o.originPoint)}const TREE_SCALE_SNAP_MIN=.999999999999,TREE_SCALE_SNAP_MAX=1.0000000000001;function applyTreeDeltas(i,s,o,a=!1){const rt=o.length;if(!rt)return;s.x=s.y=1;let et,ot;for(let at=0;atTREE_SCALE_SNAP_MIN&&(s.x=1),s.yTREE_SCALE_SNAP_MIN&&(s.y=1)}function translateAxis(i,s){i.min=i.min+s,i.max=i.max+s}function transformAxis(i,s,o,a,rt=.5){const et=mixNumber$1(i.min,i.max,rt);applyAxisDelta(i,s,o,et,a)}function transformBox(i,s){transformAxis(i.x,s.x,s.scaleX,s.scale,s.originX),transformAxis(i.y,s.y,s.scaleY,s.scale,s.originY)}function measureViewportBox(i,s){return convertBoundingBoxToBox(transformBoxPoints(i.getBoundingClientRect(),s))}function measurePageBox(i,s,o){const a=measureViewportBox(i,o),{scroll:rt}=s;return rt&&(translateAxis(a.x,rt.offset.x),translateAxis(a.y,rt.offset.y)),a}const getContextWindow=({current:i})=>i?i.ownerDocument.defaultView:null,elementDragControls=new WeakMap;class VisualElementDragControls{constructor(s){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=createBox(),this.visualElement=s}start(s,{snapToCursor:o=!1}={}){const{presenceContext:a}=this.visualElement;if(a&&a.isPresent===!1)return;const rt=j=>{const{dragSnapToOrigin:_}=this.getProps();_?this.pauseAnimation():this.stopAnimation(),o&&this.snapToCursor(extractEventInfo(j,"page").point)},et=(j,_)=>{var $;const{drag:tt,dragPropagation:st,onDragStart:lt}=this.getProps();if(tt&&!st&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=getGlobalLock(tt),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),eachAxis(ht=>{let ut=this.getAxisMotionValue(ht).get()||0;if(percent.test(ut)){const{projection:pt}=this.visualElement;if(pt&&pt.layout){const mt=pt.layout.layoutBox[ht];mt&&(ut=calcLength(mt)*(parseFloat(ut)/100))}}this.originPoint[ht]=ut}),lt&&frame.postRender(()=>lt(j,_)),($=this.removeWillChange)===null||$===void 0||$.call(this),this.removeWillChange=addValueToWillChange(this.visualElement,"transform");const{animationState:ct}=this.visualElement;ct&&ct.setActive("whileDrag",!0)},ot=(j,_)=>{const{dragPropagation:$,dragDirectionLock:tt,onDirectionLock:st,onDrag:lt}=this.getProps();if(!$&&!this.openGlobalLock)return;const{offset:ct}=_;if(tt&&this.currentDirection===null){this.currentDirection=getCurrentDirection(ct),this.currentDirection!==null&&st&&st(this.currentDirection);return}this.updateAxis("x",_.point,ct),this.updateAxis("y",_.point,ct),this.visualElement.render(),lt&<(j,_)},at=(j,_)=>this.stop(j,_),nt=()=>eachAxis(j=>{var _;return this.getAnimationState(j)==="paused"&&((_=this.getAxisMotionValue(j).animation)===null||_===void 0?void 0:_.play())}),{dragSnapToOrigin:it}=this.getProps();this.panSession=new PanSession(s,{onSessionStart:rt,onStart:et,onMove:ot,onSessionEnd:at,resumeAnimation:nt},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:it,contextWindow:getContextWindow(this.visualElement)})}stop(s,o){var a;(a=this.removeWillChange)===null||a===void 0||a.call(this);const rt=this.isDragging;if(this.cancel(),!rt)return;const{velocity:et}=o;this.startAnimation(et);const{onDragEnd:ot}=this.getProps();ot&&frame.postRender(()=>ot(s,o))}cancel(){this.isDragging=!1;const{projection:s,animationState:o}=this.visualElement;s&&(s.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:a}=this.getProps();!a&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),o&&o.setActive("whileDrag",!1)}updateAxis(s,o,a){const{drag:rt}=this.getProps();if(!a||!shouldDrag(s,rt,this.currentDirection))return;const et=this.getAxisMotionValue(s);let ot=this.originPoint[s]+a[s];this.constraints&&this.constraints[s]&&(ot=applyConstraints(ot,this.constraints[s],this.elastic[s])),et.set(ot)}resolveConstraints(){var s;const{dragConstraints:o,dragElastic:a}=this.getProps(),rt=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)===null||s===void 0?void 0:s.layout,et=this.constraints;o&&isRefObject(o)?this.constraints||(this.constraints=this.resolveRefConstraints()):o&&rt?this.constraints=calcRelativeConstraints(rt.layoutBox,o):this.constraints=!1,this.elastic=resolveDragElastic(a),et!==this.constraints&&rt&&this.constraints&&!this.hasMutatedConstraints&&eachAxis(ot=>{this.constraints!==!1&&this.getAxisMotionValue(ot)&&(this.constraints[ot]=rebaseAxisConstraints(rt.layoutBox[ot],this.constraints[ot]))})}resolveRefConstraints(){const{dragConstraints:s,onMeasureDragConstraints:o}=this.getProps();if(!s||!isRefObject(s))return!1;const a=s.current,{projection:rt}=this.visualElement;if(!rt||!rt.layout)return!1;const et=measurePageBox(a,rt.root,this.visualElement.getTransformPagePoint());let ot=calcViewportConstraints(rt.layout.layoutBox,et);if(o){const at=o(convertBoxToBoundingBox(ot));this.hasMutatedConstraints=!!at,at&&(ot=convertBoundingBoxToBox(at))}return ot}startAnimation(s){const{drag:o,dragMomentum:a,dragElastic:rt,dragTransition:et,dragSnapToOrigin:ot,onDragTransitionEnd:at}=this.getProps(),nt=this.constraints||{},it=eachAxis(j=>{if(!shouldDrag(j,o,this.currentDirection))return;let _=nt&&nt[j]||{};ot&&(_={min:0,max:0});const $=rt?200:1e6,tt=rt?40:1e7,st={type:"inertia",velocity:a?s[j]:0,bounceStiffness:$,bounceDamping:tt,timeConstant:750,restDelta:1,restSpeed:10,...et,..._};return this.startAxisValueAnimation(j,st)});return Promise.all(it).then(at)}startAxisValueAnimation(s,o){const a=this.getAxisMotionValue(s);return a.start(animateMotionValue(s,a,0,o,this.visualElement,!1,addValueToWillChange(this.visualElement,s)))}stopAnimation(){eachAxis(s=>this.getAxisMotionValue(s).stop())}pauseAnimation(){eachAxis(s=>{var o;return(o=this.getAxisMotionValue(s).animation)===null||o===void 0?void 0:o.pause()})}getAnimationState(s){var o;return(o=this.getAxisMotionValue(s).animation)===null||o===void 0?void 0:o.state}getAxisMotionValue(s){const o=`_drag${s.toUpperCase()}`,a=this.visualElement.getProps(),rt=a[o];return rt||this.visualElement.getValue(s,(a.initial?a.initial[s]:void 0)||0)}snapToCursor(s){eachAxis(o=>{const{drag:a}=this.getProps();if(!shouldDrag(o,a,this.currentDirection))return;const{projection:rt}=this.visualElement,et=this.getAxisMotionValue(o);if(rt&&rt.layout){const{min:ot,max:at}=rt.layout.layoutBox[o];et.set(s[o]-mixNumber$1(ot,at,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:s,dragConstraints:o}=this.getProps(),{projection:a}=this.visualElement;if(!isRefObject(o)||!a||!this.constraints)return;this.stopAnimation();const rt={x:0,y:0};eachAxis(ot=>{const at=this.getAxisMotionValue(ot);if(at&&this.constraints!==!1){const nt=at.get();rt[ot]=calcOrigin({min:nt,max:nt},this.constraints[ot])}});const{transformTemplate:et}=this.visualElement.getProps();this.visualElement.current.style.transform=et?et({},""):"none",a.root&&a.root.updateScroll(),a.updateLayout(),this.resolveConstraints(),eachAxis(ot=>{if(!shouldDrag(ot,s,null))return;const at=this.getAxisMotionValue(ot),{min:nt,max:it}=this.constraints[ot];at.set(mixNumber$1(nt,it,rt[ot]))})}addListeners(){if(!this.visualElement.current)return;elementDragControls.set(this.visualElement,this);const s=this.visualElement.current,o=addPointerEvent(s,"pointerdown",nt=>{const{drag:it,dragListener:j=!0}=this.getProps();it&&j&&this.start(nt)}),a=()=>{const{dragConstraints:nt}=this.getProps();isRefObject(nt)&&nt.current&&(this.constraints=this.resolveRefConstraints())},{projection:rt}=this.visualElement,et=rt.addEventListener("measure",a);rt&&!rt.layout&&(rt.root&&rt.root.updateScroll(),rt.updateLayout()),frame.read(a);const ot=addDomEvent(window,"resize",()=>this.scalePositionWithinConstraints()),at=rt.addEventListener("didUpdate",({delta:nt,hasLayoutChanged:it})=>{this.isDragging&&it&&(eachAxis(j=>{const _=this.getAxisMotionValue(j);_&&(this.originPoint[j]+=nt[j].translate,_.set(_.get()+nt[j].translate))}),this.visualElement.render())});return()=>{ot(),o(),et(),at&&at()}}getProps(){const s=this.visualElement.getProps(),{drag:o=!1,dragDirectionLock:a=!1,dragPropagation:rt=!1,dragConstraints:et=!1,dragElastic:ot=defaultElastic,dragMomentum:at=!0}=s;return{...s,drag:o,dragDirectionLock:a,dragPropagation:rt,dragConstraints:et,dragElastic:ot,dragMomentum:at}}}function shouldDrag(i,s,o){return(s===!0||s===i)&&(o===null||o===i)}function getCurrentDirection(i,s=10){let o=null;return Math.abs(i.y)>s?o="y":Math.abs(i.x)>s&&(o="x"),o}class DragGesture extends Feature{constructor(s){super(s),this.removeGroupControls=noop$1,this.removeListeners=noop$1,this.controls=new VisualElementDragControls(s)}mount(){const{dragControls:s}=this.node.getProps();s&&(this.removeGroupControls=s.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||noop$1}unmount(){this.removeGroupControls(),this.removeListeners()}}const asyncHandler=i=>(s,o)=>{i&&frame.postRender(()=>i(s,o))};class PanGesture extends Feature{constructor(){super(...arguments),this.removePointerDownListener=noop$1}onPointerDown(s){this.session=new PanSession(s,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:getContextWindow(this.node)})}createPanHandlers(){const{onPanSessionStart:s,onPanStart:o,onPan:a,onPanEnd:rt}=this.node.getProps();return{onSessionStart:asyncHandler(s),onStart:asyncHandler(o),onMove:a,onEnd:(et,ot)=>{delete this.session,rt&&frame.postRender(()=>rt(et,ot))}}}mount(){this.removePointerDownListener=addPointerEvent(this.node.current,"pointerdown",s=>this.onPointerDown(s))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function usePresence(){const i=reactExports.useContext(PresenceContext);if(i===null)return[!0,null];const{isPresent:s,onExitComplete:o,register:a}=i,rt=reactExports.useId();reactExports.useEffect(()=>a(rt),[]);const et=reactExports.useCallback(()=>o&&o(rt),[rt,o]);return!s&&o?[!1,et]:[!0]}function useIsPresent(){return isPresent(reactExports.useContext(PresenceContext))}function isPresent(i){return i===null?!0:i.isPresent}const globalProjectionState={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function pixelsToPercent(i,s){return s.max===s.min?0:i/(s.max-s.min)*100}const correctBorderRadius={correct:(i,s)=>{if(!s.target)return i;if(typeof i=="string")if(px.test(i))i=parseFloat(i);else return i;const o=pixelsToPercent(i,s.target.x),a=pixelsToPercent(i,s.target.y);return`${o}% ${a}%`}},correctBoxShadow={correct:(i,{treeScale:s,projectionDelta:o})=>{const a=i,rt=complex.parse(i);if(rt.length>5)return a;const et=complex.createTransformer(i),ot=typeof rt[0]!="number"?1:0,at=o.x.scale*s.x,nt=o.y.scale*s.y;rt[0+ot]/=at,rt[1+ot]/=nt;const it=mixNumber$1(at,nt,.5);return typeof rt[2+ot]=="number"&&(rt[2+ot]/=it),typeof rt[3+ot]=="number"&&(rt[3+ot]/=it),et(rt)}};class MeasureLayoutWithContext extends reactExports.Component{componentDidMount(){const{visualElement:s,layoutGroup:o,switchLayoutGroup:a,layoutId:rt}=this.props,{projection:et}=s;addScaleCorrector(defaultScaleCorrectors),et&&(o.group&&o.group.add(et),a&&a.register&&rt&&a.register(et),et.root.didUpdate(),et.addEventListener("animationComplete",()=>{this.safeToRemove()}),et.setOptions({...et.options,onExitComplete:()=>this.safeToRemove()})),globalProjectionState.hasEverUpdated=!0}getSnapshotBeforeUpdate(s){const{layoutDependency:o,visualElement:a,drag:rt,isPresent:et}=this.props,ot=a.projection;return ot&&(ot.isPresent=et,rt||s.layoutDependency!==o||o===void 0?ot.willUpdate():this.safeToRemove(),s.isPresent!==et&&(et?ot.promote():ot.relegate()||frame.postRender(()=>{const at=ot.getStack();(!at||!at.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:s}=this.props.visualElement;s&&(s.root.didUpdate(),microtask.postRender(()=>{!s.currentAnimation&&s.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:s,layoutGroup:o,switchLayoutGroup:a}=this.props,{projection:rt}=s;rt&&(rt.scheduleCheckAfterUnmount(),o&&o.group&&o.group.remove(rt),a&&a.deregister&&a.deregister(rt))}safeToRemove(){const{safeToRemove:s}=this.props;s&&s()}render(){return null}}function MeasureLayout(i){const[s,o]=usePresence(),a=reactExports.useContext(LayoutGroupContext);return jsxRuntimeExports.jsx(MeasureLayoutWithContext,{...i,layoutGroup:a,switchLayoutGroup:reactExports.useContext(SwitchLayoutGroupContext),isPresent:s,safeToRemove:o})}const defaultScaleCorrectors={borderRadius:{...correctBorderRadius,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:correctBorderRadius,borderTopRightRadius:correctBorderRadius,borderBottomLeftRadius:correctBorderRadius,borderBottomRightRadius:correctBorderRadius,boxShadow:correctBoxShadow},borders=["TopLeft","TopRight","BottomLeft","BottomRight"],numBorders=borders.length,asNumber=i=>typeof i=="string"?parseFloat(i):i,isPx=i=>typeof i=="number"||px.test(i);function mixValues(i,s,o,a,rt,et){rt?(i.opacity=mixNumber$1(0,o.opacity!==void 0?o.opacity:1,easeCrossfadeIn(a)),i.opacityExit=mixNumber$1(s.opacity!==void 0?s.opacity:1,0,easeCrossfadeOut(a))):et&&(i.opacity=mixNumber$1(s.opacity!==void 0?s.opacity:1,o.opacity!==void 0?o.opacity:1,a));for(let ot=0;otas?1:o(progress(i,s,a))}function copyAxisInto(i,s){i.min=s.min,i.max=s.max}function copyBoxInto(i,s){copyAxisInto(i.x,s.x),copyAxisInto(i.y,s.y)}function copyAxisDeltaInto(i,s){i.translate=s.translate,i.scale=s.scale,i.originPoint=s.originPoint,i.origin=s.origin}function removePointDelta(i,s,o,a,rt){return i-=s,i=scalePoint(i,1/o,a),rt!==void 0&&(i=scalePoint(i,1/rt,a)),i}function removeAxisDelta(i,s=0,o=1,a=.5,rt,et=i,ot=i){if(percent.test(s)&&(s=parseFloat(s),s=mixNumber$1(ot.min,ot.max,s/100)-ot.min),typeof s!="number")return;let at=mixNumber$1(et.min,et.max,a);i===et&&(at-=s),i.min=removePointDelta(i.min,s,o,at,rt),i.max=removePointDelta(i.max,s,o,at,rt)}function removeAxisTransforms(i,s,[o,a,rt],et,ot){removeAxisDelta(i,s[o],s[a],s[rt],s.scale,et,ot)}const xKeys=["x","scaleX","originX"],yKeys=["y","scaleY","originY"];function removeBoxTransforms(i,s,o,a){removeAxisTransforms(i.x,s,xKeys,o?o.x:void 0,a?a.x:void 0),removeAxisTransforms(i.y,s,yKeys,o?o.y:void 0,a?a.y:void 0)}function isAxisDeltaZero(i){return i.translate===0&&i.scale===1}function isDeltaZero(i){return isAxisDeltaZero(i.x)&&isAxisDeltaZero(i.y)}function axisEquals(i,s){return i.min===s.min&&i.max===s.max}function boxEquals(i,s){return axisEquals(i.x,s.x)&&axisEquals(i.y,s.y)}function axisEqualsRounded(i,s){return Math.round(i.min)===Math.round(s.min)&&Math.round(i.max)===Math.round(s.max)}function boxEqualsRounded(i,s){return axisEqualsRounded(i.x,s.x)&&axisEqualsRounded(i.y,s.y)}function aspectRatio(i){return calcLength(i.x)/calcLength(i.y)}function axisDeltaEquals(i,s){return i.translate===s.translate&&i.scale===s.scale&&i.originPoint===s.originPoint}class NodeStack{constructor(){this.members=[]}add(s){addUniqueItem(this.members,s),s.scheduleRender()}remove(s){if(removeItem(this.members,s),s===this.prevLead&&(this.prevLead=void 0),s===this.lead){const o=this.members[this.members.length-1];o&&this.promote(o)}}relegate(s){const o=this.members.findIndex(rt=>s===rt);if(o===0)return!1;let a;for(let rt=o;rt>=0;rt--){const et=this.members[rt];if(et.isPresent!==!1){a=et;break}}return a?(this.promote(a),!0):!1}promote(s,o){const a=this.lead;if(s!==a&&(this.prevLead=a,this.lead=s,s.show(),a)){a.instance&&a.scheduleRender(),s.scheduleRender(),s.resumeFrom=a,o&&(s.resumeFrom.preserveOpacity=!0),a.snapshot&&(s.snapshot=a.snapshot,s.snapshot.latestValues=a.animationValues||a.latestValues),s.root&&s.root.isUpdating&&(s.isLayoutDirty=!0);const{crossfade:rt}=s.options;rt===!1&&a.hide()}}exitAnimationComplete(){this.members.forEach(s=>{const{options:o,resumingFrom:a}=s;o.onExitComplete&&o.onExitComplete(),a&&a.options.onExitComplete&&a.options.onExitComplete()})}scheduleRender(){this.members.forEach(s=>{s.instance&&s.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function buildProjectionTransform(i,s,o){let a="";const rt=i.x.translate/s.x,et=i.y.translate/s.y,ot=(o==null?void 0:o.z)||0;if((rt||et||ot)&&(a=`translate3d(${rt}px, ${et}px, ${ot}px) `),(s.x!==1||s.y!==1)&&(a+=`scale(${1/s.x}, ${1/s.y}) `),o){const{transformPerspective:it,rotate:j,rotateX:_,rotateY:$,skewX:tt,skewY:st}=o;it&&(a=`perspective(${it}px) ${a}`),j&&(a+=`rotate(${j}deg) `),_&&(a+=`rotateX(${_}deg) `),$&&(a+=`rotateY(${$}deg) `),tt&&(a+=`skewX(${tt}deg) `),st&&(a+=`skewY(${st}deg) `)}const at=i.x.scale*s.x,nt=i.y.scale*s.y;return(at!==1||nt!==1)&&(a+=`scale(${at}, ${nt})`),a||"none"}const compareByDepth=(i,s)=>i.depth-s.depth;class FlatTree{constructor(){this.children=[],this.isDirty=!1}add(s){addUniqueItem(this.children,s),this.isDirty=!0}remove(s){removeItem(this.children,s),this.isDirty=!0}forEach(s){this.isDirty&&this.children.sort(compareByDepth),this.isDirty=!1,this.children.forEach(s)}}function delay(i,s){const o=time.now(),a=({timestamp:rt})=>{const et=rt-o;et>=s&&(cancelFrame(a),i(et-s))};return frame.read(a,!0),()=>cancelFrame(a)}function isSVGElement(i){return i instanceof SVGElement&&i.tagName!=="svg"}function animateSingleValue(i,s,o){const a=isMotionValue(i)?i:motionValue(i);return a.start(animateMotionValue("",a,s,o)),a.animation}const metrics={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},isDebug=typeof window<"u"&&window.MotionDebug!==void 0,transformAxes=["","X","Y","Z"],hiddenVisibility={visibility:"hidden"},animationTarget=1e3;let id=0;function resetDistortingTransform(i,s,o,a){const{latestValues:rt}=s;rt[i]&&(o[i]=rt[i],s.setStaticValue(i,0),a&&(a[i]=0))}function isOptimisedTransformAnimationInTree(i){if(i.hasCheckedOptimisedAppear=!0,i.root===i)return!1;const{visualElement:s}=i.options;return s?window.MotionHasOptimisedTransformAnimation(getOptimisedAppearId(s))?!0:i.parent&&!i.parent.hasCheckedOptimisedAppear?isOptimisedTransformAnimationInTree(i.parent):!1:!1}function createProjectionNode({attachResizeListener:i,defaultParent:s,measureScroll:o,checkIsScrollRoot:a,resetTransform:rt}){return class{constructor(ot={},at=s==null?void 0:s()){this.id=id++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,isDebug&&(metrics.totalNodes=metrics.resolvedTargetDeltas=metrics.recalculatedProjection=0),this.nodes.forEach(propagateDirtyNodes),this.nodes.forEach(resolveTargetDelta),this.nodes.forEach(calcProjection),this.nodes.forEach(cleanDirtyNodes),isDebug&&window.MotionDebug.record(metrics)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=ot,this.root=at?at.root||at:this,this.path=at?[...at.path,at]:[],this.parent=at,this.depth=at?at.depth+1:0;for(let nt=0;ntthis.root.updateBlockedByResize=!1;i(ot,()=>{this.root.updateBlockedByResize=!0,_&&_(),_=delay($,250),globalProjectionState.hasAnimatedSinceResize&&(globalProjectionState.hasAnimatedSinceResize=!1,this.nodes.forEach(finishAnimation))})}nt&&this.root.registerSharedNode(nt,this),this.options.animate!==!1&&j&&(nt||it)&&this.addEventListener("didUpdate",({delta:_,hasLayoutChanged:$,hasRelativeTargetChanged:tt,layout:st})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const lt=this.options.transition||j.getDefaultTransition()||defaultLayoutTransition,{onLayoutAnimationStart:ct,onLayoutAnimationComplete:ht}=j.getProps(),ut=!this.targetLayout||!boxEqualsRounded(this.targetLayout,st)||tt,pt=!$&&tt;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||pt||$&&(ut||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(_,pt);const mt={...getValueTransition(lt,"layout"),onPlay:ct,onComplete:ht};(j.shouldReduceMotion||this.options.layoutRoot)&&(mt.delay=0,mt.type=!1),this.startAnimation(mt)}else $||finishAnimation(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=st})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const ot=this.getStack();ot&&ot.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,cancelFrame(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(resetSkewAndRotation),this.animationId++)}getTransformTemplate(){const{visualElement:ot}=this.options;return ot&&ot.getProps().transformTemplate}willUpdate(ot=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionHandoffCancelAll&&isOptimisedTransformAnimationInTree(this)&&window.MotionHandoffCancelAll(),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let j=0;j{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let nt=0;nt{const gt=mt/1e3;mixAxisDelta(_.x,ot.x,gt),mixAxisDelta(_.y,ot.y,gt),this.setTargetDelta(_),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(calcRelativePosition($,this.layout.layoutBox,this.relativeParent.layout.layoutBox),mixBox(this.relativeTarget,this.relativeTargetOrigin,$,gt),pt&&boxEquals(this.relativeTarget,pt)&&(this.isProjectionDirty=!1),pt||(pt=createBox()),copyBoxInto(pt,this.relativeTarget)),lt&&(this.animationValues=j,mixValues(j,it,this.latestValues,gt,ut,ht)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=gt},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(ot){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(cancelFrame(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=frame.update(()=>{globalProjectionState.hasAnimatedSinceResize=!0,this.currentAnimation=animateSingleValue(0,animationTarget,{...ot,onUpdate:at=>{this.mixTargetDelta(at),ot.onUpdate&&ot.onUpdate(at)},onComplete:()=>{ot.onComplete&&ot.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const ot=this.getStack();ot&&ot.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(animationTarget),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const ot=this.getLead();let{targetWithTransforms:at,target:nt,layout:it,latestValues:j}=ot;if(!(!at||!nt||!it)){if(this!==ot&&this.layout&&it&&shouldAnimatePositionOnly(this.options.animationType,this.layout.layoutBox,it.layoutBox)){nt=this.target||createBox();const _=calcLength(this.layout.layoutBox.x);nt.x.min=ot.target.x.min,nt.x.max=nt.x.min+_;const $=calcLength(this.layout.layoutBox.y);nt.y.min=ot.target.y.min,nt.y.max=nt.y.min+$}copyBoxInto(at,nt),transformBox(at,j),calcBoxDelta(this.projectionDeltaWithTransform,this.layoutCorrected,at,j)}}registerSharedNode(ot,at){this.sharedNodes.has(ot)||this.sharedNodes.set(ot,new NodeStack),this.sharedNodes.get(ot).add(at);const it=at.options.initialPromotionConfig;at.promote({transition:it?it.transition:void 0,preserveFollowOpacity:it&&it.shouldPreserveFollowOpacity?it.shouldPreserveFollowOpacity(at):void 0})}isLead(){const ot=this.getStack();return ot?ot.lead===this:!0}getLead(){var ot;const{layoutId:at}=this.options;return at?((ot=this.getStack())===null||ot===void 0?void 0:ot.lead)||this:this}getPrevLead(){var ot;const{layoutId:at}=this.options;return at?(ot=this.getStack())===null||ot===void 0?void 0:ot.prevLead:void 0}getStack(){const{layoutId:ot}=this.options;if(ot)return this.root.sharedNodes.get(ot)}promote({needsReset:ot,transition:at,preserveFollowOpacity:nt}={}){const it=this.getStack();it&&it.promote(this,nt),ot&&(this.projectionDelta=void 0,this.needsReset=!0),at&&this.setOptions({transition:at})}relegate(){const ot=this.getStack();return ot?ot.relegate(this):!1}resetSkewAndRotation(){const{visualElement:ot}=this.options;if(!ot)return;let at=!1;const{latestValues:nt}=ot;if((nt.z||nt.rotate||nt.rotateX||nt.rotateY||nt.rotateZ||nt.skewX||nt.skewY)&&(at=!0),!at)return;const it={};nt.z&&resetDistortingTransform("z",ot,it,this.animationValues);for(let j=0;j{var at;return(at=ot.currentAnimation)===null||at===void 0?void 0:at.stop()}),this.root.nodes.forEach(clearMeasurements),this.root.sharedNodes.clear()}}}function updateLayout(i){i.updateLayout()}function notifyLayoutUpdate(i){var s;const o=((s=i.resumeFrom)===null||s===void 0?void 0:s.snapshot)||i.snapshot;if(i.isLead()&&i.layout&&o&&i.hasListeners("didUpdate")){const{layoutBox:a,measuredBox:rt}=i.layout,{animationType:et}=i.options,ot=o.source!==i.layout.source;et==="size"?eachAxis(_=>{const $=ot?o.measuredBox[_]:o.layoutBox[_],tt=calcLength($);$.min=a[_].min,$.max=$.min+tt}):shouldAnimatePositionOnly(et,o.layoutBox,a)&&eachAxis(_=>{const $=ot?o.measuredBox[_]:o.layoutBox[_],tt=calcLength(a[_]);$.max=$.min+tt,i.relativeTarget&&!i.currentAnimation&&(i.isProjectionDirty=!0,i.relativeTarget[_].max=i.relativeTarget[_].min+tt)});const at=createDelta();calcBoxDelta(at,a,o.layoutBox);const nt=createDelta();ot?calcBoxDelta(nt,i.applyTransform(rt,!0),o.measuredBox):calcBoxDelta(nt,a,o.layoutBox);const it=!isDeltaZero(at);let j=!1;if(!i.resumeFrom){const _=i.getClosestProjectingParent();if(_&&!_.resumeFrom){const{snapshot:$,layout:tt}=_;if($&&tt){const st=createBox();calcRelativePosition(st,o.layoutBox,$.layoutBox);const lt=createBox();calcRelativePosition(lt,a,tt.layoutBox),boxEqualsRounded(st,lt)||(j=!0),_.options.layoutRoot&&(i.relativeTarget=lt,i.relativeTargetOrigin=st,i.relativeParent=_)}}}i.notifyListeners("didUpdate",{layout:a,snapshot:o,delta:nt,layoutDelta:at,hasLayoutChanged:it,hasRelativeTargetChanged:j})}else if(i.isLead()){const{onExitComplete:a}=i.options;a&&a()}i.options.transition=void 0}function propagateDirtyNodes(i){isDebug&&metrics.totalNodes++,i.parent&&(i.isProjecting()||(i.isProjectionDirty=i.parent.isProjectionDirty),i.isSharedProjectionDirty||(i.isSharedProjectionDirty=!!(i.isProjectionDirty||i.parent.isProjectionDirty||i.parent.isSharedProjectionDirty)),i.isTransformDirty||(i.isTransformDirty=i.parent.isTransformDirty))}function cleanDirtyNodes(i){i.isProjectionDirty=i.isSharedProjectionDirty=i.isTransformDirty=!1}function clearSnapshot(i){i.clearSnapshot()}function clearMeasurements(i){i.clearMeasurements()}function clearIsLayoutDirty(i){i.isLayoutDirty=!1}function resetTransformStyle(i){const{visualElement:s}=i.options;s&&s.getProps().onBeforeLayoutMeasure&&s.notify("BeforeLayoutMeasure"),i.resetTransform()}function finishAnimation(i){i.finishAnimation(),i.targetDelta=i.relativeTarget=i.target=void 0,i.isProjectionDirty=!0}function resolveTargetDelta(i){i.resolveTargetDelta()}function calcProjection(i){i.calcProjection()}function resetSkewAndRotation(i){i.resetSkewAndRotation()}function removeLeadSnapshots(i){i.removeLeadSnapshot()}function mixAxisDelta(i,s,o){i.translate=mixNumber$1(s.translate,0,o),i.scale=mixNumber$1(s.scale,1,o),i.origin=s.origin,i.originPoint=s.originPoint}function mixAxis(i,s,o,a){i.min=mixNumber$1(s.min,o.min,a),i.max=mixNumber$1(s.max,o.max,a)}function mixBox(i,s,o,a){mixAxis(i.x,s.x,o.x,a),mixAxis(i.y,s.y,o.y,a)}function hasOpacityCrossfade(i){return i.animationValues&&i.animationValues.opacityExit!==void 0}const defaultLayoutTransition={duration:.45,ease:[.4,0,.1,1]},userAgentContains=i=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(i),roundPoint=userAgentContains("applewebkit/")&&!userAgentContains("chrome/")?Math.round:noop$1;function roundAxis(i){i.min=roundPoint(i.min),i.max=roundPoint(i.max)}function roundBox(i){roundAxis(i.x),roundAxis(i.y)}function shouldAnimatePositionOnly(i,s,o){return i==="position"||i==="preserve-aspect"&&!isNear(aspectRatio(s),aspectRatio(o),.2)}function checkNodeWasScrollRoot(i){var s;return i!==i.root&&((s=i.scroll)===null||s===void 0?void 0:s.wasRoot)}const DocumentProjectionNode=createProjectionNode({attachResizeListener:(i,s)=>addDomEvent(i,"resize",s),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),rootProjectionNode={current:void 0},HTMLProjectionNode=createProjectionNode({measureScroll:i=>({x:i.scrollLeft,y:i.scrollTop}),defaultParent:()=>{if(!rootProjectionNode.current){const i=new DocumentProjectionNode({});i.mount(window),i.setOptions({layoutScroll:!0}),rootProjectionNode.current=i}return rootProjectionNode.current},resetTransform:(i,s)=>{i.style.transform=s!==void 0?s:"none"},checkIsScrollRoot:i=>window.getComputedStyle(i).position==="fixed"}),drag={pan:{Feature:PanGesture},drag:{Feature:DragGesture,ProjectionNode:HTMLProjectionNode,MeasureLayout}},prefersReducedMotion={current:null},hasReducedMotionListener={current:!1};function initPrefersReducedMotion(){if(hasReducedMotionListener.current=!0,!!isBrowser)if(window.matchMedia){const i=window.matchMedia("(prefers-reduced-motion)"),s=()=>prefersReducedMotion.current=i.matches;i.addListener(s),s()}else prefersReducedMotion.current=!1}function updateMotionValuesFromProps(i,s,o){for(const a in s){const rt=s[a],et=o[a];if(isMotionValue(rt))i.addValue(a,rt);else if(isMotionValue(et))i.addValue(a,motionValue(rt,{owner:i}));else if(et!==rt)if(i.hasValue(a)){const ot=i.getValue(a);ot.liveStyle===!0?ot.jump(rt):ot.hasAnimated||ot.set(rt)}else{const ot=i.getStaticValue(a);i.addValue(a,motionValue(ot!==void 0?ot:rt,{owner:i}))}}for(const a in o)s[a]===void 0&&i.removeValue(a);return s}const visualElementStore=new WeakMap,valueTypes=[...dimensionValueTypes,color,complex],findValueType=i=>valueTypes.find(testValueType(i)),propEventHandlers=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],numVariantProps=variantProps.length;class VisualElement{scrapeMotionValuesFromProps(s,o,a){return{}}constructor({parent:s,props:o,presenceContext:a,reducedMotionConfig:rt,blockInitialAnimation:et,visualState:ot},at={}){this.applyWillChange=!1,this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=KeyframeResolver,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.isRenderScheduled=!1,this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.isRenderScheduled=!1,this.scheduleRender=()=>{this.isRenderScheduled||(this.isRenderScheduled=!0,frame.render(this.render,!1,!0))};const{latestValues:nt,renderState:it}=ot;this.latestValues=nt,this.baseTarget={...nt},this.initialValues=o.initial?{...nt}:{},this.renderState=it,this.parent=s,this.props=o,this.presenceContext=a,this.depth=s?s.depth+1:0,this.reducedMotionConfig=rt,this.options=at,this.blockInitialAnimation=!!et,this.isControllingVariants=isControllingVariants(o),this.isVariantNode=isVariantNode(o),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(s&&s.current);const{willChange:j,..._}=this.scrapeMotionValuesFromProps(o,{},this);for(const $ in _){const tt=_[$];nt[$]!==void 0&&isMotionValue(tt)&&tt.set(nt[$],!1)}}mount(s){this.current=s,visualElementStore.set(s,this),this.projection&&!this.projection.instance&&this.projection.mount(s),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((o,a)=>this.bindToMotionValue(a,o)),hasReducedMotionListener.current||initPrefersReducedMotion(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:prefersReducedMotion.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){visualElementStore.delete(this.current),this.projection&&this.projection.unmount(),cancelFrame(this.notifyUpdate),cancelFrame(this.render),this.valueSubscriptions.forEach(s=>s()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const s in this.events)this.events[s].clear();for(const s in this.features){const o=this.features[s];o&&(o.unmount(),o.isMounted=!1)}this.current=null}bindToMotionValue(s,o){const a=transformProps.has(s),rt=o.on("change",ot=>{this.latestValues[s]=ot,this.props.onUpdate&&frame.preRender(this.notifyUpdate),a&&this.projection&&(this.projection.isTransformDirty=!0)}),et=o.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(s,()=>{rt(),et(),o.owner&&o.stop()})}sortNodePosition(s){return!this.current||!this.sortInstanceNodePosition||this.type!==s.type?0:this.sortInstanceNodePosition(this.current,s.current)}updateFeatures(){let s="animation";for(s in featureDefinitions){const o=featureDefinitions[s];if(!o)continue;const{isEnabled:a,Feature:rt}=o;if(!this.features[s]&&rt&&a(this.props)&&(this.features[s]=new rt(this)),this.features[s]){const et=this.features[s];et.isMounted?et.update():(et.mount(),et.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):createBox()}getStaticValue(s){return this.latestValues[s]}setStaticValue(s,o){this.latestValues[s]=o}update(s,o){(s.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=s,this.prevPresenceContext=this.presenceContext,this.presenceContext=o;for(let a=0;ao.variantChildren.delete(s)}addValue(s,o){const a=this.values.get(s);o!==a&&(a&&this.removeValue(s),this.bindToMotionValue(s,o),this.values.set(s,o),this.latestValues[s]=o.get())}removeValue(s){this.values.delete(s);const o=this.valueSubscriptions.get(s);o&&(o(),this.valueSubscriptions.delete(s)),delete this.latestValues[s],this.removeValueFromRenderState(s,this.renderState)}hasValue(s){return this.values.has(s)}getValue(s,o){if(this.props.values&&this.props.values[s])return this.props.values[s];let a=this.values.get(s);return a===void 0&&o!==void 0&&(a=motionValue(o===null?void 0:o,{owner:this}),this.addValue(s,a)),a}readValue(s,o){var a;let rt=this.latestValues[s]!==void 0||!this.current?this.latestValues[s]:(a=this.getBaseTargetFromProps(this.props,s))!==null&&a!==void 0?a:this.readValueFromInstance(this.current,s,this.options);return rt!=null&&(typeof rt=="string"&&(isNumericalString(rt)||isZeroValueString(rt))?rt=parseFloat(rt):!findValueType(rt)&&complex.test(o)&&(rt=getAnimatableNone(s,o)),this.setBaseTarget(s,isMotionValue(rt)?rt.get():rt)),isMotionValue(rt)?rt.get():rt}setBaseTarget(s,o){this.baseTarget[s]=o}getBaseTarget(s){var o;const{initial:a}=this.props;let rt;if(typeof a=="string"||typeof a=="object"){const ot=resolveVariantFromProps(this.props,a,(o=this.presenceContext)===null||o===void 0?void 0:o.custom);ot&&(rt=ot[s])}if(a&&rt!==void 0)return rt;const et=this.getBaseTargetFromProps(this.props,s);return et!==void 0&&!isMotionValue(et)?et:this.initialValues[s]!==void 0&&rt===void 0?void 0:this.baseTarget[s]}on(s,o){return this.events[s]||(this.events[s]=new SubscriptionManager),this.events[s].add(o)}notify(s,...o){this.events[s]&&this.events[s].notify(...o)}}class DOMVisualElement extends VisualElement{constructor(){super(...arguments),this.KeyframeResolver=DOMKeyframesResolver}sortInstanceNodePosition(s,o){return s.compareDocumentPosition(o)&2?1:-1}getBaseTargetFromProps(s,o){return s.style?s.style[o]:void 0}removeValueFromRenderState(s,{vars:o,style:a}){delete o[s],delete a[s]}}function getComputedStyle(i){return window.getComputedStyle(i)}class HTMLVisualElement extends DOMVisualElement{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=renderHTML}readValueFromInstance(s,o){if(transformProps.has(o)){const a=getDefaultValueType(o);return a&&a.default||0}else{const a=getComputedStyle(s),rt=(isCSSVariableName(o)?a.getPropertyValue(o):a[o])||0;return typeof rt=="string"?rt.trim():rt}}measureInstanceViewportBox(s,{transformPagePoint:o}){return measureViewportBox(s,o)}build(s,o,a){buildHTMLStyles(s,o,a.transformTemplate)}scrapeMotionValuesFromProps(s,o,a){return scrapeMotionValuesFromProps$1(s,o,a)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:s}=this.props;isMotionValue(s)&&(this.childSubscription=s.on("change",o=>{this.current&&(this.current.textContent=`${o}`)}))}}class SVGVisualElement extends DOMVisualElement{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=createBox}getBaseTargetFromProps(s,o){return s[o]}readValueFromInstance(s,o){if(transformProps.has(o)){const a=getDefaultValueType(o);return a&&a.default||0}return o=camelCaseAttributes.has(o)?o:camelToDash(o),s.getAttribute(o)}scrapeMotionValuesFromProps(s,o,a){return scrapeMotionValuesFromProps(s,o,a)}build(s,o,a){buildSVGAttrs(s,o,this.isSVGTag,a.transformTemplate)}renderInstance(s,o,a,rt){renderSVG(s,o,a,rt)}mount(s){this.isSVGTag=isSVGTag(s.tagName),super.mount(s)}}const createDomVisualElement=(i,s)=>isSVGComponent(i)?new SVGVisualElement(s):new HTMLVisualElement(s,{allowProjection:i!==reactExports.Fragment}),layout={layout:{ProjectionNode:HTMLProjectionNode,MeasureLayout}},preloadedFeatures={...animations,...gestureAnimations,...drag,...layout},motion=createMotionProxy((i,s)=>createDomMotionConfig(i,s,preloadedFeatures,createDomVisualElement));class PopChildMeasure extends reactExports.Component{getSnapshotBeforeUpdate(s){const o=this.props.childRef.current;if(o&&s.isPresent&&!this.props.isPresent){const a=this.props.sizeRef.current;a.height=o.offsetHeight||0,a.width=o.offsetWidth||0,a.top=o.offsetTop,a.left=o.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function PopChild({children:i,isPresent:s}){const o=reactExports.useId(),a=reactExports.useRef(null),rt=reactExports.useRef({width:0,height:0,top:0,left:0}),{nonce:et}=reactExports.useContext(MotionConfigContext);return reactExports.useInsertionEffect(()=>{const{width:ot,height:at,top:nt,left:it}=rt.current;if(s||!a.current||!ot||!at)return;a.current.dataset.motionPopId=o;const j=document.createElement("style");return et&&(j.nonce=et),document.head.appendChild(j),j.sheet&&j.sheet.insertRule(` + )`;return{...!a&&rt&&tt,...a?{bgImage:at}:{bgColor:ot}}},baseStyleLabel$3={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},baseStyleTrack$1=i=>({bg:mode("gray.100","whiteAlpha.300")(i)}),baseStyleFilledTrack$1=i=>({transitionProperty:"common",transitionDuration:"slow",...filledStyle(i)}),baseStyle$w=definePartsStyle$j(i=>({label:baseStyleLabel$3,filledTrack:baseStyleFilledTrack$1(i),track:baseStyleTrack$1(i)})),sizes$f={xs:definePartsStyle$j({track:{h:"1"}}),sm:definePartsStyle$j({track:{h:"2"}}),md:definePartsStyle$j({track:{h:"3"}}),lg:definePartsStyle$j({track:{h:"4"}})},progressTheme=defineMultiStyleConfig$j({sizes:sizes$f,baseStyle:baseStyle$w,defaultProps:{size:"md",colorScheme:"blue"}}),isFunction$3=i=>typeof i=="function";function runIfFn$1(i,...s){return isFunction$3(i)?i(...s):i}var{definePartsStyle:definePartsStyle$i,defineMultiStyleConfig:defineMultiStyleConfig$i}=createMultiStyleConfigHelpers(checkboxAnatomy.keys),$size$3=cssVar$1("checkbox-size"),baseStyleControl$1=i=>{const{colorScheme:s}=i;return{w:$size$3.reference,h:$size$3.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:mode(`${s}.500`,`${s}.200`)(i),borderColor:mode(`${s}.500`,`${s}.200`)(i),color:mode("white","gray.900")(i),_hover:{bg:mode(`${s}.600`,`${s}.300`)(i),borderColor:mode(`${s}.600`,`${s}.300`)(i)},_disabled:{borderColor:mode("gray.200","transparent")(i),bg:mode("gray.200","whiteAlpha.300")(i),color:mode("gray.500","whiteAlpha.500")(i)}},_indeterminate:{bg:mode(`${s}.500`,`${s}.200`)(i),borderColor:mode(`${s}.500`,`${s}.200`)(i),color:mode("white","gray.900")(i)},_disabled:{bg:mode("gray.100","whiteAlpha.100")(i),borderColor:mode("gray.100","transparent")(i)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:mode("red.500","red.300")(i)}}},baseStyleContainer$3={_disabled:{cursor:"not-allowed"}},baseStyleLabel$2={userSelect:"none",_disabled:{opacity:.4}},baseStyleIcon$6={transitionProperty:"transform",transitionDuration:"normal"},baseStyle$v=definePartsStyle$i(i=>({icon:baseStyleIcon$6,container:baseStyleContainer$3,control:runIfFn$1(baseStyleControl$1,i),label:baseStyleLabel$2})),sizes$e={sm:definePartsStyle$i({control:{[$size$3.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:definePartsStyle$i({control:{[$size$3.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:definePartsStyle$i({control:{[$size$3.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},checkboxTheme=defineMultiStyleConfig$i({baseStyle:baseStyle$v,sizes:sizes$e,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:defineMultiStyleConfig$h,definePartsStyle:definePartsStyle$h}=createMultiStyleConfigHelpers(radioAnatomy.keys),baseStyleControl=i=>{var s;const o=(s=runIfFn$1(checkboxTheme.baseStyle,i))==null?void 0:s.control;return{...o,borderRadius:"full",_checked:{...o==null?void 0:o._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},baseStyle$u=definePartsStyle$h(i=>{var s,o,a,rt;return{label:(o=(s=checkboxTheme).baseStyle)==null?void 0:o.call(s,i).label,container:(rt=(a=checkboxTheme).baseStyle)==null?void 0:rt.call(a,i).container,control:baseStyleControl(i)}}),sizes$d={md:definePartsStyle$h({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:definePartsStyle$h({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:definePartsStyle$h({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},radioTheme=defineMultiStyleConfig$h({baseStyle:baseStyle$u,sizes:sizes$d,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:defineMultiStyleConfig$g,definePartsStyle:definePartsStyle$g}=createMultiStyleConfigHelpers(selectAnatomy.keys),$bg$b=cssVar$1("select-bg"),_a$3,baseStyleField$1={...(_a$3=inputTheme.baseStyle)==null?void 0:_a$3.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:$bg$b.reference,[$bg$b.variable]:"colors.white",_dark:{[$bg$b.variable]:"colors.gray.700"},"> option, > optgroup":{bg:$bg$b.reference}},baseStyleIcon$5={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},baseStyle$t=definePartsStyle$g({field:baseStyleField$1,icon:baseStyleIcon$5}),iconSpacing={paddingInlineEnd:"8"},_a2$1,_b$1,_c,_d,_e,_f,_g,_h,sizes$c={lg:{...(_a2$1=inputTheme.sizes)==null?void 0:_a2$1.lg,field:{...(_b$1=inputTheme.sizes)==null?void 0:_b$1.lg.field,...iconSpacing}},md:{...(_c=inputTheme.sizes)==null?void 0:_c.md,field:{...(_d=inputTheme.sizes)==null?void 0:_d.md.field,...iconSpacing}},sm:{...(_e=inputTheme.sizes)==null?void 0:_e.sm,field:{...(_f=inputTheme.sizes)==null?void 0:_f.sm.field,...iconSpacing}},xs:{...(_g=inputTheme.sizes)==null?void 0:_g.xs,field:{...(_h=inputTheme.sizes)==null?void 0:_h.xs.field,...iconSpacing},icon:{insetEnd:"1"}}},selectTheme=defineMultiStyleConfig$g({baseStyle:baseStyle$t,sizes:sizes$c,variants:inputTheme.variants,defaultProps:inputTheme.defaultProps}),$startColor=cssVar$1("skeleton-start-color"),$endColor=cssVar$1("skeleton-end-color"),baseStyle$s={[$startColor.variable]:"colors.gray.100",[$endColor.variable]:"colors.gray.400",_dark:{[$startColor.variable]:"colors.gray.800",[$endColor.variable]:"colors.gray.600"},background:$startColor.reference,borderColor:$endColor.reference,opacity:.7,borderRadius:"sm"},skeletonTheme={baseStyle:baseStyle$s},$bg$a=cssVar$1("skip-link-bg"),baseStyle$r={borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[$bg$a.variable]:"colors.white",_dark:{[$bg$a.variable]:"colors.gray.700"},bg:$bg$a.reference}},skipLinkTheme={baseStyle:baseStyle$r},{defineMultiStyleConfig:defineMultiStyleConfig$f,definePartsStyle:definePartsStyle$f}=createMultiStyleConfigHelpers(sliderAnatomy.keys),$thumbSize=cssVar$1("slider-thumb-size"),$trackSize=cssVar$1("slider-track-size"),$bg$9=cssVar$1("slider-bg"),baseStyleContainer$2=i=>{const{orientation:s}=i;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...orient({orientation:s,vertical:{h:"100%"},horizontal:{w:"100%"}})}},baseStyleTrack=i=>({...orient({orientation:i.orientation,horizontal:{h:$trackSize.reference},vertical:{w:$trackSize.reference}}),overflow:"hidden",borderRadius:"sm",[$bg$9.variable]:"colors.gray.200",_dark:{[$bg$9.variable]:"colors.whiteAlpha.200"},_disabled:{[$bg$9.variable]:"colors.gray.300",_dark:{[$bg$9.variable]:"colors.whiteAlpha.300"}},bg:$bg$9.reference}),baseStyleThumb=i=>{const{orientation:s}=i;return{...orient({orientation:s,vertical:{left:"50%",transform:"translateX(-50%)",_active:{transform:"translateX(-50%) scale(1.15)"}},horizontal:{top:"50%",transform:"translateY(-50%)",_active:{transform:"translateY(-50%) scale(1.15)"}}}),w:$thumbSize.reference,h:$thumbSize.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{bg:"gray.300"}}},baseStyleFilledTrack=i=>{const{colorScheme:s}=i;return{width:"inherit",height:"inherit",[$bg$9.variable]:`colors.${s}.500`,_dark:{[$bg$9.variable]:`colors.${s}.200`},bg:$bg$9.reference}},baseStyle$q=definePartsStyle$f(i=>({container:baseStyleContainer$2(i),track:baseStyleTrack(i),thumb:baseStyleThumb(i),filledTrack:baseStyleFilledTrack(i)})),sizeLg=definePartsStyle$f({container:{[$thumbSize.variable]:"sizes.4",[$trackSize.variable]:"sizes.1"}}),sizeMd=definePartsStyle$f({container:{[$thumbSize.variable]:"sizes.3.5",[$trackSize.variable]:"sizes.1"}}),sizeSm=definePartsStyle$f({container:{[$thumbSize.variable]:"sizes.2.5",[$trackSize.variable]:"sizes.0.5"}}),sizes$b={lg:sizeLg,md:sizeMd,sm:sizeSm},sliderTheme=defineMultiStyleConfig$f({baseStyle:baseStyle$q,sizes:sizes$b,defaultProps:{size:"md",colorScheme:"blue"}}),$size$2=cssVar("spinner-size"),baseStyle$p={width:[$size$2.reference],height:[$size$2.reference]},sizes$a={xs:{[$size$2.variable]:"sizes.3"},sm:{[$size$2.variable]:"sizes.4"},md:{[$size$2.variable]:"sizes.6"},lg:{[$size$2.variable]:"sizes.8"},xl:{[$size$2.variable]:"sizes.12"}},spinnerTheme={baseStyle:baseStyle$p,sizes:sizes$a,defaultProps:{size:"md"}},{defineMultiStyleConfig:defineMultiStyleConfig$e,definePartsStyle:definePartsStyle$e}=createMultiStyleConfigHelpers(statAnatomy.keys),baseStyleLabel$1={fontWeight:"medium"},baseStyleHelpText={opacity:.8,marginBottom:"2"},baseStyleNumber={verticalAlign:"baseline",fontWeight:"semibold"},baseStyleIcon$4={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},baseStyle$o=definePartsStyle$e({container:{},label:baseStyleLabel$1,helpText:baseStyleHelpText,number:baseStyleNumber,icon:baseStyleIcon$4}),sizes$9={md:definePartsStyle$e({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},statTheme=defineMultiStyleConfig$e({baseStyle:baseStyle$o,sizes:sizes$9,defaultProps:{size:"md"}}),$bg$8=cssVar$1("kbd-bg"),baseStyle$n={[$bg$8.variable]:"colors.gray.100",_dark:{[$bg$8.variable]:"colors.whiteAlpha.100"},bg:$bg$8.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"},kbdTheme={baseStyle:baseStyle$n},baseStyle$m={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},linkTheme={baseStyle:baseStyle$m},{defineMultiStyleConfig:defineMultiStyleConfig$d,definePartsStyle:definePartsStyle$d}=createMultiStyleConfigHelpers(listAnatomy.keys),baseStyleIcon$3={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},baseStyle$l=definePartsStyle$d({icon:baseStyleIcon$3}),listTheme=defineMultiStyleConfig$d({baseStyle:baseStyle$l}),{defineMultiStyleConfig:defineMultiStyleConfig$c,definePartsStyle:definePartsStyle$c}=createMultiStyleConfigHelpers(menuAnatomy.keys),$bg$7=cssVar$1("menu-bg"),$shadow$2=cssVar$1("menu-shadow"),baseStyleList={[$bg$7.variable]:"#fff",[$shadow$2.variable]:"shadows.sm",_dark:{[$bg$7.variable]:"colors.gray.700",[$shadow$2.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:1,borderRadius:"md",borderWidth:"1px",bg:$bg$7.reference,boxShadow:$shadow$2.reference},baseStyleItem={py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[$bg$7.variable]:"colors.gray.100",_dark:{[$bg$7.variable]:"colors.whiteAlpha.100"}},_active:{[$bg$7.variable]:"colors.gray.200",_dark:{[$bg$7.variable]:"colors.whiteAlpha.200"}},_expanded:{[$bg$7.variable]:"colors.gray.100",_dark:{[$bg$7.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:$bg$7.reference},baseStyleGroupTitle={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},baseStyleIcon$2={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},baseStyleCommand={opacity:.6},baseStyleDivider={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},baseStyleButton$1={transitionProperty:"common",transitionDuration:"normal"},baseStyle$k=definePartsStyle$c({button:baseStyleButton$1,list:baseStyleList,item:baseStyleItem,groupTitle:baseStyleGroupTitle,icon:baseStyleIcon$2,command:baseStyleCommand,divider:baseStyleDivider}),menuTheme=defineMultiStyleConfig$c({baseStyle:baseStyle$k}),{defineMultiStyleConfig:defineMultiStyleConfig$b,definePartsStyle:definePartsStyle$b}=createMultiStyleConfigHelpers(modalAnatomy.keys),$bg$6=cssVar$1("modal-bg"),$shadow$1=cssVar$1("modal-shadow"),baseStyleOverlay$1={bg:"blackAlpha.600",zIndex:"modal"},baseStyleDialogContainer$1=i=>{const{isCentered:s,scrollBehavior:o}=i;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:s?"center":"flex-start",overflow:o==="inside"?"hidden":"auto",overscrollBehaviorY:"none"}},baseStyleDialog$1=i=>{const{isCentered:s,scrollBehavior:o}=i;return{borderRadius:"md",color:"inherit",my:s?"auto":"16",mx:s?"auto":void 0,zIndex:"modal",maxH:o==="inside"?"calc(100% - 7.5rem)":void 0,[$bg$6.variable]:"colors.white",[$shadow$1.variable]:"shadows.lg",_dark:{[$bg$6.variable]:"colors.gray.700",[$shadow$1.variable]:"shadows.dark-lg"},bg:$bg$6.reference,boxShadow:$shadow$1.reference}},baseStyleHeader$2={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},baseStyleCloseButton$2={position:"absolute",top:"2",insetEnd:"3"},baseStyleBody$2=i=>{const{scrollBehavior:s}=i;return{px:"6",py:"2",flex:"1",overflow:s==="inside"?"auto":void 0}},baseStyleFooter$2={px:"6",py:"4"},baseStyle$j=definePartsStyle$b(i=>({overlay:baseStyleOverlay$1,dialogContainer:runIfFn$1(baseStyleDialogContainer$1,i),dialog:runIfFn$1(baseStyleDialog$1,i),header:baseStyleHeader$2,closeButton:baseStyleCloseButton$2,body:runIfFn$1(baseStyleBody$2,i),footer:baseStyleFooter$2}));function getSize$3(i){return definePartsStyle$b(i==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:i}})}var sizes$8={xs:getSize$3("xs"),sm:getSize$3("sm"),md:getSize$3("md"),lg:getSize$3("lg"),xl:getSize$3("xl"),"2xl":getSize$3("2xl"),"3xl":getSize$3("3xl"),"4xl":getSize$3("4xl"),"5xl":getSize$3("5xl"),"6xl":getSize$3("6xl"),full:getSize$3("full")},modalTheme=defineMultiStyleConfig$b({baseStyle:baseStyle$j,sizes:sizes$8,defaultProps:{size:"md"}}),{defineMultiStyleConfig:defineMultiStyleConfig$a,definePartsStyle:definePartsStyle$a}=createMultiStyleConfigHelpers(numberInputAnatomy.keys),$stepperWidth=cssVar("number-input-stepper-width"),$inputPadding=cssVar("number-input-input-padding"),inputPaddingValue=calc($stepperWidth).add("0.5rem").toString(),$bg$5=cssVar("number-input-bg"),$fg$3=cssVar("number-input-color"),$border$2=cssVar("number-input-border-color"),baseStyleRoot={[$stepperWidth.variable]:"sizes.6",[$inputPadding.variable]:inputPaddingValue},baseStyleField=i=>{var s,o;return(o=(s=runIfFn$1(inputTheme.baseStyle,i))==null?void 0:s.field)!=null?o:{}},baseStyleStepperGroup={width:$stepperWidth.reference},baseStyleStepper={borderStart:"1px solid",borderStartColor:$border$2.reference,color:$fg$3.reference,bg:$bg$5.reference,[$fg$3.variable]:"colors.chakra-body-text",[$border$2.variable]:"colors.chakra-border-color",_dark:{[$fg$3.variable]:"colors.whiteAlpha.800",[$border$2.variable]:"colors.whiteAlpha.300"},_active:{[$bg$5.variable]:"colors.gray.200",_dark:{[$bg$5.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}},baseStyle$i=definePartsStyle$a(i=>{var s;return{root:baseStyleRoot,field:(s=runIfFn$1(baseStyleField,i))!=null?s:{},stepperGroup:baseStyleStepperGroup,stepper:baseStyleStepper}});function getSize$2(i){var s,o,a;const rt=(s=inputTheme.sizes)==null?void 0:s[i],tt={lg:"md",md:"md",sm:"sm",xs:"sm"},ot=(a=(o=rt.field)==null?void 0:o.fontSize)!=null?a:"md",at=typography_default.fontSizes[ot];return definePartsStyle$a({field:{...rt.field,paddingInlineEnd:$inputPadding.reference,verticalAlign:"top"},stepper:{fontSize:calc(at).multiply(.75).toString(),_first:{borderTopEndRadius:tt[i]},_last:{borderBottomEndRadius:tt[i],mt:"-1px",borderTopWidth:1}}})}var sizes$7={xs:getSize$2("xs"),sm:getSize$2("sm"),md:getSize$2("md"),lg:getSize$2("lg")},numberInputTheme=defineMultiStyleConfig$a({baseStyle:baseStyle$i,sizes:sizes$7,variants:inputTheme.variants,defaultProps:inputTheme.defaultProps}),_a$2,baseStyle$h={...(_a$2=inputTheme.baseStyle)==null?void 0:_a$2.field,textAlign:"center"},sizes$6={lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}},_a2,_b,variants$8={outline:i=>{var s,o,a;return(a=(o=runIfFn$1((s=inputTheme.variants)==null?void 0:s.outline,i))==null?void 0:o.field)!=null?a:{}},flushed:i=>{var s,o,a;return(a=(o=runIfFn$1((s=inputTheme.variants)==null?void 0:s.flushed,i))==null?void 0:o.field)!=null?a:{}},filled:i=>{var s,o,a;return(a=(o=runIfFn$1((s=inputTheme.variants)==null?void 0:s.filled,i))==null?void 0:o.field)!=null?a:{}},unstyled:(_b=(_a2=inputTheme.variants)==null?void 0:_a2.unstyled.field)!=null?_b:{}},pinInputTheme={baseStyle:baseStyle$h,sizes:sizes$6,variants:variants$8,defaultProps:inputTheme.defaultProps},{defineMultiStyleConfig:defineMultiStyleConfig$9,definePartsStyle:definePartsStyle$9}=createMultiStyleConfigHelpers(popoverAnatomy.keys),$popperBg=cssVar("popper-bg"),$arrowBg=cssVar("popper-arrow-bg"),$arrowShadowColor=cssVar("popper-arrow-shadow-color"),baseStylePopper={zIndex:10},baseStyleContent={[$popperBg.variable]:"colors.white",bg:$popperBg.reference,[$arrowBg.variable]:$popperBg.reference,[$arrowShadowColor.variable]:"colors.gray.200",_dark:{[$popperBg.variable]:"colors.gray.700",[$arrowShadowColor.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},baseStyleHeader$1={px:3,py:2,borderBottomWidth:"1px"},baseStyleBody$1={px:3,py:2},baseStyleFooter$1={px:3,py:2,borderTopWidth:"1px"},baseStyleCloseButton$1={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},baseStyle$g=definePartsStyle$9({popper:baseStylePopper,content:baseStyleContent,header:baseStyleHeader$1,body:baseStyleBody$1,footer:baseStyleFooter$1,closeButton:baseStyleCloseButton$1}),popoverTheme=defineMultiStyleConfig$9({baseStyle:baseStyle$g}),{definePartsStyle:definePartsStyle$8,defineMultiStyleConfig:defineMultiStyleConfig$8}=createMultiStyleConfigHelpers(drawerAnatomy.keys),$bg$4=cssVar$1("drawer-bg"),$bs=cssVar$1("drawer-box-shadow");function getSize$1(i){return definePartsStyle$8(i==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:i}})}var baseStyleOverlay={bg:"blackAlpha.600",zIndex:"modal"},baseStyleDialogContainer={display:"flex",zIndex:"modal",justifyContent:"center"},baseStyleDialog=i=>{const{isFullHeight:s}=i;return{...s&&{height:"100vh"},zIndex:"modal",maxH:"100vh",color:"inherit",[$bg$4.variable]:"colors.white",[$bs.variable]:"shadows.lg",_dark:{[$bg$4.variable]:"colors.gray.700",[$bs.variable]:"shadows.dark-lg"},bg:$bg$4.reference,boxShadow:$bs.reference}},baseStyleHeader={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},baseStyleCloseButton={position:"absolute",top:"2",insetEnd:"3"},baseStyleBody={px:"6",py:"2",flex:"1",overflow:"auto"},baseStyleFooter={px:"6",py:"4"},baseStyle$f=definePartsStyle$8(i=>({overlay:baseStyleOverlay,dialogContainer:baseStyleDialogContainer,dialog:runIfFn$1(baseStyleDialog,i),header:baseStyleHeader,closeButton:baseStyleCloseButton,body:baseStyleBody,footer:baseStyleFooter})),sizes$5={xs:getSize$1("xs"),sm:getSize$1("md"),md:getSize$1("lg"),lg:getSize$1("2xl"),xl:getSize$1("4xl"),full:getSize$1("full")},drawerTheme=defineMultiStyleConfig$8({baseStyle:baseStyle$f,sizes:sizes$5,defaultProps:{size:"xs"}}),{definePartsStyle:definePartsStyle$7,defineMultiStyleConfig:defineMultiStyleConfig$7}=createMultiStyleConfigHelpers(editableAnatomy.keys),baseStylePreview={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},baseStyleInput={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},baseStyleTextarea={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},baseStyle$e=definePartsStyle$7({preview:baseStylePreview,input:baseStyleInput,textarea:baseStyleTextarea}),editableTheme=defineMultiStyleConfig$7({baseStyle:baseStyle$e}),{definePartsStyle:definePartsStyle$6,defineMultiStyleConfig:defineMultiStyleConfig$6}=createMultiStyleConfigHelpers(formAnatomy.keys),$fg$2=cssVar$1("form-control-color"),baseStyleRequiredIndicator={marginStart:"1",[$fg$2.variable]:"colors.red.500",_dark:{[$fg$2.variable]:"colors.red.300"},color:$fg$2.reference},baseStyleHelperText={mt:"2",[$fg$2.variable]:"colors.gray.600",_dark:{[$fg$2.variable]:"colors.whiteAlpha.600"},color:$fg$2.reference,lineHeight:"normal",fontSize:"sm"},baseStyle$d=definePartsStyle$6({container:{width:"100%",position:"relative"},requiredIndicator:baseStyleRequiredIndicator,helperText:baseStyleHelperText}),formTheme=defineMultiStyleConfig$6({baseStyle:baseStyle$d}),{definePartsStyle:definePartsStyle$5,defineMultiStyleConfig:defineMultiStyleConfig$5}=createMultiStyleConfigHelpers(formErrorAnatomy.keys),$fg$1=cssVar$1("form-error-color"),baseStyleText={[$fg$1.variable]:"colors.red.500",_dark:{[$fg$1.variable]:"colors.red.300"},color:$fg$1.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},baseStyleIcon$1={marginEnd:"0.5em",[$fg$1.variable]:"colors.red.500",_dark:{[$fg$1.variable]:"colors.red.300"},color:$fg$1.reference},baseStyle$c=definePartsStyle$5({text:baseStyleText,icon:baseStyleIcon$1}),formErrorTheme=defineMultiStyleConfig$5({baseStyle:baseStyle$c}),baseStyle$b={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},formLabelTheme={baseStyle:baseStyle$b},baseStyle$a={fontFamily:"heading",fontWeight:"bold"},sizes$4={"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},headingTheme={baseStyle:baseStyle$a,sizes:sizes$4,defaultProps:{size:"xl"}},{defineMultiStyleConfig:defineMultiStyleConfig$4,definePartsStyle:definePartsStyle$4}=createMultiStyleConfigHelpers(breadcrumbAnatomy.keys),$decor=cssVar$1("breadcrumb-link-decor"),baseStyleLink={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",outline:"none",color:"inherit",textDecoration:$decor.reference,[$decor.variable]:"none","&:not([aria-current=page])":{cursor:"pointer",_hover:{[$decor.variable]:"underline"},_focusVisible:{boxShadow:"outline"}}},baseStyle$9=definePartsStyle$4({link:baseStyleLink}),breadcrumbTheme=defineMultiStyleConfig$4({baseStyle:baseStyle$9}),baseStyle$8={lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},variantGhost=i=>{const{colorScheme:s,theme:o}=i;if(s==="gray")return{color:mode("gray.800","whiteAlpha.900")(i),_hover:{bg:mode("gray.100","whiteAlpha.200")(i)},_active:{bg:mode("gray.200","whiteAlpha.300")(i)}};const a=transparentize(`${s}.200`,.12)(o),rt=transparentize(`${s}.200`,.24)(o);return{color:mode(`${s}.600`,`${s}.200`)(i),bg:"transparent",_hover:{bg:mode(`${s}.50`,a)(i)},_active:{bg:mode(`${s}.100`,rt)(i)}}},variantOutline=i=>{const{colorScheme:s}=i,o=mode("gray.200","whiteAlpha.300")(i);return{border:"1px solid",borderColor:s==="gray"?o:"currentColor",".chakra-button__group[data-attached][data-orientation=horizontal] > &:not(:last-of-type)":{marginEnd:"-1px"},".chakra-button__group[data-attached][data-orientation=vertical] > &:not(:last-of-type)":{marginBottom:"-1px"},...runIfFn$1(variantGhost,i)}},accessibleColorMap={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},variantSolid$2=i=>{var s;const{colorScheme:o}=i;if(o==="gray"){const nt=mode("gray.100","whiteAlpha.200")(i);return{bg:nt,color:mode("gray.800","whiteAlpha.900")(i),_hover:{bg:mode("gray.200","whiteAlpha.300")(i),_disabled:{bg:nt}},_active:{bg:mode("gray.300","whiteAlpha.400")(i)}}}const{bg:a=`${o}.500`,color:rt="white",hoverBg:tt=`${o}.600`,activeBg:ot=`${o}.700`}=(s=accessibleColorMap[o])!=null?s:{},at=mode(a,`${o}.200`)(i);return{bg:at,color:mode(rt,"gray.800")(i),_hover:{bg:mode(tt,`${o}.300`)(i),_disabled:{bg:at}},_active:{bg:mode(ot,`${o}.400`)(i)}}},variantLink=i=>{const{colorScheme:s}=i;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:mode(`${s}.500`,`${s}.200`)(i),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:mode(`${s}.700`,`${s}.500`)(i)}}},variantUnstyled={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},variants$7={ghost:variantGhost,outline:variantOutline,solid:variantSolid$2,link:variantLink,unstyled:variantUnstyled},sizes$3={lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},buttonTheme={baseStyle:baseStyle$8,variants:variants$7,sizes:sizes$3,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:definePartsStyle$3,defineMultiStyleConfig:defineMultiStyleConfig$3}=createMultiStyleConfigHelpers(cardAnatomy.keys),$bg$3=cssVar$1("card-bg"),$padding=cssVar$1("card-padding"),$shadow=cssVar$1("card-shadow"),$radius=cssVar$1("card-radius"),$border$1=cssVar$1("card-border-width","0"),$borderColor=cssVar$1("card-border-color"),baseStyle$7=definePartsStyle$3({container:{[$bg$3.variable]:"colors.chakra-body-bg",backgroundColor:$bg$3.reference,boxShadow:$shadow.reference,borderRadius:$radius.reference,color:"chakra-body-text",borderWidth:$border$1.reference,borderColor:$borderColor.reference},body:{padding:$padding.reference,flex:"1 1 0%"},header:{padding:$padding.reference},footer:{padding:$padding.reference}}),sizes$2={sm:definePartsStyle$3({container:{[$radius.variable]:"radii.base",[$padding.variable]:"space.3"}}),md:definePartsStyle$3({container:{[$radius.variable]:"radii.md",[$padding.variable]:"space.5"}}),lg:definePartsStyle$3({container:{[$radius.variable]:"radii.xl",[$padding.variable]:"space.7"}})},variants$6={elevated:definePartsStyle$3({container:{[$shadow.variable]:"shadows.base",_dark:{[$bg$3.variable]:"colors.gray.700"}}}),outline:definePartsStyle$3({container:{[$border$1.variable]:"1px",[$borderColor.variable]:"colors.chakra-border-color"}}),filled:definePartsStyle$3({container:{[$bg$3.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{[$padding.variable]:0},header:{[$padding.variable]:0},footer:{[$padding.variable]:0}}},cardTheme=defineMultiStyleConfig$3({baseStyle:baseStyle$7,variants:variants$6,sizes:sizes$2,defaultProps:{variant:"elevated",size:"md"}}),$size$1=cssVar("close-button-size"),$bg$2=cssVar("close-button-bg"),baseStyle$6={w:[$size$1.reference],h:[$size$1.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[$bg$2.variable]:"colors.blackAlpha.100",_dark:{[$bg$2.variable]:"colors.whiteAlpha.100"}},_active:{[$bg$2.variable]:"colors.blackAlpha.200",_dark:{[$bg$2.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:$bg$2.reference},sizes$1={lg:{[$size$1.variable]:"sizes.10",fontSize:"md"},md:{[$size$1.variable]:"sizes.8",fontSize:"xs"},sm:{[$size$1.variable]:"sizes.6",fontSize:"2xs"}},closeButtonTheme={baseStyle:baseStyle$6,sizes:sizes$1,defaultProps:{size:"md"}},{variants:variants$5,defaultProps}=badgeTheme,baseStyle$5={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm",bg:vars.bg.reference,color:vars.color.reference,boxShadow:vars.shadow.reference},codeTheme={baseStyle:baseStyle$5,variants:variants$5,defaultProps},baseStyle$4={w:"100%",mx:"auto",maxW:"prose",px:"4"},containerTheme={baseStyle:baseStyle$4},baseStyle$3={opacity:.6,borderColor:"inherit"},variantSolid$1={borderStyle:"solid"},variantDashed={borderStyle:"dashed"},variants$4={solid:variantSolid$1,dashed:variantDashed},dividerTheme={baseStyle:baseStyle$3,variants:variants$4,defaultProps:{variant:"solid"}},{definePartsStyle:definePartsStyle$2,defineMultiStyleConfig:defineMultiStyleConfig$2}=createMultiStyleConfigHelpers(accordionAnatomy.keys),baseStyleContainer$1={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},baseStyleButton={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},baseStylePanel={pt:"2",px:"4",pb:"5"},baseStyleIcon={fontSize:"1.25em"},baseStyle$2=definePartsStyle$2({container:baseStyleContainer$1,button:baseStyleButton,panel:baseStylePanel,icon:baseStyleIcon}),accordionTheme=defineMultiStyleConfig$2({baseStyle:baseStyle$2}),{definePartsStyle:definePartsStyle$1,defineMultiStyleConfig:defineMultiStyleConfig$1}=createMultiStyleConfigHelpers(alertAnatomy.keys),$fg=cssVar$1("alert-fg"),$bg$1=cssVar$1("alert-bg"),baseStyle$1=definePartsStyle$1({container:{bg:$bg$1.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:$fg.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:$fg.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function getBg(i){const{theme:s,colorScheme:o}=i,a=transparentize(`${o}.200`,.16)(s);return{light:`colors.${o}.100`,dark:a}}var variantSubtle=definePartsStyle$1(i=>{const{colorScheme:s}=i,o=getBg(i);return{container:{[$fg.variable]:`colors.${s}.600`,[$bg$1.variable]:o.light,_dark:{[$fg.variable]:`colors.${s}.200`,[$bg$1.variable]:o.dark}}}}),variantLeftAccent=definePartsStyle$1(i=>{const{colorScheme:s}=i,o=getBg(i);return{container:{[$fg.variable]:`colors.${s}.600`,[$bg$1.variable]:o.light,_dark:{[$fg.variable]:`colors.${s}.200`,[$bg$1.variable]:o.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:$fg.reference}}}),variantTopAccent=definePartsStyle$1(i=>{const{colorScheme:s}=i,o=getBg(i);return{container:{[$fg.variable]:`colors.${s}.600`,[$bg$1.variable]:o.light,_dark:{[$fg.variable]:`colors.${s}.200`,[$bg$1.variable]:o.dark},pt:"2",borderTopWidth:"4px",borderTopColor:$fg.reference}}}),variantSolid=definePartsStyle$1(i=>{const{colorScheme:s}=i;return{container:{[$fg.variable]:"colors.white",[$bg$1.variable]:`colors.${s}.600`,_dark:{[$fg.variable]:"colors.gray.900",[$bg$1.variable]:`colors.${s}.200`},color:$fg.reference}}}),variants$3={subtle:variantSubtle,"left-accent":variantLeftAccent,"top-accent":variantTopAccent,solid:variantSolid},alertTheme=defineMultiStyleConfig$1({baseStyle:baseStyle$1,variants:variants$3,defaultProps:{variant:"subtle",colorScheme:"blue"}}),{definePartsStyle,defineMultiStyleConfig}=createMultiStyleConfigHelpers(avatarAnatomy.keys),$border=cssVar$1("avatar-border-color"),$bg=cssVar$1("avatar-bg"),$fs=cssVar$1("avatar-font-size"),$size=cssVar$1("avatar-size"),baseStyleBadge={borderRadius:"full",border:"0.2em solid",borderColor:$border.reference,[$border.variable]:"white",_dark:{[$border.variable]:"colors.gray.800"}},baseStyleExcessLabel={bg:$bg.reference,fontSize:$fs.reference,width:$size.reference,height:$size.reference,lineHeight:"1",[$bg.variable]:"colors.gray.200",_dark:{[$bg.variable]:"colors.whiteAlpha.400"}},baseStyleContainer=i=>{const{name:s,theme:o}=i,a=s?randomColor({string:s}):"colors.gray.400",rt=isDark(a)(o);let tt="white";return rt||(tt="gray.800"),{bg:$bg.reference,fontSize:$fs.reference,color:tt,borderColor:$border.reference,verticalAlign:"top",width:$size.reference,height:$size.reference,"&:not([data-loaded])":{[$bg.variable]:a},[$border.variable]:"colors.white",_dark:{[$border.variable]:"colors.gray.800"}}},baseStyleLabel={fontSize:$fs.reference,lineHeight:"1"},baseStyle=definePartsStyle(i=>({badge:runIfFn$1(baseStyleBadge,i),excessLabel:runIfFn$1(baseStyleExcessLabel,i),container:runIfFn$1(baseStyleContainer,i),label:baseStyleLabel}));function getSize(i){const s=i!=="100%"?sizes_default[i]:void 0;return definePartsStyle({container:{[$size.variable]:s??i,[$fs.variable]:`calc(${s??i} / 2.5)`},excessLabel:{[$size.variable]:s??i,[$fs.variable]:`calc(${s??i} / 2.5)`}})}var sizes={"2xs":getSize(4),xs:getSize(6),sm:getSize(8),md:getSize(12),lg:getSize(16),xl:getSize(24),"2xl":getSize(32),full:getSize("100%")},avatarTheme=defineMultiStyleConfig({baseStyle,sizes,defaultProps:{size:"md"}}),components={Accordion:accordionTheme,Alert:alertTheme,Avatar:avatarTheme,Badge:badgeTheme,Breadcrumb:breadcrumbTheme,Button:buttonTheme,Checkbox:checkboxTheme,CloseButton:closeButtonTheme,Code:codeTheme,Container:containerTheme,Divider:dividerTheme,Drawer:drawerTheme,Editable:editableTheme,Form:formTheme,FormError:formErrorTheme,FormLabel:formLabelTheme,Heading:headingTheme,Input:inputTheme,Kbd:kbdTheme,Link:linkTheme,List:listTheme,Menu:menuTheme,Modal:modalTheme,NumberInput:numberInputTheme,PinInput:pinInputTheme,Popover:popoverTheme,Progress:progressTheme,Radio:radioTheme,Select:selectTheme,Skeleton:skeletonTheme,SkipLink:skipLinkTheme,Slider:sliderTheme,Spinner:spinnerTheme,Stat:statTheme,Switch:switchTheme,Table:tableTheme,Tabs:tabsTheme,Tag:tagTheme,Textarea:textareaTheme,Tooltip:tooltipTheme,Card:cardTheme,Stepper:stepperTheme},semanticTokens={colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-inverse-text":{_light:"white",_dark:"gray.800"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-subtle-text":{_light:"gray.600",_dark:"gray.400"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},styles={global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color"}}},direction="ltr",config$1={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},theme$1={semanticTokens,direction,...foundations,components,styles,config:config$1};function isFunction$2(i){return typeof i=="function"}function pipe$1(...i){return s=>i.reduce((o,a)=>a(o),s)}var createExtendTheme=i=>function(...o){let a=[...o],rt=o[o.length-1];return isChakraTheme(rt)&&a.length>1?a=a.slice(0,a.length-1):rt=i,pipe$1(...a.map(tt=>ot=>isFunction$2(tt)?tt(ot):mergeThemeOverride(ot,tt)))(rt)},extendTheme=createExtendTheme(theme$1);function mergeThemeOverride(...i){return mergeWith({},...i,mergeThemeCustomizer)}function mergeThemeCustomizer(i,s,o,a){if((isFunction$2(i)||isFunction$2(s))&&Object.prototype.hasOwnProperty.call(a,o))return(...rt)=>{const tt=isFunction$2(i)?i(...rt):i,ot=isFunction$2(s)?s(...rt):s;return mergeWith({},tt,ot,mergeThemeCustomizer)}}function canUseDOM$1(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var isBrowser$1=canUseDOM$1();function omit$1(i,s){const o={};return Object.keys(i).forEach(a=>{s.includes(a)||(o[a]=i[a])}),o}function get$2(i,s,o,a){const rt=typeof s=="string"?s.split("."):[s];for(a=0;a{const s=new WeakMap;return(a,rt,tt,ot)=>{if(typeof a>"u")return i(a,rt,tt);s.has(a)||s.set(a,new Map);const at=s.get(a);if(at.has(rt))return at.get(rt);const nt=i(a,rt,tt,ot);return at.set(rt,nt),nt}},memoizedGet=memoize$1(get$2);function objectFilter(i,s){const o={};return Object.keys(i).forEach(a=>{const rt=i[a];s(rt,a,i)&&(o[a]=rt)}),o}var filterUndefined=i=>objectFilter(i,s=>s!=null);function isFunction$1(i){return typeof i=="function"}function runIfFn(i,...s){return isFunction$1(i)?i(...s):i}function callAllHandlers(...i){return function(o){i.some(a=>(a==null||a(o),o==null?void 0:o.defaultPrevented))}}var hasElementType=typeof Element<"u",hasMap=typeof Map=="function",hasSet=typeof Set=="function",hasArrayBuffer=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function equal$1(i,s){if(i===s)return!0;if(i&&s&&typeof i=="object"&&typeof s=="object"){if(i.constructor!==s.constructor)return!1;var o,a,rt;if(Array.isArray(i)){if(o=i.length,o!=s.length)return!1;for(a=o;a--!==0;)if(!equal$1(i[a],s[a]))return!1;return!0}var tt;if(hasMap&&i instanceof Map&&s instanceof Map){if(i.size!==s.size)return!1;for(tt=i.entries();!(a=tt.next()).done;)if(!s.has(a.value[0]))return!1;for(tt=i.entries();!(a=tt.next()).done;)if(!equal$1(a.value[1],s.get(a.value[0])))return!1;return!0}if(hasSet&&i instanceof Set&&s instanceof Set){if(i.size!==s.size)return!1;for(tt=i.entries();!(a=tt.next()).done;)if(!s.has(a.value[0]))return!1;return!0}if(hasArrayBuffer&&ArrayBuffer.isView(i)&&ArrayBuffer.isView(s)){if(o=i.length,o!=s.length)return!1;for(a=o;a--!==0;)if(i[a]!==s[a])return!1;return!0}if(i.constructor===RegExp)return i.source===s.source&&i.flags===s.flags;if(i.valueOf!==Object.prototype.valueOf&&typeof i.valueOf=="function"&&typeof s.valueOf=="function")return i.valueOf()===s.valueOf();if(i.toString!==Object.prototype.toString&&typeof i.toString=="function"&&typeof s.toString=="function")return i.toString()===s.toString();if(rt=Object.keys(i),o=rt.length,o!==Object.keys(s).length)return!1;for(a=o;a--!==0;)if(!Object.prototype.hasOwnProperty.call(s,rt[a]))return!1;if(hasElementType&&i instanceof Element)return!1;for(a=o;a--!==0;)if(!((rt[a]==="_owner"||rt[a]==="__v"||rt[a]==="__o")&&i.$$typeof)&&!equal$1(i[rt[a]],s[rt[a]]))return!1;return!0}return i!==i&&s!==s}var reactFastCompare=function(s,o){try{return equal$1(s,o)}catch(a){if((a.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw a}};const isEqual$2=getDefaultExportFromCjs(reactFastCompare);function useStyleConfigImpl(i,s={}){var o;const{styleConfig:a,...rt}=s,{theme:tt,colorMode:ot}=useChakra(),at=i?memoizedGet(tt,`components.${i}`):void 0,nt=a||at,it=mergeWith({theme:tt,colorMode:ot},(o=nt==null?void 0:nt.defaultProps)!=null?o:{},filterUndefined(omit$1(rt,["children"]))),j=reactExports.useRef({});if(nt){const $=resolveStyleConfig(nt)(it);isEqual$2(j.current,$)||(j.current=$)}return j.current}function useStyleConfig(i,s={}){return useStyleConfigImpl(i,s)}function useMultiStyleConfig(i,s={}){return useStyleConfigImpl(i,s)}var allPropNames=new Set([...propNames,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),validHTMLProps=new Set(["htmlWidth","htmlHeight","htmlSize","htmlTranslate"]);function shouldForwardProp(i){return validHTMLProps.has(i)||!allPropNames.has(i)}function assignAfter(i,...s){if(i==null)throw new TypeError("Cannot convert undefined or null to object");const o={...i};for(const a of s)if(a!=null)for(const rt in a)Object.prototype.hasOwnProperty.call(a,rt)&&(rt in o&&delete o[rt],o[rt]=a[rt]);return o}function compact(i){const s=Object.assign({},i);for(let o in s)s[o]===void 0&&delete s[o];return s}var reactPropsRegex=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,isPropValid=memoize$3(function(i){return reactPropsRegex.test(i)||i.charCodeAt(0)===111&&i.charCodeAt(1)===110&&i.charCodeAt(2)<91}),testOmitPropsOnStringTag=isPropValid,testOmitPropsOnComponent=function(s){return s!=="theme"},getDefaultShouldForwardProp=function(s){return typeof s=="string"&&s.charCodeAt(0)>96?testOmitPropsOnStringTag:testOmitPropsOnComponent},composeShouldForwardProps=function(s,o,a){var rt;if(o){var tt=o.shouldForwardProp;rt=s.__emotion_forwardProp&&tt?function(ot){return s.__emotion_forwardProp(ot)&&tt(ot)}:tt}return typeof rt!="function"&&a&&(rt=s.__emotion_forwardProp),rt},isDevelopment=!1,Insertion=function(s){var o=s.cache,a=s.serialized,rt=s.isStringTag;return registerStyles(o,a,rt),useInsertionEffectAlwaysWithSyncFallback(function(){return insertStyles(o,a,rt)}),null},createStyled=function i(s,o){var a=s.__emotion_real===s,rt=a&&s.__emotion_base||s,tt,ot;o!==void 0&&(tt=o.label,ot=o.target);var at=composeShouldForwardProps(s,o,a),nt=at||getDefaultShouldForwardProp(rt),it=!nt("as");return function(){var j=arguments,_=a&&s.__emotion_styles!==void 0?s.__emotion_styles.slice(0):[];if(tt!==void 0&&_.push("label:"+tt+";"),j[0]==null||j[0].raw===void 0)_.push.apply(_,j);else{_.push(j[0][0]);for(var $=j.length,et=1;et<$;et++)_.push(j[et],j[0][et])}var st=withEmotionCache(function(lt,ct,ht){var ut=it&<.as||rt,pt="",mt=[],gt=lt;if(lt.theme==null){gt={};for(var dt in lt)gt[dt]=lt[dt];gt.theme=reactExports.useContext(ThemeContext)}typeof lt.className=="string"?pt=getRegisteredStyles(ct.registered,mt,lt.className):lt.className!=null&&(pt=lt.className+" ");var St=serializeStyles(_.concat(mt),ct.registered,gt);pt+=ct.key+"-"+St.name,ot!==void 0&&(pt+=" "+ot);var xt=it&&at===void 0?getDefaultShouldForwardProp(ut):nt,yt={};for(var _t in lt)it&&_t==="as"||xt(_t)&&(yt[_t]=lt[_t]);return yt.className=pt,ht&&(yt.ref=ht),reactExports.createElement(reactExports.Fragment,null,reactExports.createElement(Insertion,{cache:ct,serialized:St,isStringTag:typeof ut=="string"}),reactExports.createElement(ut,yt))});return st.displayName=tt!==void 0?tt:"Styled("+(typeof rt=="string"?rt:rt.displayName||rt.name||"Component")+")",st.defaultProps=s.defaultProps,st.__emotion_real=st,st.__emotion_base=rt,st.__emotion_styles=_,st.__emotion_forwardProp=at,Object.defineProperty(st,"toString",{value:function(){return ot===void 0&&isDevelopment?"NO_COMPONENT_SELECTOR":"."+ot}}),st.withComponent=function(lt,ct){return i(lt,_extends({},o,ct,{shouldForwardProp:composeShouldForwardProps(st,ct,!0)})).apply(void 0,_)},st}},tags=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],newStyled=createStyled.bind();tags.forEach(function(i){newStyled[i]=newStyled(i)});var _a$1,emotion_styled=(_a$1=newStyled.default)!=null?_a$1:newStyled,toCSSObject=({baseStyle:i})=>s=>{const{theme:o,css:a,__css:rt,sx:tt,...ot}=s,at=objectFilter(ot,(_,$)=>isStyleProp($)),nt=runIfFn(i,s),it=assignAfter({},rt,nt,filterUndefined(at),tt),j=css(it)(s.theme);return a?[j,a]:j};function styled(i,s){const{baseStyle:o,...a}=s??{};a.shouldForwardProp||(a.shouldForwardProp=shouldForwardProp);const rt=toCSSObject({baseStyle:o}),tt=emotion_styled(i,a)(rt);return React$4.forwardRef(function(nt,it){const{colorMode:j,forced:_}=useColorMode();return React$4.createElement(tt,{ref:it,"data-theme":_?j:void 0,...nt})})}function factory(){const i=new Map;return new Proxy(styled,{apply(s,o,a){return styled(...a)},get(s,o){return i.has(o)||i.set(o,styled(o)),i.get(o)}})}var chakra=factory();function forwardRef(i){return reactExports.forwardRef(i)}function createContext$1(i={}){const{strict:s=!0,errorMessage:o="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:a}=i,rt=reactExports.createContext(void 0);rt.displayName=a;function tt(){var ot;const at=reactExports.useContext(rt);if(!at&&s){const nt=new Error(o);throw nt.name="ContextError",(ot=Error.captureStackTrace)==null||ot.call(Error,nt,tt),nt}return at}return[rt.Provider,tt,rt]}function ThemeProvider(i){const{cssVarsRoot:s,theme:o,children:a}=i,rt=reactExports.useMemo(()=>toCSSVar(o),[o]);return jsxRuntimeExports.jsxs(ThemeProvider$1,{theme:rt,children:[jsxRuntimeExports.jsx(CSSVars,{root:s}),a]})}function CSSVars({root:i=":host, :root"}){const s=[i,"[data-theme]"].join(",");return jsxRuntimeExports.jsx(Global,{styles:o=>({[s]:o.__cssVars})})}createContext$1({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `` "});function createStylesContext(i){return createContext$1({name:`${i}StylesContext`,errorMessage:`useStyles: "styles" is undefined. Seems you forgot to wrap the components in "<${i} />" `})}function GlobalStyle(){const{colorMode:i}=useColorMode();return jsxRuntimeExports.jsx(Global,{styles:s=>{const o=memoizedGet(s,"styles.global"),a=runIfFn(o,{theme:s,colorMode:i});return a?css(a)(s):void 0}})}var EnvironmentContext=reactExports.createContext({getDocument(){return document},getWindow(){return window}});EnvironmentContext.displayName="EnvironmentContext";function EnvironmentProvider(i){const{children:s,environment:o,disabled:a}=i,rt=reactExports.useRef(null),tt=reactExports.useMemo(()=>o||{getDocument:()=>{var at,nt;return(nt=(at=rt.current)==null?void 0:at.ownerDocument)!=null?nt:document},getWindow:()=>{var at,nt;return(nt=(at=rt.current)==null?void 0:at.ownerDocument.defaultView)!=null?nt:window}},[o]),ot=!a||!o;return jsxRuntimeExports.jsxs(EnvironmentContext.Provider,{value:tt,children:[s,ot&&jsxRuntimeExports.jsx("span",{id:"__chakra_env",hidden:!0,ref:rt})]})}EnvironmentProvider.displayName="EnvironmentProvider";var ChakraProvider$1=i=>{const{children:s,colorModeManager:o,portalZIndex:a,resetScope:rt,resetCSS:tt=!0,theme:ot={},environment:at,cssVarsRoot:nt,disableEnvironment:it,disableGlobalStyle:j}=i,_=jsxRuntimeExports.jsx(EnvironmentProvider,{environment:at,disabled:it,children:s});return jsxRuntimeExports.jsx(ThemeProvider,{theme:ot,cssVarsRoot:nt,children:jsxRuntimeExports.jsxs(ColorModeProvider,{colorModeManager:o,options:ot.config,children:[tt?jsxRuntimeExports.jsx(CSSReset,{scope:rt}):jsxRuntimeExports.jsx(CSSPolyfill,{}),!j&&jsxRuntimeExports.jsx(GlobalStyle,{}),a?jsxRuntimeExports.jsx(PortalManager,{zIndex:a,children:_}):_]})})},findById=(i,s)=>i.find(o=>o.id===s);function findToast(i,s){const o=getToastPosition(i,s),a=o?i[o].findIndex(rt=>rt.id===s):-1;return{position:o,index:a}}function getToastPosition(i,s){for(const[o,a]of Object.entries(i))if(findById(a,s))return o}function getToastStyle(i){const s=i.includes("right"),o=i.includes("left");let a="center";return s&&(a="flex-end"),o&&(a="flex-start"),{display:"flex",flexDirection:"column",alignItems:a}}function getToastListStyle(i){const o=i==="top"||i==="bottom"?"0 auto":void 0,a=i.includes("top")?"env(safe-area-inset-top, 0px)":void 0,rt=i.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,tt=i.includes("left")?void 0:"env(safe-area-inset-right, 0px)",ot=i.includes("right")?void 0:"env(safe-area-inset-left, 0px)";return{position:"fixed",zIndex:"var(--toast-z-index, 5500)",pointerEvents:"none",display:"flex",flexDirection:"column",margin:o,top:a,bottom:rt,right:tt,left:ot}}function useCallbackRef$2(i,s=[]){const o=reactExports.useRef(i);return reactExports.useEffect(()=>{o.current=i}),reactExports.useCallback((...a)=>{var rt;return(rt=o.current)==null?void 0:rt.call(o,...a)},s)}function useTimeout(i,s){const o=useCallbackRef$2(i);reactExports.useEffect(()=>{if(s==null)return;let a=null;return a=window.setTimeout(()=>{o()},s),()=>{a&&window.clearTimeout(a)}},[s,o])}function useUpdateEffect(i,s){const o=reactExports.useRef(!1),a=reactExports.useRef(!1);reactExports.useEffect(()=>{if(o.current&&a.current)return i();a.current=!0},s),reactExports.useEffect(()=>(o.current=!0,()=>{o.current=!1}),[])}const MotionConfigContext=reactExports.createContext({transformPagePoint:i=>i,isStatic:!1,reducedMotion:"never"}),MotionContext=reactExports.createContext({}),PresenceContext=reactExports.createContext(null),isBrowser=typeof window<"u",useIsomorphicLayoutEffect$1=isBrowser?reactExports.useLayoutEffect:reactExports.useEffect,LazyContext=reactExports.createContext({strict:!1}),camelToDash=i=>i.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),optimizedAppearDataId="framerAppearId",optimizedAppearDataAttribute="data-"+camelToDash(optimizedAppearDataId),MotionGlobalConfig={skipAnimations:!1,useManualTiming:!1};function createRenderStep(i){let s=new Set,o=new Set,a=!1,rt=!1;const tt=new WeakSet;let ot={delta:0,timestamp:0,isProcessing:!1};function at(it){tt.has(it)&&(nt.schedule(it),i()),it(ot)}const nt={schedule:(it,j=!1,_=!1)=>{const et=_&&a?s:o;return j&&tt.add(it),et.has(it)||et.add(it),it},cancel:it=>{o.delete(it),tt.delete(it)},process:it=>{if(ot=it,a){rt=!0;return}a=!0,[s,o]=[o,s],o.clear(),s.forEach(at),a=!1,rt&&(rt=!1,nt.process(it))}};return nt}const stepsOrder=["read","resolveKeyframes","update","preRender","render","postRender"],maxElapsed=40;function createRenderBatcher(i,s){let o=!1,a=!0;const rt={delta:0,timestamp:0,isProcessing:!1},tt=()=>o=!0,ot=stepsOrder.reduce((ht,ut)=>(ht[ut]=createRenderStep(tt),ht),{}),{read:at,resolveKeyframes:nt,update:it,preRender:j,render:_,postRender:$}=ot,et=()=>{const ht=performance.now();o=!1,rt.delta=a?1e3/60:Math.max(Math.min(ht-rt.timestamp,maxElapsed),1),rt.timestamp=ht,rt.isProcessing=!0,at.process(rt),nt.process(rt),it.process(rt),j.process(rt),_.process(rt),$.process(rt),rt.isProcessing=!1,o&&s&&(a=!1,i(et))},st=()=>{o=!0,a=!0,rt.isProcessing||i(et)};return{schedule:stepsOrder.reduce((ht,ut)=>{const pt=ot[ut];return ht[ut]=(mt,gt=!1,dt=!1)=>(o||st(),pt.schedule(mt,gt,dt)),ht},{}),cancel:ht=>{for(let ut=0;ut{_&&_.update(o,nt)});const et=o[optimizedAppearDataAttribute],st=reactExports.useRef(!!et&&!window.MotionHandoffIsComplete&&((tt=window.MotionHasOptimisedAnimation)===null||tt===void 0?void 0:tt.call(window,et)));return useIsomorphicLayoutEffect$1(()=>{_&&(_.updateFeatures(),microtask.render(_.render),st.current&&_.animationState&&_.animationState.animateChanges())}),reactExports.useEffect(()=>{_&&(!st.current&&_.animationState&&_.animationState.animateChanges(),st.current=!1,scheduleHandoffComplete||(scheduleHandoffComplete=!0,queueMicrotask(completeHandoff)))}),_}function completeHandoff(){window.MotionHandoffIsComplete=!0}function createProjectionNode$1(i,s,o,a){const{layoutId:rt,layout:tt,drag:ot,dragConstraints:at,layoutScroll:nt,layoutRoot:it}=s;i.projection=new o(i.latestValues,s["data-framer-portal-id"]?void 0:getClosestProjectingNode(i.parent)),i.projection.setOptions({layoutId:rt,layout:tt,alwaysMeasureLayout:!!ot||at&&isRefObject(at),visualElement:i,animationType:typeof tt=="string"?tt:"both",initialPromotionConfig:a,layoutScroll:nt,layoutRoot:it})}function getClosestProjectingNode(i){if(i)return i.options.allowProjection!==!1?i.projection:getClosestProjectingNode(i.parent)}function useMotionRef(i,s,o){return reactExports.useCallback(a=>{a&&i.mount&&i.mount(a),s&&(a?s.mount(a):s.unmount()),o&&(typeof o=="function"?o(a):isRefObject(o)&&(o.current=a))},[s])}function isVariantLabel(i){return typeof i=="string"||Array.isArray(i)}function isAnimationControls(i){return i!==null&&typeof i=="object"&&typeof i.start=="function"}const variantPriorityOrder=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],variantProps=["initial",...variantPriorityOrder];function isControllingVariants(i){return isAnimationControls(i.animate)||variantProps.some(s=>isVariantLabel(i[s]))}function isVariantNode(i){return!!(isControllingVariants(i)||i.variants)}function getCurrentTreeVariants(i,s){if(isControllingVariants(i)){const{initial:o,animate:a}=i;return{initial:o===!1||isVariantLabel(o)?o:void 0,animate:isVariantLabel(a)?a:void 0}}return i.inherit!==!1?s:{}}function useCreateMotionContext(i){const{initial:s,animate:o}=getCurrentTreeVariants(i,reactExports.useContext(MotionContext));return reactExports.useMemo(()=>({initial:s,animate:o}),[variantLabelsAsDependency(s),variantLabelsAsDependency(o)])}function variantLabelsAsDependency(i){return Array.isArray(i)?i.join(" "):i}const featureProps={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},featureDefinitions={};for(const i in featureProps)featureDefinitions[i]={isEnabled:s=>featureProps[i].some(o=>!!s[o])};function loadFeatures(i){for(const s in i)featureDefinitions[s]={...featureDefinitions[s],...i[s]}}const LayoutGroupContext=reactExports.createContext({}),motionComponentSymbol=Symbol.for("motionComponentSymbol"),noop$1=i=>i;let invariant=noop$1;function createMotionComponent({preloadedFeatures:i,createVisualElement:s,useRender:o,useVisualState:a,Component:rt}){i&&loadFeatures(i);function tt(at,nt){let it;const j={...reactExports.useContext(MotionConfigContext),...at,layoutId:useLayoutId(at)},{isStatic:_}=j,$=useCreateMotionContext(at),et=a(at,_);if(!_&&isBrowser){useStrictMode();const st=getProjectionFunctionality(j);it=st.MeasureLayout,$.visualElement=useVisualElement(rt,et,j,s,st.ProjectionNode)}return jsxRuntimeExports.jsxs(MotionContext.Provider,{value:$,children:[it&&$.visualElement?jsxRuntimeExports.jsx(it,{visualElement:$.visualElement,...j}):null,o(rt,at,useMotionRef(et,$.visualElement,nt),et,_,$.visualElement)]})}const ot=reactExports.forwardRef(tt);return ot[motionComponentSymbol]=rt,ot}function useLayoutId({layoutId:i}){const s=reactExports.useContext(LayoutGroupContext).id;return s&&i!==void 0?s+"-"+i:i}function useStrictMode(i,s){reactExports.useContext(LazyContext).strict}function getProjectionFunctionality(i){const{drag:s,layout:o}=featureDefinitions;if(!s&&!o)return{};const a={...s,...o};return{MeasureLayout:s!=null&&s.isEnabled(i)||o!=null&&o.isEnabled(i)?a.MeasureLayout:void 0,ProjectionNode:a.ProjectionNode}}function createMotionProxy(i){function s(a,rt={}){return createMotionComponent(i(a,rt))}if(typeof Proxy>"u")return s;const o=new Map;return new Proxy(s,{get:(a,rt)=>(o.has(rt)||o.set(rt,s(rt)),o.get(rt))})}const lowercaseSVGElements=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function isSVGComponent(i){return typeof i!="string"||i.includes("-")?!1:!!(lowercaseSVGElements.indexOf(i)>-1||/[A-Z]/u.test(i))}const scaleCorrectors={};function addScaleCorrector(i){Object.assign(scaleCorrectors,i)}const transformPropOrder=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],transformProps=new Set(transformPropOrder);function isForcedMotionValue(i,{layout:s,layoutId:o}){return transformProps.has(i)||i.startsWith("origin")||(s||o!==void 0)&&(!!scaleCorrectors[i]||i==="opacity")}const isMotionValue=i=>!!(i&&i.getVelocity),getValueAsType=(i,s)=>s&&typeof i=="number"?s.transform(i):i,clamp=(i,s,o)=>o>s?s:otypeof i=="number",parse:parseFloat,transform:i=>i},alpha={...number,transform:i=>clamp(0,1,i)},scale={...number,default:1},sanitize=i=>Math.round(i*1e5)/1e5,floatRegex=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,colorRegex=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,singleColorRegex=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function isString$1(i){return typeof i=="string"}function isNullish(i){return i==null}const createUnitType=i=>({test:s=>isString$1(s)&&s.endsWith(i)&&s.split(" ").length===1,parse:parseFloat,transform:s=>`${s}${i}`}),degrees=createUnitType("deg"),percent=createUnitType("%"),px=createUnitType("px"),vh=createUnitType("vh"),vw=createUnitType("vw"),progressPercentage={...percent,parse:i=>percent.parse(i)/100,transform:i=>percent.transform(i*100)},int={...number,transform:Math.round},numberValueTypes={borderWidth:px,borderTopWidth:px,borderRightWidth:px,borderBottomWidth:px,borderLeftWidth:px,borderRadius:px,radius:px,borderTopLeftRadius:px,borderTopRightRadius:px,borderBottomRightRadius:px,borderBottomLeftRadius:px,width:px,maxWidth:px,height:px,maxHeight:px,size:px,top:px,right:px,bottom:px,left:px,padding:px,paddingTop:px,paddingRight:px,paddingBottom:px,paddingLeft:px,margin:px,marginTop:px,marginRight:px,marginBottom:px,marginLeft:px,rotate:degrees,rotateX:degrees,rotateY:degrees,rotateZ:degrees,scale,scaleX:scale,scaleY:scale,scaleZ:scale,skew:degrees,skewX:degrees,skewY:degrees,distance:px,translateX:px,translateY:px,translateZ:px,x:px,y:px,z:px,perspective:px,transformPerspective:px,opacity:alpha,originX:progressPercentage,originY:progressPercentage,originZ:px,zIndex:int,backgroundPositionX:px,backgroundPositionY:px,fillOpacity:alpha,strokeOpacity:alpha,numOctaves:int},translateAlias={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},numTransforms=transformPropOrder.length;function buildTransform(i,s,o){let a="",rt=!0;for(let tt=0;tts=>typeof s=="string"&&s.startsWith(i),isCSSVariableName=checkStringStartsWith("--"),startsAsVariableToken=checkStringStartsWith("var(--"),isCSSVariableToken=i=>startsAsVariableToken(i)?singleCssVariableRegex.test(i.split("/*")[0].trim()):!1,singleCssVariableRegex=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function buildHTMLStyles(i,s,o){const{style:a,vars:rt,transformOrigin:tt}=i;let ot=!1,at=!1;for(const nt in s){const it=s[nt];if(transformProps.has(nt)){ot=!0;continue}else if(isCSSVariableName(nt)){rt[nt]=it;continue}else{const j=getValueAsType(it,numberValueTypes[nt]);nt.startsWith("origin")?(at=!0,tt[nt]=j):a[nt]=j}}if(s.transform||(ot||o?a.transform=buildTransform(s,i.transform,o):a.transform&&(a.transform="none")),at){const{originX:nt="50%",originY:it="50%",originZ:j=0}=tt;a.transformOrigin=`${nt} ${it} ${j}`}}const createHtmlRenderState=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function copyRawValuesOnly(i,s,o){for(const a in s)!isMotionValue(s[a])&&!isForcedMotionValue(a,o)&&(i[a]=s[a])}function useInitialMotionValues({transformTemplate:i},s){return reactExports.useMemo(()=>{const o=createHtmlRenderState();return buildHTMLStyles(o,s,i),Object.assign({},o.vars,o.style)},[s])}function useStyle(i,s){const o=i.style||{},a={};return copyRawValuesOnly(a,o,i),Object.assign(a,useInitialMotionValues(i,s)),a}function useHTMLProps(i,s){const o={},a=useStyle(i,s);return i.drag&&i.dragListener!==!1&&(o.draggable=!1,a.userSelect=a.WebkitUserSelect=a.WebkitTouchCallout="none",a.touchAction=i.drag===!0?"none":`pan-${i.drag==="x"?"y":"x"}`),i.tabIndex===void 0&&(i.onTap||i.onTapStart||i.whileTap)&&(o.tabIndex=0),o.style=a,o}const validMotionProps=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function isValidMotionProp(i){return i.startsWith("while")||i.startsWith("drag")&&i!=="draggable"||i.startsWith("layout")||i.startsWith("onTap")||i.startsWith("onPan")||i.startsWith("onLayout")||validMotionProps.has(i)}let shouldForward=i=>!isValidMotionProp(i);function loadExternalIsValidProp(i){i&&(shouldForward=s=>s.startsWith("on")?!isValidMotionProp(s):i(s))}try{loadExternalIsValidProp(require("@emotion/is-prop-valid").default)}catch{}function filterProps(i,s,o){const a={};for(const rt in i)rt==="values"&&typeof i.values=="object"||(shouldForward(rt)||o===!0&&isValidMotionProp(rt)||!s&&!isValidMotionProp(rt)||i.draggable&&rt.startsWith("onDrag"))&&(a[rt]=i[rt]);return a}function calcOrigin$1(i,s,o){return typeof i=="string"?i:px.transform(s+o*i)}function calcSVGTransformOrigin(i,s,o){const a=calcOrigin$1(s,i.x,i.width),rt=calcOrigin$1(o,i.y,i.height);return`${a} ${rt}`}const dashKeys={offset:"stroke-dashoffset",array:"stroke-dasharray"},camelKeys={offset:"strokeDashoffset",array:"strokeDasharray"};function buildSVGPath(i,s,o=1,a=0,rt=!0){i.pathLength=1;const tt=rt?dashKeys:camelKeys;i[tt.offset]=px.transform(-a);const ot=px.transform(s),at=px.transform(o);i[tt.array]=`${ot} ${at}`}function buildSVGAttrs(i,{attrX:s,attrY:o,attrScale:a,originX:rt,originY:tt,pathLength:ot,pathSpacing:at=1,pathOffset:nt=0,...it},j,_){if(buildHTMLStyles(i,it,_),j){i.style.viewBox&&(i.attrs.viewBox=i.style.viewBox);return}i.attrs=i.style,i.style={};const{attrs:$,style:et,dimensions:st}=i;$.transform&&(st&&(et.transform=$.transform),delete $.transform),st&&(rt!==void 0||tt!==void 0||et.transform)&&(et.transformOrigin=calcSVGTransformOrigin(st,rt!==void 0?rt:.5,tt!==void 0?tt:.5)),s!==void 0&&($.x=s),o!==void 0&&($.y=o),a!==void 0&&($.scale=a),ot!==void 0&&buildSVGPath($,ot,at,nt,!1)}const createSvgRenderState=()=>({...createHtmlRenderState(),attrs:{}}),isSVGTag=i=>typeof i=="string"&&i.toLowerCase()==="svg";function useSVGProps(i,s,o,a){const rt=reactExports.useMemo(()=>{const tt=createSvgRenderState();return buildSVGAttrs(tt,s,isSVGTag(a),i.transformTemplate),{...tt.attrs,style:{...tt.style}}},[s]);if(i.style){const tt={};copyRawValuesOnly(tt,i.style,i),rt.style={...tt,...rt.style}}return rt}function createUseRender(i=!1){return(o,a,rt,{latestValues:tt},ot)=>{const nt=(isSVGComponent(o)?useSVGProps:useHTMLProps)(a,tt,ot,o),it=filterProps(a,typeof o=="string",i),j=o!==reactExports.Fragment?{...it,...nt,ref:rt}:{},{children:_}=a,$=reactExports.useMemo(()=>isMotionValue(_)?_.get():_,[_]);return reactExports.createElement(o,{...j,children:$})}}function renderHTML(i,{style:s,vars:o},a,rt){Object.assign(i.style,s,rt&&rt.getProjectionStyles(a));for(const tt in o)i.style.setProperty(tt,o[tt])}const camelCaseAttributes=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function renderSVG(i,s,o,a){renderHTML(i,s,void 0,a);for(const rt in s.attrs)i.setAttribute(camelCaseAttributes.has(rt)?rt:camelToDash(rt),s.attrs[rt])}function scrapeMotionValuesFromProps$1(i,s,o){var a;const{style:rt}=i,tt={};for(const ot in rt)(isMotionValue(rt[ot])||s.style&&isMotionValue(s.style[ot])||isForcedMotionValue(ot,i)||((a=o==null?void 0:o.getValue(ot))===null||a===void 0?void 0:a.liveStyle)!==void 0)&&(tt[ot]=rt[ot]);return o&&rt&&typeof rt.willChange=="string"&&(o.applyWillChange=!1),tt}function scrapeMotionValuesFromProps(i,s,o){const a=scrapeMotionValuesFromProps$1(i,s,o);for(const rt in i)if(isMotionValue(i[rt])||isMotionValue(s[rt])){const tt=transformPropOrder.indexOf(rt)!==-1?"attr"+rt.charAt(0).toUpperCase()+rt.substring(1):rt;a[tt]=i[rt]}return a}function getValueState(i){const s=[{},{}];return i==null||i.values.forEach((o,a)=>{s[0][a]=o.get(),s[1][a]=o.getVelocity()}),s}function resolveVariantFromProps(i,s,o,a){if(typeof s=="function"){const[rt,tt]=getValueState(a);s=s(o!==void 0?o:i.custom,rt,tt)}if(typeof s=="string"&&(s=i.variants&&i.variants[s]),typeof s=="function"){const[rt,tt]=getValueState(a);s=s(o!==void 0?o:i.custom,rt,tt)}return s}function useConstant(i){const s=reactExports.useRef(null);return s.current===null&&(s.current=i()),s.current}const isKeyframesTarget=i=>Array.isArray(i),isCustomValue=i=>!!(i&&typeof i=="object"&&i.mix&&i.toValue),resolveFinalValueInKeyframes=i=>isKeyframesTarget(i)?i[i.length-1]||0:i;function resolveMotionValue(i){const s=isMotionValue(i)?i.get():i;return isCustomValue(s)?s.toValue():s}const acceleratedValues=new Set(["opacity","clipPath","filter","transform"]);function getWillChangeName(i){if(transformProps.has(i))return"transform";if(acceleratedValues.has(i))return camelToDash(i)}function addUniqueItem(i,s){i.indexOf(s)===-1&&i.push(s)}function removeItem(i,s){const o=i.indexOf(s);o>-1&&i.splice(o,1)}function makeState({applyWillChange:i=!1,scrapeMotionValuesFromProps:s,createRenderState:o,onMount:a},rt,tt,ot,at){const nt={latestValues:makeLatestValues(rt,tt,ot,at?!1:i,s),renderState:o()};return a&&(nt.mount=it=>a(rt,it,nt)),nt}const makeUseVisualState=i=>(s,o)=>{const a=reactExports.useContext(MotionContext),rt=reactExports.useContext(PresenceContext),tt=()=>makeState(i,s,a,rt,o);return o?tt():useConstant(tt)};function addWillChange(i,s){const o=getWillChangeName(s);o&&addUniqueItem(i,o)}function forEachDefinition(i,s,o){const a=Array.isArray(s)?s:[s];for(let rt=0;rt{for(const ut in ct){let pt=ct[ut];if(Array.isArray(pt)){const mt=st?pt.length-1:0;pt=pt[mt]}pt!==null&&(ot[ut]=pt)}for(const ut in ht)ot[ut]=ht[ut]}),nt&&(_&&j!==!1&&!isAnimationControls(_)&&forEachDefinition(i,_,ct=>{for(const ht in ct)addWillChange(at,ht)}),at.length&&(ot.willChange=at.join(","))),ot}const{schedule:frame,cancel:cancelFrame,state:frameData,steps}=createRenderBatcher(typeof requestAnimationFrame<"u"?requestAnimationFrame:noop$1,!0),svgMotionConfig={useVisualState:makeUseVisualState({scrapeMotionValuesFromProps,createRenderState:createSvgRenderState,onMount:(i,s,{renderState:o,latestValues:a})=>{frame.read(()=>{try{o.dimensions=typeof s.getBBox=="function"?s.getBBox():s.getBoundingClientRect()}catch{o.dimensions={x:0,y:0,width:0,height:0}}}),frame.render(()=>{buildSVGAttrs(o,a,isSVGTag(s.tagName),i.transformTemplate),renderSVG(s,o)})}})},htmlMotionConfig={useVisualState:makeUseVisualState({applyWillChange:!0,scrapeMotionValuesFromProps:scrapeMotionValuesFromProps$1,createRenderState:createHtmlRenderState})};function createDomMotionConfig(i,{forwardMotionProps:s=!1},o,a){return{...isSVGComponent(i)?svgMotionConfig:htmlMotionConfig,preloadedFeatures:o,useRender:createUseRender(s),createVisualElement:a,Component:i}}function addDomEvent(i,s,o,a={passive:!0}){return i.addEventListener(s,o,a),()=>i.removeEventListener(s,o)}const isPrimaryPointer=i=>i.pointerType==="mouse"?typeof i.button!="number"||i.button<=0:i.isPrimary!==!1;function extractEventInfo(i,s="page"){return{point:{x:i[`${s}X`],y:i[`${s}Y`]}}}const addPointerInfo=i=>s=>isPrimaryPointer(s)&&i(s,extractEventInfo(s));function addPointerEvent(i,s,o,a){return addDomEvent(i,s,addPointerInfo(o),a)}const combineFunctions=(i,s)=>o=>s(i(o)),pipe=(...i)=>i.reduce(combineFunctions);function createLock(i){let s=null;return()=>{const o=()=>{s=null};return s===null?(s=i,o):!1}}const globalHorizontalLock=createLock("dragHorizontal"),globalVerticalLock=createLock("dragVertical");function getGlobalLock(i){let s=!1;if(i==="y")s=globalVerticalLock();else if(i==="x")s=globalHorizontalLock();else{const o=globalHorizontalLock(),a=globalVerticalLock();o&&a?s=()=>{o(),a()}:(o&&o(),a&&a())}return s}function isDragActive(){const i=getGlobalLock(!0);return i?(i(),!1):!0}class Feature{constructor(s){this.isMounted=!1,this.node=s}update(){}}function addHoverEvent(i,s){const o=s?"pointerenter":"pointerleave",a=s?"onHoverStart":"onHoverEnd",rt=(tt,ot)=>{if(tt.pointerType==="touch"||isDragActive())return;const at=i.getProps();i.animationState&&at.whileHover&&i.animationState.setActive("whileHover",s);const nt=at[a];nt&&frame.postRender(()=>nt(tt,ot))};return addPointerEvent(i.current,o,rt,{passive:!i.getProps()[a]})}class HoverGesture extends Feature{mount(){this.unmount=pipe(addHoverEvent(this.node,!0),addHoverEvent(this.node,!1))}unmount(){}}class FocusGesture extends Feature{constructor(){super(...arguments),this.isActive=!1}onFocus(){let s=!1;try{s=this.node.current.matches(":focus-visible")}catch{s=!0}!s||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=pipe(addDomEvent(this.node.current,"focus",()=>this.onFocus()),addDomEvent(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const isNodeOrChild=(i,s)=>s?i===s?!0:isNodeOrChild(i,s.parentElement):!1;function fireSyntheticPointerEvent(i,s){if(!s)return;const o=new PointerEvent("pointer"+i);s(o,extractEventInfo(o))}class PressGesture extends Feature{constructor(){super(...arguments),this.removeStartListeners=noop$1,this.removeEndListeners=noop$1,this.removeAccessibleListeners=noop$1,this.startPointerPress=(s,o)=>{if(this.isPressing)return;this.removeEndListeners();const a=this.node.getProps(),tt=addPointerEvent(window,"pointerup",(at,nt)=>{if(!this.checkPressEnd())return;const{onTap:it,onTapCancel:j,globalTapTarget:_}=this.node.getProps(),$=!_&&!isNodeOrChild(this.node.current,at.target)?j:it;$&&frame.update(()=>$(at,nt))},{passive:!(a.onTap||a.onPointerUp)}),ot=addPointerEvent(window,"pointercancel",(at,nt)=>this.cancelPress(at,nt),{passive:!(a.onTapCancel||a.onPointerCancel)});this.removeEndListeners=pipe(tt,ot),this.startPress(s,o)},this.startAccessiblePress=()=>{const s=tt=>{if(tt.key!=="Enter"||this.isPressing)return;const ot=at=>{at.key!=="Enter"||!this.checkPressEnd()||fireSyntheticPointerEvent("up",(nt,it)=>{const{onTap:j}=this.node.getProps();j&&frame.postRender(()=>j(nt,it))})};this.removeEndListeners(),this.removeEndListeners=addDomEvent(this.node.current,"keyup",ot),fireSyntheticPointerEvent("down",(at,nt)=>{this.startPress(at,nt)})},o=addDomEvent(this.node.current,"keydown",s),a=()=>{this.isPressing&&fireSyntheticPointerEvent("cancel",(tt,ot)=>this.cancelPress(tt,ot))},rt=addDomEvent(this.node.current,"blur",a);this.removeAccessibleListeners=pipe(o,rt)}}startPress(s,o){this.isPressing=!0;const{onTapStart:a,whileTap:rt}=this.node.getProps();rt&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),a&&frame.postRender(()=>a(s,o))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!isDragActive()}cancelPress(s,o){if(!this.checkPressEnd())return;const{onTapCancel:a}=this.node.getProps();a&&frame.postRender(()=>a(s,o))}mount(){const s=this.node.getProps(),o=addPointerEvent(s.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(s.onTapStart||s.onPointerStart)}),a=addDomEvent(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=pipe(o,a)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const observerCallbacks=new WeakMap,observers=new WeakMap,fireObserverCallback=i=>{const s=observerCallbacks.get(i.target);s&&s(i)},fireAllObserverCallbacks=i=>{i.forEach(fireObserverCallback)};function initIntersectionObserver({root:i,...s}){const o=i||document;observers.has(o)||observers.set(o,{});const a=observers.get(o),rt=JSON.stringify(s);return a[rt]||(a[rt]=new IntersectionObserver(fireAllObserverCallbacks,{root:i,...s})),a[rt]}function observeIntersection(i,s,o){const a=initIntersectionObserver(s);return observerCallbacks.set(i,o),a.observe(i),()=>{observerCallbacks.delete(i),a.unobserve(i)}}const thresholdNames={some:0,all:1};class InViewFeature extends Feature{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:s={}}=this.node.getProps(),{root:o,margin:a,amount:rt="some",once:tt}=s,ot={root:o?o.current:void 0,rootMargin:a,threshold:typeof rt=="number"?rt:thresholdNames[rt]},at=nt=>{const{isIntersecting:it}=nt;if(this.isInView===it||(this.isInView=it,tt&&!it&&this.hasEnteredView))return;it&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",it);const{onViewportEnter:j,onViewportLeave:_}=this.node.getProps(),$=it?j:_;$&&$(nt)};return observeIntersection(this.node.current,ot,at)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:s,prevProps:o}=this.node;["amount","margin","root"].some(hasViewportOptionChanged(s,o))&&this.startObserver()}unmount(){}}function hasViewportOptionChanged({viewport:i={}},{viewport:s={}}={}){return o=>i[o]!==s[o]}const gestureAnimations={inView:{Feature:InViewFeature},tap:{Feature:PressGesture},focus:{Feature:FocusGesture},hover:{Feature:HoverGesture}};function shallowCompare(i,s){if(!Array.isArray(s))return!1;const o=s.length;if(o!==i.length)return!1;for(let a=0;ai*1e3,millisecondsToSeconds=i=>i/1e3,underDampedSpring={type:"spring",stiffness:500,damping:25,restSpeed:10},criticallyDampedSpring=i=>({type:"spring",stiffness:550,damping:i===0?2*Math.sqrt(550):30,restSpeed:10}),keyframesTransition={type:"keyframes",duration:.8},ease={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},getDefaultTransition=(i,{keyframes:s})=>s.length>2?keyframesTransition:transformProps.has(i)?i.startsWith("scale")?criticallyDampedSpring(s[1]):underDampedSpring:ease;function isTransitionDefined({when:i,delay:s,delayChildren:o,staggerChildren:a,staggerDirection:rt,repeat:tt,repeatType:ot,repeatDelay:at,from:nt,elapsed:it,...j}){return!!Object.keys(j).length}function getValueTransition(i,s){return i[s]||i.default||i}const isNotNull=i=>i!==null;function getFinalKeyframe(i,{repeat:s,repeatType:o="loop"},a){const rt=i.filter(isNotNull),tt=s&&o!=="loop"&&s%2===1?0:rt.length-1;return!tt||a===void 0?rt[tt]:a}const isZeroValueString=i=>/^0[^.\s]+$/u.test(i);function isNone(i){return typeof i=="number"?i===0:i!==null?i==="none"||i==="0"||isZeroValueString(i):!0}const isNumericalString=i=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(i),splitCSSVariableRegex=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function parseCSSVariable(i){const s=splitCSSVariableRegex.exec(i);if(!s)return[,];const[,o,a,rt]=s;return[`--${o??a}`,rt]}function getVariableValue(i,s,o=1){const[a,rt]=parseCSSVariable(i);if(!a)return;const tt=window.getComputedStyle(s).getPropertyValue(a);if(tt){const ot=tt.trim();return isNumericalString(ot)?parseFloat(ot):ot}return isCSSVariableToken(rt)?getVariableValue(rt,s,o+1):rt}const positionalKeys=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),isNumOrPxType=i=>i===number||i===px,getPosFromMatrix=(i,s)=>parseFloat(i.split(", ")[s]),getTranslateFromMatrix=(i,s)=>(o,{transform:a})=>{if(a==="none"||!a)return 0;const rt=a.match(/^matrix3d\((.+)\)$/u);if(rt)return getPosFromMatrix(rt[1],s);{const tt=a.match(/^matrix\((.+)\)$/u);return tt?getPosFromMatrix(tt[1],i):0}},transformKeys=new Set(["x","y","z"]),nonTranslationalTransformKeys=transformPropOrder.filter(i=>!transformKeys.has(i));function removeNonTranslationalTransform(i){const s=[];return nonTranslationalTransformKeys.forEach(o=>{const a=i.getValue(o);a!==void 0&&(s.push([o,a.get()]),a.set(o.startsWith("scale")?1:0))}),s}const positionalValues={width:({x:i},{paddingLeft:s="0",paddingRight:o="0"})=>i.max-i.min-parseFloat(s)-parseFloat(o),height:({y:i},{paddingTop:s="0",paddingBottom:o="0"})=>i.max-i.min-parseFloat(s)-parseFloat(o),top:(i,{top:s})=>parseFloat(s),left:(i,{left:s})=>parseFloat(s),bottom:({y:i},{top:s})=>parseFloat(s)+(i.max-i.min),right:({x:i},{left:s})=>parseFloat(s)+(i.max-i.min),x:getTranslateFromMatrix(4,13),y:getTranslateFromMatrix(5,14)};positionalValues.translateX=positionalValues.x;positionalValues.translateY=positionalValues.y;const testValueType=i=>s=>s.test(i),auto={test:i=>i==="auto",parse:i=>i},dimensionValueTypes=[number,px,percent,degrees,vw,vh,auto],findDimensionValueType=i=>dimensionValueTypes.find(testValueType(i)),toResolve=new Set;let isScheduled=!1,anyNeedsMeasurement=!1;function measureAllKeyframes(){if(anyNeedsMeasurement){const i=Array.from(toResolve).filter(a=>a.needsMeasurement),s=new Set(i.map(a=>a.element)),o=new Map;s.forEach(a=>{const rt=removeNonTranslationalTransform(a);rt.length&&(o.set(a,rt),a.render())}),i.forEach(a=>a.measureInitialState()),s.forEach(a=>{a.render();const rt=o.get(a);rt&&rt.forEach(([tt,ot])=>{var at;(at=a.getValue(tt))===null||at===void 0||at.set(ot)})}),i.forEach(a=>a.measureEndState()),i.forEach(a=>{a.suspendedScrollY!==void 0&&window.scrollTo(0,a.suspendedScrollY)})}anyNeedsMeasurement=!1,isScheduled=!1,toResolve.forEach(i=>i.complete()),toResolve.clear()}function readAllKeyframes(){toResolve.forEach(i=>{i.readKeyframes(),i.needsMeasurement&&(anyNeedsMeasurement=!0)})}function flushKeyframeResolvers(){readAllKeyframes(),measureAllKeyframes()}class KeyframeResolver{constructor(s,o,a,rt,tt,ot=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...s],this.onComplete=o,this.name=a,this.motionValue=rt,this.element=tt,this.isAsync=ot}scheduleResolve(){this.isScheduled=!0,this.isAsync?(toResolve.add(this),isScheduled||(isScheduled=!0,frame.read(readAllKeyframes),frame.resolveKeyframes(measureAllKeyframes))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:s,name:o,element:a,motionValue:rt}=this;for(let tt=0;tto=>!!(isString$1(o)&&singleColorRegex.test(o)&&o.startsWith(i)||s&&!isNullish(o)&&Object.prototype.hasOwnProperty.call(o,s)),splitColor=(i,s,o)=>a=>{if(!isString$1(a))return a;const[rt,tt,ot,at]=a.match(floatRegex);return{[i]:parseFloat(rt),[s]:parseFloat(tt),[o]:parseFloat(ot),alpha:at!==void 0?parseFloat(at):1}},clampRgbUnit=i=>clamp(0,255,i),rgbUnit={...number,transform:i=>Math.round(clampRgbUnit(i))},rgba={test:isColorString("rgb","red"),parse:splitColor("red","green","blue"),transform:({red:i,green:s,blue:o,alpha:a=1})=>"rgba("+rgbUnit.transform(i)+", "+rgbUnit.transform(s)+", "+rgbUnit.transform(o)+", "+sanitize(alpha.transform(a))+")"};function parseHex(i){let s="",o="",a="",rt="";return i.length>5?(s=i.substring(1,3),o=i.substring(3,5),a=i.substring(5,7),rt=i.substring(7,9)):(s=i.substring(1,2),o=i.substring(2,3),a=i.substring(3,4),rt=i.substring(4,5),s+=s,o+=o,a+=a,rt+=rt),{red:parseInt(s,16),green:parseInt(o,16),blue:parseInt(a,16),alpha:rt?parseInt(rt,16)/255:1}}const hex={test:isColorString("#"),parse:parseHex,transform:rgba.transform},hsla={test:isColorString("hsl","hue"),parse:splitColor("hue","saturation","lightness"),transform:({hue:i,saturation:s,lightness:o,alpha:a=1})=>"hsla("+Math.round(i)+", "+percent.transform(sanitize(s))+", "+percent.transform(sanitize(o))+", "+sanitize(alpha.transform(a))+")"},color={test:i=>rgba.test(i)||hex.test(i)||hsla.test(i),parse:i=>rgba.test(i)?rgba.parse(i):hsla.test(i)?hsla.parse(i):hex.parse(i),transform:i=>isString$1(i)?i:i.hasOwnProperty("red")?rgba.transform(i):hsla.transform(i)};function test(i){var s,o;return isNaN(i)&&isString$1(i)&&(((s=i.match(floatRegex))===null||s===void 0?void 0:s.length)||0)+(((o=i.match(colorRegex))===null||o===void 0?void 0:o.length)||0)>0}const NUMBER_TOKEN="number",COLOR_TOKEN="color",VAR_TOKEN="var",VAR_FUNCTION_TOKEN="var(",SPLIT_TOKEN="${}",complexRegex=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function analyseComplexValue(i){const s=i.toString(),o=[],a={color:[],number:[],var:[]},rt=[];let tt=0;const at=s.replace(complexRegex,nt=>(color.test(nt)?(a.color.push(tt),rt.push(COLOR_TOKEN),o.push(color.parse(nt))):nt.startsWith(VAR_FUNCTION_TOKEN)?(a.var.push(tt),rt.push(VAR_TOKEN),o.push(nt)):(a.number.push(tt),rt.push(NUMBER_TOKEN),o.push(parseFloat(nt))),++tt,SPLIT_TOKEN)).split(SPLIT_TOKEN);return{values:o,split:at,indexes:a,types:rt}}function parseComplexValue(i){return analyseComplexValue(i).values}function createTransformer(i){const{split:s,types:o}=analyseComplexValue(i),a=s.length;return rt=>{let tt="";for(let ot=0;ottypeof i=="number"?0:i;function getAnimatableNone$1(i){const s=parseComplexValue(i);return createTransformer(i)(s.map(convertNumbersToZero))}const complex={test,parse:parseComplexValue,createTransformer,getAnimatableNone:getAnimatableNone$1},maxDefaults=new Set(["brightness","contrast","saturate","opacity"]);function applyDefaultFilter(i){const[s,o]=i.slice(0,-1).split("(");if(s==="drop-shadow")return i;const[a]=o.match(floatRegex)||[];if(!a)return i;const rt=o.replace(a,"");let tt=maxDefaults.has(s)?1:0;return a!==o&&(tt*=100),s+"("+tt+rt+")"}const functionRegex=/\b([a-z-]*)\(.*?\)/gu,filter$1={...complex,getAnimatableNone:i=>{const s=i.match(functionRegex);return s?s.map(applyDefaultFilter).join(" "):i}},defaultValueTypes={...numberValueTypes,color,backgroundColor:color,outlineColor:color,fill:color,stroke:color,borderColor:color,borderTopColor:color,borderRightColor:color,borderBottomColor:color,borderLeftColor:color,filter:filter$1,WebkitFilter:filter$1},getDefaultValueType=i=>defaultValueTypes[i];function getAnimatableNone(i,s){let o=getDefaultValueType(i);return o!==filter$1&&(o=complex),o.getAnimatableNone?o.getAnimatableNone(s):void 0}const invalidTemplates=new Set(["auto","none","0"]);function makeNoneKeyframesAnimatable(i,s,o){let a=0,rt;for(;a{o.getValue(nt).set(it)}),this.resolveNoneKeyframes()}}function memo(i){let s;return()=>(s===void 0&&(s=i()),s)}let now;function clearTime(){now=void 0}const time={now:()=>(now===void 0&&time.set(frameData.isProcessing||MotionGlobalConfig.useManualTiming?frameData.timestamp:performance.now()),now),set:i=>{now=i,queueMicrotask(clearTime)}},isAnimatable=(i,s)=>s==="zIndex"?!1:!!(typeof i=="number"||Array.isArray(i)||typeof i=="string"&&(complex.test(i)||i==="0")&&!i.startsWith("url("));function hasKeyframesChanged(i){const s=i[0];if(i.length===1)return!0;for(let o=0;oMAX_RESOLVE_DELAY?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&flushKeyframeResolvers(),this._resolved}onKeyframesResolved(s,o){this.resolvedAt=time.now(),this.hasAttemptedResolve=!0;const{name:a,type:rt,velocity:tt,delay:ot,onComplete:at,onUpdate:nt,isGenerator:it}=this.options;if(!it&&!canAnimate(s,a,rt,tt))if(ot)this.options.duration=0;else{nt==null||nt(getFinalKeyframe(s,this.options,o)),at==null||at(),this.resolveFinishedPromise();return}const j=this.initPlayback(s,o);j!==!1&&(this._resolved={keyframes:s,finalKeyframe:o,...j},this.onPostResolved())}onPostResolved(){}then(s,o){return this.currentFinishedPromise.then(s,o)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(s=>{this.resolveFinishedPromise=s})}}function velocityPerSecond(i,s){return s?i*(1e3/s):0}const velocitySampleDuration=5;function calcGeneratorVelocity(i,s,o){const a=Math.max(s-velocitySampleDuration,0);return velocityPerSecond(o-i(a),s-a)}const safeMin=.001,minDuration=.01,maxDuration$1=10,minDamping=.05,maxDamping=1;function findSpring({duration:i=800,bounce:s=.25,velocity:o=0,mass:a=1}){let rt,tt,ot=1-s;ot=clamp(minDamping,maxDamping,ot),i=clamp(minDuration,maxDuration$1,millisecondsToSeconds(i)),ot<1?(rt=it=>{const j=it*ot,_=j*i,$=j-o,et=calcAngularFreq(it,ot),st=Math.exp(-_);return safeMin-$/et*st},tt=it=>{const _=it*ot*i,$=_*o+o,et=Math.pow(ot,2)*Math.pow(it,2)*i,st=Math.exp(-_),lt=calcAngularFreq(Math.pow(it,2),ot);return(-rt(it)+safeMin>0?-1:1)*(($-et)*st)/lt}):(rt=it=>{const j=Math.exp(-it*i),_=(it-o)*i+1;return-safeMin+j*_},tt=it=>{const j=Math.exp(-it*i),_=(o-it)*(i*i);return j*_});const at=5/i,nt=approximateRoot(rt,tt,at);if(i=secondsToMilliseconds(i),isNaN(nt))return{stiffness:100,damping:10,duration:i};{const it=Math.pow(nt,2)*a;return{stiffness:it,damping:ot*2*Math.sqrt(a*it),duration:i}}}const rootIterations=12;function approximateRoot(i,s,o){let a=o;for(let rt=1;rti[o]!==void 0)}function getSpringOptions(i){let s={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...i};if(!isSpringType(i,physicsKeys)&&isSpringType(i,durationKeys)){const o=findSpring(i);s={...s,...o,mass:1},s.isResolvedFromDuration=!0}return s}function spring({keyframes:i,restDelta:s,restSpeed:o,...a}){const rt=i[0],tt=i[i.length-1],ot={done:!1,value:rt},{stiffness:at,damping:nt,mass:it,duration:j,velocity:_,isResolvedFromDuration:$}=getSpringOptions({...a,velocity:-millisecondsToSeconds(a.velocity||0)}),et=_||0,st=nt/(2*Math.sqrt(at*it)),lt=tt-rt,ct=millisecondsToSeconds(Math.sqrt(at/it)),ht=Math.abs(lt)<5;o||(o=ht?.01:2),s||(s=ht?.005:.5);let ut;if(st<1){const pt=calcAngularFreq(ct,st);ut=mt=>{const gt=Math.exp(-st*ct*mt);return tt-gt*((et+st*ct*lt)/pt*Math.sin(pt*mt)+lt*Math.cos(pt*mt))}}else if(st===1)ut=pt=>tt-Math.exp(-ct*pt)*(lt+(et+ct*lt)*pt);else{const pt=ct*Math.sqrt(st*st-1);ut=mt=>{const gt=Math.exp(-st*ct*mt),dt=Math.min(pt*mt,300);return tt-gt*((et+st*ct*lt)*Math.sinh(dt)+pt*lt*Math.cosh(dt))/pt}}return{calculatedDuration:$&&j||null,next:pt=>{const mt=ut(pt);if($)ot.done=pt>=j;else{let gt=0;st<1&&(gt=pt===0?secondsToMilliseconds(et):calcGeneratorVelocity(ut,pt,mt));const dt=Math.abs(gt)<=o,St=Math.abs(tt-mt)<=s;ot.done=dt&&St}return ot.value=ot.done?tt:mt,ot}}}function inertia({keyframes:i,velocity:s=0,power:o=.8,timeConstant:a=325,bounceDamping:rt=10,bounceStiffness:tt=500,modifyTarget:ot,min:at,max:nt,restDelta:it=.5,restSpeed:j}){const _=i[0],$={done:!1,value:_},et=xt=>at!==void 0&&xtnt,st=xt=>at===void 0?nt:nt===void 0||Math.abs(at-xt)-lt*Math.exp(-xt/a),pt=xt=>ht+ut(xt),mt=xt=>{const yt=ut(xt),_t=pt(xt);$.done=Math.abs(yt)<=it,$.value=$.done?ht:_t};let gt,dt;const St=xt=>{et($.value)&&(gt=xt,dt=spring({keyframes:[$.value,st($.value)],velocity:calcGeneratorVelocity(pt,xt,$.value),damping:rt,stiffness:tt,restDelta:it,restSpeed:j}))};return St(0),{calculatedDuration:null,next:xt=>{let yt=!1;return!dt&>===void 0&&(yt=!0,mt(xt),St(xt)),gt!==void 0&&xt>=gt?dt.next(xt-gt):(!yt&&mt(xt),$)}}}const calcBezier=(i,s,o)=>(((1-3*o+3*s)*i+(3*o-6*s))*i+3*s)*i,subdivisionPrecision=1e-7,subdivisionMaxIterations=12;function binarySubdivide(i,s,o,a,rt){let tt,ot,at=0;do ot=s+(o-s)/2,tt=calcBezier(ot,a,rt)-i,tt>0?o=ot:s=ot;while(Math.abs(tt)>subdivisionPrecision&&++atbinarySubdivide(tt,0,1,i,o);return tt=>tt===0||tt===1?tt:calcBezier(rt(tt),s,a)}const easeIn=cubicBezier(.42,0,1,1),easeOut=cubicBezier(0,0,.58,1),easeInOut=cubicBezier(.42,0,.58,1),isEasingArray=i=>Array.isArray(i)&&typeof i[0]!="number",mirrorEasing=i=>s=>s<=.5?i(2*s)/2:(2-i(2*(1-s)))/2,reverseEasing=i=>s=>1-i(1-s),circIn=i=>1-Math.sin(Math.acos(i)),circOut=reverseEasing(circIn),circInOut=mirrorEasing(circIn),backOut=cubicBezier(.33,1.53,.69,.99),backIn=reverseEasing(backOut),backInOut=mirrorEasing(backIn),anticipate=i=>(i*=2)<1?.5*backIn(i):.5*(2-Math.pow(2,-10*(i-1))),easingLookup={linear:noop$1,easeIn,easeInOut,easeOut,circIn,circInOut,circOut,backIn,backInOut,backOut,anticipate},easingDefinitionToFunction=i=>{if(Array.isArray(i)){invariant(i.length===4);const[s,o,a,rt]=i;return cubicBezier(s,o,a,rt)}else if(typeof i=="string")return invariant(easingLookup[i]!==void 0),easingLookup[i];return i},progress=(i,s,o)=>{const a=s-i;return a===0?1:(o-i)/a},mixNumber$1=(i,s,o)=>i+(s-i)*o;function hueToRgb(i,s,o){return o<0&&(o+=1),o>1&&(o-=1),o<1/6?i+(s-i)*6*o:o<1/2?s:o<2/3?i+(s-i)*(2/3-o)*6:i}function hslaToRgba({hue:i,saturation:s,lightness:o,alpha:a}){i/=360,s/=100,o/=100;let rt=0,tt=0,ot=0;if(!s)rt=tt=ot=o;else{const at=o<.5?o*(1+s):o+s-o*s,nt=2*o-at;rt=hueToRgb(nt,at,i+1/3),tt=hueToRgb(nt,at,i),ot=hueToRgb(nt,at,i-1/3)}return{red:Math.round(rt*255),green:Math.round(tt*255),blue:Math.round(ot*255),alpha:a}}function mixImmediate(i,s){return o=>o>0?s:i}const mixLinearColor=(i,s,o)=>{const a=i*i,rt=o*(s*s-a)+a;return rt<0?0:Math.sqrt(rt)},colorTypes=[hex,rgba,hsla],getColorType=i=>colorTypes.find(s=>s.test(i));function asRGBA(i){const s=getColorType(i);if(!s)return!1;let o=s.parse(i);return s===hsla&&(o=hslaToRgba(o)),o}const mixColor=(i,s)=>{const o=asRGBA(i),a=asRGBA(s);if(!o||!a)return mixImmediate(i,s);const rt={...o};return tt=>(rt.red=mixLinearColor(o.red,a.red,tt),rt.green=mixLinearColor(o.green,a.green,tt),rt.blue=mixLinearColor(o.blue,a.blue,tt),rt.alpha=mixNumber$1(o.alpha,a.alpha,tt),rgba.transform(rt))},invisibleValues=new Set(["none","hidden"]);function mixVisibility(i,s){return invisibleValues.has(i)?o=>o<=0?i:s:o=>o>=1?s:i}function mixNumber(i,s){return o=>mixNumber$1(i,s,o)}function getMixer(i){return typeof i=="number"?mixNumber:typeof i=="string"?isCSSVariableToken(i)?mixImmediate:color.test(i)?mixColor:mixComplex:Array.isArray(i)?mixArray:typeof i=="object"?color.test(i)?mixColor:mixObject:mixImmediate}function mixArray(i,s){const o=[...i],a=o.length,rt=i.map((tt,ot)=>getMixer(tt)(tt,s[ot]));return tt=>{for(let ot=0;ot{for(const tt in a)o[tt]=a[tt](rt);return o}}function matchOrder(i,s){var o;const a=[],rt={color:0,var:0,number:0};for(let tt=0;tt{const o=complex.createTransformer(s),a=analyseComplexValue(i),rt=analyseComplexValue(s);return a.indexes.var.length===rt.indexes.var.length&&a.indexes.color.length===rt.indexes.color.length&&a.indexes.number.length>=rt.indexes.number.length?invisibleValues.has(i)&&!rt.values.length||invisibleValues.has(s)&&!a.values.length?mixVisibility(i,s):pipe(mixArray(matchOrder(a,rt),rt.values),o):mixImmediate(i,s)};function mix(i,s,o){return typeof i=="number"&&typeof s=="number"&&typeof o=="number"?mixNumber$1(i,s,o):getMixer(i)(i,s)}function createMixers(i,s,o){const a=[],rt=o||mix,tt=i.length-1;for(let ot=0;ots[0];if(tt===2&&i[0]===i[1])return()=>s[1];i[0]>i[tt-1]&&(i=[...i].reverse(),s=[...s].reverse());const ot=createMixers(s,a,rt),at=ot.length,nt=it=>{let j=0;if(at>1)for(;jnt(clamp(i[0],i[tt-1],it)):nt}function fillOffset(i,s){const o=i[i.length-1];for(let a=1;a<=s;a++){const rt=progress(0,s,a);i.push(mixNumber$1(o,1,rt))}}function defaultOffset(i){const s=[0];return fillOffset(s,i.length-1),s}function convertOffsetToTimes(i,s){return i.map(o=>o*s)}function defaultEasing(i,s){return i.map(()=>s||easeInOut).splice(0,i.length-1)}function keyframes({duration:i=300,keyframes:s,times:o,ease:a="easeInOut"}){const rt=isEasingArray(a)?a.map(easingDefinitionToFunction):easingDefinitionToFunction(a),tt={done:!1,value:s[0]},ot=convertOffsetToTimes(o&&o.length===s.length?o:defaultOffset(s),i),at=interpolate(ot,s,{ease:Array.isArray(rt)?rt:defaultEasing(s,rt)});return{calculatedDuration:i,next:nt=>(tt.value=at(nt),tt.done=nt>=i,tt)}}const maxGeneratorDuration=2e4;function calcGeneratorDuration(i){let s=0;const o=50;let a=i.next(s);for(;!a.done&&s=maxGeneratorDuration?1/0:s}const frameloopDriver=i=>{const s=({timestamp:o})=>i(o);return{start:()=>frame.update(s,!0),stop:()=>cancelFrame(s),now:()=>frameData.isProcessing?frameData.timestamp:time.now()}},generators={decay:inertia,inertia,tween:keyframes,keyframes,spring},percentToProgress=i=>i/100;class MainThreadAnimation extends BaseAnimation{constructor(s){super(s),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:nt}=this.options;nt&&nt()};const{name:o,motionValue:a,element:rt,keyframes:tt}=this.options,ot=(rt==null?void 0:rt.KeyframeResolver)||KeyframeResolver,at=(nt,it)=>this.onKeyframesResolved(nt,it);this.resolver=new ot(tt,at,o,a,rt),this.resolver.scheduleResolve()}initPlayback(s){const{type:o="keyframes",repeat:a=0,repeatDelay:rt=0,repeatType:tt,velocity:ot=0}=this.options,at=generators[o]||keyframes;let nt,it;at!==keyframes&&typeof s[0]!="number"&&(nt=pipe(percentToProgress,mix(s[0],s[1])),s=[0,100]);const j=at({...this.options,keyframes:s});tt==="mirror"&&(it=at({...this.options,keyframes:[...s].reverse(),velocity:-ot})),j.calculatedDuration===null&&(j.calculatedDuration=calcGeneratorDuration(j));const{calculatedDuration:_}=j,$=_+rt,et=$*(a+1)-rt;return{generator:j,mirroredGenerator:it,mapPercentToKeyframes:nt,calculatedDuration:_,resolvedDuration:$,totalDuration:et}}onPostResolved(){const{autoplay:s=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!s?this.pause():this.state=this.pendingPlayState}tick(s,o=!1){const{resolved:a}=this;if(!a){const{keyframes:xt}=this.options;return{done:!0,value:xt[xt.length-1]}}const{finalKeyframe:rt,generator:tt,mirroredGenerator:ot,mapPercentToKeyframes:at,keyframes:nt,calculatedDuration:it,totalDuration:j,resolvedDuration:_}=a;if(this.startTime===null)return tt.next(0);const{delay:$,repeat:et,repeatType:st,repeatDelay:lt,onUpdate:ct}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,s):this.speed<0&&(this.startTime=Math.min(s-j/this.speed,this.startTime)),o?this.currentTime=s:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(s-this.startTime)*this.speed;const ht=this.currentTime-$*(this.speed>=0?1:-1),ut=this.speed>=0?ht<0:ht>j;this.currentTime=Math.max(ht,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=j);let pt=this.currentTime,mt=tt;if(et){const xt=Math.min(this.currentTime,j)/_;let yt=Math.floor(xt),_t=xt%1;!_t&&xt>=1&&(_t=1),_t===1&&yt--,yt=Math.min(yt,et+1),!!(yt%2)&&(st==="reverse"?(_t=1-_t,lt&&(_t-=lt/_)):st==="mirror"&&(mt=ot)),pt=clamp(0,1,_t)*_}const gt=ut?{done:!1,value:nt[0]}:mt.next(pt);at&&(gt.value=at(gt.value));let{done:dt}=gt;!ut&&it!==null&&(dt=this.speed>=0?this.currentTime>=j:this.currentTime<=0);const St=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&dt);return St&&rt!==void 0&&(gt.value=getFinalKeyframe(nt,this.options,rt)),ct&&ct(gt.value),St&&this.finish(),gt}get duration(){const{resolved:s}=this;return s?millisecondsToSeconds(s.calculatedDuration):0}get time(){return millisecondsToSeconds(this.currentTime)}set time(s){s=secondsToMilliseconds(s),this.currentTime=s,this.holdTime!==null||this.speed===0?this.holdTime=s:this.driver&&(this.startTime=this.driver.now()-s/this.speed)}get speed(){return this.playbackSpeed}set speed(s){const o=this.playbackSpeed!==s;this.playbackSpeed=s,o&&(this.time=millisecondsToSeconds(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:s=frameloopDriver,onPlay:o,startTime:a}=this.options;this.driver||(this.driver=s(tt=>this.tick(tt))),o&&o();const rt=this.driver.now();this.holdTime!==null?this.startTime=rt-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=rt):this.startTime=a??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var s;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(s=this.currentTime)!==null&&s!==void 0?s:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:s}=this.options;s&&s()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(s){return this.startTime=0,this.tick(s,!0)}}const isBezierDefinition=i=>Array.isArray(i)&&typeof i[0]=="number";function isWaapiSupportedEasing(i){return!!(!i||typeof i=="string"&&i in supportedWaapiEasing||isBezierDefinition(i)||Array.isArray(i)&&i.every(isWaapiSupportedEasing))}const cubicBezierAsString=([i,s,o,a])=>`cubic-bezier(${i}, ${s}, ${o}, ${a})`,supportedWaapiEasing={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:cubicBezierAsString([0,.65,.55,1]),circOut:cubicBezierAsString([.55,0,1,.45]),backIn:cubicBezierAsString([.31,.01,.66,-.59]),backOut:cubicBezierAsString([.33,1.53,.69,.99])};function mapEasingToNativeEasingWithDefault(i){return mapEasingToNativeEasing(i)||supportedWaapiEasing.easeOut}function mapEasingToNativeEasing(i){if(i)return isBezierDefinition(i)?cubicBezierAsString(i):Array.isArray(i)?i.map(mapEasingToNativeEasingWithDefault):supportedWaapiEasing[i]}function animateStyle(i,s,o,{delay:a=0,duration:rt=300,repeat:tt=0,repeatType:ot="loop",ease:at,times:nt}={}){const it={[s]:o};nt&&(it.offset=nt);const j=mapEasingToNativeEasing(at);return Array.isArray(j)&&(it.easing=j),i.animate(it,{delay:a,duration:rt,easing:Array.isArray(j)?"linear":j,fill:"both",iterations:tt+1,direction:ot==="reverse"?"alternate":"normal"})}const supportsWaapi=memo(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),sampleDelta=10,maxDuration=2e4;function requiresPregeneratedKeyframes(i){return i.type==="spring"||!isWaapiSupportedEasing(i.ease)}function pregenerateKeyframes(i,s){const o=new MainThreadAnimation({...s,keyframes:i,repeat:0,delay:0,isGenerator:!0});let a={done:!1,value:i[0]};const rt=[];let tt=0;for(;!a.done&&ttthis.onKeyframesResolved(ot,at),o,a,rt),this.resolver.scheduleResolve()}initPlayback(s,o){var a;let{duration:rt=300,times:tt,ease:ot,type:at,motionValue:nt,name:it,startTime:j}=this.options;if(!(!((a=nt.owner)===null||a===void 0)&&a.current))return!1;if(requiresPregeneratedKeyframes(this.options)){const{onComplete:$,onUpdate:et,motionValue:st,element:lt,...ct}=this.options,ht=pregenerateKeyframes(s,ct);s=ht.keyframes,s.length===1&&(s[1]=s[0]),rt=ht.duration,tt=ht.times,ot=ht.ease,at="keyframes"}const _=animateStyle(nt.owner.current,it,s,{...this.options,duration:rt,times:tt,ease:ot});return _.startTime=j??this.calcStartTime(),this.pendingTimeline?(_.timeline=this.pendingTimeline,this.pendingTimeline=void 0):_.onfinish=()=>{const{onComplete:$}=this.options;nt.set(getFinalKeyframe(s,this.options,o)),$&&$(),this.cancel(),this.resolveFinishedPromise()},{animation:_,duration:rt,times:tt,type:at,ease:ot,keyframes:s}}get duration(){const{resolved:s}=this;if(!s)return 0;const{duration:o}=s;return millisecondsToSeconds(o)}get time(){const{resolved:s}=this;if(!s)return 0;const{animation:o}=s;return millisecondsToSeconds(o.currentTime||0)}set time(s){const{resolved:o}=this;if(!o)return;const{animation:a}=o;a.currentTime=secondsToMilliseconds(s)}get speed(){const{resolved:s}=this;if(!s)return 1;const{animation:o}=s;return o.playbackRate}set speed(s){const{resolved:o}=this;if(!o)return;const{animation:a}=o;a.playbackRate=s}get state(){const{resolved:s}=this;if(!s)return"idle";const{animation:o}=s;return o.playState}get startTime(){const{resolved:s}=this;if(!s)return null;const{animation:o}=s;return o.startTime}attachTimeline(s){if(!this._resolved)this.pendingTimeline=s;else{const{resolved:o}=this;if(!o)return noop$1;const{animation:a}=o;a.timeline=s,a.onfinish=null}return noop$1}play(){if(this.isStopped)return;const{resolved:s}=this;if(!s)return;const{animation:o}=s;o.playState==="finished"&&this.updateFinishedPromise(),o.play()}pause(){const{resolved:s}=this;if(!s)return;const{animation:o}=s;o.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:s}=this;if(!s)return;const{animation:o,keyframes:a,duration:rt,type:tt,ease:ot,times:at}=s;if(o.playState==="idle"||o.playState==="finished")return;if(this.time){const{motionValue:it,onUpdate:j,onComplete:_,element:$,...et}=this.options,st=new MainThreadAnimation({...et,keyframes:a,duration:rt,type:tt,ease:ot,times:at,isGenerator:!0}),lt=secondsToMilliseconds(this.time);it.setWithVelocity(st.sample(lt-sampleDelta).value,st.sample(lt).value,sampleDelta)}const{onStop:nt}=this.options;nt&&nt(),this.cancel()}complete(){const{resolved:s}=this;s&&s.animation.finish()}cancel(){const{resolved:s}=this;s&&s.animation.cancel()}static supports(s){const{motionValue:o,name:a,repeatDelay:rt,repeatType:tt,damping:ot,type:at}=s;return supportsWaapi()&&a&&acceleratedValues.has(a)&&o&&o.owner&&o.owner.current instanceof HTMLElement&&!o.owner.getProps().onUpdate&&!rt&&tt!=="mirror"&&ot!==0&&at!=="inertia"}}function observeTimeline(i,s){let o;const a=()=>{const{currentTime:rt}=s,ot=(rt===null?0:rt.value)/100;o!==ot&&i(ot),o=ot};return frame.update(a,!0),()=>cancelFrame(a)}const supportsScrollTimeline=memo(()=>window.ScrollTimeline!==void 0);class GroupPlaybackControls{constructor(s){this.stop=()=>this.runAll("stop"),this.animations=s.filter(Boolean)}then(s,o){return Promise.all(this.animations).then(s).catch(o)}getAll(s){return this.animations[0][s]}setAll(s,o){for(let a=0;a{if(supportsScrollTimeline()&&a.attachTimeline)a.attachTimeline(s);else return a.pause(),observeTimeline(rt=>{a.time=a.duration*rt},s)});return()=>{o.forEach((a,rt)=>{a&&a(),this.animations[rt].stop()})}}get time(){return this.getAll("time")}set time(s){this.setAll("time",s)}get speed(){return this.getAll("speed")}set speed(s){this.setAll("speed",s)}get startTime(){return this.getAll("startTime")}get duration(){let s=0;for(let o=0;oo[s]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const animateMotionValue=(i,s,o,a={},rt,tt,ot)=>at=>{const nt=getValueTransition(a,i)||{},it=nt.delay||a.delay||0;let{elapsed:j=0}=a;j=j-secondsToMilliseconds(it);let _={keyframes:Array.isArray(o)?o:[null,o],ease:"easeOut",velocity:s.getVelocity(),...nt,delay:-j,onUpdate:et=>{s.set(et),nt.onUpdate&&nt.onUpdate(et)},onComplete:()=>{at(),nt.onComplete&&nt.onComplete(),ot&&ot()},onStop:ot,name:i,motionValue:s,element:tt?void 0:rt};isTransitionDefined(nt)||(_={..._,...getDefaultTransition(i,_)}),_.duration&&(_.duration=secondsToMilliseconds(_.duration)),_.repeatDelay&&(_.repeatDelay=secondsToMilliseconds(_.repeatDelay)),_.from!==void 0&&(_.keyframes[0]=_.from);let $=!1;if((_.type===!1||_.duration===0&&!_.repeatDelay)&&(_.duration=0,_.delay===0&&($=!0)),$&&!tt&&s.get()!==void 0){const et=getFinalKeyframe(_.keyframes,nt);if(et!==void 0)return frame.update(()=>{_.onUpdate(et),_.onComplete()}),new GroupPlaybackControls([])}return!tt&&AcceleratedAnimation.supports(_)?new AcceleratedAnimation(_):new MainThreadAnimation(_)};class SubscriptionManager{constructor(){this.subscriptions=[]}add(s){return addUniqueItem(this.subscriptions,s),()=>removeItem(this.subscriptions,s)}notify(s,o,a){const rt=this.subscriptions.length;if(rt)if(rt===1)this.subscriptions[0](s,o,a);else for(let tt=0;tt!isNaN(parseFloat(i));class MotionValue{constructor(s,o={}){this.version="11.3.28",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(a,rt=!0)=>{const tt=time.now();this.updatedAt!==tt&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(a),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),rt&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(s),this.owner=o.owner}setCurrent(s){this.current=s,this.updatedAt=time.now(),this.canTrackVelocity===null&&s!==void 0&&(this.canTrackVelocity=isFloat(this.current))}setPrevFrameValue(s=this.current){this.prevFrameValue=s,this.prevUpdatedAt=this.updatedAt}onChange(s){return this.on("change",s)}on(s,o){this.events[s]||(this.events[s]=new SubscriptionManager);const a=this.events[s].add(o);return s==="change"?()=>{a(),frame.read(()=>{this.events.change.getSize()||this.stop()})}:a}clearListeners(){for(const s in this.events)this.events[s].clear()}attach(s,o){this.passiveEffect=s,this.stopPassiveEffect=o}set(s,o=!0){!o||!this.passiveEffect?this.updateAndNotify(s,o):this.passiveEffect(s,this.updateAndNotify)}setWithVelocity(s,o,a){this.set(o),this.prev=void 0,this.prevFrameValue=s,this.prevUpdatedAt=this.updatedAt-a}jump(s,o=!0){this.updateAndNotify(s),this.prev=s,this.prevUpdatedAt=this.prevFrameValue=void 0,o&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const s=time.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||s-this.updatedAt>MAX_VELOCITY_DELTA)return 0;const o=Math.min(this.updatedAt-this.prevUpdatedAt,MAX_VELOCITY_DELTA);return velocityPerSecond(parseFloat(this.current)-parseFloat(this.prevFrameValue),o)}start(s){return this.stop(),new Promise(o=>{this.hasAnimated=!0,this.animation=s(o),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function motionValue(i,s){return new MotionValue(i,s)}function setMotionValue(i,s,o){i.hasValue(s)?i.getValue(s).set(o):i.addValue(s,motionValue(o))}function setTarget(i,s){const o=resolveVariant(i,s);let{transitionEnd:a={},transition:rt={},...tt}=o||{};tt={...tt,...a};for(const ot in tt){const at=resolveFinalValueInKeyframes(tt[ot]);setMotionValue(i,ot,at)}}function getOptimisedAppearId(i){return i.getProps()[optimizedAppearDataAttribute]}class WillChangeMotionValue extends MotionValue{constructor(){super(...arguments),this.output=[],this.counts=new Map}add(s){const o=getWillChangeName(s);if(!o)return;const a=this.counts.get(o)||0;this.counts.set(o,a+1),a===0&&(this.output.push(o),this.update());let rt=!1;return()=>{if(rt)return;rt=!0;const tt=this.counts.get(o)-1;this.counts.set(o,tt),tt===0&&(removeItem(this.output,o),this.update())}}update(){this.set(this.output.length?this.output.join(", "):"auto")}}function isWillChangeMotionValue(i){return!!(isMotionValue(i)&&i.add)}function addValueToWillChange(i,s){var o;if(!i.applyWillChange)return;let a=i.getValue("willChange");if(!a&&!(!((o=i.props.style)===null||o===void 0)&&o.willChange)&&(a=new WillChangeMotionValue("auto"),i.addValue("willChange",a)),isWillChangeMotionValue(a))return a.add(s)}function shouldBlockAnimation({protectedKeys:i,needsAnimating:s},o){const a=i.hasOwnProperty(o)&&s[o]!==!0;return s[o]=!1,a}function animateTarget(i,s,{delay:o=0,transitionOverride:a,type:rt}={}){var tt;let{transition:ot=i.getDefaultTransition(),transitionEnd:at,...nt}=s;a&&(ot=a);const it=[],j=rt&&i.animationState&&i.animationState.getState()[rt];for(const _ in nt){const $=i.getValue(_,(tt=i.latestValues[_])!==null&&tt!==void 0?tt:null),et=nt[_];if(et===void 0||j&&shouldBlockAnimation(j,_))continue;const st={delay:o,...getValueTransition(ot||{},_)};let lt=!1;if(window.MotionHandoffAnimation){const ht=getOptimisedAppearId(i);if(ht){const ut=window.MotionHandoffAnimation(ht,_,frame);ut!==null&&(st.startTime=ut,lt=!0)}}$.start(animateMotionValue(_,$,et,i.shouldReduceMotion&&transformProps.has(_)?{type:!1}:st,i,lt,addValueToWillChange(i,_)));const ct=$.animation;ct&&it.push(ct)}return at&&Promise.all(it).then(()=>{frame.update(()=>{at&&setTarget(i,at)})}),it}function animateVariant(i,s,o={}){var a;const rt=resolveVariant(i,s,o.type==="exit"?(a=i.presenceContext)===null||a===void 0?void 0:a.custom:void 0);let{transition:tt=i.getDefaultTransition()||{}}=rt||{};o.transitionOverride&&(tt=o.transitionOverride);const ot=rt?()=>Promise.all(animateTarget(i,rt,o)):()=>Promise.resolve(),at=i.variantChildren&&i.variantChildren.size?(it=0)=>{const{delayChildren:j=0,staggerChildren:_,staggerDirection:$}=tt;return animateChildren(i,s,j+it,_,$,o)}:()=>Promise.resolve(),{when:nt}=tt;if(nt){const[it,j]=nt==="beforeChildren"?[ot,at]:[at,ot];return it().then(()=>j())}else return Promise.all([ot(),at(o.delay)])}function animateChildren(i,s,o=0,a=0,rt=1,tt){const ot=[],at=(i.variantChildren.size-1)*a,nt=rt===1?(it=0)=>it*a:(it=0)=>at-it*a;return Array.from(i.variantChildren).sort(sortByTreeOrder).forEach((it,j)=>{it.notify("AnimationStart",s),ot.push(animateVariant(it,s,{...tt,delay:o+nt(j)}).then(()=>it.notify("AnimationComplete",s)))}),Promise.all(ot)}function sortByTreeOrder(i,s){return i.sortNodePosition(s)}function animateVisualElement(i,s,o={}){i.notify("AnimationStart",s);let a;if(Array.isArray(s)){const rt=s.map(tt=>animateVariant(i,tt,o));a=Promise.all(rt)}else if(typeof s=="string")a=animateVariant(i,s,o);else{const rt=typeof s=="function"?resolveVariant(i,s,o.custom):s;a=Promise.all(animateTarget(i,rt,o))}return a.then(()=>{i.notify("AnimationComplete",s)})}const reversePriorityOrder=[...variantPriorityOrder].reverse(),numAnimationTypes=variantPriorityOrder.length;function animateList(i){return s=>Promise.all(s.map(({animation:o,options:a})=>animateVisualElement(i,o,a)))}function createAnimationState(i){let s=animateList(i),o=createState(),a=!0;const rt=nt=>(it,j)=>{var _;const $=resolveVariant(i,j,nt==="exit"?(_=i.presenceContext)===null||_===void 0?void 0:_.custom:void 0);if($){const{transition:et,transitionEnd:st,...lt}=$;it={...it,...lt,...st}}return it};function tt(nt){s=nt(i)}function ot(nt){const it=i.getProps(),j=i.getVariantContext(!0)||{},_=[],$=new Set;let et={},st=1/0;for(let ct=0;ctst&&mt,yt=!1;const _t=Array.isArray(pt)?pt:[pt];let Ct=_t.reduce(rt(ht),{});gt===!1&&(Ct={});const{prevResolvedValues:Et={}}=ut,kt={...Et,...Ct},Tt=$t=>{xt=!0,$.has($t)&&(yt=!0,$.delete($t)),ut.needsAnimating[$t]=!0;const It=i.getValue($t);It&&(It.liveStyle=!1)};for(const $t in kt){const It=Ct[$t],Ot=Et[$t];if(et.hasOwnProperty($t))continue;let Mt=!1;isKeyframesTarget(It)&&isKeyframesTarget(Ot)?Mt=!shallowCompare(It,Ot):Mt=It!==Ot,Mt?It!=null?Tt($t):$.add($t):It!==void 0&&$.has($t)?Tt($t):ut.protectedKeys[$t]=!0}ut.prevProp=pt,ut.prevResolvedValues=Ct,ut.isActive&&(et={...et,...Ct}),a&&i.blockInitialAnimation&&(xt=!1),xt&&(!dt||yt)&&_.push(..._t.map($t=>({animation:$t,options:{type:ht}})))}if($.size){const ct={};$.forEach(ht=>{const ut=i.getBaseTarget(ht),pt=i.getValue(ht);pt&&(pt.liveStyle=!0),ct[ht]=ut??null}),_.push({animation:ct})}let lt=!!_.length;return a&&(it.initial===!1||it.initial===it.animate)&&!i.manuallyAnimateOnMount&&(lt=!1),a=!1,lt?s(_):Promise.resolve()}function at(nt,it){var j;if(o[nt].isActive===it)return Promise.resolve();(j=i.variantChildren)===null||j===void 0||j.forEach($=>{var et;return(et=$.animationState)===null||et===void 0?void 0:et.setActive(nt,it)}),o[nt].isActive=it;const _=ot(nt);for(const $ in o)o[$].protectedKeys={};return _}return{animateChanges:ot,setActive:at,setAnimateFunction:tt,getState:()=>o,reset:()=>{o=createState(),a=!0}}}function checkVariantsDidChange(i,s){return typeof s=="string"?s!==i:Array.isArray(s)?!shallowCompare(s,i):!1}function createTypeState(i=!1){return{isActive:i,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function createState(){return{animate:createTypeState(!0),whileInView:createTypeState(),whileHover:createTypeState(),whileTap:createTypeState(),whileDrag:createTypeState(),whileFocus:createTypeState(),exit:createTypeState()}}class AnimationFeature extends Feature{constructor(s){super(s),s.animationState||(s.animationState=createAnimationState(s))}updateAnimationControlsSubscription(){const{animate:s}=this.node.getProps();isAnimationControls(s)&&(this.unmountControls=s.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:s}=this.node.getProps(),{animate:o}=this.node.prevProps||{};s!==o&&this.updateAnimationControlsSubscription()}unmount(){var s;this.node.animationState.reset(),(s=this.unmountControls)===null||s===void 0||s.call(this)}}let id$1=0;class ExitAnimationFeature extends Feature{constructor(){super(...arguments),this.id=id$1++}update(){if(!this.node.presenceContext)return;const{isPresent:s,onExitComplete:o}=this.node.presenceContext,{isPresent:a}=this.node.prevPresenceContext||{};if(!this.node.animationState||s===a)return;const rt=this.node.animationState.setActive("exit",!s);o&&!s&&rt.then(()=>o(this.id))}mount(){const{register:s}=this.node.presenceContext||{};s&&(this.unmount=s(this.id))}unmount(){}}const animations={animation:{Feature:AnimationFeature},exit:{Feature:ExitAnimationFeature}},distance=(i,s)=>Math.abs(i-s);function distance2D(i,s){const o=distance(i.x,s.x),a=distance(i.y,s.y);return Math.sqrt(o**2+a**2)}class PanSession{constructor(s,o,{transformPagePoint:a,contextWindow:rt,dragSnapToOrigin:tt=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const _=getPanInfo(this.lastMoveEventInfo,this.history),$=this.startEvent!==null,et=distance2D(_.offset,{x:0,y:0})>=3;if(!$&&!et)return;const{point:st}=_,{timestamp:lt}=frameData;this.history.push({...st,timestamp:lt});const{onStart:ct,onMove:ht}=this.handlers;$||(ct&&ct(this.lastMoveEvent,_),this.startEvent=this.lastMoveEvent),ht&&ht(this.lastMoveEvent,_)},this.handlePointerMove=(_,$)=>{this.lastMoveEvent=_,this.lastMoveEventInfo=transformPoint($,this.transformPagePoint),frame.update(this.updatePoint,!0)},this.handlePointerUp=(_,$)=>{this.end();const{onEnd:et,onSessionEnd:st,resumeAnimation:lt}=this.handlers;if(this.dragSnapToOrigin&<&<(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const ct=getPanInfo(_.type==="pointercancel"?this.lastMoveEventInfo:transformPoint($,this.transformPagePoint),this.history);this.startEvent&&et&&et(_,ct),st&&st(_,ct)},!isPrimaryPointer(s))return;this.dragSnapToOrigin=tt,this.handlers=o,this.transformPagePoint=a,this.contextWindow=rt||window;const ot=extractEventInfo(s),at=transformPoint(ot,this.transformPagePoint),{point:nt}=at,{timestamp:it}=frameData;this.history=[{...nt,timestamp:it}];const{onSessionStart:j}=o;j&&j(s,getPanInfo(at,this.history)),this.removeListeners=pipe(addPointerEvent(this.contextWindow,"pointermove",this.handlePointerMove),addPointerEvent(this.contextWindow,"pointerup",this.handlePointerUp),addPointerEvent(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(s){this.handlers=s}end(){this.removeListeners&&this.removeListeners(),cancelFrame(this.updatePoint)}}function transformPoint(i,s){return s?{point:s(i.point)}:i}function subtractPoint(i,s){return{x:i.x-s.x,y:i.y-s.y}}function getPanInfo({point:i},s){return{point:i,delta:subtractPoint(i,lastDevicePoint(s)),offset:subtractPoint(i,startDevicePoint(s)),velocity:getVelocity(s,.1)}}function startDevicePoint(i){return i[0]}function lastDevicePoint(i){return i[i.length-1]}function getVelocity(i,s){if(i.length<2)return{x:0,y:0};let o=i.length-1,a=null;const rt=lastDevicePoint(i);for(;o>=0&&(a=i[o],!(rt.timestamp-a.timestamp>secondsToMilliseconds(s)));)o--;if(!a)return{x:0,y:0};const tt=millisecondsToSeconds(rt.timestamp-a.timestamp);if(tt===0)return{x:0,y:0};const ot={x:(rt.x-a.x)/tt,y:(rt.y-a.y)/tt};return ot.x===1/0&&(ot.x=0),ot.y===1/0&&(ot.y=0),ot}const SCALE_PRECISION=1e-4,SCALE_MIN=1-SCALE_PRECISION,SCALE_MAX=1+SCALE_PRECISION,TRANSLATE_PRECISION=.01,TRANSLATE_MIN=0-TRANSLATE_PRECISION,TRANSLATE_MAX=0+TRANSLATE_PRECISION;function calcLength(i){return i.max-i.min}function isNear(i,s,o){return Math.abs(i-s)<=o}function calcAxisDelta(i,s,o,a=.5){i.origin=a,i.originPoint=mixNumber$1(s.min,s.max,i.origin),i.scale=calcLength(o)/calcLength(s),i.translate=mixNumber$1(o.min,o.max,i.origin)-i.originPoint,(i.scale>=SCALE_MIN&&i.scale<=SCALE_MAX||isNaN(i.scale))&&(i.scale=1),(i.translate>=TRANSLATE_MIN&&i.translate<=TRANSLATE_MAX||isNaN(i.translate))&&(i.translate=0)}function calcBoxDelta(i,s,o,a){calcAxisDelta(i.x,s.x,o.x,a?a.originX:void 0),calcAxisDelta(i.y,s.y,o.y,a?a.originY:void 0)}function calcRelativeAxis(i,s,o){i.min=o.min+s.min,i.max=i.min+calcLength(s)}function calcRelativeBox(i,s,o){calcRelativeAxis(i.x,s.x,o.x),calcRelativeAxis(i.y,s.y,o.y)}function calcRelativeAxisPosition(i,s,o){i.min=s.min-o.min,i.max=i.min+calcLength(s)}function calcRelativePosition(i,s,o){calcRelativeAxisPosition(i.x,s.x,o.x),calcRelativeAxisPosition(i.y,s.y,o.y)}function applyConstraints(i,{min:s,max:o},a){return s!==void 0&&io&&(i=a?mixNumber$1(o,i,a.max):Math.min(i,o)),i}function calcRelativeAxisConstraints(i,s,o){return{min:s!==void 0?i.min+s:void 0,max:o!==void 0?i.max+o-(i.max-i.min):void 0}}function calcRelativeConstraints(i,{top:s,left:o,bottom:a,right:rt}){return{x:calcRelativeAxisConstraints(i.x,o,rt),y:calcRelativeAxisConstraints(i.y,s,a)}}function calcViewportAxisConstraints(i,s){let o=s.min-i.min,a=s.max-i.max;return s.max-s.mina?o=progress(s.min,s.max-a,i.min):a>rt&&(o=progress(i.min,i.max-rt,s.min)),clamp(0,1,o)}function rebaseAxisConstraints(i,s){const o={};return s.min!==void 0&&(o.min=s.min-i.min),s.max!==void 0&&(o.max=s.max-i.min),o}const defaultElastic=.35;function resolveDragElastic(i=defaultElastic){return i===!1?i=0:i===!0&&(i=defaultElastic),{x:resolveAxisElastic(i,"left","right"),y:resolveAxisElastic(i,"top","bottom")}}function resolveAxisElastic(i,s,o){return{min:resolvePointElastic(i,s),max:resolvePointElastic(i,o)}}function resolvePointElastic(i,s){return typeof i=="number"?i:i[s]||0}const createAxisDelta=()=>({translate:0,scale:1,origin:0,originPoint:0}),createDelta=()=>({x:createAxisDelta(),y:createAxisDelta()}),createAxis=()=>({min:0,max:0}),createBox=()=>({x:createAxis(),y:createAxis()});function eachAxis(i){return[i("x"),i("y")]}function convertBoundingBoxToBox({top:i,left:s,right:o,bottom:a}){return{x:{min:s,max:o},y:{min:i,max:a}}}function convertBoxToBoundingBox({x:i,y:s}){return{top:s.min,right:i.max,bottom:s.max,left:i.min}}function transformBoxPoints(i,s){if(!s)return i;const o=s({x:i.left,y:i.top}),a=s({x:i.right,y:i.bottom});return{top:o.y,left:o.x,bottom:a.y,right:a.x}}function isIdentityScale(i){return i===void 0||i===1}function hasScale({scale:i,scaleX:s,scaleY:o}){return!isIdentityScale(i)||!isIdentityScale(s)||!isIdentityScale(o)}function hasTransform(i){return hasScale(i)||has2DTranslate(i)||i.z||i.rotate||i.rotateX||i.rotateY||i.skewX||i.skewY}function has2DTranslate(i){return is2DTranslate(i.x)||is2DTranslate(i.y)}function is2DTranslate(i){return i&&i!=="0%"}function scalePoint(i,s,o){const a=i-o,rt=s*a;return o+rt}function applyPointDelta(i,s,o,a,rt){return rt!==void 0&&(i=scalePoint(i,rt,a)),scalePoint(i,o,a)+s}function applyAxisDelta(i,s=0,o=1,a,rt){i.min=applyPointDelta(i.min,s,o,a,rt),i.max=applyPointDelta(i.max,s,o,a,rt)}function applyBoxDelta(i,{x:s,y:o}){applyAxisDelta(i.x,s.translate,s.scale,s.originPoint),applyAxisDelta(i.y,o.translate,o.scale,o.originPoint)}const TREE_SCALE_SNAP_MIN=.999999999999,TREE_SCALE_SNAP_MAX=1.0000000000001;function applyTreeDeltas(i,s,o,a=!1){const rt=o.length;if(!rt)return;s.x=s.y=1;let tt,ot;for(let at=0;atTREE_SCALE_SNAP_MIN&&(s.x=1),s.yTREE_SCALE_SNAP_MIN&&(s.y=1)}function translateAxis(i,s){i.min=i.min+s,i.max=i.max+s}function transformAxis(i,s,o,a,rt=.5){const tt=mixNumber$1(i.min,i.max,rt);applyAxisDelta(i,s,o,tt,a)}function transformBox(i,s){transformAxis(i.x,s.x,s.scaleX,s.scale,s.originX),transformAxis(i.y,s.y,s.scaleY,s.scale,s.originY)}function measureViewportBox(i,s){return convertBoundingBoxToBox(transformBoxPoints(i.getBoundingClientRect(),s))}function measurePageBox(i,s,o){const a=measureViewportBox(i,o),{scroll:rt}=s;return rt&&(translateAxis(a.x,rt.offset.x),translateAxis(a.y,rt.offset.y)),a}const getContextWindow=({current:i})=>i?i.ownerDocument.defaultView:null,elementDragControls=new WeakMap;class VisualElementDragControls{constructor(s){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=createBox(),this.visualElement=s}start(s,{snapToCursor:o=!1}={}){const{presenceContext:a}=this.visualElement;if(a&&a.isPresent===!1)return;const rt=j=>{const{dragSnapToOrigin:_}=this.getProps();_?this.pauseAnimation():this.stopAnimation(),o&&this.snapToCursor(extractEventInfo(j,"page").point)},tt=(j,_)=>{var $;const{drag:et,dragPropagation:st,onDragStart:lt}=this.getProps();if(et&&!st&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=getGlobalLock(et),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),eachAxis(ht=>{let ut=this.getAxisMotionValue(ht).get()||0;if(percent.test(ut)){const{projection:pt}=this.visualElement;if(pt&&pt.layout){const mt=pt.layout.layoutBox[ht];mt&&(ut=calcLength(mt)*(parseFloat(ut)/100))}}this.originPoint[ht]=ut}),lt&&frame.postRender(()=>lt(j,_)),($=this.removeWillChange)===null||$===void 0||$.call(this),this.removeWillChange=addValueToWillChange(this.visualElement,"transform");const{animationState:ct}=this.visualElement;ct&&ct.setActive("whileDrag",!0)},ot=(j,_)=>{const{dragPropagation:$,dragDirectionLock:et,onDirectionLock:st,onDrag:lt}=this.getProps();if(!$&&!this.openGlobalLock)return;const{offset:ct}=_;if(et&&this.currentDirection===null){this.currentDirection=getCurrentDirection(ct),this.currentDirection!==null&&st&&st(this.currentDirection);return}this.updateAxis("x",_.point,ct),this.updateAxis("y",_.point,ct),this.visualElement.render(),lt&<(j,_)},at=(j,_)=>this.stop(j,_),nt=()=>eachAxis(j=>{var _;return this.getAnimationState(j)==="paused"&&((_=this.getAxisMotionValue(j).animation)===null||_===void 0?void 0:_.play())}),{dragSnapToOrigin:it}=this.getProps();this.panSession=new PanSession(s,{onSessionStart:rt,onStart:tt,onMove:ot,onSessionEnd:at,resumeAnimation:nt},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:it,contextWindow:getContextWindow(this.visualElement)})}stop(s,o){var a;(a=this.removeWillChange)===null||a===void 0||a.call(this);const rt=this.isDragging;if(this.cancel(),!rt)return;const{velocity:tt}=o;this.startAnimation(tt);const{onDragEnd:ot}=this.getProps();ot&&frame.postRender(()=>ot(s,o))}cancel(){this.isDragging=!1;const{projection:s,animationState:o}=this.visualElement;s&&(s.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:a}=this.getProps();!a&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),o&&o.setActive("whileDrag",!1)}updateAxis(s,o,a){const{drag:rt}=this.getProps();if(!a||!shouldDrag(s,rt,this.currentDirection))return;const tt=this.getAxisMotionValue(s);let ot=this.originPoint[s]+a[s];this.constraints&&this.constraints[s]&&(ot=applyConstraints(ot,this.constraints[s],this.elastic[s])),tt.set(ot)}resolveConstraints(){var s;const{dragConstraints:o,dragElastic:a}=this.getProps(),rt=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)===null||s===void 0?void 0:s.layout,tt=this.constraints;o&&isRefObject(o)?this.constraints||(this.constraints=this.resolveRefConstraints()):o&&rt?this.constraints=calcRelativeConstraints(rt.layoutBox,o):this.constraints=!1,this.elastic=resolveDragElastic(a),tt!==this.constraints&&rt&&this.constraints&&!this.hasMutatedConstraints&&eachAxis(ot=>{this.constraints!==!1&&this.getAxisMotionValue(ot)&&(this.constraints[ot]=rebaseAxisConstraints(rt.layoutBox[ot],this.constraints[ot]))})}resolveRefConstraints(){const{dragConstraints:s,onMeasureDragConstraints:o}=this.getProps();if(!s||!isRefObject(s))return!1;const a=s.current,{projection:rt}=this.visualElement;if(!rt||!rt.layout)return!1;const tt=measurePageBox(a,rt.root,this.visualElement.getTransformPagePoint());let ot=calcViewportConstraints(rt.layout.layoutBox,tt);if(o){const at=o(convertBoxToBoundingBox(ot));this.hasMutatedConstraints=!!at,at&&(ot=convertBoundingBoxToBox(at))}return ot}startAnimation(s){const{drag:o,dragMomentum:a,dragElastic:rt,dragTransition:tt,dragSnapToOrigin:ot,onDragTransitionEnd:at}=this.getProps(),nt=this.constraints||{},it=eachAxis(j=>{if(!shouldDrag(j,o,this.currentDirection))return;let _=nt&&nt[j]||{};ot&&(_={min:0,max:0});const $=rt?200:1e6,et=rt?40:1e7,st={type:"inertia",velocity:a?s[j]:0,bounceStiffness:$,bounceDamping:et,timeConstant:750,restDelta:1,restSpeed:10,...tt,..._};return this.startAxisValueAnimation(j,st)});return Promise.all(it).then(at)}startAxisValueAnimation(s,o){const a=this.getAxisMotionValue(s);return a.start(animateMotionValue(s,a,0,o,this.visualElement,!1,addValueToWillChange(this.visualElement,s)))}stopAnimation(){eachAxis(s=>this.getAxisMotionValue(s).stop())}pauseAnimation(){eachAxis(s=>{var o;return(o=this.getAxisMotionValue(s).animation)===null||o===void 0?void 0:o.pause()})}getAnimationState(s){var o;return(o=this.getAxisMotionValue(s).animation)===null||o===void 0?void 0:o.state}getAxisMotionValue(s){const o=`_drag${s.toUpperCase()}`,a=this.visualElement.getProps(),rt=a[o];return rt||this.visualElement.getValue(s,(a.initial?a.initial[s]:void 0)||0)}snapToCursor(s){eachAxis(o=>{const{drag:a}=this.getProps();if(!shouldDrag(o,a,this.currentDirection))return;const{projection:rt}=this.visualElement,tt=this.getAxisMotionValue(o);if(rt&&rt.layout){const{min:ot,max:at}=rt.layout.layoutBox[o];tt.set(s[o]-mixNumber$1(ot,at,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:s,dragConstraints:o}=this.getProps(),{projection:a}=this.visualElement;if(!isRefObject(o)||!a||!this.constraints)return;this.stopAnimation();const rt={x:0,y:0};eachAxis(ot=>{const at=this.getAxisMotionValue(ot);if(at&&this.constraints!==!1){const nt=at.get();rt[ot]=calcOrigin({min:nt,max:nt},this.constraints[ot])}});const{transformTemplate:tt}=this.visualElement.getProps();this.visualElement.current.style.transform=tt?tt({},""):"none",a.root&&a.root.updateScroll(),a.updateLayout(),this.resolveConstraints(),eachAxis(ot=>{if(!shouldDrag(ot,s,null))return;const at=this.getAxisMotionValue(ot),{min:nt,max:it}=this.constraints[ot];at.set(mixNumber$1(nt,it,rt[ot]))})}addListeners(){if(!this.visualElement.current)return;elementDragControls.set(this.visualElement,this);const s=this.visualElement.current,o=addPointerEvent(s,"pointerdown",nt=>{const{drag:it,dragListener:j=!0}=this.getProps();it&&j&&this.start(nt)}),a=()=>{const{dragConstraints:nt}=this.getProps();isRefObject(nt)&&nt.current&&(this.constraints=this.resolveRefConstraints())},{projection:rt}=this.visualElement,tt=rt.addEventListener("measure",a);rt&&!rt.layout&&(rt.root&&rt.root.updateScroll(),rt.updateLayout()),frame.read(a);const ot=addDomEvent(window,"resize",()=>this.scalePositionWithinConstraints()),at=rt.addEventListener("didUpdate",({delta:nt,hasLayoutChanged:it})=>{this.isDragging&&it&&(eachAxis(j=>{const _=this.getAxisMotionValue(j);_&&(this.originPoint[j]+=nt[j].translate,_.set(_.get()+nt[j].translate))}),this.visualElement.render())});return()=>{ot(),o(),tt(),at&&at()}}getProps(){const s=this.visualElement.getProps(),{drag:o=!1,dragDirectionLock:a=!1,dragPropagation:rt=!1,dragConstraints:tt=!1,dragElastic:ot=defaultElastic,dragMomentum:at=!0}=s;return{...s,drag:o,dragDirectionLock:a,dragPropagation:rt,dragConstraints:tt,dragElastic:ot,dragMomentum:at}}}function shouldDrag(i,s,o){return(s===!0||s===i)&&(o===null||o===i)}function getCurrentDirection(i,s=10){let o=null;return Math.abs(i.y)>s?o="y":Math.abs(i.x)>s&&(o="x"),o}class DragGesture extends Feature{constructor(s){super(s),this.removeGroupControls=noop$1,this.removeListeners=noop$1,this.controls=new VisualElementDragControls(s)}mount(){const{dragControls:s}=this.node.getProps();s&&(this.removeGroupControls=s.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||noop$1}unmount(){this.removeGroupControls(),this.removeListeners()}}const asyncHandler=i=>(s,o)=>{i&&frame.postRender(()=>i(s,o))};class PanGesture extends Feature{constructor(){super(...arguments),this.removePointerDownListener=noop$1}onPointerDown(s){this.session=new PanSession(s,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:getContextWindow(this.node)})}createPanHandlers(){const{onPanSessionStart:s,onPanStart:o,onPan:a,onPanEnd:rt}=this.node.getProps();return{onSessionStart:asyncHandler(s),onStart:asyncHandler(o),onMove:a,onEnd:(tt,ot)=>{delete this.session,rt&&frame.postRender(()=>rt(tt,ot))}}}mount(){this.removePointerDownListener=addPointerEvent(this.node.current,"pointerdown",s=>this.onPointerDown(s))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function usePresence(){const i=reactExports.useContext(PresenceContext);if(i===null)return[!0,null];const{isPresent:s,onExitComplete:o,register:a}=i,rt=reactExports.useId();reactExports.useEffect(()=>a(rt),[]);const tt=reactExports.useCallback(()=>o&&o(rt),[rt,o]);return!s&&o?[!1,tt]:[!0]}function useIsPresent(){return isPresent(reactExports.useContext(PresenceContext))}function isPresent(i){return i===null?!0:i.isPresent}const globalProjectionState={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function pixelsToPercent(i,s){return s.max===s.min?0:i/(s.max-s.min)*100}const correctBorderRadius={correct:(i,s)=>{if(!s.target)return i;if(typeof i=="string")if(px.test(i))i=parseFloat(i);else return i;const o=pixelsToPercent(i,s.target.x),a=pixelsToPercent(i,s.target.y);return`${o}% ${a}%`}},correctBoxShadow={correct:(i,{treeScale:s,projectionDelta:o})=>{const a=i,rt=complex.parse(i);if(rt.length>5)return a;const tt=complex.createTransformer(i),ot=typeof rt[0]!="number"?1:0,at=o.x.scale*s.x,nt=o.y.scale*s.y;rt[0+ot]/=at,rt[1+ot]/=nt;const it=mixNumber$1(at,nt,.5);return typeof rt[2+ot]=="number"&&(rt[2+ot]/=it),typeof rt[3+ot]=="number"&&(rt[3+ot]/=it),tt(rt)}};class MeasureLayoutWithContext extends reactExports.Component{componentDidMount(){const{visualElement:s,layoutGroup:o,switchLayoutGroup:a,layoutId:rt}=this.props,{projection:tt}=s;addScaleCorrector(defaultScaleCorrectors),tt&&(o.group&&o.group.add(tt),a&&a.register&&rt&&a.register(tt),tt.root.didUpdate(),tt.addEventListener("animationComplete",()=>{this.safeToRemove()}),tt.setOptions({...tt.options,onExitComplete:()=>this.safeToRemove()})),globalProjectionState.hasEverUpdated=!0}getSnapshotBeforeUpdate(s){const{layoutDependency:o,visualElement:a,drag:rt,isPresent:tt}=this.props,ot=a.projection;return ot&&(ot.isPresent=tt,rt||s.layoutDependency!==o||o===void 0?ot.willUpdate():this.safeToRemove(),s.isPresent!==tt&&(tt?ot.promote():ot.relegate()||frame.postRender(()=>{const at=ot.getStack();(!at||!at.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:s}=this.props.visualElement;s&&(s.root.didUpdate(),microtask.postRender(()=>{!s.currentAnimation&&s.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:s,layoutGroup:o,switchLayoutGroup:a}=this.props,{projection:rt}=s;rt&&(rt.scheduleCheckAfterUnmount(),o&&o.group&&o.group.remove(rt),a&&a.deregister&&a.deregister(rt))}safeToRemove(){const{safeToRemove:s}=this.props;s&&s()}render(){return null}}function MeasureLayout(i){const[s,o]=usePresence(),a=reactExports.useContext(LayoutGroupContext);return jsxRuntimeExports.jsx(MeasureLayoutWithContext,{...i,layoutGroup:a,switchLayoutGroup:reactExports.useContext(SwitchLayoutGroupContext),isPresent:s,safeToRemove:o})}const defaultScaleCorrectors={borderRadius:{...correctBorderRadius,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:correctBorderRadius,borderTopRightRadius:correctBorderRadius,borderBottomLeftRadius:correctBorderRadius,borderBottomRightRadius:correctBorderRadius,boxShadow:correctBoxShadow},borders=["TopLeft","TopRight","BottomLeft","BottomRight"],numBorders=borders.length,asNumber=i=>typeof i=="string"?parseFloat(i):i,isPx=i=>typeof i=="number"||px.test(i);function mixValues(i,s,o,a,rt,tt){rt?(i.opacity=mixNumber$1(0,o.opacity!==void 0?o.opacity:1,easeCrossfadeIn(a)),i.opacityExit=mixNumber$1(s.opacity!==void 0?s.opacity:1,0,easeCrossfadeOut(a))):tt&&(i.opacity=mixNumber$1(s.opacity!==void 0?s.opacity:1,o.opacity!==void 0?o.opacity:1,a));for(let ot=0;otas?1:o(progress(i,s,a))}function copyAxisInto(i,s){i.min=s.min,i.max=s.max}function copyBoxInto(i,s){copyAxisInto(i.x,s.x),copyAxisInto(i.y,s.y)}function copyAxisDeltaInto(i,s){i.translate=s.translate,i.scale=s.scale,i.originPoint=s.originPoint,i.origin=s.origin}function removePointDelta(i,s,o,a,rt){return i-=s,i=scalePoint(i,1/o,a),rt!==void 0&&(i=scalePoint(i,1/rt,a)),i}function removeAxisDelta(i,s=0,o=1,a=.5,rt,tt=i,ot=i){if(percent.test(s)&&(s=parseFloat(s),s=mixNumber$1(ot.min,ot.max,s/100)-ot.min),typeof s!="number")return;let at=mixNumber$1(tt.min,tt.max,a);i===tt&&(at-=s),i.min=removePointDelta(i.min,s,o,at,rt),i.max=removePointDelta(i.max,s,o,at,rt)}function removeAxisTransforms(i,s,[o,a,rt],tt,ot){removeAxisDelta(i,s[o],s[a],s[rt],s.scale,tt,ot)}const xKeys=["x","scaleX","originX"],yKeys=["y","scaleY","originY"];function removeBoxTransforms(i,s,o,a){removeAxisTransforms(i.x,s,xKeys,o?o.x:void 0,a?a.x:void 0),removeAxisTransforms(i.y,s,yKeys,o?o.y:void 0,a?a.y:void 0)}function isAxisDeltaZero(i){return i.translate===0&&i.scale===1}function isDeltaZero(i){return isAxisDeltaZero(i.x)&&isAxisDeltaZero(i.y)}function axisEquals(i,s){return i.min===s.min&&i.max===s.max}function boxEquals(i,s){return axisEquals(i.x,s.x)&&axisEquals(i.y,s.y)}function axisEqualsRounded(i,s){return Math.round(i.min)===Math.round(s.min)&&Math.round(i.max)===Math.round(s.max)}function boxEqualsRounded(i,s){return axisEqualsRounded(i.x,s.x)&&axisEqualsRounded(i.y,s.y)}function aspectRatio(i){return calcLength(i.x)/calcLength(i.y)}function axisDeltaEquals(i,s){return i.translate===s.translate&&i.scale===s.scale&&i.originPoint===s.originPoint}class NodeStack{constructor(){this.members=[]}add(s){addUniqueItem(this.members,s),s.scheduleRender()}remove(s){if(removeItem(this.members,s),s===this.prevLead&&(this.prevLead=void 0),s===this.lead){const o=this.members[this.members.length-1];o&&this.promote(o)}}relegate(s){const o=this.members.findIndex(rt=>s===rt);if(o===0)return!1;let a;for(let rt=o;rt>=0;rt--){const tt=this.members[rt];if(tt.isPresent!==!1){a=tt;break}}return a?(this.promote(a),!0):!1}promote(s,o){const a=this.lead;if(s!==a&&(this.prevLead=a,this.lead=s,s.show(),a)){a.instance&&a.scheduleRender(),s.scheduleRender(),s.resumeFrom=a,o&&(s.resumeFrom.preserveOpacity=!0),a.snapshot&&(s.snapshot=a.snapshot,s.snapshot.latestValues=a.animationValues||a.latestValues),s.root&&s.root.isUpdating&&(s.isLayoutDirty=!0);const{crossfade:rt}=s.options;rt===!1&&a.hide()}}exitAnimationComplete(){this.members.forEach(s=>{const{options:o,resumingFrom:a}=s;o.onExitComplete&&o.onExitComplete(),a&&a.options.onExitComplete&&a.options.onExitComplete()})}scheduleRender(){this.members.forEach(s=>{s.instance&&s.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function buildProjectionTransform(i,s,o){let a="";const rt=i.x.translate/s.x,tt=i.y.translate/s.y,ot=(o==null?void 0:o.z)||0;if((rt||tt||ot)&&(a=`translate3d(${rt}px, ${tt}px, ${ot}px) `),(s.x!==1||s.y!==1)&&(a+=`scale(${1/s.x}, ${1/s.y}) `),o){const{transformPerspective:it,rotate:j,rotateX:_,rotateY:$,skewX:et,skewY:st}=o;it&&(a=`perspective(${it}px) ${a}`),j&&(a+=`rotate(${j}deg) `),_&&(a+=`rotateX(${_}deg) `),$&&(a+=`rotateY(${$}deg) `),et&&(a+=`skewX(${et}deg) `),st&&(a+=`skewY(${st}deg) `)}const at=i.x.scale*s.x,nt=i.y.scale*s.y;return(at!==1||nt!==1)&&(a+=`scale(${at}, ${nt})`),a||"none"}const compareByDepth=(i,s)=>i.depth-s.depth;class FlatTree{constructor(){this.children=[],this.isDirty=!1}add(s){addUniqueItem(this.children,s),this.isDirty=!0}remove(s){removeItem(this.children,s),this.isDirty=!0}forEach(s){this.isDirty&&this.children.sort(compareByDepth),this.isDirty=!1,this.children.forEach(s)}}function delay(i,s){const o=time.now(),a=({timestamp:rt})=>{const tt=rt-o;tt>=s&&(cancelFrame(a),i(tt-s))};return frame.read(a,!0),()=>cancelFrame(a)}function isSVGElement(i){return i instanceof SVGElement&&i.tagName!=="svg"}function animateSingleValue(i,s,o){const a=isMotionValue(i)?i:motionValue(i);return a.start(animateMotionValue("",a,s,o)),a.animation}const metrics={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},isDebug=typeof window<"u"&&window.MotionDebug!==void 0,transformAxes=["","X","Y","Z"],hiddenVisibility={visibility:"hidden"},animationTarget=1e3;let id=0;function resetDistortingTransform(i,s,o,a){const{latestValues:rt}=s;rt[i]&&(o[i]=rt[i],s.setStaticValue(i,0),a&&(a[i]=0))}function isOptimisedTransformAnimationInTree(i){if(i.hasCheckedOptimisedAppear=!0,i.root===i)return!1;const{visualElement:s}=i.options;return s?window.MotionHasOptimisedTransformAnimation(getOptimisedAppearId(s))?!0:i.parent&&!i.parent.hasCheckedOptimisedAppear?isOptimisedTransformAnimationInTree(i.parent):!1:!1}function createProjectionNode({attachResizeListener:i,defaultParent:s,measureScroll:o,checkIsScrollRoot:a,resetTransform:rt}){return class{constructor(ot={},at=s==null?void 0:s()){this.id=id++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,isDebug&&(metrics.totalNodes=metrics.resolvedTargetDeltas=metrics.recalculatedProjection=0),this.nodes.forEach(propagateDirtyNodes),this.nodes.forEach(resolveTargetDelta),this.nodes.forEach(calcProjection),this.nodes.forEach(cleanDirtyNodes),isDebug&&window.MotionDebug.record(metrics)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=ot,this.root=at?at.root||at:this,this.path=at?[...at.path,at]:[],this.parent=at,this.depth=at?at.depth+1:0;for(let nt=0;ntthis.root.updateBlockedByResize=!1;i(ot,()=>{this.root.updateBlockedByResize=!0,_&&_(),_=delay($,250),globalProjectionState.hasAnimatedSinceResize&&(globalProjectionState.hasAnimatedSinceResize=!1,this.nodes.forEach(finishAnimation))})}nt&&this.root.registerSharedNode(nt,this),this.options.animate!==!1&&j&&(nt||it)&&this.addEventListener("didUpdate",({delta:_,hasLayoutChanged:$,hasRelativeTargetChanged:et,layout:st})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const lt=this.options.transition||j.getDefaultTransition()||defaultLayoutTransition,{onLayoutAnimationStart:ct,onLayoutAnimationComplete:ht}=j.getProps(),ut=!this.targetLayout||!boxEqualsRounded(this.targetLayout,st)||et,pt=!$&&et;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||pt||$&&(ut||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(_,pt);const mt={...getValueTransition(lt,"layout"),onPlay:ct,onComplete:ht};(j.shouldReduceMotion||this.options.layoutRoot)&&(mt.delay=0,mt.type=!1),this.startAnimation(mt)}else $||finishAnimation(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=st})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const ot=this.getStack();ot&&ot.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,cancelFrame(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(resetSkewAndRotation),this.animationId++)}getTransformTemplate(){const{visualElement:ot}=this.options;return ot&&ot.getProps().transformTemplate}willUpdate(ot=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionHandoffCancelAll&&isOptimisedTransformAnimationInTree(this)&&window.MotionHandoffCancelAll(),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let j=0;j{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let nt=0;nt{const gt=mt/1e3;mixAxisDelta(_.x,ot.x,gt),mixAxisDelta(_.y,ot.y,gt),this.setTargetDelta(_),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(calcRelativePosition($,this.layout.layoutBox,this.relativeParent.layout.layoutBox),mixBox(this.relativeTarget,this.relativeTargetOrigin,$,gt),pt&&boxEquals(this.relativeTarget,pt)&&(this.isProjectionDirty=!1),pt||(pt=createBox()),copyBoxInto(pt,this.relativeTarget)),lt&&(this.animationValues=j,mixValues(j,it,this.latestValues,gt,ut,ht)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=gt},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(ot){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(cancelFrame(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=frame.update(()=>{globalProjectionState.hasAnimatedSinceResize=!0,this.currentAnimation=animateSingleValue(0,animationTarget,{...ot,onUpdate:at=>{this.mixTargetDelta(at),ot.onUpdate&&ot.onUpdate(at)},onComplete:()=>{ot.onComplete&&ot.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const ot=this.getStack();ot&&ot.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(animationTarget),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const ot=this.getLead();let{targetWithTransforms:at,target:nt,layout:it,latestValues:j}=ot;if(!(!at||!nt||!it)){if(this!==ot&&this.layout&&it&&shouldAnimatePositionOnly(this.options.animationType,this.layout.layoutBox,it.layoutBox)){nt=this.target||createBox();const _=calcLength(this.layout.layoutBox.x);nt.x.min=ot.target.x.min,nt.x.max=nt.x.min+_;const $=calcLength(this.layout.layoutBox.y);nt.y.min=ot.target.y.min,nt.y.max=nt.y.min+$}copyBoxInto(at,nt),transformBox(at,j),calcBoxDelta(this.projectionDeltaWithTransform,this.layoutCorrected,at,j)}}registerSharedNode(ot,at){this.sharedNodes.has(ot)||this.sharedNodes.set(ot,new NodeStack),this.sharedNodes.get(ot).add(at);const it=at.options.initialPromotionConfig;at.promote({transition:it?it.transition:void 0,preserveFollowOpacity:it&&it.shouldPreserveFollowOpacity?it.shouldPreserveFollowOpacity(at):void 0})}isLead(){const ot=this.getStack();return ot?ot.lead===this:!0}getLead(){var ot;const{layoutId:at}=this.options;return at?((ot=this.getStack())===null||ot===void 0?void 0:ot.lead)||this:this}getPrevLead(){var ot;const{layoutId:at}=this.options;return at?(ot=this.getStack())===null||ot===void 0?void 0:ot.prevLead:void 0}getStack(){const{layoutId:ot}=this.options;if(ot)return this.root.sharedNodes.get(ot)}promote({needsReset:ot,transition:at,preserveFollowOpacity:nt}={}){const it=this.getStack();it&&it.promote(this,nt),ot&&(this.projectionDelta=void 0,this.needsReset=!0),at&&this.setOptions({transition:at})}relegate(){const ot=this.getStack();return ot?ot.relegate(this):!1}resetSkewAndRotation(){const{visualElement:ot}=this.options;if(!ot)return;let at=!1;const{latestValues:nt}=ot;if((nt.z||nt.rotate||nt.rotateX||nt.rotateY||nt.rotateZ||nt.skewX||nt.skewY)&&(at=!0),!at)return;const it={};nt.z&&resetDistortingTransform("z",ot,it,this.animationValues);for(let j=0;j{var at;return(at=ot.currentAnimation)===null||at===void 0?void 0:at.stop()}),this.root.nodes.forEach(clearMeasurements),this.root.sharedNodes.clear()}}}function updateLayout(i){i.updateLayout()}function notifyLayoutUpdate(i){var s;const o=((s=i.resumeFrom)===null||s===void 0?void 0:s.snapshot)||i.snapshot;if(i.isLead()&&i.layout&&o&&i.hasListeners("didUpdate")){const{layoutBox:a,measuredBox:rt}=i.layout,{animationType:tt}=i.options,ot=o.source!==i.layout.source;tt==="size"?eachAxis(_=>{const $=ot?o.measuredBox[_]:o.layoutBox[_],et=calcLength($);$.min=a[_].min,$.max=$.min+et}):shouldAnimatePositionOnly(tt,o.layoutBox,a)&&eachAxis(_=>{const $=ot?o.measuredBox[_]:o.layoutBox[_],et=calcLength(a[_]);$.max=$.min+et,i.relativeTarget&&!i.currentAnimation&&(i.isProjectionDirty=!0,i.relativeTarget[_].max=i.relativeTarget[_].min+et)});const at=createDelta();calcBoxDelta(at,a,o.layoutBox);const nt=createDelta();ot?calcBoxDelta(nt,i.applyTransform(rt,!0),o.measuredBox):calcBoxDelta(nt,a,o.layoutBox);const it=!isDeltaZero(at);let j=!1;if(!i.resumeFrom){const _=i.getClosestProjectingParent();if(_&&!_.resumeFrom){const{snapshot:$,layout:et}=_;if($&&et){const st=createBox();calcRelativePosition(st,o.layoutBox,$.layoutBox);const lt=createBox();calcRelativePosition(lt,a,et.layoutBox),boxEqualsRounded(st,lt)||(j=!0),_.options.layoutRoot&&(i.relativeTarget=lt,i.relativeTargetOrigin=st,i.relativeParent=_)}}}i.notifyListeners("didUpdate",{layout:a,snapshot:o,delta:nt,layoutDelta:at,hasLayoutChanged:it,hasRelativeTargetChanged:j})}else if(i.isLead()){const{onExitComplete:a}=i.options;a&&a()}i.options.transition=void 0}function propagateDirtyNodes(i){isDebug&&metrics.totalNodes++,i.parent&&(i.isProjecting()||(i.isProjectionDirty=i.parent.isProjectionDirty),i.isSharedProjectionDirty||(i.isSharedProjectionDirty=!!(i.isProjectionDirty||i.parent.isProjectionDirty||i.parent.isSharedProjectionDirty)),i.isTransformDirty||(i.isTransformDirty=i.parent.isTransformDirty))}function cleanDirtyNodes(i){i.isProjectionDirty=i.isSharedProjectionDirty=i.isTransformDirty=!1}function clearSnapshot(i){i.clearSnapshot()}function clearMeasurements(i){i.clearMeasurements()}function clearIsLayoutDirty(i){i.isLayoutDirty=!1}function resetTransformStyle(i){const{visualElement:s}=i.options;s&&s.getProps().onBeforeLayoutMeasure&&s.notify("BeforeLayoutMeasure"),i.resetTransform()}function finishAnimation(i){i.finishAnimation(),i.targetDelta=i.relativeTarget=i.target=void 0,i.isProjectionDirty=!0}function resolveTargetDelta(i){i.resolveTargetDelta()}function calcProjection(i){i.calcProjection()}function resetSkewAndRotation(i){i.resetSkewAndRotation()}function removeLeadSnapshots(i){i.removeLeadSnapshot()}function mixAxisDelta(i,s,o){i.translate=mixNumber$1(s.translate,0,o),i.scale=mixNumber$1(s.scale,1,o),i.origin=s.origin,i.originPoint=s.originPoint}function mixAxis(i,s,o,a){i.min=mixNumber$1(s.min,o.min,a),i.max=mixNumber$1(s.max,o.max,a)}function mixBox(i,s,o,a){mixAxis(i.x,s.x,o.x,a),mixAxis(i.y,s.y,o.y,a)}function hasOpacityCrossfade(i){return i.animationValues&&i.animationValues.opacityExit!==void 0}const defaultLayoutTransition={duration:.45,ease:[.4,0,.1,1]},userAgentContains=i=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(i),roundPoint=userAgentContains("applewebkit/")&&!userAgentContains("chrome/")?Math.round:noop$1;function roundAxis(i){i.min=roundPoint(i.min),i.max=roundPoint(i.max)}function roundBox(i){roundAxis(i.x),roundAxis(i.y)}function shouldAnimatePositionOnly(i,s,o){return i==="position"||i==="preserve-aspect"&&!isNear(aspectRatio(s),aspectRatio(o),.2)}function checkNodeWasScrollRoot(i){var s;return i!==i.root&&((s=i.scroll)===null||s===void 0?void 0:s.wasRoot)}const DocumentProjectionNode=createProjectionNode({attachResizeListener:(i,s)=>addDomEvent(i,"resize",s),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),rootProjectionNode={current:void 0},HTMLProjectionNode=createProjectionNode({measureScroll:i=>({x:i.scrollLeft,y:i.scrollTop}),defaultParent:()=>{if(!rootProjectionNode.current){const i=new DocumentProjectionNode({});i.mount(window),i.setOptions({layoutScroll:!0}),rootProjectionNode.current=i}return rootProjectionNode.current},resetTransform:(i,s)=>{i.style.transform=s!==void 0?s:"none"},checkIsScrollRoot:i=>window.getComputedStyle(i).position==="fixed"}),drag={pan:{Feature:PanGesture},drag:{Feature:DragGesture,ProjectionNode:HTMLProjectionNode,MeasureLayout}},prefersReducedMotion={current:null},hasReducedMotionListener={current:!1};function initPrefersReducedMotion(){if(hasReducedMotionListener.current=!0,!!isBrowser)if(window.matchMedia){const i=window.matchMedia("(prefers-reduced-motion)"),s=()=>prefersReducedMotion.current=i.matches;i.addListener(s),s()}else prefersReducedMotion.current=!1}function updateMotionValuesFromProps(i,s,o){for(const a in s){const rt=s[a],tt=o[a];if(isMotionValue(rt))i.addValue(a,rt);else if(isMotionValue(tt))i.addValue(a,motionValue(rt,{owner:i}));else if(tt!==rt)if(i.hasValue(a)){const ot=i.getValue(a);ot.liveStyle===!0?ot.jump(rt):ot.hasAnimated||ot.set(rt)}else{const ot=i.getStaticValue(a);i.addValue(a,motionValue(ot!==void 0?ot:rt,{owner:i}))}}for(const a in o)s[a]===void 0&&i.removeValue(a);return s}const visualElementStore=new WeakMap,valueTypes=[...dimensionValueTypes,color,complex],findValueType=i=>valueTypes.find(testValueType(i)),propEventHandlers=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],numVariantProps=variantProps.length;class VisualElement{scrapeMotionValuesFromProps(s,o,a){return{}}constructor({parent:s,props:o,presenceContext:a,reducedMotionConfig:rt,blockInitialAnimation:tt,visualState:ot},at={}){this.applyWillChange=!1,this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=KeyframeResolver,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.isRenderScheduled=!1,this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.isRenderScheduled=!1,this.scheduleRender=()=>{this.isRenderScheduled||(this.isRenderScheduled=!0,frame.render(this.render,!1,!0))};const{latestValues:nt,renderState:it}=ot;this.latestValues=nt,this.baseTarget={...nt},this.initialValues=o.initial?{...nt}:{},this.renderState=it,this.parent=s,this.props=o,this.presenceContext=a,this.depth=s?s.depth+1:0,this.reducedMotionConfig=rt,this.options=at,this.blockInitialAnimation=!!tt,this.isControllingVariants=isControllingVariants(o),this.isVariantNode=isVariantNode(o),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(s&&s.current);const{willChange:j,..._}=this.scrapeMotionValuesFromProps(o,{},this);for(const $ in _){const et=_[$];nt[$]!==void 0&&isMotionValue(et)&&et.set(nt[$],!1)}}mount(s){this.current=s,visualElementStore.set(s,this),this.projection&&!this.projection.instance&&this.projection.mount(s),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((o,a)=>this.bindToMotionValue(a,o)),hasReducedMotionListener.current||initPrefersReducedMotion(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:prefersReducedMotion.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){visualElementStore.delete(this.current),this.projection&&this.projection.unmount(),cancelFrame(this.notifyUpdate),cancelFrame(this.render),this.valueSubscriptions.forEach(s=>s()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const s in this.events)this.events[s].clear();for(const s in this.features){const o=this.features[s];o&&(o.unmount(),o.isMounted=!1)}this.current=null}bindToMotionValue(s,o){const a=transformProps.has(s),rt=o.on("change",ot=>{this.latestValues[s]=ot,this.props.onUpdate&&frame.preRender(this.notifyUpdate),a&&this.projection&&(this.projection.isTransformDirty=!0)}),tt=o.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(s,()=>{rt(),tt(),o.owner&&o.stop()})}sortNodePosition(s){return!this.current||!this.sortInstanceNodePosition||this.type!==s.type?0:this.sortInstanceNodePosition(this.current,s.current)}updateFeatures(){let s="animation";for(s in featureDefinitions){const o=featureDefinitions[s];if(!o)continue;const{isEnabled:a,Feature:rt}=o;if(!this.features[s]&&rt&&a(this.props)&&(this.features[s]=new rt(this)),this.features[s]){const tt=this.features[s];tt.isMounted?tt.update():(tt.mount(),tt.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):createBox()}getStaticValue(s){return this.latestValues[s]}setStaticValue(s,o){this.latestValues[s]=o}update(s,o){(s.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=s,this.prevPresenceContext=this.presenceContext,this.presenceContext=o;for(let a=0;ao.variantChildren.delete(s)}addValue(s,o){const a=this.values.get(s);o!==a&&(a&&this.removeValue(s),this.bindToMotionValue(s,o),this.values.set(s,o),this.latestValues[s]=o.get())}removeValue(s){this.values.delete(s);const o=this.valueSubscriptions.get(s);o&&(o(),this.valueSubscriptions.delete(s)),delete this.latestValues[s],this.removeValueFromRenderState(s,this.renderState)}hasValue(s){return this.values.has(s)}getValue(s,o){if(this.props.values&&this.props.values[s])return this.props.values[s];let a=this.values.get(s);return a===void 0&&o!==void 0&&(a=motionValue(o===null?void 0:o,{owner:this}),this.addValue(s,a)),a}readValue(s,o){var a;let rt=this.latestValues[s]!==void 0||!this.current?this.latestValues[s]:(a=this.getBaseTargetFromProps(this.props,s))!==null&&a!==void 0?a:this.readValueFromInstance(this.current,s,this.options);return rt!=null&&(typeof rt=="string"&&(isNumericalString(rt)||isZeroValueString(rt))?rt=parseFloat(rt):!findValueType(rt)&&complex.test(o)&&(rt=getAnimatableNone(s,o)),this.setBaseTarget(s,isMotionValue(rt)?rt.get():rt)),isMotionValue(rt)?rt.get():rt}setBaseTarget(s,o){this.baseTarget[s]=o}getBaseTarget(s){var o;const{initial:a}=this.props;let rt;if(typeof a=="string"||typeof a=="object"){const ot=resolveVariantFromProps(this.props,a,(o=this.presenceContext)===null||o===void 0?void 0:o.custom);ot&&(rt=ot[s])}if(a&&rt!==void 0)return rt;const tt=this.getBaseTargetFromProps(this.props,s);return tt!==void 0&&!isMotionValue(tt)?tt:this.initialValues[s]!==void 0&&rt===void 0?void 0:this.baseTarget[s]}on(s,o){return this.events[s]||(this.events[s]=new SubscriptionManager),this.events[s].add(o)}notify(s,...o){this.events[s]&&this.events[s].notify(...o)}}class DOMVisualElement extends VisualElement{constructor(){super(...arguments),this.KeyframeResolver=DOMKeyframesResolver}sortInstanceNodePosition(s,o){return s.compareDocumentPosition(o)&2?1:-1}getBaseTargetFromProps(s,o){return s.style?s.style[o]:void 0}removeValueFromRenderState(s,{vars:o,style:a}){delete o[s],delete a[s]}}function getComputedStyle(i){return window.getComputedStyle(i)}class HTMLVisualElement extends DOMVisualElement{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=renderHTML}readValueFromInstance(s,o){if(transformProps.has(o)){const a=getDefaultValueType(o);return a&&a.default||0}else{const a=getComputedStyle(s),rt=(isCSSVariableName(o)?a.getPropertyValue(o):a[o])||0;return typeof rt=="string"?rt.trim():rt}}measureInstanceViewportBox(s,{transformPagePoint:o}){return measureViewportBox(s,o)}build(s,o,a){buildHTMLStyles(s,o,a.transformTemplate)}scrapeMotionValuesFromProps(s,o,a){return scrapeMotionValuesFromProps$1(s,o,a)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:s}=this.props;isMotionValue(s)&&(this.childSubscription=s.on("change",o=>{this.current&&(this.current.textContent=`${o}`)}))}}class SVGVisualElement extends DOMVisualElement{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=createBox}getBaseTargetFromProps(s,o){return s[o]}readValueFromInstance(s,o){if(transformProps.has(o)){const a=getDefaultValueType(o);return a&&a.default||0}return o=camelCaseAttributes.has(o)?o:camelToDash(o),s.getAttribute(o)}scrapeMotionValuesFromProps(s,o,a){return scrapeMotionValuesFromProps(s,o,a)}build(s,o,a){buildSVGAttrs(s,o,this.isSVGTag,a.transformTemplate)}renderInstance(s,o,a,rt){renderSVG(s,o,a,rt)}mount(s){this.isSVGTag=isSVGTag(s.tagName),super.mount(s)}}const createDomVisualElement=(i,s)=>isSVGComponent(i)?new SVGVisualElement(s):new HTMLVisualElement(s,{allowProjection:i!==reactExports.Fragment}),layout={layout:{ProjectionNode:HTMLProjectionNode,MeasureLayout}},preloadedFeatures={...animations,...gestureAnimations,...drag,...layout},motion=createMotionProxy((i,s)=>createDomMotionConfig(i,s,preloadedFeatures,createDomVisualElement));class PopChildMeasure extends reactExports.Component{getSnapshotBeforeUpdate(s){const o=this.props.childRef.current;if(o&&s.isPresent&&!this.props.isPresent){const a=this.props.sizeRef.current;a.height=o.offsetHeight||0,a.width=o.offsetWidth||0,a.top=o.offsetTop,a.left=o.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function PopChild({children:i,isPresent:s}){const o=reactExports.useId(),a=reactExports.useRef(null),rt=reactExports.useRef({width:0,height:0,top:0,left:0}),{nonce:tt}=reactExports.useContext(MotionConfigContext);return reactExports.useInsertionEffect(()=>{const{width:ot,height:at,top:nt,left:it}=rt.current;if(s||!a.current||!ot||!at)return;a.current.dataset.motionPopId=o;const j=document.createElement("style");return tt&&(j.nonce=tt),document.head.appendChild(j),j.sheet&&j.sheet.insertRule(` [data-motion-pop-id="${o}"] { position: absolute !important; width: ${ot}px !important; @@ -347,7 +347,7 @@ Error generating stack: `+et.message+` top: ${nt}px !important; left: ${it}px !important; } - `),()=>{document.head.removeChild(j)}},[s]),jsxRuntimeExports.jsx(PopChildMeasure,{isPresent:s,childRef:a,sizeRef:rt,children:reactExports.cloneElement(i,{ref:a})})}const PresenceChild=({children:i,initial:s,isPresent:o,onExitComplete:a,custom:rt,presenceAffectsLayout:et,mode:ot})=>{const at=useConstant(newChildrenMap),nt=reactExports.useId(),it=reactExports.useMemo(()=>({id:nt,initial:s,isPresent:o,custom:rt,onExitComplete:j=>{at.set(j,!0);for(const _ of at.values())if(!_)return;a&&a()},register:j=>(at.set(j,!1),()=>at.delete(j))}),et?[Math.random()]:[o]);return reactExports.useMemo(()=>{at.forEach((j,_)=>at.set(_,!1))},[o]),reactExports.useEffect(()=>{!o&&!at.size&&a&&a()},[o]),ot==="popLayout"&&(i=jsxRuntimeExports.jsx(PopChild,{isPresent:o,children:i})),jsxRuntimeExports.jsx(PresenceContext.Provider,{value:it,children:i})};function newChildrenMap(){return new Map}const getChildKey=i=>i.key||"";function onlyElements(i){const s=[];return reactExports.Children.forEach(i,o=>{reactExports.isValidElement(o)&&s.push(o)}),s}const AnimatePresence=({children:i,exitBeforeEnter:s,custom:o,initial:a=!0,onExitComplete:rt,presenceAffectsLayout:et=!0,mode:ot="sync"})=>{const at=reactExports.useMemo(()=>onlyElements(i),[i]),nt=at.map(getChildKey),it=reactExports.useRef(!0),j=reactExports.useRef(at),_=useConstant(()=>new Map),[$,tt]=reactExports.useState(at),[st,lt]=reactExports.useState(at);useIsomorphicLayoutEffect$1(()=>{it.current=!1,j.current=at;for(let ut=0;ut{const pt=getChildKey(ut),mt=at===st||nt.includes(pt),gt=()=>{if(_.has(pt))_.set(pt,!0);else return;let dt=!0;_.forEach(St=>{St||(dt=!1)}),dt&&(ht==null||ht(),lt(j.current),rt&&rt())};return jsxRuntimeExports.jsx(PresenceChild,{isPresent:mt,initial:!it.current||a?void 0:!1,custom:mt?void 0:o,presenceAffectsLayout:et,mode:ot,onExitComplete:mt?void 0:gt,children:ut},pt)})})};var toastMotionVariants={initial:i=>{const{position:s}=i,o=["top","bottom"].includes(s)?"y":"x";let a=["top-right","bottom-right"].includes(s)?1:-1;return s==="bottom"&&(a=1),{opacity:0,[o]:a*24}},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},ToastComponent=reactExports.memo(i=>{const{id:s,message:o,onCloseComplete:a,onRequestRemove:rt,requestClose:et=!1,position:ot="bottom",duration:at=5e3,containerStyle:nt,motionVariants:it=toastMotionVariants,toastSpacing:j="0.5rem"}=i,[_,$]=reactExports.useState(at),tt=useIsPresent();useUpdateEffect(()=>{tt||a==null||a()},[tt]),useUpdateEffect(()=>{$(at)},[at]);const st=()=>$(null),lt=()=>$(at),ct=()=>{tt&&rt()};reactExports.useEffect(()=>{tt&&et&&rt()},[tt,et,rt]),useTimeout(ct,_);const ht=reactExports.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:j,...nt}),[nt,j]),ut=reactExports.useMemo(()=>getToastStyle(ot),[ot]);return jsxRuntimeExports.jsx(motion.div,{layout:!0,className:"chakra-toast",variants:it,initial:"initial",animate:"animate",exit:"exit",onHoverStart:st,onHoverEnd:lt,custom:{position:ot},style:ut,children:jsxRuntimeExports.jsx(chakra.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:ht,children:runIfFn$2(o,{id:s,onClose:ct})})})});ToastComponent.displayName="ToastComponent";var fallbackIcon={path:jsxRuntimeExports.jsxs("g",{stroke:"currentColor",strokeWidth:"1.5",children:[jsxRuntimeExports.jsx("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),jsxRuntimeExports.jsx("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]}),viewBox:"0 0 24 24"},Icon=forwardRef((i,s)=>{const{as:o,viewBox:a,color:rt="currentColor",focusable:et=!1,children:ot,className:at,__css:nt,...it}=i,j=cx("chakra-icon",at),_=useStyleConfig("Icon",i),$={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:rt,...nt,..._},tt={ref:s,focusable:et,className:j,__css:$},st=a??fallbackIcon.viewBox;if(o&&typeof o!="string")return jsxRuntimeExports.jsx(chakra.svg,{as:o,...tt,...it});const lt=ot??fallbackIcon.path;return jsxRuntimeExports.jsx(chakra.svg,{verticalAlign:"middle",viewBox:st,...tt,...it,children:lt})});Icon.displayName="Icon";function createIcon(i){const{viewBox:s="0 0 24 24",d:o,displayName:a,defaultProps:rt={}}=i,et=reactExports.Children.toArray(i.path),ot=forwardRef((at,nt)=>jsxRuntimeExports.jsx(Icon,{ref:nt,viewBox:s,...rt,...at,children:et.length?et:jsxRuntimeExports.jsx("path",{fill:"currentColor",d:o})}));return ot.displayName=a,ot}function CheckIcon$1(i){return jsxRuntimeExports.jsx(Icon,{viewBox:"0 0 24 24",...i,children:jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"})})}function InfoIcon(i){return jsxRuntimeExports.jsx(Icon,{viewBox:"0 0 24 24",...i,children:jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"})})}function WarningIcon(i){return jsxRuntimeExports.jsx(Icon,{viewBox:"0 0 24 24",...i,children:jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})})}var spin=keyframes$1({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),Spinner=forwardRef((i,s)=>{const o=useStyleConfig("Spinner",i),{label:a="Loading...",thickness:rt="2px",speed:et="0.45s",emptyColor:ot="transparent",className:at,...nt}=omitThemingProps(i),it=cx("chakra-spinner",at),j={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:rt,borderBottomColor:ot,borderLeftColor:ot,animation:`${spin} ${et} linear infinite`,...o};return jsxRuntimeExports.jsx(chakra.div,{ref:s,__css:j,className:it,...nt,children:a&&jsxRuntimeExports.jsx(chakra.span,{srOnly:!0,children:a})})});Spinner.displayName="Spinner";var[AlertProvider,useAlertContext]=createContext$2({name:"AlertContext",hookName:"useAlertContext",providerName:""}),[AlertStylesProvider,useAlertStyles]=createContext$2({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),STATUSES={info:{icon:InfoIcon,colorScheme:"blue"},warning:{icon:WarningIcon,colorScheme:"orange"},success:{icon:CheckIcon$1,colorScheme:"green"},error:{icon:WarningIcon,colorScheme:"red"},loading:{icon:Spinner,colorScheme:"blue"}};function getStatusColorScheme(i){return STATUSES[i].colorScheme}function getStatusIcon(i){return STATUSES[i].icon}var AlertDescription=forwardRef(function(s,o){const a=useAlertStyles(),{status:rt}=useAlertContext(),et={display:"inline",...a.description};return jsxRuntimeExports.jsx(chakra.div,{ref:o,"data-status":rt,...s,className:cx("chakra-alert__desc",s.className),__css:et})});AlertDescription.displayName="AlertDescription";function AlertIcon(i){const{status:s}=useAlertContext(),o=getStatusIcon(s),a=useAlertStyles(),rt=s==="loading"?a.spinner:a.icon;return jsxRuntimeExports.jsx(chakra.span,{display:"inherit","data-status":s,...i,className:cx("chakra-alert__icon",i.className),__css:rt,children:i.children||jsxRuntimeExports.jsx(o,{h:"100%",w:"100%"})})}AlertIcon.displayName="AlertIcon";var AlertTitle=forwardRef(function(s,o){const a=useAlertStyles(),{status:rt}=useAlertContext();return jsxRuntimeExports.jsx(chakra.div,{ref:o,"data-status":rt,...s,className:cx("chakra-alert__title",s.className),__css:a.title})});AlertTitle.displayName="AlertTitle";var Alert=forwardRef(function(s,o){var a;const{status:rt="info",addRole:et=!0,...ot}=omitThemingProps(s),at=(a=s.colorScheme)!=null?a:getStatusColorScheme(rt),nt=useMultiStyleConfig("Alert",{...s,colorScheme:at}),it={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...nt.container};return jsxRuntimeExports.jsx(AlertProvider,{value:{status:rt},children:jsxRuntimeExports.jsx(AlertStylesProvider,{value:nt,children:jsxRuntimeExports.jsx(chakra.div,{"data-status":rt,role:et?"alert":void 0,ref:o,...ot,className:cx("chakra-alert",s.className),__css:it})})})});Alert.displayName="Alert";function CloseIcon(i){return jsxRuntimeExports.jsx(Icon,{focusable:"false","aria-hidden":!0,...i,children:jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"})})}var CloseButton=forwardRef(function(s,o){const a=useStyleConfig("CloseButton",s),{children:rt,isDisabled:et,__css:ot,...at}=omitThemingProps(s),nt={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return jsxRuntimeExports.jsx(chakra.button,{type:"button","aria-label":"Close",ref:o,disabled:et,__css:{...nt,...a,...ot},...at,children:rt||jsxRuntimeExports.jsx(CloseIcon,{width:"1em",height:"1em"})})});CloseButton.displayName="CloseButton";var initialState$1={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},toastStore=createStore$1(initialState$1);function createStore$1(i){let s=i;const o=new Set,a=rt=>{s=rt(s),o.forEach(et=>et())};return{getState:()=>s,subscribe:rt=>(o.add(rt),()=>{a(()=>i),o.delete(rt)}),removeToast:(rt,et)=>{a(ot=>({...ot,[et]:ot[et].filter(at=>at.id!=rt)}))},notify:(rt,et)=>{const ot=createToast(rt,et),{position:at,id:nt}=ot;return a(it=>{var j,_;const tt=at.includes("top")?[ot,...(j=it[at])!=null?j:[]]:[...(_=it[at])!=null?_:[],ot];return{...it,[at]:tt}}),nt},update:(rt,et)=>{rt&&a(ot=>{const at={...ot},{position:nt,index:it}=findToast(at,rt);return nt&&it!==-1&&(at[nt][it]={...at[nt][it],...et,message:createRenderToast(et)}),at})},closeAll:({positions:rt}={})=>{a(et=>(rt??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((nt,it)=>(nt[it]=et[it].map(j=>({...j,requestClose:!0})),nt),{...et}))},close:rt=>{a(et=>{const ot=getToastPosition(et,rt);return ot?{...et,[ot]:et[ot].map(at=>at.id==rt?{...at,requestClose:!0}:at)}:et})},isActive:rt=>!!findToast(toastStore.getState(),rt).position}}var counter=0;function createToast(i,s={}){var o,a;counter+=1;const rt=(o=s.id)!=null?o:counter,et=(a=s.position)!=null?a:"bottom";return{id:rt,message:i,position:et,duration:s.duration,onCloseComplete:s.onCloseComplete,onRequestRemove:()=>toastStore.removeToast(String(rt),et),status:s.status,requestClose:!1,containerStyle:s.containerStyle}}var Toast=i=>{const{status:s,variant:o="solid",id:a,title:rt,isClosable:et,onClose:ot,description:at,colorScheme:nt,icon:it}=i,j=a?{root:`toast-${a}`,title:`toast-${a}-title`,description:`toast-${a}-description`}:void 0;return jsxRuntimeExports.jsxs(Alert,{addRole:!1,status:s,variant:o,id:j==null?void 0:j.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto",colorScheme:nt,children:[jsxRuntimeExports.jsx(AlertIcon,{children:it}),jsxRuntimeExports.jsxs(chakra.div,{flex:"1",maxWidth:"100%",children:[rt&&jsxRuntimeExports.jsx(AlertTitle,{id:j==null?void 0:j.title,children:rt}),at&&jsxRuntimeExports.jsx(AlertDescription,{id:j==null?void 0:j.description,display:"block",children:at})]}),et&&jsxRuntimeExports.jsx(CloseButton,{size:"sm",onClick:ot,position:"absolute",insetEnd:1,top:1})]})};function createRenderToast(i={}){const{render:s,toastComponent:o=Toast}=i;return rt=>typeof s=="function"?s({...rt,...i}):jsxRuntimeExports.jsx(o,{...rt,...i})}var[ToastOptionProvider,useToastOptionContext]=createContext$2({name:"ToastOptionsContext",strict:!1}),ToastProvider=i=>{const s=reactExports.useSyncExternalStore(toastStore.subscribe,toastStore.getState,toastStore.getState),{motionVariants:o,component:a=ToastComponent,portalProps:rt}=i,ot=Object.keys(s).map(at=>{const nt=s[at];return jsxRuntimeExports.jsx("div",{role:"region","aria-live":"polite","aria-label":`Notifications-${at}`,id:`chakra-toast-manager-${at}`,style:getToastListStyle(at),children:jsxRuntimeExports.jsx(AnimatePresence,{initial:!1,children:nt.map(it=>jsxRuntimeExports.jsx(a,{motionVariants:o,...it},it.id))})},at)});return jsxRuntimeExports.jsx(Portal,{...rt,children:ot})},createChakraProvider=i=>function({children:o,theme:a=i,toastOptions:rt,...et}){return jsxRuntimeExports.jsxs(ChakraProvider$1,{theme:a,...et,children:[jsxRuntimeExports.jsx(ToastOptionProvider,{value:rt==null?void 0:rt.defaultOptions,children:o}),jsxRuntimeExports.jsx(ToastProvider,{...rt})]})},ChakraProvider=createChakraProvider(theme$1);function assignRef$1(i,s){if(i!=null){if(typeof i=="function"){i(s);return}try{i.current=s}catch{throw new Error(`Cannot assign value '${s}' to ref '${i}'`)}}}function mergeRefs(...i){return s=>{i.forEach(o=>{assignRef$1(o,s)})}}function useMergeRefs$1(...i){return reactExports.useMemo(()=>mergeRefs(...i),i)}var TRANSITION_EASINGS={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},TRANSITION_DEFAULTS={enter:{duration:.2,ease:TRANSITION_EASINGS.easeOut},exit:{duration:.1,ease:TRANSITION_EASINGS.easeIn}},withDelay={enter:(i,s)=>({...i,delay:typeof s=="number"?s:s==null?void 0:s.enter}),exit:(i,s)=>({...i,delay:typeof s=="number"?s:s==null?void 0:s.exit})},variants$2={enter:({transition:i,transitionEnd:s,delay:o}={})=>{var a;return{opacity:1,transition:(a=i==null?void 0:i.enter)!=null?a:withDelay.enter(TRANSITION_DEFAULTS.enter,o),transitionEnd:s==null?void 0:s.enter}},exit:({transition:i,transitionEnd:s,delay:o}={})=>{var a;return{opacity:0,transition:(a=i==null?void 0:i.exit)!=null?a:withDelay.exit(TRANSITION_DEFAULTS.exit,o),transitionEnd:s==null?void 0:s.exit}}},fadeConfig={initial:"exit",animate:"enter",exit:"exit",variants:variants$2},Fade=reactExports.forwardRef(function(s,o){const{unmountOnExit:a,in:rt,className:et,transition:ot,transitionEnd:at,delay:nt,...it}=s,j=rt||a?"enter":"exit",_=a?rt&&a:!0,$={transition:ot,transitionEnd:at,delay:nt};return jsxRuntimeExports.jsx(AnimatePresence,{custom:$,children:_&&jsxRuntimeExports.jsx(motion.div,{ref:o,className:cx("chakra-fade",et),custom:$,...fadeConfig,animate:j,...it})})});Fade.displayName="Fade";var variants$1={exit:({reverse:i,initialScale:s,transition:o,transitionEnd:a,delay:rt})=>{var et;return{opacity:0,...i?{scale:s,transitionEnd:a==null?void 0:a.exit}:{transitionEnd:{scale:s,...a==null?void 0:a.exit}},transition:(et=o==null?void 0:o.exit)!=null?et:withDelay.exit(TRANSITION_DEFAULTS.exit,rt)}},enter:({transitionEnd:i,transition:s,delay:o})=>{var a;return{opacity:1,scale:1,transition:(a=s==null?void 0:s.enter)!=null?a:withDelay.enter(TRANSITION_DEFAULTS.enter,o),transitionEnd:i==null?void 0:i.enter}}},scaleFadeConfig={initial:"exit",animate:"enter",exit:"exit",variants:variants$1},ScaleFade=reactExports.forwardRef(function(s,o){const{unmountOnExit:a,in:rt,reverse:et=!0,initialScale:ot=.95,className:at,transition:nt,transitionEnd:it,delay:j,..._}=s,$=a?rt&&a:!0,tt=rt||a?"enter":"exit",st={initialScale:ot,reverse:et,transition:nt,transitionEnd:it,delay:j};return jsxRuntimeExports.jsx(AnimatePresence,{custom:st,children:$&&jsxRuntimeExports.jsx(motion.div,{ref:o,className:cx("chakra-offset-slide",at),...scaleFadeConfig,animate:tt,custom:st,..._})})});ScaleFade.displayName="ScaleFade";var variants={initial:({offsetX:i,offsetY:s,transition:o,transitionEnd:a,delay:rt})=>{var et;return{opacity:0,x:i,y:s,transition:(et=o==null?void 0:o.exit)!=null?et:withDelay.exit(TRANSITION_DEFAULTS.exit,rt),transitionEnd:a==null?void 0:a.exit}},enter:({transition:i,transitionEnd:s,delay:o})=>{var a;return{opacity:1,x:0,y:0,transition:(a=i==null?void 0:i.enter)!=null?a:withDelay.enter(TRANSITION_DEFAULTS.enter,o),transitionEnd:s==null?void 0:s.enter}},exit:({offsetY:i,offsetX:s,transition:o,transitionEnd:a,reverse:rt,delay:et})=>{var ot;const at={x:s,y:i};return{opacity:0,transition:(ot=o==null?void 0:o.exit)!=null?ot:withDelay.exit(TRANSITION_DEFAULTS.exit,et),...rt?{...at,transitionEnd:a==null?void 0:a.exit}:{transitionEnd:{...at,...a==null?void 0:a.exit}}}}},slideFadeConfig={initial:"initial",animate:"enter",exit:"exit",variants},SlideFade=reactExports.forwardRef(function(s,o){const{unmountOnExit:a,in:rt,reverse:et=!0,className:ot,offsetX:at=0,offsetY:nt=8,transition:it,transitionEnd:j,delay:_,...$}=s,tt=a?rt&&a:!0,st=rt||a?"enter":"exit",lt={offsetX:at,offsetY:nt,reverse:et,transition:it,transitionEnd:j,delay:_};return jsxRuntimeExports.jsx(AnimatePresence,{custom:lt,children:tt&&jsxRuntimeExports.jsx(motion.div,{ref:o,className:cx("chakra-offset-slide",ot),custom:lt,...slideFadeConfig,animate:st,...$})})});SlideFade.displayName="SlideFade";function getValidChildren(i){return reactExports.Children.toArray(i).filter(s=>reactExports.isValidElement(s))}var[ButtonGroupProvider,useButtonGroup]=createContext$2({strict:!1,name:"ButtonGroupContext"}),attachedStyles={horizontal:{"> *:first-of-type:not(:last-of-type)":{borderEndRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderStartRadius:0}},vertical:{"> *:first-of-type:not(:last-of-type)":{borderBottomRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderTopRadius:0}}},gapStyles={horizontal:i=>({"& > *:not(style) ~ *:not(style)":{marginStart:i}}),vertical:i=>({"& > *:not(style) ~ *:not(style)":{marginTop:i}})},ButtonGroup=forwardRef(function(s,o){const{size:a,colorScheme:rt,variant:et,className:ot,spacing:at="0.5rem",isAttached:nt,isDisabled:it,orientation:j="horizontal",..._}=s,$=cx("chakra-button__group",ot),tt=reactExports.useMemo(()=>({size:a,colorScheme:rt,variant:et,isDisabled:it}),[a,rt,et,it]);let st={display:"inline-flex",...nt?attachedStyles[j]:gapStyles[j](at)};const lt=j==="vertical";return jsxRuntimeExports.jsx(ButtonGroupProvider,{value:tt,children:jsxRuntimeExports.jsx(chakra.div,{ref:o,role:"group",__css:st,className:$,"data-attached":nt?"":void 0,"data-orientation":j,flexDir:lt?"column":void 0,..._})})});ButtonGroup.displayName="ButtonGroup";function useButtonType(i){const[s,o]=reactExports.useState(!i);return{ref:reactExports.useCallback(et=>{et&&o(et.tagName==="BUTTON")},[]),type:s?"button":void 0}}function ButtonIcon(i){const{children:s,className:o,...a}=i,rt=reactExports.isValidElement(s)?reactExports.cloneElement(s,{"aria-hidden":!0,focusable:!1}):s,et=cx("chakra-button__icon",o);return jsxRuntimeExports.jsx(chakra.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...a,className:et,children:rt})}ButtonIcon.displayName="ButtonIcon";function ButtonSpinner(i){const{label:s,placement:o,spacing:a="0.5rem",children:rt=jsxRuntimeExports.jsx(Spinner,{color:"currentColor",width:"1em",height:"1em"}),className:et,__css:ot,...at}=i,nt=cx("chakra-button__spinner",et),it=o==="start"?"marginEnd":"marginStart",j=reactExports.useMemo(()=>({display:"flex",alignItems:"center",position:s?"relative":"absolute",[it]:s?a:0,fontSize:"1em",lineHeight:"normal",...ot}),[ot,s,it,a]);return jsxRuntimeExports.jsx(chakra.div,{className:nt,...at,__css:j,children:rt})}ButtonSpinner.displayName="ButtonSpinner";var Button=forwardRef((i,s)=>{const o=useButtonGroup(),a=useStyleConfig("Button",{...o,...i}),{isDisabled:rt=o==null?void 0:o.isDisabled,isLoading:et,isActive:ot,children:at,leftIcon:nt,rightIcon:it,loadingText:j,iconSpacing:_="0.5rem",type:$,spinner:tt,spinnerPlacement:st="start",className:lt,as:ct,...ht}=omitThemingProps(i),ut=reactExports.useMemo(()=>{const dt={...a==null?void 0:a._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...a,...!!o&&{_focus:dt}}},[a,o]),{ref:pt,type:mt}=useButtonType(ct),gt={rightIcon:it,leftIcon:nt,iconSpacing:_,children:at};return jsxRuntimeExports.jsxs(chakra.button,{ref:useMergeRefs$1(s,pt),as:ct,type:$??mt,"data-active":dataAttr(ot),"data-loading":dataAttr(et),__css:ut,className:cx("chakra-button",lt),...ht,disabled:rt||et,children:[et&&st==="start"&&jsxRuntimeExports.jsx(ButtonSpinner,{className:"chakra-button__spinner--start",label:j,placement:"start",spacing:_,children:tt}),et?j||jsxRuntimeExports.jsx(chakra.span,{opacity:0,children:jsxRuntimeExports.jsx(ButtonContent,{...gt})}):jsxRuntimeExports.jsx(ButtonContent,{...gt}),et&&st==="end"&&jsxRuntimeExports.jsx(ButtonSpinner,{className:"chakra-button__spinner--end",label:j,placement:"end",spacing:_,children:tt})]})});Button.displayName="Button";function ButtonContent(i){const{leftIcon:s,rightIcon:o,children:a,iconSpacing:rt}=i;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[s&&jsxRuntimeExports.jsx(ButtonIcon,{marginEnd:rt,children:s}),a,o&&jsxRuntimeExports.jsx(ButtonIcon,{marginStart:rt,children:o})]})}var[CardStylesProvider,useCardStyles]=createStylesContext("Card"),CardBody=forwardRef(function(s,o){const{className:a,...rt}=s,et=useCardStyles();return jsxRuntimeExports.jsx(chakra.div,{ref:o,className:cx("chakra-card__body",a),__css:et.body,...rt})}),CardHeader=forwardRef(function(s,o){const{className:a,...rt}=s,et=useCardStyles();return jsxRuntimeExports.jsx(chakra.div,{ref:o,className:cx("chakra-card__header",a),__css:et.header,...rt})}),Card=forwardRef(function(s,o){const{className:a,children:rt,direction:et="column",justify:ot,align:at,...nt}=omitThemingProps(s),it=useMultiStyleConfig("Card",s);return jsxRuntimeExports.jsx(chakra.div,{ref:o,className:cx("chakra-card",a),__css:{display:"flex",flexDirection:et,justifyContent:ot,alignItems:at,position:"relative",minWidth:0,wordWrap:"break-word",...it.container},...nt,children:jsxRuntimeExports.jsx(CardStylesProvider,{value:it,children:rt})})}),[CheckboxGroupProvider,useCheckboxGroupContext]=createContext$2({name:"CheckboxGroupContext",strict:!1});function useInitialAnimationState(i){const[s,o]=reactExports.useState(i),[a,rt]=reactExports.useState(!1);return i!==s&&(rt(!0),o(i)),a}function CheckIcon(i){return jsxRuntimeExports.jsx(chakra.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...i,children:jsxRuntimeExports.jsx("polyline",{points:"1.5 6 4.5 9 10.5 1"})})}function IndeterminateIcon(i){return jsxRuntimeExports.jsx(chakra.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...i,children:jsxRuntimeExports.jsx("line",{x1:"21",x2:"3",y1:"12",y2:"12"})})}function CheckboxIcon(i){const{isIndeterminate:s,isChecked:o,...a}=i,rt=s?IndeterminateIcon:CheckIcon;return o||s?jsxRuntimeExports.jsx(chakra.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:jsxRuntimeExports.jsx(rt,{...a})}):null}var[FormControlStylesProvider,useFormControlStyles]=createContext$2({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[FormControlProvider,useFormControlContext]=createContext$2({strict:!1,name:"FormControlContext"});function useFormControlProvider(i){const{id:s,isRequired:o,isInvalid:a,isDisabled:rt,isReadOnly:et,...ot}=i,at=reactExports.useId(),nt=s||`field-${at}`,it=`${nt}-label`,j=`${nt}-feedback`,_=`${nt}-helptext`,[$,tt]=reactExports.useState(!1),[st,lt]=reactExports.useState(!1),[ct,ht]=reactExports.useState(!1),ut=reactExports.useCallback((St={},xt=null)=>({id:_,...St,ref:mergeRefs(xt,yt=>{yt&<(!0)})}),[_]),pt=reactExports.useCallback((St={},xt=null)=>({...St,ref:xt,"data-focus":dataAttr(ct),"data-disabled":dataAttr(rt),"data-invalid":dataAttr(a),"data-readonly":dataAttr(et),id:St.id!==void 0?St.id:it,htmlFor:St.htmlFor!==void 0?St.htmlFor:nt}),[nt,rt,ct,a,et,it]),mt=reactExports.useCallback((St={},xt=null)=>({id:j,...St,ref:mergeRefs(xt,yt=>{yt&&tt(!0)}),"aria-live":"polite"}),[j]),gt=reactExports.useCallback((St={},xt=null)=>({...St,...ot,ref:xt,role:"group","data-focus":dataAttr(ct),"data-disabled":dataAttr(rt),"data-invalid":dataAttr(a),"data-readonly":dataAttr(et)}),[ot,rt,ct,a,et]),dt=reactExports.useCallback((St={},xt=null)=>({...St,ref:xt,role:"presentation","aria-hidden":!0,children:St.children||"*"}),[]);return{isRequired:!!o,isInvalid:!!a,isReadOnly:!!et,isDisabled:!!rt,isFocused:!!ct,onFocus:()=>ht(!0),onBlur:()=>ht(!1),hasFeedbackText:$,setHasFeedbackText:tt,hasHelpText:st,setHasHelpText:lt,id:nt,labelId:it,feedbackId:j,helpTextId:_,htmlProps:ot,getHelpTextProps:ut,getErrorMessageProps:mt,getRootProps:gt,getLabelProps:pt,getRequiredIndicatorProps:dt}}var FormControl=forwardRef(function(s,o){const a=useMultiStyleConfig("Form",s),rt=omitThemingProps(s),{getRootProps:et,htmlProps:ot,...at}=useFormControlProvider(rt),nt=cx("chakra-form-control",s.className);return jsxRuntimeExports.jsx(FormControlProvider,{value:at,children:jsxRuntimeExports.jsx(FormControlStylesProvider,{value:a,children:jsxRuntimeExports.jsx(chakra.div,{...et({},o),className:nt,__css:a.container})})})});FormControl.displayName="FormControl";var FormHelperText=forwardRef(function(s,o){const a=useFormControlContext(),rt=useFormControlStyles(),et=cx("chakra-form__helper-text",s.className);return jsxRuntimeExports.jsx(chakra.div,{...a==null?void 0:a.getHelpTextProps(s,o),__css:rt.helperText,className:et})});FormHelperText.displayName="FormHelperText";function useFormControl(i){const{isDisabled:s,isInvalid:o,isReadOnly:a,isRequired:rt,...et}=useFormControlProps(i);return{...et,disabled:s,readOnly:a,required:rt,"aria-invalid":ariaAttr(o),"aria-required":ariaAttr(rt),"aria-readonly":ariaAttr(a)}}function useFormControlProps(i){var s,o,a;const rt=useFormControlContext(),{id:et,disabled:ot,readOnly:at,required:nt,isRequired:it,isInvalid:j,isReadOnly:_,isDisabled:$,onFocus:tt,onBlur:st,...lt}=i,ct=i["aria-describedby"]?[i["aria-describedby"]]:[];return rt!=null&&rt.hasFeedbackText&&(rt!=null&&rt.isInvalid)&&ct.push(rt.feedbackId),rt!=null&&rt.hasHelpText&&ct.push(rt.helpTextId),{...lt,"aria-describedby":ct.join(" ")||void 0,id:et??(rt==null?void 0:rt.id),isDisabled:(s=ot??$)!=null?s:rt==null?void 0:rt.isDisabled,isReadOnly:(o=at??_)!=null?o:rt==null?void 0:rt.isReadOnly,isRequired:(a=nt??it)!=null?a:rt==null?void 0:rt.isRequired,isInvalid:j??(rt==null?void 0:rt.isInvalid),onFocus:callAllHandlers$1(rt==null?void 0:rt.onFocus,tt),onBlur:callAllHandlers$1(rt==null?void 0:rt.onBlur,st)}}var visuallyHiddenStyle={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},isDom=()=>typeof document<"u",hasSetup=!1,modality=null,hasEventBeforeFocus=!1,hasBlurredWindowRecently=!1,handlers=new Set;function trigger(i,s){handlers.forEach(o=>o(i,s))}var isMac=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function isValidKey(i){return!(i.metaKey||!isMac&&i.altKey||i.ctrlKey||i.key==="Control"||i.key==="Shift"||i.key==="Meta")}function onKeyboardEvent(i){hasEventBeforeFocus=!0,isValidKey(i)&&(modality="keyboard",trigger("keyboard",i))}function onPointerEvent(i){if(modality="pointer",i.type==="mousedown"||i.type==="pointerdown"){hasEventBeforeFocus=!0;const s=i.composedPath?i.composedPath()[0]:i.target;let o=!1;try{o=s.matches(":focus-visible")}catch{}if(o)return;trigger("pointer",i)}}function isVirtualClick(i){return i.mozInputSource===0&&i.isTrusted?!0:i.detail===0&&!i.pointerType}function onClickEvent(i){isVirtualClick(i)&&(hasEventBeforeFocus=!0,modality="virtual")}function onWindowFocus(i){i.target===window||i.target===document||(!hasEventBeforeFocus&&!hasBlurredWindowRecently&&(modality="virtual",trigger("virtual",i)),hasEventBeforeFocus=!1,hasBlurredWindowRecently=!1)}function onWindowBlur$1(){hasEventBeforeFocus=!1,hasBlurredWindowRecently=!0}function isFocusVisible(){return modality!=="pointer"}function setupGlobalFocusEvents(){if(!isDom()||hasSetup)return;const{focus:i}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...o){hasEventBeforeFocus=!0,i.apply(this,o)},document.addEventListener("keydown",onKeyboardEvent,!0),document.addEventListener("keyup",onKeyboardEvent,!0),document.addEventListener("click",onClickEvent,!0),window.addEventListener("focus",onWindowFocus,!0),window.addEventListener("blur",onWindowBlur$1,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",onPointerEvent,!0),document.addEventListener("pointermove",onPointerEvent,!0),document.addEventListener("pointerup",onPointerEvent,!0)):(document.addEventListener("mousedown",onPointerEvent,!0),document.addEventListener("mousemove",onPointerEvent,!0),document.addEventListener("mouseup",onPointerEvent,!0)),hasSetup=!0}function trackFocusVisible(i){setupGlobalFocusEvents(),i(isFocusVisible());const s=()=>i(isFocusVisible());return handlers.add(s),()=>{handlers.delete(s)}}function omit(i,s=[]){const o=Object.assign({},i);for(const a of s)a in o&&delete o[a];return o}function useCheckbox(i={}){const s=useFormControlProps(i),{isDisabled:o,isReadOnly:a,isRequired:rt,isInvalid:et,id:ot,onBlur:at,onFocus:nt,"aria-describedby":it}=s,{defaultChecked:j,isChecked:_,isFocusable:$,onChange:tt,isIndeterminate:st,name:lt,value:ct,tabIndex:ht=void 0,"aria-label":ut,"aria-labelledby":pt,"aria-invalid":mt,...gt}=i,dt=omit(gt,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),St=useCallbackRef$2(tt),xt=useCallbackRef$2(at),yt=useCallbackRef$2(nt),[_t,Ct]=reactExports.useState(!1),[Et,kt]=reactExports.useState(!1),[Tt,$t]=reactExports.useState(!1),[It,Ot]=reactExports.useState(!1);reactExports.useEffect(()=>trackFocusVisible(Ct),[]);const Mt=reactExports.useRef(null),[Dt,Bt]=reactExports.useState(!0),[Kt,Wt]=reactExports.useState(!!j),zt=_!==void 0,Ht=zt?_:Kt,Zt=reactExports.useCallback(Sr=>{if(a||o){Sr.preventDefault();return}zt||Wt(Ht?Sr.target.checked:st?!0:Sr.target.checked),St==null||St(Sr)},[a,o,Ht,zt,st,St]);useSafeLayoutEffect$1(()=>{Mt.current&&(Mt.current.indeterminate=!!st)},[st]),useUpdateEffect(()=>{o&&kt(!1)},[o,kt]),useSafeLayoutEffect$1(()=>{const Sr=Mt.current;if(!(Sr!=null&&Sr.form))return;const dr=()=>{Wt(!!j)};return Sr.form.addEventListener("reset",dr),()=>{var Ur;return(Ur=Sr.form)==null?void 0:Ur.removeEventListener("reset",dr)}},[]);const qt=o&&!$,hr=reactExports.useCallback(Sr=>{Sr.key===" "&&Ot(!0)},[Ot]),fr=reactExports.useCallback(Sr=>{Sr.key===" "&&Ot(!1)},[Ot]);useSafeLayoutEffect$1(()=>{if(!Mt.current)return;Mt.current.checked!==Ht&&Wt(Mt.current.checked)},[Mt.current]);const mr=reactExports.useCallback((Sr={},dr=null)=>{const Ur=tn=>{Et&&tn.preventDefault(),Ot(!0)};return{...Sr,ref:dr,"data-active":dataAttr(It),"data-hover":dataAttr(Tt),"data-checked":dataAttr(Ht),"data-focus":dataAttr(Et),"data-focus-visible":dataAttr(Et&&_t),"data-indeterminate":dataAttr(st),"data-disabled":dataAttr(o),"data-invalid":dataAttr(et),"data-readonly":dataAttr(a),"aria-hidden":!0,onMouseDown:callAllHandlers$1(Sr.onMouseDown,Ur),onMouseUp:callAllHandlers$1(Sr.onMouseUp,()=>Ot(!1)),onMouseEnter:callAllHandlers$1(Sr.onMouseEnter,()=>$t(!0)),onMouseLeave:callAllHandlers$1(Sr.onMouseLeave,()=>$t(!1))}},[It,Ht,o,Et,_t,Tt,st,et,a]),gr=reactExports.useCallback((Sr={},dr=null)=>({...Sr,ref:dr,"data-active":dataAttr(It),"data-hover":dataAttr(Tt),"data-checked":dataAttr(Ht),"data-focus":dataAttr(Et),"data-focus-visible":dataAttr(Et&&_t),"data-indeterminate":dataAttr(st),"data-disabled":dataAttr(o),"data-invalid":dataAttr(et),"data-readonly":dataAttr(a)}),[It,Ht,o,Et,_t,Tt,st,et,a]),tr=reactExports.useCallback((Sr={},dr=null)=>({...dt,...Sr,ref:mergeRefs(dr,Ur=>{Ur&&Bt(Ur.tagName==="LABEL")}),onClick:callAllHandlers$1(Sr.onClick,()=>{var Ur;Dt||((Ur=Mt.current)==null||Ur.click(),requestAnimationFrame(()=>{var tn;(tn=Mt.current)==null||tn.focus({preventScroll:!0})}))}),"data-disabled":dataAttr(o),"data-checked":dataAttr(Ht),"data-invalid":dataAttr(et)}),[dt,o,Ht,et,Dt]),rr=reactExports.useCallback((Sr={},dr=null)=>({...Sr,ref:mergeRefs(Mt,dr),type:"checkbox",name:lt,value:ct,id:ot,tabIndex:ht,onChange:callAllHandlers$1(Sr.onChange,Zt),onBlur:callAllHandlers$1(Sr.onBlur,xt,()=>kt(!1)),onFocus:callAllHandlers$1(Sr.onFocus,yt,()=>kt(!0)),onKeyDown:callAllHandlers$1(Sr.onKeyDown,hr),onKeyUp:callAllHandlers$1(Sr.onKeyUp,fr),required:rt,checked:Ht,disabled:qt,readOnly:a,"aria-label":ut,"aria-labelledby":pt,"aria-invalid":mt?!!mt:et,"aria-describedby":it,"aria-disabled":o,style:visuallyHiddenStyle}),[lt,ct,ot,Zt,xt,yt,hr,fr,rt,Ht,qt,a,ut,pt,mt,et,it,o,ht]),Qt=reactExports.useCallback((Sr={},dr=null)=>({...Sr,ref:dr,onMouseDown:callAllHandlers$1(Sr.onMouseDown,stopEvent),"data-disabled":dataAttr(o),"data-checked":dataAttr(Ht),"data-invalid":dataAttr(et)}),[Ht,o,et]);return{state:{isInvalid:et,isFocused:Et,isChecked:Ht,isActive:It,isHovered:Tt,isIndeterminate:st,isDisabled:o,isReadOnly:a,isRequired:rt},getRootProps:tr,getCheckboxProps:mr,getIndicatorProps:gr,getInputProps:rr,getLabelProps:Qt,htmlProps:dt}}function stopEvent(i){i.preventDefault(),i.stopPropagation()}var controlStyles={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},rootStyles={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},checkAnim=keyframes$1({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),indeterminateOpacityAnim=keyframes$1({from:{opacity:0},to:{opacity:1}}),indeterminateScaleAnim=keyframes$1({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),Checkbox=forwardRef(function(s,o){const a=useCheckboxGroupContext(),rt={...a,...s},et=useMultiStyleConfig("Checkbox",rt),ot=omitThemingProps(s),{spacing:at="0.5rem",className:nt,children:it,iconColor:j,iconSize:_,icon:$=jsxRuntimeExports.jsx(CheckboxIcon,{}),isChecked:tt,isDisabled:st=a==null?void 0:a.isDisabled,onChange:lt,inputProps:ct,...ht}=ot;let ut=tt;a!=null&&a.value&&ot.value&&(ut=a.value.includes(ot.value));let pt=lt;a!=null&&a.onChange&&ot.value&&(pt=callAll(a.onChange,lt));const{state:mt,getInputProps:gt,getCheckboxProps:dt,getLabelProps:St,getRootProps:xt}=useCheckbox({...ht,isDisabled:st,isChecked:ut,onChange:pt}),yt=useInitialAnimationState(mt.isChecked),_t=reactExports.useMemo(()=>({animation:yt?mt.isIndeterminate?`${indeterminateOpacityAnim} 20ms linear, ${indeterminateScaleAnim} 200ms linear`:`${checkAnim} 200ms linear`:void 0,fontSize:_,color:j,...et.icon}),[j,_,yt,mt.isIndeterminate,et.icon]),Ct=reactExports.cloneElement($,{__css:_t,isIndeterminate:mt.isIndeterminate,isChecked:mt.isChecked});return jsxRuntimeExports.jsxs(chakra.label,{__css:{...rootStyles,...et.container},className:cx("chakra-checkbox",nt),...xt(),children:[jsxRuntimeExports.jsx("input",{className:"chakra-checkbox__input",...gt(ct,o)}),jsxRuntimeExports.jsx(chakra.span,{__css:{...controlStyles,...et.control},className:"chakra-checkbox__control",...dt(),children:Ct}),it&&jsxRuntimeExports.jsx(chakra.span,{className:"chakra-checkbox__label",...St(),__css:{marginStart:at,...et.label},children:it})]})});Checkbox.displayName="Checkbox";function _objectWithoutPropertiesLoose(i,s){if(i==null)return{};var o={},a=Object.keys(i),rt,et;for(et=0;et=0)&&(o[rt]=i[rt]);return o}function _extends(){return _extends=Object.assign?Object.assign.bind():function(i){for(var s=1;s=0}).sort(tabSort)},tabbables=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],queryTabbables=tabbables.join(","),queryGuardTabbables="".concat(queryTabbables,", [data-focus-guard]"),getFocusablesWithShadowDom=function(i,s){return toArray((i.shadowRoot||i).children).reduce(function(o,a){return o.concat(a.matches(s?queryGuardTabbables:queryTabbables)?[a]:[],getFocusablesWithShadowDom(a))},[])},getFocusablesWithIFrame=function(i,s){var o;return i instanceof HTMLIFrameElement&&(!((o=i.contentDocument)===null||o===void 0)&&o.body)?getFocusables([i.contentDocument.body],s):[i]},getFocusables=function(i,s){return i.reduce(function(o,a){var rt,et=getFocusablesWithShadowDom(a,s),ot=(rt=[]).concat.apply(rt,et.map(function(at){return getFocusablesWithIFrame(at,s)}));return o.concat(ot,a.parentNode?toArray(a.parentNode.querySelectorAll(queryTabbables)).filter(function(at){return at===a}):[])},[])},getParentAutofocusables=function(i){var s=i.querySelectorAll("[".concat(FOCUS_AUTO,"]"));return toArray(s).map(function(o){return getFocusables([o])}).reduce(function(o,a){return o.concat(a)},[])},filterFocusable=function(i,s){return toArray(i).filter(function(o){return isVisibleCached(s,o)}).filter(function(o){return notHiddenInput(o)})},filterAutoFocusable=function(i,s){return s===void 0&&(s=new Map),toArray(i).filter(function(o){return isAutoFocusAllowedCached(s,o)})},getTabbableNodes=function(i,s,o){return orderByTabIndex(filterFocusable(getFocusables(i,o),s),!0,o)},getFocusableNodes=function(i,s){return orderByTabIndex(filterFocusable(getFocusables(i),s),!1)},parentAutofocusables=function(i,s){return filterFocusable(getParentAutofocusables(i),s)},contains=function(i,s){return i.shadowRoot?contains(i.shadowRoot,s):Object.getPrototypeOf(i).contains!==void 0&&Object.getPrototypeOf(i).contains.call(i,s)?!0:toArray(i.children).some(function(o){var a;if(o instanceof HTMLIFrameElement){var rt=(a=o.contentDocument)===null||a===void 0?void 0:a.body;return rt?contains(rt,s):!1}return contains(o,s)})},filterNested=function(i){for(var s=new Set,o=i.length,a=0;a0&&s.add(rt),(et&Node.DOCUMENT_POSITION_CONTAINS)>0&&s.add(a)}return i.filter(function(ot,at){return!s.has(at)})},getTopParent=function(i){return i.parentNode?getTopParent(i.parentNode):i},getAllAffectedNodes=function(i){var s=asArray(i);return s.filter(Boolean).reduce(function(o,a){var rt=a.getAttribute(FOCUS_GROUP);return o.push.apply(o,rt?filterNested(toArray(getTopParent(a).querySelectorAll("[".concat(FOCUS_GROUP,'="').concat(rt,'"]:not([').concat(FOCUS_DISABLED,'="disabled"])')))):[a]),o},[])},safeProbe=function(i){try{return i()}catch{return}},getActiveElement=function(i){if(i===void 0&&(i=document),!(!i||!i.activeElement)){var s=i.activeElement;return s.shadowRoot?getActiveElement(s.shadowRoot):s instanceof HTMLIFrameElement&&safeProbe(function(){return s.contentWindow.document})?getActiveElement(s.contentWindow.document):s}},focusInFrame=function(i,s){return i===s},focusInsideIframe=function(i,s){return!!toArray(i.querySelectorAll("iframe")).some(function(o){return focusInFrame(o,s)})},focusInside=function(i,s){return s===void 0&&(s=getActiveElement(getFirst(i).ownerDocument)),!s||s.dataset&&s.dataset.focusGuard?!1:getAllAffectedNodes(i).some(function(o){return contains(o,s)||focusInsideIframe(o,s)})},focusIsHidden=function(i){i===void 0&&(i=document);var s=getActiveElement(i);return s?toArray(i.querySelectorAll("[".concat(FOCUS_ALLOW,"]"))).some(function(o){return contains(o,s)}):!1},findSelectedRadio=function(i,s){return s.filter(isRadioElement).filter(function(o){return o.name===i.name}).filter(function(o){return o.checked})[0]||i},correctNode=function(i,s){return isRadioElement(i)&&i.name?findSelectedRadio(i,s):i},correctNodes=function(i){var s=new Set;return i.forEach(function(o){return s.add(correctNode(o,i))}),i.filter(function(o){return s.has(o)})},pickFirstFocus=function(i){return i[0]&&i.length>1?correctNode(i[0],i):i[0]},pickFocusable=function(i,s){return i.length>1?i.indexOf(correctNode(i[s],i)):s},NEW_FOCUS="NEW_FOCUS",newFocus=function(i,s,o,a){var rt=i.length,et=i[0],ot=i[rt-1],at=isGuard(o);if(!(o&&i.indexOf(o)>=0)){var nt=o!==void 0?s.indexOf(o):-1,it=a?s.indexOf(a):nt,j=a?i.indexOf(a):-1,_=nt-it,$=s.indexOf(et),tt=s.indexOf(ot),st=correctNodes(s),lt=o!==void 0?st.indexOf(o):-1,ct=lt-(a?st.indexOf(a):nt),ht=pickFocusable(i,0),ut=pickFocusable(i,rt-1);if(nt===-1||j===-1)return NEW_FOCUS;if(!_&&j>=0)return j;if(nt<=$&&at&&Math.abs(_)>1)return ut;if(nt>=tt&&at&&Math.abs(_)>1)return ht;if(_&&Math.abs(ct)>1)return j;if(nt<=$)return ut;if(nt>tt)return ht;if(_)return Math.abs(_)>1?j:(rt+j+_)%rt}},findAutoFocused=function(i){return function(s){var o,a=(o=getDataset(s))===null||o===void 0?void 0:o.autofocus;return s.autofocus||a!==void 0&&a!=="false"||i.indexOf(s)>=0}},pickAutofocus=function(i,s,o){var a=i.map(function(et){var ot=et.node;return ot}),rt=filterAutoFocusable(a.filter(findAutoFocused(o)));return rt&&rt.length?pickFirstFocus(rt):pickFirstFocus(filterAutoFocusable(s))},getParents=function(i,s){return s===void 0&&(s=[]),s.push(i),i.parentNode&&getParents(i.parentNode.host||i.parentNode,s),s},getCommonParent=function(i,s){for(var o=getParents(i),a=getParents(s),rt=0;rt=0)return et}return!1},getTopCommonParent=function(i,s,o){var a=asArray(i),rt=asArray(s),et=a[0],ot=!1;return rt.filter(Boolean).forEach(function(at){ot=getCommonParent(ot||at,at)||ot,o.filter(Boolean).forEach(function(nt){var it=getCommonParent(et,nt);it&&(!ot||contains(it,ot)?ot=it:ot=getCommonParent(it,ot))})}),ot},allParentAutofocusables=function(i,s){return i.reduce(function(o,a){return o.concat(parentAutofocusables(a,s))},[])},reorderNodes=function(i,s){var o=new Map;return s.forEach(function(a){return o.set(a.node,a)}),i.map(function(a){return o.get(a)}).filter(isDefined)},focusSolver=function(i,s){var o=getActiveElement(asArray(i).length>0?document:getFirst(i).ownerDocument),a=getAllAffectedNodes(i).filter(isNotAGuard),rt=getTopCommonParent(o||i,i,a),et=new Map,ot=getFocusableNodes(a,et),at=getTabbableNodes(a,et).filter(function(tt){var st=tt.node;return isNotAGuard(st)});if(!(!at[0]&&(at=ot,!at[0]))){var nt=getFocusableNodes([rt],et).map(function(tt){var st=tt.node;return st}),it=reorderNodes(nt,at),j=it.map(function(tt){var st=tt.node;return st}),_=newFocus(j,nt,o,s);if(_===NEW_FOCUS){var $=pickAutofocus(ot,j,allParentAutofocusables(a,et));if($)return{node:$};console.warn("focus-lock: cannot find any node to move focus into");return}return _===void 0?_:it[_]}},expandFocusableNodes=function(i){var s=getAllAffectedNodes(i).filter(isNotAGuard),o=getTopCommonParent(i,i,s),a=new Map,rt=getTabbableNodes([o],a,!0),et=getTabbableNodes(s,a).filter(function(ot){var at=ot.node;return isNotAGuard(at)}).map(function(ot){var at=ot.node;return at});return rt.map(function(ot){var at=ot.node,nt=ot.index;return{node:at,index:nt,lockItem:et.indexOf(at)>=0,guard:isGuard(at)}})},focusOn=function(i,s){"focus"in i&&i.focus(s),"contentWindow"in i&&i.contentWindow&&i.contentWindow.focus()},guardCount=0,lockDisabled=!1,moveFocusInside=function(i,s,o){o===void 0&&(o={});var a=focusSolver(i,s);if(!lockDisabled&&a){if(guardCount>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),lockDisabled=!0,setTimeout(function(){lockDisabled=!1},1);return}guardCount++,focusOn(a.node,o.focusOptions),guardCount--}};function deferAction(i){setTimeout(i,1)}var focusOnBody=function(){return document&&document.activeElement===document.body},isFreeFocus=function(){return focusOnBody()||focusIsHidden()},lastActiveTrap=null,lastActiveFocus=null,lastPortaledElement=null,focusWasOutsideWindow=!1,defaultWhitelist=function(){return!0},focusWhitelisted=function(s){return(lastActiveTrap.whiteList||defaultWhitelist)(s)},recordPortal=function(s,o){lastPortaledElement={observerNode:s,portaledElement:o}},focusIsPortaledPair=function(s){return lastPortaledElement&&lastPortaledElement.portaledElement===s};function autoGuard(i,s,o,a){var rt=null,et=i;do{var ot=a[et];if(ot.guard)ot.node.dataset.focusAutoGuard&&(rt=ot);else if(ot.lockItem){if(et!==i)return;rt=null}else break}while((et+=o)!==s);rt&&(rt.node.tabIndex=0)}var extractRef$1=function(s){return s&&"current"in s?s.current:s},focusWasOutside=function(s){return s?!!focusWasOutsideWindow:focusWasOutsideWindow==="meanwhile"},checkInHost=function i(s,o,a){return o&&(o.host===s&&(!o.activeElement||a.contains(o.activeElement))||o.parentNode&&i(s,o.parentNode,a))},withinHost=function(s,o){return o.some(function(a){return checkInHost(s,a,a)})},activateTrap=function(){var s=!1;if(lastActiveTrap){var o=lastActiveTrap,a=o.observed,rt=o.persistentFocus,et=o.autoFocus,ot=o.shards,at=o.crossFrame,nt=o.focusOptions,it=a||lastPortaledElement&&lastPortaledElement.portaledElement,j=document&&document.activeElement;if(it){var _=[it].concat(ot.map(extractRef$1).filter(Boolean));if((!j||focusWhitelisted(j))&&(rt||focusWasOutside(at)||!isFreeFocus()||!lastActiveFocus&&et)&&(it&&!(focusInside(_)||j&&withinHost(j,_)||focusIsPortaledPair(j))&&(document&&!lastActiveFocus&&j&&!et?(j.blur&&j.blur(),document.body.focus()):(s=moveFocusInside(_,lastActiveFocus,{focusOptions:nt}),lastPortaledElement={})),focusWasOutsideWindow=!1,lastActiveFocus=document&&document.activeElement),document){var $=document&&document.activeElement,tt=expandFocusableNodes(_),st=tt.map(function(lt){var ct=lt.node;return ct}).indexOf($);st>-1&&(tt.filter(function(lt){var ct=lt.guard,ht=lt.node;return ct&&ht.dataset.focusAutoGuard}).forEach(function(lt){var ct=lt.node;return ct.removeAttribute("tabIndex")}),autoGuard(st,tt.length,1,tt),autoGuard(st,-1,-1,tt))}}}return s},onTrap=function(s){activateTrap()&&s&&(s.stopPropagation(),s.preventDefault())},onBlur=function(){return deferAction(activateTrap)},onFocus=function(s){var o=s.target,a=s.currentTarget;a.contains(o)||recordPortal(a,o)},FocusWatcher=function(){return null},onWindowBlur=function(){focusWasOutsideWindow="just",deferAction(function(){focusWasOutsideWindow="meanwhile"})},attachHandler=function(){document.addEventListener("focusin",onTrap),document.addEventListener("focusout",onBlur),window.addEventListener("blur",onWindowBlur)},detachHandler=function(){document.removeEventListener("focusin",onTrap),document.removeEventListener("focusout",onBlur),window.removeEventListener("blur",onWindowBlur)};function reducePropsToState(i){return i.filter(function(s){var o=s.disabled;return!o})}function handleStateChangeOnClient(i){var s=i.slice(-1)[0];s&&!lastActiveTrap&&attachHandler();var o=lastActiveTrap,a=o&&s&&s.id===o.id;lastActiveTrap=s,o&&!a&&(o.onDeactivation(),i.filter(function(rt){var et=rt.id;return et===o.id}).length||o.returnFocus(!s)),s?(lastActiveFocus=null,(!a||o.observed!==s.observed)&&s.onActivation(),activateTrap(),deferAction(activateTrap)):(detachHandler(),lastActiveFocus=null)}mediumFocus.assignSyncMedium(onFocus);mediumBlur.assignMedium(onBlur);mediumEffect.assignMedium(function(i){return i({moveFocusInside,focusInside})});const FocusTrap$1=withSideEffect(reducePropsToState,handleStateChangeOnClient)(FocusWatcher);var FocusLockCombination=reactExports.forwardRef(function(s,o){return reactExports.createElement(FocusLock$1,_extends({sideCar:FocusTrap$1,ref:o},s))}),_ref=FocusLock$1.propTypes||{};_ref.sideCar;_objectWithoutPropertiesLoose(_ref,["sideCar"]);FocusLockCombination.propTypes={};function isElement(i){return i!=null&&typeof i=="object"&&"nodeType"in i&&i.nodeType===Node.ELEMENT_NODE}function isHTMLElement(i){var s;if(!isElement(i))return!1;const o=(s=i.ownerDocument.defaultView)!=null?s:window;return i instanceof o.HTMLElement}var hasTabIndex=i=>i.hasAttribute("tabindex");function isDisabled(i){return!!i.getAttribute("disabled")||!!i.getAttribute("aria-disabled")}function isHidden(i){return i.parentElement&&isHidden(i.parentElement)?!0:i.hidden}function isContentEditable(i){const s=i.getAttribute("contenteditable");return s!=="false"&&s!=null}function isFocusable(i){if(!isHTMLElement(i)||isHidden(i)||isDisabled(i))return!1;const{localName:s}=i;if(["input","select","textarea","button"].indexOf(s)>=0)return!0;const a={a:()=>i.hasAttribute("href"),audio:()=>i.hasAttribute("controls"),video:()=>i.hasAttribute("controls")};return s in a?a[s]():isContentEditable(i)?!0:hasTabIndex(i)}var focusableElList=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],focusableElSelector=focusableElList.join(),isVisible=i=>i.offsetWidth>0&&i.offsetHeight>0;function getAllFocusable(i){const s=Array.from(i.querySelectorAll(focusableElSelector));return s.unshift(i),s.filter(o=>isFocusable(o)&&isVisible(o))}var _a,FocusTrap=(_a=FocusLockCombination.default)!=null?_a:FocusLockCombination,FocusLock=i=>{const{initialFocusRef:s,finalFocusRef:o,contentRef:a,restoreFocus:rt,children:et,isDisabled:ot,autoFocus:at,persistentFocus:nt,lockFocusAcrossFrames:it}=i,j=reactExports.useCallback(()=>{s!=null&&s.current?s.current.focus():a!=null&&a.current&&getAllFocusable(a.current).length===0&&requestAnimationFrame(()=>{var st;(st=a.current)==null||st.focus()})},[s,a]),_=reactExports.useCallback(()=>{var tt;(tt=o==null?void 0:o.current)==null||tt.focus()},[o]),$=rt&&!o;return jsxRuntimeExports.jsx(FocusTrap,{crossFrame:it,persistentFocus:nt,autoFocus:at,disabled:ot,onActivation:j,onDeactivation:_,returnFocus:$,children:et})};FocusLock.displayName="FocusLock";var useSafeLayoutEffect=isBrowser$1?reactExports.useLayoutEffect:reactExports.useEffect;function useCallbackRef(i,s=[]){const o=reactExports.useRef(i);return useSafeLayoutEffect(()=>{o.current=i}),reactExports.useCallback((...a)=>{var rt;return(rt=o.current)==null?void 0:rt.call(o,...a)},s)}function useId(i,s){const o=reactExports.useId();return reactExports.useMemo(()=>i||[s,o].filter(Boolean).join("-"),[i,s,o])}function useControllableProp(i,s){const o=i!==void 0;return[o,o&&typeof i<"u"?i:s]}function useDisclosure(i={}){const{onClose:s,onOpen:o,isOpen:a,id:rt}=i,et=useCallbackRef(o),ot=useCallbackRef(s),[at,nt]=reactExports.useState(i.defaultIsOpen||!1),[it,j]=useControllableProp(a,at),_=useId(rt,"disclosure"),$=reactExports.useCallback(()=>{it||nt(!1),ot==null||ot()},[it,ot]),tt=reactExports.useCallback(()=>{it||nt(!0),et==null||et()},[it,et]),st=reactExports.useCallback(()=>{(j?$:tt)()},[j,tt,$]);return{isOpen:!!j,onOpen:tt,onClose:$,onToggle:st,isControlled:it,getButtonProps:(lt={})=>({...lt,"aria-expanded":j,"aria-controls":_,onClick:callAllHandlers(lt.onClick,st)}),getDisclosureProps:(lt={})=>({...lt,hidden:!j,id:_})}}var[ListStylesProvider,useListStyles]=createContext$2({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),List=forwardRef(function(s,o){const a=useMultiStyleConfig("List",s),{children:rt,styleType:et="none",stylePosition:ot,spacing:at,...nt}=omitThemingProps(s),it=getValidChildren(rt),_=at?{["& > *:not(style) ~ *:not(style)"]:{mt:at}}:{};return jsxRuntimeExports.jsx(ListStylesProvider,{value:a,children:jsxRuntimeExports.jsx(chakra.ul,{ref:o,listStyleType:et,listStylePosition:ot,role:"list",__css:{...a.container,..._},...nt,children:it})})});List.displayName="List";var OrderedList=forwardRef((i,s)=>{const{as:o,...a}=i;return jsxRuntimeExports.jsx(List,{ref:s,as:"ol",styleType:"decimal",marginStart:"1em",...a})});OrderedList.displayName="OrderedList";var UnorderedList=forwardRef(function(s,o){const{as:a,...rt}=s;return jsxRuntimeExports.jsx(List,{ref:o,as:"ul",styleType:"initial",marginStart:"1em",...rt})});UnorderedList.displayName="UnorderedList";var ListItem=forwardRef(function(s,o){const a=useListStyles();return jsxRuntimeExports.jsx(chakra.li,{ref:o,...s,__css:a.item})});ListItem.displayName="ListItem";var ListIcon=forwardRef(function(s,o){const a=useListStyles();return jsxRuntimeExports.jsx(Icon,{ref:o,role:"presentation",...s,__css:a.icon})});ListIcon.displayName="ListIcon";var Grid=forwardRef(function(s,o){const{templateAreas:a,gap:rt,rowGap:et,columnGap:ot,column:at,row:nt,autoFlow:it,autoRows:j,templateRows:_,autoColumns:$,templateColumns:tt,...st}=s,lt={display:"grid",gridTemplateAreas:a,gridGap:rt,gridRowGap:et,gridColumnGap:ot,gridAutoColumns:$,gridColumn:at,gridRow:nt,gridAutoFlow:it,gridAutoRows:j,gridTemplateRows:_,gridTemplateColumns:tt};return jsxRuntimeExports.jsx(chakra.div,{ref:o,__css:lt,...st})});Grid.displayName="Grid";function mapResponsive(i,s){return Array.isArray(i)?i.map(o=>o===null?null:s(o)):isObject$2(i)?Object.keys(i).reduce((o,a)=>(o[a]=s(i[a]),o),{}):i!=null?s(i):null}var SimpleGrid=forwardRef(function(s,o){const{columns:a,spacingX:rt,spacingY:et,spacing:ot,minChildWidth:at,...nt}=s,it=useTheme(),j=at?widthToColumns(at,it):countToColumns(a);return jsxRuntimeExports.jsx(Grid,{ref:o,gap:ot,columnGap:rt,rowGap:et,templateColumns:j,...nt})});SimpleGrid.displayName="SimpleGrid";function toPx(i){return typeof i=="number"?`${i}px`:i}function widthToColumns(i,s){return mapResponsive(i,o=>{const a=getToken("sizes",o,toPx(o))(s);return o===null?null:`repeat(auto-fit, minmax(${a}, 1fr))`})}function countToColumns(i){return mapResponsive(i,s=>s===null?null:`repeat(${s}, minmax(0, 1fr))`)}var Spacer=chakra("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});Spacer.displayName="Spacer";var Text=forwardRef(function(s,o){const a=useStyleConfig("Text",s),{className:rt,align:et,decoration:ot,casing:at,...nt}=omitThemingProps(s),it=compact({textAlign:s.align,textDecoration:s.decoration,textTransform:s.casing});return jsxRuntimeExports.jsx(chakra.p,{ref:o,className:cx("chakra-text",s.className),...it,...nt,__css:a})});Text.displayName="Text";var StackDivider=i=>jsxRuntimeExports.jsx(chakra.div,{className:"chakra-stack__divider",...i,__css:{...i.__css,borderWidth:0,alignSelf:"stretch",borderColor:"inherit",width:"auto",height:"auto"}});StackDivider.displayName="StackDivider";var StackItem=i=>jsxRuntimeExports.jsx(chakra.div,{className:"chakra-stack__item",...i,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...i.__css}});StackItem.displayName="StackItem";function getDividerStyles(i){const{spacing:s,direction:o}=i,a={column:{my:s,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:s,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:s,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:s,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":mapResponsive(o,rt=>a[rt])}}var Stack=forwardRef((i,s)=>{const{isInline:o,direction:a,align:rt,justify:et,spacing:ot="0.5rem",wrap:at,children:nt,divider:it,className:j,shouldWrapChildren:_,...$}=i,tt=o?"row":a??"column",st=reactExports.useMemo(()=>getDividerStyles({spacing:ot,direction:tt}),[ot,tt]),lt=!!it,ct=!_&&!lt,ht=reactExports.useMemo(()=>{const pt=getValidChildren(nt);return ct?pt:pt.map((mt,gt)=>{const dt=typeof mt.key<"u"?mt.key:gt,St=gt+1===pt.length,yt=_?jsxRuntimeExports.jsx(StackItem,{children:mt},dt):mt;if(!lt)return yt;const _t=reactExports.cloneElement(it,{__css:st}),Ct=St?null:_t;return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[yt,Ct]},dt)})},[it,st,lt,ct,_,nt]),ut=cx("chakra-stack",j);return jsxRuntimeExports.jsx(chakra.div,{ref:s,display:"flex",alignItems:rt,justifyContent:et,flexDirection:tt,flexWrap:at,gap:lt?void 0:ot,className:ut,...$,children:ht})});Stack.displayName="Stack";var HStack=forwardRef((i,s)=>jsxRuntimeExports.jsx(Stack,{align:"center",...i,direction:"row",ref:s}));HStack.displayName="HStack";function spanFn(i){return mapResponsive(i,s=>s==="auto"?"auto":`span ${s}/span ${s}`)}var GridItem=forwardRef(function(s,o){const{area:a,colSpan:rt,colStart:et,colEnd:ot,rowEnd:at,rowSpan:nt,rowStart:it,...j}=s,_=compact({gridArea:a,gridColumn:spanFn(rt),gridRow:spanFn(nt),gridColumnStart:et,gridColumnEnd:ot,gridRowStart:it,gridRowEnd:at});return jsxRuntimeExports.jsx(chakra.div,{ref:o,__css:_,...j})});GridItem.displayName="GridItem";var Heading=forwardRef(function(s,o){const a=useStyleConfig("Heading",s),{className:rt,...et}=omitThemingProps(s);return jsxRuntimeExports.jsx(chakra.h2,{ref:o,className:cx("chakra-heading",s.className),...et,__css:a})});Heading.displayName="Heading";var Box=chakra("div");Box.displayName="Box";var Square=forwardRef(function(s,o){const{size:a,centerContent:rt=!0,...et}=s,ot=rt?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return jsxRuntimeExports.jsx(Box,{ref:o,boxSize:a,__css:{...ot,flexShrink:0,flexGrow:0},...et})});Square.displayName="Square";var Circle=forwardRef(function(s,o){const{size:a,...rt}=s;return jsxRuntimeExports.jsx(Square,{size:a,ref:o,borderRadius:"9999px",...rt})});Circle.displayName="Circle";var Code=forwardRef(function(s,o){const a=useStyleConfig("Code",s),{className:rt,...et}=omitThemingProps(s);return jsxRuntimeExports.jsx(chakra.code,{ref:o,className:cx("chakra-code",s.className),...et,__css:{display:"inline-block",...a}})});Code.displayName="Code";var transitions={slideInBottom:{...slideFadeConfig,custom:{offsetY:16,reverse:!0}},slideInRight:{...slideFadeConfig,custom:{offsetX:16,reverse:!0}},slideInTop:{...slideFadeConfig,custom:{offsetY:-16,reverse:!0}},slideInLeft:{...slideFadeConfig,custom:{offsetX:-16,reverse:!0}},scale:{...scaleFadeConfig,custom:{initialScale:.95,reverse:!0}},none:{}},MotionSection=chakra(motion.section),getMotionProps=i=>transitions[i||"none"],ModalTransition=reactExports.forwardRef((i,s)=>{const{preset:o,motionProps:a=getMotionProps(o),...rt}=i;return jsxRuntimeExports.jsx(MotionSection,{ref:s,...a,...rt})});ModalTransition.displayName="ModalTransition";var __defProp=Object.defineProperty,__defNormalProp=(i,s,o)=>s in i?__defProp(i,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[s]=o,__publicField=(i,s,o)=>(__defNormalProp(i,s+"",o),o),ModalManager=class{constructor(){__publicField(this,"modals"),this.modals=new Map}add(i){return this.modals.set(i,this.modals.size+1),this.modals.size}remove(i){this.modals.delete(i)}isTopModal(i){return i?this.modals.get(i)===this.modals.size:!1}},modalManager=new ModalManager;function useModalManager(i,s){const[o,a]=reactExports.useState(0);return reactExports.useEffect(()=>{const rt=i.current;if(rt){if(s){const et=modalManager.add(rt);a(et)}return()=>{modalManager.remove(rt),a(0)}}},[s,i]),o}var getDefaultParent=function(i){if(typeof document>"u")return null;var s=Array.isArray(i)?i[0]:i;return s.ownerDocument.body},counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={},lockCount=0,unwrapHost=function(i){return i&&(i.host||unwrapHost(i.parentNode))},correctTargets=function(i,s){return s.map(function(o){if(i.contains(o))return o;var a=unwrapHost(o);return a&&i.contains(a)?a:(console.error("aria-hidden",o,"in not contained inside",i,". Doing nothing"),null)}).filter(function(o){return!!o})},applyAttributeToOthers=function(i,s,o,a){var rt=correctTargets(s,Array.isArray(i)?i:[i]);markerMap[o]||(markerMap[o]=new WeakMap);var et=markerMap[o],ot=[],at=new Set,nt=new Set(rt),it=function(_){!_||at.has(_)||(at.add(_),it(_.parentNode))};rt.forEach(it);var j=function(_){!_||nt.has(_)||Array.prototype.forEach.call(_.children,function($){if(at.has($))j($);else{var tt=$.getAttribute(a),st=tt!==null&&tt!=="false",lt=(counterMap.get($)||0)+1,ct=(et.get($)||0)+1;counterMap.set($,lt),et.set($,ct),ot.push($),lt===1&&st&&uncontrolledNodes.set($,!0),ct===1&&$.setAttribute(o,"true"),st||$.setAttribute(a,"true")}})};return j(s),at.clear(),lockCount++,function(){ot.forEach(function(_){var $=counterMap.get(_)-1,tt=et.get(_)-1;counterMap.set(_,$),et.set(_,tt),$||(uncontrolledNodes.has(_)||_.removeAttribute(a),uncontrolledNodes.delete(_)),tt||_.removeAttribute(o)}),lockCount--,lockCount||(counterMap=new WeakMap,counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={})}},hideOthers=function(i,s,o){o===void 0&&(o="data-aria-hidden");var a=Array.from(Array.isArray(i)?i:[i]),rt=getDefaultParent(i);return rt?(a.push.apply(a,Array.from(rt.querySelectorAll("[aria-live]"))),applyAttributeToOthers(a,rt,o,"aria-hidden")):function(){return null}};function useModal(i){const{isOpen:s,onClose:o,id:a,closeOnOverlayClick:rt=!0,closeOnEsc:et=!0,useInert:ot=!0,onOverlayClick:at,onEsc:nt}=i,it=reactExports.useRef(null),j=reactExports.useRef(null),[_,$,tt]=useIds(a,"chakra-modal","chakra-modal--header","chakra-modal--body");useAriaHidden(it,s&&ot);const st=useModalManager(it,s),lt=reactExports.useRef(null),ct=reactExports.useCallback(yt=>{lt.current=yt.target},[]),ht=reactExports.useCallback(yt=>{yt.key==="Escape"&&(yt.stopPropagation(),et&&(o==null||o()),nt==null||nt())},[et,o,nt]),[ut,pt]=reactExports.useState(!1),[mt,gt]=reactExports.useState(!1),dt=reactExports.useCallback((yt={},_t=null)=>({role:"dialog",...yt,ref:mergeRefs(_t,it),id:_,tabIndex:-1,"aria-modal":!0,"aria-labelledby":ut?$:void 0,"aria-describedby":mt?tt:void 0,onClick:callAllHandlers$1(yt.onClick,Ct=>Ct.stopPropagation())}),[tt,mt,_,$,ut]),St=reactExports.useCallback(yt=>{yt.stopPropagation(),lt.current===yt.target&&modalManager.isTopModal(it.current)&&(rt&&(o==null||o()),at==null||at())},[o,rt,at]),xt=reactExports.useCallback((yt={},_t=null)=>({...yt,ref:mergeRefs(_t,j),onClick:callAllHandlers$1(yt.onClick,St),onKeyDown:callAllHandlers$1(yt.onKeyDown,ht),onMouseDown:callAllHandlers$1(yt.onMouseDown,ct)}),[ht,ct,St]);return{isOpen:s,onClose:o,headerId:$,bodyId:tt,setBodyMounted:gt,setHeaderMounted:pt,dialogRef:it,overlayRef:j,getDialogProps:dt,getDialogContainerProps:xt,index:st}}function useAriaHidden(i,s){const o=i.current;reactExports.useEffect(()=>{if(!(!i.current||!s))return hideOthers(i.current)},[s,i,o])}function useIds(i,...s){const o=reactExports.useId(),a=i||o;return reactExports.useMemo(()=>s.map(rt=>`${rt}-${a}`),[a,s])}var[ModalStylesProvider,useModalStyles]=createContext$2({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[ModalContextProvider,useModalContext]=createContext$2({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),Modal=i=>{const s={scrollBehavior:"outside",autoFocus:!0,trapFocus:!0,returnFocusOnClose:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale",lockFocusAcrossFrames:!0,...i},{portalProps:o,children:a,autoFocus:rt,trapFocus:et,initialFocusRef:ot,finalFocusRef:at,returnFocusOnClose:nt,blockScrollOnMount:it,allowPinchZoom:j,preserveScrollBarGap:_,motionPreset:$,lockFocusAcrossFrames:tt,onCloseComplete:st}=s,lt=useMultiStyleConfig("Modal",s),ht={...useModal(s),autoFocus:rt,trapFocus:et,initialFocusRef:ot,finalFocusRef:at,returnFocusOnClose:nt,blockScrollOnMount:it,allowPinchZoom:j,preserveScrollBarGap:_,motionPreset:$,lockFocusAcrossFrames:tt};return jsxRuntimeExports.jsx(ModalContextProvider,{value:ht,children:jsxRuntimeExports.jsx(ModalStylesProvider,{value:lt,children:jsxRuntimeExports.jsx(AnimatePresence,{onExitComplete:st,children:ht.isOpen&&jsxRuntimeExports.jsx(Portal,{...o,children:a})})})})};Modal.displayName="Modal";var zeroRightClassName="right-scroll-bar-position",fullWidthClassName="width-before-scroll-bar",noScrollbarsClassName="with-scroll-bars-hidden",removedBarSizeVariable="--removed-body-scroll-bar-size",effectCar=createSidecarMedium(),nothing=function(){},RemoveScroll=reactExports.forwardRef(function(i,s){var o=reactExports.useRef(null),a=reactExports.useState({onScrollCapture:nothing,onWheelCapture:nothing,onTouchMoveCapture:nothing}),rt=a[0],et=a[1],ot=i.forwardProps,at=i.children,nt=i.className,it=i.removeScrollBar,j=i.enabled,_=i.shards,$=i.sideCar,tt=i.noIsolation,st=i.inert,lt=i.allowPinchZoom,ct=i.as,ht=ct===void 0?"div":ct,ut=i.gapMode,pt=__rest(i,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),mt=$,gt=useMergeRefs([o,s]),dt=__assign$2(__assign$2({},pt),rt);return reactExports.createElement(reactExports.Fragment,null,j&&reactExports.createElement(mt,{sideCar:effectCar,removeScrollBar:it,shards:_,noIsolation:tt,inert:st,setCallbacks:et,allowPinchZoom:!!lt,lockRef:o,gapMode:ut}),ot?reactExports.cloneElement(reactExports.Children.only(at),__assign$2(__assign$2({},dt),{ref:gt})):reactExports.createElement(ht,__assign$2({},dt,{className:nt,ref:gt}),at))});RemoveScroll.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};RemoveScroll.classNames={fullWidth:fullWidthClassName,zeroRight:zeroRightClassName};var getNonce=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function makeStyleTag(){if(!document)return null;var i=document.createElement("style");i.type="text/css";var s=getNonce();return s&&i.setAttribute("nonce",s),i}function injectStyles(i,s){i.styleSheet?i.styleSheet.cssText=s:i.appendChild(document.createTextNode(s))}function insertStyleTag(i){var s=document.head||document.getElementsByTagName("head")[0];s.appendChild(i)}var stylesheetSingleton=function(){var i=0,s=null;return{add:function(o){i==0&&(s=makeStyleTag())&&(injectStyles(s,o),insertStyleTag(s)),i++},remove:function(){i--,!i&&s&&(s.parentNode&&s.parentNode.removeChild(s),s=null)}}},styleHookSingleton=function(){var i=stylesheetSingleton();return function(s,o){reactExports.useEffect(function(){return i.add(s),function(){i.remove()}},[s&&o])}},styleSingleton=function(){var i=styleHookSingleton(),s=function(o){var a=o.styles,rt=o.dynamic;return i(a,rt),null};return s},zeroGap={left:0,top:0,right:0,gap:0},parse$1=function(i){return parseInt(i||"",10)||0},getOffset=function(i){var s=window.getComputedStyle(document.body),o=s[i==="padding"?"paddingLeft":"marginLeft"],a=s[i==="padding"?"paddingTop":"marginTop"],rt=s[i==="padding"?"paddingRight":"marginRight"];return[parse$1(o),parse$1(a),parse$1(rt)]},getGapWidth=function(i){if(i===void 0&&(i="margin"),typeof window>"u")return zeroGap;var s=getOffset(i),o=document.documentElement.clientWidth,a=window.innerWidth;return{left:s[0],top:s[1],right:s[2],gap:Math.max(0,a-o+s[2]-s[0])}},Style=styleSingleton(),getStyles=function(i,s,o,a){var rt=i.left,et=i.top,ot=i.right,at=i.gap;return o===void 0&&(o="margin"),` + `),()=>{document.head.removeChild(j)}},[s]),jsxRuntimeExports.jsx(PopChildMeasure,{isPresent:s,childRef:a,sizeRef:rt,children:reactExports.cloneElement(i,{ref:a})})}const PresenceChild=({children:i,initial:s,isPresent:o,onExitComplete:a,custom:rt,presenceAffectsLayout:tt,mode:ot})=>{const at=useConstant(newChildrenMap),nt=reactExports.useId(),it=reactExports.useMemo(()=>({id:nt,initial:s,isPresent:o,custom:rt,onExitComplete:j=>{at.set(j,!0);for(const _ of at.values())if(!_)return;a&&a()},register:j=>(at.set(j,!1),()=>at.delete(j))}),tt?[Math.random()]:[o]);return reactExports.useMemo(()=>{at.forEach((j,_)=>at.set(_,!1))},[o]),reactExports.useEffect(()=>{!o&&!at.size&&a&&a()},[o]),ot==="popLayout"&&(i=jsxRuntimeExports.jsx(PopChild,{isPresent:o,children:i})),jsxRuntimeExports.jsx(PresenceContext.Provider,{value:it,children:i})};function newChildrenMap(){return new Map}const getChildKey=i=>i.key||"";function onlyElements(i){const s=[];return reactExports.Children.forEach(i,o=>{reactExports.isValidElement(o)&&s.push(o)}),s}const AnimatePresence=({children:i,exitBeforeEnter:s,custom:o,initial:a=!0,onExitComplete:rt,presenceAffectsLayout:tt=!0,mode:ot="sync"})=>{const at=reactExports.useMemo(()=>onlyElements(i),[i]),nt=at.map(getChildKey),it=reactExports.useRef(!0),j=reactExports.useRef(at),_=useConstant(()=>new Map),[$,et]=reactExports.useState(at),[st,lt]=reactExports.useState(at);useIsomorphicLayoutEffect$1(()=>{it.current=!1,j.current=at;for(let ut=0;ut{const pt=getChildKey(ut),mt=at===st||nt.includes(pt),gt=()=>{if(_.has(pt))_.set(pt,!0);else return;let dt=!0;_.forEach(St=>{St||(dt=!1)}),dt&&(ht==null||ht(),lt(j.current),rt&&rt())};return jsxRuntimeExports.jsx(PresenceChild,{isPresent:mt,initial:!it.current||a?void 0:!1,custom:mt?void 0:o,presenceAffectsLayout:tt,mode:ot,onExitComplete:mt?void 0:gt,children:ut},pt)})})};var toastMotionVariants={initial:i=>{const{position:s}=i,o=["top","bottom"].includes(s)?"y":"x";let a=["top-right","bottom-right"].includes(s)?1:-1;return s==="bottom"&&(a=1),{opacity:0,[o]:a*24}},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},ToastComponent=reactExports.memo(i=>{const{id:s,message:o,onCloseComplete:a,onRequestRemove:rt,requestClose:tt=!1,position:ot="bottom",duration:at=5e3,containerStyle:nt,motionVariants:it=toastMotionVariants,toastSpacing:j="0.5rem"}=i,[_,$]=reactExports.useState(at),et=useIsPresent();useUpdateEffect(()=>{et||a==null||a()},[et]),useUpdateEffect(()=>{$(at)},[at]);const st=()=>$(null),lt=()=>$(at),ct=()=>{et&&rt()};reactExports.useEffect(()=>{et&&tt&&rt()},[et,tt,rt]),useTimeout(ct,_);const ht=reactExports.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:j,...nt}),[nt,j]),ut=reactExports.useMemo(()=>getToastStyle(ot),[ot]);return jsxRuntimeExports.jsx(motion.div,{layout:!0,className:"chakra-toast",variants:it,initial:"initial",animate:"animate",exit:"exit",onHoverStart:st,onHoverEnd:lt,custom:{position:ot},style:ut,children:jsxRuntimeExports.jsx(chakra.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:ht,children:runIfFn$2(o,{id:s,onClose:ct})})})});ToastComponent.displayName="ToastComponent";var fallbackIcon={path:jsxRuntimeExports.jsxs("g",{stroke:"currentColor",strokeWidth:"1.5",children:[jsxRuntimeExports.jsx("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),jsxRuntimeExports.jsx("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]}),viewBox:"0 0 24 24"},Icon=forwardRef((i,s)=>{const{as:o,viewBox:a,color:rt="currentColor",focusable:tt=!1,children:ot,className:at,__css:nt,...it}=i,j=cx("chakra-icon",at),_=useStyleConfig("Icon",i),$={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:rt,...nt,..._},et={ref:s,focusable:tt,className:j,__css:$},st=a??fallbackIcon.viewBox;if(o&&typeof o!="string")return jsxRuntimeExports.jsx(chakra.svg,{as:o,...et,...it});const lt=ot??fallbackIcon.path;return jsxRuntimeExports.jsx(chakra.svg,{verticalAlign:"middle",viewBox:st,...et,...it,children:lt})});Icon.displayName="Icon";function createIcon(i){const{viewBox:s="0 0 24 24",d:o,displayName:a,defaultProps:rt={}}=i,tt=reactExports.Children.toArray(i.path),ot=forwardRef((at,nt)=>jsxRuntimeExports.jsx(Icon,{ref:nt,viewBox:s,...rt,...at,children:tt.length?tt:jsxRuntimeExports.jsx("path",{fill:"currentColor",d:o})}));return ot.displayName=a,ot}function CheckIcon$1(i){return jsxRuntimeExports.jsx(Icon,{viewBox:"0 0 24 24",...i,children:jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"})})}function InfoIcon(i){return jsxRuntimeExports.jsx(Icon,{viewBox:"0 0 24 24",...i,children:jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"})})}function WarningIcon(i){return jsxRuntimeExports.jsx(Icon,{viewBox:"0 0 24 24",...i,children:jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})})}var spin=keyframes$1({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),Spinner=forwardRef((i,s)=>{const o=useStyleConfig("Spinner",i),{label:a="Loading...",thickness:rt="2px",speed:tt="0.45s",emptyColor:ot="transparent",className:at,...nt}=omitThemingProps(i),it=cx("chakra-spinner",at),j={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:rt,borderBottomColor:ot,borderLeftColor:ot,animation:`${spin} ${tt} linear infinite`,...o};return jsxRuntimeExports.jsx(chakra.div,{ref:s,__css:j,className:it,...nt,children:a&&jsxRuntimeExports.jsx(chakra.span,{srOnly:!0,children:a})})});Spinner.displayName="Spinner";var[AlertProvider,useAlertContext]=createContext$2({name:"AlertContext",hookName:"useAlertContext",providerName:""}),[AlertStylesProvider,useAlertStyles]=createContext$2({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),STATUSES={info:{icon:InfoIcon,colorScheme:"blue"},warning:{icon:WarningIcon,colorScheme:"orange"},success:{icon:CheckIcon$1,colorScheme:"green"},error:{icon:WarningIcon,colorScheme:"red"},loading:{icon:Spinner,colorScheme:"blue"}};function getStatusColorScheme(i){return STATUSES[i].colorScheme}function getStatusIcon(i){return STATUSES[i].icon}var AlertDescription=forwardRef(function(s,o){const a=useAlertStyles(),{status:rt}=useAlertContext(),tt={display:"inline",...a.description};return jsxRuntimeExports.jsx(chakra.div,{ref:o,"data-status":rt,...s,className:cx("chakra-alert__desc",s.className),__css:tt})});AlertDescription.displayName="AlertDescription";function AlertIcon(i){const{status:s}=useAlertContext(),o=getStatusIcon(s),a=useAlertStyles(),rt=s==="loading"?a.spinner:a.icon;return jsxRuntimeExports.jsx(chakra.span,{display:"inherit","data-status":s,...i,className:cx("chakra-alert__icon",i.className),__css:rt,children:i.children||jsxRuntimeExports.jsx(o,{h:"100%",w:"100%"})})}AlertIcon.displayName="AlertIcon";var AlertTitle=forwardRef(function(s,o){const a=useAlertStyles(),{status:rt}=useAlertContext();return jsxRuntimeExports.jsx(chakra.div,{ref:o,"data-status":rt,...s,className:cx("chakra-alert__title",s.className),__css:a.title})});AlertTitle.displayName="AlertTitle";var Alert=forwardRef(function(s,o){var a;const{status:rt="info",addRole:tt=!0,...ot}=omitThemingProps(s),at=(a=s.colorScheme)!=null?a:getStatusColorScheme(rt),nt=useMultiStyleConfig("Alert",{...s,colorScheme:at}),it={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...nt.container};return jsxRuntimeExports.jsx(AlertProvider,{value:{status:rt},children:jsxRuntimeExports.jsx(AlertStylesProvider,{value:nt,children:jsxRuntimeExports.jsx(chakra.div,{"data-status":rt,role:tt?"alert":void 0,ref:o,...ot,className:cx("chakra-alert",s.className),__css:it})})})});Alert.displayName="Alert";function CloseIcon(i){return jsxRuntimeExports.jsx(Icon,{focusable:"false","aria-hidden":!0,...i,children:jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"})})}var CloseButton=forwardRef(function(s,o){const a=useStyleConfig("CloseButton",s),{children:rt,isDisabled:tt,__css:ot,...at}=omitThemingProps(s),nt={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return jsxRuntimeExports.jsx(chakra.button,{type:"button","aria-label":"Close",ref:o,disabled:tt,__css:{...nt,...a,...ot},...at,children:rt||jsxRuntimeExports.jsx(CloseIcon,{width:"1em",height:"1em"})})});CloseButton.displayName="CloseButton";var initialState$1={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},toastStore=createStore$1(initialState$1);function createStore$1(i){let s=i;const o=new Set,a=rt=>{s=rt(s),o.forEach(tt=>tt())};return{getState:()=>s,subscribe:rt=>(o.add(rt),()=>{a(()=>i),o.delete(rt)}),removeToast:(rt,tt)=>{a(ot=>({...ot,[tt]:ot[tt].filter(at=>at.id!=rt)}))},notify:(rt,tt)=>{const ot=createToast(rt,tt),{position:at,id:nt}=ot;return a(it=>{var j,_;const et=at.includes("top")?[ot,...(j=it[at])!=null?j:[]]:[...(_=it[at])!=null?_:[],ot];return{...it,[at]:et}}),nt},update:(rt,tt)=>{rt&&a(ot=>{const at={...ot},{position:nt,index:it}=findToast(at,rt);return nt&&it!==-1&&(at[nt][it]={...at[nt][it],...tt,message:createRenderToast(tt)}),at})},closeAll:({positions:rt}={})=>{a(tt=>(rt??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((nt,it)=>(nt[it]=tt[it].map(j=>({...j,requestClose:!0})),nt),{...tt}))},close:rt=>{a(tt=>{const ot=getToastPosition(tt,rt);return ot?{...tt,[ot]:tt[ot].map(at=>at.id==rt?{...at,requestClose:!0}:at)}:tt})},isActive:rt=>!!findToast(toastStore.getState(),rt).position}}var counter=0;function createToast(i,s={}){var o,a;counter+=1;const rt=(o=s.id)!=null?o:counter,tt=(a=s.position)!=null?a:"bottom";return{id:rt,message:i,position:tt,duration:s.duration,onCloseComplete:s.onCloseComplete,onRequestRemove:()=>toastStore.removeToast(String(rt),tt),status:s.status,requestClose:!1,containerStyle:s.containerStyle}}var Toast=i=>{const{status:s,variant:o="solid",id:a,title:rt,isClosable:tt,onClose:ot,description:at,colorScheme:nt,icon:it}=i,j=a?{root:`toast-${a}`,title:`toast-${a}-title`,description:`toast-${a}-description`}:void 0;return jsxRuntimeExports.jsxs(Alert,{addRole:!1,status:s,variant:o,id:j==null?void 0:j.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto",colorScheme:nt,children:[jsxRuntimeExports.jsx(AlertIcon,{children:it}),jsxRuntimeExports.jsxs(chakra.div,{flex:"1",maxWidth:"100%",children:[rt&&jsxRuntimeExports.jsx(AlertTitle,{id:j==null?void 0:j.title,children:rt}),at&&jsxRuntimeExports.jsx(AlertDescription,{id:j==null?void 0:j.description,display:"block",children:at})]}),tt&&jsxRuntimeExports.jsx(CloseButton,{size:"sm",onClick:ot,position:"absolute",insetEnd:1,top:1})]})};function createRenderToast(i={}){const{render:s,toastComponent:o=Toast}=i;return rt=>typeof s=="function"?s({...rt,...i}):jsxRuntimeExports.jsx(o,{...rt,...i})}var[ToastOptionProvider,useToastOptionContext]=createContext$2({name:"ToastOptionsContext",strict:!1}),ToastProvider=i=>{const s=reactExports.useSyncExternalStore(toastStore.subscribe,toastStore.getState,toastStore.getState),{motionVariants:o,component:a=ToastComponent,portalProps:rt}=i,ot=Object.keys(s).map(at=>{const nt=s[at];return jsxRuntimeExports.jsx("div",{role:"region","aria-live":"polite","aria-label":`Notifications-${at}`,id:`chakra-toast-manager-${at}`,style:getToastListStyle(at),children:jsxRuntimeExports.jsx(AnimatePresence,{initial:!1,children:nt.map(it=>jsxRuntimeExports.jsx(a,{motionVariants:o,...it},it.id))})},at)});return jsxRuntimeExports.jsx(Portal,{...rt,children:ot})},createChakraProvider=i=>function({children:o,theme:a=i,toastOptions:rt,...tt}){return jsxRuntimeExports.jsxs(ChakraProvider$1,{theme:a,...tt,children:[jsxRuntimeExports.jsx(ToastOptionProvider,{value:rt==null?void 0:rt.defaultOptions,children:o}),jsxRuntimeExports.jsx(ToastProvider,{...rt})]})},ChakraProvider=createChakraProvider(theme$1);function assignRef$1(i,s){if(i!=null){if(typeof i=="function"){i(s);return}try{i.current=s}catch{throw new Error(`Cannot assign value '${s}' to ref '${i}'`)}}}function mergeRefs(...i){return s=>{i.forEach(o=>{assignRef$1(o,s)})}}function useMergeRefs$1(...i){return reactExports.useMemo(()=>mergeRefs(...i),i)}var TRANSITION_EASINGS={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},TRANSITION_DEFAULTS={enter:{duration:.2,ease:TRANSITION_EASINGS.easeOut},exit:{duration:.1,ease:TRANSITION_EASINGS.easeIn}},withDelay={enter:(i,s)=>({...i,delay:typeof s=="number"?s:s==null?void 0:s.enter}),exit:(i,s)=>({...i,delay:typeof s=="number"?s:s==null?void 0:s.exit})},variants$2={enter:({transition:i,transitionEnd:s,delay:o}={})=>{var a;return{opacity:1,transition:(a=i==null?void 0:i.enter)!=null?a:withDelay.enter(TRANSITION_DEFAULTS.enter,o),transitionEnd:s==null?void 0:s.enter}},exit:({transition:i,transitionEnd:s,delay:o}={})=>{var a;return{opacity:0,transition:(a=i==null?void 0:i.exit)!=null?a:withDelay.exit(TRANSITION_DEFAULTS.exit,o),transitionEnd:s==null?void 0:s.exit}}},fadeConfig={initial:"exit",animate:"enter",exit:"exit",variants:variants$2},Fade=reactExports.forwardRef(function(s,o){const{unmountOnExit:a,in:rt,className:tt,transition:ot,transitionEnd:at,delay:nt,...it}=s,j=rt||a?"enter":"exit",_=a?rt&&a:!0,$={transition:ot,transitionEnd:at,delay:nt};return jsxRuntimeExports.jsx(AnimatePresence,{custom:$,children:_&&jsxRuntimeExports.jsx(motion.div,{ref:o,className:cx("chakra-fade",tt),custom:$,...fadeConfig,animate:j,...it})})});Fade.displayName="Fade";var variants$1={exit:({reverse:i,initialScale:s,transition:o,transitionEnd:a,delay:rt})=>{var tt;return{opacity:0,...i?{scale:s,transitionEnd:a==null?void 0:a.exit}:{transitionEnd:{scale:s,...a==null?void 0:a.exit}},transition:(tt=o==null?void 0:o.exit)!=null?tt:withDelay.exit(TRANSITION_DEFAULTS.exit,rt)}},enter:({transitionEnd:i,transition:s,delay:o})=>{var a;return{opacity:1,scale:1,transition:(a=s==null?void 0:s.enter)!=null?a:withDelay.enter(TRANSITION_DEFAULTS.enter,o),transitionEnd:i==null?void 0:i.enter}}},scaleFadeConfig={initial:"exit",animate:"enter",exit:"exit",variants:variants$1},ScaleFade=reactExports.forwardRef(function(s,o){const{unmountOnExit:a,in:rt,reverse:tt=!0,initialScale:ot=.95,className:at,transition:nt,transitionEnd:it,delay:j,..._}=s,$=a?rt&&a:!0,et=rt||a?"enter":"exit",st={initialScale:ot,reverse:tt,transition:nt,transitionEnd:it,delay:j};return jsxRuntimeExports.jsx(AnimatePresence,{custom:st,children:$&&jsxRuntimeExports.jsx(motion.div,{ref:o,className:cx("chakra-offset-slide",at),...scaleFadeConfig,animate:et,custom:st,..._})})});ScaleFade.displayName="ScaleFade";var variants={initial:({offsetX:i,offsetY:s,transition:o,transitionEnd:a,delay:rt})=>{var tt;return{opacity:0,x:i,y:s,transition:(tt=o==null?void 0:o.exit)!=null?tt:withDelay.exit(TRANSITION_DEFAULTS.exit,rt),transitionEnd:a==null?void 0:a.exit}},enter:({transition:i,transitionEnd:s,delay:o})=>{var a;return{opacity:1,x:0,y:0,transition:(a=i==null?void 0:i.enter)!=null?a:withDelay.enter(TRANSITION_DEFAULTS.enter,o),transitionEnd:s==null?void 0:s.enter}},exit:({offsetY:i,offsetX:s,transition:o,transitionEnd:a,reverse:rt,delay:tt})=>{var ot;const at={x:s,y:i};return{opacity:0,transition:(ot=o==null?void 0:o.exit)!=null?ot:withDelay.exit(TRANSITION_DEFAULTS.exit,tt),...rt?{...at,transitionEnd:a==null?void 0:a.exit}:{transitionEnd:{...at,...a==null?void 0:a.exit}}}}},slideFadeConfig={initial:"initial",animate:"enter",exit:"exit",variants},SlideFade=reactExports.forwardRef(function(s,o){const{unmountOnExit:a,in:rt,reverse:tt=!0,className:ot,offsetX:at=0,offsetY:nt=8,transition:it,transitionEnd:j,delay:_,...$}=s,et=a?rt&&a:!0,st=rt||a?"enter":"exit",lt={offsetX:at,offsetY:nt,reverse:tt,transition:it,transitionEnd:j,delay:_};return jsxRuntimeExports.jsx(AnimatePresence,{custom:lt,children:et&&jsxRuntimeExports.jsx(motion.div,{ref:o,className:cx("chakra-offset-slide",ot),custom:lt,...slideFadeConfig,animate:st,...$})})});SlideFade.displayName="SlideFade";function getValidChildren(i){return reactExports.Children.toArray(i).filter(s=>reactExports.isValidElement(s))}var[ButtonGroupProvider,useButtonGroup]=createContext$2({strict:!1,name:"ButtonGroupContext"}),attachedStyles={horizontal:{"> *:first-of-type:not(:last-of-type)":{borderEndRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderStartRadius:0}},vertical:{"> *:first-of-type:not(:last-of-type)":{borderBottomRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderTopRadius:0}}},gapStyles={horizontal:i=>({"& > *:not(style) ~ *:not(style)":{marginStart:i}}),vertical:i=>({"& > *:not(style) ~ *:not(style)":{marginTop:i}})},ButtonGroup=forwardRef(function(s,o){const{size:a,colorScheme:rt,variant:tt,className:ot,spacing:at="0.5rem",isAttached:nt,isDisabled:it,orientation:j="horizontal",..._}=s,$=cx("chakra-button__group",ot),et=reactExports.useMemo(()=>({size:a,colorScheme:rt,variant:tt,isDisabled:it}),[a,rt,tt,it]);let st={display:"inline-flex",...nt?attachedStyles[j]:gapStyles[j](at)};const lt=j==="vertical";return jsxRuntimeExports.jsx(ButtonGroupProvider,{value:et,children:jsxRuntimeExports.jsx(chakra.div,{ref:o,role:"group",__css:st,className:$,"data-attached":nt?"":void 0,"data-orientation":j,flexDir:lt?"column":void 0,..._})})});ButtonGroup.displayName="ButtonGroup";function useButtonType(i){const[s,o]=reactExports.useState(!i);return{ref:reactExports.useCallback(tt=>{tt&&o(tt.tagName==="BUTTON")},[]),type:s?"button":void 0}}function ButtonIcon(i){const{children:s,className:o,...a}=i,rt=reactExports.isValidElement(s)?reactExports.cloneElement(s,{"aria-hidden":!0,focusable:!1}):s,tt=cx("chakra-button__icon",o);return jsxRuntimeExports.jsx(chakra.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...a,className:tt,children:rt})}ButtonIcon.displayName="ButtonIcon";function ButtonSpinner(i){const{label:s,placement:o,spacing:a="0.5rem",children:rt=jsxRuntimeExports.jsx(Spinner,{color:"currentColor",width:"1em",height:"1em"}),className:tt,__css:ot,...at}=i,nt=cx("chakra-button__spinner",tt),it=o==="start"?"marginEnd":"marginStart",j=reactExports.useMemo(()=>({display:"flex",alignItems:"center",position:s?"relative":"absolute",[it]:s?a:0,fontSize:"1em",lineHeight:"normal",...ot}),[ot,s,it,a]);return jsxRuntimeExports.jsx(chakra.div,{className:nt,...at,__css:j,children:rt})}ButtonSpinner.displayName="ButtonSpinner";var Button=forwardRef((i,s)=>{const o=useButtonGroup(),a=useStyleConfig("Button",{...o,...i}),{isDisabled:rt=o==null?void 0:o.isDisabled,isLoading:tt,isActive:ot,children:at,leftIcon:nt,rightIcon:it,loadingText:j,iconSpacing:_="0.5rem",type:$,spinner:et,spinnerPlacement:st="start",className:lt,as:ct,...ht}=omitThemingProps(i),ut=reactExports.useMemo(()=>{const dt={...a==null?void 0:a._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...a,...!!o&&{_focus:dt}}},[a,o]),{ref:pt,type:mt}=useButtonType(ct),gt={rightIcon:it,leftIcon:nt,iconSpacing:_,children:at};return jsxRuntimeExports.jsxs(chakra.button,{ref:useMergeRefs$1(s,pt),as:ct,type:$??mt,"data-active":dataAttr(ot),"data-loading":dataAttr(tt),__css:ut,className:cx("chakra-button",lt),...ht,disabled:rt||tt,children:[tt&&st==="start"&&jsxRuntimeExports.jsx(ButtonSpinner,{className:"chakra-button__spinner--start",label:j,placement:"start",spacing:_,children:et}),tt?j||jsxRuntimeExports.jsx(chakra.span,{opacity:0,children:jsxRuntimeExports.jsx(ButtonContent,{...gt})}):jsxRuntimeExports.jsx(ButtonContent,{...gt}),tt&&st==="end"&&jsxRuntimeExports.jsx(ButtonSpinner,{className:"chakra-button__spinner--end",label:j,placement:"end",spacing:_,children:et})]})});Button.displayName="Button";function ButtonContent(i){const{leftIcon:s,rightIcon:o,children:a,iconSpacing:rt}=i;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[s&&jsxRuntimeExports.jsx(ButtonIcon,{marginEnd:rt,children:s}),a,o&&jsxRuntimeExports.jsx(ButtonIcon,{marginStart:rt,children:o})]})}var[CardStylesProvider,useCardStyles]=createStylesContext("Card"),CardBody=forwardRef(function(s,o){const{className:a,...rt}=s,tt=useCardStyles();return jsxRuntimeExports.jsx(chakra.div,{ref:o,className:cx("chakra-card__body",a),__css:tt.body,...rt})}),CardHeader=forwardRef(function(s,o){const{className:a,...rt}=s,tt=useCardStyles();return jsxRuntimeExports.jsx(chakra.div,{ref:o,className:cx("chakra-card__header",a),__css:tt.header,...rt})}),Card=forwardRef(function(s,o){const{className:a,children:rt,direction:tt="column",justify:ot,align:at,...nt}=omitThemingProps(s),it=useMultiStyleConfig("Card",s);return jsxRuntimeExports.jsx(chakra.div,{ref:o,className:cx("chakra-card",a),__css:{display:"flex",flexDirection:tt,justifyContent:ot,alignItems:at,position:"relative",minWidth:0,wordWrap:"break-word",...it.container},...nt,children:jsxRuntimeExports.jsx(CardStylesProvider,{value:it,children:rt})})}),[CheckboxGroupProvider,useCheckboxGroupContext]=createContext$2({name:"CheckboxGroupContext",strict:!1});function useInitialAnimationState(i){const[s,o]=reactExports.useState(i),[a,rt]=reactExports.useState(!1);return i!==s&&(rt(!0),o(i)),a}function CheckIcon(i){return jsxRuntimeExports.jsx(chakra.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...i,children:jsxRuntimeExports.jsx("polyline",{points:"1.5 6 4.5 9 10.5 1"})})}function IndeterminateIcon(i){return jsxRuntimeExports.jsx(chakra.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...i,children:jsxRuntimeExports.jsx("line",{x1:"21",x2:"3",y1:"12",y2:"12"})})}function CheckboxIcon(i){const{isIndeterminate:s,isChecked:o,...a}=i,rt=s?IndeterminateIcon:CheckIcon;return o||s?jsxRuntimeExports.jsx(chakra.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:jsxRuntimeExports.jsx(rt,{...a})}):null}var[FormControlStylesProvider,useFormControlStyles]=createContext$2({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[FormControlProvider,useFormControlContext]=createContext$2({strict:!1,name:"FormControlContext"});function useFormControlProvider(i){const{id:s,isRequired:o,isInvalid:a,isDisabled:rt,isReadOnly:tt,...ot}=i,at=reactExports.useId(),nt=s||`field-${at}`,it=`${nt}-label`,j=`${nt}-feedback`,_=`${nt}-helptext`,[$,et]=reactExports.useState(!1),[st,lt]=reactExports.useState(!1),[ct,ht]=reactExports.useState(!1),ut=reactExports.useCallback((St={},xt=null)=>({id:_,...St,ref:mergeRefs(xt,yt=>{yt&<(!0)})}),[_]),pt=reactExports.useCallback((St={},xt=null)=>({...St,ref:xt,"data-focus":dataAttr(ct),"data-disabled":dataAttr(rt),"data-invalid":dataAttr(a),"data-readonly":dataAttr(tt),id:St.id!==void 0?St.id:it,htmlFor:St.htmlFor!==void 0?St.htmlFor:nt}),[nt,rt,ct,a,tt,it]),mt=reactExports.useCallback((St={},xt=null)=>({id:j,...St,ref:mergeRefs(xt,yt=>{yt&&et(!0)}),"aria-live":"polite"}),[j]),gt=reactExports.useCallback((St={},xt=null)=>({...St,...ot,ref:xt,role:"group","data-focus":dataAttr(ct),"data-disabled":dataAttr(rt),"data-invalid":dataAttr(a),"data-readonly":dataAttr(tt)}),[ot,rt,ct,a,tt]),dt=reactExports.useCallback((St={},xt=null)=>({...St,ref:xt,role:"presentation","aria-hidden":!0,children:St.children||"*"}),[]);return{isRequired:!!o,isInvalid:!!a,isReadOnly:!!tt,isDisabled:!!rt,isFocused:!!ct,onFocus:()=>ht(!0),onBlur:()=>ht(!1),hasFeedbackText:$,setHasFeedbackText:et,hasHelpText:st,setHasHelpText:lt,id:nt,labelId:it,feedbackId:j,helpTextId:_,htmlProps:ot,getHelpTextProps:ut,getErrorMessageProps:mt,getRootProps:gt,getLabelProps:pt,getRequiredIndicatorProps:dt}}var FormControl=forwardRef(function(s,o){const a=useMultiStyleConfig("Form",s),rt=omitThemingProps(s),{getRootProps:tt,htmlProps:ot,...at}=useFormControlProvider(rt),nt=cx("chakra-form-control",s.className);return jsxRuntimeExports.jsx(FormControlProvider,{value:at,children:jsxRuntimeExports.jsx(FormControlStylesProvider,{value:a,children:jsxRuntimeExports.jsx(chakra.div,{...tt({},o),className:nt,__css:a.container})})})});FormControl.displayName="FormControl";var FormHelperText=forwardRef(function(s,o){const a=useFormControlContext(),rt=useFormControlStyles(),tt=cx("chakra-form__helper-text",s.className);return jsxRuntimeExports.jsx(chakra.div,{...a==null?void 0:a.getHelpTextProps(s,o),__css:rt.helperText,className:tt})});FormHelperText.displayName="FormHelperText";function useFormControl(i){const{isDisabled:s,isInvalid:o,isReadOnly:a,isRequired:rt,...tt}=useFormControlProps(i);return{...tt,disabled:s,readOnly:a,required:rt,"aria-invalid":ariaAttr(o),"aria-required":ariaAttr(rt),"aria-readonly":ariaAttr(a)}}function useFormControlProps(i){var s,o,a;const rt=useFormControlContext(),{id:tt,disabled:ot,readOnly:at,required:nt,isRequired:it,isInvalid:j,isReadOnly:_,isDisabled:$,onFocus:et,onBlur:st,...lt}=i,ct=i["aria-describedby"]?[i["aria-describedby"]]:[];return rt!=null&&rt.hasFeedbackText&&(rt!=null&&rt.isInvalid)&&ct.push(rt.feedbackId),rt!=null&&rt.hasHelpText&&ct.push(rt.helpTextId),{...lt,"aria-describedby":ct.join(" ")||void 0,id:tt??(rt==null?void 0:rt.id),isDisabled:(s=ot??$)!=null?s:rt==null?void 0:rt.isDisabled,isReadOnly:(o=at??_)!=null?o:rt==null?void 0:rt.isReadOnly,isRequired:(a=nt??it)!=null?a:rt==null?void 0:rt.isRequired,isInvalid:j??(rt==null?void 0:rt.isInvalid),onFocus:callAllHandlers$1(rt==null?void 0:rt.onFocus,et),onBlur:callAllHandlers$1(rt==null?void 0:rt.onBlur,st)}}var visuallyHiddenStyle={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},isDom=()=>typeof document<"u",hasSetup=!1,modality=null,hasEventBeforeFocus=!1,hasBlurredWindowRecently=!1,handlers=new Set;function trigger(i,s){handlers.forEach(o=>o(i,s))}var isMac=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function isValidKey(i){return!(i.metaKey||!isMac&&i.altKey||i.ctrlKey||i.key==="Control"||i.key==="Shift"||i.key==="Meta")}function onKeyboardEvent(i){hasEventBeforeFocus=!0,isValidKey(i)&&(modality="keyboard",trigger("keyboard",i))}function onPointerEvent(i){if(modality="pointer",i.type==="mousedown"||i.type==="pointerdown"){hasEventBeforeFocus=!0;const s=i.composedPath?i.composedPath()[0]:i.target;let o=!1;try{o=s.matches(":focus-visible")}catch{}if(o)return;trigger("pointer",i)}}function isVirtualClick(i){return i.mozInputSource===0&&i.isTrusted?!0:i.detail===0&&!i.pointerType}function onClickEvent(i){isVirtualClick(i)&&(hasEventBeforeFocus=!0,modality="virtual")}function onWindowFocus(i){i.target===window||i.target===document||(!hasEventBeforeFocus&&!hasBlurredWindowRecently&&(modality="virtual",trigger("virtual",i)),hasEventBeforeFocus=!1,hasBlurredWindowRecently=!1)}function onWindowBlur$1(){hasEventBeforeFocus=!1,hasBlurredWindowRecently=!0}function isFocusVisible(){return modality!=="pointer"}function setupGlobalFocusEvents(){if(!isDom()||hasSetup)return;const{focus:i}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...o){hasEventBeforeFocus=!0,i.apply(this,o)},document.addEventListener("keydown",onKeyboardEvent,!0),document.addEventListener("keyup",onKeyboardEvent,!0),document.addEventListener("click",onClickEvent,!0),window.addEventListener("focus",onWindowFocus,!0),window.addEventListener("blur",onWindowBlur$1,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",onPointerEvent,!0),document.addEventListener("pointermove",onPointerEvent,!0),document.addEventListener("pointerup",onPointerEvent,!0)):(document.addEventListener("mousedown",onPointerEvent,!0),document.addEventListener("mousemove",onPointerEvent,!0),document.addEventListener("mouseup",onPointerEvent,!0)),hasSetup=!0}function trackFocusVisible(i){setupGlobalFocusEvents(),i(isFocusVisible());const s=()=>i(isFocusVisible());return handlers.add(s),()=>{handlers.delete(s)}}function omit(i,s=[]){const o=Object.assign({},i);for(const a of s)a in o&&delete o[a];return o}function useCheckbox(i={}){const s=useFormControlProps(i),{isDisabled:o,isReadOnly:a,isRequired:rt,isInvalid:tt,id:ot,onBlur:at,onFocus:nt,"aria-describedby":it}=s,{defaultChecked:j,isChecked:_,isFocusable:$,onChange:et,isIndeterminate:st,name:lt,value:ct,tabIndex:ht=void 0,"aria-label":ut,"aria-labelledby":pt,"aria-invalid":mt,...gt}=i,dt=omit(gt,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),St=useCallbackRef$2(et),xt=useCallbackRef$2(at),yt=useCallbackRef$2(nt),[_t,Ct]=reactExports.useState(!1),[Et,kt]=reactExports.useState(!1),[Tt,$t]=reactExports.useState(!1),[It,Ot]=reactExports.useState(!1);reactExports.useEffect(()=>trackFocusVisible(Ct),[]);const Mt=reactExports.useRef(null),[Dt,Bt]=reactExports.useState(!0),[Kt,Wt]=reactExports.useState(!!j),zt=_!==void 0,Ht=zt?_:Kt,Zt=reactExports.useCallback(Sr=>{if(a||o){Sr.preventDefault();return}zt||Wt(Ht?Sr.target.checked:st?!0:Sr.target.checked),St==null||St(Sr)},[a,o,Ht,zt,st,St]);useSafeLayoutEffect$1(()=>{Mt.current&&(Mt.current.indeterminate=!!st)},[st]),useUpdateEffect(()=>{o&&kt(!1)},[o,kt]),useSafeLayoutEffect$1(()=>{const Sr=Mt.current;if(!(Sr!=null&&Sr.form))return;const dr=()=>{Wt(!!j)};return Sr.form.addEventListener("reset",dr),()=>{var Ur;return(Ur=Sr.form)==null?void 0:Ur.removeEventListener("reset",dr)}},[]);const qt=o&&!$,hr=reactExports.useCallback(Sr=>{Sr.key===" "&&Ot(!0)},[Ot]),fr=reactExports.useCallback(Sr=>{Sr.key===" "&&Ot(!1)},[Ot]);useSafeLayoutEffect$1(()=>{if(!Mt.current)return;Mt.current.checked!==Ht&&Wt(Mt.current.checked)},[Mt.current]);const mr=reactExports.useCallback((Sr={},dr=null)=>{const Ur=tn=>{Et&&tn.preventDefault(),Ot(!0)};return{...Sr,ref:dr,"data-active":dataAttr(It),"data-hover":dataAttr(Tt),"data-checked":dataAttr(Ht),"data-focus":dataAttr(Et),"data-focus-visible":dataAttr(Et&&_t),"data-indeterminate":dataAttr(st),"data-disabled":dataAttr(o),"data-invalid":dataAttr(tt),"data-readonly":dataAttr(a),"aria-hidden":!0,onMouseDown:callAllHandlers$1(Sr.onMouseDown,Ur),onMouseUp:callAllHandlers$1(Sr.onMouseUp,()=>Ot(!1)),onMouseEnter:callAllHandlers$1(Sr.onMouseEnter,()=>$t(!0)),onMouseLeave:callAllHandlers$1(Sr.onMouseLeave,()=>$t(!1))}},[It,Ht,o,Et,_t,Tt,st,tt,a]),gr=reactExports.useCallback((Sr={},dr=null)=>({...Sr,ref:dr,"data-active":dataAttr(It),"data-hover":dataAttr(Tt),"data-checked":dataAttr(Ht),"data-focus":dataAttr(Et),"data-focus-visible":dataAttr(Et&&_t),"data-indeterminate":dataAttr(st),"data-disabled":dataAttr(o),"data-invalid":dataAttr(tt),"data-readonly":dataAttr(a)}),[It,Ht,o,Et,_t,Tt,st,tt,a]),tr=reactExports.useCallback((Sr={},dr=null)=>({...dt,...Sr,ref:mergeRefs(dr,Ur=>{Ur&&Bt(Ur.tagName==="LABEL")}),onClick:callAllHandlers$1(Sr.onClick,()=>{var Ur;Dt||((Ur=Mt.current)==null||Ur.click(),requestAnimationFrame(()=>{var tn;(tn=Mt.current)==null||tn.focus({preventScroll:!0})}))}),"data-disabled":dataAttr(o),"data-checked":dataAttr(Ht),"data-invalid":dataAttr(tt)}),[dt,o,Ht,tt,Dt]),rr=reactExports.useCallback((Sr={},dr=null)=>({...Sr,ref:mergeRefs(Mt,dr),type:"checkbox",name:lt,value:ct,id:ot,tabIndex:ht,onChange:callAllHandlers$1(Sr.onChange,Zt),onBlur:callAllHandlers$1(Sr.onBlur,xt,()=>kt(!1)),onFocus:callAllHandlers$1(Sr.onFocus,yt,()=>kt(!0)),onKeyDown:callAllHandlers$1(Sr.onKeyDown,hr),onKeyUp:callAllHandlers$1(Sr.onKeyUp,fr),required:rt,checked:Ht,disabled:qt,readOnly:a,"aria-label":ut,"aria-labelledby":pt,"aria-invalid":mt?!!mt:tt,"aria-describedby":it,"aria-disabled":o,style:visuallyHiddenStyle}),[lt,ct,ot,Zt,xt,yt,hr,fr,rt,Ht,qt,a,ut,pt,mt,tt,it,o,ht]),Qt=reactExports.useCallback((Sr={},dr=null)=>({...Sr,ref:dr,onMouseDown:callAllHandlers$1(Sr.onMouseDown,stopEvent),"data-disabled":dataAttr(o),"data-checked":dataAttr(Ht),"data-invalid":dataAttr(tt)}),[Ht,o,tt]);return{state:{isInvalid:tt,isFocused:Et,isChecked:Ht,isActive:It,isHovered:Tt,isIndeterminate:st,isDisabled:o,isReadOnly:a,isRequired:rt},getRootProps:tr,getCheckboxProps:mr,getIndicatorProps:gr,getInputProps:rr,getLabelProps:Qt,htmlProps:dt}}function stopEvent(i){i.preventDefault(),i.stopPropagation()}var controlStyles={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},rootStyles={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},checkAnim=keyframes$1({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),indeterminateOpacityAnim=keyframes$1({from:{opacity:0},to:{opacity:1}}),indeterminateScaleAnim=keyframes$1({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),Checkbox=forwardRef(function(s,o){const a=useCheckboxGroupContext(),rt={...a,...s},tt=useMultiStyleConfig("Checkbox",rt),ot=omitThemingProps(s),{spacing:at="0.5rem",className:nt,children:it,iconColor:j,iconSize:_,icon:$=jsxRuntimeExports.jsx(CheckboxIcon,{}),isChecked:et,isDisabled:st=a==null?void 0:a.isDisabled,onChange:lt,inputProps:ct,...ht}=ot;let ut=et;a!=null&&a.value&&ot.value&&(ut=a.value.includes(ot.value));let pt=lt;a!=null&&a.onChange&&ot.value&&(pt=callAll(a.onChange,lt));const{state:mt,getInputProps:gt,getCheckboxProps:dt,getLabelProps:St,getRootProps:xt}=useCheckbox({...ht,isDisabled:st,isChecked:ut,onChange:pt}),yt=useInitialAnimationState(mt.isChecked),_t=reactExports.useMemo(()=>({animation:yt?mt.isIndeterminate?`${indeterminateOpacityAnim} 20ms linear, ${indeterminateScaleAnim} 200ms linear`:`${checkAnim} 200ms linear`:void 0,fontSize:_,color:j,...tt.icon}),[j,_,yt,mt.isIndeterminate,tt.icon]),Ct=reactExports.cloneElement($,{__css:_t,isIndeterminate:mt.isIndeterminate,isChecked:mt.isChecked});return jsxRuntimeExports.jsxs(chakra.label,{__css:{...rootStyles,...tt.container},className:cx("chakra-checkbox",nt),...xt(),children:[jsxRuntimeExports.jsx("input",{className:"chakra-checkbox__input",...gt(ct,o)}),jsxRuntimeExports.jsx(chakra.span,{__css:{...controlStyles,...tt.control},className:"chakra-checkbox__control",...dt(),children:Ct}),it&&jsxRuntimeExports.jsx(chakra.span,{className:"chakra-checkbox__label",...St(),__css:{marginStart:at,...tt.label},children:it})]})});Checkbox.displayName="Checkbox";function _objectWithoutPropertiesLoose(i,s){if(i==null)return{};var o={};for(var a in i)if({}.hasOwnProperty.call(i,a)){if(s.includes(a))continue;o[a]=i[a]}return o}var propTypes={exports:{}},ReactPropTypesSecret$1="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ReactPropTypesSecret_1=ReactPropTypesSecret$1,ReactPropTypesSecret=ReactPropTypesSecret_1;function emptyFunction(){}function emptyFunctionWithReset(){}emptyFunctionWithReset.resetWarningCache=emptyFunction;var factoryWithThrowingShims=function(){function i(a,rt,tt,ot,at,nt){if(nt!==ReactPropTypesSecret){var it=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 it.name="Invariant Violation",it}}i.isRequired=i;function s(){return i}var o={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:s,element:i,elementType:i,instanceOf:s,node:i,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};return o.PropTypes=o,o};propTypes.exports=factoryWithThrowingShims();var propTypesExports=propTypes.exports,FOCUS_GROUP="data-focus-lock",FOCUS_DISABLED="data-focus-lock-disabled",FOCUS_ALLOW="data-no-focus-lock",FOCUS_AUTO="data-autofocus-inside",FOCUS_NO_AUTOFOCUS="data-no-autofocus";function assignRef(i,s){return typeof i=="function"?i(s):i&&(i.current=s),i}function useCallbackRef$1(i,s){var o=reactExports.useState(function(){return{value:i,callback:s,facade:{get current(){return o.value},set current(a){var rt=o.value;rt!==a&&(o.value=a,o.callback(a,rt))}}}})[0];return o.callback=s,o.facade}function useMergeRefs(i,s){return useCallbackRef$1(null,function(o){return i.forEach(function(a){return assignRef(a,o)})})}var hiddenGuard={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},__assign$2=function(){return __assign$2=Object.assign||function(s){for(var o,a=1,rt=arguments.length;a=0}).sort(tabSort)},tabbables=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],queryTabbables=tabbables.join(","),queryGuardTabbables="".concat(queryTabbables,", [data-focus-guard]"),getFocusablesWithShadowDom=function(i,s){return toArray((i.shadowRoot||i).children).reduce(function(o,a){return o.concat(a.matches(s?queryGuardTabbables:queryTabbables)?[a]:[],getFocusablesWithShadowDom(a))},[])},getFocusablesWithIFrame=function(i,s){var o;return i instanceof HTMLIFrameElement&&(!((o=i.contentDocument)===null||o===void 0)&&o.body)?getFocusables([i.contentDocument.body],s):[i]},getFocusables=function(i,s){return i.reduce(function(o,a){var rt,tt=getFocusablesWithShadowDom(a,s),ot=(rt=[]).concat.apply(rt,tt.map(function(at){return getFocusablesWithIFrame(at,s)}));return o.concat(ot,a.parentNode?toArray(a.parentNode.querySelectorAll(queryTabbables)).filter(function(at){return at===a}):[])},[])},getParentAutofocusables=function(i){var s=i.querySelectorAll("[".concat(FOCUS_AUTO,"]"));return toArray(s).map(function(o){return getFocusables([o])}).reduce(function(o,a){return o.concat(a)},[])},filterFocusable=function(i,s){return toArray(i).filter(function(o){return isVisibleCached(s,o)}).filter(function(o){return notHiddenInput(o)})},filterAutoFocusable=function(i,s){return s===void 0&&(s=new Map),toArray(i).filter(function(o){return isAutoFocusAllowedCached(s,o)})},getTabbableNodes=function(i,s,o){return orderByTabIndex(filterFocusable(getFocusables(i,o),s),!0,o)},getFocusableNodes=function(i,s){return orderByTabIndex(filterFocusable(getFocusables(i),s),!1)},parentAutofocusables=function(i,s){return filterFocusable(getParentAutofocusables(i),s)},contains=function(i,s){return i.shadowRoot?contains(i.shadowRoot,s):Object.getPrototypeOf(i).contains!==void 0&&Object.getPrototypeOf(i).contains.call(i,s)?!0:toArray(i.children).some(function(o){var a;if(o instanceof HTMLIFrameElement){var rt=(a=o.contentDocument)===null||a===void 0?void 0:a.body;return rt?contains(rt,s):!1}return contains(o,s)})},filterNested=function(i){for(var s=new Set,o=i.length,a=0;a0&&s.add(rt),(tt&Node.DOCUMENT_POSITION_CONTAINS)>0&&s.add(a)}return i.filter(function(ot,at){return!s.has(at)})},getTopParent=function(i){return i.parentNode?getTopParent(i.parentNode):i},getAllAffectedNodes=function(i){var s=asArray(i);return s.filter(Boolean).reduce(function(o,a){var rt=a.getAttribute(FOCUS_GROUP);return o.push.apply(o,rt?filterNested(toArray(getTopParent(a).querySelectorAll("[".concat(FOCUS_GROUP,'="').concat(rt,'"]:not([').concat(FOCUS_DISABLED,'="disabled"])')))):[a]),o},[])},safeProbe=function(i){try{return i()}catch{return}},getActiveElement=function(i){if(i===void 0&&(i=document),!(!i||!i.activeElement)){var s=i.activeElement;return s.shadowRoot?getActiveElement(s.shadowRoot):s instanceof HTMLIFrameElement&&safeProbe(function(){return s.contentWindow.document})?getActiveElement(s.contentWindow.document):s}},focusInFrame=function(i,s){return i===s},focusInsideIframe=function(i,s){return!!toArray(i.querySelectorAll("iframe")).some(function(o){return focusInFrame(o,s)})},focusInside=function(i,s){return s===void 0&&(s=getActiveElement(getFirst(i).ownerDocument)),!s||s.dataset&&s.dataset.focusGuard?!1:getAllAffectedNodes(i).some(function(o){return contains(o,s)||focusInsideIframe(o,s)})},focusIsHidden=function(i){i===void 0&&(i=document);var s=getActiveElement(i);return s?toArray(i.querySelectorAll("[".concat(FOCUS_ALLOW,"]"))).some(function(o){return contains(o,s)}):!1},findSelectedRadio=function(i,s){return s.filter(isRadioElement).filter(function(o){return o.name===i.name}).filter(function(o){return o.checked})[0]||i},correctNode=function(i,s){return isRadioElement(i)&&i.name?findSelectedRadio(i,s):i},correctNodes=function(i){var s=new Set;return i.forEach(function(o){return s.add(correctNode(o,i))}),i.filter(function(o){return s.has(o)})},pickFirstFocus=function(i){return i[0]&&i.length>1?correctNode(i[0],i):i[0]},pickFocusable=function(i,s){return i.length>1?i.indexOf(correctNode(i[s],i)):s},NEW_FOCUS="NEW_FOCUS",newFocus=function(i,s,o,a){var rt=i.length,tt=i[0],ot=i[rt-1],at=isGuard(o);if(!(o&&i.indexOf(o)>=0)){var nt=o!==void 0?s.indexOf(o):-1,it=a?s.indexOf(a):nt,j=a?i.indexOf(a):-1,_=nt-it,$=s.indexOf(tt),et=s.indexOf(ot),st=correctNodes(s),lt=o!==void 0?st.indexOf(o):-1,ct=lt-(a?st.indexOf(a):nt),ht=pickFocusable(i,0),ut=pickFocusable(i,rt-1);if(nt===-1||j===-1)return NEW_FOCUS;if(!_&&j>=0)return j;if(nt<=$&&at&&Math.abs(_)>1)return ut;if(nt>=et&&at&&Math.abs(_)>1)return ht;if(_&&Math.abs(ct)>1)return j;if(nt<=$)return ut;if(nt>et)return ht;if(_)return Math.abs(_)>1?j:(rt+j+_)%rt}},findAutoFocused=function(i){return function(s){var o,a=(o=getDataset(s))===null||o===void 0?void 0:o.autofocus;return s.autofocus||a!==void 0&&a!=="false"||i.indexOf(s)>=0}},pickAutofocus=function(i,s,o){var a=i.map(function(tt){var ot=tt.node;return ot}),rt=filterAutoFocusable(a.filter(findAutoFocused(o)));return rt&&rt.length?pickFirstFocus(rt):pickFirstFocus(filterAutoFocusable(s))},getParents=function(i,s){return s===void 0&&(s=[]),s.push(i),i.parentNode&&getParents(i.parentNode.host||i.parentNode,s),s},getCommonParent=function(i,s){for(var o=getParents(i),a=getParents(s),rt=0;rt=0)return tt}return!1},getTopCommonParent=function(i,s,o){var a=asArray(i),rt=asArray(s),tt=a[0],ot=!1;return rt.filter(Boolean).forEach(function(at){ot=getCommonParent(ot||at,at)||ot,o.filter(Boolean).forEach(function(nt){var it=getCommonParent(tt,nt);it&&(!ot||contains(it,ot)?ot=it:ot=getCommonParent(it,ot))})}),ot},allParentAutofocusables=function(i,s){return i.reduce(function(o,a){return o.concat(parentAutofocusables(a,s))},[])},reorderNodes=function(i,s){var o=new Map;return s.forEach(function(a){return o.set(a.node,a)}),i.map(function(a){return o.get(a)}).filter(isDefined)},focusSolver=function(i,s){var o=getActiveElement(asArray(i).length>0?document:getFirst(i).ownerDocument),a=getAllAffectedNodes(i).filter(isNotAGuard),rt=getTopCommonParent(o||i,i,a),tt=new Map,ot=getFocusableNodes(a,tt),at=getTabbableNodes(a,tt).filter(function(et){var st=et.node;return isNotAGuard(st)});if(!(!at[0]&&(at=ot,!at[0]))){var nt=getFocusableNodes([rt],tt).map(function(et){var st=et.node;return st}),it=reorderNodes(nt,at),j=it.map(function(et){var st=et.node;return st}),_=newFocus(j,nt,o,s);if(_===NEW_FOCUS){var $=pickAutofocus(ot,j,allParentAutofocusables(a,tt));if($)return{node:$};console.warn("focus-lock: cannot find any node to move focus into");return}return _===void 0?_:it[_]}},expandFocusableNodes=function(i){var s=getAllAffectedNodes(i).filter(isNotAGuard),o=getTopCommonParent(i,i,s),a=new Map,rt=getTabbableNodes([o],a,!0),tt=getTabbableNodes(s,a).filter(function(ot){var at=ot.node;return isNotAGuard(at)}).map(function(ot){var at=ot.node;return at});return rt.map(function(ot){var at=ot.node,nt=ot.index;return{node:at,index:nt,lockItem:tt.indexOf(at)>=0,guard:isGuard(at)}})},focusOn=function(i,s){"focus"in i&&i.focus(s),"contentWindow"in i&&i.contentWindow&&i.contentWindow.focus()},guardCount=0,lockDisabled=!1,moveFocusInside=function(i,s,o){o===void 0&&(o={});var a=focusSolver(i,s);if(!lockDisabled&&a){if(guardCount>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),lockDisabled=!0,setTimeout(function(){lockDisabled=!1},1);return}guardCount++,focusOn(a.node,o.focusOptions),guardCount--}};function deferAction(i){setTimeout(i,1)}var focusOnBody=function(){return document&&document.activeElement===document.body},isFreeFocus=function(){return focusOnBody()||focusIsHidden()},lastActiveTrap=null,lastActiveFocus=null,lastPortaledElement=null,focusWasOutsideWindow=!1,defaultWhitelist=function(){return!0},focusWhitelisted=function(s){return(lastActiveTrap.whiteList||defaultWhitelist)(s)},recordPortal=function(s,o){lastPortaledElement={observerNode:s,portaledElement:o}},focusIsPortaledPair=function(s){return lastPortaledElement&&lastPortaledElement.portaledElement===s};function autoGuard(i,s,o,a){var rt=null,tt=i;do{var ot=a[tt];if(ot.guard)ot.node.dataset.focusAutoGuard&&(rt=ot);else if(ot.lockItem){if(tt!==i)return;rt=null}else break}while((tt+=o)!==s);rt&&(rt.node.tabIndex=0)}var extractRef$1=function(s){return s&&"current"in s?s.current:s},focusWasOutside=function(s){return s?!!focusWasOutsideWindow:focusWasOutsideWindow==="meanwhile"},checkInHost=function i(s,o,a){return o&&(o.host===s&&(!o.activeElement||a.contains(o.activeElement))||o.parentNode&&i(s,o.parentNode,a))},withinHost=function(s,o){return o.some(function(a){return checkInHost(s,a,a)})},activateTrap=function(){var s=!1;if(lastActiveTrap){var o=lastActiveTrap,a=o.observed,rt=o.persistentFocus,tt=o.autoFocus,ot=o.shards,at=o.crossFrame,nt=o.focusOptions,it=a||lastPortaledElement&&lastPortaledElement.portaledElement,j=document&&document.activeElement;if(it){var _=[it].concat(ot.map(extractRef$1).filter(Boolean));if((!j||focusWhitelisted(j))&&(rt||focusWasOutside(at)||!isFreeFocus()||!lastActiveFocus&&tt)&&(it&&!(focusInside(_)||j&&withinHost(j,_)||focusIsPortaledPair(j))&&(document&&!lastActiveFocus&&j&&!tt?(j.blur&&j.blur(),document.body.focus()):(s=moveFocusInside(_,lastActiveFocus,{focusOptions:nt}),lastPortaledElement={})),focusWasOutsideWindow=!1,lastActiveFocus=document&&document.activeElement),document){var $=document&&document.activeElement,et=expandFocusableNodes(_),st=et.map(function(lt){var ct=lt.node;return ct}).indexOf($);st>-1&&(et.filter(function(lt){var ct=lt.guard,ht=lt.node;return ct&&ht.dataset.focusAutoGuard}).forEach(function(lt){var ct=lt.node;return ct.removeAttribute("tabIndex")}),autoGuard(st,et.length,1,et),autoGuard(st,-1,-1,et))}}}return s},onTrap=function(s){activateTrap()&&s&&(s.stopPropagation(),s.preventDefault())},onBlur=function(){return deferAction(activateTrap)},onFocus=function(s){var o=s.target,a=s.currentTarget;a.contains(o)||recordPortal(a,o)},FocusWatcher=function(){return null},onWindowBlur=function(){focusWasOutsideWindow="just",deferAction(function(){focusWasOutsideWindow="meanwhile"})},attachHandler=function(){document.addEventListener("focusin",onTrap),document.addEventListener("focusout",onBlur),window.addEventListener("blur",onWindowBlur)},detachHandler=function(){document.removeEventListener("focusin",onTrap),document.removeEventListener("focusout",onBlur),window.removeEventListener("blur",onWindowBlur)};function reducePropsToState(i){return i.filter(function(s){var o=s.disabled;return!o})}function handleStateChangeOnClient(i){var s=i.slice(-1)[0];s&&!lastActiveTrap&&attachHandler();var o=lastActiveTrap,a=o&&s&&s.id===o.id;lastActiveTrap=s,o&&!a&&(o.onDeactivation(),i.filter(function(rt){var tt=rt.id;return tt===o.id}).length||o.returnFocus(!s)),s?(lastActiveFocus=null,(!a||o.observed!==s.observed)&&s.onActivation(),activateTrap(),deferAction(activateTrap)):(detachHandler(),lastActiveFocus=null)}mediumFocus.assignSyncMedium(onFocus);mediumBlur.assignMedium(onBlur);mediumEffect.assignMedium(function(i){return i({moveFocusInside,focusInside})});const FocusTrap$1=withSideEffect(reducePropsToState,handleStateChangeOnClient)(FocusWatcher);var FocusLockCombination=reactExports.forwardRef(function(s,o){return reactExports.createElement(FocusLock$1,_extends({sideCar:FocusTrap$1,ref:o},s))}),_ref=FocusLock$1.propTypes||{};_ref.sideCar;_objectWithoutPropertiesLoose(_ref,["sideCar"]);FocusLockCombination.propTypes={};function isElement(i){return i!=null&&typeof i=="object"&&"nodeType"in i&&i.nodeType===Node.ELEMENT_NODE}function isHTMLElement(i){var s;if(!isElement(i))return!1;const o=(s=i.ownerDocument.defaultView)!=null?s:window;return i instanceof o.HTMLElement}var hasTabIndex=i=>i.hasAttribute("tabindex");function isDisabled(i){return!!i.getAttribute("disabled")||!!i.getAttribute("aria-disabled")}function isHidden(i){return i.parentElement&&isHidden(i.parentElement)?!0:i.hidden}function isContentEditable(i){const s=i.getAttribute("contenteditable");return s!=="false"&&s!=null}function isFocusable(i){if(!isHTMLElement(i)||isHidden(i)||isDisabled(i))return!1;const{localName:s}=i;if(["input","select","textarea","button"].indexOf(s)>=0)return!0;const a={a:()=>i.hasAttribute("href"),audio:()=>i.hasAttribute("controls"),video:()=>i.hasAttribute("controls")};return s in a?a[s]():isContentEditable(i)?!0:hasTabIndex(i)}var focusableElList=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],focusableElSelector=focusableElList.join(),isVisible=i=>i.offsetWidth>0&&i.offsetHeight>0;function getAllFocusable(i){const s=Array.from(i.querySelectorAll(focusableElSelector));return s.unshift(i),s.filter(o=>isFocusable(o)&&isVisible(o))}var _a,FocusTrap=(_a=FocusLockCombination.default)!=null?_a:FocusLockCombination,FocusLock=i=>{const{initialFocusRef:s,finalFocusRef:o,contentRef:a,restoreFocus:rt,children:tt,isDisabled:ot,autoFocus:at,persistentFocus:nt,lockFocusAcrossFrames:it}=i,j=reactExports.useCallback(()=>{s!=null&&s.current?s.current.focus():a!=null&&a.current&&getAllFocusable(a.current).length===0&&requestAnimationFrame(()=>{var st;(st=a.current)==null||st.focus()})},[s,a]),_=reactExports.useCallback(()=>{var et;(et=o==null?void 0:o.current)==null||et.focus()},[o]),$=rt&&!o;return jsxRuntimeExports.jsx(FocusTrap,{crossFrame:it,persistentFocus:nt,autoFocus:at,disabled:ot,onActivation:j,onDeactivation:_,returnFocus:$,children:tt})};FocusLock.displayName="FocusLock";var useSafeLayoutEffect=isBrowser$1?reactExports.useLayoutEffect:reactExports.useEffect;function useCallbackRef(i,s=[]){const o=reactExports.useRef(i);return useSafeLayoutEffect(()=>{o.current=i}),reactExports.useCallback((...a)=>{var rt;return(rt=o.current)==null?void 0:rt.call(o,...a)},s)}function useId(i,s){const o=reactExports.useId();return reactExports.useMemo(()=>i||[s,o].filter(Boolean).join("-"),[i,s,o])}function useControllableProp(i,s){const o=i!==void 0;return[o,o&&typeof i<"u"?i:s]}function useDisclosure(i={}){const{onClose:s,onOpen:o,isOpen:a,id:rt}=i,tt=useCallbackRef(o),ot=useCallbackRef(s),[at,nt]=reactExports.useState(i.defaultIsOpen||!1),[it,j]=useControllableProp(a,at),_=useId(rt,"disclosure"),$=reactExports.useCallback(()=>{it||nt(!1),ot==null||ot()},[it,ot]),et=reactExports.useCallback(()=>{it||nt(!0),tt==null||tt()},[it,tt]),st=reactExports.useCallback(()=>{(j?$:et)()},[j,et,$]);return{isOpen:!!j,onOpen:et,onClose:$,onToggle:st,isControlled:it,getButtonProps:(lt={})=>({...lt,"aria-expanded":j,"aria-controls":_,onClick:callAllHandlers(lt.onClick,st)}),getDisclosureProps:(lt={})=>({...lt,hidden:!j,id:_})}}var[ListStylesProvider,useListStyles]=createContext$2({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),List=forwardRef(function(s,o){const a=useMultiStyleConfig("List",s),{children:rt,styleType:tt="none",stylePosition:ot,spacing:at,...nt}=omitThemingProps(s),it=getValidChildren(rt),_=at?{["& > *:not(style) ~ *:not(style)"]:{mt:at}}:{};return jsxRuntimeExports.jsx(ListStylesProvider,{value:a,children:jsxRuntimeExports.jsx(chakra.ul,{ref:o,listStyleType:tt,listStylePosition:ot,role:"list",__css:{...a.container,..._},...nt,children:it})})});List.displayName="List";var OrderedList=forwardRef((i,s)=>{const{as:o,...a}=i;return jsxRuntimeExports.jsx(List,{ref:s,as:"ol",styleType:"decimal",marginStart:"1em",...a})});OrderedList.displayName="OrderedList";var UnorderedList=forwardRef(function(s,o){const{as:a,...rt}=s;return jsxRuntimeExports.jsx(List,{ref:o,as:"ul",styleType:"initial",marginStart:"1em",...rt})});UnorderedList.displayName="UnorderedList";var ListItem=forwardRef(function(s,o){const a=useListStyles();return jsxRuntimeExports.jsx(chakra.li,{ref:o,...s,__css:a.item})});ListItem.displayName="ListItem";var ListIcon=forwardRef(function(s,o){const a=useListStyles();return jsxRuntimeExports.jsx(Icon,{ref:o,role:"presentation",...s,__css:a.icon})});ListIcon.displayName="ListIcon";var Grid=forwardRef(function(s,o){const{templateAreas:a,gap:rt,rowGap:tt,columnGap:ot,column:at,row:nt,autoFlow:it,autoRows:j,templateRows:_,autoColumns:$,templateColumns:et,...st}=s,lt={display:"grid",gridTemplateAreas:a,gridGap:rt,gridRowGap:tt,gridColumnGap:ot,gridAutoColumns:$,gridColumn:at,gridRow:nt,gridAutoFlow:it,gridAutoRows:j,gridTemplateRows:_,gridTemplateColumns:et};return jsxRuntimeExports.jsx(chakra.div,{ref:o,__css:lt,...st})});Grid.displayName="Grid";function mapResponsive(i,s){return Array.isArray(i)?i.map(o=>o===null?null:s(o)):isObject$2(i)?Object.keys(i).reduce((o,a)=>(o[a]=s(i[a]),o),{}):i!=null?s(i):null}var SimpleGrid=forwardRef(function(s,o){const{columns:a,spacingX:rt,spacingY:tt,spacing:ot,minChildWidth:at,...nt}=s,it=useTheme(),j=at?widthToColumns(at,it):countToColumns(a);return jsxRuntimeExports.jsx(Grid,{ref:o,gap:ot,columnGap:rt,rowGap:tt,templateColumns:j,...nt})});SimpleGrid.displayName="SimpleGrid";function toPx(i){return typeof i=="number"?`${i}px`:i}function widthToColumns(i,s){return mapResponsive(i,o=>{const a=getToken("sizes",o,toPx(o))(s);return o===null?null:`repeat(auto-fit, minmax(${a}, 1fr))`})}function countToColumns(i){return mapResponsive(i,s=>s===null?null:`repeat(${s}, minmax(0, 1fr))`)}var Spacer=chakra("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});Spacer.displayName="Spacer";var Text=forwardRef(function(s,o){const a=useStyleConfig("Text",s),{className:rt,align:tt,decoration:ot,casing:at,...nt}=omitThemingProps(s),it=compact({textAlign:s.align,textDecoration:s.decoration,textTransform:s.casing});return jsxRuntimeExports.jsx(chakra.p,{ref:o,className:cx("chakra-text",s.className),...it,...nt,__css:a})});Text.displayName="Text";var StackDivider=i=>jsxRuntimeExports.jsx(chakra.div,{className:"chakra-stack__divider",...i,__css:{...i.__css,borderWidth:0,alignSelf:"stretch",borderColor:"inherit",width:"auto",height:"auto"}});StackDivider.displayName="StackDivider";var StackItem=i=>jsxRuntimeExports.jsx(chakra.div,{className:"chakra-stack__item",...i,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...i.__css}});StackItem.displayName="StackItem";function getDividerStyles(i){const{spacing:s,direction:o}=i,a={column:{my:s,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:s,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:s,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:s,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":mapResponsive(o,rt=>a[rt])}}var Stack=forwardRef((i,s)=>{const{isInline:o,direction:a,align:rt,justify:tt,spacing:ot="0.5rem",wrap:at,children:nt,divider:it,className:j,shouldWrapChildren:_,...$}=i,et=o?"row":a??"column",st=reactExports.useMemo(()=>getDividerStyles({spacing:ot,direction:et}),[ot,et]),lt=!!it,ct=!_&&!lt,ht=reactExports.useMemo(()=>{const pt=getValidChildren(nt);return ct?pt:pt.map((mt,gt)=>{const dt=typeof mt.key<"u"?mt.key:gt,St=gt+1===pt.length,yt=_?jsxRuntimeExports.jsx(StackItem,{children:mt},dt):mt;if(!lt)return yt;const _t=reactExports.cloneElement(it,{__css:st}),Ct=St?null:_t;return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[yt,Ct]},dt)})},[it,st,lt,ct,_,nt]),ut=cx("chakra-stack",j);return jsxRuntimeExports.jsx(chakra.div,{ref:s,display:"flex",alignItems:rt,justifyContent:tt,flexDirection:et,flexWrap:at,gap:lt?void 0:ot,className:ut,...$,children:ht})});Stack.displayName="Stack";var HStack=forwardRef((i,s)=>jsxRuntimeExports.jsx(Stack,{align:"center",...i,direction:"row",ref:s}));HStack.displayName="HStack";function spanFn(i){return mapResponsive(i,s=>s==="auto"?"auto":`span ${s}/span ${s}`)}var GridItem=forwardRef(function(s,o){const{area:a,colSpan:rt,colStart:tt,colEnd:ot,rowEnd:at,rowSpan:nt,rowStart:it,...j}=s,_=compact({gridArea:a,gridColumn:spanFn(rt),gridRow:spanFn(nt),gridColumnStart:tt,gridColumnEnd:ot,gridRowStart:it,gridRowEnd:at});return jsxRuntimeExports.jsx(chakra.div,{ref:o,__css:_,...j})});GridItem.displayName="GridItem";var Heading=forwardRef(function(s,o){const a=useStyleConfig("Heading",s),{className:rt,...tt}=omitThemingProps(s);return jsxRuntimeExports.jsx(chakra.h2,{ref:o,className:cx("chakra-heading",s.className),...tt,__css:a})});Heading.displayName="Heading";var Box=chakra("div");Box.displayName="Box";var Square=forwardRef(function(s,o){const{size:a,centerContent:rt=!0,...tt}=s,ot=rt?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return jsxRuntimeExports.jsx(Box,{ref:o,boxSize:a,__css:{...ot,flexShrink:0,flexGrow:0},...tt})});Square.displayName="Square";var Circle=forwardRef(function(s,o){const{size:a,...rt}=s;return jsxRuntimeExports.jsx(Square,{size:a,ref:o,borderRadius:"9999px",...rt})});Circle.displayName="Circle";var Code=forwardRef(function(s,o){const a=useStyleConfig("Code",s),{className:rt,...tt}=omitThemingProps(s);return jsxRuntimeExports.jsx(chakra.code,{ref:o,className:cx("chakra-code",s.className),...tt,__css:{display:"inline-block",...a}})});Code.displayName="Code";var transitions={slideInBottom:{...slideFadeConfig,custom:{offsetY:16,reverse:!0}},slideInRight:{...slideFadeConfig,custom:{offsetX:16,reverse:!0}},slideInTop:{...slideFadeConfig,custom:{offsetY:-16,reverse:!0}},slideInLeft:{...slideFadeConfig,custom:{offsetX:-16,reverse:!0}},scale:{...scaleFadeConfig,custom:{initialScale:.95,reverse:!0}},none:{}},MotionSection=chakra(motion.section),getMotionProps=i=>transitions[i||"none"],ModalTransition=reactExports.forwardRef((i,s)=>{const{preset:o,motionProps:a=getMotionProps(o),...rt}=i;return jsxRuntimeExports.jsx(MotionSection,{ref:s,...a,...rt})});ModalTransition.displayName="ModalTransition";var __defProp=Object.defineProperty,__defNormalProp=(i,s,o)=>s in i?__defProp(i,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[s]=o,__publicField=(i,s,o)=>(__defNormalProp(i,s+"",o),o),ModalManager=class{constructor(){__publicField(this,"modals"),this.modals=new Map}add(i){return this.modals.set(i,this.modals.size+1),this.modals.size}remove(i){this.modals.delete(i)}isTopModal(i){return i?this.modals.get(i)===this.modals.size:!1}},modalManager=new ModalManager;function useModalManager(i,s){const[o,a]=reactExports.useState(0);return reactExports.useEffect(()=>{const rt=i.current;if(rt){if(s){const tt=modalManager.add(rt);a(tt)}return()=>{modalManager.remove(rt),a(0)}}},[s,i]),o}var getDefaultParent=function(i){if(typeof document>"u")return null;var s=Array.isArray(i)?i[0]:i;return s.ownerDocument.body},counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={},lockCount=0,unwrapHost=function(i){return i&&(i.host||unwrapHost(i.parentNode))},correctTargets=function(i,s){return s.map(function(o){if(i.contains(o))return o;var a=unwrapHost(o);return a&&i.contains(a)?a:(console.error("aria-hidden",o,"in not contained inside",i,". Doing nothing"),null)}).filter(function(o){return!!o})},applyAttributeToOthers=function(i,s,o,a){var rt=correctTargets(s,Array.isArray(i)?i:[i]);markerMap[o]||(markerMap[o]=new WeakMap);var tt=markerMap[o],ot=[],at=new Set,nt=new Set(rt),it=function(_){!_||at.has(_)||(at.add(_),it(_.parentNode))};rt.forEach(it);var j=function(_){!_||nt.has(_)||Array.prototype.forEach.call(_.children,function($){if(at.has($))j($);else{var et=$.getAttribute(a),st=et!==null&&et!=="false",lt=(counterMap.get($)||0)+1,ct=(tt.get($)||0)+1;counterMap.set($,lt),tt.set($,ct),ot.push($),lt===1&&st&&uncontrolledNodes.set($,!0),ct===1&&$.setAttribute(o,"true"),st||$.setAttribute(a,"true")}})};return j(s),at.clear(),lockCount++,function(){ot.forEach(function(_){var $=counterMap.get(_)-1,et=tt.get(_)-1;counterMap.set(_,$),tt.set(_,et),$||(uncontrolledNodes.has(_)||_.removeAttribute(a),uncontrolledNodes.delete(_)),et||_.removeAttribute(o)}),lockCount--,lockCount||(counterMap=new WeakMap,counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={})}},hideOthers=function(i,s,o){o===void 0&&(o="data-aria-hidden");var a=Array.from(Array.isArray(i)?i:[i]),rt=getDefaultParent(i);return rt?(a.push.apply(a,Array.from(rt.querySelectorAll("[aria-live]"))),applyAttributeToOthers(a,rt,o,"aria-hidden")):function(){return null}};function useModal(i){const{isOpen:s,onClose:o,id:a,closeOnOverlayClick:rt=!0,closeOnEsc:tt=!0,useInert:ot=!0,onOverlayClick:at,onEsc:nt}=i,it=reactExports.useRef(null),j=reactExports.useRef(null),[_,$,et]=useIds(a,"chakra-modal","chakra-modal--header","chakra-modal--body");useAriaHidden(it,s&&ot);const st=useModalManager(it,s),lt=reactExports.useRef(null),ct=reactExports.useCallback(yt=>{lt.current=yt.target},[]),ht=reactExports.useCallback(yt=>{yt.key==="Escape"&&(yt.stopPropagation(),tt&&(o==null||o()),nt==null||nt())},[tt,o,nt]),[ut,pt]=reactExports.useState(!1),[mt,gt]=reactExports.useState(!1),dt=reactExports.useCallback((yt={},_t=null)=>({role:"dialog",...yt,ref:mergeRefs(_t,it),id:_,tabIndex:-1,"aria-modal":!0,"aria-labelledby":ut?$:void 0,"aria-describedby":mt?et:void 0,onClick:callAllHandlers$1(yt.onClick,Ct=>Ct.stopPropagation())}),[et,mt,_,$,ut]),St=reactExports.useCallback(yt=>{yt.stopPropagation(),lt.current===yt.target&&modalManager.isTopModal(it.current)&&(rt&&(o==null||o()),at==null||at())},[o,rt,at]),xt=reactExports.useCallback((yt={},_t=null)=>({...yt,ref:mergeRefs(_t,j),onClick:callAllHandlers$1(yt.onClick,St),onKeyDown:callAllHandlers$1(yt.onKeyDown,ht),onMouseDown:callAllHandlers$1(yt.onMouseDown,ct)}),[ht,ct,St]);return{isOpen:s,onClose:o,headerId:$,bodyId:et,setBodyMounted:gt,setHeaderMounted:pt,dialogRef:it,overlayRef:j,getDialogProps:dt,getDialogContainerProps:xt,index:st}}function useAriaHidden(i,s){const o=i.current;reactExports.useEffect(()=>{if(!(!i.current||!s))return hideOthers(i.current)},[s,i,o])}function useIds(i,...s){const o=reactExports.useId(),a=i||o;return reactExports.useMemo(()=>s.map(rt=>`${rt}-${a}`),[a,s])}var[ModalStylesProvider,useModalStyles]=createContext$2({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[ModalContextProvider,useModalContext]=createContext$2({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),Modal=i=>{const s={scrollBehavior:"outside",autoFocus:!0,trapFocus:!0,returnFocusOnClose:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale",lockFocusAcrossFrames:!0,...i},{portalProps:o,children:a,autoFocus:rt,trapFocus:tt,initialFocusRef:ot,finalFocusRef:at,returnFocusOnClose:nt,blockScrollOnMount:it,allowPinchZoom:j,preserveScrollBarGap:_,motionPreset:$,lockFocusAcrossFrames:et,onCloseComplete:st}=s,lt=useMultiStyleConfig("Modal",s),ht={...useModal(s),autoFocus:rt,trapFocus:tt,initialFocusRef:ot,finalFocusRef:at,returnFocusOnClose:nt,blockScrollOnMount:it,allowPinchZoom:j,preserveScrollBarGap:_,motionPreset:$,lockFocusAcrossFrames:et};return jsxRuntimeExports.jsx(ModalContextProvider,{value:ht,children:jsxRuntimeExports.jsx(ModalStylesProvider,{value:lt,children:jsxRuntimeExports.jsx(AnimatePresence,{onExitComplete:st,children:ht.isOpen&&jsxRuntimeExports.jsx(Portal,{...o,children:a})})})})};Modal.displayName="Modal";var zeroRightClassName="right-scroll-bar-position",fullWidthClassName="width-before-scroll-bar",noScrollbarsClassName="with-scroll-bars-hidden",removedBarSizeVariable="--removed-body-scroll-bar-size",effectCar=createSidecarMedium(),nothing=function(){},RemoveScroll=reactExports.forwardRef(function(i,s){var o=reactExports.useRef(null),a=reactExports.useState({onScrollCapture:nothing,onWheelCapture:nothing,onTouchMoveCapture:nothing}),rt=a[0],tt=a[1],ot=i.forwardProps,at=i.children,nt=i.className,it=i.removeScrollBar,j=i.enabled,_=i.shards,$=i.sideCar,et=i.noIsolation,st=i.inert,lt=i.allowPinchZoom,ct=i.as,ht=ct===void 0?"div":ct,ut=i.gapMode,pt=__rest(i,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),mt=$,gt=useMergeRefs([o,s]),dt=__assign$2(__assign$2({},pt),rt);return reactExports.createElement(reactExports.Fragment,null,j&&reactExports.createElement(mt,{sideCar:effectCar,removeScrollBar:it,shards:_,noIsolation:et,inert:st,setCallbacks:tt,allowPinchZoom:!!lt,lockRef:o,gapMode:ut}),ot?reactExports.cloneElement(reactExports.Children.only(at),__assign$2(__assign$2({},dt),{ref:gt})):reactExports.createElement(ht,__assign$2({},dt,{className:nt,ref:gt}),at))});RemoveScroll.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};RemoveScroll.classNames={fullWidth:fullWidthClassName,zeroRight:zeroRightClassName};var getNonce=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function makeStyleTag(){if(!document)return null;var i=document.createElement("style");i.type="text/css";var s=getNonce();return s&&i.setAttribute("nonce",s),i}function injectStyles(i,s){i.styleSheet?i.styleSheet.cssText=s:i.appendChild(document.createTextNode(s))}function insertStyleTag(i){var s=document.head||document.getElementsByTagName("head")[0];s.appendChild(i)}var stylesheetSingleton=function(){var i=0,s=null;return{add:function(o){i==0&&(s=makeStyleTag())&&(injectStyles(s,o),insertStyleTag(s)),i++},remove:function(){i--,!i&&s&&(s.parentNode&&s.parentNode.removeChild(s),s=null)}}},styleHookSingleton=function(){var i=stylesheetSingleton();return function(s,o){reactExports.useEffect(function(){return i.add(s),function(){i.remove()}},[s&&o])}},styleSingleton=function(){var i=styleHookSingleton(),s=function(o){var a=o.styles,rt=o.dynamic;return i(a,rt),null};return s},zeroGap={left:0,top:0,right:0,gap:0},parse$1=function(i){return parseInt(i||"",10)||0},getOffset=function(i){var s=window.getComputedStyle(document.body),o=s[i==="padding"?"paddingLeft":"marginLeft"],a=s[i==="padding"?"paddingTop":"marginTop"],rt=s[i==="padding"?"paddingRight":"marginRight"];return[parse$1(o),parse$1(a),parse$1(rt)]},getGapWidth=function(i){if(i===void 0&&(i="margin"),typeof window>"u")return zeroGap;var s=getOffset(i),o=document.documentElement.clientWidth,a=window.innerWidth;return{left:s[0],top:s[1],right:s[2],gap:Math.max(0,a-o+s[2]-s[0])}},Style=styleSingleton(),getStyles=function(i,s,o,a){var rt=i.left,tt=i.top,ot=i.right,at=i.gap;return o===void 0&&(o="margin"),` .`.concat(noScrollbarsClassName,` { overflow: hidden `).concat(a,`; padding-right: `).concat(at,"px ").concat(a,`; @@ -357,7 +357,7 @@ Error generating stack: `+et.message+` overscroll-behavior: contain; `).concat([s&&"position: relative ".concat(a,";"),o==="margin"&&` padding-left: `.concat(rt,`px; - padding-top: `).concat(et,`px; + padding-top: `).concat(tt,`px; padding-right: `).concat(ot,`px; margin-left:0; margin-top:0; @@ -384,10 +384,10 @@ Error generating stack: `+et.message+` body { `).concat(removedBarSizeVariable,": ").concat(at,`px; } -`)},RemoveScrollBar=function(i){var s=i.noRelative,o=i.noImportant,a=i.gapMode,rt=a===void 0?"margin":a,et=reactExports.useMemo(function(){return getGapWidth(rt)},[rt]);return reactExports.createElement(Style,{styles:getStyles(et,!s,rt,o?"":"!important")})},passiveSupported=!1;if(typeof window<"u")try{var options=Object.defineProperty({},"passive",{get:function(){return passiveSupported=!0,!0}});window.addEventListener("test",options,options),window.removeEventListener("test",options,options)}catch{passiveSupported=!1}var nonPassive=passiveSupported?{passive:!1}:!1,alwaysContainsScroll=function(i){return i.tagName==="TEXTAREA"},elementCanBeScrolled=function(i,s){var o=window.getComputedStyle(i);return o[s]!=="hidden"&&!(o.overflowY===o.overflowX&&!alwaysContainsScroll(i)&&o[s]==="visible")},elementCouldBeVScrolled=function(i){return elementCanBeScrolled(i,"overflowY")},elementCouldBeHScrolled=function(i){return elementCanBeScrolled(i,"overflowX")},locationCouldBeScrolled=function(i,s){var o=s.ownerDocument,a=s;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var rt=elementCouldBeScrolled(i,a);if(rt){var et=getScrollVariables(i,a),ot=et[1],at=et[2];if(ot>at)return!0}a=a.parentNode}while(a&&a!==o.body);return!1},getVScrollVariables=function(i){var s=i.scrollTop,o=i.scrollHeight,a=i.clientHeight;return[s,o,a]},getHScrollVariables=function(i){var s=i.scrollLeft,o=i.scrollWidth,a=i.clientWidth;return[s,o,a]},elementCouldBeScrolled=function(i,s){return i==="v"?elementCouldBeVScrolled(s):elementCouldBeHScrolled(s)},getScrollVariables=function(i,s){return i==="v"?getVScrollVariables(s):getHScrollVariables(s)},getDirectionFactor=function(i,s){return i==="h"&&s==="rtl"?-1:1},handleScroll=function(i,s,o,a,rt){var et=getDirectionFactor(i,window.getComputedStyle(s).direction),ot=et*a,at=o.target,nt=s.contains(at),it=!1,j=ot>0,_=0,$=0;do{var tt=getScrollVariables(i,at),st=tt[0],lt=tt[1],ct=tt[2],ht=lt-ct-et*st;(st||ht)&&elementCouldBeScrolled(i,at)&&(_+=ht,$+=st),at instanceof ShadowRoot?at=at.host:at=at.parentNode}while(!nt&&at!==document.body||nt&&(s.contains(at)||s===at));return(j&&(Math.abs(_)<1||!rt)||!j&&(Math.abs($)<1||!rt))&&(it=!0),it},getTouchXY=function(i){return"changedTouches"in i?[i.changedTouches[0].clientX,i.changedTouches[0].clientY]:[0,0]},getDeltaXY=function(i){return[i.deltaX,i.deltaY]},extractRef=function(i){return i&&"current"in i?i.current:i},deltaCompare=function(i,s){return i[0]===s[0]&&i[1]===s[1]},generateStyle=function(i){return` +`)},RemoveScrollBar=function(i){var s=i.noRelative,o=i.noImportant,a=i.gapMode,rt=a===void 0?"margin":a,tt=reactExports.useMemo(function(){return getGapWidth(rt)},[rt]);return reactExports.createElement(Style,{styles:getStyles(tt,!s,rt,o?"":"!important")})},passiveSupported=!1;if(typeof window<"u")try{var options=Object.defineProperty({},"passive",{get:function(){return passiveSupported=!0,!0}});window.addEventListener("test",options,options),window.removeEventListener("test",options,options)}catch{passiveSupported=!1}var nonPassive=passiveSupported?{passive:!1}:!1,alwaysContainsScroll=function(i){return i.tagName==="TEXTAREA"},elementCanBeScrolled=function(i,s){var o=window.getComputedStyle(i);return o[s]!=="hidden"&&!(o.overflowY===o.overflowX&&!alwaysContainsScroll(i)&&o[s]==="visible")},elementCouldBeVScrolled=function(i){return elementCanBeScrolled(i,"overflowY")},elementCouldBeHScrolled=function(i){return elementCanBeScrolled(i,"overflowX")},locationCouldBeScrolled=function(i,s){var o=s.ownerDocument,a=s;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var rt=elementCouldBeScrolled(i,a);if(rt){var tt=getScrollVariables(i,a),ot=tt[1],at=tt[2];if(ot>at)return!0}a=a.parentNode}while(a&&a!==o.body);return!1},getVScrollVariables=function(i){var s=i.scrollTop,o=i.scrollHeight,a=i.clientHeight;return[s,o,a]},getHScrollVariables=function(i){var s=i.scrollLeft,o=i.scrollWidth,a=i.clientWidth;return[s,o,a]},elementCouldBeScrolled=function(i,s){return i==="v"?elementCouldBeVScrolled(s):elementCouldBeHScrolled(s)},getScrollVariables=function(i,s){return i==="v"?getVScrollVariables(s):getHScrollVariables(s)},getDirectionFactor=function(i,s){return i==="h"&&s==="rtl"?-1:1},handleScroll=function(i,s,o,a,rt){var tt=getDirectionFactor(i,window.getComputedStyle(s).direction),ot=tt*a,at=o.target,nt=s.contains(at),it=!1,j=ot>0,_=0,$=0;do{var et=getScrollVariables(i,at),st=et[0],lt=et[1],ct=et[2],ht=lt-ct-tt*st;(st||ht)&&elementCouldBeScrolled(i,at)&&(_+=ht,$+=st),at instanceof ShadowRoot?at=at.host:at=at.parentNode}while(!nt&&at!==document.body||nt&&(s.contains(at)||s===at));return(j&&(Math.abs(_)<1||!rt)||!j&&(Math.abs($)<1||!rt))&&(it=!0),it},getTouchXY=function(i){return"changedTouches"in i?[i.changedTouches[0].clientX,i.changedTouches[0].clientY]:[0,0]},getDeltaXY=function(i){return[i.deltaX,i.deltaY]},extractRef=function(i){return i&&"current"in i?i.current:i},deltaCompare=function(i,s){return i[0]===s[0]&&i[1]===s[1]},generateStyle=function(i){return` .block-interactivity-`.concat(i,` {pointer-events: none;} .allow-interactivity-`).concat(i,` {pointer-events: all;} -`)},idCounter=0,lockStack=[];function RemoveScrollSideCar(i){var s=reactExports.useRef([]),o=reactExports.useRef([0,0]),a=reactExports.useRef(),rt=reactExports.useState(idCounter++)[0],et=reactExports.useState(styleSingleton)[0],ot=reactExports.useRef(i);reactExports.useEffect(function(){ot.current=i},[i]),reactExports.useEffect(function(){if(i.inert){document.body.classList.add("block-interactivity-".concat(rt));var lt=__spreadArray([i.lockRef.current],(i.shards||[]).map(extractRef),!0).filter(Boolean);return lt.forEach(function(ct){return ct.classList.add("allow-interactivity-".concat(rt))}),function(){document.body.classList.remove("block-interactivity-".concat(rt)),lt.forEach(function(ct){return ct.classList.remove("allow-interactivity-".concat(rt))})}}},[i.inert,i.lockRef.current,i.shards]);var at=reactExports.useCallback(function(lt,ct){if("touches"in lt&<.touches.length===2)return!ot.current.allowPinchZoom;var ht=getTouchXY(lt),ut=o.current,pt="deltaX"in lt?lt.deltaX:ut[0]-ht[0],mt="deltaY"in lt?lt.deltaY:ut[1]-ht[1],gt,dt=lt.target,St=Math.abs(pt)>Math.abs(mt)?"h":"v";if("touches"in lt&&St==="h"&&dt.type==="range")return!1;var xt=locationCouldBeScrolled(St,dt);if(!xt)return!0;if(xt?gt=St:(gt=St==="v"?"h":"v",xt=locationCouldBeScrolled(St,dt)),!xt)return!1;if(!a.current&&"changedTouches"in lt&&(pt||mt)&&(a.current=gt),!gt)return!0;var yt=a.current||gt;return handleScroll(yt,ct,lt,yt==="h"?pt:mt,!0)},[]),nt=reactExports.useCallback(function(lt){var ct=lt;if(!(!lockStack.length||lockStack[lockStack.length-1]!==et)){var ht="deltaY"in ct?getDeltaXY(ct):getTouchXY(ct),ut=s.current.filter(function(gt){return gt.name===ct.type&&(gt.target===ct.target||ct.target===gt.shadowParent)&&deltaCompare(gt.delta,ht)})[0];if(ut&&ut.should){ct.cancelable&&ct.preventDefault();return}if(!ut){var pt=(ot.current.shards||[]).map(extractRef).filter(Boolean).filter(function(gt){return gt.contains(ct.target)}),mt=pt.length>0?at(ct,pt[0]):!ot.current.noIsolation;mt&&ct.cancelable&&ct.preventDefault()}}},[]),it=reactExports.useCallback(function(lt,ct,ht,ut){var pt={name:lt,delta:ct,target:ht,should:ut,shadowParent:getOutermostShadowParent(ht)};s.current.push(pt),setTimeout(function(){s.current=s.current.filter(function(mt){return mt!==pt})},1)},[]),j=reactExports.useCallback(function(lt){o.current=getTouchXY(lt),a.current=void 0},[]),_=reactExports.useCallback(function(lt){it(lt.type,getDeltaXY(lt),lt.target,at(lt,i.lockRef.current))},[]),$=reactExports.useCallback(function(lt){it(lt.type,getTouchXY(lt),lt.target,at(lt,i.lockRef.current))},[]);reactExports.useEffect(function(){return lockStack.push(et),i.setCallbacks({onScrollCapture:_,onWheelCapture:_,onTouchMoveCapture:$}),document.addEventListener("wheel",nt,nonPassive),document.addEventListener("touchmove",nt,nonPassive),document.addEventListener("touchstart",j,nonPassive),function(){lockStack=lockStack.filter(function(lt){return lt!==et}),document.removeEventListener("wheel",nt,nonPassive),document.removeEventListener("touchmove",nt,nonPassive),document.removeEventListener("touchstart",j,nonPassive)}},[]);var tt=i.removeScrollBar,st=i.inert;return reactExports.createElement(reactExports.Fragment,null,st?reactExports.createElement(et,{styles:generateStyle(rt)}):null,tt?reactExports.createElement(RemoveScrollBar,{gapMode:i.gapMode}):null)}function getOutermostShadowParent(i){for(var s=null;i!==null;)i instanceof ShadowRoot&&(s=i.host,i=i.host),i=i.parentNode;return s}const SideCar=exportSidecar(effectCar,RemoveScrollSideCar);var ReactRemoveScroll=reactExports.forwardRef(function(i,s){return reactExports.createElement(RemoveScroll,__assign$2({},i,{ref:s,sideCar:SideCar}))});ReactRemoveScroll.classNames=RemoveScroll.classNames;function ModalFocusScope(i){const{autoFocus:s,trapFocus:o,dialogRef:a,initialFocusRef:rt,blockScrollOnMount:et,allowPinchZoom:ot,finalFocusRef:at,returnFocusOnClose:nt,preserveScrollBarGap:it,lockFocusAcrossFrames:j,isOpen:_}=useModalContext(),[$,tt]=usePresence();reactExports.useEffect(()=>{!$&&tt&&setTimeout(tt)},[$,tt]);const st=useModalManager(a,_);return jsxRuntimeExports.jsx(FocusLock,{autoFocus:s,isDisabled:!o,initialFocusRef:rt,finalFocusRef:at,restoreFocus:nt,contentRef:a,lockFocusAcrossFrames:j,children:jsxRuntimeExports.jsx(ReactRemoveScroll,{removeScrollBar:!it,allowPinchZoom:ot,enabled:st===1&&et,forwardProps:!0,children:i.children})})}var ModalContent=forwardRef((i,s)=>{const{className:o,children:a,containerProps:rt,motionProps:et,...ot}=i,{getDialogProps:at,getDialogContainerProps:nt}=useModalContext(),it=at(ot,s),j=nt(rt),_=cx("chakra-modal__content",o),$=useModalStyles(),tt={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...$.dialog},st={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...$.dialogContainer},{motionPreset:lt}=useModalContext();return jsxRuntimeExports.jsx(ModalFocusScope,{children:jsxRuntimeExports.jsx(chakra.div,{...j,className:"chakra-modal__content-container",tabIndex:-1,__css:st,children:jsxRuntimeExports.jsx(ModalTransition,{preset:lt,motionProps:et,className:_,...it,__css:tt,children:a})})})});ModalContent.displayName="ModalContent";var ModalFooter=forwardRef((i,s)=>{const{className:o,...a}=i,rt=cx("chakra-modal__footer",o),ot={display:"flex",alignItems:"center",justifyContent:"flex-end",...useModalStyles().footer};return jsxRuntimeExports.jsx(chakra.footer,{ref:s,...a,__css:ot,className:rt})});ModalFooter.displayName="ModalFooter";var ModalHeader=forwardRef((i,s)=>{const{className:o,...a}=i,{headerId:rt,setHeaderMounted:et}=useModalContext();reactExports.useEffect(()=>(et(!0),()=>et(!1)),[et]);const ot=cx("chakra-modal__header",o),nt={flex:0,...useModalStyles().header};return jsxRuntimeExports.jsx(chakra.header,{ref:s,className:ot,id:rt,...a,__css:nt})});ModalHeader.displayName="ModalHeader";var MotionDiv=chakra(motion.div),ModalOverlay=forwardRef((i,s)=>{const{className:o,transition:a,motionProps:rt,...et}=i,ot=cx("chakra-modal__overlay",o),nt={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...useModalStyles().overlay},{motionPreset:it}=useModalContext(),_=rt||(it==="none"?{}:fadeConfig);return jsxRuntimeExports.jsx(MotionDiv,{..._,__css:nt,ref:s,className:ot,...et})});ModalOverlay.displayName="ModalOverlay";var ModalBody=forwardRef((i,s)=>{const{className:o,...a}=i,{bodyId:rt,setBodyMounted:et}=useModalContext();reactExports.useEffect(()=>(et(!0),()=>et(!1)),[et]);const ot=cx("chakra-modal__body",o),at=useModalStyles();return jsxRuntimeExports.jsx(chakra.div,{ref:s,className:ot,id:rt,...a,__css:at.body})});ModalBody.displayName="ModalBody";var ModalCloseButton=forwardRef((i,s)=>{const{onClick:o,className:a,...rt}=i,{onClose:et}=useModalContext(),ot=cx("chakra-modal__close-btn",a),at=useModalStyles();return jsxRuntimeExports.jsx(CloseButton,{ref:s,__css:at.closeButton,className:ot,onClick:callAllHandlers$1(o,nt=>{nt.stopPropagation(),et()}),...rt})});ModalCloseButton.displayName="ModalCloseButton";var SelectField=forwardRef(function(s,o){const{children:a,placeholder:rt,className:et,...ot}=s;return jsxRuntimeExports.jsxs(chakra.select,{...ot,ref:o,className:cx("chakra-select",et),children:[rt&&jsxRuntimeExports.jsx("option",{value:"",children:rt}),a]})});SelectField.displayName="SelectField";function split$1(i,s){const o={},a={};for(const[rt,et]of Object.entries(i))s.includes(rt)?o[rt]=et:a[rt]=et;return[o,a]}var Select=forwardRef((i,s)=>{var o;const a=useMultiStyleConfig("Select",i),{rootProps:rt,placeholder:et,icon:ot,color:at,height:nt,h:it,minH:j,minHeight:_,iconColor:$,iconSize:tt,...st}=omitThemingProps(i),[lt,ct]=split$1(st,layoutPropNames),ht=useFormControl(ct),ut={width:"100%",height:"fit-content",position:"relative",color:at},pt={paddingEnd:"2rem",...a.field,_focus:{zIndex:"unset",...(o=a.field)==null?void 0:o._focus}};return jsxRuntimeExports.jsxs(chakra.div,{className:"chakra-select__wrapper",__css:ut,...lt,...rt,children:[jsxRuntimeExports.jsx(SelectField,{ref:s,height:it??nt,minH:j??_,placeholder:et,...ht,__css:pt,children:i.children}),jsxRuntimeExports.jsx(SelectIcon,{"data-disabled":dataAttr(ht.disabled),...($||at)&&{color:$||at},__css:a.icon,...tt&&{fontSize:tt},children:ot})]})});Select.displayName="Select";var DefaultIcon=i=>jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",...i,children:jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),IconWrapper=chakra("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),SelectIcon=i=>{const{children:s=jsxRuntimeExports.jsx(DefaultIcon,{}),...o}=i,a=reactExports.cloneElement(s,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return jsxRuntimeExports.jsx(IconWrapper,{...o,className:"chakra-select__icon-wrapper",children:reactExports.isValidElement(s)?a:null})};SelectIcon.displayName="SelectIcon";var client={},m=reactDomExports;client.createRoot=m.createRoot,client.hydrateRoot=m.hydrateRoot;var withSelector={exports:{}},useSyncExternalStoreWithSelector_production_min={};/** +`)},idCounter=0,lockStack=[];function RemoveScrollSideCar(i){var s=reactExports.useRef([]),o=reactExports.useRef([0,0]),a=reactExports.useRef(),rt=reactExports.useState(idCounter++)[0],tt=reactExports.useState(styleSingleton)[0],ot=reactExports.useRef(i);reactExports.useEffect(function(){ot.current=i},[i]),reactExports.useEffect(function(){if(i.inert){document.body.classList.add("block-interactivity-".concat(rt));var lt=__spreadArray([i.lockRef.current],(i.shards||[]).map(extractRef),!0).filter(Boolean);return lt.forEach(function(ct){return ct.classList.add("allow-interactivity-".concat(rt))}),function(){document.body.classList.remove("block-interactivity-".concat(rt)),lt.forEach(function(ct){return ct.classList.remove("allow-interactivity-".concat(rt))})}}},[i.inert,i.lockRef.current,i.shards]);var at=reactExports.useCallback(function(lt,ct){if("touches"in lt&<.touches.length===2)return!ot.current.allowPinchZoom;var ht=getTouchXY(lt),ut=o.current,pt="deltaX"in lt?lt.deltaX:ut[0]-ht[0],mt="deltaY"in lt?lt.deltaY:ut[1]-ht[1],gt,dt=lt.target,St=Math.abs(pt)>Math.abs(mt)?"h":"v";if("touches"in lt&&St==="h"&&dt.type==="range")return!1;var xt=locationCouldBeScrolled(St,dt);if(!xt)return!0;if(xt?gt=St:(gt=St==="v"?"h":"v",xt=locationCouldBeScrolled(St,dt)),!xt)return!1;if(!a.current&&"changedTouches"in lt&&(pt||mt)&&(a.current=gt),!gt)return!0;var yt=a.current||gt;return handleScroll(yt,ct,lt,yt==="h"?pt:mt,!0)},[]),nt=reactExports.useCallback(function(lt){var ct=lt;if(!(!lockStack.length||lockStack[lockStack.length-1]!==tt)){var ht="deltaY"in ct?getDeltaXY(ct):getTouchXY(ct),ut=s.current.filter(function(gt){return gt.name===ct.type&&(gt.target===ct.target||ct.target===gt.shadowParent)&&deltaCompare(gt.delta,ht)})[0];if(ut&&ut.should){ct.cancelable&&ct.preventDefault();return}if(!ut){var pt=(ot.current.shards||[]).map(extractRef).filter(Boolean).filter(function(gt){return gt.contains(ct.target)}),mt=pt.length>0?at(ct,pt[0]):!ot.current.noIsolation;mt&&ct.cancelable&&ct.preventDefault()}}},[]),it=reactExports.useCallback(function(lt,ct,ht,ut){var pt={name:lt,delta:ct,target:ht,should:ut,shadowParent:getOutermostShadowParent(ht)};s.current.push(pt),setTimeout(function(){s.current=s.current.filter(function(mt){return mt!==pt})},1)},[]),j=reactExports.useCallback(function(lt){o.current=getTouchXY(lt),a.current=void 0},[]),_=reactExports.useCallback(function(lt){it(lt.type,getDeltaXY(lt),lt.target,at(lt,i.lockRef.current))},[]),$=reactExports.useCallback(function(lt){it(lt.type,getTouchXY(lt),lt.target,at(lt,i.lockRef.current))},[]);reactExports.useEffect(function(){return lockStack.push(tt),i.setCallbacks({onScrollCapture:_,onWheelCapture:_,onTouchMoveCapture:$}),document.addEventListener("wheel",nt,nonPassive),document.addEventListener("touchmove",nt,nonPassive),document.addEventListener("touchstart",j,nonPassive),function(){lockStack=lockStack.filter(function(lt){return lt!==tt}),document.removeEventListener("wheel",nt,nonPassive),document.removeEventListener("touchmove",nt,nonPassive),document.removeEventListener("touchstart",j,nonPassive)}},[]);var et=i.removeScrollBar,st=i.inert;return reactExports.createElement(reactExports.Fragment,null,st?reactExports.createElement(tt,{styles:generateStyle(rt)}):null,et?reactExports.createElement(RemoveScrollBar,{gapMode:i.gapMode}):null)}function getOutermostShadowParent(i){for(var s=null;i!==null;)i instanceof ShadowRoot&&(s=i.host,i=i.host),i=i.parentNode;return s}const SideCar=exportSidecar(effectCar,RemoveScrollSideCar);var ReactRemoveScroll=reactExports.forwardRef(function(i,s){return reactExports.createElement(RemoveScroll,__assign$2({},i,{ref:s,sideCar:SideCar}))});ReactRemoveScroll.classNames=RemoveScroll.classNames;function ModalFocusScope(i){const{autoFocus:s,trapFocus:o,dialogRef:a,initialFocusRef:rt,blockScrollOnMount:tt,allowPinchZoom:ot,finalFocusRef:at,returnFocusOnClose:nt,preserveScrollBarGap:it,lockFocusAcrossFrames:j,isOpen:_}=useModalContext(),[$,et]=usePresence();reactExports.useEffect(()=>{!$&&et&&setTimeout(et)},[$,et]);const st=useModalManager(a,_);return jsxRuntimeExports.jsx(FocusLock,{autoFocus:s,isDisabled:!o,initialFocusRef:rt,finalFocusRef:at,restoreFocus:nt,contentRef:a,lockFocusAcrossFrames:j,children:jsxRuntimeExports.jsx(ReactRemoveScroll,{removeScrollBar:!it,allowPinchZoom:ot,enabled:st===1&&tt,forwardProps:!0,children:i.children})})}var ModalContent=forwardRef((i,s)=>{const{className:o,children:a,containerProps:rt,motionProps:tt,...ot}=i,{getDialogProps:at,getDialogContainerProps:nt}=useModalContext(),it=at(ot,s),j=nt(rt),_=cx("chakra-modal__content",o),$=useModalStyles(),et={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...$.dialog},st={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...$.dialogContainer},{motionPreset:lt}=useModalContext();return jsxRuntimeExports.jsx(ModalFocusScope,{children:jsxRuntimeExports.jsx(chakra.div,{...j,className:"chakra-modal__content-container",tabIndex:-1,__css:st,children:jsxRuntimeExports.jsx(ModalTransition,{preset:lt,motionProps:tt,className:_,...it,__css:et,children:a})})})});ModalContent.displayName="ModalContent";var ModalFooter=forwardRef((i,s)=>{const{className:o,...a}=i,rt=cx("chakra-modal__footer",o),ot={display:"flex",alignItems:"center",justifyContent:"flex-end",...useModalStyles().footer};return jsxRuntimeExports.jsx(chakra.footer,{ref:s,...a,__css:ot,className:rt})});ModalFooter.displayName="ModalFooter";var ModalHeader=forwardRef((i,s)=>{const{className:o,...a}=i,{headerId:rt,setHeaderMounted:tt}=useModalContext();reactExports.useEffect(()=>(tt(!0),()=>tt(!1)),[tt]);const ot=cx("chakra-modal__header",o),nt={flex:0,...useModalStyles().header};return jsxRuntimeExports.jsx(chakra.header,{ref:s,className:ot,id:rt,...a,__css:nt})});ModalHeader.displayName="ModalHeader";var MotionDiv=chakra(motion.div),ModalOverlay=forwardRef((i,s)=>{const{className:o,transition:a,motionProps:rt,...tt}=i,ot=cx("chakra-modal__overlay",o),nt={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...useModalStyles().overlay},{motionPreset:it}=useModalContext(),_=rt||(it==="none"?{}:fadeConfig);return jsxRuntimeExports.jsx(MotionDiv,{..._,__css:nt,ref:s,className:ot,...tt})});ModalOverlay.displayName="ModalOverlay";var ModalBody=forwardRef((i,s)=>{const{className:o,...a}=i,{bodyId:rt,setBodyMounted:tt}=useModalContext();reactExports.useEffect(()=>(tt(!0),()=>tt(!1)),[tt]);const ot=cx("chakra-modal__body",o),at=useModalStyles();return jsxRuntimeExports.jsx(chakra.div,{ref:s,className:ot,id:rt,...a,__css:at.body})});ModalBody.displayName="ModalBody";var ModalCloseButton=forwardRef((i,s)=>{const{onClick:o,className:a,...rt}=i,{onClose:tt}=useModalContext(),ot=cx("chakra-modal__close-btn",a),at=useModalStyles();return jsxRuntimeExports.jsx(CloseButton,{ref:s,__css:at.closeButton,className:ot,onClick:callAllHandlers$1(o,nt=>{nt.stopPropagation(),tt()}),...rt})});ModalCloseButton.displayName="ModalCloseButton";var SelectField=forwardRef(function(s,o){const{children:a,placeholder:rt,className:tt,...ot}=s;return jsxRuntimeExports.jsxs(chakra.select,{...ot,ref:o,className:cx("chakra-select",tt),children:[rt&&jsxRuntimeExports.jsx("option",{value:"",children:rt}),a]})});SelectField.displayName="SelectField";function split$1(i,s){const o={},a={};for(const[rt,tt]of Object.entries(i))s.includes(rt)?o[rt]=tt:a[rt]=tt;return[o,a]}var Select=forwardRef((i,s)=>{var o;const a=useMultiStyleConfig("Select",i),{rootProps:rt,placeholder:tt,icon:ot,color:at,height:nt,h:it,minH:j,minHeight:_,iconColor:$,iconSize:et,...st}=omitThemingProps(i),[lt,ct]=split$1(st,layoutPropNames),ht=useFormControl(ct),ut={width:"100%",height:"fit-content",position:"relative",color:at},pt={paddingEnd:"2rem",...a.field,_focus:{zIndex:"unset",...(o=a.field)==null?void 0:o._focus}};return jsxRuntimeExports.jsxs(chakra.div,{className:"chakra-select__wrapper",__css:ut,...lt,...rt,children:[jsxRuntimeExports.jsx(SelectField,{ref:s,height:it??nt,minH:j??_,placeholder:tt,...ht,__css:pt,children:i.children}),jsxRuntimeExports.jsx(SelectIcon,{"data-disabled":dataAttr(ht.disabled),...($||at)&&{color:$||at},__css:a.icon,...et&&{fontSize:et},children:ot})]})});Select.displayName="Select";var DefaultIcon=i=>jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",...i,children:jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),IconWrapper=chakra("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),SelectIcon=i=>{const{children:s=jsxRuntimeExports.jsx(DefaultIcon,{}),...o}=i,a=reactExports.cloneElement(s,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return jsxRuntimeExports.jsx(IconWrapper,{...o,className:"chakra-select__icon-wrapper",children:reactExports.isValidElement(s)?a:null})};SelectIcon.displayName="SelectIcon";var client={},m=reactDomExports;client.createRoot=m.createRoot,client.hydrateRoot=m.hydrateRoot;var withSelector={exports:{}},useSyncExternalStoreWithSelector_production_min={};/** * @license React * use-sync-external-store-with-selector.production.min.js * @@ -395,14 +395,14 @@ Error generating stack: `+et.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var g=reactExports;function n(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var p=typeof Object.is=="function"?Object.is:n,q=g.useSyncExternalStore,r=g.useRef,t=g.useEffect,u=g.useMemo,v=g.useDebugValue;useSyncExternalStoreWithSelector_production_min.useSyncExternalStoreWithSelector=function(i,s,o,a,rt){var et=r(null);if(et.current===null){var ot={hasValue:!1,value:null};et.current=ot}else ot=et.current;et=u(function(){function nt(tt){if(!it){if(it=!0,j=tt,tt=a(tt),rt!==void 0&&ot.hasValue){var st=ot.value;if(rt(st,tt))return _=st}return _=tt}if(st=_,p(j,tt))return st;var lt=a(tt);return rt!==void 0&&rt(st,lt)?st:(j=tt,_=lt)}var it=!1,j,_,$=o===void 0?null:o;return[function(){return nt(s())},$===null?void 0:function(){return nt($())}]},[s,o,a,rt]);var at=q(i,et[0],et[1]);return t(function(){ot.hasValue=!0,ot.value=at},[at]),v(at),at};withSelector.exports=useSyncExternalStoreWithSelector_production_min;var withSelectorExports=withSelector.exports,React$3="default"in ReactOriginal?React$4:ReactOriginal,ContextKey=Symbol.for("react-redux-context"),gT=typeof globalThis<"u"?globalThis:{};function getContext(){if(!React$3.createContext)return{};const i=gT[ContextKey]??(gT[ContextKey]=new Map);let s=i.get(React$3.createContext);return s||(s=React$3.createContext(null),i.set(React$3.createContext,s)),s}var ReactReduxContext=getContext(),notInitialized=()=>{throw new Error("uSES not initialized!")};function createReduxContextHook(i=ReactReduxContext){return function(){return React$3.useContext(i)}}var useReduxContext=createReduxContextHook(),useSyncExternalStoreWithSelector=notInitialized,initializeUseSelector=i=>{useSyncExternalStoreWithSelector=i},refEquality=(i,s)=>i===s;function createSelectorHook(i=ReactReduxContext){const s=i===ReactReduxContext?useReduxContext:createReduxContextHook(i),o=(a,rt={})=>{const{equalityFn:et=refEquality,devModeChecks:ot={}}=typeof rt=="function"?{equalityFn:rt}:rt,{store:at,subscription:nt,getServerState:it,stabilityCheck:j,identityFunctionCheck:_}=s();React$3.useRef(!0);const $=React$3.useCallback({[a.name](st){return a(st)}}[a.name],[a,j,ot.stabilityCheck]),tt=useSyncExternalStoreWithSelector(nt.addNestedSub,at.getState,it||at.getState,$,et);return React$3.useDebugValue(tt),tt};return Object.assign(o,{withTypes:()=>o}),o}var useSelector=createSelectorHook();function defaultNoopBatch(i){i()}function createListenerCollection(){let i=null,s=null;return{clear(){i=null,s=null},notify(){defaultNoopBatch(()=>{let o=i;for(;o;)o.callback(),o=o.next})},get(){const o=[];let a=i;for(;a;)o.push(a),a=a.next;return o},subscribe(o){let a=!0;const rt=s={callback:o,next:null,prev:s};return rt.prev?rt.prev.next=rt:i=rt,function(){!a||i===null||(a=!1,rt.next?rt.next.prev=rt.prev:s=rt.prev,rt.prev?rt.prev.next=rt.next:i=rt.next)}}}}var nullListeners={notify(){},get:()=>[]};function createSubscription(i,s){let o,a=nullListeners,rt=0,et=!1;function ot(lt){j();const ct=a.subscribe(lt);let ht=!1;return()=>{ht||(ht=!0,ct(),_())}}function at(){a.notify()}function nt(){st.onStateChange&&st.onStateChange()}function it(){return et}function j(){rt++,o||(o=i.subscribe(nt),a=createListenerCollection())}function _(){rt--,o&&rt===0&&(o(),o=void 0,a.clear(),a=nullListeners)}function $(){et||(et=!0,j())}function tt(){et&&(et=!1,_())}const st={addNestedSub:ot,notifyNestedSubs:at,handleChangeWrapper:nt,isSubscribed:it,trySubscribe:$,tryUnsubscribe:tt,getListeners:()=>a};return st}var canUseDOM=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",isReactNative=typeof navigator<"u"&&navigator.product==="ReactNative",useIsomorphicLayoutEffect=canUseDOM||isReactNative?React$3.useLayoutEffect:React$3.useEffect;function Provider({store:i,context:s,children:o,serverState:a,stabilityCheck:rt="once",identityFunctionCheck:et="once"}){const ot=React$3.useMemo(()=>{const it=createSubscription(i);return{store:i,subscription:it,getServerState:a?()=>a:void 0,stabilityCheck:rt,identityFunctionCheck:et}},[i,a,rt,et]),at=React$3.useMemo(()=>i.getState(),[i]);useIsomorphicLayoutEffect(()=>{const{subscription:it}=ot;return it.onStateChange=it.notifyNestedSubs,it.trySubscribe(),at!==i.getState()&&it.notifyNestedSubs(),()=>{it.tryUnsubscribe(),it.onStateChange=void 0}},[ot,at]);const nt=s||ReactReduxContext;return React$3.createElement(nt.Provider,{value:ot},o)}var Provider_default=Provider;function createStoreHook(i=ReactReduxContext){const s=i===ReactReduxContext?useReduxContext:createReduxContextHook(i),o=()=>{const{store:a}=s();return a};return Object.assign(o,{withTypes:()=>o}),o}var useStore=createStoreHook();function createDispatchHook(i=ReactReduxContext){const s=i===ReactReduxContext?useStore:createStoreHook(i),o=()=>s().dispatch;return Object.assign(o,{withTypes:()=>o}),o}var useDispatch=createDispatchHook();initializeUseSelector(withSelectorExports.useSyncExternalStoreWithSelector);const scriptRel="modulepreload",assetsURL=function(i){return"/seker/"+i},seen={},__vitePreload=function(s,o,a){let rt=Promise.resolve();if(o&&o.length>0){document.getElementsByTagName("link");const et=document.querySelector("meta[property=csp-nonce]"),ot=(et==null?void 0:et.nonce)||(et==null?void 0:et.getAttribute("nonce"));rt=Promise.all(o.map(at=>{if(at=assetsURL(at),at in seen)return;seen[at]=!0;const nt=at.endsWith(".css"),it=nt?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${at}"]${it}`))return;const j=document.createElement("link");if(j.rel=nt?"stylesheet":scriptRel,nt||(j.as="script",j.crossOrigin=""),j.href=at,ot&&j.setAttribute("nonce",ot),document.head.appendChild(j),nt)return new Promise((_,$)=>{j.addEventListener("load",_),j.addEventListener("error",()=>$(new Error(`Unable to preload CSS for ${at}`)))})}))}return rt.then(()=>s()).catch(et=>{const ot=new Event("vite:preloadError",{cancelable:!0});if(ot.payload=et,window.dispatchEvent(ot),!ot.defaultPrevented)throw et})};var lzString={exports:{}};lzString.exports;(function(i){var s=function(){var o=String.fromCharCode,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",rt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",et={};function ot(nt,it){if(!et[nt]){et[nt]={};for(var j=0;j>>8,j[_*2+1]=tt%256}return j},decompressFromUint8Array:function(nt){if(nt==null)return at.decompress(nt);for(var it=new Array(nt.length/2),j=0,_=it.length;j<_;j++)it[j]=nt[j*2]*256+nt[j*2+1];var $=[];return it.forEach(function(tt){$.push(o(tt))}),at.decompress($.join(""))},compressToEncodedURIComponent:function(nt){return nt==null?"":at._compress(nt,6,function(it){return rt.charAt(it)})},decompressFromEncodedURIComponent:function(nt){return nt==null?"":nt==""?null:(nt=nt.replace(/ /g,"+"),at._decompress(nt.length,32,function(it){return ot(rt,nt.charAt(it))}))},compress:function(nt){return at._compress(nt,16,function(it){return o(it)})},_compress:function(nt,it,j){if(nt==null)return"";var _,$,tt={},st={},lt="",ct="",ht="",ut=2,pt=3,mt=2,gt=[],dt=0,St=0,xt;for(xt=0;xt>1}else{for($=1,_=0;_>1}ut--,ut==0&&(ut=Math.pow(2,mt),mt++),delete st[ht]}else for($=tt[ht],_=0;_>1;ut--,ut==0&&(ut=Math.pow(2,mt),mt++),tt[ct]=pt++,ht=String(lt)}if(ht!==""){if(Object.prototype.hasOwnProperty.call(st,ht)){if(ht.charCodeAt(0)<256){for(_=0;_>1}else{for($=1,_=0;_>1}ut--,ut==0&&(ut=Math.pow(2,mt),mt++),delete st[ht]}else for($=tt[ht],_=0;_>1;ut--,ut==0&&(ut=Math.pow(2,mt),mt++)}for($=2,_=0;_>1;for(;;)if(dt=dt<<1,St==it-1){gt.push(j(dt));break}else St++;return gt.join("")},decompress:function(nt){return nt==null?"":nt==""?null:at._decompress(nt.length,32768,function(it){return nt.charCodeAt(it)})},_decompress:function(nt,it,j){var _=[],$=4,tt=4,st=3,lt="",ct=[],ht,ut,pt,mt,gt,dt,St,xt={val:j(0),position:it,index:1};for(ht=0;ht<3;ht+=1)_[ht]=ht;for(pt=0,gt=Math.pow(2,2),dt=1;dt!=gt;)mt=xt.val&xt.position,xt.position>>=1,xt.position==0&&(xt.position=it,xt.val=j(xt.index++)),pt|=(mt>0?1:0)*dt,dt<<=1;switch(pt){case 0:for(pt=0,gt=Math.pow(2,8),dt=1;dt!=gt;)mt=xt.val&xt.position,xt.position>>=1,xt.position==0&&(xt.position=it,xt.val=j(xt.index++)),pt|=(mt>0?1:0)*dt,dt<<=1;St=o(pt);break;case 1:for(pt=0,gt=Math.pow(2,16),dt=1;dt!=gt;)mt=xt.val&xt.position,xt.position>>=1,xt.position==0&&(xt.position=it,xt.val=j(xt.index++)),pt|=(mt>0?1:0)*dt,dt<<=1;St=o(pt);break;case 2:return""}for(_[3]=St,ut=St,ct.push(St);;){if(xt.index>nt)return"";for(pt=0,gt=Math.pow(2,st),dt=1;dt!=gt;)mt=xt.val&xt.position,xt.position>>=1,xt.position==0&&(xt.position=it,xt.val=j(xt.index++)),pt|=(mt>0?1:0)*dt,dt<<=1;switch(St=pt){case 0:for(pt=0,gt=Math.pow(2,8),dt=1;dt!=gt;)mt=xt.val&xt.position,xt.position>>=1,xt.position==0&&(xt.position=it,xt.val=j(xt.index++)),pt|=(mt>0?1:0)*dt,dt<<=1;_[tt++]=o(pt),St=tt-1,$--;break;case 1:for(pt=0,gt=Math.pow(2,16),dt=1;dt!=gt;)mt=xt.val&xt.position,xt.position>>=1,xt.position==0&&(xt.position=it,xt.val=j(xt.index++)),pt|=(mt>0?1:0)*dt,dt<<=1;_[tt++]=o(pt),St=tt-1,$--;break;case 2:return ct.join("")}if($==0&&($=Math.pow(2,st),st++),_[St])lt=_[St];else if(St===tt)lt=ut+ut.charAt(0);else return null;ct.push(lt),_[tt++]=ut+lt.charAt(0),$--,ut=lt,$==0&&($=Math.pow(2,st),st++)}}};return at}();i!=null?i.exports=s:typeof angular<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return s})})(lzString);var lzStringExports=lzString.exports;const token="%[a-f0-9]{2}",singleMatcher=new RegExp("("+token+")|([^%]+?)","gi"),multiMatcher=new RegExp("("+token+")+","gi");function decodeComponents(i,s){try{return[decodeURIComponent(i.join(""))]}catch{}if(i.length===1)return i;s=s||1;const o=i.slice(0,s),a=i.slice(s);return Array.prototype.concat.call([],decodeComponents(o),decodeComponents(a))}function decode$1(i){try{return decodeURIComponent(i)}catch{let s=i.match(singleMatcher)||[];for(let o=1;oi==null,strictUriEncode=i=>encodeURIComponent(i).replaceAll(/[!'()*]/g,s=>`%${s.charCodeAt(0).toString(16).toUpperCase()}`),encodeFragmentIdentifier=Symbol("encodeFragmentIdentifier");function encoderForArrayFormat(i){switch(i.arrayFormat){case"index":return s=>(o,a)=>{const rt=o.length;return a===void 0||i.skipNull&&a===null||i.skipEmptyString&&a===""?o:a===null?[...o,[encode(s,i),"[",rt,"]"].join("")]:[...o,[encode(s,i),"[",encode(rt,i),"]=",encode(a,i)].join("")]};case"bracket":return s=>(o,a)=>a===void 0||i.skipNull&&a===null||i.skipEmptyString&&a===""?o:a===null?[...o,[encode(s,i),"[]"].join("")]:[...o,[encode(s,i),"[]=",encode(a,i)].join("")];case"colon-list-separator":return s=>(o,a)=>a===void 0||i.skipNull&&a===null||i.skipEmptyString&&a===""?o:a===null?[...o,[encode(s,i),":list="].join("")]:[...o,[encode(s,i),":list=",encode(a,i)].join("")];case"comma":case"separator":case"bracket-separator":{const s=i.arrayFormat==="bracket-separator"?"[]=":"=";return o=>(a,rt)=>rt===void 0||i.skipNull&&rt===null||i.skipEmptyString&&rt===""?a:(rt=rt===null?"":rt,a.length===0?[[encode(o,i),s,encode(rt,i)].join("")]:[[a,encode(rt,i)].join(i.arrayFormatSeparator)])}default:return s=>(o,a)=>a===void 0||i.skipNull&&a===null||i.skipEmptyString&&a===""?o:a===null?[...o,encode(s,i)]:[...o,[encode(s,i),"=",encode(a,i)].join("")]}}function parserForArrayFormat(i){let s;switch(i.arrayFormat){case"index":return(o,a,rt)=>{if(s=/\[(\d*)]$/.exec(o),o=o.replace(/\[\d*]$/,""),!s){rt[o]=a;return}rt[o]===void 0&&(rt[o]={}),rt[o][s[1]]=a};case"bracket":return(o,a,rt)=>{if(s=/(\[])$/.exec(o),o=o.replace(/\[]$/,""),!s){rt[o]=a;return}if(rt[o]===void 0){rt[o]=[a];return}rt[o]=[...rt[o],a]};case"colon-list-separator":return(o,a,rt)=>{if(s=/(:list)$/.exec(o),o=o.replace(/:list$/,""),!s){rt[o]=a;return}if(rt[o]===void 0){rt[o]=[a];return}rt[o]=[...rt[o],a]};case"comma":case"separator":return(o,a,rt)=>{const et=typeof a=="string"&&a.includes(i.arrayFormatSeparator),ot=typeof a=="string"&&!et&&decode(a,i).includes(i.arrayFormatSeparator);a=ot?decode(a,i):a;const at=et||ot?a.split(i.arrayFormatSeparator).map(nt=>decode(nt,i)):a===null?a:decode(a,i);rt[o]=at};case"bracket-separator":return(o,a,rt)=>{const et=/(\[])$/.test(o);if(o=o.replace(/\[]$/,""),!et){rt[o]=a&&decode(a,i);return}const ot=a===null?[]:a.split(i.arrayFormatSeparator).map(at=>decode(at,i));if(rt[o]===void 0){rt[o]=ot;return}rt[o]=[...rt[o],...ot]};default:return(o,a,rt)=>{if(rt[o]===void 0){rt[o]=a;return}rt[o]=[...[rt[o]].flat(),a]}}}function validateArrayFormatSeparator(i){if(typeof i!="string"||i.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function encode(i,s){return s.encode?s.strict?strictUriEncode(i):encodeURIComponent(i):i}function decode(i,s){return s.decode?decodeUriComponent(i):i}function keysSorter(i){return Array.isArray(i)?i.sort():typeof i=="object"?keysSorter(Object.keys(i)).sort((s,o)=>Number(s)-Number(o)).map(s=>i[s]):i}function removeHash(i){const s=i.indexOf("#");return s!==-1&&(i=i.slice(0,s)),i}function getHash(i){let s="";const o=i.indexOf("#");return o!==-1&&(s=i.slice(o)),s}function parseValue(i,s,o){return o==="string"&&typeof i=="string"?i:typeof o=="function"&&typeof i=="string"?o(i):s.parseBooleans&&i!==null&&(i.toLowerCase()==="true"||i.toLowerCase()==="false")?i.toLowerCase()==="true":o==="number"&&!Number.isNaN(Number(i))&&typeof i=="string"&&i.trim()!==""||s.parseNumbers&&!Number.isNaN(Number(i))&&typeof i=="string"&&i.trim()!==""?Number(i):i}function extract(i){i=removeHash(i);const s=i.indexOf("?");return s===-1?"":i.slice(s+1)}function parse(i,s){s={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,types:Object.create(null),...s},validateArrayFormatSeparator(s.arrayFormatSeparator);const o=parserForArrayFormat(s),a=Object.create(null);if(typeof i!="string"||(i=i.trim().replace(/^[?#&]/,""),!i))return a;for(const rt of i.split("&")){if(rt==="")continue;const et=s.decode?rt.replaceAll("+"," "):rt;let[ot,at]=splitOnFirst(et,"=");ot===void 0&&(ot=et),at=at===void 0?null:["comma","separator","bracket-separator"].includes(s.arrayFormat)?at:decode(at,s),o(decode(ot,s),at,a)}for(const[rt,et]of Object.entries(a))if(typeof et=="object"&&et!==null&&s.types[rt]!=="string")for(const[ot,at]of Object.entries(et)){const nt=s.types[rt]?s.types[rt].replace("[]",""):void 0;et[ot]=parseValue(at,s,nt)}else typeof et=="object"&&et!==null&&s.types[rt]==="string"?a[rt]=Object.values(et).join(s.arrayFormatSeparator):a[rt]=parseValue(et,s,s.types[rt]);return s.sort===!1?a:(s.sort===!0?Object.keys(a).sort():Object.keys(a).sort(s.sort)).reduce((rt,et)=>{const ot=a[et];return rt[et]=ot&&typeof ot=="object"&&!Array.isArray(ot)?keysSorter(ot):ot,rt},Object.create(null))}function stringify$3(i,s){if(!i)return"";s={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...s},validateArrayFormatSeparator(s.arrayFormatSeparator);const o=ot=>s.skipNull&&isNullOrUndefined(i[ot])||s.skipEmptyString&&i[ot]==="",a=encoderForArrayFormat(s),rt={};for(const[ot,at]of Object.entries(i))o(ot)||(rt[ot]=at);const et=Object.keys(rt);return s.sort!==!1&&et.sort(s.sort),et.map(ot=>{const at=i[ot];return at===void 0?"":at===null?encode(ot,s):Array.isArray(at)?at.length===0&&s.arrayFormat==="bracket-separator"?encode(ot,s)+"[]":at.reduce(a(ot),[]).join("&"):encode(ot,s)+"="+encode(at,s)}).filter(ot=>ot.length>0).join("&")}function parseUrl(i,s){var rt;s={decode:!0,...s};let[o,a]=splitOnFirst(i,"#");return o===void 0&&(o=i),{url:((rt=o==null?void 0:o.split("?"))==null?void 0:rt[0])??"",query:parse(extract(i),s),...s&&s.parseFragmentIdentifier&&a?{fragmentIdentifier:decode(a,s)}:{}}}function stringifyUrl(i,s){s={encode:!0,strict:!0,[encodeFragmentIdentifier]:!0,...s};const o=removeHash(i.url).split("?")[0]||"",a=extract(i.url),rt={...parse(a,{sort:!1}),...i.query};let et=stringify$3(rt,s);et&&(et=`?${et}`);let ot=getHash(i.url);if(typeof i.fragmentIdentifier=="string"){const at=new URL(o);at.hash=i.fragmentIdentifier,ot=s[encodeFragmentIdentifier]?at.hash:`#${i.fragmentIdentifier}`}return`${o}${et}${ot}`}function pick(i,s,o){o={parseFragmentIdentifier:!0,[encodeFragmentIdentifier]:!1,...o};const{url:a,query:rt,fragmentIdentifier:et}=parseUrl(i,o);return stringifyUrl({url:a,query:includeKeys(rt,s),fragmentIdentifier:et},o)}function exclude(i,s,o){const a=Array.isArray(s)?rt=>!s.includes(rt):(rt,et)=>!s(rt,et);return pick(i,a,o)}const queryString=Object.freeze(Object.defineProperty({__proto__:null,exclude,extract,parse,parseUrl,pick,stringify:stringify$3,stringifyUrl},Symbol.toStringTag,{value:"Module"}));var lib$1={},ace$4={},ace$3={exports:{}};(function(i,s){(function(){var o="ace",a=function(){return this}();!a&&typeof window<"u"&&(a=window);var rt=function(j,_,$){if(typeof j!="string"){rt.original?rt.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&($=_),rt.modules[j]||(rt.payloads[j]=$,rt.modules[j]=null)};rt.modules={},rt.payloads={};var et=function(j,_,$){if(typeof _=="string"){var tt=nt(j,_);if(tt!=null)return $&&$(),tt}else if(Object.prototype.toString.call(_)==="[object Array]"){for(var st=[],lt=0,ct=_.length;ltnt.length)&&(at=nt.length),at-=ot.length;var it=nt.indexOf(ot,at);return it!==-1&&it===at}),String.prototype.repeat||et(String.prototype,"repeat",function(ot){for(var at="",nt=this;ot>0;)ot&1&&(at+=nt),(ot>>=1)&&(nt+=nt);return at}),String.prototype.includes||et(String.prototype,"includes",function(ot,at){return this.indexOf(ot,at)!=-1}),Object.assign||(Object.assign=function(ot){if(ot==null)throw new TypeError("Cannot convert undefined or null to object");for(var at=Object(ot),nt=1;nt>>0,it=arguments[1],j=it>>0,_=j<0?Math.max(nt+j,0):Math.min(j,nt),$=arguments[2],tt=$===void 0?nt:$>>0,st=tt<0?Math.max(nt+tt,0):Math.min(tt,nt);_0;)nt&1&&(it+=at),(nt>>=1)&&(at+=at);return it};var et=/^\s\s*/,ot=/\s\s*$/;a.stringTrimLeft=function(at){return at.replace(et,"")},a.stringTrimRight=function(at){return at.replace(ot,"")},a.copyObject=function(at){var nt={};for(var it in at)nt[it]=at[it];return nt},a.copyArray=function(at){for(var nt=[],it=0,j=at.length;it65535?2:1}}),ace.define("ace/lib/useragent",["require","exports","module"],function(o,a,rt){a.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},a.getOS=function(){return a.isMac?a.OS.MAC:a.isLinux?a.OS.LINUX:a.OS.WINDOWS};var et=typeof navigator=="object"?navigator:{},ot=(/mac|win|linux/i.exec(et.platform)||["other"])[0].toLowerCase(),at=et.userAgent||"",nt=et.appName||"";a.isWin=ot=="win",a.isMac=ot=="mac",a.isLinux=ot=="linux",a.isIE=nt=="Microsoft Internet Explorer"||nt.indexOf("MSAppHost")>=0?parseFloat((at.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((at.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),a.isOldIE=a.isIE&&a.isIE<9,a.isGecko=a.isMozilla=at.match(/ Gecko\/\d+/),a.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",a.isWebKit=parseFloat(at.split("WebKit/")[1])||void 0,a.isChrome=parseFloat(at.split(" Chrome/")[1])||void 0,a.isSafari=parseFloat(at.split(" Safari/")[1])&&!a.isChrome||void 0,a.isEdge=parseFloat(at.split(" Edge/")[1])||void 0,a.isAIR=at.indexOf("AdobeAIR")>=0,a.isAndroid=at.indexOf("Android")>=0,a.isChromeOS=at.indexOf(" CrOS ")>=0,a.isIOS=/iPad|iPhone|iPod/.test(at)&&!window.MSStream,a.isIOS&&(a.isMac=!0),a.isMobile=a.isIOS||a.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(o,a,rt){var et=o("./useragent"),ot="http://www.w3.org/1999/xhtml";a.buildDom=function $(tt,st,lt){if(typeof tt=="string"&&tt){var ct=document.createTextNode(tt);return st&&st.appendChild(ct),ct}if(!Array.isArray(tt))return tt&&tt.appendChild&&st&&st.appendChild(tt),tt;if(typeof tt[0]!="string"||!tt[0]){for(var ht=[],ut=0;ut"u")){if(nt){if(st)it();else if(st===!1)return nt.push([$,tt])}if(!at){var lt=st;!st||!st.getRootNode?lt=document:(lt=st.getRootNode(),(!lt||lt==st)&&(lt=document));var ct=lt.ownerDocument||lt;if(tt&&a.hasCssString(tt,lt))return null;tt&&($+=` -/*# sourceURL=ace/css/`+tt+" */");var ht=a.createElement("style");ht.appendChild(ct.createTextNode($)),tt&&(ht.id=tt),lt==ct&&(lt=a.getDocumentHead(ct)),lt.insertBefore(ht,lt.firstChild)}}}if(a.importCssString=j,a.importCssStylsheet=function($,tt){a.buildDom(["link",{rel:"stylesheet",href:$}],a.getDocumentHead(tt))},a.scrollbarWidth=function($){var tt=a.createElement("ace_inner");tt.style.width="100%",tt.style.minWidth="0px",tt.style.height="200px",tt.style.display="block";var st=a.createElement("ace_outer"),lt=st.style;lt.position="absolute",lt.left="-10000px",lt.overflow="hidden",lt.width="200px",lt.minWidth="0px",lt.height="150px",lt.display="block",st.appendChild(tt);var ct=$&&$.documentElement||document&&document.documentElement;if(!ct)return 0;ct.appendChild(st);var ht=tt.offsetWidth;lt.overflow="scroll";var ut=tt.offsetWidth;return ht===ut&&(ut=st.clientWidth),ct.removeChild(st),ht-ut},a.computedStyle=function($,tt){return window.getComputedStyle($,"")||{}},a.setStyle=function($,tt,st){$[tt]!==st&&($[tt]=st)},a.HAS_CSS_ANIMATION=!1,a.HAS_CSS_TRANSFORMS=!1,a.HI_DPI=et.isWin?typeof window<"u"&&window.devicePixelRatio>=1.5:!0,et.isChromeOS&&(a.HI_DPI=!1),typeof document<"u"){var _=document.createElement("div");a.HI_DPI&&_.style.transform!==void 0&&(a.HAS_CSS_TRANSFORMS=!0),!et.isEdge&&typeof _.style.animationName<"u"&&(a.HAS_CSS_ANIMATION=!0),_=null}a.HAS_CSS_TRANSFORMS?a.translate=function($,tt,st){$.style.transform="translate("+Math.round(tt)+"px, "+Math.round(st)+"px)"}:a.translate=function($,tt,st){$.style.top=Math.round(st)+"px",$.style.left=Math.round(tt)+"px"}}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(o,a,rt){/* + */var g=reactExports;function n(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var p=typeof Object.is=="function"?Object.is:n,q=g.useSyncExternalStore,r=g.useRef,t=g.useEffect,u=g.useMemo,v=g.useDebugValue;useSyncExternalStoreWithSelector_production_min.useSyncExternalStoreWithSelector=function(i,s,o,a,rt){var tt=r(null);if(tt.current===null){var ot={hasValue:!1,value:null};tt.current=ot}else ot=tt.current;tt=u(function(){function nt(et){if(!it){if(it=!0,j=et,et=a(et),rt!==void 0&&ot.hasValue){var st=ot.value;if(rt(st,et))return _=st}return _=et}if(st=_,p(j,et))return st;var lt=a(et);return rt!==void 0&&rt(st,lt)?st:(j=et,_=lt)}var it=!1,j,_,$=o===void 0?null:o;return[function(){return nt(s())},$===null?void 0:function(){return nt($())}]},[s,o,a,rt]);var at=q(i,tt[0],tt[1]);return t(function(){ot.hasValue=!0,ot.value=at},[at]),v(at),at};withSelector.exports=useSyncExternalStoreWithSelector_production_min;var withSelectorExports=withSelector.exports,React$3="default"in ReactOriginal?React$4:ReactOriginal,ContextKey=Symbol.for("react-redux-context"),gT=typeof globalThis<"u"?globalThis:{};function getContext(){if(!React$3.createContext)return{};const i=gT[ContextKey]??(gT[ContextKey]=new Map);let s=i.get(React$3.createContext);return s||(s=React$3.createContext(null),i.set(React$3.createContext,s)),s}var ReactReduxContext=getContext(),notInitialized=()=>{throw new Error("uSES not initialized!")};function createReduxContextHook(i=ReactReduxContext){return function(){return React$3.useContext(i)}}var useReduxContext=createReduxContextHook(),useSyncExternalStoreWithSelector=notInitialized,initializeUseSelector=i=>{useSyncExternalStoreWithSelector=i},refEquality=(i,s)=>i===s;function createSelectorHook(i=ReactReduxContext){const s=i===ReactReduxContext?useReduxContext:createReduxContextHook(i),o=(a,rt={})=>{const{equalityFn:tt=refEquality,devModeChecks:ot={}}=typeof rt=="function"?{equalityFn:rt}:rt,{store:at,subscription:nt,getServerState:it,stabilityCheck:j,identityFunctionCheck:_}=s();React$3.useRef(!0);const $=React$3.useCallback({[a.name](st){return a(st)}}[a.name],[a,j,ot.stabilityCheck]),et=useSyncExternalStoreWithSelector(nt.addNestedSub,at.getState,it||at.getState,$,tt);return React$3.useDebugValue(et),et};return Object.assign(o,{withTypes:()=>o}),o}var useSelector=createSelectorHook();function defaultNoopBatch(i){i()}function createListenerCollection(){let i=null,s=null;return{clear(){i=null,s=null},notify(){defaultNoopBatch(()=>{let o=i;for(;o;)o.callback(),o=o.next})},get(){const o=[];let a=i;for(;a;)o.push(a),a=a.next;return o},subscribe(o){let a=!0;const rt=s={callback:o,next:null,prev:s};return rt.prev?rt.prev.next=rt:i=rt,function(){!a||i===null||(a=!1,rt.next?rt.next.prev=rt.prev:s=rt.prev,rt.prev?rt.prev.next=rt.next:i=rt.next)}}}}var nullListeners={notify(){},get:()=>[]};function createSubscription(i,s){let o,a=nullListeners,rt=0,tt=!1;function ot(lt){j();const ct=a.subscribe(lt);let ht=!1;return()=>{ht||(ht=!0,ct(),_())}}function at(){a.notify()}function nt(){st.onStateChange&&st.onStateChange()}function it(){return tt}function j(){rt++,o||(o=i.subscribe(nt),a=createListenerCollection())}function _(){rt--,o&&rt===0&&(o(),o=void 0,a.clear(),a=nullListeners)}function $(){tt||(tt=!0,j())}function et(){tt&&(tt=!1,_())}const st={addNestedSub:ot,notifyNestedSubs:at,handleChangeWrapper:nt,isSubscribed:it,trySubscribe:$,tryUnsubscribe:et,getListeners:()=>a};return st}var canUseDOM=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",isReactNative=typeof navigator<"u"&&navigator.product==="ReactNative",useIsomorphicLayoutEffect=canUseDOM||isReactNative?React$3.useLayoutEffect:React$3.useEffect;function Provider({store:i,context:s,children:o,serverState:a,stabilityCheck:rt="once",identityFunctionCheck:tt="once"}){const ot=React$3.useMemo(()=>{const it=createSubscription(i);return{store:i,subscription:it,getServerState:a?()=>a:void 0,stabilityCheck:rt,identityFunctionCheck:tt}},[i,a,rt,tt]),at=React$3.useMemo(()=>i.getState(),[i]);useIsomorphicLayoutEffect(()=>{const{subscription:it}=ot;return it.onStateChange=it.notifyNestedSubs,it.trySubscribe(),at!==i.getState()&&it.notifyNestedSubs(),()=>{it.tryUnsubscribe(),it.onStateChange=void 0}},[ot,at]);const nt=s||ReactReduxContext;return React$3.createElement(nt.Provider,{value:ot},o)}var Provider_default=Provider;function createStoreHook(i=ReactReduxContext){const s=i===ReactReduxContext?useReduxContext:createReduxContextHook(i),o=()=>{const{store:a}=s();return a};return Object.assign(o,{withTypes:()=>o}),o}var useStore=createStoreHook();function createDispatchHook(i=ReactReduxContext){const s=i===ReactReduxContext?useStore:createStoreHook(i),o=()=>s().dispatch;return Object.assign(o,{withTypes:()=>o}),o}var useDispatch=createDispatchHook();initializeUseSelector(withSelectorExports.useSyncExternalStoreWithSelector);const scriptRel="modulepreload",assetsURL=function(i){return"/seker/"+i},seen={},__vitePreload=function(s,o,a){let rt=Promise.resolve();if(o&&o.length>0){document.getElementsByTagName("link");const tt=document.querySelector("meta[property=csp-nonce]"),ot=(tt==null?void 0:tt.nonce)||(tt==null?void 0:tt.getAttribute("nonce"));rt=Promise.all(o.map(at=>{if(at=assetsURL(at),at in seen)return;seen[at]=!0;const nt=at.endsWith(".css"),it=nt?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${at}"]${it}`))return;const j=document.createElement("link");if(j.rel=nt?"stylesheet":scriptRel,nt||(j.as="script",j.crossOrigin=""),j.href=at,ot&&j.setAttribute("nonce",ot),document.head.appendChild(j),nt)return new Promise((_,$)=>{j.addEventListener("load",_),j.addEventListener("error",()=>$(new Error(`Unable to preload CSS for ${at}`)))})}))}return rt.then(()=>s()).catch(tt=>{const ot=new Event("vite:preloadError",{cancelable:!0});if(ot.payload=tt,window.dispatchEvent(ot),!ot.defaultPrevented)throw tt})};var lzString={exports:{}};lzString.exports;(function(i){var s=function(){var o=String.fromCharCode,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",rt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",tt={};function ot(nt,it){if(!tt[nt]){tt[nt]={};for(var j=0;j>>8,j[_*2+1]=et%256}return j},decompressFromUint8Array:function(nt){if(nt==null)return at.decompress(nt);for(var it=new Array(nt.length/2),j=0,_=it.length;j<_;j++)it[j]=nt[j*2]*256+nt[j*2+1];var $=[];return it.forEach(function(et){$.push(o(et))}),at.decompress($.join(""))},compressToEncodedURIComponent:function(nt){return nt==null?"":at._compress(nt,6,function(it){return rt.charAt(it)})},decompressFromEncodedURIComponent:function(nt){return nt==null?"":nt==""?null:(nt=nt.replace(/ /g,"+"),at._decompress(nt.length,32,function(it){return ot(rt,nt.charAt(it))}))},compress:function(nt){return at._compress(nt,16,function(it){return o(it)})},_compress:function(nt,it,j){if(nt==null)return"";var _,$,et={},st={},lt="",ct="",ht="",ut=2,pt=3,mt=2,gt=[],dt=0,St=0,xt;for(xt=0;xt>1}else{for($=1,_=0;_>1}ut--,ut==0&&(ut=Math.pow(2,mt),mt++),delete st[ht]}else for($=et[ht],_=0;_>1;ut--,ut==0&&(ut=Math.pow(2,mt),mt++),et[ct]=pt++,ht=String(lt)}if(ht!==""){if(Object.prototype.hasOwnProperty.call(st,ht)){if(ht.charCodeAt(0)<256){for(_=0;_>1}else{for($=1,_=0;_>1}ut--,ut==0&&(ut=Math.pow(2,mt),mt++),delete st[ht]}else for($=et[ht],_=0;_>1;ut--,ut==0&&(ut=Math.pow(2,mt),mt++)}for($=2,_=0;_>1;for(;;)if(dt=dt<<1,St==it-1){gt.push(j(dt));break}else St++;return gt.join("")},decompress:function(nt){return nt==null?"":nt==""?null:at._decompress(nt.length,32768,function(it){return nt.charCodeAt(it)})},_decompress:function(nt,it,j){var _=[],$=4,et=4,st=3,lt="",ct=[],ht,ut,pt,mt,gt,dt,St,xt={val:j(0),position:it,index:1};for(ht=0;ht<3;ht+=1)_[ht]=ht;for(pt=0,gt=Math.pow(2,2),dt=1;dt!=gt;)mt=xt.val&xt.position,xt.position>>=1,xt.position==0&&(xt.position=it,xt.val=j(xt.index++)),pt|=(mt>0?1:0)*dt,dt<<=1;switch(pt){case 0:for(pt=0,gt=Math.pow(2,8),dt=1;dt!=gt;)mt=xt.val&xt.position,xt.position>>=1,xt.position==0&&(xt.position=it,xt.val=j(xt.index++)),pt|=(mt>0?1:0)*dt,dt<<=1;St=o(pt);break;case 1:for(pt=0,gt=Math.pow(2,16),dt=1;dt!=gt;)mt=xt.val&xt.position,xt.position>>=1,xt.position==0&&(xt.position=it,xt.val=j(xt.index++)),pt|=(mt>0?1:0)*dt,dt<<=1;St=o(pt);break;case 2:return""}for(_[3]=St,ut=St,ct.push(St);;){if(xt.index>nt)return"";for(pt=0,gt=Math.pow(2,st),dt=1;dt!=gt;)mt=xt.val&xt.position,xt.position>>=1,xt.position==0&&(xt.position=it,xt.val=j(xt.index++)),pt|=(mt>0?1:0)*dt,dt<<=1;switch(St=pt){case 0:for(pt=0,gt=Math.pow(2,8),dt=1;dt!=gt;)mt=xt.val&xt.position,xt.position>>=1,xt.position==0&&(xt.position=it,xt.val=j(xt.index++)),pt|=(mt>0?1:0)*dt,dt<<=1;_[et++]=o(pt),St=et-1,$--;break;case 1:for(pt=0,gt=Math.pow(2,16),dt=1;dt!=gt;)mt=xt.val&xt.position,xt.position>>=1,xt.position==0&&(xt.position=it,xt.val=j(xt.index++)),pt|=(mt>0?1:0)*dt,dt<<=1;_[et++]=o(pt),St=et-1,$--;break;case 2:return ct.join("")}if($==0&&($=Math.pow(2,st),st++),_[St])lt=_[St];else if(St===et)lt=ut+ut.charAt(0);else return null;ct.push(lt),_[et++]=ut+lt.charAt(0),$--,ut=lt,$==0&&($=Math.pow(2,st),st++)}}};return at}();i!=null?i.exports=s:typeof angular<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return s})})(lzString);var lzStringExports=lzString.exports;const token="%[a-f0-9]{2}",singleMatcher=new RegExp("("+token+")|([^%]+?)","gi"),multiMatcher=new RegExp("("+token+")+","gi");function decodeComponents(i,s){try{return[decodeURIComponent(i.join(""))]}catch{}if(i.length===1)return i;s=s||1;const o=i.slice(0,s),a=i.slice(s);return Array.prototype.concat.call([],decodeComponents(o),decodeComponents(a))}function decode$1(i){try{return decodeURIComponent(i)}catch{let s=i.match(singleMatcher)||[];for(let o=1;oi==null,strictUriEncode=i=>encodeURIComponent(i).replaceAll(/[!'()*]/g,s=>`%${s.charCodeAt(0).toString(16).toUpperCase()}`),encodeFragmentIdentifier=Symbol("encodeFragmentIdentifier");function encoderForArrayFormat(i){switch(i.arrayFormat){case"index":return s=>(o,a)=>{const rt=o.length;return a===void 0||i.skipNull&&a===null||i.skipEmptyString&&a===""?o:a===null?[...o,[encode(s,i),"[",rt,"]"].join("")]:[...o,[encode(s,i),"[",encode(rt,i),"]=",encode(a,i)].join("")]};case"bracket":return s=>(o,a)=>a===void 0||i.skipNull&&a===null||i.skipEmptyString&&a===""?o:a===null?[...o,[encode(s,i),"[]"].join("")]:[...o,[encode(s,i),"[]=",encode(a,i)].join("")];case"colon-list-separator":return s=>(o,a)=>a===void 0||i.skipNull&&a===null||i.skipEmptyString&&a===""?o:a===null?[...o,[encode(s,i),":list="].join("")]:[...o,[encode(s,i),":list=",encode(a,i)].join("")];case"comma":case"separator":case"bracket-separator":{const s=i.arrayFormat==="bracket-separator"?"[]=":"=";return o=>(a,rt)=>rt===void 0||i.skipNull&&rt===null||i.skipEmptyString&&rt===""?a:(rt=rt===null?"":rt,a.length===0?[[encode(o,i),s,encode(rt,i)].join("")]:[[a,encode(rt,i)].join(i.arrayFormatSeparator)])}default:return s=>(o,a)=>a===void 0||i.skipNull&&a===null||i.skipEmptyString&&a===""?o:a===null?[...o,encode(s,i)]:[...o,[encode(s,i),"=",encode(a,i)].join("")]}}function parserForArrayFormat(i){let s;switch(i.arrayFormat){case"index":return(o,a,rt)=>{if(s=/\[(\d*)]$/.exec(o),o=o.replace(/\[\d*]$/,""),!s){rt[o]=a;return}rt[o]===void 0&&(rt[o]={}),rt[o][s[1]]=a};case"bracket":return(o,a,rt)=>{if(s=/(\[])$/.exec(o),o=o.replace(/\[]$/,""),!s){rt[o]=a;return}if(rt[o]===void 0){rt[o]=[a];return}rt[o]=[...rt[o],a]};case"colon-list-separator":return(o,a,rt)=>{if(s=/(:list)$/.exec(o),o=o.replace(/:list$/,""),!s){rt[o]=a;return}if(rt[o]===void 0){rt[o]=[a];return}rt[o]=[...rt[o],a]};case"comma":case"separator":return(o,a,rt)=>{const tt=typeof a=="string"&&a.includes(i.arrayFormatSeparator),ot=typeof a=="string"&&!tt&&decode(a,i).includes(i.arrayFormatSeparator);a=ot?decode(a,i):a;const at=tt||ot?a.split(i.arrayFormatSeparator).map(nt=>decode(nt,i)):a===null?a:decode(a,i);rt[o]=at};case"bracket-separator":return(o,a,rt)=>{const tt=/(\[])$/.test(o);if(o=o.replace(/\[]$/,""),!tt){rt[o]=a&&decode(a,i);return}const ot=a===null?[]:a.split(i.arrayFormatSeparator).map(at=>decode(at,i));if(rt[o]===void 0){rt[o]=ot;return}rt[o]=[...rt[o],...ot]};default:return(o,a,rt)=>{if(rt[o]===void 0){rt[o]=a;return}rt[o]=[...[rt[o]].flat(),a]}}}function validateArrayFormatSeparator(i){if(typeof i!="string"||i.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function encode(i,s){return s.encode?s.strict?strictUriEncode(i):encodeURIComponent(i):i}function decode(i,s){return s.decode?decodeUriComponent(i):i}function keysSorter(i){return Array.isArray(i)?i.sort():typeof i=="object"?keysSorter(Object.keys(i)).sort((s,o)=>Number(s)-Number(o)).map(s=>i[s]):i}function removeHash(i){const s=i.indexOf("#");return s!==-1&&(i=i.slice(0,s)),i}function getHash(i){let s="";const o=i.indexOf("#");return o!==-1&&(s=i.slice(o)),s}function parseValue(i,s,o){return o==="string"&&typeof i=="string"?i:typeof o=="function"&&typeof i=="string"?o(i):s.parseBooleans&&i!==null&&(i.toLowerCase()==="true"||i.toLowerCase()==="false")?i.toLowerCase()==="true":o==="number"&&!Number.isNaN(Number(i))&&typeof i=="string"&&i.trim()!==""||s.parseNumbers&&!Number.isNaN(Number(i))&&typeof i=="string"&&i.trim()!==""?Number(i):i}function extract(i){i=removeHash(i);const s=i.indexOf("?");return s===-1?"":i.slice(s+1)}function parse(i,s){s={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,types:Object.create(null),...s},validateArrayFormatSeparator(s.arrayFormatSeparator);const o=parserForArrayFormat(s),a=Object.create(null);if(typeof i!="string"||(i=i.trim().replace(/^[?#&]/,""),!i))return a;for(const rt of i.split("&")){if(rt==="")continue;const tt=s.decode?rt.replaceAll("+"," "):rt;let[ot,at]=splitOnFirst(tt,"=");ot===void 0&&(ot=tt),at=at===void 0?null:["comma","separator","bracket-separator"].includes(s.arrayFormat)?at:decode(at,s),o(decode(ot,s),at,a)}for(const[rt,tt]of Object.entries(a))if(typeof tt=="object"&&tt!==null&&s.types[rt]!=="string")for(const[ot,at]of Object.entries(tt)){const nt=s.types[rt]?s.types[rt].replace("[]",""):void 0;tt[ot]=parseValue(at,s,nt)}else typeof tt=="object"&&tt!==null&&s.types[rt]==="string"?a[rt]=Object.values(tt).join(s.arrayFormatSeparator):a[rt]=parseValue(tt,s,s.types[rt]);return s.sort===!1?a:(s.sort===!0?Object.keys(a).sort():Object.keys(a).sort(s.sort)).reduce((rt,tt)=>{const ot=a[tt];return rt[tt]=ot&&typeof ot=="object"&&!Array.isArray(ot)?keysSorter(ot):ot,rt},Object.create(null))}function stringify$3(i,s){if(!i)return"";s={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...s},validateArrayFormatSeparator(s.arrayFormatSeparator);const o=ot=>s.skipNull&&isNullOrUndefined(i[ot])||s.skipEmptyString&&i[ot]==="",a=encoderForArrayFormat(s),rt={};for(const[ot,at]of Object.entries(i))o(ot)||(rt[ot]=at);const tt=Object.keys(rt);return s.sort!==!1&&tt.sort(s.sort),tt.map(ot=>{const at=i[ot];return at===void 0?"":at===null?encode(ot,s):Array.isArray(at)?at.length===0&&s.arrayFormat==="bracket-separator"?encode(ot,s)+"[]":at.reduce(a(ot),[]).join("&"):encode(ot,s)+"="+encode(at,s)}).filter(ot=>ot.length>0).join("&")}function parseUrl(i,s){var rt;s={decode:!0,...s};let[o,a]=splitOnFirst(i,"#");return o===void 0&&(o=i),{url:((rt=o==null?void 0:o.split("?"))==null?void 0:rt[0])??"",query:parse(extract(i),s),...s&&s.parseFragmentIdentifier&&a?{fragmentIdentifier:decode(a,s)}:{}}}function stringifyUrl(i,s){s={encode:!0,strict:!0,[encodeFragmentIdentifier]:!0,...s};const o=removeHash(i.url).split("?")[0]||"",a=extract(i.url),rt={...parse(a,{sort:!1}),...i.query};let tt=stringify$3(rt,s);tt&&(tt=`?${tt}`);let ot=getHash(i.url);if(typeof i.fragmentIdentifier=="string"){const at=new URL(o);at.hash=i.fragmentIdentifier,ot=s[encodeFragmentIdentifier]?at.hash:`#${i.fragmentIdentifier}`}return`${o}${tt}${ot}`}function pick(i,s,o){o={parseFragmentIdentifier:!0,[encodeFragmentIdentifier]:!1,...o};const{url:a,query:rt,fragmentIdentifier:tt}=parseUrl(i,o);return stringifyUrl({url:a,query:includeKeys(rt,s),fragmentIdentifier:tt},o)}function exclude(i,s,o){const a=Array.isArray(s)?rt=>!s.includes(rt):(rt,tt)=>!s(rt,tt);return pick(i,a,o)}const queryString=Object.freeze(Object.defineProperty({__proto__:null,exclude,extract,parse,parseUrl,pick,stringify:stringify$3,stringifyUrl},Symbol.toStringTag,{value:"Module"}));var lib$1={},ace$4={},ace$3={exports:{}};(function(i,s){(function(){var o="ace",a=function(){return this}();!a&&typeof window<"u"&&(a=window);var rt=function(j,_,$){if(typeof j!="string"){rt.original?rt.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&($=_),rt.modules[j]||(rt.payloads[j]=$,rt.modules[j]=null)};rt.modules={},rt.payloads={};var tt=function(j,_,$){if(typeof _=="string"){var et=nt(j,_);if(et!=null)return $&&$(),et}else if(Object.prototype.toString.call(_)==="[object Array]"){for(var st=[],lt=0,ct=_.length;ltnt.length)&&(at=nt.length),at-=ot.length;var it=nt.indexOf(ot,at);return it!==-1&&it===at}),String.prototype.repeat||tt(String.prototype,"repeat",function(ot){for(var at="",nt=this;ot>0;)ot&1&&(at+=nt),(ot>>=1)&&(nt+=nt);return at}),String.prototype.includes||tt(String.prototype,"includes",function(ot,at){return this.indexOf(ot,at)!=-1}),Object.assign||(Object.assign=function(ot){if(ot==null)throw new TypeError("Cannot convert undefined or null to object");for(var at=Object(ot),nt=1;nt>>0,it=arguments[1],j=it>>0,_=j<0?Math.max(nt+j,0):Math.min(j,nt),$=arguments[2],et=$===void 0?nt:$>>0,st=et<0?Math.max(nt+et,0):Math.min(et,nt);_0;)nt&1&&(it+=at),(nt>>=1)&&(at+=at);return it};var tt=/^\s\s*/,ot=/\s\s*$/;a.stringTrimLeft=function(at){return at.replace(tt,"")},a.stringTrimRight=function(at){return at.replace(ot,"")},a.copyObject=function(at){var nt={};for(var it in at)nt[it]=at[it];return nt},a.copyArray=function(at){for(var nt=[],it=0,j=at.length;it65535?2:1}}),ace.define("ace/lib/useragent",["require","exports","module"],function(o,a,rt){a.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},a.getOS=function(){return a.isMac?a.OS.MAC:a.isLinux?a.OS.LINUX:a.OS.WINDOWS};var tt=typeof navigator=="object"?navigator:{},ot=(/mac|win|linux/i.exec(tt.platform)||["other"])[0].toLowerCase(),at=tt.userAgent||"",nt=tt.appName||"";a.isWin=ot=="win",a.isMac=ot=="mac",a.isLinux=ot=="linux",a.isIE=nt=="Microsoft Internet Explorer"||nt.indexOf("MSAppHost")>=0?parseFloat((at.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((at.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),a.isOldIE=a.isIE&&a.isIE<9,a.isGecko=a.isMozilla=at.match(/ Gecko\/\d+/),a.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",a.isWebKit=parseFloat(at.split("WebKit/")[1])||void 0,a.isChrome=parseFloat(at.split(" Chrome/")[1])||void 0,a.isSafari=parseFloat(at.split(" Safari/")[1])&&!a.isChrome||void 0,a.isEdge=parseFloat(at.split(" Edge/")[1])||void 0,a.isAIR=at.indexOf("AdobeAIR")>=0,a.isAndroid=at.indexOf("Android")>=0,a.isChromeOS=at.indexOf(" CrOS ")>=0,a.isIOS=/iPad|iPhone|iPod/.test(at)&&!window.MSStream,a.isIOS&&(a.isMac=!0),a.isMobile=a.isIOS||a.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(o,a,rt){var tt=o("./useragent"),ot="http://www.w3.org/1999/xhtml";a.buildDom=function $(et,st,lt){if(typeof et=="string"&&et){var ct=document.createTextNode(et);return st&&st.appendChild(ct),ct}if(!Array.isArray(et))return et&&et.appendChild&&st&&st.appendChild(et),et;if(typeof et[0]!="string"||!et[0]){for(var ht=[],ut=0;ut"u")){if(nt){if(st)it();else if(st===!1)return nt.push([$,et])}if(!at){var lt=st;!st||!st.getRootNode?lt=document:(lt=st.getRootNode(),(!lt||lt==st)&&(lt=document));var ct=lt.ownerDocument||lt;if(et&&a.hasCssString(et,lt))return null;et&&($+=` +/*# sourceURL=ace/css/`+et+" */");var ht=a.createElement("style");ht.appendChild(ct.createTextNode($)),et&&(ht.id=et),lt==ct&&(lt=a.getDocumentHead(ct)),lt.insertBefore(ht,lt.firstChild)}}}if(a.importCssString=j,a.importCssStylsheet=function($,et){a.buildDom(["link",{rel:"stylesheet",href:$}],a.getDocumentHead(et))},a.scrollbarWidth=function($){var et=a.createElement("ace_inner");et.style.width="100%",et.style.minWidth="0px",et.style.height="200px",et.style.display="block";var st=a.createElement("ace_outer"),lt=st.style;lt.position="absolute",lt.left="-10000px",lt.overflow="hidden",lt.width="200px",lt.minWidth="0px",lt.height="150px",lt.display="block",st.appendChild(et);var ct=$&&$.documentElement||document&&document.documentElement;if(!ct)return 0;ct.appendChild(st);var ht=et.offsetWidth;lt.overflow="scroll";var ut=et.offsetWidth;return ht===ut&&(ut=st.clientWidth),ct.removeChild(st),ht-ut},a.computedStyle=function($,et){return window.getComputedStyle($,"")||{}},a.setStyle=function($,et,st){$[et]!==st&&($[et]=st)},a.HAS_CSS_ANIMATION=!1,a.HAS_CSS_TRANSFORMS=!1,a.HI_DPI=tt.isWin?typeof window<"u"&&window.devicePixelRatio>=1.5:!0,tt.isChromeOS&&(a.HI_DPI=!1),typeof document<"u"){var _=document.createElement("div");a.HI_DPI&&_.style.transform!==void 0&&(a.HAS_CSS_TRANSFORMS=!0),!tt.isEdge&&typeof _.style.animationName<"u"&&(a.HAS_CSS_ANIMATION=!0),_=null}a.HAS_CSS_TRANSFORMS?a.translate=function($,et,st){$.style.transform="translate("+Math.round(et)+"px, "+Math.round(st)+"px)"}:a.translate=function($,et,st){$.style.top=Math.round(st)+"px",$.style.left=Math.round(et)+"px"}}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(o,a,rt){/* * based on code from: * * @license RequireJS text 0.25.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. * Available via the MIT or new BSD license. * see: http://github.com/jrburke/requirejs for details -*/var et=o("./dom");a.get=function(ot,at){var nt=new XMLHttpRequest;nt.open("GET",ot,!0),nt.onreadystatechange=function(){nt.readyState===4&&at(nt.responseText)},nt.send(null)},a.loadScript=function(ot,at){var nt=et.getDocumentHead(),it=document.createElement("script");it.src=ot,nt.appendChild(it),it.onload=it.onreadystatechange=function(j,_){(_||!it.readyState||it.readyState=="loaded"||it.readyState=="complete")&&(it=it.onload=it.onreadystatechange=null,_||at())}},a.qualifyURL=function(ot){var at=document.createElement("a");return at.href=ot,at.href}}),ace.define("ace/lib/oop",["require","exports","module"],function(o,a,rt){a.inherits=function(et,ot){et.super_=ot,et.prototype=Object.create(ot.prototype,{constructor:{value:et,enumerable:!1,writable:!0,configurable:!0}})},a.mixin=function(et,ot){for(var at in ot)et[at]=ot[at];return et},a.implement=function(et,ot){a.mixin(et,ot)}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(o,a,rt){var et={},ot=function(){this.propagationStopped=!0},at=function(){this.defaultPrevented=!0};et._emit=et._dispatchEvent=function(nt,it){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var j=this._eventRegistry[nt]||[],_=this._defaultHandlers[nt];if(!(!j.length&&!_)){(typeof it!="object"||!it)&&(it={}),it.type||(it.type=nt),it.stopPropagation||(it.stopPropagation=ot),it.preventDefault||(it.preventDefault=at),j=j.slice();for(var $=0;$1&&(ht=lt[lt.length-2]);var pt=it[st+"Path"];return pt==null?pt=it.basePath:ct=="/"&&(st=ct=""),pt&&pt.slice(-1)!="/"&&(pt+="/"),pt+st+ct+ht+this.get("suffix")},a.setModuleUrl=function(tt,st){return it.$moduleUrls[tt]=st};var j=function(tt,st){if(tt==="ace/theme/textmate"||tt==="./theme/textmate")return st(null,o("./theme/textmate"));if(_)return _(tt,st);console.error("loader is not configured")},_;a.setLoader=function(tt){_=tt},a.dynamicModules=Object.create(null),a.$loading={},a.$loaded={},a.loadModule=function(tt,st){var lt;if(Array.isArray(tt))var ct=tt[0],ht=tt[1];else if(typeof tt=="string")var ht=tt;var ut=function(pt){if(pt&&!a.$loading[ht])return st&&st(pt);if(a.$loading[ht]||(a.$loading[ht]=[]),a.$loading[ht].push(st),!(a.$loading[ht].length>1)){var mt=function(){j(ht,function(gt,dt){dt&&(a.$loaded[ht]=dt),a._emit("load.module",{name:ht,module:dt});var St=a.$loading[ht];a.$loading[ht]=null,St.forEach(function(xt){xt&&xt(dt)})})};if(!a.get("packaged"))return mt();ot.loadScript(a.moduleUrl(ht,ct),mt),$()}};if(a.dynamicModules[ht])a.dynamicModules[ht]().then(function(pt){pt.default?ut(pt.default):ut(pt)});else{try{lt=this.$require(ht)}catch{}ut(lt||a.$loaded[ht])}},a.$require=function(tt){if(typeof rt.require=="function"){var st="require";return rt[st](tt)}},a.setModuleLoader=function(tt,st){a.dynamicModules[tt]=st};var $=function(){!it.basePath&&!it.workerPath&&!it.modePath&&!it.themePath&&!Object.keys(it.$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"),$=function(){})};a.version="1.35.4"}),ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],function(o,a,rt){o("./lib/fixoldbrowsers");var et=o("./config");et.setLoader(function(it,j){o([it],function(_){j(null,_)})});var ot=function(){return this||typeof window<"u"&&window}();rt.exports=function(it){et.init=at,et.$require=o,it.require=o},at(!0);function at(it){if(!(!ot||!ot.document)){et.set("packaged",it||o.packaged||rt.packaged||ot.define&&(void 0).packaged);var j={},_="",$=document.currentScript||document._currentScript,tt=$&&$.ownerDocument||document;$&&$.src&&(_=$.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");for(var st=tt.getElementsByTagName("script"),lt=0;lt ["+this.end.row+"/"+this.end.column+"]"},ot.prototype.contains=function(at,nt){return this.compare(at,nt)==0},ot.prototype.compareRange=function(at){var nt,it=at.end,j=at.start;return nt=this.compare(it.row,it.column),nt==1?(nt=this.compare(j.row,j.column),nt==1?2:nt==0?1:0):nt==-1?-2:(nt=this.compare(j.row,j.column),nt==-1?-1:nt==1?42:0)},ot.prototype.comparePoint=function(at){return this.compare(at.row,at.column)},ot.prototype.containsRange=function(at){return this.comparePoint(at.start)==0&&this.comparePoint(at.end)==0},ot.prototype.intersects=function(at){var nt=this.compareRange(at);return nt==-1||nt==0||nt==1},ot.prototype.isEnd=function(at,nt){return this.end.row==at&&this.end.column==nt},ot.prototype.isStart=function(at,nt){return this.start.row==at&&this.start.column==nt},ot.prototype.setStart=function(at,nt){typeof at=="object"?(this.start.column=at.column,this.start.row=at.row):(this.start.row=at,this.start.column=nt)},ot.prototype.setEnd=function(at,nt){typeof at=="object"?(this.end.column=at.column,this.end.row=at.row):(this.end.row=at,this.end.column=nt)},ot.prototype.inside=function(at,nt){return this.compare(at,nt)==0?!(this.isEnd(at,nt)||this.isStart(at,nt)):!1},ot.prototype.insideStart=function(at,nt){return this.compare(at,nt)==0?!this.isEnd(at,nt):!1},ot.prototype.insideEnd=function(at,nt){return this.compare(at,nt)==0?!this.isStart(at,nt):!1},ot.prototype.compare=function(at,nt){return!this.isMultiLine()&&at===this.start.row?ntthis.end.column?1:0:atthis.end.row?1:this.start.row===at?nt>=this.start.column?0:-1:this.end.row===at?nt<=this.end.column?0:1:0},ot.prototype.compareStart=function(at,nt){return this.start.row==at&&this.start.column==nt?-1:this.compare(at,nt)},ot.prototype.compareEnd=function(at,nt){return this.end.row==at&&this.end.column==nt?1:this.compare(at,nt)},ot.prototype.compareInside=function(at,nt){return this.end.row==at&&this.end.column==nt?1:this.start.row==at&&this.start.column==nt?-1:this.compare(at,nt)},ot.prototype.clipRows=function(at,nt){if(this.end.row>nt)var it={row:nt+1,column:0};else if(this.end.rownt)var j={row:nt+1,column:0};else if(this.start.row1?(xt++,xt>4&&(xt=1)):xt=1,ot.isIE){var $t=Math.abs(Tt.clientX-yt)>5||Math.abs(Tt.clientY-_t)>5;(!Ct||$t)&&(xt=1),Ct&&clearTimeout(Ct),Ct=setTimeout(function(){Ct=null},mt[xt-1]||600),xt==1&&(yt=Tt.clientX,_t=Tt.clientY)}if(Tt._clicks=xt,gt[dt]("mousedown",Tt),xt>4)xt=0;else if(xt>1)return gt[dt](Et[xt],Tt)}Array.isArray(pt)||(pt=[pt]),pt.forEach(function(Tt){tt(Tt,"mousedown",kt,St)})};function lt(pt){return 0|(pt.ctrlKey?1:0)|(pt.altKey?2:0)|(pt.shiftKey?4:0)|(pt.metaKey?8:0)}a.getModifierString=function(pt){return et.KEY_MODS[lt(pt)]};function ct(pt,mt,gt){var dt=lt(mt);if(!gt&&mt.code&&(gt=et.$codeToKeyCode[mt.code]||gt),!ot.isMac&&at){if(mt.getModifierState&&(mt.getModifierState("OS")||mt.getModifierState("Win"))&&(dt|=8),at.altGr)if((3&dt)!=3)at.altGr=0;else return;if(gt===18||gt===17){var St=mt.location;if(gt===17&&St===1)at[gt]==1&&(nt=mt.timeStamp);else if(gt===18&&dt===3&&St===2){var xt=mt.timeStamp-nt;xt<50&&(at.altGr=!0)}}}if(gt in et.MODIFIER_KEYS&&(gt=-1),!(!dt&>===13&&mt.location===3&&(pt(mt,dt,-gt),mt.defaultPrevented))){if(ot.isChromeOS&&dt&8){if(pt(mt,dt,gt),mt.defaultPrevented)return;dt&=-9}return!dt&&!(gt in et.FUNCTION_KEYS)&&!(gt in et.PRINTABLE_KEYS)?!1:pt(mt,dt,gt)}}a.addCommandKeyListener=function(pt,mt,gt){var dt=null;tt(pt,"keydown",function(St){at[St.keyCode]=(at[St.keyCode]||0)+1;var xt=ct(mt,St,St.keyCode);return dt=St.defaultPrevented,xt},gt),tt(pt,"keypress",function(St){dt&&(St.ctrlKey||St.altKey||St.shiftKey||St.metaKey)&&(a.stopEvent(St),dt=null)},gt),tt(pt,"keyup",function(St){at[St.keyCode]=null},gt),at||(ht(),tt(window,"focus",ht))};function ht(){at=Object.create(null)}if(typeof window=="object"&&window.postMessage&&!ot.isOldIE){var ut=1;a.nextTick=function(pt,mt){mt=mt||window;var gt="zero-timeout-message-"+ut++,dt=function(St){St.data==gt&&(a.stopPropagation(St),st(mt,"message",dt),pt())};tt(mt,"message",dt),mt.postMessage(gt,"*")}}a.$idleBlocked=!1,a.onIdle=function(pt,mt){return setTimeout(function gt(){a.$idleBlocked?setTimeout(gt,100):pt()},mt)},a.$idleBlockId=null,a.blockIdle=function(pt){a.$idleBlockId&&clearTimeout(a.$idleBlockId),a.$idleBlocked=!0,a.$idleBlockId=setTimeout(function(){a.$idleBlocked=!1},pt||100)},a.nextFrame=typeof window=="object"&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),a.nextFrame?a.nextFrame=a.nextFrame.bind(window):a.nextFrame=function(pt){setTimeout(pt,17)}}),ace.define("ace/clipboard",["require","exports","module"],function(o,a,rt){var et;rt.exports={lineMode:!1,pasteCancelled:function(){return et&&et>Date.now()-50?!0:et=!1},cancel:function(){et=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/config","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(o,a,rt){var et=o("../lib/event"),ot=o("../config").nls,at=o("../lib/useragent"),nt=o("../lib/dom"),it=o("../lib/lang"),j=o("../clipboard"),_=at.isChrome<18,$=at.isIE,tt=at.isChrome>63,st=400,lt=o("../lib/keys"),ct=lt.KEY_MODS,ht=at.isIOS,ut=ht?/\s/:/\n/,pt=at.isMobile,mt;mt=function(gt,dt){var St=nt.createElement("textarea");St.className="ace_text-input",St.setAttribute("wrap","off"),St.setAttribute("autocorrect","off"),St.setAttribute("autocapitalize","off"),St.setAttribute("spellcheck","false"),St.style.opacity="0",gt.insertBefore(St,gt.firstChild);var xt=!1,yt=!1,_t=!1,Ct=!1,Et="";pt||(St.style.fontSize="1px");var kt=!1,Tt=!1,$t="",It=0,Ot=0,Mt=0,Dt=Number.MAX_SAFE_INTEGER,Bt=Number.MIN_SAFE_INTEGER,Kt=0;try{var Wt=document.activeElement===St}catch{}this.setNumberOfExtraLines=function(_r){if(Dt=Number.MAX_SAFE_INTEGER,Bt=Number.MIN_SAFE_INTEGER,_r<0){Kt=0;return}Kt=_r},this.setAriaOptions=function(_r){if(_r.activeDescendant?(St.setAttribute("aria-haspopup","true"),St.setAttribute("aria-autocomplete",_r.inline?"both":"list"),St.setAttribute("aria-activedescendant",_r.activeDescendant)):(St.setAttribute("aria-haspopup","false"),St.setAttribute("aria-autocomplete","both"),St.removeAttribute("aria-activedescendant")),_r.role&&St.setAttribute("role",_r.role),_r.setLabel){St.setAttribute("aria-roledescription",ot("text-input.aria-roledescription","editor"));var Nr="";if(dt.$textInputAriaLabel&&(Nr+="".concat(dt.$textInputAriaLabel,", ")),dt.session){var kr=dt.session.selection.cursor.row;Nr+=ot("text-input.aria-label","Cursor at row $0",[kr+1])}St.setAttribute("aria-label",Nr)}},this.setAriaOptions({role:"textbox"}),et.addListener(St,"blur",function(_r){Tt||(dt.onBlur(_r),Wt=!1)},dt),et.addListener(St,"focus",function(_r){if(!Tt){if(Wt=!0,at.isEdge)try{if(!document.hasFocus())return}catch{}dt.onFocus(_r),at.isEdge?setTimeout(Ht):Ht()}},dt),this.$focusScroll=!1,this.focus=function(){if(this.setAriaOptions({setLabel:dt.renderer.enableKeyboardAccessibility}),Et||tt||this.$focusScroll=="browser")return St.focus({preventScroll:!0});var _r=St.style.top;St.style.position="fixed",St.style.top="0px";try{var Nr=St.getBoundingClientRect().top!=0}catch{return}var kr=[];if(Nr)for(var nn=St.parentElement;nn&&nn.nodeType==1;)kr.push(nn),nn.setAttribute("ace_nocontext","true"),!nn.parentElement&&nn.getRootNode?nn=nn.getRootNode().host:nn=nn.parentElement;St.focus({preventScroll:!0}),Nr&&kr.forEach(function(Yt){Yt.removeAttribute("ace_nocontext")}),setTimeout(function(){St.style.position="",St.style.top=="0px"&&(St.style.top=_r)},0)},this.blur=function(){St.blur()},this.isFocused=function(){return Wt},dt.on("beforeEndOperation",function(){var _r=dt.curOp,Nr=_r&&_r.command&&_r.command.name;if(Nr!="insertstring"){var kr=Nr&&(_r.docChanged||_r.selectionChanged);_t&&kr&&($t=St.value="",tn()),Ht()}});var zt=function(_r,Nr){for(var kr=Nr,nn=1;nn<=_r-Dt&&nn<2*Kt+1;nn++)kr+=dt.session.getLine(_r-nn).length+1;return kr},Ht=ht?function(_r){if(!(!Wt||xt&&!_r||Ct)){_r||(_r="");var Nr=` +`}),ace.define("ace/theme/textmate",["require","exports","module","ace/theme/textmate-css","ace/lib/dom"],function(o,a,rt){a.isDark=!1,a.cssClass="ace-tm",a.cssText=o("./textmate-css"),a.$id="ace/theme/textmate";var tt=o("../lib/dom");tt.importCssString(a.cssText,a.cssClass,!1)}),ace.define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/net","ace/lib/dom","ace/lib/app_config","ace/theme/textmate"],function(o,a,rt){"no use strict";var tt=o("./lib/lang"),ot=o("./lib/net"),at=o("./lib/dom"),nt=o("./lib/app_config").AppConfig;rt.exports=a=new nt;var it={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1,useStrictCSP:null};a.get=function(et){if(!it.hasOwnProperty(et))throw new Error("Unknown config key: "+et);return it[et]},a.set=function(et,st){if(it.hasOwnProperty(et))it[et]=st;else if(this.setDefaultValue("",et,st)==!1)throw new Error("Unknown config key: "+et);et=="useStrictCSP"&&at.useStrictCSP(st)},a.all=function(){return tt.copyObject(it)},a.$modes={},a.moduleUrl=function(et,st){if(it.$moduleUrls[et])return it.$moduleUrls[et];var lt=et.split("/");st=st||lt[lt.length-2]||"";var ct=st=="snippets"?"/":"-",ht=lt[lt.length-1];if(st=="worker"&&ct=="-"){var ut=new RegExp("^"+st+"[\\-_]|[\\-_]"+st+"$","g");ht=ht.replace(ut,"")}(!ht||ht==st)&<.length>1&&(ht=lt[lt.length-2]);var pt=it[st+"Path"];return pt==null?pt=it.basePath:ct=="/"&&(st=ct=""),pt&&pt.slice(-1)!="/"&&(pt+="/"),pt+st+ct+ht+this.get("suffix")},a.setModuleUrl=function(et,st){return it.$moduleUrls[et]=st};var j=function(et,st){if(et==="ace/theme/textmate"||et==="./theme/textmate")return st(null,o("./theme/textmate"));if(_)return _(et,st);console.error("loader is not configured")},_;a.setLoader=function(et){_=et},a.dynamicModules=Object.create(null),a.$loading={},a.$loaded={},a.loadModule=function(et,st){var lt;if(Array.isArray(et))var ct=et[0],ht=et[1];else if(typeof et=="string")var ht=et;var ut=function(pt){if(pt&&!a.$loading[ht])return st&&st(pt);if(a.$loading[ht]||(a.$loading[ht]=[]),a.$loading[ht].push(st),!(a.$loading[ht].length>1)){var mt=function(){j(ht,function(gt,dt){dt&&(a.$loaded[ht]=dt),a._emit("load.module",{name:ht,module:dt});var St=a.$loading[ht];a.$loading[ht]=null,St.forEach(function(xt){xt&&xt(dt)})})};if(!a.get("packaged"))return mt();ot.loadScript(a.moduleUrl(ht,ct),mt),$()}};if(a.dynamicModules[ht])a.dynamicModules[ht]().then(function(pt){pt.default?ut(pt.default):ut(pt)});else{try{lt=this.$require(ht)}catch{}ut(lt||a.$loaded[ht])}},a.$require=function(et){if(typeof rt.require=="function"){var st="require";return rt[st](et)}},a.setModuleLoader=function(et,st){a.dynamicModules[et]=st};var $=function(){!it.basePath&&!it.workerPath&&!it.modePath&&!it.themePath&&!Object.keys(it.$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"),$=function(){})};a.version="1.35.4"}),ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],function(o,a,rt){o("./lib/fixoldbrowsers");var tt=o("./config");tt.setLoader(function(it,j){o([it],function(_){j(null,_)})});var ot=function(){return this||typeof window<"u"&&window}();rt.exports=function(it){tt.init=at,tt.$require=o,it.require=o},at(!0);function at(it){if(!(!ot||!ot.document)){tt.set("packaged",it||o.packaged||rt.packaged||ot.define&&(void 0).packaged);var j={},_="",$=document.currentScript||document._currentScript,et=$&&$.ownerDocument||document;$&&$.src&&(_=$.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");for(var st=et.getElementsByTagName("script"),lt=0;lt ["+this.end.row+"/"+this.end.column+"]"},ot.prototype.contains=function(at,nt){return this.compare(at,nt)==0},ot.prototype.compareRange=function(at){var nt,it=at.end,j=at.start;return nt=this.compare(it.row,it.column),nt==1?(nt=this.compare(j.row,j.column),nt==1?2:nt==0?1:0):nt==-1?-2:(nt=this.compare(j.row,j.column),nt==-1?-1:nt==1?42:0)},ot.prototype.comparePoint=function(at){return this.compare(at.row,at.column)},ot.prototype.containsRange=function(at){return this.comparePoint(at.start)==0&&this.comparePoint(at.end)==0},ot.prototype.intersects=function(at){var nt=this.compareRange(at);return nt==-1||nt==0||nt==1},ot.prototype.isEnd=function(at,nt){return this.end.row==at&&this.end.column==nt},ot.prototype.isStart=function(at,nt){return this.start.row==at&&this.start.column==nt},ot.prototype.setStart=function(at,nt){typeof at=="object"?(this.start.column=at.column,this.start.row=at.row):(this.start.row=at,this.start.column=nt)},ot.prototype.setEnd=function(at,nt){typeof at=="object"?(this.end.column=at.column,this.end.row=at.row):(this.end.row=at,this.end.column=nt)},ot.prototype.inside=function(at,nt){return this.compare(at,nt)==0?!(this.isEnd(at,nt)||this.isStart(at,nt)):!1},ot.prototype.insideStart=function(at,nt){return this.compare(at,nt)==0?!this.isEnd(at,nt):!1},ot.prototype.insideEnd=function(at,nt){return this.compare(at,nt)==0?!this.isStart(at,nt):!1},ot.prototype.compare=function(at,nt){return!this.isMultiLine()&&at===this.start.row?ntthis.end.column?1:0:atthis.end.row?1:this.start.row===at?nt>=this.start.column?0:-1:this.end.row===at?nt<=this.end.column?0:1:0},ot.prototype.compareStart=function(at,nt){return this.start.row==at&&this.start.column==nt?-1:this.compare(at,nt)},ot.prototype.compareEnd=function(at,nt){return this.end.row==at&&this.end.column==nt?1:this.compare(at,nt)},ot.prototype.compareInside=function(at,nt){return this.end.row==at&&this.end.column==nt?1:this.start.row==at&&this.start.column==nt?-1:this.compare(at,nt)},ot.prototype.clipRows=function(at,nt){if(this.end.row>nt)var it={row:nt+1,column:0};else if(this.end.rownt)var j={row:nt+1,column:0};else if(this.start.row1?(xt++,xt>4&&(xt=1)):xt=1,ot.isIE){var $t=Math.abs(Tt.clientX-yt)>5||Math.abs(Tt.clientY-_t)>5;(!Ct||$t)&&(xt=1),Ct&&clearTimeout(Ct),Ct=setTimeout(function(){Ct=null},mt[xt-1]||600),xt==1&&(yt=Tt.clientX,_t=Tt.clientY)}if(Tt._clicks=xt,gt[dt]("mousedown",Tt),xt>4)xt=0;else if(xt>1)return gt[dt](Et[xt],Tt)}Array.isArray(pt)||(pt=[pt]),pt.forEach(function(Tt){et(Tt,"mousedown",kt,St)})};function lt(pt){return 0|(pt.ctrlKey?1:0)|(pt.altKey?2:0)|(pt.shiftKey?4:0)|(pt.metaKey?8:0)}a.getModifierString=function(pt){return tt.KEY_MODS[lt(pt)]};function ct(pt,mt,gt){var dt=lt(mt);if(!gt&&mt.code&&(gt=tt.$codeToKeyCode[mt.code]||gt),!ot.isMac&&at){if(mt.getModifierState&&(mt.getModifierState("OS")||mt.getModifierState("Win"))&&(dt|=8),at.altGr)if((3&dt)!=3)at.altGr=0;else return;if(gt===18||gt===17){var St=mt.location;if(gt===17&&St===1)at[gt]==1&&(nt=mt.timeStamp);else if(gt===18&&dt===3&&St===2){var xt=mt.timeStamp-nt;xt<50&&(at.altGr=!0)}}}if(gt in tt.MODIFIER_KEYS&&(gt=-1),!(!dt&>===13&&mt.location===3&&(pt(mt,dt,-gt),mt.defaultPrevented))){if(ot.isChromeOS&&dt&8){if(pt(mt,dt,gt),mt.defaultPrevented)return;dt&=-9}return!dt&&!(gt in tt.FUNCTION_KEYS)&&!(gt in tt.PRINTABLE_KEYS)?!1:pt(mt,dt,gt)}}a.addCommandKeyListener=function(pt,mt,gt){var dt=null;et(pt,"keydown",function(St){at[St.keyCode]=(at[St.keyCode]||0)+1;var xt=ct(mt,St,St.keyCode);return dt=St.defaultPrevented,xt},gt),et(pt,"keypress",function(St){dt&&(St.ctrlKey||St.altKey||St.shiftKey||St.metaKey)&&(a.stopEvent(St),dt=null)},gt),et(pt,"keyup",function(St){at[St.keyCode]=null},gt),at||(ht(),et(window,"focus",ht))};function ht(){at=Object.create(null)}if(typeof window=="object"&&window.postMessage&&!ot.isOldIE){var ut=1;a.nextTick=function(pt,mt){mt=mt||window;var gt="zero-timeout-message-"+ut++,dt=function(St){St.data==gt&&(a.stopPropagation(St),st(mt,"message",dt),pt())};et(mt,"message",dt),mt.postMessage(gt,"*")}}a.$idleBlocked=!1,a.onIdle=function(pt,mt){return setTimeout(function gt(){a.$idleBlocked?setTimeout(gt,100):pt()},mt)},a.$idleBlockId=null,a.blockIdle=function(pt){a.$idleBlockId&&clearTimeout(a.$idleBlockId),a.$idleBlocked=!0,a.$idleBlockId=setTimeout(function(){a.$idleBlocked=!1},pt||100)},a.nextFrame=typeof window=="object"&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),a.nextFrame?a.nextFrame=a.nextFrame.bind(window):a.nextFrame=function(pt){setTimeout(pt,17)}}),ace.define("ace/clipboard",["require","exports","module"],function(o,a,rt){var tt;rt.exports={lineMode:!1,pasteCancelled:function(){return tt&&tt>Date.now()-50?!0:tt=!1},cancel:function(){tt=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/config","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(o,a,rt){var tt=o("../lib/event"),ot=o("../config").nls,at=o("../lib/useragent"),nt=o("../lib/dom"),it=o("../lib/lang"),j=o("../clipboard"),_=at.isChrome<18,$=at.isIE,et=at.isChrome>63,st=400,lt=o("../lib/keys"),ct=lt.KEY_MODS,ht=at.isIOS,ut=ht?/\s/:/\n/,pt=at.isMobile,mt;mt=function(gt,dt){var St=nt.createElement("textarea");St.className="ace_text-input",St.setAttribute("wrap","off"),St.setAttribute("autocorrect","off"),St.setAttribute("autocapitalize","off"),St.setAttribute("spellcheck","false"),St.style.opacity="0",gt.insertBefore(St,gt.firstChild);var xt=!1,yt=!1,_t=!1,Ct=!1,Et="";pt||(St.style.fontSize="1px");var kt=!1,Tt=!1,$t="",It=0,Ot=0,Mt=0,Dt=Number.MAX_SAFE_INTEGER,Bt=Number.MIN_SAFE_INTEGER,Kt=0;try{var Wt=document.activeElement===St}catch{}this.setNumberOfExtraLines=function(_r){if(Dt=Number.MAX_SAFE_INTEGER,Bt=Number.MIN_SAFE_INTEGER,_r<0){Kt=0;return}Kt=_r},this.setAriaOptions=function(_r){if(_r.activeDescendant?(St.setAttribute("aria-haspopup","true"),St.setAttribute("aria-autocomplete",_r.inline?"both":"list"),St.setAttribute("aria-activedescendant",_r.activeDescendant)):(St.setAttribute("aria-haspopup","false"),St.setAttribute("aria-autocomplete","both"),St.removeAttribute("aria-activedescendant")),_r.role&&St.setAttribute("role",_r.role),_r.setLabel){St.setAttribute("aria-roledescription",ot("text-input.aria-roledescription","editor"));var Nr="";if(dt.$textInputAriaLabel&&(Nr+="".concat(dt.$textInputAriaLabel,", ")),dt.session){var kr=dt.session.selection.cursor.row;Nr+=ot("text-input.aria-label","Cursor at row $0",[kr+1])}St.setAttribute("aria-label",Nr)}},this.setAriaOptions({role:"textbox"}),tt.addListener(St,"blur",function(_r){Tt||(dt.onBlur(_r),Wt=!1)},dt),tt.addListener(St,"focus",function(_r){if(!Tt){if(Wt=!0,at.isEdge)try{if(!document.hasFocus())return}catch{}dt.onFocus(_r),at.isEdge?setTimeout(Ht):Ht()}},dt),this.$focusScroll=!1,this.focus=function(){if(this.setAriaOptions({setLabel:dt.renderer.enableKeyboardAccessibility}),Et||et||this.$focusScroll=="browser")return St.focus({preventScroll:!0});var _r=St.style.top;St.style.position="fixed",St.style.top="0px";try{var Nr=St.getBoundingClientRect().top!=0}catch{return}var kr=[];if(Nr)for(var nn=St.parentElement;nn&&nn.nodeType==1;)kr.push(nn),nn.setAttribute("ace_nocontext","true"),!nn.parentElement&&nn.getRootNode?nn=nn.getRootNode().host:nn=nn.parentElement;St.focus({preventScroll:!0}),Nr&&kr.forEach(function(Yt){Yt.removeAttribute("ace_nocontext")}),setTimeout(function(){St.style.position="",St.style.top=="0px"&&(St.style.top=_r)},0)},this.blur=function(){St.blur()},this.isFocused=function(){return Wt},dt.on("beforeEndOperation",function(){var _r=dt.curOp,Nr=_r&&_r.command&&_r.command.name;if(Nr!="insertstring"){var kr=Nr&&(_r.docChanged||_r.selectionChanged);_t&&kr&&($t=St.value="",tn()),Ht()}});var zt=function(_r,Nr){for(var kr=Nr,nn=1;nn<=_r-Dt&&nn<2*Kt+1;nn++)kr+=dt.session.getLine(_r-nn).length+1;return kr},Ht=ht?function(_r){if(!(!Wt||xt&&!_r||Ct)){_r||(_r="");var Nr=` ab`+_r+`cde fg `;Nr!=St.value&&(St.value=$t=Nr);var kr=4,nn=4+(_r.length||(dt.selection.isEmpty()?0:1));(It!=kr||Ot!=nn)&&St.setSelectionRange(kr,nn),It=kr,Ot=nn}}:function(){if(!(_t||Ct)&&!(!Wt&&!fr)){_t=!0;var _r=0,Nr=0,kr="";if(dt.session){var nn=dt.selection,Yt=nn.getRange(),er=nn.cursor.row;er===Bt+1?(Dt=Bt+1,Bt=Dt+2*Kt):er===Dt-1?(Bt=Dt-1,Dt=Bt-2*Kt):(erBt+1)&&(Dt=er>Kt?er-Kt:0,Bt=er>Kt?er+Kt:2*Kt);for(var lr=[],Lr=Dt;Lr<=Bt;Lr++)lr.push(dt.session.getLine(Lr));if(kr=lr.join(` `),_r=zt(Yt.start.row,Yt.start.column),Nr=zt(Yt.end.row,Yt.end.column),Yt.start.row=$t.length&&_r.value===$t&&$t&&_r.selectionEnd!==Ot},qt=function(_r){_t||(xt?xt=!1:Zt(St)?(dt.selectAll(),Ht()):pt&&St.selectionStart!=It&&Ht())},hr=null;this.setInputHandler=function(_r){hr=_r},this.getInputHandler=function(){return hr};var fr=!1,mr=function(_r,Nr){if(fr&&(fr=!1),yt)return Ht(),_r&&dt.onPaste(_r),yt=!1,"";for(var kr=St.selectionStart,nn=St.selectionEnd,Yt=It,er=$t.length-Ot,lr=_r,Lr=_r.length-kr,Or=_r.length-nn,Er=0;Yt>0&&$t[Er]==_r[Er];)Er++,Yt--;for(lr=lr.slice(Er),Er=1;er>0&&$t.length-Er>It-1&&$t[$t.length-Er]==_r[_r.length-Er];)Er++,er--;Lr-=Er-1,Or-=Er-1;var Cr=lr.length-Er+1;if(Cr<0&&(Yt=-Cr,Cr=0),lr=lr.slice(0,Cr),!Nr&&!lr&&!Lr&&!Yt&&!er&&!Or)return"";Ct=!0;var Hr=!1;return at.isAndroid&&lr==". "&&(lr=" ",Hr=!0),lr&&!Yt&&!er&&!Lr&&!Or||kt?dt.onTextInput(lr):dt.onTextInput(lr,{extendLeft:Yt,extendRight:er,restoreStart:Lr,restoreEnd:Or}),Ct=!1,$t=_r,It=kr,Ot=nn,Mt=Or,Hr?` -`:lr},gr=function(_r){if(_t)return Ur();if(_r&&_r.inputType){if(_r.inputType=="historyUndo")return dt.execCommand("undo");if(_r.inputType=="historyRedo")return dt.execCommand("redo")}var Nr=St.value,kr=mr(Nr,!0);(Nr.length>st+100||ut.test(kr)||pt&&It<1&&It==Ot)&&Ht()},tr=function(_r,Nr,kr){var nn=_r.clipboardData||window.clipboardData;if(!(!nn||_)){var Yt=$||kr?"Text":"text/plain";try{return Nr?nn.setData(Yt,Nr)!==!1:nn.getData(Yt)}catch(er){if(!kr)return tr(er,Nr,!0)}}},rr=function(_r,Nr){var kr=dt.getCopyText();if(!kr)return et.preventDefault(_r);tr(_r,kr)?(ht&&(Ht(kr),xt=kr,setTimeout(function(){xt=!1},10)),Nr?dt.onCut():dt.onCopy(),et.preventDefault(_r)):(xt=!0,St.value=kr,St.select(),setTimeout(function(){xt=!1,Ht(),Nr?dt.onCut():dt.onCopy()}))},Qt=function(_r){rr(_r,!0)},xr=function(_r){rr(_r,!1)},Sr=function(_r){var Nr=tr(_r);j.pasteCancelled()||(typeof Nr=="string"?(Nr&&dt.onPaste(Nr,_r),at.isIE&&setTimeout(Ht),et.preventDefault(_r)):(St.value="",yt=!0))};et.addCommandKeyListener(St,function(_r,Nr,kr){if(!_t)return dt.onCommandKey(_r,Nr,kr)},dt),et.addListener(St,"select",qt,dt),et.addListener(St,"input",gr,dt),et.addListener(St,"cut",Qt,dt),et.addListener(St,"copy",xr,dt),et.addListener(St,"paste",Sr,dt),(!("oncut"in St)||!("oncopy"in St)||!("onpaste"in St))&&et.addListener(gt,"keydown",function(_r){if(!(at.isMac&&!_r.metaKey||!_r.ctrlKey))switch(_r.keyCode){case 67:xr(_r);break;case 86:Sr(_r);break;case 88:Qt(_r);break}},dt);var dr=function(_r){if(!(_t||!dt.onCompositionStart||dt.$readOnly)&&(_t={},!kt)){_r.data&&(_t.useTextareaForIME=!1),setTimeout(Ur,0),dt._signal("compositionStart"),dt.on("mousedown",on);var Nr=dt.getSelectionRange();Nr.end.row=Nr.start.row,Nr.end.column=Nr.start.column,_t.markerRange=Nr,_t.selectionStart=It,dt.onCompositionStart(_t),_t.useTextareaForIME?($t=St.value="",It=0,Ot=0):(St.msGetInputContext&&(_t.context=St.msGetInputContext()),St.getInputContext&&(_t.context=St.getInputContext()))}},Ur=function(){if(!(!_t||!dt.onCompositionUpdate||dt.$readOnly)){if(kt)return on();if(_t.useTextareaForIME)dt.onCompositionUpdate(St.value);else{var _r=St.value;mr(_r),_t.markerRange&&(_t.context&&(_t.markerRange.start.column=_t.selectionStart=_t.context.compositionStartOffset),_t.markerRange.end.column=_t.markerRange.start.column+Ot-_t.selectionStart+Mt)}}},tn=function(_r){!dt.onCompositionEnd||dt.$readOnly||(_t=!1,dt.onCompositionEnd(),dt.off("mousedown",on),_r&&gr())};function on(){Tt=!0,St.blur(),St.focus(),Tt=!1}var Rn=it.delayedCall(Ur,50).schedule.bind(null,null);function Nn(_r){_r.keyCode==27&&St.value.lengthOt&&$t[Or]==` +`:lr},gr=function(_r){if(_t)return Ur();if(_r&&_r.inputType){if(_r.inputType=="historyUndo")return dt.execCommand("undo");if(_r.inputType=="historyRedo")return dt.execCommand("redo")}var Nr=St.value,kr=mr(Nr,!0);(Nr.length>st+100||ut.test(kr)||pt&&It<1&&It==Ot)&&Ht()},tr=function(_r,Nr,kr){var nn=_r.clipboardData||window.clipboardData;if(!(!nn||_)){var Yt=$||kr?"Text":"text/plain";try{return Nr?nn.setData(Yt,Nr)!==!1:nn.getData(Yt)}catch(er){if(!kr)return tr(er,Nr,!0)}}},rr=function(_r,Nr){var kr=dt.getCopyText();if(!kr)return tt.preventDefault(_r);tr(_r,kr)?(ht&&(Ht(kr),xt=kr,setTimeout(function(){xt=!1},10)),Nr?dt.onCut():dt.onCopy(),tt.preventDefault(_r)):(xt=!0,St.value=kr,St.select(),setTimeout(function(){xt=!1,Ht(),Nr?dt.onCut():dt.onCopy()}))},Qt=function(_r){rr(_r,!0)},xr=function(_r){rr(_r,!1)},Sr=function(_r){var Nr=tr(_r);j.pasteCancelled()||(typeof Nr=="string"?(Nr&&dt.onPaste(Nr,_r),at.isIE&&setTimeout(Ht),tt.preventDefault(_r)):(St.value="",yt=!0))};tt.addCommandKeyListener(St,function(_r,Nr,kr){if(!_t)return dt.onCommandKey(_r,Nr,kr)},dt),tt.addListener(St,"select",qt,dt),tt.addListener(St,"input",gr,dt),tt.addListener(St,"cut",Qt,dt),tt.addListener(St,"copy",xr,dt),tt.addListener(St,"paste",Sr,dt),(!("oncut"in St)||!("oncopy"in St)||!("onpaste"in St))&&tt.addListener(gt,"keydown",function(_r){if(!(at.isMac&&!_r.metaKey||!_r.ctrlKey))switch(_r.keyCode){case 67:xr(_r);break;case 86:Sr(_r);break;case 88:Qt(_r);break}},dt);var dr=function(_r){if(!(_t||!dt.onCompositionStart||dt.$readOnly)&&(_t={},!kt)){_r.data&&(_t.useTextareaForIME=!1),setTimeout(Ur,0),dt._signal("compositionStart"),dt.on("mousedown",on);var Nr=dt.getSelectionRange();Nr.end.row=Nr.start.row,Nr.end.column=Nr.start.column,_t.markerRange=Nr,_t.selectionStart=It,dt.onCompositionStart(_t),_t.useTextareaForIME?($t=St.value="",It=0,Ot=0):(St.msGetInputContext&&(_t.context=St.msGetInputContext()),St.getInputContext&&(_t.context=St.getInputContext()))}},Ur=function(){if(!(!_t||!dt.onCompositionUpdate||dt.$readOnly)){if(kt)return on();if(_t.useTextareaForIME)dt.onCompositionUpdate(St.value);else{var _r=St.value;mr(_r),_t.markerRange&&(_t.context&&(_t.markerRange.start.column=_t.selectionStart=_t.context.compositionStartOffset),_t.markerRange.end.column=_t.markerRange.start.column+Ot-_t.selectionStart+Mt)}}},tn=function(_r){!dt.onCompositionEnd||dt.$readOnly||(_t=!1,dt.onCompositionEnd(),dt.off("mousedown",on),_r&&gr())};function on(){Tt=!0,St.blur(),St.focus(),Tt=!1}var Rn=it.delayedCall(Ur,50).schedule.bind(null,null);function Nn(_r){_r.keyCode==27&&St.value.lengthOt&&$t[Or]==` `?Er=lt.end:LrOt&&$t.slice(0,Or).split(` -`).length>2?Er=lt.down:Or>Ot&&$t[Or-1]==" "?(Er=lt.right,Cr=ct.option):(Or>Ot||Or==Ot&&Ot!=It&&Lr==Or)&&(Er=lt.right),Lr!==Or&&(Cr|=ct.shift),Er){var Hr=Nr.onCommandKey({},Cr,Er);if(!Hr&&Nr.commands){Er=lt.keyCodeToString(Er);var rn=Nr.commands.findKeyCommand(Cr,Er);rn&&Nr.execCommand(rn)}It=Lr,Ot=Or,Ht("")}}};document.addEventListener("selectionchange",er),Nr.on("destroy",function(){document.removeEventListener("selectionchange",er)})}this.destroy=function(){St.parentElement&&St.parentElement.removeChild(St)}},a.TextInput=mt,a.$setUserAgentForTests=function(gt,dt){pt=gt,ht=dt}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(o,a,rt){var et=o("../lib/useragent"),ot=0,at=550,nt=function(){function _($){$.$clickSelection=null;var tt=$.editor;tt.setDefaultHandler("mousedown",this.onMouseDown.bind($)),tt.setDefaultHandler("dblclick",this.onDoubleClick.bind($)),tt.setDefaultHandler("tripleclick",this.onTripleClick.bind($)),tt.setDefaultHandler("quadclick",this.onQuadClick.bind($)),tt.setDefaultHandler("mousewheel",this.onMouseWheel.bind($));var st=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];st.forEach(function(lt){$[lt]=this[lt]},this),$.selectByLines=this.extendSelectionBy.bind($,"getLineRange"),$.selectByWords=this.extendSelectionBy.bind($,"getWordRange")}return _.prototype.onMouseDown=function($){var tt=$.inSelection(),st=$.getDocumentPosition();this.mousedownEvent=$;var lt=this.editor,ct=$.getButton();if(ct!==0){var ht=lt.getSelectionRange(),ut=ht.isEmpty();(ut||ct==1)&<.selection.moveToPosition(st),ct==2&&(lt.textInput.onContextMenu($.domEvent),et.isMozilla||$.preventDefault());return}if(this.mousedownEvent.time=Date.now(),tt&&!lt.isFocused()&&(lt.focus(),this.$focusTimeout&&!this.$clickSelection&&!lt.inMultiSelectMode)){this.setState("focusWait"),this.captureMouse($);return}return this.captureMouse($),this.startSelect(st,$.domEvent._clicks>1),$.preventDefault()},_.prototype.startSelect=function($,tt){$=$||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var st=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?st.selection.selectToPosition($):tt||st.selection.moveToPosition($),tt||this.select(),st.setStyle("ace_selecting"),this.setState("select"))},_.prototype.select=function(){var $,tt=this.editor,st=tt.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var lt=this.$clickSelection.comparePoint(st);if(lt==-1)$=this.$clickSelection.end;else if(lt==1)$=this.$clickSelection.start;else{var ct=j(this.$clickSelection,st);st=ct.cursor,$=ct.anchor}tt.selection.setSelectionAnchor($.row,$.column)}tt.selection.selectToPosition(st),tt.renderer.scrollCursorIntoView()},_.prototype.extendSelectionBy=function($){var tt,st=this.editor,lt=st.renderer.screenToTextCoordinates(this.x,this.y),ct=st.selection[$](lt.row,lt.column);if(this.$clickSelection){var ht=this.$clickSelection.comparePoint(ct.start),ut=this.$clickSelection.comparePoint(ct.end);if(ht==-1&&ut<=0)tt=this.$clickSelection.end,(ct.end.row!=lt.row||ct.end.column!=lt.column)&&(lt=ct.start);else if(ut==1&&ht>=0)tt=this.$clickSelection.start,(ct.start.row!=lt.row||ct.start.column!=lt.column)&&(lt=ct.end);else if(ht==-1&&ut==1)lt=ct.end,tt=ct.start;else{var pt=j(this.$clickSelection,lt);lt=pt.cursor,tt=pt.anchor}st.selection.setSelectionAnchor(tt.row,tt.column)}st.selection.selectToPosition(lt),st.renderer.scrollCursorIntoView()},_.prototype.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting")},_.prototype.focusWait=function(){var $=it(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),tt=Date.now();($>ot||tt-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},_.prototype.onDoubleClick=function($){var tt=$.getDocumentPosition(),st=this.editor,lt=st.session,ct=lt.getBracketRange(tt);ct?(ct.isEmpty()&&(ct.start.column--,ct.end.column++),this.setState("select")):(ct=st.selection.getWordRange(tt.row,tt.column),this.setState("selectByWords")),this.$clickSelection=ct,this.select()},_.prototype.onTripleClick=function($){var tt=$.getDocumentPosition(),st=this.editor;this.setState("selectByLines");var lt=st.getSelectionRange();lt.isMultiLine()&<.contains(tt.row,tt.column)?(this.$clickSelection=st.selection.getLineRange(lt.start.row),this.$clickSelection.end=st.selection.getLineRange(lt.end.row).end):this.$clickSelection=st.selection.getLineRange(tt.row),this.select()},_.prototype.onQuadClick=function($){var tt=this.editor;tt.selectAll(),this.$clickSelection=tt.getSelectionRange(),this.setState("selectAll")},_.prototype.onMouseWheel=function($){if(!$.getAccelKey()){$.getShiftKey()&&$.wheelY&&!$.wheelX&&($.wheelX=$.wheelY,$.wheelY=0);var tt=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var st=this.$lastScroll,lt=$.domEvent.timeStamp,ct=lt-st.t,ht=ct?$.wheelX/ct:st.vx,ut=ct?$.wheelY/ct:st.vy;ct=1&&tt.renderer.isScrollableBy($.wheelX*$.speed,0)&&(mt=!0),pt<=1&&tt.renderer.isScrollableBy(0,$.wheelY*$.speed)&&(mt=!0),mt)st.allowed=lt;else if(lt-st.allowedat.clientHeight;nt||ot.preventDefault()}}),ace.define("ace/tooltip",["require","exports","module","ace/lib/dom","ace/lib/event","ace/range","ace/lib/scroll"],function(o,a,rt){var et=this&&this.__extends||function(){var lt=function(ct,ht){return lt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ut,pt){ut.__proto__=pt}||function(ut,pt){for(var mt in pt)Object.prototype.hasOwnProperty.call(pt,mt)&&(ut[mt]=pt[mt])},lt(ct,ht)};return function(ct,ht){if(typeof ht!="function"&&ht!==null)throw new TypeError("Class extends value "+String(ht)+" is not a constructor or null");lt(ct,ht);function ut(){this.constructor=ct}ct.prototype=ht===null?Object.create(ht):(ut.prototype=ht.prototype,new ut)}}(),ot=this&&this.__values||function(lt){var ct=typeof Symbol=="function"&&Symbol.iterator,ht=ct&<[ct],ut=0;if(ht)return ht.call(lt);if(lt&&typeof lt.length=="number")return{next:function(){return lt&&ut>=lt.length&&(lt=void 0),{value:lt&<[ut++],done:!lt}}};throw new TypeError(ct?"Object is not iterable.":"Symbol.iterator is not defined.")},at=o("./lib/dom");o("./lib/event");var nt=o("./range").Range,it=o("./lib/scroll").preventParentScroll,j="ace_tooltip",_=function(){function lt(ct){this.isOpen=!1,this.$element=null,this.$parentNode=ct}return lt.prototype.$init=function(){return this.$element=at.createElement("div"),this.$element.className=j,this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},lt.prototype.getElement=function(){return this.$element||this.$init()},lt.prototype.setText=function(ct){this.getElement().textContent=ct},lt.prototype.setHtml=function(ct){this.getElement().innerHTML=ct},lt.prototype.setPosition=function(ct,ht){this.getElement().style.left=ct+"px",this.getElement().style.top=ht+"px"},lt.prototype.setClassName=function(ct){at.addCssClass(this.getElement(),ct)},lt.prototype.setTheme=function(ct){this.$element.className=j+" "+(ct.isDark?"ace_dark ":"")+(ct.cssClass||"")},lt.prototype.show=function(ct,ht,ut){ct!=null&&this.setText(ct),ht!=null&&ut!=null&&this.setPosition(ht,ut),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},lt.prototype.hide=function(ct){this.isOpen&&(this.getElement().style.display="none",this.getElement().className=j,this.isOpen=!1)},lt.prototype.getHeight=function(){return this.getElement().offsetHeight},lt.prototype.getWidth=function(){return this.getElement().offsetWidth},lt.prototype.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)},lt}(),$=function(){function lt(){this.popups=[]}return lt.prototype.addPopup=function(ct){this.popups.push(ct),this.updatePopups()},lt.prototype.removePopup=function(ct){var ht=this.popups.indexOf(ct);ht!==-1&&(this.popups.splice(ht,1),this.updatePopups())},lt.prototype.updatePopups=function(){var ct,ht,ut,pt;this.popups.sort(function(Et,kt){return kt.priority-Et.priority});var mt=[];try{for(var gt=ot(this.popups),dt=gt.next();!dt.done;dt=gt.next()){var St=dt.value,xt=!0;try{for(var yt=(ut=void 0,ot(mt)),_t=yt.next();!_t.done;_t=yt.next()){var Ct=_t.value;if(this.doPopupsOverlap(Ct,St)){xt=!1;break}}}catch(Et){ut={error:Et}}finally{try{_t&&!_t.done&&(pt=yt.return)&&pt.call(yt)}finally{if(ut)throw ut.error}}xt?mt.push(St):St.hide()}}catch(Et){ct={error:Et}}finally{try{dt&&!dt.done&&(ht=gt.return)&&ht.call(gt)}finally{if(ct)throw ct.error}}},lt.prototype.doPopupsOverlap=function(ct,ht){var ut=ct.getElement().getBoundingClientRect(),pt=ht.getElement().getBoundingClientRect();return ut.leftpt.left&&ut.toppt.top},lt}(),tt=new $;a.popupManager=tt,a.Tooltip=_;var st=function(lt){et(ct,lt);function ct(ht){ht===void 0&&(ht=document.body);var ut=lt.call(this,ht)||this;ut.timeout=void 0,ut.lastT=0,ut.idleTime=350,ut.lastEvent=void 0,ut.onMouseOut=ut.onMouseOut.bind(ut),ut.onMouseMove=ut.onMouseMove.bind(ut),ut.waitForHover=ut.waitForHover.bind(ut),ut.hide=ut.hide.bind(ut);var pt=ut.getElement();return pt.style.whiteSpace="pre-wrap",pt.style.pointerEvents="auto",pt.addEventListener("mouseout",ut.onMouseOut),pt.tabIndex=-1,pt.addEventListener("blur",(function(){pt.contains(document.activeElement)||this.hide()}).bind(ut)),pt.addEventListener("wheel",it),ut}return ct.prototype.addToEditor=function(ht){ht.on("mousemove",this.onMouseMove),ht.on("mousedown",this.hide),ht.renderer.getMouseEventTarget().addEventListener("mouseout",this.onMouseOut,!0)},ct.prototype.removeFromEditor=function(ht){ht.off("mousemove",this.onMouseMove),ht.off("mousedown",this.hide),ht.renderer.getMouseEventTarget().removeEventListener("mouseout",this.onMouseOut,!0),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},ct.prototype.onMouseMove=function(ht,ut){this.lastEvent=ht,this.lastT=Date.now();var pt=ut.$mouseHandler.isMousePressed;if(this.isOpen){var mt=this.lastEvent&&this.lastEvent.getDocumentPosition();(!this.range||!this.range.contains(mt.row,mt.column)||pt||this.isOutsideOfText(this.lastEvent))&&this.hide()}this.timeout||pt||(this.lastEvent=ht,this.timeout=setTimeout(this.waitForHover,this.idleTime))},ct.prototype.waitForHover=function(){this.timeout&&clearTimeout(this.timeout);var ht=Date.now()-this.lastT;if(this.idleTime-ht>10){this.timeout=setTimeout(this.waitForHover,this.idleTime-ht);return}this.timeout=null,this.lastEvent&&!this.isOutsideOfText(this.lastEvent)&&this.$gatherData(this.lastEvent,this.lastEvent.editor)},ct.prototype.isOutsideOfText=function(ht){var ut=ht.editor,pt=ht.getDocumentPosition(),mt=ut.session.getLine(pt.row);if(pt.column==mt.length){var gt=ut.renderer.pixelToScreenCoordinates(ht.clientX,ht.clientY),dt=ut.session.documentToScreenPosition(pt.row,pt.column);if(dt.column!=gt.column||dt.row!=gt.row)return!0}return!1},ct.prototype.setDataProvider=function(ht){this.$gatherData=ht},ct.prototype.showForRange=function(ht,ut,pt,mt){var gt=10;if(!(mt&&mt!=this.lastEvent)&&!(this.isOpen&&document.activeElement==this.getElement())){var dt=ht.renderer;this.isOpen||(tt.addPopup(this),this.$registerCloseEvents(),this.setTheme(dt.theme)),this.isOpen=!0,this.addMarker(ut,ht.session),this.range=nt.fromPoints(ut.start,ut.end);var St=dt.textToScreenCoordinates(ut.start.row,ut.start.column),xt=dt.scroller.getBoundingClientRect();St.pageX=tt.length&&(tt=void 0),{value:tt&&tt[ct++],done:!tt}}};throw new TypeError(st?"Object is not iterable.":"Symbol.iterator is not defined.")},at=o("../lib/dom"),nt=o("../lib/event"),it=o("../tooltip").Tooltip,j=o("../config").nls;o("../lib/lang");function _(tt){var st=tt.editor,lt=st.renderer.$gutterLayer,ct=new $(st);tt.editor.setDefaultHandler("guttermousedown",function(dt){if(!(!st.isFocused()||dt.getButton()!=0)){var St=lt.getRegion(dt);if(St!="foldWidgets"){var xt=dt.getDocumentPosition().row,yt=st.session.selection;if(dt.getShiftKey())yt.selectTo(xt,0);else{if(dt.domEvent.detail==2)return st.selectAll(),dt.preventDefault();tt.$clickSelection=st.selection.getLineRange(xt)}return tt.setState("selectByLines"),tt.captureMouse(dt),dt.preventDefault()}}});var ht,ut;function pt(){var dt=ut.getDocumentPosition().row,St=st.session.getLength();if(dt==St){var xt=st.renderer.pixelToScreenCoordinates(0,ut.y).row,yt=ut.$pos;if(xt>st.session.documentToScreenRow(yt.row,yt.column))return mt()}if(ct.showTooltip(dt),!!ct.isOpen)if(st.on("mousewheel",mt),tt.$tooltipFollowsMouse)gt(ut);else{var _t=ut.getGutterRow(),Ct=lt.$lines.get(_t);if(Ct){var Et=Ct.element.querySelector(".ace_gutter_annotation"),kt=Et.getBoundingClientRect(),Tt=ct.getElement().style;Tt.left=kt.right+"px",Tt.top=kt.bottom+"px"}else gt(ut)}}function mt(){ht&&(ht=clearTimeout(ht)),ct.isOpen&&(ct.hideTooltip(),st.off("mousewheel",mt))}function gt(dt){ct.setPosition(dt.x,dt.y)}tt.editor.setDefaultHandler("guttermousemove",function(dt){var St=dt.domEvent.target||dt.domEvent.srcElement;if(at.hasCssClass(St,"ace_fold-widget"))return mt();ct.isOpen&&tt.$tooltipFollowsMouse&>(dt),ut=dt,!ht&&(ht=setTimeout(function(){ht=null,ut&&!tt.isMousePressed?pt():mt()},50))}),nt.addListener(st.renderer.$gutter,"mouseout",function(dt){ut=null,!(!ct.isOpen||ht)&&(ht=setTimeout(function(){ht=null,mt()},50))},st),st.on("changeSession",mt),st.on("input",mt)}a.GutterHandler=_;var $=function(tt){et(st,tt);function st(lt){var ct=tt.call(this,lt.container)||this;return ct.editor=lt,ct}return st.prototype.setPosition=function(lt,ct){var ht=window.innerWidth||document.documentElement.clientWidth,ut=window.innerHeight||document.documentElement.clientHeight,pt=this.getWidth(),mt=this.getHeight();lt+=15,ct+=15,lt+pt>ht&&(lt-=lt+pt-ht),ct+mt>ut&&(ct-=20+mt),it.prototype.setPosition.call(this,lt,ct)},Object.defineProperty(st,"annotationLabels",{get:function(){return{error:{singular:j("gutter-tooltip.aria-label.error.singular","error"),plural:j("gutter-tooltip.aria-label.error.plural","errors")},warning:{singular:j("gutter-tooltip.aria-label.warning.singular","warning"),plural:j("gutter-tooltip.aria-label.warning.plural","warnings")},info:{singular:j("gutter-tooltip.aria-label.info.singular","information message"),plural:j("gutter-tooltip.aria-label.info.plural","information messages")}}},enumerable:!1,configurable:!0}),st.prototype.showTooltip=function(lt){var ct,ht=this.editor.renderer.$gutterLayer,ut=ht.$annotations[lt],pt;ut?pt={displayText:Array.from(ut.displayText),type:Array.from(ut.type)}:pt={displayText:[],type:[]};var mt=ht.session.getFoldLine(lt);if(mt&&ht.$showFoldedAnnotations){for(var gt={error:[],warning:[],info:[]},dt,St=lt+1;St<=mt.end.row;St++)if(ht.$annotations[St])for(var xt=0;xtj?Et=null:Zt-Et>=it&&(st.renderer.scrollCursorIntoView(),Et=null)}}function $t(zt,Ht){var Zt=Date.now(),qt=st.renderer.layerConfig.lineHeight,hr=st.renderer.layerConfig.characterWidth,fr=st.renderer.scroller.getBoundingClientRect(),mr={x:{left:pt-fr.left,right:fr.right-pt},y:{top:mt-fr.top,bottom:fr.bottom-mt}},gr=Math.min(mr.x.left,mr.x.right),tr=Math.min(mr.y.top,mr.y.bottom),rr={row:zt.row,column:zt.column};gr/hr<=2&&(rr.column+=mr.x.left=nt&&st.renderer.scrollCursorIntoView(rr):Ct=Zt:Ct=null}function It(){var zt=St;St=st.renderer.screenToTextCoordinates(pt,mt),Tt(St,zt),$t(St,zt)}function Ot(){dt=st.selection.toOrientedRange(),ut=st.session.addMarker(dt,"ace_selection",st.getSelectionStyle()),st.clearSelection(),st.isFocused()&&st.renderer.$cursorLayer.setBlinking(!1),clearInterval(gt),It(),gt=setInterval(It,20),xt=0,ot.addListener(document,"mousemove",Bt)}function Mt(){clearInterval(gt),st.session.removeMarker(ut),ut=null,st.selection.fromOrientedRange(dt),st.isFocused()&&!_t&&st.$resetCursorStyle(),dt=null,St=null,xt=0,Ct=null,Et=null,ot.removeListener(document,"mousemove",Bt)}var Dt=null;function Bt(){Dt==null&&(Dt=setTimeout(function(){Dt!=null&&ut&&Mt()},20))}function Kt(zt){var Ht=zt.types;return!Ht||Array.prototype.some.call(Ht,function(Zt){return Zt=="text/plain"||Zt=="Text"})}function Wt(zt){var Ht=["copy","copymove","all","uninitialized"],Zt=["move","copymove","linkmove","all","uninitialized"],qt=at.isMac?zt.altKey:zt.ctrlKey,hr="uninitialized";try{hr=zt.dataTransfer.effectAllowed.toLowerCase()}catch{}var fr="none";return qt&&Ht.indexOf(hr)>=0?fr="copy":Zt.indexOf(hr)>=0?fr="move":Ht.indexOf(hr)>=0&&(fr="copy"),fr}}(function(){this.dragWait=function(){var tt=Date.now()-this.mousedownEvent.time;tt>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var tt=this.editor.container;tt.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(tt){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var tt=this.editor,st=tt.container;st.draggable=!0,tt.renderer.$cursorLayer.setBlinking(!1),tt.setStyle("ace_dragging");var lt=at.isWin?"default":"move";tt.renderer.setCursorStyle(lt),this.setState("dragReady")},this.onMouseDrag=function(tt){var st=this.editor.container;if(at.isIE&&this.state=="dragReady"){var lt=$(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);lt>3&&st.dragDrop()}if(this.state==="dragWait"){var lt=$(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);lt>0&&(st.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(tt){if(this.$dragEnabled){this.mousedownEvent=tt;var st=this.editor,lt=tt.inSelection(),ct=tt.getButton(),ht=tt.domEvent.detail||1;if(ht===1&&ct===0&<){if(tt.editor.inMultiSelectMode&&(tt.getAccelKey()||tt.getShiftKey()))return;this.mousedownEvent.time=Date.now();var ut=tt.domEvent.target||tt.domEvent.srcElement;if("unselectable"in ut&&(ut.unselectable="on"),st.getDragDelay()){if(at.isWebKit){this.cancelDrag=!0;var pt=st.container;pt.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(tt,this.onMouseDrag.bind(this)),tt.defaultPrevented=!0}}}}).call(_.prototype);function $(tt,st,lt,ct){return Math.sqrt(Math.pow(lt-tt,2)+Math.pow(ct-st,2))}a.DragdropHandler=_}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(o,a,rt){var et=o("./mouse_event").MouseEvent,ot=o("../lib/event"),at=o("../lib/dom");a.addTouchListeners=function(nt,it){var j="scroll",_,$,tt,st,lt,ct,ht=0,ut,pt=0,mt=0,gt=0,dt,St;function xt(){var Tt=window.navigator&&window.navigator.clipboard,$t=!1,It=function(){var Dt=it.getCopyText(),Bt=it.session.getUndoManager().hasUndo();St.replaceChild(at.buildDom($t?["span",!Dt&&Ot("selectall")&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],Dt&&Ot("copy")&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],Dt&&Ot("cut")&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],Tt&&Ot("paste")&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],Bt&&Ot("undo")&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],Ot("find")&&["span",{class:"ace_mobile-button",action:"find"},"Find"],Ot("openCommandPalette")&&["span",{class:"ace_mobile-button",action:"openCommandPalette"},"Palette"]]:["span"]),St.firstChild)},Ot=function(Dt){return it.commands.canExecute(Dt,it)},Mt=function(Dt){var Bt=Dt.target.getAttribute("action");if(Bt=="more"||!$t)return $t=!$t,It();Bt=="paste"?Tt.readText().then(function(Kt){it.execCommand(Bt,Kt)}):Bt&&((Bt=="cut"||Bt=="copy")&&(Tt?Tt.writeText(it.getCopyText()):document.execCommand("copy")),it.execCommand(Bt)),St.firstChild.style.display="none",$t=!1,Bt!="openCommandPalette"&&it.focus()};St=at.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(Dt){j="menu",Dt.stopPropagation(),Dt.preventDefault(),it.textInput.focus()},ontouchend:function(Dt){Dt.stopPropagation(),Dt.preventDefault(),Mt(Dt)},onclick:Mt},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],it.container)}function yt(){if(!it.getOption("enableMobileMenu")){St&&_t();return}St||xt();var Tt=it.selection.cursor,$t=it.renderer.textToScreenCoordinates(Tt.row,Tt.column),It=it.renderer.textToScreenCoordinates(0,0).pageX,Ot=it.renderer.scrollLeft,Mt=it.container.getBoundingClientRect();St.style.top=$t.pageY-Mt.top-3+"px",$t.pageX-Mt.left=2?it.selection.getLineRange(ut.row):it.session.getBracketRange(ut);Tt&&!Tt.isEmpty()?it.selection.setRange(Tt):it.selection.selectWord(),j="wait"}ot.addListener(nt,"contextmenu",function(Tt){if(dt){var $t=it.textInput.getElement();$t.focus()}},it),ot.addListener(nt,"touchstart",function(Tt){var $t=Tt.touches;if(lt||$t.length>1){clearTimeout(lt),lt=null,tt=-1,j="zoom";return}dt=it.$mouseHandler.isMousePressed=!0;var It=it.renderer.layerConfig.lineHeight,Ot=it.renderer.layerConfig.lineHeight,Mt=Tt.timeStamp;st=Mt;var Dt=$t[0],Bt=Dt.clientX,Kt=Dt.clientY;Math.abs(_-Bt)+Math.abs($-Kt)>It&&(tt=-1),_=Tt.clientX=Bt,$=Tt.clientY=Kt,mt=gt=0;var Wt=new et(Tt,it);if(ut=Wt.getDocumentPosition(),Mt-tt<500&&$t.length==1&&!ht)pt++,Tt.preventDefault(),Tt.button=0,Et();else{pt=0;var zt=it.selection.cursor,Ht=it.selection.isEmpty()?zt:it.selection.anchor,Zt=it.renderer.$cursorLayer.getPixelPosition(zt,!0),qt=it.renderer.$cursorLayer.getPixelPosition(Ht,!0),hr=it.renderer.scroller.getBoundingClientRect(),fr=it.renderer.layerConfig.offset,mr=it.renderer.scrollLeft,gr=function(Qt,xr){return Qt=Qt/Ot,xr=xr/It-.75,Qt*Qt+xr*xr};if(Tt.clientXrr?"cursor":"anchor"),rr<3.5?j="anchor":tr<3.5?j="cursor":j="scroll",lt=setTimeout(Ct,450)}tt=Mt},it),ot.addListener(nt,"touchend",function(Tt){dt=it.$mouseHandler.isMousePressed=!1,ct&&clearInterval(ct),j=="zoom"?(j="",ht=0):lt?(it.selection.moveToPosition(ut),ht=0,yt()):j=="scroll"?(kt(),_t()):yt(),clearTimeout(lt),lt=null},it),ot.addListener(nt,"touchmove",function(Tt){lt&&(clearTimeout(lt),lt=null);var $t=Tt.touches;if(!($t.length>1||j=="zoom")){var It=$t[0],Ot=_-It.clientX,Mt=$-It.clientY;if(j=="wait")if(Ot*Ot+Mt*Mt>4)j="cursor";else return Tt.preventDefault();_=It.clientX,$=It.clientY,Tt.clientX=It.clientX,Tt.clientY=It.clientY;var Dt=Tt.timeStamp,Bt=Dt-st;if(st=Dt,j=="scroll"){var Kt=new et(Tt,it);Kt.speed=1,Kt.wheelX=Ot,Kt.wheelY=Mt,10*Math.abs(Ot)0)if(rr==16){for(Sr=xr;Sr-1){for(Sr=xr;Sr=0&&qt[tn]==dt;tn--)Ht[tn]=et}}}function Bt(zt,Ht,Zt){if(!(ot=zt){for(fr=hr+1;fr=zt;)fr++;for(mr=hr,gr=fr-1;mr=Ht.length||(fr=Zt[qt-1])!=ct&&fr!=ht||(mr=Ht[qt+1])!=ct&&mr!=ht?ut:(at&&(mr=ht),mr==fr?mr:ut);case xt:return fr=qt>0?Zt[qt-1]:pt,fr==ct&&qt+10&&Zt[qt-1]==ct)return ct;if(at)return ut;for(tr=qt+1,gr=Ht.length;tr=1425&&rr<=2303||rr==64286;if(fr=Ht[tr],Qt&&(fr==lt||fr==gt))return lt}return qt<1||(fr=Ht[qt-1])==pt?ut:Zt[qt-1];case pt:return at=!1,nt=!0,et;case mt:return it=!0,ut;case Ct:case Et:case Tt:case $t:case kt:at=!1;case It:return ut}}function Wt(zt){var Ht=zt.charCodeAt(0),Zt=Ht>>8;return Zt==0?Ht>191?st:Ot[Ht]:Zt==5?/[\u0591-\u05f4]/.test(zt)?lt:st:Zt==6?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(zt)?_t:/[\u0660-\u0669\u066b-\u066c]/.test(zt)?ht:Ht==1642?yt:/[\u06f0-\u06f9]/.test(zt)?ct:gt:Zt==32&&Ht<=8287?Mt[Ht&255]:Zt==254&&Ht>=65136?gt:ut}a.L=st,a.R=lt,a.EN=ct,a.ON_R=3,a.AN=4,a.R_H=5,a.B=6,a.RLE=7,a.DOT="·",a.doBidiReorder=function(zt,Ht,Zt){if(zt.length<2)return{};var qt=zt.split(""),hr=new Array(qt.length),fr=new Array(qt.length),mr=[];et=Zt?tt:$,Dt(qt,mr,qt.length,Ht);for(var gr=0;grgt&&Ht[gr]0&&qt[gr-1]==="ل"&&/\u0622|\u0623|\u0625|\u0627/.test(qt[gr])&&(mr[gr-1]=mr[gr]=a.R_H,gr++);qt[qt.length-1]===a.DOT&&(mr[qt.length-1]=a.B),qt[0]==="‫"&&(mr[0]=a.RLE);for(var gr=0;gr=0&&(j=this.session.$docRowCache[$])}return j},it.prototype.getSplitIndex=function(){var j=0,_=this.session.$screenRowCache;if(_.length)for(var $,tt=this.session.$getRowCacheIndex(_,this.currentRow);this.currentRow-j>0&&($=this.session.$getRowCacheIndex(_,this.currentRow-j-1),$===tt);)tt=$,j++;else j=this.currentRow;return j},it.prototype.updateRowLine=function(j,_){j===void 0&&(j=this.getDocumentRow());var $=j===this.session.getLength()-1,tt=$?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(j),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var st=this.session.$wrapData[j];st&&(_===void 0&&(_=this.getSplitIndex()),_>0&&st.length?(this.wrapIndent=st.indent,this.wrapOffset=this.wrapIndent*this.charWidths[et.L],this.line=__?this.session.getOverwrite()?j:j-1:_,tt=et.getVisualFromLogicalIdx($,this.bidiMap),st=this.bidiMap.bidiLevels,lt=0;!this.session.getOverwrite()&&j<=_&&st[tt]%2!==0&&tt++;for(var ct=0;ct_&&st[tt]%2===0&&(lt+=this.charWidths[st[tt]]),this.wrapIndent&&(lt+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(lt+=this.rtlLineOffset),lt},it.prototype.getSelections=function(j,_){var $=this.bidiMap,tt=$.bidiLevels,st,lt=[],ct=0,ht=Math.min(j,_)-this.wrapIndent,ut=Math.max(j,_)-this.wrapIndent,pt=!1,mt=!1,gt=0;this.wrapIndent&&(ct+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var dt,St=0;St=ht&&dttt+ct/2;){if(tt+=ct,st===lt.length-1){ct=0;break}ct=this.charWidths[lt[++st]]}return st>0&<[st-1]%2!==0&<[st]%2===0?($0&<[st-1]%2===0&<[st]%2!==0?_=1+($>tt?this.bidiMap.logicalFromVisual[st]:this.bidiMap.logicalFromVisual[st-1]):this.isRtlDir&&st===lt.length-1&&ct===0&<[st-1]%2===0||!this.isRtlDir&&st===0&<[st]%2!==0?_=1+this.bidiMap.logicalFromVisual[st]:(st>0&<[st-1]%2!==0&&ct!==0&&st--,_=this.bidiMap.logicalFromVisual[st]),_===0&&this.isRtlDir&&_++,_+this.wrapIndent},it}();a.BidiHandler=nt}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(o,a,rt){var et=o("./lib/oop"),ot=o("./lib/lang"),at=o("./lib/event_emitter").EventEmitter,nt=o("./range").Range,it=function(){function j(_){this.session=_,this.doc=_.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var $=this;this.cursor.on("change",function(tt){$.$cursorChanged=!0,$.$silent||$._emit("changeCursor"),!$.$isEmpty&&!$.$silent&&$._emit("changeSelection"),!$.$keepDesiredColumnOnChange&&tt.old.column!=tt.value.column&&($.$desiredColumn=null)}),this.anchor.on("change",function(){$.$anchorChanged=!0,!$.$isEmpty&&!$.$silent&&$._emit("changeSelection")})}return j.prototype.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},j.prototype.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},j.prototype.getCursor=function(){return this.lead.getPosition()},j.prototype.setAnchor=function(_,$){this.$isEmpty=!1,this.anchor.setPosition(_,$)},j.prototype.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},j.prototype.getSelectionLead=function(){return this.lead.getPosition()},j.prototype.isBackwards=function(){var _=this.anchor,$=this.lead;return _.row>$.row||_.row==$.row&&_.column>$.column},j.prototype.getRange=function(){var _=this.anchor,$=this.lead;return this.$isEmpty?nt.fromPoints($,$):this.isBackwards()?nt.fromPoints($,_):nt.fromPoints(_,$)},j.prototype.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},j.prototype.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},j.prototype.setRange=function(_,$){var tt=$?_.end:_.start,st=$?_.start:_.end;this.$setSelection(tt.row,tt.column,st.row,st.column)},j.prototype.$setSelection=function(_,$,tt,st){if(!this.$silent){var lt=this.$isEmpty,ct=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(_,$),this.cursor.setPosition(tt,st),this.$isEmpty=!nt.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||lt!=this.$isEmpty||ct)&&this._emit("changeSelection")}},j.prototype.$moveSelection=function(_){var $=this.lead;this.$isEmpty&&this.setSelectionAnchor($.row,$.column),_.call(this)},j.prototype.selectTo=function(_,$){this.$moveSelection(function(){this.moveCursorTo(_,$)})},j.prototype.selectToPosition=function(_){this.$moveSelection(function(){this.moveCursorToPosition(_)})},j.prototype.moveTo=function(_,$){this.clearSelection(),this.moveCursorTo(_,$)},j.prototype.moveToPosition=function(_){this.clearSelection(),this.moveCursorToPosition(_)},j.prototype.selectUp=function(){this.$moveSelection(this.moveCursorUp)},j.prototype.selectDown=function(){this.$moveSelection(this.moveCursorDown)},j.prototype.selectRight=function(){this.$moveSelection(this.moveCursorRight)},j.prototype.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},j.prototype.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},j.prototype.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},j.prototype.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},j.prototype.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},j.prototype.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},j.prototype.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},j.prototype.getWordRange=function(_,$){if(typeof $>"u"){var tt=_||this.lead;_=tt.row,$=tt.column}return this.session.getWordRange(_,$)},j.prototype.selectWord=function(){this.setSelectionRange(this.getWordRange())},j.prototype.selectAWord=function(){var _=this.getCursor(),$=this.session.getAWordRange(_.row,_.column);this.setSelectionRange($)},j.prototype.getLineRange=function(_,$){var tt=typeof _=="number"?_:this.lead.row,st,lt=this.session.getFoldLine(tt);return lt?(tt=lt.start.row,st=lt.end.row):st=tt,$===!0?new nt(tt,0,st,this.session.getLine(st).length):new nt(tt,0,st+1,0)},j.prototype.selectLine=function(){this.setSelectionRange(this.getLineRange())},j.prototype.moveCursorUp=function(){this.moveCursorBy(-1,0)},j.prototype.moveCursorDown=function(){this.moveCursorBy(1,0)},j.prototype.wouldMoveIntoSoftTab=function(_,$,tt){var st=_.column,lt=_.column+$;return tt<0&&(st=_.column-$,lt=_.column),this.session.isTabStop(_)&&this.doc.getLine(_.row).slice(st,lt).split(" ").length-1==$},j.prototype.moveCursorLeft=function(){var _=this.lead.getPosition(),$;if($=this.session.getFoldAt(_.row,_.column,-1))this.moveCursorTo($.start.row,$.start.column);else if(_.column===0)_.row>0&&this.moveCursorTo(_.row-1,this.doc.getLine(_.row-1).length);else{var tt=this.session.getTabSize();this.wouldMoveIntoSoftTab(_,tt,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-tt):this.moveCursorBy(0,-1)}},j.prototype.moveCursorRight=function(){var _=this.lead.getPosition(),$;if($=this.session.getFoldAt(_.row,_.column,1))this.moveCursorTo($.end.row,$.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&($.column=st)}}this.moveCursorTo($.row,$.column)},j.prototype.moveCursorFileEnd=function(){var _=this.doc.getLength()-1,$=this.doc.getLine(_).length;this.moveCursorTo(_,$)},j.prototype.moveCursorFileStart=function(){this.moveCursorTo(0,0)},j.prototype.moveCursorLongWordRight=function(){var _=this.lead.row,$=this.lead.column,tt=this.doc.getLine(_),st=tt.substring($);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var lt=this.session.getFoldAt(_,$,1);if(lt){this.moveCursorTo(lt.end.row,lt.end.column);return}if(this.session.nonTokenRe.exec(st)&&($+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,st=tt.substring($)),$>=tt.length){this.moveCursorTo(_,tt.length),this.moveCursorRight(),_0&&this.moveCursorWordLeft();return}this.session.tokenRe.exec(lt)&&($-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(_,$)},j.prototype.$shortWordEndIndex=function(_){var $=0,tt,st=/\s/,lt=this.session.tokenRe;if(lt.lastIndex=0,this.session.tokenRe.exec(_))$=this.session.tokenRe.lastIndex;else{for(;(tt=_[$])&&st.test(tt);)$++;if($<1){for(lt.lastIndex=0;(tt=_[$])&&!lt.test(tt);)if(lt.lastIndex=0,$++,st.test(tt))if($>2){$--;break}else{for(;(tt=_[$])&&st.test(tt);)$++;if($>2)break}}}return lt.lastIndex=0,$},j.prototype.moveCursorShortWordRight=function(){var _=this.lead.row,$=this.lead.column,tt=this.doc.getLine(_),st=tt.substring($),lt=this.session.getFoldAt(_,$,1);if(lt)return this.moveCursorTo(lt.end.row,lt.end.column);if($==tt.length){var ct=this.doc.getLength();do _++,st=this.doc.getLine(_);while(_0&&/^\s*$/.test(st));$=st.length,/\s+$/.test(st)||(st="")}var lt=ot.stringReverse(st),ct=this.$shortWordEndIndex(lt);return this.moveCursorTo(_,$-ct)},j.prototype.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},j.prototype.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},j.prototype.moveCursorBy=function(_,$){var tt=this.session.documentToScreenPosition(this.lead.row,this.lead.column),st;if($===0&&(_!==0&&(this.session.$bidiHandler.isBidiRow(tt.row,this.lead.row)?(st=this.session.$bidiHandler.getPosLeft(tt.column),tt.column=Math.round(st/this.session.$bidiHandler.charWidths[0])):st=tt.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?tt.column=this.$desiredColumn:this.$desiredColumn=tt.column),_!=0&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var lt=this.session.lineWidgets[this.lead.row];_<0?_-=lt.rowsAbove||0:_>0&&(_+=lt.rowCount-(lt.rowsAbove||0))}var ct=this.session.screenToDocumentPosition(tt.row+_,tt.column,st);_!==0&&$===0&&ct.row===this.lead.row&&(ct.column,this.lead.column),this.moveCursorTo(ct.row,ct.column+$,$===0)},j.prototype.moveCursorToPosition=function(_){this.moveCursorTo(_.row,_.column)},j.prototype.moveCursorTo=function(_,$,tt){var st=this.session.getFoldAt(_,$,1);st&&(_=st.start.row,$=st.start.column),this.$keepDesiredColumnOnChange=!0;var lt=this.session.getLine(_);/[\uDC00-\uDFFF]/.test(lt.charAt($))&<.charAt($-1)&&(this.lead.row==_&&this.lead.column==$+1?$=$-1:$=$+1),this.lead.setPosition(_,$),this.$keepDesiredColumnOnChange=!1,tt||(this.$desiredColumn=null)},j.prototype.moveCursorToScreen=function(_,$,tt){var st=this.session.screenToDocumentPosition(_,$);this.moveCursorTo(st.row,st.column,tt)},j.prototype.detach=function(){this.lead.detach(),this.anchor.detach()},j.prototype.fromOrientedRange=function(_){this.setSelectionRange(_,_.cursor==_.start),this.$desiredColumn=_.desiredColumn||this.$desiredColumn},j.prototype.toOrientedRange=function(_){var $=this.getRange();return _?(_.start.column=$.start.column,_.start.row=$.start.row,_.end.column=$.end.column,_.end.row=$.end.row):_=$,_.cursor=this.isBackwards()?_.start:_.end,_.desiredColumn=this.$desiredColumn,_},j.prototype.getRangeOfMovements=function(_){var $=this.getCursor();try{_(this);var tt=this.getCursor();return nt.fromPoints($,tt)}catch{return nt.fromPoints($,$)}finally{this.moveCursorToPosition($)}},j.prototype.toJSON=function(){if(this.rangeCount)var _=this.ranges.map(function($){var tt=$.clone();return tt.isBackwards=$.cursor==$.start,tt});else{var _=this.getRange();_.isBackwards=this.isBackwards()}return _},j.prototype.fromJSON=function(_){if(_.start==null)if(this.rangeList&&_.length>1){this.toSingleRange(_[0]);for(var $=_.length;$--;){var tt=nt.fromPoints(_[$].start,_[$].end);_[$].isBackwards&&(tt.cursor=tt.start),this.addRange(tt,!0)}return}else _=_[0];this.rangeList&&this.toSingleRange(_),this.setSelectionRange(_,_.isBackwards)},j.prototype.isEqual=function(_){if((_.length||this.rangeCount)&&_.length!=this.rangeCount)return!1;if(!_.length||!this.ranges)return this.getRange().isEqual(_);for(var $=this.ranges.length;$--;)if(!this.ranges[$].isEqual(_[$]))return!1;return!0},j}();it.prototype.setSelectionAnchor=it.prototype.setAnchor,it.prototype.getSelectionAnchor=it.prototype.getAnchor,it.prototype.setSelectionRange=it.prototype.setRange,et.implement(it.prototype,at),a.Selection=it}),ace.define("ace/tokenizer",["require","exports","module","ace/lib/report_error"],function(o,a,rt){var et=o("./lib/report_error").reportError,ot=2e3,at=function(){function nt(it){this.splitRegex,this.states=it,this.regExps={},this.matchMappings={};for(var j in this.states){for(var _=this.states[j],$=[],tt=0,st=this.matchMappings[j]={defaultToken:"text"},lt="g",ct=[],ht=0;ht<_.length;ht++){var ut=_[ht];if(ut.defaultToken&&(st.defaultToken=ut.defaultToken),ut.caseInsensitive&<.indexOf("i")===-1&&(lt+="i"),ut.unicode&<.indexOf("u")===-1&&(lt+="u"),ut.regex!=null){ut.regex instanceof RegExp&&(ut.regex=ut.regex.toString().slice(1,-1));var pt=ut.regex,mt=new RegExp("(?:("+pt+")|(.))").exec("a").length-2;Array.isArray(ut.token)?ut.token.length==1||mt==1?ut.token=ut.token[0]:mt-1!=ut.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:ut,groupCount:mt-1}),ut.token=ut.token[0]):(ut.tokenArray=ut.token,ut.token=null,ut.onMatch=this.$arrayTokens):typeof ut.token=="function"&&!ut.onMatch&&(mt>1?ut.onMatch=this.$applyToken:ut.onMatch=ut.token),mt>1&&(/\\\d/.test(ut.regex)?pt=ut.regex.replace(/\\([0-9]+)/g,function(gt,dt){return"\\"+(parseInt(dt,10)+tt+1)}):(mt=1,pt=this.removeCapturingGroups(ut.regex)),!ut.splitRegex&&typeof ut.token!="string"&&ct.push(ut)),st[tt]=ht,tt+=mt,$.push(pt),ut.onMatch||(ut.onMatch=null)}}$.length||(st[0]=0,$.push("$")),ct.forEach(function(gt){gt.splitRegex=this.createSplitterRegexp(gt.regex,lt)},this),this.regExps[j]=new RegExp("("+$.join(")|(")+")|($)",lt)}}return nt.prototype.$setMaxTokenCount=function(it){ot=it|0},nt.prototype.$applyToken=function(it){var j=this.splitRegex.exec(it).slice(1),_=this.token.apply(this,j);if(typeof _=="string")return[{type:_,value:it}];for(var $=[],tt=0,st=_.length;ttut){var yt=it.substring(ut,xt-St.length);mt.type==gt?mt.value+=yt:(mt.type&&ht.push(mt),mt={type:gt,value:yt})}for(var _t=0;_tot){for(pt>2*it.length&&this.reportError("infinite loop with in ace tokenizer",{startState:j,line:it});ut1&&_[0]!==$&&_.unshift("#tmp",$),{tokens:ht,state:_.length?_:$}},nt}();at.prototype.reportError=et,a.Tokenizer=at}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/deep_copy"],function(o,a,rt){var et=o("../lib/deep_copy").deepCopy,ot;ot=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}},(function(){this.addRules=function(it,j){if(!j){for(var _ in it)this.$rules[_]=it[_];return}for(var _ in it){for(var $=it[_],tt=0;tt<$.length;tt++){var st=$[tt];(st.next||st.onMatch)&&(typeof st.next=="string"&&st.next.indexOf(j)!==0&&(st.next=j+st.next),st.nextState&&st.nextState.indexOf(j)!==0&&(st.nextState=j+st.nextState))}this.$rules[j+_]=$}},this.getRules=function(){return this.$rules},this.embedRules=function(it,j,_,$,tt){var st=typeof it=="function"?new it().getRules():it;if($)for(var lt=0;lt<$.length;lt++)$[lt]=j+$[lt];else{$=[];for(var ct in st)$.push(j+ct)}if(this.addRules(st,j),_)for(var ht=Array.prototype[tt?"push":"unshift"],lt=0;lt<$.length;lt++)ht.apply(this.$rules[$[lt]],et(_));this.$embeds||(this.$embeds=[]),this.$embeds.push(j)},this.getEmbeds=function(){return this.$embeds};var at=function(it,j){return(it!="start"||j.length)&&j.unshift(this.nextState,it),this.nextState},nt=function(it,j){return j.shift(),j.shift()||"start"};this.normalizeRules=function(){var it=0,j=this.$rules;function _($){var tt=j[$];tt.processed=!0;for(var st=0;st=this.$rowTokens.length;){if(this.$row+=1,nt||(nt=this.$session.getLength()),this.$row>=nt)return this.$row=nt-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},at.prototype.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},at.prototype.getCurrentTokenRow=function(){return this.$row},at.prototype.getCurrentTokenColumn=function(){var nt=this.$rowTokens,it=this.$tokenIndex,j=nt[it].start;if(j!==void 0)return j;for(j=0;it>0;)it-=1,j+=nt[it].value.length;return j},at.prototype.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},at.prototype.getCurrentTokenRange=function(){var nt=this.$rowTokens[this.$tokenIndex],it=this.getCurrentTokenColumn();return new et(this.$row,it,this.$row,it+nt.value.length)},at}();a.TokenIterator=ot}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(o,a,rt){var et=o("../../lib/oop"),ot=o("../behaviour").Behaviour,at=o("../../token_iterator").TokenIterator,nt=o("../../lib/lang"),it=["text","paren.rparen","rparen","paren","punctuation.operator"],j=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],_,$={},tt={'"':'"',"'":"'"},st=function(ht){var ut=-1;if(ht.multiSelect&&(ut=ht.selection.index,$.rangeCount!=ht.multiSelect.rangeCount&&($={rangeCount:ht.multiSelect.rangeCount})),$[ut])return _=$[ut];_=$[ut]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},lt=function(ht,ut,pt,mt){var gt=ht.end.row-ht.start.row;return{text:pt+ut+mt,selection:[0,ht.start.column+1,gt,ht.end.column+(gt?0:1)]}},ct;ct=function(ht){ht=ht||{},this.add("braces","insertion",function(ut,pt,mt,gt,dt){var St=mt.getCursorPosition(),xt=gt.doc.getLine(St.row);if(dt=="{"){st(mt);var yt=mt.getSelectionRange(),_t=gt.doc.getTextRange(yt),Ct=gt.getTokenAt(St.row,St.column);if(_t!==""&&_t!=="{"&&mt.getWrapBehavioursEnabled())return lt(yt,_t,"{","}");if(Ct&&/(?:string)\.quasi|\.xml/.test(Ct.type)){var Et=[/tag\-(?:open|name)/,/attribute\-name/];return Et.some(function(Dt){return Dt.test(Ct.type)})||/(string)\.quasi/.test(Ct.type)&&Ct.value[St.column-Ct.start-1]!=="$"?void 0:(ct.recordAutoInsert(mt,gt,"}"),{text:"{}",selection:[1,1]})}else if(ct.isSaneInsertion(mt,gt))return/[\]\}\)]/.test(xt[St.column])||mt.inMultiSelectMode||ht.braces?(ct.recordAutoInsert(mt,gt,"}"),{text:"{}",selection:[1,1]}):(ct.recordMaybeInsert(mt,gt,"{"),{text:"{",selection:[1,1]})}else if(dt=="}"){st(mt);var kt=xt.substring(St.column,St.column+1);if(kt=="}"){var Tt=gt.$findOpeningBracket("}",{column:St.column+1,row:St.row});if(Tt!==null&&ct.isAutoInsertedClosing(St,xt,dt))return ct.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else if(dt==` +`).length>2?Er=lt.down:Or>Ot&&$t[Or-1]==" "?(Er=lt.right,Cr=ct.option):(Or>Ot||Or==Ot&&Ot!=It&&Lr==Or)&&(Er=lt.right),Lr!==Or&&(Cr|=ct.shift),Er){var Hr=Nr.onCommandKey({},Cr,Er);if(!Hr&&Nr.commands){Er=lt.keyCodeToString(Er);var rn=Nr.commands.findKeyCommand(Cr,Er);rn&&Nr.execCommand(rn)}It=Lr,Ot=Or,Ht("")}}};document.addEventListener("selectionchange",er),Nr.on("destroy",function(){document.removeEventListener("selectionchange",er)})}this.destroy=function(){St.parentElement&&St.parentElement.removeChild(St)}},a.TextInput=mt,a.$setUserAgentForTests=function(gt,dt){pt=gt,ht=dt}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(o,a,rt){var tt=o("../lib/useragent"),ot=0,at=550,nt=function(){function _($){$.$clickSelection=null;var et=$.editor;et.setDefaultHandler("mousedown",this.onMouseDown.bind($)),et.setDefaultHandler("dblclick",this.onDoubleClick.bind($)),et.setDefaultHandler("tripleclick",this.onTripleClick.bind($)),et.setDefaultHandler("quadclick",this.onQuadClick.bind($)),et.setDefaultHandler("mousewheel",this.onMouseWheel.bind($));var st=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];st.forEach(function(lt){$[lt]=this[lt]},this),$.selectByLines=this.extendSelectionBy.bind($,"getLineRange"),$.selectByWords=this.extendSelectionBy.bind($,"getWordRange")}return _.prototype.onMouseDown=function($){var et=$.inSelection(),st=$.getDocumentPosition();this.mousedownEvent=$;var lt=this.editor,ct=$.getButton();if(ct!==0){var ht=lt.getSelectionRange(),ut=ht.isEmpty();(ut||ct==1)&<.selection.moveToPosition(st),ct==2&&(lt.textInput.onContextMenu($.domEvent),tt.isMozilla||$.preventDefault());return}if(this.mousedownEvent.time=Date.now(),et&&!lt.isFocused()&&(lt.focus(),this.$focusTimeout&&!this.$clickSelection&&!lt.inMultiSelectMode)){this.setState("focusWait"),this.captureMouse($);return}return this.captureMouse($),this.startSelect(st,$.domEvent._clicks>1),$.preventDefault()},_.prototype.startSelect=function($,et){$=$||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var st=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?st.selection.selectToPosition($):et||st.selection.moveToPosition($),et||this.select(),st.setStyle("ace_selecting"),this.setState("select"))},_.prototype.select=function(){var $,et=this.editor,st=et.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var lt=this.$clickSelection.comparePoint(st);if(lt==-1)$=this.$clickSelection.end;else if(lt==1)$=this.$clickSelection.start;else{var ct=j(this.$clickSelection,st);st=ct.cursor,$=ct.anchor}et.selection.setSelectionAnchor($.row,$.column)}et.selection.selectToPosition(st),et.renderer.scrollCursorIntoView()},_.prototype.extendSelectionBy=function($){var et,st=this.editor,lt=st.renderer.screenToTextCoordinates(this.x,this.y),ct=st.selection[$](lt.row,lt.column);if(this.$clickSelection){var ht=this.$clickSelection.comparePoint(ct.start),ut=this.$clickSelection.comparePoint(ct.end);if(ht==-1&&ut<=0)et=this.$clickSelection.end,(ct.end.row!=lt.row||ct.end.column!=lt.column)&&(lt=ct.start);else if(ut==1&&ht>=0)et=this.$clickSelection.start,(ct.start.row!=lt.row||ct.start.column!=lt.column)&&(lt=ct.end);else if(ht==-1&&ut==1)lt=ct.end,et=ct.start;else{var pt=j(this.$clickSelection,lt);lt=pt.cursor,et=pt.anchor}st.selection.setSelectionAnchor(et.row,et.column)}st.selection.selectToPosition(lt),st.renderer.scrollCursorIntoView()},_.prototype.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting")},_.prototype.focusWait=function(){var $=it(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),et=Date.now();($>ot||et-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},_.prototype.onDoubleClick=function($){var et=$.getDocumentPosition(),st=this.editor,lt=st.session,ct=lt.getBracketRange(et);ct?(ct.isEmpty()&&(ct.start.column--,ct.end.column++),this.setState("select")):(ct=st.selection.getWordRange(et.row,et.column),this.setState("selectByWords")),this.$clickSelection=ct,this.select()},_.prototype.onTripleClick=function($){var et=$.getDocumentPosition(),st=this.editor;this.setState("selectByLines");var lt=st.getSelectionRange();lt.isMultiLine()&<.contains(et.row,et.column)?(this.$clickSelection=st.selection.getLineRange(lt.start.row),this.$clickSelection.end=st.selection.getLineRange(lt.end.row).end):this.$clickSelection=st.selection.getLineRange(et.row),this.select()},_.prototype.onQuadClick=function($){var et=this.editor;et.selectAll(),this.$clickSelection=et.getSelectionRange(),this.setState("selectAll")},_.prototype.onMouseWheel=function($){if(!$.getAccelKey()){$.getShiftKey()&&$.wheelY&&!$.wheelX&&($.wheelX=$.wheelY,$.wheelY=0);var et=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var st=this.$lastScroll,lt=$.domEvent.timeStamp,ct=lt-st.t,ht=ct?$.wheelX/ct:st.vx,ut=ct?$.wheelY/ct:st.vy;ct=1&&et.renderer.isScrollableBy($.wheelX*$.speed,0)&&(mt=!0),pt<=1&&et.renderer.isScrollableBy(0,$.wheelY*$.speed)&&(mt=!0),mt)st.allowed=lt;else if(lt-st.allowedat.clientHeight;nt||ot.preventDefault()}}),ace.define("ace/tooltip",["require","exports","module","ace/lib/dom","ace/lib/event","ace/range","ace/lib/scroll"],function(o,a,rt){var tt=this&&this.__extends||function(){var lt=function(ct,ht){return lt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ut,pt){ut.__proto__=pt}||function(ut,pt){for(var mt in pt)Object.prototype.hasOwnProperty.call(pt,mt)&&(ut[mt]=pt[mt])},lt(ct,ht)};return function(ct,ht){if(typeof ht!="function"&&ht!==null)throw new TypeError("Class extends value "+String(ht)+" is not a constructor or null");lt(ct,ht);function ut(){this.constructor=ct}ct.prototype=ht===null?Object.create(ht):(ut.prototype=ht.prototype,new ut)}}(),ot=this&&this.__values||function(lt){var ct=typeof Symbol=="function"&&Symbol.iterator,ht=ct&<[ct],ut=0;if(ht)return ht.call(lt);if(lt&&typeof lt.length=="number")return{next:function(){return lt&&ut>=lt.length&&(lt=void 0),{value:lt&<[ut++],done:!lt}}};throw new TypeError(ct?"Object is not iterable.":"Symbol.iterator is not defined.")},at=o("./lib/dom");o("./lib/event");var nt=o("./range").Range,it=o("./lib/scroll").preventParentScroll,j="ace_tooltip",_=function(){function lt(ct){this.isOpen=!1,this.$element=null,this.$parentNode=ct}return lt.prototype.$init=function(){return this.$element=at.createElement("div"),this.$element.className=j,this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},lt.prototype.getElement=function(){return this.$element||this.$init()},lt.prototype.setText=function(ct){this.getElement().textContent=ct},lt.prototype.setHtml=function(ct){this.getElement().innerHTML=ct},lt.prototype.setPosition=function(ct,ht){this.getElement().style.left=ct+"px",this.getElement().style.top=ht+"px"},lt.prototype.setClassName=function(ct){at.addCssClass(this.getElement(),ct)},lt.prototype.setTheme=function(ct){this.$element.className=j+" "+(ct.isDark?"ace_dark ":"")+(ct.cssClass||"")},lt.prototype.show=function(ct,ht,ut){ct!=null&&this.setText(ct),ht!=null&&ut!=null&&this.setPosition(ht,ut),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},lt.prototype.hide=function(ct){this.isOpen&&(this.getElement().style.display="none",this.getElement().className=j,this.isOpen=!1)},lt.prototype.getHeight=function(){return this.getElement().offsetHeight},lt.prototype.getWidth=function(){return this.getElement().offsetWidth},lt.prototype.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)},lt}(),$=function(){function lt(){this.popups=[]}return lt.prototype.addPopup=function(ct){this.popups.push(ct),this.updatePopups()},lt.prototype.removePopup=function(ct){var ht=this.popups.indexOf(ct);ht!==-1&&(this.popups.splice(ht,1),this.updatePopups())},lt.prototype.updatePopups=function(){var ct,ht,ut,pt;this.popups.sort(function(Et,kt){return kt.priority-Et.priority});var mt=[];try{for(var gt=ot(this.popups),dt=gt.next();!dt.done;dt=gt.next()){var St=dt.value,xt=!0;try{for(var yt=(ut=void 0,ot(mt)),_t=yt.next();!_t.done;_t=yt.next()){var Ct=_t.value;if(this.doPopupsOverlap(Ct,St)){xt=!1;break}}}catch(Et){ut={error:Et}}finally{try{_t&&!_t.done&&(pt=yt.return)&&pt.call(yt)}finally{if(ut)throw ut.error}}xt?mt.push(St):St.hide()}}catch(Et){ct={error:Et}}finally{try{dt&&!dt.done&&(ht=gt.return)&&ht.call(gt)}finally{if(ct)throw ct.error}}},lt.prototype.doPopupsOverlap=function(ct,ht){var ut=ct.getElement().getBoundingClientRect(),pt=ht.getElement().getBoundingClientRect();return ut.leftpt.left&&ut.toppt.top},lt}(),et=new $;a.popupManager=et,a.Tooltip=_;var st=function(lt){tt(ct,lt);function ct(ht){ht===void 0&&(ht=document.body);var ut=lt.call(this,ht)||this;ut.timeout=void 0,ut.lastT=0,ut.idleTime=350,ut.lastEvent=void 0,ut.onMouseOut=ut.onMouseOut.bind(ut),ut.onMouseMove=ut.onMouseMove.bind(ut),ut.waitForHover=ut.waitForHover.bind(ut),ut.hide=ut.hide.bind(ut);var pt=ut.getElement();return pt.style.whiteSpace="pre-wrap",pt.style.pointerEvents="auto",pt.addEventListener("mouseout",ut.onMouseOut),pt.tabIndex=-1,pt.addEventListener("blur",(function(){pt.contains(document.activeElement)||this.hide()}).bind(ut)),pt.addEventListener("wheel",it),ut}return ct.prototype.addToEditor=function(ht){ht.on("mousemove",this.onMouseMove),ht.on("mousedown",this.hide),ht.renderer.getMouseEventTarget().addEventListener("mouseout",this.onMouseOut,!0)},ct.prototype.removeFromEditor=function(ht){ht.off("mousemove",this.onMouseMove),ht.off("mousedown",this.hide),ht.renderer.getMouseEventTarget().removeEventListener("mouseout",this.onMouseOut,!0),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},ct.prototype.onMouseMove=function(ht,ut){this.lastEvent=ht,this.lastT=Date.now();var pt=ut.$mouseHandler.isMousePressed;if(this.isOpen){var mt=this.lastEvent&&this.lastEvent.getDocumentPosition();(!this.range||!this.range.contains(mt.row,mt.column)||pt||this.isOutsideOfText(this.lastEvent))&&this.hide()}this.timeout||pt||(this.lastEvent=ht,this.timeout=setTimeout(this.waitForHover,this.idleTime))},ct.prototype.waitForHover=function(){this.timeout&&clearTimeout(this.timeout);var ht=Date.now()-this.lastT;if(this.idleTime-ht>10){this.timeout=setTimeout(this.waitForHover,this.idleTime-ht);return}this.timeout=null,this.lastEvent&&!this.isOutsideOfText(this.lastEvent)&&this.$gatherData(this.lastEvent,this.lastEvent.editor)},ct.prototype.isOutsideOfText=function(ht){var ut=ht.editor,pt=ht.getDocumentPosition(),mt=ut.session.getLine(pt.row);if(pt.column==mt.length){var gt=ut.renderer.pixelToScreenCoordinates(ht.clientX,ht.clientY),dt=ut.session.documentToScreenPosition(pt.row,pt.column);if(dt.column!=gt.column||dt.row!=gt.row)return!0}return!1},ct.prototype.setDataProvider=function(ht){this.$gatherData=ht},ct.prototype.showForRange=function(ht,ut,pt,mt){var gt=10;if(!(mt&&mt!=this.lastEvent)&&!(this.isOpen&&document.activeElement==this.getElement())){var dt=ht.renderer;this.isOpen||(et.addPopup(this),this.$registerCloseEvents(),this.setTheme(dt.theme)),this.isOpen=!0,this.addMarker(ut,ht.session),this.range=nt.fromPoints(ut.start,ut.end);var St=dt.textToScreenCoordinates(ut.start.row,ut.start.column),xt=dt.scroller.getBoundingClientRect();St.pageX=et.length&&(et=void 0),{value:et&&et[ct++],done:!et}}};throw new TypeError(st?"Object is not iterable.":"Symbol.iterator is not defined.")},at=o("../lib/dom"),nt=o("../lib/event"),it=o("../tooltip").Tooltip,j=o("../config").nls;o("../lib/lang");function _(et){var st=et.editor,lt=st.renderer.$gutterLayer,ct=new $(st);et.editor.setDefaultHandler("guttermousedown",function(dt){if(!(!st.isFocused()||dt.getButton()!=0)){var St=lt.getRegion(dt);if(St!="foldWidgets"){var xt=dt.getDocumentPosition().row,yt=st.session.selection;if(dt.getShiftKey())yt.selectTo(xt,0);else{if(dt.domEvent.detail==2)return st.selectAll(),dt.preventDefault();et.$clickSelection=st.selection.getLineRange(xt)}return et.setState("selectByLines"),et.captureMouse(dt),dt.preventDefault()}}});var ht,ut;function pt(){var dt=ut.getDocumentPosition().row,St=st.session.getLength();if(dt==St){var xt=st.renderer.pixelToScreenCoordinates(0,ut.y).row,yt=ut.$pos;if(xt>st.session.documentToScreenRow(yt.row,yt.column))return mt()}if(ct.showTooltip(dt),!!ct.isOpen)if(st.on("mousewheel",mt),et.$tooltipFollowsMouse)gt(ut);else{var _t=ut.getGutterRow(),Ct=lt.$lines.get(_t);if(Ct){var Et=Ct.element.querySelector(".ace_gutter_annotation"),kt=Et.getBoundingClientRect(),Tt=ct.getElement().style;Tt.left=kt.right+"px",Tt.top=kt.bottom+"px"}else gt(ut)}}function mt(){ht&&(ht=clearTimeout(ht)),ct.isOpen&&(ct.hideTooltip(),st.off("mousewheel",mt))}function gt(dt){ct.setPosition(dt.x,dt.y)}et.editor.setDefaultHandler("guttermousemove",function(dt){var St=dt.domEvent.target||dt.domEvent.srcElement;if(at.hasCssClass(St,"ace_fold-widget"))return mt();ct.isOpen&&et.$tooltipFollowsMouse&>(dt),ut=dt,!ht&&(ht=setTimeout(function(){ht=null,ut&&!et.isMousePressed?pt():mt()},50))}),nt.addListener(st.renderer.$gutter,"mouseout",function(dt){ut=null,!(!ct.isOpen||ht)&&(ht=setTimeout(function(){ht=null,mt()},50))},st),st.on("changeSession",mt),st.on("input",mt)}a.GutterHandler=_;var $=function(et){tt(st,et);function st(lt){var ct=et.call(this,lt.container)||this;return ct.editor=lt,ct}return st.prototype.setPosition=function(lt,ct){var ht=window.innerWidth||document.documentElement.clientWidth,ut=window.innerHeight||document.documentElement.clientHeight,pt=this.getWidth(),mt=this.getHeight();lt+=15,ct+=15,lt+pt>ht&&(lt-=lt+pt-ht),ct+mt>ut&&(ct-=20+mt),it.prototype.setPosition.call(this,lt,ct)},Object.defineProperty(st,"annotationLabels",{get:function(){return{error:{singular:j("gutter-tooltip.aria-label.error.singular","error"),plural:j("gutter-tooltip.aria-label.error.plural","errors")},warning:{singular:j("gutter-tooltip.aria-label.warning.singular","warning"),plural:j("gutter-tooltip.aria-label.warning.plural","warnings")},info:{singular:j("gutter-tooltip.aria-label.info.singular","information message"),plural:j("gutter-tooltip.aria-label.info.plural","information messages")}}},enumerable:!1,configurable:!0}),st.prototype.showTooltip=function(lt){var ct,ht=this.editor.renderer.$gutterLayer,ut=ht.$annotations[lt],pt;ut?pt={displayText:Array.from(ut.displayText),type:Array.from(ut.type)}:pt={displayText:[],type:[]};var mt=ht.session.getFoldLine(lt);if(mt&&ht.$showFoldedAnnotations){for(var gt={error:[],warning:[],info:[]},dt,St=lt+1;St<=mt.end.row;St++)if(ht.$annotations[St])for(var xt=0;xtj?Et=null:Zt-Et>=it&&(st.renderer.scrollCursorIntoView(),Et=null)}}function $t(zt,Ht){var Zt=Date.now(),qt=st.renderer.layerConfig.lineHeight,hr=st.renderer.layerConfig.characterWidth,fr=st.renderer.scroller.getBoundingClientRect(),mr={x:{left:pt-fr.left,right:fr.right-pt},y:{top:mt-fr.top,bottom:fr.bottom-mt}},gr=Math.min(mr.x.left,mr.x.right),tr=Math.min(mr.y.top,mr.y.bottom),rr={row:zt.row,column:zt.column};gr/hr<=2&&(rr.column+=mr.x.left=nt&&st.renderer.scrollCursorIntoView(rr):Ct=Zt:Ct=null}function It(){var zt=St;St=st.renderer.screenToTextCoordinates(pt,mt),Tt(St,zt),$t(St,zt)}function Ot(){dt=st.selection.toOrientedRange(),ut=st.session.addMarker(dt,"ace_selection",st.getSelectionStyle()),st.clearSelection(),st.isFocused()&&st.renderer.$cursorLayer.setBlinking(!1),clearInterval(gt),It(),gt=setInterval(It,20),xt=0,ot.addListener(document,"mousemove",Bt)}function Mt(){clearInterval(gt),st.session.removeMarker(ut),ut=null,st.selection.fromOrientedRange(dt),st.isFocused()&&!_t&&st.$resetCursorStyle(),dt=null,St=null,xt=0,Ct=null,Et=null,ot.removeListener(document,"mousemove",Bt)}var Dt=null;function Bt(){Dt==null&&(Dt=setTimeout(function(){Dt!=null&&ut&&Mt()},20))}function Kt(zt){var Ht=zt.types;return!Ht||Array.prototype.some.call(Ht,function(Zt){return Zt=="text/plain"||Zt=="Text"})}function Wt(zt){var Ht=["copy","copymove","all","uninitialized"],Zt=["move","copymove","linkmove","all","uninitialized"],qt=at.isMac?zt.altKey:zt.ctrlKey,hr="uninitialized";try{hr=zt.dataTransfer.effectAllowed.toLowerCase()}catch{}var fr="none";return qt&&Ht.indexOf(hr)>=0?fr="copy":Zt.indexOf(hr)>=0?fr="move":Ht.indexOf(hr)>=0&&(fr="copy"),fr}}(function(){this.dragWait=function(){var et=Date.now()-this.mousedownEvent.time;et>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var et=this.editor.container;et.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(et){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var et=this.editor,st=et.container;st.draggable=!0,et.renderer.$cursorLayer.setBlinking(!1),et.setStyle("ace_dragging");var lt=at.isWin?"default":"move";et.renderer.setCursorStyle(lt),this.setState("dragReady")},this.onMouseDrag=function(et){var st=this.editor.container;if(at.isIE&&this.state=="dragReady"){var lt=$(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);lt>3&&st.dragDrop()}if(this.state==="dragWait"){var lt=$(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);lt>0&&(st.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(et){if(this.$dragEnabled){this.mousedownEvent=et;var st=this.editor,lt=et.inSelection(),ct=et.getButton(),ht=et.domEvent.detail||1;if(ht===1&&ct===0&<){if(et.editor.inMultiSelectMode&&(et.getAccelKey()||et.getShiftKey()))return;this.mousedownEvent.time=Date.now();var ut=et.domEvent.target||et.domEvent.srcElement;if("unselectable"in ut&&(ut.unselectable="on"),st.getDragDelay()){if(at.isWebKit){this.cancelDrag=!0;var pt=st.container;pt.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(et,this.onMouseDrag.bind(this)),et.defaultPrevented=!0}}}}).call(_.prototype);function $(et,st,lt,ct){return Math.sqrt(Math.pow(lt-et,2)+Math.pow(ct-st,2))}a.DragdropHandler=_}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(o,a,rt){var tt=o("./mouse_event").MouseEvent,ot=o("../lib/event"),at=o("../lib/dom");a.addTouchListeners=function(nt,it){var j="scroll",_,$,et,st,lt,ct,ht=0,ut,pt=0,mt=0,gt=0,dt,St;function xt(){var Tt=window.navigator&&window.navigator.clipboard,$t=!1,It=function(){var Dt=it.getCopyText(),Bt=it.session.getUndoManager().hasUndo();St.replaceChild(at.buildDom($t?["span",!Dt&&Ot("selectall")&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],Dt&&Ot("copy")&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],Dt&&Ot("cut")&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],Tt&&Ot("paste")&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],Bt&&Ot("undo")&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],Ot("find")&&["span",{class:"ace_mobile-button",action:"find"},"Find"],Ot("openCommandPalette")&&["span",{class:"ace_mobile-button",action:"openCommandPalette"},"Palette"]]:["span"]),St.firstChild)},Ot=function(Dt){return it.commands.canExecute(Dt,it)},Mt=function(Dt){var Bt=Dt.target.getAttribute("action");if(Bt=="more"||!$t)return $t=!$t,It();Bt=="paste"?Tt.readText().then(function(Kt){it.execCommand(Bt,Kt)}):Bt&&((Bt=="cut"||Bt=="copy")&&(Tt?Tt.writeText(it.getCopyText()):document.execCommand("copy")),it.execCommand(Bt)),St.firstChild.style.display="none",$t=!1,Bt!="openCommandPalette"&&it.focus()};St=at.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(Dt){j="menu",Dt.stopPropagation(),Dt.preventDefault(),it.textInput.focus()},ontouchend:function(Dt){Dt.stopPropagation(),Dt.preventDefault(),Mt(Dt)},onclick:Mt},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],it.container)}function yt(){if(!it.getOption("enableMobileMenu")){St&&_t();return}St||xt();var Tt=it.selection.cursor,$t=it.renderer.textToScreenCoordinates(Tt.row,Tt.column),It=it.renderer.textToScreenCoordinates(0,0).pageX,Ot=it.renderer.scrollLeft,Mt=it.container.getBoundingClientRect();St.style.top=$t.pageY-Mt.top-3+"px",$t.pageX-Mt.left=2?it.selection.getLineRange(ut.row):it.session.getBracketRange(ut);Tt&&!Tt.isEmpty()?it.selection.setRange(Tt):it.selection.selectWord(),j="wait"}ot.addListener(nt,"contextmenu",function(Tt){if(dt){var $t=it.textInput.getElement();$t.focus()}},it),ot.addListener(nt,"touchstart",function(Tt){var $t=Tt.touches;if(lt||$t.length>1){clearTimeout(lt),lt=null,et=-1,j="zoom";return}dt=it.$mouseHandler.isMousePressed=!0;var It=it.renderer.layerConfig.lineHeight,Ot=it.renderer.layerConfig.lineHeight,Mt=Tt.timeStamp;st=Mt;var Dt=$t[0],Bt=Dt.clientX,Kt=Dt.clientY;Math.abs(_-Bt)+Math.abs($-Kt)>It&&(et=-1),_=Tt.clientX=Bt,$=Tt.clientY=Kt,mt=gt=0;var Wt=new tt(Tt,it);if(ut=Wt.getDocumentPosition(),Mt-et<500&&$t.length==1&&!ht)pt++,Tt.preventDefault(),Tt.button=0,Et();else{pt=0;var zt=it.selection.cursor,Ht=it.selection.isEmpty()?zt:it.selection.anchor,Zt=it.renderer.$cursorLayer.getPixelPosition(zt,!0),qt=it.renderer.$cursorLayer.getPixelPosition(Ht,!0),hr=it.renderer.scroller.getBoundingClientRect(),fr=it.renderer.layerConfig.offset,mr=it.renderer.scrollLeft,gr=function(Qt,xr){return Qt=Qt/Ot,xr=xr/It-.75,Qt*Qt+xr*xr};if(Tt.clientXrr?"cursor":"anchor"),rr<3.5?j="anchor":tr<3.5?j="cursor":j="scroll",lt=setTimeout(Ct,450)}et=Mt},it),ot.addListener(nt,"touchend",function(Tt){dt=it.$mouseHandler.isMousePressed=!1,ct&&clearInterval(ct),j=="zoom"?(j="",ht=0):lt?(it.selection.moveToPosition(ut),ht=0,yt()):j=="scroll"?(kt(),_t()):yt(),clearTimeout(lt),lt=null},it),ot.addListener(nt,"touchmove",function(Tt){lt&&(clearTimeout(lt),lt=null);var $t=Tt.touches;if(!($t.length>1||j=="zoom")){var It=$t[0],Ot=_-It.clientX,Mt=$-It.clientY;if(j=="wait")if(Ot*Ot+Mt*Mt>4)j="cursor";else return Tt.preventDefault();_=It.clientX,$=It.clientY,Tt.clientX=It.clientX,Tt.clientY=It.clientY;var Dt=Tt.timeStamp,Bt=Dt-st;if(st=Dt,j=="scroll"){var Kt=new tt(Tt,it);Kt.speed=1,Kt.wheelX=Ot,Kt.wheelY=Mt,10*Math.abs(Ot)0)if(rr==16){for(Sr=xr;Sr-1){for(Sr=xr;Sr=0&&qt[tn]==dt;tn--)Ht[tn]=tt}}}function Bt(zt,Ht,Zt){if(!(ot=zt){for(fr=hr+1;fr=zt;)fr++;for(mr=hr,gr=fr-1;mr=Ht.length||(fr=Zt[qt-1])!=ct&&fr!=ht||(mr=Ht[qt+1])!=ct&&mr!=ht?ut:(at&&(mr=ht),mr==fr?mr:ut);case xt:return fr=qt>0?Zt[qt-1]:pt,fr==ct&&qt+10&&Zt[qt-1]==ct)return ct;if(at)return ut;for(tr=qt+1,gr=Ht.length;tr=1425&&rr<=2303||rr==64286;if(fr=Ht[tr],Qt&&(fr==lt||fr==gt))return lt}return qt<1||(fr=Ht[qt-1])==pt?ut:Zt[qt-1];case pt:return at=!1,nt=!0,tt;case mt:return it=!0,ut;case Ct:case Et:case Tt:case $t:case kt:at=!1;case It:return ut}}function Wt(zt){var Ht=zt.charCodeAt(0),Zt=Ht>>8;return Zt==0?Ht>191?st:Ot[Ht]:Zt==5?/[\u0591-\u05f4]/.test(zt)?lt:st:Zt==6?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(zt)?_t:/[\u0660-\u0669\u066b-\u066c]/.test(zt)?ht:Ht==1642?yt:/[\u06f0-\u06f9]/.test(zt)?ct:gt:Zt==32&&Ht<=8287?Mt[Ht&255]:Zt==254&&Ht>=65136?gt:ut}a.L=st,a.R=lt,a.EN=ct,a.ON_R=3,a.AN=4,a.R_H=5,a.B=6,a.RLE=7,a.DOT="·",a.doBidiReorder=function(zt,Ht,Zt){if(zt.length<2)return{};var qt=zt.split(""),hr=new Array(qt.length),fr=new Array(qt.length),mr=[];tt=Zt?et:$,Dt(qt,mr,qt.length,Ht);for(var gr=0;grgt&&Ht[gr]0&&qt[gr-1]==="ل"&&/\u0622|\u0623|\u0625|\u0627/.test(qt[gr])&&(mr[gr-1]=mr[gr]=a.R_H,gr++);qt[qt.length-1]===a.DOT&&(mr[qt.length-1]=a.B),qt[0]==="‫"&&(mr[0]=a.RLE);for(var gr=0;gr=0&&(j=this.session.$docRowCache[$])}return j},it.prototype.getSplitIndex=function(){var j=0,_=this.session.$screenRowCache;if(_.length)for(var $,et=this.session.$getRowCacheIndex(_,this.currentRow);this.currentRow-j>0&&($=this.session.$getRowCacheIndex(_,this.currentRow-j-1),$===et);)et=$,j++;else j=this.currentRow;return j},it.prototype.updateRowLine=function(j,_){j===void 0&&(j=this.getDocumentRow());var $=j===this.session.getLength()-1,et=$?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(j),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var st=this.session.$wrapData[j];st&&(_===void 0&&(_=this.getSplitIndex()),_>0&&st.length?(this.wrapIndent=st.indent,this.wrapOffset=this.wrapIndent*this.charWidths[tt.L],this.line=__?this.session.getOverwrite()?j:j-1:_,et=tt.getVisualFromLogicalIdx($,this.bidiMap),st=this.bidiMap.bidiLevels,lt=0;!this.session.getOverwrite()&&j<=_&&st[et]%2!==0&&et++;for(var ct=0;ct_&&st[et]%2===0&&(lt+=this.charWidths[st[et]]),this.wrapIndent&&(lt+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(lt+=this.rtlLineOffset),lt},it.prototype.getSelections=function(j,_){var $=this.bidiMap,et=$.bidiLevels,st,lt=[],ct=0,ht=Math.min(j,_)-this.wrapIndent,ut=Math.max(j,_)-this.wrapIndent,pt=!1,mt=!1,gt=0;this.wrapIndent&&(ct+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var dt,St=0;St=ht&&dtet+ct/2;){if(et+=ct,st===lt.length-1){ct=0;break}ct=this.charWidths[lt[++st]]}return st>0&<[st-1]%2!==0&<[st]%2===0?($0&<[st-1]%2===0&<[st]%2!==0?_=1+($>et?this.bidiMap.logicalFromVisual[st]:this.bidiMap.logicalFromVisual[st-1]):this.isRtlDir&&st===lt.length-1&&ct===0&<[st-1]%2===0||!this.isRtlDir&&st===0&<[st]%2!==0?_=1+this.bidiMap.logicalFromVisual[st]:(st>0&<[st-1]%2!==0&&ct!==0&&st--,_=this.bidiMap.logicalFromVisual[st]),_===0&&this.isRtlDir&&_++,_+this.wrapIndent},it}();a.BidiHandler=nt}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(o,a,rt){var tt=o("./lib/oop"),ot=o("./lib/lang"),at=o("./lib/event_emitter").EventEmitter,nt=o("./range").Range,it=function(){function j(_){this.session=_,this.doc=_.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var $=this;this.cursor.on("change",function(et){$.$cursorChanged=!0,$.$silent||$._emit("changeCursor"),!$.$isEmpty&&!$.$silent&&$._emit("changeSelection"),!$.$keepDesiredColumnOnChange&&et.old.column!=et.value.column&&($.$desiredColumn=null)}),this.anchor.on("change",function(){$.$anchorChanged=!0,!$.$isEmpty&&!$.$silent&&$._emit("changeSelection")})}return j.prototype.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},j.prototype.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},j.prototype.getCursor=function(){return this.lead.getPosition()},j.prototype.setAnchor=function(_,$){this.$isEmpty=!1,this.anchor.setPosition(_,$)},j.prototype.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},j.prototype.getSelectionLead=function(){return this.lead.getPosition()},j.prototype.isBackwards=function(){var _=this.anchor,$=this.lead;return _.row>$.row||_.row==$.row&&_.column>$.column},j.prototype.getRange=function(){var _=this.anchor,$=this.lead;return this.$isEmpty?nt.fromPoints($,$):this.isBackwards()?nt.fromPoints($,_):nt.fromPoints(_,$)},j.prototype.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},j.prototype.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},j.prototype.setRange=function(_,$){var et=$?_.end:_.start,st=$?_.start:_.end;this.$setSelection(et.row,et.column,st.row,st.column)},j.prototype.$setSelection=function(_,$,et,st){if(!this.$silent){var lt=this.$isEmpty,ct=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(_,$),this.cursor.setPosition(et,st),this.$isEmpty=!nt.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||lt!=this.$isEmpty||ct)&&this._emit("changeSelection")}},j.prototype.$moveSelection=function(_){var $=this.lead;this.$isEmpty&&this.setSelectionAnchor($.row,$.column),_.call(this)},j.prototype.selectTo=function(_,$){this.$moveSelection(function(){this.moveCursorTo(_,$)})},j.prototype.selectToPosition=function(_){this.$moveSelection(function(){this.moveCursorToPosition(_)})},j.prototype.moveTo=function(_,$){this.clearSelection(),this.moveCursorTo(_,$)},j.prototype.moveToPosition=function(_){this.clearSelection(),this.moveCursorToPosition(_)},j.prototype.selectUp=function(){this.$moveSelection(this.moveCursorUp)},j.prototype.selectDown=function(){this.$moveSelection(this.moveCursorDown)},j.prototype.selectRight=function(){this.$moveSelection(this.moveCursorRight)},j.prototype.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},j.prototype.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},j.prototype.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},j.prototype.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},j.prototype.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},j.prototype.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},j.prototype.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},j.prototype.getWordRange=function(_,$){if(typeof $>"u"){var et=_||this.lead;_=et.row,$=et.column}return this.session.getWordRange(_,$)},j.prototype.selectWord=function(){this.setSelectionRange(this.getWordRange())},j.prototype.selectAWord=function(){var _=this.getCursor(),$=this.session.getAWordRange(_.row,_.column);this.setSelectionRange($)},j.prototype.getLineRange=function(_,$){var et=typeof _=="number"?_:this.lead.row,st,lt=this.session.getFoldLine(et);return lt?(et=lt.start.row,st=lt.end.row):st=et,$===!0?new nt(et,0,st,this.session.getLine(st).length):new nt(et,0,st+1,0)},j.prototype.selectLine=function(){this.setSelectionRange(this.getLineRange())},j.prototype.moveCursorUp=function(){this.moveCursorBy(-1,0)},j.prototype.moveCursorDown=function(){this.moveCursorBy(1,0)},j.prototype.wouldMoveIntoSoftTab=function(_,$,et){var st=_.column,lt=_.column+$;return et<0&&(st=_.column-$,lt=_.column),this.session.isTabStop(_)&&this.doc.getLine(_.row).slice(st,lt).split(" ").length-1==$},j.prototype.moveCursorLeft=function(){var _=this.lead.getPosition(),$;if($=this.session.getFoldAt(_.row,_.column,-1))this.moveCursorTo($.start.row,$.start.column);else if(_.column===0)_.row>0&&this.moveCursorTo(_.row-1,this.doc.getLine(_.row-1).length);else{var et=this.session.getTabSize();this.wouldMoveIntoSoftTab(_,et,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-et):this.moveCursorBy(0,-1)}},j.prototype.moveCursorRight=function(){var _=this.lead.getPosition(),$;if($=this.session.getFoldAt(_.row,_.column,1))this.moveCursorTo($.end.row,$.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&($.column=st)}}this.moveCursorTo($.row,$.column)},j.prototype.moveCursorFileEnd=function(){var _=this.doc.getLength()-1,$=this.doc.getLine(_).length;this.moveCursorTo(_,$)},j.prototype.moveCursorFileStart=function(){this.moveCursorTo(0,0)},j.prototype.moveCursorLongWordRight=function(){var _=this.lead.row,$=this.lead.column,et=this.doc.getLine(_),st=et.substring($);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var lt=this.session.getFoldAt(_,$,1);if(lt){this.moveCursorTo(lt.end.row,lt.end.column);return}if(this.session.nonTokenRe.exec(st)&&($+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,st=et.substring($)),$>=et.length){this.moveCursorTo(_,et.length),this.moveCursorRight(),_0&&this.moveCursorWordLeft();return}this.session.tokenRe.exec(lt)&&($-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(_,$)},j.prototype.$shortWordEndIndex=function(_){var $=0,et,st=/\s/,lt=this.session.tokenRe;if(lt.lastIndex=0,this.session.tokenRe.exec(_))$=this.session.tokenRe.lastIndex;else{for(;(et=_[$])&&st.test(et);)$++;if($<1){for(lt.lastIndex=0;(et=_[$])&&!lt.test(et);)if(lt.lastIndex=0,$++,st.test(et))if($>2){$--;break}else{for(;(et=_[$])&&st.test(et);)$++;if($>2)break}}}return lt.lastIndex=0,$},j.prototype.moveCursorShortWordRight=function(){var _=this.lead.row,$=this.lead.column,et=this.doc.getLine(_),st=et.substring($),lt=this.session.getFoldAt(_,$,1);if(lt)return this.moveCursorTo(lt.end.row,lt.end.column);if($==et.length){var ct=this.doc.getLength();do _++,st=this.doc.getLine(_);while(_0&&/^\s*$/.test(st));$=st.length,/\s+$/.test(st)||(st="")}var lt=ot.stringReverse(st),ct=this.$shortWordEndIndex(lt);return this.moveCursorTo(_,$-ct)},j.prototype.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},j.prototype.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},j.prototype.moveCursorBy=function(_,$){var et=this.session.documentToScreenPosition(this.lead.row,this.lead.column),st;if($===0&&(_!==0&&(this.session.$bidiHandler.isBidiRow(et.row,this.lead.row)?(st=this.session.$bidiHandler.getPosLeft(et.column),et.column=Math.round(st/this.session.$bidiHandler.charWidths[0])):st=et.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?et.column=this.$desiredColumn:this.$desiredColumn=et.column),_!=0&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var lt=this.session.lineWidgets[this.lead.row];_<0?_-=lt.rowsAbove||0:_>0&&(_+=lt.rowCount-(lt.rowsAbove||0))}var ct=this.session.screenToDocumentPosition(et.row+_,et.column,st);_!==0&&$===0&&ct.row===this.lead.row&&(ct.column,this.lead.column),this.moveCursorTo(ct.row,ct.column+$,$===0)},j.prototype.moveCursorToPosition=function(_){this.moveCursorTo(_.row,_.column)},j.prototype.moveCursorTo=function(_,$,et){var st=this.session.getFoldAt(_,$,1);st&&(_=st.start.row,$=st.start.column),this.$keepDesiredColumnOnChange=!0;var lt=this.session.getLine(_);/[\uDC00-\uDFFF]/.test(lt.charAt($))&<.charAt($-1)&&(this.lead.row==_&&this.lead.column==$+1?$=$-1:$=$+1),this.lead.setPosition(_,$),this.$keepDesiredColumnOnChange=!1,et||(this.$desiredColumn=null)},j.prototype.moveCursorToScreen=function(_,$,et){var st=this.session.screenToDocumentPosition(_,$);this.moveCursorTo(st.row,st.column,et)},j.prototype.detach=function(){this.lead.detach(),this.anchor.detach()},j.prototype.fromOrientedRange=function(_){this.setSelectionRange(_,_.cursor==_.start),this.$desiredColumn=_.desiredColumn||this.$desiredColumn},j.prototype.toOrientedRange=function(_){var $=this.getRange();return _?(_.start.column=$.start.column,_.start.row=$.start.row,_.end.column=$.end.column,_.end.row=$.end.row):_=$,_.cursor=this.isBackwards()?_.start:_.end,_.desiredColumn=this.$desiredColumn,_},j.prototype.getRangeOfMovements=function(_){var $=this.getCursor();try{_(this);var et=this.getCursor();return nt.fromPoints($,et)}catch{return nt.fromPoints($,$)}finally{this.moveCursorToPosition($)}},j.prototype.toJSON=function(){if(this.rangeCount)var _=this.ranges.map(function($){var et=$.clone();return et.isBackwards=$.cursor==$.start,et});else{var _=this.getRange();_.isBackwards=this.isBackwards()}return _},j.prototype.fromJSON=function(_){if(_.start==null)if(this.rangeList&&_.length>1){this.toSingleRange(_[0]);for(var $=_.length;$--;){var et=nt.fromPoints(_[$].start,_[$].end);_[$].isBackwards&&(et.cursor=et.start),this.addRange(et,!0)}return}else _=_[0];this.rangeList&&this.toSingleRange(_),this.setSelectionRange(_,_.isBackwards)},j.prototype.isEqual=function(_){if((_.length||this.rangeCount)&&_.length!=this.rangeCount)return!1;if(!_.length||!this.ranges)return this.getRange().isEqual(_);for(var $=this.ranges.length;$--;)if(!this.ranges[$].isEqual(_[$]))return!1;return!0},j}();it.prototype.setSelectionAnchor=it.prototype.setAnchor,it.prototype.getSelectionAnchor=it.prototype.getAnchor,it.prototype.setSelectionRange=it.prototype.setRange,tt.implement(it.prototype,at),a.Selection=it}),ace.define("ace/tokenizer",["require","exports","module","ace/lib/report_error"],function(o,a,rt){var tt=o("./lib/report_error").reportError,ot=2e3,at=function(){function nt(it){this.splitRegex,this.states=it,this.regExps={},this.matchMappings={};for(var j in this.states){for(var _=this.states[j],$=[],et=0,st=this.matchMappings[j]={defaultToken:"text"},lt="g",ct=[],ht=0;ht<_.length;ht++){var ut=_[ht];if(ut.defaultToken&&(st.defaultToken=ut.defaultToken),ut.caseInsensitive&<.indexOf("i")===-1&&(lt+="i"),ut.unicode&<.indexOf("u")===-1&&(lt+="u"),ut.regex!=null){ut.regex instanceof RegExp&&(ut.regex=ut.regex.toString().slice(1,-1));var pt=ut.regex,mt=new RegExp("(?:("+pt+")|(.))").exec("a").length-2;Array.isArray(ut.token)?ut.token.length==1||mt==1?ut.token=ut.token[0]:mt-1!=ut.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:ut,groupCount:mt-1}),ut.token=ut.token[0]):(ut.tokenArray=ut.token,ut.token=null,ut.onMatch=this.$arrayTokens):typeof ut.token=="function"&&!ut.onMatch&&(mt>1?ut.onMatch=this.$applyToken:ut.onMatch=ut.token),mt>1&&(/\\\d/.test(ut.regex)?pt=ut.regex.replace(/\\([0-9]+)/g,function(gt,dt){return"\\"+(parseInt(dt,10)+et+1)}):(mt=1,pt=this.removeCapturingGroups(ut.regex)),!ut.splitRegex&&typeof ut.token!="string"&&ct.push(ut)),st[et]=ht,et+=mt,$.push(pt),ut.onMatch||(ut.onMatch=null)}}$.length||(st[0]=0,$.push("$")),ct.forEach(function(gt){gt.splitRegex=this.createSplitterRegexp(gt.regex,lt)},this),this.regExps[j]=new RegExp("("+$.join(")|(")+")|($)",lt)}}return nt.prototype.$setMaxTokenCount=function(it){ot=it|0},nt.prototype.$applyToken=function(it){var j=this.splitRegex.exec(it).slice(1),_=this.token.apply(this,j);if(typeof _=="string")return[{type:_,value:it}];for(var $=[],et=0,st=_.length;etut){var yt=it.substring(ut,xt-St.length);mt.type==gt?mt.value+=yt:(mt.type&&ht.push(mt),mt={type:gt,value:yt})}for(var _t=0;_tot){for(pt>2*it.length&&this.reportError("infinite loop with in ace tokenizer",{startState:j,line:it});ut1&&_[0]!==$&&_.unshift("#tmp",$),{tokens:ht,state:_.length?_:$}},nt}();at.prototype.reportError=tt,a.Tokenizer=at}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/deep_copy"],function(o,a,rt){var tt=o("../lib/deep_copy").deepCopy,ot;ot=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}},(function(){this.addRules=function(it,j){if(!j){for(var _ in it)this.$rules[_]=it[_];return}for(var _ in it){for(var $=it[_],et=0;et<$.length;et++){var st=$[et];(st.next||st.onMatch)&&(typeof st.next=="string"&&st.next.indexOf(j)!==0&&(st.next=j+st.next),st.nextState&&st.nextState.indexOf(j)!==0&&(st.nextState=j+st.nextState))}this.$rules[j+_]=$}},this.getRules=function(){return this.$rules},this.embedRules=function(it,j,_,$,et){var st=typeof it=="function"?new it().getRules():it;if($)for(var lt=0;lt<$.length;lt++)$[lt]=j+$[lt];else{$=[];for(var ct in st)$.push(j+ct)}if(this.addRules(st,j),_)for(var ht=Array.prototype[et?"push":"unshift"],lt=0;lt<$.length;lt++)ht.apply(this.$rules[$[lt]],tt(_));this.$embeds||(this.$embeds=[]),this.$embeds.push(j)},this.getEmbeds=function(){return this.$embeds};var at=function(it,j){return(it!="start"||j.length)&&j.unshift(this.nextState,it),this.nextState},nt=function(it,j){return j.shift(),j.shift()||"start"};this.normalizeRules=function(){var it=0,j=this.$rules;function _($){var et=j[$];et.processed=!0;for(var st=0;st=this.$rowTokens.length;){if(this.$row+=1,nt||(nt=this.$session.getLength()),this.$row>=nt)return this.$row=nt-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},at.prototype.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},at.prototype.getCurrentTokenRow=function(){return this.$row},at.prototype.getCurrentTokenColumn=function(){var nt=this.$rowTokens,it=this.$tokenIndex,j=nt[it].start;if(j!==void 0)return j;for(j=0;it>0;)it-=1,j+=nt[it].value.length;return j},at.prototype.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},at.prototype.getCurrentTokenRange=function(){var nt=this.$rowTokens[this.$tokenIndex],it=this.getCurrentTokenColumn();return new tt(this.$row,it,this.$row,it+nt.value.length)},at}();a.TokenIterator=ot}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(o,a,rt){var tt=o("../../lib/oop"),ot=o("../behaviour").Behaviour,at=o("../../token_iterator").TokenIterator,nt=o("../../lib/lang"),it=["text","paren.rparen","rparen","paren","punctuation.operator"],j=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],_,$={},et={'"':'"',"'":"'"},st=function(ht){var ut=-1;if(ht.multiSelect&&(ut=ht.selection.index,$.rangeCount!=ht.multiSelect.rangeCount&&($={rangeCount:ht.multiSelect.rangeCount})),$[ut])return _=$[ut];_=$[ut]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},lt=function(ht,ut,pt,mt){var gt=ht.end.row-ht.start.row;return{text:pt+ut+mt,selection:[0,ht.start.column+1,gt,ht.end.column+(gt?0:1)]}},ct;ct=function(ht){ht=ht||{},this.add("braces","insertion",function(ut,pt,mt,gt,dt){var St=mt.getCursorPosition(),xt=gt.doc.getLine(St.row);if(dt=="{"){st(mt);var yt=mt.getSelectionRange(),_t=gt.doc.getTextRange(yt),Ct=gt.getTokenAt(St.row,St.column);if(_t!==""&&_t!=="{"&&mt.getWrapBehavioursEnabled())return lt(yt,_t,"{","}");if(Ct&&/(?:string)\.quasi|\.xml/.test(Ct.type)){var Et=[/tag\-(?:open|name)/,/attribute\-name/];return Et.some(function(Dt){return Dt.test(Ct.type)})||/(string)\.quasi/.test(Ct.type)&&Ct.value[St.column-Ct.start-1]!=="$"?void 0:(ct.recordAutoInsert(mt,gt,"}"),{text:"{}",selection:[1,1]})}else if(ct.isSaneInsertion(mt,gt))return/[\]\}\)]/.test(xt[St.column])||mt.inMultiSelectMode||ht.braces?(ct.recordAutoInsert(mt,gt,"}"),{text:"{}",selection:[1,1]}):(ct.recordMaybeInsert(mt,gt,"{"),{text:"{",selection:[1,1]})}else if(dt=="}"){st(mt);var kt=xt.substring(St.column,St.column+1);if(kt=="}"){var Tt=gt.$findOpeningBracket("}",{column:St.column+1,row:St.row});if(Tt!==null&&ct.isAutoInsertedClosing(St,xt,dt))return ct.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else if(dt==` `||dt==`\r `){st(mt);var $t="";ct.isMaybeInsertedClosing(St,xt)&&($t=nt.stringRepeat("}",_.maybeInsertedBrackets),ct.clearMaybeInsertedClosing());var kt=xt.substring(St.column,St.column+1);if(kt==="}"){var It=gt.findMatchingBracket({row:St.row,column:St.column+1},"}");if(!It)return null;var Ot=this.$getIndent(gt.getLine(It.row))}else if($t)var Ot=this.$getIndent(xt);else{ct.clearMaybeInsertedClosing();return}var Mt=Ot+gt.getTabString();return{text:` `+Mt+` -`+Ot+$t,selection:[1,Mt.length,1,Mt.length]}}else ct.clearMaybeInsertedClosing()}),this.add("braces","deletion",function(ut,pt,mt,gt,dt){var St=gt.doc.getTextRange(dt);if(!dt.isMultiLine()&&St=="{"){st(mt);var xt=gt.doc.getLine(dt.start.row),yt=xt.substring(dt.end.column,dt.end.column+1);if(yt=="}")return dt.end.column++,dt;_.maybeInsertedBrackets--}}),this.add("parens","insertion",function(ut,pt,mt,gt,dt){if(dt=="("){st(mt);var St=mt.getSelectionRange(),xt=gt.doc.getTextRange(St);if(xt!==""&&mt.getWrapBehavioursEnabled())return lt(St,xt,"(",")");if(ct.isSaneInsertion(mt,gt))return ct.recordAutoInsert(mt,gt,")"),{text:"()",selection:[1,1]}}else if(dt==")"){st(mt);var yt=mt.getCursorPosition(),_t=gt.doc.getLine(yt.row),Ct=_t.substring(yt.column,yt.column+1);if(Ct==")"){var Et=gt.$findOpeningBracket(")",{column:yt.column+1,row:yt.row});if(Et!==null&&ct.isAutoInsertedClosing(yt,_t,dt))return ct.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(ut,pt,mt,gt,dt){var St=gt.doc.getTextRange(dt);if(!dt.isMultiLine()&&St=="("){st(mt);var xt=gt.doc.getLine(dt.start.row),yt=xt.substring(dt.start.column+1,dt.start.column+2);if(yt==")")return dt.end.column++,dt}}),this.add("brackets","insertion",function(ut,pt,mt,gt,dt){if(dt=="["){st(mt);var St=mt.getSelectionRange(),xt=gt.doc.getTextRange(St);if(xt!==""&&mt.getWrapBehavioursEnabled())return lt(St,xt,"[","]");if(ct.isSaneInsertion(mt,gt))return ct.recordAutoInsert(mt,gt,"]"),{text:"[]",selection:[1,1]}}else if(dt=="]"){st(mt);var yt=mt.getCursorPosition(),_t=gt.doc.getLine(yt.row),Ct=_t.substring(yt.column,yt.column+1);if(Ct=="]"){var Et=gt.$findOpeningBracket("]",{column:yt.column+1,row:yt.row});if(Et!==null&&ct.isAutoInsertedClosing(yt,_t,dt))return ct.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(ut,pt,mt,gt,dt){var St=gt.doc.getTextRange(dt);if(!dt.isMultiLine()&&St=="["){st(mt);var xt=gt.doc.getLine(dt.start.row),yt=xt.substring(dt.start.column+1,dt.start.column+2);if(yt=="]")return dt.end.column++,dt}}),this.add("string_dquotes","insertion",function(ut,pt,mt,gt,dt){var St=gt.$mode.$quotes||tt;if(dt.length==1&&St[dt]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(dt)!=-1)return;st(mt);var xt=dt,yt=mt.getSelectionRange(),_t=gt.doc.getTextRange(yt);if(_t!==""&&(_t.length!=1||!St[_t])&&mt.getWrapBehavioursEnabled())return lt(yt,_t,xt,xt);if(!_t){var Ct=mt.getCursorPosition(),Et=gt.doc.getLine(Ct.row),kt=Et.substring(Ct.column-1,Ct.column),Tt=Et.substring(Ct.column,Ct.column+1),$t=gt.getTokenAt(Ct.row,Ct.column),It=gt.getTokenAt(Ct.row,Ct.column+1);if(kt=="\\"&&$t&&/escape/.test($t.type))return null;var Ot=$t&&/string|escape/.test($t.type),Mt=!It||/string|escape/.test(It.type),Dt;if(Tt==xt)Dt=Ot!==Mt,Dt&&/string\.end/.test(It.type)&&(Dt=!1);else{if(Ot&&!Mt||Ot&&Mt)return null;var Bt=gt.$mode.tokenRe;Bt.lastIndex=0;var Kt=Bt.test(kt);Bt.lastIndex=0;var Wt=Bt.test(Tt),zt=gt.$mode.$pairQuotesAfter,Ht=zt&&zt[xt]&&zt[xt].test(kt);if(!Ht&&Kt||Wt||Tt&&!/[\s;,.})\]\\]/.test(Tt))return null;var Zt=Et[Ct.column-2];if(kt==xt&&(Zt==xt||Bt.test(Zt)))return null;Dt=!0}return{text:Dt?xt+xt:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(ut,pt,mt,gt,dt){var St=gt.$mode.$quotes||tt,xt=gt.doc.getTextRange(dt);if(!dt.isMultiLine()&&St.hasOwnProperty(xt)){st(mt);var yt=gt.doc.getLine(dt.start.row),_t=yt.substring(dt.start.column+1,dt.start.column+2);if(_t==xt)return dt.end.column++,dt}}),ht.closeDocComment!==!1&&this.add("doc comment end","insertion",function(ut,pt,mt,gt,dt){if(ut==="doc-start"&&(dt===` +`+Ot+$t,selection:[1,Mt.length,1,Mt.length]}}else ct.clearMaybeInsertedClosing()}),this.add("braces","deletion",function(ut,pt,mt,gt,dt){var St=gt.doc.getTextRange(dt);if(!dt.isMultiLine()&&St=="{"){st(mt);var xt=gt.doc.getLine(dt.start.row),yt=xt.substring(dt.end.column,dt.end.column+1);if(yt=="}")return dt.end.column++,dt;_.maybeInsertedBrackets--}}),this.add("parens","insertion",function(ut,pt,mt,gt,dt){if(dt=="("){st(mt);var St=mt.getSelectionRange(),xt=gt.doc.getTextRange(St);if(xt!==""&&mt.getWrapBehavioursEnabled())return lt(St,xt,"(",")");if(ct.isSaneInsertion(mt,gt))return ct.recordAutoInsert(mt,gt,")"),{text:"()",selection:[1,1]}}else if(dt==")"){st(mt);var yt=mt.getCursorPosition(),_t=gt.doc.getLine(yt.row),Ct=_t.substring(yt.column,yt.column+1);if(Ct==")"){var Et=gt.$findOpeningBracket(")",{column:yt.column+1,row:yt.row});if(Et!==null&&ct.isAutoInsertedClosing(yt,_t,dt))return ct.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(ut,pt,mt,gt,dt){var St=gt.doc.getTextRange(dt);if(!dt.isMultiLine()&&St=="("){st(mt);var xt=gt.doc.getLine(dt.start.row),yt=xt.substring(dt.start.column+1,dt.start.column+2);if(yt==")")return dt.end.column++,dt}}),this.add("brackets","insertion",function(ut,pt,mt,gt,dt){if(dt=="["){st(mt);var St=mt.getSelectionRange(),xt=gt.doc.getTextRange(St);if(xt!==""&&mt.getWrapBehavioursEnabled())return lt(St,xt,"[","]");if(ct.isSaneInsertion(mt,gt))return ct.recordAutoInsert(mt,gt,"]"),{text:"[]",selection:[1,1]}}else if(dt=="]"){st(mt);var yt=mt.getCursorPosition(),_t=gt.doc.getLine(yt.row),Ct=_t.substring(yt.column,yt.column+1);if(Ct=="]"){var Et=gt.$findOpeningBracket("]",{column:yt.column+1,row:yt.row});if(Et!==null&&ct.isAutoInsertedClosing(yt,_t,dt))return ct.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(ut,pt,mt,gt,dt){var St=gt.doc.getTextRange(dt);if(!dt.isMultiLine()&&St=="["){st(mt);var xt=gt.doc.getLine(dt.start.row),yt=xt.substring(dt.start.column+1,dt.start.column+2);if(yt=="]")return dt.end.column++,dt}}),this.add("string_dquotes","insertion",function(ut,pt,mt,gt,dt){var St=gt.$mode.$quotes||et;if(dt.length==1&&St[dt]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(dt)!=-1)return;st(mt);var xt=dt,yt=mt.getSelectionRange(),_t=gt.doc.getTextRange(yt);if(_t!==""&&(_t.length!=1||!St[_t])&&mt.getWrapBehavioursEnabled())return lt(yt,_t,xt,xt);if(!_t){var Ct=mt.getCursorPosition(),Et=gt.doc.getLine(Ct.row),kt=Et.substring(Ct.column-1,Ct.column),Tt=Et.substring(Ct.column,Ct.column+1),$t=gt.getTokenAt(Ct.row,Ct.column),It=gt.getTokenAt(Ct.row,Ct.column+1);if(kt=="\\"&&$t&&/escape/.test($t.type))return null;var Ot=$t&&/string|escape/.test($t.type),Mt=!It||/string|escape/.test(It.type),Dt;if(Tt==xt)Dt=Ot!==Mt,Dt&&/string\.end/.test(It.type)&&(Dt=!1);else{if(Ot&&!Mt||Ot&&Mt)return null;var Bt=gt.$mode.tokenRe;Bt.lastIndex=0;var Kt=Bt.test(kt);Bt.lastIndex=0;var Wt=Bt.test(Tt),zt=gt.$mode.$pairQuotesAfter,Ht=zt&&zt[xt]&&zt[xt].test(kt);if(!Ht&&Kt||Wt||Tt&&!/[\s;,.})\]\\]/.test(Tt))return null;var Zt=Et[Ct.column-2];if(kt==xt&&(Zt==xt||Bt.test(Zt)))return null;Dt=!0}return{text:Dt?xt+xt:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(ut,pt,mt,gt,dt){var St=gt.$mode.$quotes||et,xt=gt.doc.getTextRange(dt);if(!dt.isMultiLine()&&St.hasOwnProperty(xt)){st(mt);var yt=gt.doc.getLine(dt.start.row),_t=yt.substring(dt.start.column+1,dt.start.column+2);if(_t==xt)return dt.end.column++,dt}}),ht.closeDocComment!==!1&&this.add("doc comment end","insertion",function(ut,pt,mt,gt,dt){if(ut==="doc-start"&&(dt===` `||dt===`\r -`)&&mt.selection.isEmpty()){var St=mt.getCursorPosition();if(St.column===0)return;for(var xt=gt.doc.getLine(St.row),yt=gt.doc.getLine(St.row+1),_t=gt.getTokens(St.row),Ct=0,Et=0;Et<_t.length;Et++){Ct+=_t[Et].value.length;var kt=_t[Et];if(Ct>=St.column){if(Ct===St.column){if(!/\.doc/.test(kt.type))return;if(/\*\//.test(kt.value)){var Tt=_t[Et+1];if(!Tt||!/\.doc/.test(Tt.type))return}}var $t=St.column-(Ct-kt.value.length),It=kt.value.indexOf("*/"),Ot=kt.value.indexOf("/**",It>-1?It+2:0);if(Ot!==-1&&$t>Ot&&$t=It&&$t<=Ot||!/\.doc/.test(kt.type))return;break}}var Mt=this.$getIndent(xt);if(/\s*\*/.test(yt))return/^\s*\*/.test(xt)?{text:dt+Mt+"* ",selection:[1,2+Mt.length,1,2+Mt.length]}:{text:dt+Mt+" * ",selection:[1,3+Mt.length,1,3+Mt.length]};if(/\/\*\*/.test(xt.substring(0,St.column)))return{text:dt+Mt+" * "+dt+" "+Mt+"*/",selection:[1,4+Mt.length,1,4+Mt.length]}}})},ct.isSaneInsertion=function(ht,ut){var pt=ht.getCursorPosition(),mt=new at(ut,pt.row,pt.column);if(!this.$matchTokenType(mt.getCurrentToken()||"text",it)){if(/[)}\]]/.test(ht.session.getLine(pt.row)[pt.column]))return!0;var gt=new at(ut,pt.row,pt.column+1);if(!this.$matchTokenType(gt.getCurrentToken()||"text",it))return!1}return mt.stepForward(),mt.getCurrentTokenRow()!==pt.row||this.$matchTokenType(mt.getCurrentToken()||"text",j)},ct.$matchTokenType=function(ht,ut){return ut.indexOf(ht.type||ht)>-1},ct.recordAutoInsert=function(ht,ut,pt){var mt=ht.getCursorPosition(),gt=ut.doc.getLine(mt.row);this.isAutoInsertedClosing(mt,gt,_.autoInsertedLineEnd[0])||(_.autoInsertedBrackets=0),_.autoInsertedRow=mt.row,_.autoInsertedLineEnd=pt+gt.substr(mt.column),_.autoInsertedBrackets++},ct.recordMaybeInsert=function(ht,ut,pt){var mt=ht.getCursorPosition(),gt=ut.doc.getLine(mt.row);this.isMaybeInsertedClosing(mt,gt)||(_.maybeInsertedBrackets=0),_.maybeInsertedRow=mt.row,_.maybeInsertedLineStart=gt.substr(0,mt.column)+pt,_.maybeInsertedLineEnd=gt.substr(mt.column),_.maybeInsertedBrackets++},ct.isAutoInsertedClosing=function(ht,ut,pt){return _.autoInsertedBrackets>0&&ht.row===_.autoInsertedRow&&pt===_.autoInsertedLineEnd[0]&&ut.substr(ht.column)===_.autoInsertedLineEnd},ct.isMaybeInsertedClosing=function(ht,ut){return _.maybeInsertedBrackets>0&&ht.row===_.maybeInsertedRow&&ut.substr(ht.column)===_.maybeInsertedLineEnd&&ut.substr(0,ht.column)==_.maybeInsertedLineStart},ct.popAutoInsertedClosing=function(){_.autoInsertedLineEnd=_.autoInsertedLineEnd.substr(1),_.autoInsertedBrackets--},ct.clearMaybeInsertedClosing=function(){_&&(_.maybeInsertedBrackets=0,_.maybeInsertedRow=-1)},et.inherits(ct,ot),a.CstyleBehaviour=ct}),ace.define("ace/unicode",["require","exports","module"],function(o,a,rt){for(var et=[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],ot=0,at=[],nt=0;nt2?Zt%dt!=dt-1:Zt%dt==0}}else{if(!this.blockComment)return!1;var xt=this.blockComment.start,yt=this.blockComment.end,_t=new RegExp("^(\\s*)(?:"+j.escapeRegExp(xt)+")"),Ct=new RegExp("(?:"+j.escapeRegExp(yt)+")\\s*$"),Et=function(Dt,Bt){Tt(Dt,Bt)||(!pt||/\S/.test(Dt))&&(ut.insertInLine({row:Bt,column:Dt.length},yt),ut.insertInLine({row:Bt,column:gt},xt))},kt=function(Dt,Bt){var Kt;(Kt=Dt.match(Ct))&&ut.removeInLine(Bt,Dt.length-Kt[0].length,Dt.length),(Kt=Dt.match(_t))&&ut.removeInLine(Bt,Kt[1].length,Kt[0].length)},Tt=function(Dt,Bt){if(_t.test(Dt))return!0;for(var Kt=lt.getTokens(Bt),Wt=0;WtDt.length&&(Mt=Dt.length)}),gt==1/0&&(gt=Mt,pt=!1,mt=!1),St&>%dt!=0&&(gt=Math.floor(gt/dt)*dt),Ot(mt?kt:Et)},this.toggleBlockComment=function(st,lt,ct,ht){var ut=this.blockComment;if(ut){!ut.start&&ut[0]&&(ut=ut[0]);var pt=new _(lt,ht.row,ht.column),mt=pt.getCurrentToken();lt.selection;var gt=lt.selection.toOrientedRange(),dt,St;if(mt&&/comment/.test(mt.type)){for(var xt,yt;mt&&/comment/.test(mt.type);){var _t=mt.value.indexOf(ut.start);if(_t!=-1){var Ct=pt.getCurrentTokenRow(),Et=pt.getCurrentTokenColumn()+_t;xt=new $(Ct,Et,Ct,Et+ut.start.length);break}mt=pt.stepBackward()}for(var pt=new _(lt,ht.row,ht.column),mt=pt.getCurrentToken();mt&&/comment/.test(mt.type);){var _t=mt.value.indexOf(ut.end);if(_t!=-1){var Ct=pt.getCurrentTokenRow(),Et=pt.getCurrentTokenColumn()+_t;yt=new $(Ct,Et,Ct,Et+ut.end.length);break}mt=pt.stepForward()}yt&<.remove(yt),xt&&(lt.remove(xt),dt=xt.start.row,St=-ut.start.length)}else St=ut.start.length,dt=ct.start.row,lt.insert(ct.end,ut.end),lt.insert(ct.start,ut.start);gt.start.row==dt&&(gt.start.column+=St),gt.end.row==dt&&(gt.end.column+=St),lt.selection.fromOrientedRange(gt)}},this.getNextLineIndent=function(st,lt,ct){return this.$getIndent(lt)},this.checkOutdent=function(st,lt,ct){return!1},this.autoOutdent=function(st,lt,ct){},this.$getIndent=function(st){return st.match(/^\s*/)[0]},this.createWorker=function(st){return null},this.createModeDelegates=function(st){this.$embeds=[],this.$modes={};for(var lt in st)if(st[lt]){var ct=st[lt],ht=ct.prototype.$id,ut=et.$modes[ht];ut||(et.$modes[ht]=ut=new ct),et.$modes[lt]||(et.$modes[lt]=ut),this.$embeds.push(lt),this.$modes[lt]=ut}for(var pt=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],mt=function(dt){(function(St){var xt=pt[dt],yt=St[xt];St[pt[dt]]=function(){return this.$delegator(xt,arguments,yt)}})(gt)},gt=this,lt=0;ltthis.row)){var $=it(_,{row:this.row,column:this.column},this.$insertRight);this.setPosition($.row,$.column,!0)}},j.prototype.setPosition=function(_,$,tt){var st;if(tt?st={row:_,column:$}:st=this.$clipPositionToDocument(_,$),!(this.row==st.row&&this.column==st.column)){var lt={row:this.row,column:this.column};this.row=st.row,this.column=st.column,this._signal("change",{old:lt,value:st})}},j.prototype.detach=function(){this.document.off("change",this.$onChange)},j.prototype.attach=function(_){this.document=_||this.document,this.document.on("change",this.$onChange)},j.prototype.$clipPositionToDocument=function(_,$){var tt={};return _>=this.document.getLength()?(tt.row=Math.max(0,this.document.getLength()-1),tt.column=this.document.getLine(tt.row).length):_<0?(tt.row=0,tt.column=0):(tt.row=_,tt.column=Math.min(this.document.getLine(tt.row).length,Math.max(0,$))),$<0&&(tt.column=0),tt},j}();at.prototype.$insertRight=!1,et.implement(at.prototype,ot);function nt(j,_,$){var tt=$?j.column<=_.column:j.column<_.column;return j.row<_.row||j.row==_.row&&tt}function it(j,_,$){var tt=j.action=="insert",st=(tt?1:-1)*(j.end.row-j.start.row),lt=(tt?1:-1)*(j.end.column-j.start.column),ct=j.start,ht=tt?ct:j.end;return nt(_,ct,$)?{row:_.row,column:_.column}:nt(ht,_,!$)?{row:_.row+st,column:_.column+(_.row==ht.row?lt:0)}:{row:ct.row,column:ct.column}}a.Anchor=at}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(o,a,rt){var et=o("./lib/oop"),ot=o("./apply_delta").applyDelta,at=o("./lib/event_emitter").EventEmitter,nt=o("./range").Range,it=o("./anchor").Anchor,j=function(){function _($){this.$lines=[""],$.length===0?this.$lines=[""]:Array.isArray($)?this.insertMergedLines({row:0,column:0},$):this.insert({row:0,column:0},$)}return _.prototype.setValue=function($){var tt=this.getLength()-1;this.remove(new nt(0,0,tt,this.getLine(tt).length)),this.insert({row:0,column:0},$||"")},_.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},_.prototype.createAnchor=function($,tt){return new it(this,$,tt)},_.prototype.$detectNewLine=function($){var tt=$.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=tt?tt[1]:` +`)&&mt.selection.isEmpty()){var St=mt.getCursorPosition();if(St.column===0)return;for(var xt=gt.doc.getLine(St.row),yt=gt.doc.getLine(St.row+1),_t=gt.getTokens(St.row),Ct=0,Et=0;Et<_t.length;Et++){Ct+=_t[Et].value.length;var kt=_t[Et];if(Ct>=St.column){if(Ct===St.column){if(!/\.doc/.test(kt.type))return;if(/\*\//.test(kt.value)){var Tt=_t[Et+1];if(!Tt||!/\.doc/.test(Tt.type))return}}var $t=St.column-(Ct-kt.value.length),It=kt.value.indexOf("*/"),Ot=kt.value.indexOf("/**",It>-1?It+2:0);if(Ot!==-1&&$t>Ot&&$t=It&&$t<=Ot||!/\.doc/.test(kt.type))return;break}}var Mt=this.$getIndent(xt);if(/\s*\*/.test(yt))return/^\s*\*/.test(xt)?{text:dt+Mt+"* ",selection:[1,2+Mt.length,1,2+Mt.length]}:{text:dt+Mt+" * ",selection:[1,3+Mt.length,1,3+Mt.length]};if(/\/\*\*/.test(xt.substring(0,St.column)))return{text:dt+Mt+" * "+dt+" "+Mt+"*/",selection:[1,4+Mt.length,1,4+Mt.length]}}})},ct.isSaneInsertion=function(ht,ut){var pt=ht.getCursorPosition(),mt=new at(ut,pt.row,pt.column);if(!this.$matchTokenType(mt.getCurrentToken()||"text",it)){if(/[)}\]]/.test(ht.session.getLine(pt.row)[pt.column]))return!0;var gt=new at(ut,pt.row,pt.column+1);if(!this.$matchTokenType(gt.getCurrentToken()||"text",it))return!1}return mt.stepForward(),mt.getCurrentTokenRow()!==pt.row||this.$matchTokenType(mt.getCurrentToken()||"text",j)},ct.$matchTokenType=function(ht,ut){return ut.indexOf(ht.type||ht)>-1},ct.recordAutoInsert=function(ht,ut,pt){var mt=ht.getCursorPosition(),gt=ut.doc.getLine(mt.row);this.isAutoInsertedClosing(mt,gt,_.autoInsertedLineEnd[0])||(_.autoInsertedBrackets=0),_.autoInsertedRow=mt.row,_.autoInsertedLineEnd=pt+gt.substr(mt.column),_.autoInsertedBrackets++},ct.recordMaybeInsert=function(ht,ut,pt){var mt=ht.getCursorPosition(),gt=ut.doc.getLine(mt.row);this.isMaybeInsertedClosing(mt,gt)||(_.maybeInsertedBrackets=0),_.maybeInsertedRow=mt.row,_.maybeInsertedLineStart=gt.substr(0,mt.column)+pt,_.maybeInsertedLineEnd=gt.substr(mt.column),_.maybeInsertedBrackets++},ct.isAutoInsertedClosing=function(ht,ut,pt){return _.autoInsertedBrackets>0&&ht.row===_.autoInsertedRow&&pt===_.autoInsertedLineEnd[0]&&ut.substr(ht.column)===_.autoInsertedLineEnd},ct.isMaybeInsertedClosing=function(ht,ut){return _.maybeInsertedBrackets>0&&ht.row===_.maybeInsertedRow&&ut.substr(ht.column)===_.maybeInsertedLineEnd&&ut.substr(0,ht.column)==_.maybeInsertedLineStart},ct.popAutoInsertedClosing=function(){_.autoInsertedLineEnd=_.autoInsertedLineEnd.substr(1),_.autoInsertedBrackets--},ct.clearMaybeInsertedClosing=function(){_&&(_.maybeInsertedBrackets=0,_.maybeInsertedRow=-1)},tt.inherits(ct,ot),a.CstyleBehaviour=ct}),ace.define("ace/unicode",["require","exports","module"],function(o,a,rt){for(var tt=[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],ot=0,at=[],nt=0;nt2?Zt%dt!=dt-1:Zt%dt==0}}else{if(!this.blockComment)return!1;var xt=this.blockComment.start,yt=this.blockComment.end,_t=new RegExp("^(\\s*)(?:"+j.escapeRegExp(xt)+")"),Ct=new RegExp("(?:"+j.escapeRegExp(yt)+")\\s*$"),Et=function(Dt,Bt){Tt(Dt,Bt)||(!pt||/\S/.test(Dt))&&(ut.insertInLine({row:Bt,column:Dt.length},yt),ut.insertInLine({row:Bt,column:gt},xt))},kt=function(Dt,Bt){var Kt;(Kt=Dt.match(Ct))&&ut.removeInLine(Bt,Dt.length-Kt[0].length,Dt.length),(Kt=Dt.match(_t))&&ut.removeInLine(Bt,Kt[1].length,Kt[0].length)},Tt=function(Dt,Bt){if(_t.test(Dt))return!0;for(var Kt=lt.getTokens(Bt),Wt=0;WtDt.length&&(Mt=Dt.length)}),gt==1/0&&(gt=Mt,pt=!1,mt=!1),St&>%dt!=0&&(gt=Math.floor(gt/dt)*dt),Ot(mt?kt:Et)},this.toggleBlockComment=function(st,lt,ct,ht){var ut=this.blockComment;if(ut){!ut.start&&ut[0]&&(ut=ut[0]);var pt=new _(lt,ht.row,ht.column),mt=pt.getCurrentToken();lt.selection;var gt=lt.selection.toOrientedRange(),dt,St;if(mt&&/comment/.test(mt.type)){for(var xt,yt;mt&&/comment/.test(mt.type);){var _t=mt.value.indexOf(ut.start);if(_t!=-1){var Ct=pt.getCurrentTokenRow(),Et=pt.getCurrentTokenColumn()+_t;xt=new $(Ct,Et,Ct,Et+ut.start.length);break}mt=pt.stepBackward()}for(var pt=new _(lt,ht.row,ht.column),mt=pt.getCurrentToken();mt&&/comment/.test(mt.type);){var _t=mt.value.indexOf(ut.end);if(_t!=-1){var Ct=pt.getCurrentTokenRow(),Et=pt.getCurrentTokenColumn()+_t;yt=new $(Ct,Et,Ct,Et+ut.end.length);break}mt=pt.stepForward()}yt&<.remove(yt),xt&&(lt.remove(xt),dt=xt.start.row,St=-ut.start.length)}else St=ut.start.length,dt=ct.start.row,lt.insert(ct.end,ut.end),lt.insert(ct.start,ut.start);gt.start.row==dt&&(gt.start.column+=St),gt.end.row==dt&&(gt.end.column+=St),lt.selection.fromOrientedRange(gt)}},this.getNextLineIndent=function(st,lt,ct){return this.$getIndent(lt)},this.checkOutdent=function(st,lt,ct){return!1},this.autoOutdent=function(st,lt,ct){},this.$getIndent=function(st){return st.match(/^\s*/)[0]},this.createWorker=function(st){return null},this.createModeDelegates=function(st){this.$embeds=[],this.$modes={};for(var lt in st)if(st[lt]){var ct=st[lt],ht=ct.prototype.$id,ut=tt.$modes[ht];ut||(tt.$modes[ht]=ut=new ct),tt.$modes[lt]||(tt.$modes[lt]=ut),this.$embeds.push(lt),this.$modes[lt]=ut}for(var pt=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],mt=function(dt){(function(St){var xt=pt[dt],yt=St[xt];St[pt[dt]]=function(){return this.$delegator(xt,arguments,yt)}})(gt)},gt=this,lt=0;ltthis.row)){var $=it(_,{row:this.row,column:this.column},this.$insertRight);this.setPosition($.row,$.column,!0)}},j.prototype.setPosition=function(_,$,et){var st;if(et?st={row:_,column:$}:st=this.$clipPositionToDocument(_,$),!(this.row==st.row&&this.column==st.column)){var lt={row:this.row,column:this.column};this.row=st.row,this.column=st.column,this._signal("change",{old:lt,value:st})}},j.prototype.detach=function(){this.document.off("change",this.$onChange)},j.prototype.attach=function(_){this.document=_||this.document,this.document.on("change",this.$onChange)},j.prototype.$clipPositionToDocument=function(_,$){var et={};return _>=this.document.getLength()?(et.row=Math.max(0,this.document.getLength()-1),et.column=this.document.getLine(et.row).length):_<0?(et.row=0,et.column=0):(et.row=_,et.column=Math.min(this.document.getLine(et.row).length,Math.max(0,$))),$<0&&(et.column=0),et},j}();at.prototype.$insertRight=!1,tt.implement(at.prototype,ot);function nt(j,_,$){var et=$?j.column<=_.column:j.column<_.column;return j.row<_.row||j.row==_.row&&et}function it(j,_,$){var et=j.action=="insert",st=(et?1:-1)*(j.end.row-j.start.row),lt=(et?1:-1)*(j.end.column-j.start.column),ct=j.start,ht=et?ct:j.end;return nt(_,ct,$)?{row:_.row,column:_.column}:nt(ht,_,!$)?{row:_.row+st,column:_.column+(_.row==ht.row?lt:0)}:{row:ct.row,column:ct.column}}a.Anchor=at}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(o,a,rt){var tt=o("./lib/oop"),ot=o("./apply_delta").applyDelta,at=o("./lib/event_emitter").EventEmitter,nt=o("./range").Range,it=o("./anchor").Anchor,j=function(){function _($){this.$lines=[""],$.length===0?this.$lines=[""]:Array.isArray($)?this.insertMergedLines({row:0,column:0},$):this.insert({row:0,column:0},$)}return _.prototype.setValue=function($){var et=this.getLength()-1;this.remove(new nt(0,0,et,this.getLine(et).length)),this.insert({row:0,column:0},$||"")},_.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},_.prototype.createAnchor=function($,et){return new it(this,$,et)},_.prototype.$detectNewLine=function($){var et=$.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=et?et[1]:` `,this._signal("changeNewLineMode")},_.prototype.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return`\r `;case"unix":return` `;default:return this.$autoNewLine||` `}},_.prototype.setNewLineMode=function($){this.$newLineMode!==$&&(this.$newLineMode=$,this._signal("changeNewLineMode"))},_.prototype.getNewLineMode=function(){return this.$newLineMode},_.prototype.isNewLine=function($){return $==`\r `||$=="\r"||$==` -`},_.prototype.getLine=function($){return this.$lines[$]||""},_.prototype.getLines=function($,tt){return this.$lines.slice($,tt+1)},_.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},_.prototype.getLength=function(){return this.$lines.length},_.prototype.getTextRange=function($){return this.getLinesForRange($).join(this.getNewLineCharacter())},_.prototype.getLinesForRange=function($){var tt;if($.start.row===$.end.row)tt=[this.getLine($.start.row).substring($.start.column,$.end.column)];else{tt=this.getLines($.start.row,$.end.row),tt[0]=(tt[0]||"").substring($.start.column);var st=tt.length-1;$.end.row-$.start.row==st&&(tt[st]=tt[st].substring(0,$.end.column))}return tt},_.prototype.insertLines=function($,tt){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines($,tt)},_.prototype.removeLines=function($,tt){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines($,tt)},_.prototype.insertNewLine=function($){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines($,["",""])},_.prototype.insert=function($,tt){return this.getLength()<=1&&this.$detectNewLine(tt),this.insertMergedLines($,this.$split(tt))},_.prototype.insertInLine=function($,tt){var st=this.clippedPos($.row,$.column),lt=this.pos($.row,$.column+tt.length);return this.applyDelta({start:st,end:lt,action:"insert",lines:[tt]},!0),this.clonePos(lt)},_.prototype.clippedPos=function($,tt){var st=this.getLength();$===void 0?$=st:$<0?$=0:$>=st&&($=st-1,tt=void 0);var lt=this.getLine($);return tt==null&&(tt=lt.length),tt=Math.min(Math.max(tt,0),lt.length),{row:$,column:tt}},_.prototype.clonePos=function($){return{row:$.row,column:$.column}},_.prototype.pos=function($,tt){return{row:$,column:tt}},_.prototype.$clipPosition=function($){var tt=this.getLength();return $.row>=tt?($.row=Math.max(0,tt-1),$.column=this.getLine(tt-1).length):($.row=Math.max(0,$.row),$.column=Math.min(Math.max($.column,0),this.getLine($.row).length)),$},_.prototype.insertFullLines=function($,tt){$=Math.min(Math.max($,0),this.getLength());var st=0;$0,lt=tt=0&&this.applyDelta({start:this.pos($,this.getLine($).length),end:this.pos($+1,0),action:"remove",lines:["",""]})},_.prototype.replace=function($,tt){if($ instanceof nt||($=nt.fromPoints($.start,$.end)),tt.length===0&&$.isEmpty())return $.start;if(tt==this.getTextRange($))return $.end;this.remove($);var st;return tt?st=this.insert($.start,tt):st=$.start,st},_.prototype.applyDeltas=function($){for(var tt=0;tt<$.length;tt++)this.applyDelta($[tt])},_.prototype.revertDeltas=function($){for(var tt=$.length-1;tt>=0;tt--)this.revertDelta($[tt])},_.prototype.applyDelta=function($,tt){var st=$.action=="insert";(st?$.lines.length<=1&&!$.lines[0]:!nt.comparePoints($.start,$.end))||(st&&$.lines.length>2e4?this.$splitAndapplyLargeDelta($,2e4):(ot(this.$lines,$,tt),this._signal("change",$)))},_.prototype.$safeApplyDelta=function($){var tt=this.$lines.length;($.action=="remove"&&$.start.row20){_.running=setTimeout(_.$worker,20);break}}_.currentLine=tt,st==-1&&(st=tt),ct<=st&&_.fireUpdateEvent(ct,st)}}}return nt.prototype.setTokenizer=function(it){this.tokenizer=it,this.lines=[],this.states=[],this.start(0)},nt.prototype.setDocument=function(it){this.doc=it,this.lines=[],this.states=[],this.stop()},nt.prototype.fireUpdateEvent=function(it,j){var _={first:it,last:j};this._signal("update",{data:_})},nt.prototype.start=function(it){this.currentLine=Math.min(it||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)},nt.prototype.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},nt.prototype.$updateOnChange=function(it){var j=it.start.row,_=it.end.row-j;if(_===0)this.lines[j]=null;else if(it.action=="remove")this.lines.splice(j,_+1,null),this.states.splice(j,_+1,null);else{var $=Array(_+1);$.unshift(j,1),this.lines.splice.apply(this.lines,$),this.states.splice.apply(this.states,$)}this.currentLine=Math.min(j,this.currentLine,this.doc.getLength()),this.stop()},nt.prototype.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},nt.prototype.getTokens=function(it){return this.lines[it]||this.$tokenizeRow(it)},nt.prototype.getState=function(it){return this.currentLine==it&&this.$tokenizeRow(it),this.states[it]||"start"},nt.prototype.$tokenizeRow=function(it){var j=this.doc.getLine(it),_=this.states[it-1],$=this.tokenizer.getLineTokens(j,_,it);return this.states[it]+""!=$.state+""?(this.states[it]=$.state,this.lines[it+1]=null,this.currentLine>it+1&&(this.currentLine=it+1)):this.currentLine==it&&(this.currentLine=it+1),this.lines[it]=$.tokens},nt.prototype.cleanup=function(){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.removeAllListeners()},nt}();et.implement(at.prototype,ot),a.BackgroundTokenizer=at}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"],function(o,a,rt){var et=o("./lib/lang"),ot=o("./range").Range,at=function(){function nt(it,j,_){_===void 0&&(_="text"),this.setRegexp(it),this.clazz=j,this.type=_}return nt.prototype.setRegexp=function(it){this.regExp+""!=it+""&&(this.regExp=it,this.cache=[])},nt.prototype.update=function(it,j,_,$){if(this.regExp)for(var tt=$.firstRow,st=$.lastRow,lt={},ct=tt;ct<=st;ct++){var ht=this.cache[ct];ht==null&&(ht=et.getMatchOffsets(_.getLine(ct),this.regExp),ht.length>this.MAX_RANGES&&(ht=ht.slice(0,this.MAX_RANGES)),ht=ht.map(function(gt){return new ot(ct,gt.offset,ct,gt.offset+gt.length)}),this.cache[ct]=ht.length?ht:"");for(var ut=ht.length;ut--;){var pt=ht[ut].toScreenRange(_),mt=pt.toString();lt[mt]||(lt[mt]=!0,j.drawSingleLineMarker(it,pt,this.clazz,$))}}},nt}();at.prototype.MAX_RANGES=500,a.SearchHighlight=at}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(o,a,rt){var et=function(){function gt(){this.$keepRedoStack,this.$maxRev=0,this.$fromUndo=!1,this.$undoDepth=1/0,this.reset()}return gt.prototype.addSession=function(dt){this.$session=dt},gt.prototype.add=function(dt,St,xt){if(!this.$fromUndo&&dt!=this.$lastDelta){if(this.$keepRedoStack||(this.$redoStack.length=0),St===!1||!this.lastDeltas){this.lastDeltas=[];var yt=this.$undoStack.length;yt>this.$undoDepth-1&&this.$undoStack.splice(0,yt-this.$undoDepth+1),this.$undoStack.push(this.lastDeltas),dt.id=this.$rev=++this.$maxRev}(dt.action=="remove"||dt.action=="insert")&&(this.$lastDelta=dt),this.lastDeltas.push(dt)}},gt.prototype.addSelection=function(dt,St){this.selections.push({value:dt,rev:St||this.$rev})},gt.prototype.startNewGroup=function(){return this.lastDeltas=null,this.$rev},gt.prototype.markIgnored=function(dt,St){St==null&&(St=this.$rev+1);for(var xt=this.$undoStack,yt=xt.length;yt--;){var _t=xt[yt][0];if(_t.id<=dt)break;_t.id0},gt.prototype.canRedo=function(){return this.$redoStack.length>0},gt.prototype.bookmark=function(dt){dt==null&&(dt=this.$rev),this.mark=dt},gt.prototype.isAtBookmark=function(){return this.$rev===this.mark},gt.prototype.toJSON=function(){return{$redoStack:this.$redoStack,$undoStack:this.$undoStack}},gt.prototype.fromJSON=function(dt){this.reset(),this.$undoStack=dt.$undoStack,this.$redoStack=dt.$redoStack},gt.prototype.$prettyPrint=function(dt){return dt?_(dt):_(this.$undoStack)+` +`},_.prototype.getLine=function($){return this.$lines[$]||""},_.prototype.getLines=function($,et){return this.$lines.slice($,et+1)},_.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},_.prototype.getLength=function(){return this.$lines.length},_.prototype.getTextRange=function($){return this.getLinesForRange($).join(this.getNewLineCharacter())},_.prototype.getLinesForRange=function($){var et;if($.start.row===$.end.row)et=[this.getLine($.start.row).substring($.start.column,$.end.column)];else{et=this.getLines($.start.row,$.end.row),et[0]=(et[0]||"").substring($.start.column);var st=et.length-1;$.end.row-$.start.row==st&&(et[st]=et[st].substring(0,$.end.column))}return et},_.prototype.insertLines=function($,et){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines($,et)},_.prototype.removeLines=function($,et){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines($,et)},_.prototype.insertNewLine=function($){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines($,["",""])},_.prototype.insert=function($,et){return this.getLength()<=1&&this.$detectNewLine(et),this.insertMergedLines($,this.$split(et))},_.prototype.insertInLine=function($,et){var st=this.clippedPos($.row,$.column),lt=this.pos($.row,$.column+et.length);return this.applyDelta({start:st,end:lt,action:"insert",lines:[et]},!0),this.clonePos(lt)},_.prototype.clippedPos=function($,et){var st=this.getLength();$===void 0?$=st:$<0?$=0:$>=st&&($=st-1,et=void 0);var lt=this.getLine($);return et==null&&(et=lt.length),et=Math.min(Math.max(et,0),lt.length),{row:$,column:et}},_.prototype.clonePos=function($){return{row:$.row,column:$.column}},_.prototype.pos=function($,et){return{row:$,column:et}},_.prototype.$clipPosition=function($){var et=this.getLength();return $.row>=et?($.row=Math.max(0,et-1),$.column=this.getLine(et-1).length):($.row=Math.max(0,$.row),$.column=Math.min(Math.max($.column,0),this.getLine($.row).length)),$},_.prototype.insertFullLines=function($,et){$=Math.min(Math.max($,0),this.getLength());var st=0;$0,lt=et=0&&this.applyDelta({start:this.pos($,this.getLine($).length),end:this.pos($+1,0),action:"remove",lines:["",""]})},_.prototype.replace=function($,et){if($ instanceof nt||($=nt.fromPoints($.start,$.end)),et.length===0&&$.isEmpty())return $.start;if(et==this.getTextRange($))return $.end;this.remove($);var st;return et?st=this.insert($.start,et):st=$.start,st},_.prototype.applyDeltas=function($){for(var et=0;et<$.length;et++)this.applyDelta($[et])},_.prototype.revertDeltas=function($){for(var et=$.length-1;et>=0;et--)this.revertDelta($[et])},_.prototype.applyDelta=function($,et){var st=$.action=="insert";(st?$.lines.length<=1&&!$.lines[0]:!nt.comparePoints($.start,$.end))||(st&&$.lines.length>2e4?this.$splitAndapplyLargeDelta($,2e4):(ot(this.$lines,$,et),this._signal("change",$)))},_.prototype.$safeApplyDelta=function($){var et=this.$lines.length;($.action=="remove"&&$.start.row20){_.running=setTimeout(_.$worker,20);break}}_.currentLine=et,st==-1&&(st=et),ct<=st&&_.fireUpdateEvent(ct,st)}}}return nt.prototype.setTokenizer=function(it){this.tokenizer=it,this.lines=[],this.states=[],this.start(0)},nt.prototype.setDocument=function(it){this.doc=it,this.lines=[],this.states=[],this.stop()},nt.prototype.fireUpdateEvent=function(it,j){var _={first:it,last:j};this._signal("update",{data:_})},nt.prototype.start=function(it){this.currentLine=Math.min(it||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)},nt.prototype.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},nt.prototype.$updateOnChange=function(it){var j=it.start.row,_=it.end.row-j;if(_===0)this.lines[j]=null;else if(it.action=="remove")this.lines.splice(j,_+1,null),this.states.splice(j,_+1,null);else{var $=Array(_+1);$.unshift(j,1),this.lines.splice.apply(this.lines,$),this.states.splice.apply(this.states,$)}this.currentLine=Math.min(j,this.currentLine,this.doc.getLength()),this.stop()},nt.prototype.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},nt.prototype.getTokens=function(it){return this.lines[it]||this.$tokenizeRow(it)},nt.prototype.getState=function(it){return this.currentLine==it&&this.$tokenizeRow(it),this.states[it]||"start"},nt.prototype.$tokenizeRow=function(it){var j=this.doc.getLine(it),_=this.states[it-1],$=this.tokenizer.getLineTokens(j,_,it);return this.states[it]+""!=$.state+""?(this.states[it]=$.state,this.lines[it+1]=null,this.currentLine>it+1&&(this.currentLine=it+1)):this.currentLine==it&&(this.currentLine=it+1),this.lines[it]=$.tokens},nt.prototype.cleanup=function(){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.removeAllListeners()},nt}();tt.implement(at.prototype,ot),a.BackgroundTokenizer=at}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"],function(o,a,rt){var tt=o("./lib/lang"),ot=o("./range").Range,at=function(){function nt(it,j,_){_===void 0&&(_="text"),this.setRegexp(it),this.clazz=j,this.type=_}return nt.prototype.setRegexp=function(it){this.regExp+""!=it+""&&(this.regExp=it,this.cache=[])},nt.prototype.update=function(it,j,_,$){if(this.regExp)for(var et=$.firstRow,st=$.lastRow,lt={},ct=et;ct<=st;ct++){var ht=this.cache[ct];ht==null&&(ht=tt.getMatchOffsets(_.getLine(ct),this.regExp),ht.length>this.MAX_RANGES&&(ht=ht.slice(0,this.MAX_RANGES)),ht=ht.map(function(gt){return new ot(ct,gt.offset,ct,gt.offset+gt.length)}),this.cache[ct]=ht.length?ht:"");for(var ut=ht.length;ut--;){var pt=ht[ut].toScreenRange(_),mt=pt.toString();lt[mt]||(lt[mt]=!0,j.drawSingleLineMarker(it,pt,this.clazz,$))}}},nt}();at.prototype.MAX_RANGES=500,a.SearchHighlight=at}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(o,a,rt){var tt=function(){function gt(){this.$keepRedoStack,this.$maxRev=0,this.$fromUndo=!1,this.$undoDepth=1/0,this.reset()}return gt.prototype.addSession=function(dt){this.$session=dt},gt.prototype.add=function(dt,St,xt){if(!this.$fromUndo&&dt!=this.$lastDelta){if(this.$keepRedoStack||(this.$redoStack.length=0),St===!1||!this.lastDeltas){this.lastDeltas=[];var yt=this.$undoStack.length;yt>this.$undoDepth-1&&this.$undoStack.splice(0,yt-this.$undoDepth+1),this.$undoStack.push(this.lastDeltas),dt.id=this.$rev=++this.$maxRev}(dt.action=="remove"||dt.action=="insert")&&(this.$lastDelta=dt),this.lastDeltas.push(dt)}},gt.prototype.addSelection=function(dt,St){this.selections.push({value:dt,rev:St||this.$rev})},gt.prototype.startNewGroup=function(){return this.lastDeltas=null,this.$rev},gt.prototype.markIgnored=function(dt,St){St==null&&(St=this.$rev+1);for(var xt=this.$undoStack,yt=xt.length;yt--;){var _t=xt[yt][0];if(_t.id<=dt)break;_t.id0},gt.prototype.canRedo=function(){return this.$redoStack.length>0},gt.prototype.bookmark=function(dt){dt==null&&(dt=this.$rev),this.mark=dt},gt.prototype.isAtBookmark=function(){return this.$rev===this.mark},gt.prototype.toJSON=function(){return{$redoStack:this.$redoStack,$undoStack:this.$undoStack}},gt.prototype.fromJSON=function(dt){this.reset(),this.$undoStack=dt.$undoStack,this.$redoStack=dt.$redoStack},gt.prototype.$prettyPrint=function(dt){return dt?_(dt):_(this.$undoStack)+` --- -`+_(this.$redoStack)},gt}();et.prototype.hasUndo=et.prototype.canUndo,et.prototype.hasRedo=et.prototype.canRedo,et.prototype.isClean=et.prototype.isAtBookmark,et.prototype.markClean=et.prototype.bookmark;function ot(gt,dt){for(var St=dt;St--;){var xt=gt[St];if(xt&&!xt[0].ignore){for(;St"+gt.end.row+":"+gt.end.column}function tt(gt,dt){var St=gt.action=="insert",xt=dt.action=="insert";if(St&&xt)if(nt(dt.start,gt.end)>=0)ct(dt,gt,-1);else if(nt(dt.start,gt.start)<=0)ct(gt,dt,1);else return null;else if(St&&!xt)if(nt(dt.start,gt.end)>=0)ct(dt,gt,-1);else if(nt(dt.end,gt.start)<=0)ct(gt,dt,-1);else return null;else if(!St&&xt)if(nt(dt.start,gt.start)>=0)ct(dt,gt,1);else if(nt(dt.start,gt.start)<=0)ct(gt,dt,1);else return null;else if(!St&&!xt)if(nt(dt.start,gt.start)>=0)ct(dt,gt,1);else if(nt(dt.end,gt.start)<=0)ct(gt,dt,-1);else return null;return[dt,gt]}function st(gt,dt){for(var St=gt.length;St--;)for(var xt=0;xt=0?ct(gt,dt,-1):(nt(gt.start,dt.start)<=0||ct(gt,at.fromPoints(dt.start,gt.start),-1),ct(dt,gt,1));else if(!St&&xt)nt(dt.start,gt.end)>=0?ct(dt,gt,-1):(nt(dt.start,gt.start)<=0||ct(dt,at.fromPoints(gt.start,dt.start),-1),ct(gt,dt,1));else if(!St&&!xt)if(nt(dt.start,gt.end)>=0)ct(dt,gt,-1);else if(nt(dt.end,gt.start)<=0)ct(gt,dt,-1);else{var yt,_t;return nt(gt.start,dt.start)<0&&(yt=gt,gt=ut(gt,dt.start)),nt(gt.end,dt.end)>0&&(_t=ut(gt,dt.end)),ht(dt.end,gt.start,gt.end,-1),_t&&!yt&&(gt.lines=_t.lines,gt.start=_t.start,gt.end=_t.end,_t=gt),[dt,yt,_t].filter(Boolean)}return[dt,gt]}function ct(gt,dt,St){ht(gt.start,dt.start,dt.end,St),ht(gt.end,dt.start,dt.end,St)}function ht(gt,dt,St,xt){gt.row==(xt==1?dt:St).row&&(gt.column+=xt*(St.column-dt.column)),gt.row+=xt*(St.row-dt.row)}function ut(gt,dt){var St=gt.lines,xt=gt.end;gt.end=it(dt);var yt=gt.end.row-gt.start.row,_t=St.splice(yt,St.length),Ct=yt?dt.column:dt.column-gt.start.column;St.push(_t[0].substring(0,Ct)),_t[0]=_t[0].substr(Ct);var Et={start:it(dt),end:xt,lines:_t,action:gt.action};return Et}function pt(gt,dt){dt=j(dt);for(var St=gt.length;St--;){for(var xt=gt[St],yt=0;ytthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(nt),this.folds.sort(function(it,j){return-it.range.compareEnd(j.start.row,j.start.column)}),this.range.compareEnd(nt.start.row,nt.start.column)>0?(this.end.row=nt.end.row,this.end.column=nt.end.column):this.range.compareStart(nt.end.row,nt.end.column)<0&&(this.start.row=nt.start.row,this.start.column=nt.start.column)}else if(nt.start.row==this.end.row)this.folds.push(nt),this.end.row=nt.end.row,this.end.column=nt.end.column;else if(nt.end.row==this.start.row)this.folds.unshift(nt),this.start.row=nt.start.row,this.start.column=nt.start.column;else throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");nt.foldLine=this},at.prototype.containsRow=function(nt){return nt>=this.start.row&&nt<=this.end.row},at.prototype.walk=function(nt,it,j){var _=0,$=this.folds,tt,st,lt,ct=!0;it==null&&(it=this.end.row,j=this.end.column);for(var ht=0;ht<$.length;ht++){if(tt=$[ht],st=tt.range.compareStart(it,j),st==-1){nt(null,it,j,_,ct);return}if(lt=nt(null,tt.start.row,tt.start.column,_,ct),lt=!lt&&nt(tt.placeholder,tt.start.row,tt.start.column,_),lt||st===0)return;ct=!tt.sameRow,_=tt.end.column}nt(null,it,j,_,ct)},at.prototype.getNextFoldTo=function(nt,it){for(var j,_,$=0;$0)){var ct=ot(it,st.start);return lt===0?j&&ct!==0?-tt-2:tt:ct>0||ct===0&&!j?tt:-tt-1}}return-tt-1},nt.prototype.add=function(it){var j=!it.isEmpty(),_=this.pointIndex(it.start,j);_<0&&(_=-_-1);var $=this.pointIndex(it.end,j,_);return $<0?$=-$-1:$++,this.ranges.splice(_,$-_,it)},nt.prototype.addList=function(it){for(var j=[],_=it.length;_--;)j.push.apply(j,this.add(it[_]));return j},nt.prototype.substractPoint=function(it){var j=this.pointIndex(it);if(j>=0)return this.ranges.splice(j,1)},nt.prototype.merge=function(){var it=[],j=this.ranges;j=j.sort(function(lt,ct){return ot(lt.start,ct.start)});for(var _=j[0],$,tt=1;tt=0},nt.prototype.containsPoint=function(it){return this.pointIndex(it)>=0},nt.prototype.rangeAtPoint=function(it){var j=this.pointIndex(it);if(j>=0)return this.ranges[j]},nt.prototype.clipRows=function(it,j){var _=this.ranges;if(_[0].start.row>j||_[_.length-1].start.row=$)break}if(it.action=="insert")for(var ut=tt-$,pt=-j.column+_.column;lt$)break;if(ht.start.row==$&&ht.start.column>=j.column&&(ht.start.column==j.column&&this.$bias<=0||(ht.start.column+=pt,ht.start.row+=ut)),ht.end.row==$&&ht.end.column>=j.column){if(ht.end.column==j.column&&this.$bias<0)continue;ht.end.column==j.column&&pt>0&<ht.start.column&&ht.end.column==st[lt+1].start.column&&(ht.end.column-=pt),ht.end.column+=pt,ht.end.row+=ut}}else for(var ut=$-tt,pt=j.column-_.column;lttt)break;ht.end.rowj.column)&&(ht.end.column=j.column,ht.end.row=j.row):(ht.end.column+=pt,ht.end.row+=ut):ht.end.row>tt&&(ht.end.row+=ut),ht.start.rowj.column)&&(ht.start.column=j.column,ht.start.row=j.row):(ht.start.column+=pt,ht.start.row+=ut):ht.start.row>tt&&(ht.start.row+=ut)}if(ut!=0&<=_)return lt;if(lt.end.row>_)return null}return null},this.getNextFoldLine=function(_,$){var tt=this.$foldData,st=0;for($&&(st=tt.indexOf($)),st==-1&&(st=0),st;st=_)return lt}return null},this.getFoldedRowCount=function(_,$){for(var tt=this.$foldData,st=$-_+1,lt=0;lt=$){ut<$&&(ut>=_?st-=$-ut:st=0);break}else ht>=_&&(ut>=_?st-=ht-ut:st-=ht-_+1)}return st},this.$addFoldLine=function(_){return this.$foldData.push(_),this.$foldData.sort(function($,tt){return $.start.row-tt.start.row}),_},this.addFold=function(_,$){var tt=this.$foldData,st=!1,lt;_ instanceof at?lt=_:(lt=new at($,_),lt.collapseChildren=$.collapseChildren),this.$clipRangeToDocument(lt.range);var ct=lt.start.row,ht=lt.start.column,ut=lt.end.row,pt=lt.end.column,mt=this.getFoldAt(ct,ht,1),gt=this.getFoldAt(ut,pt,-1);if(mt&>==mt)return mt.addSubFold(lt);mt&&!mt.range.isStart(ct,ht)&&this.removeFold(mt),gt&&!gt.range.isEnd(ut,pt)&&this.removeFold(gt);var dt=this.getFoldsInRange(lt.range);dt.length>0&&(this.removeFolds(dt),lt.collapseChildren||dt.forEach(function(_t){lt.addSubFold(_t)}));for(var St=0;St0&&this.foldAll(_.start.row+1,_.end.row,_.collapseChildren-1),_.subFolds=[]},this.expandFolds=function(_){_.forEach(function($){this.expandFold($)},this)},this.unfold=function(_,$){var tt,st;if(_==null)tt=new et(0,0,this.getLength(),0),$==null&&($=!0);else if(typeof _=="number")tt=new et(_,0,_,this.getLine(_).length);else if("row"in _)tt=et.fromPoints(_,_);else{if(Array.isArray(_))return st=[],_.forEach(function(ct){st=st.concat(this.unfold(ct))},this),st;tt=_}st=this.getFoldsInRangeList(tt);for(var lt=st;st.length==1&&et.comparePoints(st[0].start,tt.start)<0&&et.comparePoints(st[0].end,tt.end)>0;)this.expandFolds(st),st=this.getFoldsInRangeList(tt);if($!=!1?this.removeFolds(st):this.expandFolds(st),lt.length)return lt},this.isRowFolded=function(_,$){return!!this.getFoldLine(_,$)},this.getRowFoldEnd=function(_,$){var tt=this.getFoldLine(_,$);return tt?tt.end.row:_},this.getRowFoldStart=function(_,$){var tt=this.getFoldLine(_,$);return tt?tt.start.row:_},this.getFoldDisplayLine=function(_,$,tt,st,lt){st==null&&(st=_.start.row),lt==null&&(lt=0),$==null&&($=_.end.row),tt==null&&(tt=this.getLine($).length);var ct=this.doc,ht="";return _.walk(function(ut,pt,mt,gt){if(!(ptmt)break;while(lt&&ht.test(lt.type));lt=st.stepBackward()}else lt=st.getCurrentToken();return ut.end.row=st.getCurrentTokenRow(),ut.end.column=st.getCurrentTokenColumn(),ut}},this.foldAll=function(_,$,tt,st){tt==null&&(tt=1e5);var lt=this.foldWidgets;if(lt){$=$||this.getLength(),_=_||0;for(var ct=_;ct<$;ct++)if(lt[ct]==null&&(lt[ct]=this.getFoldWidget(ct)),lt[ct]=="start"&&!(st&&!st(ct))){var ht=this.getFoldWidgetRange(ct);ht&&ht.isMultiLine()&&ht.end.row<=$&&ht.start.row>=_&&(ct=ht.end.row,ht.collapseChildren=tt,this.addFold("...",ht))}}},this.foldToLevel=function(_){for(this.foldAll();_-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var _=this;this.foldAll(null,null,null,function($){for(var tt=_.getTokens($),st=0;st=0;){var ct=tt[st];if(ct==null&&(ct=tt[st]=this.getFoldWidget(st)),ct=="start"){var ht=this.getFoldWidgetRange(st);if(lt||(lt=ht),ht&&ht.end.row>=_)break}st--}return{range:st!==-1&&ht,firstRange:lt}},this.onFoldWidgetClick=function(_,$){$ instanceof it&&($=$.domEvent);var tt={children:$.shiftKey,all:$.ctrlKey||$.metaKey,siblings:$.altKey},st=this.$toggleFoldWidget(_,tt);if(!st){var lt=$.target||$.srcElement;lt&&/ace_fold-widget/.test(lt.className)&&(lt.className+=" ace_invalid")}},this.$toggleFoldWidget=function(_,$){if(this.getFoldWidget){var tt=this.getFoldWidget(_),st=this.getLine(_),lt=tt==="end"?-1:1,ct=this.getFoldAt(_,lt===-1?0:st.length,lt);if(ct)return $.children||$.all?this.removeFold(ct):this.expandFold(ct),ct;var ht=this.getFoldWidgetRange(_,!0);if(ht&&!ht.isMultiLine()&&(ct=this.getFoldAt(ht.start.row,ht.start.column,1),ct&&ht.isEqual(ct.range)))return this.removeFold(ct),ct;if($.siblings){var ut=this.getParentFoldRangeData(_);if(ut.range)var pt=ut.range.start.row+1,mt=ut.range.end.row;this.foldAll(pt,mt,$.all?1e4:0)}else $.children?(mt=ht?ht.end.row:this.getLength(),this.foldAll(_+1,mt,$.all?1e4:0)):ht&&($.all&&(ht.collapseChildren=1e4),this.addFold("...",ht));return ht}},this.toggleFoldWidget=function(_){var $=this.selection.getCursor().row;$=this.getRowFoldStart($);var tt=this.$toggleFoldWidget($,{});if(!tt){var st=this.getParentFoldRangeData($,!0);if(tt=st.range||st.firstRange,tt){$=tt.start.row;var lt=this.getFoldAt($,this.getLine($).length,1);lt?this.removeFold(lt):this.addFold("...",tt)}}},this.updateFoldWidgets=function(_){var $=_.start.row,tt=_.end.row-$;if(tt===0)this.foldWidgets[$]=null;else if(_.action=="remove")this.foldWidgets.splice($,tt+1,null);else{var st=Array(tt+1);st.unshift($,1),this.foldWidgets.splice.apply(this.foldWidgets,st)}},this.tokenizerUpdateFoldWidgets=function(_){var $=_.data;$.first!=$.last&&this.foldWidgets.length>$.first&&this.foldWidgets.splice($.first,this.foldWidgets.length)}}a.Folding=j}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(o,a,rt){var et=o("../token_iterator").TokenIterator,ot=o("../range").Range;function at(){this.findMatchingBracket=function(nt,it){if(nt.column==0)return null;var j=it||this.getLine(nt.row).charAt(nt.column-1);if(j=="")return null;var _=j.match(/([\(\[\{])|([\)\]\}])/);return _?_[1]?this.$findClosingBracket(_[1],nt):this.$findOpeningBracket(_[2],nt):null},this.getBracketRange=function(nt){var it=this.getLine(nt.row),j=!0,_,$=it.charAt(nt.column-1),tt=$&&$.match(/([\(\[\{])|([\)\]\}])/);if(tt||($=it.charAt(nt.column),nt={row:nt.row,column:nt.column+1},tt=$&&$.match(/([\(\[\{])|([\)\]\}])/),j=!1),!tt)return null;if(tt[1]){var st=this.$findClosingBracket(tt[1],nt);if(!st)return null;_=ot.fromPoints(nt,st),j||(_.end.column++,_.start.column--),_.cursor=_.end}else{var st=this.$findOpeningBracket(tt[2],nt);if(!st)return null;_=ot.fromPoints(st,nt),j||(_.start.column++,_.end.column--),_.cursor=_.start}return _},this.getMatchingBracketRanges=function(nt,it){var j=this.getLine(nt.row),_=/([\(\[\{])|([\)\]\}])/,$=!it&&j.charAt(nt.column-1),tt=$&&$.match(_);if(tt||($=(it===void 0||it)&&j.charAt(nt.column),nt={row:nt.row,column:nt.column+1},tt=$&&$.match(_)),!tt)return null;var st=new ot(nt.row,nt.column-1,nt.row,nt.column),lt=tt[1]?this.$findClosingBracket(tt[1],nt):this.$findOpeningBracket(tt[2],nt);if(!lt)return[st];var ct=new ot(lt.row,lt.column,lt.row,lt.column+1);return[st,ct]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(nt,it,j){var _=this.$brackets[nt],$=1,tt=new et(this,it.row,it.column),st=tt.getCurrentToken();if(st||(st=tt.stepForward()),!!st){j||(j=new RegExp("(\\.?"+st.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)").replace(/-close\b/,"-(close|open)")+")+"));for(var lt=it.column-tt.getCurrentTokenColumn()-2,ct=st.value;;){for(;lt>=0;){var ht=ct.charAt(lt);if(ht==_){if($-=1,$==0)return{row:tt.getCurrentTokenRow(),column:lt+tt.getCurrentTokenColumn()}}else ht==nt&&($+=1);lt-=1}do st=tt.stepBackward();while(st&&!j.test(st.type));if(st==null)break;ct=st.value,lt=ct.length-1}return null}},this.$findClosingBracket=function(nt,it,j){var _=this.$brackets[nt],$=1,tt=new et(this,it.row,it.column),st=tt.getCurrentToken();if(st||(st=tt.stepForward()),!!st){j||(j=new RegExp("(\\.?"+st.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)").replace(/-open\b/,"-(close|open)")+")+"));for(var lt=it.column-tt.getCurrentTokenColumn();;){for(var ct=st.value,ht=ct.length;lt"?_=!0:it.type.indexOf("tag-name")!==-1&&(j=!0));while(it&&!j);return it},this.$findClosingTag=function(nt,it){var j,_=it.value,$=it.value,tt=0,st=new ot(nt.getCurrentTokenRow(),nt.getCurrentTokenColumn(),nt.getCurrentTokenRow(),nt.getCurrentTokenColumn()+1);it=nt.stepForward();var lt=new ot(nt.getCurrentTokenRow(),nt.getCurrentTokenColumn(),nt.getCurrentTokenRow(),nt.getCurrentTokenColumn()+it.value.length),ct=!1;do{if(j=it,j.type.indexOf("tag-close")!==-1&&!ct){var ht=new ot(nt.getCurrentTokenRow(),nt.getCurrentTokenColumn(),nt.getCurrentTokenRow(),nt.getCurrentTokenColumn()+1);ct=!0}if(it=nt.stepForward(),it){if(it.value===">"&&!ct){var ht=new ot(nt.getCurrentTokenRow(),nt.getCurrentTokenColumn(),nt.getCurrentTokenRow(),nt.getCurrentTokenColumn()+1);ct=!0}if(it.type.indexOf("tag-name")!==-1){if(_=it.value,$===_){if(j.value==="<")tt++;else if(j.value==="")var mt=new ot(nt.getCurrentTokenRow(),nt.getCurrentTokenColumn(),nt.getCurrentTokenRow(),nt.getCurrentTokenColumn()+1);else return}}}else if($===_&&it.value==="/>"&&(tt--,tt<0))var ut=new ot(nt.getCurrentTokenRow(),nt.getCurrentTokenColumn(),nt.getCurrentTokenRow(),nt.getCurrentTokenColumn()+2),pt=ut,mt=pt,ht=new ot(lt.end.row,lt.end.column,lt.end.row,lt.end.column+1)}}while(it&&tt>=0);if(st&&ht&&ut&&mt&<&&pt)return{openTag:new ot(st.start.row,st.start.column,ht.end.row,ht.end.column),closeTag:new ot(ut.start.row,ut.start.column,mt.end.row,mt.end.column),openTagName:lt,closeTagName:pt}},this.$findOpeningTag=function(nt,it){var j=nt.getCurrentToken(),_=it.value,$=0,tt=nt.getCurrentTokenRow(),st=nt.getCurrentTokenColumn(),lt=st+2,ct=new ot(tt,st,tt,lt);nt.stepForward();var ht=new ot(nt.getCurrentTokenRow(),nt.getCurrentTokenColumn(),nt.getCurrentTokenRow(),nt.getCurrentTokenColumn()+it.value.length);if(it.type.indexOf("tag-close")===-1&&(it=nt.stepForward()),!(!it||it.value!==">")){var ut=new ot(nt.getCurrentTokenRow(),nt.getCurrentTokenColumn(),nt.getCurrentTokenRow(),nt.getCurrentTokenColumn()+1);nt.stepBackward(),nt.stepBackward();do if(it=j,tt=nt.getCurrentTokenRow(),st=nt.getCurrentTokenColumn(),lt=st+it.value.length,j=nt.stepBackward(),it){if(it.type.indexOf("tag-name")!==-1){if(_===it.value)if(j.value==="<"){if($++,$>0){var pt=new ot(tt,st,tt,lt),mt=new ot(nt.getCurrentTokenRow(),nt.getCurrentTokenColumn(),nt.getCurrentTokenRow(),nt.getCurrentTokenColumn()+1);do it=nt.stepForward();while(it&&it.value!==">");var gt=new ot(nt.getCurrentTokenRow(),nt.getCurrentTokenColumn(),nt.getCurrentTokenRow(),nt.getCurrentTokenColumn()+1)}}else j.value===""){for(var dt=0,St=j;St;){if(St.type.indexOf("tag-name")!==-1&&St.value===_){$--;break}else if(St.value==="<")break;St=nt.stepBackward(),dt++}for(var xt=0;xtTt&&(this.$docRowCache.splice(Tt,kt),this.$screenRowCache.splice(Tt,kt))},Ct.prototype.$getRowCacheIndex=function(Et,kt){for(var Tt=0,$t=Et.length-1;Tt<=$t;){var It=Tt+$t>>1,Ot=Et[It];if(kt>Ot)Tt=It+1;else if(kt=kt));Ot++);return $t=Tt[Ot],$t?($t.index=Ot,$t.start=It-$t.value.length,$t):null},Ct.prototype.setUndoManager=function(Et){if(this.$undoManager=Et,this.$informUndoManager&&this.$informUndoManager.cancel(),Et){var kt=this;Et.addSession(this),this.$syncInformUndoManager=function(){kt.$informUndoManager.cancel(),kt.mergeUndoDeltas=!1},this.$informUndoManager=ot.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},Ct.prototype.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},Ct.prototype.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},Ct.prototype.getTabString=function(){return this.getUseSoftTabs()?ot.stringRepeat(" ",this.getTabSize()):" "},Ct.prototype.setUseSoftTabs=function(Et){this.setOption("useSoftTabs",Et)},Ct.prototype.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},Ct.prototype.setTabSize=function(Et){this.setOption("tabSize",Et)},Ct.prototype.getTabSize=function(){return this.$tabSize},Ct.prototype.isTabStop=function(Et){return this.$useSoftTabs&&Et.column%this.$tabSize===0},Ct.prototype.setNavigateWithinSoftTabs=function(Et){this.setOption("navigateWithinSoftTabs",Et)},Ct.prototype.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},Ct.prototype.setOverwrite=function(Et){this.setOption("overwrite",Et)},Ct.prototype.getOverwrite=function(){return this.$overwrite},Ct.prototype.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},Ct.prototype.addGutterDecoration=function(Et,kt){this.$decorations[Et]||(this.$decorations[Et]=""),this.$decorations[Et]+=" "+kt,this._signal("changeBreakpoint",{})},Ct.prototype.removeGutterDecoration=function(Et,kt){this.$decorations[Et]=(this.$decorations[Et]||"").replace(" "+kt,""),this._signal("changeBreakpoint",{})},Ct.prototype.getBreakpoints=function(){return this.$breakpoints},Ct.prototype.setBreakpoints=function(Et){this.$breakpoints=[];for(var kt=0;kt0&&($t=!!Tt.charAt(kt-1).match(this.tokenRe)),$t||($t=!!Tt.charAt(kt).match(this.tokenRe)),$t)var It=this.tokenRe;else if(/^\s+$/.test(Tt.slice(kt-1,kt+1)))var It=/\s/;else var It=this.nonTokenRe;var Ot=kt;if(Ot>0){do Ot--;while(Ot>=0&&Tt.charAt(Ot).match(It));Ot++}for(var Mt=kt;MtEt&&(Et=kt.screenWidth)}),this.lineWidgetWidth=Et},Ct.prototype.$computeWidth=function(Et){if(this.$modified||Et){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var kt=this.doc.getAllLines(),Tt=this.$rowLengthCache,$t=0,It=0,Ot=this.$foldData[It],Mt=Ot?Ot.start.row:1/0,Dt=kt.length,Bt=0;BtMt){if(Bt=Ot.end.row+1,Bt>=Dt)break;Ot=this.$foldData[It++],Mt=Ot?Ot.start.row:1/0}Tt[Bt]==null&&(Tt[Bt]=this.$getStringScreenWidth(kt[Bt])[0]),Tt[Bt]>$t&&($t=Tt[Bt])}this.screenWidth=$t}},Ct.prototype.getLine=function(Et){return this.doc.getLine(Et)},Ct.prototype.getLines=function(Et,kt){return this.doc.getLines(Et,kt)},Ct.prototype.getLength=function(){return this.doc.getLength()},Ct.prototype.getTextRange=function(Et){return this.doc.getTextRange(Et||this.selection.getRange())},Ct.prototype.insert=function(Et,kt){return this.doc.insert(Et,kt)},Ct.prototype.remove=function(Et){return this.doc.remove(Et)},Ct.prototype.removeFullLines=function(Et,kt){return this.doc.removeFullLines(Et,kt)},Ct.prototype.undoChanges=function(Et,kt){if(Et.length){this.$fromUndo=!0;for(var Tt=Et.length-1;Tt!=-1;Tt--){var $t=Et[Tt];$t.action=="insert"||$t.action=="remove"?this.doc.revertDelta($t):$t.folds&&this.addFolds($t.folds)}!kt&&this.$undoSelect&&(Et.selectionBefore?this.selection.fromJSON(Et.selectionBefore):this.selection.setRange(this.$getUndoSelection(Et,!0))),this.$fromUndo=!1}},Ct.prototype.redoChanges=function(Et,kt){if(Et.length){this.$fromUndo=!0;for(var Tt=0;TtEt.end.column&&(Ot.start.column+=Dt),Ot.end.row==Et.end.row&&Ot.end.column>Et.end.column&&(Ot.end.column+=Dt)),Mt&&Ot.start.row>=Et.end.row&&(Ot.start.row+=Mt,Ot.end.row+=Mt)}if(Ot.end=this.insert(Ot.start,$t),It.length){var Bt=Et.start,Kt=Ot.start,Mt=Kt.row-Bt.row,Dt=Kt.column-Bt.column;this.addFolds(It.map(function(Ht){return Ht=Ht.clone(),Ht.start.row==Bt.row&&(Ht.start.column+=Dt),Ht.end.row==Bt.row&&(Ht.end.column+=Dt),Ht.start.row+=Mt,Ht.end.row+=Mt,Ht}))}return Ot},Ct.prototype.indentRows=function(Et,kt,Tt){Tt=Tt.replace(/\t/g,this.getTabString());for(var $t=Et;$t<=kt;$t++)this.doc.insertInLine({row:$t,column:0},Tt)},Ct.prototype.outdentRows=function(Et){for(var kt=Et.collapseRows(),Tt=new $(0,0,0,0),$t=this.getTabSize(),It=kt.start.row;It<=kt.end.row;++It){var Ot=this.getLine(It);Tt.start.row=It,Tt.end.row=It;for(var Mt=0;Mt<$t&&Ot.charAt(Mt)==" ";++Mt);Mt<$t&&Ot.charAt(Mt)==" "?(Tt.start.column=Mt,Tt.end.column=Mt+1):(Tt.start.column=0,Tt.end.column=Mt),this.remove(Tt)}},Ct.prototype.$moveLines=function(Et,kt,Tt){if(Et=this.getRowFoldStart(Et),kt=this.getRowFoldEnd(kt),Tt<0){var $t=this.getRowFoldStart(Et+Tt);if($t<0)return 0;var It=$t-Et}else if(Tt>0){var $t=this.getRowFoldEnd(kt+Tt);if($t>this.doc.getLength()-1)return 0;var It=$t-kt}else{Et=this.$clipRowToDocument(Et),kt=this.$clipRowToDocument(kt);var It=kt-Et+1}var Ot=new $(Et,0,kt,Number.MAX_VALUE),Mt=this.getFoldsInRange(Ot).map(function(Bt){return Bt=Bt.clone(),Bt.start.row+=It,Bt.end.row+=It,Bt}),Dt=Tt==0?this.doc.getLines(Et,kt):this.doc.removeFullLines(Et,kt);return this.doc.insertFullLines(Et+It,Dt),Mt.length&&this.addFolds(Mt),It},Ct.prototype.moveLinesUp=function(Et,kt){return this.$moveLines(Et,kt,-1)},Ct.prototype.moveLinesDown=function(Et,kt){return this.$moveLines(Et,kt,1)},Ct.prototype.duplicateLines=function(Et,kt){return this.$moveLines(Et,kt,0)},Ct.prototype.$clipRowToDocument=function(Et){return Math.max(0,Math.min(Et,this.doc.getLength()-1))},Ct.prototype.$clipColumnToRow=function(Et,kt){return kt<0?0:Math.min(this.doc.getLine(Et).length,kt)},Ct.prototype.$clipPositionToDocument=function(Et,kt){if(kt=Math.max(0,kt),Et<0)Et=0,kt=0;else{var Tt=this.doc.getLength();Et>=Tt?(Et=Tt-1,kt=this.doc.getLine(Tt-1).length):kt=Math.min(this.doc.getLine(Et).length,kt)}return{row:Et,column:kt}},Ct.prototype.$clipRangeToDocument=function(Et){Et.start.row<0?(Et.start.row=0,Et.start.column=0):Et.start.column=this.$clipColumnToRow(Et.start.row,Et.start.column);var kt=this.doc.getLength()-1;return Et.end.row>kt?(Et.end.row=kt,Et.end.column=this.doc.getLine(kt).length):Et.end.column=this.$clipColumnToRow(Et.end.row,Et.end.column),Et},Ct.prototype.setUseWrapMode=function(Et){if(Et!=this.$useWrapMode){if(this.$useWrapMode=Et,this.$modified=!0,this.$resetRowCache(0),Et){var kt=this.getLength();this.$wrapData=Array(kt),this.$updateWrapData(0,kt-1)}this._signal("changeWrapMode")}},Ct.prototype.getUseWrapMode=function(){return this.$useWrapMode},Ct.prototype.setWrapLimitRange=function(Et,kt){(this.$wrapLimitRange.min!==Et||this.$wrapLimitRange.max!==kt)&&(this.$wrapLimitRange={min:Et,max:kt},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},Ct.prototype.adjustWrapLimit=function(Et,kt){var Tt=this.$wrapLimitRange;Tt.max<0&&(Tt={min:kt,max:kt});var $t=this.$constrainWrapLimit(Et,Tt.min,Tt.max);return $t!=this.$wrapLimit&&$t>1?(this.$wrapLimit=$t,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0):!1},Ct.prototype.$constrainWrapLimit=function(Et,kt,Tt){return kt&&(Et=Math.max(kt,Et)),Tt&&(Et=Math.min(Tt,Et)),Et},Ct.prototype.getWrapLimit=function(){return this.$wrapLimit},Ct.prototype.setWrapLimit=function(Et){this.setWrapLimitRange(Et,Et)},Ct.prototype.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},Ct.prototype.$updateInternalDataOnChange=function(Et){var kt=this.$useWrapMode,Tt=Et.action,$t=Et.start,It=Et.end,Ot=$t.row,Mt=It.row,Dt=Mt-Ot,Bt=null;if(this.$updating=!0,Dt!=0)if(Tt==="remove"){this[kt?"$wrapData":"$rowLengthCache"].splice(Ot,Dt);var Kt=this.$foldData;Bt=this.getFoldsInRange(Et),this.removeFolds(Bt);var Wt=this.getFoldLine(It.row),zt=0;if(Wt){Wt.addRemoveChars(It.row,It.column,$t.column-It.column),Wt.shiftRow(-Dt);var Ht=this.getFoldLine(Ot);Ht&&Ht!==Wt&&(Ht.merge(Wt),Wt=Ht),zt=Kt.indexOf(Wt)+1}for(zt;zt=It.row&&Wt.shiftRow(-Dt)}Mt=Ot}else{var Zt=Array(Dt);Zt.unshift(Ot,0);var qt=kt?this.$wrapData:this.$rowLengthCache;qt.splice.apply(qt,Zt);var Kt=this.$foldData,Wt=this.getFoldLine(Ot),zt=0;if(Wt){var hr=Wt.range.compareInside($t.row,$t.column);hr==0?(Wt=Wt.split($t.row,$t.column),Wt&&(Wt.shiftRow(Dt),Wt.addRemoveChars(Mt,0,It.column-$t.column))):hr==-1&&(Wt.addRemoveChars(Ot,0,It.column-$t.column),Wt.shiftRow(Dt)),zt=Kt.indexOf(Wt)+1}for(zt;zt=Ot&&Wt.shiftRow(Dt)}}else{Dt=Math.abs(Et.start.column-Et.end.column),Tt==="remove"&&(Bt=this.getFoldsInRange(Et),this.removeFolds(Bt),Dt=-Dt);var Wt=this.getFoldLine(Ot);Wt&&Wt.addRemoveChars(Ot,$t.column,Dt)}return kt&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,kt?this.$updateWrapData(Ot,Mt):this.$updateRowLengthCache(Ot,Mt),Bt},Ct.prototype.$updateRowLengthCache=function(Et,kt){this.$rowLengthCache[Et]=null,this.$rowLengthCache[kt]=null},Ct.prototype.$updateWrapData=function(Et,kt){var Tt=this.doc.getAllLines(),$t=this.getTabSize(),It=this.$wrapData,Ot=this.$wrapLimit,Mt,Dt,Bt=Et;for(kt=Math.min(kt,Tt.length-1);Bt<=kt;)Dt=this.getFoldLine(Bt,Dt),Dt?(Mt=[],Dt.walk((function(Kt,Wt,zt,Ht){var Zt;if(Kt!=null){Zt=this.$getDisplayTokens(Kt,Mt.length),Zt[0]=mt;for(var qt=1;qtkt-Ht;){var Zt=Ot+kt-Ht;if(Et[Zt-1]>=St&&Et[Zt]>=St){zt(Zt);continue}if(Et[Zt]==mt||Et[Zt]==gt){for(Zt;Zt!=Ot-1&&Et[Zt]!=mt;Zt--);if(Zt>Ot){zt(Zt);continue}for(Zt=Ot+kt,Zt;Zt>2)),Ot-1);Zt>qt&&Et[Zt]qt&&Et[Zt]qt&&Et[Zt]==dt;)Zt--}else for(;Zt>qt&&Et[Zt]qt){zt(++Zt);continue}Zt=Ot+kt,Et[Zt]==pt&&Zt--,zt(Zt-Ht)}return $t},Ct.prototype.$getDisplayTokens=function(Et,kt){var Tt=[],$t;kt=kt||0;for(var It=0;It39&&Ot<48||Ot>57&&Ot<64?Tt.push(dt):Ot>=4352&&_t(Ot)?Tt.push(ut,pt):Tt.push(ut)}return Tt},Ct.prototype.$getStringScreenWidth=function(Et,kt,Tt){if(kt==0)return[0,0];kt==null&&(kt=1/0),Tt=Tt||0;var $t,It;for(It=0;It=4352&&_t($t)?Tt+=2:Tt+=1,!(Tt>kt));It++);return[Tt,It]},Ct.prototype.getRowLength=function(Et){var kt=1;return this.lineWidgets&&(kt+=this.lineWidgets[Et]&&this.lineWidgets[Et].rowCount||0),!this.$useWrapMode||!this.$wrapData[Et]?kt:this.$wrapData[Et].length+kt},Ct.prototype.getRowLineCount=function(Et){return!this.$useWrapMode||!this.$wrapData[Et]?1:this.$wrapData[Et].length+1},Ct.prototype.getRowWrapIndent=function(Et){if(this.$useWrapMode){var kt=this.screenToDocumentPosition(Et,Number.MAX_VALUE),Tt=this.$wrapData[kt.row];return Tt.length&&Tt[0]=0)var Dt=Kt[Wt],It=this.$docRowCache[Wt],Ht=Et>Kt[zt-1];else var Ht=!zt;for(var Zt=this.getLength()-1,qt=this.getNextFoldLine(It),hr=qt?qt.start.row:1/0;Dt<=Et&&(Bt=this.getRowLength(It),!(Dt+Bt>Et||It>=Zt));)Dt+=Bt,It++,It>hr&&(It=qt.end.row+1,qt=this.getNextFoldLine(It,qt),hr=qt?qt.start.row:1/0),Ht&&(this.$docRowCache.push(It),this.$screenRowCache.push(Dt));if(qt&&qt.start.row<=It)$t=this.getFoldDisplayLine(qt),It=qt.start.row;else{if(Dt+Bt<=Et||It>Zt)return{row:Zt,column:this.getLine(Zt).length};$t=this.getLine(It),qt=null}var fr=0,mr=Math.floor(Et-Dt);if(this.$useWrapMode){var gr=this.$wrapData[It];gr&&(Mt=gr[mr],mr>0&&gr.length&&(fr=gr.indent,Ot=gr[mr-1]||gr[gr.length-1],$t=$t.substring(Ot)))}return Tt!==void 0&&this.$bidiHandler.isBidiRow(Dt+mr,It,mr)&&(kt=this.$bidiHandler.offsetToCol(Tt)),Ot+=this.$getStringScreenWidth($t,kt-fr)[1],this.$useWrapMode&&Ot>=Mt&&(Ot=Mt-1),qt?qt.idxToPosition(Ot):{row:It,column:Ot}},Ct.prototype.documentToScreenPosition=function(Et,kt){if(typeof kt>"u")var Tt=this.$clipPositionToDocument(Et.row,Et.column);else Tt=this.$clipPositionToDocument(Et,kt);Et=Tt.row,kt=Tt.column;var $t=0,It=null,Ot=null;Ot=this.getFoldAt(Et,kt,1),Ot&&(Et=Ot.start.row,kt=Ot.start.column);var Mt,Dt=0,Bt=this.$docRowCache,Kt=this.$getRowCacheIndex(Bt,Et),Wt=Bt.length;if(Wt&&Kt>=0)var Dt=Bt[Kt],$t=this.$screenRowCache[Kt],zt=Et>Bt[Wt-1];else var zt=!Wt;for(var Ht=this.getNextFoldLine(Dt),Zt=Ht?Ht.start.row:1/0;Dt=Zt){if(Mt=Ht.end.row+1,Mt>Et)break;Ht=this.getNextFoldLine(Mt,Ht),Zt=Ht?Ht.start.row:1/0}else Mt=Dt+1;$t+=this.getRowLength(Dt),Dt=Mt,zt&&(this.$docRowCache.push(Dt),this.$screenRowCache.push($t))}var qt="";Ht&&Dt>=Zt?(qt=this.getFoldDisplayLine(Ht,Et,kt),It=Ht.start.row):(qt=this.getLine(Et).substring(0,kt),It=Et);var hr=0;if(this.$useWrapMode){var fr=this.$wrapData[It];if(fr){for(var mr=0;qt.length>=fr[mr];)$t++,mr++;qt=qt.substring(fr[mr-1]||0,qt.length),hr=mr>0?fr.indent:0}}return this.lineWidgets&&this.lineWidgets[Dt]&&this.lineWidgets[Dt].rowsAbove&&($t+=this.lineWidgets[Dt].rowsAbove),{row:$t,column:hr+this.$getStringScreenWidth(qt)[0]}},Ct.prototype.documentToScreenColumn=function(Et,kt){return this.documentToScreenPosition(Et,kt).column},Ct.prototype.documentToScreenRow=function(Et,kt){return this.documentToScreenPosition(Et,kt).row},Ct.prototype.getScreenLength=function(){var Et=0,kt=null;if(this.$useWrapMode)for(var It=this.$wrapData.length,Ot=0,$t=0,kt=this.$foldData[$t++],Mt=kt?kt.start.row:1/0;OtMt&&(Ot=kt.end.row+1,kt=this.$foldData[$t++],Mt=kt?kt.start.row:1/0)}else{Et=this.getLength();for(var Tt=this.$foldData,$t=0;$tTt));Ot++);return[$t,Ot]})},Ct.prototype.getPrecedingCharacter=function(){var Et=this.selection.getCursor();if(Et.column===0)return Et.row===0?"":this.doc.getNewLineCharacter();var kt=this.getLine(Et.row);return kt[Et.column-1]},Ct.prototype.destroy=function(){this.destroyed||(this.bgTokenizer.setDocument(null),this.bgTokenizer.cleanup(),this.destroyed=!0),this.$stopWorker(),this.removeAllListeners(),this.doc&&this.doc.off("change",this.$onChange),this.selection.detach()},Ct}();ht.$uid=0,ht.prototype.$modes=nt.$modes,ht.prototype.getValue=ht.prototype.toString,ht.prototype.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},ht.prototype.$overwrite=!1,ht.prototype.$mode=null,ht.prototype.$modeId=null,ht.prototype.$scrollTop=0,ht.prototype.$scrollLeft=0,ht.prototype.$wrapLimit=80,ht.prototype.$useWrapMode=!1,ht.prototype.$wrapLimitRange={min:null,max:null},ht.prototype.lineWidgets=null,ht.prototype.isFullWidth=_t,et.implement(ht.prototype,it);var ut=1,pt=2,mt=3,gt=4,dt=9,St=10,xt=11,yt=12;function _t(Ct){return Ct<4352?!1:Ct>=4352&&Ct<=4447||Ct>=4515&&Ct<=4519||Ct>=4602&&Ct<=4607||Ct>=9001&&Ct<=9002||Ct>=11904&&Ct<=11929||Ct>=11931&&Ct<=12019||Ct>=12032&&Ct<=12245||Ct>=12272&&Ct<=12283||Ct>=12288&&Ct<=12350||Ct>=12353&&Ct<=12438||Ct>=12441&&Ct<=12543||Ct>=12549&&Ct<=12589||Ct>=12593&&Ct<=12686||Ct>=12688&&Ct<=12730||Ct>=12736&&Ct<=12771||Ct>=12784&&Ct<=12830||Ct>=12832&&Ct<=12871||Ct>=12880&&Ct<=13054||Ct>=13056&&Ct<=19903||Ct>=19968&&Ct<=42124||Ct>=42128&&Ct<=42182||Ct>=43360&&Ct<=43388||Ct>=44032&&Ct<=55203||Ct>=55216&&Ct<=55238||Ct>=55243&&Ct<=55291||Ct>=63744&&Ct<=64255||Ct>=65040&&Ct<=65049||Ct>=65072&&Ct<=65106||Ct>=65108&&Ct<=65126||Ct>=65128&&Ct<=65131||Ct>=65281&&Ct<=65376||Ct>=65504&&Ct<=65510}o("./edit_session/folding").Folding.call(ht.prototype),o("./edit_session/bracket_match").BracketMatch.call(ht.prototype),nt.defineOptions(ht.prototype,"session",{wrap:{set:function(Ct){if(!Ct||Ct=="off"?Ct=!1:Ct=="free"?Ct=!0:Ct=="printMargin"?Ct=-1:typeof Ct=="string"&&(Ct=parseInt(Ct,10)||!1),this.$wrap!=Ct)if(this.$wrap=Ct,!Ct)this.setUseWrapMode(!1);else{var Et=typeof Ct=="number"?Ct:null;this.setWrapLimitRange(Et,Et),this.setUseWrapMode(!0)}},get:function(){return this.getUseWrapMode()?this.$wrap==-1?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(Ct){Ct=Ct=="auto"?this.$mode.type!="text":Ct!="text",Ct!=this.$wrapAsCode&&(this.$wrapAsCode=Ct,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(Ct){this.$useWorker=Ct,this.$stopWorker(),Ct&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(Ct){Ct=parseInt(Ct),Ct>0&&this.$tabSize!==Ct&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=Ct,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(Ct){this.setFoldStyle(Ct)},handlesSet:!0},overwrite:{set:function(Ct){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(Ct){this.doc.setNewLineMode(Ct)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(Ct){this.setMode(Ct)},get:function(){return this.$modeId},handlesSet:!0}}),a.EditSession=ht}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(o,a,rt){var et=o("./lib/lang"),ot=o("./lib/oop"),at=o("./range").Range,nt=function(){function j(){this.$options={}}return j.prototype.set=function(_){return ot.mixin(this.$options,_),this},j.prototype.getOptions=function(){return et.copyObject(this.$options)},j.prototype.setOptions=function(_){this.$options=_},j.prototype.find=function(_){var $=this.$options,tt=this.$matchIterator(_,$);if(!tt)return!1;var st=null;return tt.forEach(function(lt,ct,ht,ut){return st=new at(lt,ct,ht,ut),ct==ut&&$.start&&$.start.start&&$.skipCurrent!=!1&&st.isEqual($.start)?(st=null,!1):!0}),st},j.prototype.findAll=function(_){var $=this.$options;if(!$.needle)return[];this.$assembleRegExp($);var tt=$.range,st=tt?_.getLines(tt.start.row,tt.end.row):_.doc.getAllLines(),lt=[],ct=$.re;if($.$isMultiLine){var ht=ct.length,ut=st.length-ht,pt;e:for(var mt=ct.offset||0;mt<=ut;mt++){for(var gt=0;gtxt||(lt.push(pt=new at(mt,xt,mt+ht-1,yt)),ht>2&&(mt=mt+ht-2))}}else for(var _t=0;_tTt&<[gt].end.row==$t;)gt--;for(lt=lt.slice(_t,gt+1),_t=0,gt=lt.length;_t"+gt.end.row+":"+gt.end.column}function et(gt,dt){var St=gt.action=="insert",xt=dt.action=="insert";if(St&&xt)if(nt(dt.start,gt.end)>=0)ct(dt,gt,-1);else if(nt(dt.start,gt.start)<=0)ct(gt,dt,1);else return null;else if(St&&!xt)if(nt(dt.start,gt.end)>=0)ct(dt,gt,-1);else if(nt(dt.end,gt.start)<=0)ct(gt,dt,-1);else return null;else if(!St&&xt)if(nt(dt.start,gt.start)>=0)ct(dt,gt,1);else if(nt(dt.start,gt.start)<=0)ct(gt,dt,1);else return null;else if(!St&&!xt)if(nt(dt.start,gt.start)>=0)ct(dt,gt,1);else if(nt(dt.end,gt.start)<=0)ct(gt,dt,-1);else return null;return[dt,gt]}function st(gt,dt){for(var St=gt.length;St--;)for(var xt=0;xt=0?ct(gt,dt,-1):(nt(gt.start,dt.start)<=0||ct(gt,at.fromPoints(dt.start,gt.start),-1),ct(dt,gt,1));else if(!St&&xt)nt(dt.start,gt.end)>=0?ct(dt,gt,-1):(nt(dt.start,gt.start)<=0||ct(dt,at.fromPoints(gt.start,dt.start),-1),ct(gt,dt,1));else if(!St&&!xt)if(nt(dt.start,gt.end)>=0)ct(dt,gt,-1);else if(nt(dt.end,gt.start)<=0)ct(gt,dt,-1);else{var yt,_t;return nt(gt.start,dt.start)<0&&(yt=gt,gt=ut(gt,dt.start)),nt(gt.end,dt.end)>0&&(_t=ut(gt,dt.end)),ht(dt.end,gt.start,gt.end,-1),_t&&!yt&&(gt.lines=_t.lines,gt.start=_t.start,gt.end=_t.end,_t=gt),[dt,yt,_t].filter(Boolean)}return[dt,gt]}function ct(gt,dt,St){ht(gt.start,dt.start,dt.end,St),ht(gt.end,dt.start,dt.end,St)}function ht(gt,dt,St,xt){gt.row==(xt==1?dt:St).row&&(gt.column+=xt*(St.column-dt.column)),gt.row+=xt*(St.row-dt.row)}function ut(gt,dt){var St=gt.lines,xt=gt.end;gt.end=it(dt);var yt=gt.end.row-gt.start.row,_t=St.splice(yt,St.length),Ct=yt?dt.column:dt.column-gt.start.column;St.push(_t[0].substring(0,Ct)),_t[0]=_t[0].substr(Ct);var Et={start:it(dt),end:xt,lines:_t,action:gt.action};return Et}function pt(gt,dt){dt=j(dt);for(var St=gt.length;St--;){for(var xt=gt[St],yt=0;ytthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(nt),this.folds.sort(function(it,j){return-it.range.compareEnd(j.start.row,j.start.column)}),this.range.compareEnd(nt.start.row,nt.start.column)>0?(this.end.row=nt.end.row,this.end.column=nt.end.column):this.range.compareStart(nt.end.row,nt.end.column)<0&&(this.start.row=nt.start.row,this.start.column=nt.start.column)}else if(nt.start.row==this.end.row)this.folds.push(nt),this.end.row=nt.end.row,this.end.column=nt.end.column;else if(nt.end.row==this.start.row)this.folds.unshift(nt),this.start.row=nt.start.row,this.start.column=nt.start.column;else throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");nt.foldLine=this},at.prototype.containsRow=function(nt){return nt>=this.start.row&&nt<=this.end.row},at.prototype.walk=function(nt,it,j){var _=0,$=this.folds,et,st,lt,ct=!0;it==null&&(it=this.end.row,j=this.end.column);for(var ht=0;ht<$.length;ht++){if(et=$[ht],st=et.range.compareStart(it,j),st==-1){nt(null,it,j,_,ct);return}if(lt=nt(null,et.start.row,et.start.column,_,ct),lt=!lt&&nt(et.placeholder,et.start.row,et.start.column,_),lt||st===0)return;ct=!et.sameRow,_=et.end.column}nt(null,it,j,_,ct)},at.prototype.getNextFoldTo=function(nt,it){for(var j,_,$=0;$0)){var ct=ot(it,st.start);return lt===0?j&&ct!==0?-et-2:et:ct>0||ct===0&&!j?et:-et-1}}return-et-1},nt.prototype.add=function(it){var j=!it.isEmpty(),_=this.pointIndex(it.start,j);_<0&&(_=-_-1);var $=this.pointIndex(it.end,j,_);return $<0?$=-$-1:$++,this.ranges.splice(_,$-_,it)},nt.prototype.addList=function(it){for(var j=[],_=it.length;_--;)j.push.apply(j,this.add(it[_]));return j},nt.prototype.substractPoint=function(it){var j=this.pointIndex(it);if(j>=0)return this.ranges.splice(j,1)},nt.prototype.merge=function(){var it=[],j=this.ranges;j=j.sort(function(lt,ct){return ot(lt.start,ct.start)});for(var _=j[0],$,et=1;et=0},nt.prototype.containsPoint=function(it){return this.pointIndex(it)>=0},nt.prototype.rangeAtPoint=function(it){var j=this.pointIndex(it);if(j>=0)return this.ranges[j]},nt.prototype.clipRows=function(it,j){var _=this.ranges;if(_[0].start.row>j||_[_.length-1].start.row=$)break}if(it.action=="insert")for(var ut=et-$,pt=-j.column+_.column;lt$)break;if(ht.start.row==$&&ht.start.column>=j.column&&(ht.start.column==j.column&&this.$bias<=0||(ht.start.column+=pt,ht.start.row+=ut)),ht.end.row==$&&ht.end.column>=j.column){if(ht.end.column==j.column&&this.$bias<0)continue;ht.end.column==j.column&&pt>0&<ht.start.column&&ht.end.column==st[lt+1].start.column&&(ht.end.column-=pt),ht.end.column+=pt,ht.end.row+=ut}}else for(var ut=$-et,pt=j.column-_.column;ltet)break;ht.end.rowj.column)&&(ht.end.column=j.column,ht.end.row=j.row):(ht.end.column+=pt,ht.end.row+=ut):ht.end.row>et&&(ht.end.row+=ut),ht.start.rowj.column)&&(ht.start.column=j.column,ht.start.row=j.row):(ht.start.column+=pt,ht.start.row+=ut):ht.start.row>et&&(ht.start.row+=ut)}if(ut!=0&<=_)return lt;if(lt.end.row>_)return null}return null},this.getNextFoldLine=function(_,$){var et=this.$foldData,st=0;for($&&(st=et.indexOf($)),st==-1&&(st=0),st;st=_)return lt}return null},this.getFoldedRowCount=function(_,$){for(var et=this.$foldData,st=$-_+1,lt=0;lt=$){ut<$&&(ut>=_?st-=$-ut:st=0);break}else ht>=_&&(ut>=_?st-=ht-ut:st-=ht-_+1)}return st},this.$addFoldLine=function(_){return this.$foldData.push(_),this.$foldData.sort(function($,et){return $.start.row-et.start.row}),_},this.addFold=function(_,$){var et=this.$foldData,st=!1,lt;_ instanceof at?lt=_:(lt=new at($,_),lt.collapseChildren=$.collapseChildren),this.$clipRangeToDocument(lt.range);var ct=lt.start.row,ht=lt.start.column,ut=lt.end.row,pt=lt.end.column,mt=this.getFoldAt(ct,ht,1),gt=this.getFoldAt(ut,pt,-1);if(mt&>==mt)return mt.addSubFold(lt);mt&&!mt.range.isStart(ct,ht)&&this.removeFold(mt),gt&&!gt.range.isEnd(ut,pt)&&this.removeFold(gt);var dt=this.getFoldsInRange(lt.range);dt.length>0&&(this.removeFolds(dt),lt.collapseChildren||dt.forEach(function(_t){lt.addSubFold(_t)}));for(var St=0;St0&&this.foldAll(_.start.row+1,_.end.row,_.collapseChildren-1),_.subFolds=[]},this.expandFolds=function(_){_.forEach(function($){this.expandFold($)},this)},this.unfold=function(_,$){var et,st;if(_==null)et=new tt(0,0,this.getLength(),0),$==null&&($=!0);else if(typeof _=="number")et=new tt(_,0,_,this.getLine(_).length);else if("row"in _)et=tt.fromPoints(_,_);else{if(Array.isArray(_))return st=[],_.forEach(function(ct){st=st.concat(this.unfold(ct))},this),st;et=_}st=this.getFoldsInRangeList(et);for(var lt=st;st.length==1&&tt.comparePoints(st[0].start,et.start)<0&&tt.comparePoints(st[0].end,et.end)>0;)this.expandFolds(st),st=this.getFoldsInRangeList(et);if($!=!1?this.removeFolds(st):this.expandFolds(st),lt.length)return lt},this.isRowFolded=function(_,$){return!!this.getFoldLine(_,$)},this.getRowFoldEnd=function(_,$){var et=this.getFoldLine(_,$);return et?et.end.row:_},this.getRowFoldStart=function(_,$){var et=this.getFoldLine(_,$);return et?et.start.row:_},this.getFoldDisplayLine=function(_,$,et,st,lt){st==null&&(st=_.start.row),lt==null&&(lt=0),$==null&&($=_.end.row),et==null&&(et=this.getLine($).length);var ct=this.doc,ht="";return _.walk(function(ut,pt,mt,gt){if(!(ptmt)break;while(lt&&ht.test(lt.type));lt=st.stepBackward()}else lt=st.getCurrentToken();return ut.end.row=st.getCurrentTokenRow(),ut.end.column=st.getCurrentTokenColumn(),ut}},this.foldAll=function(_,$,et,st){et==null&&(et=1e5);var lt=this.foldWidgets;if(lt){$=$||this.getLength(),_=_||0;for(var ct=_;ct<$;ct++)if(lt[ct]==null&&(lt[ct]=this.getFoldWidget(ct)),lt[ct]=="start"&&!(st&&!st(ct))){var ht=this.getFoldWidgetRange(ct);ht&&ht.isMultiLine()&&ht.end.row<=$&&ht.start.row>=_&&(ct=ht.end.row,ht.collapseChildren=et,this.addFold("...",ht))}}},this.foldToLevel=function(_){for(this.foldAll();_-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var _=this;this.foldAll(null,null,null,function($){for(var et=_.getTokens($),st=0;st=0;){var ct=et[st];if(ct==null&&(ct=et[st]=this.getFoldWidget(st)),ct=="start"){var ht=this.getFoldWidgetRange(st);if(lt||(lt=ht),ht&&ht.end.row>=_)break}st--}return{range:st!==-1&&ht,firstRange:lt}},this.onFoldWidgetClick=function(_,$){$ instanceof it&&($=$.domEvent);var et={children:$.shiftKey,all:$.ctrlKey||$.metaKey,siblings:$.altKey},st=this.$toggleFoldWidget(_,et);if(!st){var lt=$.target||$.srcElement;lt&&/ace_fold-widget/.test(lt.className)&&(lt.className+=" ace_invalid")}},this.$toggleFoldWidget=function(_,$){if(this.getFoldWidget){var et=this.getFoldWidget(_),st=this.getLine(_),lt=et==="end"?-1:1,ct=this.getFoldAt(_,lt===-1?0:st.length,lt);if(ct)return $.children||$.all?this.removeFold(ct):this.expandFold(ct),ct;var ht=this.getFoldWidgetRange(_,!0);if(ht&&!ht.isMultiLine()&&(ct=this.getFoldAt(ht.start.row,ht.start.column,1),ct&&ht.isEqual(ct.range)))return this.removeFold(ct),ct;if($.siblings){var ut=this.getParentFoldRangeData(_);if(ut.range)var pt=ut.range.start.row+1,mt=ut.range.end.row;this.foldAll(pt,mt,$.all?1e4:0)}else $.children?(mt=ht?ht.end.row:this.getLength(),this.foldAll(_+1,mt,$.all?1e4:0)):ht&&($.all&&(ht.collapseChildren=1e4),this.addFold("...",ht));return ht}},this.toggleFoldWidget=function(_){var $=this.selection.getCursor().row;$=this.getRowFoldStart($);var et=this.$toggleFoldWidget($,{});if(!et){var st=this.getParentFoldRangeData($,!0);if(et=st.range||st.firstRange,et){$=et.start.row;var lt=this.getFoldAt($,this.getLine($).length,1);lt?this.removeFold(lt):this.addFold("...",et)}}},this.updateFoldWidgets=function(_){var $=_.start.row,et=_.end.row-$;if(et===0)this.foldWidgets[$]=null;else if(_.action=="remove")this.foldWidgets.splice($,et+1,null);else{var st=Array(et+1);st.unshift($,1),this.foldWidgets.splice.apply(this.foldWidgets,st)}},this.tokenizerUpdateFoldWidgets=function(_){var $=_.data;$.first!=$.last&&this.foldWidgets.length>$.first&&this.foldWidgets.splice($.first,this.foldWidgets.length)}}a.Folding=j}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(o,a,rt){var tt=o("../token_iterator").TokenIterator,ot=o("../range").Range;function at(){this.findMatchingBracket=function(nt,it){if(nt.column==0)return null;var j=it||this.getLine(nt.row).charAt(nt.column-1);if(j=="")return null;var _=j.match(/([\(\[\{])|([\)\]\}])/);return _?_[1]?this.$findClosingBracket(_[1],nt):this.$findOpeningBracket(_[2],nt):null},this.getBracketRange=function(nt){var it=this.getLine(nt.row),j=!0,_,$=it.charAt(nt.column-1),et=$&&$.match(/([\(\[\{])|([\)\]\}])/);if(et||($=it.charAt(nt.column),nt={row:nt.row,column:nt.column+1},et=$&&$.match(/([\(\[\{])|([\)\]\}])/),j=!1),!et)return null;if(et[1]){var st=this.$findClosingBracket(et[1],nt);if(!st)return null;_=ot.fromPoints(nt,st),j||(_.end.column++,_.start.column--),_.cursor=_.end}else{var st=this.$findOpeningBracket(et[2],nt);if(!st)return null;_=ot.fromPoints(st,nt),j||(_.start.column++,_.end.column--),_.cursor=_.start}return _},this.getMatchingBracketRanges=function(nt,it){var j=this.getLine(nt.row),_=/([\(\[\{])|([\)\]\}])/,$=!it&&j.charAt(nt.column-1),et=$&&$.match(_);if(et||($=(it===void 0||it)&&j.charAt(nt.column),nt={row:nt.row,column:nt.column+1},et=$&&$.match(_)),!et)return null;var st=new ot(nt.row,nt.column-1,nt.row,nt.column),lt=et[1]?this.$findClosingBracket(et[1],nt):this.$findOpeningBracket(et[2],nt);if(!lt)return[st];var ct=new ot(lt.row,lt.column,lt.row,lt.column+1);return[st,ct]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(nt,it,j){var _=this.$brackets[nt],$=1,et=new tt(this,it.row,it.column),st=et.getCurrentToken();if(st||(st=et.stepForward()),!!st){j||(j=new RegExp("(\\.?"+st.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)").replace(/-close\b/,"-(close|open)")+")+"));for(var lt=it.column-et.getCurrentTokenColumn()-2,ct=st.value;;){for(;lt>=0;){var ht=ct.charAt(lt);if(ht==_){if($-=1,$==0)return{row:et.getCurrentTokenRow(),column:lt+et.getCurrentTokenColumn()}}else ht==nt&&($+=1);lt-=1}do st=et.stepBackward();while(st&&!j.test(st.type));if(st==null)break;ct=st.value,lt=ct.length-1}return null}},this.$findClosingBracket=function(nt,it,j){var _=this.$brackets[nt],$=1,et=new tt(this,it.row,it.column),st=et.getCurrentToken();if(st||(st=et.stepForward()),!!st){j||(j=new RegExp("(\\.?"+st.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)").replace(/-open\b/,"-(close|open)")+")+"));for(var lt=it.column-et.getCurrentTokenColumn();;){for(var ct=st.value,ht=ct.length;lt"?_=!0:it.type.indexOf("tag-name")!==-1&&(j=!0));while(it&&!j);return it},this.$findClosingTag=function(nt,it){var j,_=it.value,$=it.value,et=0,st=new ot(nt.getCurrentTokenRow(),nt.getCurrentTokenColumn(),nt.getCurrentTokenRow(),nt.getCurrentTokenColumn()+1);it=nt.stepForward();var lt=new ot(nt.getCurrentTokenRow(),nt.getCurrentTokenColumn(),nt.getCurrentTokenRow(),nt.getCurrentTokenColumn()+it.value.length),ct=!1;do{if(j=it,j.type.indexOf("tag-close")!==-1&&!ct){var ht=new ot(nt.getCurrentTokenRow(),nt.getCurrentTokenColumn(),nt.getCurrentTokenRow(),nt.getCurrentTokenColumn()+1);ct=!0}if(it=nt.stepForward(),it){if(it.value===">"&&!ct){var ht=new ot(nt.getCurrentTokenRow(),nt.getCurrentTokenColumn(),nt.getCurrentTokenRow(),nt.getCurrentTokenColumn()+1);ct=!0}if(it.type.indexOf("tag-name")!==-1){if(_=it.value,$===_){if(j.value==="<")et++;else if(j.value==="")var mt=new ot(nt.getCurrentTokenRow(),nt.getCurrentTokenColumn(),nt.getCurrentTokenRow(),nt.getCurrentTokenColumn()+1);else return}}}else if($===_&&it.value==="/>"&&(et--,et<0))var ut=new ot(nt.getCurrentTokenRow(),nt.getCurrentTokenColumn(),nt.getCurrentTokenRow(),nt.getCurrentTokenColumn()+2),pt=ut,mt=pt,ht=new ot(lt.end.row,lt.end.column,lt.end.row,lt.end.column+1)}}while(it&&et>=0);if(st&&ht&&ut&&mt&<&&pt)return{openTag:new ot(st.start.row,st.start.column,ht.end.row,ht.end.column),closeTag:new ot(ut.start.row,ut.start.column,mt.end.row,mt.end.column),openTagName:lt,closeTagName:pt}},this.$findOpeningTag=function(nt,it){var j=nt.getCurrentToken(),_=it.value,$=0,et=nt.getCurrentTokenRow(),st=nt.getCurrentTokenColumn(),lt=st+2,ct=new ot(et,st,et,lt);nt.stepForward();var ht=new ot(nt.getCurrentTokenRow(),nt.getCurrentTokenColumn(),nt.getCurrentTokenRow(),nt.getCurrentTokenColumn()+it.value.length);if(it.type.indexOf("tag-close")===-1&&(it=nt.stepForward()),!(!it||it.value!==">")){var ut=new ot(nt.getCurrentTokenRow(),nt.getCurrentTokenColumn(),nt.getCurrentTokenRow(),nt.getCurrentTokenColumn()+1);nt.stepBackward(),nt.stepBackward();do if(it=j,et=nt.getCurrentTokenRow(),st=nt.getCurrentTokenColumn(),lt=st+it.value.length,j=nt.stepBackward(),it){if(it.type.indexOf("tag-name")!==-1){if(_===it.value)if(j.value==="<"){if($++,$>0){var pt=new ot(et,st,et,lt),mt=new ot(nt.getCurrentTokenRow(),nt.getCurrentTokenColumn(),nt.getCurrentTokenRow(),nt.getCurrentTokenColumn()+1);do it=nt.stepForward();while(it&&it.value!==">");var gt=new ot(nt.getCurrentTokenRow(),nt.getCurrentTokenColumn(),nt.getCurrentTokenRow(),nt.getCurrentTokenColumn()+1)}}else j.value===""){for(var dt=0,St=j;St;){if(St.type.indexOf("tag-name")!==-1&&St.value===_){$--;break}else if(St.value==="<")break;St=nt.stepBackward(),dt++}for(var xt=0;xtTt&&(this.$docRowCache.splice(Tt,kt),this.$screenRowCache.splice(Tt,kt))},Ct.prototype.$getRowCacheIndex=function(Et,kt){for(var Tt=0,$t=Et.length-1;Tt<=$t;){var It=Tt+$t>>1,Ot=Et[It];if(kt>Ot)Tt=It+1;else if(kt=kt));Ot++);return $t=Tt[Ot],$t?($t.index=Ot,$t.start=It-$t.value.length,$t):null},Ct.prototype.setUndoManager=function(Et){if(this.$undoManager=Et,this.$informUndoManager&&this.$informUndoManager.cancel(),Et){var kt=this;Et.addSession(this),this.$syncInformUndoManager=function(){kt.$informUndoManager.cancel(),kt.mergeUndoDeltas=!1},this.$informUndoManager=ot.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},Ct.prototype.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},Ct.prototype.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},Ct.prototype.getTabString=function(){return this.getUseSoftTabs()?ot.stringRepeat(" ",this.getTabSize()):" "},Ct.prototype.setUseSoftTabs=function(Et){this.setOption("useSoftTabs",Et)},Ct.prototype.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},Ct.prototype.setTabSize=function(Et){this.setOption("tabSize",Et)},Ct.prototype.getTabSize=function(){return this.$tabSize},Ct.prototype.isTabStop=function(Et){return this.$useSoftTabs&&Et.column%this.$tabSize===0},Ct.prototype.setNavigateWithinSoftTabs=function(Et){this.setOption("navigateWithinSoftTabs",Et)},Ct.prototype.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},Ct.prototype.setOverwrite=function(Et){this.setOption("overwrite",Et)},Ct.prototype.getOverwrite=function(){return this.$overwrite},Ct.prototype.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},Ct.prototype.addGutterDecoration=function(Et,kt){this.$decorations[Et]||(this.$decorations[Et]=""),this.$decorations[Et]+=" "+kt,this._signal("changeBreakpoint",{})},Ct.prototype.removeGutterDecoration=function(Et,kt){this.$decorations[Et]=(this.$decorations[Et]||"").replace(" "+kt,""),this._signal("changeBreakpoint",{})},Ct.prototype.getBreakpoints=function(){return this.$breakpoints},Ct.prototype.setBreakpoints=function(Et){this.$breakpoints=[];for(var kt=0;kt0&&($t=!!Tt.charAt(kt-1).match(this.tokenRe)),$t||($t=!!Tt.charAt(kt).match(this.tokenRe)),$t)var It=this.tokenRe;else if(/^\s+$/.test(Tt.slice(kt-1,kt+1)))var It=/\s/;else var It=this.nonTokenRe;var Ot=kt;if(Ot>0){do Ot--;while(Ot>=0&&Tt.charAt(Ot).match(It));Ot++}for(var Mt=kt;MtEt&&(Et=kt.screenWidth)}),this.lineWidgetWidth=Et},Ct.prototype.$computeWidth=function(Et){if(this.$modified||Et){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var kt=this.doc.getAllLines(),Tt=this.$rowLengthCache,$t=0,It=0,Ot=this.$foldData[It],Mt=Ot?Ot.start.row:1/0,Dt=kt.length,Bt=0;BtMt){if(Bt=Ot.end.row+1,Bt>=Dt)break;Ot=this.$foldData[It++],Mt=Ot?Ot.start.row:1/0}Tt[Bt]==null&&(Tt[Bt]=this.$getStringScreenWidth(kt[Bt])[0]),Tt[Bt]>$t&&($t=Tt[Bt])}this.screenWidth=$t}},Ct.prototype.getLine=function(Et){return this.doc.getLine(Et)},Ct.prototype.getLines=function(Et,kt){return this.doc.getLines(Et,kt)},Ct.prototype.getLength=function(){return this.doc.getLength()},Ct.prototype.getTextRange=function(Et){return this.doc.getTextRange(Et||this.selection.getRange())},Ct.prototype.insert=function(Et,kt){return this.doc.insert(Et,kt)},Ct.prototype.remove=function(Et){return this.doc.remove(Et)},Ct.prototype.removeFullLines=function(Et,kt){return this.doc.removeFullLines(Et,kt)},Ct.prototype.undoChanges=function(Et,kt){if(Et.length){this.$fromUndo=!0;for(var Tt=Et.length-1;Tt!=-1;Tt--){var $t=Et[Tt];$t.action=="insert"||$t.action=="remove"?this.doc.revertDelta($t):$t.folds&&this.addFolds($t.folds)}!kt&&this.$undoSelect&&(Et.selectionBefore?this.selection.fromJSON(Et.selectionBefore):this.selection.setRange(this.$getUndoSelection(Et,!0))),this.$fromUndo=!1}},Ct.prototype.redoChanges=function(Et,kt){if(Et.length){this.$fromUndo=!0;for(var Tt=0;TtEt.end.column&&(Ot.start.column+=Dt),Ot.end.row==Et.end.row&&Ot.end.column>Et.end.column&&(Ot.end.column+=Dt)),Mt&&Ot.start.row>=Et.end.row&&(Ot.start.row+=Mt,Ot.end.row+=Mt)}if(Ot.end=this.insert(Ot.start,$t),It.length){var Bt=Et.start,Kt=Ot.start,Mt=Kt.row-Bt.row,Dt=Kt.column-Bt.column;this.addFolds(It.map(function(Ht){return Ht=Ht.clone(),Ht.start.row==Bt.row&&(Ht.start.column+=Dt),Ht.end.row==Bt.row&&(Ht.end.column+=Dt),Ht.start.row+=Mt,Ht.end.row+=Mt,Ht}))}return Ot},Ct.prototype.indentRows=function(Et,kt,Tt){Tt=Tt.replace(/\t/g,this.getTabString());for(var $t=Et;$t<=kt;$t++)this.doc.insertInLine({row:$t,column:0},Tt)},Ct.prototype.outdentRows=function(Et){for(var kt=Et.collapseRows(),Tt=new $(0,0,0,0),$t=this.getTabSize(),It=kt.start.row;It<=kt.end.row;++It){var Ot=this.getLine(It);Tt.start.row=It,Tt.end.row=It;for(var Mt=0;Mt<$t&&Ot.charAt(Mt)==" ";++Mt);Mt<$t&&Ot.charAt(Mt)==" "?(Tt.start.column=Mt,Tt.end.column=Mt+1):(Tt.start.column=0,Tt.end.column=Mt),this.remove(Tt)}},Ct.prototype.$moveLines=function(Et,kt,Tt){if(Et=this.getRowFoldStart(Et),kt=this.getRowFoldEnd(kt),Tt<0){var $t=this.getRowFoldStart(Et+Tt);if($t<0)return 0;var It=$t-Et}else if(Tt>0){var $t=this.getRowFoldEnd(kt+Tt);if($t>this.doc.getLength()-1)return 0;var It=$t-kt}else{Et=this.$clipRowToDocument(Et),kt=this.$clipRowToDocument(kt);var It=kt-Et+1}var Ot=new $(Et,0,kt,Number.MAX_VALUE),Mt=this.getFoldsInRange(Ot).map(function(Bt){return Bt=Bt.clone(),Bt.start.row+=It,Bt.end.row+=It,Bt}),Dt=Tt==0?this.doc.getLines(Et,kt):this.doc.removeFullLines(Et,kt);return this.doc.insertFullLines(Et+It,Dt),Mt.length&&this.addFolds(Mt),It},Ct.prototype.moveLinesUp=function(Et,kt){return this.$moveLines(Et,kt,-1)},Ct.prototype.moveLinesDown=function(Et,kt){return this.$moveLines(Et,kt,1)},Ct.prototype.duplicateLines=function(Et,kt){return this.$moveLines(Et,kt,0)},Ct.prototype.$clipRowToDocument=function(Et){return Math.max(0,Math.min(Et,this.doc.getLength()-1))},Ct.prototype.$clipColumnToRow=function(Et,kt){return kt<0?0:Math.min(this.doc.getLine(Et).length,kt)},Ct.prototype.$clipPositionToDocument=function(Et,kt){if(kt=Math.max(0,kt),Et<0)Et=0,kt=0;else{var Tt=this.doc.getLength();Et>=Tt?(Et=Tt-1,kt=this.doc.getLine(Tt-1).length):kt=Math.min(this.doc.getLine(Et).length,kt)}return{row:Et,column:kt}},Ct.prototype.$clipRangeToDocument=function(Et){Et.start.row<0?(Et.start.row=0,Et.start.column=0):Et.start.column=this.$clipColumnToRow(Et.start.row,Et.start.column);var kt=this.doc.getLength()-1;return Et.end.row>kt?(Et.end.row=kt,Et.end.column=this.doc.getLine(kt).length):Et.end.column=this.$clipColumnToRow(Et.end.row,Et.end.column),Et},Ct.prototype.setUseWrapMode=function(Et){if(Et!=this.$useWrapMode){if(this.$useWrapMode=Et,this.$modified=!0,this.$resetRowCache(0),Et){var kt=this.getLength();this.$wrapData=Array(kt),this.$updateWrapData(0,kt-1)}this._signal("changeWrapMode")}},Ct.prototype.getUseWrapMode=function(){return this.$useWrapMode},Ct.prototype.setWrapLimitRange=function(Et,kt){(this.$wrapLimitRange.min!==Et||this.$wrapLimitRange.max!==kt)&&(this.$wrapLimitRange={min:Et,max:kt},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},Ct.prototype.adjustWrapLimit=function(Et,kt){var Tt=this.$wrapLimitRange;Tt.max<0&&(Tt={min:kt,max:kt});var $t=this.$constrainWrapLimit(Et,Tt.min,Tt.max);return $t!=this.$wrapLimit&&$t>1?(this.$wrapLimit=$t,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0):!1},Ct.prototype.$constrainWrapLimit=function(Et,kt,Tt){return kt&&(Et=Math.max(kt,Et)),Tt&&(Et=Math.min(Tt,Et)),Et},Ct.prototype.getWrapLimit=function(){return this.$wrapLimit},Ct.prototype.setWrapLimit=function(Et){this.setWrapLimitRange(Et,Et)},Ct.prototype.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},Ct.prototype.$updateInternalDataOnChange=function(Et){var kt=this.$useWrapMode,Tt=Et.action,$t=Et.start,It=Et.end,Ot=$t.row,Mt=It.row,Dt=Mt-Ot,Bt=null;if(this.$updating=!0,Dt!=0)if(Tt==="remove"){this[kt?"$wrapData":"$rowLengthCache"].splice(Ot,Dt);var Kt=this.$foldData;Bt=this.getFoldsInRange(Et),this.removeFolds(Bt);var Wt=this.getFoldLine(It.row),zt=0;if(Wt){Wt.addRemoveChars(It.row,It.column,$t.column-It.column),Wt.shiftRow(-Dt);var Ht=this.getFoldLine(Ot);Ht&&Ht!==Wt&&(Ht.merge(Wt),Wt=Ht),zt=Kt.indexOf(Wt)+1}for(zt;zt=It.row&&Wt.shiftRow(-Dt)}Mt=Ot}else{var Zt=Array(Dt);Zt.unshift(Ot,0);var qt=kt?this.$wrapData:this.$rowLengthCache;qt.splice.apply(qt,Zt);var Kt=this.$foldData,Wt=this.getFoldLine(Ot),zt=0;if(Wt){var hr=Wt.range.compareInside($t.row,$t.column);hr==0?(Wt=Wt.split($t.row,$t.column),Wt&&(Wt.shiftRow(Dt),Wt.addRemoveChars(Mt,0,It.column-$t.column))):hr==-1&&(Wt.addRemoveChars(Ot,0,It.column-$t.column),Wt.shiftRow(Dt)),zt=Kt.indexOf(Wt)+1}for(zt;zt=Ot&&Wt.shiftRow(Dt)}}else{Dt=Math.abs(Et.start.column-Et.end.column),Tt==="remove"&&(Bt=this.getFoldsInRange(Et),this.removeFolds(Bt),Dt=-Dt);var Wt=this.getFoldLine(Ot);Wt&&Wt.addRemoveChars(Ot,$t.column,Dt)}return kt&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,kt?this.$updateWrapData(Ot,Mt):this.$updateRowLengthCache(Ot,Mt),Bt},Ct.prototype.$updateRowLengthCache=function(Et,kt){this.$rowLengthCache[Et]=null,this.$rowLengthCache[kt]=null},Ct.prototype.$updateWrapData=function(Et,kt){var Tt=this.doc.getAllLines(),$t=this.getTabSize(),It=this.$wrapData,Ot=this.$wrapLimit,Mt,Dt,Bt=Et;for(kt=Math.min(kt,Tt.length-1);Bt<=kt;)Dt=this.getFoldLine(Bt,Dt),Dt?(Mt=[],Dt.walk((function(Kt,Wt,zt,Ht){var Zt;if(Kt!=null){Zt=this.$getDisplayTokens(Kt,Mt.length),Zt[0]=mt;for(var qt=1;qtkt-Ht;){var Zt=Ot+kt-Ht;if(Et[Zt-1]>=St&&Et[Zt]>=St){zt(Zt);continue}if(Et[Zt]==mt||Et[Zt]==gt){for(Zt;Zt!=Ot-1&&Et[Zt]!=mt;Zt--);if(Zt>Ot){zt(Zt);continue}for(Zt=Ot+kt,Zt;Zt>2)),Ot-1);Zt>qt&&Et[Zt]qt&&Et[Zt]qt&&Et[Zt]==dt;)Zt--}else for(;Zt>qt&&Et[Zt]qt){zt(++Zt);continue}Zt=Ot+kt,Et[Zt]==pt&&Zt--,zt(Zt-Ht)}return $t},Ct.prototype.$getDisplayTokens=function(Et,kt){var Tt=[],$t;kt=kt||0;for(var It=0;It39&&Ot<48||Ot>57&&Ot<64?Tt.push(dt):Ot>=4352&&_t(Ot)?Tt.push(ut,pt):Tt.push(ut)}return Tt},Ct.prototype.$getStringScreenWidth=function(Et,kt,Tt){if(kt==0)return[0,0];kt==null&&(kt=1/0),Tt=Tt||0;var $t,It;for(It=0;It=4352&&_t($t)?Tt+=2:Tt+=1,!(Tt>kt));It++);return[Tt,It]},Ct.prototype.getRowLength=function(Et){var kt=1;return this.lineWidgets&&(kt+=this.lineWidgets[Et]&&this.lineWidgets[Et].rowCount||0),!this.$useWrapMode||!this.$wrapData[Et]?kt:this.$wrapData[Et].length+kt},Ct.prototype.getRowLineCount=function(Et){return!this.$useWrapMode||!this.$wrapData[Et]?1:this.$wrapData[Et].length+1},Ct.prototype.getRowWrapIndent=function(Et){if(this.$useWrapMode){var kt=this.screenToDocumentPosition(Et,Number.MAX_VALUE),Tt=this.$wrapData[kt.row];return Tt.length&&Tt[0]=0)var Dt=Kt[Wt],It=this.$docRowCache[Wt],Ht=Et>Kt[zt-1];else var Ht=!zt;for(var Zt=this.getLength()-1,qt=this.getNextFoldLine(It),hr=qt?qt.start.row:1/0;Dt<=Et&&(Bt=this.getRowLength(It),!(Dt+Bt>Et||It>=Zt));)Dt+=Bt,It++,It>hr&&(It=qt.end.row+1,qt=this.getNextFoldLine(It,qt),hr=qt?qt.start.row:1/0),Ht&&(this.$docRowCache.push(It),this.$screenRowCache.push(Dt));if(qt&&qt.start.row<=It)$t=this.getFoldDisplayLine(qt),It=qt.start.row;else{if(Dt+Bt<=Et||It>Zt)return{row:Zt,column:this.getLine(Zt).length};$t=this.getLine(It),qt=null}var fr=0,mr=Math.floor(Et-Dt);if(this.$useWrapMode){var gr=this.$wrapData[It];gr&&(Mt=gr[mr],mr>0&&gr.length&&(fr=gr.indent,Ot=gr[mr-1]||gr[gr.length-1],$t=$t.substring(Ot)))}return Tt!==void 0&&this.$bidiHandler.isBidiRow(Dt+mr,It,mr)&&(kt=this.$bidiHandler.offsetToCol(Tt)),Ot+=this.$getStringScreenWidth($t,kt-fr)[1],this.$useWrapMode&&Ot>=Mt&&(Ot=Mt-1),qt?qt.idxToPosition(Ot):{row:It,column:Ot}},Ct.prototype.documentToScreenPosition=function(Et,kt){if(typeof kt>"u")var Tt=this.$clipPositionToDocument(Et.row,Et.column);else Tt=this.$clipPositionToDocument(Et,kt);Et=Tt.row,kt=Tt.column;var $t=0,It=null,Ot=null;Ot=this.getFoldAt(Et,kt,1),Ot&&(Et=Ot.start.row,kt=Ot.start.column);var Mt,Dt=0,Bt=this.$docRowCache,Kt=this.$getRowCacheIndex(Bt,Et),Wt=Bt.length;if(Wt&&Kt>=0)var Dt=Bt[Kt],$t=this.$screenRowCache[Kt],zt=Et>Bt[Wt-1];else var zt=!Wt;for(var Ht=this.getNextFoldLine(Dt),Zt=Ht?Ht.start.row:1/0;Dt=Zt){if(Mt=Ht.end.row+1,Mt>Et)break;Ht=this.getNextFoldLine(Mt,Ht),Zt=Ht?Ht.start.row:1/0}else Mt=Dt+1;$t+=this.getRowLength(Dt),Dt=Mt,zt&&(this.$docRowCache.push(Dt),this.$screenRowCache.push($t))}var qt="";Ht&&Dt>=Zt?(qt=this.getFoldDisplayLine(Ht,Et,kt),It=Ht.start.row):(qt=this.getLine(Et).substring(0,kt),It=Et);var hr=0;if(this.$useWrapMode){var fr=this.$wrapData[It];if(fr){for(var mr=0;qt.length>=fr[mr];)$t++,mr++;qt=qt.substring(fr[mr-1]||0,qt.length),hr=mr>0?fr.indent:0}}return this.lineWidgets&&this.lineWidgets[Dt]&&this.lineWidgets[Dt].rowsAbove&&($t+=this.lineWidgets[Dt].rowsAbove),{row:$t,column:hr+this.$getStringScreenWidth(qt)[0]}},Ct.prototype.documentToScreenColumn=function(Et,kt){return this.documentToScreenPosition(Et,kt).column},Ct.prototype.documentToScreenRow=function(Et,kt){return this.documentToScreenPosition(Et,kt).row},Ct.prototype.getScreenLength=function(){var Et=0,kt=null;if(this.$useWrapMode)for(var It=this.$wrapData.length,Ot=0,$t=0,kt=this.$foldData[$t++],Mt=kt?kt.start.row:1/0;OtMt&&(Ot=kt.end.row+1,kt=this.$foldData[$t++],Mt=kt?kt.start.row:1/0)}else{Et=this.getLength();for(var Tt=this.$foldData,$t=0;$tTt));Ot++);return[$t,Ot]})},Ct.prototype.getPrecedingCharacter=function(){var Et=this.selection.getCursor();if(Et.column===0)return Et.row===0?"":this.doc.getNewLineCharacter();var kt=this.getLine(Et.row);return kt[Et.column-1]},Ct.prototype.destroy=function(){this.destroyed||(this.bgTokenizer.setDocument(null),this.bgTokenizer.cleanup(),this.destroyed=!0),this.$stopWorker(),this.removeAllListeners(),this.doc&&this.doc.off("change",this.$onChange),this.selection.detach()},Ct}();ht.$uid=0,ht.prototype.$modes=nt.$modes,ht.prototype.getValue=ht.prototype.toString,ht.prototype.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},ht.prototype.$overwrite=!1,ht.prototype.$mode=null,ht.prototype.$modeId=null,ht.prototype.$scrollTop=0,ht.prototype.$scrollLeft=0,ht.prototype.$wrapLimit=80,ht.prototype.$useWrapMode=!1,ht.prototype.$wrapLimitRange={min:null,max:null},ht.prototype.lineWidgets=null,ht.prototype.isFullWidth=_t,tt.implement(ht.prototype,it);var ut=1,pt=2,mt=3,gt=4,dt=9,St=10,xt=11,yt=12;function _t(Ct){return Ct<4352?!1:Ct>=4352&&Ct<=4447||Ct>=4515&&Ct<=4519||Ct>=4602&&Ct<=4607||Ct>=9001&&Ct<=9002||Ct>=11904&&Ct<=11929||Ct>=11931&&Ct<=12019||Ct>=12032&&Ct<=12245||Ct>=12272&&Ct<=12283||Ct>=12288&&Ct<=12350||Ct>=12353&&Ct<=12438||Ct>=12441&&Ct<=12543||Ct>=12549&&Ct<=12589||Ct>=12593&&Ct<=12686||Ct>=12688&&Ct<=12730||Ct>=12736&&Ct<=12771||Ct>=12784&&Ct<=12830||Ct>=12832&&Ct<=12871||Ct>=12880&&Ct<=13054||Ct>=13056&&Ct<=19903||Ct>=19968&&Ct<=42124||Ct>=42128&&Ct<=42182||Ct>=43360&&Ct<=43388||Ct>=44032&&Ct<=55203||Ct>=55216&&Ct<=55238||Ct>=55243&&Ct<=55291||Ct>=63744&&Ct<=64255||Ct>=65040&&Ct<=65049||Ct>=65072&&Ct<=65106||Ct>=65108&&Ct<=65126||Ct>=65128&&Ct<=65131||Ct>=65281&&Ct<=65376||Ct>=65504&&Ct<=65510}o("./edit_session/folding").Folding.call(ht.prototype),o("./edit_session/bracket_match").BracketMatch.call(ht.prototype),nt.defineOptions(ht.prototype,"session",{wrap:{set:function(Ct){if(!Ct||Ct=="off"?Ct=!1:Ct=="free"?Ct=!0:Ct=="printMargin"?Ct=-1:typeof Ct=="string"&&(Ct=parseInt(Ct,10)||!1),this.$wrap!=Ct)if(this.$wrap=Ct,!Ct)this.setUseWrapMode(!1);else{var Et=typeof Ct=="number"?Ct:null;this.setWrapLimitRange(Et,Et),this.setUseWrapMode(!0)}},get:function(){return this.getUseWrapMode()?this.$wrap==-1?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(Ct){Ct=Ct=="auto"?this.$mode.type!="text":Ct!="text",Ct!=this.$wrapAsCode&&(this.$wrapAsCode=Ct,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(Ct){this.$useWorker=Ct,this.$stopWorker(),Ct&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(Ct){Ct=parseInt(Ct),Ct>0&&this.$tabSize!==Ct&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=Ct,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(Ct){this.setFoldStyle(Ct)},handlesSet:!0},overwrite:{set:function(Ct){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(Ct){this.doc.setNewLineMode(Ct)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(Ct){this.setMode(Ct)},get:function(){return this.$modeId},handlesSet:!0}}),a.EditSession=ht}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(o,a,rt){var tt=o("./lib/lang"),ot=o("./lib/oop"),at=o("./range").Range,nt=function(){function j(){this.$options={}}return j.prototype.set=function(_){return ot.mixin(this.$options,_),this},j.prototype.getOptions=function(){return tt.copyObject(this.$options)},j.prototype.setOptions=function(_){this.$options=_},j.prototype.find=function(_){var $=this.$options,et=this.$matchIterator(_,$);if(!et)return!1;var st=null;return et.forEach(function(lt,ct,ht,ut){return st=new at(lt,ct,ht,ut),ct==ut&&$.start&&$.start.start&&$.skipCurrent!=!1&&st.isEqual($.start)?(st=null,!1):!0}),st},j.prototype.findAll=function(_){var $=this.$options;if(!$.needle)return[];this.$assembleRegExp($);var et=$.range,st=et?_.getLines(et.start.row,et.end.row):_.doc.getAllLines(),lt=[],ct=$.re;if($.$isMultiLine){var ht=ct.length,ut=st.length-ht,pt;e:for(var mt=ct.offset||0;mt<=ut;mt++){for(var gt=0;gtxt||(lt.push(pt=new at(mt,xt,mt+ht-1,yt)),ht>2&&(mt=mt+ht-2))}}else for(var _t=0;_tTt&<[gt].end.row==$t;)gt--;for(lt=lt.slice(_t,gt+1),_t=0,gt=lt.length;_t=pt;yt--)if(St(yt,Number.MAX_VALUE,xt))return;if($.wrap!=!1){for(yt=mt,pt=ut.row;yt>=pt;yt--)if(St(yt,Number.MAX_VALUE,xt))return}}};else var gt=function(yt){var _t=ut.row;if(!St(_t,ut.column,yt)){for(_t=_t+1;_t<=mt;_t++)if(St(_t,0,yt))return;if($.wrap!=!1){for(_t=pt,mt=ut.row;_t<=mt;_t++)if(St(_t,0,yt))return}}};if($.$isMultiLine)var dt=tt.length,St=function(xt,yt,_t){var Ct=st?xt-dt+1:xt;if(!(Ct<0||Ct+dt>_.getLength())){var Et=_.getLine(Ct),kt=Et.search(tt[0]);if(!(!st&&ktyt)&&_t(Ct,kt,Ct+dt-1,$t))return!0}}};else if(st)var St=function(yt,_t,Ct){var Et=_.getLine(yt),kt=[],Tt,$t=0;for(tt.lastIndex=0;Tt=tt.exec(Et);){var It=Tt[0].length;if($t=Tt.index,!It){if($t>=Et.length)break;tt.lastIndex=$t+=et.skipEmptyMatch(Et,$t,ct)}if(Tt.index+It>_t)break;kt.push(Tt.index,It)}for(var Ot=kt.length-1;Ot>=0;Ot-=2){var Mt=kt[Ot-1],It=kt[Ot];if(Ct(yt,Mt,yt,Mt+It))return!0}};else var St=function(yt,_t,Ct){var Et=_.getLine(yt),kt,Tt;for(tt.lastIndex=_t;Tt=tt.exec(Et);){var $t=Tt[0].length;if(kt=Tt.index,Ct(yt,kt,yt,kt+$t))return!0;if(!$t&&(tt.lastIndex=kt+=et.skipEmptyMatch(Et,kt,ct),kt>=Et.length))return!1}};return{forEach:gt}},j}();function it(j,_){var $=et.supportsLookbehind();function tt(ht,ut){ut===void 0&&(ut=!0);var pt=$&&_.$supportsUnicodeFlag?new RegExp("[\\p{L}\\p{N}_]","u"):new RegExp("\\w");return pt.test(ht)||_.regExp?$&&_.$supportsUnicodeFlag?ut?"(?<=^|[^\\p{L}\\p{N}_])":"(?=[^\\p{L}\\p{N}_]|$)":"\\b":""}var st=Array.from(j),lt=st[0],ct=st[st.length-1];return tt(lt)+j+tt(ct,!1)}a.Search=nt}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(o,a,rt){var et=this&&this.__extends||function(){var $=function(tt,st){return $=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(lt,ct){lt.__proto__=ct}||function(lt,ct){for(var ht in ct)Object.prototype.hasOwnProperty.call(ct,ht)&&(lt[ht]=ct[ht])},$(tt,st)};return function(tt,st){if(typeof st!="function"&&st!==null)throw new TypeError("Class extends value "+String(st)+" is not a constructor or null");$(tt,st);function lt(){this.constructor=tt}tt.prototype=st===null?Object.create(st):(lt.prototype=st.prototype,new lt)}}(),ot=o("../lib/keys"),at=o("../lib/useragent"),nt=ot.KEY_MODS,it=function(){function $(tt,st){this.$init(tt,st,!1)}return $.prototype.$init=function(tt,st,lt){this.platform=st||(at.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(tt),this.$singleCommand=lt},$.prototype.addCommand=function(tt){this.commands[tt.name]&&this.removeCommand(tt),this.commands[tt.name]=tt,tt.bindKey&&this._buildKeyHash(tt)},$.prototype.removeCommand=function(tt,st){var lt=tt&&(typeof tt=="string"?tt:tt.name);tt=this.commands[lt],st||delete this.commands[lt];var ct=this.commandKeyBinding;for(var ht in ct){var ut=ct[ht];if(ut==tt)delete ct[ht];else if(Array.isArray(ut)){var pt=ut.indexOf(tt);pt!=-1&&(ut.splice(pt,1),ut.length==1&&(ct[ht]=ut[0]))}}},$.prototype.bindKey=function(tt,st,lt){if(typeof tt=="object"&&tt&&(lt==null&&(lt=tt.position),tt=tt[this.platform]),!!tt){if(typeof st=="function")return this.addCommand({exec:st,bindKey:tt,name:st.name||tt});tt.split("|").forEach(function(ct){var ht="";if(ct.indexOf(" ")!=-1){var ut=ct.split(/\s+/);ct=ut.pop(),ut.forEach(function(gt){var dt=this.parseKeys(gt),St=nt[dt.hashId]+dt.key;ht+=(ht?" ":"")+St,this._addCommandToBinding(ht,"chainKeys")},this),ht+=" "}var pt=this.parseKeys(ct),mt=nt[pt.hashId]+pt.key;this._addCommandToBinding(ht+mt,st,lt)},this)}},$.prototype._addCommandToBinding=function(tt,st,lt){var ct=this.commandKeyBinding,ht;if(!st)delete ct[tt];else if(!ct[tt]||this.$singleCommand)ct[tt]=st;else{Array.isArray(ct[tt])?(ht=ct[tt].indexOf(st))!=-1&&ct[tt].splice(ht,1):ct[tt]=[ct[tt]],typeof lt!="number"&&(lt=j(st));var ut=ct[tt];for(ht=0;htlt)break}ut.splice(ht,0,st)}},$.prototype.addCommands=function(tt){tt&&Object.keys(tt).forEach(function(st){var lt=tt[st];if(lt){if(typeof lt=="string")return this.bindKey(lt,st);typeof lt=="function"&&(lt={exec:lt}),typeof lt=="object"&&(lt.name||(lt.name=st),this.addCommand(lt))}},this)},$.prototype.removeCommands=function(tt){Object.keys(tt).forEach(function(st){this.removeCommand(tt[st])},this)},$.prototype.bindKeys=function(tt){Object.keys(tt).forEach(function(st){this.bindKey(st,tt[st])},this)},$.prototype._buildKeyHash=function(tt){this.bindKey(tt.bindKey,tt)},$.prototype.parseKeys=function(tt){var st=tt.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(mt){return mt}),lt=st.pop(),ct=ot[lt];if(ot.FUNCTION_KEYS[ct])lt=ot.FUNCTION_KEYS[ct].toLowerCase();else if(st.length){if(st.length==1&&st[0]=="shift")return{key:lt.toUpperCase(),hashId:-1}}else return{key:lt,hashId:-1};for(var ht=0,ut=st.length;ut--;){var pt=ot.KEY_MODS[st[ut]];if(pt==null)return typeof console<"u"&&console.error("invalid modifier "+st[ut]+" in "+tt),!1;ht|=pt}return{key:lt,hashId:ht}},$.prototype.findKeyCommand=function(tt,st){var lt=nt[tt]+st;return this.commandKeyBinding[lt]},$.prototype.handleKeyboard=function(tt,st,lt,ct){if(!(ct<0)){var ht=nt[st]+lt,ut=this.commandKeyBinding[ht];return tt.$keyChain&&(tt.$keyChain+=" "+ht,ut=this.commandKeyBinding[tt.$keyChain]||ut),ut&&(ut=="chainKeys"||ut[ut.length-1]=="chainKeys")?(tt.$keyChain=tt.$keyChain||ht,{command:"null"}):(tt.$keyChain&&((!st||st==4)&<.length==1?tt.$keyChain=tt.$keyChain.slice(0,-ht.length-1):(st==-1||ct>0)&&(tt.$keyChain="")),{command:ut})}},$.prototype.getStatusText=function(tt,st){return st.$keyChain||""},$}();function j($){return typeof $=="object"&&$.bindKey&&$.bindKey.position||($.isDefault?-100:0)}var _=function($){et(tt,$);function tt(st,lt){var ct=$.call(this,st,lt)||this;return ct.$singleCommand=!0,ct}return tt}(it);_.call=function($,tt,st){it.prototype.$init.call($,tt,st,!0)},it.call=function($,tt,st){it.prototype.$init.call($,tt,st,!1)},a.HashHandler=_,a.MultiHashHandler=it}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(o,a,rt){var et=this&&this.__extends||function(){var j=function(_,$){return j=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(tt,st){tt.__proto__=st}||function(tt,st){for(var lt in st)Object.prototype.hasOwnProperty.call(st,lt)&&(tt[lt]=st[lt])},j(_,$)};return function(_,$){if(typeof $!="function"&&$!==null)throw new TypeError("Class extends value "+String($)+" is not a constructor or null");j(_,$);function tt(){this.constructor=_}_.prototype=$===null?Object.create($):(tt.prototype=$.prototype,new tt)}}(),ot=o("../lib/oop"),at=o("../keyboard/hash_handler").MultiHashHandler,nt=o("../lib/event_emitter").EventEmitter,it=function(j){et(_,j);function _($,tt){var st=j.call(this,tt,$)||this;return st.byName=st.commands,st.setDefaultHandler("exec",function(lt){return lt.args?lt.command.exec(lt.editor,lt.args,lt.event,!1):lt.command.exec(lt.editor,{},lt.event,!0)}),st}return _.prototype.exec=function($,tt,st){if(Array.isArray($)){for(var lt=$.length;lt--;)if(this.exec($[lt],tt,st))return!0;return!1}if(typeof $=="string"&&($=this.commands[$]),!this.canExecute($,tt))return!1;var ct={editor:tt,command:$,args:st};return ct.returnValue=this._emit("exec",ct),this._signal("afterExec",ct),ct.returnValue!==!1},_.prototype.canExecute=function($,tt){return typeof $=="string"&&($=this.commands[$]),!(!$||tt&&tt.$readOnly&&!$.readOnly||this.$checkCommandState!=!1&&$.isAvailable&&!$.isAvailable(tt))},_.prototype.toggleRecording=function($){if(!this.$inReplay)return $&&$._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(tt){this.macro.push([tt.command,tt.args])}).bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},_.prototype.replay=function($){if(!(this.$inReplay||!this.macro)){if(this.recording)return this.toggleRecording($);try{this.$inReplay=!0,this.macro.forEach(function(tt){typeof tt=="string"?this.exec(tt,$):this.exec(tt[0],$,tt[1])},this)}finally{this.$inReplay=!1}}},_.prototype.trimMacro=function($){return $.map(function(tt){return typeof tt[0]!="string"&&(tt[0]=tt[0].name),tt[1]||(tt=tt[0]),tt})},_}(at);ot.implement(it.prototype,nt),a.CommandManager=it}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(o,a,rt){var et=o("../lib/lang"),ot=o("../config"),at=o("../range").Range;function nt(j,_){return{win:j,mac:_}}a.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:nt("Ctrl-,","Command-,"),exec:function(j){ot.loadModule("ace/ext/settings_menu",function(_){_.init(j),j.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",description:"Go to next error",bindKey:nt("Alt-E","F4"),exec:function(j){ot.loadModule("ace/ext/error_marker",function(_){_.showErrorMarker(j,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",description:"Go to previous error",bindKey:nt("Alt-Shift-E","Shift-F4"),exec:function(j){ot.loadModule("ace/ext/error_marker",function(_){_.showErrorMarker(j,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:nt("Ctrl-A","Command-A"),exec:function(j){j.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:nt(null,"Ctrl-L"),exec:function(j){j.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:nt("Ctrl-L","Command-L"),exec:function(j,_){typeof _=="number"&&!isNaN(_)&&j.gotoLine(_),j.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:nt("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(j){j.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:nt("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(j){j.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",description:"Toggle fold widget",bindKey:nt("F2","F2"),exec:function(j){j.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:nt("Alt-F2","Alt-F2"),exec:function(j){j.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:nt(null,"Ctrl-Command-Option-0"),exec:function(j){j.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:nt(null,"Ctrl-Command-Option-0"),exec:function(j){j.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:nt("Alt-0","Command-Option-0"),exec:function(j){j.session.foldAll(),j.session.unfold(j.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:nt("Alt-Shift-0","Command-Option-Shift-0"),exec:function(j){j.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:nt("Ctrl-K","Command-G"),exec:function(j){j.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:nt("Ctrl-Shift-K","Command-Shift-G"),exec:function(j){j.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:nt("Alt-K","Ctrl-G"),exec:function(j){j.selection.isEmpty()?j.selection.selectWord():j.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:nt("Alt-Shift-K","Ctrl-Shift-G"),exec:function(j){j.selection.isEmpty()?j.selection.selectWord():j.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:nt("Ctrl-F","Command-F"),exec:function(j){ot.loadModule("ace/ext/searchbox",function(_){_.Search(j)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(j){j.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:nt("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(j){j.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:nt("Ctrl-Home","Command-Home|Command-Up"),exec:function(j){j.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:nt("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(j){j.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:nt("Up","Up|Ctrl-P"),exec:function(j,_){j.navigateUp(_.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:nt("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(j){j.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:nt("Ctrl-End","Command-End|Command-Down"),exec:function(j){j.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:nt("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(j){j.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:nt("Down","Down|Ctrl-N"),exec:function(j,_){j.navigateDown(_.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:nt("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(j){j.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:nt("Ctrl-Left","Option-Left"),exec:function(j){j.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:nt("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(j){j.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:nt("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(j){j.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:nt("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(j){j.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:nt("Left","Left|Ctrl-B"),exec:function(j,_){j.navigateLeft(_.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:nt("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(j){j.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:nt("Ctrl-Right","Option-Right"),exec:function(j){j.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:nt("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(j){j.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:nt("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(j){j.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:nt("Shift-Right","Shift-Right"),exec:function(j){j.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:nt("Right","Right|Ctrl-F"),exec:function(j,_){j.navigateRight(_.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(j){j.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:nt(null,"Option-PageDown"),exec:function(j){j.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:nt("PageDown","PageDown|Ctrl-V"),exec:function(j){j.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(j){j.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:nt(null,"Option-PageUp"),exec:function(j){j.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(j){j.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:nt("Ctrl-Up",null),exec:function(j){j.renderer.scrollBy(0,-2*j.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:nt("Ctrl-Down",null),exec:function(j){j.renderer.scrollBy(0,2*j.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(j){j.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(j){j.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:nt("Ctrl-Alt-E","Command-Option-E"),exec:function(j){j.commands.toggleRecording(j)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:nt("Ctrl-Shift-E","Command-Shift-E"),exec:function(j){j.commands.replay(j)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:nt("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(j){j.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:nt("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(j){j.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:nt("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(j){j.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:nt(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(j){},readOnly:!0},{name:"cut",description:"Cut",exec:function(j){var _=j.$copyWithEmptySelection&&j.selection.isEmpty(),$=_?j.selection.getLineRange():j.selection.getRange();j._emit("cut",$),$.isEmpty()||j.session.remove($),j.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(j,_){j.$handlePaste(_)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:nt("Ctrl-D","Command-D"),exec:function(j){j.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:nt("Ctrl-Shift-D","Command-Shift-D"),exec:function(j){j.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:nt("Ctrl-Alt-S","Command-Alt-S"),exec:function(j){j.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:nt("Ctrl-/","Command-/"),exec:function(j){j.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:nt("Ctrl-Shift-/","Command-Shift-/"),exec:function(j){j.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:nt("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(j){j.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:nt("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(j){j.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:nt("Ctrl-H","Command-Option-F"),exec:function(j){ot.loadModule("ace/ext/searchbox",function(_){_.Search(j,!0)})}},{name:"undo",description:"Undo",bindKey:nt("Ctrl-Z","Command-Z"),exec:function(j){j.undo()}},{name:"redo",description:"Redo",bindKey:nt("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(j){j.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:nt("Alt-Shift-Up","Command-Option-Up"),exec:function(j){j.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:nt("Alt-Up","Option-Up"),exec:function(j){j.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:nt("Alt-Shift-Down","Command-Option-Down"),exec:function(j){j.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:nt("Alt-Down","Option-Down"),exec:function(j){j.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:nt("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(j){j.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:nt("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(j){j.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:nt("Shift-Delete",null),exec:function(j){if(j.selection.isEmpty())j.remove("left");else return!1},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:nt("Alt-Backspace","Command-Backspace"),exec:function(j){j.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:nt("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(j){j.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:nt("Ctrl-Shift-Backspace",null),exec:function(j){var _=j.selection.getRange();_.start.column=0,j.session.remove(_)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:nt("Ctrl-Shift-Delete",null),exec:function(j){var _=j.selection.getRange();_.end.column=Number.MAX_VALUE,j.session.remove(_)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:nt("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(j){j.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:nt("Ctrl-Delete","Alt-Delete"),exec:function(j){j.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:nt("Shift-Tab","Shift-Tab"),exec:function(j){j.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:nt("Tab","Tab"),exec:function(j){j.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:nt("Ctrl-[","Ctrl-["),exec:function(j){j.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:nt("Ctrl-]","Ctrl-]"),exec:function(j){j.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(j,_){j.insert(_)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(j,_){j.insert(et.stringRepeat(_.text||"",_.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:nt(null,"Ctrl-O"),exec:function(j){j.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:nt("Alt-Shift-X","Ctrl-T"),exec:function(j){j.transposeLetters()},multiSelectAction:function(j){j.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:nt("Ctrl-U","Ctrl-U"),exec:function(j){j.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:nt("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(j){j.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:nt(null,null),exec:function(j){j.autoIndent()},scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:nt("Ctrl-Shift-L","Command-Shift-L"),exec:function(j){var _=j.selection.getRange();_.start.column=_.end.column=0,_.end.row++,j.selection.setRange(_,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"openlink",bindKey:nt("Ctrl+F3","F3"),exec:function(j){j.openLink()}},{name:"joinlines",description:"Join lines",bindKey:nt(null,null),exec:function(j){for(var _=j.selection.isBackwards(),$=_?j.selection.getSelectionLead():j.selection.getSelectionAnchor(),tt=_?j.selection.getSelectionAnchor():j.selection.getSelectionLead(),st=j.session.doc.getLine($.row).length,lt=j.session.doc.getTextRange(j.selection.getRange()),ct=lt.replace(/\n\s*/," ").length,ht=j.session.doc.getLine($.row),ut=$.row+1;ut<=tt.row+1;ut++){var pt=et.stringTrimLeft(et.stringTrimRight(j.session.doc.getLine(ut)));pt.length!==0&&(pt=" "+pt),ht+=pt}tt.row+10?(j.selection.moveCursorTo($.row,$.column),j.selection.selectTo($.row,$.column+ct)):(st=j.session.doc.getLine($.row).length>st?st+1:st,j.selection.moveCursorTo($.row,st))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:nt(null,null),exec:function(j){var _=j.session.doc.getLength()-1,$=j.session.doc.getLine(_).length,tt=j.selection.rangeList.ranges,st=[];tt.length<1&&(tt=[j.selection.getRange()]);for(var lt=0;lt=pt;yt--)if(St(yt,Number.MAX_VALUE,xt))return;if($.wrap!=!1){for(yt=mt,pt=ut.row;yt>=pt;yt--)if(St(yt,Number.MAX_VALUE,xt))return}}};else var gt=function(yt){var _t=ut.row;if(!St(_t,ut.column,yt)){for(_t=_t+1;_t<=mt;_t++)if(St(_t,0,yt))return;if($.wrap!=!1){for(_t=pt,mt=ut.row;_t<=mt;_t++)if(St(_t,0,yt))return}}};if($.$isMultiLine)var dt=et.length,St=function(xt,yt,_t){var Ct=st?xt-dt+1:xt;if(!(Ct<0||Ct+dt>_.getLength())){var Et=_.getLine(Ct),kt=Et.search(et[0]);if(!(!st&&ktyt)&&_t(Ct,kt,Ct+dt-1,$t))return!0}}};else if(st)var St=function(yt,_t,Ct){var Et=_.getLine(yt),kt=[],Tt,$t=0;for(et.lastIndex=0;Tt=et.exec(Et);){var It=Tt[0].length;if($t=Tt.index,!It){if($t>=Et.length)break;et.lastIndex=$t+=tt.skipEmptyMatch(Et,$t,ct)}if(Tt.index+It>_t)break;kt.push(Tt.index,It)}for(var Ot=kt.length-1;Ot>=0;Ot-=2){var Mt=kt[Ot-1],It=kt[Ot];if(Ct(yt,Mt,yt,Mt+It))return!0}};else var St=function(yt,_t,Ct){var Et=_.getLine(yt),kt,Tt;for(et.lastIndex=_t;Tt=et.exec(Et);){var $t=Tt[0].length;if(kt=Tt.index,Ct(yt,kt,yt,kt+$t))return!0;if(!$t&&(et.lastIndex=kt+=tt.skipEmptyMatch(Et,kt,ct),kt>=Et.length))return!1}};return{forEach:gt}},j}();function it(j,_){var $=tt.supportsLookbehind();function et(ht,ut){ut===void 0&&(ut=!0);var pt=$&&_.$supportsUnicodeFlag?new RegExp("[\\p{L}\\p{N}_]","u"):new RegExp("\\w");return pt.test(ht)||_.regExp?$&&_.$supportsUnicodeFlag?ut?"(?<=^|[^\\p{L}\\p{N}_])":"(?=[^\\p{L}\\p{N}_]|$)":"\\b":""}var st=Array.from(j),lt=st[0],ct=st[st.length-1];return et(lt)+j+et(ct,!1)}a.Search=nt}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(o,a,rt){var tt=this&&this.__extends||function(){var $=function(et,st){return $=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(lt,ct){lt.__proto__=ct}||function(lt,ct){for(var ht in ct)Object.prototype.hasOwnProperty.call(ct,ht)&&(lt[ht]=ct[ht])},$(et,st)};return function(et,st){if(typeof st!="function"&&st!==null)throw new TypeError("Class extends value "+String(st)+" is not a constructor or null");$(et,st);function lt(){this.constructor=et}et.prototype=st===null?Object.create(st):(lt.prototype=st.prototype,new lt)}}(),ot=o("../lib/keys"),at=o("../lib/useragent"),nt=ot.KEY_MODS,it=function(){function $(et,st){this.$init(et,st,!1)}return $.prototype.$init=function(et,st,lt){this.platform=st||(at.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(et),this.$singleCommand=lt},$.prototype.addCommand=function(et){this.commands[et.name]&&this.removeCommand(et),this.commands[et.name]=et,et.bindKey&&this._buildKeyHash(et)},$.prototype.removeCommand=function(et,st){var lt=et&&(typeof et=="string"?et:et.name);et=this.commands[lt],st||delete this.commands[lt];var ct=this.commandKeyBinding;for(var ht in ct){var ut=ct[ht];if(ut==et)delete ct[ht];else if(Array.isArray(ut)){var pt=ut.indexOf(et);pt!=-1&&(ut.splice(pt,1),ut.length==1&&(ct[ht]=ut[0]))}}},$.prototype.bindKey=function(et,st,lt){if(typeof et=="object"&&et&&(lt==null&&(lt=et.position),et=et[this.platform]),!!et){if(typeof st=="function")return this.addCommand({exec:st,bindKey:et,name:st.name||et});et.split("|").forEach(function(ct){var ht="";if(ct.indexOf(" ")!=-1){var ut=ct.split(/\s+/);ct=ut.pop(),ut.forEach(function(gt){var dt=this.parseKeys(gt),St=nt[dt.hashId]+dt.key;ht+=(ht?" ":"")+St,this._addCommandToBinding(ht,"chainKeys")},this),ht+=" "}var pt=this.parseKeys(ct),mt=nt[pt.hashId]+pt.key;this._addCommandToBinding(ht+mt,st,lt)},this)}},$.prototype._addCommandToBinding=function(et,st,lt){var ct=this.commandKeyBinding,ht;if(!st)delete ct[et];else if(!ct[et]||this.$singleCommand)ct[et]=st;else{Array.isArray(ct[et])?(ht=ct[et].indexOf(st))!=-1&&ct[et].splice(ht,1):ct[et]=[ct[et]],typeof lt!="number"&&(lt=j(st));var ut=ct[et];for(ht=0;htlt)break}ut.splice(ht,0,st)}},$.prototype.addCommands=function(et){et&&Object.keys(et).forEach(function(st){var lt=et[st];if(lt){if(typeof lt=="string")return this.bindKey(lt,st);typeof lt=="function"&&(lt={exec:lt}),typeof lt=="object"&&(lt.name||(lt.name=st),this.addCommand(lt))}},this)},$.prototype.removeCommands=function(et){Object.keys(et).forEach(function(st){this.removeCommand(et[st])},this)},$.prototype.bindKeys=function(et){Object.keys(et).forEach(function(st){this.bindKey(st,et[st])},this)},$.prototype._buildKeyHash=function(et){this.bindKey(et.bindKey,et)},$.prototype.parseKeys=function(et){var st=et.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(mt){return mt}),lt=st.pop(),ct=ot[lt];if(ot.FUNCTION_KEYS[ct])lt=ot.FUNCTION_KEYS[ct].toLowerCase();else if(st.length){if(st.length==1&&st[0]=="shift")return{key:lt.toUpperCase(),hashId:-1}}else return{key:lt,hashId:-1};for(var ht=0,ut=st.length;ut--;){var pt=ot.KEY_MODS[st[ut]];if(pt==null)return typeof console<"u"&&console.error("invalid modifier "+st[ut]+" in "+et),!1;ht|=pt}return{key:lt,hashId:ht}},$.prototype.findKeyCommand=function(et,st){var lt=nt[et]+st;return this.commandKeyBinding[lt]},$.prototype.handleKeyboard=function(et,st,lt,ct){if(!(ct<0)){var ht=nt[st]+lt,ut=this.commandKeyBinding[ht];return et.$keyChain&&(et.$keyChain+=" "+ht,ut=this.commandKeyBinding[et.$keyChain]||ut),ut&&(ut=="chainKeys"||ut[ut.length-1]=="chainKeys")?(et.$keyChain=et.$keyChain||ht,{command:"null"}):(et.$keyChain&&((!st||st==4)&<.length==1?et.$keyChain=et.$keyChain.slice(0,-ht.length-1):(st==-1||ct>0)&&(et.$keyChain="")),{command:ut})}},$.prototype.getStatusText=function(et,st){return st.$keyChain||""},$}();function j($){return typeof $=="object"&&$.bindKey&&$.bindKey.position||($.isDefault?-100:0)}var _=function($){tt(et,$);function et(st,lt){var ct=$.call(this,st,lt)||this;return ct.$singleCommand=!0,ct}return et}(it);_.call=function($,et,st){it.prototype.$init.call($,et,st,!0)},it.call=function($,et,st){it.prototype.$init.call($,et,st,!1)},a.HashHandler=_,a.MultiHashHandler=it}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(o,a,rt){var tt=this&&this.__extends||function(){var j=function(_,$){return j=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(et,st){et.__proto__=st}||function(et,st){for(var lt in st)Object.prototype.hasOwnProperty.call(st,lt)&&(et[lt]=st[lt])},j(_,$)};return function(_,$){if(typeof $!="function"&&$!==null)throw new TypeError("Class extends value "+String($)+" is not a constructor or null");j(_,$);function et(){this.constructor=_}_.prototype=$===null?Object.create($):(et.prototype=$.prototype,new et)}}(),ot=o("../lib/oop"),at=o("../keyboard/hash_handler").MultiHashHandler,nt=o("../lib/event_emitter").EventEmitter,it=function(j){tt(_,j);function _($,et){var st=j.call(this,et,$)||this;return st.byName=st.commands,st.setDefaultHandler("exec",function(lt){return lt.args?lt.command.exec(lt.editor,lt.args,lt.event,!1):lt.command.exec(lt.editor,{},lt.event,!0)}),st}return _.prototype.exec=function($,et,st){if(Array.isArray($)){for(var lt=$.length;lt--;)if(this.exec($[lt],et,st))return!0;return!1}if(typeof $=="string"&&($=this.commands[$]),!this.canExecute($,et))return!1;var ct={editor:et,command:$,args:st};return ct.returnValue=this._emit("exec",ct),this._signal("afterExec",ct),ct.returnValue!==!1},_.prototype.canExecute=function($,et){return typeof $=="string"&&($=this.commands[$]),!(!$||et&&et.$readOnly&&!$.readOnly||this.$checkCommandState!=!1&&$.isAvailable&&!$.isAvailable(et))},_.prototype.toggleRecording=function($){if(!this.$inReplay)return $&&$._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(et){this.macro.push([et.command,et.args])}).bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},_.prototype.replay=function($){if(!(this.$inReplay||!this.macro)){if(this.recording)return this.toggleRecording($);try{this.$inReplay=!0,this.macro.forEach(function(et){typeof et=="string"?this.exec(et,$):this.exec(et[0],$,et[1])},this)}finally{this.$inReplay=!1}}},_.prototype.trimMacro=function($){return $.map(function(et){return typeof et[0]!="string"&&(et[0]=et[0].name),et[1]||(et=et[0]),et})},_}(at);ot.implement(it.prototype,nt),a.CommandManager=it}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(o,a,rt){var tt=o("../lib/lang"),ot=o("../config"),at=o("../range").Range;function nt(j,_){return{win:j,mac:_}}a.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:nt("Ctrl-,","Command-,"),exec:function(j){ot.loadModule("ace/ext/settings_menu",function(_){_.init(j),j.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",description:"Go to next error",bindKey:nt("Alt-E","F4"),exec:function(j){ot.loadModule("ace/ext/error_marker",function(_){_.showErrorMarker(j,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",description:"Go to previous error",bindKey:nt("Alt-Shift-E","Shift-F4"),exec:function(j){ot.loadModule("ace/ext/error_marker",function(_){_.showErrorMarker(j,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:nt("Ctrl-A","Command-A"),exec:function(j){j.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:nt(null,"Ctrl-L"),exec:function(j){j.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:nt("Ctrl-L","Command-L"),exec:function(j,_){typeof _=="number"&&!isNaN(_)&&j.gotoLine(_),j.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:nt("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(j){j.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:nt("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(j){j.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",description:"Toggle fold widget",bindKey:nt("F2","F2"),exec:function(j){j.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:nt("Alt-F2","Alt-F2"),exec:function(j){j.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:nt(null,"Ctrl-Command-Option-0"),exec:function(j){j.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:nt(null,"Ctrl-Command-Option-0"),exec:function(j){j.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:nt("Alt-0","Command-Option-0"),exec:function(j){j.session.foldAll(),j.session.unfold(j.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:nt("Alt-Shift-0","Command-Option-Shift-0"),exec:function(j){j.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:nt("Ctrl-K","Command-G"),exec:function(j){j.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:nt("Ctrl-Shift-K","Command-Shift-G"),exec:function(j){j.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:nt("Alt-K","Ctrl-G"),exec:function(j){j.selection.isEmpty()?j.selection.selectWord():j.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:nt("Alt-Shift-K","Ctrl-Shift-G"),exec:function(j){j.selection.isEmpty()?j.selection.selectWord():j.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:nt("Ctrl-F","Command-F"),exec:function(j){ot.loadModule("ace/ext/searchbox",function(_){_.Search(j)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(j){j.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:nt("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(j){j.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:nt("Ctrl-Home","Command-Home|Command-Up"),exec:function(j){j.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:nt("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(j){j.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:nt("Up","Up|Ctrl-P"),exec:function(j,_){j.navigateUp(_.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:nt("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(j){j.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:nt("Ctrl-End","Command-End|Command-Down"),exec:function(j){j.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:nt("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(j){j.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:nt("Down","Down|Ctrl-N"),exec:function(j,_){j.navigateDown(_.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:nt("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(j){j.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:nt("Ctrl-Left","Option-Left"),exec:function(j){j.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:nt("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(j){j.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:nt("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(j){j.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:nt("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(j){j.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:nt("Left","Left|Ctrl-B"),exec:function(j,_){j.navigateLeft(_.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:nt("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(j){j.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:nt("Ctrl-Right","Option-Right"),exec:function(j){j.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:nt("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(j){j.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:nt("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(j){j.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:nt("Shift-Right","Shift-Right"),exec:function(j){j.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:nt("Right","Right|Ctrl-F"),exec:function(j,_){j.navigateRight(_.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(j){j.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:nt(null,"Option-PageDown"),exec:function(j){j.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:nt("PageDown","PageDown|Ctrl-V"),exec:function(j){j.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(j){j.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:nt(null,"Option-PageUp"),exec:function(j){j.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(j){j.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:nt("Ctrl-Up",null),exec:function(j){j.renderer.scrollBy(0,-2*j.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:nt("Ctrl-Down",null),exec:function(j){j.renderer.scrollBy(0,2*j.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(j){j.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(j){j.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:nt("Ctrl-Alt-E","Command-Option-E"),exec:function(j){j.commands.toggleRecording(j)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:nt("Ctrl-Shift-E","Command-Shift-E"),exec:function(j){j.commands.replay(j)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:nt("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(j){j.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:nt("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(j){j.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:nt("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(j){j.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:nt(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(j){},readOnly:!0},{name:"cut",description:"Cut",exec:function(j){var _=j.$copyWithEmptySelection&&j.selection.isEmpty(),$=_?j.selection.getLineRange():j.selection.getRange();j._emit("cut",$),$.isEmpty()||j.session.remove($),j.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(j,_){j.$handlePaste(_)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:nt("Ctrl-D","Command-D"),exec:function(j){j.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:nt("Ctrl-Shift-D","Command-Shift-D"),exec:function(j){j.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:nt("Ctrl-Alt-S","Command-Alt-S"),exec:function(j){j.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:nt("Ctrl-/","Command-/"),exec:function(j){j.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:nt("Ctrl-Shift-/","Command-Shift-/"),exec:function(j){j.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:nt("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(j){j.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:nt("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(j){j.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:nt("Ctrl-H","Command-Option-F"),exec:function(j){ot.loadModule("ace/ext/searchbox",function(_){_.Search(j,!0)})}},{name:"undo",description:"Undo",bindKey:nt("Ctrl-Z","Command-Z"),exec:function(j){j.undo()}},{name:"redo",description:"Redo",bindKey:nt("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(j){j.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:nt("Alt-Shift-Up","Command-Option-Up"),exec:function(j){j.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:nt("Alt-Up","Option-Up"),exec:function(j){j.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:nt("Alt-Shift-Down","Command-Option-Down"),exec:function(j){j.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:nt("Alt-Down","Option-Down"),exec:function(j){j.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:nt("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(j){j.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:nt("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(j){j.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:nt("Shift-Delete",null),exec:function(j){if(j.selection.isEmpty())j.remove("left");else return!1},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:nt("Alt-Backspace","Command-Backspace"),exec:function(j){j.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:nt("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(j){j.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:nt("Ctrl-Shift-Backspace",null),exec:function(j){var _=j.selection.getRange();_.start.column=0,j.session.remove(_)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:nt("Ctrl-Shift-Delete",null),exec:function(j){var _=j.selection.getRange();_.end.column=Number.MAX_VALUE,j.session.remove(_)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:nt("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(j){j.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:nt("Ctrl-Delete","Alt-Delete"),exec:function(j){j.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:nt("Shift-Tab","Shift-Tab"),exec:function(j){j.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:nt("Tab","Tab"),exec:function(j){j.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:nt("Ctrl-[","Ctrl-["),exec:function(j){j.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:nt("Ctrl-]","Ctrl-]"),exec:function(j){j.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(j,_){j.insert(_)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(j,_){j.insert(tt.stringRepeat(_.text||"",_.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:nt(null,"Ctrl-O"),exec:function(j){j.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:nt("Alt-Shift-X","Ctrl-T"),exec:function(j){j.transposeLetters()},multiSelectAction:function(j){j.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:nt("Ctrl-U","Ctrl-U"),exec:function(j){j.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:nt("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(j){j.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:nt(null,null),exec:function(j){j.autoIndent()},scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:nt("Ctrl-Shift-L","Command-Shift-L"),exec:function(j){var _=j.selection.getRange();_.start.column=_.end.column=0,_.end.row++,j.selection.setRange(_,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"openlink",bindKey:nt("Ctrl+F3","F3"),exec:function(j){j.openLink()}},{name:"joinlines",description:"Join lines",bindKey:nt(null,null),exec:function(j){for(var _=j.selection.isBackwards(),$=_?j.selection.getSelectionLead():j.selection.getSelectionAnchor(),et=_?j.selection.getSelectionAnchor():j.selection.getSelectionLead(),st=j.session.doc.getLine($.row).length,lt=j.session.doc.getTextRange(j.selection.getRange()),ct=lt.replace(/\n\s*/," ").length,ht=j.session.doc.getLine($.row),ut=$.row+1;ut<=et.row+1;ut++){var pt=tt.stringTrimLeft(tt.stringTrimRight(j.session.doc.getLine(ut)));pt.length!==0&&(pt=" "+pt),ht+=pt}et.row+10?(j.selection.moveCursorTo($.row,$.column),j.selection.selectTo($.row,$.column+ct)):(st=j.session.doc.getLine($.row).length>st?st+1:st,j.selection.moveCursorTo($.row,st))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:nt(null,null),exec:function(j){var _=j.session.doc.getLength()-1,$=j.session.doc.getLine(_).length,et=j.selection.rangeList.ranges,st=[];et.length<1&&(et=[j.selection.getRange()]);for(var lt=0;ltit[j].column&&j++,tt.unshift(j,0),it.splice.apply(it,tt),this.$updateRows()}}},at.prototype.$updateRows=function(){var nt=this.session.lineWidgets;if(nt){var it=!0;nt.forEach(function(j,_){if(j)for(it=!1,j.row=_;j.$oldWidget;)j.$oldWidget.row=_,j=j.$oldWidget}),it&&(this.session.lineWidgets=null)}},at.prototype.$registerLineWidget=function(nt){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var it=this.session.lineWidgets[nt.row];return it&&(nt.$oldWidget=it,it.el&&it.el.parentNode&&(it.el.parentNode.removeChild(it.el),it._inDocument=!1)),this.session.lineWidgets[nt.row]=nt,nt},at.prototype.addLineWidget=function(nt){if(this.$registerLineWidget(nt),nt.session=this.session,!this.editor)return nt;var it=this.editor.renderer;nt.html&&!nt.el&&(nt.el=et.createElement("div"),nt.el.innerHTML=nt.html),nt.text&&!nt.el&&(nt.el=et.createElement("div"),nt.el.textContent=nt.text),nt.el&&(et.addCssClass(nt.el,"ace_lineWidgetContainer"),nt.className&&et.addCssClass(nt.el,nt.className),nt.el.style.position="absolute",nt.el.style.zIndex="5",it.container.appendChild(nt.el),nt._inDocument=!0,nt.coverGutter||(nt.el.style.zIndex="3"),nt.pixelHeight==null&&(nt.pixelHeight=nt.el.offsetHeight)),nt.rowCount==null&&(nt.rowCount=nt.pixelHeight/it.layerConfig.lineHeight);var j=this.session.getFoldAt(nt.row,0);if(nt.$fold=j,j){var _=this.session.lineWidgets;nt.row==j.end.row&&!_[j.start.row]?_[j.start.row]=nt:nt.hidden=!0}return this.session._emit("changeFold",{data:{start:{row:nt.row}}}),this.$updateRows(),this.renderWidgets(null,it),this.onWidgetChanged(nt),nt},at.prototype.removeLineWidget=function(nt){if(nt._inDocument=!1,nt.session=null,nt.el&&nt.el.parentNode&&nt.el.parentNode.removeChild(nt.el),nt.editor&&nt.editor.destroy)try{nt.editor.destroy()}catch{}if(this.session.lineWidgets){var it=this.session.lineWidgets[nt.row];if(it==nt)this.session.lineWidgets[nt.row]=nt.$oldWidget,nt.$oldWidget&&this.onWidgetChanged(nt.$oldWidget);else for(;it;){if(it.$oldWidget==nt){it.$oldWidget=nt.$oldWidget;break}it=it.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:nt.row}}}),this.$updateRows()},at.prototype.getWidgetsAtRow=function(nt){for(var it=this.session.lineWidgets,j=it&&it[nt],_=[];j;)_.push(j),j=j.$oldWidget;return _},at.prototype.onWidgetChanged=function(nt){this.session._changedWidgets.push(nt),this.editor&&this.editor.renderer.updateFull()},at.prototype.measureWidgets=function(nt,it){var j=this.session._changedWidgets,_=it.layerConfig;if(!(!j||!j.length)){for(var $=1/0,tt=0;tt0&&!_[$];)$--;this.firstRow=j.firstRow,this.lastRow=j.lastRow,it.$cursorLayer.config=j;for(var st=$;st<=tt;st++){var lt=_[st];if(!(!lt||!lt.el)){if(lt.hidden){lt.el.style.top=-100-(lt.pixelHeight||0)+"px";continue}lt._inDocument||(lt._inDocument=!0,it.container.appendChild(lt.el));var ct=it.$cursorLayer.getPixelPosition({row:st,column:0},!0).top;lt.coverLine||(ct+=j.lineHeight*this.session.getRowLineCount(lt.row)),lt.el.style.top=ct-j.offset+"px";var ht=lt.coverGutter?0:it.gutterWidth;lt.fixedWidth||(ht-=it.scrollLeft),lt.el.style.left=ht+"px",lt.fullWidth&<.screenWidth&&(lt.el.style.minWidth=j.width+2*j.padding+"px"),lt.fixedWidth?lt.el.style.right=it.scrollBar.getWidth()+"px":lt.el.style.right=""}}}},at}();a.LineWidgets=ot}),ace.define("ace/keyboard/gutter_handler",["require","exports","module","ace/lib/keys","ace/mouse/default_gutter_handler"],function(o,a,rt){var et=o("../lib/keys"),ot=o("../mouse/default_gutter_handler").GutterTooltip,at=function(){function it(j){this.editor=j,this.gutterLayer=j.renderer.$gutterLayer,this.element=j.renderer.$gutter,this.lines=j.renderer.$gutterLayer.$lines,this.activeRowIndex=null,this.activeLane=null,this.annotationTooltip=new ot(this.editor)}return it.prototype.addListener=function(){this.element.addEventListener("keydown",this.$onGutterKeyDown.bind(this)),this.element.addEventListener("focusout",this.$blurGutter.bind(this)),this.editor.on("mousewheel",this.$blurGutter.bind(this))},it.prototype.removeListener=function(){this.element.removeEventListener("keydown",this.$onGutterKeyDown.bind(this)),this.element.removeEventListener("focusout",this.$blurGutter.bind(this)),this.editor.off("mousewheel",this.$blurGutter.bind(this))},it.prototype.$onGutterKeyDown=function(j){if(this.annotationTooltip.isOpen){j.preventDefault(),j.keyCode===et.escape&&this.annotationTooltip.hideTooltip();return}if(j.target===this.element){if(j.keyCode!=et.enter)return;j.preventDefault();var _=this.editor.getCursorPosition().row;this.editor.isRowVisible(_)||this.editor.scrollToLine(_,!0,!0),setTimeout((function(){var $=this.$rowToRowIndex(this.gutterLayer.$cursorCell.row),tt=this.$findNearestFoldWidget($),st=this.$findNearestAnnotation($);if(!(tt===null&&st===null)){if(tt===null&&st!==null){this.activeRowIndex=st,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex);return}if(tt!==null&&st===null){this.activeRowIndex=tt,this.activeLane="fold",this.$focusFoldWidget(this.activeRowIndex);return}if(Math.abs(st-$)0||j+_=0&&this.$isFoldWidgetVisible(j-_))return j-_;if(j+_<=this.lines.getLength()-1&&this.$isFoldWidgetVisible(j+_))return j+_}return null},it.prototype.$findNearestAnnotation=function(j){if(this.$isAnnotationVisible(j))return j;for(var _=0;j-_>0||j+_=0&&this.$isAnnotationVisible(j-_))return j-_;if(j+_<=this.lines.getLength()-1&&this.$isAnnotationVisible(j+_))return j+_}return null},it.prototype.$focusFoldWidget=function(j){if(j!=null){var _=this.$getFoldWidget(j);_.classList.add(this.editor.renderer.keyboardFocusClassName),_.focus()}},it.prototype.$focusAnnotation=function(j){if(j!=null){var _=this.$getAnnotation(j);_.classList.add(this.editor.renderer.keyboardFocusClassName),_.focus()}},it.prototype.$blurFoldWidget=function(j){var _=this.$getFoldWidget(j);_.classList.remove(this.editor.renderer.keyboardFocusClassName),_.blur()},it.prototype.$blurAnnotation=function(j){var _=this.$getAnnotation(j);_.classList.remove(this.editor.renderer.keyboardFocusClassName),_.blur()},it.prototype.$moveFoldWidgetUp=function(){for(var j=this.activeRowIndex;j>0;)if(j--,this.$isFoldWidgetVisible(j)){this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=j,this.$focusFoldWidget(this.activeRowIndex);return}},it.prototype.$moveFoldWidgetDown=function(){for(var j=this.activeRowIndex;j0;)if(j--,this.$isAnnotationVisible(j)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=j,this.$focusAnnotation(this.activeRowIndex);return}},it.prototype.$moveAnnotationDown=function(){for(var j=this.activeRowIndex;j=kt.length&&(kt=void 0),{value:kt&&kt[It++],done:!kt}}};throw new TypeError(Tt?"Object is not iterable.":"Symbol.iterator is not defined.")},ot=o("./lib/oop"),at=o("./lib/dom"),nt=o("./lib/lang"),it=o("./lib/useragent"),j=o("./keyboard/textinput").TextInput,_=o("./mouse/mouse_handler").MouseHandler,$=o("./mouse/fold_handler").FoldHandler,tt=o("./keyboard/keybinding").KeyBinding,st=o("./edit_session").EditSession,lt=o("./search").Search,ct=o("./range").Range,ht=o("./lib/event_emitter").EventEmitter,ut=o("./commands/command_manager").CommandManager,pt=o("./commands/default_commands").commands,mt=o("./config"),gt=o("./token_iterator").TokenIterator,dt=o("./line_widgets").LineWidgets,St=o("./keyboard/gutter_handler").GutterKeyboardHandler,xt=o("./config").nls,yt=o("./clipboard"),_t=o("./lib/keys"),Ct=function(){function kt(Tt,$t,It){this.session,this.$toDestroy=[];var Ot=Tt.getContainerElement();this.container=Ot,this.renderer=Tt,this.id="editor"+ ++kt.$uid,this.commands=new ut(it.isMac?"mac":"win",pt),typeof document=="object"&&(this.textInput=new j(Tt.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new _(this),new $(this)),this.keyBinding=new tt(this),this.$search=new lt().set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=nt.delayedCall((function(){this._signal("input",{}),this.session&&!this.session.destroyed&&this.session.bgTokenizer.scheduleStart()}).bind(this)),this.on("change",function(Mt,Dt){Dt._$emitInputEvent.schedule(31)}),this.setSession($t||It&&It.session||new st("")),mt.resetOptions(this),It&&this.setOptions(It),mt._signal("editor",this)}return kt.prototype.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0),this.$opResetTimer=nt.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)},kt.prototype.startOperation=function(Tt){if(this.curOp){if(!Tt||this.curOp.command)return;this.prevOp=this.curOp}Tt||(this.previousCommand=null,Tt={}),this.$opResetTimer.schedule(),this.curOp=this.session.curOp={command:Tt.command||{},args:Tt.args,scrollTop:this.renderer.scrollTop},this.curOp.selectionBefore=this.selection.toJSON()},kt.prototype.endOperation=function(Tt){if(this.curOp&&this.session){if(Tt&&Tt.returnValue===!1||!this.session)return this.curOp=null;if(Tt==!0&&this.curOp.command&&this.curOp.command.name=="mouse"||(this._signal("beforeEndOperation"),!this.curOp))return;var $t=this.curOp.command,It=$t&&$t.scrollIntoView;if(It){switch(It){case"center-animate":It="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var Ot=this.selection.getRange(),Mt=this.renderer.layerConfig;(Ot.start.row>=Mt.lastRow||Ot.end.row<=Mt.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);break}It=="animate"&&this.renderer.animateScrolling(this.curOp.scrollTop)}var Dt=this.selection.toJSON();this.curOp.selectionAfter=Dt,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(Dt),this.prevOp=this.curOp,this.curOp=null}},kt.prototype.$historyTracker=function(Tt){if(this.$mergeUndoDeltas){var $t=this.prevOp,It=this.$mergeableCommands,Ot=$t.command&&Tt.command.name==$t.command.name;if(Tt.command.name=="insertstring"){var Mt=Tt.args;this.mergeNextCommand===void 0&&(this.mergeNextCommand=!0),Ot=Ot&&this.mergeNextCommand&&(!/\s/.test(Mt)||/\s/.test($t.args)),this.mergeNextCommand=!0}else Ot=Ot&&It.indexOf(Tt.command.name)!==-1;this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3&&(Ot=!1),Ot?this.session.mergeUndoDeltas=!0:It.indexOf(Tt.command.name)!==-1&&(this.sequenceStartTime=Date.now())}},kt.prototype.setKeyboardHandler=function(Tt,$t){if(Tt&&typeof Tt=="string"&&Tt!="ace"){this.$keybindingId=Tt;var It=this;mt.loadModule(["keybinding",Tt],function(Ot){It.$keybindingId==Tt&&It.keyBinding.setKeyboardHandler(Ot&&Ot.handler),$t&&$t()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(Tt),$t&&$t()},kt.prototype.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},kt.prototype.setSession=function(Tt){if(this.session!=Tt){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 It=this.session.getSelection();It.off("changeCursor",this.$onCursorChange),It.off("changeSelection",this.$onSelectionChange)}this.session=Tt,Tt?(this.$onDocumentChange=this.onDocumentChange.bind(this),Tt.on("change",this.$onDocumentChange),this.renderer.setSession(Tt),this.$onChangeMode=this.onChangeMode.bind(this),Tt.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),Tt.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),Tt.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),Tt.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),Tt.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),Tt.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=Tt.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(Tt)),this._signal("changeSession",{session:Tt,oldSession:$t}),this.curOp=null,$t&&$t._signal("changeEditor",{oldEditor:this}),Tt&&Tt._signal("changeEditor",{editor:this}),Tt&&!Tt.destroyed&&Tt.bgTokenizer.scheduleStart()}},kt.prototype.getSession=function(){return this.session},kt.prototype.setValue=function(Tt,$t){return this.session.doc.setValue(Tt),$t?$t==1?this.navigateFileEnd():$t==-1&&this.navigateFileStart():this.selectAll(),Tt},kt.prototype.getValue=function(){return this.session.getValue()},kt.prototype.getSelection=function(){return this.selection},kt.prototype.resize=function(Tt){this.renderer.onResize(Tt)},kt.prototype.setTheme=function(Tt,$t){this.renderer.setTheme(Tt,$t)},kt.prototype.getTheme=function(){return this.renderer.getTheme()},kt.prototype.setStyle=function(Tt){this.renderer.setStyle(Tt)},kt.prototype.unsetStyle=function(Tt){this.renderer.unsetStyle(Tt)},kt.prototype.getFontSize=function(){return this.getOption("fontSize")||at.computedStyle(this.container).fontSize},kt.prototype.setFontSize=function(Tt){this.setOption("fontSize",Tt)},kt.prototype.$highlightBrackets=function(){if(!this.$highlightPending){var Tt=this;this.$highlightPending=!0,setTimeout(function(){Tt.$highlightPending=!1;var $t=Tt.session;if(!(!$t||$t.destroyed)){$t.$bracketHighlight&&($t.$bracketHighlight.markerIds.forEach(function(Ht){$t.removeMarker(Ht)}),$t.$bracketHighlight=null);var It=Tt.getCursorPosition(),Ot=Tt.getKeyboardHandler(),Mt=Ot&&Ot.$getDirectionForHighlight&&Ot.$getDirectionForHighlight(Tt),Dt=$t.getMatchingBracketRanges(It,Mt);if(!Dt){var Bt=new gt($t,It.row,It.column),Kt=Bt.getCurrentToken();if(Kt&&/\b(?:tag-open|tag-name)/.test(Kt.type)){var Wt=$t.getMatchingTags(It);Wt&&(Dt=[Wt.openTagName.isEmpty()?Wt.openTag:Wt.openTagName,Wt.closeTagName.isEmpty()?Wt.closeTag:Wt.closeTagName])}}if(!Dt&&$t.$mode.getMatching&&(Dt=$t.$mode.getMatching(Tt.session)),!Dt){Tt.getHighlightIndentGuides()&&Tt.renderer.$textLayer.$highlightIndentGuide();return}var zt="ace_bracket";Array.isArray(Dt)?Dt.length==1&&(zt="ace_error_bracket"):Dt=[Dt],Dt.length==2&&(ct.comparePoints(Dt[0].end,Dt[1].start)==0?Dt=[ct.fromPoints(Dt[0].start,Dt[1].end)]:ct.comparePoints(Dt[0].start,Dt[1].end)==0&&(Dt=[ct.fromPoints(Dt[1].start,Dt[0].end)])),$t.$bracketHighlight={ranges:Dt,markerIds:Dt.map(function(Ht){return $t.addMarker(Ht,zt,"text")})},Tt.getHighlightIndentGuides()&&Tt.renderer.$textLayer.$highlightIndentGuide()}},50)}},kt.prototype.focus=function(){this.textInput.focus()},kt.prototype.isFocused=function(){return this.textInput.isFocused()},kt.prototype.blur=function(){this.textInput.blur()},kt.prototype.onFocus=function(Tt){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",Tt))},kt.prototype.onBlur=function(Tt){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",Tt))},kt.prototype.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$updateHighlightActiveLine()},kt.prototype.onDocumentChange=function(Tt){var $t=this.session.$useWrapMode,It=Tt.start.row==Tt.end.row?Tt.end.row:1/0;this.renderer.updateLines(Tt.start.row,It,$t),this._signal("change",Tt),this.$cursorChange()},kt.prototype.onTokenizerUpdate=function(Tt){var $t=Tt.data;this.renderer.updateLines($t.first,$t.last)},kt.prototype.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},kt.prototype.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},kt.prototype.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection")},kt.prototype.$updateHighlightActiveLine=function(){var Tt=this.getSession(),$t;if(this.$highlightActiveLine&&((this.$selectionStyle!="line"||!this.selection.isMultiLine())&&($t=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&($t=!1),this.renderer.$maxLines&&this.session.getLength()===1&&!(this.renderer.$minLines>1)&&($t=!1)),Tt.$highlightLineMarker&&!$t)Tt.removeMarker(Tt.$highlightLineMarker.id),Tt.$highlightLineMarker=null;else if(!Tt.$highlightLineMarker&&$t){var It=new ct($t.row,$t.column,$t.row,1/0);It.id=Tt.addMarker(It,"ace_active-line","screenLine"),Tt.$highlightLineMarker=It}else $t&&(Tt.$highlightLineMarker.start.row=$t.row,Tt.$highlightLineMarker.end.row=$t.row,Tt.$highlightLineMarker.start.column=$t.column,Tt._signal("changeBackMarker"))},kt.prototype.onSelectionChange=function(Tt){var $t=this.session;if($t.$selectionMarker&&$t.removeMarker($t.$selectionMarker),$t.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var It=this.selection.getRange(),Ot=this.getSelectionStyle();$t.$selectionMarker=$t.addMarker(It,"ace_selection",Ot)}var Mt=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(Mt),this._signal("changeSelection")},kt.prototype.$getSelectionHighLightRegexp=function(){var Tt=this.session,$t=this.getSelectionRange();if(!($t.isEmpty()||$t.isMultiLine())){var It=$t.start.column,Ot=$t.end.column,Mt=Tt.getLine($t.start.row),Dt=Mt.substring(It,Ot);if(!(Dt.length>5e3||!/[\w\d]/.test(Dt))){var Bt=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:Dt}),Kt=Mt.substring(It-1,Ot+1);if(Bt.test(Kt))return Bt}}},kt.prototype.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},kt.prototype.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},kt.prototype.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},kt.prototype.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},kt.prototype.onChangeMode=function(Tt){this.renderer.updateText(),this._emit("changeMode",Tt)},kt.prototype.onChangeWrapLimit=function(){this.renderer.updateFull()},kt.prototype.onChangeWrapMode=function(){this.renderer.onResize(!0)},kt.prototype.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},kt.prototype.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},kt.prototype.getCopyText=function(){var Tt=this.getSelectedText(),$t=this.session.doc.getNewLineCharacter(),It=!1;if(!Tt&&this.$copyWithEmptySelection){It=!0;for(var Ot=this.selection.getAllRanges(),Mt=0;Mtit[j].column&&j++,et.unshift(j,0),it.splice.apply(it,et),this.$updateRows()}}},at.prototype.$updateRows=function(){var nt=this.session.lineWidgets;if(nt){var it=!0;nt.forEach(function(j,_){if(j)for(it=!1,j.row=_;j.$oldWidget;)j.$oldWidget.row=_,j=j.$oldWidget}),it&&(this.session.lineWidgets=null)}},at.prototype.$registerLineWidget=function(nt){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var it=this.session.lineWidgets[nt.row];return it&&(nt.$oldWidget=it,it.el&&it.el.parentNode&&(it.el.parentNode.removeChild(it.el),it._inDocument=!1)),this.session.lineWidgets[nt.row]=nt,nt},at.prototype.addLineWidget=function(nt){if(this.$registerLineWidget(nt),nt.session=this.session,!this.editor)return nt;var it=this.editor.renderer;nt.html&&!nt.el&&(nt.el=tt.createElement("div"),nt.el.innerHTML=nt.html),nt.text&&!nt.el&&(nt.el=tt.createElement("div"),nt.el.textContent=nt.text),nt.el&&(tt.addCssClass(nt.el,"ace_lineWidgetContainer"),nt.className&&tt.addCssClass(nt.el,nt.className),nt.el.style.position="absolute",nt.el.style.zIndex="5",it.container.appendChild(nt.el),nt._inDocument=!0,nt.coverGutter||(nt.el.style.zIndex="3"),nt.pixelHeight==null&&(nt.pixelHeight=nt.el.offsetHeight)),nt.rowCount==null&&(nt.rowCount=nt.pixelHeight/it.layerConfig.lineHeight);var j=this.session.getFoldAt(nt.row,0);if(nt.$fold=j,j){var _=this.session.lineWidgets;nt.row==j.end.row&&!_[j.start.row]?_[j.start.row]=nt:nt.hidden=!0}return this.session._emit("changeFold",{data:{start:{row:nt.row}}}),this.$updateRows(),this.renderWidgets(null,it),this.onWidgetChanged(nt),nt},at.prototype.removeLineWidget=function(nt){if(nt._inDocument=!1,nt.session=null,nt.el&&nt.el.parentNode&&nt.el.parentNode.removeChild(nt.el),nt.editor&&nt.editor.destroy)try{nt.editor.destroy()}catch{}if(this.session.lineWidgets){var it=this.session.lineWidgets[nt.row];if(it==nt)this.session.lineWidgets[nt.row]=nt.$oldWidget,nt.$oldWidget&&this.onWidgetChanged(nt.$oldWidget);else for(;it;){if(it.$oldWidget==nt){it.$oldWidget=nt.$oldWidget;break}it=it.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:nt.row}}}),this.$updateRows()},at.prototype.getWidgetsAtRow=function(nt){for(var it=this.session.lineWidgets,j=it&&it[nt],_=[];j;)_.push(j),j=j.$oldWidget;return _},at.prototype.onWidgetChanged=function(nt){this.session._changedWidgets.push(nt),this.editor&&this.editor.renderer.updateFull()},at.prototype.measureWidgets=function(nt,it){var j=this.session._changedWidgets,_=it.layerConfig;if(!(!j||!j.length)){for(var $=1/0,et=0;et0&&!_[$];)$--;this.firstRow=j.firstRow,this.lastRow=j.lastRow,it.$cursorLayer.config=j;for(var st=$;st<=et;st++){var lt=_[st];if(!(!lt||!lt.el)){if(lt.hidden){lt.el.style.top=-100-(lt.pixelHeight||0)+"px";continue}lt._inDocument||(lt._inDocument=!0,it.container.appendChild(lt.el));var ct=it.$cursorLayer.getPixelPosition({row:st,column:0},!0).top;lt.coverLine||(ct+=j.lineHeight*this.session.getRowLineCount(lt.row)),lt.el.style.top=ct-j.offset+"px";var ht=lt.coverGutter?0:it.gutterWidth;lt.fixedWidth||(ht-=it.scrollLeft),lt.el.style.left=ht+"px",lt.fullWidth&<.screenWidth&&(lt.el.style.minWidth=j.width+2*j.padding+"px"),lt.fixedWidth?lt.el.style.right=it.scrollBar.getWidth()+"px":lt.el.style.right=""}}}},at}();a.LineWidgets=ot}),ace.define("ace/keyboard/gutter_handler",["require","exports","module","ace/lib/keys","ace/mouse/default_gutter_handler"],function(o,a,rt){var tt=o("../lib/keys"),ot=o("../mouse/default_gutter_handler").GutterTooltip,at=function(){function it(j){this.editor=j,this.gutterLayer=j.renderer.$gutterLayer,this.element=j.renderer.$gutter,this.lines=j.renderer.$gutterLayer.$lines,this.activeRowIndex=null,this.activeLane=null,this.annotationTooltip=new ot(this.editor)}return it.prototype.addListener=function(){this.element.addEventListener("keydown",this.$onGutterKeyDown.bind(this)),this.element.addEventListener("focusout",this.$blurGutter.bind(this)),this.editor.on("mousewheel",this.$blurGutter.bind(this))},it.prototype.removeListener=function(){this.element.removeEventListener("keydown",this.$onGutterKeyDown.bind(this)),this.element.removeEventListener("focusout",this.$blurGutter.bind(this)),this.editor.off("mousewheel",this.$blurGutter.bind(this))},it.prototype.$onGutterKeyDown=function(j){if(this.annotationTooltip.isOpen){j.preventDefault(),j.keyCode===tt.escape&&this.annotationTooltip.hideTooltip();return}if(j.target===this.element){if(j.keyCode!=tt.enter)return;j.preventDefault();var _=this.editor.getCursorPosition().row;this.editor.isRowVisible(_)||this.editor.scrollToLine(_,!0,!0),setTimeout((function(){var $=this.$rowToRowIndex(this.gutterLayer.$cursorCell.row),et=this.$findNearestFoldWidget($),st=this.$findNearestAnnotation($);if(!(et===null&&st===null)){if(et===null&&st!==null){this.activeRowIndex=st,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex);return}if(et!==null&&st===null){this.activeRowIndex=et,this.activeLane="fold",this.$focusFoldWidget(this.activeRowIndex);return}if(Math.abs(st-$)0||j+_=0&&this.$isFoldWidgetVisible(j-_))return j-_;if(j+_<=this.lines.getLength()-1&&this.$isFoldWidgetVisible(j+_))return j+_}return null},it.prototype.$findNearestAnnotation=function(j){if(this.$isAnnotationVisible(j))return j;for(var _=0;j-_>0||j+_=0&&this.$isAnnotationVisible(j-_))return j-_;if(j+_<=this.lines.getLength()-1&&this.$isAnnotationVisible(j+_))return j+_}return null},it.prototype.$focusFoldWidget=function(j){if(j!=null){var _=this.$getFoldWidget(j);_.classList.add(this.editor.renderer.keyboardFocusClassName),_.focus()}},it.prototype.$focusAnnotation=function(j){if(j!=null){var _=this.$getAnnotation(j);_.classList.add(this.editor.renderer.keyboardFocusClassName),_.focus()}},it.prototype.$blurFoldWidget=function(j){var _=this.$getFoldWidget(j);_.classList.remove(this.editor.renderer.keyboardFocusClassName),_.blur()},it.prototype.$blurAnnotation=function(j){var _=this.$getAnnotation(j);_.classList.remove(this.editor.renderer.keyboardFocusClassName),_.blur()},it.prototype.$moveFoldWidgetUp=function(){for(var j=this.activeRowIndex;j>0;)if(j--,this.$isFoldWidgetVisible(j)){this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=j,this.$focusFoldWidget(this.activeRowIndex);return}},it.prototype.$moveFoldWidgetDown=function(){for(var j=this.activeRowIndex;j0;)if(j--,this.$isAnnotationVisible(j)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=j,this.$focusAnnotation(this.activeRowIndex);return}},it.prototype.$moveAnnotationDown=function(){for(var j=this.activeRowIndex;j=kt.length&&(kt=void 0),{value:kt&&kt[It++],done:!kt}}};throw new TypeError(Tt?"Object is not iterable.":"Symbol.iterator is not defined.")},ot=o("./lib/oop"),at=o("./lib/dom"),nt=o("./lib/lang"),it=o("./lib/useragent"),j=o("./keyboard/textinput").TextInput,_=o("./mouse/mouse_handler").MouseHandler,$=o("./mouse/fold_handler").FoldHandler,et=o("./keyboard/keybinding").KeyBinding,st=o("./edit_session").EditSession,lt=o("./search").Search,ct=o("./range").Range,ht=o("./lib/event_emitter").EventEmitter,ut=o("./commands/command_manager").CommandManager,pt=o("./commands/default_commands").commands,mt=o("./config"),gt=o("./token_iterator").TokenIterator,dt=o("./line_widgets").LineWidgets,St=o("./keyboard/gutter_handler").GutterKeyboardHandler,xt=o("./config").nls,yt=o("./clipboard"),_t=o("./lib/keys"),Ct=function(){function kt(Tt,$t,It){this.session,this.$toDestroy=[];var Ot=Tt.getContainerElement();this.container=Ot,this.renderer=Tt,this.id="editor"+ ++kt.$uid,this.commands=new ut(it.isMac?"mac":"win",pt),typeof document=="object"&&(this.textInput=new j(Tt.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new _(this),new $(this)),this.keyBinding=new et(this),this.$search=new lt().set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=nt.delayedCall((function(){this._signal("input",{}),this.session&&!this.session.destroyed&&this.session.bgTokenizer.scheduleStart()}).bind(this)),this.on("change",function(Mt,Dt){Dt._$emitInputEvent.schedule(31)}),this.setSession($t||It&&It.session||new st("")),mt.resetOptions(this),It&&this.setOptions(It),mt._signal("editor",this)}return kt.prototype.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0),this.$opResetTimer=nt.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)},kt.prototype.startOperation=function(Tt){if(this.curOp){if(!Tt||this.curOp.command)return;this.prevOp=this.curOp}Tt||(this.previousCommand=null,Tt={}),this.$opResetTimer.schedule(),this.curOp=this.session.curOp={command:Tt.command||{},args:Tt.args,scrollTop:this.renderer.scrollTop},this.curOp.selectionBefore=this.selection.toJSON()},kt.prototype.endOperation=function(Tt){if(this.curOp&&this.session){if(Tt&&Tt.returnValue===!1||!this.session)return this.curOp=null;if(Tt==!0&&this.curOp.command&&this.curOp.command.name=="mouse"||(this._signal("beforeEndOperation"),!this.curOp))return;var $t=this.curOp.command,It=$t&&$t.scrollIntoView;if(It){switch(It){case"center-animate":It="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var Ot=this.selection.getRange(),Mt=this.renderer.layerConfig;(Ot.start.row>=Mt.lastRow||Ot.end.row<=Mt.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);break}It=="animate"&&this.renderer.animateScrolling(this.curOp.scrollTop)}var Dt=this.selection.toJSON();this.curOp.selectionAfter=Dt,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(Dt),this.prevOp=this.curOp,this.curOp=null}},kt.prototype.$historyTracker=function(Tt){if(this.$mergeUndoDeltas){var $t=this.prevOp,It=this.$mergeableCommands,Ot=$t.command&&Tt.command.name==$t.command.name;if(Tt.command.name=="insertstring"){var Mt=Tt.args;this.mergeNextCommand===void 0&&(this.mergeNextCommand=!0),Ot=Ot&&this.mergeNextCommand&&(!/\s/.test(Mt)||/\s/.test($t.args)),this.mergeNextCommand=!0}else Ot=Ot&&It.indexOf(Tt.command.name)!==-1;this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3&&(Ot=!1),Ot?this.session.mergeUndoDeltas=!0:It.indexOf(Tt.command.name)!==-1&&(this.sequenceStartTime=Date.now())}},kt.prototype.setKeyboardHandler=function(Tt,$t){if(Tt&&typeof Tt=="string"&&Tt!="ace"){this.$keybindingId=Tt;var It=this;mt.loadModule(["keybinding",Tt],function(Ot){It.$keybindingId==Tt&&It.keyBinding.setKeyboardHandler(Ot&&Ot.handler),$t&&$t()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(Tt),$t&&$t()},kt.prototype.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},kt.prototype.setSession=function(Tt){if(this.session!=Tt){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 It=this.session.getSelection();It.off("changeCursor",this.$onCursorChange),It.off("changeSelection",this.$onSelectionChange)}this.session=Tt,Tt?(this.$onDocumentChange=this.onDocumentChange.bind(this),Tt.on("change",this.$onDocumentChange),this.renderer.setSession(Tt),this.$onChangeMode=this.onChangeMode.bind(this),Tt.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),Tt.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),Tt.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),Tt.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),Tt.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),Tt.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=Tt.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(Tt)),this._signal("changeSession",{session:Tt,oldSession:$t}),this.curOp=null,$t&&$t._signal("changeEditor",{oldEditor:this}),Tt&&Tt._signal("changeEditor",{editor:this}),Tt&&!Tt.destroyed&&Tt.bgTokenizer.scheduleStart()}},kt.prototype.getSession=function(){return this.session},kt.prototype.setValue=function(Tt,$t){return this.session.doc.setValue(Tt),$t?$t==1?this.navigateFileEnd():$t==-1&&this.navigateFileStart():this.selectAll(),Tt},kt.prototype.getValue=function(){return this.session.getValue()},kt.prototype.getSelection=function(){return this.selection},kt.prototype.resize=function(Tt){this.renderer.onResize(Tt)},kt.prototype.setTheme=function(Tt,$t){this.renderer.setTheme(Tt,$t)},kt.prototype.getTheme=function(){return this.renderer.getTheme()},kt.prototype.setStyle=function(Tt){this.renderer.setStyle(Tt)},kt.prototype.unsetStyle=function(Tt){this.renderer.unsetStyle(Tt)},kt.prototype.getFontSize=function(){return this.getOption("fontSize")||at.computedStyle(this.container).fontSize},kt.prototype.setFontSize=function(Tt){this.setOption("fontSize",Tt)},kt.prototype.$highlightBrackets=function(){if(!this.$highlightPending){var Tt=this;this.$highlightPending=!0,setTimeout(function(){Tt.$highlightPending=!1;var $t=Tt.session;if(!(!$t||$t.destroyed)){$t.$bracketHighlight&&($t.$bracketHighlight.markerIds.forEach(function(Ht){$t.removeMarker(Ht)}),$t.$bracketHighlight=null);var It=Tt.getCursorPosition(),Ot=Tt.getKeyboardHandler(),Mt=Ot&&Ot.$getDirectionForHighlight&&Ot.$getDirectionForHighlight(Tt),Dt=$t.getMatchingBracketRanges(It,Mt);if(!Dt){var Bt=new gt($t,It.row,It.column),Kt=Bt.getCurrentToken();if(Kt&&/\b(?:tag-open|tag-name)/.test(Kt.type)){var Wt=$t.getMatchingTags(It);Wt&&(Dt=[Wt.openTagName.isEmpty()?Wt.openTag:Wt.openTagName,Wt.closeTagName.isEmpty()?Wt.closeTag:Wt.closeTagName])}}if(!Dt&&$t.$mode.getMatching&&(Dt=$t.$mode.getMatching(Tt.session)),!Dt){Tt.getHighlightIndentGuides()&&Tt.renderer.$textLayer.$highlightIndentGuide();return}var zt="ace_bracket";Array.isArray(Dt)?Dt.length==1&&(zt="ace_error_bracket"):Dt=[Dt],Dt.length==2&&(ct.comparePoints(Dt[0].end,Dt[1].start)==0?Dt=[ct.fromPoints(Dt[0].start,Dt[1].end)]:ct.comparePoints(Dt[0].start,Dt[1].end)==0&&(Dt=[ct.fromPoints(Dt[1].start,Dt[0].end)])),$t.$bracketHighlight={ranges:Dt,markerIds:Dt.map(function(Ht){return $t.addMarker(Ht,zt,"text")})},Tt.getHighlightIndentGuides()&&Tt.renderer.$textLayer.$highlightIndentGuide()}},50)}},kt.prototype.focus=function(){this.textInput.focus()},kt.prototype.isFocused=function(){return this.textInput.isFocused()},kt.prototype.blur=function(){this.textInput.blur()},kt.prototype.onFocus=function(Tt){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",Tt))},kt.prototype.onBlur=function(Tt){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",Tt))},kt.prototype.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$updateHighlightActiveLine()},kt.prototype.onDocumentChange=function(Tt){var $t=this.session.$useWrapMode,It=Tt.start.row==Tt.end.row?Tt.end.row:1/0;this.renderer.updateLines(Tt.start.row,It,$t),this._signal("change",Tt),this.$cursorChange()},kt.prototype.onTokenizerUpdate=function(Tt){var $t=Tt.data;this.renderer.updateLines($t.first,$t.last)},kt.prototype.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},kt.prototype.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},kt.prototype.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection")},kt.prototype.$updateHighlightActiveLine=function(){var Tt=this.getSession(),$t;if(this.$highlightActiveLine&&((this.$selectionStyle!="line"||!this.selection.isMultiLine())&&($t=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&($t=!1),this.renderer.$maxLines&&this.session.getLength()===1&&!(this.renderer.$minLines>1)&&($t=!1)),Tt.$highlightLineMarker&&!$t)Tt.removeMarker(Tt.$highlightLineMarker.id),Tt.$highlightLineMarker=null;else if(!Tt.$highlightLineMarker&&$t){var It=new ct($t.row,$t.column,$t.row,1/0);It.id=Tt.addMarker(It,"ace_active-line","screenLine"),Tt.$highlightLineMarker=It}else $t&&(Tt.$highlightLineMarker.start.row=$t.row,Tt.$highlightLineMarker.end.row=$t.row,Tt.$highlightLineMarker.start.column=$t.column,Tt._signal("changeBackMarker"))},kt.prototype.onSelectionChange=function(Tt){var $t=this.session;if($t.$selectionMarker&&$t.removeMarker($t.$selectionMarker),$t.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var It=this.selection.getRange(),Ot=this.getSelectionStyle();$t.$selectionMarker=$t.addMarker(It,"ace_selection",Ot)}var Mt=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(Mt),this._signal("changeSelection")},kt.prototype.$getSelectionHighLightRegexp=function(){var Tt=this.session,$t=this.getSelectionRange();if(!($t.isEmpty()||$t.isMultiLine())){var It=$t.start.column,Ot=$t.end.column,Mt=Tt.getLine($t.start.row),Dt=Mt.substring(It,Ot);if(!(Dt.length>5e3||!/[\w\d]/.test(Dt))){var Bt=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:Dt}),Kt=Mt.substring(It-1,Ot+1);if(Bt.test(Kt))return Bt}}},kt.prototype.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},kt.prototype.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},kt.prototype.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},kt.prototype.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},kt.prototype.onChangeMode=function(Tt){this.renderer.updateText(),this._emit("changeMode",Tt)},kt.prototype.onChangeWrapLimit=function(){this.renderer.updateFull()},kt.prototype.onChangeWrapMode=function(){this.renderer.onResize(!0)},kt.prototype.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},kt.prototype.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},kt.prototype.getCopyText=function(){var Tt=this.getSelectedText(),$t=this.session.doc.getNewLineCharacter(),It=!1;if(!Tt&&this.$copyWithEmptySelection){It=!0;for(var Ot=this.selection.getAllRanges(),Mt=0;MtHt.search(/\S|$/)){var Kt=Ht.substr(Mt.column).search(/\S|$/);It.doc.removeInLine(Mt.row,Mt.column,Mt.column+Kt)}}this.clearSelection();var Wt=Mt.column,zt=It.getState(Mt.row),Ht=It.getLine(Mt.row),Zt=Ot.checkOutdent(zt,Ht,Tt);if(It.insert(Mt,Tt),Dt&&Dt.selection&&(Dt.selection.length==2?this.selection.setSelectionRange(new ct(Mt.row,Wt+Dt.selection[0],Mt.row,Wt+Dt.selection[1])):this.selection.setSelectionRange(new ct(Mt.row+Dt.selection[0],Dt.selection[1],Mt.row+Dt.selection[2],Dt.selection[3]))),this.$enableAutoIndent){if(It.getDocument().isNewLine(Tt)){var qt=Ot.getNextLineIndent(zt,Ht.slice(0,Mt.column),It.getTabString());It.insert({row:Mt.row+1,column:0},qt)}Zt&&Ot.autoOutdent(zt,It,Mt.row)}},kt.prototype.autoIndent=function(){for(var Tt=this.session,$t=Tt.getMode(),It=this.selection.isEmpty()?[new ct(0,0,Tt.doc.getLength()-1,0)]:this.selection.getAllRanges(),Ot="",Mt="",Dt="",Bt=Tt.getTabString(),Kt=0;Kt0&&(Ot=Tt.getState(Ht-1),Mt=Tt.getLine(Ht-1),Dt=$t.getNextLineIndent(Ot,Mt,Bt));var Zt=Tt.getLine(Ht),qt=$t.$getIndent(Zt);if(Dt!==qt){if(qt.length>0){var hr=new ct(Ht,0,Ht,qt.length);Tt.remove(hr)}Dt.length>0&&Tt.insert({row:Ht,column:0},Dt)}$t.autoOutdent(Ot,Tt,Ht)}},kt.prototype.onTextInput=function(Tt,$t){if(!$t)return this.keyBinding.onTextInput(Tt);this.startOperation({command:{name:"insertstring"}});var It=this.applyComposition.bind(this,Tt,$t);this.selection.rangeCount?this.forEachSelection(It):It(),this.endOperation()},kt.prototype.applyComposition=function(Tt,$t){if($t.extendLeft||$t.extendRight){var It=this.selection.getRange();It.start.column-=$t.extendLeft,It.end.column+=$t.extendRight,It.start.column<0&&(It.start.row--,It.start.column+=this.session.getLine(It.start.row).length+1),this.selection.setRange(It),!Tt&&!It.isEmpty()&&this.remove()}if((Tt||!this.selection.isEmpty())&&this.insert(Tt,!0),$t.restoreStart||$t.restoreEnd){var It=this.selection.getRange();It.start.column-=$t.restoreStart,It.end.column-=$t.restoreEnd,this.selection.setRange(It)}},kt.prototype.onCommandKey=function(Tt,$t,It){return this.keyBinding.onCommandKey(Tt,$t,It)},kt.prototype.setOverwrite=function(Tt){this.session.setOverwrite(Tt)},kt.prototype.getOverwrite=function(){return this.session.getOverwrite()},kt.prototype.toggleOverwrite=function(){this.session.toggleOverwrite()},kt.prototype.setScrollSpeed=function(Tt){this.setOption("scrollSpeed",Tt)},kt.prototype.getScrollSpeed=function(){return this.getOption("scrollSpeed")},kt.prototype.setDragDelay=function(Tt){this.setOption("dragDelay",Tt)},kt.prototype.getDragDelay=function(){return this.getOption("dragDelay")},kt.prototype.setSelectionStyle=function(Tt){this.setOption("selectionStyle",Tt)},kt.prototype.getSelectionStyle=function(){return this.getOption("selectionStyle")},kt.prototype.setHighlightActiveLine=function(Tt){this.setOption("highlightActiveLine",Tt)},kt.prototype.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},kt.prototype.setHighlightGutterLine=function(Tt){this.setOption("highlightGutterLine",Tt)},kt.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},kt.prototype.setHighlightSelectedWord=function(Tt){this.setOption("highlightSelectedWord",Tt)},kt.prototype.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},kt.prototype.setAnimatedScroll=function(Tt){this.renderer.setAnimatedScroll(Tt)},kt.prototype.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},kt.prototype.setShowInvisibles=function(Tt){this.renderer.setShowInvisibles(Tt)},kt.prototype.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},kt.prototype.setDisplayIndentGuides=function(Tt){this.renderer.setDisplayIndentGuides(Tt)},kt.prototype.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},kt.prototype.setHighlightIndentGuides=function(Tt){this.renderer.setHighlightIndentGuides(Tt)},kt.prototype.getHighlightIndentGuides=function(){return this.renderer.getHighlightIndentGuides()},kt.prototype.setShowPrintMargin=function(Tt){this.renderer.setShowPrintMargin(Tt)},kt.prototype.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},kt.prototype.setPrintMarginColumn=function(Tt){this.renderer.setPrintMarginColumn(Tt)},kt.prototype.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},kt.prototype.setReadOnly=function(Tt){this.setOption("readOnly",Tt)},kt.prototype.getReadOnly=function(){return this.getOption("readOnly")},kt.prototype.setBehavioursEnabled=function(Tt){this.setOption("behavioursEnabled",Tt)},kt.prototype.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},kt.prototype.setWrapBehavioursEnabled=function(Tt){this.setOption("wrapBehavioursEnabled",Tt)},kt.prototype.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},kt.prototype.setShowFoldWidgets=function(Tt){this.setOption("showFoldWidgets",Tt)},kt.prototype.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},kt.prototype.setFadeFoldWidgets=function(Tt){this.setOption("fadeFoldWidgets",Tt)},kt.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},kt.prototype.remove=function(Tt){this.selection.isEmpty()&&(Tt=="left"?this.selection.selectLeft():this.selection.selectRight());var $t=this.getSelectionRange();if(this.getBehavioursEnabled()){var It=this.session,Ot=It.getState($t.start.row),Mt=It.getMode().transformAction(Ot,"deletion",this,It,$t);if($t.end.column===0){var Dt=It.getTextRange($t);if(Dt[Dt.length-1]==` `){var Bt=It.getLine($t.end.row);/^\s+$/.test(Bt)&&($t.end.column=Bt.length)}}Mt&&($t=Mt)}this.session.remove($t),this.clearSelection()},kt.prototype.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},kt.prototype.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},kt.prototype.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},kt.prototype.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var Tt=this.getSelectionRange();Tt.start.column==Tt.end.column&&Tt.start.row==Tt.end.row&&(Tt.end.column=0,Tt.end.row++),this.session.remove(Tt),this.clearSelection()},kt.prototype.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var Tt=this.getCursorPosition();this.insert(` -`),this.moveCursorToPosition(Tt)},kt.prototype.setGhostText=function(Tt,$t){this.session.widgetManager||(this.session.widgetManager=new dt(this.session),this.session.widgetManager.attach(this)),this.renderer.setGhostText(Tt,$t)},kt.prototype.removeGhostText=function(){this.session.widgetManager&&this.renderer.removeGhostText()},kt.prototype.transposeLetters=function(){if(this.selection.isEmpty()){var Tt=this.getCursorPosition(),$t=Tt.column;if($t!==0){var It=this.session.getLine(Tt.row),Ot,Mt;$tKt.toLowerCase()?1:0});for(var Mt=new ct(0,0,0,0),Ot=Tt.first;Ot<=Tt.last;Ot++){var Dt=$t.getLine(Ot);Mt.start.row=Ot,Mt.end.row=Ot,Mt.end.column=Dt.length,$t.replace(Mt,It[Ot-Tt.first])}},kt.prototype.toggleCommentLines=function(){var Tt=this.session.getState(this.getCursorPosition().row),$t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(Tt,this.session,$t.first,$t.last)},kt.prototype.toggleBlockComment=function(){var Tt=this.getCursorPosition(),$t=this.session.getState(Tt.row),It=this.getSelectionRange();this.session.getMode().toggleBlockComment($t,this.session,It,Tt)},kt.prototype.getNumberAt=function(Tt,$t){var It=/[\-]?[0-9]+(?:\.[0-9]+)?/g;It.lastIndex=0;for(var Ot=this.session.getLine(Tt);It.lastIndex<$t;){var Mt=It.exec(Ot);if(Mt.index<=$t&&Mt.index+Mt[0].length>=$t){var Dt={value:Mt[0],start:Mt.index,end:Mt.index+Mt[0].length};return Dt}}return null},kt.prototype.modifyNumber=function(Tt){var $t=this.selection.getCursor().row,It=this.selection.getCursor().column,Ot=new ct($t,It-1,$t,It),Mt=this.session.getTextRange(Ot);if(!isNaN(parseFloat(Mt))&&isFinite(Mt)){var Dt=this.getNumberAt($t,It);if(Dt){var Bt=Dt.value.indexOf(".")>=0?Dt.start+Dt.value.indexOf(".")+1:Dt.end,Kt=Dt.start+Dt.value.length-Bt,Wt=parseFloat(Dt.value);Wt*=Math.pow(10,Kt),Bt!==Dt.end&&It=Bt&&Dt<=Kt&&(It=tr,Wt.selection.clearSelection(),Wt.moveCursorTo(Tt,Bt+Ot),Wt.selection.selectTo(Tt,Kt+Ot)),Bt=Kt});for(var zt=this.$toggleWordPairs,Ht,Zt=0;Zt=Kt&&Bt<=Wt&&qt.match(/((?:https?|ftp):\/\/[\S]+)/)){zt=qt.replace(/[\s:.,'";}\]]+$/,"");break}Kt=Wt}}catch(hr){It={error:hr}}finally{try{Zt&&!Zt.done&&(Ot=Ht.return)&&Ot.call(Ht)}finally{if(It)throw It.error}}return zt},kt.prototype.openLink=function(){var Tt=this.selection.getCursor(),$t=this.findLinkAt(Tt.row,Tt.column);return $t&&window.open($t,"_blank"),$t!=null},kt.prototype.removeLines=function(){var Tt=this.$getSelectedRows();this.session.removeFullLines(Tt.first,Tt.last),this.clearSelection()},kt.prototype.duplicateSelection=function(){var Tt=this.selection,$t=this.session,It=Tt.getRange(),Ot=Tt.isBackwards();if(It.isEmpty()){var Mt=It.start.row;$t.duplicateLines(Mt,Mt)}else{var Dt=Ot?It.start:It.end,Bt=$t.insert(Dt,$t.getTextRange(It));It.start=Dt,It.end=Bt,Tt.setSelectionRange(It,Ot)}},kt.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},kt.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},kt.prototype.moveText=function(Tt,$t,It){return this.session.moveText(Tt,$t,It)},kt.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},kt.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},kt.prototype.$moveLines=function(Tt,$t){var It,Ot,Mt=this.selection;if(!Mt.inMultiSelectMode||this.inVirtualSelectionMode){var Dt=Mt.toOrientedRange();It=this.$getSelectedRows(Dt),Ot=this.session.$moveLines(It.first,It.last,$t?0:Tt),$t&&Tt==-1&&(Ot=0),Dt.moveBy(Ot,0),Mt.fromOrientedRange(Dt)}else{var Bt=Mt.rangeList.ranges;Mt.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var Kt=0,Wt=0,zt=Bt.length,Ht=0;Hthr+1)break;hr=fr.last}for(Ht--,Kt=this.session.$moveLines(qt,hr,$t?0:Tt),$t&&Tt==-1&&(Zt=Ht+1);Zt<=Ht;)Bt[Zt].moveBy(Kt,0),Zt++;$t||(Kt=0),Wt+=Kt}Mt.fromOrientedRange(Mt.ranges[0]),Mt.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},kt.prototype.$getSelectedRows=function(Tt){return Tt=(Tt||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(Tt.start.row),last:this.session.getRowFoldEnd(Tt.end.row)}},kt.prototype.onCompositionStart=function(Tt){this.renderer.showComposition(Tt)},kt.prototype.onCompositionUpdate=function(Tt){this.renderer.setCompositionText(Tt)},kt.prototype.onCompositionEnd=function(){this.renderer.hideComposition()},kt.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},kt.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},kt.prototype.isRowVisible=function(Tt){return Tt>=this.getFirstVisibleRow()&&Tt<=this.getLastVisibleRow()},kt.prototype.isRowFullyVisible=function(Tt){return Tt>=this.renderer.getFirstFullyVisibleRow()&&Tt<=this.renderer.getLastFullyVisibleRow()},kt.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},kt.prototype.$moveByPage=function(Tt,$t){var It=this.renderer,Ot=this.renderer.layerConfig,Mt=Tt*Math.floor(Ot.height/Ot.lineHeight);$t===!0?this.selection.$moveSelection(function(){this.moveCursorBy(Mt,0)}):$t===!1&&(this.selection.moveCursorBy(Mt,0),this.selection.clearSelection());var Dt=It.scrollTop;It.scrollBy(0,Mt*Ot.lineHeight),$t!=null&&It.scrollCursorIntoView(null,.5),It.animateScrolling(Dt)},kt.prototype.selectPageDown=function(){this.$moveByPage(1,!0)},kt.prototype.selectPageUp=function(){this.$moveByPage(-1,!0)},kt.prototype.gotoPageDown=function(){this.$moveByPage(1,!1)},kt.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1)},kt.prototype.scrollPageDown=function(){this.$moveByPage(1)},kt.prototype.scrollPageUp=function(){this.$moveByPage(-1)},kt.prototype.scrollToRow=function(Tt){this.renderer.scrollToRow(Tt)},kt.prototype.scrollToLine=function(Tt,$t,It,Ot){this.renderer.scrollToLine(Tt,$t,It,Ot)},kt.prototype.centerSelection=function(){var Tt=this.getSelectionRange(),$t={row:Math.floor(Tt.start.row+(Tt.end.row-Tt.start.row)/2),column:Math.floor(Tt.start.column+(Tt.end.column-Tt.start.column)/2)};this.renderer.alignCursor($t,.5)},kt.prototype.getCursorPosition=function(){return this.selection.getCursor()},kt.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},kt.prototype.getSelectionRange=function(){return this.selection.getRange()},kt.prototype.selectAll=function(){this.selection.selectAll()},kt.prototype.clearSelection=function(){this.selection.clearSelection()},kt.prototype.moveCursorTo=function(Tt,$t){this.selection.moveCursorTo(Tt,$t)},kt.prototype.moveCursorToPosition=function(Tt){this.selection.moveCursorToPosition(Tt)},kt.prototype.jumpToMatching=function(Tt,$t){var It=this.getCursorPosition(),Ot=new gt(this.session,It.row,It.column),Mt=Ot.getCurrentToken(),Dt=0;Mt&&Mt.type.indexOf("tag-name")!==-1&&(Mt=Ot.stepBackward());var Bt=Mt||Ot.stepForward();if(Bt){var Kt,Wt=!1,zt={},Ht=It.column-Bt.start,Zt,qt={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(Bt.value.match(/[{}()\[\]]/g)){for(;Ht1?zt[Bt.value]++:Mt.value==="=0;--Dt)this.$tryReplace(It[Dt],Tt)&&Ot++;return this.selection.setSelectionRange(Mt),Ot},kt.prototype.$tryReplace=function(Tt,$t){var It=this.session.getTextRange(Tt);return $t=this.$search.replace(It,$t),$t!==null?(Tt.end=this.session.replace(Tt,$t),Tt):null},kt.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},kt.prototype.find=function(Tt,$t,It){$t||($t={}),typeof Tt=="string"||Tt instanceof RegExp?$t.needle=Tt:typeof Tt=="object"&&ot.mixin($t,Tt);var Ot=this.selection.getRange();$t.needle==null&&(Tt=this.session.getTextRange(Ot)||this.$search.$options.needle,Tt||(Ot=this.session.getWordRange(Ot.start.row,Ot.start.column),Tt=this.session.getTextRange(Ot)),this.$search.set({needle:Tt})),this.$search.set($t),$t.start||this.$search.set({start:Ot});var Mt=this.$search.find(this.session);if($t.preventScroll)return Mt;if(Mt)return this.revealRange(Mt,It),Mt;$t.backwards?Ot.start=Ot.end:Ot.end=Ot.start,this.selection.setRange(Ot)},kt.prototype.findNext=function(Tt,$t){this.find({skipCurrent:!0,backwards:!1},Tt,$t)},kt.prototype.findPrevious=function(Tt,$t){this.find(Tt,{skipCurrent:!0,backwards:!0},$t)},kt.prototype.revealRange=function(Tt,$t){this.session.unfold(Tt),this.selection.setSelectionRange(Tt);var It=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(Tt.start,Tt.end,.5),$t!==!1&&this.renderer.animateScrolling(It)},kt.prototype.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},kt.prototype.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},kt.prototype.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach(function(Tt){Tt.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()},kt.prototype.setAutoScrollEditorIntoView=function(Tt){if(Tt){var $t,It=this,Ot=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var Mt=this.$scrollAnchor;Mt.style.cssText="position:absolute",this.container.insertBefore(Mt,this.container.firstChild);var Dt=this.on("changeSelection",function(){Ot=!0}),Bt=this.renderer.on("beforeRender",function(){Ot&&($t=It.renderer.container.getBoundingClientRect())}),Kt=this.renderer.on("afterRender",function(){if(Ot&&$t&&(It.isFocused()||It.searchBox&&It.searchBox.isFocused())){var Wt=It.renderer,zt=Wt.$cursorLayer.$pixelPos,Ht=Wt.layerConfig,Zt=zt.top-Ht.offset;zt.top>=0&&Zt+$t.top<0?Ot=!0:zt.topwindow.innerHeight?Ot=!1:Ot=null,Ot!=null&&(Mt.style.top=Zt+"px",Mt.style.left=zt.left+"px",Mt.style.height=Ht.lineHeight+"px",Mt.scrollIntoView(Ot)),Ot=$t=null}});this.setAutoScrollEditorIntoView=function(Wt){Wt||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",Dt),this.renderer.off("afterRender",Kt),this.renderer.off("beforeRender",Bt))}}},kt.prototype.$resetCursorStyle=function(){var Tt=this.$cursorStyle||"ace",$t=this.renderer.$cursorLayer;$t&&($t.setSmoothBlinking(/smooth/.test(Tt)),$t.isBlinking=!this.$readOnly&&Tt!="wide",at.setCssClass($t.element,"ace_slim-cursors",/slim/.test(Tt)))},kt.prototype.prompt=function(Tt,$t,It){var Ot=this;mt.loadModule("ace/ext/prompt",function(Mt){Mt.prompt(Ot,Tt,$t,It)})},kt}();Ct.$uid=0,Ct.prototype.curOp=null,Ct.prototype.prevOp={},Ct.prototype.$mergeableCommands=["backspace","del","insertstring"],Ct.prototype.$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"],["&&","||"],["==","!="]],ot.implement(Ct.prototype,ht),mt.defineOptions(Ct.prototype,"editor",{selectionStyle:{set:function(kt){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:kt})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(kt){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(kt){this.textInput.setReadOnly(kt),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(kt){this.textInput.setCopyWithEmptySelection(kt)},initialValue:!1},cursorStyle:{set:function(kt){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(kt){this.setAutoScrollEditorIntoView(kt)}},keyboardHandler:{set:function(kt){this.setKeyboardHandler(kt)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(kt){this.session.setValue(kt)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(kt){this.setSession(kt)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(kt){this.renderer.$gutterLayer.setShowLineNumbers(kt),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),kt&&this.$relativeLineNumbers?Et.attach(this):Et.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(kt){this.$showLineNumbers&&kt?Et.attach(this):Et.detach(this)}},placeholder:{set:function(kt){this.$updatePlaceholder||(this.$updatePlaceholder=(function(){var Tt=this.session&&(this.renderer.$composition||this.session.getLength()>1||this.session.getLine(0).length>0);if(Tt&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),at.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!Tt&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),at.addCssClass(this.container,"ace_hasPlaceholder");var $t=at.createElement("div");$t.className="ace_placeholder",$t.textContent=this.$placeholder||"",this.renderer.placeholderNode=$t,this.renderer.content.appendChild(this.renderer.placeholderNode)}else!Tt&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"")}).bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},enableKeyboardAccessibility:{set:function(kt){var Tt={name:"blurTextInput",description:"Set focus to the editor content div to allow tabbing through the page",bindKey:"Esc",exec:function(Ot){Ot.blur(),Ot.renderer.scroller.focus()},readOnly:!0},$t=function(Ot){if(Ot.target==this.renderer.scroller&&Ot.keyCode===_t.enter){Ot.preventDefault();var Mt=this.getCursorPosition().row;this.isRowVisible(Mt)||this.scrollToLine(Mt,!0,!0),this.focus()}},It;kt?(this.renderer.enableKeyboardAccessibility=!0,this.renderer.keyboardFocusClassName="ace_keyboard-focus",this.textInput.getElement().setAttribute("tabindex",-1),this.textInput.setNumberOfExtraLines(it.isWin?3:0),this.renderer.scroller.setAttribute("tabindex",0),this.renderer.scroller.setAttribute("role","group"),this.renderer.scroller.setAttribute("aria-roledescription",xt("editor.scroller.aria-roledescription","editor")),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute("aria-label",xt("editor.scroller.aria-label","Editor content, press Enter to start editing, press Escape to exit")),this.renderer.scroller.addEventListener("keyup",$t.bind(this)),this.commands.addCommand(Tt),this.renderer.$gutter.setAttribute("tabindex",0),this.renderer.$gutter.setAttribute("aria-hidden",!1),this.renderer.$gutter.setAttribute("role","group"),this.renderer.$gutter.setAttribute("aria-roledescription",xt("editor.gutter.aria-roledescription","editor")),this.renderer.$gutter.setAttribute("aria-label",xt("editor.gutter.aria-label","Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit")),this.renderer.$gutter.classList.add(this.renderer.keyboardFocusClassName),this.renderer.content.setAttribute("aria-hidden",!0),It||(It=new St(this)),It.addListener(),this.textInput.setAriaOptions({setLabel:!0})):(this.renderer.enableKeyboardAccessibility=!1,this.textInput.getElement().setAttribute("tabindex",0),this.textInput.setNumberOfExtraLines(0),this.renderer.scroller.setAttribute("tabindex",-1),this.renderer.scroller.removeAttribute("role"),this.renderer.scroller.removeAttribute("aria-roledescription"),this.renderer.scroller.classList.remove(this.renderer.keyboardFocusClassName),this.renderer.scroller.removeAttribute("aria-label"),this.renderer.scroller.removeEventListener("keyup",$t.bind(this)),this.commands.removeCommand(Tt),this.renderer.content.removeAttribute("aria-hidden"),this.renderer.$gutter.setAttribute("tabindex",-1),this.renderer.$gutter.setAttribute("aria-hidden",!0),this.renderer.$gutter.removeAttribute("role"),this.renderer.$gutter.removeAttribute("aria-roledescription"),this.renderer.$gutter.removeAttribute("aria-label"),this.renderer.$gutter.classList.remove(this.renderer.keyboardFocusClassName),It&&It.removeListener())},initialValue:!1},textInputAriaLabel:{set:function(kt){this.$textInputAriaLabel=kt},initialValue:""},enableMobileMenu:{set:function(kt){this.$enableMobileMenu=kt},initialValue:!0},customScrollbar:"renderer",hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",highlightIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",useResizeObserver:"renderer",useSvgGutterIcons:"renderer",showFoldedAnnotations:"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 Et={getText:function(kt,Tt){return(Math.abs(kt.selection.lead.row-Tt)||Tt+1+(Tt<9?"·":""))+""},getWidth:function(kt,Tt,$t){return Math.max(Tt.toString().length,($t.lastRow+1).toString().length,2)*$t.characterWidth},update:function(kt,Tt){Tt.renderer.$loop.schedule(Tt.renderer.CHANGE_GUTTER)},attach:function(kt){kt.renderer.$gutterLayer.$renderer=this,kt.on("changeSelection",this.update),this.update(null,kt)},detach:function(kt){kt.renderer.$gutterLayer.$renderer==this&&(kt.renderer.$gutterLayer.$renderer=null),kt.off("changeSelection",this.update),this.update(null,kt)}};a.Editor=Ct}),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(o,a,rt){var et=o("../lib/dom"),ot=function(){function at(nt,it){this.element=nt,this.canvasHeight=it||5e5,this.element.style.height=this.canvasHeight*2+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0}return at.prototype.moveContainer=function(nt){et.translate(this.element,0,-(nt.firstRowScreen*nt.lineHeight%this.canvasHeight)-nt.offset*this.$offsetCoefficient)},at.prototype.pageChanged=function(nt,it){return Math.floor(nt.firstRowScreen*nt.lineHeight/this.canvasHeight)!==Math.floor(it.firstRowScreen*it.lineHeight/this.canvasHeight)},at.prototype.computeLineTop=function(nt,it,j){var _=it.firstRowScreen*it.lineHeight,$=Math.floor(_/this.canvasHeight),tt=j.documentToScreenRow(nt,0)*it.lineHeight;return tt-$*this.canvasHeight},at.prototype.computeLineHeight=function(nt,it,j){return it.lineHeight*j.getRowLineCount(nt)},at.prototype.getLength=function(){return this.cells.length},at.prototype.get=function(nt){return this.cells[nt]},at.prototype.shift=function(){this.$cacheCell(this.cells.shift())},at.prototype.pop=function(){this.$cacheCell(this.cells.pop())},at.prototype.push=function(nt){if(Array.isArray(nt)){this.cells.push.apply(this.cells,nt);for(var it=et.createFragment(this.element),j=0;jpt&&(dt=ut.end.row+1,ut=lt.getNextFoldLine(dt,ut),pt=ut?ut.start.row:1/0),dt>ht){for(;this.$lines.getLength()>gt+1;)this.$lines.pop();break}mt=this.$lines.get(++gt),mt?mt.row=dt:(mt=this.$lines.createCell(dt,st,this.session,$),this.$lines.push(mt)),this.$renderCell(mt,st,ut,dt),dt++}this._signal("afterRender"),this.$updateGutterWidth(st)},tt.prototype.$updateGutterWidth=function(st){var lt=this.session,ct=lt.gutterRenderer||this.$renderer,ht=lt.$firstLineNumber,ut=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||lt.$useWrapMode)&&(ut=lt.getLength()+ht-1);var pt=ct?ct.getWidth(lt,ut,st):ut.toString().length*st.characterWidth,mt=this.$padding||this.$computePadding();pt+=mt.left+mt.right,pt!==this.gutterWidth&&!isNaN(pt)&&(this.gutterWidth=pt,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",pt))},tt.prototype.$updateCursorRow=function(){if(this.$highlightGutterLine){var st=this.session.selection.getCursor();this.$cursorRow!==st.row&&(this.$cursorRow=st.row)}},tt.prototype.updateLineHighlight=function(){if(this.$highlightGutterLine){var st=this.session.selection.cursor.row;if(this.$cursorRow=st,!(this.$cursorCell&&this.$cursorCell.row==st)){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var lt=this.$lines.cells;this.$cursorCell=null;for(var ct=0;ct=this.$cursorRow){if(ht.row>this.$cursorRow){var ut=this.session.getFoldLine(this.$cursorRow);if(ct>0&&ut&&ut.start.row==lt[ct-1].row)ht=lt[ct-1];else break}ht.element.className="ace_gutter-active-line "+ht.element.className,this.$cursorCell=ht;break}}}}},tt.prototype.scrollLines=function(st){var lt=this.config;if(this.config=st,this.$updateCursorRow(),this.$lines.pageChanged(lt,st))return this.update(st);this.$lines.moveContainer(st);var ct=Math.min(st.lastRow+st.gutterOffset,this.session.getLength()-1),ht=this.oldLastRow;if(this.oldLastRow=ct,!lt||ht0;ut--)this.$lines.shift();if(ht>ct)for(var ut=this.session.getFoldedRowCount(ct+1,ht);ut>0;ut--)this.$lines.pop();st.firstRowht&&this.$lines.push(this.$renderLines(st,ht+1,ct)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(st)},tt.prototype.$renderLines=function(st,lt,ct){for(var ht=[],ut=lt,pt=this.session.getNextFoldLine(ut),mt=pt?pt.start.row:1/0;ut>mt&&(ut=pt.end.row+1,pt=this.session.getNextFoldLine(ut,pt),mt=pt?pt.start.row:1/0),!(ut>ct);){var gt=this.$lines.createCell(ut,st,this.session,$);this.$renderCell(gt,st,pt,ut),ht.push(gt),ut++}return ht},tt.prototype.$renderCell=function(st,lt,ct,ht){var ut=st.element,pt=this.session,mt=ut.childNodes[0],gt=ut.childNodes[1],dt=ut.childNodes[2],St=dt.firstChild,xt=pt.$firstLineNumber,yt=pt.$breakpoints,_t=pt.$decorations,Ct=pt.gutterRenderer||this.$renderer,Et=this.$showFoldWidgets&&pt.foldWidgets,kt=ct?ct.start.row:Number.MAX_VALUE,Tt=lt.lineHeight+"px",$t=this.$useSvgGutterIcons?"ace_gutter-cell_svg-icons ":"ace_gutter-cell ",It=this.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",Ot=(Ct?Ct.getText(pt,ht):ht+xt).toString();if(this.$highlightGutterLine&&(ht==this.$cursorRow||ct&&ht=kt&&this.$cursorRow<=ct.end.row)&&($t+="ace_gutter-active-line ",this.$cursorCell!=st&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=st)),yt[ht]&&($t+=yt[ht]),_t[ht]&&($t+=_t[ht]),this.$annotations[ht]&&ht!==kt&&($t+=this.$annotations[ht].className),Et){var Mt=Et[ht];Mt==null&&(Mt=Et[ht]=pt.getFoldWidget(ht))}if(Mt){var Dt="ace_fold-widget ace_"+Mt,Bt=Mt=="start"&&ht==kt&&htct.right-lt.right)return"foldWidgets"},tt}();_.prototype.$fixedWidth=!1,_.prototype.$highlightGutterLine=!0,_.prototype.$renderer="",_.prototype.$showLineNumbers=!0,_.prototype.$showFoldWidgets=!0,ot.implement(_.prototype,nt);function $(tt){var st=document.createTextNode("");tt.appendChild(st);var lt=et.createElement("span");tt.appendChild(lt);var ct=et.createElement("span");tt.appendChild(ct);var ht=et.createElement("span");return ct.appendChild(ht),tt}a.Gutter=_}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(o,a,rt){var et=o("../range").Range,ot=o("../lib/dom"),at=function(){function it(j){this.element=ot.createElement("div"),this.element.className="ace_layer ace_marker-layer",j.appendChild(this.element)}return it.prototype.setPadding=function(j){this.$padding=j},it.prototype.setSession=function(j){this.session=j},it.prototype.setMarkers=function(j){this.markers=j},it.prototype.elt=function(j,_){var $=this.i!=-1&&this.element.childNodes[this.i];$?this.i++:($=document.createElement("div"),this.element.appendChild($),this.i=-1),$.style.cssText=_,$.className=j},it.prototype.update=function(j){if(j){this.config=j,this.i=0;var _;for(var $ in this.markers){var tt=this.markers[$];if(!tt.range){tt.update(_,this,this.session,j);continue}var st=tt.range.clipRows(j.firstRow,j.lastRow);if(!st.isEmpty())if(st=st.toScreenRange(this.session),tt.renderer){var lt=this.$getTop(st.start.row,j),ct=this.$padding+st.start.column*j.characterWidth;tt.renderer(_,st,ct,lt,j)}else tt.type=="fullLine"?this.drawFullLineMarker(_,st,tt.clazz,j):tt.type=="screenLine"?this.drawScreenLineMarker(_,st,tt.clazz,j):st.isMultiLine()?tt.type=="text"?this.drawTextMarker(_,st,tt.clazz,j):this.drawMultiLineMarker(_,st,tt.clazz,j):this.drawSingleLineMarker(_,st,tt.clazz+" ace_start ace_br15",j)}if(this.i!=-1)for(;this.igt,ut==ht),tt,ut==ht?0:1,st)},it.prototype.drawMultiLineMarker=function(j,_,$,tt,st){var lt=this.$padding,ct=tt.lineHeight,ht=this.$getTop(_.start.row,tt),ut=lt+_.start.column*tt.characterWidth;if(st=st||"",this.session.$bidiHandler.isBidiRow(_.start.row)){var pt=_.clone();pt.end.row=pt.start.row,pt.end.column=this.session.getLine(pt.start.row).length,this.drawBidiSingleLineMarker(j,pt,$+" ace_br1 ace_start",tt,null,st)}else this.elt($+" ace_br1 ace_start","height:"+ct+"px;right:0;top:"+ht+"px;left:"+ut+"px;"+(st||""));if(this.session.$bidiHandler.isBidiRow(_.end.row)){var pt=_.clone();pt.start.row=pt.end.row,pt.start.column=0,this.drawBidiSingleLineMarker(j,pt,$+" ace_br12",tt,null,st)}else{ht=this.$getTop(_.end.row,tt);var mt=_.end.column*tt.characterWidth;this.elt($+" ace_br12","height:"+ct+"px;width:"+mt+"px;top:"+ht+"px;left:"+lt+"px;"+(st||""))}if(ct=(_.end.row-_.start.row-1)*tt.lineHeight,!(ct<=0)){ht=this.$getTop(_.start.row+1,tt);var gt=(_.start.column?1:0)|(_.end.column?0:8);this.elt($+(gt?" ace_br"+gt:""),"height:"+ct+"px;right:0;top:"+ht+"px;left:"+lt+"px;"+(st||""))}},it.prototype.drawSingleLineMarker=function(j,_,$,tt,st,lt){if(this.session.$bidiHandler.isBidiRow(_.start.row))return this.drawBidiSingleLineMarker(j,_,$,tt,st,lt);var ct=tt.lineHeight,ht=(_.end.column+(st||0)-_.start.column)*tt.characterWidth,ut=this.$getTop(_.start.row,tt),pt=this.$padding+_.start.column*tt.characterWidth;this.elt($,"height:"+ct+"px;width:"+ht+"px;top:"+ut+"px;left:"+pt+"px;"+(lt||""))},it.prototype.drawBidiSingleLineMarker=function(j,_,$,tt,st,lt){var ct=tt.lineHeight,ht=this.$getTop(_.start.row,tt),ut=this.$padding,pt=this.session.$bidiHandler.getSelections(_.start.column,_.end.column);pt.forEach(function(mt){this.elt($,"height:"+ct+"px;width:"+(mt.width+(st||0))+"px;top:"+ht+"px;left:"+(ut+mt.left)+"px;"+(lt||""))},this)},it.prototype.drawFullLineMarker=function(j,_,$,tt,st){var lt=this.$getTop(_.start.row,tt),ct=tt.lineHeight;_.start.row!=_.end.row&&(ct+=this.$getTop(_.end.row,tt)-lt),this.elt($,"height:"+ct+"px;top:"+lt+"px;left:0;right:0;"+(st||""))},it.prototype.drawScreenLineMarker=function(j,_,$,tt,st){var lt=this.$getTop(_.start.row,tt),ct=tt.lineHeight;this.elt($,"height:"+ct+"px;top:"+lt+"px;left:0;right:0;"+(st||""))},it}();at.prototype.$padding=0;function nt(it,j,_,$){return(it?1:0)|(j?2:0)|(_?4:0)|($?8:0)}a.Marker=at}),ace.define("ace/layer/text_util",["require","exports","module"],function(o,a,rt){var et=new Set(["text","rparen","lparen"]);a.isTextToken=function(ot){return et.has(ot)}}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter","ace/config","ace/layer/text_util"],function(o,a,rt){var et=o("../lib/oop"),ot=o("../lib/dom"),at=o("../lib/lang"),nt=o("./lines").Lines,it=o("../lib/event_emitter").EventEmitter,j=o("../config").nls,_=o("./text_util").isTextToken,$=function(){function tt(st){this.dom=ot,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",st.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new nt(this.element)}return tt.prototype.$updateEolChar=function(){var st=this.session.doc,lt=st.getNewLineCharacter()==` -`&&st.getNewLineMode()!="windows",ct=lt?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=ct)return this.EOL_CHAR=ct,!0},tt.prototype.setPadding=function(st){this.$padding=st,this.element.style.margin="0 "+st+"px"},tt.prototype.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},tt.prototype.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},tt.prototype.$setFontMetrics=function(st){this.$fontMetrics=st,this.$fontMetrics.on("changeCharacterSize",(function(lt){this._signal("changeCharacterSize",lt)}).bind(this)),this.$pollSizeChanges()},tt.prototype.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},tt.prototype.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},tt.prototype.setSession=function(st){this.session=st,st&&this.$computeTabString()},tt.prototype.setShowInvisibles=function(st){return this.showInvisibles==st?!1:(this.showInvisibles=st,typeof st=="string"?(this.showSpaces=/tab/i.test(st),this.showTabs=/space/i.test(st),this.showEOL=/eol/i.test(st)):this.showSpaces=this.showTabs=this.showEOL=st,this.$computeTabString(),!0)},tt.prototype.setDisplayIndentGuides=function(st){return this.displayIndentGuides==st?!1:(this.displayIndentGuides=st,this.$computeTabString(),!0)},tt.prototype.setHighlightIndentGuides=function(st){return this.$highlightIndentGuides===st?!1:(this.$highlightIndentGuides=st,st)},tt.prototype.$computeTabString=function(){var st=this.session.getTabSize();this.tabSize=st;for(var lt=this.$tabStrings=[0],ct=1;ctxt&&(dt=St.end.row+1,St=this.session.getNextFoldLine(dt,St),xt=St?St.start.row:1/0),!(dt>ut);){var yt=pt[mt++];if(yt){this.dom.removeChildren(yt),this.$renderLine(yt,dt,dt==xt?St:!1),gt&&(yt.style.top=this.$lines.computeLineTop(dt,st,this.session)+"px");var _t=st.lineHeight*this.session.getRowLength(dt)+"px";yt.style.height!=_t&&(gt=!0,yt.style.height=_t)}dt++}if(gt)for(;mt0;ut--)this.$lines.shift();if(lt.lastRow>st.lastRow)for(var ut=this.session.getFoldedRowCount(st.lastRow+1,lt.lastRow);ut>0;ut--)this.$lines.pop();st.firstRowlt.lastRow&&this.$lines.push(this.$renderLinesFragment(st,lt.lastRow+1,st.lastRow)),this.$highlightIndentGuide()},tt.prototype.$renderLinesFragment=function(st,lt,ct){for(var ht=[],ut=lt,pt=this.session.getNextFoldLine(ut),mt=pt?pt.start.row:1/0;ut>mt&&(ut=pt.end.row+1,pt=this.session.getNextFoldLine(ut,pt),mt=pt?pt.start.row:1/0),!(ut>ct);){var gt=this.$lines.createCell(ut,st,this.session),dt=gt.element;this.dom.removeChildren(dt),ot.setStyle(dt.style,"height",this.$lines.computeLineHeight(ut,st,this.session)+"px"),ot.setStyle(dt.style,"top",this.$lines.computeLineTop(ut,st,this.session)+"px"),this.$renderLine(dt,ut,ut==mt?pt:!1),this.$useLineGroups()?dt.className="ace_line_group":dt.className="ace_line",ht.push(gt),ut++}return ht},tt.prototype.update=function(st){this.$lines.moveContainer(st),this.config=st;for(var lt=st.firstRow,ct=st.lastRow,ht=this.$lines;ht.getLength();)ht.pop();ht.push(this.$renderLinesFragment(st,lt,ct))},tt.prototype.$renderToken=function(st,lt,ct,ht){for(var ut=this,pt=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC\u2066\u2067\u2068\u202A\u202B\u202D\u202E\u202C\u2069]+)|(\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,mt=this.dom.createFragment(this.element),gt,dt=0;gt=pt.exec(ht);){var St=gt[1],xt=gt[2],yt=gt[3],_t=gt[4],Ct=gt[5];if(!(!ut.showSpaces&&xt)){var Et=dt!=gt.index?ht.slice(dt,gt.index):"";if(dt=gt.index+gt[0].length,Et&&mt.appendChild(this.dom.createTextNode(Et,this.element)),St){var kt=ut.session.getScreenTabSize(lt+gt.index);mt.appendChild(ut.$tabStrings[kt].cloneNode(!0)),lt+=kt-1}else if(xt)if(ut.showSpaces){var Tt=this.dom.createElement("span");Tt.className="ace_invisible ace_invisible_space",Tt.textContent=at.stringRepeat(ut.SPACE_CHAR,xt.length),mt.appendChild(Tt)}else mt.appendChild(this.dom.createTextNode(xt,this.element));else if(yt){var Tt=this.dom.createElement("span");Tt.className="ace_invisible ace_invisible_space ace_invalid",Tt.textContent=at.stringRepeat(ut.SPACE_CHAR,yt.length),mt.appendChild(Tt)}else if(_t){lt+=1;var Tt=this.dom.createElement("span");Tt.style.width=ut.config.characterWidth*2+"px",Tt.className=ut.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",Tt.textContent=ut.showSpaces?ut.SPACE_CHAR:_t,mt.appendChild(Tt)}else if(Ct){lt+=1;var Tt=this.dom.createElement("span");Tt.style.width=ut.config.characterWidth*2+"px",Tt.className="ace_cjk",Tt.textContent=Ct,mt.appendChild(Tt)}}}if(mt.appendChild(this.dom.createTextNode(dt?ht.slice(dt):ht,this.element)),_(ct.type))st.appendChild(mt);else{var $t="ace_"+ct.type.replace(/\./g," ace_"),Tt=this.dom.createElement("span");ct.type=="fold"&&(Tt.style.width=ct.value.length*this.config.characterWidth+"px",Tt.setAttribute("title",j("inline-fold.closed.title","Unfold code"))),Tt.className=$t,Tt.appendChild(mt),st.appendChild(Tt)}return lt+ht.length},tt.prototype.renderIndentGuide=function(st,lt,ct){var ht=lt.search(this.$indentGuideRe);if(ht<=0||ht>=ct)return lt;if(lt[0]==" "){ht-=ht%this.tabSize;for(var ut=ht/this.tabSize,pt=0;ptpt[mt].start.row?this.$highlightIndentGuideMarker.dir=-1:this.$highlightIndentGuideMarker.dir=1;break}}if(!this.$highlightIndentGuideMarker.end&&st[lt.row]!==""&<.column===st[lt.row].length){this.$highlightIndentGuideMarker.dir=1;for(var mt=lt.row+1;mt0){for(var ut=0;ut=this.$highlightIndentGuideMarker.start+1){if(ht.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(ht,lt)}}else for(var ct=st.length-1;ct>=0;ct--){var ht=st[ct];if(this.$highlightIndentGuideMarker.end&&ht.row=pt;)mt=this.$renderToken(gt,mt,St,xt.substring(0,pt-ht)),xt=xt.substring(pt-ht),ht=pt,gt=this.$createLineElement(),st.appendChild(gt),gt.appendChild(this.dom.createTextNode(at.stringRepeat(" ",ct.indent),this.element)),ut++,mt=0,pt=ct[ut]||Number.MAX_VALUE;xt.length!=0&&(ht+=xt.length,mt=this.$renderToken(gt,mt,St,xt))}}ct[ct.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(gt,mt,null,"",!0)},tt.prototype.$renderSimpleLine=function(st,lt){for(var ct=0,ht=0;htthis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(st,ct,ut,pt);ct=this.$renderToken(st,ct,ut,pt)}}},tt.prototype.$renderOverflowMessage=function(st,lt,ct,ht,ut){ct&&this.$renderToken(st,lt,ct,ht.slice(0,this.MAX_LINE_LENGTH-lt));var pt=this.dom.createElement("span");pt.className="ace_inline_button ace_keyword ace_toggle_wrap",pt.textContent=ut?"":"",st.appendChild(pt)},tt.prototype.$renderLine=function(st,lt,ct){if(!ct&&ct!=!1&&(ct=this.session.getFoldLine(lt)),ct)var ht=this.$getFoldLineTokens(lt,ct);else var ht=this.session.getTokens(lt);var ut=st;if(ht.length){var pt=this.session.getRowSplitData(lt);if(pt&&pt.length){this.$renderWrappedLine(st,ht,pt);var ut=st.lastChild}else{var ut=st;this.$useLineGroups()&&(ut=this.$createLineElement(),st.appendChild(ut)),this.$renderSimpleLine(ut,ht)}}else this.$useLineGroups()&&(ut=this.$createLineElement(),st.appendChild(ut));if(this.showEOL&&ut){ct&&(lt=ct.end.row);var mt=this.dom.createElement("span");mt.className="ace_invisible ace_invisible_eol",mt.textContent=lt==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,ut.appendChild(mt)}},tt.prototype.$getFoldLineTokens=function(st,lt){var ct=this.session,ht=[];function ut(mt,gt,dt){for(var St=0,xt=0;xt+mt[St].value.lengthdt-gt&&(yt=yt.substring(0,dt-gt)),ht.push({type:mt[St].type,value:yt}),xt=gt+yt.length,St+=1}for(;xtdt?ht.push({type:mt[St].type,value:yt.substring(0,dt-xt)}):ht.push(mt[St]),xt+=yt.length,St+=1}}var pt=ct.getTokens(st);return lt.walk(function(mt,gt,dt,St,xt){mt!=null?ht.push({type:"fold",value:mt}):(xt&&(pt=ct.getTokens(gt)),pt.length&&ut(pt,St,dt))},lt.end.row,this.session.getLine(lt.end.row).length),ht},tt.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},tt}();$.prototype.EOF_CHAR="¶",$.prototype.EOL_CHAR_LF="¬",$.prototype.EOL_CHAR_CRLF="¤",$.prototype.EOL_CHAR=$.prototype.EOL_CHAR_LF,$.prototype.TAB_CHAR="—",$.prototype.SPACE_CHAR="·",$.prototype.$padding=0,$.prototype.MAX_LINE_LENGTH=1e4,$.prototype.showInvisibles=!1,$.prototype.showSpaces=!1,$.prototype.showTabs=!1,$.prototype.showEOL=!1,$.prototype.displayIndentGuides=!0,$.prototype.$highlightIndentGuides=!0,$.prototype.$tabStrings=[],$.prototype.destroy={},$.prototype.onChangeTabSize=$.prototype.$computeTabString,et.implement($.prototype,it),a.Text=$}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(o,a,rt){var et=o("../lib/dom"),ot=function(){function at(nt){this.element=et.createElement("div"),this.element.className="ace_layer ace_cursor-layer",nt.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),et.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)}return at.prototype.$updateOpacity=function(nt){for(var it=this.cursors,j=it.length;j--;)et.setStyle(it[j].style,"opacity",nt?"":"0")},at.prototype.$startCssAnimation=function(){for(var nt=this.cursors,it=nt.length;it--;)nt[it].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=!0,setTimeout((function(){this.$isAnimating&&et.addCssClass(this.element,"ace_animate-blinking")}).bind(this))},at.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,et.removeCssClass(this.element,"ace_animate-blinking")},at.prototype.setPadding=function(nt){this.$padding=nt},at.prototype.setSession=function(nt){this.session=nt},at.prototype.setBlinking=function(nt){nt!=this.isBlinking&&(this.isBlinking=nt,this.restartTimer())},at.prototype.setBlinkInterval=function(nt){nt!=this.blinkInterval&&(this.blinkInterval=nt,this.restartTimer())},at.prototype.setSmoothBlinking=function(nt){nt!=this.smoothBlinking&&(this.smoothBlinking=nt,et.setCssClass(this.element,"ace_smooth-blinking",nt),this.$updateCursors(!0),this.restartTimer())},at.prototype.addCursor=function(){var nt=et.createElement("div");return nt.className="ace_cursor",this.element.appendChild(nt),this.cursors.push(nt),nt},at.prototype.removeCursor=function(){if(this.cursors.length>1){var nt=this.cursors.pop();return nt.parentNode.removeChild(nt),nt}},at.prototype.hideCursor=function(){this.isVisible=!1,et.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},at.prototype.showCursor=function(){this.isVisible=!0,et.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},at.prototype.restartTimer=function(){var nt=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,et.removeCssClass(this.element,"ace_smooth-blinking")),nt(!0),!this.isBlinking||!this.blinkInterval||!this.isVisible){this.$stopCssAnimation();return}if(this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout((function(){this.$isSmoothBlinking&&et.addCssClass(this.element,"ace_smooth-blinking")}).bind(this))),et.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var it=(function(){this.timeoutId=setTimeout(function(){nt(!1)},.6*this.blinkInterval)}).bind(this);this.intervalId=setInterval(function(){nt(!0),it()},this.blinkInterval),it()}},at.prototype.getPixelPosition=function(nt,it){if(!this.config||!this.session)return{left:0,top:0};nt||(nt=this.session.selection.getCursor());var j=this.session.documentToScreenPosition(nt),_=this.$padding+(this.session.$bidiHandler.isBidiRow(j.row,nt.row)?this.session.$bidiHandler.getPosLeft(j.column):j.column*this.config.characterWidth),$=(j.row-(it?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:_,top:$}},at.prototype.isCursorInView=function(nt,it){return nt.top>=0&&nt.topnt.height+nt.offset||tt.top<0)&&j>1)){var st=this.cursors[_++]||this.addCursor(),lt=st.style;this.drawCursor?this.drawCursor(st,tt,nt,it[j],this.session):this.isCursorInView(tt,nt)?(et.setStyle(lt,"display","block"),et.translate(st,tt.left,tt.top),et.setStyle(lt,"width",Math.round(nt.characterWidth)+"px"),et.setStyle(lt,"height",nt.lineHeight+"px")):et.setStyle(lt,"display","none")}}for(;this.cursors.length>_;)this.removeCursor();var ct=this.session.getOverwrite();this.$setOverwrite(ct),this.$pixelPos=tt,this.restartTimer()},at.prototype.$setOverwrite=function(nt){nt!=this.overwrite&&(this.overwrite=nt,nt?et.addCssClass(this.element,"ace_overwrite-cursors"):et.removeCssClass(this.element,"ace_overwrite-cursors"))},at.prototype.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)},at}();ot.prototype.$padding=0,ot.prototype.drawCursor=null,a.Cursor=ot}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(o,a,rt){var et=this&&this.__extends||function(){var st=function(lt,ct){return st=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ht,ut){ht.__proto__=ut}||function(ht,ut){for(var pt in ut)Object.prototype.hasOwnProperty.call(ut,pt)&&(ht[pt]=ut[pt])},st(lt,ct)};return function(lt,ct){if(typeof ct!="function"&&ct!==null)throw new TypeError("Class extends value "+String(ct)+" is not a constructor or null");st(lt,ct);function ht(){this.constructor=lt}lt.prototype=ct===null?Object.create(ct):(ht.prototype=ct.prototype,new ht)}}(),ot=o("./lib/oop"),at=o("./lib/dom"),nt=o("./lib/event"),it=o("./lib/event_emitter").EventEmitter,j=32768,_=function(){function st(lt,ct){this.element=at.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+ct,this.inner=at.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),lt.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,nt.addListener(this.element,"scroll",this.onScroll.bind(this)),nt.addListener(this.element,"mousedown",nt.preventDefault)}return st.prototype.setVisible=function(lt){this.element.style.display=lt?"":"none",this.isVisible=lt,this.coeff=1},st}();ot.implement(_.prototype,it);var $=function(st){et(lt,st);function lt(ct,ht){var ut=st.call(this,ct,"-v")||this;return ut.scrollTop=0,ut.scrollHeight=0,ht.$scrollbarWidth=ut.width=at.scrollbarWidth(ct.ownerDocument),ut.inner.style.width=ut.element.style.width=(ut.width||15)+5+"px",ut.$minWidth=0,ut}return lt.prototype.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,this.coeff!=1){var ct=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-ct)/(this.coeff-ct)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},lt.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},lt.prototype.setHeight=function(ct){this.element.style.height=ct+"px"},lt.prototype.setScrollHeight=function(ct){this.scrollHeight=ct,ct>j?(this.coeff=j/ct,ct=j):this.coeff!=1&&(this.coeff=1),this.inner.style.height=ct+"px"},lt.prototype.setScrollTop=function(ct){this.scrollTop!=ct&&(this.skipEvent=!0,this.scrollTop=ct,this.element.scrollTop=ct*this.coeff)},lt}(_);$.prototype.setInnerHeight=$.prototype.setScrollHeight;var tt=function(st){et(lt,st);function lt(ct,ht){var ut=st.call(this,ct,"-h")||this;return ut.scrollLeft=0,ut.height=ht.$scrollbarWidth,ut.inner.style.height=ut.element.style.height=(ut.height||15)+5+"px",ut}return lt.prototype.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},lt.prototype.getHeight=function(){return this.isVisible?this.height:0},lt.prototype.setWidth=function(ct){this.element.style.width=ct+"px"},lt.prototype.setInnerWidth=function(ct){this.inner.style.width=ct+"px"},lt.prototype.setScrollWidth=function(ct){this.inner.style.width=ct+"px"},lt.prototype.setScrollLeft=function(ct){this.scrollLeft!=ct&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=ct)},lt}(_);a.ScrollBar=$,a.ScrollBarV=$,a.ScrollBarH=tt,a.VScrollBar=$,a.HScrollBar=tt}),ace.define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(o,a,rt){var et=this&&this.__extends||function(){var tt=function(st,lt){return tt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ct,ht){ct.__proto__=ht}||function(ct,ht){for(var ut in ht)Object.prototype.hasOwnProperty.call(ht,ut)&&(ct[ut]=ht[ut])},tt(st,lt)};return function(st,lt){if(typeof lt!="function"&<!==null)throw new TypeError("Class extends value "+String(lt)+" is not a constructor or null");tt(st,lt);function ct(){this.constructor=st}st.prototype=lt===null?Object.create(lt):(ct.prototype=lt.prototype,new ct)}}(),ot=o("./lib/oop"),at=o("./lib/dom"),nt=o("./lib/event"),it=o("./lib/event_emitter").EventEmitter;at.importCssString(`.ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{ +`),this.moveCursorToPosition(Tt)},kt.prototype.setGhostText=function(Tt,$t){this.session.widgetManager||(this.session.widgetManager=new dt(this.session),this.session.widgetManager.attach(this)),this.renderer.setGhostText(Tt,$t)},kt.prototype.removeGhostText=function(){this.session.widgetManager&&this.renderer.removeGhostText()},kt.prototype.transposeLetters=function(){if(this.selection.isEmpty()){var Tt=this.getCursorPosition(),$t=Tt.column;if($t!==0){var It=this.session.getLine(Tt.row),Ot,Mt;$tKt.toLowerCase()?1:0});for(var Mt=new ct(0,0,0,0),Ot=Tt.first;Ot<=Tt.last;Ot++){var Dt=$t.getLine(Ot);Mt.start.row=Ot,Mt.end.row=Ot,Mt.end.column=Dt.length,$t.replace(Mt,It[Ot-Tt.first])}},kt.prototype.toggleCommentLines=function(){var Tt=this.session.getState(this.getCursorPosition().row),$t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(Tt,this.session,$t.first,$t.last)},kt.prototype.toggleBlockComment=function(){var Tt=this.getCursorPosition(),$t=this.session.getState(Tt.row),It=this.getSelectionRange();this.session.getMode().toggleBlockComment($t,this.session,It,Tt)},kt.prototype.getNumberAt=function(Tt,$t){var It=/[\-]?[0-9]+(?:\.[0-9]+)?/g;It.lastIndex=0;for(var Ot=this.session.getLine(Tt);It.lastIndex<$t;){var Mt=It.exec(Ot);if(Mt.index<=$t&&Mt.index+Mt[0].length>=$t){var Dt={value:Mt[0],start:Mt.index,end:Mt.index+Mt[0].length};return Dt}}return null},kt.prototype.modifyNumber=function(Tt){var $t=this.selection.getCursor().row,It=this.selection.getCursor().column,Ot=new ct($t,It-1,$t,It),Mt=this.session.getTextRange(Ot);if(!isNaN(parseFloat(Mt))&&isFinite(Mt)){var Dt=this.getNumberAt($t,It);if(Dt){var Bt=Dt.value.indexOf(".")>=0?Dt.start+Dt.value.indexOf(".")+1:Dt.end,Kt=Dt.start+Dt.value.length-Bt,Wt=parseFloat(Dt.value);Wt*=Math.pow(10,Kt),Bt!==Dt.end&&It=Bt&&Dt<=Kt&&(It=tr,Wt.selection.clearSelection(),Wt.moveCursorTo(Tt,Bt+Ot),Wt.selection.selectTo(Tt,Kt+Ot)),Bt=Kt});for(var zt=this.$toggleWordPairs,Ht,Zt=0;Zt=Kt&&Bt<=Wt&&qt.match(/((?:https?|ftp):\/\/[\S]+)/)){zt=qt.replace(/[\s:.,'";}\]]+$/,"");break}Kt=Wt}}catch(hr){It={error:hr}}finally{try{Zt&&!Zt.done&&(Ot=Ht.return)&&Ot.call(Ht)}finally{if(It)throw It.error}}return zt},kt.prototype.openLink=function(){var Tt=this.selection.getCursor(),$t=this.findLinkAt(Tt.row,Tt.column);return $t&&window.open($t,"_blank"),$t!=null},kt.prototype.removeLines=function(){var Tt=this.$getSelectedRows();this.session.removeFullLines(Tt.first,Tt.last),this.clearSelection()},kt.prototype.duplicateSelection=function(){var Tt=this.selection,$t=this.session,It=Tt.getRange(),Ot=Tt.isBackwards();if(It.isEmpty()){var Mt=It.start.row;$t.duplicateLines(Mt,Mt)}else{var Dt=Ot?It.start:It.end,Bt=$t.insert(Dt,$t.getTextRange(It));It.start=Dt,It.end=Bt,Tt.setSelectionRange(It,Ot)}},kt.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},kt.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},kt.prototype.moveText=function(Tt,$t,It){return this.session.moveText(Tt,$t,It)},kt.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},kt.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},kt.prototype.$moveLines=function(Tt,$t){var It,Ot,Mt=this.selection;if(!Mt.inMultiSelectMode||this.inVirtualSelectionMode){var Dt=Mt.toOrientedRange();It=this.$getSelectedRows(Dt),Ot=this.session.$moveLines(It.first,It.last,$t?0:Tt),$t&&Tt==-1&&(Ot=0),Dt.moveBy(Ot,0),Mt.fromOrientedRange(Dt)}else{var Bt=Mt.rangeList.ranges;Mt.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var Kt=0,Wt=0,zt=Bt.length,Ht=0;Hthr+1)break;hr=fr.last}for(Ht--,Kt=this.session.$moveLines(qt,hr,$t?0:Tt),$t&&Tt==-1&&(Zt=Ht+1);Zt<=Ht;)Bt[Zt].moveBy(Kt,0),Zt++;$t||(Kt=0),Wt+=Kt}Mt.fromOrientedRange(Mt.ranges[0]),Mt.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},kt.prototype.$getSelectedRows=function(Tt){return Tt=(Tt||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(Tt.start.row),last:this.session.getRowFoldEnd(Tt.end.row)}},kt.prototype.onCompositionStart=function(Tt){this.renderer.showComposition(Tt)},kt.prototype.onCompositionUpdate=function(Tt){this.renderer.setCompositionText(Tt)},kt.prototype.onCompositionEnd=function(){this.renderer.hideComposition()},kt.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},kt.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},kt.prototype.isRowVisible=function(Tt){return Tt>=this.getFirstVisibleRow()&&Tt<=this.getLastVisibleRow()},kt.prototype.isRowFullyVisible=function(Tt){return Tt>=this.renderer.getFirstFullyVisibleRow()&&Tt<=this.renderer.getLastFullyVisibleRow()},kt.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},kt.prototype.$moveByPage=function(Tt,$t){var It=this.renderer,Ot=this.renderer.layerConfig,Mt=Tt*Math.floor(Ot.height/Ot.lineHeight);$t===!0?this.selection.$moveSelection(function(){this.moveCursorBy(Mt,0)}):$t===!1&&(this.selection.moveCursorBy(Mt,0),this.selection.clearSelection());var Dt=It.scrollTop;It.scrollBy(0,Mt*Ot.lineHeight),$t!=null&&It.scrollCursorIntoView(null,.5),It.animateScrolling(Dt)},kt.prototype.selectPageDown=function(){this.$moveByPage(1,!0)},kt.prototype.selectPageUp=function(){this.$moveByPage(-1,!0)},kt.prototype.gotoPageDown=function(){this.$moveByPage(1,!1)},kt.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1)},kt.prototype.scrollPageDown=function(){this.$moveByPage(1)},kt.prototype.scrollPageUp=function(){this.$moveByPage(-1)},kt.prototype.scrollToRow=function(Tt){this.renderer.scrollToRow(Tt)},kt.prototype.scrollToLine=function(Tt,$t,It,Ot){this.renderer.scrollToLine(Tt,$t,It,Ot)},kt.prototype.centerSelection=function(){var Tt=this.getSelectionRange(),$t={row:Math.floor(Tt.start.row+(Tt.end.row-Tt.start.row)/2),column:Math.floor(Tt.start.column+(Tt.end.column-Tt.start.column)/2)};this.renderer.alignCursor($t,.5)},kt.prototype.getCursorPosition=function(){return this.selection.getCursor()},kt.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},kt.prototype.getSelectionRange=function(){return this.selection.getRange()},kt.prototype.selectAll=function(){this.selection.selectAll()},kt.prototype.clearSelection=function(){this.selection.clearSelection()},kt.prototype.moveCursorTo=function(Tt,$t){this.selection.moveCursorTo(Tt,$t)},kt.prototype.moveCursorToPosition=function(Tt){this.selection.moveCursorToPosition(Tt)},kt.prototype.jumpToMatching=function(Tt,$t){var It=this.getCursorPosition(),Ot=new gt(this.session,It.row,It.column),Mt=Ot.getCurrentToken(),Dt=0;Mt&&Mt.type.indexOf("tag-name")!==-1&&(Mt=Ot.stepBackward());var Bt=Mt||Ot.stepForward();if(Bt){var Kt,Wt=!1,zt={},Ht=It.column-Bt.start,Zt,qt={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(Bt.value.match(/[{}()\[\]]/g)){for(;Ht1?zt[Bt.value]++:Mt.value==="=0;--Dt)this.$tryReplace(It[Dt],Tt)&&Ot++;return this.selection.setSelectionRange(Mt),Ot},kt.prototype.$tryReplace=function(Tt,$t){var It=this.session.getTextRange(Tt);return $t=this.$search.replace(It,$t),$t!==null?(Tt.end=this.session.replace(Tt,$t),Tt):null},kt.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},kt.prototype.find=function(Tt,$t,It){$t||($t={}),typeof Tt=="string"||Tt instanceof RegExp?$t.needle=Tt:typeof Tt=="object"&&ot.mixin($t,Tt);var Ot=this.selection.getRange();$t.needle==null&&(Tt=this.session.getTextRange(Ot)||this.$search.$options.needle,Tt||(Ot=this.session.getWordRange(Ot.start.row,Ot.start.column),Tt=this.session.getTextRange(Ot)),this.$search.set({needle:Tt})),this.$search.set($t),$t.start||this.$search.set({start:Ot});var Mt=this.$search.find(this.session);if($t.preventScroll)return Mt;if(Mt)return this.revealRange(Mt,It),Mt;$t.backwards?Ot.start=Ot.end:Ot.end=Ot.start,this.selection.setRange(Ot)},kt.prototype.findNext=function(Tt,$t){this.find({skipCurrent:!0,backwards:!1},Tt,$t)},kt.prototype.findPrevious=function(Tt,$t){this.find(Tt,{skipCurrent:!0,backwards:!0},$t)},kt.prototype.revealRange=function(Tt,$t){this.session.unfold(Tt),this.selection.setSelectionRange(Tt);var It=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(Tt.start,Tt.end,.5),$t!==!1&&this.renderer.animateScrolling(It)},kt.prototype.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},kt.prototype.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},kt.prototype.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach(function(Tt){Tt.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()},kt.prototype.setAutoScrollEditorIntoView=function(Tt){if(Tt){var $t,It=this,Ot=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var Mt=this.$scrollAnchor;Mt.style.cssText="position:absolute",this.container.insertBefore(Mt,this.container.firstChild);var Dt=this.on("changeSelection",function(){Ot=!0}),Bt=this.renderer.on("beforeRender",function(){Ot&&($t=It.renderer.container.getBoundingClientRect())}),Kt=this.renderer.on("afterRender",function(){if(Ot&&$t&&(It.isFocused()||It.searchBox&&It.searchBox.isFocused())){var Wt=It.renderer,zt=Wt.$cursorLayer.$pixelPos,Ht=Wt.layerConfig,Zt=zt.top-Ht.offset;zt.top>=0&&Zt+$t.top<0?Ot=!0:zt.topwindow.innerHeight?Ot=!1:Ot=null,Ot!=null&&(Mt.style.top=Zt+"px",Mt.style.left=zt.left+"px",Mt.style.height=Ht.lineHeight+"px",Mt.scrollIntoView(Ot)),Ot=$t=null}});this.setAutoScrollEditorIntoView=function(Wt){Wt||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",Dt),this.renderer.off("afterRender",Kt),this.renderer.off("beforeRender",Bt))}}},kt.prototype.$resetCursorStyle=function(){var Tt=this.$cursorStyle||"ace",$t=this.renderer.$cursorLayer;$t&&($t.setSmoothBlinking(/smooth/.test(Tt)),$t.isBlinking=!this.$readOnly&&Tt!="wide",at.setCssClass($t.element,"ace_slim-cursors",/slim/.test(Tt)))},kt.prototype.prompt=function(Tt,$t,It){var Ot=this;mt.loadModule("ace/ext/prompt",function(Mt){Mt.prompt(Ot,Tt,$t,It)})},kt}();Ct.$uid=0,Ct.prototype.curOp=null,Ct.prototype.prevOp={},Ct.prototype.$mergeableCommands=["backspace","del","insertstring"],Ct.prototype.$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"],["&&","||"],["==","!="]],ot.implement(Ct.prototype,ht),mt.defineOptions(Ct.prototype,"editor",{selectionStyle:{set:function(kt){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:kt})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(kt){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(kt){this.textInput.setReadOnly(kt),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(kt){this.textInput.setCopyWithEmptySelection(kt)},initialValue:!1},cursorStyle:{set:function(kt){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(kt){this.setAutoScrollEditorIntoView(kt)}},keyboardHandler:{set:function(kt){this.setKeyboardHandler(kt)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(kt){this.session.setValue(kt)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(kt){this.setSession(kt)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(kt){this.renderer.$gutterLayer.setShowLineNumbers(kt),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),kt&&this.$relativeLineNumbers?Et.attach(this):Et.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(kt){this.$showLineNumbers&&kt?Et.attach(this):Et.detach(this)}},placeholder:{set:function(kt){this.$updatePlaceholder||(this.$updatePlaceholder=(function(){var Tt=this.session&&(this.renderer.$composition||this.session.getLength()>1||this.session.getLine(0).length>0);if(Tt&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),at.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!Tt&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),at.addCssClass(this.container,"ace_hasPlaceholder");var $t=at.createElement("div");$t.className="ace_placeholder",$t.textContent=this.$placeholder||"",this.renderer.placeholderNode=$t,this.renderer.content.appendChild(this.renderer.placeholderNode)}else!Tt&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"")}).bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},enableKeyboardAccessibility:{set:function(kt){var Tt={name:"blurTextInput",description:"Set focus to the editor content div to allow tabbing through the page",bindKey:"Esc",exec:function(Ot){Ot.blur(),Ot.renderer.scroller.focus()},readOnly:!0},$t=function(Ot){if(Ot.target==this.renderer.scroller&&Ot.keyCode===_t.enter){Ot.preventDefault();var Mt=this.getCursorPosition().row;this.isRowVisible(Mt)||this.scrollToLine(Mt,!0,!0),this.focus()}},It;kt?(this.renderer.enableKeyboardAccessibility=!0,this.renderer.keyboardFocusClassName="ace_keyboard-focus",this.textInput.getElement().setAttribute("tabindex",-1),this.textInput.setNumberOfExtraLines(it.isWin?3:0),this.renderer.scroller.setAttribute("tabindex",0),this.renderer.scroller.setAttribute("role","group"),this.renderer.scroller.setAttribute("aria-roledescription",xt("editor.scroller.aria-roledescription","editor")),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute("aria-label",xt("editor.scroller.aria-label","Editor content, press Enter to start editing, press Escape to exit")),this.renderer.scroller.addEventListener("keyup",$t.bind(this)),this.commands.addCommand(Tt),this.renderer.$gutter.setAttribute("tabindex",0),this.renderer.$gutter.setAttribute("aria-hidden",!1),this.renderer.$gutter.setAttribute("role","group"),this.renderer.$gutter.setAttribute("aria-roledescription",xt("editor.gutter.aria-roledescription","editor")),this.renderer.$gutter.setAttribute("aria-label",xt("editor.gutter.aria-label","Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit")),this.renderer.$gutter.classList.add(this.renderer.keyboardFocusClassName),this.renderer.content.setAttribute("aria-hidden",!0),It||(It=new St(this)),It.addListener(),this.textInput.setAriaOptions({setLabel:!0})):(this.renderer.enableKeyboardAccessibility=!1,this.textInput.getElement().setAttribute("tabindex",0),this.textInput.setNumberOfExtraLines(0),this.renderer.scroller.setAttribute("tabindex",-1),this.renderer.scroller.removeAttribute("role"),this.renderer.scroller.removeAttribute("aria-roledescription"),this.renderer.scroller.classList.remove(this.renderer.keyboardFocusClassName),this.renderer.scroller.removeAttribute("aria-label"),this.renderer.scroller.removeEventListener("keyup",$t.bind(this)),this.commands.removeCommand(Tt),this.renderer.content.removeAttribute("aria-hidden"),this.renderer.$gutter.setAttribute("tabindex",-1),this.renderer.$gutter.setAttribute("aria-hidden",!0),this.renderer.$gutter.removeAttribute("role"),this.renderer.$gutter.removeAttribute("aria-roledescription"),this.renderer.$gutter.removeAttribute("aria-label"),this.renderer.$gutter.classList.remove(this.renderer.keyboardFocusClassName),It&&It.removeListener())},initialValue:!1},textInputAriaLabel:{set:function(kt){this.$textInputAriaLabel=kt},initialValue:""},enableMobileMenu:{set:function(kt){this.$enableMobileMenu=kt},initialValue:!0},customScrollbar:"renderer",hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",highlightIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",useResizeObserver:"renderer",useSvgGutterIcons:"renderer",showFoldedAnnotations:"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 Et={getText:function(kt,Tt){return(Math.abs(kt.selection.lead.row-Tt)||Tt+1+(Tt<9?"·":""))+""},getWidth:function(kt,Tt,$t){return Math.max(Tt.toString().length,($t.lastRow+1).toString().length,2)*$t.characterWidth},update:function(kt,Tt){Tt.renderer.$loop.schedule(Tt.renderer.CHANGE_GUTTER)},attach:function(kt){kt.renderer.$gutterLayer.$renderer=this,kt.on("changeSelection",this.update),this.update(null,kt)},detach:function(kt){kt.renderer.$gutterLayer.$renderer==this&&(kt.renderer.$gutterLayer.$renderer=null),kt.off("changeSelection",this.update),this.update(null,kt)}};a.Editor=Ct}),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(o,a,rt){var tt=o("../lib/dom"),ot=function(){function at(nt,it){this.element=nt,this.canvasHeight=it||5e5,this.element.style.height=this.canvasHeight*2+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0}return at.prototype.moveContainer=function(nt){tt.translate(this.element,0,-(nt.firstRowScreen*nt.lineHeight%this.canvasHeight)-nt.offset*this.$offsetCoefficient)},at.prototype.pageChanged=function(nt,it){return Math.floor(nt.firstRowScreen*nt.lineHeight/this.canvasHeight)!==Math.floor(it.firstRowScreen*it.lineHeight/this.canvasHeight)},at.prototype.computeLineTop=function(nt,it,j){var _=it.firstRowScreen*it.lineHeight,$=Math.floor(_/this.canvasHeight),et=j.documentToScreenRow(nt,0)*it.lineHeight;return et-$*this.canvasHeight},at.prototype.computeLineHeight=function(nt,it,j){return it.lineHeight*j.getRowLineCount(nt)},at.prototype.getLength=function(){return this.cells.length},at.prototype.get=function(nt){return this.cells[nt]},at.prototype.shift=function(){this.$cacheCell(this.cells.shift())},at.prototype.pop=function(){this.$cacheCell(this.cells.pop())},at.prototype.push=function(nt){if(Array.isArray(nt)){this.cells.push.apply(this.cells,nt);for(var it=tt.createFragment(this.element),j=0;jpt&&(dt=ut.end.row+1,ut=lt.getNextFoldLine(dt,ut),pt=ut?ut.start.row:1/0),dt>ht){for(;this.$lines.getLength()>gt+1;)this.$lines.pop();break}mt=this.$lines.get(++gt),mt?mt.row=dt:(mt=this.$lines.createCell(dt,st,this.session,$),this.$lines.push(mt)),this.$renderCell(mt,st,ut,dt),dt++}this._signal("afterRender"),this.$updateGutterWidth(st)},et.prototype.$updateGutterWidth=function(st){var lt=this.session,ct=lt.gutterRenderer||this.$renderer,ht=lt.$firstLineNumber,ut=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||lt.$useWrapMode)&&(ut=lt.getLength()+ht-1);var pt=ct?ct.getWidth(lt,ut,st):ut.toString().length*st.characterWidth,mt=this.$padding||this.$computePadding();pt+=mt.left+mt.right,pt!==this.gutterWidth&&!isNaN(pt)&&(this.gutterWidth=pt,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",pt))},et.prototype.$updateCursorRow=function(){if(this.$highlightGutterLine){var st=this.session.selection.getCursor();this.$cursorRow!==st.row&&(this.$cursorRow=st.row)}},et.prototype.updateLineHighlight=function(){if(this.$highlightGutterLine){var st=this.session.selection.cursor.row;if(this.$cursorRow=st,!(this.$cursorCell&&this.$cursorCell.row==st)){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var lt=this.$lines.cells;this.$cursorCell=null;for(var ct=0;ct=this.$cursorRow){if(ht.row>this.$cursorRow){var ut=this.session.getFoldLine(this.$cursorRow);if(ct>0&&ut&&ut.start.row==lt[ct-1].row)ht=lt[ct-1];else break}ht.element.className="ace_gutter-active-line "+ht.element.className,this.$cursorCell=ht;break}}}}},et.prototype.scrollLines=function(st){var lt=this.config;if(this.config=st,this.$updateCursorRow(),this.$lines.pageChanged(lt,st))return this.update(st);this.$lines.moveContainer(st);var ct=Math.min(st.lastRow+st.gutterOffset,this.session.getLength()-1),ht=this.oldLastRow;if(this.oldLastRow=ct,!lt||ht0;ut--)this.$lines.shift();if(ht>ct)for(var ut=this.session.getFoldedRowCount(ct+1,ht);ut>0;ut--)this.$lines.pop();st.firstRowht&&this.$lines.push(this.$renderLines(st,ht+1,ct)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(st)},et.prototype.$renderLines=function(st,lt,ct){for(var ht=[],ut=lt,pt=this.session.getNextFoldLine(ut),mt=pt?pt.start.row:1/0;ut>mt&&(ut=pt.end.row+1,pt=this.session.getNextFoldLine(ut,pt),mt=pt?pt.start.row:1/0),!(ut>ct);){var gt=this.$lines.createCell(ut,st,this.session,$);this.$renderCell(gt,st,pt,ut),ht.push(gt),ut++}return ht},et.prototype.$renderCell=function(st,lt,ct,ht){var ut=st.element,pt=this.session,mt=ut.childNodes[0],gt=ut.childNodes[1],dt=ut.childNodes[2],St=dt.firstChild,xt=pt.$firstLineNumber,yt=pt.$breakpoints,_t=pt.$decorations,Ct=pt.gutterRenderer||this.$renderer,Et=this.$showFoldWidgets&&pt.foldWidgets,kt=ct?ct.start.row:Number.MAX_VALUE,Tt=lt.lineHeight+"px",$t=this.$useSvgGutterIcons?"ace_gutter-cell_svg-icons ":"ace_gutter-cell ",It=this.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",Ot=(Ct?Ct.getText(pt,ht):ht+xt).toString();if(this.$highlightGutterLine&&(ht==this.$cursorRow||ct&&ht=kt&&this.$cursorRow<=ct.end.row)&&($t+="ace_gutter-active-line ",this.$cursorCell!=st&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=st)),yt[ht]&&($t+=yt[ht]),_t[ht]&&($t+=_t[ht]),this.$annotations[ht]&&ht!==kt&&($t+=this.$annotations[ht].className),Et){var Mt=Et[ht];Mt==null&&(Mt=Et[ht]=pt.getFoldWidget(ht))}if(Mt){var Dt="ace_fold-widget ace_"+Mt,Bt=Mt=="start"&&ht==kt&&htct.right-lt.right)return"foldWidgets"},et}();_.prototype.$fixedWidth=!1,_.prototype.$highlightGutterLine=!0,_.prototype.$renderer="",_.prototype.$showLineNumbers=!0,_.prototype.$showFoldWidgets=!0,ot.implement(_.prototype,nt);function $(et){var st=document.createTextNode("");et.appendChild(st);var lt=tt.createElement("span");et.appendChild(lt);var ct=tt.createElement("span");et.appendChild(ct);var ht=tt.createElement("span");return ct.appendChild(ht),et}a.Gutter=_}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(o,a,rt){var tt=o("../range").Range,ot=o("../lib/dom"),at=function(){function it(j){this.element=ot.createElement("div"),this.element.className="ace_layer ace_marker-layer",j.appendChild(this.element)}return it.prototype.setPadding=function(j){this.$padding=j},it.prototype.setSession=function(j){this.session=j},it.prototype.setMarkers=function(j){this.markers=j},it.prototype.elt=function(j,_){var $=this.i!=-1&&this.element.childNodes[this.i];$?this.i++:($=document.createElement("div"),this.element.appendChild($),this.i=-1),$.style.cssText=_,$.className=j},it.prototype.update=function(j){if(j){this.config=j,this.i=0;var _;for(var $ in this.markers){var et=this.markers[$];if(!et.range){et.update(_,this,this.session,j);continue}var st=et.range.clipRows(j.firstRow,j.lastRow);if(!st.isEmpty())if(st=st.toScreenRange(this.session),et.renderer){var lt=this.$getTop(st.start.row,j),ct=this.$padding+st.start.column*j.characterWidth;et.renderer(_,st,ct,lt,j)}else et.type=="fullLine"?this.drawFullLineMarker(_,st,et.clazz,j):et.type=="screenLine"?this.drawScreenLineMarker(_,st,et.clazz,j):st.isMultiLine()?et.type=="text"?this.drawTextMarker(_,st,et.clazz,j):this.drawMultiLineMarker(_,st,et.clazz,j):this.drawSingleLineMarker(_,st,et.clazz+" ace_start ace_br15",j)}if(this.i!=-1)for(;this.igt,ut==ht),et,ut==ht?0:1,st)},it.prototype.drawMultiLineMarker=function(j,_,$,et,st){var lt=this.$padding,ct=et.lineHeight,ht=this.$getTop(_.start.row,et),ut=lt+_.start.column*et.characterWidth;if(st=st||"",this.session.$bidiHandler.isBidiRow(_.start.row)){var pt=_.clone();pt.end.row=pt.start.row,pt.end.column=this.session.getLine(pt.start.row).length,this.drawBidiSingleLineMarker(j,pt,$+" ace_br1 ace_start",et,null,st)}else this.elt($+" ace_br1 ace_start","height:"+ct+"px;right:0;top:"+ht+"px;left:"+ut+"px;"+(st||""));if(this.session.$bidiHandler.isBidiRow(_.end.row)){var pt=_.clone();pt.start.row=pt.end.row,pt.start.column=0,this.drawBidiSingleLineMarker(j,pt,$+" ace_br12",et,null,st)}else{ht=this.$getTop(_.end.row,et);var mt=_.end.column*et.characterWidth;this.elt($+" ace_br12","height:"+ct+"px;width:"+mt+"px;top:"+ht+"px;left:"+lt+"px;"+(st||""))}if(ct=(_.end.row-_.start.row-1)*et.lineHeight,!(ct<=0)){ht=this.$getTop(_.start.row+1,et);var gt=(_.start.column?1:0)|(_.end.column?0:8);this.elt($+(gt?" ace_br"+gt:""),"height:"+ct+"px;right:0;top:"+ht+"px;left:"+lt+"px;"+(st||""))}},it.prototype.drawSingleLineMarker=function(j,_,$,et,st,lt){if(this.session.$bidiHandler.isBidiRow(_.start.row))return this.drawBidiSingleLineMarker(j,_,$,et,st,lt);var ct=et.lineHeight,ht=(_.end.column+(st||0)-_.start.column)*et.characterWidth,ut=this.$getTop(_.start.row,et),pt=this.$padding+_.start.column*et.characterWidth;this.elt($,"height:"+ct+"px;width:"+ht+"px;top:"+ut+"px;left:"+pt+"px;"+(lt||""))},it.prototype.drawBidiSingleLineMarker=function(j,_,$,et,st,lt){var ct=et.lineHeight,ht=this.$getTop(_.start.row,et),ut=this.$padding,pt=this.session.$bidiHandler.getSelections(_.start.column,_.end.column);pt.forEach(function(mt){this.elt($,"height:"+ct+"px;width:"+(mt.width+(st||0))+"px;top:"+ht+"px;left:"+(ut+mt.left)+"px;"+(lt||""))},this)},it.prototype.drawFullLineMarker=function(j,_,$,et,st){var lt=this.$getTop(_.start.row,et),ct=et.lineHeight;_.start.row!=_.end.row&&(ct+=this.$getTop(_.end.row,et)-lt),this.elt($,"height:"+ct+"px;top:"+lt+"px;left:0;right:0;"+(st||""))},it.prototype.drawScreenLineMarker=function(j,_,$,et,st){var lt=this.$getTop(_.start.row,et),ct=et.lineHeight;this.elt($,"height:"+ct+"px;top:"+lt+"px;left:0;right:0;"+(st||""))},it}();at.prototype.$padding=0;function nt(it,j,_,$){return(it?1:0)|(j?2:0)|(_?4:0)|($?8:0)}a.Marker=at}),ace.define("ace/layer/text_util",["require","exports","module"],function(o,a,rt){var tt=new Set(["text","rparen","lparen"]);a.isTextToken=function(ot){return tt.has(ot)}}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter","ace/config","ace/layer/text_util"],function(o,a,rt){var tt=o("../lib/oop"),ot=o("../lib/dom"),at=o("../lib/lang"),nt=o("./lines").Lines,it=o("../lib/event_emitter").EventEmitter,j=o("../config").nls,_=o("./text_util").isTextToken,$=function(){function et(st){this.dom=ot,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",st.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new nt(this.element)}return et.prototype.$updateEolChar=function(){var st=this.session.doc,lt=st.getNewLineCharacter()==` +`&&st.getNewLineMode()!="windows",ct=lt?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=ct)return this.EOL_CHAR=ct,!0},et.prototype.setPadding=function(st){this.$padding=st,this.element.style.margin="0 "+st+"px"},et.prototype.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},et.prototype.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},et.prototype.$setFontMetrics=function(st){this.$fontMetrics=st,this.$fontMetrics.on("changeCharacterSize",(function(lt){this._signal("changeCharacterSize",lt)}).bind(this)),this.$pollSizeChanges()},et.prototype.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},et.prototype.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},et.prototype.setSession=function(st){this.session=st,st&&this.$computeTabString()},et.prototype.setShowInvisibles=function(st){return this.showInvisibles==st?!1:(this.showInvisibles=st,typeof st=="string"?(this.showSpaces=/tab/i.test(st),this.showTabs=/space/i.test(st),this.showEOL=/eol/i.test(st)):this.showSpaces=this.showTabs=this.showEOL=st,this.$computeTabString(),!0)},et.prototype.setDisplayIndentGuides=function(st){return this.displayIndentGuides==st?!1:(this.displayIndentGuides=st,this.$computeTabString(),!0)},et.prototype.setHighlightIndentGuides=function(st){return this.$highlightIndentGuides===st?!1:(this.$highlightIndentGuides=st,st)},et.prototype.$computeTabString=function(){var st=this.session.getTabSize();this.tabSize=st;for(var lt=this.$tabStrings=[0],ct=1;ctxt&&(dt=St.end.row+1,St=this.session.getNextFoldLine(dt,St),xt=St?St.start.row:1/0),!(dt>ut);){var yt=pt[mt++];if(yt){this.dom.removeChildren(yt),this.$renderLine(yt,dt,dt==xt?St:!1),gt&&(yt.style.top=this.$lines.computeLineTop(dt,st,this.session)+"px");var _t=st.lineHeight*this.session.getRowLength(dt)+"px";yt.style.height!=_t&&(gt=!0,yt.style.height=_t)}dt++}if(gt)for(;mt0;ut--)this.$lines.shift();if(lt.lastRow>st.lastRow)for(var ut=this.session.getFoldedRowCount(st.lastRow+1,lt.lastRow);ut>0;ut--)this.$lines.pop();st.firstRowlt.lastRow&&this.$lines.push(this.$renderLinesFragment(st,lt.lastRow+1,st.lastRow)),this.$highlightIndentGuide()},et.prototype.$renderLinesFragment=function(st,lt,ct){for(var ht=[],ut=lt,pt=this.session.getNextFoldLine(ut),mt=pt?pt.start.row:1/0;ut>mt&&(ut=pt.end.row+1,pt=this.session.getNextFoldLine(ut,pt),mt=pt?pt.start.row:1/0),!(ut>ct);){var gt=this.$lines.createCell(ut,st,this.session),dt=gt.element;this.dom.removeChildren(dt),ot.setStyle(dt.style,"height",this.$lines.computeLineHeight(ut,st,this.session)+"px"),ot.setStyle(dt.style,"top",this.$lines.computeLineTop(ut,st,this.session)+"px"),this.$renderLine(dt,ut,ut==mt?pt:!1),this.$useLineGroups()?dt.className="ace_line_group":dt.className="ace_line",ht.push(gt),ut++}return ht},et.prototype.update=function(st){this.$lines.moveContainer(st),this.config=st;for(var lt=st.firstRow,ct=st.lastRow,ht=this.$lines;ht.getLength();)ht.pop();ht.push(this.$renderLinesFragment(st,lt,ct))},et.prototype.$renderToken=function(st,lt,ct,ht){for(var ut=this,pt=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC\u2066\u2067\u2068\u202A\u202B\u202D\u202E\u202C\u2069]+)|(\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,mt=this.dom.createFragment(this.element),gt,dt=0;gt=pt.exec(ht);){var St=gt[1],xt=gt[2],yt=gt[3],_t=gt[4],Ct=gt[5];if(!(!ut.showSpaces&&xt)){var Et=dt!=gt.index?ht.slice(dt,gt.index):"";if(dt=gt.index+gt[0].length,Et&&mt.appendChild(this.dom.createTextNode(Et,this.element)),St){var kt=ut.session.getScreenTabSize(lt+gt.index);mt.appendChild(ut.$tabStrings[kt].cloneNode(!0)),lt+=kt-1}else if(xt)if(ut.showSpaces){var Tt=this.dom.createElement("span");Tt.className="ace_invisible ace_invisible_space",Tt.textContent=at.stringRepeat(ut.SPACE_CHAR,xt.length),mt.appendChild(Tt)}else mt.appendChild(this.dom.createTextNode(xt,this.element));else if(yt){var Tt=this.dom.createElement("span");Tt.className="ace_invisible ace_invisible_space ace_invalid",Tt.textContent=at.stringRepeat(ut.SPACE_CHAR,yt.length),mt.appendChild(Tt)}else if(_t){lt+=1;var Tt=this.dom.createElement("span");Tt.style.width=ut.config.characterWidth*2+"px",Tt.className=ut.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",Tt.textContent=ut.showSpaces?ut.SPACE_CHAR:_t,mt.appendChild(Tt)}else if(Ct){lt+=1;var Tt=this.dom.createElement("span");Tt.style.width=ut.config.characterWidth*2+"px",Tt.className="ace_cjk",Tt.textContent=Ct,mt.appendChild(Tt)}}}if(mt.appendChild(this.dom.createTextNode(dt?ht.slice(dt):ht,this.element)),_(ct.type))st.appendChild(mt);else{var $t="ace_"+ct.type.replace(/\./g," ace_"),Tt=this.dom.createElement("span");ct.type=="fold"&&(Tt.style.width=ct.value.length*this.config.characterWidth+"px",Tt.setAttribute("title",j("inline-fold.closed.title","Unfold code"))),Tt.className=$t,Tt.appendChild(mt),st.appendChild(Tt)}return lt+ht.length},et.prototype.renderIndentGuide=function(st,lt,ct){var ht=lt.search(this.$indentGuideRe);if(ht<=0||ht>=ct)return lt;if(lt[0]==" "){ht-=ht%this.tabSize;for(var ut=ht/this.tabSize,pt=0;ptpt[mt].start.row?this.$highlightIndentGuideMarker.dir=-1:this.$highlightIndentGuideMarker.dir=1;break}}if(!this.$highlightIndentGuideMarker.end&&st[lt.row]!==""&<.column===st[lt.row].length){this.$highlightIndentGuideMarker.dir=1;for(var mt=lt.row+1;mt0){for(var ut=0;ut=this.$highlightIndentGuideMarker.start+1){if(ht.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(ht,lt)}}else for(var ct=st.length-1;ct>=0;ct--){var ht=st[ct];if(this.$highlightIndentGuideMarker.end&&ht.row=pt;)mt=this.$renderToken(gt,mt,St,xt.substring(0,pt-ht)),xt=xt.substring(pt-ht),ht=pt,gt=this.$createLineElement(),st.appendChild(gt),gt.appendChild(this.dom.createTextNode(at.stringRepeat(" ",ct.indent),this.element)),ut++,mt=0,pt=ct[ut]||Number.MAX_VALUE;xt.length!=0&&(ht+=xt.length,mt=this.$renderToken(gt,mt,St,xt))}}ct[ct.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(gt,mt,null,"",!0)},et.prototype.$renderSimpleLine=function(st,lt){for(var ct=0,ht=0;htthis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(st,ct,ut,pt);ct=this.$renderToken(st,ct,ut,pt)}}},et.prototype.$renderOverflowMessage=function(st,lt,ct,ht,ut){ct&&this.$renderToken(st,lt,ct,ht.slice(0,this.MAX_LINE_LENGTH-lt));var pt=this.dom.createElement("span");pt.className="ace_inline_button ace_keyword ace_toggle_wrap",pt.textContent=ut?"":"",st.appendChild(pt)},et.prototype.$renderLine=function(st,lt,ct){if(!ct&&ct!=!1&&(ct=this.session.getFoldLine(lt)),ct)var ht=this.$getFoldLineTokens(lt,ct);else var ht=this.session.getTokens(lt);var ut=st;if(ht.length){var pt=this.session.getRowSplitData(lt);if(pt&&pt.length){this.$renderWrappedLine(st,ht,pt);var ut=st.lastChild}else{var ut=st;this.$useLineGroups()&&(ut=this.$createLineElement(),st.appendChild(ut)),this.$renderSimpleLine(ut,ht)}}else this.$useLineGroups()&&(ut=this.$createLineElement(),st.appendChild(ut));if(this.showEOL&&ut){ct&&(lt=ct.end.row);var mt=this.dom.createElement("span");mt.className="ace_invisible ace_invisible_eol",mt.textContent=lt==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,ut.appendChild(mt)}},et.prototype.$getFoldLineTokens=function(st,lt){var ct=this.session,ht=[];function ut(mt,gt,dt){for(var St=0,xt=0;xt+mt[St].value.lengthdt-gt&&(yt=yt.substring(0,dt-gt)),ht.push({type:mt[St].type,value:yt}),xt=gt+yt.length,St+=1}for(;xtdt?ht.push({type:mt[St].type,value:yt.substring(0,dt-xt)}):ht.push(mt[St]),xt+=yt.length,St+=1}}var pt=ct.getTokens(st);return lt.walk(function(mt,gt,dt,St,xt){mt!=null?ht.push({type:"fold",value:mt}):(xt&&(pt=ct.getTokens(gt)),pt.length&&ut(pt,St,dt))},lt.end.row,this.session.getLine(lt.end.row).length),ht},et.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},et}();$.prototype.EOF_CHAR="¶",$.prototype.EOL_CHAR_LF="¬",$.prototype.EOL_CHAR_CRLF="¤",$.prototype.EOL_CHAR=$.prototype.EOL_CHAR_LF,$.prototype.TAB_CHAR="—",$.prototype.SPACE_CHAR="·",$.prototype.$padding=0,$.prototype.MAX_LINE_LENGTH=1e4,$.prototype.showInvisibles=!1,$.prototype.showSpaces=!1,$.prototype.showTabs=!1,$.prototype.showEOL=!1,$.prototype.displayIndentGuides=!0,$.prototype.$highlightIndentGuides=!0,$.prototype.$tabStrings=[],$.prototype.destroy={},$.prototype.onChangeTabSize=$.prototype.$computeTabString,tt.implement($.prototype,it),a.Text=$}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(o,a,rt){var tt=o("../lib/dom"),ot=function(){function at(nt){this.element=tt.createElement("div"),this.element.className="ace_layer ace_cursor-layer",nt.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),tt.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)}return at.prototype.$updateOpacity=function(nt){for(var it=this.cursors,j=it.length;j--;)tt.setStyle(it[j].style,"opacity",nt?"":"0")},at.prototype.$startCssAnimation=function(){for(var nt=this.cursors,it=nt.length;it--;)nt[it].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=!0,setTimeout((function(){this.$isAnimating&&tt.addCssClass(this.element,"ace_animate-blinking")}).bind(this))},at.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,tt.removeCssClass(this.element,"ace_animate-blinking")},at.prototype.setPadding=function(nt){this.$padding=nt},at.prototype.setSession=function(nt){this.session=nt},at.prototype.setBlinking=function(nt){nt!=this.isBlinking&&(this.isBlinking=nt,this.restartTimer())},at.prototype.setBlinkInterval=function(nt){nt!=this.blinkInterval&&(this.blinkInterval=nt,this.restartTimer())},at.prototype.setSmoothBlinking=function(nt){nt!=this.smoothBlinking&&(this.smoothBlinking=nt,tt.setCssClass(this.element,"ace_smooth-blinking",nt),this.$updateCursors(!0),this.restartTimer())},at.prototype.addCursor=function(){var nt=tt.createElement("div");return nt.className="ace_cursor",this.element.appendChild(nt),this.cursors.push(nt),nt},at.prototype.removeCursor=function(){if(this.cursors.length>1){var nt=this.cursors.pop();return nt.parentNode.removeChild(nt),nt}},at.prototype.hideCursor=function(){this.isVisible=!1,tt.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},at.prototype.showCursor=function(){this.isVisible=!0,tt.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},at.prototype.restartTimer=function(){var nt=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,tt.removeCssClass(this.element,"ace_smooth-blinking")),nt(!0),!this.isBlinking||!this.blinkInterval||!this.isVisible){this.$stopCssAnimation();return}if(this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout((function(){this.$isSmoothBlinking&&tt.addCssClass(this.element,"ace_smooth-blinking")}).bind(this))),tt.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var it=(function(){this.timeoutId=setTimeout(function(){nt(!1)},.6*this.blinkInterval)}).bind(this);this.intervalId=setInterval(function(){nt(!0),it()},this.blinkInterval),it()}},at.prototype.getPixelPosition=function(nt,it){if(!this.config||!this.session)return{left:0,top:0};nt||(nt=this.session.selection.getCursor());var j=this.session.documentToScreenPosition(nt),_=this.$padding+(this.session.$bidiHandler.isBidiRow(j.row,nt.row)?this.session.$bidiHandler.getPosLeft(j.column):j.column*this.config.characterWidth),$=(j.row-(it?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:_,top:$}},at.prototype.isCursorInView=function(nt,it){return nt.top>=0&&nt.topnt.height+nt.offset||et.top<0)&&j>1)){var st=this.cursors[_++]||this.addCursor(),lt=st.style;this.drawCursor?this.drawCursor(st,et,nt,it[j],this.session):this.isCursorInView(et,nt)?(tt.setStyle(lt,"display","block"),tt.translate(st,et.left,et.top),tt.setStyle(lt,"width",Math.round(nt.characterWidth)+"px"),tt.setStyle(lt,"height",nt.lineHeight+"px")):tt.setStyle(lt,"display","none")}}for(;this.cursors.length>_;)this.removeCursor();var ct=this.session.getOverwrite();this.$setOverwrite(ct),this.$pixelPos=et,this.restartTimer()},at.prototype.$setOverwrite=function(nt){nt!=this.overwrite&&(this.overwrite=nt,nt?tt.addCssClass(this.element,"ace_overwrite-cursors"):tt.removeCssClass(this.element,"ace_overwrite-cursors"))},at.prototype.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)},at}();ot.prototype.$padding=0,ot.prototype.drawCursor=null,a.Cursor=ot}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(o,a,rt){var tt=this&&this.__extends||function(){var st=function(lt,ct){return st=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ht,ut){ht.__proto__=ut}||function(ht,ut){for(var pt in ut)Object.prototype.hasOwnProperty.call(ut,pt)&&(ht[pt]=ut[pt])},st(lt,ct)};return function(lt,ct){if(typeof ct!="function"&&ct!==null)throw new TypeError("Class extends value "+String(ct)+" is not a constructor or null");st(lt,ct);function ht(){this.constructor=lt}lt.prototype=ct===null?Object.create(ct):(ht.prototype=ct.prototype,new ht)}}(),ot=o("./lib/oop"),at=o("./lib/dom"),nt=o("./lib/event"),it=o("./lib/event_emitter").EventEmitter,j=32768,_=function(){function st(lt,ct){this.element=at.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+ct,this.inner=at.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),lt.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,nt.addListener(this.element,"scroll",this.onScroll.bind(this)),nt.addListener(this.element,"mousedown",nt.preventDefault)}return st.prototype.setVisible=function(lt){this.element.style.display=lt?"":"none",this.isVisible=lt,this.coeff=1},st}();ot.implement(_.prototype,it);var $=function(st){tt(lt,st);function lt(ct,ht){var ut=st.call(this,ct,"-v")||this;return ut.scrollTop=0,ut.scrollHeight=0,ht.$scrollbarWidth=ut.width=at.scrollbarWidth(ct.ownerDocument),ut.inner.style.width=ut.element.style.width=(ut.width||15)+5+"px",ut.$minWidth=0,ut}return lt.prototype.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,this.coeff!=1){var ct=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-ct)/(this.coeff-ct)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},lt.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},lt.prototype.setHeight=function(ct){this.element.style.height=ct+"px"},lt.prototype.setScrollHeight=function(ct){this.scrollHeight=ct,ct>j?(this.coeff=j/ct,ct=j):this.coeff!=1&&(this.coeff=1),this.inner.style.height=ct+"px"},lt.prototype.setScrollTop=function(ct){this.scrollTop!=ct&&(this.skipEvent=!0,this.scrollTop=ct,this.element.scrollTop=ct*this.coeff)},lt}(_);$.prototype.setInnerHeight=$.prototype.setScrollHeight;var et=function(st){tt(lt,st);function lt(ct,ht){var ut=st.call(this,ct,"-h")||this;return ut.scrollLeft=0,ut.height=ht.$scrollbarWidth,ut.inner.style.height=ut.element.style.height=(ut.height||15)+5+"px",ut}return lt.prototype.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},lt.prototype.getHeight=function(){return this.isVisible?this.height:0},lt.prototype.setWidth=function(ct){this.element.style.width=ct+"px"},lt.prototype.setInnerWidth=function(ct){this.inner.style.width=ct+"px"},lt.prototype.setScrollWidth=function(ct){this.inner.style.width=ct+"px"},lt.prototype.setScrollLeft=function(ct){this.scrollLeft!=ct&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=ct)},lt}(_);a.ScrollBar=$,a.ScrollBarV=$,a.ScrollBarH=et,a.VScrollBar=$,a.HScrollBar=et}),ace.define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(o,a,rt){var tt=this&&this.__extends||function(){var et=function(st,lt){return et=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ct,ht){ct.__proto__=ht}||function(ct,ht){for(var ut in ht)Object.prototype.hasOwnProperty.call(ht,ut)&&(ct[ut]=ht[ut])},et(st,lt)};return function(st,lt){if(typeof lt!="function"&<!==null)throw new TypeError("Class extends value "+String(lt)+" is not a constructor or null");et(st,lt);function ct(){this.constructor=st}st.prototype=lt===null?Object.create(lt):(ct.prototype=lt.prototype,new ct)}}(),ot=o("./lib/oop"),at=o("./lib/dom"),nt=o("./lib/event"),it=o("./lib/event_emitter").EventEmitter;at.importCssString(`.ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{ position: absolute; background: rgba(128, 128, 128, 0.6); -moz-box-sizing: border-box; @@ -640,7 +640,7 @@ Error generating stack: `+et.message+` .ace_editor>.ace_sb_grabbed { z-index: 8; background: #000; -}`,"ace_scrollbar.css",!1);var j=function(){function tt(st,lt){this.element=at.createElement("div"),this.element.className="ace_sb"+lt,this.inner=at.createElement("div"),this.inner.className="",this.element.appendChild(this.inner),this.VScrollWidth=12,this.HScrollHeight=12,st.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,nt.addMultiMouseDownListener(this.element,[500,300,300],this,"onMouseDown")}return tt.prototype.setVisible=function(st){this.element.style.display=st?"":"none",this.isVisible=st,this.coeff=1},tt}();ot.implement(j.prototype,it);var _=function(tt){et(st,tt);function st(lt,ct){var ht=tt.call(this,lt,"-v")||this;return ht.scrollTop=0,ht.scrollHeight=0,ht.parent=lt,ht.width=ht.VScrollWidth,ht.renderer=ct,ht.inner.style.width=ht.element.style.width=(ht.width||15)+"px",ht.$minWidth=0,ht}return st.prototype.onMouseDown=function(lt,ct){if(lt==="mousedown"&&!(nt.getButton(ct)!==0||ct.detail===2)){if(ct.target===this.inner){var ht=this,ut=ct.clientY,pt=function(_t){ut=_t.clientY},mt=function(){clearInterval(xt)},gt=ct.clientY,dt=this.thumbTop,St=function(){if(ut!==void 0){var _t=ht.scrollTopFromThumbTop(dt+ut-gt);_t!==ht.scrollTop&&ht._emit("scroll",{data:_t})}};nt.capture(this.inner,pt,mt);var xt=setInterval(St,20);return nt.preventDefault(ct)}var yt=ct.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2;return this._emit("scroll",{data:this.scrollTopFromThumbTop(yt)}),nt.preventDefault(ct)}},st.prototype.getHeight=function(){return this.height},st.prototype.scrollTopFromThumbTop=function(lt){var ct=lt*(this.pageHeight-this.viewHeight)/(this.slideHeight-this.thumbHeight);return ct=ct>>0,ct<0?ct=0:ct>this.pageHeight-this.viewHeight&&(ct=this.pageHeight-this.viewHeight),ct},st.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},st.prototype.setHeight=function(lt){this.height=Math.max(0,lt),this.slideHeight=this.height,this.viewHeight=this.height,this.setScrollHeight(this.pageHeight,!0)},st.prototype.setScrollHeight=function(lt,ct){this.pageHeight===lt&&!ct||(this.pageHeight=lt,this.thumbHeight=this.slideHeight*this.viewHeight/this.pageHeight,this.thumbHeight>this.slideHeight&&(this.thumbHeight=this.slideHeight),this.thumbHeight<15&&(this.thumbHeight=15),this.inner.style.height=this.thumbHeight+"px",this.scrollTop>this.pageHeight-this.viewHeight&&(this.scrollTop=this.pageHeight-this.viewHeight,this.scrollTop<0&&(this.scrollTop=0),this._emit("scroll",{data:this.scrollTop})))},st.prototype.setScrollTop=function(lt){this.scrollTop=lt,lt<0&&(lt=0),this.thumbTop=lt*(this.slideHeight-this.thumbHeight)/(this.pageHeight-this.viewHeight),this.inner.style.top=this.thumbTop+"px"},st}(j);_.prototype.setInnerHeight=_.prototype.setScrollHeight;var $=function(tt){et(st,tt);function st(lt,ct){var ht=tt.call(this,lt,"-h")||this;return ht.scrollLeft=0,ht.scrollWidth=0,ht.height=ht.HScrollHeight,ht.inner.style.height=ht.element.style.height=(ht.height||12)+"px",ht.renderer=ct,ht}return st.prototype.onMouseDown=function(lt,ct){if(lt==="mousedown"&&!(nt.getButton(ct)!==0||ct.detail===2)){if(ct.target===this.inner){var ht=this,ut=ct.clientX,pt=function(_t){ut=_t.clientX},mt=function(){clearInterval(xt)},gt=ct.clientX,dt=this.thumbLeft,St=function(){if(ut!==void 0){var _t=ht.scrollLeftFromThumbLeft(dt+ut-gt);_t!==ht.scrollLeft&&ht._emit("scroll",{data:_t})}};nt.capture(this.inner,pt,mt);var xt=setInterval(St,20);return nt.preventDefault(ct)}var yt=ct.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2;return this._emit("scroll",{data:this.scrollLeftFromThumbLeft(yt)}),nt.preventDefault(ct)}},st.prototype.getHeight=function(){return this.isVisible?this.height:0},st.prototype.scrollLeftFromThumbLeft=function(lt){var ct=lt*(this.pageWidth-this.viewWidth)/(this.slideWidth-this.thumbWidth);return ct=ct>>0,ct<0?ct=0:ct>this.pageWidth-this.viewWidth&&(ct=this.pageWidth-this.viewWidth),ct},st.prototype.setWidth=function(lt){this.width=Math.max(0,lt),this.element.style.width=this.width+"px",this.slideWidth=this.width,this.viewWidth=this.width,this.setScrollWidth(this.pageWidth,!0)},st.prototype.setScrollWidth=function(lt,ct){this.pageWidth===lt&&!ct||(this.pageWidth=lt,this.thumbWidth=this.slideWidth*this.viewWidth/this.pageWidth,this.thumbWidth>this.slideWidth&&(this.thumbWidth=this.slideWidth),this.thumbWidth<15&&(this.thumbWidth=15),this.inner.style.width=this.thumbWidth+"px",this.scrollLeft>this.pageWidth-this.viewWidth&&(this.scrollLeft=this.pageWidth-this.viewWidth,this.scrollLeft<0&&(this.scrollLeft=0),this._emit("scroll",{data:this.scrollLeft})))},st.prototype.setScrollLeft=function(lt){this.scrollLeft=lt,lt<0&&(lt=0),this.thumbLeft=lt*(this.slideWidth-this.thumbWidth)/(this.pageWidth-this.viewWidth),this.inner.style.left=this.thumbLeft+"px"},st}(j);$.prototype.setInnerWidth=$.prototype.setScrollWidth,a.ScrollBar=_,a.ScrollBarV=_,a.ScrollBarH=$,a.VScrollBar=_,a.HScrollBar=$}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(o,a,rt){var et=o("./lib/event"),ot=function(){function at(nt,it){this.onRender=nt,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=it||window;var j=this;this._flush=function(_){j.pending=!1;var $=j.changes;if($&&(et.blockIdle(100),j.changes=0,j.onRender($)),j.changes){if(j.$recursionLimit--<0)return;j.schedule()}else j.$recursionLimit=2}}return at.prototype.schedule=function(nt){this.changes=this.changes|nt,this.changes&&!this.pending&&(et.nextFrame(this._flush),this.pending=!0)},at.prototype.clear=function(nt){var it=this.changes;return this.changes=0,it},at}();a.RenderLoop=ot}),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(o,a,rt){var et=o("../lib/oop"),ot=o("../lib/dom"),at=o("../lib/lang"),nt=o("../lib/event"),it=o("../lib/useragent"),j=o("../lib/event_emitter").EventEmitter,_=512,$=typeof ResizeObserver=="function",tt=200,st=function(){function lt(ct){this.el=ot.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=ot.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=ot.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),ct.appendChild(this.el),this.$measureNode.textContent=at.stringRepeat("X",_),this.$characterSize={width:0,height:0},$?this.$addObserver():this.checkForSizeChanges()}return lt.prototype.$setMeasureNodeStyles=function(ct,ht){ct.width=ct.height="auto",ct.left=ct.top="0px",ct.visibility="hidden",ct.position="absolute",ct.whiteSpace="pre",it.isIE<8?ct["font-family"]="inherit":ct.font="inherit",ct.overflow=ht?"hidden":"visible"},lt.prototype.checkForSizeChanges=function(ct){if(ct===void 0&&(ct=this.$measureSizes()),ct&&(this.$characterSize.width!==ct.width||this.$characterSize.height!==ct.height)){this.$measureNode.style.fontWeight="bold";var ht=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=ct,this.charSizes=Object.create(null),this.allowBoldFonts=ht&&ht.width===ct.width&&ht.height===ct.height,this._emit("changeCharacterSize",{data:ct})}},lt.prototype.$addObserver=function(){var ct=this;this.$observer=new window.ResizeObserver(function(ht){ct.checkForSizeChanges()}),this.$observer.observe(this.$measureNode)},lt.prototype.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var ct=this;return this.$pollSizeChangesTimer=nt.onIdle(function ht(){ct.checkForSizeChanges(),nt.onIdle(ht,500)},500)},lt.prototype.setPolling=function(ct){ct?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},lt.prototype.$measureSizes=function(ct){var ht={height:(ct||this.$measureNode).clientHeight,width:(ct||this.$measureNode).clientWidth/_};return ht.width===0||ht.height===0?null:ht},lt.prototype.$measureCharWidth=function(ct){this.$main.textContent=at.stringRepeat(ct,_);var ht=this.$main.getBoundingClientRect();return ht.width/_},lt.prototype.getCharacterWidth=function(ct){var ht=this.charSizes[ct];return ht===void 0&&(ht=this.charSizes[ct]=this.$measureCharWidth(ct)/this.$characterSize.width),ht},lt.prototype.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},lt.prototype.$getZoom=function(ct){return!ct||!ct.parentElement?1:(Number(window.getComputedStyle(ct).zoom)||1)*this.$getZoom(ct.parentElement)},lt.prototype.$initTransformMeasureNodes=function(){var ct=function(ht,ut){return["div",{style:"position: absolute;top:"+ht+"px;left:"+ut+"px;"}]};this.els=ot.buildDom([ct(0,0),ct(tt,0),ct(0,tt),ct(tt,tt)],this.el)},lt.prototype.transformCoordinates=function(ct,ht){if(ct){var ut=this.$getZoom(this.el);ct=dt(1/ut,ct)}function pt(Bt,Kt,Wt){var zt=Bt[1]*Kt[0]-Bt[0]*Kt[1];return[(-Kt[1]*Wt[0]+Kt[0]*Wt[1])/zt,(+Bt[1]*Wt[0]-Bt[0]*Wt[1])/zt]}function mt(Bt,Kt){return[Bt[0]-Kt[0],Bt[1]-Kt[1]]}function gt(Bt,Kt){return[Bt[0]+Kt[0],Bt[1]+Kt[1]]}function dt(Bt,Kt){return[Bt*Kt[0],Bt*Kt[1]]}this.els||this.$initTransformMeasureNodes();function St(Bt){var Kt=Bt.getBoundingClientRect();return[Kt.left,Kt.top]}var xt=St(this.els[0]),yt=St(this.els[1]),_t=St(this.els[2]),Ct=St(this.els[3]),Et=pt(mt(Ct,yt),mt(Ct,_t),mt(gt(yt,_t),gt(Ct,xt))),kt=dt(1+Et[0],mt(yt,xt)),Tt=dt(1+Et[1],mt(_t,xt));if(ht){var $t=ht,It=Et[0]*$t[0]/tt+Et[1]*$t[1]/tt+1,Ot=gt(dt($t[0],kt),dt($t[1],Tt));return gt(dt(1/It/tt,Ot),xt)}var Mt=mt(ct,xt),Dt=pt(mt(kt,dt(Et[0],Mt)),mt(Tt,dt(Et[1],Mt)),Mt);return dt(tt,Dt)},lt}();st.prototype.$characterSize={width:0,height:0},et.implement(st.prototype,j),a.FontMetrics=st}),ace.define("ace/css/editor-css",["require","exports","module"],function(o,a,rt){rt.exports=` +}`,"ace_scrollbar.css",!1);var j=function(){function et(st,lt){this.element=at.createElement("div"),this.element.className="ace_sb"+lt,this.inner=at.createElement("div"),this.inner.className="",this.element.appendChild(this.inner),this.VScrollWidth=12,this.HScrollHeight=12,st.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,nt.addMultiMouseDownListener(this.element,[500,300,300],this,"onMouseDown")}return et.prototype.setVisible=function(st){this.element.style.display=st?"":"none",this.isVisible=st,this.coeff=1},et}();ot.implement(j.prototype,it);var _=function(et){tt(st,et);function st(lt,ct){var ht=et.call(this,lt,"-v")||this;return ht.scrollTop=0,ht.scrollHeight=0,ht.parent=lt,ht.width=ht.VScrollWidth,ht.renderer=ct,ht.inner.style.width=ht.element.style.width=(ht.width||15)+"px",ht.$minWidth=0,ht}return st.prototype.onMouseDown=function(lt,ct){if(lt==="mousedown"&&!(nt.getButton(ct)!==0||ct.detail===2)){if(ct.target===this.inner){var ht=this,ut=ct.clientY,pt=function(_t){ut=_t.clientY},mt=function(){clearInterval(xt)},gt=ct.clientY,dt=this.thumbTop,St=function(){if(ut!==void 0){var _t=ht.scrollTopFromThumbTop(dt+ut-gt);_t!==ht.scrollTop&&ht._emit("scroll",{data:_t})}};nt.capture(this.inner,pt,mt);var xt=setInterval(St,20);return nt.preventDefault(ct)}var yt=ct.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2;return this._emit("scroll",{data:this.scrollTopFromThumbTop(yt)}),nt.preventDefault(ct)}},st.prototype.getHeight=function(){return this.height},st.prototype.scrollTopFromThumbTop=function(lt){var ct=lt*(this.pageHeight-this.viewHeight)/(this.slideHeight-this.thumbHeight);return ct=ct>>0,ct<0?ct=0:ct>this.pageHeight-this.viewHeight&&(ct=this.pageHeight-this.viewHeight),ct},st.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},st.prototype.setHeight=function(lt){this.height=Math.max(0,lt),this.slideHeight=this.height,this.viewHeight=this.height,this.setScrollHeight(this.pageHeight,!0)},st.prototype.setScrollHeight=function(lt,ct){this.pageHeight===lt&&!ct||(this.pageHeight=lt,this.thumbHeight=this.slideHeight*this.viewHeight/this.pageHeight,this.thumbHeight>this.slideHeight&&(this.thumbHeight=this.slideHeight),this.thumbHeight<15&&(this.thumbHeight=15),this.inner.style.height=this.thumbHeight+"px",this.scrollTop>this.pageHeight-this.viewHeight&&(this.scrollTop=this.pageHeight-this.viewHeight,this.scrollTop<0&&(this.scrollTop=0),this._emit("scroll",{data:this.scrollTop})))},st.prototype.setScrollTop=function(lt){this.scrollTop=lt,lt<0&&(lt=0),this.thumbTop=lt*(this.slideHeight-this.thumbHeight)/(this.pageHeight-this.viewHeight),this.inner.style.top=this.thumbTop+"px"},st}(j);_.prototype.setInnerHeight=_.prototype.setScrollHeight;var $=function(et){tt(st,et);function st(lt,ct){var ht=et.call(this,lt,"-h")||this;return ht.scrollLeft=0,ht.scrollWidth=0,ht.height=ht.HScrollHeight,ht.inner.style.height=ht.element.style.height=(ht.height||12)+"px",ht.renderer=ct,ht}return st.prototype.onMouseDown=function(lt,ct){if(lt==="mousedown"&&!(nt.getButton(ct)!==0||ct.detail===2)){if(ct.target===this.inner){var ht=this,ut=ct.clientX,pt=function(_t){ut=_t.clientX},mt=function(){clearInterval(xt)},gt=ct.clientX,dt=this.thumbLeft,St=function(){if(ut!==void 0){var _t=ht.scrollLeftFromThumbLeft(dt+ut-gt);_t!==ht.scrollLeft&&ht._emit("scroll",{data:_t})}};nt.capture(this.inner,pt,mt);var xt=setInterval(St,20);return nt.preventDefault(ct)}var yt=ct.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2;return this._emit("scroll",{data:this.scrollLeftFromThumbLeft(yt)}),nt.preventDefault(ct)}},st.prototype.getHeight=function(){return this.isVisible?this.height:0},st.prototype.scrollLeftFromThumbLeft=function(lt){var ct=lt*(this.pageWidth-this.viewWidth)/(this.slideWidth-this.thumbWidth);return ct=ct>>0,ct<0?ct=0:ct>this.pageWidth-this.viewWidth&&(ct=this.pageWidth-this.viewWidth),ct},st.prototype.setWidth=function(lt){this.width=Math.max(0,lt),this.element.style.width=this.width+"px",this.slideWidth=this.width,this.viewWidth=this.width,this.setScrollWidth(this.pageWidth,!0)},st.prototype.setScrollWidth=function(lt,ct){this.pageWidth===lt&&!ct||(this.pageWidth=lt,this.thumbWidth=this.slideWidth*this.viewWidth/this.pageWidth,this.thumbWidth>this.slideWidth&&(this.thumbWidth=this.slideWidth),this.thumbWidth<15&&(this.thumbWidth=15),this.inner.style.width=this.thumbWidth+"px",this.scrollLeft>this.pageWidth-this.viewWidth&&(this.scrollLeft=this.pageWidth-this.viewWidth,this.scrollLeft<0&&(this.scrollLeft=0),this._emit("scroll",{data:this.scrollLeft})))},st.prototype.setScrollLeft=function(lt){this.scrollLeft=lt,lt<0&&(lt=0),this.thumbLeft=lt*(this.slideWidth-this.thumbWidth)/(this.pageWidth-this.viewWidth),this.inner.style.left=this.thumbLeft+"px"},st}(j);$.prototype.setInnerWidth=$.prototype.setScrollWidth,a.ScrollBar=_,a.ScrollBarV=_,a.ScrollBarH=$,a.VScrollBar=_,a.HScrollBar=$}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(o,a,rt){var tt=o("./lib/event"),ot=function(){function at(nt,it){this.onRender=nt,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=it||window;var j=this;this._flush=function(_){j.pending=!1;var $=j.changes;if($&&(tt.blockIdle(100),j.changes=0,j.onRender($)),j.changes){if(j.$recursionLimit--<0)return;j.schedule()}else j.$recursionLimit=2}}return at.prototype.schedule=function(nt){this.changes=this.changes|nt,this.changes&&!this.pending&&(tt.nextFrame(this._flush),this.pending=!0)},at.prototype.clear=function(nt){var it=this.changes;return this.changes=0,it},at}();a.RenderLoop=ot}),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(o,a,rt){var tt=o("../lib/oop"),ot=o("../lib/dom"),at=o("../lib/lang"),nt=o("../lib/event"),it=o("../lib/useragent"),j=o("../lib/event_emitter").EventEmitter,_=512,$=typeof ResizeObserver=="function",et=200,st=function(){function lt(ct){this.el=ot.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=ot.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=ot.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),ct.appendChild(this.el),this.$measureNode.textContent=at.stringRepeat("X",_),this.$characterSize={width:0,height:0},$?this.$addObserver():this.checkForSizeChanges()}return lt.prototype.$setMeasureNodeStyles=function(ct,ht){ct.width=ct.height="auto",ct.left=ct.top="0px",ct.visibility="hidden",ct.position="absolute",ct.whiteSpace="pre",it.isIE<8?ct["font-family"]="inherit":ct.font="inherit",ct.overflow=ht?"hidden":"visible"},lt.prototype.checkForSizeChanges=function(ct){if(ct===void 0&&(ct=this.$measureSizes()),ct&&(this.$characterSize.width!==ct.width||this.$characterSize.height!==ct.height)){this.$measureNode.style.fontWeight="bold";var ht=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=ct,this.charSizes=Object.create(null),this.allowBoldFonts=ht&&ht.width===ct.width&&ht.height===ct.height,this._emit("changeCharacterSize",{data:ct})}},lt.prototype.$addObserver=function(){var ct=this;this.$observer=new window.ResizeObserver(function(ht){ct.checkForSizeChanges()}),this.$observer.observe(this.$measureNode)},lt.prototype.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var ct=this;return this.$pollSizeChangesTimer=nt.onIdle(function ht(){ct.checkForSizeChanges(),nt.onIdle(ht,500)},500)},lt.prototype.setPolling=function(ct){ct?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},lt.prototype.$measureSizes=function(ct){var ht={height:(ct||this.$measureNode).clientHeight,width:(ct||this.$measureNode).clientWidth/_};return ht.width===0||ht.height===0?null:ht},lt.prototype.$measureCharWidth=function(ct){this.$main.textContent=at.stringRepeat(ct,_);var ht=this.$main.getBoundingClientRect();return ht.width/_},lt.prototype.getCharacterWidth=function(ct){var ht=this.charSizes[ct];return ht===void 0&&(ht=this.charSizes[ct]=this.$measureCharWidth(ct)/this.$characterSize.width),ht},lt.prototype.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},lt.prototype.$getZoom=function(ct){return!ct||!ct.parentElement?1:(Number(window.getComputedStyle(ct).zoom)||1)*this.$getZoom(ct.parentElement)},lt.prototype.$initTransformMeasureNodes=function(){var ct=function(ht,ut){return["div",{style:"position: absolute;top:"+ht+"px;left:"+ut+"px;"}]};this.els=ot.buildDom([ct(0,0),ct(et,0),ct(0,et),ct(et,et)],this.el)},lt.prototype.transformCoordinates=function(ct,ht){if(ct){var ut=this.$getZoom(this.el);ct=dt(1/ut,ct)}function pt(Bt,Kt,Wt){var zt=Bt[1]*Kt[0]-Bt[0]*Kt[1];return[(-Kt[1]*Wt[0]+Kt[0]*Wt[1])/zt,(+Bt[1]*Wt[0]-Bt[0]*Wt[1])/zt]}function mt(Bt,Kt){return[Bt[0]-Kt[0],Bt[1]-Kt[1]]}function gt(Bt,Kt){return[Bt[0]+Kt[0],Bt[1]+Kt[1]]}function dt(Bt,Kt){return[Bt*Kt[0],Bt*Kt[1]]}this.els||this.$initTransformMeasureNodes();function St(Bt){var Kt=Bt.getBoundingClientRect();return[Kt.left,Kt.top]}var xt=St(this.els[0]),yt=St(this.els[1]),_t=St(this.els[2]),Ct=St(this.els[3]),Et=pt(mt(Ct,yt),mt(Ct,_t),mt(gt(yt,_t),gt(Ct,xt))),kt=dt(1+Et[0],mt(yt,xt)),Tt=dt(1+Et[1],mt(_t,xt));if(ht){var $t=ht,It=Et[0]*$t[0]/et+Et[1]*$t[1]/et+1,Ot=gt(dt($t[0],kt),dt($t[1],Tt));return gt(dt(1/It/et,Ot),xt)}var Mt=mt(ct,xt),Dt=pt(mt(kt,dt(Et[0],Mt)),mt(Tt,dt(Et[1],Mt)),Mt);return dt(et,Dt)},lt}();st.prototype.$characterSize={width:0,height:0},tt.implement(st.prototype,j),a.FontMetrics=st}),ace.define("ace/css/editor-css",["require","exports","module"],function(o,a,rt){rt.exports=` .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;} @@ -1315,9 +1315,9 @@ Error generating stack: `+et.message+` .ace_hidden_token { display: none; -}`}),ace.define("ace/layer/decorators",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter"],function(o,a,rt){var et=o("../lib/dom"),ot=o("../lib/oop"),at=o("../lib/event_emitter").EventEmitter,nt=function(){function it(j,_){this.canvas=et.createElement("canvas"),this.renderer=_,this.pixelRatio=1,this.maxHeight=_.layerConfig.maxHeight,this.lineHeight=_.layerConfig.lineHeight,this.canvasHeight=j.parent.scrollHeight,this.heightRatio=this.canvasHeight/this.maxHeight,this.canvasWidth=j.width,this.minDecorationHeight=2*this.pixelRatio|0,this.halfMinDecorationHeight=this.minDecorationHeight/2|0,this.canvas.width=this.canvasWidth,this.canvas.height=this.canvasHeight,this.canvas.style.top="0px",this.canvas.style.right="0px",this.canvas.style.zIndex="7px",this.canvas.style.position="absolute",this.colors={},this.colors.dark={error:"rgba(255, 18, 18, 1)",warning:"rgba(18, 136, 18, 1)",info:"rgba(18, 18, 136, 1)"},this.colors.light={error:"rgb(255,51,51)",warning:"rgb(32,133,72)",info:"rgb(35,68,138)"},j.element.appendChild(this.canvas)}return it.prototype.$updateDecorators=function(j){var _=this.renderer.theme.isDark===!0?this.colors.dark:this.colors.light;if(j){this.maxHeight=j.maxHeight,this.lineHeight=j.lineHeight,this.canvasHeight=j.height;var $=(j.lastRow+1)*this.lineHeight;$Et.priority?1:0}var lt=this.renderer.session.$annotations;if(tt.clearRect(0,0,this.canvas.width,this.canvas.height),lt){var ct={info:1,warning:2,error:3};lt.forEach(function(Ct){Ct.priority=ct[Ct.type]||null}),lt=lt.sort(st);for(var ht=this.renderer.session.$foldData,ut=0;utthis.canvasHeight&&(yt=this.canvasHeight-this.halfMinDecorationHeight),dt=Math.round(yt-this.halfMinDecorationHeight),St=Math.round(yt+this.halfMinDecorationHeight)}tt.fillStyle=_[lt[ut].type]||null,tt.fillRect(0,gt,this.canvasWidth,St-dt)}}var _t=this.renderer.session.selection.getCursor();if(_t){var mt=this.compensateFoldRows(_t.row,ht),gt=Math.round((_t.row-mt)*this.lineHeight*this.heightRatio);tt.fillStyle="rgba(0, 0, 0, 0.5)",tt.fillRect(0,gt,this.canvasWidth,2)}},it.prototype.compensateFoldRows=function(j,_){var $=0;if(_&&_.length>0)for(var tt=0;tt<_.length;tt++)j>_[tt].start.row&&j<_[tt].end.row?$+=j-_[tt].start.row:j>=_[tt].end.row&&($+=_[tt].end.row-_[tt].start.row);return $},it}();ot.implement(nt.prototype,at),a.Decorator=nt}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/scrollbar_custom","ace/scrollbar_custom","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/css/editor-css","ace/layer/decorators","ace/lib/useragent","ace/layer/text_util"],function(o,a,rt){var et=o("./lib/oop"),ot=o("./lib/dom"),at=o("./lib/lang"),nt=o("./config"),it=o("./layer/gutter").Gutter,j=o("./layer/marker").Marker,_=o("./layer/text").Text,$=o("./layer/cursor").Cursor,tt=o("./scrollbar").HScrollBar,st=o("./scrollbar").VScrollBar,lt=o("./scrollbar_custom").HScrollBar,ct=o("./scrollbar_custom").VScrollBar,ht=o("./renderloop").RenderLoop,ut=o("./layer/font_metrics").FontMetrics,pt=o("./lib/event_emitter").EventEmitter,mt=o("./css/editor-css"),gt=o("./layer/decorators").Decorator,dt=o("./lib/useragent"),St=o("./layer/text_util").isTextToken;ot.importCssString(mt,"ace_editor.css",!1);var xt=function(){function yt(_t,Ct){var Et=this;this.container=_t||ot.createElement("div"),ot.addCssClass(this.container,"ace_editor"),ot.HI_DPI&&ot.addCssClass(this.container,"ace_hidpi"),this.setTheme(Ct),nt.get("useStrictCSP")==null&&nt.set("useStrictCSP",!1),this.$gutter=ot.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden","true"),this.scroller=ot.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=ot.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new it(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new j(this.content);var kt=this.$textLayer=new _(this.content);this.canvas=kt.element,this.$markerFront=new j(this.content),this.$cursorLayer=new $(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new st(this.container,this),this.scrollBarH=new tt(this.container,this),this.scrollBarV.on("scroll",function(Tt){Et.$scrollAnimation||Et.session.setScrollTop(Tt.data-Et.scrollMargin.top)}),this.scrollBarH.on("scroll",function(Tt){Et.$scrollAnimation||Et.session.setScrollLeft(Tt.data-Et.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new ut(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",function(Tt){Et.updateCharacterSize(),Et.onResize(!0,Et.gutterWidth,Et.$size.width,Et.$size.height),Et._signal("changeCharacterSize",Tt)}),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=!dt.isIOS,this.$loop=new ht(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),this.$addResizeObserver(),nt.resetOptions(this),nt._signal("renderer",this)}return yt.prototype.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(),ot.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},yt.prototype.setSession=function(_t){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=_t,_t&&this.scrollMargin.top&&_t.getScrollTop()<=0&&_t.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(_t),this.$markerBack.setSession(_t),this.$markerFront.setSession(_t),this.$gutterLayer.setSession(_t),this.$textLayer.setSession(_t),_t&&(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))},yt.prototype.updateLines=function(_t,Ct,Et){if(Ct===void 0&&(Ct=1/0),this.$changedLines?(this.$changedLines.firstRow>_t&&(this.$changedLines.firstRow=_t),this.$changedLines.lastRowthis.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},yt.prototype.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},yt.prototype.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},yt.prototype.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},yt.prototype.updateFull=function(_t){_t?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},yt.prototype.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},yt.prototype.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},yt.prototype.onResize=function(_t,Ct,Et,kt){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=_t?1:0;var Tt=this.container;kt||(kt=Tt.clientHeight||Tt.scrollHeight),!kt&&this.$maxLines&&this.lineHeight>1&&(!Tt.style.height||Tt.style.height=="0px")&&(Tt.style.height="1px",kt=Tt.clientHeight||Tt.scrollHeight),Et||(Et=Tt.clientWidth||Tt.scrollWidth);var $t=this.$updateCachedSize(_t,Ct,Et,kt);if(this.$resizeTimer&&this.$resizeTimer.cancel(),!this.$size.scrollerHeight||!Et&&!kt)return this.resizing=0;_t&&(this.$gutterLayer.$padding=null),_t?this.$renderChanges($t|this.$changes,!0):this.$loop.schedule($t|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.$customScrollbar&&this.$updateCustomScrollbar(!0)}},yt.prototype.$updateCachedSize=function(_t,Ct,Et,kt){kt-=this.$extraHeight||0;var Tt=0,$t=this.$size,It={width:$t.width,height:$t.height,scrollerHeight:$t.scrollerHeight,scrollerWidth:$t.scrollerWidth};if(kt&&(_t||$t.height!=kt)&&($t.height=kt,Tt|=this.CHANGE_SIZE,$t.scrollerHeight=$t.height,this.$horizScroll&&($t.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight($t.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",Tt=Tt|this.CHANGE_SCROLL),Et&&(_t||$t.width!=Et)){Tt|=this.CHANGE_SIZE,$t.width=Et,Ct==null&&(Ct=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=Ct,ot.setStyle(this.scrollBarH.element.style,"left",Ct+"px"),ot.setStyle(this.scroller.style,"left",Ct+this.margin.left+"px"),$t.scrollerWidth=Math.max(0,Et-Ct-this.scrollBarV.getWidth()-this.margin.h),ot.setStyle(this.$gutter.style,"left",this.margin.left+"px");var Ot=this.scrollBarV.getWidth()+"px";ot.setStyle(this.scrollBarH.element.style,"right",Ot),ot.setStyle(this.scroller.style,"right",Ot),ot.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),this.scrollBarH.setWidth($t.scrollerWidth),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||_t)&&(Tt|=this.CHANGE_FULL)}return $t.$dirty=!Et||!kt,Tt&&this._signal("resize",It),Tt},yt.prototype.onGutterResize=function(_t){var Ct=this.$showGutter?_t:0;Ct!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,Ct,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()?this.$loop.schedule(this.CHANGE_FULL):this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},yt.prototype.adjustWrapLimit=function(){var _t=this.$size.scrollerWidth-this.$padding*2,Ct=Math.floor(_t/this.characterWidth);return this.session.adjustWrapLimit(Ct,this.$showPrintMargin&&this.$printMarginColumn)},yt.prototype.setAnimatedScroll=function(_t){this.setOption("animatedScroll",_t)},yt.prototype.getAnimatedScroll=function(){return this.$animatedScroll},yt.prototype.setShowInvisibles=function(_t){this.setOption("showInvisibles",_t),this.session.$bidiHandler.setShowInvisibles(_t)},yt.prototype.getShowInvisibles=function(){return this.getOption("showInvisibles")},yt.prototype.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},yt.prototype.setDisplayIndentGuides=function(_t){this.setOption("displayIndentGuides",_t)},yt.prototype.getHighlightIndentGuides=function(){return this.getOption("highlightIndentGuides")},yt.prototype.setHighlightIndentGuides=function(_t){this.setOption("highlightIndentGuides",_t)},yt.prototype.setShowPrintMargin=function(_t){this.setOption("showPrintMargin",_t)},yt.prototype.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},yt.prototype.setPrintMarginColumn=function(_t){this.setOption("printMarginColumn",_t)},yt.prototype.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},yt.prototype.getShowGutter=function(){return this.getOption("showGutter")},yt.prototype.setShowGutter=function(_t){return this.setOption("showGutter",_t)},yt.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},yt.prototype.setFadeFoldWidgets=function(_t){this.setOption("fadeFoldWidgets",_t)},yt.prototype.setHighlightGutterLine=function(_t){this.setOption("highlightGutterLine",_t)},yt.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},yt.prototype.$updatePrintMargin=function(){if(!(!this.$showPrintMargin&&!this.$printMarginEl)){if(!this.$printMarginEl){var _t=ot.createElement("div");_t.className="ace_layer ace_print-margin-layer",this.$printMarginEl=ot.createElement("div"),this.$printMarginEl.className="ace_print-margin",_t.appendChild(this.$printMarginEl),this.content.insertBefore(_t,this.content.firstChild)}var Ct=this.$printMarginEl.style;Ct.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",Ct.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&this.session.$wrap==-1&&this.adjustWrapLimit()}},yt.prototype.getContainerElement=function(){return this.container},yt.prototype.getMouseEventTarget=function(){return this.scroller},yt.prototype.getTextAreaContainer=function(){return this.container},yt.prototype.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var _t=this.textarea.style,Ct=this.$composition;if(!this.$keepTextAreaAtCursor&&!Ct){ot.translate(this.textarea,-100,0);return}var Et=this.$cursorLayer.$pixelPos;if(Et){Ct&&Ct.markerRange&&(Et=this.$cursorLayer.getPixelPosition(Ct.markerRange.start,!0));var kt=this.layerConfig,Tt=Et.top,$t=Et.left;Tt-=kt.offset;var It=Ct&&Ct.useTextareaForIME||dt.isMobile?this.lineHeight:1;if(Tt<0||Tt>kt.height-It){ot.translate(this.textarea,0,0);return}var Ot=1,Mt=this.$size.height-It;if(!Ct)Tt+=this.lineHeight;else if(Ct.useTextareaForIME){var Dt=this.textarea.value;Ot=this.characterWidth*this.session.$getStringScreenWidth(Dt)[0]}else Tt+=this.lineHeight+2;$t-=this.scrollLeft,$t>this.$size.scrollerWidth-Ot&&($t=this.$size.scrollerWidth-Ot),$t+=this.gutterWidth+this.margin.left,ot.setStyle(_t,"height",It+"px"),ot.setStyle(_t,"width",Ot+"px"),ot.translate(this.textarea,Math.min($t,this.$size.scrollerWidth-Ot),Math.min(Tt,Mt))}}},yt.prototype.getFirstVisibleRow=function(){return this.layerConfig.firstRow},yt.prototype.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},yt.prototype.getLastFullyVisibleRow=function(){var _t=this.layerConfig,Ct=_t.lastRow,Et=this.session.documentToScreenRow(Ct,0)*_t.lineHeight;return Et-this.session.getScrollTop()>_t.height-_t.lineHeight?Ct-1:Ct},yt.prototype.getLastVisibleRow=function(){return this.layerConfig.lastRow},yt.prototype.setPadding=function(_t){this.$padding=_t,this.$textLayer.setPadding(_t),this.$cursorLayer.setPadding(_t),this.$markerFront.setPadding(_t),this.$markerBack.setPadding(_t),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},yt.prototype.setScrollMargin=function(_t,Ct,Et,kt){var Tt=this.scrollMargin;Tt.top=_t|0,Tt.bottom=Ct|0,Tt.right=kt|0,Tt.left=Et|0,Tt.v=Tt.top+Tt.bottom,Tt.h=Tt.left+Tt.right,Tt.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-Tt.top),this.updateFull()},yt.prototype.setMargin=function(_t,Ct,Et,kt){var Tt=this.margin;Tt.top=_t|0,Tt.bottom=Ct|0,Tt.right=kt|0,Tt.left=Et|0,Tt.v=Tt.top+Tt.bottom,Tt.h=Tt.left+Tt.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},yt.prototype.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},yt.prototype.setHScrollBarAlwaysVisible=function(_t){this.setOption("hScrollBarAlwaysVisible",_t)},yt.prototype.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},yt.prototype.setVScrollBarAlwaysVisible=function(_t){this.setOption("vScrollBarAlwaysVisible",_t)},yt.prototype.$updateScrollBarV=function(){var _t=this.layerConfig.maxHeight,Ct=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(_t-=(Ct-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>_t-Ct&&(_t=this.scrollTop+Ct,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(_t+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},yt.prototype.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},yt.prototype.freeze=function(){this.$frozen=!0},yt.prototype.unfreeze=function(){this.$frozen=!1},yt.prototype.$renderChanges=function(_t,Ct){if(this.$changes&&(_t|=this.$changes,this.$changes=0),!this.session||!this.container.offsetWidth||this.$frozen||!_t&&!Ct){this.$changes|=_t;return}if(this.$size.$dirty)return this.$changes|=_t,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",_t),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var Et=this.layerConfig;if(_t&this.CHANGE_FULL||_t&this.CHANGE_SIZE||_t&this.CHANGE_TEXT||_t&this.CHANGE_LINES||_t&this.CHANGE_SCROLL||_t&this.CHANGE_H_SCROLL){if(_t|=this.$computeLayerConfig()|this.$loop.clear(),Et.firstRow!=this.layerConfig.firstRow&&Et.firstRowScreen==this.layerConfig.firstRowScreen){var kt=this.scrollTop+(Et.firstRow-Math.max(this.layerConfig.firstRow,0))*this.lineHeight;kt>0&&(this.scrollTop=kt,_t=_t|this.CHANGE_SCROLL,_t|=this.$computeLayerConfig()|this.$loop.clear())}Et=this.layerConfig,this.$updateScrollBarV(),_t&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),ot.translate(this.content,-this.scrollLeft,-Et.offset);var Tt=Et.width+2*this.$padding+"px",$t=Et.minHeight+"px";ot.setStyle(this.content.style,"width",Tt),ot.setStyle(this.content.style,"height",$t)}if(_t&this.CHANGE_H_SCROLL&&(ot.translate(this.content,-this.scrollLeft,-Et.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller ":"ace_scroller ace_scroll-left ",this.enableKeyboardAccessibility&&(this.scroller.className+=this.keyboardFocusClassName)),_t&this.CHANGE_FULL){this.$changedLines=null,this.$textLayer.update(Et),this.$showGutter&&this.$gutterLayer.update(Et),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(Et),this.$markerBack.update(Et),this.$markerFront.update(Et),this.$cursorLayer.update(Et),this.$moveTextAreaToCursor(),this._signal("afterRender",_t);return}if(_t&this.CHANGE_SCROLL){this.$changedLines=null,_t&this.CHANGE_TEXT||_t&this.CHANGE_LINES?this.$textLayer.update(Et):this.$textLayer.scrollLines(Et),this.$showGutter&&(_t&this.CHANGE_GUTTER||_t&this.CHANGE_LINES?this.$gutterLayer.update(Et):this.$gutterLayer.scrollLines(Et)),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(Et),this.$markerBack.update(Et),this.$markerFront.update(Et),this.$cursorLayer.update(Et),this.$moveTextAreaToCursor(),this._signal("afterRender",_t);return}_t&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(Et),this.$showGutter&&this.$gutterLayer.update(Et),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(Et)):_t&this.CHANGE_LINES?((this.$updateLines()||_t&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(Et),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(Et)):_t&this.CHANGE_TEXT||_t&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(Et),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(Et)):_t&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(Et),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(Et)),_t&this.CHANGE_CURSOR&&(this.$cursorLayer.update(Et),this.$moveTextAreaToCursor()),_t&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(Et),_t&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(Et),this._signal("afterRender",_t)},yt.prototype.$autosize=function(){var _t=this.session.getScreenLength()*this.lineHeight,Ct=this.$maxLines*this.lineHeight,Et=Math.min(Ct,Math.max((this.$minLines||1)*this.lineHeight,_t))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(Et+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&Et>this.$maxPixelHeight&&(Et=this.$maxPixelHeight);var kt=Et<=2*this.lineHeight,Tt=!kt&&_t>Ct;if(Et!=this.desiredHeight||this.$size.height!=this.desiredHeight||Tt!=this.$vScroll){Tt!=this.$vScroll&&(this.$vScroll=Tt,this.scrollBarV.setVisible(Tt));var $t=this.container.clientWidth;this.container.style.height=Et+"px",this.$updateCachedSize(!0,this.$gutterWidth,$t,Et),this.desiredHeight=Et,this._signal("autosize")}},yt.prototype.$computeLayerConfig=function(){var _t=this.session,Ct=this.$size,Et=Ct.height<=2*this.lineHeight,kt=this.session.getScreenLength(),Tt=kt*this.lineHeight,$t=this.$getLongestLine(),It=!Et&&(this.$hScrollBarAlwaysVisible||Ct.scrollerWidth-$t-2*this.$padding<0),Ot=this.$horizScroll!==It;Ot&&(this.$horizScroll=It,this.scrollBarH.setVisible(It));var Mt=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var Dt=Ct.scrollerHeight+this.lineHeight,Bt=!this.$maxLines&&this.$scrollPastEnd?(Ct.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;Tt+=Bt;var Kt=this.scrollMargin;this.session.setScrollTop(Math.max(-Kt.top,Math.min(this.scrollTop,Tt-Ct.scrollerHeight+Kt.bottom))),this.session.setScrollLeft(Math.max(-Kt.left,Math.min(this.scrollLeft,$t+2*this.$padding-Ct.scrollerWidth+Kt.right)));var Wt=!Et&&(this.$vScrollBarAlwaysVisible||Ct.scrollerHeight-Tt+Bt<0||this.scrollTop>Kt.top),zt=Mt!==Wt;zt&&(this.$vScroll=Wt,this.scrollBarV.setVisible(Wt));var Ht=this.scrollTop%this.lineHeight,Zt=Math.ceil(Dt/this.lineHeight)-1,qt=Math.max(0,Math.round((this.scrollTop-Ht)/this.lineHeight)),hr=qt+Zt,fr,mr,gr=this.lineHeight;qt=_t.screenToDocumentRow(qt,0);var tr=_t.getFoldLine(qt);tr&&(qt=tr.start.row),fr=_t.documentToScreenRow(qt,0),mr=_t.getRowLength(qt)*gr,hr=Math.min(_t.screenToDocumentRow(hr,0),_t.getLength()-1),Dt=Ct.scrollerHeight+_t.getRowLength(hr)*gr+mr,Ht=this.scrollTop-fr*gr;var rr=0;return(this.layerConfig.width!=$t||Ot)&&(rr=this.CHANGE_H_SCROLL),(Ot||zt)&&(rr|=this.$updateCachedSize(!0,this.gutterWidth,Ct.width,Ct.height),this._signal("scrollbarVisibilityChanged"),zt&&($t=this.$getLongestLine())),this.layerConfig={width:$t,padding:this.$padding,firstRow:qt,firstRowScreen:fr,lastRow:hr,lineHeight:gr,characterWidth:this.characterWidth,minHeight:Dt,maxHeight:Tt,offset:Ht,gutterOffset:gr?Math.max(0,Math.ceil((Ht+Ct.height-Ct.scrollerHeight)/gr)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth($t-this.$padding),rr},yt.prototype.$updateLines=function(){if(this.$changedLines){var _t=this.$changedLines.firstRow,Ct=this.$changedLines.lastRow;this.$changedLines=null;var Et=this.layerConfig;if(!(_t>Et.lastRow+1)&&!(Ctthis.$textLayer.MAX_LINE_LENGTH&&(_t=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(_t*this.characterWidth))},yt.prototype.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},yt.prototype.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},yt.prototype.addGutterDecoration=function(_t,Ct){this.$gutterLayer.addGutterDecoration(_t,Ct)},yt.prototype.removeGutterDecoration=function(_t,Ct){this.$gutterLayer.removeGutterDecoration(_t,Ct)},yt.prototype.updateBreakpoints=function(_t){this._rows=_t,this.$loop.schedule(this.CHANGE_GUTTER)},yt.prototype.setAnnotations=function(_t){this.$gutterLayer.setAnnotations(_t),this.$loop.schedule(this.CHANGE_GUTTER)},yt.prototype.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},yt.prototype.hideCursor=function(){this.$cursorLayer.hideCursor()},yt.prototype.showCursor=function(){this.$cursorLayer.showCursor()},yt.prototype.scrollSelectionIntoView=function(_t,Ct,Et){this.scrollCursorIntoView(_t,Et),this.scrollCursorIntoView(Ct,Et)},yt.prototype.scrollCursorIntoView=function(_t,Ct,Et){if(this.$size.scrollerHeight!==0){var kt=this.$cursorLayer.getPixelPosition(_t),Tt=kt.left,$t=kt.top,It=Et&&Et.top||0,Ot=Et&&Et.bottom||0;this.$scrollAnimation&&(this.$stopAnimation=!0);var Mt=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;Mt+It>$t?(Ct&&Mt+It>$t+this.lineHeight&&($t-=Ct*this.$size.scrollerHeight),$t===0&&($t=-this.scrollMargin.top),this.session.setScrollTop($t)):Mt+this.$size.scrollerHeight-Ot<$t+this.lineHeight&&(Ct&&Mt+this.$size.scrollerHeight-Ot<$t-this.lineHeight&&($t+=Ct*this.$size.scrollerHeight),this.session.setScrollTop($t+this.lineHeight+Ot-this.$size.scrollerHeight));var Dt=this.scrollLeft,Bt=2*this.layerConfig.characterWidth;Tt-Bt=1-this.scrollMargin.top||Ct>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||_t<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||_t>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right)return!0},yt.prototype.pixelToScreenCoordinates=function(_t,Ct){var Et;if(this.$hasCssTransforms){Et={top:0,left:0};var kt=this.$fontMetrics.transformCoordinates([_t,Ct]);_t=kt[1]-this.gutterWidth-this.margin.left,Ct=kt[0]}else Et=this.scroller.getBoundingClientRect();var Tt=_t+this.scrollLeft-Et.left-this.$padding,$t=Tt/this.characterWidth,It=Math.floor((Ct+this.scrollTop-Et.top)/this.lineHeight),Ot=this.$blockCursor?Math.floor($t):Math.round($t);return{row:It,column:Ot,side:$t-Ot>0?1:-1,offsetX:Tt}},yt.prototype.screenToTextCoordinates=function(_t,Ct){var Et;if(this.$hasCssTransforms){Et={top:0,left:0};var kt=this.$fontMetrics.transformCoordinates([_t,Ct]);_t=kt[1]-this.gutterWidth-this.margin.left,Ct=kt[0]}else Et=this.scroller.getBoundingClientRect();var Tt=_t+this.scrollLeft-Et.left-this.$padding,$t=Tt/this.characterWidth,It=this.$blockCursor?Math.floor($t):Math.round($t),Ot=Math.floor((Ct+this.scrollTop-Et.top)/this.lineHeight);return this.session.screenToDocumentPosition(Ot,Math.max(It,0),Tt)},yt.prototype.textToScreenCoordinates=function(_t,Ct){var Et=this.scroller.getBoundingClientRect(),kt=this.session.documentToScreenPosition(_t,Ct),Tt=this.$padding+(this.session.$bidiHandler.isBidiRow(kt.row,_t)?this.session.$bidiHandler.getPosLeft(kt.column):Math.round(kt.column*this.characterWidth)),$t=kt.row*this.lineHeight;return{pageX:Et.left+Tt-this.scrollLeft,pageY:Et.top+$t-this.scrollTop}},yt.prototype.visualizeFocus=function(){ot.addCssClass(this.container,"ace_focus")},yt.prototype.visualizeBlur=function(){ot.removeCssClass(this.container,"ace_focus")},yt.prototype.showComposition=function(_t){this.$composition=_t,_t.cssText||(_t.cssText=this.textarea.style.cssText),_t.useTextareaForIME==null&&(_t.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(ot.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):_t.markerId=this.session.addMarker(_t.markerRange,"ace_composition_marker","text")},yt.prototype.setCompositionText=function(_t){var Ct=this.session.selection.cursor;this.addToken(_t,"composition_placeholder",Ct.row,Ct.column),this.$moveTextAreaToCursor()},yt.prototype.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),ot.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var _t=this.session.selection.cursor;this.removeExtraToken(_t.row,_t.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},yt.prototype.setGhostText=function(_t,Ct){var Et=this.session.selection.cursor,kt=Ct||{row:Et.row,column:Et.column};this.removeGhostText();var Tt=this.$calculateWrappedTextChunks(_t,kt);this.addToken(Tt[0].text,"ghost_text",kt.row,kt.column),this.$ghostText={text:_t,position:{row:kt.row,column:kt.column}};var $t=ot.createElement("div");if(Tt.length>1){var It=this.hideTokensAfterPosition(kt.row,kt.column),Ot;Tt.slice(1).forEach(function(zt){var Ht=ot.createElement("div"),Zt=ot.createElement("span");Zt.className="ace_ghost_text",zt.wrapped&&(Ht.className="ghost_text_line_wrapped"),zt.text.length===0&&(zt.text=" "),Zt.appendChild(ot.createTextNode(zt.text)),Ht.appendChild(Zt),$t.appendChild(Ht),Ot=Ht}),It.forEach(function(zt){var Ht=ot.createElement("span");St(zt.type)||(Ht.className="ace_"+zt.type.replace(/\./g," ace_")),Ht.appendChild(ot.createTextNode(zt.value)),Ot.appendChild(Ht)}),this.$ghostTextWidget={el:$t,row:kt.row,column:kt.column,className:"ace_ghost_text_container"},this.session.widgetManager.addLineWidget(this.$ghostTextWidget);var Mt=this.$cursorLayer.getPixelPosition(kt,!0),Dt=this.container,Bt=Dt.getBoundingClientRect().height,Kt=Tt.length*this.lineHeight,Wt=Kt0){var Dt=0;Mt.push(Tt[It].length);for(var Bt=0;Bt1||Math.abs(_t.$size.height-kt)>1?_t.$resizeTimer.delay():_t.$resizeTimer.cancel()}),this.$resizeObserver.observe(this.container)}},yt}();xt.prototype.CHANGE_CURSOR=1,xt.prototype.CHANGE_MARKER=2,xt.prototype.CHANGE_GUTTER=4,xt.prototype.CHANGE_SCROLL=8,xt.prototype.CHANGE_LINES=16,xt.prototype.CHANGE_TEXT=32,xt.prototype.CHANGE_SIZE=64,xt.prototype.CHANGE_MARKER_BACK=128,xt.prototype.CHANGE_MARKER_FRONT=256,xt.prototype.CHANGE_FULL=512,xt.prototype.CHANGE_H_SCROLL=1024,xt.prototype.$changes=0,xt.prototype.$padding=null,xt.prototype.$frozen=!1,xt.prototype.STEPS=8,et.implement(xt.prototype,pt),nt.defineOptions(xt.prototype,"renderer",{useResizeObserver:{set:function(yt){!yt&&this.$resizeObserver?(this.$resizeObserver.disconnect(),this.$resizeTimer.cancel(),this.$resizeTimer=this.$resizeObserver=null):yt&&!this.$resizeObserver&&this.$addResizeObserver()}},animatedScroll:{initialValue:!1},showInvisibles:{set:function(yt){this.$textLayer.setShowInvisibles(yt)&&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(yt){typeof yt=="number"&&(this.$printMarginColumn=yt),this.$showPrintMargin=!!yt,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(yt){this.$gutter.style.display=yt?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},useSvgGutterIcons:{set:function(yt){this.$gutterLayer.$useSvgGutterIcons=yt},initialValue:!1},showFoldedAnnotations:{set:function(yt){this.$gutterLayer.$showFoldedAnnotations=yt},initialValue:!1},fadeFoldWidgets:{set:function(yt){ot.setCssClass(this.$gutter,"ace_fade-fold-widgets",yt)},initialValue:!1},showFoldWidgets:{set:function(yt){this.$gutterLayer.setShowFoldWidgets(yt),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(yt){this.$textLayer.setDisplayIndentGuides(yt)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightIndentGuides:{set:function(yt){this.$textLayer.setHighlightIndentGuides(yt)==!0?this.$textLayer.$highlightIndentGuide():this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells)},initialValue:!0},highlightGutterLine:{set:function(yt){this.$gutterLayer.setHighlightGutterLine(yt),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(yt){(!this.$hScrollBarAlwaysVisible||!this.$horizScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(yt){(!this.$vScrollBarAlwaysVisible||!this.$vScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(yt){typeof yt=="number"&&(yt=yt+"px"),this.container.style.fontSize=yt,this.updateFontSize()},initialValue:12},fontFamily:{set:function(yt){this.container.style.fontFamily=yt,this.updateFontSize()}},maxLines:{set:function(yt){this.updateFull()}},minLines:{set:function(yt){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(yt){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(yt){yt=+yt||0,this.$scrollPastEnd!=yt&&(this.$scrollPastEnd=yt,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(yt){this.$gutterLayer.$fixedWidth=!!yt,this.$loop.schedule(this.CHANGE_GUTTER)}},customScrollbar:{set:function(yt){this.$updateCustomScrollbar(yt)},initialValue:!1},theme:{set:function(yt){this.setTheme(yt)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!dt.isMobile&&!dt.isIE}}),a.VirtualRenderer=xt}),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(o,a,rt){var et=o("../lib/oop"),ot=o("../lib/net"),at=o("../lib/event_emitter").EventEmitter,nt=o("../config");function it(tt){var st="importScripts('"+ot.qualifyURL(tt)+"');";try{return new Blob([st],{type:"application/javascript"})}catch{var lt=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,ct=new lt;return ct.append(st),ct.getBlob("application/javascript")}}function j(tt){if(typeof Worker>"u")return{postMessage:function(){},terminate:function(){}};if(nt.get("loadWorkerFromBlob")){var st=it(tt),lt=window.URL||window.webkitURL,ct=lt.createObjectURL(st);return new Worker(ct)}return new Worker(tt)}var _=function(tt){tt.postMessage||(tt=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=tt,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(){et.implement(this,at),this.$createWorkerFromOldConfig=function(tt,st,lt,ct,ht){if(o.nameToUrl&&!o.toUrl&&(o.toUrl=o.nameToUrl),nt.get("packaged")||!o.toUrl)ct=ct||nt.moduleUrl(st,"worker");else{var ut=this.$normalizePath;ct=ct||ut(o.toUrl("ace/worker/worker.js",null,"_"));var pt={};tt.forEach(function(mt){pt[mt]=ut(o.toUrl(mt,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}return this.$worker=j(ct),ht&&this.send("importScripts",ht),this.$worker.postMessage({init:!0,tlns:pt,module:st,classname:lt}),this.$worker},this.onMessage=function(tt){var st=tt.data;switch(st.type){case"event":this._signal(st.name,{data:st.data});break;case"call":var lt=this.callbacks[st.id];lt&&(lt(st.data),delete this.callbacks[st.id]);break;case"error":this.reportError(st.data);break;case"log":window.console&&console.log&&console.log.apply(console,st.data);break}},this.reportError=function(tt){window.console&&console.error&&console.error(tt)},this.$normalizePath=function(tt){return ot.qualifyURL(tt)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker.onerror=function(tt){tt.preventDefault()},this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(tt,st){this.$worker.postMessage({command:tt,args:st})},this.call=function(tt,st,lt){if(lt){var ct=this.callbackId++;this.callbacks[ct]=lt,st.push(ct)}this.send(tt,st)},this.emit=function(tt,st){try{st.data&&st.data.err&&(st.data.err={message:st.data.err.message,stack:st.data.err.stack,code:st.data.err.code}),this.$worker&&this.$worker.postMessage({event:tt,data:{data:st.data}})}catch(lt){console.error(lt.stack)}},this.attachToDocument=function(tt){this.$doc&&this.terminate(),this.$doc=tt,this.call("setValue",[tt.getValue()]),tt.on("change",this.changeListener,!0)},this.changeListener=function(tt){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),tt.action=="insert"?this.deltaQueue.push(tt.start,tt.lines):this.deltaQueue.push(tt.start,tt.end)},this.$sendDeltaQueue=function(){var tt=this.deltaQueue;tt&&(this.deltaQueue=null,tt.length>50&&tt.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:tt}))}}).call(_.prototype);var $=function(tt,st,lt){var ct=null,ht=!1,ut=Object.create(at),pt=[],mt=new _({messageBuffer:pt,terminate:function(){},postMessage:function(dt){pt.push(dt),ct&&(ht?setTimeout(gt):gt())}});mt.setEmitSync=function(dt){ht=dt};var gt=function(){var dt=pt.shift();dt.command?ct[dt.command].apply(ct,dt.args):dt.event&&ut._signal(dt.event,dt.data)};return ut.postMessage=function(dt){mt.onMessage({data:dt})},ut.callback=function(dt,St){this.postMessage({type:"call",id:St,data:dt})},ut.emit=function(dt,St){this.postMessage({type:"event",name:dt,data:St})},nt.loadModule(["worker",st],function(dt){for(ct=new dt[lt](ut);pt.length;)gt()}),mt};a.UIWorkerClient=$,a.WorkerClient=_,a.createWorker=j}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(o,a,rt){var et=o("./range").Range,ot=o("./lib/event_emitter").EventEmitter,at=o("./lib/oop"),nt=function(){function it(j,_,$,tt,st,lt){var ct=this;this.length=_,this.session=j,this.doc=j.getDocument(),this.mainClass=st,this.othersClass=lt,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate,!0),this.$others=tt,this.$onCursorChange=function(){setTimeout(function(){ct.onCursorChange()})},this.$pos=$;var ht=j.getUndoManager().$undoStack||j.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=ht.length,this.setup(),j.selection.on("changeCursor",this.$onCursorChange)}return it.prototype.setup=function(){var j=this,_=this.doc,$=this.session;this.selectionBefore=$.selection.toJSON(),$.selection.inMultiSelectMode&&$.selection.toSingleRange(),this.pos=_.createAnchor(this.$pos.row,this.$pos.column);var tt=this.pos;tt.$insertRight=!0,tt.detach(),tt.markerId=$.addMarker(new et(tt.row,tt.column,tt.row,tt.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(st){var lt=_.createAnchor(st.row,st.column);lt.$insertRight=!0,lt.detach(),j.others.push(lt)}),$.setUndoSelect(!1)},it.prototype.showOtherMarkers=function(){if(!this.othersActive){var j=this.session,_=this;this.othersActive=!0,this.others.forEach(function($){$.markerId=j.addMarker(new et($.row,$.column,$.row,$.column+_.length),_.othersClass,null,!1)})}},it.prototype.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var j=0;j=this.pos.column&&_.start.column<=this.pos.column+this.length+1,st=_.start.column-this.pos.column;if(this.updateAnchors(j),tt&&(this.length+=$),tt&&!this.session.$fromUndo){if(j.action==="insert")for(var lt=this.others.length-1;lt>=0;lt--){var ct=this.others[lt],ht={row:ct.row,column:ct.column+st};this.doc.insertMergedLines(ht,j.lines)}else if(j.action==="remove")for(var lt=this.others.length-1;lt>=0;lt--){var ct=this.others[lt],ht={row:ct.row,column:ct.column+st};this.doc.remove(new et(ht.row,ht.column,ht.row,ht.column-$))}}this.$updating=!1,this.updateMarkers()}},it.prototype.updateAnchors=function(j){this.pos.onChange(j);for(var _=this.others.length;_--;)this.others[_].onChange(j);this.updateMarkers()},it.prototype.updateMarkers=function(){if(!this.$updating){var j=this,_=this.session,$=function(st,lt){_.removeMarker(st.markerId),st.markerId=_.addMarker(new et(st.row,st.column,st.row,st.column+j.length),lt,null,!1)};$(this.pos,this.mainClass);for(var tt=this.others.length;tt--;)$(this.others[tt],this.othersClass)}},it.prototype.onCursorChange=function(j){if(!(this.$updating||!this.session)){var _=this.session.selection.getCursor();_.row===this.pos.row&&_.column>=this.pos.column&&_.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",j)):(this.hideOtherMarkers(),this._emit("cursorLeave",j))}},it.prototype.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},it.prototype.cancel=function(){if(this.$undoStackDepth!==-1){for(var j=this.session.getUndoManager(),_=(j.$undoStack||j.$undostack).length-this.$undoStackDepth,$=0;$<_;$++)j.undo(this.session,!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}},it}();at.implement(nt.prototype,ot),a.PlaceHolder=nt}),ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(o,a,rt){var et=o("../lib/event"),ot=o("../lib/useragent");function at(it,j){return it.row==j.row&&it.column==j.column}function nt(it){var j=it.domEvent,_=j.altKey,$=j.shiftKey,tt=j.ctrlKey,st=it.getAccelKey(),lt=it.getButton();if(tt&&ot.isMac&&(lt=j.button),it.editor.inMultiSelectMode&<==2){it.editor.textInput.onContextMenu(it.domEvent);return}if(!tt&&!_&&!st){lt===0&&it.editor.inMultiSelectMode&&it.editor.exitMultiSelectMode();return}if(lt===0){var ct=it.editor,ht=ct.selection,ut=ct.inMultiSelectMode,pt=it.getDocumentPosition(),mt=ht.getCursor(),gt=it.inSelection()||ht.isEmpty()&&at(pt,mt),dt=it.x,St=it.y,xt=function(Kt){dt=Kt.clientX,St=Kt.clientY},yt=ct.session,_t=ct.renderer.pixelToScreenCoordinates(dt,St),Ct=_t,Et;if(ct.$mouseHandler.$enableJumpToDef)tt&&_||st&&_?Et=$?"block":"add":_&&ct.$blockSelectEnabled&&(Et="block");else if(st&&!_){if(Et="add",!ut&&$)return}else _&&ct.$blockSelectEnabled&&(Et="block");if(Et&&ot.isMac&&j.ctrlKey&&ct.$mouseHandler.cancelContextMenu(),Et=="add"){if(!ut&>)return;if(!ut){var kt=ht.toOrientedRange();ct.addSelectionMarker(kt)}var Tt=ht.rangeList.rangeAtPoint(pt);ct.inVirtualSelectionMode=!0,$&&(Tt=null,kt=ht.ranges[0]||kt,ct.removeSelectionMarker(kt)),ct.once("mouseup",function(){var Kt=ht.toOrientedRange();Tt&&Kt.isEmpty()&&at(Tt.cursor,Kt.cursor)?ht.substractPoint(Kt.cursor):($?ht.substractPoint(kt.cursor):kt&&(ct.removeSelectionMarker(kt),ht.addRange(kt)),ht.addRange(Kt)),ct.inVirtualSelectionMode=!1})}else if(Et=="block"){it.stop(),ct.inVirtualSelectionMode=!0;var $t,It=[],Ot=function(){var Kt=ct.renderer.pixelToScreenCoordinates(dt,St),Wt=yt.screenToDocumentPosition(Kt.row,Kt.column,Kt.offsetX);at(Ct,Kt)&&at(Wt,ht.lead)||(Ct=Kt,ct.selection.moveToPosition(Wt),ct.renderer.scrollCursorIntoView(),ct.removeSelectionMarkers(It),It=ht.rectangularRangeBlock(Ct,_t),ct.$mouseHandler.$clickSelection&&It.length==1&&It[0].isEmpty()&&(It[0]=ct.$mouseHandler.$clickSelection.clone()),It.forEach(ct.addSelectionMarker,ct),ct.updateSelectionMarkers())};ut&&!st?ht.toSingleRange():!ut&&st&&($t=ht.toOrientedRange(),ct.addSelectionMarker($t)),$?_t=yt.documentToScreenPosition(ht.lead):ht.moveToPosition(pt),Ct={row:-1,column:-1};var Mt=function(Kt){Ot(),clearInterval(Bt),ct.removeSelectionMarkers(It),It.length||(It=[ht.toOrientedRange()]),$t&&(ct.removeSelectionMarker($t),ht.toSingleRange($t));for(var Wt=0;Wt1?ot.multiSelect.joinSelections():ot.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(ot){ot.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(ot){ot.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(ot){ot.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],a.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(ot){ot.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(ot){return ot&&ot.inMultiSelectMode}}];var et=o("../keyboard/hash_handler").HashHandler;a.keyboardHandler=new et(a.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(o,a,rt){var et=o("./range_list").RangeList,ot=o("./range").Range,at=o("./selection").Selection,nt=o("./mouse/multi_select_handler").onMouseDown,it=o("./lib/event"),j=o("./lib/lang"),_=o("./commands/multi_select_commands");a.commands=_.defaultCommands.concat(_.multiSelectCommands);var $=o("./search").Search,tt=new $;function st(mt,gt,dt){return tt.$options.wrap=!0,tt.$options.needle=gt,tt.$options.backwards=dt==-1,tt.find(mt)}var lt=o("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(lt.prototype),(function(){this.ranges=null,this.rangeList=null,this.addRange=function(mt,gt){if(mt){if(!this.inMultiSelectMode&&this.rangeCount===0){var dt=this.toOrientedRange();if(this.rangeList.add(dt),this.rangeList.add(mt),this.rangeList.ranges.length!=2)return this.rangeList.removeAll(),gt||this.fromOrientedRange(mt);this.rangeList.removeAll(),this.rangeList.add(dt),this.$onAddRange(dt)}mt.cursor||(mt.cursor=mt.end);var St=this.rangeList.add(mt);return this.$onAddRange(mt),St.length&&this.$onRemoveRange(St),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),gt||this.fromOrientedRange(mt)}},this.toSingleRange=function(mt){mt=mt||this.ranges[0];var gt=this.rangeList.removeAll();gt.length&&this.$onRemoveRange(gt),mt&&this.fromOrientedRange(mt)},this.substractPoint=function(mt){var gt=this.rangeList.substractPoint(mt);if(gt)return this.$onRemoveRange(gt),gt[0]},this.mergeOverlappingRanges=function(){var mt=this.rangeList.merge();mt.length&&this.$onRemoveRange(mt)},this.$onAddRange=function(mt){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(mt),this._signal("addRange",{range:mt})},this.$onRemoveRange=function(mt){if(this.rangeCount=this.rangeList.ranges.length,this.rangeCount==1&&this.inMultiSelectMode){var gt=this.rangeList.ranges.pop();mt.push(gt),this.rangeCount=0}for(var dt=mt.length;dt--;){var St=this.ranges.indexOf(mt[dt]);this.ranges.splice(St,1)}this._signal("removeRange",{ranges:mt}),this.rangeCount===0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),gt=gt||this.ranges[0],gt&&!gt.isEqual(this.getRange())&&this.fromOrientedRange(gt)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new et,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var mt=this.ranges.length?this.ranges:[this.getRange()],gt=[],dt=0;dt1){var mt=this.rangeList.ranges,gt=mt[mt.length-1],dt=ot.fromPoints(mt[0].start,gt.end);this.toSingleRange(),this.setSelectionRange(dt,gt.cursor==gt.start)}else{var St=this.session.documentToScreenPosition(this.cursor),xt=this.session.documentToScreenPosition(this.anchor),yt=this.rectangularRangeBlock(St,xt);yt.forEach(this.addRange,this)}},this.rectangularRangeBlock=function(mt,gt,dt){var St=[],xt=mt.column0;)Dt--;if(Dt>0)for(var Bt=0;St[Bt].isEmpty();)Bt++;for(var Kt=Dt;Kt>=Bt;Kt--)St[Kt].isEmpty()&&St.splice(Kt,1)}return St}}).call(at.prototype);var ct=o("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(mt){mt.cursor||(mt.cursor=mt.end);var gt=this.getSelectionStyle();return mt.marker=this.session.addMarker(mt,"ace_selection",gt),this.session.$selectionMarkers.push(mt),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,mt},this.removeSelectionMarker=function(mt){if(mt.marker){this.session.removeMarker(mt.marker);var gt=this.session.$selectionMarkers.indexOf(mt);gt!=-1&&this.session.$selectionMarkers.splice(gt,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(mt){for(var gt=this.session.$selectionMarkers,dt=mt.length;dt--;){var St=mt[dt];if(St.marker){this.session.removeMarker(St.marker);var xt=gt.indexOf(St);xt!=-1&>.splice(xt,1)}}this.session.selectionMarkerCount=gt.length},this.$onAddRange=function(mt){this.addSelectionMarker(mt.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(mt){this.removeSelectionMarkers(mt.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(mt){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(_.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(mt){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(_.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(mt){var gt=mt.command,dt=mt.editor;if(dt.multiSelect){if(gt.multiSelectAction)gt.multiSelectAction=="forEach"?St=dt.forEachSelection(gt,mt.args):gt.multiSelectAction=="forEachLine"?St=dt.forEachSelection(gt,mt.args,!0):gt.multiSelectAction=="single"?(dt.exitMultiSelectMode(),St=gt.exec(dt,mt.args||{})):St=gt.multiSelectAction(dt,mt.args||{});else{var St=gt.exec(dt,mt.args||{});dt.multiSelect.addRange(dt.multiSelect.toOrientedRange()),dt.multiSelect.mergeOverlappingRanges()}return St}},this.forEachSelection=function(mt,gt,dt){if(!this.inVirtualSelectionMode){var St=dt&&dt.keepOrder,xt=dt==!0||dt&&dt.$byLines,yt=this.session,_t=this.selection,Ct=_t.rangeList,Et=(St?_t:Ct).ranges,kt;if(!Et.length)return mt.exec?mt.exec(this,gt||{}):mt(this,gt||{});var Tt=_t._eventRegistry;_t._eventRegistry={};var $t=new at(yt);this.inVirtualSelectionMode=!0;for(var It=Et.length;It--;){if(xt)for(;It>0&&Et[It].start.row==Et[It-1].end.row;)It--;$t.fromOrientedRange(Et[It]),$t.index=It,this.selection=yt.selection=$t;var Ot=mt.exec?mt.exec(this,gt||{}):mt(this,gt||{});!kt&&Ot!==void 0&&(kt=Ot),$t.toOrientedRange(Et[It])}$t.detach(),this.selection=yt.selection=_t,this.inVirtualSelectionMode=!1,_t._eventRegistry=Tt,_t.mergeOverlappingRanges(),_t.ranges[0]&&_t.fromOrientedRange(_t.ranges[0]);var Mt=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),Mt&&Mt.from==Mt.to&&this.renderer.animateScrolling(Mt.from),kt}},this.exitMultiSelectMode=function(){!this.inMultiSelectMode||this.inVirtualSelectionMode||this.multiSelect.toSingleRange()},this.getSelectedText=function(){var mt="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var gt=this.multiSelect.rangeList.ranges,dt=[],St=0;St0);_t<0&&(_t=0),Ct>=kt&&(Ct=kt-1)}var $t=this.session.removeFullLines(_t,Ct);$t=this.$reAlignText($t,Et),this.session.insert({row:_t,column:0},$t.join(` +}`}),ace.define("ace/layer/decorators",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter"],function(o,a,rt){var tt=o("../lib/dom"),ot=o("../lib/oop"),at=o("../lib/event_emitter").EventEmitter,nt=function(){function it(j,_){this.canvas=tt.createElement("canvas"),this.renderer=_,this.pixelRatio=1,this.maxHeight=_.layerConfig.maxHeight,this.lineHeight=_.layerConfig.lineHeight,this.canvasHeight=j.parent.scrollHeight,this.heightRatio=this.canvasHeight/this.maxHeight,this.canvasWidth=j.width,this.minDecorationHeight=2*this.pixelRatio|0,this.halfMinDecorationHeight=this.minDecorationHeight/2|0,this.canvas.width=this.canvasWidth,this.canvas.height=this.canvasHeight,this.canvas.style.top="0px",this.canvas.style.right="0px",this.canvas.style.zIndex="7px",this.canvas.style.position="absolute",this.colors={},this.colors.dark={error:"rgba(255, 18, 18, 1)",warning:"rgba(18, 136, 18, 1)",info:"rgba(18, 18, 136, 1)"},this.colors.light={error:"rgb(255,51,51)",warning:"rgb(32,133,72)",info:"rgb(35,68,138)"},j.element.appendChild(this.canvas)}return it.prototype.$updateDecorators=function(j){var _=this.renderer.theme.isDark===!0?this.colors.dark:this.colors.light;if(j){this.maxHeight=j.maxHeight,this.lineHeight=j.lineHeight,this.canvasHeight=j.height;var $=(j.lastRow+1)*this.lineHeight;$Et.priority?1:0}var lt=this.renderer.session.$annotations;if(et.clearRect(0,0,this.canvas.width,this.canvas.height),lt){var ct={info:1,warning:2,error:3};lt.forEach(function(Ct){Ct.priority=ct[Ct.type]||null}),lt=lt.sort(st);for(var ht=this.renderer.session.$foldData,ut=0;utthis.canvasHeight&&(yt=this.canvasHeight-this.halfMinDecorationHeight),dt=Math.round(yt-this.halfMinDecorationHeight),St=Math.round(yt+this.halfMinDecorationHeight)}et.fillStyle=_[lt[ut].type]||null,et.fillRect(0,gt,this.canvasWidth,St-dt)}}var _t=this.renderer.session.selection.getCursor();if(_t){var mt=this.compensateFoldRows(_t.row,ht),gt=Math.round((_t.row-mt)*this.lineHeight*this.heightRatio);et.fillStyle="rgba(0, 0, 0, 0.5)",et.fillRect(0,gt,this.canvasWidth,2)}},it.prototype.compensateFoldRows=function(j,_){var $=0;if(_&&_.length>0)for(var et=0;et<_.length;et++)j>_[et].start.row&&j<_[et].end.row?$+=j-_[et].start.row:j>=_[et].end.row&&($+=_[et].end.row-_[et].start.row);return $},it}();ot.implement(nt.prototype,at),a.Decorator=nt}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/scrollbar_custom","ace/scrollbar_custom","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/css/editor-css","ace/layer/decorators","ace/lib/useragent","ace/layer/text_util"],function(o,a,rt){var tt=o("./lib/oop"),ot=o("./lib/dom"),at=o("./lib/lang"),nt=o("./config"),it=o("./layer/gutter").Gutter,j=o("./layer/marker").Marker,_=o("./layer/text").Text,$=o("./layer/cursor").Cursor,et=o("./scrollbar").HScrollBar,st=o("./scrollbar").VScrollBar,lt=o("./scrollbar_custom").HScrollBar,ct=o("./scrollbar_custom").VScrollBar,ht=o("./renderloop").RenderLoop,ut=o("./layer/font_metrics").FontMetrics,pt=o("./lib/event_emitter").EventEmitter,mt=o("./css/editor-css"),gt=o("./layer/decorators").Decorator,dt=o("./lib/useragent"),St=o("./layer/text_util").isTextToken;ot.importCssString(mt,"ace_editor.css",!1);var xt=function(){function yt(_t,Ct){var Et=this;this.container=_t||ot.createElement("div"),ot.addCssClass(this.container,"ace_editor"),ot.HI_DPI&&ot.addCssClass(this.container,"ace_hidpi"),this.setTheme(Ct),nt.get("useStrictCSP")==null&&nt.set("useStrictCSP",!1),this.$gutter=ot.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden","true"),this.scroller=ot.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=ot.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new it(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new j(this.content);var kt=this.$textLayer=new _(this.content);this.canvas=kt.element,this.$markerFront=new j(this.content),this.$cursorLayer=new $(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new st(this.container,this),this.scrollBarH=new et(this.container,this),this.scrollBarV.on("scroll",function(Tt){Et.$scrollAnimation||Et.session.setScrollTop(Tt.data-Et.scrollMargin.top)}),this.scrollBarH.on("scroll",function(Tt){Et.$scrollAnimation||Et.session.setScrollLeft(Tt.data-Et.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new ut(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",function(Tt){Et.updateCharacterSize(),Et.onResize(!0,Et.gutterWidth,Et.$size.width,Et.$size.height),Et._signal("changeCharacterSize",Tt)}),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=!dt.isIOS,this.$loop=new ht(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),this.$addResizeObserver(),nt.resetOptions(this),nt._signal("renderer",this)}return yt.prototype.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(),ot.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},yt.prototype.setSession=function(_t){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=_t,_t&&this.scrollMargin.top&&_t.getScrollTop()<=0&&_t.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(_t),this.$markerBack.setSession(_t),this.$markerFront.setSession(_t),this.$gutterLayer.setSession(_t),this.$textLayer.setSession(_t),_t&&(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))},yt.prototype.updateLines=function(_t,Ct,Et){if(Ct===void 0&&(Ct=1/0),this.$changedLines?(this.$changedLines.firstRow>_t&&(this.$changedLines.firstRow=_t),this.$changedLines.lastRowthis.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},yt.prototype.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},yt.prototype.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},yt.prototype.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},yt.prototype.updateFull=function(_t){_t?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},yt.prototype.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},yt.prototype.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},yt.prototype.onResize=function(_t,Ct,Et,kt){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=_t?1:0;var Tt=this.container;kt||(kt=Tt.clientHeight||Tt.scrollHeight),!kt&&this.$maxLines&&this.lineHeight>1&&(!Tt.style.height||Tt.style.height=="0px")&&(Tt.style.height="1px",kt=Tt.clientHeight||Tt.scrollHeight),Et||(Et=Tt.clientWidth||Tt.scrollWidth);var $t=this.$updateCachedSize(_t,Ct,Et,kt);if(this.$resizeTimer&&this.$resizeTimer.cancel(),!this.$size.scrollerHeight||!Et&&!kt)return this.resizing=0;_t&&(this.$gutterLayer.$padding=null),_t?this.$renderChanges($t|this.$changes,!0):this.$loop.schedule($t|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.$customScrollbar&&this.$updateCustomScrollbar(!0)}},yt.prototype.$updateCachedSize=function(_t,Ct,Et,kt){kt-=this.$extraHeight||0;var Tt=0,$t=this.$size,It={width:$t.width,height:$t.height,scrollerHeight:$t.scrollerHeight,scrollerWidth:$t.scrollerWidth};if(kt&&(_t||$t.height!=kt)&&($t.height=kt,Tt|=this.CHANGE_SIZE,$t.scrollerHeight=$t.height,this.$horizScroll&&($t.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight($t.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",Tt=Tt|this.CHANGE_SCROLL),Et&&(_t||$t.width!=Et)){Tt|=this.CHANGE_SIZE,$t.width=Et,Ct==null&&(Ct=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=Ct,ot.setStyle(this.scrollBarH.element.style,"left",Ct+"px"),ot.setStyle(this.scroller.style,"left",Ct+this.margin.left+"px"),$t.scrollerWidth=Math.max(0,Et-Ct-this.scrollBarV.getWidth()-this.margin.h),ot.setStyle(this.$gutter.style,"left",this.margin.left+"px");var Ot=this.scrollBarV.getWidth()+"px";ot.setStyle(this.scrollBarH.element.style,"right",Ot),ot.setStyle(this.scroller.style,"right",Ot),ot.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),this.scrollBarH.setWidth($t.scrollerWidth),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||_t)&&(Tt|=this.CHANGE_FULL)}return $t.$dirty=!Et||!kt,Tt&&this._signal("resize",It),Tt},yt.prototype.onGutterResize=function(_t){var Ct=this.$showGutter?_t:0;Ct!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,Ct,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()?this.$loop.schedule(this.CHANGE_FULL):this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},yt.prototype.adjustWrapLimit=function(){var _t=this.$size.scrollerWidth-this.$padding*2,Ct=Math.floor(_t/this.characterWidth);return this.session.adjustWrapLimit(Ct,this.$showPrintMargin&&this.$printMarginColumn)},yt.prototype.setAnimatedScroll=function(_t){this.setOption("animatedScroll",_t)},yt.prototype.getAnimatedScroll=function(){return this.$animatedScroll},yt.prototype.setShowInvisibles=function(_t){this.setOption("showInvisibles",_t),this.session.$bidiHandler.setShowInvisibles(_t)},yt.prototype.getShowInvisibles=function(){return this.getOption("showInvisibles")},yt.prototype.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},yt.prototype.setDisplayIndentGuides=function(_t){this.setOption("displayIndentGuides",_t)},yt.prototype.getHighlightIndentGuides=function(){return this.getOption("highlightIndentGuides")},yt.prototype.setHighlightIndentGuides=function(_t){this.setOption("highlightIndentGuides",_t)},yt.prototype.setShowPrintMargin=function(_t){this.setOption("showPrintMargin",_t)},yt.prototype.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},yt.prototype.setPrintMarginColumn=function(_t){this.setOption("printMarginColumn",_t)},yt.prototype.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},yt.prototype.getShowGutter=function(){return this.getOption("showGutter")},yt.prototype.setShowGutter=function(_t){return this.setOption("showGutter",_t)},yt.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},yt.prototype.setFadeFoldWidgets=function(_t){this.setOption("fadeFoldWidgets",_t)},yt.prototype.setHighlightGutterLine=function(_t){this.setOption("highlightGutterLine",_t)},yt.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},yt.prototype.$updatePrintMargin=function(){if(!(!this.$showPrintMargin&&!this.$printMarginEl)){if(!this.$printMarginEl){var _t=ot.createElement("div");_t.className="ace_layer ace_print-margin-layer",this.$printMarginEl=ot.createElement("div"),this.$printMarginEl.className="ace_print-margin",_t.appendChild(this.$printMarginEl),this.content.insertBefore(_t,this.content.firstChild)}var Ct=this.$printMarginEl.style;Ct.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",Ct.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&this.session.$wrap==-1&&this.adjustWrapLimit()}},yt.prototype.getContainerElement=function(){return this.container},yt.prototype.getMouseEventTarget=function(){return this.scroller},yt.prototype.getTextAreaContainer=function(){return this.container},yt.prototype.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var _t=this.textarea.style,Ct=this.$composition;if(!this.$keepTextAreaAtCursor&&!Ct){ot.translate(this.textarea,-100,0);return}var Et=this.$cursorLayer.$pixelPos;if(Et){Ct&&Ct.markerRange&&(Et=this.$cursorLayer.getPixelPosition(Ct.markerRange.start,!0));var kt=this.layerConfig,Tt=Et.top,$t=Et.left;Tt-=kt.offset;var It=Ct&&Ct.useTextareaForIME||dt.isMobile?this.lineHeight:1;if(Tt<0||Tt>kt.height-It){ot.translate(this.textarea,0,0);return}var Ot=1,Mt=this.$size.height-It;if(!Ct)Tt+=this.lineHeight;else if(Ct.useTextareaForIME){var Dt=this.textarea.value;Ot=this.characterWidth*this.session.$getStringScreenWidth(Dt)[0]}else Tt+=this.lineHeight+2;$t-=this.scrollLeft,$t>this.$size.scrollerWidth-Ot&&($t=this.$size.scrollerWidth-Ot),$t+=this.gutterWidth+this.margin.left,ot.setStyle(_t,"height",It+"px"),ot.setStyle(_t,"width",Ot+"px"),ot.translate(this.textarea,Math.min($t,this.$size.scrollerWidth-Ot),Math.min(Tt,Mt))}}},yt.prototype.getFirstVisibleRow=function(){return this.layerConfig.firstRow},yt.prototype.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},yt.prototype.getLastFullyVisibleRow=function(){var _t=this.layerConfig,Ct=_t.lastRow,Et=this.session.documentToScreenRow(Ct,0)*_t.lineHeight;return Et-this.session.getScrollTop()>_t.height-_t.lineHeight?Ct-1:Ct},yt.prototype.getLastVisibleRow=function(){return this.layerConfig.lastRow},yt.prototype.setPadding=function(_t){this.$padding=_t,this.$textLayer.setPadding(_t),this.$cursorLayer.setPadding(_t),this.$markerFront.setPadding(_t),this.$markerBack.setPadding(_t),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},yt.prototype.setScrollMargin=function(_t,Ct,Et,kt){var Tt=this.scrollMargin;Tt.top=_t|0,Tt.bottom=Ct|0,Tt.right=kt|0,Tt.left=Et|0,Tt.v=Tt.top+Tt.bottom,Tt.h=Tt.left+Tt.right,Tt.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-Tt.top),this.updateFull()},yt.prototype.setMargin=function(_t,Ct,Et,kt){var Tt=this.margin;Tt.top=_t|0,Tt.bottom=Ct|0,Tt.right=kt|0,Tt.left=Et|0,Tt.v=Tt.top+Tt.bottom,Tt.h=Tt.left+Tt.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},yt.prototype.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},yt.prototype.setHScrollBarAlwaysVisible=function(_t){this.setOption("hScrollBarAlwaysVisible",_t)},yt.prototype.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},yt.prototype.setVScrollBarAlwaysVisible=function(_t){this.setOption("vScrollBarAlwaysVisible",_t)},yt.prototype.$updateScrollBarV=function(){var _t=this.layerConfig.maxHeight,Ct=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(_t-=(Ct-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>_t-Ct&&(_t=this.scrollTop+Ct,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(_t+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},yt.prototype.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},yt.prototype.freeze=function(){this.$frozen=!0},yt.prototype.unfreeze=function(){this.$frozen=!1},yt.prototype.$renderChanges=function(_t,Ct){if(this.$changes&&(_t|=this.$changes,this.$changes=0),!this.session||!this.container.offsetWidth||this.$frozen||!_t&&!Ct){this.$changes|=_t;return}if(this.$size.$dirty)return this.$changes|=_t,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",_t),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var Et=this.layerConfig;if(_t&this.CHANGE_FULL||_t&this.CHANGE_SIZE||_t&this.CHANGE_TEXT||_t&this.CHANGE_LINES||_t&this.CHANGE_SCROLL||_t&this.CHANGE_H_SCROLL){if(_t|=this.$computeLayerConfig()|this.$loop.clear(),Et.firstRow!=this.layerConfig.firstRow&&Et.firstRowScreen==this.layerConfig.firstRowScreen){var kt=this.scrollTop+(Et.firstRow-Math.max(this.layerConfig.firstRow,0))*this.lineHeight;kt>0&&(this.scrollTop=kt,_t=_t|this.CHANGE_SCROLL,_t|=this.$computeLayerConfig()|this.$loop.clear())}Et=this.layerConfig,this.$updateScrollBarV(),_t&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),ot.translate(this.content,-this.scrollLeft,-Et.offset);var Tt=Et.width+2*this.$padding+"px",$t=Et.minHeight+"px";ot.setStyle(this.content.style,"width",Tt),ot.setStyle(this.content.style,"height",$t)}if(_t&this.CHANGE_H_SCROLL&&(ot.translate(this.content,-this.scrollLeft,-Et.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller ":"ace_scroller ace_scroll-left ",this.enableKeyboardAccessibility&&(this.scroller.className+=this.keyboardFocusClassName)),_t&this.CHANGE_FULL){this.$changedLines=null,this.$textLayer.update(Et),this.$showGutter&&this.$gutterLayer.update(Et),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(Et),this.$markerBack.update(Et),this.$markerFront.update(Et),this.$cursorLayer.update(Et),this.$moveTextAreaToCursor(),this._signal("afterRender",_t);return}if(_t&this.CHANGE_SCROLL){this.$changedLines=null,_t&this.CHANGE_TEXT||_t&this.CHANGE_LINES?this.$textLayer.update(Et):this.$textLayer.scrollLines(Et),this.$showGutter&&(_t&this.CHANGE_GUTTER||_t&this.CHANGE_LINES?this.$gutterLayer.update(Et):this.$gutterLayer.scrollLines(Et)),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(Et),this.$markerBack.update(Et),this.$markerFront.update(Et),this.$cursorLayer.update(Et),this.$moveTextAreaToCursor(),this._signal("afterRender",_t);return}_t&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(Et),this.$showGutter&&this.$gutterLayer.update(Et),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(Et)):_t&this.CHANGE_LINES?((this.$updateLines()||_t&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(Et),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(Et)):_t&this.CHANGE_TEXT||_t&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(Et),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(Et)):_t&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(Et),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(Et)),_t&this.CHANGE_CURSOR&&(this.$cursorLayer.update(Et),this.$moveTextAreaToCursor()),_t&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(Et),_t&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(Et),this._signal("afterRender",_t)},yt.prototype.$autosize=function(){var _t=this.session.getScreenLength()*this.lineHeight,Ct=this.$maxLines*this.lineHeight,Et=Math.min(Ct,Math.max((this.$minLines||1)*this.lineHeight,_t))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(Et+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&Et>this.$maxPixelHeight&&(Et=this.$maxPixelHeight);var kt=Et<=2*this.lineHeight,Tt=!kt&&_t>Ct;if(Et!=this.desiredHeight||this.$size.height!=this.desiredHeight||Tt!=this.$vScroll){Tt!=this.$vScroll&&(this.$vScroll=Tt,this.scrollBarV.setVisible(Tt));var $t=this.container.clientWidth;this.container.style.height=Et+"px",this.$updateCachedSize(!0,this.$gutterWidth,$t,Et),this.desiredHeight=Et,this._signal("autosize")}},yt.prototype.$computeLayerConfig=function(){var _t=this.session,Ct=this.$size,Et=Ct.height<=2*this.lineHeight,kt=this.session.getScreenLength(),Tt=kt*this.lineHeight,$t=this.$getLongestLine(),It=!Et&&(this.$hScrollBarAlwaysVisible||Ct.scrollerWidth-$t-2*this.$padding<0),Ot=this.$horizScroll!==It;Ot&&(this.$horizScroll=It,this.scrollBarH.setVisible(It));var Mt=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var Dt=Ct.scrollerHeight+this.lineHeight,Bt=!this.$maxLines&&this.$scrollPastEnd?(Ct.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;Tt+=Bt;var Kt=this.scrollMargin;this.session.setScrollTop(Math.max(-Kt.top,Math.min(this.scrollTop,Tt-Ct.scrollerHeight+Kt.bottom))),this.session.setScrollLeft(Math.max(-Kt.left,Math.min(this.scrollLeft,$t+2*this.$padding-Ct.scrollerWidth+Kt.right)));var Wt=!Et&&(this.$vScrollBarAlwaysVisible||Ct.scrollerHeight-Tt+Bt<0||this.scrollTop>Kt.top),zt=Mt!==Wt;zt&&(this.$vScroll=Wt,this.scrollBarV.setVisible(Wt));var Ht=this.scrollTop%this.lineHeight,Zt=Math.ceil(Dt/this.lineHeight)-1,qt=Math.max(0,Math.round((this.scrollTop-Ht)/this.lineHeight)),hr=qt+Zt,fr,mr,gr=this.lineHeight;qt=_t.screenToDocumentRow(qt,0);var tr=_t.getFoldLine(qt);tr&&(qt=tr.start.row),fr=_t.documentToScreenRow(qt,0),mr=_t.getRowLength(qt)*gr,hr=Math.min(_t.screenToDocumentRow(hr,0),_t.getLength()-1),Dt=Ct.scrollerHeight+_t.getRowLength(hr)*gr+mr,Ht=this.scrollTop-fr*gr;var rr=0;return(this.layerConfig.width!=$t||Ot)&&(rr=this.CHANGE_H_SCROLL),(Ot||zt)&&(rr|=this.$updateCachedSize(!0,this.gutterWidth,Ct.width,Ct.height),this._signal("scrollbarVisibilityChanged"),zt&&($t=this.$getLongestLine())),this.layerConfig={width:$t,padding:this.$padding,firstRow:qt,firstRowScreen:fr,lastRow:hr,lineHeight:gr,characterWidth:this.characterWidth,minHeight:Dt,maxHeight:Tt,offset:Ht,gutterOffset:gr?Math.max(0,Math.ceil((Ht+Ct.height-Ct.scrollerHeight)/gr)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth($t-this.$padding),rr},yt.prototype.$updateLines=function(){if(this.$changedLines){var _t=this.$changedLines.firstRow,Ct=this.$changedLines.lastRow;this.$changedLines=null;var Et=this.layerConfig;if(!(_t>Et.lastRow+1)&&!(Ctthis.$textLayer.MAX_LINE_LENGTH&&(_t=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(_t*this.characterWidth))},yt.prototype.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},yt.prototype.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},yt.prototype.addGutterDecoration=function(_t,Ct){this.$gutterLayer.addGutterDecoration(_t,Ct)},yt.prototype.removeGutterDecoration=function(_t,Ct){this.$gutterLayer.removeGutterDecoration(_t,Ct)},yt.prototype.updateBreakpoints=function(_t){this._rows=_t,this.$loop.schedule(this.CHANGE_GUTTER)},yt.prototype.setAnnotations=function(_t){this.$gutterLayer.setAnnotations(_t),this.$loop.schedule(this.CHANGE_GUTTER)},yt.prototype.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},yt.prototype.hideCursor=function(){this.$cursorLayer.hideCursor()},yt.prototype.showCursor=function(){this.$cursorLayer.showCursor()},yt.prototype.scrollSelectionIntoView=function(_t,Ct,Et){this.scrollCursorIntoView(_t,Et),this.scrollCursorIntoView(Ct,Et)},yt.prototype.scrollCursorIntoView=function(_t,Ct,Et){if(this.$size.scrollerHeight!==0){var kt=this.$cursorLayer.getPixelPosition(_t),Tt=kt.left,$t=kt.top,It=Et&&Et.top||0,Ot=Et&&Et.bottom||0;this.$scrollAnimation&&(this.$stopAnimation=!0);var Mt=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;Mt+It>$t?(Ct&&Mt+It>$t+this.lineHeight&&($t-=Ct*this.$size.scrollerHeight),$t===0&&($t=-this.scrollMargin.top),this.session.setScrollTop($t)):Mt+this.$size.scrollerHeight-Ot<$t+this.lineHeight&&(Ct&&Mt+this.$size.scrollerHeight-Ot<$t-this.lineHeight&&($t+=Ct*this.$size.scrollerHeight),this.session.setScrollTop($t+this.lineHeight+Ot-this.$size.scrollerHeight));var Dt=this.scrollLeft,Bt=2*this.layerConfig.characterWidth;Tt-Bt=1-this.scrollMargin.top||Ct>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||_t<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||_t>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right)return!0},yt.prototype.pixelToScreenCoordinates=function(_t,Ct){var Et;if(this.$hasCssTransforms){Et={top:0,left:0};var kt=this.$fontMetrics.transformCoordinates([_t,Ct]);_t=kt[1]-this.gutterWidth-this.margin.left,Ct=kt[0]}else Et=this.scroller.getBoundingClientRect();var Tt=_t+this.scrollLeft-Et.left-this.$padding,$t=Tt/this.characterWidth,It=Math.floor((Ct+this.scrollTop-Et.top)/this.lineHeight),Ot=this.$blockCursor?Math.floor($t):Math.round($t);return{row:It,column:Ot,side:$t-Ot>0?1:-1,offsetX:Tt}},yt.prototype.screenToTextCoordinates=function(_t,Ct){var Et;if(this.$hasCssTransforms){Et={top:0,left:0};var kt=this.$fontMetrics.transformCoordinates([_t,Ct]);_t=kt[1]-this.gutterWidth-this.margin.left,Ct=kt[0]}else Et=this.scroller.getBoundingClientRect();var Tt=_t+this.scrollLeft-Et.left-this.$padding,$t=Tt/this.characterWidth,It=this.$blockCursor?Math.floor($t):Math.round($t),Ot=Math.floor((Ct+this.scrollTop-Et.top)/this.lineHeight);return this.session.screenToDocumentPosition(Ot,Math.max(It,0),Tt)},yt.prototype.textToScreenCoordinates=function(_t,Ct){var Et=this.scroller.getBoundingClientRect(),kt=this.session.documentToScreenPosition(_t,Ct),Tt=this.$padding+(this.session.$bidiHandler.isBidiRow(kt.row,_t)?this.session.$bidiHandler.getPosLeft(kt.column):Math.round(kt.column*this.characterWidth)),$t=kt.row*this.lineHeight;return{pageX:Et.left+Tt-this.scrollLeft,pageY:Et.top+$t-this.scrollTop}},yt.prototype.visualizeFocus=function(){ot.addCssClass(this.container,"ace_focus")},yt.prototype.visualizeBlur=function(){ot.removeCssClass(this.container,"ace_focus")},yt.prototype.showComposition=function(_t){this.$composition=_t,_t.cssText||(_t.cssText=this.textarea.style.cssText),_t.useTextareaForIME==null&&(_t.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(ot.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):_t.markerId=this.session.addMarker(_t.markerRange,"ace_composition_marker","text")},yt.prototype.setCompositionText=function(_t){var Ct=this.session.selection.cursor;this.addToken(_t,"composition_placeholder",Ct.row,Ct.column),this.$moveTextAreaToCursor()},yt.prototype.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),ot.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var _t=this.session.selection.cursor;this.removeExtraToken(_t.row,_t.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},yt.prototype.setGhostText=function(_t,Ct){var Et=this.session.selection.cursor,kt=Ct||{row:Et.row,column:Et.column};this.removeGhostText();var Tt=this.$calculateWrappedTextChunks(_t,kt);this.addToken(Tt[0].text,"ghost_text",kt.row,kt.column),this.$ghostText={text:_t,position:{row:kt.row,column:kt.column}};var $t=ot.createElement("div");if(Tt.length>1){var It=this.hideTokensAfterPosition(kt.row,kt.column),Ot;Tt.slice(1).forEach(function(zt){var Ht=ot.createElement("div"),Zt=ot.createElement("span");Zt.className="ace_ghost_text",zt.wrapped&&(Ht.className="ghost_text_line_wrapped"),zt.text.length===0&&(zt.text=" "),Zt.appendChild(ot.createTextNode(zt.text)),Ht.appendChild(Zt),$t.appendChild(Ht),Ot=Ht}),It.forEach(function(zt){var Ht=ot.createElement("span");St(zt.type)||(Ht.className="ace_"+zt.type.replace(/\./g," ace_")),Ht.appendChild(ot.createTextNode(zt.value)),Ot.appendChild(Ht)}),this.$ghostTextWidget={el:$t,row:kt.row,column:kt.column,className:"ace_ghost_text_container"},this.session.widgetManager.addLineWidget(this.$ghostTextWidget);var Mt=this.$cursorLayer.getPixelPosition(kt,!0),Dt=this.container,Bt=Dt.getBoundingClientRect().height,Kt=Tt.length*this.lineHeight,Wt=Kt0){var Dt=0;Mt.push(Tt[It].length);for(var Bt=0;Bt1||Math.abs(_t.$size.height-kt)>1?_t.$resizeTimer.delay():_t.$resizeTimer.cancel()}),this.$resizeObserver.observe(this.container)}},yt}();xt.prototype.CHANGE_CURSOR=1,xt.prototype.CHANGE_MARKER=2,xt.prototype.CHANGE_GUTTER=4,xt.prototype.CHANGE_SCROLL=8,xt.prototype.CHANGE_LINES=16,xt.prototype.CHANGE_TEXT=32,xt.prototype.CHANGE_SIZE=64,xt.prototype.CHANGE_MARKER_BACK=128,xt.prototype.CHANGE_MARKER_FRONT=256,xt.prototype.CHANGE_FULL=512,xt.prototype.CHANGE_H_SCROLL=1024,xt.prototype.$changes=0,xt.prototype.$padding=null,xt.prototype.$frozen=!1,xt.prototype.STEPS=8,tt.implement(xt.prototype,pt),nt.defineOptions(xt.prototype,"renderer",{useResizeObserver:{set:function(yt){!yt&&this.$resizeObserver?(this.$resizeObserver.disconnect(),this.$resizeTimer.cancel(),this.$resizeTimer=this.$resizeObserver=null):yt&&!this.$resizeObserver&&this.$addResizeObserver()}},animatedScroll:{initialValue:!1},showInvisibles:{set:function(yt){this.$textLayer.setShowInvisibles(yt)&&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(yt){typeof yt=="number"&&(this.$printMarginColumn=yt),this.$showPrintMargin=!!yt,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(yt){this.$gutter.style.display=yt?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},useSvgGutterIcons:{set:function(yt){this.$gutterLayer.$useSvgGutterIcons=yt},initialValue:!1},showFoldedAnnotations:{set:function(yt){this.$gutterLayer.$showFoldedAnnotations=yt},initialValue:!1},fadeFoldWidgets:{set:function(yt){ot.setCssClass(this.$gutter,"ace_fade-fold-widgets",yt)},initialValue:!1},showFoldWidgets:{set:function(yt){this.$gutterLayer.setShowFoldWidgets(yt),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(yt){this.$textLayer.setDisplayIndentGuides(yt)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightIndentGuides:{set:function(yt){this.$textLayer.setHighlightIndentGuides(yt)==!0?this.$textLayer.$highlightIndentGuide():this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells)},initialValue:!0},highlightGutterLine:{set:function(yt){this.$gutterLayer.setHighlightGutterLine(yt),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(yt){(!this.$hScrollBarAlwaysVisible||!this.$horizScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(yt){(!this.$vScrollBarAlwaysVisible||!this.$vScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(yt){typeof yt=="number"&&(yt=yt+"px"),this.container.style.fontSize=yt,this.updateFontSize()},initialValue:12},fontFamily:{set:function(yt){this.container.style.fontFamily=yt,this.updateFontSize()}},maxLines:{set:function(yt){this.updateFull()}},minLines:{set:function(yt){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(yt){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(yt){yt=+yt||0,this.$scrollPastEnd!=yt&&(this.$scrollPastEnd=yt,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(yt){this.$gutterLayer.$fixedWidth=!!yt,this.$loop.schedule(this.CHANGE_GUTTER)}},customScrollbar:{set:function(yt){this.$updateCustomScrollbar(yt)},initialValue:!1},theme:{set:function(yt){this.setTheme(yt)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!dt.isMobile&&!dt.isIE}}),a.VirtualRenderer=xt}),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(o,a,rt){var tt=o("../lib/oop"),ot=o("../lib/net"),at=o("../lib/event_emitter").EventEmitter,nt=o("../config");function it(et){var st="importScripts('"+ot.qualifyURL(et)+"');";try{return new Blob([st],{type:"application/javascript"})}catch{var lt=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,ct=new lt;return ct.append(st),ct.getBlob("application/javascript")}}function j(et){if(typeof Worker>"u")return{postMessage:function(){},terminate:function(){}};if(nt.get("loadWorkerFromBlob")){var st=it(et),lt=window.URL||window.webkitURL,ct=lt.createObjectURL(st);return new Worker(ct)}return new Worker(et)}var _=function(et){et.postMessage||(et=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=et,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(){tt.implement(this,at),this.$createWorkerFromOldConfig=function(et,st,lt,ct,ht){if(o.nameToUrl&&!o.toUrl&&(o.toUrl=o.nameToUrl),nt.get("packaged")||!o.toUrl)ct=ct||nt.moduleUrl(st,"worker");else{var ut=this.$normalizePath;ct=ct||ut(o.toUrl("ace/worker/worker.js",null,"_"));var pt={};et.forEach(function(mt){pt[mt]=ut(o.toUrl(mt,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}return this.$worker=j(ct),ht&&this.send("importScripts",ht),this.$worker.postMessage({init:!0,tlns:pt,module:st,classname:lt}),this.$worker},this.onMessage=function(et){var st=et.data;switch(st.type){case"event":this._signal(st.name,{data:st.data});break;case"call":var lt=this.callbacks[st.id];lt&&(lt(st.data),delete this.callbacks[st.id]);break;case"error":this.reportError(st.data);break;case"log":window.console&&console.log&&console.log.apply(console,st.data);break}},this.reportError=function(et){window.console&&console.error&&console.error(et)},this.$normalizePath=function(et){return ot.qualifyURL(et)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker.onerror=function(et){et.preventDefault()},this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(et,st){this.$worker.postMessage({command:et,args:st})},this.call=function(et,st,lt){if(lt){var ct=this.callbackId++;this.callbacks[ct]=lt,st.push(ct)}this.send(et,st)},this.emit=function(et,st){try{st.data&&st.data.err&&(st.data.err={message:st.data.err.message,stack:st.data.err.stack,code:st.data.err.code}),this.$worker&&this.$worker.postMessage({event:et,data:{data:st.data}})}catch(lt){console.error(lt.stack)}},this.attachToDocument=function(et){this.$doc&&this.terminate(),this.$doc=et,this.call("setValue",[et.getValue()]),et.on("change",this.changeListener,!0)},this.changeListener=function(et){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),et.action=="insert"?this.deltaQueue.push(et.start,et.lines):this.deltaQueue.push(et.start,et.end)},this.$sendDeltaQueue=function(){var et=this.deltaQueue;et&&(this.deltaQueue=null,et.length>50&&et.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:et}))}}).call(_.prototype);var $=function(et,st,lt){var ct=null,ht=!1,ut=Object.create(at),pt=[],mt=new _({messageBuffer:pt,terminate:function(){},postMessage:function(dt){pt.push(dt),ct&&(ht?setTimeout(gt):gt())}});mt.setEmitSync=function(dt){ht=dt};var gt=function(){var dt=pt.shift();dt.command?ct[dt.command].apply(ct,dt.args):dt.event&&ut._signal(dt.event,dt.data)};return ut.postMessage=function(dt){mt.onMessage({data:dt})},ut.callback=function(dt,St){this.postMessage({type:"call",id:St,data:dt})},ut.emit=function(dt,St){this.postMessage({type:"event",name:dt,data:St})},nt.loadModule(["worker",st],function(dt){for(ct=new dt[lt](ut);pt.length;)gt()}),mt};a.UIWorkerClient=$,a.WorkerClient=_,a.createWorker=j}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(o,a,rt){var tt=o("./range").Range,ot=o("./lib/event_emitter").EventEmitter,at=o("./lib/oop"),nt=function(){function it(j,_,$,et,st,lt){var ct=this;this.length=_,this.session=j,this.doc=j.getDocument(),this.mainClass=st,this.othersClass=lt,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate,!0),this.$others=et,this.$onCursorChange=function(){setTimeout(function(){ct.onCursorChange()})},this.$pos=$;var ht=j.getUndoManager().$undoStack||j.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=ht.length,this.setup(),j.selection.on("changeCursor",this.$onCursorChange)}return it.prototype.setup=function(){var j=this,_=this.doc,$=this.session;this.selectionBefore=$.selection.toJSON(),$.selection.inMultiSelectMode&&$.selection.toSingleRange(),this.pos=_.createAnchor(this.$pos.row,this.$pos.column);var et=this.pos;et.$insertRight=!0,et.detach(),et.markerId=$.addMarker(new tt(et.row,et.column,et.row,et.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(st){var lt=_.createAnchor(st.row,st.column);lt.$insertRight=!0,lt.detach(),j.others.push(lt)}),$.setUndoSelect(!1)},it.prototype.showOtherMarkers=function(){if(!this.othersActive){var j=this.session,_=this;this.othersActive=!0,this.others.forEach(function($){$.markerId=j.addMarker(new tt($.row,$.column,$.row,$.column+_.length),_.othersClass,null,!1)})}},it.prototype.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var j=0;j=this.pos.column&&_.start.column<=this.pos.column+this.length+1,st=_.start.column-this.pos.column;if(this.updateAnchors(j),et&&(this.length+=$),et&&!this.session.$fromUndo){if(j.action==="insert")for(var lt=this.others.length-1;lt>=0;lt--){var ct=this.others[lt],ht={row:ct.row,column:ct.column+st};this.doc.insertMergedLines(ht,j.lines)}else if(j.action==="remove")for(var lt=this.others.length-1;lt>=0;lt--){var ct=this.others[lt],ht={row:ct.row,column:ct.column+st};this.doc.remove(new tt(ht.row,ht.column,ht.row,ht.column-$))}}this.$updating=!1,this.updateMarkers()}},it.prototype.updateAnchors=function(j){this.pos.onChange(j);for(var _=this.others.length;_--;)this.others[_].onChange(j);this.updateMarkers()},it.prototype.updateMarkers=function(){if(!this.$updating){var j=this,_=this.session,$=function(st,lt){_.removeMarker(st.markerId),st.markerId=_.addMarker(new tt(st.row,st.column,st.row,st.column+j.length),lt,null,!1)};$(this.pos,this.mainClass);for(var et=this.others.length;et--;)$(this.others[et],this.othersClass)}},it.prototype.onCursorChange=function(j){if(!(this.$updating||!this.session)){var _=this.session.selection.getCursor();_.row===this.pos.row&&_.column>=this.pos.column&&_.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",j)):(this.hideOtherMarkers(),this._emit("cursorLeave",j))}},it.prototype.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},it.prototype.cancel=function(){if(this.$undoStackDepth!==-1){for(var j=this.session.getUndoManager(),_=(j.$undoStack||j.$undostack).length-this.$undoStackDepth,$=0;$<_;$++)j.undo(this.session,!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}},it}();at.implement(nt.prototype,ot),a.PlaceHolder=nt}),ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(o,a,rt){var tt=o("../lib/event"),ot=o("../lib/useragent");function at(it,j){return it.row==j.row&&it.column==j.column}function nt(it){var j=it.domEvent,_=j.altKey,$=j.shiftKey,et=j.ctrlKey,st=it.getAccelKey(),lt=it.getButton();if(et&&ot.isMac&&(lt=j.button),it.editor.inMultiSelectMode&<==2){it.editor.textInput.onContextMenu(it.domEvent);return}if(!et&&!_&&!st){lt===0&&it.editor.inMultiSelectMode&&it.editor.exitMultiSelectMode();return}if(lt===0){var ct=it.editor,ht=ct.selection,ut=ct.inMultiSelectMode,pt=it.getDocumentPosition(),mt=ht.getCursor(),gt=it.inSelection()||ht.isEmpty()&&at(pt,mt),dt=it.x,St=it.y,xt=function(Kt){dt=Kt.clientX,St=Kt.clientY},yt=ct.session,_t=ct.renderer.pixelToScreenCoordinates(dt,St),Ct=_t,Et;if(ct.$mouseHandler.$enableJumpToDef)et&&_||st&&_?Et=$?"block":"add":_&&ct.$blockSelectEnabled&&(Et="block");else if(st&&!_){if(Et="add",!ut&&$)return}else _&&ct.$blockSelectEnabled&&(Et="block");if(Et&&ot.isMac&&j.ctrlKey&&ct.$mouseHandler.cancelContextMenu(),Et=="add"){if(!ut&>)return;if(!ut){var kt=ht.toOrientedRange();ct.addSelectionMarker(kt)}var Tt=ht.rangeList.rangeAtPoint(pt);ct.inVirtualSelectionMode=!0,$&&(Tt=null,kt=ht.ranges[0]||kt,ct.removeSelectionMarker(kt)),ct.once("mouseup",function(){var Kt=ht.toOrientedRange();Tt&&Kt.isEmpty()&&at(Tt.cursor,Kt.cursor)?ht.substractPoint(Kt.cursor):($?ht.substractPoint(kt.cursor):kt&&(ct.removeSelectionMarker(kt),ht.addRange(kt)),ht.addRange(Kt)),ct.inVirtualSelectionMode=!1})}else if(Et=="block"){it.stop(),ct.inVirtualSelectionMode=!0;var $t,It=[],Ot=function(){var Kt=ct.renderer.pixelToScreenCoordinates(dt,St),Wt=yt.screenToDocumentPosition(Kt.row,Kt.column,Kt.offsetX);at(Ct,Kt)&&at(Wt,ht.lead)||(Ct=Kt,ct.selection.moveToPosition(Wt),ct.renderer.scrollCursorIntoView(),ct.removeSelectionMarkers(It),It=ht.rectangularRangeBlock(Ct,_t),ct.$mouseHandler.$clickSelection&&It.length==1&&It[0].isEmpty()&&(It[0]=ct.$mouseHandler.$clickSelection.clone()),It.forEach(ct.addSelectionMarker,ct),ct.updateSelectionMarkers())};ut&&!st?ht.toSingleRange():!ut&&st&&($t=ht.toOrientedRange(),ct.addSelectionMarker($t)),$?_t=yt.documentToScreenPosition(ht.lead):ht.moveToPosition(pt),Ct={row:-1,column:-1};var Mt=function(Kt){Ot(),clearInterval(Bt),ct.removeSelectionMarkers(It),It.length||(It=[ht.toOrientedRange()]),$t&&(ct.removeSelectionMarker($t),ht.toSingleRange($t));for(var Wt=0;Wt1?ot.multiSelect.joinSelections():ot.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(ot){ot.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(ot){ot.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(ot){ot.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],a.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(ot){ot.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(ot){return ot&&ot.inMultiSelectMode}}];var tt=o("../keyboard/hash_handler").HashHandler;a.keyboardHandler=new tt(a.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(o,a,rt){var tt=o("./range_list").RangeList,ot=o("./range").Range,at=o("./selection").Selection,nt=o("./mouse/multi_select_handler").onMouseDown,it=o("./lib/event"),j=o("./lib/lang"),_=o("./commands/multi_select_commands");a.commands=_.defaultCommands.concat(_.multiSelectCommands);var $=o("./search").Search,et=new $;function st(mt,gt,dt){return et.$options.wrap=!0,et.$options.needle=gt,et.$options.backwards=dt==-1,et.find(mt)}var lt=o("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(lt.prototype),(function(){this.ranges=null,this.rangeList=null,this.addRange=function(mt,gt){if(mt){if(!this.inMultiSelectMode&&this.rangeCount===0){var dt=this.toOrientedRange();if(this.rangeList.add(dt),this.rangeList.add(mt),this.rangeList.ranges.length!=2)return this.rangeList.removeAll(),gt||this.fromOrientedRange(mt);this.rangeList.removeAll(),this.rangeList.add(dt),this.$onAddRange(dt)}mt.cursor||(mt.cursor=mt.end);var St=this.rangeList.add(mt);return this.$onAddRange(mt),St.length&&this.$onRemoveRange(St),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),gt||this.fromOrientedRange(mt)}},this.toSingleRange=function(mt){mt=mt||this.ranges[0];var gt=this.rangeList.removeAll();gt.length&&this.$onRemoveRange(gt),mt&&this.fromOrientedRange(mt)},this.substractPoint=function(mt){var gt=this.rangeList.substractPoint(mt);if(gt)return this.$onRemoveRange(gt),gt[0]},this.mergeOverlappingRanges=function(){var mt=this.rangeList.merge();mt.length&&this.$onRemoveRange(mt)},this.$onAddRange=function(mt){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(mt),this._signal("addRange",{range:mt})},this.$onRemoveRange=function(mt){if(this.rangeCount=this.rangeList.ranges.length,this.rangeCount==1&&this.inMultiSelectMode){var gt=this.rangeList.ranges.pop();mt.push(gt),this.rangeCount=0}for(var dt=mt.length;dt--;){var St=this.ranges.indexOf(mt[dt]);this.ranges.splice(St,1)}this._signal("removeRange",{ranges:mt}),this.rangeCount===0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),gt=gt||this.ranges[0],gt&&!gt.isEqual(this.getRange())&&this.fromOrientedRange(gt)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new tt,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var mt=this.ranges.length?this.ranges:[this.getRange()],gt=[],dt=0;dt1){var mt=this.rangeList.ranges,gt=mt[mt.length-1],dt=ot.fromPoints(mt[0].start,gt.end);this.toSingleRange(),this.setSelectionRange(dt,gt.cursor==gt.start)}else{var St=this.session.documentToScreenPosition(this.cursor),xt=this.session.documentToScreenPosition(this.anchor),yt=this.rectangularRangeBlock(St,xt);yt.forEach(this.addRange,this)}},this.rectangularRangeBlock=function(mt,gt,dt){var St=[],xt=mt.column0;)Dt--;if(Dt>0)for(var Bt=0;St[Bt].isEmpty();)Bt++;for(var Kt=Dt;Kt>=Bt;Kt--)St[Kt].isEmpty()&&St.splice(Kt,1)}return St}}).call(at.prototype);var ct=o("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(mt){mt.cursor||(mt.cursor=mt.end);var gt=this.getSelectionStyle();return mt.marker=this.session.addMarker(mt,"ace_selection",gt),this.session.$selectionMarkers.push(mt),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,mt},this.removeSelectionMarker=function(mt){if(mt.marker){this.session.removeMarker(mt.marker);var gt=this.session.$selectionMarkers.indexOf(mt);gt!=-1&&this.session.$selectionMarkers.splice(gt,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(mt){for(var gt=this.session.$selectionMarkers,dt=mt.length;dt--;){var St=mt[dt];if(St.marker){this.session.removeMarker(St.marker);var xt=gt.indexOf(St);xt!=-1&>.splice(xt,1)}}this.session.selectionMarkerCount=gt.length},this.$onAddRange=function(mt){this.addSelectionMarker(mt.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(mt){this.removeSelectionMarkers(mt.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(mt){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(_.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(mt){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(_.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(mt){var gt=mt.command,dt=mt.editor;if(dt.multiSelect){if(gt.multiSelectAction)gt.multiSelectAction=="forEach"?St=dt.forEachSelection(gt,mt.args):gt.multiSelectAction=="forEachLine"?St=dt.forEachSelection(gt,mt.args,!0):gt.multiSelectAction=="single"?(dt.exitMultiSelectMode(),St=gt.exec(dt,mt.args||{})):St=gt.multiSelectAction(dt,mt.args||{});else{var St=gt.exec(dt,mt.args||{});dt.multiSelect.addRange(dt.multiSelect.toOrientedRange()),dt.multiSelect.mergeOverlappingRanges()}return St}},this.forEachSelection=function(mt,gt,dt){if(!this.inVirtualSelectionMode){var St=dt&&dt.keepOrder,xt=dt==!0||dt&&dt.$byLines,yt=this.session,_t=this.selection,Ct=_t.rangeList,Et=(St?_t:Ct).ranges,kt;if(!Et.length)return mt.exec?mt.exec(this,gt||{}):mt(this,gt||{});var Tt=_t._eventRegistry;_t._eventRegistry={};var $t=new at(yt);this.inVirtualSelectionMode=!0;for(var It=Et.length;It--;){if(xt)for(;It>0&&Et[It].start.row==Et[It-1].end.row;)It--;$t.fromOrientedRange(Et[It]),$t.index=It,this.selection=yt.selection=$t;var Ot=mt.exec?mt.exec(this,gt||{}):mt(this,gt||{});!kt&&Ot!==void 0&&(kt=Ot),$t.toOrientedRange(Et[It])}$t.detach(),this.selection=yt.selection=_t,this.inVirtualSelectionMode=!1,_t._eventRegistry=Tt,_t.mergeOverlappingRanges(),_t.ranges[0]&&_t.fromOrientedRange(_t.ranges[0]);var Mt=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),Mt&&Mt.from==Mt.to&&this.renderer.animateScrolling(Mt.from),kt}},this.exitMultiSelectMode=function(){!this.inMultiSelectMode||this.inVirtualSelectionMode||this.multiSelect.toSingleRange()},this.getSelectedText=function(){var mt="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var gt=this.multiSelect.rangeList.ranges,dt=[],St=0;St0);_t<0&&(_t=0),Ct>=kt&&(Ct=kt-1)}var $t=this.session.removeFullLines(_t,Ct);$t=this.$reAlignText($t,Et),this.session.insert({row:_t,column:0},$t.join(` `)+` -`),Et||(yt.start.column=0,yt.end.column=$t[$t.length-1].length),this.selection.setRange(yt)}else{xt.forEach(function(Dt){gt.substractPoint(Dt.cursor)});var It=0,Ot=1/0,Mt=dt.map(function(Dt){var Bt=Dt.cursor,Kt=mt.getLine(Bt.row),Wt=Kt.substr(Bt.column).search(/\S/g);return Wt==-1&&(Wt=0),Bt.column>It&&(It=Bt.column),Wtzt?mt.insert(Kt,j.stringRepeat(" ",Wt-zt)):mt.remove(new ot(Kt.row,Kt.column,Kt.row,Kt.column-Wt+zt)),Dt.start.column=Dt.end.column=It,Dt.start.row=Dt.end.row=Kt.row,Dt.cursor=Dt.end}),gt.fromOrientedRange(dt[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}},this.$reAlignText=function(mt,gt){var dt=!0,St=!0,xt,yt,_t;return mt.map(function($t){var It=$t.match(/(\s*)(.*?)(\s*)([=:].*)/);return It?xt==null?(xt=It[1].length,yt=It[2].length,_t=It[3].length,It):(xt+yt+_t!=It[1].length+It[2].length+It[3].length&&(St=!1),xt!=It[1].length&&(dt=!1),xt>It[1].length&&(xt=It[1].length),ytIt[3].length&&(_t=It[3].length),It):[$t]}).map(gt?Et:dt?St?kt:Et:Tt);function Ct($t){return j.stringRepeat(" ",$t)}function Et($t){return $t[2]?Ct(xt)+$t[2]+Ct(yt-$t[2].length+_t)+$t[4].replace(/^([=:])\s+/,"$1 "):$t[0]}function kt($t){return $t[2]?Ct(xt+yt-$t[2].length)+$t[2]+Ct(_t)+$t[4].replace(/^([=:])\s+/,"$1 "):$t[0]}function Tt($t){return $t[2]?Ct(xt)+$t[2]+Ct(_t)+$t[4].replace(/^([=:])\s+/,"$1 "):$t[0]}}}).call(ct.prototype);function ht(mt,gt){return mt.row==gt.row&&mt.column==gt.column}a.onSessionChange=function(mt){var gt=mt.session;gt&&!gt.multiSelect&&(gt.$selectionMarkers=[],gt.selection.$initRangeList(),gt.multiSelect=gt.selection),this.multiSelect=gt&>.multiSelect;var dt=mt.oldSession;dt&&(dt.multiSelect.off("addRange",this.$onAddRange),dt.multiSelect.off("removeRange",this.$onRemoveRange),dt.multiSelect.off("multiSelect",this.$onMultiSelect),dt.multiSelect.off("singleSelect",this.$onSingleSelect),dt.multiSelect.lead.off("change",this.$checkMultiselectChange),dt.multiSelect.anchor.off("change",this.$checkMultiselectChange)),gt&&(gt.multiSelect.on("addRange",this.$onAddRange),gt.multiSelect.on("removeRange",this.$onRemoveRange),gt.multiSelect.on("multiSelect",this.$onMultiSelect),gt.multiSelect.on("singleSelect",this.$onSingleSelect),gt.multiSelect.lead.on("change",this.$checkMultiselectChange),gt.multiSelect.anchor.on("change",this.$checkMultiselectChange)),gt&&this.inMultiSelectMode!=gt.selection.inMultiSelectMode&&(gt.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())};function ut(mt){mt.$multiselectOnSessionChange||(mt.$onAddRange=mt.$onAddRange.bind(mt),mt.$onRemoveRange=mt.$onRemoveRange.bind(mt),mt.$onMultiSelect=mt.$onMultiSelect.bind(mt),mt.$onSingleSelect=mt.$onSingleSelect.bind(mt),mt.$multiselectOnSessionChange=a.onSessionChange.bind(mt),mt.$checkMultiselectChange=mt.$checkMultiselectChange.bind(mt),mt.$multiselectOnSessionChange(mt),mt.on("changeSession",mt.$multiselectOnSessionChange),mt.on("mousedown",nt),mt.commands.addCommands(_.defaultCommands),pt(mt))}function pt(mt){if(!mt.textInput)return;var gt=mt.textInput.getElement(),dt=!1;it.addListener(gt,"keydown",function(xt){var yt=xt.keyCode==18&&!(xt.ctrlKey||xt.shiftKey||xt.metaKey);mt.$blockSelectEnabled&&yt?dt||(mt.renderer.setMouseCursor("crosshair"),dt=!0):dt&&St()},mt),it.addListener(gt,"keyup",St,mt),it.addListener(gt,"blur",St,mt);function St(xt){dt&&(mt.renderer.setMouseCursor(""),dt=!1)}}a.MultiSelect=ut,o("./config").defineOptions(ct.prototype,"editor",{enableMultiselect:{set:function(mt){ut(this),mt?this.on("mousedown",nt):this.off("mousedown",nt)},value:!0},enableBlockSelect:{set:function(mt){this.$blockSelectEnabled=mt},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(o,a,rt){var et=o("../../range").Range,ot=a.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(at,nt,it){var j=at.getLine(it);return this.foldingStartMarker.test(j)?"start":nt=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(j)?"end":""},this.getFoldWidgetRange=function(at,nt,it){return null},this.indentationBlock=function(at,nt,it){var j=/\S/,_=at.getLine(nt),$=_.search(j);if($!=-1){for(var tt=it||_.length,st=at.getLength(),lt=nt,ct=nt;++ntlt){var pt=at.getLine(ct).length;return new et(lt,tt,ct,pt)}}},this.openingBracketBlock=function(at,nt,it,j,_){var $={row:it,column:j+1},tt=at.$findClosingBracket(nt,$,_);if(tt){var st=at.foldWidgets[tt.row];return st==null&&(st=at.getFoldWidget(tt.row)),st=="start"&&tt.row>$.row&&(tt.row--,tt.column=at.getLine(tt.row).length),et.fromPoints($,tt)}},this.closingBracketBlock=function(at,nt,it,j,_){var $={row:it,column:j},tt=at.$findOpeningBracket(nt,$);if(tt)return tt.column++,$.column--,et.fromPoints(tt,$)}}).call(ot.prototype)}),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range","ace/config"],function(o,a,rt){var et=o("../line_widgets").LineWidgets,ot=o("../lib/dom"),at=o("../range").Range,nt=o("../config").nls;function it(_,$,tt){for(var st=0,lt=_.length-1;st<=lt;){var ct=st+lt>>1,ht=tt($,_[ct]);if(ht>0)st=ct+1;else if(ht<0)lt=ct-1;else return ct}return-(st+1)}function j(_,$,tt){var st=_.getAnnotations().sort(at.comparePoints);if(st.length){var lt=it(st,{row:$,column:-1},at.comparePoints);lt<0&&(lt=-lt-1),lt>=st.length?lt=tt>0?0:st.length-1:lt===0&&tt<0&&(lt=st.length-1);var ct=st[lt];if(!(!ct||!tt)){if(ct.row===$){do ct=st[lt+=tt];while(ct&&ct.row===$);if(!ct)return st.slice()}var ht=[];$=ct.row;do ht[tt<0?"unshift":"push"](ct),ct=st[lt+=tt];while(ct&&ct.row==$);return ht.length&&ht}}}a.showErrorMarker=function(_,$){var tt=_.session;tt.widgetManager||(tt.widgetManager=new et(tt),tt.widgetManager.attach(_));var st=_.getCursorPosition(),lt=st.row,ct=tt.widgetManager.getWidgetsAtRow(lt).filter(function(yt){return yt.type=="errorMarker"})[0];ct?ct.destroy():lt-=$;var ht=j(tt,lt,$),ut;if(ht){var pt=ht[0];st.column=(pt.pos&&typeof pt.column!="number"?pt.pos.sc:pt.column)||0,st.row=pt.row,ut=_.renderer.$gutterLayer.$annotations[st.row]}else{if(ct)return;ut={displayText:[nt("error-marker.good-state","Looks good!")],className:"ace_ok"}}_.session.unfold(st.row),_.selection.moveToPosition(st);var mt={row:st.row,fixedWidth:!0,coverGutter:!0,el:ot.createElement("div"),type:"errorMarker"},gt=mt.el.appendChild(ot.createElement("div")),dt=mt.el.appendChild(ot.createElement("div"));dt.className="error_widget_arrow "+ut.className;var St=_.renderer.$cursorLayer.getPixelPosition(st).left;dt.style.left=St+_.renderer.gutterWidth-5+"px",mt.el.className="error_widget_wrapper",gt.className="error_widget "+ut.className,ut.displayText.forEach(function(yt,_t){gt.appendChild(ot.createTextNode(yt)),_tIt&&(It=Bt.column),Wtzt?mt.insert(Kt,j.stringRepeat(" ",Wt-zt)):mt.remove(new ot(Kt.row,Kt.column,Kt.row,Kt.column-Wt+zt)),Dt.start.column=Dt.end.column=It,Dt.start.row=Dt.end.row=Kt.row,Dt.cursor=Dt.end}),gt.fromOrientedRange(dt[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}},this.$reAlignText=function(mt,gt){var dt=!0,St=!0,xt,yt,_t;return mt.map(function($t){var It=$t.match(/(\s*)(.*?)(\s*)([=:].*)/);return It?xt==null?(xt=It[1].length,yt=It[2].length,_t=It[3].length,It):(xt+yt+_t!=It[1].length+It[2].length+It[3].length&&(St=!1),xt!=It[1].length&&(dt=!1),xt>It[1].length&&(xt=It[1].length),ytIt[3].length&&(_t=It[3].length),It):[$t]}).map(gt?Et:dt?St?kt:Et:Tt);function Ct($t){return j.stringRepeat(" ",$t)}function Et($t){return $t[2]?Ct(xt)+$t[2]+Ct(yt-$t[2].length+_t)+$t[4].replace(/^([=:])\s+/,"$1 "):$t[0]}function kt($t){return $t[2]?Ct(xt+yt-$t[2].length)+$t[2]+Ct(_t)+$t[4].replace(/^([=:])\s+/,"$1 "):$t[0]}function Tt($t){return $t[2]?Ct(xt)+$t[2]+Ct(_t)+$t[4].replace(/^([=:])\s+/,"$1 "):$t[0]}}}).call(ct.prototype);function ht(mt,gt){return mt.row==gt.row&&mt.column==gt.column}a.onSessionChange=function(mt){var gt=mt.session;gt&&!gt.multiSelect&&(gt.$selectionMarkers=[],gt.selection.$initRangeList(),gt.multiSelect=gt.selection),this.multiSelect=gt&>.multiSelect;var dt=mt.oldSession;dt&&(dt.multiSelect.off("addRange",this.$onAddRange),dt.multiSelect.off("removeRange",this.$onRemoveRange),dt.multiSelect.off("multiSelect",this.$onMultiSelect),dt.multiSelect.off("singleSelect",this.$onSingleSelect),dt.multiSelect.lead.off("change",this.$checkMultiselectChange),dt.multiSelect.anchor.off("change",this.$checkMultiselectChange)),gt&&(gt.multiSelect.on("addRange",this.$onAddRange),gt.multiSelect.on("removeRange",this.$onRemoveRange),gt.multiSelect.on("multiSelect",this.$onMultiSelect),gt.multiSelect.on("singleSelect",this.$onSingleSelect),gt.multiSelect.lead.on("change",this.$checkMultiselectChange),gt.multiSelect.anchor.on("change",this.$checkMultiselectChange)),gt&&this.inMultiSelectMode!=gt.selection.inMultiSelectMode&&(gt.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())};function ut(mt){mt.$multiselectOnSessionChange||(mt.$onAddRange=mt.$onAddRange.bind(mt),mt.$onRemoveRange=mt.$onRemoveRange.bind(mt),mt.$onMultiSelect=mt.$onMultiSelect.bind(mt),mt.$onSingleSelect=mt.$onSingleSelect.bind(mt),mt.$multiselectOnSessionChange=a.onSessionChange.bind(mt),mt.$checkMultiselectChange=mt.$checkMultiselectChange.bind(mt),mt.$multiselectOnSessionChange(mt),mt.on("changeSession",mt.$multiselectOnSessionChange),mt.on("mousedown",nt),mt.commands.addCommands(_.defaultCommands),pt(mt))}function pt(mt){if(!mt.textInput)return;var gt=mt.textInput.getElement(),dt=!1;it.addListener(gt,"keydown",function(xt){var yt=xt.keyCode==18&&!(xt.ctrlKey||xt.shiftKey||xt.metaKey);mt.$blockSelectEnabled&&yt?dt||(mt.renderer.setMouseCursor("crosshair"),dt=!0):dt&&St()},mt),it.addListener(gt,"keyup",St,mt),it.addListener(gt,"blur",St,mt);function St(xt){dt&&(mt.renderer.setMouseCursor(""),dt=!1)}}a.MultiSelect=ut,o("./config").defineOptions(ct.prototype,"editor",{enableMultiselect:{set:function(mt){ut(this),mt?this.on("mousedown",nt):this.off("mousedown",nt)},value:!0},enableBlockSelect:{set:function(mt){this.$blockSelectEnabled=mt},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(o,a,rt){var tt=o("../../range").Range,ot=a.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(at,nt,it){var j=at.getLine(it);return this.foldingStartMarker.test(j)?"start":nt=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(j)?"end":""},this.getFoldWidgetRange=function(at,nt,it){return null},this.indentationBlock=function(at,nt,it){var j=/\S/,_=at.getLine(nt),$=_.search(j);if($!=-1){for(var et=it||_.length,st=at.getLength(),lt=nt,ct=nt;++ntlt){var pt=at.getLine(ct).length;return new tt(lt,et,ct,pt)}}},this.openingBracketBlock=function(at,nt,it,j,_){var $={row:it,column:j+1},et=at.$findClosingBracket(nt,$,_);if(et){var st=at.foldWidgets[et.row];return st==null&&(st=at.getFoldWidget(et.row)),st=="start"&&et.row>$.row&&(et.row--,et.column=at.getLine(et.row).length),tt.fromPoints($,et)}},this.closingBracketBlock=function(at,nt,it,j,_){var $={row:it,column:j},et=at.$findOpeningBracket(nt,$);if(et)return et.column++,$.column--,tt.fromPoints(et,$)}}).call(ot.prototype)}),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range","ace/config"],function(o,a,rt){var tt=o("../line_widgets").LineWidgets,ot=o("../lib/dom"),at=o("../range").Range,nt=o("../config").nls;function it(_,$,et){for(var st=0,lt=_.length-1;st<=lt;){var ct=st+lt>>1,ht=et($,_[ct]);if(ht>0)st=ct+1;else if(ht<0)lt=ct-1;else return ct}return-(st+1)}function j(_,$,et){var st=_.getAnnotations().sort(at.comparePoints);if(st.length){var lt=it(st,{row:$,column:-1},at.comparePoints);lt<0&&(lt=-lt-1),lt>=st.length?lt=et>0?0:st.length-1:lt===0&&et<0&&(lt=st.length-1);var ct=st[lt];if(!(!ct||!et)){if(ct.row===$){do ct=st[lt+=et];while(ct&&ct.row===$);if(!ct)return st.slice()}var ht=[];$=ct.row;do ht[et<0?"unshift":"push"](ct),ct=st[lt+=et];while(ct&&ct.row==$);return ht.length&&ht}}}a.showErrorMarker=function(_,$){var et=_.session;et.widgetManager||(et.widgetManager=new tt(et),et.widgetManager.attach(_));var st=_.getCursorPosition(),lt=st.row,ct=et.widgetManager.getWidgetsAtRow(lt).filter(function(yt){return yt.type=="errorMarker"})[0];ct?ct.destroy():lt-=$;var ht=j(et,lt,$),ut;if(ht){var pt=ht[0];st.column=(pt.pos&&typeof pt.column!="number"?pt.pos.sc:pt.column)||0,st.row=pt.row,ut=_.renderer.$gutterLayer.$annotations[st.row]}else{if(ct)return;ut={displayText:[nt("error-marker.good-state","Looks good!")],className:"ace_ok"}}_.session.unfold(st.row),_.selection.moveToPosition(st);var mt={row:st.row,fixedWidth:!0,coverGutter:!0,el:ot.createElement("div"),type:"errorMarker"},gt=mt.el.appendChild(ot.createElement("div")),dt=mt.el.appendChild(ot.createElement("div"));dt.className="error_widget_arrow "+ut.className;var St=_.renderer.$cursorLayer.getPixelPosition(st).left;dt.style.left=St+_.renderer.gutterWidth-5+"px",mt.el.className="error_widget_wrapper",gt.className="error_widget "+ut.className,ut.displayText.forEach(function(yt,_t){gt.appendChild(ot.createTextNode(yt)),_t-1}function oo(ir,Nt){var nr=this.__data__,cr=Xt(nr,ir);return cr<0?(++this.size,nr.push([ir,Nt])):nr[cr][1]=Nt,this}Zn.prototype.clear=ho,Zn.prototype.delete=so,Zn.prototype.get=fo,Zn.prototype.has=po,Zn.prototype.set=oo;function fs(ir){var Nt=-1,nr=ir==null?0:ir.length;for(this.clear();++Ntvn))return!1;var un=Wr.get(ir);if(un&&Wr.get(Nt))return un==Nt;var Ln=-1,Vn=!0,Un=nr&et?new gn:void 0;for(Wr.set(ir,Nt),Wr.set(Nt,ir);++Ln-1&&ir%1==0&&ir-1&&ir%1==0&&ir<=ot}function Ts(ir){var Nt=typeof ir;return ir!=null&&(Nt=="object"||Nt=="function")}function Cs(ir){return ir!=null&&typeof ir=="object"}var Ls=xr?on(xr):zn;function yo(ir){return Fr(ir)?Vt(ir):_i(ir)}function kn(){return[]}function Tn(){return!1}i.exports=ln})(lodash_isequal,lodash_isequal.exports);var lodash_isequalExports=lodash_isequal.exports,editorOptions$1={};Object.defineProperty(editorOptions$1,"__esModule",{value:!0});editorOptions$1.getAceInstance=editorOptions$1.debounce=editorOptions$1.editorEvents=editorOptions$1.editorOptions=void 0;var editorOptions=["minLines","maxLines","readOnly","highlightActiveLine","tabSize","enableBasicAutocompletion","enableLiveAutocompletion","enableSnippets"];editorOptions$1.editorOptions=editorOptions;var editorEvents=["onChange","onFocus","onInput","onBlur","onCopy","onPaste","onSelectionChange","onCursorChange","onScroll","handleOptions","updateRef"];editorOptions$1.editorEvents=editorEvents;var getAceInstance=function(){var i;return typeof window>"u"?(commonjsGlobal.window={},i=aceExports,delete commonjsGlobal.window):window.ace?(i=window.ace,i.acequire=window.ace.require||window.ace.acequire):i=aceExports,i};editorOptions$1.getAceInstance=getAceInstance;var debounce=function(i,s){var o=null;return function(){var a=this,rt=arguments;clearTimeout(o),o=setTimeout(function(){i.apply(a,rt)},s)}};editorOptions$1.debounce=debounce;var __extends$2=commonjsGlobal&&commonjsGlobal.__extends||function(){var i=function(s,o){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,rt){a.__proto__=rt}||function(a,rt){for(var et in rt)Object.prototype.hasOwnProperty.call(rt,et)&&(a[et]=rt[et])},i(s,o)};return function(s,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");i(s,o);function a(){this.constructor=s}s.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}}(),__assign$1=commonjsGlobal&&commonjsGlobal.__assign||function(){return __assign$1=Object.assign||function(i){for(var s,o=1,a=arguments.length;o0&&this.handleMarkers(St);var Ct=this.editor.$options;editorOptions_1$1.editorOptions.forEach(function(Et){Ct.hasOwnProperty(Et)?o.editor.setOption(Et,o.props[Et]):o.props[Et]&&console.warn("ReactAce: editor option ".concat(Et," 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(gt)&>.forEach(function(Et){typeof Et.exec=="string"?o.editor.commands.bindKey(Et.bindKey,Et.exec):o.editor.commands.addCommand(Et)}),pt&&this.editor.setKeyboardHandler("ace/keyboard/"+pt),rt&&(this.refEditor.className+=" "+rt),mt&&mt(this.editor),this.editor.resize(),nt&&this.editor.focus()},s.prototype.componentDidUpdate=function(o){for(var a=o,rt=this.props,et=0;et 0!";if(_!=this.$splits){if(_>this.$splits){for(;this.$splits_;)$=this.$editors[this.$splits-1],this.$container.removeChild($.container),this.$splits--;this.resize()}},this.getSplits=function(){return this.$splits},this.getEditor=function(_){return this.$editors[_]},this.getCurrentEditor=function(){return this.$cEditor},this.focus=function(){this.$cEditor.focus()},this.blur=function(){this.$cEditor.blur()},this.setTheme=function(_){this.$editors.forEach(function($){$.setTheme(_)})},this.setKeyboardHandler=function(_){this.$editors.forEach(function($){$.setKeyboardHandler(_)})},this.forEach=function(_,$){this.$editors.forEach(_,$)},this.$fontSize="",this.setFontSize=function(_){this.$fontSize=_,this.forEach(function($){$.setFontSize(_)})},this.$cloneSession=function(_){var $=new it(_.getDocument(),_.getMode()),tt=_.getUndoManager();return $.setUndoManager(tt),$.setTabSize(_.getTabSize()),$.setUseSoftTabs(_.getUseSoftTabs()),$.setOverwrite(_.getOverwrite()),$.setBreakpoints(_.getBreakpoints()),$.setUseWrapMode(_.getUseWrapMode()),$.setUseWorker(_.getUseWorker()),$.setWrapLimitRange(_.$wrapLimitRange.min,_.$wrapLimitRange.max),$.$foldData=_.$cloneFoldData(),$},this.setSession=function(_,$){var tt;$==null?tt=this.$cEditor:tt=this.$editors[$];var st=this.$editors.some(function(lt){return lt.session===_});return st&&(_=this.$cloneSession(_)),tt.setSession(_),_},this.getOrientation=function(){return this.$orientation},this.setOrientation=function(_){this.$orientation!=_&&(this.$orientation=_,this.resize())},this.resize=function(){var _=this.$container.clientWidth,$=this.$container.clientHeight,tt;if(this.$orientation==this.BESIDE)for(var st=_/this.$splits,lt=0;lt-1}function listCacheSet(i,s){var o=this.__data__,a=assocIndexOf(o,i);return a<0?o.push([i,s]):o[a][1]=s,this}ListCache.prototype.clear=listCacheClear;ListCache.prototype.delete=listCacheDelete;ListCache.prototype.get=listCacheGet;ListCache.prototype.has=listCacheHas;ListCache.prototype.set=listCacheSet;function MapCache(i){var s=-1,o=i?i.length:0;for(this.clear();++s0&&o.handleMarkers(Mt,Et);for(var Tt=0;Tt"u"&&(this.Diff_Timeout<=0?nt=Number.MAX_VALUE:nt=new Date().getTime()+this.Diff_Timeout*1e3);var it=nt;if(et==null||ot==null)throw new Error("Null input. (diff_main)");if(et==ot)return et?[new s.Diff(rt,et)]:[];typeof at>"u"&&(at=!0);var j=at,_=this.diff_commonPrefix(et,ot),$=et.substring(0,_);et=et.substring(_),ot=ot.substring(_),_=this.diff_commonSuffix(et,ot);var tt=et.substring(et.length-_);et=et.substring(0,et.length-_),ot=ot.substring(0,ot.length-_);var st=this.diff_compute_(et,ot,j,it);return $&&st.unshift(new s.Diff(rt,$)),tt&&st.push(new s.Diff(rt,tt)),this.diff_cleanupMerge(st),st},s.prototype.diff_compute_=function(et,ot,at,nt){var it;if(!et)return[new s.Diff(a,ot)];if(!ot)return[new s.Diff(o,et)];var j=et.length>ot.length?et:ot,_=et.length>ot.length?ot:et,$=j.indexOf(_);if($!=-1)return it=[new s.Diff(a,j.substring(0,$)),new s.Diff(rt,_),new s.Diff(a,j.substring($+_.length))],et.length>ot.length&&(it[0][0]=it[2][0]=o),it;if(_.length==1)return[new s.Diff(o,et),new s.Diff(a,ot)];var tt=this.diff_halfMatch_(et,ot);if(tt){var st=tt[0],lt=tt[1],ct=tt[2],ht=tt[3],ut=tt[4],pt=this.diff_main(st,ct,at,nt),mt=this.diff_main(lt,ht,at,nt);return pt.concat([new s.Diff(rt,ut)],mt)}return at&&et.length>100&&ot.length>100?this.diff_lineMode_(et,ot,nt):this.diff_bisect_(et,ot,nt)},s.prototype.diff_lineMode_=function(et,ot,at){var nt=this.diff_linesToChars_(et,ot);et=nt.chars1,ot=nt.chars2;var it=nt.lineArray,j=this.diff_main(et,ot,!1,at);this.diff_charsToLines_(j,it),this.diff_cleanupSemantic(j),j.push(new s.Diff(rt,""));for(var _=0,$=0,tt=0,st="",lt="";_=1&&tt>=1){j.splice(_-$-tt,$+tt),_=_-$-tt;for(var ct=this.diff_main(st,lt,!1,at),ht=ct.length-1;ht>=0;ht--)j.splice(_,0,ct[ht]);_=_+ct.length}tt=0,$=0,st="",lt="";break}_++}return j.pop(),j},s.prototype.diff_bisect_=function(et,ot,at){for(var nt=et.length,it=ot.length,j=Math.ceil((nt+it)/2),_=j,$=2*j,tt=new Array($),st=new Array($),lt=0;lt<$;lt++)tt[lt]=-1,st[lt]=-1;tt[_+1]=0,st[_+1]=0;for(var ct=nt-it,ht=ct%2!=0,ut=0,pt=0,mt=0,gt=0,dt=0;dtat);dt++){for(var St=-dt+ut;St<=dt-pt;St+=2){var xt=_+St,yt;St==-dt||St!=dt&&tt[xt-1]nt)pt+=2;else if(_t>it)ut+=2;else if(ht){var Ct=_+ct-St;if(Ct>=0&&Ct<$&&st[Ct]!=-1){var Et=nt-st[Ct];if(yt>=Et)return this.diff_bisectSplit_(et,ot,yt,_t,at)}}}for(var kt=-dt+mt;kt<=dt-gt;kt+=2){var Ct=_+kt,Et;kt==-dt||kt!=dt&&st[Ct-1]nt)gt+=2;else if(Tt>it)mt+=2;else if(!ht){var xt=_+ct-kt;if(xt>=0&&xt<$&&tt[xt]!=-1){var yt=tt[xt],_t=_+yt-xt;if(Et=nt-Et,yt>=Et)return this.diff_bisectSplit_(et,ot,yt,_t,at)}}}}return[new s.Diff(o,et),new s.Diff(a,ot)]},s.prototype.diff_bisectSplit_=function(et,ot,at,nt,it){var j=et.substring(0,at),_=ot.substring(0,nt),$=et.substring(at),tt=ot.substring(nt),st=this.diff_main(j,_,!1,it),lt=this.diff_main($,tt,!1,it);return st.concat(lt)},s.prototype.diff_linesToChars_=function(et,ot){var at=[],nt={};at[0]="";function it(tt){for(var st="",lt=0,ct=-1,ht=at.length;ctnt?et=et.substring(at-nt):atot.length?et:ot,nt=et.length>ot.length?ot:et;if(at.length<4||nt.length*2=pt.length?[yt,_t,Ct,Et,xt]:null}var _=j(at,nt,Math.ceil(at.length/4)),$=j(at,nt,Math.ceil(at.length/2)),tt;if(!_&&!$)return null;$?_?tt=_[4].length>$[4].length?_:$:tt=$:tt=_;var st,lt,ct,ht;et.length>ot.length?(st=tt[0],lt=tt[1],ct=tt[2],ht=tt[3]):(ct=tt[0],ht=tt[1],st=tt[2],lt=tt[3]);var ut=tt[4];return[st,lt,ct,ht,ut]},s.prototype.diff_cleanupSemantic=function(et){for(var ot=!1,at=[],nt=0,it=null,j=0,_=0,$=0,tt=0,st=0;j0?at[nt-1]:-1,_=0,$=0,tt=0,st=0,it=null,ot=!0)),j++;for(ot&&this.diff_cleanupMerge(et),this.diff_cleanupSemanticLossless(et),j=1;j=ut?(ht>=lt.length/2||ht>=ct.length/2)&&(et.splice(j,0,new s.Diff(rt,ct.substring(0,ht))),et[j-1][1]=lt.substring(0,lt.length-ht),et[j+1][1]=ct.substring(ht),j++):(ut>=lt.length/2||ut>=ct.length/2)&&(et.splice(j,0,new s.Diff(rt,lt.substring(0,ut))),et[j-1][0]=a,et[j-1][1]=ct.substring(0,ct.length-ut),et[j+1][0]=o,et[j+1][1]=lt.substring(ut),j++),j++}j++}},s.prototype.diff_cleanupSemanticLossless=function(et){function ot(ut,pt){if(!ut||!pt)return 6;var mt=ut.charAt(ut.length-1),gt=pt.charAt(0),dt=mt.match(s.nonAlphaNumericRegex_),St=gt.match(s.nonAlphaNumericRegex_),xt=dt&&mt.match(s.whitespaceRegex_),yt=St&>.match(s.whitespaceRegex_),_t=xt&&mt.match(s.linebreakRegex_),Ct=yt&>.match(s.linebreakRegex_),Et=_t&&ut.match(s.blanklineEndRegex_),kt=Ct&&pt.match(s.blanklineStartRegex_);return Et||kt?5:_t||Ct?4:dt&&!xt&&yt?3:xt||yt?2:dt||St?1:0}for(var at=1;at=ct&&(ct=ht,tt=nt,st=it,lt=j)}et[at-1][1]!=tt&&(tt?et[at-1][1]=tt:(et.splice(at-1,1),at--),et[at][1]=st,lt?et[at+1][1]=lt:(et.splice(at+1,1),at--))}at++}},s.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,s.whitespaceRegex_=/\s/,s.linebreakRegex_=/[\r\n]/,s.blanklineEndRegex_=/\n\r?\n$/,s.blanklineStartRegex_=/^\r?\n\r?\n/,s.prototype.diff_cleanupEfficiency=function(et){for(var ot=!1,at=[],nt=0,it=null,j=0,_=!1,$=!1,tt=!1,st=!1;j0?at[nt-1]:-1,tt=st=!1),ot=!0)),j++;ot&&this.diff_cleanupMerge(et)},s.prototype.diff_cleanupMerge=function(et){et.push(new s.Diff(rt,""));for(var ot=0,at=0,nt=0,it="",j="",_;ot1?(at!==0&&nt!==0&&(_=this.diff_commonPrefix(j,it),_!==0&&(ot-at-nt>0&&et[ot-at-nt-1][0]==rt?et[ot-at-nt-1][1]+=j.substring(0,_):(et.splice(0,0,new s.Diff(rt,j.substring(0,_))),ot++),j=j.substring(_),it=it.substring(_)),_=this.diff_commonSuffix(j,it),_!==0&&(et[ot][1]=j.substring(j.length-_)+et[ot][1],j=j.substring(0,j.length-_),it=it.substring(0,it.length-_))),ot-=at+nt,et.splice(ot,at+nt),it.length&&(et.splice(ot,0,new s.Diff(o,it)),ot++),j.length&&(et.splice(ot,0,new s.Diff(a,j)),ot++),ot++):ot!==0&&et[ot-1][0]==rt?(et[ot-1][1]+=et[ot][1],et.splice(ot,1)):ot++,nt=0,at=0,it="",j="";break}et[et.length-1][1]===""&&et.pop();var $=!1;for(ot=1;otot));_++)it=at,j=nt;return et.length!=_&&et[_][0]===o?j:j+(ot-it)},s.prototype.diff_prettyHtml=function(et){for(var ot=[],at=/&/g,nt=//g,j=/\n/g,_=0;_");switch($){case a:ot[_]=''+st+"";break;case o:ot[_]=''+st+"";break;case rt:ot[_]=""+st+"";break}}return ot.join("")},s.prototype.diff_text1=function(et){for(var ot=[],at=0;atthis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var nt=this.match_alphabet_(ot),it=this;function j(yt,_t){var Ct=yt/ot.length,Et=Math.abs(at-_t);return it.Match_Distance?Ct+Et/it.Match_Distance:Et?1:Ct}var _=this.Match_Threshold,$=et.indexOf(ot,at);$!=-1&&(_=Math.min(j(0,$),_),$=et.lastIndexOf(ot,at+ot.length),$!=-1&&(_=Math.min(j(0,$),_)));var tt=1<=pt;dt--){var St=nt[et.charAt(dt-1)];if(ut===0?gt[dt]=(gt[dt+1]<<1|1)&St:gt[dt]=(gt[dt+1]<<1|1)&St|((ht[dt+1]|ht[dt])<<1|1)|ht[dt+1],gt[dt]&tt){var xt=j(ut,dt-1);if(xt<=_)if(_=xt,$=dt-1,$>at)pt=Math.max(1,2*at-$);else break}}if(j(ut+1,at)>_)break;ht=gt}return $},s.prototype.match_alphabet_=function(et){for(var ot={},at=0;at"u")nt=et,it=this.diff_main(nt,ot,!0),it.length>2&&(this.diff_cleanupSemantic(it),this.diff_cleanupEfficiency(it));else if(et&&typeof et=="object"&&typeof ot>"u"&&typeof at>"u")it=et,nt=this.diff_text1(it);else if(typeof et=="string"&&ot&&typeof ot=="object"&&typeof at>"u")nt=et,it=ot;else if(typeof et=="string"&&typeof ot=="string"&&at&&typeof at=="object")nt=et,it=at;else throw new Error("Unknown call format to patch_make.");if(it.length===0)return[];for(var j=[],_=new s.patch_obj,$=0,tt=0,st=0,lt=nt,ct=nt,ht=0;ht=2*this.Patch_Margin&&$&&(this.patch_addContext_(_,lt),j.push(_),_=new s.patch_obj,$=0,lt=ct,tt=st);break}ut!==a&&(tt+=pt.length),ut!==o&&(st+=pt.length)}return $&&(this.patch_addContext_(_,lt),j.push(_)),j},s.prototype.patch_deepCopy=function(et){for(var ot=[],at=0;atthis.Match_MaxBits?(tt=this.match_main(ot,$.substring(0,this.Match_MaxBits),_),tt!=-1&&(st=this.match_main(ot,$.substring($.length-this.Match_MaxBits),_+$.length-this.Match_MaxBits),(st==-1||tt>=st)&&(tt=-1))):tt=this.match_main(ot,$,_),tt==-1)it[j]=!1,nt-=et[j].length2-et[j].length1;else{it[j]=!0,nt=tt-_;var lt;if(st==-1?lt=ot.substring(tt,tt+$.length):lt=ot.substring(tt,st+this.Match_MaxBits),$==lt)ot=ot.substring(0,tt)+this.diff_text2(et[j].diffs)+ot.substring(tt+$.length);else{var ct=this.diff_main($,lt,!1);if($.length>this.Match_MaxBits&&this.diff_levenshtein(ct)/$.length>this.Patch_DeleteThreshold)it[j]=!1;else{this.diff_cleanupSemanticLossless(ct);for(var ht=0,ut,pt=0;ptj[0][1].length){var _=ot-j[0][1].length;j[0][1]=at.substring(j[0][1].length)+j[0][1],it.start1-=_,it.start2-=_,it.length1+=_,it.length2+=_}if(it=et[et.length-1],j=it.diffs,j.length==0||j[j.length-1][0]!=rt)j.push(new s.Diff(rt,at)),it.length1+=ot,it.length2+=ot;else if(ot>j[j.length-1][1].length){var _=ot-j[j.length-1][1].length;j[j.length-1][1]+=at.substring(0,_),it.length1+=_,it.length2+=_}return at},s.prototype.patch_splitMax=function(et){for(var ot=this.Match_MaxBits,at=0;at2*ot?($.length1+=lt.length,it+=lt.length,tt=!1,$.diffs.push(new s.Diff(st,lt)),nt.diffs.shift()):(lt=lt.substring(0,ot-$.length1-this.Patch_Margin),$.length1+=lt.length,it+=lt.length,st===rt?($.length2+=lt.length,j+=lt.length):tt=!1,$.diffs.push(new s.Diff(st,lt)),lt==nt.diffs[0][1]?nt.diffs.shift():nt.diffs[0][1]=nt.diffs[0][1].substring(lt.length))}_=this.diff_text2($.diffs),_=_.substring(_.length-this.Patch_Margin);var ct=this.diff_text1(nt.diffs).substring(0,this.Patch_Margin);ct!==""&&($.length1+=ct.length,$.length2+=ct.length,$.diffs.length!==0&&$.diffs[$.diffs.length-1][0]===rt?$.diffs[$.diffs.length-1][1]+=ct:$.diffs.push(new s.Diff(rt,ct))),tt||et.splice(++at,0,$)}}},s.prototype.patch_toText=function(et){for(var ot=[],at=0;at-1}function oo(ir,Nt){var nr=this.__data__,cr=Xt(nr,ir);return cr<0?(++this.size,nr.push([ir,Nt])):nr[cr][1]=Nt,this}Zn.prototype.clear=ho,Zn.prototype.delete=so,Zn.prototype.get=fo,Zn.prototype.has=po,Zn.prototype.set=oo;function fs(ir){var Nt=-1,nr=ir==null?0:ir.length;for(this.clear();++Ntvn))return!1;var un=Wr.get(ir);if(un&&Wr.get(Nt))return un==Nt;var Ln=-1,Vn=!0,Un=nr&tt?new gn:void 0;for(Wr.set(ir,Nt),Wr.set(Nt,ir);++Ln-1&&ir%1==0&&ir-1&&ir%1==0&&ir<=ot}function Ts(ir){var Nt=typeof ir;return ir!=null&&(Nt=="object"||Nt=="function")}function Cs(ir){return ir!=null&&typeof ir=="object"}var Ls=xr?on(xr):zn;function yo(ir){return Fr(ir)?Vt(ir):_i(ir)}function kn(){return[]}function Tn(){return!1}i.exports=ln})(lodash_isequal,lodash_isequal.exports);var lodash_isequalExports=lodash_isequal.exports,editorOptions$1={};Object.defineProperty(editorOptions$1,"__esModule",{value:!0});editorOptions$1.getAceInstance=editorOptions$1.debounce=editorOptions$1.editorEvents=editorOptions$1.editorOptions=void 0;var editorOptions=["minLines","maxLines","readOnly","highlightActiveLine","tabSize","enableBasicAutocompletion","enableLiveAutocompletion","enableSnippets"];editorOptions$1.editorOptions=editorOptions;var editorEvents=["onChange","onFocus","onInput","onBlur","onCopy","onPaste","onSelectionChange","onCursorChange","onScroll","handleOptions","updateRef"];editorOptions$1.editorEvents=editorEvents;var getAceInstance=function(){var i;return typeof window>"u"?(commonjsGlobal.window={},i=aceExports,delete commonjsGlobal.window):window.ace?(i=window.ace,i.acequire=window.ace.require||window.ace.acequire):i=aceExports,i};editorOptions$1.getAceInstance=getAceInstance;var debounce=function(i,s){var o=null;return function(){var a=this,rt=arguments;clearTimeout(o),o=setTimeout(function(){i.apply(a,rt)},s)}};editorOptions$1.debounce=debounce;var __extends$2=commonjsGlobal&&commonjsGlobal.__extends||function(){var i=function(s,o){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,rt){a.__proto__=rt}||function(a,rt){for(var tt in rt)Object.prototype.hasOwnProperty.call(rt,tt)&&(a[tt]=rt[tt])},i(s,o)};return function(s,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");i(s,o);function a(){this.constructor=s}s.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}}(),__assign$1=commonjsGlobal&&commonjsGlobal.__assign||function(){return __assign$1=Object.assign||function(i){for(var s,o=1,a=arguments.length;o0&&this.handleMarkers(St);var Ct=this.editor.$options;editorOptions_1$1.editorOptions.forEach(function(Et){Ct.hasOwnProperty(Et)?o.editor.setOption(Et,o.props[Et]):o.props[Et]&&console.warn("ReactAce: editor option ".concat(Et," 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(gt)&>.forEach(function(Et){typeof Et.exec=="string"?o.editor.commands.bindKey(Et.bindKey,Et.exec):o.editor.commands.addCommand(Et)}),pt&&this.editor.setKeyboardHandler("ace/keyboard/"+pt),rt&&(this.refEditor.className+=" "+rt),mt&&mt(this.editor),this.editor.resize(),nt&&this.editor.focus()},s.prototype.componentDidUpdate=function(o){for(var a=o,rt=this.props,tt=0;tt 0!";if(_!=this.$splits){if(_>this.$splits){for(;this.$splits_;)$=this.$editors[this.$splits-1],this.$container.removeChild($.container),this.$splits--;this.resize()}},this.getSplits=function(){return this.$splits},this.getEditor=function(_){return this.$editors[_]},this.getCurrentEditor=function(){return this.$cEditor},this.focus=function(){this.$cEditor.focus()},this.blur=function(){this.$cEditor.blur()},this.setTheme=function(_){this.$editors.forEach(function($){$.setTheme(_)})},this.setKeyboardHandler=function(_){this.$editors.forEach(function($){$.setKeyboardHandler(_)})},this.forEach=function(_,$){this.$editors.forEach(_,$)},this.$fontSize="",this.setFontSize=function(_){this.$fontSize=_,this.forEach(function($){$.setFontSize(_)})},this.$cloneSession=function(_){var $=new it(_.getDocument(),_.getMode()),et=_.getUndoManager();return $.setUndoManager(et),$.setTabSize(_.getTabSize()),$.setUseSoftTabs(_.getUseSoftTabs()),$.setOverwrite(_.getOverwrite()),$.setBreakpoints(_.getBreakpoints()),$.setUseWrapMode(_.getUseWrapMode()),$.setUseWorker(_.getUseWorker()),$.setWrapLimitRange(_.$wrapLimitRange.min,_.$wrapLimitRange.max),$.$foldData=_.$cloneFoldData(),$},this.setSession=function(_,$){var et;$==null?et=this.$cEditor:et=this.$editors[$];var st=this.$editors.some(function(lt){return lt.session===_});return st&&(_=this.$cloneSession(_)),et.setSession(_),_},this.getOrientation=function(){return this.$orientation},this.setOrientation=function(_){this.$orientation!=_&&(this.$orientation=_,this.resize())},this.resize=function(){var _=this.$container.clientWidth,$=this.$container.clientHeight,et;if(this.$orientation==this.BESIDE)for(var st=_/this.$splits,lt=0;lt-1}function listCacheSet(i,s){var o=this.__data__,a=assocIndexOf(o,i);return a<0?o.push([i,s]):o[a][1]=s,this}ListCache.prototype.clear=listCacheClear;ListCache.prototype.delete=listCacheDelete;ListCache.prototype.get=listCacheGet;ListCache.prototype.has=listCacheHas;ListCache.prototype.set=listCacheSet;function MapCache(i){var s=-1,o=i?i.length:0;for(this.clear();++s0&&o.handleMarkers(Mt,Et);for(var Tt=0;Tt"u"&&(this.Diff_Timeout<=0?nt=Number.MAX_VALUE:nt=new Date().getTime()+this.Diff_Timeout*1e3);var it=nt;if(tt==null||ot==null)throw new Error("Null input. (diff_main)");if(tt==ot)return tt?[new s.Diff(rt,tt)]:[];typeof at>"u"&&(at=!0);var j=at,_=this.diff_commonPrefix(tt,ot),$=tt.substring(0,_);tt=tt.substring(_),ot=ot.substring(_),_=this.diff_commonSuffix(tt,ot);var et=tt.substring(tt.length-_);tt=tt.substring(0,tt.length-_),ot=ot.substring(0,ot.length-_);var st=this.diff_compute_(tt,ot,j,it);return $&&st.unshift(new s.Diff(rt,$)),et&&st.push(new s.Diff(rt,et)),this.diff_cleanupMerge(st),st},s.prototype.diff_compute_=function(tt,ot,at,nt){var it;if(!tt)return[new s.Diff(a,ot)];if(!ot)return[new s.Diff(o,tt)];var j=tt.length>ot.length?tt:ot,_=tt.length>ot.length?ot:tt,$=j.indexOf(_);if($!=-1)return it=[new s.Diff(a,j.substring(0,$)),new s.Diff(rt,_),new s.Diff(a,j.substring($+_.length))],tt.length>ot.length&&(it[0][0]=it[2][0]=o),it;if(_.length==1)return[new s.Diff(o,tt),new s.Diff(a,ot)];var et=this.diff_halfMatch_(tt,ot);if(et){var st=et[0],lt=et[1],ct=et[2],ht=et[3],ut=et[4],pt=this.diff_main(st,ct,at,nt),mt=this.diff_main(lt,ht,at,nt);return pt.concat([new s.Diff(rt,ut)],mt)}return at&&tt.length>100&&ot.length>100?this.diff_lineMode_(tt,ot,nt):this.diff_bisect_(tt,ot,nt)},s.prototype.diff_lineMode_=function(tt,ot,at){var nt=this.diff_linesToChars_(tt,ot);tt=nt.chars1,ot=nt.chars2;var it=nt.lineArray,j=this.diff_main(tt,ot,!1,at);this.diff_charsToLines_(j,it),this.diff_cleanupSemantic(j),j.push(new s.Diff(rt,""));for(var _=0,$=0,et=0,st="",lt="";_=1&&et>=1){j.splice(_-$-et,$+et),_=_-$-et;for(var ct=this.diff_main(st,lt,!1,at),ht=ct.length-1;ht>=0;ht--)j.splice(_,0,ct[ht]);_=_+ct.length}et=0,$=0,st="",lt="";break}_++}return j.pop(),j},s.prototype.diff_bisect_=function(tt,ot,at){for(var nt=tt.length,it=ot.length,j=Math.ceil((nt+it)/2),_=j,$=2*j,et=new Array($),st=new Array($),lt=0;lt<$;lt++)et[lt]=-1,st[lt]=-1;et[_+1]=0,st[_+1]=0;for(var ct=nt-it,ht=ct%2!=0,ut=0,pt=0,mt=0,gt=0,dt=0;dtat);dt++){for(var St=-dt+ut;St<=dt-pt;St+=2){var xt=_+St,yt;St==-dt||St!=dt&&et[xt-1]nt)pt+=2;else if(_t>it)ut+=2;else if(ht){var Ct=_+ct-St;if(Ct>=0&&Ct<$&&st[Ct]!=-1){var Et=nt-st[Ct];if(yt>=Et)return this.diff_bisectSplit_(tt,ot,yt,_t,at)}}}for(var kt=-dt+mt;kt<=dt-gt;kt+=2){var Ct=_+kt,Et;kt==-dt||kt!=dt&&st[Ct-1]nt)gt+=2;else if(Tt>it)mt+=2;else if(!ht){var xt=_+ct-kt;if(xt>=0&&xt<$&&et[xt]!=-1){var yt=et[xt],_t=_+yt-xt;if(Et=nt-Et,yt>=Et)return this.diff_bisectSplit_(tt,ot,yt,_t,at)}}}}return[new s.Diff(o,tt),new s.Diff(a,ot)]},s.prototype.diff_bisectSplit_=function(tt,ot,at,nt,it){var j=tt.substring(0,at),_=ot.substring(0,nt),$=tt.substring(at),et=ot.substring(nt),st=this.diff_main(j,_,!1,it),lt=this.diff_main($,et,!1,it);return st.concat(lt)},s.prototype.diff_linesToChars_=function(tt,ot){var at=[],nt={};at[0]="";function it(et){for(var st="",lt=0,ct=-1,ht=at.length;ctnt?tt=tt.substring(at-nt):atot.length?tt:ot,nt=tt.length>ot.length?ot:tt;if(at.length<4||nt.length*2=pt.length?[yt,_t,Ct,Et,xt]:null}var _=j(at,nt,Math.ceil(at.length/4)),$=j(at,nt,Math.ceil(at.length/2)),et;if(!_&&!$)return null;$?_?et=_[4].length>$[4].length?_:$:et=$:et=_;var st,lt,ct,ht;tt.length>ot.length?(st=et[0],lt=et[1],ct=et[2],ht=et[3]):(ct=et[0],ht=et[1],st=et[2],lt=et[3]);var ut=et[4];return[st,lt,ct,ht,ut]},s.prototype.diff_cleanupSemantic=function(tt){for(var ot=!1,at=[],nt=0,it=null,j=0,_=0,$=0,et=0,st=0;j0?at[nt-1]:-1,_=0,$=0,et=0,st=0,it=null,ot=!0)),j++;for(ot&&this.diff_cleanupMerge(tt),this.diff_cleanupSemanticLossless(tt),j=1;j=ut?(ht>=lt.length/2||ht>=ct.length/2)&&(tt.splice(j,0,new s.Diff(rt,ct.substring(0,ht))),tt[j-1][1]=lt.substring(0,lt.length-ht),tt[j+1][1]=ct.substring(ht),j++):(ut>=lt.length/2||ut>=ct.length/2)&&(tt.splice(j,0,new s.Diff(rt,lt.substring(0,ut))),tt[j-1][0]=a,tt[j-1][1]=ct.substring(0,ct.length-ut),tt[j+1][0]=o,tt[j+1][1]=lt.substring(ut),j++),j++}j++}},s.prototype.diff_cleanupSemanticLossless=function(tt){function ot(ut,pt){if(!ut||!pt)return 6;var mt=ut.charAt(ut.length-1),gt=pt.charAt(0),dt=mt.match(s.nonAlphaNumericRegex_),St=gt.match(s.nonAlphaNumericRegex_),xt=dt&&mt.match(s.whitespaceRegex_),yt=St&>.match(s.whitespaceRegex_),_t=xt&&mt.match(s.linebreakRegex_),Ct=yt&>.match(s.linebreakRegex_),Et=_t&&ut.match(s.blanklineEndRegex_),kt=Ct&&pt.match(s.blanklineStartRegex_);return Et||kt?5:_t||Ct?4:dt&&!xt&&yt?3:xt||yt?2:dt||St?1:0}for(var at=1;at=ct&&(ct=ht,et=nt,st=it,lt=j)}tt[at-1][1]!=et&&(et?tt[at-1][1]=et:(tt.splice(at-1,1),at--),tt[at][1]=st,lt?tt[at+1][1]=lt:(tt.splice(at+1,1),at--))}at++}},s.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,s.whitespaceRegex_=/\s/,s.linebreakRegex_=/[\r\n]/,s.blanklineEndRegex_=/\n\r?\n$/,s.blanklineStartRegex_=/^\r?\n\r?\n/,s.prototype.diff_cleanupEfficiency=function(tt){for(var ot=!1,at=[],nt=0,it=null,j=0,_=!1,$=!1,et=!1,st=!1;j0?at[nt-1]:-1,et=st=!1),ot=!0)),j++;ot&&this.diff_cleanupMerge(tt)},s.prototype.diff_cleanupMerge=function(tt){tt.push(new s.Diff(rt,""));for(var ot=0,at=0,nt=0,it="",j="",_;ot1?(at!==0&&nt!==0&&(_=this.diff_commonPrefix(j,it),_!==0&&(ot-at-nt>0&&tt[ot-at-nt-1][0]==rt?tt[ot-at-nt-1][1]+=j.substring(0,_):(tt.splice(0,0,new s.Diff(rt,j.substring(0,_))),ot++),j=j.substring(_),it=it.substring(_)),_=this.diff_commonSuffix(j,it),_!==0&&(tt[ot][1]=j.substring(j.length-_)+tt[ot][1],j=j.substring(0,j.length-_),it=it.substring(0,it.length-_))),ot-=at+nt,tt.splice(ot,at+nt),it.length&&(tt.splice(ot,0,new s.Diff(o,it)),ot++),j.length&&(tt.splice(ot,0,new s.Diff(a,j)),ot++),ot++):ot!==0&&tt[ot-1][0]==rt?(tt[ot-1][1]+=tt[ot][1],tt.splice(ot,1)):ot++,nt=0,at=0,it="",j="";break}tt[tt.length-1][1]===""&&tt.pop();var $=!1;for(ot=1;otot));_++)it=at,j=nt;return tt.length!=_&&tt[_][0]===o?j:j+(ot-it)},s.prototype.diff_prettyHtml=function(tt){for(var ot=[],at=/&/g,nt=//g,j=/\n/g,_=0;_");switch($){case a:ot[_]=''+st+"";break;case o:ot[_]=''+st+"";break;case rt:ot[_]=""+st+"";break}}return ot.join("")},s.prototype.diff_text1=function(tt){for(var ot=[],at=0;atthis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var nt=this.match_alphabet_(ot),it=this;function j(yt,_t){var Ct=yt/ot.length,Et=Math.abs(at-_t);return it.Match_Distance?Ct+Et/it.Match_Distance:Et?1:Ct}var _=this.Match_Threshold,$=tt.indexOf(ot,at);$!=-1&&(_=Math.min(j(0,$),_),$=tt.lastIndexOf(ot,at+ot.length),$!=-1&&(_=Math.min(j(0,$),_)));var et=1<=pt;dt--){var St=nt[tt.charAt(dt-1)];if(ut===0?gt[dt]=(gt[dt+1]<<1|1)&St:gt[dt]=(gt[dt+1]<<1|1)&St|((ht[dt+1]|ht[dt])<<1|1)|ht[dt+1],gt[dt]&et){var xt=j(ut,dt-1);if(xt<=_)if(_=xt,$=dt-1,$>at)pt=Math.max(1,2*at-$);else break}}if(j(ut+1,at)>_)break;ht=gt}return $},s.prototype.match_alphabet_=function(tt){for(var ot={},at=0;at"u")nt=tt,it=this.diff_main(nt,ot,!0),it.length>2&&(this.diff_cleanupSemantic(it),this.diff_cleanupEfficiency(it));else if(tt&&typeof tt=="object"&&typeof ot>"u"&&typeof at>"u")it=tt,nt=this.diff_text1(it);else if(typeof tt=="string"&&ot&&typeof ot=="object"&&typeof at>"u")nt=tt,it=ot;else if(typeof tt=="string"&&typeof ot=="string"&&at&&typeof at=="object")nt=tt,it=at;else throw new Error("Unknown call format to patch_make.");if(it.length===0)return[];for(var j=[],_=new s.patch_obj,$=0,et=0,st=0,lt=nt,ct=nt,ht=0;ht=2*this.Patch_Margin&&$&&(this.patch_addContext_(_,lt),j.push(_),_=new s.patch_obj,$=0,lt=ct,et=st);break}ut!==a&&(et+=pt.length),ut!==o&&(st+=pt.length)}return $&&(this.patch_addContext_(_,lt),j.push(_)),j},s.prototype.patch_deepCopy=function(tt){for(var ot=[],at=0;atthis.Match_MaxBits?(et=this.match_main(ot,$.substring(0,this.Match_MaxBits),_),et!=-1&&(st=this.match_main(ot,$.substring($.length-this.Match_MaxBits),_+$.length-this.Match_MaxBits),(st==-1||et>=st)&&(et=-1))):et=this.match_main(ot,$,_),et==-1)it[j]=!1,nt-=tt[j].length2-tt[j].length1;else{it[j]=!0,nt=et-_;var lt;if(st==-1?lt=ot.substring(et,et+$.length):lt=ot.substring(et,st+this.Match_MaxBits),$==lt)ot=ot.substring(0,et)+this.diff_text2(tt[j].diffs)+ot.substring(et+$.length);else{var ct=this.diff_main($,lt,!1);if($.length>this.Match_MaxBits&&this.diff_levenshtein(ct)/$.length>this.Patch_DeleteThreshold)it[j]=!1;else{this.diff_cleanupSemanticLossless(ct);for(var ht=0,ut,pt=0;ptj[0][1].length){var _=ot-j[0][1].length;j[0][1]=at.substring(j[0][1].length)+j[0][1],it.start1-=_,it.start2-=_,it.length1+=_,it.length2+=_}if(it=tt[tt.length-1],j=it.diffs,j.length==0||j[j.length-1][0]!=rt)j.push(new s.Diff(rt,at)),it.length1+=ot,it.length2+=ot;else if(ot>j[j.length-1][1].length){var _=ot-j[j.length-1][1].length;j[j.length-1][1]+=at.substring(0,_),it.length1+=_,it.length2+=_}return at},s.prototype.patch_splitMax=function(tt){for(var ot=this.Match_MaxBits,at=0;at2*ot?($.length1+=lt.length,it+=lt.length,et=!1,$.diffs.push(new s.Diff(st,lt)),nt.diffs.shift()):(lt=lt.substring(0,ot-$.length1-this.Patch_Margin),$.length1+=lt.length,it+=lt.length,st===rt?($.length2+=lt.length,j+=lt.length):et=!1,$.diffs.push(new s.Diff(st,lt)),lt==nt.diffs[0][1]?nt.diffs.shift():nt.diffs[0][1]=nt.diffs[0][1].substring(lt.length))}_=this.diff_text2($.diffs),_=_.substring(_.length-this.Patch_Margin);var ct=this.diff_text1(nt.diffs).substring(0,this.Patch_Margin);ct!==""&&($.length1+=ct.length,$.length2+=ct.length,$.diffs.length!==0&&$.diffs[$.diffs.length-1][0]===rt?$.diffs[$.diffs.length-1][1]+=ct:$.diffs.push(new s.Diff(rt,ct))),et||tt.splice(++at,0,$)}}},s.prototype.patch_toText=function(tt){for(var ot=[],at=0;at(i.SOURCE_THREE_INTERPRETER="Source §3 (Legacy)",i.PYTHON="Python",i))(Languages||{});const supportedLanguages=["Python","Source §3 (Legacy)"],languageToModeMap=Object.freeze({Python:"python","Source §3 (Legacy)":"javascript"});var extLanguage_tools={exports:{}};(function(i,s){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(o,a,rt){var et=o("./lib/dom"),ot=o("./lib/oop"),at=o("./lib/event_emitter").EventEmitter,nt=o("./lib/lang"),it=o("./range").Range,j=o("./range_list").RangeList,_=o("./keyboard/hash_handler").HashHandler,$=o("./tokenizer").Tokenizer,tt=o("./clipboard"),st={CURRENT_WORD:function(dt){return dt.session.getTextRange(dt.session.getWordRange())},SELECTION:function(dt,St,xt){var yt=dt.session.getTextRange();return xt?yt.replace(/\n\r?([ \t]*\S)/g,` -`+xt+"$1"):yt},CURRENT_LINE:function(dt){return dt.session.getLine(dt.getCursorPosition().row)},PREV_LINE:function(dt){return dt.session.getLine(dt.getCursorPosition().row-1)},LINE_INDEX:function(dt){return dt.getCursorPosition().row},LINE_NUMBER:function(dt){return dt.getCursorPosition().row+1},SOFT_TABS:function(dt){return dt.session.getUseSoftTabs()?"YES":"NO"},TAB_SIZE:function(dt){return dt.session.getTabSize()},CLIPBOARD:function(dt){return tt.getText&&tt.getText()},FILENAME:function(dt){return/[^/\\]*$/.exec(this.FILEPATH(dt))[0]},FILENAME_BASE:function(dt){return/[^/\\]*$/.exec(this.FILEPATH(dt))[0].replace(/\.[^.]*$/,"")},DIRECTORY:function(dt){return this.FILEPATH(dt).replace(/[^/\\]*$/,"")},FILEPATH:function(dt){return"/not implemented.txt"},WORKSPACE_NAME:function(){return"Unknown"},FULLNAME:function(){return"Unknown"},BLOCK_COMMENT_START:function(dt){var St=dt.session.$mode||{};return St.blockComment&&St.blockComment.start||""},BLOCK_COMMENT_END:function(dt){var St=dt.session.$mode||{};return St.blockComment&&St.blockComment.end||""},LINE_COMMENT:function(dt){var St=dt.session.$mode||{};return St.lineCommentStart||""},CURRENT_YEAR:lt.bind(null,{year:"numeric"}),CURRENT_YEAR_SHORT:lt.bind(null,{year:"2-digit"}),CURRENT_MONTH:lt.bind(null,{month:"numeric"}),CURRENT_MONTH_NAME:lt.bind(null,{month:"long"}),CURRENT_MONTH_NAME_SHORT:lt.bind(null,{month:"short"}),CURRENT_DATE:lt.bind(null,{day:"2-digit"}),CURRENT_DAY_NAME:lt.bind(null,{weekday:"long"}),CURRENT_DAY_NAME_SHORT:lt.bind(null,{weekday:"short"}),CURRENT_HOUR:lt.bind(null,{hour:"2-digit",hour12:!1}),CURRENT_MINUTE:lt.bind(null,{minute:"2-digit"}),CURRENT_SECOND:lt.bind(null,{second:"2-digit"})};st.SELECTED_TEXT=st.SELECTION;function lt(dt){var St=new Date().toLocaleString("en-us",dt);return St.length==1?"0"+St:St}var ct=function(){function dt(){this.snippetMap={},this.snippetNameMap={},this.variables=st}return dt.prototype.getTokenizer=function(){return dt.$tokenizer||this.createTokenizer()},dt.prototype.createTokenizer=function(){function St(_t){return _t=_t.substr(1),/^\d+$/.test(_t)?[{tabstopId:parseInt(_t,10)}]:[{text:_t}]}function xt(_t){return"(?:[^\\\\"+_t+"]|\\\\.)"}var yt={regex:"/("+xt("/")+"+)/",onMatch:function(_t,Ct,Et){var kt=Et[0];return kt.fmtString=!0,kt.guard=_t.slice(1,-1),kt.flag="",""},next:"formatString"};return dt.$tokenizer=new $({start:[{regex:/\\./,onMatch:function(_t,Ct,Et){var kt=_t[1];return(kt=="}"&&Et.length||"`$\\".indexOf(kt)!=-1)&&(_t=kt),[_t]}},{regex:/}/,onMatch:function(_t,Ct,Et){return[Et.length?Et.shift():_t]}},{regex:/\$(?:\d+|\w+)/,onMatch:St},{regex:/\$\{[\dA-Z_a-z]+/,onMatch:function(_t,Ct,Et){var kt=St(_t.substr(1));return Et.unshift(kt[0]),kt},next:"snippetVar"},{regex:/\n/,token:"newline",merge:!1}],snippetVar:[{regex:"\\|"+xt("\\|")+"*\\|",onMatch:function(_t,Ct,Et){var kt=_t.slice(1,-1).replace(/\\[,|\\]|,/g,function(Tt){return Tt.length==2?Tt[1]:"\0"}).split("\0").map(function(Tt){return{value:Tt}});return Et[0].choices=kt,[kt[0]]},next:"start"},yt,{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"start"}],formatString:[{regex:/:/,onMatch:function(_t,Ct,Et){return Et.length&&Et[0].expectElse?(Et[0].expectElse=!1,Et[0].ifEnd={elseEnd:Et[0]},[Et[0].ifEnd]):":"}},{regex:/\\./,onMatch:function(_t,Ct,Et){var kt=_t[1];return kt=="}"&&Et.length||"`$\\".indexOf(kt)!=-1?_t=kt:kt=="n"?_t=` +`}return at.join("").replace(/%20/g," ")},i.exports=s,i.exports.diff_match_patch=s,i.exports.DIFF_DELETE=o,i.exports.DIFF_INSERT=a,i.exports.DIFF_EQUAL=rt})(diffMatchPatch);var diffMatchPatchExports=diffMatchPatch.exports,__extends=commonjsGlobal&&commonjsGlobal.__extends||function(){var i=function(s,o){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,rt){a.__proto__=rt}||function(a,rt){for(var tt in rt)Object.prototype.hasOwnProperty.call(rt,tt)&&(a[tt]=rt[tt])},i(s,o)};return function(s,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");i(s,o);function a(){this.constructor=s}s.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}}();Object.defineProperty(diff,"__esModule",{value:!0});var PropTypes=propTypesExports,React=reactExports,split_1$1=split,DiffMatchPatch=diffMatchPatchExports,DiffComponent=function(i){__extends(s,i);function s(o){var a=i.call(this,o)||this;return a.state={value:a.props.value},a.onChange=a.onChange.bind(a),a.diff=a.diff.bind(a),a}return s.prototype.componentDidUpdate=function(){var o=this.props.value;o!==this.state.value&&this.setState({value:o})},s.prototype.onChange=function(o){this.setState({value:o}),this.props.onChange&&this.props.onChange(o)},s.prototype.diff=function(){var o=new DiffMatchPatch,a=this.state.value[0],rt=this.state.value[1];if(a.length===0&&rt.length===0)return[];var tt=o.diff_main(a,rt);o.diff_cleanupSemantic(tt);var ot=this.generateDiffedLines(tt),at=this.setCodeMarkers(ot);return at},s.prototype.generateDiffedLines=function(o){var a={DIFF_EQUAL:0,DIFF_DELETE:-1,DIFF_INSERT:1},rt={left:[],right:[]},tt={left:1,right:1};return o.forEach(function(ot){var at=ot[0],nt=ot[1],it=nt.split(` +`).length-1;if(nt.length!==0){var j=nt[0],_=nt[nt.length-1],$=0;switch(at){case a.DIFF_EQUAL:tt.left+=it,tt.right+=it;break;case a.DIFF_DELETE:j===` +`&&(tt.left++,it--),$=it,$===0&&rt.right.push({startLine:tt.right,endLine:tt.right}),_===` +`&&($-=1),rt.left.push({startLine:tt.left,endLine:tt.left+$}),tt.left+=it;break;case a.DIFF_INSERT:j===` +`&&(tt.right++,it--),$=it,$===0&&rt.left.push({startLine:tt.left,endLine:tt.left}),_===` +`&&($-=1),rt.right.push({startLine:tt.right,endLine:tt.right+$}),tt.right+=it;break;default:throw new Error("Diff type was not defined.")}}}),rt},s.prototype.setCodeMarkers=function(o){o===void 0&&(o={left:[],right:[]});for(var a=[],rt={left:[],right:[]},tt=0;tt(i.SOURCE_THREE_INTERPRETER="Source §3 (Legacy)",i.PYTHON="Python",i))(Languages||{});const supportedLanguages=["Python","Source §3 (Legacy)"],languageToModeMap=Object.freeze({Python:"python","Source §3 (Legacy)":"javascript"});var extLanguage_tools={exports:{}};(function(i,s){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(o,a,rt){var tt=o("./lib/dom"),ot=o("./lib/oop"),at=o("./lib/event_emitter").EventEmitter,nt=o("./lib/lang"),it=o("./range").Range,j=o("./range_list").RangeList,_=o("./keyboard/hash_handler").HashHandler,$=o("./tokenizer").Tokenizer,et=o("./clipboard"),st={CURRENT_WORD:function(dt){return dt.session.getTextRange(dt.session.getWordRange())},SELECTION:function(dt,St,xt){var yt=dt.session.getTextRange();return xt?yt.replace(/\n\r?([ \t]*\S)/g,` +`+xt+"$1"):yt},CURRENT_LINE:function(dt){return dt.session.getLine(dt.getCursorPosition().row)},PREV_LINE:function(dt){return dt.session.getLine(dt.getCursorPosition().row-1)},LINE_INDEX:function(dt){return dt.getCursorPosition().row},LINE_NUMBER:function(dt){return dt.getCursorPosition().row+1},SOFT_TABS:function(dt){return dt.session.getUseSoftTabs()?"YES":"NO"},TAB_SIZE:function(dt){return dt.session.getTabSize()},CLIPBOARD:function(dt){return et.getText&&et.getText()},FILENAME:function(dt){return/[^/\\]*$/.exec(this.FILEPATH(dt))[0]},FILENAME_BASE:function(dt){return/[^/\\]*$/.exec(this.FILEPATH(dt))[0].replace(/\.[^.]*$/,"")},DIRECTORY:function(dt){return this.FILEPATH(dt).replace(/[^/\\]*$/,"")},FILEPATH:function(dt){return"/not implemented.txt"},WORKSPACE_NAME:function(){return"Unknown"},FULLNAME:function(){return"Unknown"},BLOCK_COMMENT_START:function(dt){var St=dt.session.$mode||{};return St.blockComment&&St.blockComment.start||""},BLOCK_COMMENT_END:function(dt){var St=dt.session.$mode||{};return St.blockComment&&St.blockComment.end||""},LINE_COMMENT:function(dt){var St=dt.session.$mode||{};return St.lineCommentStart||""},CURRENT_YEAR:lt.bind(null,{year:"numeric"}),CURRENT_YEAR_SHORT:lt.bind(null,{year:"2-digit"}),CURRENT_MONTH:lt.bind(null,{month:"numeric"}),CURRENT_MONTH_NAME:lt.bind(null,{month:"long"}),CURRENT_MONTH_NAME_SHORT:lt.bind(null,{month:"short"}),CURRENT_DATE:lt.bind(null,{day:"2-digit"}),CURRENT_DAY_NAME:lt.bind(null,{weekday:"long"}),CURRENT_DAY_NAME_SHORT:lt.bind(null,{weekday:"short"}),CURRENT_HOUR:lt.bind(null,{hour:"2-digit",hour12:!1}),CURRENT_MINUTE:lt.bind(null,{minute:"2-digit"}),CURRENT_SECOND:lt.bind(null,{second:"2-digit"})};st.SELECTED_TEXT=st.SELECTION;function lt(dt){var St=new Date().toLocaleString("en-us",dt);return St.length==1?"0"+St:St}var ct=function(){function dt(){this.snippetMap={},this.snippetNameMap={},this.variables=st}return dt.prototype.getTokenizer=function(){return dt.$tokenizer||this.createTokenizer()},dt.prototype.createTokenizer=function(){function St(_t){return _t=_t.substr(1),/^\d+$/.test(_t)?[{tabstopId:parseInt(_t,10)}]:[{text:_t}]}function xt(_t){return"(?:[^\\\\"+_t+"]|\\\\.)"}var yt={regex:"/("+xt("/")+"+)/",onMatch:function(_t,Ct,Et){var kt=Et[0];return kt.fmtString=!0,kt.guard=_t.slice(1,-1),kt.flag="",""},next:"formatString"};return dt.$tokenizer=new $({start:[{regex:/\\./,onMatch:function(_t,Ct,Et){var kt=_t[1];return(kt=="}"&&Et.length||"`$\\".indexOf(kt)!=-1)&&(_t=kt),[_t]}},{regex:/}/,onMatch:function(_t,Ct,Et){return[Et.length?Et.shift():_t]}},{regex:/\$(?:\d+|\w+)/,onMatch:St},{regex:/\$\{[\dA-Z_a-z]+/,onMatch:function(_t,Ct,Et){var kt=St(_t.substr(1));return Et.unshift(kt[0]),kt},next:"snippetVar"},{regex:/\n/,token:"newline",merge:!1}],snippetVar:[{regex:"\\|"+xt("\\|")+"*\\|",onMatch:function(_t,Ct,Et){var kt=_t.slice(1,-1).replace(/\\[,|\\]|,/g,function(Tt){return Tt.length==2?Tt[1]:"\0"}).split("\0").map(function(Tt){return{value:Tt}});return Et[0].choices=kt,[kt[0]]},next:"start"},yt,{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"start"}],formatString:[{regex:/:/,onMatch:function(_t,Ct,Et){return Et.length&&Et[0].expectElse?(Et[0].expectElse=!1,Et[0].ifEnd={elseEnd:Et[0]},[Et[0].ifEnd]):":"}},{regex:/\\./,onMatch:function(_t,Ct,Et){var kt=_t[1];return kt=="}"&&Et.length||"`$\\".indexOf(kt)!=-1?_t=kt:kt=="n"?_t=` `:kt=="t"?_t=" ":"ulULE".indexOf(kt)!=-1&&(_t={changeCase:kt,local:kt>"a"}),[_t]}},{regex:"/\\w*}",onMatch:function(_t,Ct,Et){var kt=Et.shift();return kt&&(kt.flag=_t.slice(1,-1)),this.next=kt&&kt.tabstopId?"start":"",[kt||_t]},next:"start"},{regex:/\$(?:\d+|\w+)/,onMatch:function(_t,Ct,Et){return[{text:_t.slice(1)}]}},{regex:/\${\w+/,onMatch:function(_t,Ct,Et){var kt={text:_t.slice(2)};return Et.unshift(kt),[kt]},next:"formatStringVar"},{regex:/\n/,token:"newline",merge:!1},{regex:/}/,onMatch:function(_t,Ct,Et){var kt=Et.shift();return this.next=kt&&kt.tabstopId?"start":"",[kt||_t]},next:"start"}],formatStringVar:[{regex:/:\/\w+}/,onMatch:function(_t,Ct,Et){var kt=Et[0];return kt.formatFunction=_t.slice(2,-1),[Et.shift()]},next:"formatString"},yt,{regex:/:[\?\-+]?/,onMatch:function(_t,Ct,Et){_t[1]=="+"&&(Et[0].ifEnd=Et[0]),_t[1]=="?"&&(Et[0].expectElse=!0)},next:"formatString"},{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"formatString"}]}),dt.$tokenizer},dt.prototype.tokenizeTmSnippet=function(St,xt){return this.getTokenizer().getLineTokens(St,xt).tokens.map(function(yt){return yt.value||yt})},dt.prototype.getVariableValue=function(St,xt,yt){if(/^\d+$/.test(xt))return(this.variables.__||{})[xt]||"";if(/^[A-Z]\d+$/.test(xt))return(this.variables[xt[0]+"__"]||{})[xt.substr(1)]||"";if(xt=xt.replace(/^TM_/,""),!this.variables.hasOwnProperty(xt))return"";var _t=this.variables[xt];return typeof _t=="function"&&(_t=this.variables[xt](St,xt,yt)),_t??""},dt.prototype.tmStrFormat=function(St,xt,yt){if(!xt.fmt)return St;var _t=xt.flag||"",Ct=xt.guard;Ct=new RegExp(Ct,_t.replace(/[^gim]/g,""));var Et=typeof xt.fmt=="string"?this.tokenizeTmSnippet(xt.fmt,"formatString"):xt.fmt,kt=this,Tt=St.replace(Ct,function(){var $t=kt.variables.__;kt.variables.__=[].slice.call(arguments);for(var It=kt.resolveVariables(Et,yt),Ot="E",Mt=0;Mt=0&&Tt.splice($t,1)}}St.content?Ct(St):Array.isArray(St)&&St.forEach(Ct)},dt.prototype.parseSnippetFile=function(St){St=St.replace(/\r/g,"");for(var xt=[],yt={},_t=/^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm,Ct;Ct=_t.exec(St);){if(Ct[1])try{yt=JSON.parse(Ct[1]),xt.push(yt)}catch{}if(Ct[4])yt.content=Ct[4].replace(/^\t/gm,""),xt.push(yt),yt={};else{var Et=Ct[2],kt=Ct[3];if(Et=="regex"){var Tt=/\/((?:[^\/\\]|\\.)*)|$/g;yt.guard=Tt.exec(kt)[1],yt.trigger=Tt.exec(kt)[1],yt.endTrigger=Tt.exec(kt)[1],yt.endGuard=Tt.exec(kt)[1]}else Et=="snippet"?(yt.tabTrigger=kt.match(/^\S*/)[0],yt.name||(yt.name=kt)):Et&&(yt[Et]=kt)}}return xt},dt.prototype.getSnippetByName=function(St,xt){var yt=this.snippetNameMap,_t;return this.getActiveScopes(xt).some(function(Ct){var Et=yt[Ct];return Et&&(_t=Et[St]),!!_t},this),_t},dt}();ot.implement(ct.prototype,at);var ht=function(dt,St,xt){xt===void 0&&(xt={});var yt=dt.getCursorPosition(),_t=dt.session.getLine(yt.row),Ct=dt.session.getTabString(),Et=_t.match(/^\s*/)[0];yt.column1?(Ht=hr[hr.length-1].length,zt+=hr.length-1):Ht+=qt.length,Zt+=qt}else qt&&(qt.start?qt.end={row:zt,column:Ht}:qt.start={row:zt,column:Ht})}),{text:Zt,tabstops:Tt,tokens:kt}},ut=function(){function dt(St){if(this.index=0,this.ranges=[],this.tabstops=[],St.tabstopManager)return St.tabstopManager;St.tabstopManager=this,this.$onChange=this.onChange.bind(this),this.$onChangeSelection=nt.delayedCall(this.onChangeSelection.bind(this)).schedule,this.$onChangeSession=this.onChangeSession.bind(this),this.$onAfterExec=this.onAfterExec.bind(this),this.attach(St)}return dt.prototype.attach=function(St){this.$openTabstops=null,this.selectedTabstop=null,this.editor=St,this.session=St.session,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)},dt.prototype.detach=function(){this.tabstops.forEach(this.removeTabstopMarkers,this),this.ranges.length=0,this.tabstops.length=0,this.selectedTabstop=null,this.editor.off("change",this.$onChange),this.editor.off("changeSelection",this.$onChangeSelection),this.editor.off("changeSession",this.$onChangeSession),this.editor.commands.off("afterExec",this.$onAfterExec),this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.tabstopManager=null,this.session=null,this.editor=null},dt.prototype.onChange=function(St){for(var xt=St.action[0]=="r",yt=this.selectedTabstop||{},_t=yt.parents||{},Ct=this.tabstops.slice(),Et=0;Et2&&(this.tabstops.length&&kt.push(kt.splice(2,1)[0]),this.tabstops.splice.apply(this.tabstops,kt))},dt.prototype.addTabstopMarkers=function(St){var xt=this.session;St.forEach(function(yt){yt.markerId||(yt.markerId=xt.addMarker(yt,"ace_snippet-marker","text"))})},dt.prototype.removeTabstopMarkers=function(St){var xt=this.session;St.forEach(function(yt){xt.removeMarker(yt.markerId),yt.markerId=null})},dt.prototype.updateTabstopMarkers=function(){if(this.selectedTabstop){var St=this.selectedTabstop.snippetId;this.selectedTabstop.index===0&&St--,this.tabstops.forEach(function(xt){xt.snippetId===St?this.addTabstopMarkers(xt):this.removeTabstopMarkers(xt)},this)}},dt.prototype.removeRange=function(St){var xt=St.tabstop.indexOf(St);xt!=-1&&St.tabstop.splice(xt,1),xt=this.ranges.indexOf(St),xt!=-1&&this.ranges.splice(xt,1),xt=St.tabstop.rangeList.ranges.indexOf(St),xt!=-1&&St.tabstop.splice(xt,1),this.session.removeMarker(St.markerId),St.tabstop.length||(xt=this.tabstops.indexOf(St.tabstop),xt!=-1&&this.tabstops.splice(xt,1),this.tabstops.length||this.detach())},dt}();ut.prototype.keyboardHandler=new _,ut.prototype.keyboardHandler.bindKeys({Tab:function(dt){a.snippetManager&&a.snippetManager.expandWithTab(dt)||(dt.tabstopManager.tabNext(1),dt.renderer.scrollCursorIntoView())},"Shift-Tab":function(dt){dt.tabstopManager.tabNext(-1),dt.renderer.scrollCursorIntoView()},Esc:function(dt){dt.tabstopManager.detach()}});var pt=function(dt,St){dt.row==0&&(dt.column+=St.column),dt.row+=St.row},mt=function(dt,St){dt.row==St.row&&(dt.column-=St.column),dt.row-=St.row};et.importCssString(` +`);hr.length>1?(Ht=hr[hr.length-1].length,zt+=hr.length-1):Ht+=qt.length,Zt+=qt}else qt&&(qt.start?qt.end={row:zt,column:Ht}:qt.start={row:zt,column:Ht})}),{text:Zt,tabstops:Tt,tokens:kt}},ut=function(){function dt(St){if(this.index=0,this.ranges=[],this.tabstops=[],St.tabstopManager)return St.tabstopManager;St.tabstopManager=this,this.$onChange=this.onChange.bind(this),this.$onChangeSelection=nt.delayedCall(this.onChangeSelection.bind(this)).schedule,this.$onChangeSession=this.onChangeSession.bind(this),this.$onAfterExec=this.onAfterExec.bind(this),this.attach(St)}return dt.prototype.attach=function(St){this.$openTabstops=null,this.selectedTabstop=null,this.editor=St,this.session=St.session,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)},dt.prototype.detach=function(){this.tabstops.forEach(this.removeTabstopMarkers,this),this.ranges.length=0,this.tabstops.length=0,this.selectedTabstop=null,this.editor.off("change",this.$onChange),this.editor.off("changeSelection",this.$onChangeSelection),this.editor.off("changeSession",this.$onChangeSession),this.editor.commands.off("afterExec",this.$onAfterExec),this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.tabstopManager=null,this.session=null,this.editor=null},dt.prototype.onChange=function(St){for(var xt=St.action[0]=="r",yt=this.selectedTabstop||{},_t=yt.parents||{},Ct=this.tabstops.slice(),Et=0;Et2&&(this.tabstops.length&&kt.push(kt.splice(2,1)[0]),this.tabstops.splice.apply(this.tabstops,kt))},dt.prototype.addTabstopMarkers=function(St){var xt=this.session;St.forEach(function(yt){yt.markerId||(yt.markerId=xt.addMarker(yt,"ace_snippet-marker","text"))})},dt.prototype.removeTabstopMarkers=function(St){var xt=this.session;St.forEach(function(yt){xt.removeMarker(yt.markerId),yt.markerId=null})},dt.prototype.updateTabstopMarkers=function(){if(this.selectedTabstop){var St=this.selectedTabstop.snippetId;this.selectedTabstop.index===0&&St--,this.tabstops.forEach(function(xt){xt.snippetId===St?this.addTabstopMarkers(xt):this.removeTabstopMarkers(xt)},this)}},dt.prototype.removeRange=function(St){var xt=St.tabstop.indexOf(St);xt!=-1&&St.tabstop.splice(xt,1),xt=this.ranges.indexOf(St),xt!=-1&&this.ranges.splice(xt,1),xt=St.tabstop.rangeList.ranges.indexOf(St),xt!=-1&&St.tabstop.splice(xt,1),this.session.removeMarker(St.markerId),St.tabstop.length||(xt=this.tabstops.indexOf(St.tabstop),xt!=-1&&this.tabstops.splice(xt,1),this.tabstops.length||this.detach())},dt}();ut.prototype.keyboardHandler=new _,ut.prototype.keyboardHandler.bindKeys({Tab:function(dt){a.snippetManager&&a.snippetManager.expandWithTab(dt)||(dt.tabstopManager.tabNext(1),dt.renderer.scrollCursorIntoView())},"Shift-Tab":function(dt){dt.tabstopManager.tabNext(-1),dt.renderer.scrollCursorIntoView()},Esc:function(dt){dt.tabstopManager.detach()}});var pt=function(dt,St){dt.row==0&&(dt.column+=St.column),dt.row+=St.row},mt=function(dt,St){dt.row==St.row&&(dt.column-=St.column),dt.row-=St.row};tt.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),a.snippetManager=new ct;var gt=o("./editor").Editor;(function(){this.insertSnippet=function(dt,St){return a.snippetManager.insertSnippet(this,dt,St)},this.expandSnippet=function(dt){return a.snippetManager.expandWithTab(this,dt)}}).call(gt.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","ace/config","ace/lib/useragent"],function(o,a,rt){var et=o("../virtual_renderer").VirtualRenderer,ot=o("../editor").Editor,at=o("../range").Range,nt=o("../lib/event"),it=o("../lib/lang"),j=o("../lib/dom"),_=o("../config").nls,$=o("./../lib/useragent"),tt=function(pt){return"suggest-aria-id:".concat(pt)},st=$.isSafari?"menu":"listbox",lt=$.isSafari?"menuitem":"option",ct=$.isSafari?"aria-current":"aria-selected",ht=function(pt){var mt=new et(pt);mt.$maxLines=4;var gt=new ot(mt);return gt.setHighlightActiveLine(!1),gt.setShowPrintMargin(!1),gt.renderer.setShowGutter(!1),gt.renderer.setHighlightGutterLine(!1),gt.$mouseHandler.$focusTimeout=0,gt.$highlightTagPending=!0,gt},ut=function(){function pt(mt){var gt=j.createElement("div"),dt=ht(gt);mt&&mt.appendChild(gt),gt.style.display="none",dt.renderer.content.style.cursor="default",dt.renderer.setStyle("ace_autocomplete"),dt.renderer.$textLayer.element.setAttribute("role",st),dt.renderer.$textLayer.element.setAttribute("aria-roledescription",_("autocomplete.popup.aria-roledescription","Autocomplete suggestions")),dt.renderer.$textLayer.element.setAttribute("aria-label",_("autocomplete.popup.aria-label","Autocomplete suggestions")),dt.renderer.textarea.setAttribute("aria-hidden","true"),dt.setOption("displayIndentGuides",!1),dt.setOption("dragDelay",150);var St=function(){};dt.focus=St,dt.$isFocused=!0,dt.renderer.$cursorLayer.restartTimer=St,dt.renderer.$cursorLayer.element.style.opacity="0",dt.renderer.$maxLines=8,dt.renderer.$keepTextAreaAtCursor=!1,dt.setHighlightActiveLine(!1),dt.session.highlight(""),dt.session.$searchHighlight.clazz="ace_highlight-marker",dt.on("mousedown",function(Tt){var $t=Tt.getDocumentPosition();dt.selection.moveToPosition($t),_t.start.row=_t.end.row=$t.row,Tt.stop()});var xt,yt=new at(-1,0,-1,1/0),_t=new at(-1,0,-1,1/0);_t.id=dt.session.addMarker(_t,"ace_active-line","fullLine"),dt.setSelectOnHover=function(Tt){Tt?yt.id&&(dt.session.removeMarker(yt.id),yt.id=null):yt.id=dt.session.addMarker(yt,"ace_line-hover","fullLine")},dt.setSelectOnHover(!1),dt.on("mousemove",function(Tt){if(!xt){xt=Tt;return}if(!(xt.x==Tt.x&&xt.y==Tt.y)){xt=Tt,xt.scrollTop=dt.renderer.scrollTop,dt.isMouseOver=!0;var $t=xt.getDocumentPosition().row;yt.start.row!=$t&&(yt.id||dt.setRow($t),Et($t))}}),dt.renderer.on("beforeRender",function(){if(xt&&yt.start.row!=-1){xt.$pos=null;var Tt=xt.getDocumentPosition().row;yt.id||dt.setRow(Tt),Et(Tt,!0)}}),dt.renderer.on("afterRender",function(){var Tt=dt.getRow(),$t=dt.renderer.$textLayer,It=$t.element.childNodes[Tt-$t.config.firstRow],Ot=document.activeElement;if(It!==dt.selectedNode&&dt.selectedNode&&(j.removeCssClass(dt.selectedNode,"ace_selected"),Ot.removeAttribute("aria-activedescendant"),dt.selectedNode.removeAttribute(ct),dt.selectedNode.removeAttribute("id")),dt.selectedNode=It,It){j.addCssClass(It,"ace_selected");var Mt=tt(Tt);It.id=Mt,$t.element.setAttribute("aria-activedescendant",Mt),Ot.setAttribute("aria-activedescendant",Mt),It.setAttribute("role",lt),It.setAttribute("aria-roledescription",_("autocomplete.popup.item.aria-roledescription","item")),It.setAttribute("aria-label",dt.getData(Tt).caption||dt.getData(Tt).value),It.setAttribute("aria-setsize",dt.data.length),It.setAttribute("aria-posinset",Tt+1),It.setAttribute("aria-describedby","doc-tooltip"),It.setAttribute(ct,"true")}});var Ct=function(){Et(-1)},Et=function(Tt,$t){Tt!==yt.start.row&&(yt.start.row=yt.end.row=Tt,$t||dt.session._emit("changeBackMarker"),dt._emit("changeHoverMarker"))};dt.getHoveredRow=function(){return yt.start.row},nt.addListener(dt.container,"mouseout",function(){dt.isMouseOver=!1,Ct()}),dt.on("hide",Ct),dt.on("changeSelection",Ct),dt.session.doc.getLength=function(){return dt.data.length},dt.session.doc.getLine=function(Tt){var $t=dt.data[Tt];return typeof $t=="string"?$t:$t&&$t.value||""};var kt=dt.session.bgTokenizer;return kt.$tokenizeRow=function(Tt){var $t=dt.data[Tt],It=[];if(!$t)return It;typeof $t=="string"&&($t={value:$t});var Ot=$t.caption||$t.value||$t.name;function Mt(qt,hr){qt&&It.push({type:($t.className||"")+(hr||""),value:qt})}for(var Dt=Ot.toLowerCase(),Bt=(dt.filterText||"").toLowerCase(),Kt=0,Wt=0,zt=0;zt<=Bt.length;zt++)if(zt!=Wt&&($t.matchMask&1<=Wt?It="bottom":It="top"),It==="top"?(zt.bottom=Tt.top-this.$borderSize,zt.top=zt.bottom-Wt):It==="bottom"&&(zt.top=Tt.top+$t+this.$borderSize,zt.bottom=zt.top+Wt);var qt=zt.top>=0&&zt.bottom<=Dt;if(!Ot&&!qt)return!1;qt?Kt.$maxPixelHeight=null:It==="top"?Kt.$maxPixelHeight=Zt:Kt.$maxPixelHeight=Ht,It==="top"?(Mt.style.top="",Mt.style.bottom=Dt-zt.bottom+"px",dt.isTopdown=!1):(Mt.style.top=zt.top+"px",Mt.style.bottom="",dt.isTopdown=!0),Mt.style.display="";var hr=Tt.left;return hr+Mt.offsetWidth>Bt&&(hr=Bt-Mt.offsetWidth),Mt.style.left=hr+"px",Mt.style.right="",dt.isOpen||(dt.isOpen=!0,this._signal("show"),xt=null),dt.anchorPos=Tt,dt.anchor=It,!0},dt.show=function(Tt,$t,It){this.tryShow(Tt,$t,It?"bottom":void 0,!0)},dt.goTo=function(Tt){var $t=this.getRow(),It=this.session.getLength()-1;switch(Tt){case"up":$t=$t<=0?It:$t-1;break;case"down":$t=$t>=It?-1:$t+1;break;case"start":$t=0;break;case"end":$t=It;break}this.setRow($t)},dt.getTextLeftOffset=function(){return this.$borderSize+this.renderer.$padding+this.$imageSize},dt.$imageSize=0,dt.$borderSize=1,dt}return pt}();j.importCssString(` .ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line { background-color: #CAD6FA; @@ -1465,13 +1465,13 @@ Error generating stack: `+et.message+` animation: none; } } -`,"autocompletion.css",!1),a.AcePopup=ut,a.$singleLineEditor=ht,a.getAriaId=tt}),ace.define("ace/autocomplete/inline_screenreader",["require","exports","module"],function(o,a,rt){var et=function(){function ot(at){this.editor=at,this.screenReaderDiv=document.createElement("div"),this.screenReaderDiv.classList.add("ace_screenreader-only"),this.editor.container.appendChild(this.screenReaderDiv)}return ot.prototype.setScreenReaderContent=function(at){for(!this.popup&&this.editor.completer&&this.editor.completer.popup&&(this.popup=this.editor.completer.popup,this.popup.renderer.on("afterRender",(function(){var it=this.popup.getRow(),j=this.popup.renderer.$textLayer,_=j.element.childNodes[it-j.config.firstRow];if(_){for(var $="doc-tooltip ",tt=0;tt=0&&nt.test(ot[j]);j--)it.push(ot[j]);return it.reverse().join("")},a.retrieveFollowingIdentifier=function(ot,at,nt){nt=nt||et;for(var it=[],j=at;j0)for(var dt=this.popup.getFirstVisibleRow();dt<=this.popup.getLastVisibleRow();dt++){var St=this.popup.getData(dt);St&&(!gt||St.hideInlinePreview)&&this.$seen(St)}},mt.prototype.$onPopupShow=function(gt){this.$onPopupChange(gt),this.stickySelection=!1,this.stickySelectionDelay>=0&&this.stickySelectionTimer.schedule(this.stickySelectionDelay)},mt.prototype.observeLayoutChanges=function(){if(!(this.$elements||!this.editor)){window.addEventListener("resize",this.onLayoutChange,{passive:!0}),window.addEventListener("wheel",this.mousewheelListener);for(var gt=this.editor.container.parentNode,dt=[];gt;)dt.push(gt),gt.addEventListener("scroll",this.onLayoutChange,{passive:!0}),gt=gt.parentNode;this.$elements=dt}},mt.prototype.unObserveLayoutChanges=function(){var gt=this;window.removeEventListener("resize",this.onLayoutChange,{passive:!0}),window.removeEventListener("wheel",this.mousewheelListener),this.$elements&&this.$elements.forEach(function(dt){dt.removeEventListener("scroll",gt.onLayoutChange,{passive:!0})}),this.$elements=null},mt.prototype.onLayoutChange=function(){if(!this.popup.isOpen)return this.unObserveLayoutChanges();this.$updatePopupPosition(),this.updateDocTooltip()},mt.prototype.$updatePopupPosition=function(){var gt=this.editor,dt=gt.renderer,St=dt.layerConfig.lineHeight,xt=dt.$cursorLayer.getPixelPosition(this.base,!0);xt.left-=this.popup.getTextLeftOffset();var yt=gt.container.getBoundingClientRect();xt.top+=yt.top-dt.layerConfig.offset,xt.left+=yt.left-gt.renderer.scrollLeft,xt.left+=dt.gutterWidth;var _t={top:xt.top,left:xt.left};dt.$ghostText&&dt.$ghostTextWidget&&this.base.row===dt.$ghostText.position.row&&(_t.top+=dt.$ghostTextWidget.el.offsetHeight);var Ct=gt.container.getBoundingClientRect().bottom-St,Et=Ct<_t.top?{top:Ct,left:_t.left}:_t;this.popup.tryShow(Et,St,"bottom")||this.popup.tryShow(xt,St,"top")||this.popup.show(xt,St)},mt.prototype.openPopup=function(gt,dt,St){this.$firstOpenTimer.cancel(),this.popup||this.$init(),this.inlineEnabled&&!this.inlineRenderer&&this.$initInline(),this.popup.autoSelect=this.autoSelect,this.popup.setSelectOnHover(this.setSelectOnHover);var xt=this.popup.getRow(),yt=this.popup.data[xt];this.popup.setData(this.completions.filtered,this.completions.filterText),this.editor.textInput.setAriaOptions&&this.editor.textInput.setAriaOptions({activeDescendant:nt(this.popup.getRow()),inline:this.inlineEnabled}),gt.keyBinding.addKeyboardHandler(this.keyboardHandler);var _t;this.stickySelection&&(_t=this.popup.data.indexOf(yt)),(!_t||_t===-1)&&(_t=0),this.popup.setRow(this.autoSelect?_t:-1),_t===xt&&yt!==this.completions.filtered[_t]&&this.$onPopupChange();var Ct=this.inlineRenderer&&this.inlineEnabled;if(_t===xt&&Ct){var Et=this.popup.getData(this.popup.getRow());this.$updateGhostText(Et)}St||(this.popup.setTheme(gt.getTheme()),this.popup.setFontSize(gt.getFontSize()),this.$updatePopupPosition(),this.tooltipNode&&this.updateDocTooltip()),this.changeTimer.cancel(),this.observeLayoutChanges()},mt.prototype.detach=function(){this.editor&&(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.$firstOpenTimer.cancel(),this.changeTimer.cancel(),this.hideDocTooltip(),this.completionProvider&&this.completionProvider.detach(),this.popup&&this.popup.isOpen&&this.popup.hide(),this.popup&&this.popup.renderer&&this.popup.renderer.off("afterRender",this.$onPopupRender),this.base&&this.base.detach(),this.activated=!1,this.completionProvider=this.completions=this.base=null,this.unObserveLayoutChanges()},mt.prototype.changeListener=function(gt){var dt=this.editor.selection.lead;(dt.row!=this.base.row||dt.columnthis.filterText&>.lastIndexOf(this.filterText,0)===0)var dt=this.filtered;else var dt=this.all;this.filterText=gt,dt=this.filterCompletions(dt,this.filterText),dt=dt.sort(function(xt,yt){return yt.exactMatch-xt.exactMatch||yt.$score-xt.$score||(xt.caption||xt.value).localeCompare(yt.caption||yt.value)});var St=null;dt=dt.filter(function(xt){var yt=xt.snippet||xt.caption||xt.value;return yt===St?!1:(St=yt,!0)}),this.filtered=dt},mt.prototype.filterCompletions=function(gt,dt){var St=[],xt=dt.toUpperCase(),yt=dt.toLowerCase();e:for(var _t=0,Ct;Ct=gt[_t];_t++){var Et=!this.ignoreCaption&&Ct.caption||Ct.value||Ct.snippet;if(Et){var kt=-1,Tt=0,$t=0,It,Ot;if(this.exactMatch){if(dt!==Et.substr(0,dt.length))continue e}else{var Mt=Et.toLowerCase().indexOf(yt);if(Mt>-1)$t=Mt;else for(var Dt=0;Dt=0&&(Kt<0||Bt0&&(kt===-1&&($t+=10),$t+=Ot,Tt=Tt|1<",nt.escapeHTML(xt.caption),"","
",nt.escapeHTML($(xt.snippet))].join(""))},id:"snippetCompleter"},st=[tt,j,_];a.setCompleters=function(xt){st.length=0,xt&&st.push.apply(st,xt)},a.addCompleter=function(xt){st.push(xt)},a.textCompleter=j,a.keyWordCompleter=_,a.snippetCompleter=tt;var lt={name:"expandSnippet",exec:function(xt){return et.expandWithTab(xt)},bindKey:"Tab"},ct=function(xt,yt){ht(yt.session.$mode)},ht=function(xt){typeof xt=="string"&&(xt=at.$modes[xt]),xt&&(et.files||(et.files={}),ut(xt.$id,xt.snippetFileId),xt.modes&&xt.modes.forEach(ht))},ut=function(xt,yt){!yt||!xt||et.files[xt]||(et.files[xt]={},at.loadModule(yt,function(_t){_t&&(et.files[xt]=_t,!_t.snippets&&_t.snippetText&&(_t.snippets=et.parseSnippetFile(_t.snippetText)),et.register(_t.snippets||[],_t.scope),_t.includeScopes&&(et.snippetMap[_t.scope].includeScopes=_t.includeScopes,_t.includeScopes.forEach(function(Ct){ht("ace/mode/"+Ct)})))}))},pt=function(xt){var yt=xt.editor,_t=yt.completer&&yt.completer.activated;if(xt.command.name==="backspace")_t&&!it.getCompletionPrefix(yt)&&yt.completer.detach();else if(xt.command.name==="insertstring"&&!_t){mt=xt;var Ct=xt.editor.$liveAutocompletionDelay;Ct?gt.delay(Ct):dt(xt)}},mt,gt=nt.delayedCall(function(){dt(mt)},0),dt=function(xt){var yt=xt.editor,_t=it.getCompletionPrefix(yt),Ct=xt.args,Et=it.triggerAutocomplete(yt,Ct);if(_t&&_t.length>=yt.$liveAutocompletionThreshold||Et){var kt=ot.for(yt);kt.autoShown=!0,kt.showPopup(yt)}},St=o("../editor").Editor;o("../config").defineOptions(St.prototype,"editor",{enableBasicAutocompletion:{set:function(xt){xt?(this.completers||(this.completers=Array.isArray(xt)?xt:st),this.commands.addCommand(ot.startCommand)):this.commands.removeCommand(ot.startCommand)},value:!1},enableLiveAutocompletion:{set:function(xt){xt?(this.completers||(this.completers=Array.isArray(xt)?xt:st),this.commands.on("afterExec",pt)):this.commands.off("afterExec",pt)},value:!1},liveAutocompletionDelay:{initialValue:0},liveAutocompletionThreshold:{initialValue:0},enableSnippets:{set:function(xt){xt?(this.commands.addCommand(lt),this.on("changeMode",ct),ct(null,this)):(this.commands.removeCommand(lt),this.off("changeMode",ct))},value:!1}})}),function(){ace.require(["ace/ext/language_tools"],function(o){i&&(i.exports=o)})}()})(extLanguage_tools);var modeJavascript={exports:{}};(function(i,s){ace.define("ace/mode/jsdoc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(o,a,rt){var et=o("../lib/oop"),ot=o("./text_highlight_rules").TextHighlightRules,at=function(){this.$rules={start:[{token:["comment.doc.tag","comment.doc.text","lparen.doc"],regex:"(@(?:param|member|typedef|property|namespace|var|const|callback))(\\s*)({)",push:[{token:"lparen.doc",regex:"{",push:[{include:"doc-syntax"},{token:"rparen.doc",regex:"}|(?=$)",next:"pop"}]},{token:["rparen.doc","text.doc","variable.parameter.doc","lparen.doc","variable.parameter.doc","rparen.doc"],regex:/(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,next:"pop"},{token:"rparen.doc",regex:"}|(?=$)",next:"pop"},{include:"doc-syntax"},{defaultToken:"text.doc"}]},{token:["comment.doc.tag","text.doc","lparen.doc"],regex:"(@(?:returns?|yields|type|this|suppress|public|protected|private|package|modifies|implements|external|exception|throws|enum|define|extends))(\\s*)({)",push:[{token:"lparen.doc",regex:"{",push:[{include:"doc-syntax"},{token:"rparen.doc",regex:"}|(?=$)",next:"pop"}]},{token:"rparen.doc",regex:"}|(?=$)",next:"pop"},{include:"doc-syntax"},{defaultToken:"text.doc"}]},{token:["comment.doc.tag","text.doc","variable.parameter.doc"],regex:'(@(?:alias|memberof|instance|module|name|lends|namespace|external|this|template|requires|param|implements|function|extends|typedef|mixes|constructor|var|memberof\\!|event|listens|exports|class|constructs|interface|emits|fires|throws|const|callback|borrows|augments))(\\s+)(\\w[\\w#.:/~"\\-]*)?'},{token:["comment.doc.tag","text.doc","variable.parameter.doc"],regex:"(@method)(\\s+)(\\w[\\w.\\(\\)]*)"},{token:"comment.doc.tag",regex:"@access\\s+(?:private|public|protected)"},{token:"comment.doc.tag",regex:"@kind\\s+(?:class|constant|event|external|file|function|member|mixin|module|namespace|typedef)"},{token:"comment.doc.tag",regex:"@\\w+(?=\\s|$)"},at.getTagRule(),{defaultToken:"comment.doc.body",caseInsensitive:!0}],"doc-syntax":[{token:"operator.doc",regex:/[|:]/},{token:"paren.doc",regex:/[\[\]]/}]},this.normalizeRules()};et.inherits(at,ot),at.getTagRule=function(nt){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},at.getStartRule=function(nt){return{token:"comment.doc",regex:/\/\*\*(?!\/)/,next:nt}},at.getEndRule=function(nt){return{token:"comment.doc",regex:"\\*\\/",next:nt}},a.JsDocCommentHighlightRules=at}),ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/jsdoc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(o,a,rt){var et=o("../lib/oop"),ot=o("./jsdoc_comment_highlight_rules").JsDocCommentHighlightRules,at=o("./text_highlight_rules").TextHighlightRules,nt="[a-zA-Z\\$_¡-￿][a-zA-Z\\d\\$_¡-￿]*",it=function($){var tt={"variable.language":"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|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|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|constructor","storage.type":"const|let|var|function","constant.language":"null|Infinity|NaN|undefined","support.function":"alert","constant.language.boolean":"true|false"},st=this.createKeywordMapper(tt,"identifier"),lt="case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void",ct="\\\\(?: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]?|.)",ht="(function)(\\s*)(\\*?)",ut={token:["identifier","text","paren.lparen"],regex:"(\\b(?!"+Object.values(tt).join("|")+"\\b)"+nt+")(\\s*)(\\()"};this.$rules={no_regex:[ot.getStartRule("doc-start"),_("no_regex"),ut,{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:["entity.name.function","text","keyword.operator","text","storage.type","text","storage.type","text","paren.lparen"],regex:"("+nt+")(\\s*)(=)(\\s*)"+ht+"(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","storage.type","text","text","entity.name.function","text","paren.lparen"],regex:"(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))("+nt+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","storage.type","text","paren.lparen"],regex:"("+nt+")(\\s*)(:)(\\s*)"+ht+"(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)"+ht+"(\\s*)(\\()",next:"function_arguments"},{token:"keyword",regex:`from(?=\\s*('|"))`},{token:"keyword",regex:"(?:"+lt+")\\b",next:"start"},{token:"support.constant",regex:/that\b/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|debug|time|trace|timeEnd|assert)\b/},{token:st,regex:nt},{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:"keyword.operator",regex:/=/},{token:["storage.type","text","storage.type","text","paren.lparen"],regex:ht+"(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","storage.type","text","text","entity.name.function","text","paren.lparen"],regex:"(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",next:"function_arguments"},{token:"punctuation.operator",regex:/[.](?![.])/},{token:"support.function",regex:"prototype"},{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|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|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:nt},{regex:"",token:"empty",next:"no_regex"}],start:[ot.getStartRule("doc-start"),_("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"}],default_parameter:[{token:"string",regex:"'(?=.)",push:[{token:"string",regex:"'|$",next:"pop"},{include:"qstring"}]},{token:"string",regex:'"(?=.)',push:[{token:"string",regex:'"|$',next:"pop"},{include:"qqstring"}]},{token:"constant.language",regex:"null|Infinity|NaN|undefined"},{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:"punctuation.operator",regex:",",next:"function_arguments"},{token:"text",regex:"\\s+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],function_arguments:[_("function_arguments"),{token:"variable.parameter",regex:nt},{token:"punctuation.operator",regex:","},{token:"text",regex:"\\s+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],qqstring:[{token:"constant.language.escape",regex:ct},{token:"string",regex:"\\\\$",consumeLineEnd:!0},{token:"string",regex:'"|$',next:"no_regex"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:ct},{token:"string",regex:"\\\\$",consumeLineEnd:!0},{token:"string",regex:"'|$",next:"no_regex"},{defaultToken:"string"}]},(!$||!$.noES6)&&(this.$rules.no_regex.unshift({regex:"[{}]",onMatch:function(pt,mt,gt){if(this.next=pt=="{"?this.nextState:"",pt=="{"&>.length)gt.unshift("start",mt);else if(pt=="}"&>.length&&(gt.shift(),this.next=gt.shift(),this.next.indexOf("string")!=-1||this.next.indexOf("jsx")!=-1))return"paren.quasi.end";return pt=="{"?"paren.lparen":"paren.rparen"},nextState:"start"},{token:"string.quasi.start",regex:/`/,push:[{token:"constant.language.escape",regex:ct},{token:"paren.quasi.start",regex:/\${/,push:"start"},{token:"string.quasi.end",regex:/`/,next:"pop"},{defaultToken:"string.quasi"}]},{token:["variable.parameter","text"],regex:"("+nt+")(\\s*)(?=\\=>)"},{token:"paren.lparen",regex:"(\\()(?=[^\\(]+\\s*=>)",next:"function_arguments"},{token:"variable.language",regex:"(?:(?:(?:Weak)?(?:Set|Map))|Promise)\\b"}),this.$rules.function_arguments.unshift({token:"keyword.operator",regex:"=",next:"default_parameter"},{token:"keyword.operator",regex:"\\.{3}"}),this.$rules.property.unshift({token:"support.function",regex:"(findIndex|repeat|startsWith|endsWith|includes|isSafeInteger|trunc|cbrt|log2|log10|sign|then|catch|finally|resolve|reject|race|any|all|allSettled|keys|entries|isInteger)\\b(?=\\()"},{token:"constant.language",regex:"(?:MAX_SAFE_INTEGER|MIN_SAFE_INTEGER|EPSILON)\\b"}),(!$||$.jsx!=!1)&&j.call(this)),this.embedRules(ot,"doc-",[ot.getEndRule("no_regex")]),this.normalizeRules()};et.inherits(it,at);function j(){var $=nt.replace("\\d","\\d\\-"),tt={onMatch:function(lt,ct,ht){var ut=lt.charAt(1)=="/"?2:1;return ut==1?(ct!=this.nextState?ht.unshift(this.next,this.nextState,0):ht.unshift(this.next),ht[2]++):ut==2&&ct==this.nextState&&(ht[1]--,(!ht[1]||ht[1]<0)&&(ht.shift(),ht.shift())),[{type:"meta.tag.punctuation."+(ut==1?"":"end-")+"tag-open.xml",value:lt.slice(0,ut)},{type:"meta.tag.tag-name.xml",value:lt.substr(ut)}]},regex:"))",next:"jsxAttributes",nextState:"jsx"};this.$rules.start.unshift(tt);var st={regex:"{",token:"paren.quasi.start",push:"start"};this.$rules.jsx=[st,tt,{include:"reference"},{defaultToken:"string.xml"}],this.$rules.jsxAttributes=[{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",onMatch:function(lt,ct,ht){return ct==ht[0]&&ht.shift(),lt.length==2&&(ht[0]==this.nextState&&ht[1]--,(!ht[1]||ht[1]<0)&&ht.splice(0,2)),this.next=ht[0]||"start",[{type:this.token,value:lt}]},nextState:"jsx"},st,_("jsxAttributes"),{token:"entity.other.attribute-name.xml",regex:$},{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"}]},tt],this.$rules.reference=[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}]}function _($){return[{token:"comment",regex:/\/\*/,next:[ot.getTagRule(),{token:"comment",regex:"\\*\\/",next:$||"pop"},{defaultToken:"comment",caseInsensitive:!0}]},{token:"comment",regex:"\\/\\/",next:[ot.getTagRule(),{token:"comment",regex:"$|^",next:$||"pop"},{defaultToken:"comment",caseInsensitive:!0}]}]}a.JavaScriptHighlightRules=it}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(o,a,rt){var et=o("../range").Range,ot=function(){};(function(){this.checkOutdent=function(at,nt){return/^\s+$/.test(at)?/^\s*\}/.test(nt):!1},this.autoOutdent=function(at,nt){var it=at.getLine(nt),j=it.match(/^(\s*\})/);if(!j)return 0;var _=j[1].length,$=at.findMatchingBracket({row:nt,column:_});if(!$||$.row==nt)return 0;var tt=this.$getIndent(at.getLine($.row));at.replace(new et(nt,0,nt,_-1),tt)},this.$getIndent=function(at){return at.match(/^\s*/)[0]}}).call(ot.prototype),a.MatchingBraceOutdent=ot}),ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"],function(o,a,rt){var et=o("../../lib/oop"),ot=o("../behaviour").Behaviour,at=o("../../token_iterator").TokenIterator;function nt(j,_){return j&&j.type.lastIndexOf(_+".xml")>-1}var it=function(){this.add("string_dquotes","insertion",function(j,_,$,tt,st){if(st=='"'||st=="'"){var lt=st,ct=tt.doc.getTextRange($.getSelectionRange());if(ct!==""&&ct!=="'"&&ct!='"'&&$.getWrapBehavioursEnabled())return{text:lt+ct+lt,selection:!1};var ht=$.getCursorPosition(),ut=tt.doc.getLine(ht.row),pt=ut.substring(ht.column,ht.column+1),mt=new at(tt,ht.row,ht.column),gt=mt.getCurrentToken();if(pt==lt&&(nt(gt,"attribute-value")||nt(gt,"string")))return{text:"",selection:[1,1]};if(gt||(gt=mt.stepBackward()),!gt)return;for(;nt(gt,"tag-whitespace")||nt(gt,"whitespace");)gt=mt.stepBackward();var dt=!pt||pt.match(/\s/);if(nt(gt,"attribute-equals")&&(dt||pt==">")||nt(gt,"decl-attribute-equals")&&(dt||pt=="?"))return{text:lt+lt,selection:[1,1]}}}),this.add("string_dquotes","deletion",function(j,_,$,tt,st){var lt=tt.doc.getTextRange(st);if(!st.isMultiLine()&&(lt=='"'||lt=="'")){var ct=tt.doc.getLine(st.start.row),ht=ct.substring(st.start.column+1,st.start.column+2);if(ht==lt)return st.end.column++,st}}),this.add("autoclosing","insertion",function(j,_,$,tt,st){if(st==">"){var lt=$.getSelectionRange().start,ct=new at(tt,lt.row,lt.column),ht=ct.getCurrentToken()||ct.stepBackward();if(!ht||!(nt(ht,"tag-name")||nt(ht,"tag-whitespace")||nt(ht,"attribute-name")||nt(ht,"attribute-equals")||nt(ht,"attribute-value"))||nt(ht,"reference.attribute-value"))return;if(nt(ht,"attribute-value")){var ut=ct.getCurrentTokenColumn()+ht.value.length;if(lt.column/.test(tt.getLine(lt.row).slice(lt.column)))return;for(;!nt(ht,"tag-name");)if(ht=ct.stepBackward(),ht.value=="<"){ht=ct.stepForward();break}var mt=ct.getCurrentTokenRow(),gt=ct.getCurrentTokenColumn();if(nt(ct.stepBackward(),"end-tag-open"))return;var dt=ht.value;return mt==lt.row&&(dt=dt.substring(0,lt.column-gt)),this.voidElements&&this.voidElements.hasOwnProperty(dt.toLowerCase())?void 0:{text:">",selection:[1,1]}}}),this.add("autoindent","insertion",function(j,_,$,tt,st){if(st==` -`){var lt=$.getCursorPosition(),ct=tt.getLine(lt.row),ht=new at(tt,lt.row,lt.column),ut=ht.getCurrentToken();if(nt(ut,"")&&ut.type.indexOf("tag-close")!==-1){if(ut.value=="/>")return;for(;ut&&ut.type.indexOf("tag-name")===-1;)ut=ht.stepBackward();if(!ut)return;var pt=ut.value,mt=ht.getCurrentTokenRow();if(ut=ht.stepBackward(),!ut||ut.type.indexOf("end-tag")!==-1)return;if(this.voidElements&&!this.voidElements[pt]||!this.voidElements){var gt=tt.getTokenAt(lt.row,lt.column+1),ct=tt.getLine(mt),dt=this.$getIndent(ct),St=dt+tt.getTabString();return gt&>.value==="=0&&nt.test(ot[j]);j--)it.push(ot[j]);return it.reverse().join("")},a.retrieveFollowingIdentifier=function(ot,at,nt){nt=nt||tt;for(var it=[],j=at;j0)for(var dt=this.popup.getFirstVisibleRow();dt<=this.popup.getLastVisibleRow();dt++){var St=this.popup.getData(dt);St&&(!gt||St.hideInlinePreview)&&this.$seen(St)}},mt.prototype.$onPopupShow=function(gt){this.$onPopupChange(gt),this.stickySelection=!1,this.stickySelectionDelay>=0&&this.stickySelectionTimer.schedule(this.stickySelectionDelay)},mt.prototype.observeLayoutChanges=function(){if(!(this.$elements||!this.editor)){window.addEventListener("resize",this.onLayoutChange,{passive:!0}),window.addEventListener("wheel",this.mousewheelListener);for(var gt=this.editor.container.parentNode,dt=[];gt;)dt.push(gt),gt.addEventListener("scroll",this.onLayoutChange,{passive:!0}),gt=gt.parentNode;this.$elements=dt}},mt.prototype.unObserveLayoutChanges=function(){var gt=this;window.removeEventListener("resize",this.onLayoutChange,{passive:!0}),window.removeEventListener("wheel",this.mousewheelListener),this.$elements&&this.$elements.forEach(function(dt){dt.removeEventListener("scroll",gt.onLayoutChange,{passive:!0})}),this.$elements=null},mt.prototype.onLayoutChange=function(){if(!this.popup.isOpen)return this.unObserveLayoutChanges();this.$updatePopupPosition(),this.updateDocTooltip()},mt.prototype.$updatePopupPosition=function(){var gt=this.editor,dt=gt.renderer,St=dt.layerConfig.lineHeight,xt=dt.$cursorLayer.getPixelPosition(this.base,!0);xt.left-=this.popup.getTextLeftOffset();var yt=gt.container.getBoundingClientRect();xt.top+=yt.top-dt.layerConfig.offset,xt.left+=yt.left-gt.renderer.scrollLeft,xt.left+=dt.gutterWidth;var _t={top:xt.top,left:xt.left};dt.$ghostText&&dt.$ghostTextWidget&&this.base.row===dt.$ghostText.position.row&&(_t.top+=dt.$ghostTextWidget.el.offsetHeight);var Ct=gt.container.getBoundingClientRect().bottom-St,Et=Ct<_t.top?{top:Ct,left:_t.left}:_t;this.popup.tryShow(Et,St,"bottom")||this.popup.tryShow(xt,St,"top")||this.popup.show(xt,St)},mt.prototype.openPopup=function(gt,dt,St){this.$firstOpenTimer.cancel(),this.popup||this.$init(),this.inlineEnabled&&!this.inlineRenderer&&this.$initInline(),this.popup.autoSelect=this.autoSelect,this.popup.setSelectOnHover(this.setSelectOnHover);var xt=this.popup.getRow(),yt=this.popup.data[xt];this.popup.setData(this.completions.filtered,this.completions.filterText),this.editor.textInput.setAriaOptions&&this.editor.textInput.setAriaOptions({activeDescendant:nt(this.popup.getRow()),inline:this.inlineEnabled}),gt.keyBinding.addKeyboardHandler(this.keyboardHandler);var _t;this.stickySelection&&(_t=this.popup.data.indexOf(yt)),(!_t||_t===-1)&&(_t=0),this.popup.setRow(this.autoSelect?_t:-1),_t===xt&&yt!==this.completions.filtered[_t]&&this.$onPopupChange();var Ct=this.inlineRenderer&&this.inlineEnabled;if(_t===xt&&Ct){var Et=this.popup.getData(this.popup.getRow());this.$updateGhostText(Et)}St||(this.popup.setTheme(gt.getTheme()),this.popup.setFontSize(gt.getFontSize()),this.$updatePopupPosition(),this.tooltipNode&&this.updateDocTooltip()),this.changeTimer.cancel(),this.observeLayoutChanges()},mt.prototype.detach=function(){this.editor&&(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.$firstOpenTimer.cancel(),this.changeTimer.cancel(),this.hideDocTooltip(),this.completionProvider&&this.completionProvider.detach(),this.popup&&this.popup.isOpen&&this.popup.hide(),this.popup&&this.popup.renderer&&this.popup.renderer.off("afterRender",this.$onPopupRender),this.base&&this.base.detach(),this.activated=!1,this.completionProvider=this.completions=this.base=null,this.unObserveLayoutChanges()},mt.prototype.changeListener=function(gt){var dt=this.editor.selection.lead;(dt.row!=this.base.row||dt.columnthis.filterText&>.lastIndexOf(this.filterText,0)===0)var dt=this.filtered;else var dt=this.all;this.filterText=gt,dt=this.filterCompletions(dt,this.filterText),dt=dt.sort(function(xt,yt){return yt.exactMatch-xt.exactMatch||yt.$score-xt.$score||(xt.caption||xt.value).localeCompare(yt.caption||yt.value)});var St=null;dt=dt.filter(function(xt){var yt=xt.snippet||xt.caption||xt.value;return yt===St?!1:(St=yt,!0)}),this.filtered=dt},mt.prototype.filterCompletions=function(gt,dt){var St=[],xt=dt.toUpperCase(),yt=dt.toLowerCase();e:for(var _t=0,Ct;Ct=gt[_t];_t++){var Et=!this.ignoreCaption&&Ct.caption||Ct.value||Ct.snippet;if(Et){var kt=-1,Tt=0,$t=0,It,Ot;if(this.exactMatch){if(dt!==Et.substr(0,dt.length))continue e}else{var Mt=Et.toLowerCase().indexOf(yt);if(Mt>-1)$t=Mt;else for(var Dt=0;Dt=0&&(Kt<0||Bt0&&(kt===-1&&($t+=10),$t+=Ot,Tt=Tt|1<",nt.escapeHTML(xt.caption),"","
",nt.escapeHTML($(xt.snippet))].join(""))},id:"snippetCompleter"},st=[et,j,_];a.setCompleters=function(xt){st.length=0,xt&&st.push.apply(st,xt)},a.addCompleter=function(xt){st.push(xt)},a.textCompleter=j,a.keyWordCompleter=_,a.snippetCompleter=et;var lt={name:"expandSnippet",exec:function(xt){return tt.expandWithTab(xt)},bindKey:"Tab"},ct=function(xt,yt){ht(yt.session.$mode)},ht=function(xt){typeof xt=="string"&&(xt=at.$modes[xt]),xt&&(tt.files||(tt.files={}),ut(xt.$id,xt.snippetFileId),xt.modes&&xt.modes.forEach(ht))},ut=function(xt,yt){!yt||!xt||tt.files[xt]||(tt.files[xt]={},at.loadModule(yt,function(_t){_t&&(tt.files[xt]=_t,!_t.snippets&&_t.snippetText&&(_t.snippets=tt.parseSnippetFile(_t.snippetText)),tt.register(_t.snippets||[],_t.scope),_t.includeScopes&&(tt.snippetMap[_t.scope].includeScopes=_t.includeScopes,_t.includeScopes.forEach(function(Ct){ht("ace/mode/"+Ct)})))}))},pt=function(xt){var yt=xt.editor,_t=yt.completer&&yt.completer.activated;if(xt.command.name==="backspace")_t&&!it.getCompletionPrefix(yt)&&yt.completer.detach();else if(xt.command.name==="insertstring"&&!_t){mt=xt;var Ct=xt.editor.$liveAutocompletionDelay;Ct?gt.delay(Ct):dt(xt)}},mt,gt=nt.delayedCall(function(){dt(mt)},0),dt=function(xt){var yt=xt.editor,_t=it.getCompletionPrefix(yt),Ct=xt.args,Et=it.triggerAutocomplete(yt,Ct);if(_t&&_t.length>=yt.$liveAutocompletionThreshold||Et){var kt=ot.for(yt);kt.autoShown=!0,kt.showPopup(yt)}},St=o("../editor").Editor;o("../config").defineOptions(St.prototype,"editor",{enableBasicAutocompletion:{set:function(xt){xt?(this.completers||(this.completers=Array.isArray(xt)?xt:st),this.commands.addCommand(ot.startCommand)):this.commands.removeCommand(ot.startCommand)},value:!1},enableLiveAutocompletion:{set:function(xt){xt?(this.completers||(this.completers=Array.isArray(xt)?xt:st),this.commands.on("afterExec",pt)):this.commands.off("afterExec",pt)},value:!1},liveAutocompletionDelay:{initialValue:0},liveAutocompletionThreshold:{initialValue:0},enableSnippets:{set:function(xt){xt?(this.commands.addCommand(lt),this.on("changeMode",ct),ct(null,this)):(this.commands.removeCommand(lt),this.off("changeMode",ct))},value:!1}})}),function(){ace.require(["ace/ext/language_tools"],function(o){i&&(i.exports=o)})}()})(extLanguage_tools);var modeJavascript={exports:{}};(function(i,s){ace.define("ace/mode/jsdoc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(o,a,rt){var tt=o("../lib/oop"),ot=o("./text_highlight_rules").TextHighlightRules,at=function(){this.$rules={start:[{token:["comment.doc.tag","comment.doc.text","lparen.doc"],regex:"(@(?:param|member|typedef|property|namespace|var|const|callback))(\\s*)({)",push:[{token:"lparen.doc",regex:"{",push:[{include:"doc-syntax"},{token:"rparen.doc",regex:"}|(?=$)",next:"pop"}]},{token:["rparen.doc","text.doc","variable.parameter.doc","lparen.doc","variable.parameter.doc","rparen.doc"],regex:/(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,next:"pop"},{token:"rparen.doc",regex:"}|(?=$)",next:"pop"},{include:"doc-syntax"},{defaultToken:"text.doc"}]},{token:["comment.doc.tag","text.doc","lparen.doc"],regex:"(@(?:returns?|yields|type|this|suppress|public|protected|private|package|modifies|implements|external|exception|throws|enum|define|extends))(\\s*)({)",push:[{token:"lparen.doc",regex:"{",push:[{include:"doc-syntax"},{token:"rparen.doc",regex:"}|(?=$)",next:"pop"}]},{token:"rparen.doc",regex:"}|(?=$)",next:"pop"},{include:"doc-syntax"},{defaultToken:"text.doc"}]},{token:["comment.doc.tag","text.doc","variable.parameter.doc"],regex:'(@(?:alias|memberof|instance|module|name|lends|namespace|external|this|template|requires|param|implements|function|extends|typedef|mixes|constructor|var|memberof\\!|event|listens|exports|class|constructs|interface|emits|fires|throws|const|callback|borrows|augments))(\\s+)(\\w[\\w#.:/~"\\-]*)?'},{token:["comment.doc.tag","text.doc","variable.parameter.doc"],regex:"(@method)(\\s+)(\\w[\\w.\\(\\)]*)"},{token:"comment.doc.tag",regex:"@access\\s+(?:private|public|protected)"},{token:"comment.doc.tag",regex:"@kind\\s+(?:class|constant|event|external|file|function|member|mixin|module|namespace|typedef)"},{token:"comment.doc.tag",regex:"@\\w+(?=\\s|$)"},at.getTagRule(),{defaultToken:"comment.doc.body",caseInsensitive:!0}],"doc-syntax":[{token:"operator.doc",regex:/[|:]/},{token:"paren.doc",regex:/[\[\]]/}]},this.normalizeRules()};tt.inherits(at,ot),at.getTagRule=function(nt){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},at.getStartRule=function(nt){return{token:"comment.doc",regex:/\/\*\*(?!\/)/,next:nt}},at.getEndRule=function(nt){return{token:"comment.doc",regex:"\\*\\/",next:nt}},a.JsDocCommentHighlightRules=at}),ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/jsdoc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(o,a,rt){var tt=o("../lib/oop"),ot=o("./jsdoc_comment_highlight_rules").JsDocCommentHighlightRules,at=o("./text_highlight_rules").TextHighlightRules,nt="[a-zA-Z\\$_¡-￿][a-zA-Z\\d\\$_¡-￿]*",it=function($){var et={"variable.language":"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|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|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|constructor","storage.type":"const|let|var|function","constant.language":"null|Infinity|NaN|undefined","support.function":"alert","constant.language.boolean":"true|false"},st=this.createKeywordMapper(et,"identifier"),lt="case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void",ct="\\\\(?: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]?|.)",ht="(function)(\\s*)(\\*?)",ut={token:["identifier","text","paren.lparen"],regex:"(\\b(?!"+Object.values(et).join("|")+"\\b)"+nt+")(\\s*)(\\()"};this.$rules={no_regex:[ot.getStartRule("doc-start"),_("no_regex"),ut,{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:["entity.name.function","text","keyword.operator","text","storage.type","text","storage.type","text","paren.lparen"],regex:"("+nt+")(\\s*)(=)(\\s*)"+ht+"(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","storage.type","text","text","entity.name.function","text","paren.lparen"],regex:"(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))("+nt+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","storage.type","text","paren.lparen"],regex:"("+nt+")(\\s*)(:)(\\s*)"+ht+"(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)"+ht+"(\\s*)(\\()",next:"function_arguments"},{token:"keyword",regex:`from(?=\\s*('|"))`},{token:"keyword",regex:"(?:"+lt+")\\b",next:"start"},{token:"support.constant",regex:/that\b/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|debug|time|trace|timeEnd|assert)\b/},{token:st,regex:nt},{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:"keyword.operator",regex:/=/},{token:["storage.type","text","storage.type","text","paren.lparen"],regex:ht+"(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","storage.type","text","text","entity.name.function","text","paren.lparen"],regex:"(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",next:"function_arguments"},{token:"punctuation.operator",regex:/[.](?![.])/},{token:"support.function",regex:"prototype"},{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|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|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:nt},{regex:"",token:"empty",next:"no_regex"}],start:[ot.getStartRule("doc-start"),_("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"}],default_parameter:[{token:"string",regex:"'(?=.)",push:[{token:"string",regex:"'|$",next:"pop"},{include:"qstring"}]},{token:"string",regex:'"(?=.)',push:[{token:"string",regex:'"|$',next:"pop"},{include:"qqstring"}]},{token:"constant.language",regex:"null|Infinity|NaN|undefined"},{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:"punctuation.operator",regex:",",next:"function_arguments"},{token:"text",regex:"\\s+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],function_arguments:[_("function_arguments"),{token:"variable.parameter",regex:nt},{token:"punctuation.operator",regex:","},{token:"text",regex:"\\s+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],qqstring:[{token:"constant.language.escape",regex:ct},{token:"string",regex:"\\\\$",consumeLineEnd:!0},{token:"string",regex:'"|$',next:"no_regex"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:ct},{token:"string",regex:"\\\\$",consumeLineEnd:!0},{token:"string",regex:"'|$",next:"no_regex"},{defaultToken:"string"}]},(!$||!$.noES6)&&(this.$rules.no_regex.unshift({regex:"[{}]",onMatch:function(pt,mt,gt){if(this.next=pt=="{"?this.nextState:"",pt=="{"&>.length)gt.unshift("start",mt);else if(pt=="}"&>.length&&(gt.shift(),this.next=gt.shift(),this.next.indexOf("string")!=-1||this.next.indexOf("jsx")!=-1))return"paren.quasi.end";return pt=="{"?"paren.lparen":"paren.rparen"},nextState:"start"},{token:"string.quasi.start",regex:/`/,push:[{token:"constant.language.escape",regex:ct},{token:"paren.quasi.start",regex:/\${/,push:"start"},{token:"string.quasi.end",regex:/`/,next:"pop"},{defaultToken:"string.quasi"}]},{token:["variable.parameter","text"],regex:"("+nt+")(\\s*)(?=\\=>)"},{token:"paren.lparen",regex:"(\\()(?=[^\\(]+\\s*=>)",next:"function_arguments"},{token:"variable.language",regex:"(?:(?:(?:Weak)?(?:Set|Map))|Promise)\\b"}),this.$rules.function_arguments.unshift({token:"keyword.operator",regex:"=",next:"default_parameter"},{token:"keyword.operator",regex:"\\.{3}"}),this.$rules.property.unshift({token:"support.function",regex:"(findIndex|repeat|startsWith|endsWith|includes|isSafeInteger|trunc|cbrt|log2|log10|sign|then|catch|finally|resolve|reject|race|any|all|allSettled|keys|entries|isInteger)\\b(?=\\()"},{token:"constant.language",regex:"(?:MAX_SAFE_INTEGER|MIN_SAFE_INTEGER|EPSILON)\\b"}),(!$||$.jsx!=!1)&&j.call(this)),this.embedRules(ot,"doc-",[ot.getEndRule("no_regex")]),this.normalizeRules()};tt.inherits(it,at);function j(){var $=nt.replace("\\d","\\d\\-"),et={onMatch:function(lt,ct,ht){var ut=lt.charAt(1)=="/"?2:1;return ut==1?(ct!=this.nextState?ht.unshift(this.next,this.nextState,0):ht.unshift(this.next),ht[2]++):ut==2&&ct==this.nextState&&(ht[1]--,(!ht[1]||ht[1]<0)&&(ht.shift(),ht.shift())),[{type:"meta.tag.punctuation."+(ut==1?"":"end-")+"tag-open.xml",value:lt.slice(0,ut)},{type:"meta.tag.tag-name.xml",value:lt.substr(ut)}]},regex:"))",next:"jsxAttributes",nextState:"jsx"};this.$rules.start.unshift(et);var st={regex:"{",token:"paren.quasi.start",push:"start"};this.$rules.jsx=[st,et,{include:"reference"},{defaultToken:"string.xml"}],this.$rules.jsxAttributes=[{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",onMatch:function(lt,ct,ht){return ct==ht[0]&&ht.shift(),lt.length==2&&(ht[0]==this.nextState&&ht[1]--,(!ht[1]||ht[1]<0)&&ht.splice(0,2)),this.next=ht[0]||"start",[{type:this.token,value:lt}]},nextState:"jsx"},st,_("jsxAttributes"),{token:"entity.other.attribute-name.xml",regex:$},{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"}]},et],this.$rules.reference=[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}]}function _($){return[{token:"comment",regex:/\/\*/,next:[ot.getTagRule(),{token:"comment",regex:"\\*\\/",next:$||"pop"},{defaultToken:"comment",caseInsensitive:!0}]},{token:"comment",regex:"\\/\\/",next:[ot.getTagRule(),{token:"comment",regex:"$|^",next:$||"pop"},{defaultToken:"comment",caseInsensitive:!0}]}]}a.JavaScriptHighlightRules=it}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(o,a,rt){var tt=o("../range").Range,ot=function(){};(function(){this.checkOutdent=function(at,nt){return/^\s+$/.test(at)?/^\s*\}/.test(nt):!1},this.autoOutdent=function(at,nt){var it=at.getLine(nt),j=it.match(/^(\s*\})/);if(!j)return 0;var _=j[1].length,$=at.findMatchingBracket({row:nt,column:_});if(!$||$.row==nt)return 0;var et=this.$getIndent(at.getLine($.row));at.replace(new tt(nt,0,nt,_-1),et)},this.$getIndent=function(at){return at.match(/^\s*/)[0]}}).call(ot.prototype),a.MatchingBraceOutdent=ot}),ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"],function(o,a,rt){var tt=o("../../lib/oop"),ot=o("../behaviour").Behaviour,at=o("../../token_iterator").TokenIterator;function nt(j,_){return j&&j.type.lastIndexOf(_+".xml")>-1}var it=function(){this.add("string_dquotes","insertion",function(j,_,$,et,st){if(st=='"'||st=="'"){var lt=st,ct=et.doc.getTextRange($.getSelectionRange());if(ct!==""&&ct!=="'"&&ct!='"'&&$.getWrapBehavioursEnabled())return{text:lt+ct+lt,selection:!1};var ht=$.getCursorPosition(),ut=et.doc.getLine(ht.row),pt=ut.substring(ht.column,ht.column+1),mt=new at(et,ht.row,ht.column),gt=mt.getCurrentToken();if(pt==lt&&(nt(gt,"attribute-value")||nt(gt,"string")))return{text:"",selection:[1,1]};if(gt||(gt=mt.stepBackward()),!gt)return;for(;nt(gt,"tag-whitespace")||nt(gt,"whitespace");)gt=mt.stepBackward();var dt=!pt||pt.match(/\s/);if(nt(gt,"attribute-equals")&&(dt||pt==">")||nt(gt,"decl-attribute-equals")&&(dt||pt=="?"))return{text:lt+lt,selection:[1,1]}}}),this.add("string_dquotes","deletion",function(j,_,$,et,st){var lt=et.doc.getTextRange(st);if(!st.isMultiLine()&&(lt=='"'||lt=="'")){var ct=et.doc.getLine(st.start.row),ht=ct.substring(st.start.column+1,st.start.column+2);if(ht==lt)return st.end.column++,st}}),this.add("autoclosing","insertion",function(j,_,$,et,st){if(st==">"){var lt=$.getSelectionRange().start,ct=new at(et,lt.row,lt.column),ht=ct.getCurrentToken()||ct.stepBackward();if(!ht||!(nt(ht,"tag-name")||nt(ht,"tag-whitespace")||nt(ht,"attribute-name")||nt(ht,"attribute-equals")||nt(ht,"attribute-value"))||nt(ht,"reference.attribute-value"))return;if(nt(ht,"attribute-value")){var ut=ct.getCurrentTokenColumn()+ht.value.length;if(lt.column/.test(et.getLine(lt.row).slice(lt.column)))return;for(;!nt(ht,"tag-name");)if(ht=ct.stepBackward(),ht.value=="<"){ht=ct.stepForward();break}var mt=ct.getCurrentTokenRow(),gt=ct.getCurrentTokenColumn();if(nt(ct.stepBackward(),"end-tag-open"))return;var dt=ht.value;return mt==lt.row&&(dt=dt.substring(0,lt.column-gt)),this.voidElements&&this.voidElements.hasOwnProperty(dt.toLowerCase())?void 0:{text:">",selection:[1,1]}}}),this.add("autoindent","insertion",function(j,_,$,et,st){if(st==` +`){var lt=$.getCursorPosition(),ct=et.getLine(lt.row),ht=new at(et,lt.row,lt.column),ut=ht.getCurrentToken();if(nt(ut,"")&&ut.type.indexOf("tag-close")!==-1){if(ut.value=="/>")return;for(;ut&&ut.type.indexOf("tag-name")===-1;)ut=ht.stepBackward();if(!ut)return;var pt=ut.value,mt=ht.getCurrentTokenRow();if(ut=ht.stepBackward(),!ut||ut.type.indexOf("end-tag")!==-1)return;if(this.voidElements&&!this.voidElements[pt]||!this.voidElements){var gt=et.getTokenAt(lt.row,lt.column+1),ct=et.getLine(mt),dt=this.$getIndent(ct),St=dt+et.getTabString();return gt&>.value===""){var ct=tt.getSelectionRange().start,ht=new ot(st,ct.row,ct.column),ut=ht.getCurrentToken()||ht.stepBackward();if(!ut)return;if(ut.value=="<")return{text:">",selection:[1,1]}}})};et.inherits(it,at),a.JavaScriptBehaviour=it}),ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(o,a,rt){var et=o("../../lib/oop"),ot=o("../../range").Range,at=o("./fold_mode").FoldMode,nt=a.FoldMode=function(_,$){at.call(this),this.voidElements=_||{},this.optionalEndTags=et.mixin({},this.voidElements),$&&et.mixin(this.optionalEndTags,$)};et.inherits(nt,at);var it=function(){this.tagName="",this.closing=!1,this.selfClosing=!1,this.start={row:0,column:0},this.end={row:0,column:0}};function j(_,$){return _.type.lastIndexOf($+".xml")>-1}(function(){this.getFoldWidget=function(_,$,tt){var st=this._getFirstTagInLine(_,tt);return st?st.closing||!st.tagName&&st.selfClosing?$==="markbeginend"?"end":"":!st.tagName||st.selfClosing||this.voidElements.hasOwnProperty(st.tagName.toLowerCase())||this._findEndTagInLine(_,tt,st.tagName,st.end.column)?"":"start":this.getCommentFoldWidget(_,tt)},this.getCommentFoldWidget=function(_,$){return/comment/.test(_.getState($))&&/";break}return st}else if(j(ct,"tag-close"))return st.selfClosing=ct.value=="/>",st;st.start.column+=ct.value.length}return null},this._findEndTagInLine=function(_,$,tt,st){for(var lt=_.getTokens($),ct=0,ht=0;htht)break;var ut=this.getFoldWidgetRange(it,"all",j);if(ut){if(ut.start.row<=tt)break;if(ut.isMultiLine())j=ut.end.row;else if($==ht)break}lt=j}}return new ot(tt,st,lt,it.getLine(lt).length)},this.getCommentRegionBlock=function(it,j,_){for(var $=j.search(/\s*$/),tt=it.getLength(),st=_,lt=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,ct=1;++_st)return new ot(st,$,ut,j.length)}}).call(nt.prototype)}),ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"],function(o,a,rt){var et=o("../../lib/oop"),ot=o("./xml").FoldMode,at=o("./cstyle").FoldMode,nt=a.FoldMode=function(it){it&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+it.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+it.end))),this.xmlFoldMode=new ot};et.inherits(nt,at),(function(){this.getFoldWidgetRangeBase=this.getFoldWidgetRange,this.getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(it,j,_){var $=this.getFoldWidgetBase(it,j,_);return $||this.xmlFoldMode.getFoldWidget(it,j,_)},this.getFoldWidgetRange=function(it,j,_,$){var tt=this.getFoldWidgetRangeBase(it,j,_,$);return tt||this.xmlFoldMode.getFoldWidgetRange(it,j,_)}}).call(nt.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/javascript","ace/mode/folding/javascript"],function(o,a,rt){var et=o("../lib/oop"),ot=o("./text").Mode,at=o("./javascript_highlight_rules").JavaScriptHighlightRules,nt=o("./matching_brace_outdent").MatchingBraceOutdent,it=o("../worker/worker_client").WorkerClient,j=o("./behaviour/javascript").JavaScriptBehaviour,_=o("./folding/javascript").FoldMode,$=function(){this.HighlightRules=at,this.$outdent=new nt,this.$behaviour=new j,this.foldingRules=new _};et.inherits($,ot),(function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.$quotes={'"':'"',"'":"'","`":"`"},this.$pairQuotesAfter={"`":/\w/},this.getNextLineIndent=function(tt,st,lt){var ct=this.$getIndent(st),ht=this.getTokenizer().getLineTokens(st,tt),ut=ht.tokens,pt=ht.state;if(ut.length&&ut[ut.length-1].type=="comment")return ct;if(tt=="start"||tt=="no_regex"){var mt=st.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);mt&&(ct+=lt)}else if(tt=="doc-start"&&(pt=="start"||pt=="no_regex"))return"";return ct},this.checkOutdent=function(tt,st,lt){return this.$outdent.checkOutdent(st,lt)},this.autoOutdent=function(tt,st,lt){this.$outdent.autoOutdent(st,lt)},this.createWorker=function(tt){var st=new it(["ace"],"ace/mode/javascript_worker","JavaScriptWorker");return st.attachToDocument(tt.getDocument()),st.on("annotate",function(lt){tt.setAnnotations(lt.data)}),st.on("terminate",function(){tt.clearAnnotations()}),st},this.$id="ace/mode/javascript",this.snippetFileId="ace/snippets/javascript"}).call($.prototype),a.Mode=$}),function(){ace.require(["ace/mode/javascript"],function(o){i&&(i.exports=o)})}()})(modeJavascript);var modePython={exports:{}};(function(i,s){ace.define("ace/mode/python_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(o,a,rt){var et=o("../lib/oop"),ot=o("./text_highlight_rules").TextHighlightRules,at=function(){var nt="and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield|async|await|nonlocal",it="True|False|None|NotImplemented|Ellipsis|__debug__",j="abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|binfile|bin|iter|property|tuple|bool|filter|len|range|type|bytearray|float|list|raw_input|unichr|callable|format|locals|reduce|unicode|chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|__import__|complex|hash|min|apply|delattr|help|next|setattr|set|buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern|ascii|breakpoint|bytes",_=this.createKeywordMapper({"invalid.deprecated":"debugger","support.function":j,"variable.language":"self|cls","constant.language":it,keyword:nt},"identifier"),$="[uU]?",tt="[rR]",st="[fF]",lt="(?:[rR][fF]|[fF][rR])",ct="(?:(?:[1-9]\\d*)|(?:0))",ht="(?:0[oO]?[0-7]+)",ut="(?:0[xX][\\dA-Fa-f]+)",pt="(?:0[bB][01]+)",mt="(?:"+ct+"|"+ht+"|"+ut+"|"+pt+")",gt="(?:[eE][+-]?\\d+)",dt="(?:\\.\\d+)",St="(?:\\d+)",xt="(?:(?:"+St+"?"+dt+")|(?:"+St+"\\.))",yt="(?:(?:"+xt+"|"+St+")"+gt+")",_t="(?:"+yt+"|"+xt+")",Ct=`\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})`;this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"string",regex:$+'"{3}',next:"qqstring3"},{token:"string",regex:$+'"(?=.)',next:"qqstring"},{token:"string",regex:$+"'{3}",next:"qstring3"},{token:"string",regex:$+"'(?=.)",next:"qstring"},{token:"string",regex:tt+'"{3}',next:"rawqqstring3"},{token:"string",regex:tt+'"(?=.)',next:"rawqqstring"},{token:"string",regex:tt+"'{3}",next:"rawqstring3"},{token:"string",regex:tt+"'(?=.)",next:"rawqstring"},{token:"string",regex:st+'"{3}',next:"fqqstring3"},{token:"string",regex:st+'"(?=.)',next:"fqqstring"},{token:"string",regex:st+"'{3}",next:"fqstring3"},{token:"string",regex:st+"'(?=.)",next:"fqstring"},{token:"string",regex:lt+'"{3}',next:"rfqqstring3"},{token:"string",regex:lt+'"(?=.)',next:"rfqqstring"},{token:"string",regex:lt+"'{3}",next:"rfqstring3"},{token:"string",regex:lt+"'(?=.)",next:"rfqstring"},{token:"keyword.operator",regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|@|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"punctuation",regex:",|:|;|\\->|\\+=|\\-=|\\*=|\\/=|\\/\\/=|%=|@=|&=|\\|=|^=|>>=|<<=|\\*\\*="},{token:"paren.lparen",regex:"[\\[\\(\\{]"},{token:"paren.rparen",regex:"[\\]\\)\\}]"},{token:["keyword","text","entity.name.function"],regex:"(def|class)(\\s+)([\\u00BF-\\u1FFF\\u2C00-\\uD7FF\\w]+)"},{token:"text",regex:"\\s+"},{include:"constants"}],qqstring3:[{token:"constant.language.escape",regex:Ct},{token:"string",regex:'"{3}',next:"start"},{defaultToken:"string"}],qstring3:[{token:"constant.language.escape",regex:Ct},{token:"string",regex:"'{3}",next:"start"},{defaultToken:"string"}],qqstring:[{token:"constant.language.escape",regex:Ct},{token:"string",regex:"\\\\$",next:"qqstring"},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:Ct},{token:"string",regex:"\\\\$",next:"qstring"},{token:"string",regex:"'|$",next:"start"},{defaultToken:"string"}],rawqqstring3:[{token:"string",regex:'"{3}',next:"start"},{defaultToken:"string"}],rawqstring3:[{token:"string",regex:"'{3}",next:"start"},{defaultToken:"string"}],rawqqstring:[{token:"string",regex:"\\\\$",next:"rawqqstring"},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],rawqstring:[{token:"string",regex:"\\\\$",next:"rawqstring"},{token:"string",regex:"'|$",next:"start"},{defaultToken:"string"}],fqqstring3:[{token:"constant.language.escape",regex:Ct},{token:"string",regex:'"{3}',next:"start"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"},{defaultToken:"string"}],fqstring3:[{token:"constant.language.escape",regex:Ct},{token:"string",regex:"'{3}",next:"start"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"},{defaultToken:"string"}],fqqstring:[{token:"constant.language.escape",regex:Ct},{token:"string",regex:"\\\\$",next:"fqqstring"},{token:"string",regex:'"|$',next:"start"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"},{defaultToken:"string"}],fqstring:[{token:"constant.language.escape",regex:Ct},{token:"string",regex:"'|$",next:"start"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"},{defaultToken:"string"}],rfqqstring3:[{token:"string",regex:'"{3}',next:"start"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"},{defaultToken:"string"}],rfqstring3:[{token:"string",regex:"'{3}",next:"start"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"},{defaultToken:"string"}],rfqqstring:[{token:"string",regex:"\\\\$",next:"rfqqstring"},{token:"string",regex:'"|$',next:"start"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"},{defaultToken:"string"}],rfqstring:[{token:"string",regex:"'|$",next:"start"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"},{defaultToken:"string"}],fqstringParRules:[{token:"paren.lparen",regex:"[\\[\\(]"},{token:"paren.rparen",regex:"[\\]\\)]"},{token:"string",regex:"\\s+"},{token:"string",regex:"'[^']*'"},{token:"string",regex:'"[^"]*"'},{token:"function.support",regex:"(!s|!r|!a)"},{include:"constants"},{token:"paren.rparen",regex:"}",next:"pop"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"}],constants:[{token:"constant.numeric",regex:"(?:"+_t+"|\\d+)[jJ]\\b"},{token:"constant.numeric",regex:_t},{token:"constant.numeric",regex:mt+"[lL]\\b"},{token:"constant.numeric",regex:mt+"\\b"},{token:["punctuation","function.support"],regex:"(\\.)([a-zA-Z_]+)\\b"},{token:_,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"}]},this.normalizeRules()};et.inherits(at,ot),a.PythonHighlightRules=at}),ace.define("ace/mode/folding/pythonic",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"],function(o,a,rt){var et=o("../../lib/oop"),ot=o("./fold_mode").FoldMode,at=a.FoldMode=function(nt){this.foldingStartMarker=new RegExp("([\\[{])(?:\\s*)$|("+nt+")(?:\\s*)(?:#.*)?$")};et.inherits(at,ot),(function(){this.getFoldWidgetRange=function(nt,it,j){var _=nt.getLine(j),$=_.match(this.foldingStartMarker);if($)return $[1]?this.openingBracketBlock(nt,$[1],j,$.index):$[2]?this.indentationBlock(nt,j,$.index+$[2].length):this.indentationBlock(nt,j)}}).call(at.prototype)}),ace.define("ace/mode/python",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/python_highlight_rules","ace/mode/folding/pythonic","ace/range"],function(o,a,rt){var et=o("../lib/oop"),ot=o("./text").Mode,at=o("./python_highlight_rules").PythonHighlightRules,nt=o("./folding/pythonic").FoldMode,it=o("../range").Range,j=function(){this.HighlightRules=at,this.foldingRules=new nt("\\:"),this.$behaviour=this.$defaultBehaviour};et.inherits(j,ot),(function(){this.lineCommentStart="#",this.$pairQuotesAfter={"'":/[ruf]/i,'"':/[ruf]/i},this.getNextLineIndent=function($,tt,st){var lt=this.$getIndent(tt),ct=this.getTokenizer().getLineTokens(tt,$),ht=ct.tokens;if(ht.length&&ht[ht.length-1].type=="comment")return lt;if($=="start"){var ut=tt.match(/^.*[\{\(\[:]\s*$/);ut&&(lt+=st)}return lt};var _={pass:1,return:1,raise:1,break:1,continue:1};this.checkOutdent=function($,tt,st){if(st!==`\r +`+St}}}}})};tt.inherits(it,ot),a.XmlBehaviour=it}),ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"],function(o,a,rt){var tt=o("../../lib/oop"),ot=o("../../token_iterator").TokenIterator,at=o("../behaviour/cstyle").CstyleBehaviour,nt=o("../behaviour/xml").XmlBehaviour,it=function(){var j=new nt({closeCurlyBraces:!0}).getBehaviours();this.addBehaviours(j),this.inherit(at),this.add("autoclosing-fragment","insertion",function(_,$,et,st,lt){if(lt==">"){var ct=et.getSelectionRange().start,ht=new ot(st,ct.row,ct.column),ut=ht.getCurrentToken()||ht.stepBackward();if(!ut)return;if(ut.value=="<")return{text:">",selection:[1,1]}}})};tt.inherits(it,at),a.JavaScriptBehaviour=it}),ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(o,a,rt){var tt=o("../../lib/oop"),ot=o("../../range").Range,at=o("./fold_mode").FoldMode,nt=a.FoldMode=function(_,$){at.call(this),this.voidElements=_||{},this.optionalEndTags=tt.mixin({},this.voidElements),$&&tt.mixin(this.optionalEndTags,$)};tt.inherits(nt,at);var it=function(){this.tagName="",this.closing=!1,this.selfClosing=!1,this.start={row:0,column:0},this.end={row:0,column:0}};function j(_,$){return _.type.lastIndexOf($+".xml")>-1}(function(){this.getFoldWidget=function(_,$,et){var st=this._getFirstTagInLine(_,et);return st?st.closing||!st.tagName&&st.selfClosing?$==="markbeginend"?"end":"":!st.tagName||st.selfClosing||this.voidElements.hasOwnProperty(st.tagName.toLowerCase())||this._findEndTagInLine(_,et,st.tagName,st.end.column)?"":"start":this.getCommentFoldWidget(_,et)},this.getCommentFoldWidget=function(_,$){return/comment/.test(_.getState($))&&/";break}return st}else if(j(ct,"tag-close"))return st.selfClosing=ct.value=="/>",st;st.start.column+=ct.value.length}return null},this._findEndTagInLine=function(_,$,et,st){for(var lt=_.getTokens($),ct=0,ht=0;htht)break;var ut=this.getFoldWidgetRange(it,"all",j);if(ut){if(ut.start.row<=et)break;if(ut.isMultiLine())j=ut.end.row;else if($==ht)break}lt=j}}return new ot(et,st,lt,it.getLine(lt).length)},this.getCommentRegionBlock=function(it,j,_){for(var $=j.search(/\s*$/),et=it.getLength(),st=_,lt=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,ct=1;++_st)return new ot(st,$,ut,j.length)}}).call(nt.prototype)}),ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"],function(o,a,rt){var tt=o("../../lib/oop"),ot=o("./xml").FoldMode,at=o("./cstyle").FoldMode,nt=a.FoldMode=function(it){it&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+it.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+it.end))),this.xmlFoldMode=new ot};tt.inherits(nt,at),(function(){this.getFoldWidgetRangeBase=this.getFoldWidgetRange,this.getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(it,j,_){var $=this.getFoldWidgetBase(it,j,_);return $||this.xmlFoldMode.getFoldWidget(it,j,_)},this.getFoldWidgetRange=function(it,j,_,$){var et=this.getFoldWidgetRangeBase(it,j,_,$);return et||this.xmlFoldMode.getFoldWidgetRange(it,j,_)}}).call(nt.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/javascript","ace/mode/folding/javascript"],function(o,a,rt){var tt=o("../lib/oop"),ot=o("./text").Mode,at=o("./javascript_highlight_rules").JavaScriptHighlightRules,nt=o("./matching_brace_outdent").MatchingBraceOutdent,it=o("../worker/worker_client").WorkerClient,j=o("./behaviour/javascript").JavaScriptBehaviour,_=o("./folding/javascript").FoldMode,$=function(){this.HighlightRules=at,this.$outdent=new nt,this.$behaviour=new j,this.foldingRules=new _};tt.inherits($,ot),(function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.$quotes={'"':'"',"'":"'","`":"`"},this.$pairQuotesAfter={"`":/\w/},this.getNextLineIndent=function(et,st,lt){var ct=this.$getIndent(st),ht=this.getTokenizer().getLineTokens(st,et),ut=ht.tokens,pt=ht.state;if(ut.length&&ut[ut.length-1].type=="comment")return ct;if(et=="start"||et=="no_regex"){var mt=st.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);mt&&(ct+=lt)}else if(et=="doc-start"&&(pt=="start"||pt=="no_regex"))return"";return ct},this.checkOutdent=function(et,st,lt){return this.$outdent.checkOutdent(st,lt)},this.autoOutdent=function(et,st,lt){this.$outdent.autoOutdent(st,lt)},this.createWorker=function(et){var st=new it(["ace"],"ace/mode/javascript_worker","JavaScriptWorker");return st.attachToDocument(et.getDocument()),st.on("annotate",function(lt){et.setAnnotations(lt.data)}),st.on("terminate",function(){et.clearAnnotations()}),st},this.$id="ace/mode/javascript",this.snippetFileId="ace/snippets/javascript"}).call($.prototype),a.Mode=$}),function(){ace.require(["ace/mode/javascript"],function(o){i&&(i.exports=o)})}()})(modeJavascript);var modePython={exports:{}};(function(i,s){ace.define("ace/mode/python_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(o,a,rt){var tt=o("../lib/oop"),ot=o("./text_highlight_rules").TextHighlightRules,at=function(){var nt="and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield|async|await|nonlocal",it="True|False|None|NotImplemented|Ellipsis|__debug__",j="abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|binfile|bin|iter|property|tuple|bool|filter|len|range|type|bytearray|float|list|raw_input|unichr|callable|format|locals|reduce|unicode|chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|__import__|complex|hash|min|apply|delattr|help|next|setattr|set|buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern|ascii|breakpoint|bytes",_=this.createKeywordMapper({"invalid.deprecated":"debugger","support.function":j,"variable.language":"self|cls","constant.language":it,keyword:nt},"identifier"),$="[uU]?",et="[rR]",st="[fF]",lt="(?:[rR][fF]|[fF][rR])",ct="(?:(?:[1-9]\\d*)|(?:0))",ht="(?:0[oO]?[0-7]+)",ut="(?:0[xX][\\dA-Fa-f]+)",pt="(?:0[bB][01]+)",mt="(?:"+ct+"|"+ht+"|"+ut+"|"+pt+")",gt="(?:[eE][+-]?\\d+)",dt="(?:\\.\\d+)",St="(?:\\d+)",xt="(?:(?:"+St+"?"+dt+")|(?:"+St+"\\.))",yt="(?:(?:"+xt+"|"+St+")"+gt+")",_t="(?:"+yt+"|"+xt+")",Ct=`\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})`;this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"string",regex:$+'"{3}',next:"qqstring3"},{token:"string",regex:$+'"(?=.)',next:"qqstring"},{token:"string",regex:$+"'{3}",next:"qstring3"},{token:"string",regex:$+"'(?=.)",next:"qstring"},{token:"string",regex:et+'"{3}',next:"rawqqstring3"},{token:"string",regex:et+'"(?=.)',next:"rawqqstring"},{token:"string",regex:et+"'{3}",next:"rawqstring3"},{token:"string",regex:et+"'(?=.)",next:"rawqstring"},{token:"string",regex:st+'"{3}',next:"fqqstring3"},{token:"string",regex:st+'"(?=.)',next:"fqqstring"},{token:"string",regex:st+"'{3}",next:"fqstring3"},{token:"string",regex:st+"'(?=.)",next:"fqstring"},{token:"string",regex:lt+'"{3}',next:"rfqqstring3"},{token:"string",regex:lt+'"(?=.)',next:"rfqqstring"},{token:"string",regex:lt+"'{3}",next:"rfqstring3"},{token:"string",regex:lt+"'(?=.)",next:"rfqstring"},{token:"keyword.operator",regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|@|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"punctuation",regex:",|:|;|\\->|\\+=|\\-=|\\*=|\\/=|\\/\\/=|%=|@=|&=|\\|=|^=|>>=|<<=|\\*\\*="},{token:"paren.lparen",regex:"[\\[\\(\\{]"},{token:"paren.rparen",regex:"[\\]\\)\\}]"},{token:["keyword","text","entity.name.function"],regex:"(def|class)(\\s+)([\\u00BF-\\u1FFF\\u2C00-\\uD7FF\\w]+)"},{token:"text",regex:"\\s+"},{include:"constants"}],qqstring3:[{token:"constant.language.escape",regex:Ct},{token:"string",regex:'"{3}',next:"start"},{defaultToken:"string"}],qstring3:[{token:"constant.language.escape",regex:Ct},{token:"string",regex:"'{3}",next:"start"},{defaultToken:"string"}],qqstring:[{token:"constant.language.escape",regex:Ct},{token:"string",regex:"\\\\$",next:"qqstring"},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:Ct},{token:"string",regex:"\\\\$",next:"qstring"},{token:"string",regex:"'|$",next:"start"},{defaultToken:"string"}],rawqqstring3:[{token:"string",regex:'"{3}',next:"start"},{defaultToken:"string"}],rawqstring3:[{token:"string",regex:"'{3}",next:"start"},{defaultToken:"string"}],rawqqstring:[{token:"string",regex:"\\\\$",next:"rawqqstring"},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],rawqstring:[{token:"string",regex:"\\\\$",next:"rawqstring"},{token:"string",regex:"'|$",next:"start"},{defaultToken:"string"}],fqqstring3:[{token:"constant.language.escape",regex:Ct},{token:"string",regex:'"{3}',next:"start"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"},{defaultToken:"string"}],fqstring3:[{token:"constant.language.escape",regex:Ct},{token:"string",regex:"'{3}",next:"start"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"},{defaultToken:"string"}],fqqstring:[{token:"constant.language.escape",regex:Ct},{token:"string",regex:"\\\\$",next:"fqqstring"},{token:"string",regex:'"|$',next:"start"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"},{defaultToken:"string"}],fqstring:[{token:"constant.language.escape",regex:Ct},{token:"string",regex:"'|$",next:"start"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"},{defaultToken:"string"}],rfqqstring3:[{token:"string",regex:'"{3}',next:"start"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"},{defaultToken:"string"}],rfqstring3:[{token:"string",regex:"'{3}",next:"start"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"},{defaultToken:"string"}],rfqqstring:[{token:"string",regex:"\\\\$",next:"rfqqstring"},{token:"string",regex:'"|$',next:"start"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"},{defaultToken:"string"}],rfqstring:[{token:"string",regex:"'|$",next:"start"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"},{defaultToken:"string"}],fqstringParRules:[{token:"paren.lparen",regex:"[\\[\\(]"},{token:"paren.rparen",regex:"[\\]\\)]"},{token:"string",regex:"\\s+"},{token:"string",regex:"'[^']*'"},{token:"string",regex:'"[^"]*"'},{token:"function.support",regex:"(!s|!r|!a)"},{include:"constants"},{token:"paren.rparen",regex:"}",next:"pop"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"}],constants:[{token:"constant.numeric",regex:"(?:"+_t+"|\\d+)[jJ]\\b"},{token:"constant.numeric",regex:_t},{token:"constant.numeric",regex:mt+"[lL]\\b"},{token:"constant.numeric",regex:mt+"\\b"},{token:["punctuation","function.support"],regex:"(\\.)([a-zA-Z_]+)\\b"},{token:_,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"}]},this.normalizeRules()};tt.inherits(at,ot),a.PythonHighlightRules=at}),ace.define("ace/mode/folding/pythonic",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"],function(o,a,rt){var tt=o("../../lib/oop"),ot=o("./fold_mode").FoldMode,at=a.FoldMode=function(nt){this.foldingStartMarker=new RegExp("([\\[{])(?:\\s*)$|("+nt+")(?:\\s*)(?:#.*)?$")};tt.inherits(at,ot),(function(){this.getFoldWidgetRange=function(nt,it,j){var _=nt.getLine(j),$=_.match(this.foldingStartMarker);if($)return $[1]?this.openingBracketBlock(nt,$[1],j,$.index):$[2]?this.indentationBlock(nt,j,$.index+$[2].length):this.indentationBlock(nt,j)}}).call(at.prototype)}),ace.define("ace/mode/python",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/python_highlight_rules","ace/mode/folding/pythonic","ace/range"],function(o,a,rt){var tt=o("../lib/oop"),ot=o("./text").Mode,at=o("./python_highlight_rules").PythonHighlightRules,nt=o("./folding/pythonic").FoldMode,it=o("../range").Range,j=function(){this.HighlightRules=at,this.foldingRules=new nt("\\:"),this.$behaviour=this.$defaultBehaviour};tt.inherits(j,ot),(function(){this.lineCommentStart="#",this.$pairQuotesAfter={"'":/[ruf]/i,'"':/[ruf]/i},this.getNextLineIndent=function($,et,st){var lt=this.$getIndent(et),ct=this.getTokenizer().getLineTokens(et,$),ht=ct.tokens;if(ht.length&&ht[ht.length-1].type=="comment")return lt;if($=="start"){var ut=et.match(/^.*[\{\(\[:]\s*$/);ut&&(lt+=st)}return lt};var _={pass:1,return:1,raise:1,break:1,continue:1};this.checkOutdent=function($,et,st){if(st!==`\r `&&st!=="\r"&&st!==` -`)return!1;var lt=this.getTokenizer().getLineTokens(tt.trim(),$).tokens;if(!lt)return!1;do var ct=lt.pop();while(ct&&(ct.type=="comment"||ct.type=="text"&&ct.value.match(/^\s+$/)));return ct?ct.type=="keyword"&&_[ct.value]:!1},this.autoOutdent=function($,tt,st){st+=1;var lt=this.$getIndent(tt.getLine(st)),ct=tt.getTabString();lt.slice(-ct.length)==ct&&tt.remove(new it(st,lt.length-ct.length,st,lt.length))},this.$id="ace/mode/python",this.snippetFileId="ace/snippets/python"}).call(j.prototype),a.Mode=j}),function(){ace.require(["ace/mode/python"],function(o){i&&(i.exports=o)})}()})(modePython);var themeDracula={exports:{}};(function(i,s){ace.define("ace/theme/dracula-css",["require","exports","module"],function(o,a,rt){rt.exports=`/* +`)return!1;var lt=this.getTokenizer().getLineTokens(et.trim(),$).tokens;if(!lt)return!1;do var ct=lt.pop();while(ct&&(ct.type=="comment"||ct.type=="text"&&ct.value.match(/^\s+$/)));return ct?ct.type=="keyword"&&_[ct.value]:!1},this.autoOutdent=function($,et,st){st+=1;var lt=this.$getIndent(et.getLine(st)),ct=et.getTabString();lt.slice(-ct.length)==ct&&et.remove(new it(st,lt.length-ct.length,st,lt.length))},this.$id="ace/mode/python",this.snippetFileId="ace/snippets/python"}).call(j.prototype),a.Mode=j}),function(){ace.require(["ace/mode/python"],function(o){i&&(i.exports=o)})}()})(modePython);var themeDracula={exports:{}};(function(i,s){ace.define("ace/theme/dracula-css",["require","exports","module"],function(o,a,rt){rt.exports=`/* * Copyright © 2017 Zeno Rocha * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: @@ -1636,7 +1636,7 @@ Error generating stack: `+et.message+` .ace-dracula .ace_indent-guide-active { background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACAQMAAACjTyRkAAAABlBMVEUAAADCwsK76u2xAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjYGBoAAAAhACBGFbxzQAAAABJRU5ErkJggg==") right repeat-y; } -`}),ace.define("ace/theme/dracula",["require","exports","module","ace/theme/dracula-css","ace/lib/dom"],function(o,a,rt){a.isDark=!0,a.cssClass="ace-dracula",a.cssText=o("./dracula-css"),a.$selectionColorConflict=!0;var et=o("../lib/dom");et.importCssString(a.cssText,a.cssClass,!1)}),function(){ace.require(["ace/theme/dracula"],function(o){i&&(i.exports=o)})}()})(themeDracula);var themeTomorrow_night_eighties={exports:{}};(function(i,s){ace.define("ace/theme/tomorrow_night_eighties-css",["require","exports","module"],function(o,a,rt){rt.exports=`.ace-tomorrow-night-eighties .ace_gutter { +`}),ace.define("ace/theme/dracula",["require","exports","module","ace/theme/dracula-css","ace/lib/dom"],function(o,a,rt){a.isDark=!0,a.cssClass="ace-dracula",a.cssText=o("./dracula-css"),a.$selectionColorConflict=!0;var tt=o("../lib/dom");tt.importCssString(a.cssText,a.cssClass,!1)}),function(){ace.require(["ace/theme/dracula"],function(o){i&&(i.exports=o)})}()})(themeDracula);var themeTomorrow_night_eighties={exports:{}};(function(i,s){ace.define("ace/theme/tomorrow_night_eighties-css",["require","exports","module"],function(o,a,rt){rt.exports=`.ace-tomorrow-night-eighties .ace_gutter { background: #272727; color: #CCC } @@ -1764,18 +1764,18 @@ Error generating stack: `+et.message+` .ace-tomorrow-night-eighties .ace_indent-guide-active { background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQIW2PQ1dX9zzBz5sz/ABCcBFFentLlAAAAAElFTkSuQmCC) right repeat-y; } -`}),ace.define("ace/theme/tomorrow_night_eighties",["require","exports","module","ace/theme/tomorrow_night_eighties-css","ace/lib/dom"],function(o,a,rt){a.isDark=!0,a.cssClass="ace-tomorrow-night-eighties",a.cssText=o("./tomorrow_night_eighties-css");var et=o("../lib/dom");et.importCssString(a.cssText,a.cssClass,!1)}),function(){ace.require(["ace/theme/tomorrow_night_eighties"],function(o){i&&(i.exports=o)})}()})(themeTomorrow_night_eighties);const Editor=i=>{const s=useTypedSelector(a=>a.workspace.currentLanguage),{colorMode:o}=useColorMode();return jsxRuntimeExports.jsx(_default,{mode:languageToModeMap[s],theme:o==="dark"?"dracula":"tomorrow_night_eighties",fontSize:15,width:"100%",...i})},JsonDisplay=({jsonProgram:i})=>jsxRuntimeExports.jsx(Card,{children:jsxRuntimeExports.jsxs(CardBody,{children:[jsxRuntimeExports.jsx(Text,{children:"JSON Code:"}),jsxRuntimeExports.jsx(Box,{overflowX:"scroll",children:jsxRuntimeExports.jsx(Code,{display:"block",whiteSpace:"pre",width:"max-content",children:i})})]})});function formatProdErrorMessage$1(i){return`Minified Redux error #${i}; visit https://redux.js.org/Errors?code=${i} for the full message or use the non-minified dev environment for full errors. `}var $$observable=typeof Symbol=="function"&&Symbol.observable||"@@observable",symbol_observable_default=$$observable,randomString=()=>Math.random().toString(36).substring(7).split("").join("."),ActionTypes={INIT:`@@redux/INIT${randomString()}`,REPLACE:`@@redux/REPLACE${randomString()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${randomString()}`},actionTypes_default=ActionTypes;function isPlainObject$1(i){if(typeof i!="object"||i===null)return!1;let s=i;for(;Object.getPrototypeOf(s)!==null;)s=Object.getPrototypeOf(s);return Object.getPrototypeOf(i)===s||Object.getPrototypeOf(i)===null}function createStore(i,s,o){if(typeof i!="function")throw new Error(formatProdErrorMessage$1(2));if(typeof s=="function"&&typeof o=="function"||typeof o=="function"&&typeof arguments[3]=="function")throw new Error(formatProdErrorMessage$1(0));if(typeof s=="function"&&typeof o>"u"&&(o=s,s=void 0),typeof o<"u"){if(typeof o!="function")throw new Error(formatProdErrorMessage$1(1));return o(createStore)(i,s)}let a=i,rt=s,et=new Map,ot=et,at=0,nt=!1;function it(){ot===et&&(ot=new Map,et.forEach((ct,ht)=>{ot.set(ht,ct)}))}function j(){if(nt)throw new Error(formatProdErrorMessage$1(3));return rt}function _(ct){if(typeof ct!="function")throw new Error(formatProdErrorMessage$1(4));if(nt)throw new Error(formatProdErrorMessage$1(5));let ht=!0;it();const ut=at++;return ot.set(ut,ct),function(){if(ht){if(nt)throw new Error(formatProdErrorMessage$1(6));ht=!1,it(),ot.delete(ut),et=null}}}function $(ct){if(!isPlainObject$1(ct))throw new Error(formatProdErrorMessage$1(7));if(typeof ct.type>"u")throw new Error(formatProdErrorMessage$1(8));if(typeof ct.type!="string")throw new Error(formatProdErrorMessage$1(17));if(nt)throw new Error(formatProdErrorMessage$1(9));try{nt=!0,rt=a(rt,ct)}finally{nt=!1}return(et=ot).forEach(ut=>{ut()}),ct}function tt(ct){if(typeof ct!="function")throw new Error(formatProdErrorMessage$1(10));a=ct,$({type:actionTypes_default.REPLACE})}function st(){const ct=_;return{subscribe(ht){if(typeof ht!="object"||ht===null)throw new Error(formatProdErrorMessage$1(11));function ut(){const mt=ht;mt.next&&mt.next(j())}return ut(),{unsubscribe:ct(ut)}},[symbol_observable_default](){return this}}}return $({type:actionTypes_default.INIT}),{dispatch:$,subscribe:_,getState:j,replaceReducer:tt,[symbol_observable_default]:st}}function assertReducerShape(i){Object.keys(i).forEach(s=>{const o=i[s];if(typeof o(void 0,{type:actionTypes_default.INIT})>"u")throw new Error(formatProdErrorMessage$1(12));if(typeof o(void 0,{type:actionTypes_default.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(formatProdErrorMessage$1(13))})}function combineReducers(i){const s=Object.keys(i),o={};for(let et=0;et"u")throw at&&at.type,new Error(formatProdErrorMessage$1(14));it[_]=st,nt=nt||st!==tt}return nt=nt||a.length!==Object.keys(ot).length,nt?it:ot}}function compose(...i){return i.length===0?s=>s:i.length===1?i[0]:i.reduce((s,o)=>(...a)=>s(o(...a)))}function applyMiddleware(...i){return s=>(o,a)=>{const rt=s(o,a);let et=()=>{throw new Error(formatProdErrorMessage$1(15))};const ot={getState:rt.getState,dispatch:(nt,...it)=>et(nt,...it)},at=i.map(nt=>nt(ot));return et=compose(...at)(rt.dispatch),{...rt,dispatch:et}}}function isAction(i){return isPlainObject$1(i)&&"type"in i&&typeof i.type=="string"}var NOTHING=Symbol.for("immer-nothing"),DRAFTABLE=Symbol.for("immer-draftable"),DRAFT_STATE=Symbol.for("immer-state");function die(i,...s){throw new Error(`[Immer] minified error nr: ${i}. Full error at: https://bit.ly/3cXEKWf`)}var getPrototypeOf=Object.getPrototypeOf;function isDraft(i){return!!i&&!!i[DRAFT_STATE]}function isDraftable(i){var s;return i?isPlainObject(i)||Array.isArray(i)||!!i[DRAFTABLE]||!!((s=i.constructor)!=null&&s[DRAFTABLE])||isMap(i)||isSet(i):!1}var objectCtorString=Object.prototype.constructor.toString();function isPlainObject(i){if(!i||typeof i!="object")return!1;const s=getPrototypeOf(i);if(s===null)return!0;const o=Object.hasOwnProperty.call(s,"constructor")&&s.constructor;return o===Object?!0:typeof o=="function"&&Function.toString.call(o)===objectCtorString}function each(i,s){getArchtype(i)===0?Reflect.ownKeys(i).forEach(o=>{s(o,i[o],i)}):i.forEach((o,a)=>s(a,o,i))}function getArchtype(i){const s=i[DRAFT_STATE];return s?s.type_:Array.isArray(i)?1:isMap(i)?2:isSet(i)?3:0}function has(i,s){return getArchtype(i)===2?i.has(s):Object.prototype.hasOwnProperty.call(i,s)}function set(i,s,o){const a=getArchtype(i);a===2?i.set(s,o):a===3?i.add(o):i[s]=o}function is(i,s){return i===s?i!==0||1/i===1/s:i!==i&&s!==s}function isMap(i){return i instanceof Map}function isSet(i){return i instanceof Set}function latest(i){return i.copy_||i.base_}function shallowCopy(i,s){if(isMap(i))return new Map(i);if(isSet(i))return new Set(i);if(Array.isArray(i))return Array.prototype.slice.call(i);const o=isPlainObject(i);if(s===!0||s==="class_only"&&!o){const a=Object.getOwnPropertyDescriptors(i);delete a[DRAFT_STATE];let rt=Reflect.ownKeys(a);for(let et=0;et1&&(i.set=i.add=i.clear=i.delete=dontMutateFrozenCollections),Object.freeze(i),s&&Object.entries(i).forEach(([o,a])=>freeze(a,!0))),i}function dontMutateFrozenCollections(){die(2)}function isFrozen(i){return Object.isFrozen(i)}var plugins={};function getPlugin(i){const s=plugins[i];return s||die(0,i),s}var currentScope;function getCurrentScope(){return currentScope}function createScope(i,s){return{drafts_:[],parent_:i,immer_:s,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function usePatchesInScope(i,s){s&&(getPlugin("Patches"),i.patches_=[],i.inversePatches_=[],i.patchListener_=s)}function revokeScope(i){leaveScope(i),i.drafts_.forEach(revokeDraft),i.drafts_=null}function leaveScope(i){i===currentScope&&(currentScope=i.parent_)}function enterScope(i){return currentScope=createScope(currentScope,i)}function revokeDraft(i){const s=i[DRAFT_STATE];s.type_===0||s.type_===1?s.revoke_():s.revoked_=!0}function processResult(i,s){s.unfinalizedDrafts_=s.drafts_.length;const o=s.drafts_[0];return i!==void 0&&i!==o?(o[DRAFT_STATE].modified_&&(revokeScope(s),die(4)),isDraftable(i)&&(i=finalize(s,i),s.parent_||maybeFreeze(s,i)),s.patches_&&getPlugin("Patches").generateReplacementPatches_(o[DRAFT_STATE].base_,i,s.patches_,s.inversePatches_)):i=finalize(s,o,[]),revokeScope(s),s.patches_&&s.patchListener_(s.patches_,s.inversePatches_),i!==NOTHING?i:void 0}function finalize(i,s,o){if(isFrozen(s))return s;const a=s[DRAFT_STATE];if(!a)return each(s,(rt,et)=>finalizeProperty(i,a,s,rt,et,o)),s;if(a.scope_!==i)return s;if(!a.modified_)return maybeFreeze(i,a.base_,!0),a.base_;if(!a.finalized_){a.finalized_=!0,a.scope_.unfinalizedDrafts_--;const rt=a.copy_;let et=rt,ot=!1;a.type_===3&&(et=new Set(rt),rt.clear(),ot=!0),each(et,(at,nt)=>finalizeProperty(i,a,rt,at,nt,o,ot)),maybeFreeze(i,rt,!1),o&&i.patches_&&getPlugin("Patches").generatePatches_(a,o,i.patches_,i.inversePatches_)}return a.copy_}function finalizeProperty(i,s,o,a,rt,et,ot){if(isDraft(rt)){const at=et&&s&&s.type_!==3&&!has(s.assigned_,a)?et.concat(a):void 0,nt=finalize(i,rt,at);if(set(o,a,nt),isDraft(nt))i.canAutoFreeze_=!1;else return}else ot&&o.add(rt);if(isDraftable(rt)&&!isFrozen(rt)){if(!i.immer_.autoFreeze_&&i.unfinalizedDrafts_<1)return;finalize(i,rt),(!s||!s.scope_.parent_)&&typeof a!="symbol"&&Object.prototype.propertyIsEnumerable.call(o,a)&&maybeFreeze(i,rt)}}function maybeFreeze(i,s,o=!1){!i.parent_&&i.immer_.autoFreeze_&&i.canAutoFreeze_&&freeze(s,o)}function createProxyProxy(i,s){const o=Array.isArray(i),a={type_:o?1:0,scope_:s?s.scope_:getCurrentScope(),modified_:!1,finalized_:!1,assigned_:{},parent_:s,base_:i,draft_:null,copy_:null,revoke_:null,isManual_:!1};let rt=a,et=objectTraps;o&&(rt=[a],et=arrayTraps);const{revoke:ot,proxy:at}=Proxy.revocable(rt,et);return a.draft_=at,a.revoke_=ot,at}var objectTraps={get(i,s){if(s===DRAFT_STATE)return i;const o=latest(i);if(!has(o,s))return readPropFromProto(i,o,s);const a=o[s];return i.finalized_||!isDraftable(a)?a:a===peek(i.base_,s)?(prepareCopy(i),i.copy_[s]=createProxy(a,i)):a},has(i,s){return s in latest(i)},ownKeys(i){return Reflect.ownKeys(latest(i))},set(i,s,o){const a=getDescriptorFromProto(latest(i),s);if(a!=null&&a.set)return a.set.call(i.draft_,o),!0;if(!i.modified_){const rt=peek(latest(i),s),et=rt==null?void 0:rt[DRAFT_STATE];if(et&&et.base_===o)return i.copy_[s]=o,i.assigned_[s]=!1,!0;if(is(o,rt)&&(o!==void 0||has(i.base_,s)))return!0;prepareCopy(i),markChanged(i)}return i.copy_[s]===o&&(o!==void 0||s in i.copy_)||Number.isNaN(o)&&Number.isNaN(i.copy_[s])||(i.copy_[s]=o,i.assigned_[s]=!0),!0},deleteProperty(i,s){return peek(i.base_,s)!==void 0||s in i.base_?(i.assigned_[s]=!1,prepareCopy(i),markChanged(i)):delete i.assigned_[s],i.copy_&&delete i.copy_[s],!0},getOwnPropertyDescriptor(i,s){const o=latest(i),a=Reflect.getOwnPropertyDescriptor(o,s);return a&&{writable:!0,configurable:i.type_!==1||s!=="length",enumerable:a.enumerable,value:o[s]}},defineProperty(){die(11)},getPrototypeOf(i){return getPrototypeOf(i.base_)},setPrototypeOf(){die(12)}},arrayTraps={};each(objectTraps,(i,s)=>{arrayTraps[i]=function(){return arguments[0]=arguments[0][0],s.apply(this,arguments)}});arrayTraps.deleteProperty=function(i,s){return arrayTraps.set.call(this,i,s,void 0)};arrayTraps.set=function(i,s,o){return objectTraps.set.call(this,i[0],s,o,i[0])};function peek(i,s){const o=i[DRAFT_STATE];return(o?latest(o):i)[s]}function readPropFromProto(i,s,o){var rt;const a=getDescriptorFromProto(s,o);return a?"value"in a?a.value:(rt=a.get)==null?void 0:rt.call(i.draft_):void 0}function getDescriptorFromProto(i,s){if(!(s in i))return;let o=getPrototypeOf(i);for(;o;){const a=Object.getOwnPropertyDescriptor(o,s);if(a)return a;o=getPrototypeOf(o)}}function markChanged(i){i.modified_||(i.modified_=!0,i.parent_&&markChanged(i.parent_))}function prepareCopy(i){i.copy_||(i.copy_=shallowCopy(i.base_,i.scope_.immer_.useStrictShallowCopy_))}var Immer2=class{constructor(i){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(s,o,a)=>{if(typeof s=="function"&&typeof o!="function"){const et=o;o=s;const ot=this;return function(nt=et,...it){return ot.produce(nt,j=>o.call(this,j,...it))}}typeof o!="function"&&die(6),a!==void 0&&typeof a!="function"&&die(7);let rt;if(isDraftable(s)){const et=enterScope(this),ot=createProxy(s,void 0);let at=!0;try{rt=o(ot),at=!1}finally{at?revokeScope(et):leaveScope(et)}return usePatchesInScope(et,a),processResult(rt,et)}else if(!s||typeof s!="object"){if(rt=o(s),rt===void 0&&(rt=s),rt===NOTHING&&(rt=void 0),this.autoFreeze_&&freeze(rt,!0),a){const et=[],ot=[];getPlugin("Patches").generateReplacementPatches_(s,rt,et,ot),a(et,ot)}return rt}else die(1,s)},this.produceWithPatches=(s,o)=>{if(typeof s=="function")return(ot,...at)=>this.produceWithPatches(ot,nt=>s(nt,...at));let a,rt;return[this.produce(s,o,(ot,at)=>{a=ot,rt=at}),a,rt]},typeof(i==null?void 0:i.autoFreeze)=="boolean"&&this.setAutoFreeze(i.autoFreeze),typeof(i==null?void 0:i.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(i.useStrictShallowCopy)}createDraft(i){isDraftable(i)||die(8),isDraft(i)&&(i=current(i));const s=enterScope(this),o=createProxy(i,void 0);return o[DRAFT_STATE].isManual_=!0,leaveScope(s),o}finishDraft(i,s){const o=i&&i[DRAFT_STATE];(!o||!o.isManual_)&&die(9);const{scope_:a}=o;return usePatchesInScope(a,s),processResult(void 0,a)}setAutoFreeze(i){this.autoFreeze_=i}setUseStrictShallowCopy(i){this.useStrictShallowCopy_=i}applyPatches(i,s){let o;for(o=s.length-1;o>=0;o--){const rt=s[o];if(rt.path.length===0&&rt.op==="replace"){i=rt.value;break}}o>-1&&(s=s.slice(o+1));const a=getPlugin("Patches").applyPatches_;return isDraft(i)?a(i,s):this.produce(i,rt=>a(rt,s))}};function createProxy(i,s){const o=isMap(i)?getPlugin("MapSet").proxyMap_(i,s):isSet(i)?getPlugin("MapSet").proxySet_(i,s):createProxyProxy(i,s);return(s?s.scope_:getCurrentScope()).drafts_.push(o),o}function current(i){return isDraft(i)||die(10,i),currentImpl(i)}function currentImpl(i){if(!isDraftable(i)||isFrozen(i))return i;const s=i[DRAFT_STATE];let o;if(s){if(!s.modified_)return s.base_;s.finalized_=!0,o=shallowCopy(i,s.scope_.immer_.useStrictShallowCopy_)}else o=shallowCopy(i,!0);return each(o,(a,rt)=>{set(o,a,currentImpl(rt))}),s&&(s.finalized_=!1),o}var immer=new Immer2,produce=immer.produce;immer.produceWithPatches.bind(immer);immer.setAutoFreeze.bind(immer);immer.setUseStrictShallowCopy.bind(immer);immer.applyPatches.bind(immer);immer.createDraft.bind(immer);immer.finishDraft.bind(immer);function createThunkMiddleware(i){return({dispatch:o,getState:a})=>rt=>et=>typeof et=="function"?et(o,a,i):rt(et)}var thunk=createThunkMiddleware(),withExtraArgument=createThunkMiddleware,composeWithDevTools=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?compose:compose.apply(null,arguments)};function createAction(i,s){function o(...a){if(s){let rt=s(...a);if(!rt)throw new Error(formatProdErrorMessage(0));return{type:i,payload:rt.payload,..."meta"in rt&&{meta:rt.meta},..."error"in rt&&{error:rt.error}}}return{type:i,payload:a[0]}}return o.toString=()=>`${i}`,o.type=i,o.match=a=>isAction(a)&&a.type===i,o}var Tuple=class Hl extends Array{constructor(...s){super(...s),Object.setPrototypeOf(this,Hl.prototype)}static get[Symbol.species](){return Hl}concat(...s){return super.concat.apply(this,s)}prepend(...s){return s.length===1&&Array.isArray(s[0])?new Hl(...s[0].concat(this)):new Hl(...s.concat(this))}};function freezeDraftable(i){return isDraftable(i)?produce(i,()=>{}):i}function emplace(i,s,o){if(i.has(s)){let rt=i.get(s);return o.update&&(rt=o.update(rt,s,i),i.set(s,rt)),rt}if(!o.insert)throw new Error(formatProdErrorMessage(10));const a=o.insert(s,i);return i.set(s,a),a}function isBoolean(i){return typeof i=="boolean"}var buildGetDefaultMiddleware=()=>function(s){const{thunk:o=!0,immutableCheck:a=!0,serializableCheck:rt=!0,actionCreatorCheck:et=!0}=s??{};let ot=new Tuple;return o&&(isBoolean(o)?ot.push(thunk):ot.push(withExtraArgument(o.extraArgument))),ot},SHOULD_AUTOBATCH="RTK_autoBatch",createQueueWithTimer=i=>s=>{setTimeout(s,i)},rAF=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:createQueueWithTimer(10),autoBatchEnhancer=(i={type:"raf"})=>s=>(...o)=>{const a=s(...o);let rt=!0,et=!1,ot=!1;const at=new Set,nt=i.type==="tick"?queueMicrotask:i.type==="raf"?rAF:i.type==="callback"?i.queueNotification:createQueueWithTimer(i.timeout),it=()=>{ot=!1,et&&(et=!1,at.forEach(j=>j()))};return Object.assign({},a,{subscribe(j){const _=()=>rt&&j(),$=a.subscribe(_);return at.add(j),()=>{$(),at.delete(j)}},dispatch(j){var _;try{return rt=!((_=j==null?void 0:j.meta)!=null&&_[SHOULD_AUTOBATCH]),et=!rt,et&&(ot||(ot=!0,nt(it))),a.dispatch(j)}finally{rt=!0}}})},buildGetDefaultEnhancers=i=>function(o){const{autoBatch:a=!0}=o??{};let rt=new Tuple(i);return a&&rt.push(autoBatchEnhancer(typeof a=="object"?a:void 0)),rt};function configureStore(i){const s=buildGetDefaultMiddleware(),{reducer:o=void 0,middleware:a,devTools:rt=!0,preloadedState:et=void 0,enhancers:ot=void 0}=i||{};let at;if(typeof o=="function")at=o;else if(isPlainObject$1(o))at=combineReducers(o);else throw new Error(formatProdErrorMessage(1));let nt;typeof a=="function"?nt=a(s):nt=s();let it=compose;rt&&(it=composeWithDevTools({trace:!1,...typeof rt=="object"&&rt}));const j=applyMiddleware(...nt),_=buildGetDefaultEnhancers(j);let $=typeof ot=="function"?ot(_):_();const tt=it(...$);return createStore(at,et,tt)}function executeReducerBuilderCallback(i){const s={},o=[];let a;const rt={addCase(et,ot){const at=typeof et=="string"?et:et.type;if(!at)throw new Error(formatProdErrorMessage(28));if(at in s)throw new Error(formatProdErrorMessage(29));return s[at]=ot,rt},addMatcher(et,ot){return o.push({matcher:et,reducer:ot}),rt},addDefaultCase(et){return a=et,rt}};return i(rt),[s,o,a]}function isStateFunction(i){return typeof i=="function"}function createReducer(i,s){let[o,a,rt]=executeReducerBuilderCallback(s),et;if(isStateFunction(i))et=()=>freezeDraftable(i());else{const at=freezeDraftable(i);et=()=>at}function ot(at=et(),nt){let it=[o[nt.type],...a.filter(({matcher:j})=>j(nt)).map(({reducer:j})=>j)];return it.filter(j=>!!j).length===0&&(it=[rt]),it.reduce((j,_)=>{if(_)if(isDraft(j)){const tt=_(j,nt);return tt===void 0?j:tt}else{if(isDraftable(j))return produce(j,$=>_($,nt));{const $=_(j,nt);if($===void 0){if(j===null)return j;throw new Error(formatProdErrorMessage(9))}return $}}return j},at)}return ot.getInitialState=et,ot}var asyncThunkSymbol=Symbol.for("rtk-slice-createasyncthunk");function getType(i,s){return`${i}/${s}`}function buildCreateSlice({creators:i}={}){var o;const s=(o=i==null?void 0:i.asyncThunk)==null?void 0:o[asyncThunkSymbol];return function(rt){const{name:et,reducerPath:ot=et}=rt;if(!et)throw new Error(formatProdErrorMessage(11));typeof process<"u";const at=(typeof rt.reducers=="function"?rt.reducers(buildReducerCreators()):rt.reducers)||{},nt=Object.keys(at),it={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},j={addCase(pt,mt){const gt=typeof pt=="string"?pt:pt.type;if(!gt)throw new Error(formatProdErrorMessage(12));if(gt in it.sliceCaseReducersByType)throw new Error(formatProdErrorMessage(13));return it.sliceCaseReducersByType[gt]=mt,j},addMatcher(pt,mt){return it.sliceMatchers.push({matcher:pt,reducer:mt}),j},exposeAction(pt,mt){return it.actionCreators[pt]=mt,j},exposeCaseReducer(pt,mt){return it.sliceCaseReducersByName[pt]=mt,j}};nt.forEach(pt=>{const mt=at[pt],gt={reducerName:pt,type:getType(et,pt),createNotation:typeof rt.reducers=="function"};isAsyncThunkSliceReducerDefinition(mt)?handleThunkCaseReducerDefinition(gt,mt,j,s):handleNormalReducerDefinition(gt,mt,j)});function _(){const[pt={},mt=[],gt=void 0]=typeof rt.extraReducers=="function"?executeReducerBuilderCallback(rt.extraReducers):[rt.extraReducers],dt={...pt,...it.sliceCaseReducersByType};return createReducer(rt.initialState,St=>{for(let xt in dt)St.addCase(xt,dt[xt]);for(let xt of it.sliceMatchers)St.addMatcher(xt.matcher,xt.reducer);for(let xt of mt)St.addMatcher(xt.matcher,xt.reducer);gt&&St.addDefaultCase(gt)})}const $=pt=>pt,tt=new Map;let st;function lt(pt,mt){return st||(st=_()),st(pt,mt)}function ct(){return st||(st=_()),st.getInitialState()}function ht(pt,mt=!1){function gt(St){let xt=St[pt];return typeof xt>"u"&&mt&&(xt=ct()),xt}function dt(St=$){const xt=emplace(tt,mt,{insert:()=>new WeakMap});return emplace(xt,St,{insert:()=>{const yt={};for(const[_t,Ct]of Object.entries(rt.selectors??{}))yt[_t]=wrapSelector(Ct,St,ct,mt);return yt}})}return{reducerPath:pt,getSelectors:dt,get selectors(){return dt(gt)},selectSlice:gt}}const ut={name:et,reducer:lt,actions:it.actionCreators,caseReducers:it.sliceCaseReducersByName,getInitialState:ct,...ht(ot),injectInto(pt,{reducerPath:mt,...gt}={}){const dt=mt??ot;return pt.inject({reducerPath:dt,reducer:lt},gt),{...ut,...ht(dt,!0)}}};return ut}}function wrapSelector(i,s,o,a){function rt(et,...ot){let at=s(et);return typeof at>"u"&&a&&(at=o()),i(at,...ot)}return rt.unwrapped=i,rt}var createSlice=buildCreateSlice();function buildReducerCreators(){function i(s,o){return{_reducerDefinitionType:"asyncThunk",payloadCreator:s,...o}}return i.withTypes=()=>i,{reducer(s){return Object.assign({[s.name](...o){return s(...o)}}[s.name],{_reducerDefinitionType:"reducer"})},preparedReducer(s,o){return{_reducerDefinitionType:"reducerWithPrepare",prepare:s,reducer:o}},asyncThunk:i}}function handleNormalReducerDefinition({type:i,reducerName:s,createNotation:o},a,rt){let et,ot;if("reducer"in a){if(o&&!isCaseReducerWithPrepareDefinition(a))throw new Error(formatProdErrorMessage(17));et=a.reducer,ot=a.prepare}else et=a;rt.addCase(i,et).exposeCaseReducer(s,et).exposeAction(s,ot?createAction(i,ot):createAction(i))}function isAsyncThunkSliceReducerDefinition(i){return i._reducerDefinitionType==="asyncThunk"}function isCaseReducerWithPrepareDefinition(i){return i._reducerDefinitionType==="reducerWithPrepare"}function handleThunkCaseReducerDefinition({type:i,reducerName:s},o,a,rt){if(!rt)throw new Error(formatProdErrorMessage(18));const{payloadCreator:et,fulfilled:ot,pending:at,rejected:nt,settled:it,options:j}=o,_=rt(i,et,j);a.exposeAction(s,_),ot&&a.addCase(_.fulfilled,ot),at&&a.addCase(_.pending,at),nt&&a.addCase(_.rejected,nt),it&&a.addMatcher(_.settled,it),a.exposeCaseReducer(s,{fulfilled:ot||noop,pending:at||noop,rejected:nt||noop,settled:it||noop})}function noop(){}function formatProdErrorMessage(i){return`Minified Redux Toolkit error #${i}; visit https://redux-toolkit.js.org/Errors?code=${i} for the full message or use the non-minified dev environment for full errors. `}const loadSamplePythonPrograms=async()=>(await __vitePreload(async()=>{const{samplePythonPrograms:i}=await import("./index-CxR4alL1.js");return{samplePythonPrograms:i}},[])).samplePythonPrograms,loadSampleSourceThreePrograms=async()=>(await __vitePreload(async()=>{const{sampleSourceThreePrograms:i}=await import("./index-OcF0Dhf2.js");return{sampleSourceThreePrograms:i}},[])).sampleSourceThreePrograms;let samplePythonPrograms,sampleSourceThreePrograms;const sampleProgramLoader=async i=>{switch(i){case Languages.PYTHON:return samplePythonPrograms===void 0&&(samplePythonPrograms=await loadSamplePythonPrograms()),samplePythonPrograms;case Languages.SOURCE_THREE_INTERPRETER:return sampleSourceThreePrograms===void 0&&(sampleSourceThreePrograms=await loadSampleSourceThreePrograms()),sampleSourceThreePrograms}},defaultPrograms=Object.freeze({[Languages.PYTHON]:`# Write your Python program here! +`}),ace.define("ace/theme/tomorrow_night_eighties",["require","exports","module","ace/theme/tomorrow_night_eighties-css","ace/lib/dom"],function(o,a,rt){a.isDark=!0,a.cssClass="ace-tomorrow-night-eighties",a.cssText=o("./tomorrow_night_eighties-css");var tt=o("../lib/dom");tt.importCssString(a.cssText,a.cssClass,!1)}),function(){ace.require(["ace/theme/tomorrow_night_eighties"],function(o){i&&(i.exports=o)})}()})(themeTomorrow_night_eighties);const Editor=i=>{const s=useTypedSelector(a=>a.workspace.currentLanguage),{colorMode:o}=useColorMode();return jsxRuntimeExports.jsx(_default,{mode:languageToModeMap[s],theme:o==="dark"?"dracula":"tomorrow_night_eighties",fontSize:15,width:"100%",...i})},JsonDisplay=({jsonProgram:i})=>jsxRuntimeExports.jsx(Card,{children:jsxRuntimeExports.jsxs(CardBody,{children:[jsxRuntimeExports.jsx(Text,{children:"JSON Code:"}),jsxRuntimeExports.jsx(Box,{overflowX:"scroll",children:jsxRuntimeExports.jsx(Code,{display:"block",whiteSpace:"pre",width:"max-content",children:i})})]})});function formatProdErrorMessage$1(i){return`Minified Redux error #${i}; visit https://redux.js.org/Errors?code=${i} for the full message or use the non-minified dev environment for full errors. `}var $$observable=typeof Symbol=="function"&&Symbol.observable||"@@observable",symbol_observable_default=$$observable,randomString=()=>Math.random().toString(36).substring(7).split("").join("."),ActionTypes={INIT:`@@redux/INIT${randomString()}`,REPLACE:`@@redux/REPLACE${randomString()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${randomString()}`},actionTypes_default=ActionTypes;function isPlainObject$1(i){if(typeof i!="object"||i===null)return!1;let s=i;for(;Object.getPrototypeOf(s)!==null;)s=Object.getPrototypeOf(s);return Object.getPrototypeOf(i)===s||Object.getPrototypeOf(i)===null}function createStore(i,s,o){if(typeof i!="function")throw new Error(formatProdErrorMessage$1(2));if(typeof s=="function"&&typeof o=="function"||typeof o=="function"&&typeof arguments[3]=="function")throw new Error(formatProdErrorMessage$1(0));if(typeof s=="function"&&typeof o>"u"&&(o=s,s=void 0),typeof o<"u"){if(typeof o!="function")throw new Error(formatProdErrorMessage$1(1));return o(createStore)(i,s)}let a=i,rt=s,tt=new Map,ot=tt,at=0,nt=!1;function it(){ot===tt&&(ot=new Map,tt.forEach((ct,ht)=>{ot.set(ht,ct)}))}function j(){if(nt)throw new Error(formatProdErrorMessage$1(3));return rt}function _(ct){if(typeof ct!="function")throw new Error(formatProdErrorMessage$1(4));if(nt)throw new Error(formatProdErrorMessage$1(5));let ht=!0;it();const ut=at++;return ot.set(ut,ct),function(){if(ht){if(nt)throw new Error(formatProdErrorMessage$1(6));ht=!1,it(),ot.delete(ut),tt=null}}}function $(ct){if(!isPlainObject$1(ct))throw new Error(formatProdErrorMessage$1(7));if(typeof ct.type>"u")throw new Error(formatProdErrorMessage$1(8));if(typeof ct.type!="string")throw new Error(formatProdErrorMessage$1(17));if(nt)throw new Error(formatProdErrorMessage$1(9));try{nt=!0,rt=a(rt,ct)}finally{nt=!1}return(tt=ot).forEach(ut=>{ut()}),ct}function et(ct){if(typeof ct!="function")throw new Error(formatProdErrorMessage$1(10));a=ct,$({type:actionTypes_default.REPLACE})}function st(){const ct=_;return{subscribe(ht){if(typeof ht!="object"||ht===null)throw new Error(formatProdErrorMessage$1(11));function ut(){const mt=ht;mt.next&&mt.next(j())}return ut(),{unsubscribe:ct(ut)}},[symbol_observable_default](){return this}}}return $({type:actionTypes_default.INIT}),{dispatch:$,subscribe:_,getState:j,replaceReducer:et,[symbol_observable_default]:st}}function assertReducerShape(i){Object.keys(i).forEach(s=>{const o=i[s];if(typeof o(void 0,{type:actionTypes_default.INIT})>"u")throw new Error(formatProdErrorMessage$1(12));if(typeof o(void 0,{type:actionTypes_default.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(formatProdErrorMessage$1(13))})}function combineReducers(i){const s=Object.keys(i),o={};for(let tt=0;tt"u")throw at&&at.type,new Error(formatProdErrorMessage$1(14));it[_]=st,nt=nt||st!==et}return nt=nt||a.length!==Object.keys(ot).length,nt?it:ot}}function compose(...i){return i.length===0?s=>s:i.length===1?i[0]:i.reduce((s,o)=>(...a)=>s(o(...a)))}function applyMiddleware(...i){return s=>(o,a)=>{const rt=s(o,a);let tt=()=>{throw new Error(formatProdErrorMessage$1(15))};const ot={getState:rt.getState,dispatch:(nt,...it)=>tt(nt,...it)},at=i.map(nt=>nt(ot));return tt=compose(...at)(rt.dispatch),{...rt,dispatch:tt}}}function isAction(i){return isPlainObject$1(i)&&"type"in i&&typeof i.type=="string"}var NOTHING=Symbol.for("immer-nothing"),DRAFTABLE=Symbol.for("immer-draftable"),DRAFT_STATE=Symbol.for("immer-state");function die(i,...s){throw new Error(`[Immer] minified error nr: ${i}. Full error at: https://bit.ly/3cXEKWf`)}var getPrototypeOf=Object.getPrototypeOf;function isDraft(i){return!!i&&!!i[DRAFT_STATE]}function isDraftable(i){var s;return i?isPlainObject(i)||Array.isArray(i)||!!i[DRAFTABLE]||!!((s=i.constructor)!=null&&s[DRAFTABLE])||isMap(i)||isSet(i):!1}var objectCtorString=Object.prototype.constructor.toString();function isPlainObject(i){if(!i||typeof i!="object")return!1;const s=getPrototypeOf(i);if(s===null)return!0;const o=Object.hasOwnProperty.call(s,"constructor")&&s.constructor;return o===Object?!0:typeof o=="function"&&Function.toString.call(o)===objectCtorString}function each(i,s){getArchtype(i)===0?Reflect.ownKeys(i).forEach(o=>{s(o,i[o],i)}):i.forEach((o,a)=>s(a,o,i))}function getArchtype(i){const s=i[DRAFT_STATE];return s?s.type_:Array.isArray(i)?1:isMap(i)?2:isSet(i)?3:0}function has(i,s){return getArchtype(i)===2?i.has(s):Object.prototype.hasOwnProperty.call(i,s)}function set(i,s,o){const a=getArchtype(i);a===2?i.set(s,o):a===3?i.add(o):i[s]=o}function is(i,s){return i===s?i!==0||1/i===1/s:i!==i&&s!==s}function isMap(i){return i instanceof Map}function isSet(i){return i instanceof Set}function latest(i){return i.copy_||i.base_}function shallowCopy(i,s){if(isMap(i))return new Map(i);if(isSet(i))return new Set(i);if(Array.isArray(i))return Array.prototype.slice.call(i);const o=isPlainObject(i);if(s===!0||s==="class_only"&&!o){const a=Object.getOwnPropertyDescriptors(i);delete a[DRAFT_STATE];let rt=Reflect.ownKeys(a);for(let tt=0;tt1&&(i.set=i.add=i.clear=i.delete=dontMutateFrozenCollections),Object.freeze(i),s&&Object.entries(i).forEach(([o,a])=>freeze(a,!0))),i}function dontMutateFrozenCollections(){die(2)}function isFrozen(i){return Object.isFrozen(i)}var plugins={};function getPlugin(i){const s=plugins[i];return s||die(0,i),s}var currentScope;function getCurrentScope(){return currentScope}function createScope(i,s){return{drafts_:[],parent_:i,immer_:s,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function usePatchesInScope(i,s){s&&(getPlugin("Patches"),i.patches_=[],i.inversePatches_=[],i.patchListener_=s)}function revokeScope(i){leaveScope(i),i.drafts_.forEach(revokeDraft),i.drafts_=null}function leaveScope(i){i===currentScope&&(currentScope=i.parent_)}function enterScope(i){return currentScope=createScope(currentScope,i)}function revokeDraft(i){const s=i[DRAFT_STATE];s.type_===0||s.type_===1?s.revoke_():s.revoked_=!0}function processResult(i,s){s.unfinalizedDrafts_=s.drafts_.length;const o=s.drafts_[0];return i!==void 0&&i!==o?(o[DRAFT_STATE].modified_&&(revokeScope(s),die(4)),isDraftable(i)&&(i=finalize(s,i),s.parent_||maybeFreeze(s,i)),s.patches_&&getPlugin("Patches").generateReplacementPatches_(o[DRAFT_STATE].base_,i,s.patches_,s.inversePatches_)):i=finalize(s,o,[]),revokeScope(s),s.patches_&&s.patchListener_(s.patches_,s.inversePatches_),i!==NOTHING?i:void 0}function finalize(i,s,o){if(isFrozen(s))return s;const a=s[DRAFT_STATE];if(!a)return each(s,(rt,tt)=>finalizeProperty(i,a,s,rt,tt,o)),s;if(a.scope_!==i)return s;if(!a.modified_)return maybeFreeze(i,a.base_,!0),a.base_;if(!a.finalized_){a.finalized_=!0,a.scope_.unfinalizedDrafts_--;const rt=a.copy_;let tt=rt,ot=!1;a.type_===3&&(tt=new Set(rt),rt.clear(),ot=!0),each(tt,(at,nt)=>finalizeProperty(i,a,rt,at,nt,o,ot)),maybeFreeze(i,rt,!1),o&&i.patches_&&getPlugin("Patches").generatePatches_(a,o,i.patches_,i.inversePatches_)}return a.copy_}function finalizeProperty(i,s,o,a,rt,tt,ot){if(isDraft(rt)){const at=tt&&s&&s.type_!==3&&!has(s.assigned_,a)?tt.concat(a):void 0,nt=finalize(i,rt,at);if(set(o,a,nt),isDraft(nt))i.canAutoFreeze_=!1;else return}else ot&&o.add(rt);if(isDraftable(rt)&&!isFrozen(rt)){if(!i.immer_.autoFreeze_&&i.unfinalizedDrafts_<1)return;finalize(i,rt),(!s||!s.scope_.parent_)&&typeof a!="symbol"&&Object.prototype.propertyIsEnumerable.call(o,a)&&maybeFreeze(i,rt)}}function maybeFreeze(i,s,o=!1){!i.parent_&&i.immer_.autoFreeze_&&i.canAutoFreeze_&&freeze(s,o)}function createProxyProxy(i,s){const o=Array.isArray(i),a={type_:o?1:0,scope_:s?s.scope_:getCurrentScope(),modified_:!1,finalized_:!1,assigned_:{},parent_:s,base_:i,draft_:null,copy_:null,revoke_:null,isManual_:!1};let rt=a,tt=objectTraps;o&&(rt=[a],tt=arrayTraps);const{revoke:ot,proxy:at}=Proxy.revocable(rt,tt);return a.draft_=at,a.revoke_=ot,at}var objectTraps={get(i,s){if(s===DRAFT_STATE)return i;const o=latest(i);if(!has(o,s))return readPropFromProto(i,o,s);const a=o[s];return i.finalized_||!isDraftable(a)?a:a===peek(i.base_,s)?(prepareCopy(i),i.copy_[s]=createProxy(a,i)):a},has(i,s){return s in latest(i)},ownKeys(i){return Reflect.ownKeys(latest(i))},set(i,s,o){const a=getDescriptorFromProto(latest(i),s);if(a!=null&&a.set)return a.set.call(i.draft_,o),!0;if(!i.modified_){const rt=peek(latest(i),s),tt=rt==null?void 0:rt[DRAFT_STATE];if(tt&&tt.base_===o)return i.copy_[s]=o,i.assigned_[s]=!1,!0;if(is(o,rt)&&(o!==void 0||has(i.base_,s)))return!0;prepareCopy(i),markChanged(i)}return i.copy_[s]===o&&(o!==void 0||s in i.copy_)||Number.isNaN(o)&&Number.isNaN(i.copy_[s])||(i.copy_[s]=o,i.assigned_[s]=!0),!0},deleteProperty(i,s){return peek(i.base_,s)!==void 0||s in i.base_?(i.assigned_[s]=!1,prepareCopy(i),markChanged(i)):delete i.assigned_[s],i.copy_&&delete i.copy_[s],!0},getOwnPropertyDescriptor(i,s){const o=latest(i),a=Reflect.getOwnPropertyDescriptor(o,s);return a&&{writable:!0,configurable:i.type_!==1||s!=="length",enumerable:a.enumerable,value:o[s]}},defineProperty(){die(11)},getPrototypeOf(i){return getPrototypeOf(i.base_)},setPrototypeOf(){die(12)}},arrayTraps={};each(objectTraps,(i,s)=>{arrayTraps[i]=function(){return arguments[0]=arguments[0][0],s.apply(this,arguments)}});arrayTraps.deleteProperty=function(i,s){return arrayTraps.set.call(this,i,s,void 0)};arrayTraps.set=function(i,s,o){return objectTraps.set.call(this,i[0],s,o,i[0])};function peek(i,s){const o=i[DRAFT_STATE];return(o?latest(o):i)[s]}function readPropFromProto(i,s,o){var rt;const a=getDescriptorFromProto(s,o);return a?"value"in a?a.value:(rt=a.get)==null?void 0:rt.call(i.draft_):void 0}function getDescriptorFromProto(i,s){if(!(s in i))return;let o=getPrototypeOf(i);for(;o;){const a=Object.getOwnPropertyDescriptor(o,s);if(a)return a;o=getPrototypeOf(o)}}function markChanged(i){i.modified_||(i.modified_=!0,i.parent_&&markChanged(i.parent_))}function prepareCopy(i){i.copy_||(i.copy_=shallowCopy(i.base_,i.scope_.immer_.useStrictShallowCopy_))}var Immer2=class{constructor(i){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(s,o,a)=>{if(typeof s=="function"&&typeof o!="function"){const tt=o;o=s;const ot=this;return function(nt=tt,...it){return ot.produce(nt,j=>o.call(this,j,...it))}}typeof o!="function"&&die(6),a!==void 0&&typeof a!="function"&&die(7);let rt;if(isDraftable(s)){const tt=enterScope(this),ot=createProxy(s,void 0);let at=!0;try{rt=o(ot),at=!1}finally{at?revokeScope(tt):leaveScope(tt)}return usePatchesInScope(tt,a),processResult(rt,tt)}else if(!s||typeof s!="object"){if(rt=o(s),rt===void 0&&(rt=s),rt===NOTHING&&(rt=void 0),this.autoFreeze_&&freeze(rt,!0),a){const tt=[],ot=[];getPlugin("Patches").generateReplacementPatches_(s,rt,tt,ot),a(tt,ot)}return rt}else die(1,s)},this.produceWithPatches=(s,o)=>{if(typeof s=="function")return(ot,...at)=>this.produceWithPatches(ot,nt=>s(nt,...at));let a,rt;return[this.produce(s,o,(ot,at)=>{a=ot,rt=at}),a,rt]},typeof(i==null?void 0:i.autoFreeze)=="boolean"&&this.setAutoFreeze(i.autoFreeze),typeof(i==null?void 0:i.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(i.useStrictShallowCopy)}createDraft(i){isDraftable(i)||die(8),isDraft(i)&&(i=current(i));const s=enterScope(this),o=createProxy(i,void 0);return o[DRAFT_STATE].isManual_=!0,leaveScope(s),o}finishDraft(i,s){const o=i&&i[DRAFT_STATE];(!o||!o.isManual_)&&die(9);const{scope_:a}=o;return usePatchesInScope(a,s),processResult(void 0,a)}setAutoFreeze(i){this.autoFreeze_=i}setUseStrictShallowCopy(i){this.useStrictShallowCopy_=i}applyPatches(i,s){let o;for(o=s.length-1;o>=0;o--){const rt=s[o];if(rt.path.length===0&&rt.op==="replace"){i=rt.value;break}}o>-1&&(s=s.slice(o+1));const a=getPlugin("Patches").applyPatches_;return isDraft(i)?a(i,s):this.produce(i,rt=>a(rt,s))}};function createProxy(i,s){const o=isMap(i)?getPlugin("MapSet").proxyMap_(i,s):isSet(i)?getPlugin("MapSet").proxySet_(i,s):createProxyProxy(i,s);return(s?s.scope_:getCurrentScope()).drafts_.push(o),o}function current(i){return isDraft(i)||die(10,i),currentImpl(i)}function currentImpl(i){if(!isDraftable(i)||isFrozen(i))return i;const s=i[DRAFT_STATE];let o;if(s){if(!s.modified_)return s.base_;s.finalized_=!0,o=shallowCopy(i,s.scope_.immer_.useStrictShallowCopy_)}else o=shallowCopy(i,!0);return each(o,(a,rt)=>{set(o,a,currentImpl(rt))}),s&&(s.finalized_=!1),o}var immer=new Immer2,produce=immer.produce;immer.produceWithPatches.bind(immer);immer.setAutoFreeze.bind(immer);immer.setUseStrictShallowCopy.bind(immer);immer.applyPatches.bind(immer);immer.createDraft.bind(immer);immer.finishDraft.bind(immer);function createThunkMiddleware(i){return({dispatch:o,getState:a})=>rt=>tt=>typeof tt=="function"?tt(o,a,i):rt(tt)}var thunk=createThunkMiddleware(),withExtraArgument=createThunkMiddleware,composeWithDevTools=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?compose:compose.apply(null,arguments)};function createAction(i,s){function o(...a){if(s){let rt=s(...a);if(!rt)throw new Error(formatProdErrorMessage(0));return{type:i,payload:rt.payload,..."meta"in rt&&{meta:rt.meta},..."error"in rt&&{error:rt.error}}}return{type:i,payload:a[0]}}return o.toString=()=>`${i}`,o.type=i,o.match=a=>isAction(a)&&a.type===i,o}var Tuple=class Hl extends Array{constructor(...s){super(...s),Object.setPrototypeOf(this,Hl.prototype)}static get[Symbol.species](){return Hl}concat(...s){return super.concat.apply(this,s)}prepend(...s){return s.length===1&&Array.isArray(s[0])?new Hl(...s[0].concat(this)):new Hl(...s.concat(this))}};function freezeDraftable(i){return isDraftable(i)?produce(i,()=>{}):i}function emplace(i,s,o){if(i.has(s)){let rt=i.get(s);return o.update&&(rt=o.update(rt,s,i),i.set(s,rt)),rt}if(!o.insert)throw new Error(formatProdErrorMessage(10));const a=o.insert(s,i);return i.set(s,a),a}function isBoolean(i){return typeof i=="boolean"}var buildGetDefaultMiddleware=()=>function(s){const{thunk:o=!0,immutableCheck:a=!0,serializableCheck:rt=!0,actionCreatorCheck:tt=!0}=s??{};let ot=new Tuple;return o&&(isBoolean(o)?ot.push(thunk):ot.push(withExtraArgument(o.extraArgument))),ot},SHOULD_AUTOBATCH="RTK_autoBatch",createQueueWithTimer=i=>s=>{setTimeout(s,i)},rAF=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:createQueueWithTimer(10),autoBatchEnhancer=(i={type:"raf"})=>s=>(...o)=>{const a=s(...o);let rt=!0,tt=!1,ot=!1;const at=new Set,nt=i.type==="tick"?queueMicrotask:i.type==="raf"?rAF:i.type==="callback"?i.queueNotification:createQueueWithTimer(i.timeout),it=()=>{ot=!1,tt&&(tt=!1,at.forEach(j=>j()))};return Object.assign({},a,{subscribe(j){const _=()=>rt&&j(),$=a.subscribe(_);return at.add(j),()=>{$(),at.delete(j)}},dispatch(j){var _;try{return rt=!((_=j==null?void 0:j.meta)!=null&&_[SHOULD_AUTOBATCH]),tt=!rt,tt&&(ot||(ot=!0,nt(it))),a.dispatch(j)}finally{rt=!0}}})},buildGetDefaultEnhancers=i=>function(o){const{autoBatch:a=!0}=o??{};let rt=new Tuple(i);return a&&rt.push(autoBatchEnhancer(typeof a=="object"?a:void 0)),rt};function configureStore(i){const s=buildGetDefaultMiddleware(),{reducer:o=void 0,middleware:a,devTools:rt=!0,preloadedState:tt=void 0,enhancers:ot=void 0}=i||{};let at;if(typeof o=="function")at=o;else if(isPlainObject$1(o))at=combineReducers(o);else throw new Error(formatProdErrorMessage(1));let nt;typeof a=="function"?nt=a(s):nt=s();let it=compose;rt&&(it=composeWithDevTools({trace:!1,...typeof rt=="object"&&rt}));const j=applyMiddleware(...nt),_=buildGetDefaultEnhancers(j);let $=typeof ot=="function"?ot(_):_();const et=it(...$);return createStore(at,tt,et)}function executeReducerBuilderCallback(i){const s={},o=[];let a;const rt={addCase(tt,ot){const at=typeof tt=="string"?tt:tt.type;if(!at)throw new Error(formatProdErrorMessage(28));if(at in s)throw new Error(formatProdErrorMessage(29));return s[at]=ot,rt},addMatcher(tt,ot){return o.push({matcher:tt,reducer:ot}),rt},addDefaultCase(tt){return a=tt,rt}};return i(rt),[s,o,a]}function isStateFunction(i){return typeof i=="function"}function createReducer(i,s){let[o,a,rt]=executeReducerBuilderCallback(s),tt;if(isStateFunction(i))tt=()=>freezeDraftable(i());else{const at=freezeDraftable(i);tt=()=>at}function ot(at=tt(),nt){let it=[o[nt.type],...a.filter(({matcher:j})=>j(nt)).map(({reducer:j})=>j)];return it.filter(j=>!!j).length===0&&(it=[rt]),it.reduce((j,_)=>{if(_)if(isDraft(j)){const et=_(j,nt);return et===void 0?j:et}else{if(isDraftable(j))return produce(j,$=>_($,nt));{const $=_(j,nt);if($===void 0){if(j===null)return j;throw new Error(formatProdErrorMessage(9))}return $}}return j},at)}return ot.getInitialState=tt,ot}var asyncThunkSymbol=Symbol.for("rtk-slice-createasyncthunk");function getType(i,s){return`${i}/${s}`}function buildCreateSlice({creators:i}={}){var o;const s=(o=i==null?void 0:i.asyncThunk)==null?void 0:o[asyncThunkSymbol];return function(rt){const{name:tt,reducerPath:ot=tt}=rt;if(!tt)throw new Error(formatProdErrorMessage(11));typeof process<"u";const at=(typeof rt.reducers=="function"?rt.reducers(buildReducerCreators()):rt.reducers)||{},nt=Object.keys(at),it={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},j={addCase(pt,mt){const gt=typeof pt=="string"?pt:pt.type;if(!gt)throw new Error(formatProdErrorMessage(12));if(gt in it.sliceCaseReducersByType)throw new Error(formatProdErrorMessage(13));return it.sliceCaseReducersByType[gt]=mt,j},addMatcher(pt,mt){return it.sliceMatchers.push({matcher:pt,reducer:mt}),j},exposeAction(pt,mt){return it.actionCreators[pt]=mt,j},exposeCaseReducer(pt,mt){return it.sliceCaseReducersByName[pt]=mt,j}};nt.forEach(pt=>{const mt=at[pt],gt={reducerName:pt,type:getType(tt,pt),createNotation:typeof rt.reducers=="function"};isAsyncThunkSliceReducerDefinition(mt)?handleThunkCaseReducerDefinition(gt,mt,j,s):handleNormalReducerDefinition(gt,mt,j)});function _(){const[pt={},mt=[],gt=void 0]=typeof rt.extraReducers=="function"?executeReducerBuilderCallback(rt.extraReducers):[rt.extraReducers],dt={...pt,...it.sliceCaseReducersByType};return createReducer(rt.initialState,St=>{for(let xt in dt)St.addCase(xt,dt[xt]);for(let xt of it.sliceMatchers)St.addMatcher(xt.matcher,xt.reducer);for(let xt of mt)St.addMatcher(xt.matcher,xt.reducer);gt&&St.addDefaultCase(gt)})}const $=pt=>pt,et=new Map;let st;function lt(pt,mt){return st||(st=_()),st(pt,mt)}function ct(){return st||(st=_()),st.getInitialState()}function ht(pt,mt=!1){function gt(St){let xt=St[pt];return typeof xt>"u"&&mt&&(xt=ct()),xt}function dt(St=$){const xt=emplace(et,mt,{insert:()=>new WeakMap});return emplace(xt,St,{insert:()=>{const yt={};for(const[_t,Ct]of Object.entries(rt.selectors??{}))yt[_t]=wrapSelector(Ct,St,ct,mt);return yt}})}return{reducerPath:pt,getSelectors:dt,get selectors(){return dt(gt)},selectSlice:gt}}const ut={name:tt,reducer:lt,actions:it.actionCreators,caseReducers:it.sliceCaseReducersByName,getInitialState:ct,...ht(ot),injectInto(pt,{reducerPath:mt,...gt}={}){const dt=mt??ot;return pt.inject({reducerPath:dt,reducer:lt},gt),{...ut,...ht(dt,!0)}}};return ut}}function wrapSelector(i,s,o,a){function rt(tt,...ot){let at=s(tt);return typeof at>"u"&&a&&(at=o()),i(at,...ot)}return rt.unwrapped=i,rt}var createSlice=buildCreateSlice();function buildReducerCreators(){function i(s,o){return{_reducerDefinitionType:"asyncThunk",payloadCreator:s,...o}}return i.withTypes=()=>i,{reducer(s){return Object.assign({[s.name](...o){return s(...o)}}[s.name],{_reducerDefinitionType:"reducer"})},preparedReducer(s,o){return{_reducerDefinitionType:"reducerWithPrepare",prepare:s,reducer:o}},asyncThunk:i}}function handleNormalReducerDefinition({type:i,reducerName:s,createNotation:o},a,rt){let tt,ot;if("reducer"in a){if(o&&!isCaseReducerWithPrepareDefinition(a))throw new Error(formatProdErrorMessage(17));tt=a.reducer,ot=a.prepare}else tt=a;rt.addCase(i,tt).exposeCaseReducer(s,tt).exposeAction(s,ot?createAction(i,ot):createAction(i))}function isAsyncThunkSliceReducerDefinition(i){return i._reducerDefinitionType==="asyncThunk"}function isCaseReducerWithPrepareDefinition(i){return i._reducerDefinitionType==="reducerWithPrepare"}function handleThunkCaseReducerDefinition({type:i,reducerName:s},o,a,rt){if(!rt)throw new Error(formatProdErrorMessage(18));const{payloadCreator:tt,fulfilled:ot,pending:at,rejected:nt,settled:it,options:j}=o,_=rt(i,tt,j);a.exposeAction(s,_),ot&&a.addCase(_.fulfilled,ot),at&&a.addCase(_.pending,at),nt&&a.addCase(_.rejected,nt),it&&a.addMatcher(_.settled,it),a.exposeCaseReducer(s,{fulfilled:ot||noop,pending:at||noop,rejected:nt||noop,settled:it||noop})}function noop(){}function formatProdErrorMessage(i){return`Minified Redux Toolkit error #${i}; visit https://redux-toolkit.js.org/Errors?code=${i} for the full message or use the non-minified dev environment for full errors. `}const loadSamplePythonPrograms=async()=>(await __vitePreload(async()=>{const{samplePythonPrograms:i}=await import("./index-CxR4alL1.js");return{samplePythonPrograms:i}},[])).samplePythonPrograms,loadSampleSourceThreePrograms=async()=>(await __vitePreload(async()=>{const{sampleSourceThreePrograms:i}=await import("./index-OcF0Dhf2.js");return{sampleSourceThreePrograms:i}},[])).sampleSourceThreePrograms;let samplePythonPrograms,sampleSourceThreePrograms;const sampleProgramLoader=async i=>{switch(i){case Languages.PYTHON:return samplePythonPrograms===void 0&&(samplePythonPrograms=await loadSamplePythonPrograms()),samplePythonPrograms;case Languages.SOURCE_THREE_INTERPRETER:return sampleSourceThreePrograms===void 0&&(sampleSourceThreePrograms=await loadSampleSourceThreePrograms()),sampleSourceThreePrograms}},defaultPrograms=Object.freeze({[Languages.PYTHON]:`# Write your Python program here! `,[Languages.SOURCE_THREE_INTERPRETER]:`// Write your Source §3 program here! -`}),initialState={currentLanguage:Languages.PYTHON,editorValue:{...defaultPrograms}},WorkspaceSlice=createSlice({name:"workspace",initialState,reducers:{setCurrentLanguage:(i,s)=>{i.currentLanguage=s.payload},setEditorValue:(i,s)=>{i.editorValue[i.currentLanguage]=s.payload},resetEditorValues:(i,s)=>{const o=s.payload;o!==void 0?i.editorValue[o]=defaultPrograms[o]:i.editorValue={...defaultPrograms}}}}),WorkspaceActions=WorkspaceSlice.actions,workspace=WorkspaceSlice.reducer,{setCurrentLanguage:setCurrentLanguage$1}=WorkspaceActions,LanguageSelector=()=>{const i=useTypedSelector(o=>o.workspace.currentLanguage),s=useTypedDispatch();return jsxRuntimeExports.jsx(Select,{size:"sm",variant:"filled",width:"fit-content",name:"languageMode",id:"languagemode",value:i,onChange:o=>s(setCurrentLanguage$1(o.target.value)),children:supportedLanguages.map(o=>jsxRuntimeExports.jsx("option",{value:o,children:o},o))})},UserGuide=()=>{const{isOpen:i,onOpen:s,onClose:o}=useDisclosure();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Button,{variant:"link",onClick:s,fontWeight:"normal",children:"View User Guide"}),jsxRuntimeExports.jsxs(Modal,{isOpen:i,onClose:o,children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsx(ModalHeader,{children:"User Guide"}),jsxRuntimeExports.jsx(ModalCloseButton,{}),jsxRuntimeExports.jsx(ModalBody,{paddingBottom:0,children:jsxRuntimeExports.jsxs(OrderedList,{children:[jsxRuntimeExports.jsxs(ListItem,{children:["Connect your SPIKE Prime to your computer via USB.",jsxRuntimeExports.jsx("br",{}),jsxRuntimeExports.jsxs("em",{children:[jsxRuntimeExports.jsx("strong",{children:"Note:"})," You can also connect via Bluetooth but reliability will not be guaranteed."]})]}),jsxRuntimeExports.jsxs(ListItem,{children:["Select the appropriate language mode:"," ",Languages.SOURCE_THREE_INTERPRETER," or ",Languages.PYTHON]}),jsxRuntimeExports.jsx(ListItem,{children:'After finishing your code, click the "Run on Device" button.'}),jsxRuntimeExports.jsxs(ListItem,{children:["Select the correct port from the pop-up that is shown.",jsxRuntimeExports.jsx("br",{}),jsxRuntimeExports.jsxs("em",{children:[jsxRuntimeExports.jsx("strong",{children:"Note:"})," SEKER only supports Chromium-based browsers version 89 and onwards. If you do not see a pop-up, this means your browser is not supported."]})]}),jsxRuntimeExports.jsx(ListItem,{children:"The SPIKE Prime should start running your code."})]})}),jsxRuntimeExports.jsx(ModalFooter,{paddingTop:0})]})]})]})};var ArrowForwardIcon=createIcon({d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z",displayName:"ArrowForwardIcon"});const SampleProgramListItem=({label:i,onClick:s})=>jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsx(Button,{size:"sm",variant:"link",fontWeight:"normal",width:"full",iconSpacing:"auto",rightIcon:jsxRuntimeExports.jsxs(HStack,{spacing:1,children:[jsxRuntimeExports.jsx(Text,{children:"Load"}),jsxRuntimeExports.jsx(ArrowForwardIcon,{})]}),onClick:s,children:i})}),{setEditorValue:setEditorValue$1}=WorkspaceActions,SampleProgramSidebar=()=>{const[i,s]=reactExports.useState(),o=useTypedSelector(rt=>rt.workspace.currentLanguage),a=useTypedDispatch();return reactExports.useEffect(()=>{s(void 0),sampleProgramLoader(o).then(s)},[o]),jsxRuntimeExports.jsxs(Card,{children:[jsxRuntimeExports.jsx(CardHeader,{children:jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsxs(Heading,{size:"md",children:["Sample ",o," Programs"]}),jsxRuntimeExports.jsx(Text,{children:"Click on a program below to load them into the editor."})]})}),jsxRuntimeExports.jsx(CardBody,{paddingTop:0,children:jsxRuntimeExports.jsx(Stack,{divider:jsxRuntimeExports.jsx(StackDivider,{}),children:i===void 0?jsxRuntimeExports.jsx(Text,{fontStyle:"italic",color:"gray",children:"Loading sample programs…"}):i.length==0?jsxRuntimeExports.jsx(Text,{fontStyle:"italic",color:"gray",children:"No sample programs found."}):i.map((rt,et)=>jsxRuntimeExports.jsx(SampleProgramListItem,{label:`Sample Program ${et+1}`,onClick:()=>a(setEditorValue$1(rt))},et))})})]})};var sicp={},createContext={},constants={},types={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.Variant=i.Chapter=i.ErrorSeverity=i.ErrorType=void 0,function(s){s.SYNTAX="Syntax",s.TYPE="Type",s.RUNTIME="Runtime"}(i.ErrorType||(i.ErrorType={})),function(s){s.WARNING="Warning",s.ERROR="Error"}(i.ErrorSeverity||(i.ErrorSeverity={})),function(s){s[s.SOURCE_1=1]="SOURCE_1",s[s.SOURCE_2=2]="SOURCE_2",s[s.SOURCE_3=3]="SOURCE_3",s[s.SOURCE_4=4]="SOURCE_4",s[s.FULL_JS=-1]="FULL_JS",s[s.HTML=-2]="HTML",s[s.LIBRARY_PARSER=100]="LIBRARY_PARSER"}(i.Chapter||(i.Chapter={})),function(s){s.DEFAULT="default",s.NATIVE="native",s.WASM="wasm",s.LAZY="lazy",s.NON_DET="non-det",s.CONCURRENT="concurrent",s.GPU="gpu"}(i.Variant||(i.Variant={}))})(types);Object.defineProperty(constants,"__esModule",{value:!0});constants.ACORN_PARSE_OPTIONS=constants.sourceLanguages=constants.JSSLANG_PROPERTIES=constants.UNKNOWN_LOCATION=constants.MAX_LIST_DISPLAY_LENGTH=constants.MODULE_CONTEXTS_ID=constants.MODULE_PARAMS_ID=constants.NATIVE_STORAGE_ID=constants.GLOBAL=constants.TRY_AGAIN=constants.CUT=void 0;const types_1$m=types;constants.CUT="cut";constants.TRY_AGAIN="retry";constants.GLOBAL=typeof window>"u"?commonjsGlobal:window;constants.NATIVE_STORAGE_ID="nativeStorage";constants.MODULE_PARAMS_ID="moduleParams";constants.MODULE_CONTEXTS_ID="moduleContexts";constants.MAX_LIST_DISPLAY_LENGTH=100;constants.UNKNOWN_LOCATION={start:{line:-1,column:-1},end:{line:-1,column:-1}};constants.JSSLANG_PROPERTIES={maxExecTime:1e3,factorToIncreaseBy:10};constants.sourceLanguages=[{chapter:types_1$m.Chapter.SOURCE_1,variant:types_1$m.Variant.DEFAULT},{chapter:types_1$m.Chapter.SOURCE_1,variant:types_1$m.Variant.WASM},{chapter:types_1$m.Chapter.SOURCE_1,variant:types_1$m.Variant.LAZY},{chapter:types_1$m.Chapter.SOURCE_2,variant:types_1$m.Variant.DEFAULT},{chapter:types_1$m.Chapter.SOURCE_2,variant:types_1$m.Variant.LAZY},{chapter:types_1$m.Chapter.SOURCE_3,variant:types_1$m.Variant.DEFAULT},{chapter:types_1$m.Chapter.SOURCE_3,variant:types_1$m.Variant.CONCURRENT},{chapter:types_1$m.Chapter.SOURCE_3,variant:types_1$m.Variant.NON_DET},{chapter:types_1$m.Chapter.SOURCE_4,variant:types_1$m.Variant.DEFAULT},{chapter:types_1$m.Chapter.SOURCE_4,variant:types_1$m.Variant.GPU}];constants.ACORN_PARSE_OPTIONS={ecmaVersion:2015};var lib={},acorn={exports:{}};(function(i,s){(function(o,a){a(s)})(commonjsGlobal,function(o){var a=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],rt=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],et="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࢘-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",ot="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟊꟐꟑꟓꟕ-ꟙꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",at={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},nt="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",it={5:nt,"5module":nt+" export import",6:nt+" const class extends export import super"},j=/^in(stanceof)?$/,_=new RegExp("["+ot+"]"),$=new RegExp("["+ot+et+"]");function tt(vt,Rt){for(var Ft=65536,Ut=0;Utvt)return!1;if(Ft+=Rt[Ut+1],Ft>=vt)return!0}return!1}function st(vt,Rt){return vt<65?vt===36:vt<91?!0:vt<97?vt===95:vt<123?!0:vt<=65535?vt>=170&&_.test(String.fromCharCode(vt)):Rt===!1?!1:tt(vt,rt)}function lt(vt,Rt){return vt<48?vt===36:vt<58?!0:vt<65?!1:vt<91?!0:vt<97?vt===95:vt<123?!0:vt<=65535?vt>=170&&$.test(String.fromCharCode(vt)):Rt===!1?!1:tt(vt,rt)||tt(vt,a)}var ct=function(Rt,Ft){Ft===void 0&&(Ft={}),this.label=Rt,this.keyword=Ft.keyword,this.beforeExpr=!!Ft.beforeExpr,this.startsExpr=!!Ft.startsExpr,this.isLoop=!!Ft.isLoop,this.isAssign=!!Ft.isAssign,this.prefix=!!Ft.prefix,this.postfix=!!Ft.postfix,this.binop=Ft.binop||null,this.updateContext=null};function ht(vt,Rt){return new ct(vt,{beforeExpr:!0,binop:Rt})}var ut={beforeExpr:!0},pt={startsExpr:!0},mt={};function gt(vt,Rt){return Rt===void 0&&(Rt={}),Rt.keyword=vt,mt[vt]=new ct(vt,Rt)}var dt={num:new ct("num",pt),regexp:new ct("regexp",pt),string:new ct("string",pt),name:new ct("name",pt),privateId:new ct("privateId",pt),eof:new ct("eof"),bracketL:new ct("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new ct("]"),braceL:new ct("{",{beforeExpr:!0,startsExpr:!0}),braceR:new ct("}"),parenL:new ct("(",{beforeExpr:!0,startsExpr:!0}),parenR:new ct(")"),comma:new ct(",",ut),semi:new ct(";",ut),colon:new ct(":",ut),dot:new ct("."),question:new ct("?",ut),questionDot:new ct("?."),arrow:new ct("=>",ut),template:new ct("template"),invalidTemplate:new ct("invalidTemplate"),ellipsis:new ct("...",ut),backQuote:new ct("`",pt),dollarBraceL:new ct("${",{beforeExpr:!0,startsExpr:!0}),eq:new ct("=",{beforeExpr:!0,isAssign:!0}),assign:new ct("_=",{beforeExpr:!0,isAssign:!0}),incDec:new ct("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new ct("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:ht("||",1),logicalAND:ht("&&",2),bitwiseOR:ht("|",3),bitwiseXOR:ht("^",4),bitwiseAND:ht("&",5),equality:ht("==/!=/===/!==",6),relational:ht("/<=/>=",7),bitShift:ht("<>/>>>",8),plusMin:new ct("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:ht("%",10),star:ht("*",10),slash:ht("/",10),starstar:new ct("**",{beforeExpr:!0}),coalesce:ht("??",1),_break:gt("break"),_case:gt("case",ut),_catch:gt("catch"),_continue:gt("continue"),_debugger:gt("debugger"),_default:gt("default",ut),_do:gt("do",{isLoop:!0,beforeExpr:!0}),_else:gt("else",ut),_finally:gt("finally"),_for:gt("for",{isLoop:!0}),_function:gt("function",pt),_if:gt("if"),_return:gt("return",ut),_switch:gt("switch"),_throw:gt("throw",ut),_try:gt("try"),_var:gt("var"),_const:gt("const"),_while:gt("while",{isLoop:!0}),_with:gt("with"),_new:gt("new",{beforeExpr:!0,startsExpr:!0}),_this:gt("this",pt),_super:gt("super",pt),_class:gt("class",pt),_extends:gt("extends",ut),_export:gt("export"),_import:gt("import",pt),_null:gt("null",pt),_true:gt("true",pt),_false:gt("false",pt),_in:gt("in",{beforeExpr:!0,binop:7}),_instanceof:gt("instanceof",{beforeExpr:!0,binop:7}),_typeof:gt("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:gt("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:gt("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},St=/\r\n?|\n|\u2028|\u2029/,xt=new RegExp(St.source,"g");function yt(vt){return vt===10||vt===13||vt===8232||vt===8233}function _t(vt,Rt,Ft){Ft===void 0&&(Ft=vt.length);for(var Ut=Rt;Ut>10)+55296,(vt&1023)+56320))}var Kt=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Wt=function(Rt,Ft){this.line=Rt,this.column=Ft};Wt.prototype.offset=function(Rt){return new Wt(this.line,this.column+Rt)};var zt=function(Rt,Ft,Ut){this.start=Ft,this.end=Ut,Rt.sourceFile!==null&&(this.source=Rt.sourceFile)};function Ht(vt,Rt){for(var Ft=1,Ut=0;;){var sr=_t(vt,Ut,Rt);if(sr<0)return new Wt(Ft,Rt-Ut);++Ft,Ut=sr}}var Zt={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},qt=!1;function hr(vt){var Rt={};for(var Ft in Zt)Rt[Ft]=vt&&It(vt,Ft)?vt[Ft]:Zt[Ft];if(Rt.ecmaVersion==="latest"?Rt.ecmaVersion=1e8:Rt.ecmaVersion==null?(!qt&&typeof console=="object"&&console.warn&&(qt=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required. +`}),initialState={currentLanguage:Languages.PYTHON,editorValue:{...defaultPrograms}},WorkspaceSlice=createSlice({name:"workspace",initialState,reducers:{setCurrentLanguage:(i,s)=>{i.currentLanguage=s.payload},setEditorValue:(i,s)=>{i.editorValue[i.currentLanguage]=s.payload},resetEditorValues:(i,s)=>{const o=s.payload;o!==void 0?i.editorValue[o]=defaultPrograms[o]:i.editorValue={...defaultPrograms}}}}),WorkspaceActions=WorkspaceSlice.actions,workspace=WorkspaceSlice.reducer,{setCurrentLanguage:setCurrentLanguage$1}=WorkspaceActions,LanguageSelector=()=>{const i=useTypedSelector(o=>o.workspace.currentLanguage),s=useTypedDispatch();return jsxRuntimeExports.jsx(Select,{size:"sm",variant:"filled",width:"fit-content",name:"languageMode",id:"languagemode",value:i,onChange:o=>s(setCurrentLanguage$1(o.target.value)),children:supportedLanguages.map(o=>jsxRuntimeExports.jsx("option",{value:o,children:o},o))})},UserGuide=()=>{const{isOpen:i,onOpen:s,onClose:o}=useDisclosure();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Button,{variant:"link",onClick:s,fontWeight:"normal",children:"View User Guide"}),jsxRuntimeExports.jsxs(Modal,{isOpen:i,onClose:o,children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsx(ModalHeader,{children:"User Guide"}),jsxRuntimeExports.jsx(ModalCloseButton,{}),jsxRuntimeExports.jsx(ModalBody,{paddingBottom:0,children:jsxRuntimeExports.jsxs(OrderedList,{children:[jsxRuntimeExports.jsxs(ListItem,{children:["Connect your SPIKE Prime to your computer via USB.",jsxRuntimeExports.jsx("br",{}),jsxRuntimeExports.jsxs("em",{children:[jsxRuntimeExports.jsx("strong",{children:"Note:"})," You can also connect via Bluetooth but reliability will not be guaranteed."]})]}),jsxRuntimeExports.jsxs(ListItem,{children:["Select the appropriate language mode:"," ",Languages.SOURCE_THREE_INTERPRETER," or ",Languages.PYTHON]}),jsxRuntimeExports.jsx(ListItem,{children:'After finishing your code, click the "Run on Device" button.'}),jsxRuntimeExports.jsxs(ListItem,{children:["Select the correct port from the pop-up that is shown.",jsxRuntimeExports.jsx("br",{}),jsxRuntimeExports.jsxs("em",{children:[jsxRuntimeExports.jsx("strong",{children:"Note:"})," SEKER only supports Chromium-based browsers version 89 and onwards. If you do not see a pop-up, this means your browser is not supported."]})]}),jsxRuntimeExports.jsx(ListItem,{children:"The SPIKE Prime should start running your code."})]})}),jsxRuntimeExports.jsx(ModalFooter,{paddingTop:0})]})]})]})};var ArrowForwardIcon=createIcon({d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z",displayName:"ArrowForwardIcon"});const SampleProgramListItem=({label:i,onClick:s})=>jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsx(Button,{size:"sm",variant:"link",fontWeight:"normal",width:"full",iconSpacing:"auto",rightIcon:jsxRuntimeExports.jsxs(HStack,{spacing:1,children:[jsxRuntimeExports.jsx(Text,{children:"Load"}),jsxRuntimeExports.jsx(ArrowForwardIcon,{})]}),onClick:s,children:i})}),{setEditorValue:setEditorValue$1}=WorkspaceActions,SampleProgramSidebar=()=>{const[i,s]=reactExports.useState(),o=useTypedSelector(rt=>rt.workspace.currentLanguage),a=useTypedDispatch();return reactExports.useEffect(()=>{s(void 0),sampleProgramLoader(o).then(s)},[o]),jsxRuntimeExports.jsxs(Card,{children:[jsxRuntimeExports.jsx(CardHeader,{children:jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsxs(Heading,{size:"md",children:["Sample ",o," Programs"]}),jsxRuntimeExports.jsx(Text,{children:"Click on a program below to load them into the editor."})]})}),jsxRuntimeExports.jsx(CardBody,{paddingTop:0,children:jsxRuntimeExports.jsx(Stack,{divider:jsxRuntimeExports.jsx(StackDivider,{}),children:i===void 0?jsxRuntimeExports.jsx(Text,{fontStyle:"italic",color:"gray",children:"Loading sample programs…"}):i.length==0?jsxRuntimeExports.jsx(Text,{fontStyle:"italic",color:"gray",children:"No sample programs found."}):i.map((rt,tt)=>jsxRuntimeExports.jsx(SampleProgramListItem,{label:`Sample Program ${tt+1}`,onClick:()=>a(setEditorValue$1(rt))},tt))})})]})};var sicp={},createContext={},constants={},types={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.Variant=i.Chapter=i.ErrorSeverity=i.ErrorType=void 0,function(s){s.SYNTAX="Syntax",s.TYPE="Type",s.RUNTIME="Runtime"}(i.ErrorType||(i.ErrorType={})),function(s){s.WARNING="Warning",s.ERROR="Error"}(i.ErrorSeverity||(i.ErrorSeverity={})),function(s){s[s.SOURCE_1=1]="SOURCE_1",s[s.SOURCE_2=2]="SOURCE_2",s[s.SOURCE_3=3]="SOURCE_3",s[s.SOURCE_4=4]="SOURCE_4",s[s.FULL_JS=-1]="FULL_JS",s[s.HTML=-2]="HTML",s[s.LIBRARY_PARSER=100]="LIBRARY_PARSER"}(i.Chapter||(i.Chapter={})),function(s){s.DEFAULT="default",s.NATIVE="native",s.WASM="wasm",s.LAZY="lazy",s.NON_DET="non-det",s.CONCURRENT="concurrent",s.GPU="gpu"}(i.Variant||(i.Variant={}))})(types);Object.defineProperty(constants,"__esModule",{value:!0});constants.ACORN_PARSE_OPTIONS=constants.sourceLanguages=constants.JSSLANG_PROPERTIES=constants.UNKNOWN_LOCATION=constants.MAX_LIST_DISPLAY_LENGTH=constants.MODULE_CONTEXTS_ID=constants.MODULE_PARAMS_ID=constants.NATIVE_STORAGE_ID=constants.GLOBAL=constants.TRY_AGAIN=constants.CUT=void 0;const types_1$m=types;constants.CUT="cut";constants.TRY_AGAIN="retry";constants.GLOBAL=typeof window>"u"?commonjsGlobal:window;constants.NATIVE_STORAGE_ID="nativeStorage";constants.MODULE_PARAMS_ID="moduleParams";constants.MODULE_CONTEXTS_ID="moduleContexts";constants.MAX_LIST_DISPLAY_LENGTH=100;constants.UNKNOWN_LOCATION={start:{line:-1,column:-1},end:{line:-1,column:-1}};constants.JSSLANG_PROPERTIES={maxExecTime:1e3,factorToIncreaseBy:10};constants.sourceLanguages=[{chapter:types_1$m.Chapter.SOURCE_1,variant:types_1$m.Variant.DEFAULT},{chapter:types_1$m.Chapter.SOURCE_1,variant:types_1$m.Variant.WASM},{chapter:types_1$m.Chapter.SOURCE_1,variant:types_1$m.Variant.LAZY},{chapter:types_1$m.Chapter.SOURCE_2,variant:types_1$m.Variant.DEFAULT},{chapter:types_1$m.Chapter.SOURCE_2,variant:types_1$m.Variant.LAZY},{chapter:types_1$m.Chapter.SOURCE_3,variant:types_1$m.Variant.DEFAULT},{chapter:types_1$m.Chapter.SOURCE_3,variant:types_1$m.Variant.CONCURRENT},{chapter:types_1$m.Chapter.SOURCE_3,variant:types_1$m.Variant.NON_DET},{chapter:types_1$m.Chapter.SOURCE_4,variant:types_1$m.Variant.DEFAULT},{chapter:types_1$m.Chapter.SOURCE_4,variant:types_1$m.Variant.GPU}];constants.ACORN_PARSE_OPTIONS={ecmaVersion:2015};var lib={},acorn={exports:{}};(function(i,s){(function(o,a){a(s)})(commonjsGlobal,function(o){var a=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],rt=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],tt="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࢘-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",ot="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟊꟐꟑꟓꟕ-ꟙꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",at={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},nt="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",it={5:nt,"5module":nt+" export import",6:nt+" const class extends export import super"},j=/^in(stanceof)?$/,_=new RegExp("["+ot+"]"),$=new RegExp("["+ot+tt+"]");function et(vt,Rt){for(var Ft=65536,Ut=0;Utvt)return!1;if(Ft+=Rt[Ut+1],Ft>=vt)return!0}return!1}function st(vt,Rt){return vt<65?vt===36:vt<91?!0:vt<97?vt===95:vt<123?!0:vt<=65535?vt>=170&&_.test(String.fromCharCode(vt)):Rt===!1?!1:et(vt,rt)}function lt(vt,Rt){return vt<48?vt===36:vt<58?!0:vt<65?!1:vt<91?!0:vt<97?vt===95:vt<123?!0:vt<=65535?vt>=170&&$.test(String.fromCharCode(vt)):Rt===!1?!1:et(vt,rt)||et(vt,a)}var ct=function(Rt,Ft){Ft===void 0&&(Ft={}),this.label=Rt,this.keyword=Ft.keyword,this.beforeExpr=!!Ft.beforeExpr,this.startsExpr=!!Ft.startsExpr,this.isLoop=!!Ft.isLoop,this.isAssign=!!Ft.isAssign,this.prefix=!!Ft.prefix,this.postfix=!!Ft.postfix,this.binop=Ft.binop||null,this.updateContext=null};function ht(vt,Rt){return new ct(vt,{beforeExpr:!0,binop:Rt})}var ut={beforeExpr:!0},pt={startsExpr:!0},mt={};function gt(vt,Rt){return Rt===void 0&&(Rt={}),Rt.keyword=vt,mt[vt]=new ct(vt,Rt)}var dt={num:new ct("num",pt),regexp:new ct("regexp",pt),string:new ct("string",pt),name:new ct("name",pt),privateId:new ct("privateId",pt),eof:new ct("eof"),bracketL:new ct("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new ct("]"),braceL:new ct("{",{beforeExpr:!0,startsExpr:!0}),braceR:new ct("}"),parenL:new ct("(",{beforeExpr:!0,startsExpr:!0}),parenR:new ct(")"),comma:new ct(",",ut),semi:new ct(";",ut),colon:new ct(":",ut),dot:new ct("."),question:new ct("?",ut),questionDot:new ct("?."),arrow:new ct("=>",ut),template:new ct("template"),invalidTemplate:new ct("invalidTemplate"),ellipsis:new ct("...",ut),backQuote:new ct("`",pt),dollarBraceL:new ct("${",{beforeExpr:!0,startsExpr:!0}),eq:new ct("=",{beforeExpr:!0,isAssign:!0}),assign:new ct("_=",{beforeExpr:!0,isAssign:!0}),incDec:new ct("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new ct("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:ht("||",1),logicalAND:ht("&&",2),bitwiseOR:ht("|",3),bitwiseXOR:ht("^",4),bitwiseAND:ht("&",5),equality:ht("==/!=/===/!==",6),relational:ht("/<=/>=",7),bitShift:ht("<>/>>>",8),plusMin:new ct("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:ht("%",10),star:ht("*",10),slash:ht("/",10),starstar:new ct("**",{beforeExpr:!0}),coalesce:ht("??",1),_break:gt("break"),_case:gt("case",ut),_catch:gt("catch"),_continue:gt("continue"),_debugger:gt("debugger"),_default:gt("default",ut),_do:gt("do",{isLoop:!0,beforeExpr:!0}),_else:gt("else",ut),_finally:gt("finally"),_for:gt("for",{isLoop:!0}),_function:gt("function",pt),_if:gt("if"),_return:gt("return",ut),_switch:gt("switch"),_throw:gt("throw",ut),_try:gt("try"),_var:gt("var"),_const:gt("const"),_while:gt("while",{isLoop:!0}),_with:gt("with"),_new:gt("new",{beforeExpr:!0,startsExpr:!0}),_this:gt("this",pt),_super:gt("super",pt),_class:gt("class",pt),_extends:gt("extends",ut),_export:gt("export"),_import:gt("import",pt),_null:gt("null",pt),_true:gt("true",pt),_false:gt("false",pt),_in:gt("in",{beforeExpr:!0,binop:7}),_instanceof:gt("instanceof",{beforeExpr:!0,binop:7}),_typeof:gt("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:gt("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:gt("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},St=/\r\n?|\n|\u2028|\u2029/,xt=new RegExp(St.source,"g");function yt(vt){return vt===10||vt===13||vt===8232||vt===8233}function _t(vt,Rt,Ft){Ft===void 0&&(Ft=vt.length);for(var Ut=Rt;Ut>10)+55296,(vt&1023)+56320))}var Kt=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Wt=function(Rt,Ft){this.line=Rt,this.column=Ft};Wt.prototype.offset=function(Rt){return new Wt(this.line,this.column+Rt)};var zt=function(Rt,Ft,Ut){this.start=Ft,this.end=Ut,Rt.sourceFile!==null&&(this.source=Rt.sourceFile)};function Ht(vt,Rt){for(var Ft=1,Ut=0;;){var sr=_t(vt,Ut,Rt);if(sr<0)return new Wt(Ft,Rt-Ut);++Ft,Ut=sr}}var Zt={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},qt=!1;function hr(vt){var Rt={};for(var Ft in Zt)Rt[Ft]=vt&&It(vt,Ft)?vt[Ft]:Zt[Ft];if(Rt.ecmaVersion==="latest"?Rt.ecmaVersion=1e8:Rt.ecmaVersion==null?(!qt&&typeof console=="object"&&console.warn&&(qt=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required. Defaulting to 2020, but this will stop working in the future.`)),Rt.ecmaVersion=11):Rt.ecmaVersion>=2015&&(Rt.ecmaVersion-=2009),Rt.allowReserved==null&&(Rt.allowReserved=Rt.ecmaVersion<5),(!vt||vt.allowHashBang==null)&&(Rt.allowHashBang=Rt.ecmaVersion>=14),Ot(Rt.onToken)){var Ut=Rt.onToken;Rt.onToken=function(sr){return Ut.push(sr)}}return Ot(Rt.onComment)&&(Rt.onComment=fr(Rt,Rt.onComment)),Rt}function fr(vt,Rt){return function(Ft,Ut,sr,vr,wr,Fr){var Br={type:Ft?"Block":"Line",value:Ut,start:sr,end:vr};vt.locations&&(Br.loc=new zt(this,wr,Fr)),vt.ranges&&(Br.range=[sr,vr]),Rt.push(Br)}}var mr=1,gr=2,tr=4,rr=8,Qt=16,xr=32,Sr=64,dr=128,Ur=256,tn=mr|gr|Ur;function on(vt,Rt){return gr|(vt?tr:0)|(Rt?rr:0)}var Rn=0,Nn=1,Mn=2,pn=3,Hn=4,In=5,_r=function(Rt,Ft,Ut){this.options=Rt=hr(Rt),this.sourceFile=Rt.sourceFile,this.keywords=Dt(it[Rt.ecmaVersion>=6?6:Rt.sourceType==="module"?"5module":5]);var sr="";Rt.allowReserved!==!0&&(sr=at[Rt.ecmaVersion>=6?6:Rt.ecmaVersion===5?5:3],Rt.sourceType==="module"&&(sr+=" await")),this.reservedWords=Dt(sr);var vr=(sr?sr+" ":"")+at.strict;this.reservedWordsStrict=Dt(vr),this.reservedWordsStrictBind=Dt(vr+" "+at.strictBind),this.input=String(Ft),this.containsEsc=!1,Ut?(this.pos=Ut,this.lineStart=this.input.lastIndexOf(` `,Ut-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(St).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=dt.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=Rt.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&Rt.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(mr),this.regexpState=null,this.privateNameStack=[]},Nr={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};_r.prototype.parse=function(){var Rt=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(Rt)},Nr.inFunction.get=function(){return(this.currentVarScope().flags&gr)>0},Nr.inGenerator.get=function(){return(this.currentVarScope().flags&rr)>0&&!this.currentVarScope().inClassFieldInit},Nr.inAsync.get=function(){return(this.currentVarScope().flags&tr)>0&&!this.currentVarScope().inClassFieldInit},Nr.canAwait.get=function(){for(var vt=this.scopeStack.length-1;vt>=0;vt--){var Rt=this.scopeStack[vt];if(Rt.inClassFieldInit||Rt.flags&Ur)return!1;if(Rt.flags&gr)return(Rt.flags&tr)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},Nr.allowSuper.get=function(){var vt=this.currentThisScope(),Rt=vt.flags,Ft=vt.inClassFieldInit;return(Rt&Sr)>0||Ft||this.options.allowSuperOutsideMethod},Nr.allowDirectSuper.get=function(){return(this.currentThisScope().flags&dr)>0},Nr.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},Nr.allowNewDotTarget.get=function(){var vt=this.currentThisScope(),Rt=vt.flags,Ft=vt.inClassFieldInit;return(Rt&(gr|Ur))>0||Ft},Nr.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Ur)>0},_r.extend=function(){for(var Rt=[],Ft=arguments.length;Ft--;)Rt[Ft]=arguments[Ft];for(var Ut=this,sr=0;sr=,?^&]/.test(sr)||sr==="!"&&this.input.charAt(Ut+1)==="=")}vt+=Rt[0].length,Et.lastIndex=vt,vt+=Et.exec(this.input)[0].length,this.input[vt]===";"&&vt++}},kr.eat=function(vt){return this.type===vt?(this.next(),!0):!1},kr.isContextual=function(vt){return this.type===dt.name&&this.value===vt&&!this.containsEsc},kr.eatContextual=function(vt){return this.isContextual(vt)?(this.next(),!0):!1},kr.expectContextual=function(vt){this.eatContextual(vt)||this.unexpected()},kr.canInsertSemicolon=function(){return this.type===dt.eof||this.type===dt.braceR||St.test(this.input.slice(this.lastTokEnd,this.start))},kr.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},kr.semicolon=function(){!this.eat(dt.semi)&&!this.insertSemicolon()&&this.unexpected()},kr.afterTrailingComma=function(vt,Rt){if(this.type===vt)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),Rt||this.next(),!0},kr.expect=function(vt){this.eat(vt)||this.unexpected()},kr.unexpected=function(vt){this.raise(vt??this.start,"Unexpected token")};var Yt=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};kr.checkPatternErrors=function(vt,Rt){if(vt){vt.trailingComma>-1&&this.raiseRecoverable(vt.trailingComma,"Comma is not permitted after the rest element");var Ft=Rt?vt.parenthesizedAssign:vt.parenthesizedBind;Ft>-1&&this.raiseRecoverable(Ft,Rt?"Assigning to rvalue":"Parenthesized pattern")}},kr.checkExpressionErrors=function(vt,Rt){if(!vt)return!1;var Ft=vt.shorthandAssign,Ut=vt.doubleProto;if(!Rt)return Ft>=0||Ut>=0;Ft>=0&&this.raise(Ft,"Shorthand property assignments are valid only in destructuring patterns"),Ut>=0&&this.raiseRecoverable(Ut,"Redefinition of __proto__ property")},kr.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos55295&&Ut<56320)return!0;if(st(Ut,!0)){for(var sr=Ft+1;lt(Ut=this.input.charCodeAt(sr),!0);)++sr;if(Ut===92||Ut>55295&&Ut<56320)return!0;var vr=this.input.slice(Ft,sr);if(!j.test(vr))return!0}return!1},er.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;Et.lastIndex=this.pos;var vt=Et.exec(this.input),Rt=this.pos+vt[0].length,Ft;return!St.test(this.input.slice(this.pos,Rt))&&this.input.slice(Rt,Rt+8)==="function"&&(Rt+8===this.input.length||!(lt(Ft=this.input.charCodeAt(Rt+8))||Ft>55295&&Ft<56320))},er.parseStatement=function(vt,Rt,Ft){var Ut=this.type,sr=this.startNode(),vr;switch(this.isLet(vt)&&(Ut=dt._var,vr="let"),Ut){case dt._break:case dt._continue:return this.parseBreakContinueStatement(sr,Ut.keyword);case dt._debugger:return this.parseDebuggerStatement(sr);case dt._do:return this.parseDoStatement(sr);case dt._for:return this.parseForStatement(sr);case dt._function:return vt&&(this.strict||vt!=="if"&&vt!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(sr,!1,!vt);case dt._class:return vt&&this.unexpected(),this.parseClass(sr,!0);case dt._if:return this.parseIfStatement(sr);case dt._return:return this.parseReturnStatement(sr);case dt._switch:return this.parseSwitchStatement(sr);case dt._throw:return this.parseThrowStatement(sr);case dt._try:return this.parseTryStatement(sr);case dt._const:case dt._var:return vr=vr||this.value,vt&&vr!=="var"&&this.unexpected(),this.parseVarStatement(sr,vr);case dt._while:return this.parseWhileStatement(sr);case dt._with:return this.parseWithStatement(sr);case dt.braceL:return this.parseBlock(!0,sr);case dt.semi:return this.parseEmptyStatement(sr);case dt._export:case dt._import:if(this.options.ecmaVersion>10&&Ut===dt._import){Et.lastIndex=this.pos;var wr=Et.exec(this.input),Fr=this.pos+wr[0].length,Br=this.input.charCodeAt(Fr);if(Br===40||Br===46)return this.parseExpressionStatement(sr,this.parseExpression())}return this.options.allowImportExportEverywhere||(Rt||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),Ut===dt._import?this.parseImport(sr):this.parseExport(sr,Ft);default:if(this.isAsyncFunction())return vt&&this.unexpected(),this.next(),this.parseFunctionStatement(sr,!0,!vt);var ln=this.value,hn=this.parseExpression();return Ut===dt.name&&hn.type==="Identifier"&&this.eat(dt.colon)?this.parseLabeledStatement(sr,ln,hn,vt):this.parseExpressionStatement(sr,hn)}},er.parseBreakContinueStatement=function(vt,Rt){var Ft=Rt==="break";this.next(),this.eat(dt.semi)||this.insertSemicolon()?vt.label=null:this.type!==dt.name?this.unexpected():(vt.label=this.parseIdent(),this.semicolon());for(var Ut=0;Ut=6?this.eat(dt.semi):this.semicolon(),this.finishNode(vt,"DoWhileStatement")},er.parseForStatement=function(vt){this.next();var Rt=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(lr),this.enterScope(0),this.expect(dt.parenL),this.type===dt.semi)return Rt>-1&&this.unexpected(Rt),this.parseFor(vt,null);var Ft=this.isLet();if(this.type===dt._var||this.type===dt._const||Ft){var Ut=this.startNode(),sr=Ft?"let":this.value;return this.next(),this.parseVar(Ut,!0,sr),this.finishNode(Ut,"VariableDeclaration"),(this.type===dt._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&Ut.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===dt._in?Rt>-1&&this.unexpected(Rt):vt.await=Rt>-1),this.parseForIn(vt,Ut)):(Rt>-1&&this.unexpected(Rt),this.parseFor(vt,Ut))}var vr=this.isContextual("let"),wr=!1,Fr=new Yt,Br=this.parseExpression(Rt>-1?"await":!0,Fr);return this.type===dt._in||(wr=this.options.ecmaVersion>=6&&this.isContextual("of"))?(this.options.ecmaVersion>=9&&(this.type===dt._in?Rt>-1&&this.unexpected(Rt):vt.await=Rt>-1),vr&&wr&&this.raise(Br.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(Br,!1,Fr),this.checkLValPattern(Br),this.parseForIn(vt,Br)):(this.checkExpressionErrors(Fr,!0),Rt>-1&&this.unexpected(Rt),this.parseFor(vt,Br))},er.parseFunctionStatement=function(vt,Rt,Ft){return this.next(),this.parseFunction(vt,Er|(Ft?0:Cr),!1,Rt)},er.parseIfStatement=function(vt){return this.next(),vt.test=this.parseParenExpression(),vt.consequent=this.parseStatement("if"),vt.alternate=this.eat(dt._else)?this.parseStatement("if"):null,this.finishNode(vt,"IfStatement")},er.parseReturnStatement=function(vt){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(dt.semi)||this.insertSemicolon()?vt.argument=null:(vt.argument=this.parseExpression(),this.semicolon()),this.finishNode(vt,"ReturnStatement")},er.parseSwitchStatement=function(vt){this.next(),vt.discriminant=this.parseParenExpression(),vt.cases=[],this.expect(dt.braceL),this.labels.push(Lr),this.enterScope(0);for(var Rt,Ft=!1;this.type!==dt.braceR;)if(this.type===dt._case||this.type===dt._default){var Ut=this.type===dt._case;Rt&&this.finishNode(Rt,"SwitchCase"),vt.cases.push(Rt=this.startNode()),Rt.consequent=[],this.next(),Ut?Rt.test=this.parseExpression():(Ft&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),Ft=!0,Rt.test=null),this.expect(dt.colon)}else Rt||this.unexpected(),Rt.consequent.push(this.parseStatement(null));return this.exitScope(),Rt&&this.finishNode(Rt,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(vt,"SwitchStatement")},er.parseThrowStatement=function(vt){return this.next(),St.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),vt.argument=this.parseExpression(),this.semicolon(),this.finishNode(vt,"ThrowStatement")};var Or=[];er.parseCatchClauseParam=function(){var vt=this.parseBindingAtom(),Rt=vt.type==="Identifier";return this.enterScope(Rt?xr:0),this.checkLValPattern(vt,Rt?Hn:Mn),this.expect(dt.parenR),vt},er.parseTryStatement=function(vt){if(this.next(),vt.block=this.parseBlock(),vt.handler=null,this.type===dt._catch){var Rt=this.startNode();this.next(),this.eat(dt.parenL)?Rt.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),Rt.param=null,this.enterScope(0)),Rt.body=this.parseBlock(!1),this.exitScope(),vt.handler=this.finishNode(Rt,"CatchClause")}return vt.finalizer=this.eat(dt._finally)?this.parseBlock():null,!vt.handler&&!vt.finalizer&&this.raise(vt.start,"Missing catch or finally clause"),this.finishNode(vt,"TryStatement")},er.parseVarStatement=function(vt,Rt,Ft){return this.next(),this.parseVar(vt,!1,Rt,Ft),this.semicolon(),this.finishNode(vt,"VariableDeclaration")},er.parseWhileStatement=function(vt){return this.next(),vt.test=this.parseParenExpression(),this.labels.push(lr),vt.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(vt,"WhileStatement")},er.parseWithStatement=function(vt){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),vt.object=this.parseParenExpression(),vt.body=this.parseStatement("with"),this.finishNode(vt,"WithStatement")},er.parseEmptyStatement=function(vt){return this.next(),this.finishNode(vt,"EmptyStatement")},er.parseLabeledStatement=function(vt,Rt,Ft,Ut){for(var sr=0,vr=this.labels;sr=0;Br--){var ln=this.labels[Br];if(ln.statementStart===vt.start)ln.statementStart=this.start,ln.kind=Fr;else break}return this.labels.push({name:Rt,kind:Fr,statementStart:this.start}),vt.body=this.parseStatement(Ut?Ut.indexOf("label")===-1?Ut+"label":Ut:"label"),this.labels.pop(),vt.label=Ft,this.finishNode(vt,"LabeledStatement")},er.parseExpressionStatement=function(vt,Rt){return vt.expression=Rt,this.semicolon(),this.finishNode(vt,"ExpressionStatement")},er.parseBlock=function(vt,Rt,Ft){for(vt===void 0&&(vt=!0),Rt===void 0&&(Rt=this.startNode()),Rt.body=[],this.expect(dt.braceL),vt&&this.enterScope(0);this.type!==dt.braceR;){var Ut=this.parseStatement(null);Rt.body.push(Ut)}return Ft&&(this.strict=!1),this.next(),vt&&this.exitScope(),this.finishNode(Rt,"BlockStatement")},er.parseFor=function(vt,Rt){return vt.init=Rt,this.expect(dt.semi),vt.test=this.type===dt.semi?null:this.parseExpression(),this.expect(dt.semi),vt.update=this.type===dt.parenR?null:this.parseExpression(),this.expect(dt.parenR),vt.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(vt,"ForStatement")},er.parseForIn=function(vt,Rt){var Ft=this.type===dt._in;return this.next(),Rt.type==="VariableDeclaration"&&Rt.declarations[0].init!=null&&(!Ft||this.options.ecmaVersion<8||this.strict||Rt.kind!=="var"||Rt.declarations[0].id.type!=="Identifier")&&this.raise(Rt.start,(Ft?"for-in":"for-of")+" loop variable declaration may not have an initializer"),vt.left=Rt,vt.right=Ft?this.parseExpression():this.parseMaybeAssign(),this.expect(dt.parenR),vt.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(vt,Ft?"ForInStatement":"ForOfStatement")},er.parseVar=function(vt,Rt,Ft,Ut){for(vt.declarations=[],vt.kind=Ft;;){var sr=this.startNode();if(this.parseVarId(sr,Ft),this.eat(dt.eq)?sr.init=this.parseMaybeAssign(Rt):!Ut&&Ft==="const"&&!(this.type===dt._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!Ut&&sr.id.type!=="Identifier"&&!(Rt&&(this.type===dt._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):sr.init=null,vt.declarations.push(this.finishNode(sr,"VariableDeclarator")),!this.eat(dt.comma))break}return vt},er.parseVarId=function(vt,Rt){vt.id=this.parseBindingAtom(),this.checkLValPattern(vt.id,Rt==="var"?Nn:Mn,!1)};var Er=1,Cr=2,Hr=4;er.parseFunction=function(vt,Rt,Ft,Ut,sr){this.initFunction(vt),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!Ut)&&(this.type===dt.star&&Rt&Cr&&this.unexpected(),vt.generator=this.eat(dt.star)),this.options.ecmaVersion>=8&&(vt.async=!!Ut),Rt&Er&&(vt.id=Rt&Hr&&this.type!==dt.name?null:this.parseIdent(),vt.id&&!(Rt&Cr)&&this.checkLValSimple(vt.id,this.strict||vt.generator||vt.async?this.treatFunctionsAsVar?Nn:Mn:pn));var vr=this.yieldPos,wr=this.awaitPos,Fr=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(on(vt.async,vt.generator)),Rt&Er||(vt.id=this.type===dt.name?this.parseIdent():null),this.parseFunctionParams(vt),this.parseFunctionBody(vt,Ft,!1,sr),this.yieldPos=vr,this.awaitPos=wr,this.awaitIdentPos=Fr,this.finishNode(vt,Rt&Er?"FunctionDeclaration":"FunctionExpression")},er.parseFunctionParams=function(vt){this.expect(dt.parenL),vt.params=this.parseBindingList(dt.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},er.parseClass=function(vt,Rt){this.next();var Ft=this.strict;this.strict=!0,this.parseClassId(vt,Rt),this.parseClassSuper(vt);var Ut=this.enterClassBody(),sr=this.startNode(),vr=!1;for(sr.body=[],this.expect(dt.braceL);this.type!==dt.braceR;){var wr=this.parseClassElement(vt.superClass!==null);wr&&(sr.body.push(wr),wr.type==="MethodDefinition"&&wr.kind==="constructor"?(vr&&this.raiseRecoverable(wr.start,"Duplicate constructor in the same class"),vr=!0):wr.key&&wr.key.type==="PrivateIdentifier"&&rn(Ut,wr)&&this.raiseRecoverable(wr.key.start,"Identifier '#"+wr.key.name+"' has already been declared"))}return this.strict=Ft,this.next(),vt.body=this.finishNode(sr,"ClassBody"),this.exitClassBody(),this.finishNode(vt,Rt?"ClassDeclaration":"ClassExpression")},er.parseClassElement=function(vt){if(this.eat(dt.semi))return null;var Rt=this.options.ecmaVersion,Ft=this.startNode(),Ut="",sr=!1,vr=!1,wr="method",Fr=!1;if(this.eatContextual("static")){if(Rt>=13&&this.eat(dt.braceL))return this.parseClassStaticBlock(Ft),Ft;this.isClassElementNameStart()||this.type===dt.star?Fr=!0:Ut="static"}if(Ft.static=Fr,!Ut&&Rt>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===dt.star)&&!this.canInsertSemicolon()?vr=!0:Ut="async"),!Ut&&(Rt>=9||!vr)&&this.eat(dt.star)&&(sr=!0),!Ut&&!vr&&!sr){var Br=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?wr=Br:Ut=Br)}if(Ut?(Ft.computed=!1,Ft.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),Ft.key.name=Ut,this.finishNode(Ft.key,"Identifier")):this.parseClassElementName(Ft),Rt<13||this.type===dt.parenL||wr!=="method"||sr||vr){var ln=!Ft.static&&Dr(Ft,"constructor"),hn=ln&&vt;ln&&wr!=="method"&&this.raise(Ft.key.start,"Constructor can't have get/set modifier"),Ft.kind=ln?"constructor":wr,this.parseClassMethod(Ft,sr,vr,hn)}else this.parseClassField(Ft);return Ft},er.isClassElementNameStart=function(){return this.type===dt.name||this.type===dt.privateId||this.type===dt.num||this.type===dt.string||this.type===dt.bracketL||this.type.keyword},er.parseClassElementName=function(vt){this.type===dt.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),vt.computed=!1,vt.key=this.parsePrivateIdent()):this.parsePropertyName(vt)},er.parseClassMethod=function(vt,Rt,Ft,Ut){var sr=vt.key;vt.kind==="constructor"?(Rt&&this.raise(sr.start,"Constructor can't be a generator"),Ft&&this.raise(sr.start,"Constructor can't be an async method")):vt.static&&Dr(vt,"prototype")&&this.raise(sr.start,"Classes may not have a static property named prototype");var vr=vt.value=this.parseMethod(Rt,Ft,Ut);return vt.kind==="get"&&vr.params.length!==0&&this.raiseRecoverable(vr.start,"getter should have no params"),vt.kind==="set"&&vr.params.length!==1&&this.raiseRecoverable(vr.start,"setter should have exactly one param"),vt.kind==="set"&&vr.params[0].type==="RestElement"&&this.raiseRecoverable(vr.params[0].start,"Setter cannot use rest params"),this.finishNode(vt,"MethodDefinition")},er.parseClassField=function(vt){if(Dr(vt,"constructor")?this.raise(vt.key.start,"Classes can't have a field named 'constructor'"):vt.static&&Dr(vt,"prototype")&&this.raise(vt.key.start,"Classes can't have a static field named 'prototype'"),this.eat(dt.eq)){var Rt=this.currentThisScope(),Ft=Rt.inClassFieldInit;Rt.inClassFieldInit=!0,vt.value=this.parseMaybeAssign(),Rt.inClassFieldInit=Ft}else vt.value=null;return this.semicolon(),this.finishNode(vt,"PropertyDefinition")},er.parseClassStaticBlock=function(vt){vt.body=[];var Rt=this.labels;for(this.labels=[],this.enterScope(Ur|Sr);this.type!==dt.braceR;){var Ft=this.parseStatement(null);vt.body.push(Ft)}return this.next(),this.exitScope(),this.labels=Rt,this.finishNode(vt,"StaticBlock")},er.parseClassId=function(vt,Rt){this.type===dt.name?(vt.id=this.parseIdent(),Rt&&this.checkLValSimple(vt.id,Mn,!1)):(Rt===!0&&this.unexpected(),vt.id=null)},er.parseClassSuper=function(vt){vt.superClass=this.eat(dt._extends)?this.parseExprSubscripts(null,!1):null},er.enterClassBody=function(){var vt={declared:Object.create(null),used:[]};return this.privateNameStack.push(vt),vt.declared},er.exitClassBody=function(){var vt=this.privateNameStack.pop(),Rt=vt.declared,Ft=vt.used;if(this.options.checkPrivateFields)for(var Ut=this.privateNameStack.length,sr=Ut===0?null:this.privateNameStack[Ut-1],vr=0;vr=11&&(this.eatContextual("as")?(vt.exported=this.parseModuleExportName(),this.checkExport(Rt,vt.exported,this.lastTokStart)):vt.exported=null),this.expectContextual("from"),this.type!==dt.string&&this.unexpected(),vt.source=this.parseExprAtom(),this.semicolon(),this.finishNode(vt,"ExportAllDeclaration")},er.parseExport=function(vt,Rt){if(this.next(),this.eat(dt.star))return this.parseExportAllDeclaration(vt,Rt);if(this.eat(dt._default))return this.checkExport(Rt,"default",this.lastTokStart),vt.declaration=this.parseExportDefaultDeclaration(),this.finishNode(vt,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())vt.declaration=this.parseExportDeclaration(vt),vt.declaration.type==="VariableDeclaration"?this.checkVariableExport(Rt,vt.declaration.declarations):this.checkExport(Rt,vt.declaration.id,vt.declaration.id.start),vt.specifiers=[],vt.source=null;else{if(vt.declaration=null,vt.specifiers=this.parseExportSpecifiers(Rt),this.eatContextual("from"))this.type!==dt.string&&this.unexpected(),vt.source=this.parseExprAtom();else{for(var Ft=0,Ut=vt.specifiers;Ft=13&&this.type===dt.string){var vt=this.parseLiteral(this.value);return Kt.test(vt.value)&&this.raise(vt.start,"An export name cannot include a lone surrogate."),vt}return this.parseIdent(!0)},er.adaptDirectivePrologue=function(vt){for(var Rt=0;Rt=5&&vt.type==="ExpressionStatement"&&vt.expression.type==="Literal"&&typeof vt.expression.value=="string"&&(this.input[vt.start]==='"'||this.input[vt.start]==="'")};var Yr=_r.prototype;Yr.toAssignable=function(vt,Rt,Ft){if(this.options.ecmaVersion>=6&&vt)switch(vt.type){case"Identifier":this.inAsync&&vt.name==="await"&&this.raise(vt.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":vt.type="ObjectPattern",Ft&&this.checkPatternErrors(Ft,!0);for(var Ut=0,sr=vt.properties;Ut=8&&!Fr&&Br.name==="async"&&!this.canInsertSemicolon()&&this.eat(dt._function))return this.overrideContext(Gr.f_expr),this.parseFunction(this.startNodeAt(vr,wr),0,!1,!0,Rt);if(sr&&!this.canInsertSemicolon()){if(this.eat(dt.arrow))return this.parseArrowExpression(this.startNodeAt(vr,wr),[Br],!1,Rt);if(this.options.ecmaVersion>=8&&Br.name==="async"&&this.type===dt.name&&!Fr&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return Br=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(dt.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(vr,wr),[Br],!0,Rt)}return Br;case dt.regexp:var ln=this.value;return Ut=this.parseLiteral(ln.value),Ut.regex={pattern:ln.pattern,flags:ln.flags},Ut;case dt.num:case dt.string:return this.parseLiteral(this.value);case dt._null:case dt._true:case dt._false:return Ut=this.startNode(),Ut.value=this.type===dt._null?null:this.type===dt._true,Ut.raw=this.type.keyword,this.next(),this.finishNode(Ut,"Literal");case dt.parenL:var hn=this.start,jn=this.parseParenAndDistinguishExpression(sr,Rt);return vt&&(vt.parenthesizedAssign<0&&!this.isSimpleAssignTarget(jn)&&(vt.parenthesizedAssign=hn),vt.parenthesizedBind<0&&(vt.parenthesizedBind=hn)),jn;case dt.bracketL:return Ut=this.startNode(),this.next(),Ut.elements=this.parseExprList(dt.bracketR,!0,!0,vt),this.finishNode(Ut,"ArrayExpression");case dt.braceL:return this.overrideContext(Gr.b_expr),this.parseObj(!1,vt);case dt._function:return Ut=this.startNode(),this.next(),this.parseFunction(Ut,0);case dt._class:return this.parseClass(this.startNode(),!1);case dt._new:return this.parseNew();case dt.backQuote:return this.parseTemplate();case dt._import:return this.options.ecmaVersion>=11?this.parseExprImport(Ft):this.unexpected();default:return this.parseExprAtomDefault()}},Rr.parseExprAtomDefault=function(){this.unexpected()},Rr.parseExprImport=function(vt){var Rt=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===dt.parenL&&!vt)return this.parseDynamicImport(Rt);if(this.type===dt.dot){var Ft=this.startNodeAt(Rt.start,Rt.loc&&Rt.loc.start);return Ft.name="import",Rt.meta=this.finishNode(Ft,"Identifier"),this.parseImportMeta(Rt)}else this.unexpected()},Rr.parseDynamicImport=function(vt){if(this.next(),vt.source=this.parseMaybeAssign(),!this.eat(dt.parenR)){var Rt=this.start;this.eat(dt.comma)&&this.eat(dt.parenR)?this.raiseRecoverable(Rt,"Trailing comma is not allowed in import()"):this.unexpected(Rt)}return this.finishNode(vt,"ImportExpression")},Rr.parseImportMeta=function(vt){this.next();var Rt=this.containsEsc;return vt.property=this.parseIdent(!0),vt.property.name!=="meta"&&this.raiseRecoverable(vt.property.start,"The only valid meta property for import is 'import.meta'"),Rt&&this.raiseRecoverable(vt.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(vt.start,"Cannot use 'import.meta' outside a module"),this.finishNode(vt,"MetaProperty")},Rr.parseLiteral=function(vt){var Rt=this.startNode();return Rt.value=vt,Rt.raw=this.input.slice(this.start,this.end),Rt.raw.charCodeAt(Rt.raw.length-1)===110&&(Rt.bigint=Rt.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(Rt,"Literal")},Rr.parseParenExpression=function(){this.expect(dt.parenL);var vt=this.parseExpression();return this.expect(dt.parenR),vt},Rr.shouldParseArrow=function(vt){return!this.canInsertSemicolon()},Rr.parseParenAndDistinguishExpression=function(vt,Rt){var Ft=this.start,Ut=this.startLoc,sr,vr=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var wr=this.start,Fr=this.startLoc,Br=[],ln=!0,hn=!1,jn=new Yt,Ts=this.yieldPos,Cs=this.awaitPos,Ls;for(this.yieldPos=0,this.awaitPos=0;this.type!==dt.parenR;)if(ln?ln=!1:this.expect(dt.comma),vr&&this.afterTrailingComma(dt.parenR,!0)){hn=!0;break}else if(this.type===dt.ellipsis){Ls=this.start,Br.push(this.parseParenItem(this.parseRestBinding())),this.type===dt.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else Br.push(this.parseMaybeAssign(!1,jn,this.parseParenItem));var yo=this.lastTokEnd,kn=this.lastTokEndLoc;if(this.expect(dt.parenR),vt&&this.shouldParseArrow(Br)&&this.eat(dt.arrow))return this.checkPatternErrors(jn,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=Ts,this.awaitPos=Cs,this.parseParenArrowList(Ft,Ut,Br,Rt);(!Br.length||hn)&&this.unexpected(this.lastTokStart),Ls&&this.unexpected(Ls),this.checkExpressionErrors(jn,!0),this.yieldPos=Ts||this.yieldPos,this.awaitPos=Cs||this.awaitPos,Br.length>1?(sr=this.startNodeAt(wr,Fr),sr.expressions=Br,this.finishNodeAt(sr,"SequenceExpression",yo,kn)):sr=Br[0]}else sr=this.parseParenExpression();if(this.options.preserveParens){var Tn=this.startNodeAt(Ft,Ut);return Tn.expression=sr,this.finishNode(Tn,"ParenthesizedExpression")}else return sr},Rr.parseParenItem=function(vt){return vt},Rr.parseParenArrowList=function(vt,Rt,Ft,Ut){return this.parseArrowExpression(this.startNodeAt(vt,Rt),Ft,!1,Ut)};var Rs=[];Rr.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var vt=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===dt.dot){var Rt=this.startNodeAt(vt.start,vt.loc&&vt.loc.start);Rt.name="new",vt.meta=this.finishNode(Rt,"Identifier"),this.next();var Ft=this.containsEsc;return vt.property=this.parseIdent(!0),vt.property.name!=="target"&&this.raiseRecoverable(vt.property.start,"The only valid meta property for new is 'new.target'"),Ft&&this.raiseRecoverable(vt.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(vt.start,"'new.target' can only be used in functions and class static block"),this.finishNode(vt,"MetaProperty")}var Ut=this.start,sr=this.startLoc;return vt.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),Ut,sr,!0,!1),this.eat(dt.parenL)?vt.arguments=this.parseExprList(dt.parenR,this.options.ecmaVersion>=8,!1):vt.arguments=Rs,this.finishNode(vt,"NewExpression")},Rr.parseTemplateElement=function(vt){var Rt=vt.isTagged,Ft=this.startNode();return this.type===dt.invalidTemplate?(Rt||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),Ft.value={raw:this.value,cooked:null}):Ft.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,` `),cooked:this.value},this.next(),Ft.tail=this.type===dt.backQuote,this.finishNode(Ft,"TemplateElement")},Rr.parseTemplate=function(vt){vt===void 0&&(vt={});var Rt=vt.isTagged;Rt===void 0&&(Rt=!1);var Ft=this.startNode();this.next(),Ft.expressions=[];var Ut=this.parseTemplateElement({isTagged:Rt});for(Ft.quasis=[Ut];!Ut.tail;)this.type===dt.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(dt.dollarBraceL),Ft.expressions.push(this.parseExpression()),this.expect(dt.braceR),Ft.quasis.push(Ut=this.parseTemplateElement({isTagged:Rt}));return this.next(),this.finishNode(Ft,"TemplateLiteral")},Rr.isAsyncProp=function(vt){return!vt.computed&&vt.key.type==="Identifier"&&vt.key.name==="async"&&(this.type===dt.name||this.type===dt.num||this.type===dt.string||this.type===dt.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===dt.star)&&!St.test(this.input.slice(this.lastTokEnd,this.start))},Rr.parseObj=function(vt,Rt){var Ft=this.startNode(),Ut=!0,sr={};for(Ft.properties=[],this.next();!this.eat(dt.braceR);){if(Ut)Ut=!1;else if(this.expect(dt.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(dt.braceR))break;var vr=this.parseProperty(vt,Rt);vt||this.checkPropClash(vr,sr,Rt),Ft.properties.push(vr)}return this.finishNode(Ft,vt?"ObjectPattern":"ObjectExpression")},Rr.parseProperty=function(vt,Rt){var Ft=this.startNode(),Ut,sr,vr,wr;if(this.options.ecmaVersion>=9&&this.eat(dt.ellipsis))return vt?(Ft.argument=this.parseIdent(!1),this.type===dt.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(Ft,"RestElement")):(Ft.argument=this.parseMaybeAssign(!1,Rt),this.type===dt.comma&&Rt&&Rt.trailingComma<0&&(Rt.trailingComma=this.start),this.finishNode(Ft,"SpreadElement"));this.options.ecmaVersion>=6&&(Ft.method=!1,Ft.shorthand=!1,(vt||Rt)&&(vr=this.start,wr=this.startLoc),vt||(Ut=this.eat(dt.star)));var Fr=this.containsEsc;return this.parsePropertyName(Ft),!vt&&!Fr&&this.options.ecmaVersion>=8&&!Ut&&this.isAsyncProp(Ft)?(sr=!0,Ut=this.options.ecmaVersion>=9&&this.eat(dt.star),this.parsePropertyName(Ft)):sr=!1,this.parsePropertyValue(Ft,vt,Ut,sr,vr,wr,Rt,Fr),this.finishNode(Ft,"Property")},Rr.parseGetterSetter=function(vt){vt.kind=vt.key.name,this.parsePropertyName(vt),vt.value=this.parseMethod(!1);var Rt=vt.kind==="get"?0:1;if(vt.value.params.length!==Rt){var Ft=vt.value.start;vt.kind==="get"?this.raiseRecoverable(Ft,"getter should have no params"):this.raiseRecoverable(Ft,"setter should have exactly one param")}else vt.kind==="set"&&vt.value.params[0].type==="RestElement"&&this.raiseRecoverable(vt.value.params[0].start,"Setter cannot use rest params")},Rr.parsePropertyValue=function(vt,Rt,Ft,Ut,sr,vr,wr,Fr){(Ft||Ut)&&this.type===dt.colon&&this.unexpected(),this.eat(dt.colon)?(vt.value=Rt?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,wr),vt.kind="init"):this.options.ecmaVersion>=6&&this.type===dt.parenL?(Rt&&this.unexpected(),vt.kind="init",vt.method=!0,vt.value=this.parseMethod(Ft,Ut)):!Rt&&!Fr&&this.options.ecmaVersion>=5&&!vt.computed&&vt.key.type==="Identifier"&&(vt.key.name==="get"||vt.key.name==="set")&&this.type!==dt.comma&&this.type!==dt.braceR&&this.type!==dt.eq?((Ft||Ut)&&this.unexpected(),this.parseGetterSetter(vt)):this.options.ecmaVersion>=6&&!vt.computed&&vt.key.type==="Identifier"?((Ft||Ut)&&this.unexpected(),this.checkUnreserved(vt.key),vt.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=sr),vt.kind="init",Rt?vt.value=this.parseMaybeDefault(sr,vr,this.copyNode(vt.key)):this.type===dt.eq&&wr?(wr.shorthandAssign<0&&(wr.shorthandAssign=this.start),vt.value=this.parseMaybeDefault(sr,vr,this.copyNode(vt.key))):vt.value=this.copyNode(vt.key),vt.shorthand=!0):this.unexpected()},Rr.parsePropertyName=function(vt){if(this.options.ecmaVersion>=6){if(this.eat(dt.bracketL))return vt.computed=!0,vt.key=this.parseMaybeAssign(),this.expect(dt.bracketR),vt.key;vt.computed=!1}return vt.key=this.type===dt.num||this.type===dt.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")},Rr.initFunction=function(vt){vt.id=null,this.options.ecmaVersion>=6&&(vt.generator=vt.expression=!1),this.options.ecmaVersion>=8&&(vt.async=!1)},Rr.parseMethod=function(vt,Rt,Ft){var Ut=this.startNode(),sr=this.yieldPos,vr=this.awaitPos,wr=this.awaitIdentPos;return this.initFunction(Ut),this.options.ecmaVersion>=6&&(Ut.generator=vt),this.options.ecmaVersion>=8&&(Ut.async=!!Rt),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(on(Rt,Ut.generator)|Sr|(Ft?dr:0)),this.expect(dt.parenL),Ut.params=this.parseBindingList(dt.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(Ut,!1,!0,!1),this.yieldPos=sr,this.awaitPos=vr,this.awaitIdentPos=wr,this.finishNode(Ut,"FunctionExpression")},Rr.parseArrowExpression=function(vt,Rt,Ft,Ut){var sr=this.yieldPos,vr=this.awaitPos,wr=this.awaitIdentPos;return this.enterScope(on(Ft,!1)|Qt),this.initFunction(vt),this.options.ecmaVersion>=8&&(vt.async=!!Ft),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,vt.params=this.toAssignableList(Rt,!0),this.parseFunctionBody(vt,!0,!1,Ut),this.yieldPos=sr,this.awaitPos=vr,this.awaitIdentPos=wr,this.finishNode(vt,"ArrowFunctionExpression")},Rr.parseFunctionBody=function(vt,Rt,Ft,Ut){var sr=Rt&&this.type!==dt.braceL,vr=this.strict,wr=!1;if(sr)vt.body=this.parseMaybeAssign(Ut),vt.expression=!0,this.checkParams(vt,!1);else{var Fr=this.options.ecmaVersion>=7&&!this.isSimpleParamList(vt.params);(!vr||Fr)&&(wr=this.strictDirective(this.end),wr&&Fr&&this.raiseRecoverable(vt.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var Br=this.labels;this.labels=[],wr&&(this.strict=!0),this.checkParams(vt,!vr&&!wr&&!Rt&&!Ft&&this.isSimpleParamList(vt.params)),this.strict&&vt.id&&this.checkLValSimple(vt.id,In),vt.body=this.parseBlock(!1,void 0,wr&&!vr),vt.expression=!1,this.adaptDirectivePrologue(vt.body.body),this.labels=Br}this.exitScope()},Rr.isSimpleParamList=function(vt){for(var Rt=0,Ft=vt;Rt-1||sr.functions.indexOf(vt)>-1||sr.var.indexOf(vt)>-1,sr.lexical.push(vt),this.inModule&&sr.flags&mr&&delete this.undefinedExports[vt]}else if(Rt===Hn){var vr=this.currentScope();vr.lexical.push(vt)}else if(Rt===pn){var wr=this.currentScope();this.treatFunctionsAsVar?Ut=wr.lexical.indexOf(vt)>-1:Ut=wr.lexical.indexOf(vt)>-1||wr.var.indexOf(vt)>-1,wr.functions.push(vt)}else for(var Fr=this.scopeStack.length-1;Fr>=0;--Fr){var Br=this.scopeStack[Fr];if(Br.lexical.indexOf(vt)>-1&&!(Br.flags&xr&&Br.lexical[0]===vt)||!this.treatFunctionsAsVarInScope(Br)&&Br.functions.indexOf(vt)>-1){Ut=!0;break}if(Br.var.push(vt),this.inModule&&Br.flags&mr&&delete this.undefinedExports[vt],Br.flags&tn)break}Ut&&this.raiseRecoverable(Ft,"Identifier '"+vt+"' has already been declared")},Xn.checkLocalExport=function(vt){this.scopeStack[0].lexical.indexOf(vt.name)===-1&&this.scopeStack[0].var.indexOf(vt.name)===-1&&(this.undefinedExports[vt.name]=vt)},Xn.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},Xn.currentVarScope=function(){for(var vt=this.scopeStack.length-1;;vt--){var Rt=this.scopeStack[vt];if(Rt.flags&tn)return Rt}},Xn.currentThisScope=function(){for(var vt=this.scopeStack.length-1;;vt--){var Rt=this.scopeStack[vt];if(Rt.flags&tn&&!(Rt.flags&Qt))return Rt}};var Ns=function(Rt,Ft,Ut){this.type="",this.start=Ft,this.end=0,Rt.options.locations&&(this.loc=new zt(Rt,Ut)),Rt.options.directSourceFile&&(this.sourceFile=Rt.options.directSourceFile),Rt.options.ranges&&(this.range=[Ft,0])},ms=_r.prototype;ms.startNode=function(){return new Ns(this,this.start,this.startLoc)},ms.startNodeAt=function(vt,Rt){return new Ns(this,vt,Rt)};function no(vt,Rt,Ft,Ut){return vt.type=Rt,vt.end=Ft,this.options.locations&&(vt.loc.end=Ut),this.options.ranges&&(vt.range[1]=Ft),vt}ms.finishNode=function(vt,Rt){return no.call(this,vt,Rt,this.lastTokEnd,this.lastTokEndLoc)},ms.finishNodeAt=function(vt,Rt,Ft,Ut){return no.call(this,vt,Rt,Ft,Ut)},ms.copyNode=function(vt){var Rt=new Ns(this,vt.start,this.startLoc);for(var Ft in vt)Rt[Ft]=vt[Ft];return Rt};var Vs="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",io=Vs+" Extended_Pictographic",us=io,cs=us+" EBase EComp EMod EPres ExtPict",Gs=cs,Jr=Gs,hs={9:Vs,10:io,11:us,12:cs,13:Gs,14:Jr},Ks="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",ws={9:"",10:"",11:"",12:"",13:"",14:Ks},Zn="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",ho="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",so=ho+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",fo=so+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",po=fo+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",oo=po+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",fs=oo+" Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz",_s={9:ho,10:so,11:fo,12:po,13:oo,14:fs},Is={};function Es(vt){var Rt=Is[vt]={binary:Dt(hs[vt]+" "+Zn),binaryOfStrings:Dt(ws[vt]),nonBinary:{General_Category:Dt(Zn),Script:Dt(_s[vt])}};Rt.nonBinary.Script_Extensions=Rt.nonBinary.Script,Rt.nonBinary.gc=Rt.nonBinary.General_Category,Rt.nonBinary.sc=Rt.nonBinary.Script,Rt.nonBinary.scx=Rt.nonBinary.Script_Extensions}for(var Xs=0,gs=[9,10,11,12,13,14];Xs=6?"uy":"")+(Rt.options.ecmaVersion>=9?"s":"")+(Rt.options.ecmaVersion>=13?"d":"")+(Rt.options.ecmaVersion>=15?"v":""),this.unicodeProperties=Is[Rt.options.ecmaVersion>=14?14:Rt.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};Qn.prototype.reset=function(Rt,Ft,Ut){var sr=Ut.indexOf("v")!==-1,vr=Ut.indexOf("u")!==-1;this.start=Rt|0,this.source=Ft+"",this.flags=Ut,sr&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=vr&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=vr&&this.parser.options.ecmaVersion>=9)},Qn.prototype.raise=function(Rt){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+Rt)},Qn.prototype.at=function(Rt,Ft){Ft===void 0&&(Ft=!1);var Ut=this.source,sr=Ut.length;if(Rt>=sr)return-1;var vr=Ut.charCodeAt(Rt);if(!(Ft||this.switchU)||vr<=55295||vr>=57344||Rt+1>=sr)return vr;var wr=Ut.charCodeAt(Rt+1);return wr>=56320&&wr<=57343?(vr<<10)+wr-56613888:vr},Qn.prototype.nextIndex=function(Rt,Ft){Ft===void 0&&(Ft=!1);var Ut=this.source,sr=Ut.length;if(Rt>=sr)return sr;var vr=Ut.charCodeAt(Rt),wr;return!(Ft||this.switchU)||vr<=55295||vr>=57344||Rt+1>=sr||(wr=Ut.charCodeAt(Rt+1))<56320||wr>57343?Rt+1:Rt+2},Qn.prototype.current=function(Rt){return Rt===void 0&&(Rt=!1),this.at(this.pos,Rt)},Qn.prototype.lookahead=function(Rt){return Rt===void 0&&(Rt=!1),this.at(this.nextIndex(this.pos,Rt),Rt)},Qn.prototype.advance=function(Rt){Rt===void 0&&(Rt=!1),this.pos=this.nextIndex(this.pos,Rt)},Qn.prototype.eat=function(Rt,Ft){return Ft===void 0&&(Ft=!1),this.current(Ft)===Rt?(this.advance(Ft),!0):!1},Qn.prototype.eatChars=function(Rt,Ft){Ft===void 0&&(Ft=!1);for(var Ut=this.pos,sr=0,vr=Rt;sr-1&&this.raise(vt.start,"Duplicate regular expression flag"),wr==="u"&&(Ut=!0),wr==="v"&&(sr=!0)}this.options.ecmaVersion>=15&&Ut&&sr&&this.raise(vt.start,"Invalid regular expression flag")},Xr.validateRegExpPattern=function(vt){this.regexp_pattern(vt),!vt.switchN&&this.options.ecmaVersion>=9&&vt.groupNames.length>0&&(vt.switchN=!0,this.regexp_pattern(vt))},Xr.regexp_pattern=function(vt){vt.pos=0,vt.lastIntValue=0,vt.lastStringValue="",vt.lastAssertionIsQuantifiable=!1,vt.numCapturingParens=0,vt.maxBackReference=0,vt.groupNames.length=0,vt.backReferenceNames.length=0,this.regexp_disjunction(vt),vt.pos!==vt.source.length&&(vt.eat(41)&&vt.raise("Unmatched ')'"),(vt.eat(93)||vt.eat(125))&&vt.raise("Lone quantifier brackets")),vt.maxBackReference>vt.numCapturingParens&&vt.raise("Invalid escape");for(var Rt=0,Ft=vt.backReferenceNames;Rt=9&&(Ft=vt.eat(60)),vt.eat(61)||vt.eat(33))return this.regexp_disjunction(vt),vt.eat(41)||vt.raise("Unterminated group"),vt.lastAssertionIsQuantifiable=!Ft,!0}return vt.pos=Rt,!1},Xr.regexp_eatQuantifier=function(vt,Rt){return Rt===void 0&&(Rt=!1),this.regexp_eatQuantifierPrefix(vt,Rt)?(vt.eat(63),!0):!1},Xr.regexp_eatQuantifierPrefix=function(vt,Rt){return vt.eat(42)||vt.eat(43)||vt.eat(63)||this.regexp_eatBracedQuantifier(vt,Rt)},Xr.regexp_eatBracedQuantifier=function(vt,Rt){var Ft=vt.pos;if(vt.eat(123)){var Ut=0,sr=-1;if(this.regexp_eatDecimalDigits(vt)&&(Ut=vt.lastIntValue,vt.eat(44)&&this.regexp_eatDecimalDigits(vt)&&(sr=vt.lastIntValue),vt.eat(125)))return sr!==-1&&sr=9?this.regexp_groupSpecifier(vt):vt.current()===63&&vt.raise("Invalid group"),this.regexp_disjunction(vt),vt.eat(41))return vt.numCapturingParens+=1,!0;vt.raise("Unterminated group")}return!1},Xr.regexp_eatExtendedAtom=function(vt){return vt.eat(46)||this.regexp_eatReverseSolidusAtomEscape(vt)||this.regexp_eatCharacterClass(vt)||this.regexp_eatUncapturingGroup(vt)||this.regexp_eatCapturingGroup(vt)||this.regexp_eatInvalidBracedQuantifier(vt)||this.regexp_eatExtendedPatternCharacter(vt)},Xr.regexp_eatInvalidBracedQuantifier=function(vt){return this.regexp_eatBracedQuantifier(vt,!0)&&vt.raise("Nothing to repeat"),!1},Xr.regexp_eatSyntaxCharacter=function(vt){var Rt=vt.current();return Jn(Rt)?(vt.lastIntValue=Rt,vt.advance(),!0):!1};function Jn(vt){return vt===36||vt>=40&&vt<=43||vt===46||vt===63||vt>=91&&vt<=94||vt>=123&&vt<=125}Xr.regexp_eatPatternCharacters=function(vt){for(var Rt=vt.pos,Ft=0;(Ft=vt.current())!==-1&&!Jn(Ft);)vt.advance();return vt.pos!==Rt},Xr.regexp_eatExtendedPatternCharacter=function(vt){var Rt=vt.current();return Rt!==-1&&Rt!==36&&!(Rt>=40&&Rt<=43)&&Rt!==46&&Rt!==63&&Rt!==91&&Rt!==94&&Rt!==124?(vt.advance(),!0):!1},Xr.regexp_groupSpecifier=function(vt){if(vt.eat(63)){if(this.regexp_eatGroupName(vt)){vt.groupNames.indexOf(vt.lastStringValue)!==-1&&vt.raise("Duplicate capture group name"),vt.groupNames.push(vt.lastStringValue);return}vt.raise("Invalid group")}},Xr.regexp_eatGroupName=function(vt){if(vt.lastStringValue="",vt.eat(60)){if(this.regexp_eatRegExpIdentifierName(vt)&&vt.eat(62))return!0;vt.raise("Invalid capture group name")}return!1},Xr.regexp_eatRegExpIdentifierName=function(vt){if(vt.lastStringValue="",this.regexp_eatRegExpIdentifierStart(vt)){for(vt.lastStringValue+=Bt(vt.lastIntValue);this.regexp_eatRegExpIdentifierPart(vt);)vt.lastStringValue+=Bt(vt.lastIntValue);return!0}return!1},Xr.regexp_eatRegExpIdentifierStart=function(vt){var Rt=vt.pos,Ft=this.options.ecmaVersion>=11,Ut=vt.current(Ft);return vt.advance(Ft),Ut===92&&this.regexp_eatRegExpUnicodeEscapeSequence(vt,Ft)&&(Ut=vt.lastIntValue),mo(Ut)?(vt.lastIntValue=Ut,!0):(vt.pos=Rt,!1)};function mo(vt){return st(vt,!0)||vt===36||vt===95}Xr.regexp_eatRegExpIdentifierPart=function(vt){var Rt=vt.pos,Ft=this.options.ecmaVersion>=11,Ut=vt.current(Ft);return vt.advance(Ft),Ut===92&&this.regexp_eatRegExpUnicodeEscapeSequence(vt,Ft)&&(Ut=vt.lastIntValue),wo(Ut)?(vt.lastIntValue=Ut,!0):(vt.pos=Rt,!1)};function wo(vt){return lt(vt,!0)||vt===36||vt===95||vt===8204||vt===8205}Xr.regexp_eatAtomEscape=function(vt){return this.regexp_eatBackReference(vt)||this.regexp_eatCharacterClassEscape(vt)||this.regexp_eatCharacterEscape(vt)||vt.switchN&&this.regexp_eatKGroupName(vt)?!0:(vt.switchU&&(vt.current()===99&&vt.raise("Invalid unicode escape"),vt.raise("Invalid escape")),!1)},Xr.regexp_eatBackReference=function(vt){var Rt=vt.pos;if(this.regexp_eatDecimalEscape(vt)){var Ft=vt.lastIntValue;if(vt.switchU)return Ft>vt.maxBackReference&&(vt.maxBackReference=Ft),!0;if(Ft<=vt.numCapturingParens)return!0;vt.pos=Rt}return!1},Xr.regexp_eatKGroupName=function(vt){if(vt.eat(107)){if(this.regexp_eatGroupName(vt))return vt.backReferenceNames.push(vt.lastStringValue),!0;vt.raise("Invalid named reference")}return!1},Xr.regexp_eatCharacterEscape=function(vt){return this.regexp_eatControlEscape(vt)||this.regexp_eatCControlLetter(vt)||this.regexp_eatZero(vt)||this.regexp_eatHexEscapeSequence(vt)||this.regexp_eatRegExpUnicodeEscapeSequence(vt,!1)||!vt.switchU&&this.regexp_eatLegacyOctalEscapeSequence(vt)||this.regexp_eatIdentityEscape(vt)},Xr.regexp_eatCControlLetter=function(vt){var Rt=vt.pos;if(vt.eat(99)){if(this.regexp_eatControlLetter(vt))return!0;vt.pos=Rt}return!1},Xr.regexp_eatZero=function(vt){return vt.current()===48&&!zn(vt.lookahead())?(vt.lastIntValue=0,vt.advance(),!0):!1},Xr.regexp_eatControlEscape=function(vt){var Rt=vt.current();return Rt===116?(vt.lastIntValue=9,vt.advance(),!0):Rt===110?(vt.lastIntValue=10,vt.advance(),!0):Rt===118?(vt.lastIntValue=11,vt.advance(),!0):Rt===102?(vt.lastIntValue=12,vt.advance(),!0):Rt===114?(vt.lastIntValue=13,vt.advance(),!0):!1},Xr.regexp_eatControlLetter=function(vt){var Rt=vt.current();return go(Rt)?(vt.lastIntValue=Rt%32,vt.advance(),!0):!1};function go(vt){return vt>=65&&vt<=90||vt>=97&&vt<=122}Xr.regexp_eatRegExpUnicodeEscapeSequence=function(vt,Rt){Rt===void 0&&(Rt=!1);var Ft=vt.pos,Ut=Rt||vt.switchU;if(vt.eat(117)){if(this.regexp_eatFixedHexDigits(vt,4)){var sr=vt.lastIntValue;if(Ut&&sr>=55296&&sr<=56319){var vr=vt.pos;if(vt.eat(92)&&vt.eat(117)&&this.regexp_eatFixedHexDigits(vt,4)){var wr=vt.lastIntValue;if(wr>=56320&&wr<=57343)return vt.lastIntValue=(sr-55296)*1024+(wr-56320)+65536,!0}vt.pos=vr,vt.lastIntValue=sr}return!0}if(Ut&&vt.eat(123)&&this.regexp_eatHexDigits(vt)&&vt.eat(125)&&wt(vt.lastIntValue))return!0;Ut&&vt.raise("Invalid unicode escape"),vt.pos=Ft}return!1};function wt(vt){return vt>=0&&vt<=1114111}Xr.regexp_eatIdentityEscape=function(vt){if(vt.switchU)return this.regexp_eatSyntaxCharacter(vt)?!0:vt.eat(47)?(vt.lastIntValue=47,!0):!1;var Rt=vt.current();return Rt!==99&&(!vt.switchN||Rt!==107)?(vt.lastIntValue=Rt,vt.advance(),!0):!1},Xr.regexp_eatDecimalEscape=function(vt){vt.lastIntValue=0;var Rt=vt.current();if(Rt>=49&&Rt<=57){do vt.lastIntValue=10*vt.lastIntValue+(Rt-48),vt.advance();while((Rt=vt.current())>=48&&Rt<=57);return!0}return!1};var Lt=0,Vt=1,Xt=2;Xr.regexp_eatCharacterClassEscape=function(vt){var Rt=vt.current();if(or(Rt))return vt.lastIntValue=-1,vt.advance(),Vt;var Ft=!1;if(vt.switchU&&this.options.ecmaVersion>=9&&((Ft=Rt===80)||Rt===112)){vt.lastIntValue=-1,vt.advance();var Ut;if(vt.eat(123)&&(Ut=this.regexp_eatUnicodePropertyValueExpression(vt))&&vt.eat(125))return Ft&&Ut===Xt&&vt.raise("Invalid property name"),Ut;vt.raise("Invalid property name")}return Lt};function or(vt){return vt===100||vt===68||vt===115||vt===83||vt===119||vt===87}Xr.regexp_eatUnicodePropertyValueExpression=function(vt){var Rt=vt.pos;if(this.regexp_eatUnicodePropertyName(vt)&&vt.eat(61)){var Ft=vt.lastStringValue;if(this.regexp_eatUnicodePropertyValue(vt)){var Ut=vt.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(vt,Ft,Ut),Vt}}if(vt.pos=Rt,this.regexp_eatLoneUnicodePropertyNameOrValue(vt)){var sr=vt.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(vt,sr)}return Lt},Xr.regexp_validateUnicodePropertyNameAndValue=function(vt,Rt,Ft){It(vt.unicodeProperties.nonBinary,Rt)||vt.raise("Invalid property name"),vt.unicodeProperties.nonBinary[Rt].test(Ft)||vt.raise("Invalid property value")},Xr.regexp_validateUnicodePropertyNameOrValue=function(vt,Rt){if(vt.unicodeProperties.binary.test(Rt))return Vt;if(vt.switchV&&vt.unicodeProperties.binaryOfStrings.test(Rt))return Xt;vt.raise("Invalid property name")},Xr.regexp_eatUnicodePropertyName=function(vt){var Rt=0;for(vt.lastStringValue="";br(Rt=vt.current());)vt.lastStringValue+=Bt(Rt),vt.advance();return vt.lastStringValue!==""};function br(vt){return go(vt)||vt===95}Xr.regexp_eatUnicodePropertyValue=function(vt){var Rt=0;for(vt.lastStringValue="";$r(Rt=vt.current());)vt.lastStringValue+=Bt(Rt),vt.advance();return vt.lastStringValue!==""};function $r(vt){return br(vt)||zn(vt)}Xr.regexp_eatLoneUnicodePropertyNameOrValue=function(vt){return this.regexp_eatUnicodePropertyValue(vt)},Xr.regexp_eatCharacterClass=function(vt){if(vt.eat(91)){var Rt=vt.eat(94),Ft=this.regexp_classContents(vt);return vt.eat(93)||vt.raise("Unterminated character class"),Rt&&Ft===Xt&&vt.raise("Negated character class may contain strings"),!0}return!1},Xr.regexp_classContents=function(vt){return vt.current()===93?Vt:vt.switchV?this.regexp_classSetExpression(vt):(this.regexp_nonEmptyClassRanges(vt),Vt)},Xr.regexp_nonEmptyClassRanges=function(vt){for(;this.regexp_eatClassAtom(vt);){var Rt=vt.lastIntValue;if(vt.eat(45)&&this.regexp_eatClassAtom(vt)){var Ft=vt.lastIntValue;vt.switchU&&(Rt===-1||Ft===-1)&&vt.raise("Invalid character class"),Rt!==-1&&Ft!==-1&&Rt>Ft&&vt.raise("Range out of order in character class")}}},Xr.regexp_eatClassAtom=function(vt){var Rt=vt.pos;if(vt.eat(92)){if(this.regexp_eatClassEscape(vt))return!0;if(vt.switchU){var Ft=vt.current();(Ft===99||ys(Ft))&&vt.raise("Invalid class escape"),vt.raise("Invalid escape")}vt.pos=Rt}var Ut=vt.current();return Ut!==93?(vt.lastIntValue=Ut,vt.advance(),!0):!1},Xr.regexp_eatClassEscape=function(vt){var Rt=vt.pos;if(vt.eat(98))return vt.lastIntValue=8,!0;if(vt.switchU&&vt.eat(45))return vt.lastIntValue=45,!0;if(!vt.switchU&&vt.eat(99)){if(this.regexp_eatClassControlLetter(vt))return!0;vt.pos=Rt}return this.regexp_eatCharacterClassEscape(vt)||this.regexp_eatCharacterEscape(vt)},Xr.regexp_classSetExpression=function(vt){var Rt=Vt,Ft;if(!this.regexp_eatClassSetRange(vt))if(Ft=this.regexp_eatClassSetOperand(vt)){Ft===Xt&&(Rt=Xt);for(var Ut=vt.pos;vt.eatChars([38,38]);){if(vt.current()!==38&&(Ft=this.regexp_eatClassSetOperand(vt))){Ft!==Xt&&(Rt=Vt);continue}vt.raise("Invalid character in character class")}if(Ut!==vt.pos)return Rt;for(;vt.eatChars([45,45]);)this.regexp_eatClassSetOperand(vt)||vt.raise("Invalid character in character class");if(Ut!==vt.pos)return Rt}else vt.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(vt)){if(Ft=this.regexp_eatClassSetOperand(vt),!Ft)return Rt;Ft===Xt&&(Rt=Xt)}},Xr.regexp_eatClassSetRange=function(vt){var Rt=vt.pos;if(this.regexp_eatClassSetCharacter(vt)){var Ft=vt.lastIntValue;if(vt.eat(45)&&this.regexp_eatClassSetCharacter(vt)){var Ut=vt.lastIntValue;return Ft!==-1&&Ut!==-1&&Ft>Ut&&vt.raise("Range out of order in character class"),!0}vt.pos=Rt}return!1},Xr.regexp_eatClassSetOperand=function(vt){return this.regexp_eatClassSetCharacter(vt)?Vt:this.regexp_eatClassStringDisjunction(vt)||this.regexp_eatNestedClass(vt)},Xr.regexp_eatNestedClass=function(vt){var Rt=vt.pos;if(vt.eat(91)){var Ft=vt.eat(94),Ut=this.regexp_classContents(vt);if(vt.eat(93))return Ft&&Ut===Xt&&vt.raise("Negated character class may contain strings"),Ut;vt.pos=Rt}if(vt.eat(92)){var sr=this.regexp_eatCharacterClassEscape(vt);if(sr)return sr;vt.pos=Rt}return null},Xr.regexp_eatClassStringDisjunction=function(vt){var Rt=vt.pos;if(vt.eatChars([92,113])){if(vt.eat(123)){var Ft=this.regexp_classStringDisjunctionContents(vt);if(vt.eat(125))return Ft}else vt.raise("Invalid escape");vt.pos=Rt}return null},Xr.regexp_classStringDisjunctionContents=function(vt){for(var Rt=this.regexp_classString(vt);vt.eat(124);)this.regexp_classString(vt)===Xt&&(Rt=Xt);return Rt},Xr.regexp_classString=function(vt){for(var Rt=0;this.regexp_eatClassSetCharacter(vt);)Rt++;return Rt===1?Vt:Xt},Xr.regexp_eatClassSetCharacter=function(vt){var Rt=vt.pos;if(vt.eat(92))return this.regexp_eatCharacterEscape(vt)||this.regexp_eatClassSetReservedPunctuator(vt)?!0:vt.eat(98)?(vt.lastIntValue=8,!0):(vt.pos=Rt,!1);var Ft=vt.current();return Ft<0||Ft===vt.lookahead()&&zr(Ft)||Zr(Ft)?!1:(vt.advance(),vt.lastIntValue=Ft,!0)};function zr(vt){return vt===33||vt>=35&&vt<=38||vt>=42&&vt<=44||vt===46||vt>=58&&vt<=64||vt===94||vt===96||vt===126}function Zr(vt){return vt===40||vt===41||vt===45||vt===47||vt>=91&&vt<=93||vt>=123&&vt<=125}Xr.regexp_eatClassSetReservedPunctuator=function(vt){var Rt=vt.current();return wn(Rt)?(vt.lastIntValue=Rt,vt.advance(),!0):!1};function wn(vt){return vt===33||vt===35||vt===37||vt===38||vt===44||vt===45||vt>=58&&vt<=62||vt===64||vt===96||vt===126}Xr.regexp_eatClassControlLetter=function(vt){var Rt=vt.current();return zn(Rt)||Rt===95?(vt.lastIntValue=Rt%32,vt.advance(),!0):!1},Xr.regexp_eatHexEscapeSequence=function(vt){var Rt=vt.pos;if(vt.eat(120)){if(this.regexp_eatFixedHexDigits(vt,2))return!0;vt.switchU&&vt.raise("Invalid escape"),vt.pos=Rt}return!1},Xr.regexp_eatDecimalDigits=function(vt){var Rt=vt.pos,Ft=0;for(vt.lastIntValue=0;zn(Ft=vt.current());)vt.lastIntValue=10*vt.lastIntValue+(Ft-48),vt.advance();return vt.pos!==Rt};function zn(vt){return vt>=48&&vt<=57}Xr.regexp_eatHexDigits=function(vt){var Rt=vt.pos,Ft=0;for(vt.lastIntValue=0;_i(Ft=vt.current());)vt.lastIntValue=16*vt.lastIntValue+es(Ft),vt.advance();return vt.pos!==Rt};function _i(vt){return vt>=48&&vt<=57||vt>=65&&vt<=70||vt>=97&&vt<=102}function es(vt){return vt>=65&&vt<=70?10+(vt-65):vt>=97&&vt<=102?10+(vt-97):vt-48}Xr.regexp_eatLegacyOctalEscapeSequence=function(vt){if(this.regexp_eatOctalDigit(vt)){var Rt=vt.lastIntValue;if(this.regexp_eatOctalDigit(vt)){var Ft=vt.lastIntValue;Rt<=3&&this.regexp_eatOctalDigit(vt)?vt.lastIntValue=Rt*64+Ft*8+vt.lastIntValue:vt.lastIntValue=Rt*8+Ft}else vt.lastIntValue=Rt;return!0}return!1},Xr.regexp_eatOctalDigit=function(vt){var Rt=vt.current();return ys(Rt)?(vt.lastIntValue=Rt-48,vt.advance(),!0):(vt.lastIntValue=0,!1)};function ys(vt){return vt>=48&&vt<=55}Xr.regexp_eatFixedHexDigits=function(vt,Rt){var Ft=vt.pos;vt.lastIntValue=0;for(var Ut=0;Ut=this.input.length)return this.finishToken(dt.eof);if(vt.override)return vt.override(this);this.readToken(this.fullCharCodeAtPos())},yn.readToken=function(vt){return st(vt,this.options.ecmaVersion>=6)||vt===92?this.readWord():this.getTokenFromCode(vt)},yn.fullCharCodeAtPos=function(){var vt=this.input.charCodeAt(this.pos);if(vt<=55295||vt>=56320)return vt;var Rt=this.input.charCodeAt(this.pos+1);return Rt<=56319||Rt>=57344?vt:(vt<<10)+Rt-56613888},yn.skipBlockComment=function(){var vt=this.options.onComment&&this.curPosition(),Rt=this.pos,Ft=this.input.indexOf("*/",this.pos+=2);if(Ft===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=Ft+2,this.options.locations)for(var Ut=void 0,sr=Rt;(Ut=_t(this.input,sr,this.pos))>-1;)++this.curLine,sr=this.lineStart=Ut;this.options.onComment&&this.options.onComment(!0,this.input.slice(Rt+2,Ft),Rt,this.pos,vt,this.curPosition())},yn.skipLineComment=function(vt){for(var Rt=this.pos,Ft=this.options.onComment&&this.curPosition(),Ut=this.input.charCodeAt(this.pos+=vt);this.pos8&&vt<14||vt>=5760&&Ct.test(String.fromCharCode(vt)))++this.pos;else break e}}},yn.finishToken=function(vt,Rt){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var Ft=this.type;this.type=vt,this.value=Rt,this.updateContext(Ft)},yn.readToken_dot=function(){var vt=this.input.charCodeAt(this.pos+1);if(vt>=48&&vt<=57)return this.readNumber(!0);var Rt=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&vt===46&&Rt===46?(this.pos+=3,this.finishToken(dt.ellipsis)):(++this.pos,this.finishToken(dt.dot))},yn.readToken_slash=function(){var vt=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):vt===61?this.finishOp(dt.assign,2):this.finishOp(dt.slash,1)},yn.readToken_mult_modulo_exp=function(vt){var Rt=this.input.charCodeAt(this.pos+1),Ft=1,Ut=vt===42?dt.star:dt.modulo;return this.options.ecmaVersion>=7&&vt===42&&Rt===42&&(++Ft,Ut=dt.starstar,Rt=this.input.charCodeAt(this.pos+2)),Rt===61?this.finishOp(dt.assign,Ft+1):this.finishOp(Ut,Ft)},yn.readToken_pipe_amp=function(vt){var Rt=this.input.charCodeAt(this.pos+1);if(Rt===vt){if(this.options.ecmaVersion>=12){var Ft=this.input.charCodeAt(this.pos+2);if(Ft===61)return this.finishOp(dt.assign,3)}return this.finishOp(vt===124?dt.logicalOR:dt.logicalAND,2)}return Rt===61?this.finishOp(dt.assign,2):this.finishOp(vt===124?dt.bitwiseOR:dt.bitwiseAND,1)},yn.readToken_caret=function(){var vt=this.input.charCodeAt(this.pos+1);return vt===61?this.finishOp(dt.assign,2):this.finishOp(dt.bitwiseXOR,1)},yn.readToken_plus_min=function(vt){var Rt=this.input.charCodeAt(this.pos+1);return Rt===vt?Rt===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||St.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(dt.incDec,2):Rt===61?this.finishOp(dt.assign,2):this.finishOp(dt.plusMin,1)},yn.readToken_lt_gt=function(vt){var Rt=this.input.charCodeAt(this.pos+1),Ft=1;return Rt===vt?(Ft=vt===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+Ft)===61?this.finishOp(dt.assign,Ft+1):this.finishOp(dt.bitShift,Ft)):Rt===33&&vt===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(Rt===61&&(Ft=2),this.finishOp(dt.relational,Ft))},yn.readToken_eq_excl=function(vt){var Rt=this.input.charCodeAt(this.pos+1);return Rt===61?this.finishOp(dt.equality,this.input.charCodeAt(this.pos+2)===61?3:2):vt===61&&Rt===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(dt.arrow)):this.finishOp(vt===61?dt.eq:dt.prefix,1)},yn.readToken_question=function(){var vt=this.options.ecmaVersion;if(vt>=11){var Rt=this.input.charCodeAt(this.pos+1);if(Rt===46){var Ft=this.input.charCodeAt(this.pos+2);if(Ft<48||Ft>57)return this.finishOp(dt.questionDot,2)}if(Rt===63){if(vt>=12){var Ut=this.input.charCodeAt(this.pos+2);if(Ut===61)return this.finishOp(dt.assign,3)}return this.finishOp(dt.coalesce,2)}}return this.finishOp(dt.question,1)},yn.readToken_numberSign=function(){var vt=this.options.ecmaVersion,Rt=35;if(vt>=13&&(++this.pos,Rt=this.fullCharCodeAtPos(),st(Rt,!0)||Rt===92))return this.finishToken(dt.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+Bt(Rt)+"'")},yn.getTokenFromCode=function(vt){switch(vt){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(dt.parenL);case 41:return++this.pos,this.finishToken(dt.parenR);case 59:return++this.pos,this.finishToken(dt.semi);case 44:return++this.pos,this.finishToken(dt.comma);case 91:return++this.pos,this.finishToken(dt.bracketL);case 93:return++this.pos,this.finishToken(dt.bracketR);case 123:return++this.pos,this.finishToken(dt.braceL);case 125:return++this.pos,this.finishToken(dt.braceR);case 58:return++this.pos,this.finishToken(dt.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(dt.backQuote);case 48:var Rt=this.input.charCodeAt(this.pos+1);if(Rt===120||Rt===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(Rt===111||Rt===79)return this.readRadixNumber(8);if(Rt===98||Rt===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(vt);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(vt);case 124:case 38:return this.readToken_pipe_amp(vt);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(vt);case 60:case 62:return this.readToken_lt_gt(vt);case 61:case 33:return this.readToken_eq_excl(vt);case 63:return this.readToken_question();case 126:return this.finishOp(dt.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+Bt(vt)+"'")},yn.finishOp=function(vt,Rt){var Ft=this.input.slice(this.pos,this.pos+Rt);return this.pos+=Rt,this.finishToken(vt,Ft)},yn.readRegexp=function(){for(var vt,Rt,Ft=this.pos;;){this.pos>=this.input.length&&this.raise(Ft,"Unterminated regular expression");var Ut=this.input.charAt(this.pos);if(St.test(Ut)&&this.raise(Ft,"Unterminated regular expression"),vt)vt=!1;else{if(Ut==="[")Rt=!0;else if(Ut==="]"&&Rt)Rt=!1;else if(Ut==="/"&&!Rt)break;vt=Ut==="\\"}++this.pos}var sr=this.input.slice(Ft,this.pos);++this.pos;var vr=this.pos,wr=this.readWord1();this.containsEsc&&this.unexpected(vr);var Fr=this.regexpState||(this.regexpState=new Qn(this));Fr.reset(Ft,sr,wr),this.validateRegExpFlags(Fr),this.validateRegExpPattern(Fr);var Br=null;try{Br=new RegExp(sr,wr)}catch{}return this.finishToken(dt.regexp,{pattern:sr,flags:wr,value:Br})},yn.readInt=function(vt,Rt,Ft){for(var Ut=this.options.ecmaVersion>=12&&Rt===void 0,sr=Ft&&this.input.charCodeAt(this.pos)===48,vr=this.pos,wr=0,Fr=0,Br=0,ln=Rt??1/0;Br=97?jn=hn-97+10:hn>=65?jn=hn-65+10:hn>=48&&hn<=57?jn=hn-48:jn=1/0,jn>=vt)break;Fr=hn,wr=wr*vt+jn}return Ut&&Fr===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===vr||Rt!=null&&this.pos-vr!==Rt?null:wr};function vs(vt,Rt){return Rt?parseInt(vt,8):parseFloat(vt.replace(/_/g,""))}function ss(vt){return typeof BigInt!="function"?null:BigInt(vt.replace(/_/g,""))}yn.readRadixNumber=function(vt){var Rt=this.pos;this.pos+=2;var Ft=this.readInt(vt);return Ft==null&&this.raise(this.start+2,"Expected number in radix "+vt),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(Ft=ss(this.input.slice(Rt,this.pos)),++this.pos):st(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(dt.num,Ft)},yn.readNumber=function(vt){var Rt=this.pos;!vt&&this.readInt(10,void 0,!0)===null&&this.raise(Rt,"Invalid number");var Ft=this.pos-Rt>=2&&this.input.charCodeAt(Rt)===48;Ft&&this.strict&&this.raise(Rt,"Invalid number");var Ut=this.input.charCodeAt(this.pos);if(!Ft&&!vt&&this.options.ecmaVersion>=11&&Ut===110){var sr=ss(this.input.slice(Rt,this.pos));return++this.pos,st(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(dt.num,sr)}Ft&&/[89]/.test(this.input.slice(Rt,this.pos))&&(Ft=!1),Ut===46&&!Ft&&(++this.pos,this.readInt(10),Ut=this.input.charCodeAt(this.pos)),(Ut===69||Ut===101)&&!Ft&&(Ut=this.input.charCodeAt(++this.pos),(Ut===43||Ut===45)&&++this.pos,this.readInt(10)===null&&this.raise(Rt,"Invalid number")),st(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var vr=vs(this.input.slice(Rt,this.pos),Ft);return this.finishToken(dt.num,vr)},yn.readCodePoint=function(){var vt=this.input.charCodeAt(this.pos),Rt;if(vt===123){this.options.ecmaVersion<6&&this.unexpected();var Ft=++this.pos;Rt=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,Rt>1114111&&this.invalidStringToken(Ft,"Code point out of bounds")}else Rt=this.readHexChar(4);return Rt},yn.readString=function(vt){for(var Rt="",Ft=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var Ut=this.input.charCodeAt(this.pos);if(Ut===vt)break;Ut===92?(Rt+=this.input.slice(Ft,this.pos),Rt+=this.readEscapedChar(!1),Ft=this.pos):Ut===8232||Ut===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(yt(Ut)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return Rt+=this.input.slice(Ft,this.pos++),this.finishToken(dt.string,Rt)};var _o={};yn.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(vt){if(vt===_o)this.readInvalidTemplateToken();else throw vt}this.inTemplateElement=!1},yn.invalidStringToken=function(vt,Rt){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw _o;this.raise(vt,Rt)},yn.readTmplToken=function(){for(var vt="",Rt=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var Ft=this.input.charCodeAt(this.pos);if(Ft===96||Ft===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===dt.template||this.type===dt.invalidTemplate)?Ft===36?(this.pos+=2,this.finishToken(dt.dollarBraceL)):(++this.pos,this.finishToken(dt.backQuote)):(vt+=this.input.slice(Rt,this.pos),this.finishToken(dt.template,vt));if(Ft===92)vt+=this.input.slice(Rt,this.pos),vt+=this.readEscapedChar(!0),Rt=this.pos;else if(yt(Ft)){switch(vt+=this.input.slice(Rt,this.pos),++this.pos,Ft){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:vt+=` `;break;default:vt+=String.fromCharCode(Ft);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),Rt=this.pos}else++this.pos}},yn.readInvalidTemplateToken=function(){for(;this.pos=48&&Rt<=55){var Ut=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],sr=parseInt(Ut,8);return sr>255&&(Ut=Ut.slice(0,-1),sr=parseInt(Ut,8)),this.pos+=Ut.length-1,Rt=this.input.charCodeAt(this.pos),(Ut!=="0"||Rt===56||Rt===57)&&(this.strict||vt)&&this.invalidStringToken(this.pos-1-Ut.length,vt?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(sr)}return yt(Rt)?"":String.fromCharCode(Rt)}},yn.readHexChar=function(vt){var Rt=this.pos,Ft=this.readInt(16,vt);return Ft===null&&this.invalidStringToken(Rt,"Bad character escape sequence"),Ft},yn.readWord1=function(){this.containsEsc=!1;for(var vt="",Rt=!0,Ft=this.pos,Ut=this.options.ecmaVersion>=6;this.pos":9,"<=":9,">=":9,in:9,instanceof:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"%":12,"/":12,"**":13},NEEDS_PARENTHESES=17;astring.NEEDS_PARENTHESES=NEEDS_PARENTHESES;var EXPRESSIONS_PRECEDENCE={ArrayExpression:20,TaggedTemplateExpression:20,ThisExpression:20,Identifier:20,PrivateIdentifier:20,Literal:18,TemplateLiteral:20,Super:20,SequenceExpression:20,MemberExpression:19,ChainExpression:19,CallExpression:19,NewExpression:19,ArrowFunctionExpression:NEEDS_PARENTHESES,ClassExpression:NEEDS_PARENTHESES,FunctionExpression:NEEDS_PARENTHESES,ObjectExpression:NEEDS_PARENTHESES,UpdateExpression:16,UnaryExpression:15,AwaitExpression:15,BinaryExpression:14,LogicalExpression:13,ConditionalExpression:4,AssignmentExpression:3,YieldExpression:2,RestElement:1};astring.EXPRESSIONS_PRECEDENCE=EXPRESSIONS_PRECEDENCE;function formatSequence(i,s){var o=i.generator;if(i.write("("),s!=null&&s.length>0){o[s[0].type](s[0],i);for(var a=s.length,rt=1;rt0){i.write(a);for(var ot=1;ot0){o.VariableDeclarator(a[0],i);for(var et=1;et0){o.write(rt),et&&s.comments!=null&&formatComments(o,s.comments,ot,rt);for(var nt=at.length,it=0;it0){for(;et0&&o.write(", ");var ot=a[et],at=ot.type[6];if(at==="D")o.write(ot.local.name,ot),et++;else if(at==="N")o.write("* as "+ot.local.name,ot),et++;else break}if(et0)for(var et=0;;){var ot=a[et],at=ot.local.name;if(o.write(at,ot),at!==ot.exported.name&&o.write(" as "+ot.exported.name),++et "),s.body.type[0]==="O"?(o.write("("),this.ObjectExpression(s.body,o),o.write(")")):this[s.body.type](s.body,o)},ThisExpression:function(s,o){o.write("this",s)},Super:function(s,o){o.write("super",s)},RestElement:RestElement=function(s,o){o.write("..."),this[s.argument.type](s.argument,o)},SpreadElement:RestElement,YieldExpression:function(s,o){o.write(s.delegate?"yield*":"yield"),s.argument&&(o.write(" "),this[s.argument.type](s.argument,o))},AwaitExpression:function(s,o){o.write("await ",s),formatExpression(o,s.argument,s)},TemplateLiteral:function(s,o){var a=s.quasis,rt=s.expressions;o.write("`");for(var et=rt.length,ot=0;ot0)for(var a=s.elements,rt=a.length,et=0;;){var ot=a[et];if(ot!=null&&this[ot.type](ot,o),++et0){o.write(rt),et&&s.comments!=null&&formatComments(o,s.comments,ot,rt);for(var at=","+rt,nt=s.properties,it=nt.length,j=0;;){var _=nt[j];if(et&&_.comments!=null&&formatComments(o,_.comments,ot,rt),o.write(ot),this[_.type](_,o),++j0)for(var a=s.properties,rt=a.length,et=0;this[a[et].type](a[et],o),++et1||et[0]==="U"&&(et[1]==="n"||et[1]==="p")&&rt.prefix&&rt.operator[0]===a&&(a==="+"||a==="-"))&&o.write(" "),ot?(o.write(a.length>1?" (":"("),this[et](rt,o),o.write(")")):this[et](rt,o)}else this[s.argument.type](s.argument,o),o.write(s.operator)},UpdateExpression:function(s,o){s.prefix?(o.write(s.operator),this[s.argument.type](s.argument,o)):(this[s.argument.type](s.argument,o),o.write(s.operator))},AssignmentExpression:function(s,o){this[s.left.type](s.left,o),o.write(" "+s.operator+" "),this[s.right.type](s.right,o)},AssignmentPattern:function(s,o){this[s.left.type](s.left,o),o.write(" = "),this[s.right.type](s.right,o)},BinaryExpression:BinaryExpression=function(s,o){var a=s.operator==="in";a&&o.write("("),formatExpression(o,s.left,s,!1),o.write(" "+s.operator+" "),formatExpression(o,s.right,s,!0),a&&o.write(")")},LogicalExpression:BinaryExpression,ConditionalExpression:function(s,o){var a=s.test,rt=o.expressionsPrecedence[a.type];rt===NEEDS_PARENTHESES||rt<=o.expressionsPrecedence.ConditionalExpression?(o.write("("),this[a.type](a,o),o.write(")")):this[a.type](a,o),o.write(" ? "),this[s.consequent.type](s.consequent,o),o.write(" : "),this[s.alternate.type](s.alternate,o)},NewExpression:function(s,o){o.write("new ");var a=o.expressionsPrecedence[s.callee.type];a===NEEDS_PARENTHESES||a=48&&Rt<=55){var Ut=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],sr=parseInt(Ut,8);return sr>255&&(Ut=Ut.slice(0,-1),sr=parseInt(Ut,8)),this.pos+=Ut.length-1,Rt=this.input.charCodeAt(this.pos),(Ut!=="0"||Rt===56||Rt===57)&&(this.strict||vt)&&this.invalidStringToken(this.pos-1-Ut.length,vt?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(sr)}return yt(Rt)?"":String.fromCharCode(Rt)}},yn.readHexChar=function(vt){var Rt=this.pos,Ft=this.readInt(16,vt);return Ft===null&&this.invalidStringToken(Rt,"Bad character escape sequence"),Ft},yn.readWord1=function(){this.containsEsc=!1;for(var vt="",Rt=!0,Ft=this.pos,Ut=this.options.ecmaVersion>=6;this.pos":9,"<=":9,">=":9,in:9,instanceof:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"%":12,"/":12,"**":13},NEEDS_PARENTHESES=17;astring.NEEDS_PARENTHESES=NEEDS_PARENTHESES;var EXPRESSIONS_PRECEDENCE={ArrayExpression:20,TaggedTemplateExpression:20,ThisExpression:20,Identifier:20,PrivateIdentifier:20,Literal:18,TemplateLiteral:20,Super:20,SequenceExpression:20,MemberExpression:19,ChainExpression:19,CallExpression:19,NewExpression:19,ArrowFunctionExpression:NEEDS_PARENTHESES,ClassExpression:NEEDS_PARENTHESES,FunctionExpression:NEEDS_PARENTHESES,ObjectExpression:NEEDS_PARENTHESES,UpdateExpression:16,UnaryExpression:15,AwaitExpression:15,BinaryExpression:14,LogicalExpression:13,ConditionalExpression:4,AssignmentExpression:3,YieldExpression:2,RestElement:1};astring.EXPRESSIONS_PRECEDENCE=EXPRESSIONS_PRECEDENCE;function formatSequence(i,s){var o=i.generator;if(i.write("("),s!=null&&s.length>0){o[s[0].type](s[0],i);for(var a=s.length,rt=1;rt0){i.write(a);for(var ot=1;ot0){o.VariableDeclarator(a[0],i);for(var tt=1;tt0){o.write(rt),tt&&s.comments!=null&&formatComments(o,s.comments,ot,rt);for(var nt=at.length,it=0;it0){for(;tt0&&o.write(", ");var ot=a[tt],at=ot.type[6];if(at==="D")o.write(ot.local.name,ot),tt++;else if(at==="N")o.write("* as "+ot.local.name,ot),tt++;else break}if(tt0)for(var tt=0;;){var ot=a[tt],at=ot.local.name;if(o.write(at,ot),at!==ot.exported.name&&o.write(" as "+ot.exported.name),++tt "),s.body.type[0]==="O"?(o.write("("),this.ObjectExpression(s.body,o),o.write(")")):this[s.body.type](s.body,o)},ThisExpression:function(s,o){o.write("this",s)},Super:function(s,o){o.write("super",s)},RestElement:RestElement=function(s,o){o.write("..."),this[s.argument.type](s.argument,o)},SpreadElement:RestElement,YieldExpression:function(s,o){o.write(s.delegate?"yield*":"yield"),s.argument&&(o.write(" "),this[s.argument.type](s.argument,o))},AwaitExpression:function(s,o){o.write("await ",s),formatExpression(o,s.argument,s)},TemplateLiteral:function(s,o){var a=s.quasis,rt=s.expressions;o.write("`");for(var tt=rt.length,ot=0;ot0)for(var a=s.elements,rt=a.length,tt=0;;){var ot=a[tt];if(ot!=null&&this[ot.type](ot,o),++tt0){o.write(rt),tt&&s.comments!=null&&formatComments(o,s.comments,ot,rt);for(var at=","+rt,nt=s.properties,it=nt.length,j=0;;){var _=nt[j];if(tt&&_.comments!=null&&formatComments(o,_.comments,ot,rt),o.write(ot),this[_.type](_,o),++j0)for(var a=s.properties,rt=a.length,tt=0;this[a[tt].type](a[tt],o),++tt1||tt[0]==="U"&&(tt[1]==="n"||tt[1]==="p")&&rt.prefix&&rt.operator[0]===a&&(a==="+"||a==="-"))&&o.write(" "),ot?(o.write(a.length>1?" (":"("),this[tt](rt,o),o.write(")")):this[tt](rt,o)}else this[s.argument.type](s.argument,o),o.write(s.operator)},UpdateExpression:function(s,o){s.prefix?(o.write(s.operator),this[s.argument.type](s.argument,o)):(this[s.argument.type](s.argument,o),o.write(s.operator))},AssignmentExpression:function(s,o){this[s.left.type](s.left,o),o.write(" "+s.operator+" "),this[s.right.type](s.right,o)},AssignmentPattern:function(s,o){this[s.left.type](s.left,o),o.write(" = "),this[s.right.type](s.right,o)},BinaryExpression:BinaryExpression=function(s,o){var a=s.operator==="in";a&&o.write("("),formatExpression(o,s.left,s,!1),o.write(" "+s.operator+" "),formatExpression(o,s.right,s,!0),a&&o.write(")")},LogicalExpression:BinaryExpression,ConditionalExpression:function(s,o){var a=s.test,rt=o.expressionsPrecedence[a.type];rt===NEEDS_PARENTHESES||rt<=o.expressionsPrecedence.ConditionalExpression?(o.write("("),this[a.type](a,o),o.write(")")):this[a.type](a,o),o.write(" ? "),this[s.consequent.type](s.consequent,o),o.write(" : "),this[s.alternate.type](s.alternate,o)},NewExpression:function(s,o){o.write("new ");var a=o.expressionsPrecedence[s.callee.type];a===NEEDS_PARENTHESES||a0&&(this.lineEndSize>0&&(_.length===1?o[j-1]===_:o.endsWith(_))?(this.line+=this.lineEndSize,this.column=0):this.column+=j)}},{key:"toString",value:function(){return this.output}}]),i}();function generate(i,s){var o=new State(s);return o.generator[i.type](i,o),o.output}function commonjsRequire(i){throw new Error('Could not dynamically require "'+i+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var gpuBrowser={exports:{}};/** * gpu.js * http://gpu.rocks/ @@ -1789,11 +1789,11 @@ Defaulting to 2020, but this will stop working in the future.`)),Rt.ecmaVersion= * The MIT License * * Copyright (c) 2022 gpu.js Team - */(function(i,s){(function(o){i.exports=o()})(function(){return function(){function o(a,rt,et){function ot(it,j){if(!rt[it]){if(!a[it]){var _=typeof commonjsRequire=="function"&&commonjsRequire;if(!j&&_)return _(it,!0);if(at)return at(it,!0);var $=new Error("Cannot find module '"+it+"'");throw $.code="MODULE_NOT_FOUND",$}var tt=rt[it]={exports:{}};a[it][0].call(tt.exports,function(st){var lt=a[it][1][st];return ot(lt||st)},tt,tt.exports,o,a,rt,et)}return rt[it].exports}for(var at=typeof commonjsRequire=="function"&&commonjsRequire,nt=0;ntwt)return!1;if(Vt+=Lt[Xt+1],Vt>=wt)return!0}}function ht(wt,Lt){return wt<65?wt===36:wt<91?!0:wt<97?wt===95:wt<123?!0:wt<=65535?wt>=170&&$.test(String.fromCharCode(wt)):Lt===!1?!1:ct(wt,st)}function ut(wt,Lt){return wt<48?wt===36:wt<58?!0:wt<65?!1:wt<91?!0:wt<97?wt===95:wt<123?!0:wt<=65535?wt>=170&&tt.test(String.fromCharCode(wt)):Lt===!1?!1:ct(wt,st)||ct(wt,lt)}var pt=function(Lt,Vt){Vt===void 0&&(Vt={}),this.label=Lt,this.keyword=Vt.keyword,this.beforeExpr=!!Vt.beforeExpr,this.startsExpr=!!Vt.startsExpr,this.isLoop=!!Vt.isLoop,this.isAssign=!!Vt.isAssign,this.prefix=!!Vt.prefix,this.postfix=!!Vt.postfix,this.binop=Vt.binop||null,this.updateContext=null};function mt(wt,Lt){return new pt(wt,{beforeExpr:!0,binop:Lt})}var gt={beforeExpr:!0},dt={startsExpr:!0},St={};function xt(wt,Lt){return Lt===void 0&&(Lt={}),Lt.keyword=wt,St[wt]=new pt(wt,Lt)}var yt={num:new pt("num",dt),regexp:new pt("regexp",dt),string:new pt("string",dt),name:new pt("name",dt),eof:new pt("eof"),bracketL:new pt("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new pt("]"),braceL:new pt("{",{beforeExpr:!0,startsExpr:!0}),braceR:new pt("}"),parenL:new pt("(",{beforeExpr:!0,startsExpr:!0}),parenR:new pt(")"),comma:new pt(",",gt),semi:new pt(";",gt),colon:new pt(":",gt),dot:new pt("."),question:new pt("?",gt),arrow:new pt("=>",gt),template:new pt("template"),invalidTemplate:new pt("invalidTemplate"),ellipsis:new pt("...",gt),backQuote:new pt("`",dt),dollarBraceL:new pt("${",{beforeExpr:!0,startsExpr:!0}),eq:new pt("=",{beforeExpr:!0,isAssign:!0}),assign:new pt("_=",{beforeExpr:!0,isAssign:!0}),incDec:new pt("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new pt("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:mt("||",1),logicalAND:mt("&&",2),bitwiseOR:mt("|",3),bitwiseXOR:mt("^",4),bitwiseAND:mt("&",5),equality:mt("==/!=/===/!==",6),relational:mt("/<=/>=",7),bitShift:mt("<>/>>>",8),plusMin:new pt("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:mt("%",10),star:mt("*",10),slash:mt("/",10),starstar:new pt("**",{beforeExpr:!0}),_break:xt("break"),_case:xt("case",gt),_catch:xt("catch"),_continue:xt("continue"),_debugger:xt("debugger"),_default:xt("default",gt),_do:xt("do",{isLoop:!0,beforeExpr:!0}),_else:xt("else",gt),_finally:xt("finally"),_for:xt("for",{isLoop:!0}),_function:xt("function",dt),_if:xt("if"),_return:xt("return",gt),_switch:xt("switch"),_throw:xt("throw",gt),_try:xt("try"),_var:xt("var"),_const:xt("const"),_while:xt("while",{isLoop:!0}),_with:xt("with"),_new:xt("new",{beforeExpr:!0,startsExpr:!0}),_this:xt("this",dt),_super:xt("super",dt),_class:xt("class",dt),_extends:xt("extends",gt),_export:xt("export"),_import:xt("import",dt),_null:xt("null",dt),_true:xt("true",dt),_false:xt("false",dt),_in:xt("in",{beforeExpr:!0,binop:7}),_instanceof:xt("instanceof",{beforeExpr:!0,binop:7}),_typeof:xt("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:xt("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:xt("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},_t=/\r\n?|\n|\u2028|\u2029/,Ct=new RegExp(_t.source,"g");function Et(wt,Lt){return wt===10||wt===13||!Lt&&(wt===8232||wt===8233)}var kt=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,Tt=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,$t=Object.prototype,It=$t.hasOwnProperty,Ot=$t.toString;function Mt(wt,Lt){return It.call(wt,Lt)}var Dt=Array.isArray||function(wt){return Ot.call(wt)==="[object Array]"};function Bt(wt){return new RegExp("^(?:"+wt.replace(/ /g,"|")+")$")}var Kt=function(Lt,Vt){this.line=Lt,this.column=Vt};Kt.prototype.offset=function(Lt){return new Kt(this.line,this.column+Lt)};var Wt=function(Lt,Vt,Xt){this.start=Vt,this.end=Xt,Lt.sourceFile!==null&&(this.source=Lt.sourceFile)};function zt(wt,Lt){for(var Vt=1,Xt=0;;){Ct.lastIndex=Xt;var or=Ct.exec(wt);if(or&&or.index=2015&&(Lt.ecmaVersion-=2009),Lt.allowReserved==null&&(Lt.allowReserved=Lt.ecmaVersion<5),Dt(Lt.onToken)){var Xt=Lt.onToken;Lt.onToken=function(or){return Xt.push(or)}}return Dt(Lt.onComment)&&(Lt.onComment=qt(Lt,Lt.onComment)),Lt}function qt(wt,Lt){return function(Vt,Xt,or,br,$r,zr){var Zr={type:Vt?"Block":"Line",value:Xt,start:or,end:br};wt.locations&&(Zr.loc=new Wt(this,$r,zr)),wt.ranges&&(Zr.range=[or,br]),Lt.push(Zr)}}var hr=1,fr=2,mr=hr|fr,gr=4,tr=8,rr=16,Qt=32,xr=64,Sr=128;function dr(wt,Lt){return fr|(wt?gr:0)|(Lt?tr:0)}var Ur=0,tn=1,on=2,Rn=3,Nn=4,Mn=5,pn=function(Lt,Vt,Xt){this.options=Lt=Zt(Lt),this.sourceFile=Lt.sourceFile,this.keywords=Bt(nt[Lt.ecmaVersion>=6?6:Lt.sourceType==="module"?"5module":5]);var or="";if(Lt.allowReserved!==!0){for(var br=Lt.ecmaVersion;!(or=ot[br]);br--);Lt.sourceType==="module"&&(or+=" await")}this.reservedWords=Bt(or);var $r=(or?or+" ":"")+ot.strict;this.reservedWordsStrict=Bt($r),this.reservedWordsStrictBind=Bt($r+" "+ot.strictBind),this.input=String(Vt),this.containsEsc=!1,Xt?(this.pos=Xt,this.lineStart=this.input.lastIndexOf(` + */(function(i,s){(function(o){i.exports=o()})(function(){return function(){function o(a,rt,tt){function ot(it,j){if(!rt[it]){if(!a[it]){var _=typeof commonjsRequire=="function"&&commonjsRequire;if(!j&&_)return _(it,!0);if(at)return at(it,!0);var $=new Error("Cannot find module '"+it+"'");throw $.code="MODULE_NOT_FOUND",$}var et=rt[it]={exports:{}};a[it][0].call(et.exports,function(st){var lt=a[it][1][st];return ot(lt||st)},et,et.exports,o,a,rt,tt)}return rt[it].exports}for(var at=typeof commonjsRequire=="function"&&commonjsRequire,nt=0;ntwt)return!1;if(Vt+=Lt[Xt+1],Vt>=wt)return!0}}function ht(wt,Lt){return wt<65?wt===36:wt<91?!0:wt<97?wt===95:wt<123?!0:wt<=65535?wt>=170&&$.test(String.fromCharCode(wt)):Lt===!1?!1:ct(wt,st)}function ut(wt,Lt){return wt<48?wt===36:wt<58?!0:wt<65?!1:wt<91?!0:wt<97?wt===95:wt<123?!0:wt<=65535?wt>=170&&et.test(String.fromCharCode(wt)):Lt===!1?!1:ct(wt,st)||ct(wt,lt)}var pt=function(Lt,Vt){Vt===void 0&&(Vt={}),this.label=Lt,this.keyword=Vt.keyword,this.beforeExpr=!!Vt.beforeExpr,this.startsExpr=!!Vt.startsExpr,this.isLoop=!!Vt.isLoop,this.isAssign=!!Vt.isAssign,this.prefix=!!Vt.prefix,this.postfix=!!Vt.postfix,this.binop=Vt.binop||null,this.updateContext=null};function mt(wt,Lt){return new pt(wt,{beforeExpr:!0,binop:Lt})}var gt={beforeExpr:!0},dt={startsExpr:!0},St={};function xt(wt,Lt){return Lt===void 0&&(Lt={}),Lt.keyword=wt,St[wt]=new pt(wt,Lt)}var yt={num:new pt("num",dt),regexp:new pt("regexp",dt),string:new pt("string",dt),name:new pt("name",dt),eof:new pt("eof"),bracketL:new pt("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new pt("]"),braceL:new pt("{",{beforeExpr:!0,startsExpr:!0}),braceR:new pt("}"),parenL:new pt("(",{beforeExpr:!0,startsExpr:!0}),parenR:new pt(")"),comma:new pt(",",gt),semi:new pt(";",gt),colon:new pt(":",gt),dot:new pt("."),question:new pt("?",gt),arrow:new pt("=>",gt),template:new pt("template"),invalidTemplate:new pt("invalidTemplate"),ellipsis:new pt("...",gt),backQuote:new pt("`",dt),dollarBraceL:new pt("${",{beforeExpr:!0,startsExpr:!0}),eq:new pt("=",{beforeExpr:!0,isAssign:!0}),assign:new pt("_=",{beforeExpr:!0,isAssign:!0}),incDec:new pt("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new pt("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:mt("||",1),logicalAND:mt("&&",2),bitwiseOR:mt("|",3),bitwiseXOR:mt("^",4),bitwiseAND:mt("&",5),equality:mt("==/!=/===/!==",6),relational:mt("/<=/>=",7),bitShift:mt("<>/>>>",8),plusMin:new pt("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:mt("%",10),star:mt("*",10),slash:mt("/",10),starstar:new pt("**",{beforeExpr:!0}),_break:xt("break"),_case:xt("case",gt),_catch:xt("catch"),_continue:xt("continue"),_debugger:xt("debugger"),_default:xt("default",gt),_do:xt("do",{isLoop:!0,beforeExpr:!0}),_else:xt("else",gt),_finally:xt("finally"),_for:xt("for",{isLoop:!0}),_function:xt("function",dt),_if:xt("if"),_return:xt("return",gt),_switch:xt("switch"),_throw:xt("throw",gt),_try:xt("try"),_var:xt("var"),_const:xt("const"),_while:xt("while",{isLoop:!0}),_with:xt("with"),_new:xt("new",{beforeExpr:!0,startsExpr:!0}),_this:xt("this",dt),_super:xt("super",dt),_class:xt("class",dt),_extends:xt("extends",gt),_export:xt("export"),_import:xt("import",dt),_null:xt("null",dt),_true:xt("true",dt),_false:xt("false",dt),_in:xt("in",{beforeExpr:!0,binop:7}),_instanceof:xt("instanceof",{beforeExpr:!0,binop:7}),_typeof:xt("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:xt("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:xt("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},_t=/\r\n?|\n|\u2028|\u2029/,Ct=new RegExp(_t.source,"g");function Et(wt,Lt){return wt===10||wt===13||!Lt&&(wt===8232||wt===8233)}var kt=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,Tt=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,$t=Object.prototype,It=$t.hasOwnProperty,Ot=$t.toString;function Mt(wt,Lt){return It.call(wt,Lt)}var Dt=Array.isArray||function(wt){return Ot.call(wt)==="[object Array]"};function Bt(wt){return new RegExp("^(?:"+wt.replace(/ /g,"|")+")$")}var Kt=function(Lt,Vt){this.line=Lt,this.column=Vt};Kt.prototype.offset=function(Lt){return new Kt(this.line,this.column+Lt)};var Wt=function(Lt,Vt,Xt){this.start=Vt,this.end=Xt,Lt.sourceFile!==null&&(this.source=Lt.sourceFile)};function zt(wt,Lt){for(var Vt=1,Xt=0;;){Ct.lastIndex=Xt;var or=Ct.exec(wt);if(or&&or.index=2015&&(Lt.ecmaVersion-=2009),Lt.allowReserved==null&&(Lt.allowReserved=Lt.ecmaVersion<5),Dt(Lt.onToken)){var Xt=Lt.onToken;Lt.onToken=function(or){return Xt.push(or)}}return Dt(Lt.onComment)&&(Lt.onComment=qt(Lt,Lt.onComment)),Lt}function qt(wt,Lt){return function(Vt,Xt,or,br,$r,zr){var Zr={type:Vt?"Block":"Line",value:Xt,start:or,end:br};wt.locations&&(Zr.loc=new Wt(this,$r,zr)),wt.ranges&&(Zr.range=[or,br]),Lt.push(Zr)}}var hr=1,fr=2,mr=hr|fr,gr=4,tr=8,rr=16,Qt=32,xr=64,Sr=128;function dr(wt,Lt){return fr|(wt?gr:0)|(Lt?tr:0)}var Ur=0,tn=1,on=2,Rn=3,Nn=4,Mn=5,pn=function(Lt,Vt,Xt){this.options=Lt=Zt(Lt),this.sourceFile=Lt.sourceFile,this.keywords=Bt(nt[Lt.ecmaVersion>=6?6:Lt.sourceType==="module"?"5module":5]);var or="";if(Lt.allowReserved!==!0){for(var br=Lt.ecmaVersion;!(or=ot[br]);br--);Lt.sourceType==="module"&&(or+=" await")}this.reservedWords=Bt(or);var $r=(or?or+" ":"")+ot.strict;this.reservedWordsStrict=Bt($r),this.reservedWordsStrictBind=Bt($r+" "+ot.strictBind),this.input=String(Vt),this.containsEsc=!1,Xt?(this.pos=Xt,this.lineStart=this.input.lastIndexOf(` `,Xt-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(_t).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=yt.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=Lt.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports={},this.pos===0&&Lt.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(hr),this.regexpState=null},Hn={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}};pn.prototype.parse=function(){var Lt=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(Lt)},Hn.inFunction.get=function(){return(this.currentVarScope().flags&fr)>0},Hn.inGenerator.get=function(){return(this.currentVarScope().flags&tr)>0},Hn.inAsync.get=function(){return(this.currentVarScope().flags&gr)>0},Hn.allowSuper.get=function(){return(this.currentThisScope().flags&xr)>0},Hn.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Sr)>0},Hn.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},pn.prototype.inNonArrowFunction=function(){return(this.currentThisScope().flags&fr)>0},pn.extend=function(){for(var Lt=[],Vt=arguments.length;Vt--;)Lt[Vt]=arguments[Vt];for(var Xt=this,or=0;or-1&&this.raiseRecoverable(wt.trailingComma,"Comma is not permitted after the rest element");var Vt=Lt?wt.parenthesizedAssign:wt.parenthesizedBind;Vt>-1&&this.raiseRecoverable(Vt,"Parenthesized pattern")}},In.checkExpressionErrors=function(wt,Lt){if(!wt)return!1;var Vt=wt.shorthandAssign,Xt=wt.doubleProto;if(!Lt)return Vt>=0||Xt>=0;Vt>=0&&this.raise(Vt,"Shorthand property assignments are valid only in destructuring patterns"),Xt>=0&&this.raiseRecoverable(Xt,"Redefinition of __proto__ property")},In.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos=6&&this.unexpected(),this.parseFunctionStatement(or,!1,!wt);case yt._class:return wt&&this.unexpected(),this.parseClass(or,!0);case yt._if:return this.parseIfStatement(or);case yt._return:return this.parseReturnStatement(or);case yt._switch:return this.parseSwitchStatement(or);case yt._throw:return this.parseThrowStatement(or);case yt._try:return this.parseTryStatement(or);case yt._const:case yt._var:return br=br||this.value,wt&&br!=="var"&&this.unexpected(),this.parseVarStatement(or,br);case yt._while:return this.parseWhileStatement(or);case yt._with:return this.parseWithStatement(or);case yt.braceL:return this.parseBlock(!0,or);case yt.semi:return this.parseEmptyStatement(or);case yt._export:case yt._import:if(this.options.ecmaVersion>10&&Xt===yt._import){Tt.lastIndex=this.pos;var $r=Tt.exec(this.input),zr=this.pos+$r[0].length,Zr=this.input.charCodeAt(zr);if(Zr===40)return this.parseExpressionStatement(or,this.parseExpression())}return this.options.allowImportExportEverywhere||(Lt||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),Xt===yt._import?this.parseImport(or):this.parseExport(or,Vt);default:if(this.isAsyncFunction())return wt&&this.unexpected(),this.next(),this.parseFunctionStatement(or,!0,!wt);var wn=this.value,zn=this.parseExpression();return Xt===yt.name&&zn.type==="Identifier"&&this.eat(yt.colon)?this.parseLabeledStatement(or,wn,zn,wt):this.parseExpressionStatement(or,zn)}},kr.parseBreakContinueStatement=function(wt,Lt){var Vt=Lt==="break";this.next(),this.eat(yt.semi)||this.insertSemicolon()?wt.label=null:this.type!==yt.name?this.unexpected():(wt.label=this.parseIdent(),this.semicolon());for(var Xt=0;Xt=6?this.eat(yt.semi):this.semicolon(),this.finishNode(wt,"DoWhileStatement")},kr.parseForStatement=function(wt){this.next();var Lt=this.options.ecmaVersion>=9&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction)&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(nn),this.enterScope(0),this.expect(yt.parenL),this.type===yt.semi)return Lt>-1&&this.unexpected(Lt),this.parseFor(wt,null);var Vt=this.isLet();if(this.type===yt._var||this.type===yt._const||Vt){var Xt=this.startNode(),or=Vt?"let":this.value;return this.next(),this.parseVar(Xt,!0,or),this.finishNode(Xt,"VariableDeclaration"),(this.type===yt._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&Xt.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===yt._in?Lt>-1&&this.unexpected(Lt):wt.await=Lt>-1),this.parseForIn(wt,Xt)):(Lt>-1&&this.unexpected(Lt),this.parseFor(wt,Xt))}var br=new Nr,$r=this.parseExpression(!0,br);return this.type===yt._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.options.ecmaVersion>=9&&(this.type===yt._in?Lt>-1&&this.unexpected(Lt):wt.await=Lt>-1),this.toAssignable($r,!1,br),this.checkLVal($r),this.parseForIn(wt,$r)):(this.checkExpressionErrors(br,!0),Lt>-1&&this.unexpected(Lt),this.parseFor(wt,$r))},kr.parseFunctionStatement=function(wt,Lt,Vt){return this.next(),this.parseFunction(wt,lr|(Vt?0:Lr),!1,Lt)},kr.parseIfStatement=function(wt){return this.next(),wt.test=this.parseParenExpression(),wt.consequent=this.parseStatement("if"),wt.alternate=this.eat(yt._else)?this.parseStatement("if"):null,this.finishNode(wt,"IfStatement")},kr.parseReturnStatement=function(wt){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(yt.semi)||this.insertSemicolon()?wt.argument=null:(wt.argument=this.parseExpression(),this.semicolon()),this.finishNode(wt,"ReturnStatement")},kr.parseSwitchStatement=function(wt){this.next(),wt.discriminant=this.parseParenExpression(),wt.cases=[],this.expect(yt.braceL),this.labels.push(Yt),this.enterScope(0);for(var Lt,Vt=!1;this.type!==yt.braceR;)if(this.type===yt._case||this.type===yt._default){var Xt=this.type===yt._case;Lt&&this.finishNode(Lt,"SwitchCase"),wt.cases.push(Lt=this.startNode()),Lt.consequent=[],this.next(),Xt?Lt.test=this.parseExpression():(Vt&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),Vt=!0,Lt.test=null),this.expect(yt.colon)}else Lt||this.unexpected(),Lt.consequent.push(this.parseStatement(null));return this.exitScope(),Lt&&this.finishNode(Lt,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(wt,"SwitchStatement")},kr.parseThrowStatement=function(wt){return this.next(),_t.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),wt.argument=this.parseExpression(),this.semicolon(),this.finishNode(wt,"ThrowStatement")};var er=[];kr.parseTryStatement=function(wt){if(this.next(),wt.block=this.parseBlock(),wt.handler=null,this.type===yt._catch){var Lt=this.startNode();if(this.next(),this.eat(yt.parenL)){Lt.param=this.parseBindingAtom();var Vt=Lt.param.type==="Identifier";this.enterScope(Vt?Qt:0),this.checkLVal(Lt.param,Vt?Nn:on),this.expect(yt.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),Lt.param=null,this.enterScope(0);Lt.body=this.parseBlock(!1),this.exitScope(),wt.handler=this.finishNode(Lt,"CatchClause")}return wt.finalizer=this.eat(yt._finally)?this.parseBlock():null,!wt.handler&&!wt.finalizer&&this.raise(wt.start,"Missing catch or finally clause"),this.finishNode(wt,"TryStatement")},kr.parseVarStatement=function(wt,Lt){return this.next(),this.parseVar(wt,!1,Lt),this.semicolon(),this.finishNode(wt,"VariableDeclaration")},kr.parseWhileStatement=function(wt){return this.next(),wt.test=this.parseParenExpression(),this.labels.push(nn),wt.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(wt,"WhileStatement")},kr.parseWithStatement=function(wt){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),wt.object=this.parseParenExpression(),wt.body=this.parseStatement("with"),this.finishNode(wt,"WithStatement")},kr.parseEmptyStatement=function(wt){return this.next(),this.finishNode(wt,"EmptyStatement")},kr.parseLabeledStatement=function(wt,Lt,Vt,Xt){for(var or=0,br=this.labels;or=0;Zr--){var wn=this.labels[Zr];if(wn.statementStart===wt.start)wn.statementStart=this.start,wn.kind=zr;else break}return this.labels.push({name:Lt,kind:zr,statementStart:this.start}),wt.body=this.parseStatement(Xt?Xt.indexOf("label")===-1?Xt+"label":Xt:"label"),this.labels.pop(),wt.label=Vt,this.finishNode(wt,"LabeledStatement")},kr.parseExpressionStatement=function(wt,Lt){return wt.expression=Lt,this.semicolon(),this.finishNode(wt,"ExpressionStatement")},kr.parseBlock=function(wt,Lt){for(wt===void 0&&(wt=!0),Lt===void 0&&(Lt=this.startNode()),Lt.body=[],this.expect(yt.braceL),wt&&this.enterScope(0);!this.eat(yt.braceR);){var Vt=this.parseStatement(null);Lt.body.push(Vt)}return wt&&this.exitScope(),this.finishNode(Lt,"BlockStatement")},kr.parseFor=function(wt,Lt){return wt.init=Lt,this.expect(yt.semi),wt.test=this.type===yt.semi?null:this.parseExpression(),this.expect(yt.semi),wt.update=this.type===yt.parenR?null:this.parseExpression(),this.expect(yt.parenR),wt.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(wt,"ForStatement")},kr.parseForIn=function(wt,Lt){var Vt=this.type===yt._in;return this.next(),Lt.type==="VariableDeclaration"&&Lt.declarations[0].init!=null&&(!Vt||this.options.ecmaVersion<8||this.strict||Lt.kind!=="var"||Lt.declarations[0].id.type!=="Identifier")?this.raise(Lt.start,(Vt?"for-in":"for-of")+" loop variable declaration may not have an initializer"):Lt.type==="AssignmentPattern"&&this.raise(Lt.start,"Invalid left-hand side in for-loop"),wt.left=Lt,wt.right=Vt?this.parseExpression():this.parseMaybeAssign(),this.expect(yt.parenR),wt.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(wt,Vt?"ForInStatement":"ForOfStatement")},kr.parseVar=function(wt,Lt,Vt){for(wt.declarations=[],wt.kind=Vt;;){var Xt=this.startNode();if(this.parseVarId(Xt,Vt),this.eat(yt.eq)?Xt.init=this.parseMaybeAssign(Lt):Vt==="const"&&!(this.type===yt._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():Xt.id.type!=="Identifier"&&!(Lt&&(this.type===yt._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):Xt.init=null,wt.declarations.push(this.finishNode(Xt,"VariableDeclarator")),!this.eat(yt.comma))break}return wt},kr.parseVarId=function(wt,Lt){wt.id=this.parseBindingAtom(),this.checkLVal(wt.id,Lt==="var"?tn:on,!1)};var lr=1,Lr=2,Or=4;kr.parseFunction=function(wt,Lt,Vt,Xt){this.initFunction(wt),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!Xt)&&(this.type===yt.star&&Lt&Lr&&this.unexpected(),wt.generator=this.eat(yt.star)),this.options.ecmaVersion>=8&&(wt.async=!!Xt),Lt&lr&&(wt.id=Lt&Or&&this.type!==yt.name?null:this.parseIdent(),wt.id&&!(Lt&Lr)&&this.checkLVal(wt.id,this.strict||wt.generator||wt.async?this.treatFunctionsAsVar?tn:on:Rn));var or=this.yieldPos,br=this.awaitPos,$r=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(dr(wt.async,wt.generator)),Lt&lr||(wt.id=this.type===yt.name?this.parseIdent():null),this.parseFunctionParams(wt),this.parseFunctionBody(wt,Vt,!1),this.yieldPos=or,this.awaitPos=br,this.awaitIdentPos=$r,this.finishNode(wt,Lt&lr?"FunctionDeclaration":"FunctionExpression")},kr.parseFunctionParams=function(wt){this.expect(yt.parenL),wt.params=this.parseBindingList(yt.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},kr.parseClass=function(wt,Lt){this.next();var Vt=this.strict;this.strict=!0,this.parseClassId(wt,Lt),this.parseClassSuper(wt);var Xt=this.startNode(),or=!1;for(Xt.body=[],this.expect(yt.braceL);!this.eat(yt.braceR);){var br=this.parseClassElement(wt.superClass!==null);br&&(Xt.body.push(br),br.type==="MethodDefinition"&&br.kind==="constructor"&&(or&&this.raise(br.start,"Duplicate constructor in the same class"),or=!0))}return wt.body=this.finishNode(Xt,"ClassBody"),this.strict=Vt,this.finishNode(wt,Lt?"ClassDeclaration":"ClassExpression")},kr.parseClassElement=function(wt){var Lt=this;if(this.eat(yt.semi))return null;var Vt=this.startNode(),Xt=function(Zr,wn){wn===void 0&&(wn=!1);var zn=Lt.start,_i=Lt.startLoc;return Lt.eatContextual(Zr)?Lt.type!==yt.parenL&&(!wn||!Lt.canInsertSemicolon())?!0:(Vt.key&&Lt.unexpected(),Vt.computed=!1,Vt.key=Lt.startNodeAt(zn,_i),Vt.key.name=Zr,Lt.finishNode(Vt.key,"Identifier"),!1):!1};Vt.kind="method",Vt.static=Xt("static");var or=this.eat(yt.star),br=!1;or||(this.options.ecmaVersion>=8&&Xt("async",!0)?(br=!0,or=this.options.ecmaVersion>=9&&this.eat(yt.star)):Xt("get")?Vt.kind="get":Xt("set")&&(Vt.kind="set")),Vt.key||this.parsePropertyName(Vt);var $r=Vt.key,zr=!1;return!Vt.computed&&!Vt.static&&($r.type==="Identifier"&&$r.name==="constructor"||$r.type==="Literal"&&$r.value==="constructor")?(Vt.kind!=="method"&&this.raise($r.start,"Constructor can't have get/set modifier"),or&&this.raise($r.start,"Constructor can't be a generator"),br&&this.raise($r.start,"Constructor can't be an async method"),Vt.kind="constructor",zr=wt):Vt.static&&$r.type==="Identifier"&&$r.name==="prototype"&&this.raise($r.start,"Classes may not have a static property named prototype"),this.parseClassMethod(Vt,or,br,zr),Vt.kind==="get"&&Vt.value.params.length!==0&&this.raiseRecoverable(Vt.value.start,"getter should have no params"),Vt.kind==="set"&&Vt.value.params.length!==1&&this.raiseRecoverable(Vt.value.start,"setter should have exactly one param"),Vt.kind==="set"&&Vt.value.params[0].type==="RestElement"&&this.raiseRecoverable(Vt.value.params[0].start,"Setter cannot use rest params"),Vt},kr.parseClassMethod=function(wt,Lt,Vt,Xt){return wt.value=this.parseMethod(Lt,Vt,Xt),this.finishNode(wt,"MethodDefinition")},kr.parseClassId=function(wt,Lt){this.type===yt.name?(wt.id=this.parseIdent(),Lt&&this.checkLVal(wt.id,on,!1)):(Lt===!0&&this.unexpected(),wt.id=null)},kr.parseClassSuper=function(wt){wt.superClass=this.eat(yt._extends)?this.parseExprSubscripts():null},kr.parseExport=function(wt,Lt){if(this.next(),this.eat(yt.star))return this.expectContextual("from"),this.type!==yt.string&&this.unexpected(),wt.source=this.parseExprAtom(),this.semicolon(),this.finishNode(wt,"ExportAllDeclaration");if(this.eat(yt._default)){this.checkExport(Lt,"default",this.lastTokStart);var Vt;if(this.type===yt._function||(Vt=this.isAsyncFunction())){var Xt=this.startNode();this.next(),Vt&&this.next(),wt.declaration=this.parseFunction(Xt,lr|Or,!1,Vt)}else if(this.type===yt._class){var or=this.startNode();wt.declaration=this.parseClass(or,"nullableID")}else wt.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(wt,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())wt.declaration=this.parseStatement(null),wt.declaration.type==="VariableDeclaration"?this.checkVariableExport(Lt,wt.declaration.declarations):this.checkExport(Lt,wt.declaration.id.name,wt.declaration.id.start),wt.specifiers=[],wt.source=null;else{if(wt.declaration=null,wt.specifiers=this.parseExportSpecifiers(Lt),this.eatContextual("from"))this.type!==yt.string&&this.unexpected(),wt.source=this.parseExprAtom();else{for(var br=0,$r=wt.specifiers;br<$r.length;br+=1){var zr=$r[br];this.checkUnreserved(zr.local),this.checkLocalExport(zr.local)}wt.source=null}this.semicolon()}return this.finishNode(wt,"ExportNamedDeclaration")},kr.checkExport=function(wt,Lt,Vt){wt&&(Mt(wt,Lt)&&this.raiseRecoverable(Vt,"Duplicate export '"+Lt+"'"),wt[Lt]=!0)},kr.checkPatternExport=function(wt,Lt){var Vt=Lt.type;if(Vt==="Identifier")this.checkExport(wt,Lt.name,Lt.start);else if(Vt==="ObjectPattern")for(var Xt=0,or=Lt.properties;Xt=6&&wt)switch(wt.type){case"Identifier":this.inAsync&&wt.name==="await"&&this.raise(wt.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"RestElement":break;case"ObjectExpression":wt.type="ObjectPattern",Vt&&this.checkPatternErrors(Vt,!0);for(var Xt=0,or=wt.properties;Xt=8&&!br&&$r.name==="async"&&!this.canInsertSemicolon()&&this.eat(yt._function))return this.parseFunction(this.startNodeAt(Xt,or),0,!1,!0);if(Vt&&!this.canInsertSemicolon()){if(this.eat(yt.arrow))return this.parseArrowExpression(this.startNodeAt(Xt,or),[$r],!1);if(this.options.ecmaVersion>=8&&$r.name==="async"&&this.type===yt.name&&!br)return $r=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(yt.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(Xt,or),[$r],!0)}return $r;case yt.regexp:var zr=this.value;return Lt=this.parseLiteral(zr.value),Lt.regex={pattern:zr.pattern,flags:zr.flags},Lt;case yt.num:case yt.string:return this.parseLiteral(this.value);case yt._null:case yt._true:case yt._false:return Lt=this.startNode(),Lt.value=this.type===yt._null?null:this.type===yt._true,Lt.raw=this.type.keyword,this.next(),this.finishNode(Lt,"Literal");case yt.parenL:var Zr=this.start,wn=this.parseParenAndDistinguishExpression(Vt);return wt&&(wt.parenthesizedAssign<0&&!this.isSimpleAssignTarget(wn)&&(wt.parenthesizedAssign=Zr),wt.parenthesizedBind<0&&(wt.parenthesizedBind=Zr)),wn;case yt.bracketL:return Lt=this.startNode(),this.next(),Lt.elements=this.parseExprList(yt.bracketR,!0,!0,wt),this.finishNode(Lt,"ArrayExpression");case yt.braceL:return this.parseObj(!1,wt);case yt._function:return Lt=this.startNode(),this.next(),this.parseFunction(Lt,0);case yt._class:return this.parseClass(this.startNode(),!1);case yt._new:return this.parseNew();case yt.backQuote:return this.parseTemplate();case yt._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}},Cr.parseExprImport=function(){var wt=this.startNode();switch(this.next(),this.type){case yt.parenL:return this.parseDynamicImport(wt);default:this.unexpected()}},Cr.parseDynamicImport=function(wt){if(this.next(),wt.source=this.parseMaybeAssign(),!this.eat(yt.parenR)){var Lt=this.start;this.eat(yt.comma)&&this.eat(yt.parenR)?this.raiseRecoverable(Lt,"Trailing comma is not allowed in import()"):this.unexpected(Lt)}return this.finishNode(wt,"ImportExpression")},Cr.parseLiteral=function(wt){var Lt=this.startNode();return Lt.value=wt,Lt.raw=this.input.slice(this.start,this.end),Lt.raw.charCodeAt(Lt.raw.length-1)===110&&(Lt.bigint=Lt.raw.slice(0,-1)),this.next(),this.finishNode(Lt,"Literal")},Cr.parseParenExpression=function(){this.expect(yt.parenL);var wt=this.parseExpression();return this.expect(yt.parenR),wt},Cr.parseParenAndDistinguishExpression=function(wt){var Lt=this.start,Vt=this.startLoc,Xt,or=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var br=this.start,$r=this.startLoc,zr=[],Zr=!0,wn=!1,zn=new Nr,_i=this.yieldPos,es=this.awaitPos,ys;for(this.yieldPos=0,this.awaitPos=0;this.type!==yt.parenR;)if(Zr?Zr=!1:this.expect(yt.comma),or&&this.afterTrailingComma(yt.parenR,!0)){wn=!0;break}else if(this.type===yt.ellipsis){ys=this.start,zr.push(this.parseParenItem(this.parseRestBinding())),this.type===yt.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}else zr.push(this.parseMaybeAssign(!1,zn,this.parseParenItem));var Bs=this.start,yn=this.startLoc;if(this.expect(yt.parenR),wt&&!this.canInsertSemicolon()&&this.eat(yt.arrow))return this.checkPatternErrors(zn,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=_i,this.awaitPos=es,this.parseParenArrowList(Lt,Vt,zr);(!zr.length||wn)&&this.unexpected(this.lastTokStart),ys&&this.unexpected(ys),this.checkExpressionErrors(zn,!0),this.yieldPos=_i||this.yieldPos,this.awaitPos=es||this.awaitPos,zr.length>1?(Xt=this.startNodeAt(br,$r),Xt.expressions=zr,this.finishNodeAt(Xt,"SequenceExpression",Bs,yn)):Xt=zr[0]}else Xt=this.parseParenExpression();if(this.options.preserveParens){var vs=this.startNodeAt(Lt,Vt);return vs.expression=Xt,this.finishNode(vs,"ParenthesizedExpression")}else return Xt},Cr.parseParenItem=function(wt){return wt},Cr.parseParenArrowList=function(wt,Lt,Vt){return this.parseArrowExpression(this.startNodeAt(wt,Lt),Vt)};var Hr=[];Cr.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var wt=this.startNode(),Lt=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(yt.dot)){wt.meta=Lt;var Vt=this.containsEsc;return wt.property=this.parseIdent(!0),(wt.property.name!=="target"||Vt)&&this.raiseRecoverable(wt.property.start,"The only valid meta property for new is new.target"),this.inNonArrowFunction()||this.raiseRecoverable(wt.start,"new.target can only be used in functions"),this.finishNode(wt,"MetaProperty")}var Xt=this.start,or=this.startLoc,br=this.type===yt._import;return wt.callee=this.parseSubscripts(this.parseExprAtom(),Xt,or,!0),br&&wt.callee.type==="ImportExpression"&&this.raise(Xt,"Cannot use new with import()"),this.eat(yt.parenL)?wt.arguments=this.parseExprList(yt.parenR,this.options.ecmaVersion>=8,!1):wt.arguments=Hr,this.finishNode(wt,"NewExpression")},Cr.parseTemplateElement=function(wt){var Lt=wt.isTagged,Vt=this.startNode();return this.type===yt.invalidTemplate?(Lt||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),Vt.value={raw:this.value,cooked:null}):Vt.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,` `),cooked:this.value},this.next(),Vt.tail=this.type===yt.backQuote,this.finishNode(Vt,"TemplateElement")},Cr.parseTemplate=function(wt){wt===void 0&&(wt={});var Lt=wt.isTagged;Lt===void 0&&(Lt=!1);var Vt=this.startNode();this.next(),Vt.expressions=[];var Xt=this.parseTemplateElement({isTagged:Lt});for(Vt.quasis=[Xt];!Xt.tail;)this.type===yt.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(yt.dollarBraceL),Vt.expressions.push(this.parseExpression()),this.expect(yt.braceR),Vt.quasis.push(Xt=this.parseTemplateElement({isTagged:Lt}));return this.next(),this.finishNode(Vt,"TemplateLiteral")},Cr.isAsyncProp=function(wt){return!wt.computed&&wt.key.type==="Identifier"&&wt.key.name==="async"&&(this.type===yt.name||this.type===yt.num||this.type===yt.string||this.type===yt.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===yt.star)&&!_t.test(this.input.slice(this.lastTokEnd,this.start))},Cr.parseObj=function(wt,Lt){var Vt=this.startNode(),Xt=!0,or={};for(Vt.properties=[],this.next();!this.eat(yt.braceR);){if(Xt)Xt=!1;else if(this.expect(yt.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(yt.braceR))break;var br=this.parseProperty(wt,Lt);wt||this.checkPropClash(br,or,Lt),Vt.properties.push(br)}return this.finishNode(Vt,wt?"ObjectPattern":"ObjectExpression")},Cr.parseProperty=function(wt,Lt){var Vt=this.startNode(),Xt,or,br,$r;if(this.options.ecmaVersion>=9&&this.eat(yt.ellipsis))return wt?(Vt.argument=this.parseIdent(!1),this.type===yt.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(Vt,"RestElement")):(this.type===yt.parenL&&Lt&&(Lt.parenthesizedAssign<0&&(Lt.parenthesizedAssign=this.start),Lt.parenthesizedBind<0&&(Lt.parenthesizedBind=this.start)),Vt.argument=this.parseMaybeAssign(!1,Lt),this.type===yt.comma&&Lt&&Lt.trailingComma<0&&(Lt.trailingComma=this.start),this.finishNode(Vt,"SpreadElement"));this.options.ecmaVersion>=6&&(Vt.method=!1,Vt.shorthand=!1,(wt||Lt)&&(br=this.start,$r=this.startLoc),wt||(Xt=this.eat(yt.star)));var zr=this.containsEsc;return this.parsePropertyName(Vt),!wt&&!zr&&this.options.ecmaVersion>=8&&!Xt&&this.isAsyncProp(Vt)?(or=!0,Xt=this.options.ecmaVersion>=9&&this.eat(yt.star),this.parsePropertyName(Vt,Lt)):or=!1,this.parsePropertyValue(Vt,wt,Xt,or,br,$r,Lt,zr),this.finishNode(Vt,"Property")},Cr.parsePropertyValue=function(wt,Lt,Vt,Xt,or,br,$r,zr){if((Vt||Xt)&&this.type===yt.colon&&this.unexpected(),this.eat(yt.colon))wt.value=Lt?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,$r),wt.kind="init";else if(this.options.ecmaVersion>=6&&this.type===yt.parenL)Lt&&this.unexpected(),wt.kind="init",wt.method=!0,wt.value=this.parseMethod(Vt,Xt);else if(!Lt&&!zr&&this.options.ecmaVersion>=5&&!wt.computed&&wt.key.type==="Identifier"&&(wt.key.name==="get"||wt.key.name==="set")&&this.type!==yt.comma&&this.type!==yt.braceR){(Vt||Xt)&&this.unexpected(),wt.kind=wt.key.name,this.parsePropertyName(wt),wt.value=this.parseMethod(!1);var Zr=wt.kind==="get"?0:1;if(wt.value.params.length!==Zr){var wn=wt.value.start;wt.kind==="get"?this.raiseRecoverable(wn,"getter should have no params"):this.raiseRecoverable(wn,"setter should have exactly one param")}else wt.kind==="set"&&wt.value.params[0].type==="RestElement"&&this.raiseRecoverable(wt.value.params[0].start,"Setter cannot use rest params")}else this.options.ecmaVersion>=6&&!wt.computed&&wt.key.type==="Identifier"?((Vt||Xt)&&this.unexpected(),this.checkUnreserved(wt.key),wt.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=or),wt.kind="init",Lt?wt.value=this.parseMaybeDefault(or,br,wt.key):this.type===yt.eq&&$r?($r.shorthandAssign<0&&($r.shorthandAssign=this.start),wt.value=this.parseMaybeDefault(or,br,wt.key)):wt.value=wt.key,wt.shorthand=!0):this.unexpected()},Cr.parsePropertyName=function(wt){if(this.options.ecmaVersion>=6){if(this.eat(yt.bracketL))return wt.computed=!0,wt.key=this.parseMaybeAssign(),this.expect(yt.bracketR),wt.key;wt.computed=!1}return wt.key=this.type===yt.num||this.type===yt.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")},Cr.initFunction=function(wt){wt.id=null,this.options.ecmaVersion>=6&&(wt.generator=wt.expression=!1),this.options.ecmaVersion>=8&&(wt.async=!1)},Cr.parseMethod=function(wt,Lt,Vt){var Xt=this.startNode(),or=this.yieldPos,br=this.awaitPos,$r=this.awaitIdentPos;return this.initFunction(Xt),this.options.ecmaVersion>=6&&(Xt.generator=wt),this.options.ecmaVersion>=8&&(Xt.async=!!Lt),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(dr(Lt,Xt.generator)|xr|(Vt?Sr:0)),this.expect(yt.parenL),Xt.params=this.parseBindingList(yt.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(Xt,!1,!0),this.yieldPos=or,this.awaitPos=br,this.awaitIdentPos=$r,this.finishNode(Xt,"FunctionExpression")},Cr.parseArrowExpression=function(wt,Lt,Vt){var Xt=this.yieldPos,or=this.awaitPos,br=this.awaitIdentPos;return this.enterScope(dr(Vt,!1)|rr),this.initFunction(wt),this.options.ecmaVersion>=8&&(wt.async=!!Vt),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,wt.params=this.toAssignableList(Lt,!0),this.parseFunctionBody(wt,!0,!1),this.yieldPos=Xt,this.awaitPos=or,this.awaitIdentPos=br,this.finishNode(wt,"ArrowFunctionExpression")},Cr.parseFunctionBody=function(wt,Lt,Vt){var Xt=Lt&&this.type!==yt.braceL,or=this.strict,br=!1;if(Xt)wt.body=this.parseMaybeAssign(),wt.expression=!0,this.checkParams(wt,!1);else{var $r=this.options.ecmaVersion>=7&&!this.isSimpleParamList(wt.params);(!or||$r)&&(br=this.strictDirective(this.end),br&&$r&&this.raiseRecoverable(wt.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var zr=this.labels;this.labels=[],br&&(this.strict=!0),this.checkParams(wt,!or&&!br&&!Lt&&!Vt&&this.isSimpleParamList(wt.params)),wt.body=this.parseBlock(!1),wt.expression=!1,this.adaptDirectivePrologue(wt.body.body),this.labels=zr}this.exitScope(),this.strict&&wt.id&&this.checkLVal(wt.id,Mn),this.strict=or},Cr.isSimpleParamList=function(wt){for(var Lt=0,Vt=wt;Lt-1||or.functions.indexOf(wt)>-1||or.var.indexOf(wt)>-1,or.lexical.push(wt),this.inModule&&or.flags&hr&&delete this.undefinedExports[wt]}else if(Lt===Nn){var br=this.currentScope();br.lexical.push(wt)}else if(Lt===Rn){var $r=this.currentScope();this.treatFunctionsAsVar?Xt=$r.lexical.indexOf(wt)>-1:Xt=$r.lexical.indexOf(wt)>-1||$r.var.indexOf(wt)>-1,$r.functions.push(wt)}else for(var zr=this.scopeStack.length-1;zr>=0;--zr){var Zr=this.scopeStack[zr];if(Zr.lexical.indexOf(wt)>-1&&!(Zr.flags&Qt&&Zr.lexical[0]===wt)||!this.treatFunctionsAsVarInScope(Zr)&&Zr.functions.indexOf(wt)>-1){Xt=!0;break}if(Zr.var.push(wt),this.inModule&&Zr.flags&hr&&delete this.undefinedExports[wt],Zr.flags&mr)break}Xt&&this.raiseRecoverable(Vt,"Identifier '"+wt+"' has already been declared")},Dr.checkLocalExport=function(wt){this.scopeStack[0].lexical.indexOf(wt.name)===-1&&this.scopeStack[0].var.indexOf(wt.name)===-1&&(this.undefinedExports[wt.name]=wt)},Dr.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},Dr.currentVarScope=function(){for(var wt=this.scopeStack.length-1;;wt--){var Lt=this.scopeStack[wt];if(Lt.flags&mr)return Lt}},Dr.currentThisScope=function(){for(var wt=this.scopeStack.length-1;;wt--){var Lt=this.scopeStack[wt];if(Lt.flags&mr&&!(Lt.flags&rr))return Lt}};var jr=function(Lt,Vt,Xt){this.type="",this.start=Vt,this.end=0,Lt.options.locations&&(this.loc=new Wt(Lt,Xt)),Lt.options.directSourceFile&&(this.sourceFile=Lt.options.directSourceFile),Lt.options.ranges&&(this.range=[Vt,0])},Gr=pn.prototype;Gr.startNode=function(){return new jr(this,this.start,this.startLoc)},Gr.startNodeAt=function(wt,Lt){return new jr(this,wt,Lt)};function an(wt,Lt,Vt,Xt){return wt.type=Lt,wt.end=Vt,this.options.locations&&(wt.loc.end=Xt),this.options.ranges&&(wt.range[1]=Vt),wt}Gr.finishNode=function(wt,Lt){return an.call(this,wt,Lt,this.lastTokEnd,this.lastTokEndLoc)},Gr.finishNodeAt=function(wt,Lt,Vt,Xt){return an.call(this,wt,Lt,Vt,Xt)};var Rr=function(Lt,Vt,Xt,or,br){this.token=Lt,this.isExpr=!!Vt,this.preserveSpace=!!Xt,this.override=or,this.generator=!!br},mn={b_stat:new Rr("{",!1),b_expr:new Rr("{",!0),b_tmpl:new Rr("${",!1),p_stat:new Rr("(",!1),p_expr:new Rr("(",!0),q_tmpl:new Rr("`",!0,!0,function(wt){return wt.tryReadTemplateToken()}),f_stat:new Rr("function",!1),f_expr:new Rr("function",!0),f_expr_gen:new Rr("function",!0,!1,null,!0),f_gen:new Rr("function",!1,!1,null,!0)},Rs=pn.prototype;Rs.initialContext=function(){return[mn.b_stat]},Rs.braceIsBlock=function(wt){var Lt=this.curContext();return Lt===mn.f_expr||Lt===mn.f_stat?!0:wt===yt.colon&&(Lt===mn.b_stat||Lt===mn.b_expr)?!Lt.isExpr:wt===yt._return||wt===yt.name&&this.exprAllowed?_t.test(this.input.slice(this.lastTokEnd,this.start)):wt===yt._else||wt===yt.semi||wt===yt.eof||wt===yt.parenR||wt===yt.arrow?!0:wt===yt.braceL?Lt===mn.b_stat:wt===yt._var||wt===yt._const||wt===yt.name?!1:!this.exprAllowed},Rs.inGeneratorContext=function(){for(var wt=this.context.length-1;wt>=1;wt--){var Lt=this.context[wt];if(Lt.token==="function")return Lt.generator}return!1},Rs.updateContext=function(wt){var Lt,Vt=this.type;Vt.keyword&&wt===yt.dot?this.exprAllowed=!1:(Lt=Vt.updateContext)?Lt.call(this,wt):this.exprAllowed=Vt.beforeExpr},yt.parenR.updateContext=yt.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var wt=this.context.pop();wt===mn.b_stat&&this.curContext().token==="function"&&(wt=this.context.pop()),this.exprAllowed=!wt.isExpr},yt.braceL.updateContext=function(wt){this.context.push(this.braceIsBlock(wt)?mn.b_stat:mn.b_expr),this.exprAllowed=!0},yt.dollarBraceL.updateContext=function(){this.context.push(mn.b_tmpl),this.exprAllowed=!0},yt.parenL.updateContext=function(wt){var Lt=wt===yt._if||wt===yt._for||wt===yt._with||wt===yt._while;this.context.push(Lt?mn.p_stat:mn.p_expr),this.exprAllowed=!0},yt.incDec.updateContext=function(){},yt._function.updateContext=yt._class.updateContext=function(wt){wt.beforeExpr&&wt!==yt.semi&&wt!==yt._else&&!(wt===yt._return&&_t.test(this.input.slice(this.lastTokEnd,this.start)))&&!((wt===yt.colon||wt===yt.braceL)&&this.curContext()===mn.b_stat)?this.context.push(mn.f_expr):this.context.push(mn.f_stat),this.exprAllowed=!1},yt.backQuote.updateContext=function(){this.curContext()===mn.q_tmpl?this.context.pop():this.context.push(mn.q_tmpl),this.exprAllowed=!1},yt.star.updateContext=function(wt){if(wt===yt._function){var Lt=this.context.length-1;this.context[Lt]===mn.f_expr?this.context[Lt]=mn.f_expr_gen:this.context[Lt]=mn.f_gen}this.exprAllowed=!0},yt.name.updateContext=function(wt){var Lt=!1;this.options.ecmaVersion>=6&&wt!==yt.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(Lt=!0),this.exprAllowed=Lt};var ps="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Xn=ps+" Extended_Pictographic",ls=Xn,Ns={9:ps,10:Xn,11:ls},ms="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",no="Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Vs=no+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",io=Vs+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",us={9:no,10:Vs,11:io},cs={};function Gs(wt){var Lt=cs[wt]={binary:Bt(Ns[wt]+" "+ms),nonBinary:{General_Category:Bt(ms),Script:Bt(us[wt])}};Lt.nonBinary.Script_Extensions=Lt.nonBinary.Script,Lt.nonBinary.gc=Lt.nonBinary.General_Category,Lt.nonBinary.sc=Lt.nonBinary.Script,Lt.nonBinary.scx=Lt.nonBinary.Script_Extensions}Gs(9),Gs(10),Gs(11);var Jr=pn.prototype,hs=function(Lt){this.parser=Lt,this.validFlags="gim"+(Lt.options.ecmaVersion>=6?"uy":"")+(Lt.options.ecmaVersion>=9?"s":""),this.unicodeProperties=cs[Lt.options.ecmaVersion>=11?11:Lt.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};hs.prototype.reset=function(Lt,Vt,Xt){var or=Xt.indexOf("u")!==-1;this.start=Lt|0,this.source=Vt+"",this.flags=Xt,this.switchU=or&&this.parser.options.ecmaVersion>=6,this.switchN=or&&this.parser.options.ecmaVersion>=9},hs.prototype.raise=function(Lt){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+Lt)},hs.prototype.at=function(Lt){var Vt=this.source,Xt=Vt.length;if(Lt>=Xt)return-1;var or=Vt.charCodeAt(Lt);if(!this.switchU||or<=55295||or>=57344||Lt+1>=Xt)return or;var br=Vt.charCodeAt(Lt+1);return br>=56320&&br<=57343?(or<<10)+br-56613888:or},hs.prototype.nextIndex=function(Lt){var Vt=this.source,Xt=Vt.length;if(Lt>=Xt)return Xt;var or=Vt.charCodeAt(Lt),br;return!this.switchU||or<=55295||or>=57344||Lt+1>=Xt||(br=Vt.charCodeAt(Lt+1))<56320||br>57343?Lt+1:Lt+2},hs.prototype.current=function(){return this.at(this.pos)},hs.prototype.lookahead=function(){return this.at(this.nextIndex(this.pos))},hs.prototype.advance=function(){this.pos=this.nextIndex(this.pos)},hs.prototype.eat=function(Lt){return this.current()===Lt?(this.advance(),!0):!1};function Ks(wt){return wt<=65535?String.fromCharCode(wt):(wt-=65536,String.fromCharCode((wt>>10)+55296,(wt&1023)+56320))}Jr.validateRegExpFlags=function(wt){for(var Lt=wt.validFlags,Vt=wt.flags,Xt=0;Xt-1&&this.raise(wt.start,"Duplicate regular expression flag")}},Jr.validateRegExpPattern=function(wt){this.regexp_pattern(wt),!wt.switchN&&this.options.ecmaVersion>=9&&wt.groupNames.length>0&&(wt.switchN=!0,this.regexp_pattern(wt))},Jr.regexp_pattern=function(wt){wt.pos=0,wt.lastIntValue=0,wt.lastStringValue="",wt.lastAssertionIsQuantifiable=!1,wt.numCapturingParens=0,wt.maxBackReference=0,wt.groupNames.length=0,wt.backReferenceNames.length=0,this.regexp_disjunction(wt),wt.pos!==wt.source.length&&(wt.eat(41)&&wt.raise("Unmatched ')'"),(wt.eat(93)||wt.eat(125))&&wt.raise("Lone quantifier brackets")),wt.maxBackReference>wt.numCapturingParens&&wt.raise("Invalid escape");for(var Lt=0,Vt=wt.backReferenceNames;Lt=9&&(Vt=wt.eat(60)),wt.eat(61)||wt.eat(33))return this.regexp_disjunction(wt),wt.eat(41)||wt.raise("Unterminated group"),wt.lastAssertionIsQuantifiable=!Vt,!0}return wt.pos=Lt,!1},Jr.regexp_eatQuantifier=function(wt,Lt){return Lt===void 0&&(Lt=!1),this.regexp_eatQuantifierPrefix(wt,Lt)?(wt.eat(63),!0):!1},Jr.regexp_eatQuantifierPrefix=function(wt,Lt){return wt.eat(42)||wt.eat(43)||wt.eat(63)||this.regexp_eatBracedQuantifier(wt,Lt)},Jr.regexp_eatBracedQuantifier=function(wt,Lt){var Vt=wt.pos;if(wt.eat(123)){var Xt=0,or=-1;if(this.regexp_eatDecimalDigits(wt)&&(Xt=wt.lastIntValue,wt.eat(44)&&this.regexp_eatDecimalDigits(wt)&&(or=wt.lastIntValue),wt.eat(125)))return or!==-1&&or=9?this.regexp_groupSpecifier(wt):wt.current()===63&&wt.raise("Invalid group"),this.regexp_disjunction(wt),wt.eat(41))return wt.numCapturingParens+=1,!0;wt.raise("Unterminated group")}return!1},Jr.regexp_eatExtendedAtom=function(wt){return wt.eat(46)||this.regexp_eatReverseSolidusAtomEscape(wt)||this.regexp_eatCharacterClass(wt)||this.regexp_eatUncapturingGroup(wt)||this.regexp_eatCapturingGroup(wt)||this.regexp_eatInvalidBracedQuantifier(wt)||this.regexp_eatExtendedPatternCharacter(wt)},Jr.regexp_eatInvalidBracedQuantifier=function(wt){return this.regexp_eatBracedQuantifier(wt,!0)&&wt.raise("Nothing to repeat"),!1},Jr.regexp_eatSyntaxCharacter=function(wt){var Lt=wt.current();return ws(Lt)?(wt.lastIntValue=Lt,wt.advance(),!0):!1};function ws(wt){return wt===36||wt>=40&&wt<=43||wt===46||wt===63||wt>=91&&wt<=94||wt>=123&&wt<=125}Jr.regexp_eatPatternCharacters=function(wt){for(var Lt=wt.pos,Vt=0;(Vt=wt.current())!==-1&&!ws(Vt);)wt.advance();return wt.pos!==Lt},Jr.regexp_eatExtendedPatternCharacter=function(wt){var Lt=wt.current();return Lt!==-1&&Lt!==36&&!(Lt>=40&&Lt<=43)&&Lt!==46&&Lt!==63&&Lt!==91&&Lt!==94&&Lt!==124?(wt.advance(),!0):!1},Jr.regexp_groupSpecifier=function(wt){if(wt.eat(63)){if(this.regexp_eatGroupName(wt)){wt.groupNames.indexOf(wt.lastStringValue)!==-1&&wt.raise("Duplicate capture group name"),wt.groupNames.push(wt.lastStringValue);return}wt.raise("Invalid group")}},Jr.regexp_eatGroupName=function(wt){if(wt.lastStringValue="",wt.eat(60)){if(this.regexp_eatRegExpIdentifierName(wt)&&wt.eat(62))return!0;wt.raise("Invalid capture group name")}return!1},Jr.regexp_eatRegExpIdentifierName=function(wt){if(wt.lastStringValue="",this.regexp_eatRegExpIdentifierStart(wt)){for(wt.lastStringValue+=Ks(wt.lastIntValue);this.regexp_eatRegExpIdentifierPart(wt);)wt.lastStringValue+=Ks(wt.lastIntValue);return!0}return!1},Jr.regexp_eatRegExpIdentifierStart=function(wt){var Lt=wt.pos,Vt=wt.current();return wt.advance(),Vt===92&&this.regexp_eatRegExpUnicodeEscapeSequence(wt)&&(Vt=wt.lastIntValue),Zn(Vt)?(wt.lastIntValue=Vt,!0):(wt.pos=Lt,!1)};function Zn(wt){return ht(wt,!0)||wt===36||wt===95}Jr.regexp_eatRegExpIdentifierPart=function(wt){var Lt=wt.pos,Vt=wt.current();return wt.advance(),Vt===92&&this.regexp_eatRegExpUnicodeEscapeSequence(wt)&&(Vt=wt.lastIntValue),ho(Vt)?(wt.lastIntValue=Vt,!0):(wt.pos=Lt,!1)};function ho(wt){return ut(wt,!0)||wt===36||wt===95||wt===8204||wt===8205}Jr.regexp_eatAtomEscape=function(wt){return this.regexp_eatBackReference(wt)||this.regexp_eatCharacterClassEscape(wt)||this.regexp_eatCharacterEscape(wt)||wt.switchN&&this.regexp_eatKGroupName(wt)?!0:(wt.switchU&&(wt.current()===99&&wt.raise("Invalid unicode escape"),wt.raise("Invalid escape")),!1)},Jr.regexp_eatBackReference=function(wt){var Lt=wt.pos;if(this.regexp_eatDecimalEscape(wt)){var Vt=wt.lastIntValue;if(wt.switchU)return Vt>wt.maxBackReference&&(wt.maxBackReference=Vt),!0;if(Vt<=wt.numCapturingParens)return!0;wt.pos=Lt}return!1},Jr.regexp_eatKGroupName=function(wt){if(wt.eat(107)){if(this.regexp_eatGroupName(wt))return wt.backReferenceNames.push(wt.lastStringValue),!0;wt.raise("Invalid named reference")}return!1},Jr.regexp_eatCharacterEscape=function(wt){return this.regexp_eatControlEscape(wt)||this.regexp_eatCControlLetter(wt)||this.regexp_eatZero(wt)||this.regexp_eatHexEscapeSequence(wt)||this.regexp_eatRegExpUnicodeEscapeSequence(wt)||!wt.switchU&&this.regexp_eatLegacyOctalEscapeSequence(wt)||this.regexp_eatIdentityEscape(wt)},Jr.regexp_eatCControlLetter=function(wt){var Lt=wt.pos;if(wt.eat(99)){if(this.regexp_eatControlLetter(wt))return!0;wt.pos=Lt}return!1},Jr.regexp_eatZero=function(wt){return wt.current()===48&&!_s(wt.lookahead())?(wt.lastIntValue=0,wt.advance(),!0):!1},Jr.regexp_eatControlEscape=function(wt){var Lt=wt.current();return Lt===116?(wt.lastIntValue=9,wt.advance(),!0):Lt===110?(wt.lastIntValue=10,wt.advance(),!0):Lt===118?(wt.lastIntValue=11,wt.advance(),!0):Lt===102?(wt.lastIntValue=12,wt.advance(),!0):Lt===114?(wt.lastIntValue=13,wt.advance(),!0):!1},Jr.regexp_eatControlLetter=function(wt){var Lt=wt.current();return so(Lt)?(wt.lastIntValue=Lt%32,wt.advance(),!0):!1};function so(wt){return wt>=65&&wt<=90||wt>=97&&wt<=122}Jr.regexp_eatRegExpUnicodeEscapeSequence=function(wt){var Lt=wt.pos;if(wt.eat(117)){if(this.regexp_eatFixedHexDigits(wt,4)){var Vt=wt.lastIntValue;if(wt.switchU&&Vt>=55296&&Vt<=56319){var Xt=wt.pos;if(wt.eat(92)&&wt.eat(117)&&this.regexp_eatFixedHexDigits(wt,4)){var or=wt.lastIntValue;if(or>=56320&&or<=57343)return wt.lastIntValue=(Vt-55296)*1024+(or-56320)+65536,!0}wt.pos=Xt,wt.lastIntValue=Vt}return!0}if(wt.switchU&&wt.eat(123)&&this.regexp_eatHexDigits(wt)&&wt.eat(125)&&fo(wt.lastIntValue))return!0;wt.switchU&&wt.raise("Invalid unicode escape"),wt.pos=Lt}return!1};function fo(wt){return wt>=0&&wt<=1114111}Jr.regexp_eatIdentityEscape=function(wt){if(wt.switchU)return this.regexp_eatSyntaxCharacter(wt)?!0:wt.eat(47)?(wt.lastIntValue=47,!0):!1;var Lt=wt.current();return Lt!==99&&(!wt.switchN||Lt!==107)?(wt.lastIntValue=Lt,wt.advance(),!0):!1},Jr.regexp_eatDecimalEscape=function(wt){wt.lastIntValue=0;var Lt=wt.current();if(Lt>=49&&Lt<=57){do wt.lastIntValue=10*wt.lastIntValue+(Lt-48),wt.advance();while((Lt=wt.current())>=48&&Lt<=57);return!0}return!1},Jr.regexp_eatCharacterClassEscape=function(wt){var Lt=wt.current();if(po(Lt))return wt.lastIntValue=-1,wt.advance(),!0;if(wt.switchU&&this.options.ecmaVersion>=9&&(Lt===80||Lt===112)){if(wt.lastIntValue=-1,wt.advance(),wt.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(wt)&&wt.eat(125))return!0;wt.raise("Invalid property name")}return!1};function po(wt){return wt===100||wt===68||wt===115||wt===83||wt===119||wt===87}Jr.regexp_eatUnicodePropertyValueExpression=function(wt){var Lt=wt.pos;if(this.regexp_eatUnicodePropertyName(wt)&&wt.eat(61)){var Vt=wt.lastStringValue;if(this.regexp_eatUnicodePropertyValue(wt)){var Xt=wt.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(wt,Vt,Xt),!0}}if(wt.pos=Lt,this.regexp_eatLoneUnicodePropertyNameOrValue(wt)){var or=wt.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(wt,or),!0}return!1},Jr.regexp_validateUnicodePropertyNameAndValue=function(wt,Lt,Vt){Mt(wt.unicodeProperties.nonBinary,Lt)||wt.raise("Invalid property name"),wt.unicodeProperties.nonBinary[Lt].test(Vt)||wt.raise("Invalid property value")},Jr.regexp_validateUnicodePropertyNameOrValue=function(wt,Lt){wt.unicodeProperties.binary.test(Lt)||wt.raise("Invalid property name")},Jr.regexp_eatUnicodePropertyName=function(wt){var Lt=0;for(wt.lastStringValue="";oo(Lt=wt.current());)wt.lastStringValue+=Ks(Lt),wt.advance();return wt.lastStringValue!==""};function oo(wt){return so(wt)||wt===95}Jr.regexp_eatUnicodePropertyValue=function(wt){var Lt=0;for(wt.lastStringValue="";fs(Lt=wt.current());)wt.lastStringValue+=Ks(Lt),wt.advance();return wt.lastStringValue!==""};function fs(wt){return oo(wt)||_s(wt)}Jr.regexp_eatLoneUnicodePropertyNameOrValue=function(wt){return this.regexp_eatUnicodePropertyValue(wt)},Jr.regexp_eatCharacterClass=function(wt){if(wt.eat(91)){if(wt.eat(94),this.regexp_classRanges(wt),wt.eat(93))return!0;wt.raise("Unterminated character class")}return!1},Jr.regexp_classRanges=function(wt){for(;this.regexp_eatClassAtom(wt);){var Lt=wt.lastIntValue;if(wt.eat(45)&&this.regexp_eatClassAtom(wt)){var Vt=wt.lastIntValue;wt.switchU&&(Lt===-1||Vt===-1)&&wt.raise("Invalid character class"),Lt!==-1&&Vt!==-1&&Lt>Vt&&wt.raise("Range out of order in character class")}}},Jr.regexp_eatClassAtom=function(wt){var Lt=wt.pos;if(wt.eat(92)){if(this.regexp_eatClassEscape(wt))return!0;if(wt.switchU){var Vt=wt.current();(Vt===99||Xs(Vt))&&wt.raise("Invalid class escape"),wt.raise("Invalid escape")}wt.pos=Lt}var Xt=wt.current();return Xt!==93?(wt.lastIntValue=Xt,wt.advance(),!0):!1},Jr.regexp_eatClassEscape=function(wt){var Lt=wt.pos;if(wt.eat(98))return wt.lastIntValue=8,!0;if(wt.switchU&&wt.eat(45))return wt.lastIntValue=45,!0;if(!wt.switchU&&wt.eat(99)){if(this.regexp_eatClassControlLetter(wt))return!0;wt.pos=Lt}return this.regexp_eatCharacterClassEscape(wt)||this.regexp_eatCharacterEscape(wt)},Jr.regexp_eatClassControlLetter=function(wt){var Lt=wt.current();return _s(Lt)||Lt===95?(wt.lastIntValue=Lt%32,wt.advance(),!0):!1},Jr.regexp_eatHexEscapeSequence=function(wt){var Lt=wt.pos;if(wt.eat(120)){if(this.regexp_eatFixedHexDigits(wt,2))return!0;wt.switchU&&wt.raise("Invalid escape"),wt.pos=Lt}return!1},Jr.regexp_eatDecimalDigits=function(wt){var Lt=wt.pos,Vt=0;for(wt.lastIntValue=0;_s(Vt=wt.current());)wt.lastIntValue=10*wt.lastIntValue+(Vt-48),wt.advance();return wt.pos!==Lt};function _s(wt){return wt>=48&&wt<=57}Jr.regexp_eatHexDigits=function(wt){var Lt=wt.pos,Vt=0;for(wt.lastIntValue=0;Is(Vt=wt.current());)wt.lastIntValue=16*wt.lastIntValue+Es(Vt),wt.advance();return wt.pos!==Lt};function Is(wt){return wt>=48&&wt<=57||wt>=65&&wt<=70||wt>=97&&wt<=102}function Es(wt){return wt>=65&&wt<=70?10+(wt-65):wt>=97&&wt<=102?10+(wt-97):wt-48}Jr.regexp_eatLegacyOctalEscapeSequence=function(wt){if(this.regexp_eatOctalDigit(wt)){var Lt=wt.lastIntValue;if(this.regexp_eatOctalDigit(wt)){var Vt=wt.lastIntValue;Lt<=3&&this.regexp_eatOctalDigit(wt)?wt.lastIntValue=Lt*64+Vt*8+wt.lastIntValue:wt.lastIntValue=Lt*8+Vt}else wt.lastIntValue=Lt;return!0}return!1},Jr.regexp_eatOctalDigit=function(wt){var Lt=wt.current();return Xs(Lt)?(wt.lastIntValue=Lt-48,wt.advance(),!0):(wt.lastIntValue=0,!1)};function Xs(wt){return wt>=48&&wt<=55}Jr.regexp_eatFixedHexDigits=function(wt,Lt){var Vt=wt.pos;wt.lastIntValue=0;for(var Xt=0;Xt=this.input.length)return this.finishToken(yt.eof);if(wt.override)return wt.override(this);this.readToken(this.fullCharCodeAtPos())},gn.readToken=function(wt){return ht(wt,this.options.ecmaVersion>=6)||wt===92?this.readWord():this.getTokenFromCode(wt)},gn.fullCharCodeAtPos=function(){var wt=this.input.charCodeAt(this.pos);if(wt<=55295||wt>=57344)return wt;var Lt=this.input.charCodeAt(this.pos+1);return(wt<<10)+Lt-56613888},gn.skipBlockComment=function(){var wt=this.options.onComment&&this.curPosition(),Lt=this.pos,Vt=this.input.indexOf("*/",this.pos+=2);if(Vt===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=Vt+2,this.options.locations){Ct.lastIndex=Lt;for(var Xt;(Xt=Ct.exec(this.input))&&Xt.index8&&wt<14||wt>=5760&&kt.test(String.fromCharCode(wt)))++this.pos;else break e}}},gn.finishToken=function(wt,Lt){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var Vt=this.type;this.type=wt,this.value=Lt,this.updateContext(Vt)},gn.readToken_dot=function(){var wt=this.input.charCodeAt(this.pos+1);if(wt>=48&&wt<=57)return this.readNumber(!0);var Lt=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&wt===46&&Lt===46?(this.pos+=3,this.finishToken(yt.ellipsis)):(++this.pos,this.finishToken(yt.dot))},gn.readToken_slash=function(){var wt=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):wt===61?this.finishOp(yt.assign,2):this.finishOp(yt.slash,1)},gn.readToken_mult_modulo_exp=function(wt){var Lt=this.input.charCodeAt(this.pos+1),Vt=1,Xt=wt===42?yt.star:yt.modulo;return this.options.ecmaVersion>=7&&wt===42&&Lt===42&&(++Vt,Xt=yt.starstar,Lt=this.input.charCodeAt(this.pos+2)),Lt===61?this.finishOp(yt.assign,Vt+1):this.finishOp(Xt,Vt)},gn.readToken_pipe_amp=function(wt){var Lt=this.input.charCodeAt(this.pos+1);return Lt===wt?this.finishOp(wt===124?yt.logicalOR:yt.logicalAND,2):Lt===61?this.finishOp(yt.assign,2):this.finishOp(wt===124?yt.bitwiseOR:yt.bitwiseAND,1)},gn.readToken_caret=function(){var wt=this.input.charCodeAt(this.pos+1);return wt===61?this.finishOp(yt.assign,2):this.finishOp(yt.bitwiseXOR,1)},gn.readToken_plus_min=function(wt){var Lt=this.input.charCodeAt(this.pos+1);return Lt===wt?Lt===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||_t.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(yt.incDec,2):Lt===61?this.finishOp(yt.assign,2):this.finishOp(yt.plusMin,1)},gn.readToken_lt_gt=function(wt){var Lt=this.input.charCodeAt(this.pos+1),Vt=1;return Lt===wt?(Vt=wt===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+Vt)===61?this.finishOp(yt.assign,Vt+1):this.finishOp(yt.bitShift,Vt)):Lt===33&&wt===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(Lt===61&&(Vt=2),this.finishOp(yt.relational,Vt))},gn.readToken_eq_excl=function(wt){var Lt=this.input.charCodeAt(this.pos+1);return Lt===61?this.finishOp(yt.equality,this.input.charCodeAt(this.pos+2)===61?3:2):wt===61&&Lt===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(yt.arrow)):this.finishOp(wt===61?yt.eq:yt.prefix,1)},gn.getTokenFromCode=function(wt){switch(wt){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(yt.parenL);case 41:return++this.pos,this.finishToken(yt.parenR);case 59:return++this.pos,this.finishToken(yt.semi);case 44:return++this.pos,this.finishToken(yt.comma);case 91:return++this.pos,this.finishToken(yt.bracketL);case 93:return++this.pos,this.finishToken(yt.bracketR);case 123:return++this.pos,this.finishToken(yt.braceL);case 125:return++this.pos,this.finishToken(yt.braceR);case 58:return++this.pos,this.finishToken(yt.colon);case 63:return++this.pos,this.finishToken(yt.question);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(yt.backQuote);case 48:var Lt=this.input.charCodeAt(this.pos+1);if(Lt===120||Lt===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(Lt===111||Lt===79)return this.readRadixNumber(8);if(Lt===98||Lt===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(wt);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(wt);case 124:case 38:return this.readToken_pipe_amp(wt);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(wt);case 60:case 62:return this.readToken_lt_gt(wt);case 61:case 33:return this.readToken_eq_excl(wt);case 126:return this.finishOp(yt.prefix,1)}this.raise(this.pos,"Unexpected character '"+Xr(wt)+"'")},gn.finishOp=function(wt,Lt){var Vt=this.input.slice(this.pos,this.pos+Lt);return this.pos+=Lt,this.finishToken(wt,Vt)},gn.readRegexp=function(){for(var wt,Lt,Vt=this.pos;;){this.pos>=this.input.length&&this.raise(Vt,"Unterminated regular expression");var Xt=this.input.charAt(this.pos);if(_t.test(Xt)&&this.raise(Vt,"Unterminated regular expression"),wt)wt=!1;else{if(Xt==="[")Lt=!0;else if(Xt==="]"&&Lt)Lt=!1;else if(Xt==="/"&&!Lt)break;wt=Xt==="\\"}++this.pos}var or=this.input.slice(Vt,this.pos);++this.pos;var br=this.pos,$r=this.readWord1();this.containsEsc&&this.unexpected(br);var zr=this.regexpState||(this.regexpState=new hs(this));zr.reset(Vt,or,$r),this.validateRegExpFlags(zr),this.validateRegExpPattern(zr);var Zr=null;try{Zr=new RegExp(or,$r)}catch{}return this.finishToken(yt.regexp,{pattern:or,flags:$r,value:Zr})},gn.readInt=function(wt,Lt){for(var Vt=this.pos,Xt=0,or=0,br=Lt??1/0;or=97?zr=$r-97+10:$r>=65?zr=$r-65+10:$r>=48&&$r<=57?zr=$r-48:zr=1/0,zr>=wt)break;++this.pos,Xt=Xt*wt+zr}return this.pos===Vt||Lt!=null&&this.pos-Vt!==Lt?null:Xt},gn.readRadixNumber=function(wt){var Lt=this.pos;this.pos+=2;var Vt=this.readInt(wt);return Vt==null&&this.raise(this.start+2,"Expected number in radix "+wt),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(Vt=typeof BigInt<"u"?BigInt(this.input.slice(Lt,this.pos)):null,++this.pos):ht(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(yt.num,Vt)},gn.readNumber=function(wt){var Lt=this.pos;!wt&&this.readInt(10)===null&&this.raise(Lt,"Invalid number");var Vt=this.pos-Lt>=2&&this.input.charCodeAt(Lt)===48;Vt&&this.strict&&this.raise(Lt,"Invalid number");var Xt=this.input.charCodeAt(this.pos);if(!Vt&&!wt&&this.options.ecmaVersion>=11&&Xt===110){var or=this.input.slice(Lt,this.pos),br=typeof BigInt<"u"?BigInt(or):null;return++this.pos,ht(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(yt.num,br)}Vt&&/[89]/.test(this.input.slice(Lt,this.pos))&&(Vt=!1),Xt===46&&!Vt&&(++this.pos,this.readInt(10),Xt=this.input.charCodeAt(this.pos)),(Xt===69||Xt===101)&&!Vt&&(Xt=this.input.charCodeAt(++this.pos),(Xt===43||Xt===45)&&++this.pos,this.readInt(10)===null&&this.raise(Lt,"Invalid number")),ht(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var $r=this.input.slice(Lt,this.pos),zr=Vt?parseInt($r,8):parseFloat($r);return this.finishToken(yt.num,zr)},gn.readCodePoint=function(){var wt=this.input.charCodeAt(this.pos),Lt;if(wt===123){this.options.ecmaVersion<6&&this.unexpected();var Vt=++this.pos;Lt=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,Lt>1114111&&this.invalidStringToken(Vt,"Code point out of bounds")}else Lt=this.readHexChar(4);return Lt};function Xr(wt){return wt<=65535?String.fromCharCode(wt):(wt-=65536,String.fromCharCode((wt>>10)+55296,(wt&1023)+56320))}gn.readString=function(wt){for(var Lt="",Vt=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var Xt=this.input.charCodeAt(this.pos);if(Xt===wt)break;Xt===92?(Lt+=this.input.slice(Vt,this.pos),Lt+=this.readEscapedChar(!1),Vt=this.pos):(Et(Xt,this.options.ecmaVersion>=10)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return Lt+=this.input.slice(Vt,this.pos++),this.finishToken(yt.string,Lt)};var Qn={};gn.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(wt){if(wt===Qn)this.readInvalidTemplateToken();else throw wt}this.inTemplateElement=!1},gn.invalidStringToken=function(wt,Lt){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Qn;this.raise(wt,Lt)},gn.readTmplToken=function(){for(var wt="",Lt=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var Vt=this.input.charCodeAt(this.pos);if(Vt===96||Vt===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===yt.template||this.type===yt.invalidTemplate)?Vt===36?(this.pos+=2,this.finishToken(yt.dollarBraceL)):(++this.pos,this.finishToken(yt.backQuote)):(wt+=this.input.slice(Lt,this.pos),this.finishToken(yt.template,wt));if(Vt===92)wt+=this.input.slice(Lt,this.pos),wt+=this.readEscapedChar(!0),Lt=this.pos;else if(Et(Vt)){switch(wt+=this.input.slice(Lt,this.pos),++this.pos,Vt){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:wt+=` `;break;default:wt+=String.fromCharCode(Vt);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),Lt=this.pos}else++this.pos}},gn.readInvalidTemplateToken=function(){for(;this.pos=48&&Lt<=55){var Xt=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],or=parseInt(Xt,8);return or>255&&(Xt=Xt.slice(0,-1),or=parseInt(Xt,8)),this.pos+=Xt.length-1,Lt=this.input.charCodeAt(this.pos),(Xt!=="0"||Lt===56||Lt===57)&&(this.strict||wt)&&this.invalidStringToken(this.pos-1-Xt.length,wt?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(or)}return Et(Lt)?"":String.fromCharCode(Lt)}},gn.readHexChar=function(wt){var Lt=this.pos,Vt=this.readInt(16,wt);return Vt===null&&this.invalidStringToken(Lt,"Bad character escape sequence"),Vt},gn.readWord1=function(){this.containsEsc=!1;for(var wt="",Lt=!0,Vt=this.pos,Xt=this.options.ecmaVersion>=6;this.pos=48&&Lt<=55){var Xt=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],or=parseInt(Xt,8);return or>255&&(Xt=Xt.slice(0,-1),or=parseInt(Xt,8)),this.pos+=Xt.length-1,Lt=this.input.charCodeAt(this.pos),(Xt!=="0"||Lt===56||Lt===57)&&(this.strict||wt)&&this.invalidStringToken(this.pos-1-Xt.length,wt?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(or)}return Et(Lt)?"":String.fromCharCode(Lt)}},gn.readHexChar=function(wt){var Lt=this.pos,Vt=this.readInt(16,wt);return Vt===null&&this.invalidStringToken(Lt,"Bad character escape sequence"),Vt},gn.readWord1=function(){this.containsEsc=!1;for(var wt="",Lt=!0,Vt=this.pos,Xt=this.options.ecmaVersion>=6;this.pos0;)ct.pop()}function kt(zt,Ht){ht[zt]=Ht}function Tt(zt){const Ht=dt[zt];return Ht?$+"."+Ht:zt}function $t(zt){xt=" ".repeat(zt)}function It(zt,Ht){const Zt=`${$}Variable${gt.length}`;return ct.push(`${xt}const ${Zt} = ${Ht};`),gt.push(zt),Zt}function Ot(zt,Ht){const Zt=`${$}Variable${gt.length}`,qt=`imageDatum${St}`;ct.push(`${xt}let ${qt} = ["P3\\n# ${lt}.ppm\\n", ${zt}, ' ', ${Ht}, "\\n255\\n"].join("");`),ct.push(`${xt}for (let i = 0; i < ${qt}.length; i += 4) {`),ct.push(`${xt} ${qt} += ${Zt}[i] + ' ' + ${Zt}[i + 1] + ' ' + ${Zt}[i + 2] + ' ';`),ct.push(`${xt}}`),ct.push(`${xt}if (typeof require !== "undefined") {`),ct.push(`${xt} require('fs').writeFileSync('./${lt}.ppm', ${qt});`),ct.push(`${xt}}`),St++}function Mt(zt){ct.push(`${xt}// ${zt}`)}function Dt(){ct.push(`${xt}(() => { ${xt}const error = ${$}.getError(); ${xt}if (error !== ${$}.NONE) { @@ -1805,19 +1805,19 @@ ${xt} throw new Error('${$} threw ' + name); ${xt} } ${xt} } ${xt}} -${xt}})();`)}function Bt(zt,Ht){return`${$}.${zt}(${at(Ht,{contextName:$,contextVariables:gt,getEntity:Tt,addVariable:It,variables:ht,onUnrecognizedArgumentLookup:pt})})`}function Kt(zt){if(ht){for(const Ht in ht)if(ht[Ht]===zt)return Ht}return null}function Wt(zt){const Ht=gt.indexOf(zt);return Ht!==-1?`${$}Variable${Ht}`:null}}function ot(j,_){const $=new Proxy(j,{get:dt}),tt={},{contextName:st,contextVariables:lt,getEntity:ct,useTrackablePrimitives:ht,recording:ut,variables:pt,indent:mt,onUnrecognizedArgumentLookup:gt}=_;return $;function dt(_t,Ct){return typeof _t[Ct]=="function"?function(){switch(Ct){case"drawBuffersWEBGL":return ut.push(`${mt}${st}.drawBuffersWEBGL([${at(arguments[0],{contextName:st,contextVariables:lt,getEntity:St,addVariable:yt,variables:pt,onUnrecognizedArgumentLookup:gt})}]);`),j.drawBuffersWEBGL(arguments[0])}let Et=j[Ct].apply(j,arguments);switch(typeof Et){case"undefined":ut.push(`${mt}${xt(Ct,arguments)};`);return;case"number":case"boolean":ht&<.indexOf(it(Et))===-1?(ut.push(`${mt}const ${st}Variable${lt.length} = ${xt(Ct,arguments)};`),lt.push(Et=it(Et))):(ut.push(`${mt}const ${st}Variable${lt.length} = ${xt(Ct,arguments)};`),lt.push(Et));break;default:Et===null?ut.push(`${xt(Ct,arguments)};`):ut.push(`${mt}const ${st}Variable${lt.length} = ${xt(Ct,arguments)};`),lt.push(Et)}return Et}:(tt[j[Ct]]=Ct,j[Ct])}function St(_t){return tt.hasOwnProperty(_t)?`${st}.${tt[_t]}`:ct(_t)}function xt(_t,Ct){return`${st}.${_t}(${at(Ct,{contextName:st,contextVariables:lt,getEntity:St,addVariable:yt,variables:pt,onUnrecognizedArgumentLookup:gt})})`}function yt(_t,Ct){const Et=`${st}Variable${lt.length}`;return lt.push(_t),ut.push(`${mt}const ${Et} = ${Ct};`),Et}}function at(j,_){const{variables:$,onUnrecognizedArgumentLookup:tt}=_;return Array.from(j).map(lt=>{const ct=st(lt);return ct||nt(lt,_)}).join(", ");function st(lt){if($){for(const ct in $)if($.hasOwnProperty(ct)&&$[ct]===lt)return ct}return tt?tt(lt):null}}function nt(j,_){const{contextName:$,contextVariables:tt,getEntity:st,addVariable:lt,onUnrecognizedArgumentLookup:ct}=_;if(typeof j>"u")return"undefined";if(j===null)return"null";const ht=tt.indexOf(j);if(ht>-1)return`${$}Variable${ht}`;switch(j.constructor.name){case"String":const ut=/\n/.test(j),pt=/'/.test(j),mt=/"/.test(j);return ut?"`"+j+"`":pt&&!mt?'"'+j+'"':"'"+j+"'";case"Number":return st(j);case"Boolean":return st(j);case"Array":return lt(j,`new ${j.constructor.name}([${Array.from(j).join(",")}])`);case"Float32Array":case"Uint8Array":case"Uint16Array":case"Int32Array":return lt(j,`new ${j.constructor.name}(${JSON.stringify(Array.from(j))})`);default:if(ct){const gt=ct(j);if(gt)return gt}throw new Error(`unrecognized argument type ${j.constructor.name}`)}}function it(j){return new j.constructor(j)}typeof a<"u"&&(a.exports={glWiretap:et,glExtensionWiretap:ot}),typeof window<"u"&&(et.glExtensionWiretap=ot,window.glWiretap=et)},{}],4:[function(o,a,rt){function et(lt){const ct=new Array(lt.length);for(let ht=0;ht{lt.output=$(ut),lt.graphical&&_(lt)},lt.toJSON=()=>{throw new Error("Not usable with gpuMock")},lt.setConstants=ut=>(lt.constants=ut,lt),lt.setGraphical=ut=>(lt.graphical=ut,lt),lt.setCanvas=ut=>(lt.canvas=ut,lt),lt.setContext=ut=>(lt.context=ut,lt),lt.destroy=()=>{},lt.validateSettings=()=>{},lt.graphical&<.output&&_(lt),lt.exec=function(){return new Promise((ut,pt)=>{try{ut(lt.apply(lt,arguments))}catch(mt){pt(mt)}})},lt.getPixels=ut=>{const{x:pt,y:mt}=lt.output;return ut?st(lt._imageData.data,pt,mt):lt._imageData.data.slice(0)},lt.color=function(ut,pt,mt,gt){typeof gt>"u"&&(gt=1),ut=Math.floor(ut*255),pt=Math.floor(pt*255),mt=Math.floor(mt*255),gt=Math.floor(gt*255);const dt=lt.output.x,St=lt.output.y,xt=lt.thread.x,yt=St-lt.thread.y-1,_t=xt+yt*dt;lt._colorData[_t*4+0]=ut,lt._colorData[_t*4+1]=pt,lt._colorData[_t*4+2]=mt,lt._colorData[_t*4+3]=gt};const ct=()=>lt,ht=["setWarnVarUsage","setArgumentTypes","setTactic","setOptimizeFloatMemory","setDebug","setLoopMaxIterations","setConstantTypes","setFunctions","setNativeFunctions","setInjectedNative","setPipeline","setPrecision","setOutputToTexture","setImmutable","setStrictIntegers","setDynamicOutput","setHardcodeConstants","setDynamicArguments","setUseLegacyEncoder","setWarnVarUsage","addSubKernel"];for(let ut=0;ut0&&it.push(", "),it.push("user_"),it.push(_)}it.push(`) { +${xt}})();`)}function Bt(zt,Ht){return`${$}.${zt}(${at(Ht,{contextName:$,contextVariables:gt,getEntity:Tt,addVariable:It,variables:ht,onUnrecognizedArgumentLookup:pt})})`}function Kt(zt){if(ht){for(const Ht in ht)if(ht[Ht]===zt)return Ht}return null}function Wt(zt){const Ht=gt.indexOf(zt);return Ht!==-1?`${$}Variable${Ht}`:null}}function ot(j,_){const $=new Proxy(j,{get:dt}),et={},{contextName:st,contextVariables:lt,getEntity:ct,useTrackablePrimitives:ht,recording:ut,variables:pt,indent:mt,onUnrecognizedArgumentLookup:gt}=_;return $;function dt(_t,Ct){return typeof _t[Ct]=="function"?function(){switch(Ct){case"drawBuffersWEBGL":return ut.push(`${mt}${st}.drawBuffersWEBGL([${at(arguments[0],{contextName:st,contextVariables:lt,getEntity:St,addVariable:yt,variables:pt,onUnrecognizedArgumentLookup:gt})}]);`),j.drawBuffersWEBGL(arguments[0])}let Et=j[Ct].apply(j,arguments);switch(typeof Et){case"undefined":ut.push(`${mt}${xt(Ct,arguments)};`);return;case"number":case"boolean":ht&<.indexOf(it(Et))===-1?(ut.push(`${mt}const ${st}Variable${lt.length} = ${xt(Ct,arguments)};`),lt.push(Et=it(Et))):(ut.push(`${mt}const ${st}Variable${lt.length} = ${xt(Ct,arguments)};`),lt.push(Et));break;default:Et===null?ut.push(`${xt(Ct,arguments)};`):ut.push(`${mt}const ${st}Variable${lt.length} = ${xt(Ct,arguments)};`),lt.push(Et)}return Et}:(et[j[Ct]]=Ct,j[Ct])}function St(_t){return et.hasOwnProperty(_t)?`${st}.${et[_t]}`:ct(_t)}function xt(_t,Ct){return`${st}.${_t}(${at(Ct,{contextName:st,contextVariables:lt,getEntity:St,addVariable:yt,variables:pt,onUnrecognizedArgumentLookup:gt})})`}function yt(_t,Ct){const Et=`${st}Variable${lt.length}`;return lt.push(_t),ut.push(`${mt}const ${Et} = ${Ct};`),Et}}function at(j,_){const{variables:$,onUnrecognizedArgumentLookup:et}=_;return Array.from(j).map(lt=>{const ct=st(lt);return ct||nt(lt,_)}).join(", ");function st(lt){if($){for(const ct in $)if($.hasOwnProperty(ct)&&$[ct]===lt)return ct}return et?et(lt):null}}function nt(j,_){const{contextName:$,contextVariables:et,getEntity:st,addVariable:lt,onUnrecognizedArgumentLookup:ct}=_;if(typeof j>"u")return"undefined";if(j===null)return"null";const ht=et.indexOf(j);if(ht>-1)return`${$}Variable${ht}`;switch(j.constructor.name){case"String":const ut=/\n/.test(j),pt=/'/.test(j),mt=/"/.test(j);return ut?"`"+j+"`":pt&&!mt?'"'+j+'"':"'"+j+"'";case"Number":return st(j);case"Boolean":return st(j);case"Array":return lt(j,`new ${j.constructor.name}([${Array.from(j).join(",")}])`);case"Float32Array":case"Uint8Array":case"Uint16Array":case"Int32Array":return lt(j,`new ${j.constructor.name}(${JSON.stringify(Array.from(j))})`);default:if(ct){const gt=ct(j);if(gt)return gt}throw new Error(`unrecognized argument type ${j.constructor.name}`)}}function it(j){return new j.constructor(j)}typeof a<"u"&&(a.exports={glWiretap:tt,glExtensionWiretap:ot}),typeof window<"u"&&(tt.glExtensionWiretap=ot,window.glWiretap=tt)},{}],4:[function(o,a,rt){function tt(lt){const ct=new Array(lt.length);for(let ht=0;ht{lt.output=$(ut),lt.graphical&&_(lt)},lt.toJSON=()=>{throw new Error("Not usable with gpuMock")},lt.setConstants=ut=>(lt.constants=ut,lt),lt.setGraphical=ut=>(lt.graphical=ut,lt),lt.setCanvas=ut=>(lt.canvas=ut,lt),lt.setContext=ut=>(lt.context=ut,lt),lt.destroy=()=>{},lt.validateSettings=()=>{},lt.graphical&<.output&&_(lt),lt.exec=function(){return new Promise((ut,pt)=>{try{ut(lt.apply(lt,arguments))}catch(mt){pt(mt)}})},lt.getPixels=ut=>{const{x:pt,y:mt}=lt.output;return ut?st(lt._imageData.data,pt,mt):lt._imageData.data.slice(0)},lt.color=function(ut,pt,mt,gt){typeof gt>"u"&&(gt=1),ut=Math.floor(ut*255),pt=Math.floor(pt*255),mt=Math.floor(mt*255),gt=Math.floor(gt*255);const dt=lt.output.x,St=lt.output.y,xt=lt.thread.x,yt=St-lt.thread.y-1,_t=xt+yt*dt;lt._colorData[_t*4+0]=ut,lt._colorData[_t*4+1]=pt,lt._colorData[_t*4+2]=mt,lt._colorData[_t*4+3]=gt};const ct=()=>lt,ht=["setWarnVarUsage","setArgumentTypes","setTactic","setOptimizeFloatMemory","setDebug","setLoopMaxIterations","setConstantTypes","setFunctions","setNativeFunctions","setInjectedNative","setPipeline","setPrecision","setOutputToTexture","setImmutable","setStrictIntegers","setDynamicOutput","setHardcodeConstants","setDynamicArguments","setUseLegacyEncoder","setWarnVarUsage","addSubKernel"];for(let ut=0;ut0&&it.push(", "),it.push("user_"),it.push(_)}it.push(`) { `)}for(let j=0;j0&&it.push(j.join(""),`; `),it.push(`for (let ${lt}=0;${lt}0&&it.push(`if (!${_.join("")}) break; -`),it.push(tt.join("")),it.push(` +`),it.push(et.join("")),it.push(` ${$.join("")};`),it.push(`} `)}return it}astWhileStatement(nt,it){if(nt.type!=="WhileStatement")throw this.astErrorOutput("Invalid while statement",nt);return it.push("for (let i = 0; i < LOOP_MAX; i++) {"),it.push("if ("),this.astGeneric(nt.test,it),it.push(`) { `),this.astGeneric(nt.body,it),it.push(`} else { @@ -1830,7 +1830,7 @@ ${$.join("")};`),it.push(`} `),it.push(`} `),it}astAssignmentExpression(nt,it){const j=this.getDeclaration(nt.left);if(j&&!j.assignable)throw this.astErrorOutput(`Variable ${nt.left.name} is not assignable here`,nt);return this.astGeneric(nt.left,it),it.push(nt.operator),this.astGeneric(nt.right,it),it}astBlockStatement(nt,it){if(this.isState("loop-body")){this.pushState("block-body");for(let j=0;j0&&it.push(",");const $=j[_],tt=this.getDeclaration($.id);tt.valueType||(tt.valueType=this.getType($.init)),this.astGeneric($,it)}return this.isState("in-for-loop-init")||it.push(";"),it}astIfStatement(nt,it){return it.push("if ("),this.astGeneric(nt.test,it),it.push(")"),nt.consequent.type==="BlockStatement"?this.astGeneric(nt.consequent,it):(it.push(` { +`)}return it}astVariableDeclaration(nt,it){it.push(`${nt.kind} `);const{declarations:j}=nt;for(let _=0;_0&&it.push(",");const $=j[_],et=this.getDeclaration($.id);et.valueType||(et.valueType=this.getType($.init)),this.astGeneric($,it)}return this.isState("in-for-loop-init")||it.push(";"),it}astIfStatement(nt,it){return it.push("if ("),this.astGeneric(nt.test,it),it.push(")"),nt.consequent.type==="BlockStatement"?this.astGeneric(nt.consequent,it):(it.push(` { `),this.astGeneric(nt.consequent,it),it.push(` } `)),nt.alternate&&(it.push("else "),nt.alternate.type==="BlockStatement"||nt.alternate.type==="IfStatement"?this.astGeneric(nt.alternate,it):(it.push(` { @@ -1842,7 +1842,7 @@ ${$.join("")};`),it.push(`} `);continue}it.push("case "),this.astGeneric(_[$].test,it),it.push(`: `),_[$].consequent&&_[$].consequent.length>0&&(this.astGeneric(_[$].consequent,it),it.push(`break; `))}it.push(` -}`)}astThisExpression(nt,it){return it.push("_this"),it}astMemberExpression(nt,it){const{signature:j,type:_,property:$,xProperty:tt,yProperty:st,zProperty:lt,name:ct,origin:ht}=this.getMemberExpressionDetails(nt);switch(j){case"this.thread.value":return it.push(`_this.thread.${ct}`),it;case"this.output.value":switch(ct){case"x":it.push("outputX");break;case"y":it.push("outputY");break;case"z":it.push("outputZ");break;default:throw this.astErrorOutput("Unexpected expression",nt)}return it;case"value":throw this.astErrorOutput("Unexpected expression",nt);case"value[]":case"value[][]":case"value[][][]":case"value.value":if(ht==="Math")return it.push(Math[ct]),it;switch($){case"r":return it.push(`user_${ct}[0]`),it;case"g":return it.push(`user_${ct}[1]`),it;case"b":return it.push(`user_${ct}[2]`),it;case"a":return it.push(`user_${ct}[3]`),it}break;case"this.constants.value":case"this.constants.value[]":case"this.constants.value[][]":case"this.constants.value[][][]":break;case"fn()[]":return this.astGeneric(nt.object,it),it.push("["),this.astGeneric(nt.property,it),it.push("]"),it;case"fn()[][]":return this.astGeneric(nt.object.object,it),it.push("["),this.astGeneric(nt.object.property,it),it.push("]"),it.push("["),this.astGeneric(nt.property,it),it.push("]"),it;default:throw this.astErrorOutput("Unexpected expression",nt)}if(!nt.computed)switch(_){case"Number":case"Integer":case"Float":case"Boolean":return it.push(`${ht}_${ct}`),it}const ut=`${ht}_${ct}`;switch(_){case"Array(2)":case"Array(3)":case"Array(4)":case"Matrix(2)":case"Matrix(3)":case"Matrix(4)":case"HTMLImageArray":case"ArrayTexture(1)":case"ArrayTexture(2)":case"ArrayTexture(3)":case"ArrayTexture(4)":case"HTMLImage":default:let pt,mt;if(ht==="constants"){const gt=this.constants[ct];mt=this.constantTypes[ct]==="Input",pt=mt?gt.size:null}else mt=this.isInput(ct),pt=mt?this.argumentSizes[this.argumentNames.indexOf(ct)]:null;it.push(`${ut}`),lt&&st?mt?(it.push("[("),this.astGeneric(lt,it),it.push(`*${this.dynamicArguments?"(outputY * outputX)":pt[1]*pt[0]})+(`),this.astGeneric(st,it),it.push(`*${this.dynamicArguments?"outputX":pt[0]})+`),this.astGeneric(tt,it),it.push("]")):(it.push("["),this.astGeneric(lt,it),it.push("]"),it.push("["),this.astGeneric(st,it),it.push("]"),it.push("["),this.astGeneric(tt,it),it.push("]")):st?mt?(it.push("[("),this.astGeneric(st,it),it.push(`*${this.dynamicArguments?"outputX":pt[0]})+`),this.astGeneric(tt,it),it.push("]")):(it.push("["),this.astGeneric(st,it),it.push("]"),it.push("["),this.astGeneric(tt,it),it.push("]")):typeof tt<"u"&&(it.push("["),this.astGeneric(tt,it),it.push("]"))}return it}astCallExpression(nt,it){if(nt.type!=="CallExpression")throw this.astErrorOutput("Unknown CallExpression",nt);let j=this.astMemberExpressionUnroll(nt.callee);this.calledFunctions.indexOf(j)<0&&this.calledFunctions.push(j),this.isAstMathFunction(nt),this.onFunctionCall&&this.onFunctionCall(this.name,j,nt.arguments),it.push(j),it.push("(");const _=this.lookupFunctionArgumentTypes(j)||[];for(let $=0;$0&&it.push(", "),this.astGeneric(tt,it)}return it.push(")"),it}astArrayExpression(nt,it){const j=this.getType(nt),_=nt.elements.length,$=[];for(let tt=0;tt<_;++tt){const st=[];this.astGeneric(nt.elements[tt],st),$.push(st.join(""))}switch(j){case"Matrix(2)":case"Matrix(3)":case"Matrix(4)":it.push(`[${$.join(", ")}]`);break;default:it.push(`new Float32Array([${$.join(", ")}])`)}return it}astDebuggerStatement(nt,it){return it.push("debugger;"),it}}a.exports={CPUFunctionNode:ot}},{"../function-node":10}],7:[function(o,a,rt){const{utils:et}=o("../../utils");function ot(nt,it){const j=[];for(const _ in it){if(!it.hasOwnProperty(_))continue;const $=it[_],tt=nt[_];switch($){case"Number":case"Integer":case"Float":case"Boolean":j.push(`${_}:${tt}`);break;case"Array(2)":case"Array(3)":case"Array(4)":case"Matrix(2)":case"Matrix(3)":case"Matrix(4)":j.push(`${_}:new ${tt.constructor.name}(${JSON.stringify(Array.from(tt))})`);break}}return`{ ${j.join()} }`}function at(nt,it){const j=[],_=[],$=[],tt=!/^function/.test(nt.color.toString());if(j.push(" const { context, canvas, constants: incomingConstants } = settings;",` const output = new Int32Array(${JSON.stringify(Array.from(nt.output))});`,` const _constantTypes = ${JSON.stringify(nt.constantTypes)};`,` const _constants = ${ot(nt.constants,nt.constantTypes)};`),_.push(" constants: _constants,"," context,"," output,"," thread: {x: 0, y: 0, z: 0},"),nt.graphical){j.push(` const _imageData = context.createImageData(${nt.output[0]}, ${nt.output[1]});`),j.push(` const _colorData = new Uint8ClampedArray(${nt.output[0]} * ${nt.output[1]} * 4);`);const ct=et.flattenFunctionToString((tt?"function ":"")+nt.color.toString(),{thisLookup:ut=>{switch(ut){case"_colorData":return"_colorData";case"_imageData":return"_imageData";case"output":return"output";case"thread":return"this.thread"}return JSON.stringify(nt[ut])},findDependency:(ut,pt)=>null}),ht=et.flattenFunctionToString((tt?"function ":"")+nt.getPixels.toString(),{thisLookup:ut=>{switch(ut){case"_colorData":return"_colorData";case"_imageData":return"_imageData";case"output":return"output";case"thread":return"this.thread"}return JSON.stringify(nt[ut])},findDependency:()=>null});_.push(" _imageData,"," _colorData,",` color: ${ct},`),$.push(` kernel.getPixels = ${ht};`)}const st=[],lt=Object.keys(nt.constantTypes);for(let ct=0;ctht==="this"?(tt?"function ":"")+nt[ut].toString():null,thisLookup:ht=>{switch(ht){case"canvas":return;case"context":return"context"}}});$.push(ct),_.push(" _mediaTo2DArray,"),_.push(" _imageTo3DArray,")}else if(nt.argumentTypes.indexOf("HTMLImage")!==-1||st.indexOf("HTMLImage")!==-1){const ct=et.flattenFunctionToString((tt?"function ":"")+nt._mediaTo2DArray.toString(),{findDependency:(ht,ut)=>null,thisLookup:ht=>{switch(ht){case"canvas":return"settings.canvas";case"context":return"settings.context"}throw new Error("unhandled thisLookup")}});$.push(ct),_.push(" _mediaTo2DArray,")}return`function(settings) { +}`)}astThisExpression(nt,it){return it.push("_this"),it}astMemberExpression(nt,it){const{signature:j,type:_,property:$,xProperty:et,yProperty:st,zProperty:lt,name:ct,origin:ht}=this.getMemberExpressionDetails(nt);switch(j){case"this.thread.value":return it.push(`_this.thread.${ct}`),it;case"this.output.value":switch(ct){case"x":it.push("outputX");break;case"y":it.push("outputY");break;case"z":it.push("outputZ");break;default:throw this.astErrorOutput("Unexpected expression",nt)}return it;case"value":throw this.astErrorOutput("Unexpected expression",nt);case"value[]":case"value[][]":case"value[][][]":case"value.value":if(ht==="Math")return it.push(Math[ct]),it;switch($){case"r":return it.push(`user_${ct}[0]`),it;case"g":return it.push(`user_${ct}[1]`),it;case"b":return it.push(`user_${ct}[2]`),it;case"a":return it.push(`user_${ct}[3]`),it}break;case"this.constants.value":case"this.constants.value[]":case"this.constants.value[][]":case"this.constants.value[][][]":break;case"fn()[]":return this.astGeneric(nt.object,it),it.push("["),this.astGeneric(nt.property,it),it.push("]"),it;case"fn()[][]":return this.astGeneric(nt.object.object,it),it.push("["),this.astGeneric(nt.object.property,it),it.push("]"),it.push("["),this.astGeneric(nt.property,it),it.push("]"),it;default:throw this.astErrorOutput("Unexpected expression",nt)}if(!nt.computed)switch(_){case"Number":case"Integer":case"Float":case"Boolean":return it.push(`${ht}_${ct}`),it}const ut=`${ht}_${ct}`;switch(_){case"Array(2)":case"Array(3)":case"Array(4)":case"Matrix(2)":case"Matrix(3)":case"Matrix(4)":case"HTMLImageArray":case"ArrayTexture(1)":case"ArrayTexture(2)":case"ArrayTexture(3)":case"ArrayTexture(4)":case"HTMLImage":default:let pt,mt;if(ht==="constants"){const gt=this.constants[ct];mt=this.constantTypes[ct]==="Input",pt=mt?gt.size:null}else mt=this.isInput(ct),pt=mt?this.argumentSizes[this.argumentNames.indexOf(ct)]:null;it.push(`${ut}`),lt&&st?mt?(it.push("[("),this.astGeneric(lt,it),it.push(`*${this.dynamicArguments?"(outputY * outputX)":pt[1]*pt[0]})+(`),this.astGeneric(st,it),it.push(`*${this.dynamicArguments?"outputX":pt[0]})+`),this.astGeneric(et,it),it.push("]")):(it.push("["),this.astGeneric(lt,it),it.push("]"),it.push("["),this.astGeneric(st,it),it.push("]"),it.push("["),this.astGeneric(et,it),it.push("]")):st?mt?(it.push("[("),this.astGeneric(st,it),it.push(`*${this.dynamicArguments?"outputX":pt[0]})+`),this.astGeneric(et,it),it.push("]")):(it.push("["),this.astGeneric(st,it),it.push("]"),it.push("["),this.astGeneric(et,it),it.push("]")):typeof et<"u"&&(it.push("["),this.astGeneric(et,it),it.push("]"))}return it}astCallExpression(nt,it){if(nt.type!=="CallExpression")throw this.astErrorOutput("Unknown CallExpression",nt);let j=this.astMemberExpressionUnroll(nt.callee);this.calledFunctions.indexOf(j)<0&&this.calledFunctions.push(j),this.isAstMathFunction(nt),this.onFunctionCall&&this.onFunctionCall(this.name,j,nt.arguments),it.push(j),it.push("(");const _=this.lookupFunctionArgumentTypes(j)||[];for(let $=0;$0&&it.push(", "),this.astGeneric(et,it)}return it.push(")"),it}astArrayExpression(nt,it){const j=this.getType(nt),_=nt.elements.length,$=[];for(let et=0;et<_;++et){const st=[];this.astGeneric(nt.elements[et],st),$.push(st.join(""))}switch(j){case"Matrix(2)":case"Matrix(3)":case"Matrix(4)":it.push(`[${$.join(", ")}]`);break;default:it.push(`new Float32Array([${$.join(", ")}])`)}return it}astDebuggerStatement(nt,it){return it.push("debugger;"),it}}a.exports={CPUFunctionNode:ot}},{"../function-node":10}],7:[function(o,a,rt){const{utils:tt}=o("../../utils");function ot(nt,it){const j=[];for(const _ in it){if(!it.hasOwnProperty(_))continue;const $=it[_],et=nt[_];switch($){case"Number":case"Integer":case"Float":case"Boolean":j.push(`${_}:${et}`);break;case"Array(2)":case"Array(3)":case"Array(4)":case"Matrix(2)":case"Matrix(3)":case"Matrix(4)":j.push(`${_}:new ${et.constructor.name}(${JSON.stringify(Array.from(et))})`);break}}return`{ ${j.join()} }`}function at(nt,it){const j=[],_=[],$=[],et=!/^function/.test(nt.color.toString());if(j.push(" const { context, canvas, constants: incomingConstants } = settings;",` const output = new Int32Array(${JSON.stringify(Array.from(nt.output))});`,` const _constantTypes = ${JSON.stringify(nt.constantTypes)};`,` const _constants = ${ot(nt.constants,nt.constantTypes)};`),_.push(" constants: _constants,"," context,"," output,"," thread: {x: 0, y: 0, z: 0},"),nt.graphical){j.push(` const _imageData = context.createImageData(${nt.output[0]}, ${nt.output[1]});`),j.push(` const _colorData = new Uint8ClampedArray(${nt.output[0]} * ${nt.output[1]} * 4);`);const ct=tt.flattenFunctionToString((et?"function ":"")+nt.color.toString(),{thisLookup:ut=>{switch(ut){case"_colorData":return"_colorData";case"_imageData":return"_imageData";case"output":return"output";case"thread":return"this.thread"}return JSON.stringify(nt[ut])},findDependency:(ut,pt)=>null}),ht=tt.flattenFunctionToString((et?"function ":"")+nt.getPixels.toString(),{thisLookup:ut=>{switch(ut){case"_colorData":return"_colorData";case"_imageData":return"_imageData";case"output":return"output";case"thread":return"this.thread"}return JSON.stringify(nt[ut])},findDependency:()=>null});_.push(" _imageData,"," _colorData,",` color: ${ct},`),$.push(` kernel.getPixels = ${ht};`)}const st=[],lt=Object.keys(nt.constantTypes);for(let ct=0;ctht==="this"?(et?"function ":"")+nt[ut].toString():null,thisLookup:ht=>{switch(ht){case"canvas":return;case"context":return"context"}}});$.push(ct),_.push(" _mediaTo2DArray,"),_.push(" _imageTo3DArray,")}else if(nt.argumentTypes.indexOf("HTMLImage")!==-1||st.indexOf("HTMLImage")!==-1){const ct=tt.flattenFunctionToString((et?"function ":"")+nt._mediaTo2DArray.toString(),{findDependency:(ht,ut)=>null,thisLookup:ht=>{switch(ht){case"canvas":return"settings.canvas";case"context":return"settings.context"}throw new Error("unhandled thisLookup")}});$.push(ct),_.push(" _mediaTo2DArray,")}return`function(settings) { ${j.join(` `)} for (const p in _constantTypes) { @@ -1877,9 +1877,9 @@ ${nt._kernelString} ${$.join(` `)} return kernel; -}`}a.exports={cpuKernelString:at}},{"../../utils":114}],8:[function(o,a,rt){const{Kernel:et}=o("../kernel"),{FunctionBuilder:ot}=o("../function-builder"),{CPUFunctionNode:at}=o("./function-node"),{utils:nt}=o("../../utils"),{cpuKernelString:it}=o("./kernel-string");class j extends et{static getFeatures(){return this.features}static get features(){return Object.freeze({kernelMap:!0,isIntegerDivisionAccurate:!0})}static get isSupported(){return!0}static isContextMatch($){return!1}static get mode(){return"cpu"}static nativeFunctionArguments(){return null}static nativeFunctionReturnType(){throw new Error(`Looking up native function return type not supported on ${this.name}`)}static combineKernels($){return $}static getSignature($,tt){return"cpu"+(tt.length>0?":"+tt.join(","):"")}constructor($,tt){super($,tt),this.mergeSettings($.settings||tt),this._imageData=null,this._colorData=null,this._kernelString=null,this._prependedString=[],this.thread={x:0,y:0,z:0},this.translatedSources=null}initCanvas(){if(typeof document<"u")return document.createElement("canvas");if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(0,0)}initContext(){return this.canvas?this.canvas.getContext("2d"):null}initPlugins($){return[]}validateSettings($){if(!this.output||this.output.length===0){if($.length!==1)throw new Error("Auto output only supported for kernels with only one input");const tt=nt.getVariableType($[0],this.strictIntegers);if(tt==="Array")this.output=nt.getDimensions(tt);else if(tt==="NumberTexture"||tt==="ArrayTexture(4)")this.output=$[0].output;else throw new Error("Auto output not supported for input type: "+tt)}if(this.graphical&&this.output.length!==2)throw new Error("Output must have 2 dimensions on graphical mode");this.checkOutput()}translateSource(){if(this.leadingReturnStatement=this.output.length>1?"resultX[x] = ":"result[x] = ",this.subKernels){const tt=[];for(let st=0;st1?`resultX_${lt}[x] = subKernelResult_${lt}; +}`}a.exports={cpuKernelString:at}},{"../../utils":114}],8:[function(o,a,rt){const{Kernel:tt}=o("../kernel"),{FunctionBuilder:ot}=o("../function-builder"),{CPUFunctionNode:at}=o("./function-node"),{utils:nt}=o("../../utils"),{cpuKernelString:it}=o("./kernel-string");class j extends tt{static getFeatures(){return this.features}static get features(){return Object.freeze({kernelMap:!0,isIntegerDivisionAccurate:!0})}static get isSupported(){return!0}static isContextMatch($){return!1}static get mode(){return"cpu"}static nativeFunctionArguments(){return null}static nativeFunctionReturnType(){throw new Error(`Looking up native function return type not supported on ${this.name}`)}static combineKernels($){return $}static getSignature($,et){return"cpu"+(et.length>0?":"+et.join(","):"")}constructor($,et){super($,et),this.mergeSettings($.settings||et),this._imageData=null,this._colorData=null,this._kernelString=null,this._prependedString=[],this.thread={x:0,y:0,z:0},this.translatedSources=null}initCanvas(){if(typeof document<"u")return document.createElement("canvas");if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(0,0)}initContext(){return this.canvas?this.canvas.getContext("2d"):null}initPlugins($){return[]}validateSettings($){if(!this.output||this.output.length===0){if($.length!==1)throw new Error("Auto output only supported for kernels with only one input");const et=nt.getVariableType($[0],this.strictIntegers);if(et==="Array")this.output=nt.getDimensions(et);else if(et==="NumberTexture"||et==="ArrayTexture(4)")this.output=$[0].output;else throw new Error("Auto output not supported for input type: "+et)}if(this.graphical&&this.output.length!==2)throw new Error("Output must have 2 dimensions on graphical mode");this.checkOutput()}translateSource(){if(this.leadingReturnStatement=this.output.length>1?"resultX[x] = ":"result[x] = ",this.subKernels){const et=[];for(let st=0;st1?`resultX_${lt}[x] = subKernelResult_${lt}; `:`result_${lt}[x] = subKernelResult_${lt}; -`)}this.followingReturnStatement=tt.join("")}const $=ot.fromKernel(this,at);this.translatedSources=$.getPrototypes("kernel"),!this.graphical&&!this.returnType&&(this.returnType=$.getKernelResultType())}build(){if(this.built)return;if(this.setupConstants(),this.setupArguments(arguments),this.validateSettings(arguments),this.translateSource(),this.graphical){const{canvas:tt,output:st}=this;if(!tt)throw new Error("no canvas available for using graphical output");const lt=st[0],ct=st[1]||1;tt.width=lt,tt.height=ct,this._imageData=this.context.createImageData(lt,ct),this._colorData=new Uint8ClampedArray(lt*ct*4)}const $=this.getKernelString();this.kernelString=$,this.debug&&(console.log("Function output:"),console.log($));try{this.run=new Function([],$).bind(this)()}catch(tt){console.error("An error occurred compiling the javascript: ",tt)}this.buildSignature(arguments),this.built=!0}color($,tt,st,lt){typeof lt>"u"&&(lt=1),$=Math.floor($*255),tt=Math.floor(tt*255),st=Math.floor(st*255),lt=Math.floor(lt*255);const ct=this.output[0],ht=this.output[1],ut=this.thread.x,pt=ht-this.thread.y-1,mt=ut+pt*ct;this._colorData[mt*4+0]=$,this._colorData[mt*4+1]=tt,this._colorData[mt*4+2]=st,this._colorData[mt*4+3]=lt}getKernelString(){if(this._kernelString!==null)return this._kernelString;let $=null,{translatedSources:tt}=this;return tt.length>1?tt=tt.filter(st=>/^function/.test(st)?st:($=st,!1)):$=tt.shift(),this._kernelString=` const LOOP_MAX = ${this._getLoopMaxString()}; +`)}this.followingReturnStatement=et.join("")}const $=ot.fromKernel(this,at);this.translatedSources=$.getPrototypes("kernel"),!this.graphical&&!this.returnType&&(this.returnType=$.getKernelResultType())}build(){if(this.built)return;if(this.setupConstants(),this.setupArguments(arguments),this.validateSettings(arguments),this.translateSource(),this.graphical){const{canvas:et,output:st}=this;if(!et)throw new Error("no canvas available for using graphical output");const lt=st[0],ct=st[1]||1;et.width=lt,et.height=ct,this._imageData=this.context.createImageData(lt,ct),this._colorData=new Uint8ClampedArray(lt*ct*4)}const $=this.getKernelString();this.kernelString=$,this.debug&&(console.log("Function output:"),console.log($));try{this.run=new Function([],$).bind(this)()}catch(et){console.error("An error occurred compiling the javascript: ",et)}this.buildSignature(arguments),this.built=!0}color($,et,st,lt){typeof lt>"u"&&(lt=1),$=Math.floor($*255),et=Math.floor(et*255),st=Math.floor(st*255),lt=Math.floor(lt*255);const ct=this.output[0],ht=this.output[1],ut=this.thread.x,pt=ht-this.thread.y-1,mt=ut+pt*ct;this._colorData[mt*4+0]=$,this._colorData[mt*4+1]=et,this._colorData[mt*4+2]=st,this._colorData[mt*4+3]=lt}getKernelString(){if(this._kernelString!==null)return this._kernelString;let $=null,{translatedSources:et}=this;return et.length>1?et=et.filter(st=>/^function/.test(st)?st:($=st,!1)):$=et.shift(),this._kernelString=` const LOOP_MAX = ${this._getLoopMaxString()}; ${this.injectedNative||""} const _this = this; ${this._resultKernelHeader()} @@ -1889,13 +1889,13 @@ ${nt._kernelString} ${this._earlyThrows()} ${this._processArguments()} ${this.graphical?this._graphicalKernelBody($):this._resultKernelBody($)} - ${tt.length>0?tt.join(` + ${et.length>0?et.join(` `):""} - };`}toString(){return it(this)}_getLoopMaxString(){return this.loopMaxIterations?` ${parseInt(this.loopMaxIterations)};`:" 1000;"}_processConstants(){if(!this.constants)return"";const $=[];for(let tt in this.constants)switch(this.constantTypes[tt]){case"HTMLCanvas":case"OffscreenCanvas":case"HTMLImage":case"ImageBitmap":case"ImageData":case"HTMLVideo":$.push(` const constants_${tt} = this._mediaTo2DArray(this.constants.${tt}); -`);break;case"HTMLImageArray":$.push(` const constants_${tt} = this._imageTo3DArray(this.constants.${tt}); -`);break;case"Input":$.push(` const constants_${tt} = this.constants.${tt}.value; -`);break;default:$.push(` const constants_${tt} = this.constants.${tt}; -`)}return $.join("")}_earlyThrows(){if(this.graphical||this.immutable||!this.pipeline)return"";const $=[];for(let st=0;st`user_${lt} === result_${ht.name}`).join(" || ");tt.push(`user_${lt} === result${ct?` || ${ct}`:""}`)}return`if (${tt.join(" || ")}) throw new Error('Source and destination arrays are the same. Use immutable = true');`}_processArguments(){const $=[];for(let tt=0;tt`user_${lt} === result_${ht.name}`).join(" || ");et.push(`user_${lt} === result${ct?` || ${ct}`:""}`)}return`if (${et.join(" || ")}) throw new Error('Source and destination arrays are the same. Use immutable = true');`}_processArguments(){const $=[];for(let et=0;et0?$.width:$.videoWidth,lt=$.height>0?$.height:$.videoHeight;tt.width=0;mt--){const gt=ut[mt]=new Array(st);for(let dt=0;dt0?$.width:$.videoWidth,lt=$.height>0?$.height:$.videoHeight;et.width=0;mt--){const gt=ut[mt]=new Array(st);for(let dt=0;dt`const result_${st.name} = new ${tt}(outputX); + return;`}_getKernelResultTypeConstructorString(){switch(this.returnType){case"LiteralInteger":case"Number":case"Integer":case"Float":return"Float32Array";case"Array(2)":case"Array(3)":case"Array(4)":return"Array";default:if(this.graphical)return"Float32Array";throw new Error(`unhandled returnType ${this.returnType}`)}}_resultImmutableKernel1DLoop($){const et=this._getKernelResultTypeConstructorString();return` const outputX = _this.output[0]; + const result = new ${et}(outputX); + ${this._mapSubKernels(st=>`const result_${st.name} = new ${et}(outputX); `).join(" ")} ${this._mapSubKernels(st=>`let subKernelResult_${st.name}; `).join(" ")} @@ -1928,16 +1928,16 @@ ${nt._kernelString} ${$} }`}_mutableKernel1DResults(){const $=this._getKernelResultTypeConstructorString();return` const outputX = _this.output[0]; const result = new ${$}(outputX); - ${this._mapSubKernels(tt=>`const result_${tt.name} = new ${$}(outputX); + ${this._mapSubKernels(et=>`const result_${et.name} = new ${$}(outputX); `).join(" ")} - ${this._mapSubKernels(tt=>`let subKernelResult_${tt.name}; + ${this._mapSubKernels(et=>`let subKernelResult_${et.name}; `).join(" ")}`}_resultMutableKernel1DLoop($){return` const outputX = _this.output[0]; for (let x = 0; x < outputX; x++) { this.thread.x = x; this.thread.y = 0; this.thread.z = 0; ${$} - }`}_resultImmutableKernel2DLoop($){const tt=this._getKernelResultTypeConstructorString();return` const outputX = _this.output[0]; + }`}_resultImmutableKernel2DLoop($){const et=this._getKernelResultTypeConstructorString();return` const outputX = _this.output[0]; const outputY = _this.output[1]; const result = new Array(outputY); ${this._mapSubKernels(st=>`const result_${st.name} = new Array(outputY); @@ -1947,8 +1947,8 @@ ${nt._kernelString} for (let y = 0; y < outputY; y++) { this.thread.z = 0; this.thread.y = y; - const resultX = result[y] = new ${tt}(outputX); - ${this._mapSubKernels(st=>`const resultX_${st.name} = result_${st.name}[y] = new ${tt}(outputX); + const resultX = result[y] = new ${et}(outputX); + ${this._mapSubKernels(st=>`const resultX_${st.name} = result_${st.name}[y] = new ${et}(outputX); `).join("")} for (let x = 0; x < outputX; x++) { this.thread.x = x; @@ -1957,21 +1957,21 @@ ${nt._kernelString} }`}_mutableKernel2DResults(){const $=this._getKernelResultTypeConstructorString();return` const outputX = _this.output[0]; const outputY = _this.output[1]; const result = new Array(outputY); - ${this._mapSubKernels(tt=>`const result_${tt.name} = new Array(outputY); + ${this._mapSubKernels(et=>`const result_${et.name} = new Array(outputY); `).join(" ")} - ${this._mapSubKernels(tt=>`let subKernelResult_${tt.name}; + ${this._mapSubKernels(et=>`let subKernelResult_${et.name}; `).join(" ")} for (let y = 0; y < outputY; y++) { const resultX = result[y] = new ${$}(outputX); - ${this._mapSubKernels(tt=>`const resultX_${tt.name} = result_${tt.name}[y] = new ${$}(outputX); + ${this._mapSubKernels(et=>`const resultX_${et.name} = result_${et.name}[y] = new ${$}(outputX); `).join("")} - }`}_resultMutableKernel2DLoop($){const tt=this._getKernelResultTypeConstructorString();return` const outputX = _this.output[0]; + }`}_resultMutableKernel2DLoop($){const et=this._getKernelResultTypeConstructorString();return` const outputX = _this.output[0]; const outputY = _this.output[1]; for (let y = 0; y < outputY; y++) { this.thread.z = 0; this.thread.y = y; const resultX = result[y]; - ${this._mapSubKernels(st=>`const resultX_${st.name} = result_${st.name}[y] = new ${tt}(outputX); + ${this._mapSubKernels(st=>`const resultX_${st.name} = result_${st.name}[y] = new ${et}(outputX); `).join("")} for (let x = 0; x < outputX; x++) { this.thread.x = x; @@ -1986,7 +1986,7 @@ ${nt._kernelString} this.thread.x = x; ${$} } - }`}_resultImmutableKernel3DLoop($){const tt=this._getKernelResultTypeConstructorString();return` const outputX = _this.output[0]; + }`}_resultImmutableKernel3DLoop($){const et=this._getKernelResultTypeConstructorString();return` const outputX = _this.output[0]; const outputY = _this.output[1]; const outputZ = _this.output[2]; const result = new Array(outputZ); @@ -2001,8 +2001,8 @@ ${nt._kernelString} `).join(" ")} for (let y = 0; y < outputY; y++) { this.thread.y = y; - const resultX = resultY[y] = new ${tt}(outputX); - ${this._mapSubKernels(st=>`const resultX_${st.name} = resultY_${st.name}[y] = new ${tt}(outputX); + const resultX = resultY[y] = new ${et}(outputX); + ${this._mapSubKernels(st=>`const resultX_${st.name} = resultY_${st.name}[y] = new ${et}(outputX); `).join(" ")} for (let x = 0; x < outputX; x++) { this.thread.x = x; @@ -2013,17 +2013,17 @@ ${nt._kernelString} const outputY = _this.output[1]; const outputZ = _this.output[2]; const result = new Array(outputZ); - ${this._mapSubKernels(tt=>`const result_${tt.name} = new Array(outputZ); + ${this._mapSubKernels(et=>`const result_${et.name} = new Array(outputZ); `).join(" ")} - ${this._mapSubKernels(tt=>`let subKernelResult_${tt.name}; + ${this._mapSubKernels(et=>`let subKernelResult_${et.name}; `).join(" ")} for (let z = 0; z < outputZ; z++) { const resultY = result[z] = new Array(outputY); - ${this._mapSubKernels(tt=>`const resultY_${tt.name} = result_${tt.name}[z] = new Array(outputY); + ${this._mapSubKernels(et=>`const resultY_${et.name} = result_${et.name}[z] = new Array(outputY); `).join(" ")} for (let y = 0; y < outputY; y++) { const resultX = resultY[y] = new ${$}(outputX); - ${this._mapSubKernels(tt=>`const resultX_${tt.name} = resultY_${tt.name}[y] = new ${$}(outputX); + ${this._mapSubKernels(et=>`const resultX_${et.name} = resultY_${et.name}[y] = new ${$}(outputX); `).join(" ")} } }`}_resultMutableKernel3DLoop($){return` const outputX = _this.output[0]; @@ -2046,11 +2046,11 @@ ${nt._kernelString} ${this.subKernels.map($=>`${$.property}: result_${$.name}`).join(`, `)} };`:` - return result;`}_mapSubKernels($){return this.subKernels===null?[""]:this.subKernels.map($)}destroy($){$&&delete this.canvas}static destroyContext($){}toJSON(){const $=super.toJSON();return $.functionNodes=ot.fromKernel(this,at).toJSON(),$}setOutput($){super.setOutput($);const[tt,st]=this.output;this.graphical&&(this._imageData=this.context.createImageData(tt,st),this._colorData=new Uint8ClampedArray(tt*st*4))}prependString($){if(this._kernelString)throw new Error("Kernel already built");this._prependedString.push($)}hasPrependString($){return this._prependedString.indexOf($)>-1}}a.exports={CPUKernel:j}},{"../../utils":114,"../function-builder":9,"../kernel":36,"./function-node":6,"./kernel-string":7}],9:[function(o,a,rt){class et{static fromKernel(at,nt,it){const{kernelArguments:j,kernelConstants:_,argumentNames:$,argumentSizes:tt,argumentBitRatios:st,constants:lt,constantBitRatios:ct,debug:ht,loopMaxIterations:ut,nativeFunctions:pt,output:mt,optimizeFloatMemory:gt,precision:dt,plugins:St,source:xt,subKernels:yt,functions:_t,leadingReturnStatement:Ct,followingReturnStatement:Et,dynamicArguments:kt,dynamicOutput:Tt}=at,$t=new Array(j.length),It={};for(let Qt=0;Qtrr.needsArgumentType(Qt,xr),Mt=(Qt,xr,Sr)=>{rr.assignArgumentType(Qt,xr,Sr)},Dt=(Qt,xr,Sr)=>rr.lookupReturnType(Qt,xr,Sr),Bt=Qt=>rr.lookupFunctionArgumentTypes(Qt),Kt=(Qt,xr)=>rr.lookupFunctionArgumentName(Qt,xr),Wt=(Qt,xr)=>rr.lookupFunctionArgumentBitRatio(Qt,xr),zt=(Qt,xr,Sr,dr)=>{rr.assignArgumentType(Qt,xr,Sr,dr)},Ht=(Qt,xr,Sr,dr)=>{rr.assignArgumentBitRatio(Qt,xr,Sr,dr)},Zt=(Qt,xr,Sr)=>{rr.trackFunctionCall(Qt,xr,Sr)},qt=(Qt,xr)=>{const Sr=[];for(let Ur=0;Urnew nt(Qt.source,{returnType:Qt.returnType,argumentTypes:Qt.argumentTypes,output:mt,plugins:St,constants:lt,constantTypes:It,constantBitRatios:ct,optimizeFloatMemory:gt,precision:dt,lookupReturnType:Dt,lookupFunctionArgumentTypes:Bt,lookupFunctionArgumentName:Kt,lookupFunctionArgumentBitRatio:Wt,needsArgumentType:Ot,assignArgumentType:Mt,triggerImplyArgumentType:zt,triggerImplyArgumentBitRatio:Ht,onFunctionCall:Zt,onNestedFunction:qt})));let tr=null;yt&&(tr=yt.map(Qt=>{const{name:xr,source:Sr}=Qt;return new nt(Sr,Object.assign({},hr,{name:xr,isSubKernel:!0,isRootKernel:!1}))}));const rr=new et({kernel:at,rootNode:mr,functionNodes:gr,nativeFunctions:pt,subKernelNodes:tr});return rr}constructor(at){if(at=at||{},this.kernel=at.kernel,this.rootNode=at.rootNode,this.functionNodes=at.functionNodes||[],this.subKernelNodes=at.subKernelNodes||[],this.nativeFunctions=at.nativeFunctions||[],this.functionMap={},this.nativeFunctionNames=[],this.lookupChain=[],this.functionNodeDependencies={},this.functionCalls={},this.rootNode&&(this.functionMap.kernel=this.rootNode),this.functionNodes)for(let nt=0;nt-1){const j=nt.indexOf(at);if(j===-1)nt.push(at);else{const _=nt.splice(j,1)[0];nt.push(_)}return nt}const it=this.functionMap[at];if(it){const j=nt.indexOf(at);if(j===-1){nt.push(at),it.toString();for(let _=0;_-1}}a.exports={CPUKernel:j}},{"../../utils":114,"../function-builder":9,"../kernel":36,"./function-node":6,"./kernel-string":7}],9:[function(o,a,rt){class tt{static fromKernel(at,nt,it){const{kernelArguments:j,kernelConstants:_,argumentNames:$,argumentSizes:et,argumentBitRatios:st,constants:lt,constantBitRatios:ct,debug:ht,loopMaxIterations:ut,nativeFunctions:pt,output:mt,optimizeFloatMemory:gt,precision:dt,plugins:St,source:xt,subKernels:yt,functions:_t,leadingReturnStatement:Ct,followingReturnStatement:Et,dynamicArguments:kt,dynamicOutput:Tt}=at,$t=new Array(j.length),It={};for(let Qt=0;Qtrr.needsArgumentType(Qt,xr),Mt=(Qt,xr,Sr)=>{rr.assignArgumentType(Qt,xr,Sr)},Dt=(Qt,xr,Sr)=>rr.lookupReturnType(Qt,xr,Sr),Bt=Qt=>rr.lookupFunctionArgumentTypes(Qt),Kt=(Qt,xr)=>rr.lookupFunctionArgumentName(Qt,xr),Wt=(Qt,xr)=>rr.lookupFunctionArgumentBitRatio(Qt,xr),zt=(Qt,xr,Sr,dr)=>{rr.assignArgumentType(Qt,xr,Sr,dr)},Ht=(Qt,xr,Sr,dr)=>{rr.assignArgumentBitRatio(Qt,xr,Sr,dr)},Zt=(Qt,xr,Sr)=>{rr.trackFunctionCall(Qt,xr,Sr)},qt=(Qt,xr)=>{const Sr=[];for(let Ur=0;Urnew nt(Qt.source,{returnType:Qt.returnType,argumentTypes:Qt.argumentTypes,output:mt,plugins:St,constants:lt,constantTypes:It,constantBitRatios:ct,optimizeFloatMemory:gt,precision:dt,lookupReturnType:Dt,lookupFunctionArgumentTypes:Bt,lookupFunctionArgumentName:Kt,lookupFunctionArgumentBitRatio:Wt,needsArgumentType:Ot,assignArgumentType:Mt,triggerImplyArgumentType:zt,triggerImplyArgumentBitRatio:Ht,onFunctionCall:Zt,onNestedFunction:qt})));let tr=null;yt&&(tr=yt.map(Qt=>{const{name:xr,source:Sr}=Qt;return new nt(Sr,Object.assign({},hr,{name:xr,isSubKernel:!0,isRootKernel:!1}))}));const rr=new tt({kernel:at,rootNode:mr,functionNodes:gr,nativeFunctions:pt,subKernelNodes:tr});return rr}constructor(at){if(at=at||{},this.kernel=at.kernel,this.rootNode=at.rootNode,this.functionNodes=at.functionNodes||[],this.subKernelNodes=at.subKernelNodes||[],this.nativeFunctions=at.nativeFunctions||[],this.functionMap={},this.nativeFunctionNames=[],this.lookupChain=[],this.functionNodeDependencies={},this.functionCalls={},this.rootNode&&(this.functionMap.kernel=this.rootNode),this.functionNodes)for(let nt=0;nt-1){const j=nt.indexOf(at);if(j===-1)nt.push(at);else{const _=nt.splice(j,1)[0];nt.push(_)}return nt}const it=this.functionMap[at];if(it){const j=nt.indexOf(at);if(j===-1){nt.push(at),it.toString();for(let _=0;_-1){nt.push(this.nativeFunctions[_].source);continue}const $=this.functionMap[j];$&&nt.push($.toString())}return nt}toJSON(){return this.traceFunctionCalls(this.rootNode.name).reverse().map(at=>{const nt=this.nativeFunctions.indexOf(at);if(nt>-1)return{name:at,source:this.nativeFunctions[nt].source};if(this.functionMap[at])return this.functionMap[at].toJSON();throw new Error(`function ${at} not found`)})}fromJSON(at,nt){this.functionMap={};for(let it=0;it0){const tt=nt.arguments;for(let st=0;st0&&this.argumentTypes.length!==this.argumentNames.length)throw new Error(`argumentTypes count of ${this.argumentTypes.length} exceeds ${this.argumentNames.length}`);if(this.output.length<1)throw new Error("this.output is not big enough")}isIdentifierConstant(_){return this.constants?this.constants.hasOwnProperty(_):!1}isInput(_){return this.argumentTypes[this.argumentNames.indexOf(_)]==="Input"}pushState(_){this.states.push(_)}popState(_){if(this.state!==_)throw new Error(`Cannot popState ${_} when in ${this.state}`);this.states.pop()}isState(_){return this.state===_}get state(){return this.states[this.states.length-1]}astMemberExpressionUnroll(_){if(_.type==="Identifier")return _.name;if(_.type==="ThisExpression")return"this";if(_.type==="MemberExpression"&&_.object&&_.property)return _.object.hasOwnProperty("name")&&_.object.name!=="Math"?this.astMemberExpressionUnroll(_.property):this.astMemberExpressionUnroll(_.object)+"."+this.astMemberExpressionUnroll(_.property);if(_.hasOwnProperty("expressions")){const $=_.expressions[0];if($.type==="Literal"&&$.value===0&&_.expressions.length===2)return this.astMemberExpressionUnroll(_.expressions[1])}throw this.astErrorOutput("Unknown astMemberExpressionUnroll",_)}getJsAST(_){if(this.ast)return this.ast;if(typeof this.source=="object")return this.traceFunctionAST(this.source),this.ast=this.source;if(_=_||et,_===null)throw new Error("Missing JS to AST parser");const $=Object.freeze(_.parse(`const parser_${this.name} = ${this.source};`,{locations:!0})),tt=$.body[0].declarations[0].init;if(this.traceFunctionAST(tt),!$)throw new Error("Failed to parse JS code");return this.ast=tt}traceFunctionAST(_){const{contexts:$,declarations:tt,functions:st,identifiers:lt,functionCalls:ct}=new at(_);this.contexts=$,this.identifiers=lt,this.functionCalls=ct,this.functions=st;for(let ht=0;ht":case"<":return"Boolean";case"&":case"|":case"^":case"<<":case">>":case">>>":return"Integer"}const st=this.getType(_.left);if(this.isState("skip-literal-correction"))return st;if(st==="LiteralInteger"){const ut=this.getType(_.right);return ut==="LiteralInteger"?_.left.value%1===0?"Integer":"Float":ut}return it[st]||st;case"UpdateExpression":return this.getType(_.argument);case"UnaryExpression":return _.operator==="~"?"Integer":this.getType(_.argument);case"VariableDeclaration":{const ut=_.declarations;let pt;for(let mt=0;mt-1}isAstMathFunction(_){const $=["abs","acos","acosh","asin","asinh","atan","atan2","atanh","cbrt","ceil","clz32","cos","cosh","expm1","exp","floor","fround","imul","log","log2","log10","log1p","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc"];return _.type==="CallExpression"&&_.callee&&_.callee.type==="MemberExpression"&&_.callee.object&&_.callee.object.type==="Identifier"&&_.callee.object.name==="Math"&&_.callee.property&&_.callee.property.type==="Identifier"&&$.indexOf(_.callee.property.name)>-1}isAstVariable(_){return _.type==="Identifier"||_.type==="MemberExpression"}isSafe(_){return this.isSafeDependencies(this.getDependencies(_))}isSafeDependencies(_){return _&&_.every?_.every($=>$.isSafe):!0}getDependencies(_,$,tt){if($||($=[]),!_)return null;if(Array.isArray(_)){for(let st=0;st<_.length;st++)this.getDependencies(_[st],$,tt);return $}switch(_.type){case"AssignmentExpression":return this.getDependencies(_.left,$,tt),this.getDependencies(_.right,$,tt),$;case"ConditionalExpression":return this.getDependencies(_.test,$,tt),this.getDependencies(_.alternate,$,tt),this.getDependencies(_.consequent,$,tt),$;case"Literal":$.push({origin:"literal",value:_.value,isSafe:tt===!0?!1:_.value>-1/0&&_.value<1/0&&!isNaN(_.value)});break;case"VariableDeclarator":return this.getDependencies(_.init,$,tt);case"Identifier":const st=this.getDeclaration(_);if(st)$.push({name:_.name,origin:"declaration",isSafe:tt?!1:this.isSafeDependencies(st.dependencies)});else if(this.argumentNames.indexOf(_.name)>-1)$.push({name:_.name,origin:"argument",isSafe:!1});else if(this.strictTypingChecking)throw new Error(`Cannot find identifier origin "${_.name}"`);break;case"FunctionDeclaration":return this.getDependencies(_.body.body[_.body.body.length-1],$,tt);case"ReturnStatement":return this.getDependencies(_.argument,$);case"BinaryExpression":case"LogicalExpression":return tt=_.operator==="/"||_.operator==="*",this.getDependencies(_.left,$,tt),this.getDependencies(_.right,$,tt),$;case"UnaryExpression":case"UpdateExpression":return this.getDependencies(_.argument,$,tt);case"VariableDeclaration":return this.getDependencies(_.declarations,$,tt);case"ArrayExpression":return $.push({origin:"declaration",isSafe:!0}),$;case"CallExpression":return $.push({origin:"function",isSafe:!0}),$;case"MemberExpression":const lt=this.getMemberExpressionDetails(_);switch(lt.signature){case"value[]":this.getDependencies(_.object,$,tt);break;case"value[][]":this.getDependencies(_.object.object,$,tt);break;case"value[][][]":this.getDependencies(_.object.object.object,$,tt);break;case"this.output.value":this.dynamicOutput&&$.push({name:lt.name,origin:"output",isSafe:!1});break}if(lt)return lt.property&&this.getDependencies(lt.property,$,tt),lt.xProperty&&this.getDependencies(lt.xProperty,$,tt),lt.yProperty&&this.getDependencies(lt.yProperty,$,tt),lt.zProperty&&this.getDependencies(lt.zProperty,$,tt),$;case"SequenceExpression":return this.getDependencies(_.expressions,$,tt);default:throw this.astErrorOutput(`Unhandled type ${_.type} in getDependencies`,_)}return $}getVariableSignature(_,$){if(!this.isAstVariable(_))throw new Error(`ast of type "${_.type}" is not a variable signature`);if(_.type==="Identifier")return"value";const tt=[];for(;_;)_.computed?tt.push("[]"):_.type==="ThisExpression"?tt.unshift("this"):_.property&&_.property.name?_.property.name==="x"||_.property.name==="y"||_.property.name==="z"?tt.unshift($?"."+_.property.name:".value"):_.property.name==="constants"||_.property.name==="thread"||_.property.name==="output"?tt.unshift("."+_.property.name):tt.unshift($?"."+_.property.name:".value"):_.name?tt.unshift($?_.name:"value"):_.callee&&_.callee.name?tt.unshift($?_.callee.name+"()":"fn()"):_.elements?tt.unshift("[]"):tt.unshift("unknown"),_=_.object;const st=tt.join("");return $||["value","value[]","value[][]","value[][][]","value[][][][]","value.value","value.thread.value","this.thread.value","this.output.value","this.constants.value","this.constants.value[]","this.constants.value[][]","this.constants.value[][][]","this.constants.value[][][][]","fn()[]","fn()[][]","fn()[][][]","[][]"].indexOf(st)>-1?st:null}build(){return this.toString().length>0}astGeneric(_,$){if(_===null)throw this.astErrorOutput("NULL ast",_);if(Array.isArray(_)){for(let tt=0;tt<_.length;tt++)this.astGeneric(_[tt],$);return $}switch(_.type){case"FunctionDeclaration":return this.astFunctionDeclaration(_,$);case"FunctionExpression":return this.astFunctionExpression(_,$);case"ReturnStatement":return this.astReturnStatement(_,$);case"Literal":return this.astLiteral(_,$);case"BinaryExpression":return this.astBinaryExpression(_,$);case"Identifier":return this.astIdentifierExpression(_,$);case"AssignmentExpression":return this.astAssignmentExpression(_,$);case"ExpressionStatement":return this.astExpressionStatement(_,$);case"EmptyStatement":return this.astEmptyStatement(_,$);case"BlockStatement":return this.astBlockStatement(_,$);case"IfStatement":return this.astIfStatement(_,$);case"SwitchStatement":return this.astSwitchStatement(_,$);case"BreakStatement":return this.astBreakStatement(_,$);case"ContinueStatement":return this.astContinueStatement(_,$);case"ForStatement":return this.astForStatement(_,$);case"WhileStatement":return this.astWhileStatement(_,$);case"DoWhileStatement":return this.astDoWhileStatement(_,$);case"VariableDeclaration":return this.astVariableDeclaration(_,$);case"VariableDeclarator":return this.astVariableDeclarator(_,$);case"ThisExpression":return this.astThisExpression(_,$);case"SequenceExpression":return this.astSequenceExpression(_,$);case"UnaryExpression":return this.astUnaryExpression(_,$);case"UpdateExpression":return this.astUpdateExpression(_,$);case"LogicalExpression":return this.astLogicalExpression(_,$);case"MemberExpression":return this.astMemberExpression(_,$);case"CallExpression":return this.astCallExpression(_,$);case"ArrayExpression":return this.astArrayExpression(_,$);case"DebuggerStatement":return this.astDebuggerStatement(_,$);case"ConditionalExpression":return this.astConditionalExpression(_,$)}throw this.astErrorOutput("Unknown ast type : "+_.type,_)}astErrorOutput(_,$){if(typeof this.source!="string")return new Error(_);const tt=ot.getAstString(this.source,$),lt=this.source.substr($.start).split(/\n/),ct=lt.length>0?lt[lt.length-1]:0;return new Error(`${_} on line ${lt.length}, position ${ct.length}: - ${tt}`)}astDebuggerStatement(_,$){return $}astConditionalExpression(_,$){if(_.type!=="ConditionalExpression")throw this.astErrorOutput("Not a conditional expression",_);return $.push("("),this.astGeneric(_.test,$),$.push("?"),this.astGeneric(_.consequent,$),$.push(":"),this.astGeneric(_.alternate,$),$.push(")"),$}astFunction(_,$){throw new Error(`"astFunction" not defined on ${this.constructor.name}`)}astFunctionDeclaration(_,$){return this.isChildFunction(_)?$:this.astFunction(_,$)}astFunctionExpression(_,$){return this.isChildFunction(_)?$:this.astFunction(_,$)}isChildFunction(_){for(let $=0;$1?$.push("(",st.join(","),")"):$.push(st[0]),$}astUnaryExpression(_,$){return this.checkAndUpconvertBitwiseUnary(_,$)||(_.prefix?($.push(_.operator),this.astGeneric(_.argument,$)):(this.astGeneric(_.argument,$),$.push(_.operator))),$}checkAndUpconvertBitwiseUnary(_,$){}astUpdateExpression(_,$){return _.prefix?($.push(_.operator),this.astGeneric(_.argument,$)):(this.astGeneric(_.argument,$),$.push(_.operator)),$}astLogicalExpression(_,$){return $.push("("),this.astGeneric(_.left,$),$.push(_.operator),this.astGeneric(_.right,$),$.push(")"),$}astMemberExpression(_,$){return $}astCallExpression(_,$){return $}astArrayExpression(_,$){return $}getMemberExpressionDetails(_){if(_.type!=="MemberExpression")throw this.astErrorOutput(`Expression ${_.type} not a MemberExpression`,_);let $=null,tt=null;const st=this.getVariableSignature(_);switch(st){case"value":return null;case"value.thread.value":case"this.thread.value":case"this.output.value":return{signature:st,type:"Integer",name:_.property.name};case"value[]":if(typeof _.object.name!="string")throw this.astErrorOutput("Unexpected expression",_);return $=_.object.name,{name:$,origin:"user",signature:st,type:this.getVariableType(_.object),xProperty:_.property};case"value[][]":if(typeof _.object.object.name!="string")throw this.astErrorOutput("Unexpected expression",_);return $=_.object.object.name,{name:$,origin:"user",signature:st,type:this.getVariableType(_.object.object),yProperty:_.object.property,xProperty:_.property};case"value[][][]":if(typeof _.object.object.object.name!="string")throw this.astErrorOutput("Unexpected expression",_);return $=_.object.object.object.name,{name:$,origin:"user",signature:st,type:this.getVariableType(_.object.object.object),zProperty:_.object.object.property,yProperty:_.object.property,xProperty:_.property};case"value[][][][]":if(typeof _.object.object.object.object.name!="string")throw this.astErrorOutput("Unexpected expression",_);return $=_.object.object.object.object.name,{name:$,origin:"user",signature:st,type:this.getVariableType(_.object.object.object.object),zProperty:_.object.object.property,yProperty:_.object.property,xProperty:_.property};case"value.value":if(typeof _.property.name!="string")throw this.astErrorOutput("Unexpected expression",_);if(this.isAstMathVariable(_))return $=_.property.name,{name:$,origin:"Math",type:"Number",signature:st};switch(_.property.name){case"r":case"g":case"b":case"a":return $=_.object.name,{name:$,property:_.property.name,origin:"user",signature:st,type:"Number"};default:throw this.astErrorOutput("Unexpected expression",_)}case"this.constants.value":if(typeof _.property.name!="string")throw this.astErrorOutput("Unexpected expression",_);if($=_.property.name,tt=this.getConstantType($),!tt)throw this.astErrorOutput("Constant has no type",_);return{name:$,type:tt,origin:"constants",signature:st};case"this.constants.value[]":if(typeof _.object.property.name!="string")throw this.astErrorOutput("Unexpected expression",_);if($=_.object.property.name,tt=this.getConstantType($),!tt)throw this.astErrorOutput("Constant has no type",_);return{name:$,type:tt,origin:"constants",signature:st,xProperty:_.property};case"this.constants.value[][]":{if(typeof _.object.object.property.name!="string")throw this.astErrorOutput("Unexpected expression",_);if($=_.object.object.property.name,tt=this.getConstantType($),!tt)throw this.astErrorOutput("Constant has no type",_);return{name:$,type:tt,origin:"constants",signature:st,yProperty:_.object.property,xProperty:_.property}}case"this.constants.value[][][]":{if(typeof _.object.object.object.property.name!="string")throw this.astErrorOutput("Unexpected expression",_);if($=_.object.object.object.property.name,tt=this.getConstantType($),!tt)throw this.astErrorOutput("Constant has no type",_);return{name:$,type:tt,origin:"constants",signature:st,zProperty:_.object.object.property,yProperty:_.object.property,xProperty:_.property}}case"fn()[]":case"fn()[][]":case"[][]":return{signature:st,property:_.property};default:throw this.astErrorOutput("Unexpected expression",_)}}findIdentifierOrigin(_){const $=[this.ast];for(;$.length>0;){const tt=$[0];if(tt.type==="VariableDeclarator"&&tt.id&&tt.id.name&&tt.id.name===_.name)return tt;if($.shift(),tt.argument)$.push(tt.argument);else if(tt.body)$.push(tt.body);else if(tt.declarations)$.push(tt.declarations);else if(Array.isArray(tt))for(let st=0;st0;){const tt=$.pop();if(tt.type==="ReturnStatement")return tt;if(tt.type!=="FunctionDeclaration")if(tt.argument)$.push(tt.argument);else if(tt.body)$.push(tt.body);else if(tt.declarations)$.push(tt.declarations);else if(Array.isArray(tt))for(let st=0;st0?it[it.length-1]:null}const at={trackIdentifiers:"trackIdentifiers",memberExpression:"memberExpression",inForLoopInit:"inForLoopInit"};class nt{constructor(j){this.runningContexts=[],this.functionContexts=[],this.contexts=[],this.functionCalls=[],this.declarations=[],this.identifiers=[],this.functions=[],this.returnStatements=[],this.trackedIdentifiers=null,this.states=[],this.newFunctionContext(),this.scan(j)}isState(j){return this.states[this.states.length-1]===j}hasState(j){return this.states.indexOf(j)>-1}pushState(j){this.states.push(j)}popState(j){if(this.isState(j))this.states.pop();else throw new Error(`Cannot pop the non-active state "${j}"`)}get currentFunctionContext(){return ot(this.functionContexts)}get currentContext(){return ot(this.runningContexts)}newFunctionContext(){const j={"@contextType":"function"};this.contexts.push(j),this.functionContexts.push(j)}newContext(j){const _=Object.assign({"@contextType":"const/let"},this.currentContext);this.contexts.push(_),this.runningContexts.push(_),j();const{currentFunctionContext:$}=this;for(const tt in $)!$.hasOwnProperty(tt)||_.hasOwnProperty(tt)||(_[tt]=$[tt]);return this.runningContexts.pop(),_}useFunctionContext(j){const _=ot(this.functionContexts);this.runningContexts.push(_),j(),this.runningContexts.pop()}getIdentifiers(j){const _=this.trackedIdentifiers=[];return this.pushState(at.trackIdentifiers),j(),this.trackedIdentifiers=null,this.popState(at.trackIdentifiers),_}getDeclaration(j){const{currentContext:_,currentFunctionContext:$,runningContexts:tt}=this,st=_[j]||$[j]||null;if(!st&&_===$&&tt.length>0){const lt=tt[tt.length-2];if(lt[j])return lt[j]}return st}scan(j){if(j){if(Array.isArray(j)){for(let _=0;_{this.scan(j.body)});break;case"BlockStatement":this.newContext(()=>{this.scan(j.body)});break;case"AssignmentExpression":case"LogicalExpression":this.scan(j.left),this.scan(j.right);break;case"BinaryExpression":this.scan(j.left),this.scan(j.right);break;case"UpdateExpression":if(j.operator==="++"){const _=this.getDeclaration(j.argument.name);_&&(_.suggestedType="Integer")}this.scan(j.argument);break;case"UnaryExpression":this.scan(j.argument);break;case"VariableDeclaration":j.kind==="var"?this.useFunctionContext(()=>{j.declarations=et.normalizeDeclarations(j),this.scan(j.declarations)}):(j.declarations=et.normalizeDeclarations(j),this.scan(j.declarations));break;case"VariableDeclarator":{const{currentContext:_}=this,$=this.hasState(at.inForLoopInit),tt={ast:j,context:_,name:j.id.name,origin:"declaration",inForLoopInit:$,inForLoopTest:null,assignable:_===this.currentFunctionContext||!$&&!_.hasOwnProperty(j.id.name),suggestedType:null,valueType:null,dependencies:null,isSafe:null};_[j.id.name]||(_[j.id.name]=tt),this.declarations.push(tt),this.scan(j.id),this.scan(j.init);break}case"FunctionExpression":case"FunctionDeclaration":this.runningContexts.length===0?this.scan(j.body):this.functions.push(j);break;case"IfStatement":this.scan(j.test),this.scan(j.consequent),j.alternate&&this.scan(j.alternate);break;case"ForStatement":{let _;const $=this.newContext(()=>{this.pushState(at.inForLoopInit),this.scan(j.init),this.popState(at.inForLoopInit),_=this.getIdentifiers(()=>{this.scan(j.test)}),this.scan(j.update),this.newContext(()=>{this.scan(j.body)})});if(_)for(const tt in $)tt!=="@contextType"&&_.indexOf(tt)>-1&&($[tt].inForLoopTest=!0);break}case"DoWhileStatement":case"WhileStatement":this.newContext(()=>{this.scan(j.body),this.scan(j.test)});break;case"Identifier":{this.isState(at.trackIdentifiers)&&this.trackedIdentifiers.push(j.name),this.identifiers.push({context:this.currentContext,declaration:this.getDeclaration(j.name),ast:j});break}case"ReturnStatement":this.returnStatements.push(j),this.scan(j.argument);break;case"MemberExpression":this.pushState(at.memberExpression),this.scan(j.object),this.scan(j.property),this.popState(at.memberExpression);break;case"ExpressionStatement":this.scan(j.expression);break;case"SequenceExpression":this.scan(j.expressions);break;case"CallExpression":this.functionCalls.push({context:this.currentContext,ast:j}),this.scan(j.arguments);break;case"ArrayExpression":this.scan(j.elements);break;case"ConditionalExpression":this.scan(j.test),this.scan(j.alternate),this.scan(j.consequent);break;case"SwitchStatement":this.scan(j.discriminant),this.scan(j.cases);break;case"SwitchCase":this.scan(j.test),this.scan(j.consequent);break;case"ThisExpression":case"Literal":case"DebuggerStatement":case"EmptyStatement":case"BreakStatement":case"ContinueStatement":break;default:throw new Error(`unhandled type "${j.type}"`)}}}}a.exports={FunctionTracer:nt}},{"../utils":114}],12:[function(o,a,rt){const{glWiretap:et}=o("gl-wiretap"),{utils:ot}=o("../../utils");function at(tt){return tt.toString().replace("=>","").replace(/^function /,"").replace(/utils[.]/g,"/*utils.*/")}function nt(tt,st,lt,ct,ht){lt.built||lt.build.apply(lt,st),st=st?Array.from(st).map(fr=>{switch(typeof fr){case"boolean":return new Boolean(fr);case"number":return new Number(fr);default:return fr}}):null;const ut=[],pt=et(lt.context,{useTrackablePrimitives:!0,onReadPixels:fr=>{if(Zt.subKernels){if(!mt)ut.push(` const result = { result: ${it(fr,Zt)} };`),mt=!0;else{const mr=Zt.subKernels[gt++].property;ut.push(` result${isNaN(mr)?"."+mr:`[${mr}]`} = ${it(fr,Zt)};`)}gt===Zt.subKernels.length&&ut.push(" return result;");return}fr?ut.push(` return ${it(fr,Zt)};`):ut.push(" return null;")},onUnrecognizedArgumentLookup:fr=>{const mr=$(fr,Zt.kernelArguments,[],pt);if(mr)return mr;const gr=$(fr,Zt.kernelConstants,Et?Object.keys(Et).map(tr=>Et[tr]):[],pt);return gr||null}});let mt=!1,gt=0;const{source:dt,canvas:St,output:xt,pipeline:yt,graphical:_t,loopMaxIterations:Ct,constants:Et,optimizeFloatMemory:kt,precision:Tt,fixIntegerDivisionAccuracy:$t,functions:It,nativeFunctions:Ot,subKernels:Mt,immutable:Dt,argumentTypes:Bt,constantTypes:Kt,kernelArguments:Wt,kernelConstants:zt,tactic:Ht}=lt,Zt=new tt(dt,{canvas:St,context:pt,checkContext:!1,output:xt,pipeline:yt,graphical:_t,loopMaxIterations:Ct,constants:Et,optimizeFloatMemory:kt,precision:Tt,fixIntegerDivisionAccuracy:$t,functions:It,nativeFunctions:Ot,subKernels:Mt,immutable:Dt,argumentTypes:Bt,constantTypes:Kt,tactic:Ht});let qt=[];if(pt.setIndent(2),Zt.build.apply(Zt,st),qt.push(pt.toString()),pt.reset(),Zt.kernelArguments.forEach((fr,mr)=>{switch(fr.type){case"Integer":case"Boolean":case"Number":case"Float":case"Array":case"Array(2)":case"Array(3)":case"Array(4)":case"HTMLCanvas":case"HTMLImage":case"HTMLVideo":pt.insertVariable(`uploadValue_${fr.name}`,fr.uploadValue);break;case"HTMLImageArray":for(let gr=0;grfr.varName).join(", ")}) {`),pt.setIndent(4),Zt.run.apply(Zt,st),Zt.renderKernels?Zt.renderKernels():Zt.renderOutput&&Zt.renderOutput(),qt.push(" /** start setup uploads for kernel values **/"),Zt.kernelArguments.forEach(fr=>{qt.push(" "+fr.getStringValueHandler().split(` +`)}getPrototypesFromFunctionNames(at){const nt=[];for(let it=0;it-1){nt.push(this.nativeFunctions[_].source);continue}const $=this.functionMap[j];$&&nt.push($.toString())}return nt}toJSON(){return this.traceFunctionCalls(this.rootNode.name).reverse().map(at=>{const nt=this.nativeFunctions.indexOf(at);if(nt>-1)return{name:at,source:this.nativeFunctions[nt].source};if(this.functionMap[at])return this.functionMap[at].toJSON();throw new Error(`function ${at} not found`)})}fromJSON(at,nt){this.functionMap={};for(let it=0;it0){const et=nt.arguments;for(let st=0;st0&&this.argumentTypes.length!==this.argumentNames.length)throw new Error(`argumentTypes count of ${this.argumentTypes.length} exceeds ${this.argumentNames.length}`);if(this.output.length<1)throw new Error("this.output is not big enough")}isIdentifierConstant(_){return this.constants?this.constants.hasOwnProperty(_):!1}isInput(_){return this.argumentTypes[this.argumentNames.indexOf(_)]==="Input"}pushState(_){this.states.push(_)}popState(_){if(this.state!==_)throw new Error(`Cannot popState ${_} when in ${this.state}`);this.states.pop()}isState(_){return this.state===_}get state(){return this.states[this.states.length-1]}astMemberExpressionUnroll(_){if(_.type==="Identifier")return _.name;if(_.type==="ThisExpression")return"this";if(_.type==="MemberExpression"&&_.object&&_.property)return _.object.hasOwnProperty("name")&&_.object.name!=="Math"?this.astMemberExpressionUnroll(_.property):this.astMemberExpressionUnroll(_.object)+"."+this.astMemberExpressionUnroll(_.property);if(_.hasOwnProperty("expressions")){const $=_.expressions[0];if($.type==="Literal"&&$.value===0&&_.expressions.length===2)return this.astMemberExpressionUnroll(_.expressions[1])}throw this.astErrorOutput("Unknown astMemberExpressionUnroll",_)}getJsAST(_){if(this.ast)return this.ast;if(typeof this.source=="object")return this.traceFunctionAST(this.source),this.ast=this.source;if(_=_||tt,_===null)throw new Error("Missing JS to AST parser");const $=Object.freeze(_.parse(`const parser_${this.name} = ${this.source};`,{locations:!0})),et=$.body[0].declarations[0].init;if(this.traceFunctionAST(et),!$)throw new Error("Failed to parse JS code");return this.ast=et}traceFunctionAST(_){const{contexts:$,declarations:et,functions:st,identifiers:lt,functionCalls:ct}=new at(_);this.contexts=$,this.identifiers=lt,this.functionCalls=ct,this.functions=st;for(let ht=0;ht":case"<":return"Boolean";case"&":case"|":case"^":case"<<":case">>":case">>>":return"Integer"}const st=this.getType(_.left);if(this.isState("skip-literal-correction"))return st;if(st==="LiteralInteger"){const ut=this.getType(_.right);return ut==="LiteralInteger"?_.left.value%1===0?"Integer":"Float":ut}return it[st]||st;case"UpdateExpression":return this.getType(_.argument);case"UnaryExpression":return _.operator==="~"?"Integer":this.getType(_.argument);case"VariableDeclaration":{const ut=_.declarations;let pt;for(let mt=0;mt-1}isAstMathFunction(_){const $=["abs","acos","acosh","asin","asinh","atan","atan2","atanh","cbrt","ceil","clz32","cos","cosh","expm1","exp","floor","fround","imul","log","log2","log10","log1p","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc"];return _.type==="CallExpression"&&_.callee&&_.callee.type==="MemberExpression"&&_.callee.object&&_.callee.object.type==="Identifier"&&_.callee.object.name==="Math"&&_.callee.property&&_.callee.property.type==="Identifier"&&$.indexOf(_.callee.property.name)>-1}isAstVariable(_){return _.type==="Identifier"||_.type==="MemberExpression"}isSafe(_){return this.isSafeDependencies(this.getDependencies(_))}isSafeDependencies(_){return _&&_.every?_.every($=>$.isSafe):!0}getDependencies(_,$,et){if($||($=[]),!_)return null;if(Array.isArray(_)){for(let st=0;st<_.length;st++)this.getDependencies(_[st],$,et);return $}switch(_.type){case"AssignmentExpression":return this.getDependencies(_.left,$,et),this.getDependencies(_.right,$,et),$;case"ConditionalExpression":return this.getDependencies(_.test,$,et),this.getDependencies(_.alternate,$,et),this.getDependencies(_.consequent,$,et),$;case"Literal":$.push({origin:"literal",value:_.value,isSafe:et===!0?!1:_.value>-1/0&&_.value<1/0&&!isNaN(_.value)});break;case"VariableDeclarator":return this.getDependencies(_.init,$,et);case"Identifier":const st=this.getDeclaration(_);if(st)$.push({name:_.name,origin:"declaration",isSafe:et?!1:this.isSafeDependencies(st.dependencies)});else if(this.argumentNames.indexOf(_.name)>-1)$.push({name:_.name,origin:"argument",isSafe:!1});else if(this.strictTypingChecking)throw new Error(`Cannot find identifier origin "${_.name}"`);break;case"FunctionDeclaration":return this.getDependencies(_.body.body[_.body.body.length-1],$,et);case"ReturnStatement":return this.getDependencies(_.argument,$);case"BinaryExpression":case"LogicalExpression":return et=_.operator==="/"||_.operator==="*",this.getDependencies(_.left,$,et),this.getDependencies(_.right,$,et),$;case"UnaryExpression":case"UpdateExpression":return this.getDependencies(_.argument,$,et);case"VariableDeclaration":return this.getDependencies(_.declarations,$,et);case"ArrayExpression":return $.push({origin:"declaration",isSafe:!0}),$;case"CallExpression":return $.push({origin:"function",isSafe:!0}),$;case"MemberExpression":const lt=this.getMemberExpressionDetails(_);switch(lt.signature){case"value[]":this.getDependencies(_.object,$,et);break;case"value[][]":this.getDependencies(_.object.object,$,et);break;case"value[][][]":this.getDependencies(_.object.object.object,$,et);break;case"this.output.value":this.dynamicOutput&&$.push({name:lt.name,origin:"output",isSafe:!1});break}if(lt)return lt.property&&this.getDependencies(lt.property,$,et),lt.xProperty&&this.getDependencies(lt.xProperty,$,et),lt.yProperty&&this.getDependencies(lt.yProperty,$,et),lt.zProperty&&this.getDependencies(lt.zProperty,$,et),$;case"SequenceExpression":return this.getDependencies(_.expressions,$,et);default:throw this.astErrorOutput(`Unhandled type ${_.type} in getDependencies`,_)}return $}getVariableSignature(_,$){if(!this.isAstVariable(_))throw new Error(`ast of type "${_.type}" is not a variable signature`);if(_.type==="Identifier")return"value";const et=[];for(;_;)_.computed?et.push("[]"):_.type==="ThisExpression"?et.unshift("this"):_.property&&_.property.name?_.property.name==="x"||_.property.name==="y"||_.property.name==="z"?et.unshift($?"."+_.property.name:".value"):_.property.name==="constants"||_.property.name==="thread"||_.property.name==="output"?et.unshift("."+_.property.name):et.unshift($?"."+_.property.name:".value"):_.name?et.unshift($?_.name:"value"):_.callee&&_.callee.name?et.unshift($?_.callee.name+"()":"fn()"):_.elements?et.unshift("[]"):et.unshift("unknown"),_=_.object;const st=et.join("");return $||["value","value[]","value[][]","value[][][]","value[][][][]","value.value","value.thread.value","this.thread.value","this.output.value","this.constants.value","this.constants.value[]","this.constants.value[][]","this.constants.value[][][]","this.constants.value[][][][]","fn()[]","fn()[][]","fn()[][][]","[][]"].indexOf(st)>-1?st:null}build(){return this.toString().length>0}astGeneric(_,$){if(_===null)throw this.astErrorOutput("NULL ast",_);if(Array.isArray(_)){for(let et=0;et<_.length;et++)this.astGeneric(_[et],$);return $}switch(_.type){case"FunctionDeclaration":return this.astFunctionDeclaration(_,$);case"FunctionExpression":return this.astFunctionExpression(_,$);case"ReturnStatement":return this.astReturnStatement(_,$);case"Literal":return this.astLiteral(_,$);case"BinaryExpression":return this.astBinaryExpression(_,$);case"Identifier":return this.astIdentifierExpression(_,$);case"AssignmentExpression":return this.astAssignmentExpression(_,$);case"ExpressionStatement":return this.astExpressionStatement(_,$);case"EmptyStatement":return this.astEmptyStatement(_,$);case"BlockStatement":return this.astBlockStatement(_,$);case"IfStatement":return this.astIfStatement(_,$);case"SwitchStatement":return this.astSwitchStatement(_,$);case"BreakStatement":return this.astBreakStatement(_,$);case"ContinueStatement":return this.astContinueStatement(_,$);case"ForStatement":return this.astForStatement(_,$);case"WhileStatement":return this.astWhileStatement(_,$);case"DoWhileStatement":return this.astDoWhileStatement(_,$);case"VariableDeclaration":return this.astVariableDeclaration(_,$);case"VariableDeclarator":return this.astVariableDeclarator(_,$);case"ThisExpression":return this.astThisExpression(_,$);case"SequenceExpression":return this.astSequenceExpression(_,$);case"UnaryExpression":return this.astUnaryExpression(_,$);case"UpdateExpression":return this.astUpdateExpression(_,$);case"LogicalExpression":return this.astLogicalExpression(_,$);case"MemberExpression":return this.astMemberExpression(_,$);case"CallExpression":return this.astCallExpression(_,$);case"ArrayExpression":return this.astArrayExpression(_,$);case"DebuggerStatement":return this.astDebuggerStatement(_,$);case"ConditionalExpression":return this.astConditionalExpression(_,$)}throw this.astErrorOutput("Unknown ast type : "+_.type,_)}astErrorOutput(_,$){if(typeof this.source!="string")return new Error(_);const et=ot.getAstString(this.source,$),lt=this.source.substr($.start).split(/\n/),ct=lt.length>0?lt[lt.length-1]:0;return new Error(`${_} on line ${lt.length}, position ${ct.length}: + ${et}`)}astDebuggerStatement(_,$){return $}astConditionalExpression(_,$){if(_.type!=="ConditionalExpression")throw this.astErrorOutput("Not a conditional expression",_);return $.push("("),this.astGeneric(_.test,$),$.push("?"),this.astGeneric(_.consequent,$),$.push(":"),this.astGeneric(_.alternate,$),$.push(")"),$}astFunction(_,$){throw new Error(`"astFunction" not defined on ${this.constructor.name}`)}astFunctionDeclaration(_,$){return this.isChildFunction(_)?$:this.astFunction(_,$)}astFunctionExpression(_,$){return this.isChildFunction(_)?$:this.astFunction(_,$)}isChildFunction(_){for(let $=0;$1?$.push("(",st.join(","),")"):$.push(st[0]),$}astUnaryExpression(_,$){return this.checkAndUpconvertBitwiseUnary(_,$)||(_.prefix?($.push(_.operator),this.astGeneric(_.argument,$)):(this.astGeneric(_.argument,$),$.push(_.operator))),$}checkAndUpconvertBitwiseUnary(_,$){}astUpdateExpression(_,$){return _.prefix?($.push(_.operator),this.astGeneric(_.argument,$)):(this.astGeneric(_.argument,$),$.push(_.operator)),$}astLogicalExpression(_,$){return $.push("("),this.astGeneric(_.left,$),$.push(_.operator),this.astGeneric(_.right,$),$.push(")"),$}astMemberExpression(_,$){return $}astCallExpression(_,$){return $}astArrayExpression(_,$){return $}getMemberExpressionDetails(_){if(_.type!=="MemberExpression")throw this.astErrorOutput(`Expression ${_.type} not a MemberExpression`,_);let $=null,et=null;const st=this.getVariableSignature(_);switch(st){case"value":return null;case"value.thread.value":case"this.thread.value":case"this.output.value":return{signature:st,type:"Integer",name:_.property.name};case"value[]":if(typeof _.object.name!="string")throw this.astErrorOutput("Unexpected expression",_);return $=_.object.name,{name:$,origin:"user",signature:st,type:this.getVariableType(_.object),xProperty:_.property};case"value[][]":if(typeof _.object.object.name!="string")throw this.astErrorOutput("Unexpected expression",_);return $=_.object.object.name,{name:$,origin:"user",signature:st,type:this.getVariableType(_.object.object),yProperty:_.object.property,xProperty:_.property};case"value[][][]":if(typeof _.object.object.object.name!="string")throw this.astErrorOutput("Unexpected expression",_);return $=_.object.object.object.name,{name:$,origin:"user",signature:st,type:this.getVariableType(_.object.object.object),zProperty:_.object.object.property,yProperty:_.object.property,xProperty:_.property};case"value[][][][]":if(typeof _.object.object.object.object.name!="string")throw this.astErrorOutput("Unexpected expression",_);return $=_.object.object.object.object.name,{name:$,origin:"user",signature:st,type:this.getVariableType(_.object.object.object.object),zProperty:_.object.object.property,yProperty:_.object.property,xProperty:_.property};case"value.value":if(typeof _.property.name!="string")throw this.astErrorOutput("Unexpected expression",_);if(this.isAstMathVariable(_))return $=_.property.name,{name:$,origin:"Math",type:"Number",signature:st};switch(_.property.name){case"r":case"g":case"b":case"a":return $=_.object.name,{name:$,property:_.property.name,origin:"user",signature:st,type:"Number"};default:throw this.astErrorOutput("Unexpected expression",_)}case"this.constants.value":if(typeof _.property.name!="string")throw this.astErrorOutput("Unexpected expression",_);if($=_.property.name,et=this.getConstantType($),!et)throw this.astErrorOutput("Constant has no type",_);return{name:$,type:et,origin:"constants",signature:st};case"this.constants.value[]":if(typeof _.object.property.name!="string")throw this.astErrorOutput("Unexpected expression",_);if($=_.object.property.name,et=this.getConstantType($),!et)throw this.astErrorOutput("Constant has no type",_);return{name:$,type:et,origin:"constants",signature:st,xProperty:_.property};case"this.constants.value[][]":{if(typeof _.object.object.property.name!="string")throw this.astErrorOutput("Unexpected expression",_);if($=_.object.object.property.name,et=this.getConstantType($),!et)throw this.astErrorOutput("Constant has no type",_);return{name:$,type:et,origin:"constants",signature:st,yProperty:_.object.property,xProperty:_.property}}case"this.constants.value[][][]":{if(typeof _.object.object.object.property.name!="string")throw this.astErrorOutput("Unexpected expression",_);if($=_.object.object.object.property.name,et=this.getConstantType($),!et)throw this.astErrorOutput("Constant has no type",_);return{name:$,type:et,origin:"constants",signature:st,zProperty:_.object.object.property,yProperty:_.object.property,xProperty:_.property}}case"fn()[]":case"fn()[][]":case"[][]":return{signature:st,property:_.property};default:throw this.astErrorOutput("Unexpected expression",_)}}findIdentifierOrigin(_){const $=[this.ast];for(;$.length>0;){const et=$[0];if(et.type==="VariableDeclarator"&&et.id&&et.id.name&&et.id.name===_.name)return et;if($.shift(),et.argument)$.push(et.argument);else if(et.body)$.push(et.body);else if(et.declarations)$.push(et.declarations);else if(Array.isArray(et))for(let st=0;st0;){const et=$.pop();if(et.type==="ReturnStatement")return et;if(et.type!=="FunctionDeclaration")if(et.argument)$.push(et.argument);else if(et.body)$.push(et.body);else if(et.declarations)$.push(et.declarations);else if(Array.isArray(et))for(let st=0;st0?it[it.length-1]:null}const at={trackIdentifiers:"trackIdentifiers",memberExpression:"memberExpression",inForLoopInit:"inForLoopInit"};class nt{constructor(j){this.runningContexts=[],this.functionContexts=[],this.contexts=[],this.functionCalls=[],this.declarations=[],this.identifiers=[],this.functions=[],this.returnStatements=[],this.trackedIdentifiers=null,this.states=[],this.newFunctionContext(),this.scan(j)}isState(j){return this.states[this.states.length-1]===j}hasState(j){return this.states.indexOf(j)>-1}pushState(j){this.states.push(j)}popState(j){if(this.isState(j))this.states.pop();else throw new Error(`Cannot pop the non-active state "${j}"`)}get currentFunctionContext(){return ot(this.functionContexts)}get currentContext(){return ot(this.runningContexts)}newFunctionContext(){const j={"@contextType":"function"};this.contexts.push(j),this.functionContexts.push(j)}newContext(j){const _=Object.assign({"@contextType":"const/let"},this.currentContext);this.contexts.push(_),this.runningContexts.push(_),j();const{currentFunctionContext:$}=this;for(const et in $)!$.hasOwnProperty(et)||_.hasOwnProperty(et)||(_[et]=$[et]);return this.runningContexts.pop(),_}useFunctionContext(j){const _=ot(this.functionContexts);this.runningContexts.push(_),j(),this.runningContexts.pop()}getIdentifiers(j){const _=this.trackedIdentifiers=[];return this.pushState(at.trackIdentifiers),j(),this.trackedIdentifiers=null,this.popState(at.trackIdentifiers),_}getDeclaration(j){const{currentContext:_,currentFunctionContext:$,runningContexts:et}=this,st=_[j]||$[j]||null;if(!st&&_===$&&et.length>0){const lt=et[et.length-2];if(lt[j])return lt[j]}return st}scan(j){if(j){if(Array.isArray(j)){for(let _=0;_{this.scan(j.body)});break;case"BlockStatement":this.newContext(()=>{this.scan(j.body)});break;case"AssignmentExpression":case"LogicalExpression":this.scan(j.left),this.scan(j.right);break;case"BinaryExpression":this.scan(j.left),this.scan(j.right);break;case"UpdateExpression":if(j.operator==="++"){const _=this.getDeclaration(j.argument.name);_&&(_.suggestedType="Integer")}this.scan(j.argument);break;case"UnaryExpression":this.scan(j.argument);break;case"VariableDeclaration":j.kind==="var"?this.useFunctionContext(()=>{j.declarations=tt.normalizeDeclarations(j),this.scan(j.declarations)}):(j.declarations=tt.normalizeDeclarations(j),this.scan(j.declarations));break;case"VariableDeclarator":{const{currentContext:_}=this,$=this.hasState(at.inForLoopInit),et={ast:j,context:_,name:j.id.name,origin:"declaration",inForLoopInit:$,inForLoopTest:null,assignable:_===this.currentFunctionContext||!$&&!_.hasOwnProperty(j.id.name),suggestedType:null,valueType:null,dependencies:null,isSafe:null};_[j.id.name]||(_[j.id.name]=et),this.declarations.push(et),this.scan(j.id),this.scan(j.init);break}case"FunctionExpression":case"FunctionDeclaration":this.runningContexts.length===0?this.scan(j.body):this.functions.push(j);break;case"IfStatement":this.scan(j.test),this.scan(j.consequent),j.alternate&&this.scan(j.alternate);break;case"ForStatement":{let _;const $=this.newContext(()=>{this.pushState(at.inForLoopInit),this.scan(j.init),this.popState(at.inForLoopInit),_=this.getIdentifiers(()=>{this.scan(j.test)}),this.scan(j.update),this.newContext(()=>{this.scan(j.body)})});if(_)for(const et in $)et!=="@contextType"&&_.indexOf(et)>-1&&($[et].inForLoopTest=!0);break}case"DoWhileStatement":case"WhileStatement":this.newContext(()=>{this.scan(j.body),this.scan(j.test)});break;case"Identifier":{this.isState(at.trackIdentifiers)&&this.trackedIdentifiers.push(j.name),this.identifiers.push({context:this.currentContext,declaration:this.getDeclaration(j.name),ast:j});break}case"ReturnStatement":this.returnStatements.push(j),this.scan(j.argument);break;case"MemberExpression":this.pushState(at.memberExpression),this.scan(j.object),this.scan(j.property),this.popState(at.memberExpression);break;case"ExpressionStatement":this.scan(j.expression);break;case"SequenceExpression":this.scan(j.expressions);break;case"CallExpression":this.functionCalls.push({context:this.currentContext,ast:j}),this.scan(j.arguments);break;case"ArrayExpression":this.scan(j.elements);break;case"ConditionalExpression":this.scan(j.test),this.scan(j.alternate),this.scan(j.consequent);break;case"SwitchStatement":this.scan(j.discriminant),this.scan(j.cases);break;case"SwitchCase":this.scan(j.test),this.scan(j.consequent);break;case"ThisExpression":case"Literal":case"DebuggerStatement":case"EmptyStatement":case"BreakStatement":case"ContinueStatement":break;default:throw new Error(`unhandled type "${j.type}"`)}}}}a.exports={FunctionTracer:nt}},{"../utils":114}],12:[function(o,a,rt){const{glWiretap:tt}=o("gl-wiretap"),{utils:ot}=o("../../utils");function at(et){return et.toString().replace("=>","").replace(/^function /,"").replace(/utils[.]/g,"/*utils.*/")}function nt(et,st,lt,ct,ht){lt.built||lt.build.apply(lt,st),st=st?Array.from(st).map(fr=>{switch(typeof fr){case"boolean":return new Boolean(fr);case"number":return new Number(fr);default:return fr}}):null;const ut=[],pt=tt(lt.context,{useTrackablePrimitives:!0,onReadPixels:fr=>{if(Zt.subKernels){if(!mt)ut.push(` const result = { result: ${it(fr,Zt)} };`),mt=!0;else{const mr=Zt.subKernels[gt++].property;ut.push(` result${isNaN(mr)?"."+mr:`[${mr}]`} = ${it(fr,Zt)};`)}gt===Zt.subKernels.length&&ut.push(" return result;");return}fr?ut.push(` return ${it(fr,Zt)};`):ut.push(" return null;")},onUnrecognizedArgumentLookup:fr=>{const mr=$(fr,Zt.kernelArguments,[],pt);if(mr)return mr;const gr=$(fr,Zt.kernelConstants,Et?Object.keys(Et).map(tr=>Et[tr]):[],pt);return gr||null}});let mt=!1,gt=0;const{source:dt,canvas:St,output:xt,pipeline:yt,graphical:_t,loopMaxIterations:Ct,constants:Et,optimizeFloatMemory:kt,precision:Tt,fixIntegerDivisionAccuracy:$t,functions:It,nativeFunctions:Ot,subKernels:Mt,immutable:Dt,argumentTypes:Bt,constantTypes:Kt,kernelArguments:Wt,kernelConstants:zt,tactic:Ht}=lt,Zt=new et(dt,{canvas:St,context:pt,checkContext:!1,output:xt,pipeline:yt,graphical:_t,loopMaxIterations:Ct,constants:Et,optimizeFloatMemory:kt,precision:Tt,fixIntegerDivisionAccuracy:$t,functions:It,nativeFunctions:Ot,subKernels:Mt,immutable:Dt,argumentTypes:Bt,constantTypes:Kt,tactic:Ht});let qt=[];if(pt.setIndent(2),Zt.build.apply(Zt,st),qt.push(pt.toString()),pt.reset(),Zt.kernelArguments.forEach((fr,mr)=>{switch(fr.type){case"Integer":case"Boolean":case"Number":case"Float":case"Array":case"Array(2)":case"Array(3)":case"Array(4)":case"HTMLCanvas":case"HTMLImage":case"HTMLVideo":pt.insertVariable(`uploadValue_${fr.name}`,fr.uploadValue);break;case"HTMLImageArray":for(let gr=0;grfr.varName).join(", ")}) {`),pt.setIndent(4),Zt.run.apply(Zt,st),Zt.renderKernels?Zt.renderKernels():Zt.renderOutput&&Zt.renderOutput(),qt.push(" /** start setup uploads for kernel values **/"),Zt.kernelArguments.forEach(fr=>{qt.push(" "+fr.getStringValueHandler().split(` `).join(` `))}),qt.push(" /** end setup uploads for kernel values **/"),qt.push(pt.toString()),Zt.renderOutput===Zt.renderTexture){pt.reset();const fr=pt.getContextVariableName(Zt.framebuffer);if(Zt.renderKernels){const mr=Zt.renderKernels(),gr=pt.getContextVariableName(Zt.texture.texture);qt.push(` return { result: { @@ -2074,20 +2074,20 @@ ${nt._kernelString} ${ct||""} ${qt.join(` `)} -}`}function it(tt,st){const lt=st.precision==="single"?tt:`new Float32Array(${tt}.buffer)`;return st.output[2]?`renderOutput(${lt}, ${st.output[0]}, ${st.output[1]}, ${st.output[2]})`:st.output[1]?`renderOutput(${lt}, ${st.output[0]}, ${st.output[1]})`:`renderOutput(${lt}, ${st.output[0]})`}function j(tt){const st=tt.getPixels.toString(),lt=!/^function/.test(st);return ot.flattenFunctionToString(`${lt?"function ":""}${st}`,{findDependency:(ct,ht)=>ct==="utils"?`const ${ht} = ${ot[ht].toString()};`:null,thisLookup:ct=>{if(ct==="context")return null;if(tt.hasOwnProperty(ct))return JSON.stringify(tt[ct]);throw new Error(`unhandled thisLookup ${ct}`)}})}function _(tt,st,lt){const ct=tt.toArray.toString(),ht=!/^function/.test(ct),ut=ot.flattenFunctionToString(`${ht?"function ":""}${ct}`,{findDependency:(pt,mt)=>{if(pt==="utils")return`const ${mt} = ${ot[mt].toString()};`;if(pt==="this")return mt==="framebuffer"?"":`${ht?"function ":""}${tt[mt].toString()}`;throw new Error("unhandled fromObject")},thisLookup:(pt,mt)=>{if(pt==="texture")return st;if(pt==="context")return mt?null:"gl";if(tt.hasOwnProperty(pt))return JSON.stringify(tt[pt]);throw new Error(`unhandled thisLookup ${pt}`)}});return`() => { +}`}function it(et,st){const lt=st.precision==="single"?et:`new Float32Array(${et}.buffer)`;return st.output[2]?`renderOutput(${lt}, ${st.output[0]}, ${st.output[1]}, ${st.output[2]})`:st.output[1]?`renderOutput(${lt}, ${st.output[0]}, ${st.output[1]})`:`renderOutput(${lt}, ${st.output[0]})`}function j(et){const st=et.getPixels.toString(),lt=!/^function/.test(st);return ot.flattenFunctionToString(`${lt?"function ":""}${st}`,{findDependency:(ct,ht)=>ct==="utils"?`const ${ht} = ${ot[ht].toString()};`:null,thisLookup:ct=>{if(ct==="context")return null;if(et.hasOwnProperty(ct))return JSON.stringify(et[ct]);throw new Error(`unhandled thisLookup ${ct}`)}})}function _(et,st,lt){const ct=et.toArray.toString(),ht=!/^function/.test(ct),ut=ot.flattenFunctionToString(`${ht?"function ":""}${ct}`,{findDependency:(pt,mt)=>{if(pt==="utils")return`const ${mt} = ${ot[mt].toString()};`;if(pt==="this")return mt==="framebuffer"?"":`${ht?"function ":""}${et[mt].toString()}`;throw new Error("unhandled fromObject")},thisLookup:(pt,mt)=>{if(pt==="texture")return st;if(pt==="context")return mt?null:"gl";if(et.hasOwnProperty(pt))return JSON.stringify(et[pt]);throw new Error(`unhandled thisLookup ${pt}`)}});return`() => { function framebuffer() { return ${lt}; }; ${ut} return toArray(); - }`}function $(tt,st,lt,ct,ht){if(tt===null||st===null)return null;switch(typeof tt){case"boolean":case"number":return null}if(typeof HTMLImageElement<"u"&&tt instanceof HTMLImageElement)for(let ut=0;ut0?":"+Tt.join(","):"")}setFixIntegerDivisionAccuracy(kt){return this.fixIntegerDivisionAccuracy=kt,this}setPrecision(kt){return this.precision=kt,this}setFloatTextures(kt){return ot.warnDeprecated("method","setFloatTextures","setOptimizeFloatMemory"),this.floatTextures=kt,this}static nativeFunctionArguments(kt){const Tt=[],$t=[],It=[],Ot=/^[a-zA-Z_]/,Mt=/[a-zA-Z_0-9]/;let Dt=0,Bt=null,Kt=null;for(;Dt0?It[It.length-1]:null;if(Ht==="FUNCTION_ARGUMENTS"&&Wt==="/"&&zt==="*"){It.push("MULTI_LINE_COMMENT"),Dt+=2;continue}else if(Ht==="MULTI_LINE_COMMENT"&&Wt==="*"&&zt==="/"){It.pop(),Dt+=2;continue}else if(Ht==="FUNCTION_ARGUMENTS"&&Wt==="/"&&zt==="/"){It.push("COMMENT"),Dt+=2;continue}else if(Ht==="COMMENT"&&Wt===` -`){It.pop(),Dt++;continue}else if(Ht===null&&Wt==="("){It.push("FUNCTION_ARGUMENTS"),Dt++;continue}else if(Ht==="FUNCTION_ARGUMENTS"){if(Wt===")"){It.pop();break}if(Wt==="f"&&zt==="l"&&kt[Dt+2]==="o"&&kt[Dt+3]==="a"&&kt[Dt+4]==="t"&&kt[Dt+5]===" "){It.push("DECLARE_VARIABLE"),Kt="float",Bt="",Dt+=6;continue}else if(Wt==="i"&&zt==="n"&&kt[Dt+2]==="t"&&kt[Dt+3]===" "){It.push("DECLARE_VARIABLE"),Kt="int",Bt="",Dt+=4;continue}else if(Wt==="v"&&zt==="e"&&kt[Dt+2]==="c"&&kt[Dt+3]==="2"&&kt[Dt+4]===" "){It.push("DECLARE_VARIABLE"),Kt="vec2",Bt="",Dt+=5;continue}else if(Wt==="v"&&zt==="e"&&kt[Dt+2]==="c"&&kt[Dt+3]==="3"&&kt[Dt+4]===" "){It.push("DECLARE_VARIABLE"),Kt="vec3",Bt="",Dt+=5;continue}else if(Wt==="v"&&zt==="e"&&kt[Dt+2]==="c"&&kt[Dt+3]==="4"&&kt[Dt+4]===" "){It.push("DECLARE_VARIABLE"),Kt="vec4",Bt="",Dt+=5;continue}}else if(Ht==="DECLARE_VARIABLE"){if(Bt===""){if(Wt===" "){Dt++;continue}if(!Ot.test(Wt))throw new Error("variable name is not expected string")}Bt+=Wt,Mt.test(zt)||(It.pop(),$t.push(Bt),Tt.push(Ct[Kt]))}Dt++}if(It.length>0)throw new Error("GLSL function was not parsable");return{argumentNames:$t,argumentTypes:Tt}}static nativeFunctionReturnType(kt){return Ct[kt.match(/int|float|vec[2-4]/)[0]]}static combineKernels(kt,Tt){kt.apply(null,arguments);const{texSize:$t,context:It,threadDim:Ot}=Tt.texSize;let Mt;if(Tt.precision==="single"){const Dt=$t[0],Bt=Math.ceil($t[1]/4);Mt=new Float32Array(Dt*Bt*4*4),It.readPixels(0,0,Dt,Bt*4,It.RGBA,It.FLOAT,Mt)}else{const Dt=new Uint8Array($t[0]*$t[1]*4);It.readPixels(0,0,$t[0],$t[1],It.RGBA,It.UNSIGNED_BYTE,Dt),Mt=new Float32Array(Dt.buffer)}if(Mt=Mt.subarray(0,Ot[0]*Ot[1]*Ot[2]),Tt.output.length===1)return Mt;if(Tt.output.length===2)return ot.splitArray(Mt,Tt.output[0]);if(Tt.output.length===3)return ot.splitArray(Mt,Tt.output[0]*Tt.output[1]).map(function(Bt){return ot.splitArray(Bt,Tt.output[0])})}constructor(kt,Tt){super(kt,Tt),this.transferValues=null,this.formatValues=null,this.TextureConstructor=null,this.renderOutput=null,this.renderRawOutput=null,this.texSize=null,this.translatedSource=null,this.compiledFragmentShader=null,this.compiledVertexShader=null,this.switchingKernels=null,this._textureSwitched=null,this._mappedTextureSwitched=null}checkTextureSize(){const{features:kt}=this.constructor;if(this.texSize[0]>kt.maxTextureSize||this.texSize[1]>kt.maxTextureSize)throw new Error(`Texture size [${this.texSize[0]},${this.texSize[1]}] generated by kernel is larger than supported size [${kt.maxTextureSize},${kt.maxTextureSize}]`)}translateSource(){throw new Error(`"translateSource" not defined on ${this.constructor.name}`)}pickRenderStrategy(kt){if(this.graphical)return this.renderRawOutput=this.readPackedPixelsToUint8Array,this.transferValues=Tt=>Tt,this.TextureConstructor=yt,null;if(this.precision==="unsigned")if(this.renderRawOutput=this.readPackedPixelsToUint8Array,this.transferValues=this.readPackedPixelsToFloat32Array,this.pipeline)switch(this.renderOutput=this.renderTexture,this.subKernels!==null&&(this.renderKernels=this.renderKernelsToTextures),this.returnType){case"LiteralInteger":case"Float":case"Number":case"Integer":return this.output[2]>0?(this.TextureConstructor=xt,null):this.output[1]>0?(this.TextureConstructor=St,null):(this.TextureConstructor=dt,null);case"Array(2)":case"Array(3)":case"Array(4)":return this.requestFallback(kt)}else switch(this.subKernels!==null&&(this.renderKernels=this.renderKernelsToArrays),this.returnType){case"LiteralInteger":case"Float":case"Number":case"Integer":return this.renderOutput=this.renderValues,this.output[2]>0?(this.TextureConstructor=xt,this.formatValues=ot.erect3DPackedFloat,null):this.output[1]>0?(this.TextureConstructor=St,this.formatValues=ot.erect2DPackedFloat,null):(this.TextureConstructor=dt,this.formatValues=ot.erectPackedFloat,null);case"Array(2)":case"Array(3)":case"Array(4)":return this.requestFallback(kt)}else if(this.precision==="single"){if(this.renderRawOutput=this.readFloatPixelsToFloat32Array,this.transferValues=this.readFloatPixelsToFloat32Array,this.pipeline)switch(this.renderOutput=this.renderTexture,this.subKernels!==null&&(this.renderKernels=this.renderKernelsToTextures),this.returnType){case"LiteralInteger":case"Float":case"Number":case"Integer":return this.optimizeFloatMemory?this.output[2]>0?(this.TextureConstructor=gt,null):this.output[1]>0?(this.TextureConstructor=mt,null):(this.TextureConstructor=pt,null):this.output[2]>0?(this.TextureConstructor=ut,null):this.output[1]>0?(this.TextureConstructor=ht,null):(this.TextureConstructor=ct,null);case"Array(2)":return this.output[2]>0?(this.TextureConstructor=it,null):this.output[1]>0?(this.TextureConstructor=nt,null):(this.TextureConstructor=at,null);case"Array(3)":return this.output[2]>0?(this.TextureConstructor=$,null):this.output[1]>0?(this.TextureConstructor=_,null):(this.TextureConstructor=j,null);case"Array(4)":return this.output[2]>0?(this.TextureConstructor=lt,null):this.output[1]>0?(this.TextureConstructor=st,null):(this.TextureConstructor=tt,null)}if(this.renderOutput=this.renderValues,this.subKernels!==null&&(this.renderKernels=this.renderKernelsToArrays),this.optimizeFloatMemory)switch(this.returnType){case"LiteralInteger":case"Float":case"Number":case"Integer":return this.output[2]>0?(this.TextureConstructor=gt,this.formatValues=ot.erectMemoryOptimized3DFloat,null):this.output[1]>0?(this.TextureConstructor=mt,this.formatValues=ot.erectMemoryOptimized2DFloat,null):(this.TextureConstructor=pt,this.formatValues=ot.erectMemoryOptimizedFloat,null);case"Array(2)":return this.output[2]>0?(this.TextureConstructor=it,this.formatValues=ot.erect3DArray2,null):this.output[1]>0?(this.TextureConstructor=nt,this.formatValues=ot.erect2DArray2,null):(this.TextureConstructor=at,this.formatValues=ot.erectArray2,null);case"Array(3)":return this.output[2]>0?(this.TextureConstructor=$,this.formatValues=ot.erect3DArray3,null):this.output[1]>0?(this.TextureConstructor=_,this.formatValues=ot.erect2DArray3,null):(this.TextureConstructor=j,this.formatValues=ot.erectArray3,null);case"Array(4)":return this.output[2]>0?(this.TextureConstructor=lt,this.formatValues=ot.erect3DArray4,null):this.output[1]>0?(this.TextureConstructor=st,this.formatValues=ot.erect2DArray4,null):(this.TextureConstructor=tt,this.formatValues=ot.erectArray4,null)}else switch(this.returnType){case"LiteralInteger":case"Float":case"Number":case"Integer":return this.output[2]>0?(this.TextureConstructor=ut,this.formatValues=ot.erect3DFloat,null):this.output[1]>0?(this.TextureConstructor=ht,this.formatValues=ot.erect2DFloat,null):(this.TextureConstructor=ct,this.formatValues=ot.erectFloat,null);case"Array(2)":return this.output[2]>0?(this.TextureConstructor=it,this.formatValues=ot.erect3DArray2,null):this.output[1]>0?(this.TextureConstructor=nt,this.formatValues=ot.erect2DArray2,null):(this.TextureConstructor=at,this.formatValues=ot.erectArray2,null);case"Array(3)":return this.output[2]>0?(this.TextureConstructor=$,this.formatValues=ot.erect3DArray3,null):this.output[1]>0?(this.TextureConstructor=_,this.formatValues=ot.erect2DArray3,null):(this.TextureConstructor=j,this.formatValues=ot.erectArray3,null);case"Array(4)":return this.output[2]>0?(this.TextureConstructor=lt,this.formatValues=ot.erect3DArray4,null):this.output[1]>0?(this.TextureConstructor=st,this.formatValues=ot.erect2DArray4,null):(this.TextureConstructor=tt,this.formatValues=ot.erectArray4,null)}}else throw new Error(`unhandled precision of "${this.precision}"`);throw new Error(`unhandled return type "${this.returnType}"`)}getKernelString(){throw new Error("abstract method call")}getMainResultTexture(){switch(this.returnType){case"LiteralInteger":case"Float":case"Integer":case"Number":return this.getMainResultNumberTexture();case"Array(2)":return this.getMainResultArray2Texture();case"Array(3)":return this.getMainResultArray3Texture();case"Array(4)":return this.getMainResultArray4Texture();default:throw new Error(`unhandled returnType type ${this.returnType}`)}}getMainResultKernelNumberTexture(){throw new Error("abstract method call")}getMainResultSubKernelNumberTexture(){throw new Error("abstract method call")}getMainResultKernelArray2Texture(){throw new Error("abstract method call")}getMainResultSubKernelArray2Texture(){throw new Error("abstract method call")}getMainResultKernelArray3Texture(){throw new Error("abstract method call")}getMainResultSubKernelArray3Texture(){throw new Error("abstract method call")}getMainResultKernelArray4Texture(){throw new Error("abstract method call")}getMainResultSubKernelArray4Texture(){throw new Error("abstract method call")}getMainResultGraphical(){throw new Error("abstract method call")}getMainResultMemoryOptimizedFloats(){throw new Error("abstract method call")}getMainResultPackedPixels(){throw new Error("abstract method call")}getMainResultString(){return this.graphical?this.getMainResultGraphical():this.precision==="single"?this.optimizeFloatMemory?this.getMainResultMemoryOptimizedFloats():this.getMainResultTexture():this.getMainResultPackedPixels()}getMainResultNumberTexture(){return ot.linesToString(this.getMainResultKernelNumberTexture())+ot.linesToString(this.getMainResultSubKernelNumberTexture())}getMainResultArray2Texture(){return ot.linesToString(this.getMainResultKernelArray2Texture())+ot.linesToString(this.getMainResultSubKernelArray2Texture())}getMainResultArray3Texture(){return ot.linesToString(this.getMainResultKernelArray3Texture())+ot.linesToString(this.getMainResultSubKernelArray3Texture())}getMainResultArray4Texture(){return ot.linesToString(this.getMainResultKernelArray4Texture())+ot.linesToString(this.getMainResultSubKernelArray4Texture())}getFloatTacticDeclaration(){return`precision ${this.getVariablePrecisionString(this.texSize,this.tactic)} float; +`){It.pop(),Dt++;continue}else if(Ht===null&&Wt==="("){It.push("FUNCTION_ARGUMENTS"),Dt++;continue}else if(Ht==="FUNCTION_ARGUMENTS"){if(Wt===")"){It.pop();break}if(Wt==="f"&&zt==="l"&&kt[Dt+2]==="o"&&kt[Dt+3]==="a"&&kt[Dt+4]==="t"&&kt[Dt+5]===" "){It.push("DECLARE_VARIABLE"),Kt="float",Bt="",Dt+=6;continue}else if(Wt==="i"&&zt==="n"&&kt[Dt+2]==="t"&&kt[Dt+3]===" "){It.push("DECLARE_VARIABLE"),Kt="int",Bt="",Dt+=4;continue}else if(Wt==="v"&&zt==="e"&&kt[Dt+2]==="c"&&kt[Dt+3]==="2"&&kt[Dt+4]===" "){It.push("DECLARE_VARIABLE"),Kt="vec2",Bt="",Dt+=5;continue}else if(Wt==="v"&&zt==="e"&&kt[Dt+2]==="c"&&kt[Dt+3]==="3"&&kt[Dt+4]===" "){It.push("DECLARE_VARIABLE"),Kt="vec3",Bt="",Dt+=5;continue}else if(Wt==="v"&&zt==="e"&&kt[Dt+2]==="c"&&kt[Dt+3]==="4"&&kt[Dt+4]===" "){It.push("DECLARE_VARIABLE"),Kt="vec4",Bt="",Dt+=5;continue}}else if(Ht==="DECLARE_VARIABLE"){if(Bt===""){if(Wt===" "){Dt++;continue}if(!Ot.test(Wt))throw new Error("variable name is not expected string")}Bt+=Wt,Mt.test(zt)||(It.pop(),$t.push(Bt),Tt.push(Ct[Kt]))}Dt++}if(It.length>0)throw new Error("GLSL function was not parsable");return{argumentNames:$t,argumentTypes:Tt}}static nativeFunctionReturnType(kt){return Ct[kt.match(/int|float|vec[2-4]/)[0]]}static combineKernels(kt,Tt){kt.apply(null,arguments);const{texSize:$t,context:It,threadDim:Ot}=Tt.texSize;let Mt;if(Tt.precision==="single"){const Dt=$t[0],Bt=Math.ceil($t[1]/4);Mt=new Float32Array(Dt*Bt*4*4),It.readPixels(0,0,Dt,Bt*4,It.RGBA,It.FLOAT,Mt)}else{const Dt=new Uint8Array($t[0]*$t[1]*4);It.readPixels(0,0,$t[0],$t[1],It.RGBA,It.UNSIGNED_BYTE,Dt),Mt=new Float32Array(Dt.buffer)}if(Mt=Mt.subarray(0,Ot[0]*Ot[1]*Ot[2]),Tt.output.length===1)return Mt;if(Tt.output.length===2)return ot.splitArray(Mt,Tt.output[0]);if(Tt.output.length===3)return ot.splitArray(Mt,Tt.output[0]*Tt.output[1]).map(function(Bt){return ot.splitArray(Bt,Tt.output[0])})}constructor(kt,Tt){super(kt,Tt),this.transferValues=null,this.formatValues=null,this.TextureConstructor=null,this.renderOutput=null,this.renderRawOutput=null,this.texSize=null,this.translatedSource=null,this.compiledFragmentShader=null,this.compiledVertexShader=null,this.switchingKernels=null,this._textureSwitched=null,this._mappedTextureSwitched=null}checkTextureSize(){const{features:kt}=this.constructor;if(this.texSize[0]>kt.maxTextureSize||this.texSize[1]>kt.maxTextureSize)throw new Error(`Texture size [${this.texSize[0]},${this.texSize[1]}] generated by kernel is larger than supported size [${kt.maxTextureSize},${kt.maxTextureSize}]`)}translateSource(){throw new Error(`"translateSource" not defined on ${this.constructor.name}`)}pickRenderStrategy(kt){if(this.graphical)return this.renderRawOutput=this.readPackedPixelsToUint8Array,this.transferValues=Tt=>Tt,this.TextureConstructor=yt,null;if(this.precision==="unsigned")if(this.renderRawOutput=this.readPackedPixelsToUint8Array,this.transferValues=this.readPackedPixelsToFloat32Array,this.pipeline)switch(this.renderOutput=this.renderTexture,this.subKernels!==null&&(this.renderKernels=this.renderKernelsToTextures),this.returnType){case"LiteralInteger":case"Float":case"Number":case"Integer":return this.output[2]>0?(this.TextureConstructor=xt,null):this.output[1]>0?(this.TextureConstructor=St,null):(this.TextureConstructor=dt,null);case"Array(2)":case"Array(3)":case"Array(4)":return this.requestFallback(kt)}else switch(this.subKernels!==null&&(this.renderKernels=this.renderKernelsToArrays),this.returnType){case"LiteralInteger":case"Float":case"Number":case"Integer":return this.renderOutput=this.renderValues,this.output[2]>0?(this.TextureConstructor=xt,this.formatValues=ot.erect3DPackedFloat,null):this.output[1]>0?(this.TextureConstructor=St,this.formatValues=ot.erect2DPackedFloat,null):(this.TextureConstructor=dt,this.formatValues=ot.erectPackedFloat,null);case"Array(2)":case"Array(3)":case"Array(4)":return this.requestFallback(kt)}else if(this.precision==="single"){if(this.renderRawOutput=this.readFloatPixelsToFloat32Array,this.transferValues=this.readFloatPixelsToFloat32Array,this.pipeline)switch(this.renderOutput=this.renderTexture,this.subKernels!==null&&(this.renderKernels=this.renderKernelsToTextures),this.returnType){case"LiteralInteger":case"Float":case"Number":case"Integer":return this.optimizeFloatMemory?this.output[2]>0?(this.TextureConstructor=gt,null):this.output[1]>0?(this.TextureConstructor=mt,null):(this.TextureConstructor=pt,null):this.output[2]>0?(this.TextureConstructor=ut,null):this.output[1]>0?(this.TextureConstructor=ht,null):(this.TextureConstructor=ct,null);case"Array(2)":return this.output[2]>0?(this.TextureConstructor=it,null):this.output[1]>0?(this.TextureConstructor=nt,null):(this.TextureConstructor=at,null);case"Array(3)":return this.output[2]>0?(this.TextureConstructor=$,null):this.output[1]>0?(this.TextureConstructor=_,null):(this.TextureConstructor=j,null);case"Array(4)":return this.output[2]>0?(this.TextureConstructor=lt,null):this.output[1]>0?(this.TextureConstructor=st,null):(this.TextureConstructor=et,null)}if(this.renderOutput=this.renderValues,this.subKernels!==null&&(this.renderKernels=this.renderKernelsToArrays),this.optimizeFloatMemory)switch(this.returnType){case"LiteralInteger":case"Float":case"Number":case"Integer":return this.output[2]>0?(this.TextureConstructor=gt,this.formatValues=ot.erectMemoryOptimized3DFloat,null):this.output[1]>0?(this.TextureConstructor=mt,this.formatValues=ot.erectMemoryOptimized2DFloat,null):(this.TextureConstructor=pt,this.formatValues=ot.erectMemoryOptimizedFloat,null);case"Array(2)":return this.output[2]>0?(this.TextureConstructor=it,this.formatValues=ot.erect3DArray2,null):this.output[1]>0?(this.TextureConstructor=nt,this.formatValues=ot.erect2DArray2,null):(this.TextureConstructor=at,this.formatValues=ot.erectArray2,null);case"Array(3)":return this.output[2]>0?(this.TextureConstructor=$,this.formatValues=ot.erect3DArray3,null):this.output[1]>0?(this.TextureConstructor=_,this.formatValues=ot.erect2DArray3,null):(this.TextureConstructor=j,this.formatValues=ot.erectArray3,null);case"Array(4)":return this.output[2]>0?(this.TextureConstructor=lt,this.formatValues=ot.erect3DArray4,null):this.output[1]>0?(this.TextureConstructor=st,this.formatValues=ot.erect2DArray4,null):(this.TextureConstructor=et,this.formatValues=ot.erectArray4,null)}else switch(this.returnType){case"LiteralInteger":case"Float":case"Number":case"Integer":return this.output[2]>0?(this.TextureConstructor=ut,this.formatValues=ot.erect3DFloat,null):this.output[1]>0?(this.TextureConstructor=ht,this.formatValues=ot.erect2DFloat,null):(this.TextureConstructor=ct,this.formatValues=ot.erectFloat,null);case"Array(2)":return this.output[2]>0?(this.TextureConstructor=it,this.formatValues=ot.erect3DArray2,null):this.output[1]>0?(this.TextureConstructor=nt,this.formatValues=ot.erect2DArray2,null):(this.TextureConstructor=at,this.formatValues=ot.erectArray2,null);case"Array(3)":return this.output[2]>0?(this.TextureConstructor=$,this.formatValues=ot.erect3DArray3,null):this.output[1]>0?(this.TextureConstructor=_,this.formatValues=ot.erect2DArray3,null):(this.TextureConstructor=j,this.formatValues=ot.erectArray3,null);case"Array(4)":return this.output[2]>0?(this.TextureConstructor=lt,this.formatValues=ot.erect3DArray4,null):this.output[1]>0?(this.TextureConstructor=st,this.formatValues=ot.erect2DArray4,null):(this.TextureConstructor=et,this.formatValues=ot.erectArray4,null)}}else throw new Error(`unhandled precision of "${this.precision}"`);throw new Error(`unhandled return type "${this.returnType}"`)}getKernelString(){throw new Error("abstract method call")}getMainResultTexture(){switch(this.returnType){case"LiteralInteger":case"Float":case"Integer":case"Number":return this.getMainResultNumberTexture();case"Array(2)":return this.getMainResultArray2Texture();case"Array(3)":return this.getMainResultArray3Texture();case"Array(4)":return this.getMainResultArray4Texture();default:throw new Error(`unhandled returnType type ${this.returnType}`)}}getMainResultKernelNumberTexture(){throw new Error("abstract method call")}getMainResultSubKernelNumberTexture(){throw new Error("abstract method call")}getMainResultKernelArray2Texture(){throw new Error("abstract method call")}getMainResultSubKernelArray2Texture(){throw new Error("abstract method call")}getMainResultKernelArray3Texture(){throw new Error("abstract method call")}getMainResultSubKernelArray3Texture(){throw new Error("abstract method call")}getMainResultKernelArray4Texture(){throw new Error("abstract method call")}getMainResultSubKernelArray4Texture(){throw new Error("abstract method call")}getMainResultGraphical(){throw new Error("abstract method call")}getMainResultMemoryOptimizedFloats(){throw new Error("abstract method call")}getMainResultPackedPixels(){throw new Error("abstract method call")}getMainResultString(){return this.graphical?this.getMainResultGraphical():this.precision==="single"?this.optimizeFloatMemory?this.getMainResultMemoryOptimizedFloats():this.getMainResultTexture():this.getMainResultPackedPixels()}getMainResultNumberTexture(){return ot.linesToString(this.getMainResultKernelNumberTexture())+ot.linesToString(this.getMainResultSubKernelNumberTexture())}getMainResultArray2Texture(){return ot.linesToString(this.getMainResultKernelArray2Texture())+ot.linesToString(this.getMainResultSubKernelArray2Texture())}getMainResultArray3Texture(){return ot.linesToString(this.getMainResultKernelArray3Texture())+ot.linesToString(this.getMainResultSubKernelArray3Texture())}getMainResultArray4Texture(){return ot.linesToString(this.getMainResultKernelArray4Texture())+ot.linesToString(this.getMainResultSubKernelArray4Texture())}getFloatTacticDeclaration(){return`precision ${this.getVariablePrecisionString(this.texSize,this.tactic)} float; `}getIntTacticDeclaration(){return`precision ${this.getVariablePrecisionString(this.texSize,this.tactic,!0)} int; `}getSampler2DTacticDeclaration(){return`precision ${this.getVariablePrecisionString(this.texSize,this.tactic)} sampler2D; `}getSampler2DArrayTacticDeclaration(){return`precision ${this.getVariablePrecisionString(this.texSize,this.tactic)} sampler2DArray; -`}renderTexture(){return this.immutable?this.texture.clone():this.texture}readPackedPixelsToUint8Array(){if(this.precision!=="unsigned")throw new Error('Requires this.precision to be "unsigned"');const{texSize:kt,context:Tt}=this,$t=new Uint8Array(kt[0]*kt[1]*4);return Tt.readPixels(0,0,kt[0],kt[1],Tt.RGBA,Tt.UNSIGNED_BYTE,$t),$t}readPackedPixelsToFloat32Array(){return new Float32Array(this.readPackedPixelsToUint8Array().buffer)}readFloatPixelsToFloat32Array(){if(this.precision!=="single")throw new Error('Requires this.precision to be "single"');const{texSize:kt,context:Tt}=this,$t=kt[0],It=kt[1],Ot=new Float32Array($t*It*4);return Tt.readPixels(0,0,$t,It,Tt.RGBA,Tt.FLOAT,Ot),Ot}getPixels(kt){const{context:Tt,output:$t}=this,[It,Ot]=$t,Mt=new Uint8Array(It*Ot*4);return Tt.readPixels(0,0,It,Ot,Tt.RGBA,Tt.UNSIGNED_BYTE,Mt),new Uint8ClampedArray((kt?Mt:ot.flipPixels(Mt,It,Ot)).buffer)}renderKernelsToArrays(){const kt={result:this.renderOutput()};for(let Tt=0;Tt0){for(let Dt=0;Dt0){const{mappedTextures:$t}=this;for(let It=0;It<$t.length;It++){const Ot=$t[It];if(Ot.texture===Tt.texture){const{prevArg:Mt}=kt;Mt&&(Mt.texture._refs===1&&(Ot.delete(),$t[It]=Mt.clone(),this._mappedTextureSwitched[It]=!0),Mt.delete()),kt.prevArg=Tt.clone();return}}}}}onActivate(kt){if(this._textureSwitched=!0,this.texture=kt.texture,this.mappedTextures){for(let Tt=0;Tt1?(this.newTexture(),!0):!1}cloneTexture(){this.texture._refs--;const{context:it,size:j,texture:_,kernel:$}=this;$.debug&&console.warn("cloning internal texture"),it.bindFramebuffer(it.FRAMEBUFFER,this.framebuffer()),at(it,_),it.framebufferTexture2D(it.FRAMEBUFFER,it.COLOR_ATTACHMENT0,it.TEXTURE_2D,_,0);const tt=it.createTexture();at(it,tt),it.texImage2D(it.TEXTURE_2D,0,this.internalFormat,j[0],j[1],0,this.textureFormat,this.textureType,null),it.copyTexSubImage2D(it.TEXTURE_2D,0,0,0,0,0,j[0],j[1]),tt._refs=1,this.texture=tt}newTexture(){this.texture._refs--;const it=this.context,j=this.size;this.kernel.debug&&console.warn("new internal texture");const $=it.createTexture();at(it,$),it.texImage2D(it.TEXTURE_2D,0,this.internalFormat,j[0],j[1],0,this.textureFormat,this.textureType,null),$._refs=1,this.texture=$}clear(){if(this.texture._refs){this.texture._refs--;const _=this.context,$=this.texture=_.createTexture();at(_,$);const tt=this.size;$._refs=1,_.texImage2D(_.TEXTURE_2D,0,this.internalFormat,tt[0],tt[1],0,this.textureFormat,this.textureType,null)}const{context:it,texture:j}=this;it.bindFramebuffer(it.FRAMEBUFFER,this.framebuffer()),it.bindTexture(it.TEXTURE_2D,j),at(it,j),it.framebufferTexture2D(it.FRAMEBUFFER,it.COLOR_ATTACHMENT0,it.TEXTURE_2D,j,0),it.clearColor(0,0,0,0),it.clear(it.COLOR_BUFFER_BIT|it.DEPTH_BUFFER_BIT)}delete(){this._deleted||(this._deleted=!0,!(this.texture._refs&&(this.texture._refs--,this.texture._refs))&&this.context.deleteTexture(this.texture))}framebuffer(){return this._framebuffer||(this._framebuffer=this.kernel.getRawValueFramebuffer(this.size[0],this.size[1])),this._framebuffer}}function at(nt,it){nt.activeTexture(nt.TEXTURE15),nt.bindTexture(nt.TEXTURE_2D,it),nt.texParameteri(nt.TEXTURE_2D,nt.TEXTURE_WRAP_S,nt.CLAMP_TO_EDGE),nt.texParameteri(nt.TEXTURE_2D,nt.TEXTURE_WRAP_T,nt.CLAMP_TO_EDGE),nt.texParameteri(nt.TEXTURE_2D,nt.TEXTURE_MIN_FILTER,nt.NEAREST),nt.texParameteri(nt.TEXTURE_2D,nt.TEXTURE_MAG_FILTER,nt.NEAREST)}a.exports={GLTexture:ot}},{"../../../texture":113}],28:[function(o,a,rt){const{utils:et}=o("../../../utils"),{GLTextureFloat:ot}=o("./float");class at extends ot{constructor(it){super(it),this.type="MemoryOptimizedNumberTexture"}toArray(){return et.erectMemoryOptimized2DFloat(this.renderValues(),this.output[0],this.output[1])}}a.exports={GLTextureMemoryOptimized2D:at}},{"../../../utils":114,"./float":25}],29:[function(o,a,rt){const{utils:et}=o("../../../utils"),{GLTextureFloat:ot}=o("./float");class at extends ot{constructor(it){super(it),this.type="MemoryOptimizedNumberTexture"}toArray(){return et.erectMemoryOptimized3DFloat(this.renderValues(),this.output[0],this.output[1],this.output[2])}}a.exports={GLTextureMemoryOptimized3D:at}},{"../../../utils":114,"./float":25}],30:[function(o,a,rt){const{utils:et}=o("../../../utils"),{GLTextureFloat:ot}=o("./float");class at extends ot{constructor(it){super(it),this.type="MemoryOptimizedNumberTexture"}toArray(){return et.erectMemoryOptimizedFloat(this.renderValues(),this.output[0])}}a.exports={GLTextureMemoryOptimized:at}},{"../../../utils":114,"./float":25}],31:[function(o,a,rt){const{utils:et}=o("../../../utils"),{GLTextureUnsigned:ot}=o("./unsigned");class at extends ot{constructor(it){super(it),this.type="NumberTexture"}toArray(){return et.erect2DPackedFloat(this.renderValues(),this.output[0],this.output[1])}}a.exports={GLTextureUnsigned2D:at}},{"../../../utils":114,"./unsigned":33}],32:[function(o,a,rt){const{utils:et}=o("../../../utils"),{GLTextureUnsigned:ot}=o("./unsigned");class at extends ot{constructor(it){super(it),this.type="NumberTexture"}toArray(){return et.erect3DPackedFloat(this.renderValues(),this.output[0],this.output[1],this.output[2])}}a.exports={GLTextureUnsigned3D:at}},{"../../../utils":114,"./unsigned":33}],33:[function(o,a,rt){const{utils:et}=o("../../../utils"),{GLTexture:ot}=o("./index");class at extends ot{get textureType(){return this.context.UNSIGNED_BYTE}constructor(it){super(it),this.type="NumberTexture"}renderRawOutput(){const{context:it}=this;it.bindFramebuffer(it.FRAMEBUFFER,this.framebuffer()),it.framebufferTexture2D(it.FRAMEBUFFER,it.COLOR_ATTACHMENT0,it.TEXTURE_2D,this.texture,0);const j=new Uint8Array(this.size[0]*this.size[1]*4);return it.readPixels(0,0,this.size[0],this.size[1],it.RGBA,it.UNSIGNED_BYTE,j),j}renderValues(){return this._deleted?null:new Float32Array(this.renderRawOutput().buffer)}toArray(){return et.erectPackedFloat(this.renderValues(),this.output[0])}}a.exports={GLTextureUnsigned:at}},{"../../../utils":114,"./index":27}],34:[function(o,a,rt){const et=o("gl"),{WebGLKernel:ot}=o("../web-gl/kernel"),{glKernelString:at}=o("../gl/kernel-string");let nt=null,it=null,j=null,_=null,$=null;class tt extends ot{static get isSupported(){return nt!==null||(this.setupFeatureChecks(),nt=j!==null),nt}static setupFeatureChecks(){if(it=null,_=null,typeof et=="function")try{if(j=et(2,2,{preserveDrawingBuffer:!0}),!j||!j.getExtension)return;_={STACKGL_resize_drawingbuffer:j.getExtension("STACKGL_resize_drawingbuffer"),STACKGL_destroy_context:j.getExtension("STACKGL_destroy_context"),OES_texture_float:j.getExtension("OES_texture_float"),OES_texture_float_linear:j.getExtension("OES_texture_float_linear"),OES_element_index_uint:j.getExtension("OES_element_index_uint"),WEBGL_draw_buffers:j.getExtension("WEBGL_draw_buffers"),WEBGL_color_buffer_float:j.getExtension("WEBGL_color_buffer_float")},$=this.getFeatures()}catch(lt){console.warn(lt)}}static isContextMatch(lt){try{return lt.getParameter(lt.RENDERER)==="ANGLE"}catch{return!1}}static getIsTextureFloat(){return!!_.OES_texture_float}static getIsDrawBuffers(){return!!_.WEBGL_draw_buffers}static getChannelCount(){return _.WEBGL_draw_buffers?j.getParameter(_.WEBGL_draw_buffers.MAX_DRAW_BUFFERS_WEBGL):1}static getMaxTextureSize(){return j.getParameter(j.MAX_TEXTURE_SIZE)}static get testCanvas(){return it}static get testContext(){return j}static get features(){return $}initCanvas(){return{}}initContext(){return et(2,2,{preserveDrawingBuffer:!0})}initExtensions(){this.extensions={STACKGL_resize_drawingbuffer:this.context.getExtension("STACKGL_resize_drawingbuffer"),STACKGL_destroy_context:this.context.getExtension("STACKGL_destroy_context"),OES_texture_float:this.context.getExtension("OES_texture_float"),OES_texture_float_linear:this.context.getExtension("OES_texture_float_linear"),OES_element_index_uint:this.context.getExtension("OES_element_index_uint"),WEBGL_draw_buffers:this.context.getExtension("WEBGL_draw_buffers")}}build(){super.build.apply(this,arguments),this.fallbackRequested||this.extensions.STACKGL_resize_drawingbuffer.resize(this.maxTexSize[0],this.maxTexSize[1])}destroyExtensions(){this.extensions.STACKGL_resize_drawingbuffer=null,this.extensions.STACKGL_destroy_context=null,this.extensions.OES_texture_float=null,this.extensions.OES_texture_float_linear=null,this.extensions.OES_element_index_uint=null,this.extensions.WEBGL_draw_buffers=null}static destroyContext(lt){const ct=lt.getExtension("STACKGL_destroy_context");ct&&ct.destroy&&ct.destroy()}toString(){return at(this.constructor,arguments,this,`const gl = context || require('gl')(1, 1); +`}renderTexture(){return this.immutable?this.texture.clone():this.texture}readPackedPixelsToUint8Array(){if(this.precision!=="unsigned")throw new Error('Requires this.precision to be "unsigned"');const{texSize:kt,context:Tt}=this,$t=new Uint8Array(kt[0]*kt[1]*4);return Tt.readPixels(0,0,kt[0],kt[1],Tt.RGBA,Tt.UNSIGNED_BYTE,$t),$t}readPackedPixelsToFloat32Array(){return new Float32Array(this.readPackedPixelsToUint8Array().buffer)}readFloatPixelsToFloat32Array(){if(this.precision!=="single")throw new Error('Requires this.precision to be "single"');const{texSize:kt,context:Tt}=this,$t=kt[0],It=kt[1],Ot=new Float32Array($t*It*4);return Tt.readPixels(0,0,$t,It,Tt.RGBA,Tt.FLOAT,Ot),Ot}getPixels(kt){const{context:Tt,output:$t}=this,[It,Ot]=$t,Mt=new Uint8Array(It*Ot*4);return Tt.readPixels(0,0,It,Ot,Tt.RGBA,Tt.UNSIGNED_BYTE,Mt),new Uint8ClampedArray((kt?Mt:ot.flipPixels(Mt,It,Ot)).buffer)}renderKernelsToArrays(){const kt={result:this.renderOutput()};for(let Tt=0;Tt0){for(let Dt=0;Dt0){const{mappedTextures:$t}=this;for(let It=0;It<$t.length;It++){const Ot=$t[It];if(Ot.texture===Tt.texture){const{prevArg:Mt}=kt;Mt&&(Mt.texture._refs===1&&(Ot.delete(),$t[It]=Mt.clone(),this._mappedTextureSwitched[It]=!0),Mt.delete()),kt.prevArg=Tt.clone();return}}}}}onActivate(kt){if(this._textureSwitched=!0,this.texture=kt.texture,this.mappedTextures){for(let Tt=0;Tt1?(this.newTexture(),!0):!1}cloneTexture(){this.texture._refs--;const{context:it,size:j,texture:_,kernel:$}=this;$.debug&&console.warn("cloning internal texture"),it.bindFramebuffer(it.FRAMEBUFFER,this.framebuffer()),at(it,_),it.framebufferTexture2D(it.FRAMEBUFFER,it.COLOR_ATTACHMENT0,it.TEXTURE_2D,_,0);const et=it.createTexture();at(it,et),it.texImage2D(it.TEXTURE_2D,0,this.internalFormat,j[0],j[1],0,this.textureFormat,this.textureType,null),it.copyTexSubImage2D(it.TEXTURE_2D,0,0,0,0,0,j[0],j[1]),et._refs=1,this.texture=et}newTexture(){this.texture._refs--;const it=this.context,j=this.size;this.kernel.debug&&console.warn("new internal texture");const $=it.createTexture();at(it,$),it.texImage2D(it.TEXTURE_2D,0,this.internalFormat,j[0],j[1],0,this.textureFormat,this.textureType,null),$._refs=1,this.texture=$}clear(){if(this.texture._refs){this.texture._refs--;const _=this.context,$=this.texture=_.createTexture();at(_,$);const et=this.size;$._refs=1,_.texImage2D(_.TEXTURE_2D,0,this.internalFormat,et[0],et[1],0,this.textureFormat,this.textureType,null)}const{context:it,texture:j}=this;it.bindFramebuffer(it.FRAMEBUFFER,this.framebuffer()),it.bindTexture(it.TEXTURE_2D,j),at(it,j),it.framebufferTexture2D(it.FRAMEBUFFER,it.COLOR_ATTACHMENT0,it.TEXTURE_2D,j,0),it.clearColor(0,0,0,0),it.clear(it.COLOR_BUFFER_BIT|it.DEPTH_BUFFER_BIT)}delete(){this._deleted||(this._deleted=!0,!(this.texture._refs&&(this.texture._refs--,this.texture._refs))&&this.context.deleteTexture(this.texture))}framebuffer(){return this._framebuffer||(this._framebuffer=this.kernel.getRawValueFramebuffer(this.size[0],this.size[1])),this._framebuffer}}function at(nt,it){nt.activeTexture(nt.TEXTURE15),nt.bindTexture(nt.TEXTURE_2D,it),nt.texParameteri(nt.TEXTURE_2D,nt.TEXTURE_WRAP_S,nt.CLAMP_TO_EDGE),nt.texParameteri(nt.TEXTURE_2D,nt.TEXTURE_WRAP_T,nt.CLAMP_TO_EDGE),nt.texParameteri(nt.TEXTURE_2D,nt.TEXTURE_MIN_FILTER,nt.NEAREST),nt.texParameteri(nt.TEXTURE_2D,nt.TEXTURE_MAG_FILTER,nt.NEAREST)}a.exports={GLTexture:ot}},{"../../../texture":113}],28:[function(o,a,rt){const{utils:tt}=o("../../../utils"),{GLTextureFloat:ot}=o("./float");class at extends ot{constructor(it){super(it),this.type="MemoryOptimizedNumberTexture"}toArray(){return tt.erectMemoryOptimized2DFloat(this.renderValues(),this.output[0],this.output[1])}}a.exports={GLTextureMemoryOptimized2D:at}},{"../../../utils":114,"./float":25}],29:[function(o,a,rt){const{utils:tt}=o("../../../utils"),{GLTextureFloat:ot}=o("./float");class at extends ot{constructor(it){super(it),this.type="MemoryOptimizedNumberTexture"}toArray(){return tt.erectMemoryOptimized3DFloat(this.renderValues(),this.output[0],this.output[1],this.output[2])}}a.exports={GLTextureMemoryOptimized3D:at}},{"../../../utils":114,"./float":25}],30:[function(o,a,rt){const{utils:tt}=o("../../../utils"),{GLTextureFloat:ot}=o("./float");class at extends ot{constructor(it){super(it),this.type="MemoryOptimizedNumberTexture"}toArray(){return tt.erectMemoryOptimizedFloat(this.renderValues(),this.output[0])}}a.exports={GLTextureMemoryOptimized:at}},{"../../../utils":114,"./float":25}],31:[function(o,a,rt){const{utils:tt}=o("../../../utils"),{GLTextureUnsigned:ot}=o("./unsigned");class at extends ot{constructor(it){super(it),this.type="NumberTexture"}toArray(){return tt.erect2DPackedFloat(this.renderValues(),this.output[0],this.output[1])}}a.exports={GLTextureUnsigned2D:at}},{"../../../utils":114,"./unsigned":33}],32:[function(o,a,rt){const{utils:tt}=o("../../../utils"),{GLTextureUnsigned:ot}=o("./unsigned");class at extends ot{constructor(it){super(it),this.type="NumberTexture"}toArray(){return tt.erect3DPackedFloat(this.renderValues(),this.output[0],this.output[1],this.output[2])}}a.exports={GLTextureUnsigned3D:at}},{"../../../utils":114,"./unsigned":33}],33:[function(o,a,rt){const{utils:tt}=o("../../../utils"),{GLTexture:ot}=o("./index");class at extends ot{get textureType(){return this.context.UNSIGNED_BYTE}constructor(it){super(it),this.type="NumberTexture"}renderRawOutput(){const{context:it}=this;it.bindFramebuffer(it.FRAMEBUFFER,this.framebuffer()),it.framebufferTexture2D(it.FRAMEBUFFER,it.COLOR_ATTACHMENT0,it.TEXTURE_2D,this.texture,0);const j=new Uint8Array(this.size[0]*this.size[1]*4);return it.readPixels(0,0,this.size[0],this.size[1],it.RGBA,it.UNSIGNED_BYTE,j),j}renderValues(){return this._deleted?null:new Float32Array(this.renderRawOutput().buffer)}toArray(){return tt.erectPackedFloat(this.renderValues(),this.output[0])}}a.exports={GLTextureUnsigned:at}},{"../../../utils":114,"./index":27}],34:[function(o,a,rt){const tt=o("gl"),{WebGLKernel:ot}=o("../web-gl/kernel"),{glKernelString:at}=o("../gl/kernel-string");let nt=null,it=null,j=null,_=null,$=null;class et extends ot{static get isSupported(){return nt!==null||(this.setupFeatureChecks(),nt=j!==null),nt}static setupFeatureChecks(){if(it=null,_=null,typeof tt=="function")try{if(j=tt(2,2,{preserveDrawingBuffer:!0}),!j||!j.getExtension)return;_={STACKGL_resize_drawingbuffer:j.getExtension("STACKGL_resize_drawingbuffer"),STACKGL_destroy_context:j.getExtension("STACKGL_destroy_context"),OES_texture_float:j.getExtension("OES_texture_float"),OES_texture_float_linear:j.getExtension("OES_texture_float_linear"),OES_element_index_uint:j.getExtension("OES_element_index_uint"),WEBGL_draw_buffers:j.getExtension("WEBGL_draw_buffers"),WEBGL_color_buffer_float:j.getExtension("WEBGL_color_buffer_float")},$=this.getFeatures()}catch(lt){console.warn(lt)}}static isContextMatch(lt){try{return lt.getParameter(lt.RENDERER)==="ANGLE"}catch{return!1}}static getIsTextureFloat(){return!!_.OES_texture_float}static getIsDrawBuffers(){return!!_.WEBGL_draw_buffers}static getChannelCount(){return _.WEBGL_draw_buffers?j.getParameter(_.WEBGL_draw_buffers.MAX_DRAW_BUFFERS_WEBGL):1}static getMaxTextureSize(){return j.getParameter(j.MAX_TEXTURE_SIZE)}static get testCanvas(){return it}static get testContext(){return j}static get features(){return $}initCanvas(){return{}}initContext(){return tt(2,2,{preserveDrawingBuffer:!0})}initExtensions(){this.extensions={STACKGL_resize_drawingbuffer:this.context.getExtension("STACKGL_resize_drawingbuffer"),STACKGL_destroy_context:this.context.getExtension("STACKGL_destroy_context"),OES_texture_float:this.context.getExtension("OES_texture_float"),OES_texture_float_linear:this.context.getExtension("OES_texture_float_linear"),OES_element_index_uint:this.context.getExtension("OES_element_index_uint"),WEBGL_draw_buffers:this.context.getExtension("WEBGL_draw_buffers")}}build(){super.build.apply(this,arguments),this.fallbackRequested||this.extensions.STACKGL_resize_drawingbuffer.resize(this.maxTexSize[0],this.maxTexSize[1])}destroyExtensions(){this.extensions.STACKGL_resize_drawingbuffer=null,this.extensions.STACKGL_destroy_context=null,this.extensions.OES_texture_float=null,this.extensions.OES_texture_float_linear=null,this.extensions.OES_element_index_uint=null,this.extensions.WEBGL_draw_buffers=null}static destroyContext(lt){const ct=lt.getExtension("STACKGL_destroy_context");ct&&ct.destroy&&ct.destroy()}toString(){return at(this.constructor,arguments,this,`const gl = context || require('gl')(1, 1); `,` if (!context) { gl.getExtension('STACKGL_destroy_context').destroy(); } -`)}setOutput(lt){return super.setOutput(lt),this.graphical&&this.extensions.STACKGL_resize_drawingbuffer&&this.extensions.STACKGL_resize_drawingbuffer.resize(this.maxTexSize[0],this.maxTexSize[1]),this}}a.exports={HeadlessGLKernel:tt}},{"../gl/kernel-string":12,"../web-gl/kernel":70,gl:2}],35:[function(o,a,rt){class et{constructor(at,nt){const{name:it,kernel:j,context:_,checkContext:$,onRequestContextHandle:tt,onUpdateValueMismatch:st,origin:lt,strictIntegers:ct,type:ht,tactic:ut}=nt;if(!it)throw new Error("name not set");if(!ht)throw new Error("type not set");if(!lt)throw new Error("origin not set");if(lt!=="user"&<!=="constants")throw new Error(`origin must be "user" or "constants" value is "${lt}"`);if(!tt)throw new Error("onRequestContextHandle is not set");this.name=it,this.origin=lt,this.tactic=ut,this.varName=lt==="constants"?`constants.${it}`:it,this.kernel=j,this.strictIntegers=ct,this.type=at.type||ht,this.size=at.size||null,this.index=null,this.context=_,this.checkContext=$??!0,this.contextHandle=null,this.onRequestContextHandle=tt,this.onUpdateValueMismatch=st,this.forceUploadEachRun=null}get id(){return`${this.origin}_${name}`}getSource(){throw new Error(`"getSource" not defined on ${this.constructor.name}`)}updateValue(at){throw new Error(`"updateValue" not defined on ${this.constructor.name}`)}}a.exports={KernelValue:et}},{}],36:[function(o,a,rt){const{utils:et}=o("../utils"),{Input:ot}=o("../input");class at{static get isSupported(){throw new Error(`"isSupported" not implemented on ${this.name}`)}static isContextMatch(j){throw new Error(`"isContextMatch" not implemented on ${this.name}`)}static getFeatures(){throw new Error(`"getFeatures" not implemented on ${this.name}`)}static destroyContext(j){throw new Error(`"destroyContext" called on ${this.name}`)}static nativeFunctionArguments(){throw new Error(`"nativeFunctionArguments" called on ${this.name}`)}static nativeFunctionReturnType(){throw new Error(`"nativeFunctionReturnType" called on ${this.name}`)}static combineKernels(){throw new Error(`"combineKernels" called on ${this.name}`)}constructor(j,_){if(typeof j!="object"){if(typeof j!="string")throw new Error("source not a string");if(!et.isFunctionString(j))throw new Error("source not a function string")}this.useLegacyEncoder=!1,this.fallbackRequested=!1,this.onRequestFallback=null,this.argumentNames=typeof j=="string"?et.getArgumentNamesFromString(j):null,this.argumentTypes=null,this.argumentSizes=null,this.argumentBitRatios=null,this.kernelArguments=null,this.kernelConstants=null,this.forceUploadKernelConstants=null,this.source=j,this.output=null,this.debug=!1,this.graphical=!1,this.loopMaxIterations=0,this.constants=null,this.constantTypes=null,this.constantBitRatios=null,this.dynamicArguments=!1,this.dynamicOutput=!1,this.canvas=null,this.context=null,this.checkContext=null,this.gpu=null,this.functions=null,this.nativeFunctions=null,this.injectedNative=null,this.subKernels=null,this.validate=!0,this.immutable=!1,this.pipeline=!1,this.precision=null,this.tactic=null,this.plugins=null,this.returnType=null,this.leadingReturnStatement=null,this.followingReturnStatement=null,this.optimizeFloatMemory=null,this.strictIntegers=!1,this.fixIntegerDivisionAccuracy=null,this.built=!1,this.signature=null}mergeSettings(j){for(let _ in j)if(!(!j.hasOwnProperty(_)||!this.hasOwnProperty(_))){switch(_){case"output":if(!Array.isArray(j.output)){this.setOutput(j.output);continue}break;case"functions":this.functions=[];for(let $=0;$j.name):null,returnType:this.returnType}}}buildSignature(j){const _=this.constructor;this.signature=_.getSignature(this,_.getArgumentTypes(this,j))}static getArgumentTypes(j,_){const $=new Array(_.length);for(let tt=0;tt<_.length;tt++){const st=_[tt],lt=j.argumentTypes[tt];if(st.type)$[tt]=st.type;else switch(lt){case"Number":case"Integer":case"Float":case"ArrayTexture(1)":$[tt]=et.getVariableType(st);break;default:$[tt]=lt}}return $}static getSignature(j,_){throw new Error(`"getSignature" not implemented on ${this.name}`)}functionToIGPUFunction(j,_={}){if(typeof j!="string"&&typeof j!="function")throw new Error("source not a string or function");const $=typeof j=="string"?j:j.toString();let tt=[];return Array.isArray(_.argumentTypes)?tt=_.argumentTypes:typeof _.argumentTypes=="object"?tt=et.getArgumentNamesFromString($).map(st=>_.argumentTypes[st])||[]:tt=_.argumentTypes||[],{name:et.getFunctionNameFromString($)||null,source:$,argumentTypes:tt,returnType:_.returnType||null}}onActivate(j){}}function nt(it){const j=Object.keys(it),_=[];for(let $=0;$j.name):null,returnType:this.returnType}}}buildSignature(j){const _=this.constructor;this.signature=_.getSignature(this,_.getArgumentTypes(this,j))}static getArgumentTypes(j,_){const $=new Array(_.length);for(let et=0;et<_.length;et++){const st=_[et],lt=j.argumentTypes[et];if(st.type)$[et]=st.type;else switch(lt){case"Number":case"Integer":case"Float":case"ArrayTexture(1)":$[et]=tt.getVariableType(st);break;default:$[et]=lt}}return $}static getSignature(j,_){throw new Error(`"getSignature" not implemented on ${this.name}`)}functionToIGPUFunction(j,_={}){if(typeof j!="string"&&typeof j!="function")throw new Error("source not a string or function");const $=typeof j=="string"?j:j.toString();let et=[];return Array.isArray(_.argumentTypes)?et=_.argumentTypes:typeof _.argumentTypes=="object"?et=tt.getArgumentNamesFromString($).map(st=>_.argumentTypes[st])||[]:et=_.argumentTypes||[],{name:tt.getFunctionNameFromString($)||null,source:$,argumentTypes:et,returnType:_.returnType||null}}onActivate(j){}}function nt(it){const j=Object.keys(it),_=[];for(let $=0;$0&&$.push(", ");let lt=this.argumentTypes[this.argumentNames.indexOf(st)];if(!lt)throw this.astErrorOutput(`Unknown argument ${st} type`,_);lt==="LiteralInteger"&&(this.argumentTypes[tt]=lt="Number");const ct=nt[lt];if(!ct)throw this.astErrorOutput("Unexpected expression",_);const ht=et.sanitizeName(st);ct==="sampler2D"||ct==="sampler2DArray"?$.push(`${ct} user_${ht},ivec2 user_${ht}Size,ivec3 user_${ht}Dim`):$.push(`${ct} user_${ht}`)}$.push(`) { -`);for(let tt=0;tt<_.body.body.length;++tt)this.astGeneric(_.body.body[tt],$),$.push(` +}`;a.exports={fragmentShader:tt}},{}],38:[function(o,a,rt){const{utils:tt}=o("../../utils"),{FunctionNode:ot}=o("../function-node");class at extends ot{constructor(_,$){super(_,$),$&&$.hasOwnProperty("fixIntegerDivisionAccuracy")&&(this.fixIntegerDivisionAccuracy=$.fixIntegerDivisionAccuracy)}astConditionalExpression(_,$){if(_.type!=="ConditionalExpression")throw this.astErrorOutput("Not a conditional expression",_);const et=this.getType(_.consequent),st=this.getType(_.alternate);return et===null&&st===null?($.push("if ("),this.astGeneric(_.test,$),$.push(") {"),this.astGeneric(_.consequent,$),$.push(";"),$.push("} else {"),this.astGeneric(_.alternate,$),$.push(";"),$.push("}"),$):($.push("("),this.astGeneric(_.test,$),$.push("?"),this.astGeneric(_.consequent,$),$.push(":"),this.astGeneric(_.alternate,$),$.push(")"),$)}astFunction(_,$){if(this.isRootKernel)$.push("void");else{this.returnType||this.findLastReturn()&&(this.returnType=this.getType(_.body),this.returnType==="LiteralInteger"&&(this.returnType="Number"));const{returnType:et}=this;if(!et)$.push("void");else{const st=nt[et];if(!st)throw new Error(`unknown type ${et}`);$.push(st)}}if($.push(" "),$.push(this.name),$.push("("),!this.isRootKernel)for(let et=0;et0&&$.push(", ");let lt=this.argumentTypes[this.argumentNames.indexOf(st)];if(!lt)throw this.astErrorOutput(`Unknown argument ${st} type`,_);lt==="LiteralInteger"&&(this.argumentTypes[et]=lt="Number");const ct=nt[lt];if(!ct)throw this.astErrorOutput("Unexpected expression",_);const ht=tt.sanitizeName(st);ct==="sampler2D"||ct==="sampler2DArray"?$.push(`${ct} user_${ht},ivec2 user_${ht}Size,ivec3 user_${ht}Dim`):$.push(`${ct} user_${ht}`)}$.push(`) { +`);for(let et=0;et<_.body.body.length;++et)this.astGeneric(_.body.body[et],$),$.push(` `);return $.push(`} -`),$}astReturnStatement(_,$){if(!_.argument)throw this.astErrorOutput("Unexpected return statement",_);this.pushState("skip-literal-correction");const tt=this.getType(_.argument);this.popState("skip-literal-correction");const st=[];switch(this.returnType||(tt==="LiteralInteger"||tt==="Integer"?this.returnType="Number":this.returnType=tt),this.returnType){case"LiteralInteger":case"Number":case"Float":switch(tt){case"Integer":st.push("float("),this.astGeneric(_.argument,st),st.push(")");break;case"LiteralInteger":this.castLiteralToFloat(_.argument,st),this.getType(_)==="Integer"&&(st.unshift("float("),st.push(")"));break;default:this.astGeneric(_.argument,st)}break;case"Integer":switch(tt){case"Float":case"Number":this.castValueToInteger(_.argument,st);break;case"LiteralInteger":this.castLiteralToInteger(_.argument,st);break;default:this.astGeneric(_.argument,st)}break;case"Array(4)":case"Array(3)":case"Array(2)":case"Matrix(2)":case"Matrix(3)":case"Matrix(4)":case"Input":this.astGeneric(_.argument,st);break;default:throw this.astErrorOutput(`unhandled return type ${this.returnType}`,_)}return this.isRootKernel?($.push(`kernelResult = ${st.join("")};`),$.push("return;")):this.isSubKernel?($.push(`subKernelResult_${this.name} = ${st.join("")};`),$.push(`return subKernelResult_${this.name};`)):$.push(`return ${st.join("")};`),$}astLiteral(_,$){if(isNaN(_.value))throw this.astErrorOutput("Non-numeric literal not supported : "+_.value,_);const tt=this.astKey(_);return Number.isInteger(_.value)?this.isState("casting-to-integer")||this.isState("building-integer")?(this.literalTypes[tt]="Integer",$.push(`${_.value}`)):this.isState("casting-to-float")||this.isState("building-float")?(this.literalTypes[tt]="Number",$.push(`${_.value}.0`)):(this.literalTypes[tt]="Number",$.push(`${_.value}.0`)):this.isState("casting-to-integer")||this.isState("building-integer")?(this.literalTypes[tt]="Integer",$.push(Math.round(_.value))):(this.literalTypes[tt]="Number",$.push(`${_.value}`)),$}astBinaryExpression(_,$){if(this.checkAndUpconvertOperator(_,$))return $;if(this.fixIntegerDivisionAccuracy&&_.operator==="/"){switch($.push("divWithIntCheck("),this.pushState("building-float"),this.getType(_.left)){case"Integer":this.castValueToFloat(_.left,$);break;case"LiteralInteger":this.castLiteralToFloat(_.left,$);break;default:this.astGeneric(_.left,$)}switch($.push(", "),this.getType(_.right)){case"Integer":this.castValueToFloat(_.right,$);break;case"LiteralInteger":this.castLiteralToFloat(_.right,$);break;default:this.astGeneric(_.right,$)}return this.popState("building-float"),$.push(")"),$}$.push("(");const tt=this.getType(_.left)||"Number",st=this.getType(_.right)||"Number";if(!tt||!st)throw this.astErrorOutput("Unhandled binary expression",_);const lt=tt+" & "+st;switch(lt){case"Integer & Integer":this.pushState("building-integer"),this.astGeneric(_.left,$),$.push(it[_.operator]||_.operator),this.astGeneric(_.right,$),this.popState("building-integer");break;case"Number & Float":case"Float & Number":case"Float & Float":case"Number & Number":this.pushState("building-float"),this.astGeneric(_.left,$),$.push(it[_.operator]||_.operator),this.astGeneric(_.right,$),this.popState("building-float");break;case"LiteralInteger & LiteralInteger":this.isState("casting-to-integer")||this.isState("building-integer")?(this.pushState("building-integer"),this.astGeneric(_.left,$),$.push(it[_.operator]||_.operator),this.astGeneric(_.right,$),this.popState("building-integer")):(this.pushState("building-float"),this.castLiteralToFloat(_.left,$),$.push(it[_.operator]||_.operator),this.castLiteralToFloat(_.right,$),this.popState("building-float"));break;case"Integer & Float":case"Integer & Number":if((_.operator===">"||_.operator==="<"&&_.right.type==="Literal")&&!Number.isInteger(_.right.value)){this.pushState("building-float"),this.castValueToFloat(_.left,$),$.push(it[_.operator]||_.operator),this.astGeneric(_.right,$),this.popState("building-float");break}if(this.pushState("building-integer"),this.astGeneric(_.left,$),$.push(it[_.operator]||_.operator),this.pushState("casting-to-integer"),_.right.type==="Literal"){const ct=[];if(this.astGeneric(_.right,ct),this.getType(_.right)==="Integer")$.push(ct.join(""));else throw this.astErrorOutput("Unhandled binary expression with literal",_)}else $.push("int("),this.astGeneric(_.right,$),$.push(")");this.popState("casting-to-integer"),this.popState("building-integer");break;case"Integer & LiteralInteger":this.pushState("building-integer"),this.astGeneric(_.left,$),$.push(it[_.operator]||_.operator),this.castLiteralToInteger(_.right,$),this.popState("building-integer");break;case"Number & Integer":this.pushState("building-float"),this.astGeneric(_.left,$),$.push(it[_.operator]||_.operator),this.castValueToFloat(_.right,$),this.popState("building-float");break;case"Float & LiteralInteger":case"Number & LiteralInteger":this.pushState("building-float"),this.astGeneric(_.left,$),$.push(it[_.operator]||_.operator),this.castLiteralToFloat(_.right,$),this.popState("building-float");break;case"LiteralInteger & Float":case"LiteralInteger & Number":this.isState("casting-to-integer")?(this.pushState("building-integer"),this.castLiteralToInteger(_.left,$),$.push(it[_.operator]||_.operator),this.castValueToInteger(_.right,$),this.popState("building-integer")):(this.pushState("building-float"),this.astGeneric(_.left,$),$.push(it[_.operator]||_.operator),this.pushState("casting-to-float"),this.astGeneric(_.right,$),this.popState("casting-to-float"),this.popState("building-float"));break;case"LiteralInteger & Integer":this.pushState("building-integer"),this.castLiteralToInteger(_.left,$),$.push(it[_.operator]||_.operator),this.astGeneric(_.right,$),this.popState("building-integer");break;case"Boolean & Boolean":this.pushState("building-boolean"),this.astGeneric(_.left,$),$.push(it[_.operator]||_.operator),this.astGeneric(_.right,$),this.popState("building-boolean");break;case"Float & Integer":this.pushState("building-float"),this.astGeneric(_.left,$),$.push(it[_.operator]||_.operator),this.castValueToFloat(_.right,$),this.popState("building-float");break;default:throw this.astErrorOutput(`Unhandled binary expression between ${lt}`,_)}return $.push(")"),$}checkAndUpconvertOperator(_,$){const tt=this.checkAndUpconvertBitwiseOperators(_,$);if(tt)return tt;const lt={"%":this.fixIntegerDivisionAccuracy?"integerCorrectionModulo":"modulo","**":"pow"}[_.operator];if(!lt)return null;switch($.push(lt),$.push("("),this.getType(_.left)){case"Integer":this.castValueToFloat(_.left,$);break;case"LiteralInteger":this.castLiteralToFloat(_.left,$);break;default:this.astGeneric(_.left,$)}switch($.push(","),this.getType(_.right)){case"Integer":this.castValueToFloat(_.right,$);break;case"LiteralInteger":this.castLiteralToFloat(_.right,$);break;default:this.astGeneric(_.right,$)}return $.push(")"),$}checkAndUpconvertBitwiseOperators(_,$){const st={"&":"bitwiseAnd","|":"bitwiseOr","^":"bitwiseXOR","<<":"bitwiseZeroFillLeftShift",">>":"bitwiseSignedRightShift",">>>":"bitwiseZeroFillRightShift"}[_.operator];if(!st)return null;switch($.push(st),$.push("("),this.getType(_.left)){case"Number":case"Float":this.castValueToInteger(_.left,$);break;case"LiteralInteger":this.castLiteralToInteger(_.left,$);break;default:this.astGeneric(_.left,$)}switch($.push(","),this.getType(_.right)){case"Number":case"Float":this.castValueToInteger(_.right,$);break;case"LiteralInteger":this.castLiteralToInteger(_.right,$);break;default:this.astGeneric(_.right,$)}return $.push(")"),$}checkAndUpconvertBitwiseUnary(_,$){const st={"~":"bitwiseNot"}[_.operator];if(!st)return null;switch($.push(st),$.push("("),this.getType(_.argument)){case"Number":case"Float":this.castValueToInteger(_.argument,$);break;case"LiteralInteger":this.castLiteralToInteger(_.argument,$);break;default:this.astGeneric(_.argument,$)}return $.push(")"),$}castLiteralToInteger(_,$){return this.pushState("casting-to-integer"),this.astGeneric(_,$),this.popState("casting-to-integer"),$}castLiteralToFloat(_,$){return this.pushState("casting-to-float"),this.astGeneric(_,$),this.popState("casting-to-float"),$}castValueToInteger(_,$){return this.pushState("casting-to-integer"),$.push("int("),this.astGeneric(_,$),$.push(")"),this.popState("casting-to-integer"),$}castValueToFloat(_,$){return this.pushState("casting-to-float"),$.push("float("),this.astGeneric(_,$),$.push(")"),this.popState("casting-to-float"),$}astIdentifierExpression(_,$){if(_.type!=="Identifier")throw this.astErrorOutput("IdentifierExpression - not an Identifier",_);const tt=this.getType(_),st=et.sanitizeName(_.name);return _.name==="Infinity"?$.push("3.402823466e+38"):tt==="Boolean"?this.argumentNames.indexOf(st)>-1?$.push(`bool(user_${st})`):$.push(`user_${st}`):$.push(`user_${st}`),$}astForStatement(_,$){if(_.type!=="ForStatement")throw this.astErrorOutput("Invalid for statement",_);const tt=[],st=[],lt=[],ct=[];let ht=null;if(_.init){const{declarations:ut}=_.init;ut.length>1&&(ht=!1),this.astGeneric(_.init,tt);for(let pt=0;pt"||_.operator==="<"&&_.right.type==="Literal")&&!Number.isInteger(_.right.value)){this.pushState("building-float"),this.castValueToFloat(_.left,$),$.push(it[_.operator]||_.operator),this.astGeneric(_.right,$),this.popState("building-float");break}if(this.pushState("building-integer"),this.astGeneric(_.left,$),$.push(it[_.operator]||_.operator),this.pushState("casting-to-integer"),_.right.type==="Literal"){const ct=[];if(this.astGeneric(_.right,ct),this.getType(_.right)==="Integer")$.push(ct.join(""));else throw this.astErrorOutput("Unhandled binary expression with literal",_)}else $.push("int("),this.astGeneric(_.right,$),$.push(")");this.popState("casting-to-integer"),this.popState("building-integer");break;case"Integer & LiteralInteger":this.pushState("building-integer"),this.astGeneric(_.left,$),$.push(it[_.operator]||_.operator),this.castLiteralToInteger(_.right,$),this.popState("building-integer");break;case"Number & Integer":this.pushState("building-float"),this.astGeneric(_.left,$),$.push(it[_.operator]||_.operator),this.castValueToFloat(_.right,$),this.popState("building-float");break;case"Float & LiteralInteger":case"Number & LiteralInteger":this.pushState("building-float"),this.astGeneric(_.left,$),$.push(it[_.operator]||_.operator),this.castLiteralToFloat(_.right,$),this.popState("building-float");break;case"LiteralInteger & Float":case"LiteralInteger & Number":this.isState("casting-to-integer")?(this.pushState("building-integer"),this.castLiteralToInteger(_.left,$),$.push(it[_.operator]||_.operator),this.castValueToInteger(_.right,$),this.popState("building-integer")):(this.pushState("building-float"),this.astGeneric(_.left,$),$.push(it[_.operator]||_.operator),this.pushState("casting-to-float"),this.astGeneric(_.right,$),this.popState("casting-to-float"),this.popState("building-float"));break;case"LiteralInteger & Integer":this.pushState("building-integer"),this.castLiteralToInteger(_.left,$),$.push(it[_.operator]||_.operator),this.astGeneric(_.right,$),this.popState("building-integer");break;case"Boolean & Boolean":this.pushState("building-boolean"),this.astGeneric(_.left,$),$.push(it[_.operator]||_.operator),this.astGeneric(_.right,$),this.popState("building-boolean");break;case"Float & Integer":this.pushState("building-float"),this.astGeneric(_.left,$),$.push(it[_.operator]||_.operator),this.castValueToFloat(_.right,$),this.popState("building-float");break;default:throw this.astErrorOutput(`Unhandled binary expression between ${lt}`,_)}return $.push(")"),$}checkAndUpconvertOperator(_,$){const et=this.checkAndUpconvertBitwiseOperators(_,$);if(et)return et;const lt={"%":this.fixIntegerDivisionAccuracy?"integerCorrectionModulo":"modulo","**":"pow"}[_.operator];if(!lt)return null;switch($.push(lt),$.push("("),this.getType(_.left)){case"Integer":this.castValueToFloat(_.left,$);break;case"LiteralInteger":this.castLiteralToFloat(_.left,$);break;default:this.astGeneric(_.left,$)}switch($.push(","),this.getType(_.right)){case"Integer":this.castValueToFloat(_.right,$);break;case"LiteralInteger":this.castLiteralToFloat(_.right,$);break;default:this.astGeneric(_.right,$)}return $.push(")"),$}checkAndUpconvertBitwiseOperators(_,$){const st={"&":"bitwiseAnd","|":"bitwiseOr","^":"bitwiseXOR","<<":"bitwiseZeroFillLeftShift",">>":"bitwiseSignedRightShift",">>>":"bitwiseZeroFillRightShift"}[_.operator];if(!st)return null;switch($.push(st),$.push("("),this.getType(_.left)){case"Number":case"Float":this.castValueToInteger(_.left,$);break;case"LiteralInteger":this.castLiteralToInteger(_.left,$);break;default:this.astGeneric(_.left,$)}switch($.push(","),this.getType(_.right)){case"Number":case"Float":this.castValueToInteger(_.right,$);break;case"LiteralInteger":this.castLiteralToInteger(_.right,$);break;default:this.astGeneric(_.right,$)}return $.push(")"),$}checkAndUpconvertBitwiseUnary(_,$){const st={"~":"bitwiseNot"}[_.operator];if(!st)return null;switch($.push(st),$.push("("),this.getType(_.argument)){case"Number":case"Float":this.castValueToInteger(_.argument,$);break;case"LiteralInteger":this.castLiteralToInteger(_.argument,$);break;default:this.astGeneric(_.argument,$)}return $.push(")"),$}castLiteralToInteger(_,$){return this.pushState("casting-to-integer"),this.astGeneric(_,$),this.popState("casting-to-integer"),$}castLiteralToFloat(_,$){return this.pushState("casting-to-float"),this.astGeneric(_,$),this.popState("casting-to-float"),$}castValueToInteger(_,$){return this.pushState("casting-to-integer"),$.push("int("),this.astGeneric(_,$),$.push(")"),this.popState("casting-to-integer"),$}castValueToFloat(_,$){return this.pushState("casting-to-float"),$.push("float("),this.astGeneric(_,$),$.push(")"),this.popState("casting-to-float"),$}astIdentifierExpression(_,$){if(_.type!=="Identifier")throw this.astErrorOutput("IdentifierExpression - not an Identifier",_);const et=this.getType(_),st=tt.sanitizeName(_.name);return _.name==="Infinity"?$.push("3.402823466e+38"):et==="Boolean"?this.argumentNames.indexOf(st)>-1?$.push(`bool(user_${st})`):$.push(`user_${st}`):$.push(`user_${st}`),$}astForStatement(_,$){if(_.type!=="ForStatement")throw this.astErrorOutput("Invalid for statement",_);const et=[],st=[],lt=[],ct=[];let ht=null;if(_.init){const{declarations:ut}=_.init;ut.length>1&&(ht=!1),this.astGeneric(_.init,et);for(let pt=0;pt0&&$.push(tt.join(""),` +`)}else{const ut=this.getInternalVariableName("safeI");et.length>0&&$.push(et.join(""),` `),$.push(`for (int ${ut}=0;${ut}0&&$.push(`if (!${st.join("")}) break; `),$.push(ct.join("")),$.push(` ${lt.join("")};`),$.push(`} -`)}return $}astWhileStatement(_,$){if(_.type!=="WhileStatement")throw this.astErrorOutput("Invalid while statement",_);const tt=this.getInternalVariableName("safeI");return $.push(`for (int ${tt}=0;${tt}0&&ct.push(ht.join(",")),st.push(ct.join(";")),$.push(st.join("")),$.push(";"),$}astIfStatement(_,$){return $.push("if ("),this.astGeneric(_.test,$),$.push(")"),_.consequent.type==="BlockStatement"?this.astGeneric(_.consequent,$):($.push(` { +`),$}astAssignmentExpression(_,$){if(_.operator==="%=")this.astGeneric(_.left,$),$.push("="),$.push("mod("),this.astGeneric(_.left,$),$.push(","),this.astGeneric(_.right,$),$.push(")");else if(_.operator==="**=")this.astGeneric(_.left,$),$.push("="),$.push("pow("),this.astGeneric(_.left,$),$.push(","),this.astGeneric(_.right,$),$.push(")");else{const et=this.getType(_.left),st=this.getType(_.right);return this.astGeneric(_.left,$),$.push(_.operator),et!=="Integer"&&st==="Integer"?($.push("float("),this.astGeneric(_.right,$),$.push(")")):this.astGeneric(_.right,$),$}}astBlockStatement(_,$){if(this.isState("loop-body")){this.pushState("block-body");for(let et=0;et<_.body.length;et++)this.astGeneric(_.body[et],$);this.popState("block-body")}else{$.push(`{ +`);for(let et=0;et<_.body.length;et++)this.astGeneric(_.body[et],$);$.push(`} +`)}return $}astVariableDeclaration(_,$){const et=_.declarations;if(!et||!et[0]||!et[0].init)throw this.astErrorOutput("Unexpected expression",_);const st=[];let lt=null;const ct=[];let ht=[];for(let ut=0;ut0&&ct.push(ht.join(",")),st.push(ct.join(";")),$.push(st.join("")),$.push(";"),$}astIfStatement(_,$){return $.push("if ("),this.astGeneric(_.test,$),$.push(")"),_.consequent.type==="BlockStatement"?this.astGeneric(_.consequent,$):($.push(` { `),this.astGeneric(_.consequent,$),$.push(` } `)),_.alternate&&($.push("else "),_.alternate.type==="BlockStatement"||_.alternate.type==="IfStatement"?this.astGeneric(_.alternate,$):($.push(` { `),this.astGeneric(_.alternate,$),$.push(` } -`))),$}astSwitchStatement(_,$){if(_.type!=="SwitchStatement")throw this.astErrorOutput("Invalid switch statement",_);const{discriminant:tt,cases:st}=_,lt=this.getType(tt),ct=`switchDiscriminant${this.astKey(_,"_")}`;switch(lt){case"Float":case"Number":$.push(`float ${ct} = `),this.astGeneric(tt,$),$.push(`; -`);break;case"Integer":$.push(`int ${ct} = `),this.astGeneric(tt,$),$.push(`; +`))),$}astSwitchStatement(_,$){if(_.type!=="SwitchStatement")throw this.astErrorOutput("Invalid switch statement",_);const{discriminant:et,cases:st}=_,lt=this.getType(et),ct=`switchDiscriminant${this.astKey(_,"_")}`;switch(lt){case"Float":case"Number":$.push(`float ${ct} = `),this.astGeneric(et,$),$.push(`; +`);break;case"Integer":$.push(`int ${ct} = `),this.astGeneric(et,$),$.push(`; `);break}if(st.length===1&&!st[0].test)return this.astGeneric(st[0].consequent,$),$;let ht=!1,ut=[],pt=!1,mt=!1;for(let gt=0;gtgt+1){pt=!0,this.astGeneric(st[gt].consequent,ut);continue}else $.push(` else { `);this.astGeneric(st[gt].consequent,$),$.push(` -}`)}return pt&&($.push(" else {"),$.push(ut.join("")),$.push("}")),$}astThisExpression(_,$){return $.push("this"),$}astMemberExpression(_,$){const{property:tt,name:st,signature:lt,origin:ct,type:ht,xProperty:ut,yProperty:pt,zProperty:mt}=this.getMemberExpressionDetails(_);switch(lt){case"value.thread.value":case"this.thread.value":if(st!=="x"&&st!=="y"&&st!=="z")throw this.astErrorOutput("Unexpected expression, expected `this.thread.x`, `this.thread.y`, or `this.thread.z`",_);return $.push(`threadId.${st}`),$;case"this.output.value":if(this.dynamicOutput)switch(st){case"x":this.isState("casting-to-float")?$.push("float(uOutputDim.x)"):$.push("uOutputDim.x");break;case"y":this.isState("casting-to-float")?$.push("float(uOutputDim.y)"):$.push("uOutputDim.y");break;case"z":this.isState("casting-to-float")?$.push("float(uOutputDim.z)"):$.push("uOutputDim.z");break;default:throw this.astErrorOutput("Unexpected expression",_)}else switch(st){case"x":this.isState("casting-to-integer")?$.push(this.output[0]):$.push(this.output[0],".0");break;case"y":this.isState("casting-to-integer")?$.push(this.output[1]):$.push(this.output[1],".0");break;case"z":this.isState("casting-to-integer")?$.push(this.output[2]):$.push(this.output[2],".0");break;default:throw this.astErrorOutput("Unexpected expression",_)}return $;case"value":throw this.astErrorOutput("Unexpected expression",_);case"value[]":case"value[][]":case"value[][][]":case"value[][][][]":case"value.value":if(ct==="Math")return $.push(Math[st]),$;const dt=et.sanitizeName(st);switch(tt){case"r":return $.push(`user_${dt}.r`),$;case"g":return $.push(`user_${dt}.g`),$;case"b":return $.push(`user_${dt}.b`),$;case"a":return $.push(`user_${dt}.a`),$}break;case"this.constants.value":if(typeof ut>"u")switch(ht){case"Array(2)":case"Array(3)":case"Array(4)":return $.push(`constants_${et.sanitizeName(st)}`),$}case"this.constants.value[]":case"this.constants.value[][]":case"this.constants.value[][][]":case"this.constants.value[][][][]":break;case"fn()[]":return this.astCallExpression(_.object,$),$.push("["),$.push(this.memberExpressionPropertyMarkup(tt)),$.push("]"),$;case"fn()[][]":return this.astCallExpression(_.object.object,$),$.push("["),$.push(this.memberExpressionPropertyMarkup(_.object.property)),$.push("]"),$.push("["),$.push(this.memberExpressionPropertyMarkup(_.property)),$.push("]"),$;case"[][]":return this.astArrayExpression(_.object,$),$.push("["),$.push(this.memberExpressionPropertyMarkup(tt)),$.push("]"),$;default:throw this.astErrorOutput("Unexpected expression",_)}if(_.computed===!1)switch(ht){case"Number":case"Integer":case"Float":case"Boolean":return $.push(`${ct}_${et.sanitizeName(st)}`),$}const gt=`${ct}_${et.sanitizeName(st)}`;switch(ht){case"Array(2)":case"Array(3)":case"Array(4)":this.astGeneric(_.object,$),$.push("["),$.push(this.memberExpressionPropertyMarkup(ut)),$.push("]");break;case"HTMLImageArray":$.push(`getImage3D(${gt}, ${gt}Size, ${gt}Dim, `),this.memberExpressionXYZ(ut,pt,mt,$),$.push(")");break;case"ArrayTexture(1)":$.push(`getFloatFromSampler2D(${gt}, ${gt}Size, ${gt}Dim, `),this.memberExpressionXYZ(ut,pt,mt,$),$.push(")");break;case"Array1D(2)":case"Array2D(2)":case"Array3D(2)":$.push(`getMemoryOptimizedVec2(${gt}, ${gt}Size, ${gt}Dim, `),this.memberExpressionXYZ(ut,pt,mt,$),$.push(")");break;case"ArrayTexture(2)":$.push(`getVec2FromSampler2D(${gt}, ${gt}Size, ${gt}Dim, `),this.memberExpressionXYZ(ut,pt,mt,$),$.push(")");break;case"Array1D(3)":case"Array2D(3)":case"Array3D(3)":$.push(`getMemoryOptimizedVec3(${gt}, ${gt}Size, ${gt}Dim, `),this.memberExpressionXYZ(ut,pt,mt,$),$.push(")");break;case"ArrayTexture(3)":$.push(`getVec3FromSampler2D(${gt}, ${gt}Size, ${gt}Dim, `),this.memberExpressionXYZ(ut,pt,mt,$),$.push(")");break;case"Array1D(4)":case"Array2D(4)":case"Array3D(4)":$.push(`getMemoryOptimizedVec4(${gt}, ${gt}Size, ${gt}Dim, `),this.memberExpressionXYZ(ut,pt,mt,$),$.push(")");break;case"ArrayTexture(4)":case"HTMLCanvas":case"OffscreenCanvas":case"HTMLImage":case"ImageBitmap":case"ImageData":case"HTMLVideo":$.push(`getVec4FromSampler2D(${gt}, ${gt}Size, ${gt}Dim, `),this.memberExpressionXYZ(ut,pt,mt,$),$.push(")");break;case"NumberTexture":case"Array":case"Array2D":case"Array3D":case"Array4D":case"Input":case"Number":case"Float":case"Integer":if(this.precision==="single")$.push(`getMemoryOptimized32(${gt}, ${gt}Size, ${gt}Dim, `),this.memberExpressionXYZ(ut,pt,mt,$),$.push(")");else{const dt=ct==="user"?this.lookupFunctionArgumentBitRatio(this.name,st):this.constantBitRatios[st];switch(dt){case 1:$.push(`get8(${gt}, ${gt}Size, ${gt}Dim, `);break;case 2:$.push(`get16(${gt}, ${gt}Size, ${gt}Dim, `);break;case 4:case 0:$.push(`get32(${gt}, ${gt}Size, ${gt}Dim, `);break;default:throw new Error(`unhandled bit ratio of ${dt}`)}this.memberExpressionXYZ(ut,pt,mt,$),$.push(")")}break;case"MemoryOptimizedNumberTexture":$.push(`getMemoryOptimized32(${gt}, ${gt}Size, ${gt}Dim, `),this.memberExpressionXYZ(ut,pt,mt,$),$.push(")");break;case"Matrix(2)":case"Matrix(3)":case"Matrix(4)":$.push(`${gt}[${this.memberExpressionPropertyMarkup(pt)}]`),pt&&$.push(`[${this.memberExpressionPropertyMarkup(ut)}]`);break;default:throw new Error(`unhandled member expression "${ht}"`)}return $}astCallExpression(_,$){if(!_.callee)throw this.astErrorOutput("Unknown CallExpression",_);let tt=null;const st=this.isAstMathFunction(_);if(st||_.callee.object&&_.callee.object.type==="ThisExpression"?tt=_.callee.property.name:_.callee.type==="SequenceExpression"&&_.callee.expressions[0].type==="Literal"&&!isNaN(_.callee.expressions[0].raw)?tt=_.callee.expressions[1].property.name:tt=_.callee.name,!tt)throw this.astErrorOutput("Unhandled function, couldn't find name",_);switch(tt){case"pow":tt="_pow";break;case"round":tt="_round";break}if(this.calledFunctions.indexOf(tt)<0&&this.calledFunctions.push(tt),tt==="random"&&this.plugins&&this.plugins.length>0)for(let lt=0;lt0&&$.push(", "),ht){case"Integer":this.castValueToFloat(ct,$);break;default:this.astGeneric(ct,$);break}}else{const lt=this.lookupFunctionArgumentTypes(tt)||[];for(let ct=0;ct<_.arguments.length;++ct){const ht=_.arguments[ct];let ut=lt[ct];ct>0&&$.push(", ");const pt=this.getType(ht);switch(ut||(this.triggerImplyArgumentType(tt,ct,pt,this),ut=pt),pt){case"Boolean":this.astGeneric(ht,$);continue;case"Number":case"Float":if(ut==="Integer"){$.push("int("),this.astGeneric(ht,$),$.push(")");continue}else if(ut==="Number"||ut==="Float"){this.astGeneric(ht,$);continue}else if(ut==="LiteralInteger"){this.castLiteralToFloat(ht,$);continue}break;case"Integer":if(ut==="Number"||ut==="Float"){$.push("float("),this.astGeneric(ht,$),$.push(")");continue}else if(ut==="Integer"){this.astGeneric(ht,$);continue}break;case"LiteralInteger":if(ut==="Integer"){this.castLiteralToInteger(ht,$);continue}else if(ut==="Number"||ut==="Float"){this.castLiteralToFloat(ht,$);continue}else if(ut==="LiteralInteger"){this.astGeneric(ht,$);continue}break;case"Array(2)":case"Array(3)":case"Array(4)":if(ut===pt){if(ht.type==="Identifier")$.push(`user_${et.sanitizeName(ht.name)}`);else if(ht.type==="ArrayExpression"||ht.type==="MemberExpression"||ht.type==="CallExpression")this.astGeneric(ht,$);else throw this.astErrorOutput(`Unhandled argument type ${ht.type}`,_);continue}break;case"HTMLCanvas":case"OffscreenCanvas":case"HTMLImage":case"ImageBitmap":case"ImageData":case"HTMLImageArray":case"HTMLVideo":case"ArrayTexture(1)":case"ArrayTexture(2)":case"ArrayTexture(3)":case"ArrayTexture(4)":case"Array":case"Input":if(ut===pt){if(ht.type!=="Identifier")throw this.astErrorOutput(`Unhandled argument type ${ht.type}`,_);this.triggerImplyArgumentBitRatio(this.name,ht.name,tt,ct);const mt=et.sanitizeName(ht.name);$.push(`user_${mt},user_${mt}Size,user_${mt}Dim`);continue}break}throw this.astErrorOutput(`Unhandled argument combination of ${pt} and ${ut} for argument named "${ht.name}"`,_)}}return $.push(")"),$}astArrayExpression(_,$){const tt=this.getType(_),st=_.elements.length;switch(tt){case"Matrix(2)":case"Matrix(3)":case"Matrix(4)":$.push(`mat${st}(`);break;default:$.push(`vec${st}(`)}for(let lt=0;lt0&&$.push(", ");const ct=_.elements[lt];this.astGeneric(ct,$)}return $.push(")"),$}memberExpressionXYZ(_,$,tt,st){return tt?st.push(this.memberExpressionPropertyMarkup(tt),", "):st.push("0, "),$?st.push(this.memberExpressionPropertyMarkup($),", "):st.push("0, "),st.push(this.memberExpressionPropertyMarkup(_)),st}memberExpressionPropertyMarkup(_){if(!_)throw new Error("Property not set");const $=this.getType(_),tt=[];switch($){case"Number":case"Float":this.castValueToInteger(_,tt);break;case"LiteralInteger":this.castLiteralToInteger(_,tt);break;default:this.astGeneric(_,tt)}return tt.join("")}}const nt={Array:"sampler2D","Array(2)":"vec2","Array(3)":"vec3","Array(4)":"vec4","Matrix(2)":"mat2","Matrix(3)":"mat3","Matrix(4)":"mat4",Array2D:"sampler2D",Array3D:"sampler2D",Boolean:"bool",Float:"float",Input:"sampler2D",Integer:"int",Number:"float",LiteralInteger:"float",NumberTexture:"sampler2D",MemoryOptimizedNumberTexture:"sampler2D","ArrayTexture(1)":"sampler2D","ArrayTexture(2)":"sampler2D","ArrayTexture(3)":"sampler2D","ArrayTexture(4)":"sampler2D",HTMLVideo:"sampler2D",HTMLCanvas:"sampler2D",OffscreenCanvas:"sampler2D",HTMLImage:"sampler2D",ImageBitmap:"sampler2D",ImageData:"sampler2D",HTMLImageArray:"sampler2DArray"},it={"===":"==","!==":"!="};a.exports={WebGLFunctionNode:at}},{"../../utils":114,"../function-node":10}],39:[function(o,a,rt){const{WebGLKernelValueBoolean:et}=o("./kernel-value/boolean"),{WebGLKernelValueFloat:ot}=o("./kernel-value/float"),{WebGLKernelValueInteger:at}=o("./kernel-value/integer"),{WebGLKernelValueHTMLImage:nt}=o("./kernel-value/html-image"),{WebGLKernelValueDynamicHTMLImage:it}=o("./kernel-value/dynamic-html-image"),{WebGLKernelValueHTMLVideo:j}=o("./kernel-value/html-video"),{WebGLKernelValueDynamicHTMLVideo:_}=o("./kernel-value/dynamic-html-video"),{WebGLKernelValueSingleInput:$}=o("./kernel-value/single-input"),{WebGLKernelValueDynamicSingleInput:tt}=o("./kernel-value/dynamic-single-input"),{WebGLKernelValueUnsignedInput:st}=o("./kernel-value/unsigned-input"),{WebGLKernelValueDynamicUnsignedInput:lt}=o("./kernel-value/dynamic-unsigned-input"),{WebGLKernelValueMemoryOptimizedNumberTexture:ct}=o("./kernel-value/memory-optimized-number-texture"),{WebGLKernelValueDynamicMemoryOptimizedNumberTexture:ht}=o("./kernel-value/dynamic-memory-optimized-number-texture"),{WebGLKernelValueNumberTexture:ut}=o("./kernel-value/number-texture"),{WebGLKernelValueDynamicNumberTexture:pt}=o("./kernel-value/dynamic-number-texture"),{WebGLKernelValueSingleArray:mt}=o("./kernel-value/single-array"),{WebGLKernelValueDynamicSingleArray:gt}=o("./kernel-value/dynamic-single-array"),{WebGLKernelValueSingleArray1DI:dt}=o("./kernel-value/single-array1d-i"),{WebGLKernelValueDynamicSingleArray1DI:St}=o("./kernel-value/dynamic-single-array1d-i"),{WebGLKernelValueSingleArray2DI:xt}=o("./kernel-value/single-array2d-i"),{WebGLKernelValueDynamicSingleArray2DI:yt}=o("./kernel-value/dynamic-single-array2d-i"),{WebGLKernelValueSingleArray3DI:_t}=o("./kernel-value/single-array3d-i"),{WebGLKernelValueDynamicSingleArray3DI:Ct}=o("./kernel-value/dynamic-single-array3d-i"),{WebGLKernelValueArray2:Et}=o("./kernel-value/array2"),{WebGLKernelValueArray3:kt}=o("./kernel-value/array3"),{WebGLKernelValueArray4:Tt}=o("./kernel-value/array4"),{WebGLKernelValueUnsignedArray:$t}=o("./kernel-value/unsigned-array"),{WebGLKernelValueDynamicUnsignedArray:It}=o("./kernel-value/dynamic-unsigned-array"),Ot={unsigned:{dynamic:{Boolean:et,Integer:at,Float:ot,Array:It,"Array(2)":Et,"Array(3)":kt,"Array(4)":Tt,"Array1D(2)":!1,"Array1D(3)":!1,"Array1D(4)":!1,"Array2D(2)":!1,"Array2D(3)":!1,"Array2D(4)":!1,"Array3D(2)":!1,"Array3D(3)":!1,"Array3D(4)":!1,Input:lt,NumberTexture:pt,"ArrayTexture(1)":pt,"ArrayTexture(2)":pt,"ArrayTexture(3)":pt,"ArrayTexture(4)":pt,MemoryOptimizedNumberTexture:ht,HTMLCanvas:it,OffscreenCanvas:it,HTMLImage:it,ImageBitmap:it,ImageData:it,HTMLImageArray:!1,HTMLVideo:_},static:{Boolean:et,Float:ot,Integer:at,Array:$t,"Array(2)":Et,"Array(3)":kt,"Array(4)":Tt,"Array1D(2)":!1,"Array1D(3)":!1,"Array1D(4)":!1,"Array2D(2)":!1,"Array2D(3)":!1,"Array2D(4)":!1,"Array3D(2)":!1,"Array3D(3)":!1,"Array3D(4)":!1,Input:st,NumberTexture:ut,"ArrayTexture(1)":ut,"ArrayTexture(2)":ut,"ArrayTexture(3)":ut,"ArrayTexture(4)":ut,MemoryOptimizedNumberTexture:ct,HTMLCanvas:nt,OffscreenCanvas:nt,HTMLImage:nt,ImageBitmap:nt,ImageData:nt,HTMLImageArray:!1,HTMLVideo:j}},single:{dynamic:{Boolean:et,Integer:at,Float:ot,Array:gt,"Array(2)":Et,"Array(3)":kt,"Array(4)":Tt,"Array1D(2)":St,"Array1D(3)":St,"Array1D(4)":St,"Array2D(2)":yt,"Array2D(3)":yt,"Array2D(4)":yt,"Array3D(2)":Ct,"Array3D(3)":Ct,"Array3D(4)":Ct,Input:tt,NumberTexture:pt,"ArrayTexture(1)":pt,"ArrayTexture(2)":pt,"ArrayTexture(3)":pt,"ArrayTexture(4)":pt,MemoryOptimizedNumberTexture:ht,HTMLCanvas:it,OffscreenCanvas:it,HTMLImage:it,ImageBitmap:it,ImageData:it,HTMLImageArray:!1,HTMLVideo:_},static:{Boolean:et,Float:ot,Integer:at,Array:mt,"Array(2)":Et,"Array(3)":kt,"Array(4)":Tt,"Array1D(2)":dt,"Array1D(3)":dt,"Array1D(4)":dt,"Array2D(2)":xt,"Array2D(3)":xt,"Array2D(4)":xt,"Array3D(2)":_t,"Array3D(3)":_t,"Array3D(4)":_t,Input:$,NumberTexture:ut,"ArrayTexture(1)":ut,"ArrayTexture(2)":ut,"ArrayTexture(3)":ut,"ArrayTexture(4)":ut,MemoryOptimizedNumberTexture:ct,HTMLCanvas:nt,OffscreenCanvas:nt,HTMLImage:nt,ImageBitmap:nt,ImageData:nt,HTMLImageArray:!1,HTMLVideo:j}}};function Mt(Dt,Bt,Kt,Wt){if(!Dt)throw new Error("type missing");if(!Bt)throw new Error("dynamic missing");if(!Kt)throw new Error("precision missing");Wt.type&&(Dt=Wt.type);const zt=Ot[Kt][Bt];if(zt[Dt]===!1)return null;if(zt[Dt]===void 0)throw new Error(`Could not find a KernelValue for ${Dt}`);return zt[Dt]}a.exports={lookupKernelValueType:Mt,kernelValueMaps:Ot}},{"./kernel-value/array2":41,"./kernel-value/array3":42,"./kernel-value/array4":43,"./kernel-value/boolean":44,"./kernel-value/dynamic-html-image":45,"./kernel-value/dynamic-html-video":46,"./kernel-value/dynamic-memory-optimized-number-texture":47,"./kernel-value/dynamic-number-texture":48,"./kernel-value/dynamic-single-array":49,"./kernel-value/dynamic-single-array1d-i":50,"./kernel-value/dynamic-single-array2d-i":51,"./kernel-value/dynamic-single-array3d-i":52,"./kernel-value/dynamic-single-input":53,"./kernel-value/dynamic-unsigned-array":54,"./kernel-value/dynamic-unsigned-input":55,"./kernel-value/float":56,"./kernel-value/html-image":57,"./kernel-value/html-video":58,"./kernel-value/integer":60,"./kernel-value/memory-optimized-number-texture":61,"./kernel-value/number-texture":62,"./kernel-value/single-array":63,"./kernel-value/single-array1d-i":64,"./kernel-value/single-array2d-i":65,"./kernel-value/single-array3d-i":66,"./kernel-value/single-input":67,"./kernel-value/unsigned-array":68,"./kernel-value/unsigned-input":69}],40:[function(o,a,rt){const{WebGLKernelValue:et}=o("./index"),{Input:ot}=o("../../../input");class at extends et{checkSize(it,j){if(!this.kernel.validate)return;const{maxTextureSize:_}=this.kernel.constructor.features;if(it>_||j>_)throw it>j?new Error(`Argument texture width of ${it} larger than maximum size of ${_} for your GPU`):it"u")switch(ht){case"Array(2)":case"Array(3)":case"Array(4)":return $.push(`constants_${tt.sanitizeName(st)}`),$}case"this.constants.value[]":case"this.constants.value[][]":case"this.constants.value[][][]":case"this.constants.value[][][][]":break;case"fn()[]":return this.astCallExpression(_.object,$),$.push("["),$.push(this.memberExpressionPropertyMarkup(et)),$.push("]"),$;case"fn()[][]":return this.astCallExpression(_.object.object,$),$.push("["),$.push(this.memberExpressionPropertyMarkup(_.object.property)),$.push("]"),$.push("["),$.push(this.memberExpressionPropertyMarkup(_.property)),$.push("]"),$;case"[][]":return this.astArrayExpression(_.object,$),$.push("["),$.push(this.memberExpressionPropertyMarkup(et)),$.push("]"),$;default:throw this.astErrorOutput("Unexpected expression",_)}if(_.computed===!1)switch(ht){case"Number":case"Integer":case"Float":case"Boolean":return $.push(`${ct}_${tt.sanitizeName(st)}`),$}const gt=`${ct}_${tt.sanitizeName(st)}`;switch(ht){case"Array(2)":case"Array(3)":case"Array(4)":this.astGeneric(_.object,$),$.push("["),$.push(this.memberExpressionPropertyMarkup(ut)),$.push("]");break;case"HTMLImageArray":$.push(`getImage3D(${gt}, ${gt}Size, ${gt}Dim, `),this.memberExpressionXYZ(ut,pt,mt,$),$.push(")");break;case"ArrayTexture(1)":$.push(`getFloatFromSampler2D(${gt}, ${gt}Size, ${gt}Dim, `),this.memberExpressionXYZ(ut,pt,mt,$),$.push(")");break;case"Array1D(2)":case"Array2D(2)":case"Array3D(2)":$.push(`getMemoryOptimizedVec2(${gt}, ${gt}Size, ${gt}Dim, `),this.memberExpressionXYZ(ut,pt,mt,$),$.push(")");break;case"ArrayTexture(2)":$.push(`getVec2FromSampler2D(${gt}, ${gt}Size, ${gt}Dim, `),this.memberExpressionXYZ(ut,pt,mt,$),$.push(")");break;case"Array1D(3)":case"Array2D(3)":case"Array3D(3)":$.push(`getMemoryOptimizedVec3(${gt}, ${gt}Size, ${gt}Dim, `),this.memberExpressionXYZ(ut,pt,mt,$),$.push(")");break;case"ArrayTexture(3)":$.push(`getVec3FromSampler2D(${gt}, ${gt}Size, ${gt}Dim, `),this.memberExpressionXYZ(ut,pt,mt,$),$.push(")");break;case"Array1D(4)":case"Array2D(4)":case"Array3D(4)":$.push(`getMemoryOptimizedVec4(${gt}, ${gt}Size, ${gt}Dim, `),this.memberExpressionXYZ(ut,pt,mt,$),$.push(")");break;case"ArrayTexture(4)":case"HTMLCanvas":case"OffscreenCanvas":case"HTMLImage":case"ImageBitmap":case"ImageData":case"HTMLVideo":$.push(`getVec4FromSampler2D(${gt}, ${gt}Size, ${gt}Dim, `),this.memberExpressionXYZ(ut,pt,mt,$),$.push(")");break;case"NumberTexture":case"Array":case"Array2D":case"Array3D":case"Array4D":case"Input":case"Number":case"Float":case"Integer":if(this.precision==="single")$.push(`getMemoryOptimized32(${gt}, ${gt}Size, ${gt}Dim, `),this.memberExpressionXYZ(ut,pt,mt,$),$.push(")");else{const dt=ct==="user"?this.lookupFunctionArgumentBitRatio(this.name,st):this.constantBitRatios[st];switch(dt){case 1:$.push(`get8(${gt}, ${gt}Size, ${gt}Dim, `);break;case 2:$.push(`get16(${gt}, ${gt}Size, ${gt}Dim, `);break;case 4:case 0:$.push(`get32(${gt}, ${gt}Size, ${gt}Dim, `);break;default:throw new Error(`unhandled bit ratio of ${dt}`)}this.memberExpressionXYZ(ut,pt,mt,$),$.push(")")}break;case"MemoryOptimizedNumberTexture":$.push(`getMemoryOptimized32(${gt}, ${gt}Size, ${gt}Dim, `),this.memberExpressionXYZ(ut,pt,mt,$),$.push(")");break;case"Matrix(2)":case"Matrix(3)":case"Matrix(4)":$.push(`${gt}[${this.memberExpressionPropertyMarkup(pt)}]`),pt&&$.push(`[${this.memberExpressionPropertyMarkup(ut)}]`);break;default:throw new Error(`unhandled member expression "${ht}"`)}return $}astCallExpression(_,$){if(!_.callee)throw this.astErrorOutput("Unknown CallExpression",_);let et=null;const st=this.isAstMathFunction(_);if(st||_.callee.object&&_.callee.object.type==="ThisExpression"?et=_.callee.property.name:_.callee.type==="SequenceExpression"&&_.callee.expressions[0].type==="Literal"&&!isNaN(_.callee.expressions[0].raw)?et=_.callee.expressions[1].property.name:et=_.callee.name,!et)throw this.astErrorOutput("Unhandled function, couldn't find name",_);switch(et){case"pow":et="_pow";break;case"round":et="_round";break}if(this.calledFunctions.indexOf(et)<0&&this.calledFunctions.push(et),et==="random"&&this.plugins&&this.plugins.length>0)for(let lt=0;lt0&&$.push(", "),ht){case"Integer":this.castValueToFloat(ct,$);break;default:this.astGeneric(ct,$);break}}else{const lt=this.lookupFunctionArgumentTypes(et)||[];for(let ct=0;ct<_.arguments.length;++ct){const ht=_.arguments[ct];let ut=lt[ct];ct>0&&$.push(", ");const pt=this.getType(ht);switch(ut||(this.triggerImplyArgumentType(et,ct,pt,this),ut=pt),pt){case"Boolean":this.astGeneric(ht,$);continue;case"Number":case"Float":if(ut==="Integer"){$.push("int("),this.astGeneric(ht,$),$.push(")");continue}else if(ut==="Number"||ut==="Float"){this.astGeneric(ht,$);continue}else if(ut==="LiteralInteger"){this.castLiteralToFloat(ht,$);continue}break;case"Integer":if(ut==="Number"||ut==="Float"){$.push("float("),this.astGeneric(ht,$),$.push(")");continue}else if(ut==="Integer"){this.astGeneric(ht,$);continue}break;case"LiteralInteger":if(ut==="Integer"){this.castLiteralToInteger(ht,$);continue}else if(ut==="Number"||ut==="Float"){this.castLiteralToFloat(ht,$);continue}else if(ut==="LiteralInteger"){this.astGeneric(ht,$);continue}break;case"Array(2)":case"Array(3)":case"Array(4)":if(ut===pt){if(ht.type==="Identifier")$.push(`user_${tt.sanitizeName(ht.name)}`);else if(ht.type==="ArrayExpression"||ht.type==="MemberExpression"||ht.type==="CallExpression")this.astGeneric(ht,$);else throw this.astErrorOutput(`Unhandled argument type ${ht.type}`,_);continue}break;case"HTMLCanvas":case"OffscreenCanvas":case"HTMLImage":case"ImageBitmap":case"ImageData":case"HTMLImageArray":case"HTMLVideo":case"ArrayTexture(1)":case"ArrayTexture(2)":case"ArrayTexture(3)":case"ArrayTexture(4)":case"Array":case"Input":if(ut===pt){if(ht.type!=="Identifier")throw this.astErrorOutput(`Unhandled argument type ${ht.type}`,_);this.triggerImplyArgumentBitRatio(this.name,ht.name,et,ct);const mt=tt.sanitizeName(ht.name);$.push(`user_${mt},user_${mt}Size,user_${mt}Dim`);continue}break}throw this.astErrorOutput(`Unhandled argument combination of ${pt} and ${ut} for argument named "${ht.name}"`,_)}}return $.push(")"),$}astArrayExpression(_,$){const et=this.getType(_),st=_.elements.length;switch(et){case"Matrix(2)":case"Matrix(3)":case"Matrix(4)":$.push(`mat${st}(`);break;default:$.push(`vec${st}(`)}for(let lt=0;lt0&&$.push(", ");const ct=_.elements[lt];this.astGeneric(ct,$)}return $.push(")"),$}memberExpressionXYZ(_,$,et,st){return et?st.push(this.memberExpressionPropertyMarkup(et),", "):st.push("0, "),$?st.push(this.memberExpressionPropertyMarkup($),", "):st.push("0, "),st.push(this.memberExpressionPropertyMarkup(_)),st}memberExpressionPropertyMarkup(_){if(!_)throw new Error("Property not set");const $=this.getType(_),et=[];switch($){case"Number":case"Float":this.castValueToInteger(_,et);break;case"LiteralInteger":this.castLiteralToInteger(_,et);break;default:this.astGeneric(_,et)}return et.join("")}}const nt={Array:"sampler2D","Array(2)":"vec2","Array(3)":"vec3","Array(4)":"vec4","Matrix(2)":"mat2","Matrix(3)":"mat3","Matrix(4)":"mat4",Array2D:"sampler2D",Array3D:"sampler2D",Boolean:"bool",Float:"float",Input:"sampler2D",Integer:"int",Number:"float",LiteralInteger:"float",NumberTexture:"sampler2D",MemoryOptimizedNumberTexture:"sampler2D","ArrayTexture(1)":"sampler2D","ArrayTexture(2)":"sampler2D","ArrayTexture(3)":"sampler2D","ArrayTexture(4)":"sampler2D",HTMLVideo:"sampler2D",HTMLCanvas:"sampler2D",OffscreenCanvas:"sampler2D",HTMLImage:"sampler2D",ImageBitmap:"sampler2D",ImageData:"sampler2D",HTMLImageArray:"sampler2DArray"},it={"===":"==","!==":"!="};a.exports={WebGLFunctionNode:at}},{"../../utils":114,"../function-node":10}],39:[function(o,a,rt){const{WebGLKernelValueBoolean:tt}=o("./kernel-value/boolean"),{WebGLKernelValueFloat:ot}=o("./kernel-value/float"),{WebGLKernelValueInteger:at}=o("./kernel-value/integer"),{WebGLKernelValueHTMLImage:nt}=o("./kernel-value/html-image"),{WebGLKernelValueDynamicHTMLImage:it}=o("./kernel-value/dynamic-html-image"),{WebGLKernelValueHTMLVideo:j}=o("./kernel-value/html-video"),{WebGLKernelValueDynamicHTMLVideo:_}=o("./kernel-value/dynamic-html-video"),{WebGLKernelValueSingleInput:$}=o("./kernel-value/single-input"),{WebGLKernelValueDynamicSingleInput:et}=o("./kernel-value/dynamic-single-input"),{WebGLKernelValueUnsignedInput:st}=o("./kernel-value/unsigned-input"),{WebGLKernelValueDynamicUnsignedInput:lt}=o("./kernel-value/dynamic-unsigned-input"),{WebGLKernelValueMemoryOptimizedNumberTexture:ct}=o("./kernel-value/memory-optimized-number-texture"),{WebGLKernelValueDynamicMemoryOptimizedNumberTexture:ht}=o("./kernel-value/dynamic-memory-optimized-number-texture"),{WebGLKernelValueNumberTexture:ut}=o("./kernel-value/number-texture"),{WebGLKernelValueDynamicNumberTexture:pt}=o("./kernel-value/dynamic-number-texture"),{WebGLKernelValueSingleArray:mt}=o("./kernel-value/single-array"),{WebGLKernelValueDynamicSingleArray:gt}=o("./kernel-value/dynamic-single-array"),{WebGLKernelValueSingleArray1DI:dt}=o("./kernel-value/single-array1d-i"),{WebGLKernelValueDynamicSingleArray1DI:St}=o("./kernel-value/dynamic-single-array1d-i"),{WebGLKernelValueSingleArray2DI:xt}=o("./kernel-value/single-array2d-i"),{WebGLKernelValueDynamicSingleArray2DI:yt}=o("./kernel-value/dynamic-single-array2d-i"),{WebGLKernelValueSingleArray3DI:_t}=o("./kernel-value/single-array3d-i"),{WebGLKernelValueDynamicSingleArray3DI:Ct}=o("./kernel-value/dynamic-single-array3d-i"),{WebGLKernelValueArray2:Et}=o("./kernel-value/array2"),{WebGLKernelValueArray3:kt}=o("./kernel-value/array3"),{WebGLKernelValueArray4:Tt}=o("./kernel-value/array4"),{WebGLKernelValueUnsignedArray:$t}=o("./kernel-value/unsigned-array"),{WebGLKernelValueDynamicUnsignedArray:It}=o("./kernel-value/dynamic-unsigned-array"),Ot={unsigned:{dynamic:{Boolean:tt,Integer:at,Float:ot,Array:It,"Array(2)":Et,"Array(3)":kt,"Array(4)":Tt,"Array1D(2)":!1,"Array1D(3)":!1,"Array1D(4)":!1,"Array2D(2)":!1,"Array2D(3)":!1,"Array2D(4)":!1,"Array3D(2)":!1,"Array3D(3)":!1,"Array3D(4)":!1,Input:lt,NumberTexture:pt,"ArrayTexture(1)":pt,"ArrayTexture(2)":pt,"ArrayTexture(3)":pt,"ArrayTexture(4)":pt,MemoryOptimizedNumberTexture:ht,HTMLCanvas:it,OffscreenCanvas:it,HTMLImage:it,ImageBitmap:it,ImageData:it,HTMLImageArray:!1,HTMLVideo:_},static:{Boolean:tt,Float:ot,Integer:at,Array:$t,"Array(2)":Et,"Array(3)":kt,"Array(4)":Tt,"Array1D(2)":!1,"Array1D(3)":!1,"Array1D(4)":!1,"Array2D(2)":!1,"Array2D(3)":!1,"Array2D(4)":!1,"Array3D(2)":!1,"Array3D(3)":!1,"Array3D(4)":!1,Input:st,NumberTexture:ut,"ArrayTexture(1)":ut,"ArrayTexture(2)":ut,"ArrayTexture(3)":ut,"ArrayTexture(4)":ut,MemoryOptimizedNumberTexture:ct,HTMLCanvas:nt,OffscreenCanvas:nt,HTMLImage:nt,ImageBitmap:nt,ImageData:nt,HTMLImageArray:!1,HTMLVideo:j}},single:{dynamic:{Boolean:tt,Integer:at,Float:ot,Array:gt,"Array(2)":Et,"Array(3)":kt,"Array(4)":Tt,"Array1D(2)":St,"Array1D(3)":St,"Array1D(4)":St,"Array2D(2)":yt,"Array2D(3)":yt,"Array2D(4)":yt,"Array3D(2)":Ct,"Array3D(3)":Ct,"Array3D(4)":Ct,Input:et,NumberTexture:pt,"ArrayTexture(1)":pt,"ArrayTexture(2)":pt,"ArrayTexture(3)":pt,"ArrayTexture(4)":pt,MemoryOptimizedNumberTexture:ht,HTMLCanvas:it,OffscreenCanvas:it,HTMLImage:it,ImageBitmap:it,ImageData:it,HTMLImageArray:!1,HTMLVideo:_},static:{Boolean:tt,Float:ot,Integer:at,Array:mt,"Array(2)":Et,"Array(3)":kt,"Array(4)":Tt,"Array1D(2)":dt,"Array1D(3)":dt,"Array1D(4)":dt,"Array2D(2)":xt,"Array2D(3)":xt,"Array2D(4)":xt,"Array3D(2)":_t,"Array3D(3)":_t,"Array3D(4)":_t,Input:$,NumberTexture:ut,"ArrayTexture(1)":ut,"ArrayTexture(2)":ut,"ArrayTexture(3)":ut,"ArrayTexture(4)":ut,MemoryOptimizedNumberTexture:ct,HTMLCanvas:nt,OffscreenCanvas:nt,HTMLImage:nt,ImageBitmap:nt,ImageData:nt,HTMLImageArray:!1,HTMLVideo:j}}};function Mt(Dt,Bt,Kt,Wt){if(!Dt)throw new Error("type missing");if(!Bt)throw new Error("dynamic missing");if(!Kt)throw new Error("precision missing");Wt.type&&(Dt=Wt.type);const zt=Ot[Kt][Bt];if(zt[Dt]===!1)return null;if(zt[Dt]===void 0)throw new Error(`Could not find a KernelValue for ${Dt}`);return zt[Dt]}a.exports={lookupKernelValueType:Mt,kernelValueMaps:Ot}},{"./kernel-value/array2":41,"./kernel-value/array3":42,"./kernel-value/array4":43,"./kernel-value/boolean":44,"./kernel-value/dynamic-html-image":45,"./kernel-value/dynamic-html-video":46,"./kernel-value/dynamic-memory-optimized-number-texture":47,"./kernel-value/dynamic-number-texture":48,"./kernel-value/dynamic-single-array":49,"./kernel-value/dynamic-single-array1d-i":50,"./kernel-value/dynamic-single-array2d-i":51,"./kernel-value/dynamic-single-array3d-i":52,"./kernel-value/dynamic-single-input":53,"./kernel-value/dynamic-unsigned-array":54,"./kernel-value/dynamic-unsigned-input":55,"./kernel-value/float":56,"./kernel-value/html-image":57,"./kernel-value/html-video":58,"./kernel-value/integer":60,"./kernel-value/memory-optimized-number-texture":61,"./kernel-value/number-texture":62,"./kernel-value/single-array":63,"./kernel-value/single-array1d-i":64,"./kernel-value/single-array2d-i":65,"./kernel-value/single-array3d-i":66,"./kernel-value/single-input":67,"./kernel-value/unsigned-array":68,"./kernel-value/unsigned-input":69}],40:[function(o,a,rt){const{WebGLKernelValue:tt}=o("./index"),{Input:ot}=o("../../../input");class at extends tt{checkSize(it,j){if(!this.kernel.validate)return;const{maxTextureSize:_}=this.kernel.constructor.features;if(it>_||j>_)throw it>j?new Error(`Argument texture width of ${it} larger than maximum size of ${_} for your GPU`):itTt===Et.name)&&yt.push(Et)}return yt}initExtensions(){this.extensions={OES_texture_float:this.context.getExtension("OES_texture_float"),OES_texture_float_linear:this.context.getExtension("OES_texture_float_linear"),OES_element_index_uint:this.context.getExtension("OES_element_index_uint"),WEBGL_draw_buffers:this.context.getExtension("WEBGL_draw_buffers"),WEBGL_color_buffer_float:this.context.getExtension("WEBGL_color_buffer_float")}}validateSettings(xt){if(!this.validate){this.texSize=nt.getKernelTextureSize({optimizeFloatMemory:this.optimizeFloatMemory,precision:this.precision},this.output);return}const{features:yt}=this.constructor;if(this.optimizeFloatMemory===!0&&!yt.isTextureFloat)throw new Error("Float textures are not supported");if(this.precision==="single"&&!yt.isFloatRead)throw new Error("Single precision not supported");if(!this.graphical&&this.precision===null&&yt.isTextureFloat&&(this.precision=yt.isFloatRead?"single":"unsigned"),this.subKernels&&this.subKernels.length>0&&!this.extensions.WEBGL_draw_buffers)throw new Error("could not instantiate draw buffers extension");if(this.fixIntegerDivisionAccuracy===null?this.fixIntegerDivisionAccuracy=!yt.isIntegerDivisionAccurate:this.fixIntegerDivisionAccuracy&&yt.isIntegerDivisionAccurate&&(this.fixIntegerDivisionAccuracy=!1),this.checkOutput(),!this.output||this.output.length===0){if(xt.length!==1)throw new Error("Auto output only supported for kernels with only one input");const _t=nt.getVariableType(xt[0],this.strictIntegers);switch(_t){case"Array":this.output=nt.getDimensions(_t);break;case"NumberTexture":case"MemoryOptimizedNumberTexture":case"ArrayTexture(1)":case"ArrayTexture(2)":case"ArrayTexture(3)":case"ArrayTexture(4)":this.output=xt[0].output;break;default:throw new Error("Auto output not supported for input type: "+_t)}}if(this.graphical){if(this.output.length!==2)throw new Error("Output must have 2 dimensions on graphical mode");this.precision==="precision"&&(this.precision="unsigned",console.warn("Cannot use graphical mode and single precision at the same time")),this.texSize=nt.clone(this.output);return}else this.precision===null&&yt.isTextureFloat&&(this.precision="single");this.texSize=nt.getKernelTextureSize({optimizeFloatMemory:this.optimizeFloatMemory,precision:this.precision},this.output),this.checkTextureSize()}updateMaxTexSize(){const{texSize:xt,canvas:yt}=this;if(this.maxTexSize===null){let _t=mt.indexOf(yt);_t===-1&&(_t=mt.length,mt.push(yt),gt[_t]=[xt[0],xt[1]]),this.maxTexSize=gt[_t]}this.maxTexSize[0]this.argumentNames.length)throw new Error("too many arguments for kernel");const{context:_t}=this;let Ct=0;const Et=()=>this.createTexture(),kt=()=>this.constantTextureCount+Ct++,Tt=It=>{this.switchKernels({type:"argumentMismatch",needed:It})},$t=()=>_t.TEXTURE0+this.constantTextureCount+this.argumentTextureCount++;for(let It=0;Itthis.createTexture(),onRequestIndex:()=>Ct++,onRequestContextHandle:()=>yt.TEXTURE0+this.constantTextureCount++});this.constantBitRatios[Et]=It.bitRatio,this.kernelConstants.push(It),It.setup(),It.forceUploadEachRun&&this.forceUploadKernelConstants.push(It)}}build(){if(this.built||(this.initExtensions(),this.validateSettings(arguments),this.setupConstants(arguments),this.fallbackRequested)||(this.setupArguments(arguments),this.fallbackRequested))return;this.updateMaxTexSize(),this.translateSource();const xt=this.pickRenderStrategy(arguments);if(xt)return xt;const{texSize:yt,context:_t,canvas:Ct}=this;_t.enable(_t.SCISSOR_TEST),this.pipeline&&this.precision==="single"?(_t.viewport(0,0,this.maxTexSize[0],this.maxTexSize[1]),Ct.width=this.maxTexSize[0],Ct.height=this.maxTexSize[1]):(_t.viewport(0,0,this.maxTexSize[0],this.maxTexSize[1]),Ct.width=this.maxTexSize[0],Ct.height=this.maxTexSize[1]);const Et=this.threadDim=Array.from(this.output);for(;Et.length<3;)Et.push(1);const kt=this.getVertexShader(arguments),Tt=_t.createShader(_t.VERTEX_SHADER);_t.shaderSource(Tt,kt),_t.compileShader(Tt),this.vertShader=Tt;const $t=this.getFragmentShader(arguments),It=_t.createShader(_t.FRAGMENT_SHADER);if(_t.shaderSource(It,$t),_t.compileShader(It),this.fragShader=It,this.debug&&(console.log("GLSL Shader Output:"),console.log($t)),!_t.getShaderParameter(Tt,_t.COMPILE_STATUS))throw new Error("Error compiling vertex shader: "+_t.getShaderInfoLog(Tt));if(!_t.getShaderParameter(It,_t.COMPILE_STATUS))throw new Error("Error compiling fragment shader: "+_t.getShaderInfoLog(It));const Ot=this.program=_t.createProgram();_t.attachShader(Ot,Tt),_t.attachShader(Ot,It),_t.linkProgram(Ot),this.framebuffer=_t.createFramebuffer(),this.framebuffer.width=yt[0],this.framebuffer.height=yt[1],this.rawValueFramebuffers={};const Mt=new Float32Array([-1,-1,1,-1,-1,1,1,1]),Dt=new Float32Array([0,0,1,0,0,1,1,1]),Bt=Mt.byteLength;let Kt=this.buffer;Kt?_t.bindBuffer(_t.ARRAY_BUFFER,Kt):(Kt=this.buffer=_t.createBuffer(),_t.bindBuffer(_t.ARRAY_BUFFER,Kt),_t.bufferData(_t.ARRAY_BUFFER,Mt.byteLength+Dt.byteLength,_t.STATIC_DRAW)),_t.bufferSubData(_t.ARRAY_BUFFER,0,Mt),_t.bufferSubData(_t.ARRAY_BUFFER,Bt,Dt);const Wt=_t.getAttribLocation(this.program,"aPos");_t.enableVertexAttribArray(Wt),_t.vertexAttribPointer(Wt,2,_t.FLOAT,!1,0,0);const zt=_t.getAttribLocation(this.program,"aTexCoord");_t.enableVertexAttribArray(zt),_t.vertexAttribPointer(zt,2,_t.FLOAT,!1,0,Bt),_t.bindFramebuffer(_t.FRAMEBUFFER,this.framebuffer);let Ht=0;_t.useProgram(this.program);for(let Zt in this.constants)this.kernelConstants[Ht++].updateValue(this.constants[Zt]);this._setupOutputTexture(),this.subKernels!==null&&this.subKernels.length>0&&(this._mappedTextureSwitched={},this._setupSubOutputTextures()),this.buildSignature(arguments),this.built=!0}translateSource(){const xt=ot.fromKernel(this,at,{fixIntegerDivisionAccuracy:this.fixIntegerDivisionAccuracy});this.translatedSource=xt.getPrototypeString("kernel"),this.setupReturnTypes(xt)}setupReturnTypes(xt){if(!this.graphical&&!this.returnType&&(this.returnType=xt.getKernelResultType()),this.subKernels&&this.subKernels.length>0)for(let yt=0;ytTt===Et.name)&&yt.push(Et)}return yt}initExtensions(){this.extensions={OES_texture_float:this.context.getExtension("OES_texture_float"),OES_texture_float_linear:this.context.getExtension("OES_texture_float_linear"),OES_element_index_uint:this.context.getExtension("OES_element_index_uint"),WEBGL_draw_buffers:this.context.getExtension("WEBGL_draw_buffers"),WEBGL_color_buffer_float:this.context.getExtension("WEBGL_color_buffer_float")}}validateSettings(xt){if(!this.validate){this.texSize=nt.getKernelTextureSize({optimizeFloatMemory:this.optimizeFloatMemory,precision:this.precision},this.output);return}const{features:yt}=this.constructor;if(this.optimizeFloatMemory===!0&&!yt.isTextureFloat)throw new Error("Float textures are not supported");if(this.precision==="single"&&!yt.isFloatRead)throw new Error("Single precision not supported");if(!this.graphical&&this.precision===null&&yt.isTextureFloat&&(this.precision=yt.isFloatRead?"single":"unsigned"),this.subKernels&&this.subKernels.length>0&&!this.extensions.WEBGL_draw_buffers)throw new Error("could not instantiate draw buffers extension");if(this.fixIntegerDivisionAccuracy===null?this.fixIntegerDivisionAccuracy=!yt.isIntegerDivisionAccurate:this.fixIntegerDivisionAccuracy&&yt.isIntegerDivisionAccurate&&(this.fixIntegerDivisionAccuracy=!1),this.checkOutput(),!this.output||this.output.length===0){if(xt.length!==1)throw new Error("Auto output only supported for kernels with only one input");const _t=nt.getVariableType(xt[0],this.strictIntegers);switch(_t){case"Array":this.output=nt.getDimensions(_t);break;case"NumberTexture":case"MemoryOptimizedNumberTexture":case"ArrayTexture(1)":case"ArrayTexture(2)":case"ArrayTexture(3)":case"ArrayTexture(4)":this.output=xt[0].output;break;default:throw new Error("Auto output not supported for input type: "+_t)}}if(this.graphical){if(this.output.length!==2)throw new Error("Output must have 2 dimensions on graphical mode");this.precision==="precision"&&(this.precision="unsigned",console.warn("Cannot use graphical mode and single precision at the same time")),this.texSize=nt.clone(this.output);return}else this.precision===null&&yt.isTextureFloat&&(this.precision="single");this.texSize=nt.getKernelTextureSize({optimizeFloatMemory:this.optimizeFloatMemory,precision:this.precision},this.output),this.checkTextureSize()}updateMaxTexSize(){const{texSize:xt,canvas:yt}=this;if(this.maxTexSize===null){let _t=mt.indexOf(yt);_t===-1&&(_t=mt.length,mt.push(yt),gt[_t]=[xt[0],xt[1]]),this.maxTexSize=gt[_t]}this.maxTexSize[0]this.argumentNames.length)throw new Error("too many arguments for kernel");const{context:_t}=this;let Ct=0;const Et=()=>this.createTexture(),kt=()=>this.constantTextureCount+Ct++,Tt=It=>{this.switchKernels({type:"argumentMismatch",needed:It})},$t=()=>_t.TEXTURE0+this.constantTextureCount+this.argumentTextureCount++;for(let It=0;Itthis.createTexture(),onRequestIndex:()=>Ct++,onRequestContextHandle:()=>yt.TEXTURE0+this.constantTextureCount++});this.constantBitRatios[Et]=It.bitRatio,this.kernelConstants.push(It),It.setup(),It.forceUploadEachRun&&this.forceUploadKernelConstants.push(It)}}build(){if(this.built||(this.initExtensions(),this.validateSettings(arguments),this.setupConstants(arguments),this.fallbackRequested)||(this.setupArguments(arguments),this.fallbackRequested))return;this.updateMaxTexSize(),this.translateSource();const xt=this.pickRenderStrategy(arguments);if(xt)return xt;const{texSize:yt,context:_t,canvas:Ct}=this;_t.enable(_t.SCISSOR_TEST),this.pipeline&&this.precision==="single"?(_t.viewport(0,0,this.maxTexSize[0],this.maxTexSize[1]),Ct.width=this.maxTexSize[0],Ct.height=this.maxTexSize[1]):(_t.viewport(0,0,this.maxTexSize[0],this.maxTexSize[1]),Ct.width=this.maxTexSize[0],Ct.height=this.maxTexSize[1]);const Et=this.threadDim=Array.from(this.output);for(;Et.length<3;)Et.push(1);const kt=this.getVertexShader(arguments),Tt=_t.createShader(_t.VERTEX_SHADER);_t.shaderSource(Tt,kt),_t.compileShader(Tt),this.vertShader=Tt;const $t=this.getFragmentShader(arguments),It=_t.createShader(_t.FRAGMENT_SHADER);if(_t.shaderSource(It,$t),_t.compileShader(It),this.fragShader=It,this.debug&&(console.log("GLSL Shader Output:"),console.log($t)),!_t.getShaderParameter(Tt,_t.COMPILE_STATUS))throw new Error("Error compiling vertex shader: "+_t.getShaderInfoLog(Tt));if(!_t.getShaderParameter(It,_t.COMPILE_STATUS))throw new Error("Error compiling fragment shader: "+_t.getShaderInfoLog(It));const Ot=this.program=_t.createProgram();_t.attachShader(Ot,Tt),_t.attachShader(Ot,It),_t.linkProgram(Ot),this.framebuffer=_t.createFramebuffer(),this.framebuffer.width=yt[0],this.framebuffer.height=yt[1],this.rawValueFramebuffers={};const Mt=new Float32Array([-1,-1,1,-1,-1,1,1,1]),Dt=new Float32Array([0,0,1,0,0,1,1,1]),Bt=Mt.byteLength;let Kt=this.buffer;Kt?_t.bindBuffer(_t.ARRAY_BUFFER,Kt):(Kt=this.buffer=_t.createBuffer(),_t.bindBuffer(_t.ARRAY_BUFFER,Kt),_t.bufferData(_t.ARRAY_BUFFER,Mt.byteLength+Dt.byteLength,_t.STATIC_DRAW)),_t.bufferSubData(_t.ARRAY_BUFFER,0,Mt),_t.bufferSubData(_t.ARRAY_BUFFER,Bt,Dt);const Wt=_t.getAttribLocation(this.program,"aPos");_t.enableVertexAttribArray(Wt),_t.vertexAttribPointer(Wt,2,_t.FLOAT,!1,0,0);const zt=_t.getAttribLocation(this.program,"aTexCoord");_t.enableVertexAttribArray(zt),_t.vertexAttribPointer(zt,2,_t.FLOAT,!1,0,Bt),_t.bindFramebuffer(_t.FRAMEBUFFER,this.framebuffer);let Ht=0;_t.useProgram(this.program);for(let Zt in this.constants)this.kernelConstants[Ht++].updateValue(this.constants[Zt]);this._setupOutputTexture(),this.subKernels!==null&&this.subKernels.length>0&&(this._mappedTextureSwitched={},this._setupSubOutputTextures()),this.buildSignature(arguments),this.built=!0}translateSource(){const xt=ot.fromKernel(this,at,{fixIntegerDivisionAccuracy:this.fixIntegerDivisionAccuracy});this.translatedSource=xt.getPrototypeString("kernel"),this.setupReturnTypes(xt)}setupReturnTypes(xt){if(!this.graphical&&!this.returnType&&(this.returnType=xt.getKernelResultType()),this.subKernels&&this.subKernels.length>0)for(let yt=0;ytxt.source&&this.source.match(xt.functionMatch)?xt.source:"").join(` @@ -2656,7 +2656,7 @@ float integerCorrectionModulo(float number, float divisor) { divisor = abs(divisor); } return number - (divisor * floor(divWithIntCheck(number, divisor))); -}`:""}_getMainArgumentsString(xt){const yt=[],{argumentNames:_t}=this;for(let Ct=0;Ct<_t.length;Ct++)yt.push(this.kernelArguments[Ct].getSource(xt[Ct]));return yt.join("")}_getInjectedNative(){return this.injectedNative||""}_getMainConstantsString(){const xt=[],{constants:yt}=this;if(yt){let _t=0;for(const Ct in yt)this.constants.hasOwnProperty(Ct)&&xt.push(this.kernelConstants[_t++].getSource(this.constants[Ct]))}return xt.join("")}getRawValueFramebuffer(xt,yt){if(this.rawValueFramebuffers[xt]||(this.rawValueFramebuffers[xt]={}),!this.rawValueFramebuffers[xt][yt]){const _t=this.context.createFramebuffer();_t.width=xt,_t.height=yt,this.rawValueFramebuffers[xt][yt]=_t}return this.rawValueFramebuffers[xt][yt]}getKernelResultDeclaration(){switch(this.returnType){case"Array(2)":return"vec2 kernelResult";case"Array(3)":return"vec3 kernelResult";case"Array(4)":return"vec4 kernelResult";case"LiteralInteger":case"Float":case"Number":case"Integer":return"float kernelResult";default:if(this.graphical)return"float kernelResult";throw new Error(`unrecognized output type "${this.returnType}"`)}}getKernelString(){const xt=[this.getKernelResultDeclaration()],{subKernels:yt}=this;if(yt!==null)switch(this.returnType){case"Number":case"Float":case"Integer":for(let _t=0;_t{if(yt.hasOwnProperty(Ct))return yt[Ct];throw`unhandled artifact ${Ct}`})}getFragmentShader(xt){return this.compiledFragmentShader!==null?this.compiledFragmentShader:this.compiledFragmentShader=this.replaceArtifacts(this.constructor.fragmentShader,this._getFragShaderArtifactMap(xt))}getVertexShader(xt){return this.compiledVertexShader!==null?this.compiledVertexShader:this.compiledVertexShader=this.replaceArtifacts(this.constructor.vertexShader,this._getVertShaderArtifactMap(xt))}toString(){const xt=nt.linesToString(["const gl = context"]);return $(this.constructor,arguments,this,xt)}destroy(xt){if(!this.context)return;this.buffer&&this.context.deleteBuffer(this.buffer),this.framebuffer&&this.context.deleteFramebuffer(this.framebuffer);for(const _t in this.rawValueFramebuffers){for(const Ct in this.rawValueFramebuffers[_t])this.context.deleteFramebuffer(this.rawValueFramebuffers[_t][Ct]),delete this.rawValueFramebuffers[_t][Ct];delete this.rawValueFramebuffers[_t]}if(this.vertShader&&this.context.deleteShader(this.vertShader),this.fragShader&&this.context.deleteShader(this.fragShader),this.program&&this.context.deleteProgram(this.program),this.texture){this.texture.delete();const _t=this.textureCache.indexOf(this.texture.texture);_t>-1&&this.textureCache.splice(_t,1),this.texture=null}if(this.mappedTextures&&this.mappedTextures.length){for(let _t=0;_t-1&&this.textureCache.splice(Et,1)}this.mappedTextures=null}if(this.kernelArguments)for(let _t=0;_t0;){const _t=this.textureCache.pop();this.context.deleteTexture(_t)}if(xt){const _t=mt.indexOf(this.canvas);_t>=0&&(mt[_t]=null,gt[_t]=null)}if(this.destroyExtensions(),delete this.context,delete this.canvas,!this.gpu)return;const yt=this.gpu.kernels.indexOf(this);yt!==-1&&this.gpu.kernels.splice(yt,1)}destroyExtensions(){this.extensions.OES_texture_float=null,this.extensions.OES_texture_float_linear=null,this.extensions.OES_element_index_uint=null,this.extensions.WEBGL_draw_buffers=null}static destroyContext(xt){const yt=xt.getExtension("WEBGL_lose_context");yt&&yt.loseContext()}toJSON(){const xt=super.toJSON();return xt.functionNodes=ot.fromKernel(this,at).toJSON(),xt.settings.threadDim=this.threadDim,xt}}a.exports={WebGLKernel:dt}},{"../../plugins/math-random-uniformly-distributed":112,"../../utils":114,"../function-builder":9,"../gl/kernel":13,"../gl/kernel-string":12,"./fragment-shader":37,"./function-node":38,"./kernel-value-maps":39,"./vertex-shader":71}],71:[function(o,a,rt){const et=`__FLOAT_TACTIC_DECLARATION__; +}`:""}_getMainArgumentsString(xt){const yt=[],{argumentNames:_t}=this;for(let Ct=0;Ct<_t.length;Ct++)yt.push(this.kernelArguments[Ct].getSource(xt[Ct]));return yt.join("")}_getInjectedNative(){return this.injectedNative||""}_getMainConstantsString(){const xt=[],{constants:yt}=this;if(yt){let _t=0;for(const Ct in yt)this.constants.hasOwnProperty(Ct)&&xt.push(this.kernelConstants[_t++].getSource(this.constants[Ct]))}return xt.join("")}getRawValueFramebuffer(xt,yt){if(this.rawValueFramebuffers[xt]||(this.rawValueFramebuffers[xt]={}),!this.rawValueFramebuffers[xt][yt]){const _t=this.context.createFramebuffer();_t.width=xt,_t.height=yt,this.rawValueFramebuffers[xt][yt]=_t}return this.rawValueFramebuffers[xt][yt]}getKernelResultDeclaration(){switch(this.returnType){case"Array(2)":return"vec2 kernelResult";case"Array(3)":return"vec3 kernelResult";case"Array(4)":return"vec4 kernelResult";case"LiteralInteger":case"Float":case"Number":case"Integer":return"float kernelResult";default:if(this.graphical)return"float kernelResult";throw new Error(`unrecognized output type "${this.returnType}"`)}}getKernelString(){const xt=[this.getKernelResultDeclaration()],{subKernels:yt}=this;if(yt!==null)switch(this.returnType){case"Number":case"Float":case"Integer":for(let _t=0;_t{if(yt.hasOwnProperty(Ct))return yt[Ct];throw`unhandled artifact ${Ct}`})}getFragmentShader(xt){return this.compiledFragmentShader!==null?this.compiledFragmentShader:this.compiledFragmentShader=this.replaceArtifacts(this.constructor.fragmentShader,this._getFragShaderArtifactMap(xt))}getVertexShader(xt){return this.compiledVertexShader!==null?this.compiledVertexShader:this.compiledVertexShader=this.replaceArtifacts(this.constructor.vertexShader,this._getVertShaderArtifactMap(xt))}toString(){const xt=nt.linesToString(["const gl = context"]);return $(this.constructor,arguments,this,xt)}destroy(xt){if(!this.context)return;this.buffer&&this.context.deleteBuffer(this.buffer),this.framebuffer&&this.context.deleteFramebuffer(this.framebuffer);for(const _t in this.rawValueFramebuffers){for(const Ct in this.rawValueFramebuffers[_t])this.context.deleteFramebuffer(this.rawValueFramebuffers[_t][Ct]),delete this.rawValueFramebuffers[_t][Ct];delete this.rawValueFramebuffers[_t]}if(this.vertShader&&this.context.deleteShader(this.vertShader),this.fragShader&&this.context.deleteShader(this.fragShader),this.program&&this.context.deleteProgram(this.program),this.texture){this.texture.delete();const _t=this.textureCache.indexOf(this.texture.texture);_t>-1&&this.textureCache.splice(_t,1),this.texture=null}if(this.mappedTextures&&this.mappedTextures.length){for(let _t=0;_t-1&&this.textureCache.splice(Et,1)}this.mappedTextures=null}if(this.kernelArguments)for(let _t=0;_t0;){const _t=this.textureCache.pop();this.context.deleteTexture(_t)}if(xt){const _t=mt.indexOf(this.canvas);_t>=0&&(mt[_t]=null,gt[_t]=null)}if(this.destroyExtensions(),delete this.context,delete this.canvas,!this.gpu)return;const yt=this.gpu.kernels.indexOf(this);yt!==-1&&this.gpu.kernels.splice(yt,1)}destroyExtensions(){this.extensions.OES_texture_float=null,this.extensions.OES_texture_float_linear=null,this.extensions.OES_element_index_uint=null,this.extensions.WEBGL_draw_buffers=null}static destroyContext(xt){const yt=xt.getExtension("WEBGL_lose_context");yt&&yt.loseContext()}toJSON(){const xt=super.toJSON();return xt.functionNodes=ot.fromKernel(this,at).toJSON(),xt.settings.threadDim=this.threadDim,xt}}a.exports={WebGLKernel:dt}},{"../../plugins/math-random-uniformly-distributed":112,"../../utils":114,"../function-builder":9,"../gl/kernel":13,"../gl/kernel-string":12,"./fragment-shader":37,"./function-node":38,"./kernel-value-maps":39,"./vertex-shader":71}],71:[function(o,a,rt){const tt=`__FLOAT_TACTIC_DECLARATION__; __INT_TACTIC_DECLARATION__; __SAMPLER_2D_TACTIC_DECLARATION__; @@ -2669,7 +2669,7 @@ uniform vec2 ratio; void main(void) { gl_Position = vec4((aPos + vec2(1)) * ratio + vec2(-1), 0, 1); vTexCoord = aTexCoord; -}`;a.exports={vertexShader:et}},{}],72:[function(o,a,rt){const et=`#version 300 es +}`;a.exports={vertexShader:tt}},{}],72:[function(o,a,rt){const tt=`#version 300 es __HEADER__; __FLOAT_TACTIC_DECLARATION__; __INT_TACTIC_DECLARATION__; @@ -3115,12 +3115,12 @@ __KERNEL__; void main(void) { index = int(vTexCoord.s * float(uTexSize.x)) + int(vTexCoord.t * float(uTexSize.y)) * uTexSize.x; __MAIN_RESULT__; -}`;a.exports={fragmentShader:et}},{}],73:[function(o,a,rt){const{utils:et}=o("../../utils"),{WebGLFunctionNode:ot}=o("../web-gl/function-node");class at extends ot{astIdentifierExpression(it,j){if(it.type!=="Identifier")throw this.astErrorOutput("IdentifierExpression - not an Identifier",it);const _=this.getType(it),$=et.sanitizeName(it.name);return it.name==="Infinity"?j.push("intBitsToFloat(2139095039)"):_==="Boolean"?this.argumentNames.indexOf($)>-1?j.push(`bool(user_${$})`):j.push(`user_${$}`):j.push(`user_${$}`),j}}a.exports={WebGL2FunctionNode:at}},{"../../utils":114,"../web-gl/function-node":38}],74:[function(o,a,rt){const{WebGL2KernelValueBoolean:et}=o("./kernel-value/boolean"),{WebGL2KernelValueFloat:ot}=o("./kernel-value/float"),{WebGL2KernelValueInteger:at}=o("./kernel-value/integer"),{WebGL2KernelValueHTMLImage:nt}=o("./kernel-value/html-image"),{WebGL2KernelValueDynamicHTMLImage:it}=o("./kernel-value/dynamic-html-image"),{WebGL2KernelValueHTMLImageArray:j}=o("./kernel-value/html-image-array"),{WebGL2KernelValueDynamicHTMLImageArray:_}=o("./kernel-value/dynamic-html-image-array"),{WebGL2KernelValueHTMLVideo:$}=o("./kernel-value/html-video"),{WebGL2KernelValueDynamicHTMLVideo:tt}=o("./kernel-value/dynamic-html-video"),{WebGL2KernelValueSingleInput:st}=o("./kernel-value/single-input"),{WebGL2KernelValueDynamicSingleInput:lt}=o("./kernel-value/dynamic-single-input"),{WebGL2KernelValueUnsignedInput:ct}=o("./kernel-value/unsigned-input"),{WebGL2KernelValueDynamicUnsignedInput:ht}=o("./kernel-value/dynamic-unsigned-input"),{WebGL2KernelValueMemoryOptimizedNumberTexture:ut}=o("./kernel-value/memory-optimized-number-texture"),{WebGL2KernelValueDynamicMemoryOptimizedNumberTexture:pt}=o("./kernel-value/dynamic-memory-optimized-number-texture"),{WebGL2KernelValueNumberTexture:mt}=o("./kernel-value/number-texture"),{WebGL2KernelValueDynamicNumberTexture:gt}=o("./kernel-value/dynamic-number-texture"),{WebGL2KernelValueSingleArray:dt}=o("./kernel-value/single-array"),{WebGL2KernelValueDynamicSingleArray:St}=o("./kernel-value/dynamic-single-array"),{WebGL2KernelValueSingleArray1DI:xt}=o("./kernel-value/single-array1d-i"),{WebGL2KernelValueDynamicSingleArray1DI:yt}=o("./kernel-value/dynamic-single-array1d-i"),{WebGL2KernelValueSingleArray2DI:_t}=o("./kernel-value/single-array2d-i"),{WebGL2KernelValueDynamicSingleArray2DI:Ct}=o("./kernel-value/dynamic-single-array2d-i"),{WebGL2KernelValueSingleArray3DI:Et}=o("./kernel-value/single-array3d-i"),{WebGL2KernelValueDynamicSingleArray3DI:kt}=o("./kernel-value/dynamic-single-array3d-i"),{WebGL2KernelValueArray2:Tt}=o("./kernel-value/array2"),{WebGL2KernelValueArray3:$t}=o("./kernel-value/array3"),{WebGL2KernelValueArray4:It}=o("./kernel-value/array4"),{WebGL2KernelValueUnsignedArray:Ot}=o("./kernel-value/unsigned-array"),{WebGL2KernelValueDynamicUnsignedArray:Mt}=o("./kernel-value/dynamic-unsigned-array"),Dt={unsigned:{dynamic:{Boolean:et,Integer:at,Float:ot,Array:Mt,"Array(2)":Tt,"Array(3)":$t,"Array(4)":It,"Array1D(2)":!1,"Array1D(3)":!1,"Array1D(4)":!1,"Array2D(2)":!1,"Array2D(3)":!1,"Array2D(4)":!1,"Array3D(2)":!1,"Array3D(3)":!1,"Array3D(4)":!1,Input:ht,NumberTexture:gt,"ArrayTexture(1)":gt,"ArrayTexture(2)":gt,"ArrayTexture(3)":gt,"ArrayTexture(4)":gt,MemoryOptimizedNumberTexture:pt,HTMLCanvas:it,OffscreenCanvas:it,HTMLImage:it,ImageBitmap:it,ImageData:it,HTMLImageArray:_,HTMLVideo:tt},static:{Boolean:et,Float:ot,Integer:at,Array:Ot,"Array(2)":Tt,"Array(3)":$t,"Array(4)":It,"Array1D(2)":!1,"Array1D(3)":!1,"Array1D(4)":!1,"Array2D(2)":!1,"Array2D(3)":!1,"Array2D(4)":!1,"Array3D(2)":!1,"Array3D(3)":!1,"Array3D(4)":!1,Input:ct,NumberTexture:mt,"ArrayTexture(1)":mt,"ArrayTexture(2)":mt,"ArrayTexture(3)":mt,"ArrayTexture(4)":mt,MemoryOptimizedNumberTexture:pt,HTMLCanvas:nt,OffscreenCanvas:nt,HTMLImage:nt,ImageBitmap:nt,ImageData:nt,HTMLImageArray:j,HTMLVideo:$}},single:{dynamic:{Boolean:et,Integer:at,Float:ot,Array:St,"Array(2)":Tt,"Array(3)":$t,"Array(4)":It,"Array1D(2)":yt,"Array1D(3)":yt,"Array1D(4)":yt,"Array2D(2)":Ct,"Array2D(3)":Ct,"Array2D(4)":Ct,"Array3D(2)":kt,"Array3D(3)":kt,"Array3D(4)":kt,Input:lt,NumberTexture:gt,"ArrayTexture(1)":gt,"ArrayTexture(2)":gt,"ArrayTexture(3)":gt,"ArrayTexture(4)":gt,MemoryOptimizedNumberTexture:pt,HTMLCanvas:it,OffscreenCanvas:it,HTMLImage:it,ImageBitmap:it,ImageData:it,HTMLImageArray:_,HTMLVideo:tt},static:{Boolean:et,Float:ot,Integer:at,Array:dt,"Array(2)":Tt,"Array(3)":$t,"Array(4)":It,"Array1D(2)":xt,"Array1D(3)":xt,"Array1D(4)":xt,"Array2D(2)":_t,"Array2D(3)":_t,"Array2D(4)":_t,"Array3D(2)":Et,"Array3D(3)":Et,"Array3D(4)":Et,Input:st,NumberTexture:mt,"ArrayTexture(1)":mt,"ArrayTexture(2)":mt,"ArrayTexture(3)":mt,"ArrayTexture(4)":mt,MemoryOptimizedNumberTexture:ut,HTMLCanvas:nt,OffscreenCanvas:nt,HTMLImage:nt,ImageBitmap:nt,ImageData:nt,HTMLImageArray:j,HTMLVideo:$}}};function Bt(Kt,Wt,zt,Ht){if(!Kt)throw new Error("type missing");if(!Wt)throw new Error("dynamic missing");if(!zt)throw new Error("precision missing");Ht.type&&(Kt=Ht.type);const Zt=Dt[zt][Wt];if(Zt[Kt]===!1)return null;if(Zt[Kt]===void 0)throw new Error(`Could not find a KernelValue for ${Kt}`);return Zt[Kt]}a.exports={kernelValueMaps:Dt,lookupKernelValueType:Bt}},{"./kernel-value/array2":75,"./kernel-value/array3":76,"./kernel-value/array4":77,"./kernel-value/boolean":78,"./kernel-value/dynamic-html-image":80,"./kernel-value/dynamic-html-image-array":79,"./kernel-value/dynamic-html-video":81,"./kernel-value/dynamic-memory-optimized-number-texture":82,"./kernel-value/dynamic-number-texture":83,"./kernel-value/dynamic-single-array":84,"./kernel-value/dynamic-single-array1d-i":85,"./kernel-value/dynamic-single-array2d-i":86,"./kernel-value/dynamic-single-array3d-i":87,"./kernel-value/dynamic-single-input":88,"./kernel-value/dynamic-unsigned-array":89,"./kernel-value/dynamic-unsigned-input":90,"./kernel-value/float":91,"./kernel-value/html-image":93,"./kernel-value/html-image-array":92,"./kernel-value/html-video":94,"./kernel-value/integer":95,"./kernel-value/memory-optimized-number-texture":96,"./kernel-value/number-texture":97,"./kernel-value/single-array":98,"./kernel-value/single-array1d-i":99,"./kernel-value/single-array2d-i":100,"./kernel-value/single-array3d-i":101,"./kernel-value/single-input":102,"./kernel-value/unsigned-array":103,"./kernel-value/unsigned-input":104}],75:[function(o,a,rt){const{WebGLKernelValueArray2:et}=o("../../web-gl/kernel-value/array2");class ot extends et{}a.exports={WebGL2KernelValueArray2:ot}},{"../../web-gl/kernel-value/array2":41}],76:[function(o,a,rt){const{WebGLKernelValueArray3:et}=o("../../web-gl/kernel-value/array3");class ot extends et{}a.exports={WebGL2KernelValueArray3:ot}},{"../../web-gl/kernel-value/array3":42}],77:[function(o,a,rt){const{WebGLKernelValueArray4:et}=o("../../web-gl/kernel-value/array4");class ot extends et{}a.exports={WebGL2KernelValueArray4:ot}},{"../../web-gl/kernel-value/array4":43}],78:[function(o,a,rt){const{WebGLKernelValueBoolean:et}=o("../../web-gl/kernel-value/boolean");class ot extends et{}a.exports={WebGL2KernelValueBoolean:ot}},{"../../web-gl/kernel-value/boolean":44}],79:[function(o,a,rt){const{utils:et}=o("../../../utils"),{WebGL2KernelValueHTMLImageArray:ot}=o("./html-image-array");class at extends ot{getSource(){const it=this.getVariablePrecisionString();return et.linesToString([`uniform ${it} sampler2DArray ${this.id}`,`uniform ${it} ivec2 ${this.sizeId}`,`uniform ${it} ivec3 ${this.dimensionsId}`])}updateValue(it){const{width:j,height:_}=it[0];this.checkSize(j,_),this.dimensions=[j,_,it.length],this.textureSize=[j,_],this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(it)}}a.exports={WebGL2KernelValueDynamicHTMLImageArray:at}},{"../../../utils":114,"./html-image-array":92}],80:[function(o,a,rt){const{utils:et}=o("../../../utils"),{WebGLKernelValueDynamicHTMLImage:ot}=o("../../web-gl/kernel-value/dynamic-html-image");class at extends ot{getSource(){const it=this.getVariablePrecisionString();return et.linesToString([`uniform ${it} sampler2D ${this.id}`,`uniform ${it} ivec2 ${this.sizeId}`,`uniform ${it} ivec3 ${this.dimensionsId}`])}}a.exports={WebGL2KernelValueDynamicHTMLImage:at}},{"../../../utils":114,"../../web-gl/kernel-value/dynamic-html-image":45}],81:[function(o,a,rt){o("../../../utils");const{WebGL2KernelValueDynamicHTMLImage:et}=o("./dynamic-html-image");class ot extends et{}a.exports={WebGL2KernelValueDynamicHTMLVideo:ot}},{"../../../utils":114,"./dynamic-html-image":80}],82:[function(o,a,rt){const{utils:et}=o("../../../utils"),{WebGLKernelValueDynamicMemoryOptimizedNumberTexture:ot}=o("../../web-gl/kernel-value/dynamic-memory-optimized-number-texture");class at extends ot{getSource(){return et.linesToString([`uniform sampler2D ${this.id}`,`uniform ivec2 ${this.sizeId}`,`uniform ivec3 ${this.dimensionsId}`])}}a.exports={WebGL2KernelValueDynamicMemoryOptimizedNumberTexture:at}},{"../../../utils":114,"../../web-gl/kernel-value/dynamic-memory-optimized-number-texture":47}],83:[function(o,a,rt){const{utils:et}=o("../../../utils"),{WebGLKernelValueDynamicNumberTexture:ot}=o("../../web-gl/kernel-value/dynamic-number-texture");class at extends ot{getSource(){const it=this.getVariablePrecisionString();return et.linesToString([`uniform ${it} sampler2D ${this.id}`,`uniform ${it} ivec2 ${this.sizeId}`,`uniform ${it} ivec3 ${this.dimensionsId}`])}}a.exports={WebGL2KernelValueDynamicNumberTexture:at}},{"../../../utils":114,"../../web-gl/kernel-value/dynamic-number-texture":48}],84:[function(o,a,rt){const{utils:et}=o("../../../utils"),{WebGL2KernelValueSingleArray:ot}=o("../../web-gl2/kernel-value/single-array");class at extends ot{getSource(){const it=this.getVariablePrecisionString();return et.linesToString([`uniform ${it} sampler2D ${this.id}`,`uniform ${it} ivec2 ${this.sizeId}`,`uniform ${it} ivec3 ${this.dimensionsId}`])}updateValue(it){this.dimensions=et.getDimensions(it,!0),this.textureSize=et.getMemoryOptimizedFloatTextureSize(this.dimensions,this.bitRatio),this.uploadArrayLength=this.textureSize[0]*this.textureSize[1]*this.bitRatio,this.checkSize(this.textureSize[0],this.textureSize[1]),this.uploadValue=new Float32Array(this.uploadArrayLength),this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(it)}}a.exports={WebGL2KernelValueDynamicSingleArray:at}},{"../../../utils":114,"../../web-gl2/kernel-value/single-array":98}],85:[function(o,a,rt){const{utils:et}=o("../../../utils"),{WebGL2KernelValueSingleArray1DI:ot}=o("../../web-gl2/kernel-value/single-array1d-i");class at extends ot{getSource(){const it=this.getVariablePrecisionString();return et.linesToString([`uniform ${it} sampler2D ${this.id}`,`uniform ${it} ivec2 ${this.sizeId}`,`uniform ${it} ivec3 ${this.dimensionsId}`])}updateValue(it){this.setShape(it),this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(it)}}a.exports={WebGL2KernelValueDynamicSingleArray1DI:at}},{"../../../utils":114,"../../web-gl2/kernel-value/single-array1d-i":99}],86:[function(o,a,rt){const{utils:et}=o("../../../utils"),{WebGL2KernelValueSingleArray2DI:ot}=o("../../web-gl2/kernel-value/single-array2d-i");class at extends ot{getSource(){const it=this.getVariablePrecisionString();return et.linesToString([`uniform ${it} sampler2D ${this.id}`,`uniform ${it} ivec2 ${this.sizeId}`,`uniform ${it} ivec3 ${this.dimensionsId}`])}updateValue(it){this.setShape(it),this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(it)}}a.exports={WebGL2KernelValueDynamicSingleArray2DI:at}},{"../../../utils":114,"../../web-gl2/kernel-value/single-array2d-i":100}],87:[function(o,a,rt){const{utils:et}=o("../../../utils"),{WebGL2KernelValueSingleArray3DI:ot}=o("../../web-gl2/kernel-value/single-array3d-i");class at extends ot{getSource(){const it=this.getVariablePrecisionString();return et.linesToString([`uniform ${it} sampler2D ${this.id}`,`uniform ${it} ivec2 ${this.sizeId}`,`uniform ${it} ivec3 ${this.dimensionsId}`])}updateValue(it){this.setShape(it),this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(it)}}a.exports={WebGL2KernelValueDynamicSingleArray3DI:at}},{"../../../utils":114,"../../web-gl2/kernel-value/single-array3d-i":101}],88:[function(o,a,rt){const{utils:et}=o("../../../utils"),{WebGL2KernelValueSingleInput:ot}=o("../../web-gl2/kernel-value/single-input");class at extends ot{getSource(){const it=this.getVariablePrecisionString();return et.linesToString([`uniform ${it} sampler2D ${this.id}`,`uniform ${it} ivec2 ${this.sizeId}`,`uniform ${it} ivec3 ${this.dimensionsId}`])}updateValue(it){let[j,_,$]=it.size;this.dimensions=new Int32Array([j||1,_||1,$||1]),this.textureSize=et.getMemoryOptimizedFloatTextureSize(this.dimensions,this.bitRatio),this.uploadArrayLength=this.textureSize[0]*this.textureSize[1]*this.bitRatio,this.checkSize(this.textureSize[0],this.textureSize[1]),this.uploadValue=new Float32Array(this.uploadArrayLength),this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(it)}}a.exports={WebGL2KernelValueDynamicSingleInput:at}},{"../../../utils":114,"../../web-gl2/kernel-value/single-input":102}],89:[function(o,a,rt){const{utils:et}=o("../../../utils"),{WebGLKernelValueDynamicUnsignedArray:ot}=o("../../web-gl/kernel-value/dynamic-unsigned-array");class at extends ot{getSource(){const it=this.getVariablePrecisionString();return et.linesToString([`uniform ${it} sampler2D ${this.id}`,`uniform ${it} ivec2 ${this.sizeId}`,`uniform ${it} ivec3 ${this.dimensionsId}`])}}a.exports={WebGL2KernelValueDynamicUnsignedArray:at}},{"../../../utils":114,"../../web-gl/kernel-value/dynamic-unsigned-array":54}],90:[function(o,a,rt){const{utils:et}=o("../../../utils"),{WebGLKernelValueDynamicUnsignedInput:ot}=o("../../web-gl/kernel-value/dynamic-unsigned-input");class at extends ot{getSource(){const it=this.getVariablePrecisionString();return et.linesToString([`uniform ${it} sampler2D ${this.id}`,`uniform ${it} ivec2 ${this.sizeId}`,`uniform ${it} ivec3 ${this.dimensionsId}`])}}a.exports={WebGL2KernelValueDynamicUnsignedInput:at}},{"../../../utils":114,"../../web-gl/kernel-value/dynamic-unsigned-input":55}],91:[function(o,a,rt){o("../../../utils");const{WebGLKernelValueFloat:et}=o("../../web-gl/kernel-value/float");class ot extends et{}a.exports={WebGL2KernelValueFloat:ot}},{"../../../utils":114,"../../web-gl/kernel-value/float":56}],92:[function(o,a,rt){const{utils:et}=o("../../../utils"),{WebGLKernelArray:ot}=o("../../web-gl/kernel-value/array");class at extends ot{constructor(it,j){super(it,j),this.checkSize(it[0].width,it[0].height),this.dimensions=[it[0].width,it[0].height,it.length],this.textureSize=[it[0].width,it[0].height]}defineTexture(){const{context:it}=this;it.activeTexture(this.contextHandle),it.bindTexture(it.TEXTURE_2D_ARRAY,this.texture),it.texParameteri(it.TEXTURE_2D_ARRAY,it.TEXTURE_MAG_FILTER,it.NEAREST),it.texParameteri(it.TEXTURE_2D_ARRAY,it.TEXTURE_MIN_FILTER,it.NEAREST)}getStringValueHandler(){return`const uploadValue_${this.name} = ${this.varName}; -`}getSource(){const it=this.getVariablePrecisionString();return et.linesToString([`uniform ${it} sampler2DArray ${this.id}`,`${it} ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`,`${it} ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`])}updateValue(it){const{context:j}=this;j.activeTexture(this.contextHandle),j.bindTexture(j.TEXTURE_2D_ARRAY,this.texture),j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,!0),j.texImage3D(j.TEXTURE_2D_ARRAY,0,j.RGBA,it[0].width,it[0].height,it.length,0,j.RGBA,j.UNSIGNED_BYTE,null);for(let _=0;_-1?j.push(`bool(user_${$})`):j.push(`user_${$}`):j.push(`user_${$}`),j}}a.exports={WebGL2FunctionNode:at}},{"../../utils":114,"../web-gl/function-node":38}],74:[function(o,a,rt){const{WebGL2KernelValueBoolean:tt}=o("./kernel-value/boolean"),{WebGL2KernelValueFloat:ot}=o("./kernel-value/float"),{WebGL2KernelValueInteger:at}=o("./kernel-value/integer"),{WebGL2KernelValueHTMLImage:nt}=o("./kernel-value/html-image"),{WebGL2KernelValueDynamicHTMLImage:it}=o("./kernel-value/dynamic-html-image"),{WebGL2KernelValueHTMLImageArray:j}=o("./kernel-value/html-image-array"),{WebGL2KernelValueDynamicHTMLImageArray:_}=o("./kernel-value/dynamic-html-image-array"),{WebGL2KernelValueHTMLVideo:$}=o("./kernel-value/html-video"),{WebGL2KernelValueDynamicHTMLVideo:et}=o("./kernel-value/dynamic-html-video"),{WebGL2KernelValueSingleInput:st}=o("./kernel-value/single-input"),{WebGL2KernelValueDynamicSingleInput:lt}=o("./kernel-value/dynamic-single-input"),{WebGL2KernelValueUnsignedInput:ct}=o("./kernel-value/unsigned-input"),{WebGL2KernelValueDynamicUnsignedInput:ht}=o("./kernel-value/dynamic-unsigned-input"),{WebGL2KernelValueMemoryOptimizedNumberTexture:ut}=o("./kernel-value/memory-optimized-number-texture"),{WebGL2KernelValueDynamicMemoryOptimizedNumberTexture:pt}=o("./kernel-value/dynamic-memory-optimized-number-texture"),{WebGL2KernelValueNumberTexture:mt}=o("./kernel-value/number-texture"),{WebGL2KernelValueDynamicNumberTexture:gt}=o("./kernel-value/dynamic-number-texture"),{WebGL2KernelValueSingleArray:dt}=o("./kernel-value/single-array"),{WebGL2KernelValueDynamicSingleArray:St}=o("./kernel-value/dynamic-single-array"),{WebGL2KernelValueSingleArray1DI:xt}=o("./kernel-value/single-array1d-i"),{WebGL2KernelValueDynamicSingleArray1DI:yt}=o("./kernel-value/dynamic-single-array1d-i"),{WebGL2KernelValueSingleArray2DI:_t}=o("./kernel-value/single-array2d-i"),{WebGL2KernelValueDynamicSingleArray2DI:Ct}=o("./kernel-value/dynamic-single-array2d-i"),{WebGL2KernelValueSingleArray3DI:Et}=o("./kernel-value/single-array3d-i"),{WebGL2KernelValueDynamicSingleArray3DI:kt}=o("./kernel-value/dynamic-single-array3d-i"),{WebGL2KernelValueArray2:Tt}=o("./kernel-value/array2"),{WebGL2KernelValueArray3:$t}=o("./kernel-value/array3"),{WebGL2KernelValueArray4:It}=o("./kernel-value/array4"),{WebGL2KernelValueUnsignedArray:Ot}=o("./kernel-value/unsigned-array"),{WebGL2KernelValueDynamicUnsignedArray:Mt}=o("./kernel-value/dynamic-unsigned-array"),Dt={unsigned:{dynamic:{Boolean:tt,Integer:at,Float:ot,Array:Mt,"Array(2)":Tt,"Array(3)":$t,"Array(4)":It,"Array1D(2)":!1,"Array1D(3)":!1,"Array1D(4)":!1,"Array2D(2)":!1,"Array2D(3)":!1,"Array2D(4)":!1,"Array3D(2)":!1,"Array3D(3)":!1,"Array3D(4)":!1,Input:ht,NumberTexture:gt,"ArrayTexture(1)":gt,"ArrayTexture(2)":gt,"ArrayTexture(3)":gt,"ArrayTexture(4)":gt,MemoryOptimizedNumberTexture:pt,HTMLCanvas:it,OffscreenCanvas:it,HTMLImage:it,ImageBitmap:it,ImageData:it,HTMLImageArray:_,HTMLVideo:et},static:{Boolean:tt,Float:ot,Integer:at,Array:Ot,"Array(2)":Tt,"Array(3)":$t,"Array(4)":It,"Array1D(2)":!1,"Array1D(3)":!1,"Array1D(4)":!1,"Array2D(2)":!1,"Array2D(3)":!1,"Array2D(4)":!1,"Array3D(2)":!1,"Array3D(3)":!1,"Array3D(4)":!1,Input:ct,NumberTexture:mt,"ArrayTexture(1)":mt,"ArrayTexture(2)":mt,"ArrayTexture(3)":mt,"ArrayTexture(4)":mt,MemoryOptimizedNumberTexture:pt,HTMLCanvas:nt,OffscreenCanvas:nt,HTMLImage:nt,ImageBitmap:nt,ImageData:nt,HTMLImageArray:j,HTMLVideo:$}},single:{dynamic:{Boolean:tt,Integer:at,Float:ot,Array:St,"Array(2)":Tt,"Array(3)":$t,"Array(4)":It,"Array1D(2)":yt,"Array1D(3)":yt,"Array1D(4)":yt,"Array2D(2)":Ct,"Array2D(3)":Ct,"Array2D(4)":Ct,"Array3D(2)":kt,"Array3D(3)":kt,"Array3D(4)":kt,Input:lt,NumberTexture:gt,"ArrayTexture(1)":gt,"ArrayTexture(2)":gt,"ArrayTexture(3)":gt,"ArrayTexture(4)":gt,MemoryOptimizedNumberTexture:pt,HTMLCanvas:it,OffscreenCanvas:it,HTMLImage:it,ImageBitmap:it,ImageData:it,HTMLImageArray:_,HTMLVideo:et},static:{Boolean:tt,Float:ot,Integer:at,Array:dt,"Array(2)":Tt,"Array(3)":$t,"Array(4)":It,"Array1D(2)":xt,"Array1D(3)":xt,"Array1D(4)":xt,"Array2D(2)":_t,"Array2D(3)":_t,"Array2D(4)":_t,"Array3D(2)":Et,"Array3D(3)":Et,"Array3D(4)":Et,Input:st,NumberTexture:mt,"ArrayTexture(1)":mt,"ArrayTexture(2)":mt,"ArrayTexture(3)":mt,"ArrayTexture(4)":mt,MemoryOptimizedNumberTexture:ut,HTMLCanvas:nt,OffscreenCanvas:nt,HTMLImage:nt,ImageBitmap:nt,ImageData:nt,HTMLImageArray:j,HTMLVideo:$}}};function Bt(Kt,Wt,zt,Ht){if(!Kt)throw new Error("type missing");if(!Wt)throw new Error("dynamic missing");if(!zt)throw new Error("precision missing");Ht.type&&(Kt=Ht.type);const Zt=Dt[zt][Wt];if(Zt[Kt]===!1)return null;if(Zt[Kt]===void 0)throw new Error(`Could not find a KernelValue for ${Kt}`);return Zt[Kt]}a.exports={kernelValueMaps:Dt,lookupKernelValueType:Bt}},{"./kernel-value/array2":75,"./kernel-value/array3":76,"./kernel-value/array4":77,"./kernel-value/boolean":78,"./kernel-value/dynamic-html-image":80,"./kernel-value/dynamic-html-image-array":79,"./kernel-value/dynamic-html-video":81,"./kernel-value/dynamic-memory-optimized-number-texture":82,"./kernel-value/dynamic-number-texture":83,"./kernel-value/dynamic-single-array":84,"./kernel-value/dynamic-single-array1d-i":85,"./kernel-value/dynamic-single-array2d-i":86,"./kernel-value/dynamic-single-array3d-i":87,"./kernel-value/dynamic-single-input":88,"./kernel-value/dynamic-unsigned-array":89,"./kernel-value/dynamic-unsigned-input":90,"./kernel-value/float":91,"./kernel-value/html-image":93,"./kernel-value/html-image-array":92,"./kernel-value/html-video":94,"./kernel-value/integer":95,"./kernel-value/memory-optimized-number-texture":96,"./kernel-value/number-texture":97,"./kernel-value/single-array":98,"./kernel-value/single-array1d-i":99,"./kernel-value/single-array2d-i":100,"./kernel-value/single-array3d-i":101,"./kernel-value/single-input":102,"./kernel-value/unsigned-array":103,"./kernel-value/unsigned-input":104}],75:[function(o,a,rt){const{WebGLKernelValueArray2:tt}=o("../../web-gl/kernel-value/array2");class ot extends tt{}a.exports={WebGL2KernelValueArray2:ot}},{"../../web-gl/kernel-value/array2":41}],76:[function(o,a,rt){const{WebGLKernelValueArray3:tt}=o("../../web-gl/kernel-value/array3");class ot extends tt{}a.exports={WebGL2KernelValueArray3:ot}},{"../../web-gl/kernel-value/array3":42}],77:[function(o,a,rt){const{WebGLKernelValueArray4:tt}=o("../../web-gl/kernel-value/array4");class ot extends tt{}a.exports={WebGL2KernelValueArray4:ot}},{"../../web-gl/kernel-value/array4":43}],78:[function(o,a,rt){const{WebGLKernelValueBoolean:tt}=o("../../web-gl/kernel-value/boolean");class ot extends tt{}a.exports={WebGL2KernelValueBoolean:ot}},{"../../web-gl/kernel-value/boolean":44}],79:[function(o,a,rt){const{utils:tt}=o("../../../utils"),{WebGL2KernelValueHTMLImageArray:ot}=o("./html-image-array");class at extends ot{getSource(){const it=this.getVariablePrecisionString();return tt.linesToString([`uniform ${it} sampler2DArray ${this.id}`,`uniform ${it} ivec2 ${this.sizeId}`,`uniform ${it} ivec3 ${this.dimensionsId}`])}updateValue(it){const{width:j,height:_}=it[0];this.checkSize(j,_),this.dimensions=[j,_,it.length],this.textureSize=[j,_],this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(it)}}a.exports={WebGL2KernelValueDynamicHTMLImageArray:at}},{"../../../utils":114,"./html-image-array":92}],80:[function(o,a,rt){const{utils:tt}=o("../../../utils"),{WebGLKernelValueDynamicHTMLImage:ot}=o("../../web-gl/kernel-value/dynamic-html-image");class at extends ot{getSource(){const it=this.getVariablePrecisionString();return tt.linesToString([`uniform ${it} sampler2D ${this.id}`,`uniform ${it} ivec2 ${this.sizeId}`,`uniform ${it} ivec3 ${this.dimensionsId}`])}}a.exports={WebGL2KernelValueDynamicHTMLImage:at}},{"../../../utils":114,"../../web-gl/kernel-value/dynamic-html-image":45}],81:[function(o,a,rt){o("../../../utils");const{WebGL2KernelValueDynamicHTMLImage:tt}=o("./dynamic-html-image");class ot extends tt{}a.exports={WebGL2KernelValueDynamicHTMLVideo:ot}},{"../../../utils":114,"./dynamic-html-image":80}],82:[function(o,a,rt){const{utils:tt}=o("../../../utils"),{WebGLKernelValueDynamicMemoryOptimizedNumberTexture:ot}=o("../../web-gl/kernel-value/dynamic-memory-optimized-number-texture");class at extends ot{getSource(){return tt.linesToString([`uniform sampler2D ${this.id}`,`uniform ivec2 ${this.sizeId}`,`uniform ivec3 ${this.dimensionsId}`])}}a.exports={WebGL2KernelValueDynamicMemoryOptimizedNumberTexture:at}},{"../../../utils":114,"../../web-gl/kernel-value/dynamic-memory-optimized-number-texture":47}],83:[function(o,a,rt){const{utils:tt}=o("../../../utils"),{WebGLKernelValueDynamicNumberTexture:ot}=o("../../web-gl/kernel-value/dynamic-number-texture");class at extends ot{getSource(){const it=this.getVariablePrecisionString();return tt.linesToString([`uniform ${it} sampler2D ${this.id}`,`uniform ${it} ivec2 ${this.sizeId}`,`uniform ${it} ivec3 ${this.dimensionsId}`])}}a.exports={WebGL2KernelValueDynamicNumberTexture:at}},{"../../../utils":114,"../../web-gl/kernel-value/dynamic-number-texture":48}],84:[function(o,a,rt){const{utils:tt}=o("../../../utils"),{WebGL2KernelValueSingleArray:ot}=o("../../web-gl2/kernel-value/single-array");class at extends ot{getSource(){const it=this.getVariablePrecisionString();return tt.linesToString([`uniform ${it} sampler2D ${this.id}`,`uniform ${it} ivec2 ${this.sizeId}`,`uniform ${it} ivec3 ${this.dimensionsId}`])}updateValue(it){this.dimensions=tt.getDimensions(it,!0),this.textureSize=tt.getMemoryOptimizedFloatTextureSize(this.dimensions,this.bitRatio),this.uploadArrayLength=this.textureSize[0]*this.textureSize[1]*this.bitRatio,this.checkSize(this.textureSize[0],this.textureSize[1]),this.uploadValue=new Float32Array(this.uploadArrayLength),this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(it)}}a.exports={WebGL2KernelValueDynamicSingleArray:at}},{"../../../utils":114,"../../web-gl2/kernel-value/single-array":98}],85:[function(o,a,rt){const{utils:tt}=o("../../../utils"),{WebGL2KernelValueSingleArray1DI:ot}=o("../../web-gl2/kernel-value/single-array1d-i");class at extends ot{getSource(){const it=this.getVariablePrecisionString();return tt.linesToString([`uniform ${it} sampler2D ${this.id}`,`uniform ${it} ivec2 ${this.sizeId}`,`uniform ${it} ivec3 ${this.dimensionsId}`])}updateValue(it){this.setShape(it),this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(it)}}a.exports={WebGL2KernelValueDynamicSingleArray1DI:at}},{"../../../utils":114,"../../web-gl2/kernel-value/single-array1d-i":99}],86:[function(o,a,rt){const{utils:tt}=o("../../../utils"),{WebGL2KernelValueSingleArray2DI:ot}=o("../../web-gl2/kernel-value/single-array2d-i");class at extends ot{getSource(){const it=this.getVariablePrecisionString();return tt.linesToString([`uniform ${it} sampler2D ${this.id}`,`uniform ${it} ivec2 ${this.sizeId}`,`uniform ${it} ivec3 ${this.dimensionsId}`])}updateValue(it){this.setShape(it),this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(it)}}a.exports={WebGL2KernelValueDynamicSingleArray2DI:at}},{"../../../utils":114,"../../web-gl2/kernel-value/single-array2d-i":100}],87:[function(o,a,rt){const{utils:tt}=o("../../../utils"),{WebGL2KernelValueSingleArray3DI:ot}=o("../../web-gl2/kernel-value/single-array3d-i");class at extends ot{getSource(){const it=this.getVariablePrecisionString();return tt.linesToString([`uniform ${it} sampler2D ${this.id}`,`uniform ${it} ivec2 ${this.sizeId}`,`uniform ${it} ivec3 ${this.dimensionsId}`])}updateValue(it){this.setShape(it),this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(it)}}a.exports={WebGL2KernelValueDynamicSingleArray3DI:at}},{"../../../utils":114,"../../web-gl2/kernel-value/single-array3d-i":101}],88:[function(o,a,rt){const{utils:tt}=o("../../../utils"),{WebGL2KernelValueSingleInput:ot}=o("../../web-gl2/kernel-value/single-input");class at extends ot{getSource(){const it=this.getVariablePrecisionString();return tt.linesToString([`uniform ${it} sampler2D ${this.id}`,`uniform ${it} ivec2 ${this.sizeId}`,`uniform ${it} ivec3 ${this.dimensionsId}`])}updateValue(it){let[j,_,$]=it.size;this.dimensions=new Int32Array([j||1,_||1,$||1]),this.textureSize=tt.getMemoryOptimizedFloatTextureSize(this.dimensions,this.bitRatio),this.uploadArrayLength=this.textureSize[0]*this.textureSize[1]*this.bitRatio,this.checkSize(this.textureSize[0],this.textureSize[1]),this.uploadValue=new Float32Array(this.uploadArrayLength),this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(it)}}a.exports={WebGL2KernelValueDynamicSingleInput:at}},{"../../../utils":114,"../../web-gl2/kernel-value/single-input":102}],89:[function(o,a,rt){const{utils:tt}=o("../../../utils"),{WebGLKernelValueDynamicUnsignedArray:ot}=o("../../web-gl/kernel-value/dynamic-unsigned-array");class at extends ot{getSource(){const it=this.getVariablePrecisionString();return tt.linesToString([`uniform ${it} sampler2D ${this.id}`,`uniform ${it} ivec2 ${this.sizeId}`,`uniform ${it} ivec3 ${this.dimensionsId}`])}}a.exports={WebGL2KernelValueDynamicUnsignedArray:at}},{"../../../utils":114,"../../web-gl/kernel-value/dynamic-unsigned-array":54}],90:[function(o,a,rt){const{utils:tt}=o("../../../utils"),{WebGLKernelValueDynamicUnsignedInput:ot}=o("../../web-gl/kernel-value/dynamic-unsigned-input");class at extends ot{getSource(){const it=this.getVariablePrecisionString();return tt.linesToString([`uniform ${it} sampler2D ${this.id}`,`uniform ${it} ivec2 ${this.sizeId}`,`uniform ${it} ivec3 ${this.dimensionsId}`])}}a.exports={WebGL2KernelValueDynamicUnsignedInput:at}},{"../../../utils":114,"../../web-gl/kernel-value/dynamic-unsigned-input":55}],91:[function(o,a,rt){o("../../../utils");const{WebGLKernelValueFloat:tt}=o("../../web-gl/kernel-value/float");class ot extends tt{}a.exports={WebGL2KernelValueFloat:ot}},{"../../../utils":114,"../../web-gl/kernel-value/float":56}],92:[function(o,a,rt){const{utils:tt}=o("../../../utils"),{WebGLKernelArray:ot}=o("../../web-gl/kernel-value/array");class at extends ot{constructor(it,j){super(it,j),this.checkSize(it[0].width,it[0].height),this.dimensions=[it[0].width,it[0].height,it.length],this.textureSize=[it[0].width,it[0].height]}defineTexture(){const{context:it}=this;it.activeTexture(this.contextHandle),it.bindTexture(it.TEXTURE_2D_ARRAY,this.texture),it.texParameteri(it.TEXTURE_2D_ARRAY,it.TEXTURE_MAG_FILTER,it.NEAREST),it.texParameteri(it.TEXTURE_2D_ARRAY,it.TEXTURE_MIN_FILTER,it.NEAREST)}getStringValueHandler(){return`const uploadValue_${this.name} = ${this.varName}; +`}getSource(){const it=this.getVariablePrecisionString();return tt.linesToString([`uniform ${it} sampler2DArray ${this.id}`,`${it} ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`,`${it} ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`])}updateValue(it){const{context:j}=this;j.activeTexture(this.contextHandle),j.bindTexture(j.TEXTURE_2D_ARRAY,this.texture),j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,!0),j.texImage3D(j.TEXTURE_2D_ARRAY,0,j.RGBA,it[0].width,it[0].height,it.length,0,j.RGBA,j.UNSIGNED_BYTE,null);for(let _=0;_pt.isSupported)}static get isKernelMapSupported(){return $.some(pt=>pt.isSupported&&pt.features.kernelMap)}static get isOffscreenCanvasSupported(){return typeof Worker<"u"&&typeof OffscreenCanvas<"u"||typeof importScripts<"u"}static get isWebGLSupported(){return j.isSupported}static get isWebGL2Supported(){return it.isSupported}static get isHeadlessGLSupported(){return nt.isSupported}static get isCanvasSupported(){return typeof HTMLCanvasElement<"u"}static get isGPUHTMLImageArraySupported(){return it.isSupported}static get isSinglePrecisionSupported(){return $.some(pt=>pt.isSupported&&pt.features.isFloatRead&&pt.features.isTextureFloat)}constructor(pt){if(pt=pt||{},this.canvas=pt.canvas||null,this.context=pt.context||null,this.mode=pt.mode,this.Kernel=null,this.kernels=[],this.functions=[],this.nativeFunctions=[],this.injectedNative=null,this.mode!=="dev"){if(this.chooseKernel(),pt.functions)for(let mt=0;mt"u")throw new Error("Missing source parameter");if(typeof pt!="object"&&!ot.isFunction(pt)&&typeof pt!="string")throw new Error("source parameter not a function");const gt=this.kernels;if(this.mode==="dev"){const kt=et(pt,ht(mt));return gt.push(kt),kt}pt=typeof pt=="function"?pt.toString():pt;const dt={},St=ht(mt)||{};mt&&typeof mt.argumentTypes=="object"&&(St.argumentTypes=Object.keys(mt.argumentTypes).map(kt=>mt.argumentTypes[kt]));function xt(kt){console.warn("Falling back to CPU");const Tt=new at(pt,{argumentTypes:Et.argumentTypes,constantTypes:Et.constantTypes,graphical:Et.graphical,loopMaxIterations:Et.loopMaxIterations,constants:Et.constants,dynamicOutput:Et.dynamicOutput,dynamicArgument:Et.dynamicArguments,output:Et.output,precision:Et.precision,pipeline:Et.pipeline,immutable:Et.immutable,optimizeFloatMemory:Et.optimizeFloatMemory,fixIntegerDivisionAccuracy:Et.fixIntegerDivisionAccuracy,functions:Et.functions,nativeFunctions:Et.nativeFunctions,injectedNative:Et.injectedNative,subKernels:Et.subKernels,strictIntegers:Et.strictIntegers,debug:Et.debug});Tt.build.apply(Tt,kt);const $t=Tt.run.apply(Tt,kt);return Et.replaceKernel(Tt),$t}function yt(kt,Tt,$t){$t.debug&&console.warn("Switching kernels");let It=null;if($t.signature&&!dt[$t.signature]&&(dt[$t.signature]=$t),$t.dynamicOutput)for(let Wt=kt.length-1;Wt>=0;Wt--){const zt=kt[Wt];zt.type==="outputPrecisionMismatch"&&(It=zt.needed)}const Ot=$t.constructor,Mt=Ot.getArgumentTypes($t,Tt),Dt=Ot.getSignature($t,Mt),Bt=dt[Dt];if(Bt)return Bt.onActivate($t),Bt;const Kt=dt[Dt]=new Ot(pt,{argumentTypes:Mt,constantTypes:$t.constantTypes,graphical:$t.graphical,loopMaxIterations:$t.loopMaxIterations,constants:$t.constants,dynamicOutput:$t.dynamicOutput,dynamicArgument:$t.dynamicArguments,context:$t.context,canvas:$t.canvas,output:It||$t.output,precision:$t.precision,pipeline:$t.pipeline,immutable:$t.immutable,optimizeFloatMemory:$t.optimizeFloatMemory,fixIntegerDivisionAccuracy:$t.fixIntegerDivisionAccuracy,functions:$t.functions,nativeFunctions:$t.nativeFunctions,injectedNative:$t.injectedNative,subKernels:$t.subKernels,strictIntegers:$t.strictIntegers,debug:$t.debug,gpu:$t.gpu,validate:lt,returnType:$t.returnType,tactic:$t.tactic,onRequestFallback:xt,onRequestSwitchKernel:yt,texture:$t.texture,mappedTextures:$t.mappedTextures,drawBuffersMap:$t.drawBuffersMap});return Kt.build.apply(Kt,Tt),Et.replaceKernel(Kt),gt.push(Kt),Kt}const _t=Object.assign({context:this.context,canvas:this.canvas,functions:this.functions,nativeFunctions:this.nativeFunctions,injectedNative:this.injectedNative,gpu:this,validate:lt,onRequestFallback:xt,onRequestSwitchKernel:yt},St),Ct=new this.Kernel(pt,_t),Et=_(Ct);return this.canvas||(this.canvas=Ct.canvas),this.context||(this.context=Ct.context),gt.push(Ct),Et}createKernelMap(){let pt,mt;const gt=typeof arguments[arguments.length-2];if(gt==="function"||gt==="string"?(pt=arguments[arguments.length-2],mt=arguments[arguments.length-1]):pt=arguments[arguments.length-1],this.mode!=="dev"&&(!this.Kernel.isSupported||!this.Kernel.features.kernelMap)&&this.mode&&tt.indexOf(this.mode)<0)throw new Error(`kernelMap not supported on ${this.Kernel.name}`);const dt=ht(mt);if(mt&&typeof mt.argumentTypes=="object"&&(dt.argumentTypes=Object.keys(mt.argumentTypes).map(St=>mt.argumentTypes[St])),Array.isArray(arguments[0])){dt.subKernels=[];const St=arguments[0];for(let xt=0;xt0)throw new Error('Cannot call "addNativeFunction" after "createKernels" has been called.');return this.nativeFunctions.push(Object.assign({name:pt,source:mt},gt)),this}injectNative(pt){return this.injectedNative=pt,this}destroy(){return new Promise((pt,mt)=>{this.kernels||pt(),setTimeout(()=>{try{for(let dt=0;dt{try{_(it.apply(this,arguments))}catch(tt){$(tt)}})},j.replaceKernel=function(_){nt=_,at(nt,j)},at(nt,j),j}function at(nt,it){if(it.kernel){it.kernel=nt;return}const j=et.allPropertiesOf(nt);for(let _=0;_it.kernel[$]),it.__defineSetter__($,tt=>{it.kernel[$]=tt})))}it.kernel=nt}a.exports={kernelRunShortcut:ot}},{"./utils":114}],112:[function(o,a,rt){const _={name:"math-random-uniformly-distributed",onBeforeRun:$=>{$.setUniform1f("randomSeed1",Math.random()),$.setUniform1f("randomSeed2",Math.random())},functionMatch:"Math.random()",functionReplace:"nrand(vTexCoord)",functionReturnType:"Number",source:`// https://www.shadertoy.com/view/4t2SDh +}`;a.exports={vertexShader:tt}},{}],107:[function(o,a,rt){const tt=o("./index"),ot=tt.GPU;for(const nt in tt)tt.hasOwnProperty(nt)&&nt!=="GPU"&&(ot[nt]=tt[nt]);typeof window<"u"&&at(window),typeof self<"u"&&at(self);function at(nt){nt.GPU||Object.defineProperty(nt,"GPU",{get(){return ot}})}a.exports=tt},{"./index":109}],108:[function(o,a,rt){const{gpuMock:tt}=o("gpu-mock.js"),{utils:ot}=o("./utils");o("./backend/kernel");const{CPUKernel:at}=o("./backend/cpu/kernel"),{HeadlessGLKernel:nt}=o("./backend/headless-gl/kernel"),{WebGL2Kernel:it}=o("./backend/web-gl2/kernel"),{WebGLKernel:j}=o("./backend/web-gl/kernel"),{kernelRunShortcut:_}=o("./kernel-run-shortcut"),$=[nt,it,j],et=["gpu","cpu"],st={headlessgl:nt,webgl2:it,webgl:j};let lt=!0;class ct{static disableValidation(){lt=!1}static enableValidation(){lt=!0}static get isGPUSupported(){return $.some(pt=>pt.isSupported)}static get isKernelMapSupported(){return $.some(pt=>pt.isSupported&&pt.features.kernelMap)}static get isOffscreenCanvasSupported(){return typeof Worker<"u"&&typeof OffscreenCanvas<"u"||typeof importScripts<"u"}static get isWebGLSupported(){return j.isSupported}static get isWebGL2Supported(){return it.isSupported}static get isHeadlessGLSupported(){return nt.isSupported}static get isCanvasSupported(){return typeof HTMLCanvasElement<"u"}static get isGPUHTMLImageArraySupported(){return it.isSupported}static get isSinglePrecisionSupported(){return $.some(pt=>pt.isSupported&&pt.features.isFloatRead&&pt.features.isTextureFloat)}constructor(pt){if(pt=pt||{},this.canvas=pt.canvas||null,this.context=pt.context||null,this.mode=pt.mode,this.Kernel=null,this.kernels=[],this.functions=[],this.nativeFunctions=[],this.injectedNative=null,this.mode!=="dev"){if(this.chooseKernel(),pt.functions)for(let mt=0;mt"u")throw new Error("Missing source parameter");if(typeof pt!="object"&&!ot.isFunction(pt)&&typeof pt!="string")throw new Error("source parameter not a function");const gt=this.kernels;if(this.mode==="dev"){const kt=tt(pt,ht(mt));return gt.push(kt),kt}pt=typeof pt=="function"?pt.toString():pt;const dt={},St=ht(mt)||{};mt&&typeof mt.argumentTypes=="object"&&(St.argumentTypes=Object.keys(mt.argumentTypes).map(kt=>mt.argumentTypes[kt]));function xt(kt){console.warn("Falling back to CPU");const Tt=new at(pt,{argumentTypes:Et.argumentTypes,constantTypes:Et.constantTypes,graphical:Et.graphical,loopMaxIterations:Et.loopMaxIterations,constants:Et.constants,dynamicOutput:Et.dynamicOutput,dynamicArgument:Et.dynamicArguments,output:Et.output,precision:Et.precision,pipeline:Et.pipeline,immutable:Et.immutable,optimizeFloatMemory:Et.optimizeFloatMemory,fixIntegerDivisionAccuracy:Et.fixIntegerDivisionAccuracy,functions:Et.functions,nativeFunctions:Et.nativeFunctions,injectedNative:Et.injectedNative,subKernels:Et.subKernels,strictIntegers:Et.strictIntegers,debug:Et.debug});Tt.build.apply(Tt,kt);const $t=Tt.run.apply(Tt,kt);return Et.replaceKernel(Tt),$t}function yt(kt,Tt,$t){$t.debug&&console.warn("Switching kernels");let It=null;if($t.signature&&!dt[$t.signature]&&(dt[$t.signature]=$t),$t.dynamicOutput)for(let Wt=kt.length-1;Wt>=0;Wt--){const zt=kt[Wt];zt.type==="outputPrecisionMismatch"&&(It=zt.needed)}const Ot=$t.constructor,Mt=Ot.getArgumentTypes($t,Tt),Dt=Ot.getSignature($t,Mt),Bt=dt[Dt];if(Bt)return Bt.onActivate($t),Bt;const Kt=dt[Dt]=new Ot(pt,{argumentTypes:Mt,constantTypes:$t.constantTypes,graphical:$t.graphical,loopMaxIterations:$t.loopMaxIterations,constants:$t.constants,dynamicOutput:$t.dynamicOutput,dynamicArgument:$t.dynamicArguments,context:$t.context,canvas:$t.canvas,output:It||$t.output,precision:$t.precision,pipeline:$t.pipeline,immutable:$t.immutable,optimizeFloatMemory:$t.optimizeFloatMemory,fixIntegerDivisionAccuracy:$t.fixIntegerDivisionAccuracy,functions:$t.functions,nativeFunctions:$t.nativeFunctions,injectedNative:$t.injectedNative,subKernels:$t.subKernels,strictIntegers:$t.strictIntegers,debug:$t.debug,gpu:$t.gpu,validate:lt,returnType:$t.returnType,tactic:$t.tactic,onRequestFallback:xt,onRequestSwitchKernel:yt,texture:$t.texture,mappedTextures:$t.mappedTextures,drawBuffersMap:$t.drawBuffersMap});return Kt.build.apply(Kt,Tt),Et.replaceKernel(Kt),gt.push(Kt),Kt}const _t=Object.assign({context:this.context,canvas:this.canvas,functions:this.functions,nativeFunctions:this.nativeFunctions,injectedNative:this.injectedNative,gpu:this,validate:lt,onRequestFallback:xt,onRequestSwitchKernel:yt},St),Ct=new this.Kernel(pt,_t),Et=_(Ct);return this.canvas||(this.canvas=Ct.canvas),this.context||(this.context=Ct.context),gt.push(Ct),Et}createKernelMap(){let pt,mt;const gt=typeof arguments[arguments.length-2];if(gt==="function"||gt==="string"?(pt=arguments[arguments.length-2],mt=arguments[arguments.length-1]):pt=arguments[arguments.length-1],this.mode!=="dev"&&(!this.Kernel.isSupported||!this.Kernel.features.kernelMap)&&this.mode&&et.indexOf(this.mode)<0)throw new Error(`kernelMap not supported on ${this.Kernel.name}`);const dt=ht(mt);if(mt&&typeof mt.argumentTypes=="object"&&(dt.argumentTypes=Object.keys(mt.argumentTypes).map(St=>mt.argumentTypes[St])),Array.isArray(arguments[0])){dt.subKernels=[];const St=arguments[0];for(let xt=0;xt0)throw new Error('Cannot call "addNativeFunction" after "createKernels" has been called.');return this.nativeFunctions.push(Object.assign({name:pt,source:mt},gt)),this}injectNative(pt){return this.injectedNative=pt,this}destroy(){return new Promise((pt,mt)=>{this.kernels||pt(),setTimeout(()=>{try{for(let dt=0;dt{try{_(it.apply(this,arguments))}catch(et){$(et)}})},j.replaceKernel=function(_){nt=_,at(nt,j)},at(nt,j),j}function at(nt,it){if(it.kernel){it.kernel=nt;return}const j=tt.allPropertiesOf(nt);for(let _=0;_it.kernel[$]),it.__defineSetter__($,et=>{it.kernel[$]=et})))}it.kernel=nt}a.exports={kernelRunShortcut:ot}},{"./utils":114}],112:[function(o,a,rt){const _={name:"math-random-uniformly-distributed",onBeforeRun:$=>{$.setUniform1f("randomSeed1",Math.random()),$.setUniform1f("randomSeed2",Math.random())},functionMatch:"Math.random()",functionReplace:"nrand(vTexCoord)",functionReturnType:"Number",source:`// https://www.shadertoy.com/view/4t2SDh //note: uniformly distributed, normalized rand, [0,1] highp float randomSeedShift = 1.0; highp float slide = 1.0; @@ -3150,23 +3150,23 @@ highp float nrand(highp vec2 n) { slide += 0.0009; } return result; -}`};a.exports=_},{}],113:[function(o,a,rt){class et{constructor(at){const{texture:nt,size:it,dimensions:j,output:_,context:$,type:tt="NumberTexture",kernel:st,internalFormat:lt,textureFormat:ct}=at;if(!_)throw new Error('settings property "output" required.');if(!$)throw new Error('settings property "context" required.');if(!nt)throw new Error('settings property "texture" required.');if(!st)throw new Error('settings property "kernel" required.');this.texture=nt,nt._refs?nt._refs++:nt._refs=1,this.size=it,this.dimensions=j,this.output=_,this.context=$,this.kernel=st,this.type=tt,this._deleted=!1,this.internalFormat=lt,this.textureFormat=ct}toArray(){throw new Error(`Not implemented on ${this.constructor.name}`)}clone(){throw new Error(`Not implemented on ${this.constructor.name}`)}delete(){throw new Error(`Not implemented on ${this.constructor.name}`)}clear(){throw new Error(`Not implemented on ${this.constructor.name}`)}}a.exports={Texture:et}},{}],114:[function(o,a,rt){const et=o("acorn"),{Input:ot}=o("./input"),{Texture:at}=o("./texture"),nt=/function ([^(]*)/,it=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,j=/([^\s,]+)/g,_={systemEndianness(){return lt},getSystemEndianness(){const ct=new ArrayBuffer(4),ht=new Uint32Array(ct),ut=new Uint8Array(ct);if(ht[0]=3735928559,ut[0]===239)return"LE";if(ut[0]===222)return"BE";throw new Error("unknown endianness")},isFunction(ct){return typeof ct=="function"},isFunctionString(ct){return typeof ct=="string"?ct.slice(0,8).toLowerCase()==="function":!1},getFunctionNameFromString(ct){const ht=nt.exec(ct);return!ht||ht.length===0?null:ht[1].trim()},getFunctionBodyFromString(ct){return ct.substring(ct.indexOf("{")+1,ct.lastIndexOf("}"))},getArgumentNamesFromString(ct){const ht=ct.replace(it,"");let ut=ht.slice(ht.indexOf("(")+1,ht.indexOf(")")).match(j);return ut===null&&(ut=[]),ut},clone(ct){if(ct===null||typeof ct!="object"||ct.hasOwnProperty("isActiveClone"))return ct;const ht=ct.constructor();for(let ut in ct)Object.prototype.hasOwnProperty.call(ct,ut)&&(ct.isActiveClone=null,ht[ut]=_.clone(ct[ut]),delete ct.isActiveClone);return ht},isArray(ct){return!isNaN(ct.length)},getVariableType(ct,ht){if(_.isArray(ct))return ct.length>0&&ct[0].nodeName==="IMG"?"HTMLImageArray":"Array";switch(ct.constructor){case Boolean:return"Boolean";case Number:return ht&&Number.isInteger(ct)?"Integer":"Float";case at:return ct.type;case ot:return"Input"}if("nodeName"in ct)switch(ct.nodeName){case"IMG":return"HTMLImage";case"CANVAS":return"HTMLImage";case"VIDEO":return"HTMLVideo"}else{if(ct.hasOwnProperty("type"))return ct.type;if(typeof OffscreenCanvas<"u"&&ct instanceof OffscreenCanvas)return"OffscreenCanvas";if(typeof ImageBitmap<"u"&&ct instanceof ImageBitmap)return"ImageBitmap";if(typeof ImageData<"u"&&ct instanceof ImageData)return"ImageData"}return"Unknown"},getKernelTextureSize(ct,ht){let[ut,pt,mt]=ht,gt=(ut||1)*(pt||1)*(mt||1);return ct.optimizeFloatMemory&&ct.precision==="single"&&(ut=gt=Math.ceil(gt/4)),pt>1&&ut*pt===gt?new Int32Array([ut,pt]):_.closestSquareDimensions(gt)},closestSquareDimensions(ct){const ht=Math.sqrt(ct);let ut=Math.ceil(ht),pt=Math.floor(ht);for(;ut*pt0&&ct[0].nodeName==="IMG"?"HTMLImageArray":"Array";switch(ct.constructor){case Boolean:return"Boolean";case Number:return ht&&Number.isInteger(ct)?"Integer":"Float";case at:return ct.type;case ot:return"Input"}if("nodeName"in ct)switch(ct.nodeName){case"IMG":return"HTMLImage";case"CANVAS":return"HTMLImage";case"VIDEO":return"HTMLVideo"}else{if(ct.hasOwnProperty("type"))return ct.type;if(typeof OffscreenCanvas<"u"&&ct instanceof OffscreenCanvas)return"OffscreenCanvas";if(typeof ImageBitmap<"u"&&ct instanceof ImageBitmap)return"ImageBitmap";if(typeof ImageData<"u"&&ct instanceof ImageData)return"ImageData"}return"Unknown"},getKernelTextureSize(ct,ht){let[ut,pt,mt]=ht,gt=(ut||1)*(pt||1)*(mt||1);return ct.optimizeFloatMemory&&ct.precision==="single"&&(ut=gt=Math.ceil(gt/4)),pt>1&&ut*pt===gt?new Int32Array([ut,pt]):_.closestSquareDimensions(gt)},closestSquareDimensions(ct){const ht=Math.sqrt(ct);let ut=Math.ceil(ht),pt=Math.floor(ht);for(;ut*pt0?ct.join(`; `)+`; `:` -`},warnDeprecated(ct,ht,ut){console.warn(ut?`You are using a deprecated ${ct} "${ht}". It has been replaced with "${ut}". Fixing, but please upgrade as it will soon be removed.`:`You are using a deprecated ${ct} "${ht}". It has been removed. Fixing, but please upgrade as it will soon be removed.`)},flipPixels:(ct,ht,ut)=>{const pt=ut/2|0,mt=ht*4,gt=new Uint8ClampedArray(ht*4),dt=ct.slice(0);for(let St=0;Stct.subarray(0,ht),erect2DPackedFloat:(ct,ht,ut)=>{const pt=new Array(ut);for(let mt=0;mt{const mt=new Array(pt);for(let gt=0;gtct.subarray(0,ht),erectMemoryOptimized2DFloat:(ct,ht,ut)=>{const pt=new Array(ut);for(let mt=0;mt{const mt=new Array(pt);for(let gt=0;gt{const ut=new Float32Array(ht);let pt=0;for(let mt=0;mt{const pt=new Array(ut);let mt=0;for(let gt=0;gt{const mt=new Array(pt);let gt=0;for(let dt=0;dt{const ut=new Array(ht),pt=ht*4;let mt=0;for(let gt=0;gt{const pt=new Array(ut),mt=ht*4;for(let gt=0;gt{const mt=ht*4,gt=new Array(pt);for(let dt=0;dt{const ut=new Array(ht),pt=ht*4;let mt=0;for(let gt=0;gt{const pt=ht*4,mt=new Array(ut);for(let gt=0;gt{const mt=ht*4,gt=new Array(pt);for(let dt=0;dt{const ut=new Array(ct),pt=ht*4;let mt=0;for(let gt=0;gt{const pt=ht*4,mt=new Array(ut);for(let gt=0;gt{const mt=ht*4,gt=new Array(pt);for(let dt=0;dt{const{findDependency:ut,thisLookup:pt,doNotDefine:mt}=ht;let gt=ht.flattened;gt||(gt=ht.flattened={});const dt=et.parse(ct),St=[];let xt=0;function yt(Ct){if(Array.isArray(Ct)){const Et=[];for(let kt=0;kt{const pt=ut/2|0,mt=ht*4,gt=new Uint8ClampedArray(ht*4),dt=ct.slice(0);for(let St=0;Stct.subarray(0,ht),erect2DPackedFloat:(ct,ht,ut)=>{const pt=new Array(ut);for(let mt=0;mt{const mt=new Array(pt);for(let gt=0;gtct.subarray(0,ht),erectMemoryOptimized2DFloat:(ct,ht,ut)=>{const pt=new Array(ut);for(let mt=0;mt{const mt=new Array(pt);for(let gt=0;gt{const ut=new Float32Array(ht);let pt=0;for(let mt=0;mt{const pt=new Array(ut);let mt=0;for(let gt=0;gt{const mt=new Array(pt);let gt=0;for(let dt=0;dt{const ut=new Array(ht),pt=ht*4;let mt=0;for(let gt=0;gt{const pt=new Array(ut),mt=ht*4;for(let gt=0;gt{const mt=ht*4,gt=new Array(pt);for(let dt=0;dt{const ut=new Array(ht),pt=ht*4;let mt=0;for(let gt=0;gt{const pt=ht*4,mt=new Array(ut);for(let gt=0;gt{const mt=ht*4,gt=new Array(pt);for(let dt=0;dt{const ut=new Array(ct),pt=ht*4;let mt=0;for(let gt=0;gt{const pt=ht*4,mt=new Array(ut);for(let gt=0;gt{const mt=ht*4,gt=new Array(pt);for(let dt=0;dt{const{findDependency:ut,thisLookup:pt,doNotDefine:mt}=ht;let gt=ht.flattened;gt||(gt=ht.flattened={});const dt=tt.parse(ct),St=[];let xt=0;function yt(Ct){if(Array.isArray(Ct)){const Et=[];for(let kt=0;ktkt!==null);return Et.length<1?"":`${Ct.kind} ${Et.join(",")}`;case"VariableDeclarator":return Ct.init.object&&Ct.init.object.type==="ThisExpression"?pt(Ct.init.property.name,!0)?`${Ct.id.name} = ${yt(Ct.init)}`:null:`${Ct.id.name} = ${yt(Ct.init)}`;case"CallExpression":{if(Ct.callee.property.name==="subarray")return`${yt(Ct.callee.object)}.${yt(Ct.callee.property)}(${Ct.arguments.map(kt=>yt(kt)).join(", ")})`;if(Ct.callee.object.name==="gl"||Ct.callee.object.name==="context")return`${yt(Ct.callee.object)}.${yt(Ct.callee.property)}(${Ct.arguments.map(kt=>yt(kt)).join(", ")})`;if(Ct.callee.object.type==="ThisExpression")return St.push(ut("this",Ct.callee.property.name)),`${Ct.callee.property.name}(${Ct.arguments.map(kt=>yt(kt)).join(", ")})`;if(Ct.callee.object.name){const kt=ut(Ct.callee.object.name,Ct.callee.property.name);return kt===null?`${Ct.callee.object.name}.${Ct.callee.property.name}(${Ct.arguments.map(Tt=>yt(Tt)).join(", ")})`:(St.push(kt),`${Ct.callee.property.name}(${Ct.arguments.map(Tt=>yt(Tt)).join(", ")})`)}else{if(Ct.callee.object.type==="MemberExpression")return`${yt(Ct.callee.object)}.${Ct.callee.property.name}(${Ct.arguments.map(kt=>yt(kt)).join(", ")})`;throw new Error("unknown ast.callee")}}case"ReturnStatement":return`return ${yt(Ct.argument)}`;case"BinaryExpression":return`(${yt(Ct.left)}${Ct.operator}${yt(Ct.right)})`;case"UnaryExpression":return Ct.prefix?`${Ct.operator} ${yt(Ct.argument)}`:`${yt(Ct.argument)} ${Ct.operator}`;case"ExpressionStatement":return`${yt(Ct.expression)}`;case"SequenceExpression":return`(${yt(Ct.expressions)})`;case"ArrowFunctionExpression":return`(${Ct.params.map(yt).join(", ")}) => ${yt(Ct.body)}`;case"Literal":return Ct.raw;case"Identifier":return Ct.name;case"MemberExpression":return Ct.object.type==="ThisExpression"?pt(Ct.property.name):Ct.computed?`${yt(Ct.object)}[${yt(Ct.property)}]`:yt(Ct.object)+"."+yt(Ct.property);case"ThisExpression":return"this";case"NewExpression":return`new ${yt(Ct.callee)}(${Ct.arguments.map(kt=>yt(kt)).join(", ")})`;case"ForStatement":return`for (${yt(Ct.init)};${yt(Ct.test)};${yt(Ct.update)}) ${yt(Ct.body)}`;case"AssignmentExpression":return`${yt(Ct.left)}${Ct.operator}${yt(Ct.right)}`;case"UpdateExpression":return`${yt(Ct.argument)}${Ct.operator}`;case"IfStatement":return`if (${yt(Ct.test)}) ${yt(Ct.consequent)}`;case"ThrowStatement":return`throw ${yt(Ct.argument)}`;case"ObjectPattern":return Ct.properties.map(yt).join(", ");case"ArrayPattern":return Ct.elements.map(yt).join(", ");case"DebuggerStatement":return"debugger;";case"ConditionalExpression":return`${yt(Ct.test)}?${yt(Ct.consequent)}:${yt(Ct.alternate)}`;case"Property":if(Ct.kind==="init")return yt(Ct.key)}throw new Error(`unhandled ast.type of ${Ct.type}`)}const _t=yt(dt);if(St.length>0){const Ct=[];for(let Et=0;Et{if(ct.type!=="VariableDeclaration")throw new Error('Ast is not of type "VariableDeclaration"');const ht=[];for(let ut=0;ut{const ut=ct.createKernel(function(St){return St[this.thread.y][this.thread.x].r*255},{output:[ht.width,ht.height],precision:"unsigned",argumentTypes:{a:"HTMLImage"}}),pt=ct.createKernel(function(St){return St[this.thread.y][this.thread.x].g*255},{output:[ht.width,ht.height],precision:"unsigned",argumentTypes:{a:"HTMLImage"}}),mt=ct.createKernel(function(St){return St[this.thread.y][this.thread.x].b*255},{output:[ht.width,ht.height],precision:"unsigned",argumentTypes:{a:"HTMLImage"}}),gt=ct.createKernel(function(St){return St[this.thread.y][this.thread.x].a*255},{output:[ht.width,ht.height],precision:"unsigned",argumentTypes:{a:"HTMLImage"}}),dt=[ut(ht),pt(ht),mt(ht),gt(ht)];return dt.rKernel=ut,dt.gKernel=pt,dt.bKernel=mt,dt.aKernel=gt,dt.gpu=ct,dt},splitRGBAToCanvases:(ct,ht,ut,pt)=>{const mt=ct.createKernel(function(xt){const yt=xt[this.thread.y][this.thread.x];this.color(yt.r/255,0,0,255)},{output:[ut,pt],graphical:!0,argumentTypes:{v:"Array2D(4)"}});mt(ht);const gt=ct.createKernel(function(xt){const yt=xt[this.thread.y][this.thread.x];this.color(0,yt.g/255,0,255)},{output:[ut,pt],graphical:!0,argumentTypes:{v:"Array2D(4)"}});gt(ht);const dt=ct.createKernel(function(xt){const yt=xt[this.thread.y][this.thread.x];this.color(0,0,yt.b/255,255)},{output:[ut,pt],graphical:!0,argumentTypes:{v:"Array2D(4)"}});dt(ht);const St=ct.createKernel(function(xt){const yt=xt[this.thread.y][this.thread.x];this.color(255,255,255,yt.a/255)},{output:[ut,pt],graphical:!0,argumentTypes:{v:"Array2D(4)"}});return St(ht),[mt.canvas,gt.canvas,dt.canvas,St.canvas]},getMinifySafeName:ct=>{try{const ht=et.parse(`const value = ${ct.toString()}`),{init:ut}=ht.body[0].declarations[0];return ut.body.name||ut.body.body[0].argument.name}catch{throw new Error("Unrecognized function type. Please use `() => yourFunctionVariableHere` or function() { return yourFunctionVariableHere; }")}},sanitizeName:function(ct){return $.test(ct)&&(ct=ct.replace($,"S_S")),tt.test(ct)?ct=ct.replace(tt,"U_U"):st.test(ct)&&(ct=ct.replace(st,"u_u")),ct}},$=/\$/,tt=/__/,st=/_/,lt=_.getSystemEndianness();a.exports={utils:_}},{"./input":110,"./texture":113,acorn:1}]},{},[107])(107)})})(gpuBrowser);var gpuBrowserExports=gpuBrowser.exports,rttc={},runtimeSourceError={};Object.defineProperty(runtimeSourceError,"__esModule",{value:!0});runtimeSourceError.RuntimeSourceError=void 0;const constants_1$1=constants,types_1$l=types;class RuntimeSourceError{constructor(s){this.type=types_1$l.ErrorType.RUNTIME,this.severity=types_1$l.ErrorSeverity.ERROR,this.location=s?s.loc:constants_1$1.UNKNOWN_LOCATION}explain(){return""}elaborate(){return this.explain()}}runtimeSourceError.RuntimeSourceError=RuntimeSourceError;Object.defineProperty(rttc,"__esModule",{value:!0});rttc.isIdentifier=rttc.checkMemberAccess=rttc.checkIfStatement=rttc.checkBinaryExpression=rttc.checkUnaryExpression=rttc.TypeError=void 0;const runtimeSourceError_1$1=runtimeSourceError,types_1$k=types,LHS=" on left hand side of operation",RHS=" on right hand side of operation";let TypeError$1=class extends runtimeSourceError_1$1.RuntimeSourceError{constructor(s,o,a,rt,et=types_1$k.Chapter.SOURCE_4){super(s),this.side=o,this.expected=a,this.got=rt,this.chapter=et,this.type=types_1$k.ErrorType.RUNTIME,this.severity=types_1$k.ErrorSeverity.ERROR}explain(){const s=this.got==="array"?this.chapter<=2?"pair":"compound data":this.got;return`Expected ${this.expected}${this.side}, got ${s}.`}elaborate(){return this.explain()}};rttc.TypeError=TypeError$1;const typeOf=i=>i===null?"null":Array.isArray(i)?"array":typeof i,isNumber=i=>typeOf(i)==="number",isArrayIndex=i=>isNumber(i)&&i>>>0===i&&i<2**32-1,isString=i=>typeOf(i)==="string",isBool=i=>typeOf(i)==="boolean",isObject=i=>typeOf(i)==="object",isArray=i=>typeOf(i)==="array",checkUnaryExpression=(i,s,o,a=types_1$k.Chapter.SOURCE_4)=>(s==="+"||s==="-")&&!isNumber(o)?new TypeError$1(i,"","number",typeOf(o),a):s==="!"&&!isBool(o)?new TypeError$1(i,"","boolean",typeOf(o),a):void 0;rttc.checkUnaryExpression=checkUnaryExpression;const checkBinaryExpression=(i,s,o,a,rt)=>{switch(s){case"-":case"*":case"/":case"%":return isNumber(a)?isNumber(rt)?void 0:new TypeError$1(i,RHS,"number",typeOf(rt),o):new TypeError$1(i,LHS,"number",typeOf(a),o);case"+":case"<":case"<=":case">":case">=":case"!==":case"===":return o>2&&(s==="==="||s==="!==")?void 0:isNumber(a)?isNumber(rt)?void 0:new TypeError$1(i,RHS,"number",typeOf(rt),o):isString(a)?isString(rt)?void 0:new TypeError$1(i,RHS,"string",typeOf(rt),o):new TypeError$1(i,LHS,"string or number",typeOf(a),o);default:return}};rttc.checkBinaryExpression=checkBinaryExpression;const checkIfStatement=(i,s,o=types_1$k.Chapter.SOURCE_4)=>isBool(s)?void 0:new TypeError$1(i," as condition","boolean",typeOf(s),o);rttc.checkIfStatement=checkIfStatement;const checkMemberAccess=(i,s,o)=>isObject(s)?isString(o)?void 0:new TypeError$1(i," as prop","string",typeOf(o)):isArray(s)?isArrayIndex(o)?void 0:isNumber(o)?new TypeError$1(i," as prop","array index","other number"):new TypeError$1(i," as prop","array index",typeOf(o)):new TypeError$1(i,"","object or array",typeOf(s));rttc.checkMemberAccess=checkMemberAccess;const isIdentifier=i=>i.name!==void 0;rttc.isIdentifier=isIdentifier;var transfomer={},astCreator={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.whileStatement=i.ifStatement=i.variableDeclarator=i.variableDeclaration=i.arrowFunctionExpression=i.blockExpression=i.functionDeclaration=i.functionDeclarationExpression=i.primitive=i.unaryExpression=i.binaryExpression=i.assignmentExpression=i.arrayExpression=i.conditionalExpression=i.mutateToConditionalExpression=i.logicalExpression=i.mutateToMemberExpression=i.mutateToReturnStatement=i.mutateToExpressionStatement=i.mutateToAssignmentExpression=i.mutateToCallExpression=i.objectExpression=i.property=i.returnStatement=i.program=i.blockStatement=i.functionExpression=i.blockArrowFunction=i.expressionStatement=i.callExpression=i.constantDeclaration=i.declaration=i.memberExpression=i.literal=i.identifier=i.locationDummyNode=i.getVariableDecarationName=void 0;const s=Wt=>Wt.declarations[0].id.name;i.getVariableDecarationName=s;const o=(Wt,zt)=>(0,i.literal)("Dummy",{start:{line:Wt,column:zt},end:{line:Wt,column:zt}});i.locationDummyNode=o;const a=(Wt,zt)=>({type:"Identifier",name:Wt,loc:zt});i.identifier=a;const rt=(Wt,zt)=>({type:"Literal",value:Wt,loc:zt});i.literal=rt;const et=(Wt,zt)=>({type:"MemberExpression",object:Wt,computed:typeof zt=="number",optional:!1,property:typeof zt=="number"?(0,i.literal)(zt):(0,i.identifier)(zt)});i.memberExpression=et;const ot=(Wt,zt,Ht,Zt)=>({type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:(0,i.identifier)(Wt),init:Ht}],kind:zt,loc:Zt});i.declaration=ot;const at=(Wt,zt,Ht)=>(0,i.declaration)(Wt,"const",zt,Ht);i.constantDeclaration=at;const nt=(Wt,zt,Ht)=>({type:"CallExpression",callee:Wt,arguments:zt,optional:!1,loc:Ht});i.callExpression=nt;const it=Wt=>({type:"ExpressionStatement",expression:Wt});i.expressionStatement=it;const j=(Wt,zt,Ht)=>({type:"ArrowFunctionExpression",expression:!1,generator:!1,params:Wt,body:Array.isArray(zt)?(0,i.blockStatement)(zt):zt,loc:Ht});i.blockArrowFunction=j;const _=(Wt,zt,Ht)=>({type:"FunctionExpression",id:null,async:!1,generator:!1,params:Wt,body:Array.isArray(zt)?(0,i.blockStatement)(zt):zt,loc:Ht});i.functionExpression=_;const $=Wt=>({type:"BlockStatement",body:Wt});i.blockStatement=$;const tt=Wt=>({type:"Program",sourceType:"module",body:Wt});i.program=tt;const st=(Wt,zt)=>({type:"ReturnStatement",argument:Wt,loc:zt});i.returnStatement=st;const lt=(Wt,zt)=>({type:"Property",method:!1,shorthand:!1,computed:!1,key:(0,i.identifier)(Wt),value:zt,kind:"init"});i.property=lt;const ct=Wt=>({type:"ObjectExpression",properties:Wt});i.objectExpression=ct;const ht=(Wt,zt,Ht)=>{Wt.type="CallExpression",Wt=Wt,Wt.callee=zt,Wt.arguments=Ht};i.mutateToCallExpression=ht;const ut=(Wt,zt,Ht)=>{Wt.type="AssignmentExpression",Wt=Wt,Wt.operator="=",Wt.left=zt,Wt.right=Ht};i.mutateToAssignmentExpression=ut;const pt=(Wt,zt)=>{Wt.type="ExpressionStatement",Wt=Wt,Wt.expression=zt};i.mutateToExpressionStatement=pt;const mt=(Wt,zt)=>{Wt.type="ReturnStatement",Wt=Wt,Wt.argument=zt};i.mutateToReturnStatement=mt;const gt=(Wt,zt,Ht)=>{Wt.type="MemberExpression",Wt=Wt,Wt.object=zt,Wt.property=Ht,Wt.computed=!1};i.mutateToMemberExpression=gt;const dt=(Wt,zt,Ht,Zt)=>({type:"LogicalExpression",operator:Wt,left:zt,right:Ht,loc:Zt});i.logicalExpression=dt;const St=(Wt,zt,Ht,Zt)=>{Wt.type="ConditionalExpression",Wt=Wt,Wt.test=zt,Wt.consequent=Ht,Wt.alternate=Zt};i.mutateToConditionalExpression=St;const xt=(Wt,zt,Ht,Zt)=>({type:"ConditionalExpression",test:Wt,consequent:zt,alternate:Ht,loc:Zt});i.conditionalExpression=xt;const yt=Wt=>({type:"ArrayExpression",elements:Wt});i.arrayExpression=yt;const _t=(Wt,zt)=>({type:"AssignmentExpression",operator:"=",left:Wt,right:zt});i.assignmentExpression=_t;const Ct=(Wt,zt,Ht,Zt)=>({type:"BinaryExpression",operator:Wt,left:zt,right:Ht,loc:Zt});i.binaryExpression=Ct;const Et=(Wt,zt,Ht)=>({type:"UnaryExpression",operator:Wt,prefix:!0,argument:zt,loc:Ht});i.unaryExpression=Et;const kt=Wt=>Wt===void 0?(0,i.identifier)("undefined"):(0,i.literal)(Wt);i.primitive=kt;const Tt=(Wt,zt,Ht,Zt)=>({type:"FunctionExpression",id:Wt,params:zt,body:Ht,loc:Zt});i.functionDeclarationExpression=Tt;const $t=(Wt,zt,Ht,Zt)=>({type:"FunctionDeclaration",id:Wt,params:zt,body:Ht,loc:Zt});i.functionDeclaration=$t;const It=(Wt,zt)=>({type:"BlockExpression",body:Wt,loc:zt});i.blockExpression=It;const Ot=(Wt,zt,Ht)=>({type:"ArrowFunctionExpression",expression:zt.type!=="BlockStatement",generator:!1,params:Wt,body:zt,loc:Ht});i.arrowFunctionExpression=Ot;const Mt=(Wt,zt)=>({type:"VariableDeclaration",kind:"const",declarations:Wt,loc:zt});i.variableDeclaration=Mt;const Dt=(Wt,zt,Ht)=>({type:"VariableDeclarator",id:Wt,init:zt,loc:Ht});i.variableDeclarator=Dt;const Bt=(Wt,zt,Ht,Zt)=>({type:"IfStatement",test:Wt,consequent:zt,alternate:Ht,loc:Zt});i.ifStatement=Bt;const Kt=(Wt,zt,Ht)=>({type:"WhileStatement",test:zt,body:Wt,loc:Ht});i.whileStatement=Kt})(astCreator);var walkers$1={},walk={exports:{}};(function(i,s){(function(o,a){a(s)})(commonjsGlobal,function(o){function a(ut,pt,mt,gt,dt){mt||(mt=ht),function St(xt,yt,_t){var Ct=_t||xt.type;mt[Ct](xt,yt,St),pt[Ct]&&pt[Ct](xt,yt)}(ut,gt,dt)}function rt(ut,pt,mt,gt,dt){var St=[];mt||(mt=ht),function xt(yt,_t,Ct){var Et=Ct||yt.type,kt=yt!==St[St.length-1];kt&&St.push(yt),mt[Et](yt,_t,xt),pt[Et]&&pt[Et](yt,_t||St,St),kt&&St.pop()}(ut,gt,dt)}function et(ut,pt,mt,gt,dt){var St=mt?st(mt,gt||void 0):gt;(function xt(yt,_t,Ct){St[Ct||yt.type](yt,_t,xt)})(ut,pt,dt)}function ot(ut){return typeof ut=="string"?function(pt){return pt===ut}:ut||function(){return!0}}var at=function(pt,mt){this.node=pt,this.state=mt};function nt(ut,pt,mt,gt,dt){mt||(mt=ht);var St;(function xt(yt,_t,Ct){var Et=Ct||yt.type;mt[Et](yt,_t,xt),St!==yt&&(pt(yt,_t,Et),St=yt)})(ut,gt,dt)}function it(ut,pt,mt,gt){mt||(mt=ht);var dt=[],St;(function xt(yt,_t,Ct){var Et=Ct||yt.type,kt=yt!==dt[dt.length-1];kt&&dt.push(yt),mt[Et](yt,_t,xt),St!==yt&&(pt(yt,_t||dt,dt,Et),St=yt),kt&&dt.pop()})(ut,gt)}function j(ut,pt,mt,gt,dt,St){dt||(dt=ht),gt=ot(gt);try{(function xt(yt,_t,Ct){var Et=Ct||yt.type;if((pt==null||yt.start<=pt)&&(mt==null||yt.end>=mt)&&dt[Et](yt,_t,xt),(pt==null||yt.start===pt)&&(mt==null||yt.end===mt)&>(Et,yt))throw new at(yt,_t)})(ut,St)}catch(xt){if(xt instanceof at)return xt;throw xt}}function _(ut,pt,mt,gt,dt){mt=ot(mt),gt||(gt=ht);try{(function St(xt,yt,_t){var Ct=_t||xt.type;if(!(xt.start>pt||xt.end=pt&&mt(Ct,xt))throw new at(xt,yt);gt[Ct](xt,yt,St)}})(ut,dt)}catch(St){if(St instanceof at)return St;throw St}}function tt(ut,pt,mt,gt,dt){mt=ot(mt),gt||(gt=ht);var St;return function xt(yt,_t,Ct){if(!(yt.start>pt)){var Et=Ct||yt.type;yt.end<=pt&&(!St||St.node.end{let et=!0;if((0,walkers_1$1.simple)(rt,{FunctionDeclaration(){et=!1},ArrowFunctionExpression(){et=!1},ReturnStatement(){et=!1},BreakStatement(){et=!1},ContinueStatement(){et=!1}}),!et)return;const ot=new RegExp(/^math_[a-z]+$/);if((0,walkers_1$1.simple)(rt,{CallExpression(tt){if(tt.callee.type!=="Identifier"){et=!1;return}const st=tt.callee.name;if(!ot.test(st)){et=!1;return}}}),!et)return;const at=new Set;(0,walkers_1$1.simple)(rt,{VariableDeclaration(tt){tt.declarations[0].id.type==="Identifier"&&at.add(tt.declarations[0].id.name)}}),this.localVar=at;const nt=[],it=this.getArrayName;if((0,walkers_1$1.simple)(rt,{AssignmentExpression(tt){if(!(tt.left.type==="Identifier"&&at.has(tt.left.name))){if(tt.left.type==="MemberExpression"){const st=it(tt.left);if(at.has(st.name))return}nt.push(tt)}}}),nt.length!==1||nt[0].left.type!=="MemberExpression")return;const j=this.getPropertyAccess(nt[0].left);if(j.length===0||j.length>this.counters.length)return;const _=this.getPropertyAccess,$=this.outputArray;if((0,walkers_1$1.simple)(rt,{MemberExpression(tt){if(it(tt).name!==$.name)return;const lt=_(tt);JSON.stringify(lt)!==JSON.stringify(j)&&(et=!1)}},(0,walkers_1$1.make)({MemberExpression:()=>{}})),!!et){for(let tt=0;tt3&&(this.state=3)}},this.getArrayName=rt=>{let et=rt;for(;et.type==="MemberExpression";)et=et.object;return et},this.getPropertyAccess=rt=>{const et=[];let ot=!0,at=rt;for(;at.type==="MemberExpression";){if(at.property.type!=="Identifier"){ot=!1;break}et.push(at.property.name),at=at.object}return ot?(this.outputArray=at,et.reverse()):[]},this.program=s,this.node=o,this.counters=a,this.state=0,this.checkBody(o)}}bodyVerifier.default=GPUBodyVerifier;var loopVerifier={};Object.defineProperty(loopVerifier,"__esModule",{value:!0});class GPULoopVerifier{constructor(s){this.forLoopTransform=o=>{!o.init||!o.update||!o.test||(this.ok=this.hasCounter(o.init)&&this.hasCondition(o.test)&&this.hasUpdate(o.update))},this.hasCounter=o=>{if(!o||o.type!=="VariableDeclaration"||o.kind!=="let")return!1;const a=o.declarations;if(a.length>1)return!1;const rt=a[0];if(rt.id.type!=="Identifier"||!rt.init)return!1;this.counter=rt.id.name;const et=rt.init;return!(!et||et.type!=="Literal"||et.value!==0)},this.hasCondition=o=>{if(o.type!=="BinaryExpression"||!(o.operator==="<"||o.operator==="<="))return!1;const a=o.left;if(a.type!=="Identifier"||a.name!==this.counter)return!1;const rt=o.right;return rt.type==="Identifier"||rt.type==="Literal"?(this.end=rt,!0):!1},this.hasUpdate=o=>{if(o.type!=="AssignmentExpression"||o.operator!=="="||o.left.type!=="Identifier"||o.left.name!==this.counter||o.right.type!=="BinaryExpression")return!1;const a=o.right;if(a.operator!=="+")return!1;const rt=a.left.type==="Identifier"&&a.left.name===this.counter,et=a.right.type==="Identifier"&&a.right.name===this.counter,ot=a.left.type==="Literal"&&a.left.value===1,at=a.right.type==="Literal"&&a.right.value===1;return rt&&at||et&&ot},this.node=s,this.forLoopTransform(this.node)}}loopVerifier.default=GPULoopVerifier;Object.defineProperty(transfomer,"__esModule",{value:!0});transfomer.gpuRuntimeTranspile=void 0;const create=astCreator,walkers_1=walkers$1,bodyVerifier_1=bodyVerifier,loopVerifier_1=loopVerifier;let currentKernelId=0;class GPUTransformer{constructor(s,o){this.transform=()=>{const a=this.gpuTranspile,rt=[];return(0,walkers_1.simple)(this.program,{ForStatement(et){const ot=a(et);ot>0&&et.loc&&rt.push([et.loc.start.line,ot])}},(0,walkers_1.make)({ForStatement:()=>{}})),rt},this.gpuTranspile=a=>{if(this.state=0,this.counters=[],this.end=[],this.checkOuterLoops(a),this.counters.length===0||new Set(this.counters).size!==this.counters.length)return 0;const rt=new bodyVerifier_1.default(this.program,this.innerBody,this.counters);if(rt.state===0)return 0;this.state=rt.state,this.outputArray=rt.outputArray,this.localVar=rt.localVar,this.getOuterVariables(),this.getTargetBody(a);const et=[];for(const _ in this.outerVariables)if(this.outerVariables.hasOwnProperty(_)){const $=this.outerVariables[_];et.push([create.literal(_),JSON.parse(JSON.stringify($))])}const ot=rt.getArrayName,at=this.localVar;(0,walkers_1.ancestor)(this.targetBody,{AssignmentExpression(_,$){if(_.left.type==="Identifier"||_.left.type!=="MemberExpression")return;const tt=ot(_.left);if(at.has(tt.name))return;const st=$.length;create.mutateToReturnStatement($[st-2],_.right)}});const nt=[];for(let _=0;_create.identifier(_)),this.targetBody),j=create.callExpression(this.globalIds.__createKernelSource,[create.arrayExpression(this.end),create.arrayExpression(et.map(create.arrayExpression)),create.arrayExpression(Array.from(at.values()).map(_=>create.literal(_))),this.outputArray,it,create.literal(currentKernelId++)],a.loc);return create.mutateToExpressionStatement(a,j),this.state},this.checkOuterLoops=a=>{let rt=a;for(;rt.type==="ForStatement";){const et=new loopVerifier_1.default(rt);if(!et.ok||(this.innerBody=rt.body,this.counters.push(et.counter),this.end.push(et.end),this.innerBody.type!=="BlockStatement")||this.innerBody.body.length>1||this.innerBody.body.length===0)break;rt=this.innerBody.body[0]}},this.program=s,this.globalIds={__createKernelSource:o}}getTargetBody(s){let o=this.state;for(this.targetBody=s;o>1;)this.targetBody=this.targetBody.body.body[0],o--;this.targetBody=this.targetBody.body}getOuterVariables(){const s=this.innerBody,o=this.localVar,a=this.counters,rt=this.outputArray.name,et={};(0,walkers_1.simple)(s,{Identifier(ot){o.has(ot.name)||a.includes(ot.name)||ot.name===rt||ot.name.startsWith("math_")||(et[ot.name]=ot)}}),this.outerVariables=et}}function gpuRuntimeTranspile(i,s){const o=i.params.map(at=>at.name),a=i.body;(0,walkers_1.simple)(a,{CallExpression(at){if(at.callee.type!=="Identifier")return;const it=at.callee.name.split("_")[1],j=at.arguments;create.mutateToCallExpression(at,create.memberExpression(create.identifier("Math"),it),j)}});const rt=new Set([...o,"Math"]);(0,walkers_1.simple)(a,{Identifier(at){rt.has(at.name)||s.has(at.name)||create.mutateToMemberExpression(at,create.memberExpression(create.identifier("this"),"constants"),create.identifier(at.name))}});let et=["x"];o.length===2&&(et=["y","x"]),o.length===3&&(et=["z","y","x"]);const ot=o.slice();return(0,walkers_1.simple)(a,{Identifier(at){let nt=-1;for(let j=0;jprettyOutput(o));return Array.from(s)}function checkArray(i){return Array.isArray(i)}function checkArray2D(i,s){for(let o=0;oMAX_SIZE}function manualRun(i,s,o){function a(){for(let ot=0;ot1&&(ot=ot&&checkArray2D(a,i),ot||(at="undefined")),i.length>2&&(ot=ot&&checkArray3D(a,i),ot||(at="undefined")),!ot)throw new rttc_1.TypeError(a,"","object or array",at);if(ot=checkValidGPU(rt,i),!ot){manualRun(rt,i,a);return}const nt=[];for(let $=i.length-1;$>=0;$--)nt.push(i[$]);const it={constants:{}};it.constants=s;const _=et.createKernel(o,it).setOutput(nt)();i.length===1&&buildArray(_,i,a),i.length===2&&build2DArray(_,i,a),i.length===3&&build3DArray(_,i,a)}lib.__createKernel=__createKernel;function entriesToObject(i){const s={};return i.forEach(([o,a])=>s[o]=a),s}const kernels=new Map;function __clearKernelCache(){kernels.clear()}lib.__clearKernelCache=__clearKernelCache;function __createKernelSource(i,s,o,a,rt,et){const ot=entriesToObject(s),at=kernels.get(et);if(at!==void 0)return __createKernel(i,ot,at,a,rt);const nt=rt.toString(),j=(0,acorn_1.parse)(nt,constants_1.ACORN_PARSE_OPTIONS).body[0].expression,_=(0,transfomer_1.gpuRuntimeTranspile)(j,new Set(o)),$=new Function((0,astring_1$8.generate)(_));return kernels.set(et,$),__createKernel(i,ot,$,a,rt)}lib.__createKernelSource=__createKernelSource;var schedulers={},errors={},stringify$1={},closure={},interpreter={},lodash={exports:{}};/** +`)}return Ct.join("")+_t}return _t},normalizeDeclarations:ct=>{if(ct.type!=="VariableDeclaration")throw new Error('Ast is not of type "VariableDeclaration"');const ht=[];for(let ut=0;ut{const ut=ct.createKernel(function(St){return St[this.thread.y][this.thread.x].r*255},{output:[ht.width,ht.height],precision:"unsigned",argumentTypes:{a:"HTMLImage"}}),pt=ct.createKernel(function(St){return St[this.thread.y][this.thread.x].g*255},{output:[ht.width,ht.height],precision:"unsigned",argumentTypes:{a:"HTMLImage"}}),mt=ct.createKernel(function(St){return St[this.thread.y][this.thread.x].b*255},{output:[ht.width,ht.height],precision:"unsigned",argumentTypes:{a:"HTMLImage"}}),gt=ct.createKernel(function(St){return St[this.thread.y][this.thread.x].a*255},{output:[ht.width,ht.height],precision:"unsigned",argumentTypes:{a:"HTMLImage"}}),dt=[ut(ht),pt(ht),mt(ht),gt(ht)];return dt.rKernel=ut,dt.gKernel=pt,dt.bKernel=mt,dt.aKernel=gt,dt.gpu=ct,dt},splitRGBAToCanvases:(ct,ht,ut,pt)=>{const mt=ct.createKernel(function(xt){const yt=xt[this.thread.y][this.thread.x];this.color(yt.r/255,0,0,255)},{output:[ut,pt],graphical:!0,argumentTypes:{v:"Array2D(4)"}});mt(ht);const gt=ct.createKernel(function(xt){const yt=xt[this.thread.y][this.thread.x];this.color(0,yt.g/255,0,255)},{output:[ut,pt],graphical:!0,argumentTypes:{v:"Array2D(4)"}});gt(ht);const dt=ct.createKernel(function(xt){const yt=xt[this.thread.y][this.thread.x];this.color(0,0,yt.b/255,255)},{output:[ut,pt],graphical:!0,argumentTypes:{v:"Array2D(4)"}});dt(ht);const St=ct.createKernel(function(xt){const yt=xt[this.thread.y][this.thread.x];this.color(255,255,255,yt.a/255)},{output:[ut,pt],graphical:!0,argumentTypes:{v:"Array2D(4)"}});return St(ht),[mt.canvas,gt.canvas,dt.canvas,St.canvas]},getMinifySafeName:ct=>{try{const ht=tt.parse(`const value = ${ct.toString()}`),{init:ut}=ht.body[0].declarations[0];return ut.body.name||ut.body.body[0].argument.name}catch{throw new Error("Unrecognized function type. Please use `() => yourFunctionVariableHere` or function() { return yourFunctionVariableHere; }")}},sanitizeName:function(ct){return $.test(ct)&&(ct=ct.replace($,"S_S")),et.test(ct)?ct=ct.replace(et,"U_U"):st.test(ct)&&(ct=ct.replace(st,"u_u")),ct}},$=/\$/,et=/__/,st=/_/,lt=_.getSystemEndianness();a.exports={utils:_}},{"./input":110,"./texture":113,acorn:1}]},{},[107])(107)})})(gpuBrowser);var gpuBrowserExports=gpuBrowser.exports,rttc={},runtimeSourceError={};Object.defineProperty(runtimeSourceError,"__esModule",{value:!0});runtimeSourceError.RuntimeSourceError=void 0;const constants_1$1=constants,types_1$l=types;class RuntimeSourceError{constructor(s){this.type=types_1$l.ErrorType.RUNTIME,this.severity=types_1$l.ErrorSeverity.ERROR,this.location=s?s.loc:constants_1$1.UNKNOWN_LOCATION}explain(){return""}elaborate(){return this.explain()}}runtimeSourceError.RuntimeSourceError=RuntimeSourceError;Object.defineProperty(rttc,"__esModule",{value:!0});rttc.isIdentifier=rttc.checkMemberAccess=rttc.checkIfStatement=rttc.checkBinaryExpression=rttc.checkUnaryExpression=rttc.TypeError=void 0;const runtimeSourceError_1$1=runtimeSourceError,types_1$k=types,LHS=" on left hand side of operation",RHS=" on right hand side of operation";let TypeError$1=class extends runtimeSourceError_1$1.RuntimeSourceError{constructor(s,o,a,rt,tt=types_1$k.Chapter.SOURCE_4){super(s),this.side=o,this.expected=a,this.got=rt,this.chapter=tt,this.type=types_1$k.ErrorType.RUNTIME,this.severity=types_1$k.ErrorSeverity.ERROR}explain(){const s=this.got==="array"?this.chapter<=2?"pair":"compound data":this.got;return`Expected ${this.expected}${this.side}, got ${s}.`}elaborate(){return this.explain()}};rttc.TypeError=TypeError$1;const typeOf=i=>i===null?"null":Array.isArray(i)?"array":typeof i,isNumber=i=>typeOf(i)==="number",isArrayIndex=i=>isNumber(i)&&i>>>0===i&&i<2**32-1,isString=i=>typeOf(i)==="string",isBool=i=>typeOf(i)==="boolean",isObject=i=>typeOf(i)==="object",isArray=i=>typeOf(i)==="array",checkUnaryExpression=(i,s,o,a=types_1$k.Chapter.SOURCE_4)=>(s==="+"||s==="-")&&!isNumber(o)?new TypeError$1(i,"","number",typeOf(o),a):s==="!"&&!isBool(o)?new TypeError$1(i,"","boolean",typeOf(o),a):void 0;rttc.checkUnaryExpression=checkUnaryExpression;const checkBinaryExpression=(i,s,o,a,rt)=>{switch(s){case"-":case"*":case"/":case"%":return isNumber(a)?isNumber(rt)?void 0:new TypeError$1(i,RHS,"number",typeOf(rt),o):new TypeError$1(i,LHS,"number",typeOf(a),o);case"+":case"<":case"<=":case">":case">=":case"!==":case"===":return o>2&&(s==="==="||s==="!==")?void 0:isNumber(a)?isNumber(rt)?void 0:new TypeError$1(i,RHS,"number",typeOf(rt),o):isString(a)?isString(rt)?void 0:new TypeError$1(i,RHS,"string",typeOf(rt),o):new TypeError$1(i,LHS,"string or number",typeOf(a),o);default:return}};rttc.checkBinaryExpression=checkBinaryExpression;const checkIfStatement=(i,s,o=types_1$k.Chapter.SOURCE_4)=>isBool(s)?void 0:new TypeError$1(i," as condition","boolean",typeOf(s),o);rttc.checkIfStatement=checkIfStatement;const checkMemberAccess=(i,s,o)=>isObject(s)?isString(o)?void 0:new TypeError$1(i," as prop","string",typeOf(o)):isArray(s)?isArrayIndex(o)?void 0:isNumber(o)?new TypeError$1(i," as prop","array index","other number"):new TypeError$1(i," as prop","array index",typeOf(o)):new TypeError$1(i,"","object or array",typeOf(s));rttc.checkMemberAccess=checkMemberAccess;const isIdentifier=i=>i.name!==void 0;rttc.isIdentifier=isIdentifier;var transfomer={},astCreator={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.whileStatement=i.ifStatement=i.variableDeclarator=i.variableDeclaration=i.arrowFunctionExpression=i.blockExpression=i.functionDeclaration=i.functionDeclarationExpression=i.primitive=i.unaryExpression=i.binaryExpression=i.assignmentExpression=i.arrayExpression=i.conditionalExpression=i.mutateToConditionalExpression=i.logicalExpression=i.mutateToMemberExpression=i.mutateToReturnStatement=i.mutateToExpressionStatement=i.mutateToAssignmentExpression=i.mutateToCallExpression=i.objectExpression=i.property=i.returnStatement=i.program=i.blockStatement=i.functionExpression=i.blockArrowFunction=i.expressionStatement=i.callExpression=i.constantDeclaration=i.declaration=i.memberExpression=i.literal=i.identifier=i.locationDummyNode=i.getVariableDecarationName=void 0;const s=Wt=>Wt.declarations[0].id.name;i.getVariableDecarationName=s;const o=(Wt,zt)=>(0,i.literal)("Dummy",{start:{line:Wt,column:zt},end:{line:Wt,column:zt}});i.locationDummyNode=o;const a=(Wt,zt)=>({type:"Identifier",name:Wt,loc:zt});i.identifier=a;const rt=(Wt,zt)=>({type:"Literal",value:Wt,loc:zt});i.literal=rt;const tt=(Wt,zt)=>({type:"MemberExpression",object:Wt,computed:typeof zt=="number",optional:!1,property:typeof zt=="number"?(0,i.literal)(zt):(0,i.identifier)(zt)});i.memberExpression=tt;const ot=(Wt,zt,Ht,Zt)=>({type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:(0,i.identifier)(Wt),init:Ht}],kind:zt,loc:Zt});i.declaration=ot;const at=(Wt,zt,Ht)=>(0,i.declaration)(Wt,"const",zt,Ht);i.constantDeclaration=at;const nt=(Wt,zt,Ht)=>({type:"CallExpression",callee:Wt,arguments:zt,optional:!1,loc:Ht});i.callExpression=nt;const it=Wt=>({type:"ExpressionStatement",expression:Wt});i.expressionStatement=it;const j=(Wt,zt,Ht)=>({type:"ArrowFunctionExpression",expression:!1,generator:!1,params:Wt,body:Array.isArray(zt)?(0,i.blockStatement)(zt):zt,loc:Ht});i.blockArrowFunction=j;const _=(Wt,zt,Ht)=>({type:"FunctionExpression",id:null,async:!1,generator:!1,params:Wt,body:Array.isArray(zt)?(0,i.blockStatement)(zt):zt,loc:Ht});i.functionExpression=_;const $=Wt=>({type:"BlockStatement",body:Wt});i.blockStatement=$;const et=Wt=>({type:"Program",sourceType:"module",body:Wt});i.program=et;const st=(Wt,zt)=>({type:"ReturnStatement",argument:Wt,loc:zt});i.returnStatement=st;const lt=(Wt,zt)=>({type:"Property",method:!1,shorthand:!1,computed:!1,key:(0,i.identifier)(Wt),value:zt,kind:"init"});i.property=lt;const ct=Wt=>({type:"ObjectExpression",properties:Wt});i.objectExpression=ct;const ht=(Wt,zt,Ht)=>{Wt.type="CallExpression",Wt=Wt,Wt.callee=zt,Wt.arguments=Ht};i.mutateToCallExpression=ht;const ut=(Wt,zt,Ht)=>{Wt.type="AssignmentExpression",Wt=Wt,Wt.operator="=",Wt.left=zt,Wt.right=Ht};i.mutateToAssignmentExpression=ut;const pt=(Wt,zt)=>{Wt.type="ExpressionStatement",Wt=Wt,Wt.expression=zt};i.mutateToExpressionStatement=pt;const mt=(Wt,zt)=>{Wt.type="ReturnStatement",Wt=Wt,Wt.argument=zt};i.mutateToReturnStatement=mt;const gt=(Wt,zt,Ht)=>{Wt.type="MemberExpression",Wt=Wt,Wt.object=zt,Wt.property=Ht,Wt.computed=!1};i.mutateToMemberExpression=gt;const dt=(Wt,zt,Ht,Zt)=>({type:"LogicalExpression",operator:Wt,left:zt,right:Ht,loc:Zt});i.logicalExpression=dt;const St=(Wt,zt,Ht,Zt)=>{Wt.type="ConditionalExpression",Wt=Wt,Wt.test=zt,Wt.consequent=Ht,Wt.alternate=Zt};i.mutateToConditionalExpression=St;const xt=(Wt,zt,Ht,Zt)=>({type:"ConditionalExpression",test:Wt,consequent:zt,alternate:Ht,loc:Zt});i.conditionalExpression=xt;const yt=Wt=>({type:"ArrayExpression",elements:Wt});i.arrayExpression=yt;const _t=(Wt,zt)=>({type:"AssignmentExpression",operator:"=",left:Wt,right:zt});i.assignmentExpression=_t;const Ct=(Wt,zt,Ht,Zt)=>({type:"BinaryExpression",operator:Wt,left:zt,right:Ht,loc:Zt});i.binaryExpression=Ct;const Et=(Wt,zt,Ht)=>({type:"UnaryExpression",operator:Wt,prefix:!0,argument:zt,loc:Ht});i.unaryExpression=Et;const kt=Wt=>Wt===void 0?(0,i.identifier)("undefined"):(0,i.literal)(Wt);i.primitive=kt;const Tt=(Wt,zt,Ht,Zt)=>({type:"FunctionExpression",id:Wt,params:zt,body:Ht,loc:Zt});i.functionDeclarationExpression=Tt;const $t=(Wt,zt,Ht,Zt)=>({type:"FunctionDeclaration",id:Wt,params:zt,body:Ht,loc:Zt});i.functionDeclaration=$t;const It=(Wt,zt)=>({type:"BlockExpression",body:Wt,loc:zt});i.blockExpression=It;const Ot=(Wt,zt,Ht)=>({type:"ArrowFunctionExpression",expression:zt.type!=="BlockStatement",generator:!1,params:Wt,body:zt,loc:Ht});i.arrowFunctionExpression=Ot;const Mt=(Wt,zt)=>({type:"VariableDeclaration",kind:"const",declarations:Wt,loc:zt});i.variableDeclaration=Mt;const Dt=(Wt,zt,Ht)=>({type:"VariableDeclarator",id:Wt,init:zt,loc:Ht});i.variableDeclarator=Dt;const Bt=(Wt,zt,Ht,Zt)=>({type:"IfStatement",test:Wt,consequent:zt,alternate:Ht,loc:Zt});i.ifStatement=Bt;const Kt=(Wt,zt,Ht)=>({type:"WhileStatement",test:zt,body:Wt,loc:Ht});i.whileStatement=Kt})(astCreator);var walkers$1={},walk={exports:{}};(function(i,s){(function(o,a){a(s)})(commonjsGlobal,function(o){function a(ut,pt,mt,gt,dt){mt||(mt=ht),function St(xt,yt,_t){var Ct=_t||xt.type;mt[Ct](xt,yt,St),pt[Ct]&&pt[Ct](xt,yt)}(ut,gt,dt)}function rt(ut,pt,mt,gt,dt){var St=[];mt||(mt=ht),function xt(yt,_t,Ct){var Et=Ct||yt.type,kt=yt!==St[St.length-1];kt&&St.push(yt),mt[Et](yt,_t,xt),pt[Et]&&pt[Et](yt,_t||St,St),kt&&St.pop()}(ut,gt,dt)}function tt(ut,pt,mt,gt,dt){var St=mt?st(mt,gt||void 0):gt;(function xt(yt,_t,Ct){St[Ct||yt.type](yt,_t,xt)})(ut,pt,dt)}function ot(ut){return typeof ut=="string"?function(pt){return pt===ut}:ut||function(){return!0}}var at=function(pt,mt){this.node=pt,this.state=mt};function nt(ut,pt,mt,gt,dt){mt||(mt=ht);var St;(function xt(yt,_t,Ct){var Et=Ct||yt.type;mt[Et](yt,_t,xt),St!==yt&&(pt(yt,_t,Et),St=yt)})(ut,gt,dt)}function it(ut,pt,mt,gt){mt||(mt=ht);var dt=[],St;(function xt(yt,_t,Ct){var Et=Ct||yt.type,kt=yt!==dt[dt.length-1];kt&&dt.push(yt),mt[Et](yt,_t,xt),St!==yt&&(pt(yt,_t||dt,dt,Et),St=yt),kt&&dt.pop()})(ut,gt)}function j(ut,pt,mt,gt,dt,St){dt||(dt=ht),gt=ot(gt);try{(function xt(yt,_t,Ct){var Et=Ct||yt.type;if((pt==null||yt.start<=pt)&&(mt==null||yt.end>=mt)&&dt[Et](yt,_t,xt),(pt==null||yt.start===pt)&&(mt==null||yt.end===mt)&>(Et,yt))throw new at(yt,_t)})(ut,St)}catch(xt){if(xt instanceof at)return xt;throw xt}}function _(ut,pt,mt,gt,dt){mt=ot(mt),gt||(gt=ht);try{(function St(xt,yt,_t){var Ct=_t||xt.type;if(!(xt.start>pt||xt.end=pt&&mt(Ct,xt))throw new at(xt,yt);gt[Ct](xt,yt,St)}})(ut,dt)}catch(St){if(St instanceof at)return St;throw St}}function et(ut,pt,mt,gt,dt){mt=ot(mt),gt||(gt=ht);var St;return function xt(yt,_t,Ct){if(!(yt.start>pt)){var Et=Ct||yt.type;yt.end<=pt&&(!St||St.node.end{let tt=!0;if((0,walkers_1$1.simple)(rt,{FunctionDeclaration(){tt=!1},ArrowFunctionExpression(){tt=!1},ReturnStatement(){tt=!1},BreakStatement(){tt=!1},ContinueStatement(){tt=!1}}),!tt)return;const ot=new RegExp(/^math_[a-z]+$/);if((0,walkers_1$1.simple)(rt,{CallExpression(et){if(et.callee.type!=="Identifier"){tt=!1;return}const st=et.callee.name;if(!ot.test(st)){tt=!1;return}}}),!tt)return;const at=new Set;(0,walkers_1$1.simple)(rt,{VariableDeclaration(et){et.declarations[0].id.type==="Identifier"&&at.add(et.declarations[0].id.name)}}),this.localVar=at;const nt=[],it=this.getArrayName;if((0,walkers_1$1.simple)(rt,{AssignmentExpression(et){if(!(et.left.type==="Identifier"&&at.has(et.left.name))){if(et.left.type==="MemberExpression"){const st=it(et.left);if(at.has(st.name))return}nt.push(et)}}}),nt.length!==1||nt[0].left.type!=="MemberExpression")return;const j=this.getPropertyAccess(nt[0].left);if(j.length===0||j.length>this.counters.length)return;const _=this.getPropertyAccess,$=this.outputArray;if((0,walkers_1$1.simple)(rt,{MemberExpression(et){if(it(et).name!==$.name)return;const lt=_(et);JSON.stringify(lt)!==JSON.stringify(j)&&(tt=!1)}},(0,walkers_1$1.make)({MemberExpression:()=>{}})),!!tt){for(let et=0;et3&&(this.state=3)}},this.getArrayName=rt=>{let tt=rt;for(;tt.type==="MemberExpression";)tt=tt.object;return tt},this.getPropertyAccess=rt=>{const tt=[];let ot=!0,at=rt;for(;at.type==="MemberExpression";){if(at.property.type!=="Identifier"){ot=!1;break}tt.push(at.property.name),at=at.object}return ot?(this.outputArray=at,tt.reverse()):[]},this.program=s,this.node=o,this.counters=a,this.state=0,this.checkBody(o)}}bodyVerifier.default=GPUBodyVerifier;var loopVerifier={};Object.defineProperty(loopVerifier,"__esModule",{value:!0});class GPULoopVerifier{constructor(s){this.forLoopTransform=o=>{!o.init||!o.update||!o.test||(this.ok=this.hasCounter(o.init)&&this.hasCondition(o.test)&&this.hasUpdate(o.update))},this.hasCounter=o=>{if(!o||o.type!=="VariableDeclaration"||o.kind!=="let")return!1;const a=o.declarations;if(a.length>1)return!1;const rt=a[0];if(rt.id.type!=="Identifier"||!rt.init)return!1;this.counter=rt.id.name;const tt=rt.init;return!(!tt||tt.type!=="Literal"||tt.value!==0)},this.hasCondition=o=>{if(o.type!=="BinaryExpression"||!(o.operator==="<"||o.operator==="<="))return!1;const a=o.left;if(a.type!=="Identifier"||a.name!==this.counter)return!1;const rt=o.right;return rt.type==="Identifier"||rt.type==="Literal"?(this.end=rt,!0):!1},this.hasUpdate=o=>{if(o.type!=="AssignmentExpression"||o.operator!=="="||o.left.type!=="Identifier"||o.left.name!==this.counter||o.right.type!=="BinaryExpression")return!1;const a=o.right;if(a.operator!=="+")return!1;const rt=a.left.type==="Identifier"&&a.left.name===this.counter,tt=a.right.type==="Identifier"&&a.right.name===this.counter,ot=a.left.type==="Literal"&&a.left.value===1,at=a.right.type==="Literal"&&a.right.value===1;return rt&&at||tt&&ot},this.node=s,this.forLoopTransform(this.node)}}loopVerifier.default=GPULoopVerifier;Object.defineProperty(transfomer,"__esModule",{value:!0});transfomer.gpuRuntimeTranspile=void 0;const create=astCreator,walkers_1=walkers$1,bodyVerifier_1=bodyVerifier,loopVerifier_1=loopVerifier;let currentKernelId=0;class GPUTransformer{constructor(s,o){this.transform=()=>{const a=this.gpuTranspile,rt=[];return(0,walkers_1.simple)(this.program,{ForStatement(tt){const ot=a(tt);ot>0&&tt.loc&&rt.push([tt.loc.start.line,ot])}},(0,walkers_1.make)({ForStatement:()=>{}})),rt},this.gpuTranspile=a=>{if(this.state=0,this.counters=[],this.end=[],this.checkOuterLoops(a),this.counters.length===0||new Set(this.counters).size!==this.counters.length)return 0;const rt=new bodyVerifier_1.default(this.program,this.innerBody,this.counters);if(rt.state===0)return 0;this.state=rt.state,this.outputArray=rt.outputArray,this.localVar=rt.localVar,this.getOuterVariables(),this.getTargetBody(a);const tt=[];for(const _ in this.outerVariables)if(this.outerVariables.hasOwnProperty(_)){const $=this.outerVariables[_];tt.push([create.literal(_),JSON.parse(JSON.stringify($))])}const ot=rt.getArrayName,at=this.localVar;(0,walkers_1.ancestor)(this.targetBody,{AssignmentExpression(_,$){if(_.left.type==="Identifier"||_.left.type!=="MemberExpression")return;const et=ot(_.left);if(at.has(et.name))return;const st=$.length;create.mutateToReturnStatement($[st-2],_.right)}});const nt=[];for(let _=0;_create.identifier(_)),this.targetBody),j=create.callExpression(this.globalIds.__createKernelSource,[create.arrayExpression(this.end),create.arrayExpression(tt.map(create.arrayExpression)),create.arrayExpression(Array.from(at.values()).map(_=>create.literal(_))),this.outputArray,it,create.literal(currentKernelId++)],a.loc);return create.mutateToExpressionStatement(a,j),this.state},this.checkOuterLoops=a=>{let rt=a;for(;rt.type==="ForStatement";){const tt=new loopVerifier_1.default(rt);if(!tt.ok||(this.innerBody=rt.body,this.counters.push(tt.counter),this.end.push(tt.end),this.innerBody.type!=="BlockStatement")||this.innerBody.body.length>1||this.innerBody.body.length===0)break;rt=this.innerBody.body[0]}},this.program=s,this.globalIds={__createKernelSource:o}}getTargetBody(s){let o=this.state;for(this.targetBody=s;o>1;)this.targetBody=this.targetBody.body.body[0],o--;this.targetBody=this.targetBody.body}getOuterVariables(){const s=this.innerBody,o=this.localVar,a=this.counters,rt=this.outputArray.name,tt={};(0,walkers_1.simple)(s,{Identifier(ot){o.has(ot.name)||a.includes(ot.name)||ot.name===rt||ot.name.startsWith("math_")||(tt[ot.name]=ot)}}),this.outerVariables=tt}}function gpuRuntimeTranspile(i,s){const o=i.params.map(at=>at.name),a=i.body;(0,walkers_1.simple)(a,{CallExpression(at){if(at.callee.type!=="Identifier")return;const it=at.callee.name.split("_")[1],j=at.arguments;create.mutateToCallExpression(at,create.memberExpression(create.identifier("Math"),it),j)}});const rt=new Set([...o,"Math"]);(0,walkers_1.simple)(a,{Identifier(at){rt.has(at.name)||s.has(at.name)||create.mutateToMemberExpression(at,create.memberExpression(create.identifier("this"),"constants"),create.identifier(at.name))}});let tt=["x"];o.length===2&&(tt=["y","x"]),o.length===3&&(tt=["z","y","x"]);const ot=o.slice();return(0,walkers_1.simple)(a,{Identifier(at){let nt=-1;for(let j=0;jprettyOutput(o));return Array.from(s)}function checkArray(i){return Array.isArray(i)}function checkArray2D(i,s){for(let o=0;oMAX_SIZE}function manualRun(i,s,o){function a(){for(let ot=0;ot1&&(ot=ot&&checkArray2D(a,i),ot||(at="undefined")),i.length>2&&(ot=ot&&checkArray3D(a,i),ot||(at="undefined")),!ot)throw new rttc_1.TypeError(a,"","object or array",at);if(ot=checkValidGPU(rt,i),!ot){manualRun(rt,i,a);return}const nt=[];for(let $=i.length-1;$>=0;$--)nt.push(i[$]);const it={constants:{}};it.constants=s;const _=tt.createKernel(o,it).setOutput(nt)();i.length===1&&buildArray(_,i,a),i.length===2&&build2DArray(_,i,a),i.length===3&&build3DArray(_,i,a)}lib.__createKernel=__createKernel;function entriesToObject(i){const s={};return i.forEach(([o,a])=>s[o]=a),s}const kernels=new Map;function __clearKernelCache(){kernels.clear()}lib.__clearKernelCache=__clearKernelCache;function __createKernelSource(i,s,o,a,rt,tt){const ot=entriesToObject(s),at=kernels.get(tt);if(at!==void 0)return __createKernel(i,ot,at,a,rt);const nt=rt.toString(),j=(0,acorn_1.parse)(nt,constants_1.ACORN_PARSE_OPTIONS).body[0].expression,_=(0,transfomer_1.gpuRuntimeTranspile)(j,new Set(o)),$=new Function((0,astring_1$8.generate)(_));return kernels.set(tt,$),__createKernel(i,ot,$,a,rt)}lib.__createKernelSource=__createKernelSource;var schedulers={},errors={},stringify$1={},closure={},interpreter={},lodash={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */lodash.exports;(function(i,s){(function(){var o,a="4.17.21",rt=200,et="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",ot="Expected a function",at="Invalid `variable` option passed into `_.template`",nt="__lodash_hash_undefined__",it=500,j="__lodash_placeholder__",_=1,$=2,tt=4,st=1,lt=2,ct=1,ht=2,ut=4,pt=8,mt=16,gt=32,dt=64,St=128,xt=256,yt=512,_t=30,Ct="...",Et=800,kt=16,Tt=1,$t=2,It=3,Ot=1/0,Mt=9007199254740991,Dt=17976931348623157e292,Bt=NaN,Kt=4294967295,Wt=Kt-1,zt=Kt>>>1,Ht=[["ary",St],["bind",ct],["bindKey",ht],["curry",pt],["curryRight",mt],["flip",yt],["partial",gt],["partialRight",dt],["rearg",xt]],Zt="[object Arguments]",qt="[object Array]",hr="[object AsyncFunction]",fr="[object Boolean]",mr="[object Date]",gr="[object DOMException]",tr="[object Error]",rr="[object Function]",Qt="[object GeneratorFunction]",xr="[object Map]",Sr="[object Number]",dr="[object Null]",Ur="[object Object]",tn="[object Promise]",on="[object Proxy]",Rn="[object RegExp]",Nn="[object Set]",Mn="[object String]",pn="[object Symbol]",Hn="[object Undefined]",In="[object WeakMap]",_r="[object WeakSet]",Nr="[object ArrayBuffer]",kr="[object DataView]",nn="[object Float32Array]",Yt="[object Float64Array]",er="[object Int8Array]",lr="[object Int16Array]",Lr="[object Int32Array]",Or="[object Uint8Array]",Er="[object Uint8ClampedArray]",Cr="[object Uint16Array]",Hr="[object Uint32Array]",rn=/\b__p \+= '';/g,Dr=/\b(__p \+=) '' \+/g,Yr=/(__e\(.*?\)|\b__t\)) \+\n'';/g,jr=/&(?:amp|lt|gt|quot|#39);/g,Gr=/[&<>"']/g,an=RegExp(jr.source),Rr=RegExp(Gr.source),mn=/<%-([\s\S]+?)%>/g,Rs=/<%([\s\S]+?)%>/g,ps=/<%=([\s\S]+?)%>/g,Xn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ls=/^\w*$/,Ns=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ms=/[\\^$.*+?()[\]{}|]/g,no=RegExp(ms.source),Vs=/^\s+/,io=/\s/,us=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,cs=/\{\n\/\* \[wrapped with (.+)\] \*/,Gs=/,? & /,Jr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,hs=/[()=,{}\[\]\/\s]/,Ks=/\\(\\)?/g,ws=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Zn=/\w*$/,ho=/^[-+]0x[0-9a-f]+$/i,so=/^0b[01]+$/i,fo=/^\[object .+?Constructor\]$/,po=/^0o[0-7]+$/i,oo=/^(?:0|[1-9]\d*)$/,fs=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_s=/($^)/,Is=/['\n\r\u2028\u2029\\]/g,Es="\\ud800-\\udfff",Xs="\\u0300-\\u036f",gs="\\ufe20-\\ufe2f",gn="\\u20d0-\\u20ff",Xr=Xs+gs+gn,Qn="\\u2700-\\u27bf",Jn="a-z\\xdf-\\xf6\\xf8-\\xff",mo="\\xac\\xb1\\xd7\\xf7",wo="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",go="\\u2000-\\u206f",wt=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Lt="A-Z\\xc0-\\xd6\\xd8-\\xde",Vt="\\ufe0e\\ufe0f",Xt=mo+wo+go+wt,or="['’]",br="["+Es+"]",$r="["+Xt+"]",zr="["+Xr+"]",Zr="\\d+",wn="["+Qn+"]",zn="["+Jn+"]",_i="[^"+Es+Xt+Zr+Qn+Jn+Lt+"]",es="\\ud83c[\\udffb-\\udfff]",ys="(?:"+zr+"|"+es+")",Bs="[^"+Es+"]",yn="(?:\\ud83c[\\udde6-\\uddff]){2}",vs="[\\ud800-\\udbff][\\udc00-\\udfff]",ss="["+Lt+"]",_o="\\u200d",Eo="(?:"+zn+"|"+_i+")",xs="(?:"+ss+"|"+_i+")",Po="(?:"+or+"(?:d|ll|m|re|s|t|ve))?",Do="(?:"+or+"(?:D|LL|M|RE|S|T|VE))?",vt=ys+"?",Rt="["+Vt+"]?",Ft="(?:"+_o+"(?:"+[Bs,yn,vs].join("|")+")"+Rt+vt+")*",Ut="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",sr="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",vr=Rt+vt+Ft,wr="(?:"+[wn,yn,vs].join("|")+")"+vr,Fr="(?:"+[Bs+zr+"?",zr,yn,vs,br].join("|")+")",Br=RegExp(or,"g"),ln=RegExp(zr,"g"),hn=RegExp(es+"(?="+es+")|"+Fr+vr,"g"),jn=RegExp([ss+"?"+zn+"+"+Po+"(?="+[$r,ss,"$"].join("|")+")",xs+"+"+Do+"(?="+[$r,ss+Eo,"$"].join("|")+")",ss+"?"+Eo+"+"+Po,ss+"+"+Do,sr,Ut,Zr,wr].join("|"),"g"),Ts=RegExp("["+_o+Es+Xr+Vt+"]"),Cs=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ls=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],yo=-1,kn={};kn[nn]=kn[Yt]=kn[er]=kn[lr]=kn[Lr]=kn[Or]=kn[Er]=kn[Cr]=kn[Hr]=!0,kn[Zt]=kn[qt]=kn[Nr]=kn[fr]=kn[kr]=kn[mr]=kn[tr]=kn[rr]=kn[xr]=kn[Sr]=kn[Ur]=kn[Rn]=kn[Nn]=kn[Mn]=kn[In]=!1;var Tn={};Tn[Zt]=Tn[qt]=Tn[Nr]=Tn[kr]=Tn[fr]=Tn[mr]=Tn[nn]=Tn[Yt]=Tn[er]=Tn[lr]=Tn[Lr]=Tn[xr]=Tn[Sr]=Tn[Ur]=Tn[Rn]=Tn[Nn]=Tn[Mn]=Tn[pn]=Tn[Or]=Tn[Er]=Tn[Cr]=Tn[Hr]=!0,Tn[tr]=Tn[rr]=Tn[In]=!1;var ir={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Nt={"&":"&","<":"<",">":">",'"':""","'":"'"},nr={"&":"&","<":"<",">":">",""":'"',"'":"'"},cr={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Vr=parseFloat,Wr=parseInt,sn=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,vn=typeof self=="object"&&self&&self.Object===Object&&self,qr=sn||vn||Function("return this")(),un=s&&!s.nodeType&&s,Ln=un&&!0&&i&&!i.nodeType&&i,Vn=Ln&&Ln.exports===un,Un=Vn&&sn.process,On=function(){try{var pr=Ln&&Ln.require&&Ln.require("util").types;return pr||Un&&Un.binding&&Un.binding("util")}catch{}}(),ts=On&&On.isArrayBuffer,Ms=On&&On.isDate,Ys=On&&On.isMap,vo=On&&On.isRegExp,$l=On&&On.isSet,Ho=On&&On.isTypedArray;function os(pr,Ar,Tr){switch(Tr.length){case 0:return pr.call(Ar);case 1:return pr.call(Ar,Tr[0]);case 2:return pr.call(Ar,Tr[0],Tr[1]);case 3:return pr.call(Ar,Tr[0],Tr[1],Tr[2])}return pr.apply(Ar,Tr)}function Py(pr,Ar,Tr,Qr){for(var xn=-1,Pn=pr==null?0:pr.length;++xn-1}function Lu(pr,Ar,Tr){for(var Qr=-1,xn=pr==null?0:pr.length;++Qr-1;);return Tr}function jp(pr,Ar){for(var Tr=pr.length;Tr--&&na(Ar,pr[Tr],0)>-1;);return Tr}function Uy(pr,Ar){for(var Tr=pr.length,Qr=0;Tr--;)pr[Tr]===Ar&&++Qr;return Qr}var Wy=Ou(ir),Hy=Ou(Nt);function Gy(pr){return"\\"+cr[pr]}function Ky(pr,Ar){return pr==null?o:pr[Ar]}function ga(pr){return Ts.test(pr)}function Xy(pr){return Cs.test(pr)}function Yy(pr){for(var Ar,Tr=[];!(Ar=pr.next()).done;)Tr.push(Ar.value);return Tr}function Bu(pr){var Ar=-1,Tr=Array(pr.size);return pr.forEach(function(Qr,xn){Tr[++Ar]=[xn,Qr]}),Tr}function Up(pr,Ar){return function(Tr){return pr(Ar(Tr))}}function No(pr,Ar){for(var Tr=-1,Qr=pr.length,xn=0,Pn=[];++Tr-1}function Ov(ft,bt){var At=this.__data__,Pt=cu(At,ft);return Pt<0?(++this.size,At.push([ft,bt])):At[Pt][1]=bt,this}To.prototype.clear=Lv,To.prototype.delete=Mv,To.prototype.get=Pv,To.prototype.has=Dv,To.prototype.set=Ov;function Co(ft){var bt=-1,At=ft==null?0:ft.length;for(this.clear();++bt=bt?ft:bt)),ft}function Js(ft,bt,At,Pt,jt,Jt){var ar,ur=bt&_,yr=bt&$,Ir=bt&tt;if(At&&(ar=jt?At(ft,Pt,jt,Jt):At(ft)),ar!==o)return ar;if(!Gn(ft))return ft;var Mr=bn(ft);if(Mr){if(ar=B0(ft),!ur)return Ps(ft,ar)}else{var Pr=Ss(ft),Kr=Pr==rr||Pr==Qt;if(Wo(ft))return Tm(ft,ur);if(Pr==Ur||Pr==Zt||Kr&&!jt){if(ar=yr||Kr?{}:Wm(ft),!ur)return yr?A0(ft,Zv(ar,ft)):$0(ft,tm(ar,ft))}else{if(!Tn[Pr])return jt?ft:{};ar=z0(ft,Pr,ur)}}Jt||(Jt=new lo);var en=Jt.get(ft);if(en)return en;Jt.set(ft,ar),xy(ft)?ft.forEach(function(dn){ar.add(Js(dn,bt,At,dn,ft,Jt))}):yy(ft)&&ft.forEach(function(dn,Cn){ar.set(Cn,Js(dn,bt,At,Cn,ft,Jt))});var fn=Ir?yr?fp:hp:yr?Os:as,_n=Mr?o:fn(ft);return qs(_n||ft,function(dn,Cn){_n&&(Cn=dn,dn=ft[Cn]),Dl(ar,Cn,Js(dn,bt,At,Cn,ft,Jt))}),ar}function Jv(ft){var bt=as(ft);return function(At){return rm(At,ft,bt)}}function rm(ft,bt,At){var Pt=At.length;if(ft==null)return!Pt;for(ft=Bn(ft);Pt--;){var jt=At[Pt],Jt=bt[jt],ar=ft[jt];if(ar===o&&!(jt in ft)||!Jt(ar))return!1}return!0}function nm(ft,bt,At){if(typeof ft!="function")throw new Qs(ot);return Ul(function(){ft.apply(o,At)},bt)}function Ol(ft,bt,At,Pt){var jt=-1,Jt=Gl,ar=!0,ur=ft.length,yr=[],Ir=bt.length;if(!ur)return yr;At&&(bt=Wn(bt,zs(At))),Pt?(Jt=Lu,ar=!1):bt.length>=rt&&(Jt=Al,ar=!1,bt=new Xo(bt));e:for(;++jtjt?0:jt+At),Pt=Pt===o||Pt>jt?jt:Sn(Pt),Pt<0&&(Pt+=jt),Pt=At>Pt?0:Sy(Pt);At0&&At(ur)?bt>1?ds(ur,bt-1,At,Pt,jt):Fo(jt,ur):Pt||(jt[jt.length]=ur)}return jt}var Ku=Im(),om=Im(!0);function xo(ft,bt){return ft&&Ku(ft,bt,as)}function Xu(ft,bt){return ft&&om(ft,bt,as)}function fu(ft,bt){return Oo(bt,function(At){return Io(ft[At])})}function qo(ft,bt){bt=jo(bt,ft);for(var At=0,Pt=bt.length;ft!=null&&Atbt}function r0(ft,bt){return ft!=null&&Fn.call(ft,bt)}function n0(ft,bt){return ft!=null&&bt in Bn(ft)}function i0(ft,bt,At){return ft>=bs(bt,At)&&ft=120&&Mr.length>=120)?new Xo(ar&&Mr):o}Mr=ft[0];var Pr=-1,Kr=ur[0];e:for(;++Pr-1;)ur!==ft&&nu.call(ur,yr,1),nu.call(ft,yr,1);return ft}function ym(ft,bt){for(var At=ft?bt.length:0,Pt=At-1;At--;){var jt=bt[At];if(At==Pt||jt!==Jt){var Jt=jt;Ro(jt)?nu.call(ft,jt,1):ip(ft,jt)}}return ft}function tp(ft,bt){return ft+ou(Qp()*(bt-ft+1))}function y0(ft,bt,At,Pt){for(var jt=-1,Jt=ns(su((bt-ft)/(At||1)),0),ar=Tr(Jt);Jt--;)ar[Pt?Jt:++jt]=ft,ft+=At;return ar}function rp(ft,bt){var At="";if(!ft||bt<1||bt>Mt)return At;do bt%2&&(At+=ft),bt=ou(bt/2),bt&&(ft+=ft);while(bt);return At}function En(ft,bt){return xp(Km(ft,bt,Fs),ft+"")}function v0(ft){return em(Cl(ft))}function x0(ft,bt){var At=Cl(ft);return _u(At,Yo(bt,0,At.length))}function Vl(ft,bt,At,Pt){if(!Gn(ft))return ft;bt=jo(bt,ft);for(var jt=-1,Jt=bt.length,ar=Jt-1,ur=ft;ur!=null&&++jtjt?0:jt+bt),At=At>jt?jt:At,At<0&&(At+=jt),jt=bt>At?0:At-bt>>>0,bt>>>=0;for(var Jt=Tr(jt);++Pt>>1,ar=ft[Jt];ar!==null&&!Us(ar)&&(At?ar<=bt:ar=rt){var Ir=bt?null:M0(ft);if(Ir)return Xl(Ir);ar=!1,jt=Al,yr=new Xo}else yr=bt?[]:ur;e:for(;++Pt=Pt?ft:eo(ft,bt,At)}var Em=cv||function(ft){return qr.clearTimeout(ft)};function Tm(ft,bt){if(bt)return ft.slice();var At=ft.length,Pt=Gp?Gp(At):new ft.constructor(At);return ft.copy(Pt),Pt}function lp(ft){var bt=new ft.constructor(ft.byteLength);return new tu(bt).set(new tu(ft)),bt}function E0(ft,bt){var At=bt?lp(ft.buffer):ft.buffer;return new ft.constructor(At,ft.byteOffset,ft.byteLength)}function T0(ft){var bt=new ft.constructor(ft.source,Zn.exec(ft));return bt.lastIndex=ft.lastIndex,bt}function C0(ft){return Pl?Bn(Pl.call(ft)):{}}function Cm(ft,bt){var At=bt?lp(ft.buffer):ft.buffer;return new ft.constructor(At,ft.byteOffset,ft.length)}function km(ft,bt){if(ft!==bt){var At=ft!==o,Pt=ft===null,jt=ft===ft,Jt=Us(ft),ar=bt!==o,ur=bt===null,yr=bt===bt,Ir=Us(bt);if(!ur&&!Ir&&!Jt&&ft>bt||Jt&&ar&&yr&&!ur&&!Ir||Pt&&ar&&yr||!At&&yr||!jt)return 1;if(!Pt&&!Jt&&!Ir&&ft=ur)return yr;var Ir=At[Pt];return yr*(Ir=="desc"?-1:1)}}return ft.index-bt.index}function $m(ft,bt,At,Pt){for(var jt=-1,Jt=ft.length,ar=At.length,ur=-1,yr=bt.length,Ir=ns(Jt-ar,0),Mr=Tr(yr+Ir),Pr=!Pt;++ur1?At[jt-1]:o,ar=jt>2?At[2]:o;for(Jt=ft.length>3&&typeof Jt=="function"?(jt--,Jt):o,ar&&$s(At[0],At[1],ar)&&(Jt=jt<3?o:Jt,jt=1),bt=Bn(bt);++Pt-1?jt[Jt?bt[ar]:ar]:o}}function Pm(ft){return Ao(function(bt){var At=bt.length,Pt=At,jt=Zs.prototype.thru;for(ft&&bt.reverse();Pt--;){var Jt=bt[Pt];if(typeof Jt!="function")throw new Qs(ot);if(jt&&!ar&&Su(Jt)=="wrapper")var ar=new Zs([],!0)}for(Pt=ar?Pt:At;++Pt1&&An.reverse(),Mr&&yrur))return!1;var Ir=Jt.get(ft),Mr=Jt.get(bt);if(Ir&&Mr)return Ir==bt&&Mr==ft;var Pr=-1,Kr=!0,en=At<?new Xo:o;for(Jt.set(ft,bt),Jt.set(bt,ft);++Pr1?"& ":"")+bt[Pt],bt=bt.join(At>2?", ":" "),ft.replace(us,`{ + */lodash.exports;(function(i,s){(function(){var o,a="4.17.21",rt=200,tt="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",ot="Expected a function",at="Invalid `variable` option passed into `_.template`",nt="__lodash_hash_undefined__",it=500,j="__lodash_placeholder__",_=1,$=2,et=4,st=1,lt=2,ct=1,ht=2,ut=4,pt=8,mt=16,gt=32,dt=64,St=128,xt=256,yt=512,_t=30,Ct="...",Et=800,kt=16,Tt=1,$t=2,It=3,Ot=1/0,Mt=9007199254740991,Dt=17976931348623157e292,Bt=NaN,Kt=4294967295,Wt=Kt-1,zt=Kt>>>1,Ht=[["ary",St],["bind",ct],["bindKey",ht],["curry",pt],["curryRight",mt],["flip",yt],["partial",gt],["partialRight",dt],["rearg",xt]],Zt="[object Arguments]",qt="[object Array]",hr="[object AsyncFunction]",fr="[object Boolean]",mr="[object Date]",gr="[object DOMException]",tr="[object Error]",rr="[object Function]",Qt="[object GeneratorFunction]",xr="[object Map]",Sr="[object Number]",dr="[object Null]",Ur="[object Object]",tn="[object Promise]",on="[object Proxy]",Rn="[object RegExp]",Nn="[object Set]",Mn="[object String]",pn="[object Symbol]",Hn="[object Undefined]",In="[object WeakMap]",_r="[object WeakSet]",Nr="[object ArrayBuffer]",kr="[object DataView]",nn="[object Float32Array]",Yt="[object Float64Array]",er="[object Int8Array]",lr="[object Int16Array]",Lr="[object Int32Array]",Or="[object Uint8Array]",Er="[object Uint8ClampedArray]",Cr="[object Uint16Array]",Hr="[object Uint32Array]",rn=/\b__p \+= '';/g,Dr=/\b(__p \+=) '' \+/g,Yr=/(__e\(.*?\)|\b__t\)) \+\n'';/g,jr=/&(?:amp|lt|gt|quot|#39);/g,Gr=/[&<>"']/g,an=RegExp(jr.source),Rr=RegExp(Gr.source),mn=/<%-([\s\S]+?)%>/g,Rs=/<%([\s\S]+?)%>/g,ps=/<%=([\s\S]+?)%>/g,Xn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ls=/^\w*$/,Ns=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ms=/[\\^$.*+?()[\]{}|]/g,no=RegExp(ms.source),Vs=/^\s+/,io=/\s/,us=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,cs=/\{\n\/\* \[wrapped with (.+)\] \*/,Gs=/,? & /,Jr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,hs=/[()=,{}\[\]\/\s]/,Ks=/\\(\\)?/g,ws=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Zn=/\w*$/,ho=/^[-+]0x[0-9a-f]+$/i,so=/^0b[01]+$/i,fo=/^\[object .+?Constructor\]$/,po=/^0o[0-7]+$/i,oo=/^(?:0|[1-9]\d*)$/,fs=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_s=/($^)/,Is=/['\n\r\u2028\u2029\\]/g,Es="\\ud800-\\udfff",Xs="\\u0300-\\u036f",gs="\\ufe20-\\ufe2f",gn="\\u20d0-\\u20ff",Xr=Xs+gs+gn,Qn="\\u2700-\\u27bf",Jn="a-z\\xdf-\\xf6\\xf8-\\xff",mo="\\xac\\xb1\\xd7\\xf7",wo="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",go="\\u2000-\\u206f",wt=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Lt="A-Z\\xc0-\\xd6\\xd8-\\xde",Vt="\\ufe0e\\ufe0f",Xt=mo+wo+go+wt,or="['’]",br="["+Es+"]",$r="["+Xt+"]",zr="["+Xr+"]",Zr="\\d+",wn="["+Qn+"]",zn="["+Jn+"]",_i="[^"+Es+Xt+Zr+Qn+Jn+Lt+"]",es="\\ud83c[\\udffb-\\udfff]",ys="(?:"+zr+"|"+es+")",Bs="[^"+Es+"]",yn="(?:\\ud83c[\\udde6-\\uddff]){2}",vs="[\\ud800-\\udbff][\\udc00-\\udfff]",ss="["+Lt+"]",_o="\\u200d",Eo="(?:"+zn+"|"+_i+")",xs="(?:"+ss+"|"+_i+")",Po="(?:"+or+"(?:d|ll|m|re|s|t|ve))?",Do="(?:"+or+"(?:D|LL|M|RE|S|T|VE))?",vt=ys+"?",Rt="["+Vt+"]?",Ft="(?:"+_o+"(?:"+[Bs,yn,vs].join("|")+")"+Rt+vt+")*",Ut="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",sr="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",vr=Rt+vt+Ft,wr="(?:"+[wn,yn,vs].join("|")+")"+vr,Fr="(?:"+[Bs+zr+"?",zr,yn,vs,br].join("|")+")",Br=RegExp(or,"g"),ln=RegExp(zr,"g"),hn=RegExp(es+"(?="+es+")|"+Fr+vr,"g"),jn=RegExp([ss+"?"+zn+"+"+Po+"(?="+[$r,ss,"$"].join("|")+")",xs+"+"+Do+"(?="+[$r,ss+Eo,"$"].join("|")+")",ss+"?"+Eo+"+"+Po,ss+"+"+Do,sr,Ut,Zr,wr].join("|"),"g"),Ts=RegExp("["+_o+Es+Xr+Vt+"]"),Cs=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ls=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],yo=-1,kn={};kn[nn]=kn[Yt]=kn[er]=kn[lr]=kn[Lr]=kn[Or]=kn[Er]=kn[Cr]=kn[Hr]=!0,kn[Zt]=kn[qt]=kn[Nr]=kn[fr]=kn[kr]=kn[mr]=kn[tr]=kn[rr]=kn[xr]=kn[Sr]=kn[Ur]=kn[Rn]=kn[Nn]=kn[Mn]=kn[In]=!1;var Tn={};Tn[Zt]=Tn[qt]=Tn[Nr]=Tn[kr]=Tn[fr]=Tn[mr]=Tn[nn]=Tn[Yt]=Tn[er]=Tn[lr]=Tn[Lr]=Tn[xr]=Tn[Sr]=Tn[Ur]=Tn[Rn]=Tn[Nn]=Tn[Mn]=Tn[pn]=Tn[Or]=Tn[Er]=Tn[Cr]=Tn[Hr]=!0,Tn[tr]=Tn[rr]=Tn[In]=!1;var ir={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Nt={"&":"&","<":"<",">":">",'"':""","'":"'"},nr={"&":"&","<":"<",">":">",""":'"',"'":"'"},cr={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Vr=parseFloat,Wr=parseInt,sn=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,vn=typeof self=="object"&&self&&self.Object===Object&&self,qr=sn||vn||Function("return this")(),un=s&&!s.nodeType&&s,Ln=un&&!0&&i&&!i.nodeType&&i,Vn=Ln&&Ln.exports===un,Un=Vn&&sn.process,On=function(){try{var pr=Ln&&Ln.require&&Ln.require("util").types;return pr||Un&&Un.binding&&Un.binding("util")}catch{}}(),ts=On&&On.isArrayBuffer,Ms=On&&On.isDate,Ys=On&&On.isMap,vo=On&&On.isRegExp,$l=On&&On.isSet,Ho=On&&On.isTypedArray;function os(pr,Ar,Tr){switch(Tr.length){case 0:return pr.call(Ar);case 1:return pr.call(Ar,Tr[0]);case 2:return pr.call(Ar,Tr[0],Tr[1]);case 3:return pr.call(Ar,Tr[0],Tr[1],Tr[2])}return pr.apply(Ar,Tr)}function Py(pr,Ar,Tr,Qr){for(var xn=-1,Pn=pr==null?0:pr.length;++xn-1}function Lu(pr,Ar,Tr){for(var Qr=-1,xn=pr==null?0:pr.length;++Qr-1;);return Tr}function jp(pr,Ar){for(var Tr=pr.length;Tr--&&na(Ar,pr[Tr],0)>-1;);return Tr}function Uy(pr,Ar){for(var Tr=pr.length,Qr=0;Tr--;)pr[Tr]===Ar&&++Qr;return Qr}var Wy=Ou(ir),Hy=Ou(Nt);function Gy(pr){return"\\"+cr[pr]}function Ky(pr,Ar){return pr==null?o:pr[Ar]}function ga(pr){return Ts.test(pr)}function Xy(pr){return Cs.test(pr)}function Yy(pr){for(var Ar,Tr=[];!(Ar=pr.next()).done;)Tr.push(Ar.value);return Tr}function Bu(pr){var Ar=-1,Tr=Array(pr.size);return pr.forEach(function(Qr,xn){Tr[++Ar]=[xn,Qr]}),Tr}function Up(pr,Ar){return function(Tr){return pr(Ar(Tr))}}function No(pr,Ar){for(var Tr=-1,Qr=pr.length,xn=0,Pn=[];++Tr-1}function Ov(ft,bt){var At=this.__data__,Pt=cu(At,ft);return Pt<0?(++this.size,At.push([ft,bt])):At[Pt][1]=bt,this}To.prototype.clear=Lv,To.prototype.delete=Mv,To.prototype.get=Pv,To.prototype.has=Dv,To.prototype.set=Ov;function Co(ft){var bt=-1,At=ft==null?0:ft.length;for(this.clear();++bt=bt?ft:bt)),ft}function Js(ft,bt,At,Pt,jt,Jt){var ar,ur=bt&_,yr=bt&$,Ir=bt&et;if(At&&(ar=jt?At(ft,Pt,jt,Jt):At(ft)),ar!==o)return ar;if(!Gn(ft))return ft;var Mr=bn(ft);if(Mr){if(ar=B0(ft),!ur)return Ps(ft,ar)}else{var Pr=Ss(ft),Kr=Pr==rr||Pr==Qt;if(Wo(ft))return Tm(ft,ur);if(Pr==Ur||Pr==Zt||Kr&&!jt){if(ar=yr||Kr?{}:Wm(ft),!ur)return yr?A0(ft,Zv(ar,ft)):$0(ft,tm(ar,ft))}else{if(!Tn[Pr])return jt?ft:{};ar=z0(ft,Pr,ur)}}Jt||(Jt=new lo);var en=Jt.get(ft);if(en)return en;Jt.set(ft,ar),xy(ft)?ft.forEach(function(dn){ar.add(Js(dn,bt,At,dn,ft,Jt))}):yy(ft)&&ft.forEach(function(dn,Cn){ar.set(Cn,Js(dn,bt,At,Cn,ft,Jt))});var fn=Ir?yr?fp:hp:yr?Os:as,_n=Mr?o:fn(ft);return qs(_n||ft,function(dn,Cn){_n&&(Cn=dn,dn=ft[Cn]),Dl(ar,Cn,Js(dn,bt,At,Cn,ft,Jt))}),ar}function Jv(ft){var bt=as(ft);return function(At){return rm(At,ft,bt)}}function rm(ft,bt,At){var Pt=At.length;if(ft==null)return!Pt;for(ft=Bn(ft);Pt--;){var jt=At[Pt],Jt=bt[jt],ar=ft[jt];if(ar===o&&!(jt in ft)||!Jt(ar))return!1}return!0}function nm(ft,bt,At){if(typeof ft!="function")throw new Qs(ot);return Ul(function(){ft.apply(o,At)},bt)}function Ol(ft,bt,At,Pt){var jt=-1,Jt=Gl,ar=!0,ur=ft.length,yr=[],Ir=bt.length;if(!ur)return yr;At&&(bt=Wn(bt,zs(At))),Pt?(Jt=Lu,ar=!1):bt.length>=rt&&(Jt=Al,ar=!1,bt=new Xo(bt));e:for(;++jtjt?0:jt+At),Pt=Pt===o||Pt>jt?jt:Sn(Pt),Pt<0&&(Pt+=jt),Pt=At>Pt?0:Sy(Pt);At0&&At(ur)?bt>1?ds(ur,bt-1,At,Pt,jt):Fo(jt,ur):Pt||(jt[jt.length]=ur)}return jt}var Ku=Im(),om=Im(!0);function xo(ft,bt){return ft&&Ku(ft,bt,as)}function Xu(ft,bt){return ft&&om(ft,bt,as)}function fu(ft,bt){return Oo(bt,function(At){return Io(ft[At])})}function qo(ft,bt){bt=jo(bt,ft);for(var At=0,Pt=bt.length;ft!=null&&Atbt}function r0(ft,bt){return ft!=null&&Fn.call(ft,bt)}function n0(ft,bt){return ft!=null&&bt in Bn(ft)}function i0(ft,bt,At){return ft>=bs(bt,At)&&ft=120&&Mr.length>=120)?new Xo(ar&&Mr):o}Mr=ft[0];var Pr=-1,Kr=ur[0];e:for(;++Pr-1;)ur!==ft&&nu.call(ur,yr,1),nu.call(ft,yr,1);return ft}function ym(ft,bt){for(var At=ft?bt.length:0,Pt=At-1;At--;){var jt=bt[At];if(At==Pt||jt!==Jt){var Jt=jt;Ro(jt)?nu.call(ft,jt,1):ip(ft,jt)}}return ft}function tp(ft,bt){return ft+ou(Qp()*(bt-ft+1))}function y0(ft,bt,At,Pt){for(var jt=-1,Jt=ns(su((bt-ft)/(At||1)),0),ar=Tr(Jt);Jt--;)ar[Pt?Jt:++jt]=ft,ft+=At;return ar}function rp(ft,bt){var At="";if(!ft||bt<1||bt>Mt)return At;do bt%2&&(At+=ft),bt=ou(bt/2),bt&&(ft+=ft);while(bt);return At}function En(ft,bt){return xp(Km(ft,bt,Fs),ft+"")}function v0(ft){return em(Cl(ft))}function x0(ft,bt){var At=Cl(ft);return _u(At,Yo(bt,0,At.length))}function Vl(ft,bt,At,Pt){if(!Gn(ft))return ft;bt=jo(bt,ft);for(var jt=-1,Jt=bt.length,ar=Jt-1,ur=ft;ur!=null&&++jtjt?0:jt+bt),At=At>jt?jt:At,At<0&&(At+=jt),jt=bt>At?0:At-bt>>>0,bt>>>=0;for(var Jt=Tr(jt);++Pt>>1,ar=ft[Jt];ar!==null&&!Us(ar)&&(At?ar<=bt:ar=rt){var Ir=bt?null:M0(ft);if(Ir)return Xl(Ir);ar=!1,jt=Al,yr=new Xo}else yr=bt?[]:ur;e:for(;++Pt=Pt?ft:eo(ft,bt,At)}var Em=cv||function(ft){return qr.clearTimeout(ft)};function Tm(ft,bt){if(bt)return ft.slice();var At=ft.length,Pt=Gp?Gp(At):new ft.constructor(At);return ft.copy(Pt),Pt}function lp(ft){var bt=new ft.constructor(ft.byteLength);return new tu(bt).set(new tu(ft)),bt}function E0(ft,bt){var At=bt?lp(ft.buffer):ft.buffer;return new ft.constructor(At,ft.byteOffset,ft.byteLength)}function T0(ft){var bt=new ft.constructor(ft.source,Zn.exec(ft));return bt.lastIndex=ft.lastIndex,bt}function C0(ft){return Pl?Bn(Pl.call(ft)):{}}function Cm(ft,bt){var At=bt?lp(ft.buffer):ft.buffer;return new ft.constructor(At,ft.byteOffset,ft.length)}function km(ft,bt){if(ft!==bt){var At=ft!==o,Pt=ft===null,jt=ft===ft,Jt=Us(ft),ar=bt!==o,ur=bt===null,yr=bt===bt,Ir=Us(bt);if(!ur&&!Ir&&!Jt&&ft>bt||Jt&&ar&&yr&&!ur&&!Ir||Pt&&ar&&yr||!At&&yr||!jt)return 1;if(!Pt&&!Jt&&!Ir&&ft=ur)return yr;var Ir=At[Pt];return yr*(Ir=="desc"?-1:1)}}return ft.index-bt.index}function $m(ft,bt,At,Pt){for(var jt=-1,Jt=ft.length,ar=At.length,ur=-1,yr=bt.length,Ir=ns(Jt-ar,0),Mr=Tr(yr+Ir),Pr=!Pt;++ur1?At[jt-1]:o,ar=jt>2?At[2]:o;for(Jt=ft.length>3&&typeof Jt=="function"?(jt--,Jt):o,ar&&$s(At[0],At[1],ar)&&(Jt=jt<3?o:Jt,jt=1),bt=Bn(bt);++Pt-1?jt[Jt?bt[ar]:ar]:o}}function Pm(ft){return Ao(function(bt){var At=bt.length,Pt=At,jt=Zs.prototype.thru;for(ft&&bt.reverse();Pt--;){var Jt=bt[Pt];if(typeof Jt!="function")throw new Qs(ot);if(jt&&!ar&&Su(Jt)=="wrapper")var ar=new Zs([],!0)}for(Pt=ar?Pt:At;++Pt1&&An.reverse(),Mr&&yrur))return!1;var Ir=Jt.get(ft),Mr=Jt.get(bt);if(Ir&&Mr)return Ir==bt&&Mr==ft;var Pr=-1,Kr=!0,en=At<?new Xo:o;for(Jt.set(ft,bt),Jt.set(bt,ft);++Pr1?"& ":"")+bt[Pt],bt=bt.join(At>2?", ":" "),ft.replace(us,`{ /* [wrapped with `+bt+`] */ -`)}function U0(ft){return bn(ft)||Jo(ft)||!!(Yp&&ft&&ft[Yp])}function Ro(ft,bt){var At=typeof ft;return bt=bt??Mt,!!bt&&(At=="number"||At!="symbol"&&oo.test(ft))&&ft>-1&&ft%1==0&&ft0){if(++bt>=Et)return arguments[0]}else bt=0;return ft.apply(o,arguments)}}function _u(ft,bt){var At=-1,Pt=ft.length,jt=Pt-1;for(bt=bt===o?Pt:bt;++At1?ft[bt-1]:o;return At=typeof At=="function"?(ft.pop(),At):o,sy(ft,At)});function oy(ft){var bt=Gt(ft);return bt.__chain__=!0,bt}function r1(ft,bt){return bt(ft),ft}function Eu(ft,bt){return bt(ft)}var n1=Ao(function(ft){var bt=ft.length,At=bt?ft[0]:0,Pt=this.__wrapped__,jt=function(Jt){return Gu(Jt,ft)};return bt>1||this.__actions__.length||!(Pt instanceof $n)||!Ro(At)?this.thru(jt):(Pt=Pt.slice(At,+At+(bt?1:0)),Pt.__actions__.push({func:Eu,args:[jt],thisArg:o}),new Zs(Pt,this.__chain__).thru(function(Jt){return bt&&!Jt.length&&Jt.push(o),Jt}))});function i1(){return oy(this)}function s1(){return new Zs(this.value(),this.__chain__)}function o1(){this.__values__===o&&(this.__values__=by(this.value()));var ft=this.__index__>=this.__values__.length,bt=ft?o:this.__values__[this.__index__++];return{done:ft,value:bt}}function a1(){return this}function l1(ft){for(var bt,At=this;At instanceof uu;){var Pt=Jm(At);Pt.__index__=0,Pt.__values__=o,bt?jt.__wrapped__=Pt:bt=Pt;var jt=Pt;At=At.__wrapped__}return jt.__wrapped__=ft,bt}function u1(){var ft=this.__wrapped__;if(ft instanceof $n){var bt=ft;return this.__actions__.length&&(bt=new $n(this)),bt=bt.reverse(),bt.__actions__.push({func:Eu,args:[bp],thisArg:o}),new Zs(bt,this.__chain__)}return this.thru(bp)}function c1(){return wm(this.__wrapped__,this.__actions__)}var h1=gu(function(ft,bt,At){Fn.call(ft,At)?++ft[At]:ko(ft,At,1)});function f1(ft,bt,At){var Pt=bn(ft)?Dp:e0;return At&&$s(ft,bt,At)&&(bt=o),Pt(ft,cn(bt,3))}function d1(ft,bt){var At=bn(ft)?Oo:sm;return At(ft,cn(bt,3))}var p1=Mm(ey),m1=Mm(ty);function g1(ft,bt){return ds(Tu(ft,bt),1)}function y1(ft,bt){return ds(Tu(ft,bt),Ot)}function v1(ft,bt,At){return At=At===o?1:Sn(At),ds(Tu(ft,bt),At)}function ay(ft,bt){var At=bn(ft)?qs:Bo;return At(ft,cn(bt,3))}function ly(ft,bt){var At=bn(ft)?Dy:im;return At(ft,cn(bt,3))}var x1=gu(function(ft,bt,At){Fn.call(ft,At)?ft[At].push(bt):ko(ft,At,[bt])});function b1(ft,bt,At,Pt){ft=Ds(ft)?ft:Cl(ft),At=At&&!Pt?Sn(At):0;var jt=ft.length;return At<0&&(At=ns(jt+At,0)),Ru(ft)?At<=jt&&ft.indexOf(bt,At)>-1:!!jt&&na(ft,bt,At)>-1}var S1=En(function(ft,bt,At){var Pt=-1,jt=typeof bt=="function",Jt=Ds(ft)?Tr(ft.length):[];return Bo(ft,function(ar){Jt[++Pt]=jt?os(bt,ar,At):Fl(ar,bt,At)}),Jt}),w1=gu(function(ft,bt,At){ko(ft,At,bt)});function Tu(ft,bt){var At=bn(ft)?Wn:hm;return At(ft,cn(bt,3))}function _1(ft,bt,At,Pt){return ft==null?[]:(bn(bt)||(bt=bt==null?[]:[bt]),At=Pt?o:At,bn(At)||(At=At==null?[]:[At]),mm(ft,bt,At))}var E1=gu(function(ft,bt,At){ft[At?0:1].push(bt)},function(){return[[],[]]});function T1(ft,bt,At){var Pt=bn(ft)?Mu:Vp,jt=arguments.length<3;return Pt(ft,cn(bt,4),At,jt,Bo)}function C1(ft,bt,At){var Pt=bn(ft)?Oy:Vp,jt=arguments.length<3;return Pt(ft,cn(bt,4),At,jt,im)}function k1(ft,bt){var At=bn(ft)?Oo:sm;return At(ft,$u(cn(bt,3)))}function $1(ft){var bt=bn(ft)?em:v0;return bt(ft)}function A1(ft,bt,At){(At?$s(ft,bt,At):bt===o)?bt=1:bt=Sn(bt);var Pt=bn(ft)?Yv:x0;return Pt(ft,bt)}function R1(ft){var bt=bn(ft)?qv:S0;return bt(ft)}function I1(ft){if(ft==null)return 0;if(Ds(ft))return Ru(ft)?xa(ft):ft.length;var bt=Ss(ft);return bt==xr||bt==Nn?ft.size:Zu(ft).length}function L1(ft,bt,At){var Pt=bn(ft)?Pu:w0;return At&&$s(ft,bt,At)&&(bt=o),Pt(ft,cn(bt,3))}var M1=En(function(ft,bt){if(ft==null)return[];var At=bt.length;return At>1&&$s(ft,bt[0],bt[1])?bt=[]:At>2&&$s(bt[0],bt[1],bt[2])&&(bt=[bt[0]]),mm(ft,ds(bt,1),[])}),Cu=hv||function(){return qr.Date.now()};function P1(ft,bt){if(typeof bt!="function")throw new Qs(ot);return ft=Sn(ft),function(){if(--ft<1)return bt.apply(this,arguments)}}function uy(ft,bt,At){return bt=At?o:bt,bt=ft&&bt==null?ft.length:bt,$o(ft,St,o,o,o,o,bt)}function cy(ft,bt){var At;if(typeof bt!="function")throw new Qs(ot);return ft=Sn(ft),function(){return--ft>0&&(At=bt.apply(this,arguments)),ft<=1&&(bt=o),At}}var wp=En(function(ft,bt,At){var Pt=ct;if(At.length){var jt=No(At,El(wp));Pt|=gt}return $o(ft,Pt,bt,At,jt)}),hy=En(function(ft,bt,At){var Pt=ct|ht;if(At.length){var jt=No(At,El(hy));Pt|=gt}return $o(bt,Pt,ft,At,jt)});function fy(ft,bt,At){bt=At?o:bt;var Pt=$o(ft,pt,o,o,o,o,o,bt);return Pt.placeholder=fy.placeholder,Pt}function dy(ft,bt,At){bt=At?o:bt;var Pt=$o(ft,mt,o,o,o,o,o,bt);return Pt.placeholder=dy.placeholder,Pt}function py(ft,bt,At){var Pt,jt,Jt,ar,ur,yr,Ir=0,Mr=!1,Pr=!1,Kr=!0;if(typeof ft!="function")throw new Qs(ot);bt=ro(bt)||0,Gn(At)&&(Mr=!!At.leading,Pr="maxWait"in At,Jt=Pr?ns(ro(At.maxWait)||0,bt):Jt,Kr="trailing"in At?!!At.trailing:Kr);function en(qn){var co=Pt,Mo=jt;return Pt=jt=o,Ir=qn,ar=ft.apply(Mo,co),ar}function fn(qn){return Ir=qn,ur=Ul(Cn,bt),Mr?en(qn):ar}function _n(qn){var co=qn-yr,Mo=qn-Ir,My=bt-co;return Pr?bs(My,Jt-Mo):My}function dn(qn){var co=qn-yr,Mo=qn-Ir;return yr===o||co>=bt||co<0||Pr&&Mo>=Jt}function Cn(){var qn=Cu();if(dn(qn))return An(qn);ur=Ul(Cn,_n(qn))}function An(qn){return ur=o,Kr&&Pt?en(qn):(Pt=jt=o,ar)}function Ws(){ur!==o&&Em(ur),Ir=0,Pt=yr=jt=ur=o}function As(){return ur===o?ar:An(Cu())}function Hs(){var qn=Cu(),co=dn(qn);if(Pt=arguments,jt=this,yr=qn,co){if(ur===o)return fn(yr);if(Pr)return Em(ur),ur=Ul(Cn,bt),en(yr)}return ur===o&&(ur=Ul(Cn,bt)),ar}return Hs.cancel=Ws,Hs.flush=As,Hs}var D1=En(function(ft,bt){return nm(ft,1,bt)}),O1=En(function(ft,bt,At){return nm(ft,ro(bt)||0,At)});function F1(ft){return $o(ft,yt)}function ku(ft,bt){if(typeof ft!="function"||bt!=null&&typeof bt!="function")throw new Qs(ot);var At=function(){var Pt=arguments,jt=bt?bt.apply(this,Pt):Pt[0],Jt=At.cache;if(Jt.has(jt))return Jt.get(jt);var ar=ft.apply(this,Pt);return At.cache=Jt.set(jt,ar)||Jt,ar};return At.cache=new(ku.Cache||Co),At}ku.Cache=Co;function $u(ft){if(typeof ft!="function")throw new Qs(ot);return function(){var bt=arguments;switch(bt.length){case 0:return!ft.call(this);case 1:return!ft.call(this,bt[0]);case 2:return!ft.call(this,bt[0],bt[1]);case 3:return!ft.call(this,bt[0],bt[1],bt[2])}return!ft.apply(this,bt)}}function N1(ft){return cy(2,ft)}var V1=_0(function(ft,bt){bt=bt.length==1&&bn(bt[0])?Wn(bt[0],zs(cn())):Wn(ds(bt,1),zs(cn()));var At=bt.length;return En(function(Pt){for(var jt=-1,Jt=bs(Pt.length,At);++jt=bt}),Jo=lm(function(){return arguments}())?lm:function(ft){return Kn(ft)&&Fn.call(ft,"callee")&&!Xp.call(ft,"callee")},bn=Tr.isArray,eS=ts?zs(ts):o0;function Ds(ft){return ft!=null&&Au(ft.length)&&!Io(ft)}function Yn(ft){return Kn(ft)&&Ds(ft)}function tS(ft){return ft===!0||ft===!1||Kn(ft)&&ks(ft)==fr}var Wo=dv||Pp,rS=Ms?zs(Ms):a0;function nS(ft){return Kn(ft)&&ft.nodeType===1&&!Wl(ft)}function iS(ft){if(ft==null)return!0;if(Ds(ft)&&(bn(ft)||typeof ft=="string"||typeof ft.splice=="function"||Wo(ft)||Tl(ft)||Jo(ft)))return!ft.length;var bt=Ss(ft);if(bt==xr||bt==Nn)return!ft.size;if(zl(ft))return!Zu(ft).length;for(var At in ft)if(Fn.call(ft,At))return!1;return!0}function sS(ft,bt){return Nl(ft,bt)}function oS(ft,bt,At){At=typeof At=="function"?At:o;var Pt=At?At(ft,bt):o;return Pt===o?Nl(ft,bt,o,At):!!Pt}function Ep(ft){if(!Kn(ft))return!1;var bt=ks(ft);return bt==tr||bt==gr||typeof ft.message=="string"&&typeof ft.name=="string"&&!Wl(ft)}function aS(ft){return typeof ft=="number"&&qp(ft)}function Io(ft){if(!Gn(ft))return!1;var bt=ks(ft);return bt==rr||bt==Qt||bt==hr||bt==on}function gy(ft){return typeof ft=="number"&&ft==Sn(ft)}function Au(ft){return typeof ft=="number"&&ft>-1&&ft%1==0&&ft<=Mt}function Gn(ft){var bt=typeof ft;return ft!=null&&(bt=="object"||bt=="function")}function Kn(ft){return ft!=null&&typeof ft=="object"}var yy=Ys?zs(Ys):u0;function lS(ft,bt){return ft===bt||Qu(ft,bt,pp(bt))}function uS(ft,bt,At){return At=typeof At=="function"?At:o,Qu(ft,bt,pp(bt),At)}function cS(ft){return vy(ft)&&ft!=+ft}function hS(ft){if(G0(ft))throw new xn(et);return um(ft)}function fS(ft){return ft===null}function dS(ft){return ft==null}function vy(ft){return typeof ft=="number"||Kn(ft)&&ks(ft)==Sr}function Wl(ft){if(!Kn(ft)||ks(ft)!=Ur)return!1;var bt=ru(ft);if(bt===null)return!0;var At=Fn.call(bt,"constructor")&&bt.constructor;return typeof At=="function"&&At instanceof At&&Zl.call(At)==av}var Tp=vo?zs(vo):c0;function pS(ft){return gy(ft)&&ft>=-Mt&&ft<=Mt}var xy=$l?zs($l):h0;function Ru(ft){return typeof ft=="string"||!bn(ft)&&Kn(ft)&&ks(ft)==Mn}function Us(ft){return typeof ft=="symbol"||Kn(ft)&&ks(ft)==pn}var Tl=Ho?zs(Ho):f0;function mS(ft){return ft===o}function gS(ft){return Kn(ft)&&Ss(ft)==In}function yS(ft){return Kn(ft)&&ks(ft)==_r}var vS=bu(Ju),xS=bu(function(ft,bt){return ft<=bt});function by(ft){if(!ft)return[];if(Ds(ft))return Ru(ft)?ao(ft):Ps(ft);if(Rl&&ft[Rl])return Yy(ft[Rl]());var bt=Ss(ft),At=bt==xr?Bu:bt==Nn?Xl:Cl;return At(ft)}function Lo(ft){if(!ft)return ft===0?ft:0;if(ft=ro(ft),ft===Ot||ft===-Ot){var bt=ft<0?-1:1;return bt*Dt}return ft===ft?ft:0}function Sn(ft){var bt=Lo(ft),At=bt%1;return bt===bt?At?bt-At:bt:0}function Sy(ft){return ft?Yo(Sn(ft),0,Kt):0}function ro(ft){if(typeof ft=="number")return ft;if(Us(ft))return Bt;if(Gn(ft)){var bt=typeof ft.valueOf=="function"?ft.valueOf():ft;ft=Gn(bt)?bt+"":bt}if(typeof ft!="string")return ft===0?ft:+ft;ft=Bp(ft);var At=so.test(ft);return At||po.test(ft)?Wr(ft.slice(2),At?2:8):ho.test(ft)?Bt:+ft}function wy(ft){return bo(ft,Os(ft))}function bS(ft){return ft?Yo(Sn(ft),-Mt,Mt):ft===0?ft:0}function Dn(ft){return ft==null?"":js(ft)}var SS=wl(function(ft,bt){if(zl(bt)||Ds(bt)){bo(bt,as(bt),ft);return}for(var At in bt)Fn.call(bt,At)&&Dl(ft,At,bt[At])}),_y=wl(function(ft,bt){bo(bt,Os(bt),ft)}),Iu=wl(function(ft,bt,At,Pt){bo(bt,Os(bt),ft,Pt)}),wS=wl(function(ft,bt,At,Pt){bo(bt,as(bt),ft,Pt)}),_S=Ao(Gu);function ES(ft,bt){var At=Sl(ft);return bt==null?At:tm(At,bt)}var TS=En(function(ft,bt){ft=Bn(ft);var At=-1,Pt=bt.length,jt=Pt>2?bt[2]:o;for(jt&&$s(bt[0],bt[1],jt)&&(Pt=1);++At1),Jt}),bo(ft,fp(ft),At),Pt&&(At=Js(At,_|$|tt,P0));for(var jt=bt.length;jt--;)ip(At,bt[jt]);return At});function WS(ft,bt){return Ty(ft,$u(cn(bt)))}var HS=Ao(function(ft,bt){return ft==null?{}:m0(ft,bt)});function Ty(ft,bt){if(ft==null)return{};var At=Wn(fp(ft),function(Pt){return[Pt]});return bt=cn(bt),gm(ft,At,function(Pt,jt){return bt(Pt,jt[0])})}function GS(ft,bt,At){bt=jo(bt,ft);var Pt=-1,jt=bt.length;for(jt||(jt=1,ft=o);++Ptbt){var Pt=ft;ft=bt,bt=Pt}if(At||ft%1||bt%1){var jt=Qp();return bs(ft+jt*(bt-ft+Vr("1e-"+((jt+"").length-1))),bt)}return tp(ft,bt)}var nw=_l(function(ft,bt,At){return bt=bt.toLowerCase(),ft+(At?$y(bt):bt)});function $y(ft){return $p(Dn(ft).toLowerCase())}function Ay(ft){return ft=Dn(ft),ft&&ft.replace(fs,Wy).replace(ln,"")}function iw(ft,bt,At){ft=Dn(ft),bt=js(bt);var Pt=ft.length;At=At===o?Pt:Yo(Sn(At),0,Pt);var jt=At;return At-=bt.length,At>=0&&ft.slice(At,jt)==bt}function sw(ft){return ft=Dn(ft),ft&&Rr.test(ft)?ft.replace(Gr,Hy):ft}function ow(ft){return ft=Dn(ft),ft&&no.test(ft)?ft.replace(ms,"\\$&"):ft}var aw=_l(function(ft,bt,At){return ft+(At?"-":"")+bt.toLowerCase()}),lw=_l(function(ft,bt,At){return ft+(At?" ":"")+bt.toLowerCase()}),uw=Lm("toLowerCase");function cw(ft,bt,At){ft=Dn(ft),bt=Sn(bt);var Pt=bt?xa(ft):0;if(!bt||Pt>=bt)return ft;var jt=(bt-Pt)/2;return xu(ou(jt),At)+ft+xu(su(jt),At)}function hw(ft,bt,At){ft=Dn(ft),bt=Sn(bt);var Pt=bt?xa(ft):0;return bt&&Pt>>0,At?(ft=Dn(ft),ft&&(typeof bt=="string"||bt!=null&&!Tp(bt))&&(bt=js(bt),!bt&&ga(ft))?Uo(ao(ft),0,At):ft.split(bt,At)):[]}var xw=_l(function(ft,bt,At){return ft+(At?" ":"")+$p(bt)});function bw(ft,bt,At){return ft=Dn(ft),At=At==null?0:Yo(Sn(At),0,ft.length),bt=js(bt),ft.slice(At,At+bt.length)==bt}function Sw(ft,bt,At){var Pt=Gt.templateSettings;At&&$s(ft,bt,At)&&(bt=o),ft=Dn(ft),bt=Iu({},bt,Pt,Vm);var jt=Iu({},bt.imports,Pt.imports,Vm),Jt=as(jt),ar=Vu(jt,Jt),ur,yr,Ir=0,Mr=bt.interpolate||_s,Pr="__p += '",Kr=zu((bt.escape||_s).source+"|"+Mr.source+"|"+(Mr===ps?ws:_s).source+"|"+(bt.evaluate||_s).source+"|$","g"),en="//# sourceURL="+(Fn.call(bt,"sourceURL")?(bt.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++yo+"]")+` +`)}function U0(ft){return bn(ft)||Jo(ft)||!!(Yp&&ft&&ft[Yp])}function Ro(ft,bt){var At=typeof ft;return bt=bt??Mt,!!bt&&(At=="number"||At!="symbol"&&oo.test(ft))&&ft>-1&&ft%1==0&&ft0){if(++bt>=Et)return arguments[0]}else bt=0;return ft.apply(o,arguments)}}function _u(ft,bt){var At=-1,Pt=ft.length,jt=Pt-1;for(bt=bt===o?Pt:bt;++At1?ft[bt-1]:o;return At=typeof At=="function"?(ft.pop(),At):o,sy(ft,At)});function oy(ft){var bt=Gt(ft);return bt.__chain__=!0,bt}function r1(ft,bt){return bt(ft),ft}function Eu(ft,bt){return bt(ft)}var n1=Ao(function(ft){var bt=ft.length,At=bt?ft[0]:0,Pt=this.__wrapped__,jt=function(Jt){return Gu(Jt,ft)};return bt>1||this.__actions__.length||!(Pt instanceof $n)||!Ro(At)?this.thru(jt):(Pt=Pt.slice(At,+At+(bt?1:0)),Pt.__actions__.push({func:Eu,args:[jt],thisArg:o}),new Zs(Pt,this.__chain__).thru(function(Jt){return bt&&!Jt.length&&Jt.push(o),Jt}))});function i1(){return oy(this)}function s1(){return new Zs(this.value(),this.__chain__)}function o1(){this.__values__===o&&(this.__values__=by(this.value()));var ft=this.__index__>=this.__values__.length,bt=ft?o:this.__values__[this.__index__++];return{done:ft,value:bt}}function a1(){return this}function l1(ft){for(var bt,At=this;At instanceof uu;){var Pt=Jm(At);Pt.__index__=0,Pt.__values__=o,bt?jt.__wrapped__=Pt:bt=Pt;var jt=Pt;At=At.__wrapped__}return jt.__wrapped__=ft,bt}function u1(){var ft=this.__wrapped__;if(ft instanceof $n){var bt=ft;return this.__actions__.length&&(bt=new $n(this)),bt=bt.reverse(),bt.__actions__.push({func:Eu,args:[bp],thisArg:o}),new Zs(bt,this.__chain__)}return this.thru(bp)}function c1(){return wm(this.__wrapped__,this.__actions__)}var h1=gu(function(ft,bt,At){Fn.call(ft,At)?++ft[At]:ko(ft,At,1)});function f1(ft,bt,At){var Pt=bn(ft)?Dp:e0;return At&&$s(ft,bt,At)&&(bt=o),Pt(ft,cn(bt,3))}function d1(ft,bt){var At=bn(ft)?Oo:sm;return At(ft,cn(bt,3))}var p1=Mm(ey),m1=Mm(ty);function g1(ft,bt){return ds(Tu(ft,bt),1)}function y1(ft,bt){return ds(Tu(ft,bt),Ot)}function v1(ft,bt,At){return At=At===o?1:Sn(At),ds(Tu(ft,bt),At)}function ay(ft,bt){var At=bn(ft)?qs:Bo;return At(ft,cn(bt,3))}function ly(ft,bt){var At=bn(ft)?Dy:im;return At(ft,cn(bt,3))}var x1=gu(function(ft,bt,At){Fn.call(ft,At)?ft[At].push(bt):ko(ft,At,[bt])});function b1(ft,bt,At,Pt){ft=Ds(ft)?ft:Cl(ft),At=At&&!Pt?Sn(At):0;var jt=ft.length;return At<0&&(At=ns(jt+At,0)),Ru(ft)?At<=jt&&ft.indexOf(bt,At)>-1:!!jt&&na(ft,bt,At)>-1}var S1=En(function(ft,bt,At){var Pt=-1,jt=typeof bt=="function",Jt=Ds(ft)?Tr(ft.length):[];return Bo(ft,function(ar){Jt[++Pt]=jt?os(bt,ar,At):Fl(ar,bt,At)}),Jt}),w1=gu(function(ft,bt,At){ko(ft,At,bt)});function Tu(ft,bt){var At=bn(ft)?Wn:hm;return At(ft,cn(bt,3))}function _1(ft,bt,At,Pt){return ft==null?[]:(bn(bt)||(bt=bt==null?[]:[bt]),At=Pt?o:At,bn(At)||(At=At==null?[]:[At]),mm(ft,bt,At))}var E1=gu(function(ft,bt,At){ft[At?0:1].push(bt)},function(){return[[],[]]});function T1(ft,bt,At){var Pt=bn(ft)?Mu:Vp,jt=arguments.length<3;return Pt(ft,cn(bt,4),At,jt,Bo)}function C1(ft,bt,At){var Pt=bn(ft)?Oy:Vp,jt=arguments.length<3;return Pt(ft,cn(bt,4),At,jt,im)}function k1(ft,bt){var At=bn(ft)?Oo:sm;return At(ft,$u(cn(bt,3)))}function $1(ft){var bt=bn(ft)?em:v0;return bt(ft)}function A1(ft,bt,At){(At?$s(ft,bt,At):bt===o)?bt=1:bt=Sn(bt);var Pt=bn(ft)?Yv:x0;return Pt(ft,bt)}function R1(ft){var bt=bn(ft)?qv:S0;return bt(ft)}function I1(ft){if(ft==null)return 0;if(Ds(ft))return Ru(ft)?xa(ft):ft.length;var bt=Ss(ft);return bt==xr||bt==Nn?ft.size:Zu(ft).length}function L1(ft,bt,At){var Pt=bn(ft)?Pu:w0;return At&&$s(ft,bt,At)&&(bt=o),Pt(ft,cn(bt,3))}var M1=En(function(ft,bt){if(ft==null)return[];var At=bt.length;return At>1&&$s(ft,bt[0],bt[1])?bt=[]:At>2&&$s(bt[0],bt[1],bt[2])&&(bt=[bt[0]]),mm(ft,ds(bt,1),[])}),Cu=hv||function(){return qr.Date.now()};function P1(ft,bt){if(typeof bt!="function")throw new Qs(ot);return ft=Sn(ft),function(){if(--ft<1)return bt.apply(this,arguments)}}function uy(ft,bt,At){return bt=At?o:bt,bt=ft&&bt==null?ft.length:bt,$o(ft,St,o,o,o,o,bt)}function cy(ft,bt){var At;if(typeof bt!="function")throw new Qs(ot);return ft=Sn(ft),function(){return--ft>0&&(At=bt.apply(this,arguments)),ft<=1&&(bt=o),At}}var wp=En(function(ft,bt,At){var Pt=ct;if(At.length){var jt=No(At,El(wp));Pt|=gt}return $o(ft,Pt,bt,At,jt)}),hy=En(function(ft,bt,At){var Pt=ct|ht;if(At.length){var jt=No(At,El(hy));Pt|=gt}return $o(bt,Pt,ft,At,jt)});function fy(ft,bt,At){bt=At?o:bt;var Pt=$o(ft,pt,o,o,o,o,o,bt);return Pt.placeholder=fy.placeholder,Pt}function dy(ft,bt,At){bt=At?o:bt;var Pt=$o(ft,mt,o,o,o,o,o,bt);return Pt.placeholder=dy.placeholder,Pt}function py(ft,bt,At){var Pt,jt,Jt,ar,ur,yr,Ir=0,Mr=!1,Pr=!1,Kr=!0;if(typeof ft!="function")throw new Qs(ot);bt=ro(bt)||0,Gn(At)&&(Mr=!!At.leading,Pr="maxWait"in At,Jt=Pr?ns(ro(At.maxWait)||0,bt):Jt,Kr="trailing"in At?!!At.trailing:Kr);function en(qn){var co=Pt,Mo=jt;return Pt=jt=o,Ir=qn,ar=ft.apply(Mo,co),ar}function fn(qn){return Ir=qn,ur=Ul(Cn,bt),Mr?en(qn):ar}function _n(qn){var co=qn-yr,Mo=qn-Ir,My=bt-co;return Pr?bs(My,Jt-Mo):My}function dn(qn){var co=qn-yr,Mo=qn-Ir;return yr===o||co>=bt||co<0||Pr&&Mo>=Jt}function Cn(){var qn=Cu();if(dn(qn))return An(qn);ur=Ul(Cn,_n(qn))}function An(qn){return ur=o,Kr&&Pt?en(qn):(Pt=jt=o,ar)}function Ws(){ur!==o&&Em(ur),Ir=0,Pt=yr=jt=ur=o}function As(){return ur===o?ar:An(Cu())}function Hs(){var qn=Cu(),co=dn(qn);if(Pt=arguments,jt=this,yr=qn,co){if(ur===o)return fn(yr);if(Pr)return Em(ur),ur=Ul(Cn,bt),en(yr)}return ur===o&&(ur=Ul(Cn,bt)),ar}return Hs.cancel=Ws,Hs.flush=As,Hs}var D1=En(function(ft,bt){return nm(ft,1,bt)}),O1=En(function(ft,bt,At){return nm(ft,ro(bt)||0,At)});function F1(ft){return $o(ft,yt)}function ku(ft,bt){if(typeof ft!="function"||bt!=null&&typeof bt!="function")throw new Qs(ot);var At=function(){var Pt=arguments,jt=bt?bt.apply(this,Pt):Pt[0],Jt=At.cache;if(Jt.has(jt))return Jt.get(jt);var ar=ft.apply(this,Pt);return At.cache=Jt.set(jt,ar)||Jt,ar};return At.cache=new(ku.Cache||Co),At}ku.Cache=Co;function $u(ft){if(typeof ft!="function")throw new Qs(ot);return function(){var bt=arguments;switch(bt.length){case 0:return!ft.call(this);case 1:return!ft.call(this,bt[0]);case 2:return!ft.call(this,bt[0],bt[1]);case 3:return!ft.call(this,bt[0],bt[1],bt[2])}return!ft.apply(this,bt)}}function N1(ft){return cy(2,ft)}var V1=_0(function(ft,bt){bt=bt.length==1&&bn(bt[0])?Wn(bt[0],zs(cn())):Wn(ds(bt,1),zs(cn()));var At=bt.length;return En(function(Pt){for(var jt=-1,Jt=bs(Pt.length,At);++jt=bt}),Jo=lm(function(){return arguments}())?lm:function(ft){return Kn(ft)&&Fn.call(ft,"callee")&&!Xp.call(ft,"callee")},bn=Tr.isArray,eS=ts?zs(ts):o0;function Ds(ft){return ft!=null&&Au(ft.length)&&!Io(ft)}function Yn(ft){return Kn(ft)&&Ds(ft)}function tS(ft){return ft===!0||ft===!1||Kn(ft)&&ks(ft)==fr}var Wo=dv||Pp,rS=Ms?zs(Ms):a0;function nS(ft){return Kn(ft)&&ft.nodeType===1&&!Wl(ft)}function iS(ft){if(ft==null)return!0;if(Ds(ft)&&(bn(ft)||typeof ft=="string"||typeof ft.splice=="function"||Wo(ft)||Tl(ft)||Jo(ft)))return!ft.length;var bt=Ss(ft);if(bt==xr||bt==Nn)return!ft.size;if(zl(ft))return!Zu(ft).length;for(var At in ft)if(Fn.call(ft,At))return!1;return!0}function sS(ft,bt){return Nl(ft,bt)}function oS(ft,bt,At){At=typeof At=="function"?At:o;var Pt=At?At(ft,bt):o;return Pt===o?Nl(ft,bt,o,At):!!Pt}function Ep(ft){if(!Kn(ft))return!1;var bt=ks(ft);return bt==tr||bt==gr||typeof ft.message=="string"&&typeof ft.name=="string"&&!Wl(ft)}function aS(ft){return typeof ft=="number"&&qp(ft)}function Io(ft){if(!Gn(ft))return!1;var bt=ks(ft);return bt==rr||bt==Qt||bt==hr||bt==on}function gy(ft){return typeof ft=="number"&&ft==Sn(ft)}function Au(ft){return typeof ft=="number"&&ft>-1&&ft%1==0&&ft<=Mt}function Gn(ft){var bt=typeof ft;return ft!=null&&(bt=="object"||bt=="function")}function Kn(ft){return ft!=null&&typeof ft=="object"}var yy=Ys?zs(Ys):u0;function lS(ft,bt){return ft===bt||Qu(ft,bt,pp(bt))}function uS(ft,bt,At){return At=typeof At=="function"?At:o,Qu(ft,bt,pp(bt),At)}function cS(ft){return vy(ft)&&ft!=+ft}function hS(ft){if(G0(ft))throw new xn(tt);return um(ft)}function fS(ft){return ft===null}function dS(ft){return ft==null}function vy(ft){return typeof ft=="number"||Kn(ft)&&ks(ft)==Sr}function Wl(ft){if(!Kn(ft)||ks(ft)!=Ur)return!1;var bt=ru(ft);if(bt===null)return!0;var At=Fn.call(bt,"constructor")&&bt.constructor;return typeof At=="function"&&At instanceof At&&Zl.call(At)==av}var Tp=vo?zs(vo):c0;function pS(ft){return gy(ft)&&ft>=-Mt&&ft<=Mt}var xy=$l?zs($l):h0;function Ru(ft){return typeof ft=="string"||!bn(ft)&&Kn(ft)&&ks(ft)==Mn}function Us(ft){return typeof ft=="symbol"||Kn(ft)&&ks(ft)==pn}var Tl=Ho?zs(Ho):f0;function mS(ft){return ft===o}function gS(ft){return Kn(ft)&&Ss(ft)==In}function yS(ft){return Kn(ft)&&ks(ft)==_r}var vS=bu(Ju),xS=bu(function(ft,bt){return ft<=bt});function by(ft){if(!ft)return[];if(Ds(ft))return Ru(ft)?ao(ft):Ps(ft);if(Rl&&ft[Rl])return Yy(ft[Rl]());var bt=Ss(ft),At=bt==xr?Bu:bt==Nn?Xl:Cl;return At(ft)}function Lo(ft){if(!ft)return ft===0?ft:0;if(ft=ro(ft),ft===Ot||ft===-Ot){var bt=ft<0?-1:1;return bt*Dt}return ft===ft?ft:0}function Sn(ft){var bt=Lo(ft),At=bt%1;return bt===bt?At?bt-At:bt:0}function Sy(ft){return ft?Yo(Sn(ft),0,Kt):0}function ro(ft){if(typeof ft=="number")return ft;if(Us(ft))return Bt;if(Gn(ft)){var bt=typeof ft.valueOf=="function"?ft.valueOf():ft;ft=Gn(bt)?bt+"":bt}if(typeof ft!="string")return ft===0?ft:+ft;ft=Bp(ft);var At=so.test(ft);return At||po.test(ft)?Wr(ft.slice(2),At?2:8):ho.test(ft)?Bt:+ft}function wy(ft){return bo(ft,Os(ft))}function bS(ft){return ft?Yo(Sn(ft),-Mt,Mt):ft===0?ft:0}function Dn(ft){return ft==null?"":js(ft)}var SS=wl(function(ft,bt){if(zl(bt)||Ds(bt)){bo(bt,as(bt),ft);return}for(var At in bt)Fn.call(bt,At)&&Dl(ft,At,bt[At])}),_y=wl(function(ft,bt){bo(bt,Os(bt),ft)}),Iu=wl(function(ft,bt,At,Pt){bo(bt,Os(bt),ft,Pt)}),wS=wl(function(ft,bt,At,Pt){bo(bt,as(bt),ft,Pt)}),_S=Ao(Gu);function ES(ft,bt){var At=Sl(ft);return bt==null?At:tm(At,bt)}var TS=En(function(ft,bt){ft=Bn(ft);var At=-1,Pt=bt.length,jt=Pt>2?bt[2]:o;for(jt&&$s(bt[0],bt[1],jt)&&(Pt=1);++At1),Jt}),bo(ft,fp(ft),At),Pt&&(At=Js(At,_|$|et,P0));for(var jt=bt.length;jt--;)ip(At,bt[jt]);return At});function WS(ft,bt){return Ty(ft,$u(cn(bt)))}var HS=Ao(function(ft,bt){return ft==null?{}:m0(ft,bt)});function Ty(ft,bt){if(ft==null)return{};var At=Wn(fp(ft),function(Pt){return[Pt]});return bt=cn(bt),gm(ft,At,function(Pt,jt){return bt(Pt,jt[0])})}function GS(ft,bt,At){bt=jo(bt,ft);var Pt=-1,jt=bt.length;for(jt||(jt=1,ft=o);++Ptbt){var Pt=ft;ft=bt,bt=Pt}if(At||ft%1||bt%1){var jt=Qp();return bs(ft+jt*(bt-ft+Vr("1e-"+((jt+"").length-1))),bt)}return tp(ft,bt)}var nw=_l(function(ft,bt,At){return bt=bt.toLowerCase(),ft+(At?$y(bt):bt)});function $y(ft){return $p(Dn(ft).toLowerCase())}function Ay(ft){return ft=Dn(ft),ft&&ft.replace(fs,Wy).replace(ln,"")}function iw(ft,bt,At){ft=Dn(ft),bt=js(bt);var Pt=ft.length;At=At===o?Pt:Yo(Sn(At),0,Pt);var jt=At;return At-=bt.length,At>=0&&ft.slice(At,jt)==bt}function sw(ft){return ft=Dn(ft),ft&&Rr.test(ft)?ft.replace(Gr,Hy):ft}function ow(ft){return ft=Dn(ft),ft&&no.test(ft)?ft.replace(ms,"\\$&"):ft}var aw=_l(function(ft,bt,At){return ft+(At?"-":"")+bt.toLowerCase()}),lw=_l(function(ft,bt,At){return ft+(At?" ":"")+bt.toLowerCase()}),uw=Lm("toLowerCase");function cw(ft,bt,At){ft=Dn(ft),bt=Sn(bt);var Pt=bt?xa(ft):0;if(!bt||Pt>=bt)return ft;var jt=(bt-Pt)/2;return xu(ou(jt),At)+ft+xu(su(jt),At)}function hw(ft,bt,At){ft=Dn(ft),bt=Sn(bt);var Pt=bt?xa(ft):0;return bt&&Pt>>0,At?(ft=Dn(ft),ft&&(typeof bt=="string"||bt!=null&&!Tp(bt))&&(bt=js(bt),!bt&&ga(ft))?Uo(ao(ft),0,At):ft.split(bt,At)):[]}var xw=_l(function(ft,bt,At){return ft+(At?" ":"")+$p(bt)});function bw(ft,bt,At){return ft=Dn(ft),At=At==null?0:Yo(Sn(At),0,ft.length),bt=js(bt),ft.slice(At,At+bt.length)==bt}function Sw(ft,bt,At){var Pt=Gt.templateSettings;At&&$s(ft,bt,At)&&(bt=o),ft=Dn(ft),bt=Iu({},bt,Pt,Vm);var jt=Iu({},bt.imports,Pt.imports,Vm),Jt=as(jt),ar=Vu(jt,Jt),ur,yr,Ir=0,Mr=bt.interpolate||_s,Pr="__p += '",Kr=zu((bt.escape||_s).source+"|"+Mr.source+"|"+(Mr===ps?ws:_s).source+"|"+(bt.evaluate||_s).source+"|$","g"),en="//# sourceURL="+(Fn.call(bt,"sourceURL")?(bt.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++yo+"]")+` `;ft.replace(Kr,function(dn,Cn,An,Ws,As,Hs){return An||(An=Ws),Pr+=ft.slice(Ir,Hs).replace(Is,Gy),Cn&&(ur=!0,Pr+=`' + __e(`+Cn+`) + '`),As&&(yr=!0,Pr+=`'; @@ -3183,27 +3183,27 @@ __p += '`),An&&(Pr+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+Pr+`return __p -}`;var _n=Iy(function(){return Pn(Jt,en+"return "+Pr).apply(o,ar)});if(_n.source=Pr,Ep(_n))throw _n;return _n}function ww(ft){return Dn(ft).toLowerCase()}function _w(ft){return Dn(ft).toUpperCase()}function Ew(ft,bt,At){if(ft=Dn(ft),ft&&(At||bt===o))return Bp(ft);if(!ft||!(bt=js(bt)))return ft;var Pt=ao(ft),jt=ao(bt),Jt=zp(Pt,jt),ar=jp(Pt,jt)+1;return Uo(Pt,Jt,ar).join("")}function Tw(ft,bt,At){if(ft=Dn(ft),ft&&(At||bt===o))return ft.slice(0,Wp(ft)+1);if(!ft||!(bt=js(bt)))return ft;var Pt=ao(ft),jt=jp(Pt,ao(bt))+1;return Uo(Pt,0,jt).join("")}function Cw(ft,bt,At){if(ft=Dn(ft),ft&&(At||bt===o))return ft.replace(Vs,"");if(!ft||!(bt=js(bt)))return ft;var Pt=ao(ft),jt=zp(Pt,ao(bt));return Uo(Pt,jt).join("")}function kw(ft,bt){var At=_t,Pt=Ct;if(Gn(bt)){var jt="separator"in bt?bt.separator:jt;At="length"in bt?Sn(bt.length):At,Pt="omission"in bt?js(bt.omission):Pt}ft=Dn(ft);var Jt=ft.length;if(ga(ft)){var ar=ao(ft);Jt=ar.length}if(At>=Jt)return ft;var ur=At-xa(Pt);if(ur<1)return Pt;var yr=ar?Uo(ar,0,ur).join(""):ft.slice(0,ur);if(jt===o)return yr+Pt;if(ar&&(ur+=yr.length-ur),Tp(jt)){if(ft.slice(ur).search(jt)){var Ir,Mr=yr;for(jt.global||(jt=zu(jt.source,Dn(Zn.exec(jt))+"g")),jt.lastIndex=0;Ir=jt.exec(Mr);)var Pr=Ir.index;yr=yr.slice(0,Pr===o?ur:Pr)}}else if(ft.indexOf(js(jt),ur)!=ur){var Kr=yr.lastIndexOf(jt);Kr>-1&&(yr=yr.slice(0,Kr))}return yr+Pt}function $w(ft){return ft=Dn(ft),ft&&an.test(ft)?ft.replace(jr,Jy):ft}var Aw=_l(function(ft,bt,At){return ft+(At?" ":"")+bt.toUpperCase()}),$p=Lm("toUpperCase");function Ry(ft,bt,At){return ft=Dn(ft),bt=At?o:bt,bt===o?Xy(ft)?rv(ft):Vy(ft):ft.match(bt)||[]}var Iy=En(function(ft,bt){try{return os(ft,o,bt)}catch(At){return Ep(At)?At:new xn(At)}}),Rw=Ao(function(ft,bt){return qs(bt,function(At){At=So(At),ko(ft,At,wp(ft[At],ft))}),ft});function Iw(ft){var bt=ft==null?0:ft.length,At=cn();return ft=bt?Wn(ft,function(Pt){if(typeof Pt[1]!="function")throw new Qs(ot);return[At(Pt[0]),Pt[1]]}):[],En(function(Pt){for(var jt=-1;++jtMt)return[];var At=Kt,Pt=bs(ft,Kt);bt=cn(bt),ft-=Kt;for(var jt=Nu(Pt,bt);++At0||bt<0)?new $n(At):(ft<0?At=At.takeRight(-ft):ft&&(At=At.drop(ft)),bt!==o&&(bt=Sn(bt),At=bt<0?At.dropRight(-bt):At.take(bt-ft)),At)},$n.prototype.takeRightWhile=function(ft){return this.reverse().takeWhile(ft).reverse()},$n.prototype.toArray=function(){return this.take(Kt)},xo($n.prototype,function(ft,bt){var At=/^(?:filter|find|map|reject)|While$/.test(bt),Pt=/^(?:head|last)$/.test(bt),jt=Gt[Pt?"take"+(bt=="last"?"Right":""):bt],Jt=Pt||/^find/.test(bt);jt&&(Gt.prototype[bt]=function(){var ar=this.__wrapped__,ur=Pt?[1]:arguments,yr=ar instanceof $n,Ir=ur[0],Mr=yr||bn(ar),Pr=function(Cn){var An=jt.apply(Gt,Fo([Cn],ur));return Pt&&Kr?An[0]:An};Mr&&At&&typeof Ir=="function"&&Ir.length!=1&&(yr=Mr=!1);var Kr=this.__chain__,en=!!this.__actions__.length,fn=Jt&&!Kr,_n=yr&&!en;if(!Jt&&Mr){ar=_n?ar:new $n(this);var dn=ft.apply(ar,ur);return dn.__actions__.push({func:Eu,args:[Pr],thisArg:o}),new Zs(dn,Kr)}return fn&&_n?ft.apply(this,ur):(dn=this.thru(Pr),fn?Pt?dn.value()[0]:dn.value():dn)})}),qs(["pop","push","shift","sort","splice","unshift"],function(ft){var bt=Yl[ft],At=/^(?:push|sort|unshift)$/.test(ft)?"tap":"thru",Pt=/^(?:pop|shift)$/.test(ft);Gt.prototype[ft]=function(){var jt=arguments;if(Pt&&!this.__chain__){var Jt=this.value();return bt.apply(bn(Jt)?Jt:[],jt)}return this[At](function(ar){return bt.apply(bn(ar)?ar:[],jt)})}}),xo($n.prototype,function(ft,bt){var At=Gt[bt];if(At){var Pt=At.name+"";Fn.call(xl,Pt)||(xl[Pt]=[]),xl[Pt].push({name:bt,func:At})}}),xl[yu(o,ht).name]=[{name:"wrapper",func:o}],$n.prototype.clone=Ev,$n.prototype.reverse=Tv,$n.prototype.value=Cv,Gt.prototype.at=n1,Gt.prototype.chain=i1,Gt.prototype.commit=s1,Gt.prototype.next=o1,Gt.prototype.plant=l1,Gt.prototype.reverse=u1,Gt.prototype.toJSON=Gt.prototype.valueOf=Gt.prototype.value=c1,Gt.prototype.first=Gt.prototype.head,Rl&&(Gt.prototype[Rl]=a1),Gt},ba=nv();Ln?((Ln.exports=ba)._=ba,un._=ba):qr._=ba}).call(commonjsGlobal)})(lodash,lodash.exports);var lodashExports=lodash.exports,moduleLoader={},xmlhttprequestTs_umd={exports:{}};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$6=getAugmentedNamespace(__viteBrowserExternal$1);(function(i,s){(function(o,a){a(s,require$$6,require$$6,require$$6,require$$6,require$$6,require$$6,require$$6)})(commonjsGlobal,function(o,a,rt,et,ot,at,nt,it){/** +}`;var _n=Iy(function(){return Pn(Jt,en+"return "+Pr).apply(o,ar)});if(_n.source=Pr,Ep(_n))throw _n;return _n}function ww(ft){return Dn(ft).toLowerCase()}function _w(ft){return Dn(ft).toUpperCase()}function Ew(ft,bt,At){if(ft=Dn(ft),ft&&(At||bt===o))return Bp(ft);if(!ft||!(bt=js(bt)))return ft;var Pt=ao(ft),jt=ao(bt),Jt=zp(Pt,jt),ar=jp(Pt,jt)+1;return Uo(Pt,Jt,ar).join("")}function Tw(ft,bt,At){if(ft=Dn(ft),ft&&(At||bt===o))return ft.slice(0,Wp(ft)+1);if(!ft||!(bt=js(bt)))return ft;var Pt=ao(ft),jt=jp(Pt,ao(bt))+1;return Uo(Pt,0,jt).join("")}function Cw(ft,bt,At){if(ft=Dn(ft),ft&&(At||bt===o))return ft.replace(Vs,"");if(!ft||!(bt=js(bt)))return ft;var Pt=ao(ft),jt=zp(Pt,ao(bt));return Uo(Pt,jt).join("")}function kw(ft,bt){var At=_t,Pt=Ct;if(Gn(bt)){var jt="separator"in bt?bt.separator:jt;At="length"in bt?Sn(bt.length):At,Pt="omission"in bt?js(bt.omission):Pt}ft=Dn(ft);var Jt=ft.length;if(ga(ft)){var ar=ao(ft);Jt=ar.length}if(At>=Jt)return ft;var ur=At-xa(Pt);if(ur<1)return Pt;var yr=ar?Uo(ar,0,ur).join(""):ft.slice(0,ur);if(jt===o)return yr+Pt;if(ar&&(ur+=yr.length-ur),Tp(jt)){if(ft.slice(ur).search(jt)){var Ir,Mr=yr;for(jt.global||(jt=zu(jt.source,Dn(Zn.exec(jt))+"g")),jt.lastIndex=0;Ir=jt.exec(Mr);)var Pr=Ir.index;yr=yr.slice(0,Pr===o?ur:Pr)}}else if(ft.indexOf(js(jt),ur)!=ur){var Kr=yr.lastIndexOf(jt);Kr>-1&&(yr=yr.slice(0,Kr))}return yr+Pt}function $w(ft){return ft=Dn(ft),ft&&an.test(ft)?ft.replace(jr,Jy):ft}var Aw=_l(function(ft,bt,At){return ft+(At?" ":"")+bt.toUpperCase()}),$p=Lm("toUpperCase");function Ry(ft,bt,At){return ft=Dn(ft),bt=At?o:bt,bt===o?Xy(ft)?rv(ft):Vy(ft):ft.match(bt)||[]}var Iy=En(function(ft,bt){try{return os(ft,o,bt)}catch(At){return Ep(At)?At:new xn(At)}}),Rw=Ao(function(ft,bt){return qs(bt,function(At){At=So(At),ko(ft,At,wp(ft[At],ft))}),ft});function Iw(ft){var bt=ft==null?0:ft.length,At=cn();return ft=bt?Wn(ft,function(Pt){if(typeof Pt[1]!="function")throw new Qs(ot);return[At(Pt[0]),Pt[1]]}):[],En(function(Pt){for(var jt=-1;++jtMt)return[];var At=Kt,Pt=bs(ft,Kt);bt=cn(bt),ft-=Kt;for(var jt=Nu(Pt,bt);++At0||bt<0)?new $n(At):(ft<0?At=At.takeRight(-ft):ft&&(At=At.drop(ft)),bt!==o&&(bt=Sn(bt),At=bt<0?At.dropRight(-bt):At.take(bt-ft)),At)},$n.prototype.takeRightWhile=function(ft){return this.reverse().takeWhile(ft).reverse()},$n.prototype.toArray=function(){return this.take(Kt)},xo($n.prototype,function(ft,bt){var At=/^(?:filter|find|map|reject)|While$/.test(bt),Pt=/^(?:head|last)$/.test(bt),jt=Gt[Pt?"take"+(bt=="last"?"Right":""):bt],Jt=Pt||/^find/.test(bt);jt&&(Gt.prototype[bt]=function(){var ar=this.__wrapped__,ur=Pt?[1]:arguments,yr=ar instanceof $n,Ir=ur[0],Mr=yr||bn(ar),Pr=function(Cn){var An=jt.apply(Gt,Fo([Cn],ur));return Pt&&Kr?An[0]:An};Mr&&At&&typeof Ir=="function"&&Ir.length!=1&&(yr=Mr=!1);var Kr=this.__chain__,en=!!this.__actions__.length,fn=Jt&&!Kr,_n=yr&&!en;if(!Jt&&Mr){ar=_n?ar:new $n(this);var dn=ft.apply(ar,ur);return dn.__actions__.push({func:Eu,args:[Pr],thisArg:o}),new Zs(dn,Kr)}return fn&&_n?ft.apply(this,ur):(dn=this.thru(Pr),fn?Pt?dn.value()[0]:dn.value():dn)})}),qs(["pop","push","shift","sort","splice","unshift"],function(ft){var bt=Yl[ft],At=/^(?:push|sort|unshift)$/.test(ft)?"tap":"thru",Pt=/^(?:pop|shift)$/.test(ft);Gt.prototype[ft]=function(){var jt=arguments;if(Pt&&!this.__chain__){var Jt=this.value();return bt.apply(bn(Jt)?Jt:[],jt)}return this[At](function(ar){return bt.apply(bn(ar)?ar:[],jt)})}}),xo($n.prototype,function(ft,bt){var At=Gt[bt];if(At){var Pt=At.name+"";Fn.call(xl,Pt)||(xl[Pt]=[]),xl[Pt].push({name:bt,func:At})}}),xl[yu(o,ht).name]=[{name:"wrapper",func:o}],$n.prototype.clone=Ev,$n.prototype.reverse=Tv,$n.prototype.value=Cv,Gt.prototype.at=n1,Gt.prototype.chain=i1,Gt.prototype.commit=s1,Gt.prototype.next=o1,Gt.prototype.plant=l1,Gt.prototype.reverse=u1,Gt.prototype.toJSON=Gt.prototype.valueOf=Gt.prototype.value=c1,Gt.prototype.first=Gt.prototype.head,Rl&&(Gt.prototype[Rl]=a1),Gt},ba=nv();Ln?((Ln.exports=ba)._=ba,un._=ba):qr._=ba}).call(commonjsGlobal)})(lodash,lodash.exports);var lodashExports=lodash.exports,moduleLoader={},xmlhttprequestTs_umd={exports:{}};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$6=getAugmentedNamespace(__viteBrowserExternal$1);(function(i,s){(function(o,a){a(s,require$$6,require$$6,require$$6,require$$6,require$$6,require$$6,require$$6)})(commonjsGlobal,function(o,a,rt,tt,ot,at,nt,it){/** * @license xmlhttprequest-ts * MIT license - */var j=function(){function _(){this.UNSENT=_.UNSENT,this.OPENED=_.OPENED,this.HEADERS_RECEIVED=_.HEADERS_RECEIVED,this.LOADING=_.LOADING,this.DONE=_.DONE,this.disableHeaderCheck=!1,this.readyState=_.UNSENT,this.responseText="",this.responseXML=null,this.status=0,this.statusText="",this.timeout=0,this.withCredentials=!1,this.defaultHeaders={"User-Agent":"ts-XMLHttpRequest",Accept:"*/*"},this.errorFlag=!1,this.forbiddenRequestHeaders=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","content-transfer-encoding","cookie","cookie2","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"],this.forbiddenRequestMethods=["TRACE","TRACK","CONNECT"],this.headers={},this.headersLowerCase={},this.listeners={},this.sendFlag=!1}return _.prototype.open=function($,tt,st,lt,ct){if(st===void 0&&(st=!0),this.abort(),this.errorFlag=!1,!this.isAllowedHttpMethod($))throw new Error("SecurityError: Request method not allowed");this.settings={method:$,url:tt,async:typeof st!="boolean"?!0:st,user:lt,password:ct},this.setState(this.OPENED)},_.prototype.setDisableHeaderCheck=function($){this.disableHeaderCheck=$},_.prototype.setRequestHeader=function($,tt){if(this.readyState!==this.OPENED)throw new Error("INVALID_STATE_ERR: setRequestHeader can only be called when state is OPEN");if(!this.isAllowedHttpHeader($)){console.warn('Refused to set unsafe header "'+$+'"');return}if(this.sendFlag)throw new Error("INVALID_STATE_ERR: send flag is true");$=this.headersLowerCase[$.toLowerCase()]||$,this.headersLowerCase[$.toLowerCase()]=$,this.headers[$]=this.headers[$]?this.headers[$]+", "+tt:tt},_.prototype.getAllResponseHeaders=function(){if(this.readyStatethis.OPENED&&this.response&&this.response.headers&&this.response.headers[$.toLowerCase()]&&!this.errorFlag){var tt=this.response.headers[$.toLowerCase()];if(typeof tt=="string")return tt;if(Array.isArray(tt))return tt.join(", ")}return null},_.prototype.getRequestHeader=function($){if(typeof $=="string"&&this.headersLowerCase[$.toLowerCase()])return this.headers[this.headersLowerCase[$.toLowerCase()]]},_.prototype.send=function($){var tt=this,st=this;if(this.settings===void 0)throw new Error("INVALID_STATE_ERR: connection must be opened before send() is called");if(this.readyState!==this.OPENED)throw new Error("INVALID_STATE_ERR: connection must be opened before send() is called");if(this.sendFlag)throw new Error("INVALID_STATE_ERR: send has already been called");var lt=!1,ct=!1,ht=ot.parse(this.settings.url),ut;switch(ht.protocol){case"https:":lt=!0;case"http:":ut=ht.hostname;break;case"file:":ct=!0;break;case void 0:case null:case"":ut="localhost";break;default:throw new Error("Protocol not supported.")}if(ct){if(this.settings.method!=="GET")throw new Error("XMLHttpRequest: Only GET method is supported");if(this.settings.async)a.readFile(unescape(ht.pathname||"/"),"utf8",function(Mt,Dt){Mt?st.handleError(Mt):(st.status=200,st.responseText=Dt,st.setState(st.DONE))});else try{this.responseText=a.readFileSync(unescape(ht.pathname||"/"),"utf8"),this.status=200,this.setState(st.DONE)}catch(Mt){this.handleError(Mt)}return}var pt=ht.port||(lt?443:80),mt=ht.pathname+(ht.search?ht.search:"");for(var gt in this.defaultHeaders)this.headersLowerCase[gt.toLowerCase()]||(this.headers[gt]=this.defaultHeaders[gt]);if(ut&&(this.headers.Host=ut),ht.host&&ht.host[0]==="["&&(this.headers.Host="["+this.headers.Host+"]"),lt&&pt===443||pt===80||(this.headers.Host+=":"+ht.port),this.settings.user){typeof this.settings.password>"u"&&(this.settings.password="");var dt=Buffer.from(this.settings.user+":"+this.settings.password);this.headers.Authorization="Basic "+dt.toString("base64")}this.settings.method==="GET"||this.settings.method==="HEAD"?$=null:$?(this.headers["Content-Length"]=""+(Buffer.isBuffer($)?$.length:Buffer.byteLength($)),this.getRequestHeader("Content-Type")||(this.headers["Content-Type"]="text/plain;charset=UTF-8")):this.settings.method==="POST"&&(this.headers["Content-Length"]="0");var St={host:ut,port:pt,path:mt,method:this.settings.method,headers:this.headers,agent:!1,withCredentials:this.withCredentials};if(this.errorFlag=!1,this.settings.async){this.timeout>=1&&(this.timeoutTimer=setTimeout(function(){tt.readyState!==tt.DONE&&st.handleTimeout(new Error("request timed out after "+tt.timeout+"ms"))},this.timeout));var xt=lt?et.request:rt.request;this.sendFlag=!0,st.dispatchEvent("readystatechange");var yt=function(Mt){st.handleError(Mt)},_t=0,Ct=function(Mt){if(st.response=Mt,st.settings===void 0)throw new Error("INVALID_STATE_ERR: connection must be opened before send() is called");if(st.response.headers.location&&(st.response.statusCode===301||st.response.statusCode===302||st.response.statusCode===303||st.response.statusCode===307)){if(_t++,_t>=10)throw new Error("XMLHttpRequest: Request failed - too many redirects");st.settings.url=st.response.headers.location;var Dt=ot.parse(st.settings.url);ut=Dt.hostname,ut&&(st.headers.Host=ut);var Bt={hostname:Dt.hostname,port:Dt.port,path:Dt.path,method:st.response.statusCode===303?"GET":st.settings.method,headers:st.headers,withCredentials:st.withCredentials};lt=ht.protocol==="https:",xt=lt?et.request:rt.request,st.request=xt(Bt,Ct).on("error",yt),st.request.end();return}st.response.setEncoding("utf8"),st.setState(st.HEADERS_RECEIVED),st.status=st.response.statusCode||0,st.response.on("data",function(Kt){Kt&&(st.responseText+=Kt),st.sendFlag&&st.setState(st.LOADING)}),st.response.on("end",function(){st.sendFlag&&(st.setState(st.DONE),st.sendFlag=!1)}),st.response.on("error",function(Kt){st.handleError(Kt)})};st.request=xt(St,Ct).on("error",yt),$&&st.request.write($),st.request.end(),st.dispatchEvent("loadstart")}else{var Et=new Date().getTime(),kt=at.tmpdir()+nt.sep+"ts-xmlhttprequest-content-"+process.pid,Tt=at.tmpdir()+nt.sep+"ts-xmlhttprequest-sync-"+process.pid;a.writeFileSync(Tt,"","utf8");var $t="let http = require('http'), https = require('https'), fs = require('fs');let doRequest = http"+(lt?"s":"")+".request;let options = "+JSON.stringify(St)+";let responseText = '';let req = doRequest(options, function(response) {response.setEncoding('utf8');response.on('data', function(chunk) { responseText += chunk;});response.on('end', function() {fs.writeFileSync( '"+kt+"', JSON.stringify({ err: null, data: {statusCode: response.statusCode, headers: response.headers, text: responseText} }), 'utf8');fs.unlinkSync('"+Tt+"');});response.on('error', function(error) {fs.writeFileSync('"+kt+"', JSON.stringify({err: error}), 'utf8');fs.unlinkSync('"+Tt+"');});}).on('error', function(error) {fs.writeFileSync('"+kt+"', JSON.stringify({err: error}), 'utf8');fs.unlinkSync('"+Tt+"');});"+($?"req.write('"+JSON.stringify($).slice(1,-1).replace(/'/g,"\\'")+"');":"")+"req.end();";st.dispatchEvent("loadstart"),this.setState(st.LOADING);var It=it.spawn(process.argv[0],["-e",$t]);for(It.on("exit",function(Mt,Dt){try{a.unlinkSync(Tt)}catch{}try{a.unlinkSync(kt)}catch{}});a.existsSync(Tt);)if(this.timeout!==0&&new Date().getTime()>=Et+this.timeout)return It.stdin.end(),It.kill(),st.handleTimeout(new Error("request timed out after "+this.timeout+"ms"));It.stdin.end(),It.kill();var Ot=JSON.parse(a.readFileSync(kt,"utf8"));a.unlinkSync(kt),Ot.err?st.handleError(Ot.err):(st.response=Ot.data,st.status=Ot.data.statusCode,st.responseText=Ot.data.text,st.setState(st.DONE))}},_.prototype.abort=function(){this.request&&(this.request.abort(),this.request=void 0),this.headers={},this.status=0,this.responseText="",this.responseXML=null,this.errorFlag=!0,this.readyState!==this.UNSENT&&(this.readyState!==this.OPENED||this.sendFlag)&&this.readyState!==this.DONE&&(this.sendFlag=!1,this.setState(this.DONE)),this.readyState=this.UNSENT,this.dispatchEvent("abort")},_.prototype.addEventListener=function($,tt){$ in this.listeners||(this.listeners[$]=[]),this.listeners[$].push(tt)},_.prototype.removeEventListener=function($,tt){$ in this.listeners&&(this.listeners[$]=this.listeners[$].filter(function(st){return st!==tt}))},_.prototype.dispatchEvent=function($,tt){var st="on"+$;if(typeof this[st]=="function"&&this[st](tt),$ in this.listeners)for(var lt=0,ct=this.listeners[$].length;ltthis.OPENED&&this.response&&this.response.headers&&this.response.headers[$.toLowerCase()]&&!this.errorFlag){var et=this.response.headers[$.toLowerCase()];if(typeof et=="string")return et;if(Array.isArray(et))return et.join(", ")}return null},_.prototype.getRequestHeader=function($){if(typeof $=="string"&&this.headersLowerCase[$.toLowerCase()])return this.headers[this.headersLowerCase[$.toLowerCase()]]},_.prototype.send=function($){var et=this,st=this;if(this.settings===void 0)throw new Error("INVALID_STATE_ERR: connection must be opened before send() is called");if(this.readyState!==this.OPENED)throw new Error("INVALID_STATE_ERR: connection must be opened before send() is called");if(this.sendFlag)throw new Error("INVALID_STATE_ERR: send has already been called");var lt=!1,ct=!1,ht=ot.parse(this.settings.url),ut;switch(ht.protocol){case"https:":lt=!0;case"http:":ut=ht.hostname;break;case"file:":ct=!0;break;case void 0:case null:case"":ut="localhost";break;default:throw new Error("Protocol not supported.")}if(ct){if(this.settings.method!=="GET")throw new Error("XMLHttpRequest: Only GET method is supported");if(this.settings.async)a.readFile(unescape(ht.pathname||"/"),"utf8",function(Mt,Dt){Mt?st.handleError(Mt):(st.status=200,st.responseText=Dt,st.setState(st.DONE))});else try{this.responseText=a.readFileSync(unescape(ht.pathname||"/"),"utf8"),this.status=200,this.setState(st.DONE)}catch(Mt){this.handleError(Mt)}return}var pt=ht.port||(lt?443:80),mt=ht.pathname+(ht.search?ht.search:"");for(var gt in this.defaultHeaders)this.headersLowerCase[gt.toLowerCase()]||(this.headers[gt]=this.defaultHeaders[gt]);if(ut&&(this.headers.Host=ut),ht.host&&ht.host[0]==="["&&(this.headers.Host="["+this.headers.Host+"]"),lt&&pt===443||pt===80||(this.headers.Host+=":"+ht.port),this.settings.user){typeof this.settings.password>"u"&&(this.settings.password="");var dt=Buffer.from(this.settings.user+":"+this.settings.password);this.headers.Authorization="Basic "+dt.toString("base64")}this.settings.method==="GET"||this.settings.method==="HEAD"?$=null:$?(this.headers["Content-Length"]=""+(Buffer.isBuffer($)?$.length:Buffer.byteLength($)),this.getRequestHeader("Content-Type")||(this.headers["Content-Type"]="text/plain;charset=UTF-8")):this.settings.method==="POST"&&(this.headers["Content-Length"]="0");var St={host:ut,port:pt,path:mt,method:this.settings.method,headers:this.headers,agent:!1,withCredentials:this.withCredentials};if(this.errorFlag=!1,this.settings.async){this.timeout>=1&&(this.timeoutTimer=setTimeout(function(){et.readyState!==et.DONE&&st.handleTimeout(new Error("request timed out after "+et.timeout+"ms"))},this.timeout));var xt=lt?tt.request:rt.request;this.sendFlag=!0,st.dispatchEvent("readystatechange");var yt=function(Mt){st.handleError(Mt)},_t=0,Ct=function(Mt){if(st.response=Mt,st.settings===void 0)throw new Error("INVALID_STATE_ERR: connection must be opened before send() is called");if(st.response.headers.location&&(st.response.statusCode===301||st.response.statusCode===302||st.response.statusCode===303||st.response.statusCode===307)){if(_t++,_t>=10)throw new Error("XMLHttpRequest: Request failed - too many redirects");st.settings.url=st.response.headers.location;var Dt=ot.parse(st.settings.url);ut=Dt.hostname,ut&&(st.headers.Host=ut);var Bt={hostname:Dt.hostname,port:Dt.port,path:Dt.path,method:st.response.statusCode===303?"GET":st.settings.method,headers:st.headers,withCredentials:st.withCredentials};lt=ht.protocol==="https:",xt=lt?tt.request:rt.request,st.request=xt(Bt,Ct).on("error",yt),st.request.end();return}st.response.setEncoding("utf8"),st.setState(st.HEADERS_RECEIVED),st.status=st.response.statusCode||0,st.response.on("data",function(Kt){Kt&&(st.responseText+=Kt),st.sendFlag&&st.setState(st.LOADING)}),st.response.on("end",function(){st.sendFlag&&(st.setState(st.DONE),st.sendFlag=!1)}),st.response.on("error",function(Kt){st.handleError(Kt)})};st.request=xt(St,Ct).on("error",yt),$&&st.request.write($),st.request.end(),st.dispatchEvent("loadstart")}else{var Et=new Date().getTime(),kt=at.tmpdir()+nt.sep+"ts-xmlhttprequest-content-"+process.pid,Tt=at.tmpdir()+nt.sep+"ts-xmlhttprequest-sync-"+process.pid;a.writeFileSync(Tt,"","utf8");var $t="let http = require('http'), https = require('https'), fs = require('fs');let doRequest = http"+(lt?"s":"")+".request;let options = "+JSON.stringify(St)+";let responseText = '';let req = doRequest(options, function(response) {response.setEncoding('utf8');response.on('data', function(chunk) { responseText += chunk;});response.on('end', function() {fs.writeFileSync( '"+kt+"', JSON.stringify({ err: null, data: {statusCode: response.statusCode, headers: response.headers, text: responseText} }), 'utf8');fs.unlinkSync('"+Tt+"');});response.on('error', function(error) {fs.writeFileSync('"+kt+"', JSON.stringify({err: error}), 'utf8');fs.unlinkSync('"+Tt+"');});}).on('error', function(error) {fs.writeFileSync('"+kt+"', JSON.stringify({err: error}), 'utf8');fs.unlinkSync('"+Tt+"');});"+($?"req.write('"+JSON.stringify($).slice(1,-1).replace(/'/g,"\\'")+"');":"")+"req.end();";st.dispatchEvent("loadstart"),this.setState(st.LOADING);var It=it.spawn(process.argv[0],["-e",$t]);for(It.on("exit",function(Mt,Dt){try{a.unlinkSync(Tt)}catch{}try{a.unlinkSync(kt)}catch{}});a.existsSync(Tt);)if(this.timeout!==0&&new Date().getTime()>=Et+this.timeout)return It.stdin.end(),It.kill(),st.handleTimeout(new Error("request timed out after "+this.timeout+"ms"));It.stdin.end(),It.kill();var Ot=JSON.parse(a.readFileSync(kt,"utf8"));a.unlinkSync(kt),Ot.err?st.handleError(Ot.err):(st.response=Ot.data,st.status=Ot.data.statusCode,st.responseText=Ot.data.text,st.setState(st.DONE))}},_.prototype.abort=function(){this.request&&(this.request.abort(),this.request=void 0),this.headers={},this.status=0,this.responseText="",this.responseXML=null,this.errorFlag=!0,this.readyState!==this.UNSENT&&(this.readyState!==this.OPENED||this.sendFlag)&&this.readyState!==this.DONE&&(this.sendFlag=!1,this.setState(this.DONE)),this.readyState=this.UNSENT,this.dispatchEvent("abort")},_.prototype.addEventListener=function($,et){$ in this.listeners||(this.listeners[$]=[]),this.listeners[$].push(et)},_.prototype.removeEventListener=function($,et){$ in this.listeners&&(this.listeners[$]=this.listeners[$].filter(function(st){return st!==et}))},_.prototype.dispatchEvent=function($,et){var st="on"+$;if(typeof this[st]=="function"&&this[st](et),$ in this.listeners)for(var lt=0,ct=this.listeners[$].length;lttypeof window>"u"?new xmlhttprequest_ts_1.XMLHttpRequest:new XMLHttpRequest;exports.newHttpRequest=newHttpRequest,exports.MODULES_STATIC_URL="https://source-academy.github.io/modules";function setModulesStaticURL(i){exports.MODULES_STATIC_URL=i}exports.setModulesStaticURL=setModulesStaticURL;function httpGet(i){const s=(0,exports.newHttpRequest)();try{typeof window>"u"&&(s.timeout=1e4),s.open("GET",i,!1),s.send(null)}catch(o){if(!(o instanceof DOMException))throw o}if(s.status!==200&&s.status!==304)throw new moduleErrors_1.ModuleConnectionError;return s.responseText}exports.httpGet=httpGet,exports.memoizedGetModuleManifest=(0,lodash_1.memoize)(getModuleManifest);function getModuleManifest(){const i=httpGet(`${exports.MODULES_STATIC_URL}/modules.json`);return JSON.parse(i)}const memoizedGetModuleFileInternal=(0,lodash_1.memoize)(getModuleFile),memoizedGetModuleFile=(i,s)=>memoizedGetModuleFileInternal({name:i,type:s});exports.memoizedGetModuleFile=memoizedGetModuleFile;function getModuleFile({name:i,type:s}){return httpGet(`${exports.MODULES_STATIC_URL}/${s}s/${i}.js${s==="json"?"on":""}`)}function loadModuleBundle(path,context,node){const modules=(0,exports.memoizedGetModuleManifest)(),moduleList=Object.keys(modules);if(moduleList.includes(path)===!1)throw new moduleErrors_1.ModuleNotFoundError(path,node);const moduleText=(0,exports.memoizedGetModuleFile)(path,"bundle");try{const moduleBundle=eval(moduleText);return moduleBundle({context})}catch(i){throw new moduleErrors_1.ModuleInternalError(path,node)}}exports.loadModuleBundle=loadModuleBundle;function loadModuleTabs(path,node){const modules=(0,exports.memoizedGetModuleManifest)(),moduleList=Object.keys(modules);if(moduleList.includes(path)===!1)throw new moduleErrors_1.ModuleNotFoundError(path,node);const sideContentTabPaths=modules[path].tabs;return sideContentTabPaths.map(path=>{const rawTabFile=(0,exports.memoizedGetModuleFile)(path,"tab");try{return eval(rawTabFile)}catch(i){throw new moduleErrors_1.ModuleInternalError(path,node)}})}exports.loadModuleTabs=loadModuleTabs,exports.memoizedloadModuleDocs=(0,lodash_1.memoize)(loadModuleDocs);function loadModuleDocs(i,s){try{const o=(0,exports.memoizedGetModuleManifest)();if(!Object.keys(o).includes(i))throw new moduleErrors_1.ModuleNotFoundError(i,s);const rt=getModuleFile({name:i,type:"json"});return JSON.parse(rt)}catch{return console.warn("Failed to load module documentation"),null}}exports.loadModuleDocs=loadModuleDocs})(moduleLoader);var inspector={};Object.defineProperty(inspector,"__esModule",{value:!0});inspector.areBreakpointsSet=inspector.checkEditorBreakpoints=inspector.manualToggleDebugger=inspector.setBreakpointAtLine=inspector.saveState=void 0;const saveState=(i,s,o)=>{i.debugger.state.it=s,i.debugger.state.scheduler=o};inspector.saveState=saveState;const setBreakpointAtLine=i=>{breakpoints=i};inspector.setBreakpointAtLine=setBreakpointAtLine;const manualToggleDebugger=i=>(i.runtime.break=!0,{status:"suspended",scheduler:i.debugger.state.scheduler,it:i.debugger.state.it,context:i});inspector.manualToggleDebugger=manualToggleDebugger;let breakpoints=[],moved=!0,prevStoppedLine=-1;const checkEditorBreakpoints=(i,s)=>{if(s.loc){const o=s.loc.start.line-1;!moved&&o!==prevStoppedLine&&(moved=!0),i.runtime.debuggerOn&&breakpoints[o]!==void 0&&moved&&(moved=!1,prevStoppedLine=o,i.runtime.break=!0)}};inspector.checkEditorBreakpoints=checkEditorBreakpoints;const areBreakpointsSet=()=>breakpoints.length>0;inspector.areBreakpointsSet=areBreakpointsSet;var operators={},timeoutErrors={},formatters={};Object.defineProperty(formatters,"__esModule",{value:!0});formatters.simplify=formatters.stripIndent=formatters.oneLine=void 0;function templateToString(i,s){return typeof i=="string"?i:s.reduce((o,a,rt)=>o+a+i[rt+1],i[0])}function oneLine(i,...s){return templateToString(i,s).replace(/(?:\n(?:\s*))+/g," ").trim()}formatters.oneLine=oneLine;function stripIndent(i,...s){const o=templateToString(i,s),a=o.match(/^[^\S\n]*(?=\S)/gm),rt=a&&Math.min(...a.map(et=>et.length));return rt?o.replace(new RegExp(`^.{${rt}}`,"gm"),"").trim():o.trim()}formatters.stripIndent=stripIndent;function simplify(i,s=15,o="..."){if(i.lengthtypeof window>"u"?new xmlhttprequest_ts_1.XMLHttpRequest:new XMLHttpRequest;exports.newHttpRequest=newHttpRequest,exports.MODULES_STATIC_URL="https://source-academy.github.io/modules";function setModulesStaticURL(i){exports.MODULES_STATIC_URL=i}exports.setModulesStaticURL=setModulesStaticURL;function httpGet(i){const s=(0,exports.newHttpRequest)();try{typeof window>"u"&&(s.timeout=1e4),s.open("GET",i,!1),s.send(null)}catch(o){if(!(o instanceof DOMException))throw o}if(s.status!==200&&s.status!==304)throw new moduleErrors_1.ModuleConnectionError;return s.responseText}exports.httpGet=httpGet,exports.memoizedGetModuleManifest=(0,lodash_1.memoize)(getModuleManifest);function getModuleManifest(){const i=httpGet(`${exports.MODULES_STATIC_URL}/modules.json`);return JSON.parse(i)}const memoizedGetModuleFileInternal=(0,lodash_1.memoize)(getModuleFile),memoizedGetModuleFile=(i,s)=>memoizedGetModuleFileInternal({name:i,type:s});exports.memoizedGetModuleFile=memoizedGetModuleFile;function getModuleFile({name:i,type:s}){return httpGet(`${exports.MODULES_STATIC_URL}/${s}s/${i}.js${s==="json"?"on":""}`)}function loadModuleBundle(path,context,node){const modules=(0,exports.memoizedGetModuleManifest)(),moduleList=Object.keys(modules);if(moduleList.includes(path)===!1)throw new moduleErrors_1.ModuleNotFoundError(path,node);const moduleText=(0,exports.memoizedGetModuleFile)(path,"bundle");try{const moduleBundle=eval(moduleText);return moduleBundle({context})}catch(i){throw new moduleErrors_1.ModuleInternalError(path,node)}}exports.loadModuleBundle=loadModuleBundle;function loadModuleTabs(path,node){const modules=(0,exports.memoizedGetModuleManifest)(),moduleList=Object.keys(modules);if(moduleList.includes(path)===!1)throw new moduleErrors_1.ModuleNotFoundError(path,node);const sideContentTabPaths=modules[path].tabs;return sideContentTabPaths.map(path=>{const rawTabFile=(0,exports.memoizedGetModuleFile)(path,"tab");try{return eval(rawTabFile)}catch(i){throw new moduleErrors_1.ModuleInternalError(path,node)}})}exports.loadModuleTabs=loadModuleTabs,exports.memoizedloadModuleDocs=(0,lodash_1.memoize)(loadModuleDocs);function loadModuleDocs(i,s){try{const o=(0,exports.memoizedGetModuleManifest)();if(!Object.keys(o).includes(i))throw new moduleErrors_1.ModuleNotFoundError(i,s);const rt=getModuleFile({name:i,type:"json"});return JSON.parse(rt)}catch{return console.warn("Failed to load module documentation"),null}}exports.loadModuleDocs=loadModuleDocs})(moduleLoader);var inspector={};Object.defineProperty(inspector,"__esModule",{value:!0});inspector.areBreakpointsSet=inspector.checkEditorBreakpoints=inspector.manualToggleDebugger=inspector.setBreakpointAtLine=inspector.saveState=void 0;const saveState=(i,s,o)=>{i.debugger.state.it=s,i.debugger.state.scheduler=o};inspector.saveState=saveState;const setBreakpointAtLine=i=>{breakpoints=i};inspector.setBreakpointAtLine=setBreakpointAtLine;const manualToggleDebugger=i=>(i.runtime.break=!0,{status:"suspended",scheduler:i.debugger.state.scheduler,it:i.debugger.state.it,context:i});inspector.manualToggleDebugger=manualToggleDebugger;let breakpoints=[],moved=!0,prevStoppedLine=-1;const checkEditorBreakpoints=(i,s)=>{if(s.loc){const o=s.loc.start.line-1;!moved&&o!==prevStoppedLine&&(moved=!0),i.runtime.debuggerOn&&breakpoints[o]!==void 0&&moved&&(moved=!1,prevStoppedLine=o,i.runtime.break=!0)}};inspector.checkEditorBreakpoints=checkEditorBreakpoints;const areBreakpointsSet=()=>breakpoints.length>0;inspector.areBreakpointsSet=areBreakpointsSet;var operators={},timeoutErrors={},formatters={};Object.defineProperty(formatters,"__esModule",{value:!0});formatters.simplify=formatters.stripIndent=formatters.oneLine=void 0;function templateToString(i,s){return typeof i=="string"?i:s.reduce((o,a,rt)=>o+a+i[rt+1],i[0])}function oneLine(i,...s){return templateToString(i,s).replace(/(?:\n(?:\s*))+/g," ").trim()}formatters.oneLine=oneLine;function stripIndent(i,...s){const o=templateToString(i,s),a=o.match(/^[^\S\n]*(?=\S)/gm),rt=a&&Math.min(...a.map(tt=>tt.length));return rt?o.replace(new RegExp(`^.{${rt}}`,"gm"),"").trim():o.trim()}formatters.stripIndent=stripIndent;function simplify(i,s=15,o="..."){if(i.length`${_}(${$.map(tt=>(0,a.stringify)(tt)).join(", ")})`);return(0,o.stripIndent)`${"Potential infinite recursion detected"}: ${j.join(" ... ")}. - ${et(this.maxExecTime)}`}elaborate(){return this.explain()}}return timeoutErrors.PotentialInfiniteRecursionError=nt,timeoutErrors}var makeWrapper$1={};Object.defineProperty(makeWrapper$1,"__esModule",{value:!0});makeWrapper$1.makeWrapper=void 0;function makeWrapper(i,s){for(const o in i)i.hasOwnProperty(o)&&Object.defineProperty(s,o,Object.getOwnPropertyDescriptor(i,o));for(const o of["length","name"])i.hasOwnProperty(o)&&Object.defineProperty(s,o,Object.getOwnPropertyDescriptor(i,o))}makeWrapper$1.makeWrapper=makeWrapper;var hasRequiredOperators;function requireOperators(){return hasRequiredOperators||(hasRequiredOperators=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.getProp=i.setProp=i.wrap=i.callIteratively=i.evaluateBinaryExpression=i.binaryOp=i.evaluateUnaryExpression=i.unaryOp=i.boolOrErr=i.callIfFuncAndRightArgs=i.makeLazyFunction=i.wrapLazyCallee=i.delayIt=i.forceIt=i.throwIfTimeout=void 0;const s=requireCreateContext(),o=requireErrors(),a=runtimeSourceError,rt=requireTimeoutErrors(),et=astCreator,ot=astCreator,at=makeWrapper$1,nt=rttc;function it(xt,yt,_t,Ct,Et){if(_t-yt>xt.maxExecTime)throw new rt.PotentialInfiniteLoopError(ot.locationDummyNode(Ct,Et),xt.maxExecTime)}i.throwIfTimeout=it;function j(xt){if(xt!=null&&xt.isMemoized!==void 0){if(xt.isMemoized)return xt.memoizedValue;const yt=j(xt.f());return xt.isMemoized=!0,xt.memoizedValue=yt,yt}else return xt}i.forceIt=j;function _(xt){return{isMemoized:!1,value:void 0,f:xt}}i.delayIt=_;function $(xt){if(xt=j(xt),typeof xt=="function"){const yt=(..._t)=>xt(..._t.map(j));return(0,at.makeWrapper)(xt,yt),yt[Symbol.toStringTag]=()=>xt.toString(),yt.toString=()=>xt.toString(),yt}else if(xt instanceof s.LazyBuiltIn)if(xt.evaluateArgs){const yt=(..._t)=>xt.func(..._t.map(j));return(0,at.makeWrapper)(xt.func,yt),yt[Symbol.toStringTag]=()=>xt.toString(),yt.toString=()=>xt.toString(),yt}else return xt;return xt}i.wrapLazyCallee=$;function tt(xt){return new s.LazyBuiltIn(xt,!1)}i.makeLazyFunction=tt;function st(xt,yt,_t,...Ct){const Et=ot.callExpression(ot.locationDummyNode(yt,_t),Ct,{start:{line:yt,column:_t},end:{line:yt,column:_t}});if(typeof xt=="function"){const kt=xt;xt.transformedFunction!==void 0&&(xt=xt.transformedFunction);const Tt=xt.length,$t=Ct.length,It=xt.minArgsNeeded!==void 0;if(It?xt.minArgsNeeded>$t:Tt!==$t)throw new o.InvalidNumberOfArguments(Et,It?xt.minArgsNeeded:Tt,$t,It);try{const Ot=Ct.map(j);return kt(...Ot)}catch(Ot){throw Ot instanceof a.RuntimeSourceError||Ot instanceof o.ExceptionError?Ot:new o.ExceptionError(Ot,Et.loc)}}else if(xt instanceof s.LazyBuiltIn)try{return xt.evaluateArgs&&(Ct=Ct.map(j)),xt.func(...Ct)}catch(kt){throw kt instanceof a.RuntimeSourceError||kt instanceof o.ExceptionError?kt:new o.ExceptionError(kt,Et.loc)}else throw new o.CallingNonFunctionValue(xt,Et)}i.callIfFuncAndRightArgs=st;function lt(xt,yt,_t){xt=j(xt);const Ct=nt.checkIfStatement(ot.locationDummyNode(yt,_t),xt);if(Ct===void 0)return xt;throw Ct}i.boolOrErr=lt;function ct(xt,yt,_t,Ct){yt=j(yt);const Et=nt.checkUnaryExpression(ot.locationDummyNode(_t,Ct),xt,yt);if(Et===void 0)return ht(xt,yt);throw Et}i.unaryOp=ct;function ht(xt,yt){return xt==="!"?!yt:xt==="-"?-yt:+yt}i.evaluateUnaryExpression=ht;function ut(xt,yt,_t,Ct,Et,kt){_t=j(_t),Ct=j(Ct);const Tt=nt.checkBinaryExpression(ot.locationDummyNode(Et,kt),xt,yt,_t,Ct);if(Tt===void 0)return pt(xt,_t,Ct);throw Tt}i.binaryOp=ut;function pt(xt,yt,_t){switch(xt){case"+":return yt+_t;case"-":return yt-_t;case"*":return yt*_t;case"/":return yt/_t;case"%":return yt%_t;case"===":return yt===_t;case"!==":return yt!==_t;case"<=":return yt<=_t;case"<":return yt<_t;case">":return yt>_t;case">=":return yt>=_t;default:return}}i.evaluateBinaryExpression=pt;const mt=(xt,yt,..._t)=>{let Ct=-1,Et=-1;const kt=Date.now(),Tt=[];for(;;){const $t=(0,et.locationDummyNode)(Ct,Et);if(xt=j(xt),typeof xt=="function"){xt.transformedFunction!==void 0&&(xt=xt.transformedFunction);const Ot=xt.length,Mt=_t.length,Dt=xt.minArgsNeeded!==void 0;if(Dt?xt.minArgsNeeded>Mt:Ot!==Mt)throw new o.InvalidNumberOfArguments((0,et.callExpression)($t,_t,{start:{line:Ct,column:Et},end:{line:Ct,column:Et}}),Dt?xt.minArgsNeeded:Ot,Mt,Dt)}else if(xt instanceof s.LazyBuiltIn)xt.evaluateArgs&&(_t=_t.map(j)),xt=xt.func;else throw new o.CallingNonFunctionValue(xt,$t);let It;try{if(It=xt(..._t),Date.now()-kt>yt.maxExecTime)throw new rt.PotentialInfiniteRecursionError($t,Tt,yt.maxExecTime)}catch(Ot){throw Ot instanceof a.RuntimeSourceError||Ot instanceof o.ExceptionError?Ot:new o.ExceptionError(Ot,$t.loc)}if(It==null)return It;if(It.isTail===!0)xt=It.function,_t=It.arguments,Ct=It.line,Et=It.column,Tt.push([It.functionName,_t]);else return It.isTail===!1?It.value:It}};i.callIteratively=mt;const gt=(xt,yt,_t,Ct)=>{_t&&(xt.minArgsNeeded=xt.length);const Et=(...kt)=>(0,i.callIteratively)(xt,Ct,...kt);return(0,at.makeWrapper)(xt,Et),Et.transformedFunction=xt,Et[Symbol.toStringTag]=()=>yt,Et.toString=()=>yt,Et};i.wrap=gt;const dt=(xt,yt,_t,Ct,Et)=>{const kt=(0,et.locationDummyNode)(Ct,Et),Tt=nt.checkMemberAccess(kt,xt,yt);if(Tt===void 0)return xt[yt]=_t;throw Tt};i.setProp=dt;const St=(xt,yt,_t,Ct)=>{const Et=(0,et.locationDummyNode)(_t,Ct),kt=nt.checkMemberAccess(Et,xt,yt);if(kt===void 0){if(xt[yt]!==void 0&&!xt.hasOwnProperty(yt))throw new o.GetInheritedPropertyError(Et,xt,yt);return xt[yt]}else throw kt};i.getProp=St}(operators)),operators}var hasRequiredInterpreter;function requireInterpreter(){return hasRequiredInterpreter||(hasRequiredInterpreter=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.apply=i.evaluate=i.evaluators=i.pushEnvironment=i.createBlockEnvironment=i.actualValue=void 0;const s=lodashExports,o=constants,a=requireCreateContext(),rt=requireErrors(),et=runtimeSourceError,ot=moduleLoader,at=inspector,nt=types,it=astCreator,j=requireOperators(),_=rttc,$=requireClosure();class tt{}class st{}class lt{constructor(rr){this.value=rr}}class ct{constructor(rr,Qt,xr){this.callee=rr,this.args=Qt,this.node=xr}}class ht{constructor(rr,Qt){this.exp=rr,this.env=Qt,this.isMemoized=!1,this.value=null}}const ut=(tr,rr)=>new ht(tr,rr);function*pt(tr,rr){if(tr instanceof ht){if(tr.isMemoized)return tr.value;(0,i.pushEnvironment)(rr,tr.env);const Qt=yield*mt(tr.exp,rr);return Mt(rr),tr.value=Qt,tr.isMemoized=!0,Qt}else return tr}function*mt(tr,rr){const Qt=yield*mr(tr,rr);return yield*pt(Qt,rr)}i.actualValue=mt;const gt=(tr,rr,Qt)=>{const xr={name:tr.functionName,tail:tr.environment,head:{},id:(0,s.uniqueId)()};return Qt&&(xr.callExpression=Object.assign(Object.assign({},Qt),{arguments:rr.map(it.primitive)})),tr.node.params.forEach((Sr,dr)=>{Sr.type==="RestElement"?xr.head[Sr.argument.name]=rr.slice(dr):xr.head[Sr.name]=rr[dr]}),xr},dt=(tr,rr="blockEnvironment",Qt={})=>({name:rr,tail:It(tr),head:Qt,id:(0,s.uniqueId)()});i.createBlockEnvironment=dt;const St=(tr,rr)=>{throw tr.errors.push(rr),tr.runtime.environments=tr.runtime.environments.slice(-tr.numberOfOuterEnvironments),rr},xt=Symbol("Used to implement hoisting");function yt(tr,rr,Qt){const xr=It(tr);if(xr.head.hasOwnProperty(rr)){const Sr=Object.getOwnPropertyDescriptors(xr.head);return St(tr,new rt.VariableRedeclaration(Qt,rr,Sr[rr].writable))}return xr.head[rr]=xt,xr}function _t(tr,rr){for(const Qt of rr.declarations)yt(tr,Qt.id.name,rr)}function Ct(tr,rr){for(const Qt of rr.specifiers)yt(tr,Qt.local.name,rr)}function Et(tr,rr){for(const Qt of rr.body)switch(Qt.type){case"VariableDeclaration":_t(tr,Qt);break;case"FunctionDeclaration":yt(tr,Qt.id.name,Qt);break}}function kt(tr,rr,Qt,xr=!1){const Sr=It(tr);return Sr.head[rr]!==xt?St(tr,new rt.VariableRedeclaration(tr.runtime.nodes[0],rr,!xr)):(Object.defineProperty(Sr.head,rr,{value:Qt,writable:!xr,enumerable:!0}),Sr)}function*Tt(tr,rr){(0,at.checkEditorBreakpoints)(tr,rr),tr.runtime.nodes.unshift(rr),yield tr}function*$t(tr){tr.runtime.break=!1,tr.runtime.nodes.shift(),yield tr}const It=tr=>tr.runtime.environments[0],Ot=(tr,rr)=>{tr.runtime.environments[0]=rr,tr.runtime.environmentTree.insert(rr)},Mt=tr=>tr.runtime.environments.shift(),Dt=(tr,rr)=>{tr.runtime.environments.unshift(rr),tr.runtime.environmentTree.insert(rr)};i.pushEnvironment=Dt;const Bt=(tr,rr)=>{let Qt=It(tr);for(;Qt;){if(Qt.head.hasOwnProperty(rr))return Qt.head[rr]===xt?St(tr,new rt.UnassignedVariable(rr,tr.runtime.nodes[0])):Qt.head[rr];Qt=Qt.tail}return St(tr,new rt.UndefinedVariable(rr,tr.runtime.nodes[0]))},Kt=(tr,rr,Qt)=>{let xr=It(tr);for(;xr;)if(xr.head.hasOwnProperty(rr)){if(xr.head[rr]===xt)break;if(Object.getOwnPropertyDescriptors(xr.head)[rr].writable){xr.head[rr]=Qt;return}return St(tr,new rt.ConstAssignment(tr.runtime.nodes[0],rr))}else xr=xr.tail;return St(tr,new rt.UndefinedVariable(rr,tr.runtime.nodes[0]))},Wt=(tr,rr,Qt,xr)=>{var Sr;if(rr instanceof $.default){const dr=rr.node.params,Ur=((Sr=dr[dr.length-1])===null||Sr===void 0?void 0:Sr.type)==="RestElement";if(Ur?dr.length-1>Qt.length:dr.length!==Qt.length)return St(tr,new rt.InvalidNumberOfArguments(xr,Ur?dr.length-1:dr.length,Qt.length,Ur))}else{const dr=rr.minArgsNeeded!=null;if(dr?rr.minArgsNeeded>Qt.length:rr.length!==Qt.length)return St(tr,new rt.InvalidNumberOfArguments(xr,dr?rr.minArgsNeeded:rr.length,Qt.length,dr))}};function*zt(tr,rr){const Qt=[];for(const xr of rr.arguments)tr.variant===nt.Variant.LAZY?Qt.push(ut(xr,It(tr))):xr.type==="SpreadElement"?Qt.push(...yield*mt(xr.argument,tr)):Qt.push(yield*mt(xr,tr));return Qt}function Ht(tr){return tr.operator==="&&"?(0,it.conditionalExpression)(tr.left,tr.right,(0,it.literal)(!1),tr.loc):(0,it.conditionalExpression)(tr.left,(0,it.literal)(!0),tr.right,tr.loc)}function*Zt(tr,rr){const Qt=yield*mt(tr.test,rr),xr=_.checkIfStatement(tr,Qt,rr.chapter);return xr?St(rr,xr):Qt?tr.consequent:tr.alternate}function*qt(tr,rr){Et(tr,rr);let Qt;for(const xr of rr.body)if(Qt=yield*mr(xr,tr),Qt instanceof lt||Qt instanceof ct||Qt instanceof tt||Qt instanceof st)break;return Qt}i.evaluators={Literal:function*(tr,rr){return tr.value},TemplateLiteral:function*(tr){return tr.quasis[0].value.cooked},ThisExpression:function*(tr,rr){return It(rr).thisContext},ArrayExpression:function*(tr,rr){const Qt=[];for(const xr of tr.elements)Qt.push(yield*mr(xr,rr));return Qt},DebuggerStatement:function*(tr,rr){rr.runtime.break=!0,yield},FunctionExpression:function*(tr,rr){return new $.default(tr,It(rr),rr)},ArrowFunctionExpression:function*(tr,rr){return $.default.makeFromArrowFunction(tr,It(rr),rr)},Identifier:function*(tr,rr){return Bt(rr,tr.name)},CallExpression:function*(tr,rr){const Qt=yield*mt(tr.callee,rr),xr=yield*zt(rr,tr);let Sr;return tr.callee.type==="MemberExpression"&&(Sr=yield*mt(tr.callee.object,rr)),yield*gr(rr,Qt,xr,tr,Sr)},NewExpression:function*(tr,rr){const Qt=yield*mr(tr.callee,rr),xr=[];for(const dr of tr.arguments)xr.push(yield*mr(dr,rr));const Sr={};return Qt instanceof $.default?(Sr.__proto__=Qt.fun.prototype,Qt.fun.apply(Sr,xr)):(Sr.__proto__=Qt.prototype,Qt.apply(Sr,xr)),Sr},UnaryExpression:function*(tr,rr){const Qt=yield*mt(tr.argument,rr),xr=_.checkUnaryExpression(tr,tr.operator,Qt,rr.chapter);return xr?St(rr,xr):(0,j.evaluateUnaryExpression)(tr.operator,Qt)},BinaryExpression:function*(tr,rr){const Qt=yield*mt(tr.left,rr),xr=yield*mt(tr.right,rr),Sr=_.checkBinaryExpression(tr,tr.operator,rr.chapter,Qt,xr);return Sr?St(rr,Sr):(0,j.evaluateBinaryExpression)(tr.operator,Qt,xr)},ConditionalExpression:function*(tr,rr){return yield*this.IfStatement(tr,rr)},LogicalExpression:function*(tr,rr){return yield*this.ConditionalExpression(Ht(tr),rr)},VariableDeclaration:function*(tr,rr){const Qt=tr.declarations[0],xr=tr.kind==="const",Sr=Qt.id,dr=yield*mr(Qt.init,rr);kt(rr,Sr.name,dr,xr)},ContinueStatement:function*(tr,rr){return new st},BreakStatement:function*(tr,rr){return new tt},ForStatement:function*(tr,rr){const Qt=(0,i.createBlockEnvironment)(rr,"forLoopEnvironment");(0,i.pushEnvironment)(rr,Qt);const xr=tr.init,Sr=tr.test,dr=tr.update;xr.type==="VariableDeclaration"&&_t(rr,xr),yield*mt(xr,rr);let Ur;for(;yield*mt(Sr,rr);){const tn=(0,i.createBlockEnvironment)(rr,"forBlockEnvironment");(0,i.pushEnvironment)(rr,tn);for(const on in Qt.head)Qt.head.hasOwnProperty(on)&&(yt(rr,on,tr),kt(rr,on,Qt.head[on],!0));if(Ur=yield*mt(tr.body,rr),Mt(rr),Ur instanceof st&&(Ur=void 0),Ur instanceof tt){Ur=void 0;break}if(Ur instanceof lt||Ur instanceof ct)break;yield*mt(dr,rr)}return Mt(rr),Ur},MemberExpression:function*(tr,rr){let Qt=yield*mt(tr.object,rr);Qt instanceof $.default&&(Qt=Qt.fun);let xr;tr.computed?xr=yield*mt(tr.property,rr):xr=tr.property.name;const Sr=_.checkMemberAccess(tr,Qt,xr);if(Sr)return St(rr,Sr);if(Qt!=null&&typeof Qt[xr]<"u"&&!Qt.hasOwnProperty(xr))return St(rr,new rt.GetInheritedPropertyError(tr,Qt,xr));try{return Qt[xr]}catch{return St(rr,new rt.GetPropertyError(tr,Qt,xr))}},AssignmentExpression:function*(tr,rr){if(tr.left.type==="MemberExpression"){const Sr=tr.left,dr=yield*mt(Sr.object,rr);let Ur;Sr.computed?Ur=yield*mt(Sr.property,rr):Ur=Sr.property.name;const tn=_.checkMemberAccess(tr,dr,Ur);if(tn)return St(rr,tn);const on=yield*mr(tr.right,rr);try{dr[Ur]=on}catch{return St(rr,new rt.SetPropertyError(tr,dr,Ur))}return on}const Qt=tr.left,xr=yield*mr(tr.right,rr);return Kt(rr,Qt.name,xr),xr},FunctionDeclaration:function*(tr,rr){const Qt=tr.id,xr=new $.default(tr,It(rr),rr);kt(rr,Qt.name,xr,!0)},IfStatement:function*(tr,rr){const Qt=yield*Zt(tr,rr);if(Qt!==null)return yield*mr(Qt,rr)},ExpressionStatement:function*(tr,rr){return yield*mr(tr.expression,rr)},ReturnStatement:function*(tr,rr){let Qt=tr.argument;for(;Qt.type==="LogicalExpression"||Qt.type==="ConditionalExpression";)Qt.type==="LogicalExpression"&&(Qt=Ht(Qt)),Qt=yield*Zt(Qt,rr);if(Qt.type==="CallExpression"&&rr.variant!==nt.Variant.LAZY){const xr=yield*mt(Qt.callee,rr),Sr=yield*zt(rr,Qt);return new ct(xr,Sr,Qt)}else return new lt(yield*mr(Qt,rr))},WhileStatement:function*(tr,rr){let Qt;for(;(yield*mt(tr.test,rr))&&!(Qt instanceof lt)&&!(Qt instanceof tt)&&!(Qt instanceof ct);)Qt=yield*mt(tr.body,rr);if(!(Qt instanceof tt))return Qt},ObjectExpression:function*(tr,rr){const Qt={};for(const xr of tr.properties){const Sr=xr;let dr;Sr.key.type==="Identifier"?dr=Sr.key.name:dr=yield*mr(Sr.key,rr),Qt[dr]=yield*mr(Sr.value,rr)}return Qt},BlockStatement:function*(tr,rr){const Qt=(0,i.createBlockEnvironment)(rr,"blockEnvironment");(0,i.pushEnvironment)(rr,Qt);const xr=yield*qt(rr,tr);return Mt(rr),xr},ImportDeclaration:function*(tr,rr){try{const Qt=tr.source.value,xr=tr.specifiers.map(dr=>{if(dr.type!=="ImportSpecifier")throw new Error(`I expected only ImportSpecifiers to be allowed, but encountered ${dr.type}.`);return{imported:dr.imported.name,local:dr.local.name}});Qt in rr.moduleContexts||(rr.moduleContexts[Qt]={state:null,tabs:(0,ot.loadModuleTabs)(Qt,tr)});const Sr=(0,ot.loadModuleBundle)(Qt,rr,tr);Ct(rr,tr);for(const dr of xr)kt(rr,dr.local,Sr[dr.imported],!0);return}catch(Qt){return St(rr,Qt)}},Program:function*(tr,rr){rr.numberOfOuterEnvironments+=1;const Qt=(0,i.createBlockEnvironment)(rr,"programEnvironment");return(0,i.pushEnvironment)(rr,Qt),yield*pt(yield*qt(rr,tr),rr)}};function hr(tr){return(0,s.isEmpty)(tr.head)}function fr(tr){if(hr(tr)){const rr=tr.tail;return rr===null?tr:fr(rr)}else return tr}function*mr(tr,rr){yield*Tt(rr,tr);const Qt=yield*i.evaluators[tr.type](tr,rr);return yield*$t(rr),Qt instanceof $.default&&Object.defineProperty(fr(It(rr)).head,(0,s.uniqueId)(),{value:Qt,writable:!1,enumerable:!0}),Qt}i.evaluate=mr;function*gr(tr,rr,Qt,xr,Sr){let dr,Ur=0;for(;!(dr instanceof lt);)if(rr instanceof $.default){Wt(tr,rr,Qt,xr);const tn=gt(rr,Qt,xr);dr instanceof ct?Ot(tr,tn):((0,i.pushEnvironment)(tr,tn),Ur++);const on=(0,i.createBlockEnvironment)(tr,"functionBodyEnvironment");on.thisContext=Sr,(0,i.pushEnvironment)(tr,on),dr=yield*qt(tr,rr.node.body),Mt(tr),dr instanceof ct?(rr=dr.callee,xr=dr.node,Qt=dr.args):dr instanceof lt||(dr=new lt(void 0))}else if(rr instanceof a.LazyBuiltIn)try{let tn=Qt;if(rr.evaluateArgs){tn=[];for(const on of Qt)tn.push(yield*pt(on,tr))}dr=rr.func.apply(Sr,tn);break}catch(tn){tr.runtime.environments=tr.runtime.environments.slice(-tr.numberOfOuterEnvironments);const on=xr?xr.loc:o.UNKNOWN_LOCATION;if(!(tn instanceof et.RuntimeSourceError||tn instanceof rt.ExceptionError))return St(tr,new rt.ExceptionError(tn,on));throw dr=void 0,tn}else if(typeof rr=="function"){Wt(tr,rr,Qt,xr);try{const tn=[];for(const on of Qt)tn.push(yield*pt(on,tr));dr=rr.apply(Sr,tn);break}catch(tn){tr.runtime.environments=tr.runtime.environments.slice(-tr.numberOfOuterEnvironments);const on=xr?xr.loc:o.UNKNOWN_LOCATION;if(!(tn instanceof et.RuntimeSourceError||tn instanceof rt.ExceptionError))return St(tr,new rt.ExceptionError(tn,on));throw dr=void 0,tn}}else return St(tr,new rt.CallingNonFunctionValue(rr,xr));dr instanceof lt&&(dr=dr.value);for(let tn=1;tn<=Ur;tn++)Mt(tr);return dr}i.apply=gr}(interpreter)),interpreter}var hasRequiredClosure;function requireClosure(){if(hasRequiredClosure)return closure;hasRequiredClosure=1,Object.defineProperty(closure,"__esModule",{value:!0});const i=astring,s=astCreator,o=requireInterpreter(),a=(ot,at,nt)=>{function it(){const j=Array.prototype.slice.call(arguments),_=(0,o.apply)(at,ot,j,(0,s.callExpression)((0,s.identifier)(nt),j),this);let $=_.next();for(;!$.done;)$=_.next();return $.value}return Object.defineProperty(it,"name",{value:nt}),Object.setPrototypeOf(it,()=>{}),Object.defineProperty(it,"Inherits",{value:j=>{it.prototype=Object.create(j.prototype),it.prototype.constructor=it}}),it.toString=()=>(0,i.generate)(ot.originalNode),it.call=(j,..._)=>it.apply(j,_),it};class rt extends Function{constructor(at){return super(),Object.setPrototypeOf(at,new.target.prototype)}}class et extends rt{constructor(at,nt,it){super(function(..._){return j.apply(this,_)}),this.node=at,this.environment=nt,this.originalNode=at,this.node.type==="FunctionDeclaration"&&this.node.id!==null?this.functionName=this.node.id.name:this.functionName=(this.node.params.length===1?"":"(")+this.node.params.map(_=>_.name).join(", ")+(this.node.params.length===1?"":")")+" => ...";const j=a(this,it,this.functionName);this.fun=j}static makeFromArrowFunction(at,nt,it){function j(tt){return tt.type!=="BlockStatement"}const _=j(at.body)?[(0,s.returnStatement)(at.body,at.body.loc)]:at.body,$=new et((0,s.blockArrowFunction)(at.params,_,at.loc),nt,it);return $.originalNode=at,$}toString(){return(0,i.generate)(this.originalNode)}}return closure.default=et,closure}var hasRequiredStringify;function requireStringify(){if(hasRequiredStringify)return stringify$1;hasRequiredStringify=1,Object.defineProperty(stringify$1,"__esModule",{value:!0}),stringify$1.lineTreeToString=stringify$1.stringDagToSingleLine=stringify$1.stringDagToLineTree=stringify$1.valueToStringDag=stringify$1.typeToString=stringify$1.stringify=void 0;const i=constants,s=requireClosure(),o=requireOperators();function a(_){return typeof _.replPrefix=="string"&&typeof _.replSuffix=="string"&&typeof _.replArrayContents=="function"}const rt=(_,$=2,tt=80)=>{if(_=(0,o.forceIt)(_),typeof $=="string")throw"stringify with arbitrary indent string not supported";let st=$;return $>10&&(st=10),j(nt(at(_),st,tt))};stringify$1.stringify=rt;function et(_){return ot(_)}stringify$1.typeToString=et;function ot(_,$={_next:0}){function tt(st){return ot(st,$)}switch(_.kind){case"primitive":return _.name;case"variable":return _.constraint&&_.constraint!=="none"?_.constraint:(_.name in $||($[_.name]="T"+$._next++),$[_.name]);case"list":return`List<${tt(_.elementType)}>`;case"array":return`Array<${tt(_.elementType)}>`;case"pair":const st=tt(_.headType);return _.tailType.kind==="list"&&st===tt(_.tailType.elementType)?`List<${st}>`:`[${tt(_.headType)}, ${tt(_.tailType)}]`;case"function":let lt=_.parameterTypes.map(tt).join(", ");return(_.parameterTypes.length!==1||_.parameterTypes[0].kind==="function")&&(lt=`(${lt})`),`${lt} -> ${tt(_.returnType)}`;default:return"Unable to infer type"}}function at(_){const $=new Map,tt=new Map;function st(pt){const mt=tt.get(pt);if(mt!==void 0)return[mt,!1];$.set(pt,$.size);const gt=pt,[dt,St]=ut(gt[0]),[xt,yt]=ut(gt[1]),_t=St||yt;$.delete(pt);const Ct={type:"pair",head:dt,tail:xt,length:dt.length+xt.length+4};return _t||tt.set(pt,Ct),[Ct,_t]}function lt(pt,mt,gt,dt){const St=tt.get(pt);if(St!==void 0)return[St,!1];$.set(pt,$.size);const xt=mt.map(ut);let yt=gt.length+dt.length+Math.max(0,xt.length-1)*2,_t=!1;for(let Et=0;EtEt[0]),prefix:gt,suffix:dt,length:yt};return _t||tt.set(pt,Ct),[Ct,_t]}function ct(pt){const mt=tt.get(pt);if(mt!==void 0)return[mt,!1];$.set(pt,$.size);const gt=Object.entries(pt),dt=gt.map(Ct=>ut(Ct[1]));let St=2+Math.max(0,gt.length-1)*2+gt.length*2,xt=!1;const yt=[];for(let Ct=0;Ct",length:13},!0];if(pt instanceof s.default)return ht(pt.toString());if(typeof pt=="string"){const mt=JSON.stringify(pt);return[{type:"terminal",str:mt,length:mt.length},!1]}else return typeof pt!="object"?ht(pt.toString()):$.size>i.MAX_LIST_DISPLAY_LENGTH?[{type:"terminal",str:"...",length:14},!1]:typeof pt.toReplString=="function"?ht(pt.toReplString()):Array.isArray(pt)?pt.length===2?st(pt):lt(pt,pt,"[","]"):a(pt)?lt(pt,pt.replArrayContents(),pt.replPrefix,pt.replSuffix):Object.getPrototypeOf(pt)===Object.prototype?ct(pt):ht(pt.toString())}return ut(_)[0]}stringify$1.valueToStringDag=at;function nt(_,$,tt){const lt="["+" ".repeat(Math.max(0,$-1)),ct=new Map;function ht(ut){const pt=ct.get(ut);if(pt!==void 0)return pt;let mt;if(ut.type==="terminal")mt={type:"line",line:ut};else if(ut.type==="multiline")mt={type:"block",prefixFirst:"",prefixRest:"",block:ut.lines.map(gt=>({type:"line",line:{type:"terminal",str:gt,length:gt.length}})),suffixRest:"",suffixLast:""};else if(ut.type==="pair"){const gt=ht(ut.head),dt=ht(ut.tail);ut.length-2>tt||gt.type!=="line"||dt.type!=="line"?mt={type:"block",prefixFirst:lt,prefixRest:"",block:[gt,dt],suffixRest:",",suffixLast:"]"}:mt={type:"line",line:ut}}else if(ut.type==="arraylike"){const gt=ut.elems.map(ht);ut.length-ut.prefix.length-ut.suffix.length>tt||gt.some(dt=>dt.type!=="line")?mt={type:"block",prefixFirst:ut.prefix+" ".repeat(Math.max(0,$-ut.prefix.length)),prefixRest:" ".repeat(Math.max(ut.prefix.length,$)),block:gt,suffixRest:",",suffixLast:ut.suffix}:mt={type:"line",line:ut}}else if(ut.type==="kvpair"){const gt=ht(ut.value);ut.length>tt||gt.type!=="line"?mt={type:"block",prefixFirst:"",prefixRest:"",block:[{type:"line",line:{type:"terminal",str:JSON.stringify(ut.key),length:0}},gt],suffixRest:":",suffixLast:""}:mt={type:"line",line:ut}}else throw"up";return ct.set(ut,mt),mt}return ht(_)}stringify$1.stringDagToLineTree=nt;function it(_){function $(tt,st){if(tt.type==="multiline")throw"Tried to format multiline string as single line string";if(tt.type==="terminal")st.push(tt.str);else if(tt.type==="pair")st.push("["),$(tt.head,st),st.push(", "),$(tt.tail,st),st.push("]");else if(tt.type==="kvpair")st.push(JSON.stringify(tt.key)),st.push(": "),$(tt.value,st);else if(tt.type==="arraylike"){st.push(tt.prefix),tt.elems.length>0&&$(tt.elems[0],st);for(let lt=1;lt(0,o.stringify)(dt.value));mt.write(gt.join(", ")),mt.write(")")}})}explain(){const ht=ut=>(0,i.generate)(ut,{generator:this.customGenerator});return`Maximum call stack size exceeded + ${tt(this.maxExecTime)}`}elaborate(){return this.explain()}}timeoutErrors.PotentialInfiniteLoopError=at;class nt extends ot{constructor(j,_,$){super(j),this.calls=_,this.maxExecTime=$,this.type=s.ErrorType.RUNTIME,this.severity=s.ErrorSeverity.ERROR,this.calls=this.calls.slice(-3)}explain(){const j=this.calls.map(([_,$])=>`${_}(${$.map(et=>(0,a.stringify)(et)).join(", ")})`);return(0,o.stripIndent)`${"Potential infinite recursion detected"}: ${j.join(" ... ")}. + ${tt(this.maxExecTime)}`}elaborate(){return this.explain()}}return timeoutErrors.PotentialInfiniteRecursionError=nt,timeoutErrors}var makeWrapper$1={};Object.defineProperty(makeWrapper$1,"__esModule",{value:!0});makeWrapper$1.makeWrapper=void 0;function makeWrapper(i,s){for(const o in i)i.hasOwnProperty(o)&&Object.defineProperty(s,o,Object.getOwnPropertyDescriptor(i,o));for(const o of["length","name"])i.hasOwnProperty(o)&&Object.defineProperty(s,o,Object.getOwnPropertyDescriptor(i,o))}makeWrapper$1.makeWrapper=makeWrapper;var hasRequiredOperators;function requireOperators(){return hasRequiredOperators||(hasRequiredOperators=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.getProp=i.setProp=i.wrap=i.callIteratively=i.evaluateBinaryExpression=i.binaryOp=i.evaluateUnaryExpression=i.unaryOp=i.boolOrErr=i.callIfFuncAndRightArgs=i.makeLazyFunction=i.wrapLazyCallee=i.delayIt=i.forceIt=i.throwIfTimeout=void 0;const s=requireCreateContext(),o=requireErrors(),a=runtimeSourceError,rt=requireTimeoutErrors(),tt=astCreator,ot=astCreator,at=makeWrapper$1,nt=rttc;function it(xt,yt,_t,Ct,Et){if(_t-yt>xt.maxExecTime)throw new rt.PotentialInfiniteLoopError(ot.locationDummyNode(Ct,Et),xt.maxExecTime)}i.throwIfTimeout=it;function j(xt){if(xt!=null&&xt.isMemoized!==void 0){if(xt.isMemoized)return xt.memoizedValue;const yt=j(xt.f());return xt.isMemoized=!0,xt.memoizedValue=yt,yt}else return xt}i.forceIt=j;function _(xt){return{isMemoized:!1,value:void 0,f:xt}}i.delayIt=_;function $(xt){if(xt=j(xt),typeof xt=="function"){const yt=(..._t)=>xt(..._t.map(j));return(0,at.makeWrapper)(xt,yt),yt[Symbol.toStringTag]=()=>xt.toString(),yt.toString=()=>xt.toString(),yt}else if(xt instanceof s.LazyBuiltIn)if(xt.evaluateArgs){const yt=(..._t)=>xt.func(..._t.map(j));return(0,at.makeWrapper)(xt.func,yt),yt[Symbol.toStringTag]=()=>xt.toString(),yt.toString=()=>xt.toString(),yt}else return xt;return xt}i.wrapLazyCallee=$;function et(xt){return new s.LazyBuiltIn(xt,!1)}i.makeLazyFunction=et;function st(xt,yt,_t,...Ct){const Et=ot.callExpression(ot.locationDummyNode(yt,_t),Ct,{start:{line:yt,column:_t},end:{line:yt,column:_t}});if(typeof xt=="function"){const kt=xt;xt.transformedFunction!==void 0&&(xt=xt.transformedFunction);const Tt=xt.length,$t=Ct.length,It=xt.minArgsNeeded!==void 0;if(It?xt.minArgsNeeded>$t:Tt!==$t)throw new o.InvalidNumberOfArguments(Et,It?xt.minArgsNeeded:Tt,$t,It);try{const Ot=Ct.map(j);return kt(...Ot)}catch(Ot){throw Ot instanceof a.RuntimeSourceError||Ot instanceof o.ExceptionError?Ot:new o.ExceptionError(Ot,Et.loc)}}else if(xt instanceof s.LazyBuiltIn)try{return xt.evaluateArgs&&(Ct=Ct.map(j)),xt.func(...Ct)}catch(kt){throw kt instanceof a.RuntimeSourceError||kt instanceof o.ExceptionError?kt:new o.ExceptionError(kt,Et.loc)}else throw new o.CallingNonFunctionValue(xt,Et)}i.callIfFuncAndRightArgs=st;function lt(xt,yt,_t){xt=j(xt);const Ct=nt.checkIfStatement(ot.locationDummyNode(yt,_t),xt);if(Ct===void 0)return xt;throw Ct}i.boolOrErr=lt;function ct(xt,yt,_t,Ct){yt=j(yt);const Et=nt.checkUnaryExpression(ot.locationDummyNode(_t,Ct),xt,yt);if(Et===void 0)return ht(xt,yt);throw Et}i.unaryOp=ct;function ht(xt,yt){return xt==="!"?!yt:xt==="-"?-yt:+yt}i.evaluateUnaryExpression=ht;function ut(xt,yt,_t,Ct,Et,kt){_t=j(_t),Ct=j(Ct);const Tt=nt.checkBinaryExpression(ot.locationDummyNode(Et,kt),xt,yt,_t,Ct);if(Tt===void 0)return pt(xt,_t,Ct);throw Tt}i.binaryOp=ut;function pt(xt,yt,_t){switch(xt){case"+":return yt+_t;case"-":return yt-_t;case"*":return yt*_t;case"/":return yt/_t;case"%":return yt%_t;case"===":return yt===_t;case"!==":return yt!==_t;case"<=":return yt<=_t;case"<":return yt<_t;case">":return yt>_t;case">=":return yt>=_t;default:return}}i.evaluateBinaryExpression=pt;const mt=(xt,yt,..._t)=>{let Ct=-1,Et=-1;const kt=Date.now(),Tt=[];for(;;){const $t=(0,tt.locationDummyNode)(Ct,Et);if(xt=j(xt),typeof xt=="function"){xt.transformedFunction!==void 0&&(xt=xt.transformedFunction);const Ot=xt.length,Mt=_t.length,Dt=xt.minArgsNeeded!==void 0;if(Dt?xt.minArgsNeeded>Mt:Ot!==Mt)throw new o.InvalidNumberOfArguments((0,tt.callExpression)($t,_t,{start:{line:Ct,column:Et},end:{line:Ct,column:Et}}),Dt?xt.minArgsNeeded:Ot,Mt,Dt)}else if(xt instanceof s.LazyBuiltIn)xt.evaluateArgs&&(_t=_t.map(j)),xt=xt.func;else throw new o.CallingNonFunctionValue(xt,$t);let It;try{if(It=xt(..._t),Date.now()-kt>yt.maxExecTime)throw new rt.PotentialInfiniteRecursionError($t,Tt,yt.maxExecTime)}catch(Ot){throw Ot instanceof a.RuntimeSourceError||Ot instanceof o.ExceptionError?Ot:new o.ExceptionError(Ot,$t.loc)}if(It==null)return It;if(It.isTail===!0)xt=It.function,_t=It.arguments,Ct=It.line,Et=It.column,Tt.push([It.functionName,_t]);else return It.isTail===!1?It.value:It}};i.callIteratively=mt;const gt=(xt,yt,_t,Ct)=>{_t&&(xt.minArgsNeeded=xt.length);const Et=(...kt)=>(0,i.callIteratively)(xt,Ct,...kt);return(0,at.makeWrapper)(xt,Et),Et.transformedFunction=xt,Et[Symbol.toStringTag]=()=>yt,Et.toString=()=>yt,Et};i.wrap=gt;const dt=(xt,yt,_t,Ct,Et)=>{const kt=(0,tt.locationDummyNode)(Ct,Et),Tt=nt.checkMemberAccess(kt,xt,yt);if(Tt===void 0)return xt[yt]=_t;throw Tt};i.setProp=dt;const St=(xt,yt,_t,Ct)=>{const Et=(0,tt.locationDummyNode)(_t,Ct),kt=nt.checkMemberAccess(Et,xt,yt);if(kt===void 0){if(xt[yt]!==void 0&&!xt.hasOwnProperty(yt))throw new o.GetInheritedPropertyError(Et,xt,yt);return xt[yt]}else throw kt};i.getProp=St}(operators)),operators}var hasRequiredInterpreter;function requireInterpreter(){return hasRequiredInterpreter||(hasRequiredInterpreter=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.apply=i.evaluate=i.evaluators=i.pushEnvironment=i.createBlockEnvironment=i.actualValue=void 0;const s=lodashExports,o=constants,a=requireCreateContext(),rt=requireErrors(),tt=runtimeSourceError,ot=moduleLoader,at=inspector,nt=types,it=astCreator,j=requireOperators(),_=rttc,$=requireClosure();class et{}class st{}class lt{constructor(rr){this.value=rr}}class ct{constructor(rr,Qt,xr){this.callee=rr,this.args=Qt,this.node=xr}}class ht{constructor(rr,Qt){this.exp=rr,this.env=Qt,this.isMemoized=!1,this.value=null}}const ut=(tr,rr)=>new ht(tr,rr);function*pt(tr,rr){if(tr instanceof ht){if(tr.isMemoized)return tr.value;(0,i.pushEnvironment)(rr,tr.env);const Qt=yield*mt(tr.exp,rr);return Mt(rr),tr.value=Qt,tr.isMemoized=!0,Qt}else return tr}function*mt(tr,rr){const Qt=yield*mr(tr,rr);return yield*pt(Qt,rr)}i.actualValue=mt;const gt=(tr,rr,Qt)=>{const xr={name:tr.functionName,tail:tr.environment,head:{},id:(0,s.uniqueId)()};return Qt&&(xr.callExpression=Object.assign(Object.assign({},Qt),{arguments:rr.map(it.primitive)})),tr.node.params.forEach((Sr,dr)=>{Sr.type==="RestElement"?xr.head[Sr.argument.name]=rr.slice(dr):xr.head[Sr.name]=rr[dr]}),xr},dt=(tr,rr="blockEnvironment",Qt={})=>({name:rr,tail:It(tr),head:Qt,id:(0,s.uniqueId)()});i.createBlockEnvironment=dt;const St=(tr,rr)=>{throw tr.errors.push(rr),tr.runtime.environments=tr.runtime.environments.slice(-tr.numberOfOuterEnvironments),rr},xt=Symbol("Used to implement hoisting");function yt(tr,rr,Qt){const xr=It(tr);if(xr.head.hasOwnProperty(rr)){const Sr=Object.getOwnPropertyDescriptors(xr.head);return St(tr,new rt.VariableRedeclaration(Qt,rr,Sr[rr].writable))}return xr.head[rr]=xt,xr}function _t(tr,rr){for(const Qt of rr.declarations)yt(tr,Qt.id.name,rr)}function Ct(tr,rr){for(const Qt of rr.specifiers)yt(tr,Qt.local.name,rr)}function Et(tr,rr){for(const Qt of rr.body)switch(Qt.type){case"VariableDeclaration":_t(tr,Qt);break;case"FunctionDeclaration":yt(tr,Qt.id.name,Qt);break}}function kt(tr,rr,Qt,xr=!1){const Sr=It(tr);return Sr.head[rr]!==xt?St(tr,new rt.VariableRedeclaration(tr.runtime.nodes[0],rr,!xr)):(Object.defineProperty(Sr.head,rr,{value:Qt,writable:!xr,enumerable:!0}),Sr)}function*Tt(tr,rr){(0,at.checkEditorBreakpoints)(tr,rr),tr.runtime.nodes.unshift(rr),yield tr}function*$t(tr){tr.runtime.break=!1,tr.runtime.nodes.shift(),yield tr}const It=tr=>tr.runtime.environments[0],Ot=(tr,rr)=>{tr.runtime.environments[0]=rr,tr.runtime.environmentTree.insert(rr)},Mt=tr=>tr.runtime.environments.shift(),Dt=(tr,rr)=>{tr.runtime.environments.unshift(rr),tr.runtime.environmentTree.insert(rr)};i.pushEnvironment=Dt;const Bt=(tr,rr)=>{let Qt=It(tr);for(;Qt;){if(Qt.head.hasOwnProperty(rr))return Qt.head[rr]===xt?St(tr,new rt.UnassignedVariable(rr,tr.runtime.nodes[0])):Qt.head[rr];Qt=Qt.tail}return St(tr,new rt.UndefinedVariable(rr,tr.runtime.nodes[0]))},Kt=(tr,rr,Qt)=>{let xr=It(tr);for(;xr;)if(xr.head.hasOwnProperty(rr)){if(xr.head[rr]===xt)break;if(Object.getOwnPropertyDescriptors(xr.head)[rr].writable){xr.head[rr]=Qt;return}return St(tr,new rt.ConstAssignment(tr.runtime.nodes[0],rr))}else xr=xr.tail;return St(tr,new rt.UndefinedVariable(rr,tr.runtime.nodes[0]))},Wt=(tr,rr,Qt,xr)=>{var Sr;if(rr instanceof $.default){const dr=rr.node.params,Ur=((Sr=dr[dr.length-1])===null||Sr===void 0?void 0:Sr.type)==="RestElement";if(Ur?dr.length-1>Qt.length:dr.length!==Qt.length)return St(tr,new rt.InvalidNumberOfArguments(xr,Ur?dr.length-1:dr.length,Qt.length,Ur))}else{const dr=rr.minArgsNeeded!=null;if(dr?rr.minArgsNeeded>Qt.length:rr.length!==Qt.length)return St(tr,new rt.InvalidNumberOfArguments(xr,dr?rr.minArgsNeeded:rr.length,Qt.length,dr))}};function*zt(tr,rr){const Qt=[];for(const xr of rr.arguments)tr.variant===nt.Variant.LAZY?Qt.push(ut(xr,It(tr))):xr.type==="SpreadElement"?Qt.push(...yield*mt(xr.argument,tr)):Qt.push(yield*mt(xr,tr));return Qt}function Ht(tr){return tr.operator==="&&"?(0,it.conditionalExpression)(tr.left,tr.right,(0,it.literal)(!1),tr.loc):(0,it.conditionalExpression)(tr.left,(0,it.literal)(!0),tr.right,tr.loc)}function*Zt(tr,rr){const Qt=yield*mt(tr.test,rr),xr=_.checkIfStatement(tr,Qt,rr.chapter);return xr?St(rr,xr):Qt?tr.consequent:tr.alternate}function*qt(tr,rr){Et(tr,rr);let Qt;for(const xr of rr.body)if(Qt=yield*mr(xr,tr),Qt instanceof lt||Qt instanceof ct||Qt instanceof et||Qt instanceof st)break;return Qt}i.evaluators={Literal:function*(tr,rr){return tr.value},TemplateLiteral:function*(tr){return tr.quasis[0].value.cooked},ThisExpression:function*(tr,rr){return It(rr).thisContext},ArrayExpression:function*(tr,rr){const Qt=[];for(const xr of tr.elements)Qt.push(yield*mr(xr,rr));return Qt},DebuggerStatement:function*(tr,rr){rr.runtime.break=!0,yield},FunctionExpression:function*(tr,rr){return new $.default(tr,It(rr),rr)},ArrowFunctionExpression:function*(tr,rr){return $.default.makeFromArrowFunction(tr,It(rr),rr)},Identifier:function*(tr,rr){return Bt(rr,tr.name)},CallExpression:function*(tr,rr){const Qt=yield*mt(tr.callee,rr),xr=yield*zt(rr,tr);let Sr;return tr.callee.type==="MemberExpression"&&(Sr=yield*mt(tr.callee.object,rr)),yield*gr(rr,Qt,xr,tr,Sr)},NewExpression:function*(tr,rr){const Qt=yield*mr(tr.callee,rr),xr=[];for(const dr of tr.arguments)xr.push(yield*mr(dr,rr));const Sr={};return Qt instanceof $.default?(Sr.__proto__=Qt.fun.prototype,Qt.fun.apply(Sr,xr)):(Sr.__proto__=Qt.prototype,Qt.apply(Sr,xr)),Sr},UnaryExpression:function*(tr,rr){const Qt=yield*mt(tr.argument,rr),xr=_.checkUnaryExpression(tr,tr.operator,Qt,rr.chapter);return xr?St(rr,xr):(0,j.evaluateUnaryExpression)(tr.operator,Qt)},BinaryExpression:function*(tr,rr){const Qt=yield*mt(tr.left,rr),xr=yield*mt(tr.right,rr),Sr=_.checkBinaryExpression(tr,tr.operator,rr.chapter,Qt,xr);return Sr?St(rr,Sr):(0,j.evaluateBinaryExpression)(tr.operator,Qt,xr)},ConditionalExpression:function*(tr,rr){return yield*this.IfStatement(tr,rr)},LogicalExpression:function*(tr,rr){return yield*this.ConditionalExpression(Ht(tr),rr)},VariableDeclaration:function*(tr,rr){const Qt=tr.declarations[0],xr=tr.kind==="const",Sr=Qt.id,dr=yield*mr(Qt.init,rr);kt(rr,Sr.name,dr,xr)},ContinueStatement:function*(tr,rr){return new st},BreakStatement:function*(tr,rr){return new et},ForStatement:function*(tr,rr){const Qt=(0,i.createBlockEnvironment)(rr,"forLoopEnvironment");(0,i.pushEnvironment)(rr,Qt);const xr=tr.init,Sr=tr.test,dr=tr.update;xr.type==="VariableDeclaration"&&_t(rr,xr),yield*mt(xr,rr);let Ur;for(;yield*mt(Sr,rr);){const tn=(0,i.createBlockEnvironment)(rr,"forBlockEnvironment");(0,i.pushEnvironment)(rr,tn);for(const on in Qt.head)Qt.head.hasOwnProperty(on)&&(yt(rr,on,tr),kt(rr,on,Qt.head[on],!0));if(Ur=yield*mt(tr.body,rr),Mt(rr),Ur instanceof st&&(Ur=void 0),Ur instanceof et){Ur=void 0;break}if(Ur instanceof lt||Ur instanceof ct)break;yield*mt(dr,rr)}return Mt(rr),Ur},MemberExpression:function*(tr,rr){let Qt=yield*mt(tr.object,rr);Qt instanceof $.default&&(Qt=Qt.fun);let xr;tr.computed?xr=yield*mt(tr.property,rr):xr=tr.property.name;const Sr=_.checkMemberAccess(tr,Qt,xr);if(Sr)return St(rr,Sr);if(Qt!=null&&typeof Qt[xr]<"u"&&!Qt.hasOwnProperty(xr))return St(rr,new rt.GetInheritedPropertyError(tr,Qt,xr));try{return Qt[xr]}catch{return St(rr,new rt.GetPropertyError(tr,Qt,xr))}},AssignmentExpression:function*(tr,rr){if(tr.left.type==="MemberExpression"){const Sr=tr.left,dr=yield*mt(Sr.object,rr);let Ur;Sr.computed?Ur=yield*mt(Sr.property,rr):Ur=Sr.property.name;const tn=_.checkMemberAccess(tr,dr,Ur);if(tn)return St(rr,tn);const on=yield*mr(tr.right,rr);try{dr[Ur]=on}catch{return St(rr,new rt.SetPropertyError(tr,dr,Ur))}return on}const Qt=tr.left,xr=yield*mr(tr.right,rr);return Kt(rr,Qt.name,xr),xr},FunctionDeclaration:function*(tr,rr){const Qt=tr.id,xr=new $.default(tr,It(rr),rr);kt(rr,Qt.name,xr,!0)},IfStatement:function*(tr,rr){const Qt=yield*Zt(tr,rr);if(Qt!==null)return yield*mr(Qt,rr)},ExpressionStatement:function*(tr,rr){return yield*mr(tr.expression,rr)},ReturnStatement:function*(tr,rr){let Qt=tr.argument;for(;Qt.type==="LogicalExpression"||Qt.type==="ConditionalExpression";)Qt.type==="LogicalExpression"&&(Qt=Ht(Qt)),Qt=yield*Zt(Qt,rr);if(Qt.type==="CallExpression"&&rr.variant!==nt.Variant.LAZY){const xr=yield*mt(Qt.callee,rr),Sr=yield*zt(rr,Qt);return new ct(xr,Sr,Qt)}else return new lt(yield*mr(Qt,rr))},WhileStatement:function*(tr,rr){let Qt;for(;(yield*mt(tr.test,rr))&&!(Qt instanceof lt)&&!(Qt instanceof et)&&!(Qt instanceof ct);)Qt=yield*mt(tr.body,rr);if(!(Qt instanceof et))return Qt},ObjectExpression:function*(tr,rr){const Qt={};for(const xr of tr.properties){const Sr=xr;let dr;Sr.key.type==="Identifier"?dr=Sr.key.name:dr=yield*mr(Sr.key,rr),Qt[dr]=yield*mr(Sr.value,rr)}return Qt},BlockStatement:function*(tr,rr){const Qt=(0,i.createBlockEnvironment)(rr,"blockEnvironment");(0,i.pushEnvironment)(rr,Qt);const xr=yield*qt(rr,tr);return Mt(rr),xr},ImportDeclaration:function*(tr,rr){try{const Qt=tr.source.value,xr=tr.specifiers.map(dr=>{if(dr.type!=="ImportSpecifier")throw new Error(`I expected only ImportSpecifiers to be allowed, but encountered ${dr.type}.`);return{imported:dr.imported.name,local:dr.local.name}});Qt in rr.moduleContexts||(rr.moduleContexts[Qt]={state:null,tabs:(0,ot.loadModuleTabs)(Qt,tr)});const Sr=(0,ot.loadModuleBundle)(Qt,rr,tr);Ct(rr,tr);for(const dr of xr)kt(rr,dr.local,Sr[dr.imported],!0);return}catch(Qt){return St(rr,Qt)}},Program:function*(tr,rr){rr.numberOfOuterEnvironments+=1;const Qt=(0,i.createBlockEnvironment)(rr,"programEnvironment");return(0,i.pushEnvironment)(rr,Qt),yield*pt(yield*qt(rr,tr),rr)}};function hr(tr){return(0,s.isEmpty)(tr.head)}function fr(tr){if(hr(tr)){const rr=tr.tail;return rr===null?tr:fr(rr)}else return tr}function*mr(tr,rr){yield*Tt(rr,tr);const Qt=yield*i.evaluators[tr.type](tr,rr);return yield*$t(rr),Qt instanceof $.default&&Object.defineProperty(fr(It(rr)).head,(0,s.uniqueId)(),{value:Qt,writable:!1,enumerable:!0}),Qt}i.evaluate=mr;function*gr(tr,rr,Qt,xr,Sr){let dr,Ur=0;for(;!(dr instanceof lt);)if(rr instanceof $.default){Wt(tr,rr,Qt,xr);const tn=gt(rr,Qt,xr);dr instanceof ct?Ot(tr,tn):((0,i.pushEnvironment)(tr,tn),Ur++);const on=(0,i.createBlockEnvironment)(tr,"functionBodyEnvironment");on.thisContext=Sr,(0,i.pushEnvironment)(tr,on),dr=yield*qt(tr,rr.node.body),Mt(tr),dr instanceof ct?(rr=dr.callee,xr=dr.node,Qt=dr.args):dr instanceof lt||(dr=new lt(void 0))}else if(rr instanceof a.LazyBuiltIn)try{let tn=Qt;if(rr.evaluateArgs){tn=[];for(const on of Qt)tn.push(yield*pt(on,tr))}dr=rr.func.apply(Sr,tn);break}catch(tn){tr.runtime.environments=tr.runtime.environments.slice(-tr.numberOfOuterEnvironments);const on=xr?xr.loc:o.UNKNOWN_LOCATION;if(!(tn instanceof tt.RuntimeSourceError||tn instanceof rt.ExceptionError))return St(tr,new rt.ExceptionError(tn,on));throw dr=void 0,tn}else if(typeof rr=="function"){Wt(tr,rr,Qt,xr);try{const tn=[];for(const on of Qt)tn.push(yield*pt(on,tr));dr=rr.apply(Sr,tn);break}catch(tn){tr.runtime.environments=tr.runtime.environments.slice(-tr.numberOfOuterEnvironments);const on=xr?xr.loc:o.UNKNOWN_LOCATION;if(!(tn instanceof tt.RuntimeSourceError||tn instanceof rt.ExceptionError))return St(tr,new rt.ExceptionError(tn,on));throw dr=void 0,tn}}else return St(tr,new rt.CallingNonFunctionValue(rr,xr));dr instanceof lt&&(dr=dr.value);for(let tn=1;tn<=Ur;tn++)Mt(tr);return dr}i.apply=gr}(interpreter)),interpreter}var hasRequiredClosure;function requireClosure(){if(hasRequiredClosure)return closure;hasRequiredClosure=1,Object.defineProperty(closure,"__esModule",{value:!0});const i=astring,s=astCreator,o=requireInterpreter(),a=(ot,at,nt)=>{function it(){const j=Array.prototype.slice.call(arguments),_=(0,o.apply)(at,ot,j,(0,s.callExpression)((0,s.identifier)(nt),j),this);let $=_.next();for(;!$.done;)$=_.next();return $.value}return Object.defineProperty(it,"name",{value:nt}),Object.setPrototypeOf(it,()=>{}),Object.defineProperty(it,"Inherits",{value:j=>{it.prototype=Object.create(j.prototype),it.prototype.constructor=it}}),it.toString=()=>(0,i.generate)(ot.originalNode),it.call=(j,..._)=>it.apply(j,_),it};class rt extends Function{constructor(at){return super(),Object.setPrototypeOf(at,new.target.prototype)}}class tt extends rt{constructor(at,nt,it){super(function(..._){return j.apply(this,_)}),this.node=at,this.environment=nt,this.originalNode=at,this.node.type==="FunctionDeclaration"&&this.node.id!==null?this.functionName=this.node.id.name:this.functionName=(this.node.params.length===1?"":"(")+this.node.params.map(_=>_.name).join(", ")+(this.node.params.length===1?"":")")+" => ...";const j=a(this,it,this.functionName);this.fun=j}static makeFromArrowFunction(at,nt,it){function j(et){return et.type!=="BlockStatement"}const _=j(at.body)?[(0,s.returnStatement)(at.body,at.body.loc)]:at.body,$=new tt((0,s.blockArrowFunction)(at.params,_,at.loc),nt,it);return $.originalNode=at,$}toString(){return(0,i.generate)(this.originalNode)}}return closure.default=tt,closure}var hasRequiredStringify;function requireStringify(){if(hasRequiredStringify)return stringify$1;hasRequiredStringify=1,Object.defineProperty(stringify$1,"__esModule",{value:!0}),stringify$1.lineTreeToString=stringify$1.stringDagToSingleLine=stringify$1.stringDagToLineTree=stringify$1.valueToStringDag=stringify$1.typeToString=stringify$1.stringify=void 0;const i=constants,s=requireClosure(),o=requireOperators();function a(_){return typeof _.replPrefix=="string"&&typeof _.replSuffix=="string"&&typeof _.replArrayContents=="function"}const rt=(_,$=2,et=80)=>{if(_=(0,o.forceIt)(_),typeof $=="string")throw"stringify with arbitrary indent string not supported";let st=$;return $>10&&(st=10),j(nt(at(_),st,et))};stringify$1.stringify=rt;function tt(_){return ot(_)}stringify$1.typeToString=tt;function ot(_,$={_next:0}){function et(st){return ot(st,$)}switch(_.kind){case"primitive":return _.name;case"variable":return _.constraint&&_.constraint!=="none"?_.constraint:(_.name in $||($[_.name]="T"+$._next++),$[_.name]);case"list":return`List<${et(_.elementType)}>`;case"array":return`Array<${et(_.elementType)}>`;case"pair":const st=et(_.headType);return _.tailType.kind==="list"&&st===et(_.tailType.elementType)?`List<${st}>`:`[${et(_.headType)}, ${et(_.tailType)}]`;case"function":let lt=_.parameterTypes.map(et).join(", ");return(_.parameterTypes.length!==1||_.parameterTypes[0].kind==="function")&&(lt=`(${lt})`),`${lt} -> ${et(_.returnType)}`;default:return"Unable to infer type"}}function at(_){const $=new Map,et=new Map;function st(pt){const mt=et.get(pt);if(mt!==void 0)return[mt,!1];$.set(pt,$.size);const gt=pt,[dt,St]=ut(gt[0]),[xt,yt]=ut(gt[1]),_t=St||yt;$.delete(pt);const Ct={type:"pair",head:dt,tail:xt,length:dt.length+xt.length+4};return _t||et.set(pt,Ct),[Ct,_t]}function lt(pt,mt,gt,dt){const St=et.get(pt);if(St!==void 0)return[St,!1];$.set(pt,$.size);const xt=mt.map(ut);let yt=gt.length+dt.length+Math.max(0,xt.length-1)*2,_t=!1;for(let Et=0;EtEt[0]),prefix:gt,suffix:dt,length:yt};return _t||et.set(pt,Ct),[Ct,_t]}function ct(pt){const mt=et.get(pt);if(mt!==void 0)return[mt,!1];$.set(pt,$.size);const gt=Object.entries(pt),dt=gt.map(Ct=>ut(Ct[1]));let St=2+Math.max(0,gt.length-1)*2+gt.length*2,xt=!1;const yt=[];for(let Ct=0;Ct",length:13},!0];if(pt instanceof s.default)return ht(pt.toString());if(typeof pt=="string"){const mt=JSON.stringify(pt);return[{type:"terminal",str:mt,length:mt.length},!1]}else return typeof pt!="object"?ht(pt.toString()):$.size>i.MAX_LIST_DISPLAY_LENGTH?[{type:"terminal",str:"...",length:14},!1]:typeof pt.toReplString=="function"?ht(pt.toReplString()):Array.isArray(pt)?pt.length===2?st(pt):lt(pt,pt,"[","]"):a(pt)?lt(pt,pt.replArrayContents(),pt.replPrefix,pt.replSuffix):Object.getPrototypeOf(pt)===Object.prototype?ct(pt):ht(pt.toString())}return ut(_)[0]}stringify$1.valueToStringDag=at;function nt(_,$,et){const lt="["+" ".repeat(Math.max(0,$-1)),ct=new Map;function ht(ut){const pt=ct.get(ut);if(pt!==void 0)return pt;let mt;if(ut.type==="terminal")mt={type:"line",line:ut};else if(ut.type==="multiline")mt={type:"block",prefixFirst:"",prefixRest:"",block:ut.lines.map(gt=>({type:"line",line:{type:"terminal",str:gt,length:gt.length}})),suffixRest:"",suffixLast:""};else if(ut.type==="pair"){const gt=ht(ut.head),dt=ht(ut.tail);ut.length-2>et||gt.type!=="line"||dt.type!=="line"?mt={type:"block",prefixFirst:lt,prefixRest:"",block:[gt,dt],suffixRest:",",suffixLast:"]"}:mt={type:"line",line:ut}}else if(ut.type==="arraylike"){const gt=ut.elems.map(ht);ut.length-ut.prefix.length-ut.suffix.length>et||gt.some(dt=>dt.type!=="line")?mt={type:"block",prefixFirst:ut.prefix+" ".repeat(Math.max(0,$-ut.prefix.length)),prefixRest:" ".repeat(Math.max(ut.prefix.length,$)),block:gt,suffixRest:",",suffixLast:ut.suffix}:mt={type:"line",line:ut}}else if(ut.type==="kvpair"){const gt=ht(ut.value);ut.length>et||gt.type!=="line"?mt={type:"block",prefixFirst:"",prefixRest:"",block:[{type:"line",line:{type:"terminal",str:JSON.stringify(ut.key),length:0}},gt],suffixRest:":",suffixLast:""}:mt={type:"line",line:ut}}else throw"up";return ct.set(ut,mt),mt}return ht(_)}stringify$1.stringDagToLineTree=nt;function it(_){function $(et,st){if(et.type==="multiline")throw"Tried to format multiline string as single line string";if(et.type==="terminal")st.push(et.str);else if(et.type==="pair")st.push("["),$(et.head,st),st.push(", "),$(et.tail,st),st.push("]");else if(et.type==="kvpair")st.push(JSON.stringify(et.key)),st.push(": "),$(et.value,st);else if(et.type==="arraylike"){st.push(et.prefix),et.elems.length>0&&$(et.elems[0],st);for(let lt=1;lt(0,o.stringify)(dt.value));mt.write(gt.join(", ")),mt.write(")")}})}explain(){const ht=ut=>(0,i.generate)(ut,{generator:this.customGenerator});return`Maximum call stack size exceeded `+this.calls.map(ut=>ht(ut)+"..").join(" ")}elaborate(){return"TODO"}}errors.MaximumStackLimitExceeded=ot,ot.MAX_CALLS_TO_SHOW=3;class at extends a.RuntimeSourceError{constructor(ht,ut){super(ut),this.callee=ht,this.node=ut}explain(){return`Calling non-function value ${(0,o.stringify)(this.callee)}.`}elaborate(){const ht=this.callee,ut=(0,o.stringify)(ht);let pt="";pt=this.node.arguments.map(i.generate).join(", ");const gt=`Because ${ut} is not a function, you cannot run ${ut}(${pt}).`,dt=`If you were planning to perform multiplication by ${ut}, you need to use the * operator.`;return Number.isFinite(ht)?`${gt} ${dt}`:gt}}errors.CallingNonFunctionValue=at;class nt extends a.RuntimeSourceError{constructor(ht,ut){super(ut),this.name=ht}explain(){return`Name ${this.name} not declared.`}elaborate(){return`Before you can read the value of ${this.name}, you need to declare it as a variable or a constant. You can do this using the let or const keywords.`}}errors.UndefinedVariable=nt;class it extends a.RuntimeSourceError{constructor(ht,ut){super(ut),this.name=ht}explain(){return`Name ${this.name} declared later in current scope but not yet assigned`}elaborate(){return`If you're trying to access the value of ${this.name} from an outer scope, please rename the inner ${this.name}. An easy way to avoid this issue in future would be to avoid declaring any variables or constants with the name ${this.name} in the same scope.`}}errors.UnassignedVariable=it;class j extends a.RuntimeSourceError{constructor(ht,ut,pt,mt=!1){super(ht),this.expected=ut,this.got=pt,this.hasVarArgs=mt,this.calleeStr=(0,i.generate)(ht.callee)}explain(){return`Expected ${this.expected} ${this.hasVarArgs?"or more ":""}arguments, but got ${this.got}.`}elaborate(){const ht=this.calleeStr,ut=this.expected===1?"":"s";return`Try calling function ${ht} again, but with ${this.expected} argument${ut} instead. Remember that arguments are separated by a ',' (comma).`}}errors.InvalidNumberOfArguments=j;class _ extends a.RuntimeSourceError{constructor(ht,ut,pt){super(ht),this.node=ht,this.name=ut,this.writable=pt}explain(){return`Redeclaring name ${this.name}.`}elaborate(){if(this.writable===!0){const ht=`Since ${this.name} has already been declared, you can assign a value to it without re-declaring.`;let ut="";return this.node.type==="FunctionDeclaration"?ut="("+this.node.params.map(i.generate).join(",")+") => {...":this.node.type==="VariableDeclaration"&&(ut=(0,i.generate)(this.node.declarations[0].init)),`${ht} As such, you can just do ${this.name} = ${ut}; -`}else return this.writable===!1?`You will need to declare another variable, as ${this.name} is read-only.`:""}}errors.VariableRedeclaration=_;class $ extends a.RuntimeSourceError{constructor(ht,ut){super(ht),this.name=ut}explain(){return`Cannot assign new value to constant ${this.name}.`}elaborate(){return`As ${this.name} was declared as a constant, its value cannot be changed. You will have to declare a new variable.`}}errors.ConstAssignment=$;class tt extends a.RuntimeSourceError{constructor(ht,ut,pt){super(ht),this.obj=ut,this.prop=pt}explain(){return`Cannot read property ${this.prop} of ${(0,o.stringify)(this.obj)}.`}elaborate(){return"TODO"}}errors.GetPropertyError=tt;class st extends a.RuntimeSourceError{constructor(ht,ut,pt){super(ht),this.obj=ut,this.prop=pt,this.type=s.ErrorType.RUNTIME,this.severity=s.ErrorSeverity.ERROR,this.location=ht.loc}explain(){return`Cannot read inherited property ${this.prop} of ${(0,o.stringify)(this.obj)}.`}elaborate(){return"TODO"}}errors.GetInheritedPropertyError=st;class lt extends a.RuntimeSourceError{constructor(ht,ut,pt){super(ht),this.obj=ut,this.prop=pt}explain(){return`Cannot assign property ${this.prop} of ${(0,o.stringify)(this.obj)}.`}elaborate(){return"TODO"}}return errors.SetPropertyError=lt,errors}var hasRequiredSchedulers;function requireSchedulers(){if(hasRequiredSchedulers)return schedulers;hasRequiredSchedulers=1,Object.defineProperty(schedulers,"__esModule",{value:!0}),schedulers.PreemptiveScheduler=schedulers.NonDetScheduler=schedulers.AsyncScheduler=void 0;const i=requireErrors(),s=inspector;class o{run(at,nt){return new Promise((it,j)=>{nt.runtime.isRunning=!0;let _=at.next();try{for(;!_.done;)_=at.next(),nt.runtime.break&&((0,s.saveState)(nt,at,this),_.done=!0)}catch{it({status:"error"})}finally{nt.runtime.isRunning=!1}nt.runtime.break?it({status:"suspended",it:at,scheduler:this,context:nt}):it({status:"finished",context:nt,value:_.value})})}}schedulers.AsyncScheduler=o;class a{run(at,nt){return new Promise((it,j)=>{try{const _=at.next();_.done?it({status:"finished",context:nt,value:_.value}):it({status:"suspended-non-det",it:at,scheduler:this,context:nt,value:_.value})}catch(_){et(_,nt),it({status:"error"})}finally{nt.runtime.isRunning=!1}})}}schedulers.NonDetScheduler=a;class rt{constructor(at){this.steps=at}run(at,nt){return new Promise((it,j)=>{nt.runtime.isRunning=!0;let _=!1,$=at.next();const tt=setInterval(()=>{let st=0;try{for(;!$.done&&st{nt.runtime.isRunning=!0;let _=at.next();try{for(;!_.done;)_=at.next(),nt.runtime.break&&((0,s.saveState)(nt,at,this),_.done=!0)}catch{it({status:"error"})}finally{nt.runtime.isRunning=!1}nt.runtime.break?it({status:"suspended",it:at,scheduler:this,context:nt}):it({status:"finished",context:nt,value:_.value})})}}schedulers.AsyncScheduler=o;class a{run(at,nt){return new Promise((it,j)=>{try{const _=at.next();_.done?it({status:"finished",context:nt,value:_.value}):it({status:"suspended-non-det",it:at,scheduler:this,context:nt,value:_.value})}catch(_){tt(_,nt),it({status:"error"})}finally{nt.runtime.isRunning=!1}})}}schedulers.NonDetScheduler=a;class rt{constructor(at){this.steps=at}run(at,nt){return new Promise((it,j)=>{nt.runtime.isRunning=!0;let _=!1,$=at.next();const et=setInterval(()=>{let st=0;try{for(;!$.done&&st=0;ct-=1)lt=o(st[ct],lt);return lt}list$1.list=at;function nt(st){for(;a(st);)st=et(st);return ot(st)}list$1.is_list=nt;function it(st){const lt=[];for(;!ot(st);)lt.push(rt(st)),st=et(st);return lt}list$1.list_to_vector=it;function j(st){return at(...st)}list$1.vector_to_list=j;function _(st,lt){if(a(st)){st[0]=lt;return}else throw new Error("set_head(xs,x) expects a pair as argument xs, but encountered "+(0,i.stringify)(st))}list$1.set_head=_;function $(st,lt){if(a(st)){st[1]=lt;return}else throw new Error("set_tail(xs,x) expects a pair as argument xs, but encountered "+(0,i.stringify)(st))}list$1.set_tail=$;function tt(st,lt,ct){const ht=new Set,ut=new Map;class pt{constructor(xt){this.replPrefix="list(",this.replSuffix=")",this.listNode=xt}replArrayContents(){const xt=[];let yt=this.listNode;for(;yt!==null;)xt.push(rt(yt)),yt=et(yt);return xt}}function mt(St){return ut.get(St)||St}const gt=[];let dt=0;for(gt.push(lt);dt0;){const St=gt.pop();if(!a(St))continue;const xt=rt(St),yt=et(St),_t=mt(yt),Ct=ot(_t)||_t instanceof pt?new pt(o(xt,yt)):o(xt,yt);ut.set(St,Ct)}for(const St of ut.values())if(a(St))_(St,mt(rt(St))),$(St,mt(et(St)));else if(St instanceof pt){_(St.listNode,mt(rt(St.listNode)));let xt=mt(et(St.listNode));xt instanceof pt&&(xt=xt.listNode),$(St.listNode,xt)}return st(mt(lt),ct),lt}return list$1.rawDisplayList=tt,list$1}var list_prelude={};Object.defineProperty(list_prelude,"__esModule",{value:!0});list_prelude.listPrelude=void 0;list_prelude.listPrelude=` +`;var list$1={},hasRequiredList;function requireList(){if(hasRequiredList)return list$1;hasRequiredList=1,Object.defineProperty(list$1,"__esModule",{value:!0}),list$1.rawDisplayList=list$1.set_tail=list$1.set_head=list$1.vector_to_list=list$1.list_to_vector=list$1.is_list=list$1.list=list$1.is_null=list$1.tail=list$1.head=list$1.is_pair=list$1.pair=void 0;const i=requireStringify();function s(st){return Array.isArray===void 0?st instanceof Array:Array.isArray(st)}function o(st,lt){return[st,lt]}list$1.pair=o;function a(st){return s(st)&&st.length===2}list$1.is_pair=a;function rt(st){if(a(st))return st[0];throw new Error("head(xs) expects a pair as argument xs, but encountered "+(0,i.stringify)(st))}list$1.head=rt;function tt(st){if(a(st))return st[1];throw new Error("tail(xs) expects a pair as argument xs, but encountered "+(0,i.stringify)(st))}list$1.tail=tt;function ot(st){return st===null}list$1.is_null=ot;function at(...st){let lt=null;for(let ct=st.length-1;ct>=0;ct-=1)lt=o(st[ct],lt);return lt}list$1.list=at;function nt(st){for(;a(st);)st=tt(st);return ot(st)}list$1.is_list=nt;function it(st){const lt=[];for(;!ot(st);)lt.push(rt(st)),st=tt(st);return lt}list$1.list_to_vector=it;function j(st){return at(...st)}list$1.vector_to_list=j;function _(st,lt){if(a(st)){st[0]=lt;return}else throw new Error("set_head(xs,x) expects a pair as argument xs, but encountered "+(0,i.stringify)(st))}list$1.set_head=_;function $(st,lt){if(a(st)){st[1]=lt;return}else throw new Error("set_tail(xs,x) expects a pair as argument xs, but encountered "+(0,i.stringify)(st))}list$1.set_tail=$;function et(st,lt,ct){const ht=new Set,ut=new Map;class pt{constructor(xt){this.replPrefix="list(",this.replSuffix=")",this.listNode=xt}replArrayContents(){const xt=[];let yt=this.listNode;for(;yt!==null;)xt.push(rt(yt)),yt=tt(yt);return xt}}function mt(St){return ut.get(St)||St}const gt=[];let dt=0;for(gt.push(lt);dt0;){const St=gt.pop();if(!a(St))continue;const xt=rt(St),yt=tt(St),_t=mt(yt),Ct=ot(_t)||_t instanceof pt?new pt(o(xt,yt)):o(xt,yt);ut.set(St,Ct)}for(const St of ut.values())if(a(St))_(St,mt(rt(St))),$(St,mt(tt(St)));else if(St instanceof pt){_(St.listNode,mt(rt(St.listNode)));let xt=mt(tt(St.listNode));xt instanceof pt&&(xt=xt.listNode),$(St.listNode,xt)}return st(mt(lt),ct),lt}return list$1.rawDisplayList=et,list$1}var list_prelude={};Object.defineProperty(list_prelude,"__esModule",{value:!0});list_prelude.listPrelude=void 0;list_prelude.listPrelude=` // equal computes the structural equality // over its arguments @@ -3603,7 +3603,7 @@ function $accumulate(f, initial, xs, cont) { function accumulate(f, initial, xs) { return $accumulate(f, initial, xs, x => x); } -`;var misc={},hasRequiredMisc;function requireMisc(){if(hasRequiredMisc)return misc;hasRequiredMisc=1,Object.defineProperty(misc,"__esModule",{value:!0}),misc.get_time=misc.arity=misc.char_at=misc.parse_int=misc.array_length=misc.is_array=misc.has_own_property=misc.is_NaN=misc.is_function=misc.is_object=misc.is_boolean=misc.is_string=misc.is_undefined=misc.is_number=misc.timed=misc.error_message=misc.rawDisplay=void 0;const i=requireClosure(),s=requireStringify();function o(pt,mt,gt){return console.log((mt===void 0?"":mt+" ")+pt.toString()),pt}misc.rawDisplay=o;function a(pt,...mt){const gt=(mt[0]===void 0?"":mt[0]+" ")+(0,s.stringify)(pt);throw new Error(gt)}misc.error_message=a;function rt(pt,mt,gt,dt){return(...St)=>{const xt=ut(),yt=mt(...St),_t=ut()-xt;return dt("Duration: "+Math.round(_t)+"ms","",gt),yt}}misc.timed=rt;function et(pt){return typeof pt=="number"}misc.is_number=et;function ot(pt){return typeof pt>"u"}misc.is_undefined=ot;function at(pt){return typeof pt=="string"}misc.is_string=at;function nt(pt){return typeof pt=="boolean"}misc.is_boolean=nt;function it(pt){return typeof pt=="object"||j(pt)}misc.is_object=it;function j(pt){return typeof pt=="function"}misc.is_function=j;function _(pt){return et(pt)&&isNaN(pt)}misc.is_NaN=_;function $(pt,mt){return pt.hasOwnProperty(mt)}misc.has_own_property=$;function tt(pt){return pt instanceof Array}misc.is_array=tt;function st(pt){return pt.length}misc.array_length=st;function lt(pt,mt){if(typeof pt=="string"&&typeof mt=="number"&&Number.isInteger(mt)&&2<=mt&&mt<=36)return parseInt(pt,mt);throw new Error("parse_int expects two arguments a string s, and a positive integer i between 2 and 36, inclusive.")}misc.parse_int=lt;function ct(pt,mt){if(typeof pt!="string")throw new Error("char_at expects the first argument to be a string.");if(typeof mt!="number"||!Number.isInteger(mt)||mt<0)throw new Error("char_at expects the second argument to be a nonnegative integer.");return pt[mt]}misc.char_at=ct;function ht(pt){var mt;if(pt instanceof i.default){const gt=pt.node.params;return((mt=gt[gt.length-1])===null||mt===void 0?void 0:mt.type)==="RestElement"?gt.length-1:gt.length}else{if(typeof pt=="function")return pt.length;throw new Error("arity expects a function as argument")}}misc.arity=ht;function ut(){return new Date().getTime()}return misc.get_time=ut,misc}var nonDet_prelude={};Object.defineProperty(nonDet_prelude,"__esModule",{value:!0});nonDet_prelude.nonDetPrelude=void 0;nonDet_prelude.nonDetPrelude=` +`;var misc={},hasRequiredMisc;function requireMisc(){if(hasRequiredMisc)return misc;hasRequiredMisc=1,Object.defineProperty(misc,"__esModule",{value:!0}),misc.get_time=misc.arity=misc.char_at=misc.parse_int=misc.array_length=misc.is_array=misc.has_own_property=misc.is_NaN=misc.is_function=misc.is_object=misc.is_boolean=misc.is_string=misc.is_undefined=misc.is_number=misc.timed=misc.error_message=misc.rawDisplay=void 0;const i=requireClosure(),s=requireStringify();function o(pt,mt,gt){return console.log((mt===void 0?"":mt+" ")+pt.toString()),pt}misc.rawDisplay=o;function a(pt,...mt){const gt=(mt[0]===void 0?"":mt[0]+" ")+(0,s.stringify)(pt);throw new Error(gt)}misc.error_message=a;function rt(pt,mt,gt,dt){return(...St)=>{const xt=ut(),yt=mt(...St),_t=ut()-xt;return dt("Duration: "+Math.round(_t)+"ms","",gt),yt}}misc.timed=rt;function tt(pt){return typeof pt=="number"}misc.is_number=tt;function ot(pt){return typeof pt>"u"}misc.is_undefined=ot;function at(pt){return typeof pt=="string"}misc.is_string=at;function nt(pt){return typeof pt=="boolean"}misc.is_boolean=nt;function it(pt){return typeof pt=="object"||j(pt)}misc.is_object=it;function j(pt){return typeof pt=="function"}misc.is_function=j;function _(pt){return tt(pt)&&isNaN(pt)}misc.is_NaN=_;function $(pt,mt){return pt.hasOwnProperty(mt)}misc.has_own_property=$;function et(pt){return pt instanceof Array}misc.is_array=et;function st(pt){return pt.length}misc.array_length=st;function lt(pt,mt){if(typeof pt=="string"&&typeof mt=="number"&&Number.isInteger(mt)&&2<=mt&&mt<=36)return parseInt(pt,mt);throw new Error("parse_int expects two arguments a string s, and a positive integer i between 2 and 36, inclusive.")}misc.parse_int=lt;function ct(pt,mt){if(typeof pt!="string")throw new Error("char_at expects the first argument to be a string.");if(typeof mt!="number"||!Number.isInteger(mt)||mt<0)throw new Error("char_at expects the second argument to be a nonnegative integer.");return pt[mt]}misc.char_at=ct;function ht(pt){var mt;if(pt instanceof i.default){const gt=pt.node.params;return((mt=gt[gt.length-1])===null||mt===void 0?void 0:mt.type)==="RestElement"?gt.length-1:gt.length}else{if(typeof pt=="function")return pt.length;throw new Error("arity expects a function as argument")}}misc.arity=ht;function ut(){return new Date().getTime()}return misc.get_time=ut,misc}var nonDet_prelude={};Object.defineProperty(nonDet_prelude,"__esModule",{value:!0});nonDet_prelude.nonDetPrelude=void 0;nonDet_prelude.nonDetPrelude=` function require(predicate) { return predicate ? "Satisfied require" : amb(); } @@ -3630,8 +3630,8 @@ function accumulate(f, initial, xs) { function bi_implication(P, Q) { return implication(P, Q) && implication(Q, P); } -`;var parser$1={},parser={},acornLoose={exports:{}};(function(i,s){(function(o,a){a(s,acornExports)})(commonjsGlobal,function(o,a){var rt="✖";function et(tt){return tt.name===rt}function ot(){}var at=function(st,lt){if(lt===void 0&&(lt={}),this.toks=this.constructor.BaseParser.tokenizer(st,lt),this.options=this.toks.options,this.input=this.toks.input,this.tok=this.last={type:a.tokTypes.eof,start:0,end:0},this.tok.validateRegExpFlags=ot,this.tok.validateRegExpPattern=ot,this.options.locations){var ct=this.toks.curPosition();this.tok.loc=new a.SourceLocation(this.toks,ct,ct)}this.ahead=[],this.context=[],this.curIndent=0,this.curLineStart=0,this.nextLineStart=this.lineEnd(this.curLineStart)+1,this.inAsync=!1,this.inGenerator=!1,this.inFunction=!1};at.prototype.startNode=function(){return new a.Node(this.toks,this.tok.start,this.options.locations?this.tok.loc.start:null)},at.prototype.storeCurrentPos=function(){return this.options.locations?[this.tok.start,this.tok.loc.start]:this.tok.start},at.prototype.startNodeAt=function(st){return this.options.locations?new a.Node(this.toks,st[0],st[1]):new a.Node(this.toks,st)},at.prototype.finishNode=function(st,lt){return st.type=lt,st.end=this.last.end,this.options.locations&&(st.loc.end=this.last.loc.end),this.options.ranges&&(st.range[1]=this.last.end),st},at.prototype.dummyNode=function(st){var lt=this.startNode();return lt.type=st,lt.end=lt.start,this.options.locations&&(lt.loc.end=lt.loc.start),this.options.ranges&&(lt.range[1]=lt.start),this.last={type:a.tokTypes.name,start:lt.start,end:lt.start,loc:lt.loc},lt},at.prototype.dummyIdent=function(){var st=this.dummyNode("Identifier");return st.name=rt,st},at.prototype.dummyString=function(){var st=this.dummyNode("Literal");return st.value=st.raw=rt,st},at.prototype.eat=function(st){return this.tok.type===st?(this.next(),!0):!1},at.prototype.isContextual=function(st){return this.tok.type===a.tokTypes.name&&this.tok.value===st},at.prototype.eatContextual=function(st){return this.tok.value===st&&this.eat(a.tokTypes.name)},at.prototype.canInsertSemicolon=function(){return this.tok.type===a.tokTypes.eof||this.tok.type===a.tokTypes.braceR||a.lineBreak.test(this.input.slice(this.last.end,this.tok.start))},at.prototype.semicolon=function(){return this.eat(a.tokTypes.semi)},at.prototype.expect=function(st){if(this.eat(st))return!0;for(var lt=1;lt<=2;lt++)if(this.lookAhead(lt).type===st){for(var ct=0;ct=this.input.length||this.indentationAfter(this.nextLineStart)=this.curLineStart;--st){var lt=this.input.charCodeAt(st);if(lt!==9&<!==32)return!1}return!0},at.prototype.extend=function(st,lt){this[st]=lt(this[st])},at.prototype.parse=function(){return this.next(),this.parseTopLevel()},at.extend=function(){for(var st=[],lt=arguments.length;lt--;)st[lt]=arguments[lt];for(var ct=this,ht=0;ht8||tt===32||tt===160||a.isNewLine(tt)}nt.next=function(){if(this.last=this.tok,this.ahead.length?this.tok=this.ahead.shift():this.tok=this.readToken(),this.tok.start>=this.nextLineStart){for(;this.tok.start>=this.nextLineStart;)this.curLineStart=this.nextLineStart,this.nextLineStart=this.lineEnd(this.curLineStart)+1;this.curIndent=this.indentationAfter(this.curLineStart)}},nt.readToken=function(){for(;;)try{return this.toks.next(),this.toks.type===a.tokTypes.dot&&this.input.substr(this.toks.end,1)==="."&&this.options.ecmaVersion>=6&&(this.toks.end++,this.toks.type=a.tokTypes.ellipsis),new a.Token(this.toks)}catch(ut){if(!(ut instanceof SyntaxError))throw ut;var tt=ut.message,st=ut.raisedAt,lt=!0;if(/unterminated/i.test(tt))if(st=this.lineEnd(ut.pos+1),/string/.test(tt))lt={start:ut.pos,end:st,type:a.tokTypes.string,value:this.input.slice(ut.pos+1,st)};else if(/regular expr/i.test(tt)){var ct=this.input.slice(ut.pos,st);try{ct=new RegExp(ct)}catch{}lt={start:ut.pos,end:st,type:a.tokTypes.regexp,value:ct}}else/template/.test(tt)?lt={start:ut.pos,end:st,type:a.tokTypes.template,value:this.input.slice(ut.pos,st)}:lt=!1;else if(/invalid (unicode|regexp|number)|expecting unicode|octal literal|is reserved|directly after number|expected number in radix/i.test(tt))for(;st]/.test(st)||/[enwfd]/.test(st)&&/\b(case|else|return|throw|new|in|(instance|type)?of|delete|void)$/.test(this.input.slice(tt-10,tt)),this.options.locations){this.toks.curLine=1,this.toks.lineStart=a.lineBreakG.lastIndex=0;for(var lt;(lt=a.lineBreakG.exec(this.input))&<.indexthis.ahead.length;)this.ahead.push(this.readToken());return this.ahead[tt-1]};var j=at.prototype;j.parseTopLevel=function(){var tt=this.startNodeAt(this.options.locations?[0,a.getLineInfo(this.input,0)]:0);for(tt.body=[];this.tok.type!==a.tokTypes.eof;)tt.body.push(this.parseStatement());return this.toks.adaptDirectivePrologue(tt.body),this.last=this.tok,tt.sourceType=this.options.sourceType,this.finishNode(tt,"Program")},j.parseStatement=function(){var tt=this.tok.type,st=this.startNode(),lt;switch(this.toks.isLet()&&(tt=a.tokTypes._var,lt="let"),tt){case a.tokTypes._break:case a.tokTypes._continue:this.next();var ct=tt===a.tokTypes._break;return this.semicolon()||this.canInsertSemicolon()?st.label=null:(st.label=this.tok.type===a.tokTypes.name?this.parseIdent():null,this.semicolon()),this.finishNode(st,ct?"BreakStatement":"ContinueStatement");case a.tokTypes._debugger:return this.next(),this.semicolon(),this.finishNode(st,"DebuggerStatement");case a.tokTypes._do:return this.next(),st.body=this.parseStatement(),st.test=this.eat(a.tokTypes._while)?this.parseParenExpression():this.dummyIdent(),this.semicolon(),this.finishNode(st,"DoWhileStatement");case a.tokTypes._for:this.next();var ht=this.options.ecmaVersion>=9&&this.eatContextual("await");if(this.pushCx(),this.expect(a.tokTypes.parenL),this.tok.type===a.tokTypes.semi)return this.parseFor(st,null);var ut=this.toks.isLet();if(ut||this.tok.type===a.tokTypes._var||this.tok.type===a.tokTypes._const){var pt=this.parseVar(this.startNode(),!0,ut?"let":this.tok.value);return pt.declarations.length===1&&(this.tok.type===a.tokTypes._in||this.isContextual("of"))?(this.options.ecmaVersion>=9&&this.tok.type!==a.tokTypes._in&&(st.await=ht),this.parseForIn(st,pt)):this.parseFor(st,pt)}var mt=this.parseExpression(!0);return this.tok.type===a.tokTypes._in||this.isContextual("of")?(this.options.ecmaVersion>=9&&this.tok.type!==a.tokTypes._in&&(st.await=ht),this.parseForIn(st,this.toAssignable(mt))):this.parseFor(st,mt);case a.tokTypes._function:return this.next(),this.parseFunction(st,!0);case a.tokTypes._if:return this.next(),st.test=this.parseParenExpression(),st.consequent=this.parseStatement(),st.alternate=this.eat(a.tokTypes._else)?this.parseStatement():null,this.finishNode(st,"IfStatement");case a.tokTypes._return:return this.next(),this.eat(a.tokTypes.semi)||this.canInsertSemicolon()?st.argument=null:(st.argument=this.parseExpression(),this.semicolon()),this.finishNode(st,"ReturnStatement");case a.tokTypes._switch:var gt=this.curIndent,dt=this.curLineStart;this.next(),st.discriminant=this.parseParenExpression(),st.cases=[],this.pushCx(),this.expect(a.tokTypes.braceL);for(var St;!this.closes(a.tokTypes.braceR,gt,dt,!0);)if(this.tok.type===a.tokTypes._case||this.tok.type===a.tokTypes._default){var xt=this.tok.type===a.tokTypes._case;St&&this.finishNode(St,"SwitchCase"),st.cases.push(St=this.startNode()),St.consequent=[],this.next(),xt?St.test=this.parseExpression():St.test=null,this.expect(a.tokTypes.colon)}else St||(st.cases.push(St=this.startNode()),St.consequent=[],St.test=null),St.consequent.push(this.parseStatement());return St&&this.finishNode(St,"SwitchCase"),this.popCx(),this.eat(a.tokTypes.braceR),this.finishNode(st,"SwitchStatement");case a.tokTypes._throw:return this.next(),st.argument=this.parseExpression(),this.semicolon(),this.finishNode(st,"ThrowStatement");case a.tokTypes._try:if(this.next(),st.block=this.parseBlock(),st.handler=null,this.tok.type===a.tokTypes._catch){var yt=this.startNode();this.next(),this.eat(a.tokTypes.parenL)?(yt.param=this.toAssignable(this.parseExprAtom(),!0),this.expect(a.tokTypes.parenR)):yt.param=null,yt.body=this.parseBlock(),st.handler=this.finishNode(yt,"CatchClause")}return st.finalizer=this.eat(a.tokTypes._finally)?this.parseBlock():null,!st.handler&&!st.finalizer?st.block:this.finishNode(st,"TryStatement");case a.tokTypes._var:case a.tokTypes._const:return this.parseVar(st,!1,lt||this.tok.value);case a.tokTypes._while:return this.next(),st.test=this.parseParenExpression(),st.body=this.parseStatement(),this.finishNode(st,"WhileStatement");case a.tokTypes._with:return this.next(),st.object=this.parseParenExpression(),st.body=this.parseStatement(),this.finishNode(st,"WithStatement");case a.tokTypes.braceL:return this.parseBlock();case a.tokTypes.semi:return this.next(),this.finishNode(st,"EmptyStatement");case a.tokTypes._class:return this.parseClass(!0);case a.tokTypes._import:if(this.options.ecmaVersion>10){var _t=this.lookAhead(1).type;if(_t===a.tokTypes.parenL||_t===a.tokTypes.dot)return st.expression=this.parseExpression(),this.semicolon(),this.finishNode(st,"ExpressionStatement")}return this.parseImport();case a.tokTypes._export:return this.parseExport();default:if(this.toks.isAsyncFunction())return this.next(),this.next(),this.parseFunction(st,!0,!0);var Ct=this.parseExpression();return et(Ct)?(this.next(),this.tok.type===a.tokTypes.eof?this.finishNode(st,"EmptyStatement"):this.parseStatement()):tt===a.tokTypes.name&&Ct.type==="Identifier"&&this.eat(a.tokTypes.colon)?(st.body=this.parseStatement(),st.label=Ct,this.finishNode(st,"LabeledStatement")):(st.expression=Ct,this.semicolon(),this.finishNode(st,"ExpressionStatement"))}},j.parseBlock=function(){var tt=this.startNode();this.pushCx(),this.expect(a.tokTypes.braceL);var st=this.curIndent,lt=this.curLineStart;for(tt.body=[];!this.closes(a.tokTypes.braceR,st,lt,!0);)tt.body.push(this.parseStatement());return this.popCx(),this.eat(a.tokTypes.braceR),this.finishNode(tt,"BlockStatement")},j.parseFor=function(tt,st){return tt.init=st,tt.test=tt.update=null,this.eat(a.tokTypes.semi)&&this.tok.type!==a.tokTypes.semi&&(tt.test=this.parseExpression()),this.eat(a.tokTypes.semi)&&this.tok.type!==a.tokTypes.parenR&&(tt.update=this.parseExpression()),this.popCx(),this.expect(a.tokTypes.parenR),tt.body=this.parseStatement(),this.finishNode(tt,"ForStatement")},j.parseForIn=function(tt,st){var lt=this.tok.type===a.tokTypes._in?"ForInStatement":"ForOfStatement";return this.next(),tt.left=st,tt.right=this.parseExpression(),this.popCx(),this.expect(a.tokTypes.parenR),tt.body=this.parseStatement(),this.finishNode(tt,lt)},j.parseVar=function(tt,st,lt){tt.kind=lt,this.next(),tt.declarations=[];do{var ct=this.startNode();ct.id=this.options.ecmaVersion>=6?this.toAssignable(this.parseExprAtom(),!0):this.parseIdent(),ct.init=this.eat(a.tokTypes.eq)?this.parseMaybeAssign(st):null,tt.declarations.push(this.finishNode(ct,"VariableDeclarator"))}while(this.eat(a.tokTypes.comma));if(!tt.declarations.length){var ht=this.startNode();ht.id=this.dummyIdent(),tt.declarations.push(this.finishNode(ht,"VariableDeclarator"))}return st||this.semicolon(),this.finishNode(tt,"VariableDeclaration")},j.parseClass=function(tt){var st=this.startNode();this.next(),this.tok.type===a.tokTypes.name?st.id=this.parseIdent():tt===!0?st.id=this.dummyIdent():st.id=null,st.superClass=this.eat(a.tokTypes._extends)?this.parseExpression():null,st.body=this.startNode(),st.body.body=[],this.pushCx();var lt=this.curIndent+1,ct=this.curLineStart;for(this.eat(a.tokTypes.braceL),this.curIndent+1=13&&this.eat(a.tokTypes.braceL))return this.parseClassStaticBlock(ut),ut;this.isClassElementNameStart()||this.toks.type===a.tokTypes.star?St=!0:pt="static"}if(ut.static=St,!pt&&st>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.toks.type===a.tokTypes.star)&&!this.canInsertSemicolon()?gt=!0:pt="async"),!pt){mt=this.eat(a.tokTypes.star);var xt=this.toks.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?dt=xt:pt=xt)}if(pt)ut.computed=!1,ut.key=this.startNodeAt(lt?[this.toks.lastTokStart,this.toks.lastTokStartLoc]:this.toks.lastTokStart),ut.key.name=pt,this.finishNode(ut.key,"Identifier");else if(this.parseClassElementName(ut),et(ut.key))return et(this.parseMaybeAssign())&&this.next(),this.eat(a.tokTypes.comma),null;if(st<13||this.toks.type===a.tokTypes.parenL||dt!=="method"||mt||gt){var yt=!ut.computed&&!ut.static&&!mt&&!gt&&dt==="method"&&(ut.key.type==="Identifier"&&ut.key.name==="constructor"||ut.key.type==="Literal"&&ut.key.value==="constructor");ut.kind=yt?"constructor":dt,ut.value=this.parseMethod(mt,gt),this.finishNode(ut,"MethodDefinition")}else{if(this.eat(a.tokTypes.eq))if(this.curLineStart!==ht&&this.curIndent<=ct&&this.tokenStartsLine())ut.value=null;else{var _t=this.inAsync,Ct=this.inGenerator;this.inAsync=!1,this.inGenerator=!1,ut.value=this.parseMaybeAssign(),this.inAsync=_t,this.inGenerator=Ct}else ut.value=null;this.semicolon(),this.finishNode(ut,"PropertyDefinition")}return ut},j.parseClassStaticBlock=function(tt){var st=this.curIndent,lt=this.curLineStart;for(tt.body=[],this.pushCx();!this.closes(a.tokTypes.braceR,st,lt,!0);)tt.body.push(this.parseStatement());return this.popCx(),this.eat(a.tokTypes.braceR),this.finishNode(tt,"StaticBlock")},j.isClassElementNameStart=function(){return this.toks.isClassElementNameStart()},j.parseClassElementName=function(tt){this.toks.type===a.tokTypes.privateId?(tt.computed=!1,tt.key=this.parsePrivateIdent()):this.parsePropertyName(tt)},j.parseFunction=function(tt,st,lt){var ct=this.inAsync,ht=this.inGenerator,ut=this.inFunction;return this.initFunction(tt),this.options.ecmaVersion>=6&&(tt.generator=this.eat(a.tokTypes.star)),this.options.ecmaVersion>=8&&(tt.async=!!lt),this.tok.type===a.tokTypes.name?tt.id=this.parseIdent():st===!0&&(tt.id=this.dummyIdent()),this.inAsync=tt.async,this.inGenerator=tt.generator,this.inFunction=!0,tt.params=this.parseFunctionParams(),tt.body=this.parseBlock(),this.toks.adaptDirectivePrologue(tt.body.body),this.inAsync=ct,this.inGenerator=ht,this.inFunction=ut,this.finishNode(tt,st?"FunctionDeclaration":"FunctionExpression")},j.parseExport=function(){var tt=this.startNode();if(this.next(),this.eat(a.tokTypes.star))return this.options.ecmaVersion>=11&&(this.eatContextual("as")?tt.exported=this.parseExprAtom():tt.exported=null),tt.source=this.eatContextual("from")?this.parseExprAtom():this.dummyString(),this.semicolon(),this.finishNode(tt,"ExportAllDeclaration");if(this.eat(a.tokTypes._default)){var st;if(this.tok.type===a.tokTypes._function||(st=this.toks.isAsyncFunction())){var lt=this.startNode();this.next(),st&&this.next(),tt.declaration=this.parseFunction(lt,"nullableID",st)}else this.tok.type===a.tokTypes._class?tt.declaration=this.parseClass("nullableID"):(tt.declaration=this.parseMaybeAssign(),this.semicolon());return this.finishNode(tt,"ExportDefaultDeclaration")}return this.tok.type.keyword||this.toks.isLet()||this.toks.isAsyncFunction()?(tt.declaration=this.parseStatement(),tt.specifiers=[],tt.source=null):(tt.declaration=null,tt.specifiers=this.parseExportSpecifierList(),tt.source=this.eatContextual("from")?this.parseExprAtom():null,this.semicolon()),this.finishNode(tt,"ExportNamedDeclaration")},j.parseImport=function(){var tt=this.startNode();if(this.next(),this.tok.type===a.tokTypes.string)tt.specifiers=[],tt.source=this.parseExprAtom();else{var st;this.tok.type===a.tokTypes.name&&this.tok.value!=="from"&&(st=this.startNode(),st.local=this.parseIdent(),this.finishNode(st,"ImportDefaultSpecifier"),this.eat(a.tokTypes.comma)),tt.specifiers=this.parseImportSpecifiers(),tt.source=this.eatContextual("from")&&this.tok.type===a.tokTypes.string?this.parseExprAtom():this.dummyString(),st&&tt.specifiers.unshift(st)}return this.semicolon(),this.finishNode(tt,"ImportDeclaration")},j.parseImportSpecifiers=function(){var tt=[];if(this.tok.type===a.tokTypes.star){var st=this.startNode();this.next(),st.local=this.eatContextual("as")?this.parseIdent():this.dummyIdent(),tt.push(this.finishNode(st,"ImportNamespaceSpecifier"))}else{var lt=this.curIndent,ct=this.curLineStart,ht=this.nextLineStart;for(this.pushCx(),this.eat(a.tokTypes.braceL),this.curLineStart>ht&&(ht=this.curLineStart);!this.closes(a.tokTypes.braceR,lt+(this.curLineStart<=ht?1:0),ct);){var ut=this.startNode();if(this.eat(a.tokTypes.star))ut.local=this.eatContextual("as")?this.parseModuleExportName():this.dummyIdent(),this.finishNode(ut,"ImportNamespaceSpecifier");else{if(this.isContextual("from")||(ut.imported=this.parseModuleExportName(),et(ut.imported)))break;ut.local=this.eatContextual("as")?this.parseModuleExportName():ut.imported,this.finishNode(ut,"ImportSpecifier")}tt.push(ut),this.eat(a.tokTypes.comma)}this.eat(a.tokTypes.braceR),this.popCx()}return tt},j.parseExportSpecifierList=function(){var tt=[],st=this.curIndent,lt=this.curLineStart,ct=this.nextLineStart;for(this.pushCx(),this.eat(a.tokTypes.braceL),this.curLineStart>ct&&(ct=this.curLineStart);!this.closes(a.tokTypes.braceR,st+(this.curLineStart<=ct?1:0),lt)&&!this.isContextual("from");){var ht=this.startNode();if(ht.local=this.parseModuleExportName(),et(ht.local))break;ht.exported=this.eatContextual("as")?this.parseModuleExportName():ht.local,this.finishNode(ht,"ExportSpecifier"),tt.push(ht),this.eat(a.tokTypes.comma)}return this.eat(a.tokTypes.braceR),this.popCx(),tt},j.parseModuleExportName=function(){return this.options.ecmaVersion>=13&&this.tok.type===a.tokTypes.string?this.parseExprAtom():this.parseIdent()};var _=at.prototype;_.checkLVal=function(tt){if(!tt)return tt;switch(tt.type){case"Identifier":case"MemberExpression":return tt;case"ParenthesizedExpression":return tt.expression=this.checkLVal(tt.expression),tt;default:return this.dummyIdent()}},_.parseExpression=function(tt){var st=this.storeCurrentPos(),lt=this.parseMaybeAssign(tt);if(this.tok.type===a.tokTypes.comma){var ct=this.startNodeAt(st);for(ct.expressions=[lt];this.eat(a.tokTypes.comma);)ct.expressions.push(this.parseMaybeAssign(tt));return this.finishNode(ct,"SequenceExpression")}return lt},_.parseParenExpression=function(){this.pushCx(),this.expect(a.tokTypes.parenL);var tt=this.parseExpression();return this.popCx(),this.expect(a.tokTypes.parenR),tt},_.parseMaybeAssign=function(tt){if(this.inGenerator&&this.toks.isContextual("yield")){var st=this.startNode();return this.next(),this.semicolon()||this.canInsertSemicolon()||this.tok.type!==a.tokTypes.star&&!this.tok.type.startsExpr?(st.delegate=!1,st.argument=null):(st.delegate=this.eat(a.tokTypes.star),st.argument=this.parseMaybeAssign()),this.finishNode(st,"YieldExpression")}var lt=this.storeCurrentPos(),ct=this.parseMaybeConditional(tt);if(this.tok.type.isAssign){var ht=this.startNodeAt(lt);return ht.operator=this.tok.value,ht.left=this.tok.type===a.tokTypes.eq?this.toAssignable(ct):this.checkLVal(ct),this.next(),ht.right=this.parseMaybeAssign(tt),this.finishNode(ht,"AssignmentExpression")}return ct},_.parseMaybeConditional=function(tt){var st=this.storeCurrentPos(),lt=this.parseExprOps(tt);if(this.eat(a.tokTypes.question)){var ct=this.startNodeAt(st);return ct.test=lt,ct.consequent=this.parseMaybeAssign(),ct.alternate=this.expect(a.tokTypes.colon)?this.parseMaybeAssign(tt):this.dummyIdent(),this.finishNode(ct,"ConditionalExpression")}return lt},_.parseExprOps=function(tt){var st=this.storeCurrentPos(),lt=this.curIndent,ct=this.curLineStart;return this.parseExprOp(this.parseMaybeUnary(!1),st,-1,tt,lt,ct)},_.parseExprOp=function(tt,st,lt,ct,ht,ut){if(this.curLineStart!==ut&&this.curIndentlt){var mt=this.startNodeAt(st);if(mt.left=tt,mt.operator=this.tok.value,this.next(),this.curLineStart!==ut&&this.curIndent=8&&this.toks.isContextual("await")&&(this.inAsync||this.toks.inModule&&this.options.ecmaVersion>=13||!this.inFunction&&this.options.allowAwaitOutsideFunction))lt=this.parseAwait(),tt=!0;else if(this.tok.type.prefix){var ct=this.startNode(),ht=this.tok.type===a.tokTypes.incDec;ht||(tt=!0),ct.operator=this.tok.value,ct.prefix=!0,this.next(),ct.argument=this.parseMaybeUnary(!0),ht&&(ct.argument=this.checkLVal(ct.argument)),lt=this.finishNode(ct,ht?"UpdateExpression":"UnaryExpression")}else if(this.tok.type===a.tokTypes.ellipsis){var ut=this.startNode();this.next(),ut.argument=this.parseMaybeUnary(tt),lt=this.finishNode(ut,"SpreadElement")}else if(!tt&&this.tok.type===a.tokTypes.privateId)lt=this.parsePrivateIdent();else for(lt=this.parseExprSubscripts();this.tok.type.postfix&&!this.canInsertSemicolon();){var pt=this.startNodeAt(st);pt.operator=this.tok.value,pt.prefix=!1,pt.argument=this.checkLVal(lt),this.next(),lt=this.finishNode(pt,"UpdateExpression")}if(!tt&&this.eat(a.tokTypes.starstar)){var mt=this.startNodeAt(st);return mt.operator="**",mt.left=lt,mt.right=this.parseMaybeUnary(!1),this.finishNode(mt,"BinaryExpression")}return lt},_.parseExprSubscripts=function(){var tt=this.storeCurrentPos();return this.parseSubscripts(this.parseExprAtom(),tt,!1,this.curIndent,this.curLineStart)},_.parseSubscripts=function(tt,st,lt,ct,ht){for(var ut=this.options.ecmaVersion>=11,pt=!1;;){if(this.curLineStart!==ht&&this.curIndent<=ct&&this.tokenStartsLine())if(this.tok.type===a.tokTypes.dot&&this.curIndent===ct)--ct;else break;var mt=tt.type==="Identifier"&&tt.name==="async"&&!this.canInsertSemicolon(),gt=ut&&this.eat(a.tokTypes.questionDot);if(gt&&(pt=!0),gt&&this.tok.type!==a.tokTypes.parenL&&this.tok.type!==a.tokTypes.bracketL&&this.tok.type!==a.tokTypes.backQuote||this.eat(a.tokTypes.dot)){var dt=this.startNodeAt(st);dt.object=tt,this.curLineStart!==ht&&this.curIndent<=ct&&this.tokenStartsLine()?dt.property=this.dummyIdent():dt.property=this.parsePropertyAccessor()||this.dummyIdent(),dt.computed=!1,ut&&(dt.optional=gt),tt=this.finishNode(dt,"MemberExpression")}else if(this.tok.type===a.tokTypes.bracketL){this.pushCx(),this.next();var St=this.startNodeAt(st);St.object=tt,St.property=this.parseExpression(),St.computed=!0,ut&&(St.optional=gt),this.popCx(),this.expect(a.tokTypes.bracketR),tt=this.finishNode(St,"MemberExpression")}else if(!lt&&this.tok.type===a.tokTypes.parenL){var xt=this.parseExprList(a.tokTypes.parenR);if(mt&&this.eat(a.tokTypes.arrow))return this.parseArrowExpression(this.startNodeAt(st),xt,!0);var yt=this.startNodeAt(st);yt.callee=tt,yt.arguments=xt,ut&&(yt.optional=gt),tt=this.finishNode(yt,"CallExpression")}else if(this.tok.type===a.tokTypes.backQuote){var _t=this.startNodeAt(st);_t.tag=tt,_t.quasi=this.parseTemplate(),tt=this.finishNode(_t,"TaggedTemplateExpression")}else break}if(pt){var Ct=this.startNodeAt(st);Ct.expression=tt,tt=this.finishNode(Ct,"ChainExpression")}return tt},_.parseExprAtom=function(){var tt;switch(this.tok.type){case a.tokTypes._this:case a.tokTypes._super:var st=this.tok.type===a.tokTypes._this?"ThisExpression":"Super";return tt=this.startNode(),this.next(),this.finishNode(tt,st);case a.tokTypes.name:var lt=this.storeCurrentPos(),ct=this.parseIdent(),ht=!1;if(ct.name==="async"&&!this.canInsertSemicolon()){if(this.eat(a.tokTypes._function))return this.toks.overrideContext(a.tokContexts.f_expr),this.parseFunction(this.startNodeAt(lt),!1,!0);this.tok.type===a.tokTypes.name&&(ct=this.parseIdent(),ht=!0)}return this.eat(a.tokTypes.arrow)?this.parseArrowExpression(this.startNodeAt(lt),[ct],ht):ct;case a.tokTypes.regexp:tt=this.startNode();var ut=this.tok.value;return tt.regex={pattern:ut.pattern,flags:ut.flags},tt.value=ut.value,tt.raw=this.input.slice(this.tok.start,this.tok.end),this.next(),this.finishNode(tt,"Literal");case a.tokTypes.num:case a.tokTypes.string:return tt=this.startNode(),tt.value=this.tok.value,tt.raw=this.input.slice(this.tok.start,this.tok.end),this.tok.type===a.tokTypes.num&&tt.raw.charCodeAt(tt.raw.length-1)===110&&(tt.bigint=tt.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(tt,"Literal");case a.tokTypes._null:case a.tokTypes._true:case a.tokTypes._false:return tt=this.startNode(),tt.value=this.tok.type===a.tokTypes._null?null:this.tok.type===a.tokTypes._true,tt.raw=this.tok.type.keyword,this.next(),this.finishNode(tt,"Literal");case a.tokTypes.parenL:var pt=this.storeCurrentPos();this.next();var mt=this.parseExpression();if(this.expect(a.tokTypes.parenR),this.eat(a.tokTypes.arrow)){var gt=mt.expressions||[mt];return gt.length&&et(gt[gt.length-1])&>.pop(),this.parseArrowExpression(this.startNodeAt(pt),gt)}if(this.options.preserveParens){var dt=this.startNodeAt(pt);dt.expression=mt,mt=this.finishNode(dt,"ParenthesizedExpression")}return mt;case a.tokTypes.bracketL:return tt=this.startNode(),tt.elements=this.parseExprList(a.tokTypes.bracketR,!0),this.finishNode(tt,"ArrayExpression");case a.tokTypes.braceL:return this.toks.overrideContext(a.tokContexts.b_expr),this.parseObj();case a.tokTypes._class:return this.parseClass(!1);case a.tokTypes._function:return tt=this.startNode(),this.next(),this.parseFunction(tt,!1);case a.tokTypes._new:return this.parseNew();case a.tokTypes.backQuote:return this.parseTemplate();case a.tokTypes._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.dummyIdent();default:return this.dummyIdent()}},_.parseExprImport=function(){var tt=this.startNode(),st=this.parseIdent(!0);switch(this.tok.type){case a.tokTypes.parenL:return this.parseDynamicImport(tt);case a.tokTypes.dot:return tt.meta=st,this.parseImportMeta(tt);default:return tt.name="import",this.finishNode(tt,"Identifier")}},_.parseDynamicImport=function(tt){return tt.source=this.parseExprList(a.tokTypes.parenR)[0]||this.dummyString(),this.finishNode(tt,"ImportExpression")},_.parseImportMeta=function(tt){return this.next(),tt.property=this.parseIdent(!0),this.finishNode(tt,"MetaProperty")},_.parseNew=function(){var tt=this.startNode(),st=this.curIndent,lt=this.curLineStart,ct=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(a.tokTypes.dot))return tt.meta=ct,tt.property=this.parseIdent(!0),this.finishNode(tt,"MetaProperty");var ht=this.storeCurrentPos();return tt.callee=this.parseSubscripts(this.parseExprAtom(),ht,!0,st,lt),this.tok.type===a.tokTypes.parenL?tt.arguments=this.parseExprList(a.tokTypes.parenR):tt.arguments=[],this.finishNode(tt,"NewExpression")},_.parseTemplateElement=function(){var tt=this.startNode();return this.tok.type===a.tokTypes.invalidTemplate?tt.value={raw:this.tok.value,cooked:null}:tt.value={raw:this.input.slice(this.tok.start,this.tok.end).replace(/\r\n?/g,` -`),cooked:this.tok.value},this.next(),tt.tail=this.tok.type===a.tokTypes.backQuote,this.finishNode(tt,"TemplateElement")},_.parseTemplate=function(){var tt=this.startNode();this.next(),tt.expressions=[];var st=this.parseTemplateElement();for(tt.quasis=[st];!st.tail;)this.next(),tt.expressions.push(this.parseExpression()),this.expect(a.tokTypes.braceR)?st=this.parseTemplateElement():(st=this.startNode(),st.value={cooked:"",raw:""},st.tail=!0,this.finishNode(st,"TemplateElement")),tt.quasis.push(st);return this.expect(a.tokTypes.backQuote),this.finishNode(tt,"TemplateLiteral")},_.parseObj=function(){var tt=this.startNode();tt.properties=[],this.pushCx();var st=this.curIndent+1,lt=this.curLineStart;for(this.eat(a.tokTypes.braceL),this.curIndent+1=9&&this.eat(a.tokTypes.ellipsis)){ct.argument=this.parseMaybeAssign(),tt.properties.push(this.finishNode(ct,"SpreadElement")),this.eat(a.tokTypes.comma);continue}if(this.options.ecmaVersion>=6&&(pt=this.storeCurrentPos(),ct.method=!1,ct.shorthand=!1,ht=this.eat(a.tokTypes.star)),this.parsePropertyName(ct),this.toks.isAsyncProp(ct)?(ut=!0,ht=this.options.ecmaVersion>=9&&this.eat(a.tokTypes.star),this.parsePropertyName(ct)):ut=!1,et(ct.key)){et(this.parseMaybeAssign())&&this.next(),this.eat(a.tokTypes.comma);continue}if(this.eat(a.tokTypes.colon))ct.kind="init",ct.value=this.parseMaybeAssign();else if(this.options.ecmaVersion>=6&&(this.tok.type===a.tokTypes.parenL||this.tok.type===a.tokTypes.braceL))ct.kind="init",ct.method=!0,ct.value=this.parseMethod(ht,ut);else if(this.options.ecmaVersion>=5&&ct.key.type==="Identifier"&&!ct.computed&&(ct.key.name==="get"||ct.key.name==="set")&&this.tok.type!==a.tokTypes.comma&&this.tok.type!==a.tokTypes.braceR&&this.tok.type!==a.tokTypes.eq)ct.kind=ct.key.name,this.parsePropertyName(ct),ct.value=this.parseMethod(!1);else{if(ct.kind="init",this.options.ecmaVersion>=6)if(this.eat(a.tokTypes.eq)){var mt=this.startNodeAt(pt);mt.operator="=",mt.left=ct.key,mt.right=this.parseMaybeAssign(),ct.value=this.finishNode(mt,"AssignmentExpression")}else ct.value=ct.key;else ct.value=this.dummyIdent();ct.shorthand=!0}tt.properties.push(this.finishNode(ct,"Property")),this.eat(a.tokTypes.comma)}return this.popCx(),this.eat(a.tokTypes.braceR)||(this.last.end=this.tok.start,this.options.locations&&(this.last.loc.end=this.tok.loc.start)),this.finishNode(tt,"ObjectExpression")},_.parsePropertyName=function(tt){if(this.options.ecmaVersion>=6)if(this.eat(a.tokTypes.bracketL)){tt.computed=!0,tt.key=this.parseExpression(),this.expect(a.tokTypes.bracketR);return}else tt.computed=!1;var st=this.tok.type===a.tokTypes.num||this.tok.type===a.tokTypes.string?this.parseExprAtom():this.parseIdent();tt.key=st||this.dummyIdent()},_.parsePropertyAccessor=function(){if(this.tok.type===a.tokTypes.name||this.tok.type.keyword)return this.parseIdent();if(this.tok.type===a.tokTypes.privateId)return this.parsePrivateIdent()},_.parseIdent=function(){var tt=this.tok.type===a.tokTypes.name?this.tok.value:this.tok.type.keyword;if(!tt)return this.dummyIdent();this.tok.type.keyword&&(this.toks.type=a.tokTypes.name);var st=this.startNode();return this.next(),st.name=tt,this.finishNode(st,"Identifier")},_.parsePrivateIdent=function(){var tt=this.startNode();return tt.name=this.tok.value,this.next(),this.finishNode(tt,"PrivateIdentifier")},_.initFunction=function(tt){tt.id=null,tt.params=[],this.options.ecmaVersion>=6&&(tt.generator=!1,tt.expression=!1),this.options.ecmaVersion>=8&&(tt.async=!1)},_.toAssignable=function(tt,st){if(!(!tt||tt.type==="Identifier"||tt.type==="MemberExpression"&&!st))if(tt.type==="ParenthesizedExpression")this.toAssignable(tt.expression,st);else{if(this.options.ecmaVersion<6)return this.dummyIdent();if(tt.type==="ObjectExpression"){tt.type="ObjectPattern";for(var lt=0,ct=tt.properties;lt=6&&(lt.generator=!!tt),this.options.ecmaVersion>=8&&(lt.async=!!st),this.inAsync=lt.async,this.inGenerator=lt.generator,this.inFunction=!0,lt.params=this.parseFunctionParams(),lt.body=this.parseBlock(),this.toks.adaptDirectivePrologue(lt.body.body),this.inAsync=ct,this.inGenerator=ht,this.inFunction=ut,this.finishNode(lt,"FunctionExpression")},_.parseArrowExpression=function(tt,st,lt){var ct=this.inAsync,ht=this.inGenerator,ut=this.inFunction;return this.initFunction(tt),this.options.ecmaVersion>=8&&(tt.async=!!lt),this.inAsync=tt.async,this.inGenerator=!1,this.inFunction=!0,tt.params=this.toAssignableList(st,!0),tt.expression=this.tok.type!==a.tokTypes.braceL,tt.expression?tt.body=this.parseMaybeAssign():(tt.body=this.parseBlock(),this.toks.adaptDirectivePrologue(tt.body.body)),this.inAsync=ct,this.inGenerator=ht,this.inFunction=ut,this.finishNode(tt,"ArrowFunctionExpression")},_.parseExprList=function(tt,st){this.pushCx();var lt=this.curIndent,ct=this.curLineStart,ht=[];for(this.next();!this.closes(tt,lt+1,ct);){if(this.eat(a.tokTypes.comma)){ht.push(st?null:this.dummyIdent());continue}var ut=this.parseMaybeAssign();if(et(ut)){if(this.closes(tt,lt,ct))break;this.next()}else ht.push(ut);this.eat(a.tokTypes.comma)}return this.popCx(),this.eat(tt)||(this.last.end=this.tok.start,this.options.locations&&(this.last.loc.end=this.tok.loc.start)),ht},_.parseAwait=function(){var tt=this.startNode();return this.next(),tt.argument=this.parseMaybeUnary(),this.finishNode(tt,"AwaitExpression")},a.defaultOptions.tabSize=4;function $(tt,st){return at.parse(tt,st)}o.LooseParser=at,o.isDummy=et,o.parse=$})})(acornLoose,acornLoose.exports);var acornLooseExports=acornLoose.exports,validator={},validityErrors={};Object.defineProperty(validityErrors,"__esModule",{value:!0});validityErrors.NoAssignmentToForVariable=void 0;const types_1$j=types;class NoAssignmentToForVariable{constructor(s){this.node=s,this.type=types_1$j.ErrorType.SYNTAX,this.severity=types_1$j.ErrorSeverity.ERROR}get location(){return this.node.loc}explain(){return"Assignment to a for loop variable in the for loop is not allowed."}elaborate(){return this.explain()}}validityErrors.NoAssignmentToForVariable=NoAssignmentToForVariable;var hasRequiredValidator;function requireValidator(){if(hasRequiredValidator)return validator;hasRequiredValidator=1,Object.defineProperty(validator,"__esModule",{value:!0}),validator.validateAndAnnotate=void 0;const i=requireErrors(),s=validityErrors,o=astCreator,a=walkers$1;class rt{constructor(at){this.isConstant=at,this.accessedBeforeDeclaration=!1}}function et(ot,at){const nt=new Map,it=new Map;function j(st){const lt=new Map;for(const ct of st.body)ct.type==="VariableDeclaration"?lt.set((0,o.getVariableDecarationName)(ct),new rt(ct.kind==="const")):ct.type==="FunctionDeclaration"&<.set(ct.id.name,new rt(!0));it.set(st,!1),nt.set(st,lt)}function _(st){nt.set(st,new Map(st.params.map(lt=>[lt.name,new rt(!1)]))),it.set(st,!1)}(0,a.ancestor)(ot,{Program:j,BlockStatement:j,FunctionDeclaration:_,ArrowFunctionExpression:_,ForStatement(st,lt){const ct=st.init;ct.type==="VariableDeclaration"&&(nt.set(st,new Map([[(0,o.getVariableDecarationName)(ct),new rt(ct.kind==="const")]])),it.set(st,!1))}});function $(st,lt){const ct=st.name,ht=lt[lt.length-2];for(let ut=lt.length-1;ut>=0;ut--){const pt=lt[ut],mt=nt.get(pt);if(mt!=null&&mt.has(ct)){mt.get(ct).accessedBeforeDeclaration=!0,ht.type==="AssignmentExpression"&&ht.left===st&&(mt.get(ct).isConstant&&at.errors.push(new i.ConstAssignment(ht,ct)),pt.type==="ForStatement"&&pt.init!==ht&&pt.update!==ht&&at.errors.push(new s.NoAssignmentToForVariable(ht)));break}}}const tt=Object.assign(Object.assign({},a.base),{VariableDeclarator(st,lt,ct){st.init&&ct(st.init,lt,"Expression")}});return(0,a.ancestor)(ot,{VariableDeclaration(st,lt){const ct=lt[lt.length-2],ht=(0,o.getVariableDecarationName)(st),ut=nt.get(ct).get(ht).accessedBeforeDeclaration;st.typability=ut?"Untypable":"NotYetTyped"},Identifier:$,FunctionDeclaration(st,lt){const ct=lt[lt.length-2];st.typability=it.get(ct)?"Untypable":"NotYetTyped"},Pattern(st,lt){st.type==="Identifier"?$(st,lt):st.type==="MemberExpression"&&st.object.type==="Identifier"&&$(st.object,lt)},CallExpression(st,lt){for(let ct=lt.length-1;ct>=0;ct--){const ht=lt[ct];if(it.has(ht)){it.set(ht,!0);break}}}},tt),ot}return validator.validateAndAnnotate=et,validator}var rules$1={},bracesAroundFor$1={};Object.defineProperty(bracesAroundFor$1,"__esModule",{value:!0});bracesAroundFor$1.BracesAroundForError=void 0;const astring_1$7=astring,types_1$i=types;class BracesAroundForError{constructor(s){this.node=s,this.type=types_1$i.ErrorType.SYNTAX,this.severity=types_1$i.ErrorSeverity.ERROR}get location(){return this.node.loc}explain(){return'Missing curly braces around "for" block.'}elaborate(){const s=(0,astring_1$7.generate)(this.node.init),o=(0,astring_1$7.generate)(this.node.test),a=(0,astring_1$7.generate)(this.node.update);return`Remember to enclose your "for" block with braces: +`;var parser$1={},parser={},acornLoose={exports:{}};(function(i,s){(function(o,a){a(s,acornExports)})(commonjsGlobal,function(o,a){var rt="✖";function tt(et){return et.name===rt}function ot(){}var at=function(st,lt){if(lt===void 0&&(lt={}),this.toks=this.constructor.BaseParser.tokenizer(st,lt),this.options=this.toks.options,this.input=this.toks.input,this.tok=this.last={type:a.tokTypes.eof,start:0,end:0},this.tok.validateRegExpFlags=ot,this.tok.validateRegExpPattern=ot,this.options.locations){var ct=this.toks.curPosition();this.tok.loc=new a.SourceLocation(this.toks,ct,ct)}this.ahead=[],this.context=[],this.curIndent=0,this.curLineStart=0,this.nextLineStart=this.lineEnd(this.curLineStart)+1,this.inAsync=!1,this.inGenerator=!1,this.inFunction=!1};at.prototype.startNode=function(){return new a.Node(this.toks,this.tok.start,this.options.locations?this.tok.loc.start:null)},at.prototype.storeCurrentPos=function(){return this.options.locations?[this.tok.start,this.tok.loc.start]:this.tok.start},at.prototype.startNodeAt=function(st){return this.options.locations?new a.Node(this.toks,st[0],st[1]):new a.Node(this.toks,st)},at.prototype.finishNode=function(st,lt){return st.type=lt,st.end=this.last.end,this.options.locations&&(st.loc.end=this.last.loc.end),this.options.ranges&&(st.range[1]=this.last.end),st},at.prototype.dummyNode=function(st){var lt=this.startNode();return lt.type=st,lt.end=lt.start,this.options.locations&&(lt.loc.end=lt.loc.start),this.options.ranges&&(lt.range[1]=lt.start),this.last={type:a.tokTypes.name,start:lt.start,end:lt.start,loc:lt.loc},lt},at.prototype.dummyIdent=function(){var st=this.dummyNode("Identifier");return st.name=rt,st},at.prototype.dummyString=function(){var st=this.dummyNode("Literal");return st.value=st.raw=rt,st},at.prototype.eat=function(st){return this.tok.type===st?(this.next(),!0):!1},at.prototype.isContextual=function(st){return this.tok.type===a.tokTypes.name&&this.tok.value===st},at.prototype.eatContextual=function(st){return this.tok.value===st&&this.eat(a.tokTypes.name)},at.prototype.canInsertSemicolon=function(){return this.tok.type===a.tokTypes.eof||this.tok.type===a.tokTypes.braceR||a.lineBreak.test(this.input.slice(this.last.end,this.tok.start))},at.prototype.semicolon=function(){return this.eat(a.tokTypes.semi)},at.prototype.expect=function(st){if(this.eat(st))return!0;for(var lt=1;lt<=2;lt++)if(this.lookAhead(lt).type===st){for(var ct=0;ct=this.input.length||this.indentationAfter(this.nextLineStart)=this.curLineStart;--st){var lt=this.input.charCodeAt(st);if(lt!==9&<!==32)return!1}return!0},at.prototype.extend=function(st,lt){this[st]=lt(this[st])},at.prototype.parse=function(){return this.next(),this.parseTopLevel()},at.extend=function(){for(var st=[],lt=arguments.length;lt--;)st[lt]=arguments[lt];for(var ct=this,ht=0;ht8||et===32||et===160||a.isNewLine(et)}nt.next=function(){if(this.last=this.tok,this.ahead.length?this.tok=this.ahead.shift():this.tok=this.readToken(),this.tok.start>=this.nextLineStart){for(;this.tok.start>=this.nextLineStart;)this.curLineStart=this.nextLineStart,this.nextLineStart=this.lineEnd(this.curLineStart)+1;this.curIndent=this.indentationAfter(this.curLineStart)}},nt.readToken=function(){for(;;)try{return this.toks.next(),this.toks.type===a.tokTypes.dot&&this.input.substr(this.toks.end,1)==="."&&this.options.ecmaVersion>=6&&(this.toks.end++,this.toks.type=a.tokTypes.ellipsis),new a.Token(this.toks)}catch(ut){if(!(ut instanceof SyntaxError))throw ut;var et=ut.message,st=ut.raisedAt,lt=!0;if(/unterminated/i.test(et))if(st=this.lineEnd(ut.pos+1),/string/.test(et))lt={start:ut.pos,end:st,type:a.tokTypes.string,value:this.input.slice(ut.pos+1,st)};else if(/regular expr/i.test(et)){var ct=this.input.slice(ut.pos,st);try{ct=new RegExp(ct)}catch{}lt={start:ut.pos,end:st,type:a.tokTypes.regexp,value:ct}}else/template/.test(et)?lt={start:ut.pos,end:st,type:a.tokTypes.template,value:this.input.slice(ut.pos,st)}:lt=!1;else if(/invalid (unicode|regexp|number)|expecting unicode|octal literal|is reserved|directly after number|expected number in radix/i.test(et))for(;st]/.test(st)||/[enwfd]/.test(st)&&/\b(case|else|return|throw|new|in|(instance|type)?of|delete|void)$/.test(this.input.slice(et-10,et)),this.options.locations){this.toks.curLine=1,this.toks.lineStart=a.lineBreakG.lastIndex=0;for(var lt;(lt=a.lineBreakG.exec(this.input))&<.indexthis.ahead.length;)this.ahead.push(this.readToken());return this.ahead[et-1]};var j=at.prototype;j.parseTopLevel=function(){var et=this.startNodeAt(this.options.locations?[0,a.getLineInfo(this.input,0)]:0);for(et.body=[];this.tok.type!==a.tokTypes.eof;)et.body.push(this.parseStatement());return this.toks.adaptDirectivePrologue(et.body),this.last=this.tok,et.sourceType=this.options.sourceType,this.finishNode(et,"Program")},j.parseStatement=function(){var et=this.tok.type,st=this.startNode(),lt;switch(this.toks.isLet()&&(et=a.tokTypes._var,lt="let"),et){case a.tokTypes._break:case a.tokTypes._continue:this.next();var ct=et===a.tokTypes._break;return this.semicolon()||this.canInsertSemicolon()?st.label=null:(st.label=this.tok.type===a.tokTypes.name?this.parseIdent():null,this.semicolon()),this.finishNode(st,ct?"BreakStatement":"ContinueStatement");case a.tokTypes._debugger:return this.next(),this.semicolon(),this.finishNode(st,"DebuggerStatement");case a.tokTypes._do:return this.next(),st.body=this.parseStatement(),st.test=this.eat(a.tokTypes._while)?this.parseParenExpression():this.dummyIdent(),this.semicolon(),this.finishNode(st,"DoWhileStatement");case a.tokTypes._for:this.next();var ht=this.options.ecmaVersion>=9&&this.eatContextual("await");if(this.pushCx(),this.expect(a.tokTypes.parenL),this.tok.type===a.tokTypes.semi)return this.parseFor(st,null);var ut=this.toks.isLet();if(ut||this.tok.type===a.tokTypes._var||this.tok.type===a.tokTypes._const){var pt=this.parseVar(this.startNode(),!0,ut?"let":this.tok.value);return pt.declarations.length===1&&(this.tok.type===a.tokTypes._in||this.isContextual("of"))?(this.options.ecmaVersion>=9&&this.tok.type!==a.tokTypes._in&&(st.await=ht),this.parseForIn(st,pt)):this.parseFor(st,pt)}var mt=this.parseExpression(!0);return this.tok.type===a.tokTypes._in||this.isContextual("of")?(this.options.ecmaVersion>=9&&this.tok.type!==a.tokTypes._in&&(st.await=ht),this.parseForIn(st,this.toAssignable(mt))):this.parseFor(st,mt);case a.tokTypes._function:return this.next(),this.parseFunction(st,!0);case a.tokTypes._if:return this.next(),st.test=this.parseParenExpression(),st.consequent=this.parseStatement(),st.alternate=this.eat(a.tokTypes._else)?this.parseStatement():null,this.finishNode(st,"IfStatement");case a.tokTypes._return:return this.next(),this.eat(a.tokTypes.semi)||this.canInsertSemicolon()?st.argument=null:(st.argument=this.parseExpression(),this.semicolon()),this.finishNode(st,"ReturnStatement");case a.tokTypes._switch:var gt=this.curIndent,dt=this.curLineStart;this.next(),st.discriminant=this.parseParenExpression(),st.cases=[],this.pushCx(),this.expect(a.tokTypes.braceL);for(var St;!this.closes(a.tokTypes.braceR,gt,dt,!0);)if(this.tok.type===a.tokTypes._case||this.tok.type===a.tokTypes._default){var xt=this.tok.type===a.tokTypes._case;St&&this.finishNode(St,"SwitchCase"),st.cases.push(St=this.startNode()),St.consequent=[],this.next(),xt?St.test=this.parseExpression():St.test=null,this.expect(a.tokTypes.colon)}else St||(st.cases.push(St=this.startNode()),St.consequent=[],St.test=null),St.consequent.push(this.parseStatement());return St&&this.finishNode(St,"SwitchCase"),this.popCx(),this.eat(a.tokTypes.braceR),this.finishNode(st,"SwitchStatement");case a.tokTypes._throw:return this.next(),st.argument=this.parseExpression(),this.semicolon(),this.finishNode(st,"ThrowStatement");case a.tokTypes._try:if(this.next(),st.block=this.parseBlock(),st.handler=null,this.tok.type===a.tokTypes._catch){var yt=this.startNode();this.next(),this.eat(a.tokTypes.parenL)?(yt.param=this.toAssignable(this.parseExprAtom(),!0),this.expect(a.tokTypes.parenR)):yt.param=null,yt.body=this.parseBlock(),st.handler=this.finishNode(yt,"CatchClause")}return st.finalizer=this.eat(a.tokTypes._finally)?this.parseBlock():null,!st.handler&&!st.finalizer?st.block:this.finishNode(st,"TryStatement");case a.tokTypes._var:case a.tokTypes._const:return this.parseVar(st,!1,lt||this.tok.value);case a.tokTypes._while:return this.next(),st.test=this.parseParenExpression(),st.body=this.parseStatement(),this.finishNode(st,"WhileStatement");case a.tokTypes._with:return this.next(),st.object=this.parseParenExpression(),st.body=this.parseStatement(),this.finishNode(st,"WithStatement");case a.tokTypes.braceL:return this.parseBlock();case a.tokTypes.semi:return this.next(),this.finishNode(st,"EmptyStatement");case a.tokTypes._class:return this.parseClass(!0);case a.tokTypes._import:if(this.options.ecmaVersion>10){var _t=this.lookAhead(1).type;if(_t===a.tokTypes.parenL||_t===a.tokTypes.dot)return st.expression=this.parseExpression(),this.semicolon(),this.finishNode(st,"ExpressionStatement")}return this.parseImport();case a.tokTypes._export:return this.parseExport();default:if(this.toks.isAsyncFunction())return this.next(),this.next(),this.parseFunction(st,!0,!0);var Ct=this.parseExpression();return tt(Ct)?(this.next(),this.tok.type===a.tokTypes.eof?this.finishNode(st,"EmptyStatement"):this.parseStatement()):et===a.tokTypes.name&&Ct.type==="Identifier"&&this.eat(a.tokTypes.colon)?(st.body=this.parseStatement(),st.label=Ct,this.finishNode(st,"LabeledStatement")):(st.expression=Ct,this.semicolon(),this.finishNode(st,"ExpressionStatement"))}},j.parseBlock=function(){var et=this.startNode();this.pushCx(),this.expect(a.tokTypes.braceL);var st=this.curIndent,lt=this.curLineStart;for(et.body=[];!this.closes(a.tokTypes.braceR,st,lt,!0);)et.body.push(this.parseStatement());return this.popCx(),this.eat(a.tokTypes.braceR),this.finishNode(et,"BlockStatement")},j.parseFor=function(et,st){return et.init=st,et.test=et.update=null,this.eat(a.tokTypes.semi)&&this.tok.type!==a.tokTypes.semi&&(et.test=this.parseExpression()),this.eat(a.tokTypes.semi)&&this.tok.type!==a.tokTypes.parenR&&(et.update=this.parseExpression()),this.popCx(),this.expect(a.tokTypes.parenR),et.body=this.parseStatement(),this.finishNode(et,"ForStatement")},j.parseForIn=function(et,st){var lt=this.tok.type===a.tokTypes._in?"ForInStatement":"ForOfStatement";return this.next(),et.left=st,et.right=this.parseExpression(),this.popCx(),this.expect(a.tokTypes.parenR),et.body=this.parseStatement(),this.finishNode(et,lt)},j.parseVar=function(et,st,lt){et.kind=lt,this.next(),et.declarations=[];do{var ct=this.startNode();ct.id=this.options.ecmaVersion>=6?this.toAssignable(this.parseExprAtom(),!0):this.parseIdent(),ct.init=this.eat(a.tokTypes.eq)?this.parseMaybeAssign(st):null,et.declarations.push(this.finishNode(ct,"VariableDeclarator"))}while(this.eat(a.tokTypes.comma));if(!et.declarations.length){var ht=this.startNode();ht.id=this.dummyIdent(),et.declarations.push(this.finishNode(ht,"VariableDeclarator"))}return st||this.semicolon(),this.finishNode(et,"VariableDeclaration")},j.parseClass=function(et){var st=this.startNode();this.next(),this.tok.type===a.tokTypes.name?st.id=this.parseIdent():et===!0?st.id=this.dummyIdent():st.id=null,st.superClass=this.eat(a.tokTypes._extends)?this.parseExpression():null,st.body=this.startNode(),st.body.body=[],this.pushCx();var lt=this.curIndent+1,ct=this.curLineStart;for(this.eat(a.tokTypes.braceL),this.curIndent+1=13&&this.eat(a.tokTypes.braceL))return this.parseClassStaticBlock(ut),ut;this.isClassElementNameStart()||this.toks.type===a.tokTypes.star?St=!0:pt="static"}if(ut.static=St,!pt&&st>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.toks.type===a.tokTypes.star)&&!this.canInsertSemicolon()?gt=!0:pt="async"),!pt){mt=this.eat(a.tokTypes.star);var xt=this.toks.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?dt=xt:pt=xt)}if(pt)ut.computed=!1,ut.key=this.startNodeAt(lt?[this.toks.lastTokStart,this.toks.lastTokStartLoc]:this.toks.lastTokStart),ut.key.name=pt,this.finishNode(ut.key,"Identifier");else if(this.parseClassElementName(ut),tt(ut.key))return tt(this.parseMaybeAssign())&&this.next(),this.eat(a.tokTypes.comma),null;if(st<13||this.toks.type===a.tokTypes.parenL||dt!=="method"||mt||gt){var yt=!ut.computed&&!ut.static&&!mt&&!gt&&dt==="method"&&(ut.key.type==="Identifier"&&ut.key.name==="constructor"||ut.key.type==="Literal"&&ut.key.value==="constructor");ut.kind=yt?"constructor":dt,ut.value=this.parseMethod(mt,gt),this.finishNode(ut,"MethodDefinition")}else{if(this.eat(a.tokTypes.eq))if(this.curLineStart!==ht&&this.curIndent<=ct&&this.tokenStartsLine())ut.value=null;else{var _t=this.inAsync,Ct=this.inGenerator;this.inAsync=!1,this.inGenerator=!1,ut.value=this.parseMaybeAssign(),this.inAsync=_t,this.inGenerator=Ct}else ut.value=null;this.semicolon(),this.finishNode(ut,"PropertyDefinition")}return ut},j.parseClassStaticBlock=function(et){var st=this.curIndent,lt=this.curLineStart;for(et.body=[],this.pushCx();!this.closes(a.tokTypes.braceR,st,lt,!0);)et.body.push(this.parseStatement());return this.popCx(),this.eat(a.tokTypes.braceR),this.finishNode(et,"StaticBlock")},j.isClassElementNameStart=function(){return this.toks.isClassElementNameStart()},j.parseClassElementName=function(et){this.toks.type===a.tokTypes.privateId?(et.computed=!1,et.key=this.parsePrivateIdent()):this.parsePropertyName(et)},j.parseFunction=function(et,st,lt){var ct=this.inAsync,ht=this.inGenerator,ut=this.inFunction;return this.initFunction(et),this.options.ecmaVersion>=6&&(et.generator=this.eat(a.tokTypes.star)),this.options.ecmaVersion>=8&&(et.async=!!lt),this.tok.type===a.tokTypes.name?et.id=this.parseIdent():st===!0&&(et.id=this.dummyIdent()),this.inAsync=et.async,this.inGenerator=et.generator,this.inFunction=!0,et.params=this.parseFunctionParams(),et.body=this.parseBlock(),this.toks.adaptDirectivePrologue(et.body.body),this.inAsync=ct,this.inGenerator=ht,this.inFunction=ut,this.finishNode(et,st?"FunctionDeclaration":"FunctionExpression")},j.parseExport=function(){var et=this.startNode();if(this.next(),this.eat(a.tokTypes.star))return this.options.ecmaVersion>=11&&(this.eatContextual("as")?et.exported=this.parseExprAtom():et.exported=null),et.source=this.eatContextual("from")?this.parseExprAtom():this.dummyString(),this.semicolon(),this.finishNode(et,"ExportAllDeclaration");if(this.eat(a.tokTypes._default)){var st;if(this.tok.type===a.tokTypes._function||(st=this.toks.isAsyncFunction())){var lt=this.startNode();this.next(),st&&this.next(),et.declaration=this.parseFunction(lt,"nullableID",st)}else this.tok.type===a.tokTypes._class?et.declaration=this.parseClass("nullableID"):(et.declaration=this.parseMaybeAssign(),this.semicolon());return this.finishNode(et,"ExportDefaultDeclaration")}return this.tok.type.keyword||this.toks.isLet()||this.toks.isAsyncFunction()?(et.declaration=this.parseStatement(),et.specifiers=[],et.source=null):(et.declaration=null,et.specifiers=this.parseExportSpecifierList(),et.source=this.eatContextual("from")?this.parseExprAtom():null,this.semicolon()),this.finishNode(et,"ExportNamedDeclaration")},j.parseImport=function(){var et=this.startNode();if(this.next(),this.tok.type===a.tokTypes.string)et.specifiers=[],et.source=this.parseExprAtom();else{var st;this.tok.type===a.tokTypes.name&&this.tok.value!=="from"&&(st=this.startNode(),st.local=this.parseIdent(),this.finishNode(st,"ImportDefaultSpecifier"),this.eat(a.tokTypes.comma)),et.specifiers=this.parseImportSpecifiers(),et.source=this.eatContextual("from")&&this.tok.type===a.tokTypes.string?this.parseExprAtom():this.dummyString(),st&&et.specifiers.unshift(st)}return this.semicolon(),this.finishNode(et,"ImportDeclaration")},j.parseImportSpecifiers=function(){var et=[];if(this.tok.type===a.tokTypes.star){var st=this.startNode();this.next(),st.local=this.eatContextual("as")?this.parseIdent():this.dummyIdent(),et.push(this.finishNode(st,"ImportNamespaceSpecifier"))}else{var lt=this.curIndent,ct=this.curLineStart,ht=this.nextLineStart;for(this.pushCx(),this.eat(a.tokTypes.braceL),this.curLineStart>ht&&(ht=this.curLineStart);!this.closes(a.tokTypes.braceR,lt+(this.curLineStart<=ht?1:0),ct);){var ut=this.startNode();if(this.eat(a.tokTypes.star))ut.local=this.eatContextual("as")?this.parseModuleExportName():this.dummyIdent(),this.finishNode(ut,"ImportNamespaceSpecifier");else{if(this.isContextual("from")||(ut.imported=this.parseModuleExportName(),tt(ut.imported)))break;ut.local=this.eatContextual("as")?this.parseModuleExportName():ut.imported,this.finishNode(ut,"ImportSpecifier")}et.push(ut),this.eat(a.tokTypes.comma)}this.eat(a.tokTypes.braceR),this.popCx()}return et},j.parseExportSpecifierList=function(){var et=[],st=this.curIndent,lt=this.curLineStart,ct=this.nextLineStart;for(this.pushCx(),this.eat(a.tokTypes.braceL),this.curLineStart>ct&&(ct=this.curLineStart);!this.closes(a.tokTypes.braceR,st+(this.curLineStart<=ct?1:0),lt)&&!this.isContextual("from");){var ht=this.startNode();if(ht.local=this.parseModuleExportName(),tt(ht.local))break;ht.exported=this.eatContextual("as")?this.parseModuleExportName():ht.local,this.finishNode(ht,"ExportSpecifier"),et.push(ht),this.eat(a.tokTypes.comma)}return this.eat(a.tokTypes.braceR),this.popCx(),et},j.parseModuleExportName=function(){return this.options.ecmaVersion>=13&&this.tok.type===a.tokTypes.string?this.parseExprAtom():this.parseIdent()};var _=at.prototype;_.checkLVal=function(et){if(!et)return et;switch(et.type){case"Identifier":case"MemberExpression":return et;case"ParenthesizedExpression":return et.expression=this.checkLVal(et.expression),et;default:return this.dummyIdent()}},_.parseExpression=function(et){var st=this.storeCurrentPos(),lt=this.parseMaybeAssign(et);if(this.tok.type===a.tokTypes.comma){var ct=this.startNodeAt(st);for(ct.expressions=[lt];this.eat(a.tokTypes.comma);)ct.expressions.push(this.parseMaybeAssign(et));return this.finishNode(ct,"SequenceExpression")}return lt},_.parseParenExpression=function(){this.pushCx(),this.expect(a.tokTypes.parenL);var et=this.parseExpression();return this.popCx(),this.expect(a.tokTypes.parenR),et},_.parseMaybeAssign=function(et){if(this.inGenerator&&this.toks.isContextual("yield")){var st=this.startNode();return this.next(),this.semicolon()||this.canInsertSemicolon()||this.tok.type!==a.tokTypes.star&&!this.tok.type.startsExpr?(st.delegate=!1,st.argument=null):(st.delegate=this.eat(a.tokTypes.star),st.argument=this.parseMaybeAssign()),this.finishNode(st,"YieldExpression")}var lt=this.storeCurrentPos(),ct=this.parseMaybeConditional(et);if(this.tok.type.isAssign){var ht=this.startNodeAt(lt);return ht.operator=this.tok.value,ht.left=this.tok.type===a.tokTypes.eq?this.toAssignable(ct):this.checkLVal(ct),this.next(),ht.right=this.parseMaybeAssign(et),this.finishNode(ht,"AssignmentExpression")}return ct},_.parseMaybeConditional=function(et){var st=this.storeCurrentPos(),lt=this.parseExprOps(et);if(this.eat(a.tokTypes.question)){var ct=this.startNodeAt(st);return ct.test=lt,ct.consequent=this.parseMaybeAssign(),ct.alternate=this.expect(a.tokTypes.colon)?this.parseMaybeAssign(et):this.dummyIdent(),this.finishNode(ct,"ConditionalExpression")}return lt},_.parseExprOps=function(et){var st=this.storeCurrentPos(),lt=this.curIndent,ct=this.curLineStart;return this.parseExprOp(this.parseMaybeUnary(!1),st,-1,et,lt,ct)},_.parseExprOp=function(et,st,lt,ct,ht,ut){if(this.curLineStart!==ut&&this.curIndentlt){var mt=this.startNodeAt(st);if(mt.left=et,mt.operator=this.tok.value,this.next(),this.curLineStart!==ut&&this.curIndent=8&&this.toks.isContextual("await")&&(this.inAsync||this.toks.inModule&&this.options.ecmaVersion>=13||!this.inFunction&&this.options.allowAwaitOutsideFunction))lt=this.parseAwait(),et=!0;else if(this.tok.type.prefix){var ct=this.startNode(),ht=this.tok.type===a.tokTypes.incDec;ht||(et=!0),ct.operator=this.tok.value,ct.prefix=!0,this.next(),ct.argument=this.parseMaybeUnary(!0),ht&&(ct.argument=this.checkLVal(ct.argument)),lt=this.finishNode(ct,ht?"UpdateExpression":"UnaryExpression")}else if(this.tok.type===a.tokTypes.ellipsis){var ut=this.startNode();this.next(),ut.argument=this.parseMaybeUnary(et),lt=this.finishNode(ut,"SpreadElement")}else if(!et&&this.tok.type===a.tokTypes.privateId)lt=this.parsePrivateIdent();else for(lt=this.parseExprSubscripts();this.tok.type.postfix&&!this.canInsertSemicolon();){var pt=this.startNodeAt(st);pt.operator=this.tok.value,pt.prefix=!1,pt.argument=this.checkLVal(lt),this.next(),lt=this.finishNode(pt,"UpdateExpression")}if(!et&&this.eat(a.tokTypes.starstar)){var mt=this.startNodeAt(st);return mt.operator="**",mt.left=lt,mt.right=this.parseMaybeUnary(!1),this.finishNode(mt,"BinaryExpression")}return lt},_.parseExprSubscripts=function(){var et=this.storeCurrentPos();return this.parseSubscripts(this.parseExprAtom(),et,!1,this.curIndent,this.curLineStart)},_.parseSubscripts=function(et,st,lt,ct,ht){for(var ut=this.options.ecmaVersion>=11,pt=!1;;){if(this.curLineStart!==ht&&this.curIndent<=ct&&this.tokenStartsLine())if(this.tok.type===a.tokTypes.dot&&this.curIndent===ct)--ct;else break;var mt=et.type==="Identifier"&&et.name==="async"&&!this.canInsertSemicolon(),gt=ut&&this.eat(a.tokTypes.questionDot);if(gt&&(pt=!0),gt&&this.tok.type!==a.tokTypes.parenL&&this.tok.type!==a.tokTypes.bracketL&&this.tok.type!==a.tokTypes.backQuote||this.eat(a.tokTypes.dot)){var dt=this.startNodeAt(st);dt.object=et,this.curLineStart!==ht&&this.curIndent<=ct&&this.tokenStartsLine()?dt.property=this.dummyIdent():dt.property=this.parsePropertyAccessor()||this.dummyIdent(),dt.computed=!1,ut&&(dt.optional=gt),et=this.finishNode(dt,"MemberExpression")}else if(this.tok.type===a.tokTypes.bracketL){this.pushCx(),this.next();var St=this.startNodeAt(st);St.object=et,St.property=this.parseExpression(),St.computed=!0,ut&&(St.optional=gt),this.popCx(),this.expect(a.tokTypes.bracketR),et=this.finishNode(St,"MemberExpression")}else if(!lt&&this.tok.type===a.tokTypes.parenL){var xt=this.parseExprList(a.tokTypes.parenR);if(mt&&this.eat(a.tokTypes.arrow))return this.parseArrowExpression(this.startNodeAt(st),xt,!0);var yt=this.startNodeAt(st);yt.callee=et,yt.arguments=xt,ut&&(yt.optional=gt),et=this.finishNode(yt,"CallExpression")}else if(this.tok.type===a.tokTypes.backQuote){var _t=this.startNodeAt(st);_t.tag=et,_t.quasi=this.parseTemplate(),et=this.finishNode(_t,"TaggedTemplateExpression")}else break}if(pt){var Ct=this.startNodeAt(st);Ct.expression=et,et=this.finishNode(Ct,"ChainExpression")}return et},_.parseExprAtom=function(){var et;switch(this.tok.type){case a.tokTypes._this:case a.tokTypes._super:var st=this.tok.type===a.tokTypes._this?"ThisExpression":"Super";return et=this.startNode(),this.next(),this.finishNode(et,st);case a.tokTypes.name:var lt=this.storeCurrentPos(),ct=this.parseIdent(),ht=!1;if(ct.name==="async"&&!this.canInsertSemicolon()){if(this.eat(a.tokTypes._function))return this.toks.overrideContext(a.tokContexts.f_expr),this.parseFunction(this.startNodeAt(lt),!1,!0);this.tok.type===a.tokTypes.name&&(ct=this.parseIdent(),ht=!0)}return this.eat(a.tokTypes.arrow)?this.parseArrowExpression(this.startNodeAt(lt),[ct],ht):ct;case a.tokTypes.regexp:et=this.startNode();var ut=this.tok.value;return et.regex={pattern:ut.pattern,flags:ut.flags},et.value=ut.value,et.raw=this.input.slice(this.tok.start,this.tok.end),this.next(),this.finishNode(et,"Literal");case a.tokTypes.num:case a.tokTypes.string:return et=this.startNode(),et.value=this.tok.value,et.raw=this.input.slice(this.tok.start,this.tok.end),this.tok.type===a.tokTypes.num&&et.raw.charCodeAt(et.raw.length-1)===110&&(et.bigint=et.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(et,"Literal");case a.tokTypes._null:case a.tokTypes._true:case a.tokTypes._false:return et=this.startNode(),et.value=this.tok.type===a.tokTypes._null?null:this.tok.type===a.tokTypes._true,et.raw=this.tok.type.keyword,this.next(),this.finishNode(et,"Literal");case a.tokTypes.parenL:var pt=this.storeCurrentPos();this.next();var mt=this.parseExpression();if(this.expect(a.tokTypes.parenR),this.eat(a.tokTypes.arrow)){var gt=mt.expressions||[mt];return gt.length&&tt(gt[gt.length-1])&>.pop(),this.parseArrowExpression(this.startNodeAt(pt),gt)}if(this.options.preserveParens){var dt=this.startNodeAt(pt);dt.expression=mt,mt=this.finishNode(dt,"ParenthesizedExpression")}return mt;case a.tokTypes.bracketL:return et=this.startNode(),et.elements=this.parseExprList(a.tokTypes.bracketR,!0),this.finishNode(et,"ArrayExpression");case a.tokTypes.braceL:return this.toks.overrideContext(a.tokContexts.b_expr),this.parseObj();case a.tokTypes._class:return this.parseClass(!1);case a.tokTypes._function:return et=this.startNode(),this.next(),this.parseFunction(et,!1);case a.tokTypes._new:return this.parseNew();case a.tokTypes.backQuote:return this.parseTemplate();case a.tokTypes._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.dummyIdent();default:return this.dummyIdent()}},_.parseExprImport=function(){var et=this.startNode(),st=this.parseIdent(!0);switch(this.tok.type){case a.tokTypes.parenL:return this.parseDynamicImport(et);case a.tokTypes.dot:return et.meta=st,this.parseImportMeta(et);default:return et.name="import",this.finishNode(et,"Identifier")}},_.parseDynamicImport=function(et){return et.source=this.parseExprList(a.tokTypes.parenR)[0]||this.dummyString(),this.finishNode(et,"ImportExpression")},_.parseImportMeta=function(et){return this.next(),et.property=this.parseIdent(!0),this.finishNode(et,"MetaProperty")},_.parseNew=function(){var et=this.startNode(),st=this.curIndent,lt=this.curLineStart,ct=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(a.tokTypes.dot))return et.meta=ct,et.property=this.parseIdent(!0),this.finishNode(et,"MetaProperty");var ht=this.storeCurrentPos();return et.callee=this.parseSubscripts(this.parseExprAtom(),ht,!0,st,lt),this.tok.type===a.tokTypes.parenL?et.arguments=this.parseExprList(a.tokTypes.parenR):et.arguments=[],this.finishNode(et,"NewExpression")},_.parseTemplateElement=function(){var et=this.startNode();return this.tok.type===a.tokTypes.invalidTemplate?et.value={raw:this.tok.value,cooked:null}:et.value={raw:this.input.slice(this.tok.start,this.tok.end).replace(/\r\n?/g,` +`),cooked:this.tok.value},this.next(),et.tail=this.tok.type===a.tokTypes.backQuote,this.finishNode(et,"TemplateElement")},_.parseTemplate=function(){var et=this.startNode();this.next(),et.expressions=[];var st=this.parseTemplateElement();for(et.quasis=[st];!st.tail;)this.next(),et.expressions.push(this.parseExpression()),this.expect(a.tokTypes.braceR)?st=this.parseTemplateElement():(st=this.startNode(),st.value={cooked:"",raw:""},st.tail=!0,this.finishNode(st,"TemplateElement")),et.quasis.push(st);return this.expect(a.tokTypes.backQuote),this.finishNode(et,"TemplateLiteral")},_.parseObj=function(){var et=this.startNode();et.properties=[],this.pushCx();var st=this.curIndent+1,lt=this.curLineStart;for(this.eat(a.tokTypes.braceL),this.curIndent+1=9&&this.eat(a.tokTypes.ellipsis)){ct.argument=this.parseMaybeAssign(),et.properties.push(this.finishNode(ct,"SpreadElement")),this.eat(a.tokTypes.comma);continue}if(this.options.ecmaVersion>=6&&(pt=this.storeCurrentPos(),ct.method=!1,ct.shorthand=!1,ht=this.eat(a.tokTypes.star)),this.parsePropertyName(ct),this.toks.isAsyncProp(ct)?(ut=!0,ht=this.options.ecmaVersion>=9&&this.eat(a.tokTypes.star),this.parsePropertyName(ct)):ut=!1,tt(ct.key)){tt(this.parseMaybeAssign())&&this.next(),this.eat(a.tokTypes.comma);continue}if(this.eat(a.tokTypes.colon))ct.kind="init",ct.value=this.parseMaybeAssign();else if(this.options.ecmaVersion>=6&&(this.tok.type===a.tokTypes.parenL||this.tok.type===a.tokTypes.braceL))ct.kind="init",ct.method=!0,ct.value=this.parseMethod(ht,ut);else if(this.options.ecmaVersion>=5&&ct.key.type==="Identifier"&&!ct.computed&&(ct.key.name==="get"||ct.key.name==="set")&&this.tok.type!==a.tokTypes.comma&&this.tok.type!==a.tokTypes.braceR&&this.tok.type!==a.tokTypes.eq)ct.kind=ct.key.name,this.parsePropertyName(ct),ct.value=this.parseMethod(!1);else{if(ct.kind="init",this.options.ecmaVersion>=6)if(this.eat(a.tokTypes.eq)){var mt=this.startNodeAt(pt);mt.operator="=",mt.left=ct.key,mt.right=this.parseMaybeAssign(),ct.value=this.finishNode(mt,"AssignmentExpression")}else ct.value=ct.key;else ct.value=this.dummyIdent();ct.shorthand=!0}et.properties.push(this.finishNode(ct,"Property")),this.eat(a.tokTypes.comma)}return this.popCx(),this.eat(a.tokTypes.braceR)||(this.last.end=this.tok.start,this.options.locations&&(this.last.loc.end=this.tok.loc.start)),this.finishNode(et,"ObjectExpression")},_.parsePropertyName=function(et){if(this.options.ecmaVersion>=6)if(this.eat(a.tokTypes.bracketL)){et.computed=!0,et.key=this.parseExpression(),this.expect(a.tokTypes.bracketR);return}else et.computed=!1;var st=this.tok.type===a.tokTypes.num||this.tok.type===a.tokTypes.string?this.parseExprAtom():this.parseIdent();et.key=st||this.dummyIdent()},_.parsePropertyAccessor=function(){if(this.tok.type===a.tokTypes.name||this.tok.type.keyword)return this.parseIdent();if(this.tok.type===a.tokTypes.privateId)return this.parsePrivateIdent()},_.parseIdent=function(){var et=this.tok.type===a.tokTypes.name?this.tok.value:this.tok.type.keyword;if(!et)return this.dummyIdent();this.tok.type.keyword&&(this.toks.type=a.tokTypes.name);var st=this.startNode();return this.next(),st.name=et,this.finishNode(st,"Identifier")},_.parsePrivateIdent=function(){var et=this.startNode();return et.name=this.tok.value,this.next(),this.finishNode(et,"PrivateIdentifier")},_.initFunction=function(et){et.id=null,et.params=[],this.options.ecmaVersion>=6&&(et.generator=!1,et.expression=!1),this.options.ecmaVersion>=8&&(et.async=!1)},_.toAssignable=function(et,st){if(!(!et||et.type==="Identifier"||et.type==="MemberExpression"&&!st))if(et.type==="ParenthesizedExpression")this.toAssignable(et.expression,st);else{if(this.options.ecmaVersion<6)return this.dummyIdent();if(et.type==="ObjectExpression"){et.type="ObjectPattern";for(var lt=0,ct=et.properties;lt=6&&(lt.generator=!!et),this.options.ecmaVersion>=8&&(lt.async=!!st),this.inAsync=lt.async,this.inGenerator=lt.generator,this.inFunction=!0,lt.params=this.parseFunctionParams(),lt.body=this.parseBlock(),this.toks.adaptDirectivePrologue(lt.body.body),this.inAsync=ct,this.inGenerator=ht,this.inFunction=ut,this.finishNode(lt,"FunctionExpression")},_.parseArrowExpression=function(et,st,lt){var ct=this.inAsync,ht=this.inGenerator,ut=this.inFunction;return this.initFunction(et),this.options.ecmaVersion>=8&&(et.async=!!lt),this.inAsync=et.async,this.inGenerator=!1,this.inFunction=!0,et.params=this.toAssignableList(st,!0),et.expression=this.tok.type!==a.tokTypes.braceL,et.expression?et.body=this.parseMaybeAssign():(et.body=this.parseBlock(),this.toks.adaptDirectivePrologue(et.body.body)),this.inAsync=ct,this.inGenerator=ht,this.inFunction=ut,this.finishNode(et,"ArrowFunctionExpression")},_.parseExprList=function(et,st){this.pushCx();var lt=this.curIndent,ct=this.curLineStart,ht=[];for(this.next();!this.closes(et,lt+1,ct);){if(this.eat(a.tokTypes.comma)){ht.push(st?null:this.dummyIdent());continue}var ut=this.parseMaybeAssign();if(tt(ut)){if(this.closes(et,lt,ct))break;this.next()}else ht.push(ut);this.eat(a.tokTypes.comma)}return this.popCx(),this.eat(et)||(this.last.end=this.tok.start,this.options.locations&&(this.last.loc.end=this.tok.loc.start)),ht},_.parseAwait=function(){var et=this.startNode();return this.next(),et.argument=this.parseMaybeUnary(),this.finishNode(et,"AwaitExpression")},a.defaultOptions.tabSize=4;function $(et,st){return at.parse(et,st)}o.LooseParser=at,o.isDummy=tt,o.parse=$})})(acornLoose,acornLoose.exports);var acornLooseExports=acornLoose.exports,validator={},validityErrors={};Object.defineProperty(validityErrors,"__esModule",{value:!0});validityErrors.NoAssignmentToForVariable=void 0;const types_1$j=types;class NoAssignmentToForVariable{constructor(s){this.node=s,this.type=types_1$j.ErrorType.SYNTAX,this.severity=types_1$j.ErrorSeverity.ERROR}get location(){return this.node.loc}explain(){return"Assignment to a for loop variable in the for loop is not allowed."}elaborate(){return this.explain()}}validityErrors.NoAssignmentToForVariable=NoAssignmentToForVariable;var hasRequiredValidator;function requireValidator(){if(hasRequiredValidator)return validator;hasRequiredValidator=1,Object.defineProperty(validator,"__esModule",{value:!0}),validator.validateAndAnnotate=void 0;const i=requireErrors(),s=validityErrors,o=astCreator,a=walkers$1;class rt{constructor(at){this.isConstant=at,this.accessedBeforeDeclaration=!1}}function tt(ot,at){const nt=new Map,it=new Map;function j(st){const lt=new Map;for(const ct of st.body)ct.type==="VariableDeclaration"?lt.set((0,o.getVariableDecarationName)(ct),new rt(ct.kind==="const")):ct.type==="FunctionDeclaration"&<.set(ct.id.name,new rt(!0));it.set(st,!1),nt.set(st,lt)}function _(st){nt.set(st,new Map(st.params.map(lt=>[lt.name,new rt(!1)]))),it.set(st,!1)}(0,a.ancestor)(ot,{Program:j,BlockStatement:j,FunctionDeclaration:_,ArrowFunctionExpression:_,ForStatement(st,lt){const ct=st.init;ct.type==="VariableDeclaration"&&(nt.set(st,new Map([[(0,o.getVariableDecarationName)(ct),new rt(ct.kind==="const")]])),it.set(st,!1))}});function $(st,lt){const ct=st.name,ht=lt[lt.length-2];for(let ut=lt.length-1;ut>=0;ut--){const pt=lt[ut],mt=nt.get(pt);if(mt!=null&&mt.has(ct)){mt.get(ct).accessedBeforeDeclaration=!0,ht.type==="AssignmentExpression"&&ht.left===st&&(mt.get(ct).isConstant&&at.errors.push(new i.ConstAssignment(ht,ct)),pt.type==="ForStatement"&&pt.init!==ht&&pt.update!==ht&&at.errors.push(new s.NoAssignmentToForVariable(ht)));break}}}const et=Object.assign(Object.assign({},a.base),{VariableDeclarator(st,lt,ct){st.init&&ct(st.init,lt,"Expression")}});return(0,a.ancestor)(ot,{VariableDeclaration(st,lt){const ct=lt[lt.length-2],ht=(0,o.getVariableDecarationName)(st),ut=nt.get(ct).get(ht).accessedBeforeDeclaration;st.typability=ut?"Untypable":"NotYetTyped"},Identifier:$,FunctionDeclaration(st,lt){const ct=lt[lt.length-2];st.typability=it.get(ct)?"Untypable":"NotYetTyped"},Pattern(st,lt){st.type==="Identifier"?$(st,lt):st.type==="MemberExpression"&&st.object.type==="Identifier"&&$(st.object,lt)},CallExpression(st,lt){for(let ct=lt.length-1;ct>=0;ct--){const ht=lt[ct];if(it.has(ht)){it.set(ht,!0);break}}}},et),ot}return validator.validateAndAnnotate=tt,validator}var rules$1={},bracesAroundFor$1={};Object.defineProperty(bracesAroundFor$1,"__esModule",{value:!0});bracesAroundFor$1.BracesAroundForError=void 0;const astring_1$7=astring,types_1$i=types;class BracesAroundForError{constructor(s){this.node=s,this.type=types_1$i.ErrorType.SYNTAX,this.severity=types_1$i.ErrorSeverity.ERROR}get location(){return this.node.loc}explain(){return'Missing curly braces around "for" block.'}elaborate(){const s=(0,astring_1$7.generate)(this.node.init),o=(0,astring_1$7.generate)(this.node.test),a=(0,astring_1$7.generate)(this.node.update);return`Remember to enclose your "for" block with braces: ${` for (${s} ${o}; ${a}) { //code goes here @@ -3700,14 +3700,14 @@ function accumulate(f, initial, xs) { `+this.fixs.map(o=>" "+(0,astring_1.generate)(o)).join(` `)+` -`}}singleVariableDeclaration$1.MultipleDeclarationsError=MultipleDeclarationsError;const singleVariableDeclaration={name:"single-variable-declaration",checkers:{VariableDeclaration(i,s){return i.declarations.length>1?[new MultipleDeclarationsError(i)]:[]}}};singleVariableDeclaration$1.default=singleVariableDeclaration;Object.defineProperty(rules$1,"__esModule",{value:!0});const bracesAroundFor_1=bracesAroundFor$1,bracesAroundIfElse_1=bracesAroundIfElse$1,bracesAroundWhile_1=bracesAroundWhile$1,forStatementMustHaveAllParts_1=forStatementMustHaveAllParts$1,noDeclareMutable_1=noDeclareMutable$1,noDotAbbreviation_1=noDotAbbreviation$1,noEval_1=noEval$1,noHolesInArrays_1=noHolesInArrays$1,noIfWithoutElse_1=noIfWithoutElse$1,noImplicitDeclareUndefined_1=noImplicitDeclareUndefined$1,noImplicitReturnUndefined_1=noImplicitReturnUndefined$1,noNull_1=noNull$1,noSpreadInArray_1=noSpreadInArray$1,noTemplateExpression_1=noTemplateExpression$1,noUnspecifiedLiteral_1=noUnspecifiedLiteral$1,noUnspecifiedOperator_1=noUnspecifiedOperator$1,noUpdateAssignment_1=noUpdateAssignment$1,noVar_1=noVar$1,singleVariableDeclaration_1=singleVariableDeclaration$1,rules=[bracesAroundFor_1.default,bracesAroundIfElse_1.default,bracesAroundWhile_1.default,forStatementMustHaveAllParts_1.default,noDeclareMutable_1.default,noDotAbbreviation_1.default,noIfWithoutElse_1.default,noImplicitDeclareUndefined_1.default,noImplicitReturnUndefined_1.default,noNull_1.default,noUnspecifiedLiteral_1.default,noUnspecifiedOperator_1.default,noUpdateAssignment_1.default,noVar_1.default,singleVariableDeclaration_1.default,noEval_1.default,noHolesInArrays_1.default,noTemplateExpression_1.default,noSpreadInArray_1.default];rules$1.default=rules;var syntaxBlacklist={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.libraryParserLanguage=void 0,i.libraryParserLanguage=100;const s={Program:1,BlockStatement:1,ExpressionStatement:1,IfStatement:1,ReturnStatement:1,FunctionDeclaration:1,VariableDeclaration:1,VariableDeclarator:1,ArrowFunctionExpression:1,UnaryExpression:1,BinaryExpression:1,LogicalExpression:1,ConditionalExpression:1,CallExpression:1,Identifier:1,Literal:1,TemplateLiteral:1,TemplateElement:1,DebuggerStatement:1,ImportDeclaration:1,ImportSpecifier:1,BreakStatement:3,ContinueStatement:3,WhileStatement:3,ForStatement:3,MemberPattern:3,ArrayExpression:3,AssignmentExpression:3,MemberExpression:3,Property:3,SpreadElement:3,RestElement:3,ObjectExpression:i.libraryParserLanguage,NewExpression:i.libraryParserLanguage,TryStatement:i.libraryParserLanguage,CatchClause:i.libraryParserLanguage,ThrowStatement:i.libraryParserLanguage,ThisExpression:i.libraryParserLanguage,Super:i.libraryParserLanguage,ClassDeclaration:i.libraryParserLanguage,ClassExpression:i.libraryParserLanguage,Class:i.libraryParserLanguage,ClassBody:i.libraryParserLanguage,MethodDefinition:i.libraryParserLanguage,FunctionExpression:i.libraryParserLanguage,UpdateExpression:1/0,Statement:1/0,EmptyStatement:1/0,ParenthesizedExpression:1/0,LabeledStatement:1/0,WithStatement:1/0,SwitchStatement:1/0,SwitchCase:1/0,YieldExpression:1/0,AwaitExpression:1/0,DoWhileStatement:1/0,ForInStatement:1/0,ForOfStatement:1/0,ForInit:1/0,Function:1/0,Pattern:1/0,VariablePattern:1/0,ArrayPattern:1/0,ObjectPattern:1/0,Expression:1/0,MetaProperty:1/0,SequenceExpression:1/0,AssignmentPattern:1/0,ExportNamedDeclaration:1/0,ExportDefaultDeclaration:1/0,ExportAllDeclaration:1/0,ImportDefaultSpecifier:1/0,ImportNamespaceSpecifier:1/0,TaggedTemplateExpression:1/0};i.default=s})(syntaxBlacklist);var hasRequiredParser$1;function requireParser$1(){return hasRequiredParser$1||(hasRequiredParser$1=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.typedParse=i.looseParse=i.parseWithComments=i.createAcornParserOptions=i.tokenize=i.parse=i.parseAt=i.TrailingCommaError=i.MissingSemicolonError=i.FatalSyntaxError=i.DisallowedConstructError=void 0;const s=acornExports,o=acornLooseExports,a=constants,rt=types,et=formatters,ot=walkers$1,at=requireValidator(),nt=rules$1,it=syntaxBlacklist;class j{constructor(yt){this.node=yt,this.type=rt.ErrorType.SYNTAX,this.severity=rt.ErrorSeverity.ERROR,this.nodeType=this.formatNodeType(this.node.type)}get location(){return this.node.loc}explain(){return`${this.nodeType} are not allowed`}elaborate(){return(0,et.stripIndent)` +`}}singleVariableDeclaration$1.MultipleDeclarationsError=MultipleDeclarationsError;const singleVariableDeclaration={name:"single-variable-declaration",checkers:{VariableDeclaration(i,s){return i.declarations.length>1?[new MultipleDeclarationsError(i)]:[]}}};singleVariableDeclaration$1.default=singleVariableDeclaration;Object.defineProperty(rules$1,"__esModule",{value:!0});const bracesAroundFor_1=bracesAroundFor$1,bracesAroundIfElse_1=bracesAroundIfElse$1,bracesAroundWhile_1=bracesAroundWhile$1,forStatementMustHaveAllParts_1=forStatementMustHaveAllParts$1,noDeclareMutable_1=noDeclareMutable$1,noDotAbbreviation_1=noDotAbbreviation$1,noEval_1=noEval$1,noHolesInArrays_1=noHolesInArrays$1,noIfWithoutElse_1=noIfWithoutElse$1,noImplicitDeclareUndefined_1=noImplicitDeclareUndefined$1,noImplicitReturnUndefined_1=noImplicitReturnUndefined$1,noNull_1=noNull$1,noSpreadInArray_1=noSpreadInArray$1,noTemplateExpression_1=noTemplateExpression$1,noUnspecifiedLiteral_1=noUnspecifiedLiteral$1,noUnspecifiedOperator_1=noUnspecifiedOperator$1,noUpdateAssignment_1=noUpdateAssignment$1,noVar_1=noVar$1,singleVariableDeclaration_1=singleVariableDeclaration$1,rules=[bracesAroundFor_1.default,bracesAroundIfElse_1.default,bracesAroundWhile_1.default,forStatementMustHaveAllParts_1.default,noDeclareMutable_1.default,noDotAbbreviation_1.default,noIfWithoutElse_1.default,noImplicitDeclareUndefined_1.default,noImplicitReturnUndefined_1.default,noNull_1.default,noUnspecifiedLiteral_1.default,noUnspecifiedOperator_1.default,noUpdateAssignment_1.default,noVar_1.default,singleVariableDeclaration_1.default,noEval_1.default,noHolesInArrays_1.default,noTemplateExpression_1.default,noSpreadInArray_1.default];rules$1.default=rules;var syntaxBlacklist={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.libraryParserLanguage=void 0,i.libraryParserLanguage=100;const s={Program:1,BlockStatement:1,ExpressionStatement:1,IfStatement:1,ReturnStatement:1,FunctionDeclaration:1,VariableDeclaration:1,VariableDeclarator:1,ArrowFunctionExpression:1,UnaryExpression:1,BinaryExpression:1,LogicalExpression:1,ConditionalExpression:1,CallExpression:1,Identifier:1,Literal:1,TemplateLiteral:1,TemplateElement:1,DebuggerStatement:1,ImportDeclaration:1,ImportSpecifier:1,BreakStatement:3,ContinueStatement:3,WhileStatement:3,ForStatement:3,MemberPattern:3,ArrayExpression:3,AssignmentExpression:3,MemberExpression:3,Property:3,SpreadElement:3,RestElement:3,ObjectExpression:i.libraryParserLanguage,NewExpression:i.libraryParserLanguage,TryStatement:i.libraryParserLanguage,CatchClause:i.libraryParserLanguage,ThrowStatement:i.libraryParserLanguage,ThisExpression:i.libraryParserLanguage,Super:i.libraryParserLanguage,ClassDeclaration:i.libraryParserLanguage,ClassExpression:i.libraryParserLanguage,Class:i.libraryParserLanguage,ClassBody:i.libraryParserLanguage,MethodDefinition:i.libraryParserLanguage,FunctionExpression:i.libraryParserLanguage,UpdateExpression:1/0,Statement:1/0,EmptyStatement:1/0,ParenthesizedExpression:1/0,LabeledStatement:1/0,WithStatement:1/0,SwitchStatement:1/0,SwitchCase:1/0,YieldExpression:1/0,AwaitExpression:1/0,DoWhileStatement:1/0,ForInStatement:1/0,ForOfStatement:1/0,ForInit:1/0,Function:1/0,Pattern:1/0,VariablePattern:1/0,ArrayPattern:1/0,ObjectPattern:1/0,Expression:1/0,MetaProperty:1/0,SequenceExpression:1/0,AssignmentPattern:1/0,ExportNamedDeclaration:1/0,ExportDefaultDeclaration:1/0,ExportAllDeclaration:1/0,ImportDefaultSpecifier:1/0,ImportNamespaceSpecifier:1/0,TaggedTemplateExpression:1/0};i.default=s})(syntaxBlacklist);var hasRequiredParser$1;function requireParser$1(){return hasRequiredParser$1||(hasRequiredParser$1=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.typedParse=i.looseParse=i.parseWithComments=i.createAcornParserOptions=i.tokenize=i.parse=i.parseAt=i.TrailingCommaError=i.MissingSemicolonError=i.FatalSyntaxError=i.DisallowedConstructError=void 0;const s=acornExports,o=acornLooseExports,a=constants,rt=types,tt=formatters,ot=walkers$1,at=requireValidator(),nt=rules$1,it=syntaxBlacklist;class j{constructor(yt){this.node=yt,this.type=rt.ErrorType.SYNTAX,this.severity=rt.ErrorSeverity.ERROR,this.nodeType=this.formatNodeType(this.node.type)}get location(){return this.node.loc}explain(){return`${this.nodeType} are not allowed`}elaborate(){return(0,tt.stripIndent)` You are trying to use ${this.nodeType}, which is not allowed (yet). - `}formatNodeType(yt){switch(yt){case"ThisExpression":return"'this' expressions";case"Property":return"Properties";default:return yt.split(/(?=[A-Z])/).map((Ct,Et)=>Et===0?Ct:Ct.toLowerCase()).join(" ")+"s"}}}i.DisallowedConstructError=j;class _{constructor(yt,_t){this.location=yt,this.message=_t,this.type=rt.ErrorType.SYNTAX,this.severity=rt.ErrorSeverity.ERROR}explain(){return this.message}elaborate(){return"There is a syntax error in your program"}}i.FatalSyntaxError=_;class ${constructor(yt){this.location=yt,this.type=rt.ErrorType.SYNTAX,this.severity=rt.ErrorSeverity.ERROR}explain(){return"Missing semicolon at the end of statement"}elaborate(){return"Every statement must be terminated by a semicolon."}}i.MissingSemicolonError=$;class tt{constructor(yt){this.location=yt}explain(){return"Trailing comma"}elaborate(){return"Please remove the trailing comma"}}i.TrailingCommaError=tt;function st(xt,yt){let _t;try{_t=(0,s.parseExpressionAt)(xt,yt,a.ACORN_PARSE_OPTIONS)}catch{return}return _t}i.parseAt=st;function lt(xt,yt){let _t;try{_t=(0,s.parse)(xt,(0,i.createAcornParserOptions)(yt)),(0,ot.ancestor)(_t,St,void 0,yt)}catch(Et){if(Et instanceof SyntaxError){const kt=Et.loc,Tt={start:{line:kt.line,column:kt.column},end:{line:kt.line,column:kt.column+1}};yt.errors.push(new _(Tt,Et.toString()))}else throw Et}const Ct=yt.errors.find(Et=>Et.severity===rt.ErrorSeverity.ERROR);if(_t&&!Ct)return _t}i.parse=lt;function ct(xt,yt){return[...(0,s.tokenizer)(xt,(0,i.createAcornParserOptions)(yt))]}i.tokenize=ct;const ht=xt=>({sourceType:"module",ecmaVersion:6,locations:!0,onInsertedSemicolon(yt,_t){xt.errors.push(new $({end:{line:_t.line,column:_t.column+1},start:_t}))},onTrailingComma(yt,_t){xt.errors.push(new tt({end:{line:_t.line,column:_t.column+1},start:_t}))}});i.createAcornParserOptions=ht;function ut(xt){let yt=[];const _t={sourceType:"module",ecmaVersion:6,locations:!0,onComment:yt};let Ct;try{Ct=(0,s.parse)(xt,_t)}catch{yt=[],Ct=(0,o.parse)(xt,_t)}return[Ct,yt]}i.parseWithComments=ut;function pt(xt,yt){return(0,o.parse)(xt,(0,i.createAcornParserOptions)(yt))}i.looseParse=pt;function mt(xt,yt){const _t=pt(xt,yt);return _t===void 0?null:(0,at.validateAndAnnotate)(_t,yt)}i.typedParse=mt;function gt(xt,yt){const _t=new Map,Ct=new Set;return Object.entries(xt).map(kt=>{const Tt=kt[0];_t.set(Tt,($t,It,Ot)=>{Ct.has($t)||(Ct.add($t),It.chapter{const Tt=kt.checkers;Object.entries(Tt).forEach(It=>{const Ot=It[0],Mt=It[1],Dt=_t.get(Ot),Bt=(Kt,Wt,zt)=>{if(typeof kt.disableOn<"u"&&Wt.chapter>=kt.disableOn)return;Mt(Kt,zt).forEach(Zt=>Wt.errors.push(Zt))};_t.set(Ot,(Kt,Wt,zt)=>{Dt(Kt,Wt,zt),Bt(Kt,Wt,zt)})})}),dt(_t)}const dt=xt=>Array.from(xt).reduce((yt,[_t,Ct])=>Object.assign(yt,{[_t]:Ct}),{}),St=gt(it.default,nt.default)}(parser)),parser}var hasRequiredParser;function requireParser(){if(hasRequiredParser)return parser$1;hasRequiredParser=1,Object.defineProperty(parser$1,"__esModule",{value:!0}),parser$1.tokenize=parser$1.parse=void 0;const i=requireParser$1(),s=syntaxBlacklist,o=formatters,a=requireList();class rt extends Error{constructor(st){super(st),this.name="ParseError"}}function et(){console.error((0,o.oneLine)` + `}formatNodeType(yt){switch(yt){case"ThisExpression":return"'this' expressions";case"Property":return"Properties";default:return yt.split(/(?=[A-Z])/).map((Ct,Et)=>Et===0?Ct:Ct.toLowerCase()).join(" ")+"s"}}}i.DisallowedConstructError=j;class _{constructor(yt,_t){this.location=yt,this.message=_t,this.type=rt.ErrorType.SYNTAX,this.severity=rt.ErrorSeverity.ERROR}explain(){return this.message}elaborate(){return"There is a syntax error in your program"}}i.FatalSyntaxError=_;class ${constructor(yt){this.location=yt,this.type=rt.ErrorType.SYNTAX,this.severity=rt.ErrorSeverity.ERROR}explain(){return"Missing semicolon at the end of statement"}elaborate(){return"Every statement must be terminated by a semicolon."}}i.MissingSemicolonError=$;class et{constructor(yt){this.location=yt}explain(){return"Trailing comma"}elaborate(){return"Please remove the trailing comma"}}i.TrailingCommaError=et;function st(xt,yt){let _t;try{_t=(0,s.parseExpressionAt)(xt,yt,a.ACORN_PARSE_OPTIONS)}catch{return}return _t}i.parseAt=st;function lt(xt,yt){let _t;try{_t=(0,s.parse)(xt,(0,i.createAcornParserOptions)(yt)),(0,ot.ancestor)(_t,St,void 0,yt)}catch(Et){if(Et instanceof SyntaxError){const kt=Et.loc,Tt={start:{line:kt.line,column:kt.column},end:{line:kt.line,column:kt.column+1}};yt.errors.push(new _(Tt,Et.toString()))}else throw Et}const Ct=yt.errors.find(Et=>Et.severity===rt.ErrorSeverity.ERROR);if(_t&&!Ct)return _t}i.parse=lt;function ct(xt,yt){return[...(0,s.tokenizer)(xt,(0,i.createAcornParserOptions)(yt))]}i.tokenize=ct;const ht=xt=>({sourceType:"module",ecmaVersion:6,locations:!0,onInsertedSemicolon(yt,_t){xt.errors.push(new $({end:{line:_t.line,column:_t.column+1},start:_t}))},onTrailingComma(yt,_t){xt.errors.push(new et({end:{line:_t.line,column:_t.column+1},start:_t}))}});i.createAcornParserOptions=ht;function ut(xt){let yt=[];const _t={sourceType:"module",ecmaVersion:6,locations:!0,onComment:yt};let Ct;try{Ct=(0,s.parse)(xt,_t)}catch{yt=[],Ct=(0,o.parse)(xt,_t)}return[Ct,yt]}i.parseWithComments=ut;function pt(xt,yt){return(0,o.parse)(xt,(0,i.createAcornParserOptions)(yt))}i.looseParse=pt;function mt(xt,yt){const _t=pt(xt,yt);return _t===void 0?null:(0,at.validateAndAnnotate)(_t,yt)}i.typedParse=mt;function gt(xt,yt){const _t=new Map,Ct=new Set;return Object.entries(xt).map(kt=>{const Tt=kt[0];_t.set(Tt,($t,It,Ot)=>{Ct.has($t)||(Ct.add($t),It.chapter{const Tt=kt.checkers;Object.entries(Tt).forEach(It=>{const Ot=It[0],Mt=It[1],Dt=_t.get(Ot),Bt=(Kt,Wt,zt)=>{if(typeof kt.disableOn<"u"&&Wt.chapter>=kt.disableOn)return;Mt(Kt,zt).forEach(Zt=>Wt.errors.push(Zt))};_t.set(Ot,(Kt,Wt,zt)=>{Dt(Kt,Wt,zt),Bt(Kt,Wt,zt)})})}),dt(_t)}const dt=xt=>Array.from(xt).reduce((yt,[_t,Ct])=>Object.assign(yt,{[_t]:Ct}),{}),St=gt(it.default,nt.default)}(parser)),parser}var hasRequiredParser;function requireParser(){if(hasRequiredParser)return parser$1;hasRequiredParser=1,Object.defineProperty(parser$1,"__esModule",{value:!0}),parser$1.tokenize=parser$1.parse=void 0;const i=requireParser$1(),s=syntaxBlacklist,o=formatters,a=requireList();class rt extends Error{constructor(st){super(st),this.name="ParseError"}}function tt(){console.error((0,o.oneLine)` UNREACHABLE CODE REACHED! Please file an issue at https://github.com/source-academy/js-slang/issues if you see this. - `)}function ot(tt){return tt.length===1?j(tt[0]):(0,a.vector_to_list)(["sequence",(0,a.vector_to_list)(tt.map(j))])}function at(tt){return nt(tt)?(0,a.vector_to_list)(["block",ot(tt)]):ot(tt)}function nt(tt){return tt.reduce((st,lt)=>st||lt.type==="VariableDeclaration"||lt.type==="FunctionDeclaration",!1)}const it=new Map([["Program",tt=>(tt=tt,ot(tt.body))],["BlockStatement",tt=>at(tt.body)],["ExpressionStatement",tt=>j(tt.expression)],["IfStatement",tt=>(0,a.vector_to_list)(["conditional_statement",j(tt.test),j(tt.consequent),tt.alternate===null?ot([]):j(tt.alternate)])],["FunctionDeclaration",tt=>(0,a.vector_to_list)(["function_declaration",j(tt.id),(0,a.vector_to_list)(tt.params.map(j)),at(tt.body.body)])],["VariableDeclaration",tt=>{if(tt.kind==="let")return(0,a.vector_to_list)(["variable_declaration",j(tt.declarations[0].id),j(tt.declarations[0].init)]);if(tt.kind==="const")return(0,a.vector_to_list)(["constant_declaration",j(tt.declarations[0].id),j(tt.declarations[0].init)]);throw et(),new rt("Invalid declaration kind")}],["ReturnStatement",tt=>(0,a.vector_to_list)(["return_statement",j(tt.argument)])],["CallExpression",tt=>(0,a.vector_to_list)(["application",j(tt.callee),(0,a.vector_to_list)(tt.arguments.map(j))])],["UnaryExpression",tt=>(0,a.vector_to_list)(["unary_operator_combination",tt.operator==="-"?"-unary":tt.operator,j(tt.argument)])],["BinaryExpression",tt=>(0,a.vector_to_list)(["binary_operator_combination",tt.operator,j(tt.left),j(tt.right)])],["LogicalExpression",tt=>(0,a.vector_to_list)(["logical_composition",tt.operator,j(tt.left),j(tt.right)])],["ConditionalExpression",tt=>(0,a.vector_to_list)(["conditional_expression",j(tt.test),j(tt.consequent),j(tt.alternate)])],["ArrowFunctionExpression",tt=>(0,a.vector_to_list)(["lambda_expression",(0,a.vector_to_list)(tt.params.map(j)),tt.body.type==="BlockStatement"?at(tt.body.body):(0,a.vector_to_list)(["return_statement",j(tt.body)])])],["Identifier",tt=>(0,a.vector_to_list)(["name",tt.name])],["Literal",tt=>(0,a.vector_to_list)(["literal",tt.value])],["ArrayExpression",tt=>(0,a.vector_to_list)(["array_expression",(0,a.vector_to_list)(tt.elements.map(j))])],["AssignmentExpression",tt=>{if(tt.left.type==="Identifier")return(0,a.vector_to_list)(["assignment",j(tt.left),j(tt.right)]);if(tt.left.type==="MemberExpression")return(0,a.vector_to_list)(["object_assignment",j(tt.left),j(tt.right)]);throw et(),new rt("Invalid assignment")}],["ForStatement",tt=>(0,a.vector_to_list)(["for_loop",j(tt.init),j(tt.test),j(tt.update),j(tt.body)])],["WhileStatement",tt=>(0,a.vector_to_list)(["while_loop",j(tt.test),j(tt.body)])],["BreakStatement",tt=>(0,a.vector_to_list)(["break_statement"])],["ContinueStatement",tt=>(0,a.vector_to_list)(["continue_statement"])],["ObjectExpression",tt=>(0,a.vector_to_list)(["object_expression",(0,a.vector_to_list)(tt.properties.map(j))])],["MemberExpression",tt=>(0,a.vector_to_list)(["object_access",j(tt.object),!tt.computed&&tt.property.type==="Identifier"?(0,a.vector_to_list)(["property",tt.property.name]):j(tt.property)])],["Property",tt=>(0,a.vector_to_list)(["key_value_pair",tt.key.type==="Identifier"?(0,a.vector_to_list)(["property",tt.key.name]):j(tt.key),j(tt.value)])],["ImportDeclaration",tt=>(0,a.vector_to_list)(["import_declaration",(0,a.vector_to_list)(tt.specifiers.map(j)),tt.source.value])],["ImportSpecifier",tt=>(0,a.vector_to_list)(["name",tt.imported.name])],["ClassDeclaration",tt=>(0,a.vector_to_list)(["class_declaration",(0,a.vector_to_list)(["name",tt.id===null?null:tt.id.name,tt.superClass===null||tt.superClass===void 0?null:j(tt.superClass),tt.body.body.map(j)])])],["NewExpression",tt=>(0,a.vector_to_list)(["new_expression",j(tt.callee),(0,a.vector_to_list)(tt.arguments.map(j))])],["MethodDefinition",tt=>(0,a.vector_to_list)(["method_definition",tt.kind,tt.static,j(tt.key),j(tt.value)])],["FunctionExpression",tt=>(0,a.vector_to_list)(["lambda_expression",(0,a.vector_to_list)(tt.params.map(j)),at(tt.body.body)])],["ThisExpression",tt=>(0,a.vector_to_list)(["this_expression"])],["Super",tt=>(0,a.vector_to_list)(["super_expression"])],["TryStatement",tt=>(0,a.vector_to_list)(["try_statement",j(tt.block),tt.handler===null||tt.handler===void 0?null:(0,a.vector_to_list)(["name",tt.handler.param.name]),tt.handler===null||tt.handler===void 0?null:j(tt.handler.body)])],["ThrowStatement",tt=>(0,a.vector_to_list)(["throw_statement",j(tt.argument)])],["SpreadElement",tt=>(0,a.vector_to_list)(["spread_element",j(tt.argument)])],["RestElement",tt=>(0,a.vector_to_list)(["rest_element",j(tt.argument)])]]);function j(tt){if(it.has(tt.type)){const lt=it.get(tt.type)(tt);return lt!=null&&typeof lt=="object"&<.tag!==void 0&&(lt.loc=tt.loc),lt}else throw et(),new rt("Cannot transform unknown type: "+tt.type)}function _(tt,st){st.chapter=s.libraryParserLanguage;const lt=(0,i.parse)(tt,st);if(st.errors.length>0)throw new rt(st.errors[0].explain());if(lt!==void 0)return j(lt);throw et(),new rt("Invalid parse")}parser$1.parse=_;function $(tt,st){const lt=(0,i.tokenize)(tt,st).map(ct=>tt.substring(ct.start,ct.end));return(0,a.vector_to_list)(lt)}return parser$1.tokenize=$,parser$1}var stream={},hasRequiredStream;function requireStream(){if(hasRequiredStream)return stream;hasRequiredStream=1,Object.defineProperty(stream,"__esModule",{value:!0}),stream.list_to_stream=stream.stream=stream.stream_tail=void 0;const i=requireList();function s(rt){let et;if((0,i.is_pair)(rt))et=rt[1];else throw new Error("stream_tail(xs) expects a pair as argument xs, but encountered "+rt);if(typeof et=="function")return et();throw new Error("stream_tail(xs) expects a function as the tail of the argument pair xs, but encountered "+et)}stream.stream_tail=s;function o(...rt){return a((0,i.list)(...rt))}stream.stream=o;function a(rt){return(0,i.is_null)(rt)?null:(0,i.pair)((0,i.head)(rt),()=>a((0,i.tail)(rt)))}return stream.list_to_stream=a,stream}var stream_prelude={};Object.defineProperty(stream_prelude,"__esModule",{value:!0});stream_prelude.streamPrelude=void 0;stream_prelude.streamPrelude=` + `)}function ot(et){return et.length===1?j(et[0]):(0,a.vector_to_list)(["sequence",(0,a.vector_to_list)(et.map(j))])}function at(et){return nt(et)?(0,a.vector_to_list)(["block",ot(et)]):ot(et)}function nt(et){return et.reduce((st,lt)=>st||lt.type==="VariableDeclaration"||lt.type==="FunctionDeclaration",!1)}const it=new Map([["Program",et=>(et=et,ot(et.body))],["BlockStatement",et=>at(et.body)],["ExpressionStatement",et=>j(et.expression)],["IfStatement",et=>(0,a.vector_to_list)(["conditional_statement",j(et.test),j(et.consequent),et.alternate===null?ot([]):j(et.alternate)])],["FunctionDeclaration",et=>(0,a.vector_to_list)(["function_declaration",j(et.id),(0,a.vector_to_list)(et.params.map(j)),at(et.body.body)])],["VariableDeclaration",et=>{if(et.kind==="let")return(0,a.vector_to_list)(["variable_declaration",j(et.declarations[0].id),j(et.declarations[0].init)]);if(et.kind==="const")return(0,a.vector_to_list)(["constant_declaration",j(et.declarations[0].id),j(et.declarations[0].init)]);throw tt(),new rt("Invalid declaration kind")}],["ReturnStatement",et=>(0,a.vector_to_list)(["return_statement",j(et.argument)])],["CallExpression",et=>(0,a.vector_to_list)(["application",j(et.callee),(0,a.vector_to_list)(et.arguments.map(j))])],["UnaryExpression",et=>(0,a.vector_to_list)(["unary_operator_combination",et.operator==="-"?"-unary":et.operator,j(et.argument)])],["BinaryExpression",et=>(0,a.vector_to_list)(["binary_operator_combination",et.operator,j(et.left),j(et.right)])],["LogicalExpression",et=>(0,a.vector_to_list)(["logical_composition",et.operator,j(et.left),j(et.right)])],["ConditionalExpression",et=>(0,a.vector_to_list)(["conditional_expression",j(et.test),j(et.consequent),j(et.alternate)])],["ArrowFunctionExpression",et=>(0,a.vector_to_list)(["lambda_expression",(0,a.vector_to_list)(et.params.map(j)),et.body.type==="BlockStatement"?at(et.body.body):(0,a.vector_to_list)(["return_statement",j(et.body)])])],["Identifier",et=>(0,a.vector_to_list)(["name",et.name])],["Literal",et=>(0,a.vector_to_list)(["literal",et.value])],["ArrayExpression",et=>(0,a.vector_to_list)(["array_expression",(0,a.vector_to_list)(et.elements.map(j))])],["AssignmentExpression",et=>{if(et.left.type==="Identifier")return(0,a.vector_to_list)(["assignment",j(et.left),j(et.right)]);if(et.left.type==="MemberExpression")return(0,a.vector_to_list)(["object_assignment",j(et.left),j(et.right)]);throw tt(),new rt("Invalid assignment")}],["ForStatement",et=>(0,a.vector_to_list)(["for_loop",j(et.init),j(et.test),j(et.update),j(et.body)])],["WhileStatement",et=>(0,a.vector_to_list)(["while_loop",j(et.test),j(et.body)])],["BreakStatement",et=>(0,a.vector_to_list)(["break_statement"])],["ContinueStatement",et=>(0,a.vector_to_list)(["continue_statement"])],["ObjectExpression",et=>(0,a.vector_to_list)(["object_expression",(0,a.vector_to_list)(et.properties.map(j))])],["MemberExpression",et=>(0,a.vector_to_list)(["object_access",j(et.object),!et.computed&&et.property.type==="Identifier"?(0,a.vector_to_list)(["property",et.property.name]):j(et.property)])],["Property",et=>(0,a.vector_to_list)(["key_value_pair",et.key.type==="Identifier"?(0,a.vector_to_list)(["property",et.key.name]):j(et.key),j(et.value)])],["ImportDeclaration",et=>(0,a.vector_to_list)(["import_declaration",(0,a.vector_to_list)(et.specifiers.map(j)),et.source.value])],["ImportSpecifier",et=>(0,a.vector_to_list)(["name",et.imported.name])],["ClassDeclaration",et=>(0,a.vector_to_list)(["class_declaration",(0,a.vector_to_list)(["name",et.id===null?null:et.id.name,et.superClass===null||et.superClass===void 0?null:j(et.superClass),et.body.body.map(j)])])],["NewExpression",et=>(0,a.vector_to_list)(["new_expression",j(et.callee),(0,a.vector_to_list)(et.arguments.map(j))])],["MethodDefinition",et=>(0,a.vector_to_list)(["method_definition",et.kind,et.static,j(et.key),j(et.value)])],["FunctionExpression",et=>(0,a.vector_to_list)(["lambda_expression",(0,a.vector_to_list)(et.params.map(j)),at(et.body.body)])],["ThisExpression",et=>(0,a.vector_to_list)(["this_expression"])],["Super",et=>(0,a.vector_to_list)(["super_expression"])],["TryStatement",et=>(0,a.vector_to_list)(["try_statement",j(et.block),et.handler===null||et.handler===void 0?null:(0,a.vector_to_list)(["name",et.handler.param.name]),et.handler===null||et.handler===void 0?null:j(et.handler.body)])],["ThrowStatement",et=>(0,a.vector_to_list)(["throw_statement",j(et.argument)])],["SpreadElement",et=>(0,a.vector_to_list)(["spread_element",j(et.argument)])],["RestElement",et=>(0,a.vector_to_list)(["rest_element",j(et.argument)])]]);function j(et){if(it.has(et.type)){const lt=it.get(et.type)(et);return lt!=null&&typeof lt=="object"&<.tag!==void 0&&(lt.loc=et.loc),lt}else throw tt(),new rt("Cannot transform unknown type: "+et.type)}function _(et,st){st.chapter=s.libraryParserLanguage;const lt=(0,i.parse)(et,st);if(st.errors.length>0)throw new rt(st.errors[0].explain());if(lt!==void 0)return j(lt);throw tt(),new rt("Invalid parse")}parser$1.parse=_;function $(et,st){const lt=(0,i.tokenize)(et,st).map(ct=>et.substring(ct.start,ct.end));return(0,a.vector_to_list)(lt)}return parser$1.tokenize=$,parser$1}var stream={},hasRequiredStream;function requireStream(){if(hasRequiredStream)return stream;hasRequiredStream=1,Object.defineProperty(stream,"__esModule",{value:!0}),stream.list_to_stream=stream.stream=stream.stream_tail=void 0;const i=requireList();function s(rt){let tt;if((0,i.is_pair)(rt))tt=rt[1];else throw new Error("stream_tail(xs) expects a pair as argument xs, but encountered "+rt);if(typeof tt=="function")return tt();throw new Error("stream_tail(xs) expects a function as the tail of the argument pair xs, but encountered "+tt)}stream.stream_tail=s;function o(...rt){return a((0,i.list)(...rt))}stream.stream=o;function a(rt){return(0,i.is_null)(rt)?null:(0,i.pair)((0,i.head)(rt),()=>a((0,i.tail)(rt)))}return stream.list_to_stream=a,stream}var stream_prelude={};Object.defineProperty(stream_prelude,"__esModule",{value:!0});stream_prelude.streamPrelude=void 0;stream_prelude.streamPrelude=` // Supporting streams in the Scheme style, following // "stream discipline" @@ -3925,8 +3925,8 @@ function stream_ref(s, n) { ? head(s) : stream_ref(stream_tail(s), n - 1); } -`;var typeChecker={},typeErrors={},hasRequiredTypeErrors;function requireTypeErrors(){if(hasRequiredTypeErrors)return typeErrors;hasRequiredTypeErrors=1,Object.defineProperty(typeErrors,"__esModule",{value:!0}),typeErrors.InconsistentPredicateTestError=typeErrors.CallingNonFunctionType=typeErrors.ConsequentAlternateMismatchError=typeErrors.UndefinedIdentifierError=typeErrors.InvalidTestConditionError=typeErrors.InvalidArgumentTypesError=typeErrors.DifferentNumberArgumentsError=typeErrors.CyclicReferenceError=typeErrors.DifferentAssignmentError=typeErrors.ReassignConstError=typeErrors.ArrayAssignmentError=typeErrors.InvalidArrayIndexType=void 0;const i=astring,s=types,o=formatters,a=requireStringify();class rt{constructor(mt,gt){this.node=mt,this.receivedType=gt,this.type=s.ErrorType.TYPE,this.severity=s.ErrorSeverity.WARNING}get location(){return this.node.loc}explain(){return`Expected array index as number, got ${(0,a.typeToString)(this.receivedType)} instead`}elaborate(){return this.explain()}}typeErrors.InvalidArrayIndexType=rt;class et{constructor(mt,gt,dt){this.node=mt,this.arrayType=gt,this.receivedType=dt,this.type=s.ErrorType.TYPE,this.severity=s.ErrorSeverity.WARNING}get location(){return this.node.loc}explain(){return(0,o.stripIndent)`Expected array type: ${(0,a.typeToString)(this.arrayType)} - but got: ${(0,a.typeToString)(this.receivedType)}`}elaborate(){return this.explain()}}typeErrors.ArrayAssignmentError=et;class ot{constructor(mt){this.node=mt,this.type=s.ErrorType.TYPE,this.severity=s.ErrorSeverity.WARNING}get location(){return this.node.loc}explain(){const[mt]=nt(this.node);return`Reassignment of constant ${mt}`}elaborate(){return this.explain()}}typeErrors.ReassignConstError=ot;class at{constructor(mt,gt,dt){this.node=mt,this.expectedType=gt,this.receivedType=dt,this.type=s.ErrorType.TYPE,this.severity=s.ErrorSeverity.WARNING}get location(){return this.node.loc}explain(){const[mt,gt]=nt(this.node);return(0,o.stripIndent)` +`;var typeChecker={},typeErrors={},hasRequiredTypeErrors;function requireTypeErrors(){if(hasRequiredTypeErrors)return typeErrors;hasRequiredTypeErrors=1,Object.defineProperty(typeErrors,"__esModule",{value:!0}),typeErrors.InconsistentPredicateTestError=typeErrors.CallingNonFunctionType=typeErrors.ConsequentAlternateMismatchError=typeErrors.UndefinedIdentifierError=typeErrors.InvalidTestConditionError=typeErrors.InvalidArgumentTypesError=typeErrors.DifferentNumberArgumentsError=typeErrors.CyclicReferenceError=typeErrors.DifferentAssignmentError=typeErrors.ReassignConstError=typeErrors.ArrayAssignmentError=typeErrors.InvalidArrayIndexType=void 0;const i=astring,s=types,o=formatters,a=requireStringify();class rt{constructor(mt,gt){this.node=mt,this.receivedType=gt,this.type=s.ErrorType.TYPE,this.severity=s.ErrorSeverity.WARNING}get location(){return this.node.loc}explain(){return`Expected array index as number, got ${(0,a.typeToString)(this.receivedType)} instead`}elaborate(){return this.explain()}}typeErrors.InvalidArrayIndexType=rt;class tt{constructor(mt,gt,dt){this.node=mt,this.arrayType=gt,this.receivedType=dt,this.type=s.ErrorType.TYPE,this.severity=s.ErrorSeverity.WARNING}get location(){return this.node.loc}explain(){return(0,o.stripIndent)`Expected array type: ${(0,a.typeToString)(this.arrayType)} + but got: ${(0,a.typeToString)(this.receivedType)}`}elaborate(){return this.explain()}}typeErrors.ArrayAssignmentError=tt;class ot{constructor(mt){this.node=mt,this.type=s.ErrorType.TYPE,this.severity=s.ErrorSeverity.WARNING}get location(){return this.node.loc}explain(){const[mt]=nt(this.node);return`Reassignment of constant ${mt}`}elaborate(){return this.explain()}}typeErrors.ReassignConstError=ot;class at{constructor(mt,gt,dt){this.node=mt,this.expectedType=gt,this.receivedType=dt,this.type=s.ErrorType.TYPE,this.severity=s.ErrorSeverity.WARNING}get location(){return this.node.loc}explain(){const[mt,gt]=nt(this.node);return(0,o.stripIndent)` Expected assignment of ${mt}: ${gt} to get a value of type: @@ -3954,7 +3954,7 @@ function stream_ref(s, n) { ${gt} The function expected ${dt(this.expectedTypes)} but instead received ${dt(this.receivedTypes)} - `}elaborate(){return this.explain()}}typeErrors.InvalidArgumentTypesError=$;function tt(pt){let mt=(0,o.simplify)((0,i.generate)(pt.test)),gt;switch(pt.type){case"IfStatement":{mt=`if (${mt}) { ... } else { ... }`,gt="if statement";break}case"ConditionalExpression":{mt=`${mt} ? ... : ...`,gt="conditional expression";break}case"WhileStatement":{mt=`while (${mt}) { ... }`,gt="while statement";break}case"ForStatement":mt=`for (...; ${mt}; ...) { ... }`,gt="for statement"}return{exprString:mt,kind:gt}}class st{constructor(mt,gt){this.node=mt,this.receivedType=gt,this.type=s.ErrorType.TYPE,this.severity=s.ErrorSeverity.WARNING}get location(){return this.node.loc}explain(){const{exprString:mt,kind:gt}=tt(this.node);return(0,o.stripIndent)` + `}elaborate(){return this.explain()}}typeErrors.InvalidArgumentTypesError=$;function et(pt){let mt=(0,o.simplify)((0,i.generate)(pt.test)),gt;switch(pt.type){case"IfStatement":{mt=`if (${mt}) { ... } else { ... }`,gt="if statement";break}case"ConditionalExpression":{mt=`${mt} ? ... : ...`,gt="conditional expression";break}case"WhileStatement":{mt=`while (${mt}) { ... }`,gt="while statement";break}case"ForStatement":mt=`for (...; ${mt}; ...) { ... }`,gt="for statement"}return{exprString:mt,kind:gt}}class st{constructor(mt,gt){this.node=mt,this.receivedType=gt,this.type=s.ErrorType.TYPE,this.severity=s.ErrorSeverity.WARNING}get location(){return this.node.loc}explain(){const{exprString:mt,kind:gt}=et(this.node);return(0,o.stripIndent)` Expected the test part of the ${gt}: ${mt} to have type boolean, but instead it is type: @@ -3963,7 +3963,7 @@ function stream_ref(s, n) { One or more undeclared names detected (e.g. '${this.name}'). If there aren't actually any undeclared names, then is either a Source or misconfiguration bug. Please report this to the administrators! - `}elaborate(){return this.explain()}}typeErrors.UndefinedIdentifierError=lt;class ct{constructor(mt,gt,dt){this.node=mt,this.consequentType=gt,this.alternateType=dt,this.type=s.ErrorType.TYPE,this.severity=s.ErrorSeverity.WARNING}get location(){return this.node.loc}explain(){const{exprString:mt,kind:gt}=tt(this.node);return(0,o.stripIndent)` + `}elaborate(){return this.explain()}}typeErrors.UndefinedIdentifierError=lt;class ct{constructor(mt,gt,dt){this.node=mt,this.consequentType=gt,this.alternateType=dt,this.type=s.ErrorType.TYPE,this.severity=s.ErrorSeverity.WARNING}get location(){return this.node.loc}explain(){const{exprString:mt,kind:gt}=et(this.node);return(0,o.stripIndent)` The two branches of the ${gt}: ${mt} produce different types! @@ -3986,14 +3986,14 @@ function stream_ref(s, n) { ${(0,a.typeToString)(this.preUnifyType)} but could not unify with type ${(0,a.typeToString)(this.predicateType)} - `}elaborate(){return this.explain()}}return typeErrors.InconsistentPredicateTestError=ut,typeErrors}var internalTypeErrors={},hasRequiredInternalTypeErrors;function requireInternalTypeErrors(){if(hasRequiredInternalTypeErrors)return internalTypeErrors;hasRequiredInternalTypeErrors=1,Object.defineProperty(internalTypeErrors,"__esModule",{value:!0}),internalTypeErrors.InternalCyclicReferenceError=internalTypeErrors.InternalDifferentNumberArgumentsError=internalTypeErrors.UnifyError=internalTypeErrors.InternalTypeError=internalTypeErrors.TypeError=void 0;const i=types,s=requireStringify();class o{constructor(nt,it){this.node=nt,this.message=it,this.type=i.ErrorType.TYPE,this.severity=i.ErrorSeverity.WARNING,nt.typability="Untypable"}get location(){return this.node.loc}explain(){return this.message}elaborate(){return this.message}}internalTypeErrors.TypeError=o;class a extends Error{constructor(nt){super(),this.message=nt}}internalTypeErrors.InternalTypeError=a;class rt extends a{constructor(nt,it){super(`Failed to unify LHS: ${(0,s.typeToString)(nt)}, RHS: ${(0,s.typeToString)(it)}`),this.LHS=nt,this.RHS=it}}internalTypeErrors.UnifyError=rt;class et extends a{constructor(nt,it){super(`Expected ${nt} args, got ${it}`),this.numExpectedArgs=nt,this.numReceived=it}}internalTypeErrors.InternalDifferentNumberArgumentsError=et;class ot extends a{constructor(nt){super("contains a cyclic reference to itself"),this.name=nt}}return internalTypeErrors.InternalCyclicReferenceError=ot,internalTypeErrors}var hasRequiredTypeChecker;function requireTypeChecker(){if(hasRequiredTypeChecker)return typeChecker;hasRequiredTypeChecker=1,Object.defineProperty(typeChecker,"__esModule",{value:!0}),typeChecker.createTypeEnvironment=typeChecker.tForAll=typeChecker.tVar=typeChecker.typeCheck=void 0;const i=requireTypeErrors(),s=requireParser$1(),o=requireStringify(),a=requireInternalTypeErrors(),rt="-_1";let et=0;function ot(Yt,er){if(Yt!==null){if(er&&Yt.typability!=="Untypable")try{Yt.inferredType=mt(Yt.inferredType,er),Yt.typability="Typed"}catch(lr){j(lr)&&!(lr instanceof a.InternalCyclicReferenceError)&&tt(new a.TypeError(Yt,lr))}else Yt.inferredType=qt(et),et++;switch(Yt.type){case"Program":{Yt.body.forEach(lr=>{ot(lr,er)});break}case"UnaryExpression":{ot(Yt.argument,er);break}case"LogicalExpression":case"BinaryExpression":{ot(Yt.left,er),ot(Yt.right,er);break}case"ExpressionStatement":{ot(Yt.expression,er);break}case"BlockStatement":{Yt.body.forEach(lr=>{ot(lr,er)});break}case"WhileStatement":{ot(Yt.test,er),ot(Yt.body,er);break}case"ForStatement":{ot(Yt.init,er),ot(Yt.test,er),ot(Yt.update,er),ot(Yt.body,er);break}case"ConditionalExpression":case"IfStatement":{ot(Yt.test,er),ot(Yt.consequent,er),Yt.alternate&&ot(Yt.alternate,er);break}case"CallExpression":{ot(Yt.callee,er),Yt.arguments.forEach(lr=>{ot(lr,er)});break}case"ReturnStatement":{const lr=Yt.argument;ot(lr,er);break}case"VariableDeclaration":{const lr=Yt.declarations[0].init;ot(lr,er);break}case"ArrowFunctionExpression":{Yt.params.forEach(lr=>{ot(lr,er)}),ot(Yt.body,er);break}case"FunctionDeclaration":{const lr=Yt;if(er)try{lr.functionInferredType=mt(lr.functionInferredType,er)}catch(Lr){Lr instanceof a.InternalCyclicReferenceError?tt(new i.CyclicReferenceError(Yt)):j(Lr)&&tt(new a.TypeError(Yt,Lr))}else lr.functionInferredType=qt(et);et++,lr.params.forEach(Lr=>{ot(Lr,er)}),ot(lr.body,er);break}case"AssignmentExpression":ot(Yt.left,er),ot(Yt.right,er);break;case"ArrayExpression":Yt.elements.forEach(lr=>ot(lr,er));break;case"MemberExpression":ot(Yt.object,er),ot(Yt.property,er);break;default:return}}}function at(Yt){return Yt.kind==="pair"}function nt(Yt){return Yt.kind==="list"}function it(Yt){return nt(Yt)?Yt.elementType:null}function j(Yt){return Yt instanceof a.InternalTypeError}let _=!1,$=[];function tt(Yt){Yt instanceof i.UndefinedIdentifierError&&_||(_=!0,$.push(Yt))}function st(Yt,er){function lr(Lr){et=0,_=!1,$=[];const Or=er.typeEnvironment;if(er.chapter>=3&&Or.length===3){const Cr=Or[2].typeMap;for(const[Hr,rn]of kr)Cr.set(Hr,rn)}const Er=[];ot(Lr);try{zt(Lr,Or,Er,!0)}catch(Cr){j(Cr)?tt(new a.TypeError(Lr,`Uncaught internal type error during typechecking, report this to the adminstrators! -`+Cr.message)):tt(new a.TypeError(Lr,`Uncaught error during typechecking, report this to the adminstrators! -`+Cr.message))}return ot(Lr,Er),[Lr,$]}for(const Lr of er.unTypecheckedCode)lr((0,s.typedParse)(Lr,er));return er.unTypecheckedCode=[],lr(Yt)}typeChecker.typeCheck=st;function lt(Yt){const er=et;return et++,Object.assign(Object.assign({},Yt),{name:`T${er}`})}function ct(Yt,er){switch(Yt.kind){case"primitive":return Yt;case"list":return{kind:"list",elementType:ct(Yt.elementType,er)};case"array":return{kind:"array",elementType:ct(Yt.elementType,er)};case"pair":return{kind:"pair",headType:ct(Yt.headType,er),tailType:ct(Yt.tailType,er)};case"variable":return er[Yt.name];case"function":return Object.assign(Object.assign({},Yt),{parameterTypes:Yt.parameterTypes.map(lr=>ct(lr,er)),returnType:ct(Yt.returnType,er)})}}function ht(Yt,er){const lr=[...Yt];return er.forEach(Lr=>{lr.findIndex(Or=>Or.name===Lr.name)===-1&&lr.push(Lr)}),lr}function ut(Yt){switch(Yt.kind){case"primitive":return[];case"list":return ut(Yt.elementType);case"array":return ut(Yt.elementType);case"pair":return ht(ut(Yt.headType),ut(Yt.tailType));case"variable":return[Yt];case"function":return ht(Yt.parameterTypes.reduce((er,lr)=>ht(er,ut(lr)),[]),ut(Yt.returnType))}}function pt(Yt){const er=Yt.polyType,lr=ut(er),Lr={};return lr.forEach(Or=>{Lr[Or.name]=lt(Or)}),ct(er,Lr)}function mt(Yt,er){switch(Yt.kind){case"primitive":return Yt;case"pair":{const lr=mt(Yt.headType,er),Lr=mt(Yt.tailType,er);return Lr.kind==="list"&&lr===it(Lr)?mr(lr):fr(lr,Lr)}case"list":return{kind:"list",elementType:mt(Yt.elementType,er)};case"array":return{kind:"array",elementType:mt(Yt.elementType,er)};case"variable":{for(const lr of er){const Lr=lr[0],Or=lr[1];if(Lr.name===Yt.name){if(gt(Or,Lr.name)){if(at(Or)&&Lr===Or.tailType)return{kind:"list",elementType:Or.headType};if(Lr.kind==="variable"&&Lr===it(Or))return{kind:"list",elementType:Lr};throw new a.InternalCyclicReferenceError(Yt.name)}return mt(lr[1],er)}}return Yt}case"function":return Object.assign(Object.assign({},Yt),{parameterTypes:Yt.parameterTypes.map(lr=>mt(lr,er)),returnType:mt(Yt.returnType,er)})}}function gt(Yt,er){switch(Yt.kind){case"primitive":return!1;case"pair":return gt(Yt.headType,er)||gt(Yt.tailType,er);case"array":case"list":return gt(Yt.elementType,er);case"variable":return Yt.name===er;case"function":return Yt.parameterTypes.some(Lr=>gt(Lr,er))||gt(Yt.returnType,er)}}function dt(Yt,er,lr){for(const Lr of er)if(Lr[0].name===Yt.name)return _t(er,[lr,Lr[1]]);return lr.kind==="variable"&&Yt.constraint==="addable"&&lr.constraint==="none"&&(lr.constraint=Yt.constraint),Yt!==lr&&er.push([Yt,lr]),er}function St(Yt,er){return Yt.constraint==="addable"&&er.kind!=="variable"&&!(er.kind==="primitive"&&(er.name==="string"||er.name==="number"))}function xt(Yt){return{kind:"function",parameterTypes:[lt(qt("T"))],returnType:rr}}function yt(){return dr(lt(qt("T")),rr)}function _t(Yt,[er,lr]){if(er.kind==="primitive"&&lr.kind==="primitive"&&er.name===lr.name)return Yt;if(er.kind!=="variable"&&lr.kind==="variable")return _t(Yt,[lr,er]);if(er.kind==="variable"){if(lr=mt(lr,Yt),(lr.kind==="primitive"||lr.kind==="variable")&&er.name===lr.name)return Yt;if(lr.kind==="pair"&&er===lr.tailType)_t(Yt,[er,mr(lr.headType)]);else if(lr.kind==="pair"&&lr.tailType.kind==="list"){const Lr=_t(Yt,[lr.headType,it(lr.tailType)]);return _t(Lr,[er,mr(lr.headType)])}else if(gt(lr,er.name))throw new a.InternalCyclicReferenceError(er.name);if(St(er,lr))throw new a.UnifyError(er,lr);return dt(er,Yt,mt(lr,Yt))}else if(er.kind==="function"&&lr.kind==="function"){if(er.parameterTypes.length!==lr.parameterTypes.length)throw new a.InternalDifferentNumberArgumentsError(lr.parameterTypes.length,er.parameterTypes.length);let Lr=Yt;for(let Or=0;Orkt(er));case"ForStatement":case"WhileStatement":return kt(Yt.body);case"ReturnStatement":return!0;default:return!1}}function Tt(Yt){switch(Yt.type){case"ExpressionStatement":return!0;case"IfStatement":return Tt(Yt.consequent)||Tt(Yt.alternate);case"BlockStatement":return Yt.body.some(er=>Tt(er));case"ForStatement":case"WhileStatement":return Tt(Yt.body);default:return!1}}function $t(Yt,er,lr=[]){if(Yt.type==="LogicalExpression"&&Yt.operator==="&&")return lr=$t(Yt.left,er,lr),$t(Yt.right,er,lr);if(Yt.type==="UnaryExpression"&&Yt.operator==="!")return It(Yt.argument,er,lr);if(Yt.type==="CallExpression"&&Yt.callee.type==="Identifier"&&Yt.arguments.length===1&&Yt.arguments[0].type==="Identifier"){const Lr=Mt(Yt.callee.name,er);if(Lr!==void 0&&Lr.kind==="predicate")return lr.push({node:Yt,ifTrueType:Lr.ifTrueType,argVarName:Yt.arguments[0].name}),lr}return lr}function It(Yt,er,lr=[]){return Yt.type==="LogicalExpression"&&Yt.operator==="||"?(lr=It(Yt.left,er,lr),It(Yt.right,er,lr)):Yt.type==="UnaryExpression"&&Yt.operator==="!"?$t(Yt.argument,er,lr):lr}function Ot(Yt,er){const lr=Yt.body.length-1;if(er){for(let Lr=lr;Lr>=0;Lr--)if(Tt(Yt.body[Lr]))return Lr;return lr}else return Yt.body.findIndex((Lr,Or)=>Or===lr||kt(Lr))}function Mt(Yt,er){for(let lr=er.length-1;lr>=0;lr--)if(er[lr].typeMap.has(Yt))return er[lr].typeMap.get(Yt)}function Dt(Yt,er){for(let lr=er.length-1;lr>=0;lr--)if(er[lr].declKindMap.has(Yt))return er[lr].declKindMap.get(Yt)}function Bt(Yt,er,lr){lr[lr.length-1].typeMap.set(Yt,er)}function Kt(Yt,er,lr){lr[lr.length-1].declKindMap.set(Yt,er)}function Wt(Yt){Yt.push({typeMap:new Map,declKindMap:new Map})}function zt(Yt,er,lr,Lr=!1){try{return Ht(Yt,er,lr,Lr)}catch(Or){if(Or instanceof a.InternalCyclicReferenceError)return tt(new i.CyclicReferenceError(Yt)),lr;throw Or}}function Ht(Yt,er,lr,Lr=!1){const Or=Yt.inferredType;switch(Yt.type){case"UnaryExpression":{const Er=Yt.operator==="-"?rt:Yt.operator,Cr=Mt(Er,er),Hr=Yt.argument,rn=Hr.inferredType,Dr=[];let Yr=zt(Hr,er,lr);Dr.push(mt(Hr.inferredType,Yr));try{Yr=_t(Yr,[dr(rn,Or),Cr])}catch(jr){if(jr instanceof a.UnifyError){const Gr=Cr.parameterTypes;return tt(new i.InvalidArgumentTypesError(Yt,[Hr],Gr,Dr)),Yr}}return Yr}case"LogicalExpression":{const Er=Yt.left,Cr=Er.inferredType,Hr=Yt.right,rn=Hr.inferredType;let Dr=lr;Dr=_t(lr,[Or,rr]),Dr=zt(Er,er,Dr);const Yr=mt(Er.inferredType,Dr);let jr;if(Yt.operator==="&&"){const Gr=$t(Yt.left,er);Gr.length>0&&(Dr=Ct(Yt,Gr,Yt.right,Lr,er,Dr),jr=mt(Hr.inferredType,Dr))}else if(Yt.operator==="||"){const Gr=It(Yt.left,er);Gr.length>0&&(Dr=Ct(Yt,Gr,Yt.right,Lr,er,Dr),jr=mt(Hr.inferredType,Dr))}jr===void 0&&(Dr=zt(Hr,er,Dr),jr=mt(Hr.inferredType,Dr));try{Dr=_t(lr,[Cr,rr]),Dr=_t(lr,[rn,rr])}catch(Gr){Gr instanceof a.UnifyError&&tt(new i.InvalidArgumentTypesError(Yt,[Er,Hr],[rr,rr],[Yr,jr]))}return Dr}case"BinaryExpression":{const Er=Mt(Yt.operator,er),Cr=Er.kind==="forall"?pt(Er):Er.kind==="predicate"?xt():Er,Hr=Yt.left,rn=Hr.inferredType,Dr=Yt.right,Yr=Dr.inferredType,jr=[Hr,Dr];let Gr=lr;const an=[];jr.forEach(Rr=>{Gr=zt(Rr,er,Gr),an.push(mt(Rr.inferredType,Gr))});try{Gr=_t(lr,[dr(rn,Yr,Or),Cr])}catch(Rr){if(Rr instanceof a.UnifyError){const mn=Cr.parameterTypes;tt(new i.InvalidArgumentTypesError(Yt,jr,mn,an))}}return Gr}case"ExpressionStatement":return zt(Yt.expression,er,_t(lr,[Or,Sr]));case"ReturnStatement":{const Er=Yt.argument;return zt(Er,er,_t(lr,[Or,Er.inferredType]))}case"WhileStatement":{const Er=Yt.test,Cr=Er.inferredType,Hr=Yt.body,rn=Hr.inferredType;let Dr=_t(lr,[Or,rn]);try{Dr=zt(Er,er,Dr),Dr=_t(Dr,[Cr,rr])}catch(Yr){Yr instanceof a.UnifyError&&tt(new i.InvalidTestConditionError(Yt,Yr.RHS))}return zt(Hr,er,Dr,Lr)}case"ForStatement":{const Er=Yt.init,Cr=Yt.test,Hr=Cr.inferredType,rn=Yt.body,Dr=rn.inferredType,Yr=Yt.update;let jr=_t(lr,[Or,Dr]);if(Wt(er),Er.type==="VariableDeclaration"&&Er.kind!=="var"&&Er.declarations[0].id.type==="Identifier"){const an=Er.declarations[0].id.name;Bt(an,Er.declarations[0].init.inferredType,er),Kt(an,Er.kind,er),jr=zt(Er,er,jr),Bt(an,gr(mt(Er.declarations[0].init.inferredType,jr)),er)}else jr=zt(Er,er,jr);try{jr=zt(Cr,er,jr),jr=_t(jr,[Hr,rr])}catch(an){an instanceof a.UnifyError&&tt(new i.InvalidTestConditionError(Yt,an.RHS))}jr=zt(Yr,er,jr);const Gr=zt(rn,er,jr,Lr);return er.pop(),Gr}case"Program":case"BlockStatement":{Wt(er);for(const Rr of Yt.body)if(Rr.type==="ImportDeclaration")for(const mn of Rr.specifiers)mn.type==="ImportSpecifier"&&mn.local.type==="Identifier"&&(Bt(mn.local.name,gr(qt("T1")),er),Kt(mn.local.name,"const",er));const Er=Yt.body.length-1,Cr=Ot(Yt,Lr);let Hr=-1,rn=!1,Dr=Er;const Yr=[];for(;Dr>=0;){const Rr=Yt.body[Dr];(Rr.type==="FunctionDeclaration"||Rr.type==="VariableDeclaration")&&(rn||(rn=!0,Hr=Dr),Yr.push(Rr)),Dr--}Yr.forEach(Rr=>{if(Rr.type==="FunctionDeclaration"&&Rr.id!==null){const mn=Rr.id.name;Bt(mn,Rr.functionInferredType,er),Kt(mn,"const",er)}else if(Rr.type==="VariableDeclaration"&&Rr.kind!=="var"&&Rr.declarations[0].id.type==="Identifier"){const mn=Rr.declarations[0].id.name;Bt(mn,Rr.declarations[0].init.inferredType,er),Kt(mn,Rr.kind,er)}});const jr=Yt.body[Cr],Gr=Lr&&jr.type==="ExpressionStatement"?jr.expression.inferredType:jr.inferredType;let an=_t(lr,[Or,Gr]);for(let Rr=0;Rr<=Hr;Rr++)Rr===Cr?an=zt(Yt.body[Rr],er,an,Lr):an=zt(Yt.body[Rr],er,an);Yr.forEach(Rr=>{Rr.type==="FunctionDeclaration"&&Rr.id!==null?Bt(Rr.id.name,gr(mt(Rr.functionInferredType,an)),er):Rr.type==="VariableDeclaration"&&Rr.declarations[0].id.type==="Identifier"&&Bt(Rr.declarations[0].id.name,gr(mt(Rr.declarations[0].init.inferredType,an)),er)});for(let Rr=Hr+1;Rr<=Er;Rr++){const mn=Yt.body[Rr];Rr===Cr?an=zt(mn,er,an,Lr):an=zt(mn,er,an)}return Yt.type==="BlockStatement"&&er.pop(),an}case"Literal":{const Er=Yt.value,Cr=typeof Er;if(Er===null)return _t(lr,[Or,mr(qt(et++))]);if(Cr==="number")return _t(lr,[Or,Qt]);if(Cr==="boolean")return _t(lr,[Or,rr]);if(Cr==="string")return _t(lr,[Or,xr]);throw Error("Unexpected literal type")}case"Identifier":{const Er=Yt.name,Cr=Mt(Er,er);return Cr!==void 0?Cr.kind==="forall"?_t(lr,[Or,pt(Cr)]):Cr.kind==="predicate"?_t(lr,[Or,yt()]):_t(lr,[Or,Cr]):(tt(new i.UndefinedIdentifierError(Yt,Er)),lr)}case"ConditionalExpression":case"IfStatement":{const Er=Yt.test,Cr=Er.inferredType,Hr=Yt.consequent,rn=Hr.inferredType,Dr=Yt.alternate,Yr=Dr.inferredType;let jr=lr;try{jr=zt(Er,er,jr),jr=_t(jr,[Cr,rr])}catch(Rr){Rr instanceof a.UnifyError&&tt(new i.InvalidTestConditionError(Yt,Rr.RHS))}const Gr=$t(Er,er),an=It(Er,er);if(Gr.length>0)jr=Et(Yt,Gr,Hr,Dr,Lr,er,jr);else if(an.length>0)jr=Et(Yt,an,Dr,Hr,Lr,er,jr);else{jr=zt(Hr,er,jr,Lr);try{jr=zt(Dr,er,jr,Lr)}catch(Rr){Rr instanceof a.UnifyError&&tt(new i.ConsequentAlternateMismatchError(Yt,Rr.RHS,Rr.LHS))}}try{jr=_t(jr,[Or,rn]),jr=_t(jr,[Or,Yr])}catch(Rr){Rr instanceof a.UnifyError&&tt(new i.ConsequentAlternateMismatchError(Yt,Rr.RHS,Rr.LHS))}return jr}case"ArrowFunctionExpression":{Wt(er);const Er=Yt.params,Cr=Er.map(Yr=>Yr.inferredType),Hr=Yt.body;Cr.push(Hr.inferredType);const rn=_t(lr,[Or,dr(...Cr)]);Er.forEach(Yr=>{Bt(Yr.name,Yr.inferredType,er)});const Dr=zt(Hr,er,rn);return er.pop(),Dr}case"VariableDeclaration":{const Er=Yt.declarations[0].init;return zt(Er,er,_t(lr,[Or,Sr]))}case"FunctionDeclaration":{const Er=Yt;let Cr=_t(lr,[Or,Sr]);Wt(er);const Hr=Er.functionInferredType,rn=Yt.params,Dr=rn.map(Gr=>Gr.inferredType),Yr=Yt.body;Dr.push(Yr.inferredType),Cr=_t(Cr,[Hr,dr(...Dr)]),rn.forEach(Gr=>{Bt(Gr.name,Gr.inferredType,er)});const jr=zt(Yr,er,Cr);return er.pop(),jr}case"CallExpression":{const Er=Yt.callee,Cr=Er.inferredType,Hr=Yt.arguments,rn=Hr.map(Gr=>Gr.inferredType);rn.push(Or);let Dr=lr;Dr=zt(Er,er,Dr);const Yr=mt(Er.inferredType,Dr),jr=[];Hr.forEach(Gr=>{Dr=zt(Gr,er,Dr),jr.push(mt(Gr.inferredType,Dr))});try{Dr=_t(lr,[dr(...rn),Cr])}catch(Gr){if(Gr instanceof a.UnifyError)if(Yr.kind==="function"){const an=Yr.parameterTypes;tt(new i.InvalidArgumentTypesError(Yt,Hr,an,jr))}else tt(new i.CallingNonFunctionType(Yt,Yr));else Gr instanceof a.InternalDifferentNumberArgumentsError&&tt(new i.DifferentNumberArgumentsError(Yt,Gr.numExpectedArgs,Gr.numReceived))}return Dr}case"AssignmentExpression":{const Er=Yt.left,Cr=Yt.right,Hr=Cr.inferredType,rn=Er.inferredType;let Dr=_t(lr,[Or,Hr]);if(Dr=zt(Cr,er,Dr),Er.type==="Identifier"&&Dt(Er.name,er)==="const")return tt(new i.ReassignConstError(Yt)),Dr;Dr=zt(Er,er,Dr);try{return _t(Dr,[Hr,rn])}catch(Yr){Yr instanceof a.UnifyError&&(Er.type==="Identifier"?tt(new i.DifferentAssignmentError(Yt,mt(rn,Dr),mt(Hr,Dr))):tt(new i.ArrayAssignmentError(Yt,tr(mt(rn,Dr)),tr(mt(Hr,Dr)))))}return Dr}case"ArrayExpression":{let Er=lr;const Cr=Yt.elements;Cr.forEach(rn=>{Er=zt(rn,er,Er)});const Hr=qt(et++);return Er=_t(Er,[Or,tr(Hr)]),Cr.forEach(rn=>{try{Er=_t(Er,[Hr,rn.inferredType])}catch(Dr){Dr instanceof a.UnifyError&&tt(new i.ArrayAssignmentError(Yt,mt(Yt.inferredType,Er),tr(mt(rn.inferredType,Er))))}}),Er}case"MemberExpression":{const Cr=Yt.object.name,Hr=Yt.property,rn=Hr.inferredType;let Dr=zt(Hr,er,lr);const Yr=Mt(Cr,er);if(Yr.kind==="predicate")throw Yr.ifTrueType.kind==="forall"?new a.InternalTypeError(`Expected ${Cr} to be an array, got ${(0,o.typeToString)(pt(Yr.ifTrueType))}`):new a.InternalTypeError(`Expected ${Cr} to be an array, got ${(0,o.typeToString)(Yr.ifTrueType)}`);if(Yr.kind==="forall")throw new a.InternalTypeError(`Expected ${Cr} to be an array, got ${(0,o.typeToString)(pt(Yr))}`);const jr=mt(Yr,Dr);if(jr.kind!=="array")throw new a.InternalTypeError(`Expected ${Cr} to be an array, got ${(0,o.typeToString)(jr)}`);const Gr=jr.elementType;try{Dr=_t(lr,[rn,Qt])}catch(an){an instanceof a.UnifyError&&tt(new i.InvalidArrayIndexType(Yt,mt(rn,Dr)))}return _t(Dr,[Or,Gr])}default:return _t(lr,[Or,Sr])}}function Zt(Yt){return{kind:"primitive",name:Yt}}function qt(Yt){return{kind:"variable",name:`T${Yt}`,constraint:"none"}}typeChecker.tVar=qt;function hr(Yt){return{kind:"variable",name:`${Yt}`,constraint:"addable"}}function fr(Yt,er){return{kind:"pair",headType:Yt,tailType:er}}function mr(Yt){return{kind:"list",elementType:Yt}}function gr(Yt){return{kind:"forall",polyType:Yt}}typeChecker.tForAll=gr;function tr(Yt){return{kind:"array",elementType:Yt}}const rr=Zt("boolean"),Qt=Zt("number"),xr=Zt("string"),Sr=Zt("undefined");function dr(...Yt){const er=Yt.slice(0,-1),lr=Yt.slice(-1)[0];return{kind:"function",parameterTypes:er,returnType:lr}}function Ur(Yt){return{kind:"predicate",ifTrueType:Yt}}const tn=[["Infinity",Qt],["NaN",Qt],["undefined",Sr],["math_E",Qt],["math_LN2",Qt],["math_LN10",Qt],["math_LOG2E",Qt],["math_LOG10E",Qt],["math_PI",Qt],["math_SQRT1_2",Qt],["math_SQRT2",Qt],["is_boolean",Ur(rr)],["is_number",Ur(Qt)],["is_string",Ur(xr)],["is_undefined",Ur(Sr)],["is_function",Ur(gr(dr(qt("T"),qt("U"))))],["math_abs",dr(Qt,Qt)],["math_acos",dr(Qt,Qt)],["math_acosh",dr(Qt,Qt)],["math_asin",dr(Qt,Qt)],["math_asinh",dr(Qt,Qt)],["math_atan",dr(Qt,Qt)],["math_atan2",dr(Qt,Qt,Qt)],["math_atanh",dr(Qt,Qt)],["math_cbrt",dr(Qt,Qt)],["math_ceil",dr(Qt,Qt)],["math_clz32",dr(Qt,Qt)],["math_cos",dr(Qt,Qt)],["math_cosh",dr(Qt,Qt)],["math_exp",dr(Qt,Qt)],["math_expm1",dr(Qt,Qt)],["math_floor",dr(Qt,Qt)],["math_fround",dr(Qt,Qt)],["math_hypot",gr(qt("T"))],["math_imul",dr(Qt,Qt,Qt)],["math_log",dr(Qt,Qt)],["math_log1p",dr(Qt,Qt)],["math_log2",dr(Qt,Qt)],["math_log10",dr(Qt,Qt)],["math_max",gr(qt("T"))],["math_min",gr(qt("T"))],["math_pow",dr(Qt,Qt,Qt)],["math_random",dr(Qt)],["math_round",dr(Qt,Qt)],["math_sign",dr(Qt,Qt)],["math_sin",dr(Qt,Qt)],["math_sinh",dr(Qt,Qt)],["math_sqrt",dr(Qt,Qt)],["math_tan",dr(Qt,Qt)],["math_tanh",dr(Qt,Qt)],["math_trunc",dr(Qt,Qt)],["parse_int",dr(xr,Qt,Qt)],["prompt",dr(xr,xr)],["get_time",dr(Qt)],["stringify",gr(dr(qt("T"),xr))],["display",gr(qt("T"))],["error",gr(qt("T"))]],on=qt("headType"),Rn=qt("tailType"),Nn=[["pair",gr(dr(on,Rn,fr(on,Rn)))],["head",gr(dr(fr(on,Rn),on))],["tail",gr(dr(fr(on,Rn),Rn))],["is_pair",Ur(gr(fr(on,Rn)))],["is_null",Ur(gr(mr(qt("T"))))],["is_list",Ur(gr(mr(qt("T"))))]],Mn=[["set_head",gr(dr(fr(on,Rn),on,Sr))],["set_tail",gr(dr(fr(on,Rn),Rn,Sr))]],pn=[["is_array",Ur(gr(tr(qt("T"))))],["array_length",gr(dr(tr(qt("T")),Qt))]],Hn=[["list",gr(qt("T1"))]],In=[[rt,dr(Qt,Qt)],["!",dr(rr,rr)],["&&",gr(dr(rr,qt("T"),qt("T")))],["||",gr(dr(rr,qt("T"),qt("T")))],["<",gr(dr(hr("A"),hr("A"),rr))],["<=",gr(dr(hr("A"),hr("A"),rr))],[">",gr(dr(hr("A"),hr("A"),rr))],[">=",gr(dr(hr("A"),hr("A"),rr))],["+",gr(dr(hr("A"),hr("A"),hr("A")))],["%",dr(Qt,Qt,Qt)],["-",dr(Qt,Qt,Qt)],["*",dr(Qt,Qt,Qt)],["/",dr(Qt,Qt,Qt)]],_r=[["===",gr(dr(hr("A"),hr("A"),rr))],["!==",gr(dr(hr("A"),hr("A"),rr))]],Nr=[["===",gr(dr(qt("T1"),qt("T2"),rr))],["!==",gr(dr(qt("T1"),qt("T2"),rr))]],kr=[["is_stream",gr(dr(qt("T1"),rr))],["list_to_stream",gr(dr(mr(qt("T1")),qt("T2")))],["stream_to_list",gr(dr(qt("T1"),mr(qt("T2"))))],["stream_length",gr(dr(qt("T1"),Qt))],["stream_map",gr(dr(qt("T1"),qt("T2")))],["build_stream",gr(dr(Qt,dr(Qt,qt("T1")),qt("T2")))],["stream_for_each",gr(dr(dr(qt("T1"),qt("T2")),rr))],["stream_reverse",gr(dr(qt("T1"),qt("T1")))],["stream_append",gr(dr(qt("T1"),qt("T1"),qt("T1")))],["stream_member",gr(dr(qt("T1"),qt("T2"),qt("T2")))],["stream_remove",gr(dr(qt("T1"),qt("T2"),qt("T2")))],["stream_remove_all",gr(dr(qt("T1"),qt("T2"),qt("T2")))],["stream_filter",gr(dr(dr(qt("T1"),rr),qt("T2"),qt("T2")))],["enum_stream",gr(dr(Qt,Qt,qt("T1")))],["integers_from",gr(dr(Qt,qt("T1")))],["eval_stream",gr(dr(qt("T1"),Qt,mr(qt("T2"))))],["stream_ref",gr(dr(qt("T1"),Qt,qt("T2")))]];function nn(Yt){const er=[...tn,...In];return Yt>=2&&er.push(...Nn,...Hn),Yt>=3?er.push(...Nr,...Mn,...pn):er.push(..._r),[{typeMap:new Map(er),declKindMap:new Map(er.map(lr=>[lr[0],"const"]))}]}return typeChecker.createTypeEnvironment=nn,typeChecker}var hasRequiredCreateContext;function requireCreateContext(){return hasRequiredCreateContext||(hasRequiredCreateContext=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.importBuiltins=i.importExternalSymbols=i.defineBuiltin=i.defineSymbol=i.ensureGlobalEnvironmentExist=i.createEmptyContext=i.createGlobalEnvironment=i.EnvTreeNode=i.EnvTree=i.LazyBuiltIn=void 0;const s=constants,o=lib,a=requireSchedulers(),rt=lazyList_prelude,et=requireList(),ot=requireList(),at=list_prelude,nt=requireMisc(),it=nonDet_prelude,j=requireParser(),_=requireStream(),$=stream_prelude,tt=requireTypeChecker(),st=types,lt=makeWrapper$1,ct=requireOperators(),ht=requireStringify();class ut{constructor(Dt,Bt){this.func=Dt,this.evaluateArgs=Bt}}i.LazyBuiltIn=ut;class pt{constructor(){this._root=null,this.map=new Map}get root(){return this._root}insert(Dt){const Bt=Dt.tail;if(Bt===null)this._root===null&&(this._root=new mt(Dt,null),this.map.set(Dt,this._root));else{const Kt=this.map.get(Bt);if(Kt){const Wt=new mt(Dt,Kt);Kt.addChild(Wt),this.map.set(Dt,Wt)}}}getTreeNode(Dt){return this.map.get(Dt)}}i.EnvTree=pt;class mt{constructor(Dt,Bt){this.environment=Dt,this.parent=Bt,this._children=[]}get children(){return this._children}resetChildren(Dt){this.clearChildren(),this.addChildren(Dt),Dt.forEach(Bt=>Bt.parent=this)}clearChildren(){this._children=[]}addChildren(Dt){this._children.push(...Dt)}addChild(Dt){return this._children.push(Dt),Dt}}i.EnvTreeNode=mt;const gt=()=>({break:!1,debuggerOn:!0,isRunning:!1,environmentTree:new pt,environments:[],value:void 0,nodes:[]}),dt=()=>({observers:{callbacks:Array()},status:!1,state:{it:function*(){}(),scheduler:new a.AsyncScheduler}}),St=()=>({tail:null,name:"global",head:{},id:"-1"});i.createGlobalEnvironment=St;const xt=()=>({builtins:new Map,previousProgramsIdentifiers:new Set,operators:new Map(Object.entries(ct)),gpu:new Map(Object.entries(o)),maxExecTime:s.JSSLANG_PROPERTIES.maxExecTime,evaller:null}),yt=(Mt,Dt=st.Variant.DEFAULT,Bt,Kt)=>({chapter:Mt,externalSymbols:Bt,errors:[],externalContext:Kt,runtime:gt(),numberOfOuterEnvironments:1,prelude:null,debugger:dt(),nativeStorage:xt(),executionMethod:"auto",variant:Dt,moduleContexts:{},unTypecheckedCode:[],typeEnvironment:(0,tt.createTypeEnvironment)(Mt),previousCode:[]});i.createEmptyContext=yt;const _t=Mt=>{if(Mt.runtime||(Mt.runtime=gt()),Mt.runtime.environments||(Mt.runtime.environments=[]),Mt.runtime.environmentTree||(Mt.runtime.environmentTree=new pt),Mt.runtime.environments.length===0){const Dt=(0,i.createGlobalEnvironment)();Mt.runtime.environments.push(Dt),Mt.runtime.environmentTree.insert(Dt)}};i.ensureGlobalEnvironmentExist=_t;const Ct=(Mt,Dt,Bt)=>{const Kt=Mt.runtime.environments[0];Object.defineProperty(Kt.head,Dt,{value:Bt,writable:!1,enumerable:!0}),Mt.nativeStorage.builtins.set(Dt,Bt);const Wt=Mt.typeEnvironment[0];Wt.declKindMap.has(Dt)||(Wt.typeMap.set(Dt,(0,tt.tForAll)((0,tt.tVar)("T1"))),Wt.declKindMap.set(Dt,"const"))};i.defineSymbol=Ct;function Et(Mt,Dt,Bt,Kt=void 0){if(typeof Bt=="function"){const Wt=Dt.split("(")[0].trim(),zt=`function ${Dt} { + `}elaborate(){return this.explain()}}return typeErrors.InconsistentPredicateTestError=ut,typeErrors}var internalTypeErrors={},hasRequiredInternalTypeErrors;function requireInternalTypeErrors(){if(hasRequiredInternalTypeErrors)return internalTypeErrors;hasRequiredInternalTypeErrors=1,Object.defineProperty(internalTypeErrors,"__esModule",{value:!0}),internalTypeErrors.InternalCyclicReferenceError=internalTypeErrors.InternalDifferentNumberArgumentsError=internalTypeErrors.UnifyError=internalTypeErrors.InternalTypeError=internalTypeErrors.TypeError=void 0;const i=types,s=requireStringify();class o{constructor(nt,it){this.node=nt,this.message=it,this.type=i.ErrorType.TYPE,this.severity=i.ErrorSeverity.WARNING,nt.typability="Untypable"}get location(){return this.node.loc}explain(){return this.message}elaborate(){return this.message}}internalTypeErrors.TypeError=o;class a extends Error{constructor(nt){super(),this.message=nt}}internalTypeErrors.InternalTypeError=a;class rt extends a{constructor(nt,it){super(`Failed to unify LHS: ${(0,s.typeToString)(nt)}, RHS: ${(0,s.typeToString)(it)}`),this.LHS=nt,this.RHS=it}}internalTypeErrors.UnifyError=rt;class tt extends a{constructor(nt,it){super(`Expected ${nt} args, got ${it}`),this.numExpectedArgs=nt,this.numReceived=it}}internalTypeErrors.InternalDifferentNumberArgumentsError=tt;class ot extends a{constructor(nt){super("contains a cyclic reference to itself"),this.name=nt}}return internalTypeErrors.InternalCyclicReferenceError=ot,internalTypeErrors}var hasRequiredTypeChecker;function requireTypeChecker(){if(hasRequiredTypeChecker)return typeChecker;hasRequiredTypeChecker=1,Object.defineProperty(typeChecker,"__esModule",{value:!0}),typeChecker.createTypeEnvironment=typeChecker.tForAll=typeChecker.tVar=typeChecker.typeCheck=void 0;const i=requireTypeErrors(),s=requireParser$1(),o=requireStringify(),a=requireInternalTypeErrors(),rt="-_1";let tt=0;function ot(Yt,er){if(Yt!==null){if(er&&Yt.typability!=="Untypable")try{Yt.inferredType=mt(Yt.inferredType,er),Yt.typability="Typed"}catch(lr){j(lr)&&!(lr instanceof a.InternalCyclicReferenceError)&&et(new a.TypeError(Yt,lr))}else Yt.inferredType=qt(tt),tt++;switch(Yt.type){case"Program":{Yt.body.forEach(lr=>{ot(lr,er)});break}case"UnaryExpression":{ot(Yt.argument,er);break}case"LogicalExpression":case"BinaryExpression":{ot(Yt.left,er),ot(Yt.right,er);break}case"ExpressionStatement":{ot(Yt.expression,er);break}case"BlockStatement":{Yt.body.forEach(lr=>{ot(lr,er)});break}case"WhileStatement":{ot(Yt.test,er),ot(Yt.body,er);break}case"ForStatement":{ot(Yt.init,er),ot(Yt.test,er),ot(Yt.update,er),ot(Yt.body,er);break}case"ConditionalExpression":case"IfStatement":{ot(Yt.test,er),ot(Yt.consequent,er),Yt.alternate&&ot(Yt.alternate,er);break}case"CallExpression":{ot(Yt.callee,er),Yt.arguments.forEach(lr=>{ot(lr,er)});break}case"ReturnStatement":{const lr=Yt.argument;ot(lr,er);break}case"VariableDeclaration":{const lr=Yt.declarations[0].init;ot(lr,er);break}case"ArrowFunctionExpression":{Yt.params.forEach(lr=>{ot(lr,er)}),ot(Yt.body,er);break}case"FunctionDeclaration":{const lr=Yt;if(er)try{lr.functionInferredType=mt(lr.functionInferredType,er)}catch(Lr){Lr instanceof a.InternalCyclicReferenceError?et(new i.CyclicReferenceError(Yt)):j(Lr)&&et(new a.TypeError(Yt,Lr))}else lr.functionInferredType=qt(tt);tt++,lr.params.forEach(Lr=>{ot(Lr,er)}),ot(lr.body,er);break}case"AssignmentExpression":ot(Yt.left,er),ot(Yt.right,er);break;case"ArrayExpression":Yt.elements.forEach(lr=>ot(lr,er));break;case"MemberExpression":ot(Yt.object,er),ot(Yt.property,er);break;default:return}}}function at(Yt){return Yt.kind==="pair"}function nt(Yt){return Yt.kind==="list"}function it(Yt){return nt(Yt)?Yt.elementType:null}function j(Yt){return Yt instanceof a.InternalTypeError}let _=!1,$=[];function et(Yt){Yt instanceof i.UndefinedIdentifierError&&_||(_=!0,$.push(Yt))}function st(Yt,er){function lr(Lr){tt=0,_=!1,$=[];const Or=er.typeEnvironment;if(er.chapter>=3&&Or.length===3){const Cr=Or[2].typeMap;for(const[Hr,rn]of kr)Cr.set(Hr,rn)}const Er=[];ot(Lr);try{zt(Lr,Or,Er,!0)}catch(Cr){j(Cr)?et(new a.TypeError(Lr,`Uncaught internal type error during typechecking, report this to the adminstrators! +`+Cr.message)):et(new a.TypeError(Lr,`Uncaught error during typechecking, report this to the adminstrators! +`+Cr.message))}return ot(Lr,Er),[Lr,$]}for(const Lr of er.unTypecheckedCode)lr((0,s.typedParse)(Lr,er));return er.unTypecheckedCode=[],lr(Yt)}typeChecker.typeCheck=st;function lt(Yt){const er=tt;return tt++,Object.assign(Object.assign({},Yt),{name:`T${er}`})}function ct(Yt,er){switch(Yt.kind){case"primitive":return Yt;case"list":return{kind:"list",elementType:ct(Yt.elementType,er)};case"array":return{kind:"array",elementType:ct(Yt.elementType,er)};case"pair":return{kind:"pair",headType:ct(Yt.headType,er),tailType:ct(Yt.tailType,er)};case"variable":return er[Yt.name];case"function":return Object.assign(Object.assign({},Yt),{parameterTypes:Yt.parameterTypes.map(lr=>ct(lr,er)),returnType:ct(Yt.returnType,er)})}}function ht(Yt,er){const lr=[...Yt];return er.forEach(Lr=>{lr.findIndex(Or=>Or.name===Lr.name)===-1&&lr.push(Lr)}),lr}function ut(Yt){switch(Yt.kind){case"primitive":return[];case"list":return ut(Yt.elementType);case"array":return ut(Yt.elementType);case"pair":return ht(ut(Yt.headType),ut(Yt.tailType));case"variable":return[Yt];case"function":return ht(Yt.parameterTypes.reduce((er,lr)=>ht(er,ut(lr)),[]),ut(Yt.returnType))}}function pt(Yt){const er=Yt.polyType,lr=ut(er),Lr={};return lr.forEach(Or=>{Lr[Or.name]=lt(Or)}),ct(er,Lr)}function mt(Yt,er){switch(Yt.kind){case"primitive":return Yt;case"pair":{const lr=mt(Yt.headType,er),Lr=mt(Yt.tailType,er);return Lr.kind==="list"&&lr===it(Lr)?mr(lr):fr(lr,Lr)}case"list":return{kind:"list",elementType:mt(Yt.elementType,er)};case"array":return{kind:"array",elementType:mt(Yt.elementType,er)};case"variable":{for(const lr of er){const Lr=lr[0],Or=lr[1];if(Lr.name===Yt.name){if(gt(Or,Lr.name)){if(at(Or)&&Lr===Or.tailType)return{kind:"list",elementType:Or.headType};if(Lr.kind==="variable"&&Lr===it(Or))return{kind:"list",elementType:Lr};throw new a.InternalCyclicReferenceError(Yt.name)}return mt(lr[1],er)}}return Yt}case"function":return Object.assign(Object.assign({},Yt),{parameterTypes:Yt.parameterTypes.map(lr=>mt(lr,er)),returnType:mt(Yt.returnType,er)})}}function gt(Yt,er){switch(Yt.kind){case"primitive":return!1;case"pair":return gt(Yt.headType,er)||gt(Yt.tailType,er);case"array":case"list":return gt(Yt.elementType,er);case"variable":return Yt.name===er;case"function":return Yt.parameterTypes.some(Lr=>gt(Lr,er))||gt(Yt.returnType,er)}}function dt(Yt,er,lr){for(const Lr of er)if(Lr[0].name===Yt.name)return _t(er,[lr,Lr[1]]);return lr.kind==="variable"&&Yt.constraint==="addable"&&lr.constraint==="none"&&(lr.constraint=Yt.constraint),Yt!==lr&&er.push([Yt,lr]),er}function St(Yt,er){return Yt.constraint==="addable"&&er.kind!=="variable"&&!(er.kind==="primitive"&&(er.name==="string"||er.name==="number"))}function xt(Yt){return{kind:"function",parameterTypes:[lt(qt("T"))],returnType:rr}}function yt(){return dr(lt(qt("T")),rr)}function _t(Yt,[er,lr]){if(er.kind==="primitive"&&lr.kind==="primitive"&&er.name===lr.name)return Yt;if(er.kind!=="variable"&&lr.kind==="variable")return _t(Yt,[lr,er]);if(er.kind==="variable"){if(lr=mt(lr,Yt),(lr.kind==="primitive"||lr.kind==="variable")&&er.name===lr.name)return Yt;if(lr.kind==="pair"&&er===lr.tailType)_t(Yt,[er,mr(lr.headType)]);else if(lr.kind==="pair"&&lr.tailType.kind==="list"){const Lr=_t(Yt,[lr.headType,it(lr.tailType)]);return _t(Lr,[er,mr(lr.headType)])}else if(gt(lr,er.name))throw new a.InternalCyclicReferenceError(er.name);if(St(er,lr))throw new a.UnifyError(er,lr);return dt(er,Yt,mt(lr,Yt))}else if(er.kind==="function"&&lr.kind==="function"){if(er.parameterTypes.length!==lr.parameterTypes.length)throw new a.InternalDifferentNumberArgumentsError(lr.parameterTypes.length,er.parameterTypes.length);let Lr=Yt;for(let Or=0;Orkt(er));case"ForStatement":case"WhileStatement":return kt(Yt.body);case"ReturnStatement":return!0;default:return!1}}function Tt(Yt){switch(Yt.type){case"ExpressionStatement":return!0;case"IfStatement":return Tt(Yt.consequent)||Tt(Yt.alternate);case"BlockStatement":return Yt.body.some(er=>Tt(er));case"ForStatement":case"WhileStatement":return Tt(Yt.body);default:return!1}}function $t(Yt,er,lr=[]){if(Yt.type==="LogicalExpression"&&Yt.operator==="&&")return lr=$t(Yt.left,er,lr),$t(Yt.right,er,lr);if(Yt.type==="UnaryExpression"&&Yt.operator==="!")return It(Yt.argument,er,lr);if(Yt.type==="CallExpression"&&Yt.callee.type==="Identifier"&&Yt.arguments.length===1&&Yt.arguments[0].type==="Identifier"){const Lr=Mt(Yt.callee.name,er);if(Lr!==void 0&&Lr.kind==="predicate")return lr.push({node:Yt,ifTrueType:Lr.ifTrueType,argVarName:Yt.arguments[0].name}),lr}return lr}function It(Yt,er,lr=[]){return Yt.type==="LogicalExpression"&&Yt.operator==="||"?(lr=It(Yt.left,er,lr),It(Yt.right,er,lr)):Yt.type==="UnaryExpression"&&Yt.operator==="!"?$t(Yt.argument,er,lr):lr}function Ot(Yt,er){const lr=Yt.body.length-1;if(er){for(let Lr=lr;Lr>=0;Lr--)if(Tt(Yt.body[Lr]))return Lr;return lr}else return Yt.body.findIndex((Lr,Or)=>Or===lr||kt(Lr))}function Mt(Yt,er){for(let lr=er.length-1;lr>=0;lr--)if(er[lr].typeMap.has(Yt))return er[lr].typeMap.get(Yt)}function Dt(Yt,er){for(let lr=er.length-1;lr>=0;lr--)if(er[lr].declKindMap.has(Yt))return er[lr].declKindMap.get(Yt)}function Bt(Yt,er,lr){lr[lr.length-1].typeMap.set(Yt,er)}function Kt(Yt,er,lr){lr[lr.length-1].declKindMap.set(Yt,er)}function Wt(Yt){Yt.push({typeMap:new Map,declKindMap:new Map})}function zt(Yt,er,lr,Lr=!1){try{return Ht(Yt,er,lr,Lr)}catch(Or){if(Or instanceof a.InternalCyclicReferenceError)return et(new i.CyclicReferenceError(Yt)),lr;throw Or}}function Ht(Yt,er,lr,Lr=!1){const Or=Yt.inferredType;switch(Yt.type){case"UnaryExpression":{const Er=Yt.operator==="-"?rt:Yt.operator,Cr=Mt(Er,er),Hr=Yt.argument,rn=Hr.inferredType,Dr=[];let Yr=zt(Hr,er,lr);Dr.push(mt(Hr.inferredType,Yr));try{Yr=_t(Yr,[dr(rn,Or),Cr])}catch(jr){if(jr instanceof a.UnifyError){const Gr=Cr.parameterTypes;return et(new i.InvalidArgumentTypesError(Yt,[Hr],Gr,Dr)),Yr}}return Yr}case"LogicalExpression":{const Er=Yt.left,Cr=Er.inferredType,Hr=Yt.right,rn=Hr.inferredType;let Dr=lr;Dr=_t(lr,[Or,rr]),Dr=zt(Er,er,Dr);const Yr=mt(Er.inferredType,Dr);let jr;if(Yt.operator==="&&"){const Gr=$t(Yt.left,er);Gr.length>0&&(Dr=Ct(Yt,Gr,Yt.right,Lr,er,Dr),jr=mt(Hr.inferredType,Dr))}else if(Yt.operator==="||"){const Gr=It(Yt.left,er);Gr.length>0&&(Dr=Ct(Yt,Gr,Yt.right,Lr,er,Dr),jr=mt(Hr.inferredType,Dr))}jr===void 0&&(Dr=zt(Hr,er,Dr),jr=mt(Hr.inferredType,Dr));try{Dr=_t(lr,[Cr,rr]),Dr=_t(lr,[rn,rr])}catch(Gr){Gr instanceof a.UnifyError&&et(new i.InvalidArgumentTypesError(Yt,[Er,Hr],[rr,rr],[Yr,jr]))}return Dr}case"BinaryExpression":{const Er=Mt(Yt.operator,er),Cr=Er.kind==="forall"?pt(Er):Er.kind==="predicate"?xt():Er,Hr=Yt.left,rn=Hr.inferredType,Dr=Yt.right,Yr=Dr.inferredType,jr=[Hr,Dr];let Gr=lr;const an=[];jr.forEach(Rr=>{Gr=zt(Rr,er,Gr),an.push(mt(Rr.inferredType,Gr))});try{Gr=_t(lr,[dr(rn,Yr,Or),Cr])}catch(Rr){if(Rr instanceof a.UnifyError){const mn=Cr.parameterTypes;et(new i.InvalidArgumentTypesError(Yt,jr,mn,an))}}return Gr}case"ExpressionStatement":return zt(Yt.expression,er,_t(lr,[Or,Sr]));case"ReturnStatement":{const Er=Yt.argument;return zt(Er,er,_t(lr,[Or,Er.inferredType]))}case"WhileStatement":{const Er=Yt.test,Cr=Er.inferredType,Hr=Yt.body,rn=Hr.inferredType;let Dr=_t(lr,[Or,rn]);try{Dr=zt(Er,er,Dr),Dr=_t(Dr,[Cr,rr])}catch(Yr){Yr instanceof a.UnifyError&&et(new i.InvalidTestConditionError(Yt,Yr.RHS))}return zt(Hr,er,Dr,Lr)}case"ForStatement":{const Er=Yt.init,Cr=Yt.test,Hr=Cr.inferredType,rn=Yt.body,Dr=rn.inferredType,Yr=Yt.update;let jr=_t(lr,[Or,Dr]);if(Wt(er),Er.type==="VariableDeclaration"&&Er.kind!=="var"&&Er.declarations[0].id.type==="Identifier"){const an=Er.declarations[0].id.name;Bt(an,Er.declarations[0].init.inferredType,er),Kt(an,Er.kind,er),jr=zt(Er,er,jr),Bt(an,gr(mt(Er.declarations[0].init.inferredType,jr)),er)}else jr=zt(Er,er,jr);try{jr=zt(Cr,er,jr),jr=_t(jr,[Hr,rr])}catch(an){an instanceof a.UnifyError&&et(new i.InvalidTestConditionError(Yt,an.RHS))}jr=zt(Yr,er,jr);const Gr=zt(rn,er,jr,Lr);return er.pop(),Gr}case"Program":case"BlockStatement":{Wt(er);for(const Rr of Yt.body)if(Rr.type==="ImportDeclaration")for(const mn of Rr.specifiers)mn.type==="ImportSpecifier"&&mn.local.type==="Identifier"&&(Bt(mn.local.name,gr(qt("T1")),er),Kt(mn.local.name,"const",er));const Er=Yt.body.length-1,Cr=Ot(Yt,Lr);let Hr=-1,rn=!1,Dr=Er;const Yr=[];for(;Dr>=0;){const Rr=Yt.body[Dr];(Rr.type==="FunctionDeclaration"||Rr.type==="VariableDeclaration")&&(rn||(rn=!0,Hr=Dr),Yr.push(Rr)),Dr--}Yr.forEach(Rr=>{if(Rr.type==="FunctionDeclaration"&&Rr.id!==null){const mn=Rr.id.name;Bt(mn,Rr.functionInferredType,er),Kt(mn,"const",er)}else if(Rr.type==="VariableDeclaration"&&Rr.kind!=="var"&&Rr.declarations[0].id.type==="Identifier"){const mn=Rr.declarations[0].id.name;Bt(mn,Rr.declarations[0].init.inferredType,er),Kt(mn,Rr.kind,er)}});const jr=Yt.body[Cr],Gr=Lr&&jr.type==="ExpressionStatement"?jr.expression.inferredType:jr.inferredType;let an=_t(lr,[Or,Gr]);for(let Rr=0;Rr<=Hr;Rr++)Rr===Cr?an=zt(Yt.body[Rr],er,an,Lr):an=zt(Yt.body[Rr],er,an);Yr.forEach(Rr=>{Rr.type==="FunctionDeclaration"&&Rr.id!==null?Bt(Rr.id.name,gr(mt(Rr.functionInferredType,an)),er):Rr.type==="VariableDeclaration"&&Rr.declarations[0].id.type==="Identifier"&&Bt(Rr.declarations[0].id.name,gr(mt(Rr.declarations[0].init.inferredType,an)),er)});for(let Rr=Hr+1;Rr<=Er;Rr++){const mn=Yt.body[Rr];Rr===Cr?an=zt(mn,er,an,Lr):an=zt(mn,er,an)}return Yt.type==="BlockStatement"&&er.pop(),an}case"Literal":{const Er=Yt.value,Cr=typeof Er;if(Er===null)return _t(lr,[Or,mr(qt(tt++))]);if(Cr==="number")return _t(lr,[Or,Qt]);if(Cr==="boolean")return _t(lr,[Or,rr]);if(Cr==="string")return _t(lr,[Or,xr]);throw Error("Unexpected literal type")}case"Identifier":{const Er=Yt.name,Cr=Mt(Er,er);return Cr!==void 0?Cr.kind==="forall"?_t(lr,[Or,pt(Cr)]):Cr.kind==="predicate"?_t(lr,[Or,yt()]):_t(lr,[Or,Cr]):(et(new i.UndefinedIdentifierError(Yt,Er)),lr)}case"ConditionalExpression":case"IfStatement":{const Er=Yt.test,Cr=Er.inferredType,Hr=Yt.consequent,rn=Hr.inferredType,Dr=Yt.alternate,Yr=Dr.inferredType;let jr=lr;try{jr=zt(Er,er,jr),jr=_t(jr,[Cr,rr])}catch(Rr){Rr instanceof a.UnifyError&&et(new i.InvalidTestConditionError(Yt,Rr.RHS))}const Gr=$t(Er,er),an=It(Er,er);if(Gr.length>0)jr=Et(Yt,Gr,Hr,Dr,Lr,er,jr);else if(an.length>0)jr=Et(Yt,an,Dr,Hr,Lr,er,jr);else{jr=zt(Hr,er,jr,Lr);try{jr=zt(Dr,er,jr,Lr)}catch(Rr){Rr instanceof a.UnifyError&&et(new i.ConsequentAlternateMismatchError(Yt,Rr.RHS,Rr.LHS))}}try{jr=_t(jr,[Or,rn]),jr=_t(jr,[Or,Yr])}catch(Rr){Rr instanceof a.UnifyError&&et(new i.ConsequentAlternateMismatchError(Yt,Rr.RHS,Rr.LHS))}return jr}case"ArrowFunctionExpression":{Wt(er);const Er=Yt.params,Cr=Er.map(Yr=>Yr.inferredType),Hr=Yt.body;Cr.push(Hr.inferredType);const rn=_t(lr,[Or,dr(...Cr)]);Er.forEach(Yr=>{Bt(Yr.name,Yr.inferredType,er)});const Dr=zt(Hr,er,rn);return er.pop(),Dr}case"VariableDeclaration":{const Er=Yt.declarations[0].init;return zt(Er,er,_t(lr,[Or,Sr]))}case"FunctionDeclaration":{const Er=Yt;let Cr=_t(lr,[Or,Sr]);Wt(er);const Hr=Er.functionInferredType,rn=Yt.params,Dr=rn.map(Gr=>Gr.inferredType),Yr=Yt.body;Dr.push(Yr.inferredType),Cr=_t(Cr,[Hr,dr(...Dr)]),rn.forEach(Gr=>{Bt(Gr.name,Gr.inferredType,er)});const jr=zt(Yr,er,Cr);return er.pop(),jr}case"CallExpression":{const Er=Yt.callee,Cr=Er.inferredType,Hr=Yt.arguments,rn=Hr.map(Gr=>Gr.inferredType);rn.push(Or);let Dr=lr;Dr=zt(Er,er,Dr);const Yr=mt(Er.inferredType,Dr),jr=[];Hr.forEach(Gr=>{Dr=zt(Gr,er,Dr),jr.push(mt(Gr.inferredType,Dr))});try{Dr=_t(lr,[dr(...rn),Cr])}catch(Gr){if(Gr instanceof a.UnifyError)if(Yr.kind==="function"){const an=Yr.parameterTypes;et(new i.InvalidArgumentTypesError(Yt,Hr,an,jr))}else et(new i.CallingNonFunctionType(Yt,Yr));else Gr instanceof a.InternalDifferentNumberArgumentsError&&et(new i.DifferentNumberArgumentsError(Yt,Gr.numExpectedArgs,Gr.numReceived))}return Dr}case"AssignmentExpression":{const Er=Yt.left,Cr=Yt.right,Hr=Cr.inferredType,rn=Er.inferredType;let Dr=_t(lr,[Or,Hr]);if(Dr=zt(Cr,er,Dr),Er.type==="Identifier"&&Dt(Er.name,er)==="const")return et(new i.ReassignConstError(Yt)),Dr;Dr=zt(Er,er,Dr);try{return _t(Dr,[Hr,rn])}catch(Yr){Yr instanceof a.UnifyError&&(Er.type==="Identifier"?et(new i.DifferentAssignmentError(Yt,mt(rn,Dr),mt(Hr,Dr))):et(new i.ArrayAssignmentError(Yt,tr(mt(rn,Dr)),tr(mt(Hr,Dr)))))}return Dr}case"ArrayExpression":{let Er=lr;const Cr=Yt.elements;Cr.forEach(rn=>{Er=zt(rn,er,Er)});const Hr=qt(tt++);return Er=_t(Er,[Or,tr(Hr)]),Cr.forEach(rn=>{try{Er=_t(Er,[Hr,rn.inferredType])}catch(Dr){Dr instanceof a.UnifyError&&et(new i.ArrayAssignmentError(Yt,mt(Yt.inferredType,Er),tr(mt(rn.inferredType,Er))))}}),Er}case"MemberExpression":{const Cr=Yt.object.name,Hr=Yt.property,rn=Hr.inferredType;let Dr=zt(Hr,er,lr);const Yr=Mt(Cr,er);if(Yr.kind==="predicate")throw Yr.ifTrueType.kind==="forall"?new a.InternalTypeError(`Expected ${Cr} to be an array, got ${(0,o.typeToString)(pt(Yr.ifTrueType))}`):new a.InternalTypeError(`Expected ${Cr} to be an array, got ${(0,o.typeToString)(Yr.ifTrueType)}`);if(Yr.kind==="forall")throw new a.InternalTypeError(`Expected ${Cr} to be an array, got ${(0,o.typeToString)(pt(Yr))}`);const jr=mt(Yr,Dr);if(jr.kind!=="array")throw new a.InternalTypeError(`Expected ${Cr} to be an array, got ${(0,o.typeToString)(jr)}`);const Gr=jr.elementType;try{Dr=_t(lr,[rn,Qt])}catch(an){an instanceof a.UnifyError&&et(new i.InvalidArrayIndexType(Yt,mt(rn,Dr)))}return _t(Dr,[Or,Gr])}default:return _t(lr,[Or,Sr])}}function Zt(Yt){return{kind:"primitive",name:Yt}}function qt(Yt){return{kind:"variable",name:`T${Yt}`,constraint:"none"}}typeChecker.tVar=qt;function hr(Yt){return{kind:"variable",name:`${Yt}`,constraint:"addable"}}function fr(Yt,er){return{kind:"pair",headType:Yt,tailType:er}}function mr(Yt){return{kind:"list",elementType:Yt}}function gr(Yt){return{kind:"forall",polyType:Yt}}typeChecker.tForAll=gr;function tr(Yt){return{kind:"array",elementType:Yt}}const rr=Zt("boolean"),Qt=Zt("number"),xr=Zt("string"),Sr=Zt("undefined");function dr(...Yt){const er=Yt.slice(0,-1),lr=Yt.slice(-1)[0];return{kind:"function",parameterTypes:er,returnType:lr}}function Ur(Yt){return{kind:"predicate",ifTrueType:Yt}}const tn=[["Infinity",Qt],["NaN",Qt],["undefined",Sr],["math_E",Qt],["math_LN2",Qt],["math_LN10",Qt],["math_LOG2E",Qt],["math_LOG10E",Qt],["math_PI",Qt],["math_SQRT1_2",Qt],["math_SQRT2",Qt],["is_boolean",Ur(rr)],["is_number",Ur(Qt)],["is_string",Ur(xr)],["is_undefined",Ur(Sr)],["is_function",Ur(gr(dr(qt("T"),qt("U"))))],["math_abs",dr(Qt,Qt)],["math_acos",dr(Qt,Qt)],["math_acosh",dr(Qt,Qt)],["math_asin",dr(Qt,Qt)],["math_asinh",dr(Qt,Qt)],["math_atan",dr(Qt,Qt)],["math_atan2",dr(Qt,Qt,Qt)],["math_atanh",dr(Qt,Qt)],["math_cbrt",dr(Qt,Qt)],["math_ceil",dr(Qt,Qt)],["math_clz32",dr(Qt,Qt)],["math_cos",dr(Qt,Qt)],["math_cosh",dr(Qt,Qt)],["math_exp",dr(Qt,Qt)],["math_expm1",dr(Qt,Qt)],["math_floor",dr(Qt,Qt)],["math_fround",dr(Qt,Qt)],["math_hypot",gr(qt("T"))],["math_imul",dr(Qt,Qt,Qt)],["math_log",dr(Qt,Qt)],["math_log1p",dr(Qt,Qt)],["math_log2",dr(Qt,Qt)],["math_log10",dr(Qt,Qt)],["math_max",gr(qt("T"))],["math_min",gr(qt("T"))],["math_pow",dr(Qt,Qt,Qt)],["math_random",dr(Qt)],["math_round",dr(Qt,Qt)],["math_sign",dr(Qt,Qt)],["math_sin",dr(Qt,Qt)],["math_sinh",dr(Qt,Qt)],["math_sqrt",dr(Qt,Qt)],["math_tan",dr(Qt,Qt)],["math_tanh",dr(Qt,Qt)],["math_trunc",dr(Qt,Qt)],["parse_int",dr(xr,Qt,Qt)],["prompt",dr(xr,xr)],["get_time",dr(Qt)],["stringify",gr(dr(qt("T"),xr))],["display",gr(qt("T"))],["error",gr(qt("T"))]],on=qt("headType"),Rn=qt("tailType"),Nn=[["pair",gr(dr(on,Rn,fr(on,Rn)))],["head",gr(dr(fr(on,Rn),on))],["tail",gr(dr(fr(on,Rn),Rn))],["is_pair",Ur(gr(fr(on,Rn)))],["is_null",Ur(gr(mr(qt("T"))))],["is_list",Ur(gr(mr(qt("T"))))]],Mn=[["set_head",gr(dr(fr(on,Rn),on,Sr))],["set_tail",gr(dr(fr(on,Rn),Rn,Sr))]],pn=[["is_array",Ur(gr(tr(qt("T"))))],["array_length",gr(dr(tr(qt("T")),Qt))]],Hn=[["list",gr(qt("T1"))]],In=[[rt,dr(Qt,Qt)],["!",dr(rr,rr)],["&&",gr(dr(rr,qt("T"),qt("T")))],["||",gr(dr(rr,qt("T"),qt("T")))],["<",gr(dr(hr("A"),hr("A"),rr))],["<=",gr(dr(hr("A"),hr("A"),rr))],[">",gr(dr(hr("A"),hr("A"),rr))],[">=",gr(dr(hr("A"),hr("A"),rr))],["+",gr(dr(hr("A"),hr("A"),hr("A")))],["%",dr(Qt,Qt,Qt)],["-",dr(Qt,Qt,Qt)],["*",dr(Qt,Qt,Qt)],["/",dr(Qt,Qt,Qt)]],_r=[["===",gr(dr(hr("A"),hr("A"),rr))],["!==",gr(dr(hr("A"),hr("A"),rr))]],Nr=[["===",gr(dr(qt("T1"),qt("T2"),rr))],["!==",gr(dr(qt("T1"),qt("T2"),rr))]],kr=[["is_stream",gr(dr(qt("T1"),rr))],["list_to_stream",gr(dr(mr(qt("T1")),qt("T2")))],["stream_to_list",gr(dr(qt("T1"),mr(qt("T2"))))],["stream_length",gr(dr(qt("T1"),Qt))],["stream_map",gr(dr(qt("T1"),qt("T2")))],["build_stream",gr(dr(Qt,dr(Qt,qt("T1")),qt("T2")))],["stream_for_each",gr(dr(dr(qt("T1"),qt("T2")),rr))],["stream_reverse",gr(dr(qt("T1"),qt("T1")))],["stream_append",gr(dr(qt("T1"),qt("T1"),qt("T1")))],["stream_member",gr(dr(qt("T1"),qt("T2"),qt("T2")))],["stream_remove",gr(dr(qt("T1"),qt("T2"),qt("T2")))],["stream_remove_all",gr(dr(qt("T1"),qt("T2"),qt("T2")))],["stream_filter",gr(dr(dr(qt("T1"),rr),qt("T2"),qt("T2")))],["enum_stream",gr(dr(Qt,Qt,qt("T1")))],["integers_from",gr(dr(Qt,qt("T1")))],["eval_stream",gr(dr(qt("T1"),Qt,mr(qt("T2"))))],["stream_ref",gr(dr(qt("T1"),Qt,qt("T2")))]];function nn(Yt){const er=[...tn,...In];return Yt>=2&&er.push(...Nn,...Hn),Yt>=3?er.push(...Nr,...Mn,...pn):er.push(..._r),[{typeMap:new Map(er),declKindMap:new Map(er.map(lr=>[lr[0],"const"]))}]}return typeChecker.createTypeEnvironment=nn,typeChecker}var hasRequiredCreateContext;function requireCreateContext(){return hasRequiredCreateContext||(hasRequiredCreateContext=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.importBuiltins=i.importExternalSymbols=i.defineBuiltin=i.defineSymbol=i.ensureGlobalEnvironmentExist=i.createEmptyContext=i.createGlobalEnvironment=i.EnvTreeNode=i.EnvTree=i.LazyBuiltIn=void 0;const s=constants,o=lib,a=requireSchedulers(),rt=lazyList_prelude,tt=requireList(),ot=requireList(),at=list_prelude,nt=requireMisc(),it=nonDet_prelude,j=requireParser(),_=requireStream(),$=stream_prelude,et=requireTypeChecker(),st=types,lt=makeWrapper$1,ct=requireOperators(),ht=requireStringify();class ut{constructor(Dt,Bt){this.func=Dt,this.evaluateArgs=Bt}}i.LazyBuiltIn=ut;class pt{constructor(){this._root=null,this.map=new Map}get root(){return this._root}insert(Dt){const Bt=Dt.tail;if(Bt===null)this._root===null&&(this._root=new mt(Dt,null),this.map.set(Dt,this._root));else{const Kt=this.map.get(Bt);if(Kt){const Wt=new mt(Dt,Kt);Kt.addChild(Wt),this.map.set(Dt,Wt)}}}getTreeNode(Dt){return this.map.get(Dt)}}i.EnvTree=pt;class mt{constructor(Dt,Bt){this.environment=Dt,this.parent=Bt,this._children=[]}get children(){return this._children}resetChildren(Dt){this.clearChildren(),this.addChildren(Dt),Dt.forEach(Bt=>Bt.parent=this)}clearChildren(){this._children=[]}addChildren(Dt){this._children.push(...Dt)}addChild(Dt){return this._children.push(Dt),Dt}}i.EnvTreeNode=mt;const gt=()=>({break:!1,debuggerOn:!0,isRunning:!1,environmentTree:new pt,environments:[],value:void 0,nodes:[]}),dt=()=>({observers:{callbacks:Array()},status:!1,state:{it:function*(){}(),scheduler:new a.AsyncScheduler}}),St=()=>({tail:null,name:"global",head:{},id:"-1"});i.createGlobalEnvironment=St;const xt=()=>({builtins:new Map,previousProgramsIdentifiers:new Set,operators:new Map(Object.entries(ct)),gpu:new Map(Object.entries(o)),maxExecTime:s.JSSLANG_PROPERTIES.maxExecTime,evaller:null}),yt=(Mt,Dt=st.Variant.DEFAULT,Bt,Kt)=>({chapter:Mt,externalSymbols:Bt,errors:[],externalContext:Kt,runtime:gt(),numberOfOuterEnvironments:1,prelude:null,debugger:dt(),nativeStorage:xt(),executionMethod:"auto",variant:Dt,moduleContexts:{},unTypecheckedCode:[],typeEnvironment:(0,et.createTypeEnvironment)(Mt),previousCode:[]});i.createEmptyContext=yt;const _t=Mt=>{if(Mt.runtime||(Mt.runtime=gt()),Mt.runtime.environments||(Mt.runtime.environments=[]),Mt.runtime.environmentTree||(Mt.runtime.environmentTree=new pt),Mt.runtime.environments.length===0){const Dt=(0,i.createGlobalEnvironment)();Mt.runtime.environments.push(Dt),Mt.runtime.environmentTree.insert(Dt)}};i.ensureGlobalEnvironmentExist=_t;const Ct=(Mt,Dt,Bt)=>{const Kt=Mt.runtime.environments[0];Object.defineProperty(Kt.head,Dt,{value:Bt,writable:!1,enumerable:!0}),Mt.nativeStorage.builtins.set(Dt,Bt);const Wt=Mt.typeEnvironment[0];Wt.declKindMap.has(Dt)||(Wt.typeMap.set(Dt,(0,et.tForAll)((0,et.tVar)("T1"))),Wt.declKindMap.set(Dt,"const"))};i.defineSymbol=Ct;function Et(Mt,Dt,Bt,Kt=void 0){if(typeof Bt=="function"){const Wt=Dt.split("(")[0].trim(),zt=`function ${Dt} { [implementation hidden] }`;Bt.toString=()=>zt,Bt.minArgsNeeded=Kt,(0,i.defineSymbol)(Mt,Wt,Bt)}else if(Bt instanceof ut){const Wt=(...Zt)=>Bt.func(...Zt),zt=Dt.split("(")[0].trim(),Ht=`function ${Dt} { [implementation hidden] -}`;Wt.toString=()=>Ht,(0,lt.makeWrapper)(Bt.func,Wt),(0,i.defineSymbol)(Mt,zt,new ut(Wt,Bt.evaluateArgs))}else(0,i.defineSymbol)(Mt,Dt,Bt)}i.defineBuiltin=Et;const kt=(Mt,Dt)=>{(0,i.ensureGlobalEnvironmentExist)(Mt),Dt.forEach(Bt=>{(0,i.defineSymbol)(Mt,Bt,s.GLOBAL[Bt])})};i.importExternalSymbols=kt;const Tt=(Mt,Dt)=>{(0,i.ensureGlobalEnvironmentExist)(Mt);const Bt=(qt,...hr)=>Dt.rawDisplay(qt,hr[0],Mt.externalContext),Kt=(qt,...hr)=>{if(hr.length===1&&hr[0]!==void 0&&typeof hr[0]!="string")throw new TypeError("display expects the second argument to be a string");return Bt((0,ht.stringify)(qt),hr[0]),qt},Wt=(qt,...hr)=>{if(hr.length===1&&hr[0]!==void 0&&typeof hr[0]!="string")throw new TypeError("display_list expects the second argument to be a string");return et.rawDisplayList(Kt,qt,hr[0])},zt=qt=>{const hr=Date.now(),fr=Dt.prompt(qt,"",Mt.externalContext);return Mt.nativeStorage.maxExecTime+=Date.now()-hr,fr},Ht=qt=>{const hr=Date.now();Dt.alert(qt,"",Mt.externalContext),Mt.nativeStorage.maxExecTime+=Date.now()-hr},Zt=(...qt)=>(Dt.visualiseList(qt,Mt.externalContext),qt[0]);if(Mt.chapter>=1){Et(Mt,"get_time()",nt.get_time),Et(Mt,"display(val, prepend = undefined)",Kt,1),Et(Mt,"raw_display(str, prepend = undefined)",Bt,1),Et(Mt,"stringify(val, indent = 2, maxLineLength = 80)",ht.stringify,1),Et(Mt,"error(str, prepend = undefined)",nt.error_message,1),Et(Mt,"prompt(str)",zt),Et(Mt,"is_number(val)",nt.is_number),Et(Mt,"is_string(val)",nt.is_string),Et(Mt,"is_function(val)",nt.is_function),Et(Mt,"is_boolean(val)",nt.is_boolean),Et(Mt,"is_undefined(val)",nt.is_undefined),Et(Mt,"parse_int(str, radix)",nt.parse_int),Et(Mt,"char_at(str, index)",nt.char_at),Et(Mt,"arity(f)",nt.arity),Et(Mt,"undefined",void 0),Et(Mt,"NaN",NaN),Et(Mt,"Infinity",1/0);const qt=Object.getOwnPropertyNames(Math),hr=[..."abcdefghijklmnopqrstuvwxyz"];for(const fr of qt){const mr=Math[fr];if(typeof mr=="function"){let gr,tr;fr==="max"||fr==="min"?(gr="...values",tr=0):gr=hr.slice(0,mr.length).join(", "),Et(Mt,`math_${fr}(${gr})`,mr,tr)}else Et(Mt,`math_${fr}`,mr)}}Mt.chapter>=2&&(Mt.variant===st.Variant.LAZY?(Et(Mt,"pair(left, right)",new ut(et.pair,!1)),Et(Mt,"list(...values)",new ut(et.list,!1),0),Et(Mt,"is_pair(val)",new ut(et.is_pair,!0)),Et(Mt,"head(xs)",new ut(et.head,!0)),Et(Mt,"tail(xs)",new ut(et.tail,!0)),Et(Mt,"is_null(val)",new ut(et.is_null,!0)),Et(Mt,"draw_data(...xs)",new ut(Zt,!0),1),Et(Mt,"is_list(val)",new ut(et.is_list,!0))):(Et(Mt,"pair(left, right)",et.pair),Et(Mt,"is_pair(val)",et.is_pair),Et(Mt,"head(xs)",et.head),Et(Mt,"tail(xs)",et.tail),Et(Mt,"is_null(val)",et.is_null),Et(Mt,"list(...values)",et.list,0),Et(Mt,"draw_data(...xs)",Zt,1),Et(Mt,"display_list(val, prepend = undefined)",Wt,0),Et(Mt,"is_list(val)",et.is_list))),Mt.chapter>=3&&(Et(Mt,"set_head(xs, val)",et.set_head),Et(Mt,"set_tail(xs, val)",et.set_tail),Et(Mt,"array_length(arr)",nt.array_length),Et(Mt,"is_array(val)",nt.is_array),Et(Mt,"stream_tail(stream)",_.stream_tail),Et(Mt,"stream(...values)",_.stream,0)),Mt.chapter>=4&&(Et(Mt,"parse(program_string)",qt=>j.parse(qt,Ot(Mt.chapter))),Et(Mt,"tokenize(program_string)",qt=>j.tokenize(qt,Ot(Mt.chapter))),Et(Mt,"apply_in_underlying_javascript(fun, args)",(qt,hr)=>qt.apply(qt,(0,ot.list_to_vector)(hr))),Mt.variant===st.Variant.GPU&&(Et(Mt,"__clearKernelCache()",o.__clearKernelCache),Et(Mt,"__createKernelSource(shape, extern, localNames, output, fun, kernelId)",o.__createKernelSource))),Mt.chapter===st.Chapter.LIBRARY_PARSER&&(Et(Mt,"is_object(val)",nt.is_object),Et(Mt,"is_NaN(val)",nt.is_NaN),Et(Mt,"has_own_property(obj, prop)",nt.has_own_property),Et(Mt,"alert(val)",Ht),Et(Mt,"timed(fun)",qt=>nt.timed(Mt,qt,Mt.externalContext,Dt.rawDisplay))),Mt.variant===st.Variant.LAZY&&(Et(Mt,"wrapLazyCallee(f)",new ut(ct.wrapLazyCallee,!0)),Et(Mt,"makeLazyFunction(f)",new ut(ct.makeLazyFunction,!0)),Et(Mt,"forceIt(val)",new ut(ct.forceIt,!0)),Et(Mt,"delayIt(xs)",new ut(ct.delayIt,!0)))};i.importBuiltins=Tt;function $t(Mt){let Dt="";Mt.chapter>=2&&(Dt+=Mt.variant===st.Variant.LAZY?rt.lazyListPrelude:at.listPrelude),Mt.chapter>=3&&(Dt+=$.streamPrelude),Mt.variant===st.Variant.NON_DET&&(Dt+=it.nonDetPrelude),Dt!==""&&(Mt.prelude=Dt)}const It={rawDisplay:nt.rawDisplay,prompt:nt.rawDisplay,alert:nt.rawDisplay,visualiseList:Mt=>{throw new Error("List visualizer is not enabled")}},Ot=(Mt=st.Chapter.SOURCE_1,Dt=st.Variant.DEFAULT,Bt=[],Kt,Wt=It)=>{if(Mt===st.Chapter.FULL_JS)return Object.assign(Object.assign({},Ot(st.Chapter.SOURCE_4,Dt,Bt,Kt,Wt)),{chapter:st.Chapter.FULL_JS});const zt=(0,i.createEmptyContext)(Mt,Dt,Bt,Kt);return(0,i.importBuiltins)(zt,Wt),$t(zt),(0,i.importExternalSymbols)(zt,Bt),zt};i.default=Ot}(createContext)),createContext}Object.defineProperty(sicp,"__esModule",{value:!0});const createContext_1=requireCreateContext(),dict=createContext_1.default(4).nativeStorage.builtins;dict.get("get_time");dict.get("display");dict.get("raw_display");const stringify=dict.get("stringify");dict.get("error");dict.get("prompt");const is_number=dict.get("is_number"),is_string=dict.get("is_string"),is_function=dict.get("is_function"),is_boolean=dict.get("is_boolean"),is_undefined=dict.get("is_undefined");dict.get("parse_int");dict.get("char_at");const arity=dict.get("arity");dict.get("math_abs");dict.get("math_acos");dict.get("math_acosh");dict.get("math_asin");dict.get("math_asinh");dict.get("math_atan");dict.get("math_atanh");dict.get("math_atan2");dict.get("math_ceil");dict.get("math_cbrt");dict.get("math_expm1");dict.get("math_clz32");dict.get("math_cos");dict.get("math_cosh");dict.get("math_exp");dict.get("math_floor");dict.get("math_fround");dict.get("math_hypot");dict.get("math_imul");dict.get("math_log");dict.get("math_log1p");dict.get("math_log2");dict.get("math_log10");dict.get("math_max");dict.get("math_min");dict.get("math_pow");dict.get("math_random");dict.get("math_round");dict.get("math_sign");dict.get("math_sin");dict.get("math_sinh");dict.get("math_sqrt");dict.get("math_tan");dict.get("math_tanh");dict.get("math_trunc");dict.get("math_E");dict.get("math_LN10");dict.get("math_LN2");dict.get("math_LOG10E");dict.get("math_LOG2E");dict.get("math_PI");dict.get("math_SQRT1_2");dict.get("math_SQRT2");const pair=dict.get("pair"),is_pair=dict.get("is_pair"),head=dict.get("head"),tail=dict.get("tail"),is_null=dict.get("is_null"),list=dict.get("list");dict.get("draw_data");dict.get("display_list");dict.get("is_list");dict.get("set_head");dict.get("set_tail");dict.get("array_length");dict.get("is_array");const stream_tail=dict.get("stream_tail");dict.get("stream");dict.get("parse");dict.get("tokenize");dict.get("apply_in_underlying_javascript");function equal(i,s){return is_pair(i)?is_pair(s)&&equal(head(i),head(s))&&equal(tail(i),tail(s)):is_null(i)?is_null(s):is_number(i)?is_number(s)&&i===s:is_boolean(i)?is_boolean(s)&&(i&&s||!i&&!s):is_string(i)?is_string(s)&&i===s:is_undefined(i)?is_undefined(s):is_function(i)?is_function(s)&&i===s:!1}function $length(i,s){return is_null(i)?s:$length(tail(i),s+1)}function length(i){return $length(i,0)}function $map(i,s,o){return is_null(s)?reverse(o):$map(i,tail(s),pair(i(head(s)),o))}function map(i,s){return $map(i,s,null)}function $build_list(i,s,o){return i<0?o:$build_list(i-1,s,pair(s(i),o))}function build_list(i,s){return $build_list(s-1,i,null)}function for_each(i,s){return is_null(s)?!0:(i(head(s)),for_each(i,tail(s)))}function $list_to_string(i,s){return is_null(i)?s("null"):is_pair(i)?$list_to_string(head(i),o=>$list_to_string(tail(i),a=>s("["+o+","+a+"]"))):s(stringify(i))}function list_to_string(i){return $list_to_string(i,s=>s)}function $reverse(i,s){return is_null(i)?s:$reverse(tail(i),pair(head(i),s))}function reverse(i){return $reverse(i,null)}function $append(i,s,o){return is_null(i)?o(s):$append(tail(i),s,a=>o(pair(head(i),a)))}function append(i,s){return $append(i,s,o=>o)}function member(i,s){return is_null(s)?null:i===head(s)?s:member(i,tail(s))}function $remove(i,s,o){const a=append,rt=reverse;return is_null(s)?a(rt(o),s):i===head(s)?a(rt(o),tail(s)):$remove(i,tail(s),pair(head(s),o))}function remove(i,s){return $remove(i,s,null)}function $remove_all(i,s,o){const a=append,rt=reverse;return is_null(s)?a(rt(o),s):i===head(s)?$remove_all(i,tail(s),o):$remove_all(i,tail(s),pair(head(s),o))}function remove_all(i,s){return $remove_all(i,s,null)}function $filter(i,s,o){return is_null(s)?reverse(o):i(head(s))?$filter(i,tail(s),pair(head(s),o)):$filter(i,tail(s),o)}function filter(i,s){return $filter(i,s,null)}function $enum_list(i,s,o){const a=reverse;return i>s?a(o):$enum_list(i+1,s,pair(i,o))}function enum_list(i,s){return $enum_list(i,s,null)}function list_ref(i,s){return s===0?head(i):list_ref(tail(i),s-1)}function $accumulate(i,s,o,a){return is_null(o)?a(s):$accumulate(i,s,tail(o),rt=>a(i(head(o),rt)))}function accumulate(i,s,o){return $accumulate(i,s,o,a=>a)}function is_stream(i){return is_null(i)||is_pair(i)&&is_function(tail(i))&&arity(tail(i))===0&&is_stream(stream_tail(i))}function list_to_stream(i){return is_null(i)?null:pair(head(i),()=>list_to_stream(tail(i)))}function stream_to_list(i){return is_null(i)?null:pair(head(i),stream_to_list(stream_tail(i)))}function stream_length(i){return is_null(i)?0:1+stream_length(stream_tail(i))}function stream_map(i,s){return is_null(s)?null:pair(i(head(s)),()=>stream_map(i,stream_tail(s)))}function build_stream(i,s){function o(a){return a>=s?null:pair(i(a),()=>o(a+1))}return o(0)}function stream_for_each(i,s){return is_null(s)?!0:(i(head(s)),stream_for_each(i,stream_tail(s)))}function stream_reverse(i){function s(o,a){return is_null(o)?a:s(stream_tail(o),pair(head(o),()=>a))}return s(i,null)}function stream_append(i,s){return is_null(i)?s:pair(head(i),()=>stream_append(stream_tail(i),s))}function stream_member(i,s){return is_null(s)?null:head(s)===i?s:stream_member(i,stream_tail(s))}function stream_remove(i,s){return is_null(s)?null:i===head(s)?stream_tail(s):pair(head(s),()=>stream_remove(i,stream_tail(s)))}function stream_remove_all(i,s){return is_null(s)?null:i===head(s)?stream_remove_all(i,stream_tail(s)):pair(head(s),()=>stream_remove_all(i,stream_tail(s)))}function stream_filter(i,s){return is_null(s)?null:i(head(s))?pair(head(s),()=>stream_filter(i,stream_tail(s))):stream_filter(i,stream_tail(s))}function enum_stream(i,s){return i>s?null:pair(i,()=>enum_stream(i+1,s))}function integers_from(i){return pair(i,()=>integers_from(i+1))}function eval_stream(i,s){function o(a,rt){return rt===1?list(head(a)):pair(head(a),o(stream_tail(a),rt-1))}return s===0?null:o(i,s)}function stream_ref(i,s){return s===0?head(i):stream_ref(stream_tail(i),s-1)}sicp.equal=equal;sicp.$length=$length;sicp.length=length;sicp.$map=$map;var map_1=sicp.map=map;sicp.$build_list=$build_list;sicp.build_list=build_list;sicp.for_each=for_each;sicp.$list_to_string=$list_to_string;sicp.list_to_string=list_to_string;sicp.$reverse=$reverse;sicp.reverse=reverse;sicp.$append=$append;sicp.append=append;sicp.member=member;sicp.$remove=$remove;sicp.remove=remove;sicp.$remove_all=$remove_all;sicp.remove_all=remove_all;sicp.$filter=$filter;sicp.filter=filter;sicp.$enum_list=$enum_list;sicp.enum_list=enum_list;sicp.list_ref=list_ref;sicp.$accumulate=$accumulate;sicp.accumulate=accumulate;sicp.is_stream=is_stream;sicp.list_to_stream=list_to_stream;sicp.stream_to_list=stream_to_list;sicp.stream_length=stream_length;sicp.stream_map=stream_map;sicp.build_stream=build_stream;sicp.stream_for_each=stream_for_each;sicp.stream_reverse=stream_reverse;sicp.stream_append=stream_append;sicp.stream_member=stream_member;sicp.stream_remove=stream_remove;sicp.stream_remove_all=stream_remove_all;sicp.stream_filter=stream_filter;sicp.enum_stream=enum_stream;sicp.integers_from=integers_from;sicp.eval_stream=eval_stream;sicp.stream_ref=stream_ref;sicp.get_time=dict.get("get_time");sicp.display=dict.get("display");sicp.raw_display=dict.get("raw_display");sicp.stringify=dict.get("stringify");var error_1=sicp.error=dict.get("error");sicp.prompt=dict.get("prompt");sicp.is_number=dict.get("is_number");sicp.is_string=dict.get("is_string");sicp.is_function=dict.get("is_function");sicp.is_boolean=dict.get("is_boolean");sicp.is_undefined=dict.get("is_undefined");sicp.parse_int=dict.get("parse_int");sicp.char_at=dict.get("char_at");sicp.arity=dict.get("arity");sicp.math_abs=dict.get("math_abs");sicp.math_acos=dict.get("math_acos");sicp.math_acosh=dict.get("math_acosh");sicp.math_asin=dict.get("math_asin");sicp.math_asinh=dict.get("math_asinh");sicp.math_atan=dict.get("math_atan");sicp.math_atanh=dict.get("math_atanh");sicp.math_atan2=dict.get("math_atan2");sicp.math_ceil=dict.get("math_ceil");sicp.math_cbrt=dict.get("math_cbrt");sicp.math_expm1=dict.get("math_expm1");sicp.math_clz32=dict.get("math_clz32");sicp.math_cos=dict.get("math_cos");sicp.math_cosh=dict.get("math_cosh");sicp.math_exp=dict.get("math_exp");sicp.math_floor=dict.get("math_floor");sicp.math_fround=dict.get("math_fround");sicp.math_hypot=dict.get("math_hypot");sicp.math_imul=dict.get("math_imul");sicp.math_log=dict.get("math_log");sicp.math_log1p=dict.get("math_log1p");sicp.math_log2=dict.get("math_log2");sicp.math_log10=dict.get("math_log10");sicp.math_max=dict.get("math_max");sicp.math_min=dict.get("math_min");sicp.math_pow=dict.get("math_pow");sicp.math_random=dict.get("math_random");sicp.math_round=dict.get("math_round");sicp.math_sign=dict.get("math_sign");sicp.math_sin=dict.get("math_sin");sicp.math_sinh=dict.get("math_sinh");sicp.math_sqrt=dict.get("math_sqrt");sicp.math_tan=dict.get("math_tan");sicp.math_tanh=dict.get("math_tanh");sicp.math_trunc=dict.get("math_trunc");sicp.math_E=dict.get("math_E");sicp.math_LN10=dict.get("math_LN10");sicp.math_LN2=dict.get("math_LN2");sicp.math_LOG10E=dict.get("math_LOG10E");sicp.math_LOG2E=dict.get("math_LOG2E");sicp.math_PI=dict.get("math_PI");sicp.math_SQRT1_2=dict.get("math_SQRT1_2");sicp.math_SQRT2=dict.get("math_SQRT2");sicp.pair=dict.get("pair");sicp.is_pair=dict.get("is_pair");var head_1=sicp.head=dict.get("head"),tail_1=sicp.tail=dict.get("tail"),is_null_1=sicp.is_null=dict.get("is_null");sicp.list=dict.get("list");sicp.draw_data=dict.get("draw_data");sicp.display_list=dict.get("display_list");sicp.is_list=dict.get("is_list");sicp.set_head=dict.get("set_head");sicp.set_tail=dict.get("set_tail");sicp.array_length=dict.get("array_length");sicp.is_array=dict.get("is_array");sicp.stream_tail=dict.get("stream_tail");sicp.stream=dict.get("stream");var parse_1=sicp.parse=dict.get("parse");sicp.tokenize=dict.get("tokenize");sicp.apply_in_underlying_javascript=dict.get("apply_in_underlying_javascript");function list_to_array(i){return is_null_1(i)?[]:[head_1(i)].concat(list_to_array(tail_1(i)))}function parameters(i){return map_1(s=>head_1(s)==="rest_element"?{tag:"rest",sym:head_1(tail_1(head_1(tail_1(s))))}:head_1(tail_1(s)),i)}function objectify(i){switch(head_1(i)){case"literal":return{tag:"lit",val:head_1(tail_1(i))};case"name":return{tag:"nam",sym:head_1(tail_1(i))};case"application":return{tag:"app",fun:objectify(head_1(tail_1(i))),args:list_to_array(map_1(objectify,head_1(tail_1(tail_1(i)))))};case"logical_composition":return{tag:"log",sym:head_1(tail_1(i)),frst:objectify(head_1(tail_1(tail_1(i)))),scnd:objectify(head_1(tail_1(tail_1(tail_1(i)))))};case"binary_operator_combination":return{tag:"binop",sym:head_1(tail_1(i)),frst:objectify(head_1(tail_1(tail_1(i)))),scnd:objectify(head_1(tail_1(tail_1(tail_1(i)))))};case"object_access":return{tag:"arr_acc",arr:objectify(head_1(tail_1(i))),ind:objectify(head_1(tail_1(tail_1(i))))};case"object_assignment":return{tag:"arr_assmt",arr:objectify(head_1(tail_1(head_1(tail_1(i))))),ind:objectify(head_1(tail_1(tail_1(head_1(tail_1(i)))))),expr:objectify(head_1(tail_1(tail_1(i))))};case"array_expression":return{tag:"arr_lit",elems:list_to_array(map_1(objectify,head_1(tail_1(i))))};case"unary_operator_combination":return{tag:"unop",sym:head_1(tail_1(i)),frst:objectify(head_1(tail_1(tail_1(i))))};case"lambda_expression":return{tag:"lam",prms:list_to_array(parameters(head_1(tail_1(i)))),body:objectify(head_1(tail_1(tail_1(i))))};case"sequence":return{tag:"seq",stmts:list_to_array(map_1(objectify,head_1(tail_1(i))))};case"block":return{tag:"blk",body:objectify(head_1(tail_1(i)))};case"variable_declaration":return{tag:"let",sym:head_1(tail_1(head_1(tail_1(i)))),expr:objectify(head_1(tail_1(tail_1(i))))};case"constant_declaration":return{tag:"const",sym:head_1(tail_1(head_1(tail_1(i)))),expr:objectify(head_1(tail_1(tail_1(i))))};case"assignment":return{tag:"assmt",sym:head_1(tail_1(head_1(tail_1(i)))),expr:objectify(head_1(tail_1(tail_1(i))))};case"conditional_statement":return{tag:"cond_stmt",pred:objectify(head_1(tail_1(i))),cons:objectify(head_1(tail_1(tail_1(i)))),alt:objectify(head_1(tail_1(tail_1(tail_1(i)))))};case"while_loop":return{tag:"while",pred:objectify(head_1(tail_1(i))),body:objectify(head_1(tail_1(tail_1(i))))};case"for_loop":return{tag:"for",init:objectify(head_1(tail_1(i))),pred:objectify(head_1(tail_1(tail_1(i)))),upd:objectify(head_1(tail_1(tail_1(tail_1(i))))),body:objectify(head_1(tail_1(tail_1(tail_1(tail_1(i))))))};case"break_statement":return{tag:"break"};case"continue_statement":return{tag:"cont"};case"conditional_expression":return{tag:"cond_expr",pred:objectify(head_1(tail_1(i))),cons:objectify(head_1(tail_1(tail_1(i)))),alt:objectify(head_1(tail_1(tail_1(tail_1(i)))))};case"function_declaration":return{tag:"fun",sym:head_1(tail_1(head_1(tail_1(i)))),prms:list_to_array(parameters(head_1(tail_1(tail_1(i))))),body:objectify(head_1(tail_1(tail_1(tail_1(i)))))};case"return_statement":return{tag:"ret",expr:objectify(head_1(tail_1(i)))};case"import_declaration":return{tag:"import",syms:map_1(s=>head_1(tail_1(s)),head_1(tail_1(i))),from:head_1(tail_1(tail_1(i)))};case"this_expression":return{tag:"this"};case"spread_element":return{tag:"spread",sym:head_1(tail_1(head_1(tail_1(i))))};case"property":return{tag:"prop",sym:head_1(tail_1(i))};default:throw error_1(i,"unknown syntax:")}}function parse_into_json(i){const s=objectify(parse_1(i));return JSON.stringify(s)}function parseIntoJsonChunks(i){const s=objectify(parse_1(i));return convertToJsonChunks(s)}function convertToJsonChunks(i,s=1500){if(JSON.stringify(i).length<=s)return[JSON.stringify(i)];switch(i.tag){case"app":case"arr_acc":case"arr_assmt":case"arr_lit":case"assmt":case"binop":case"blk":case"break":case"cond_expr":case"cond_stmt":case"const":case"cont":case"for":case"fun":case"import":case"lam":case"let":case"lit":case"log":case"nam":case"prop":case"ret":return[JSON.stringify(i)];case"seq":const o=[];let a=0;for(const ot of i.stmts){if(a+=JSON.stringify(ot).length,a>s&&o.length>1)break;o.push(ot)}const rt=i.stmts.slice(o.length);return o.push({tag:"pause_for_input"}),[JSON.stringify({tag:"seq",stmts:o})].concat(convertToJsonChunks({tag:"seq",stmts:rt}));case"spread":case"this":case"unop":case"while":case"pause_for_input":return[JSON.stringify(i)]}}const readUntilPrompt=async(i,s=0,o=()=>{})=>{const a=i.readable.getReader(),rt=s&&setTimeout(()=>{throw a.releaseLock(),i.close(),new Error("Timed Out.")},s);let et="";for(;;){const{value:ot,done:at}=await a.read(),nt=new TextDecoder().decode(ot);et+=nt;const it=et.split(` -`);for(const j of it.slice(0,it.length))o(j);if(et=it[it.length-1],et.substring(0,4)==">>> "||at)return s&&clearTimeout(rt),o(et),a.releaseLock(),at}},writeLines=async(i,...s)=>{const o=i.writable.getWriter();for(const a of s){const rt=new TextEncoder().encode(a+` -`),et=100;for(let ot=0;ot{let s=i.trim();const o=[">>>",">OK",">"];for(const rt of o)s.startsWith(rt)&&(s=s.substring(rt.length).trim());const a="raw REPL; CTRL-B to exit";if(s.startsWith(a)&&(s=s.substring(a.length).trim()),!!s)return s},runProgram=async(i,s)=>{console.log("Sending program chunk..."),await writeLines(i,RAW_MODE_ENTER,s,RAW_MODE_COMPILE,RAW_MODE_EXIT),await readUntilPrompt(i,0,o=>{const a=processRawOutput(o);a&&console.log(a)}),console.log("Sending chunk complete...")},sleep=i=>new Promise(s=>setTimeout(s,i)),cleanProgram=i=>i.replaceAll(/(^#|\s#) ?.*$/gm,"").replaceAll(/\n\n\n+/gm,` +}`;Wt.toString=()=>Ht,(0,lt.makeWrapper)(Bt.func,Wt),(0,i.defineSymbol)(Mt,zt,new ut(Wt,Bt.evaluateArgs))}else(0,i.defineSymbol)(Mt,Dt,Bt)}i.defineBuiltin=Et;const kt=(Mt,Dt)=>{(0,i.ensureGlobalEnvironmentExist)(Mt),Dt.forEach(Bt=>{(0,i.defineSymbol)(Mt,Bt,s.GLOBAL[Bt])})};i.importExternalSymbols=kt;const Tt=(Mt,Dt)=>{(0,i.ensureGlobalEnvironmentExist)(Mt);const Bt=(qt,...hr)=>Dt.rawDisplay(qt,hr[0],Mt.externalContext),Kt=(qt,...hr)=>{if(hr.length===1&&hr[0]!==void 0&&typeof hr[0]!="string")throw new TypeError("display expects the second argument to be a string");return Bt((0,ht.stringify)(qt),hr[0]),qt},Wt=(qt,...hr)=>{if(hr.length===1&&hr[0]!==void 0&&typeof hr[0]!="string")throw new TypeError("display_list expects the second argument to be a string");return tt.rawDisplayList(Kt,qt,hr[0])},zt=qt=>{const hr=Date.now(),fr=Dt.prompt(qt,"",Mt.externalContext);return Mt.nativeStorage.maxExecTime+=Date.now()-hr,fr},Ht=qt=>{const hr=Date.now();Dt.alert(qt,"",Mt.externalContext),Mt.nativeStorage.maxExecTime+=Date.now()-hr},Zt=(...qt)=>(Dt.visualiseList(qt,Mt.externalContext),qt[0]);if(Mt.chapter>=1){Et(Mt,"get_time()",nt.get_time),Et(Mt,"display(val, prepend = undefined)",Kt,1),Et(Mt,"raw_display(str, prepend = undefined)",Bt,1),Et(Mt,"stringify(val, indent = 2, maxLineLength = 80)",ht.stringify,1),Et(Mt,"error(str, prepend = undefined)",nt.error_message,1),Et(Mt,"prompt(str)",zt),Et(Mt,"is_number(val)",nt.is_number),Et(Mt,"is_string(val)",nt.is_string),Et(Mt,"is_function(val)",nt.is_function),Et(Mt,"is_boolean(val)",nt.is_boolean),Et(Mt,"is_undefined(val)",nt.is_undefined),Et(Mt,"parse_int(str, radix)",nt.parse_int),Et(Mt,"char_at(str, index)",nt.char_at),Et(Mt,"arity(f)",nt.arity),Et(Mt,"undefined",void 0),Et(Mt,"NaN",NaN),Et(Mt,"Infinity",1/0);const qt=Object.getOwnPropertyNames(Math),hr=[..."abcdefghijklmnopqrstuvwxyz"];for(const fr of qt){const mr=Math[fr];if(typeof mr=="function"){let gr,tr;fr==="max"||fr==="min"?(gr="...values",tr=0):gr=hr.slice(0,mr.length).join(", "),Et(Mt,`math_${fr}(${gr})`,mr,tr)}else Et(Mt,`math_${fr}`,mr)}}Mt.chapter>=2&&(Mt.variant===st.Variant.LAZY?(Et(Mt,"pair(left, right)",new ut(tt.pair,!1)),Et(Mt,"list(...values)",new ut(tt.list,!1),0),Et(Mt,"is_pair(val)",new ut(tt.is_pair,!0)),Et(Mt,"head(xs)",new ut(tt.head,!0)),Et(Mt,"tail(xs)",new ut(tt.tail,!0)),Et(Mt,"is_null(val)",new ut(tt.is_null,!0)),Et(Mt,"draw_data(...xs)",new ut(Zt,!0),1),Et(Mt,"is_list(val)",new ut(tt.is_list,!0))):(Et(Mt,"pair(left, right)",tt.pair),Et(Mt,"is_pair(val)",tt.is_pair),Et(Mt,"head(xs)",tt.head),Et(Mt,"tail(xs)",tt.tail),Et(Mt,"is_null(val)",tt.is_null),Et(Mt,"list(...values)",tt.list,0),Et(Mt,"draw_data(...xs)",Zt,1),Et(Mt,"display_list(val, prepend = undefined)",Wt,0),Et(Mt,"is_list(val)",tt.is_list))),Mt.chapter>=3&&(Et(Mt,"set_head(xs, val)",tt.set_head),Et(Mt,"set_tail(xs, val)",tt.set_tail),Et(Mt,"array_length(arr)",nt.array_length),Et(Mt,"is_array(val)",nt.is_array),Et(Mt,"stream_tail(stream)",_.stream_tail),Et(Mt,"stream(...values)",_.stream,0)),Mt.chapter>=4&&(Et(Mt,"parse(program_string)",qt=>j.parse(qt,Ot(Mt.chapter))),Et(Mt,"tokenize(program_string)",qt=>j.tokenize(qt,Ot(Mt.chapter))),Et(Mt,"apply_in_underlying_javascript(fun, args)",(qt,hr)=>qt.apply(qt,(0,ot.list_to_vector)(hr))),Mt.variant===st.Variant.GPU&&(Et(Mt,"__clearKernelCache()",o.__clearKernelCache),Et(Mt,"__createKernelSource(shape, extern, localNames, output, fun, kernelId)",o.__createKernelSource))),Mt.chapter===st.Chapter.LIBRARY_PARSER&&(Et(Mt,"is_object(val)",nt.is_object),Et(Mt,"is_NaN(val)",nt.is_NaN),Et(Mt,"has_own_property(obj, prop)",nt.has_own_property),Et(Mt,"alert(val)",Ht),Et(Mt,"timed(fun)",qt=>nt.timed(Mt,qt,Mt.externalContext,Dt.rawDisplay))),Mt.variant===st.Variant.LAZY&&(Et(Mt,"wrapLazyCallee(f)",new ut(ct.wrapLazyCallee,!0)),Et(Mt,"makeLazyFunction(f)",new ut(ct.makeLazyFunction,!0)),Et(Mt,"forceIt(val)",new ut(ct.forceIt,!0)),Et(Mt,"delayIt(xs)",new ut(ct.delayIt,!0)))};i.importBuiltins=Tt;function $t(Mt){let Dt="";Mt.chapter>=2&&(Dt+=Mt.variant===st.Variant.LAZY?rt.lazyListPrelude:at.listPrelude),Mt.chapter>=3&&(Dt+=$.streamPrelude),Mt.variant===st.Variant.NON_DET&&(Dt+=it.nonDetPrelude),Dt!==""&&(Mt.prelude=Dt)}const It={rawDisplay:nt.rawDisplay,prompt:nt.rawDisplay,alert:nt.rawDisplay,visualiseList:Mt=>{throw new Error("List visualizer is not enabled")}},Ot=(Mt=st.Chapter.SOURCE_1,Dt=st.Variant.DEFAULT,Bt=[],Kt,Wt=It)=>{if(Mt===st.Chapter.FULL_JS)return Object.assign(Object.assign({},Ot(st.Chapter.SOURCE_4,Dt,Bt,Kt,Wt)),{chapter:st.Chapter.FULL_JS});const zt=(0,i.createEmptyContext)(Mt,Dt,Bt,Kt);return(0,i.importBuiltins)(zt,Wt),$t(zt),(0,i.importExternalSymbols)(zt,Bt),zt};i.default=Ot}(createContext)),createContext}Object.defineProperty(sicp,"__esModule",{value:!0});const createContext_1=requireCreateContext(),dict=createContext_1.default(4).nativeStorage.builtins;dict.get("get_time");dict.get("display");dict.get("raw_display");const stringify=dict.get("stringify");dict.get("error");dict.get("prompt");const is_number=dict.get("is_number"),is_string=dict.get("is_string"),is_function=dict.get("is_function"),is_boolean=dict.get("is_boolean"),is_undefined=dict.get("is_undefined");dict.get("parse_int");dict.get("char_at");const arity=dict.get("arity");dict.get("math_abs");dict.get("math_acos");dict.get("math_acosh");dict.get("math_asin");dict.get("math_asinh");dict.get("math_atan");dict.get("math_atanh");dict.get("math_atan2");dict.get("math_ceil");dict.get("math_cbrt");dict.get("math_expm1");dict.get("math_clz32");dict.get("math_cos");dict.get("math_cosh");dict.get("math_exp");dict.get("math_floor");dict.get("math_fround");dict.get("math_hypot");dict.get("math_imul");dict.get("math_log");dict.get("math_log1p");dict.get("math_log2");dict.get("math_log10");dict.get("math_max");dict.get("math_min");dict.get("math_pow");dict.get("math_random");dict.get("math_round");dict.get("math_sign");dict.get("math_sin");dict.get("math_sinh");dict.get("math_sqrt");dict.get("math_tan");dict.get("math_tanh");dict.get("math_trunc");dict.get("math_E");dict.get("math_LN10");dict.get("math_LN2");dict.get("math_LOG10E");dict.get("math_LOG2E");dict.get("math_PI");dict.get("math_SQRT1_2");dict.get("math_SQRT2");const pair=dict.get("pair"),is_pair=dict.get("is_pair"),head=dict.get("head"),tail=dict.get("tail"),is_null=dict.get("is_null"),list=dict.get("list");dict.get("draw_data");dict.get("display_list");dict.get("is_list");dict.get("set_head");dict.get("set_tail");dict.get("array_length");dict.get("is_array");const stream_tail=dict.get("stream_tail");dict.get("stream");dict.get("parse");dict.get("tokenize");dict.get("apply_in_underlying_javascript");function equal(i,s){return is_pair(i)?is_pair(s)&&equal(head(i),head(s))&&equal(tail(i),tail(s)):is_null(i)?is_null(s):is_number(i)?is_number(s)&&i===s:is_boolean(i)?is_boolean(s)&&(i&&s||!i&&!s):is_string(i)?is_string(s)&&i===s:is_undefined(i)?is_undefined(s):is_function(i)?is_function(s)&&i===s:!1}function $length(i,s){return is_null(i)?s:$length(tail(i),s+1)}function length(i){return $length(i,0)}function $map(i,s,o){return is_null(s)?reverse(o):$map(i,tail(s),pair(i(head(s)),o))}function map(i,s){return $map(i,s,null)}function $build_list(i,s,o){return i<0?o:$build_list(i-1,s,pair(s(i),o))}function build_list(i,s){return $build_list(s-1,i,null)}function for_each(i,s){return is_null(s)?!0:(i(head(s)),for_each(i,tail(s)))}function $list_to_string(i,s){return is_null(i)?s("null"):is_pair(i)?$list_to_string(head(i),o=>$list_to_string(tail(i),a=>s("["+o+","+a+"]"))):s(stringify(i))}function list_to_string(i){return $list_to_string(i,s=>s)}function $reverse(i,s){return is_null(i)?s:$reverse(tail(i),pair(head(i),s))}function reverse(i){return $reverse(i,null)}function $append(i,s,o){return is_null(i)?o(s):$append(tail(i),s,a=>o(pair(head(i),a)))}function append(i,s){return $append(i,s,o=>o)}function member(i,s){return is_null(s)?null:i===head(s)?s:member(i,tail(s))}function $remove(i,s,o){const a=append,rt=reverse;return is_null(s)?a(rt(o),s):i===head(s)?a(rt(o),tail(s)):$remove(i,tail(s),pair(head(s),o))}function remove(i,s){return $remove(i,s,null)}function $remove_all(i,s,o){const a=append,rt=reverse;return is_null(s)?a(rt(o),s):i===head(s)?$remove_all(i,tail(s),o):$remove_all(i,tail(s),pair(head(s),o))}function remove_all(i,s){return $remove_all(i,s,null)}function $filter(i,s,o){return is_null(s)?reverse(o):i(head(s))?$filter(i,tail(s),pair(head(s),o)):$filter(i,tail(s),o)}function filter(i,s){return $filter(i,s,null)}function $enum_list(i,s,o){const a=reverse;return i>s?a(o):$enum_list(i+1,s,pair(i,o))}function enum_list(i,s){return $enum_list(i,s,null)}function list_ref(i,s){return s===0?head(i):list_ref(tail(i),s-1)}function $accumulate(i,s,o,a){return is_null(o)?a(s):$accumulate(i,s,tail(o),rt=>a(i(head(o),rt)))}function accumulate(i,s,o){return $accumulate(i,s,o,a=>a)}function is_stream(i){return is_null(i)||is_pair(i)&&is_function(tail(i))&&arity(tail(i))===0&&is_stream(stream_tail(i))}function list_to_stream(i){return is_null(i)?null:pair(head(i),()=>list_to_stream(tail(i)))}function stream_to_list(i){return is_null(i)?null:pair(head(i),stream_to_list(stream_tail(i)))}function stream_length(i){return is_null(i)?0:1+stream_length(stream_tail(i))}function stream_map(i,s){return is_null(s)?null:pair(i(head(s)),()=>stream_map(i,stream_tail(s)))}function build_stream(i,s){function o(a){return a>=s?null:pair(i(a),()=>o(a+1))}return o(0)}function stream_for_each(i,s){return is_null(s)?!0:(i(head(s)),stream_for_each(i,stream_tail(s)))}function stream_reverse(i){function s(o,a){return is_null(o)?a:s(stream_tail(o),pair(head(o),()=>a))}return s(i,null)}function stream_append(i,s){return is_null(i)?s:pair(head(i),()=>stream_append(stream_tail(i),s))}function stream_member(i,s){return is_null(s)?null:head(s)===i?s:stream_member(i,stream_tail(s))}function stream_remove(i,s){return is_null(s)?null:i===head(s)?stream_tail(s):pair(head(s),()=>stream_remove(i,stream_tail(s)))}function stream_remove_all(i,s){return is_null(s)?null:i===head(s)?stream_remove_all(i,stream_tail(s)):pair(head(s),()=>stream_remove_all(i,stream_tail(s)))}function stream_filter(i,s){return is_null(s)?null:i(head(s))?pair(head(s),()=>stream_filter(i,stream_tail(s))):stream_filter(i,stream_tail(s))}function enum_stream(i,s){return i>s?null:pair(i,()=>enum_stream(i+1,s))}function integers_from(i){return pair(i,()=>integers_from(i+1))}function eval_stream(i,s){function o(a,rt){return rt===1?list(head(a)):pair(head(a),o(stream_tail(a),rt-1))}return s===0?null:o(i,s)}function stream_ref(i,s){return s===0?head(i):stream_ref(stream_tail(i),s-1)}sicp.equal=equal;sicp.$length=$length;sicp.length=length;sicp.$map=$map;var map_1=sicp.map=map;sicp.$build_list=$build_list;sicp.build_list=build_list;sicp.for_each=for_each;sicp.$list_to_string=$list_to_string;sicp.list_to_string=list_to_string;sicp.$reverse=$reverse;sicp.reverse=reverse;sicp.$append=$append;sicp.append=append;sicp.member=member;sicp.$remove=$remove;sicp.remove=remove;sicp.$remove_all=$remove_all;sicp.remove_all=remove_all;sicp.$filter=$filter;sicp.filter=filter;sicp.$enum_list=$enum_list;sicp.enum_list=enum_list;sicp.list_ref=list_ref;sicp.$accumulate=$accumulate;sicp.accumulate=accumulate;sicp.is_stream=is_stream;sicp.list_to_stream=list_to_stream;sicp.stream_to_list=stream_to_list;sicp.stream_length=stream_length;sicp.stream_map=stream_map;sicp.build_stream=build_stream;sicp.stream_for_each=stream_for_each;sicp.stream_reverse=stream_reverse;sicp.stream_append=stream_append;sicp.stream_member=stream_member;sicp.stream_remove=stream_remove;sicp.stream_remove_all=stream_remove_all;sicp.stream_filter=stream_filter;sicp.enum_stream=enum_stream;sicp.integers_from=integers_from;sicp.eval_stream=eval_stream;sicp.stream_ref=stream_ref;sicp.get_time=dict.get("get_time");sicp.display=dict.get("display");sicp.raw_display=dict.get("raw_display");sicp.stringify=dict.get("stringify");var error_1=sicp.error=dict.get("error");sicp.prompt=dict.get("prompt");sicp.is_number=dict.get("is_number");sicp.is_string=dict.get("is_string");sicp.is_function=dict.get("is_function");sicp.is_boolean=dict.get("is_boolean");sicp.is_undefined=dict.get("is_undefined");sicp.parse_int=dict.get("parse_int");sicp.char_at=dict.get("char_at");sicp.arity=dict.get("arity");sicp.math_abs=dict.get("math_abs");sicp.math_acos=dict.get("math_acos");sicp.math_acosh=dict.get("math_acosh");sicp.math_asin=dict.get("math_asin");sicp.math_asinh=dict.get("math_asinh");sicp.math_atan=dict.get("math_atan");sicp.math_atanh=dict.get("math_atanh");sicp.math_atan2=dict.get("math_atan2");sicp.math_ceil=dict.get("math_ceil");sicp.math_cbrt=dict.get("math_cbrt");sicp.math_expm1=dict.get("math_expm1");sicp.math_clz32=dict.get("math_clz32");sicp.math_cos=dict.get("math_cos");sicp.math_cosh=dict.get("math_cosh");sicp.math_exp=dict.get("math_exp");sicp.math_floor=dict.get("math_floor");sicp.math_fround=dict.get("math_fround");sicp.math_hypot=dict.get("math_hypot");sicp.math_imul=dict.get("math_imul");sicp.math_log=dict.get("math_log");sicp.math_log1p=dict.get("math_log1p");sicp.math_log2=dict.get("math_log2");sicp.math_log10=dict.get("math_log10");sicp.math_max=dict.get("math_max");sicp.math_min=dict.get("math_min");sicp.math_pow=dict.get("math_pow");sicp.math_random=dict.get("math_random");sicp.math_round=dict.get("math_round");sicp.math_sign=dict.get("math_sign");sicp.math_sin=dict.get("math_sin");sicp.math_sinh=dict.get("math_sinh");sicp.math_sqrt=dict.get("math_sqrt");sicp.math_tan=dict.get("math_tan");sicp.math_tanh=dict.get("math_tanh");sicp.math_trunc=dict.get("math_trunc");sicp.math_E=dict.get("math_E");sicp.math_LN10=dict.get("math_LN10");sicp.math_LN2=dict.get("math_LN2");sicp.math_LOG10E=dict.get("math_LOG10E");sicp.math_LOG2E=dict.get("math_LOG2E");sicp.math_PI=dict.get("math_PI");sicp.math_SQRT1_2=dict.get("math_SQRT1_2");sicp.math_SQRT2=dict.get("math_SQRT2");sicp.pair=dict.get("pair");sicp.is_pair=dict.get("is_pair");var head_1=sicp.head=dict.get("head"),tail_1=sicp.tail=dict.get("tail"),is_null_1=sicp.is_null=dict.get("is_null");sicp.list=dict.get("list");sicp.draw_data=dict.get("draw_data");sicp.display_list=dict.get("display_list");sicp.is_list=dict.get("is_list");sicp.set_head=dict.get("set_head");sicp.set_tail=dict.get("set_tail");sicp.array_length=dict.get("array_length");sicp.is_array=dict.get("is_array");sicp.stream_tail=dict.get("stream_tail");sicp.stream=dict.get("stream");var parse_1=sicp.parse=dict.get("parse");sicp.tokenize=dict.get("tokenize");sicp.apply_in_underlying_javascript=dict.get("apply_in_underlying_javascript");function list_to_array(i){return is_null_1(i)?[]:[head_1(i)].concat(list_to_array(tail_1(i)))}function parameters(i){return map_1(s=>head_1(s)==="rest_element"?{tag:"rest",sym:head_1(tail_1(head_1(tail_1(s))))}:head_1(tail_1(s)),i)}function objectify(i){switch(head_1(i)){case"literal":return{tag:"lit",val:head_1(tail_1(i))};case"name":return{tag:"nam",sym:head_1(tail_1(i))};case"application":return{tag:"app",fun:objectify(head_1(tail_1(i))),args:list_to_array(map_1(objectify,head_1(tail_1(tail_1(i)))))};case"logical_composition":return{tag:"log",sym:head_1(tail_1(i)),frst:objectify(head_1(tail_1(tail_1(i)))),scnd:objectify(head_1(tail_1(tail_1(tail_1(i)))))};case"binary_operator_combination":return{tag:"binop",sym:head_1(tail_1(i)),frst:objectify(head_1(tail_1(tail_1(i)))),scnd:objectify(head_1(tail_1(tail_1(tail_1(i)))))};case"object_access":return{tag:"arr_acc",arr:objectify(head_1(tail_1(i))),ind:objectify(head_1(tail_1(tail_1(i))))};case"object_assignment":return{tag:"arr_assmt",arr:objectify(head_1(tail_1(head_1(tail_1(i))))),ind:objectify(head_1(tail_1(tail_1(head_1(tail_1(i)))))),expr:objectify(head_1(tail_1(tail_1(i))))};case"array_expression":return{tag:"arr_lit",elems:list_to_array(map_1(objectify,head_1(tail_1(i))))};case"unary_operator_combination":return{tag:"unop",sym:head_1(tail_1(i)),frst:objectify(head_1(tail_1(tail_1(i))))};case"lambda_expression":return{tag:"lam",prms:list_to_array(parameters(head_1(tail_1(i)))),body:objectify(head_1(tail_1(tail_1(i))))};case"sequence":return{tag:"seq",stmts:list_to_array(map_1(objectify,head_1(tail_1(i))))};case"block":return{tag:"blk",body:objectify(head_1(tail_1(i)))};case"variable_declaration":return{tag:"let",sym:head_1(tail_1(head_1(tail_1(i)))),expr:objectify(head_1(tail_1(tail_1(i))))};case"constant_declaration":return{tag:"const",sym:head_1(tail_1(head_1(tail_1(i)))),expr:objectify(head_1(tail_1(tail_1(i))))};case"assignment":return{tag:"assmt",sym:head_1(tail_1(head_1(tail_1(i)))),expr:objectify(head_1(tail_1(tail_1(i))))};case"conditional_statement":return{tag:"cond_stmt",pred:objectify(head_1(tail_1(i))),cons:objectify(head_1(tail_1(tail_1(i)))),alt:objectify(head_1(tail_1(tail_1(tail_1(i)))))};case"while_loop":return{tag:"while",pred:objectify(head_1(tail_1(i))),body:objectify(head_1(tail_1(tail_1(i))))};case"for_loop":return{tag:"for",init:objectify(head_1(tail_1(i))),pred:objectify(head_1(tail_1(tail_1(i)))),upd:objectify(head_1(tail_1(tail_1(tail_1(i))))),body:objectify(head_1(tail_1(tail_1(tail_1(tail_1(i))))))};case"break_statement":return{tag:"break"};case"continue_statement":return{tag:"cont"};case"conditional_expression":return{tag:"cond_expr",pred:objectify(head_1(tail_1(i))),cons:objectify(head_1(tail_1(tail_1(i)))),alt:objectify(head_1(tail_1(tail_1(tail_1(i)))))};case"function_declaration":return{tag:"fun",sym:head_1(tail_1(head_1(tail_1(i)))),prms:list_to_array(parameters(head_1(tail_1(tail_1(i))))),body:objectify(head_1(tail_1(tail_1(tail_1(i)))))};case"return_statement":return{tag:"ret",expr:objectify(head_1(tail_1(i)))};case"import_declaration":return{tag:"import",syms:map_1(s=>head_1(tail_1(s)),head_1(tail_1(i))),from:head_1(tail_1(tail_1(i)))};case"this_expression":return{tag:"this"};case"spread_element":return{tag:"spread",sym:head_1(tail_1(head_1(tail_1(i))))};case"property":return{tag:"prop",sym:head_1(tail_1(i))};default:throw error_1(i,"unknown syntax:")}}function parse_into_json(i){const s=objectify(parse_1(i));return JSON.stringify(s)}function parseIntoJsonChunks(i){const s=objectify(parse_1(i));return convertToJsonChunks(s)}function convertToJsonChunks(i,s=1500){if(JSON.stringify(i).length<=s)return[JSON.stringify(i)];switch(i.tag){case"app":case"arr_acc":case"arr_assmt":case"arr_lit":case"assmt":case"binop":case"blk":case"break":case"cond_expr":case"cond_stmt":case"const":case"cont":case"for":case"fun":case"import":case"lam":case"let":case"lit":case"log":case"nam":case"prop":case"ret":return[JSON.stringify(i)];case"seq":const o=[];let a=0;for(const ot of i.stmts){if(a+=JSON.stringify(ot).length,a>s&&o.length>1)break;o.push(ot)}const rt=i.stmts.slice(o.length);return o.push({tag:"pause_for_input"}),[JSON.stringify({tag:"seq",stmts:o})].concat(convertToJsonChunks({tag:"seq",stmts:rt}));case"spread":case"this":case"unop":case"while":case"pause_for_input":return[JSON.stringify(i)]}}const readUntilPrompt=async(i,s=0,o=()=>{})=>{const a=i.readable.getReader(),rt=s&&setTimeout(()=>{throw a.releaseLock(),i.close(),new Error("Timed Out.")},s);let tt="";for(;;){const{value:ot,done:at}=await a.read(),nt=new TextDecoder().decode(ot);tt+=nt;const it=tt.split(` +`);for(const j of it.slice(0,it.length))o(j);if(tt=it[it.length-1],tt.substring(0,4)==">>> "||at)return s&&clearTimeout(rt),o(tt),a.releaseLock(),at}},writeLines=async(i,...s)=>{const o=i.writable.getWriter();for(const a of s){const rt=new TextEncoder().encode(a+` +`),tt=100;for(let ot=0;ot{let s=i.trim();const o=[">>>",">OK",">"];for(const rt of o)s.startsWith(rt)&&(s=s.substring(rt.length).trim());const a="raw REPL; CTRL-B to exit";if(s.startsWith(a)&&(s=s.substring(a.length).trim()),!!s)return s},runProgram=async(i,s)=>{console.log("Sending program chunk..."),await writeLines(i,RAW_MODE_ENTER,s,RAW_MODE_COMPILE,RAW_MODE_EXIT),await readUntilPrompt(i,0,o=>{const a=processRawOutput(o);a&&console.log(a)}),console.log("Sending chunk complete...")},sleep=i=>new Promise(s=>setTimeout(s,i)),cleanProgram=i=>i.replaceAll(/(^#|\s#) ?.*$/gm,"").replaceAll(/\n\n\n+/gm,` -`),getInterpreterLib=async()=>(await __vitePreload(async()=>{const{default:i}=await import("./index-Bg2lWxxV.js");return{default:i}},[])).default,getSourceThreePrelude=async()=>(await __vitePreload(async()=>{const{sourceThreePrelude:i}=await import("./index-C9Zpxbc1.js");return{sourceThreePrelude:i}},[])).sourceThreePrelude,{setCurrentLanguage,setEditorValue,resetEditorValues}=WorkspaceActions,EditorPage=()=>{const[i,s]=reactExports.useState(""),o=useTypedDispatch(),a=useTypedSelector(lt=>lt.workspace.currentLanguage),rt=reactExports.useCallback(lt=>o(setCurrentLanguage(lt)),[o]),et=useTypedSelector(lt=>lt.workspace.editorValue[a]),ot=reactExports.useCallback(lt=>o(setEditorValue(lt)),[o]),[at,nt]=reactExports.useState(!1),[it,j]=reactExports.useState(),[_,$]=reactExports.useState();reactExports.useEffect(()=>{it||at&&getSourceThreePrelude().then(j)},[at]),reactExports.useEffect(()=>{_||a===Languages.SOURCE_THREE_INTERPRETER&&getInterpreterLib().then($)},[a]);const tt=async()=>{if(a===Languages.SOURCE_THREE_INTERPRETER)try{parse_into_json(et),s("")}catch(ct){s("[ERROR] "+ct);return}const lt=await navigator.serial.requestPort();switch(await lt.open({baudRate:BAUD_RATE_SPIKE_PRIME}),await writeLines(lt,KEYBOARD_INTERRUPT),await readUntilPrompt(lt,2e3),a){case Languages.PYTHON:await runProgram(lt,cleanProgram(et));break;case Languages.SOURCE_THREE_INTERPRETER:if(!_)throw new Error("Interpreter not loaded");if(await runProgram(lt,cleanProgram(_.prefix)),await runProgram(lt,cleanProgram(_.prefix2)),await runProgram(lt,cleanProgram(_.spikeMicrocode)),at){if(!it)throw new Error("Preludes not loaded");for(const ut of it){console.log("Sending prelude chunk");const pt=parse_into_json(ut);await writeLines(lt,RAW_MODE_ENTER,"json_prelude = '''\\",...pt.match(/.{1,1000}/g).map(mt=>mt+"\\"),"'''",RAW_MODE_COMPILE,RAW_MODE_EXIT),await readUntilPrompt(lt,0,mt=>{const gt=processRawOutput(mt);gt&&console.log(gt)}),console.log("Sending prelude chunk complete"),await runProgram(lt,cleanProgram(_.evaluatePrelude))}}console.log("Sending JSON program");const ct=parseIntoJsonChunks(et),ht=ct[0];await writeLines(lt,RAW_MODE_ENTER,"json_string = '''\\",...ht.match(/.{1,500}/g).map(ut=>ut+"\\"),"'''",RAW_MODE_COMPILE,RAW_MODE_EXIT),await readUntilPrompt(lt,0,ut=>{const pt=processRawOutput(ut);pt&&console.log(pt)}),console.log("Sending JSON program complete"),await writeLines(lt,RAW_MODE_ENTER,cleanProgram(_.suffix),RAW_MODE_COMPILE,...ct.slice(1).flatMap(ut=>[ut,RAW_MODE_COMPILE]),RAW_MODE_EXIT),await readUntilPrompt(lt,0,ut=>{const pt=processRawOutput(ut);pt&&console.log(pt)});break}await writeLines(lt,END_OF_TRANSMISSION),lt.close()},st=()=>{try{s(parse_into_json(et))}catch(lt){s("[ERROR] "+lt)}};return reactExports.useEffect(()=>{const lt=queryString.parse(location.hash),ct=lzStringExports.decompressFromEncodedURIComponent(lt.prgrm);ct&&(rt(Languages.SOURCE_THREE_INTERPRETER),ot(ct))},[]),reactExports.useEffect(()=>{resetEditorValues(a),s("")},[a,ot]),jsxRuntimeExports.jsx(Box,{className:"App",children:jsxRuntimeExports.jsxs(SimpleGrid,{columns:{sm:1,lg:3},spacingX:{sm:0,lg:8},spacingY:8,children:[jsxRuntimeExports.jsx(GridItem,{colSpan:2,children:jsxRuntimeExports.jsxs(Stack,{children:[jsxRuntimeExports.jsx(Heading,{children:"SEKER: Source–SPIKE Prime Runner"}),jsxRuntimeExports.jsx(UserGuide,{}),a===Languages.SOURCE_THREE_INTERPRETER&&jsxRuntimeExports.jsxs(Text,{fontStyle:"italic",color:"orange.500",children:["Note: Support for ",Languages.SOURCE_THREE_INTERPRETER," Programs is in beta!"]}),i&&jsxRuntimeExports.jsx(JsonDisplay,{jsonProgram:i}),jsxRuntimeExports.jsxs(HStack,{children:[jsxRuntimeExports.jsx(Text,{fontWeight:"bold",children:"Select language mode:"}),jsxRuntimeExports.jsx(LanguageSelector,{}),a===Languages.SOURCE_THREE_INTERPRETER&&jsxRuntimeExports.jsx(Checkbox,{isChecked:at,onChange:()=>nt(lt=>!lt),children:"Prelude"}),jsxRuntimeExports.jsx(Spacer,{}),jsxRuntimeExports.jsxs(ButtonGroup,{size:"sm",children:[jsxRuntimeExports.jsx(Button,{onClick:tt,children:"Run on Device"}),a===Languages.SOURCE_THREE_INTERPRETER&&jsxRuntimeExports.jsx(Button,{onClick:st,children:"Parse into JSON"})]})]}),jsxRuntimeExports.jsx(Box,{borderRadius:6,overflow:"clip",children:jsxRuntimeExports.jsx(Editor,{name:"editor",onChange:ot,value:et,wrapEnabled:!0})})]})}),jsxRuntimeExports.jsx(GridItem,{children:jsxRuntimeExports.jsx(SampleProgramSidebar,{})})]})})},rootReducer=combineReducers({workspace}),store=configureStore({reducer:rootReducer}),App=()=>jsxRuntimeExports.jsx(Provider_default,{store,children:jsxRuntimeExports.jsx(EditorPage,{})}),config={initialColorMode:"system",useSystemColorMode:!0},theme=extendTheme({config,fonts:{heading:"Inter, Avenir, Helvetica, Arial, sans-serif",body:"Inter, Avenir, Helvetica, Arial, sans-serif"}});client.createRoot(document.getElementById("root")).render(jsxRuntimeExports.jsxs(React$4.StrictMode,{children:[jsxRuntimeExports.jsx(ColorModeScript,{initialColorMode:theme.config.initialColorMode}),jsxRuntimeExports.jsx(ChakraProvider,{theme,children:jsxRuntimeExports.jsx(App,{})})]})); +`),getInterpreterLib=async()=>(await __vitePreload(async()=>{const{default:i}=await import("./index-Bg2lWxxV.js");return{default:i}},[])).default,getSourceThreePrelude=async()=>(await __vitePreload(async()=>{const{sourceThreePrelude:i}=await import("./index-C9Zpxbc1.js");return{sourceThreePrelude:i}},[])).sourceThreePrelude,{setCurrentLanguage,setEditorValue,resetEditorValues}=WorkspaceActions,EditorPage=()=>{const[i,s]=reactExports.useState(""),o=useTypedDispatch(),a=useTypedSelector(lt=>lt.workspace.currentLanguage),rt=reactExports.useCallback(lt=>o(setCurrentLanguage(lt)),[o]),tt=useTypedSelector(lt=>lt.workspace.editorValue[a]),ot=reactExports.useCallback(lt=>o(setEditorValue(lt)),[o]),[at,nt]=reactExports.useState(!1),[it,j]=reactExports.useState(),[_,$]=reactExports.useState();reactExports.useEffect(()=>{it||at&&getSourceThreePrelude().then(j)},[at]),reactExports.useEffect(()=>{_||a===Languages.SOURCE_THREE_INTERPRETER&&getInterpreterLib().then($)},[a]);const et=async()=>{if(a===Languages.SOURCE_THREE_INTERPRETER)try{parse_into_json(tt),s("")}catch(ct){s("[ERROR] "+ct);return}const lt=await navigator.serial.requestPort();switch(await lt.open({baudRate:BAUD_RATE_SPIKE_PRIME}),await writeLines(lt,KEYBOARD_INTERRUPT),await readUntilPrompt(lt,2e3),a){case Languages.PYTHON:await runProgram(lt,cleanProgram(tt));break;case Languages.SOURCE_THREE_INTERPRETER:if(!_)throw new Error("Interpreter not loaded");if(await runProgram(lt,cleanProgram(_.prefix)),await runProgram(lt,cleanProgram(_.prefix2)),await runProgram(lt,cleanProgram(_.spikeMicrocode)),at){if(!it)throw new Error("Preludes not loaded");for(const ut of it){console.log("Sending prelude chunk");const pt=parse_into_json(ut);await writeLines(lt,RAW_MODE_ENTER,"json_prelude = '''\\",...pt.match(/.{1,1000}/g).map(mt=>mt+"\\"),"'''",RAW_MODE_COMPILE,RAW_MODE_EXIT),await readUntilPrompt(lt,0,mt=>{const gt=processRawOutput(mt);gt&&console.log(gt)}),console.log("Sending prelude chunk complete"),await runProgram(lt,cleanProgram(_.evaluatePrelude))}}console.log("Sending JSON program");const ct=parseIntoJsonChunks(tt),ht=ct[0];await writeLines(lt,RAW_MODE_ENTER,"json_string = '''\\",...ht.match(/.{1,500}/g).map(ut=>ut+"\\"),"'''",RAW_MODE_COMPILE,RAW_MODE_EXIT),await readUntilPrompt(lt,0,ut=>{const pt=processRawOutput(ut);pt&&console.log(pt)}),console.log("Sending JSON program complete"),await writeLines(lt,RAW_MODE_ENTER,cleanProgram(_.suffix),RAW_MODE_COMPILE,...ct.slice(1).flatMap(ut=>[ut,RAW_MODE_COMPILE]),RAW_MODE_EXIT),await readUntilPrompt(lt,0,ut=>{const pt=processRawOutput(ut);pt&&console.log(pt)});break}await writeLines(lt,END_OF_TRANSMISSION),lt.close()},st=()=>{try{s(parse_into_json(tt))}catch(lt){s("[ERROR] "+lt)}};return reactExports.useEffect(()=>{const lt=queryString.parse(location.hash),ct=lzStringExports.decompressFromEncodedURIComponent(lt.prgrm);ct&&(rt(Languages.SOURCE_THREE_INTERPRETER),ot(ct))},[]),reactExports.useEffect(()=>{resetEditorValues(a),s("")},[a,ot]),jsxRuntimeExports.jsx(Box,{className:"App",children:jsxRuntimeExports.jsxs(SimpleGrid,{columns:{sm:1,lg:3},spacingX:{sm:0,lg:8},spacingY:8,children:[jsxRuntimeExports.jsx(GridItem,{colSpan:2,children:jsxRuntimeExports.jsxs(Stack,{children:[jsxRuntimeExports.jsx(Heading,{children:"SEKER: Source–SPIKE Prime Runner"}),jsxRuntimeExports.jsx(UserGuide,{}),a===Languages.SOURCE_THREE_INTERPRETER&&jsxRuntimeExports.jsxs(Text,{fontStyle:"italic",color:"orange.500",children:["Note: Support for ",Languages.SOURCE_THREE_INTERPRETER," Programs is in beta!"]}),i&&jsxRuntimeExports.jsx(JsonDisplay,{jsonProgram:i}),jsxRuntimeExports.jsxs(HStack,{children:[jsxRuntimeExports.jsx(Text,{fontWeight:"bold",children:"Select language mode:"}),jsxRuntimeExports.jsx(LanguageSelector,{}),a===Languages.SOURCE_THREE_INTERPRETER&&jsxRuntimeExports.jsx(Checkbox,{isChecked:at,onChange:()=>nt(lt=>!lt),children:"Prelude"}),jsxRuntimeExports.jsx(Spacer,{}),jsxRuntimeExports.jsxs(ButtonGroup,{size:"sm",children:[jsxRuntimeExports.jsx(Button,{onClick:et,children:"Run on Device"}),a===Languages.SOURCE_THREE_INTERPRETER&&jsxRuntimeExports.jsx(Button,{onClick:st,children:"Parse into JSON"})]})]}),jsxRuntimeExports.jsx(Box,{borderRadius:6,overflow:"clip",children:jsxRuntimeExports.jsx(Editor,{name:"editor",onChange:ot,value:tt,wrapEnabled:!0})})]})}),jsxRuntimeExports.jsx(GridItem,{children:jsxRuntimeExports.jsx(SampleProgramSidebar,{})})]})})},rootReducer=combineReducers({workspace}),store=configureStore({reducer:rootReducer}),App=()=>jsxRuntimeExports.jsx(Provider_default,{store,children:jsxRuntimeExports.jsx(EditorPage,{})}),config={initialColorMode:"system",useSystemColorMode:!0},theme=extendTheme({config,fonts:{heading:"Inter, Avenir, Helvetica, Arial, sans-serif",body:"Inter, Avenir, Helvetica, Arial, sans-serif"}});client.createRoot(document.getElementById("root")).render(jsxRuntimeExports.jsxs(React$4.StrictMode,{children:[jsxRuntimeExports.jsx(ColorModeScript,{initialColorMode:theme.config.initialColorMode}),jsxRuntimeExports.jsx(ChakraProvider,{theme,children:jsxRuntimeExports.jsx(App,{})})]})); diff --git a/index.html b/index.html index 3c03a24..f13f418 100644 --- a/index.html +++ b/index.html @@ -9,7 +9,7 @@ /> SEKER: Source-SPIKE Prime Runner - +