@webqit/oohtml 1.10.3 → 2.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 (53) hide show
  1. package/.gitignore +3 -3
  2. package/LICENSE +20 -20
  3. package/README.md +399 -396
  4. package/dist/context-api.js +2 -0
  5. package/dist/context-api.js.map +7 -0
  6. package/dist/html-imports.js +1 -2
  7. package/dist/html-imports.js.map +3 -3
  8. package/dist/html-modules.js +1 -2
  9. package/dist/html-modules.js.map +3 -3
  10. package/dist/main.js +26 -14
  11. package/dist/main.js.map +3 -3
  12. package/dist/namespaced-html.js +1 -2
  13. package/dist/namespaced-html.js.map +3 -3
  14. package/dist/scoped-js.js +27 -0
  15. package/dist/scoped-js.js.map +7 -0
  16. package/dist/state-api.js +1 -2
  17. package/dist/state-api.js.map +3 -3
  18. package/package.json +76 -76
  19. package/src/context-api/HTMLContext.js +158 -0
  20. package/src/context-api/HTMLContextManager.js +77 -0
  21. package/src/context-api/_ContextRequestEvent.js +26 -0
  22. package/src/context-api/index.js +53 -0
  23. package/src/{namespaced-html/browser-entry.js → context-api/targets.browser.js} +9 -9
  24. package/src/html-imports/_HTMLImportElement.js +216 -0
  25. package/src/html-imports/index.js +92 -557
  26. package/src/{browser-entry.js → html-imports/targets.browser.js} +10 -10
  27. package/src/html-modules/HTMLExportsManager.js +191 -0
  28. package/src/html-modules/_HTMLImportsContext.js +114 -0
  29. package/src/html-modules/index.js +133 -384
  30. package/src/{html-imports/browser-entry.js → html-modules/targets.browser.js} +9 -9
  31. package/src/index.js +34 -39
  32. package/src/namespaced-html/index.js +130 -144
  33. package/src/namespaced-html/targets.browser.js +10 -0
  34. package/src/scoped-js/index.js +382 -0
  35. package/src/scoped-js/targets.browser.js +10 -0
  36. package/src/state-api/index.js +55 -142
  37. package/src/state-api/targets.browser.js +10 -0
  38. package/src/{html-modules/browser-entry.js → targets.browser.js} +10 -10
  39. package/src/util.js +20 -180
  40. package/test/imports.test.js +194 -0
  41. package/test/index.js +119 -0
  42. package/test/modules.test.js +198 -0
  43. package/test/namespaced-html.test.js +50 -0
  44. package/test/scoped-js.js +57 -0
  45. package/test/state-api.test.js +34 -0
  46. package/test/test.html +69 -0
  47. package/dist/subscript.js +0 -15
  48. package/dist/subscript.js.map +0 -7
  49. package/src/state-api/browser-entry.js +0 -10
  50. package/src/subscript/Element.js +0 -103
  51. package/src/subscript/browser-entry.js +0 -10
  52. package/src/subscript/index.js +0 -70
  53. package/test/all.test.js +0 -0
