@webqit/webflo 0.11.61-0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/.gitignore +7 -7
  2. package/LICENSE +20 -20
  3. package/README.md +2079 -2074
  4. package/docker/Dockerfile +42 -42
  5. package/docker/README.md +91 -91
  6. package/docker/package.json +2 -2
  7. package/package.json +80 -81
  8. package/src/{Context.js → AbstractContext.js} +71 -79
  9. package/src/config-pi/deployment/Env.js +68 -68
  10. package/src/config-pi/deployment/Layout.js +63 -63
  11. package/src/config-pi/deployment/Origins.js +139 -139
  12. package/src/config-pi/deployment/Proxy.js +74 -74
  13. package/src/config-pi/deployment/index.js +17 -17
  14. package/src/config-pi/index.js +15 -15
  15. package/src/config-pi/runtime/Client.js +116 -98
  16. package/src/config-pi/runtime/Server.js +125 -125
  17. package/src/config-pi/runtime/client/Worker.js +109 -134
  18. package/src/config-pi/runtime/client/index.js +11 -11
  19. package/src/config-pi/runtime/index.js +17 -17
  20. package/src/config-pi/runtime/server/Headers.js +74 -74
  21. package/src/config-pi/runtime/server/Redirects.js +69 -69
  22. package/src/config-pi/runtime/server/index.js +13 -13
  23. package/src/config-pi/static/Manifest.js +319 -319
  24. package/src/config-pi/static/Ssg.js +49 -49
  25. package/src/config-pi/static/index.js +13 -13
  26. package/src/deployment-pi/index.js +10 -10
  27. package/src/deployment-pi/origins/index.js +216 -216
  28. package/src/index.js +11 -19
  29. package/src/runtime-pi/HttpEvent.js +126 -106
  30. package/src/runtime-pi/HttpUser.js +126 -0
  31. package/src/runtime-pi/MessagingOverBroadcast.js +9 -0
  32. package/src/runtime-pi/MessagingOverChannel.js +85 -0
  33. package/src/runtime-pi/MessagingOverSocket.js +106 -0
  34. package/src/runtime-pi/MultiportMessagingAPI.js +81 -0
  35. package/src/runtime-pi/WebfloCookieStorage.js +27 -0
  36. package/src/runtime-pi/WebfloEventTarget.js +39 -0
  37. package/src/runtime-pi/WebfloMessageEvent.js +58 -0
  38. package/src/runtime-pi/WebfloMessagingAPI.js +69 -0
  39. package/src/runtime-pi/{Router.js → WebfloRouter.js} +99 -130
  40. package/src/runtime-pi/WebfloRuntime.js +52 -0
  41. package/src/runtime-pi/WebfloStorage.js +109 -0
  42. package/src/runtime-pi/client/ClientMessaging.js +5 -0
  43. package/src/runtime-pi/client/Context.js +3 -7
  44. package/src/runtime-pi/client/CookieStorage.js +17 -0
  45. package/src/runtime-pi/client/Router.js +38 -48
  46. package/src/runtime-pi/client/SessionStorage.js +33 -0
  47. package/src/runtime-pi/client/Url.js +156 -205
  48. package/src/runtime-pi/client/WebfloClient.js +544 -0
  49. package/src/runtime-pi/client/WebfloRootClient1.js +179 -0
  50. package/src/runtime-pi/client/WebfloRootClient2.js +109 -0
  51. package/src/runtime-pi/client/WebfloSubClient.js +165 -0
  52. package/src/runtime-pi/client/Workport.js +118 -178
  53. package/src/runtime-pi/client/generate.js +480 -471
  54. package/src/runtime-pi/client/index.js +16 -21
  55. package/src/runtime-pi/client/worker/ClientMessaging.js +5 -0
  56. package/src/runtime-pi/client/worker/Context.js +3 -7
  57. package/src/runtime-pi/client/worker/CookieStorage.js +17 -0
  58. package/src/runtime-pi/client/worker/SessionStorage.js +13 -0
  59. package/src/runtime-pi/client/worker/WebfloWorker.js +294 -0
  60. package/src/runtime-pi/client/worker/Workport.js +17 -85
  61. package/src/runtime-pi/client/worker/index.js +10 -21
  62. package/src/runtime-pi/index.js +6 -13
  63. package/src/runtime-pi/server/ClientMessaging.js +18 -0
  64. package/src/runtime-pi/server/ClientMessagingRegistry.js +57 -0
  65. package/src/runtime-pi/server/Context.js +11 -15
  66. package/src/runtime-pi/server/CookieStorage.js +17 -0
  67. package/src/runtime-pi/server/Router.js +93 -159
  68. package/src/runtime-pi/server/SessionStorage.js +53 -0
  69. package/src/runtime-pi/server/WebfloServer.js +755 -0
  70. package/src/runtime-pi/server/index.js +10 -21
  71. package/src/runtime-pi/util-http.js +322 -86
  72. package/src/runtime-pi/util-url.js +146 -146
  73. package/src/runtime-pi/xURL.js +108 -105
  74. package/src/runtime-pi/xfetch.js +22 -22
  75. package/src/services-pi/cert/http-auth-hook.js +22 -22
  76. package/src/services-pi/cert/http-cleanup-hook.js +22 -22
  77. package/src/services-pi/cert/index.js +79 -79
  78. package/src/services-pi/index.js +8 -8
  79. package/src/static-pi/index.js +10 -10
  80. package/src/webflo.js +30 -30
  81. package/test/index.test.js +26 -26
  82. package/test/site/package.json +9 -9
  83. package/test/site/public/bundle.html +5 -5
  84. package/test/site/public/bundle.html.json +3 -3
  85. package/test/site/public/bundle.js +2 -2
  86. package/test/site/public/bundle.webflo.js +15 -15
  87. package/test/site/public/index.html +29 -29
  88. package/test/site/public/index1.html +34 -34
  89. package/test/site/public/page-2/bundle.html +4 -4
  90. package/test/site/public/page-2/bundle.js +2 -2
  91. package/test/site/public/page-2/index.html +45 -45
  92. package/test/site/public/page-2/main.html +2 -2
  93. package/test/site/public/page-4/subpage/bundle.js +2 -2
  94. package/test/site/public/page-4/subpage/index.html +30 -30
  95. package/test/site/public/sparoots.json +4 -4
  96. package/test/site/public/worker.js +3 -3
  97. package/test/site/server/index.js +15 -15
  98. package/src/runtime-pi/Application.js +0 -29
  99. package/src/runtime-pi/Cookies.js +0 -82
  100. package/src/runtime-pi/Runtime.js +0 -21
  101. package/src/runtime-pi/client/Application.js +0 -100
  102. package/src/runtime-pi/client/Runtime.js +0 -332
  103. package/src/runtime-pi/client/createStorage.js +0 -57
  104. package/src/runtime-pi/client/oohtml/full.js +0 -7
  105. package/src/runtime-pi/client/oohtml/namespacing.js +0 -7
  106. package/src/runtime-pi/client/oohtml/scripting.js +0 -8
  107. package/src/runtime-pi/client/oohtml/templating.js +0 -8
  108. package/src/runtime-pi/client/worker/Application.js +0 -44
  109. package/src/runtime-pi/client/worker/Runtime.js +0 -269
  110. package/src/runtime-pi/server/Application.js +0 -116
  111. package/src/runtime-pi/server/Runtime.js +0 -557
  112. package/src/runtime-pi/xFormData.js +0 -24
  113. package/src/runtime-pi/xHeaders.js +0 -146
  114. package/src/runtime-pi/xRequest.js +0 -46
  115. package/src/runtime-pi/xRequestHeaders.js +0 -109
  116. package/src/runtime-pi/xResponse.js +0 -33
  117. package/src/runtime-pi/xResponseHeaders.js +0 -117
  118. package/src/runtime-pi/xxHttpMessage.js +0 -102
@@ -1,15 +1,15 @@
1
- /** @webqit/webflo */
2
- var ta=Object.defineProperty;var ra=(e,t)=>()=>(e&&(t=e(e=0)),t);var ts=(e,t)=>{for(var r in t)ta(e,r,{get:t[r],enumerable:!0})};var Mn={};ts(Mn,{URLPattern:()=>Fn});function to(e,t){return(t?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(e)}function Sn(e,t=!1){let r=[],i=0;for(;i<e.length;){let s=e[i],n=function(a){if(!t)throw new TypeError(a);r.push({type:"INVALID_CHAR",index:i,value:e[i++]})};if(s==="*"){r.push({type:"ASTERISK",index:i,value:e[i++]});continue}if(s==="+"||s==="?"){r.push({type:"MODIFIER",index:i,value:e[i++]});continue}if(s==="\\"){r.push({type:"ESCAPED_CHAR",index:i++,value:e[i++]});continue}if(s==="{"){r.push({type:"OPEN",index:i,value:e[i++]});continue}if(s==="}"){r.push({type:"CLOSE",index:i,value:e[i++]});continue}if(s===":"){let a="",o=i+1;for(;o<e.length;){let u=e.substr(o,1);if(o===i+1&&Za.test(u)||o!==i+1&&eo.test(u)){a+=e[o++];continue}break}if(!a){n(`Missing parameter name at ${i}`);continue}r.push({type:"NAME",index:i,value:a}),i=o;continue}if(s==="("){let a=1,o="",u=i+1,l=!1;if(e[u]==="?"){n(`Pattern cannot start with "?" at ${u}`);continue}for(;u<e.length;){if(!to(e[u],!1)){n(`Invalid character '${e[u]}' at ${u}.`),l=!0;break}if(e[u]==="\\"){o+=e[u++]+e[u++];continue}if(e[u]===")"){if(a--,a===0){u++;break}}else if(e[u]==="("&&(a++,e[u+1]!=="?")){n(`Capturing groups are not allowed at ${u}`),l=!0;break}o+=e[u++]}if(l)continue;if(a){n(`Unbalanced pattern at ${i}`);continue}if(!o){n(`Missing pattern at ${i}`);continue}r.push({type:"PATTERN",index:i,value:o}),i=u;continue}r.push({type:"CHAR",index:i,value:e[i++]})}return r.push({type:"END",index:i,value:""}),r}function _n(e,t={}){let r=Sn(e),{prefixes:i="./"}=t,s=`[^${Mt(t.delimiter||"/#?")}]+?`,n=[],a=0,o=0,u="",l=new Set,h=d=>{if(o<r.length&&r[o].type===d)return r[o++].value},f=()=>{let d=h("MODIFIER");return d||h("ASTERISK")},m=d=>{let w=h(d);if(w!==void 0)return w;let{type:v,index:_}=r[o];throw new TypeError(`Unexpected ${v} at ${_}, expected ${d}`)},p=()=>{let d="",w;for(;w=h("CHAR")||h("ESCAPED_CHAR");)d+=w;return d},x=d=>d,b=t.encodePart||x;for(;o<r.length;){let d=h("CHAR"),w=h("NAME"),v=h("PATTERN");if(!w&&!v&&h("ASTERISK")&&(v=".*"),w||v){let F=d||"";i.indexOf(F)===-1&&(u+=F,F=""),u&&(n.push(b(u)),u="");let D=w||a++;if(l.has(D))throw new TypeError(`Duplicate name '${D}'.`);l.add(D),n.push({name:D,prefix:b(F),suffix:"",pattern:v||s,modifier:f()||""});continue}let _=d||h("ESCAPED_CHAR");if(_){u+=_;continue}if(h("OPEN")){let F=p(),D=h("NAME")||"",te=h("PATTERN")||"";!D&&!te&&h("ASTERISK")&&(te=".*");let V=p();m("CLOSE");let j=f()||"";if(!D&&!te&&!j){u+=F;continue}if(!D&&!te&&!F)continue;u&&(n.push(b(u)),u=""),n.push({name:D||(te?a++:""),pattern:D&&!te?s:te,prefix:b(F),suffix:b(V),modifier:j});continue}u&&(n.push(b(u)),u=""),m("END")}return n}function Mt(e){return e.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function En(e){return e&&e.sensitive?"u":"ui"}function ro(e,t){if(!t)return e;let r=/\((?:\?<(.*?)>)?(?!\?)/g,i=0,s=r.exec(e.source);for(;s;)t.push({name:s[1]||i++,prefix:"",suffix:"",modifier:"",pattern:""}),s=r.exec(e.source);return e}function io(e,t,r){let i=e.map(s=>kn(s,t,r).source);return new RegExp(`(?:${i.join("|")})`,En(r))}function so(e,t,r){return Cn(_n(e,r),t,r)}function Cn(e,t,r={}){let{strict:i=!1,start:s=!0,end:n=!0,encode:a=h=>h}=r,o=`[${Mt(r.endsWith||"")}]|$`,u=`[${Mt(r.delimiter||"/#?")}]`,l=s?"^":"";for(let h of e)if(typeof h=="string")l+=Mt(a(h));else{let f=Mt(a(h.prefix)),m=Mt(a(h.suffix));if(h.pattern)if(t&&t.push(h),f||m)if(h.modifier==="+"||h.modifier==="*"){let p=h.modifier==="*"?"?":"";l+=`(?:${f}((?:${h.pattern})(?:${m}${f}(?:${h.pattern}))*)${m})${p}`}else l+=`(?:${f}(${h.pattern})${m})${h.modifier}`;else h.modifier==="+"||h.modifier==="*"?l+=`((?:${h.pattern})${h.modifier})`:l+=`(${h.pattern})${h.modifier}`;else l+=`(?:${f}${m})${h.modifier}`}if(n)i||(l+=`${u}?`),l+=r.endsWith?`(?=${o})`:"$";else{let h=e[e.length-1],f=typeof h=="string"?u.indexOf(h[h.length-1])>-1:h===void 0;i||(l+=`(?:${u}(?=${o}))?`),f||(l+=`(?=${u}|${o})`)}return new RegExp(l,En(r))}function kn(e,t,r){return e instanceof RegExp?ro(e,t):Array.isArray(e)?io(e,t,r):so(e,t,r)}function oo(e,t){return e.length?e[0]==="/"?!0:!t||e.length<2?!1:(e[0]=="\\"||e[0]=="{")&&e[1]=="/":!1}function An(e,t){return e.startsWith(t)?e.substring(t.length,e.length):e}function uo(e,t){return e.endsWith(t)?e.substr(0,e.length-t.length):e}function Pn(e){return!e||e.length<2?!1:e[0]==="["||(e[0]==="\\"||e[0]==="{")&&e[1]==="["}function In(e){if(!e)return!0;for(let t of On)if(e.test(t))return!0;return!1}function lo(e,t){if(e=An(e,"#"),t||e==="")return e;let r=new URL("https://example.com");return r.hash=e,r.hash?r.hash.substring(1,r.hash.length):""}function co(e,t){if(e=An(e,"?"),t||e==="")return e;let r=new URL("https://example.com");return r.search=e,r.search?r.search.substring(1,r.search.length):""}function ho(e,t){return t||e===""?e:Pn(e)?Rn(e):Nn(e)}function fo(e,t){if(t||e==="")return e;let r=new URL("https://example.com");return r.password=e,r.password}function po(e,t){if(t||e==="")return e;let r=new URL("https://example.com");return r.username=e,r.username}function mo(e,t,r){if(r||e==="")return e;if(t&&!On.includes(t))return new URL(`${t}:${e}`).pathname;let i=e[0]=="/";return e=new URL(i?e:"/-"+e,"https://example.com").pathname,i||(e=e.substring(2,e.length)),e}function go(e,t,r){return Tn(t)===e&&(e=""),r||e===""?e:Ln(e)}function xo(e,t){return e=uo(e,":"),t||e===""?e:Qi(e)}function Tn(e){switch(e){case"ws":case"http":return"80";case"wws":case"https":return"443";case"ftp":return"21";default:return""}}function Qi(e){if(e==="")return e;if(/^[-+.A-Za-z0-9]*$/.test(e))return e.toLowerCase();throw new TypeError(`Invalid protocol '${e}'.`)}function yo(e){if(e==="")return e;let t=new URL("https://example.com");return t.username=e,t.username}function bo(e){if(e==="")return e;let t=new URL("https://example.com");return t.password=e,t.password}function Nn(e){if(e==="")return e;if(/[\t\n\r #%/:<>?@[\]^\\|]/g.test(e))throw new TypeError(`Invalid hostname '${e}'`);let t=new URL("https://example.com");return t.hostname=e,t.hostname}function Rn(e){if(e==="")return e;if(/[^0-9a-fA-F[\]:]/g.test(e))throw new TypeError(`Invalid IPv6 hostname '${e}'`);return e.toLowerCase()}function Ln(e){if(e===""||/^[0-9]*$/.test(e)&&parseInt(e)<=65535)return e;throw new TypeError(`Invalid port '${e}'.`)}function wo(e){if(e==="")return e;let t=new URL("https://example.com");return t.pathname=e[0]!=="/"?"/-"+e:e,e[0]!=="/"?t.pathname.substring(2,t.pathname.length):t.pathname}function vo(e){return e===""?e:new URL(`data:${e}`).pathname}function So(e){if(e==="")return e;let t=new URL("https://example.com");return t.search=e,t.search.substring(1,t.search.length)}function _o(e){if(e==="")return e;let t=new URL("https://example.com");return t.hash=e,t.hash.substring(1,t.hash.length)}function vn(e,t){if(typeof e!="string")throw new TypeError("parameter 1 is not of type 'string'.");let r=new URL(e,t);return{protocol:r.protocol.substring(0,r.protocol.length-1),username:r.username,password:r.password,hostname:r.hostname,port:r.port,pathname:r.pathname,search:r.search!=""?r.search.substring(1,r.search.length):void 0,hash:r.hash!=""?r.hash.substring(1,r.hash.length):void 0}}function sr(e,t,r){let i;if(typeof t.baseURL=="string")try{i=new URL(t.baseURL),e.protocol=i.protocol?i.protocol.substring(0,i.protocol.length-1):"",e.username=i.username,e.password=i.password,e.hostname=i.hostname,e.port=i.port,e.pathname=i.pathname,e.search=i.search?i.search.substring(1,i.search.length):"",e.hash=i.hash?i.hash.substring(1,i.hash.length):""}catch{throw new TypeError(`invalid baseURL '${t.baseURL}'.`)}if(typeof t.protocol=="string"&&(e.protocol=xo(t.protocol,r)),typeof t.username=="string"&&(e.username=po(t.username,r)),typeof t.password=="string"&&(e.password=fo(t.password,r)),typeof t.hostname=="string"&&(e.hostname=ho(t.hostname,r)),typeof t.port=="string"&&(e.port=go(t.port,e.protocol,r)),typeof t.pathname=="string"){if(e.pathname=t.pathname,i&&!oo(e.pathname,r)){let s=i.pathname.lastIndexOf("/");s>=0&&(e.pathname=i.pathname.substring(0,s+1)+e.pathname)}e.pathname=mo(e.pathname,e.protocol,r)}return typeof t.search=="string"&&(e.search=co(t.search,r)),typeof t.hash=="string"&&(e.hash=lo(t.hash,r)),e}function nr(e){return e.replace(/([+*?:{}()\\])/g,"\\$1")}function ko(e){return e.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function Ao(e,t){let r=".*",i=`[^${ko(t.delimiter||"/#?")}]+?`,s=/[$_\u200C\u200D\p{ID_Continue}]/u,n="";for(let a=0;a<e.length;++a){let o=e[a],u=a>0?e[a-1]:null,l=a<e.length-1?e[a+1]:null;if(typeof o=="string"){n+=nr(o);continue}if(o.pattern===""){if(o.modifier===""){n+=nr(o.prefix);continue}n+=`{${nr(o.prefix)}}${o.modifier}`;continue}let h=typeof o.name!="number",f=t.prefixes!==void 0?t.prefixes:"./",m=o.suffix!==""||o.prefix!==""&&(o.prefix.length!==1||!f.includes(o.prefix));if(!m&&h&&o.pattern===i&&o.modifier===""&&l&&!l.prefix&&!l.suffix)if(typeof l=="string"){let p=l.length>0?l[0]:"";m=s.test(p)}else m=typeof l.name=="number";if(!m&&o.prefix===""&&u&&typeof u=="string"&&u.length>0){let p=u[u.length-1];m=f.includes(p)}m&&(n+="{"),n+=nr(o.prefix),h&&(n+=`:${o.name}`),o.pattern===r?!h&&(!u||typeof u=="string"||u.modifier||m||o.prefix!=="")?n+="*":n+=`(${r})`:o.pattern===i?h||(n+=`(${i})`):n+=`(${o.pattern})`,o.pattern===i&&h&&o.suffix!==""&&s.test(o.suffix[0])&&(n+="\\"),n+=nr(o.suffix),m&&(n+="}"),n+=o.modifier}return n}var Za,eo,st,no,ao,On,Eo,Co,it,Fn,Dn=ra(()=>{Za=/[$_\p{ID_Start}]/u,eo=/[$_\u200C\u200D\p{ID_Continue}]/u;st={delimiter:"",prefixes:"",sensitive:!0,strict:!0},no={delimiter:".",prefixes:"",sensitive:!0,strict:!0},ao={delimiter:"/",prefixes:"/",sensitive:!0,strict:!0};On=["ftp","file","http","https","ws","wss"];Eo=class{constructor(e){this.tokenList=[],this.internalResult={},this.tokenIndex=0,this.tokenIncrement=1,this.componentStart=0,this.state=0,this.groupDepth=0,this.hostnameIPv6BracketDepth=0,this.shouldTreatAsStandardURL=!1,this.input=e}get result(){return this.internalResult}parse(){for(this.tokenList=Sn(this.input,!0);this.tokenIndex<this.tokenList.length;this.tokenIndex+=this.tokenIncrement){if(this.tokenIncrement=1,this.tokenList[this.tokenIndex].type==="END"){if(this.state===0){this.rewind(),this.isHashPrefix()?this.changeState(9,1):this.isSearchPrefix()?(this.changeState(8,1),this.internalResult.hash=""):(this.changeState(7,0),this.internalResult.search="",this.internalResult.hash="");continue}else if(this.state===2){this.rewindAndSetState(5);continue}this.changeState(10,0);break}if(this.groupDepth>0)if(this.isGroupClose())this.groupDepth-=1;else continue;if(this.isGroupOpen()){this.groupDepth+=1;continue}switch(this.state){case 0:this.isProtocolSuffix()&&(this.internalResult.username="",this.internalResult.password="",this.internalResult.hostname="",this.internalResult.port="",this.internalResult.pathname="",this.internalResult.search="",this.internalResult.hash="",this.rewindAndSetState(1));break;case 1:if(this.isProtocolSuffix()){this.computeShouldTreatAsStandardURL();let e=7,t=1;this.shouldTreatAsStandardURL&&(this.internalResult.pathname="/"),this.nextIsAuthoritySlashes()?(e=2,t=3):this.shouldTreatAsStandardURL&&(e=2),this.changeState(e,t)}break;case 2:this.isIdentityTerminator()?this.rewindAndSetState(3):(this.isPathnameStart()||this.isSearchPrefix()||this.isHashPrefix())&&this.rewindAndSetState(5);break;case 3:this.isPasswordPrefix()?this.changeState(4,1):this.isIdentityTerminator()&&this.changeState(5,1);break;case 4:this.isIdentityTerminator()&&this.changeState(5,1);break;case 5:this.isIPv6Open()?this.hostnameIPv6BracketDepth+=1:this.isIPv6Close()&&(this.hostnameIPv6BracketDepth-=1),this.isPortPrefix()&&!this.hostnameIPv6BracketDepth?this.changeState(6,1):this.isPathnameStart()?this.changeState(7,0):this.isSearchPrefix()?this.changeState(8,1):this.isHashPrefix()&&this.changeState(9,1);break;case 6:this.isPathnameStart()?this.changeState(7,0):this.isSearchPrefix()?this.changeState(8,1):this.isHashPrefix()&&this.changeState(9,1);break;case 7:this.isSearchPrefix()?this.changeState(8,1):this.isHashPrefix()&&this.changeState(9,1);break;case 8:this.isHashPrefix()&&this.changeState(9,1);break;case 9:break;case 10:break}}}changeState(e,t){switch(this.state){case 0:break;case 1:this.internalResult.protocol=this.makeComponentString();break;case 2:break;case 3:this.internalResult.username=this.makeComponentString();break;case 4:this.internalResult.password=this.makeComponentString();break;case 5:this.internalResult.hostname=this.makeComponentString();break;case 6:this.internalResult.port=this.makeComponentString();break;case 7:this.internalResult.pathname=this.makeComponentString();break;case 8:this.internalResult.search=this.makeComponentString();break;case 9:this.internalResult.hash=this.makeComponentString();break;case 10:break}this.changeStateWithoutSettingComponent(e,t)}changeStateWithoutSettingComponent(e,t){this.state=e,this.componentStart=this.tokenIndex+t,this.tokenIndex+=t,this.tokenIncrement=0}rewind(){this.tokenIndex=this.componentStart,this.tokenIncrement=0}rewindAndSetState(e){this.rewind(),this.state=e}safeToken(e){return e<0&&(e=this.tokenList.length-e),e<this.tokenList.length?this.tokenList[e]:this.tokenList[this.tokenList.length-1]}isNonSpecialPatternChar(e,t){let r=this.safeToken(e);return r.value===t&&(r.type==="CHAR"||r.type==="ESCAPED_CHAR"||r.type==="INVALID_CHAR")}isProtocolSuffix(){return this.isNonSpecialPatternChar(this.tokenIndex,":")}nextIsAuthoritySlashes(){return this.isNonSpecialPatternChar(this.tokenIndex+1,"/")&&this.isNonSpecialPatternChar(this.tokenIndex+2,"/")}isIdentityTerminator(){return this.isNonSpecialPatternChar(this.tokenIndex,"@")}isPasswordPrefix(){return this.isNonSpecialPatternChar(this.tokenIndex,":")}isPortPrefix(){return this.isNonSpecialPatternChar(this.tokenIndex,":")}isPathnameStart(){return this.isNonSpecialPatternChar(this.tokenIndex,"/")}isSearchPrefix(){if(this.isNonSpecialPatternChar(this.tokenIndex,"?"))return!0;if(this.tokenList[this.tokenIndex].value!=="?")return!1;let e=this.safeToken(this.tokenIndex-1);return e.type!=="NAME"&&e.type!=="PATTERN"&&e.type!=="CLOSE"&&e.type!=="ASTERISK"}isHashPrefix(){return this.isNonSpecialPatternChar(this.tokenIndex,"#")}isGroupOpen(){return this.tokenList[this.tokenIndex].type=="OPEN"}isGroupClose(){return this.tokenList[this.tokenIndex].type=="CLOSE"}isIPv6Open(){return this.isNonSpecialPatternChar(this.tokenIndex,"[")}isIPv6Close(){return this.isNonSpecialPatternChar(this.tokenIndex,"]")}makeComponentString(){let e=this.tokenList[this.tokenIndex],t=this.safeToken(this.componentStart).index;return this.input.substring(t,e.index)}computeShouldTreatAsStandardURL(){let e={};Object.assign(e,st),e.encodePart=Qi;let t=kn(this.makeComponentString(),void 0,e);this.shouldTreatAsStandardURL=In(t)}},Co=["protocol","username","password","hostname","port","pathname","search","hash"],it="*";Fn=class{constructor(e={},t){this.regexp={},this.keys={},this.component_pattern={};try{if(typeof e=="string"){let s=new Eo(e);if(s.parse(),e=s.result,t)if(typeof t=="string")e.baseURL=t;else throw new TypeError("'baseURL' parameter is not of type 'string'.");else if(typeof e.protocol!="string")throw new TypeError("A base URL must be provided for a relative constructor string.")}else if(t)throw new TypeError("parameter 1 is not of type 'string'.");if(!e||typeof e!="object")throw new TypeError("parameter 1 is not of type 'string' and cannot convert to dictionary.");let r={pathname:it,protocol:it,username:it,password:it,hostname:it,port:it,search:it,hash:it};this.pattern=sr(r,e,!0),Tn(this.pattern.protocol)===this.pattern.port&&(this.pattern.port="");let i;for(i of Co){if(!(i in this.pattern))continue;let s={},n=this.pattern[i];switch(this.keys[i]=[],i){case"protocol":Object.assign(s,st),s.encodePart=Qi;break;case"username":Object.assign(s,st),s.encodePart=yo;break;case"password":Object.assign(s,st),s.encodePart=bo;break;case"hostname":Object.assign(s,no),Pn(n)?s.encodePart=Rn:s.encodePart=Nn;break;case"port":Object.assign(s,st),s.encodePart=Ln;break;case"pathname":In(this.regexp.protocol)?(Object.assign(s,ao),s.encodePart=wo):(Object.assign(s,st),s.encodePart=vo);break;case"search":Object.assign(s,st),s.encodePart=So;break;case"hash":Object.assign(s,st),s.encodePart=_o;break}try{let a=_n(n,s);this.regexp[i]=Cn(a,this.keys[i],s),this.component_pattern[i]=Ao(a,s)}catch{throw new TypeError(`invalid ${i} pattern '${this.pattern[i]}'.`)}}}catch(r){throw new TypeError(`Failed to construct 'URLPattern': ${r.message}`)}}test(e={},t){let r={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof e!="string"&&t)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof e>"u")return!1;try{typeof e=="object"?r=sr(r,e,!1):r=sr(r,vn(e,t),!1)}catch{return!1}let i;for(i in this.pattern)if(!this.regexp[i].exec(r[i]))return!1;return!0}exec(e={},t){let r={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof e!="string"&&t)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof e>"u")return;try{typeof e=="object"?r=sr(r,e,!1):r=sr(r,vn(e,t),!1)}catch{return null}let i={};t?i.inputs=[e,t]:i.inputs=[e];let s;for(s in this.pattern){let n=this.regexp[s].exec(r[s]);if(!n)return null;let a={};for(let[o,u]of this.keys[s].entries())if(typeof u.name=="string"||typeof u.name=="number"){let l=n[o+1];a[u.name]=l}i[s]={input:r[s]||"",groups:a}}return i}get protocol(){return this.component_pattern.protocol}get username(){return this.component_pattern.username}get password(){return this.component_pattern.password}get hostname(){return this.component_pattern.hostname}get port(){return this.component_pattern.port}get pathname(){return this.component_pattern.pathname}get search(){return this.component_pattern.search}get hash(){return this.component_pattern.hash}};globalThis.URLPattern||(globalThis.URLPattern=Fn)});function E(e){return!Array.isArray(e)&&typeof e=="object"&&e}function H(e){return typeof e}function y(e,...t){globalThis.WebQitInternalsRegistry||(globalThis.WebQitInternalsRegistry=new Map);var r=globalThis.WebQitInternalsRegistry.get(e);if(!r){if(r=new Map,t[0]===!1)return r;globalThis.WebQitInternalsRegistry.set(e,r)}for(var i,s;i=t.shift();)if((s=r)&&!(r=r.get(i))){if(r=new Map,t[0]===!1)return r;s.set(i,r)}return r}function S(e){return Array.isArray(e)}function Bt(e){return e===!0||e===!1}function at(e){return typeof e=="function"}function si(e){return at(e)&&/^class\s?/.test(Function.prototype.toString.call(e))}function fr(e){return e===null||e===""}function ee(e){return arguments.length&&(e===void 0||typeof e>"u")}function k(e){return Array.isArray(e)||typeof e=="object"&&e||at(e)}function Re(e){return fr(e)||ee(e)||e===!1||e===0||k(e)&&!Object.keys(e).length}function T(e){return at(e)||e&&{}.toString.call(e)==="[object function]"}function we(e){return e instanceof Number||typeof e=="number"}function $(e){return we(e)||e!==!0&&e!==!1&&e!==null&&e!==""&&!isNaN(e*1)}function ni(e){return S(e)&&Object.getPrototypeOf(e)===Array.prototype}function bt(e){return E(e)&&Object.getPrototypeOf(e)===Object.prototype}function W(e){return e instanceof String||typeof e=="string"&&e!==null}function ai(e){return!W(e)&&!ee(e.length)}function Ue(e,t=1){var r=0;e.forEach(s=>{r++});var i=e.slice(e.length-r,t);return arguments.length>1?i:i[0]}function ue(e,t=1){return arguments.length>1?Ue(e.slice().reverse(),t).reverse():Ue(e.slice().reverse())}function pr(e,...t){return t.forEach(r=>{e.indexOf(r)<0&&e.push(r)}),e}function oi(i,t){t=t||Object.prototype,t=t&&!S(t)?[t]:t;for(var r=[],i=i;i&&(!t||t.indexOf(i)<0)&&i.name!=="default";)r.push(i),i=i?Object.getPrototypeOf(i):null;return r}function ui(e,t){var r=[];return oi(e,t).forEach(i=>{pr(r,...Object.getOwnPropertyNames(i))}),r}function ce(e,t,r=!1,i=!1,s=!1){var n=0,a=e.shift();if(($(a)||a===!0||a===!1)&&(n=a,a=e.shift()),!e.length)throw new Error("_merge() requires two or more array/objects.");return e.forEach((o,u)=>{!k(o)&&!T(o)||(r?ui(o):Object.keys(o)).forEach(l=>{if(!!t(l,a,o,u)){var h=a[l],f=o[l];if((S(h)&&S(f)||E(h)&&E(f))&&(n===!0||n>0))a[l]=S(h)&&S(f)?[]:{},ce([$(n)?n-1:n,a[l],h,f],t,r,i,s);else if(S(a)&&S(o))i?a[l]=f:a.push(f);else try{s?Object.defineProperty(a,l,Object.getOwnPropertyDescriptor(o,l)):a[l]=o[l]}catch{}}})}),a}function he(e,t){var r=void 0;return k(e)&&Object.keys(e).forEach((i,s)=>{r!==!1&&(r=t($(i)?parseFloat(i):i,e[i],s))}),r}function le(...e){return ce(e,(t,r,i)=>!0,!1,!1,!1)}function ke(e,t,r=!1){if(t=="")return e;var i=r?e.lastIndexOf(t):e.indexOf(t);return i===-1?"":e.substr(i+t.length)}function wt(e,t,r=null,i=!1){return t.length>e.length?-1:(typeof r=="number"?i?e.slice(0,r+1+(r<0?e.length:0)):e.slice(r):e).reduce((s,n,a)=>{var[o,u,l]=s;if(!i&&o>-1)return[o,u,l];var h=l+1,f=n===t[h]?h===0?[a,0]:[u,h]:[-1,-1];return f[1]===t.length-1&&(f[1]=-1,f[0]>-1)?[f[0]].concat(f):[o].concat(f)},[-1,-1,-1])[0]+(i||typeof r!="number"?0:r>-1?r:e.length-r)}function vt(e,t,r=null,i=!1){var s=wt(e,t,r,i);return s===-1?[]:e.slice(s+t.length)}function qe(e,t){return e.reduce((r,i,s)=>r||t(i,s),!1)}function We(e,t,r=!1){if(t=="")return e;var i=r?e.lastIndexOf(t):e.indexOf(t);return i===-1?e:e.substr(0,i)}function O(e,t=!0){return S(e)?e:!t&&E(e)?[e]:e!==!1&&e!==0&&Re(e)?[]:ai(e)?Array.prototype.slice.call(e):E(e)?Object.values(e):[e]}function St(e,t,r=null){return S(t)?e.filter(i=>r?t.filter(s=>r(i,s)).length:t.indexOf(i)===-1):[]}function He(e,t,r=null){return r||r!==!1&&e.dotSafe&&t.dotSafe?e.join(".")===t.join("."):e.length===t.length&&e.reduce((i,s,n)=>i&&s===t[n],!0)}function _t(e,t,r=!1){for(var i=e.indexOf(t);i>-1&&(r||r===!1);)e.splice(i,1),r>0&&r--,i=e.indexOf(t);return e}var ns=function(e,t=1,r=!0){return!$(t)||t<=0||(!S(e)&&E(e)&&r&&(e=Object.values(e)),!S(e))?e:e.reduce((i,s)=>S(s)||E(s)&&r?i.concat(ns(S(s)?s:Object.values(s),t-1,r)):i.concat(s),[])},li=ns;function $t(e,t,r=null){return S(t)?e.filter(i=>r?t.filter(s=>r(i,s)).length:t.indexOf(i)!==-1):[]}function Ut(e,t,r=null){return r||r!==!1&&e.dotSafe&&t.dotSafe?(e.join(".")+".").startsWith(t.join(".")+"."):t.reduce((i,s,n)=>i&&s===e[n],!0)}function ot(e){let t=(r,i,s)=>s.indexOf(r)===i;return e.filter(t)}function ut(e){return(ci(e)?e:O(e).length?[e]:[]).reduce((t,r)=>t.concat([O(r)]),[]).map(t=>ze.resolve(t))}var ze=class extends Array{static resolve(t){return t.every(r=>!(r+"").includes("."))?new ze().concat(t):t}get dotSafe(){return!0}};function ci(e){return O(e).reduce((t,r)=>t||S(r),!1)}function hi(e){return e.filter(t=>t||t===0).length!==e.length}function as(e){return e.filter(t=>hi(O(t))).length>0}var lt=class{constructor(t){this.target=t,this.fireables=[],this.currentlyFiring=[]}add(t){return this.fireables.push(t),t}remove(t){this.fireables=this.fireables.filter(r=>r!==t)}removeMatches(t){this.match(t).forEach(r=>{this.fireables=this.fireables.filter(i=>i!==r)})}match(t){return this.fireables.filter(r=>{var i=ut(r.filter),s=O((r.params||{}).tags),n=ut(t.filter),a=O((t.params||{}).tags);return(!t.originalHandler||r.handler===t.originalHandler)&&(!n.length||He(n,i))&&(!a.length||a.length===s.length&&$t(s,a).length===a.length)})}static _getFirebase(t,r,i=!0,s=this.__namespace){if(!k(r))throw new Error('Subject must be of type object; "'+H(r)+'" given!');var n=this;return s&&globalThis.WebQitObserverNamespaceRegistry.has(t+"-"+s)&&(n=globalThis.WebQitObserverNamespaceRegistry.get(t+"-"+s),t+="-"+s),!y(r,"firebases").has(t)&&i&&y(r,"firebases").set(t,new n(r)),y(r,"firebases").get(t)}static _namespace(t,r,i=null){if(t+="-"+r,arguments.length===2)return globalThis.WebQitObserverNamespaceRegistry.get(t);if(!(i.prototype instanceof this))throw new Error(`The implementation of the namespace ${this.name}.${r} must be a subclass of ${this.name}.`);globalThis.WebQitObserverNamespaceRegistry.set(t,i),i.__namespace=r}};globalThis.WebQitObserverNamespaceRegistry||(globalThis.WebQitObserverNamespaceRegistry=new Map);var ct=class{constructor(t,r){this.target=t,this.handler=r.handler,this.filter=r.filter,this.params=r.params}disconnect(){this.disconnected=!0}};var qt=class extends ct{fire(t,r,i){return this.disconnected||this.filter&&!$t(O(this.filter),[t.type]).length?r(...Array.prototype.slice.call(arguments,2)):this.handler(t,i,r)}};function Et(e,t,r=!0,i=!0,s=!1,n=!1){if(S(e)&&S(t)){var a=[],o=!0;return e.forEach(u=>{if(!!o){var l=!1;he(t,(h,f)=>{(!l||i&&k(u))&&(l=r(u,f),(S(l)&&!l.length||E(l)&&!Object.keys(l).length)&&(l=!1),k(l)&&i&&(u=l))}),k(l)?a.push(i?l:u):Bt(l)?s&&!l||!s&&l?a.push(u):n&&(o=!1):a.push(l)}}),a}if(E(e)&&E(t)){var a={},o=!0;return Object.keys(e).forEach(h=>{if(!!o){var f=r(e[h],t[h]);(S(f)&&!f.length||E(f)&&!Object.keys(f).length)&&(f=!1),k(f)?a[h]=i?f:e[h]:Bt(f)?s&&!f||!s&&f?a[h]=e[h]:n&&(o=!1):a[h]=f}}),a}}function mr(e,t=[],r=!0){var i=0;return $(arguments[0])&&k(arguments[1])&&(i=arguments[0],e=arguments[1],t=arguments[2]||[]),ce([i,{},e],(s,n,a)=>T(t)?t(s):S(t)&&t.length?t.indexOf(s)>-1:!0,!1,!1,r)}function dr(e,t=[]){return ce([{},e],(r,i,s)=>{if(!T(s[r]))return T(t)?t(r):S(t)&&t.length?t.indexOf(r)>-1:!0},!1,!1,!1)}var fi=function(e,t,r=!0,i=1){if(S(e)&&S(t)&&e.length!==t.length)return!r;if(E(e)&&E(t)){var s=Object.keys(e),n=Object.keys(t);if(!s.length&&!n.length)return bt(e)&&bt(t)?r:e===t===r;if(!fi(s,n))return!r}if(i>0&&(S(e)&&S(t)||E(e)&&E(t))){var a=Et(e,t,(o,u)=>fi(o,u,r,i-1),!1,!1,!0);return S(a)?a.length===e.length&&a.length===t.length:E(a)&&E(e)?Object.keys(a).length===Object.keys(e).length&&Object.keys(a).length===Object.keys(t).length:a}return T(r)?r(e,t):we(e)&&we(t)&&isNaN(e)&&isNaN(t)?r:e===t===r},pi=fi;function mi(e,t=null){var r={};return arguments.length===2&&(S(e)&&S(t)?e.forEach((i,s)=>r[i]=t[s]):r[e]=t),r}function gi(e,t,r=null){return le(e,E(t)?t:mi(t,r))}var Ct=class{constructor(t,r){if(this.target=t,!r.type)throw new Error("Action type must be given in definition!");he(r,(i,s)=>{Object.defineProperty(this,i,{value:s,enumerable:!0})}),Object.seal(this)}};var J=class extends lt{add(t){return super.add(new qt(this.target,t))}fire(t,r=null){if(t instanceof Ct||(t=new Ct(this.target,t)),this.currentlyFiring.filter(n=>n.type===t.type&&n.name===t.name).length)return r?r():void 0;this.currentlyFiring.push(t);let i=(n,...a)=>{var o=this.fireables[n];return o?o.fire(t,(...u)=>i(n+1,...u),...a):r?r(...a):a[0]};var s=i(0);return this.currentlyFiring.pop(),s}static getFirebase(t,r=!0,i=null){return super._getFirebase("interceptor",...arguments)}static namespace(t,r=null){return super._namespace("interceptor",...arguments)}};function Q(e){return y(e,!1).get(e)||e}function X(e,t,r={},i={}){if(!t||!k(t))throw new Error("Target must be of type object!");t=Q(t);var s,n=function(a){return arguments.length?a:Reflect[e](t,...Object.values(r))};return(s=J.getFirebase(t,!1,i.namespace))?s.fire({type:e,...r},n):n()}function gr(e,t,r,i={}){return X("apply",e,{thisArgument:t,argumentsList:r},i)}function xr(e,t,r=null,i={}){return X("construct",e,arguments.length>2?{argumentsList:t,newTarget:r}:{argumentsList:t},i)}function xi(e,t){return ke(e,t,!0)}function Qe(e,t){return We(e,t,!0)}function yr(e,t){return typeof e!="string"?e:e.replace(/\w\S*/g,function(r){return r.charAt(0).toUpperCase()+(typeof t!==void 0&&t?r.substr(1).toLowerCase():r.substr(1))})}function br(e,t,r){return Qe(ke(e,t),r)}function yi(e,t,r){return e.startsWith(t)&&e.endsWith(r)}var ve=class{constructor(t,r=!1){this._={},this._.target=t,this._.cancellable=r,this._.propagationStopped=!1,this._.defaultPrevented=!1,this._.promisesInstance=null,this._.promises=[]}get target(){return this._.target}get cancellable(){return this._.cancellable}stopPropagation(){this._.propagationStopped=!0}get propagationStopped(){return this._.propagationStopped}preventDefault(){this._.defaultPrevented=!0}get defaultPrevented(){return this._.defaultPrevented}waitUntil(t){t instanceof Promise&&(this._.promises.push(t),this._.promisesInstance=null)}get promises(){return!this._.promisesInstance&&this._.promises.length&&(this._.promisesInstance=Promise.all(this._.promises)),this._.promisesInstance}respondWith(t){var r,i=E(t)&&!ee(t.propagationStopped)&&!ee(t.defaultPrevented);t===!1||i&&t.propagationStopped?this.stopPropagation():t===!1||i&&t.defaultPrevented?this.preventDefault():(t instanceof Promise&&(r=t)||i&&(r=t.promises))&&this.waitUntil(r)}};var Wt=class extends ct{constructor(t,r){if(super(t,r),this.filters2D=ut(this.filter),this.filtersIsOriginally2D=ci(this.filter),this.filtersIsDynamic=as(this.filters2D),this.filtersIsDynamic&&this.filters2D.length>1)throw new Error('Only one "Dynamic Filter" must be observed at a time! "'+this.filters2D.map(i=>"["+i.join(", ")+"]").join(", ")+'" have been bound together.')}fire(t){if(this.disconnected||this.params.type&&!qe(t,a=>this.params.type===a.type))return;let r=a=>!["set","def"].includes(a.type)||!this.params.diff||(T(this.params.diff)?this.params.diff(a.value,a.oldValue):a.value!==a.oldValue);var i=new ve(this.target);if(this.filters2D.length){var s=t.filter(a=>this.filters2D.filter((o,u)=>{var l=o.slice();return this.filtersIsDynamic&&a.path.forEach((h,f)=>{l[f]=l[f]||l[f]===0?l[f]:h}),(!this.filtersIsDynamic||!hi(l))&&r(a)&&(!this.params.subtree&&He(l,a.path)||this.params.suptree&&Ut(l,a.path)&&(!$(this.params.suptree)||vt(l,a.path).length<=this.params.suptree)||this.params.subtree&&a.path.length>=l.length&&Ut(a.path,l)&&(!$(this.params.subtree)||vt(a.path,l).length<=this.params.subtree))}).length);if(s.length)if(this.filtersIsOriginally2D||this.params.subtree){var n=s;E(this.filter)&&(n={...this.filter},s.forEach((a,o)=>{n[a.name]=a})),i.respondWith(this.handler(n,i))}else s.forEach((a,o)=>{i.respondWith(this.handler(a,i))})}else(this.params.subtree||t.filter(a=>He(a.path,[a.name])).length===t.length)&&t.filter(a=>r(a)).length&&i.respondWith(this.handler(t,i));return i}};var Ge=class{constructor(t,r){if(this.target=t,r.originalSubject||(this.originalSubject=t),!("type"in r))throw new Error("Mutation type must be given in definition!");if(!("name"in r))throw new Error("Property name must be given in definition!");he(r,(i,s)=>{i==="path"&&(s=ze.resolve(s)),Object.defineProperty(this,i,{value:s,enumerable:!0})}),this.path||Object.defineProperty(this,"path",{value:ze.resolve([r.name]),enumerable:!0}),Object.seal(this)}};var z=class extends lt{constructor(t){super(t),this.buffers=[]}add(t){return super.add(new Wt(this.target,t))}fire(t,r){var i=new ve(this.target,r);return t=O(t,!1).map(s=>s instanceof Ge?s:new Ge(this.target,s)),this.buffers.length?(ue(this.buffers)(t),i):(this.currentlyFiring.filter(s=>t.filter(n=>s.type===n.type&&s.name===n.name).length).length,this.fireables.forEach(s=>{if(i.propagationStopped&&r)return i;i.respondWith(s.fire(t))}),i)}static getFirebase(t,r=!0,i=null){return super._getFirebase("observer",...arguments)}static namespace(t,r=null){return super._namespace("observer",...arguments)}};function fe(e,t,r=null,i={}){if(e=r||e,!e||!k(e))throw new Error("Target must be of type object!");e=Q(e);var s=O(t),n=s.map(a=>{var o,u=function(l){return arguments.length?l:y(e,"accessorizedProps").has(a)&&y(e,"accessorizedProps").get(a).touch(!0)?y(e,"accessorizedProps").get(a).get():r?Reflect.get(e,a,r):Reflect.get(e,a)};return(o=J.getFirebase(e,!0,i.namespace))?o.fire({type:"get",name:a,related:s,receiver:r},u):u()});return S(t)?n:n[0]}function wr(e,t,r=null,i={}){if(e=Q(e),!e||!k(e))throw new Error('Observable subjects must be of type object; "'+H(e)+'" given!');if(T(t)&&(i=arguments.length>2?r:{},r=t,t=null),!T(r))throw new Error('Handler must be a function; "'+H(r)+'" given!');var s,n=z.getFirebase(e,!0,i.namespace),a={filter:t,handler:r,params:i};if((a.filter||a.params.subtree==="*"||a.params.subtree&&kt(e))&&Ke(e,a.filter,a.params.subtree,i.namespace),a.params.unique&&(s=n.match({filter:t,params:i})).length){if(a.params.unique!=="replace")return s[0];n.remove(s[0])}return n.add(a)}function Je(e,t,r,i=null,s={}){if(e!==r){var n;if(wr(r,(o,u)=>{if(n=z.getFirebase(e,!1,s.namespace)){var l=o.map(h=>{var f=h;do if(f.target===e)return;while(f=f.src);var m={};return he(h,(p,x)=>{p!=="target"&&p!=="name"&&p!=="path"&&p!=="src"&&(m[p]=x)}),m.name=t,m.path=[t].concat(h.path),m.originalSubject=h.originalSubject,m.src=h,new Ge(e,m)}).filter(h=>h);if(l.length)return n.fire(l,u.cancellable)}},{subtree:!0,...s,unique:!0,tags:[bi,t,e]}),E(i)&&(n=z.getFirebase(e,!1,s.namespace))){var a=le({name:t,type:"set",value:r,related:[t]},i);let o=n.fire(a,s.cancellable);if(s.eventTypeReturn)return o}}}var bi={};function Ke(e,t=null,r=!1,i=null){if(!e||!k(e))throw new Error("Target must be of type object!");var s=z.getFirebase(e,!0,i);if(!(!s||s.build)){s.build=r;var n=ut(t),a=!n.length||n.filter(u=>!u[0]&&u[0]!==0).length?Object.keys(e):n.map(u=>u[0]),o=n.length?n.map(u=>u.slice(1)).filter(u=>u.length):null;s.subBuild=o&&o.length?o:null,a.forEach(u=>{var l=fe(e,u,null,{namespace:i});try{k(l)&&(Je(e,u,l,null,params),(s.subBuild&&kt(l)||(_isFunction(r)?r(l):r&&kt(l)))&&Ke(l,s.subBuild,r,i))}catch{}})}}var kt=e=>(e instanceof Object||e instanceof Array||e instanceof Function)&&(typeof window>"u"||e!==window);function vr(e,t,r=null,i={}){if(e=Q(e),!e||!k(e))throw new Error('Observable subjects must be of type object; "'+H(e)+'" given!');if(T(t)&&(i=arguments.length>2?r:{},r=t,t=null),r&&!T(r))throw new Error('Handler must be a function; "'+H(r)+'" given!');var s;if(s=z.getFirebase(e,!1,i.namespace))return s.removeMatches({filter:t,originalHandler:r,params:i})}function Xe(e,t,r,i=null,s={}){vr(r,null,null,{...s,tags:[bi,t,e]});var n;if(E(i)&&(n=z.getFirebase(e,!1,s.namespace))){var a=le({name:t,type:"del",oldValue:r,related:[t]},i);n.fire(a,s.cancellable)}}function Ye(e,t,r={}){return X("has",e,{name:t},r)}function Sr(e,t,r,i={}){t=r.receiver||t;var s=r.keysOrPayload,n=r.value;if(!t||!k(t))throw new Error("Target must be of type object!");E(s)&&(i=n||{},n=null),t=Q(t);var a=J.getFirebase(t,!1,i.namespace),o=z.getFirebase(t,!1,i.namespace);let u=(p,x,b,d)=>{var w="set",v;e&&(w="defineProperty",v=x||{},x=v.value);var _=!1,C;Ye(t,p,i)&&(_=!0,C=fe(t,p,r.receiver,i));var F={name:p,type:w,value:x,receiver:r.receiver,related:b,detail:d,isUpdate:_,oldValue:C},D=function(V){return arguments.length&&(v?v=V:x=V),v?y(t,"accessorizedProps",!1).has(p)&&!y(t,"accessorizedProps").get(p).restore()?!1:(Object.defineProperty(t,p,v),!0):y(t,"accessorizedProps",!1).has(p)?y(t,"accessorizedProps").get(p).set(x):(t[p]=x,!0)};if(a){var te=v?{type:"defineProperty",name:p,descriptor:v,receiver:r.receiver,related:b,detail:d,isUpdate:_,oldValue:C}:{type:"set",name:p,value:x,receiver:r.receiver,related:b,detail:d,isUpdate:_,oldValue:C};F.success=a.fire(te,D)}else F.success=D();return F.success&&F.value!==F.oldValue&&(k(F.oldValue)&&Xe(t,p,F.oldValue,null,i),k(F.value)&&(Je(t,p,F.value,null,i),o&&(o.subBuild||o.build&&kt(F.value))&&Ke(F.value,o.subBuild,o.build,i.namespace))),F};var l,h=[];S(s)||(W(s)||we(s))&&(l=O(s))?h=l.map(p=>u(p,n,l,i.detail)):E(s)&&(l=Object.keys(s))&&(h=l.map(p=>u(p,s[p],l,i.detail)));var f=h.filter(p=>p.success!==!1),m;return o?(m=o.fire(f,i.cancellable),m.successCount=f.length):i.eventTypeReturn&&(m=new ve(t)),i.eventTypeReturn?m:f.length>0}function _r(e,t,r=null,i={}){return Sr(!0,e,{keysOrPayload:t,value:r},i)}function Er(e,t,r={}){if(!e||!k(e))throw new Error("Target must be of type object!");e=Q(e);var i=O(t),s=i.map(u=>{var l;Ye(e,u,r)&&(l=fe(e,u,null,r));var h={name:u,type:"deleteProperty",related:i,detail:r.detail,oldValue:l},f,m=function(p){return arguments.length?p:y(e,"accessorizedProps",!1).has(u)&&!y(e,"accessorizedProps").get(u).restore()?!1:(delete e[u],!0)};return(f=J.getFirebase(e,!1,r.namespace))?h.success=f.fire({type:"deleteProperty",name:u,oldValue:l,related:i},m):h.success=m(),h.success&&k(h.oldValue)&&Xe(e,u,h.oldValue,null,r),h}),n=s.filter(u=>u.success!==!1),a,o;return(a=z.getFirebase(e,!1,r.namespace))?(o=a.fire(n,r.cancellable),o.successCount=n.length):r.eventTypeReturn&&(o=new ve(e)),r.eventTypeReturn?o:n.length>0}function Cr(e,t,r={}){return X("getOwnPropertyDescriptor",e,{name:t},r)}function kr(e,t={}){return X("getPrototypeOf",e,{},t)}function Ar(e,t={}){return X("isExtensible",e,{},t)}function Pr(e,t={}){return X("ownKeys",e,{},t)}function Or(e,t={}){return X("preventExtensions",e,{},t)}function At(e,t,r=null,i=null,s={}){return Sr(!1,e,arguments.length>3?{keysOrPayload:t,value:r,receiver:i}:{keysOrPayload:t,value:r},s)}function Ir(e,t,r={}){return X("setPrototypeOf",e,{prototype:t},r)}function os(e,t=[],r={}){r=E(t)?t:r;var i=(arguments.length===1?Object.keys(e):O(t)).map(s=>{if(y(e,"accessorizedProps").has(s)&&y(e,"accessorizedProps").get(s).touch(!0))return!1;let n=()=>{for(var m,p=e;!m&&(p=Object.getPrototypeOf(p));)m=Object.getOwnPropertyDescriptor(p,s);return m};var a=Object.getOwnPropertyDescriptor(e,s),o,u;a||(o={writable:!0,enumerable:!(s in e),configurable:r.configurable!==!1});var l={...a||o};"value"in l&&delete l.value,"writable"in l&&delete l.writable,l.get=()=>{if(f.ongoingGets.length)return f.get();f.ongoingGets.push(1);var m=fe(e,s,null,r);return f.ongoingGets.pop(),m};var h;l.set=m=>{if(f.ongoingSets.length)return f.set(m);f.ongoingSets.push(1);var p=At(e,s,m,null,r);return f.ongoingSets.pop(),p};var f={ongoingGets:[],ongoingSets:[],get:function(){var m=a;return m||(u?m=o:m=n()||o),m.get?m.get.call(e):m.value},set:function(m){var p=a;return p||(u?p=o:(p=n())?"value"in p&&(p=o,u=!0):(p=o,u=!0)),p.set||p.get?p.set?p.set.call(e,m):!1:(p.value=m,!0)},restore:function(){try{return this.intact()&&(a||u?Object.defineProperty(e,s,a||o):delete e[s],y(e,"accessorizedProps").delete(s)),!0}catch{}return!1},intact:function(){return(Object.getOwnPropertyDescriptor(e,s)||{}).get===l.get},touch:function(m=!1){return this.intact()||(m?!this.restore():!1)}};try{return Object.defineProperty(e,s,l),y(e,"accessorizedProps").set(s,f),!0}catch{}return!1});return S(t)?i:i[0]}function us(e,t=[],r={}){r=E(t)?t:r;var i=(arguments.length===1?Object.keys(e):O(t)).map(s=>y(e,"accessorizedProps",!1).has(s)?y(e,"accessorizedProps").get(s).restore():!0);return S(t)?i:i[0]}function ls(e,t={}){if(!k(e))throw new Error('Object must be of type target; "'+H(e)+'" given!');var r=new Proxy(e,{apply:(i,s,n)=>gr(i,s,n,t),construct:(i,s,n=null)=>xr(i,s,n,t),defineProperty:(i,s,n)=>_r(i,s,n,t),deleteProperty:(i,s)=>Er(i,s,t),get:(i,s,n=null)=>{var a=fe(i,s,n,t);return t.proxyAutoBinding!==!1&&T(a)&&!si(a)?a.bind(r):a},getOwnPropertyDescriptor:(i,s)=>Cr(i,s,t),getPrototypeOf:i=>kr(i,t),has:(i,s)=>Ye(i,s,t),isExtensible:i=>Ar(i,t),ownKeys:i=>Pr(i,t),preventExtensions:i=>Or(i,t),set:(i,s,n,a=null)=>At(i,s,n,a,t),setPrototypeOf:(i,s)=>Ir(i,s,t)});return y(r).set(r,e),r}function cs(e,t,r={}){if(e=Q(e),!k(e))throw new Error('Object must be of type target; "'+H(handler)+'" given!');var i={},s=!0;E(t)||(T(t)?t={"":t}:T(r)&&(t={[t]:r},r=arguments.length>3?arguments[3]:{}),s=!1);var n=J.getFirebase(e,!0,r.namespace);return Object.keys(t).forEach(a=>{if(!T(t[a]))throw new Error("Callback"+(a===null?"":" for "+a)+' must be a function; "'+H(t[a])+'" given!');var o={filter:a,handler:t[a],params:r},u;if(o.params.unique&&(u=n.match(o)).length){if(o.params.unique!=="replace")return u[0];n.remove(u[0])}s?i[a]=n.add(o):i=n.add(o)}),i}function hs(e,t=null,r={}){if(e=Q(e),!e||!k(e))throw new Error('Object must be of type target; "'+H(e)+'" given!');var i=J.getFirebase(e,!1,r.namespace);_isObject(t)||(T(t)?t={[null]:t}:T(r)&&(t={[t]:r},r=arguments.length>3?arguments[3]:{}),isOriginallyObj=!1),(i=J.getFirebase(e,!1,r.namespace))&&Object.keys(t).forEach(s=>{if(!T(t[s]))throw new Error("Callback"+(s===null?"":" for "+s)+' must be a function; "'+H(t[s])+'" given!');var n={filter:s,originalHandler:t[s],params:r};return i.removeMatches(n)})}function fs(e,...t){var r=t.map(n=>{if(n=Q(n),!k(n))throw new Error("Target must be of type object!");return{target:n,subjectCopy:S(n)?n.slice(0):mr(n)}}),i=e(...t);let s=()=>{r.map(n=>{var a=Object.keys(n.subjectCopy),o=Object.keys(n.target),u=[],l=ot(a.concat(o)).map(f=>{if(n.subjectCopy[f]!==n.target[f]){u.push(f);var m={name:f,related:u,buffered:!0};return o.includes(f)?(m.type="set",m.value=n.target[f],a.includes(f)&&(m.isUpdate=!0)):m.type="del",a.includes(f)&&(m.oldValue=n.subjectCopy[f]),k(n.subjectCopy[f])&&Xe(n.target,f,n.subjectCopy[f]),k(n.target[f])&&Je(n.target,f,n.target[f]),m}}).filter(f=>f),h;if(l.length&&(h=z.getFirebase(n.target,!1)))return h.fire(l)})};return i instanceof Promise?i.then(s):s(),i}var P={apply:gr,construct:xr,defineProperty:_r,deleteProperty:Er,get:fe,getOwnPropertyDescriptor:Cr,getPrototypeOf:kr,has:Ye,isExtensible:Ar,ownKeys:Pr,preventExtensions:Or,set:At,setPrototypeOf:Ir,accessorize:os,unaccessorize:us,proxy:ls,unproxy:Q,observe:wr,unobserve:vr,intercept:cs,unintercept:hs,closure:fs,build:Ke,link:Je,unlink:Xe,Observers:z,Interceptors:J};function Se(e){return!Array.isArray(e)&&typeof e=="object"&&e}function ps(e){var t=typeof e.InstallTrigger<"u";if(t)return"firefox";var r=/constructor/i.test(e.HTMLElement)||function(l){return l.toString()==="[object SafariRemoteNotification]"}(!e.safari||typeof e.safari<"u"&&e.safari.pushNotification);if(r)return"safari";var i=!!e.chrome&&(!!e.chrome.webstore||!!e.chrome.runtime),s=i&&e.navigator.userAgent.indexOf("Edg")!=-1,n=!!e.opr&&!!e.opr.addons||!!e.opera||e.navigator.userAgent.indexOf(" OPR/")>=0,a=!!e.document.documentMode,o=!a&&!!e.StyleMedia,u=(i||n)&&!!e.CSS;return o?"edge":a?"ie":n?"opera":s?"ie-chromium":i?"chrome":"unknown"}function ms(e){var t=e.getComputedStyle(e.document.documentElement,""),r=(Array.prototype.slice.call(t).join("").match(/-(moz|webkit|ms)-/)||t.Olink===""&&["","o"])[1],i=("WebKit|Moz|Ms|O".match(new RegExp("("+r+")","i"))||[])[1];return{api:i,prefix:r,css:"-"+r+"-"}}function Le(){if(!(Se(this)&&this.window)&&typeof window>"u")throw new Error("A window context is required.");let e=Se(this)&&this.window?this.window:window;if(e.WebQit||(e.WebQit={}),!e.WebQit.window){let t,r;Object.defineProperty(e.WebQit,"window",{get:()=>e}),Object.defineProperty(e.WebQit,"vendor",{value:{getName:()=>(t||(t=ps(e)),t),getPrefix:()=>(r||(r=ms(e)),r)}})}return e.WebQit}function Tr(e){return typeof e=="function"}function pe(e){return Array.isArray(e)||typeof e=="object"&&e||Tr(e)}function ds(e){return e instanceof Number||typeof e=="number"}function ht(e){return ds(e)||e!==!0&&e!==!1&&e!==null&&e!==""&&!isNaN(e*1)}var Ht=class{constructor(t,r=!0){this.window=t,this.async=r,this.readCallbacks=[],this.writeCallbacks=[],this._run()}_run(){this.window.requestAnimationFrame(()=>{this.readCallbacks.forEach((t,r)=>{t&&!t()&&(this.readCallbacks[r]=null)}),this.writeCallbacks.forEach((t,r)=>{t&&!t()&&(this.writeCallbacks[r]=null)}),this._run()})}onread(t,r=!1){if(r)return new Promise((i,s)=>{this.async===!1?t(i,s):this.readCallbacks.push(()=>{t(i,s)})});this.async===!1?t():this.readCallbacks.push(t)}onwrite(t,r=!1){if(r)return new Promise((i,s)=>{this.async===!1?t(i,s):this.writeCallbacks.push(()=>{t(i,s)})});this.async===!1?t():this.writeCallbacks.push(t)}cycle(t,r,i){this.onread(()=>{var s=t(i);if(s){var n=a=>{this.onwrite(()=>{var o=r(a,i);if(o){var u=l=>{this.cycle(t,r,l)};o instanceof Promise?o.then(u):u()}})};s instanceof Promise?s.then(n):n()}})}};function Fe(e){return e instanceof String||typeof e=="string"&&e!==null}function ft(e){return Array.isArray(e)}function Pt(e){return arguments.length&&(e===void 0||typeof e>"u")}function gs(e){return!Fe(e)&&!Pt(e.length)}function Nr(e){return e===null||e===""}function xs(e){return Nr(e)||Pt(e)||e===!1||e===0||pe(e)&&!Object.keys(e).length}function Y(e,t=!0){return ft(e)?e:!t&&Se(e)?[e]:e!==!1&&e!==0&&xs(e)?[]:gs(e)?Array.prototype.slice.call(e):Se(e)?Object.values(e):[e]}function zt(e){let t=Le.call(this);t.DOM.isDOMReady||t.window.document.readyState==="complete"?e(t.window):(t.window.domReadyCallbacks||(t.window.domReadyCallbacks=[],t.window.document.addEventListener("DOMContentLoaded",()=>{t.DOM.isDOMReady=!0,t.window.domReadyCallbacks.splice(0).forEach(r=>r(t.window))},!1)),t.window.domReadyCallbacks.push(e))}var Qt=class{constructor(t){this.window=t}onAdded(t,r,i={}){return i.on="added",this.onPresenceChange(t,(s,n,a,o,u)=>{r(s,n,a,o,u)},i)}onRemoved(t,r,i={}){return i.on="removed",this.onPresenceChange(t,(s,n,a,o,u)=>{r(s,n,a,o,u)},i)}onPresent(t,r,i={}){zt.call(this.window,()=>{this.window.MutationObserver&&this.onAdded(t,(s,n)=>{s.forEach(a=>r(a,n))},i),Fe(t)?Y(this.window.document.querySelectorAll(t)).forEach(s=>r(s,1)):t.parentNode&&r(t,1)})}onAbsent(t,r,i={}){zt.call(this.window,()=>{this.window.MutationObserver&&onRemoved(t,(s,n)=>{s.forEach(a=>r(a,n))},i),Fe(t)?Y(this.window.document.querySelectorAll(t)).length===0&&r(null,0):t.parentNode||r(t,0)})}onPresenceChange(t,r,i={}){t=Y(t,!1);var s=(f,m)=>{if(m=m.filter(b=>b.matches),Fe(f)){var p=m.filter(b=>b.matches(f));if(i.observeIndirectMutation!==!1&&(p=m.reduce((b,d)=>b.concat(Y(d.querySelectorAll(f))),p),p.length))return p}else{if(m.includes(f))return[f];if(i.observeIndirectMutation!==!1&&m.length){for(var x=f;x=x.parentNode;)if(m.includes(x))return[f]}}},n=(f,m)=>(m.$$searchCache||(m.$$searchCache=new Map),f.reduce((p,x)=>{var b;return m.$$searchCache.has(x)?b=m.$$searchCache.get(x):(b=s(x,m,Fe(x))||[],m.$$searchCache.set(x,b)),p.concat(b)},[])),a=new Set,o=new Set,u=(f,m,p)=>{m&&i.on==="removed"||!m&&i.on==="added"||(f=n(t,f)).length&&(i.maintainCallState?(f.forEach(x=>{m?(a.add(x),o.delete(x)):(a.delete(x),o.add(x))}),r(f,m,p,a,o)):r(f,m,p))},l=i.context||this.window.document.documentElement,h=this._observe(l,(f,m,p,x)=>{i.ignoreTransients||(u(f,0,!0),u(f.concat(m),1,!0),u(m,0,!0)),u(x,0),u(p,1)});return h}onAttrChange(t,r,i=[]){var s=new this.window.MutationObserver(r),n={attributes:!0,attributeOldValue:!0};return i&&(n.attributeFilter=i),s.observe(t,n),s}onTreeChange(t,r,i=!1){var s=new this.window.MutationObserver(r),n={childList:!0,subtree:i};return s.observe(t,n),s}onMutation(t,r,i){var s=new this.window.MutationObserver(r);return s.observe(t,i),s}_observe(t,r){if(!wi.has(t)){let s=new Set,n=new this.window.MutationObserver(a=>{if(!!s.size){var o=a.reduce((f,m)=>f.concat(Y(m.addedNodes)),[]),u=a.reduce((f,m)=>f.concat(Y(m.removedNodes)),[]),l=[],h=[];o=new Set(o),u=new Set(u),o.forEach(f=>{u.has(f)&&(u.delete(f),o.delete(f),f.isConnected?l.push(f):h.push(f))}),o=[...o],u=[...u],s.forEach(f=>f(l,h,o,u))}});n.observe(t,{childList:!0,subtree:!0}),wi.set(t,{callbacks:s,observer:n})}let i=wi.get(t);return i.callbacks.add(r),{disconnect(){i.callbacks.delete(r)},reconnect(){i.callbacks.add(r)}}}},wi=new Map;function ys(e){ha(e),fa(e),pa(e)}function ha(e){e.CSS||(e.CSS={}),e.CSS.escape||(e.CSS.escape=t=>t.replace(/([\:@\~\$\&])/g,"\\$1"))}function fa(e){"isConnected"in e.Node.prototype||Object.defineProperty(e.Node.prototype,"isConnected",{get:function(){return!this.ownerDocument||!(this.ownerDocument.compareDocumentPosition(this)&this.DOCUMENT_POSITION_DISCONNECTED)}})}function pa(e){e.Element.prototype.matches||(e.Element.prototype.matches=e.Element.prototype.matchesSelector||e.Element.prototype.mozMatchesSelector||e.Element.prototype.msMatchesSelector||e.Element.prototype.oMatchesSelector||e.Element.prototype.webkitMatchesSelector||function(t){for(var r=(this.document||this.ownerDocument).querySelectorAll(t),i=r.length;--i>=0&&r.item(i)!==this;);return i>-1})}function Rr(e,t=null,r=!1){let i=Le.call(this);if(Fe(e)){var s;if(e.trim().startsWith("<")){var n=i.window.document.createElement("div");n.innerHTML=e,s=r?Y(n.children):n.firstChild}else s=r?Y(ws.call(this,e,t)):vi.call(this,e,t);return s}return e instanceof i.window.Element?r?[e]:e:r?Y(e):e}function bs(e,t=null){return Rr.call(this,e,t,!0)}function vi(e,t=null,r=!1){let i=Le.call(this);t=t||i.window.document;var s,n=r?"querySelectorAll":"querySelector";try{s=t[n](e)}catch{try{s=t[n](e.replace(/\:is\(/g,":matches("))}catch{try{s=t[n](e.replace(/\:is\(/g,":-webkit-any("))}catch{try{s=t[n](e.replace(/\:is\(/g,":-moz-any("))}catch(l){throw l}}}}return s}function ws(e,t=null){return vi.call(this,e,t,!0)}function pt(e){return Tr(e)||e&&{}.toString.call(e)==="[object function]"}function Ze(e,t,r={},i={}){t=Y(t).slice();for(var s=e;!Pt(s)&&!Nr(s)&&t.length;){var n=t.shift();if(!(r.get?r.get(s,n):pe(s)?n in s:s[n])){i.exists=!1;return}s=r.get?r.get(s,n):s[n]}return i.exists=!0,s}function Lr(e,t,r,i={},s={}){let n=(h,f,m)=>s.set?s.set(h,f,m):(ht(t[o])&&ft(h)?h.push(m):h[f]=m,!0);t=Y(t);for(var a=e,o=0;o<t.length;o++)if(o<t.length-1){if(!a||!pe(a)&&!pt(a))return!1;var u=Ze(a,t[o],s);if(!pe(u)){if(s.buildTree===!1)return!1;u=pt(s.buildTree)?s.buildTree(o):ht(t[o+1])?[]:{};var l=n(a,t[o],u);if(!l)return!1}a=u}else return n(a,t[o],r)}function vs(e,t,r=!1,i={}){t=Y(t);var s=!1;do{var n=t.pop(),n=n===""?0:n,a=e;t.length&&(a=Ze(e,t,{},i)),(pe(a)||pt(a))&&(i.has?i.has(a,n):n in a)&&(i.deleteProperty?s=i.deleteProperty(a,n):i.del?s=i.del(a,n):(delete a[n],s=!0))}while(s&&r&&t.length&&(pe(a)||pt(a))&&!(i.keys?i.keys(a):Object.keys(a)).length);return s}function Si(e,t,r={}){var i={};return Ze(e,t,r,i),i.exists}function _i(e,t=!1){let r=Le.call(this);var i={};return!(i.el=r.window.document.head.querySelector('meta[name="oohtml"]'))&&t&&(i.el=r.window.document.createElement("meta"),i.el.setAttribute("name",e),r.window.document.head.append(i.el)),i.el&&(i.vars=(i.el.getAttribute("content")||"").split(";").filter(s=>s).reduce((s,n)=>{var a=n.split("=").map(o=>o.trim());return Lr(s,a[0].split("."),a[1]==="true"?!0:a[1]==="false"?!1:ht(a[1])?parseInt(a[1]):a[1]),s},{})),i.get=function(s){return Ze(this.vars,s.split("."))},i.set=function(s,n=null,a=!1){var o=Se(s)?s:{[s]:n===!0?"true":n};if(a=arguments.length<3?n:a,Object.keys(o).forEach(u=>{if(o[u]===!1)vs(this.vars,u.split("."));else if(Se(o[u]))Object.keys(o[u]).forEach(h=>{var f=(u+"."+h).split(".");(!a||!Si(this.vars,f))&&Lr(this.vars,f,o[u][h])});else{var l=u.split(".");(!a||!Si(this.vars,l))&&Lr(this.vars,l,o[u])}}),t){let u=(l,h)=>Object.keys(h).reduce((f,m)=>{var p=(l?l+".":"")+m;return Se(h[m])?f.push(...u(p,h[m])):f.push(p+"="+h[m]),f},[]);this.el.setAttribute("content",u("",this.vars).join(";"))}return!0},i.defaults=function(s,n=null){return this.set(s,n,!0)},i}function ae(){let e=Le.call(this);return e.DOM||(e.DOM={},ys(e.window),e.DOM.reflow=new Ht(e.window),e.DOM.mutations=new Qt(e.window),e.DOM.meta=_i.bind(e.window),e.DOM.query=Rr.bind(e.window),e.DOM.queryAll=bs.bind(e.window),e.DOM.ready=zt.bind(e.window)),e}var B=class{static lex(t,r,i={}){if(!W(t=t+""))throw new Error("Argument1 must be a string!");var s=l=>({delims:l.delims.slice(),options:dr(l.options),nesting:l.nesting.slice(),maxDepth:l.maxDepth,comments:l.comments.slice(),tokens:l.tokens.slice(),matches:l.matches.slice(),matchesi:dr(l.matchesi)});if(B.$cache[t]&&i.cache!==!1)for(var n=0;n<B.$cache[t].length;n++){var a=B.$cache[t][n];if(pi(a.delims,r))return s(a)}var o=new B(t,i),u=o.lex(r);return i.cache!==!1&&(B.$cache[t]=B.$cache[t]||[],B.$cache[t].push(u)),s(u)}static split(t,r,i){return B.lex(t,r,i).tokens}static match(t,r,i){return B.lex(t,r,i).matches}constructor(t,r){if(!W(t))throw new Error("Lexer requires the first argument to be a string.");this.$str=t,this.$options=r||{},this.$options.blocks||(this.$options.blocks=B.$blocks),this.$options.quotes||(this.$options.quotes=B.$quotes),this.$options.comments||(this.$options.comments=B.$comments)}lex(t,r){for(var i={delims:O(t),options:le(!0,{},this.$options,r||{}),nesting:[],maxDepth:0,comments:[],tokens:[],matches:[],matchesi:{}},s=0;typeof s=="number";)s=this._evalCharsAt(i,s);if(i.nesting.length)throw new Error("Error parsing the string: "+this.$str+". Unterminated blocks: "+li(i.nesting).join(", "));return i}_evalCharsAt(t,r){if(!(r>=this.$str.length)){var i=1,s={},n={},a={};if(t.openComment||(n=this._testQuotes(t,r)),t.openQuote||(s=this._testComments(t,r)),t.openComment||s.ending)if(!t.nesting.length&&!a.ending){var o=s.starting||s.ending||this.$str[r];i=o.length,this._push(t,o,"comments",s.starting)}else this._push(t,this.$str[r]);else if(t.openQuote||n.ending)this._push(t,this.$str[r]);else{if(t.options.limit&&t.matches.length===t.options.limit)return this._push(t,this.$str[r]),r+1;a=this._testNesting(t,r);var a=this._testNesting(t,r),u=this._testChars(t.options.stopChars||[],t,r);if(!t.nesting.length&&u!==!1){t.options.stopChar=u,t.options.stopCharForward=this.$str.substr(r);return}if(!t.delims.length)t.nesting.length===2&&a.starting?(t.matches.push(null),this._push(t,a.starting),i=a.starting.length):!t.nesting.length&&a.ending?(this._push(t,a.ending),i=a.ending.length,t.matches.push(null)):this._push(t,this.$str[r]);else if(!t.nesting.length&&!a.ending){this._push(t,"");var l=this._testChars(t.delims,t,r);if(l!==!1&&(t.matches.push(l),t.matchesi[r]=l,i=l.length||1,!t.options.preserveDelims)){var h=r+(l.length||1);return h===this.$str.length&&this._push(t,""),h}this._push(t,l||this.$str[r])}else{var o=a.starting||a.ending||this.$str[r];i=o.length,this._push(t,o)}}return r+i}}_testQuotes(t,r){var i={};return(t.options.quotes||[]).forEach(s=>{this.$str.substr(r,1)===s&&(t.openQuote?s===t.openQuote&&(t.openQuote=!1,i.ending=s):(t.openQuote=s,i.starting=s))}),i}_testComments(t,r){var i={};return(t.options.comments||[]).forEach(s=>{if(t.openComment){if(ue(s)===ue(t.openComment)){var a=ue(s);this.$str.substr(r).startsWith(a)&&(t.openComment=!1,i.ending=a)}}else{var n=Ue(s);this.$str.substr(r).startsWith(n)&&(t.openComment=s,i.starting=n)}}),i}_testNesting(t,r){var i={};return(t.options.blocks||[]).forEach(s=>{var n=Ue(s);if(this.$str.substr(r).startsWith(n))t.nesting=t.nesting.concat([s]),i.starting=n;else if(t.nesting.length&&ue(s)===ue(ue(t.nesting))){var a=ue(s);this.$str.substr(r).startsWith(a)&&(t.nesting=t.nesting.slice(0,-1),i.ending=a)}}),t.maxDepth=Math.max(t.maxDepth,t.nesting.length),i}_testChars(t,r,i){for(var s=0;s<t.length;s++){var n=t[s];if(T(n)){var a=n(this.$str.substr(0,i),this.$str.substr(i),r.tokens.slice());if(a!==!1)return a}if(r.options.useRegex){var o=this.$str.substr(i).match(new RegExp("^"+n,r.options.useRegex!==!0?r.options.useRegex:""));if(o)return o[0]}if(!r.options.ci&&this.$str.substr(i,n.length)===n||r.options.ci&&this.$str.substr(i,n.length).toLowerCase()===n.toLowerCase())return n}return!1}_push(t,r,i="tokens",s=!1){var n=t.matches.length;if(ee(t.tokens[n])&&(t.tokens[n]=""),i==="comments"){t.tokens[n].comments||(t.tokens[n]=new String(t.tokens[n]),t.tokens[n].comments=[]);var a=t.tokens[n].comments.length-(!t.tokens[n].comments.length||s?0:1);t.tokens[n].comments[a]=(t.tokens[n].comments[a]||"")+r}else{var o=t.tokens[n].comments;t.tokens[n]=t.tokens[n]+r}}split(t,r,i){return this.lex(r,i).tokens}match(t,r,i){return this.lex(r,i).matches}regParse(t,r){return this.lex(t,le({useRegex:!0},r||{}))}regSplit(t,r){return this.regParse(t,r).tokens}regMatch(t,r){return this.regParse(t,r).matches}};B.$blocks=[["(",")"],["[","]"],["{","}"]];B.$quotes=['"',"'","`"];B.$comments=[["/*","*/"],["//",`
3
- `]];B.$cache=Object.create(null);function Ae(e,t={}){let r=ae.call(this);return r.OOHTML||(r.OOHTML={}),r.OOHTML.meta||(r.OOHTML.meta=r.DOM.meta("oohtml",!0)),r.OOHTML.meta.defaults(le(3,e,t)),r.OOHTML.meta}function Fr(e,t,r,i=null){var s=t.split("#")[0].split("/").map(n=>n.trim()).filter(n=>n);return Es(e,s,r,i)}function Mr(e){var t=B.split(e.trim(),[":"]);e=t.shift();var r=t.reduce((i,s)=>{var[n,a]=B.split(s.trim(),[]);return i[n]=br(a,"(",")"),i},{});return[e,r]}function _s(e,t){return t=t.split("#")[0].split("/").map(r=>r.trim()).filter(r=>r),e=e.split("#")[0].split("/").map(r=>r.trim()).filter(r=>r),e.length?e.reduce((r,i,s)=>r?B.split(i.trim(),["|","+"]).reduce((n,o)=>{var[o,u]=Mr(o);o=o.trim();var l=o===t[s];if(!l&&("deep"in u||"deepest"in u)){var h=t.slice(s+1).reduce((m,p,x)=>m>-1&&"deep"in u?m:p===o?x:m,-1);if(h>-1){var f=t.splice(s,h+1);l=!0}}return n||l},!1):!1,!0):!1}var Ss=(e,t)=>B.split(e.trim(),["|","+"],{preserveDelims:!0}).reduce((r,i)=>{var s;return(i.startsWith("|")||i.startsWith("+"))&&(s=i.substr(0,1),i=i.substr(1).trim()),r.theEnd||s==="|"&&r.length?(r.theEnd=!0,r):r.concat(t(i.trim()))},[]).filter(r=>r),Ei=(e,t,r)=>{let i=s=>s.reduce((n,a)=>n.concat(...r(a).values()),[]);return Ss(t,n=>{var[n,a]=Mr(n);return e.reduce((o,u)=>{var l=r(u);n==="*"&&(n="("+l.keys().join("+")+")");var h=yi(n,"(",")")?Ei([u],br(n,"(",")"),r):O(l.get(n),!1),f=[],m=p=>`${p}${f.map(x=>`:${x}(${a[x]})`).join("")}`;return Object.keys(a).forEach(p=>{if(p==="deep"||p==="deepest")for(var x=[u];(p==="deepest"||!h.length)&&(x=i(x)).length;){var b=Ei(x,m(n),r);b.length&&(h=b)}else(p==="having"||p==="not-having")&&(h=h.filter(d=>{var w=Ss(a[p],v=>r(d,v));return p==="not-having"?!w.length:w.length})),f.push(p)}),o.concat(h)},[])})},Es=function(e,t,r,i=null,s=0){if(!t.length)return[];let n=t.shift(),a;n.endsWith(".")&&(a=!0,n=n.substr(0,n.length-1).trim());let o=Ei(e,n,r);if(o.forEach(u=>{y(u,"oohtml").has("queryCallback")&&y(u,"oohtml").get("queryCallback")()}),o.length&&a)return o;if(t.length){let u=Es(o,t.slice(),r,i,s+1);return u===-1?i(o,s,!0):u}return i?i(o,s):o};function Dr(e={}){let t=ae.call(this);if(e.onDomReady){t.DOM.ready(()=>{Dr.call(this,{...e,onDomReady:!1})});return}let r=t.window,i=t.window.document,s=t.DOM.mutations,n=Ae.call(this,{element:{template:"",export:"export",import:"import"},attr:{moduleid:"name",moduleref:"template",exportid:"name",exportgroup:"exportgroup"},api:{templateClass:"",templates:"templates",exports:"exports",moduleref:"template"}},e.params),a="template"+(n.get("element.template")?'[is="'+n.get("element.template")+'"]':"")+"["+r.CSS.escape(n.get("attr.moduleid"))+"]";var o=r.HTMLTemplateElement;if(n.get("api.templateClass")){if(!r[n.get("api.templateClass")])throw new Error('The custom element class "'+n.get("api.templateClass")+'" is not defined!');o=r[n.get("api.templateClass")]}let u=(d,w,v)=>{d==="templatemutation"&&(["addedExports","removedExports"].forEach(_=>{Object.defineProperty(w,_,{value:Object.keys(w[_]).map(C=>({name:C,items:w[_][C]}))})}),["addedTemplates","removedTemplates"].forEach(_=>{Object.defineProperty(w,_,{value:Object.keys(w[_]).map(C=>({name:C,item:w[_][C]}))})})),Object.defineProperty(w,"path",{value:v}),i.dispatchEvent(new r.CustomEvent(d,{detail:w}))},l=(d,w)=>{let v=C=>{d.dispatchEvent(new r.CustomEvent(C,{detail:{path:w}}))};var _=d.getAttribute("src");return new Promise((C,F)=>{r.fetch?r.fetch(_).then(D=>D.ok?D.text():Promise.reject(D.statusText)).then(D=>{d.innerHTML=D,v("load"),u("templatecontentloaded",{template:d},w),C(d)}).catch(D=>{console.error("Error fetching the bundle at "+_+". ("+D+")"),d.innerHTML="",v("loaderror"),u("templatecontentloaderror",{template:d},w),C(d)}):(C(),console.error("Error fetching the bundle at "+_+". (window.fetch() not supported by browser.)"))})},h=(d,w,v,_=null,C=!0)=>{let F=(V,j,be,re)=>{if(!!V.matches){var K,$e;if(V.matches(a)&&(K=V.getAttribute(n.get("attr.moduleid")))&&p(K)){var hr=(v?v+"/":"")+K;be==="removed"?(y(d,"oohtml","templates").delete(K),y(V,"oohtml").get("parentTemplate")===d&&y(V,"oohtml").delete("parentTemplate"),j&&(j.removedTemplates[K]=V)):be==="added"&&(y(d,"oohtml","templates").set(K,V),y(V,"oohtml").set("parentTemplate",d),j&&(j.addedTemplates[K]=V)),h(V,V.content,hr,be,re)}else{let es=jt=>{var Z=jt.getAttribute(n.get("attr.exportgroup"))||"default";be==="removed"?y(d,"oohtml","exports").has(Z)&&(_t(y(d,"oohtml","exports").get(Z),jt),y(d,"oohtml","exports").has(Z).length||y(d,"oohtml","exports").delete(Z),j&&(j.removedExports[Z]||(j.removedExports[Z]=[]),j.removedExports[Z].push(jt))):be==="added"&&(y(d,"oohtml","exports").has(Z)||y(d,"oohtml","exports").set(Z,[]),y(d,"oohtml","exports").get(Z).push(jt),j&&(j.addedExports[Z]||(j.addedExports[Z]=[]),j.addedExports[Z].push(jt)))};if(V.matches(n.get("element.export"))){var $e=V.getAttribute(n.get("attr.exportid"))||"default";O(V.children).forEach(Z=>{Z.setAttribute(n.get("attr.exportgroup"),$e),es(Z)})}else es(V)}}};d.modulemutationsType=_;let D={addedTemplates:Object.create(null),removedTemplates:Object.create(null),addedExports:Object.create(null),removedExports:Object.create(null)};if(O(w.children).forEach(V=>F(V,D,_,C)),C&&u("templatemutation",D,v),_==="added"&&!y(d,"oohtml").get("onLiveMode")){y(d,"oohtml").set("onLiveMode",!0);let V=()=>{if(!d.content.children.length)return y(d,"oohtml").delete("queryCallback"),l(d,v)};d.getAttribute("src")&&(d.getAttribute("loading")==="lazy"?y(d,"oohtml").set("queryCallback",V):f.push(V())),s.onAttrChange(d,j=>{j[0].target.getAttribute(j[0].attributeName)!==j[0].oldValue&&(d.getAttribute("loading")==="lazy"?y(d,"oohtml").set("queryCallback",V):j[0].attributeName==="loading"?y(d,"oohtml").delete("queryCallback"):V())},["src","loading"]);var te=new r.MutationObserver(j=>{let be={addedTemplates:Object.create(null),removedTemplates:Object.create(null),addedExports:Object.create(null),removedExports:Object.create(null)};j.forEach(re=>{re.addedNodes.forEach(K=>F(K,be,"added",!0)),re.removedNodes.forEach(K=>F(K,be,"removed",!0))}),u("templatemutation",be,v)});te.observe(w,{childList:!0})}};if(n.get("api.templates")in i)throw new Error('document already has a "'+n.get("api.templates")+'" property!');let f=[];if(Object.defineProperty(i,n.get("api.templates"),{get:function(){return m(y(i,"oohtml","templates"))}}),n.get("api.templates")in o.prototype)throw new Error('The "HTMLTemplateElement" class already has a "'+n.get("api.templates")+'" property!');if(Object.defineProperty(o.prototype,n.get("api.templates"),{get:function(){return y(this,"oohtml").has("queryCallback")&&y(this,"oohtml").get("queryCallback")(),m(y(this,"oohtml","templates"))}}),n.get("api.exports")in o.prototype)throw new Error('The "HTMLTemplateElement" class already has a "'+n.get("api.exports")+'" property!');Object.defineProperty(o.prototype,n.get("api.exports"),{get:function(){return y(this,"oohtml").has("queryCallback")&&y(this,"oohtml").get("queryCallback")(),m(y(this,"oohtml","exports"))}});let m=d=>Object.defineProperties({},Array.from(d.keys()).reduce((w,v)=>(w[v]={get:()=>d.get(v)},w),{})),p=d=>{var w;return(w=d.match(/([^a-zA-Z0-9\_\-\@])/))?(console.error(`Invalid character "${w}" in the module name: ${d}.`),!1):!0},x=d=>{var w=i.createElement("template");return Fr([i],d,function(v,_){var C=y(v,"oohtml","templates");return arguments.length===1?C:_.startsWith(":")?y(v,"oohtml","exports").get(_.substr(1)):C.get(_)}).forEach(v=>{y(v,"oohtml","templates").forEach((_,C)=>{y(w,"oohtml","templates").set(C,_)}),y(v,"oohtml","exports").forEach((_,C)=>{y(w,"oohtml","exports").has(C)||y(w,"oohtml","exports").set(C,[]),y(w,"oohtml","exports").get(C).push(..._)})}),w};if(O(i.querySelectorAll(a)).forEach(async d=>{var w=d.getAttribute(n.get("attr.moduleid"));!d.closest(n.get("element.import"))&&p(w)&&(y(i,"oohtml","templates").set(w,d),h(d,d.content,w,"added",!1))}),s.onPresenceChange(a,async(d,w)=>{let v={addedTemplates:Object.create(null),removedTemplates:Object.create(null),addedExports:Object.create(null),removedExports:Object.create(null)};d.forEach(_=>{var C=_.getAttribute(n.get("attr.moduleid"));_.closest(n.get("element.import"))||!p(C)||(w?(y(i,"oohtml","templates").set(C,_),h(_,_.content,C,"added"),v.addedTemplates[C]=_):(y(i,"oohtml","templates").get(C)===_&&y(i,"oohtml","templates").delete(C),h(_,_.content,C,"removed"),v.removedTemplates[C]=_))}),u("templatemutation",v,"")}),s.onPresent(n.get("element.import"),d=>{h(d,d,"","added",!1)}),n.get("api.moduleref")in r.Element.prototype)throw new Error('The "Element" class already has a "'+n.get("api.moduleref")+'" property!');Object.defineProperty(r.Element.prototype,n.get("api.moduleref"),{get:function(){var d;if(!y(this,"oohtml").has("module")&&(d=this.getAttribute(n.get("attr.moduleref")))){var w=x(d);y(this,"oohtml").set("module",w)}return y(this,"oohtml").get("module")}});var b=f.length?"loading":"indeterminate";Object.defineProperty(i,"templatesReadyState",{get:()=>b}),t.DOM.ready.call(t,()=>(f.forEach(d=>{d&&d.catch(w=>{console.warn(w)})}),Promise.all(f).then(()=>{b="complete",i.dispatchEvent(new r.Event("templatesreadystatechange"))})))}function Vr(e={}){let t=ae.call(this);if(e.onDomReady){t.DOM.ready(()=>{Vr.call(this,{...e,onDomReady:!1})});return}let r=t.window,i=t.window.document,s=t.DOM.mutations,n=[],a=Ae.call(this,{element:{import:"import"},attr:{importid:"name",exportsearch:"exportsearch"}},e.params);Cs.push(a.get("attr.importid"),a.get("attr.moduleref"));let o="["+r.CSS.escape(a.get("attr.moduleref"))+"]",u="["+r.CSS.escape(a.get("attr.exportgroup"))+"]",l,h=class{static create(p){return y(this.el,"oohtml").get("instance")||new h(p)}constructor(p){this.el=p,y(this.el,"oohtml").set("instance",this);let[x,b]=Mr(p.getAttribute(a.get("attr.importid"))||"default");y(this.el,"oohtml").set("importID",x),y(this.el,"oohtml").set("importModifiers",b)}hydrate(p,x,b){y(this.el,"oohtml").set("anchorNode",p),y(this.el,"oohtml").set("slottedElements",x),y(this.el,"oohtml").set("compositionBlock",b),this._bindSlotted(x),this._connectToCompositionBlock()}connectedCallback(){y(this.el,"oohtml").has("anchorNode")||(y(this.el,"oohtml").set("anchorNode",a.get("isomorphic")?i.createComment(this.el.outerHTML):i.createTextNode("")),y(this.el,"oohtml").set("compositionBlock",this.el.hasAttribute(a.get("attr.moduleref"))?this.el.getAttribute(a.get("attr.moduleref")).trim().startsWith("~")?this.el.parentNode.closest(u):null:this.el.parentNode.closest(o)),this._connectToCompositionBlock()),t.DOM.ready.call(t,()=>{this.resolve("connected")})}_connectToCompositionBlock(){this.compositionBlock&&y(this.compositionBlock,"oohtml","imports").set(this.importID,this.el)}_bindSlotted(p){p.forEach(x=>{x.importReference=this.el}),y(this.el,"oohtml").set("slottedObserver",s.onRemoved(p,(x,b,d,w,v)=>{v&&v.size===p.length&&y(this.el,"oohtml").get("slottedObserver").disconnect(),x.forEach(_=>{_.parentNode||_t(this.slottedElements,_),_.importReference===this.el&&delete _.importReference}),this.slottedElements.length||this.anchorNode.isConnected&&this.anchorNode.replaceWith(this.el)},{maintainCallState:!0,ignoreTransients:!0}))}resolve(p=null){if(!qe(n,_=>this.el.closest(_))){var x=(_,C,F)=>{var D=this.importID,te=this.importModifiers,[V,j]="search"in te||F!==null?("search"in te?te.search:F).split("-").filter(re=>re).map(re=>parseInt(re||0)).concat([0,1e3]):[0,0];let be=re=>re.reduce((K,$e)=>K.concat(y($e,"oohtml","exports").get(D)||[]),[]);return Fr(_,C,function(re,K){var $e=y(re,"oohtml","templates");return arguments.length===1?$e:K.startsWith(":")?y(re,"oohtml","exports").get(K.substr(1)):$e.get(K)},function(re,K,$e){var hr=be(re);return!hr.length&&K>V&&j?(j--,-1):hr})},b,d;if(this.el.hasAttribute(a.get("attr.moduleref")))this.compositionBlock&&y(this.compositionBlock,"oohtml","imports").get(this.importID)===this.el&&y(this.compositionBlock,"oohtml","imports").delete(this.importID),b=this.el;else{if(!this.compositionBlock){console.warn("Scoped slots must be found within template contexts. ["+this.importID+"]",this.el);return}b=this.compositionBlock}var w=b.getAttribute(a.get("attr.moduleref")).trim(),v=this.el.getAttribute(a.get("attr.exportsearch"));b&&(d=x([w.startsWith("~")?this.compositionBlock:i],w,v)).length?St(d,y(this.el,"oohtml").get("originalSlottedElements")||[]).length&&(y(this.el,"oohtml").set("originalSlottedElements",d),this.fill(d)):(y(this.el,"oohtml").set("originalSlottedElements",null),this.empty())}}fill(p){p=O(p,!1).map(x=>x.cloneNode(!0)),this.empty(!0),this.el.isConnected&&this.el.replaceWith(this.anchorNode),p.forEach(x=>{y(x,"oohtml","templates").set("~",this.el),ma(x,this.el),x.getAttribute(a.get("attr.exportgroup"))||x.setAttribute(a.get("attr.exportgroup"),this.importID),this.anchorNode.before(x)}),this._bindSlotted(p),this.slottedElements.push(...p)}empty(p=!1){if(this.slottedElements){var x=this.slottedElements;p&&y(this.el,"oohtml").has("slottedObserver")&&(y(this.el,"oohtml").get("slottedObserver").disconnect(),x=this.slottedElements.splice(0)),x.forEach(b=>b.remove())}}get importID(){return y(this.el,"oohtml").get("importID")}get importModifiers(){return y(this.el,"oohtml").get("importModifiers")}get anchorNode(){return y(this.el,"oohtml").get("anchorNode")}get compositionBlock(){return y(this.el,"oohtml").get("compositionBlock")}get slottedElements(){return y(this.el,"oohtml").has("slottedElements")||y(this.el,"oohtml").set("slottedElements",[]),y(this.el,"oohtml").get("slottedElements")}get exports(){return y(this.el,"oohtml").get("exports")}static get observedAttributes(){return[a.get("attr.importid")]}};s.onPresent(a.get("element.import"),p=>{var x=h.create(p);x.connectedCallback()});let f=(p,x,b=null)=>{let d=(v,_)=>!x||_===x||x===!0&&(v.importModifiers&&"search"in v.importModifiers||v.el.getAttribute(a.get("attr.exportsearch")));if(p.matches(a.get("element.import"))){var w=h.create(p);d(w,w.importID)&&w.resolve(b)}else y(p,"oohtml","imports").forEach((v,_)=>{var C=h.create(v);d(C,_)&&C.resolve(`Resolution scope: ${b}`)})};s.onPresent(o,p=>{qe(n,x=>p.closest(x))||s.onAttrChange(p,x=>{x[0].target.getAttribute(x[0].attributeName)!==x[0].oldValue&&f(p,null,`Attr-Change: ${x[0].attributeName}`)},[a.get("attr.moduleref"),a.get("attr.importid")])}),i.addEventListener("templatemutation",p=>{!p.detail.path||O(i.querySelectorAll("["+r.CSS.escape(a.get("attr.moduleref"))+"]")).forEach(x=>{_s(x.getAttribute(a.get("attr.moduleref")),p.detail.path)&&(f(x,!0,`'templatemutation' event: ${p.detail.path}, search()`),p.detail.addedExports.concat(p.detail.removedExports).forEach(b=>{f(x,b.name,`'templatemutation' event: ${p.detail.path}, ${b.name}`)}))})});let m=()=>{O(i.querySelectorAll(u)).forEach(p=>{if(!y(p.parentNode,"oohtml").get("importsCan")&&!p.importReference){var x=[];p.parentNode.childNodes.forEach(b=>{var d;if(b.nodeType===1&&b.matches(u))x.push(b);else if(b.nodeType===8&&(d=b.nodeValue.trim())&&d.startsWith("<"+a.get("element.import"))&&d.endsWith("</"+a.get("element.import")+">")){var w,v=i.createElement("div");if(v.innerHTML=d,(w=v.firstChild).matches(a.get("element.import"))){var _=w.hasAttribute(a.get("attr.moduleref"))?w.getAttribute(a.get("attr.moduleref")).trim().startsWith("~")?b.parentNode.closest(u):null:b.parentNode.closest(o),C=h.create(w);C.hydrate(b,x,_),x=[]}}}),y(p.parentNode,"oohtml").set("importsCan",!0)}})};t.DOM.ready.call(t,()=>{a.get("isomorphic")&&m()})}function ma(e,t,r=[],i=!0){r=r.concat(Cs),e.hasAttribute("noinherit")&&(r=r.concat((e.getAttribute("noinherit")||"*").split(" ").map(o=>o.trim())));var s=ga.concat(["role","class"]);if(ot(s).forEach(o=>{var u,l;if(!r.includes(o)&&!r.includes("*")&&(u=t.getAttribute(o))){if(l=e.getAttribute(o))var h=i?[l,u]:[u,l];else var h=[u];e.setAttribute(o,ot(h.join(" ").split(" ").map(f=>f.trim())).join(" ")),r.push(o)}}),ot(da.concat("style")).forEach(o=>{var u,l;if(!r.includes(o)&&!r.includes("*")&&(u=t.getAttribute(o))){if(l=e.getAttribute(o)){var h=i?[l,u]:[u,l];h[0].trim().endsWith(";")||(h[0]=h[0]+";")}else var h=[u];e.setAttribute(o,h.join(" ")),r.push(o)}}),!r.includes("*"))for(var n=0;n<t.attributes.length;n++){var a=t.attributes[n];!r.includes(a.name)&&(!e.hasAttribute(a.name)||i)&&e.setAttribute(a.name,a.value)}return e}var Cs=["nocompose"],da=[],ga=[];function jr(e={}){let t=ae.call(this);if(e.onDomReady){t.DOM.ready(()=>{jr.call(this,{...e,onDomReady:!1})});return}let r=t.window,i=t.window.document,s=t.DOM.mutations,n=[],a=Ae.call(this,{attr:{namespace:"namespace",id:"id"},api:{namespace:"namespace"},eagermode:!0},e.params),o=function(l){if(!y(l,"oohtml").has("namespace")){let h=Object.create(null);y(l,"oohtml").set("namespace",h),P.link&&P.link(l,a.get("api.namespace"),h)}return y(l,"oohtml").get("namespace")},u=function(l){if(!y(l,"oohtml").has("publicNamespace")){let h=o(l);y(l,"oohtml").set("publicNamespace",a.get("eagermode")?new Proxy(h,{get(f,m){if(W(m)&&!h[m]){var p=O(l.querySelectorAll("["+r.CSS.escape(a.get("attr.id"))+'="'+m+'"]')).filter(x=>{var b=x.parentNode.closest("["+r.CSS.escape(a.get("attr.namespace"))+"]");return l===i?!b:b===l})[0];p&&P.set(h,m,p)}return h[m]}}):h)}return y(l,"oohtml").get("publicNamespace")};if(a.get("api.namespace")in r.Element.prototype)throw new Error('The "Element" class already has a "'+a.get("api.namespace")+'" property!');if(Object.defineProperty(r.Element.prototype,a.get("api.namespace"),{get:function(){return u(this)}}),a.get("api.namespace")in i)throw new Error('The "document" object already has a "'+a.get("api.namespace")+'" property!');Object.defineProperty(i,a.get("api.namespace"),{get:function(){return u(i)}}),s.onPresent("["+r.CSS.escape(a.get("attr.id"))+"]",l=>{var h=y(l,"oohtml");if(!(h.get("idAlreadyBeingWatched")||qe(n,x=>l.closest(x)))){var f=l.getAttribute(a.get("attr.id")),m=l.parentNode.closest("["+r.CSS.escape(a.get("attr.namespace"))+"]");m||(m=i);var p=o(m);p[f]!==l&&P.set(p,f,l),h.set("idAlreadyBeingWatched",!0),s.onPresenceChange(l,(x,b)=>{b?p[f]!==l&&P.set(p,f,l):p[f]===l&&P.deleteProperty(p,f)})}})}function Br(e={}){let t=ae.call(this);if(e.onDomReady){t.DOM.ready(()=>{Br.call(this,{...e,onDomReady:!1})});return}let r=t.window,i=t.window.document,s=Ae.call(this,{api:{state:"state",setState:"setState",clearState:"clearState"}},e.params),n=function(a,o=null){if(!y(a,"oohtml").has("state")||o){let u=o||Object.create(null),l=y(a,"oohtml").get("state");if(y(a,"oohtml").set("state",u),l&&P.unlink&&P.unlink(a,s.get("api.state"),l),P.link){let h=o?{isUpdate:!!l,oldValue:l}:null;P.link(a,s.get("api.state"),u,h)}}return y(a,"oohtml").get("state")};if(s.get("api.state")in r.Element.prototype)throw new Error('The "Element" class already has a "'+s.get("api.state")+'" property!');if(Object.defineProperty(r.Element.prototype,s.get("api.state"),{get:function(){return P.proxy(n(this))}}),s.get("api.setState")in r.Element.prototype)throw new Error('The "Element" class already has a "'+s.get("api.setState")+'" property!');if(Object.defineProperty(r.Element.prototype,s.get("api.setState"),{value:function(a,o={}){if(!o.update)n(this,a);else{var u=n(this);if(o.update!=="merge"){var l=St(Object.keys(u),Object.keys(a));P.deleteProperty(u,l)}P.set(u,a)}}}),s.get("api.clearState")in r.Element.prototype)throw new Error('The "Element" class already has a "'+s.get("api.clearState")+'" property!');if(Object.defineProperty(r.Element.prototype,s.get("api.clearState"),{value:function(){n(this,{})}}),s.get("api.state")in i)throw new Error('The "document" object already has a "'+s.get("api.state")+'" property!');if(Object.defineProperty(i,s.get("api.state"),{get:function(){return P.proxy(n(i))}}),s.get("api.setState")in i)throw new Error('The "document" object already has a "'+s.get("api.setState")+'" property!');if(Object.defineProperty(i,s.get("api.setState"),{value:function(a,o={}){if(!o.update)n(i,a);else{var u=n(i);if(o.update!=="merge"){var l=St(Object.keys(u),Object.keys(a));P.deleteProperty(u,l)}P.set(u,a)}}}),s.get("api.clearState")in i)throw new Error('The "document" object already has a "'+s.get("api.clearState")+'" property!');Object.defineProperty(i,s.get("api.clearState"),{value:function(){n(i,{})}})}var{stringify:xa}=JSON;if(!String.prototype.repeat)throw new Error("String.prototype.repeat is undefined, see https://github.com/davidbonnet/astring#installation");if(!String.prototype.endsWith)throw new Error("String.prototype.endsWith is undefined, see https://github.com/davidbonnet/astring#installation");var $r={"||":3,"&&":4,"|":5,"??":5,"^":6,"&":7,"==":8,"!=":8,"===":8,"!==":8,"<":9,">":9,"<=":9,">=":9,in:9,instanceof:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"%":12,"/":12,"**":13},_e=17,ya={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:_e,ClassExpression:_e,FunctionExpression:_e,ObjectExpression:_e,UpdateExpression:16,UnaryExpression:15,AwaitExpression:15,BinaryExpression:14,LogicalExpression:13,ConditionalExpression:4,AssignmentExpression:3,YieldExpression:2,RestElement:1};function Ot(e,t){let{generator:r}=e;if(e.write("("),t!=null&&t.length>0){r[t[0].type](t[0],e);let{length:i}=t;for(let s=1;s<i;s++){let n=t[s];e.write(", "),r[n.type](n,e)}}e.write(")")}function Ns(e,t,r,i){let s=e.expressionsPrecedence[t.type];if(s===_e)return!0;let n=e.expressionsPrecedence[r.type];return s!==n?!i&&s===15&&n===14&&r.operator==="**"||s<n:s!==13&&s!==14?!1:t.operator==="**"&&r.operator==="**"?!i:i?$r[t.operator]<=$r[r.operator]:$r[t.operator]<$r[r.operator]}function Ur(e,t,r,i){let{generator:s}=e;Ns(e,t,r,i)?(e.write("("),s[t.type](t,e),e.write(")")):s[t.type](t,e)}function ba(e,t,r,i){let s=t.split(`
4
- `),n=s.length-1;if(e.write(s[0].trim()),n>0){e.write(i);for(let a=1;a<n;a++)e.write(r+s[a].trim()+i);e.write(r+s[n].trim())}}function ie(e,t,r,i){let{length:s}=t;for(let n=0;n<s;n++){let a=t[n];e.write(r),a.type[0]==="L"?e.write("// "+a.value.trim()+`
5
- `,a):(e.write("/*"),ba(e,a.value,r,i),e.write("*/"+i))}}function wa(e){let t=e;for(;t!=null;){let{type:r}=t;if(r[0]==="C"&&r[1]==="a")return!0;if(r[0]==="M"&&r[1]==="e"&&r[2]==="m")t=t.object;else return!1}}function Ci(e,t){let{generator:r}=e,{declarations:i}=t;e.write(t.kind+" ");let{length:s}=i;if(s>0){r.VariableDeclarator(i[0],e);for(let n=1;n<s;n++)e.write(", "),r.VariableDeclarator(i[n],e)}}var ks,As,Ps,Os,Is,Ts,va={Program(e,t){let r=t.indent.repeat(t.indentLevel),{lineEnd:i,writeComments:s}=t;s&&e.comments!=null&&ie(t,e.comments,r,i);let n=e.body,{length:a}=n;for(let o=0;o<a;o++){let u=n[o];s&&u.comments!=null&&ie(t,u.comments,r,i),t.write(r),this[u.type](u,t),t.write(i)}s&&e.trailingComments!=null&&ie(t,e.trailingComments,r,i)},BlockStatement:Ts=function(e,t){let r=t.indent.repeat(t.indentLevel++),{lineEnd:i,writeComments:s}=t,n=r+t.indent;t.write("{");let a=e.body;if(a!=null&&a.length>0){t.write(i),s&&e.comments!=null&&ie(t,e.comments,n,i);let{length:o}=a;for(let u=0;u<o;u++){let l=a[u];s&&l.comments!=null&&ie(t,l.comments,n,i),t.write(n),this[l.type](l,t),t.write(i)}t.write(r)}else s&&e.comments!=null&&(t.write(i),ie(t,e.comments,n,i),t.write(r));s&&e.trailingComments!=null&&ie(t,e.trailingComments,n,i),t.write("}"),t.indentLevel--},ClassBody:Ts,StaticBlock(e,t){t.write("static "),this.BlockStatement(e,t)},EmptyStatement(e,t){t.write(";")},ExpressionStatement(e,t){let r=t.expressionsPrecedence[e.expression.type];r===_e||r===3&&e.expression.left.type[0]==="O"?(t.write("("),this[e.expression.type](e.expression,t),t.write(")")):this[e.expression.type](e.expression,t),t.write(";")},IfStatement(e,t){t.write("if ("),this[e.test.type](e.test,t),t.write(") "),this[e.consequent.type](e.consequent,t),e.alternate!=null&&(t.write(" else "),this[e.alternate.type](e.alternate,t))},LabeledStatement(e,t){this[e.label.type](e.label,t),t.write(": "),this[e.body.type](e.body,t)},BreakStatement(e,t){t.write("break"),e.label!=null&&(t.write(" "),this[e.label.type](e.label,t)),t.write(";")},ContinueStatement(e,t){t.write("continue"),e.label!=null&&(t.write(" "),this[e.label.type](e.label,t)),t.write(";")},WithStatement(e,t){t.write("with ("),this[e.object.type](e.object,t),t.write(") "),this[e.body.type](e.body,t)},SwitchStatement(e,t){let r=t.indent.repeat(t.indentLevel++),{lineEnd:i,writeComments:s}=t;t.indentLevel++;let n=r+t.indent,a=n+t.indent;t.write("switch ("),this[e.discriminant.type](e.discriminant,t),t.write(") {"+i);let{cases:o}=e,{length:u}=o;for(let l=0;l<u;l++){let h=o[l];s&&h.comments!=null&&ie(t,h.comments,n,i),h.test?(t.write(n+"case "),this[h.test.type](h.test,t),t.write(":"+i)):t.write(n+"default:"+i);let{consequent:f}=h,{length:m}=f;for(let p=0;p<m;p++){let x=f[p];s&&x.comments!=null&&ie(t,x.comments,a,i),t.write(a),this[x.type](x,t),t.write(i)}}t.indentLevel-=2,t.write(r+"}")},ReturnStatement(e,t){t.write("return"),e.argument&&(t.write(" "),this[e.argument.type](e.argument,t)),t.write(";")},ThrowStatement(e,t){t.write("throw "),this[e.argument.type](e.argument,t),t.write(";")},TryStatement(e,t){if(t.write("try "),this[e.block.type](e.block,t),e.handler){let{handler:r}=e;r.param==null?t.write(" catch "):(t.write(" catch ("),this[r.param.type](r.param,t),t.write(") ")),this[r.body.type](r.body,t)}e.finalizer&&(t.write(" finally "),this[e.finalizer.type](e.finalizer,t))},WhileStatement(e,t){t.write("while ("),this[e.test.type](e.test,t),t.write(") "),this[e.body.type](e.body,t)},DoWhileStatement(e,t){t.write("do "),this[e.body.type](e.body,t),t.write(" while ("),this[e.test.type](e.test,t),t.write(");")},ForStatement(e,t){if(t.write("for ("),e.init!=null){let{init:r}=e;r.type[0]==="V"?Ci(t,r):this[r.type](r,t)}t.write("; "),e.test&&this[e.test.type](e.test,t),t.write("; "),e.update&&this[e.update.type](e.update,t),t.write(") "),this[e.body.type](e.body,t)},ForInStatement:ks=function(e,t){t.write(`for ${e.await?"await ":""}(`);let{left:r}=e;r.type[0]==="V"?Ci(t,r):this[r.type](r,t),t.write(e.type[3]==="I"?" in ":" of "),this[e.right.type](e.right,t),t.write(") "),this[e.body.type](e.body,t)},ForOfStatement:ks,DebuggerStatement(e,t){t.write("debugger;",e)},FunctionDeclaration:As=function(e,t){t.write((e.async?"async ":"")+(e.generator?"function* ":"function ")+(e.id?e.id.name:""),e),Ot(t,e.params),t.write(" "),this[e.body.type](e.body,t)},FunctionExpression:As,VariableDeclaration(e,t){Ci(t,e),t.write(";")},VariableDeclarator(e,t){this[e.id.type](e.id,t),e.init!=null&&(t.write(" = "),this[e.init.type](e.init,t))},ClassDeclaration(e,t){if(t.write("class "+(e.id?`${e.id.name} `:""),e),e.superClass){t.write("extends ");let{superClass:r}=e,{type:i}=r,s=t.expressionsPrecedence[i];(i[0]!=="C"||i[1]!=="l"||i[5]!=="E")&&(s===_e||s<t.expressionsPrecedence.ClassExpression)?(t.write("("),this[e.superClass.type](r,t),t.write(")")):this[r.type](r,t),t.write(" ")}this.ClassBody(e.body,t)},ImportDeclaration(e,t){t.write("import ");let{specifiers:r}=e,{length:i}=r,s=0;if(i>0){for(;s<i;){s>0&&t.write(", ");let n=r[s],a=n.type[6];if(a==="D")t.write(n.local.name,n),s++;else if(a==="N")t.write("* as "+n.local.name,n),s++;else break}if(s<i){for(t.write("{");;){let n=r[s],{name:a}=n.imported;if(t.write(a,n),a!==n.local.name&&t.write(" as "+n.local.name),++s<i)t.write(", ");else break}t.write("}")}t.write(" from ")}this.Literal(e.source,t),t.write(";")},ImportExpression(e,t){t.write("import("),this[e.source.type](e.source,t),t.write(")")},ExportDefaultDeclaration(e,t){t.write("export default "),this[e.declaration.type](e.declaration,t),t.expressionsPrecedence[e.declaration.type]!=null&&e.declaration.type[0]!=="F"&&t.write(";")},ExportNamedDeclaration(e,t){if(t.write("export "),e.declaration)this[e.declaration.type](e.declaration,t);else{t.write("{");let{specifiers:r}=e,{length:i}=r;if(i>0)for(let s=0;;){let n=r[s],{name:a}=n.local;if(t.write(a,n),a!==n.exported.name&&t.write(" as "+n.exported.name),++s<i)t.write(", ");else break}t.write("}"),e.source&&(t.write(" from "),this.Literal(e.source,t)),t.write(";")}},ExportAllDeclaration(e,t){e.exported!=null?t.write("export * as "+e.exported.name+" from "):t.write("export * from "),this.Literal(e.source,t),t.write(";")},MethodDefinition(e,t){e.static&&t.write("static ");let r=e.kind[0];(r==="g"||r==="s")&&t.write(e.kind+" "),e.value.async&&t.write("async "),e.value.generator&&t.write("*"),e.computed?(t.write("["),this[e.key.type](e.key,t),t.write("]")):this[e.key.type](e.key,t),Ot(t,e.value.params),t.write(" "),this[e.value.body.type](e.value.body,t)},ClassExpression(e,t){this.ClassDeclaration(e,t)},ArrowFunctionExpression(e,t){t.write(e.async?"async ":"",e);let{params:r}=e;r!=null&&(r.length===1&&r[0].type[0]==="I"?t.write(r[0].name,r[0]):Ot(t,e.params)),t.write(" => "),e.body.type[0]==="O"?(t.write("("),this.ObjectExpression(e.body,t),t.write(")")):this[e.body.type](e.body,t)},ThisExpression(e,t){t.write("this",e)},Super(e,t){t.write("super",e)},RestElement:Ps=function(e,t){t.write("..."),this[e.argument.type](e.argument,t)},SpreadElement:Ps,YieldExpression(e,t){t.write(e.delegate?"yield*":"yield"),e.argument&&(t.write(" "),this[e.argument.type](e.argument,t))},AwaitExpression(e,t){t.write("await ",e),Ur(t,e.argument,e)},TemplateLiteral(e,t){let{quasis:r,expressions:i}=e;t.write("`");let{length:s}=i;for(let a=0;a<s;a++){let o=i[a],u=r[a];t.write(u.value.raw,u),t.write("${"),this[o.type](o,t),t.write("}")}let n=r[r.length-1];t.write(n.value.raw,n),t.write("`")},TemplateElement(e,t){t.write(e.value.raw,e)},TaggedTemplateExpression(e,t){Ur(t,e.tag,e),this[e.quasi.type](e.quasi,t)},ArrayExpression:Is=function(e,t){if(t.write("["),e.elements.length>0){let{elements:r}=e,{length:i}=r;for(let s=0;;){let n=r[s];if(n!=null&&this[n.type](n,t),++s<i)t.write(", ");else{n==null&&t.write(", ");break}}}t.write("]")},ArrayPattern:Is,ObjectExpression(e,t){let r=t.indent.repeat(t.indentLevel++),{lineEnd:i,writeComments:s}=t,n=r+t.indent;if(t.write("{"),e.properties.length>0){t.write(i),s&&e.comments!=null&&ie(t,e.comments,n,i);let a=","+i,{properties:o}=e,{length:u}=o;for(let l=0;;){let h=o[l];if(s&&h.comments!=null&&ie(t,h.comments,n,i),t.write(n),this[h.type](h,t),++l<u)t.write(a);else break}t.write(i),s&&e.trailingComments!=null&&ie(t,e.trailingComments,n,i),t.write(r+"}")}else s?e.comments!=null?(t.write(i),ie(t,e.comments,n,i),e.trailingComments!=null&&ie(t,e.trailingComments,n,i),t.write(r+"}")):e.trailingComments!=null?(t.write(i),ie(t,e.trailingComments,n,i),t.write(r+"}")):t.write("}"):t.write("}");t.indentLevel--},Property(e,t){e.method||e.kind[0]!=="i"?this.MethodDefinition(e,t):(e.shorthand||(e.computed?(t.write("["),this[e.key.type](e.key,t),t.write("]")):this[e.key.type](e.key,t),t.write(": ")),this[e.value.type](e.value,t))},PropertyDefinition(e,t){e.static&&t.write("static "),this[e.key.type](e.key,t),e.value!=null&&(t.write(" = "),this[e.value.type](e.value,t))},ObjectPattern(e,t){if(t.write("{"),e.properties.length>0){let{properties:r}=e,{length:i}=r;for(let s=0;this[r[s].type](r[s],t),++s<i;)t.write(", ")}t.write("}")},SequenceExpression(e,t){Ot(t,e.expressions)},UnaryExpression(e,t){if(e.prefix){let{operator:r,argument:i,argument:{type:s}}=e;t.write(r);let n=Ns(t,i,e);!n&&(r.length>1||s[0]==="U"&&(s[1]==="n"||s[1]==="p")&&i.prefix&&i.operator[0]===r&&(r==="+"||r==="-"))&&t.write(" "),n?(t.write(r.length>1?" (":"("),this[s](i,t),t.write(")")):this[s](i,t)}else this[e.argument.type](e.argument,t),t.write(e.operator)},UpdateExpression(e,t){e.prefix?(t.write(e.operator),this[e.argument.type](e.argument,t)):(this[e.argument.type](e.argument,t),t.write(e.operator))},AssignmentExpression(e,t){this[e.left.type](e.left,t),t.write(" "+e.operator+" "),this[e.right.type](e.right,t)},AssignmentPattern(e,t){this[e.left.type](e.left,t),t.write(" = "),this[e.right.type](e.right,t)},BinaryExpression:Os=function(e,t){let r=e.operator==="in";r&&t.write("("),Ur(t,e.left,e,!1),t.write(" "+e.operator+" "),Ur(t,e.right,e,!0),r&&t.write(")")},LogicalExpression:Os,ConditionalExpression(e,t){let{test:r}=e,i=t.expressionsPrecedence[r.type];i===_e||i<=t.expressionsPrecedence.ConditionalExpression?(t.write("("),this[r.type](r,t),t.write(")")):this[r.type](r,t),t.write(" ? "),this[e.consequent.type](e.consequent,t),t.write(" : "),this[e.alternate.type](e.alternate,t)},NewExpression(e,t){t.write("new ");let r=t.expressionsPrecedence[e.callee.type];r===_e||r<t.expressionsPrecedence.CallExpression||wa(e.callee)?(t.write("("),this[e.callee.type](e.callee,t),t.write(")")):this[e.callee.type](e.callee,t),Ot(t,e.arguments)},CallExpression(e,t){let r=t.expressionsPrecedence[e.callee.type];r===_e||r<t.expressionsPrecedence.CallExpression?(t.write("("),this[e.callee.type](e.callee,t),t.write(")")):this[e.callee.type](e.callee,t),e.optional&&t.write("?."),Ot(t,e.arguments)},ChainExpression(e,t){this[e.expression.type](e.expression,t)},MemberExpression(e,t){let r=t.expressionsPrecedence[e.object.type];r===_e||r<t.expressionsPrecedence.MemberExpression?(t.write("("),this[e.object.type](e.object,t),t.write(")")):this[e.object.type](e.object,t),e.computed?(e.optional&&t.write("?."),t.write("["),this[e.property.type](e.property,t),t.write("]")):(e.optional?t.write("?."):t.write("."),this[e.property.type](e.property,t))},MetaProperty(e,t){t.write(e.meta.name+"."+e.property.name,e)},Identifier(e,t){t.write(e.name,e)},PrivateIdentifier(e,t){t.write(`#${e.name}`,e)},Literal(e,t){e.raw!=null?t.write(e.raw,e):e.regex!=null?this.RegExpLiteral(e,t):e.bigint!=null?t.write(e.bigint+"n",e):t.write(xa(e.value),e)},RegExpLiteral(e,t){let{regex:r}=e;t.write(`/${r.pattern}/${r.flags}`,e)}},Sa={};var ki=class{constructor(t){let r=t??Sa;this.output="",r.output!=null?(this.output=r.output,this.write=this.writeToStream):this.output="",this.generator=r.generator!=null?r.generator:va,this.expressionsPrecedence=r.expressionsPrecedence!=null?r.expressionsPrecedence:ya,this.indent=r.indent!=null?r.indent:" ",this.lineEnd=r.lineEnd!=null?r.lineEnd:`
6
- `,this.indentLevel=r.startingIndentLevel!=null?r.startingIndentLevel:0,this.writeComments=r.comments?r.comments:!1,r.sourceMap!=null&&(this.write=r.output==null?this.writeAndMap:this.writeToStreamAndMap,this.sourceMap=r.sourceMap,this.line=1,this.column=0,this.lineEndSize=this.lineEnd.split(`
7
- `).length-1,this.mapping={original:null,generated:this,name:void 0,source:r.sourceMap.file||r.sourceMap._file})}write(t){this.output+=t}writeToStream(t){this.output.write(t)}writeAndMap(t,r){this.output+=t,this.map(t,r)}writeToStreamAndMap(t,r){this.output.write(t),this.map(t,r)}map(t,r){if(r!=null){let{type:n}=r;if(n[0]==="L"&&n[2]==="n"){this.column=0,this.line++;return}if(r.loc!=null){let{mapping:a}=this;a.original=r.loc.start,a.name=r.name,this.sourceMap.addMapping(a)}if(n[0]==="T"&&n[8]==="E"||n[0]==="L"&&n[1]==="i"&&typeof r.value=="string"){let{length:a}=t,{column:o,line:u}=this;for(let l=0;l<a;l++)t[l]===`
8
- `?(o=0,u++):o++;this.column=o,this.line=u;return}}let{length:i}=t,{lineEnd:s}=this;i>0&&(this.lineEndSize>0&&(s.length===1?t[i-1]===s:t.endsWith(s))?(this.line+=this.lineEndSize,this.column=0):this.column+=i)}toString(){return this.output}};function Rs(e,t){let r=new ki(t);return r.generator[e.type](e,r),r.output}var se=class{constructor(t,r){this.id=t,Object.assign(this,r),this.dependencies=0}with(t,r){let i={};Object.keys(t).forEach(n=>{i[n]=this[n],this[n]=t[n]});let s=r();return Object.keys(t).forEach(n=>{this[n]=i[n]}),s}inUse(t){return arguments.length?(t?this.dependencies++:this.dependencies--,this):this.dependencies>0}};var mt=class extends se{constructor(t,r,i={}){super(r,i),this.ownerContract=t,this.refs=new Set,this.propertyStack=[],this.embeddingReference=null}withProperty(t,r){this.propertyStack.unshift(t);let i=this.embeddingReference?this.embeddingReference.withProperty(t,r):r();return this.propertyStack.shift(),i}get lineage(){return`${this.ownerContract.lineage}:${this.id}`}toJson(t=!1){return{id:this.id,type:this.type,kind:this.kind,refs:Array.from(this.refs).map(r=>r.toJson(t)),contractId:this.ownerContract.id}}};var g={tryStmt(e,t,r,i){return{type:"TryStatement",block:e,handler:t,finalizer:r,guardedHandlers:i}},catchClause(e,t){return{type:"CatchClause",param:e,body:t}},throwStmt(e){return{type:"ThrowStatement",argument:e}},returnStmt(e){return{type:"ReturnStatement",argument:e}},exprStmt(e){return{type:"ExpressionStatement",expression:e}},blockStmt(e){return{type:"BlockStatement",body:e}},labeledStmt(e,t){return{type:"LabeledStatement",label:e,body:t}},withStmt(e,t){return{type:"WithStatement",object:e,body:t}},ifStmt(e,t,r){return this.condExpr(e,t,r,"IfStatement")},switchStmt(e,t,r=!1){return{type:"SwitchStatement",discriminant:e,cases:t}},switchCase(e,t){return{type:"SwitchCase",test:e,consequent:t}},whileStmt(e,t){return{type:"WhileStatement",test:e,body:t}},doWhileStmt(e,t){return{type:"DoWhileStatement",test:e,body:t}},forStmt(e,t,r,i){return{type:"ForStatement",init:e,test:t,update:r,body:i}},forInStmt(e,t,r){return{type:"ForInStatement",left:e,right:t,body:r}},forOfStmt(e,t,r){return{type:"ForOfStatement",left:e,right:t,body:r}},breakStmt(e=null){return{type:"BreakStatement",label:e}},continueStmt(e=null){return{type:"ContinueStatement",label:e}},varDeclaration(e,t){return{type:"VariableDeclaration",kind:e,declarations:t}},varDeclarator(e,t=null){return{type:"VariableDeclarator",id:e,init:t}},funcDeclaration(e,t,r,i=!1,s=!1,n=!1){return this.func("FunctionDeclaration",...arguments)},sequenceExpr(e){return{type:"SequenceExpression",expressions:e}},parensExpr(e){return{type:"ParenthesizedExpression",expression:e}},logicalExpr(e,t,r){return{type:"LogicalExpression",operator:e,left:t,right:r}},binaryExpr(e,t,r){return{type:"BinaryExpression",operator:e,left:t,right:r}},unaryExpr(e,t,r=!0){return{type:"UnaryExpression",operator:e,argument:t,prefix:r}},updateExpr(e,t,r=!1){return{type:"UpdateExpression",operator:e,argument:t,prefix:r}},assignmentExpr(e,t,r="="){return{type:"AssignmentExpression",operator:r,left:e,right:t}},assignmentPattern(e,t){return{type:"AssignmentPattern",left:e,right:t}},thisExpr(){return{type:"ThisExpression"}},condExpr(e,t,r,i="ConditionalExpression"){return{type:i,test:e,consequent:t,alternate:r}},arrayExpr(e){return{type:"ArrayExpression",elements:e}},arrayPattern(e){return{type:"ArrayPattern",elements:e}},objectExpr(e){return{type:"ObjectExpression",properties:e}},objectPattern(e){return{type:"ObjectPattern",properties:e}},chainExpr(e){return{type:"ChainExpression",expression:e}},callExpr(e,t,r=!1){return{type:"CallExpression",callee:e,arguments:t,optional:r}},newExpr(e,t){return{type:"NewExpression",callee:e,arguments:t}},awaitExpr(e){return{type:"AwaitExpression",argument:e}},taggedTemplateExpr(e,t){return{type:"TaggedTemplateExpression",tag:e,quasi:t}},memberExpr(e,t,r=!1,i=!1){return{type:"MemberExpression",object:e,property:t,computed:r,optional:i}},funcExpr(e,t,r,i=!1,s=!1,n=!1){return this.func("FunctionExpression",...arguments)},arrowFuncExpr(e,t,r,i=!1,s=!1,n=!1){return this.func("ArrowFunctionExpression",...arguments)},func(e,t,r,i,s=!1,n=!1,a=!1){return{type:e,id:t,params:r,body:i,async:s,expression:n,generator:a}},identifier(e){return{type:"Identifier",name:e}},property(e,t,r="init",i=!1,s=!1,n=!1){return{type:"Property",key:e,value:t,kind:r,shorthand:i,computed:s,method:n}},methodDefinition(e,t,r="method",i=!1,s=!1){return{type:"MethodDefinition",key:e,value:t,kind:r,static:i,computed:s}},spreadElement(e){return{type:"SpreadElement",argument:e}},literal(e){return{type:"Literal",value:e}},templateLiteral(e,t){return{type:"TemplateLiteral",quasis:e,expressions:t}},invert(e){return this.unaryExpr("!",e)},clone(e){return e={...e},delete e.start,delete e.end,e}};var me=class extends se{constructor(t,r,i){super(r,i),this.ownerContext=t}generate(){if(!this.expr)return[this.expr,this];let t=g.identifier(this.ownerContext.getSubscriptIdentifier("$contract",!0)),r=g.memberExpr(g.memberExpr(t,g.identifier("memo")),g.literal(this.id),!0);return this.composed=g.assignmentExpr(r,this.expr),[this.composed,this]}toJson(t=!1){return{id:this.id}}};var dt=class extends se{constructor(t,r,i){super(r,i),this.ownerReference=t,this.condition=this.ownerContract.currentCondition,this.path=[],this.isDotSafe=!0}get ownerContract(){return this.ownerReference.ownerContract}push(...t){return this.doIsDotSafe(t),this.path.push(...t),this}unshift(...t){return this.doIsDotSafe(t),this.path.unshift(...t),this}doIsDotSafe(t){t.some(r=>r instanceof me||(r.name+"").includes("."))&&(this.isDotSafe=!1)}match(t){let r=(a,o)=>!a||!o?!1:a instanceof me&&o instanceof me?a.id===o.id:a.name===o.name,i=this.path,s=Array.isArray(t)?t:t.path,n=i.length-s.length;return n>0&&([i,s]=[s,i]),[i.reduce((a,o,u)=>a&&r(o,s[u]),!0),n]}toJson(t=!1){return{id:this.id,path:this.path.map(r=>r instanceof me?{memoId:r.id}:r),$path:this.isDotSafe?this.path.map(r=>r.name).join("."):void 0,condition:(this.condition||{}).lineage,referenceId:this.ownerReference.id}}};var Gt=class extends dt{constructor(t,r,i){super(t,r,i),this.subscriptions=new Map,this.$subscriptions=new Map,this.updates=new Map}subscribe(t,r,i=!1){let s=i?this.$subscriptions:this.subscriptions,n=s.get(t);n||(n=new Set,s.set(t,n)),n.add(r),this.updates.forEach(a=>a.forEach(o=>{o.subscribe(t,r,i)}))}update(t,r,i){let s=this.updates.get(t);s||(s=new Set,this.updates.set(t,s)),s.add(r),i&&this.subscriptions.forEach((n,a)=>n.forEach(o=>{r.subscribe(a,o,!0)}))}toJson(t=!1){let{id:r,condition:i,referenceId:s,...n}=super.toJson(t),a={},o={};return this.subscriptions.forEach((u,l)=>{a[l.lineage]=Array.from(u).map(h=>h.id)}),this.$subscriptions.forEach((u,l)=>{o[l.lineage]=Array.from(u).map(h=>h.id)}),{id:r,...n,depth:this.depth.map(u=>u instanceof me?{memoId:u.id}:u),subscriptions:a,$subscriptions:o,condition:i,referenceId:s}}};var Pe=class extends mt{constructor(t,r,i){super(t,r,i),this.destructuringStack=[]}withDestructure(t,r){this.destructuringStack.push(t);let i=r();return this.destructuringStack.pop(),i}addRef(t={}){let r=new Gt(this,this.refs.size,{...t,condition:this.condition,depth:this.destructuringStack.slice(0)});return r.push(...this.propertyStack),this.refs.add(r),r}doSubscribe(t,r){let i=new Set(r);return this.refs.forEach((s,n)=>{i.forEach(a=>{let[o,u]=s.match(a);if(o&&u<=0){if(this.kind==="const")return;s.subscribe(t,a),this.inUse(!0),s.condition&&s.condition.inUse(!0),i.delete(a)}})}),[...i]}doUpdate(t,r,i){let s=new Set(r);return t===this?[...s]:(this.refs.forEach((n,a)=>{s.forEach(o=>{let[u,l]=n.match(o);if(u&&l>=0){if(this.kind==="const")throw new Error("Assignment to a constant declaration.");n.update(t,o,i),s.delete(o)}})}),[...s])}inUse(t){let r=super.inUse(...arguments);return this.ownerContract.inUse(...arguments),r}};var Kt=class extends dt{};var et=class extends mt{addRef(t){let r=new Kt(this,this.refs.size,{...t,condition:this.condition});return r.push(...this.propertyStack),this.refs.add(r),r}setAssignee(t){this.assignee=t}toJson(t=!1){let r=super.toJson(t);return this.assignee&&(r.assignee=this.assignee.id),r}};var It=class extends se{constructor(t,r,i={}){super(r,i),this.ownerContext=t,this.ownerScope=t&&(t.currentScope||t.ownerScope),this.effectReferences=[]}pushEffectReference(t){this.effectReferences.push(t)}doSubscribe(t,r=null){if(r=this.effectReferences.reduce((i,s)=>s.doSubscribe(t,i),r||[...t.refs]),!r.length)return!0;if(!this.ownerScope||["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"].includes(this.type))return r=this.ownerContext.references.reduce((i,s)=>s instanceof Pe?s.doSubscribe(t,i):i,r),r.length?this.ownerContext.effectReference({},i=>(r.forEach(s=>{this.canObserveGlobal(s)&&i.addRef().push(...s.path)}),t.inUse(!0),i.doSubscribe(t,r),!0),!1):!0;if(this.ownerScope)return this.ownerScope.doSubscribe(t,r)}doUpdate(t,r=null){if(r=this.effectReferences.reduce((i,s)=>s.doUpdate(t,i),r||[...t.refs]),!this.ownerScope||["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"].includes(this.type)){if(t.type==="VariableDeclaration")return;t.ownerContract.$sideEffects=!0;let i=r.length&&r||[...t.refs];return this.ownerContext.sideEffects.push({reference:t,remainderRefs:i}),!0}if(!r.length)return!0;if(this.ownerScope)return this.ownerScope.doUpdate(t,r)}doSideEffectUpdates(t,r){if(this.effectReferences.forEach(i=>{let s=i.doUpdate(t,r,!0);i.type==="VariableDeclaration"&&(r=s)}),!r.length)return!0;if(!this.ownerScope||["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"].includes(this.type))return this.ownerContext.sideEffects.push({reference:t,remainderRefs:r,isSideEffects:!0}),!0;if(this.ownerScope)return this.ownerScope.doSideEffectUpdates(t,r)}canObserveGlobal(t){return(!this.ownerContext.$params.globalsOnlyPaths||t.path.length>1)&&!(this.ownerContext.$params.globalsNoObserve||[]).includes(t.path[0].name)}};var gt=class extends se{constructor(t,r,i){super(r,i),this.ownerContext=t,this.ownerContract=t.currentContract||t,this.parent=t.currentCondition}inUse(t){let r=super.inUse(...arguments),i=[];return this.switch?i.push(this.switch,...this.cases):(this.when||this.whenNot)&&i.push(this.when||this.whenNot),i.forEach(s=>s.inUse(...arguments)),r}get lineage(){return`${this.ownerContract.lineage}:${this.id}`}toJson(t=!1){let r={id:this.id};return this.switch?(r.switch=this.switch.id,r.cases=this.cases.map(i=>i.id)):this.whenNot?r.whenNot=this.whenNot.id:this.when&&(r.when=this.when.id),this.parent&&(this.parent.ownerContract.id===this.ownerContract.id?r.parent=this.parent.id:r.parent=`${this.parent.ownerContract.lineage}:${this.parent.id}`),r}};var Oe=class extends se{constructor(t,r,i){super(r,i),this.ownerContext=t,this.ownerContract=t&&(t.currentContract||t),this.ownerScope=t&&(t.currentScope||t.ownerScope),this.subscriptIdentifiers={},this.references=[],this.referenceStack=[],this.entries=[],this.entryStack=[],this.memos=[],this._hoistedAwaitKeyword=void 0,this._hoistedExitStatements=new Map,this._nextIds={},this.sideEffects=[],this.$sideEffects=!1}get $params(){return this.params||this.ownerContract&&this.ownerContract.$params}nextId(t){return this.ownerContext?this.ownerContext.nextId(t):(t="",typeof this._nextIds[t]>"u"&&(this._nextIds[t]=0),this._nextIds[t]++)}closest(t=null,r=!1,i=-1){if(!arguments.length)return this.ownerContract;let s=i+1;if(typeof t=="function"?t(this,s):[].concat(t).some(n=>n===this.type))return r?{instance:this,level:s}:this;if(this.ownerContract)return this.ownerContract.closest(t,r,s)}closestContext(t=!1){return this.closest(r=>r instanceof Ie,t)}closestFunction(t=!1){return this.closest(["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"],t)}defineSubscriptIdentifier(t,r,i=[]){this.subscriptIdentifiers[t]={whitelist:r,blacklist:i,toString(){return this.whitelist[0]}}}getSubscriptIdentifier(t,r=!1){return this.subscriptIdentifiers[t]||r&&this.ownerContract&&this.ownerContract.getSubscriptIdentifier(t,r)}subscriptIdentifiersNoConflict(t){if(t.type!=="Identifier")throw new Error(`An implied Identifier is of type ${t.type}`);for(let r in this.subscriptIdentifiers){let i=this.subscriptIdentifiers[r],s=i.whitelist.indexOf(t.name);s!==-1&&(i.blacklist.push(i.whitelist.splice(s,1)),i.whitelist.length||(i.whitelist=i.blacklist.map(n=>{let a;do{let o=String.fromCharCode(0|Math.random()*26+97);a=`${n}${o}`}while(i.blacklist.includes(a));return a})))}this.ownerContract&&this.ownerContract.subscriptIdentifiersNoConflict(t)}get currentReference(){return this.referenceStack[0]}pushReference(t,r){this.references.unshift(t);let i=this.currentReference;this.referenceStack.unshift(t);let s=r(t,i);if(this.referenceStack.shift()!==t)throw new Error("Reference stack corrupted.");return s}signalReference(t,r,i=!0){let s=new et(this,this.nextId("causes"),t),n=this.pushReference(s,r),a=this.closestContext(),o=a.currentScope||a.ownerScope;return(!s.refs.size||i&&!o.doSubscribe(s))&&(this.references=this.references.filter(u=>u!==s)),n}effectReference(t,r,i=!0){let s=new Pe(this,this.nextId("affecteds"),t),n=this.pushReference(s,r),a=this.closestContext(),o=a.currentScope||a.ownerScope;return o.pushEffectReference(s),s.refs.size?(s.type!=="VariableDeclaration"||s.kind==="var")&&i&&o.doUpdate(s):this.references=this.references.filter(u=>u!==s),n}chainableReference(t,r){return this.currentReference&&this.currentReference.propertyStack.length?r():this.signalReference(t,r)}embeddableSignalReference(t,r){return this.currentReference&&this.signalReference(t,(i,s)=>(i.embeddingReference=s,r(i,s)))}embeddableEffectReference(t,r){return this.effectReference(t,(i,s)=>(i.embeddingReference=s,r(i,s)))}get currentScope(){return this.entryStack.reduce((t,r)=>t||r instanceof It&&r,null)}get currentCondition(){return this.entryStack.reduce((t,r)=>t||r instanceof gt&&r,null)||this.closestFunction()!==this&&this.ownerContext&&this.ownerContext.currentCondition}get currentContext(){return this.entryStack.reduce((t,r)=>t||r instanceof Ie&&r,null)}get currentContract(){return this.entryStack.reduce((t,r)=>t||r instanceof Oe&&r,null)}get currentEntry(){return this.entryStack[0]}pushEntry(t,r){this.entries.unshift(t),this.entryStack.unshift(t);let i=r(t);return this.entryStack.shift(),t instanceof Oe&&!t.generatable()&&(this.entries=this.entries.filter(s=>s!==t)),i}createScope(t,r){let i=new It(this,this.nextId("scope"),t);return this.pushEntry(i,r)}createCondition(t,r){let i=new gt(this,this.nextId("condition"),t);return this.pushEntry(i,r)}defineContext(t,r){let i=new Ie(this,this.nextId("context"),t);return this.pushEntry(i,r)}defineContract(t,r){let i=new Oe(this,this.nextId("contract"),t);return this.pushEntry(i,r)}defineMemo(t){let r=new me(this,this.nextId("memo"),t);return this.memos.unshift(r),r}getLabelInfo(){let t=this.type,r,i;return(this.ownerScope||{}).label?{label:{name:r},type:i}=this.ownerScope:t==="Iteration"&&this.ownerContract.ownerScope.label&&({label:{name:r},type:i}=this.ownerContract.ownerScope),{type:t,label:r,target:i}}get hoistedAwaitKeyword(){return this._hoistedAwaitKeyword}get hoistedExitStatements(){return this._hoistedExitStatements}hoistAwaitKeyword(){["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"].includes(this.type)||(this._hoistedAwaitKeyword=!0,this.ownerContract&&this.ownerContract.hoistAwaitKeyword())}hoistExitStatement(t,r){if(["break","continue"].includes(t.value)){let i=this.getLabelInfo();if(i.type==="Iteration"?i.target!=="BlockStatement"&&(r.value===i.label||!r.value):r.value&&r.value===i.label)return this._hoistedExitStatements.set(t,{...i,arg:r}),i}if(this._hoistedExitStatements.set(t,r),this.ownerContract)return this.ownerContract.hoistExitStatement(t,r)}generatable(){return this.references.length||this instanceof Ie}generate(t,r={}){if(!t||!this.generatable())return t;this.generated=!0;let i=g.identifier(this.ownerContract.getSubscriptIdentifier("$contract",!0)),s,n;r.isFunctionContract?s=t:this.inSequence?s=g.arrowFuncExpr(null,[i],t,this.hoistedAwaitKeyword,!0):(n=Array.isArray(t)?g.blockStmt(t):g.blockStmt([t]),s=g.arrowFuncExpr(null,[i],n,this.hoistedAwaitKeyword));let a=[g.literal(this.id),...r.args||[],s],o=g.callExpr(i,a);if(this.hoistedAwaitKeyword&&(o=g.awaitExpr(o)),this.inSequence||r.generateForArgument)return o;let u=this;o=g.exprStmt(o),o.comments=[{type:"Line",value:{toString(){return u.lineage},trim(){return this.toString()}}}];let l=[o];if(this.hookExpr=l,!(this.ownerScope||{}).singleStatementScope){let h,f=[],m,p=(x,b)=>{let d=g.ifStmt(x,b);m?m.alternate=d:(m=d,l.push(d))};if(this.hoistedExitStatements.forEach((x,b)=>{if(["break","continue"].includes(b.value)&&!f.includes(b.value)&&x.arg){let d=x.arg,w=g.callExpr(g.memberExpr(i,g.identifier("exiting")),[b,d]),v=g.exprStmt(g.identifier(x.type==="Iteration"||!d.value?b.value:b.value+" "+d.value));p(w,v),f.push(b.value)}else h=!0}),h){let x=g.callExpr(g.memberExpr(i,g.identifier("exiting"))),b=g.exprStmt(g.identifier("return"));p(x,b)}}return l}get lineage(){let t=this.ownerContract&&this.ownerContract.lineage;return this.ownerContract&&!this.generated?t:`${t?t+"/":""}${this.id}`}toJson(t=!1){let r={id:this.id,lineage:this.lineage,type:this.type,signals:{},effects:{},sideEffects:this.sideEffects.length?!0:void 0,$sideEffects:this.$sideEffects===!0?!0:void 0,subContracts:{},conditions:{},hoistedAwaitKeyword:this.hoistedAwaitKeyword,loc:this.loc};this.references.forEach(n=>{let a;n instanceof et?a=r.signals:n instanceof Pe&&(a=r.effects),a[n.id]=n.toJson(t)});let i=this.lineage.split("/").length,s=n=>n.reduce((a,o)=>a.subContracts[o],r);return this.entries.slice(0).reverse().forEach(n=>{if(n instanceof Oe&&n.generated){let a=s(n.lineage.split("/").slice(i,-1));a.subContracts[n.id]=n.toJson(t)}else if(n instanceof gt){let a=s(n.ownerContract.lineage.split("/").slice(i));a.conditions[n.id]=n.toJson(t)}}),r}};var Ie=class extends Oe{};var xt=class{constructor(t={}){this.params=t,this.locations=[],this._locStart=this.params.locStart||0,this.deferredTasks=[]}setLocation(t,r){if(this.params.locations===!1||!r)return;let i=[r.start+this._locStart,r.end+this._locStart];this.params.locations==="detached"?(this.locations.push(i),t.loc=this.locations.length-1):t.loc=i}serialize(t,r={}){return Rs(t,{comments:!0,...r})}generate(t){let r={type:"Global"},i=new Ie(null,"#",{...r,params:this.params});i.defineSubscriptIdentifier("$contract",["$x"]);let[s]=i.createScope(r,()=>this.generateNodes(i,[t]));return this.deferredTasks.forEach(n=>n()),{source:this.serialize(s),graph:i.toJson(!1),identifier:i.getSubscriptIdentifier("$contract"),locations:this.locations,ast:s}}generateNodes(t,r,i=!1){let s=r.length;s>1&&(r=r.reduce((a,o)=>o.type==="FunctionDeclaration"?[o].concat(a):a.concat(o),[]));let n=a=>{if(a===s)return[];let o=!1,u=()=>(o=!0,n(a+1)),l;if(r[a]){let h=()=>this.generateNode(t,r[a],i);this[`generate${r[a].type}`]&&(!i||["Identifier","FunctionDeclaration","FunctionExpression"].includes(r[a].type))&&(h=()=>this[`generate${r[a].type}`].call(this,t,r[a],u)),l=h()}else l=[r[a]];return o||(l=[].concat(l).concat(u(1))),l};return n(0)}generateNode(t,r,i=!1){return Object.keys(r).reduce((s,n)=>{let a=r[n];return Array.isArray(a)?a=this.generateNodes(t,a,i):typeof a=="object"&&a&&([a]=this.generateNodes(t,[a],i)),{...s,[n]:a}},{})}generateProgram(t,r){let i={type:r.type},s=t.createScope(i,()=>this.generateNodes(t,r.body));return{...r,body:s}}generateMethodDefinition(t,r){let i=this.generateNode(t,r.value,!0);return g.methodDefinition(r.key,i,r.kind,r.static,r.computed)}generateFunctionDeclaration(t,r){return this.generateFunction(g.funcDeclaration,...arguments)}generateFunctionExpression(t,r){return this.generateFunction(g.funcExpr,...arguments)}generateArrowFunctionExpression(t,r){return this.generateFunction(g.arrowFuncExpr,...arguments)}generateFunction(t,r,i){let s=(p,x)=>p?x.effectReference({type:i.type},()=>this.generateNodes(x,[p]),!1):[p],n=(p,x,b)=>r.defineContext({type:i.type,isSubscriptFunction:i.isSubscriptFunction},d=>d.createScope({type:i.type},()=>(p=s(p,d)[0],x=x.map(w=>{if(w.type==="AssignmentPattern"){let _=this.generateNode(d,w.right),C={type:w.left.type},[F]=d.effectReference(C,()=>this.generateNodes(d,[w.left]),!1);return g.assignmentPattern(F,_)}let v={type:w.type};return[w]=d.effectReference(v,()=>this.generateNodes(d,[w]),!1),w}),i.type==="ArrowFunctionExpression"&&i.expression?b=this.generateNode(d,g.blockStmt([g.returnStmt(b)])):b=this.generateNode(d,b),[d,p,x,b]))),a=g.identifier(r.getSubscriptIdentifier("$contract",!0)),o=(p,x,b,d,w)=>x.generate(p.call(g,b,[a].concat(d),w,i.async,i.expression,i.generator),{args:[g.literal(i.type),g.identifier(i.isSubscriptFunction?"true":"false")],isFunctionContract:!0,generateForArgument:!0}),u,l,h,f,m;if(i.type==="FunctionDeclaration"){[h]=s(i.id,r),[l,,f,m]=n(null,i.params,i.body),u=o(g.funcExpr,l,null,f,m);let p=g.memberExpr(a,g.identifier("functions")),x=(b,...d)=>g.callExpr(g.memberExpr(p,g.identifier(b)),[h,...d]);u=[g.exprStmt(x("define",u)),t.call(g,h,f,g.blockStmt([g.returnStmt(g.callExpr(g.memberExpr(x("get"),g.identifier("call")),[g.thisExpr(),g.spreadElement(g.identifier("arguments"))]))]))]}else[l,h,f,m]=n(i.id,i.params,i.body),u=o(t,l,h,f,m);return this.deferredTasks.unshift(()=>{l.sideEffects.forEach(p=>{l.ownerScope.doSideEffectUpdates(p.reference,p.remainderRefs)})}),u}generateVariableDeclaration(t,r){let i={type:r.type,kind:r.kind},s=[],n=(u,l,h)=>{let f,[m]=u.signalReference(i,v=>(f=v,this.generateNodes(t,[l.init]))),p,[x]=u.effectReference(i,v=>(p=v,this.generateNodes(t,[l.id])));if(f.setAssignee(p),this.setLocation(u,l),h||r.kind==="const"||!l.init||!this.params.devMode&&!u.references.filter(v=>v instanceof et).length)return g.varDeclarator(x,m);let b=["ObjectPattern","ArrayPattern"].includes(l.id.type),d=Array.from(p.refs).map(v=>g.varDeclarator(g.identifier(v.path[0].name),null)),w=g.assignmentExpr(x,m);return s.length?(s.push(g.varDeclaration(r.kind,d),...u.generate(g.exprStmt(w))),[]):(s.push(...u.generate(g.exprStmt(w))),d)},a=t.currentContract&&["ForStatement","ForOfStatement","ForInStatement"].includes(t.currentContract.type),o=r.declarations.reduce((u,l)=>a?u.concat(n(t.currentContract,l,!0)):t.defineContract(i,h=>u.concat(n(h,l))),[]);return o.length?[g.varDeclaration(r.kind,o),...s]:s}generateIfStatement(t,r){let i={type:r.type};return t.defineContract(i,s=>{let{consequent:n,alternate:a}=r,[o]=s.signalReference(i,()=>this.generateNodes(t,[r.test])),[u,l]=t.defineMemo({expr:o}).generate();return n=t.createCondition({when:l},()=>this.generateNodes(t,[r.consequent])),n[0].type!=="BlockStatement"&&n.length>1?n=g.blockStmt(n):n=n[0],r.alternate&&(a=t.createCondition({whenNot:l},()=>this.generateNodes(t,[r.alternate])),a[0]&&a[0].type!=="BlockStatement"&&a.length>1?a=g.blockStmt(a):a=a[0]),this.setLocation(s,r),this.setLocation(l,r.test),s.generate(g.ifStmt(u,n,a))})}generateSwitchStatement(t,r){let i={type:r.type};return t.defineContract(i,s=>{let[n]=s.signalReference(i,()=>this.generateNodes(t,[r.discriminant])),[a,o]=t.defineMemo({expr:n}).generate(),u=t.createScope(i,()=>r.cases.reduce((l,h)=>{let f=l.slice(-1)[0],m=h.consequent.some(w=>w.type==="BreakStatement"),[p]=s.signalReference({type:h.type},()=>this.generateNodes(t,[h.test])),[x,b]=t.defineMemo({expr:p}).generate(),d={switch:o,cases:[b]};return f&&!f.hasBreak&&d.cases.push(...f.condition.cases),this.setLocation(b,h.test),l.concat({caseNode:h,$test:x,condition:d,hasBreak:m})},[]).map(({caseNode:l,$test:h,condition:f})=>{let m=t.createCondition(f,()=>this.generateNodes(t,l.consequent));return g.switchCase(h,m)}));return this.setLocation(s,r),this.setLocation(o,r.discriminant),s.generate(g.switchStmt(a,u))})}generateWhileStatement(t,r){return this.generateLoopStmtA(g.whileStmt,...arguments)}generateDoWhileStatement(t,r){return this.generateLoopStmtA(g.doWhileStmt,...arguments)}generateForStatement(t,r){return this.generateLoopStmtA(g.forStmt,...arguments)}generateLoopStmtA(t,r,i){let s={type:i.type};return r.defineContract({type:i.type},n=>(this.setLocation(n,i),n.defineSubscriptIdentifier("$counter",["$x_index"]),r.createScope({type:"Iteration"},()=>{let a,o,u,l;return i.type==="ForStatement"?([o,u,l]=n.signalReference(s,()=>this.generateNodes(r,[i.init,i.test,i.update])),a=h=>t.call(g,o,u,l,h)):([u]=n.signalReference(s,()=>this.generateNodes(r,[i.test])),a=h=>t.call(g,u,h)),r.defineContext({type:"Iteration",isIteration:!0},h=>{this.setLocation(h,i.body);let f,[m]=this.generateNodes(h,[i.body]);m.body.length&&([f,m]=this.composeLoopStmt(h,m));let p=[].concat(f||[]).concat(a(g.blockStmt(m)));return n.generate(p)})})))}composeLoopStmt(t,r,i={}){let s=[i.disposeCallback],n=()=>s.forEach(h=>h&&h()),a=[],o=[],u=[],l=r.body.slice(0);if(!i.iterationId){i.iterationId=g.identifier(t.getSubscriptIdentifier("$counter",!0));let h=g.varDeclarator(g.clone(i.iterationId),g.literal(-1)),f=g.updateExpr("++",g.clone(i.iterationId),!1);a.push(h),u.push(f),s.push(()=>u.pop())}return o.length&&(u.push(g.varDeclaration("let",o)),s.push(()=>u.splice(-1))),u.push(...t.generate(l,{args:[i.iterationId],disposeCallback:n})),a.length?a=g.varDeclaration("let",a):a=null,[a,u]}generateForOfStatement(t,r){return this.generateLoopStmtB(g.forOfStmt,...arguments)}generateForInStatement(t,r){return this.generateLoopStmtB(g.forInStmt,...arguments)}generateLoopStmtB(t,r,i){let s={type:i.type};return r.defineContract({type:i.type},n=>(this.setLocation(n,i),n.defineSubscriptIdentifier("$counter",[i.type==="ForInStatement"?"$x_key":"$x_index"]),r.createScope({type:"Iteration"},()=>{let a,o;i.left.type==="VariableDeclaration"?([a]=this.generateNodes(r,[i.left]),o=a.declarations[0].id):([a]=n.affectedsReference(s,()=>this.generateNodes(r,[i.left])),o=a);let[u]=n.signalReference(s,()=>this.generateNodes(r,[i.right]));return r.defineContext({type:"Iteration",isIteration:!0},l=>{this.setLocation(l,i.body);let[h]=this.generateNodes(l,[i.body]),f=t.call(g,a,u,h),m=[];if(h.body.length){let p=d=>this.composeLoopStmt(l,h,{disposeCallback:()=>{f.left=a},...d}),x=a,b=h;if(i.type==="ForOfStatement")[m,b]=p({});else if(o.type==="Identifier")[m,b]=p({iterationId:o});else{let d=g.identifier(r.getSubscriptIdentifier("$counter"));[m,b]=p({iterationId:d}),x=g.varDeclaration("let",[g.varDeclarator(g.clone(d),null)]);let w;i.left.type==="VariableDeclaration"?w=g.varDeclaration(a.kind,[g.varDeclarator(o,g.clone(d))]):w=g.exprStmt(g.sequenceExpr([g.assignmentExpr(o,g.clone(d),"=")])),b=[w].concat(b)}f=t.call(g,x,u,g.blockStmt(b))}return n.generate([].concat(m||[]).concat(f))})})))}generateLabeledStatement(t,r){t.subscriptIdentifiersNoConflict(r.label);let i={type:r.type,label:r.label};return r.body.type.endsWith("Statement")?t.createScope({type:r.body.type,label:r.label},s=>{if(r.body.type==="BlockStatement"){let a=this.generateNodes(t,r.body.body);return g.labeledStmt(r.label,g.blockStmt(a))}s.singleStatementScope=!0;let[n]=this.generateNodes(t,[r.body]);return g.labeledStmt(r.label,n)}):t.defineContract(i,s=>{this.setLocation(s,r.body);let[n]=this.generateNodes(t,[r.body]);return g.labeledStmt(r.label,s.generate(n))})}generateBreakStatement(t,r){return this.generateExitStmt(g.breakStmt,...arguments)}generateContinueStatement(t,r){return this.generateExitStmt(g.continueStmt,...arguments)}generateExitStmt(t,r,i){let s=r.currentContract.closest(["Iteration","SwitchStatement","LabeledStatement"]);if(s&&s.type==="SwitchStatement"&&i.type==="BreakStatement"&&!i.label)return t.call(g,null);let n=g.identifier(r.getSubscriptIdentifier("$contract",!0)),a=g.literal(i.type==="BreakStatement"?"break":"continue"),o=i.label?g.literal(i.label.name):g.identifier("null"),u=g.exprStmt(g.callExpr(g.memberExpr(n,g.identifier("exit")),[a,o]));return r.currentContract.hoistExitStatement(a,o),[u,g.returnStmt()]}generateReturnStatement(t,r){let i={type:r.type};return t.defineContract(i,s=>{let[n]=s.signalReference(i,()=>this.generateNodes(t,[r.argument])),a=g.identifier(t.getSubscriptIdentifier("$contract",!0)),o=g.literal("return"),u=n||g.identifier("undefined"),l=g.exprStmt(g.callExpr(g.memberExpr(a,g.identifier("exit")),[o,u]));return s.hoistExitStatement(o,g.identifier("true")),s.generate([l,g.returnStmt()])})}generateBlockStatement(t,r){return t.createScope({type:r.type},()=>{let i=this.generateNodes(t,r.body);return g.blockStmt(i)})}generateExpressionStatement(t,r){let i={type:r.type};return t.defineContract(i,s=>{this.setLocation(s,r.expression);let[n]=s.signalReference(i,()=>this.generateNodes(t,[r.expression]));return s.generate(g.exprStmt(n))})}generateSequenceExpression(t,r){let i=r.expressions.map((s,n)=>{let a={type:s.type,inSequence:!0};return n===r.expressions.length-1?([s]=t.currentContract.chainableReference(a,()=>this.generateNodes(t,[s])),s):t.defineContract(a,o=>(this.setLocation(o,s),[s]=o.signalReference(a,()=>this.generateNodes(t,[s])),s.type==="Identifier"?s:o.generate(s)))});return g.sequenceExpr(i)}generateAssignmentExpression(t,r){let i={type:r.type,kind:r.operator},s,[n]=t.currentContract.signalReference(i,u=>(s=u,this.generateNodes(t,[r.right]))),a,[o]=t.currentContract.embeddableEffectReference(i,u=>(a=u,this.generateNodes(t,[r.left])));return s.setAssignee(a),g.assignmentExpr(o,n,r.operator)}generateUpdateExpression(t,r){return this.generateMutationExpr(g.updateExpr,...arguments)}generateUnaryExpression(t,r){if(r.operator==="delete")return this.generateMutationExpr(g.unaryExpr,...arguments);let i={type:r.type,kind:r.operator},[s]=t.currentContract.signalReference(i,()=>this.generateNodes(t,[r.argument]));return g.unaryExpr(r.operator,s,r.prefix)}generateMutationExpr(t,r,i){let s={type:i.type,kind:i.operator},[n]=r.currentContract.effectReference(s,()=>this.generateNodes(r,[i.argument]));return t.call(g,i.operator,n,i.prefix)}generateBinaryExpression(t,r){let[i]=t.currentContract.signalReference({type:r.type},()=>this.generateNodes(t,[r.left])),[s]=t.currentContract.signalReference({type:r.type},()=>this.generateNodes(t,[r.right]));return g.binaryExpr(r.operator,i,s)}generateLogicalExpression(t,r){let i={type:r.type,kind:r.operator},[s]=t.currentContract.chainableReference(i,()=>this.generateNodes(t,[r.left])),[n,a]=t.defineMemo({expr:s}).generate(),o=r.operator==="||"?{whenNot:a}:{when:a},[u]=t.createCondition(o,()=>t.currentContract.chainableReference(i,()=>this.generateNodes(t,[r.right])));return this.setLocation(a,r.left),g.logicalExpr(r.operator,n,u)}generateConditionalExpression(t,r){let i={type:r.type},[s]=t.currentContract.signalReference(i,()=>this.generateNodes(t,[r.test])),[n,a]=t.defineMemo({expr:s}).generate(),[o]=t.createCondition({when:a},()=>t.currentContract.chainableReference(i,()=>this.generateNodes(t,[r.consequent]))),[u]=t.createCondition({whenNot:a},()=>t.currentContract.chainableReference(i,()=>this.generateNodes(t,[r.alternate])));return this.setLocation(a,r.test),g.condExpr(n,o,u)}generateArrayPattern(t,r){let i=r.elements.map((s,n)=>([s]=t.currentContract.currentReference.withDestructure({name:n},()=>this.generateNodes(t,[s])),s));return g.arrayPattern(i)}generateObjectPattern(t,r){let i=r.properties.map(s=>{let{key:n,value:a}=s;s.computed&&([n]=t.currentContract.signalReference({type:n.type},()=>this.generateNodes(t,[n])));let o={name:s.key.name};return s.computed&&(s.key.type==="Literal"?o={name:s.key.value}:[n,o]=t.defineMemo({expr:n}).generate()),[a]=t.currentContract.currentReference.withDestructure(o,()=>this.generateNodes(t,[a])),this.setLocation(o,s.key),g.property(n,a,s.kind,s.shorthand,s.computed,s.method)});return g.objectPattern(i)}generateMemberExpression(t,r){let{property:i}=r;r.computed&&([i]=t.currentContract.signalReference({type:i.type},()=>this.generateNodes(t,[i])));let s={name:r.property.name};r.computed&&(r.property.type==="Literal"?s={name:r.property.value}:[i,s]=t.defineMemo({expr:i}).generate());let[n]=t.currentContract.currentReference.withProperty(s,()=>this.generateNodes(t,[r.object]));return this.setLocation(s,r.property),g.memberExpr(n,i,r.computed,r.optional)}generateThisExpression(t,r){return this.generateIdentifier(...arguments)}generateIdentifier(t,r){let i=()=>r.type==="Identifier"?g.identifier(r.name):g.thisExpr();r.type==="Identifier"&&t.subscriptIdentifiersNoConflict(r);let s={name:r.type==="Identifier"?r.name:"this"};this.setLocation(s,r);let n=t.closestFunction(),a=(t.currentContract||t).currentReference;if(a)do(!n||n.isSubscriptFunction||a instanceof Pe)&&a.addRef().unshift(s);while(a=a.contextReference);return i()}generateSpreadElement(t,r){return this.generateArgumentExpr(g.spreadElement,...arguments)}generateAwaitExpression(t,r){return t.currentContract.hoistAwaitKeyword(),this.generateArgumentExpr(g.awaitExpr,...arguments)}generateArgumentExpr(t,r,i){let[s]=r.currentContract.signalReference({type:i.type},()=>this.generateNodes(r,[i.argument]));return t.call(g,s)}generateCallExpression(t,r){return this.generateCallExpr(g.callExpr,...arguments)}generateNewExpression(t,r){return this.generateCallExpr(g.newExpr,...arguments)}generateCallExpr(t,r,i){let[s]=r.currentContract.signalReference({type:i.callee.type},()=>this.generateNodes(r,[i.callee])),n=i.arguments.map(a=>r.currentContract.signalReference({type:a.type},()=>this.generateNodes(r,[a])[0]));return t.call(g,s,n,i.optional)}generateParenthesizedExpression(t,r){return this.generateExprExpr(g.parensExpr,...arguments)}generateChainExpression(t,r){return this.generateExprExpr(g.chainExpr,...arguments)}generateExprExpr(t,r,i){let[s]=this.generateNodes(r,[i.expression]);return t.call(g,s)}generateArrayExpression(t,r){let i=r.elements.map(s=>t.currentContract.signalReference({type:s.type},()=>this.generateNodes(t,[s])[0]));return g.arrayExpr(i)}generateObjectExpression(t,r){let i=this.generateNodes(t,r.properties);return g.objectExpr(i)}generateProperty(t,r){let{key:i,value:s}=r;return r.computed&&([i]=t.currentContract.signalReference({type:i.type},()=>this.generateNodes(t,[i]))),[s]=t.currentContract.signalReference({type:s.type},()=>this.generateNodes(t,[s])),g.property(i,s,r.kind,r.shorthand,r.computed,!1)}generateTaggedTemplateExpression(t,r){let[i,s]=t.currentContract.signalReference({type:r.type},()=>this.generateNodes(t,[r.tag,r.quasi]));return g.taggedTemplateExpr(i,s)}generateTemplateLiteral(t,r){let i=r.expressions.map(s=>t.currentContract.signalReference({type:r.type},()=>this.generateNodes(t,[s])[0]));return g.templateLiteral(r.quasis,i)}generateTryStatement(t,r){let[i,s,n]=this.generateNodes(t,[r.block,r.handler,r.finalizer]);return g.tryStmt(i,s,n)}generateCatchClause(t,r){let[i]=this.generateNodes(t,[r.body]);return g.catchClause(r.param,i)}generateThrowStatement(t,r){return this.generateArgumentExpr(g.throwStmt,...arguments)}};var Me=class{constructor(t,r,i,s={},n=null,a=null){this.ownerContract=t,this.graph=r,this.callee=i,this.params=s,this.exits=a||new Map,this.$thread=n||{entries:new Map,sequence:[],ownerContract:this},this.subContracts=new Map,this.contract=function(u,l,h=null,f=null){if(!this.graph.subContracts[u])throw new Error(`[${this.graph.type}:${this.graph.lineage}]: Graph not found for child contract ${u}.`);let m=this.graph.subContracts[u],p={...this.params,isIterationContract:arguments.length===3,iterationId:arguments.length===3&&l,isFunctionContract:arguments.length===4,functionType:arguments.length===4&&l,isSubscriptFunction:arguments.length===4&&h,functionScope:this.params.isFunctionContract&&this.graph.lineage||this.params.functionScope};if(p.isIterationContract){let w=h,v=new Me(this,m,w,p,this.$thread,this.exits),_=this.subContracts.get(u);return _||(_=new Map,this.subContracts.set(u,_)),_.has(p.iterationId)&&_.get(p.iterationId).dispose(),_.set(p.iterationId,v),v.call()}let x,b,d;return this.subContracts.has(u)&&this.subContracts.get(u).dispose(),p.isFunctionContract?(x=f,d=b=new Me(this,m,x,p),p.functionType!=="FunctionDeclaration"&&(d=x instanceof(async()=>{}).constructor?async function(){return b.call(this,...arguments)}:function(){return b.call(this,...arguments)},o(d,b))):(x=l,b=new Me(this,m,x,p,this.$thread,this.exits),d=b.call()),this.subContracts.set(u,b),d}.bind(this),this.contract.memo=Object.create(null),this.contract.exiting=function(u,l){if(!arguments.length)return this.exits.size;let h=this.exits.get(u)===l;return h&&this.exits.clear(),h}.bind(this),this.contract.exit=function(u,l){this.exits.set(u,l)}.bind(this),this.contract.functions=new Map,this.contract.functions.define=(u,l)=>{this.contract.functions.set(u,l),o(u,l,!0)};let o=(u,l,h=!1)=>{h||(Object.defineProperty(u,"length",{configurable:!0,value:l.callee.length-1}),Object.defineProperty(u,"name",{configurable:!0,value:l.callee.name})),l.params.isSubscriptFunction&&(u.thread=l.thread.bind(l),u.dispose=l.dispose.bind(l),Object.defineProperty(u,"runtime",{value:l}),Object.defineProperty(u,"sideEffects",{configurable:!0,value:l.graph.sideEffects||""}),Object.defineProperty(u,"subscriptSource",{configurable:!0,value:l.graph.subscriptSource||""}),Object.defineProperty(u,"originalSource",{configurable:!0,value:l.graph.originalSource||""}))}}fire(t,r,i){if(!!this.ownerContract)return this.ownerContract.fire(t,r,i)}call(t,...r){if(this.disposed)throw new Error(`[${this.graph.type}:${this.graph.lineage}]: Instance not runable after having been disposed.`);let i=this.callee.call(t,this.contract,...r);if(this.graph.$sideEffects)for(let s in this.graph.effects)for(let n of this.graph.effects[s].refs)this.buildThread([],n,[],0,!0);if(!this.ownerContract||this.params.isFunctionContract){let s=this.exits.get("return");this.exits.clear(),s!==void 0&&(i=i instanceof Promise?i.then(()=>s):s)}return i}iterate(t=[]){if(this.disposed)return!1;if(!["ForOfStatement","ForInStatement"].includes(this.graph.type)||this.subContracts.size!==1)throw new Error(`Contract ${this.graph.lineage} is not an iterator.`);let[[,r]]=this.subContracts,i,s=(n,a)=>n instanceof Promise?n.then(a):a();if(!t.length||t.includes("length")&&this.graph.type==="ForOfStatement")for(let[,n]of r)i=s(i,()=>n.call());else for(let n of t){let a=r.get(n)||r.get(parseInt(n));!a||(i=s(i,()=>a.call()))}return i}thread(...t){if(this.disposed)return!1;this.$thread.active=!0;for(let r in this.graph.effects)for(let i of this.graph.effects[r].refs)for(let s of t){let[n,a,o]=this.matchRefs(s,i);!n||this.buildThread(s,i,o,a)}return this.runThread()}runThread(){let t=(a,o)=>{if(["ForOfStatement","ForInStatement"].includes(a.graph.type)&&o.every(u=>u.executionPlan.isIterationContractTarget)){let u=o.map(l=>l.executionPlan.iterationTarget);return this.fire(a.graph.lineage,"iterating",o),a.iterate(u)}return this.fire(a.graph.lineage,"executing",o),a.call()},r,i,s,n=(a,o)=>a instanceof Promise?a.then(o):o();for(;(i=this.$thread.sequence.shift())&&(s=[...this.$thread.entries.get(i)])&&this.$thread.entries.delete(i);)r=n(r,()=>{if(i.disposed||!i.filterRefs(s).length)return;this.$thread.current=i;let a=t(i,s);return n(a,()=>{for(let o of s)[].concat(o.executionPlan.assigneeRef||o.executionPlan.assigneeRefs||[]).forEach(u=>{i.buildThread([],u,[],0)})}),a});return n(r,()=>{let a=this.exits.get("return");return this.exits.clear(),this.$thread.current=null,this.$thread.active=!1,a})}buildThread(t,r,i,s=0,n=!1){let a=s>0;if(this.ownerContract){if(!this.compute(i)||r.condition!==void 0&&!this.assert(r.condition))return}else a||(a=i.length||r.condition!==void 0);let o=n?r.$subscriptions:r.subscriptions;Object.keys(o).forEach(u=>{let[l,h]=u.split(":"),f=p=>{!p||p.selectRefs(h,o[u],a?t:null)},m=this.locate(l);Array.isArray(m)?m.forEach(f):f(m)})}selectRefs(t,r,i=null){let s=this.$thread,n=this.graph.signals[t],a=(u,l)=>u.graph.lineage.localeCompare(l.graph.lineage,void 0,{numeric:!0}),o=(u,l=[],h={})=>{if(!s.active||s.current&&a(this,s.current)<0)return;let f=s.entries.get(this);if(f||(f=new Set,s.entries.set(this,f),s.sequence.push(this),s.sequence.sort(a)),f.add({...u,computes:l,executionPlan:h}),!h.assigneeRef&&["VariableDeclaration","AssignmentExpression"].includes(this.graph.type)){h.assigneeRefs=[];for(let m in this.graph.effects)h.assigneeRefs.push(...this.graph.effects[m].refs)}};for(let u of r){let l=n.refs[u];if(!i){o(l);continue}let[h,f,m]=this.matchRefs(i,l);if(!h)continue;if(f<=0){o(l,m);continue}let p=i.slice(-f),x="assignee"in n?this.graph.effects[n.assignee]:null;if(x){x.refs.forEach(b=>{if(b.depth.length){let[d,w,v]=this.matchRefs(p,b.depth),_=m.concat(v);if(d&&w>0){let C=b.path.concat(p.slice(-w));this.buildThread(C,b,_,w)}else d&&o(l,_,{assigneeRef:b})}else{let d=b.path.concat(p);this.buildThread(d,b,m,f)}});continue}if(f===1&&this.graph.type==="ForOfStatement"){o(l,m,{isIterationContractTarget:!0,iterationTarget:p[0]});continue}if(f===1&&this.graph.type==="ForInStatement"){o(l,m,{isIterationContractTarget:!0,iterationTarget:p[0]});continue}}}filterRefs(t){return t.filter(r=>{if(!!this.compute(r.computes)&&!(r.condition!==void 0&&!this.assert(r.condition)))return!0})}matchRefs(t,r){let i,s,n,a;Array.isArray(t)?(i=t,s=t.dotSafe?t.join("."):void 0):(i=t.path,s=t.$path),Array.isArray(r)?(n=r,a=r.dotSafe?r.join("."):void 0):(n=r.path,a=r.$path);let o=i.length-n.length;if(o>0&&([i,n,s,a]=[n,i,a,s]),s&&a)return[`${a}.`.startsWith(`${s}.`),o,[]];let u=[],l=f=>typeof f=="object"?f.name:f,h=(f,m)=>{if(!f||!m)return!1;let p=typeof f=="object"&&"memoId"in f,x=typeof m=="object"&&"memoId"in m;return p||x?(u.push(b=>(p?b[f.memoId]:l(f))===(x?b[m.memoId]:l(m))),!0):l(f)===l(m)};return[i.reduce((f,m,p)=>f&&h(m,n[p]),!0),o,u]}locate(t){let r=this.graph.lineage+"/",i=t+"/";if(i===r)return this;if(i.startsWith(r)){let s=t.slice(r.length).split("/"),n=this.subContracts.get(parseInt(s.shift()));if(s.length){if(n instanceof Map)return Array.from(n).reduce((a,[o,u])=>a.concat(u.locate(t)),[]);if(n)return n.locate(t)}return n}if(this.ownerContract)return this.ownerContract.locate(t)}compute(t){return!t.some(r=>r(this.contract.memo)===!1)}assert(t){if(typeof t=="string"&&t.includes(":")){let[s,n]=t.split(":");return this.locate(s).assert(n)}let r=this.graph.conditions[t],i=this.contract.memo;return typeof r.parent<"u"&&!this.assert(r.parent)?!1:typeof r.switch<"u"?r.cases.some(s=>i[s]===i[r.switch]):typeof r.whenNot<"u"?!i[r.whenNot]:typeof r.when<"u"?i[r.when]:!0}dispose(){this.params.isFunctionContract||(this.subContracts.forEach((t,r)=>{t instanceof Map?(t.forEach(i=>i.dispose()),t.clear()):t.dispose()}),this.subContracts.clear(),delete this.ownerContract,delete this.callee,delete this.params,delete this.contract.memo,this.disposed=!0)}};var Tt=class extends Me{static create(t,r=[],i={}){let s=t.graph.hoistedAwaitKeyword?Object.getPrototypeOf(async function(){}).constructor:Function,n=i.compileFunction?i.compileFunction(t.source,[t.identifier+""].concat(r)):new s(t.identifier+"",...r,t.source);return new this(null,t.graph,n,i)}constructor(t,r,i,s={},n=null){super(t,r,i,s={},n),this.observers=[]}observe(t,r){this.params.devMode,this.observers.push({contractUrl:t,callback:r})}fire(t,r,i){(this.observers||[]).forEach(s=>{s.contractUrl===t&&s.callback(r,i)})}};function Ai(e,t=!1){let r=e.split(/\n/g);if(r.length>1){for(;!r[0].trim().length;)r.shift();let i=r[t?1:0].split(/[^\s]/)[0].length;if(i)return r.map((s,n)=>{let a=s.substring(0,i);return a.trim().length?a.trim()==="}"&&n===r.length-1?"}":s:s.substring(i)}).join(`
9
- `)}return e}function U(...e){let t=typeof e[e.length-1]=="object"?e.pop():{};t.compilerParams={...U.compilerParams,...t.compilerParams||{}},t.runtimeParams={...U.runtimeParams,...t.runtimeParams||{}};let r=Ai(e.pop()||""),i,s=e;if(U.cache[r]&&!t.compilerParams.devMode&&Oi(s,U.cache[r][1])&&Ii(t.compilerParams,U.cache[r][2]))[i,s]=U.cache[r];else{let n=Pi(r);i=new xt(t.compilerParams).generate(n),U.cache[r]=[i,s,t.compilerParams]}return Fs(this,i,e,t.runtimeParams,r)}U.cache={};U.compilerParams={globalsNoObserve:[],globalsOnlyPaths:!1,compact:2};U.runtimeParams={};U.cloneCache={};U.clone=function(e,t=null,r={},i={}){if(typeof e!="function")throw new Error(`Expected argument 1 to be of type 'function' but got ${typeof e}.`);if(!e.name)throw new Error("Function must have a name.");let s=Ai(e.toString(),!0),n=s,a;if(s.startsWith("async ")&&(a=!0,n=n.substring(6)),!n.startsWith("function ")&&!n.startsWith("function(")){if(n.trim().startsWith("[")){let h,f=n.split(/\](?:[\s]+)?\(/g).filter(m=>m);[h,n]=f.reduce((m,p,x)=>{if(Array.isArray(m))return m;p=`${m}${p||""}]`;try{return Pi(p),[p,`${e.name}(${f.slice(x+1).join("] (")}`]}catch{return`${p} (`}},"")}n="function "+n}let o,u,l;if(U.cloneCache[n]&&!r.devMode&&Ii(r,U.cloneCache[n][3]))[o,u,l]=U.cloneCache[n];else{let h=Pi(n).body[0],f=h.body.start+1;n.substr(f,1)===`
10
- `&&(f+=1);let m=new xt({...r,...U.compilerParams,locStart:-f});u=h.params.map(p=>m.serialize(p)),o=m.generate({type:"Program",body:h.body.body}),!o.graph.hoistedAwaitKeyword&&a&&(o.graph.hoistedAwaitKeyword=!0),l=n.substring(f,h.body.end-1),U.cloneCache[n]=[o,u,l,r]}return Fs(t,o,u,i,l,e.name)};var Fs=function(e,t,r=[],i={},s=null,n=null){let a=Tt.create(t,r,{...i,...U.runtimeParams}),o=function(...l){try{return a.call(this===void 0?e:this,...l)}catch(h){throw console.info("-----------------------"),console.log(s||""),console.info("-----------------------"),h}};o.thread=a.thread.bind(a),o.dispose=a.dispose.bind(a),Object.defineProperty(o,"runtime",{value:a}),Object.defineProperty(o,"sideEffects",{configurable:!0,value:a.graph.sideEffects}),Object.defineProperty(o,"subscriptSource",{configurable:!0,value:t.source}),Object.defineProperty(o,"originalSource",{configurable:!0,value:s}),Object.defineProperty(o,"length",{configurable:!0,value:r.length}),Object.defineProperty(o,"name",{configurable:!0,value:n});let u=(t.graph.hoistedAwaitKeyword?"async ":"")+"function"+(n?" "+n:"");return o.toString=()=>`${u}(${r.join(", ")}) {${s}}`,o},Ls=new Map,Pi=function(e,t={}){t={ecmaVersion:"2020",allowReturnOutsideFunction:!0,allowAwaitOutsideFunction:!0,allowSuperOutsideMethod:!0,preserveParens:!1,...t};let r=Ls.get(e);return r||(r=Ti.parse(e,t),Ls.set(e,r)),r},Oi=(e,t)=>typeof e=="object"&&e&&typeof t=="object"&&t?Ii(e,t):Array.isArray(e)&&Array.isArray(t)&&e.length===t.length?e.every(r=>t.some(i=>Oi(r,i))):e===t,Ii=function(e,t){for(let r in e)if(!Oi(e[r],t[r]))return!1;return!0};var Ni=e=>class extends(e||class{}){static get compilerParams(){return{}}static get runtimeParams(){return{}}static get subscriptMethods(){return[]}static implementMethod(t,r=null){return U.clone(t,r,this.compilerParams,this.runtimeParams)}constructor(){super();let t=this.constructor;t.subscriptMethods.forEach(r=>{if(!this[r])throw new Error(`${r} is not a method.`);if(r==="constructor")throw new Error("Class constructors cannot be subscript methods.");this[r]=t.implementMethod(this[r],this)})}};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,154,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,161,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,19306,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,262,6,10,9,357,0,62,13,1495,6,110,6,6,9,4759,9,787719,239],Bs=[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,85,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,190,0,80,921,103,110,18,195,2637,96,16,1070,4050,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,46,2,18,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,482,44,11,6,17,0,322,29,19,43,1269,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,4152,8,221,3,5761,15,7472,3104,541,1507,4938],Ea="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F",$s="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",Ri={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"},Li="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",Ca={5:Li,"5module":Li+" export import",6:Li+" const class extends export import super"},ka=/^in(stanceof)?$/,Aa=new RegExp("["+$s+"]"),Pa=new RegExp("["+$s+Ea+"]");function Mi(e,t){for(var r=65536,i=0;i<t.length;i+=2){if(r+=t[i],r>e)return!1;if(r+=t[i+1],r>=e)return!0}}function Ve(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&Aa.test(String.fromCharCode(e)):t===!1?!1:Mi(e,Bs)}function Nt(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&Pa.test(String.fromCharCode(e)):t===!1?!1:Mi(e,Bs)||Mi(e,_a)}var M=function(t,r){r===void 0&&(r={}),this.label=t,this.keyword=r.keyword,this.beforeExpr=!!r.beforeExpr,this.startsExpr=!!r.startsExpr,this.isLoop=!!r.isLoop,this.isAssign=!!r.isAssign,this.prefix=!!r.prefix,this.postfix=!!r.postfix,this.binop=r.binop||null,this.updateContext=null};function de(e,t){return new M(e,{beforeExpr:!0,binop:t})}var ge={beforeExpr:!0},oe={startsExpr:!0},ji={};function L(e,t){return t===void 0&&(t={}),t.keyword=e,ji[e]=new M(e,t)}var c={num:new M("num",oe),regexp:new M("regexp",oe),string:new M("string",oe),name:new M("name",oe),privateId:new M("privateId",oe),eof:new M("eof"),bracketL:new M("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new M("]"),braceL:new M("{",{beforeExpr:!0,startsExpr:!0}),braceR:new M("}"),parenL:new M("(",{beforeExpr:!0,startsExpr:!0}),parenR:new M(")"),comma:new M(",",ge),semi:new M(";",ge),colon:new M(":",ge),dot:new M("."),question:new M("?",ge),questionDot:new M("?."),arrow:new M("=>",ge),template:new M("template"),invalidTemplate:new M("invalidTemplate"),ellipsis:new M("...",ge),backQuote:new M("`",oe),dollarBraceL:new M("${",{beforeExpr:!0,startsExpr:!0}),eq:new M("=",{beforeExpr:!0,isAssign:!0}),assign:new M("_=",{beforeExpr:!0,isAssign:!0}),incDec:new M("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new M("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:de("||",1),logicalAND:de("&&",2),bitwiseOR:de("|",3),bitwiseXOR:de("^",4),bitwiseAND:de("&",5),equality:de("==/!=/===/!==",6),relational:de("</>/<=/>=",7),bitShift:de("<</>>/>>>",8),plusMin:new M("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:de("%",10),star:de("*",10),slash:de("/",10),starstar:new M("**",{beforeExpr:!0}),coalesce:de("??",1),_break:L("break"),_case:L("case",ge),_catch:L("catch"),_continue:L("continue"),_debugger:L("debugger"),_default:L("default",ge),_do:L("do",{isLoop:!0,beforeExpr:!0}),_else:L("else",ge),_finally:L("finally"),_for:L("for",{isLoop:!0}),_function:L("function",oe),_if:L("if"),_return:L("return",ge),_switch:L("switch"),_throw:L("throw",ge),_try:L("try"),_var:L("var"),_const:L("const"),_while:L("while",{isLoop:!0}),_with:L("with"),_new:L("new",{beforeExpr:!0,startsExpr:!0}),_this:L("this",oe),_super:L("super",oe),_class:L("class",oe),_extends:L("extends",ge),_export:L("export"),_import:L("import",oe),_null:L("null",oe),_true:L("true",oe),_false:L("false",oe),_in:L("in",{beforeExpr:!0,binop:7}),_instanceof:L("instanceof",{beforeExpr:!0,binop:7}),_typeof:L("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:L("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:L("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},ye=/\r\n?|\n|\u2028|\u2029/,Oa=new RegExp(ye.source,"g");function Rt(e){return e===10||e===13||e===8232||e===8233}function Us(e,t,r){r===void 0&&(r=e.length);for(var i=t;i<r;i++){var s=e.charCodeAt(i);if(Rt(s))return i<r-1&&s===13&&e.charCodeAt(i+1)===10?i+2:i+1}return-1}var qs=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,xe=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Ws=Object.prototype,Ia=Ws.hasOwnProperty,Ta=Ws.toString,Zt=Object.hasOwn||function(e,t){return Ia.call(e,t)},Ms=Array.isArray||function(e){return Ta.call(e)==="[object Array]"};function yt(e){return new RegExp("^(?:"+e.replace(/ /g,"|")+")$")}function tt(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var Na=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Xt=function(t,r){this.line=t,this.column=r};Xt.prototype.offset=function(t){return new Xt(this.line,this.column+t)};var Qr=function(t,r,i){this.start=r,this.end=i,t.sourceFile!==null&&(this.source=t.sourceFile)};function Hs(e,t){for(var r=1,i=0;;){var s=Us(e,i,t);if(s<0)return new Xt(r,t-i);++r,i=s}}var Di={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},Ds=!1;function Ra(e){var t={};for(var r in Di)t[r]=e&&Zt(e,r)?e[r]:Di[r];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!Ds&&typeof console=="object"&&console.warn&&(Ds=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
11
- Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved==null&&(t.allowReserved=t.ecmaVersion<5),Ms(t.onToken)){var i=t.onToken;t.onToken=function(s){return i.push(s)}}return Ms(t.onComment)&&(t.onComment=La(t,t.onComment)),t}function La(e,t){return function(r,i,s,n,a,o){var u={type:r?"Block":"Line",value:i,start:s,end:n};e.locations&&(u.loc=new Qr(this,a,o)),e.ranges&&(u.range=[s,n]),t.push(u)}}var Yt=1,Lt=2,Bi=4,zs=8,Qs=16,Gs=32,$i=64,Ks=128,er=256,Ui=Yt|Lt|er;function qi(e,t){return Lt|(e?Bi:0)|(t?zs:0)}var Wr=0,Wi=1,De=2,Js=3,Xs=4,Ys=5,G=function(t,r,i){this.options=t=Ra(t),this.sourceFile=t.sourceFile,this.keywords=yt(Ca[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var s="";t.allowReserved!==!0&&(s=Ri[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(s+=" await")),this.reservedWords=yt(s);var n=(s?s+" ":"")+Ri.strict;this.reservedWordsStrict=yt(n),this.reservedWordsStrictBind=yt(n+" "+Ri.strictBind),this.input=String(r),this.containsEsc=!1,i?(this.pos=i,this.lineStart=this.input.lastIndexOf(`
12
- `,i-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(ye).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=c.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=t.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&&t.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(Yt),this.regexpState=null,this.privateNameStack=[]},Te={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}};G.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)};Te.inFunction.get=function(){return(this.currentVarScope().flags&Lt)>0};Te.inGenerator.get=function(){return(this.currentVarScope().flags&zs)>0&&!this.currentVarScope().inClassFieldInit};Te.inAsync.get=function(){return(this.currentVarScope().flags&Bi)>0&&!this.currentVarScope().inClassFieldInit};Te.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e];if(t.inClassFieldInit||t.flags&er)return!1;if(t.flags&Lt)return(t.flags&Bi)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};Te.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags,r=e.inClassFieldInit;return(t&$i)>0||r||this.options.allowSuperOutsideMethod};Te.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Ks)>0};Te.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};Te.allowNewDotTarget.get=function(){var e=this.currentThisScope(),t=e.flags,r=e.inClassFieldInit;return(t&(Lt|er))>0||r};Te.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&er)>0};G.extend=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];for(var i=this,s=0;s<t.length;s++)i=t[s](i);return i};G.parse=function(t,r){return new this(r,t).parse()};G.parseExpressionAt=function(t,r,i){var s=new this(i,t,r);return s.nextToken(),s.parseExpression()};G.tokenizer=function(t,r){return new this(r,t)};Object.defineProperties(G.prototype,Te);var ne=G.prototype,Fa=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;ne.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){xe.lastIndex=e,e+=xe.exec(this.input)[0].length;var t=Fa.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){xe.lastIndex=e+t[0].length;var r=xe.exec(this.input),i=r.index+r[0].length,s=this.input.charAt(i);return s===";"||s==="}"||ye.test(r[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(s)||s==="!"&&this.input.charAt(i+1)==="=")}e+=t[0].length,xe.lastIndex=e,e+=xe.exec(this.input)[0].length,this.input[e]===";"&&e++}};ne.eat=function(e){return this.type===e?(this.next(),!0):!1};ne.isContextual=function(e){return this.type===c.name&&this.value===e&&!this.containsEsc};ne.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};ne.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};ne.canInsertSemicolon=function(){return this.type===c.eof||this.type===c.braceR||ye.test(this.input.slice(this.lastTokEnd,this.start))};ne.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};ne.semicolon=function(){!this.eat(c.semi)&&!this.insertSemicolon()&&this.unexpected()};ne.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0};ne.expect=function(e){this.eat(e)||this.unexpected()};ne.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var Gr=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};ne.checkPatternErrors=function(e,t){if(!!e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var r=t?e.parenthesizedAssign:e.parenthesizedBind;r>-1&&this.raiseRecoverable(r,"Parenthesized pattern")}};ne.checkExpressionErrors=function(e,t){if(!e)return!1;var r=e.shorthandAssign,i=e.doubleProto;if(!t)return r>=0||i>=0;r>=0&&this.raise(r,"Shorthand property assignments are valid only in destructuring patterns"),i>=0&&this.raiseRecoverable(i,"Redefinition of __proto__ property")};ne.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")};ne.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var I=G.prototype;I.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==c.eof;){var r=this.parseStatement(null,!0,t);e.body.push(r)}if(this.inModule)for(var i=0,s=Object.keys(this.undefinedExports);i<s.length;i+=1){var n=s[i];this.raiseRecoverable(this.undefinedExports[n].start,"Export '"+n+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,"Program")};var Hi={kind:"loop"},Ma={kind:"switch"};I.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;xe.lastIndex=this.pos;var t=xe.exec(this.input),r=this.pos+t[0].length,i=this.input.charCodeAt(r);if(i===91||i===92||i>55295&&i<56320)return!0;if(e)return!1;if(i===123)return!0;if(Ve(i,!0)){for(var s=r+1;Nt(i=this.input.charCodeAt(s),!0);)++s;if(i===92||i>55295&&i<56320)return!0;var n=this.input.slice(r,s);if(!ka.test(n))return!0}return!1};I.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;xe.lastIndex=this.pos;var e=xe.exec(this.input),t=this.pos+e[0].length,r;return!ye.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(Nt(r=this.input.charCodeAt(t+8))||r>55295&&r<56320))};I.parseStatement=function(e,t,r){var i=this.type,s=this.startNode(),n;switch(this.isLet(e)&&(i=c._var,n="let"),i){case c._break:case c._continue:return this.parseBreakContinueStatement(s,i.keyword);case c._debugger:return this.parseDebuggerStatement(s);case c._do:return this.parseDoStatement(s);case c._for:return this.parseForStatement(s);case c._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(s,!1,!e);case c._class:return e&&this.unexpected(),this.parseClass(s,!0);case c._if:return this.parseIfStatement(s);case c._return:return this.parseReturnStatement(s);case c._switch:return this.parseSwitchStatement(s);case c._throw:return this.parseThrowStatement(s);case c._try:return this.parseTryStatement(s);case c._const:case c._var:return n=n||this.value,e&&n!=="var"&&this.unexpected(),this.parseVarStatement(s,n);case c._while:return this.parseWhileStatement(s);case c._with:return this.parseWithStatement(s);case c.braceL:return this.parseBlock(!0,s);case c.semi:return this.parseEmptyStatement(s);case c._export:case c._import:if(this.options.ecmaVersion>10&&i===c._import){xe.lastIndex=this.pos;var a=xe.exec(this.input),o=this.pos+a[0].length,u=this.input.charCodeAt(o);if(u===40||u===46)return this.parseExpressionStatement(s,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||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'")),i===c._import?this.parseImport(s):this.parseExport(s,r);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(s,!0,!e);var l=this.value,h=this.parseExpression();return i===c.name&&h.type==="Identifier"&&this.eat(c.colon)?this.parseLabeledStatement(s,l,h,e):this.parseExpressionStatement(s,h)}};I.parseBreakContinueStatement=function(e,t){var r=t==="break";this.next(),this.eat(c.semi)||this.insertSemicolon()?e.label=null:this.type!==c.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var i=0;i<this.labels.length;++i){var s=this.labels[i];if((e.label==null||s.name===e.label.name)&&(s.kind!=null&&(r||s.kind==="loop")||e.label&&r))break}return i===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,r?"BreakStatement":"ContinueStatement")};I.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")};I.parseDoStatement=function(e){return this.next(),this.labels.push(Hi),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(c._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(c.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};I.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Hi),this.enterScope(0),this.expect(c.parenL),this.type===c.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var r=this.isLet();if(this.type===c._var||this.type===c._const||r){var i=this.startNode(),s=r?"let":this.value;return this.next(),this.parseVar(i,!0,s),this.finishNode(i,"VariableDeclaration"),(this.type===c._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&i.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===c._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,i)):(t>-1&&this.unexpected(t),this.parseFor(e,i))}var n=this.isContextual("let"),a=!1,o=new Gr,u=this.parseExpression(t>-1?"await":!0,o);return this.type===c._in||(a=this.options.ecmaVersion>=6&&this.isContextual("of"))?(this.options.ecmaVersion>=9&&(this.type===c._in?t>-1&&this.unexpected(t):e.await=t>-1),n&&a&&this.raise(u.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(u,!1,o),this.checkLValPattern(u),this.parseForIn(e,u)):(this.checkExpressionErrors(o,!0),t>-1&&this.unexpected(t),this.parseFor(e,u))};I.parseFunctionStatement=function(e,t,r){return this.next(),this.parseFunction(e,Jt|(r?0:Vi),!1,t)};I.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(c._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};I.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(c.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};I.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(c.braceL),this.labels.push(Ma),this.enterScope(0);for(var t,r=!1;this.type!==c.braceR;)if(this.type===c._case||this.type===c._default){var i=this.type===c._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),i?t.test=this.parseExpression():(r&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),r=!0,t.test=null),this.expect(c.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};I.parseThrowStatement=function(e){return this.next(),ye.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Da=[];I.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===c._catch){var t=this.startNode();if(this.next(),this.eat(c.parenL)){t.param=this.parseBindingAtom();var r=t.param.type==="Identifier";this.enterScope(r?Gs:0),this.checkLValPattern(t.param,r?Xs:De),this.expect(c.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0);t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(c._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};I.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")};I.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Hi),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};I.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};I.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};I.parseLabeledStatement=function(e,t,r,i){for(var s=0,n=this.labels;s<n.length;s+=1){var a=n[s];a.name===t&&this.raise(r.start,"Label '"+t+"' is already declared")}for(var o=this.type.isLoop?"loop":this.type===c._switch?"switch":null,u=this.labels.length-1;u>=0;u--){var l=this.labels[u];if(l.statementStart===e.start)l.statementStart=this.start,l.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(i?i.indexOf("label")===-1?i+"label":i:"label"),this.labels.pop(),e.label=r,this.finishNode(e,"LabeledStatement")};I.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")};I.parseBlock=function(e,t,r){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(c.braceL),e&&this.enterScope(0);this.type!==c.braceR;){var i=this.parseStatement(null);t.body.push(i)}return r&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")};I.parseFor=function(e,t){return e.init=t,this.expect(c.semi),e.test=this.type===c.semi?null:this.parseExpression(),this.expect(c.semi),e.update=this.type===c.parenR?null:this.parseExpression(),this.expect(c.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};I.parseForIn=function(e,t){var r=this.type===c._in;return this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!r||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")&&this.raise(t.start,(r?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=r?this.parseExpression():this.parseMaybeAssign(),this.expect(c.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,r?"ForInStatement":"ForOfStatement")};I.parseVar=function(e,t,r){for(e.declarations=[],e.kind=r;;){var i=this.startNode();if(this.parseVarId(i,r),this.eat(c.eq)?i.init=this.parseMaybeAssign(t):r==="const"&&!(this.type===c._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():i.id.type!=="Identifier"&&!(t&&(this.type===c._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):i.init=null,e.declarations.push(this.finishNode(i,"VariableDeclarator")),!this.eat(c.comma))break}return e};I.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?Wi:De,!1)};var Jt=1,Vi=2,Zs=4;I.parseFunction=function(e,t,r,i,s){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!i)&&(this.type===c.star&&t&Vi&&this.unexpected(),e.generator=this.eat(c.star)),this.options.ecmaVersion>=8&&(e.async=!!i),t&Jt&&(e.id=t&Zs&&this.type!==c.name?null:this.parseIdent(),e.id&&!(t&Vi)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?Wi:De:Js));var n=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(qi(e.async,e.generator)),t&Jt||(e.id=this.type===c.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,r,!1,s),this.yieldPos=n,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,t&Jt?"FunctionDeclaration":"FunctionExpression")};I.parseFunctionParams=function(e){this.expect(c.parenL),e.params=this.parseBindingList(c.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};I.parseClass=function(e,t){this.next();var r=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var i=this.enterClassBody(),s=this.startNode(),n=!1;for(s.body=[],this.expect(c.braceL);this.type!==c.braceR;){var a=this.parseClassElement(e.superClass!==null);a&&(s.body.push(a),a.type==="MethodDefinition"&&a.kind==="constructor"?(n&&this.raise(a.start,"Duplicate constructor in the same class"),n=!0):a.key&&a.key.type==="PrivateIdentifier"&&Va(i,a)&&this.raiseRecoverable(a.key.start,"Identifier '#"+a.key.name+"' has already been declared"))}return this.strict=r,this.next(),e.body=this.finishNode(s,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")};I.parseClassElement=function(e){if(this.eat(c.semi))return null;var t=this.options.ecmaVersion,r=this.startNode(),i="",s=!1,n=!1,a="method",o=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(c.braceL))return this.parseClassStaticBlock(r),r;this.isClassElementNameStart()||this.type===c.star?o=!0:i="static"}if(r.static=o,!i&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===c.star)&&!this.canInsertSemicolon()?n=!0:i="async"),!i&&(t>=9||!n)&&this.eat(c.star)&&(s=!0),!i&&!n&&!s){var u=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?a=u:i=u)}if(i?(r.computed=!1,r.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),r.key.name=i,this.finishNode(r.key,"Identifier")):this.parseClassElementName(r),t<13||this.type===c.parenL||a!=="method"||s||n){var l=!r.static&&Hr(r,"constructor"),h=l&&e;l&&a!=="method"&&this.raise(r.key.start,"Constructor can't have get/set modifier"),r.kind=l?"constructor":a,this.parseClassMethod(r,s,n,h)}else this.parseClassField(r);return r};I.isClassElementNameStart=function(){return this.type===c.name||this.type===c.privateId||this.type===c.num||this.type===c.string||this.type===c.bracketL||this.type.keyword};I.parseClassElementName=function(e){this.type===c.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)};I.parseClassMethod=function(e,t,r,i){var s=e.key;e.kind==="constructor"?(t&&this.raise(s.start,"Constructor can't be a generator"),r&&this.raise(s.start,"Constructor can't be an async method")):e.static&&Hr(e,"prototype")&&this.raise(s.start,"Classes may not have a static property named prototype");var n=e.value=this.parseMethod(t,r,i);return e.kind==="get"&&n.params.length!==0&&this.raiseRecoverable(n.start,"getter should have no params"),e.kind==="set"&&n.params.length!==1&&this.raiseRecoverable(n.start,"setter should have exactly one param"),e.kind==="set"&&n.params[0].type==="RestElement"&&this.raiseRecoverable(n.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")};I.parseClassField=function(e){if(Hr(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&Hr(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(c.eq)){var t=this.currentThisScope(),r=t.inClassFieldInit;t.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),t.inClassFieldInit=r}else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")};I.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(er|$i);this.type!==c.braceR;){var r=this.parseStatement(null);e.body.push(r)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")};I.parseClassId=function(e,t){this.type===c.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,De,!1)):(t===!0&&this.unexpected(),e.id=null)};I.parseClassSuper=function(e){e.superClass=this.eat(c._extends)?this.parseExprSubscripts(!1):null};I.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};I.exitClassBody=function(){for(var e=this.privateNameStack.pop(),t=e.declared,r=e.used,i=this.privateNameStack.length,s=i===0?null:this.privateNameStack[i-1],n=0;n<r.length;++n){var a=r[n];Zt(t,a.name)||(s?s.used.push(a):this.raiseRecoverable(a.start,"Private field '#"+a.name+"' must be declared in an enclosing class"))}};function Va(e,t){var r=t.key.name,i=e[r],s="true";return t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set")&&(s=(t.static?"s":"i")+t.kind),i==="iget"&&s==="iset"||i==="iset"&&s==="iget"||i==="sget"&&s==="sset"||i==="sset"&&s==="sget"?(e[r]="true",!1):i?!0:(e[r]=s,!1)}function Hr(e,t){var r=e.computed,i=e.key;return!r&&(i.type==="Identifier"&&i.name===t||i.type==="Literal"&&i.value===t)}I.parseExport=function(e,t){if(this.next(),this.eat(c.star))return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==c.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(c._default)){this.checkExport(t,"default",this.lastTokStart);var r;if(this.type===c._function||(r=this.isAsyncFunction())){var i=this.startNode();this.next(),r&&this.next(),e.declaration=this.parseFunction(i,Jt|Zs,!1,r)}else if(this.type===c._class){var s=this.startNode();e.declaration=this.parseClass(s,"nullableID")}else e.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(null),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==c.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var n=0,a=e.specifiers;n<a.length;n+=1){var o=a[n];this.checkUnreserved(o.local),this.checkLocalExport(o.local),o.local.type==="Literal"&&this.raise(o.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")};I.checkExport=function(e,t,r){!e||(typeof t!="string"&&(t=t.type==="Identifier"?t.name:t.value),Zt(e,t)&&this.raiseRecoverable(r,"Duplicate export '"+t+"'"),e[t]=!0)};I.checkPatternExport=function(e,t){var r=t.type;if(r==="Identifier")this.checkExport(e,t,t.start);else if(r==="ObjectPattern")for(var i=0,s=t.properties;i<s.length;i+=1){var n=s[i];this.checkPatternExport(e,n)}else if(r==="ArrayPattern")for(var a=0,o=t.elements;a<o.length;a+=1){var u=o[a];u&&this.checkPatternExport(e,u)}else r==="Property"?this.checkPatternExport(e,t.value):r==="AssignmentPattern"?this.checkPatternExport(e,t.left):r==="RestElement"?this.checkPatternExport(e,t.argument):r==="ParenthesizedExpression"&&this.checkPatternExport(e,t.expression)};I.checkVariableExport=function(e,t){if(!!e)for(var r=0,i=t;r<i.length;r+=1){var s=i[r];this.checkPatternExport(e,s.id)}};I.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};I.parseExportSpecifiers=function(e){var t=[],r=!0;for(this.expect(c.braceL);!this.eat(c.braceR);){if(r)r=!1;else if(this.expect(c.comma),this.afterTrailingComma(c.braceR))break;var i=this.startNode();i.local=this.parseModuleExportName(),i.exported=this.eatContextual("as")?this.parseModuleExportName():i.local,this.checkExport(e,i.exported,i.exported.start),t.push(this.finishNode(i,"ExportSpecifier"))}return t};I.parseImport=function(e){return this.next(),this.type===c.string?(e.specifiers=Da,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===c.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(e,"ImportDeclaration")};I.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===c.name){var r=this.startNode();if(r.local=this.parseIdent(),this.checkLValSimple(r.local,De),e.push(this.finishNode(r,"ImportDefaultSpecifier")),!this.eat(c.comma))return e}if(this.type===c.star){var i=this.startNode();return this.next(),this.expectContextual("as"),i.local=this.parseIdent(),this.checkLValSimple(i.local,De),e.push(this.finishNode(i,"ImportNamespaceSpecifier")),e}for(this.expect(c.braceL);!this.eat(c.braceR);){if(t)t=!1;else if(this.expect(c.comma),this.afterTrailingComma(c.braceR))break;var s=this.startNode();s.imported=this.parseModuleExportName(),this.eatContextual("as")?s.local=this.parseIdent():(this.checkUnreserved(s.imported),s.local=s.imported),this.checkLValSimple(s.local,De),e.push(this.finishNode(s,"ImportSpecifier"))}return e};I.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===c.string){var e=this.parseLiteral(this.value);return Na.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)};I.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)};I.isDirectiveCandidate=function(e){return e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var Ce=G.prototype;Ce.toAssignable=function(e,t,r){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",r&&this.checkPatternErrors(r,!0);for(var i=0,s=e.properties;i<s.length;i+=1){var n=s[i];this.toAssignable(n,t),n.type==="RestElement"&&(n.argument.type==="ArrayPattern"||n.argument.type==="ObjectPattern")&&this.raise(n.argument.start,"Unexpected token")}break;case"Property":e.kind!=="init"&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",r&&this.checkPatternErrors(r,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),e.argument.type==="AssignmentPattern"&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":e.operator!=="="&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,r);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else r&&this.checkPatternErrors(r,!0);return e};Ce.toAssignableList=function(e,t){for(var r=e.length,i=0;i<r;i++){var s=e[i];s&&this.toAssignable(s,t)}if(r){var n=e[r-1];this.options.ecmaVersion===6&&t&&n&&n.type==="RestElement"&&n.argument.type!=="Identifier"&&this.unexpected(n.argument.start)}return e};Ce.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")};Ce.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==c.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")};Ce.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case c.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(c.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case c.braceL:return this.parseObj(!0)}return this.parseIdent()};Ce.parseBindingList=function(e,t,r){for(var i=[],s=!0;!this.eat(e);)if(s?s=!1:this.expect(c.comma),t&&this.type===c.comma)i.push(null);else{if(r&&this.afterTrailingComma(e))break;if(this.type===c.ellipsis){var n=this.parseRestBinding();this.parseBindingListItem(n),i.push(n),this.type===c.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}else{var a=this.parseMaybeDefault(this.start,this.startLoc);this.parseBindingListItem(a),i.push(a)}}return i};Ce.parseBindingListItem=function(e){return e};Ce.parseMaybeDefault=function(e,t,r){if(r=r||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(c.eq))return r;var i=this.startNodeAt(e,t);return i.left=r,i.right=this.parseMaybeAssign(),this.finishNode(i,"AssignmentPattern")};Ce.checkLValSimple=function(e,t,r){t===void 0&&(t=Wr);var i=t!==Wr;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(i?"Binding ":"Assigning to ")+e.name+" in strict mode"),i&&(t===De&&e.name==="let"&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),r&&(Zt(r,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),r[e.name]=!0),t!==Ys&&this.declareName(e.name,t,e.start));break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":i&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return i&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,r);default:this.raise(e.start,(i?"Binding":"Assigning to")+" rvalue")}};Ce.checkLValPattern=function(e,t,r){switch(t===void 0&&(t=Wr),e.type){case"ObjectPattern":for(var i=0,s=e.properties;i<s.length;i+=1){var n=s[i];this.checkLValInnerPattern(n,t,r)}break;case"ArrayPattern":for(var a=0,o=e.elements;a<o.length;a+=1){var u=o[a];u&&this.checkLValInnerPattern(u,t,r)}break;default:this.checkLValSimple(e,t,r)}};Ce.checkLValInnerPattern=function(e,t,r){switch(t===void 0&&(t=Wr),e.type){case"Property":this.checkLValInnerPattern(e.value,t,r);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,r);break;case"RestElement":this.checkLValPattern(e.argument,t,r);break;default:this.checkLValPattern(e,t,r)}};var Ee=function(t,r,i,s,n){this.token=t,this.isExpr=!!r,this.preserveSpace=!!i,this.override=s,this.generator=!!n},q={b_stat:new Ee("{",!1),b_expr:new Ee("{",!0),b_tmpl:new Ee("${",!1),p_stat:new Ee("(",!1),p_expr:new Ee("(",!0),q_tmpl:new Ee("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new Ee("function",!1),f_expr:new Ee("function",!0),f_expr_gen:new Ee("function",!0,!1,null,!0),f_gen:new Ee("function",!1,!1,null,!0)},Ft=G.prototype;Ft.initialContext=function(){return[q.b_stat]};Ft.curContext=function(){return this.context[this.context.length-1]};Ft.braceIsBlock=function(e){var t=this.curContext();return t===q.f_expr||t===q.f_stat?!0:e===c.colon&&(t===q.b_stat||t===q.b_expr)?!t.isExpr:e===c._return||e===c.name&&this.exprAllowed?ye.test(this.input.slice(this.lastTokEnd,this.start)):e===c._else||e===c.semi||e===c.eof||e===c.parenR||e===c.arrow?!0:e===c.braceL?t===q.b_stat:e===c._var||e===c._const||e===c.name?!1:!this.exprAllowed};Ft.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token==="function")return t.generator}return!1};Ft.updateContext=function(e){var t,r=this.type;r.keyword&&e===c.dot?this.exprAllowed=!1:(t=r.updateContext)?t.call(this,e):this.exprAllowed=r.beforeExpr};Ft.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)};c.parenR.updateContext=c.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();e===q.b_stat&&this.curContext().token==="function"&&(e=this.context.pop()),this.exprAllowed=!e.isExpr};c.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?q.b_stat:q.b_expr),this.exprAllowed=!0};c.dollarBraceL.updateContext=function(){this.context.push(q.b_tmpl),this.exprAllowed=!0};c.parenL.updateContext=function(e){var t=e===c._if||e===c._for||e===c._with||e===c._while;this.context.push(t?q.p_stat:q.p_expr),this.exprAllowed=!0};c.incDec.updateContext=function(){};c._function.updateContext=c._class.updateContext=function(e){e.beforeExpr&&e!==c._else&&!(e===c.semi&&this.curContext()!==q.p_stat)&&!(e===c._return&&ye.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===c.colon||e===c.braceL)&&this.curContext()===q.b_stat)?this.context.push(q.f_expr):this.context.push(q.f_stat),this.exprAllowed=!1};c.backQuote.updateContext=function(){this.curContext()===q.q_tmpl?this.context.pop():this.context.push(q.q_tmpl),this.exprAllowed=!1};c.star.updateContext=function(e){if(e===c._function){var t=this.context.length-1;this.context[t]===q.f_expr?this.context[t]=q.f_expr_gen:this.context[t]=q.f_gen}this.exprAllowed=!0};c.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==c.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var N=G.prototype;N.checkPropClash=function(e,t,r){if(!(this.options.ecmaVersion>=9&&e.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var i=e.key,s;switch(i.type){case"Identifier":s=i.name;break;case"Literal":s=String(i.value);break;default:return}var n=e.kind;if(this.options.ecmaVersion>=6){s==="__proto__"&&n==="init"&&(t.proto&&(r?r.doubleProto<0&&(r.doubleProto=i.start):this.raiseRecoverable(i.start,"Redefinition of __proto__ property")),t.proto=!0);return}s="$"+s;var a=t[s];if(a){var o;n==="init"?o=this.strict&&a.init||a.get||a.set:o=a.init||a[n],o&&this.raiseRecoverable(i.start,"Redefinition of property")}else a=t[s]={init:!1,get:!1,set:!1};a[n]=!0}};N.parseExpression=function(e,t){var r=this.start,i=this.startLoc,s=this.parseMaybeAssign(e,t);if(this.type===c.comma){var n=this.startNodeAt(r,i);for(n.expressions=[s];this.eat(c.comma);)n.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(n,"SequenceExpression")}return s};N.parseMaybeAssign=function(e,t,r){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var i=!1,s=-1,n=-1,a=-1;t?(s=t.parenthesizedAssign,n=t.trailingComma,a=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new Gr,i=!0);var o=this.start,u=this.startLoc;(this.type===c.parenL||this.type===c.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await");var l=this.parseMaybeConditional(e,t);if(r&&(l=r.call(this,l,o,u)),this.type.isAssign){var h=this.startNodeAt(o,u);return h.operator=this.value,this.type===c.eq&&(l=this.toAssignable(l,!1,t)),i||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=l.start&&(t.shorthandAssign=-1),this.type===c.eq?this.checkLValPattern(l):this.checkLValSimple(l),h.left=l,this.next(),h.right=this.parseMaybeAssign(e),a>-1&&(t.doubleProto=a),this.finishNode(h,"AssignmentExpression")}else i&&this.checkExpressionErrors(t,!0);return s>-1&&(t.parenthesizedAssign=s),n>-1&&(t.trailingComma=n),l};N.parseMaybeConditional=function(e,t){var r=this.start,i=this.startLoc,s=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return s;if(this.eat(c.question)){var n=this.startNodeAt(r,i);return n.test=s,n.consequent=this.parseMaybeAssign(),this.expect(c.colon),n.alternate=this.parseMaybeAssign(e),this.finishNode(n,"ConditionalExpression")}return s};N.parseExprOps=function(e,t){var r=this.start,i=this.startLoc,s=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||s.start===r&&s.type==="ArrowFunctionExpression"?s:this.parseExprOp(s,r,i,-1,e)};N.parseExprOp=function(e,t,r,i,s){var n=this.type.binop;if(n!=null&&(!s||this.type!==c._in)&&n>i){var a=this.type===c.logicalOR||this.type===c.logicalAND,o=this.type===c.coalesce;o&&(n=c.logicalAND.binop);var u=this.value;this.next();var l=this.start,h=this.startLoc,f=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,s),l,h,n,s),m=this.buildBinary(t,r,e,f,u,a||o);return(a&&this.type===c.coalesce||o&&(this.type===c.logicalOR||this.type===c.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(m,t,r,i,s)}return e};N.buildBinary=function(e,t,r,i,s,n){i.type==="PrivateIdentifier"&&this.raise(i.start,"Private identifier can only be left side of binary expression");var a=this.startNodeAt(e,t);return a.left=r,a.operator=s,a.right=i,this.finishNode(a,n?"LogicalExpression":"BinaryExpression")};N.parseMaybeUnary=function(e,t,r,i){var s=this.start,n=this.startLoc,a;if(this.isContextual("await")&&this.canAwait)a=this.parseAwait(i),t=!0;else if(this.type.prefix){var o=this.startNode(),u=this.type===c.incDec;o.operator=this.value,o.prefix=!0,this.next(),o.argument=this.parseMaybeUnary(null,!0,u,i),this.checkExpressionErrors(e,!0),u?this.checkLValSimple(o.argument):this.strict&&o.operator==="delete"&&o.argument.type==="Identifier"?this.raiseRecoverable(o.start,"Deleting local variable in strict mode"):o.operator==="delete"&&en(o.argument)?this.raiseRecoverable(o.start,"Private fields can not be deleted"):t=!0,a=this.finishNode(o,u?"UpdateExpression":"UnaryExpression")}else if(!t&&this.type===c.privateId)(i||this.privateNameStack.length===0)&&this.unexpected(),a=this.parsePrivateIdent(),this.type!==c._in&&this.unexpected();else{if(a=this.parseExprSubscripts(e,i),this.checkExpressionErrors(e))return a;for(;this.type.postfix&&!this.canInsertSemicolon();){var l=this.startNodeAt(s,n);l.operator=this.value,l.prefix=!1,l.argument=a,this.checkLValSimple(a),this.next(),a=this.finishNode(l,"UpdateExpression")}}if(!r&&this.eat(c.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(s,n,a,this.parseMaybeUnary(null,!1,!1,i),"**",!1);else return a};function en(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&en(e.expression)}N.parseExprSubscripts=function(e,t){var r=this.start,i=this.startLoc,s=this.parseExprAtom(e,t);if(s.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return s;var n=this.parseSubscripts(s,r,i,!1,t);return e&&n.type==="MemberExpression"&&(e.parenthesizedAssign>=n.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=n.start&&(e.parenthesizedBind=-1),e.trailingComma>=n.start&&(e.trailingComma=-1)),n};N.parseSubscripts=function(e,t,r,i,s){for(var n=this.options.ecmaVersion>=8&&e.type==="Identifier"&&e.name==="async"&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,a=!1;;){var o=this.parseSubscript(e,t,r,i,n,a,s);if(o.optional&&(a=!0),o===e||o.type==="ArrowFunctionExpression"){if(a){var u=this.startNodeAt(t,r);u.expression=o,o=this.finishNode(u,"ChainExpression")}return o}e=o}};N.parseSubscript=function(e,t,r,i,s,n,a){var o=this.options.ecmaVersion>=11,u=o&&this.eat(c.questionDot);i&&u&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var l=this.eat(c.bracketL);if(l||u&&this.type!==c.parenL&&this.type!==c.backQuote||this.eat(c.dot)){var h=this.startNodeAt(t,r);h.object=e,l?(h.property=this.parseExpression(),this.expect(c.bracketR)):this.type===c.privateId&&e.type!=="Super"?h.property=this.parsePrivateIdent():h.property=this.parseIdent(this.options.allowReserved!=="never"),h.computed=!!l,o&&(h.optional=u),e=this.finishNode(h,"MemberExpression")}else if(!i&&this.eat(c.parenL)){var f=new Gr,m=this.yieldPos,p=this.awaitPos,x=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var b=this.parseExprList(c.parenR,this.options.ecmaVersion>=8,!1,f);if(s&&!u&&!this.canInsertSemicolon()&&this.eat(c.arrow))return this.checkPatternErrors(f,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=m,this.awaitPos=p,this.awaitIdentPos=x,this.parseArrowExpression(this.startNodeAt(t,r),b,!0,a);this.checkExpressionErrors(f,!0),this.yieldPos=m||this.yieldPos,this.awaitPos=p||this.awaitPos,this.awaitIdentPos=x||this.awaitIdentPos;var d=this.startNodeAt(t,r);d.callee=e,d.arguments=b,o&&(d.optional=u),e=this.finishNode(d,"CallExpression")}else if(this.type===c.backQuote){(u||n)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var w=this.startNodeAt(t,r);w.tag=e,w.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(w,"TaggedTemplateExpression")}return e};N.parseExprAtom=function(e,t){this.type===c.slash&&this.readRegexp();var r,i=this.potentialArrowAt===this.start;switch(this.type){case c._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),r=this.startNode(),this.next(),this.type===c.parenL&&!this.allowDirectSuper&&this.raise(r.start,"super() call outside constructor of a subclass"),this.type!==c.dot&&this.type!==c.bracketL&&this.type!==c.parenL&&this.unexpected(),this.finishNode(r,"Super");case c._this:return r=this.startNode(),this.next(),this.finishNode(r,"ThisExpression");case c.name:var s=this.start,n=this.startLoc,a=this.containsEsc,o=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!a&&o.name==="async"&&!this.canInsertSemicolon()&&this.eat(c._function))return this.overrideContext(q.f_expr),this.parseFunction(this.startNodeAt(s,n),0,!1,!0,t);if(i&&!this.canInsertSemicolon()){if(this.eat(c.arrow))return this.parseArrowExpression(this.startNodeAt(s,n),[o],!1,t);if(this.options.ecmaVersion>=8&&o.name==="async"&&this.type===c.name&&!a&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return o=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(c.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(s,n),[o],!0,t)}return o;case c.regexp:var u=this.value;return r=this.parseLiteral(u.value),r.regex={pattern:u.pattern,flags:u.flags},r;case c.num:case c.string:return this.parseLiteral(this.value);case c._null:case c._true:case c._false:return r=this.startNode(),r.value=this.type===c._null?null:this.type===c._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,"Literal");case c.parenL:var l=this.start,h=this.parseParenAndDistinguishExpression(i,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(h)&&(e.parenthesizedAssign=l),e.parenthesizedBind<0&&(e.parenthesizedBind=l)),h;case c.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(c.bracketR,!0,!0,e),this.finishNode(r,"ArrayExpression");case c.braceL:return this.overrideContext(q.b_expr),this.parseObj(!1,e);case c._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case c._class:return this.parseClass(this.startNode(),!1);case c._new:return this.parseNew();case c.backQuote:return this.parseTemplate();case c._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}};N.parseExprImport=function(){var e=this.startNode();this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import");var t=this.parseIdent(!0);switch(this.type){case c.parenL:return this.parseDynamicImport(e);case c.dot:return e.meta=t,this.parseImportMeta(e);default:this.unexpected()}};N.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(c.parenR)){var t=this.start;this.eat(c.comma)&&this.eat(c.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")};N.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")};N.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")};N.parseParenExpression=function(){this.expect(c.parenL);var e=this.parseExpression();return this.expect(c.parenR),e};N.parseParenAndDistinguishExpression=function(e,t){var r=this.start,i=this.startLoc,s,n=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var a=this.start,o=this.startLoc,u=[],l=!0,h=!1,f=new Gr,m=this.yieldPos,p=this.awaitPos,x;for(this.yieldPos=0,this.awaitPos=0;this.type!==c.parenR;)if(l?l=!1:this.expect(c.comma),n&&this.afterTrailingComma(c.parenR,!0)){h=!0;break}else if(this.type===c.ellipsis){x=this.start,u.push(this.parseParenItem(this.parseRestBinding())),this.type===c.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}else u.push(this.parseMaybeAssign(!1,f,this.parseParenItem));var b=this.lastTokEnd,d=this.lastTokEndLoc;if(this.expect(c.parenR),e&&!this.canInsertSemicolon()&&this.eat(c.arrow))return this.checkPatternErrors(f,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=m,this.awaitPos=p,this.parseParenArrowList(r,i,u,t);(!u.length||h)&&this.unexpected(this.lastTokStart),x&&this.unexpected(x),this.checkExpressionErrors(f,!0),this.yieldPos=m||this.yieldPos,this.awaitPos=p||this.awaitPos,u.length>1?(s=this.startNodeAt(a,o),s.expressions=u,this.finishNodeAt(s,"SequenceExpression",b,d)):s=u[0]}else s=this.parseParenExpression();if(this.options.preserveParens){var w=this.startNodeAt(r,i);return w.expression=s,this.finishNode(w,"ParenthesizedExpression")}else return s};N.parseParenItem=function(e){return e};N.parseParenArrowList=function(e,t,r,i){return this.parseArrowExpression(this.startNodeAt(e,t),r,!1,i)};var ja=[];N.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(c.dot)){e.meta=t;var r=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),r&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var i=this.start,s=this.startLoc,n=this.type===c._import;return e.callee=this.parseSubscripts(this.parseExprAtom(),i,s,!0,!1),n&&e.callee.type==="ImportExpression"&&this.raise(i,"Cannot use new with import()"),this.eat(c.parenL)?e.arguments=this.parseExprList(c.parenR,this.options.ecmaVersion>=8,!1):e.arguments=ja,this.finishNode(e,"NewExpression")};N.parseTemplateElement=function(e){var t=e.isTagged,r=this.startNode();return this.type===c.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),r.value={raw:this.value,cooked:null}):r.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
13
- `),cooked:this.value},this.next(),r.tail=this.type===c.backQuote,this.finishNode(r,"TemplateElement")};N.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var r=this.startNode();this.next(),r.expressions=[];var i=this.parseTemplateElement({isTagged:t});for(r.quasis=[i];!i.tail;)this.type===c.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(c.dollarBraceL),r.expressions.push(this.parseExpression()),this.expect(c.braceR),r.quasis.push(i=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(r,"TemplateLiteral")};N.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===c.name||this.type===c.num||this.type===c.string||this.type===c.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===c.star)&&!ye.test(this.input.slice(this.lastTokEnd,this.start))};N.parseObj=function(e,t){var r=this.startNode(),i=!0,s={};for(r.properties=[],this.next();!this.eat(c.braceR);){if(i)i=!1;else if(this.expect(c.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(c.braceR))break;var n=this.parseProperty(e,t);e||this.checkPropClash(n,s,t),r.properties.push(n)}return this.finishNode(r,e?"ObjectPattern":"ObjectExpression")};N.parseProperty=function(e,t){var r=this.startNode(),i,s,n,a;if(this.options.ecmaVersion>=9&&this.eat(c.ellipsis))return e?(r.argument=this.parseIdent(!1),this.type===c.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(r,"RestElement")):(this.type===c.parenL&&t&&(t.parenthesizedAssign<0&&(t.parenthesizedAssign=this.start),t.parenthesizedBind<0&&(t.parenthesizedBind=this.start)),r.argument=this.parseMaybeAssign(!1,t),this.type===c.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(r,"SpreadElement"));this.options.ecmaVersion>=6&&(r.method=!1,r.shorthand=!1,(e||t)&&(n=this.start,a=this.startLoc),e||(i=this.eat(c.star)));var o=this.containsEsc;return this.parsePropertyName(r),!e&&!o&&this.options.ecmaVersion>=8&&!i&&this.isAsyncProp(r)?(s=!0,i=this.options.ecmaVersion>=9&&this.eat(c.star),this.parsePropertyName(r,t)):s=!1,this.parsePropertyValue(r,e,i,s,n,a,t,o),this.finishNode(r,"Property")};N.parsePropertyValue=function(e,t,r,i,s,n,a,o){if((r||i)&&this.type===c.colon&&this.unexpected(),this.eat(c.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,a),e.kind="init";else if(this.options.ecmaVersion>=6&&this.type===c.parenL)t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(r,i);else if(!t&&!o&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==c.comma&&this.type!==c.braceR&&this.type!==c.eq){(r||i)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var u=e.kind==="get"?0:1;if(e.value.params.length!==u){var l=e.value.start;e.kind==="get"?this.raiseRecoverable(l,"getter should have no params"):this.raiseRecoverable(l,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")}else this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((r||i)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=s),e.kind="init",t?e.value=this.parseMaybeDefault(s,n,this.copyNode(e.key)):this.type===c.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),e.value=this.parseMaybeDefault(s,n,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected()};N.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(c.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(c.bracketR),e.key;e.computed=!1}return e.key=this.type===c.num||this.type===c.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};N.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)};N.parseMethod=function(e,t,r){var i=this.startNode(),s=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(i),this.options.ecmaVersion>=6&&(i.generator=e),this.options.ecmaVersion>=8&&(i.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(qi(t,i.generator)|$i|(r?Ks:0)),this.expect(c.parenL),i.params=this.parseBindingList(c.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(i,!1,!0,!1),this.yieldPos=s,this.awaitPos=n,this.awaitIdentPos=a,this.finishNode(i,"FunctionExpression")};N.parseArrowExpression=function(e,t,r,i){var s=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.enterScope(qi(r,!1)|Qs),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!r),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,i),this.yieldPos=s,this.awaitPos=n,this.awaitIdentPos=a,this.finishNode(e,"ArrowFunctionExpression")};N.parseFunctionBody=function(e,t,r,i){var s=t&&this.type!==c.braceL,n=this.strict,a=!1;if(s)e.body=this.parseMaybeAssign(i),e.expression=!0,this.checkParams(e,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!n||o)&&(a=this.strictDirective(this.end),a&&o&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var u=this.labels;this.labels=[],a&&(this.strict=!0),this.checkParams(e,!n&&!a&&!t&&!r&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,Ys),e.body=this.parseBlock(!1,void 0,a&&!n),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=u}this.exitScope()};N.isSimpleParamList=function(e){for(var t=0,r=e;t<r.length;t+=1){var i=r[t];if(i.type!=="Identifier")return!1}return!0};N.checkParams=function(e,t){for(var r=Object.create(null),i=0,s=e.params;i<s.length;i+=1){var n=s[i];this.checkLValInnerPattern(n,Wi,t?null:r)}};N.parseExprList=function(e,t,r,i){for(var s=[],n=!0;!this.eat(e);){if(n)n=!1;else if(this.expect(c.comma),t&&this.afterTrailingComma(e))break;var a=void 0;r&&this.type===c.comma?a=null:this.type===c.ellipsis?(a=this.parseSpread(i),i&&this.type===c.comma&&i.trailingComma<0&&(i.trailingComma=this.start)):a=this.parseMaybeAssign(!1,i),s.push(a)}return s};N.checkUnreserved=function(e){var t=e.start,r=e.end,i=e.name;if(this.inGenerator&&i==="yield"&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&i==="await"&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),this.currentThisScope().inClassFieldInit&&i==="arguments"&&this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(i==="arguments"||i==="await")&&this.raise(t,"Cannot use "+i+" in class static initialization block"),this.keywords.test(i)&&this.raise(t,"Unexpected keyword '"+i+"'"),!(this.options.ecmaVersion<6&&this.input.slice(t,r).indexOf("\\")!==-1)){var s=this.strict?this.reservedWordsStrict:this.reservedWords;s.test(i)&&(!this.inAsync&&i==="await"&&this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+i+"' is reserved"))}};N.parseIdent=function(e,t){var r=this.startNode();return this.type===c.name?r.name=this.value:this.type.keyword?(r.name=this.type.keyword,(r.name==="class"||r.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop()):this.unexpected(),this.next(!!e),this.finishNode(r,"Identifier"),e||(this.checkUnreserved(r),r.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=r.start)),r};N.parsePrivateIdent=function(){var e=this.startNode();return this.type===c.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,"PrivateIdentifier"),this.privateNameStack.length===0?this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(e),e};N.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===c.semi||this.canInsertSemicolon()||this.type!==c.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(c.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")};N.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,"AwaitExpression")};var zr=G.prototype;zr.raise=function(e,t){var r=Hs(this.input,e);t+=" ("+r.line+":"+r.column+")";var i=new SyntaxError(t);throw i.pos=e,i.loc=r,i.raisedAt=this.pos,i};zr.raiseRecoverable=zr.raise;zr.curPosition=function(){if(this.options.locations)return new Xt(this.curLine,this.pos-this.lineStart)};var rt=G.prototype,Ba=function(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[],this.inClassFieldInit=!1};rt.enterScope=function(e){this.scopeStack.push(new Ba(e))};rt.exitScope=function(){this.scopeStack.pop()};rt.treatFunctionsAsVarInScope=function(e){return e.flags&Lt||!this.inModule&&e.flags&Yt};rt.declareName=function(e,t,r){var i=!1;if(t===De){var s=this.currentScope();i=s.lexical.indexOf(e)>-1||s.functions.indexOf(e)>-1||s.var.indexOf(e)>-1,s.lexical.push(e),this.inModule&&s.flags&Yt&&delete this.undefinedExports[e]}else if(t===Xs){var n=this.currentScope();n.lexical.push(e)}else if(t===Js){var a=this.currentScope();this.treatFunctionsAsVar?i=a.lexical.indexOf(e)>-1:i=a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var u=this.scopeStack[o];if(u.lexical.indexOf(e)>-1&&!(u.flags&Gs&&u.lexical[0]===e)||!this.treatFunctionsAsVarInScope(u)&&u.functions.indexOf(e)>-1){i=!0;break}if(u.var.push(e),this.inModule&&u.flags&Yt&&delete this.undefinedExports[e],u.flags&Ui)break}i&&this.raiseRecoverable(r,"Identifier '"+e+"' has already been declared")};rt.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)};rt.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};rt.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&Ui)return t}};rt.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&Ui&&!(t.flags&Qs))return t}};var Kr=function(t,r,i){this.type="",this.start=r,this.end=0,t.options.locations&&(this.loc=new Qr(t,i)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[r,0])},tr=G.prototype;tr.startNode=function(){return new Kr(this,this.start,this.startLoc)};tr.startNodeAt=function(e,t){return new Kr(this,e,t)};function tn(e,t,r,i){return e.type=t,e.end=r,this.options.locations&&(e.loc.end=i),this.options.ranges&&(e.range[1]=r),e}tr.finishNode=function(e,t){return tn.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)};tr.finishNodeAt=function(e,t,r,i){return tn.call(this,e,t,r,i)};tr.copyNode=function(e){var t=new Kr(this,e.start,this.startLoc);for(var r in e)t[r]=e[r];return t};var rn="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",sn=rn+" Extended_Pictographic",nn=sn,an=nn+" EBase EComp EMod EPres ExtPict",$a=an,Ua={9:rn,10:sn,11:nn,12:an,13:$a},Vs="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",on="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",un=on+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",ln=un+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",cn=ln+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",qa=cn+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Wa={9:on,10:un,11:ln,12:cn,13:qa},hn={};function Ha(e){var t=hn[e]={binary:yt(Ua[e]+" "+Vs),nonBinary:{General_Category:yt(Vs),Script:yt(Wa[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(qr=0,Fi=[9,10,11,12,13];qr<Fi.length;qr+=1)js=Fi[qr],Ha(js);var js,qr,Fi,A=G.prototype,je=function(t){this.parser=t,this.validFlags="gim"+(t.options.ecmaVersion>=6?"uy":"")+(t.options.ecmaVersion>=9?"s":"")+(t.options.ecmaVersion>=13?"d":""),this.unicodeProperties=hn[t.options.ecmaVersion>=13?13:t.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=[]};je.prototype.reset=function(t,r,i){var s=i.indexOf("u")!==-1;this.start=t|0,this.source=r+"",this.flags=i,this.switchU=s&&this.parser.options.ecmaVersion>=6,this.switchN=s&&this.parser.options.ecmaVersion>=9};je.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)};je.prototype.at=function(t,r){r===void 0&&(r=!1);var i=this.source,s=i.length;if(t>=s)return-1;var n=i.charCodeAt(t);if(!(r||this.switchU)||n<=55295||n>=57344||t+1>=s)return n;var a=i.charCodeAt(t+1);return a>=56320&&a<=57343?(n<<10)+a-56613888:n};je.prototype.nextIndex=function(t,r){r===void 0&&(r=!1);var i=this.source,s=i.length;if(t>=s)return s;var n=i.charCodeAt(t),a;return!(r||this.switchU)||n<=55295||n>=57344||t+1>=s||(a=i.charCodeAt(t+1))<56320||a>57343?t+1:t+2};je.prototype.current=function(t){return t===void 0&&(t=!1),this.at(this.pos,t)};je.prototype.lookahead=function(t){return t===void 0&&(t=!1),this.at(this.nextIndex(this.pos,t),t)};je.prototype.advance=function(t){t===void 0&&(t=!1),this.pos=this.nextIndex(this.pos,t)};je.prototype.eat=function(t,r){return r===void 0&&(r=!1),this.current(r)===t?(this.advance(r),!0):!1};A.validateRegExpFlags=function(e){for(var t=e.validFlags,r=e.flags,i=0;i<r.length;i++){var s=r.charAt(i);t.indexOf(s)===-1&&this.raise(e.start,"Invalid regular expression flag"),r.indexOf(s,i+1)>-1&&this.raise(e.start,"Duplicate regular expression flag")}};A.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))};A.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,r=e.backReferenceNames;t<r.length;t+=1){var i=r[t];e.groupNames.indexOf(i)===-1&&e.raise("Invalid named capture referenced")}};A.regexp_disjunction=function(e){for(this.regexp_alternative(e);e.eat(124);)this.regexp_alternative(e);this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")};A.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););};A.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1};A.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var r=!1;if(this.options.ecmaVersion>=9&&(r=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!r,!0}return e.pos=t,!1};A.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1};A.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)};A.regexp_eatBracedQuantifier=function(e,t){var r=e.pos;if(e.eat(123)){var i=0,s=-1;if(this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(s=e.lastIntValue),e.eat(125)))return s!==-1&&s<i&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=r}return!1};A.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)};A.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1};A.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)&&e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}e.pos=t}return!1};A.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1};A.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};A.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1};A.regexp_eatSyntaxCharacter=function(e){var t=e.current();return fn(t)?(e.lastIntValue=t,e.advance(),!0):!1};function fn(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}A.regexp_eatPatternCharacters=function(e){for(var t=e.pos,r=0;(r=e.current())!==-1&&!fn(r);)e.advance();return e.pos!==t};A.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),!0):!1};A.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e)){e.groupNames.indexOf(e.lastStringValue)!==-1&&e.raise("Duplicate capture group name"),e.groupNames.push(e.lastStringValue);return}e.raise("Invalid group")}};A.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1};A.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=tt(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=tt(e.lastIntValue);return!0}return!1};A.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,r=this.options.ecmaVersion>=11,i=e.current(r);return e.advance(r),i===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,r)&&(i=e.lastIntValue),za(i)?(e.lastIntValue=i,!0):(e.pos=t,!1)};function za(e){return Ve(e,!0)||e===36||e===95}A.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,r=this.options.ecmaVersion>=11,i=e.current(r);return e.advance(r),i===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,r)&&(i=e.lastIntValue),Qa(i)?(e.lastIntValue=i,!0):(e.pos=t,!1)};function Qa(e){return Nt(e,!0)||e===36||e===95||e===8204||e===8205}A.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)};A.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var r=e.lastIntValue;if(e.switchU)return r>e.maxBackReference&&(e.maxBackReference=r),!0;if(r<=e.numCapturingParens)return!0;e.pos=t}return!1};A.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1};A.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};A.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1};A.regexp_eatZero=function(e){return e.current()===48&&!Jr(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1};A.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114?(e.lastIntValue=13,e.advance(),!0):!1};A.regexp_eatControlLetter=function(e){var t=e.current();return pn(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function pn(e){return e>=65&&e<=90||e>=97&&e<=122}A.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var r=e.pos,i=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(i&&s>=55296&&s<=56319){var n=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var a=e.lastIntValue;if(a>=56320&&a<=57343)return e.lastIntValue=(s-55296)*1024+(a-56320)+65536,!0}e.pos=n,e.lastIntValue=s}return!0}if(i&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&Ga(e.lastIntValue))return!0;i&&e.raise("Invalid unicode escape"),e.pos=r}return!1};function Ga(e){return e>=0&&e<=1114111}A.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),!0):!1};A.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};A.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(Ka(t))return e.lastIntValue=-1,e.advance(),!0;if(e.switchU&&this.options.ecmaVersion>=9&&(t===80||t===112)){if(e.lastIntValue=-1,e.advance(),e.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(e)&&e.eat(125))return!0;e.raise("Invalid property name")}return!1};function Ka(e){return e===100||e===68||e===115||e===83||e===119||e===87}A.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var r=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,r,i),!0}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var s=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,s),!0}return!1};A.regexp_validateUnicodePropertyNameAndValue=function(e,t,r){Zt(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(r)||e.raise("Invalid property value")};A.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name")};A.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";mn(t=e.current());)e.lastStringValue+=tt(t),e.advance();return e.lastStringValue!==""};function mn(e){return pn(e)||e===95}A.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";Ja(t=e.current());)e.lastStringValue+=tt(t),e.advance();return e.lastStringValue!==""};function Ja(e){return mn(e)||Jr(e)}A.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};A.regexp_eatCharacterClass=function(e){if(e.eat(91)){if(e.eat(94),this.regexp_classRanges(e),e.eat(93))return!0;e.raise("Unterminated character class")}return!1};A.regexp_classRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var r=e.lastIntValue;e.switchU&&(t===-1||r===-1)&&e.raise("Invalid character class"),t!==-1&&r!==-1&&t>r&&e.raise("Range out of order in character class")}}};A.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var r=e.current();(r===99||xn(r))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var i=e.current();return i!==93?(e.lastIntValue=i,e.advance(),!0):!1};A.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};A.regexp_eatClassControlLetter=function(e){var t=e.current();return Jr(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1};A.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1};A.regexp_eatDecimalDigits=function(e){var t=e.pos,r=0;for(e.lastIntValue=0;Jr(r=e.current());)e.lastIntValue=10*e.lastIntValue+(r-48),e.advance();return e.pos!==t};function Jr(e){return e>=48&&e<=57}A.regexp_eatHexDigits=function(e){var t=e.pos,r=0;for(e.lastIntValue=0;dn(r=e.current());)e.lastIntValue=16*e.lastIntValue+gn(r),e.advance();return e.pos!==t};function dn(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function gn(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}A.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var r=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+r*8+e.lastIntValue:e.lastIntValue=t*8+r}else e.lastIntValue=t;return!0}return!1};A.regexp_eatOctalDigit=function(e){var t=e.current();return xn(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function xn(e){return e>=48&&e<=55}A.regexp_eatFixedHexDigits=function(e,t){var r=e.pos;e.lastIntValue=0;for(var i=0;i<t;++i){var s=e.current();if(!dn(s))return e.pos=r,!1;e.lastIntValue=16*e.lastIntValue+gn(s),e.advance()}return!0};var zi=function(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new Qr(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end])},R=G.prototype;R.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new zi(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};R.getToken=function(){return this.next(),new zi(this)};typeof Symbol<"u"&&(R[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===c.eof,value:t}}}});R.nextToken=function(){var e=this.curContext();if((!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(c.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())};R.readToken=function(e){return Ve(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};R.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888};R.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,r=this.input.indexOf("*/",this.pos+=2);if(r===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=r+2,this.options.locations)for(var i=void 0,s=t;(i=Us(this.input,s,this.pos))>-1;)++this.curLine,s=this.lineStart=i;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,r),t,this.pos,e,this.curPosition())};R.skipLineComment=function(e){for(var t=this.pos,r=this.options.onComment&&this.curPosition(),i=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!Rt(i);)i=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,r,this.curPosition())};R.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(e>8&&e<14||e>=5760&&qs.test(String.fromCharCode(e)))++this.pos;else break e}}};R.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var r=this.type;this.type=e,this.value=t,this.updateContext(r)};R.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(c.ellipsis)):(++this.pos,this.finishToken(c.dot))};R.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(c.assign,2):this.finishOp(c.slash,1)};R.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),r=1,i=e===42?c.star:c.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++r,i=c.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(c.assign,r+1):this.finishOp(i,r)};R.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12){var r=this.input.charCodeAt(this.pos+2);if(r===61)return this.finishOp(c.assign,3)}return this.finishOp(e===124?c.logicalOR:c.logicalAND,2)}return t===61?this.finishOp(c.assign,2):this.finishOp(e===124?c.bitwiseOR:c.bitwiseAND,1)};R.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(c.assign,2):this.finishOp(c.bitwiseXOR,1)};R.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||ye.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(c.incDec,2):t===61?this.finishOp(c.assign,2):this.finishOp(c.plusMin,1)};R.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),r=1;return t===e?(r=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+r)===61?this.finishOp(c.assign,r+1):this.finishOp(c.bitShift,r)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(r=2),this.finishOp(c.relational,r))};R.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(c.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(c.arrow)):this.finishOp(e===61?c.eq:c.prefix,1)};R.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var r=this.input.charCodeAt(this.pos+2);if(r<48||r>57)return this.finishOp(c.questionDot,2)}if(t===63){if(e>=12){var i=this.input.charCodeAt(this.pos+2);if(i===61)return this.finishOp(c.assign,3)}return this.finishOp(c.coalesce,2)}}return this.finishOp(c.question,1)};R.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),Ve(t,!0)||t===92))return this.finishToken(c.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+tt(t)+"'")};R.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(c.parenL);case 41:return++this.pos,this.finishToken(c.parenR);case 59:return++this.pos,this.finishToken(c.semi);case 44:return++this.pos,this.finishToken(c.comma);case 91:return++this.pos,this.finishToken(c.bracketL);case 93:return++this.pos,this.finishToken(c.bracketR);case 123:return++this.pos,this.finishToken(c.braceL);case 125:return++this.pos,this.finishToken(c.braceR);case 58:return++this.pos,this.finishToken(c.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(c.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===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(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(c.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+tt(e)+"'")};R.finishOp=function(e,t){var r=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,r)};R.readRegexp=function(){for(var e,t,r=this.pos;;){this.pos>=this.input.length&&this.raise(r,"Unterminated regular expression");var i=this.input.charAt(this.pos);if(ye.test(i)&&this.raise(r,"Unterminated regular expression"),e)e=!1;else{if(i==="[")t=!0;else if(i==="]"&&t)t=!1;else if(i==="/"&&!t)break;e=i==="\\"}++this.pos}var s=this.input.slice(r,this.pos);++this.pos;var n=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(n);var o=this.regexpState||(this.regexpState=new je(this));o.reset(r,s,a),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var u=null;try{u=new RegExp(s,a)}catch{}return this.finishToken(c.regexp,{pattern:s,flags:a,value:u})};R.readInt=function(e,t,r){for(var i=this.options.ecmaVersion>=12&&t===void 0,s=r&&this.input.charCodeAt(this.pos)===48,n=this.pos,a=0,o=0,u=0,l=t??1/0;u<l;++u,++this.pos){var h=this.input.charCodeAt(this.pos),f=void 0;if(i&&h===95){s&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),o===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),u===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),o=h;continue}if(h>=97?f=h-97+10:h>=65?f=h-65+10:h>=48&&h<=57?f=h-48:f=1/0,f>=e)break;o=h,a=a*e+f}return i&&o===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===n||t!=null&&this.pos-n!==t?null:a};function Xa(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function yn(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}R.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var r=this.readInt(e);return r==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(r=yn(this.input.slice(t,this.pos)),++this.pos):Ve(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(c.num,r)};R.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,"Invalid number");var r=this.pos-t>=2&&this.input.charCodeAt(t)===48;r&&this.strict&&this.raise(t,"Invalid number");var i=this.input.charCodeAt(this.pos);if(!r&&!e&&this.options.ecmaVersion>=11&&i===110){var s=yn(this.input.slice(t,this.pos));return++this.pos,Ve(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(c.num,s)}r&&/[89]/.test(this.input.slice(t,this.pos))&&(r=!1),i===46&&!r&&(++this.pos,this.readInt(10),i=this.input.charCodeAt(this.pos)),(i===69||i===101)&&!r&&(i=this.input.charCodeAt(++this.pos),(i===43||i===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,"Invalid number")),Ve(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var n=Xa(this.input.slice(t,this.pos),r);return this.finishToken(c.num,n)};R.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var r=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(r,"Code point out of bounds")}else t=this.readHexChar(4);return t};R.readString=function(e){for(var t="",r=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var i=this.input.charCodeAt(this.pos);if(i===e)break;i===92?(t+=this.input.slice(r,this.pos),t+=this.readEscapedChar(!1),r=this.pos):i===8232||i===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(Rt(i)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(r,this.pos++),this.finishToken(c.string,t)};var bn={};R.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===bn)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};R.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw bn;this.raise(e,t)};R.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var r=this.input.charCodeAt(this.pos);if(r===96||r===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===c.template||this.type===c.invalidTemplate)?r===36?(this.pos+=2,this.finishToken(c.dollarBraceL)):(++this.pos,this.finishToken(c.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(c.template,e));if(r===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(Rt(r)){switch(e+=this.input.slice(t,this.pos),++this.pos,r){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
14
- `;break;default:e+=String.fromCharCode(r);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}};R.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(c.invalidTemplate,this.input.slice(this.start,this.pos))}this.raise(this.start,"Unterminated template")};R.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
15
- `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return tt(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var r=this.pos-1;return this.invalidStringToken(r,"Invalid escape sequence in template string"),null}default:if(t>=48&&t<=55){var i=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],s=parseInt(i,8);return s>255&&(i=i.slice(0,-1),s=parseInt(i,8)),this.pos+=i.length-1,t=this.input.charCodeAt(this.pos),(i!=="0"||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-i.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(s)}return Rt(t)?"":String.fromCharCode(t)}};R.readHexChar=function(e){var t=this.pos,r=this.readInt(16,e);return r===null&&this.invalidStringToken(t,"Bad character escape sequence"),r};R.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,r=this.pos,i=this.options.ecmaVersion>=6;this.pos<this.input.length;){var s=this.fullCharCodeAtPos();if(Nt(s,i))this.pos+=s<=65535?1:2;else if(s===92){this.containsEsc=!0,e+=this.input.slice(r,this.pos);var n=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var a=this.readCodePoint();(t?Ve:Nt)(a,i)||this.invalidStringToken(n,"Invalid Unicode escape"),e+=tt(a),r=this.pos}else break;t=!1}return e+this.input.slice(r,this.pos)};R.readWord=function(){var e=this.readWord1(),t=c.name;return this.keywords.test(e)&&(t=ji[e]),this.finishToken(t,e)};var Ya="8.7.1";G.acorn={Parser:G,version:Ya,defaultOptions:Di,Position:Xt,SourceLocation:Qr,getLineInfo:Hs,Node:Kr,TokenType:M,tokTypes:c,keywordTypes:ji,TokContext:Ee,tokContexts:q,isIdentifierChar:Nt,isIdentifierStart:Ve,Token:zi,isNewLine:Rt,lineBreak:ye,lineBreakG:Oa,nonASCIIwhitespace:qs};var Ti=G.extend(function(e){let t=!1,r=!1,i=!1;return class extends e{parseFunction(s,n,a,o,u){return this.type.label==="**"&&(s.isSubscriptFunction=!0,this.next()),super.parseFunction(s,n,a,o,u)}isClassElementNameStart(){return this.type.label==="**"&&(t=!0,this.next()),super.isClassElementNameStart()}isAsyncProp(s){return this.type.label==="**"&&(t=!0,this.next()),super.isAsyncProp(s)}eat(s){return(i&&s.label===":"||(i||r)&&s.label==="*")&&this.type.label==="**"?(t=!0,this.next(),!1):super.eat(s)}parseProperty(s,n){i=!0;let a=super.parseProperty(s,n);return i=!1,t&&(a.value.isSubscriptFunction=!0,t=!1),a}parseClassElement(s){r=!0;let n=super.parseClassElement(s);return r=!1,t&&(n.value.isSubscriptFunction=!0,t=!1),n}}});var wn=e=>class extends Ni(e){static get subscriptParams(){return{globalsAutoObserve:["document"]}}static expose(t,r){let i=y(t,"oohtml","subscript","instances"),s=r.name;return s||(s=[...i.keys()].filter(n=>$(n)).length),i.set(s,r),r}static implementMethod(t,r){let i=super.implementMethod(t,r);return this.expose(r,i)}static implementScript(t,r){let i=(t.textContent||"").trim();return this.expose(r,U.call(r,i,{compilerParams:this.compilerParams,runtimeParams:this.runtimeParams}))}static doConnectedCallback(t){if(typeof WebQit>"u"||!WebQit.Observer)return;let r=y(t,"oohtml","subscript","instances"),i=(s,n,a=[])=>{r.forEach(o=>o.thread(...s.map(u=>a.concat(u.path))))};(this.subscriptParams.globalsAutoObserve||[]).forEach(s=>{WebQit.Observer.observe(globalThis[s],n=>i(n,null,[s]),{subtree:!0,diff:!0,tags:[t,"subscript-element",s],unique:!0})}),WebQit.Observer.observe(t,s=>i(s,null,["this"]),{subtree:!0,diff:!0,tags:[t,"subscript-element","this"],unique:!0})}static doDisconnectedCallback(t){typeof WebQit>"u"||!WebQit.Observer||((this.subscriptParams.globalsAutoObserve||[]).forEach(r=>{WebQit.Observer.unobserve(globalThis[r],null,null,{subtree:!0,tags:[t,"subscript-element",r]})}),WebQit.Observer.unobserve(t,null,null,{subtree:!0,tags:[t,"subscript-element","this"]}))}connectedCallback(){this.constructor.doConnectedCallback(this),super.connectedCallback&&super.connectedCallback()}disconnectedCallback(){this.constructor.doDisconnectedCallback(this),super.disconnectedCallback&&super.disconnectedCallback()}get subscript(){return y(this,"oohtml","subscript","instances")}};function Xr(e={}){let t=ae.call(this);if(e.onDomReady){t.DOM.ready(()=>{Xr.call(this,{...e,onDomReady:!1})});return}let r=t.DOM.mutations,i=Ae.call(this,{selectors:{script:'script[type="subscript"]'},api:{bind:"bind",unbind:"unbind"},script:{}},e.params),s=a=>class extends wn(a){static get compilerParams(){return e.compilerParams||{}}static get runtimeParams(){return e.runtimeParams||{}}},n=s();r.onPresent(i.get("selectors.script"),a=>{let o=a.parentNode;if(!o)return;let u=y(o,"oohtml","subscript").get("script-tags");if(u||(u=new WeakSet,y(o,"oohtml","subscript").set("script-tags",u)),u.has(a))return;n.implementScript(a,o)(),n.doConnectedCallback(o),u.add(a);let l=r.onRemoved(o,()=>{n.doDisconnectedCallback(o),u.delete(a),l.disconnect()},{ignoreTransients:!0})}),t.OOHTML||(t.OOHTML={}),t.OOHTML.SubscriptElement=s}function Yr(e={}){let t=ae.call(this);t.OOHTML||(t.OOHTML={},t.Observer=P,Dr.call(this,e.HTMLModules||{}),Vr.call(this,e.HTMLImports||{}),jr.call(this,e.NamespacedHTML||{}),Br.call(this,e.StateAPI||{}),Xr.call(this,e.Subscript||{}))}Yr.call(window);var Zi={};ts(Zi,{start:()=>Qo});var rr=class{constructor(t,r=null){Object.defineProperty(this,"dict",{value:Object.create(t)});for(let i in this.dict)i in this||(this[i]=this.dict[i]);arguments.length>1&&Object.defineProperty(this.dict,"CWD",{get:()=>r})}get name(){return"webflo"}static create(...t){return new this(...t)}get CWD(){return this.dict.CWD||""}get meta(){return this.dict.meta||{}}get app(){return this.dict.app||{}}get config(){return this.dict.config||{}}get flags(){return this.dict.flags||{}}set flags(t){this.dict.flags=t}get layout(){return this.dict.layout||{}}set layout(t){this.dict.layout=t}get logger(){return this.dict.logger}set logger(t){this.dict.logger=t}};var ir=class extends rr{};typeof URLPattern>"u"&&await Promise.resolve().then(()=>(Dn(),Mn));function Vn(e,t,r,i=!1){if(W(t)&&t.endsWith("]")){var s=Qe(xi(t,"["),"]")||0;return $(s)&&(s=parseInt(s)),t=Qe(t,"[")||0,$(t)&&(t=parseInt(t)),Vn(e,t,(n,a)=>{if(!n[a]){if(!i)return r();n[a]=$(s)?[]:{}}return r(n[a],s)},i)}else return r(e,t)}function ar(e,t,r,i=!0){Vn(e,t,(s,n)=>{$(n)?(n=n||S(s)?s.length:Object.keys(s).filter($).length,O(r,!1).forEach((a,o)=>{s[n+o]=a})):s[n]=i&&n in s?O(s[n],!1).concat(r):r},!0)}function Be(e,t={},r="&"){return e=e||"",(e.startsWith("?")?e.substr(1):e).split(r).filter(i=>i).map(i=>i.split("=").map(s=>s.trim())).forEach(i=>ar(t,i[0],decodeURIComponent(i[1]))),t}function Zr(e,t,r,i=null){if((E(t)||S(t))&&(!i||i(t,e))){var s=S(t);Object.keys(t).forEach(n=>{Zr(`${e}[${n}]`,t[n],r,i)})}else r(e,!t&&t!==0?"":t)}function nt(e,t="&",r=null){var i=[];return Object.keys(e).forEach(s=>{Zr(s,e[s],(n,a)=>{i.push(`${n}=${encodeURIComponent(a)}`)},r)}),i.join(t)}var jn={join(){for(var e=[],t=0,r=0,i=arguments.length;r<i;r++)e=e.concat(arguments[r].split("/"));var s=[];for(r=0,i=e.length;r<i;r++){var n=e[r];!n||n==="."||(n===".."?s.length?s.pop():t++:s.push(n))}return e[0]===""&&s.unshift(""),"../".repeat(t)+s.join("/")||(s.length?"/":".")},dirname(e){return this.join(e,"..")}};var or=class{constructor(t,r){this.cx=t,this.path=S(r)?r:(r+"").split("/").filter(i=>i)}async route(t,r,i,s,n=null){let a=this,o=async function(u){let l={};if(!u.trail||u.trail.length<u.destination.length){if(u=await a.readTick(u),l.pathname=`/${u.trail.join("/")}`,l.stepname=u.trail[u.trail.length-1],a.finalizeHandlerContext(l,u),u.exports){u.exports.hints&&await r.port.post({...u.exports.hints,$type:"handler:hints"});let h=O(u.method),f=T(u.exports)&&h.includes("default")?u.exports:h.reduce((m,p)=>m||u.exports[p.toLowerCase()],null);if(f){let m=async(...x)=>{let b={...u,arg:x[0]};if(x.length>1){var d=x[1],w,v={...x[2]||{}};if(x[1]instanceof b.event.Request)w=x[1],d=w.url;else if(!W(d))throw new Error("Router redirect url must be a string!");var _=d.startsWith("/")?d:a.pathJoin(`/${u.trail.join("/")}`,d);if(_.startsWith("../"))throw new Error("Router redirect cannot traverse beyond the routing directory! ("+d+" >> "+_+")");v.method&&(b.method=v.method,S(v.method)&&(v.method=v.method[0])),w?b.event=u.event.retarget(w,{...v,_proxy:{url:_}}):b.event=u.event.retarget(_,v),b.source=u.destination.join("/"),b.destination=_.split("?").shift().split("/").map(C=>C.trim()).filter(C=>C),b.trail=x[1].startsWith("/")?[]:u.trail.reduce((C,F,D)=>C.length===D&&F===b.destination[D]?C.concat(F):C,[]),b.trailOnFile=u.trailOnFile.slice(0,b.trail.length)}return o(b)},p=u.destination.slice(u.trail.length);return m.pathname=p.join("/"),m.stepname=p[0],await f.call(l,u.event,u.arg,m,n)}return o(u)}else if((u.currentSegmentOnFile||{}).dirExists)return o(u)}if(s)return await s.call(l,u.event,u.arg,n)};return o({destination:this.path,event:r,method:t,arg:i})}};var Dt=class extends or{async readTick(t){var r=this.cx.layout,i=Object.keys(this.cx.layout);return t.trail?(t.currentSegment=t.destination[t.trail.length],t.currentSegmentOnFile=[t.currentSegment,"-"].reduce((s,n)=>{if(s.index)return s;var a=`/${t.trailOnFile.concat(n).join("/")}`;return r[a]?{seg:n,index:a}:i.filter(o=>o.startsWith(`${a}/`)).length?{seg:n,dirExists:!0}:s},{seg:null}),t.trail.push(t.currentSegment),t.trailOnFile.push(t.currentSegmentOnFile.seg),t.exports=r[t.currentSegmentOnFile.index]):(t.trail=[],t.trailOnFile=[],t.currentSegmentOnFile={index:"/"},t.exports=r["/"]),t}finalizeHandlerContext(t,r){return t.dirname=r.currentSegmentOnFile.index}pathJoin(...t){return jn.join(...t)}};var ur=class{constructor(t){this.cx=t}async handle(t,r){let i=new Dt(this.cx,t.url.pathname),s=async()=>{let n=t.request.method.toLowerCase();return i.route([n==="delete"?"del":n,"default"],t,{},async a=>r(a.request),r)};return await(this.cx.middlewares||[]).concat(s).reverse().reduce((n,a)=>()=>a.call(this.cx,t,i,n),null)()}async render(t,r){let i=await r.json();return new Dt(this.cx,t.url.pathname).route("render",t,i,async(n,a)=>(window.WebQit.DOM&&await new Promise(o=>window.WebQit.DOM.ready(o)),window.document.state&&(window.document.state.env||window.document.setState({env:"client",onHydration:(n.detail||{}).srcType==="init",network:this.cx.runtime.network,url:this.cx.runtime.location},{update:!0}),window.document.setState({data:a},{update:"merge"})),window.document.templates&&(window.document.body.setAttribute("template","routes/"+n.url.pathname.split("/").filter(o=>o).map(o=>o+"+-").join("/")),await new Promise(o=>(window.document.templatesReadyState==="complete"&&o(),window.document.addEventListener("templatesreadystatechange",o)))),await this.scrollIntoView(n),window))}async unrender(t){window.document.state&&window.document.setState({data:{}},{update:"merge"})}async scrollIntoView(t){if(!(t.detail.src instanceof Element))return;await new Promise(s=>setTimeout(s,10));let r,i;t.url.hash&&(i=document.querySelector(t.url.hash))?i.scrollIntoView():(r=Array.from(document.querySelectorAll("[data-viewport-top]")).pop())?r.focus():document.body.scrollIntoView()}};function Bn(e=null,t=!1){let r=t?"localStorage":"sessionStorage";if(!window[r])throw new Error(`The specified Web Storage API ${r} is invalid or not supported`);let i={};return P.intercept(i,(s,n,a)=>{let o=e?`${e}.${s.name}`:s.name;if(s.type==="get"&&W(o)){let h=window[r].getItem(o);return ee(h)?h:JSON.parse(h)}if(s.type==="set")return window[r].setItem(o,ee(s.value)?s.value:JSON.stringify(s.value)),!0;if(s.type==="deleteProperty")return window[r].removeItem(o),!0;if(s.type==="has"){for(var u=0;u<window[r].length;u++)if(window[r].key(u)===o)return!0;return!1}if(s.type==="ownKeys"){for(var l=[],u=0;u<window[r].length;u++)l.push(window[r].key(u));return l}return s.type==="getOwnPropertyDescriptor"?{enumerable:!0,configurable:!0}:a()}),P.proxy(i)}var Ne=class{constructor(t){let r=this.constructor;var i=(s,n)=>E(s)&&E(n)?i(Object.keys(s),Object.keys(n))&&i(Object.values(s),Object.values(n)):S(s)&&S(n)?s.length===n.length&&s.reduce((a,o,u)=>a&&o===n[u],!0):s===n;P.intercept(this,"set",(s,n,a)=>s.name==="hash"&&s.value&&!s.value.startsWith("#")?a("#"+s.value):s.name==="search"&&s.value&&!s.value.startsWith("?")?a("?"+s.value):a()),P.observe(this,s=>{var n={},a;for(var o of s){if(o.name==="href"&&o.related.length===1){var n=r.parseUrl(o.value);delete n.query,delete n.href,a=!0}if(o.name==="query"&&(o.path.length>1||!o.related.includes("search"))){var u=r.toSearch(this.query);u!==this.search&&(n.search=u)}if(o.name==="search"){var l=r.toQuery(n.search||this.search);i(l,this.query)||(n.query=l)}}if(!a){var h=this.origin,f=[this.username,this.password].filter(p=>p);f.length===2&&(h=`${this.protocol}//${f.join(":")}@${this.hostname}${this.port?`:${this.port}`:""}`);var m=[h,n.pathname||this.pathname,n.search||this.search,this.hash].join("");m!==this.href&&(n.href=m)}if(!Re(n))return P.set(this,n)},{subtree:!0,diff:!0}),P.observe(this,s=>{s.forEach(n=>{if(n&&n.detail){if(!k(n.detail))throw new Error('"e.detail" can only be of type object.');if(n.detail.request&&!E(n.detail.request))throw new Error('"e.detail.request" can only be of type object.')}})},{diff:!0}),P.set(this,W(t)?r.parseUrl(t):Ne.copy(t))}toString(){return this.href}static from(t){return new this(E(t)?t:this.parseUrl(t))}static copy(t){var r=Po.reduce((i,s)=>gi(i,s,t[s]),{});return"query"in t||delete r.query,r}static parseUrl(t){var r=document.createElement("a");return r.href=t,this.copy(r)}static toQuery(t){return Be(t)}static toSearch(t){var r=nt(t);return r?"?"+r:""}},Po=["protocol","username","password","host","hostname","port","origin","pathname","search","query","hash","href"];var{URL:ei,fetch:$n,Headers:Gi,Request:Un,Response:qn,FormData:Wn,ReadableStream:Oo,File:Y1,Blob:Ki}=globalThis;var To=e=>{let t=class extends e{constructor(...r){super(...r);var i=Be(this.search);let s=n=>{var a=nt(n);a=a?"?"+a:"",a!==this.search&&(this.search=a)};this.__query={value:i,proxy:new Proxy(i,{set(n,a,o){return n[a]=o,s(n),!0},deleteProperty(n,a){return delete n[a],s(n),!0}})}}set search(r){super.search=r;var i=Be(r);Ji(i,this.query)||(this.query=i)}get search(){return super.search}get query(){return this.__query.proxy}};return t.Observable=class extends t{constructor(){super(...arguments);let{Observer:r}=WebQit;r.accessorize(this,["protocol","username","password","host","hostname","port","origin","pathname","search","query","hash","href"])}},t},Ji=(e,t)=>E(e)&&E(t)?Ji(Object.keys(e),Object.keys(t))&&Ji(Object.values(e),Object.values(t)):S(e)&&S(t)?e.length===t.length&&e.reduce((r,i,s)=>r&&i===t[s],!0):e===t,Hn=To;var No=e=>class extends e{tee(t=null){let r=new this.constructor,i=new this.constructor;for(var[s,n]of this.entries()){let a=a(n);t&&t(n,s,a)||!t&&!a?r.append(s,n):i.append(s,n)}return[r,i]}json(t={},r=null){if(arguments.length){Object.keys(t).forEach(a=>{Zr(a,t[a],(o,u)=>{(!r||r(o,u,k(u)))&&this.append(o,u)},o=>!Xi(o))});return}var i;for(var[s,n]of this.entries())i||(i=$(We(s,"["))?[]:{}),ar(i,s,n);return i}},zn=No,Xi=(e,t=null)=>{if(!k(e))return;let r=e[Symbol.toStringTag];return(t||["Uint8Array","Uint16Array","Uint32Array","ArrayBuffer","Blob","File","FormData","Stream"]).reduce((i,s)=>i||(r===s?s:null),null)};var Ro=e=>class extends e{constructor(t={}){t instanceof e?super(t):(super(),this.json(t))}json(t={},r=!0){if(arguments.length){let a=Qn(this),o=Object.keys(a).reduce((u,l)=>u.concat(typeof l!="symbol"&&"set"in a[l]?l:[]),[]);Object.keys(t).forEach(u=>{var l=o.reduce((h,f)=>h||(f===u||f.toLocaleLowerCase()===u?f:null),null);l?(r||this[l]===void 0)&&(this[l]=t[u]):(r||!this.has(u))&&this.set(u,t[u])});return}let i={};for(var[s,n]of this)i[s]=n;return i}set cacheControl(t){return this.set("Cache-Control",t)}get cacheControl(){return this.get("Cache-Control")}set contentLength(t){return this.set("Content-Length",t)}get contentLength(){return this.get("Content-Length")}set contentType(t){return this.set("Content-Type",t)}get contentType(){return this.get("Content-Type")}},ti=Ro;function Qn(e){if(e){let t=Object.getPrototypeOf(e);return t===Object.prototype?{}:{...Qn(t),...Object.getOwnPropertyDescriptors(e)}}else return Object.create(null)}var Lo=e=>class extends ti(e){set accept(t){return this.set("Accept",t)}get accept(){let t=this.get("Accept"),r=t&&t.split(",").map(i=>(i=i.trim().split(";").map(s=>s.trim()),[i.shift(),parseFloat((i.pop()||"1").replace("q=",""))])).sort((i,s)=>i[1]>s[1]?-1:1)||[];return{match(i){return i=(i+"").split("/"),r.reduce((s,n)=>s||(n=n[0].split("/"))&&[0,1].every(a=>i[a]===n[a]||i[a]==="*"||n[a]==="*"),!1)},toString(){return t}}}set cookies(t){if(!E(t))throw new Error(`Cookies must be of type object. Received type: ${H(t)}.`);return this.set("Cookie",nt(t,";")),this._cookies=null,!0}get cookies(){return this._cookies||(this._cookies=Be(this.get("cookie"),{},";")),this._cookies}set range(t){let r=[];return O(t).forEach((i,s)=>{let n=Array.isArray(i)?i.join("-"):i+"";s===0&&!n.includes("bytes=")&&(n=`bytes=${n}`),r.push(n)}),this.set("Range",r.join(", "))}get range(){let t=this.get("Range");return t?ke(t,"bytes=").split(",").map(i=>{let s=i.trim().split("-");return s[0]=s[0]?parseInt(s[0],10):void 0,s[1]&&(s[1]=parseInt(s[1],10)),s.clamp=n=>{(s[1]>n-1||s[1]===void 0)&&(s[1]=n-1),s[0]===void 0&&(s[0]=s[1]?n-s[1]-1:0)},s}):void 0}set cors(t){return this.set("Access-Control-Allow-Origin",t===!0?"*":t===!1?"":t)}get cors(){return this.get("Access-Control-Allow-Origin")}},Gn=Lo;var Fo=e=>class extends ti(e){set cookies(t){if(!E(t))throw new Error(`The "cookies" response directive cannot be of type: ${H(t)}`);for(let r in t){let i=t[r];if(E(i)){let s=[i.value];for(let n in i){if(n==="value")continue;let a=n[0].toUpperCase()+n.substring(1);a==="MaxAge"&&(a="Max-Age"),s.push(i[n]===!0?a:`${a}=${i[n]}`)}i=s.join("; ")}this.append("Set-Cookie",`${r}=${i}`)}return!0}get cookies(){let t=this.get("Set-Cookie");return t&&t.split(",").reduce((r,i)=>{let[s,n]=i.split(";"),[a,o]=s.trim().split("=");return r[a]={value:o},n&&(n||"").split(/\;/g).map(u=>u.trim().split("=")).forEach(u=>{r[a][u[0][0].toLowerCase()+u[0].substring(1).replace("-","")]=u.length===1?!0:u[1]}),r},{})}set contentRange(t){if(Array.isArray(t)){if(t.length===2&&!t[0].includes("-")||t.length<2)throw new Error("A Content-Range array must be in the format: [ 'start-end', 'total' ]");return this.set("Content-Range",`bytes ${t.join("/")}`)}return this.set("Content-Range",t)}get contentRange(){let t=this.get("Content-Range");return t&&ke(t,"bytes ").split("/")}set cors(t){return this.set("Access-Control-Allow-Origin",t===!0?"*":t===!1?"":t)}get cors(){return this.get("Access-Control-Allow-Origin")}set attachment(t){if(t=t===!0?"attachment":t===!1?"inline":t,!W(t))throw new Error(`The "download" response directive does not support the type: ${H(t)}`);return["attachment","inline"].includes(t)||(t=`attachment; filename="${t}"`),this.set("Content-Disposition",t)}get attachment(){var t=(this.get("Content-Disposition")||"").trim();return t=t==="attachment"?!0:t==="inline"?!1:ke(Qe(t,'"'),'filename="'),t}get location(){return this.get("Location")}set location(t){return this.set("Location",t)}get redirect(){return this.get("Location")}set redirect(t){return this.set("Location",t)}},Kn=Fo;var Mo=(e,t,r)=>{let i=class extends e{constructor(s,n,a){"headers"in n&&!(n.headers instanceof t)&&(n={...n},n.headers=new t(n.headers),arguments[1]=n),Re(n)?super(s):super(s,n),this._headers=n.headers,a.headers&&this.headers.json(a.headers);let o={};Object.defineProperty(this,"attrs",{get:()=>o}),Object.defineProperty(this,"bodyAttrs",{get:()=>a})}clone(){return new this.constructor(super.clone())}get headers(){return this._headers||(this._headers=new t(super.headers)),this._headers}get attrs(){return this.attrs}get url(){return"url"in this.attrs?this.attrs.url:super.url}async arrayBuffer(){return this.bodyAttrs.arrayBuffer?this.bodyAttrs.arrayBuffer:super.arrayBuffer()}async blob(){return this.bodyAttrs.blob?this.bodyAttrs.blob:super.blob()}async formData(){if(this.bodyAttrs.formData)return this.bodyAttrs.formData;let s=await super.formData();return s.tee=r.prototype.tee.bind(s),s.json=r.prototype.json.bind(s),s}async json(){return this.bodyAttrs.json?this.bodyAttrs.json:super.json()}async text(){return this.bodyAttrs.text?this.bodyAttrs.text:super.text()}jsonfy(s=!1){return(!this.bodyAttrs.jsonfied||s)&&(this.bodyAttrs.jsonfied=new Promise(async(n,a)=>{var o=this,u,l=o.headers.get("content-type")||"",h=l==="application/json"||this.bodyAttrs.json?"json":l==="application/x-www-form-urlencoded"||l.startsWith("multipart/form-data")||this.bodyAttrs.formData?"formData":l==="text/plain"?"plain":"other";try{h==="formData"?u=(await o.formData()).json():u=h==="json"?await o.json():h==="plain"?await o.text():o.body,n(u)}catch(f){a(f)}})),this.bodyAttrs.jsonfied}};return i.Headers=t,i},ri=Mo;function ii(e,t,r){let i={body:e,input:e},s=(o,u)=>{if(!t.encode)return;let[l,h]=t.encode(u);o.body=l,o.headers=h};if(W(e)||we(e))return i.inputType="text",i.text=e,i.headers={contentLength:(e+"").length},i;if(i.inputType=Xi(e),["Blob","File"].includes(i.inputType))i.blob=e,i.headers={contentType:e.type,contentLength:e.size};else if(["Uint8Array","Uint16Array","Uint32Array","ArrayBuffer"].includes(i.inputType))i.arrayBuffer=e,i.headers={contentLength:e.byteLength};else if(i.inputType==="FormData")i.formData=e,s(i,e);else if(E(e)&&bt(e)||S(e)&&ni(e)){i.inputType="object";var n,a=new t;a.json(e,(o,u,l)=>(n=n||l,!0)),n?(i.formData=a,s(i,a)):(i.json=e,i.body=JSON.stringify(e),i.headers={contentType:"application/json",contentLength:new r([i.body]).size}),i.jsonfied=e}return i}var Do=(e,t,r,i)=>class extends ri(e,t,r){constructor(s,n={}){n={...n};let a={};s instanceof e&&(n.method&&s.method!==n.method.toUpperCase()&&["GET","HEAD"].includes(n.method.toUpperCase())?(s=s.url,["headers","mode","credentials","cache","redirect","referrer","integrity"].forEach(u=>{u in n||(n[u]=s[u])})):a=s.bodyAttrs||{}),"body"in n&&(a=ii(n.body,r,i),n.body=a.body);let o;n.mode==="navigate"&&(o=!0,n={...n},delete n.mode),super(s,n,a),o&&(this.attrs.mode="navigate")}get mode(){return"mode"in this.attrs?this.attrs.mode:super.mode}get cache(){return"cache"in this.attrs?this.attrs.cache:super.cache}get destination(){return"destination"in this.attrs?this.attrs.destination:super.destination}get referrer(){return"referrer"in this.attrs?this.attrs.referrer:super.referrer}static compat(s,n=null){return s instanceof e?Object.setPrototypeOf(s,new this):new this(n,s)}},Jn=Do;var Vo=(e,t,r,i)=>class extends ri(e,t,r){constructor(s=null,n={}){let a={},o;arguments.length&&(s instanceof e?(o=s,n={status:s.status,statusText:s.statusText,headers:s.headers,...n},s.status===0&&delete n.status,a=s.bodyAttrs||{},s=s.body):(a=ii(s,r,i),s=a.body)),super(s,n,a),o&&(this.attrs.url=o.url,this.attrs.ok=o.ok,this.attrs.status=o.status,this.attrs.type=o.type,this.attrs.redirected=o.redirected)}get ok(){return"ok"in this.attrs?this.attrs.ok:super.ok}get status(){return"status"in this.attrs?this.attrs.status:super.status}get statusText(){return"statusText"in this.attrs?this.attrs.statusText:super.statusText}get type(){return"type"in this.attrs?this.attrs.type:super.type}get redirected(){return"redirected"in this.attrs?this.attrs.redirected:super.redirected}static compat(s){return s instanceof e?Object.setPrototypeOf(s,new this):new this(s)}},Xn=Vo;var jo=e=>e,Yn=jo;var Bo=(e,t,r)=>{let i=class{constructor(s,n,a){this._request=s,this._detail=n||{},this._sessionFactory=a,this.Request=e,this.Response=t,this.URL=r,this.port={listeners:[],post(o){let u=this.listeners.map(l=>l(o)).filter(l=>l instanceof Promise);if(process.length)return Promise.all(u)},listen(o){this.listeners.push(o)}}}get url(){return this._url||(this._url=new this.URL(this._request.url)),this._url}get request(){return this._request}get detail(){return this._detail}get session(){return this._session||(this._session=this.sessionFactory().get()),this._session}sessionFactory(...s){return this._sessionFactory(...s)}retarget(s,n={}){var a;return s instanceof e?Re(n)?a=s:a=new e(s,n):(a=new e(this._request,n),a.attrs.url=`${this.url.origin}${s}`,a.attrs.referrer=this.request.url),new i(a,this.detail)}};return i},Zn=Bo;var lr=class{constructor(t,r={}){this.ready=navigator.serviceWorker.ready,this.registration=new Promise((s,n)=>{let a=()=>{navigator.serviceWorker.register(t,{scope:r.scope||"/"}).then(async o=>{let u=h=>{let f=h.state==="installed"?"waiting":h.state==="activating"||h.state==="activated"?"active":h.state;P.set(this,f,h)},l=o.active||o.waiting||o.installing;u(l),l.addEventListener("statechange",h=>u(h.target)),o.addEventListener("updatefound",()=>{u(o.installing),o.installing.addEventListener("statechange",h=>u(h.target))}),s(o)}).catch(o=>n(o))};r.onWondowLoad?window.addEventListener("load",a):a(),r.startMessages&&navigator.serviceWorker.startMessages()});let i=(s,n,a=1)=>{if(this.active)T(s)&&(s=s()),n(this.active,s);else if(a){let o=u=>{T(s)&&(s=s()),n(u.value,s),a!==2&&P.unobserve(this,"active",o)};P.observe(this,"active",o)}};this.messaging={post:(s,n=1)=>(i(s,(a,o)=>{a.postMessage(o)},n),this.post),listen:s=>(navigator.serviceWorker.addEventListener("message",s),this.post),request:(s,n=1)=>new Promise(a=>{i(s,(o,u)=>{let l=new MessageChannel;o.postMessage(u,[l.port2]),l.port1.onmessage=h=>a(h.data)},n)}),channel(s){this.channels.has(s)||this.channels.set(s,new BroadcastChannel(n));let n=this.channels.get(s);return{broadcast:a=>n.postMessage(a),listen:a=>n.addEventListener("message",a)}},channels:new Map},this.notifications={fire:(s,n={})=>new Promise((a,o)=>{if(typeof Notification>"u"||Notification.permission!=="granted")return o(typeof Notification<"u"&&Notification&&Notification.permission);u.addEventListener("error",o);let u=new Notification(s,n);u.addEventListener("click",a),u.addEventListener("close",a)})},this.push={getSubscription:async()=>(await this.registration).pushManager.getSubscription(),subscribe:async(s,n={})=>{var a=await this.push.getSubscription();return a||(await this.registration).pushManager.subscribe(E(s)?s:{applicationServerKey:$o(s),...n})},unsubscribe:async()=>{var s=await this.push.getSubscription();return s?s.unsubscribe():null}}}};function $o(e){for(var t="=".repeat((4-e.length%4)%4),r=(e+t).replace(/\-/g,"+").replace(/_/g,"/"),i=window.atob(r),s=new Uint8Array(i.length),n=0;n<i.length;++n)s[n]=i.charCodeAt(n);return s}var Uo=Hn(ei),Yi=zn(Wn);var qo=Gn(Gi),Wo=Kn(Gi),ea=Jn(Un,qo,Yi,Ki),Vt=Xn(qn,Wo,Yi,Ki),Ho=Yn($n),zo=Zn(ea,Vt,Uo);var cr=class{constructor(t,r){this.cx=t,this.clients=new Map,this.cx.runtime=this;let i=r(this.cx,"*");if(!i||!i.handle)throw new Error('Application instance must define a ".handle()" method.');if(this.clients.set("*",i),P.set(this,"location",new Ne(window.document.location)),P.observe(this.location,[["href"]],([s])=>{if(!(s.value==="http:"||(s.detail||{}).src===window.document.location))if(s.value===window.document.location.href||s.value+"/"===window.document.location.href)window.history.replaceState(window.history.state,"",this.location.href);else try{window.history.pushState(window.history.state,"",this.location.href)}catch{}},{diff:!0}),window.addEventListener("popstate",s=>{window.setTimeout(()=>{this.go(Ne.copy(window.document.location),{},{src:window.document.location,srcType:"history"})},0)}),window.addEventListener("click",s=>{var n=s.target.closest("a");!n||!n.href||!n.target&&!n.download&&this.isSpaRoute(n,s)&&(this.go(Ne.copy(n),{},{src:n,srcType:"link"}),n.href.includes("#")||s.preventDefault())}),window.addEventListener("submit",s=>{var n=s.target.closest("form"),a=s.submitter,o=["action","enctype","method","noValidate","target"].reduce((f,m)=>(f[m]=a&&a.hasAttribute(`form${m.toLowerCase()}`)?a[`form${yr(m)}`]:n[m],f),{});o.method=a&&a.dataset.method||n.dataset.method||o.method,o.submitter=a;var u=window.document.createElement("a");if(u.href=o.action,!o.target&&this.isSpaRoute(u,s)){var l=new Yi(n);if((a||{}).name&&l.set(a.name,a.value),o.method.toUpperCase()==="GET"){var h=Be(u.search);Array.from(l.entries()).forEach(f=>{ar(h,f[0],f[1],!1)}),u.search=nt(h),l=null}this.go(Ne.copy(u),{method:o.method,body:l},{...o,src:n,srcType:"form"}),u.hash||s.preventDefault()}}),P.set(this,"network",{}),window.addEventListener("online",()=>P.set(this.network,"online",navigator.onLine)),window.addEventListener("offline",()=>P.set(this.network,"online",navigator.onLine)),this.cx.service_worker_support){let s=new lr(this.cx.worker_filename,{scope:this.cx.worker_scope,startMessages:!0});P.set(this,"workport",s),s.messaging.listen(async n=>{let a=n.ports[0],o=this.clients.get("*"),u=o.alert&&await o.alert(n);a&&(u instanceof Promise?u.then(l=>{a.postMessage(l)}):a.postMessage(u))})}this.go(this.location,{},{srcType:"init"})}get history(){return window.history}isSpaRoute(t,r){if(t=typeof t=="string"?new ei(t):t,t.origin&&t.origin!==this.location.origin||r&&(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey))return!1;if(!this.cx.params.routing)return!0;if(this.cx.params.routing.targets===!1)return!1;let i=t.pathname.split("/").filter(n=>n),s=n=>(n=n.split("/").filter(a=>a),n.reduce((a,o,u)=>a&&(o===i[u]||[o,i[u]].includes("-")),!0));return s(this.cx.params.routing.root)&&this.cx.params.routing.subroots.reduce((n,a)=>n&&!s(a),!0)}generateRequest(t,r){return new ea(t,{signal:this._abortController.signal,...r,headers:{Accept:"application/json","X-Redirect-Policy":"manual-when-cross-spa","X-Redirect-Code":this._xRedirectCode,"X-Powered-By":"@webqit/webflo",...r.headers||{}}})}getSession(t,r=null,i=!1){return Bn(r,i)}async go(t,r={},i={}){if(t=typeof t=="string"?new ei(t):t,r={referrer:this.location.href,...r},i.srcType!=="init"&&We(t.href,"#")===We(r.referrer,"#")&&(r.method||"GET").toUpperCase()==="GET")return new Vt(null,{status:304});this._abortController&&this._abortController.abort(),this._abortController=new AbortController,this._xRedirectCode=200,P.set(this.network,"error",null),P.set(this.network,"requesting",{...r,...i}),["link","form"].includes(i.srcType)&&(i.src.state&&(i.src.state.active=!0),i.submitter&&i.submitter.state&&(i.submitter.state.active=!0));let s=this.generateRequest(t.href,r),n=new zo(s,i,(l=null,h=!1)=>this.getSession(n,l,h)),a=this.clients.get("*"),o,u;try{o=await a.handle(n,(...l)=>this.remoteFetch(...l)),u=this.handleResponse(n,o),o.redirected?P.set(this.location,{href:o.url},{detail:{redirected:!0}}):[302,301].includes(u.status)||P.set(this.location,t),P.set(this.network,"requesting",null),["link","form"].includes(i.srcType)&&(i.src.state&&(i.src.state.active=!1),i.submitter&&i.submitter.state&&(i.submitter.state.active=!1)),u.ok&&u.headers.contentType==="application/json"?a.render&&await a.render(n,u):u.ok||([404,500].includes(u.status)&&P.set(this.network,"error",new Error(u.statusText,{cause:u.status})),a.unrender&&await a.unrender(n))}catch(l){console.error(l),P.set(this.network,"error",{...l,retry:()=>this.go(t,r={},i)}),u=new Vt(null,{status:500,statusText:l.message})}return u}remoteFetch(t,...r){let i=typeof t=="string"?t:t.url||t.href;P.set(this.network,"remote",i);let s=Ho(t,...r);return s.catch(n=>P.set(this.network,"error",n)),s.then(async n=>(P.set(this.network,"remote",null),new Vt(n)))}handleResponse(t,r){if(r instanceof Vt||(r=new Vt(r)),!r.redirected){let i=r.headers.get("Location");i&&r.status===this._xRedirectCode&&(r.attrs.status=parseInt(r.headers.get("X-Redirect-Code")),P.set(this.network,"redirecting",i),window.location=i)}return r}};async function Qo(e=null){let t=this||{},r=i=>new ur(i);return new cr(ir.create(t),(...i)=>e?e(...i.concat(r)):r(...i))}globalThis.WebQit||(globalThis.WebQit={});WebQit.Webflo=Zi;
1
+ /** @webqit/webflo */
2
+ var ta=Object.defineProperty;var ra=(e,t)=>()=>(e&&(t=e(e=0)),t);var ts=(e,t)=>{for(var r in t)ta(e,r,{get:t[r],enumerable:!0})};var Mn={};ts(Mn,{URLPattern:()=>Fn});function to(e,t){return(t?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(e)}function Sn(e,t=!1){let r=[],i=0;for(;i<e.length;){let s=e[i],n=function(a){if(!t)throw new TypeError(a);r.push({type:"INVALID_CHAR",index:i,value:e[i++]})};if(s==="*"){r.push({type:"ASTERISK",index:i,value:e[i++]});continue}if(s==="+"||s==="?"){r.push({type:"MODIFIER",index:i,value:e[i++]});continue}if(s==="\\"){r.push({type:"ESCAPED_CHAR",index:i++,value:e[i++]});continue}if(s==="{"){r.push({type:"OPEN",index:i,value:e[i++]});continue}if(s==="}"){r.push({type:"CLOSE",index:i,value:e[i++]});continue}if(s===":"){let a="",o=i+1;for(;o<e.length;){let u=e.substr(o,1);if(o===i+1&&Za.test(u)||o!==i+1&&eo.test(u)){a+=e[o++];continue}break}if(!a){n(`Missing parameter name at ${i}`);continue}r.push({type:"NAME",index:i,value:a}),i=o;continue}if(s==="("){let a=1,o="",u=i+1,l=!1;if(e[u]==="?"){n(`Pattern cannot start with "?" at ${u}`);continue}for(;u<e.length;){if(!to(e[u],!1)){n(`Invalid character '${e[u]}' at ${u}.`),l=!0;break}if(e[u]==="\\"){o+=e[u++]+e[u++];continue}if(e[u]===")"){if(a--,a===0){u++;break}}else if(e[u]==="("&&(a++,e[u+1]!=="?")){n(`Capturing groups are not allowed at ${u}`),l=!0;break}o+=e[u++]}if(l)continue;if(a){n(`Unbalanced pattern at ${i}`);continue}if(!o){n(`Missing pattern at ${i}`);continue}r.push({type:"PATTERN",index:i,value:o}),i=u;continue}r.push({type:"CHAR",index:i,value:e[i++]})}return r.push({type:"END",index:i,value:""}),r}function _n(e,t={}){let r=Sn(e),{prefixes:i="./"}=t,s=`[^${Mt(t.delimiter||"/#?")}]+?`,n=[],a=0,o=0,u="",l=new Set,h=d=>{if(o<r.length&&r[o].type===d)return r[o++].value},f=()=>{let d=h("MODIFIER");return d||h("ASTERISK")},m=d=>{let w=h(d);if(w!==void 0)return w;let{type:v,index:_}=r[o];throw new TypeError(`Unexpected ${v} at ${_}, expected ${d}`)},p=()=>{let d="",w;for(;w=h("CHAR")||h("ESCAPED_CHAR");)d+=w;return d},x=d=>d,b=t.encodePart||x;for(;o<r.length;){let d=h("CHAR"),w=h("NAME"),v=h("PATTERN");if(!w&&!v&&h("ASTERISK")&&(v=".*"),w||v){let F=d||"";i.indexOf(F)===-1&&(u+=F,F=""),u&&(n.push(b(u)),u="");let D=w||a++;if(l.has(D))throw new TypeError(`Duplicate name '${D}'.`);l.add(D),n.push({name:D,prefix:b(F),suffix:"",pattern:v||s,modifier:f()||""});continue}let _=d||h("ESCAPED_CHAR");if(_){u+=_;continue}if(h("OPEN")){let F=p(),D=h("NAME")||"",te=h("PATTERN")||"";!D&&!te&&h("ASTERISK")&&(te=".*");let V=p();m("CLOSE");let j=f()||"";if(!D&&!te&&!j){u+=F;continue}if(!D&&!te&&!F)continue;u&&(n.push(b(u)),u=""),n.push({name:D||(te?a++:""),pattern:D&&!te?s:te,prefix:b(F),suffix:b(V),modifier:j});continue}u&&(n.push(b(u)),u=""),m("END")}return n}function Mt(e){return e.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function En(e){return e&&e.sensitive?"u":"ui"}function ro(e,t){if(!t)return e;let r=/\((?:\?<(.*?)>)?(?!\?)/g,i=0,s=r.exec(e.source);for(;s;)t.push({name:s[1]||i++,prefix:"",suffix:"",modifier:"",pattern:""}),s=r.exec(e.source);return e}function io(e,t,r){let i=e.map(s=>kn(s,t,r).source);return new RegExp(`(?:${i.join("|")})`,En(r))}function so(e,t,r){return Cn(_n(e,r),t,r)}function Cn(e,t,r={}){let{strict:i=!1,start:s=!0,end:n=!0,encode:a=h=>h}=r,o=`[${Mt(r.endsWith||"")}]|$`,u=`[${Mt(r.delimiter||"/#?")}]`,l=s?"^":"";for(let h of e)if(typeof h=="string")l+=Mt(a(h));else{let f=Mt(a(h.prefix)),m=Mt(a(h.suffix));if(h.pattern)if(t&&t.push(h),f||m)if(h.modifier==="+"||h.modifier==="*"){let p=h.modifier==="*"?"?":"";l+=`(?:${f}((?:${h.pattern})(?:${m}${f}(?:${h.pattern}))*)${m})${p}`}else l+=`(?:${f}(${h.pattern})${m})${h.modifier}`;else h.modifier==="+"||h.modifier==="*"?l+=`((?:${h.pattern})${h.modifier})`:l+=`(${h.pattern})${h.modifier}`;else l+=`(?:${f}${m})${h.modifier}`}if(n)i||(l+=`${u}?`),l+=r.endsWith?`(?=${o})`:"$";else{let h=e[e.length-1],f=typeof h=="string"?u.indexOf(h[h.length-1])>-1:h===void 0;i||(l+=`(?:${u}(?=${o}))?`),f||(l+=`(?=${u}|${o})`)}return new RegExp(l,En(r))}function kn(e,t,r){return e instanceof RegExp?ro(e,t):Array.isArray(e)?io(e,t,r):so(e,t,r)}function oo(e,t){return e.length?e[0]==="/"?!0:!t||e.length<2?!1:(e[0]=="\\"||e[0]=="{")&&e[1]=="/":!1}function An(e,t){return e.startsWith(t)?e.substring(t.length,e.length):e}function uo(e,t){return e.endsWith(t)?e.substr(0,e.length-t.length):e}function Pn(e){return!e||e.length<2?!1:e[0]==="["||(e[0]==="\\"||e[0]==="{")&&e[1]==="["}function In(e){if(!e)return!0;for(let t of On)if(e.test(t))return!0;return!1}function lo(e,t){if(e=An(e,"#"),t||e==="")return e;let r=new URL("https://example.com");return r.hash=e,r.hash?r.hash.substring(1,r.hash.length):""}function co(e,t){if(e=An(e,"?"),t||e==="")return e;let r=new URL("https://example.com");return r.search=e,r.search?r.search.substring(1,r.search.length):""}function ho(e,t){return t||e===""?e:Pn(e)?Rn(e):Nn(e)}function fo(e,t){if(t||e==="")return e;let r=new URL("https://example.com");return r.password=e,r.password}function po(e,t){if(t||e==="")return e;let r=new URL("https://example.com");return r.username=e,r.username}function mo(e,t,r){if(r||e==="")return e;if(t&&!On.includes(t))return new URL(`${t}:${e}`).pathname;let i=e[0]=="/";return e=new URL(i?e:"/-"+e,"https://example.com").pathname,i||(e=e.substring(2,e.length)),e}function go(e,t,r){return Tn(t)===e&&(e=""),r||e===""?e:Ln(e)}function xo(e,t){return e=uo(e,":"),t||e===""?e:Qi(e)}function Tn(e){switch(e){case"ws":case"http":return"80";case"wws":case"https":return"443";case"ftp":return"21";default:return""}}function Qi(e){if(e==="")return e;if(/^[-+.A-Za-z0-9]*$/.test(e))return e.toLowerCase();throw new TypeError(`Invalid protocol '${e}'.`)}function yo(e){if(e==="")return e;let t=new URL("https://example.com");return t.username=e,t.username}function bo(e){if(e==="")return e;let t=new URL("https://example.com");return t.password=e,t.password}function Nn(e){if(e==="")return e;if(/[\t\n\r #%/:<>?@[\]^\\|]/g.test(e))throw new TypeError(`Invalid hostname '${e}'`);let t=new URL("https://example.com");return t.hostname=e,t.hostname}function Rn(e){if(e==="")return e;if(/[^0-9a-fA-F[\]:]/g.test(e))throw new TypeError(`Invalid IPv6 hostname '${e}'`);return e.toLowerCase()}function Ln(e){if(e===""||/^[0-9]*$/.test(e)&&parseInt(e)<=65535)return e;throw new TypeError(`Invalid port '${e}'.`)}function wo(e){if(e==="")return e;let t=new URL("https://example.com");return t.pathname=e[0]!=="/"?"/-"+e:e,e[0]!=="/"?t.pathname.substring(2,t.pathname.length):t.pathname}function vo(e){return e===""?e:new URL(`data:${e}`).pathname}function So(e){if(e==="")return e;let t=new URL("https://example.com");return t.search=e,t.search.substring(1,t.search.length)}function _o(e){if(e==="")return e;let t=new URL("https://example.com");return t.hash=e,t.hash.substring(1,t.hash.length)}function vn(e,t){if(typeof e!="string")throw new TypeError("parameter 1 is not of type 'string'.");let r=new URL(e,t);return{protocol:r.protocol.substring(0,r.protocol.length-1),username:r.username,password:r.password,hostname:r.hostname,port:r.port,pathname:r.pathname,search:r.search!=""?r.search.substring(1,r.search.length):void 0,hash:r.hash!=""?r.hash.substring(1,r.hash.length):void 0}}function sr(e,t,r){let i;if(typeof t.baseURL=="string")try{i=new URL(t.baseURL),e.protocol=i.protocol?i.protocol.substring(0,i.protocol.length-1):"",e.username=i.username,e.password=i.password,e.hostname=i.hostname,e.port=i.port,e.pathname=i.pathname,e.search=i.search?i.search.substring(1,i.search.length):"",e.hash=i.hash?i.hash.substring(1,i.hash.length):""}catch{throw new TypeError(`invalid baseURL '${t.baseURL}'.`)}if(typeof t.protocol=="string"&&(e.protocol=xo(t.protocol,r)),typeof t.username=="string"&&(e.username=po(t.username,r)),typeof t.password=="string"&&(e.password=fo(t.password,r)),typeof t.hostname=="string"&&(e.hostname=ho(t.hostname,r)),typeof t.port=="string"&&(e.port=go(t.port,e.protocol,r)),typeof t.pathname=="string"){if(e.pathname=t.pathname,i&&!oo(e.pathname,r)){let s=i.pathname.lastIndexOf("/");s>=0&&(e.pathname=i.pathname.substring(0,s+1)+e.pathname)}e.pathname=mo(e.pathname,e.protocol,r)}return typeof t.search=="string"&&(e.search=co(t.search,r)),typeof t.hash=="string"&&(e.hash=lo(t.hash,r)),e}function nr(e){return e.replace(/([+*?:{}()\\])/g,"\\$1")}function ko(e){return e.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function Ao(e,t){let r=".*",i=`[^${ko(t.delimiter||"/#?")}]+?`,s=/[$_\u200C\u200D\p{ID_Continue}]/u,n="";for(let a=0;a<e.length;++a){let o=e[a],u=a>0?e[a-1]:null,l=a<e.length-1?e[a+1]:null;if(typeof o=="string"){n+=nr(o);continue}if(o.pattern===""){if(o.modifier===""){n+=nr(o.prefix);continue}n+=`{${nr(o.prefix)}}${o.modifier}`;continue}let h=typeof o.name!="number",f=t.prefixes!==void 0?t.prefixes:"./",m=o.suffix!==""||o.prefix!==""&&(o.prefix.length!==1||!f.includes(o.prefix));if(!m&&h&&o.pattern===i&&o.modifier===""&&l&&!l.prefix&&!l.suffix)if(typeof l=="string"){let p=l.length>0?l[0]:"";m=s.test(p)}else m=typeof l.name=="number";if(!m&&o.prefix===""&&u&&typeof u=="string"&&u.length>0){let p=u[u.length-1];m=f.includes(p)}m&&(n+="{"),n+=nr(o.prefix),h&&(n+=`:${o.name}`),o.pattern===r?!h&&(!u||typeof u=="string"||u.modifier||m||o.prefix!=="")?n+="*":n+=`(${r})`:o.pattern===i?h||(n+=`(${i})`):n+=`(${o.pattern})`,o.pattern===i&&h&&o.suffix!==""&&s.test(o.suffix[0])&&(n+="\\"),n+=nr(o.suffix),m&&(n+="}"),n+=o.modifier}return n}var Za,eo,st,no,ao,On,Eo,Co,it,Fn,Dn=ra(()=>{Za=/[$_\p{ID_Start}]/u,eo=/[$_\u200C\u200D\p{ID_Continue}]/u;st={delimiter:"",prefixes:"",sensitive:!0,strict:!0},no={delimiter:".",prefixes:"",sensitive:!0,strict:!0},ao={delimiter:"/",prefixes:"/",sensitive:!0,strict:!0};On=["ftp","file","http","https","ws","wss"];Eo=class{constructor(e){this.tokenList=[],this.internalResult={},this.tokenIndex=0,this.tokenIncrement=1,this.componentStart=0,this.state=0,this.groupDepth=0,this.hostnameIPv6BracketDepth=0,this.shouldTreatAsStandardURL=!1,this.input=e}get result(){return this.internalResult}parse(){for(this.tokenList=Sn(this.input,!0);this.tokenIndex<this.tokenList.length;this.tokenIndex+=this.tokenIncrement){if(this.tokenIncrement=1,this.tokenList[this.tokenIndex].type==="END"){if(this.state===0){this.rewind(),this.isHashPrefix()?this.changeState(9,1):this.isSearchPrefix()?(this.changeState(8,1),this.internalResult.hash=""):(this.changeState(7,0),this.internalResult.search="",this.internalResult.hash="");continue}else if(this.state===2){this.rewindAndSetState(5);continue}this.changeState(10,0);break}if(this.groupDepth>0)if(this.isGroupClose())this.groupDepth-=1;else continue;if(this.isGroupOpen()){this.groupDepth+=1;continue}switch(this.state){case 0:this.isProtocolSuffix()&&(this.internalResult.username="",this.internalResult.password="",this.internalResult.hostname="",this.internalResult.port="",this.internalResult.pathname="",this.internalResult.search="",this.internalResult.hash="",this.rewindAndSetState(1));break;case 1:if(this.isProtocolSuffix()){this.computeShouldTreatAsStandardURL();let e=7,t=1;this.shouldTreatAsStandardURL&&(this.internalResult.pathname="/"),this.nextIsAuthoritySlashes()?(e=2,t=3):this.shouldTreatAsStandardURL&&(e=2),this.changeState(e,t)}break;case 2:this.isIdentityTerminator()?this.rewindAndSetState(3):(this.isPathnameStart()||this.isSearchPrefix()||this.isHashPrefix())&&this.rewindAndSetState(5);break;case 3:this.isPasswordPrefix()?this.changeState(4,1):this.isIdentityTerminator()&&this.changeState(5,1);break;case 4:this.isIdentityTerminator()&&this.changeState(5,1);break;case 5:this.isIPv6Open()?this.hostnameIPv6BracketDepth+=1:this.isIPv6Close()&&(this.hostnameIPv6BracketDepth-=1),this.isPortPrefix()&&!this.hostnameIPv6BracketDepth?this.changeState(6,1):this.isPathnameStart()?this.changeState(7,0):this.isSearchPrefix()?this.changeState(8,1):this.isHashPrefix()&&this.changeState(9,1);break;case 6:this.isPathnameStart()?this.changeState(7,0):this.isSearchPrefix()?this.changeState(8,1):this.isHashPrefix()&&this.changeState(9,1);break;case 7:this.isSearchPrefix()?this.changeState(8,1):this.isHashPrefix()&&this.changeState(9,1);break;case 8:this.isHashPrefix()&&this.changeState(9,1);break;case 9:break;case 10:break}}}changeState(e,t){switch(this.state){case 0:break;case 1:this.internalResult.protocol=this.makeComponentString();break;case 2:break;case 3:this.internalResult.username=this.makeComponentString();break;case 4:this.internalResult.password=this.makeComponentString();break;case 5:this.internalResult.hostname=this.makeComponentString();break;case 6:this.internalResult.port=this.makeComponentString();break;case 7:this.internalResult.pathname=this.makeComponentString();break;case 8:this.internalResult.search=this.makeComponentString();break;case 9:this.internalResult.hash=this.makeComponentString();break;case 10:break}this.changeStateWithoutSettingComponent(e,t)}changeStateWithoutSettingComponent(e,t){this.state=e,this.componentStart=this.tokenIndex+t,this.tokenIndex+=t,this.tokenIncrement=0}rewind(){this.tokenIndex=this.componentStart,this.tokenIncrement=0}rewindAndSetState(e){this.rewind(),this.state=e}safeToken(e){return e<0&&(e=this.tokenList.length-e),e<this.tokenList.length?this.tokenList[e]:this.tokenList[this.tokenList.length-1]}isNonSpecialPatternChar(e,t){let r=this.safeToken(e);return r.value===t&&(r.type==="CHAR"||r.type==="ESCAPED_CHAR"||r.type==="INVALID_CHAR")}isProtocolSuffix(){return this.isNonSpecialPatternChar(this.tokenIndex,":")}nextIsAuthoritySlashes(){return this.isNonSpecialPatternChar(this.tokenIndex+1,"/")&&this.isNonSpecialPatternChar(this.tokenIndex+2,"/")}isIdentityTerminator(){return this.isNonSpecialPatternChar(this.tokenIndex,"@")}isPasswordPrefix(){return this.isNonSpecialPatternChar(this.tokenIndex,":")}isPortPrefix(){return this.isNonSpecialPatternChar(this.tokenIndex,":")}isPathnameStart(){return this.isNonSpecialPatternChar(this.tokenIndex,"/")}isSearchPrefix(){if(this.isNonSpecialPatternChar(this.tokenIndex,"?"))return!0;if(this.tokenList[this.tokenIndex].value!=="?")return!1;let e=this.safeToken(this.tokenIndex-1);return e.type!=="NAME"&&e.type!=="PATTERN"&&e.type!=="CLOSE"&&e.type!=="ASTERISK"}isHashPrefix(){return this.isNonSpecialPatternChar(this.tokenIndex,"#")}isGroupOpen(){return this.tokenList[this.tokenIndex].type=="OPEN"}isGroupClose(){return this.tokenList[this.tokenIndex].type=="CLOSE"}isIPv6Open(){return this.isNonSpecialPatternChar(this.tokenIndex,"[")}isIPv6Close(){return this.isNonSpecialPatternChar(this.tokenIndex,"]")}makeComponentString(){let e=this.tokenList[this.tokenIndex],t=this.safeToken(this.componentStart).index;return this.input.substring(t,e.index)}computeShouldTreatAsStandardURL(){let e={};Object.assign(e,st),e.encodePart=Qi;let t=kn(this.makeComponentString(),void 0,e);this.shouldTreatAsStandardURL=In(t)}},Co=["protocol","username","password","hostname","port","pathname","search","hash"],it="*";Fn=class{constructor(e={},t){this.regexp={},this.keys={},this.component_pattern={};try{if(typeof e=="string"){let s=new Eo(e);if(s.parse(),e=s.result,t)if(typeof t=="string")e.baseURL=t;else throw new TypeError("'baseURL' parameter is not of type 'string'.");else if(typeof e.protocol!="string")throw new TypeError("A base URL must be provided for a relative constructor string.")}else if(t)throw new TypeError("parameter 1 is not of type 'string'.");if(!e||typeof e!="object")throw new TypeError("parameter 1 is not of type 'string' and cannot convert to dictionary.");let r={pathname:it,protocol:it,username:it,password:it,hostname:it,port:it,search:it,hash:it};this.pattern=sr(r,e,!0),Tn(this.pattern.protocol)===this.pattern.port&&(this.pattern.port="");let i;for(i of Co){if(!(i in this.pattern))continue;let s={},n=this.pattern[i];switch(this.keys[i]=[],i){case"protocol":Object.assign(s,st),s.encodePart=Qi;break;case"username":Object.assign(s,st),s.encodePart=yo;break;case"password":Object.assign(s,st),s.encodePart=bo;break;case"hostname":Object.assign(s,no),Pn(n)?s.encodePart=Rn:s.encodePart=Nn;break;case"port":Object.assign(s,st),s.encodePart=Ln;break;case"pathname":In(this.regexp.protocol)?(Object.assign(s,ao),s.encodePart=wo):(Object.assign(s,st),s.encodePart=vo);break;case"search":Object.assign(s,st),s.encodePart=So;break;case"hash":Object.assign(s,st),s.encodePart=_o;break}try{let a=_n(n,s);this.regexp[i]=Cn(a,this.keys[i],s),this.component_pattern[i]=Ao(a,s)}catch{throw new TypeError(`invalid ${i} pattern '${this.pattern[i]}'.`)}}}catch(r){throw new TypeError(`Failed to construct 'URLPattern': ${r.message}`)}}test(e={},t){let r={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof e!="string"&&t)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof e>"u")return!1;try{typeof e=="object"?r=sr(r,e,!1):r=sr(r,vn(e,t),!1)}catch{return!1}let i;for(i in this.pattern)if(!this.regexp[i].exec(r[i]))return!1;return!0}exec(e={},t){let r={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof e!="string"&&t)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof e>"u")return;try{typeof e=="object"?r=sr(r,e,!1):r=sr(r,vn(e,t),!1)}catch{return null}let i={};t?i.inputs=[e,t]:i.inputs=[e];let s;for(s in this.pattern){let n=this.regexp[s].exec(r[s]);if(!n)return null;let a={};for(let[o,u]of this.keys[s].entries())if(typeof u.name=="string"||typeof u.name=="number"){let l=n[o+1];a[u.name]=l}i[s]={input:r[s]||"",groups:a}}return i}get protocol(){return this.component_pattern.protocol}get username(){return this.component_pattern.username}get password(){return this.component_pattern.password}get hostname(){return this.component_pattern.hostname}get port(){return this.component_pattern.port}get pathname(){return this.component_pattern.pathname}get search(){return this.component_pattern.search}get hash(){return this.component_pattern.hash}};globalThis.URLPattern||(globalThis.URLPattern=Fn)});function E(e){return!Array.isArray(e)&&typeof e=="object"&&e}function H(e){return typeof e}function y(e,...t){globalThis.WebQitInternalsRegistry||(globalThis.WebQitInternalsRegistry=new Map);var r=globalThis.WebQitInternalsRegistry.get(e);if(!r){if(r=new Map,t[0]===!1)return r;globalThis.WebQitInternalsRegistry.set(e,r)}for(var i,s;i=t.shift();)if((s=r)&&!(r=r.get(i))){if(r=new Map,t[0]===!1)return r;s.set(i,r)}return r}function S(e){return Array.isArray(e)}function Bt(e){return e===!0||e===!1}function at(e){return typeof e=="function"}function si(e){return at(e)&&/^class\s?/.test(Function.prototype.toString.call(e))}function fr(e){return e===null||e===""}function ee(e){return arguments.length&&(e===void 0||typeof e>"u")}function k(e){return Array.isArray(e)||typeof e=="object"&&e||at(e)}function Re(e){return fr(e)||ee(e)||e===!1||e===0||k(e)&&!Object.keys(e).length}function T(e){return at(e)||e&&{}.toString.call(e)==="[object function]"}function we(e){return e instanceof Number||typeof e=="number"}function $(e){return we(e)||e!==!0&&e!==!1&&e!==null&&e!==""&&!isNaN(e*1)}function ni(e){return S(e)&&Object.getPrototypeOf(e)===Array.prototype}function bt(e){return E(e)&&Object.getPrototypeOf(e)===Object.prototype}function W(e){return e instanceof String||typeof e=="string"&&e!==null}function ai(e){return!W(e)&&!ee(e.length)}function Ue(e,t=1){var r=0;e.forEach(s=>{r++});var i=e.slice(e.length-r,t);return arguments.length>1?i:i[0]}function ue(e,t=1){return arguments.length>1?Ue(e.slice().reverse(),t).reverse():Ue(e.slice().reverse())}function pr(e,...t){return t.forEach(r=>{e.indexOf(r)<0&&e.push(r)}),e}function oi(i,t){t=t||Object.prototype,t=t&&!S(t)?[t]:t;for(var r=[],i=i;i&&(!t||t.indexOf(i)<0)&&i.name!=="default";)r.push(i),i=i?Object.getPrototypeOf(i):null;return r}function ui(e,t){var r=[];return oi(e,t).forEach(i=>{pr(r,...Object.getOwnPropertyNames(i))}),r}function ce(e,t,r=!1,i=!1,s=!1){var n=0,a=e.shift();if(($(a)||a===!0||a===!1)&&(n=a,a=e.shift()),!e.length)throw new Error("_merge() requires two or more array/objects.");return e.forEach((o,u)=>{!k(o)&&!T(o)||(r?ui(o):Object.keys(o)).forEach(l=>{if(!!t(l,a,o,u)){var h=a[l],f=o[l];if((S(h)&&S(f)||E(h)&&E(f))&&(n===!0||n>0))a[l]=S(h)&&S(f)?[]:{},ce([$(n)?n-1:n,a[l],h,f],t,r,i,s);else if(S(a)&&S(o))i?a[l]=f:a.push(f);else try{s?Object.defineProperty(a,l,Object.getOwnPropertyDescriptor(o,l)):a[l]=o[l]}catch{}}})}),a}function he(e,t){var r=void 0;return k(e)&&Object.keys(e).forEach((i,s)=>{r!==!1&&(r=t($(i)?parseFloat(i):i,e[i],s))}),r}function le(...e){return ce(e,(t,r,i)=>!0,!1,!1,!1)}function ke(e,t,r=!1){if(t=="")return e;var i=r?e.lastIndexOf(t):e.indexOf(t);return i===-1?"":e.substr(i+t.length)}function wt(e,t,r=null,i=!1){return t.length>e.length?-1:(typeof r=="number"?i?e.slice(0,r+1+(r<0?e.length:0)):e.slice(r):e).reduce((s,n,a)=>{var[o,u,l]=s;if(!i&&o>-1)return[o,u,l];var h=l+1,f=n===t[h]?h===0?[a,0]:[u,h]:[-1,-1];return f[1]===t.length-1&&(f[1]=-1,f[0]>-1)?[f[0]].concat(f):[o].concat(f)},[-1,-1,-1])[0]+(i||typeof r!="number"?0:r>-1?r:e.length-r)}function vt(e,t,r=null,i=!1){var s=wt(e,t,r,i);return s===-1?[]:e.slice(s+t.length)}function qe(e,t){return e.reduce((r,i,s)=>r||t(i,s),!1)}function We(e,t,r=!1){if(t=="")return e;var i=r?e.lastIndexOf(t):e.indexOf(t);return i===-1?e:e.substr(0,i)}function O(e,t=!0){return S(e)?e:!t&&E(e)?[e]:e!==!1&&e!==0&&Re(e)?[]:ai(e)?Array.prototype.slice.call(e):E(e)?Object.values(e):[e]}function St(e,t,r=null){return S(t)?e.filter(i=>r?t.filter(s=>r(i,s)).length:t.indexOf(i)===-1):[]}function He(e,t,r=null){return r||r!==!1&&e.dotSafe&&t.dotSafe?e.join(".")===t.join("."):e.length===t.length&&e.reduce((i,s,n)=>i&&s===t[n],!0)}function _t(e,t,r=!1){for(var i=e.indexOf(t);i>-1&&(r||r===!1);)e.splice(i,1),r>0&&r--,i=e.indexOf(t);return e}var ns=function(e,t=1,r=!0){return!$(t)||t<=0||(!S(e)&&E(e)&&r&&(e=Object.values(e)),!S(e))?e:e.reduce((i,s)=>S(s)||E(s)&&r?i.concat(ns(S(s)?s:Object.values(s),t-1,r)):i.concat(s),[])},li=ns;function $t(e,t,r=null){return S(t)?e.filter(i=>r?t.filter(s=>r(i,s)).length:t.indexOf(i)!==-1):[]}function Ut(e,t,r=null){return r||r!==!1&&e.dotSafe&&t.dotSafe?(e.join(".")+".").startsWith(t.join(".")+"."):t.reduce((i,s,n)=>i&&s===e[n],!0)}function ot(e){let t=(r,i,s)=>s.indexOf(r)===i;return e.filter(t)}function ut(e){return(ci(e)?e:O(e).length?[e]:[]).reduce((t,r)=>t.concat([O(r)]),[]).map(t=>ze.resolve(t))}var ze=class extends Array{static resolve(t){return t.every(r=>!(r+"").includes("."))?new ze().concat(t):t}get dotSafe(){return!0}};function ci(e){return O(e).reduce((t,r)=>t||S(r),!1)}function hi(e){return e.filter(t=>t||t===0).length!==e.length}function as(e){return e.filter(t=>hi(O(t))).length>0}var lt=class{constructor(t){this.target=t,this.fireables=[],this.currentlyFiring=[]}add(t){return this.fireables.push(t),t}remove(t){this.fireables=this.fireables.filter(r=>r!==t)}removeMatches(t){this.match(t).forEach(r=>{this.fireables=this.fireables.filter(i=>i!==r)})}match(t){return this.fireables.filter(r=>{var i=ut(r.filter),s=O((r.params||{}).tags),n=ut(t.filter),a=O((t.params||{}).tags);return(!t.originalHandler||r.handler===t.originalHandler)&&(!n.length||He(n,i))&&(!a.length||a.length===s.length&&$t(s,a).length===a.length)})}static _getFirebase(t,r,i=!0,s=this.__namespace){if(!k(r))throw new Error('Subject must be of type object; "'+H(r)+'" given!');var n=this;return s&&globalThis.WebQitObserverNamespaceRegistry.has(t+"-"+s)&&(n=globalThis.WebQitObserverNamespaceRegistry.get(t+"-"+s),t+="-"+s),!y(r,"firebases").has(t)&&i&&y(r,"firebases").set(t,new n(r)),y(r,"firebases").get(t)}static _namespace(t,r,i=null){if(t+="-"+r,arguments.length===2)return globalThis.WebQitObserverNamespaceRegistry.get(t);if(!(i.prototype instanceof this))throw new Error(`The implementation of the namespace ${this.name}.${r} must be a subclass of ${this.name}.`);globalThis.WebQitObserverNamespaceRegistry.set(t,i),i.__namespace=r}};globalThis.WebQitObserverNamespaceRegistry||(globalThis.WebQitObserverNamespaceRegistry=new Map);var ct=class{constructor(t,r){this.target=t,this.handler=r.handler,this.filter=r.filter,this.params=r.params}disconnect(){this.disconnected=!0}};var qt=class extends ct{fire(t,r,i){return this.disconnected||this.filter&&!$t(O(this.filter),[t.type]).length?r(...Array.prototype.slice.call(arguments,2)):this.handler(t,i,r)}};function Et(e,t,r=!0,i=!0,s=!1,n=!1){if(S(e)&&S(t)){var a=[],o=!0;return e.forEach(u=>{if(!!o){var l=!1;he(t,(h,f)=>{(!l||i&&k(u))&&(l=r(u,f),(S(l)&&!l.length||E(l)&&!Object.keys(l).length)&&(l=!1),k(l)&&i&&(u=l))}),k(l)?a.push(i?l:u):Bt(l)?s&&!l||!s&&l?a.push(u):n&&(o=!1):a.push(l)}}),a}if(E(e)&&E(t)){var a={},o=!0;return Object.keys(e).forEach(h=>{if(!!o){var f=r(e[h],t[h]);(S(f)&&!f.length||E(f)&&!Object.keys(f).length)&&(f=!1),k(f)?a[h]=i?f:e[h]:Bt(f)?s&&!f||!s&&f?a[h]=e[h]:n&&(o=!1):a[h]=f}}),a}}function mr(e,t=[],r=!0){var i=0;return $(arguments[0])&&k(arguments[1])&&(i=arguments[0],e=arguments[1],t=arguments[2]||[]),ce([i,{},e],(s,n,a)=>T(t)?t(s):S(t)&&t.length?t.indexOf(s)>-1:!0,!1,!1,r)}function dr(e,t=[]){return ce([{},e],(r,i,s)=>{if(!T(s[r]))return T(t)?t(r):S(t)&&t.length?t.indexOf(r)>-1:!0},!1,!1,!1)}var fi=function(e,t,r=!0,i=1){if(S(e)&&S(t)&&e.length!==t.length)return!r;if(E(e)&&E(t)){var s=Object.keys(e),n=Object.keys(t);if(!s.length&&!n.length)return bt(e)&&bt(t)?r:e===t===r;if(!fi(s,n))return!r}if(i>0&&(S(e)&&S(t)||E(e)&&E(t))){var a=Et(e,t,(o,u)=>fi(o,u,r,i-1),!1,!1,!0);return S(a)?a.length===e.length&&a.length===t.length:E(a)&&E(e)?Object.keys(a).length===Object.keys(e).length&&Object.keys(a).length===Object.keys(t).length:a}return T(r)?r(e,t):we(e)&&we(t)&&isNaN(e)&&isNaN(t)?r:e===t===r},pi=fi;function mi(e,t=null){var r={};return arguments.length===2&&(S(e)&&S(t)?e.forEach((i,s)=>r[i]=t[s]):r[e]=t),r}function gi(e,t,r=null){return le(e,E(t)?t:mi(t,r))}var Ct=class{constructor(t,r){if(this.target=t,!r.type)throw new Error("Action type must be given in definition!");he(r,(i,s)=>{Object.defineProperty(this,i,{value:s,enumerable:!0})}),Object.seal(this)}};var J=class extends lt{add(t){return super.add(new qt(this.target,t))}fire(t,r=null){if(t instanceof Ct||(t=new Ct(this.target,t)),this.currentlyFiring.filter(n=>n.type===t.type&&n.name===t.name).length)return r?r():void 0;this.currentlyFiring.push(t);let i=(n,...a)=>{var o=this.fireables[n];return o?o.fire(t,(...u)=>i(n+1,...u),...a):r?r(...a):a[0]};var s=i(0);return this.currentlyFiring.pop(),s}static getFirebase(t,r=!0,i=null){return super._getFirebase("interceptor",...arguments)}static namespace(t,r=null){return super._namespace("interceptor",...arguments)}};function Q(e){return y(e,!1).get(e)||e}function X(e,t,r={},i={}){if(!t||!k(t))throw new Error("Target must be of type object!");t=Q(t);var s,n=function(a){return arguments.length?a:Reflect[e](t,...Object.values(r))};return(s=J.getFirebase(t,!1,i.namespace))?s.fire({type:e,...r},n):n()}function gr(e,t,r,i={}){return X("apply",e,{thisArgument:t,argumentsList:r},i)}function xr(e,t,r=null,i={}){return X("construct",e,arguments.length>2?{argumentsList:t,newTarget:r}:{argumentsList:t},i)}function xi(e,t){return ke(e,t,!0)}function Qe(e,t){return We(e,t,!0)}function yr(e,t){return typeof e!="string"?e:e.replace(/\w\S*/g,function(r){return r.charAt(0).toUpperCase()+(typeof t!==void 0&&t?r.substr(1).toLowerCase():r.substr(1))})}function br(e,t,r){return Qe(ke(e,t),r)}function yi(e,t,r){return e.startsWith(t)&&e.endsWith(r)}var ve=class{constructor(t,r=!1){this._={},this._.target=t,this._.cancellable=r,this._.propagationStopped=!1,this._.defaultPrevented=!1,this._.promisesInstance=null,this._.promises=[]}get target(){return this._.target}get cancellable(){return this._.cancellable}stopPropagation(){this._.propagationStopped=!0}get propagationStopped(){return this._.propagationStopped}preventDefault(){this._.defaultPrevented=!0}get defaultPrevented(){return this._.defaultPrevented}waitUntil(t){t instanceof Promise&&(this._.promises.push(t),this._.promisesInstance=null)}get promises(){return!this._.promisesInstance&&this._.promises.length&&(this._.promisesInstance=Promise.all(this._.promises)),this._.promisesInstance}respondWith(t){var r,i=E(t)&&!ee(t.propagationStopped)&&!ee(t.defaultPrevented);t===!1||i&&t.propagationStopped?this.stopPropagation():t===!1||i&&t.defaultPrevented?this.preventDefault():(t instanceof Promise&&(r=t)||i&&(r=t.promises))&&this.waitUntil(r)}};var Wt=class extends ct{constructor(t,r){if(super(t,r),this.filters2D=ut(this.filter),this.filtersIsOriginally2D=ci(this.filter),this.filtersIsDynamic=as(this.filters2D),this.filtersIsDynamic&&this.filters2D.length>1)throw new Error('Only one "Dynamic Filter" must be observed at a time! "'+this.filters2D.map(i=>"["+i.join(", ")+"]").join(", ")+'" have been bound together.')}fire(t){if(this.disconnected||this.params.type&&!qe(t,a=>this.params.type===a.type))return;let r=a=>!["set","def"].includes(a.type)||!this.params.diff||(T(this.params.diff)?this.params.diff(a.value,a.oldValue):a.value!==a.oldValue);var i=new ve(this.target);if(this.filters2D.length){var s=t.filter(a=>this.filters2D.filter((o,u)=>{var l=o.slice();return this.filtersIsDynamic&&a.path.forEach((h,f)=>{l[f]=l[f]||l[f]===0?l[f]:h}),(!this.filtersIsDynamic||!hi(l))&&r(a)&&(!this.params.subtree&&He(l,a.path)||this.params.suptree&&Ut(l,a.path)&&(!$(this.params.suptree)||vt(l,a.path).length<=this.params.suptree)||this.params.subtree&&a.path.length>=l.length&&Ut(a.path,l)&&(!$(this.params.subtree)||vt(a.path,l).length<=this.params.subtree))}).length);if(s.length)if(this.filtersIsOriginally2D||this.params.subtree){var n=s;E(this.filter)&&(n={...this.filter},s.forEach((a,o)=>{n[a.name]=a})),i.respondWith(this.handler(n,i))}else s.forEach((a,o)=>{i.respondWith(this.handler(a,i))})}else(this.params.subtree||t.filter(a=>He(a.path,[a.name])).length===t.length)&&t.filter(a=>r(a)).length&&i.respondWith(this.handler(t,i));return i}};var Ge=class{constructor(t,r){if(this.target=t,r.originalSubject||(this.originalSubject=t),!("type"in r))throw new Error("Mutation type must be given in definition!");if(!("name"in r))throw new Error("Property name must be given in definition!");he(r,(i,s)=>{i==="path"&&(s=ze.resolve(s)),Object.defineProperty(this,i,{value:s,enumerable:!0})}),this.path||Object.defineProperty(this,"path",{value:ze.resolve([r.name]),enumerable:!0}),Object.seal(this)}};var z=class extends lt{constructor(t){super(t),this.buffers=[]}add(t){return super.add(new Wt(this.target,t))}fire(t,r){var i=new ve(this.target,r);return t=O(t,!1).map(s=>s instanceof Ge?s:new Ge(this.target,s)),this.buffers.length?(ue(this.buffers)(t),i):(this.currentlyFiring.filter(s=>t.filter(n=>s.type===n.type&&s.name===n.name).length).length,this.fireables.forEach(s=>{if(i.propagationStopped&&r)return i;i.respondWith(s.fire(t))}),i)}static getFirebase(t,r=!0,i=null){return super._getFirebase("observer",...arguments)}static namespace(t,r=null){return super._namespace("observer",...arguments)}};function fe(e,t,r=null,i={}){if(e=r||e,!e||!k(e))throw new Error("Target must be of type object!");e=Q(e);var s=O(t),n=s.map(a=>{var o,u=function(l){return arguments.length?l:y(e,"accessorizedProps").has(a)&&y(e,"accessorizedProps").get(a).touch(!0)?y(e,"accessorizedProps").get(a).get():r?Reflect.get(e,a,r):Reflect.get(e,a)};return(o=J.getFirebase(e,!0,i.namespace))?o.fire({type:"get",name:a,related:s,receiver:r},u):u()});return S(t)?n:n[0]}function wr(e,t,r=null,i={}){if(e=Q(e),!e||!k(e))throw new Error('Observable subjects must be of type object; "'+H(e)+'" given!');if(T(t)&&(i=arguments.length>2?r:{},r=t,t=null),!T(r))throw new Error('Handler must be a function; "'+H(r)+'" given!');var s,n=z.getFirebase(e,!0,i.namespace),a={filter:t,handler:r,params:i};if((a.filter||a.params.subtree==="*"||a.params.subtree&&kt(e))&&Ke(e,a.filter,a.params.subtree,i.namespace),a.params.unique&&(s=n.match({filter:t,params:i})).length){if(a.params.unique!=="replace")return s[0];n.remove(s[0])}return n.add(a)}function Je(e,t,r,i=null,s={}){if(e!==r){var n;if(wr(r,(o,u)=>{if(n=z.getFirebase(e,!1,s.namespace)){var l=o.map(h=>{var f=h;do if(f.target===e)return;while(f=f.src);var m={};return he(h,(p,x)=>{p!=="target"&&p!=="name"&&p!=="path"&&p!=="src"&&(m[p]=x)}),m.name=t,m.path=[t].concat(h.path),m.originalSubject=h.originalSubject,m.src=h,new Ge(e,m)}).filter(h=>h);if(l.length)return n.fire(l,u.cancellable)}},{subtree:!0,...s,unique:!0,tags:[bi,t,e]}),E(i)&&(n=z.getFirebase(e,!1,s.namespace))){var a=le({name:t,type:"set",value:r,related:[t]},i);let o=n.fire(a,s.cancellable);if(s.eventTypeReturn)return o}}}var bi={};function Ke(e,t=null,r=!1,i=null){if(!e||!k(e))throw new Error("Target must be of type object!");var s=z.getFirebase(e,!0,i);if(!(!s||s.build)){s.build=r;var n=ut(t),a=!n.length||n.filter(u=>!u[0]&&u[0]!==0).length?Object.keys(e):n.map(u=>u[0]),o=n.length?n.map(u=>u.slice(1)).filter(u=>u.length):null;s.subBuild=o&&o.length?o:null,a.forEach(u=>{var l=fe(e,u,null,{namespace:i});try{k(l)&&(Je(e,u,l,null,params),(s.subBuild&&kt(l)||(_isFunction(r)?r(l):r&&kt(l)))&&Ke(l,s.subBuild,r,i))}catch{}})}}var kt=e=>(e instanceof Object||e instanceof Array||e instanceof Function)&&(typeof window>"u"||e!==window);function vr(e,t,r=null,i={}){if(e=Q(e),!e||!k(e))throw new Error('Observable subjects must be of type object; "'+H(e)+'" given!');if(T(t)&&(i=arguments.length>2?r:{},r=t,t=null),r&&!T(r))throw new Error('Handler must be a function; "'+H(r)+'" given!');var s;if(s=z.getFirebase(e,!1,i.namespace))return s.removeMatches({filter:t,originalHandler:r,params:i})}function Xe(e,t,r,i=null,s={}){vr(r,null,null,{...s,tags:[bi,t,e]});var n;if(E(i)&&(n=z.getFirebase(e,!1,s.namespace))){var a=le({name:t,type:"del",oldValue:r,related:[t]},i);n.fire(a,s.cancellable)}}function Ye(e,t,r={}){return X("has",e,{name:t},r)}function Sr(e,t,r,i={}){t=r.receiver||t;var s=r.keysOrPayload,n=r.value;if(!t||!k(t))throw new Error("Target must be of type object!");E(s)&&(i=n||{},n=null),t=Q(t);var a=J.getFirebase(t,!1,i.namespace),o=z.getFirebase(t,!1,i.namespace);let u=(p,x,b,d)=>{var w="set",v;e&&(w="defineProperty",v=x||{},x=v.value);var _=!1,C;Ye(t,p,i)&&(_=!0,C=fe(t,p,r.receiver,i));var F={name:p,type:w,value:x,receiver:r.receiver,related:b,detail:d,isUpdate:_,oldValue:C},D=function(V){return arguments.length&&(v?v=V:x=V),v?y(t,"accessorizedProps",!1).has(p)&&!y(t,"accessorizedProps").get(p).restore()?!1:(Object.defineProperty(t,p,v),!0):y(t,"accessorizedProps",!1).has(p)?y(t,"accessorizedProps").get(p).set(x):(t[p]=x,!0)};if(a){var te=v?{type:"defineProperty",name:p,descriptor:v,receiver:r.receiver,related:b,detail:d,isUpdate:_,oldValue:C}:{type:"set",name:p,value:x,receiver:r.receiver,related:b,detail:d,isUpdate:_,oldValue:C};F.success=a.fire(te,D)}else F.success=D();return F.success&&F.value!==F.oldValue&&(k(F.oldValue)&&Xe(t,p,F.oldValue,null,i),k(F.value)&&(Je(t,p,F.value,null,i),o&&(o.subBuild||o.build&&kt(F.value))&&Ke(F.value,o.subBuild,o.build,i.namespace))),F};var l,h=[];S(s)||(W(s)||we(s))&&(l=O(s))?h=l.map(p=>u(p,n,l,i.detail)):E(s)&&(l=Object.keys(s))&&(h=l.map(p=>u(p,s[p],l,i.detail)));var f=h.filter(p=>p.success!==!1),m;return o?(m=o.fire(f,i.cancellable),m.successCount=f.length):i.eventTypeReturn&&(m=new ve(t)),i.eventTypeReturn?m:f.length>0}function _r(e,t,r=null,i={}){return Sr(!0,e,{keysOrPayload:t,value:r},i)}function Er(e,t,r={}){if(!e||!k(e))throw new Error("Target must be of type object!");e=Q(e);var i=O(t),s=i.map(u=>{var l;Ye(e,u,r)&&(l=fe(e,u,null,r));var h={name:u,type:"deleteProperty",related:i,detail:r.detail,oldValue:l},f,m=function(p){return arguments.length?p:y(e,"accessorizedProps",!1).has(u)&&!y(e,"accessorizedProps").get(u).restore()?!1:(delete e[u],!0)};return(f=J.getFirebase(e,!1,r.namespace))?h.success=f.fire({type:"deleteProperty",name:u,oldValue:l,related:i},m):h.success=m(),h.success&&k(h.oldValue)&&Xe(e,u,h.oldValue,null,r),h}),n=s.filter(u=>u.success!==!1),a,o;return(a=z.getFirebase(e,!1,r.namespace))?(o=a.fire(n,r.cancellable),o.successCount=n.length):r.eventTypeReturn&&(o=new ve(e)),r.eventTypeReturn?o:n.length>0}function Cr(e,t,r={}){return X("getOwnPropertyDescriptor",e,{name:t},r)}function kr(e,t={}){return X("getPrototypeOf",e,{},t)}function Ar(e,t={}){return X("isExtensible",e,{},t)}function Pr(e,t={}){return X("ownKeys",e,{},t)}function Or(e,t={}){return X("preventExtensions",e,{},t)}function At(e,t,r=null,i=null,s={}){return Sr(!1,e,arguments.length>3?{keysOrPayload:t,value:r,receiver:i}:{keysOrPayload:t,value:r},s)}function Ir(e,t,r={}){return X("setPrototypeOf",e,{prototype:t},r)}function os(e,t=[],r={}){r=E(t)?t:r;var i=(arguments.length===1?Object.keys(e):O(t)).map(s=>{if(y(e,"accessorizedProps").has(s)&&y(e,"accessorizedProps").get(s).touch(!0))return!1;let n=()=>{for(var m,p=e;!m&&(p=Object.getPrototypeOf(p));)m=Object.getOwnPropertyDescriptor(p,s);return m};var a=Object.getOwnPropertyDescriptor(e,s),o,u;a||(o={writable:!0,enumerable:!(s in e),configurable:r.configurable!==!1});var l={...a||o};"value"in l&&delete l.value,"writable"in l&&delete l.writable,l.get=()=>{if(f.ongoingGets.length)return f.get();f.ongoingGets.push(1);var m=fe(e,s,null,r);return f.ongoingGets.pop(),m};var h;l.set=m=>{if(f.ongoingSets.length)return f.set(m);f.ongoingSets.push(1);var p=At(e,s,m,null,r);return f.ongoingSets.pop(),p};var f={ongoingGets:[],ongoingSets:[],get:function(){var m=a;return m||(u?m=o:m=n()||o),m.get?m.get.call(e):m.value},set:function(m){var p=a;return p||(u?p=o:(p=n())?"value"in p&&(p=o,u=!0):(p=o,u=!0)),p.set||p.get?p.set?p.set.call(e,m):!1:(p.value=m,!0)},restore:function(){try{return this.intact()&&(a||u?Object.defineProperty(e,s,a||o):delete e[s],y(e,"accessorizedProps").delete(s)),!0}catch{}return!1},intact:function(){return(Object.getOwnPropertyDescriptor(e,s)||{}).get===l.get},touch:function(m=!1){return this.intact()||(m?!this.restore():!1)}};try{return Object.defineProperty(e,s,l),y(e,"accessorizedProps").set(s,f),!0}catch{}return!1});return S(t)?i:i[0]}function us(e,t=[],r={}){r=E(t)?t:r;var i=(arguments.length===1?Object.keys(e):O(t)).map(s=>y(e,"accessorizedProps",!1).has(s)?y(e,"accessorizedProps").get(s).restore():!0);return S(t)?i:i[0]}function ls(e,t={}){if(!k(e))throw new Error('Object must be of type target; "'+H(e)+'" given!');var r=new Proxy(e,{apply:(i,s,n)=>gr(i,s,n,t),construct:(i,s,n=null)=>xr(i,s,n,t),defineProperty:(i,s,n)=>_r(i,s,n,t),deleteProperty:(i,s)=>Er(i,s,t),get:(i,s,n=null)=>{var a=fe(i,s,n,t);return t.proxyAutoBinding!==!1&&T(a)&&!si(a)?a.bind(r):a},getOwnPropertyDescriptor:(i,s)=>Cr(i,s,t),getPrototypeOf:i=>kr(i,t),has:(i,s)=>Ye(i,s,t),isExtensible:i=>Ar(i,t),ownKeys:i=>Pr(i,t),preventExtensions:i=>Or(i,t),set:(i,s,n,a=null)=>At(i,s,n,a,t),setPrototypeOf:(i,s)=>Ir(i,s,t)});return y(r).set(r,e),r}function cs(e,t,r={}){if(e=Q(e),!k(e))throw new Error('Object must be of type target; "'+H(handler)+'" given!');var i={},s=!0;E(t)||(T(t)?t={"":t}:T(r)&&(t={[t]:r},r=arguments.length>3?arguments[3]:{}),s=!1);var n=J.getFirebase(e,!0,r.namespace);return Object.keys(t).forEach(a=>{if(!T(t[a]))throw new Error("Callback"+(a===null?"":" for "+a)+' must be a function; "'+H(t[a])+'" given!');var o={filter:a,handler:t[a],params:r},u;if(o.params.unique&&(u=n.match(o)).length){if(o.params.unique!=="replace")return u[0];n.remove(u[0])}s?i[a]=n.add(o):i=n.add(o)}),i}function hs(e,t=null,r={}){if(e=Q(e),!e||!k(e))throw new Error('Object must be of type target; "'+H(e)+'" given!');var i=J.getFirebase(e,!1,r.namespace);_isObject(t)||(T(t)?t={[null]:t}:T(r)&&(t={[t]:r},r=arguments.length>3?arguments[3]:{}),isOriginallyObj=!1),(i=J.getFirebase(e,!1,r.namespace))&&Object.keys(t).forEach(s=>{if(!T(t[s]))throw new Error("Callback"+(s===null?"":" for "+s)+' must be a function; "'+H(t[s])+'" given!');var n={filter:s,originalHandler:t[s],params:r};return i.removeMatches(n)})}function fs(e,...t){var r=t.map(n=>{if(n=Q(n),!k(n))throw new Error("Target must be of type object!");return{target:n,subjectCopy:S(n)?n.slice(0):mr(n)}}),i=e(...t);let s=()=>{r.map(n=>{var a=Object.keys(n.subjectCopy),o=Object.keys(n.target),u=[],l=ot(a.concat(o)).map(f=>{if(n.subjectCopy[f]!==n.target[f]){u.push(f);var m={name:f,related:u,buffered:!0};return o.includes(f)?(m.type="set",m.value=n.target[f],a.includes(f)&&(m.isUpdate=!0)):m.type="del",a.includes(f)&&(m.oldValue=n.subjectCopy[f]),k(n.subjectCopy[f])&&Xe(n.target,f,n.subjectCopy[f]),k(n.target[f])&&Je(n.target,f,n.target[f]),m}}).filter(f=>f),h;if(l.length&&(h=z.getFirebase(n.target,!1)))return h.fire(l)})};return i instanceof Promise?i.then(s):s(),i}var P={apply:gr,construct:xr,defineProperty:_r,deleteProperty:Er,get:fe,getOwnPropertyDescriptor:Cr,getPrototypeOf:kr,has:Ye,isExtensible:Ar,ownKeys:Pr,preventExtensions:Or,set:At,setPrototypeOf:Ir,accessorize:os,unaccessorize:us,proxy:ls,unproxy:Q,observe:wr,unobserve:vr,intercept:cs,unintercept:hs,closure:fs,build:Ke,link:Je,unlink:Xe,Observers:z,Interceptors:J};function Se(e){return!Array.isArray(e)&&typeof e=="object"&&e}function ps(e){var t=typeof e.InstallTrigger<"u";if(t)return"firefox";var r=/constructor/i.test(e.HTMLElement)||function(l){return l.toString()==="[object SafariRemoteNotification]"}(!e.safari||typeof e.safari<"u"&&e.safari.pushNotification);if(r)return"safari";var i=!!e.chrome&&(!!e.chrome.webstore||!!e.chrome.runtime),s=i&&e.navigator.userAgent.indexOf("Edg")!=-1,n=!!e.opr&&!!e.opr.addons||!!e.opera||e.navigator.userAgent.indexOf(" OPR/")>=0,a=!!e.document.documentMode,o=!a&&!!e.StyleMedia,u=(i||n)&&!!e.CSS;return o?"edge":a?"ie":n?"opera":s?"ie-chromium":i?"chrome":"unknown"}function ms(e){var t=e.getComputedStyle(e.document.documentElement,""),r=(Array.prototype.slice.call(t).join("").match(/-(moz|webkit|ms)-/)||t.Olink===""&&["","o"])[1],i=("WebKit|Moz|Ms|O".match(new RegExp("("+r+")","i"))||[])[1];return{api:i,prefix:r,css:"-"+r+"-"}}function Le(){if(!(Se(this)&&this.window)&&typeof window>"u")throw new Error("A window context is required.");let e=Se(this)&&this.window?this.window:window;if(e.WebQit||(e.WebQit={}),!e.WebQit.window){let t,r;Object.defineProperty(e.WebQit,"window",{get:()=>e}),Object.defineProperty(e.WebQit,"vendor",{value:{getName:()=>(t||(t=ps(e)),t),getPrefix:()=>(r||(r=ms(e)),r)}})}return e.WebQit}function Tr(e){return typeof e=="function"}function pe(e){return Array.isArray(e)||typeof e=="object"&&e||Tr(e)}function ds(e){return e instanceof Number||typeof e=="number"}function ht(e){return ds(e)||e!==!0&&e!==!1&&e!==null&&e!==""&&!isNaN(e*1)}var Ht=class{constructor(t,r=!0){this.window=t,this.async=r,this.readCallbacks=[],this.writeCallbacks=[],this._run()}_run(){this.window.requestAnimationFrame(()=>{this.readCallbacks.forEach((t,r)=>{t&&!t()&&(this.readCallbacks[r]=null)}),this.writeCallbacks.forEach((t,r)=>{t&&!t()&&(this.writeCallbacks[r]=null)}),this._run()})}onread(t,r=!1){if(r)return new Promise((i,s)=>{this.async===!1?t(i,s):this.readCallbacks.push(()=>{t(i,s)})});this.async===!1?t():this.readCallbacks.push(t)}onwrite(t,r=!1){if(r)return new Promise((i,s)=>{this.async===!1?t(i,s):this.writeCallbacks.push(()=>{t(i,s)})});this.async===!1?t():this.writeCallbacks.push(t)}cycle(t,r,i){this.onread(()=>{var s=t(i);if(s){var n=a=>{this.onwrite(()=>{var o=r(a,i);if(o){var u=l=>{this.cycle(t,r,l)};o instanceof Promise?o.then(u):u()}})};s instanceof Promise?s.then(n):n()}})}};function Fe(e){return e instanceof String||typeof e=="string"&&e!==null}function ft(e){return Array.isArray(e)}function Pt(e){return arguments.length&&(e===void 0||typeof e>"u")}function gs(e){return!Fe(e)&&!Pt(e.length)}function Nr(e){return e===null||e===""}function xs(e){return Nr(e)||Pt(e)||e===!1||e===0||pe(e)&&!Object.keys(e).length}function Y(e,t=!0){return ft(e)?e:!t&&Se(e)?[e]:e!==!1&&e!==0&&xs(e)?[]:gs(e)?Array.prototype.slice.call(e):Se(e)?Object.values(e):[e]}function zt(e){let t=Le.call(this);t.DOM.isDOMReady||t.window.document.readyState==="complete"?e(t.window):(t.window.domReadyCallbacks||(t.window.domReadyCallbacks=[],t.window.document.addEventListener("DOMContentLoaded",()=>{t.DOM.isDOMReady=!0,t.window.domReadyCallbacks.splice(0).forEach(r=>r(t.window))},!1)),t.window.domReadyCallbacks.push(e))}var Qt=class{constructor(t){this.window=t}onAdded(t,r,i={}){return i.on="added",this.onPresenceChange(t,(s,n,a,o,u)=>{r(s,n,a,o,u)},i)}onRemoved(t,r,i={}){return i.on="removed",this.onPresenceChange(t,(s,n,a,o,u)=>{r(s,n,a,o,u)},i)}onPresent(t,r,i={}){zt.call(this.window,()=>{this.window.MutationObserver&&this.onAdded(t,(s,n)=>{s.forEach(a=>r(a,n))},i),Fe(t)?Y(this.window.document.querySelectorAll(t)).forEach(s=>r(s,1)):t.parentNode&&r(t,1)})}onAbsent(t,r,i={}){zt.call(this.window,()=>{this.window.MutationObserver&&onRemoved(t,(s,n)=>{s.forEach(a=>r(a,n))},i),Fe(t)?Y(this.window.document.querySelectorAll(t)).length===0&&r(null,0):t.parentNode||r(t,0)})}onPresenceChange(t,r,i={}){t=Y(t,!1);var s=(f,m)=>{if(m=m.filter(b=>b.matches),Fe(f)){var p=m.filter(b=>b.matches(f));if(i.observeIndirectMutation!==!1&&(p=m.reduce((b,d)=>b.concat(Y(d.querySelectorAll(f))),p),p.length))return p}else{if(m.includes(f))return[f];if(i.observeIndirectMutation!==!1&&m.length){for(var x=f;x=x.parentNode;)if(m.includes(x))return[f]}}},n=(f,m)=>(m.$$searchCache||(m.$$searchCache=new Map),f.reduce((p,x)=>{var b;return m.$$searchCache.has(x)?b=m.$$searchCache.get(x):(b=s(x,m,Fe(x))||[],m.$$searchCache.set(x,b)),p.concat(b)},[])),a=new Set,o=new Set,u=(f,m,p)=>{m&&i.on==="removed"||!m&&i.on==="added"||(f=n(t,f)).length&&(i.maintainCallState?(f.forEach(x=>{m?(a.add(x),o.delete(x)):(a.delete(x),o.add(x))}),r(f,m,p,a,o)):r(f,m,p))},l=i.context||this.window.document.documentElement,h=this._observe(l,(f,m,p,x)=>{i.ignoreTransients||(u(f,0,!0),u(f.concat(m),1,!0),u(m,0,!0)),u(x,0),u(p,1)});return h}onAttrChange(t,r,i=[]){var s=new this.window.MutationObserver(r),n={attributes:!0,attributeOldValue:!0};return i&&(n.attributeFilter=i),s.observe(t,n),s}onTreeChange(t,r,i=!1){var s=new this.window.MutationObserver(r),n={childList:!0,subtree:i};return s.observe(t,n),s}onMutation(t,r,i){var s=new this.window.MutationObserver(r);return s.observe(t,i),s}_observe(t,r){if(!wi.has(t)){let s=new Set,n=new this.window.MutationObserver(a=>{if(!!s.size){var o=a.reduce((f,m)=>f.concat(Y(m.addedNodes)),[]),u=a.reduce((f,m)=>f.concat(Y(m.removedNodes)),[]),l=[],h=[];o=new Set(o),u=new Set(u),o.forEach(f=>{u.has(f)&&(u.delete(f),o.delete(f),f.isConnected?l.push(f):h.push(f))}),o=[...o],u=[...u],s.forEach(f=>f(l,h,o,u))}});n.observe(t,{childList:!0,subtree:!0}),wi.set(t,{callbacks:s,observer:n})}let i=wi.get(t);return i.callbacks.add(r),{disconnect(){i.callbacks.delete(r)},reconnect(){i.callbacks.add(r)}}}},wi=new Map;function ys(e){ha(e),fa(e),pa(e)}function ha(e){e.CSS||(e.CSS={}),e.CSS.escape||(e.CSS.escape=t=>t.replace(/([\:@\~\$\&])/g,"\\$1"))}function fa(e){"isConnected"in e.Node.prototype||Object.defineProperty(e.Node.prototype,"isConnected",{get:function(){return!this.ownerDocument||!(this.ownerDocument.compareDocumentPosition(this)&this.DOCUMENT_POSITION_DISCONNECTED)}})}function pa(e){e.Element.prototype.matches||(e.Element.prototype.matches=e.Element.prototype.matchesSelector||e.Element.prototype.mozMatchesSelector||e.Element.prototype.msMatchesSelector||e.Element.prototype.oMatchesSelector||e.Element.prototype.webkitMatchesSelector||function(t){for(var r=(this.document||this.ownerDocument).querySelectorAll(t),i=r.length;--i>=0&&r.item(i)!==this;);return i>-1})}function Rr(e,t=null,r=!1){let i=Le.call(this);if(Fe(e)){var s;if(e.trim().startsWith("<")){var n=i.window.document.createElement("div");n.innerHTML=e,s=r?Y(n.children):n.firstChild}else s=r?Y(ws.call(this,e,t)):vi.call(this,e,t);return s}return e instanceof i.window.Element?r?[e]:e:r?Y(e):e}function bs(e,t=null){return Rr.call(this,e,t,!0)}function vi(e,t=null,r=!1){let i=Le.call(this);t=t||i.window.document;var s,n=r?"querySelectorAll":"querySelector";try{s=t[n](e)}catch{try{s=t[n](e.replace(/\:is\(/g,":matches("))}catch{try{s=t[n](e.replace(/\:is\(/g,":-webkit-any("))}catch{try{s=t[n](e.replace(/\:is\(/g,":-moz-any("))}catch(l){throw l}}}}return s}function ws(e,t=null){return vi.call(this,e,t,!0)}function pt(e){return Tr(e)||e&&{}.toString.call(e)==="[object function]"}function Ze(e,t,r={},i={}){t=Y(t).slice();for(var s=e;!Pt(s)&&!Nr(s)&&t.length;){var n=t.shift();if(!(r.get?r.get(s,n):pe(s)?n in s:s[n])){i.exists=!1;return}s=r.get?r.get(s,n):s[n]}return i.exists=!0,s}function Lr(e,t,r,i={},s={}){let n=(h,f,m)=>s.set?s.set(h,f,m):(ht(t[o])&&ft(h)?h.push(m):h[f]=m,!0);t=Y(t);for(var a=e,o=0;o<t.length;o++)if(o<t.length-1){if(!a||!pe(a)&&!pt(a))return!1;var u=Ze(a,t[o],s);if(!pe(u)){if(s.buildTree===!1)return!1;u=pt(s.buildTree)?s.buildTree(o):ht(t[o+1])?[]:{};var l=n(a,t[o],u);if(!l)return!1}a=u}else return n(a,t[o],r)}function vs(e,t,r=!1,i={}){t=Y(t);var s=!1;do{var n=t.pop(),n=n===""?0:n,a=e;t.length&&(a=Ze(e,t,{},i)),(pe(a)||pt(a))&&(i.has?i.has(a,n):n in a)&&(i.deleteProperty?s=i.deleteProperty(a,n):i.del?s=i.del(a,n):(delete a[n],s=!0))}while(s&&r&&t.length&&(pe(a)||pt(a))&&!(i.keys?i.keys(a):Object.keys(a)).length);return s}function Si(e,t,r={}){var i={};return Ze(e,t,r,i),i.exists}function _i(e,t=!1){let r=Le.call(this);var i={};return!(i.el=r.window.document.head.querySelector('meta[name="oohtml"]'))&&t&&(i.el=r.window.document.createElement("meta"),i.el.setAttribute("name",e),r.window.document.head.append(i.el)),i.el&&(i.vars=(i.el.getAttribute("content")||"").split(";").filter(s=>s).reduce((s,n)=>{var a=n.split("=").map(o=>o.trim());return Lr(s,a[0].split("."),a[1]==="true"?!0:a[1]==="false"?!1:ht(a[1])?parseInt(a[1]):a[1]),s},{})),i.get=function(s){return Ze(this.vars,s.split("."))},i.set=function(s,n=null,a=!1){var o=Se(s)?s:{[s]:n===!0?"true":n};if(a=arguments.length<3?n:a,Object.keys(o).forEach(u=>{if(o[u]===!1)vs(this.vars,u.split("."));else if(Se(o[u]))Object.keys(o[u]).forEach(h=>{var f=(u+"."+h).split(".");(!a||!Si(this.vars,f))&&Lr(this.vars,f,o[u][h])});else{var l=u.split(".");(!a||!Si(this.vars,l))&&Lr(this.vars,l,o[u])}}),t){let u=(l,h)=>Object.keys(h).reduce((f,m)=>{var p=(l?l+".":"")+m;return Se(h[m])?f.push(...u(p,h[m])):f.push(p+"="+h[m]),f},[]);this.el.setAttribute("content",u("",this.vars).join(";"))}return!0},i.defaults=function(s,n=null){return this.set(s,n,!0)},i}function ae(){let e=Le.call(this);return e.DOM||(e.DOM={},ys(e.window),e.DOM.reflow=new Ht(e.window),e.DOM.mutations=new Qt(e.window),e.DOM.meta=_i.bind(e.window),e.DOM.query=Rr.bind(e.window),e.DOM.queryAll=bs.bind(e.window),e.DOM.ready=zt.bind(e.window)),e}var B=class{static lex(t,r,i={}){if(!W(t=t+""))throw new Error("Argument1 must be a string!");var s=l=>({delims:l.delims.slice(),options:dr(l.options),nesting:l.nesting.slice(),maxDepth:l.maxDepth,comments:l.comments.slice(),tokens:l.tokens.slice(),matches:l.matches.slice(),matchesi:dr(l.matchesi)});if(B.$cache[t]&&i.cache!==!1)for(var n=0;n<B.$cache[t].length;n++){var a=B.$cache[t][n];if(pi(a.delims,r))return s(a)}var o=new B(t,i),u=o.lex(r);return i.cache!==!1&&(B.$cache[t]=B.$cache[t]||[],B.$cache[t].push(u)),s(u)}static split(t,r,i){return B.lex(t,r,i).tokens}static match(t,r,i){return B.lex(t,r,i).matches}constructor(t,r){if(!W(t))throw new Error("Lexer requires the first argument to be a string.");this.$str=t,this.$options=r||{},this.$options.blocks||(this.$options.blocks=B.$blocks),this.$options.quotes||(this.$options.quotes=B.$quotes),this.$options.comments||(this.$options.comments=B.$comments)}lex(t,r){for(var i={delims:O(t),options:le(!0,{},this.$options,r||{}),nesting:[],maxDepth:0,comments:[],tokens:[],matches:[],matchesi:{}},s=0;typeof s=="number";)s=this._evalCharsAt(i,s);if(i.nesting.length)throw new Error("Error parsing the string: "+this.$str+". Unterminated blocks: "+li(i.nesting).join(", "));return i}_evalCharsAt(t,r){if(!(r>=this.$str.length)){var i=1,s={},n={},a={};if(t.openComment||(n=this._testQuotes(t,r)),t.openQuote||(s=this._testComments(t,r)),t.openComment||s.ending)if(!t.nesting.length&&!a.ending){var o=s.starting||s.ending||this.$str[r];i=o.length,this._push(t,o,"comments",s.starting)}else this._push(t,this.$str[r]);else if(t.openQuote||n.ending)this._push(t,this.$str[r]);else{if(t.options.limit&&t.matches.length===t.options.limit)return this._push(t,this.$str[r]),r+1;a=this._testNesting(t,r);var a=this._testNesting(t,r),u=this._testChars(t.options.stopChars||[],t,r);if(!t.nesting.length&&u!==!1){t.options.stopChar=u,t.options.stopCharForward=this.$str.substr(r);return}if(!t.delims.length)t.nesting.length===2&&a.starting?(t.matches.push(null),this._push(t,a.starting),i=a.starting.length):!t.nesting.length&&a.ending?(this._push(t,a.ending),i=a.ending.length,t.matches.push(null)):this._push(t,this.$str[r]);else if(!t.nesting.length&&!a.ending){this._push(t,"");var l=this._testChars(t.delims,t,r);if(l!==!1&&(t.matches.push(l),t.matchesi[r]=l,i=l.length||1,!t.options.preserveDelims)){var h=r+(l.length||1);return h===this.$str.length&&this._push(t,""),h}this._push(t,l||this.$str[r])}else{var o=a.starting||a.ending||this.$str[r];i=o.length,this._push(t,o)}}return r+i}}_testQuotes(t,r){var i={};return(t.options.quotes||[]).forEach(s=>{this.$str.substr(r,1)===s&&(t.openQuote?s===t.openQuote&&(t.openQuote=!1,i.ending=s):(t.openQuote=s,i.starting=s))}),i}_testComments(t,r){var i={};return(t.options.comments||[]).forEach(s=>{if(t.openComment){if(ue(s)===ue(t.openComment)){var a=ue(s);this.$str.substr(r).startsWith(a)&&(t.openComment=!1,i.ending=a)}}else{var n=Ue(s);this.$str.substr(r).startsWith(n)&&(t.openComment=s,i.starting=n)}}),i}_testNesting(t,r){var i={};return(t.options.blocks||[]).forEach(s=>{var n=Ue(s);if(this.$str.substr(r).startsWith(n))t.nesting=t.nesting.concat([s]),i.starting=n;else if(t.nesting.length&&ue(s)===ue(ue(t.nesting))){var a=ue(s);this.$str.substr(r).startsWith(a)&&(t.nesting=t.nesting.slice(0,-1),i.ending=a)}}),t.maxDepth=Math.max(t.maxDepth,t.nesting.length),i}_testChars(t,r,i){for(var s=0;s<t.length;s++){var n=t[s];if(T(n)){var a=n(this.$str.substr(0,i),this.$str.substr(i),r.tokens.slice());if(a!==!1)return a}if(r.options.useRegex){var o=this.$str.substr(i).match(new RegExp("^"+n,r.options.useRegex!==!0?r.options.useRegex:""));if(o)return o[0]}if(!r.options.ci&&this.$str.substr(i,n.length)===n||r.options.ci&&this.$str.substr(i,n.length).toLowerCase()===n.toLowerCase())return n}return!1}_push(t,r,i="tokens",s=!1){var n=t.matches.length;if(ee(t.tokens[n])&&(t.tokens[n]=""),i==="comments"){t.tokens[n].comments||(t.tokens[n]=new String(t.tokens[n]),t.tokens[n].comments=[]);var a=t.tokens[n].comments.length-(!t.tokens[n].comments.length||s?0:1);t.tokens[n].comments[a]=(t.tokens[n].comments[a]||"")+r}else{var o=t.tokens[n].comments;t.tokens[n]=t.tokens[n]+r}}split(t,r,i){return this.lex(r,i).tokens}match(t,r,i){return this.lex(r,i).matches}regParse(t,r){return this.lex(t,le({useRegex:!0},r||{}))}regSplit(t,r){return this.regParse(t,r).tokens}regMatch(t,r){return this.regParse(t,r).matches}};B.$blocks=[["(",")"],["[","]"],["{","}"]];B.$quotes=['"',"'","`"];B.$comments=[["/*","*/"],["//",`
3
+ `]];B.$cache=Object.create(null);function Ae(e,t={}){let r=ae.call(this);return r.OOHTML||(r.OOHTML={}),r.OOHTML.meta||(r.OOHTML.meta=r.DOM.meta("oohtml",!0)),r.OOHTML.meta.defaults(le(3,e,t)),r.OOHTML.meta}function Fr(e,t,r,i=null){var s=t.split("#")[0].split("/").map(n=>n.trim()).filter(n=>n);return Es(e,s,r,i)}function Mr(e){var t=B.split(e.trim(),[":"]);e=t.shift();var r=t.reduce((i,s)=>{var[n,a]=B.split(s.trim(),[]);return i[n]=br(a,"(",")"),i},{});return[e,r]}function _s(e,t){return t=t.split("#")[0].split("/").map(r=>r.trim()).filter(r=>r),e=e.split("#")[0].split("/").map(r=>r.trim()).filter(r=>r),e.length?e.reduce((r,i,s)=>r?B.split(i.trim(),["|","+"]).reduce((n,o)=>{var[o,u]=Mr(o);o=o.trim();var l=o===t[s];if(!l&&("deep"in u||"deepest"in u)){var h=t.slice(s+1).reduce((m,p,x)=>m>-1&&"deep"in u?m:p===o?x:m,-1);if(h>-1){var f=t.splice(s,h+1);l=!0}}return n||l},!1):!1,!0):!1}var Ss=(e,t)=>B.split(e.trim(),["|","+"],{preserveDelims:!0}).reduce((r,i)=>{var s;return(i.startsWith("|")||i.startsWith("+"))&&(s=i.substr(0,1),i=i.substr(1).trim()),r.theEnd||s==="|"&&r.length?(r.theEnd=!0,r):r.concat(t(i.trim()))},[]).filter(r=>r),Ei=(e,t,r)=>{let i=s=>s.reduce((n,a)=>n.concat(...r(a).values()),[]);return Ss(t,n=>{var[n,a]=Mr(n);return e.reduce((o,u)=>{var l=r(u);n==="*"&&(n="("+l.keys().join("+")+")");var h=yi(n,"(",")")?Ei([u],br(n,"(",")"),r):O(l.get(n),!1),f=[],m=p=>`${p}${f.map(x=>`:${x}(${a[x]})`).join("")}`;return Object.keys(a).forEach(p=>{if(p==="deep"||p==="deepest")for(var x=[u];(p==="deepest"||!h.length)&&(x=i(x)).length;){var b=Ei(x,m(n),r);b.length&&(h=b)}else(p==="having"||p==="not-having")&&(h=h.filter(d=>{var w=Ss(a[p],v=>r(d,v));return p==="not-having"?!w.length:w.length})),f.push(p)}),o.concat(h)},[])})},Es=function(e,t,r,i=null,s=0){if(!t.length)return[];let n=t.shift(),a;n.endsWith(".")&&(a=!0,n=n.substr(0,n.length-1).trim());let o=Ei(e,n,r);if(o.forEach(u=>{y(u,"oohtml").has("queryCallback")&&y(u,"oohtml").get("queryCallback")()}),o.length&&a)return o;if(t.length){let u=Es(o,t.slice(),r,i,s+1);return u===-1?i(o,s,!0):u}return i?i(o,s):o};function Dr(e={}){let t=ae.call(this);if(e.onDomReady){t.DOM.ready(()=>{Dr.call(this,{...e,onDomReady:!1})});return}let r=t.window,i=t.window.document,s=t.DOM.mutations,n=Ae.call(this,{element:{template:"",export:"export",import:"import"},attr:{moduleid:"name",moduleref:"template",exportid:"name",exportgroup:"exportgroup"},api:{templateClass:"",templates:"templates",exports:"exports",moduleref:"template"}},e.params),a="template"+(n.get("element.template")?'[is="'+n.get("element.template")+'"]':"")+"["+r.CSS.escape(n.get("attr.moduleid"))+"]";var o=r.HTMLTemplateElement;if(n.get("api.templateClass")){if(!r[n.get("api.templateClass")])throw new Error('The custom element class "'+n.get("api.templateClass")+'" is not defined!');o=r[n.get("api.templateClass")]}let u=(d,w,v)=>{d==="templatemutation"&&(["addedExports","removedExports"].forEach(_=>{Object.defineProperty(w,_,{value:Object.keys(w[_]).map(C=>({name:C,items:w[_][C]}))})}),["addedTemplates","removedTemplates"].forEach(_=>{Object.defineProperty(w,_,{value:Object.keys(w[_]).map(C=>({name:C,item:w[_][C]}))})})),Object.defineProperty(w,"path",{value:v}),i.dispatchEvent(new r.CustomEvent(d,{detail:w}))},l=(d,w)=>{let v=C=>{d.dispatchEvent(new r.CustomEvent(C,{detail:{path:w}}))};var _=d.getAttribute("src");return new Promise((C,F)=>{r.fetch?r.fetch(_).then(D=>D.ok?D.text():Promise.reject(D.statusText)).then(D=>{d.innerHTML=D,v("load"),u("templatecontentloaded",{template:d},w),C(d)}).catch(D=>{console.error("Error fetching the bundle at "+_+". ("+D+")"),d.innerHTML="",v("loaderror"),u("templatecontentloaderror",{template:d},w),C(d)}):(C(),console.error("Error fetching the bundle at "+_+". (window.fetch() not supported by browser.)"))})},h=(d,w,v,_=null,C=!0)=>{let F=(V,j,be,re)=>{if(!!V.matches){var K,$e;if(V.matches(a)&&(K=V.getAttribute(n.get("attr.moduleid")))&&p(K)){var hr=(v?v+"/":"")+K;be==="removed"?(y(d,"oohtml","templates").delete(K),y(V,"oohtml").get("parentTemplate")===d&&y(V,"oohtml").delete("parentTemplate"),j&&(j.removedTemplates[K]=V)):be==="added"&&(y(d,"oohtml","templates").set(K,V),y(V,"oohtml").set("parentTemplate",d),j&&(j.addedTemplates[K]=V)),h(V,V.content,hr,be,re)}else{let es=jt=>{var Z=jt.getAttribute(n.get("attr.exportgroup"))||"default";be==="removed"?y(d,"oohtml","exports").has(Z)&&(_t(y(d,"oohtml","exports").get(Z),jt),y(d,"oohtml","exports").has(Z).length||y(d,"oohtml","exports").delete(Z),j&&(j.removedExports[Z]||(j.removedExports[Z]=[]),j.removedExports[Z].push(jt))):be==="added"&&(y(d,"oohtml","exports").has(Z)||y(d,"oohtml","exports").set(Z,[]),y(d,"oohtml","exports").get(Z).push(jt),j&&(j.addedExports[Z]||(j.addedExports[Z]=[]),j.addedExports[Z].push(jt)))};if(V.matches(n.get("element.export"))){var $e=V.getAttribute(n.get("attr.exportid"))||"default";O(V.children).forEach(Z=>{Z.setAttribute(n.get("attr.exportgroup"),$e),es(Z)})}else es(V)}}};d.modulemutationsType=_;let D={addedTemplates:Object.create(null),removedTemplates:Object.create(null),addedExports:Object.create(null),removedExports:Object.create(null)};if(O(w.children).forEach(V=>F(V,D,_,C)),C&&u("templatemutation",D,v),_==="added"&&!y(d,"oohtml").get("onLiveMode")){y(d,"oohtml").set("onLiveMode",!0);let V=()=>{if(!d.content.children.length)return y(d,"oohtml").delete("queryCallback"),l(d,v)};d.getAttribute("src")&&(d.getAttribute("loading")==="lazy"?y(d,"oohtml").set("queryCallback",V):f.push(V())),s.onAttrChange(d,j=>{j[0].target.getAttribute(j[0].attributeName)!==j[0].oldValue&&(d.getAttribute("loading")==="lazy"?y(d,"oohtml").set("queryCallback",V):j[0].attributeName==="loading"?y(d,"oohtml").delete("queryCallback"):V())},["src","loading"]);var te=new r.MutationObserver(j=>{let be={addedTemplates:Object.create(null),removedTemplates:Object.create(null),addedExports:Object.create(null),removedExports:Object.create(null)};j.forEach(re=>{re.addedNodes.forEach(K=>F(K,be,"added",!0)),re.removedNodes.forEach(K=>F(K,be,"removed",!0))}),u("templatemutation",be,v)});te.observe(w,{childList:!0})}};if(n.get("api.templates")in i)throw new Error('document already has a "'+n.get("api.templates")+'" property!');let f=[];if(Object.defineProperty(i,n.get("api.templates"),{get:function(){return m(y(i,"oohtml","templates"))}}),n.get("api.templates")in o.prototype)throw new Error('The "HTMLTemplateElement" class already has a "'+n.get("api.templates")+'" property!');if(Object.defineProperty(o.prototype,n.get("api.templates"),{get:function(){return y(this,"oohtml").has("queryCallback")&&y(this,"oohtml").get("queryCallback")(),m(y(this,"oohtml","templates"))}}),n.get("api.exports")in o.prototype)throw new Error('The "HTMLTemplateElement" class already has a "'+n.get("api.exports")+'" property!');Object.defineProperty(o.prototype,n.get("api.exports"),{get:function(){return y(this,"oohtml").has("queryCallback")&&y(this,"oohtml").get("queryCallback")(),m(y(this,"oohtml","exports"))}});let m=d=>Object.defineProperties({},Array.from(d.keys()).reduce((w,v)=>(w[v]={get:()=>d.get(v)},w),{})),p=d=>{var w;return(w=d.match(/([^a-zA-Z0-9\_\-\@])/))?(console.error(`Invalid character "${w}" in the module name: ${d}.`),!1):!0},x=d=>{var w=i.createElement("template");return Fr([i],d,function(v,_){var C=y(v,"oohtml","templates");return arguments.length===1?C:_.startsWith(":")?y(v,"oohtml","exports").get(_.substr(1)):C.get(_)}).forEach(v=>{y(v,"oohtml","templates").forEach((_,C)=>{y(w,"oohtml","templates").set(C,_)}),y(v,"oohtml","exports").forEach((_,C)=>{y(w,"oohtml","exports").has(C)||y(w,"oohtml","exports").set(C,[]),y(w,"oohtml","exports").get(C).push(..._)})}),w};if(O(i.querySelectorAll(a)).forEach(async d=>{var w=d.getAttribute(n.get("attr.moduleid"));!d.closest(n.get("element.import"))&&p(w)&&(y(i,"oohtml","templates").set(w,d),h(d,d.content,w,"added",!1))}),s.onPresenceChange(a,async(d,w)=>{let v={addedTemplates:Object.create(null),removedTemplates:Object.create(null),addedExports:Object.create(null),removedExports:Object.create(null)};d.forEach(_=>{var C=_.getAttribute(n.get("attr.moduleid"));_.closest(n.get("element.import"))||!p(C)||(w?(y(i,"oohtml","templates").set(C,_),h(_,_.content,C,"added"),v.addedTemplates[C]=_):(y(i,"oohtml","templates").get(C)===_&&y(i,"oohtml","templates").delete(C),h(_,_.content,C,"removed"),v.removedTemplates[C]=_))}),u("templatemutation",v,"")}),s.onPresent(n.get("element.import"),d=>{h(d,d,"","added",!1)}),n.get("api.moduleref")in r.Element.prototype)throw new Error('The "Element" class already has a "'+n.get("api.moduleref")+'" property!');Object.defineProperty(r.Element.prototype,n.get("api.moduleref"),{get:function(){var d;if(!y(this,"oohtml").has("module")&&(d=this.getAttribute(n.get("attr.moduleref")))){var w=x(d);y(this,"oohtml").set("module",w)}return y(this,"oohtml").get("module")}});var b=f.length?"loading":"indeterminate";Object.defineProperty(i,"templatesReadyState",{get:()=>b}),t.DOM.ready.call(t,()=>(f.forEach(d=>{d&&d.catch(w=>{console.warn(w)})}),Promise.all(f).then(()=>{b="complete",i.dispatchEvent(new r.Event("templatesreadystatechange"))})))}function Vr(e={}){let t=ae.call(this);if(e.onDomReady){t.DOM.ready(()=>{Vr.call(this,{...e,onDomReady:!1})});return}let r=t.window,i=t.window.document,s=t.DOM.mutations,n=[],a=Ae.call(this,{element:{import:"import"},attr:{importid:"name",exportsearch:"exportsearch"}},e.params);Cs.push(a.get("attr.importid"),a.get("attr.moduleref"));let o="["+r.CSS.escape(a.get("attr.moduleref"))+"]",u="["+r.CSS.escape(a.get("attr.exportgroup"))+"]",l,h=class{static create(p){return y(this.el,"oohtml").get("instance")||new h(p)}constructor(p){this.el=p,y(this.el,"oohtml").set("instance",this);let[x,b]=Mr(p.getAttribute(a.get("attr.importid"))||"default");y(this.el,"oohtml").set("importID",x),y(this.el,"oohtml").set("importModifiers",b)}hydrate(p,x,b){y(this.el,"oohtml").set("anchorNode",p),y(this.el,"oohtml").set("slottedElements",x),y(this.el,"oohtml").set("compositionBlock",b),this._bindSlotted(x),this._connectToCompositionBlock()}connectedCallback(){y(this.el,"oohtml").has("anchorNode")||(y(this.el,"oohtml").set("anchorNode",a.get("isomorphic")?i.createComment(this.el.outerHTML):i.createTextNode("")),y(this.el,"oohtml").set("compositionBlock",this.el.hasAttribute(a.get("attr.moduleref"))?this.el.getAttribute(a.get("attr.moduleref")).trim().startsWith("~")?this.el.parentNode.closest(u):null:this.el.parentNode.closest(o)),this._connectToCompositionBlock()),t.DOM.ready.call(t,()=>{this.resolve("connected")})}_connectToCompositionBlock(){this.compositionBlock&&y(this.compositionBlock,"oohtml","imports").set(this.importID,this.el)}_bindSlotted(p){p.forEach(x=>{x.importReference=this.el}),y(this.el,"oohtml").set("slottedObserver",s.onRemoved(p,(x,b,d,w,v)=>{v&&v.size===p.length&&y(this.el,"oohtml").get("slottedObserver").disconnect(),x.forEach(_=>{_.parentNode||_t(this.slottedElements,_),_.importReference===this.el&&delete _.importReference}),this.slottedElements.length||this.anchorNode.isConnected&&this.anchorNode.replaceWith(this.el)},{maintainCallState:!0,ignoreTransients:!0}))}resolve(p=null){if(!qe(n,_=>this.el.closest(_))){var x=(_,C,F)=>{var D=this.importID,te=this.importModifiers,[V,j]="search"in te||F!==null?("search"in te?te.search:F).split("-").filter(re=>re).map(re=>parseInt(re||0)).concat([0,1e3]):[0,0];let be=re=>re.reduce((K,$e)=>K.concat(y($e,"oohtml","exports").get(D)||[]),[]);return Fr(_,C,function(re,K){var $e=y(re,"oohtml","templates");return arguments.length===1?$e:K.startsWith(":")?y(re,"oohtml","exports").get(K.substr(1)):$e.get(K)},function(re,K,$e){var hr=be(re);return!hr.length&&K>V&&j?(j--,-1):hr})},b,d;if(this.el.hasAttribute(a.get("attr.moduleref")))this.compositionBlock&&y(this.compositionBlock,"oohtml","imports").get(this.importID)===this.el&&y(this.compositionBlock,"oohtml","imports").delete(this.importID),b=this.el;else{if(!this.compositionBlock){console.warn("Scoped slots must be found within template contexts. ["+this.importID+"]",this.el);return}b=this.compositionBlock}var w=b.getAttribute(a.get("attr.moduleref")).trim(),v=this.el.getAttribute(a.get("attr.exportsearch"));b&&(d=x([w.startsWith("~")?this.compositionBlock:i],w,v)).length?St(d,y(this.el,"oohtml").get("originalSlottedElements")||[]).length&&(y(this.el,"oohtml").set("originalSlottedElements",d),this.fill(d)):(y(this.el,"oohtml").set("originalSlottedElements",null),this.empty())}}fill(p){p=O(p,!1).map(x=>x.cloneNode(!0)),this.empty(!0),this.el.isConnected&&this.el.replaceWith(this.anchorNode),p.forEach(x=>{y(x,"oohtml","templates").set("~",this.el),ma(x,this.el),x.getAttribute(a.get("attr.exportgroup"))||x.setAttribute(a.get("attr.exportgroup"),this.importID),this.anchorNode.before(x)}),this._bindSlotted(p),this.slottedElements.push(...p)}empty(p=!1){if(this.slottedElements){var x=this.slottedElements;p&&y(this.el,"oohtml").has("slottedObserver")&&(y(this.el,"oohtml").get("slottedObserver").disconnect(),x=this.slottedElements.splice(0)),x.forEach(b=>b.remove())}}get importID(){return y(this.el,"oohtml").get("importID")}get importModifiers(){return y(this.el,"oohtml").get("importModifiers")}get anchorNode(){return y(this.el,"oohtml").get("anchorNode")}get compositionBlock(){return y(this.el,"oohtml").get("compositionBlock")}get slottedElements(){return y(this.el,"oohtml").has("slottedElements")||y(this.el,"oohtml").set("slottedElements",[]),y(this.el,"oohtml").get("slottedElements")}get exports(){return y(this.el,"oohtml").get("exports")}static get observedAttributes(){return[a.get("attr.importid")]}};s.onPresent(a.get("element.import"),p=>{var x=h.create(p);x.connectedCallback()});let f=(p,x,b=null)=>{let d=(v,_)=>!x||_===x||x===!0&&(v.importModifiers&&"search"in v.importModifiers||v.el.getAttribute(a.get("attr.exportsearch")));if(p.matches(a.get("element.import"))){var w=h.create(p);d(w,w.importID)&&w.resolve(b)}else y(p,"oohtml","imports").forEach((v,_)=>{var C=h.create(v);d(C,_)&&C.resolve(`Resolution scope: ${b}`)})};s.onPresent(o,p=>{qe(n,x=>p.closest(x))||s.onAttrChange(p,x=>{x[0].target.getAttribute(x[0].attributeName)!==x[0].oldValue&&f(p,null,`Attr-Change: ${x[0].attributeName}`)},[a.get("attr.moduleref"),a.get("attr.importid")])}),i.addEventListener("templatemutation",p=>{!p.detail.path||O(i.querySelectorAll("["+r.CSS.escape(a.get("attr.moduleref"))+"]")).forEach(x=>{_s(x.getAttribute(a.get("attr.moduleref")),p.detail.path)&&(f(x,!0,`'templatemutation' event: ${p.detail.path}, search()`),p.detail.addedExports.concat(p.detail.removedExports).forEach(b=>{f(x,b.name,`'templatemutation' event: ${p.detail.path}, ${b.name}`)}))})});let m=()=>{O(i.querySelectorAll(u)).forEach(p=>{if(!y(p.parentNode,"oohtml").get("importsCan")&&!p.importReference){var x=[];p.parentNode.childNodes.forEach(b=>{var d;if(b.nodeType===1&&b.matches(u))x.push(b);else if(b.nodeType===8&&(d=b.nodeValue.trim())&&d.startsWith("<"+a.get("element.import"))&&d.endsWith("</"+a.get("element.import")+">")){var w,v=i.createElement("div");if(v.innerHTML=d,(w=v.firstChild).matches(a.get("element.import"))){var _=w.hasAttribute(a.get("attr.moduleref"))?w.getAttribute(a.get("attr.moduleref")).trim().startsWith("~")?b.parentNode.closest(u):null:b.parentNode.closest(o),C=h.create(w);C.hydrate(b,x,_),x=[]}}}),y(p.parentNode,"oohtml").set("importsCan",!0)}})};t.DOM.ready.call(t,()=>{a.get("isomorphic")&&m()})}function ma(e,t,r=[],i=!0){r=r.concat(Cs),e.hasAttribute("noinherit")&&(r=r.concat((e.getAttribute("noinherit")||"*").split(" ").map(o=>o.trim())));var s=ga.concat(["role","class"]);if(ot(s).forEach(o=>{var u,l;if(!r.includes(o)&&!r.includes("*")&&(u=t.getAttribute(o))){if(l=e.getAttribute(o))var h=i?[l,u]:[u,l];else var h=[u];e.setAttribute(o,ot(h.join(" ").split(" ").map(f=>f.trim())).join(" ")),r.push(o)}}),ot(da.concat("style")).forEach(o=>{var u,l;if(!r.includes(o)&&!r.includes("*")&&(u=t.getAttribute(o))){if(l=e.getAttribute(o)){var h=i?[l,u]:[u,l];h[0].trim().endsWith(";")||(h[0]=h[0]+";")}else var h=[u];e.setAttribute(o,h.join(" ")),r.push(o)}}),!r.includes("*"))for(var n=0;n<t.attributes.length;n++){var a=t.attributes[n];!r.includes(a.name)&&(!e.hasAttribute(a.name)||i)&&e.setAttribute(a.name,a.value)}return e}var Cs=["nocompose"],da=[],ga=[];function jr(e={}){let t=ae.call(this);if(e.onDomReady){t.DOM.ready(()=>{jr.call(this,{...e,onDomReady:!1})});return}let r=t.window,i=t.window.document,s=t.DOM.mutations,n=[],a=Ae.call(this,{attr:{namespace:"namespace",id:"id"},api:{namespace:"namespace"},eagermode:!0},e.params),o=function(l){if(!y(l,"oohtml").has("namespace")){let h=Object.create(null);y(l,"oohtml").set("namespace",h),P.link&&P.link(l,a.get("api.namespace"),h)}return y(l,"oohtml").get("namespace")},u=function(l){if(!y(l,"oohtml").has("publicNamespace")){let h=o(l);y(l,"oohtml").set("publicNamespace",a.get("eagermode")?new Proxy(h,{get(f,m){if(W(m)&&!h[m]){var p=O(l.querySelectorAll("["+r.CSS.escape(a.get("attr.id"))+'="'+m+'"]')).filter(x=>{var b=x.parentNode.closest("["+r.CSS.escape(a.get("attr.namespace"))+"]");return l===i?!b:b===l})[0];p&&P.set(h,m,p)}return h[m]}}):h)}return y(l,"oohtml").get("publicNamespace")};if(a.get("api.namespace")in r.Element.prototype)throw new Error('The "Element" class already has a "'+a.get("api.namespace")+'" property!');if(Object.defineProperty(r.Element.prototype,a.get("api.namespace"),{get:function(){return u(this)}}),a.get("api.namespace")in i)throw new Error('The "document" object already has a "'+a.get("api.namespace")+'" property!');Object.defineProperty(i,a.get("api.namespace"),{get:function(){return u(i)}}),s.onPresent("["+r.CSS.escape(a.get("attr.id"))+"]",l=>{var h=y(l,"oohtml");if(!(h.get("idAlreadyBeingWatched")||qe(n,x=>l.closest(x)))){var f=l.getAttribute(a.get("attr.id")),m=l.parentNode.closest("["+r.CSS.escape(a.get("attr.namespace"))+"]");m||(m=i);var p=o(m);p[f]!==l&&P.set(p,f,l),h.set("idAlreadyBeingWatched",!0),s.onPresenceChange(l,(x,b)=>{b?p[f]!==l&&P.set(p,f,l):p[f]===l&&P.deleteProperty(p,f)})}})}function Br(e={}){let t=ae.call(this);if(e.onDomReady){t.DOM.ready(()=>{Br.call(this,{...e,onDomReady:!1})});return}let r=t.window,i=t.window.document,s=Ae.call(this,{api:{state:"state",setState:"setState",clearState:"clearState"}},e.params),n=function(a,o=null){if(!y(a,"oohtml").has("state")||o){let u=o||Object.create(null),l=y(a,"oohtml").get("state");if(y(a,"oohtml").set("state",u),l&&P.unlink&&P.unlink(a,s.get("api.state"),l),P.link){let h=o?{isUpdate:!!l,oldValue:l}:null;P.link(a,s.get("api.state"),u,h)}}return y(a,"oohtml").get("state")};if(s.get("api.state")in r.Element.prototype)throw new Error('The "Element" class already has a "'+s.get("api.state")+'" property!');if(Object.defineProperty(r.Element.prototype,s.get("api.state"),{get:function(){return P.proxy(n(this))}}),s.get("api.setState")in r.Element.prototype)throw new Error('The "Element" class already has a "'+s.get("api.setState")+'" property!');if(Object.defineProperty(r.Element.prototype,s.get("api.setState"),{value:function(a,o={}){if(!o.update)n(this,a);else{var u=n(this);if(o.update!=="merge"){var l=St(Object.keys(u),Object.keys(a));P.deleteProperty(u,l)}P.set(u,a)}}}),s.get("api.clearState")in r.Element.prototype)throw new Error('The "Element" class already has a "'+s.get("api.clearState")+'" property!');if(Object.defineProperty(r.Element.prototype,s.get("api.clearState"),{value:function(){n(this,{})}}),s.get("api.state")in i)throw new Error('The "document" object already has a "'+s.get("api.state")+'" property!');if(Object.defineProperty(i,s.get("api.state"),{get:function(){return P.proxy(n(i))}}),s.get("api.setState")in i)throw new Error('The "document" object already has a "'+s.get("api.setState")+'" property!');if(Object.defineProperty(i,s.get("api.setState"),{value:function(a,o={}){if(!o.update)n(i,a);else{var u=n(i);if(o.update!=="merge"){var l=St(Object.keys(u),Object.keys(a));P.deleteProperty(u,l)}P.set(u,a)}}}),s.get("api.clearState")in i)throw new Error('The "document" object already has a "'+s.get("api.clearState")+'" property!');Object.defineProperty(i,s.get("api.clearState"),{value:function(){n(i,{})}})}var{stringify:xa}=JSON;if(!String.prototype.repeat)throw new Error("String.prototype.repeat is undefined, see https://github.com/davidbonnet/astring#installation");if(!String.prototype.endsWith)throw new Error("String.prototype.endsWith is undefined, see https://github.com/davidbonnet/astring#installation");var $r={"||":3,"&&":4,"|":5,"??":5,"^":6,"&":7,"==":8,"!=":8,"===":8,"!==":8,"<":9,">":9,"<=":9,">=":9,in:9,instanceof:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"%":12,"/":12,"**":13},_e=17,ya={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:_e,ClassExpression:_e,FunctionExpression:_e,ObjectExpression:_e,UpdateExpression:16,UnaryExpression:15,AwaitExpression:15,BinaryExpression:14,LogicalExpression:13,ConditionalExpression:4,AssignmentExpression:3,YieldExpression:2,RestElement:1};function Ot(e,t){let{generator:r}=e;if(e.write("("),t!=null&&t.length>0){r[t[0].type](t[0],e);let{length:i}=t;for(let s=1;s<i;s++){let n=t[s];e.write(", "),r[n.type](n,e)}}e.write(")")}function Ns(e,t,r,i){let s=e.expressionsPrecedence[t.type];if(s===_e)return!0;let n=e.expressionsPrecedence[r.type];return s!==n?!i&&s===15&&n===14&&r.operator==="**"||s<n:s!==13&&s!==14?!1:t.operator==="**"&&r.operator==="**"?!i:i?$r[t.operator]<=$r[r.operator]:$r[t.operator]<$r[r.operator]}function Ur(e,t,r,i){let{generator:s}=e;Ns(e,t,r,i)?(e.write("("),s[t.type](t,e),e.write(")")):s[t.type](t,e)}function ba(e,t,r,i){let s=t.split(`
4
+ `),n=s.length-1;if(e.write(s[0].trim()),n>0){e.write(i);for(let a=1;a<n;a++)e.write(r+s[a].trim()+i);e.write(r+s[n].trim())}}function ie(e,t,r,i){let{length:s}=t;for(let n=0;n<s;n++){let a=t[n];e.write(r),a.type[0]==="L"?e.write("// "+a.value.trim()+`
5
+ `,a):(e.write("/*"),ba(e,a.value,r,i),e.write("*/"+i))}}function wa(e){let t=e;for(;t!=null;){let{type:r}=t;if(r[0]==="C"&&r[1]==="a")return!0;if(r[0]==="M"&&r[1]==="e"&&r[2]==="m")t=t.object;else return!1}}function Ci(e,t){let{generator:r}=e,{declarations:i}=t;e.write(t.kind+" ");let{length:s}=i;if(s>0){r.VariableDeclarator(i[0],e);for(let n=1;n<s;n++)e.write(", "),r.VariableDeclarator(i[n],e)}}var ks,As,Ps,Os,Is,Ts,va={Program(e,t){let r=t.indent.repeat(t.indentLevel),{lineEnd:i,writeComments:s}=t;s&&e.comments!=null&&ie(t,e.comments,r,i);let n=e.body,{length:a}=n;for(let o=0;o<a;o++){let u=n[o];s&&u.comments!=null&&ie(t,u.comments,r,i),t.write(r),this[u.type](u,t),t.write(i)}s&&e.trailingComments!=null&&ie(t,e.trailingComments,r,i)},BlockStatement:Ts=function(e,t){let r=t.indent.repeat(t.indentLevel++),{lineEnd:i,writeComments:s}=t,n=r+t.indent;t.write("{");let a=e.body;if(a!=null&&a.length>0){t.write(i),s&&e.comments!=null&&ie(t,e.comments,n,i);let{length:o}=a;for(let u=0;u<o;u++){let l=a[u];s&&l.comments!=null&&ie(t,l.comments,n,i),t.write(n),this[l.type](l,t),t.write(i)}t.write(r)}else s&&e.comments!=null&&(t.write(i),ie(t,e.comments,n,i),t.write(r));s&&e.trailingComments!=null&&ie(t,e.trailingComments,n,i),t.write("}"),t.indentLevel--},ClassBody:Ts,StaticBlock(e,t){t.write("static "),this.BlockStatement(e,t)},EmptyStatement(e,t){t.write(";")},ExpressionStatement(e,t){let r=t.expressionsPrecedence[e.expression.type];r===_e||r===3&&e.expression.left.type[0]==="O"?(t.write("("),this[e.expression.type](e.expression,t),t.write(")")):this[e.expression.type](e.expression,t),t.write(";")},IfStatement(e,t){t.write("if ("),this[e.test.type](e.test,t),t.write(") "),this[e.consequent.type](e.consequent,t),e.alternate!=null&&(t.write(" else "),this[e.alternate.type](e.alternate,t))},LabeledStatement(e,t){this[e.label.type](e.label,t),t.write(": "),this[e.body.type](e.body,t)},BreakStatement(e,t){t.write("break"),e.label!=null&&(t.write(" "),this[e.label.type](e.label,t)),t.write(";")},ContinueStatement(e,t){t.write("continue"),e.label!=null&&(t.write(" "),this[e.label.type](e.label,t)),t.write(";")},WithStatement(e,t){t.write("with ("),this[e.object.type](e.object,t),t.write(") "),this[e.body.type](e.body,t)},SwitchStatement(e,t){let r=t.indent.repeat(t.indentLevel++),{lineEnd:i,writeComments:s}=t;t.indentLevel++;let n=r+t.indent,a=n+t.indent;t.write("switch ("),this[e.discriminant.type](e.discriminant,t),t.write(") {"+i);let{cases:o}=e,{length:u}=o;for(let l=0;l<u;l++){let h=o[l];s&&h.comments!=null&&ie(t,h.comments,n,i),h.test?(t.write(n+"case "),this[h.test.type](h.test,t),t.write(":"+i)):t.write(n+"default:"+i);let{consequent:f}=h,{length:m}=f;for(let p=0;p<m;p++){let x=f[p];s&&x.comments!=null&&ie(t,x.comments,a,i),t.write(a),this[x.type](x,t),t.write(i)}}t.indentLevel-=2,t.write(r+"}")},ReturnStatement(e,t){t.write("return"),e.argument&&(t.write(" "),this[e.argument.type](e.argument,t)),t.write(";")},ThrowStatement(e,t){t.write("throw "),this[e.argument.type](e.argument,t),t.write(";")},TryStatement(e,t){if(t.write("try "),this[e.block.type](e.block,t),e.handler){let{handler:r}=e;r.param==null?t.write(" catch "):(t.write(" catch ("),this[r.param.type](r.param,t),t.write(") ")),this[r.body.type](r.body,t)}e.finalizer&&(t.write(" finally "),this[e.finalizer.type](e.finalizer,t))},WhileStatement(e,t){t.write("while ("),this[e.test.type](e.test,t),t.write(") "),this[e.body.type](e.body,t)},DoWhileStatement(e,t){t.write("do "),this[e.body.type](e.body,t),t.write(" while ("),this[e.test.type](e.test,t),t.write(");")},ForStatement(e,t){if(t.write("for ("),e.init!=null){let{init:r}=e;r.type[0]==="V"?Ci(t,r):this[r.type](r,t)}t.write("; "),e.test&&this[e.test.type](e.test,t),t.write("; "),e.update&&this[e.update.type](e.update,t),t.write(") "),this[e.body.type](e.body,t)},ForInStatement:ks=function(e,t){t.write(`for ${e.await?"await ":""}(`);let{left:r}=e;r.type[0]==="V"?Ci(t,r):this[r.type](r,t),t.write(e.type[3]==="I"?" in ":" of "),this[e.right.type](e.right,t),t.write(") "),this[e.body.type](e.body,t)},ForOfStatement:ks,DebuggerStatement(e,t){t.write("debugger;",e)},FunctionDeclaration:As=function(e,t){t.write((e.async?"async ":"")+(e.generator?"function* ":"function ")+(e.id?e.id.name:""),e),Ot(t,e.params),t.write(" "),this[e.body.type](e.body,t)},FunctionExpression:As,VariableDeclaration(e,t){Ci(t,e),t.write(";")},VariableDeclarator(e,t){this[e.id.type](e.id,t),e.init!=null&&(t.write(" = "),this[e.init.type](e.init,t))},ClassDeclaration(e,t){if(t.write("class "+(e.id?`${e.id.name} `:""),e),e.superClass){t.write("extends ");let{superClass:r}=e,{type:i}=r,s=t.expressionsPrecedence[i];(i[0]!=="C"||i[1]!=="l"||i[5]!=="E")&&(s===_e||s<t.expressionsPrecedence.ClassExpression)?(t.write("("),this[e.superClass.type](r,t),t.write(")")):this[r.type](r,t),t.write(" ")}this.ClassBody(e.body,t)},ImportDeclaration(e,t){t.write("import ");let{specifiers:r}=e,{length:i}=r,s=0;if(i>0){for(;s<i;){s>0&&t.write(", ");let n=r[s],a=n.type[6];if(a==="D")t.write(n.local.name,n),s++;else if(a==="N")t.write("* as "+n.local.name,n),s++;else break}if(s<i){for(t.write("{");;){let n=r[s],{name:a}=n.imported;if(t.write(a,n),a!==n.local.name&&t.write(" as "+n.local.name),++s<i)t.write(", ");else break}t.write("}")}t.write(" from ")}this.Literal(e.source,t),t.write(";")},ImportExpression(e,t){t.write("import("),this[e.source.type](e.source,t),t.write(")")},ExportDefaultDeclaration(e,t){t.write("export default "),this[e.declaration.type](e.declaration,t),t.expressionsPrecedence[e.declaration.type]!=null&&e.declaration.type[0]!=="F"&&t.write(";")},ExportNamedDeclaration(e,t){if(t.write("export "),e.declaration)this[e.declaration.type](e.declaration,t);else{t.write("{");let{specifiers:r}=e,{length:i}=r;if(i>0)for(let s=0;;){let n=r[s],{name:a}=n.local;if(t.write(a,n),a!==n.exported.name&&t.write(" as "+n.exported.name),++s<i)t.write(", ");else break}t.write("}"),e.source&&(t.write(" from "),this.Literal(e.source,t)),t.write(";")}},ExportAllDeclaration(e,t){e.exported!=null?t.write("export * as "+e.exported.name+" from "):t.write("export * from "),this.Literal(e.source,t),t.write(";")},MethodDefinition(e,t){e.static&&t.write("static ");let r=e.kind[0];(r==="g"||r==="s")&&t.write(e.kind+" "),e.value.async&&t.write("async "),e.value.generator&&t.write("*"),e.computed?(t.write("["),this[e.key.type](e.key,t),t.write("]")):this[e.key.type](e.key,t),Ot(t,e.value.params),t.write(" "),this[e.value.body.type](e.value.body,t)},ClassExpression(e,t){this.ClassDeclaration(e,t)},ArrowFunctionExpression(e,t){t.write(e.async?"async ":"",e);let{params:r}=e;r!=null&&(r.length===1&&r[0].type[0]==="I"?t.write(r[0].name,r[0]):Ot(t,e.params)),t.write(" => "),e.body.type[0]==="O"?(t.write("("),this.ObjectExpression(e.body,t),t.write(")")):this[e.body.type](e.body,t)},ThisExpression(e,t){t.write("this",e)},Super(e,t){t.write("super",e)},RestElement:Ps=function(e,t){t.write("..."),this[e.argument.type](e.argument,t)},SpreadElement:Ps,YieldExpression(e,t){t.write(e.delegate?"yield*":"yield"),e.argument&&(t.write(" "),this[e.argument.type](e.argument,t))},AwaitExpression(e,t){t.write("await ",e),Ur(t,e.argument,e)},TemplateLiteral(e,t){let{quasis:r,expressions:i}=e;t.write("`");let{length:s}=i;for(let a=0;a<s;a++){let o=i[a],u=r[a];t.write(u.value.raw,u),t.write("${"),this[o.type](o,t),t.write("}")}let n=r[r.length-1];t.write(n.value.raw,n),t.write("`")},TemplateElement(e,t){t.write(e.value.raw,e)},TaggedTemplateExpression(e,t){Ur(t,e.tag,e),this[e.quasi.type](e.quasi,t)},ArrayExpression:Is=function(e,t){if(t.write("["),e.elements.length>0){let{elements:r}=e,{length:i}=r;for(let s=0;;){let n=r[s];if(n!=null&&this[n.type](n,t),++s<i)t.write(", ");else{n==null&&t.write(", ");break}}}t.write("]")},ArrayPattern:Is,ObjectExpression(e,t){let r=t.indent.repeat(t.indentLevel++),{lineEnd:i,writeComments:s}=t,n=r+t.indent;if(t.write("{"),e.properties.length>0){t.write(i),s&&e.comments!=null&&ie(t,e.comments,n,i);let a=","+i,{properties:o}=e,{length:u}=o;for(let l=0;;){let h=o[l];if(s&&h.comments!=null&&ie(t,h.comments,n,i),t.write(n),this[h.type](h,t),++l<u)t.write(a);else break}t.write(i),s&&e.trailingComments!=null&&ie(t,e.trailingComments,n,i),t.write(r+"}")}else s?e.comments!=null?(t.write(i),ie(t,e.comments,n,i),e.trailingComments!=null&&ie(t,e.trailingComments,n,i),t.write(r+"}")):e.trailingComments!=null?(t.write(i),ie(t,e.trailingComments,n,i),t.write(r+"}")):t.write("}"):t.write("}");t.indentLevel--},Property(e,t){e.method||e.kind[0]!=="i"?this.MethodDefinition(e,t):(e.shorthand||(e.computed?(t.write("["),this[e.key.type](e.key,t),t.write("]")):this[e.key.type](e.key,t),t.write(": ")),this[e.value.type](e.value,t))},PropertyDefinition(e,t){e.static&&t.write("static "),this[e.key.type](e.key,t),e.value!=null&&(t.write(" = "),this[e.value.type](e.value,t))},ObjectPattern(e,t){if(t.write("{"),e.properties.length>0){let{properties:r}=e,{length:i}=r;for(let s=0;this[r[s].type](r[s],t),++s<i;)t.write(", ")}t.write("}")},SequenceExpression(e,t){Ot(t,e.expressions)},UnaryExpression(e,t){if(e.prefix){let{operator:r,argument:i,argument:{type:s}}=e;t.write(r);let n=Ns(t,i,e);!n&&(r.length>1||s[0]==="U"&&(s[1]==="n"||s[1]==="p")&&i.prefix&&i.operator[0]===r&&(r==="+"||r==="-"))&&t.write(" "),n?(t.write(r.length>1?" (":"("),this[s](i,t),t.write(")")):this[s](i,t)}else this[e.argument.type](e.argument,t),t.write(e.operator)},UpdateExpression(e,t){e.prefix?(t.write(e.operator),this[e.argument.type](e.argument,t)):(this[e.argument.type](e.argument,t),t.write(e.operator))},AssignmentExpression(e,t){this[e.left.type](e.left,t),t.write(" "+e.operator+" "),this[e.right.type](e.right,t)},AssignmentPattern(e,t){this[e.left.type](e.left,t),t.write(" = "),this[e.right.type](e.right,t)},BinaryExpression:Os=function(e,t){let r=e.operator==="in";r&&t.write("("),Ur(t,e.left,e,!1),t.write(" "+e.operator+" "),Ur(t,e.right,e,!0),r&&t.write(")")},LogicalExpression:Os,ConditionalExpression(e,t){let{test:r}=e,i=t.expressionsPrecedence[r.type];i===_e||i<=t.expressionsPrecedence.ConditionalExpression?(t.write("("),this[r.type](r,t),t.write(")")):this[r.type](r,t),t.write(" ? "),this[e.consequent.type](e.consequent,t),t.write(" : "),this[e.alternate.type](e.alternate,t)},NewExpression(e,t){t.write("new ");let r=t.expressionsPrecedence[e.callee.type];r===_e||r<t.expressionsPrecedence.CallExpression||wa(e.callee)?(t.write("("),this[e.callee.type](e.callee,t),t.write(")")):this[e.callee.type](e.callee,t),Ot(t,e.arguments)},CallExpression(e,t){let r=t.expressionsPrecedence[e.callee.type];r===_e||r<t.expressionsPrecedence.CallExpression?(t.write("("),this[e.callee.type](e.callee,t),t.write(")")):this[e.callee.type](e.callee,t),e.optional&&t.write("?."),Ot(t,e.arguments)},ChainExpression(e,t){this[e.expression.type](e.expression,t)},MemberExpression(e,t){let r=t.expressionsPrecedence[e.object.type];r===_e||r<t.expressionsPrecedence.MemberExpression?(t.write("("),this[e.object.type](e.object,t),t.write(")")):this[e.object.type](e.object,t),e.computed?(e.optional&&t.write("?."),t.write("["),this[e.property.type](e.property,t),t.write("]")):(e.optional?t.write("?."):t.write("."),this[e.property.type](e.property,t))},MetaProperty(e,t){t.write(e.meta.name+"."+e.property.name,e)},Identifier(e,t){t.write(e.name,e)},PrivateIdentifier(e,t){t.write(`#${e.name}`,e)},Literal(e,t){e.raw!=null?t.write(e.raw,e):e.regex!=null?this.RegExpLiteral(e,t):e.bigint!=null?t.write(e.bigint+"n",e):t.write(xa(e.value),e)},RegExpLiteral(e,t){let{regex:r}=e;t.write(`/${r.pattern}/${r.flags}`,e)}},Sa={};var ki=class{constructor(t){let r=t??Sa;this.output="",r.output!=null?(this.output=r.output,this.write=this.writeToStream):this.output="",this.generator=r.generator!=null?r.generator:va,this.expressionsPrecedence=r.expressionsPrecedence!=null?r.expressionsPrecedence:ya,this.indent=r.indent!=null?r.indent:" ",this.lineEnd=r.lineEnd!=null?r.lineEnd:`
6
+ `,this.indentLevel=r.startingIndentLevel!=null?r.startingIndentLevel:0,this.writeComments=r.comments?r.comments:!1,r.sourceMap!=null&&(this.write=r.output==null?this.writeAndMap:this.writeToStreamAndMap,this.sourceMap=r.sourceMap,this.line=1,this.column=0,this.lineEndSize=this.lineEnd.split(`
7
+ `).length-1,this.mapping={original:null,generated:this,name:void 0,source:r.sourceMap.file||r.sourceMap._file})}write(t){this.output+=t}writeToStream(t){this.output.write(t)}writeAndMap(t,r){this.output+=t,this.map(t,r)}writeToStreamAndMap(t,r){this.output.write(t),this.map(t,r)}map(t,r){if(r!=null){let{type:n}=r;if(n[0]==="L"&&n[2]==="n"){this.column=0,this.line++;return}if(r.loc!=null){let{mapping:a}=this;a.original=r.loc.start,a.name=r.name,this.sourceMap.addMapping(a)}if(n[0]==="T"&&n[8]==="E"||n[0]==="L"&&n[1]==="i"&&typeof r.value=="string"){let{length:a}=t,{column:o,line:u}=this;for(let l=0;l<a;l++)t[l]===`
8
+ `?(o=0,u++):o++;this.column=o,this.line=u;return}}let{length:i}=t,{lineEnd:s}=this;i>0&&(this.lineEndSize>0&&(s.length===1?t[i-1]===s:t.endsWith(s))?(this.line+=this.lineEndSize,this.column=0):this.column+=i)}toString(){return this.output}};function Rs(e,t){let r=new ki(t);return r.generator[e.type](e,r),r.output}var se=class{constructor(t,r){this.id=t,Object.assign(this,r),this.dependencies=0}with(t,r){let i={};Object.keys(t).forEach(n=>{i[n]=this[n],this[n]=t[n]});let s=r();return Object.keys(t).forEach(n=>{this[n]=i[n]}),s}inUse(t){return arguments.length?(t?this.dependencies++:this.dependencies--,this):this.dependencies>0}};var mt=class extends se{constructor(t,r,i={}){super(r,i),this.ownerContract=t,this.refs=new Set,this.propertyStack=[],this.embeddingReference=null}withProperty(t,r){this.propertyStack.unshift(t);let i=this.embeddingReference?this.embeddingReference.withProperty(t,r):r();return this.propertyStack.shift(),i}get lineage(){return`${this.ownerContract.lineage}:${this.id}`}toJson(t=!1){return{id:this.id,type:this.type,kind:this.kind,refs:Array.from(this.refs).map(r=>r.toJson(t)),contractId:this.ownerContract.id}}};var g={tryStmt(e,t,r,i){return{type:"TryStatement",block:e,handler:t,finalizer:r,guardedHandlers:i}},catchClause(e,t){return{type:"CatchClause",param:e,body:t}},throwStmt(e){return{type:"ThrowStatement",argument:e}},returnStmt(e){return{type:"ReturnStatement",argument:e}},exprStmt(e){return{type:"ExpressionStatement",expression:e}},blockStmt(e){return{type:"BlockStatement",body:e}},labeledStmt(e,t){return{type:"LabeledStatement",label:e,body:t}},withStmt(e,t){return{type:"WithStatement",object:e,body:t}},ifStmt(e,t,r){return this.condExpr(e,t,r,"IfStatement")},switchStmt(e,t,r=!1){return{type:"SwitchStatement",discriminant:e,cases:t}},switchCase(e,t){return{type:"SwitchCase",test:e,consequent:t}},whileStmt(e,t){return{type:"WhileStatement",test:e,body:t}},doWhileStmt(e,t){return{type:"DoWhileStatement",test:e,body:t}},forStmt(e,t,r,i){return{type:"ForStatement",init:e,test:t,update:r,body:i}},forInStmt(e,t,r){return{type:"ForInStatement",left:e,right:t,body:r}},forOfStmt(e,t,r){return{type:"ForOfStatement",left:e,right:t,body:r}},breakStmt(e=null){return{type:"BreakStatement",label:e}},continueStmt(e=null){return{type:"ContinueStatement",label:e}},varDeclaration(e,t){return{type:"VariableDeclaration",kind:e,declarations:t}},varDeclarator(e,t=null){return{type:"VariableDeclarator",id:e,init:t}},funcDeclaration(e,t,r,i=!1,s=!1,n=!1){return this.func("FunctionDeclaration",...arguments)},sequenceExpr(e){return{type:"SequenceExpression",expressions:e}},parensExpr(e){return{type:"ParenthesizedExpression",expression:e}},logicalExpr(e,t,r){return{type:"LogicalExpression",operator:e,left:t,right:r}},binaryExpr(e,t,r){return{type:"BinaryExpression",operator:e,left:t,right:r}},unaryExpr(e,t,r=!0){return{type:"UnaryExpression",operator:e,argument:t,prefix:r}},updateExpr(e,t,r=!1){return{type:"UpdateExpression",operator:e,argument:t,prefix:r}},assignmentExpr(e,t,r="="){return{type:"AssignmentExpression",operator:r,left:e,right:t}},assignmentPattern(e,t){return{type:"AssignmentPattern",left:e,right:t}},thisExpr(){return{type:"ThisExpression"}},condExpr(e,t,r,i="ConditionalExpression"){return{type:i,test:e,consequent:t,alternate:r}},arrayExpr(e){return{type:"ArrayExpression",elements:e}},arrayPattern(e){return{type:"ArrayPattern",elements:e}},objectExpr(e){return{type:"ObjectExpression",properties:e}},objectPattern(e){return{type:"ObjectPattern",properties:e}},chainExpr(e){return{type:"ChainExpression",expression:e}},callExpr(e,t,r=!1){return{type:"CallExpression",callee:e,arguments:t,optional:r}},newExpr(e,t){return{type:"NewExpression",callee:e,arguments:t}},awaitExpr(e){return{type:"AwaitExpression",argument:e}},taggedTemplateExpr(e,t){return{type:"TaggedTemplateExpression",tag:e,quasi:t}},memberExpr(e,t,r=!1,i=!1){return{type:"MemberExpression",object:e,property:t,computed:r,optional:i}},funcExpr(e,t,r,i=!1,s=!1,n=!1){return this.func("FunctionExpression",...arguments)},arrowFuncExpr(e,t,r,i=!1,s=!1,n=!1){return this.func("ArrowFunctionExpression",...arguments)},func(e,t,r,i,s=!1,n=!1,a=!1){return{type:e,id:t,params:r,body:i,async:s,expression:n,generator:a}},identifier(e){return{type:"Identifier",name:e}},property(e,t,r="init",i=!1,s=!1,n=!1){return{type:"Property",key:e,value:t,kind:r,shorthand:i,computed:s,method:n}},methodDefinition(e,t,r="method",i=!1,s=!1){return{type:"MethodDefinition",key:e,value:t,kind:r,static:i,computed:s}},spreadElement(e){return{type:"SpreadElement",argument:e}},literal(e){return{type:"Literal",value:e}},templateLiteral(e,t){return{type:"TemplateLiteral",quasis:e,expressions:t}},invert(e){return this.unaryExpr("!",e)},clone(e){return e={...e},delete e.start,delete e.end,e}};var me=class extends se{constructor(t,r,i){super(r,i),this.ownerContext=t}generate(){if(!this.expr)return[this.expr,this];let t=g.identifier(this.ownerContext.getSubscriptIdentifier("$contract",!0)),r=g.memberExpr(g.memberExpr(t,g.identifier("memo")),g.literal(this.id),!0);return this.composed=g.assignmentExpr(r,this.expr),[this.composed,this]}toJson(t=!1){return{id:this.id}}};var dt=class extends se{constructor(t,r,i){super(r,i),this.ownerReference=t,this.condition=this.ownerContract.currentCondition,this.path=[],this.isDotSafe=!0}get ownerContract(){return this.ownerReference.ownerContract}push(...t){return this.doIsDotSafe(t),this.path.push(...t),this}unshift(...t){return this.doIsDotSafe(t),this.path.unshift(...t),this}doIsDotSafe(t){t.some(r=>r instanceof me||(r.name+"").includes("."))&&(this.isDotSafe=!1)}match(t){let r=(a,o)=>!a||!o?!1:a instanceof me&&o instanceof me?a.id===o.id:a.name===o.name,i=this.path,s=Array.isArray(t)?t:t.path,n=i.length-s.length;return n>0&&([i,s]=[s,i]),[i.reduce((a,o,u)=>a&&r(o,s[u]),!0),n]}toJson(t=!1){return{id:this.id,path:this.path.map(r=>r instanceof me?{memoId:r.id}:r),$path:this.isDotSafe?this.path.map(r=>r.name).join("."):void 0,condition:(this.condition||{}).lineage,referenceId:this.ownerReference.id}}};var Gt=class extends dt{constructor(t,r,i){super(t,r,i),this.subscriptions=new Map,this.$subscriptions=new Map,this.updates=new Map}subscribe(t,r,i=!1){let s=i?this.$subscriptions:this.subscriptions,n=s.get(t);n||(n=new Set,s.set(t,n)),n.add(r),this.updates.forEach(a=>a.forEach(o=>{o.subscribe(t,r,i)}))}update(t,r,i){let s=this.updates.get(t);s||(s=new Set,this.updates.set(t,s)),s.add(r),i&&this.subscriptions.forEach((n,a)=>n.forEach(o=>{r.subscribe(a,o,!0)}))}toJson(t=!1){let{id:r,condition:i,referenceId:s,...n}=super.toJson(t),a={},o={};return this.subscriptions.forEach((u,l)=>{a[l.lineage]=Array.from(u).map(h=>h.id)}),this.$subscriptions.forEach((u,l)=>{o[l.lineage]=Array.from(u).map(h=>h.id)}),{id:r,...n,depth:this.depth.map(u=>u instanceof me?{memoId:u.id}:u),subscriptions:a,$subscriptions:o,condition:i,referenceId:s}}};var Pe=class extends mt{constructor(t,r,i){super(t,r,i),this.destructuringStack=[]}withDestructure(t,r){this.destructuringStack.push(t);let i=r();return this.destructuringStack.pop(),i}addRef(t={}){let r=new Gt(this,this.refs.size,{...t,condition:this.condition,depth:this.destructuringStack.slice(0)});return r.push(...this.propertyStack),this.refs.add(r),r}doSubscribe(t,r){let i=new Set(r);return this.refs.forEach((s,n)=>{i.forEach(a=>{let[o,u]=s.match(a);if(o&&u<=0){if(this.kind==="const")return;s.subscribe(t,a),this.inUse(!0),s.condition&&s.condition.inUse(!0),i.delete(a)}})}),[...i]}doUpdate(t,r,i){let s=new Set(r);return t===this?[...s]:(this.refs.forEach((n,a)=>{s.forEach(o=>{let[u,l]=n.match(o);if(u&&l>=0){if(this.kind==="const")throw new Error("Assignment to a constant declaration.");n.update(t,o,i),s.delete(o)}})}),[...s])}inUse(t){let r=super.inUse(...arguments);return this.ownerContract.inUse(...arguments),r}};var Kt=class extends dt{};var et=class extends mt{addRef(t){let r=new Kt(this,this.refs.size,{...t,condition:this.condition});return r.push(...this.propertyStack),this.refs.add(r),r}setAssignee(t){this.assignee=t}toJson(t=!1){let r=super.toJson(t);return this.assignee&&(r.assignee=this.assignee.id),r}};var It=class extends se{constructor(t,r,i={}){super(r,i),this.ownerContext=t,this.ownerScope=t&&(t.currentScope||t.ownerScope),this.effectReferences=[]}pushEffectReference(t){this.effectReferences.push(t)}doSubscribe(t,r=null){if(r=this.effectReferences.reduce((i,s)=>s.doSubscribe(t,i),r||[...t.refs]),!r.length)return!0;if(!this.ownerScope||["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"].includes(this.type))return r=this.ownerContext.references.reduce((i,s)=>s instanceof Pe?s.doSubscribe(t,i):i,r),r.length?this.ownerContext.effectReference({},i=>(r.forEach(s=>{this.canObserveGlobal(s)&&i.addRef().push(...s.path)}),t.inUse(!0),i.doSubscribe(t,r),!0),!1):!0;if(this.ownerScope)return this.ownerScope.doSubscribe(t,r)}doUpdate(t,r=null){if(r=this.effectReferences.reduce((i,s)=>s.doUpdate(t,i),r||[...t.refs]),!this.ownerScope||["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"].includes(this.type)){if(t.type==="VariableDeclaration")return;t.ownerContract.$sideEffects=!0;let i=r.length&&r||[...t.refs];return this.ownerContext.sideEffects.push({reference:t,remainderRefs:i}),!0}if(!r.length)return!0;if(this.ownerScope)return this.ownerScope.doUpdate(t,r)}doSideEffectUpdates(t,r){if(this.effectReferences.forEach(i=>{let s=i.doUpdate(t,r,!0);i.type==="VariableDeclaration"&&(r=s)}),!r.length)return!0;if(!this.ownerScope||["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"].includes(this.type))return this.ownerContext.sideEffects.push({reference:t,remainderRefs:r,isSideEffects:!0}),!0;if(this.ownerScope)return this.ownerScope.doSideEffectUpdates(t,r)}canObserveGlobal(t){return(!this.ownerContext.$params.globalsOnlyPaths||t.path.length>1)&&!(this.ownerContext.$params.globalsNoObserve||[]).includes(t.path[0].name)}};var gt=class extends se{constructor(t,r,i){super(r,i),this.ownerContext=t,this.ownerContract=t.currentContract||t,this.parent=t.currentCondition}inUse(t){let r=super.inUse(...arguments),i=[];return this.switch?i.push(this.switch,...this.cases):(this.when||this.whenNot)&&i.push(this.when||this.whenNot),i.forEach(s=>s.inUse(...arguments)),r}get lineage(){return`${this.ownerContract.lineage}:${this.id}`}toJson(t=!1){let r={id:this.id};return this.switch?(r.switch=this.switch.id,r.cases=this.cases.map(i=>i.id)):this.whenNot?r.whenNot=this.whenNot.id:this.when&&(r.when=this.when.id),this.parent&&(this.parent.ownerContract.id===this.ownerContract.id?r.parent=this.parent.id:r.parent=`${this.parent.ownerContract.lineage}:${this.parent.id}`),r}};var Oe=class extends se{constructor(t,r,i){super(r,i),this.ownerContext=t,this.ownerContract=t&&(t.currentContract||t),this.ownerScope=t&&(t.currentScope||t.ownerScope),this.subscriptIdentifiers={},this.references=[],this.referenceStack=[],this.entries=[],this.entryStack=[],this.memos=[],this._hoistedAwaitKeyword=void 0,this._hoistedExitStatements=new Map,this._nextIds={},this.sideEffects=[],this.$sideEffects=!1}get $params(){return this.params||this.ownerContract&&this.ownerContract.$params}nextId(t){return this.ownerContext?this.ownerContext.nextId(t):(t="",typeof this._nextIds[t]>"u"&&(this._nextIds[t]=0),this._nextIds[t]++)}closest(t=null,r=!1,i=-1){if(!arguments.length)return this.ownerContract;let s=i+1;if(typeof t=="function"?t(this,s):[].concat(t).some(n=>n===this.type))return r?{instance:this,level:s}:this;if(this.ownerContract)return this.ownerContract.closest(t,r,s)}closestContext(t=!1){return this.closest(r=>r instanceof Ie,t)}closestFunction(t=!1){return this.closest(["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"],t)}defineSubscriptIdentifier(t,r,i=[]){this.subscriptIdentifiers[t]={whitelist:r,blacklist:i,toString(){return this.whitelist[0]}}}getSubscriptIdentifier(t,r=!1){return this.subscriptIdentifiers[t]||r&&this.ownerContract&&this.ownerContract.getSubscriptIdentifier(t,r)}subscriptIdentifiersNoConflict(t){if(t.type!=="Identifier")throw new Error(`An implied Identifier is of type ${t.type}`);for(let r in this.subscriptIdentifiers){let i=this.subscriptIdentifiers[r],s=i.whitelist.indexOf(t.name);s!==-1&&(i.blacklist.push(i.whitelist.splice(s,1)),i.whitelist.length||(i.whitelist=i.blacklist.map(n=>{let a;do{let o=String.fromCharCode(0|Math.random()*26+97);a=`${n}${o}`}while(i.blacklist.includes(a));return a})))}this.ownerContract&&this.ownerContract.subscriptIdentifiersNoConflict(t)}get currentReference(){return this.referenceStack[0]}pushReference(t,r){this.references.unshift(t);let i=this.currentReference;this.referenceStack.unshift(t);let s=r(t,i);if(this.referenceStack.shift()!==t)throw new Error("Reference stack corrupted.");return s}signalReference(t,r,i=!0){let s=new et(this,this.nextId("causes"),t),n=this.pushReference(s,r),a=this.closestContext(),o=a.currentScope||a.ownerScope;return(!s.refs.size||i&&!o.doSubscribe(s))&&(this.references=this.references.filter(u=>u!==s)),n}effectReference(t,r,i=!0){let s=new Pe(this,this.nextId("affecteds"),t),n=this.pushReference(s,r),a=this.closestContext(),o=a.currentScope||a.ownerScope;return o.pushEffectReference(s),s.refs.size?(s.type!=="VariableDeclaration"||s.kind==="var")&&i&&o.doUpdate(s):this.references=this.references.filter(u=>u!==s),n}chainableReference(t,r){return this.currentReference&&this.currentReference.propertyStack.length?r():this.signalReference(t,r)}embeddableSignalReference(t,r){return this.currentReference&&this.signalReference(t,(i,s)=>(i.embeddingReference=s,r(i,s)))}embeddableEffectReference(t,r){return this.effectReference(t,(i,s)=>(i.embeddingReference=s,r(i,s)))}get currentScope(){return this.entryStack.reduce((t,r)=>t||r instanceof It&&r,null)}get currentCondition(){return this.entryStack.reduce((t,r)=>t||r instanceof gt&&r,null)||this.closestFunction()!==this&&this.ownerContext&&this.ownerContext.currentCondition}get currentContext(){return this.entryStack.reduce((t,r)=>t||r instanceof Ie&&r,null)}get currentContract(){return this.entryStack.reduce((t,r)=>t||r instanceof Oe&&r,null)}get currentEntry(){return this.entryStack[0]}pushEntry(t,r){this.entries.unshift(t),this.entryStack.unshift(t);let i=r(t);return this.entryStack.shift(),t instanceof Oe&&!t.generatable()&&(this.entries=this.entries.filter(s=>s!==t)),i}createScope(t,r){let i=new It(this,this.nextId("scope"),t);return this.pushEntry(i,r)}createCondition(t,r){let i=new gt(this,this.nextId("condition"),t);return this.pushEntry(i,r)}defineContext(t,r){let i=new Ie(this,this.nextId("context"),t);return this.pushEntry(i,r)}defineContract(t,r){let i=new Oe(this,this.nextId("contract"),t);return this.pushEntry(i,r)}defineMemo(t){let r=new me(this,this.nextId("memo"),t);return this.memos.unshift(r),r}getLabelInfo(){let t=this.type,r,i;return(this.ownerScope||{}).label?{label:{name:r},type:i}=this.ownerScope:t==="Iteration"&&this.ownerContract.ownerScope.label&&({label:{name:r},type:i}=this.ownerContract.ownerScope),{type:t,label:r,target:i}}get hoistedAwaitKeyword(){return this._hoistedAwaitKeyword}get hoistedExitStatements(){return this._hoistedExitStatements}hoistAwaitKeyword(){["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"].includes(this.type)||(this._hoistedAwaitKeyword=!0,this.ownerContract&&this.ownerContract.hoistAwaitKeyword())}hoistExitStatement(t,r){if(["break","continue"].includes(t.value)){let i=this.getLabelInfo();if(i.type==="Iteration"?i.target!=="BlockStatement"&&(r.value===i.label||!r.value):r.value&&r.value===i.label)return this._hoistedExitStatements.set(t,{...i,arg:r}),i}if(this._hoistedExitStatements.set(t,r),this.ownerContract)return this.ownerContract.hoistExitStatement(t,r)}generatable(){return this.references.length||this instanceof Ie}generate(t,r={}){if(!t||!this.generatable())return t;this.generated=!0;let i=g.identifier(this.ownerContract.getSubscriptIdentifier("$contract",!0)),s,n;r.isFunctionContract?s=t:this.inSequence?s=g.arrowFuncExpr(null,[i],t,this.hoistedAwaitKeyword,!0):(n=Array.isArray(t)?g.blockStmt(t):g.blockStmt([t]),s=g.arrowFuncExpr(null,[i],n,this.hoistedAwaitKeyword));let a=[g.literal(this.id),...r.args||[],s],o=g.callExpr(i,a);if(this.hoistedAwaitKeyword&&(o=g.awaitExpr(o)),this.inSequence||r.generateForArgument)return o;let u=this;o=g.exprStmt(o),o.comments=[{type:"Line",value:{toString(){return u.lineage},trim(){return this.toString()}}}];let l=[o];if(this.hookExpr=l,!(this.ownerScope||{}).singleStatementScope){let h,f=[],m,p=(x,b)=>{let d=g.ifStmt(x,b);m?m.alternate=d:(m=d,l.push(d))};if(this.hoistedExitStatements.forEach((x,b)=>{if(["break","continue"].includes(b.value)&&!f.includes(b.value)&&x.arg){let d=x.arg,w=g.callExpr(g.memberExpr(i,g.identifier("exiting")),[b,d]),v=g.exprStmt(g.identifier(x.type==="Iteration"||!d.value?b.value:b.value+" "+d.value));p(w,v),f.push(b.value)}else h=!0}),h){let x=g.callExpr(g.memberExpr(i,g.identifier("exiting"))),b=g.exprStmt(g.identifier("return"));p(x,b)}}return l}get lineage(){let t=this.ownerContract&&this.ownerContract.lineage;return this.ownerContract&&!this.generated?t:`${t?t+"/":""}${this.id}`}toJson(t=!1){let r={id:this.id,lineage:this.lineage,type:this.type,signals:{},effects:{},sideEffects:this.sideEffects.length?!0:void 0,$sideEffects:this.$sideEffects===!0?!0:void 0,subContracts:{},conditions:{},hoistedAwaitKeyword:this.hoistedAwaitKeyword,loc:this.loc};this.references.forEach(n=>{let a;n instanceof et?a=r.signals:n instanceof Pe&&(a=r.effects),a[n.id]=n.toJson(t)});let i=this.lineage.split("/").length,s=n=>n.reduce((a,o)=>a.subContracts[o],r);return this.entries.slice(0).reverse().forEach(n=>{if(n instanceof Oe&&n.generated){let a=s(n.lineage.split("/").slice(i,-1));a.subContracts[n.id]=n.toJson(t)}else if(n instanceof gt){let a=s(n.ownerContract.lineage.split("/").slice(i));a.conditions[n.id]=n.toJson(t)}}),r}};var Ie=class extends Oe{};var xt=class{constructor(t={}){this.params=t,this.locations=[],this._locStart=this.params.locStart||0,this.deferredTasks=[]}setLocation(t,r){if(this.params.locations===!1||!r)return;let i=[r.start+this._locStart,r.end+this._locStart];this.params.locations==="detached"?(this.locations.push(i),t.loc=this.locations.length-1):t.loc=i}serialize(t,r={}){return Rs(t,{comments:!0,...r})}generate(t){let r={type:"Global"},i=new Ie(null,"#",{...r,params:this.params});i.defineSubscriptIdentifier("$contract",["$x"]);let[s]=i.createScope(r,()=>this.generateNodes(i,[t]));return this.deferredTasks.forEach(n=>n()),{source:this.serialize(s),graph:i.toJson(!1),identifier:i.getSubscriptIdentifier("$contract"),locations:this.locations,ast:s}}generateNodes(t,r,i=!1){let s=r.length;s>1&&(r=r.reduce((a,o)=>o.type==="FunctionDeclaration"?[o].concat(a):a.concat(o),[]));let n=a=>{if(a===s)return[];let o=!1,u=()=>(o=!0,n(a+1)),l;if(r[a]){let h=()=>this.generateNode(t,r[a],i);this[`generate${r[a].type}`]&&(!i||["Identifier","FunctionDeclaration","FunctionExpression"].includes(r[a].type))&&(h=()=>this[`generate${r[a].type}`].call(this,t,r[a],u)),l=h()}else l=[r[a]];return o||(l=[].concat(l).concat(u(1))),l};return n(0)}generateNode(t,r,i=!1){return Object.keys(r).reduce((s,n)=>{let a=r[n];return Array.isArray(a)?a=this.generateNodes(t,a,i):typeof a=="object"&&a&&([a]=this.generateNodes(t,[a],i)),{...s,[n]:a}},{})}generateProgram(t,r){let i={type:r.type},s=t.createScope(i,()=>this.generateNodes(t,r.body));return{...r,body:s}}generateMethodDefinition(t,r){let i=this.generateNode(t,r.value,!0);return g.methodDefinition(r.key,i,r.kind,r.static,r.computed)}generateFunctionDeclaration(t,r){return this.generateFunction(g.funcDeclaration,...arguments)}generateFunctionExpression(t,r){return this.generateFunction(g.funcExpr,...arguments)}generateArrowFunctionExpression(t,r){return this.generateFunction(g.arrowFuncExpr,...arguments)}generateFunction(t,r,i){let s=(p,x)=>p?x.effectReference({type:i.type},()=>this.generateNodes(x,[p]),!1):[p],n=(p,x,b)=>r.defineContext({type:i.type,isSubscriptFunction:i.isSubscriptFunction},d=>d.createScope({type:i.type},()=>(p=s(p,d)[0],x=x.map(w=>{if(w.type==="AssignmentPattern"){let _=this.generateNode(d,w.right),C={type:w.left.type},[F]=d.effectReference(C,()=>this.generateNodes(d,[w.left]),!1);return g.assignmentPattern(F,_)}let v={type:w.type};return[w]=d.effectReference(v,()=>this.generateNodes(d,[w]),!1),w}),i.type==="ArrowFunctionExpression"&&i.expression?b=this.generateNode(d,g.blockStmt([g.returnStmt(b)])):b=this.generateNode(d,b),[d,p,x,b]))),a=g.identifier(r.getSubscriptIdentifier("$contract",!0)),o=(p,x,b,d,w)=>x.generate(p.call(g,b,[a].concat(d),w,i.async,i.expression,i.generator),{args:[g.literal(i.type),g.identifier(i.isSubscriptFunction?"true":"false")],isFunctionContract:!0,generateForArgument:!0}),u,l,h,f,m;if(i.type==="FunctionDeclaration"){[h]=s(i.id,r),[l,,f,m]=n(null,i.params,i.body),u=o(g.funcExpr,l,null,f,m);let p=g.memberExpr(a,g.identifier("functions")),x=(b,...d)=>g.callExpr(g.memberExpr(p,g.identifier(b)),[h,...d]);u=[g.exprStmt(x("define",u)),t.call(g,h,f,g.blockStmt([g.returnStmt(g.callExpr(g.memberExpr(x("get"),g.identifier("call")),[g.thisExpr(),g.spreadElement(g.identifier("arguments"))]))]))]}else[l,h,f,m]=n(i.id,i.params,i.body),u=o(t,l,h,f,m);return this.deferredTasks.unshift(()=>{l.sideEffects.forEach(p=>{l.ownerScope.doSideEffectUpdates(p.reference,p.remainderRefs)})}),u}generateVariableDeclaration(t,r){let i={type:r.type,kind:r.kind},s=[],n=(u,l,h)=>{let f,[m]=u.signalReference(i,v=>(f=v,this.generateNodes(t,[l.init]))),p,[x]=u.effectReference(i,v=>(p=v,this.generateNodes(t,[l.id])));if(f.setAssignee(p),this.setLocation(u,l),h||r.kind==="const"||!l.init||!this.params.devMode&&!u.references.filter(v=>v instanceof et).length)return g.varDeclarator(x,m);let b=["ObjectPattern","ArrayPattern"].includes(l.id.type),d=Array.from(p.refs).map(v=>g.varDeclarator(g.identifier(v.path[0].name),null)),w=g.assignmentExpr(x,m);return s.length?(s.push(g.varDeclaration(r.kind,d),...u.generate(g.exprStmt(w))),[]):(s.push(...u.generate(g.exprStmt(w))),d)},a=t.currentContract&&["ForStatement","ForOfStatement","ForInStatement"].includes(t.currentContract.type),o=r.declarations.reduce((u,l)=>a?u.concat(n(t.currentContract,l,!0)):t.defineContract(i,h=>u.concat(n(h,l))),[]);return o.length?[g.varDeclaration(r.kind,o),...s]:s}generateIfStatement(t,r){let i={type:r.type};return t.defineContract(i,s=>{let{consequent:n,alternate:a}=r,[o]=s.signalReference(i,()=>this.generateNodes(t,[r.test])),[u,l]=t.defineMemo({expr:o}).generate();return n=t.createCondition({when:l},()=>this.generateNodes(t,[r.consequent])),n[0].type!=="BlockStatement"&&n.length>1?n=g.blockStmt(n):n=n[0],r.alternate&&(a=t.createCondition({whenNot:l},()=>this.generateNodes(t,[r.alternate])),a[0]&&a[0].type!=="BlockStatement"&&a.length>1?a=g.blockStmt(a):a=a[0]),this.setLocation(s,r),this.setLocation(l,r.test),s.generate(g.ifStmt(u,n,a))})}generateSwitchStatement(t,r){let i={type:r.type};return t.defineContract(i,s=>{let[n]=s.signalReference(i,()=>this.generateNodes(t,[r.discriminant])),[a,o]=t.defineMemo({expr:n}).generate(),u=t.createScope(i,()=>r.cases.reduce((l,h)=>{let f=l.slice(-1)[0],m=h.consequent.some(w=>w.type==="BreakStatement"),[p]=s.signalReference({type:h.type},()=>this.generateNodes(t,[h.test])),[x,b]=t.defineMemo({expr:p}).generate(),d={switch:o,cases:[b]};return f&&!f.hasBreak&&d.cases.push(...f.condition.cases),this.setLocation(b,h.test),l.concat({caseNode:h,$test:x,condition:d,hasBreak:m})},[]).map(({caseNode:l,$test:h,condition:f})=>{let m=t.createCondition(f,()=>this.generateNodes(t,l.consequent));return g.switchCase(h,m)}));return this.setLocation(s,r),this.setLocation(o,r.discriminant),s.generate(g.switchStmt(a,u))})}generateWhileStatement(t,r){return this.generateLoopStmtA(g.whileStmt,...arguments)}generateDoWhileStatement(t,r){return this.generateLoopStmtA(g.doWhileStmt,...arguments)}generateForStatement(t,r){return this.generateLoopStmtA(g.forStmt,...arguments)}generateLoopStmtA(t,r,i){let s={type:i.type};return r.defineContract({type:i.type},n=>(this.setLocation(n,i),n.defineSubscriptIdentifier("$counter",["$x_index"]),r.createScope({type:"Iteration"},()=>{let a,o,u,l;return i.type==="ForStatement"?([o,u,l]=n.signalReference(s,()=>this.generateNodes(r,[i.init,i.test,i.update])),a=h=>t.call(g,o,u,l,h)):([u]=n.signalReference(s,()=>this.generateNodes(r,[i.test])),a=h=>t.call(g,u,h)),r.defineContext({type:"Iteration",isIteration:!0},h=>{this.setLocation(h,i.body);let f,[m]=this.generateNodes(h,[i.body]);m.body.length&&([f,m]=this.composeLoopStmt(h,m));let p=[].concat(f||[]).concat(a(g.blockStmt(m)));return n.generate(p)})})))}composeLoopStmt(t,r,i={}){let s=[i.disposeCallback],n=()=>s.forEach(h=>h&&h()),a=[],o=[],u=[],l=r.body.slice(0);if(!i.iterationId){i.iterationId=g.identifier(t.getSubscriptIdentifier("$counter",!0));let h=g.varDeclarator(g.clone(i.iterationId),g.literal(-1)),f=g.updateExpr("++",g.clone(i.iterationId),!1);a.push(h),u.push(f),s.push(()=>u.pop())}return o.length&&(u.push(g.varDeclaration("let",o)),s.push(()=>u.splice(-1))),u.push(...t.generate(l,{args:[i.iterationId],disposeCallback:n})),a.length?a=g.varDeclaration("let",a):a=null,[a,u]}generateForOfStatement(t,r){return this.generateLoopStmtB(g.forOfStmt,...arguments)}generateForInStatement(t,r){return this.generateLoopStmtB(g.forInStmt,...arguments)}generateLoopStmtB(t,r,i){let s={type:i.type};return r.defineContract({type:i.type},n=>(this.setLocation(n,i),n.defineSubscriptIdentifier("$counter",[i.type==="ForInStatement"?"$x_key":"$x_index"]),r.createScope({type:"Iteration"},()=>{let a,o;i.left.type==="VariableDeclaration"?([a]=this.generateNodes(r,[i.left]),o=a.declarations[0].id):([a]=n.affectedsReference(s,()=>this.generateNodes(r,[i.left])),o=a);let[u]=n.signalReference(s,()=>this.generateNodes(r,[i.right]));return r.defineContext({type:"Iteration",isIteration:!0},l=>{this.setLocation(l,i.body);let[h]=this.generateNodes(l,[i.body]),f=t.call(g,a,u,h),m=[];if(h.body.length){let p=d=>this.composeLoopStmt(l,h,{disposeCallback:()=>{f.left=a},...d}),x=a,b=h;if(i.type==="ForOfStatement")[m,b]=p({});else if(o.type==="Identifier")[m,b]=p({iterationId:o});else{let d=g.identifier(r.getSubscriptIdentifier("$counter"));[m,b]=p({iterationId:d}),x=g.varDeclaration("let",[g.varDeclarator(g.clone(d),null)]);let w;i.left.type==="VariableDeclaration"?w=g.varDeclaration(a.kind,[g.varDeclarator(o,g.clone(d))]):w=g.exprStmt(g.sequenceExpr([g.assignmentExpr(o,g.clone(d),"=")])),b=[w].concat(b)}f=t.call(g,x,u,g.blockStmt(b))}return n.generate([].concat(m||[]).concat(f))})})))}generateLabeledStatement(t,r){t.subscriptIdentifiersNoConflict(r.label);let i={type:r.type,label:r.label};return r.body.type.endsWith("Statement")?t.createScope({type:r.body.type,label:r.label},s=>{if(r.body.type==="BlockStatement"){let a=this.generateNodes(t,r.body.body);return g.labeledStmt(r.label,g.blockStmt(a))}s.singleStatementScope=!0;let[n]=this.generateNodes(t,[r.body]);return g.labeledStmt(r.label,n)}):t.defineContract(i,s=>{this.setLocation(s,r.body);let[n]=this.generateNodes(t,[r.body]);return g.labeledStmt(r.label,s.generate(n))})}generateBreakStatement(t,r){return this.generateExitStmt(g.breakStmt,...arguments)}generateContinueStatement(t,r){return this.generateExitStmt(g.continueStmt,...arguments)}generateExitStmt(t,r,i){let s=r.currentContract.closest(["Iteration","SwitchStatement","LabeledStatement"]);if(s&&s.type==="SwitchStatement"&&i.type==="BreakStatement"&&!i.label)return t.call(g,null);let n=g.identifier(r.getSubscriptIdentifier("$contract",!0)),a=g.literal(i.type==="BreakStatement"?"break":"continue"),o=i.label?g.literal(i.label.name):g.identifier("null"),u=g.exprStmt(g.callExpr(g.memberExpr(n,g.identifier("exit")),[a,o]));return r.currentContract.hoistExitStatement(a,o),[u,g.returnStmt()]}generateReturnStatement(t,r){let i={type:r.type};return t.defineContract(i,s=>{let[n]=s.signalReference(i,()=>this.generateNodes(t,[r.argument])),a=g.identifier(t.getSubscriptIdentifier("$contract",!0)),o=g.literal("return"),u=n||g.identifier("undefined"),l=g.exprStmt(g.callExpr(g.memberExpr(a,g.identifier("exit")),[o,u]));return s.hoistExitStatement(o,g.identifier("true")),s.generate([l,g.returnStmt()])})}generateBlockStatement(t,r){return t.createScope({type:r.type},()=>{let i=this.generateNodes(t,r.body);return g.blockStmt(i)})}generateExpressionStatement(t,r){let i={type:r.type};return t.defineContract(i,s=>{this.setLocation(s,r.expression);let[n]=s.signalReference(i,()=>this.generateNodes(t,[r.expression]));return s.generate(g.exprStmt(n))})}generateSequenceExpression(t,r){let i=r.expressions.map((s,n)=>{let a={type:s.type,inSequence:!0};return n===r.expressions.length-1?([s]=t.currentContract.chainableReference(a,()=>this.generateNodes(t,[s])),s):t.defineContract(a,o=>(this.setLocation(o,s),[s]=o.signalReference(a,()=>this.generateNodes(t,[s])),s.type==="Identifier"?s:o.generate(s)))});return g.sequenceExpr(i)}generateAssignmentExpression(t,r){let i={type:r.type,kind:r.operator},s,[n]=t.currentContract.signalReference(i,u=>(s=u,this.generateNodes(t,[r.right]))),a,[o]=t.currentContract.embeddableEffectReference(i,u=>(a=u,this.generateNodes(t,[r.left])));return s.setAssignee(a),g.assignmentExpr(o,n,r.operator)}generateUpdateExpression(t,r){return this.generateMutationExpr(g.updateExpr,...arguments)}generateUnaryExpression(t,r){if(r.operator==="delete")return this.generateMutationExpr(g.unaryExpr,...arguments);let i={type:r.type,kind:r.operator},[s]=t.currentContract.signalReference(i,()=>this.generateNodes(t,[r.argument]));return g.unaryExpr(r.operator,s,r.prefix)}generateMutationExpr(t,r,i){let s={type:i.type,kind:i.operator},[n]=r.currentContract.effectReference(s,()=>this.generateNodes(r,[i.argument]));return t.call(g,i.operator,n,i.prefix)}generateBinaryExpression(t,r){let[i]=t.currentContract.signalReference({type:r.type},()=>this.generateNodes(t,[r.left])),[s]=t.currentContract.signalReference({type:r.type},()=>this.generateNodes(t,[r.right]));return g.binaryExpr(r.operator,i,s)}generateLogicalExpression(t,r){let i={type:r.type,kind:r.operator},[s]=t.currentContract.chainableReference(i,()=>this.generateNodes(t,[r.left])),[n,a]=t.defineMemo({expr:s}).generate(),o=r.operator==="||"?{whenNot:a}:{when:a},[u]=t.createCondition(o,()=>t.currentContract.chainableReference(i,()=>this.generateNodes(t,[r.right])));return this.setLocation(a,r.left),g.logicalExpr(r.operator,n,u)}generateConditionalExpression(t,r){let i={type:r.type},[s]=t.currentContract.signalReference(i,()=>this.generateNodes(t,[r.test])),[n,a]=t.defineMemo({expr:s}).generate(),[o]=t.createCondition({when:a},()=>t.currentContract.chainableReference(i,()=>this.generateNodes(t,[r.consequent]))),[u]=t.createCondition({whenNot:a},()=>t.currentContract.chainableReference(i,()=>this.generateNodes(t,[r.alternate])));return this.setLocation(a,r.test),g.condExpr(n,o,u)}generateArrayPattern(t,r){let i=r.elements.map((s,n)=>([s]=t.currentContract.currentReference.withDestructure({name:n},()=>this.generateNodes(t,[s])),s));return g.arrayPattern(i)}generateObjectPattern(t,r){let i=r.properties.map(s=>{let{key:n,value:a}=s;s.computed&&([n]=t.currentContract.signalReference({type:n.type},()=>this.generateNodes(t,[n])));let o={name:s.key.name};return s.computed&&(s.key.type==="Literal"?o={name:s.key.value}:[n,o]=t.defineMemo({expr:n}).generate()),[a]=t.currentContract.currentReference.withDestructure(o,()=>this.generateNodes(t,[a])),this.setLocation(o,s.key),g.property(n,a,s.kind,s.shorthand,s.computed,s.method)});return g.objectPattern(i)}generateMemberExpression(t,r){let{property:i}=r;r.computed&&([i]=t.currentContract.signalReference({type:i.type},()=>this.generateNodes(t,[i])));let s={name:r.property.name};r.computed&&(r.property.type==="Literal"?s={name:r.property.value}:[i,s]=t.defineMemo({expr:i}).generate());let[n]=t.currentContract.currentReference.withProperty(s,()=>this.generateNodes(t,[r.object]));return this.setLocation(s,r.property),g.memberExpr(n,i,r.computed,r.optional)}generateThisExpression(t,r){return this.generateIdentifier(...arguments)}generateIdentifier(t,r){let i=()=>r.type==="Identifier"?g.identifier(r.name):g.thisExpr();r.type==="Identifier"&&t.subscriptIdentifiersNoConflict(r);let s={name:r.type==="Identifier"?r.name:"this"};this.setLocation(s,r);let n=t.closestFunction(),a=(t.currentContract||t).currentReference;if(a)do(!n||n.isSubscriptFunction||a instanceof Pe)&&a.addRef().unshift(s);while(a=a.contextReference);return i()}generateSpreadElement(t,r){return this.generateArgumentExpr(g.spreadElement,...arguments)}generateAwaitExpression(t,r){return t.currentContract.hoistAwaitKeyword(),this.generateArgumentExpr(g.awaitExpr,...arguments)}generateArgumentExpr(t,r,i){let[s]=r.currentContract.signalReference({type:i.type},()=>this.generateNodes(r,[i.argument]));return t.call(g,s)}generateCallExpression(t,r){return this.generateCallExpr(g.callExpr,...arguments)}generateNewExpression(t,r){return this.generateCallExpr(g.newExpr,...arguments)}generateCallExpr(t,r,i){let[s]=r.currentContract.signalReference({type:i.callee.type},()=>this.generateNodes(r,[i.callee])),n=i.arguments.map(a=>r.currentContract.signalReference({type:a.type},()=>this.generateNodes(r,[a])[0]));return t.call(g,s,n,i.optional)}generateParenthesizedExpression(t,r){return this.generateExprExpr(g.parensExpr,...arguments)}generateChainExpression(t,r){return this.generateExprExpr(g.chainExpr,...arguments)}generateExprExpr(t,r,i){let[s]=this.generateNodes(r,[i.expression]);return t.call(g,s)}generateArrayExpression(t,r){let i=r.elements.map(s=>t.currentContract.signalReference({type:s.type},()=>this.generateNodes(t,[s])[0]));return g.arrayExpr(i)}generateObjectExpression(t,r){let i=this.generateNodes(t,r.properties);return g.objectExpr(i)}generateProperty(t,r){let{key:i,value:s}=r;return r.computed&&([i]=t.currentContract.signalReference({type:i.type},()=>this.generateNodes(t,[i]))),[s]=t.currentContract.signalReference({type:s.type},()=>this.generateNodes(t,[s])),g.property(i,s,r.kind,r.shorthand,r.computed,!1)}generateTaggedTemplateExpression(t,r){let[i,s]=t.currentContract.signalReference({type:r.type},()=>this.generateNodes(t,[r.tag,r.quasi]));return g.taggedTemplateExpr(i,s)}generateTemplateLiteral(t,r){let i=r.expressions.map(s=>t.currentContract.signalReference({type:r.type},()=>this.generateNodes(t,[s])[0]));return g.templateLiteral(r.quasis,i)}generateTryStatement(t,r){let[i,s,n]=this.generateNodes(t,[r.block,r.handler,r.finalizer]);return g.tryStmt(i,s,n)}generateCatchClause(t,r){let[i]=this.generateNodes(t,[r.body]);return g.catchClause(r.param,i)}generateThrowStatement(t,r){return this.generateArgumentExpr(g.throwStmt,...arguments)}};var Me=class{constructor(t,r,i,s={},n=null,a=null){this.ownerContract=t,this.graph=r,this.callee=i,this.params=s,this.exits=a||new Map,this.$thread=n||{entries:new Map,sequence:[],ownerContract:this},this.subContracts=new Map,this.contract=function(u,l,h=null,f=null){if(!this.graph.subContracts[u])throw new Error(`[${this.graph.type}:${this.graph.lineage}]: Graph not found for child contract ${u}.`);let m=this.graph.subContracts[u],p={...this.params,isIterationContract:arguments.length===3,iterationId:arguments.length===3&&l,isFunctionContract:arguments.length===4,functionType:arguments.length===4&&l,isSubscriptFunction:arguments.length===4&&h,functionScope:this.params.isFunctionContract&&this.graph.lineage||this.params.functionScope};if(p.isIterationContract){let w=h,v=new Me(this,m,w,p,this.$thread,this.exits),_=this.subContracts.get(u);return _||(_=new Map,this.subContracts.set(u,_)),_.has(p.iterationId)&&_.get(p.iterationId).dispose(),_.set(p.iterationId,v),v.call()}let x,b,d;return this.subContracts.has(u)&&this.subContracts.get(u).dispose(),p.isFunctionContract?(x=f,d=b=new Me(this,m,x,p),p.functionType!=="FunctionDeclaration"&&(d=x instanceof(async()=>{}).constructor?async function(){return b.call(this,...arguments)}:function(){return b.call(this,...arguments)},o(d,b))):(x=l,b=new Me(this,m,x,p,this.$thread,this.exits),d=b.call()),this.subContracts.set(u,b),d}.bind(this),this.contract.memo=Object.create(null),this.contract.exiting=function(u,l){if(!arguments.length)return this.exits.size;let h=this.exits.get(u)===l;return h&&this.exits.clear(),h}.bind(this),this.contract.exit=function(u,l){this.exits.set(u,l)}.bind(this),this.contract.functions=new Map,this.contract.functions.define=(u,l)=>{this.contract.functions.set(u,l),o(u,l,!0)};let o=(u,l,h=!1)=>{h||(Object.defineProperty(u,"length",{configurable:!0,value:l.callee.length-1}),Object.defineProperty(u,"name",{configurable:!0,value:l.callee.name})),l.params.isSubscriptFunction&&(u.thread=l.thread.bind(l),u.dispose=l.dispose.bind(l),Object.defineProperty(u,"runtime",{value:l}),Object.defineProperty(u,"sideEffects",{configurable:!0,value:l.graph.sideEffects||""}),Object.defineProperty(u,"subscriptSource",{configurable:!0,value:l.graph.subscriptSource||""}),Object.defineProperty(u,"originalSource",{configurable:!0,value:l.graph.originalSource||""}))}}fire(t,r,i){if(!!this.ownerContract)return this.ownerContract.fire(t,r,i)}call(t,...r){if(this.disposed)throw new Error(`[${this.graph.type}:${this.graph.lineage}]: Instance not runable after having been disposed.`);let i=this.callee.call(t,this.contract,...r);if(this.graph.$sideEffects)for(let s in this.graph.effects)for(let n of this.graph.effects[s].refs)this.buildThread([],n,[],0,!0);if(!this.ownerContract||this.params.isFunctionContract){let s=this.exits.get("return");this.exits.clear(),s!==void 0&&(i=i instanceof Promise?i.then(()=>s):s)}return i}iterate(t=[]){if(this.disposed)return!1;if(!["ForOfStatement","ForInStatement"].includes(this.graph.type)||this.subContracts.size!==1)throw new Error(`Contract ${this.graph.lineage} is not an iterator.`);let[[,r]]=this.subContracts,i,s=(n,a)=>n instanceof Promise?n.then(a):a();if(!t.length||t.includes("length")&&this.graph.type==="ForOfStatement")for(let[,n]of r)i=s(i,()=>n.call());else for(let n of t){let a=r.get(n)||r.get(parseInt(n));!a||(i=s(i,()=>a.call()))}return i}thread(...t){if(this.disposed)return!1;this.$thread.active=!0;for(let r in this.graph.effects)for(let i of this.graph.effects[r].refs)for(let s of t){let[n,a,o]=this.matchRefs(s,i);!n||this.buildThread(s,i,o,a)}return this.runThread()}runThread(){let t=(a,o)=>{if(["ForOfStatement","ForInStatement"].includes(a.graph.type)&&o.every(u=>u.executionPlan.isIterationContractTarget)){let u=o.map(l=>l.executionPlan.iterationTarget);return this.fire(a.graph.lineage,"iterating",o),a.iterate(u)}return this.fire(a.graph.lineage,"executing",o),a.call()},r,i,s,n=(a,o)=>a instanceof Promise?a.then(o):o();for(;(i=this.$thread.sequence.shift())&&(s=[...this.$thread.entries.get(i)])&&this.$thread.entries.delete(i);)r=n(r,()=>{if(i.disposed||!i.filterRefs(s).length)return;this.$thread.current=i;let a=t(i,s);return n(a,()=>{for(let o of s)[].concat(o.executionPlan.assigneeRef||o.executionPlan.assigneeRefs||[]).forEach(u=>{i.buildThread([],u,[],0)})}),a});return n(r,()=>{let a=this.exits.get("return");return this.exits.clear(),this.$thread.current=null,this.$thread.active=!1,a})}buildThread(t,r,i,s=0,n=!1){let a=s>0;if(this.ownerContract){if(!this.compute(i)||r.condition!==void 0&&!this.assert(r.condition))return}else a||(a=i.length||r.condition!==void 0);let o=n?r.$subscriptions:r.subscriptions;Object.keys(o).forEach(u=>{let[l,h]=u.split(":"),f=p=>{!p||p.selectRefs(h,o[u],a?t:null)},m=this.locate(l);Array.isArray(m)?m.forEach(f):f(m)})}selectRefs(t,r,i=null){let s=this.$thread,n=this.graph.signals[t],a=(u,l)=>u.graph.lineage.localeCompare(l.graph.lineage,void 0,{numeric:!0}),o=(u,l=[],h={})=>{if(!s.active||s.current&&a(this,s.current)<0)return;let f=s.entries.get(this);if(f||(f=new Set,s.entries.set(this,f),s.sequence.push(this),s.sequence.sort(a)),f.add({...u,computes:l,executionPlan:h}),!h.assigneeRef&&["VariableDeclaration","AssignmentExpression"].includes(this.graph.type)){h.assigneeRefs=[];for(let m in this.graph.effects)h.assigneeRefs.push(...this.graph.effects[m].refs)}};for(let u of r){let l=n.refs[u];if(!i){o(l);continue}let[h,f,m]=this.matchRefs(i,l);if(!h)continue;if(f<=0){o(l,m);continue}let p=i.slice(-f),x="assignee"in n?this.graph.effects[n.assignee]:null;if(x){x.refs.forEach(b=>{if(b.depth.length){let[d,w,v]=this.matchRefs(p,b.depth),_=m.concat(v);if(d&&w>0){let C=b.path.concat(p.slice(-w));this.buildThread(C,b,_,w)}else d&&o(l,_,{assigneeRef:b})}else{let d=b.path.concat(p);this.buildThread(d,b,m,f)}});continue}if(f===1&&this.graph.type==="ForOfStatement"){o(l,m,{isIterationContractTarget:!0,iterationTarget:p[0]});continue}if(f===1&&this.graph.type==="ForInStatement"){o(l,m,{isIterationContractTarget:!0,iterationTarget:p[0]});continue}}}filterRefs(t){return t.filter(r=>{if(!!this.compute(r.computes)&&!(r.condition!==void 0&&!this.assert(r.condition)))return!0})}matchRefs(t,r){let i,s,n,a;Array.isArray(t)?(i=t,s=t.dotSafe?t.join("."):void 0):(i=t.path,s=t.$path),Array.isArray(r)?(n=r,a=r.dotSafe?r.join("."):void 0):(n=r.path,a=r.$path);let o=i.length-n.length;if(o>0&&([i,n,s,a]=[n,i,a,s]),s&&a)return[`${a}.`.startsWith(`${s}.`),o,[]];let u=[],l=f=>typeof f=="object"?f.name:f,h=(f,m)=>{if(!f||!m)return!1;let p=typeof f=="object"&&"memoId"in f,x=typeof m=="object"&&"memoId"in m;return p||x?(u.push(b=>(p?b[f.memoId]:l(f))===(x?b[m.memoId]:l(m))),!0):l(f)===l(m)};return[i.reduce((f,m,p)=>f&&h(m,n[p]),!0),o,u]}locate(t){let r=this.graph.lineage+"/",i=t+"/";if(i===r)return this;if(i.startsWith(r)){let s=t.slice(r.length).split("/"),n=this.subContracts.get(parseInt(s.shift()));if(s.length){if(n instanceof Map)return Array.from(n).reduce((a,[o,u])=>a.concat(u.locate(t)),[]);if(n)return n.locate(t)}return n}if(this.ownerContract)return this.ownerContract.locate(t)}compute(t){return!t.some(r=>r(this.contract.memo)===!1)}assert(t){if(typeof t=="string"&&t.includes(":")){let[s,n]=t.split(":");return this.locate(s).assert(n)}let r=this.graph.conditions[t],i=this.contract.memo;return typeof r.parent<"u"&&!this.assert(r.parent)?!1:typeof r.switch<"u"?r.cases.some(s=>i[s]===i[r.switch]):typeof r.whenNot<"u"?!i[r.whenNot]:typeof r.when<"u"?i[r.when]:!0}dispose(){this.params.isFunctionContract||(this.subContracts.forEach((t,r)=>{t instanceof Map?(t.forEach(i=>i.dispose()),t.clear()):t.dispose()}),this.subContracts.clear(),delete this.ownerContract,delete this.callee,delete this.params,delete this.contract.memo,this.disposed=!0)}};var Tt=class extends Me{static create(t,r=[],i={}){let s=t.graph.hoistedAwaitKeyword?Object.getPrototypeOf(async function(){}).constructor:Function,n=i.compileFunction?i.compileFunction(t.source,[t.identifier+""].concat(r)):new s(t.identifier+"",...r,t.source);return new this(null,t.graph,n,i)}constructor(t,r,i,s={},n=null){super(t,r,i,s={},n),this.observers=[]}observe(t,r){this.params.devMode,this.observers.push({contractUrl:t,callback:r})}fire(t,r,i){(this.observers||[]).forEach(s=>{s.contractUrl===t&&s.callback(r,i)})}};function Ai(e,t=!1){let r=e.split(/\n/g);if(r.length>1){for(;!r[0].trim().length;)r.shift();let i=r[t?1:0].split(/[^\s]/)[0].length;if(i)return r.map((s,n)=>{let a=s.substring(0,i);return a.trim().length?a.trim()==="}"&&n===r.length-1?"}":s:s.substring(i)}).join(`
9
+ `)}return e}function U(...e){let t=typeof e[e.length-1]=="object"?e.pop():{};t.compilerParams={...U.compilerParams,...t.compilerParams||{}},t.runtimeParams={...U.runtimeParams,...t.runtimeParams||{}};let r=Ai(e.pop()||""),i,s=e;if(U.cache[r]&&!t.compilerParams.devMode&&Oi(s,U.cache[r][1])&&Ii(t.compilerParams,U.cache[r][2]))[i,s]=U.cache[r];else{let n=Pi(r);i=new xt(t.compilerParams).generate(n),U.cache[r]=[i,s,t.compilerParams]}return Fs(this,i,e,t.runtimeParams,r)}U.cache={};U.compilerParams={globalsNoObserve:[],globalsOnlyPaths:!1,compact:2};U.runtimeParams={};U.cloneCache={};U.clone=function(e,t=null,r={},i={}){if(typeof e!="function")throw new Error(`Expected argument 1 to be of type 'function' but got ${typeof e}.`);if(!e.name)throw new Error("Function must have a name.");let s=Ai(e.toString(),!0),n=s,a;if(s.startsWith("async ")&&(a=!0,n=n.substring(6)),!n.startsWith("function ")&&!n.startsWith("function(")){if(n.trim().startsWith("[")){let h,f=n.split(/\](?:[\s]+)?\(/g).filter(m=>m);[h,n]=f.reduce((m,p,x)=>{if(Array.isArray(m))return m;p=`${m}${p||""}]`;try{return Pi(p),[p,`${e.name}(${f.slice(x+1).join("] (")}`]}catch{return`${p} (`}},"")}n="function "+n}let o,u,l;if(U.cloneCache[n]&&!r.devMode&&Ii(r,U.cloneCache[n][3]))[o,u,l]=U.cloneCache[n];else{let h=Pi(n).body[0],f=h.body.start+1;n.substr(f,1)===`
10
+ `&&(f+=1);let m=new xt({...r,...U.compilerParams,locStart:-f});u=h.params.map(p=>m.serialize(p)),o=m.generate({type:"Program",body:h.body.body}),!o.graph.hoistedAwaitKeyword&&a&&(o.graph.hoistedAwaitKeyword=!0),l=n.substring(f,h.body.end-1),U.cloneCache[n]=[o,u,l,r]}return Fs(t,o,u,i,l,e.name)};var Fs=function(e,t,r=[],i={},s=null,n=null){let a=Tt.create(t,r,{...i,...U.runtimeParams}),o=function(...l){try{return a.call(this===void 0?e:this,...l)}catch(h){throw console.info("-----------------------"),console.log(s||""),console.info("-----------------------"),h}};o.thread=a.thread.bind(a),o.dispose=a.dispose.bind(a),Object.defineProperty(o,"runtime",{value:a}),Object.defineProperty(o,"sideEffects",{configurable:!0,value:a.graph.sideEffects}),Object.defineProperty(o,"subscriptSource",{configurable:!0,value:t.source}),Object.defineProperty(o,"originalSource",{configurable:!0,value:s}),Object.defineProperty(o,"length",{configurable:!0,value:r.length}),Object.defineProperty(o,"name",{configurable:!0,value:n});let u=(t.graph.hoistedAwaitKeyword?"async ":"")+"function"+(n?" "+n:"");return o.toString=()=>`${u}(${r.join(", ")}) {${s}}`,o},Ls=new Map,Pi=function(e,t={}){t={ecmaVersion:"2020",allowReturnOutsideFunction:!0,allowAwaitOutsideFunction:!0,allowSuperOutsideMethod:!0,preserveParens:!1,...t};let r=Ls.get(e);return r||(r=Ti.parse(e,t),Ls.set(e,r)),r},Oi=(e,t)=>typeof e=="object"&&e&&typeof t=="object"&&t?Ii(e,t):Array.isArray(e)&&Array.isArray(t)&&e.length===t.length?e.every(r=>t.some(i=>Oi(r,i))):e===t,Ii=function(e,t){for(let r in e)if(!Oi(e[r],t[r]))return!1;return!0};var Ni=e=>class extends(e||class{}){static get compilerParams(){return{}}static get runtimeParams(){return{}}static get subscriptMethods(){return[]}static implementMethod(t,r=null){return U.clone(t,r,this.compilerParams,this.runtimeParams)}constructor(){super();let t=this.constructor;t.subscriptMethods.forEach(r=>{if(!this[r])throw new Error(`${r} is not a method.`);if(r==="constructor")throw new Error("Class constructors cannot be subscript methods.");this[r]=t.implementMethod(this[r],this)})}};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,154,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,161,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,19306,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,262,6,10,9,357,0,62,13,1495,6,110,6,6,9,4759,9,787719,239],Bs=[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,85,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,190,0,80,921,103,110,18,195,2637,96,16,1070,4050,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,46,2,18,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,482,44,11,6,17,0,322,29,19,43,1269,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,4152,8,221,3,5761,15,7472,3104,541,1507,4938],Ea="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F",$s="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",Ri={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"},Li="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",Ca={5:Li,"5module":Li+" export import",6:Li+" const class extends export import super"},ka=/^in(stanceof)?$/,Aa=new RegExp("["+$s+"]"),Pa=new RegExp("["+$s+Ea+"]");function Mi(e,t){for(var r=65536,i=0;i<t.length;i+=2){if(r+=t[i],r>e)return!1;if(r+=t[i+1],r>=e)return!0}}function Ve(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&Aa.test(String.fromCharCode(e)):t===!1?!1:Mi(e,Bs)}function Nt(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&Pa.test(String.fromCharCode(e)):t===!1?!1:Mi(e,Bs)||Mi(e,_a)}var M=function(t,r){r===void 0&&(r={}),this.label=t,this.keyword=r.keyword,this.beforeExpr=!!r.beforeExpr,this.startsExpr=!!r.startsExpr,this.isLoop=!!r.isLoop,this.isAssign=!!r.isAssign,this.prefix=!!r.prefix,this.postfix=!!r.postfix,this.binop=r.binop||null,this.updateContext=null};function de(e,t){return new M(e,{beforeExpr:!0,binop:t})}var ge={beforeExpr:!0},oe={startsExpr:!0},ji={};function L(e,t){return t===void 0&&(t={}),t.keyword=e,ji[e]=new M(e,t)}var c={num:new M("num",oe),regexp:new M("regexp",oe),string:new M("string",oe),name:new M("name",oe),privateId:new M("privateId",oe),eof:new M("eof"),bracketL:new M("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new M("]"),braceL:new M("{",{beforeExpr:!0,startsExpr:!0}),braceR:new M("}"),parenL:new M("(",{beforeExpr:!0,startsExpr:!0}),parenR:new M(")"),comma:new M(",",ge),semi:new M(";",ge),colon:new M(":",ge),dot:new M("."),question:new M("?",ge),questionDot:new M("?."),arrow:new M("=>",ge),template:new M("template"),invalidTemplate:new M("invalidTemplate"),ellipsis:new M("...",ge),backQuote:new M("`",oe),dollarBraceL:new M("${",{beforeExpr:!0,startsExpr:!0}),eq:new M("=",{beforeExpr:!0,isAssign:!0}),assign:new M("_=",{beforeExpr:!0,isAssign:!0}),incDec:new M("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new M("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:de("||",1),logicalAND:de("&&",2),bitwiseOR:de("|",3),bitwiseXOR:de("^",4),bitwiseAND:de("&",5),equality:de("==/!=/===/!==",6),relational:de("</>/<=/>=",7),bitShift:de("<</>>/>>>",8),plusMin:new M("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:de("%",10),star:de("*",10),slash:de("/",10),starstar:new M("**",{beforeExpr:!0}),coalesce:de("??",1),_break:L("break"),_case:L("case",ge),_catch:L("catch"),_continue:L("continue"),_debugger:L("debugger"),_default:L("default",ge),_do:L("do",{isLoop:!0,beforeExpr:!0}),_else:L("else",ge),_finally:L("finally"),_for:L("for",{isLoop:!0}),_function:L("function",oe),_if:L("if"),_return:L("return",ge),_switch:L("switch"),_throw:L("throw",ge),_try:L("try"),_var:L("var"),_const:L("const"),_while:L("while",{isLoop:!0}),_with:L("with"),_new:L("new",{beforeExpr:!0,startsExpr:!0}),_this:L("this",oe),_super:L("super",oe),_class:L("class",oe),_extends:L("extends",ge),_export:L("export"),_import:L("import",oe),_null:L("null",oe),_true:L("true",oe),_false:L("false",oe),_in:L("in",{beforeExpr:!0,binop:7}),_instanceof:L("instanceof",{beforeExpr:!0,binop:7}),_typeof:L("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:L("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:L("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},ye=/\r\n?|\n|\u2028|\u2029/,Oa=new RegExp(ye.source,"g");function Rt(e){return e===10||e===13||e===8232||e===8233}function Us(e,t,r){r===void 0&&(r=e.length);for(var i=t;i<r;i++){var s=e.charCodeAt(i);if(Rt(s))return i<r-1&&s===13&&e.charCodeAt(i+1)===10?i+2:i+1}return-1}var qs=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,xe=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Ws=Object.prototype,Ia=Ws.hasOwnProperty,Ta=Ws.toString,Zt=Object.hasOwn||function(e,t){return Ia.call(e,t)},Ms=Array.isArray||function(e){return Ta.call(e)==="[object Array]"};function yt(e){return new RegExp("^(?:"+e.replace(/ /g,"|")+")$")}function tt(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var Na=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Xt=function(t,r){this.line=t,this.column=r};Xt.prototype.offset=function(t){return new Xt(this.line,this.column+t)};var Qr=function(t,r,i){this.start=r,this.end=i,t.sourceFile!==null&&(this.source=t.sourceFile)};function Hs(e,t){for(var r=1,i=0;;){var s=Us(e,i,t);if(s<0)return new Xt(r,t-i);++r,i=s}}var Di={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},Ds=!1;function Ra(e){var t={};for(var r in Di)t[r]=e&&Zt(e,r)?e[r]:Di[r];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!Ds&&typeof console=="object"&&console.warn&&(Ds=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
11
+ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved==null&&(t.allowReserved=t.ecmaVersion<5),Ms(t.onToken)){var i=t.onToken;t.onToken=function(s){return i.push(s)}}return Ms(t.onComment)&&(t.onComment=La(t,t.onComment)),t}function La(e,t){return function(r,i,s,n,a,o){var u={type:r?"Block":"Line",value:i,start:s,end:n};e.locations&&(u.loc=new Qr(this,a,o)),e.ranges&&(u.range=[s,n]),t.push(u)}}var Yt=1,Lt=2,Bi=4,zs=8,Qs=16,Gs=32,$i=64,Ks=128,er=256,Ui=Yt|Lt|er;function qi(e,t){return Lt|(e?Bi:0)|(t?zs:0)}var Wr=0,Wi=1,De=2,Js=3,Xs=4,Ys=5,G=function(t,r,i){this.options=t=Ra(t),this.sourceFile=t.sourceFile,this.keywords=yt(Ca[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var s="";t.allowReserved!==!0&&(s=Ri[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(s+=" await")),this.reservedWords=yt(s);var n=(s?s+" ":"")+Ri.strict;this.reservedWordsStrict=yt(n),this.reservedWordsStrictBind=yt(n+" "+Ri.strictBind),this.input=String(r),this.containsEsc=!1,i?(this.pos=i,this.lineStart=this.input.lastIndexOf(`
12
+ `,i-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(ye).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=c.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=t.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&&t.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(Yt),this.regexpState=null,this.privateNameStack=[]},Te={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}};G.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)};Te.inFunction.get=function(){return(this.currentVarScope().flags&Lt)>0};Te.inGenerator.get=function(){return(this.currentVarScope().flags&zs)>0&&!this.currentVarScope().inClassFieldInit};Te.inAsync.get=function(){return(this.currentVarScope().flags&Bi)>0&&!this.currentVarScope().inClassFieldInit};Te.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e];if(t.inClassFieldInit||t.flags&er)return!1;if(t.flags&Lt)return(t.flags&Bi)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};Te.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags,r=e.inClassFieldInit;return(t&$i)>0||r||this.options.allowSuperOutsideMethod};Te.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Ks)>0};Te.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};Te.allowNewDotTarget.get=function(){var e=this.currentThisScope(),t=e.flags,r=e.inClassFieldInit;return(t&(Lt|er))>0||r};Te.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&er)>0};G.extend=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];for(var i=this,s=0;s<t.length;s++)i=t[s](i);return i};G.parse=function(t,r){return new this(r,t).parse()};G.parseExpressionAt=function(t,r,i){var s=new this(i,t,r);return s.nextToken(),s.parseExpression()};G.tokenizer=function(t,r){return new this(r,t)};Object.defineProperties(G.prototype,Te);var ne=G.prototype,Fa=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;ne.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){xe.lastIndex=e,e+=xe.exec(this.input)[0].length;var t=Fa.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){xe.lastIndex=e+t[0].length;var r=xe.exec(this.input),i=r.index+r[0].length,s=this.input.charAt(i);return s===";"||s==="}"||ye.test(r[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(s)||s==="!"&&this.input.charAt(i+1)==="=")}e+=t[0].length,xe.lastIndex=e,e+=xe.exec(this.input)[0].length,this.input[e]===";"&&e++}};ne.eat=function(e){return this.type===e?(this.next(),!0):!1};ne.isContextual=function(e){return this.type===c.name&&this.value===e&&!this.containsEsc};ne.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};ne.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};ne.canInsertSemicolon=function(){return this.type===c.eof||this.type===c.braceR||ye.test(this.input.slice(this.lastTokEnd,this.start))};ne.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};ne.semicolon=function(){!this.eat(c.semi)&&!this.insertSemicolon()&&this.unexpected()};ne.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0};ne.expect=function(e){this.eat(e)||this.unexpected()};ne.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var Gr=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};ne.checkPatternErrors=function(e,t){if(!!e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var r=t?e.parenthesizedAssign:e.parenthesizedBind;r>-1&&this.raiseRecoverable(r,"Parenthesized pattern")}};ne.checkExpressionErrors=function(e,t){if(!e)return!1;var r=e.shorthandAssign,i=e.doubleProto;if(!t)return r>=0||i>=0;r>=0&&this.raise(r,"Shorthand property assignments are valid only in destructuring patterns"),i>=0&&this.raiseRecoverable(i,"Redefinition of __proto__ property")};ne.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")};ne.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var I=G.prototype;I.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==c.eof;){var r=this.parseStatement(null,!0,t);e.body.push(r)}if(this.inModule)for(var i=0,s=Object.keys(this.undefinedExports);i<s.length;i+=1){var n=s[i];this.raiseRecoverable(this.undefinedExports[n].start,"Export '"+n+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,"Program")};var Hi={kind:"loop"},Ma={kind:"switch"};I.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;xe.lastIndex=this.pos;var t=xe.exec(this.input),r=this.pos+t[0].length,i=this.input.charCodeAt(r);if(i===91||i===92||i>55295&&i<56320)return!0;if(e)return!1;if(i===123)return!0;if(Ve(i,!0)){for(var s=r+1;Nt(i=this.input.charCodeAt(s),!0);)++s;if(i===92||i>55295&&i<56320)return!0;var n=this.input.slice(r,s);if(!ka.test(n))return!0}return!1};I.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;xe.lastIndex=this.pos;var e=xe.exec(this.input),t=this.pos+e[0].length,r;return!ye.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(Nt(r=this.input.charCodeAt(t+8))||r>55295&&r<56320))};I.parseStatement=function(e,t,r){var i=this.type,s=this.startNode(),n;switch(this.isLet(e)&&(i=c._var,n="let"),i){case c._break:case c._continue:return this.parseBreakContinueStatement(s,i.keyword);case c._debugger:return this.parseDebuggerStatement(s);case c._do:return this.parseDoStatement(s);case c._for:return this.parseForStatement(s);case c._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(s,!1,!e);case c._class:return e&&this.unexpected(),this.parseClass(s,!0);case c._if:return this.parseIfStatement(s);case c._return:return this.parseReturnStatement(s);case c._switch:return this.parseSwitchStatement(s);case c._throw:return this.parseThrowStatement(s);case c._try:return this.parseTryStatement(s);case c._const:case c._var:return n=n||this.value,e&&n!=="var"&&this.unexpected(),this.parseVarStatement(s,n);case c._while:return this.parseWhileStatement(s);case c._with:return this.parseWithStatement(s);case c.braceL:return this.parseBlock(!0,s);case c.semi:return this.parseEmptyStatement(s);case c._export:case c._import:if(this.options.ecmaVersion>10&&i===c._import){xe.lastIndex=this.pos;var a=xe.exec(this.input),o=this.pos+a[0].length,u=this.input.charCodeAt(o);if(u===40||u===46)return this.parseExpressionStatement(s,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||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'")),i===c._import?this.parseImport(s):this.parseExport(s,r);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(s,!0,!e);var l=this.value,h=this.parseExpression();return i===c.name&&h.type==="Identifier"&&this.eat(c.colon)?this.parseLabeledStatement(s,l,h,e):this.parseExpressionStatement(s,h)}};I.parseBreakContinueStatement=function(e,t){var r=t==="break";this.next(),this.eat(c.semi)||this.insertSemicolon()?e.label=null:this.type!==c.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var i=0;i<this.labels.length;++i){var s=this.labels[i];if((e.label==null||s.name===e.label.name)&&(s.kind!=null&&(r||s.kind==="loop")||e.label&&r))break}return i===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,r?"BreakStatement":"ContinueStatement")};I.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")};I.parseDoStatement=function(e){return this.next(),this.labels.push(Hi),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(c._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(c.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};I.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Hi),this.enterScope(0),this.expect(c.parenL),this.type===c.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var r=this.isLet();if(this.type===c._var||this.type===c._const||r){var i=this.startNode(),s=r?"let":this.value;return this.next(),this.parseVar(i,!0,s),this.finishNode(i,"VariableDeclaration"),(this.type===c._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&i.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===c._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,i)):(t>-1&&this.unexpected(t),this.parseFor(e,i))}var n=this.isContextual("let"),a=!1,o=new Gr,u=this.parseExpression(t>-1?"await":!0,o);return this.type===c._in||(a=this.options.ecmaVersion>=6&&this.isContextual("of"))?(this.options.ecmaVersion>=9&&(this.type===c._in?t>-1&&this.unexpected(t):e.await=t>-1),n&&a&&this.raise(u.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(u,!1,o),this.checkLValPattern(u),this.parseForIn(e,u)):(this.checkExpressionErrors(o,!0),t>-1&&this.unexpected(t),this.parseFor(e,u))};I.parseFunctionStatement=function(e,t,r){return this.next(),this.parseFunction(e,Jt|(r?0:Vi),!1,t)};I.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(c._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};I.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(c.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};I.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(c.braceL),this.labels.push(Ma),this.enterScope(0);for(var t,r=!1;this.type!==c.braceR;)if(this.type===c._case||this.type===c._default){var i=this.type===c._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),i?t.test=this.parseExpression():(r&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),r=!0,t.test=null),this.expect(c.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};I.parseThrowStatement=function(e){return this.next(),ye.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Da=[];I.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===c._catch){var t=this.startNode();if(this.next(),this.eat(c.parenL)){t.param=this.parseBindingAtom();var r=t.param.type==="Identifier";this.enterScope(r?Gs:0),this.checkLValPattern(t.param,r?Xs:De),this.expect(c.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0);t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(c._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};I.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")};I.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Hi),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};I.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};I.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};I.parseLabeledStatement=function(e,t,r,i){for(var s=0,n=this.labels;s<n.length;s+=1){var a=n[s];a.name===t&&this.raise(r.start,"Label '"+t+"' is already declared")}for(var o=this.type.isLoop?"loop":this.type===c._switch?"switch":null,u=this.labels.length-1;u>=0;u--){var l=this.labels[u];if(l.statementStart===e.start)l.statementStart=this.start,l.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(i?i.indexOf("label")===-1?i+"label":i:"label"),this.labels.pop(),e.label=r,this.finishNode(e,"LabeledStatement")};I.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")};I.parseBlock=function(e,t,r){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(c.braceL),e&&this.enterScope(0);this.type!==c.braceR;){var i=this.parseStatement(null);t.body.push(i)}return r&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")};I.parseFor=function(e,t){return e.init=t,this.expect(c.semi),e.test=this.type===c.semi?null:this.parseExpression(),this.expect(c.semi),e.update=this.type===c.parenR?null:this.parseExpression(),this.expect(c.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};I.parseForIn=function(e,t){var r=this.type===c._in;return this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!r||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")&&this.raise(t.start,(r?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=r?this.parseExpression():this.parseMaybeAssign(),this.expect(c.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,r?"ForInStatement":"ForOfStatement")};I.parseVar=function(e,t,r){for(e.declarations=[],e.kind=r;;){var i=this.startNode();if(this.parseVarId(i,r),this.eat(c.eq)?i.init=this.parseMaybeAssign(t):r==="const"&&!(this.type===c._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():i.id.type!=="Identifier"&&!(t&&(this.type===c._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):i.init=null,e.declarations.push(this.finishNode(i,"VariableDeclarator")),!this.eat(c.comma))break}return e};I.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?Wi:De,!1)};var Jt=1,Vi=2,Zs=4;I.parseFunction=function(e,t,r,i,s){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!i)&&(this.type===c.star&&t&Vi&&this.unexpected(),e.generator=this.eat(c.star)),this.options.ecmaVersion>=8&&(e.async=!!i),t&Jt&&(e.id=t&Zs&&this.type!==c.name?null:this.parseIdent(),e.id&&!(t&Vi)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?Wi:De:Js));var n=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(qi(e.async,e.generator)),t&Jt||(e.id=this.type===c.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,r,!1,s),this.yieldPos=n,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,t&Jt?"FunctionDeclaration":"FunctionExpression")};I.parseFunctionParams=function(e){this.expect(c.parenL),e.params=this.parseBindingList(c.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};I.parseClass=function(e,t){this.next();var r=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var i=this.enterClassBody(),s=this.startNode(),n=!1;for(s.body=[],this.expect(c.braceL);this.type!==c.braceR;){var a=this.parseClassElement(e.superClass!==null);a&&(s.body.push(a),a.type==="MethodDefinition"&&a.kind==="constructor"?(n&&this.raise(a.start,"Duplicate constructor in the same class"),n=!0):a.key&&a.key.type==="PrivateIdentifier"&&Va(i,a)&&this.raiseRecoverable(a.key.start,"Identifier '#"+a.key.name+"' has already been declared"))}return this.strict=r,this.next(),e.body=this.finishNode(s,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")};I.parseClassElement=function(e){if(this.eat(c.semi))return null;var t=this.options.ecmaVersion,r=this.startNode(),i="",s=!1,n=!1,a="method",o=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(c.braceL))return this.parseClassStaticBlock(r),r;this.isClassElementNameStart()||this.type===c.star?o=!0:i="static"}if(r.static=o,!i&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===c.star)&&!this.canInsertSemicolon()?n=!0:i="async"),!i&&(t>=9||!n)&&this.eat(c.star)&&(s=!0),!i&&!n&&!s){var u=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?a=u:i=u)}if(i?(r.computed=!1,r.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),r.key.name=i,this.finishNode(r.key,"Identifier")):this.parseClassElementName(r),t<13||this.type===c.parenL||a!=="method"||s||n){var l=!r.static&&Hr(r,"constructor"),h=l&&e;l&&a!=="method"&&this.raise(r.key.start,"Constructor can't have get/set modifier"),r.kind=l?"constructor":a,this.parseClassMethod(r,s,n,h)}else this.parseClassField(r);return r};I.isClassElementNameStart=function(){return this.type===c.name||this.type===c.privateId||this.type===c.num||this.type===c.string||this.type===c.bracketL||this.type.keyword};I.parseClassElementName=function(e){this.type===c.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)};I.parseClassMethod=function(e,t,r,i){var s=e.key;e.kind==="constructor"?(t&&this.raise(s.start,"Constructor can't be a generator"),r&&this.raise(s.start,"Constructor can't be an async method")):e.static&&Hr(e,"prototype")&&this.raise(s.start,"Classes may not have a static property named prototype");var n=e.value=this.parseMethod(t,r,i);return e.kind==="get"&&n.params.length!==0&&this.raiseRecoverable(n.start,"getter should have no params"),e.kind==="set"&&n.params.length!==1&&this.raiseRecoverable(n.start,"setter should have exactly one param"),e.kind==="set"&&n.params[0].type==="RestElement"&&this.raiseRecoverable(n.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")};I.parseClassField=function(e){if(Hr(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&Hr(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(c.eq)){var t=this.currentThisScope(),r=t.inClassFieldInit;t.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),t.inClassFieldInit=r}else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")};I.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(er|$i);this.type!==c.braceR;){var r=this.parseStatement(null);e.body.push(r)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")};I.parseClassId=function(e,t){this.type===c.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,De,!1)):(t===!0&&this.unexpected(),e.id=null)};I.parseClassSuper=function(e){e.superClass=this.eat(c._extends)?this.parseExprSubscripts(!1):null};I.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};I.exitClassBody=function(){for(var e=this.privateNameStack.pop(),t=e.declared,r=e.used,i=this.privateNameStack.length,s=i===0?null:this.privateNameStack[i-1],n=0;n<r.length;++n){var a=r[n];Zt(t,a.name)||(s?s.used.push(a):this.raiseRecoverable(a.start,"Private field '#"+a.name+"' must be declared in an enclosing class"))}};function Va(e,t){var r=t.key.name,i=e[r],s="true";return t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set")&&(s=(t.static?"s":"i")+t.kind),i==="iget"&&s==="iset"||i==="iset"&&s==="iget"||i==="sget"&&s==="sset"||i==="sset"&&s==="sget"?(e[r]="true",!1):i?!0:(e[r]=s,!1)}function Hr(e,t){var r=e.computed,i=e.key;return!r&&(i.type==="Identifier"&&i.name===t||i.type==="Literal"&&i.value===t)}I.parseExport=function(e,t){if(this.next(),this.eat(c.star))return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==c.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(c._default)){this.checkExport(t,"default",this.lastTokStart);var r;if(this.type===c._function||(r=this.isAsyncFunction())){var i=this.startNode();this.next(),r&&this.next(),e.declaration=this.parseFunction(i,Jt|Zs,!1,r)}else if(this.type===c._class){var s=this.startNode();e.declaration=this.parseClass(s,"nullableID")}else e.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(null),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==c.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var n=0,a=e.specifiers;n<a.length;n+=1){var o=a[n];this.checkUnreserved(o.local),this.checkLocalExport(o.local),o.local.type==="Literal"&&this.raise(o.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")};I.checkExport=function(e,t,r){!e||(typeof t!="string"&&(t=t.type==="Identifier"?t.name:t.value),Zt(e,t)&&this.raiseRecoverable(r,"Duplicate export '"+t+"'"),e[t]=!0)};I.checkPatternExport=function(e,t){var r=t.type;if(r==="Identifier")this.checkExport(e,t,t.start);else if(r==="ObjectPattern")for(var i=0,s=t.properties;i<s.length;i+=1){var n=s[i];this.checkPatternExport(e,n)}else if(r==="ArrayPattern")for(var a=0,o=t.elements;a<o.length;a+=1){var u=o[a];u&&this.checkPatternExport(e,u)}else r==="Property"?this.checkPatternExport(e,t.value):r==="AssignmentPattern"?this.checkPatternExport(e,t.left):r==="RestElement"?this.checkPatternExport(e,t.argument):r==="ParenthesizedExpression"&&this.checkPatternExport(e,t.expression)};I.checkVariableExport=function(e,t){if(!!e)for(var r=0,i=t;r<i.length;r+=1){var s=i[r];this.checkPatternExport(e,s.id)}};I.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};I.parseExportSpecifiers=function(e){var t=[],r=!0;for(this.expect(c.braceL);!this.eat(c.braceR);){if(r)r=!1;else if(this.expect(c.comma),this.afterTrailingComma(c.braceR))break;var i=this.startNode();i.local=this.parseModuleExportName(),i.exported=this.eatContextual("as")?this.parseModuleExportName():i.local,this.checkExport(e,i.exported,i.exported.start),t.push(this.finishNode(i,"ExportSpecifier"))}return t};I.parseImport=function(e){return this.next(),this.type===c.string?(e.specifiers=Da,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===c.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(e,"ImportDeclaration")};I.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===c.name){var r=this.startNode();if(r.local=this.parseIdent(),this.checkLValSimple(r.local,De),e.push(this.finishNode(r,"ImportDefaultSpecifier")),!this.eat(c.comma))return e}if(this.type===c.star){var i=this.startNode();return this.next(),this.expectContextual("as"),i.local=this.parseIdent(),this.checkLValSimple(i.local,De),e.push(this.finishNode(i,"ImportNamespaceSpecifier")),e}for(this.expect(c.braceL);!this.eat(c.braceR);){if(t)t=!1;else if(this.expect(c.comma),this.afterTrailingComma(c.braceR))break;var s=this.startNode();s.imported=this.parseModuleExportName(),this.eatContextual("as")?s.local=this.parseIdent():(this.checkUnreserved(s.imported),s.local=s.imported),this.checkLValSimple(s.local,De),e.push(this.finishNode(s,"ImportSpecifier"))}return e};I.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===c.string){var e=this.parseLiteral(this.value);return Na.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)};I.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)};I.isDirectiveCandidate=function(e){return e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var Ce=G.prototype;Ce.toAssignable=function(e,t,r){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",r&&this.checkPatternErrors(r,!0);for(var i=0,s=e.properties;i<s.length;i+=1){var n=s[i];this.toAssignable(n,t),n.type==="RestElement"&&(n.argument.type==="ArrayPattern"||n.argument.type==="ObjectPattern")&&this.raise(n.argument.start,"Unexpected token")}break;case"Property":e.kind!=="init"&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",r&&this.checkPatternErrors(r,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),e.argument.type==="AssignmentPattern"&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":e.operator!=="="&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,r);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else r&&this.checkPatternErrors(r,!0);return e};Ce.toAssignableList=function(e,t){for(var r=e.length,i=0;i<r;i++){var s=e[i];s&&this.toAssignable(s,t)}if(r){var n=e[r-1];this.options.ecmaVersion===6&&t&&n&&n.type==="RestElement"&&n.argument.type!=="Identifier"&&this.unexpected(n.argument.start)}return e};Ce.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")};Ce.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==c.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")};Ce.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case c.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(c.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case c.braceL:return this.parseObj(!0)}return this.parseIdent()};Ce.parseBindingList=function(e,t,r){for(var i=[],s=!0;!this.eat(e);)if(s?s=!1:this.expect(c.comma),t&&this.type===c.comma)i.push(null);else{if(r&&this.afterTrailingComma(e))break;if(this.type===c.ellipsis){var n=this.parseRestBinding();this.parseBindingListItem(n),i.push(n),this.type===c.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}else{var a=this.parseMaybeDefault(this.start,this.startLoc);this.parseBindingListItem(a),i.push(a)}}return i};Ce.parseBindingListItem=function(e){return e};Ce.parseMaybeDefault=function(e,t,r){if(r=r||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(c.eq))return r;var i=this.startNodeAt(e,t);return i.left=r,i.right=this.parseMaybeAssign(),this.finishNode(i,"AssignmentPattern")};Ce.checkLValSimple=function(e,t,r){t===void 0&&(t=Wr);var i=t!==Wr;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(i?"Binding ":"Assigning to ")+e.name+" in strict mode"),i&&(t===De&&e.name==="let"&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),r&&(Zt(r,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),r[e.name]=!0),t!==Ys&&this.declareName(e.name,t,e.start));break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":i&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return i&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,r);default:this.raise(e.start,(i?"Binding":"Assigning to")+" rvalue")}};Ce.checkLValPattern=function(e,t,r){switch(t===void 0&&(t=Wr),e.type){case"ObjectPattern":for(var i=0,s=e.properties;i<s.length;i+=1){var n=s[i];this.checkLValInnerPattern(n,t,r)}break;case"ArrayPattern":for(var a=0,o=e.elements;a<o.length;a+=1){var u=o[a];u&&this.checkLValInnerPattern(u,t,r)}break;default:this.checkLValSimple(e,t,r)}};Ce.checkLValInnerPattern=function(e,t,r){switch(t===void 0&&(t=Wr),e.type){case"Property":this.checkLValInnerPattern(e.value,t,r);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,r);break;case"RestElement":this.checkLValPattern(e.argument,t,r);break;default:this.checkLValPattern(e,t,r)}};var Ee=function(t,r,i,s,n){this.token=t,this.isExpr=!!r,this.preserveSpace=!!i,this.override=s,this.generator=!!n},q={b_stat:new Ee("{",!1),b_expr:new Ee("{",!0),b_tmpl:new Ee("${",!1),p_stat:new Ee("(",!1),p_expr:new Ee("(",!0),q_tmpl:new Ee("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new Ee("function",!1),f_expr:new Ee("function",!0),f_expr_gen:new Ee("function",!0,!1,null,!0),f_gen:new Ee("function",!1,!1,null,!0)},Ft=G.prototype;Ft.initialContext=function(){return[q.b_stat]};Ft.curContext=function(){return this.context[this.context.length-1]};Ft.braceIsBlock=function(e){var t=this.curContext();return t===q.f_expr||t===q.f_stat?!0:e===c.colon&&(t===q.b_stat||t===q.b_expr)?!t.isExpr:e===c._return||e===c.name&&this.exprAllowed?ye.test(this.input.slice(this.lastTokEnd,this.start)):e===c._else||e===c.semi||e===c.eof||e===c.parenR||e===c.arrow?!0:e===c.braceL?t===q.b_stat:e===c._var||e===c._const||e===c.name?!1:!this.exprAllowed};Ft.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token==="function")return t.generator}return!1};Ft.updateContext=function(e){var t,r=this.type;r.keyword&&e===c.dot?this.exprAllowed=!1:(t=r.updateContext)?t.call(this,e):this.exprAllowed=r.beforeExpr};Ft.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)};c.parenR.updateContext=c.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();e===q.b_stat&&this.curContext().token==="function"&&(e=this.context.pop()),this.exprAllowed=!e.isExpr};c.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?q.b_stat:q.b_expr),this.exprAllowed=!0};c.dollarBraceL.updateContext=function(){this.context.push(q.b_tmpl),this.exprAllowed=!0};c.parenL.updateContext=function(e){var t=e===c._if||e===c._for||e===c._with||e===c._while;this.context.push(t?q.p_stat:q.p_expr),this.exprAllowed=!0};c.incDec.updateContext=function(){};c._function.updateContext=c._class.updateContext=function(e){e.beforeExpr&&e!==c._else&&!(e===c.semi&&this.curContext()!==q.p_stat)&&!(e===c._return&&ye.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===c.colon||e===c.braceL)&&this.curContext()===q.b_stat)?this.context.push(q.f_expr):this.context.push(q.f_stat),this.exprAllowed=!1};c.backQuote.updateContext=function(){this.curContext()===q.q_tmpl?this.context.pop():this.context.push(q.q_tmpl),this.exprAllowed=!1};c.star.updateContext=function(e){if(e===c._function){var t=this.context.length-1;this.context[t]===q.f_expr?this.context[t]=q.f_expr_gen:this.context[t]=q.f_gen}this.exprAllowed=!0};c.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==c.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var N=G.prototype;N.checkPropClash=function(e,t,r){if(!(this.options.ecmaVersion>=9&&e.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var i=e.key,s;switch(i.type){case"Identifier":s=i.name;break;case"Literal":s=String(i.value);break;default:return}var n=e.kind;if(this.options.ecmaVersion>=6){s==="__proto__"&&n==="init"&&(t.proto&&(r?r.doubleProto<0&&(r.doubleProto=i.start):this.raiseRecoverable(i.start,"Redefinition of __proto__ property")),t.proto=!0);return}s="$"+s;var a=t[s];if(a){var o;n==="init"?o=this.strict&&a.init||a.get||a.set:o=a.init||a[n],o&&this.raiseRecoverable(i.start,"Redefinition of property")}else a=t[s]={init:!1,get:!1,set:!1};a[n]=!0}};N.parseExpression=function(e,t){var r=this.start,i=this.startLoc,s=this.parseMaybeAssign(e,t);if(this.type===c.comma){var n=this.startNodeAt(r,i);for(n.expressions=[s];this.eat(c.comma);)n.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(n,"SequenceExpression")}return s};N.parseMaybeAssign=function(e,t,r){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var i=!1,s=-1,n=-1,a=-1;t?(s=t.parenthesizedAssign,n=t.trailingComma,a=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new Gr,i=!0);var o=this.start,u=this.startLoc;(this.type===c.parenL||this.type===c.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await");var l=this.parseMaybeConditional(e,t);if(r&&(l=r.call(this,l,o,u)),this.type.isAssign){var h=this.startNodeAt(o,u);return h.operator=this.value,this.type===c.eq&&(l=this.toAssignable(l,!1,t)),i||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=l.start&&(t.shorthandAssign=-1),this.type===c.eq?this.checkLValPattern(l):this.checkLValSimple(l),h.left=l,this.next(),h.right=this.parseMaybeAssign(e),a>-1&&(t.doubleProto=a),this.finishNode(h,"AssignmentExpression")}else i&&this.checkExpressionErrors(t,!0);return s>-1&&(t.parenthesizedAssign=s),n>-1&&(t.trailingComma=n),l};N.parseMaybeConditional=function(e,t){var r=this.start,i=this.startLoc,s=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return s;if(this.eat(c.question)){var n=this.startNodeAt(r,i);return n.test=s,n.consequent=this.parseMaybeAssign(),this.expect(c.colon),n.alternate=this.parseMaybeAssign(e),this.finishNode(n,"ConditionalExpression")}return s};N.parseExprOps=function(e,t){var r=this.start,i=this.startLoc,s=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||s.start===r&&s.type==="ArrowFunctionExpression"?s:this.parseExprOp(s,r,i,-1,e)};N.parseExprOp=function(e,t,r,i,s){var n=this.type.binop;if(n!=null&&(!s||this.type!==c._in)&&n>i){var a=this.type===c.logicalOR||this.type===c.logicalAND,o=this.type===c.coalesce;o&&(n=c.logicalAND.binop);var u=this.value;this.next();var l=this.start,h=this.startLoc,f=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,s),l,h,n,s),m=this.buildBinary(t,r,e,f,u,a||o);return(a&&this.type===c.coalesce||o&&(this.type===c.logicalOR||this.type===c.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(m,t,r,i,s)}return e};N.buildBinary=function(e,t,r,i,s,n){i.type==="PrivateIdentifier"&&this.raise(i.start,"Private identifier can only be left side of binary expression");var a=this.startNodeAt(e,t);return a.left=r,a.operator=s,a.right=i,this.finishNode(a,n?"LogicalExpression":"BinaryExpression")};N.parseMaybeUnary=function(e,t,r,i){var s=this.start,n=this.startLoc,a;if(this.isContextual("await")&&this.canAwait)a=this.parseAwait(i),t=!0;else if(this.type.prefix){var o=this.startNode(),u=this.type===c.incDec;o.operator=this.value,o.prefix=!0,this.next(),o.argument=this.parseMaybeUnary(null,!0,u,i),this.checkExpressionErrors(e,!0),u?this.checkLValSimple(o.argument):this.strict&&o.operator==="delete"&&o.argument.type==="Identifier"?this.raiseRecoverable(o.start,"Deleting local variable in strict mode"):o.operator==="delete"&&en(o.argument)?this.raiseRecoverable(o.start,"Private fields can not be deleted"):t=!0,a=this.finishNode(o,u?"UpdateExpression":"UnaryExpression")}else if(!t&&this.type===c.privateId)(i||this.privateNameStack.length===0)&&this.unexpected(),a=this.parsePrivateIdent(),this.type!==c._in&&this.unexpected();else{if(a=this.parseExprSubscripts(e,i),this.checkExpressionErrors(e))return a;for(;this.type.postfix&&!this.canInsertSemicolon();){var l=this.startNodeAt(s,n);l.operator=this.value,l.prefix=!1,l.argument=a,this.checkLValSimple(a),this.next(),a=this.finishNode(l,"UpdateExpression")}}if(!r&&this.eat(c.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(s,n,a,this.parseMaybeUnary(null,!1,!1,i),"**",!1);else return a};function en(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&en(e.expression)}N.parseExprSubscripts=function(e,t){var r=this.start,i=this.startLoc,s=this.parseExprAtom(e,t);if(s.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return s;var n=this.parseSubscripts(s,r,i,!1,t);return e&&n.type==="MemberExpression"&&(e.parenthesizedAssign>=n.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=n.start&&(e.parenthesizedBind=-1),e.trailingComma>=n.start&&(e.trailingComma=-1)),n};N.parseSubscripts=function(e,t,r,i,s){for(var n=this.options.ecmaVersion>=8&&e.type==="Identifier"&&e.name==="async"&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,a=!1;;){var o=this.parseSubscript(e,t,r,i,n,a,s);if(o.optional&&(a=!0),o===e||o.type==="ArrowFunctionExpression"){if(a){var u=this.startNodeAt(t,r);u.expression=o,o=this.finishNode(u,"ChainExpression")}return o}e=o}};N.parseSubscript=function(e,t,r,i,s,n,a){var o=this.options.ecmaVersion>=11,u=o&&this.eat(c.questionDot);i&&u&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var l=this.eat(c.bracketL);if(l||u&&this.type!==c.parenL&&this.type!==c.backQuote||this.eat(c.dot)){var h=this.startNodeAt(t,r);h.object=e,l?(h.property=this.parseExpression(),this.expect(c.bracketR)):this.type===c.privateId&&e.type!=="Super"?h.property=this.parsePrivateIdent():h.property=this.parseIdent(this.options.allowReserved!=="never"),h.computed=!!l,o&&(h.optional=u),e=this.finishNode(h,"MemberExpression")}else if(!i&&this.eat(c.parenL)){var f=new Gr,m=this.yieldPos,p=this.awaitPos,x=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var b=this.parseExprList(c.parenR,this.options.ecmaVersion>=8,!1,f);if(s&&!u&&!this.canInsertSemicolon()&&this.eat(c.arrow))return this.checkPatternErrors(f,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=m,this.awaitPos=p,this.awaitIdentPos=x,this.parseArrowExpression(this.startNodeAt(t,r),b,!0,a);this.checkExpressionErrors(f,!0),this.yieldPos=m||this.yieldPos,this.awaitPos=p||this.awaitPos,this.awaitIdentPos=x||this.awaitIdentPos;var d=this.startNodeAt(t,r);d.callee=e,d.arguments=b,o&&(d.optional=u),e=this.finishNode(d,"CallExpression")}else if(this.type===c.backQuote){(u||n)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var w=this.startNodeAt(t,r);w.tag=e,w.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(w,"TaggedTemplateExpression")}return e};N.parseExprAtom=function(e,t){this.type===c.slash&&this.readRegexp();var r,i=this.potentialArrowAt===this.start;switch(this.type){case c._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),r=this.startNode(),this.next(),this.type===c.parenL&&!this.allowDirectSuper&&this.raise(r.start,"super() call outside constructor of a subclass"),this.type!==c.dot&&this.type!==c.bracketL&&this.type!==c.parenL&&this.unexpected(),this.finishNode(r,"Super");case c._this:return r=this.startNode(),this.next(),this.finishNode(r,"ThisExpression");case c.name:var s=this.start,n=this.startLoc,a=this.containsEsc,o=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!a&&o.name==="async"&&!this.canInsertSemicolon()&&this.eat(c._function))return this.overrideContext(q.f_expr),this.parseFunction(this.startNodeAt(s,n),0,!1,!0,t);if(i&&!this.canInsertSemicolon()){if(this.eat(c.arrow))return this.parseArrowExpression(this.startNodeAt(s,n),[o],!1,t);if(this.options.ecmaVersion>=8&&o.name==="async"&&this.type===c.name&&!a&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return o=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(c.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(s,n),[o],!0,t)}return o;case c.regexp:var u=this.value;return r=this.parseLiteral(u.value),r.regex={pattern:u.pattern,flags:u.flags},r;case c.num:case c.string:return this.parseLiteral(this.value);case c._null:case c._true:case c._false:return r=this.startNode(),r.value=this.type===c._null?null:this.type===c._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,"Literal");case c.parenL:var l=this.start,h=this.parseParenAndDistinguishExpression(i,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(h)&&(e.parenthesizedAssign=l),e.parenthesizedBind<0&&(e.parenthesizedBind=l)),h;case c.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(c.bracketR,!0,!0,e),this.finishNode(r,"ArrayExpression");case c.braceL:return this.overrideContext(q.b_expr),this.parseObj(!1,e);case c._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case c._class:return this.parseClass(this.startNode(),!1);case c._new:return this.parseNew();case c.backQuote:return this.parseTemplate();case c._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}};N.parseExprImport=function(){var e=this.startNode();this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import");var t=this.parseIdent(!0);switch(this.type){case c.parenL:return this.parseDynamicImport(e);case c.dot:return e.meta=t,this.parseImportMeta(e);default:this.unexpected()}};N.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(c.parenR)){var t=this.start;this.eat(c.comma)&&this.eat(c.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")};N.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")};N.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")};N.parseParenExpression=function(){this.expect(c.parenL);var e=this.parseExpression();return this.expect(c.parenR),e};N.parseParenAndDistinguishExpression=function(e,t){var r=this.start,i=this.startLoc,s,n=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var a=this.start,o=this.startLoc,u=[],l=!0,h=!1,f=new Gr,m=this.yieldPos,p=this.awaitPos,x;for(this.yieldPos=0,this.awaitPos=0;this.type!==c.parenR;)if(l?l=!1:this.expect(c.comma),n&&this.afterTrailingComma(c.parenR,!0)){h=!0;break}else if(this.type===c.ellipsis){x=this.start,u.push(this.parseParenItem(this.parseRestBinding())),this.type===c.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}else u.push(this.parseMaybeAssign(!1,f,this.parseParenItem));var b=this.lastTokEnd,d=this.lastTokEndLoc;if(this.expect(c.parenR),e&&!this.canInsertSemicolon()&&this.eat(c.arrow))return this.checkPatternErrors(f,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=m,this.awaitPos=p,this.parseParenArrowList(r,i,u,t);(!u.length||h)&&this.unexpected(this.lastTokStart),x&&this.unexpected(x),this.checkExpressionErrors(f,!0),this.yieldPos=m||this.yieldPos,this.awaitPos=p||this.awaitPos,u.length>1?(s=this.startNodeAt(a,o),s.expressions=u,this.finishNodeAt(s,"SequenceExpression",b,d)):s=u[0]}else s=this.parseParenExpression();if(this.options.preserveParens){var w=this.startNodeAt(r,i);return w.expression=s,this.finishNode(w,"ParenthesizedExpression")}else return s};N.parseParenItem=function(e){return e};N.parseParenArrowList=function(e,t,r,i){return this.parseArrowExpression(this.startNodeAt(e,t),r,!1,i)};var ja=[];N.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(c.dot)){e.meta=t;var r=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),r&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var i=this.start,s=this.startLoc,n=this.type===c._import;return e.callee=this.parseSubscripts(this.parseExprAtom(),i,s,!0,!1),n&&e.callee.type==="ImportExpression"&&this.raise(i,"Cannot use new with import()"),this.eat(c.parenL)?e.arguments=this.parseExprList(c.parenR,this.options.ecmaVersion>=8,!1):e.arguments=ja,this.finishNode(e,"NewExpression")};N.parseTemplateElement=function(e){var t=e.isTagged,r=this.startNode();return this.type===c.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),r.value={raw:this.value,cooked:null}):r.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
13
+ `),cooked:this.value},this.next(),r.tail=this.type===c.backQuote,this.finishNode(r,"TemplateElement")};N.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var r=this.startNode();this.next(),r.expressions=[];var i=this.parseTemplateElement({isTagged:t});for(r.quasis=[i];!i.tail;)this.type===c.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(c.dollarBraceL),r.expressions.push(this.parseExpression()),this.expect(c.braceR),r.quasis.push(i=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(r,"TemplateLiteral")};N.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===c.name||this.type===c.num||this.type===c.string||this.type===c.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===c.star)&&!ye.test(this.input.slice(this.lastTokEnd,this.start))};N.parseObj=function(e,t){var r=this.startNode(),i=!0,s={};for(r.properties=[],this.next();!this.eat(c.braceR);){if(i)i=!1;else if(this.expect(c.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(c.braceR))break;var n=this.parseProperty(e,t);e||this.checkPropClash(n,s,t),r.properties.push(n)}return this.finishNode(r,e?"ObjectPattern":"ObjectExpression")};N.parseProperty=function(e,t){var r=this.startNode(),i,s,n,a;if(this.options.ecmaVersion>=9&&this.eat(c.ellipsis))return e?(r.argument=this.parseIdent(!1),this.type===c.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(r,"RestElement")):(this.type===c.parenL&&t&&(t.parenthesizedAssign<0&&(t.parenthesizedAssign=this.start),t.parenthesizedBind<0&&(t.parenthesizedBind=this.start)),r.argument=this.parseMaybeAssign(!1,t),this.type===c.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(r,"SpreadElement"));this.options.ecmaVersion>=6&&(r.method=!1,r.shorthand=!1,(e||t)&&(n=this.start,a=this.startLoc),e||(i=this.eat(c.star)));var o=this.containsEsc;return this.parsePropertyName(r),!e&&!o&&this.options.ecmaVersion>=8&&!i&&this.isAsyncProp(r)?(s=!0,i=this.options.ecmaVersion>=9&&this.eat(c.star),this.parsePropertyName(r,t)):s=!1,this.parsePropertyValue(r,e,i,s,n,a,t,o),this.finishNode(r,"Property")};N.parsePropertyValue=function(e,t,r,i,s,n,a,o){if((r||i)&&this.type===c.colon&&this.unexpected(),this.eat(c.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,a),e.kind="init";else if(this.options.ecmaVersion>=6&&this.type===c.parenL)t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(r,i);else if(!t&&!o&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==c.comma&&this.type!==c.braceR&&this.type!==c.eq){(r||i)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var u=e.kind==="get"?0:1;if(e.value.params.length!==u){var l=e.value.start;e.kind==="get"?this.raiseRecoverable(l,"getter should have no params"):this.raiseRecoverable(l,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")}else this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((r||i)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=s),e.kind="init",t?e.value=this.parseMaybeDefault(s,n,this.copyNode(e.key)):this.type===c.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),e.value=this.parseMaybeDefault(s,n,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected()};N.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(c.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(c.bracketR),e.key;e.computed=!1}return e.key=this.type===c.num||this.type===c.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};N.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)};N.parseMethod=function(e,t,r){var i=this.startNode(),s=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(i),this.options.ecmaVersion>=6&&(i.generator=e),this.options.ecmaVersion>=8&&(i.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(qi(t,i.generator)|$i|(r?Ks:0)),this.expect(c.parenL),i.params=this.parseBindingList(c.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(i,!1,!0,!1),this.yieldPos=s,this.awaitPos=n,this.awaitIdentPos=a,this.finishNode(i,"FunctionExpression")};N.parseArrowExpression=function(e,t,r,i){var s=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.enterScope(qi(r,!1)|Qs),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!r),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,i),this.yieldPos=s,this.awaitPos=n,this.awaitIdentPos=a,this.finishNode(e,"ArrowFunctionExpression")};N.parseFunctionBody=function(e,t,r,i){var s=t&&this.type!==c.braceL,n=this.strict,a=!1;if(s)e.body=this.parseMaybeAssign(i),e.expression=!0,this.checkParams(e,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!n||o)&&(a=this.strictDirective(this.end),a&&o&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var u=this.labels;this.labels=[],a&&(this.strict=!0),this.checkParams(e,!n&&!a&&!t&&!r&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,Ys),e.body=this.parseBlock(!1,void 0,a&&!n),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=u}this.exitScope()};N.isSimpleParamList=function(e){for(var t=0,r=e;t<r.length;t+=1){var i=r[t];if(i.type!=="Identifier")return!1}return!0};N.checkParams=function(e,t){for(var r=Object.create(null),i=0,s=e.params;i<s.length;i+=1){var n=s[i];this.checkLValInnerPattern(n,Wi,t?null:r)}};N.parseExprList=function(e,t,r,i){for(var s=[],n=!0;!this.eat(e);){if(n)n=!1;else if(this.expect(c.comma),t&&this.afterTrailingComma(e))break;var a=void 0;r&&this.type===c.comma?a=null:this.type===c.ellipsis?(a=this.parseSpread(i),i&&this.type===c.comma&&i.trailingComma<0&&(i.trailingComma=this.start)):a=this.parseMaybeAssign(!1,i),s.push(a)}return s};N.checkUnreserved=function(e){var t=e.start,r=e.end,i=e.name;if(this.inGenerator&&i==="yield"&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&i==="await"&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),this.currentThisScope().inClassFieldInit&&i==="arguments"&&this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(i==="arguments"||i==="await")&&this.raise(t,"Cannot use "+i+" in class static initialization block"),this.keywords.test(i)&&this.raise(t,"Unexpected keyword '"+i+"'"),!(this.options.ecmaVersion<6&&this.input.slice(t,r).indexOf("\\")!==-1)){var s=this.strict?this.reservedWordsStrict:this.reservedWords;s.test(i)&&(!this.inAsync&&i==="await"&&this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+i+"' is reserved"))}};N.parseIdent=function(e,t){var r=this.startNode();return this.type===c.name?r.name=this.value:this.type.keyword?(r.name=this.type.keyword,(r.name==="class"||r.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop()):this.unexpected(),this.next(!!e),this.finishNode(r,"Identifier"),e||(this.checkUnreserved(r),r.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=r.start)),r};N.parsePrivateIdent=function(){var e=this.startNode();return this.type===c.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,"PrivateIdentifier"),this.privateNameStack.length===0?this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(e),e};N.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===c.semi||this.canInsertSemicolon()||this.type!==c.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(c.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")};N.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,"AwaitExpression")};var zr=G.prototype;zr.raise=function(e,t){var r=Hs(this.input,e);t+=" ("+r.line+":"+r.column+")";var i=new SyntaxError(t);throw i.pos=e,i.loc=r,i.raisedAt=this.pos,i};zr.raiseRecoverable=zr.raise;zr.curPosition=function(){if(this.options.locations)return new Xt(this.curLine,this.pos-this.lineStart)};var rt=G.prototype,Ba=function(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[],this.inClassFieldInit=!1};rt.enterScope=function(e){this.scopeStack.push(new Ba(e))};rt.exitScope=function(){this.scopeStack.pop()};rt.treatFunctionsAsVarInScope=function(e){return e.flags&Lt||!this.inModule&&e.flags&Yt};rt.declareName=function(e,t,r){var i=!1;if(t===De){var s=this.currentScope();i=s.lexical.indexOf(e)>-1||s.functions.indexOf(e)>-1||s.var.indexOf(e)>-1,s.lexical.push(e),this.inModule&&s.flags&Yt&&delete this.undefinedExports[e]}else if(t===Xs){var n=this.currentScope();n.lexical.push(e)}else if(t===Js){var a=this.currentScope();this.treatFunctionsAsVar?i=a.lexical.indexOf(e)>-1:i=a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var u=this.scopeStack[o];if(u.lexical.indexOf(e)>-1&&!(u.flags&Gs&&u.lexical[0]===e)||!this.treatFunctionsAsVarInScope(u)&&u.functions.indexOf(e)>-1){i=!0;break}if(u.var.push(e),this.inModule&&u.flags&Yt&&delete this.undefinedExports[e],u.flags&Ui)break}i&&this.raiseRecoverable(r,"Identifier '"+e+"' has already been declared")};rt.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)};rt.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};rt.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&Ui)return t}};rt.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&Ui&&!(t.flags&Qs))return t}};var Kr=function(t,r,i){this.type="",this.start=r,this.end=0,t.options.locations&&(this.loc=new Qr(t,i)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[r,0])},tr=G.prototype;tr.startNode=function(){return new Kr(this,this.start,this.startLoc)};tr.startNodeAt=function(e,t){return new Kr(this,e,t)};function tn(e,t,r,i){return e.type=t,e.end=r,this.options.locations&&(e.loc.end=i),this.options.ranges&&(e.range[1]=r),e}tr.finishNode=function(e,t){return tn.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)};tr.finishNodeAt=function(e,t,r,i){return tn.call(this,e,t,r,i)};tr.copyNode=function(e){var t=new Kr(this,e.start,this.startLoc);for(var r in e)t[r]=e[r];return t};var rn="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",sn=rn+" Extended_Pictographic",nn=sn,an=nn+" EBase EComp EMod EPres ExtPict",$a=an,Ua={9:rn,10:sn,11:nn,12:an,13:$a},Vs="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",on="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",un=on+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",ln=un+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",cn=ln+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",qa=cn+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Wa={9:on,10:un,11:ln,12:cn,13:qa},hn={};function Ha(e){var t=hn[e]={binary:yt(Ua[e]+" "+Vs),nonBinary:{General_Category:yt(Vs),Script:yt(Wa[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(qr=0,Fi=[9,10,11,12,13];qr<Fi.length;qr+=1)js=Fi[qr],Ha(js);var js,qr,Fi,A=G.prototype,je=function(t){this.parser=t,this.validFlags="gim"+(t.options.ecmaVersion>=6?"uy":"")+(t.options.ecmaVersion>=9?"s":"")+(t.options.ecmaVersion>=13?"d":""),this.unicodeProperties=hn[t.options.ecmaVersion>=13?13:t.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=[]};je.prototype.reset=function(t,r,i){var s=i.indexOf("u")!==-1;this.start=t|0,this.source=r+"",this.flags=i,this.switchU=s&&this.parser.options.ecmaVersion>=6,this.switchN=s&&this.parser.options.ecmaVersion>=9};je.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)};je.prototype.at=function(t,r){r===void 0&&(r=!1);var i=this.source,s=i.length;if(t>=s)return-1;var n=i.charCodeAt(t);if(!(r||this.switchU)||n<=55295||n>=57344||t+1>=s)return n;var a=i.charCodeAt(t+1);return a>=56320&&a<=57343?(n<<10)+a-56613888:n};je.prototype.nextIndex=function(t,r){r===void 0&&(r=!1);var i=this.source,s=i.length;if(t>=s)return s;var n=i.charCodeAt(t),a;return!(r||this.switchU)||n<=55295||n>=57344||t+1>=s||(a=i.charCodeAt(t+1))<56320||a>57343?t+1:t+2};je.prototype.current=function(t){return t===void 0&&(t=!1),this.at(this.pos,t)};je.prototype.lookahead=function(t){return t===void 0&&(t=!1),this.at(this.nextIndex(this.pos,t),t)};je.prototype.advance=function(t){t===void 0&&(t=!1),this.pos=this.nextIndex(this.pos,t)};je.prototype.eat=function(t,r){return r===void 0&&(r=!1),this.current(r)===t?(this.advance(r),!0):!1};A.validateRegExpFlags=function(e){for(var t=e.validFlags,r=e.flags,i=0;i<r.length;i++){var s=r.charAt(i);t.indexOf(s)===-1&&this.raise(e.start,"Invalid regular expression flag"),r.indexOf(s,i+1)>-1&&this.raise(e.start,"Duplicate regular expression flag")}};A.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))};A.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,r=e.backReferenceNames;t<r.length;t+=1){var i=r[t];e.groupNames.indexOf(i)===-1&&e.raise("Invalid named capture referenced")}};A.regexp_disjunction=function(e){for(this.regexp_alternative(e);e.eat(124);)this.regexp_alternative(e);this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")};A.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););};A.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1};A.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var r=!1;if(this.options.ecmaVersion>=9&&(r=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!r,!0}return e.pos=t,!1};A.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1};A.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)};A.regexp_eatBracedQuantifier=function(e,t){var r=e.pos;if(e.eat(123)){var i=0,s=-1;if(this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(s=e.lastIntValue),e.eat(125)))return s!==-1&&s<i&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=r}return!1};A.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)};A.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1};A.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)&&e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}e.pos=t}return!1};A.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1};A.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};A.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1};A.regexp_eatSyntaxCharacter=function(e){var t=e.current();return fn(t)?(e.lastIntValue=t,e.advance(),!0):!1};function fn(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}A.regexp_eatPatternCharacters=function(e){for(var t=e.pos,r=0;(r=e.current())!==-1&&!fn(r);)e.advance();return e.pos!==t};A.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),!0):!1};A.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e)){e.groupNames.indexOf(e.lastStringValue)!==-1&&e.raise("Duplicate capture group name"),e.groupNames.push(e.lastStringValue);return}e.raise("Invalid group")}};A.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1};A.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=tt(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=tt(e.lastIntValue);return!0}return!1};A.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,r=this.options.ecmaVersion>=11,i=e.current(r);return e.advance(r),i===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,r)&&(i=e.lastIntValue),za(i)?(e.lastIntValue=i,!0):(e.pos=t,!1)};function za(e){return Ve(e,!0)||e===36||e===95}A.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,r=this.options.ecmaVersion>=11,i=e.current(r);return e.advance(r),i===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,r)&&(i=e.lastIntValue),Qa(i)?(e.lastIntValue=i,!0):(e.pos=t,!1)};function Qa(e){return Nt(e,!0)||e===36||e===95||e===8204||e===8205}A.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)};A.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var r=e.lastIntValue;if(e.switchU)return r>e.maxBackReference&&(e.maxBackReference=r),!0;if(r<=e.numCapturingParens)return!0;e.pos=t}return!1};A.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1};A.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};A.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1};A.regexp_eatZero=function(e){return e.current()===48&&!Jr(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1};A.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114?(e.lastIntValue=13,e.advance(),!0):!1};A.regexp_eatControlLetter=function(e){var t=e.current();return pn(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function pn(e){return e>=65&&e<=90||e>=97&&e<=122}A.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var r=e.pos,i=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(i&&s>=55296&&s<=56319){var n=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var a=e.lastIntValue;if(a>=56320&&a<=57343)return e.lastIntValue=(s-55296)*1024+(a-56320)+65536,!0}e.pos=n,e.lastIntValue=s}return!0}if(i&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&Ga(e.lastIntValue))return!0;i&&e.raise("Invalid unicode escape"),e.pos=r}return!1};function Ga(e){return e>=0&&e<=1114111}A.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),!0):!1};A.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};A.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(Ka(t))return e.lastIntValue=-1,e.advance(),!0;if(e.switchU&&this.options.ecmaVersion>=9&&(t===80||t===112)){if(e.lastIntValue=-1,e.advance(),e.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(e)&&e.eat(125))return!0;e.raise("Invalid property name")}return!1};function Ka(e){return e===100||e===68||e===115||e===83||e===119||e===87}A.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var r=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,r,i),!0}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var s=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,s),!0}return!1};A.regexp_validateUnicodePropertyNameAndValue=function(e,t,r){Zt(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(r)||e.raise("Invalid property value")};A.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name")};A.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";mn(t=e.current());)e.lastStringValue+=tt(t),e.advance();return e.lastStringValue!==""};function mn(e){return pn(e)||e===95}A.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";Ja(t=e.current());)e.lastStringValue+=tt(t),e.advance();return e.lastStringValue!==""};function Ja(e){return mn(e)||Jr(e)}A.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};A.regexp_eatCharacterClass=function(e){if(e.eat(91)){if(e.eat(94),this.regexp_classRanges(e),e.eat(93))return!0;e.raise("Unterminated character class")}return!1};A.regexp_classRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var r=e.lastIntValue;e.switchU&&(t===-1||r===-1)&&e.raise("Invalid character class"),t!==-1&&r!==-1&&t>r&&e.raise("Range out of order in character class")}}};A.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var r=e.current();(r===99||xn(r))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var i=e.current();return i!==93?(e.lastIntValue=i,e.advance(),!0):!1};A.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};A.regexp_eatClassControlLetter=function(e){var t=e.current();return Jr(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1};A.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1};A.regexp_eatDecimalDigits=function(e){var t=e.pos,r=0;for(e.lastIntValue=0;Jr(r=e.current());)e.lastIntValue=10*e.lastIntValue+(r-48),e.advance();return e.pos!==t};function Jr(e){return e>=48&&e<=57}A.regexp_eatHexDigits=function(e){var t=e.pos,r=0;for(e.lastIntValue=0;dn(r=e.current());)e.lastIntValue=16*e.lastIntValue+gn(r),e.advance();return e.pos!==t};function dn(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function gn(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}A.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var r=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+r*8+e.lastIntValue:e.lastIntValue=t*8+r}else e.lastIntValue=t;return!0}return!1};A.regexp_eatOctalDigit=function(e){var t=e.current();return xn(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function xn(e){return e>=48&&e<=55}A.regexp_eatFixedHexDigits=function(e,t){var r=e.pos;e.lastIntValue=0;for(var i=0;i<t;++i){var s=e.current();if(!dn(s))return e.pos=r,!1;e.lastIntValue=16*e.lastIntValue+gn(s),e.advance()}return!0};var zi=function(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new Qr(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end])},R=G.prototype;R.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new zi(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};R.getToken=function(){return this.next(),new zi(this)};typeof Symbol<"u"&&(R[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===c.eof,value:t}}}});R.nextToken=function(){var e=this.curContext();if((!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(c.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())};R.readToken=function(e){return Ve(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};R.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888};R.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,r=this.input.indexOf("*/",this.pos+=2);if(r===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=r+2,this.options.locations)for(var i=void 0,s=t;(i=Us(this.input,s,this.pos))>-1;)++this.curLine,s=this.lineStart=i;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,r),t,this.pos,e,this.curPosition())};R.skipLineComment=function(e){for(var t=this.pos,r=this.options.onComment&&this.curPosition(),i=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!Rt(i);)i=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,r,this.curPosition())};R.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(e>8&&e<14||e>=5760&&qs.test(String.fromCharCode(e)))++this.pos;else break e}}};R.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var r=this.type;this.type=e,this.value=t,this.updateContext(r)};R.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(c.ellipsis)):(++this.pos,this.finishToken(c.dot))};R.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(c.assign,2):this.finishOp(c.slash,1)};R.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),r=1,i=e===42?c.star:c.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++r,i=c.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(c.assign,r+1):this.finishOp(i,r)};R.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12){var r=this.input.charCodeAt(this.pos+2);if(r===61)return this.finishOp(c.assign,3)}return this.finishOp(e===124?c.logicalOR:c.logicalAND,2)}return t===61?this.finishOp(c.assign,2):this.finishOp(e===124?c.bitwiseOR:c.bitwiseAND,1)};R.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(c.assign,2):this.finishOp(c.bitwiseXOR,1)};R.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||ye.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(c.incDec,2):t===61?this.finishOp(c.assign,2):this.finishOp(c.plusMin,1)};R.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),r=1;return t===e?(r=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+r)===61?this.finishOp(c.assign,r+1):this.finishOp(c.bitShift,r)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(r=2),this.finishOp(c.relational,r))};R.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(c.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(c.arrow)):this.finishOp(e===61?c.eq:c.prefix,1)};R.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var r=this.input.charCodeAt(this.pos+2);if(r<48||r>57)return this.finishOp(c.questionDot,2)}if(t===63){if(e>=12){var i=this.input.charCodeAt(this.pos+2);if(i===61)return this.finishOp(c.assign,3)}return this.finishOp(c.coalesce,2)}}return this.finishOp(c.question,1)};R.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),Ve(t,!0)||t===92))return this.finishToken(c.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+tt(t)+"'")};R.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(c.parenL);case 41:return++this.pos,this.finishToken(c.parenR);case 59:return++this.pos,this.finishToken(c.semi);case 44:return++this.pos,this.finishToken(c.comma);case 91:return++this.pos,this.finishToken(c.bracketL);case 93:return++this.pos,this.finishToken(c.bracketR);case 123:return++this.pos,this.finishToken(c.braceL);case 125:return++this.pos,this.finishToken(c.braceR);case 58:return++this.pos,this.finishToken(c.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(c.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===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(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(c.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+tt(e)+"'")};R.finishOp=function(e,t){var r=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,r)};R.readRegexp=function(){for(var e,t,r=this.pos;;){this.pos>=this.input.length&&this.raise(r,"Unterminated regular expression");var i=this.input.charAt(this.pos);if(ye.test(i)&&this.raise(r,"Unterminated regular expression"),e)e=!1;else{if(i==="[")t=!0;else if(i==="]"&&t)t=!1;else if(i==="/"&&!t)break;e=i==="\\"}++this.pos}var s=this.input.slice(r,this.pos);++this.pos;var n=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(n);var o=this.regexpState||(this.regexpState=new je(this));o.reset(r,s,a),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var u=null;try{u=new RegExp(s,a)}catch{}return this.finishToken(c.regexp,{pattern:s,flags:a,value:u})};R.readInt=function(e,t,r){for(var i=this.options.ecmaVersion>=12&&t===void 0,s=r&&this.input.charCodeAt(this.pos)===48,n=this.pos,a=0,o=0,u=0,l=t??1/0;u<l;++u,++this.pos){var h=this.input.charCodeAt(this.pos),f=void 0;if(i&&h===95){s&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),o===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),u===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),o=h;continue}if(h>=97?f=h-97+10:h>=65?f=h-65+10:h>=48&&h<=57?f=h-48:f=1/0,f>=e)break;o=h,a=a*e+f}return i&&o===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===n||t!=null&&this.pos-n!==t?null:a};function Xa(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function yn(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}R.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var r=this.readInt(e);return r==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(r=yn(this.input.slice(t,this.pos)),++this.pos):Ve(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(c.num,r)};R.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,"Invalid number");var r=this.pos-t>=2&&this.input.charCodeAt(t)===48;r&&this.strict&&this.raise(t,"Invalid number");var i=this.input.charCodeAt(this.pos);if(!r&&!e&&this.options.ecmaVersion>=11&&i===110){var s=yn(this.input.slice(t,this.pos));return++this.pos,Ve(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(c.num,s)}r&&/[89]/.test(this.input.slice(t,this.pos))&&(r=!1),i===46&&!r&&(++this.pos,this.readInt(10),i=this.input.charCodeAt(this.pos)),(i===69||i===101)&&!r&&(i=this.input.charCodeAt(++this.pos),(i===43||i===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,"Invalid number")),Ve(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var n=Xa(this.input.slice(t,this.pos),r);return this.finishToken(c.num,n)};R.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var r=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(r,"Code point out of bounds")}else t=this.readHexChar(4);return t};R.readString=function(e){for(var t="",r=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var i=this.input.charCodeAt(this.pos);if(i===e)break;i===92?(t+=this.input.slice(r,this.pos),t+=this.readEscapedChar(!1),r=this.pos):i===8232||i===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(Rt(i)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(r,this.pos++),this.finishToken(c.string,t)};var bn={};R.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===bn)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};R.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw bn;this.raise(e,t)};R.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var r=this.input.charCodeAt(this.pos);if(r===96||r===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===c.template||this.type===c.invalidTemplate)?r===36?(this.pos+=2,this.finishToken(c.dollarBraceL)):(++this.pos,this.finishToken(c.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(c.template,e));if(r===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(Rt(r)){switch(e+=this.input.slice(t,this.pos),++this.pos,r){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
14
+ `;break;default:e+=String.fromCharCode(r);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}};R.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(c.invalidTemplate,this.input.slice(this.start,this.pos))}this.raise(this.start,"Unterminated template")};R.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
15
+ `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return tt(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var r=this.pos-1;return this.invalidStringToken(r,"Invalid escape sequence in template string"),null}default:if(t>=48&&t<=55){var i=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],s=parseInt(i,8);return s>255&&(i=i.slice(0,-1),s=parseInt(i,8)),this.pos+=i.length-1,t=this.input.charCodeAt(this.pos),(i!=="0"||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-i.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(s)}return Rt(t)?"":String.fromCharCode(t)}};R.readHexChar=function(e){var t=this.pos,r=this.readInt(16,e);return r===null&&this.invalidStringToken(t,"Bad character escape sequence"),r};R.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,r=this.pos,i=this.options.ecmaVersion>=6;this.pos<this.input.length;){var s=this.fullCharCodeAtPos();if(Nt(s,i))this.pos+=s<=65535?1:2;else if(s===92){this.containsEsc=!0,e+=this.input.slice(r,this.pos);var n=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var a=this.readCodePoint();(t?Ve:Nt)(a,i)||this.invalidStringToken(n,"Invalid Unicode escape"),e+=tt(a),r=this.pos}else break;t=!1}return e+this.input.slice(r,this.pos)};R.readWord=function(){var e=this.readWord1(),t=c.name;return this.keywords.test(e)&&(t=ji[e]),this.finishToken(t,e)};var Ya="8.7.1";G.acorn={Parser:G,version:Ya,defaultOptions:Di,Position:Xt,SourceLocation:Qr,getLineInfo:Hs,Node:Kr,TokenType:M,tokTypes:c,keywordTypes:ji,TokContext:Ee,tokContexts:q,isIdentifierChar:Nt,isIdentifierStart:Ve,Token:zi,isNewLine:Rt,lineBreak:ye,lineBreakG:Oa,nonASCIIwhitespace:qs};var Ti=G.extend(function(e){let t=!1,r=!1,i=!1;return class extends e{parseFunction(s,n,a,o,u){return this.type.label==="**"&&(s.isSubscriptFunction=!0,this.next()),super.parseFunction(s,n,a,o,u)}isClassElementNameStart(){return this.type.label==="**"&&(t=!0,this.next()),super.isClassElementNameStart()}isAsyncProp(s){return this.type.label==="**"&&(t=!0,this.next()),super.isAsyncProp(s)}eat(s){return(i&&s.label===":"||(i||r)&&s.label==="*")&&this.type.label==="**"?(t=!0,this.next(),!1):super.eat(s)}parseProperty(s,n){i=!0;let a=super.parseProperty(s,n);return i=!1,t&&(a.value.isSubscriptFunction=!0,t=!1),a}parseClassElement(s){r=!0;let n=super.parseClassElement(s);return r=!1,t&&(n.value.isSubscriptFunction=!0,t=!1),n}}});var wn=e=>class extends Ni(e){static get subscriptParams(){return{globalsAutoObserve:["document"]}}static expose(t,r){let i=y(t,"oohtml","subscript","instances"),s=r.name;return s||(s=[...i.keys()].filter(n=>$(n)).length),i.set(s,r),r}static implementMethod(t,r){let i=super.implementMethod(t,r);return this.expose(r,i)}static implementScript(t,r){let i=(t.textContent||"").trim();return this.expose(r,U.call(r,i,{compilerParams:this.compilerParams,runtimeParams:this.runtimeParams}))}static doConnectedCallback(t){if(typeof WebQit>"u"||!WebQit.Observer)return;let r=y(t,"oohtml","subscript","instances"),i=(s,n,a=[])=>{r.forEach(o=>o.thread(...s.map(u=>a.concat(u.path))))};(this.subscriptParams.globalsAutoObserve||[]).forEach(s=>{WebQit.Observer.observe(globalThis[s],n=>i(n,null,[s]),{subtree:!0,diff:!0,tags:[t,"subscript-element",s],unique:!0})}),WebQit.Observer.observe(t,s=>i(s,null,["this"]),{subtree:!0,diff:!0,tags:[t,"subscript-element","this"],unique:!0})}static doDisconnectedCallback(t){typeof WebQit>"u"||!WebQit.Observer||((this.subscriptParams.globalsAutoObserve||[]).forEach(r=>{WebQit.Observer.unobserve(globalThis[r],null,null,{subtree:!0,tags:[t,"subscript-element",r]})}),WebQit.Observer.unobserve(t,null,null,{subtree:!0,tags:[t,"subscript-element","this"]}))}connectedCallback(){this.constructor.doConnectedCallback(this),super.connectedCallback&&super.connectedCallback()}disconnectedCallback(){this.constructor.doDisconnectedCallback(this),super.disconnectedCallback&&super.disconnectedCallback()}get subscript(){return y(this,"oohtml","subscript","instances")}};function Xr(e={}){let t=ae.call(this);if(e.onDomReady){t.DOM.ready(()=>{Xr.call(this,{...e,onDomReady:!1})});return}let r=t.DOM.mutations,i=Ae.call(this,{selectors:{script:'script[type="subscript"]'},api:{bind:"bind",unbind:"unbind"},script:{}},e.params),s=a=>class extends wn(a){static get compilerParams(){return e.compilerParams||{}}static get runtimeParams(){return e.runtimeParams||{}}},n=s();r.onPresent(i.get("selectors.script"),a=>{let o=a.parentNode;if(!o)return;let u=y(o,"oohtml","subscript").get("script-tags");if(u||(u=new WeakSet,y(o,"oohtml","subscript").set("script-tags",u)),u.has(a))return;n.implementScript(a,o)(),n.doConnectedCallback(o),u.add(a);let l=r.onRemoved(o,()=>{n.doDisconnectedCallback(o),u.delete(a),l.disconnect()},{ignoreTransients:!0})}),t.OOHTML||(t.OOHTML={}),t.OOHTML.SubscriptElement=s}function Yr(e={}){let t=ae.call(this);t.OOHTML||(t.OOHTML={},t.Observer=P,Dr.call(this,e.HTMLModules||{}),Vr.call(this,e.HTMLImports||{}),jr.call(this,e.NamespacedHTML||{}),Br.call(this,e.StateAPI||{}),Xr.call(this,e.Subscript||{}))}Yr.call(window);var Zi={};ts(Zi,{start:()=>Qo});var rr=class{constructor(t,r=null){Object.defineProperty(this,"dict",{value:Object.create(t)});for(let i in this.dict)i in this||(this[i]=this.dict[i]);arguments.length>1&&Object.defineProperty(this.dict,"CWD",{get:()=>r})}get name(){return"webflo"}static create(...t){return new this(...t)}get CWD(){return this.dict.CWD||""}get meta(){return this.dict.meta||{}}get app(){return this.dict.app||{}}get config(){return this.dict.config||{}}get flags(){return this.dict.flags||{}}set flags(t){this.dict.flags=t}get layout(){return this.dict.layout||{}}set layout(t){this.dict.layout=t}get logger(){return this.dict.logger}set logger(t){this.dict.logger=t}};var ir=class extends rr{};typeof URLPattern>"u"&&await Promise.resolve().then(()=>(Dn(),Mn));function Vn(e,t,r,i=!1){if(W(t)&&t.endsWith("]")){var s=Qe(xi(t,"["),"]")||0;return $(s)&&(s=parseInt(s)),t=Qe(t,"[")||0,$(t)&&(t=parseInt(t)),Vn(e,t,(n,a)=>{if(!n[a]){if(!i)return r();n[a]=$(s)?[]:{}}return r(n[a],s)},i)}else return r(e,t)}function ar(e,t,r,i=!0){Vn(e,t,(s,n)=>{$(n)?(n=n||S(s)?s.length:Object.keys(s).filter($).length,O(r,!1).forEach((a,o)=>{s[n+o]=a})):s[n]=i&&n in s?O(s[n],!1).concat(r):r},!0)}function Be(e,t={},r="&"){return e=e||"",(e.startsWith("?")?e.substr(1):e).split(r).filter(i=>i).map(i=>i.split("=").map(s=>s.trim())).forEach(i=>ar(t,i[0],decodeURIComponent(i[1]))),t}function Zr(e,t,r,i=null){if((E(t)||S(t))&&(!i||i(t,e))){var s=S(t);Object.keys(t).forEach(n=>{Zr(`${e}[${n}]`,t[n],r,i)})}else r(e,!t&&t!==0?"":t)}function nt(e,t="&",r=null){var i=[];return Object.keys(e).forEach(s=>{Zr(s,e[s],(n,a)=>{i.push(`${n}=${encodeURIComponent(a)}`)},r)}),i.join(t)}var jn={join(){for(var e=[],t=0,r=0,i=arguments.length;r<i;r++)e=e.concat(arguments[r].split("/"));var s=[];for(r=0,i=e.length;r<i;r++){var n=e[r];!n||n==="."||(n===".."?s.length?s.pop():t++:s.push(n))}return e[0]===""&&s.unshift(""),"../".repeat(t)+s.join("/")||(s.length?"/":".")},dirname(e){return this.join(e,"..")}};var or=class{constructor(t,r){this.cx=t,this.path=S(r)?r:(r+"").split("/").filter(i=>i)}async route(t,r,i,s,n=null){let a=this,o=async function(u){let l={};if(!u.trail||u.trail.length<u.destination.length){if(u=await a.readTick(u),l.pathname=`/${u.trail.join("/")}`,l.stepname=u.trail[u.trail.length-1],a.finalizeHandlerContext(l,u),u.exports){u.exports.hints&&await r.port.post({...u.exports.hints,$type:"handler:hints"});let h=O(u.method),f=T(u.exports)&&h.includes("default")?u.exports:h.reduce((m,p)=>m||u.exports[p.toLowerCase()],null);if(f){let m=async(...x)=>{let b={...u,arg:x[0]};if(x.length>1){var d=x[1],w,v={...x[2]||{}};if(x[1]instanceof b.event.Request)w=x[1],d=w.url;else if(!W(d))throw new Error("Router redirect url must be a string!");var _=d.startsWith("/")?d:a.pathJoin(`/${u.trail.join("/")}`,d);if(_.startsWith("../"))throw new Error("Router redirect cannot traverse beyond the routing directory! ("+d+" >> "+_+")");v.method&&(b.method=v.method,S(v.method)&&(v.method=v.method[0])),w?b.event=u.event.retarget(w,{...v,_proxy:{url:_}}):b.event=u.event.retarget(_,v),b.source=u.destination.join("/"),b.destination=_.split("?").shift().split("/").map(C=>C.trim()).filter(C=>C),b.trail=x[1].startsWith("/")?[]:u.trail.reduce((C,F,D)=>C.length===D&&F===b.destination[D]?C.concat(F):C,[]),b.trailOnFile=u.trailOnFile.slice(0,b.trail.length)}return o(b)},p=u.destination.slice(u.trail.length);return m.pathname=p.join("/"),m.stepname=p[0],await f.call(l,u.event,u.arg,m,n)}return o(u)}else if((u.currentSegmentOnFile||{}).dirExists)return o(u)}if(s)return await s.call(l,u.event,u.arg,n)};return o({destination:this.path,event:r,method:t,arg:i})}};var Dt=class extends or{async readTick(t){var r=this.cx.layout,i=Object.keys(this.cx.layout);return t.trail?(t.currentSegment=t.destination[t.trail.length],t.currentSegmentOnFile=[t.currentSegment,"-"].reduce((s,n)=>{if(s.index)return s;var a=`/${t.trailOnFile.concat(n).join("/")}`;return r[a]?{seg:n,index:a}:i.filter(o=>o.startsWith(`${a}/`)).length?{seg:n,dirExists:!0}:s},{seg:null}),t.trail.push(t.currentSegment),t.trailOnFile.push(t.currentSegmentOnFile.seg),t.exports=r[t.currentSegmentOnFile.index]):(t.trail=[],t.trailOnFile=[],t.currentSegmentOnFile={index:"/"},t.exports=r["/"]),t}finalizeHandlerContext(t,r){return t.dirname=r.currentSegmentOnFile.index}pathJoin(...t){return jn.join(...t)}};var ur=class{constructor(t){this.cx=t}async handle(t,r){let i=new Dt(this.cx,t.url.pathname),s=async()=>{let n=t.request.method.toLowerCase();return i.route([n==="delete"?"del":n,"default"],t,{},async a=>r(a.request),r)};return await(this.cx.middlewares||[]).concat(s).reverse().reduce((n,a)=>()=>a.call(this.cx,t,i,n),null)()}async render(t,r){let i=await r.json();return new Dt(this.cx,t.url.pathname).route("render",t,i,async(n,a)=>(window.WebQit.DOM&&await new Promise(o=>window.WebQit.DOM.ready(o)),window.document.state&&(window.document.state.env||window.document.setState({env:"client",onHydration:(n.detail||{}).srcType==="init",network:this.cx.runtime.network,url:this.cx.runtime.location},{update:!0}),window.document.setState({data:a},{update:"merge"})),window.document.templates&&(window.document.body.setAttribute("template","routes/"+n.url.pathname.split("/").filter(o=>o).map(o=>o+"+-").join("/")),await new Promise(o=>(window.document.templatesReadyState==="complete"&&o(),window.document.addEventListener("templatesreadystatechange",o)))),await this.scrollIntoView(n),window))}async unrender(t){window.document.state&&window.document.setState({data:{}},{update:"merge"})}async scrollIntoView(t){if(!(t.detail.src instanceof Element))return;await new Promise(s=>setTimeout(s,10));let r,i;t.url.hash&&(i=document.querySelector(t.url.hash))?i.scrollIntoView():(r=Array.from(document.querySelectorAll("[data-viewport-top]")).pop())?r.focus():document.body.scrollIntoView()}};function Bn(e=null,t=!1){let r=t?"localStorage":"sessionStorage";if(!window[r])throw new Error(`The specified Web Storage API ${r} is invalid or not supported`);let i={};return P.intercept(i,(s,n,a)=>{let o=e?`${e}.${s.name}`:s.name;if(s.type==="get"&&W(o)){let h=window[r].getItem(o);return ee(h)?h:JSON.parse(h)}if(s.type==="set")return window[r].setItem(o,ee(s.value)?s.value:JSON.stringify(s.value)),!0;if(s.type==="deleteProperty")return window[r].removeItem(o),!0;if(s.type==="has"){for(var u=0;u<window[r].length;u++)if(window[r].key(u)===o)return!0;return!1}if(s.type==="ownKeys"){for(var l=[],u=0;u<window[r].length;u++)l.push(window[r].key(u));return l}return s.type==="getOwnPropertyDescriptor"?{enumerable:!0,configurable:!0}:a()}),P.proxy(i)}var Ne=class{constructor(t){let r=this.constructor;var i=(s,n)=>E(s)&&E(n)?i(Object.keys(s),Object.keys(n))&&i(Object.values(s),Object.values(n)):S(s)&&S(n)?s.length===n.length&&s.reduce((a,o,u)=>a&&o===n[u],!0):s===n;P.intercept(this,"set",(s,n,a)=>s.name==="hash"&&s.value&&!s.value.startsWith("#")?a("#"+s.value):s.name==="search"&&s.value&&!s.value.startsWith("?")?a("?"+s.value):a()),P.observe(this,s=>{var n={},a;for(var o of s){if(o.name==="href"&&o.related.length===1){var n=r.parseUrl(o.value);delete n.query,delete n.href,a=!0}if(o.name==="query"&&(o.path.length>1||!o.related.includes("search"))){var u=r.toSearch(this.query);u!==this.search&&(n.search=u)}if(o.name==="search"){var l=r.toQuery(n.search||this.search);i(l,this.query)||(n.query=l)}}if(!a){var h=this.origin,f=[this.username,this.password].filter(p=>p);f.length===2&&(h=`${this.protocol}//${f.join(":")}@${this.hostname}${this.port?`:${this.port}`:""}`);var m=[h,n.pathname||this.pathname,n.search||this.search,this.hash].join("");m!==this.href&&(n.href=m)}if(!Re(n))return P.set(this,n)},{subtree:!0,diff:!0}),P.observe(this,s=>{s.forEach(n=>{if(n&&n.detail){if(!k(n.detail))throw new Error('"e.detail" can only be of type object.');if(n.detail.request&&!E(n.detail.request))throw new Error('"e.detail.request" can only be of type object.')}})},{diff:!0}),P.set(this,W(t)?r.parseUrl(t):Ne.copy(t))}toString(){return this.href}static from(t){return new this(E(t)?t:this.parseUrl(t))}static copy(t){var r=Po.reduce((i,s)=>gi(i,s,t[s]),{});return"query"in t||delete r.query,r}static parseUrl(t){var r=document.createElement("a");return r.href=t,this.copy(r)}static toQuery(t){return Be(t)}static toSearch(t){var r=nt(t);return r?"?"+r:""}},Po=["protocol","username","password","host","hostname","port","origin","pathname","search","query","hash","href"];var{URL:ei,fetch:$n,Headers:Gi,Request:Un,Response:qn,FormData:Wn,ReadableStream:Oo,File:Y1,Blob:Ki}=globalThis;var To=e=>{let t=class extends e{constructor(...r){super(...r);var i=Be(this.search);let s=n=>{var a=nt(n);a=a?"?"+a:"",a!==this.search&&(this.search=a)};this.__query={value:i,proxy:new Proxy(i,{set(n,a,o){return n[a]=o,s(n),!0},deleteProperty(n,a){return delete n[a],s(n),!0}})}}set search(r){super.search=r;var i=Be(r);Ji(i,this.query)||(this.query=i)}get search(){return super.search}get query(){return this.__query.proxy}};return t.Observable=class extends t{constructor(){super(...arguments);let{Observer:r}=WebQit;r.accessorize(this,["protocol","username","password","host","hostname","port","origin","pathname","search","query","hash","href"])}},t},Ji=(e,t)=>E(e)&&E(t)?Ji(Object.keys(e),Object.keys(t))&&Ji(Object.values(e),Object.values(t)):S(e)&&S(t)?e.length===t.length&&e.reduce((r,i,s)=>r&&i===t[s],!0):e===t,Hn=To;var No=e=>class extends e{tee(t=null){let r=new this.constructor,i=new this.constructor;for(var[s,n]of this.entries()){let a=a(n);t&&t(n,s,a)||!t&&!a?r.append(s,n):i.append(s,n)}return[r,i]}json(t={},r=null){if(arguments.length){Object.keys(t).forEach(a=>{Zr(a,t[a],(o,u)=>{(!r||r(o,u,k(u)))&&this.append(o,u)},o=>!Xi(o))});return}var i;for(var[s,n]of this.entries())i||(i=$(We(s,"["))?[]:{}),ar(i,s,n);return i}},zn=No,Xi=(e,t=null)=>{if(!k(e))return;let r=e[Symbol.toStringTag];return(t||["Uint8Array","Uint16Array","Uint32Array","ArrayBuffer","Blob","File","FormData","Stream"]).reduce((i,s)=>i||(r===s?s:null),null)};var Ro=e=>class extends e{constructor(t={}){t instanceof e?super(t):(super(),this.json(t))}json(t={},r=!0){if(arguments.length){let a=Qn(this),o=Object.keys(a).reduce((u,l)=>u.concat(typeof l!="symbol"&&"set"in a[l]?l:[]),[]);Object.keys(t).forEach(u=>{var l=o.reduce((h,f)=>h||(f===u||f.toLocaleLowerCase()===u?f:null),null);l?(r||this[l]===void 0)&&(this[l]=t[u]):(r||!this.has(u))&&this.set(u,t[u])});return}let i={};for(var[s,n]of this)i[s]=n;return i}set cacheControl(t){return this.set("Cache-Control",t)}get cacheControl(){return this.get("Cache-Control")}set contentLength(t){return this.set("Content-Length",t)}get contentLength(){return this.get("Content-Length")}set contentType(t){return this.set("Content-Type",t)}get contentType(){return this.get("Content-Type")}},ti=Ro;function Qn(e){if(e){let t=Object.getPrototypeOf(e);return t===Object.prototype?{}:{...Qn(t),...Object.getOwnPropertyDescriptors(e)}}else return Object.create(null)}var Lo=e=>class extends ti(e){set accept(t){return this.set("Accept",t)}get accept(){let t=this.get("Accept"),r=t&&t.split(",").map(i=>(i=i.trim().split(";").map(s=>s.trim()),[i.shift(),parseFloat((i.pop()||"1").replace("q=",""))])).sort((i,s)=>i[1]>s[1]?-1:1)||[];return{match(i){return i=(i+"").split("/"),r.reduce((s,n)=>s||(n=n[0].split("/"))&&[0,1].every(a=>i[a]===n[a]||i[a]==="*"||n[a]==="*"),!1)},toString(){return t}}}set cookies(t){if(!E(t))throw new Error(`Cookies must be of type object. Received type: ${H(t)}.`);return this.set("Cookie",nt(t,";")),this._cookies=null,!0}get cookies(){return this._cookies||(this._cookies=Be(this.get("cookie"),{},";")),this._cookies}set range(t){let r=[];return O(t).forEach((i,s)=>{let n=Array.isArray(i)?i.join("-"):i+"";s===0&&!n.includes("bytes=")&&(n=`bytes=${n}`),r.push(n)}),this.set("Range",r.join(", "))}get range(){let t=this.get("Range");return t?ke(t,"bytes=").split(",").map(i=>{let s=i.trim().split("-");return s[0]=s[0]?parseInt(s[0],10):void 0,s[1]&&(s[1]=parseInt(s[1],10)),s.clamp=n=>{(s[1]>n-1||s[1]===void 0)&&(s[1]=n-1),s[0]===void 0&&(s[0]=s[1]?n-s[1]-1:0)},s}):void 0}set cors(t){return this.set("Access-Control-Allow-Origin",t===!0?"*":t===!1?"":t)}get cors(){return this.get("Access-Control-Allow-Origin")}},Gn=Lo;var Fo=e=>class extends ti(e){set cookies(t){if(!E(t))throw new Error(`The "cookies" response directive cannot be of type: ${H(t)}`);for(let r in t){let i=t[r];if(E(i)){let s=[i.value];for(let n in i){if(n==="value")continue;let a=n[0].toUpperCase()+n.substring(1);a==="MaxAge"&&(a="Max-Age"),s.push(i[n]===!0?a:`${a}=${i[n]}`)}i=s.join("; ")}this.append("Set-Cookie",`${r}=${i}`)}return!0}get cookies(){let t=this.get("Set-Cookie");return t&&t.split(",").reduce((r,i)=>{let[s,n]=i.split(";"),[a,o]=s.trim().split("=");return r[a]={value:o},n&&(n||"").split(/\;/g).map(u=>u.trim().split("=")).forEach(u=>{r[a][u[0][0].toLowerCase()+u[0].substring(1).replace("-","")]=u.length===1?!0:u[1]}),r},{})}set contentRange(t){if(Array.isArray(t)){if(t.length===2&&!t[0].includes("-")||t.length<2)throw new Error("A Content-Range array must be in the format: [ 'start-end', 'total' ]");return this.set("Content-Range",`bytes ${t.join("/")}`)}return this.set("Content-Range",t)}get contentRange(){let t=this.get("Content-Range");return t&&ke(t,"bytes ").split("/")}set cors(t){return this.set("Access-Control-Allow-Origin",t===!0?"*":t===!1?"":t)}get cors(){return this.get("Access-Control-Allow-Origin")}set attachment(t){if(t=t===!0?"attachment":t===!1?"inline":t,!W(t))throw new Error(`The "download" response directive does not support the type: ${H(t)}`);return["attachment","inline"].includes(t)||(t=`attachment; filename="${t}"`),this.set("Content-Disposition",t)}get attachment(){var t=(this.get("Content-Disposition")||"").trim();return t=t==="attachment"?!0:t==="inline"?!1:ke(Qe(t,'"'),'filename="'),t}get location(){return this.get("Location")}set location(t){return this.set("Location",t)}get redirect(){return this.get("Location")}set redirect(t){return this.set("Location",t)}},Kn=Fo;var Mo=(e,t,r)=>{let i=class extends e{constructor(s,n,a){"headers"in n&&!(n.headers instanceof t)&&(n={...n},n.headers=new t(n.headers),arguments[1]=n),Re(n)?super(s):super(s,n),this._headers=n.headers,a.headers&&this.headers.json(a.headers);let o={};Object.defineProperty(this,"attrs",{get:()=>o}),Object.defineProperty(this,"bodyAttrs",{get:()=>a})}clone(){return new this.constructor(super.clone())}get headers(){return this._headers||(this._headers=new t(super.headers)),this._headers}get attrs(){return this.attrs}get url(){return"url"in this.attrs?this.attrs.url:super.url}async arrayBuffer(){return this.bodyAttrs.arrayBuffer?this.bodyAttrs.arrayBuffer:super.arrayBuffer()}async blob(){return this.bodyAttrs.blob?this.bodyAttrs.blob:super.blob()}async formData(){if(this.bodyAttrs.formData)return this.bodyAttrs.formData;let s=await super.formData();return s.tee=r.prototype.tee.bind(s),s.json=r.prototype.json.bind(s),s}async json(){return this.bodyAttrs.json?this.bodyAttrs.json:super.json()}async text(){return this.bodyAttrs.text?this.bodyAttrs.text:super.text()}jsonfy(s=!1){return(!this.bodyAttrs.jsonfied||s)&&(this.bodyAttrs.jsonfied=new Promise(async(n,a)=>{var o=this,u,l=o.headers.get("content-type")||"",h=l==="application/json"||this.bodyAttrs.json?"json":l==="application/x-www-form-urlencoded"||l.startsWith("multipart/form-data")||this.bodyAttrs.formData?"formData":l==="text/plain"?"plain":"other";try{h==="formData"?u=(await o.formData()).json():u=h==="json"?await o.json():h==="plain"?await o.text():o.body,n(u)}catch(f){a(f)}})),this.bodyAttrs.jsonfied}};return i.Headers=t,i},ri=Mo;function ii(e,t,r){let i={body:e,input:e},s=(o,u)=>{if(!t.encode)return;let[l,h]=t.encode(u);o.body=l,o.headers=h};if(W(e)||we(e))return i.inputType="text",i.text=e,i.headers={contentLength:(e+"").length},i;if(i.inputType=Xi(e),["Blob","File"].includes(i.inputType))i.blob=e,i.headers={contentType:e.type,contentLength:e.size};else if(["Uint8Array","Uint16Array","Uint32Array","ArrayBuffer"].includes(i.inputType))i.arrayBuffer=e,i.headers={contentLength:e.byteLength};else if(i.inputType==="FormData")i.formData=e,s(i,e);else if(E(e)&&bt(e)||S(e)&&ni(e)){i.inputType="object";var n,a=new t;a.json(e,(o,u,l)=>(n=n||l,!0)),n?(i.formData=a,s(i,a)):(i.json=e,i.body=JSON.stringify(e),i.headers={contentType:"application/json",contentLength:new r([i.body]).size}),i.jsonfied=e}return i}var Do=(e,t,r,i)=>class extends ri(e,t,r){constructor(s,n={}){n={...n};let a={};s instanceof e&&(n.method&&s.method!==n.method.toUpperCase()&&["GET","HEAD"].includes(n.method.toUpperCase())?(s=s.url,["headers","mode","credentials","cache","redirect","referrer","integrity"].forEach(u=>{u in n||(n[u]=s[u])})):a=s.bodyAttrs||{}),"body"in n&&(a=ii(n.body,r,i),n.body=a.body);let o;n.mode==="navigate"&&(o=!0,n={...n},delete n.mode),super(s,n,a),o&&(this.attrs.mode="navigate")}get mode(){return"mode"in this.attrs?this.attrs.mode:super.mode}get cache(){return"cache"in this.attrs?this.attrs.cache:super.cache}get destination(){return"destination"in this.attrs?this.attrs.destination:super.destination}get referrer(){return"referrer"in this.attrs?this.attrs.referrer:super.referrer}static compat(s,n=null){return s instanceof e?Object.setPrototypeOf(s,new this):new this(n,s)}},Jn=Do;var Vo=(e,t,r,i)=>class extends ri(e,t,r){constructor(s=null,n={}){let a={},o;arguments.length&&(s instanceof e?(o=s,n={status:s.status,statusText:s.statusText,headers:s.headers,...n},s.status===0&&delete n.status,a=s.bodyAttrs||{},s=s.body):(a=ii(s,r,i),s=a.body)),super(s,n,a),o&&(this.attrs.url=o.url,this.attrs.ok=o.ok,this.attrs.status=o.status,this.attrs.type=o.type,this.attrs.redirected=o.redirected)}get ok(){return"ok"in this.attrs?this.attrs.ok:super.ok}get status(){return"status"in this.attrs?this.attrs.status:super.status}get statusText(){return"statusText"in this.attrs?this.attrs.statusText:super.statusText}get type(){return"type"in this.attrs?this.attrs.type:super.type}get redirected(){return"redirected"in this.attrs?this.attrs.redirected:super.redirected}static compat(s){return s instanceof e?Object.setPrototypeOf(s,new this):new this(s)}},Xn=Vo;var jo=e=>e,Yn=jo;var Bo=(e,t,r)=>{let i=class{constructor(s,n,a){this._request=s,this._detail=n||{},this._sessionFactory=a,this.Request=e,this.Response=t,this.URL=r,this.port={listeners:[],post(o){let u=this.listeners.map(l=>l(o)).filter(l=>l instanceof Promise);if(process.length)return Promise.all(u)},listen(o){this.listeners.push(o)}}}get url(){return this._url||(this._url=new this.URL(this._request.url)),this._url}get request(){return this._request}get detail(){return this._detail}get session(){return this._session||(this._session=this.sessionFactory().get()),this._session}sessionFactory(...s){return this._sessionFactory(...s)}retarget(s,n={}){var a;return s instanceof e?Re(n)?a=s:a=new e(s,n):(a=new e(this._request,n),a.attrs.url=`${this.url.origin}${s}`,a.attrs.referrer=this.request.url),new i(a,this.detail)}};return i},Zn=Bo;var lr=class{constructor(t,r={}){this.ready=navigator.serviceWorker.ready,this.registration=new Promise((s,n)=>{let a=()=>{navigator.serviceWorker.register(t,{scope:r.scope||"/"}).then(async o=>{let u=h=>{let f=h.state==="installed"?"waiting":h.state==="activating"||h.state==="activated"?"active":h.state;P.set(this,f,h)},l=o.active||o.waiting||o.installing;u(l),l.addEventListener("statechange",h=>u(h.target)),o.addEventListener("updatefound",()=>{u(o.installing),o.installing.addEventListener("statechange",h=>u(h.target))}),s(o)}).catch(o=>n(o))};r.onWondowLoad?window.addEventListener("load",a):a(),r.startMessages&&navigator.serviceWorker.startMessages()});let i=(s,n,a=1)=>{if(this.active)T(s)&&(s=s()),n(this.active,s);else if(a){let o=u=>{T(s)&&(s=s()),n(u.value,s),a!==2&&P.unobserve(this,"active",o)};P.observe(this,"active",o)}};this.messaging={post:(s,n=1)=>(i(s,(a,o)=>{a.postMessage(o)},n),this.post),listen:s=>(navigator.serviceWorker.addEventListener("message",s),this.post),request:(s,n=1)=>new Promise(a=>{i(s,(o,u)=>{let l=new MessageChannel;o.postMessage(u,[l.port2]),l.port1.onmessage=h=>a(h.data)},n)}),channel(s){this.channels.has(s)||this.channels.set(s,new BroadcastChannel(n));let n=this.channels.get(s);return{broadcast:a=>n.postMessage(a),listen:a=>n.addEventListener("message",a)}},channels:new Map},this.notifications={fire:(s,n={})=>new Promise((a,o)=>{if(typeof Notification>"u"||Notification.permission!=="granted")return o(typeof Notification<"u"&&Notification&&Notification.permission);u.addEventListener("error",o);let u=new Notification(s,n);u.addEventListener("click",a),u.addEventListener("close",a)})},this.push={getSubscription:async()=>(await this.registration).pushManager.getSubscription(),subscribe:async(s,n={})=>{var a=await this.push.getSubscription();return a||(await this.registration).pushManager.subscribe(E(s)?s:{applicationServerKey:$o(s),...n})},unsubscribe:async()=>{var s=await this.push.getSubscription();return s?s.unsubscribe():null}}}};function $o(e){for(var t="=".repeat((4-e.length%4)%4),r=(e+t).replace(/\-/g,"+").replace(/_/g,"/"),i=window.atob(r),s=new Uint8Array(i.length),n=0;n<i.length;++n)s[n]=i.charCodeAt(n);return s}var Uo=Hn(ei),Yi=zn(Wn);var qo=Gn(Gi),Wo=Kn(Gi),ea=Jn(Un,qo,Yi,Ki),Vt=Xn(qn,Wo,Yi,Ki),Ho=Yn($n),zo=Zn(ea,Vt,Uo);var cr=class{constructor(t,r){this.cx=t,this.clients=new Map,this.cx.runtime=this;let i=r(this.cx,"*");if(!i||!i.handle)throw new Error('Application instance must define a ".handle()" method.');if(this.clients.set("*",i),P.set(this,"location",new Ne(window.document.location)),P.observe(this.location,[["href"]],([s])=>{if(!(s.value==="http:"||(s.detail||{}).src===window.document.location))if(s.value===window.document.location.href||s.value+"/"===window.document.location.href)window.history.replaceState(window.history.state,"",this.location.href);else try{window.history.pushState(window.history.state,"",this.location.href)}catch{}},{diff:!0}),window.addEventListener("popstate",s=>{window.setTimeout(()=>{this.go(Ne.copy(window.document.location),{},{src:window.document.location,srcType:"history"})},0)}),window.addEventListener("click",s=>{var n=s.target.closest("a");!n||!n.href||!n.target&&!n.download&&this.isSpaRoute(n,s)&&(this.go(Ne.copy(n),{},{src:n,srcType:"link"}),n.href.includes("#")||s.preventDefault())}),window.addEventListener("submit",s=>{var n=s.target.closest("form"),a=s.submitter,o=["action","enctype","method","noValidate","target"].reduce((f,m)=>(f[m]=a&&a.hasAttribute(`form${m.toLowerCase()}`)?a[`form${yr(m)}`]:n[m],f),{});o.method=a&&a.dataset.method||n.dataset.method||o.method,o.submitter=a;var u=window.document.createElement("a");if(u.href=o.action,!o.target&&this.isSpaRoute(u,s)){var l=new Yi(n);if((a||{}).name&&l.set(a.name,a.value),o.method.toUpperCase()==="GET"){var h=Be(u.search);Array.from(l.entries()).forEach(f=>{ar(h,f[0],f[1],!1)}),u.search=nt(h),l=null}this.go(Ne.copy(u),{method:o.method,body:l},{...o,src:n,srcType:"form"}),u.hash||s.preventDefault()}}),P.set(this,"network",{}),window.addEventListener("online",()=>P.set(this.network,"online",navigator.onLine)),window.addEventListener("offline",()=>P.set(this.network,"online",navigator.onLine)),this.cx.service_worker_support){let s=new lr(this.cx.worker_filename,{scope:this.cx.worker_scope,startMessages:!0});P.set(this,"workport",s),s.messaging.listen(async n=>{let a=n.ports[0],o=this.clients.get("*"),u=o.alert&&await o.alert(n);a&&(u instanceof Promise?u.then(l=>{a.postMessage(l)}):a.postMessage(u))})}this.go(this.location,{},{srcType:"init"})}get history(){return window.history}isSpaRoute(t,r){if(t=typeof t=="string"?new ei(t):t,t.origin&&t.origin!==this.location.origin||r&&(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey))return!1;if(!this.cx.params.routing)return!0;if(this.cx.params.routing.targets===!1)return!1;let i=t.pathname.split("/").filter(n=>n),s=n=>(n=n.split("/").filter(a=>a),n.reduce((a,o,u)=>a&&(o===i[u]||[o,i[u]].includes("-")),!0));return s(this.cx.params.routing.root)&&this.cx.params.routing.subroots.reduce((n,a)=>n&&!s(a),!0)}generateRequest(t,r){return new ea(t,{signal:this._abortController.signal,...r,headers:{Accept:"application/json","X-Redirect-Policy":"manual-when-cross-spa","X-Redirect-Code":this._xRedirectCode,"X-Powered-By":"@webqit/webflo",...r.headers||{}}})}getSession(t,r=null,i=!1){return Bn(r,i)}async go(t,r={},i={}){if(t=typeof t=="string"?new ei(t):t,r={referrer:this.location.href,...r},i.srcType!=="init"&&We(t.href,"#")===We(r.referrer,"#")&&(r.method||"GET").toUpperCase()==="GET")return new Vt(null,{status:304});this._abortController&&this._abortController.abort(),this._abortController=new AbortController,this._xRedirectCode=200,P.set(this.network,"error",null),P.set(this.network,"requesting",{...r,...i}),["link","form"].includes(i.srcType)&&(i.src.state&&(i.src.state.active=!0),i.submitter&&i.submitter.state&&(i.submitter.state.active=!0));let s=this.generateRequest(t.href,r),n=new zo(s,i,(l=null,h=!1)=>this.getSession(n,l,h)),a=this.clients.get("*"),o,u;try{o=await a.handle(n,(...l)=>this.remoteFetch(...l)),u=this.handleResponse(n,o),o.redirected?P.set(this.location,{href:o.url},{detail:{redirected:!0}}):[302,301].includes(u.status)||P.set(this.location,t),P.set(this.network,"requesting",null),["link","form"].includes(i.srcType)&&(i.src.state&&(i.src.state.active=!1),i.submitter&&i.submitter.state&&(i.submitter.state.active=!1)),u.ok&&u.headers.contentType==="application/json"?a.render&&await a.render(n,u):u.ok||([404,500].includes(u.status)&&P.set(this.network,"error",new Error(u.statusText,{cause:u.status})),a.unrender&&await a.unrender(n))}catch(l){console.error(l),P.set(this.network,"error",{...l,retry:()=>this.go(t,r={},i)}),u=new Vt(null,{status:500,statusText:l.message})}return u}remoteFetch(t,...r){let i=typeof t=="string"?t:t.url||t.href;P.set(this.network,"remote",i);let s=Ho(t,...r);return s.catch(n=>P.set(this.network,"error",n)),s.then(async n=>(P.set(this.network,"remote",null),new Vt(n)))}handleResponse(t,r){if(r instanceof Vt||(r=new Vt(r)),!r.redirected){let i=r.headers.get("Location");i&&r.status===this._xRedirectCode&&(r.attrs.status=parseInt(r.headers.get("X-Redirect-Code")),P.set(this.network,"redirecting",i),window.location=i)}return r}};async function Qo(e=null){let t=this||{},r=i=>new ur(i);return new cr(ir.create(t),(...i)=>e?e(...i.concat(r)):r(...i))}globalThis.WebQit||(globalThis.WebQit={});WebQit.Webflo=Zi;