@webqit/oohtml 3.1.13 → 3.2.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.
- package/README.md +212 -217
- package/dist/bindings-api.js +1 -1
- package/dist/bindings-api.js.map +2 -2
- package/dist/context-api.js +1 -1
- package/dist/context-api.js.map +1 -1
- package/dist/data-binding.js +8 -8
- package/dist/data-binding.js.map +2 -2
- package/dist/html-imports.js +1 -1
- package/dist/html-imports.js.map +2 -2
- package/dist/main.js +25 -23
- package/dist/main.js.map +3 -3
- package/dist/main.lite.js +23 -21
- package/dist/main.lite.js.map +3 -3
- package/dist/namespaced-html.js +1 -1
- package/dist/namespaced-html.js.map +3 -3
- package/dist/scoped-css.js +5 -3
- package/dist/scoped-css.js.map +3 -3
- package/dist/scoped-js.js +1 -1
- package/dist/scoped-js.js.map +3 -3
- package/package.json +3 -3
- package/src/bindings-api/DOMBindingsContext.js +1 -1
- package/src/bindings-api/index.js +21 -21
- package/src/data-binding/index.js +4 -19
- package/src/html-imports/HTMLImportsContext.js +1 -3
- package/src/html-imports/index.js +7 -1
- package/src/index.js +3 -3
- package/src/namespaced-html/DOMNamingContext.js +54 -0
- package/src/namespaced-html/index.js +237 -60
- package/src/scoped-css/index.js +108 -16
- package/src/scoped-js/index.js +48 -25
- package/src/util.js +38 -0
- package/test/scoped-css.test.js +2 -2
- package/src/scoped-js/Hash.js +0 -26
package/dist/main.js
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
(()=>{var ir=Object.defineProperty;var Ps=(e,t,i)=>t in e?ir(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var ii=(e,t)=>{for(var i in t)ir(e,i,{get:t[i],enumerable:!0})};var j=(e,t,i)=>(Ps(e,typeof t!="symbol"?t+"":t,i),i);var Di={};ii(Di,{Observer:()=>I,QuantumAsyncFunction:()=>Vn,QuantumAsyncScript:()=>Se,QuantumFunction:()=>Mn,QuantumModule:()=>Ce,QuantumScript:()=>Ee,State:()=>Vt});var gi={};ii(gi,{apply:()=>Me,batch:()=>Fe,construct:()=>pi,defineProperties:()=>zs,defineProperty:()=>le,deleteProperties:()=>Gs,deleteProperty:()=>ce,get:()=>dt,getOwnPropertyDescriptor:()=>Ve,getOwnPropertyDescriptors:()=>Ws,getPrototypeOf:()=>hi,has:()=>De,intercept:()=>Hs,isExtensible:()=>fi,map:()=>Us,observe:()=>xi,ownKeys:()=>ue,path:()=>Bs,preventExtensions:()=>di,reduce:()=>yi,set:()=>Nt,setPrototypeOf:()=>mi});function $(e){return!Array.isArray(e)&&typeof e=="object"&&e}function Wt(e){return typeof e}function P(e){return Array.isArray(e)}function ri(e,t,i=null){return P(t)?e.filter(r=>i?t.filter(s=>i(r,s)).length:t.indexOf(r)!==-1):[]}function Ct(e,...t){if(globalThis.webqit||(globalThis.webqit={}),globalThis.webqit.refs||Object.defineProperty(globalThis.webqit,"refs",{value:new ee}),!arguments.length)return globalThis.webqit.refs;let i=globalThis.webqit.refs.get(e);i||(i=new ee,globalThis.webqit.refs.set(e,i));let r,s;for(;r=t.shift();)(s=i)&&!(i=i.get(r))&&(i=new ee,s.set(r,i));return i}var ee=class extends Map{constructor(...t){super(...t),this.observers=new Set}set(t,i){let r=super.set(t,i);return this.fire("set",t,i,t),r}delete(t){let i=super.delete(t);return this.fire("delete",t),i}has(t){return this.fire("has",t),super.has(t)}get(t){return this.fire("get",t),super.get(t)}keyNames(){return Array.from(super.keys())}observe(t,i,r){let s={type:t,key:i,callback:r};return this.observers.add(s),()=>this.observers.delete(s)}unobserve(t,i,r){if(Array.isArray(t)||Array.isArray(i))throw new Error('The "type" and "key" arguments can only be strings.');for(let s of this.observers)!(Ne([t,"*"],s.type)&&Ne([i,"*"],s.key)&&s.callback===r)||this.observers.delete(s)}fire(t,i,...r){for(let s of this.observers)!(Ne([t,"*"],s.type)&&Ne([i,"*"],s.key))||s.callback(...r)}},Ne=(e,t)=>Array.isArray(t)?ri(e,t).length:e.includes(t);function Ut(e){return typeof e=="function"}function ie(e){return e===null||e===""}function pt(e){return arguments.length&&(e===void 0||typeof e>"u")}function R(e){return Array.isArray(e)||typeof e=="object"&&e||Ut(e)}function si(e){return ie(e)||pt(e)||e===!1||e===0||R(e)&&!Object.keys(e).length}function L(e){return Ut(e)||e&&{}.toString.call(e)==="[object function]"}function re(e){return e instanceof Number||typeof e=="number"}function Y(e){return re(e)||e!==!0&&e!==!1&&e!==null&&e!==""&&!isNaN(e*1)}function zt(e){return e instanceof String||typeof e=="string"&&e!==null}function ni(e){return!zt(e)&&!pt(e.length)}function $e(e,...t){return t.forEach(i=>{e.indexOf(i)<0&&e.push(i)}),e}function ai(r,t){t=t||Object.prototype,t=t&&!P(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 oi(e,t){var i=[];return ai(e,t).forEach(r=>{$e(i,...Object.getOwnPropertyNames(r))}),i}function ot(e,t,i=!1,r=!1,s=!1){var n=0,a=e.shift();if((Y(a)||a===!0||a===!1)&&(n=a,a=e.shift()),!e.length)throw new Error("_merge() requires two or more array/objects.");return e.forEach((o,l)=>{!R(o)&&!L(o)||(i?oi(o):Object.keys(o)).forEach(u=>{if(!!t(u,a,o,l)){var c=a[u],f=o[u];if((P(c)&&P(f)||$(c)&&$(f))&&(n===!0||n>0))a[u]=P(c)&&P(f)?[]:{},ot([Y(n)?n-1:n,a[u],c,f],t,i,r,s);else if(P(a)&&P(o))r?a[u]=f:a.push(f);else try{s?Object.defineProperty(a,u,Object.getOwnPropertyDescriptor(o,u)):a[u]=o[u]}catch{}}})}),a}function se(...e){return ot(e,(t,i,r)=>!0,!1,!1,!1)}function D(e,t=!0){return P(e)?e:!t&&$(e)?[e]:e!==!1&&e!==0&&si(e)?[]:ni(e)?Array.prototype.slice.call(e):$(e)?Object.values(e):[e]}var M=(...e)=>Ct("observer-api",...e),Gt=(e,t)=>e instanceof Promise?e.then(t):t(e),Le={};var Ot=class{constructor(t,i){this.registry=t,Object.assign(this,{...i,target:t.target}),this.params.signal&&this.params.signal.addEventListener("abort",()=>this.remove())}remove(){return this.removed=!0,this.registry.removeRegistration(this)}};var ne=class extends Ot{constructor(){super(...arguments),this.emit.currentRegistration=this,Object.defineProperty(this,"abortController",{value:new AbortController}),Object.defineProperty(this,"signal",{value:this.abortController.signal}),Le.setMaxListeners?.(0,this.signal)}remove(){this.abortController.abort(),super.remove()}fire(t){if(this.emit.recursionTarget&&!["inject","force-async","force-sync"].includes(this.params.recursions))return;let i=t,r=this.filter;if(r!==1/0&&(r=D(r,!1))&&(i=t.filter(n=>r.includes(n.key))),this.params.diff&&(i=i.filter(n=>n.type!=="set"||n.value!==n.oldValue)),!i.length)return;if(["inject","defer"].includes(this.params.recursions)){if(this.emit.recursionTarget){this.emit.recursionTarget.push(...i);return}this.emit.recursionTarget=this.params.recursions==="inject"?i:[]}let s=this.filter===1/0||Array.isArray(this.filter)?this.emit(i,this):this.emit(i[0],this);return Gt(s,n=>{let a=this.emit.recursionTarget;return delete this.emit.recursionTarget,this.params.recursions==="defer"&&a?.length?this.emit.currentRegistration.fire(a):n})}};var Tt=class{constructor(t){this.target=t,this.entries=[]}addRegistration(t){return this.entries.push(t),t}removeRegistration(t){this.entries=this.entries.filter(i=>i!==t)}static _getInstance(t,i,r=!0,s=this.__namespace){if(!R(i))throw new Error(`Subject must be of type object; "${Wt(i)}" given!`);let n=this;return s&&M("namespaces").has(t+"-"+s)&&(n=M("namespaces").get(t+"-"+s),t+="-"+s),!M(i,"registry").has(t)&&r&&M(i,"registry").set(t,new n(i)),M(i,"registry").get(t)}static _namespace(t,i,r=null){if(t+="-"+i,arguments.length===2)return M("namespaces").get(t);if(!(r.prototype instanceof this))throw new Error(`The implementation of the namespace ${this.name}.${i} must be a subclass of ${this.name}.`);M("namespaces").set(t,r),r.__namespace=i}};var H=class{constructor(t,i){if(this.target=t,!i.operation)throw new Error("Descriptor operation must be given in definition!");Object.assign(this,i)}};var kt=class extends Tt{static getInstance(t,i=!0,r=null){return super._getInstance("listeners",...arguments)}static namespace(t,i=null){return super._namespace("listeners",...arguments)}constructor(t){super(t),this.batches=[]}addRegistration(t,i,r){return super.addRegistration(new ne(this,{filter:t,emit:i,params:r}))}emit(t,i=!1){if(this.batches.length){this.batches[0].snapshots.push({events:[...t],isPropertyDescriptors:i});return}this.$emit(this.entries,[{events:t,isPropertyDescriptors:i}])}$emit(t,i){let r=t.filter(l=>l.params.withPropertyDescriptors).length,s=i.some(l=>l.isPropertyDescriptors),n=[],a=[],o=t.length;i.forEach(l=>{(r||!s)&&n.push(...l.events),r!==o&&s&&(l.isPropertyDescriptors?a.push(...l.events.map(u=>{let{target:c,type:f,...p}=u,d=new H(c,{type:"set",...p});return Object.defineProperty(d,"value","get"in p.value?{get:()=>p.value.get()}:{value:p.value.value}),p.oldValue&&Object.defineProperty(d,"oldValue","get"in p.oldValue?{get:()=>p.oldValue.get()}:{value:p.oldValue.value}),d})):a.push(...l.events))}),t.forEach(l=>{l.params.withPropertyDescriptors?l.fire(n.length?n:a):l.fire(a.length?a:n)})}batch(t){this.batches.unshift({entries:[...this.entries],snapshots:[]});let i=t();return Gt(i,r=>{let s=this.batches.shift();return s.snapshots.length&&this.$emit(s.entries,s.snapshots),r})}};var ae=class extends Ot{exec(t,i,r){return this.running||!this.traps[t.operation]?i(...Array.prototype.slice.call(arguments,2)):(this.running=!0,this.traps[t.operation](t,r,(...s)=>(this.running=!1,i(...s))))}};var mt=class extends Tt{static getInstance(t,i=!0,r=null){return super._getInstance("traps",...arguments)}static namespace(t,i=null){return super._namespace("traps",...arguments)}addRegistration(t){return super.addRegistration(new ae(this,t))}emit(t,i=null){let r=this;return function s(n,...a){let o=r.entries[n];return o?o.exec(t,(...l)=>s(n+1,...l),...a):i?i(t,...a):a[0]}(0)}};var ci={};ii(ci,{accessorize:()=>qs,proxy:()=>lr,unaccessorize:()=>js,unproxy:()=>oe});function qs(e,t,i={}){e=Re(e);let r=M(e,"accessorizedProps");function s(l){let u,c=e;do u=Object.getOwnPropertyDescriptor(c,l);while(!u&&(c=Object.getPrototypeOf(c)));return u?{proto:c,descriptor:u}:{descriptor:{value:void 0,configurable:!0,enumerable:!0,writable:!0}}}function n(l){if(r.has(l+""))return!0;let u=s(l);u.getValue=function(p=!1){return p?this.descriptor:this.descriptor.get?this.descriptor.get():this.descriptor.value},u.setValue=function(p,d=!1){if(this.dirty=!0,d){this.descriptor=p;return}return this.descriptor.set?this.descriptor.set(p)!==!1:(this.descriptor.value=p,!0)},u.intact=function(){let p=Object.getOwnPropertyDescriptor(e,l);return p?.get===f.get&&p?.set===f.set&&r.get(l+"")===this},u.restore=function(){return this.intact()?(this.proto&&this.proto!==e||!this.proto&&!this.dirty?delete e[l]:Object.defineProperty(e,l,this.descriptor),r.delete(l+""),!0):!1},r.set(isNaN(l)?l:parseInt(l),u);let{enumerable:c=!0}=u.descriptor,f={enumerable:c,configurable:!0};("value"in u.descriptor||u.descriptor.set)&&(f.set=function(p){return Nt(this,l,p,i)}),("value"in u.descriptor||u.descriptor.get)&&(f.get=function(){return dt(this,l,i)});try{return Object.defineProperty(e,l,f),!0}catch{return r.delete(l+""),!1}}let o=(Array.isArray(t)?t:t===void 0?Object.keys(e):[t]).map(n);return t===void 0||Array.isArray(t)?o:o[0]}function js(e,t,i={}){e=Re(e);let r=M(e,"accessorizedProps");function s(o){return r.has(o+"")?r.get(o+"").restore():!0}let a=(Array.isArray(t)?t:t===void 0?Object.keys(e):[t]).map(s);return t===void 0||Array.isArray(t)?a:a[0]}function lr(e,t={},i=void 0){let r=Re(e);if(typeof t.membrane=="boolean")throw new Error("The params.membrane parameter cannot be of type boolean.");if(t.membrane&&M(r,"membraneRef").has(t.membrane))return M(r,"membraneRef").get(t.membrane);let s={apply(o,l,u){if(Array.isArray(l)){let c=Re(l);return M(c).set("$length",c.length),Fe(c,()=>Me(o,l,u))}return Me(o,oe(l),u)},construct:(o,l,u=null)=>pi(o,l,u,t),defineProperty:(o,l,u)=>le(o,l,u,t),deleteProperty:(o,l)=>ce(o,l,t),get:(o,l,u=null)=>{let c={...t,receiver:u};Array.isArray(o)&&l==="length"&&M(o).has("$length")&&(c.forceValue=M(o).get("$length"));let f=dt(o,l,c);return Array.isArray(o)&&typeof f=="function"?lr(f,{...t,membrane:u}):f},getOwnPropertyDescriptor:(o,l)=>Ve(o,l,t),getPrototypeOf:o=>hi(o,t),has:(o,l)=>De(o,l,t),isExtensible:o=>fi(o,t),ownKeys:o=>ue(o,t),preventExtensions:o=>di(o,t),set:(o,l,u,c=null)=>{let f={...t,receiver:c};return Array.isArray(o)&&l==="length"&&(f.forceOldValue=M(o).get("$length"),M(o).set("$length",u)),Nt(o,l,u,f)},setPrototypeOf:(o,l)=>mi(o,l,t)},n=i?.(s)||s,a=new Proxy(r,n);return t.membrane&&M(r,"membraneRef").set(t.membrane,a),M(a).set(a,r),a}function oe(e){return M(e).get(e)||e}function Re(e){if(!e||!R(e))throw new Error("Target must be of type object!");return oe(e)}var he=class extends Array{};function Bs(...e){return new he(...e)}function yi(e,t,i,r=n=>n,s={}){if(!!t.length)return function n(a,o,l){let u=o[l.level],c=l.level===o.length-1;return a instanceof H&&a.operation!=="get"?l={...l,probe:"always"}:l.probe!=="always"&&(l={...l,probe:!c}),i(a,u,(f,...p)=>{let d=x=>{x instanceof H&&(x.path=[x.key],a instanceof H&&(x.path=a.path.concat(x.key),Object.defineProperty(x,"context",{get:()=>a,configurable:!0})))},y=x=>{let w=ut(x,!1);return Gt(w,g=>{x instanceof H?x.value=g:x=g;let b=p[0]||{};return n(x,o,{...l,...b,level:l.level+1})})};return qe(u)&&Array.isArray(f)?(f.forEach(d),c?r(f,...p):f.map(y)):(d(f),c?r(f,...p):y(f))},l)}(e,t.slice(0),{...s,level:0})}function xi(e,t,i,r={}){if(e=ut(e,!r.level),L(arguments[1])&&([,i,r={}]=arguments,t=1/0),!L(i))throw new Error(`Handler must be a function; "${Wt(i)}" given!`);if(t instanceof he)return yi(e,t,xi,i,r);if(r={...r,descripted:!0},delete r.live,!R(e))return r.probe&&dt(e,t,i,r);let s=cr(e,t,i,r);return r.probe?dt(e,t,s,r):s()}function Hs(e,t,i={}){return e=ut(e),$(t)||([,,,i={}]=arguments,t={[arguments[1]]:arguments[2]}),mt.getInstance(e,!0,i.namespace).addRegistration({traps:t,params:i})}function Ve(e,t,i=s=>s,r={}){return lt(e,"getOwnPropertyDescriptor",{key:t},i,r)}function Ws(e,t,i=s=>s,r={}){return lt(e,"getOwnPropertyDescriptors",{key:t},i,r)}function hi(e,t=r=>r,i={}){return lt(e,"getPrototypeOf",{},t,i)}function fi(e,t=r=>r,i={}){return lt(e,"isExtensible",{},t,i)}function ue(e,t=r=>r,i={}){return lt(e,"ownKeys",{},t,i)}function De(e,t,i=s=>s,r={}){return lt(e,"has",{key:t},i,r)}function dt(e,t,i=s=>s,r={}){let s,n=ut(e,!r.level);return $(i)?[r,i]=[i,a=>a]:r.live&&(s=!0),t instanceof he?yi(n,t,dt,i,r):Qs(n,t,a=>{let o=[...a];return function l(u,c,f){if(!c.length)return f(u);let p=c.shift();if(!["string","number","symbol"].includes(typeof p))throw new Error(`Property name/key ${p} invalid.`);function d(w,g=void 0){let b=T=>(w.value=T,l([...u,r.live||r.descripted?w:T],c,f));if(arguments.length>1)return b(g);if(!R(n))return b(n?.[w.key]);let v=M(n,"accessorizedProps",!1),N=v&&v.get(w.key);if(N&&N.intact())return b(N.getValue(r.withPropertyDescriptors));if(r.withPropertyDescriptors){let T=Object.getOwnPropertyDescriptor(n,w.key);return"forceValue"in r&&"value"in T&&(T.value=r.forceValue),b(T)}return"forceValue"in r?b(r.forceValue):b(Reflect.get(n,w.key))}let y=new H(n,{type:"get",key:p,value:void 0,operation:"get",related:o});if(!R(n))return d(y);let x=mt.getInstance(n,!1,r.namespace);return x?x.emit(y,d):d(y)}([],a.slice(0),l=>{let u=qe(t)?l:l[0];return s&&R(n)?cr(n,t,i,r)(u):i(u)})},r)}function Fe(e,t,i={}){return e=ut(e),kt.getInstance(e,!0,i.namespace).batch(t)}function Us(e,t,i={}){t=ut(t),e=ut(e);let r=(i.only||[]).slice(0),s=(i.except||[]).slice(0),n=ue(i.spread?[...e]:e).map(u=>isNaN(u)?u:parseInt(u)),a=r.length?r.filter(u=>n.includes(u)):n.filter(u=>!s.includes(u)),o=u=>!Array.isArray(t)||isNaN(u)?u:u-s.filter(c=>c<u).length,l=u=>{let c=Ve(e,u,i);"value"in c&&c.writable&&c.enumerable&&c.configurable?Nt(t,o(u),c.value,i):(c.enumerable||i.onlyEnumerable===!1)&&le(t,u,{...c,configurable:!0},i)};return Fe(t,()=>{a.forEach(l)}),xi(e,u=>{u.filter(c=>r.length?r.includes(c.key):!s.includes(c.key)).forEach(c=>{if(c.operation==="deleteProperty")return ce(t,o(c.key),i);if(c.operation==="defineProperty"){(c.value.enumerable||i.onlyEnumerable===!1)&&le(t,o(c.key),{...c.value,configurable:!0},i);return}l(c.key)})},{...i,withPropertyDescriptors:!0})}function Nt(e,t,i,r=a=>a,s={},n=!1){let a=ut(e),o=[[t,i]];$(t)&&([,,r=u=>u,s={},n=!1]=arguments,o=Object.entries(t)),$(r)&&([n,s,r]=[typeof s=="boolean"?s:n,r,u=>u]);let l=o.map(([u])=>u);return function u(c,f,p){if(!f.length)return p(c);let[d,y]=f.shift();function x(g,b=void 0){let v=G=>(g.status=G,u(c.concat(g),f,p));if(arguments.length>1)return v(g,b);let N=M(a,"accessorizedProps",!1),T=N&&N.get(g.key);return g.operation==="defineProperty"?(T&&!T.restore()&&v(!1),Object.defineProperty(a,g.key,g.value),v(!0)):T&&T.intact()?v(T.setValue(g.value)):v(Reflect.set(a,g.key,g.value))}function w(g,b){if(s.diff&&y===b)return u(c,f,p);let v=new H(a,{type:n?"def":"set",key:d,value:y,isUpdate:g,oldValue:b,related:[...l],operation:n?"defineProperty":"set",detail:s.detail}),N=mt.getInstance(a,!1,s.namespace);return N?N.emit(v,x):x(v)}return De(a,d,g=>{if(!g)return w(g);let b={...s,withPropertyDescriptors:n};return"forceOldValue"in s&&(b.forceValue=s.forceOldValue),dt(a,d,v=>w(g,v),b)},s)}([],o.slice(0),u=>{let c=kt.getInstance(a,!1,s.namespace);return c&&c.emit(u,n),r(qe(t)?u.map(f=>f.status):u[0]?.status)})}function le(e,t,i,r=n=>n,s={}){return Nt(e,t,i,r,s,!0)}function zs(e,t,i=s=>s,r={}){return Nt(e,t,i,r,!0)}function ce(e,t,i=s=>s,r={}){e=ut(e),$(i)&&([r,i]=[i,a=>a]);let s=D(t,!1),n=[...s];return function a(o,l,u){if(!l.length)return u(o);let c=l.shift();function f(d,y=void 0){let x=b=>(d.status=b,a(o.concat(d),l,u));if(arguments.length>1)return x(d,y);let w=M(e,"accessorizedProps",!1),g=w&&w.get(d.key);return g&&!g.restore()&&x(!1),x(Reflect.deleteProperty(e,d.key))}function p(d){let y=new H(e,{type:"delete",key:c,oldValue:d,related:[...n],operation:"deleteProperty",detail:r.detail}),x=mt.getInstance(e,!1,r.namespace);return x?x.emit(y,f):f(y)}return dt(e,c,p,r)}([],s.slice(0),a=>{let o=kt.getInstance(e,!1,r.namespace);return o&&o.emit(a),i(qe(t)?a.map(l=>l.status):a[0].status)})}function Gs(e,t,i=s=>s,r={}){return ce(...arguments)}function pi(e,t,i=null,r=n=>n,s={}){return lt(e,"construct",arguments.length>2?{argumentsList:t,newTarget:i}:{argumentsList:t},r,s)}function Me(e,t,i,r=n=>n,s={}){return lt(e,"apply",{thisArgument:t,argumentsList:i},r,s)}function mi(e,t,i=s=>s,r={}){return lt(e,"setPrototypeOf",{proto:t},i,r)}function di(e,t=r=>r,i={}){return lt(e,"preventExtensions",{},t,i)}function cr(e,t,i,r={}){let s;r.signal||(s=new AbortController,r={...r,signal:s.signal},Le.setMaxListeners?.(0,s.signal));let n=kt.getInstance(e,!0,r.namespace);return function a(o,l=null){l?.remove();let c={signal:n.addRegistration(t,a,r).signal};if(arguments.length){let f=i(o,c);if(arguments.length>1)return f}return s}}function lt(e,t,i={},r=n=>n,s={}){e=ut(e),$(r)&&([s,r]=[r,l=>l]);function n(l,u){return arguments.length>1?r(u):r((Reflect[t]||Object[t])(e,...Object.values(i)))}let a=new H(e,{operation:t,...i}),o=mt.getInstance(e,!1,s.namespace);return o?o.emit(a,n):n(a)}function qe(e){return e===1/0||Array.isArray(e)}function ut(e,t=!0){if((!e||!R(e))&&t)throw new Error(`Object must be of type object or array! "${Wt(e)}" given.`);return e instanceof H&&(e=e.value),e&&oe(e)}function Qs(e,t,i,r={}){return t===1/0?r.level&&!R(e)?i([]):ue(e,i,r):i(D(t,!1))}var Xs={...gi,...ci},I=Xs;var bi=(e,...t)=>{let i=t.pop();return e.constructor.name==="AsyncFunction"?K(e.call(...t),i):i(e.call(...t))},K=(e,t)=>e instanceof Promise?e.then(t):t(e),wi=e=>typeof e=="object"&&e||typeof e=="function";function vi(e){let t=typeof e[e.length-1]=="object"?e.pop():{},i=e.pop()||"";return t.functionParams=e,{source:i,params:t}}var hr={};var Ks=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],yr=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,3104,541,1507,4938,6,4191],Ys="\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\u0CF3\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-\u0ECE\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",xr="\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",_i={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"},Ei="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",Js={5:Ei,"5module":Ei+" export import",6:Ei+" const class extends export import super"},Zs=/^in(stanceof)?$/,tn=new RegExp("["+xr+"]"),en=new RegExp("["+xr+Ys+"]");function Ci(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}return!1}function xt(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&tn.test(String.fromCharCode(e)):t===!1?!1:Ci(e,yr)}function Qt(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&&en.test(String.fromCharCode(e)):t===!1?!1:Ci(e,yr)||Ci(e,Ks)}var O=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 O(e,{beforeExpr:!0,binop:t})}var Z={beforeExpr:!0},Q={startsExpr:!0},Pi={};function A(e,t){return t===void 0&&(t={}),t.keyword=e,Pi[e]=new O(e,t)}var h={num:new O("num",Q),regexp:new O("regexp",Q),string:new O("string",Q),name:new O("name",Q),privateId:new O("privateId",Q),eof:new O("eof"),bracketL:new O("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new O("]"),braceL:new O("{",{beforeExpr:!0,startsExpr:!0}),braceR:new O("}"),parenL:new O("(",{beforeExpr:!0,startsExpr:!0}),parenR:new O(")"),comma:new O(",",Z),semi:new O(";",Z),colon:new O(":",Z),dot:new O("."),question:new O("?",Z),questionDot:new O("?."),arrow:new O("=>",Z),template:new O("template"),invalidTemplate:new O("invalidTemplate"),ellipsis:new O("...",Z),backQuote:new O("`",Q),dollarBraceL:new O("${",{beforeExpr:!0,startsExpr:!0}),eq:new O("=",{beforeExpr:!0,isAssign:!0}),assign:new O("_=",{beforeExpr:!0,isAssign:!0}),incDec:new O("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new O("!/~",{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 O("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:J("%",10),star:J("*",10),slash:J("/",10),starstar:new O("**",{beforeExpr:!0}),coalesce:J("??",1),_break:A("break"),_case:A("case",Z),_catch:A("catch"),_continue:A("continue"),_debugger:A("debugger"),_default:A("default",Z),_do:A("do",{isLoop:!0,beforeExpr:!0}),_else:A("else",Z),_finally:A("finally"),_for:A("for",{isLoop:!0}),_function:A("function",Q),_if:A("if"),_return:A("return",Z),_switch:A("switch"),_throw:A("throw",Z),_try:A("try"),_var:A("var"),_const:A("const"),_while:A("while",{isLoop:!0}),_with:A("with"),_new:A("new",{beforeExpr:!0,startsExpr:!0}),_this:A("this",Q),_super:A("super",Q),_class:A("class",Q),_extends:A("extends",Z),_export:A("export"),_import:A("import",Q),_null:A("null",Q),_true:A("true",Q),_false:A("false",Q),_in:A("in",{beforeExpr:!0,binop:7}),_instanceof:A("instanceof",{beforeExpr:!0,binop:7}),_typeof:A("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:A("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:A("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},et=/\r\n?|\n|\u2028|\u2029/,rn=new RegExp(et.source,"g");function Xt(e){return e===10||e===13||e===8232||e===8233}function gr(e,t,i){i===void 0&&(i=e.length);for(var r=t;r<i;r++){var s=e.charCodeAt(r);if(Xt(s))return r<i-1&&s===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var br=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,tt=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,wr=Object.prototype,sn=wr.hasOwnProperty,nn=wr.toString,de=Object.hasOwn||function(e,t){return sn.call(e,t)},fr=Array.isArray||function(e){return nn.call(e)==="[object Array]"};function $t(e){return new RegExp("^(?:"+e.replace(/ /g,"|")+")$")}function At(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var an=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,pe=function(t,i){this.line=t,this.column=i};pe.prototype.offset=function(t){return new pe(this.line,this.column+t)};var Ue=function(t,i,r){this.start=i,this.end=r,t.sourceFile!==null&&(this.source=t.sourceFile)};function vr(e,t){for(var i=1,r=0;;){var s=gr(e,r,t);if(s<0)return new pe(i,t-r);++i,r=s}}var ki={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},pr=!1;function on(e){var t={};for(var i in ki)t[i]=e&&de(e,i)?e[i]:ki[i];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!pr&&typeof console=="object"&&console.warn&&(pr=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
2
|
-
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),(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),
|
|
3
|
-
`,r-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(et).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=h.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(me),this.regexpState=null,this.privateNameStack=[]},ct={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}};F.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)};ct.inFunction.get=function(){return(this.currentVarScope().flags&Kt)>0};ct.inGenerator.get=function(){return(this.currentVarScope().flags&_r)>0&&!this.currentVarScope().inClassFieldInit};ct.inAsync.get=function(){return(this.currentVarScope().flags&Ii)>0&&!this.currentVarScope().inClassFieldInit};ct.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e];if(t.inClassFieldInit||t.flags&ye)return!1;if(t.flags&Kt)return(t.flags&Ii)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};ct.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(t&Oi)>0||i||this.options.allowSuperOutsideMethod};ct.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Cr)>0};ct.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};ct.allowNewDotTarget.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(t&(Kt|ye))>0||i};ct.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&ye)>0};F.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};F.parse=function(t,i){return new this(i,t).parse()};F.parseExpressionAt=function(t,i,r){var s=new this(r,t,i);return s.nextToken(),s.parseExpression()};F.tokenizer=function(t,i){return new this(i,t)};Object.defineProperties(F.prototype,ct);var W=F.prototype,ln=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;W.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){tt.lastIndex=e,e+=tt.exec(this.input)[0].length;var t=ln.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){tt.lastIndex=e+t[0].length;var i=tt.exec(this.input),r=i.index+i[0].length,s=this.input.charAt(r);return s===";"||s==="}"||et.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(s)||s==="!"&&this.input.charAt(r+1)==="=")}e+=t[0].length,tt.lastIndex=e,e+=tt.exec(this.input)[0].length,this.input[e]===";"&&e++}};W.eat=function(e){return this.type===e?(this.next(),!0):!1};W.isContextual=function(e){return this.type===h.name&&this.value===e&&!this.containsEsc};W.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};W.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};W.canInsertSemicolon=function(){return this.type===h.eof||this.type===h.braceR||et.test(this.input.slice(this.lastTokEnd,this.start))};W.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};W.semicolon=function(){!this.eat(h.semi)&&!this.insertSemicolon()&&this.unexpected()};W.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0};W.expect=function(e){this.eat(e)||this.unexpected()};W.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var ze=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};W.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,t?"Assigning to rvalue":"Parenthesized pattern")}};W.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")};W.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")};W.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var E=F.prototype;E.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==h.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 Li={kind:"loop"},cn={kind:"switch"};E.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;tt.lastIndex=this.pos;var t=tt.exec(this.input),i=this.pos+t[0].length,r=this.input.charCodeAt(i);if(r===91||r===92)return!0;if(e)return!1;if(r===123||r>55295&&r<56320)return!0;if(xt(r,!0)){for(var s=i+1;Qt(r=this.input.charCodeAt(s),!0);)++s;if(r===92||r>55295&&r<56320)return!0;var n=this.input.slice(i,s);if(!Zs.test(n))return!0}return!1};E.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;tt.lastIndex=this.pos;var e=tt.exec(this.input),t=this.pos+e[0].length,i;return!et.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(Qt(i=this.input.charCodeAt(t+8))||i>55295&&i<56320))};E.parseStatement=function(e,t,i){var r=this.type,s=this.startNode(),n;switch(this.isLet(e)&&(r=h._var,n="let"),r){case h._break:case h._continue:return this.parseBreakContinueStatement(s,r.keyword);case h._debugger:return this.parseDebuggerStatement(s);case h._do:return this.parseDoStatement(s);case h._for:return this.parseForStatement(s);case h._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(s,!1,!e);case h._class:return e&&this.unexpected(),this.parseClass(s,!0);case h._if:return this.parseIfStatement(s);case h._return:return this.parseReturnStatement(s);case h._switch:return this.parseSwitchStatement(s);case h._throw:return this.parseThrowStatement(s);case h._try:return this.parseTryStatement(s);case h._const:case h._var:return n=n||this.value,e&&n!=="var"&&this.unexpected(),this.parseVarStatement(s,n);case h._while:return this.parseWhileStatement(s);case h._with:return this.parseWithStatement(s);case h.braceL:return this.parseBlock(!0,s);case h.semi:return this.parseEmptyStatement(s);case h._export:case h._import:if(this.options.ecmaVersion>10&&r===h._import){tt.lastIndex=this.pos;var a=tt.exec(this.input),o=this.pos+a[0].length,l=this.input.charCodeAt(o);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===h._import?this.parseImport(s):this.parseExport(s,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(s,!0,!e);var u=this.value,c=this.parseExpression();return r===h.name&&c.type==="Identifier"&&this.eat(h.colon)?this.parseLabeledStatement(s,u,c,e):this.parseExpressionStatement(s,c)}};E.parseBreakContinueStatement=function(e,t){var i=t==="break";this.next(),this.eat(h.semi)||this.insertSemicolon()?e.label=null:this.type!==h.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")};E.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")};E.parseDoStatement=function(e){return this.next(),this.labels.push(Li),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(h._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(h.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};E.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Li),this.enterScope(0),this.expect(h.parenL),this.type===h.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===h._var||this.type===h._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===h._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&r.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===h._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,o=new ze,l=this.parseExpression(t>-1?"await":!0,o);return this.type===h._in||(a=this.options.ecmaVersion>=6&&this.isContextual("of"))?(this.options.ecmaVersion>=9&&(this.type===h._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,o),this.checkLValPattern(l),this.parseForIn(e,l)):(this.checkExpressionErrors(o,!0),t>-1&&this.unexpected(t),this.parseFor(e,l))};E.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,fe|(i?0:Ai),!1,t)};E.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(h._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};E.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(h.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};E.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(h.braceL),this.labels.push(cn),this.enterScope(0);for(var t,i=!1;this.type!==h.braceR;)if(this.type===h._case||this.type===h._default){var r=this.type===h._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(h.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")};E.parseThrowStatement=function(e){return this.next(),et.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 hn=[];E.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===h._catch){var t=this.startNode();if(this.next(),this.eat(h.parenL)){t.param=this.parseBindingAtom();var i=t.param.type==="Identifier";this.enterScope(i?Sr:0),this.checkLValPattern(t.param,i?Ar:yt),this.expect(h.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(h._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};E.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")};E.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Li),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};E.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")};E.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};E.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 o=this.type.isLoop?"loop":this.type===h._switch?"switch":null,l=this.labels.length-1;l>=0;l--){var u=this.labels[l];if(u.statementStart===e.start)u.statementStart=this.start,u.kind=o;else break}return this.labels.push({name:t,kind:o,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")};E.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")};E.parseBlock=function(e,t,i){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(h.braceL),e&&this.enterScope(0);this.type!==h.braceR;){var r=this.parseStatement(null);t.body.push(r)}return i&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")};E.parseFor=function(e,t){return e.init=t,this.expect(h.semi),e.test=this.type===h.semi?null:this.parseExpression(),this.expect(h.semi),e.update=this.type===h.parenR?null:this.parseExpression(),this.expect(h.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};E.parseForIn=function(e,t){var i=this.type===h._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(h.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")};E.parseVar=function(e,t,i){for(e.declarations=[],e.kind=i;;){var r=this.startNode();if(this.parseVarId(r,i),this.eat(h.eq)?r.init=this.parseMaybeAssign(t):i==="const"&&!(this.type===h._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():r.id.type!=="Identifier"&&!(t&&(this.type===h._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(h.comma))break}return e};E.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?$i:yt,!1)};var fe=1,Ai=2,Ir=4;E.parseFunction=function(e,t,i,r,s){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===h.star&&t&Ai&&this.unexpected(),e.generator=this.eat(h.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&fe&&(e.id=t&Ir&&this.type!==h.name?null:this.parseIdent(),e.id&&!(t&Ai)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?$i:yt:kr));var n=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ni(e.async,e.generator)),t&fe||(e.id=this.type===h.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,!1,s),this.yieldPos=n,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,t&fe?"FunctionDeclaration":"FunctionExpression")};E.parseFunctionParams=function(e){this.expect(h.parenL),e.params=this.parseBindingList(h.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};E.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(h.braceL);this.type!==h.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"&&fn(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")};E.parseClassElement=function(e){if(this.eat(h.semi))return null;var t=this.options.ecmaVersion,i=this.startNode(),r="",s=!1,n=!1,a="method",o=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(h.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===h.star?o=!0:r="static"}if(i.static=o,!r&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===h.star)&&!this.canInsertSemicolon()?n=!0:r="async"),!r&&(t>=9||!n)&&this.eat(h.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===h.parenL||a!=="method"||s||n){var u=!i.static&&He(i,"constructor"),c=u&&e;u&&a!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=u?"constructor":a,this.parseClassMethod(i,s,n,c)}else this.parseClassField(i);return i};E.isClassElementNameStart=function(){return this.type===h.name||this.type===h.privateId||this.type===h.num||this.type===h.string||this.type===h.bracketL||this.type.keyword};E.parseClassElementName=function(e){this.type===h.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)};E.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&&He(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")};E.parseClassField=function(e){if(He(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&He(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(h.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")};E.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(ye|Oi);this.type!==h.braceR;){var i=this.parseStatement(null);e.body.push(i)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")};E.parseClassId=function(e,t){this.type===h.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,yt,!1)):(t===!0&&this.unexpected(),e.id=null)};E.parseClassSuper=function(e){e.superClass=this.eat(h._extends)?this.parseExprSubscripts(null,!1):null};E.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};E.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];de(t,a.name)||(s?s.used.push(a):this.raiseRecoverable(a.start,"Private field '#"+a.name+"' must be declared in an enclosing class"))}};function fn(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 He(e,t){var i=e.computed,r=e.key;return!i&&(r.type==="Identifier"&&r.name===t||r.type==="Literal"&&r.value===t)}E.parseExport=function(e,t){if(this.next(),this.eat(h.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!==h.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(h._default)){this.checkExport(t,"default",this.lastTokStart);var i;if(this.type===h._function||(i=this.isAsyncFunction())){var r=this.startNode();this.next(),i&&this.next(),e.declaration=this.parseFunction(r,fe|Ir,!1,i)}else if(this.type===h._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!==h.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var n=0,a=e.specifiers;n<a.length;n+=1){var o=a[n];this.checkUnreserved(o.local),this.checkLocalExport(o.local),o.local.type==="Literal"&&this.raise(o.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")};E.checkExport=function(e,t,i){!e||(typeof t!="string"&&(t=t.type==="Identifier"?t.name:t.value),de(e,t)&&this.raiseRecoverable(i,"Duplicate export '"+t+"'"),e[t]=!0)};E.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,o=t.elements;a<o.length;a+=1){var l=o[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)};E.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)}};E.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};E.parseExportSpecifiers=function(e){var t=[],i=!0;for(this.expect(h.braceL);!this.eat(h.braceR);){if(i)i=!1;else if(this.expect(h.comma),this.afterTrailingComma(h.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};E.parseImport=function(e){return this.next(),this.type===h.string?(e.specifiers=hn,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===h.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(e,"ImportDeclaration")};E.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===h.name){var i=this.startNode();if(i.local=this.parseIdent(),this.checkLValSimple(i.local,yt),e.push(this.finishNode(i,"ImportDefaultSpecifier")),!this.eat(h.comma))return e}if(this.type===h.star){var r=this.startNode();return this.next(),this.expectContextual("as"),r.local=this.parseIdent(),this.checkLValSimple(r.local,yt),e.push(this.finishNode(r,"ImportNamespaceSpecifier")),e}for(this.expect(h.braceL);!this.eat(h.braceR);){if(t)t=!1;else if(this.expect(h.comma),this.afterTrailingComma(h.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,yt),e.push(this.finishNode(s,"ImportSpecifier"))}return e};E.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===h.string){var e=this.parseLiteral(this.value);return an.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)};E.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)};E.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var nt=F.prototype;nt.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};nt.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};nt.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")};nt.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==h.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")};nt.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case h.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(h.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case h.braceL:return this.parseObj(!0)}return this.parseIdent()};nt.parseBindingList=function(e,t,i){for(var r=[],s=!0;!this.eat(e);)if(s?s=!1:this.expect(h.comma),t&&this.type===h.comma)r.push(null);else{if(i&&this.afterTrailingComma(e))break;if(this.type===h.ellipsis){var n=this.parseRestBinding();this.parseBindingListItem(n),r.push(n),this.type===h.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};nt.parseBindingListItem=function(e){return e};nt.parseMaybeDefault=function(e,t,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(h.eq))return i;var r=this.startNodeAt(e,t);return r.left=i,r.right=this.parseMaybeAssign(),this.finishNode(r,"AssignmentPattern")};nt.checkLValSimple=function(e,t,i){t===void 0&&(t=Be);var r=t!==Be;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===yt&&e.name==="let"&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),i&&(de(i,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),i[e.name]=!0),t!==Pr&&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")}};nt.checkLValPattern=function(e,t,i){switch(t===void 0&&(t=Be),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,o=e.elements;a<o.length;a+=1){var l=o[a];l&&this.checkLValInnerPattern(l,t,i)}break;default:this.checkLValSimple(e,t,i)}};nt.checkLValInnerPattern=function(e,t,i){switch(t===void 0&&(t=Be),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 st=function(t,i,r,s,n){this.token=t,this.isExpr=!!i,this.preserveSpace=!!r,this.override=s,this.generator=!!n},V={b_stat:new st("{",!1),b_expr:new st("{",!0),b_tmpl:new st("${",!1),p_stat:new st("(",!1),p_expr:new st("(",!0),q_tmpl:new st("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new st("function",!1),f_expr:new st("function",!0),f_expr_gen:new st("function",!0,!1,null,!0),f_gen:new st("function",!1,!1,null,!0)},Yt=F.prototype;Yt.initialContext=function(){return[V.b_stat]};Yt.curContext=function(){return this.context[this.context.length-1]};Yt.braceIsBlock=function(e){var t=this.curContext();return t===V.f_expr||t===V.f_stat?!0:e===h.colon&&(t===V.b_stat||t===V.b_expr)?!t.isExpr:e===h._return||e===h.name&&this.exprAllowed?et.test(this.input.slice(this.lastTokEnd,this.start)):e===h._else||e===h.semi||e===h.eof||e===h.parenR||e===h.arrow?!0:e===h.braceL?t===V.b_stat:e===h._var||e===h._const||e===h.name?!1:!this.exprAllowed};Yt.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};Yt.updateContext=function(e){var t,i=this.type;i.keyword&&e===h.dot?this.exprAllowed=!1:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr};Yt.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)};h.parenR.updateContext=h.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();e===V.b_stat&&this.curContext().token==="function"&&(e=this.context.pop()),this.exprAllowed=!e.isExpr};h.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?V.b_stat:V.b_expr),this.exprAllowed=!0};h.dollarBraceL.updateContext=function(){this.context.push(V.b_tmpl),this.exprAllowed=!0};h.parenL.updateContext=function(e){var t=e===h._if||e===h._for||e===h._with||e===h._while;this.context.push(t?V.p_stat:V.p_expr),this.exprAllowed=!0};h.incDec.updateContext=function(){};h._function.updateContext=h._class.updateContext=function(e){e.beforeExpr&&e!==h._else&&!(e===h.semi&&this.curContext()!==V.p_stat)&&!(e===h._return&&et.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===h.colon||e===h.braceL)&&this.curContext()===V.b_stat)?this.context.push(V.f_expr):this.context.push(V.f_stat),this.exprAllowed=!1};h.backQuote.updateContext=function(){this.curContext()===V.q_tmpl?this.context.pop():this.context.push(V.q_tmpl),this.exprAllowed=!1};h.star.updateContext=function(e){if(e===h._function){var t=this.context.length-1;this.context[t]===V.f_expr?this.context[t]=V.f_expr_gen:this.context[t]=V.f_gen}this.exprAllowed=!0};h.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==h.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var C=F.prototype;C.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 o;n==="init"?o=this.strict&&a.init||a.get||a.set:o=a.init||a[n],o&&this.raiseRecoverable(r.start,"Redefinition of property")}else a=t[s]={init:!1,get:!1,set:!1};a[n]=!0}};C.parseExpression=function(e,t){var i=this.start,r=this.startLoc,s=this.parseMaybeAssign(e,t);if(this.type===h.comma){var n=this.startNodeAt(i,r);for(n.expressions=[s];this.eat(h.comma);)n.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(n,"SequenceExpression")}return s};C.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 ze,r=!0);var o=this.start,l=this.startLoc;(this.type===h.parenL||this.type===h.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await");var u=this.parseMaybeConditional(e,t);if(i&&(u=i.call(this,u,o,l)),this.type.isAssign){var c=this.startNodeAt(o,l);return c.operator=this.value,this.type===h.eq&&(u=this.toAssignable(u,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=u.start&&(t.shorthandAssign=-1),this.type===h.eq?this.checkLValPattern(u):this.checkLValSimple(u),c.left=u,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),u};C.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(h.question)){var n=this.startNodeAt(i,r);return n.test=s,n.consequent=this.parseMaybeAssign(),this.expect(h.colon),n.alternate=this.parseMaybeAssign(e),this.finishNode(n,"ConditionalExpression")}return s};C.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)};C.parseExprOp=function(e,t,i,r,s){var n=this.type.binop;if(n!=null&&(!s||this.type!==h._in)&&n>r){var a=this.type===h.logicalOR||this.type===h.logicalAND,o=this.type===h.coalesce;o&&(n=h.logicalAND.binop);var l=this.value;this.next();var u=this.start,c=this.startLoc,f=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,s),u,c,n,s),p=this.buildBinary(t,i,e,f,l,a||o);return(a&&this.type===h.coalesce||o&&(this.type===h.logicalOR||this.type===h.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(p,t,i,r,s)}return e};C.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")};C.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 o=this.startNode(),l=this.type===h.incDec;o.operator=this.value,o.prefix=!0,this.next(),o.argument=this.parseMaybeUnary(null,!0,l,r),this.checkExpressionErrors(e,!0),l?this.checkLValSimple(o.argument):this.strict&&o.operator==="delete"&&o.argument.type==="Identifier"?this.raiseRecoverable(o.start,"Deleting local variable in strict mode"):o.operator==="delete"&&Or(o.argument)?this.raiseRecoverable(o.start,"Private fields can not be deleted"):t=!0,a=this.finishNode(o,l?"UpdateExpression":"UnaryExpression")}else if(!t&&this.type===h.privateId)(r||this.privateNameStack.length===0)&&this.unexpected(),a=this.parsePrivateIdent(),this.type!==h._in&&this.unexpected();else{if(a=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return a;for(;this.type.postfix&&!this.canInsertSemicolon();){var u=this.startNodeAt(s,n);u.operator=this.value,u.prefix=!1,u.argument=a,this.checkLValSimple(a),this.next(),a=this.finishNode(u,"UpdateExpression")}}if(!i&&this.eat(h.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 Or(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&Or(e.expression)}C.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};C.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 o=this.parseSubscript(e,t,i,r,n,a,s);if(o.optional&&(a=!0),o===e||o.type==="ArrowFunctionExpression"){if(a){var l=this.startNodeAt(t,i);l.expression=o,o=this.finishNode(l,"ChainExpression")}return o}e=o}};C.parseSubscript=function(e,t,i,r,s,n,a){var o=this.options.ecmaVersion>=11,l=o&&this.eat(h.questionDot);r&&l&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var u=this.eat(h.bracketL);if(u||l&&this.type!==h.parenL&&this.type!==h.backQuote||this.eat(h.dot)){var c=this.startNodeAt(t,i);c.object=e,u?(c.property=this.parseExpression(),this.expect(h.bracketR)):this.type===h.privateId&&e.type!=="Super"?c.property=this.parsePrivateIdent():c.property=this.parseIdent(this.options.allowReserved!=="never"),c.computed=!!u,o&&(c.optional=l),e=this.finishNode(c,"MemberExpression")}else if(!r&&this.eat(h.parenL)){var f=new ze,p=this.yieldPos,d=this.awaitPos,y=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var x=this.parseExprList(h.parenR,this.options.ecmaVersion>=8,!1,f);if(s&&!l&&!this.canInsertSemicolon()&&this.eat(h.arrow))return this.checkPatternErrors(f,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=p,this.awaitPos=d,this.awaitIdentPos=y,this.parseArrowExpression(this.startNodeAt(t,i),x,!0,a);this.checkExpressionErrors(f,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=d||this.awaitPos,this.awaitIdentPos=y||this.awaitIdentPos;var w=this.startNodeAt(t,i);w.callee=e,w.arguments=x,o&&(w.optional=l),e=this.finishNode(w,"CallExpression")}else if(this.type===h.backQuote){(l||n)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var g=this.startNodeAt(t,i);g.tag=e,g.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(g,"TaggedTemplateExpression")}return e};C.parseExprAtom=function(e,t){this.type===h.slash&&this.readRegexp();var i,r=this.potentialArrowAt===this.start;switch(this.type){case h._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),i=this.startNode(),this.next(),this.type===h.parenL&&!this.allowDirectSuper&&this.raise(i.start,"super() call outside constructor of a subclass"),this.type!==h.dot&&this.type!==h.bracketL&&this.type!==h.parenL&&this.unexpected(),this.finishNode(i,"Super");case h._this:return i=this.startNode(),this.next(),this.finishNode(i,"ThisExpression");case h.name:var s=this.start,n=this.startLoc,a=this.containsEsc,o=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!a&&o.name==="async"&&!this.canInsertSemicolon()&&this.eat(h._function))return this.overrideContext(V.f_expr),this.parseFunction(this.startNodeAt(s,n),0,!1,!0,t);if(r&&!this.canInsertSemicolon()){if(this.eat(h.arrow))return this.parseArrowExpression(this.startNodeAt(s,n),[o],!1,t);if(this.options.ecmaVersion>=8&&o.name==="async"&&this.type===h.name&&!a&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return o=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(h.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(s,n),[o],!0,t)}return o;case h.regexp:var l=this.value;return i=this.parseLiteral(l.value),i.regex={pattern:l.pattern,flags:l.flags},i;case h.num:case h.string:return this.parseLiteral(this.value);case h._null:case h._true:case h._false:return i=this.startNode(),i.value=this.type===h._null?null:this.type===h._true,i.raw=this.type.keyword,this.next(),this.finishNode(i,"Literal");case h.parenL:var u=this.start,c=this.parseParenAndDistinguishExpression(r,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(c)&&(e.parenthesizedAssign=u),e.parenthesizedBind<0&&(e.parenthesizedBind=u)),c;case h.bracketL:return i=this.startNode(),this.next(),i.elements=this.parseExprList(h.bracketR,!0,!0,e),this.finishNode(i,"ArrayExpression");case h.braceL:return this.overrideContext(V.b_expr),this.parseObj(!1,e);case h._function:return i=this.startNode(),this.next(),this.parseFunction(i,0);case h._class:return this.parseClass(this.startNode(),!1);case h._new:return this.parseNew();case h.backQuote:return this.parseTemplate();case h._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}};C.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 h.parenL:return this.parseDynamicImport(e);case h.dot:return e.meta=t,this.parseImportMeta(e);default:this.unexpected()}};C.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(h.parenR)){var t=this.start;this.eat(h.comma)&&this.eat(h.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")};C.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")};C.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")};C.parseParenExpression=function(){this.expect(h.parenL);var e=this.parseExpression();return this.expect(h.parenR),e};C.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,o=this.startLoc,l=[],u=!0,c=!1,f=new ze,p=this.yieldPos,d=this.awaitPos,y;for(this.yieldPos=0,this.awaitPos=0;this.type!==h.parenR;)if(u?u=!1:this.expect(h.comma),n&&this.afterTrailingComma(h.parenR,!0)){c=!0;break}else if(this.type===h.ellipsis){y=this.start,l.push(this.parseParenItem(this.parseRestBinding())),this.type===h.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}else l.push(this.parseMaybeAssign(!1,f,this.parseParenItem));var x=this.lastTokEnd,w=this.lastTokEndLoc;if(this.expect(h.parenR),e&&!this.canInsertSemicolon()&&this.eat(h.arrow))return this.checkPatternErrors(f,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=p,this.awaitPos=d,this.parseParenArrowList(i,r,l,t);(!l.length||c)&&this.unexpected(this.lastTokStart),y&&this.unexpected(y),this.checkExpressionErrors(f,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=d||this.awaitPos,l.length>1?(s=this.startNodeAt(a,o),s.expressions=l,this.finishNodeAt(s,"SequenceExpression",x,w)):s=l[0]}else s=this.parseParenExpression();if(this.options.preserveParens){var g=this.startNodeAt(i,r);return g.expression=s,this.finishNode(g,"ParenthesizedExpression")}else return s};C.parseParenItem=function(e){return e};C.parseParenArrowList=function(e,t,i,r){return this.parseArrowExpression(this.startNodeAt(e,t),i,!1,r)};var pn=[];C.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(h.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===h._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(h.parenL)?e.arguments=this.parseExprList(h.parenR,this.options.ecmaVersion>=8,!1):e.arguments=pn,this.finishNode(e,"NewExpression")};C.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===h.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,`
|
|
4
|
-
`),cooked:this.value},this.next(),i.tail=this.type===h.backQuote,this.finishNode(i,"TemplateElement")};C.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===h.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(h.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(h.braceR),i.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")};C.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===h.name||this.type===h.num||this.type===h.string||this.type===h.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===h.star)&&!et.test(this.input.slice(this.lastTokEnd,this.start))};C.parseObj=function(e,t){var i=this.startNode(),r=!0,s={};for(i.properties=[],this.next();!this.eat(h.braceR);){if(r)r=!1;else if(this.expect(h.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(h.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")};C.parseProperty=function(e,t){var i=this.startNode(),r,s,n,a;if(this.options.ecmaVersion>=9&&this.eat(h.ellipsis))return e?(i.argument=this.parseIdent(!1),this.type===h.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(!1,t),this.type===h.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(h.star)));var o=this.containsEsc;return this.parsePropertyName(i),!e&&!o&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(i)?(s=!0,r=this.options.ecmaVersion>=9&&this.eat(h.star),this.parsePropertyName(i)):s=!1,this.parsePropertyValue(i,e,r,s,n,a,t,o),this.finishNode(i,"Property")};C.parsePropertyValue=function(e,t,i,r,s,n,a,o){if((i||r)&&this.type===h.colon&&this.unexpected(),this.eat(h.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===h.parenL)t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(i,r);else if(!t&&!o&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==h.comma&&this.type!==h.braceR&&this.type!==h.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 u=e.value.start;e.kind==="get"?this.raiseRecoverable(u,"getter should have no params"):this.raiseRecoverable(u,"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===h.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()};C.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(h.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(h.bracketR),e.key;e.computed=!1}return e.key=this.type===h.num||this.type===h.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};C.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)};C.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(Ni(t,r.generator)|Oi|(i?Cr:0)),this.expect(h.parenL),r.params=this.parseBindingList(h.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")};C.parseArrowExpression=function(e,t,i,r){var s=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.enterScope(Ni(i,!1)|Er),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")};C.parseFunctionBody=function(e,t,i,r){var s=t&&this.type!==h.braceL,n=this.strict,a=!1;if(s)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!n||o)&&(a=this.strictDirective(this.end),a&&o&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var 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,Pr),e.body=this.parseBlock(!1,void 0,a&&!n),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=l}this.exitScope()};C.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};C.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,$i,t?null:i)}};C.parseExprList=function(e,t,i,r){for(var s=[],n=!0;!this.eat(e);){if(n)n=!1;else if(this.expect(h.comma),t&&this.afterTrailingComma(e))break;var a=void 0;i&&this.type===h.comma?a=null:this.type===h.ellipsis?(a=this.parseSpread(r),r&&this.type===h.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):a=this.parseMaybeAssign(!1,r),s.push(a)}return s};C.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"))}};C.parseIdent=function(e){var t=this.startNode();return this.type===h.name?t.name=this.value:this.type.keyword?(t.name=this.type.keyword,(t.name==="class"||t.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop()):this.unexpected(),this.next(!!e),this.finishNode(t,"Identifier"),e||(this.checkUnreserved(t),t.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t};C.parsePrivateIdent=function(){var e=this.startNode();return this.type===h.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};C.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===h.semi||this.canInsertSemicolon()||this.type!==h.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(h.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")};C.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 We=F.prototype;We.raise=function(e,t){var i=vr(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};We.raiseRecoverable=We.raise;We.curPosition=function(){if(this.options.locations)return new pe(this.curLine,this.pos-this.lineStart)};var Pt=F.prototype,mn=function(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[],this.inClassFieldInit=!1};Pt.enterScope=function(e){this.scopeStack.push(new mn(e))};Pt.exitScope=function(){this.scopeStack.pop()};Pt.treatFunctionsAsVarInScope=function(e){return e.flags&Kt||!this.inModule&&e.flags&me};Pt.declareName=function(e,t,i){var r=!1;if(t===yt){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&me&&delete this.undefinedExports[e]}else if(t===Ar){var n=this.currentScope();n.lexical.push(e)}else if(t===kr){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 o=this.scopeStack.length-1;o>=0;--o){var l=this.scopeStack[o];if(l.lexical.indexOf(e)>-1&&!(l.flags&Sr&&l.lexical[0]===e)||!this.treatFunctionsAsVarInScope(l)&&l.functions.indexOf(e)>-1){r=!0;break}if(l.var.push(e),this.inModule&&l.flags&me&&delete this.undefinedExports[e],l.flags&Ti)break}r&&this.raiseRecoverable(i,"Identifier '"+e+"' has already been declared")};Pt.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)};Pt.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};Pt.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&Ti)return t}};Pt.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&Ti&&!(t.flags&Er))return t}};var Ge=function(t,i,r){this.type="",this.start=i,this.end=0,t.options.locations&&(this.loc=new Ue(t,r)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[i,0])},xe=F.prototype;xe.startNode=function(){return new Ge(this,this.start,this.startLoc)};xe.startNodeAt=function(e,t){return new Ge(this,e,t)};function Tr(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}xe.finishNode=function(e,t){return Tr.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)};xe.finishNodeAt=function(e,t,i,r){return Tr.call(this,e,t,i,r)};xe.copyNode=function(e){var t=new Ge(this,e.start,this.startLoc);for(var i in e)t[i]=e[i];return t};var Nr="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",$r=Nr+" Extended_Pictographic",Lr=$r,Rr=Lr+" EBase EComp EMod EPres ExtPict",Mr=Rr,dn=Mr,yn={9:Nr,10:$r,11:Lr,12:Rr,13:Mr,14:dn},mr="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",Vr="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",Dr=Vr+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Fr=Dr+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",qr=Fr+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",jr=qr+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",xn=jr+" Kawi Nag_Mundari Nagm",gn={9:Vr,10:Dr,11:Fr,12:qr,13:jr,14:xn},Br={};function bn(e){var t=Br[e]={binary:$t(yn[e]+" "+mr),nonBinary:{General_Category:$t(mr),Script:$t(gn[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(je=0,Si=[9,10,11,12,13,14];je<Si.length;je+=1)dr=Si[je],bn(dr);var dr,je,Si,_=F.prototype,gt=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=Br[t.options.ecmaVersion>=14?14: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=[]};gt.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};gt.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)};gt.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};gt.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};gt.prototype.current=function(t){return t===void 0&&(t=!1),this.at(this.pos,t)};gt.prototype.lookahead=function(t){return t===void 0&&(t=!1),this.at(this.nextIndex(this.pos,t),t)};gt.prototype.advance=function(t){t===void 0&&(t=!1),this.pos=this.nextIndex(this.pos,t)};gt.prototype.eat=function(t,i){return i===void 0&&(i=!1),this.current(i)===t?(this.advance(i),!0):!1};_.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")}};_.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))};_.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")}};_.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")};_.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););};_.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};_.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};_.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1};_.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)};_.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};_.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)};_.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1};_.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};_.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};_.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)};_.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1};_.regexp_eatSyntaxCharacter=function(e){var t=e.current();return Hr(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Hr(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}_.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;(i=e.current())!==-1&&!Hr(i);)e.advance();return e.pos!==t};_.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};_.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")}};_.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};_.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=At(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=At(e.lastIntValue);return!0}return!1};_.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),wn(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function wn(e){return xt(e,!0)||e===36||e===95}_.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),vn(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function vn(e){return Qt(e,!0)||e===36||e===95||e===8204||e===8205}_.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)};_.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};_.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};_.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)};_.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1};_.regexp_eatZero=function(e){return e.current()===48&&!Qe(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1};_.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};_.regexp_eatControlLetter=function(e){var t=e.current();return Wr(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function Wr(e){return e>=65&&e<=90||e>=97&&e<=122}_.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)&&_n(e.lastIntValue))return!0;r&&e.raise("Invalid unicode escape"),e.pos=i}return!1};function _n(e){return e>=0&&e<=1114111}_.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};_.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};_.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(En(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 En(e){return e===100||e===68||e===115||e===83||e===119||e===87}_.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};_.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){de(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value")};_.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name")};_.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Ur(t=e.current());)e.lastStringValue+=At(t),e.advance();return e.lastStringValue!==""};function Ur(e){return Wr(e)||e===95}_.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";Sn(t=e.current());)e.lastStringValue+=At(t),e.advance();return e.lastStringValue!==""};function Sn(e){return Ur(e)||Qe(e)}_.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};_.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};_.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")}}};_.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||Qr(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};_.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)};_.regexp_eatClassControlLetter=function(e){var t=e.current();return Qe(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1};_.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};_.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Qe(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t};function Qe(e){return e>=48&&e<=57}_.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;zr(i=e.current());)e.lastIntValue=16*e.lastIntValue+Gr(i),e.advance();return e.pos!==t};function zr(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Gr(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}_.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};_.regexp_eatOctalDigit=function(e){var t=e.current();return Qr(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function Qr(e){return e>=48&&e<=55}_.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var s=e.current();if(!zr(s))return e.pos=i,!1;e.lastIntValue=16*e.lastIntValue+Gr(s),e.advance()}return!0};var Ri=function(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new Ue(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end])},k=F.prototype;k.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 Ri(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};k.getToken=function(){return this.next(),new Ri(this)};typeof Symbol<"u"&&(k[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===h.eof,value:t}}}});k.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(h.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())};k.readToken=function(e){return xt(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};k.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};k.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=gr(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())};k.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&&!Xt(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())};k.skipSpace=function(){t: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 t}break;default:if(e>8&&e<14||e>=5760&&br.test(String.fromCharCode(e)))++this.pos;else break t}}};k.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)};k.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(h.ellipsis)):(++this.pos,this.finishToken(h.dot))};k.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(h.assign,2):this.finishOp(h.slash,1)};k.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,r=e===42?h.star:h.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++i,r=h.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(h.assign,i+1):this.finishOp(r,i)};k.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(h.assign,3)}return this.finishOp(e===124?h.logicalOR:h.logicalAND,2)}return t===61?this.finishOp(h.assign,2):this.finishOp(e===124?h.bitwiseOR:h.bitwiseAND,1)};k.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(h.assign,2):this.finishOp(h.bitwiseXOR,1)};k.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||et.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(h.incDec,2):t===61?this.finishOp(h.assign,2):this.finishOp(h.plusMin,1)};k.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(h.assign,i+1):this.finishOp(h.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(h.relational,i))};k.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(h.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(h.arrow)):this.finishOp(e===61?h.eq:h.prefix,1)};k.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(h.questionDot,2)}if(t===63){if(e>=12){var r=this.input.charCodeAt(this.pos+2);if(r===61)return this.finishOp(h.assign,3)}return this.finishOp(h.coalesce,2)}}return this.finishOp(h.question,1)};k.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),xt(t,!0)||t===92))return this.finishToken(h.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+At(t)+"'")};k.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(h.parenL);case 41:return++this.pos,this.finishToken(h.parenR);case 59:return++this.pos,this.finishToken(h.semi);case 44:return++this.pos,this.finishToken(h.comma);case 91:return++this.pos,this.finishToken(h.bracketL);case 93:return++this.pos,this.finishToken(h.bracketR);case 123:return++this.pos,this.finishToken(h.braceL);case 125:return++this.pos,this.finishToken(h.braceR);case 58:return++this.pos,this.finishToken(h.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(h.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(h.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+At(e)+"'")};k.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)};k.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(et.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 o=this.regexpState||(this.regexpState=new gt(this));o.reset(i,s,a),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var l=null;try{l=new RegExp(s,a)}catch{}return this.finishToken(h.regexp,{pattern:s,flags:a,value:l})};k.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,o=0,l=0,u=t??1/0;l<u;++l,++this.pos){var c=this.input.charCodeAt(this.pos),f=void 0;if(r&&c===95){s&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),o===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),l===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),o=c;continue}if(c>=97?f=c-97+10:c>=65?f=c-65+10:c>=48&&c<=57?f=c-48:f=1/0,f>=e)break;o=c,a=a*e+f}return r&&o===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===n||t!=null&&this.pos-n!==t?null:a};function Cn(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function Xr(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}k.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=Xr(this.input.slice(t,this.pos)),++this.pos):xt(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(h.num,i)};k.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=Xr(this.input.slice(t,this.pos));return++this.pos,xt(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(h.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")),xt(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var n=Cn(this.input.slice(t,this.pos),i);return this.finishToken(h.num,n)};k.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};k.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)):(Xt(r)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(i,this.pos++),this.finishToken(h.string,t)};var Kr={};k.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===Kr)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};k.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Kr;this.raise(e,t)};k.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===h.template||this.type===h.invalidTemplate)?i===36?(this.pos+=2,this.finishToken(h.dollarBraceL)):(++this.pos,this.finishToken(h.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(h.template,e));if(i===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(Xt(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+=`
|
|
5
|
-
`;break;default:e+=String.fromCharCode(i);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}};
|
|
6
|
-
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return
|
|
7
|
-
`),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
|
|
8
|
-
`,a):(e.write("/*"),In(e,a.value,i,r),e.write("*/"+r))}}function On(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 Mi(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 Jr,Zr,ts,es,is,rs,Tn={Program(e,t){let i=t.indent.repeat(t.indentLevel),{lineEnd:r,writeComments:s}=t;s&&e.comments!=null&&U(t,e.comments,i,r);let n=e.body,{length:a}=n;for(let o=0;o<a;o++){let l=n[o];s&&l.comments!=null&&U(t,l.comments,i,r),t.write(i),this[l.type](l,t),t.write(r)}s&&e.trailingComments!=null&&U(t,e.trailingComments,i,r)},BlockStatement:rs=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&&U(t,e.comments,n,r);let{length:o}=a;for(let l=0;l<o;l++){let u=a[l];s&&u.comments!=null&&U(t,u.comments,n,r),t.write(n),this[u.type](u,t),t.write(r)}t.write(i)}else s&&e.comments!=null&&(t.write(r),U(t,e.comments,n,r),t.write(i));s&&e.trailingComments!=null&&U(t,e.trailingComments,n,r),t.write("}"),t.indentLevel--},ClassBody:rs,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===at||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:o}=e,{length:l}=o;for(let u=0;u<l;u++){let c=o[u];s&&c.comments!=null&&U(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:f}=c,{length:p}=f;for(let d=0;d<p;d++){let y=f[d];s&&y.comments!=null&&U(t,y.comments,a,r),t.write(a),this[y.type](y,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"?Mi(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:Jr=function(e,t){t.write(`for ${e.await?"await ":""}(`);let{left:i}=e;i.type[0]==="V"?Mi(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:Jr,DebuggerStatement(e,t){t.write("debugger;",e)},FunctionDeclaration:Zr=function(e,t){t.write((e.async?"async ":"")+(e.generator?"function* ":"function ")+(e.id?e.id.name:""),e),Jt(t,e.params),t.write(" "),this[e.body.type](e.body,t)},FunctionExpression:Zr,VariableDeclaration(e,t){Mi(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===at||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),Jt(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]):Jt(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:ts=function(e,t){t.write("..."),this[e.argument.type](e.argument,t)},SpreadElement:ts,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),Ke(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 o=r[a],l=i[a];t.write(l.value.raw,l),t.write("${"),this[o.type](o,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){Ke(t,e.tag,e),this[e.quasi.type](e.quasi,t)},ArrayExpression:is=function(e,t){if(t.write("["),e.elements.length>0){let{elements: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:is,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&&U(t,e.comments,n,r);let a=","+r,{properties:o}=e,{length:l}=o;for(let u=0;;){let c=o[u];if(s&&c.comments!=null&&U(t,c.comments,n,r),t.write(n),this[c.type](c,t),++u<l)t.write(a);else break}t.write(r),s&&e.trailingComments!=null&&U(t,e.trailingComments,n,r),t.write(i+"}")}else s?e.comments!=null?(t.write(r),U(t,e.comments,n,r),e.trailingComments!=null&&U(t,e.trailingComments,n,r),t.write(i+"}")):e.trailingComments!=null?(t.write(r),U(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){if(e.static&&t.write("static "),e.computed&&t.write("["),this[e.key.type](e.key,t),e.computed&&t.write("]"),e.value==null){e.key.type[0]!=="F"&&t.write(";");return}t.write(" = "),this[e.value.type](e.value,t),t.write(";")},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){Jt(t,e.expressions)},UnaryExpression(e,t){if(e.prefix){let{operator:i,argument:r,argument:{type:s}}=e;t.write(i);let n=ss(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:es=function(e,t){let i=e.operator==="in";i&&t.write("("),Ke(t,e.left,e,!1),t.write(" "+e.operator+" "),Ke(t,e.right,e,!0),i&&t.write(")")},LogicalExpression:es,ConditionalExpression(e,t){let{test:i}=e,r=t.expressionsPrecedence[i.type];r===at||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===at||i<t.expressionsPrecedence.CallExpression||On(e.callee)?(t.write("("),this[e.callee.type](e.callee,t),t.write(")")):this[e.callee.type](e.callee,t),Jt(t,e.arguments)},CallExpression(e,t){let i=t.expressionsPrecedence[e.callee.type];i===at||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("?."),Jt(t,e.arguments)},ChainExpression(e,t){this[e.expression.type](e.expression,t)},MemberExpression(e,t){let i=t.expressionsPrecedence[e.object.type];i===at||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(An(e.value),e)},RegExpLiteral(e,t){let{regex:i}=e;t.write(`/${i.pattern}/${i.flags}`,e)}},Nn={};var Vi=class{constructor(t){let i=t??Nn;this.output="",i.output!=null?(this.output=i.output,this.write=this.writeToStream):this.output="",this.generator=i.generator!=null?i.generator:Tn,this.expressionsPrecedence=i.expressionsPrecedence!=null?i.expressionsPrecedence:Pn,this.indent=i.indent!=null?i.indent:" ",this.lineEnd=i.lineEnd!=null?i.lineEnd:`
|
|
1
|
+
(()=>{var cr=Object.defineProperty;var Fs=(e,t,i)=>t in e?cr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var hi=(e,t)=>{for(var i in t)cr(e,i,{get:t[i],enumerable:!0})};var G=(e,t,i)=>(Fs(e,typeof t!="symbol"?t+"":t,i),i);var Gi={};hi(Gi,{Observer:()=>L,QuantumAsyncFunction:()=>Xn,QuantumAsyncScript:()=>$e,QuantumFunction:()=>Qn,QuantumModule:()=>Le,QuantumScript:()=>Ne,State:()=>Ht});var Ai={};hi(Ai,{apply:()=>He,batch:()=>ze,construct:()=>_i,defineProperties:()=>nn,defineProperty:()=>xe,deleteProperties:()=>an,deleteProperty:()=>be,get:()=>vt,getOwnPropertyDescriptor:()=>We,getOwnPropertyDescriptors:()=>rn,getPrototypeOf:()=>wi,has:()=>Ue,intercept:()=>en,isExtensible:()=>vi,map:()=>sn,observe:()=>ki,ownKeys:()=>ye,path:()=>tn,preventExtensions:()=>Ei,reduce:()=>Ci,set:()=>Dt,setPrototypeOf:()=>Si});function M(e){return!Array.isArray(e)&&typeof e=="object"&&e}function Kt(e){return typeof e}function $(e){return Array.isArray(e)}function fi(e,t,i=null){return $(t)?e.filter(r=>i?t.filter(s=>i(r,s)).length:t.indexOf(r)!==-1):[]}function Ot(e,...t){if(globalThis.webqit||(globalThis.webqit={}),globalThis.webqit.refs||Object.defineProperty(globalThis.webqit,"refs",{value:new ce}),!arguments.length)return globalThis.webqit.refs;let i=globalThis.webqit.refs.get(e);i||(i=new ce,globalThis.webqit.refs.set(e,i));let r,s;for(;r=t.shift();)(s=i)&&!(i=i.get(r))&&(i=new ce,s.set(r,i));return i}var ce=class extends Map{constructor(...t){super(...t),this.observers=new Set}set(t,i){let r=super.set(t,i);return this.fire("set",t,i,t),r}delete(t){let i=super.delete(t);return this.fire("delete",t),i}has(t){return this.fire("has",t),super.has(t)}get(t){return this.fire("get",t),super.get(t)}keyNames(){return Array.from(super.keys())}observe(t,i,r){let s={type:t,key:i,callback:r};return this.observers.add(s),()=>this.observers.delete(s)}unobserve(t,i,r){if(Array.isArray(t)||Array.isArray(i))throw new Error('The "type" and "key" arguments can only be strings.');for(let s of this.observers)!(qe([t,"*"],s.type)&&qe([i,"*"],s.key)&&s.callback===r)||this.observers.delete(s)}fire(t,i,...r){for(let s of this.observers)!(qe([t,"*"],s.type)&&qe([i,"*"],s.key))||s.callback(...r)}},qe=(e,t)=>Array.isArray(t)?fi(e,t).length:e.includes(t);function Yt(e){return typeof e=="function"}function he(e){return e===null||e===""}function bt(e){return arguments.length&&(e===void 0||typeof e>"u")}function D(e){return Array.isArray(e)||typeof e=="object"&&e||Yt(e)}function pi(e){return he(e)||bt(e)||e===!1||e===0||D(e)&&!Object.keys(e).length}function V(e){return Yt(e)||e&&{}.toString.call(e)==="[object function]"}function fe(e){return e instanceof Number||typeof e=="number"}function it(e){return fe(e)||e!==!0&&e!==!1&&e!==null&&e!==""&&!isNaN(e*1)}function Jt(e){return e instanceof String||typeof e=="string"&&e!==null}function di(e){return!Jt(e)&&!bt(e.length)}function Fe(e,...t){return t.forEach(i=>{e.indexOf(i)<0&&e.push(i)}),e}function mi(r,t){t=t||Object.prototype,t=t&&!$(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 gi(e,t){var i=[];return mi(e,t).forEach(r=>{Fe(i,...Object.getOwnPropertyNames(r))}),i}function ht(e,t,i=!1,r=!1,s=!1){var n=0,a=e.shift();if((it(a)||a===!0||a===!1)&&(n=a,a=e.shift()),!e.length)throw new Error("_merge() requires two or more array/objects.");return e.forEach((o,u)=>{!D(o)&&!V(o)||(i?gi(o):Object.keys(o)).forEach(l=>{if(!!t(l,a,o,u)){var c=a[l],f=o[l];if(($(c)&&$(f)||M(c)&&M(f))&&(n===!0||n>0))a[l]=$(c)&&$(f)?[]:{},ht([it(n)?n-1:n,a[l],c,f],t,i,r,s);else if($(a)&&$(o))r?a[l]=f:a.push(f);else try{s?Object.defineProperty(a,l,Object.getOwnPropertyDescriptor(o,l)):a[l]=o[l]}catch{}}})}),a}function pe(...e){return ht(e,(t,i,r)=>!0,!1,!1,!1)}function B(e,t=!0){return $(e)?e:!t&&M(e)?[e]:e!==!1&&e!==0&&pi(e)?[]:di(e)?Array.prototype.slice.call(e):M(e)?Object.values(e):[e]}var q=(...e)=>Ot("observer-api",...e),Zt=(e,t)=>e instanceof Promise?e.then(t):t(e),je={};var Mt=class{constructor(t,i){this.registry=t,Object.assign(this,{...i,target:t.target}),this.params.signal&&this.params.signal.addEventListener("abort",()=>this.remove())}remove(){return this.removed=!0,this.registry.removeRegistration(this)}};var de=class extends Mt{constructor(){super(...arguments),this.emit.currentRegistration=this,Object.defineProperty(this,"abortController",{value:new AbortController}),Object.defineProperty(this,"signal",{value:this.abortController.signal}),je.setMaxListeners?.(0,this.signal)}remove(){this.abortController.abort(),super.remove()}fire(t){if(this.emit.recursionTarget&&!["inject","force-async","force-sync"].includes(this.params.recursions))return;let i=t,r=this.filter;if(r!==1/0&&(r=B(r,!1))&&(i=t.filter(n=>r.includes(n.key))),this.params.diff&&(i=i.filter(n=>n.type!=="set"||n.value!==n.oldValue)),!i.length)return;if(["inject","defer"].includes(this.params.recursions)){if(this.emit.recursionTarget){this.emit.recursionTarget.push(...i);return}this.emit.recursionTarget=this.params.recursions==="inject"?i:[]}let s=this.filter===1/0||Array.isArray(this.filter)?this.emit(i,this):this.emit(i[0],this);return Zt(s,n=>{let a=this.emit.recursionTarget;return delete this.emit.recursionTarget,this.params.recursions==="defer"&&a?.length?this.emit.currentRegistration.fire(a):n})}};var Vt=class{constructor(t){this.target=t,this.entries=[]}addRegistration(t){return this.entries.push(t),t}removeRegistration(t){this.entries=this.entries.filter(i=>i!==t)}static _getInstance(t,i,r=!0,s=this.__namespace){if(!D(i))throw new Error(`Subject must be of type object; "${Kt(i)}" given!`);let n=this;return s&&q("namespaces").has(t+"-"+s)&&(n=q("namespaces").get(t+"-"+s),t+="-"+s),!q(i,"registry").has(t)&&r&&q(i,"registry").set(t,new n(i)),q(i,"registry").get(t)}static _namespace(t,i,r=null){if(t+="-"+i,arguments.length===2)return q("namespaces").get(t);if(!(r.prototype instanceof this))throw new Error(`The implementation of the namespace ${this.name}.${i} must be a subclass of ${this.name}.`);q("namespaces").set(t,r),r.__namespace=i}};var Q=class{constructor(t,i){if(this.target=t,!i.operation)throw new Error("Descriptor operation must be given in definition!");Object.assign(this,i)}};var Tt=class extends Vt{static getInstance(t,i=!0,r=null){return super._getInstance("listeners",...arguments)}static namespace(t,i=null){return super._namespace("listeners",...arguments)}constructor(t){super(t),this.batches=[]}addRegistration(t,i,r){return super.addRegistration(new de(this,{filter:t,emit:i,params:r}))}emit(t,i=!1){if(this.batches.length){this.batches[0].snapshots.push({events:[...t],isPropertyDescriptors:i});return}this.$emit(this.entries,[{events:t,isPropertyDescriptors:i}])}$emit(t,i){let r=t.filter(u=>u.params.withPropertyDescriptors).length,s=i.some(u=>u.isPropertyDescriptors),n=[],a=[],o=t.length;i.forEach(u=>{(r||!s)&&n.push(...u.events),r!==o&&s&&(u.isPropertyDescriptors?a.push(...u.events.map(l=>{let{target:c,type:f,...p}=l,m=new Q(c,{type:"set",...p});return Object.defineProperty(m,"value","get"in p.value?{get:()=>p.value.get()}:{value:p.value.value}),p.oldValue&&Object.defineProperty(m,"oldValue","get"in p.oldValue?{get:()=>p.oldValue.get()}:{value:p.oldValue.value}),m})):a.push(...u.events))}),t.forEach(u=>{u.params.withPropertyDescriptors?u.fire(n.length?n:a):u.fire(a.length?a:n)})}batch(t){this.batches.unshift({entries:[...this.entries],snapshots:[]});let i=t();return Zt(i,r=>{let s=this.batches.shift();return s.snapshots.length&&this.$emit(s.entries,s.snapshots),r})}};var me=class extends Mt{exec(t,i,r){return this.running||!this.traps[t.operation]?i(...Array.prototype.slice.call(arguments,2)):(this.running=!0,this.traps[t.operation](t,r,(...s)=>(this.running=!1,i(...s))))}};var wt=class extends Vt{static getInstance(t,i=!0,r=null){return super._getInstance("traps",...arguments)}static namespace(t,i=null){return super._namespace("traps",...arguments)}addRegistration(t){return super.addRegistration(new me(this,t))}emit(t,i=null){let r=this;return function s(n,...a){let o=r.entries[n];return o?o.exec(t,(...u)=>s(n+1,...u),...a):i?i(t,...a):a[0]}(0)}};var bi={};hi(bi,{accessorize:()=>Js,proxy:()=>yr,unaccessorize:()=>Zs,unproxy:()=>ge});function Js(e,t,i={}){e=Be(e);let r=q(e,"accessorizedProps");function s(u){let l,c=e;do l=Object.getOwnPropertyDescriptor(c,u);while(!l&&(c=Object.getPrototypeOf(c)));return l?{proto:c,descriptor:l}:{descriptor:{value:void 0,configurable:!0,enumerable:!0,writable:!0}}}function n(u){if(r.has(u+""))return!0;let l=s(u);l.getValue=function(p=!1){return p?this.descriptor:this.descriptor.get?this.descriptor.get():this.descriptor.value},l.setValue=function(p,m=!1){if(this.dirty=!0,m){this.descriptor=p;return}return this.descriptor.set?this.descriptor.set(p)!==!1:(this.descriptor.value=p,!0)},l.intact=function(){let p=Object.getOwnPropertyDescriptor(e,u);return p?.get===f.get&&p?.set===f.set&&r.get(u+"")===this},l.restore=function(){return this.intact()?(this.proto&&this.proto!==e||!this.proto&&!this.dirty?delete e[u]:Object.defineProperty(e,u,this.descriptor),r.delete(u+""),!0):!1},r.set(isNaN(u)?u:parseInt(u),l);let{enumerable:c=!0}=l.descriptor,f={enumerable:c,configurable:!0};("value"in l.descriptor||l.descriptor.set)&&(f.set=function(p){return Dt(this,u,p,i)}),("value"in l.descriptor||l.descriptor.get)&&(f.get=function(){return vt(this,u,i)});try{return Object.defineProperty(e,u,f),!0}catch{return r.delete(u+""),!1}}let o=(Array.isArray(t)?t:t===void 0?Object.keys(e):[t]).map(n);return t===void 0||Array.isArray(t)?o:o[0]}function Zs(e,t,i={}){e=Be(e);let r=q(e,"accessorizedProps");function s(o){return r.has(o+"")?r.get(o+"").restore():!0}let a=(Array.isArray(t)?t:t===void 0?Object.keys(e):[t]).map(s);return t===void 0||Array.isArray(t)?a:a[0]}function yr(e,t={},i=void 0){let r=Be(e);if(typeof t.membrane=="boolean")throw new Error("The params.membrane parameter cannot be of type boolean.");if(t.membrane&&q(r,"membraneRef").has(t.membrane))return q(r,"membraneRef").get(t.membrane);let s={apply(o,u,l){if(Array.isArray(u)){let c=Be(u);return q(c).set("$length",c.length),ze(c,()=>He(o,u,l))}return He(o,ge(u),l)},construct:(o,u,l=null)=>_i(o,u,l,t),defineProperty:(o,u,l)=>xe(o,u,l,t),deleteProperty:(o,u)=>be(o,u,t),get:(o,u,l=null)=>{let c={...t,receiver:l};Array.isArray(o)&&u==="length"&&q(o).has("$length")&&(c.forceValue=q(o).get("$length"));let f=vt(o,u,c);return Array.isArray(o)&&typeof f=="function"?yr(f,{...t,membrane:l}):f},getOwnPropertyDescriptor:(o,u)=>We(o,u,t),getPrototypeOf:o=>wi(o,t),has:(o,u)=>Ue(o,u,t),isExtensible:o=>vi(o,t),ownKeys:o=>ye(o,t),preventExtensions:o=>Ei(o,t),set:(o,u,l,c=null)=>{let f={...t,receiver:c};return Array.isArray(o)&&u==="length"&&(f.forceOldValue=q(o).get("$length"),q(o).set("$length",l)),Dt(o,u,l,f)},setPrototypeOf:(o,u)=>Si(o,u,t)},n=i?.(s)||s,a=new Proxy(r,n);return t.membrane&&q(r,"membraneRef").set(t.membrane,a),q(a).set(a,r),a}function ge(e){return q(e).get(e)||e}function Be(e){if(!e||!D(e))throw new Error("Target must be of type object!");return ge(e)}var we=class extends Array{};function tn(...e){return new we(...e)}function Ci(e,t,i,r=n=>n,s={}){if(!!t.length)return function n(a,o,u){let l=o[u.level],c=u.level===o.length-1;return a instanceof Q&&a.operation!=="get"?u={...u,probe:"always"}:u.probe!=="always"&&(u={...u,probe:!c}),i(a,l,(f,...p)=>{let m=y=>{y instanceof Q&&(y.path=[y.key],a instanceof Q&&(y.path=a.path.concat(y.key),Object.defineProperty(y,"context",{get:()=>a,configurable:!0})))},g=y=>{let v=ft(y,!1);return Zt(v,x=>{y instanceof Q?y.value=x:y=x;let b=p[0]||{};return n(y,o,{...u,...b,level:u.level+1})})};return Ge(l)&&Array.isArray(f)?(f.forEach(m),c?r(f,...p):f.map(g)):(m(f),c?r(f,...p):g(f))},u)}(e,t.slice(0),{...s,level:0})}function ki(e,t,i,r={}){if(e=ft(e,!r.level),V(arguments[1])&&([,i,r={}]=arguments,t=1/0),!V(i))throw new Error(`Handler must be a function; "${Kt(i)}" given!`);if(t instanceof we)return Ci(e,t,ki,i,r);if(r={...r,descripted:!0},delete r.live,!D(e))return r.probe&&vt(e,t,i,r);let s=xr(e,t,i,r);return r.probe?vt(e,t,s,r):s()}function en(e,t,i={}){return e=ft(e),M(t)||([,,,i={}]=arguments,t={[arguments[1]]:arguments[2]}),wt.getInstance(e,!0,i.namespace).addRegistration({traps:t,params:i})}function We(e,t,i=s=>s,r={}){return pt(e,"getOwnPropertyDescriptor",{key:t},i,r)}function rn(e,t,i=s=>s,r={}){return pt(e,"getOwnPropertyDescriptors",{key:t},i,r)}function wi(e,t=r=>r,i={}){return pt(e,"getPrototypeOf",{},t,i)}function vi(e,t=r=>r,i={}){return pt(e,"isExtensible",{},t,i)}function ye(e,t=r=>r,i={}){return pt(e,"ownKeys",{},t,i)}function Ue(e,t,i=s=>s,r={}){return pt(e,"has",{key:t},i,r)}function vt(e,t,i=s=>s,r={}){let s,n=ft(e,!r.level);return M(i)?[r,i]=[i,a=>a]:r.live&&(s=!0),t instanceof we?Ci(n,t,vt,i,r):on(n,t,a=>{let o=[...a];return function u(l,c,f){if(!c.length)return f(l);let p=c.shift();if(!["string","number","symbol"].includes(typeof p))throw new Error(`Property name/key ${p} invalid.`);function m(v,x=void 0){let b=N=>(v.value=N,u([...l,r.live||r.descripted?v:N],c,f));if(arguments.length>1)return b(x);if(!D(n))return b(n?.[v.key]);let _=q(n,"accessorizedProps",!1),A=_&&_.get(v.key);if(A&&A.intact())return b(A.getValue(r.withPropertyDescriptors));if(r.withPropertyDescriptors){let N=Object.getOwnPropertyDescriptor(n,v.key);return"forceValue"in r&&"value"in N&&(N.value=r.forceValue),b(N)}return"forceValue"in r?b(r.forceValue):b(Reflect.get(n,v.key))}let g=new Q(n,{type:"get",key:p,value:void 0,operation:"get",related:o});if(!D(n))return m(g);let y=wt.getInstance(n,!1,r.namespace);return y?y.emit(g,m):m(g)}([],a.slice(0),u=>{let l=Ge(t)?u:u[0];return s&&D(n)?xr(n,t,i,r)(l):i(l)})},r)}function ze(e,t,i={}){return e=ft(e),Tt.getInstance(e,!0,i.namespace).batch(t)}function sn(e,t,i={}){t=ft(t),e=ft(e);let r=(i.only||[]).slice(0),s=(i.except||[]).slice(0),n=ye(i.spread?[...e]:e).map(l=>isNaN(l)?l:parseInt(l)),a=r.length?r.filter(l=>n.includes(l)):n.filter(l=>!s.includes(l)),o=l=>!Array.isArray(t)||isNaN(l)?l:l-s.filter(c=>c<l).length,u=l=>{let c=We(e,l,i);"value"in c&&c.writable&&c.enumerable&&c.configurable?Dt(t,o(l),c.value,i):(c.enumerable||i.onlyEnumerable===!1)&&xe(t,l,{...c,configurable:!0},i)};return ze(t,()=>{a.forEach(u)}),ki(e,l=>{l.filter(c=>r.length?r.includes(c.key):!s.includes(c.key)).forEach(c=>{if(c.operation==="deleteProperty")return be(t,o(c.key),i);if(c.operation==="defineProperty"){(c.value.enumerable||i.onlyEnumerable===!1)&&xe(t,o(c.key),{...c.value,configurable:!0},i);return}u(c.key)})},{...i,withPropertyDescriptors:!0})}function Dt(e,t,i,r=a=>a,s={},n=!1){let a=ft(e),o=[[t,i]];M(t)&&([,,r=l=>l,s={},n=!1]=arguments,o=Object.entries(t)),M(r)&&([n,s,r]=[typeof s=="boolean"?s:n,r,l=>l]);let u=o.map(([l])=>l);return function l(c,f,p){if(!f.length)return p(c);let[m,g]=f.shift();function y(x,b=void 0){let _=U=>(x.status=U,l(c.concat(x),f,p));if(arguments.length>1)return _(x,b);let A=q(a,"accessorizedProps",!1),N=A&&A.get(x.key);return x.operation==="defineProperty"?(N&&!N.restore()&&_(!1),Object.defineProperty(a,x.key,x.value),_(!0)):N&&N.intact()?_(N.setValue(x.value)):_(Reflect.set(a,x.key,x.value))}function v(x,b){if(s.diff&&g===b)return l(c,f,p);let _=new Q(a,{type:n?"def":"set",key:m,value:g,isUpdate:x,oldValue:b,related:[...u],operation:n?"defineProperty":"set",detail:s.detail}),A=wt.getInstance(a,!1,s.namespace);return A?A.emit(_,y):y(_)}return Ue(a,m,x=>{if(!x)return v(x);let b={...s,withPropertyDescriptors:n};return"forceOldValue"in s&&(b.forceValue=s.forceOldValue),vt(a,m,_=>v(x,_),b)},s)}([],o.slice(0),l=>{let c=Tt.getInstance(a,!1,s.namespace);return c&&c.emit(l,n),r(Ge(t)?l.map(f=>f.status):l[0]?.status)})}function xe(e,t,i,r=n=>n,s={}){return Dt(e,t,i,r,s,!0)}function nn(e,t,i=s=>s,r={}){return Dt(e,t,i,r,!0)}function be(e,t,i=s=>s,r={}){e=ft(e),M(i)&&([r,i]=[i,a=>a]);let s=B(t,!1),n=[...s];return function a(o,u,l){if(!u.length)return l(o);let c=u.shift();function f(m,g=void 0){let y=b=>(m.status=b,a(o.concat(m),u,l));if(arguments.length>1)return y(m,g);let v=q(e,"accessorizedProps",!1),x=v&&v.get(m.key);return x&&!x.restore()&&y(!1),y(Reflect.deleteProperty(e,m.key))}function p(m){let g=new Q(e,{type:"delete",key:c,oldValue:m,related:[...n],operation:"deleteProperty",detail:r.detail}),y=wt.getInstance(e,!1,r.namespace);return y?y.emit(g,f):f(g)}return vt(e,c,p,r)}([],s.slice(0),a=>{let o=Tt.getInstance(e,!1,r.namespace);return o&&o.emit(a),i(Ge(t)?a.map(u=>u.status):a[0].status)})}function an(e,t,i=s=>s,r={}){return be(...arguments)}function _i(e,t,i=null,r=n=>n,s={}){return pt(e,"construct",arguments.length>2?{argumentsList:t,newTarget:i}:{argumentsList:t},r,s)}function He(e,t,i,r=n=>n,s={}){return pt(e,"apply",{thisArgument:t,argumentsList:i},r,s)}function Si(e,t,i=s=>s,r={}){return pt(e,"setPrototypeOf",{proto:t},i,r)}function Ei(e,t=r=>r,i={}){return pt(e,"preventExtensions",{},t,i)}function xr(e,t,i,r={}){let s;r.signal||(s=new AbortController,r={...r,signal:s.signal},je.setMaxListeners?.(0,s.signal));let n=Tt.getInstance(e,!0,r.namespace);return function a(o,u=null){u?.remove();let c={signal:n.addRegistration(t,a,r).signal};if(arguments.length){let f=i(o,c);if(arguments.length>1)return f}return s}}function pt(e,t,i={},r=n=>n,s={}){e=ft(e),M(r)&&([s,r]=[r,u=>u]);function n(u,l){return arguments.length>1?r(l):r((Reflect[t]||Object[t])(e,...Object.values(i)))}let a=new Q(e,{operation:t,...i}),o=wt.getInstance(e,!1,s.namespace);return o?o.emit(a,n):n(a)}function Ge(e){return e===1/0||Array.isArray(e)}function ft(e,t=!0){if((!e||!D(e))&&t)throw new Error(`Object must be of type object or array! "${Kt(e)}" given.`);return e instanceof Q&&(e=e.value),e&&ge(e)}function on(e,t,i,r={}){return t===1/0?r.level&&!D(e)?i([]):ye(e,i,r):i(B(t,!1))}var un={...Ai,...bi},L=un;var Pi=(e,...t)=>{let i=t.pop();return e.constructor.name==="AsyncFunction"?et(e.call(...t),i):i(e.call(...t))},et=(e,t)=>e instanceof Promise?e.then(t):t(e),Ii=e=>typeof e=="object"&&e||typeof e=="function";function Oi(e){let t=typeof e[e.length-1]=="object"?e.pop():{},i=e.pop()||"";return t.functionParams=e,{source:i,params:t}}var br={};var ln=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],Er=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,3104,541,1507,4938,6,4191],cn="\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\u0CF3\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-\u0ECE\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",Cr="\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",Ti={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"},Ni="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",hn={5:Ni,"5module":Ni+" export import",6:Ni+" const class extends export import super"},fn=/^in(stanceof)?$/,pn=new RegExp("["+Cr+"]"),dn=new RegExp("["+Cr+cn+"]");function Li(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}return!1}function St(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&pn.test(String.fromCharCode(e)):t===!1?!1:Li(e,Er)}function te(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&&dn.test(String.fromCharCode(e)):t===!1?!1:Li(e,Er)||Li(e,ln)}var R=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 rt(e,t){return new R(e,{beforeExpr:!0,binop:t})}var st={beforeExpr:!0},J={startsExpr:!0},Vi={};function T(e,t){return t===void 0&&(t={}),t.keyword=e,Vi[e]=new R(e,t)}var h={num:new R("num",J),regexp:new R("regexp",J),string:new R("string",J),name:new R("name",J),privateId:new R("privateId",J),eof:new R("eof"),bracketL:new R("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new R("]"),braceL:new R("{",{beforeExpr:!0,startsExpr:!0}),braceR:new R("}"),parenL:new R("(",{beforeExpr:!0,startsExpr:!0}),parenR:new R(")"),comma:new R(",",st),semi:new R(";",st),colon:new R(":",st),dot:new R("."),question:new R("?",st),questionDot:new R("?."),arrow:new R("=>",st),template:new R("template"),invalidTemplate:new R("invalidTemplate"),ellipsis:new R("...",st),backQuote:new R("`",J),dollarBraceL:new R("${",{beforeExpr:!0,startsExpr:!0}),eq:new R("=",{beforeExpr:!0,isAssign:!0}),assign:new R("_=",{beforeExpr:!0,isAssign:!0}),incDec:new R("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new R("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:rt("||",1),logicalAND:rt("&&",2),bitwiseOR:rt("|",3),bitwiseXOR:rt("^",4),bitwiseAND:rt("&",5),equality:rt("==/!=/===/!==",6),relational:rt("</>/<=/>=",7),bitShift:rt("<</>>/>>>",8),plusMin:new R("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:rt("%",10),star:rt("*",10),slash:rt("/",10),starstar:new R("**",{beforeExpr:!0}),coalesce:rt("??",1),_break:T("break"),_case:T("case",st),_catch:T("catch"),_continue:T("continue"),_debugger:T("debugger"),_default:T("default",st),_do:T("do",{isLoop:!0,beforeExpr:!0}),_else:T("else",st),_finally:T("finally"),_for:T("for",{isLoop:!0}),_function:T("function",J),_if:T("if"),_return:T("return",st),_switch:T("switch"),_throw:T("throw",st),_try:T("try"),_var:T("var"),_const:T("const"),_while:T("while",{isLoop:!0}),_with:T("with"),_new:T("new",{beforeExpr:!0,startsExpr:!0}),_this:T("this",J),_super:T("super",J),_class:T("class",J),_extends:T("extends",st),_export:T("export"),_import:T("import",J),_null:T("null",J),_true:T("true",J),_false:T("false",J),_in:T("in",{beforeExpr:!0,binop:7}),_instanceof:T("instanceof",{beforeExpr:!0,binop:7}),_typeof:T("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:T("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:T("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},at=/\r\n?|\n|\u2028|\u2029/,mn=new RegExp(at.source,"g");function ee(e){return e===10||e===13||e===8232||e===8233}function kr(e,t,i){i===void 0&&(i=e.length);for(var r=t;r<i;r++){var s=e.charCodeAt(r);if(ee(s))return r<i-1&&s===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var Ar=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,nt=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Pr=Object.prototype,gn=Pr.hasOwnProperty,yn=Pr.toString,Ee=Object.hasOwn||function(e,t){return gn.call(e,t)},wr=Array.isArray||function(e){return yn.call(e)==="[object Array]"};function qt(e){return new RegExp("^(?:"+e.replace(/ /g,"|")+")$")}function Nt(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var xn=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,_e=function(t,i){this.line=t,this.column=i};_e.prototype.offset=function(t){return new _e(this.line,this.column+t)};var Je=function(t,i,r){this.start=i,this.end=r,t.sourceFile!==null&&(this.source=t.sourceFile)};function Ir(e,t){for(var i=1,r=0;;){var s=kr(e,r,t);if(s<0)return new _e(i,t-r);++i,r=s}}var Ri={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},vr=!1;function bn(e){var t={};for(var i in Ri)t[i]=e&&Ee(e,i)?e[i]:Ri[i];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!vr&&typeof console=="object"&&console.warn&&(vr=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
2
|
+
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),(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),wr(t.onToken)){var r=t.onToken;t.onToken=function(s){return r.push(s)}}return wr(t.onComment)&&(t.onComment=wn(t,t.onComment)),t}function wn(e,t){return function(i,r,s,n,a,o){var u={type:i?"Block":"Line",value:r,start:s,end:n};e.locations&&(u.loc=new Je(this,a,o)),e.ranges&&(u.range=[s,n]),t.push(u)}}var Se=1,ie=2,Di=4,Or=8,Tr=16,Nr=32,qi=64,$r=128,Ce=256,Fi=Se|ie|Ce;function ji(e,t){return ie|(e?Di:0)|(t?Or:0)}var Xe=0,Bi=1,_t=2,Lr=3,Rr=4,Mr=5,H=function(t,i,r){this.options=t=bn(t),this.sourceFile=t.sourceFile,this.keywords=qt(hn[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var s="";t.allowReserved!==!0&&(s=Ti[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(s+=" await")),this.reservedWords=qt(s);var n=(s?s+" ":"")+Ti.strict;this.reservedWordsStrict=qt(n),this.reservedWordsStrictBind=qt(n+" "+Ti.strictBind),this.input=String(i),this.containsEsc=!1,r?(this.pos=r,this.lineStart=this.input.lastIndexOf(`
|
|
3
|
+
`,r-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(at).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=h.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(Se),this.regexpState=null,this.privateNameStack=[]},dt={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}};H.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)};dt.inFunction.get=function(){return(this.currentVarScope().flags&ie)>0};dt.inGenerator.get=function(){return(this.currentVarScope().flags&Or)>0&&!this.currentVarScope().inClassFieldInit};dt.inAsync.get=function(){return(this.currentVarScope().flags&Di)>0&&!this.currentVarScope().inClassFieldInit};dt.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e];if(t.inClassFieldInit||t.flags&Ce)return!1;if(t.flags&ie)return(t.flags&Di)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};dt.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(t&qi)>0||i||this.options.allowSuperOutsideMethod};dt.allowDirectSuper.get=function(){return(this.currentThisScope().flags&$r)>0};dt.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};dt.allowNewDotTarget.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(t&(ie|Ce))>0||i};dt.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Ce)>0};H.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};H.parse=function(t,i){return new this(i,t).parse()};H.parseExpressionAt=function(t,i,r){var s=new this(r,t,i);return s.nextToken(),s.parseExpression()};H.tokenizer=function(t,i){return new this(i,t)};Object.defineProperties(H.prototype,dt);var X=H.prototype,vn=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;X.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){nt.lastIndex=e,e+=nt.exec(this.input)[0].length;var t=vn.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){nt.lastIndex=e+t[0].length;var i=nt.exec(this.input),r=i.index+i[0].length,s=this.input.charAt(r);return s===";"||s==="}"||at.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(s)||s==="!"&&this.input.charAt(r+1)==="=")}e+=t[0].length,nt.lastIndex=e,e+=nt.exec(this.input)[0].length,this.input[e]===";"&&e++}};X.eat=function(e){return this.type===e?(this.next(),!0):!1};X.isContextual=function(e){return this.type===h.name&&this.value===e&&!this.containsEsc};X.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};X.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};X.canInsertSemicolon=function(){return this.type===h.eof||this.type===h.braceR||at.test(this.input.slice(this.lastTokEnd,this.start))};X.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};X.semicolon=function(){!this.eat(h.semi)&&!this.insertSemicolon()&&this.unexpected()};X.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0};X.expect=function(e){this.eat(e)||this.unexpected()};X.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var Ze=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};X.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,t?"Assigning to rvalue":"Parenthesized pattern")}};X.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")};X.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")};X.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var k=H.prototype;k.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==h.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 Hi={kind:"loop"},_n={kind:"switch"};k.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;nt.lastIndex=this.pos;var t=nt.exec(this.input),i=this.pos+t[0].length,r=this.input.charCodeAt(i);if(r===91||r===92)return!0;if(e)return!1;if(r===123||r>55295&&r<56320)return!0;if(St(r,!0)){for(var s=i+1;te(r=this.input.charCodeAt(s),!0);)++s;if(r===92||r>55295&&r<56320)return!0;var n=this.input.slice(i,s);if(!fn.test(n))return!0}return!1};k.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;nt.lastIndex=this.pos;var e=nt.exec(this.input),t=this.pos+e[0].length,i;return!at.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(te(i=this.input.charCodeAt(t+8))||i>55295&&i<56320))};k.parseStatement=function(e,t,i){var r=this.type,s=this.startNode(),n;switch(this.isLet(e)&&(r=h._var,n="let"),r){case h._break:case h._continue:return this.parseBreakContinueStatement(s,r.keyword);case h._debugger:return this.parseDebuggerStatement(s);case h._do:return this.parseDoStatement(s);case h._for:return this.parseForStatement(s);case h._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(s,!1,!e);case h._class:return e&&this.unexpected(),this.parseClass(s,!0);case h._if:return this.parseIfStatement(s);case h._return:return this.parseReturnStatement(s);case h._switch:return this.parseSwitchStatement(s);case h._throw:return this.parseThrowStatement(s);case h._try:return this.parseTryStatement(s);case h._const:case h._var:return n=n||this.value,e&&n!=="var"&&this.unexpected(),this.parseVarStatement(s,n);case h._while:return this.parseWhileStatement(s);case h._with:return this.parseWithStatement(s);case h.braceL:return this.parseBlock(!0,s);case h.semi:return this.parseEmptyStatement(s);case h._export:case h._import:if(this.options.ecmaVersion>10&&r===h._import){nt.lastIndex=this.pos;var a=nt.exec(this.input),o=this.pos+a[0].length,u=this.input.charCodeAt(o);if(u===40||u===46)return this.parseExpressionStatement(s,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===h._import?this.parseImport(s):this.parseExport(s,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(s,!0,!e);var l=this.value,c=this.parseExpression();return r===h.name&&c.type==="Identifier"&&this.eat(h.colon)?this.parseLabeledStatement(s,l,c,e):this.parseExpressionStatement(s,c)}};k.parseBreakContinueStatement=function(e,t){var i=t==="break";this.next(),this.eat(h.semi)||this.insertSemicolon()?e.label=null:this.type!==h.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")};k.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")};k.parseDoStatement=function(e){return this.next(),this.labels.push(Hi),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(h._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(h.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};k.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Hi),this.enterScope(0),this.expect(h.parenL),this.type===h.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===h._var||this.type===h._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===h._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&r.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===h._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,o=new Ze,u=this.parseExpression(t>-1?"await":!0,o);return this.type===h._in||(a=this.options.ecmaVersion>=6&&this.isContextual("of"))?(this.options.ecmaVersion>=9&&(this.type===h._in?t>-1&&this.unexpected(t):e.await=t>-1),n&&a&&this.raise(u.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(u,!1,o),this.checkLValPattern(u),this.parseForIn(e,u)):(this.checkExpressionErrors(o,!0),t>-1&&this.unexpected(t),this.parseFor(e,u))};k.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,ve|(i?0:Mi),!1,t)};k.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(h._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};k.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(h.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};k.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(h.braceL),this.labels.push(_n),this.enterScope(0);for(var t,i=!1;this.type!==h.braceR;)if(this.type===h._case||this.type===h._default){var r=this.type===h._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(h.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")};k.parseThrowStatement=function(e){return this.next(),at.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 Sn=[];k.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===h._catch){var t=this.startNode();if(this.next(),this.eat(h.parenL)){t.param=this.parseBindingAtom();var i=t.param.type==="Identifier";this.enterScope(i?Nr:0),this.checkLValPattern(t.param,i?Rr:_t),this.expect(h.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(h._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};k.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")};k.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Hi),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};k.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")};k.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};k.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 o=this.type.isLoop?"loop":this.type===h._switch?"switch":null,u=this.labels.length-1;u>=0;u--){var l=this.labels[u];if(l.statementStart===e.start)l.statementStart=this.start,l.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf("label")===-1?r+"label":r:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")};k.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")};k.parseBlock=function(e,t,i){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(h.braceL),e&&this.enterScope(0);this.type!==h.braceR;){var r=this.parseStatement(null);t.body.push(r)}return i&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")};k.parseFor=function(e,t){return e.init=t,this.expect(h.semi),e.test=this.type===h.semi?null:this.parseExpression(),this.expect(h.semi),e.update=this.type===h.parenR?null:this.parseExpression(),this.expect(h.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};k.parseForIn=function(e,t){var i=this.type===h._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(h.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")};k.parseVar=function(e,t,i){for(e.declarations=[],e.kind=i;;){var r=this.startNode();if(this.parseVarId(r,i),this.eat(h.eq)?r.init=this.parseMaybeAssign(t):i==="const"&&!(this.type===h._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():r.id.type!=="Identifier"&&!(t&&(this.type===h._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(h.comma))break}return e};k.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?Bi:_t,!1)};var ve=1,Mi=2,Vr=4;k.parseFunction=function(e,t,i,r,s){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===h.star&&t&Mi&&this.unexpected(),e.generator=this.eat(h.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&ve&&(e.id=t&Vr&&this.type!==h.name?null:this.parseIdent(),e.id&&!(t&Mi)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?Bi:_t:Lr));var n=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ji(e.async,e.generator)),t&ve||(e.id=this.type===h.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,!1,s),this.yieldPos=n,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,t&ve?"FunctionDeclaration":"FunctionExpression")};k.parseFunctionParams=function(e){this.expect(h.parenL),e.params=this.parseBindingList(h.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};k.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(h.braceL);this.type!==h.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"&&En(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")};k.parseClassElement=function(e){if(this.eat(h.semi))return null;var t=this.options.ecmaVersion,i=this.startNode(),r="",s=!1,n=!1,a="method",o=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(h.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===h.star?o=!0:r="static"}if(i.static=o,!r&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===h.star)&&!this.canInsertSemicolon()?n=!0:r="async"),!r&&(t>=9||!n)&&this.eat(h.star)&&(s=!0),!r&&!n&&!s){var u=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?a=u:r=u)}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===h.parenL||a!=="method"||s||n){var l=!i.static&&Ke(i,"constructor"),c=l&&e;l&&a!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=l?"constructor":a,this.parseClassMethod(i,s,n,c)}else this.parseClassField(i);return i};k.isClassElementNameStart=function(){return this.type===h.name||this.type===h.privateId||this.type===h.num||this.type===h.string||this.type===h.bracketL||this.type.keyword};k.parseClassElementName=function(e){this.type===h.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)};k.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&&Ke(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")};k.parseClassField=function(e){if(Ke(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&Ke(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(h.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")};k.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(Ce|qi);this.type!==h.braceR;){var i=this.parseStatement(null);e.body.push(i)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")};k.parseClassId=function(e,t){this.type===h.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,_t,!1)):(t===!0&&this.unexpected(),e.id=null)};k.parseClassSuper=function(e){e.superClass=this.eat(h._extends)?this.parseExprSubscripts(null,!1):null};k.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};k.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];Ee(t,a.name)||(s?s.used.push(a):this.raiseRecoverable(a.start,"Private field '#"+a.name+"' must be declared in an enclosing class"))}};function En(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 Ke(e,t){var i=e.computed,r=e.key;return!i&&(r.type==="Identifier"&&r.name===t||r.type==="Literal"&&r.value===t)}k.parseExport=function(e,t){if(this.next(),this.eat(h.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!==h.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(h._default)){this.checkExport(t,"default",this.lastTokStart);var i;if(this.type===h._function||(i=this.isAsyncFunction())){var r=this.startNode();this.next(),i&&this.next(),e.declaration=this.parseFunction(r,ve|Vr,!1,i)}else if(this.type===h._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!==h.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var n=0,a=e.specifiers;n<a.length;n+=1){var o=a[n];this.checkUnreserved(o.local),this.checkLocalExport(o.local),o.local.type==="Literal"&&this.raise(o.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")};k.checkExport=function(e,t,i){!e||(typeof t!="string"&&(t=t.type==="Identifier"?t.name:t.value),Ee(e,t)&&this.raiseRecoverable(i,"Duplicate export '"+t+"'"),e[t]=!0)};k.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,o=t.elements;a<o.length;a+=1){var u=o[a];u&&this.checkPatternExport(e,u)}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)};k.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)}};k.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};k.parseExportSpecifiers=function(e){var t=[],i=!0;for(this.expect(h.braceL);!this.eat(h.braceR);){if(i)i=!1;else if(this.expect(h.comma),this.afterTrailingComma(h.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};k.parseImport=function(e){return this.next(),this.type===h.string?(e.specifiers=Sn,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===h.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(e,"ImportDeclaration")};k.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===h.name){var i=this.startNode();if(i.local=this.parseIdent(),this.checkLValSimple(i.local,_t),e.push(this.finishNode(i,"ImportDefaultSpecifier")),!this.eat(h.comma))return e}if(this.type===h.star){var r=this.startNode();return this.next(),this.expectContextual("as"),r.local=this.parseIdent(),this.checkLValSimple(r.local,_t),e.push(this.finishNode(r,"ImportNamespaceSpecifier")),e}for(this.expect(h.braceL);!this.eat(h.braceR);){if(t)t=!1;else if(this.expect(h.comma),this.afterTrailingComma(h.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,_t),e.push(this.finishNode(s,"ImportSpecifier"))}return e};k.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===h.string){var e=this.parseLiteral(this.value);return xn.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)};k.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)};k.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var lt=H.prototype;lt.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};lt.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};lt.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")};lt.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==h.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")};lt.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case h.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(h.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case h.braceL:return this.parseObj(!0)}return this.parseIdent()};lt.parseBindingList=function(e,t,i){for(var r=[],s=!0;!this.eat(e);)if(s?s=!1:this.expect(h.comma),t&&this.type===h.comma)r.push(null);else{if(i&&this.afterTrailingComma(e))break;if(this.type===h.ellipsis){var n=this.parseRestBinding();this.parseBindingListItem(n),r.push(n),this.type===h.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};lt.parseBindingListItem=function(e){return e};lt.parseMaybeDefault=function(e,t,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(h.eq))return i;var r=this.startNodeAt(e,t);return r.left=i,r.right=this.parseMaybeAssign(),this.finishNode(r,"AssignmentPattern")};lt.checkLValSimple=function(e,t,i){t===void 0&&(t=Xe);var r=t!==Xe;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===_t&&e.name==="let"&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),i&&(Ee(i,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),i[e.name]=!0),t!==Mr&&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")}};lt.checkLValPattern=function(e,t,i){switch(t===void 0&&(t=Xe),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,o=e.elements;a<o.length;a+=1){var u=o[a];u&&this.checkLValInnerPattern(u,t,i)}break;default:this.checkLValSimple(e,t,i)}};lt.checkLValInnerPattern=function(e,t,i){switch(t===void 0&&(t=Xe),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 ut=function(t,i,r,s,n){this.token=t,this.isExpr=!!i,this.preserveSpace=!!r,this.override=s,this.generator=!!n},F={b_stat:new ut("{",!1),b_expr:new ut("{",!0),b_tmpl:new ut("${",!1),p_stat:new ut("(",!1),p_expr:new ut("(",!0),q_tmpl:new ut("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new ut("function",!1),f_expr:new ut("function",!0),f_expr_gen:new ut("function",!0,!1,null,!0),f_gen:new ut("function",!1,!1,null,!0)},re=H.prototype;re.initialContext=function(){return[F.b_stat]};re.curContext=function(){return this.context[this.context.length-1]};re.braceIsBlock=function(e){var t=this.curContext();return t===F.f_expr||t===F.f_stat?!0:e===h.colon&&(t===F.b_stat||t===F.b_expr)?!t.isExpr:e===h._return||e===h.name&&this.exprAllowed?at.test(this.input.slice(this.lastTokEnd,this.start)):e===h._else||e===h.semi||e===h.eof||e===h.parenR||e===h.arrow?!0:e===h.braceL?t===F.b_stat:e===h._var||e===h._const||e===h.name?!1:!this.exprAllowed};re.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};re.updateContext=function(e){var t,i=this.type;i.keyword&&e===h.dot?this.exprAllowed=!1:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr};re.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)};h.parenR.updateContext=h.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();e===F.b_stat&&this.curContext().token==="function"&&(e=this.context.pop()),this.exprAllowed=!e.isExpr};h.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?F.b_stat:F.b_expr),this.exprAllowed=!0};h.dollarBraceL.updateContext=function(){this.context.push(F.b_tmpl),this.exprAllowed=!0};h.parenL.updateContext=function(e){var t=e===h._if||e===h._for||e===h._with||e===h._while;this.context.push(t?F.p_stat:F.p_expr),this.exprAllowed=!0};h.incDec.updateContext=function(){};h._function.updateContext=h._class.updateContext=function(e){e.beforeExpr&&e!==h._else&&!(e===h.semi&&this.curContext()!==F.p_stat)&&!(e===h._return&&at.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===h.colon||e===h.braceL)&&this.curContext()===F.b_stat)?this.context.push(F.f_expr):this.context.push(F.f_stat),this.exprAllowed=!1};h.backQuote.updateContext=function(){this.curContext()===F.q_tmpl?this.context.pop():this.context.push(F.q_tmpl),this.exprAllowed=!1};h.star.updateContext=function(e){if(e===h._function){var t=this.context.length-1;this.context[t]===F.f_expr?this.context[t]=F.f_expr_gen:this.context[t]=F.f_gen}this.exprAllowed=!0};h.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==h.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var P=H.prototype;P.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 o;n==="init"?o=this.strict&&a.init||a.get||a.set:o=a.init||a[n],o&&this.raiseRecoverable(r.start,"Redefinition of property")}else a=t[s]={init:!1,get:!1,set:!1};a[n]=!0}};P.parseExpression=function(e,t){var i=this.start,r=this.startLoc,s=this.parseMaybeAssign(e,t);if(this.type===h.comma){var n=this.startNodeAt(i,r);for(n.expressions=[s];this.eat(h.comma);)n.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(n,"SequenceExpression")}return s};P.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 Ze,r=!0);var o=this.start,u=this.startLoc;(this.type===h.parenL||this.type===h.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await");var l=this.parseMaybeConditional(e,t);if(i&&(l=i.call(this,l,o,u)),this.type.isAssign){var c=this.startNodeAt(o,u);return c.operator=this.value,this.type===h.eq&&(l=this.toAssignable(l,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=l.start&&(t.shorthandAssign=-1),this.type===h.eq?this.checkLValPattern(l):this.checkLValSimple(l),c.left=l,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),l};P.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(h.question)){var n=this.startNodeAt(i,r);return n.test=s,n.consequent=this.parseMaybeAssign(),this.expect(h.colon),n.alternate=this.parseMaybeAssign(e),this.finishNode(n,"ConditionalExpression")}return s};P.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)};P.parseExprOp=function(e,t,i,r,s){var n=this.type.binop;if(n!=null&&(!s||this.type!==h._in)&&n>r){var a=this.type===h.logicalOR||this.type===h.logicalAND,o=this.type===h.coalesce;o&&(n=h.logicalAND.binop);var u=this.value;this.next();var l=this.start,c=this.startLoc,f=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,s),l,c,n,s),p=this.buildBinary(t,i,e,f,u,a||o);return(a&&this.type===h.coalesce||o&&(this.type===h.logicalOR||this.type===h.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(p,t,i,r,s)}return e};P.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")};P.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 o=this.startNode(),u=this.type===h.incDec;o.operator=this.value,o.prefix=!0,this.next(),o.argument=this.parseMaybeUnary(null,!0,u,r),this.checkExpressionErrors(e,!0),u?this.checkLValSimple(o.argument):this.strict&&o.operator==="delete"&&o.argument.type==="Identifier"?this.raiseRecoverable(o.start,"Deleting local variable in strict mode"):o.operator==="delete"&&Dr(o.argument)?this.raiseRecoverable(o.start,"Private fields can not be deleted"):t=!0,a=this.finishNode(o,u?"UpdateExpression":"UnaryExpression")}else if(!t&&this.type===h.privateId)(r||this.privateNameStack.length===0)&&this.unexpected(),a=this.parsePrivateIdent(),this.type!==h._in&&this.unexpected();else{if(a=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return a;for(;this.type.postfix&&!this.canInsertSemicolon();){var l=this.startNodeAt(s,n);l.operator=this.value,l.prefix=!1,l.argument=a,this.checkLValSimple(a),this.next(),a=this.finishNode(l,"UpdateExpression")}}if(!i&&this.eat(h.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 Dr(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&Dr(e.expression)}P.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};P.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 o=this.parseSubscript(e,t,i,r,n,a,s);if(o.optional&&(a=!0),o===e||o.type==="ArrowFunctionExpression"){if(a){var u=this.startNodeAt(t,i);u.expression=o,o=this.finishNode(u,"ChainExpression")}return o}e=o}};P.parseSubscript=function(e,t,i,r,s,n,a){var o=this.options.ecmaVersion>=11,u=o&&this.eat(h.questionDot);r&&u&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var l=this.eat(h.bracketL);if(l||u&&this.type!==h.parenL&&this.type!==h.backQuote||this.eat(h.dot)){var c=this.startNodeAt(t,i);c.object=e,l?(c.property=this.parseExpression(),this.expect(h.bracketR)):this.type===h.privateId&&e.type!=="Super"?c.property=this.parsePrivateIdent():c.property=this.parseIdent(this.options.allowReserved!=="never"),c.computed=!!l,o&&(c.optional=u),e=this.finishNode(c,"MemberExpression")}else if(!r&&this.eat(h.parenL)){var f=new Ze,p=this.yieldPos,m=this.awaitPos,g=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var y=this.parseExprList(h.parenR,this.options.ecmaVersion>=8,!1,f);if(s&&!u&&!this.canInsertSemicolon()&&this.eat(h.arrow))return this.checkPatternErrors(f,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=p,this.awaitPos=m,this.awaitIdentPos=g,this.parseArrowExpression(this.startNodeAt(t,i),y,!0,a);this.checkExpressionErrors(f,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=m||this.awaitPos,this.awaitIdentPos=g||this.awaitIdentPos;var v=this.startNodeAt(t,i);v.callee=e,v.arguments=y,o&&(v.optional=u),e=this.finishNode(v,"CallExpression")}else if(this.type===h.backQuote){(u||n)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var x=this.startNodeAt(t,i);x.tag=e,x.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(x,"TaggedTemplateExpression")}return e};P.parseExprAtom=function(e,t){this.type===h.slash&&this.readRegexp();var i,r=this.potentialArrowAt===this.start;switch(this.type){case h._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),i=this.startNode(),this.next(),this.type===h.parenL&&!this.allowDirectSuper&&this.raise(i.start,"super() call outside constructor of a subclass"),this.type!==h.dot&&this.type!==h.bracketL&&this.type!==h.parenL&&this.unexpected(),this.finishNode(i,"Super");case h._this:return i=this.startNode(),this.next(),this.finishNode(i,"ThisExpression");case h.name:var s=this.start,n=this.startLoc,a=this.containsEsc,o=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!a&&o.name==="async"&&!this.canInsertSemicolon()&&this.eat(h._function))return this.overrideContext(F.f_expr),this.parseFunction(this.startNodeAt(s,n),0,!1,!0,t);if(r&&!this.canInsertSemicolon()){if(this.eat(h.arrow))return this.parseArrowExpression(this.startNodeAt(s,n),[o],!1,t);if(this.options.ecmaVersion>=8&&o.name==="async"&&this.type===h.name&&!a&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return o=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(h.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(s,n),[o],!0,t)}return o;case h.regexp:var u=this.value;return i=this.parseLiteral(u.value),i.regex={pattern:u.pattern,flags:u.flags},i;case h.num:case h.string:return this.parseLiteral(this.value);case h._null:case h._true:case h._false:return i=this.startNode(),i.value=this.type===h._null?null:this.type===h._true,i.raw=this.type.keyword,this.next(),this.finishNode(i,"Literal");case h.parenL:var l=this.start,c=this.parseParenAndDistinguishExpression(r,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(c)&&(e.parenthesizedAssign=l),e.parenthesizedBind<0&&(e.parenthesizedBind=l)),c;case h.bracketL:return i=this.startNode(),this.next(),i.elements=this.parseExprList(h.bracketR,!0,!0,e),this.finishNode(i,"ArrayExpression");case h.braceL:return this.overrideContext(F.b_expr),this.parseObj(!1,e);case h._function:return i=this.startNode(),this.next(),this.parseFunction(i,0);case h._class:return this.parseClass(this.startNode(),!1);case h._new:return this.parseNew();case h.backQuote:return this.parseTemplate();case h._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}};P.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 h.parenL:return this.parseDynamicImport(e);case h.dot:return e.meta=t,this.parseImportMeta(e);default:this.unexpected()}};P.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(h.parenR)){var t=this.start;this.eat(h.comma)&&this.eat(h.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")};P.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")};P.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")};P.parseParenExpression=function(){this.expect(h.parenL);var e=this.parseExpression();return this.expect(h.parenR),e};P.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,o=this.startLoc,u=[],l=!0,c=!1,f=new Ze,p=this.yieldPos,m=this.awaitPos,g;for(this.yieldPos=0,this.awaitPos=0;this.type!==h.parenR;)if(l?l=!1:this.expect(h.comma),n&&this.afterTrailingComma(h.parenR,!0)){c=!0;break}else if(this.type===h.ellipsis){g=this.start,u.push(this.parseParenItem(this.parseRestBinding())),this.type===h.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}else u.push(this.parseMaybeAssign(!1,f,this.parseParenItem));var y=this.lastTokEnd,v=this.lastTokEndLoc;if(this.expect(h.parenR),e&&!this.canInsertSemicolon()&&this.eat(h.arrow))return this.checkPatternErrors(f,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=p,this.awaitPos=m,this.parseParenArrowList(i,r,u,t);(!u.length||c)&&this.unexpected(this.lastTokStart),g&&this.unexpected(g),this.checkExpressionErrors(f,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=m||this.awaitPos,u.length>1?(s=this.startNodeAt(a,o),s.expressions=u,this.finishNodeAt(s,"SequenceExpression",y,v)):s=u[0]}else s=this.parseParenExpression();if(this.options.preserveParens){var x=this.startNodeAt(i,r);return x.expression=s,this.finishNode(x,"ParenthesizedExpression")}else return s};P.parseParenItem=function(e){return e};P.parseParenArrowList=function(e,t,i,r){return this.parseArrowExpression(this.startNodeAt(e,t),i,!1,r)};var Cn=[];P.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(h.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===h._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(h.parenL)?e.arguments=this.parseExprList(h.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Cn,this.finishNode(e,"NewExpression")};P.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===h.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,`
|
|
4
|
+
`),cooked:this.value},this.next(),i.tail=this.type===h.backQuote,this.finishNode(i,"TemplateElement")};P.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===h.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(h.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(h.braceR),i.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")};P.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===h.name||this.type===h.num||this.type===h.string||this.type===h.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===h.star)&&!at.test(this.input.slice(this.lastTokEnd,this.start))};P.parseObj=function(e,t){var i=this.startNode(),r=!0,s={};for(i.properties=[],this.next();!this.eat(h.braceR);){if(r)r=!1;else if(this.expect(h.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(h.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")};P.parseProperty=function(e,t){var i=this.startNode(),r,s,n,a;if(this.options.ecmaVersion>=9&&this.eat(h.ellipsis))return e?(i.argument=this.parseIdent(!1),this.type===h.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(!1,t),this.type===h.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(h.star)));var o=this.containsEsc;return this.parsePropertyName(i),!e&&!o&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(i)?(s=!0,r=this.options.ecmaVersion>=9&&this.eat(h.star),this.parsePropertyName(i)):s=!1,this.parsePropertyValue(i,e,r,s,n,a,t,o),this.finishNode(i,"Property")};P.parsePropertyValue=function(e,t,i,r,s,n,a,o){if((i||r)&&this.type===h.colon&&this.unexpected(),this.eat(h.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===h.parenL)t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(i,r);else if(!t&&!o&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==h.comma&&this.type!==h.braceR&&this.type!==h.eq){(i||r)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var u=e.kind==="get"?0:1;if(e.value.params.length!==u){var l=e.value.start;e.kind==="get"?this.raiseRecoverable(l,"getter should have no params"):this.raiseRecoverable(l,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")}else this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((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===h.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()};P.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(h.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(h.bracketR),e.key;e.computed=!1}return e.key=this.type===h.num||this.type===h.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};P.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)};P.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(ji(t,r.generator)|qi|(i?$r:0)),this.expect(h.parenL),r.params=this.parseBindingList(h.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")};P.parseArrowExpression=function(e,t,i,r){var s=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.enterScope(ji(i,!1)|Tr),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")};P.parseFunctionBody=function(e,t,i,r){var s=t&&this.type!==h.braceL,n=this.strict,a=!1;if(s)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!n||o)&&(a=this.strictDirective(this.end),a&&o&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var u=this.labels;this.labels=[],a&&(this.strict=!0),this.checkParams(e,!n&&!a&&!t&&!i&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,Mr),e.body=this.parseBlock(!1,void 0,a&&!n),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=u}this.exitScope()};P.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};P.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,Bi,t?null:i)}};P.parseExprList=function(e,t,i,r){for(var s=[],n=!0;!this.eat(e);){if(n)n=!1;else if(this.expect(h.comma),t&&this.afterTrailingComma(e))break;var a=void 0;i&&this.type===h.comma?a=null:this.type===h.ellipsis?(a=this.parseSpread(r),r&&this.type===h.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):a=this.parseMaybeAssign(!1,r),s.push(a)}return s};P.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"))}};P.parseIdent=function(e){var t=this.startNode();return this.type===h.name?t.name=this.value:this.type.keyword?(t.name=this.type.keyword,(t.name==="class"||t.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop()):this.unexpected(),this.next(!!e),this.finishNode(t,"Identifier"),e||(this.checkUnreserved(t),t.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t};P.parsePrivateIdent=function(){var e=this.startNode();return this.type===h.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};P.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===h.semi||this.canInsertSemicolon()||this.type!==h.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(h.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")};P.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 Ye=H.prototype;Ye.raise=function(e,t){var i=Ir(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};Ye.raiseRecoverable=Ye.raise;Ye.curPosition=function(){if(this.options.locations)return new _e(this.curLine,this.pos-this.lineStart)};var $t=H.prototype,kn=function(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[],this.inClassFieldInit=!1};$t.enterScope=function(e){this.scopeStack.push(new kn(e))};$t.exitScope=function(){this.scopeStack.pop()};$t.treatFunctionsAsVarInScope=function(e){return e.flags&ie||!this.inModule&&e.flags&Se};$t.declareName=function(e,t,i){var r=!1;if(t===_t){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&Se&&delete this.undefinedExports[e]}else if(t===Rr){var n=this.currentScope();n.lexical.push(e)}else if(t===Lr){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 o=this.scopeStack.length-1;o>=0;--o){var u=this.scopeStack[o];if(u.lexical.indexOf(e)>-1&&!(u.flags&Nr&&u.lexical[0]===e)||!this.treatFunctionsAsVarInScope(u)&&u.functions.indexOf(e)>-1){r=!0;break}if(u.var.push(e),this.inModule&&u.flags&Se&&delete this.undefinedExports[e],u.flags&Fi)break}r&&this.raiseRecoverable(i,"Identifier '"+e+"' has already been declared")};$t.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)};$t.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};$t.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&Fi)return t}};$t.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&Fi&&!(t.flags&Tr))return t}};var ti=function(t,i,r){this.type="",this.start=i,this.end=0,t.options.locations&&(this.loc=new Je(t,r)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[i,0])},ke=H.prototype;ke.startNode=function(){return new ti(this,this.start,this.startLoc)};ke.startNodeAt=function(e,t){return new ti(this,e,t)};function qr(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}ke.finishNode=function(e,t){return qr.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)};ke.finishNodeAt=function(e,t,i,r){return qr.call(this,e,t,i,r)};ke.copyNode=function(e){var t=new ti(this,e.start,this.startLoc);for(var i in e)t[i]=e[i];return t};var Fr="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",jr=Fr+" Extended_Pictographic",Br=jr,Hr=Br+" EBase EComp EMod EPres ExtPict",Wr=Hr,An=Wr,Pn={9:Fr,10:jr,11:Br,12:Hr,13:Wr,14:An},_r="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",Ur="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",zr=Ur+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Gr=zr+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Qr=Gr+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Xr=Qr+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",In=Xr+" Kawi Nag_Mundari Nagm",On={9:Ur,10:zr,11:Gr,12:Qr,13:Xr,14:In},Kr={};function Tn(e){var t=Kr[e]={binary:qt(Pn[e]+" "+_r),nonBinary:{General_Category:qt(_r),Script:qt(On[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(Qe=0,$i=[9,10,11,12,13,14];Qe<$i.length;Qe+=1)Sr=$i[Qe],Tn(Sr);var Sr,Qe,$i,C=H.prototype,Et=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=Kr[t.options.ecmaVersion>=14?14: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=[]};Et.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};Et.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)};Et.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};Et.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};Et.prototype.current=function(t){return t===void 0&&(t=!1),this.at(this.pos,t)};Et.prototype.lookahead=function(t){return t===void 0&&(t=!1),this.at(this.nextIndex(this.pos,t),t)};Et.prototype.advance=function(t){t===void 0&&(t=!1),this.pos=this.nextIndex(this.pos,t)};Et.prototype.eat=function(t,i){return i===void 0&&(i=!1),this.current(i)===t?(this.advance(i),!0):!1};C.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")}};C.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))};C.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")}};C.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")};C.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););};C.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};C.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};C.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1};C.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)};C.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};C.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)};C.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1};C.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};C.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};C.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)};C.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1};C.regexp_eatSyntaxCharacter=function(e){var t=e.current();return Yr(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Yr(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}C.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;(i=e.current())!==-1&&!Yr(i);)e.advance();return e.pos!==t};C.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};C.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")}};C.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};C.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=Nt(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=Nt(e.lastIntValue);return!0}return!1};C.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),Nn(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function Nn(e){return St(e,!0)||e===36||e===95}C.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),$n(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function $n(e){return te(e,!0)||e===36||e===95||e===8204||e===8205}C.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)};C.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};C.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};C.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)};C.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1};C.regexp_eatZero=function(e){return e.current()===48&&!ei(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1};C.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};C.regexp_eatControlLetter=function(e){var t=e.current();return Jr(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function Jr(e){return e>=65&&e<=90||e>=97&&e<=122}C.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)&&Ln(e.lastIntValue))return!0;r&&e.raise("Invalid unicode escape"),e.pos=i}return!1};function Ln(e){return e>=0&&e<=1114111}C.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};C.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};C.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(Rn(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 Rn(e){return e===100||e===68||e===115||e===83||e===119||e===87}C.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};C.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){Ee(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value")};C.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name")};C.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Zr(t=e.current());)e.lastStringValue+=Nt(t),e.advance();return e.lastStringValue!==""};function Zr(e){return Jr(e)||e===95}C.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";Mn(t=e.current());)e.lastStringValue+=Nt(t),e.advance();return e.lastStringValue!==""};function Mn(e){return Zr(e)||ei(e)}C.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};C.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};C.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")}}};C.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||is(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};C.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)};C.regexp_eatClassControlLetter=function(e){var t=e.current();return ei(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1};C.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};C.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;ei(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t};function ei(e){return e>=48&&e<=57}C.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;ts(i=e.current());)e.lastIntValue=16*e.lastIntValue+es(i),e.advance();return e.pos!==t};function ts(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function es(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}C.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};C.regexp_eatOctalDigit=function(e){var t=e.current();return is(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function is(e){return e>=48&&e<=55}C.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var s=e.current();if(!ts(s))return e.pos=i,!1;e.lastIntValue=16*e.lastIntValue+es(s),e.advance()}return!0};var Wi=function(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new Je(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end])},I=H.prototype;I.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 Wi(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};I.getToken=function(){return this.next(),new Wi(this)};typeof Symbol<"u"&&(I[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===h.eof,value:t}}}});I.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(h.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())};I.readToken=function(e){return St(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};I.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};I.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=kr(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())};I.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&&!ee(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())};I.skipSpace=function(){t: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 t}break;default:if(e>8&&e<14||e>=5760&&Ar.test(String.fromCharCode(e)))++this.pos;else break t}}};I.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)};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(h.ellipsis)):(++this.pos,this.finishToken(h.dot))};I.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(h.assign,2):this.finishOp(h.slash,1)};I.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,r=e===42?h.star:h.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++i,r=h.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(h.assign,i+1):this.finishOp(r,i)};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(h.assign,3)}return this.finishOp(e===124?h.logicalOR:h.logicalAND,2)}return t===61?this.finishOp(h.assign,2):this.finishOp(e===124?h.bitwiseOR:h.bitwiseAND,1)};I.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(h.assign,2):this.finishOp(h.bitwiseXOR,1)};I.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||at.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(h.incDec,2):t===61?this.finishOp(h.assign,2):this.finishOp(h.plusMin,1)};I.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(h.assign,i+1):this.finishOp(h.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(h.relational,i))};I.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(h.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(h.arrow)):this.finishOp(e===61?h.eq:h.prefix,1)};I.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(h.questionDot,2)}if(t===63){if(e>=12){var r=this.input.charCodeAt(this.pos+2);if(r===61)return this.finishOp(h.assign,3)}return this.finishOp(h.coalesce,2)}}return this.finishOp(h.question,1)};I.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),St(t,!0)||t===92))return this.finishToken(h.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+Nt(t)+"'")};I.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(h.parenL);case 41:return++this.pos,this.finishToken(h.parenR);case 59:return++this.pos,this.finishToken(h.semi);case 44:return++this.pos,this.finishToken(h.comma);case 91:return++this.pos,this.finishToken(h.bracketL);case 93:return++this.pos,this.finishToken(h.bracketR);case 123:return++this.pos,this.finishToken(h.braceL);case 125:return++this.pos,this.finishToken(h.braceR);case 58:return++this.pos,this.finishToken(h.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(h.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(h.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+Nt(e)+"'")};I.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)};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(at.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 o=this.regexpState||(this.regexpState=new Et(this));o.reset(i,s,a),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var u=null;try{u=new RegExp(s,a)}catch{}return this.finishToken(h.regexp,{pattern:s,flags:a,value:u})};I.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,o=0,u=0,l=t??1/0;u<l;++u,++this.pos){var c=this.input.charCodeAt(this.pos),f=void 0;if(r&&c===95){s&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),o===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),u===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),o=c;continue}if(c>=97?f=c-97+10:c>=65?f=c-65+10:c>=48&&c<=57?f=c-48:f=1/0,f>=e)break;o=c,a=a*e+f}return r&&o===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===n||t!=null&&this.pos-n!==t?null:a};function Vn(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function rs(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}I.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=rs(this.input.slice(t,this.pos)),++this.pos):St(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(h.num,i)};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=rs(this.input.slice(t,this.pos));return++this.pos,St(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(h.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")),St(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var n=Vn(this.input.slice(t,this.pos),i);return this.finishToken(h.num,n)};I.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};I.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)):(ee(r)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(i,this.pos++),this.finishToken(h.string,t)};var ss={};I.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===ss)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};I.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw ss;this.raise(e,t)};I.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===h.template||this.type===h.invalidTemplate)?i===36?(this.pos+=2,this.finishToken(h.dollarBraceL)):(++this.pos,this.finishToken(h.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(h.template,e));if(i===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(ee(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+=`
|
|
5
|
+
`;break;default:e+=String.fromCharCode(i);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}};I.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(h.invalidTemplate,this.input.slice(this.start,this.pos))}this.raise(this.start,"Unterminated template")};I.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
|
|
6
|
+
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Nt(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;this.invalidStringToken(i,"Invalid escape sequence in template string")}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 ee(t)?"":String.fromCharCode(t)}};I.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return i===null&&this.invalidStringToken(t,"Bad character escape sequence"),i};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(te(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?St:te)(a,r)||this.invalidStringToken(n,"Invalid Unicode escape"),e+=Nt(a),i=this.pos}else break;t=!1}return e+this.input.slice(i,this.pos)};I.readWord=function(){var e=this.readWord1(),t=h.name;return this.keywords.test(e)&&(t=Vi[e]),this.finishToken(t,e)};var Dn="8.8.2";H.acorn={Parser:H,version:Dn,defaultOptions:Ri,Position:_e,SourceLocation:Je,getLineInfo:Ir,Node:ti,TokenType:R,tokTypes:h,keywordTypes:Vi,TokContext:ut,tokContexts:F,isIdentifierChar:te,isIdentifierStart:St,Token:Wi,isNewLine:ee,lineBreak:at,lineBreakG:mn,nonASCIIwhitespace:Ar};var ns=H.extend(function(e){let t=!1,i=!1,r=!1;return class extends e{parseFunction(s,n,a,o,u){return this.type.label==="**"&&(s.isQuantumFunction=!0,this.next()),super.parseFunction(s,n,a,o,u)}isClassElementNameStart(){return this.type.label==="**"&&(t=!0,this.next()),super.isClassElementNameStart()}isAsyncProp(s){return this.type.label==="**"&&(t=!0,this.next()),super.isAsyncProp(s)}eat(s){return(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.isQuantumFunction=!0,t=!1),a}parseClassElement(s){i=!0;let n=super.parseClassElement(s);return i=!1,t&&(n.value.isQuantumFunction=!0,t=!1),n}}});var{stringify:qn}=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 ii={"||":2,"??":3,"&&":4,"|":5,"^":6,"&":7,"==":8,"!=":8,"===":8,"!==":8,"<":9,">":9,"<=":9,">=":9,in:9,instanceof:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"%":12,"/":12,"**":13},ct=17,Fn={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:ct,ClassExpression:ct,FunctionExpression:ct,ObjectExpression:ct,UpdateExpression:16,UnaryExpression:15,AwaitExpression:15,BinaryExpression:14,LogicalExpression:13,ConditionalExpression:4,AssignmentExpression:3,YieldExpression:2,RestElement:1};function se(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 fs(e,t,i,r){let s=e.expressionsPrecedence[t.type];if(s===ct)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:s===13&&n===13&&(t.operator==="??"||i.operator==="??")?!0:r?ii[t.operator]<=ii[i.operator]:ii[t.operator]<ii[i.operator]}function ri(e,t,i,r){let{generator:s}=e;fs(e,t,i,r)?(e.write("("),s[t.type](t,e),e.write(")")):s[t.type](t,e)}function jn(e,t,i,r){let s=t.split(`
|
|
7
|
+
`),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 K(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()+`
|
|
8
|
+
`,a):(e.write("/*"),jn(e,a.value,i,r),e.write("*/"+r))}}function Bn(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 Ui(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 as,os,us,ls,cs,hs,Hn={Program(e,t){let i=t.indent.repeat(t.indentLevel),{lineEnd:r,writeComments:s}=t;s&&e.comments!=null&&K(t,e.comments,i,r);let n=e.body,{length:a}=n;for(let o=0;o<a;o++){let u=n[o];s&&u.comments!=null&&K(t,u.comments,i,r),t.write(i),this[u.type](u,t),t.write(r)}s&&e.trailingComments!=null&&K(t,e.trailingComments,i,r)},BlockStatement:hs=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&&K(t,e.comments,n,r);let{length:o}=a;for(let u=0;u<o;u++){let l=a[u];s&&l.comments!=null&&K(t,l.comments,n,r),t.write(n),this[l.type](l,t),t.write(r)}t.write(i)}else s&&e.comments!=null&&(t.write(r),K(t,e.comments,n,r),t.write(i));s&&e.trailingComments!=null&&K(t,e.trailingComments,n,r),t.write("}"),t.indentLevel--},ClassBody:hs,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===ct||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:o}=e,{length:u}=o;for(let l=0;l<u;l++){let c=o[l];s&&c.comments!=null&&K(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:f}=c,{length:p}=f;for(let m=0;m<p;m++){let g=f[m];s&&g.comments!=null&&K(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"?Ui(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:as=function(e,t){t.write(`for ${e.await?"await ":""}(`);let{left:i}=e;i.type[0]==="V"?Ui(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:as,DebuggerStatement(e,t){t.write("debugger;",e)},FunctionDeclaration:os=function(e,t){t.write((e.async?"async ":"")+(e.generator?"function* ":"function ")+(e.id?e.id.name:""),e),se(t,e.params),t.write(" "),this[e.body.type](e.body,t)},FunctionExpression:os,VariableDeclaration(e,t){Ui(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===ct||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),se(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]):se(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:us=function(e,t){t.write("..."),this[e.argument.type](e.argument,t)},SpreadElement:us,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),ri(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 o=r[a],u=i[a];t.write(u.value.raw,u),t.write("${"),this[o.type](o,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){ri(t,e.tag,e),this[e.quasi.type](e.quasi,t)},ArrayExpression:cs=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:cs,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&&K(t,e.comments,n,r);let a=","+r,{properties:o}=e,{length:u}=o;for(let l=0;;){let c=o[l];if(s&&c.comments!=null&&K(t,c.comments,n,r),t.write(n),this[c.type](c,t),++l<u)t.write(a);else break}t.write(r),s&&e.trailingComments!=null&&K(t,e.trailingComments,n,r),t.write(i+"}")}else s?e.comments!=null?(t.write(r),K(t,e.comments,n,r),e.trailingComments!=null&&K(t,e.trailingComments,n,r),t.write(i+"}")):e.trailingComments!=null?(t.write(r),K(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){if(e.static&&t.write("static "),e.computed&&t.write("["),this[e.key.type](e.key,t),e.computed&&t.write("]"),e.value==null){e.key.type[0]!=="F"&&t.write(";");return}t.write(" = "),this[e.value.type](e.value,t),t.write(";")},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){se(t,e.expressions)},UnaryExpression(e,t){if(e.prefix){let{operator:i,argument:r,argument:{type:s}}=e;t.write(i);let n=fs(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:ls=function(e,t){let i=e.operator==="in";i&&t.write("("),ri(t,e.left,e,!1),t.write(" "+e.operator+" "),ri(t,e.right,e,!0),i&&t.write(")")},LogicalExpression:ls,ConditionalExpression(e,t){let{test:i}=e,r=t.expressionsPrecedence[i.type];r===ct||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===ct||i<t.expressionsPrecedence.CallExpression||Bn(e.callee)?(t.write("("),this[e.callee.type](e.callee,t),t.write(")")):this[e.callee.type](e.callee,t),se(t,e.arguments)},CallExpression(e,t){let i=t.expressionsPrecedence[e.callee.type];i===ct||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("?."),se(t,e.arguments)},ChainExpression(e,t){this[e.expression.type](e.expression,t)},MemberExpression(e,t){let i=t.expressionsPrecedence[e.object.type];i===ct||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(qn(e.value),e)},RegExpLiteral(e,t){let{regex:i}=e;t.write(`/${i.pattern}/${i.flags}`,e)}},Wn={};var zi=class{constructor(t){let i=t??Wn;this.output="",i.output!=null?(this.output=i.output,this.write=this.writeToStream):this.output="",this.generator=i.generator!=null?i.generator:Hn,this.expressionsPrecedence=i.expressionsPrecedence!=null?i.expressionsPrecedence:Fn,this.indent=i.indent!=null?i.indent:" ",this.lineEnd=i.lineEnd!=null?i.lineEnd:`
|
|
9
9
|
`,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(`
|
|
10
|
-
`).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:o,line:
|
|
11
|
-
`?(o=0,l++):o++;this.column=o,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 ns(e,t){let i=new Vi(t);return i.generator[e.type](e,i),i.output}var bt=class{type="Identifier";whitelist=[];blacklist=[];constructor(t){this.whitelist[0]=t}get name(){return this.whitelist[0]}noConflict(t){let i=this.whitelist.indexOf(t);if(i===-1)return!1;this.blacklist.push(this.whitelist.splice(i,1)),this.whitelist.length||(this.whitelist=this.blacklist.map(r=>{let s;do{let n=String.fromCharCode(0|Math.random()*26+97);s=`${r}${n}`}while(this.blacklist.includes(s));return s}))}};var m={throwStmt(e){return{type:"ThrowStatement",argument:e}},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}},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.conditionalExpr(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}},returnStmt(e){return{type:"ReturnStatement",argument:e}},yieldExpr(e,t=!1){return{type:"YieldExpression",argument:e,delegate:t}},awaitExpr(e){return{type:"AwaitExpression",argument: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"}},conditionalExpr(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}},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}},classDeclaration(e,t,i=null){return this.class("ClassDeclaration",...arguments)},classExpression(e,t,i=null){return this.class("ClassExpression",...arguments)},class(e,t,i,r=null){return{type:e,id:t,body:i,superClass:r}},methodDefinition(e,t,i="method",r=!1,s=!1){return{type:"MethodDefinition",key:e,value:t,kind:i,static:r,computed:s}},propertyDefinition(e,t,i=!1,r=!1){return{type:"PropertyDefinition",key:e,value:t,static:i,computed:r}},spreadElement(e){return{type:"SpreadElement",argument:e}},literal(e){if(typeof e=="object"&&!("name"in e)&&!("value"in e))throw new Error('Objects that convert to literals must have a "name" or "value" property.');return typeof e=="object"?{type:"Literal",get value(){return"name"in e?e.name:e.value}}:{type:"Literal",value:e}},templateLiteral(e,t){return{type:"TemplateLiteral",quasis:e,expressions:t}},comments(e){let t={};return Object.defineProperty(t,"toString",{value:()=>e}),Object.defineProperty(t,"trim",{value:function(){return this.toString()}}),[{type:"Line",value:t}]},withLoc(e,...t){return["start","end"].forEach(i=>{let r=i==="start"?t[0]:t[t.length-1];e[i]=r[i],r.loc&&(e.loc=e.loc||{},e.loc[i]=r.loc?.[i])}),e},invert(e){return this.unaryExpr("!",e)},clone(e){return e={...e},delete e.start,delete e.end,e}};var Zt=class{type="BlockStatement";$body=[];constructor(t){this.body=t}get body(){return this.$body}set body(t){this.$body=t,m.withLoc(this,...t)}};var ge=class{constructor(t,{type:i}){this.context=t,Object.assign(this,{type:i}),this.vars=new Set,this.$qIdentifiers=new Map,this.$qIdentifiersCursors={...this.context?.$qIdentifiersCursors||{}},this.locations=[]}index(t,i=!1){if(!this.type.includes("Function")&&this.context)return this.context.index(...arguments);let r=["start","end"].map(s=>{let n=[m.literal(t[s])];return i&&t.loc&&(n.push(m.literal(t.loc[s].line)),n.push(m.literal(t.loc[s].column))),m.arrayExpr(n)});return this.locations.push(m.arrayExpr(r)),m.literal(this.locations.length-1)}get$qIdentifier(t,i=!0,r=!1){let s=this.$qIdentifiers.get(t);if(!s){if(i&&this.context)return this.context.get$qIdentifier(t,i);r&&(typeof this.$qIdentifiersCursors[t]>"u"&&(this.$qIdentifiersCursors[t]=0),t+=this.$qIdentifiersCursors[t]++),this.$qIdentifiers.set(t,s=new bt(t))}return s}getRandomIdentifier(t,i=!0){return this.get$qIdentifier(t,i,!0)}$qIdentifiersNoConflict(t){for(let[,i]of this.$qIdentifiers)i.noConflict(t);this.context&&this.context.$qIdentifiersNoConflict(t)}push(t,i,r=!1){let s;return["var","update"].includes(i)&&(s=this.find(t,!1))&&s.type!=="const"?s.willUpdate=!0:(i!=="update"||!this.context)&&(t instanceof bt||this.$qIdentifiersNoConflict(t.name+""),this.vars.add({identifier:t,type:i,willUpdate:r||i==="update"})),this.context&&(i==="update"||i==="var"&&!this.type.includes("Function"))?this.context.push(t,i):!0}find(t,i=!0){let r;for(let s of this.vars)if(s.identifier.name+""==t.name+""){r=s;break}return!r&&i?this.context?.find(t,i):r}};var be=class{history=[];scopes=[];functionTypes=["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"];loopTypes=["DoWhileStatement","WhileStatement","ForStatement","ForOfStatement","ForInStatement"];labeledTypes=["SwitchStatement","LabeledStatement"];topLevelAwait=!1;topLevelArgsKeyword=!1;constructor(t={}){this.params=t}pushScope(t,i){let r=new ge(this.currentScope,t);this.scopes.unshift(r);let s=i();return this.scopes.shift(),s}get currentScope(){return this.scopes[0]}pushHistory(t,i){this.history.unshift(t);let r=i();return this.history.shift(),r}get currentEntry(){return this.history[0]}serialize(t,i={}){return ns(t,{comments:!0,...i})}transform(t){if(t.type!=="Program")throw new Error('AST must be of type "Program".');return this.pushScope(t,()=>{let i=this.transformNodes(t.body,{static:this.params.startStatic}),r={...t,body:i};r.body.length&&(r.body[0].comments=m.comments("Program body"));let s=m.exprStmt(m.assignmentExpr(this.$path("locations"),m.arrayExpr(this.currentScope.locations)));if(s.comments=m.comments("Location data"),r.body.unshift(s),this.exports.size){this.exports.forEach(o=>{r.body.push(m.exprStmt(this.$call("export",...o)))});let a=m.memberExpr(m.identifier("Promise"),m.identifier("all"));r.body.push(m.exprStmt(m.awaitExpr(m.callExpr(a,[this.$path("$promises.exports")]))))}let n=this.serialize(r,{startingIndentLevel:this.params.startingIndentLevel});return{toString(){return n},identifier:this.currentScope.get$qIdentifier("$q").name,topLevelAwait:this.topLevelAwait,get originalSource(){return t.originalSource||""}}})}transformNodes(t,i={}){let r=t.length,[s,n,a]=t.reduce(([o,l,u],c)=>c.type==="ImportDeclaration"?[o.concat(c),l,u]:c.type==="FunctionDeclaration"?[o,l.concat(c),u]:[o,l,u.concat(c)],[[],[],[]]);return t=[...s,...n,...a],function o(l,u){if(u===r)return l;let[c,f]=this.transformNode(t[u],i,!0);if(l=l.concat(c||[]),u===s.length-1){let p=m.memberExpr(m.identifier("Promise"),m.identifier("all"));l=l.concat(m.exprStmt(m.awaitExpr(m.callExpr(p,[this.$path("$promises.imports")]))))}if(["ReturnStatement","BreakStatement","ContinueStatement"].includes(t[u].type))return l;if(f.flowControl?.size&&f.node.type==="IfStatement"){let p=t.slice(u+1);if(p.length){let d=new Zt(p);return l.concat(this.transformNode(d))}}return o.call(this,l,u+1)}.call(this,[],0)}transformNode(t,i={},r=!1){if(typeof t!="object"||!t)return t;let s={static:this.currentEntry?.static,mode:this.currentEntry?.mode,...i,parentNode:this.currentEntry?.node,node:t,hoistedAwaitKeyword:!1,flowControl:new Map},n=this.pushHistory(s,()=>this[`transform${t.type}`]?this[`transform${t.type}`].call(this,t):Object.keys(t).reduce((a,o)=>{let l=Array.isArray(t[o])?this.transformNodes(t[o],i):this.transformNode(t[o],i);return{...a,[o]:l}},{}));return r?[n,s]:n}$serial(t){return this.currentScope.index(t,this.params.locations)}$path(t){return t.split(".").reduce((i,r)=>m.memberExpr(i,m.identifier(r)),this.currentScope.get$qIdentifier("$q"))}$trail(){return this.currentEntry.trail?[m.literal(this.currentEntry.trail)]:[]}$call(t,...i){return m.callExpr(this.$path(t),i)}$typed(t,i,r=null){let s=r?[m.literal(r)]:[];return this.$call("typed",m.literal(t),i,...s)}$obj(t){let i=Object.entries(t).map(([r,s])=>m.property(m.identifier(r),Array.isArray(s)?m.arrayExpr(s):s));return m.objectExpr(i)}$closure(...t){let i=t.pop(),r=t.pop()||[];return m.arrowFuncExpr(null,r,i,this.currentEntry.hoistedAwaitKeyword)}$var(t,i,r,s,...n){let a=s?this.$closure([this.currentScope.get$qIdentifier("$q")],s):m.identifier("undefined"),o=this.$call(t,m.literal(r),i,a,...n);return a.async&&(o=m.awaitExpr(o)),m.exprStmt(o)}$update(t,i,...r){let s=this.$closure(i);return this.$call("update",m.literal(t.name),s,...r)}$autorun(t,...i){let r=i.pop(),s=i.pop(),n=i.pop()||{},a=Object.keys(n).length?[this.$obj(n)]:[],o=this.$closure([this.currentScope.get$qIdentifier("$q")],r),l=this.$call("autorun",m.literal(t),...a,s,o);return o.async&&(l=m.awaitExpr(l)),m.exprStmt(l)}$iteration(t,i,r){let s=m.literal(t),n=this.currentEntry.parentNode.label?m.literal(this.currentEntry.parentNode.label.name):m.identifier("null"),a={kind:s,label:n},o=m.blockStmt(r);return this.$autorun("iteration",a,i,o)}hoistAwaitKeyword(){for(let t of this.history)if(t.hoistedAwaitKeyword=!0,t.node.type.includes("Function"))return;this.topLevelAwait=!0}hoistArgumentsKeyword(){let t=["FunctionDeclaration","FunctionExpression"];if(!this.history.some(i=>t.includes(i.node.type)))return this.topLevelArgsKeyword=!0,!0}hoistExitStatement(t,i={}){for(let r of this.history){let s=()=>r.node?.type==="SwitchStatement"&&t.value==="break"&&i.name==="null",n=()=>r.parentNode?.type==="LabeledStatement"&&this.loopTypes.includes(r.parentNode.body.type)&&i.value===r.parentNode.label.name,a=()=>this.loopTypes.includes(r.node.type)&&i.name==="null";if(s())return r.node;if(n()||a())return r.flowControl.set(t,{...i,endpoint:!0}),r.node;if(r.node.type.includes("Function"))return;r.flowControl.set(t,i)}}transformFunctionDeclaration(t){return this.transformFunction(m.funcDeclaration,...arguments)}transformFunctionExpression(t){return this.transformFunction(m.funcExpr,...arguments)}transformArrowFunctionExpression(t){return this.transformFunction(m.arrowFuncExpr,...arguments)}transformFunction(t,i){let r=this.$serial(i),{id:s,params:n,body:a}=i;[s,n,a]=this.pushScope(i,()=>{let y=[];s&&this.currentScope.push(s,"self");let x=n.map(b=>{if(b.type==="AssignmentPattern"&&i.isQuantumFunction){let v=this.currentScope.getRandomIdentifier("$rand",!1),N=this.transformSignal(v,"param"),T=m.varDeclarator(b.left,m.withLoc(m.logicalExpr("||",v,b.right),b));return y.push(...this.transformNode(m.varDeclaration("let",[m.withLoc(T,b)]),{static:!i.isQuantumFunction})),N}return this.transformSignal(b,"param")}),w=this.transformNode(a,{static:!i.isQuantumFunction});y.push(...w.type==="BlockStatement"?w.body:[m.returnStmt(w)]),y.length&&(y[0].comments=m.comments("Function body"));let g=m.exprStmt(m.assignmentExpr(this.$path("locations"),m.arrayExpr(this.currentScope.locations)));return g.comments=m.comments("Location data"),y.unshift(g),[s,x,m.blockStmt(y)]});let o=this.currentScope.get$qIdentifier("$q"),l=this.$closure([o],a),u=m.identifier(i.isQuantumFunction||!1),c=m.identifier(i.type==="FunctionDeclaration"),f=m.blockStmt([m.returnStmt(this.$call("runtime.spawn",u,m.thisExpr(),l))]),p=y=>this.$call("function",c,u,r,y),d=t.call(m,s,n,f,i.async,i.expresion,i.generator);if(i.type==="FunctionDeclaration"){if(this.currentScope.push(s,"static"),d=[d,m.exprStmt(p(s))],this.currentEntry.isExport){let y=[m.literal(s),r];this.currentEntry.isExport==="as-default"&&y.push(m.literal("default")),this.exports.add([m.arrayExpr(y)])}}else this.currentEntry.isMethod||(d=p(d));return d}transformClassDeclaration(t){return this.transformClass(m.classDeclaration,...arguments)}transformClassExpression(t){return this.transformClass(m.classExpression,...arguments)}transformClass(t,i){let{id:r,body:s,superClass:n}=i;n&&(n=this.transformNode(n));let a=new Set;s=this.pushScope(i,()=>(r&&this.currentScope.push(r,"self"),this.transformNode(s,{methods:a})));let o=m.identifier(i.type==="ClassDeclaration"),l=c=>{let f=m.arrayExpr([...a].map(p=>this.$obj(p)));return this.$call("class",o,c,f)},u=t.call(m,r,s,n);if(i.type==="ClassDeclaration"){if(this.currentScope.push(r,"static"),u=[u,m.exprStmt(l(r))],this.currentEntry.isExport){let c=[m.literal(r),this.$serial(i)];this.currentEntry.isExport==="as-default"&&c.push(m.literal("default")),this.exports.add([m.arrayExpr(c)])}}else u=l(u);return u}transformMethodDefinition(t){let{key:i,value:r}=t;t.computed&&(i=this.transformNode(i));let s=this.transformNode(r,{static:!0,isMethod:!0});return this.currentEntry.methods.add({name:t.computed?i:m.literal(i),static:m.identifier(t.static),isQuantumFunction:m.identifier(r.isQuantumFunction||!1),serial:this.$serial(t)}),m.methodDefinition(i,s,t.kind,t.static,t.computed)}transformPropertyDefinition(t){let{key:i,value:r}=t;return t.computed&&(i=this.transformNode(i)),r=this.transformNode(r),m.exprStmt(m.propertyDefinition(i,r,t.static,t.computed))}exports=new Set;transformExportDefaultDeclaration(t){return this.handleExports(...arguments)}transformExportNamedDeclaration(t){return this.handleExports(...arguments)}transformExportAllDeclaration(t){return this.handleExports(...arguments)}handleExports(t){if(t.type==="ExportAllDeclaration"){let r=[m.literal("*"),this.$serial(t.exported||t),m.literal(t.exported?.name||t.exported?.value||"")];this.exports.add([m.arrayExpr(r),this.$obj({source:t.source,serial:this.$serial(t)})]);return}let i=r=>r.map(s=>{let n=[m.literal(s.local.name),this.$serial(s)],a=s.exported.name||s.exported.value;return a!==s.local.name&&n.push(m.literal(a)),m.arrayExpr(n)});if(t.source){this.exports.add(i(t.specifiers).concat(this.$obj({source:t.source,serial:this.$serial(t)})));return}if(t.type==="ExportNamedDeclaration"&&t.specifiers.length){this.exports.add(i(t.specifiers));return}if(t.type==="ExportDefaultDeclaration"&&["Identifier","ThisExpression"].includes(t.declaration.type)){let r=[m.literal(t.declaration.name||"this"),this.$serial(t),m.literal("default")];this.exports.add([m.arrayExpr(r)]);return}return this.transformNode(t.declaration,{isExport:t.type==="ExportDefaultDeclaration"?"as-default":!0})}transformImportDeclaration(t){let i=t.specifiers.map(r=>{let{imported:s,local:n}=r;this.transformSignal(n,"import"),r.type==="ImportNamespaceSpecifier"?s=m.identifier("*"):r.type==="ImportDefaultSpecifier"&&(s=m.identifier("default"));let a=s.name||s.value||"",o=[m.literal(a),this.$serial(r)];return a!==r.local.name&&o.push(m.literal(r.local.name)),m.arrayExpr(o)});return m.exprStmt(this.$call("import",...i.concat(this.$obj({source:t.source,serial:this.$serial(t)}))))}transformImportExpression(t){return this.$call("import",this.$obj({source:t.source,isDynamic:m.identifier("true"),serial:this.$serial(t)}))}transformSignal(t,i,r=null){return t.type==="Identifier"?(this.currentScope.push(t,i,["let","param"].includes(i)),r?.add(t),t):this.transformNode(t,{mode:i,static:!0,signals:r})}transformThisExpression(t){return this.transformIdentifier(...arguments)}transformIdentifier(t){let i=this.currentScope.find(t);!i&&t.name&&this.currentScope.$qIdentifiersNoConflict(t.name);let r=[];return t.hint?r.push(this.$obj({[t.hint]:m.identifier(!0)})):this.currentEntry.mode,t.type==="ThisExpression"||["param","self"].includes(i?.type)||["arguments"].includes(t.name)?this.currentEntry.trail?this.$call("obj",t,...this.$trail(),...r):t:(this.history.forEach(s=>s.refs?.add(t)),this.$call("ref",m.literal(t),...this.$trail(),...r))}transformMemberExpression(t){let{object:i,property:r,computed:s,optional:n}=t;s&&(r=this.transformNode(r));let a=this.transformNode(i,{trail:(this.currentEntry.trail||0)+1});return i.typed&&(a=this.$typed(i.typed,a,m.literal(r))),m.memberExpr(a,r,s,n)}transformVariableDeclaration(t){let i=this.currentEntry.isExport;return t.declarations.reduce((s,n)=>["ObjectPattern","ArrayPattern"].includes(n.id.type)?s.concat(this.expandPattern(n.id,n.init)):s.concat(n),[]).reduce((s,n)=>{let a=this.$serial(n),o=this.transformNode(n.init);this.transformSignal(n.id,t.kind,this.currentEntry.signals);let l=[];n.restOf&&(o=this.$typed(n.init.typed,o),l.push(this.$obj({restOf:n.restOf,type:m.literal(n.init.typed==="iterable"?"array":"object")})));let u=s.concat(this.$var(t.kind,a,n.id,o,...l));if(i&&!(n.id instanceof bt)){let c=[m.literal(n.id),a];this.exports.add([m.arrayExpr(c)])}return u},[])}transformAssignmentExpression(t){let r=!this.currentEntry.static&&this.history[1].node.type==="ExpressionStatement",{left:s,right:n}=t,a=(l,u)=>(u=this.transformNode(u),l=this.transformNode(l),m.assignmentExpr(l,u,t.operator));if(["MemberExpression","ChainExpression"].includes(s.type))return a(s,n);if(["ObjectPattern","ArrayPattern"].includes(s.type)){let l=n,u=this.expandPattern(s,n,r).reduce((c,f)=>{if(f.id.originalB&&(l=f.id),f.type==="AssignmentExpression")return c.concat(a(f.left,f.right));let p=this.transformNode(f.init);if(f.id instanceof bt){let y=this.$serial(f);return c.concat(this.$var("let",y,f.id,p))}this.transformSignal(f.id,"update",this.currentEntry.signals);let d=[];return f.restOf&&(p=this.$typed(f.init.typed,p),d.push(this.$obj({restOf:f.restOf,type:m.literal(f.init.typed==="iterable"?"array":"object")}))),c.concat(this.$update(f.id,p,...d))},[]);return r?u:m.sequenceExpr(u.concat(l))}n=this.transformNode(n),this.transformSignal(s,"update",this.currentEntry.signals);let o=this.currentScope.getRandomIdentifier("$current",!1);return this.$call("update",m.literal(s),this.$closure([o],m.assignmentExpr(o,n,t.operator.replace("====",""))))}transformAssignmentPattern(t){let{left:i,right:r}=t;return r=this.transformNode(r),["MemberExpression","ChainExpression"].includes(i.type)?i=this.transformNode(i,{static:!0}):i=this.transformSignal(i,this.currentEntry.mode,this.currentEntry.signals),m.assignmentPattern(i,r)}expandPattern(t,i,r=!0){let s=[],n=this;if(!["Identifier","Literal"].includes(i.type)&&r){let a=m.withLoc(n.currentScope.getRandomIdentifier("$rand",!1),i);a.originalB=!0,i.typed=t.type==="ObjectPattern"?"desctructurable":"iterable",s.push(m.withLoc(m.varDeclarator(a,i),i)),i=a}return function a(o,l,u){l.typed=u?"desctructurable":"iterable";let c=[];for(let f=0;f<o.length;f++){let p=o[f],d=f,y=p;if(p===null){c.push(f);continue}if(p.type==="RestElement"){let b=m.withLoc(m.varDeclarator(p.argument,l),p);b.restOf=c.map(v=>m.literal(v)),s.push(b);continue}u?{key:d,value:y}=p:d=m.literal(d);let x,w;y.type==="AssignmentPattern"?(x=y.right,y.left.type==="Identifier"?w=y.left:y=y.left):y.type==="Identifier"&&(w=y);let g=m.memberExpr(l,d,u?p.computed:!0);if(x&&(g=m.logicalExpr("||",g,x)),w)s.push(m.withLoc(m.varDeclarator(w,g),p)),c.push(d);else if(y.type==="MemberExpression"||y.type==="ChainExpression"&&(y=y.expression))s.push(m.withLoc(m.assignmentExpr(y,g),p));else if(y.elements||y.properties){let b=(y.properties?y.properties:y.elements).length>1;if(r&&b){let v=n.currentScope.getRandomIdentifier("$rand",!1);s.push(m.withLoc(m.varDeclarator(v,g),p)),g=v}a(y.elements||y.properties,g,y.properties&&!0)}}}(t.elements||t.properties,i,t.properties&&!0),s}transformUpdateExpression(t){if(t.argument.type==="Identifier"){this.transformSignal(t.argument,"update",this.currentEntry.signals);let i=this.currentScope.getRandomIdentifier("$current",!1),r=m.binaryExpr(t.operator==="--"?"-":"+",i,m.literal(1),!0),s=(t.prefix?"pre":"post")+(t.operator==="--"?"dec":"inc");return this.$call("update",m.literal(t.argument.name),this.$closure([i],r),this.$obj({kind:m.literal(s)}))}return transform.call(m,t.operator,this.transformNode(t.argument),t.prefix)}transformUnaryExpression(t){return t.operator==="typeof"&&t.argument.type==="Identifier"&&(t.argument.hint="isTypeCheck"),m.unaryExpr(t.operator,this.transformNode(t.argument))}transformIfStatement(t){let i=this.$serial(t),{test:r,consequent:s,alternate:n}=t;r=this.transformNode(t.test),s=this.pushScope(t,()=>this.transformNodes([t.consequent])),s[0].type!=="BlockStatement"&&s.length>1?s=m.blockStmt(s):s=s[0],n&&(n=this.pushScope(t,()=>this.transformNodes([t.alternate])),n[0]&&n[0].type!=="BlockStatement"&&n.length>1?n=m.blockStmt(n):n=n[0],n.type==="BlockStatement"&&(n=this.$autorun("block",this.$serial(t.alternate),n)));let a=m.ifStmt(r,s,n);return this.currentEntry.static?a:this.$autorun("block",i,m.blockStmt([a]))}transformSwitchStatement(t){let i=this.$serial(t);return this.pushScope(t,()=>{let r=this.transformNode(t.discriminant),s=t.cases.map(a=>{let o=this.transformNode(a.test),l=this.transformNodes(a.consequent);return m.switchCase(o,l)}),n=m.switchStmt(r,s);return this.currentEntry.static?n:this.$autorun("block",$loc,m.blockStmt([n]))})}transformWhileStatement(t){return this.transformLoopStmtA(m.whileStmt,...arguments)}transformDoWhileStatement(t){return this.transformLoopStmtA(m.doWhileStmt,...arguments)}transformForStatement(t){return this.transformLoopStmtA(m.forStmt,...arguments)}transformLoopStmtA(t,i){let r=i.type==="WhileStatement"?"while":i.type==="DoWhileStatement"?"do-while":"for",s=this.$serial(i);return this.pushScope(i,()=>{let n=this.currentScope.get$qIdentifier("$q"),a,o={kind:m.literal(r),label:this.currentEntry.parentNode.label?m.literal(this.currentEntry.parentNode.label.name):m.identifier("null")};if(r==="for"){let u=m.blockStmt(this.transformNode(i.init));o.init=this.$closure([n],u);let c=this.transformNode(i.test);o.test=this.$closure([n],c);let f=this.transformNode(i.update);o.advance=this.$closure([n],f),a=p=>t.call(m,u,c,f,p)}else{let u=this.transformNode(i.test);o.test=this.$closure([n],u),a=c=>t.call(m,u,c)}let l=this.transformNode(i.body);return this.currentEntry.static?a(l):this.$autorun("iteration",o,s,l)})}transformForOfStatement(t){return this.transformLoopStmtB(m.forOfStmt,...arguments)}transformForInStatement(t){return this.transformLoopStmtB(m.forInStmt,...arguments)}transformLoopStmtB(t,i){let r=i.type==="ForInStatement"?"for-in":"for-of",s=this.$serial(i),n=this.transformNode(i.right);return this.pushScope(i,()=>{if(this.currentEntry.static){let[f,p]=this.transformNodes([i.left,i.body]);return t.call(m,f,n,p)}let a=this.currentScope.get$qIdentifier("$q"),o=this.currentScope.get$qIdentifier(r==="for-of"?"$val":"$key",!1),l={kind:m.literal(r),label:this.currentEntry.parentNode.label?m.literal(this.currentEntry.parentNode.label.name):m.identifier("null"),parameters:this.$closure([a],m.arrayExpr([m.literal(o),n]))},u;if(i.left.type==="VariableDeclaration"){let f=m.withLoc(m.varDeclarator(i.left.declarations[0].id,o),i.left);u=m.varDeclaration(i.left.kind,[f])}else u=m.withLoc(m.assignmentExpr(i.left,o),i.left);let c=m.blockStmt(this.transformNodes([u].concat(i.body.body)));return this.$autorun("iteration",l,s,c)})}transformBreakStatement(t){return this.transformExitStmt(m.breakStmt,...arguments)}transformContinueStatement(t){return this.transformExitStmt(m.continueStmt,...arguments)}transformExitStmt(t,i){let r=i.type==="BreakStatement"?"break":"continue",s=m.literal(r),n=i.label?m.literal(i.label.name):m.identifier("null");return this.hoistExitStatement(s,n)?.type==="SwitchStatement"?t.call(m):m.exprStmt(this.$call(r,n))}transformReturnStatement(t){let i=new Set,r=this.transformNode(t.argument,{refs:i});if(this.currentEntry.static)return m.returnStmt(r);let s=m.literal("return"),n=r?[s,r]:[s];this.hoistExitStatement(...n);let a=this.$call("return",...n.slice(1));if(!i.size)return m.exprStmt(a);let o=this.$serial(t);return this.$autorun("return",o,a)}transformBlockStatement(t){if(t instanceof Zt){let r=this.$serial(t),s=this.transformNodes(t.body);return this.$autorun("downstream",r,m.blockStmt(s))}let i=this.pushScope(t,()=>this.transformNodes(t.body));return m.blockStmt(i)}transformLabeledStatement(t){this.currentScope.push(t.label,"const");let i=[].concat(this.transformNode(t.body));return[m.labeledStmt(t.label,i.shift()),...i]}transformExpressionStatement(t){let i=this.$serial(t);return[].concat(this.transformNode(t.expression)||[]).reduce((s,n)=>n.type==="VariableDeclaration"||n.type.endsWith("Statement")?s.concat(n):this.currentEntry.static?m.exprStmt(n):s.concat(this.$autorun("stmt",i,n)),[])}transformAwaitExpression(t){this.hoistAwaitKeyword();let i=this.transformNode(t.argument);return m.awaitExpr(i)}transformSequenceExpression(t){let i=t.expressions.reduce((r,s,n)=>r.concat(this.transformNode(s,{trail:n===t.expressions.length-1?this.currentEntry.trail:void 0})),[]);return this.history[1].node.type==="ExpressionStatement"?i:m.sequenceExpr(i)}transformConditionalExpression(t){let{test:i,consequent:r,alternate:s}=t;return i=this.transformNode(i),r=this.transformNode(r,{trail:this.currentEntry.trail}),s=this.transformNode(s,{trail:this.currentEntry.trail}),m.conditionalExpr(i,r,s)}transformLogicalExpression(t){let{left:i,right:r}=t;return i=this.transformNode(i,{trail:this.currentEntry.trail}),r=this.transformNode(r,{trail:this.currentEntry.trail}),m.logicalExpr(t.operator,i,r)}transformBinaryExpression(t){let{left:i,right:r}=t;i=this.transformNode(i),r=this.transformNode(r);let s=m.binaryExpr(t.operator,i,r);return this.currentEntry.trail?this.$call("obj",s,...this.$trail()):s}transformCallExpression(t){return this.transformCallExpr(m.callExpr,...arguments)}transformNewExpression(t){return this.transformCallExpr(m.newExpr,...arguments)}transformCallExpr(t,i){let r=this.transformNode(i.callee,{mode:"callee"}),s=i.arguments.map(a=>this.transformNode(a)),n=t.call(m,r,s,i.optional);return this.currentEntry.trail?this.$call("obj",n,...this.$trail()):n}transformObjectExpression(t){let i=m.objectExpr(t.properties.map(r=>this.transformNode(r)));return this.currentEntry.trail?this.$call("obj",i,...this.$trail()):i}transformProperty(t){let{key:i,value:r}=t;return t.computed&&(i=this.transformNode(i)),r=this.transformNode(r),m.property(i,r,t.kind,!1,t.computed,!1)}transformArrayExpression(t){let i=m.arrayExpr(t.elements.map(r=>this.transformNode(r)));return this.currentEntry.trail?this.$call("obj",i,...this.$trail()):i}transformTaggedTemplateExpression(t){let[i,r]=this.transformNodes([t.tag,t.quasi]),s=m.taggedTemplateExpr(i,r);return this.currentEntry.trail?this.$call("obj",s,...this.$trail()):s}transformTemplateLiteral(t){let i=t.expressions.map(s=>this.transformNode(s)),r=m.templateLiteral(t.quasis,i);return this.currentEntry.trail?this.$call("obj",r,...this.$trail()):r}};var as=new Map;function os(e,t={}){let i=`${e}${JSON.stringify(t)}`,r=as.get(i);if(!r){try{r=Yr.parse(e,t)}catch(s){let n=`${s.message||s}`,{pos:a,loc:{line:o,column:l}}=s,c=[{expr:e.slice(Math.max(0,a-15),a+15),line:o,column:l},{source:e}];throw t.inBrowser&&console.error(c),new(globalThis[s.name]||Error)(n,{cause:c})}r.originalSource=e,as.set(i,r)}return r}function us(e,t={}){return new be(t).transform(e)}function Ye(...e){let t,i={runtimeParams:Rn,compilerParams:Ln,parserParams:$n};for(;t=e.shift();){let{runtimeParams:r={},compilerParams:{globalsNoObserve:s=[],globalsOnlyPathsExcept:n=[],...a}={},parserParams:o={}}=t;i={runtimeParams:{...i.runtimeParams,...r},compilerParams:{...i.compilerParams,globalsNoObserve:[...i.compilerParams.globalsNoObserve,...s],globalsOnlyPathsExcept:[...i.compilerParams.globalsOnlyPathsExcept,...n],...a},parserParams:{...i.parserParams,...o}},e.devMode}return i}var $n={ecmaVersion:"latest",allowReturnOutsideFunction:!0,allowAwaitOutsideFunction:!1,allowSuperOutsideMethod:!1,preserveParens:!1,locations:!0},Ln={globalsNoObserve:["arguments","debugger"],globalsOnlyPathsExcept:[],originalSource:!0,locations:!0,compact:2},Rn={apiVersion:3};var we=Object.create(null);var Lt=class extends EventTarget{managedAlways=new Set;managedOnce=new Set;constructor(){super(),hr.setMaxListeners?.(0,this)}fire(t){return this.dispatchEvent(new Event(t,{cancelable:!0}))}on(...t){return this.addEventListener(...t),()=>this.removeEventListener(...t)}abort(t=!1){this.managedAlways.forEach(i=>i.abort?i.abort(t):i(t)),this.managedOnce.forEach(i=>i.abort?i.abort(t):i(t)),this.managedOnce.clear(),this.fire("abort")}manage(t){this.managedAlways.add(t)}once(t){this.managedOnce.add(t)}};var Rt=class extends Lt{subscribers=new Set;signals=new Map;constructor(t,i,r){super(),this.context=t,this.context?.once(()=>this.abort()),this.once(()=>this.watchMode(!1)),this.type=i,this.state=r}get name(){return[...this.context?.signals.keys()||[]].find(t=>this.context.signals.get(t)===this)}signal(t,i="prop"){let r=this.signals.get(t);return r||(r=new Rt(this,i,i==="object"?t:wi(this.state)?I.get(this.state,t):void 0),this.signals.set(t,r),this.signals.size===1&&this.watchMode(),r.once(()=>{this.signals.delete(t),this.signals.size||this.watchMode(!1)})),r}subscribe(t){this.subscribers.add(t),t.once(()=>{this.subscribers.delete(t),this.subscribers.size||this.abort()})}watchMode(t=!0){this.mutationsWatch?.abort(),!(!t||!this.signals.size||!wi(this.state))&&(this.mutationsWatch=I.observe(this.state,i=>{let r={map:new Map,add(n,a){for(let o of n)o.spec.beforeSchedule?.(a)!==!1&&(this.map.has(o.runtime)||this.map.set(o.runtime,new Set),this.map.get(o.runtime).add(o))}};for(let n of i){let a=this.signals.get(n.key);!a||(r.add(a.subscribers,n),a.refresh(n.value))}let s=r.map.size?[...r.map].sort((n,a)=>n.$serial>a.$serial?-1:1):r.map;for(let[n,a]of s)n.state!=="aborted"&&n.schedule(...a)},{recursions:"force-sync"}))}refresh(t){this.state=t;for(let[i,r]of this.signals)r.refresh(I.get(this.state??{},i));this.watchMode()}};var z=class extends Rt{symbols=new Map;constructor(t,i,r=void 0){super(t,i,r||Object.create(null))}};var ht=class extends Lt{state;constructor(t,i,r,s,n,a){super(),t?.once(this),this.context=t,this.type=i,this.spec=r,this.scope=n,t?.scope!==n&&this.manage(n),this.serial=s,a&&(this.closure=a),t?.type==="iteration"?this.path=t.path.concat(this.spec.index):t?.type==="round"?this.path=t.path.concat(this.serial):this.path=(t?.path||[]).slice(0,-1).concat(this.serial),this.flowControl=new Map}get runtime(){return this.context.runtime}contains(t){return this===t.context||t.context&&this.contains(t.context)}order(t){if(!t)return this;let[i,r]=t.path.length<this.path.length?[t,this]:[this,t];return i.path.reduce((s,n,a)=>s&&n<=r.path[a],!0)&&i||r}beforeExecute(){this.state="running";let t=this.flowControl;return this.flowControl=new Map,t}execute(t=null){try{return this.runtime.thread.unshift(this),K(this.beforeExecute(),i=>bi(this.closure,this,this,r=>(this.spec.complete&&(r=this.spec.complete(r,this)),this.afterExecute(i),this.runtime.thread.shift(),t?t(r,this):r)))}catch(i){if(i.cause)throw i;let r=`${i.message||i}`;this.runtime.throw(r,[this.serial,this.context?.serial],globalThis[i.name])}}afterExecute(t){this.state="complete";let i=this.flowControl;this.handleDownstream(i.size,t.size),this.handleRightstream(i.size,t.size);for(let r of["break","continue","return"])i.has(r)&&!i.get(r).endpoint?this.hoistFlowControl(r,i.get(r).arg):t.has(r)&&!t.get(r).endpoint&&this.hoistFlowControl(r,t.get(r).arg,!0)}typed(t,i,r=void 0){let s=Array.isArray(i)?"array":i===null?"null":typeof i;if(s===t||t==="iterable"&&i?.[Symbol.iterator]||t==="desctructurable"&&!["undefined","null"].includes(s))return i;throw t==="iterable"?new Error("value is not iterable."):t==="desctructurable"?new Error((r?`Cannot access ${r}; `:"")+"object not desctructurable."):new Error(`value must be of type ${t}.`)}let(t,i,r,s={}){return this.var(t,i,r,{...s,kind:"let"})}const(t,i,r,s={}){return this.var(t,i,r,{...s,kind:"const"})}var(t,i,r,s={}){s={kind:"var",...s},r||(r=()=>{});let n=s.restOf?(...o)=>{try{return r(...o)}catch(l){throw new Error(`Cannot declare ${t}; ${l.message}`)}}:r,a=(o,l)=>{let u=s.kind==="var"?this.runtime.scope:l.scope;for(;s.kind==="var"&&!["module","function"].includes(u.type)&&!I.has(u.state,t)&&u.context;)u=u.context;let c=u.symbols.get(t);if(c&&(c.kind!==s.kind||s.kind==="let"&&c.serial!==i))throw new Error(`Identifier "${t}" has already been declared.`);c?.reader?.abort(),c={serial:i,kind:s.kind};let f=o;return s.restOf&&(s.type==="array"?f=[]:f={},c.reader=I.map(o,f,{except:s.restOf,spread:s.type==="array"}),l.once(c.reader)),u.symbols.set(t,c),I.set(u.state,t,f),f};return this.autorun(s.kind,{complete:a,...s},i,n)}update(t,i,r={}){let s=this.scope;for(;s&&!I.has(s.state,t);)s=s.context;if(!s)throw new ReferenceError(`${t} is not defined.`);let n=s.symbols.get(t);if(n?.kind==="const")throw new ReferenceError(`Assignment to constant variable "${t}".`);let a=I.get(s.state,t),o=r.restOf?(...l)=>{try{return i(...l)}catch(u){throw new Error(`Cannot update ${t}; ${u.message}`)}}:i;return bi(o,void 0,a,l=>{n?.reader?.abort();let u=l;return r.restOf&&(n=n||{},r.type==="array"?u=[]:u={},n.reader=I.map(l,u,{except:r.restOf,spread:r.type==="array"}),this.once(n.reader)),I.set(s.state,t,u),["postinc","postdec"].includes(r.kind)?a:u})}ref(t,...i){let r=0,s={};typeof i[0]=="number"?(r=i.shift(),s=i.shift()||{}):typeof i[0]=="object"&&(s=i.shift());let n=this.scope;for(;n&&!I.has(n.state,t);)n=n.context;if(!n){if(s.isTypeCheck)return;throw new Error(`${t} is not defined.`)}let a=n.symbols.get(t)?.kind,o=n.signal(t,a);return s.typed&&this.typed(s.typed,o.state,t),this.autobind(o,r,s)}obj(t,...i){let r=0,s={};return typeof i[0]=="number"?(r=i.shift(),s=i.shift()||{}):typeof i[0]=="object"&&(s=i.shift()),this.autobind(this.runtime.$objects.signal(t,"object"),r,s)}autobind(t,i,r){let s=this.runtime.$params.isQuantumFunction,n=t.type==="const",a=this===this.runtime,o=this.state==="aborted",l=this;return function u(c,f){if(s&&!n&&!a&&!o&&c.subscribe(l),!f||!c.state||typeof c.state!="object"){let d=c.state;return typeof c.state=="function"&&(d=I.proxy(c.state,{membrane:c})),d}let p;return I.proxy(c.state,{},d=>({...d,get(y,x,w=null){return p?d.get(y,x,w):(p=!0,u(c.signal(x),f-1))}}))}(t,i)}autorun(t,...i){let r=i.pop(),s=i.pop(),n=i.pop()||{},a=ht,o=this.scope;if(t==="iteration"){let u=this.runtime.constructor;a=r.constructor.name==="AsyncFunction"?u.AutoAsyncIterator:u.AutoIterator}["block","iteration"].includes(t)&&(o=new z(o,t));let l=new a(this,t,n,s,o,r);if(!(t==="downstream"&&(this.downstream=l,this.flowControlApplied())))return l.execute()}function(t,i,r,s){t&&I.set(this.scope.state,s.name,s);let n=this;return Object.defineProperty(s,"toString",{value:function(a=!1){if(a&&i)return Function.prototype.toString.call(s);let o=n.runtime.extractSource(r);return o.startsWith("static ")?o.replace("static ",""):o}}),s}class(t,i,r){return t&&I.set(this.scope.state,i.name,i),r.forEach(({name:s,static:n,isQuantumFunction:a,serial:o})=>{this.function(!1,a,o,n?i[s]:i.prototype[s])}),i}async import(...t){return this.runtime.import(...t)}async export(...t){return this.runtime.export(...t)}continue(t){return this.applyFlowControl("continue",t)}break(t){return this.applyFlowControl("break",t)}return(t){return this.applyFlowControl("return",t)}applyFlowControl(t,i,r=!1){let s=this.flowControl.size;if(r?this.flowControl.delete(t):this.flowControl.set(t,{arg:i}),this.type==="round"&&(this.context.breakpoint=this),this.type==="round"&&["break","continue"].includes(t)&&i===this.context?.spec.label){r||(this.flowControl.get(t).endpoint=!0),this.state!=="running"&&this.handleRightstream(this.flowControl.size,s);return}this.state!=="running"&&(this.handleDownstream(this.flowControl.size,s),this.hoistFlowControl(...arguments))}hoistFlowControl(...t){return this.context?.applyFlowControl(...t)}flowControlApplied(t,i){return arguments.length?arguments.length===1?this.flowControl.has(t):this.flowControl.get(t)?.arg===i:this.flowControl.size||!1}handleDownstream(t,i){let r;this.type!=="block"||!(r=this.context?.downstream)||(t?r.abort():i&&(r.state="resuming",this.runtime.schedule(r)))}handleRightstream(t,i){if(this.type!=="round")return;let r=this,s=new Set;for(;r=r.nextRound;)t?r.abort():i&&r.state!=="inert"&&(r.state="resuming",s.add(r));s.size&&this.runtime.schedule(...s),!t&&i&&this.runtime.on("reflection",()=>{this.context.iterating||this.context.iterate()},{once:!0})}abort(t=!1){return t&&(this.context?.breakpoint===this&&delete this.context.breakpoint,this.flowControl.clear()),this.state=t?"inert":"aborted",super.abort(t)}};var Mt=class extends ht{rounds=new Map;constructor(t,i,r,s,n,a){r.$closure=a,super(t,i,r,s,n),this.manage(()=>{delete this.breakpoint,this.rounds.clear()})}pseudorun(t){return this.runtime.iThread.unshift(this),K(t(),i=>(this.runtime.iThread.pop(),i))}createIterator(){return this.spec.kind==="for-in"?function*(){for(let t in this.iteratee)yield t}.call(this):this.spec.kind==="for-of"?function*(){for(let t of this.iteratee)yield t}.call(this):{next:()=>({done:!this.pseudorun(()=>this.spec.test(this))})}}closure(){["for-of","for-in"].includes(this.spec.kind)?([this.production,this.iteratee]=this.spec.parameters(this),this.iterator=this.createIterator(),this.iterator.original=!0,this.watchMode()):(this.spec.kind==="for"&&this.spec.init(this),this.iterator=this.createIterator()),this.iterate()}terminated(){return this.breakpoint&&!this.breakpoint.flowControlApplied("continue",this.spec.label)&&this.breakpoint.flowControlApplied()}advance(){this.spec.kind==="for"&&this.pseudorun(()=>this.spec.advance(this))}iterate(){this.iterating=!0;let t=()=>!this.terminated()&&!(this.cursor=this.iterator.next()).done,i=()=>{this.createRound(this.cursor.value).execute(),this.advance()};if(this.spec.kind==="do-while")do i();while(t());else for(;t();)i();this.iterating=!1}createRound(t){let i=this.rounds.size,r={index:i},s=["for-in","for-of"].includes(this.spec.kind)?{[this.production]:t}:{...this.scope.state},n=new z(this.scope,"round",s);this.scope.symbols.forEach((l,u)=>{n.symbols.set(u,l)});let a=new ht(this,"round",r,this.serial,n,this.spec.$closure),o=this.spec.kind==="for-in"?t:i;return this.rounds.set(o,a),this.lastRound&&(this.lastRound.nextRound=a,a.prevRound=this.lastRound),this.lastRound=a,a}watchMode(){let t=(i,r)=>{let s=new Set,n=new Set;for(let a of i){if(Array.isArray(this.iteratee)&&a.key==="length")continue;let o=this.spec.kind==="for-in"?a.key:a.value,l=this.spec.kind==="for-in"?a.key:parseInt(a.key),u=this.rounds.get(l);if(u)I.set(u.scope.state,this.production,o),a.type==="delete"&&(this.rounds.set(l,void 0),u.prevRound&&(u.prevRound.nextRound=u.nextRound),u.nextRound&&(u.nextRound.prevRound=u.prevRound),s.add(u));else if(a.type!=="delete"&&!a.isUpdate){if(this.spec.kind==="for-of"&&this.iterator.original&&!r.done)continue;n.add(o)}}this.runtime.on("reflection",()=>{s.forEach(a=>a.abort(!0))},{once:!0}),n.size&&(this.iterator=function*(a){yield*a,yield*n}(this.iterator),r.done&&this.iterate())};this.once(I.observe(this.iteratee,i=>{K(this.cursor,r=>t(i,r))}))}};var ve=class extends Mt{async createIterator(){return this.spec.kind==="for-in"?function*(){for(let t in this.iteratee)yield t}.call(this):this.spec.kind==="for-of"?function*(){for(let t of this.iteratee)yield t}.call(this):{next:async()=>({done:!await this.pseudorun(()=>this.spec.test(this))})}}async closure(){["for-of","for-in"].includes(this.spec.kind)?([this.production,this.iteratee]=await this.spec.parameters(this),this.iterator=await this.createIterator(),this.iterator.original=!0,this.watchMode()):(this.spec.kind==="for"&&await this.spec.init(this),this.iterator=await this.createIterator()),await this.iterate()}async iterate(){let t;this.iterating=!0;let i=async()=>!this.terminated()&&(this.cursor=this.iterator.next())&&(t=await this.cursor)&&!t.done,r=async()=>{await this.createRound(t.value).execute(),await this.advance()};if(this.spec.kind==="do-while")do await r();while(await i());else for(;await i();)await r();this.iterating=!1}};var Vt=class{constructor(t){Object.defineProperty(this,"runtime",{value:t});let i={statechange:()=>{I.defineProperty(this,"value",{value:t.flowControl.get("return")?.arg,enumerable:!0,configurable:!0})}};for(let r in i)t.on(r,i[r]),i[r]();t.$params.sourceType==="module"&&Object.defineProperty(this,"exports",{value:t.exports})}dispose(){return this.runtime.abort(!0)}};var Dt=class extends ht{locations=[];queue=new Set;thread=[];iThread=[];constructor(t,i,r,s,n){super(t,i,{},-1,s,n);let{$serial:a=0,...o}=r;this.$serial=a,this.$params=o,this.$objects=new z(void 0,"objects"),this.manage(this.$objects),this.exports=Object.create(null),this.$promises={imports:[],exports:[]},this.manage(()=>{I.deleteProperties(this.exports,Object.keys(this.exports)),this.$promises.imports.splice(0),this.$promises.exports.splice(0)})}extractSource(t,i=!1){let[[r,s,n],[a]]=this.locations[t],o=this.$params.originalSource.slice(r,a);return i?{expr:o,line:s,column:n}:o}throw(t,i,r=null,s=null){let n,a=s!==null?`[${s}]: ${t}`:t,o=i.map(u=>u!==-1&&this.extractSource(u,!0)).filter(u=>u);o.push({source:this.$params.originalSource}),n=new(r||Error)(a,{cause:o});let l=this.$params.sourceType==="module"&&this.$params.experimentalFeatures!==!1&&this.$params.exportNamespace||this.$params.fileName;throw l&&(n.fileName=l),s&&(n.code=s),this.$params.inBrowser&&console.error(o),n}get runtime(){return this}get nowRunning(){return this.thread[0]}schedule(...t){let i=this.queue.size;for(let r of t)this.queue.add(r);if(!i)return this.flowControlDirty=!1,function r(s,n){let a;for(let o of this.queue){if(n&&n.order(o)!==n||["aborted","running"].includes(o.state)||this.iThread[0]?.contains(o)){this.queue.delete(o);continue}a=a?a.order(o):o,n||(n=a)}return a?(a.abort(),a.execute(o=>(this.queue.delete(a),r.call(this,o,a)))):(this.fire("reflection"),this.flowControlApplied()&&this.fire("statechange"),s)}.call(this,void 0,this.nowRunning)}execute(t=null){return super.execute(i=>{let r=this.$params.isQuantumFunction?new Vt(this):i;return t?t(r,this):r})}spawn(t,i,r){let s=this.nowRunning||this,n={...this.$params,$serial:this.$serial+1,isQuantumFunction:t},a=new z(s.scope,"function",{this:i});return new this.constructor(s,"function",n,a,r).execute()}async import(...t){let i=t.pop(),r=typeof i=="string"?{source:i}:i,s=a=>{if(r.forExport||r.isDynamic)return a;this.assignModules(t,this.scope.state,a,i.serial)};if(this.$params.experimentalFeatures!==!1&&we[r.source])return s(we[r.source]);let n=(async()=>{let a=this.$params.sourceType==="module"&&this.$params.experimentalFeatures!==!1&&this.$params.exportNamespace||this.$params.fileName;try{return s(await import(r.source))}catch(o){throw o.code==="ERR_MODULE_NOT_FOUND"&&this.throw(`Cannot find package "${r.source}"${a?` imported at "${a}"`:""}.`,[r.serial],null,o.code),o}})();return r.isDynamic||this.$promises[r.forExport?"exports":"imports"].push(n),n}async export(...t){let i=Array.isArray(t[t.length-1])?null:t.pop(),r=i?await this.import({...i,forExport:!0}):this.scope.state;this.assignModules(t,this.exports,r,i?.serial)}assignModules(t,i,r,s=null){let n=[];for(let[a,o,l]of t){if(a==="*"&&l){I.set(i,l,r);continue}I.has(r,a)||this.throw(`The requested module does not provide an export named "${a}".`,[o,s]),I.set(i,l||a,I.get(r,a)),n.push([a,o,l])}!n.length||this.once(I.observe(r,a=>{for(let[o,,l]of n)for(let u of a)o==="*"?I.set(i,u.key,u.value):u.key===o&&I.set(i,l||o,u.value)}))}afterExecute(...t){return this.$params.sourceType==="module"&&this.$params.experimentalFeatures!==!1&&this.$params.exportNamespace&&(we[this.$params.exportNamespace]=this.exports,this.once(()=>{delete we[this.$params.exportNamespace]})),super.afterExecute(...t)}};j(Dt,"AutoAsyncIterator",ve),j(Dt,"AutoIterator",Mt);function _e(e,t,i,r){let{env:s,functionParams:n=[],exportNamespace:a,fileName:o}=r,{parserParams:l,compilerParams:u,runtimeParams:c}=Ye(r),f=Object.getOwnPropertyDescriptor(globalThis,"window")?.get?.toString().includes("[native code]")??!1,p=["async-script","module"].includes(e);if(e==="module")l.sourceType=e,l.allowAwaitOutsideFunction=!0;else if(["function","async-function"].includes(e)){let y=" "+i.split(`
|
|
10
|
+
`).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:o,line:u}=this;for(let l=0;l<a;l++)t[l]===`
|
|
11
|
+
`?(o=0,u++):o++;this.column=o,this.line=u;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 ps(e,t){let i=new zi(t);return i.generator[e.type](e,i),i.output}var Ct=class{type="Identifier";whitelist=[];blacklist=[];constructor(t){this.whitelist[0]=t}get name(){return this.whitelist[0]}noConflict(t){let i=this.whitelist.indexOf(t);if(i===-1)return!1;this.blacklist.push(this.whitelist.splice(i,1)),this.whitelist.length||(this.whitelist=this.blacklist.map(r=>{let s;do{let n=String.fromCharCode(0|Math.random()*26+97);s=`${r}${n}`}while(this.blacklist.includes(s));return s}))}};var d={throwStmt(e){return{type:"ThrowStatement",argument:e}},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}},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.conditionalExpr(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}},returnStmt(e){return{type:"ReturnStatement",argument:e}},yieldExpr(e,t=!1){return{type:"YieldExpression",argument:e,delegate:t}},awaitExpr(e){return{type:"AwaitExpression",argument: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"}},conditionalExpr(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}},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}},classDeclaration(e,t,i=null){return this.class("ClassDeclaration",...arguments)},classExpression(e,t,i=null){return this.class("ClassExpression",...arguments)},class(e,t,i,r=null){return{type:e,id:t,body:i,superClass:r}},methodDefinition(e,t,i="method",r=!1,s=!1){return{type:"MethodDefinition",key:e,value:t,kind:i,static:r,computed:s}},propertyDefinition(e,t,i=!1,r=!1){return{type:"PropertyDefinition",key:e,value:t,static:i,computed:r}},spreadElement(e){return{type:"SpreadElement",argument:e}},literal(e){if(typeof e=="object"&&!("name"in e)&&!("value"in e))throw new Error('Objects that convert to literals must have a "name" or "value" property.');return typeof e=="object"?{type:"Literal",get value(){return"name"in e?e.name:e.value}}:{type:"Literal",value:e}},templateLiteral(e,t){return{type:"TemplateLiteral",quasis:e,expressions:t}},comments(e){let t={};return Object.defineProperty(t,"toString",{value:()=>e}),Object.defineProperty(t,"trim",{value:function(){return this.toString()}}),[{type:"Line",value:t}]},withLoc(e,...t){return["start","end"].forEach(i=>{let r=i==="start"?t[0]:t[t.length-1];e[i]=r[i],r.loc&&(e.loc=e.loc||{},e.loc[i]=r.loc?.[i])}),e},invert(e){return this.unaryExpr("!",e)},clone(e){return e={...e},delete e.start,delete e.end,e}};var ne=class{type="BlockStatement";$body=[];constructor(t){this.body=t}get body(){return this.$body}set body(t){this.$body=t,d.withLoc(this,...t)}};var Ae=class{constructor(t,{type:i}){this.context=t,Object.assign(this,{type:i}),this.vars=new Set,this.$qIdentifiers=new Map,this.$qIdentifiersCursors={...this.context?.$qIdentifiersCursors||{}},this.locations=[]}index(t,i=!1){if(!this.type.includes("Function")&&this.context)return this.context.index(...arguments);let r=["start","end"].map(s=>{let n=[d.literal(t[s])];return i&&t.loc&&(n.push(d.literal(t.loc[s].line)),n.push(d.literal(t.loc[s].column))),d.arrayExpr(n)});return this.locations.push(d.arrayExpr(r)),d.literal(this.locations.length-1)}get$qIdentifier(t,i=!0,r=!1){let s=this.$qIdentifiers.get(t);if(!s){if(i&&this.context)return this.context.get$qIdentifier(t,i);r&&(typeof this.$qIdentifiersCursors[t]>"u"&&(this.$qIdentifiersCursors[t]=0),t+=this.$qIdentifiersCursors[t]++),this.$qIdentifiers.set(t,s=new Ct(t))}return s}getRandomIdentifier(t,i=!0){return this.get$qIdentifier(t,i,!0)}$qIdentifiersNoConflict(t){for(let[,i]of this.$qIdentifiers)i.noConflict(t);this.context&&this.context.$qIdentifiersNoConflict(t)}push(t,i,r=!1){let s;return["var","update"].includes(i)&&(s=this.find(t,!1))&&s.type!=="const"?s.willUpdate=!0:(i!=="update"||!this.context)&&(t instanceof Ct||this.$qIdentifiersNoConflict(t.name+""),this.vars.add({identifier:t,type:i,willUpdate:r||i==="update"})),this.context&&(i==="update"||i==="var"&&!this.type.includes("Function"))?this.context.push(t,i):!0}find(t,i=!0){let r;for(let s of this.vars)if(s.identifier.name+""==t.name+""){r=s;break}return!r&&i?this.context?.find(t,i):r}};var Pe=class{history=[];scopes=[];functionTypes=["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"];loopTypes=["DoWhileStatement","WhileStatement","ForStatement","ForOfStatement","ForInStatement"];labeledTypes=["SwitchStatement","LabeledStatement"];topLevelAwait=!1;topLevelArgsKeyword=!1;constructor(t={}){this.params=t}pushScope(t,i){let r=new Ae(this.currentScope,t);this.scopes.unshift(r);let s=i();return this.scopes.shift(),s}get currentScope(){return this.scopes[0]}pushHistory(t,i){this.history.unshift(t);let r=i();return this.history.shift(),r}get currentEntry(){return this.history[0]}serialize(t,i={}){return ps(t,{comments:!0,...i})}transform(t){if(t.type!=="Program")throw new Error('AST must be of type "Program".');return this.pushScope(t,()=>{let i=this.transformNodes(t.body,{static:this.params.startStatic}),r={...t,body:i};r.body.length&&(r.body[0].comments=d.comments("Program body"));let s=d.exprStmt(d.assignmentExpr(this.$path("locations"),d.arrayExpr(this.currentScope.locations)));if(s.comments=d.comments("Location data"),r.body.unshift(s),this.exports.size){this.exports.forEach(o=>{r.body.push(d.exprStmt(this.$call("export",...o)))});let a=d.memberExpr(d.identifier("Promise"),d.identifier("all"));r.body.push(d.exprStmt(d.awaitExpr(d.callExpr(a,[this.$path("$promises.exports")]))))}let n=this.serialize(r,{startingIndentLevel:this.params.startingIndentLevel});return{toString(){return n},identifier:this.currentScope.get$qIdentifier("$q").name,topLevelAwait:this.topLevelAwait,get originalSource(){return t.originalSource||""}}})}transformNodes(t,i={}){let r=t.length,[s,n,a]=t.reduce(([o,u,l],c)=>c.type==="ImportDeclaration"?[o.concat(c),u,l]:c.type==="FunctionDeclaration"?[o,u.concat(c),l]:[o,u,l.concat(c)],[[],[],[]]);return t=[...s,...n,...a],function o(u,l){if(l===r)return u;let[c,f]=this.transformNode(t[l],i,!0);if(u=u.concat(c||[]),l===s.length-1){let p=d.memberExpr(d.identifier("Promise"),d.identifier("all"));u=u.concat(d.exprStmt(d.awaitExpr(d.callExpr(p,[this.$path("$promises.imports")]))))}if(["ReturnStatement","BreakStatement","ContinueStatement"].includes(t[l].type))return u;if(f.flowControl?.size&&f.node.type==="IfStatement"){let p=t.slice(l+1);if(p.length){let m=new ne(p);return u.concat(this.transformNode(m))}}return o.call(this,u,l+1)}.call(this,[],0)}transformNode(t,i={},r=!1){if(typeof t!="object"||!t)return t;let s={static:this.currentEntry?.static,mode:this.currentEntry?.mode,...i,parentNode:this.currentEntry?.node,node:t,hoistedAwaitKeyword:!1,flowControl:new Map},n=this.pushHistory(s,()=>this[`transform${t.type}`]?this[`transform${t.type}`].call(this,t):Object.keys(t).reduce((a,o)=>{let u=Array.isArray(t[o])?this.transformNodes(t[o],i):this.transformNode(t[o],i);return{...a,[o]:u}},{}));return r?[n,s]:n}$serial(t){return this.currentScope.index(t,this.params.locations)}$path(t){return t.split(".").reduce((i,r)=>d.memberExpr(i,d.identifier(r)),this.currentScope.get$qIdentifier("$q"))}$trail(){return this.currentEntry.trail?[d.literal(this.currentEntry.trail)]:[]}$call(t,...i){return d.callExpr(this.$path(t),i)}$typed(t,i,r=null){let s=r?[d.literal(r)]:[];return this.$call("typed",d.literal(t),i,...s)}$obj(t){let i=Object.entries(t).map(([r,s])=>d.property(d.identifier(r),Array.isArray(s)?d.arrayExpr(s):s));return d.objectExpr(i)}$closure(...t){let i=t.pop(),r=t.pop()||[];return d.arrowFuncExpr(null,r,i,this.currentEntry.hoistedAwaitKeyword)}$var(t,i,r,s,...n){let a=s?this.$closure([this.currentScope.get$qIdentifier("$q")],s):d.identifier("undefined"),o=this.$call(t,d.literal(r),i,a,...n);return a.async&&(o=d.awaitExpr(o)),d.exprStmt(o)}$update(t,i,...r){let s=this.$closure(i);return this.$call("update",d.literal(t.name),s,...r)}$autorun(t,...i){let r=i.pop(),s=i.pop(),n=i.pop()||{},a=Object.keys(n).length?[this.$obj(n)]:[],o=this.$closure([this.currentScope.get$qIdentifier("$q")],r),u=this.$call("autorun",d.literal(t),...a,s,o);return o.async&&(u=d.awaitExpr(u)),d.exprStmt(u)}$iteration(t,i,r){let s=d.literal(t),n=this.currentEntry.parentNode.label?d.literal(this.currentEntry.parentNode.label.name):d.identifier("null"),a={kind:s,label:n},o=d.blockStmt(r);return this.$autorun("iteration",a,i,o)}hoistAwaitKeyword(){for(let t of this.history)if(t.hoistedAwaitKeyword=!0,t.node.type.includes("Function"))return;this.topLevelAwait=!0}hoistArgumentsKeyword(){let t=["FunctionDeclaration","FunctionExpression"];if(!this.history.some(i=>t.includes(i.node.type)))return this.topLevelArgsKeyword=!0,!0}hoistExitStatement(t,i={}){for(let r of this.history){let s=()=>r.node?.type==="SwitchStatement"&&t.value==="break"&&i.name==="null",n=()=>r.parentNode?.type==="LabeledStatement"&&this.loopTypes.includes(r.parentNode.body.type)&&i.value===r.parentNode.label.name,a=()=>this.loopTypes.includes(r.node.type)&&i.name==="null";if(s())return r.node;if(n()||a())return r.flowControl.set(t,{...i,endpoint:!0}),r.node;if(r.node.type.includes("Function"))return;r.flowControl.set(t,i)}}transformFunctionDeclaration(t){return this.transformFunction(d.funcDeclaration,...arguments)}transformFunctionExpression(t){return this.transformFunction(d.funcExpr,...arguments)}transformArrowFunctionExpression(t){return this.transformFunction(d.arrowFuncExpr,...arguments)}transformFunction(t,i){let r=this.$serial(i),{id:s,params:n,body:a}=i;[s,n,a]=this.pushScope(i,()=>{let g=[];s&&this.currentScope.push(s,"self");let y=n.map(b=>{if(b.type==="AssignmentPattern"&&i.isQuantumFunction){let _=this.currentScope.getRandomIdentifier("$rand",!1),A=this.transformSignal(_,"param"),N=d.varDeclarator(b.left,d.withLoc(d.logicalExpr("||",_,b.right),b));return g.push(...this.transformNode(d.varDeclaration("let",[d.withLoc(N,b)]),{static:!i.isQuantumFunction})),A}return this.transformSignal(b,"param")}),v=this.transformNode(a,{static:!i.isQuantumFunction});g.push(...v.type==="BlockStatement"?v.body:[d.returnStmt(v)]),g.length&&(g[0].comments=d.comments("Function body"));let x=d.exprStmt(d.assignmentExpr(this.$path("locations"),d.arrayExpr(this.currentScope.locations)));return x.comments=d.comments("Location data"),g.unshift(x),[s,y,d.blockStmt(g)]});let o=this.currentScope.get$qIdentifier("$q"),u=this.$closure([o],a),l=d.identifier(i.isQuantumFunction||!1),c=d.identifier(i.type==="FunctionDeclaration"),f=d.blockStmt([d.returnStmt(this.$call("runtime.spawn",l,d.thisExpr(),u))]),p=g=>this.$call("function",c,l,r,g),m=t.call(d,s,n,f,i.async,i.expresion,i.generator);if(i.type==="FunctionDeclaration"){if(this.currentScope.push(s,"static"),m=[m,d.exprStmt(p(s))],this.currentEntry.isExport){let g=[d.literal(s),r];this.currentEntry.isExport==="as-default"&&g.push(d.literal("default")),this.exports.add([d.arrayExpr(g)])}}else this.currentEntry.isMethod||(m=p(m));return m}transformClassDeclaration(t){return this.transformClass(d.classDeclaration,...arguments)}transformClassExpression(t){return this.transformClass(d.classExpression,...arguments)}transformClass(t,i){let{id:r,body:s,superClass:n}=i;n&&(n=this.transformNode(n));let a=new Set;s=this.pushScope(i,()=>(r&&this.currentScope.push(r,"self"),this.transformNode(s,{methods:a})));let o=d.identifier(i.type==="ClassDeclaration"),u=c=>{let f=d.arrayExpr([...a].map(p=>this.$obj(p)));return this.$call("class",o,c,f)},l=t.call(d,r,s,n);if(i.type==="ClassDeclaration"){if(this.currentScope.push(r,"static"),l=[l,d.exprStmt(u(r))],this.currentEntry.isExport){let c=[d.literal(r),this.$serial(i)];this.currentEntry.isExport==="as-default"&&c.push(d.literal("default")),this.exports.add([d.arrayExpr(c)])}}else l=u(l);return l}transformMethodDefinition(t){let{key:i,value:r}=t;t.computed&&(i=this.transformNode(i));let s=this.transformNode(r,{static:!0,isMethod:!0});return this.currentEntry.methods.add({name:t.computed?i:d.literal(i),static:d.identifier(t.static),isQuantumFunction:d.identifier(r.isQuantumFunction||!1),serial:this.$serial(t)}),d.methodDefinition(i,s,t.kind,t.static,t.computed)}transformPropertyDefinition(t){let{key:i,value:r}=t;return t.computed&&(i=this.transformNode(i)),r=this.transformNode(r),d.exprStmt(d.propertyDefinition(i,r,t.static,t.computed))}exports=new Set;transformExportDefaultDeclaration(t){return this.handleExports(...arguments)}transformExportNamedDeclaration(t){return this.handleExports(...arguments)}transformExportAllDeclaration(t){return this.handleExports(...arguments)}handleExports(t){if(t.type==="ExportAllDeclaration"){let r=[d.literal("*"),this.$serial(t.exported||t),d.literal(t.exported?.name||t.exported?.value||"")];this.exports.add([d.arrayExpr(r),this.$obj({source:t.source,serial:this.$serial(t)})]);return}let i=r=>r.map(s=>{let n=[d.literal(s.local.name),this.$serial(s)],a=s.exported.name||s.exported.value;return a!==s.local.name&&n.push(d.literal(a)),d.arrayExpr(n)});if(t.source){this.exports.add(i(t.specifiers).concat(this.$obj({source:t.source,serial:this.$serial(t)})));return}if(t.type==="ExportNamedDeclaration"&&t.specifiers.length){this.exports.add(i(t.specifiers));return}if(t.type==="ExportDefaultDeclaration"&&["Identifier","ThisExpression"].includes(t.declaration.type)){let r=[d.literal(t.declaration.name||"this"),this.$serial(t),d.literal("default")];this.exports.add([d.arrayExpr(r)]);return}return this.transformNode(t.declaration,{isExport:t.type==="ExportDefaultDeclaration"?"as-default":!0})}transformImportDeclaration(t){let i=t.specifiers.map(r=>{let{imported:s,local:n}=r;this.transformSignal(n,"import"),r.type==="ImportNamespaceSpecifier"?s=d.identifier("*"):r.type==="ImportDefaultSpecifier"&&(s=d.identifier("default"));let a=s.name||s.value||"",o=[d.literal(a),this.$serial(r)];return a!==r.local.name&&o.push(d.literal(r.local.name)),d.arrayExpr(o)});return d.exprStmt(this.$call("import",...i.concat(this.$obj({source:t.source,serial:this.$serial(t)}))))}transformImportExpression(t){return this.$call("import",this.$obj({source:t.source,isDynamic:d.identifier("true"),serial:this.$serial(t)}))}transformSignal(t,i,r=null){return t.type==="Identifier"?(this.currentScope.push(t,i,["let","param"].includes(i)),r?.add(t),t):this.transformNode(t,{mode:i,static:!0,signals:r})}transformThisExpression(t){return this.transformIdentifier(...arguments)}transformIdentifier(t){let i=this.currentScope.find(t);!i&&t.name&&this.currentScope.$qIdentifiersNoConflict(t.name);let r=[];return t.hint?r.push(this.$obj({[t.hint]:d.identifier(!0)})):this.currentEntry.mode,t.type==="ThisExpression"||["param","self"].includes(i?.type)||["arguments"].includes(t.name)?this.currentEntry.trail?this.$call("obj",t,...this.$trail(),...r):t:(this.history.forEach(s=>s.refs?.add(t)),this.$call("ref",d.literal(t),...this.$trail(),...r))}transformMemberExpression(t){let{object:i,property:r,computed:s,optional:n}=t;s&&(r=this.transformNode(r));let a=this.transformNode(i,{trail:(this.currentEntry.trail||0)+1});return i.typed&&(a=this.$typed(i.typed,a,d.literal(r))),d.memberExpr(a,r,s,n)}transformVariableDeclaration(t){let i=this.currentEntry.isExport;return t.declarations.reduce((s,n)=>["ObjectPattern","ArrayPattern"].includes(n.id.type)?s.concat(this.expandPattern(n.id,n.init)):s.concat(n),[]).reduce((s,n)=>{let a=this.$serial(n),o=this.transformNode(n.init);this.transformSignal(n.id,t.kind,this.currentEntry.signals);let u=[];n.restOf&&(o=this.$typed(n.init.typed,o),u.push(this.$obj({restOf:n.restOf,type:d.literal(n.init.typed==="iterable"?"array":"object")})));let l=s.concat(this.$var(t.kind,a,n.id,o,...u));if(i&&!(n.id instanceof Ct)){let c=[d.literal(n.id),a];this.exports.add([d.arrayExpr(c)])}return l},[])}transformAssignmentExpression(t){let r=!this.currentEntry.static&&this.history[1].node.type==="ExpressionStatement",{left:s,right:n}=t,a=(u,l)=>(l=this.transformNode(l),u=this.transformNode(u),d.assignmentExpr(u,l,t.operator));if(["MemberExpression","ChainExpression"].includes(s.type))return a(s,n);if(["ObjectPattern","ArrayPattern"].includes(s.type)){let u=n,l=this.expandPattern(s,n,r).reduce((c,f)=>{if(f.id.originalB&&(u=f.id),f.type==="AssignmentExpression")return c.concat(a(f.left,f.right));let p=this.transformNode(f.init);if(f.id instanceof Ct){let g=this.$serial(f);return c.concat(this.$var("let",g,f.id,p))}this.transformSignal(f.id,"update",this.currentEntry.signals);let m=[];return f.restOf&&(p=this.$typed(f.init.typed,p),m.push(this.$obj({restOf:f.restOf,type:d.literal(f.init.typed==="iterable"?"array":"object")}))),c.concat(this.$update(f.id,p,...m))},[]);return r?l:d.sequenceExpr(l.concat(u))}n=this.transformNode(n),this.transformSignal(s,"update",this.currentEntry.signals);let o=this.currentScope.getRandomIdentifier("$current",!1);return this.$call("update",d.literal(s),this.$closure([o],d.assignmentExpr(o,n,t.operator.replace("====",""))))}transformAssignmentPattern(t){let{left:i,right:r}=t;return r=this.transformNode(r),["MemberExpression","ChainExpression"].includes(i.type)?i=this.transformNode(i,{static:!0}):i=this.transformSignal(i,this.currentEntry.mode,this.currentEntry.signals),d.assignmentPattern(i,r)}expandPattern(t,i,r=!0){let s=[],n=this;if(!["Identifier","Literal"].includes(i.type)&&r){let a=d.withLoc(n.currentScope.getRandomIdentifier("$rand",!1),i);a.originalB=!0,i.typed=t.type==="ObjectPattern"?"desctructurable":"iterable",s.push(d.withLoc(d.varDeclarator(a,i),i)),i=a}return function a(o,u,l){u.typed=l?"desctructurable":"iterable";let c=[];for(let f=0;f<o.length;f++){let p=o[f],m=f,g=p;if(p===null){c.push(f);continue}if(p.type==="RestElement"){let b=d.withLoc(d.varDeclarator(p.argument,u),p);b.restOf=c.map(_=>d.literal(_)),s.push(b);continue}l?{key:m,value:g}=p:m=d.literal(m);let y,v;g.type==="AssignmentPattern"?(y=g.right,g.left.type==="Identifier"?v=g.left:g=g.left):g.type==="Identifier"&&(v=g);let x=d.memberExpr(u,m,l?p.computed:!0);if(y&&(x=d.logicalExpr("||",x,y)),v)s.push(d.withLoc(d.varDeclarator(v,x),p)),c.push(m);else if(g.type==="MemberExpression"||g.type==="ChainExpression"&&(g=g.expression))s.push(d.withLoc(d.assignmentExpr(g,x),p));else if(g.elements||g.properties){let b=(g.properties?g.properties:g.elements).length>1;if(r&&b){let _=n.currentScope.getRandomIdentifier("$rand",!1);s.push(d.withLoc(d.varDeclarator(_,x),p)),x=_}a(g.elements||g.properties,x,g.properties&&!0)}}}(t.elements||t.properties,i,t.properties&&!0),s}transformUpdateExpression(t){if(t.argument.type==="Identifier"){this.transformSignal(t.argument,"update",this.currentEntry.signals);let i=this.currentScope.getRandomIdentifier("$current",!1),r=d.binaryExpr(t.operator==="--"?"-":"+",i,d.literal(1),!0),s=(t.prefix?"pre":"post")+(t.operator==="--"?"dec":"inc");return this.$call("update",d.literal(t.argument.name),this.$closure([i],r),this.$obj({kind:d.literal(s)}))}return transform.call(d,t.operator,this.transformNode(t.argument),t.prefix)}transformUnaryExpression(t){return t.operator==="typeof"&&t.argument.type==="Identifier"&&(t.argument.hint="isTypeCheck"),d.unaryExpr(t.operator,this.transformNode(t.argument))}transformIfStatement(t){let i=this.$serial(t),{test:r,consequent:s,alternate:n}=t;r=this.transformNode(t.test),s=this.pushScope(t,()=>this.transformNodes([t.consequent])),s[0].type!=="BlockStatement"&&s.length>1?s=d.blockStmt(s):s=s[0],n&&(n=this.pushScope(t,()=>this.transformNodes([t.alternate])),n[0]&&n[0].type!=="BlockStatement"&&n.length>1?n=d.blockStmt(n):n=n[0],n.type==="BlockStatement"&&(n=this.$autorun("block",this.$serial(t.alternate),n)));let a=d.ifStmt(r,s,n);return this.currentEntry.static?a:this.$autorun("block",i,d.blockStmt([a]))}transformSwitchStatement(t){let i=this.$serial(t);return this.pushScope(t,()=>{let r=this.transformNode(t.discriminant),s=t.cases.map(a=>{let o=this.transformNode(a.test),u=this.transformNodes(a.consequent);return d.switchCase(o,u)}),n=d.switchStmt(r,s);return this.currentEntry.static?n:this.$autorun("block",$loc,d.blockStmt([n]))})}transformWhileStatement(t){return this.transformLoopStmtA(d.whileStmt,...arguments)}transformDoWhileStatement(t){return this.transformLoopStmtA(d.doWhileStmt,...arguments)}transformForStatement(t){return this.transformLoopStmtA(d.forStmt,...arguments)}transformLoopStmtA(t,i){let r=i.type==="WhileStatement"?"while":i.type==="DoWhileStatement"?"do-while":"for",s=this.$serial(i);return this.pushScope(i,()=>{let n=this.currentScope.get$qIdentifier("$q"),a,o={kind:d.literal(r),label:this.currentEntry.parentNode.label?d.literal(this.currentEntry.parentNode.label.name):d.identifier("null")};if(r==="for"){let l=d.blockStmt(this.transformNode(i.init));o.init=this.$closure([n],l);let c=this.transformNode(i.test);o.test=this.$closure([n],c);let f=this.transformNode(i.update);o.advance=this.$closure([n],f),a=p=>t.call(d,l,c,f,p)}else{let l=this.transformNode(i.test);o.test=this.$closure([n],l),a=c=>t.call(d,l,c)}let u=this.transformNode(i.body);return this.currentEntry.static?a(u):this.$autorun("iteration",o,s,u)})}transformForOfStatement(t){return this.transformLoopStmtB(d.forOfStmt,...arguments)}transformForInStatement(t){return this.transformLoopStmtB(d.forInStmt,...arguments)}transformLoopStmtB(t,i){let r=i.type==="ForInStatement"?"for-in":"for-of",s=this.$serial(i),n=this.transformNode(i.right);return this.pushScope(i,()=>{if(this.currentEntry.static){let[f,p]=this.transformNodes([i.left,i.body]);return t.call(d,f,n,p)}let a=this.currentScope.get$qIdentifier("$q"),o=this.currentScope.get$qIdentifier(r==="for-of"?"$val":"$key",!1),u={kind:d.literal(r),label:this.currentEntry.parentNode.label?d.literal(this.currentEntry.parentNode.label.name):d.identifier("null"),parameters:this.$closure([a],d.arrayExpr([d.literal(o),n]))},l;if(i.left.type==="VariableDeclaration"){let f=d.withLoc(d.varDeclarator(i.left.declarations[0].id,o),i.left);l=d.varDeclaration(i.left.kind,[f])}else l=d.withLoc(d.assignmentExpr(i.left,o),i.left);let c=d.blockStmt(this.transformNodes([l].concat(i.body.body)));return this.$autorun("iteration",u,s,c)})}transformBreakStatement(t){return this.transformExitStmt(d.breakStmt,...arguments)}transformContinueStatement(t){return this.transformExitStmt(d.continueStmt,...arguments)}transformExitStmt(t,i){let r=i.type==="BreakStatement"?"break":"continue",s=d.literal(r),n=i.label?d.literal(i.label.name):d.identifier("null");return this.hoistExitStatement(s,n)?.type==="SwitchStatement"?t.call(d):d.exprStmt(this.$call(r,n))}transformReturnStatement(t){let i=new Set,r=this.transformNode(t.argument,{refs:i});if(this.currentEntry.static)return d.returnStmt(r);let s=d.literal("return"),n=r?[s,r]:[s];this.hoistExitStatement(...n);let a=this.$call("return",...n.slice(1));if(!i.size)return d.exprStmt(a);let o=this.$serial(t);return this.$autorun("return",o,a)}transformBlockStatement(t){if(t instanceof ne){let r=this.$serial(t),s=this.transformNodes(t.body);return this.$autorun("downstream",r,d.blockStmt(s))}let i=this.pushScope(t,()=>this.transformNodes(t.body));return d.blockStmt(i)}transformLabeledStatement(t){this.currentScope.push(t.label,"const");let i=[].concat(this.transformNode(t.body));return[d.labeledStmt(t.label,i.shift()),...i]}transformExpressionStatement(t){let i=this.$serial(t);return[].concat(this.transformNode(t.expression)||[]).reduce((s,n)=>n.type==="VariableDeclaration"||n.type.endsWith("Statement")?s.concat(n):this.currentEntry.static?d.exprStmt(n):s.concat(this.$autorun("stmt",i,n)),[])}transformAwaitExpression(t){this.hoistAwaitKeyword();let i=this.transformNode(t.argument);return d.awaitExpr(i)}transformSequenceExpression(t){let i=t.expressions.reduce((r,s,n)=>r.concat(this.transformNode(s,{trail:n===t.expressions.length-1?this.currentEntry.trail:void 0})),[]);return this.history[1].node.type==="ExpressionStatement"?i:d.sequenceExpr(i)}transformConditionalExpression(t){let{test:i,consequent:r,alternate:s}=t;return i=this.transformNode(i),r=this.transformNode(r,{trail:this.currentEntry.trail}),s=this.transformNode(s,{trail:this.currentEntry.trail}),d.conditionalExpr(i,r,s)}transformLogicalExpression(t){let{left:i,right:r}=t;return i=this.transformNode(i,{trail:this.currentEntry.trail}),r=this.transformNode(r,{trail:this.currentEntry.trail}),d.logicalExpr(t.operator,i,r)}transformBinaryExpression(t){let{left:i,right:r}=t;i=this.transformNode(i),r=this.transformNode(r);let s=d.binaryExpr(t.operator,i,r);return this.currentEntry.trail?this.$call("obj",s,...this.$trail()):s}transformCallExpression(t){return this.transformCallExpr(d.callExpr,...arguments)}transformNewExpression(t){return this.transformCallExpr(d.newExpr,...arguments)}transformCallExpr(t,i){let r=this.transformNode(i.callee,{mode:"callee"}),s=i.arguments.map(a=>this.transformNode(a)),n=t.call(d,r,s,i.optional);return this.currentEntry.trail?this.$call("obj",n,...this.$trail()):n}transformObjectExpression(t){let i=d.objectExpr(t.properties.map(r=>this.transformNode(r)));return this.currentEntry.trail?this.$call("obj",i,...this.$trail()):i}transformProperty(t){let{key:i,value:r}=t;return t.computed&&(i=this.transformNode(i)),r=this.transformNode(r),d.property(i,r,t.kind,!1,t.computed,!1)}transformArrayExpression(t){let i=d.arrayExpr(t.elements.map(r=>this.transformNode(r)));return this.currentEntry.trail?this.$call("obj",i,...this.$trail()):i}transformTaggedTemplateExpression(t){let[i,r]=this.transformNodes([t.tag,t.quasi]),s=d.taggedTemplateExpr(i,r);return this.currentEntry.trail?this.$call("obj",s,...this.$trail()):s}transformTemplateLiteral(t){let i=t.expressions.map(s=>this.transformNode(s)),r=d.templateLiteral(t.quasis,i);return this.currentEntry.trail?this.$call("obj",r,...this.$trail()):r}};var ds=new Map;function ms(e,t={}){let i=`${e}${JSON.stringify(t)}`,r=ds.get(i);if(!r){try{r=ns.parse(e,t)}catch(s){let n=`${s.message||s}`,{pos:a,loc:{line:o,column:u}}=s,c=[{expr:e.slice(Math.max(0,a-15),a+15),line:o,column:u},{source:e}];throw t.inBrowser&&console.error(c),new(globalThis[s.name]||Error)(n,{cause:c})}r.originalSource=e,ds.set(i,r)}return r}function gs(e,t={}){return new Pe(t).transform(e)}function si(...e){let t,i={runtimeParams:Gn,compilerParams:zn,parserParams:Un};for(;t=e.shift();){let{runtimeParams:r={},compilerParams:{globalsNoObserve:s=[],globalsOnlyPathsExcept:n=[],...a}={},parserParams:o={}}=t;i={runtimeParams:{...i.runtimeParams,...r},compilerParams:{...i.compilerParams,globalsNoObserve:[...i.compilerParams.globalsNoObserve,...s],globalsOnlyPathsExcept:[...i.compilerParams.globalsOnlyPathsExcept,...n],...a},parserParams:{...i.parserParams,...o}},e.devMode}return i}var Un={ecmaVersion:"latest",allowReturnOutsideFunction:!0,allowAwaitOutsideFunction:!1,allowSuperOutsideMethod:!1,preserveParens:!1,locations:!0},zn={globalsNoObserve:["arguments","debugger"],globalsOnlyPathsExcept:[],originalSource:!0,locations:!0,compact:2},Gn={apiVersion:3};var Ie=Object.create(null);var Ft=class extends EventTarget{managedAlways=new Set;managedOnce=new Set;constructor(){super(),br.setMaxListeners?.(0,this)}fire(t){return this.dispatchEvent(new Event(t,{cancelable:!0}))}on(...t){return this.addEventListener(...t),()=>this.removeEventListener(...t)}abort(t=!1){this.managedAlways.forEach(i=>i.abort?i.abort(t):i(t)),this.managedOnce.forEach(i=>i.abort?i.abort(t):i(t)),this.managedOnce.clear(),this.fire("abort")}manage(t){this.managedAlways.add(t)}once(t){this.managedOnce.add(t)}};var jt=class extends Ft{subscribers=new Set;signals=new Map;constructor(t,i,r){super(),this.context=t,this.context?.once(()=>this.abort()),this.once(()=>this.watchMode(!1)),this.type=i,this.state=r}get name(){return[...this.context?.signals.keys()||[]].find(t=>this.context.signals.get(t)===this)}signal(t,i="prop"){let r=this.signals.get(t);return r||(r=new jt(this,i,i==="object"?t:Ii(this.state)?L.get(this.state,t):void 0),this.signals.set(t,r),this.signals.size===1&&this.watchMode(),r.once(()=>{this.signals.delete(t),this.signals.size||this.watchMode(!1)})),r}subscribe(t){this.subscribers.add(t),t.once(()=>{this.subscribers.delete(t),this.subscribers.size||this.abort()})}watchMode(t=!0){this.mutationsWatch?.abort(),!(!t||!this.signals.size||!Ii(this.state))&&(this.mutationsWatch=L.observe(this.state,i=>{let r={map:new Map,add(n,a){for(let o of n)o.spec.beforeSchedule?.(a)!==!1&&(this.map.has(o.runtime)||this.map.set(o.runtime,new Set),this.map.get(o.runtime).add(o))}};for(let n of i){let a=this.signals.get(n.key);!a||(r.add(a.subscribers,n),a.refresh(n.value))}let s=r.map.size?[...r.map].sort((n,a)=>n.$serial>a.$serial?-1:1):r.map;for(let[n,a]of s)n.state!=="aborted"&&n.schedule(...a)},{recursions:"force-sync"}))}refresh(t){this.state=t;for(let[i,r]of this.signals)r.refresh(L.get(this.state??{},i));this.watchMode()}};var Y=class extends jt{symbols=new Map;constructor(t,i,r=void 0){super(t,i,r||Object.create(null))}};var mt=class extends Ft{state;constructor(t,i,r,s,n,a){super(),t?.once(this),this.context=t,this.type=i,this.spec=r,this.scope=n,t?.scope!==n&&this.manage(n),this.serial=s,a&&(this.closure=a),t?.type==="iteration"?this.path=t.path.concat(this.spec.index):t?.type==="round"?this.path=t.path.concat(this.serial):this.path=(t?.path||[]).slice(0,-1).concat(this.serial),this.flowControl=new Map}get runtime(){return this.context.runtime}contains(t){return this===t.context||t.context&&this.contains(t.context)}order(t){if(!t)return this;let[i,r]=t.path.length<this.path.length?[t,this]:[this,t];return i.path.reduce((s,n,a)=>s&&n<=r.path[a],!0)&&i||r}beforeExecute(){this.state="running";let t=this.flowControl;return this.flowControl=new Map,t}execute(t=null){try{return this.runtime.thread.unshift(this),et(this.beforeExecute(),i=>Pi(this.closure,this,this,r=>(this.spec.complete&&(r=this.spec.complete(r,this)),this.afterExecute(i),this.runtime.thread.shift(),t?t(r,this):r)))}catch(i){if(i.cause)throw i;let r=`${i.message||i}`;this.runtime.throw(r,[this.serial,this.context?.serial],globalThis[i.name])}}afterExecute(t){this.state="complete";let i=this.flowControl;this.handleDownstream(i.size,t.size),this.handleRightstream(i.size,t.size);for(let r of["break","continue","return"])i.has(r)&&!i.get(r).endpoint?this.hoistFlowControl(r,i.get(r).arg):t.has(r)&&!t.get(r).endpoint&&this.hoistFlowControl(r,t.get(r).arg,!0)}typed(t,i,r=void 0){let s=Array.isArray(i)?"array":i===null?"null":typeof i;if(s===t||t==="iterable"&&i?.[Symbol.iterator]||t==="desctructurable"&&!["undefined","null"].includes(s))return i;throw t==="iterable"?new Error("value is not iterable."):t==="desctructurable"?new Error((r?`Cannot access ${r}; `:"")+"object not desctructurable."):new Error(`value must be of type ${t}.`)}let(t,i,r,s={}){return this.var(t,i,r,{...s,kind:"let"})}const(t,i,r,s={}){return this.var(t,i,r,{...s,kind:"const"})}var(t,i,r,s={}){s={kind:"var",...s},r||(r=()=>{});let n=s.restOf?(...o)=>{try{return r(...o)}catch(u){throw new Error(`Cannot declare ${t}; ${u.message}`)}}:r,a=(o,u)=>{let l=s.kind==="var"?this.runtime.scope:u.scope;for(;s.kind==="var"&&!["module","function"].includes(l.type)&&!L.has(l.state,t)&&l.context;)l=l.context;let c=l.symbols.get(t);if(c&&(c.kind!==s.kind||s.kind==="let"&&c.serial!==i))throw new Error(`Identifier "${t}" has already been declared.`);c?.reader?.abort(),c={serial:i,kind:s.kind};let f=o;return s.restOf&&(s.type==="array"?f=[]:f={},c.reader=L.map(o,f,{except:s.restOf,spread:s.type==="array"}),u.once(c.reader)),l.symbols.set(t,c),L.set(l.state,t,f),f};return this.autorun(s.kind,{complete:a,...s},i,n)}update(t,i,r={}){let s=this.scope;for(;s&&!L.has(s.state,t);)s=s.context;if(!s)throw new ReferenceError(`${t} is not defined.`);let n=s.symbols.get(t);if(n?.kind==="const")throw new ReferenceError(`Assignment to constant variable "${t}".`);let a=L.get(s.state,t),o=r.restOf?(...u)=>{try{return i(...u)}catch(l){throw new Error(`Cannot update ${t}; ${l.message}`)}}:i;return Pi(o,void 0,a,u=>{n?.reader?.abort();let l=u;return r.restOf&&(n=n||{},r.type==="array"?l=[]:l={},n.reader=L.map(u,l,{except:r.restOf,spread:r.type==="array"}),this.once(n.reader)),L.set(s.state,t,l),["postinc","postdec"].includes(r.kind)?a:l})}ref(t,...i){let r=0,s={};typeof i[0]=="number"?(r=i.shift(),s=i.shift()||{}):typeof i[0]=="object"&&(s=i.shift());let n=this.scope;for(;n&&!L.has(n.state,t);)n=n.context;if(!n){if(s.isTypeCheck)return;throw new Error(`${t} is not defined.`)}let a=n.symbols.get(t)?.kind,o=n.signal(t,a);return s.typed&&this.typed(s.typed,o.state,t),this.autobind(o,r,s)}obj(t,...i){let r=0,s={};return typeof i[0]=="number"?(r=i.shift(),s=i.shift()||{}):typeof i[0]=="object"&&(s=i.shift()),this.autobind(this.runtime.$objects.signal(t,"object"),r,s)}autobind(t,i,r){let s=this.runtime.$params.isQuantumFunction,n=t.type==="const",a=this===this.runtime,o=this.state==="aborted",u=this;return function l(c,f){if(s&&!n&&!a&&!o&&c.subscribe(u),!f||!c.state||typeof c.state!="object"){let m=c.state;return typeof c.state=="function"&&(m=L.proxy(c.state,{membrane:c})),m}let p;return L.proxy(c.state,{},m=>({...m,get(g,y,v=null){return p?m.get(g,y,v):(p=!0,l(c.signal(y),f-1))}}))}(t,i)}autorun(t,...i){let r=i.pop(),s=i.pop(),n=i.pop()||{},a=mt,o=this.scope;if(t==="iteration"){let l=this.runtime.constructor;a=r.constructor.name==="AsyncFunction"?l.AutoAsyncIterator:l.AutoIterator}["block","iteration"].includes(t)&&(o=new Y(o,t));let u=new a(this,t,n,s,o,r);if(!(t==="downstream"&&(this.downstream=u,this.flowControlApplied())))return u.execute()}function(t,i,r,s){t&&L.set(this.scope.state,s.name,s);let n=this;return Object.defineProperty(s,"toString",{value:function(a=!1){if(a&&i)return Function.prototype.toString.call(s);let o=n.runtime.extractSource(r);return o.startsWith("static ")?o.replace("static ",""):o}}),s}class(t,i,r){return t&&L.set(this.scope.state,i.name,i),r.forEach(({name:s,static:n,isQuantumFunction:a,serial:o})=>{this.function(!1,a,o,n?i[s]:i.prototype[s])}),i}async import(...t){return this.runtime.import(...t)}async export(...t){return this.runtime.export(...t)}continue(t){return this.applyFlowControl("continue",t)}break(t){return this.applyFlowControl("break",t)}return(t){return this.applyFlowControl("return",t)}applyFlowControl(t,i,r=!1){let s=this.flowControl.size;if(r?this.flowControl.delete(t):this.flowControl.set(t,{arg:i}),this.type==="round"&&(this.context.breakpoint=this),this.type==="round"&&["break","continue"].includes(t)&&i===this.context?.spec.label){r||(this.flowControl.get(t).endpoint=!0),this.state!=="running"&&this.handleRightstream(this.flowControl.size,s);return}this.state!=="running"&&(this.handleDownstream(this.flowControl.size,s),this.hoistFlowControl(...arguments))}hoistFlowControl(...t){return this.context?.applyFlowControl(...t)}flowControlApplied(t,i){return arguments.length?arguments.length===1?this.flowControl.has(t):this.flowControl.get(t)?.arg===i:this.flowControl.size||!1}handleDownstream(t,i){let r;this.type!=="block"||!(r=this.context?.downstream)||(t?r.abort():i&&(r.state="resuming",this.runtime.schedule(r)))}handleRightstream(t,i){if(this.type!=="round")return;let r=this,s=new Set;for(;r=r.nextRound;)t?r.abort():i&&r.state!=="inert"&&(r.state="resuming",s.add(r));s.size&&this.runtime.schedule(...s),!t&&i&&this.runtime.on("reflection",()=>{this.context.iterating||this.context.iterate()},{once:!0})}abort(t=!1){return t&&(this.context?.breakpoint===this&&delete this.context.breakpoint,this.flowControl.clear()),this.state=t?"inert":"aborted",super.abort(t)}};var Bt=class extends mt{rounds=new Map;constructor(t,i,r,s,n,a){r.$closure=a,super(t,i,r,s,n),this.manage(()=>{delete this.breakpoint,this.rounds.clear()})}pseudorun(t){return this.runtime.iThread.unshift(this),et(t(),i=>(this.runtime.iThread.pop(),i))}createIterator(){return this.spec.kind==="for-in"?function*(){for(let t in this.iteratee)yield t}.call(this):this.spec.kind==="for-of"?function*(){for(let t of this.iteratee)yield t}.call(this):{next:()=>({done:!this.pseudorun(()=>this.spec.test(this))})}}closure(){["for-of","for-in"].includes(this.spec.kind)?([this.production,this.iteratee]=this.spec.parameters(this),this.iterator=this.createIterator(),this.iterator.original=!0,this.watchMode()):(this.spec.kind==="for"&&this.spec.init(this),this.iterator=this.createIterator()),this.iterate()}terminated(){return this.breakpoint&&!this.breakpoint.flowControlApplied("continue",this.spec.label)&&this.breakpoint.flowControlApplied()}advance(){this.spec.kind==="for"&&this.pseudorun(()=>this.spec.advance(this))}iterate(){this.iterating=!0;let t=()=>!this.terminated()&&!(this.cursor=this.iterator.next()).done,i=()=>{this.createRound(this.cursor.value).execute(),this.advance()};if(this.spec.kind==="do-while")do i();while(t());else for(;t();)i();this.iterating=!1}createRound(t){let i=this.rounds.size,r={index:i},s=["for-in","for-of"].includes(this.spec.kind)?{[this.production]:t}:{...this.scope.state},n=new Y(this.scope,"round",s);this.scope.symbols.forEach((u,l)=>{n.symbols.set(l,u)});let a=new mt(this,"round",r,this.serial,n,this.spec.$closure),o=this.spec.kind==="for-in"?t:i;return this.rounds.set(o,a),this.lastRound&&(this.lastRound.nextRound=a,a.prevRound=this.lastRound),this.lastRound=a,a}watchMode(){let t=(i,r)=>{let s=new Set,n=new Set;for(let a of i){if(Array.isArray(this.iteratee)&&a.key==="length")continue;let o=this.spec.kind==="for-in"?a.key:a.value,u=this.spec.kind==="for-in"?a.key:parseInt(a.key),l=this.rounds.get(u);if(l)L.set(l.scope.state,this.production,o),a.type==="delete"&&(this.rounds.set(u,void 0),l.prevRound&&(l.prevRound.nextRound=l.nextRound),l.nextRound&&(l.nextRound.prevRound=l.prevRound),s.add(l));else if(a.type!=="delete"&&!a.isUpdate){if(this.spec.kind==="for-of"&&this.iterator.original&&!r.done)continue;n.add(o)}}this.runtime.on("reflection",()=>{s.forEach(a=>a.abort(!0))},{once:!0}),n.size&&(this.iterator=function*(a){yield*a,yield*n}(this.iterator),r.done&&this.iterate())};this.once(L.observe(this.iteratee,i=>{et(this.cursor,r=>t(i,r))}))}};var Oe=class extends Bt{async createIterator(){return this.spec.kind==="for-in"?function*(){for(let t in this.iteratee)yield t}.call(this):this.spec.kind==="for-of"?function*(){for(let t of this.iteratee)yield t}.call(this):{next:async()=>({done:!await this.pseudorun(()=>this.spec.test(this))})}}async closure(){["for-of","for-in"].includes(this.spec.kind)?([this.production,this.iteratee]=await this.spec.parameters(this),this.iterator=await this.createIterator(),this.iterator.original=!0,this.watchMode()):(this.spec.kind==="for"&&await this.spec.init(this),this.iterator=await this.createIterator()),await this.iterate()}async iterate(){let t;this.iterating=!0;let i=async()=>!this.terminated()&&(this.cursor=this.iterator.next())&&(t=await this.cursor)&&!t.done,r=async()=>{await this.createRound(t.value).execute(),await this.advance()};if(this.spec.kind==="do-while")do await r();while(await i());else for(;await i();)await r();this.iterating=!1}};var Ht=class{constructor(t){Object.defineProperty(this,"runtime",{value:t});let i={statechange:()=>{L.defineProperty(this,"value",{value:t.flowControl.get("return")?.arg,enumerable:!0,configurable:!0})}};for(let r in i)t.on(r,i[r]),i[r]();t.$params.sourceType==="module"&&Object.defineProperty(this,"exports",{value:t.exports})}dispose(){return this.runtime.abort(!0)}};var Wt=class extends mt{locations=[];queue=new Set;thread=[];iThread=[];constructor(t,i,r,s,n){super(t,i,{},-1,s,n);let{$serial:a=0,...o}=r;this.$serial=a,this.$params=o,this.$objects=new Y(void 0,"objects"),this.manage(this.$objects),this.exports=Object.create(null),this.$promises={imports:[],exports:[]},this.manage(()=>{L.deleteProperties(this.exports,Object.keys(this.exports)),this.$promises.imports.splice(0),this.$promises.exports.splice(0)})}extractSource(t,i=!1){let[[r,s,n],[a]]=this.locations[t],o=this.$params.originalSource.slice(r,a);return i?{expr:o,line:s,column:n}:o}throw(t,i,r=null,s=null){let n,a=s!==null?`[${s}]: ${t}`:t,o=i.map(l=>l!==-1&&this.extractSource(l,!0)).filter(l=>l);o.push({source:this.$params.originalSource}),n=new(r||Error)(a,{cause:o});let u=this.$params.sourceType==="module"&&this.$params.experimentalFeatures!==!1&&this.$params.exportNamespace||this.$params.fileName;throw u&&(n.fileName=u),s&&(n.code=s),this.$params.inBrowser&&console.error(o),n}get runtime(){return this}get nowRunning(){return this.thread[0]}schedule(...t){let i=this.queue.size;for(let r of t)this.queue.add(r);if(!i)return this.flowControlDirty=!1,function r(s,n){let a;for(let o of this.queue){if(n&&n.order(o)!==n||["aborted","running"].includes(o.state)||this.iThread[0]?.contains(o)){this.queue.delete(o);continue}a=a?a.order(o):o,n||(n=a)}return a?(a.abort(),a.execute(o=>(this.queue.delete(a),r.call(this,o,a)))):(this.fire("reflection"),this.flowControlApplied()&&this.fire("statechange"),s)}.call(this,void 0,this.nowRunning)}execute(t=null){return super.execute(i=>{let r=this.$params.isQuantumFunction?new Ht(this):i;return t?t(r,this):r})}spawn(t,i,r){let s=this.nowRunning||this,n={...this.$params,$serial:this.$serial+1,isQuantumFunction:t},a=new Y(s.scope,"function",{this:i});return new this.constructor(s,"function",n,a,r).execute()}async import(...t){let i=t.pop(),r=typeof i=="string"?{source:i}:i,s=a=>{if(r.forExport||r.isDynamic)return a;this.assignModules(t,this.scope.state,a,i.serial)};if(this.$params.experimentalFeatures!==!1&&Ie[r.source])return s(Ie[r.source]);let n=(async()=>{let a=this.$params.sourceType==="module"&&this.$params.experimentalFeatures!==!1&&this.$params.exportNamespace||this.$params.fileName;try{return s(await import(r.source))}catch(o){throw o.code==="ERR_MODULE_NOT_FOUND"&&this.throw(`Cannot find package "${r.source}"${a?` imported at "${a}"`:""}.`,[r.serial],null,o.code),o}})();return r.isDynamic||this.$promises[r.forExport?"exports":"imports"].push(n),n}async export(...t){let i=Array.isArray(t[t.length-1])?null:t.pop(),r=i?await this.import({...i,forExport:!0}):this.scope.state;this.assignModules(t,this.exports,r,i?.serial)}assignModules(t,i,r,s=null){let n=[];for(let[a,o,u]of t){if(a==="*"&&u){L.set(i,u,r);continue}L.has(r,a)||this.throw(`The requested module does not provide an export named "${a}".`,[o,s]),L.set(i,u||a,L.get(r,a)),n.push([a,o,u])}!n.length||this.once(L.observe(r,a=>{for(let[o,,u]of n)for(let l of a)o==="*"?L.set(i,l.key,l.value):l.key===o&&L.set(i,u||o,l.value)}))}afterExecute(...t){return this.$params.sourceType==="module"&&this.$params.experimentalFeatures!==!1&&this.$params.exportNamespace&&(Ie[this.$params.exportNamespace]=this.exports,this.once(()=>{delete Ie[this.$params.exportNamespace]})),super.afterExecute(...t)}};G(Wt,"AutoAsyncIterator",Oe),G(Wt,"AutoIterator",Bt);function Te(e,t,i,r){let{env:s,functionParams:n=[],exportNamespace:a,fileName:o}=r,{parserParams:u,compilerParams:l,runtimeParams:c}=si(r),f=Object.getOwnPropertyDescriptor(globalThis,"window")?.get?.toString().includes("[native code]")??!1,p=["async-script","module"].includes(e);if(e==="module")u.sourceType=e,u.allowAwaitOutsideFunction=!0;else if(["function","async-function"].includes(e)){let g=" "+i.split(`
|
|
12
12
|
`).join(`
|
|
13
13
|
`);i=`return ${e==="async-function"?"async ":""}function**(${n.join(", ")}) {
|
|
14
|
-
${
|
|
15
|
-
}`,u.startStatic=!0}else if(!["script","async-script"].includes(e))throw new Error(`Unrecognized sourceType specified: "${e}".`);u.sourceType=e,l.inBrowser=f;let d=t(i,{parserParams:l,compilerParams:u,base64:p&&f&&"export default async function(%0) {%1}"});if(d instanceof Promise&&!["async-function","async-script","module"].includes(e))throw new Error("Parse-compile can only return a Promise for sourceTypes: async-function, async-script, module.");return c.sourceType=e,c.inBrowser=f,c.exportNamespace=a,c.fileName=o,K(d,y=>{let x=["function","async-function"].includes(e);return K(((g,b)=>{if(c.compileFunction)return c.compileFunction(b.toString(),[g]);if(p&&c.inBrowser){let v=()=>import(`data:text/javascript;base64,${b.toString("base64")}`).then(N=>N.default);return window.webqit?.realdom?.schedule?window.webqit?.realdom?.schedule("write",v,!0):v()}return new(p?async function(){}.constructor:Function)(g,b.toString())})(y.identifier+"",y),g=>{let b=(v,N=s)=>{let T=g;v&&(T=T.bind(v));let G="global",B=new z(void 0,G,globalThis);return(e.endsWith("script")||N)&&(G="env",B=new z(B,G,N)),e==="module"&&(G="module",B=new z(B,G)),typeof v<"u"&&(B=new z(B,"this",{this:v})),new Dt(void 0,G,{...c,originalSource:y.originalSource,isQuantumFunction:!x},B,T)};return x?b().execute():{createRuntime:b,compiledSource:y}})})}var Ft=class{constructor(...t){let i=this.constructor,r=typeof t[t.length-1]=="object"?t.pop():{},s=t.pop()||"";this.$program=_e(i.sourceType,i.parseCompileCallback,s,r)}execute(){return K(this.$program,({createRuntime:t})=>t().execute())}bind(t,i=void 0){return K(this.$program,({createRuntime:r})=>r(t,i))}toString(t=!1){return K(this.$program,({compiledSource:i})=>t?i+"":i.originalSource)}};function Mn(...e){let{source:t,params:i}=vi(e);return _e("function",ke,t,i)}function Vn(...e){let{source:t,params:i}=vi(e);return _e("async-function",ke,t,i)}var Ee=class extends Ft{};j(Ee,"sourceType","script"),j(Ee,"parseCompileCallback",ke);var Se=class extends Ft{};j(Se,"sourceType","async-script"),j(Se,"parseCompileCallback",ke);var Ce=class extends Ft{};j(Ce,"sourceType","module"),j(Ce,"parseCompileCallback",ke);function ke(e,t){let i=os(e,t.parserParams);return us(i,t.compilerParams)}function Ae(e,t,i={},r={}){t=D(t).slice();for(var s=e;!pt(s)&&!ie(s)&&t.length;){var n=t.shift();if(!(i.get?i.get(s,n):R(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 Fi(e,t,i,r={},s={}){let n=(c,f,p)=>s.set?s.set(c,f,p):(Y(t[o])&&P(c)?c.push(p):c[f]=p,!0);t=D(t);for(var a=e,o=0;o<t.length;o++)if(o<t.length-1){if(!a||!R(a)&&!L(a))return!1;var l=Ae(a,t[o],s);if(!R(l)){if(s.buildTree===!1)return!1;l=L(s.buildTree)?s.buildTree(o):Y(t[o+1])?[]:{};var u=n(a,t[o],l);if(!u)return!1}a=l}else return n(a,t[o],i)}var Pe=class{constructor(t,i=!1){Object.defineProperty(this,"window",{value:t}),Object.defineProperty(this,"readCallbacks",{value:new Set}),Object.defineProperty(this,"writeCallbacks",{value:new Set}),Object.defineProperty(this,"_synthesis",{value:0,writable:!0}),!i&&this.window.requestAnimationFrame?this._loop():this._synthesis++}get synthesis(){return this._synthesis}async synthesizeWhile(t){this._synthesis++,this._fulfill();let i=await t();return this._synthesis--,i}_fulfill(){for(let t of this.readCallbacks)t(),this.readCallbacks.delete(t);for(let t of this.writeCallbacks)t(),this.writeCallbacks.delete(t)}_loop(){this.window.requestAnimationFrame(()=>{this._fulfill(),this._loop()})}onread(t,i=!1){if(i)return new Promise(r=>{this.synthesis?r(t()):this.readCallbacks.add(()=>{r(t())})});this.synthesis?Promise.resolve().then(t):this.readCallbacks.add(t)}onwrite(t,i=!1){if(i)return new Promise(r=>{this.synthesis?r(t()):this.writeCallbacks.add(()=>{r(t())})});this.synthesis?Promise.resolve().then(t):this.writeCallbacks.add(t)}cycle(t,i,r){this.onread(()=>{let s=t(r),n=a=>{a!==void 0&&this.onwrite(()=>{let o=i(a,r),l=u=>{u!==void 0&&this.cycle(t,i,u)};o instanceof Promise?o.then(l):l(o)})};s instanceof Promise?s.then(n):n(s)})}};function ls(e){return(e=e.trim())&&e.startsWith("(")&&e.endsWith(")")}function Ze(e,t,i,r=!0){i=(Array.isArray(i)?i:[i]).map(a=>(a+"").replace("(",r?"(.//":"(./")).join("|");let s=[],n;try{let a=e.document.evaluate(i,t,null,XPathResult.ANY_TYPE);for(;n=a.iterateNext();)s.push(n)}catch{}return s}function cs(e,t,i){i=(Array.isArray(i)?i:[i]).map(r=>(r+"").replace("(","(self::")).join("|");try{return e.document.evaluate(`${i}`,t,null,XPathResult.BOOLEAN_TYPE).booleanValue}catch{}}function hs(e,t="|"){return[...e].reduce(([i,r,s,n],a)=>!i&&r===0&&(Array.isArray(t)?t:[t]).includes(a)?[i,r,[""].concat(s)]:(!i&&["(","[","{"].includes(a)&&!s[0].endsWith("\\")&&r++,!i&&[")","]","}"].includes(a)&&!s[0].endsWith("\\")&&r--,['"',"'","`"].includes(a)&&!s[0].endsWith("\\")&&(i=i===a?null:i||a),s[0]+=a,[i,r,s]),[null,0,[""]])[2].reverse()}var it=class{constructor(t){this.content=t,this.type=typeof t=="string"?"selector":"instance",this.kind=this.type==="instance"?null:ls(t)?"xpath":"css",this.kind==="xpath"&&(this.isXpathAttr=hs(t.trim().slice(1,-1),"@").length>1)}toString(){return this.content}};var qt=class{constructor(t,i,r){this.context=t,this.namespace=i,this.window=t.defaultView||t.ownerDocument?.defaultView||r,this.document=this.window.document,this.webqit=this.window.webqit,Object.defineProperty(this,"#",{value:{}})}resolveArgs(t){if(L(t[0])?t=[[],...t]:$(t[0])&&!(t[0]instanceof it)&&t.length===1?t=[[],void 0,t[0]]:$(t[1])&&t.length===2?t=[D(t[0],!1),void 0,t[1]]:t[0]=D(t[0],!1),t[0].filter(i=>typeof i!="string"&&!(i instanceof it)&&!(i instanceof this.window.Node)).length)throw new Error("Argument #2 must be either a string or a Node object, or a list of those.");return t[0]=t[0].map(i=>i instanceof it?i:new it(i)),t}registry(...t){return Ct("realdom.realtime",this.window,this.namespace,...t)}createSignalGenerator(){return{generate(){return this.lastController?.abort(),this.lastController=new AbortController,{signal:this.lastController.signal}},disconnect(){this.lastController?.abort()}}}forEachMatchingContext(t,i,r){let{window:s}=this,n=Array.isArray(i)?i:[i],a=new Set;for(let[o,l]of this.registry(t))for(let[u,c]of l){let f=n.filter(p=>u.contains(p.target)?o==="subtree"||p.target===u:!1);if(!!f.length){Array.isArray(i)||(f=f[0]);for(let p of c)a.add([p,f,u])}}for(let[o,l,u]of a)r.call(s,o,l,u)}disconnectables(t,...i){let r={disconnect(){i.forEach(s=>s&&L(s.disconnect)&&s.disconnect()||L(s)&&s()||$(s)&&(s.disconnected=!0))}};return t&&t.addEventListener("abort",()=>r.disconnect()),r}};var It=class extends qt{constructor(t,...i){super(t,"attr",...i)}get(t,i=void 0,r={}){let s=typeof t=="string"||t instanceof it;[t=[],i=void 0,r={}]=this.resolveArgs(arguments);let{context:n}=this,a=ys(n,t);if(!i)return a;let o=r.lifecycleSignals&&this.createSignalGenerator();if(s)for(let l of a){let u=o?.generate()||{};i(l,u,n)}else{let l=o?.generate()||{};i(a,l,n)}if(r.live){o&&(r={...r,signalGenerator:o});let l=this.observe(s?t[0]:t,i,{newValue:!0,...r});return this.disconnectables(r.signal,l)}}observe(t,i,r={}){let s=typeof t=="string"||t instanceof it;if([t=[],i,r={}]=this.resolveArgs(arguments),["sync","intercept"].includes(r.timing))return this.observeSync(s?t[0]:t,i,r);if(r.timing&&r.timing!=="async")throw new Error(`Timing option "${r.timing}" invalid.`);let{context:n,window:a,webqit:o}=this;r.eventDetails&&!o.realdom.attrInterceptionHooks?.intercepting&&ms.call(a,"intercept",()=>{});let l=new a.MutationObserver(p=>{p=ds(p).map(d=>xs.call(a,d)),ps.call(a,f,p,n)}),u={attributes:!0,attributeOldValue:r.oldValue,subtree:r.subtree};t.length&&(u.attributeFilter=t.map(p=>p+"")),l.observe(n,u);let c=r.signalGenerator||r.lifecycleSignals&&this.createSignalGenerator(),f={context:n,spec:t,callback:i,params:r,atomics:new Map,originalFilterIsString:s,signalGenerator:c,disconnectable:l};return this.disconnectables(r.signal,l,c)}observeSync(t,i,r={}){let s=typeof t=="string"||t instanceof it;[t,i,r={}]=this.resolveArgs(arguments);let{context:n,window:a}=this;if(r.timing&&!["sync","intercept"].includes(r.timing))throw new Error(`Timing option "${r.timing}" invalid.`);let o=r.timing==="intercept"?"intercept":"sync",l=r.subtree?"subtree":"children";this.registry(o).size||ms.call(a,o,y=>{this.forEachMatchingContext(o,y,ps)});let u={disconnect(){d.delete(f),d.size||p.delete(n)}},c=r.signalGenerator||r.lifecycleSignals&&this.createSignalGenerator(),f={context:n,spec:t,callback:i,params:r,atomics:new Map,originalFilterIsString:s,signalGenerator:c,disconnectable:u},p=this.registry(o,l);p.has(n)||p.set(n,new Set);let d=p.get(n);return d.add(f),this.disconnectables(r.signal,u,c)}};function ds(e){return e.reduce((t,i,r)=>t[r-1]?.attributeName===i.attributeName?t:t.concat(i),[])}function ps(e,t){let{context:i,spec:r,callback:s,params:n,atomics:a,originalFilterIsString:o,signalGenerator:l}=e,u=r.map(p=>p+"");if(n.atomic&&!a.size?t=ys(i,r,t):n.timing!=="async"&&r.length&&(t=t.filter(p=>u.includes(p.name))),!t.length)return;n.newValue===null&&n.oldValue===null&&n.eventDetails||(t=t.map(p=>{let d;return n.eventDetails||({event:d,...p}=p),!n.oldValue&&"oldValue"in p&&({oldValue:d,...p}=p),!n.newValue&&"value"in p?{value:d,...p}=p:n.newValue&&typeof p.value>"u"&&(p={...p,value:p.target.getAttribute(p.name)}),p})),n.atomic&&(t.forEach(p=>a.set(p.name,p)),t=Array.from(a.entries()).map(([,p])=>p));let c=o?t[0]:t,f=l?.generate()||{};s(c,f,i)}function ys(e,t,i=[]){let r={event:null,type:"attribute"};return t.length?t.map(n=>(n=n+"",i.find(a=>a.name===n)||{target:e,name:n,value:e.getAttribute(n),...r})):Array.from(e.attributes).map(n=>i.find(a=>a.name===n.nodeName)||{target:e,name:n.nodeName,value:n.nodeValue,...r})}function xs({target:e,attributeName:t,value:i,oldValue:r}){let a=(this.webqit.realdom.attrInterceptionRecords?.get(e)||{})[t]?.[0]||"mutation";return{target:e,name:t,value:i,oldValue:r,type:"observation",event:a}}function ms(e,t){let i=this,{webqit:r,document:s,Element:n}=i;r.realdom.attrInterceptionHooks||Object.defineProperty(r.realdom,"attrInterceptionHooks",{value:new Map}),r.realdom.attrInterceptionHooks.has(e)||r.realdom.attrInterceptionHooks.set(e,new Set),r.realdom.attrInterceptionHooks.get(e).add(t);let a=()=>r.realdom.attrInterceptionHooks.get(e).delete(t);if(r.realdom.attrInterceptionHooks?.intercepting)return a;console.warn("Attr mutation APIs are now being intercepted."),r.realdom.attrInterceptionHooks.intercepting=!0,Object.defineProperty(r.realdom,"attrInterceptionRecords",{value:new Map});let o=(c,f)=>{r.realdom.attrInterceptionRecords.has(c.target)||r.realdom.attrInterceptionRecords.set(c.target,{});let p=r.realdom.attrInterceptionRecords.get(c.target);p[c.name]=p[c.name]||[],p[c.name].unshift(c.event),r.realdom.attrInterceptionHooks.get("intercept")?.forEach(y=>y([c]));let d=f();return r.realdom.attrInterceptionHooks.get("sync")?.forEach(y=>y([c])),d};new i.MutationObserver(c=>{c=c.filter(f=>!(i.webqit.realdom.attrInterceptionRecords?.get(f.target)||{})[f.attributeName]?.shift()),c=ds(c).map(f=>xs.call(i,f)),c.length&&(r.realdom.attrInterceptionHooks.get("intercept")?.forEach(f=>f(c)),r.realdom.attrInterceptionHooks.get("sync")?.forEach(f=>f(c)))}).observe(s,{attributes:!0,subtree:!0,attributeOldValue:!0});let u=Object.create(null);return["setAttribute","removeAttribute","toggleAttribute"].forEach(c=>{u[c]=n.prototype[c],n.prototype[c]=function(...f){let p,d=this.getAttribute(f[0]);["setAttribute","toggleAttribute"].includes(c)&&(p=f[1]),c==="toggleAttribute"&&p===void 0&&(p=d===null);let y={target:this,name:f[0],value:p,oldValue:d,type:"interception",event:[this,c]};return o(y,()=>u[c].call(this,...f))}}),a}var Ie=class extends qt{constructor(t,...i){super(t,"tree",...i)}attr(t,i=void 0,r={}){let{context:s,window:n}=this;return new It(s,n).get(...arguments)}query(t,i=void 0,r={}){[t,i=void 0,r={}]=this.resolveArgs(arguments);let{context:s}=this,n=new Map,a=u=>(n.has(u)||n.set(u,{target:u,entrants:[],exits:[],type:"query",event:null}),n.get(u));if(!r.generation||r.generation==="entrants"){if(!t.length)[...s.children].forEach(u=>a(s).entrants.push(u));else if(t.every(u=>u.type==="selector")){let[u,c]=t.reduce(([p,d],y)=>y.kind==="xpath"?[p,d.concat(y)]:[p.concat(y),d],[[],[]]),f=[];r.subtree?(u.length&&f.push(...s.querySelectorAll(u.join(","))),c.length&&f.push(...Ze(this.window,s,c))):(u.length&&f.push(...[...s.children].filter(p=>p.matches(u))),c.length&&f.push(...Ze(this.window,s,c,!1))),f.forEach(p=>a(p.parentNode||s).entrants.push(p))}}if(!i)return n;let o={disconnected:!1},l=i&&r.lifecycleSignals&&this.createSignalGenerator();for(let[,u]of n){if(o.disconnected)break;let c=l?.generate()||{};i(u,c,s)}if(r.live){l&&(r={...r,signalGenerator:l});let u=this.observe(t,i,r);return this.disconnectables(r.signal,o,u)}return this.disconnectables(r.signal,o,l)}children(t,i=void 0,r={}){return[t,i=void 0,r={}]=this.resolveArgs(arguments),this.query(t,i,{...r,subtree:!1})}subtree(t,i=void 0,r={}){return[t,i=void 0,r={}]=this.resolveArgs(arguments),this.query(t,i,{...r,subtree:!0})}observe(t,i,r={}){if([t,i,r={}]=this.resolveArgs(arguments),["sync","intercept"].includes(r.timing))return this.observeSync(t,i,r);if(r.timing&&r.timing!=="async")throw new Error(`Timing option "${r.timing}" invalid.`);let{context:s,window:n,webqit:a,document:o}=this;r.eventDetails&&(a.realdom.domInterceptionRecordsAlwaysOn=!0),(o.readyState==="loading"||a.realdom.domInterceptionRecordsAlwaysOn)&&!a.realdom.domInterceptionHooks?.intercepting&&ws.call(n,"sync",()=>{});let l=new n.MutationObserver(f=>f.forEach(p=>{qi.call(n,c,bs.call(n,p),s)}));l.observe(s,{childList:!0,subtree:r.subtree});let u=r.signalGenerator||r.lifecycleSignals&&this.createSignalGenerator(),c={context:s,spec:t,callback:i,params:r,signalGenerator:u,disconnectable:l};if(r.staticSensitivity){let f=gs.call(n,c);return this.disconnectables(r.signal,l,u,f)}return this.disconnectables(r.signal,l,u)}observeSync(t,i,r={}){[t,i,r={}]=this.resolveArgs(arguments);let{context:s,window:n}=this;if(r.timing&&!["sync","intercept"].includes(r.timing))throw new Error(`Timing option "${r.timing}" invalid.`);let a=r.timing==="intercept"?"intercept":"sync",o=r.subtree?"subtree":"children";this.registry(a).size||ws.call(n,a,y=>{this.forEachMatchingContext(a,y,qi)});let l=new n.MutationObserver(y=>y.forEach(x=>{Array.isArray((x=bs.call(n,x)).event)||qi.call(n,f,x,s)}));l.observe(s,{childList:!0,subtree:r.subtree});let u={disconnect(){l.disconnect(),d.delete(f),d.size||p.delete(s)}},c=r.signalGenerator||r.lifecycleSignals&&this.createSignalGenerator(),f={context:s,spec:t,callback:i,params:r,signalGenerator:c,disconnectable:u},p=this.registry(a,o);p.has(s)||p.set(s,new Set);let d=p.get(s);if(d.add(f),r.staticSensitivity){let y=gs.call(n,f);return this.disconnectables(r.signal,u,c,y)}return this.disconnectables(r.signal,u,c)}};function gs(e){let t=this,{context:i,spec:r,callback:s,params:n,signalGenerator:a}=e,o=r.filter(d=>d.kind==="css"),l=d=>d.match(/\.([\w-]+)/g)?.length?["class"]:[],u=d=>d.match(/#([\w-]+)/g)?.length?["id"]:[],c=d=>[...d.matchAll(/\[([^\=\]]+)(\=[^\]]+)?\]/g)].map(y=>y[1]).concat(l(d)).concat(u(d));if(!(e.$attrs=Array.from(new Set(o.filter(d=>(d+"").includes("[")).reduce((d,y)=>d.concat(c(y+"")),[])))).length)return;let f=new Set,p=new Set;return f.push=d=>(p.delete(d),f.add(d)),p.push=d=>(f.delete(d),p.add(d)),e.$deliveryCache={entrants:f,exits:p},new It(i,t).observe(e.$attrs,d=>{let y=new Map,x=b=>(y.has(b)||y.set(b,{target:b,entrants:[],exits:[],type:"static",event:null}),y.get(b)),w=new WeakMap,g=b=>(w.has(b)||w.set(b,o.some(v=>b.matches(v+""))),w.get(b));for(let b of d)["entrants","exits"].forEach(v=>{n.generation&&v!==n.generation||e.$deliveryCache[v].has(b.target)||(v==="entrants"?!g(b.target):g(b.target))||(e.$deliveryCache[v].push(b.target),x(b.target)[v].push(b.target),x(b.target).event=b.event)});for(let[,b]of y){let v=a?.generate()||{};s(b,v,i)}},{subtree:n.subtree,timing:n.timing,eventDetails:n.eventDetails})}function qi(e,t){let{context:i,spec:r,callback:s,params:n,signalGenerator:a,$deliveryCache:o}=e,l={...t,entrants:[],exits:[]};if(n.eventDetails||delete l.event,["entrants","exits"].forEach(c=>{if(!(n.generation&&c!==n.generation)&&(r.length?l[c]=jn.call(this,r,t[c],t.event!=="parse"):l[c]=[...t[c]],!!o))for(let f of l[c])o[c].push(f)}),!l.entrants.length&&!l.exits.length)return;let u=a?.generate()||{};s(l,u,i)}function jn(e,t,i){t=Array.isArray(t)?t:[...t];let r=(s,n)=>{if(n.type==="selector"){let a=n.isXpathAttr?[]:s.filter(o=>n.kind==="xpath"?cs(this,o,n+""):o.matches&&o.matches(n+""));if((i||n.isXpathAttr)&&(a=s.reduce((o,l)=>n.kind==="xpath"?[...o,...Ze(this,l,n,i)]:l.querySelectorAll?[...o,...l.querySelectorAll(n+"")]:o,a)),a.length)return a}else if(s.includes(n.content)||i&&s.some(a=>a.contains(n.content)))return[n.content]};return t.$$searchCache||(t.$$searchCache=new Map),e.reduce((s,n)=>{let a;return t.$$searchCache.has(n.content)?a=t.$$searchCache.get(n.content):(a=r(t,n)||[],n.type==="instance"&&t.$$searchCache.set(n.content,a)),s.concat(a)},[])}function bs({target:e,addedNodes:t,removedNodes:i}){let r=this,s;return s=D(t).reduce((n,a)=>n||r.webqit.realdom.domInterceptionRecords?.get(a),null),s=D(i).reduce((n,a)=>n||r.webqit.realdom.domInterceptionRecords?.get(a),s),s=s||r.document.readyState==="loading"&&"parse"||"mutation",{target:e,entrants:t,exits:i,type:"observation",event:s}}function ws(e,t){let i=this,{webqit:r,document:s,Node:n,CharacterData:a,Element:o,HTMLElement:l,HTMLTemplateElement:u,DocumentFragment:c}=i;r.realdom.domInterceptionHooks||Object.defineProperty(r.realdom,"domInterceptionHooks",{value:new Map}),r.realdom.domInterceptionHooks.has(e)||r.realdom.domInterceptionHooks.set(e,new Set),r.realdom.domInterceptionHooks.get(e).add(t);let f=()=>r.realdom.domInterceptionHooks.get(e).delete(t);if(r.realdom.domInterceptionHooks?.intercepting)return f;console.warn("DOM mutation APIs are now being intercepted."),r.realdom.domInterceptionHooks.intercepting=!0,Object.defineProperty(r.realdom,"domInterceptionRecords",{value:new Map});let p=(x,w)=>{x.entrants.concat(x.exits).forEach(b=>{clearTimeout(r.realdom.domInterceptionRecords.get(b)?.timeout),r.realdom.domInterceptionRecords.set(b,x.event);let v=setTimeout(()=>{r.realdom.domInterceptionRecords.delete(b)},0);Object.defineProperty(x.event,"timeout",{value:v,configurable:!0})}),r.realdom.domInterceptionHooks.get("intercept")?.forEach(b=>b(x));let g=w();return r.realdom.domInterceptionHooks.get("sync")?.forEach(b=>b(x)),g},d={characterData:Object.create(null),other:Object.create(null)};["insertBefore","insertAdjacentElement","insertAdjacentHTML","setHTML","replaceChildren","replaceWith","remove","replaceChild","removeChild","before","after","append","prepend","appendChild"].forEach(x=>{function w(...g){let b=this instanceof a?d.characterData:d.other,v=()=>b[x].call(this,...g);if(!(this instanceof a||this instanceof o||this instanceof c))return v();let N=[],T=[],G=this;["insertBefore"].includes(x)?T=[g[0]]:["insertAdjacentElement","insertAdjacentHTML"].includes(x)?(T=[g[1]],["beforebegin","afterend"].includes(g[0])&&(G=this.parentNode)):["setHTML","replaceChildren"].includes(x)?(N=[...this.childNodes],T=x==="replaceChildren"?[...g]:[g[0]]):["replaceWith","remove"].includes(x)?(N=[this],T=x==="replaceWith"?[...g]:[],G=this.parentNode):["replaceChild"].includes(x)?(N=[g[1]],T=[g[0]]):["removeChild"].includes(x)?N=[...g]:(T=[...g],["before","after"].includes(x)&&(G=this.parentNode));let B=x;if(["insertAdjacentHTML","setHTML"].includes(x)){let er=this.nodeName;if(x==="insertAdjacentHTML"&&["beforebegin","afterend"].includes(g[0])){if(!this.parentNode)return b[x].call(this,...g);er=this.parentNode.nodeName}let Te=s.createElement(er);b.setHTML.call(Te,T[0],x==="setHTML"?g[1]:{}),T=[...Te.childNodes],x==="insertAdjacentHTML"?(B="insertAdjacentElement",g[1]=new c,g[1].______isTemp=!0,g[1].append(...Te.childNodes)):(B="replaceChildren",g=[...Te.childNodes])}return p({target:G,entrants:T,exits:N,type:"interception",event:[this,x]},()=>b[B].call(this,...g))}["insertBefore","replaceChild","removeChild","appendChild"].includes(x)?(d.other[x]=n.prototype[x],n.prototype[x]=w):(["after","before","remove","replaceWith"].includes(x)&&(d.characterData[x]=a.prototype[x],a.prototype[x]=w),o.prototype[x]&&(d.other[x]=o.prototype[x],o.prototype[x]=w))});let y=Object.create(null);return["outerHTML","outerText","innerHTML","innerText","textContent","nodeValue"].forEach(x=>{let w=["textContent","nodeValue"].includes(x)?n:["outerText","innerText"].includes(x)?l:o;y[x]=Object.getOwnPropertyDescriptor(w.prototype,x),Object.defineProperty(w.prototype,x,{...y[x],set:function(g){let b=()=>y[x].set.call(this,g);if(!(this instanceof o))return b();let v=[],N=[],T=this;if(["outerHTML","outerText"].includes(x)?(v=[this],T=this.parentNode):v=[...this.childNodes],["outerHTML","innerHTML"].includes(x)){let B=this.nodeName;if(x==="outerHTML"){if(!this.parentNode)return b();B=this.parentNode.nodeName}let Ht=s.createElement(B==="TEMPLATE"?"div":B);y[x].set.call(Ht,g),N=this instanceof u?[]:[...Ht.childNodes],x==="outerHTML"?(g=new c,g.______isTemp=!0,g.append(...Ht.childNodes),b=()=>o.prototype.replaceWith.call(this,g)):this instanceof u?b=()=>this.content.replaceChildren(...Ht.childNodes):b=()=>o.prototype.replaceChildren.call(this,...Ht.childNodes)}return p({target:T,entrants:N,exits:v,type:"interception",event:[this,x]},b)}})}),["append","prepend","replaceChildren"].forEach(x=>{[s,c.prototype].forEach(w=>{let g=w[x];w[x]=function(...b){if(this.______isTemp)return g.call(this,...b);let v=x==="replaceChildren"?[...this.childNodes]:[];return p({target:this,entrants:b,exits:v,type:"interception",event:[this,x]},()=>g.call(this,...b))}})}),f}function vs(){Bn.call(this),Hn.call(this),Wn.call(this)}function Bn(){let e=this;e.CSS||(e.CSS={}),e.CSS.escape||(e.CSS.escape=t=>t.replace(/([\:@\~\$\&])/g,"\\$1"))}function Hn(){let e=this;"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 Wn(){let e=this;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 _s(){let e=this;if(e.webqit||(e.webqit={}),e.webqit.realdom)return e.webqit.realdom;e.webqit.realdom={},vs.call(e),e.webqit.realdom.meta=(...i)=>Un.call(e,...i),e.webqit.realdom.ready=(...i)=>ji.call(e,...i),e.webqit.realdom.realtime=(i,r="dom")=>{if(r==="dom")return new Ie(i,e);if(r==="attr")return new It(i,e)};let t=new Pe(e);return e.webqit.realdom.schedule=(i,...r)=>t[`on${i}`](...r),e.webqit.realdom.synthesizeWhile=(...i)=>t.synthesizeWhile(...i),e.webqit.realdom}function ji(...e){let t="interactive",i;zt(e[0])?(t=e[0],L(e[1])&&(i=e[1])):L(e[0])&&(i=e[0]);let r={interactive:["interactive","complete"],complete:["complete"]};if(!r[t])throw new Error(`Invalid ready-state timing: ${t}.`);let s=this;if(!i)return s.webqit.realdom.readyStatePromises||(s.webqit.realdom.readyStatePromises={interactive:new Promise(n=>ji.call(this,"interactive",n)),complete:new Promise(n=>ji.call(this,"complete",n))}),s.webqit.realdom.readyStatePromises[t];if(r[t].includes(s.document.readyState))return i(s);s.webqit.realdom.readyStateCallbacks||(s.webqit.realdom.readyStateCallbacks={interactive:[],complete:[]},s.document.addEventListener("readystatechange",()=>{let n=s.document.readyState;for(let a of s.webqit.realdom.readyStateCallbacks[n].splice(0))a(s)},!1)),s.webqit.realdom.readyStateCallbacks[t].push(i)}function Un(e){let t=this,i={},r;return(r=t.document.querySelector(`meta[name="${e}"]`))&&(i=(r.content||"").split(";").filter(s=>s).reduce((s,n)=>{let a=n.split("=").map(o=>o.trim());return Fi(s,a[0].split("."),a[1]==="true"?!0:a[1]==="false"?!1:Y(a[1])?parseInt(a[1]):a[1]),s},{})),{get name(){return e},get content(){return r.content},json(){return JSON.parse(JSON.stringify(i))}}}function ti(e,t){return typeof e!="string"?e:e.replace(/\w\S*/g,function(i){return i.charAt(0).toUpperCase()+(typeof t!==void 0&&t?i.substr(1).toLowerCase():i.substr(1))})}var S=(...e)=>Ct("oohtml",...e),q={};function X(e,t,i){let r=this,s=_s.call(r);q.window=r,r.webqitConfig||(r.webqitConfig=s.meta("webqit").json()),r.webqit||(r.webqit={}),r.webqit.oohtml||(r.webqit.oohtml={}),r.webqit.oohtml.configs||(r.webqit.oohtml.configs={});let n=e.toUpperCase().replace("-","_");if(!r.webqit.oohtml.configs[n]){r.webqit.oohtml.configs[n]={};let a=r.webqit.oohtml.configs[n];se(2,a,i,t,s.meta(e).json()),r.webqitConfig.prefix&&Object.keys(a).forEach(o=>{Object.keys(a[o]).forEach(l=>{o==="api"&&typeof a[o][l]=="string"?a[o][l]=`${r.webqitConfig.prefix}${ti(a[o][l])}`:["attr","elements"].includes(o)&&a[o][l]?.startsWith("data-")===!1&&(a[o][l]=`${r.webqitConfig.prefix}-${a[o][l]}`)})})}return{config:r.webqit.oohtml.configs[n],realdom:s,window:r}}function Bi(e={}){let{config:t,window:i}=X.call(this,"namespaced-html",e,{attr:{namespace:"namespace",id:"id"},api:{namespace:"namespace",eagermode:!0},target:{attr:":target",event:":target",scrolling:!0}});t.idSelector=`[${i.CSS.escape(t.attr.id)}]`,t.namespaceSelector=`[${i.CSS.escape(t.attr.namespace)}]`,Qn.call(i,t),Xn.call(i,t)}function Oe(e,t){let i=this,{webqit:{Observer:r}}=i;if(!S(e).has("namespace")){let s=Object.create(null);r.intercept(s,"get",(n,a,o)=>{if(r.has(s,n.key)||!t.api.eagermode)return o();let l=`[${i.CSS.escape(t.attr.id)}="${n.key}"]`,u=Array.from(e.querySelectorAll(l)).filter(c=>{let f=c.parentNode.closest(t.namespaceSelector);return e===i.document?!f:f===e})[0];return u&&r.set(s,n.key,u),o()}),S(e).set("namespace",s)}return S(e).get("namespace")}function Qn(e){let t=this,{webqit:{Observer:i}}=t;if(e.api.namespace in t.document)throw new Error(`document already has a "${e.api.namespace}" property!`);if(e.api.namespace in t.Element.prototype)throw new Error(`The "Element" class already has a "${e.api.namespace}" property!`);Object.defineProperty(t.document,e.api.namespace,{get:function(){return i.proxy(Oe.call(t,t.document,e))}}),Object.defineProperty(t.Element.prototype,e.api.namespace,{get:function(){return i.proxy(Oe.call(t,this,e))}})}function Xn(e){let t=this,{webqit:{Observer:i,realdom:r}}=t,s=(o,l,u)=>{let c=l.getAttribute(e.attr.id),f=o.closest(e.namespaceSelector)||S(l).get("ownerNamespace")||t.document,p=Oe.call(t,f,e);u?i.get(p,c)!==l&&(S(l).set("ownerNamespace",f),i.set(p,c,l)):i.get(p,c)===l&&(S(l).delete("ownerNamespace"),i.deleteProperty(p,c))};r.realtime(t.document).subtree(e.idSelector,o=>{o.entrants.forEach(l=>s(o.target,l,!0)),o.exits.forEach(l=>s(o.target,l,!1))},{live:!0,timing:"sync",staticSensitivity:!0}),r.realtime(t.document,"attr").observe(e.attr.namespace,o=>{let l=o.target.parentNode?.closest(e.namespaceSelector)||S(o.target).get("ownerNamespace")||t.document,u=Oe.call(t,l,e),c=Oe.call(t,o.target,e);if(o.target.matches(e.namespaceSelector))for(let[f,p]of Object.entries(u))!o.target.contains(p.parentNode)||(i.deleteProperty(u,f),i.set(c,f,p));else for(let[f,p]of Object.entries(c))i.deleteProperty(c,f),i.set(u,f,p)},{subtree:!0,timing:"sync"});let n,a=()=>{let o=t.location.hash?.substring(1).split("/").map(u=>u.trim()).filter(u=>u)||[],l=o.reduce((u,c)=>u&&u[e.api.namespace][c],t.document);n&&e.target.attr&&n.toggleAttribute(e.target.attr,!1),l&&l!==t.document&&(e.target.attr&&l.toggleAttribute(e.target.attr,!0),e.target.event&&l.dispatchEvent(new t.CustomEvent(e.target.event)),e.target.scrolling&&o.length>1&&l.scrollIntoView(),n=l)};t.addEventListener("hashchange",a),r.ready(a)}function Hi({advanced:e={},...t}){let{config:i,window:r}=X.call(this,"scoped-css",t,{style:{retention:"retain",mimeType:"",strategy:null}});i.styleSelector=(Array.isArray(i.style.mimeType)?i.style.mimeType:[i.style.mimeType]).reduce((s,n)=>{let a=n?`[type=${r.CSS.escape(n)}]`:"";return s.concat(`style${a}[scoped]`)},[]).join(","),Kn.call(r,i)}function Kn(e){let t=this,{webqit:{realdom:i}}=t;t.HTMLScriptElement.supports||(t.HTMLScriptElement.supports=()=>!1);let r=()=>{};i.realtime(t.document).subtree(e.styleSelector,s=>{s.entrants.forEach(n=>{if("scoped"in n)return r(n);if(e.style.strategy==="@scope"){if(Object.defineProperty(n,"scoped",{value:n.hasAttribute("scoped")}),n.hasAttribute("ref"))return;let a=`scoped${Yn()}`;n.setAttribute("ref",a),n.textContent=`@scope from (:has(> style[ref="${a}"])) {
|
|
16
|
-
|
|
17
|
-
}`}})},{live:!0,timing:"intercept",generation:"entrants"})}var Yn=()=>(0|Math.random()*9e6).toString(36);var wt=class{static toHash(t){let i;return(i=this.hashTable.get(t))||(i=this.uniqId(),this.hashTable.set(t,i)),i}static fromHash(t){let i;return this.hashTable.forEach((r,s)=>{r===t&&(i=s)}),i}};j(wt,"hashTable",new Map),j(wt,"uniqId",()=>(0|Math.random()*9e6).toString(36));function Wi({advanced:e={},...t}){let{config:i,window:r}=X.call(this,"scoped-js",t,{script:{retention:"retain",mimeType:""},advanced:Ye(e)});i.scriptSelector=(Array.isArray(i.script.mimeType)?i.script.mimeType:[i.script.mimeType]).reduce((s,n)=>{let a=n?`[type=${r.CSS.escape(n)}]`:"";return s.concat(`script${a}[scoped],script${a}[quantum]`)},[]).join(","),r.webqit.oohtml.Script={compileCache:[new Map,new Map],execute:Jn.bind(r,i)},Zn.call(r,i)}async function Jn(e,t){let i=this,{realdom:r}=i.webqit,s=wt.fromHash(t);if(!s)throw new Error("Argument must be a valid exec hash.");let{script:n,compiledScript:a,thisContext:o}=s;e.script.retention==="dispose"?n.remove():e.script.retention==="dispose"?n.textContent='"source hidden"':n.textContent=await a.toString();let l=(await a.bind(o)).execute();n.quantum&&Object.defineProperty(n,"state",{value:l}),r.realtime(i.document).observe(n,()=>{n.quantum&&l.dispose(),n.scoped&&o.scripts.splice(o.scripts.indexOf(n,1))},{subtree:!0,timing:"sync",generation:"exits"})}function Zn(e){let t=this,{webqit:{oohtml:i,realdom:r,QuantumScript:s,QuantumAsyncScript:n,QuantumModule:a}}=t;t.HTMLScriptElement.supports||(t.HTMLScriptElement.supports=()=>!1);let o=["module"].concat(e.script.mimeType||[]);r.realtime(t.document).subtree(e.scriptSelector,l=>{l.entrants.forEach(u=>{if(u.cloned)return;if("quantum"in u||(Object.defineProperty(u,"quantum",{value:u.hasAttribute("quantum")}),"scoped"in u))return handled(u);Object.defineProperty(u,"scoped",{value:u.hasAttribute("scoped")});let c=(u._=u.textContent.trim())&&u._.startsWith("/*@oohtml*/if(false){")&&u._.endsWith("}/*@oohtml*/")?u._.slice(21,-12):u.textContent,f=wt.toHash(c),p=i.Script.compileCache[u.quantum?0:1],d;if(!(d=p.get(f))){let{parserParams:g,compilerParams:b,runtimeParams:v}=e.advanced;d=new(u.type==="module"?a:s||n)(c,{exportNamespace:`#${u.id}`,fileName:`${t.document.url?.split("#")?.[0]||""}#${u.id}`,parserParams:g,compilerParams:{...b,startStatic:!u.quantum},runtimeParams:v}),p.set(f,d)}let y=u.scoped?u.parentNode||l.target:u.type==="module"?void 0:t;u.scoped&&(y.scripts||Object.defineProperty(y,"scripts",{value:[]}),y.scripts.push(u));let x=wt.toHash({script:u,compiledScript:d,thisContext:y});l.type==="query"||o.includes(u.type)&&!t.HTMLScriptElement.supports(u.type)?i.Script.execute(x):u.textContent=`webqit.oohtml.Script.execute( '${x}' );`})},{live:!0,timing:"intercept",generation:"entrants",eventDetails:!0})}function ei(){let{window:e}=q,{webqit:t}=e;if(t.DOMContextRequestEvent)return t.DOMContextRequestEvent;class i extends e.Event{constructor(...s){let n=s.pop();if(typeof n!="function")throw new Error("Callback must be provided.");let a=s.pop();if(!a?.kind)throw new Error('"options.kind" must be specified.');let o=["contextrequest","contextclaim"],l=s.pop()||o[0];if(!o.includes(l))throw new Error(`Invalid event type. Must be one of: ${o.join(",")}`);let{kind:u,detail:c,targetContext:f,live:p,signal:d,diff:y,...x}=a;super(l,{...x,bubbles:x.bubbles!==!1}),Object.defineProperty(this,"callback",{get:()=>n}),Object.defineProperty(this,"kind",{get:()=>u}),Object.defineProperty(this,"targetContext",{get:()=>f}),Object.defineProperty(this,"detail",{get:()=>c}),Object.defineProperty(this,"live",{get:()=>p}),Object.defineProperty(this,"signal",{get:()=>d}),Object.defineProperty(this,"diff",{get:()=>y}),Object.defineProperty(this,"options",{get:()=>x})}respondWith(s){if(this.diff){if("_prevValue"in this&&this._prevValue===s)return;Object.defineProperty(this,"_prevValue",{value:s,configurable:!0})}return this.callback(s)}}return t.DOMContextRequestEvent=i,i}var jt=class extends AbortController{constructor(t){super(),t(i=>{let{window:{webqit:{Observer:r}}}=q;r.defineProperty(this,"value",{value:i,configurable:!0,enumerable:!0})},this)}};var Ui=class{static createRequest(){return{kind:this.kind}}constructor(t=null){Object.defineProperty(this,"detail",{get:()=>t}),Object.defineProperty(this,"subscriptions",{value:new Set})}get configs(){let{window:{webqit:{oohtml:{configs:t}}}}=q;return t}get name(){return this.host===q.window.document?1/0:this.host.getAttribute(this.configs.CONTEXT_API.attr.contextname)}subscribed(t){}handle(t){}unsubscribed(t){}matchEvent(t){return t.kind===this.constructor.kind&&(!t.targetContext||t.targetContext===this.name)}handleEvent(t){if(!(this.disposed||typeof t.respondWith!="function")){if(t.type==="contextclaim"){if(t.target===this.host||!(t.detail instanceof Ui))return;let i=new Set;return this.subscriptions.forEach(r=>{!t.target.contains(r.target)||!t.detail.matchEvent(r)||(t.stopPropagation(),this.subscriptions.delete(r),i.add(r))}),t.respondWith(i)}if(t.type==="contextrequest")return this.matchEvent(t)?(t.live&&(this.subscriptions.add(t),this.subscribed(t),t.signal?.addEventListener("abort",()=>{this.subscriptions.delete(t),this.unsubscribed(t)})),t.stopPropagation(),this.handle(t)):void 0}}initialize(t){this.host=t,this.disposed=!1,t.addEventListener("contextrequest",this),t.addEventListener("contextclaim",this);let{value:i}=vt.instance(t).request("contextclaim",{kind:this.constructor.kind,detail:this});return i?.forEach(r=>{this.subscriptions.add(r),this.subscribed(r),this.handle(r)}),this}dispose(t){return this.disposed=!0,t.removeEventListener("contextrequest",this),t.removeEventListener("contextclaim",this),this.subscriptions.forEach(i=>{this.subscriptions.delete(i),this.unsubscribed(i);let{target:r}=i;r.dispatchEvent(i)}),this}},rt=Ui;j(rt,"kind");var Bt=class extends Error{};var vt=class{static instance(t){return S(t).get("contexts::instance")||new this(t)}constructor(t){S(t).get("contexts::instance")?.dispose(),S(t).set("contexts::instance",this);let i={host:t,contexts:new Set};Object.defineProperty(this,"#",{get:()=>i})}get[Symbol.iterator](){return this["#"].contexts[Symbol.iterator]}get length(){return this["#"].contexts.size}find(...t){return[...this["#"].contexts].find(i=>typeof t[0]=="function"?t[0](i):i.constructor.kind===t[0]&&(t.length===1||i.detail===t[1]))}attach(t){if(!(t instanceof rt))throw new TypeError("Context is not a valid DOMContext instance.");if(this.find(t.constructor.kind,t.detail))throw new Bt(`Context of same kind "${t.constructor.kind}"${t.detail?` and detail "${t.detail}"`:""} already exists.`);this["#"].contexts.add(t),t.initialize(this["#"].host)}detach(t){t.dispose(this["#"].host),this["#"].contexts.delete(t)}request(...t){return new jt((i,r)=>{typeof t[t.length-1]!="function"&&(t[t.length-1]?t.push(i):t[t.length-1]=i);let s;(s=t.find(a=>typeof a=="object"&&a))&&s.live&&(s.signal&&s.signal.addEventListener("abort",()=>r.abort()),t[t.indexOf(s)]={...s,signal:r.signal});let n=new(ei())(...t);this["#"].host.dispatchEvent(n)})}};function zi(e={}){let{config:t,window:i}=X.call(this,"context-api",e,{attr:{contextname:"contextname"},api:{contexts:"contexts"}});i.webqit.DOMContexts=vt,i.webqit.DOMContext=rt,i.webqit.DOMContextRequestEvent=ei(),i.webqit.DOMContextResponse=jt,i.webqit.DuplicateContextError=Bt,ta.call(i,t)}function ta(e){let t=this;if(e.api.contexts in t.document)throw new Error(`document already has a "${e.api.contexts}" property!`);if(e.api.contexts in t.HTMLElement.prototype)throw new Error(`The "HTMLElement" class already has a "${e.api.contexts}" property!`);Object.defineProperty(t.document,e.api.contexts,{get:function(){return vt.instance(t.document)}}),Object.defineProperty(t.HTMLElement.prototype,e.api.contexts,{get:function(){return vt.instance(this)}});let i=new Set;t.addEventListener("contextrequest",r=>{typeof r.respondWith=="function"&&(i.add(r),r.respondWith())}),t.addEventListener("contextclaim",r=>{if(typeof r.detail!="object"||typeof r.detail.matchEvent!="function"||typeof r.respondWith!="function")return;let s=new Set;i.forEach(n=>{!r.target.contains(n.target)||!r.detail.matchEvent(n)||(i.delete(n),s.add(n))}),r.respondWith(s)})}var _t=class extends rt{static createRequest(t=null){let i=super.createRequest();if(t?.startsWith("@")){let[r,...s]=s.slice(1).split(".").map(n=>n.trim());i.targetContext=r,i.detail=s.join(".")}else i.detail=t;return i}get bindingsObj(){return this.host[this.configs.BINDINGS_API.api.bindings]}matchEvent(t){return super.matchEvent(t)&&(!t.detail||!this.detail||(Array.isArray(t.detail)?t.detail[0]===this.detail:t.detail===this.detail))}handle(t){if(t._controller?.abort(),!(t.detail+"").trim())return t.respondWith(this.bindingsObj);let{window:{webqit:{Observer:i}}}=q;t._controller=i.reduce(this.bindingsObj,Array.isArray(t.detail)?t.detail:[t.detail],i.get,r=>{this.disposed||t.respondWith(r.value)},{live:t.live,signal:t.signal,descripted:!0})}unsubscribed(t){t._controller?.abort()}};j(_t,"kind","bindings");function Qi(e={}){let{config:t,window:i}=X.call(this,"bindings-api",e,{attr:{bindingsreflection:"bindings"},api:{bind:"bind",bindings:"bindings"}});i.webqit.DOMBindingsContext=_t,ea.call(i,t)}function Gi(e,t){let i=this,{webqit:{Observer:r,oohtml:{configs:{CONTEXT_API:s}}}}=i;if(!S(t).has("bindings")){let n=Object.create(null);S(t).set("bindings",n),r.observe(n,a=>{let o=Object.keys(n),l=t===i.document?i.document.documentElement:t,u=e.attr.bindingsreflection;o.length&&u?l.setAttribute(e.attr.bindingsreflection,o.join(" ")):u&&l.toggleAttribute(e.attr.bindingsreflection,!1);let c=t[s.api.contexts];for(let f of a)if(f.type==="delete"){let p=c.find(_t.kind,f.key);p&&c.detach(p)}else c.find(_t.kind,f.key)||c.attach(new _t(f.key))})}return S(t).get("bindings")}function Ss(e,t,i,{merge:r,diff:s,namespace:n}={}){let a=this,{webqit:{Observer:o}}=a,l=Gi.call(this,e,t),u={diff:s,namespace:n},c=r?[]:o.ownKeys(l,u).filter(f=>!(f in i));return o.batch(l,()=>(c.length&&o.deleteProperties(l,c,u),o.set(l,i,u)),u)}function ea(e){let t=this,{webqit:{Observer:i}}=t;if(e.api.bind in t.document)throw new Error(`document already has a "${e.api.bind}" property!`);if(e.api.bindings in t.document)throw new Error(`document already has a "${e.api.bindings}" property!`);if(e.api.bind in t.Element.prototype)throw new Error(`The "Element" class already has a "${e.api.bind}" property!`);if(e.api.bindings in t.Element.prototype)throw new Error(`The "Element" class already has a "${e.api.bindings}" property!`);Object.defineProperty(t.document,e.api.bind,{value:function(r,s={}){return Ss.call(t,e,t.document,r,s)}}),Object.defineProperty(t.document,e.api.bindings,{get:function(){return i.proxy(Gi.call(t,e,t.document))}}),Object.defineProperty(t.Element.prototype,e.api.bind,{value:function(r,s={}){return Ss.call(t,e,this,r,s)}}),Object.defineProperty(t.Element.prototype,e.api.bindings,{get:function(){return i.proxy(Gi.call(t,e,this))}})}var ft=class{static instance(t){return S(t).get("defsmanager::instance")||new this(t)}constructor(t,i=null,r=0){let{window:s}=q,{webqit:{realdom:n,oohtml:{configs:a}}}=s;S(t).get("defsmanager::instance")?.dispose(),S(t).set("defsmanager::instance",this),this.host=t,this.config=a.HTML_IMPORTS,this.parent=i,this.level=r,this.defs=Et(this.host),this.defId=(this.host.getAttribute(this.config.attr.def)||"").trim(),this.validateDefId(this.defId),this.realtimeA=n.realtime(this.host.content).children(o=>{this.export(o.entrants,!0),this.export(o.exits,!1)},{live:!0,timing:"sync"}),this.realtimeB=n.realtime(this.host).attr(["src","loading"],(...o)=>this.evaluateLoading(...o),{live:!0,atomic:!0,timing:"sync",lifecycleSignals:!0}),this.realtimeC=this.evalInheritance()}validateDefId(t){if(["@","/","*","#"].some(i=>t.includes(i)))throw new Error(`The export ID "${t}" contains an invalid character.`)}export(t,i){let{window:r}=q,{webqit:{Observer:s}}=r,n,a=this.defs["#"]||[];s.batch(this.defs,()=>{t.forEach(o=>{if(o.nodeType!==1)return;let l=o.matches(this.config.templateSelector),u=(o.getAttribute(l?this.config.attr.def:this.config.attr.fragmentdef)||"").trim();i?(l&&u?new ft(o,this.host,this.level+1):(a.push(o),n=!0),u&&(this.validateDefId(u),s.set(this.defs,(!l&&"#"||"")+u,o))):(l&&u?ft.instance(o).dispose():(a=a.filter(c=>c!==o),n=!0),u&&s.deleteProperty(this.defs,(!l&&"#"||"")+u))}),n&&s.set(this.defs,"#",a)})}evaluateLoading([t,i],{signal:r}){let{window:{webqit:{Observer:s}}}=q,n=(t.value||"").trim();if(!n)return;let a,o=c=>{if(!c)return a;a=c.then(()=>u.remove())},l=(i.value||"").trim(),u=s.intercept(this.defs,"get",async(c,f,p)=>(l==="lazy"&&o(this.load(n,!0)),await o(),p()),{signal:r});l!=="lazy"&&o(this.load(n))}load(t){let{window:i}=q;if(this.host.content.children.length)return Promise.resolve();if(this.fetchInFlight?.src===t)return this.fetchInFlight.request;this.fetchInFlight?.controller.abort();let r=new AbortController,s=(a,o)=>this.host.dispatchEvent(new i.CustomEvent(a,{detail:o})),n=i.fetch(t,{signal:r.signal,element:this.host}).then(a=>a.ok?a.text():Promise.reject(a.statusText)).then(a=>(this.host.innerHTML=a.trim(),s("load"),this.host)).catch(a=>(console.error(`Error fetching the bundle at "${t}": ${a.message}`),this.fetchInFlight=null,s("loaderror"),this.host));return this.fetchInFlight={src:t,request:n,controller:r},n}evalInheritance(){if(!this.parent)return[];let{window:{webqit:{Observer:t}}}=q,i=(this.host.getAttribute(this.config.attr.extends)||"").trim(),r=(this.host.getAttribute(this.config.attr.inherits)||"").trim(),s=o=>{o.forEach(l=>{t.get(this.defs,l.key)===l.oldValue&&(["get","set","def"].includes(l.type)?t[l.type.replace("get","set")](this.defs,l.key,l.value):l.type==="delete"&&t.deleteProperty(this.defs,l.key))})},n=[],a=Et(this.parent);return i&&n.push(t.reduce(a,[i,this.config.api.defs,1/0],t.get,s,{live:!0})),(r=r.split(" ").map(o=>o.trim()).filter(o=>o)).length&&n.push(t.get(a,r,s,{live:!0})),n}dispose(){this.realtimeA.disconnect(),this.realtimeB.disconnect(),this.realtimeC.forEach(t=>t instanceof Promise?t.then(i=>i.abort()):t.abort()),Object.entries(this.defs).forEach(([t,i])=>{t.startsWith("#")||ft.instance(i).dispose()})}};var St=class extends rt{static createRequest(t=null){let i=super.createRequest();if(t?.startsWith("/"))i.detail=t,i.targetContext=1/0;else if(t?.startsWith("@")){let[r,...s]=s.slice(1).split(/(?<=\w)(?=\/|#)/).map(n=>n.trim());i.targetContext=r,i.detail=s.join("")}else i.detail=t;return i}get localModules(){return Et(this.host)}handle(t){let{window:{webqit:{Observer:i}}}=q;if(t._controller?.abort(),(t.detail||"").trim()==="/")return t.respondWith(this.localModules);let r=this.configs.HTML_IMPORTS,s=(t.detail||"").split(/\/|(?<=\w)(?=#)/g).map(a=>a.trim()).filter(a=>a);if(s.length&&(s=s.join(`/${r.api.defs}/`)?.split("/")||[]),!s.length)return t.respondWith();let n={live:t.live,signal:t.signal,descripted:!0};t._controller=i.reduce(this.localModules,s,i.get,(a,{signal:o}={})=>{let l=Array.isArray(a)?a:a.value,u=Array.isArray(a)?a.length:a.value;if(!(!u&&this.host.isConnected===!1))return u||!this.contextModules?(t._isValidLocalResult=u,t.respondWith(l)):i.reduce(this.contextModules,s,i.get,c=>(t._currentSource="context",t.respondWith(Array.isArray(c)?c:c.value)),{...n,signal:o})},{lifecycleSignals:!0,...n})}unsubscribed(t){t._controller?.abort()}realtimeSources(t){this.host=t;let i=()=>{for(let n of this.subscriptions)n._isValidLocalResult||this.handle(n)},r=this.configs.HTML_IMPORTS;if(!this.host.matches||!r.attr.importscontext)return;this.refdSourceController?.disconnect();let s=this.host.ownerDocument.defaultView.webqit.realdom;this.refdSourceController=s.realtime(this.host).attr(r.attr.importscontext,(n,{signal:a})=>{if(!n.value)return this.contextModules=void 0,i();let o={...this.constructor.createRequest(n.value.trim()),live:!0,signal:a};this.host.parentNode[this.configs.CONTEXT_API.api.contexts].request(o,l=>{this.contextModules=l&&Object.getPrototypeOf(l)?Et(l):l,i()})},{live:!0,timing:"sync",lifecycleSignals:!0})}initialize(t){return this.realtimeSources(t),super.initialize(t)}dispose(t){return this.refdSourceController?.disconnect(),super.dispose(t)}};j(St,"kind","html-imports");function Cs(){let{window:e}=q,{webqit:t}=e,{realdom:i,oohtml:{configs:r}}=t;if(t.HTMLImportElement)return t.HTMLImportElement;let s=r.HTML_IMPORTS.elements.import.includes("-")?e.HTMLElement:class{};class n extends s{static instance(o){return r.HTML_IMPORTS.elements.import.includes("-")&&o instanceof this?o:S(o).get("import::instance")||new this(o)}constructor(...o){super();let l=o[0]||this;S(l).set("import::instance",this),Object.defineProperty(this,"el",{get:()=>l,configurable:!1});let u={};Object.defineProperty(this,"#",{get:()=>u,configurable:!1}),u.slottedElements=new Set,u.setAnchorNode=c=>(u.anchorNode=c,c),u.importRequest=(c,f=null)=>{let p={...St.createRequest(u.moduleRef?.includes("#")?u.moduleRef:`${u.moduleRef}#`),live:f&&!0,signal:f};(this.el.isConnected?this.el.parentNode:u.anchorNode.parentNode)[r.CONTEXT_API.api.contexts].request(p,d=>{c((d instanceof e.HTMLTemplateElement?[...d.content.children]:Array.isArray(d)?d:d&&[d])||[])})},u.hydrate=(c,f)=>{u.moduleRef=(this.el.getAttribute(r.HTML_IMPORTS.attr.ref)||"").trim(),c.replaceWith(u.setAnchorNode(this.createAnchorNode())),u.autoRestore(()=>{f.forEach(p=>{u.slottedElements.add(p),S(p).set("slot@imports",this.el)})}),u.hydrationImportRequest=new AbortController,u.importRequest(p=>{if(u.originalsRemapped)return this.fill(p);let d=p.map((x,w)=>({el:x,fragmentDef:x.getAttribute(r.HTML_IMPORTS.attr.fragmentdef)||"",tagName:x.tagName,i:w})),y=-1;f.forEach(x=>{let w=x.tagName,g=x.getAttribute(r.HTML_IMPORTS.attr.fragmentdef)||"",b=(y++,d.find(v=>v.tagName===w&&v.fragmentDef===g&&v.i===y));!b||S(x).set("original@imports",b.el)}),u.originalsRemapped=!0},u.hydrationImportRequest.signal)},u.autoRestore=(c=null)=>{u.autoRestoreRealtime?.disconnect(),c&&c();let f=()=>{u.anchorNode?.replaceWith(this.el),u.anchorNode=null,this.el.setAttribute("data-nodecount",0)};if(!u.slottedElements.size)return f();let p=i.realtime(e.document).observe([...u.slottedElements],d=>{if(d.exits.forEach(y=>{S(y).delete("slot@imports"),u.slottedElements.delete(y)}),!u.slottedElements.size){if(p.disconnect(),!d.target.isConnected)return;f()}},{subtree:!0,timing:"sync",generation:"exits"});u.autoRestoreRealtime=p},u.connectedCallback=()=>{if(u.slottedElements.size)throw new Error("Illegal reinsertion into the DOM; import slot is not empty!");u.moduleRefRealtime||(u.moduleRefRealtime=i.realtime(this.el).attr(r.HTML_IMPORTS.attr.ref,(c,{signal:f})=>{u.moduleRef=c.value,u.importRequest(p=>!u.hydrationImportRequest&&this.fill(p),f)},{live:!0,timing:"sync",lifecycleSignals:!0}),u.hydrationImportRequest?.abort(),u.hydrationImportRequest=null)},u.disconnectedCallback=()=>{u.hydrationImportRequest?.abort(),u.hydrationImportRequest=null,!u.anchorNode.isConnected&&(u.moduleRefRealtime?.disconnect(),u.moduleRefRealtime=null)}}createAnchorNode(){if(e.webqit.env!=="server")return e.document.createTextNode("");let o=e.document.createElement("div");o.textContent=this.el.outerHTML;let l=e.document.createComment(o.innerHTML);return S(l).set("isAnchorNode",!0),l}fill(o){Array.isArray(o)&&(o=new Set(o)),this.el.setAttribute("data-nodecount",o.size),this["#"].autoRestore(()=>{if(this["#"].slottedElements.forEach(l=>{let u=S(l).get("original@imports");o.has(u)?o.delete(u):(this["#"].slottedElements.delete(l),l.remove())}),o.size){let l=this["#"].anchorNode,u=this["#"].setAnchorNode(this.createAnchorNode());(this.el.isConnected?this.el:l).replaceWith(u)}o.forEach(l=>{let u=l.cloneNode(!0);u.hasAttribute(r.HTML_IMPORTS.attr.fragmentdef)||u.toggleAttribute(r.HTML_IMPORTS.attr.fragmentdef,!0),S(u).set("original@imports",l),S(u).set("slot@imports",this.el),this["#"].slottedElements.add(u),this["#"].anchorNode.before(u)})})}empty(){this["#"].slottedElements.forEach(o=>o.remove())}get anchorNode(){return this["#"].anchorNode}get moduleRef(){return this["#"].moduleRef}get slottedElements(){return this["#"].slottedElements}}return r.HTML_IMPORTS.elements.import.includes("-")&&customElements.define(r.HTML_IMPORTS.elements.import,n),t.HTMLImportElement=n,n}function Xi(e={}){let{config:t,window:i}=X.call(this,"html-imports",e,{elements:{import:"import"},attr:{def:"def",extends:"extends",inherits:"inherits",ref:"ref",importscontext:"importscontext"},api:{def:"def",defs:"defs",import:"import"}});t.attr.fragmentdef||(t.attr.fragmentdef=t.attr.def),t.templateSelector=`template[${i.CSS.escape(t.attr.def)}]`,t.importsContextSelector=`[${i.CSS.escape(t.attr.importscontext)}]`,t.slottedElementsSelector=`[${i.CSS.escape(t.attr.fragmentdef)}]:not(template)`;let r=(s,n)=>{let a=`starts-with(., "${s}")`,o=`substring(., string-length(.) - string-length("${n}") + 1) = "${n}"`;return`${a} and ${o}`};t.anchorNodeSelector=`comment()[${r(`<${t.elements.import}`,`</${t.elements.import}>`)}]`,i.webqit.HTMLImportsContext=St,i.webqit.HTMLImportElement=Cs(),ia.call(i,t),ra.call(i,t)}function Et(e,t=!0){if(!S(e).has("defs")&&t){let i=Object.create(null);S(e).set("defs",i)}return S(e).get("defs")}function ia(e){let t=this,{webqit:{oohtml:{configs:i}}}=t;if(e.api.defs in t.HTMLTemplateElement.prototype)throw new Error(`The "HTMLTemplateElement" class already has a "${e.api.defs}" property!`);if(e.api.def in t.HTMLTemplateElement.prototype)throw new Error(`The "HTMLTemplateElement" class already has a "${e.api.def}" property!`);if(e.api.import in t.document)throw new Error(`document already has a "${e.api.import}" property!`);if(e.api.import in t.HTMLElement.prototype)throw new Error(`The "HTMLElement" class already has a "${e.api.import}" property!`);Object.defineProperty(t.HTMLTemplateElement.prototype,e.api.defs,{get:function(){return Et(this)}}),Object.defineProperty(t.HTMLTemplateElement.prototype,e.api.def,{get:function(){return this.getAttribute(e.attr.def)}}),Object.defineProperty(t.document,e.api.import,{value:function(s,n=!1,a=null){return r(t.document,...arguments)}}),Object.defineProperty(t.HTMLElement.prototype,e.api.import,{value:function(s,n=!1,a=null){return r(this,...arguments)}});function r(s,n,a=!1,o=null){let l={};typeof a=="function"?(o=a,a=!1):typeof a=="object"&&a?l={...a,...l}:l={live:a};let u={...St.createRequest(n),...l};return s[i.CONTEXT_API.api.contexts].request(u,o)}}function ra(e){let t=this,{webqit:{Observer:i,realdom:r,oohtml:{configs:s},HTMLImportElement:n,HTMLImportsContext:a}}=t,o=c=>{let f=c[s.CONTEXT_API.api.contexts];f.find(a.kind)||f.attach(new a)},l=c=>{let f=c[s.CONTEXT_API.api.contexts],p=f.find(a.kind);p&&(!c.isConnected||!c.matches?.(e.importsContextSelector)&&!Object.keys(p.localModules).length)&&f.detach(p)};r.realtime(t.document).subtree([e.templateSelector,e.importsContextSelector],c=>{c.entrants.forEach(f=>{if(f.matches(e.templateSelector)){Object.defineProperty(f,"scoped",{value:f.hasAttribute("scoped")});let p=ft.instance(f);p.ownerContext=f.scoped?c.target:t.document;let d=Et(p.ownerContext);p.defId&&i.set(d,p.defId,f),o(p.ownerContext)}else o(f)}),c.exits.forEach(f=>{if(f.matches(e.templateSelector)){let p=ft.instance(f),d=Et(p.ownerContext);p.defId&&i.deleteProperty(d,p.defId),l(p.ownerContext)}else l(f)})},{live:!0,timing:"sync",staticSensitivity:!0}),r.realtime(t.document).subtree(e.elements.import,c=>{c.entrants.forEach(f=>u(f,!0,c)),c.exits.forEach(f=>u(f,!1,c))},{live:!0,timing:"sync"});function u(c,f){let p=n.instance(c);f?p["#"].connectedCallback():p["#"].disconnectedCallback()}t.webqit.env!=="server"&&r.realtime(t.document).subtree(`(${e.anchorNodeSelector})`,c=>{c.entrants.forEach(f=>{if(S(f).get("isAnchorNode"))return;let p=t.document.createElement("div");p.innerHTML=f.nodeValue,p.innerHTML=p.firstChild.textContent;let d=p.firstChild,y=parseInt(d.getAttribute("data-nodecount")),x=new Set,w=f;for(;(w=w.previousElementSibling)&&w.matches(e.slottedElementsSelector)&&y--;)x.add(w);n.instance(d)["#"].hydrate(f,x)})},{live:!0})}function Zi(e={}){let{config:t,window:i}=X.call(this,"data-binding",e,{attr:{expr:"expr",itemIndex:"data-key"},tokens:{nodeType:"processing-instruction",tagStart:"?{",tagEnd:"}?",stateStart:"; [=",stateEnd:"]"}});({CONTEXT_API:t.CONTEXT_API,BINDINGS_API:t.BINDINGS_API,HTML_IMPORTS:t.HTML_IMPORTS}=i.webqit.oohtml.configs),t.attrSelector=`[${i.CSS.escape(t.attr.expr)}]`;let r=(s,n)=>{let a=`starts-with(., "${s}")`,o=`substring(., string-length(.) - string-length("${n}") + 1) = "${n}"`;return`${a} and ${o}`};t.discreteBindingsSelector=`comment()[${r(t.tokens.tagStart,t.tokens.tagEnd)}]`,sa.call(i,t)}function sa(e){let t=this,{webqit:{realdom:i}}=t;i.realtime(t.document).subtree(`(${e.discreteBindingsSelector})`,r=>{ks.call(this,...r.exits),na.call(this,e,...r.entrants)},{live:!0}),i.realtime(t.document).subtree(e.attrSelector,r=>{ks.call(this,...r.exits),oa.call(this,e,...r.entrants)},{live:!0,timing:"sync",staticSensitivity:!0})}function As(e,t){let{webqit:{realdom:i,Observer:r,DOMBindingsContext:s}}=this;if(S(t).has("data-binding"))return S(t).get("data-binding");let n=Object.create(null),a=new AbortController;n.$exec__=(l,u,...c)=>{i.schedule("write",()=>l[u](...c))},n.$assign__=(l,u,c)=>{i.schedule("write",()=>l[u]=c)},r.intercept(n,{get:(l,u,c)=>{if(!(l.key in n)){let f={...s.createRequest(l.key),live:!0,signal:a.signal};t[e.CONTEXT_API.api.contexts].request(f,p=>{r.set(n,l.key,p)})}return c(n[l.key]??(l.key in globalThis?globalThis[l.key]:void 0))},has:(l,u,c)=>c(!0)});let o={scope:n,abortController:a,bindings:new Map};return S(t).set("data-binding",o),o}function ks(...e){for(let t of e){let i=t.nodeName==="#text"?t.parentNode:t,{bindings:r,abortController:s}=S(i).get("data-binding")||{};if(!r?.has(t))return;r.get(t).state.dispose(),r.get(t).signals?.forEach(n=>n.abort()),r.delete(t),r.size||(s.abort(),S(i).delete("data-binding"))}}async function na(e,...t){let i=this,{webqit:{QuantumAsyncFunction:r}}=i,s=a=>{let o=e.tokens.tagStart.split("").map(y=>`\\${y}`).join(""),l=e.tokens.tagEnd.split("").map(y=>`\\${y}`).join(""),u=e.tokens.stateStart.split("").map(y=>y===" "?"(?:\\s+)?":`\\${y}`).join(""),c=e.tokens.stateEnd.split("").map(y=>`\\${y}`).join(""),f=`^${o}(.*?)(?:${u}(\\d+)${c}(?:\\s+)?)?${l}$`,[,p,d]=a.match(new RegExp(f));return{raw:a,expr:p,span:parseInt(d??0)}},n=t.reduce((a,o)=>{if(o.isBound)return a;let l=s(o.nodeValue),u=o;if(l.span){if(u=o.nextSibling,u?.nodeName!=="#text"||u.nodeValue.length<l.span)return a;u.nodeValue.length>l.span&&u.splitText(l.span)}else u=o.ownerDocument.createTextNode(""),o.after(u);u.isBound=!0;let c=o;return i.webqit.env!=="server"&&(c.remove(),c=null),a.concat({textNode:u,template:l,anchorNode:c})},[]);for(let{textNode:a,template:o,anchorNode:l}of n){let u=aa(e,o.expr),{scope:c,bindings:f}=As.call(this,e,a.parentNode);Object.defineProperty(a,"$oohtml_internal_databinding_anchorNode",{value:l,configurable:!0}),f.set(a,{state:await(await u.bind(a,c)).execute()})}}var Ki=new Map;function aa(e,t){if(Ki.has(t))return Ki.get(t);let i=`let content = ((${t}) ?? '') + '';`;i+="$assign__(this, 'nodeValue', content);",i+=`if ( this.$oohtml_internal_databinding_anchorNode ) { $assign__(this.$oohtml_internal_databinding_anchorNode, 'nodeValue', "${e.tokens.tagStart}${te(t)}${e.tokens.stateStart}" + content.length + "${e.tokens.stateEnd} ${e.tokens.tagEnd}"); }`;let{webqit:{QuantumModule:r}}=this,s=new r(i);return Ki.set(t,s),s}async function oa(e,...t){for(let i of t){let r=ua(e,i.getAttribute(e.attr.expr)),{scope:s,bindings:n}=As.call(this,e,i),a=[];Object.defineProperty(i,"$oohtml_internal_databinding_signals",{value:a,configurable:!0}),n.set(i,{signals:a,state:await(await r.bind(i,s)).execute()})}}var Yi=new Map;function ua(e,t){if(Yi.has(t))return Yi.get(t);let i={},r=Ji(t,";").map(a=>{let[o,l]=Ji(a,":").map(d=>d.trim()),u=o[0],c=o.slice(1).trim(),f=`(${l})`,p=`(${f} ?? '')`;if(u==="&")return c.startsWith("--")?`$exec__(this.style, 'setProperty', "${te(c)}", ${p});`:`$assign__(this.style, "${te(c)}", ${p});`;if(u==="%")return`$exec__(this.classList, 'toggle', "${te(c)}", !!${f});`;if(u==="~")return c.startsWith("?")?`$exec__(this, 'toggleAttribute', "${te(c.substring(1).trim())}", !!${f});`:`$exec__(this, 'setAttribute', "${te(c)}", ${p});`;if(u==="@"){if(i[c])throw new Error(`Duplicate binding: ${o}.`);if(i[c]=!0,c==="text")return`$assign__(this, 'textContent', ${p});`;if(c==="html")return`$exec__(this, 'setHTML', ${p});`;if(c==="items"){let[d,y]=Ji(l,"/");if(!y)throw new Error(`Invalid ${u}items spec: ${a}; no import specifier.`);let[x,w,g,b]=d.trim().match(/(.*?[\)\s+])(of|in)([\(\{\[\s+].*)/i)||[];if(!x)throw new Error(`Invalid ${u}items spec: ${a}.`);if(w.startsWith("(")?w=w.trim().slice(1,-1).split(",").map(N=>N.trim()):w=[w],w.length>(g==="in"?3:2))throw new Error(`Invalid ${u}items spec: ${a}.`);let v=g==="in"?w[2]:w[1]||"$index__";return`
|
|
14
|
+
${g}
|
|
15
|
+
}`,l.startStatic=!0}else if(!["script","async-script"].includes(e))throw new Error(`Unrecognized sourceType specified: "${e}".`);l.sourceType=e,u.inBrowser=f;let m=t(i,{parserParams:u,compilerParams:l,base64:p&&f&&"export default async function(%0) {%1}"});if(m instanceof Promise&&!["async-function","async-script","module"].includes(e))throw new Error("Parse-compile can only return a Promise for sourceTypes: async-function, async-script, module.");return c.sourceType=e,c.inBrowser=f,c.exportNamespace=a,c.fileName=o,et(m,g=>{let y=["function","async-function"].includes(e);return et(((x,b)=>{if(c.compileFunction)return c.compileFunction(b.toString(),[x]);if(p&&c.inBrowser){let _=()=>import(`data:text/javascript;base64,${b.toString("base64")}`).then(A=>A.default);return window.webqit?.realdom?.schedule?window.webqit?.realdom?.schedule("write",_,!0):_()}return new(p?async function(){}.constructor:Function)(x,b.toString())})(g.identifier+"",g),x=>{let b=(_,A=s)=>{let N=x;_&&(N=N.bind(_));let U="global",W=new Y(void 0,U,globalThis);return(e.endsWith("script")||A)&&(U="env",W=new Y(W,U,A)),e==="module"&&(U="module",W=new Y(W,U)),typeof _<"u"&&(W=new Y(W,"this",{this:_})),new Wt(void 0,U,{...c,originalSource:g.originalSource,isQuantumFunction:!y},W,N)};return y?b().execute():{createRuntime:b,compiledSource:g}})})}var Ut=class{constructor(...t){let i=this.constructor,r=typeof t[t.length-1]=="object"?t.pop():{},s=t.pop()||"";this.$program=Te(i.sourceType,i.parseCompileCallback,s,r)}execute(){return et(this.$program,({createRuntime:t})=>t().execute())}bind(t,i=void 0){return et(this.$program,({createRuntime:r})=>r(t,i))}toString(t=!1){return et(this.$program,({compiledSource:i})=>t?i+"":i.originalSource)}};function Qn(...e){let{source:t,params:i}=Oi(e);return Te("function",Re,t,i)}function Xn(...e){let{source:t,params:i}=Oi(e);return Te("async-function",Re,t,i)}var Ne=class extends Ut{};G(Ne,"sourceType","script"),G(Ne,"parseCompileCallback",Re);var $e=class extends Ut{};G($e,"sourceType","async-script"),G($e,"parseCompileCallback",Re);var Le=class extends Ut{};G(Le,"sourceType","module"),G(Le,"parseCompileCallback",Re);function Re(e,t){let i=ms(e,t.parserParams);return gs(i,t.compilerParams)}function Me(e,t,i={},r={}){t=B(t).slice();for(var s=e;!bt(s)&&!he(s)&&t.length;){var n=t.shift();if(!(i.get?i.get(s,n):D(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 Qi(e,t,i,r={},s={}){let n=(c,f,p)=>s.set?s.set(c,f,p):(it(t[o])&&$(c)?c.push(p):c[f]=p,!0);t=B(t);for(var a=e,o=0;o<t.length;o++)if(o<t.length-1){if(!a||!D(a)&&!V(a))return!1;var u=Me(a,t[o],s);if(!D(u)){if(s.buildTree===!1)return!1;u=V(s.buildTree)?s.buildTree(o):it(t[o+1])?[]:{};var l=n(a,t[o],u);if(!l)return!1}a=u}else return n(a,t[o],i)}var Ve=class{constructor(t,i=!1){Object.defineProperty(this,"window",{value:t}),Object.defineProperty(this,"readCallbacks",{value:new Set}),Object.defineProperty(this,"writeCallbacks",{value:new Set}),Object.defineProperty(this,"_synthesis",{value:0,writable:!0}),!i&&this.window.requestAnimationFrame?this._loop():this._synthesis++}get synthesis(){return this._synthesis}async synthesizeWhile(t){this._synthesis++,this._fulfill();let i=await t();return this._synthesis--,i}_fulfill(){for(let t of this.readCallbacks)t(),this.readCallbacks.delete(t);for(let t of this.writeCallbacks)t(),this.writeCallbacks.delete(t)}_loop(){this.window.requestAnimationFrame(()=>{this._fulfill(),this._loop()})}onread(t,i=!1){if(i)return new Promise(r=>{this.synthesis?r(t()):this.readCallbacks.add(()=>{r(t())})});this.synthesis?Promise.resolve().then(t):this.readCallbacks.add(t)}onwrite(t,i=!1){if(i)return new Promise(r=>{this.synthesis?r(t()):this.writeCallbacks.add(()=>{r(t())})});this.synthesis?Promise.resolve().then(t):this.writeCallbacks.add(t)}cycle(t,i,r){this.onread(()=>{let s=t(r),n=a=>{a!==void 0&&this.onwrite(()=>{let o=i(a,r),u=l=>{l!==void 0&&this.cycle(t,i,l)};o instanceof Promise?o.then(u):u(o)})};s instanceof Promise?s.then(n):n(s)})}};function ys(e){return(e=e.trim())&&e.startsWith("(")&&e.endsWith(")")}function ai(e,t,i,r=!0){i=(Array.isArray(i)?i:[i]).map(a=>(a+"").replace("(",r?"(.//":"(./")).join("|");let s=[],n;try{let a=e.document.evaluate(i,t,null,XPathResult.ANY_TYPE);for(;n=a.iterateNext();)s.push(n)}catch{}return s}function xs(e,t,i){i=(Array.isArray(i)?i:[i]).map(r=>(r+"").replace("(","(self::")).join("|");try{return e.document.evaluate(`${i}`,t,null,XPathResult.BOOLEAN_TYPE).booleanValue}catch{}}function bs(e,t="|"){return[...e].reduce(([i,r,s,n],a)=>!i&&r===0&&(Array.isArray(t)?t:[t]).includes(a)?[i,r,[""].concat(s)]:(!i&&["(","[","{"].includes(a)&&!s[0].endsWith("\\")&&r++,!i&&[")","]","}"].includes(a)&&!s[0].endsWith("\\")&&r--,['"',"'","`"].includes(a)&&!s[0].endsWith("\\")&&(i=i===a?null:i||a),s[0]+=a,[i,r,s]),[null,0,[""]])[2].reverse()}var ot=class{constructor(t){this.content=t,this.type=typeof t=="string"?"selector":"instance",this.kind=this.type==="instance"?null:ys(t)?"xpath":"css",this.kind==="xpath"&&(this.isXpathAttr=bs(t.trim().slice(1,-1),"@").length>1)}toString(){return this.content}};var zt=class{constructor(t,i,r){this.context=t,this.namespace=i,this.window=t.defaultView||t.ownerDocument?.defaultView||r,this.document=this.window.document,this.webqit=this.window.webqit,Object.defineProperty(this,"#",{value:{}})}resolveArgs(t){if(V(t[0])?t=[[],...t]:M(t[0])&&!(t[0]instanceof ot)&&t.length===1?t=[[],void 0,t[0]]:M(t[1])&&t.length===2?t=[B(t[0],!1),void 0,t[1]]:t[0]=B(t[0],!1),t[0].filter(i=>typeof i!="string"&&!(i instanceof ot)&&!(i instanceof this.window.Node)).length)throw new Error("Argument #2 must be either a string or a Node object, or a list of those.");return t[0]=t[0].map(i=>i instanceof ot?i:new ot(i)),t}registry(...t){return Ot("realdom.realtime",this.window,this.namespace,...t)}createSignalGenerator(){return{generate(){return this.lastController?.abort(),this.lastController=new AbortController,{signal:this.lastController.signal}},disconnect(){this.lastController?.abort()}}}forEachMatchingContext(t,i,r){let{window:s}=this,n=Array.isArray(i)?i:[i],a=new Set;for(let[o,u]of this.registry(t))for(let[l,c]of u){let f=n.filter(p=>l.contains(p.target)?o==="subtree"||p.target===l:!1);if(!!f.length){Array.isArray(i)||(f=f[0]);for(let p of c)a.add([p,f,l])}}for(let[o,u,l]of a)r.call(s,o,u,l)}disconnectables(t,...i){let r={disconnect(){i.forEach(s=>s&&V(s.disconnect)&&s.disconnect()||V(s)&&s()||M(s)&&(s.disconnected=!0))}};return t&&t.addEventListener("abort",()=>r.disconnect()),r}};var Lt=class extends zt{constructor(t,...i){super(t,"attr",...i)}get(t,i=void 0,r={}){let s=typeof t=="string"||t instanceof ot;[t=[],i=void 0,r={}]=this.resolveArgs(arguments);let{context:n}=this,a=Es(n,t);if(!i)return a;let o=r.lifecycleSignals&&this.createSignalGenerator();if(s)for(let u of a){let l=o?.generate()||{};i(u,l,n)}else{let u=o?.generate()||{};i(a,u,n)}if(r.live){o&&(r={...r,signalGenerator:o});let u=this.observe(s?t[0]:t,i,{newValue:!0,...r});return this.disconnectables(r.signal,u)}}observe(t,i,r={}){let s=typeof t=="string"||t instanceof ot;if([t=[],i,r={}]=this.resolveArgs(arguments),["sync","intercept"].includes(r.timing))return this.observeSync(s?t[0]:t,i,r);if(r.timing&&r.timing!=="async")throw new Error(`Timing option "${r.timing}" invalid.`);let{context:n,window:a,webqit:o}=this;r.eventDetails&&!o.realdom.attrInterceptionHooks?.intercepting&&_s.call(a,"intercept",()=>{});let u=new a.MutationObserver(p=>{p=Ss(p).map(m=>Cs.call(a,m)),vs.call(a,f,p,n)}),l={attributes:!0,attributeOldValue:r.oldValue,subtree:r.subtree};t.length&&(l.attributeFilter=t.map(p=>p+"")),u.observe(n,l);let c=r.signalGenerator||r.lifecycleSignals&&this.createSignalGenerator(),f={context:n,spec:t,callback:i,params:r,atomics:new Map,originalFilterIsString:s,signalGenerator:c,disconnectable:u};return this.disconnectables(r.signal,u,c)}observeSync(t,i,r={}){let s=typeof t=="string"||t instanceof ot;[t,i,r={}]=this.resolveArgs(arguments);let{context:n,window:a}=this;if(r.timing&&!["sync","intercept"].includes(r.timing))throw new Error(`Timing option "${r.timing}" invalid.`);let o=r.timing==="intercept"?"intercept":"sync",u=r.subtree?"subtree":"children";this.registry(o).size||_s.call(a,o,g=>{this.forEachMatchingContext(o,g,vs)});let l={disconnect(){m.delete(f),m.size||p.delete(n)}},c=r.signalGenerator||r.lifecycleSignals&&this.createSignalGenerator(),f={context:n,spec:t,callback:i,params:r,atomics:new Map,originalFilterIsString:s,signalGenerator:c,disconnectable:l},p=this.registry(o,u);p.has(n)||p.set(n,new Set);let m=p.get(n);return m.add(f),this.disconnectables(r.signal,l,c)}};function Ss(e){return e.reduce((t,i,r)=>t[r-1]?.attributeName===i.attributeName?t:t.concat(i),[])}function vs(e,t){let{context:i,spec:r,callback:s,params:n,atomics:a,originalFilterIsString:o,signalGenerator:u}=e,l=r.map(p=>p+"");if(n.atomic&&!a.size?t=Es(i,r,t):n.timing!=="async"&&r.length&&(t=t.filter(p=>l.includes(p.name))),!t.length)return;n.newValue===null&&n.oldValue===null&&n.eventDetails||(t=t.map(p=>{let m;return n.eventDetails||({event:m,...p}=p),!n.oldValue&&"oldValue"in p&&({oldValue:m,...p}=p),!n.newValue&&"value"in p?{value:m,...p}=p:n.newValue&&typeof p.value>"u"&&(p={...p,value:p.target.getAttribute(p.name)}),p})),n.atomic&&(t.forEach(p=>a.set(p.name,p)),t=Array.from(a.entries()).map(([,p])=>p));let c=o?t[0]:t,f=u?.generate()||{};s(c,f,i)}function Es(e,t,i=[]){let r={event:null,type:"attribute"};return t.length?t.map(n=>(n=n+"",i.find(a=>a.name===n)||{target:e,name:n,value:e.getAttribute(n),...r})):Array.from(e.attributes).map(n=>i.find(a=>a.name===n.nodeName)||{target:e,name:n.nodeName,value:n.nodeValue,...r})}function Cs({target:e,attributeName:t,value:i,oldValue:r}){let a=(this.webqit.realdom.attrInterceptionRecords?.get(e)||{})[t]?.[0]||"mutation";return{target:e,name:t,value:i,oldValue:r,type:"observation",event:a}}function _s(e,t){let i=this,{webqit:r,document:s,Element:n}=i;r.realdom.attrInterceptionHooks||Object.defineProperty(r.realdom,"attrInterceptionHooks",{value:new Map}),r.realdom.attrInterceptionHooks.has(e)||r.realdom.attrInterceptionHooks.set(e,new Set),r.realdom.attrInterceptionHooks.get(e).add(t);let a=()=>r.realdom.attrInterceptionHooks.get(e).delete(t);if(r.realdom.attrInterceptionHooks?.intercepting)return a;console.warn("Attr mutation APIs are now being intercepted."),r.realdom.attrInterceptionHooks.intercepting=!0,Object.defineProperty(r.realdom,"attrInterceptionRecords",{value:new Map});let o=(c,f)=>{r.realdom.attrInterceptionRecords.has(c.target)||r.realdom.attrInterceptionRecords.set(c.target,{});let p=r.realdom.attrInterceptionRecords.get(c.target);p[c.name]=p[c.name]||[],p[c.name].unshift(c.event),r.realdom.attrInterceptionHooks.get("intercept")?.forEach(g=>g([c]));let m=f();return r.realdom.attrInterceptionHooks.get("sync")?.forEach(g=>g([c])),m};new i.MutationObserver(c=>{c=c.filter(f=>!(i.webqit.realdom.attrInterceptionRecords?.get(f.target)||{})[f.attributeName]?.shift()),c=Ss(c).map(f=>Cs.call(i,f)),c.length&&(r.realdom.attrInterceptionHooks.get("intercept")?.forEach(f=>f(c)),r.realdom.attrInterceptionHooks.get("sync")?.forEach(f=>f(c)))}).observe(s,{attributes:!0,subtree:!0,attributeOldValue:!0});let l=Object.create(null);return["setAttribute","removeAttribute","toggleAttribute"].forEach(c=>{l[c]=n.prototype[c],n.prototype[c]=function(...f){let p,m=this.getAttribute(f[0]);["setAttribute","toggleAttribute"].includes(c)&&(p=f[1]),c==="toggleAttribute"&&p===void 0&&(p=m===null);let g={target:this,name:f[0],value:p,oldValue:m,type:"interception",event:[this,c]};return o(g,()=>l[c].call(this,...f))}}),a}var De=class extends zt{constructor(t,...i){super(t,"tree",...i)}attr(t,i=void 0,r={}){let{context:s,window:n}=this;return new Lt(s,n).get(...arguments)}query(t,i=void 0,r={}){[t,i=void 0,r={}]=this.resolveArgs(arguments);let{context:s}=this,n=new Map,a=l=>(n.has(l)||n.set(l,{target:l,entrants:[],exits:[],type:"query",event:null}),n.get(l));if(!r.generation||r.generation==="entrants"){if(!t.length)[...s.children].forEach(l=>a(s).entrants.push(l));else if(t.every(l=>l.type==="selector")){let[l,c]=t.reduce(([p,m],g)=>g.kind==="xpath"?[p,m.concat(g)]:[p.concat(g),m],[[],[]]),f=[];r.subtree?(l.length&&f.push(...s.querySelectorAll(l.join(","))),c.length&&f.push(...ai(this.window,s,c))):(l.length&&f.push(...[...s.children].filter(p=>p.matches(l))),c.length&&f.push(...ai(this.window,s,c,!1))),f.forEach(p=>a(p.parentNode||s).entrants.push(p))}}if(!i)return n;let o={disconnected:!1},u=i&&r.lifecycleSignals&&this.createSignalGenerator();for(let[,l]of n){if(o.disconnected)break;let c=u?.generate()||{};i(l,c,s)}if(r.live){u&&(r={...r,signalGenerator:u});let l=this.observe(t,i,r);return this.disconnectables(r.signal,o,l)}return this.disconnectables(r.signal,o,u)}children(t,i=void 0,r={}){return[t,i=void 0,r={}]=this.resolveArgs(arguments),this.query(t,i,{...r,subtree:!1})}subtree(t,i=void 0,r={}){return[t,i=void 0,r={}]=this.resolveArgs(arguments),this.query(t,i,{...r,subtree:!0})}observe(t,i,r={}){if([t,i,r={}]=this.resolveArgs(arguments),["sync","intercept"].includes(r.timing))return this.observeSync(t,i,r);if(r.timing&&r.timing!=="async")throw new Error(`Timing option "${r.timing}" invalid.`);let{context:s,window:n,webqit:a,document:o}=this;r.eventDetails&&(a.realdom.domInterceptionRecordsAlwaysOn=!0),(o.readyState==="loading"||a.realdom.domInterceptionRecordsAlwaysOn)&&!a.realdom.domInterceptionHooks?.intercepting&&Ps.call(n,"sync",()=>{});let u=new n.MutationObserver(f=>f.forEach(p=>{Xi.call(n,c,As.call(n,p),s)}));u.observe(s,{childList:!0,subtree:r.subtree});let l=r.signalGenerator||r.lifecycleSignals&&this.createSignalGenerator(),c={context:s,spec:t,callback:i,params:r,signalGenerator:l,disconnectable:u};if(r.staticSensitivity){let f=ks.call(n,c);return this.disconnectables(r.signal,u,l,f)}return this.disconnectables(r.signal,u,l)}observeSync(t,i,r={}){[t,i,r={}]=this.resolveArgs(arguments);let{context:s,window:n}=this;if(r.timing&&!["sync","intercept"].includes(r.timing))throw new Error(`Timing option "${r.timing}" invalid.`);let a=r.timing==="intercept"?"intercept":"sync",o=r.subtree?"subtree":"children";this.registry(a).size||Ps.call(n,a,g=>{this.forEachMatchingContext(a,g,Xi)});let u=new n.MutationObserver(g=>g.forEach(y=>{Array.isArray((y=As.call(n,y)).event)||Xi.call(n,f,y,s)}));u.observe(s,{childList:!0,subtree:r.subtree});let l={disconnect(){u.disconnect(),m.delete(f),m.size||p.delete(s)}},c=r.signalGenerator||r.lifecycleSignals&&this.createSignalGenerator(),f={context:s,spec:t,callback:i,params:r,signalGenerator:c,disconnectable:l},p=this.registry(a,o);p.has(s)||p.set(s,new Set);let m=p.get(s);if(m.add(f),r.staticSensitivity){let g=ks.call(n,f);return this.disconnectables(r.signal,l,c,g)}return this.disconnectables(r.signal,l,c)}};function ks(e){let t=this,{context:i,spec:r,callback:s,params:n,signalGenerator:a}=e,o=r.filter(m=>m.kind==="css"),u=m=>m.match(/\.([\w-]+)/g)?.length?["class"]:[],l=m=>m.match(/#([\w-]+)/g)?.length?["id"]:[],c=m=>[...m.matchAll(/\[([^\=\]]+)(\=[^\]]+)?\]/g)].map(g=>g[1]).concat(u(m)).concat(l(m));if(!(e.$attrs=Array.from(new Set(o.filter(m=>(m+"").includes("[")).reduce((m,g)=>m.concat(c(g+"")),[])))).length)return;let f=new Set,p=new Set;return f.push=m=>(p.delete(m),f.add(m)),p.push=m=>(f.delete(m),p.add(m)),e.$deliveryCache={entrants:f,exits:p},new Lt(i,t).observe(e.$attrs,m=>{let g=new Map,y=b=>(g.has(b)||g.set(b,{target:b,entrants:[],exits:[],type:"static",event:null}),g.get(b)),v=new WeakMap,x=b=>(v.has(b)||v.set(b,o.some(_=>b.matches(_+""))),v.get(b));for(let b of m)["entrants","exits"].forEach(_=>{n.generation&&_!==n.generation||e.$deliveryCache[_].has(b.target)||(_==="entrants"?!x(b.target):x(b.target))||(e.$deliveryCache[_].push(b.target),y(b.target)[_].push(b.target),y(b.target).event=b.event)});for(let[,b]of g){let _=a?.generate()||{};s(b,_,i)}},{subtree:n.subtree,timing:n.timing,eventDetails:n.eventDetails})}function Xi(e,t){let{context:i,spec:r,callback:s,params:n,signalGenerator:a,$deliveryCache:o}=e,u={...t,entrants:[],exits:[]};if(n.eventDetails||delete u.event,["entrants","exits"].forEach(c=>{if(!(n.generation&&c!==n.generation)&&(r.length?u[c]=Zn.call(this,r,t[c],t.event!=="parse"):u[c]=[...t[c]],!!o))for(let f of u[c])o[c].push(f)}),!u.entrants.length&&!u.exits.length)return;let l=a?.generate()||{};s(u,l,i)}function Zn(e,t,i){t=Array.isArray(t)?t:[...t];let r=(s,n)=>{if(n.type==="selector"){let a=n.isXpathAttr?[]:s.filter(o=>n.kind==="xpath"?xs(this,o,n+""):o.matches&&o.matches(n+""));if((i||n.isXpathAttr)&&(a=s.reduce((o,u)=>n.kind==="xpath"?[...o,...ai(this,u,n,i)]:u.querySelectorAll?[...o,...u.querySelectorAll(n+"")]:o,a)),a.length)return a}else if(s.includes(n.content)||i&&s.some(a=>a.contains(n.content)))return[n.content]};return t.$$searchCache||(t.$$searchCache=new Map),e.reduce((s,n)=>{let a;return t.$$searchCache.has(n.content)?a=t.$$searchCache.get(n.content):(a=r(t,n)||[],n.type==="instance"&&t.$$searchCache.set(n.content,a)),s.concat(a)},[])}function As({target:e,addedNodes:t,removedNodes:i}){let r=this,s;return s=B(t).reduce((n,a)=>n||r.webqit.realdom.domInterceptionRecords?.get(a),null),s=B(i).reduce((n,a)=>n||r.webqit.realdom.domInterceptionRecords?.get(a),s),s=s||r.document.readyState==="loading"&&"parse"||"mutation",{target:e,entrants:t,exits:i,type:"observation",event:s}}function Ps(e,t){let i=this,{webqit:r,document:s,Node:n,CharacterData:a,Element:o,HTMLElement:u,HTMLTemplateElement:l,DocumentFragment:c}=i;r.realdom.domInterceptionHooks||Object.defineProperty(r.realdom,"domInterceptionHooks",{value:new Map}),r.realdom.domInterceptionHooks.has(e)||r.realdom.domInterceptionHooks.set(e,new Set),r.realdom.domInterceptionHooks.get(e).add(t);let f=()=>r.realdom.domInterceptionHooks.get(e).delete(t);if(r.realdom.domInterceptionHooks?.intercepting)return f;console.warn("DOM mutation APIs are now being intercepted."),r.realdom.domInterceptionHooks.intercepting=!0,Object.defineProperty(r.realdom,"domInterceptionRecords",{value:new Map});let p=(y,v)=>{y.entrants.concat(y.exits).forEach(b=>{clearTimeout(r.realdom.domInterceptionRecords.get(b)?.timeout),r.realdom.domInterceptionRecords.set(b,y.event);let _=setTimeout(()=>{r.realdom.domInterceptionRecords.delete(b)},0);Object.defineProperty(y.event,"timeout",{value:_,configurable:!0})}),r.realdom.domInterceptionHooks.get("intercept")?.forEach(b=>b(y));let x=v();return r.realdom.domInterceptionHooks.get("sync")?.forEach(b=>b(y)),x},m={characterData:Object.create(null),other:Object.create(null)};["insertBefore","insertAdjacentElement","insertAdjacentHTML","setHTML","replaceChildren","replaceWith","remove","replaceChild","removeChild","before","after","append","prepend","appendChild"].forEach(y=>{function v(...x){let b=this instanceof a?m.characterData:m.other,_=()=>b[y].call(this,...x);if(!(this instanceof a||this instanceof o||this instanceof c))return _();let A=[],N=[],U=this;["insertBefore"].includes(y)?N=[x[0]]:["insertAdjacentElement","insertAdjacentHTML"].includes(y)?(N=[x[1]],["beforebegin","afterend"].includes(x[0])&&(U=this.parentNode)):["setHTML","replaceChildren"].includes(y)?(A=[...this.childNodes],N=y==="replaceChildren"?[...x]:[x[0]]):["replaceWith","remove"].includes(y)?(A=[this],N=y==="replaceWith"?[...x]:[],U=this.parentNode):["replaceChild"].includes(y)?(A=[x[1]],N=[x[0]]):["removeChild"].includes(y)?A=[...x]:(N=[...x],["before","after"].includes(y)&&(U=this.parentNode));let W=y;if(["insertAdjacentHTML","setHTML"].includes(y)){let w=this.nodeName;if(y==="insertAdjacentHTML"&&["beforebegin","afterend"].includes(x[0])){if(!this.parentNode)return b[y].call(this,...x);w=this.parentNode.nodeName}let E=s.createElement(w);b.setHTML.call(E,N[0],y==="setHTML"?x[1]:{}),N=[...E.childNodes],y==="insertAdjacentHTML"?(W="insertAdjacentElement",x[1]=new c,x[1].______isTemp=!0,x[1].append(...E.childNodes)):(W="replaceChildren",x=[...E.childNodes])}return p({target:U,entrants:N,exits:A,type:"interception",event:[this,y]},()=>b[W].call(this,...x))}["insertBefore","replaceChild","removeChild","appendChild"].includes(y)?(m.other[y]=n.prototype[y],n.prototype[y]=v):(["after","before","remove","replaceWith"].includes(y)&&(m.characterData[y]=a.prototype[y],a.prototype[y]=v),o.prototype[y]&&(m.other[y]=o.prototype[y],o.prototype[y]=v))});let g=Object.create(null);return["outerHTML","outerText","innerHTML","innerText","textContent","nodeValue"].forEach(y=>{let v=["textContent","nodeValue"].includes(y)?n:["outerText","innerText"].includes(y)?u:o;g[y]=Object.getOwnPropertyDescriptor(v.prototype,y),Object.defineProperty(v.prototype,y,{...g[y],set:function(x){let b=()=>g[y].set.call(this,x);if(!(this instanceof o))return b();let _=[],A=[],N=this;if(["outerHTML","outerText"].includes(y)?(_=[this],N=this.parentNode):_=[...this.childNodes],["outerHTML","innerHTML"].includes(y)){let W=this.nodeName;if(y==="outerHTML"){if(!this.parentNode)return b();W=this.parentNode.nodeName}let yt=s.createElement(W==="TEMPLATE"?"div":W);g[y].set.call(yt,x),A=this instanceof l?[]:[...yt.childNodes],y==="outerHTML"?(x=new c,x.______isTemp=!0,x.append(...yt.childNodes),b=()=>o.prototype.replaceWith.call(this,x)):this instanceof l?b=()=>this.content.replaceChildren(...yt.childNodes):b=()=>o.prototype.replaceChildren.call(this,...yt.childNodes)}return p({target:N,entrants:A,exits:_,type:"interception",event:[this,y]},b)}})}),["append","prepend","replaceChildren"].forEach(y=>{[s,c.prototype].forEach(v=>{let x=v[y];v[y]=function(...b){if(this.______isTemp)return x.call(this,...b);let _=y==="replaceChildren"?[...this.childNodes]:[];return p({target:this,entrants:b,exits:_,type:"interception",event:[this,y]},()=>x.call(this,...b))}})}),f}function Is(){ta.call(this),ea.call(this),ia.call(this)}function ta(){let e=this;e.CSS||(e.CSS={}),e.CSS.escape||(e.CSS.escape=t=>t.replace(/([\:@\~\$\&])/g,"\\$1"))}function ea(){let e=this;"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 ia(){let e=this;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 Os(){let e=this;if(e.webqit||(e.webqit={}),e.webqit.realdom)return e.webqit.realdom;e.webqit.realdom={},Is.call(e),e.webqit.realdom.meta=(...i)=>ra.call(e,...i),e.webqit.realdom.ready=(...i)=>Ki.call(e,...i),e.webqit.realdom.realtime=(i,r="dom")=>{if(r==="dom")return new De(i,e);if(r==="attr")return new Lt(i,e)};let t=new Ve(e);return e.webqit.realdom.schedule=(i,...r)=>t[`on${i}`](...r),e.webqit.realdom.synthesizeWhile=(...i)=>t.synthesizeWhile(...i),e.webqit.realdom}function Ki(...e){let t="interactive",i;Jt(e[0])?(t=e[0],V(e[1])&&(i=e[1])):V(e[0])&&(i=e[0]);let r={interactive:["interactive","complete"],complete:["complete"]};if(!r[t])throw new Error(`Invalid ready-state timing: ${t}.`);let s=this;if(!i)return s.webqit.realdom.readyStatePromises||(s.webqit.realdom.readyStatePromises={interactive:new Promise(n=>Ki.call(this,"interactive",n)),complete:new Promise(n=>Ki.call(this,"complete",n))}),s.webqit.realdom.readyStatePromises[t];if(r[t].includes(s.document.readyState))return i(s);s.webqit.realdom.readyStateCallbacks||(s.webqit.realdom.readyStateCallbacks={interactive:[],complete:[]},s.document.addEventListener("readystatechange",()=>{let n=s.document.readyState;for(let a of s.webqit.realdom.readyStateCallbacks[n].splice(0))a(s)},!1)),s.webqit.realdom.readyStateCallbacks[t].push(i)}function ra(e){let t=this,i={},r;return(r=t.document.querySelector(`meta[name="${e}"]`))&&(i=(r.content||"").split(";").filter(s=>s).reduce((s,n)=>{let a=n.split("=").map(o=>o.trim());return Qi(s,a[0].split("."),a[1]==="true"?!0:a[1]==="false"?!1:it(a[1])?parseInt(a[1]):a[1]),s},{})),{get name(){return e},get content(){return r.content},json(){return JSON.parse(JSON.stringify(i))}}}function oi(e,t){return typeof e!="string"?e:e.replace(/\w\S*/g,function(i){return i.charAt(0).toUpperCase()+(typeof t!==void 0&&t?i.substr(1).toLowerCase():i.substr(1))})}var S=(...e)=>Ot("oohtml",...e),j={};function Z(e,t,i){let r=this,s=Os.call(r);j.window=r,r.webqitConfig||(r.webqitConfig=s.meta("webqit").json()),r.webqit||(r.webqit={}),r.webqit.oohtml||(r.webqit.oohtml={}),r.webqit.oohtml.configs||(r.webqit.oohtml.configs={});let n=e.toUpperCase().replace("-","_");if(!r.webqit.oohtml.configs[n]){r.webqit.oohtml.configs[n]={};let a=r.webqit.oohtml.configs[n];pe(2,a,i,t,s.meta(e).json()),r.webqitConfig.prefix&&Object.keys(a).forEach(o=>{Object.keys(a[o]).forEach(u=>{o==="api"&&typeof a[o][u]=="string"?a[o][u]=`${r.webqitConfig.prefix}${oi(a[o][u])}`:["attr","elements"].includes(o)&&a[o][u]?.startsWith("data-")===!1&&(a[o][u]=`${r.webqitConfig.prefix}-${a[o][u]}`)})})}return{config:r.webqit.oohtml.configs[n],realdom:s,window:r}}function ae(e,t){return[...e].reduce(([i,r,s],n)=>!i&&r===0&&(Array.isArray(t)?t:[t]).includes(n)?[i,r,[""].concat(s)]:(!i&&["(","[","{"].includes(n)&&!s[0].endsWith("\\")&&r++,!i&&[")","]","}"].includes(n)&&!s[0].endsWith("\\")&&r--,['"',"'","`"].includes(n)&&!s[0].endsWith("\\")&&(i=i===n?null:i||n),s[0]+=n,[i,r,s]),[null,0,[""]])[2].reverse()}var aa=()=>(0|Math.random()*9e6).toString(36),Yi=new Map;function Gt(e){let t;return(t=Yi.get(e))||(t=aa(),Yi.set(e,t)),t}function ui(e){let t;return Yi.forEach((i,r)=>{i===e&&(t=r)}),t}function li(){let{window:e}=j,{webqit:t}=e;if(t.DOMContextRequestEvent)return t.DOMContextRequestEvent;class i extends e.Event{constructor(...s){let n=s.pop();if(typeof n!="function")throw new Error("Callback must be provided.");let a=s.pop();if(!a?.kind)throw new Error('"options.kind" must be specified.');let o=["contextrequest","contextclaim"],u=s.pop()||o[0];if(!o.includes(u))throw new Error(`Invalid event type. Must be one of: ${o.join(",")}`);let{kind:l,detail:c,targetContext:f,live:p,signal:m,diff:g,...y}=a;super(u,{...y,bubbles:y.bubbles!==!1}),Object.defineProperty(this,"callback",{get:()=>n}),Object.defineProperty(this,"kind",{get:()=>l}),Object.defineProperty(this,"targetContext",{get:()=>f}),Object.defineProperty(this,"detail",{get:()=>c}),Object.defineProperty(this,"live",{get:()=>p}),Object.defineProperty(this,"signal",{get:()=>m}),Object.defineProperty(this,"diff",{get:()=>g}),Object.defineProperty(this,"options",{get:()=>y})}respondWith(s){if(this.diff){if("_prevValue"in this&&this._prevValue===s)return;Object.defineProperty(this,"_prevValue",{value:s,configurable:!0})}return this.callback(s)}}return t.DOMContextRequestEvent=i,i}var Qt=class extends AbortController{constructor(t){super(),t(i=>{let{window:{webqit:{Observer:r}}}=j;r.defineProperty(this,"value",{value:i,configurable:!0,enumerable:!0})},this)}};var Xt=class extends Error{};var kt=class{static instance(t){return S(t).get("contexts::instance")||new this(t)}constructor(t){S(t).get("contexts::instance")?.dispose(),S(t).set("contexts::instance",this);let i={host:t,contexts:new Set};Object.defineProperty(this,"#",{get:()=>i})}get[Symbol.iterator](){return this["#"].contexts[Symbol.iterator]}get length(){return this["#"].contexts.size}find(...t){return[...this["#"].contexts].find(i=>typeof t[0]=="function"?t[0](i):i.constructor.kind===t[0]&&(t.length===1||i.detail===t[1]))}attach(t){if(!(t instanceof tt))throw new TypeError("Context is not a valid DOMContext instance.");if(this.find(t.constructor.kind,t.detail))throw new Xt(`Context of same kind "${t.constructor.kind}"${t.detail?` and detail "${t.detail}"`:""} already exists.`);this["#"].contexts.add(t),t.initialize(this["#"].host)}detach(t){t.dispose(this["#"].host),this["#"].contexts.delete(t)}request(...t){return new Qt((i,r)=>{typeof t[t.length-1]!="function"&&(t[t.length-1]?t.push(i):t[t.length-1]=i);let s;(s=t.find(a=>typeof a=="object"&&a))&&s.live&&(s.signal&&s.signal.addEventListener("abort",()=>r.abort()),t[t.indexOf(s)]={...s,signal:r.signal});let n=new(li())(...t);this["#"].host.dispatchEvent(n)})}};var Ji=class{static createRequest(){return{kind:this.kind}}constructor(t=null){Object.defineProperty(this,"detail",{get:()=>t}),Object.defineProperty(this,"subscriptions",{value:new Set})}get configs(){let{window:{webqit:{oohtml:{configs:t}}}}=j;return t}get name(){return this.host===j.window.document?1/0:this.host.getAttribute(this.configs.CONTEXT_API.attr.contextname)}subscribed(t){}handle(t){}unsubscribed(t){}matchEvent(t){return t.kind===this.constructor.kind&&(!t.targetContext||t.targetContext===this.name)}handleEvent(t){if(!(this.disposed||typeof t.respondWith!="function")){if(t.type==="contextclaim"){if(t.target===this.host||!(t.detail instanceof Ji))return;let i=new Set;return this.subscriptions.forEach(r=>{!t.target.contains(r.target)||!t.detail.matchEvent(r)||(t.stopPropagation(),this.subscriptions.delete(r),i.add(r))}),t.respondWith(i)}if(t.type==="contextrequest")return this.matchEvent(t)?(t.live&&(this.subscriptions.add(t),this.subscribed(t),t.signal?.addEventListener("abort",()=>{this.subscriptions.delete(t),this.unsubscribed(t)})),t.stopPropagation(),this.handle(t)):void 0}}initialize(t){this.host=t,this.disposed=!1,t.addEventListener("contextrequest",this),t.addEventListener("contextclaim",this);let{value:i}=kt.instance(t).request("contextclaim",{kind:this.constructor.kind,detail:this});return i?.forEach(r=>{this.subscriptions.add(r),this.subscribed(r),this.handle(r)}),this}dispose(t){return this.disposed=!0,t.removeEventListener("contextrequest",this),t.removeEventListener("contextclaim",this),this.subscriptions.forEach(i=>{this.subscriptions.delete(i),this.unsubscribed(i);let{target:r}=i;r.dispatchEvent(i)}),this}},tt=Ji;G(tt,"kind");var oe=class extends tt{static createRequest(t=null){let i=super.createRequest();if(t?.startsWith("@")){let[r,...s]=s.slice(1).split("/").map(n=>n.trim());i.targetContext=r,i.detail=s.join("/")}else i.detail=t;return i}get namespaceObj(){return this.host[this.configs.NAMESPACED_HTML.api.namespace]}handle(t){let{window:{webqit:{Observer:i}}}=j;if(t._controller?.abort(),!(t.detail||"").trim())return t.respondWith(i.unproxy(this.namespaceObj));let r=(t.detail||"").split("/").map(s=>s.trim()).filter(s=>s);if(!r.length)return t.respondWith();r=r.join(`/${this.configs.NAMESPACED_HTML.api.namespace}/`)?.split("/")||[],t._controller=i.reduce(this.namespaceObj,r,i.get,s=>{this.disposed||t.respondWith(s.value)},{live:t.live,signal:t.signal,descripted:!0})}unsubscribed(t){t._controller?.abort()}};G(oe,"kind","namespace");function Zi(e={}){let{config:t,window:i}=Z.call(this,"namespaced-html",e,{attr:{namespace:"namespace",lid:"id"},api:{namespace:"namespace"},tokens:{lidrefPrefix:"~",lidrefSeparator:":"},target:{attr:":target",event:":target",scrolling:!0}});t.lidSelector=`[${i.CSS.escape(t.attr.lid)}]`,t.namespaceSelector=`[${i.CSS.escape(t.attr.namespace)}]`,i.webqit.DOMNamingContext=oe,oa.call(i,t),ua.call(i,t)}function ci(e,t=null,i=!1){let r=this,{webqit:{oohtml:{configs:{NAMESPACED_HTML:s}}}}=r,{lidrefPrefix:n,lidrefSeparator:a}=s.tokens,o=new RegExp(`${t?":scope|":""}#${[...n].map(f=>/\w/.test(f)?f:i?`\\\\${f}`:`\\${f}`).join("")}([\\w-]|\\\\.)+`,"g"),[u,l]=ae(e,",").reduce(([f,p],m)=>{let g,y;return m=m.replace(o,(v,x,b)=>{if(g||(g=[...m.matchAll(/(["'])(?:(?=(\\?))\2.)*?\1/g)]),g.some(A=>b>A.index&&b+v.length<A.index+v.length))return v;if(v===":scope")return y=!0,t;let _=v.replace(`#${i?[...n].map(A=>/\w/.test(A)?A:`\\${A}`).join(""):n}`,"");return s.attr.lid==="id"?`[id^="${n}"][id$="${a}${_}"]`:`[${r.CSS.escape(s.attr.lid)}="${_}"]`}),y?[f,p.concat(m)]:[f.concat(m),p]},[[],[]]),c;return t&&u.length?c=[u.length>1?`${t} :is(${u.join(", ")})`:`${t} ${u[0]}`,l.join(", ")].filter(f=>f).join(", "):c=[...u,...l].join(", "),c}function Ns(e){if(!S(e).has("namespace")){let t=Object.create(null);S(e).set("namespace",t)}return S(e).get("namespace")}function oa(e){let t=this,{webqit:{Observer:i}}=t;if(e.api.namespace in t.document)throw new Error(`document already has a "${e.api.namespace}" property!`);if(e.api.namespace in t.Element.prototype)throw new Error(`The "Element" class already has a "${e.api.namespace}" property!`);Object.defineProperty(t.document,e.api.namespace,{get:function(){return i.proxy(Ns.call(t,t.document))}}),Object.defineProperty(t.Element.prototype,e.api.namespace,{get:function(){return i.proxy(Ns.call(t,this))}})}function ua(e){let t=this,{webqit:{Observer:i,realdom:r,oohtml:{configs:s},DOMNamingContext:n}}=t,{lidrefPrefix:a,lidrefSeparator:o}=e.tokens;t.document[s.CONTEXT_API.api.contexts].attach(new n),r.realtime(t.document).subtree(e.namespaceSelector,w=>{w.exits.forEach(E=>{let O=E[s.CONTEXT_API.api.contexts],z=O.find(n.kind);z&&O.detach(z)}),w.entrants.forEach(E=>{let O=E[s.CONTEXT_API.api.contexts];O.find(n.kind)||O.attach(new n)})},{live:!0,timing:"sync",staticSensitivity:!0});let u=["aria-owns","aria-controls","aria-labelledby","aria-describedby","aria-flowto"],l=["for","list","form","aria-activedescendant","aria-details","aria-errormessage"],c=[e.attr.lid,...u,...l],f={id:"id",for:"htmlFor","aria-owns":"ariaOwns","aria-controls":"ariaControls","aria-labelledby":"ariaLabelledBy","aria-describedby":"ariaDescribedBy","aria-flowto":"ariaFlowto","aria-activedescendant":"ariaActiveDescendant","aria-details":"ariaDetails","aria-errormessage":"ariaErrorMessage"},p=w=>w.startsWith(a)&&w.includes(o),m=w=>w.startsWith(a)&&!w.includes(o),g=(w,E)=>`${a}${w}${o}${E}`,y=w=>p(w)?w.split(o)[1]:w,v=w=>p(w)?`${a}${w.split(o)[1]}`:w,x=Object.getOwnPropertyDescriptor(t.Element.prototype,"getAttribute");Object.defineProperty(t.Element.prototype,"getAttribute",{...x,value(w){let E=x.value.call(this,w);return!S(this,"lock").get(w)&&c.includes(w)?(w==="id"?y:v)(E):E}});let b=Object.getOwnPropertyDescriptor(t.Document.prototype,"getElementById");Object.defineProperty(t.Document.prototype,"getElementById",{...b,value(w){return m(w)?this.querySelector(ci.call(t,`#${w}`)):b.value.call(this,w)}});for(let w of["querySelector","querySelectorAll"])for(nodeApi of[t.Document,t.Element]){let E=Object.getOwnPropertyDescriptor(nodeApi.prototype,w);Object.defineProperty(nodeApi.prototype,w,{...E,value(O){return E.value.call(this,ci.call(t,O))}})}for(let w of c){if(!(w in f))continue;let E=w==="for"?[t.HTMLLabelElement,t.HTMLOutputElement]:[t.Element];for(let O of E){let z=Object.getOwnPropertyDescriptor(O.prototype,f[w]);!z||Object.defineProperty(O.prototype,f[w],{...z,get(){return(w==="id"?y:v)(z.get.call(this,w)||"")}})}}e.attr.lid!=="id"&&Object.defineProperty(t.Element.prototype,e.attr.lid,{configurable:!0,enumerable:!0,get(){return this.getAttribute(e.attr.lid)},set(w){return this.setAttribute(e.attr.lid,w)}});let _=(w,E,O)=>{if(S(w,"lock").get(E))return;S(w,"lock").set(E,!0),typeof O=="function"&&(O=O());let z=S(w).get("ownerNamespace");if(E===e.attr.lid){let Rt=y(O);i.get(z,Rt)===w&&i.deleteProperty(z,Rt)}else{let Rt=O.split(" ").map(xt=>(xt=xt.trim())&&v(xt)).join(" ");w.setAttribute(E,Rt)}S(w,"lock").delete(E)},A=(w,E,O)=>{if(S(w,"lock").get(E))return;S(w,"lock").set(E,!0),typeof O=="function"&&(O=O());let z=S(w).get("ownerNamespace"),Rt=S(w).get("namespaceUUID");if(E===e.attr.lid){let xt=y(O);i.get(z,xt)!==w&&(w.setAttribute("id",g(Rt,xt)),i.set(z,xt,w))}else{let xt=O.split(" ").map(le=>(le=le.trim())&&!m(le)?le:g(Rt,le.replace(a,""))).join(" ");w.setAttribute(E,xt)}S(w,"lock").delete(E)},N=(w,E=!0)=>{for(let O of c)!w.hasAttribute(O)||_(w,O,()=>w.getAttribute(O));S(w).delete("ownerNamespace"),S(w).delete("namespaceUUID"),E&&(S(w).get("namespaceBinding").abort(),S(w).delete("namespaceBinding"))},U=w=>{if(!S(w).get("ownerNamespace")){let E={...n.createRequest(),live:!0},O=w.parentNode[s.CONTEXT_API.api.contexts].request(E,z=>{S(w).get("namespaceUUID")&&N(w,!1),S(w).set("ownerNamespace",z),S(w).set("namespaceUUID",ui(z)||Gt(z)),U(w)});S(w).set("namespaceBinding",O);return}for(let E of c)!w.hasAttribute(E)||A(w,E,()=>w.getAttribute(E))};r.realtime(t.document).subtree(`[${c.map(w=>t.CSS.escape(w)).join("],[")}]`,w=>{w.exits.forEach(N),w.entrants.forEach(U)},{live:!0,timing:"sync"}),r.realtime(t.document,"attr").observe(c,w=>{for(let E of w)E.oldValue?(_(E.target,E.name,E.oldValue),E.value&&A(E.target,E.name,E.value)):U(entry)},{subtree:!0,timing:"sync",newValue:!0,oldValue:!0});let W,yt=()=>{if(!t.location.hash?.startsWith(`#${a}`))return;let w=t.location.hash?.substring(`#${a}`.length).split("/").map(O=>O.trim()).filter(O=>O)||[],E=w.reduce((O,z)=>O&&O[e.api.namespace][z],t.document);W&&e.target.attr&&W.toggleAttribute(e.target.attr,!1),E&&E!==t.document&&(e.target.attr&&E.toggleAttribute(e.target.attr,!0),e.target.event&&E.dispatchEvent(new t.CustomEvent(e.target.event)),e.target.scrolling&&w.length>1&&E.scrollIntoView(),W=E)};t.addEventListener("hashchange",yt),r.ready(yt)}function tr({advanced:e={},...t}){let{config:i,window:r}=Z.call(this,"scoped-css",t,{api:{styleSheets:"styleSheets"},style:{retention:"retain",mimeType:"",strategy:null}});i.styleSelector=(Array.isArray(i.style.mimeType)?i.style.mimeType:[i.style.mimeType]).reduce((s,n)=>{let a=n?`[type=${r.CSS.escape(n)}]`:"";return s.concat(`style${a}[scoped]`)},[]).join(","),r.webqit.oohtml.Style={compileCache:new Map},la.call(r,i),ca.call(r,i)}function la(e){let t=this,i=new Map;if(e.api.styleSheets in t.Element.prototype)throw new Error(`The "Element" class already has a "${e.api.styleSheets}" property!`);Object.defineProperty(t.HTMLElement.prototype,e.api.styleSheets,{get:function(){return i.has(this)||i.set(this,[]),i.get(this)}}),Object.defineProperty(t.HTMLStyleElement.prototype,"scoped",{configurable:!0,get(){return this.hasAttribute("scoped")},set(r){this.toggleAttribute("scoped",r)}})}function ca(e){let t=this,{webqit:{oohtml:i,realdom:r}}=t;t.CSS.supports||(t.CSS.supports=()=>!1);let s=new WeakSet;r.realtime(t.document).subtree(e.styleSelector,n=>{n.entrants.forEach(a=>{if(s.has(a)||(s.add(a),!a.scoped))return;let o=Gt(a.textContent),u,l=CSS.supports("selector(:has(a,b))");if(!(u=i.Style.compileCache.get(o))){let c=l?`:has(> style[rand-${o}])`:`[rand-${o}]`;u=ha.call(t,a,c),i.Style.compileCache.set(o,u)}a.parentNode[e.api.styleSheets].push(a),Object.defineProperty(a,"sheet",{value:u,configurable:!0}),(l?a:a.parentNode).toggleAttribute(`rand-${o}`,!0),a.textContent=`
|
|
16
|
+
/*[ Shared style sheet ]*/
|
|
17
|
+
`})},{live:!0,timing:"intercept",generation:"entrants"})}function ha(e,t){let i=this,r=e.textContent,s=i.CSSScopeRule&&!1,n,a=s?`@scope (${t}) {
|
|
18
|
+
${r.trim()}
|
|
19
|
+
}`:r.trim();try{n=new i.CSSStyleSheet,n.replaceSync(a),$s(n,!s&&t),document.adoptedStyleSheets.push(n)}catch{let u=i.document.createElement("style");i.document.body.appendChild(u),u.textContent=a,n=u.sheet,$s(n,!s&&t)}return n}function $s(e,t=null){let i=e?.cssRules.length||-1;for(let r=0;r<i;++r){let s=e.cssRules[r];s instanceof CSSImportRule||Ls(s,t)}}function Ls(e,t=null){if(e instanceof CSSStyleRule){Rs(e,t);return}if([window.CSSScopeRule,window.CSSMediaRule,window.CSSContainerRule,window.CSSSupportsRule,window.CSSLayerBlockRule].some(i=>i&&e instanceof i)){let i=e.cssRules.length;for(let r=0;r<i;++r)Ls(e.cssRules[r],t)}}function Rs(e,t=null){let i=ci(e.selectorText,t,!0);if(e.selectorText=i,e.cssRules){let r=e.cssRules.length;for(let s=0;s<r;++s)Rs(e.cssRules[s])}}function er({advanced:e={},...t}){let{config:i,window:r}=Z.call(this,"scoped-js",t,{script:{retention:"retain",mimeType:""},api:{scripts:"scripts"},advanced:si(e)});i.scriptSelector=(Array.isArray(i.script.mimeType)?i.script.mimeType:[i.script.mimeType]).reduce((s,n)=>{let a=n?`[type=${r.CSS.escape(n)} ]`:"";return s.concat(`script${a}[scoped],script${a}[quantum]`)},[]).join(","),r.webqit.oohtml.Script={compileCache:[new Map,new Map],execute:pa.bind(r,i)},fa.call(r,i),da.call(r,i)}function fa(e){let t=this,i=new Map;if(e.api.scripts in t.Element.prototype)throw new Error(`The "Element" class already has a "${e.api.scripts}" property!`);Object.defineProperty(t.HTMLElement.prototype,e.api.scripts,{get:function(){return i.has(this)||i.set(this,[]),i.get(this)}}),Object.defineProperties(t.HTMLScriptElement.prototype,{scoped:{configurable:!0,get(){return this.hasAttribute("scoped")},set(r){this.toggleAttribute("scoped",r)}},quantum:{configurable:!0,get(){return this.hasAttribute("quantum")},set(r){this.toggleAttribute("quantum",r)}}})}async function pa(e,t){let i=this,{realdom:r}=i.webqit,s=ui(t);if(!s)throw new Error("Argument must be a valid exec hash.");let{script:n,compiledScript:a,thisContext:o}=s;e.script.retention==="dispose"?n.remove():e.script.retention==="dispose"?n.textContent='"source hidden"':n.textContent=await a.toString();let u=(await a.bind(o)).execute();n.quantum&&Object.defineProperty(n,"state",{value:u}),r.realtime(i.document).observe(n,()=>{n.quantum&&u.dispose(),n.scoped&&o[e.api.scripts].splice(o[e.api.scripts].indexOf(n,1))},{subtree:!0,timing:"sync",generation:"exits"})}function da(e){let t=this,{webqit:{oohtml:i,realdom:r,QuantumScript:s,QuantumAsyncScript:n,QuantumModule:a}}=t;t.HTMLScriptElement.supports||(t.HTMLScriptElement.supports=()=>!1);let o=["module"].concat(e.script.mimeType||[]),u=new WeakSet;r.realtime(t.document).subtree(e.scriptSelector,l=>{l.entrants.forEach(c=>{if(u.has(c))return;u.add(c);let f=(c._=c.textContent.trim())&&c._.startsWith("/*@oohtml*/if(false){")&&c._.endsWith("}/*@oohtml*/")?c._.slice(21,-12):c.textContent,p=Gt(f),m=i.Script.compileCache[c.quantum?0:1],g;if(!(g=m.get(p))){let{parserParams:b,compilerParams:_,runtimeParams:A}=e.advanced;g=new(c.type==="module"?a:s||n)(f,{exportNamespace:`#${c.id}`,fileName:`${t.document.url?.split("#")?.[0]||""}#${c.id}`,parserParams:b,compilerParams:{..._,startStatic:!c.quantum},runtimeParams:A}),m.set(p,g)}let y=c.scoped?c.parentNode||l.target:c.type==="module"?void 0:t;c.scoped&&y[e.api.scripts].push(c);let v=Gt({script:c,compiledScript:g,thisContext:y});l.type==="query"||o.includes(c.type)&&!t.HTMLScriptElement.supports(c.type)?i.Script.execute(v):c.textContent=`webqit.oohtml.Script.execute( '${v}' );`})},{live:!0,timing:"intercept",generation:"entrants",eventDetails:!0})}function ir(e={}){let{config:t,window:i}=Z.call(this,"context-api",e,{attr:{contextname:"contextname"},api:{contexts:"contexts"}});i.webqit.DOMContexts=kt,i.webqit.DOMContext=tt,i.webqit.DOMContextRequestEvent=li(),i.webqit.DOMContextResponse=Qt,i.webqit.DuplicateContextError=Xt,ma.call(i,t)}function ma(e){let t=this;if(e.api.contexts in t.document)throw new Error(`document already has a "${e.api.contexts}" property!`);if(e.api.contexts in t.HTMLElement.prototype)throw new Error(`The "HTMLElement" class already has a "${e.api.contexts}" property!`);Object.defineProperty(t.document,e.api.contexts,{get:function(){return kt.instance(t.document)}}),Object.defineProperty(t.HTMLElement.prototype,e.api.contexts,{get:function(){return kt.instance(this)}});let i=new Set;t.addEventListener("contextrequest",r=>{typeof r.respondWith=="function"&&(i.add(r),r.respondWith())}),t.addEventListener("contextclaim",r=>{if(typeof r.detail!="object"||typeof r.detail.matchEvent!="function"||typeof r.respondWith!="function")return;let s=new Set;i.forEach(n=>{!r.target.contains(n.target)||!r.detail.matchEvent(n)||(i.delete(n),s.add(n))}),r.respondWith(s)})}var At=class extends tt{static createRequest(t=null){let i=super.createRequest();if(t?.startsWith("@")){let[r,...s]=s.slice(1).split(".").map(n=>n.trim());i.targetContext=r,i.detail=s.join(".")}else i.detail=t;return i}get bindingsObj(){return this.host[this.configs.BINDINGS_API.api.bindings]}matchEvent(t){return super.matchEvent(t)&&(!t.detail||!this.detail||(Array.isArray(t.detail)?t.detail[0]===this.detail:t.detail===this.detail))}handle(t){if(t._controller?.abort(),!(t.detail+"").trim())return t.respondWith(this.bindingsObj);let{window:{webqit:{Observer:i}}}=j;t._controller=i.reduce(this.bindingsObj,Array.isArray(t.detail)?t.detail:[t.detail],i.get,r=>{this.disposed||t.respondWith(r.value)},{live:t.live,signal:t.signal,descripted:!0})}unsubscribed(t){t._controller?.abort()}};G(At,"kind","bindings");function sr(e={}){let{config:t,window:i}=Z.call(this,"bindings-api",e,{attr:{bindingsreflection:"bindings"},api:{bind:"bind",bindings:"bindings"}});i.webqit.DOMBindingsContext=At,ga.call(i,t)}function rr(e,t){let i=this,{webqit:{Observer:r,oohtml:{configs:{CONTEXT_API:s}}}}=i;if(!S(t).has("bindings")){let n=Object.create(null);S(t).set("bindings",n),r.observe(n,a=>{let o=Object.keys(n),u=t===i.document?i.document.documentElement:t,l=e.attr.bindingsreflection;o.length&&l?u.setAttribute(e.attr.bindingsreflection,o.join(" ")):l&&u.toggleAttribute(e.attr.bindingsreflection,!1);let c=t[s.api.contexts];for(let f of a)if(f.type==="delete"){let p=c.find(At.kind,f.key);p&&c.detach(p)}else c.find(At.kind,f.key)||c.attach(new At(f.key))})}return S(t).get("bindings")}function ga(e){let t=this,{webqit:{Observer:i}}=t;if(e.api.bind in t.document)throw new Error(`document already has a "${e.api.bind}" property!`);if(e.api.bindings in t.document)throw new Error(`document already has a "${e.api.bindings}" property!`);if(e.api.bind in t.Element.prototype)throw new Error(`The "Element" class already has a "${e.api.bind}" property!`);if(e.api.bindings in t.Element.prototype)throw new Error(`The "Element" class already has a "${e.api.bindings}" property!`);Object.defineProperty(t.document,e.api.bind,{value:function(r,s={}){return Ms.call(t,e,t.document,r,s)}}),Object.defineProperty(t.document,e.api.bindings,{get:function(){return i.proxy(rr.call(t,e,t.document))}}),Object.defineProperty(t.Element.prototype,e.api.bind,{value:function(r,s={}){return Ms.call(t,e,this,r,s)}}),Object.defineProperty(t.Element.prototype,e.api.bindings,{get:function(){return i.proxy(rr.call(t,e,this))}})}function Ms(e,t,i,{merge:r,diff:s,namespace:n}={}){let a=this,{webqit:{Observer:o}}=a,u=rr.call(this,e,t),l={diff:s,namespace:n},c=r?[]:o.ownKeys(u,l).filter(f=>!(f in i));return o.batch(u,()=>(c.length&&o.deleteProperties(u,c,l),o.set(u,i,l)),l)}var gt=class{static instance(t){return S(t).get("defsmanager::instance")||new this(t)}constructor(t,i=null,r=0){let{window:s}=j,{webqit:{realdom:n,oohtml:{configs:a}}}=s;S(t).get("defsmanager::instance")?.dispose(),S(t).set("defsmanager::instance",this),this.host=t,this.config=a.HTML_IMPORTS,this.parent=i,this.level=r,this.defs=Pt(this.host),this.defId=(this.host.getAttribute(this.config.attr.def)||"").trim(),this.validateDefId(this.defId),this.realtimeA=n.realtime(this.host.content).children(o=>{this.export(o.entrants,!0),this.export(o.exits,!1)},{live:!0,timing:"sync"}),this.realtimeB=n.realtime(this.host).attr(["src","loading"],(...o)=>this.evaluateLoading(...o),{live:!0,atomic:!0,timing:"sync",lifecycleSignals:!0}),this.realtimeC=this.evalInheritance()}validateDefId(t){if(["@","/","*","#"].some(i=>t.includes(i)))throw new Error(`The export ID "${t}" contains an invalid character.`)}export(t,i){let{window:r}=j,{webqit:{Observer:s}}=r,n,a=this.defs["#"]||[];s.batch(this.defs,()=>{t.forEach(o=>{if(o.nodeType!==1)return;let u=o.matches(this.config.templateSelector),l=(o.getAttribute(u?this.config.attr.def:this.config.attr.fragmentdef)||"").trim();i?(u&&l?new gt(o,this.host,this.level+1):(a.push(o),n=!0),l&&(this.validateDefId(l),s.set(this.defs,(!u&&"#"||"")+l,o))):(u&&l?gt.instance(o).dispose():(a=a.filter(c=>c!==o),n=!0),l&&s.deleteProperty(this.defs,(!u&&"#"||"")+l))}),n&&s.set(this.defs,"#",a)})}evaluateLoading([t,i],{signal:r}){let{window:{webqit:{Observer:s}}}=j,n=(t.value||"").trim();if(!n)return;let a,o=c=>{if(!c)return a;a=c.then(()=>l.remove())},u=(i.value||"").trim(),l=s.intercept(this.defs,"get",async(c,f,p)=>(u==="lazy"&&o(this.load(n,!0)),await o(),p()),{signal:r});u!=="lazy"&&o(this.load(n))}load(t){let{window:i}=j;if(this.host.content.children.length)return Promise.resolve();if(this.fetchInFlight?.src===t)return this.fetchInFlight.request;this.fetchInFlight?.controller.abort();let r=new AbortController,s=(a,o)=>this.host.dispatchEvent(new i.CustomEvent(a,{detail:o})),n=i.fetch(t,{signal:r.signal,element:this.host}).then(a=>a.ok?a.text():Promise.reject(a.statusText)).then(a=>(this.host.innerHTML=a.trim(),s("load"),this.host)).catch(a=>(console.error(`Error fetching the bundle at "${t}": ${a.message}`),this.fetchInFlight=null,s("loaderror"),this.host));return this.fetchInFlight={src:t,request:n,controller:r},n}evalInheritance(){if(!this.parent)return[];let{window:{webqit:{Observer:t}}}=j,i=(this.host.getAttribute(this.config.attr.extends)||"").trim(),r=(this.host.getAttribute(this.config.attr.inherits)||"").trim(),s=o=>{o.forEach(u=>{t.get(this.defs,u.key)===u.oldValue&&(["get","set","def"].includes(u.type)?t[u.type.replace("get","set")](this.defs,u.key,u.value):u.type==="delete"&&t.deleteProperty(this.defs,u.key))})},n=[],a=Pt(this.parent);return i&&n.push(t.reduce(a,[i,this.config.api.defs,1/0],t.get,s,{live:!0})),(r=r.split(" ").map(o=>o.trim()).filter(o=>o)).length&&n.push(t.get(a,r,s,{live:!0})),n}dispose(){this.realtimeA.disconnect(),this.realtimeB.disconnect(),this.realtimeC.forEach(t=>t instanceof Promise?t.then(i=>i.abort()):t.abort()),Object.entries(this.defs).forEach(([t,i])=>{t.startsWith("#")||gt.instance(i).dispose()})}};var It=class extends tt{static createRequest(t=null){let i=super.createRequest();if(t?.startsWith("/"))i.detail=t,i.targetContext=1/0;else if(t?.startsWith("@")){let[r,...s]=s.slice(1).split(/(?<=\w)(?=\/|#)/).map(n=>n.trim());i.targetContext=r,i.detail=s.join("")}else i.detail=t;return i}get localModules(){return Pt(this.host)}handle(t){let{window:{webqit:{Observer:i}}}=j;if(t._controller?.abort(),(t.detail||"").trim()==="/")return t.respondWith(this.localModules);let r=(t.detail||"").split(/\/|(?<=\w)(?=#)/g).map(n=>n.trim()).filter(n=>n);if(!r.length)return t.respondWith();r=r.join(`/${this.configs.HTML_IMPORTS.api.defs}/`)?.split("/")||[];let s={live:t.live,signal:t.signal,descripted:!0};t._controller=i.reduce(this.localModules,r,i.get,(n,{signal:a}={})=>{let o=Array.isArray(n)?n:n.value,u=Array.isArray(n)?n.length:n.value;if(!(!u&&this.host.isConnected===!1))return u||!this.contextModules?(t._isValidLocalResult=u,t.respondWith(o)):i.reduce(this.contextModules,r,i.get,l=>(t._currentSource="context",t.respondWith(Array.isArray(l)?l:l.value)),{...s,signal:a})},{lifecycleSignals:!0,...s})}unsubscribed(t){t._controller?.abort()}realtimeSources(t){this.host=t;let i=()=>{for(let n of this.subscriptions)n._isValidLocalResult||this.handle(n)},r=this.configs.HTML_IMPORTS;if(!this.host.matches||!r.attr.importscontext)return;this.refdSourceController?.disconnect();let s=this.host.ownerDocument.defaultView.webqit.realdom;this.refdSourceController=s.realtime(this.host).attr(r.attr.importscontext,(n,{signal:a})=>{if(!n.value)return this.contextModules=void 0,i();let o={...this.constructor.createRequest(n.value.trim()),live:!0,signal:a};this.host.parentNode[this.configs.CONTEXT_API.api.contexts].request(o,u=>{this.contextModules=u&&Object.getPrototypeOf(u)?Pt(u):u,i()})},{live:!0,timing:"sync",lifecycleSignals:!0})}initialize(t){return this.realtimeSources(t),super.initialize(t)}dispose(t){return this.refdSourceController?.disconnect(),super.dispose(t)}};G(It,"kind","html-imports");function Vs(){let{window:e}=j,{webqit:t}=e,{realdom:i,oohtml:{configs:r}}=t;if(t.HTMLImportElement)return t.HTMLImportElement;let s=r.HTML_IMPORTS.elements.import.includes("-")?e.HTMLElement:class{};class n extends s{static instance(o){return r.HTML_IMPORTS.elements.import.includes("-")&&o instanceof this?o:S(o).get("import::instance")||new this(o)}constructor(...o){super();let u=o[0]||this;S(u).set("import::instance",this),Object.defineProperty(this,"el",{get:()=>u,configurable:!1});let l={};Object.defineProperty(this,"#",{get:()=>l,configurable:!1}),l.slottedElements=new Set,l.setAnchorNode=c=>(l.anchorNode=c,c),l.importRequest=(c,f=null)=>{let p={...It.createRequest(l.moduleRef?.includes("#")?l.moduleRef:`${l.moduleRef}#`),live:f&&!0,signal:f};(this.el.isConnected?this.el.parentNode:l.anchorNode.parentNode)[r.CONTEXT_API.api.contexts].request(p,m=>{c((m instanceof e.HTMLTemplateElement?[...m.content.children]:Array.isArray(m)?m:m&&[m])||[])})},l.hydrate=(c,f)=>{l.moduleRef=(this.el.getAttribute(r.HTML_IMPORTS.attr.ref)||"").trim(),c.replaceWith(l.setAnchorNode(this.createAnchorNode())),l.autoRestore(()=>{f.forEach(p=>{l.slottedElements.add(p),S(p).set("slot@imports",this.el)})}),l.hydrationImportRequest=new AbortController,l.importRequest(p=>{if(l.originalsRemapped)return this.fill(p);let m=p.map((y,v)=>({el:y,fragmentDef:y.getAttribute(r.HTML_IMPORTS.attr.fragmentdef)||"",tagName:y.tagName,i:v})),g=-1;f.forEach(y=>{let v=y.tagName,x=y.getAttribute(r.HTML_IMPORTS.attr.fragmentdef)||"",b=(g++,m.find(_=>_.tagName===v&&_.fragmentDef===x&&_.i===g));!b||S(y).set("original@imports",b.el)}),l.originalsRemapped=!0},l.hydrationImportRequest.signal)},l.autoRestore=(c=null)=>{l.autoRestoreRealtime?.disconnect(),c&&c();let f=()=>{l.anchorNode?.replaceWith(this.el),l.anchorNode=null,this.el.setAttribute("data-nodecount",0)};if(!l.slottedElements.size)return f();let p=i.realtime(e.document).observe([...l.slottedElements],m=>{if(m.exits.forEach(g=>{S(g).delete("slot@imports"),l.slottedElements.delete(g)}),!l.slottedElements.size){if(p.disconnect(),!m.target.isConnected)return;f()}},{subtree:!0,timing:"sync",generation:"exits"});l.autoRestoreRealtime=p},l.connectedCallback=()=>{if(l.slottedElements.size)throw new Error("Illegal reinsertion into the DOM; import slot is not empty!");l.moduleRefRealtime||(l.moduleRefRealtime=i.realtime(this.el).attr(r.HTML_IMPORTS.attr.ref,(c,{signal:f})=>{l.moduleRef=c.value,l.importRequest(p=>!l.hydrationImportRequest&&this.fill(p),f)},{live:!0,timing:"sync",lifecycleSignals:!0}),l.hydrationImportRequest?.abort(),l.hydrationImportRequest=null)},l.disconnectedCallback=()=>{l.hydrationImportRequest?.abort(),l.hydrationImportRequest=null,!l.anchorNode.isConnected&&(l.moduleRefRealtime?.disconnect(),l.moduleRefRealtime=null)}}createAnchorNode(){if(e.webqit.env!=="server")return e.document.createTextNode("");let o=e.document.createElement("div");o.textContent=this.el.outerHTML;let u=e.document.createComment(o.innerHTML);return S(u).set("isAnchorNode",!0),u}fill(o){Array.isArray(o)&&(o=new Set(o)),this.el.setAttribute("data-nodecount",o.size),this["#"].autoRestore(()=>{if(this["#"].slottedElements.forEach(u=>{let l=S(u).get("original@imports");o.has(l)?o.delete(l):(this["#"].slottedElements.delete(u),u.remove())}),o.size){let u=this["#"].anchorNode,l=this["#"].setAnchorNode(this.createAnchorNode());(this.el.isConnected?this.el:u).replaceWith(l)}o.forEach(u=>{let l=u.cloneNode(!0);l.hasAttribute(r.HTML_IMPORTS.attr.fragmentdef)||l.toggleAttribute(r.HTML_IMPORTS.attr.fragmentdef,!0),S(l).set("original@imports",u),S(l).set("slot@imports",this.el),this["#"].slottedElements.add(l),this["#"].anchorNode.before(l)})})}empty(){this["#"].slottedElements.forEach(o=>o.remove())}get anchorNode(){return this["#"].anchorNode}get moduleRef(){return this["#"].moduleRef}get slottedElements(){return this["#"].slottedElements}}return r.HTML_IMPORTS.elements.import.includes("-")&&customElements.define(r.HTML_IMPORTS.elements.import,n),t.HTMLImportElement=n,n}function nr(e={}){let{config:t,window:i}=Z.call(this,"html-imports",e,{elements:{import:"import"},attr:{def:"def",extends:"extends",inherits:"inherits",ref:"ref",importscontext:"importscontext"},api:{def:"def",defs:"defs",import:"import"}});t.attr.fragmentdef||(t.attr.fragmentdef=t.attr.def),t.templateSelector=`template[${i.CSS.escape(t.attr.def)}]`,t.importsContextSelector=`[${i.CSS.escape(t.attr.importscontext)}]`,t.slottedElementsSelector=`[${i.CSS.escape(t.attr.fragmentdef)}]:not(template)`;let r=(s,n)=>{let a=`starts-with(., "${s}")`,o=`substring(., string-length(.) - string-length("${n}") + 1) = "${n}"`;return`${a} and ${o}`};t.anchorNodeSelector=`comment()[${r(`<${t.elements.import}`,`</${t.elements.import}>`)}]`,i.webqit.HTMLImportsContext=It,i.webqit.HTMLImportElement=Vs(),ya.call(i,t),xa.call(i,t)}function Pt(e,t=!0){if(!S(e).has("defs")&&t){let i=Object.create(null);S(e).set("defs",i)}return S(e).get("defs")}function ya(e){let t=this,{webqit:{oohtml:{configs:i}}}=t;if(e.api.defs in t.HTMLTemplateElement.prototype)throw new Error(`The "HTMLTemplateElement" class already has a "${e.api.defs}" property!`);if(e.api.def in t.HTMLTemplateElement.prototype)throw new Error(`The "HTMLTemplateElement" class already has a "${e.api.def}" property!`);if(e.api.import in t.document)throw new Error(`document already has a "${e.api.import}" property!`);if(e.api.import in t.HTMLElement.prototype)throw new Error(`The "HTMLElement" class already has a "${e.api.import}" property!`);Object.defineProperty(t.HTMLTemplateElement.prototype,e.api.defs,{get:function(){return Pt(this)}}),Object.defineProperty(t.HTMLTemplateElement.prototype,e.api.def,{get:function(){return this.getAttribute(e.attr.def)}}),Object.defineProperty(t.HTMLTemplateElement.prototype,"scoped",{configurable:!0,get(){return this.hasAttribute("scoped")},set(s){this.toggleAttribute("scoped",s)}}),Object.defineProperty(t.document,e.api.import,{value:function(s,n=!1,a=null){return r(t.document,...arguments)}}),Object.defineProperty(t.HTMLElement.prototype,e.api.import,{value:function(s,n=!1,a=null){return r(this,...arguments)}});function r(s,n,a=!1,o=null){let u={};typeof a=="function"?(o=a,a=!1):typeof a=="object"&&a?u={...a,...u}:u={live:a};let l={...It.createRequest(n),...u};return s[i.CONTEXT_API.api.contexts].request(l,o)}}function xa(e){let t=this,{webqit:{Observer:i,realdom:r,oohtml:{configs:s},HTMLImportElement:n,HTMLImportsContext:a}}=t,o=c=>{let f=c[s.CONTEXT_API.api.contexts];f.find(a.kind)||f.attach(new a)},u=c=>{let f=c[s.CONTEXT_API.api.contexts],p=f.find(a.kind);p&&(!c.isConnected||!c.matches?.(e.importsContextSelector)&&!Object.keys(p.localModules).length)&&f.detach(p)};r.realtime(t.document).subtree([e.templateSelector,e.importsContextSelector],c=>{c.entrants.forEach(f=>{if(f.matches(e.templateSelector)){let p=gt.instance(f);p.ownerContext=f.scoped?c.target:t.document;let m=Pt(p.ownerContext);p.defId&&i.set(m,p.defId,f),o(p.ownerContext)}else o(f)}),c.exits.forEach(f=>{if(f.matches(e.templateSelector)){let p=gt.instance(f),m=Pt(p.ownerContext);p.defId&&i.deleteProperty(m,p.defId),u(p.ownerContext)}else u(f)})},{live:!0,timing:"sync",staticSensitivity:!0}),r.realtime(t.document).subtree(e.elements.import,c=>{c.entrants.forEach(f=>l(f,!0,c)),c.exits.forEach(f=>l(f,!1,c))},{live:!0,timing:"sync"});function l(c,f){let p=n.instance(c);f?p["#"].connectedCallback():p["#"].disconnectedCallback()}t.webqit.env!=="server"&&r.realtime(t.document).subtree(`(${e.anchorNodeSelector})`,c=>{c.entrants.forEach(f=>{if(S(f).get("isAnchorNode"))return;let p=t.document.createElement("div");p.innerHTML=f.nodeValue,p.innerHTML=p.firstChild.textContent;let m=p.firstChild,g=parseInt(m.getAttribute("data-nodecount")),y=new Set,v=f;for(;(v=v.previousElementSibling)&&v.matches(e.slottedElementsSelector)&&g--;)y.add(v);n.instance(m)["#"].hydrate(f,y)})},{live:!0})}function ur(e={}){let{config:t,window:i}=Z.call(this,"data-binding",e,{attr:{expr:"expr",itemIndex:"data-key"},tokens:{nodeType:"processing-instruction",tagStart:"?{",tagEnd:"}?",stateStart:"; [=",stateEnd:"]"}});({CONTEXT_API:t.CONTEXT_API,BINDINGS_API:t.BINDINGS_API,HTML_IMPORTS:t.HTML_IMPORTS}=i.webqit.oohtml.configs),t.attrSelector=`[${i.CSS.escape(t.attr.expr)}]`;let r=(s,n)=>{let a=`starts-with(., "${s}")`,o=`substring(., string-length(.) - string-length("${n}") + 1) = "${n}"`;return`${a} and ${o}`};t.discreteBindingsSelector=`comment()[${r(t.tokens.tagStart,t.tokens.tagEnd)}]`,ba.call(i,t)}function ba(e){let t=this,{webqit:{realdom:i}}=t;i.realtime(t.document).subtree(`(${e.discreteBindingsSelector})`,r=>{Ds.call(this,...r.exits),wa.call(this,e,...r.entrants)},{live:!0}),i.realtime(t.document).subtree(e.attrSelector,r=>{Ds.call(this,...r.exits),_a.call(this,e,...r.entrants)},{live:!0,timing:"sync",staticSensitivity:!0})}function qs(e,t){let{webqit:{realdom:i,Observer:r,DOMBindingsContext:s}}=this;if(S(t).has("data-binding"))return S(t).get("data-binding");let n=Object.create(null),a=new AbortController;n.$exec__=(u,l,...c)=>{i.schedule("write",()=>u[l](...c))},n.$assign__=(u,l,c)=>{i.schedule("write",()=>u[l]=c)},r.intercept(n,{get:(u,l,c)=>{if(!(u.key in n)){let f={...s.createRequest(u.key),live:!0,signal:a.signal};t[e.CONTEXT_API.api.contexts].request(f,p=>{r.set(n,u.key,p)})}return c(n[u.key]??(u.key in globalThis?globalThis[u.key]:void 0))},has:(u,l,c)=>c(!0)});let o={scope:n,abortController:a,bindings:new Map};return S(t).set("data-binding",o),o}function Ds(...e){for(let t of e){let i=t.nodeName==="#text"?t.parentNode:t,{bindings:r,abortController:s}=S(i).get("data-binding")||{};if(!r?.has(t))return;r.get(t).state.dispose(),r.get(t).signals?.forEach(n=>n.abort()),r.delete(t),r.size||(s.abort(),S(i).delete("data-binding"))}}async function wa(e,...t){let i=this,{webqit:{QuantumAsyncFunction:r}}=i,s=a=>{let o=e.tokens.tagStart.split("").map(g=>`\\${g}`).join(""),u=e.tokens.tagEnd.split("").map(g=>`\\${g}`).join(""),l=e.tokens.stateStart.split("").map(g=>g===" "?"(?:\\s+)?":`\\${g}`).join(""),c=e.tokens.stateEnd.split("").map(g=>`\\${g}`).join(""),f=`^${o}(.*?)(?:${l}(\\d+)${c}(?:\\s+)?)?${u}$`,[,p,m]=a.match(new RegExp(f));return{raw:a,expr:p,span:parseInt(m??0)}},n=t.reduce((a,o)=>{if(o.isBound)return a;let u=s(o.nodeValue),l=o;if(u.span){if(l=o.nextSibling,l?.nodeName!=="#text"||l.nodeValue.length<u.span)return a;l.nodeValue.length>u.span&&l.splitText(u.span)}else l=o.ownerDocument.createTextNode(""),o.after(l);l.isBound=!0;let c=o;return i.webqit.env!=="server"&&(c.remove(),c=null),a.concat({textNode:l,template:u,anchorNode:c})},[]);for(let{textNode:a,template:o,anchorNode:u}of n){let l=va(e,o.expr),{scope:c,bindings:f}=qs.call(this,e,a.parentNode);Object.defineProperty(a,"$oohtml_internal_databinding_anchorNode",{value:u,configurable:!0}),f.set(a,{state:await(await l.bind(a,c)).execute()})}}var ar=new Map;function va(e,t){if(ar.has(t))return ar.get(t);let i=`let content = ((${t}) ?? '') + '';`;i+="$assign__(this, 'nodeValue', content);",i+=`if ( this.$oohtml_internal_databinding_anchorNode ) { $assign__(this.$oohtml_internal_databinding_anchorNode, 'nodeValue', "${e.tokens.tagStart}${ue(t)}${e.tokens.stateStart}" + content.length + "${e.tokens.stateEnd} ${e.tokens.tagEnd}"); }`;let{webqit:{QuantumModule:r}}=this,s=new r(i);return ar.set(t,s),s}async function _a(e,...t){for(let i of t){let r=Sa(e,i.getAttribute(e.attr.expr)),{scope:s,bindings:n}=qs.call(this,e,i),a=[];Object.defineProperty(i,"$oohtml_internal_databinding_signals",{value:a,configurable:!0}),n.set(i,{signals:a,state:await(await r.bind(i,s)).execute()})}}var or=new Map;function Sa(e,t){if(or.has(t))return or.get(t);let i={},r=ae(t,";").map(a=>{let[o,u]=ae(a,":").map(m=>m.trim()),l=o[0],c=o.slice(1).trim(),f=`(${u})`,p=`(${f} ?? '')`;if(l==="&")return c.startsWith("--")?`$exec__(this.style, 'setProperty', "${ue(c)}", ${p});`:`$assign__(this.style, "${ue(c)}", ${p});`;if(l==="%")return`$exec__(this.classList, 'toggle', "${ue(c)}", !!${f});`;if(l==="~")return c.startsWith("?")?`$exec__(this, 'toggleAttribute', "${ue(c.substring(1).trim())}", !!${f});`:`$exec__(this, 'setAttribute', "${ue(c)}", ${p});`;if(l==="@"){if(i[c])throw new Error(`Duplicate binding: ${o}.`);if(i[c]=!0,c==="text")return`$assign__(this, 'textContent', ${p});`;if(c==="html")return`$exec__(this, 'setHTML', ${p});`;if(c==="items"){let[m,g]=ae(u,"/");if(!g)throw new Error(`Invalid ${l}items spec: ${a}; no import specifier.`);let[y,v,x,b]=m.trim().match(/(.*?[\)\s+])(of|in)([\(\{\[\s+].*)/i)||[];if(!y)throw new Error(`Invalid ${l}items spec: ${a}.`);if(v.startsWith("(")?v=v.trim().slice(1,-1).split(",").map(A=>A.trim()):v=[v],v.length>(x==="in"?3:2))throw new Error(`Invalid ${l}items spec: ${a}.`);let _=x==="in"?v[2]:v[1]||"$index__";return`
|
|
18
20
|
let $iteratee__ = ${b};
|
|
19
|
-
let $import__ = this.${e.HTML_IMPORTS.api.import}( ${
|
|
21
|
+
let $import__ = this.${e.HTML_IMPORTS.api.import}( ${g.trim()}, true );
|
|
20
22
|
this.$oohtml_internal_databinding_signals?.push( $import__ );
|
|
21
23
|
|
|
22
24
|
if ( $import__.value && $iteratee__ ) {
|
|
@@ -24,13 +26,13 @@ ${n.textContent}
|
|
|
24
26
|
this.querySelectorAll( '[${e.attr.itemIndex}]' ).forEach( x => {
|
|
25
27
|
$existing__.set( x.getAttribute( '${e.attr.itemIndex}' ), x );
|
|
26
28
|
} );
|
|
27
|
-
${
|
|
28
|
-
for ( let ${
|
|
29
|
-
${
|
|
30
|
-
${
|
|
31
|
-
const $itemBinding__ = { ${
|
|
29
|
+
${_?`let ${_} = -1;`:""}
|
|
30
|
+
for ( let ${v[0]} ${x} $iteratee__ ) {
|
|
31
|
+
${_?`${_} ++;`:""}
|
|
32
|
+
${x==="in"&&v[1]?`let ${v[1]} = $iteratee__[ ${v[0]} ];`:""}
|
|
33
|
+
const $itemBinding__ = { ${v.join(", ")} };
|
|
32
34
|
|
|
33
|
-
const $key___ = ( ${
|
|
35
|
+
const $key___ = ( ${x==="in"?v[0]:_} ) + '';
|
|
34
36
|
let $itemNode__ = $existing__.get( $key___ );
|
|
35
37
|
if ( $itemNode__ ) {
|
|
36
38
|
$existing__.delete( $key___ );
|
|
@@ -42,10 +44,10 @@ ${n.textContent}
|
|
|
42
44
|
$exec__(this, 'appendChild', $itemNode__ );
|
|
43
45
|
}
|
|
44
46
|
|
|
45
|
-
if ( ${
|
|
47
|
+
if ( ${x==="in"?`!( ${v[0]} in $iteratee__ )`:`typeof ${v[0]} === 'undefined'`} ) { $itemNode__.remove(); }
|
|
46
48
|
}
|
|
47
49
|
$existing__.forEach( x => x.remove() );
|
|
48
50
|
$existing__.clear();
|
|
49
51
|
}`}}if(a.trim())throw new Error(`Invalid binding: ${a}.`)}).join(`
|
|
50
|
-
`),{webqit:{QuantumModule:s}}=this,n=new s(r);return
|
|
52
|
+
`),{webqit:{QuantumModule:s}}=this,n=new s(r);return or.set(t,n),n}var ue=e=>e.replace(/"/g,'\\"');function lr(e,t={}){this.webqit||(this.webqit={}),Object.assign(this.webqit,e),ir.call(this,t.CONTEXT_API||{}),sr.call(this,t.BINDINGS_API||{}),Zi.call(this,t.NAMESPACED_HTML||{}),nr.call(this,t.HTML_IMPORTS||{}),ur.call(this,t.DATA_BINDING||{}),tr.call(this,t.SCOPED_CSS||{}),er.call(this,t.SCOPED_JS||{})}lr.call(window,Gi);})();
|
|
51
53
|
//# sourceMappingURL=main.js.map
|