package/dist/subscript.js DELETED
@@ -1,15 +0,0 @@
1
- (()=>{function A(e){return!Array.isArray(e)&&typeof e=="object"&&e}function ee(e,...t){globalThis.WebQitInternalsRegistry||(globalThis.WebQitInternalsRegistry=new Map);var i=globalThis.WebQitInternalsRegistry.get(e);if(!i){if(i=new Map,t[0]===!1)return i;globalThis.WebQitInternalsRegistry.set(e,i)}for(var r,s;r=t.shift();)if((s=i)&&!(i=i.get(r))){if(i=new Map,t[0]===!1)return i;s.set(r,i)}return i}function w(e){return Array.isArray(e)}function Be(e){return e===!0||e===!1}function Pe(e){return typeof e=="function"}function Xe(e){return e===null||e===""}function te(e){return arguments.length&&(e===void 0||typeof e>"u")}function L(e){return Array.isArray(e)||typeof e=="object"&&e||Pe(e)}function bt(e){return Xe(e)||te(e)||e===!1||e===0||L(e)&&!Object.keys(e).length}function N(e){return Pe(e)||e&&{}.toString.call(e)==="[object function]"}function be(e){return e instanceof Number||typeof e=="number"}function q(e){return be(e)||e!==!0&&e!==!1&&e!==null&&e!==""&&!isNaN(e*1)}function Ze(e){return A(e)&&Object.getPrototypeOf(e)===Object.prototype}function ve(e){return e instanceof String||typeof e=="string"&&e!==null}function vt(e){return!ve(e)&&!te(e.length)}function pe(e,t=1){var i=0;e.forEach(s=>{i++});var r=e.slice(e.length-i,t);return arguments.length>1?r:r[0]}function G(e,t=1){return arguments.length>1?pe(e.slice().reverse(),t).reverse():pe(e.slice().reverse())}function et(e,...t){return t.forEach(i=>{e.indexOf(i)<0&&e.push(i)}),e}function wt(r,t){t=t||Object.prototype,t=t&&!w(t)?[t]:t;for(var i=[],r=r;r&&(!t||t.indexOf(r)<0)&&r.name!=="default";)i.push(r),r=r?Object.getPrototypeOf(r):null;return i}function St(e,t){var i=[];return wt(e,t).forEach(r=>{et(i,...Object.getOwnPropertyNames(r))}),i}function K(e,t,i=!1,r=!1,s=!1){var n=0,a=e.shift();if((q(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((u,l)=>{!L(u)&&!N(u)||(i?St(u):Object.getOwnPropertyNames(u)).forEach(h=>{if(!!t(h,a,u,l)){var c=a[h],p=u[h];if((w(c)&&w(p)||A(c)&&A(p))&&(n===!0||n>0))a[h]=w(c)&&w(p)?[]:{},K([q(n)?n-1:n,a[h],c,p],t,i,r,s);else if(w(a)&&w(u))r?a[h]=p:a.push(p);else try{s?Object.defineProperty(a,h,Object.getOwnPropertyDescriptor(u,h)):a[h]=u[h]}catch{}}})}),a}function qe(e,t){var i=void 0;return L(e)&&Object.keys(e).forEach((r,s)=>{i!==!1&&(i=t(q(r)?parseFloat(r):r,e[r],s))}),i}function me(...e){return K(e,(t,i,r)=>!0,!1,!1,!1)}function J(e){return!Array.isArray(e)&&typeof e=="object"&&e}function ti(e){var t=typeof e.InstallTrigger<"u";if(t)return"firefox";var i=/constructor/i.test(e.HTMLElement)||function(h){return h.toString()==="[object SafariRemoteNotification]"}(!e.safari||typeof e.safari<"u"&&e.safari.pushNotification);if(i)return"safari";var r=!!e.chrome&&(!!e.chrome.webstore||!!e.chrome.runtime),s=r&&e.navigator.userAgent.indexOf("Edg")!=-1,n=!!e.opr&&!!e.opr.addons||!!e.opera||e.navigator.userAgent.indexOf(" OPR/")>=0,a=!!e.document.documentMode,u=!a&&!!e.StyleMedia,l=(r||n)&&!!e.CSS;return u?"edge":a?"ie":n?"opera":s?"ie-chromium":r?"chrome":"unknown"}function ii(e){var t=e.getComputedStyle(e.document.documentElement,""),i=(Array.prototype.slice.call(t).join("").match(/-(moz|webkit|ms)-/)||t.Olink===""&&["","o"])[1],r=("WebKit|Moz|Ms|O".match(new RegExp("("+i+")","i"))||[])[1];return{api:r,prefix:i,css:"-"+i+"-"}}function oe(){if(!(J(this)&&this.window)&&typeof window>"u")throw new Error("A window context is required.");let e=J(this)&&this.window?this.window:window;if(e.WebQit||(e.WebQit={}),!e.WebQit.window){let t,i;Object.defineProperty(e.WebQit,"window",{get:()=>e}),Object.defineProperty(e.WebQit,"vendor",{value:{getName:()=>(t||(t=ti(e)),t),getPrefix:()=>(i||(i=ii(e)),i)}})}return e.WebQit}function tt(e){return typeof e=="function"}function $(e){return Array.isArray(e)||typeof e=="object"&&e||tt(e)}function ri(e){return e instanceof Number||typeof e=="number"}function we(e){return ri(e)||e!==!0&&e!==!1&&e!==null&&e!==""&&!isNaN(e*1)}var $e=class{constructor(t,i=!0){this.window=t,this.async=i,this.readCallbacks=[],this.writeCallbacks=[],this._run()}_run(){this.window.requestAnimationFrame(()=>{this.readCallbacks.forEach((t,i)=>{t&&!t()&&(this.readCallbacks[i]=null)}),this.writeCallbacks.forEach((t,i)=>{t&&!t()&&(this.writeCallbacks[i]=null)}),this._run()})}onread(t,i=!1){if(i)return new Promise((r,s)=>{this.async===!1?t(r,s):this.readCallbacks.push(()=>{t(r,s)})});this.async===!1?t():this.readCallbacks.push(t)}onwrite(t,i=!1){if(i)return new Promise((r,s)=>{this.async===!1?t(r,s):this.writeCallbacks.push(()=>{t(r,s)})});this.async===!1?t():this.writeCallbacks.push(t)}cycle(t,i,r){this.onread(()=>{var s=t(r);if(s){var n=a=>{this.onwrite(()=>{var u=i(a,r);if(u){var l=h=>{this.cycle(t,i,h)};u instanceof Promise?u.then(l):l()}})};s instanceof Promise?s.then(n):n()}})}};function ue(e){return e instanceof String||typeof e=="string"&&e!==null}function Se(e){return Array.isArray(e)}function Ne(e){return arguments.length&&(e===void 0||typeof e>"u")}function si(e){return!ue(e)&&!Ne(e.length)}function it(e){return e===null||e===""}function ni(e){return it(e)||Ne(e)||e===!1||e===0||$(e)&&!Object.keys(e).length}function F(e,t=!0){return Se(e)?e:!t&&J(e)?[e]:e!==!1&&e!==0&&ni(e)?[]:si(e)?Array.prototype.slice.call(e):J(e)?Object.values(e):[e]}function Ue(e){let t=oe.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(i=>i(t.window))},!1)),t.window.domReadyCallbacks.push(e))}var je=class{constructor(t){this.window=t}onAdded(t,i,r={}){return r.on="added",this.onPresenceChange(t,(s,n,a,u,l)=>{i(s,n,a,u,l)},r)}onRemoved(t,i,r={}){return r.on="removed",this.onPresenceChange(t,(s,n,a,u,l)=>{i(s,n,a,u,l)},r)}onPresent(t,i,r={}){Ue.call(this.window,()=>{this.window.MutationObserver&&this.onAdded(t,(s,n)=>{s.forEach(a=>i(a,n))},r),ue(t)?F(this.window.document.querySelectorAll(t)).forEach(s=>i(s,1)):t.parentNode&&i(t,1)})}onAbsent(t,i,r={}){Ue.call(this.window,()=>{this.window.MutationObserver&&onRemoved(t,(s,n)=>{s.forEach(a=>i(a,n))},r),ue(t)?F(this.window.document.querySelectorAll(t)).length===0&&i(null,0):t.parentNode||i(t,0)})}onPresenceChange(t,i,r={}){t=F(t,!1);var s=(p,m)=>{if(m=m.filter(x=>x.matches),ue(p)){var d=m.filter(x=>x.matches(p));if(r.observeIndirectMutation!==!1&&(d=m.reduce((x,y)=>x.concat(F(y.querySelectorAll(p))),d),d.length))return d}else{if(m.includes(p))return[p];if(r.observeIndirectMutation!==!1&&m.length){for(var g=p;g=g.parentNode;)if(m.includes(g))return[p]}}},n=(p,m)=>(m.$$searchCache||(m.$$searchCache=new Map),p.reduce((d,g)=>{var x;return m.$$searchCache.has(g)?x=m.$$searchCache.get(g):(x=s(g,m,ue(g))||[],m.$$searchCache.set(g,x)),d.concat(x)},[])),a=new Set,u=new Set,l=(p,m,d)=>{m&&r.on==="removed"||!m&&r.on==="added"||(p=n(t,p)).length&&(r.maintainCallState?(p.forEach(g=>{m?(a.add(g),u.delete(g)):(a.delete(g),u.add(g))}),i(p,m,d,a,u)):i(p,m,d))},h=r.context||this.window.document.documentElement,c=this._observe(h,(p,m,d,g)=>{r.ignoreTransients||(l(p,0,!0),l(p.concat(m),1,!0),l(m,0,!0)),l(g,0),l(d,1)});return c}onAttrChange(t,i,r=[]){var s=new this.window.MutationObserver(i),n={attributes:!0,attributeOldValue:!0};return r&&(n.attributeFilter=r),s.observe(t,n),s}onTreeChange(t,i,r=!1){var s=new this.window.MutationObserver(i),n={childList:!0,subtree:r};return s.observe(t,n),s}onMutation(t,i,r){var s=new this.window.MutationObserver(i);return s.observe(t,r),s}_observe(t,i){if(!_t.has(t)){let s=new Set,n=new this.window.MutationObserver(a=>{if(!!s.size){var u=a.reduce((p,m)=>p.concat(F(m.addedNodes)),[]),l=a.reduce((p,m)=>p.concat(F(m.removedNodes)),[]),h=[],c=[];u=new Set(u),l=new Set(l),u.forEach(p=>{l.has(p)&&(l.delete(p),u.delete(p),p.isConnected?h.push(p):c.push(p))}),u=[...u],l=[...l],s.forEach(p=>p(h,c,u,l))}});n.observe(t,{childList:!0,subtree:!0}),_t.set(t,{callbacks:s,observer:n})}let r=_t.get(t);return r.callbacks.add(i),{disconnect(){r.callbacks.delete(i)},reconnect(){r.callbacks.add(i)}}}},_t=new Map;function ai(e){hr(e),cr(e),fr(e)}function hr(e){e.CSS||(e.CSS={}),e.CSS.escape||(e.CSS.escape=t=>t.replace(/([\:@\~\$\&])/g,"\\$1"))}function cr(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 fr(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 i=(this.document||this.ownerDocument).querySelectorAll(t),r=i.length;--r>=0&&i.item(r)!==this;);return r>-1})}function rt(e,t=null,i=!1){let r=oe.call(this);if(ue(e)){var s;if(e.trim().startsWith("<")){var n=r.window.document.createElement("div");n.innerHTML=e,s=i?F(n.children):n.firstChild}else s=i?F(ui.call(this,e,t)):Ct.call(this,e,t);return s}return e instanceof r.window.Element?i?[e]:e:i?F(e):e}function oi(e,t=null){return rt.call(this,e,t,!0)}function Ct(e,t=null,i=!1){let r=oe.call(this);t=t||r.window.document;var s,n=i?"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(h){throw h}}}}return s}function ui(e,t=null){return Ct.call(this,e,t,!0)}function _e(e){return tt(e)||e&&{}.toString.call(e)==="[object function]"}function de(e,t,i={},r={}){t=F(t).slice();for(var s=e;!Ne(s)&&!it(s)&&t.length;){var n=t.shift();if(!(i.get?i.get(s,n):$(s)?n in s:s[n])){r.exists=!1;return}s=i.get?i.get(s,n):s[n]}return r.exists=!0,s}function st(e,t,i,r={},s={}){let n=(c,p,m)=>s.set?s.set(c,p,m):(we(t[u])&&Se(c)?c.push(m):c[p]=m,!0);t=F(t);for(var a=e,u=0;u<t.length;u++)if(u<t.length-1){if(!a||!$(a)&&!_e(a))return!1;var l=de(a,t[u],s);if(!$(l)){if(s.buildTree===!1)return!1;l=_e(s.buildTree)?s.buildTree(u):we(t[u+1])?[]:{};var h=n(a,t[u],l);if(!h)return!1}a=l}else return n(a,t[u],i)}function li(e,t,i=!1,r={}){t=F(t);var s=!1;do{var n=t.pop(),n=n===""?0:n,a=e;t.length&&(a=de(e,t,{},r)),($(a)||_e(a))&&(r.has?r.has(a,n):n in a)&&(r.deleteProperty?s=r.deleteProperty(a,n):r.del?s=r.del(a,n):(delete a[n],s=!0))}while(s&&i&&t.length&&($(a)||_e(a))&&!(r.keys?r.keys(a):Object.keys(a)).length);return s}function Et(e,t,i={}){var r={};return de(e,t,i,r),r.exists}function kt(e,t=!1){let i=oe.call(this);var r={};return!(r.el=i.window.document.head.querySelector('meta[name="oohtml"]'))&&t&&(r.el=i.window.document.createElement("meta"),r.el.setAttribute("name",e),i.window.document.head.append(r.el)),r.el&&(r.vars=(r.el.getAttribute("content")||"").split(";").filter(s=>s).reduce((s,n)=>{var a=n.split("=").map(u=>u.trim());return st(s,a[0].split("."),a[1]==="true"?!0:a[1]==="false"?!1:we(a[1])?parseInt(a[1]):a[1]),s},{})),r.get=function(s){return de(this.vars,s.split("."))},r.set=function(s,n=null,a=!1){var u=J(s)?s:{[s]:n===!0?"true":n};if(a=arguments.length<3?n:a,Object.keys(u).forEach(l=>{if(u[l]===!1)li(this.vars,l.split("."));else if(J(u[l]))Object.keys(u[l]).forEach(c=>{var p=(l+"."+c).split(".");(!a||!Et(this.vars,p))&&st(this.vars,p,u[l][c])});else{var h=l.split(".");(!a||!Et(this.vars,h))&&st(this.vars,h,u[l])}}),t){let l=(h,c)=>Object.keys(c).reduce((p,m)=>{var d=(h?h+".":"")+m;return J(c[m])?p.push(...l(d,c[m])):p.push(d+"="+c[m]),p},[]);this.el.setAttribute("content",l("",this.vars).join(";"))}return!0},r.defaults=function(s,n=null){return this.set(s,n,!0)},r}function nt(){let e=oe.call(this);return e.DOM||(e.DOM={},ai(e.window),e.DOM.reflow=new $e(e.window),e.DOM.mutations=new je(e.window),e.DOM.meta=kt.bind(e.window),e.DOM.query=rt.bind(e.window),e.DOM.queryAll=oi.bind(e.window),e.DOM.ready=Ue.bind(e.window)),e}var{stringify:pr}=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 at={"||":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},Y=17,mr={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:Y,ClassExpression:Y,FunctionExpression:Y,ObjectExpression:Y,UpdateExpression:16,UnaryExpression:15,AwaitExpression:15,BinaryExpression:14,LogicalExpression:13,ConditionalExpression:4,AssignmentExpression:3,YieldExpression:2,RestElement:1};function Oe(e,t){let{generator:i}=e;if(e.write("("),t!=null&&t.length>0){i[t[0].type](t[0],e);let{length:r}=t;for(let s=1;s<r;s++){let n=t[s];e.write(", "),i[n.type](n,e)}}e.write(")")}function gi(e,t,i,r){let s=e.expressionsPrecedence[t.type];if(s===Y)return!0;let n=e.expressionsPrecedence[i.type];return s!==n?!r&&s===15&&n===14&&i.operator==="**"||s<n:s!==13&&s!==14?!1:t.operator==="**"&&i.operator==="**"?!r:r?at[t.operator]<=at[i.operator]:at[t.operator]<at[i.operator]}function ot(e,t,i,r){let{generator:s}=e;gi(e,t,i,r)?(e.write("("),s[t.type](t,e),e.write(")")):s[t.type](t,e)}function dr(e,t,i,r){let s=t.split(`
2
- `),n=s.length-1;if(e.write(s[0].trim()),n>0){e.write(r);for(let a=1;a<n;a++)e.write(i+s[a].trim()+r);e.write(i+s[n].trim())}}function V(e,t,i,r){let{length:s}=t;for(let n=0;n<s;n++){let a=t[n];e.write(i),a.type[0]==="L"?e.write("// "+a.value.trim()+`
3
- `,a):(e.write("/*"),dr(e,a.value,i,r),e.write("*/"+r))}}function gr(e){let t=e;for(;t!=null;){let{type:i}=t;if(i[0]==="C"&&i[1]==="a")return!0;if(i[0]==="M"&&i[1]==="e"&&i[2]==="m")t=t.object;else return!1}}function At(e,t){let{generator:i}=e,{declarations:r}=t;e.write(t.kind+" ");let{length:s}=r;if(s>0){i.VariableDeclarator(r[0],e);for(let n=1;n<s;n++)e.write(", "),i.VariableDeclarator(r[n],e)}}var hi,ci,fi,pi,mi,di,xr={Program(e,t){let i=t.indent.repeat(t.indentLevel),{lineEnd:r,writeComments:s}=t;s&&e.comments!=null&&V(t,e.comments,i,r);let n=e.body,{length:a}=n;for(let u=0;u<a;u++){let l=n[u];s&&l.comments!=null&&V(t,l.comments,i,r),t.write(i),this[l.type](l,t),t.write(r)}s&&e.trailingComments!=null&&V(t,e.trailingComments,i,r)},BlockStatement:di=function(e,t){let i=t.indent.repeat(t.indentLevel++),{lineEnd:r,writeComments:s}=t,n=i+t.indent;t.write("{");let a=e.body;if(a!=null&&a.length>0){t.write(r),s&&e.comments!=null&&V(t,e.comments,n,r);let{length:u}=a;for(let l=0;l<u;l++){let h=a[l];s&&h.comments!=null&&V(t,h.comments,n,r),t.write(n),this[h.type](h,t),t.write(r)}t.write(i)}else s&&e.comments!=null&&(t.write(r),V(t,e.comments,n,r),t.write(i));s&&e.trailingComments!=null&&V(t,e.trailingComments,n,r),t.write("}"),t.indentLevel--},ClassBody:di,StaticBlock(e,t){t.write("static "),this.BlockStatement(e,t)},EmptyStatement(e,t){t.write(";")},ExpressionStatement(e,t){let i=t.expressionsPrecedence[e.expression.type];i===Y||i===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 i=t.indent.repeat(t.indentLevel++),{lineEnd:r,writeComments:s}=t;t.indentLevel++;let n=i+t.indent,a=n+t.indent;t.write("switch ("),this[e.discriminant.type](e.discriminant,t),t.write(") {"+r);let{cases:u}=e,{length:l}=u;for(let h=0;h<l;h++){let c=u[h];s&&c.comments!=null&&V(t,c.comments,n,r),c.test?(t.write(n+"case "),this[c.test.type](c.test,t),t.write(":"+r)):t.write(n+"default:"+r);let{consequent:p}=c,{length:m}=p;for(let d=0;d<m;d++){let g=p[d];s&&g.comments!=null&&V(t,g.comments,a,r),t.write(a),this[g.type](g,t),t.write(r)}}t.indentLevel-=2,t.write(i+"}")},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:i}=e;i.param==null?t.write(" catch "):(t.write(" catch ("),this[i.param.type](i.param,t),t.write(") ")),this[i.body.type](i.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:i}=e;i.type[0]==="V"?At(t,i):this[i.type](i,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:hi=function(e,t){t.write(`for ${e.await?"await ":""}(`);let{left:i}=e;i.type[0]==="V"?At(t,i):this[i.type](i,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:hi,DebuggerStatement(e,t){t.write("debugger;",e)},FunctionDeclaration:ci=function(e,t){t.write((e.async?"async ":"")+(e.generator?"function* ":"function ")+(e.id?e.id.name:""),e),Oe(t,e.params),t.write(" "),this[e.body.type](e.body,t)},FunctionExpression:ci,VariableDeclaration(e,t){At(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:i}=e,{type:r}=i,s=t.expressionsPrecedence[r];(r[0]!=="C"||r[1]!=="l"||r[5]!=="E")&&(s===Y||s<t.expressionsPrecedence.ClassExpression)?(t.write("("),this[e.superClass.type](i,t),t.write(")")):this[i.type](i,t),t.write(" ")}this.ClassBody(e.body,t)},ImportDeclaration(e,t){t.write("import ");let{specifiers:i}=e,{length:r}=i,s=0;if(r>0){for(;s<r;){s>0&&t.write(", ");let n=i[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<r){for(t.write("{");;){let n=i[s],{name:a}=n.imported;if(t.write(a,n),a!==n.local.name&&t.write(" as "+n.local.name),++s<r)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:i}=e,{length:r}=i;if(r>0)for(let s=0;;){let n=i[s],{name:a}=n.local;if(t.write(a,n),a!==n.exported.name&&t.write(" as "+n.exported.name),++s<r)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 i=e.kind[0];(i==="g"||i==="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),Oe(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:i}=e;i!=null&&(i.length===1&&i[0].type[0]==="I"?t.write(i[0].name,i[0]):Oe(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:fi=function(e,t){t.write("..."),this[e.argument.type](e.argument,t)},SpreadElement:fi,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),ot(t,e.argument,e)},TemplateLiteral(e,t){let{quasis:i,expressions:r}=e;t.write("`");let{length:s}=r;for(let a=0;a<s;a++){let u=r[a],l=i[a];t.write(l.value.raw,l),t.write("${"),this[u.type](u,t),t.write("}")}let n=i[i.length-1];t.write(n.value.raw,n),t.write("`")},TemplateElement(e,t){t.write(e.value.raw,e)},TaggedTemplateExpression(e,t){ot(t,e.tag,e),this[e.quasi.type](e.quasi,t)},ArrayExpression:mi=function(e,t){if(t.write("["),e.elements.length>0){let{elements:i}=e,{length:r}=i;for(let s=0;;){let n=i[s];if(n!=null&&this[n.type](n,t),++s<r)t.write(", ");else{n==null&&t.write(", ");break}}}t.write("]")},ArrayPattern:mi,ObjectExpression(e,t){let i=t.indent.repeat(t.indentLevel++),{lineEnd:r,writeComments:s}=t,n=i+t.indent;if(t.write("{"),e.properties.length>0){t.write(r),s&&e.comments!=null&&V(t,e.comments,n,r);let a=","+r,{properties:u}=e,{length:l}=u;for(let h=0;;){let c=u[h];if(s&&c.comments!=null&&V(t,c.comments,n,r),t.write(n),this[c.type](c,t),++h<l)t.write(a);else break}t.write(r),s&&e.trailingComments!=null&&V(t,e.trailingComments,n,r),t.write(i+"}")}else s?e.comments!=null?(t.write(r),V(t,e.comments,n,r),e.trailingComments!=null&&V(t,e.trailingComments,n,r),t.write(i+"}")):e.trailingComments!=null?(t.write(r),V(t,e.trailingComments,n,r),t.write(i+"}")):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:i}=e,{length:r}=i;for(let s=0;this[i[s].type](i[s],t),++s<r;)t.write(", ")}t.write("}")},SequenceExpression(e,t){Oe(t,e.expressions)},UnaryExpression(e,t){if(e.prefix){let{operator:i,argument:r,argument:{type:s}}=e;t.write(i);let n=gi(t,r,e);!n&&(i.length>1||s[0]==="U"&&(s[1]==="n"||s[1]==="p")&&r.prefix&&r.operator[0]===i&&(i==="+"||i==="-"))&&t.write(" "),n?(t.write(i.length>1?" (":"("),this[s](r,t),t.write(")")):this[s](r,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:pi=function(e,t){let i=e.operator==="in";i&&t.write("("),ot(t,e.left,e,!1),t.write(" "+e.operator+" "),ot(t,e.right,e,!0),i&&t.write(")")},LogicalExpression:pi,ConditionalExpression(e,t){let{test:i}=e,r=t.expressionsPrecedence[i.type];r===Y||r<=t.expressionsPrecedence.ConditionalExpression?(t.write("("),this[i.type](i,t),t.write(")")):this[i.type](i,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 i=t.expressionsPrecedence[e.callee.type];i===Y||i<t.expressionsPrecedence.CallExpression||gr(e.callee)?(t.write("("),this[e.callee.type](e.callee,t),t.write(")")):this[e.callee.type](e.callee,t),Oe(t,e.arguments)},CallExpression(e,t){let i=t.expressionsPrecedence[e.callee.type];i===Y||i<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("?."),Oe(t,e.arguments)},ChainExpression(e,t){this[e.expression.type](e.expression,t)},MemberExpression(e,t){let i=t.expressionsPrecedence[e.object.type];i===Y||i<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(pr(e.value),e)},RegExpLiteral(e,t){let{regex:i}=e;t.write(`/${i.pattern}/${i.flags}`,e)}},yr={};var It=class{constructor(t){let i=t??yr;this.output="",i.output!=null?(this.output=i.output,this.write=this.writeToStream):this.output="",this.generator=i.generator!=null?i.generator:xr,this.expressionsPrecedence=i.expressionsPrecedence!=null?i.expressionsPrecedence:mr,this.indent=i.indent!=null?i.indent:" ",this.lineEnd=i.lineEnd!=null?i.lineEnd:`
4
- `,this.indentLevel=i.startingIndentLevel!=null?i.startingIndentLevel:0,this.writeComments=i.comments?i.comments:!1,i.sourceMap!=null&&(this.write=i.output==null?this.writeAndMap:this.writeToStreamAndMap,this.sourceMap=i.sourceMap,this.line=1,this.column=0,this.lineEndSize=this.lineEnd.split(`
5
- `).length-1,this.mapping={original:null,generated:this,name:void 0,source:i.sourceMap.file||i.sourceMap._file})}write(t){this.output+=t}writeToStream(t){this.output.write(t)}writeAndMap(t,i){this.output+=t,this.map(t,i)}writeToStreamAndMap(t,i){this.output.write(t),this.map(t,i)}map(t,i){if(i!=null){let{type:n}=i;if(n[0]==="L"&&n[2]==="n"){this.column=0,this.line++;return}if(i.loc!=null){let{mapping:a}=this;a.original=i.loc.start,a.name=i.name,this.sourceMap.addMapping(a)}if(n[0]==="T"&&n[8]==="E"||n[0]==="L"&&n[1]==="i"&&typeof i.value=="string"){let{length:a}=t,{column:u,line:l}=this;for(let h=0;h<a;h++)t[h]===`
6
- `?(u=0,l++):u++;this.column=u,this.line=l;return}}let{length:r}=t,{lineEnd:s}=this;r>0&&(this.lineEndSize>0&&(s.length===1?t[r-1]===s:t.endsWith(s))?(this.line+=this.lineEndSize,this.column=0):this.column+=r)}toString(){return this.output}};function xi(e,t){let i=new It(t);return i.generator[e.type](e,i),i.output}var M=class{constructor(t,i){this.id=t,Object.assign(this,i),this.dependencies=0}with(t,i){let r={};Object.keys(t).forEach(n=>{r[n]=this[n],this[n]=t[n]});let s=i();return Object.keys(t).forEach(n=>{this[n]=r[n]}),s}inUse(t){return arguments.length?(t?this.dependencies++:this.dependencies--,this):this.dependencies>0}};var Ce=class extends M{constructor(t,i,r={}){super(i,r),this.ownerContract=t,this.refs=new Set,this.propertyStack=[],this.embeddingReference=null}withProperty(t,i){this.propertyStack.unshift(t);let r=this.embeddingReference?this.embeddingReference.withProperty(t,i):i();return this.propertyStack.shift(),r}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(i=>i.toJson(t)),contractId:this.ownerContract.id}}};var f={tryStmt(e,t,i,r){return{type:"TryStatement",block:e,handler:t,finalizer:i,guardedHandlers:r}},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,i){return this.condExpr(e,t,i,"IfStatement")},switchStmt(e,t,i=!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,i,r){return{type:"ForStatement",init:e,test:t,update:i,body:r}},forInStmt(e,t,i){return{type:"ForInStatement",left:e,right:t,body:i}},forOfStmt(e,t,i){return{type:"ForOfStatement",left:e,right:t,body:i}},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,i,r=!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,i){return{type:"LogicalExpression",operator:e,left:t,right:i}},binaryExpr(e,t,i){return{type:"BinaryExpression",operator:e,left:t,right:i}},unaryExpr(e,t,i=!0){return{type:"UnaryExpression",operator:e,argument:t,prefix:i}},updateExpr(e,t,i=!1){return{type:"UpdateExpression",operator:e,argument:t,prefix:i}},assignmentExpr(e,t,i="="){return{type:"AssignmentExpression",operator:i,left:e,right:t}},assignmentPattern(e,t){return{type:"AssignmentPattern",left:e,right:t}},thisExpr(){return{type:"ThisExpression"}},condExpr(e,t,i,r="ConditionalExpression"){return{type:r,test:e,consequent:t,alternate:i}},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,i=!1){return{type:"CallExpression",callee:e,arguments:t,optional:i}},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,i=!1,r=!1){return{type:"MemberExpression",object:e,property:t,computed:i,optional:r}},funcExpr(e,t,i,r=!1,s=!1,n=!1){return this.func("FunctionExpression",...arguments)},arrowFuncExpr(e,t,i,r=!1,s=!1,n=!1){return this.func("ArrowFunctionExpression",...arguments)},func(e,t,i,r,s=!1,n=!1,a=!1){return{type:e,id:t,params:i,body:r,async:s,expression:n,generator:a}},identifier(e){return{type:"Identifier",name:e}},property(e,t,i="init",r=!1,s=!1,n=!1){return{type:"Property",key:e,value:t,kind:i,shorthand:r,computed:s,method:n}},methodDefinition(e,t,i="method",r=!1,s=!1){return{type:"MethodDefinition",key:e,value:t,kind:i,static:r,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 U=class extends M{constructor(t,i,r){super(i,r),this.ownerContext=t}generate(){if(!this.expr)return[this.expr,this];let t=f.identifier(this.ownerContext.getSubscriptIdentifier("$contract",!0)),i=f.memberExpr(f.memberExpr(t,f.identifier("memo")),f.literal(this.id),!0);return this.composed=f.assignmentExpr(i,this.expr),[this.composed,this]}toJson(t=!1){return{id:this.id}}};var Ee=class extends M{constructor(t,i,r){super(i,r),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(i=>i instanceof U||(i.name+"").includes("."))&&(this.isDotSafe=!1)}match(t){let i=(a,u)=>!a||!u?!1:a instanceof U&&u instanceof U?a.id===u.id:a.name===u.name,r=this.path,s=Array.isArray(t)?t:t.path,n=r.length-s.length;return n>0&&([r,s]=[s,r]),[r.reduce((a,u,l)=>a&&i(u,s[l]),!0),n]}toJson(t=!1){return{id:this.id,path:this.path.map(i=>i instanceof U?{memoId:i.id}:i),$path:this.isDotSafe?this.path.map(i=>i.name).join("."):void 0,condition:(this.condition||{}).lineage,referenceId:this.ownerReference.id}}};var We=class extends Ee{constructor(t,i,r){super(t,i,r),this.subscriptions=new Map,this.$subscriptions=new Map,this.updates=new Map}subscribe(t,i,r=!1){let s=r?this.$subscriptions:this.subscriptions,n=s.get(t);n||(n=new Set,s.set(t,n)),n.add(i),this.updates.forEach(a=>a.forEach(u=>{u.subscribe(t,i,r)}))}update(t,i,r){let s=this.updates.get(t);s||(s=new Set,this.updates.set(t,s)),s.add(i),r&&this.subscriptions.forEach((n,a)=>n.forEach(u=>{i.subscribe(a,u,!0)}))}toJson(t=!1){let{id:i,condition:r,referenceId:s,...n}=super.toJson(t),a={},u={};return this.subscriptions.forEach((l,h)=>{a[h.lineage]=Array.from(l).map(c=>c.id)}),this.$subscriptions.forEach((l,h)=>{u[h.lineage]=Array.from(l).map(c=>c.id)}),{id:i,...n,depth:this.depth.map(l=>l instanceof U?{memoId:l.id}:l),subscriptions:a,$subscriptions:u,condition:r,referenceId:s}}};var ie=class extends Ce{constructor(t,i,r){super(t,i,r),this.destructuringStack=[]}withDestructure(t,i){this.destructuringStack.push(t);let r=i();return this.destructuringStack.pop(),r}addRef(t={}){let i=new We(this,this.refs.size,{...t,condition:this.condition,depth:this.destructuringStack.slice(0)});return i.push(...this.propertyStack),this.refs.add(i),i}doSubscribe(t,i){let r=new Set(i);return this.refs.forEach((s,n)=>{r.forEach(a=>{let[u,l]=s.match(a);if(u&&l<=0){if(this.kind==="const")return;s.subscribe(t,a),this.inUse(!0),s.condition&&s.condition.inUse(!0),r.delete(a)}})}),[...r]}doUpdate(t,i,r){let s=new Set(i);return t===this?[...s]:(this.refs.forEach((n,a)=>{s.forEach(u=>{let[l,h]=n.match(u);if(l&&h>=0){if(this.kind==="const")throw new Error("Assignment to a constant declaration.");n.update(t,u,r),s.delete(u)}})}),[...s])}inUse(t){let i=super.inUse(...arguments);return this.ownerContract.inUse(...arguments),i}};var ze=class extends Ee{};var ge=class extends Ce{addRef(t){let i=new ze(this,this.refs.size,{...t,condition:this.condition});return i.push(...this.propertyStack),this.refs.add(i),i}setAssignee(t){this.assignee=t}toJson(t=!1){let i=super.toJson(t);return this.assignee&&(i.assignee=this.assignee.id),i}};var Te=class extends M{constructor(t,i,r={}){super(i,r),this.ownerContext=t,this.ownerScope=t&&(t.currentScope||t.ownerScope),this.effectReferences=[]}pushEffectReference(t){this.effectReferences.push(t)}doSubscribe(t,i=null){if(i=this.effectReferences.reduce((r,s)=>s.doSubscribe(t,r),i||[...t.refs]),!i.length)return!0;if(!this.ownerScope||["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"].includes(this.type))return i=this.ownerContext.references.reduce((r,s)=>s instanceof ie?s.doSubscribe(t,r):r,i),i.length?this.ownerContext.effectReference({},r=>(i.forEach(s=>{this.canObserveGlobal(s)&&r.addRef().push(...s.path)}),t.inUse(!0),r.doSubscribe(t,i),!0),!1):!0;if(this.ownerScope)return this.ownerScope.doSubscribe(t,i)}doUpdate(t,i=null){if(i=this.effectReferences.reduce((r,s)=>s.doUpdate(t,r),i||[...t.refs]),!this.ownerScope||["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"].includes(this.type)){if(t.type==="VariableDeclaration")return;t.ownerContract.$sideEffects=!0;let r=i.length&&i||[...t.refs];return this.ownerContext.sideEffects.push({reference:t,remainderRefs:r}),!0}if(!i.length)return!0;if(this.ownerScope)return this.ownerScope.doUpdate(t,i)}doSideEffectUpdates(t,i){if(this.effectReferences.forEach(r=>{let s=r.doUpdate(t,i,!0);r.type==="VariableDeclaration"&&(i=s)}),!i.length)return!0;if(!this.ownerScope||["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"].includes(this.type))return this.ownerContext.sideEffects.push({reference:t,remainderRefs:i,isSideEffects:!0}),!0;if(this.ownerScope)return this.ownerScope.doSideEffectUpdates(t,i)}canObserveGlobal(t){return(!this.ownerContext.$params.globalsOnlyPaths||t.path.length>1)&&!(this.ownerContext.$params.globalsNoObserve||[]).includes(t.path[0].name)}};var ke=class extends M{constructor(t,i,r){super(i,r),this.ownerContext=t,this.ownerContract=t.currentContract||t,this.parent=t.currentCondition}inUse(t){let i=super.inUse(...arguments),r=[];return this.switch?r.push(this.switch,...this.cases):(this.when||this.whenNot)&&r.push(this.when||this.whenNot),r.forEach(s=>s.inUse(...arguments)),i}get lineage(){return`${this.ownerContract.lineage}:${this.id}`}toJson(t=!1){let i={id:this.id};return this.switch?(i.switch=this.switch.id,i.cases=this.cases.map(r=>r.id)):this.whenNot?i.whenNot=this.whenNot.id:this.when&&(i.when=this.when.id),this.parent&&(this.parent.ownerContract.id===this.ownerContract.id?i.parent=this.parent.id:i.parent=`${this.parent.ownerContract.lineage}:${this.parent.id}`),i}};var re=class extends M{constructor(t,i,r){super(i,r),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,i=!1,r=-1){if(!arguments.length)return this.ownerContract;let s=r+1;if(typeof t=="function"?t(this,s):[].concat(t).some(n=>n===this.type))return i?{instance:this,level:s}:this;if(this.ownerContract)return this.ownerContract.closest(t,i,s)}closestContext(t=!1){return this.closest(i=>i instanceof se,t)}closestFunction(t=!1){return this.closest(["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"],t)}defineSubscriptIdentifier(t,i,r=[]){this.subscriptIdentifiers[t]={whitelist:i,blacklist:r,toString(){return this.whitelist[0]}}}getSubscriptIdentifier(t,i=!1){return this.subscriptIdentifiers[t]||i&&this.ownerContract&&this.ownerContract.getSubscriptIdentifier(t,i)}subscriptIdentifiersNoConflict(t){if(t.type!=="Identifier")throw new Error(`An implied Identifier is of type ${t.type}`);for(let i in this.subscriptIdentifiers){let r=this.subscriptIdentifiers[i],s=r.whitelist.indexOf(t.name);s!==-1&&(r.blacklist.push(r.whitelist.splice(s,1)),r.whitelist.length||(r.whitelist=r.blacklist.map(n=>{let a;do{let u=String.fromCharCode(0|Math.random()*26+97);a=`${n}${u}`}while(r.blacklist.includes(a));return a})))}this.ownerContract&&this.ownerContract.subscriptIdentifiersNoConflict(t)}get currentReference(){return this.referenceStack[0]}pushReference(t,i){this.references.unshift(t);let r=this.currentReference;this.referenceStack.unshift(t);let s=i(t,r);if(this.referenceStack.shift()!==t)throw new Error("Reference stack corrupted.");return s}signalReference(t,i,r=!0){let s=new ge(this,this.nextId("causes"),t),n=this.pushReference(s,i),a=this.closestContext(),u=a.currentScope||a.ownerScope;return(!s.refs.size||r&&!u.doSubscribe(s))&&(this.references=this.references.filter(l=>l!==s)),n}effectReference(t,i,r=!0){let s=new ie(this,this.nextId("affecteds"),t),n=this.pushReference(s,i),a=this.closestContext(),u=a.currentScope||a.ownerScope;return u.pushEffectReference(s),s.refs.size?(s.type!=="VariableDeclaration"||s.kind==="var")&&r&&u.doUpdate(s):this.references=this.references.filter(l=>l!==s),n}chainableReference(t,i){return this.currentReference&&this.currentReference.propertyStack.length?i():this.signalReference(t,i)}embeddableSignalReference(t,i){return this.currentReference&&this.signalReference(t,(r,s)=>(r.embeddingReference=s,i(r,s)))}embeddableEffectReference(t,i){return this.effectReference(t,(r,s)=>(r.embeddingReference=s,i(r,s)))}get currentScope(){return this.entryStack.reduce((t,i)=>t||i instanceof Te&&i,null)}get currentCondition(){return this.entryStack.reduce((t,i)=>t||i instanceof ke&&i,null)||this.closestFunction()!==this&&this.ownerContext&&this.ownerContext.currentCondition}get currentContext(){return this.entryStack.reduce((t,i)=>t||i instanceof se&&i,null)}get currentContract(){return this.entryStack.reduce((t,i)=>t||i instanceof re&&i,null)}get currentEntry(){return this.entryStack[0]}pushEntry(t,i){this.entries.unshift(t),this.entryStack.unshift(t);let r=i(t);return this.entryStack.shift(),t instanceof re&&!t.generatable()&&(this.entries=this.entries.filter(s=>s!==t)),r}createScope(t,i){let r=new Te(this,this.nextId("scope"),t);return this.pushEntry(r,i)}createCondition(t,i){let r=new ke(this,this.nextId("condition"),t);return this.pushEntry(r,i)}defineContext(t,i){let r=new se(this,this.nextId("context"),t);return this.pushEntry(r,i)}defineContract(t,i){let r=new re(this,this.nextId("contract"),t);return this.pushEntry(r,i)}defineMemo(t){let i=new U(this,this.nextId("memo"),t);return this.memos.unshift(i),i}getLabelInfo(){let t=this.type,i,r;return(this.ownerScope||{}).label?{label:{name:i},type:r}=this.ownerScope:t==="Iteration"&&this.ownerContract.ownerScope.label&&({label:{name:i},type:r}=this.ownerContract.ownerScope),{type:t,label:i,target:r}}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,i){if(["break","continue"].includes(t.value)){let r=this.getLabelInfo();if(r.type==="Iteration"?r.target!=="BlockStatement"&&(i.value===r.label||!i.value):i.value&&i.value===r.label)return this._hoistedExitStatements.set(t,{...r,arg:i}),r}if(this._hoistedExitStatements.set(t,i),this.ownerContract)return this.ownerContract.hoistExitStatement(t,i)}generatable(){return this.references.length||this instanceof se}generate(t,i={}){if(!t||!this.generatable())return t;this.generated=!0;let r=f.identifier(this.ownerContract.getSubscriptIdentifier("$contract",!0)),s,n;i.isFunctionContract?s=t:this.inSequence?s=f.arrowFuncExpr(null,[r],t,this.hoistedAwaitKeyword,!0):(n=Array.isArray(t)?f.blockStmt(t):f.blockStmt([t]),s=f.arrowFuncExpr(null,[r],n,this.hoistedAwaitKeyword));let a=[f.literal(this.id),...i.args||[],s],u=f.callExpr(r,a);if(this.hoistedAwaitKeyword&&(u=f.awaitExpr(u)),this.inSequence||i.generateForArgument)return u;let l=this;u=f.exprStmt(u),u.comments=[{type:"Line",value:{toString(){return l.lineage},trim(){return this.toString()}}}];let h=[u];if(this.hookExpr=h,!(this.ownerScope||{}).singleStatementScope){let c,p=[],m,d=(g,x)=>{let y=f.ifStmt(g,x);m?m.alternate=y:(m=y,h.push(y))};if(this.hoistedExitStatements.forEach((g,x)=>{if(["break","continue"].includes(x.value)&&!p.includes(x.value)&&g.arg){let y=g.arg,E=f.callExpr(f.memberExpr(r,f.identifier("exiting")),[x,y]),R=f.exprStmt(f.identifier(g.type==="Iteration"||!y.value?x.value:x.value+" "+y.value));d(E,R),p.push(x.value)}else c=!0}),c){let g=f.callExpr(f.memberExpr(r,f.identifier("exiting"))),x=f.exprStmt(f.identifier("return"));d(g,x)}}return h}get lineage(){let t=this.ownerContract&&this.ownerContract.lineage;return this.ownerContract&&!this.generated?t:`${t?t+"/":""}${this.id}`}toJson(t=!1){let i={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 ge?a=i.signals:n instanceof ie&&(a=i.effects),a[n.id]=n.toJson(t)});let r=this.lineage.split("/").length,s=n=>n.reduce((a,u)=>a.subContracts[u],i);return this.entries.slice(0).reverse().forEach(n=>{if(n instanceof re&&n.generated){let a=s(n.lineage.split("/").slice(r,-1));a.subContracts[n.id]=n.toJson(t)}else if(n instanceof ke){let a=s(n.ownerContract.lineage.split("/").slice(r));a.conditions[n.id]=n.toJson(t)}}),i}};var se=class extends re{};var Ae=class{constructor(t={}){this.params=t,this.locations=[],this._locStart=this.params.locStart||0,this.deferredTasks=[]}setLocation(t,i){if(this.params.locations===!1||!i)return;let r=[i.start+this._locStart,i.end+this._locStart];this.params.locations==="detached"?(this.locations.push(r),t.loc=this.locations.length-1):t.loc=r}serialize(t,i={}){return xi(t,{comments:!0,...i})}generate(t){let i={type:"Global"},r=new se(null,"#",{...i,params:this.params});r.defineSubscriptIdentifier("$contract",["$x"]);let[s]=r.createScope(i,()=>this.generateNodes(r,[t]));return this.deferredTasks.forEach(n=>n()),{source:this.serialize(s),graph:r.toJson(!1),identifier:r.getSubscriptIdentifier("$contract"),locations:this.locations,ast:s}}generateNodes(t,i,r=!1){let s=i.length;s>1&&(i=i.reduce((a,u)=>u.type==="FunctionDeclaration"?[u].concat(a):a.concat(u),[]));let n=a=>{if(a===s)return[];let u=!1,l=()=>(u=!0,n(a+1)),h;if(i[a]){let c=()=>this.generateNode(t,i[a],r);this[`generate${i[a].type}`]&&(!r||["Identifier","FunctionDeclaration","FunctionExpression"].includes(i[a].type))&&(c=()=>this[`generate${i[a].type}`].call(this,t,i[a],l)),h=c()}else h=[i[a]];return u||(h=[].concat(h).concat(l(1))),h};return n(0)}generateNode(t,i,r=!1){return Object.keys(i).reduce((s,n)=>{let a=i[n];return Array.isArray(a)?a=this.generateNodes(t,a,r):typeof a=="object"&&a&&([a]=this.generateNodes(t,[a],r)),{...s,[n]:a}},{})}generateProgram(t,i){let r={type:i.type},s=t.createScope(r,()=>this.generateNodes(t,i.body));return{...i,body:s}}generateMethodDefinition(t,i){let r=this.generateNode(t,i.value,!0);return f.methodDefinition(i.key,r,i.kind,i.static,i.computed)}generateFunctionDeclaration(t,i){return this.generateFunction(f.funcDeclaration,...arguments)}generateFunctionExpression(t,i){return this.generateFunction(f.funcExpr,...arguments)}generateArrowFunctionExpression(t,i){return this.generateFunction(f.arrowFuncExpr,...arguments)}generateFunction(t,i,r){let s=(d,g)=>d?g.effectReference({type:r.type},()=>this.generateNodes(g,[d]),!1):[d],n=(d,g,x)=>i.defineContext({type:r.type,isSubscriptFunction:r.isSubscriptFunction},y=>y.createScope({type:r.type},()=>(d=s(d,y)[0],g=g.map(E=>{if(E.type==="AssignmentPattern"){let H=this.generateNode(y,E.right),yt={type:E.left.type},[lr]=y.effectReference(yt,()=>this.generateNodes(y,[E.left]),!1);return f.assignmentPattern(lr,H)}let R={type:E.type};return[E]=y.effectReference(R,()=>this.generateNodes(y,[E]),!1),E}),r.type==="ArrowFunctionExpression"&&r.expression?x=this.generateNode(y,f.blockStmt([f.returnStmt(x)])):x=this.generateNode(y,x),[y,d,g,x]))),a=f.identifier(i.getSubscriptIdentifier("$contract",!0)),u=(d,g,x,y,E)=>g.generate(d.call(f,x,[a].concat(y),E,r.async,r.expression,r.generator),{args:[f.literal(r.type),f.identifier(r.isSubscriptFunction?"true":"false")],isFunctionContract:!0,generateForArgument:!0}),l,h,c,p,m;if(r.type==="FunctionDeclaration"){[c]=s(r.id,i),[h,,p,m]=n(null,r.params,r.body),l=u(f.funcExpr,h,null,p,m);let d=f.memberExpr(a,f.identifier("functions")),g=(x,...y)=>f.callExpr(f.memberExpr(d,f.identifier(x)),[c,...y]);l=[f.exprStmt(g("define",l)),t.call(f,c,p,f.blockStmt([f.returnStmt(f.callExpr(f.memberExpr(g("get"),f.identifier("call")),[f.thisExpr(),f.spreadElement(f.identifier("arguments"))]))]))]}else[h,c,p,m]=n(r.id,r.params,r.body),l=u(t,h,c,p,m);return this.deferredTasks.unshift(()=>{h.sideEffects.forEach(d=>{h.ownerScope.doSideEffectUpdates(d.reference,d.remainderRefs)})}),l}generateVariableDeclaration(t,i){let r={type:i.type,kind:i.kind},s=[],n=(l,h,c)=>{let p,[m]=l.signalReference(r,R=>(p=R,this.generateNodes(t,[h.init]))),d,[g]=l.effectReference(r,R=>(d=R,this.generateNodes(t,[h.id])));if(p.setAssignee(d),this.setLocation(l,h),c||i.kind==="const"||!h.init||!this.params.devMode&&!l.references.filter(R=>R instanceof ge).length)return f.varDeclarator(g,m);let x=["ObjectPattern","ArrayPattern"].includes(h.id.type),y=Array.from(d.refs).map(R=>f.varDeclarator(f.identifier(R.path[0].name),null)),E=f.assignmentExpr(g,m);return s.length?(s.push(f.varDeclaration(i.kind,y),...l.generate(f.exprStmt(E))),[]):(s.push(...l.generate(f.exprStmt(E))),y)},a=t.currentContract&&["ForStatement","ForOfStatement","ForInStatement"].includes(t.currentContract.type),u=i.declarations.reduce((l,h)=>a?l.concat(n(t.currentContract,h,!0)):t.defineContract(r,c=>l.concat(n(c,h))),[]);return u.length?[f.varDeclaration(i.kind,u),...s]:s}generateIfStatement(t,i){let r={type:i.type};return t.defineContract(r,s=>{let{consequent:n,alternate:a}=i,[u]=s.signalReference(r,()=>this.generateNodes(t,[i.test])),[l,h]=t.defineMemo({expr:u}).generate();return n=t.createCondition({when:h},()=>this.generateNodes(t,[i.consequent])),n[0].type!=="BlockStatement"&&n.length>1?n=f.blockStmt(n):n=n[0],i.alternate&&(a=t.createCondition({whenNot:h},()=>this.generateNodes(t,[i.alternate])),a[0]&&a[0].type!=="BlockStatement"&&a.length>1?a=f.blockStmt(a):a=a[0]),this.setLocation(s,i),this.setLocation(h,i.test),s.generate(f.ifStmt(l,n,a))})}generateSwitchStatement(t,i){let r={type:i.type};return t.defineContract(r,s=>{let[n]=s.signalReference(r,()=>this.generateNodes(t,[i.discriminant])),[a,u]=t.defineMemo({expr:n}).generate(),l=t.createScope(r,()=>i.cases.reduce((h,c)=>{let p=h.slice(-1)[0],m=c.consequent.some(E=>E.type==="BreakStatement"),[d]=s.signalReference({type:c.type},()=>this.generateNodes(t,[c.test])),[g,x]=t.defineMemo({expr:d}).generate(),y={switch:u,cases:[x]};return p&&!p.hasBreak&&y.cases.push(...p.condition.cases),this.setLocation(x,c.test),h.concat({caseNode:c,$test:g,condition:y,hasBreak:m})},[]).map(({caseNode:h,$test:c,condition:p})=>{let m=t.createCondition(p,()=>this.generateNodes(t,h.consequent));return f.switchCase(c,m)}));return this.setLocation(s,i),this.setLocation(u,i.discriminant),s.generate(f.switchStmt(a,l))})}generateWhileStatement(t,i){return this.generateLoopStmtA(f.whileStmt,...arguments)}generateDoWhileStatement(t,i){return this.generateLoopStmtA(f.doWhileStmt,...arguments)}generateForStatement(t,i){return this.generateLoopStmtA(f.forStmt,...arguments)}generateLoopStmtA(t,i,r){let s={type:r.type};return i.defineContract({type:r.type},n=>(this.setLocation(n,r),n.defineSubscriptIdentifier("$counter",["$x_index"]),i.createScope({type:"Iteration"},()=>{let a,u,l,h;return r.type==="ForStatement"?([u,l,h]=n.signalReference(s,()=>this.generateNodes(i,[r.init,r.test,r.update])),a=c=>t.call(f,u,l,h,c)):([l]=n.signalReference(s,()=>this.generateNodes(i,[r.test])),a=c=>t.call(f,l,c)),i.defineContext({type:"Iteration",isIteration:!0},c=>{this.setLocation(c,r.body);let p,[m]=this.generateNodes(c,[r.body]);m.body.length&&([p,m]=this.composeLoopStmt(c,m));let d=[].concat(p||[]).concat(a(f.blockStmt(m)));return n.generate(d)})})))}composeLoopStmt(t,i,r={}){let s=[r.disposeCallback],n=()=>s.forEach(c=>c&&c()),a=[],u=[],l=[],h=i.body.slice(0);if(!r.iterationId){r.iterationId=f.identifier(t.getSubscriptIdentifier("$counter",!0));let c=f.varDeclarator(f.clone(r.iterationId),f.literal(-1)),p=f.updateExpr("++",f.clone(r.iterationId),!1);a.push(c),l.push(p),s.push(()=>l.pop())}return u.length&&(l.push(f.varDeclaration("let",u)),s.push(()=>l.splice(-1))),l.push(...t.generate(h,{args:[r.iterationId],disposeCallback:n})),a.length?a=f.varDeclaration("let",a):a=null,[a,l]}generateForOfStatement(t,i){return this.generateLoopStmtB(f.forOfStmt,...arguments)}generateForInStatement(t,i){return this.generateLoopStmtB(f.forInStmt,...arguments)}generateLoopStmtB(t,i,r){let s={type:r.type};return i.defineContract({type:r.type},n=>(this.setLocation(n,r),n.defineSubscriptIdentifier("$counter",[r.type==="ForInStatement"?"$x_key":"$x_index"]),i.createScope({type:"Iteration"},()=>{let a,u;r.left.type==="VariableDeclaration"?([a]=this.generateNodes(i,[r.left]),u=a.declarations[0].id):([a]=n.affectedsReference(s,()=>this.generateNodes(i,[r.left])),u=a);let[l]=n.signalReference(s,()=>this.generateNodes(i,[r.right]));return i.defineContext({type:"Iteration",isIteration:!0},h=>{this.setLocation(h,r.body);let[c]=this.generateNodes(h,[r.body]),p=t.call(f,a,l,c),m=[];if(c.body.length){let d=y=>this.composeLoopStmt(h,c,{disposeCallback:()=>{p.left=a},...y}),g=a,x=c;if(r.type==="ForOfStatement")[m,x]=d({});else if(u.type==="Identifier")[m,x]=d({iterationId:u});else{let y=f.identifier(i.getSubscriptIdentifier("$counter"));[m,x]=d({iterationId:y}),g=f.varDeclaration("let",[f.varDeclarator(f.clone(y),null)]);let E;r.left.type==="VariableDeclaration"?E=f.varDeclaration(a.kind,[f.varDeclarator(u,f.clone(y))]):E=f.exprStmt(f.sequenceExpr([f.assignmentExpr(u,f.clone(y),"=")])),x=[E].concat(x)}p=t.call(f,g,l,f.blockStmt(x))}return n.generate([].concat(m||[]).concat(p))})})))}generateLabeledStatement(t,i){t.subscriptIdentifiersNoConflict(i.label);let r={type:i.type,label:i.label};return i.body.type.endsWith("Statement")?t.createScope({type:i.body.type,label:i.label},s=>{if(i.body.type==="BlockStatement"){let a=this.generateNodes(t,i.body.body);return f.labeledStmt(i.label,f.blockStmt(a))}s.singleStatementScope=!0;let[n]=this.generateNodes(t,[i.body]);return f.labeledStmt(i.label,n)}):t.defineContract(r,s=>{this.setLocation(s,i.body);let[n]=this.generateNodes(t,[i.body]);return f.labeledStmt(i.label,s.generate(n))})}generateBreakStatement(t,i){return this.generateExitStmt(f.breakStmt,...arguments)}generateContinueStatement(t,i){return this.generateExitStmt(f.continueStmt,...arguments)}generateExitStmt(t,i,r){let s=i.currentContract.closest(["Iteration","SwitchStatement","LabeledStatement"]);if(s&&s.type==="SwitchStatement"&&r.type==="BreakStatement"&&!r.label)return t.call(f,null);let n=f.identifier(i.getSubscriptIdentifier("$contract",!0)),a=f.literal(r.type==="BreakStatement"?"break":"continue"),u=r.label?f.literal(r.label.name):f.identifier("null"),l=f.exprStmt(f.callExpr(f.memberExpr(n,f.identifier("exit")),[a,u]));return i.currentContract.hoistExitStatement(a,u),[l,f.returnStmt()]}generateReturnStatement(t,i){let r={type:i.type};return t.defineContract(r,s=>{let[n]=s.signalReference(r,()=>this.generateNodes(t,[i.argument])),a=f.identifier(t.getSubscriptIdentifier("$contract",!0)),u=f.literal("return"),l=n||f.identifier("undefined"),h=f.exprStmt(f.callExpr(f.memberExpr(a,f.identifier("exit")),[u,l]));return s.hoistExitStatement(u,f.identifier("true")),s.generate([h,f.returnStmt()])})}generateBlockStatement(t,i){return t.createScope({type:i.type},()=>{let r=this.generateNodes(t,i.body);return f.blockStmt(r)})}generateExpressionStatement(t,i){let r={type:i.type};return t.defineContract(r,s=>{this.setLocation(s,i.expression);let[n]=s.signalReference(r,()=>this.generateNodes(t,[i.expression]));return s.generate(f.exprStmt(n))})}generateSequenceExpression(t,i){let r=i.expressions.map((s,n)=>{let a={type:s.type,inSequence:!0};return n===i.expressions.length-1?([s]=t.currentContract.chainableReference(a,()=>this.generateNodes(t,[s])),s):t.defineContract(a,u=>(this.setLocation(u,s),[s]=u.signalReference(a,()=>this.generateNodes(t,[s])),s.type==="Identifier"?s:u.generate(s)))});return f.sequenceExpr(r)}generateAssignmentExpression(t,i){let r={type:i.type,kind:i.operator},s,[n]=t.currentContract.signalReference(r,l=>(s=l,this.generateNodes(t,[i.right]))),a,[u]=t.currentContract.embeddableEffectReference(r,l=>(a=l,this.generateNodes(t,[i.left])));return s.setAssignee(a),f.assignmentExpr(u,n,i.operator)}generateUpdateExpression(t,i){return this.generateMutationExpr(f.updateExpr,...arguments)}generateUnaryExpression(t,i){if(i.operator==="delete")return this.generateMutationExpr(f.unaryExpr,...arguments);let r={type:i.type,kind:i.operator},[s]=t.currentContract.signalReference(r,()=>this.generateNodes(t,[i.argument]));return f.unaryExpr(i.operator,s,i.prefix)}generateMutationExpr(t,i,r){let s={type:r.type,kind:r.operator},[n]=i.currentContract.effectReference(s,()=>this.generateNodes(i,[r.argument]));return t.call(f,r.operator,n,r.prefix)}generateBinaryExpression(t,i){let[r]=t.currentContract.signalReference({type:i.type},()=>this.generateNodes(t,[i.left])),[s]=t.currentContract.signalReference({type:i.type},()=>this.generateNodes(t,[i.right]));return f.binaryExpr(i.operator,r,s)}generateLogicalExpression(t,i){let r={type:i.type,kind:i.operator},[s]=t.currentContract.chainableReference(r,()=>this.generateNodes(t,[i.left])),[n,a]=t.defineMemo({expr:s}).generate(),u=i.operator==="||"?{whenNot:a}:{when:a},[l]=t.createCondition(u,()=>t.currentContract.chainableReference(r,()=>this.generateNodes(t,[i.right])));return this.setLocation(a,i.left),f.logicalExpr(i.operator,n,l)}generateConditionalExpression(t,i){let r={type:i.type},[s]=t.currentContract.signalReference(r,()=>this.generateNodes(t,[i.test])),[n,a]=t.defineMemo({expr:s}).generate(),[u]=t.createCondition({when:a},()=>t.currentContract.chainableReference(r,()=>this.generateNodes(t,[i.consequent]))),[l]=t.createCondition({whenNot:a},()=>t.currentContract.chainableReference(r,()=>this.generateNodes(t,[i.alternate])));return this.setLocation(a,i.test),f.condExpr(n,u,l)}generateArrayPattern(t,i){let r=i.elements.map((s,n)=>([s]=t.currentContract.currentReference.withDestructure({name:n},()=>this.generateNodes(t,[s])),s));return f.arrayPattern(r)}generateObjectPattern(t,i){let r=i.properties.map(s=>{let{key:n,value:a}=s;s.computed&&([n]=t.currentContract.signalReference({type:n.type},()=>this.generateNodes(t,[n])));let u={name:s.key.name};return s.computed&&(s.key.type==="Literal"?u={name:s.key.value}:[n,u]=t.defineMemo({expr:n}).generate()),[a]=t.currentContract.currentReference.withDestructure(u,()=>this.generateNodes(t,[a])),this.setLocation(u,s.key),f.property(n,a,s.kind,s.shorthand,s.computed,s.method)});return f.objectPattern(r)}generateMemberExpression(t,i){let{property:r}=i;i.computed&&([r]=t.currentContract.signalReference({type:r.type},()=>this.generateNodes(t,[r])));let s={name:i.property.name};i.computed&&(i.property.type==="Literal"?s={name:i.property.value}:[r,s]=t.defineMemo({expr:r}).generate());let[n]=t.currentContract.currentReference.withProperty(s,()=>this.generateNodes(t,[i.object]));return this.setLocation(s,i.property),f.memberExpr(n,r,i.computed,i.optional)}generateThisExpression(t,i){return this.generateIdentifier(...arguments)}generateIdentifier(t,i){let r=()=>i.type==="Identifier"?f.identifier(i.name):f.thisExpr();i.type==="Identifier"&&t.subscriptIdentifiersNoConflict(i);let s={name:i.type==="Identifier"?i.name:"this"};this.setLocation(s,i);let n=t.closestFunction(),a=(t.currentContract||t).currentReference;if(a)do(!n||n.isSubscriptFunction||a instanceof ie)&&a.addRef().unshift(s);while(a=a.contextReference);return r()}generateSpreadElement(t,i){return this.generateArgumentExpr(f.spreadElement,...arguments)}generateAwaitExpression(t,i){return t.currentContract.hoistAwaitKeyword(),this.generateArgumentExpr(f.awaitExpr,...arguments)}generateArgumentExpr(t,i,r){let[s]=i.currentContract.signalReference({type:r.type},()=>this.generateNodes(i,[r.argument]));return t.call(f,s)}generateCallExpression(t,i){return this.generateCallExpr(f.callExpr,...arguments)}generateNewExpression(t,i){return this.generateCallExpr(f.newExpr,...arguments)}generateCallExpr(t,i,r){let[s]=i.currentContract.signalReference({type:r.callee.type},()=>this.generateNodes(i,[r.callee])),n=r.arguments.map(a=>i.currentContract.signalReference({type:a.type},()=>this.generateNodes(i,[a])[0]));return t.call(f,s,n,r.optional)}generateParenthesizedExpression(t,i){return this.generateExprExpr(f.parensExpr,...arguments)}generateChainExpression(t,i){return this.generateExprExpr(f.chainExpr,...arguments)}generateExprExpr(t,i,r){let[s]=this.generateNodes(i,[r.expression]);return t.call(f,s)}generateArrayExpression(t,i){let r=i.elements.map(s=>t.currentContract.signalReference({type:s.type},()=>this.generateNodes(t,[s])[0]));return f.arrayExpr(r)}generateObjectExpression(t,i){let r=this.generateNodes(t,i.properties);return f.objectExpr(r)}generateProperty(t,i){let{key:r,value:s}=i;return i.computed&&([r]=t.currentContract.signalReference({type:r.type},()=>this.generateNodes(t,[r]))),[s]=t.currentContract.signalReference({type:s.type},()=>this.generateNodes(t,[s])),f.property(r,s,i.kind,i.shorthand,i.computed,!1)}generateTaggedTemplateExpression(t,i){let[r,s]=t.currentContract.signalReference({type:i.type},()=>this.generateNodes(t,[i.tag,i.quasi]));return f.taggedTemplateExpr(r,s)}generateTemplateLiteral(t,i){let r=i.expressions.map(s=>t.currentContract.signalReference({type:i.type},()=>this.generateNodes(t,[s])[0]));return f.templateLiteral(i.quasis,r)}generateTryStatement(t,i){let[r,s,n]=this.generateNodes(t,[i.block,i.handler,i.finalizer]);return f.tryStmt(r,s,n)}generateCatchClause(t,i){let[r]=this.generateNodes(t,[i.body]);return f.catchClause(i.param,r)}generateThrowStatement(t,i){return this.generateArgumentExpr(f.throwStmt,...arguments)}};var le=class{constructor(t,i,r,s={},n=null,a=null){this.ownerContract=t,this.graph=i,this.callee=r,this.params=s,this.exits=a||new Map,this.$thread=n||{entries:new Map,sequence:[],ownerContract:this},this.subContracts=new Map,this.contract=function(l,h,c=null,p=null){if(!this.graph.subContracts[l])throw new Error(`[${this.graph.type}:${this.graph.lineage}]: Graph not found for child contract ${l}.`);let m=this.graph.subContracts[l],d={...this.params,isIterationContract:arguments.length===3,iterationId:arguments.length===3&&h,isFunctionContract:arguments.length===4,functionType:arguments.length===4&&h,isSubscriptFunction:arguments.length===4&&c,functionScope:this.params.isFunctionContract&&this.graph.lineage||this.params.functionScope};if(d.isIterationContract){let E=c,R=new le(this,m,E,d,this.$thread,this.exits),H=this.subContracts.get(l);return H||(H=new Map,this.subContracts.set(l,H)),H.has(d.iterationId)&&H.get(d.iterationId).dispose(),H.set(d.iterationId,R),R.call()}let g,x,y;return this.subContracts.has(l)&&this.subContracts.get(l).dispose(),d.isFunctionContract?(g=p,y=x=new le(this,m,g,d),d.functionType!=="FunctionDeclaration"&&(y=g instanceof(async()=>{}).constructor?async function(){return x.call(this,...arguments)}:function(){return x.call(this,...arguments)},u(y,x))):(g=h,x=new le(this,m,g,d,this.$thread,this.exits),y=x.call()),this.subContracts.set(l,x),y}.bind(this),this.contract.memo=Object.create(null),this.contract.exiting=function(l,h){if(!arguments.length)return this.exits.size;let c=this.exits.get(l)===h;return c&&this.exits.clear(),c}.bind(this),this.contract.exit=function(l,h){this.exits.set(l,h)}.bind(this),this.contract.functions=new Map,this.contract.functions.define=(l,h)=>{this.contract.functions.set(l,h),u(l,h,!0)};let u=(l,h,c=!1)=>{c||(Object.defineProperty(l,"length",{configurable:!0,value:h.callee.length-1}),Object.defineProperty(l,"name",{configurable:!0,value:h.callee.name})),h.params.isSubscriptFunction&&(l.thread=h.thread.bind(h),l.dispose=h.dispose.bind(h),Object.defineProperty(l,"runtime",{value:h}),Object.defineProperty(l,"sideEffects",{configurable:!0,value:h.graph.sideEffects||""}),Object.defineProperty(l,"subscriptSource",{configurable:!0,value:h.graph.subscriptSource||""}),Object.defineProperty(l,"originalSource",{configurable:!0,value:h.graph.originalSource||""}))}}fire(t,i,r){if(!!this.ownerContract)return this.ownerContract.fire(t,i,r)}call(t,...i){if(this.disposed)throw new Error(`[${this.graph.type}:${this.graph.lineage}]: Instance not runable after having been disposed.`);let r=this.callee.call(t,this.contract,...i);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&&(r=r instanceof Promise?r.then(()=>s):s)}return r}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[[,i]]=this.subContracts,r,s=(n,a)=>n instanceof Promise?n.then(a):a();if(!t.length||t.includes("length")&&this.graph.type==="ForOfStatement")for(let[,n]of i)r=s(r,()=>n.call());else for(let n of t){let a=i.get(n)||i.get(parseInt(n));!a||(r=s(r,()=>a.call()))}return r}thread(...t){if(this.disposed)return!1;this.$thread.active=!0;for(let i in this.graph.effects)for(let r of this.graph.effects[i].refs)for(let s of t){let[n,a,u]=this.matchRefs(s,r);!n||this.buildThread(s,r,u,a)}return this.runThread()}runThread(){let t=(a,u)=>{if(["ForOfStatement","ForInStatement"].includes(a.graph.type)&&u.every(l=>l.executionPlan.isIterationContractTarget)){let l=u.map(h=>h.executionPlan.iterationTarget);return this.fire(a.graph.lineage,"iterating",u),a.iterate(l)}return this.fire(a.graph.lineage,"executing",u),a.call()},i,r,s,n=(a,u)=>a instanceof Promise?a.then(u):u();for(;(r=this.$thread.sequence.shift())&&(s=[...this.$thread.entries.get(r)])&&this.$thread.entries.delete(r);)i=n(i,()=>{if(r.disposed||!r.filterRefs(s).length)return;this.$thread.current=r;let a=t(r,s);return n(a,()=>{for(let u of s)[].concat(u.executionPlan.assigneeRef||u.executionPlan.assigneeRefs||[]).forEach(l=>{r.buildThread([],l,[],0)})}),a});return n(i,()=>{let a=this.exits.get("return");return this.exits.clear(),this.$thread.current=null,this.$thread.active=!1,a})}buildThread(t,i,r,s=0,n=!1){let a=s>0;if(this.ownerContract){if(!this.compute(r)||i.condition!==void 0&&!this.assert(i.condition))return}else a||(a=r.length||i.condition!==void 0);let u=n?i.$subscriptions:i.subscriptions;Object.keys(u).forEach(l=>{let[h,c]=l.split(":"),p=d=>{!d||d.selectRefs(c,u[l],a?t:null)},m=this.locate(h);Array.isArray(m)?m.forEach(p):p(m)})}selectRefs(t,i,r=null){let s=this.$thread,n=this.graph.signals[t],a=(l,h)=>l.graph.lineage.localeCompare(h.graph.lineage,void 0,{numeric:!0}),u=(l,h=[],c={})=>{if(!s.active||s.current&&a(this,s.current)<0)return;let p=s.entries.get(this);if(p||(p=new Set,s.entries.set(this,p),s.sequence.push(this),s.sequence.sort(a)),p.add({...l,computes:h,executionPlan:c}),!c.assigneeRef&&["VariableDeclaration","AssignmentExpression"].includes(this.graph.type)){c.assigneeRefs=[];for(let m in this.graph.effects)c.assigneeRefs.push(...this.graph.effects[m].refs)}};for(let l of i){let h=n.refs[l];if(!r){u(h);continue}let[c,p,m]=this.matchRefs(r,h);if(!c)continue;if(p<=0){u(h,m);continue}let d=r.slice(-p),g="assignee"in n?this.graph.effects[n.assignee]:null;if(g){g.refs.forEach(x=>{if(x.depth.length){let[y,E,R]=this.matchRefs(d,x.depth),H=m.concat(R);if(y&&E>0){let yt=x.path.concat(d.slice(-E));this.buildThread(yt,x,H,E)}else y&&u(h,H,{assigneeRef:x})}else{let y=x.path.concat(d);this.buildThread(y,x,m,p)}});continue}if(p===1&&this.graph.type==="ForOfStatement"){u(h,m,{isIterationContractTarget:!0,iterationTarget:d[0]});continue}if(p===1&&this.graph.type==="ForInStatement"){u(h,m,{isIterationContractTarget:!0,iterationTarget:d[0]});continue}}}filterRefs(t){return t.filter(i=>{if(!!this.compute(i.computes)&&!(i.condition!==void 0&&!this.assert(i.condition)))return!0})}matchRefs(t,i){let r,s,n,a;Array.isArray(t)?(r=t,s=t.dotSafe?t.join("."):void 0):(r=t.path,s=t.$path),Array.isArray(i)?(n=i,a=i.dotSafe?i.join("."):void 0):(n=i.path,a=i.$path);let u=r.length-n.length;if(u>0&&([r,n,s,a]=[n,r,a,s]),s&&a)return[`${a}.`.startsWith(`${s}.`),u,[]];let l=[],h=p=>typeof p=="object"?p.name:p,c=(p,m)=>{if(!p||!m)return!1;let d=typeof p=="object"&&"memoId"in p,g=typeof m=="object"&&"memoId"in m;return d||g?(l.push(x=>(d?x[p.memoId]:h(p))===(g?x[m.memoId]:h(m))),!0):h(p)===h(m)};return[r.reduce((p,m,d)=>p&&c(m,n[d]),!0),u,l]}locate(t){let i=this.graph.lineage+"/",r=t+"/";if(r===i)return this;if(r.startsWith(i)){let s=t.slice(i.length).split("/"),n=this.subContracts.get(parseInt(s.shift()));if(s.length){if(n instanceof Map)return Array.from(n).reduce((a,[u,l])=>a.concat(l.locate(t)),[]);if(n)return n.locate(t)}return n}if(this.ownerContract)return this.ownerContract.locate(t)}compute(t){return!t.some(i=>i(this.contract.memo)===!1)}assert(t){if(typeof t=="string"&&t.includes(":")){let[s,n]=t.split(":");return this.locate(s).assert(n)}let i=this.graph.conditions[t],r=this.contract.memo;return typeof i.parent<"u"&&!this.assert(i.parent)?!1:typeof i.switch<"u"?i.cases.some(s=>r[s]===r[i.switch]):typeof i.whenNot<"u"?!r[i.whenNot]:typeof i.when<"u"?r[i.when]:!0}dispose(){this.params.isFunctionContract||(this.subContracts.forEach((t,i)=>{t instanceof Map?(t.forEach(r=>r.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 Le=class extends le{static create(t,i=[],r={}){let s=t.graph.hoistedAwaitKeyword?Object.getPrototypeOf(async function(){}).constructor:Function,n=r.compileFunction?r.compileFunction(t.source,[t.identifier+""].concat(i)):new s(t.identifier+"",...i,t.source);return new this(null,t.graph,n,r)}constructor(t,i,r,s={},n=null){super(t,i,r,s={},n),this.observers=[]}observe(t,i){this.params.devMode,this.observers.push({contractUrl:t,callback:i})}fire(t,i,r){(this.observers||[]).forEach(s=>{s.contractUrl===t&&s.callback(i,r)})}};function Pt(e,t=!1){let i=e.split(/\n/g);if(i.length>1){for(;!i[0].trim().length;)i.shift();let r=i[t?1:0].split(/[^\s]/)[0].length;if(r)return i.map((s,n)=>{let a=s.substring(0,r);return a.trim().length?a.trim()==="}"&&n===i.length-1?"}":s:s.substring(r)}).join(`
7
- `)}return e}function I(...e){let t=typeof e[e.length-1]=="object"?e.pop():{};t.compilerParams={...I.compilerParams,...t.compilerParams||{}},t.runtimeParams={...I.runtimeParams,...t.runtimeParams||{}};let i=Pt(e.pop()||""),r,s=e;if(I.cache[i]&&!t.compilerParams.devMode&&Ot(s,I.cache[i][1])&&Tt(t.compilerParams,I.cache[i][2]))[r,s]=I.cache[i];else{let n=Nt(i);r=new Ae(t.compilerParams).generate(n),I.cache[i]=[r,s,t.compilerParams]}return bi(this,r,e,t.runtimeParams,i)}I.cache={};I.compilerParams={globalsNoObserve:[],globalsOnlyPaths:!1,compact:2};I.runtimeParams={};I.cloneCache={};I.clone=function(e,t=null,i={},r={}){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=Pt(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 c,p=n.split(/\](?:[\s]+)?\(/g).filter(m=>m);[c,n]=p.reduce((m,d,g)=>{if(Array.isArray(m))return m;d=`${m}${d||""}]`;try{return Nt(d),[d,`${e.name}(${p.slice(g+1).join("] (")}`]}catch{return`${d} (`}},"")}n="function "+n}let u,l,h;if(I.cloneCache[n]&&!i.devMode&&Tt(i,I.cloneCache[n][3]))[u,l,h]=I.cloneCache[n];else{let c=Nt(n).body[0],p=c.body.start+1;n.substr(p,1)===`
8
- `&&(p+=1);let m=new Ae({...i,...I.compilerParams,locStart:-p});l=c.params.map(d=>m.serialize(d)),u=m.generate({type:"Program",body:c.body.body}),!u.graph.hoistedAwaitKeyword&&a&&(u.graph.hoistedAwaitKeyword=!0),h=n.substring(p,c.body.end-1),I.cloneCache[n]=[u,l,h,i]}return bi(t,u,l,r,h,e.name)};var bi=function(e,t,i=[],r={},s=null,n=null){let a=Le.create(t,i,{...r,...I.runtimeParams}),u=function(...h){try{return a.call(this===void 0?e:this,...h)}catch(c){throw console.info("-----------------------"),console.log(s||""),console.info("-----------------------"),c}};u.thread=a.thread.bind(a),u.dispose=a.dispose.bind(a),Object.defineProperty(u,"runtime",{value:a}),Object.defineProperty(u,"sideEffects",{configurable:!0,value:a.graph.sideEffects}),Object.defineProperty(u,"subscriptSource",{configurable:!0,value:t.source}),Object.defineProperty(u,"originalSource",{configurable:!0,value:s}),Object.defineProperty(u,"length",{configurable:!0,value:i.length}),Object.defineProperty(u,"name",{configurable:!0,value:n});let l=(t.graph.hoistedAwaitKeyword?"async ":"")+"function"+(n?" "+n:"");return u.toString=()=>`${l}(${i.join(", ")}) {${s}}`,u},yi=new Map,Nt=function(e,t={}){t={ecmaVersion:"2020",allowReturnOutsideFunction:!0,allowAwaitOutsideFunction:!0,allowSuperOutsideMethod:!0,preserveParens:!1,...t};let i=yi.get(e);return i||(i=Lt.parse(e,t),yi.set(e,i)),i},Ot=(e,t)=>typeof e=="object"&&e&&typeof t=="object"&&t?Tt(e,t):Array.isArray(e)&&Array.isArray(t)&&e.length===t.length?e.every(i=>t.some(r=>Ot(i,r))):e===t,Tt=function(e,t){for(let i in e)if(!Ot(e[i],t[i]))return!1;return!0};var Ft=e=>class extends(e||class{}){static get compilerParams(){return{}}static get runtimeParams(){return{}}static get subscriptMethods(){return[]}static implementMethod(t,i=null){return I.clone(t,i,this.compilerParams,this.runtimeParams)}constructor(){super();let t=this.constructor;t.subscriptMethods.forEach(i=>{if(!this[i])throw new Error(`${i} is not a method.`);if(i==="constructor")throw new Error("Class constructors cannot be subscript methods.");this[i]=t.implementMethod(this[i],this)})}};var br=[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],Ci=[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],vr="\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",Ei="\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",Rt={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"},Vt="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",wr={5:Vt,"5module":Vt+" export import",6:Vt+" const class extends export import super"},Sr=/^in(stanceof)?$/,_r=new RegExp("["+Ei+"]"),Cr=new RegExp("["+Ei+vr+"]");function Dt(e,t){for(var i=65536,r=0;r<t.length;r+=2){if(i+=t[r],i>e)return!1;if(i+=t[r+1],i>=e)return!0}}function ce(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&_r.test(String.fromCharCode(e)):t===!1?!1:Dt(e,Ci)}function Fe(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&&Cr.test(String.fromCharCode(e)):t===!1?!1:Dt(e,Ci)||Dt(e,br)}var k=function(t,i){i===void 0&&(i={}),this.label=t,this.keyword=i.keyword,this.beforeExpr=!!i.beforeExpr,this.startsExpr=!!i.startsExpr,this.isLoop=!!i.isLoop,this.isAssign=!!i.isAssign,this.prefix=!!i.prefix,this.postfix=!!i.postfix,this.binop=i.binop||null,this.updateContext=null};function j(e,t){return new k(e,{beforeExpr:!0,binop:t})}var W={beforeExpr:!0},B={startsExpr:!0},$t={};function C(e,t){return t===void 0&&(t={}),t.keyword=e,$t[e]=new k(e,t)}var o={num:new k("num",B),regexp:new k("regexp",B),string:new k("string",B),name:new k("name",B),privateId:new k("privateId",B),eof:new k("eof"),bracketL:new k("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new k("]"),braceL:new k("{",{beforeExpr:!0,startsExpr:!0}),braceR:new k("}"),parenL:new k("(",{beforeExpr:!0,startsExpr:!0}),parenR:new k(")"),comma:new k(",",W),semi:new k(";",W),colon:new k(":",W),dot:new k("."),question:new k("?",W),questionDot:new k("?."),arrow:new k("=>",W),template:new k("template"),invalidTemplate:new k("invalidTemplate"),ellipsis:new k("...",W),backQuote:new k("`",B),dollarBraceL:new k("${",{beforeExpr:!0,startsExpr:!0}),eq:new k("=",{beforeExpr:!0,isAssign:!0}),assign:new k("_=",{beforeExpr:!0,isAssign:!0}),incDec:new k("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new k("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:j("||",1),logicalAND:j("&&",2),bitwiseOR:j("|",3),bitwiseXOR:j("^",4),bitwiseAND:j("&",5),equality:j("==/!=/===/!==",6),relational:j("</>/<=/>=",7),bitShift:j("<</>>/>>>",8),plusMin:new k("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:j("%",10),star:j("*",10),slash:j("/",10),starstar:new k("**",{beforeExpr:!0}),coalesce:j("??",1),_break:C("break"),_case:C("case",W),_catch:C("catch"),_continue:C("continue"),_debugger:C("debugger"),_default:C("default",W),_do:C("do",{isLoop:!0,beforeExpr:!0}),_else:C("else",W),_finally:C("finally"),_for:C("for",{isLoop:!0}),_function:C("function",B),_if:C("if"),_return:C("return",W),_switch:C("switch"),_throw:C("throw",W),_try:C("try"),_var:C("var"),_const:C("const"),_while:C("while",{isLoop:!0}),_with:C("with"),_new:C("new",{beforeExpr:!0,startsExpr:!0}),_this:C("this",B),_super:C("super",B),_class:C("class",B),_extends:C("extends",W),_export:C("export"),_import:C("import",B),_null:C("null",B),_true:C("true",B),_false:C("false",B),_in:C("in",{beforeExpr:!0,binop:7}),_instanceof:C("instanceof",{beforeExpr:!0,binop:7}),_typeof:C("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:C("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:C("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},Q=/\r\n?|\n|\u2028|\u2029/,Er=new RegExp(Q.source,"g");function Re(e){return e===10||e===13||e===8232||e===8233}function ki(e,t,i){i===void 0&&(i=e.length);for(var r=t;r<i;r++){var s=e.charCodeAt(r);if(Re(s))return r<i-1&&s===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var Ai=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,z=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Ii=Object.prototype,kr=Ii.hasOwnProperty,Ar=Ii.toString,Ke=Object.hasOwn||function(e,t){return kr.call(e,t)},vi=Array.isArray||function(e){return Ar.call(e)==="[object Array]"};function Ie(e){return new RegExp("^(?:"+e.replace(/ /g,"|")+")$")}function xe(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var Ir=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,He=function(t,i){this.line=t,this.column=i};He.prototype.offset=function(t){return new He(this.line,this.column+t)};var ft=function(t,i,r){this.start=i,this.end=r,t.sourceFile!==null&&(this.source=t.sourceFile)};function Pi(e,t){for(var i=1,r=0;;){var s=ki(e,r,t);if(s<0)return new He(i,t-r);++i,r=s}}var Bt={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},wi=!1;function Pr(e){var t={};for(var i in Bt)t[i]=e&&Ke(e,i)?e[i]:Bt[i];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!wi&&typeof console=="object"&&console.warn&&(wi=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
9
- 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),vi(t.onToken)){var r=t.onToken;t.onToken=function(s){return r.push(s)}}return vi(t.onComment)&&(t.onComment=Nr(t,t.onComment)),t}function Nr(e,t){return function(i,r,s,n,a,u){var l={type:i?"Block":"Line",value:r,start:s,end:n};e.locations&&(l.loc=new ft(this,a,u)),e.ranges&&(l.range=[s,n]),t.push(l)}}var Ge=1,Ve=2,Ut=4,Ni=8,Oi=16,Ti=32,jt=64,Li=128,Je=256,Wt=Ge|Ve|Je;function zt(e,t){return Ve|(e?Ut:0)|(t?Ni:0)}var lt=0,Qt=1,he=2,Fi=3,Ri=4,Vi=5,T=function(t,i,r){this.options=t=Pr(t),this.sourceFile=t.sourceFile,this.keywords=Ie(wr[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var s="";t.allowReserved!==!0&&(s=Rt[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(s+=" await")),this.reservedWords=Ie(s);var n=(s?s+" ":"")+Rt.strict;this.reservedWordsStrict=Ie(n),this.reservedWordsStrictBind=Ie(n+" "+Rt.strictBind),this.input=String(i),this.containsEsc=!1,r?(this.pos=r,this.lineStart=this.input.lastIndexOf(`
10
- `,r-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(Q).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=o.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(Ge),this.regexpState=null,this.privateNameStack=[]},ne={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}};T.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)};ne.inFunction.get=function(){return(this.currentVarScope().flags&Ve)>0};ne.inGenerator.get=function(){return(this.currentVarScope().flags&Ni)>0&&!this.currentVarScope().inClassFieldInit};ne.inAsync.get=function(){return(this.currentVarScope().flags&Ut)>0&&!this.currentVarScope().inClassFieldInit};ne.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e];if(t.inClassFieldInit||t.flags&Je)return!1;if(t.flags&Ve)return(t.flags&Ut)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};ne.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(t&jt)>0||i||this.options.allowSuperOutsideMethod};ne.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Li)>0};ne.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};ne.allowNewDotTarget.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(t&(Ve|Je))>0||i};ne.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Je)>0};T.extend=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];for(var r=this,s=0;s<t.length;s++)r=t[s](r);return r};T.parse=function(t,i){return new this(i,t).parse()};T.parseExpressionAt=function(t,i,r){var s=new this(r,t,i);return s.nextToken(),s.parseExpression()};T.tokenizer=function(t,i){return new this(i,t)};Object.defineProperties(T.prototype,ne);var D=T.prototype,Or=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;D.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){z.lastIndex=e,e+=z.exec(this.input)[0].length;var t=Or.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){z.lastIndex=e+t[0].length;var i=z.exec(this.input),r=i.index+i[0].length,s=this.input.charAt(r);return s===";"||s==="}"||Q.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(s)||s==="!"&&this.input.charAt(r+1)==="=")}e+=t[0].length,z.lastIndex=e,e+=z.exec(this.input)[0].length,this.input[e]===";"&&e++}};D.eat=function(e){return this.type===e?(this.next(),!0):!1};D.isContextual=function(e){return this.type===o.name&&this.value===e&&!this.containsEsc};D.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};D.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};D.canInsertSemicolon=function(){return this.type===o.eof||this.type===o.braceR||Q.test(this.input.slice(this.lastTokEnd,this.start))};D.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};D.semicolon=function(){!this.eat(o.semi)&&!this.insertSemicolon()&&this.unexpected()};D.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0};D.expect=function(e){this.eat(e)||this.unexpected()};D.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var pt=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};D.checkPatternErrors=function(e,t){if(!!e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var i=t?e.parenthesizedAssign:e.parenthesizedBind;i>-1&&this.raiseRecoverable(i,"Parenthesized pattern")}};D.checkExpressionErrors=function(e,t){if(!e)return!1;var i=e.shorthandAssign,r=e.doubleProto;if(!t)return i>=0||r>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),r>=0&&this.raiseRecoverable(r,"Redefinition of __proto__ property")};D.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")};D.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var v=T.prototype;v.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==o.eof;){var i=this.parseStatement(null,!0,t);e.body.push(i)}if(this.inModule)for(var r=0,s=Object.keys(this.undefinedExports);r<s.length;r+=1){var n=s[r];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 Ht={kind:"loop"},Tr={kind:"switch"};v.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;z.lastIndex=this.pos;var t=z.exec(this.input),i=this.pos+t[0].length,r=this.input.charCodeAt(i);if(r===91||r===92||r>55295&&r<56320)return!0;if(e)return!1;if(r===123)return!0;if(ce(r,!0)){for(var s=i+1;Fe(r=this.input.charCodeAt(s),!0);)++s;if(r===92||r>55295&&r<56320)return!0;var n=this.input.slice(i,s);if(!Sr.test(n))return!0}return!1};v.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;z.lastIndex=this.pos;var e=z.exec(this.input),t=this.pos+e[0].length,i;return!Q.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(Fe(i=this.input.charCodeAt(t+8))||i>55295&&i<56320))};v.parseStatement=function(e,t,i){var r=this.type,s=this.startNode(),n;switch(this.isLet(e)&&(r=o._var,n="let"),r){case o._break:case o._continue:return this.parseBreakContinueStatement(s,r.keyword);case o._debugger:return this.parseDebuggerStatement(s);case o._do:return this.parseDoStatement(s);case o._for:return this.parseForStatement(s);case o._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(s,!1,!e);case o._class:return e&&this.unexpected(),this.parseClass(s,!0);case o._if:return this.parseIfStatement(s);case o._return:return this.parseReturnStatement(s);case o._switch:return this.parseSwitchStatement(s);case o._throw:return this.parseThrowStatement(s);case o._try:return this.parseTryStatement(s);case o._const:case o._var:return n=n||this.value,e&&n!=="var"&&this.unexpected(),this.parseVarStatement(s,n);case o._while:return this.parseWhileStatement(s);case o._with:return this.parseWithStatement(s);case o.braceL:return this.parseBlock(!0,s);case o.semi:return this.parseEmptyStatement(s);case o._export:case o._import:if(this.options.ecmaVersion>10&&r===o._import){z.lastIndex=this.pos;var a=z.exec(this.input),u=this.pos+a[0].length,l=this.input.charCodeAt(u);if(l===40||l===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'")),r===o._import?this.parseImport(s):this.parseExport(s,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(s,!0,!e);var h=this.value,c=this.parseExpression();return r===o.name&&c.type==="Identifier"&&this.eat(o.colon)?this.parseLabeledStatement(s,h,c,e):this.parseExpressionStatement(s,c)}};v.parseBreakContinueStatement=function(e,t){var i=t==="break";this.next(),this.eat(o.semi)||this.insertSemicolon()?e.label=null:this.type!==o.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var r=0;r<this.labels.length;++r){var s=this.labels[r];if((e.label==null||s.name===e.label.name)&&(s.kind!=null&&(i||s.kind==="loop")||e.label&&i))break}return r===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,i?"BreakStatement":"ContinueStatement")};v.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")};v.parseDoStatement=function(e){return this.next(),this.labels.push(Ht),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(o._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(o.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};v.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Ht),this.enterScope(0),this.expect(o.parenL),this.type===o.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===o._var||this.type===o._const||i){var r=this.startNode(),s=i?"let":this.value;return this.next(),this.parseVar(r,!0,s),this.finishNode(r,"VariableDeclaration"),(this.type===o._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&r.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===o._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,r)):(t>-1&&this.unexpected(t),this.parseFor(e,r))}var n=this.isContextual("let"),a=!1,u=new pt,l=this.parseExpression(t>-1?"await":!0,u);return this.type===o._in||(a=this.options.ecmaVersion>=6&&this.isContextual("of"))?(this.options.ecmaVersion>=9&&(this.type===o._in?t>-1&&this.unexpected(t):e.await=t>-1),n&&a&&this.raise(l.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(l,!1,u),this.checkLValPattern(l),this.parseForIn(e,l)):(this.checkExpressionErrors(u,!0),t>-1&&this.unexpected(t),this.parseFor(e,l))};v.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,Qe|(i?0:qt),!1,t)};v.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(o._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};v.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(o.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};v.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(o.braceL),this.labels.push(Tr),this.enterScope(0);for(var t,i=!1;this.type!==o.braceR;)if(this.type===o._case||this.type===o._default){var r=this.type===o._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,t.test=null),this.expect(o.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")};v.parseThrowStatement=function(e){return this.next(),Q.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 Lr=[];v.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===o._catch){var t=this.startNode();if(this.next(),this.eat(o.parenL)){t.param=this.parseBindingAtom();var i=t.param.type==="Identifier";this.enterScope(i?Ti:0),this.checkLValPattern(t.param,i?Ri:he),this.expect(o.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(o._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};v.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")};v.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Ht),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};v.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")};v.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};v.parseLabeledStatement=function(e,t,i,r){for(var s=0,n=this.labels;s<n.length;s+=1){var a=n[s];a.name===t&&this.raise(i.start,"Label '"+t+"' is already declared")}for(var u=this.type.isLoop?"loop":this.type===o._switch?"switch":null,l=this.labels.length-1;l>=0;l--){var h=this.labels[l];if(h.statementStart===e.start)h.statementStart=this.start,h.kind=u;else break}return this.labels.push({name:t,kind:u,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf("label")===-1?r+"label":r:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")};v.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")};v.parseBlock=function(e,t,i){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(o.braceL),e&&this.enterScope(0);this.type!==o.braceR;){var r=this.parseStatement(null);t.body.push(r)}return i&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")};v.parseFor=function(e,t){return e.init=t,this.expect(o.semi),e.test=this.type===o.semi?null:this.parseExpression(),this.expect(o.semi),e.update=this.type===o.parenR?null:this.parseExpression(),this.expect(o.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};v.parseForIn=function(e,t){var i=this.type===o._in;return this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")&&this.raise(t.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(o.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")};v.parseVar=function(e,t,i){for(e.declarations=[],e.kind=i;;){var r=this.startNode();if(this.parseVarId(r,i),this.eat(o.eq)?r.init=this.parseMaybeAssign(t):i==="const"&&!(this.type===o._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():r.id.type!=="Identifier"&&!(t&&(this.type===o._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):r.init=null,e.declarations.push(this.finishNode(r,"VariableDeclarator")),!this.eat(o.comma))break}return e};v.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?Qt:he,!1)};var Qe=1,qt=2,Mi=4;v.parseFunction=function(e,t,i,r,s){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===o.star&&t&qt&&this.unexpected(),e.generator=this.eat(o.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&Qe&&(e.id=t&Mi&&this.type!==o.name?null:this.parseIdent(),e.id&&!(t&qt)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?Qt:he:Fi));var n=this.yieldPos,a=this.awaitPos,u=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(zt(e.async,e.generator)),t&Qe||(e.id=this.type===o.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,!1,s),this.yieldPos=n,this.awaitPos=a,this.awaitIdentPos=u,this.finishNode(e,t&Qe?"FunctionDeclaration":"FunctionExpression")};v.parseFunctionParams=function(e){this.expect(o.parenL),e.params=this.parseBindingList(o.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};v.parseClass=function(e,t){this.next();var i=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),s=this.startNode(),n=!1;for(s.body=[],this.expect(o.braceL);this.type!==o.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"&&Fr(r,a)&&this.raiseRecoverable(a.key.start,"Identifier '#"+a.key.name+"' has already been declared"))}return this.strict=i,this.next(),e.body=this.finishNode(s,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")};v.parseClassElement=function(e){if(this.eat(o.semi))return null;var t=this.options.ecmaVersion,i=this.startNode(),r="",s=!1,n=!1,a="method",u=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(o.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===o.star?u=!0:r="static"}if(i.static=u,!r&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===o.star)&&!this.canInsertSemicolon()?n=!0:r="async"),!r&&(t>=9||!n)&&this.eat(o.star)&&(s=!0),!r&&!n&&!s){var l=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?a=l:r=l)}if(r?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=r,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),t<13||this.type===o.parenL||a!=="method"||s||n){var h=!i.static&&ht(i,"constructor"),c=h&&e;h&&a!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=h?"constructor":a,this.parseClassMethod(i,s,n,c)}else this.parseClassField(i);return i};v.isClassElementNameStart=function(){return this.type===o.name||this.type===o.privateId||this.type===o.num||this.type===o.string||this.type===o.bracketL||this.type.keyword};v.parseClassElementName=function(e){this.type===o.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)};v.parseClassMethod=function(e,t,i,r){var s=e.key;e.kind==="constructor"?(t&&this.raise(s.start,"Constructor can't be a generator"),i&&this.raise(s.start,"Constructor can't be an async method")):e.static&&ht(e,"prototype")&&this.raise(s.start,"Classes may not have a static property named prototype");var n=e.value=this.parseMethod(t,i,r);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")};v.parseClassField=function(e){if(ht(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&ht(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(o.eq)){var t=this.currentThisScope(),i=t.inClassFieldInit;t.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),t.inClassFieldInit=i}else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")};v.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(Je|jt);this.type!==o.braceR;){var i=this.parseStatement(null);e.body.push(i)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")};v.parseClassId=function(e,t){this.type===o.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,he,!1)):(t===!0&&this.unexpected(),e.id=null)};v.parseClassSuper=function(e){e.superClass=this.eat(o._extends)?this.parseExprSubscripts(!1):null};v.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};v.exitClassBody=function(){for(var e=this.privateNameStack.pop(),t=e.declared,i=e.used,r=this.privateNameStack.length,s=r===0?null:this.privateNameStack[r-1],n=0;n<i.length;++n){var a=i[n];Ke(t,a.name)||(s?s.used.push(a):this.raiseRecoverable(a.start,"Private field '#"+a.name+"' must be declared in an enclosing class"))}};function Fr(e,t){var i=t.key.name,r=e[i],s="true";return t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set")&&(s=(t.static?"s":"i")+t.kind),r==="iget"&&s==="iset"||r==="iset"&&s==="iget"||r==="sget"&&s==="sset"||r==="sset"&&s==="sget"?(e[i]="true",!1):r?!0:(e[i]=s,!1)}function ht(e,t){var i=e.computed,r=e.key;return!i&&(r.type==="Identifier"&&r.name===t||r.type==="Literal"&&r.value===t)}v.parseExport=function(e,t){if(this.next(),this.eat(o.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!==o.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(o._default)){this.checkExport(t,"default",this.lastTokStart);var i;if(this.type===o._function||(i=this.isAsyncFunction())){var r=this.startNode();this.next(),i&&this.next(),e.declaration=this.parseFunction(r,Qe|Mi,!1,i)}else if(this.type===o._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!==o.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var n=0,a=e.specifiers;n<a.length;n+=1){var u=a[n];this.checkUnreserved(u.local),this.checkLocalExport(u.local),u.local.type==="Literal"&&this.raise(u.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")};v.checkExport=function(e,t,i){!e||(typeof t!="string"&&(t=t.type==="Identifier"?t.name:t.value),Ke(e,t)&&this.raiseRecoverable(i,"Duplicate export '"+t+"'"),e[t]=!0)};v.checkPatternExport=function(e,t){var i=t.type;if(i==="Identifier")this.checkExport(e,t,t.start);else if(i==="ObjectPattern")for(var r=0,s=t.properties;r<s.length;r+=1){var n=s[r];this.checkPatternExport(e,n)}else if(i==="ArrayPattern")for(var a=0,u=t.elements;a<u.length;a+=1){var l=u[a];l&&this.checkPatternExport(e,l)}else i==="Property"?this.checkPatternExport(e,t.value):i==="AssignmentPattern"?this.checkPatternExport(e,t.left):i==="RestElement"?this.checkPatternExport(e,t.argument):i==="ParenthesizedExpression"&&this.checkPatternExport(e,t.expression)};v.checkVariableExport=function(e,t){if(!!e)for(var i=0,r=t;i<r.length;i+=1){var s=r[i];this.checkPatternExport(e,s.id)}};v.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};v.parseExportSpecifiers=function(e){var t=[],i=!0;for(this.expect(o.braceL);!this.eat(o.braceR);){if(i)i=!1;else if(this.expect(o.comma),this.afterTrailingComma(o.braceR))break;var r=this.startNode();r.local=this.parseModuleExportName(),r.exported=this.eatContextual("as")?this.parseModuleExportName():r.local,this.checkExport(e,r.exported,r.exported.start),t.push(this.finishNode(r,"ExportSpecifier"))}return t};v.parseImport=function(e){return this.next(),this.type===o.string?(e.specifiers=Lr,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===o.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(e,"ImportDeclaration")};v.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===o.name){var i=this.startNode();if(i.local=this.parseIdent(),this.checkLValSimple(i.local,he),e.push(this.finishNode(i,"ImportDefaultSpecifier")),!this.eat(o.comma))return e}if(this.type===o.star){var r=this.startNode();return this.next(),this.expectContextual("as"),r.local=this.parseIdent(),this.checkLValSimple(r.local,he),e.push(this.finishNode(r,"ImportNamespaceSpecifier")),e}for(this.expect(o.braceL);!this.eat(o.braceR);){if(t)t=!1;else if(this.expect(o.comma),this.afterTrailingComma(o.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,he),e.push(this.finishNode(s,"ImportSpecifier"))}return e};v.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===o.string){var e=this.parseLiteral(this.value);return Ir.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)};v.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)};v.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 Z=T.prototype;Z.toAssignable=function(e,t,i){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",i&&this.checkPatternErrors(i,!0);for(var r=0,s=e.properties;r<s.length;r+=1){var n=s[r];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",i&&this.checkPatternErrors(i,!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,i);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 i&&this.checkPatternErrors(i,!0);return e};Z.toAssignableList=function(e,t){for(var i=e.length,r=0;r<i;r++){var s=e[r];s&&this.toAssignable(s,t)}if(i){var n=e[i-1];this.options.ecmaVersion===6&&t&&n&&n.type==="RestElement"&&n.argument.type!=="Identifier"&&this.unexpected(n.argument.start)}return e};Z.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")};Z.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==o.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")};Z.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case o.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(o.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case o.braceL:return this.parseObj(!0)}return this.parseIdent()};Z.parseBindingList=function(e,t,i){for(var r=[],s=!0;!this.eat(e);)if(s?s=!1:this.expect(o.comma),t&&this.type===o.comma)r.push(null);else{if(i&&this.afterTrailingComma(e))break;if(this.type===o.ellipsis){var n=this.parseRestBinding();this.parseBindingListItem(n),r.push(n),this.type===o.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),r.push(a)}}return r};Z.parseBindingListItem=function(e){return e};Z.parseMaybeDefault=function(e,t,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(o.eq))return i;var r=this.startNodeAt(e,t);return r.left=i,r.right=this.parseMaybeAssign(),this.finishNode(r,"AssignmentPattern")};Z.checkLValSimple=function(e,t,i){t===void 0&&(t=lt);var r=t!==lt;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?"Binding ":"Assigning to ")+e.name+" in strict mode"),r&&(t===he&&e.name==="let"&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),i&&(Ke(i,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),i[e.name]=!0),t!==Vi&&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":r&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return r&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,i);default:this.raise(e.start,(r?"Binding":"Assigning to")+" rvalue")}};Z.checkLValPattern=function(e,t,i){switch(t===void 0&&(t=lt),e.type){case"ObjectPattern":for(var r=0,s=e.properties;r<s.length;r+=1){var n=s[r];this.checkLValInnerPattern(n,t,i)}break;case"ArrayPattern":for(var a=0,u=e.elements;a<u.length;a+=1){var l=u[a];l&&this.checkLValInnerPattern(l,t,i)}break;default:this.checkLValSimple(e,t,i)}};Z.checkLValInnerPattern=function(e,t,i){switch(t===void 0&&(t=lt),e.type){case"Property":this.checkLValInnerPattern(e.value,t,i);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,i);break;case"RestElement":this.checkLValPattern(e.argument,t,i);break;default:this.checkLValPattern(e,t,i)}};var X=function(t,i,r,s,n){this.token=t,this.isExpr=!!i,this.preserveSpace=!!r,this.override=s,this.generator=!!n},P={b_stat:new X("{",!1),b_expr:new X("{",!0),b_tmpl:new X("${",!1),p_stat:new X("(",!1),p_expr:new X("(",!0),q_tmpl:new X("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new X("function",!1),f_expr:new X("function",!0),f_expr_gen:new X("function",!0,!1,null,!0),f_gen:new X("function",!1,!1,null,!0)},Me=T.prototype;Me.initialContext=function(){return[P.b_stat]};Me.curContext=function(){return this.context[this.context.length-1]};Me.braceIsBlock=function(e){var t=this.curContext();return t===P.f_expr||t===P.f_stat?!0:e===o.colon&&(t===P.b_stat||t===P.b_expr)?!t.isExpr:e===o._return||e===o.name&&this.exprAllowed?Q.test(this.input.slice(this.lastTokEnd,this.start)):e===o._else||e===o.semi||e===o.eof||e===o.parenR||e===o.arrow?!0:e===o.braceL?t===P.b_stat:e===o._var||e===o._const||e===o.name?!1:!this.exprAllowed};Me.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};Me.updateContext=function(e){var t,i=this.type;i.keyword&&e===o.dot?this.exprAllowed=!1:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr};Me.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)};o.parenR.updateContext=o.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();e===P.b_stat&&this.curContext().token==="function"&&(e=this.context.pop()),this.exprAllowed=!e.isExpr};o.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?P.b_stat:P.b_expr),this.exprAllowed=!0};o.dollarBraceL.updateContext=function(){this.context.push(P.b_tmpl),this.exprAllowed=!0};o.parenL.updateContext=function(e){var t=e===o._if||e===o._for||e===o._with||e===o._while;this.context.push(t?P.p_stat:P.p_expr),this.exprAllowed=!0};o.incDec.updateContext=function(){};o._function.updateContext=o._class.updateContext=function(e){e.beforeExpr&&e!==o._else&&!(e===o.semi&&this.curContext()!==P.p_stat)&&!(e===o._return&&Q.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===o.colon||e===o.braceL)&&this.curContext()===P.b_stat)?this.context.push(P.f_expr):this.context.push(P.f_stat),this.exprAllowed=!1};o.backQuote.updateContext=function(){this.curContext()===P.q_tmpl?this.context.pop():this.context.push(P.q_tmpl),this.exprAllowed=!1};o.star.updateContext=function(e){if(e===o._function){var t=this.context.length-1;this.context[t]===P.f_expr?this.context[t]=P.f_expr_gen:this.context[t]=P.f_gen}this.exprAllowed=!0};o.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==o.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var S=T.prototype;S.checkPropClash=function(e,t,i){if(!(this.options.ecmaVersion>=9&&e.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,s;switch(r.type){case"Identifier":s=r.name;break;case"Literal":s=String(r.value);break;default:return}var n=e.kind;if(this.options.ecmaVersion>=6){s==="__proto__"&&n==="init"&&(t.proto&&(i?i.doubleProto<0&&(i.doubleProto=r.start):this.raiseRecoverable(r.start,"Redefinition of __proto__ property")),t.proto=!0);return}s="$"+s;var a=t[s];if(a){var u;n==="init"?u=this.strict&&a.init||a.get||a.set:u=a.init||a[n],u&&this.raiseRecoverable(r.start,"Redefinition of property")}else a=t[s]={init:!1,get:!1,set:!1};a[n]=!0}};S.parseExpression=function(e,t){var i=this.start,r=this.startLoc,s=this.parseMaybeAssign(e,t);if(this.type===o.comma){var n=this.startNodeAt(i,r);for(n.expressions=[s];this.eat(o.comma);)n.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(n,"SequenceExpression")}return s};S.parseMaybeAssign=function(e,t,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,s=-1,n=-1,a=-1;t?(s=t.parenthesizedAssign,n=t.trailingComma,a=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new pt,r=!0);var u=this.start,l=this.startLoc;(this.type===o.parenL||this.type===o.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await");var h=this.parseMaybeConditional(e,t);if(i&&(h=i.call(this,h,u,l)),this.type.isAssign){var c=this.startNodeAt(u,l);return c.operator=this.value,this.type===o.eq&&(h=this.toAssignable(h,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=h.start&&(t.shorthandAssign=-1),this.type===o.eq?this.checkLValPattern(h):this.checkLValSimple(h),c.left=h,this.next(),c.right=this.parseMaybeAssign(e),a>-1&&(t.doubleProto=a),this.finishNode(c,"AssignmentExpression")}else r&&this.checkExpressionErrors(t,!0);return s>-1&&(t.parenthesizedAssign=s),n>-1&&(t.trailingComma=n),h};S.parseMaybeConditional=function(e,t){var i=this.start,r=this.startLoc,s=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return s;if(this.eat(o.question)){var n=this.startNodeAt(i,r);return n.test=s,n.consequent=this.parseMaybeAssign(),this.expect(o.colon),n.alternate=this.parseMaybeAssign(e),this.finishNode(n,"ConditionalExpression")}return s};S.parseExprOps=function(e,t){var i=this.start,r=this.startLoc,s=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||s.start===i&&s.type==="ArrowFunctionExpression"?s:this.parseExprOp(s,i,r,-1,e)};S.parseExprOp=function(e,t,i,r,s){var n=this.type.binop;if(n!=null&&(!s||this.type!==o._in)&&n>r){var a=this.type===o.logicalOR||this.type===o.logicalAND,u=this.type===o.coalesce;u&&(n=o.logicalAND.binop);var l=this.value;this.next();var h=this.start,c=this.startLoc,p=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,s),h,c,n,s),m=this.buildBinary(t,i,e,p,l,a||u);return(a&&this.type===o.coalesce||u&&(this.type===o.logicalOR||this.type===o.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(m,t,i,r,s)}return e};S.buildBinary=function(e,t,i,r,s,n){r.type==="PrivateIdentifier"&&this.raise(r.start,"Private identifier can only be left side of binary expression");var a=this.startNodeAt(e,t);return a.left=i,a.operator=s,a.right=r,this.finishNode(a,n?"LogicalExpression":"BinaryExpression")};S.parseMaybeUnary=function(e,t,i,r){var s=this.start,n=this.startLoc,a;if(this.isContextual("await")&&this.canAwait)a=this.parseAwait(r),t=!0;else if(this.type.prefix){var u=this.startNode(),l=this.type===o.incDec;u.operator=this.value,u.prefix=!0,this.next(),u.argument=this.parseMaybeUnary(null,!0,l,r),this.checkExpressionErrors(e,!0),l?this.checkLValSimple(u.argument):this.strict&&u.operator==="delete"&&u.argument.type==="Identifier"?this.raiseRecoverable(u.start,"Deleting local variable in strict mode"):u.operator==="delete"&&Di(u.argument)?this.raiseRecoverable(u.start,"Private fields can not be deleted"):t=!0,a=this.finishNode(u,l?"UpdateExpression":"UnaryExpression")}else if(!t&&this.type===o.privateId)(r||this.privateNameStack.length===0)&&this.unexpected(),a=this.parsePrivateIdent(),this.type!==o._in&&this.unexpected();else{if(a=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return a;for(;this.type.postfix&&!this.canInsertSemicolon();){var h=this.startNodeAt(s,n);h.operator=this.value,h.prefix=!1,h.argument=a,this.checkLValSimple(a),this.next(),a=this.finishNode(h,"UpdateExpression")}}if(!i&&this.eat(o.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(s,n,a,this.parseMaybeUnary(null,!1,!1,r),"**",!1);else return a};function Di(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&Di(e.expression)}S.parseExprSubscripts=function(e,t){var i=this.start,r=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,i,r,!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};S.parseSubscripts=function(e,t,i,r,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 u=this.parseSubscript(e,t,i,r,n,a,s);if(u.optional&&(a=!0),u===e||u.type==="ArrowFunctionExpression"){if(a){var l=this.startNodeAt(t,i);l.expression=u,u=this.finishNode(l,"ChainExpression")}return u}e=u}};S.parseSubscript=function(e,t,i,r,s,n,a){var u=this.options.ecmaVersion>=11,l=u&&this.eat(o.questionDot);r&&l&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var h=this.eat(o.bracketL);if(h||l&&this.type!==o.parenL&&this.type!==o.backQuote||this.eat(o.dot)){var c=this.startNodeAt(t,i);c.object=e,h?(c.property=this.parseExpression(),this.expect(o.bracketR)):this.type===o.privateId&&e.type!=="Super"?c.property=this.parsePrivateIdent():c.property=this.parseIdent(this.options.allowReserved!=="never"),c.computed=!!h,u&&(c.optional=l),e=this.finishNode(c,"MemberExpression")}else if(!r&&this.eat(o.parenL)){var p=new pt,m=this.yieldPos,d=this.awaitPos,g=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var x=this.parseExprList(o.parenR,this.options.ecmaVersion>=8,!1,p);if(s&&!l&&!this.canInsertSemicolon()&&this.eat(o.arrow))return this.checkPatternErrors(p,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=m,this.awaitPos=d,this.awaitIdentPos=g,this.parseArrowExpression(this.startNodeAt(t,i),x,!0,a);this.checkExpressionErrors(p,!0),this.yieldPos=m||this.yieldPos,this.awaitPos=d||this.awaitPos,this.awaitIdentPos=g||this.awaitIdentPos;var y=this.startNodeAt(t,i);y.callee=e,y.arguments=x,u&&(y.optional=l),e=this.finishNode(y,"CallExpression")}else if(this.type===o.backQuote){(l||n)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var E=this.startNodeAt(t,i);E.tag=e,E.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(E,"TaggedTemplateExpression")}return e};S.parseExprAtom=function(e,t){this.type===o.slash&&this.readRegexp();var i,r=this.potentialArrowAt===this.start;switch(this.type){case o._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),i=this.startNode(),this.next(),this.type===o.parenL&&!this.allowDirectSuper&&this.raise(i.start,"super() call outside constructor of a subclass"),this.type!==o.dot&&this.type!==o.bracketL&&this.type!==o.parenL&&this.unexpected(),this.finishNode(i,"Super");case o._this:return i=this.startNode(),this.next(),this.finishNode(i,"ThisExpression");case o.name:var s=this.start,n=this.startLoc,a=this.containsEsc,u=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!a&&u.name==="async"&&!this.canInsertSemicolon()&&this.eat(o._function))return this.overrideContext(P.f_expr),this.parseFunction(this.startNodeAt(s,n),0,!1,!0,t);if(r&&!this.canInsertSemicolon()){if(this.eat(o.arrow))return this.parseArrowExpression(this.startNodeAt(s,n),[u],!1,t);if(this.options.ecmaVersion>=8&&u.name==="async"&&this.type===o.name&&!a&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return u=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(o.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(s,n),[u],!0,t)}return u;case o.regexp:var l=this.value;return i=this.parseLiteral(l.value),i.regex={pattern:l.pattern,flags:l.flags},i;case o.num:case o.string:return this.parseLiteral(this.value);case o._null:case o._true:case o._false:return i=this.startNode(),i.value=this.type===o._null?null:this.type===o._true,i.raw=this.type.keyword,this.next(),this.finishNode(i,"Literal");case o.parenL:var h=this.start,c=this.parseParenAndDistinguishExpression(r,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(c)&&(e.parenthesizedAssign=h),e.parenthesizedBind<0&&(e.parenthesizedBind=h)),c;case o.bracketL:return i=this.startNode(),this.next(),i.elements=this.parseExprList(o.bracketR,!0,!0,e),this.finishNode(i,"ArrayExpression");case o.braceL:return this.overrideContext(P.b_expr),this.parseObj(!1,e);case o._function:return i=this.startNode(),this.next(),this.parseFunction(i,0);case o._class:return this.parseClass(this.startNode(),!1);case o._new:return this.parseNew();case o.backQuote:return this.parseTemplate();case o._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}};S.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 o.parenL:return this.parseDynamicImport(e);case o.dot:return e.meta=t,this.parseImportMeta(e);default:this.unexpected()}};S.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(o.parenR)){var t=this.start;this.eat(o.comma)&&this.eat(o.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")};S.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")};S.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")};S.parseParenExpression=function(){this.expect(o.parenL);var e=this.parseExpression();return this.expect(o.parenR),e};S.parseParenAndDistinguishExpression=function(e,t){var i=this.start,r=this.startLoc,s,n=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var a=this.start,u=this.startLoc,l=[],h=!0,c=!1,p=new pt,m=this.yieldPos,d=this.awaitPos,g;for(this.yieldPos=0,this.awaitPos=0;this.type!==o.parenR;)if(h?h=!1:this.expect(o.comma),n&&this.afterTrailingComma(o.parenR,!0)){c=!0;break}else if(this.type===o.ellipsis){g=this.start,l.push(this.parseParenItem(this.parseRestBinding())),this.type===o.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}else l.push(this.parseMaybeAssign(!1,p,this.parseParenItem));var x=this.lastTokEnd,y=this.lastTokEndLoc;if(this.expect(o.parenR),e&&!this.canInsertSemicolon()&&this.eat(o.arrow))return this.checkPatternErrors(p,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=m,this.awaitPos=d,this.parseParenArrowList(i,r,l,t);(!l.length||c)&&this.unexpected(this.lastTokStart),g&&this.unexpected(g),this.checkExpressionErrors(p,!0),this.yieldPos=m||this.yieldPos,this.awaitPos=d||this.awaitPos,l.length>1?(s=this.startNodeAt(a,u),s.expressions=l,this.finishNodeAt(s,"SequenceExpression",x,y)):s=l[0]}else s=this.parseParenExpression();if(this.options.preserveParens){var E=this.startNodeAt(i,r);return E.expression=s,this.finishNode(E,"ParenthesizedExpression")}else return s};S.parseParenItem=function(e){return e};S.parseParenArrowList=function(e,t,i,r){return this.parseArrowExpression(this.startNodeAt(e,t),i,!1,r)};var Rr=[];S.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(o.dot)){e.meta=t;var i=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'"),i&&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 r=this.start,s=this.startLoc,n=this.type===o._import;return e.callee=this.parseSubscripts(this.parseExprAtom(),r,s,!0,!1),n&&e.callee.type==="ImportExpression"&&this.raise(r,"Cannot use new with import()"),this.eat(o.parenL)?e.arguments=this.parseExprList(o.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Rr,this.finishNode(e,"NewExpression")};S.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===o.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value,cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
11
- `),cooked:this.value},this.next(),i.tail=this.type===o.backQuote,this.finishNode(i,"TemplateElement")};S.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var i=this.startNode();this.next(),i.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(i.quasis=[r];!r.tail;)this.type===o.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(o.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(o.braceR),i.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")};S.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===o.name||this.type===o.num||this.type===o.string||this.type===o.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===o.star)&&!Q.test(this.input.slice(this.lastTokEnd,this.start))};S.parseObj=function(e,t){var i=this.startNode(),r=!0,s={};for(i.properties=[],this.next();!this.eat(o.braceR);){if(r)r=!1;else if(this.expect(o.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(o.braceR))break;var n=this.parseProperty(e,t);e||this.checkPropClash(n,s,t),i.properties.push(n)}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")};S.parseProperty=function(e,t){var i=this.startNode(),r,s,n,a;if(this.options.ecmaVersion>=9&&this.eat(o.ellipsis))return e?(i.argument=this.parseIdent(!1),this.type===o.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(this.type===o.parenL&&t&&(t.parenthesizedAssign<0&&(t.parenthesizedAssign=this.start),t.parenthesizedBind<0&&(t.parenthesizedBind=this.start)),i.argument=this.parseMaybeAssign(!1,t),this.type===o.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(i,"SpreadElement"));this.options.ecmaVersion>=6&&(i.method=!1,i.shorthand=!1,(e||t)&&(n=this.start,a=this.startLoc),e||(r=this.eat(o.star)));var u=this.containsEsc;return this.parsePropertyName(i),!e&&!u&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(i)?(s=!0,r=this.options.ecmaVersion>=9&&this.eat(o.star),this.parsePropertyName(i,t)):s=!1,this.parsePropertyValue(i,e,r,s,n,a,t,u),this.finishNode(i,"Property")};S.parsePropertyValue=function(e,t,i,r,s,n,a,u){if((i||r)&&this.type===o.colon&&this.unexpected(),this.eat(o.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===o.parenL)t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(i,r);else if(!t&&!u&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==o.comma&&this.type!==o.braceR&&this.type!==o.eq){(i||r)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var l=e.kind==="get"?0:1;if(e.value.params.length!==l){var h=e.value.start;e.kind==="get"?this.raiseRecoverable(h,"getter should have no params"):this.raiseRecoverable(h,"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"?((i||r)&&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===o.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()};S.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(o.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(o.bracketR),e.key;e.computed=!1}return e.key=this.type===o.num||this.type===o.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};S.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)};S.parseMethod=function(e,t,i){var r=this.startNode(),s=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(zt(t,r.generator)|jt|(i?Li:0)),this.expect(o.parenL),r.params=this.parseBindingList(o.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=s,this.awaitPos=n,this.awaitIdentPos=a,this.finishNode(r,"FunctionExpression")};S.parseArrowExpression=function(e,t,i,r){var s=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.enterScope(zt(i,!1)|Oi),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=s,this.awaitPos=n,this.awaitIdentPos=a,this.finishNode(e,"ArrowFunctionExpression")};S.parseFunctionBody=function(e,t,i,r){var s=t&&this.type!==o.braceL,n=this.strict,a=!1;if(s)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var u=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!n||u)&&(a=this.strictDirective(this.end),a&&u&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var l=this.labels;this.labels=[],a&&(this.strict=!0),this.checkParams(e,!n&&!a&&!t&&!i&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,Vi),e.body=this.parseBlock(!1,void 0,a&&!n),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=l}this.exitScope()};S.isSimpleParamList=function(e){for(var t=0,i=e;t<i.length;t+=1){var r=i[t];if(r.type!=="Identifier")return!1}return!0};S.checkParams=function(e,t){for(var i=Object.create(null),r=0,s=e.params;r<s.length;r+=1){var n=s[r];this.checkLValInnerPattern(n,Qt,t?null:i)}};S.parseExprList=function(e,t,i,r){for(var s=[],n=!0;!this.eat(e);){if(n)n=!1;else if(this.expect(o.comma),t&&this.afterTrailingComma(e))break;var a=void 0;i&&this.type===o.comma?a=null:this.type===o.ellipsis?(a=this.parseSpread(r),r&&this.type===o.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):a=this.parseMaybeAssign(!1,r),s.push(a)}return s};S.checkUnreserved=function(e){var t=e.start,i=e.end,r=e.name;if(this.inGenerator&&r==="yield"&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&r==="await"&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),this.currentThisScope().inClassFieldInit&&r==="arguments"&&this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(r==="arguments"||r==="await")&&this.raise(t,"Cannot use "+r+" in class static initialization block"),this.keywords.test(r)&&this.raise(t,"Unexpected keyword '"+r+"'"),!(this.options.ecmaVersion<6&&this.input.slice(t,i).indexOf("\\")!==-1)){var s=this.strict?this.reservedWordsStrict:this.reservedWords;s.test(r)&&(!this.inAsync&&r==="await"&&this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+r+"' is reserved"))}};S.parseIdent=function(e,t){var i=this.startNode();return this.type===o.name?i.name=this.value:this.type.keyword?(i.name=this.type.keyword,(i.name==="class"||i.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop()):this.unexpected(),this.next(!!e),this.finishNode(i,"Identifier"),e||(this.checkUnreserved(i),i.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=i.start)),i};S.parsePrivateIdent=function(){var e=this.startNode();return this.type===o.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};S.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===o.semi||this.canInsertSemicolon()||this.type!==o.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(o.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")};S.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 ct=T.prototype;ct.raise=function(e,t){var i=Pi(this.input,e);t+=" ("+i.line+":"+i.column+")";var r=new SyntaxError(t);throw r.pos=e,r.loc=i,r.raisedAt=this.pos,r};ct.raiseRecoverable=ct.raise;ct.curPosition=function(){if(this.options.locations)return new He(this.curLine,this.pos-this.lineStart)};var ye=T.prototype,Vr=function(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[],this.inClassFieldInit=!1};ye.enterScope=function(e){this.scopeStack.push(new Vr(e))};ye.exitScope=function(){this.scopeStack.pop()};ye.treatFunctionsAsVarInScope=function(e){return e.flags&Ve||!this.inModule&&e.flags&Ge};ye.declareName=function(e,t,i){var r=!1;if(t===he){var s=this.currentScope();r=s.lexical.indexOf(e)>-1||s.functions.indexOf(e)>-1||s.var.indexOf(e)>-1,s.lexical.push(e),this.inModule&&s.flags&Ge&&delete this.undefinedExports[e]}else if(t===Ri){var n=this.currentScope();n.lexical.push(e)}else if(t===Fi){var a=this.currentScope();this.treatFunctionsAsVar?r=a.lexical.indexOf(e)>-1:r=a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var u=this.scopeStack.length-1;u>=0;--u){var l=this.scopeStack[u];if(l.lexical.indexOf(e)>-1&&!(l.flags&Ti&&l.lexical[0]===e)||!this.treatFunctionsAsVarInScope(l)&&l.functions.indexOf(e)>-1){r=!0;break}if(l.var.push(e),this.inModule&&l.flags&Ge&&delete this.undefinedExports[e],l.flags&Wt)break}r&&this.raiseRecoverable(i,"Identifier '"+e+"' has already been declared")};ye.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)};ye.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};ye.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&Wt)return t}};ye.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&Wt&&!(t.flags&Oi))return t}};var mt=function(t,i,r){this.type="",this.start=i,this.end=0,t.options.locations&&(this.loc=new ft(t,r)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[i,0])},Ye=T.prototype;Ye.startNode=function(){return new mt(this,this.start,this.startLoc)};Ye.startNodeAt=function(e,t){return new mt(this,e,t)};function Bi(e,t,i,r){return e.type=t,e.end=i,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=i),e}Ye.finishNode=function(e,t){return Bi.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)};Ye.finishNodeAt=function(e,t,i,r){return Bi.call(this,e,t,i,r)};Ye.copyNode=function(e){var t=new mt(this,e.start,this.startLoc);for(var i in e)t[i]=e[i];return t};var qi="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",$i=qi+" Extended_Pictographic",Ui=$i,ji=Ui+" EBase EComp EMod EPres ExtPict",Mr=ji,Dr={9:qi,10:$i,11:Ui,12:ji,13:Mr},Si="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",Wi="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",zi=Wi+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Qi=zi+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Hi=Qi+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Br=Hi+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",qr={9:Wi,10:zi,11:Qi,12:Hi,13:Br},Gi={};function $r(e){var t=Gi[e]={binary:Ie(Dr[e]+" "+Si),nonBinary:{General_Category:Ie(Si),Script:Ie(qr[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(ut=0,Mt=[9,10,11,12,13];ut<Mt.length;ut+=1)_i=Mt[ut],$r(_i);var _i,ut,Mt,b=T.prototype,fe=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=Gi[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=[]};fe.prototype.reset=function(t,i,r){var s=r.indexOf("u")!==-1;this.start=t|0,this.source=i+"",this.flags=r,this.switchU=s&&this.parser.options.ecmaVersion>=6,this.switchN=s&&this.parser.options.ecmaVersion>=9};fe.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)};fe.prototype.at=function(t,i){i===void 0&&(i=!1);var r=this.source,s=r.length;if(t>=s)return-1;var n=r.charCodeAt(t);if(!(i||this.switchU)||n<=55295||n>=57344||t+1>=s)return n;var a=r.charCodeAt(t+1);return a>=56320&&a<=57343?(n<<10)+a-56613888:n};fe.prototype.nextIndex=function(t,i){i===void 0&&(i=!1);var r=this.source,s=r.length;if(t>=s)return s;var n=r.charCodeAt(t),a;return!(i||this.switchU)||n<=55295||n>=57344||t+1>=s||(a=r.charCodeAt(t+1))<56320||a>57343?t+1:t+2};fe.prototype.current=function(t){return t===void 0&&(t=!1),this.at(this.pos,t)};fe.prototype.lookahead=function(t){return t===void 0&&(t=!1),this.at(this.nextIndex(this.pos,t),t)};fe.prototype.advance=function(t){t===void 0&&(t=!1),this.pos=this.nextIndex(this.pos,t)};fe.prototype.eat=function(t,i){return i===void 0&&(i=!1),this.current(i)===t?(this.advance(i),!0):!1};b.validateRegExpFlags=function(e){for(var t=e.validFlags,i=e.flags,r=0;r<i.length;r++){var s=i.charAt(r);t.indexOf(s)===-1&&this.raise(e.start,"Invalid regular expression flag"),i.indexOf(s,r+1)>-1&&this.raise(e.start,"Duplicate regular expression flag")}};b.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))};b.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,i=e.backReferenceNames;t<i.length;t+=1){var r=i[t];e.groupNames.indexOf(r)===-1&&e.raise("Invalid named capture referenced")}};b.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")};b.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););};b.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};b.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 i=!1;if(this.options.ecmaVersion>=9&&(i=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!i,!0}return e.pos=t,!1};b.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1};b.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)};b.regexp_eatBracedQuantifier=function(e,t){var i=e.pos;if(e.eat(123)){var r=0,s=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(s=e.lastIntValue),e.eat(125)))return s!==-1&&s<r&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=i}return!1};b.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)};b.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1};b.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};b.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};b.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)};b.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1};b.regexp_eatSyntaxCharacter=function(e){var t=e.current();return Ki(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Ki(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}b.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;(i=e.current())!==-1&&!Ki(i);)e.advance();return e.pos!==t};b.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};b.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")}};b.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};b.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=xe(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=xe(e.lastIntValue);return!0}return!1};b.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,r=e.current(i);return e.advance(i),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(r=e.lastIntValue),Ur(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function Ur(e){return ce(e,!0)||e===36||e===95}b.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,r=e.current(i);return e.advance(i),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(r=e.lastIntValue),jr(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function jr(e){return Fe(e,!0)||e===36||e===95||e===8204||e===8205}b.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)};b.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var i=e.lastIntValue;if(e.switchU)return i>e.maxBackReference&&(e.maxBackReference=i),!0;if(i<=e.numCapturingParens)return!0;e.pos=t}return!1};b.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};b.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)};b.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1};b.regexp_eatZero=function(e){return e.current()===48&&!dt(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1};b.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};b.regexp_eatControlLetter=function(e){var t=e.current();return Ji(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function Ji(e){return e>=65&&e<=90||e>=97&&e<=122}b.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var i=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(r&&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(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&Wr(e.lastIntValue))return!0;r&&e.raise("Invalid unicode escape"),e.pos=i}return!1};function Wr(e){return e>=0&&e<=1114111}b.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};b.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};b.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(zr(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 zr(e){return e===100||e===68||e===115||e===83||e===119||e===87}b.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var i=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,i,r),!0}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var s=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,s),!0}return!1};b.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){Ke(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value")};b.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name")};b.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Yi(t=e.current());)e.lastStringValue+=xe(t),e.advance();return e.lastStringValue!==""};function Yi(e){return Ji(e)||e===95}b.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";Qr(t=e.current());)e.lastStringValue+=xe(t),e.advance();return e.lastStringValue!==""};function Qr(e){return Yi(e)||dt(e)}b.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};b.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};b.regexp_classRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var i=e.lastIntValue;e.switchU&&(t===-1||i===-1)&&e.raise("Invalid character class"),t!==-1&&i!==-1&&t>i&&e.raise("Range out of order in character class")}}};b.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var i=e.current();(i===99||er(i))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var r=e.current();return r!==93?(e.lastIntValue=r,e.advance(),!0):!1};b.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)};b.regexp_eatClassControlLetter=function(e){var t=e.current();return dt(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1};b.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};b.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;dt(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t};function dt(e){return e>=48&&e<=57}b.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Xi(i=e.current());)e.lastIntValue=16*e.lastIntValue+Zi(i),e.advance();return e.pos!==t};function Xi(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Zi(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}b.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var i=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+i*8+e.lastIntValue:e.lastIntValue=t*8+i}else e.lastIntValue=t;return!0}return!1};b.regexp_eatOctalDigit=function(e){var t=e.current();return er(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function er(e){return e>=48&&e<=55}b.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var s=e.current();if(!Xi(s))return e.pos=i,!1;e.lastIntValue=16*e.lastIntValue+Zi(s),e.advance()}return!0};var Gt=function(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new ft(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end])},_=T.prototype;_.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 Gt(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};_.getToken=function(){return this.next(),new Gt(this)};typeof Symbol<"u"&&(_[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===o.eof,value:t}}}});_.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(o.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())};_.readToken=function(e){return ce(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};_.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};_.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(var r=void 0,s=t;(r=ki(this.input,s,this.pos))>-1;)++this.curLine,s=this.lineStart=r;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,i),t,this.pos,e,this.curPosition())};_.skipLineComment=function(e){for(var t=this.pos,i=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!Re(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,i,this.curPosition())};_.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&&Ai.test(String.fromCharCode(e)))++this.pos;else break e}}};_.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=e,this.value=t,this.updateContext(i)};_.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(o.ellipsis)):(++this.pos,this.finishToken(o.dot))};_.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(o.assign,2):this.finishOp(o.slash,1)};_.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,r=e===42?o.star:o.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++i,r=o.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(o.assign,i+1):this.finishOp(r,i)};_.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12){var i=this.input.charCodeAt(this.pos+2);if(i===61)return this.finishOp(o.assign,3)}return this.finishOp(e===124?o.logicalOR:o.logicalAND,2)}return t===61?this.finishOp(o.assign,2):this.finishOp(e===124?o.bitwiseOR:o.bitwiseAND,1)};_.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(o.assign,2):this.finishOp(o.bitwiseXOR,1)};_.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||Q.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(o.incDec,2):t===61?this.finishOp(o.assign,2):this.finishOp(o.plusMin,1)};_.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),i=1;return t===e?(i=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+i)===61?this.finishOp(o.assign,i+1):this.finishOp(o.bitShift,i)):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&&(i=2),this.finishOp(o.relational,i))};_.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(o.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(o.arrow)):this.finishOp(e===61?o.eq:o.prefix,1)};_.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(o.questionDot,2)}if(t===63){if(e>=12){var r=this.input.charCodeAt(this.pos+2);if(r===61)return this.finishOp(o.assign,3)}return this.finishOp(o.coalesce,2)}}return this.finishOp(o.question,1)};_.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),ce(t,!0)||t===92))return this.finishToken(o.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+xe(t)+"'")};_.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(o.parenL);case 41:return++this.pos,this.finishToken(o.parenR);case 59:return++this.pos,this.finishToken(o.semi);case 44:return++this.pos,this.finishToken(o.comma);case 91:return++this.pos,this.finishToken(o.bracketL);case 93:return++this.pos,this.finishToken(o.bracketR);case 123:return++this.pos,this.finishToken(o.braceL);case 125:return++this.pos,this.finishToken(o.braceR);case 58:return++this.pos,this.finishToken(o.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(o.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(o.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+xe(e)+"'")};_.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)};_.readRegexp=function(){for(var e,t,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var r=this.input.charAt(this.pos);if(Q.test(r)&&this.raise(i,"Unterminated regular expression"),e)e=!1;else{if(r==="[")t=!0;else if(r==="]"&&t)t=!1;else if(r==="/"&&!t)break;e=r==="\\"}++this.pos}var s=this.input.slice(i,this.pos);++this.pos;var n=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(n);var u=this.regexpState||(this.regexpState=new fe(this));u.reset(i,s,a),this.validateRegExpFlags(u),this.validateRegExpPattern(u);var l=null;try{l=new RegExp(s,a)}catch{}return this.finishToken(o.regexp,{pattern:s,flags:a,value:l})};_.readInt=function(e,t,i){for(var r=this.options.ecmaVersion>=12&&t===void 0,s=i&&this.input.charCodeAt(this.pos)===48,n=this.pos,a=0,u=0,l=0,h=t??1/0;l<h;++l,++this.pos){var c=this.input.charCodeAt(this.pos),p=void 0;if(r&&c===95){s&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),u===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),l===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),u=c;continue}if(c>=97?p=c-97+10:c>=65?p=c-65+10:c>=48&&c<=57?p=c-48:p=1/0,p>=e)break;u=c,a=a*e+p}return r&&u===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 Hr(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function tr(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}_.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var i=this.readInt(e);return i==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(i=tr(this.input.slice(t,this.pos)),++this.pos):ce(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(o.num,i)};_.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,"Invalid number");var i=this.pos-t>=2&&this.input.charCodeAt(t)===48;i&&this.strict&&this.raise(t,"Invalid number");var r=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&r===110){var s=tr(this.input.slice(t,this.pos));return++this.pos,ce(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(o.num,s)}i&&/[89]/.test(this.input.slice(t,this.pos))&&(i=!1),r===46&&!i&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),(r===69||r===101)&&!i&&(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,"Invalid number")),ce(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var n=Hr(this.input.slice(t,this.pos),i);return this.finishToken(o.num,n)};_.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var i=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(i,"Code point out of bounds")}else t=this.readHexChar(4);return t};_.readString=function(e){for(var t="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(i,this.pos),t+=this.readEscapedChar(!1),i=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(Re(r)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(i,this.pos++),this.finishToken(o.string,t)};var ir={};_.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===ir)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};_.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw ir;this.raise(e,t)};_.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(i===96||i===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===o.template||this.type===o.invalidTemplate)?i===36?(this.pos+=2,this.finishToken(o.dollarBraceL)):(++this.pos,this.finishToken(o.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(o.template,e));if(i===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(Re(i)){switch(e+=this.input.slice(t,this.pos),++this.pos,i){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
12
- `;break;default:e+=String.fromCharCode(i);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}};_.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(o.invalidTemplate,this.input.slice(this.start,this.pos))}this.raise(this.start,"Unterminated template")};_.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
13
- `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return xe(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 i=this.pos-1;return this.invalidStringToken(i,"Invalid escape sequence in template string"),null}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],s=parseInt(r,8);return s>255&&(r=r.slice(0,-1),s=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!=="0"||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(s)}return Re(t)?"":String.fromCharCode(t)}};_.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return i===null&&this.invalidStringToken(t,"Bad character escape sequence"),i};_.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,i=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var s=this.fullCharCodeAtPos();if(Fe(s,r))this.pos+=s<=65535?1:2;else if(s===92){this.containsEsc=!0,e+=this.input.slice(i,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?ce:Fe)(a,r)||this.invalidStringToken(n,"Invalid Unicode escape"),e+=xe(a),i=this.pos}else break;t=!1}return e+this.input.slice(i,this.pos)};_.readWord=function(){var e=this.readWord1(),t=o.name;return this.keywords.test(e)&&(t=$t[e]),this.finishToken(t,e)};var Gr="8.7.1";T.acorn={Parser:T,version:Gr,defaultOptions:Bt,Position:He,SourceLocation:ft,getLineInfo:Pi,Node:mt,TokenType:k,tokTypes:o,keywordTypes:$t,TokContext:X,tokContexts:P,isIdentifierChar:Fe,isIdentifierStart:ce,Token:Gt,isNewLine:Re,lineBreak:Q,lineBreakG:Er,nonASCIIwhitespace:Ai};var Lt=T.extend(function(e){let t=!1,i=!1,r=!1;return class extends e{parseFunction(s,n,a,u,l){return this.type.label==="**"&&(s.isSubscriptFunction=!0,this.next()),super.parseFunction(s,n,a,u,l)}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(r&&s.label===":"||(r||i)&&s.label==="*")&&this.type.label==="**"?(t=!0,this.next(),!1):super.eat(s)}parseProperty(s,n){r=!0;let a=super.parseProperty(s,n);return r=!1,t&&(a.value.isSubscriptFunction=!0,t=!1),a}parseClassElement(s){i=!0;let n=super.parseClassElement(s);return i=!1,t&&(n.value.isSubscriptFunction=!0,t=!1),n}}});var rr=e=>class extends Ft(e){static get subscriptParams(){return{globalsAutoObserve:["document"]}}static expose(t,i){let r=ee(t,"oohtml","subscript","instances"),s=i.name;return s||(s=[...r.keys()].filter(n=>q(n)).length),r.set(s,i),i}static implementMethod(t,i){let r=super.implementMethod(t,i);return this.expose(i,r)}static implementScript(t,i){let r=(t.textContent||"").trim();return this.expose(i,I.call(i,r,{compilerParams:this.compilerParams,runtimeParams:this.runtimeParams}))}static doConnectedCallback(t){if(typeof WebQit>"u"||!WebQit.Observer)return;let i=ee(t,"oohtml","subscript","instances"),r=(s,n,a=[])=>{i.forEach(u=>u.thread(...s.map(l=>a.concat(l.path))))};(this.subscriptParams.globalsAutoObserve||[]).forEach(s=>{WebQit.Observer.observe(globalThis[s],n=>r(n,null,[s]),{subtree:!0,diff:!0,tags:[t,"subscript-element",s],unique:!0})}),WebQit.Observer.observe(t,s=>r(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(i=>{WebQit.Observer.unobserve(globalThis[i],null,null,{subtree:!0,tags:[t,"subscript-element",i]})}),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 ee(this,"oohtml","subscript","instances")}};function ae(e,t=!0){return w(e)?e:!t&&A(e)?[e]:e!==!1&&e!==0&&bt(e)?[]:vt(e)?Array.prototype.slice.call(e):A(e)?Object.values(e):[e]}var or=function(e,t=1,i=!0){return!q(t)||t<=0||(!w(e)&&A(e)&&i&&(e=Object.values(e)),!w(e))?e:e.reduce((r,s)=>w(s)||A(s)&&i?r.concat(or(w(s)?s:Object.values(s),t-1,i)):r.concat(s),[])},Jt=or;function De(e,t,i=!0,r=!0,s=!1,n=!1){if(w(e)&&w(t)){var a=[],u=!0;return e.forEach(l=>{if(!!u){var h=!1;qe(t,(c,p)=>{(!h||r&&L(l))&&(h=i(l,p),(w(h)&&!h.length||A(h)&&!Object.keys(h).length)&&(h=!1),L(h)&&r&&(l=h))}),L(h)?a.push(r?h:l):Be(h)?s&&!h||!s&&h?a.push(l):n&&(u=!1):a.push(h)}}),a}if(A(e)&&A(t)){var a={},u=!0;return Object.keys(e).forEach(c=>{if(!!u){var p=i(e[c],t[c]);(w(p)&&!p.length||A(p)&&!Object.keys(p).length)&&(p=!1),L(p)?a[c]=r?p:e[c]:Be(p)?s&&!p||!s&&p?a[c]=e[c]:n&&(u=!1):a[c]=p}}),a}}function gt(e,t=[]){return K([{},e],(i,r,s)=>{if(!N(s[i]))return N(t)?t(i):w(t)&&t.length?t.indexOf(i)>-1:!0},!1,!1,!1)}var Yt=function(e,t,i=!0,r=1){if(w(e)&&w(t)&&e.length!==t.length)return!i;if(A(e)&&A(t)){var s=Object.keys(e),n=Object.keys(t);if(!s.length&&!n.length)return Ze(e)&&Ze(t)?i:e===t===i;if(!Yt(s,n))return!i}if(r>0&&(w(e)&&w(t)||A(e)&&A(t))){var a=De(e,t,(u,l)=>Yt(u,l,i,r-1),!1,!1,!0);return w(a)?a.length===e.length&&a.length===t.length:A(a)&&A(e)?Object.keys(a).length===Object.keys(e).length&&Object.keys(a).length===Object.keys(t).length:a}return N(i)?i(e,t):be(e)&&be(t)&&isNaN(e)&&isNaN(t)?i:e===t===i},Xt=Yt;var O=class{static lex(t,i,r={}){if(!ve(t=t+""))throw new Error("Argument1 must be a string!");var s=h=>({delims:h.delims.slice(),options:gt(h.options),nesting:h.nesting.slice(),maxDepth:h.maxDepth,comments:h.comments.slice(),tokens:h.tokens.slice(),matches:h.matches.slice(),matchesi:gt(h.matchesi)});if(O.$cache[t]&&r.cache!==!1)for(var n=0;n<O.$cache[t].length;n++){var a=O.$cache[t][n];if(Xt(a.delims,i))return s(a)}var u=new O(t,r),l=u.lex(i);return r.cache!==!1&&(O.$cache[t]=O.$cache[t]||[],O.$cache[t].push(l)),s(l)}static split(t,i,r){return O.lex(t,i,r).tokens}static match(t,i,r){return O.lex(t,i,r).matches}constructor(t,i){if(!ve(t))throw new Error("Lexer requires the first argument to be a string.");this.$str=t,this.$options=i||{},this.$options.blocks||(this.$options.blocks=O.$blocks),this.$options.quotes||(this.$options.quotes=O.$quotes),this.$options.comments||(this.$options.comments=O.$comments)}lex(t,i){for(var r={delims:ae(t),options:me(!0,{},this.$options,i||{}),nesting:[],maxDepth:0,comments:[],tokens:[],matches:[],matchesi:{}},s=0;typeof s=="number";)s=this._evalCharsAt(r,s);if(r.nesting.length)throw new Error("Error parsing the string: "+this.$str+". Unterminated blocks: "+Jt(r.nesting).join(", "));return r}_evalCharsAt(t,i){if(!(i>=this.$str.length)){var r=1,s={},n={},a={};if(t.openComment||(n=this._testQuotes(t,i)),t.openQuote||(s=this._testComments(t,i)),t.openComment||s.ending)if(!t.nesting.length&&!a.ending){var u=s.starting||s.ending||this.$str[i];r=u.length,this._push(t,u,"comments",s.starting)}else this._push(t,this.$str[i]);else if(t.openQuote||n.ending)this._push(t,this.$str[i]);else{if(t.options.limit&&t.matches.length===t.options.limit)return this._push(t,this.$str[i]),i+1;a=this._testNesting(t,i);var a=this._testNesting(t,i),l=this._testChars(t.options.stopChars||[],t,i);if(!t.nesting.length&&l!==!1){t.options.stopChar=l,t.options.stopCharForward=this.$str.substr(i);return}if(!t.delims.length)t.nesting.length===2&&a.starting?(t.matches.push(null),this._push(t,a.starting),r=a.starting.length):!t.nesting.length&&a.ending?(this._push(t,a.ending),r=a.ending.length,t.matches.push(null)):this._push(t,this.$str[i]);else if(!t.nesting.length&&!a.ending){this._push(t,"");var h=this._testChars(t.delims,t,i);if(h!==!1&&(t.matches.push(h),t.matchesi[i]=h,r=h.length||1,!t.options.preserveDelims)){var c=i+(h.length||1);return c===this.$str.length&&this._push(t,""),c}this._push(t,h||this.$str[i])}else{var u=a.starting||a.ending||this.$str[i];r=u.length,this._push(t,u)}}return i+r}}_testQuotes(t,i){var r={};return(t.options.quotes||[]).forEach(s=>{this.$str.substr(i,1)===s&&(t.openQuote?s===t.openQuote&&(t.openQuote=!1,r.ending=s):(t.openQuote=s,r.starting=s))}),r}_testComments(t,i){var r={};return(t.options.comments||[]).forEach(s=>{if(t.openComment){if(G(s)===G(t.openComment)){var a=G(s);this.$str.substr(i).startsWith(a)&&(t.openComment=!1,r.ending=a)}}else{var n=pe(s);this.$str.substr(i).startsWith(n)&&(t.openComment=s,r.starting=n)}}),r}_testNesting(t,i){var r={};return(t.options.blocks||[]).forEach(s=>{var n=pe(s);if(this.$str.substr(i).startsWith(n))t.nesting=t.nesting.concat([s]),r.starting=n;else if(t.nesting.length&&G(s)===G(G(t.nesting))){var a=G(s);this.$str.substr(i).startsWith(a)&&(t.nesting=t.nesting.slice(0,-1),r.ending=a)}}),t.maxDepth=Math.max(t.maxDepth,t.nesting.length),r}_testChars(t,i,r){for(var s=0;s<t.length;s++){var n=t[s];if(N(n)){var a=n(this.$str.substr(0,r),this.$str.substr(r),i.tokens.slice());if(a!==!1)return a}if(i.options.useRegex){var u=this.$str.substr(r).match(new RegExp("^"+n,i.options.useRegex!==!0?i.options.useRegex:""));if(u)return u[0]}if(!i.options.ci&&this.$str.substr(r,n.length)===n||i.options.ci&&this.$str.substr(r,n.length).toLowerCase()===n.toLowerCase())return n}return!1}_push(t,i,r="tokens",s=!1){var n=t.matches.length;if(te(t.tokens[n])&&(t.tokens[n]=""),r==="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]||"")+i}else{var u=t.tokens[n].comments;t.tokens[n]=t.tokens[n]+i}}split(t,i,r){return this.lex(i,r).tokens}match(t,i,r){return this.lex(i,r).matches}regParse(t,i){return this.lex(t,me({useRegex:!0},i||{}))}regSplit(t,i){return this.regParse(t,i).tokens}regMatch(t,i){return this.regParse(t,i).matches}};O.$blocks=[["(",")"],["[","]"],["{","}"]];O.$quotes=['"',"'","`"];O.$comments=[["/*","*/"],["//",`
14
- `]];O.$cache=Object.create(null);function ur(e,t={}){let i=nt.call(this);return i.OOHTML||(i.OOHTML={}),i.OOHTML.meta||(i.OOHTML.meta=i.DOM.meta("oohtml",!0)),i.OOHTML.meta.defaults(me(3,e,t)),i.OOHTML.meta}function xt(e={}){let t=nt.call(this);if(e.onDomReady){t.DOM.ready(()=>{xt.call(this,{...e,onDomReady:!1})});return}let i=t.DOM.mutations,r=ur.call(this,{selectors:{script:'script[type="subscript"]'},api:{bind:"bind",unbind:"unbind"},script:{}},e.params),s=a=>class extends rr(a){static get compilerParams(){return e.compilerParams||{}}static get runtimeParams(){return e.runtimeParams||{}}},n=s();i.onPresent(r.get("selectors.script"),a=>{let u=a.parentNode;if(!u)return;let l=ee(u,"oohtml","subscript").get("script-tags");if(l||(l=new WeakSet,ee(u,"oohtml","subscript").set("script-tags",l)),l.has(a))return;n.implementScript(a,u)(),n.doConnectedCallback(u),l.add(a);let h=i.onRemoved(u,()=>{n.doDisconnectedCallback(u),l.delete(a),h.disconnect()},{ignoreTransients:!0})}),t.OOHTML||(t.OOHTML={}),t.OOHTML.SubscriptElement=s}xt.call(window);})();
15
- //# sourceMappingURL=subscript.js.map