UNPKG

@webqit/oohtml

Version:

A suite of new DOM features that brings language support for modern UI development paradigms: a component-based architecture, data binding, and reactivity.

3 lines 271 kB
(()=>{var Pr=Object.defineProperty;var fn=(e,t,i)=>t in e?Pr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var Ci=(e,t)=>{for(var i in t)Pr(e,i,{get:t[i],enumerable:!0})};var G=(e,t,i)=>(fn(e,typeof t!="symbol"?t+"":t,i),i),Ir=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)};var J=(e,t,i)=>(Ir(e,t,"read from private field"),i?i.call(e):t.get(e)),Se=(e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)},re=(e,t,i,r)=>(Ir(e,t,"write to private field"),r?r.call(e,i):t.set(e,i),i);var or={};Ci(or,{AsyncQuantumFunction:()=>Ms,AsyncQuantumScript:()=>me,Observer:()=>R,QuantumAsyncFunction:()=>wa,QuantumAsyncScript:()=>va,QuantumFunction:()=>ba,QuantumModule:()=>ze,QuantumScript:()=>We,State:()=>Xt});var ji={};Ci(ji,{apply:()=>ii,batch:()=>ni,construct:()=>Mi,defineProperties:()=>On,defineProperty:()=>Te,deleteProperties:()=>Tn,deleteProperty:()=>Ne,get:()=>Pt,getOwnPropertyDescriptor:()=>ri,getOwnPropertyDescriptors:()=>Pn,getPrototypeOf:()=>Li,has:()=>si,intercept:()=>An,isExtensible:()=>Ri,map:()=>In,observe:()=>qi,ownKeys:()=>Oe,path:()=>kn,preventExtensions:()=>Vi,reduce:()=>Fi,set:()=>Wt,setPrototypeOf:()=>Di});function V(e){return!Array.isArray(e)&&typeof e=="object"&&e}function se(e){return typeof e}function L(e){return Array.isArray(e)}function ki(e,t,i=null){return L(t)?e.filter(r=>i?t.filter(s=>i(r,s)).length:t.indexOf(r)!==-1):[]}function K(e,...t){if(globalThis.webqit||(globalThis.webqit={}),globalThis.webqit.refs||Object.defineProperty(globalThis.webqit,"refs",{value:new _e}),!arguments.length)return globalThis.webqit.refs;let i=globalThis.webqit.refs.get(e);i||(i=new _e,globalThis.webqit.refs.set(e,i));let r,s;for(;r=t.shift();)(s=i)&&!(i=i.get(r))&&(i=new _e,s.set(r,i));return i}var _e=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)!(Je([t,"*"],s.type)&&Je([i,"*"],s.key)&&s.callback===r)||this.observers.delete(s)}fire(t,i,...r){for(let s of this.observers)!(Je([t,"*"],s.type)&&Je([i,"*"],s.key))||s.callback(...r)}},Je=(e,t)=>Array.isArray(t)?ki(e,t).length:e.includes(t);function ne(e){return typeof e=="function"}function Ee(e){return e===null||e===""}function kt(e){return arguments.length&&(e===void 0||typeof e>"u")}function q(e){return Array.isArray(e)||typeof e=="object"&&e||ne(e)}function Ai(e){return Ee(e)||kt(e)||e===!1||e===0||q(e)&&!Object.keys(e).length}function F(e){return ne(e)||e&&{}.toString.call(e)==="[object function]"}function Ce(e){return e instanceof Number||typeof e=="number"}function ut(e){return Ce(e)||e!==!0&&e!==!1&&e!==null&&e!==""&&!isNaN(e*1)}function ae(e){return e instanceof String||typeof e=="string"&&e!==null}function Pi(e){return!ae(e)&&!kt(e.length)}function Ze(e,...t){return t.forEach(i=>{e.indexOf(i)<0&&e.push(i)}),e}function Ii(r,t){t=t||Object.prototype,t=t&&!L(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 Ii(e,t).forEach(r=>{Ze(i,...Object.getOwnPropertyNames(r))}),i}function xt(e,t,i=!1,r=!1,s=!1){var n=0,a=e.shift();if((ut(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)=>{!q(o)&&!F(o)||(i?Oi(o):Object.keys(o)).forEach(c=>{if(!!t(c,a,o,u)){var l=a[c],f=o[c];if((L(l)&&L(f)||V(l)&&V(f))&&(n===!0||n>0))a[c]=L(l)&&L(f)?[]:{},xt([ut(n)?n-1:n,a[c],l,f],t,i,r,s);else if(L(a)&&L(o))r?a[c]=f:a.push(f);else try{s?Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(o,c)):a[c]=o[c]}catch{}}})}),a}function ke(...e){return xt(e,(t,i,r)=>!0,!1,!1,!1)}function W(e,t=!0){return L(e)?e:!t&&V(e)?[e]:e!==!1&&e!==0&&Ai(e)?[]:Pi(e)?Array.prototype.slice.call(e):V(e)?Object.values(e):[e]}var j=(...e)=>K("observer-api",...e),oe=(e,t)=>e instanceof Promise?e.then(t):t(e),ti={};var Ht=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 Ae=class extends Ht{constructor(){super(...arguments),this.emit.currentRegistration=this,Object.defineProperty(this,"abortController",{value:new AbortController}),Object.defineProperty(this,"signal",{value:this.abortController.signal}),ti.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=W(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 oe(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 Ut=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(!q(i))throw new Error(`Subject must be of type object; "${se(i)}" given!`);let n=this;return s&&j("namespaces").has(t+"-"+s)&&(n=j("namespaces").get(t+"-"+s),t+="-"+s),!j(i,"registry").has(t)&&r&&j(i,"registry").set(t,new n(i)),j(i,"registry").get(t)}static _namespace(t,i,r=null){if(t+="-"+i,arguments.length===2)return j("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}.`);j("namespaces").set(t,r),r.__namespace=i}};var Z=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 Rt=class extends Ut{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 Ae(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(c=>{let{target:l,type:f,...p}=c,m=new Z(l,{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 oe(i,r=>{let s=this.batches.shift();return s.snapshots.length&&this.$emit(s.entries,s.snapshots),r})}};var Pe=class extends Ht{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 At=class extends Ut{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 Pe(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 $i={};Ci($i,{accessorize:()=>En,proxy:()=>Mr,unaccessorize:()=>Cn,unproxy:()=>Ie});function En(e,t,i={}){e=ei(e);let r=j(e,"accessorizedProps");function s(u){let c,l=e;do c=Object.getOwnPropertyDescriptor(l,u);while(!c&&(l=Object.getPrototypeOf(l)));return c?{proto:l,descriptor:c}:{descriptor:{value:void 0,configurable:!0,enumerable:!0,writable:!0}}}function n(u){if(r.has(u+""))return!0;let c=s(u);c.getValue=function(p=!1){return p?this.descriptor:this.descriptor.get?this.descriptor.get():this.descriptor.value},c.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)},c.intact=function(){let p=Object.getOwnPropertyDescriptor(e,u);return p?.get===f.get&&p?.set===f.set&&r.get(u+"")===this},c.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),c);let{enumerable:l=!0}=c.descriptor,f={enumerable:l,configurable:!0};("value"in c.descriptor||c.descriptor.set)&&(f.set=function(p){return Wt(this,u,p,i)}),("value"in c.descriptor||c.descriptor.get)&&(f.get=function(){return Pt(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 Cn(e,t,i={}){e=ei(e);let r=j(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 Mr(e,t={},i=void 0){let r=ei(e);if(typeof t.membrane=="boolean")throw new Error("The params.membrane parameter cannot be of type boolean.");if(t.membrane&&j(r,"membraneRef").has(t.membrane))return j(r,"membraneRef").get(t.membrane);let s={apply(o,u,c){if(Array.isArray(u)){let l=ei(u);return j(l).set("$length",l.length),ni(l,()=>ii(o,u,c))}return ii(o,Ie(u),c)},construct:(o,u,c=null)=>Mi(o,u,c,t),defineProperty:(o,u,c)=>Te(o,u,c,t),deleteProperty:(o,u)=>Ne(o,u,t),get:(o,u,c=null)=>{let l={...t,receiver:c};Array.isArray(o)&&u==="length"&&j(o).has("$length")&&(l.forceValue=j(o).get("$length"));let f=Pt(o,u,l);return Array.isArray(o)&&typeof f=="function"?Mr(f,{...t,membrane:c}):f},getOwnPropertyDescriptor:(o,u)=>ri(o,u,t),getPrototypeOf:o=>Li(o,t),has:(o,u)=>si(o,u,t),isExtensible:o=>Ri(o,t),ownKeys:o=>Oe(o,t),preventExtensions:o=>Vi(o,t),set:(o,u,c,l=null)=>{let f={...t,receiver:l};return Array.isArray(o)&&u==="length"&&(f.forceOldValue=j(o).get("$length"),j(o).set("$length",c)),Wt(o,u,c,f)},setPrototypeOf:(o,u)=>Di(o,u,t)},n=i?.(s)||s,a=new Proxy(r,n);return t.membrane&&j(r,"membraneRef").set(t.membrane,a),j(a).set(a,r),a}function Ie(e){return j(e).get(e)||e}function ei(e){if(!e||!q(e))throw new Error("Target must be of type object!");return Ie(e)}var $e=class extends Array{};function kn(...e){return new $e(...e)}function Fi(e,t,i,r=n=>n,s={}){if(!!t.length)return function n(a,o,u){let c=o[u.level],l=u.level===o.length-1;return a instanceof Z&&a.operation!=="get"?u={...u,probe:"always"}:u.probe!=="always"&&(u={...u,probe:!l}),i(a,c,(f,...p)=>{let m=v=>{v instanceof Z&&(v.path=[v.key],a instanceof Z&&(v.path=a.path.concat(v.key),Object.defineProperty(v,"context",{get:()=>a,configurable:!0})))},g=v=>{let E=bt(v,!1);return oe(E,y=>{v instanceof Z?v.value=y:v=y;let w=p[0]||{};return n(v,o,{...u,...w,level:u.level+1})})};return ai(c)&&Array.isArray(f)?(f.forEach(m),l?r(f,...p):f.map(g)):(m(f),l?r(f,...p):g(f))},u)}(e,t.slice(0),{...s,level:0})}function qi(e,t,i,r={}){if(e=bt(e,!r.level),F(arguments[1])&&([,i,r={}]=arguments,t=1/0),!F(i))throw new Error(`Handler must be a function; "${se(i)}" given!`);if(t instanceof $e)return Fi(e,t,qi,i,r);if(r={...r,descripted:!0},delete r.live,!q(e))return r.probe&&Pt(e,t,i,r);let s=Dr(e,t,i,r);return r.probe?Pt(e,t,s,r):s()}function An(e,t,i={}){return e=bt(e),V(t)||([,,,i={}]=arguments,t={[arguments[1]]:arguments[2]}),At.getInstance(e,!0,i.namespace).addRegistration({traps:t,params:i})}function ri(e,t,i=s=>s,r={}){return wt(e,"getOwnPropertyDescriptor",{key:t},i,r)}function Pn(e,t,i=s=>s,r={}){return wt(e,"getOwnPropertyDescriptors",{key:t},i,r)}function Li(e,t=r=>r,i={}){return wt(e,"getPrototypeOf",{},t,i)}function Ri(e,t=r=>r,i={}){return wt(e,"isExtensible",{},t,i)}function Oe(e,t=r=>r,i={}){return wt(e,"ownKeys",{},t,i)}function si(e,t,i=s=>s,r={}){return wt(e,"has",{key:t},i,r)}function Pt(e,t,i=s=>s,r={}){let s,n=bt(e,!r.level);return V(i)?[r,i]=[i,a=>a]:r.live&&(s=!0),t instanceof $e?Fi(n,t,Pt,i,r):Nn(n,t,a=>{let o=[...a];return function u(c,l,f){if(!l.length)return f(c);let p=l.shift();if(!["string","number","symbol"].includes(typeof p))throw new Error(`Property name/key ${p} invalid.`);function m(E,y=void 0){let w=x=>(E.value=x,u([...c,r.live||r.descripted?E:x],l,f));if(arguments.length>1)return w(y);if(!q(n))return w(n?.[E.key]);let C=j(n,"accessorizedProps",!1),b=C&&C.get(E.key);if(b&&b.intact())return w(b.getValue(r.withPropertyDescriptors));if(r.withPropertyDescriptors){let x=Object.getOwnPropertyDescriptor(n,E.key);return"forceValue"in r&&"value"in x&&(x.value=r.forceValue),w(x)}return"forceValue"in r?w(r.forceValue):w(Reflect.get(n,E.key))}let g=new Z(n,{type:"get",key:p,value:void 0,operation:"get",related:o});if(!q(n))return m(g);let v=At.getInstance(n,!1,r.namespace);return v?v.emit(g,m):m(g)}([],a.slice(0),u=>{let c=ai(t)?u:u[0];return s&&q(n)?Dr(n,t,i,r)(c):i(c)})},r)}function ni(e,t,i={}){return e=bt(e),Rt.getInstance(e,!0,i.namespace).batch(t)}function In(e,t,i={}){t=bt(t),e=bt(e);let r=(i.only||[]).slice(0),s=(i.except||[]).slice(0),n=Oe(i.spread?[...e]:e).map(c=>isNaN(c)?c:parseInt(c)),a=r.length?r.filter(c=>n.includes(c)):n.filter(c=>!s.includes(c)),o=c=>!Array.isArray(t)||isNaN(c)?c:c-s.filter(l=>l<c).length,u=c=>{let l=ri(e,c,i);"value"in l&&l.writable&&l.enumerable&&l.configurable?Wt(t,o(c),l.value,i):(l.enumerable||i.onlyEnumerable===!1)&&Te(t,c,{...l,configurable:!0},i)};return ni(t,()=>{a.forEach(u)}),qi(e,c=>{c.filter(l=>r.length?r.includes(l.key):!s.includes(l.key)).forEach(l=>{if(l.operation==="deleteProperty")return Ne(t,o(l.key),i);if(l.operation==="defineProperty"){(l.value.enumerable||i.onlyEnumerable===!1)&&Te(t,o(l.key),{...l.value,configurable:!0},i);return}u(l.key)})},{...i,withPropertyDescriptors:!0})}function Wt(e,t,i,r=a=>a,s={},n=!1){let a=bt(e),o=[[t,i]];V(t)&&([,,r=c=>c,s={},n=!1]=arguments,o=Object.entries(t)),V(r)&&([n,s,r]=[typeof s=="boolean"?s:n,r,c=>c]);let u=o.map(([c])=>c);return function c(l,f,p){if(!f.length)return p(l);let[m,g]=f.shift();function v(y,w=void 0){let C=_=>(y.status=_,c(l.concat(y),f,p));if(arguments.length>1)return C(y,w);let b=j(a,"accessorizedProps",!1),x=b&&b.get(y.key);return y.operation==="defineProperty"?(x&&!x.restore()&&C(!1),Object.defineProperty(a,y.key,y.value),C(!0)):x&&x.intact()?C(x.setValue(y.value)):C(Reflect.set(a,y.key,y.value))}function E(y,w){if(s.diff&&g===w)return c(l,f,p);let C=new Z(a,{type:n?"def":"set",key:m,value:g,isUpdate:y,oldValue:w,related:[...u],operation:n?"defineProperty":"set",detail:s.detail}),b=At.getInstance(a,!1,s.namespace);return b?b.emit(C,v):v(C)}return si(a,m,y=>{if(!y)return E(y);let w={...s,withPropertyDescriptors:n};return"forceOldValue"in s&&(w.forceValue=s.forceOldValue),Pt(a,m,C=>E(y,C),w)},s)}([],o.slice(0),c=>{let l=Rt.getInstance(a,!1,s.namespace);return l&&l.emit(c,n),r(ai(t)?c.map(f=>f.status):c[0]?.status)})}function Te(e,t,i,r=n=>n,s={}){return Wt(e,t,i,r,s,!0)}function On(e,t,i=s=>s,r={}){return Wt(e,t,i,r,!0)}function Ne(e,t,i=s=>s,r={}){e=bt(e),V(i)&&([r,i]=[i,a=>a]);let s=W(t,!1),n=[...s];return function a(o,u,c){if(!u.length)return c(o);let l=u.shift();function f(m,g=void 0){let v=w=>(m.status=w,a(o.concat(m),u,c));if(arguments.length>1)return v(m,g);let E=j(e,"accessorizedProps",!1),y=E&&E.get(m.key);return y&&!y.restore()&&v(!1),v(Reflect.deleteProperty(e,m.key))}function p(m){let g=new Z(e,{type:"delete",key:l,oldValue:m,related:[...n],operation:"deleteProperty",detail:r.detail}),v=At.getInstance(e,!1,r.namespace);return v?v.emit(g,f):f(g)}return Pt(e,l,p,r)}([],s.slice(0),a=>{let o=Rt.getInstance(e,!1,r.namespace);return o&&o.emit(a),i(ai(t)?a.map(u=>u.status):a[0].status)})}function Tn(e,t,i=s=>s,r={}){return Ne(...arguments)}function Mi(e,t,i=null,r=n=>n,s={}){return wt(e,"construct",arguments.length>2?{argumentsList:t,newTarget:i}:{argumentsList:t},r,s)}function ii(e,t,i,r=n=>n,s={}){return wt(e,"apply",{thisArgument:t,argumentsList:i},r,s)}function Di(e,t,i=s=>s,r={}){return wt(e,"setPrototypeOf",{proto:t},i,r)}function Vi(e,t=r=>r,i={}){return wt(e,"preventExtensions",{},t,i)}function Dr(e,t,i,r={}){let s=new AbortController;ti.setMaxListeners?.(0,s.signal),r.signal&&r.signal.addEventListener("abort",()=>s.abort()),r={...r,signal:s.signal};let n=Rt.getInstance(e,!0,r.namespace);return function a(o,u=null){u?.remove();let l={signal:n.addRegistration(t,a,r).signal};if(arguments.length){let f=i(o,l);if(arguments.length>1)return f}return s}}function wt(e,t,i={},r=n=>n,s={}){e=bt(e),V(r)&&([s,r]=[r,u=>u]);function n(u,c){return arguments.length>1?r(c):r((Reflect[t]||Object[t])(e,...Object.values(i)))}let a=new Z(e,{operation:t,...i}),o=At.getInstance(e,!1,s.namespace);return o?o.emit(a,n):n(a)}function ai(e){return e===1/0||Array.isArray(e)}function bt(e,t=!0){if((!e||!q(e))&&t)throw new Error(`Object must be of type object or array! "${se(e)}" given.`);return e instanceof Z&&(e=e.value),e&&Ie(e)}function Nn(e,t,i,r={}){return t===1/0?r.level&&!q(e)?i([]):Oe(e,i,r):i(W(t,!1))}var $n={...ji,...$i},R=$n;var Bi=(e,...t)=>{let i=t.pop();if(e.constructor.name==="AsyncFunction")return at(e.call(...t),i);try{return i(e.call(...t))}catch(r){return i(void 0,r)}},at=(e,t)=>e instanceof Promise?e.then(t).catch(i=>t(void 0,i)):t(e),Hi=e=>typeof e=="object"&&e||typeof e=="function";function Ui(e){let t=typeof e[e.length-1]=="object"?e.pop():{},i=e.pop()||"";return t.functionParams=e,{source:i,params:t}}var Vr={};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],Hr=[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],Rn="\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",Ur="\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",Wi={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"},zi="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",Mn={5:zi,"5module":zi+" export import",6:zi+" const class extends export import super"},Dn=/^in(stanceof)?$/,Vn=new RegExp("["+Ur+"]"),Fn=new RegExp("["+Ur+Rn+"]");function Gi(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 Ot(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&Vn.test(String.fromCharCode(e)):t===!1?!1:Gi(e,Hr)}function ue(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&&Fn.test(String.fromCharCode(e)):t===!1?!1:Gi(e,Hr)||Gi(e,Ln)}var M=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 ct(e,t){return new M(e,{beforeExpr:!0,binop:t})}var lt={beforeExpr:!0},rt={startsExpr:!0},Yi={};function $(e,t){return t===void 0&&(t={}),t.keyword=e,Yi[e]=new M(e,t)}var h={num:new M("num",rt),regexp:new M("regexp",rt),string:new M("string",rt),name:new M("name",rt),privateId:new M("privateId",rt),eof:new M("eof"),bracketL:new M("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new M("]"),braceL:new M("{",{beforeExpr:!0,startsExpr:!0}),braceR:new M("}"),parenL:new M("(",{beforeExpr:!0,startsExpr:!0}),parenR:new M(")"),comma:new M(",",lt),semi:new M(";",lt),colon:new M(":",lt),dot:new M("."),question:new M("?",lt),questionDot:new M("?."),arrow:new M("=>",lt),template:new M("template"),invalidTemplate:new M("invalidTemplate"),ellipsis:new M("...",lt),backQuote:new M("`",rt),dollarBraceL:new M("${",{beforeExpr:!0,startsExpr:!0}),eq:new M("=",{beforeExpr:!0,isAssign:!0}),assign:new M("_=",{beforeExpr:!0,isAssign:!0}),incDec:new M("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new M("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:ct("||",1),logicalAND:ct("&&",2),bitwiseOR:ct("|",3),bitwiseXOR:ct("^",4),bitwiseAND:ct("&",5),equality:ct("==/!=/===/!==",6),relational:ct("</>/<=/>=",7),bitShift:ct("<</>>/>>>",8),plusMin:new M("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:ct("%",10),star:ct("*",10),slash:ct("/",10),starstar:new M("**",{beforeExpr:!0}),coalesce:ct("??",1),_break:$("break"),_case:$("case",lt),_catch:$("catch"),_continue:$("continue"),_debugger:$("debugger"),_default:$("default",lt),_do:$("do",{isLoop:!0,beforeExpr:!0}),_else:$("else",lt),_finally:$("finally"),_for:$("for",{isLoop:!0}),_function:$("function",rt),_if:$("if"),_return:$("return",lt),_switch:$("switch"),_throw:$("throw",lt),_try:$("try"),_var:$("var"),_const:$("const"),_while:$("while",{isLoop:!0}),_with:$("with"),_new:$("new",{beforeExpr:!0,startsExpr:!0}),_this:$("this",rt),_super:$("super",rt),_class:$("class",rt),_extends:$("extends",lt),_export:$("export"),_import:$("import",rt),_null:$("null",rt),_true:$("true",rt),_false:$("false",rt),_in:$("in",{beforeExpr:!0,binop:7}),_instanceof:$("instanceof",{beforeExpr:!0,binop:7}),_typeof:$("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:$("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:$("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},ft=/\r\n?|\n|\u2028|\u2029/,qn=new RegExp(ft.source,"g");function ce(e){return e===10||e===13||e===8232||e===8233}function Wr(e,t,i){i===void 0&&(i=e.length);for(var r=t;r<i;r++){var s=e.charCodeAt(r);if(ce(s))return r<i-1&&s===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var zr=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,ht=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Qr=Object.prototype,jn=Qr.hasOwnProperty,Bn=Qr.toString,De=Object.hasOwn||function(e,t){return jn.call(e,t)},Fr=Array.isArray||function(e){return Bn.call(e)==="[object Array]"};function zt(e){return new RegExp("^(?:"+e.replace(/ /g,"|")+")$")}function Mt(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var Hn=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Re=function(t,i){this.line=t,this.column=i};Re.prototype.offset=function(t){return new Re(this.line,this.column+t)};var hi=function(t,i,r){this.start=i,this.end=r,t.sourceFile!==null&&(this.source=t.sourceFile)};function Gr(e,t){for(var i=1,r=0;;){var s=Wr(e,r,t);if(s<0)return new Re(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},qr=!1;function Un(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?(!qr&&typeof console=="object"&&console.warn&&(qr=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required. 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),Fr(t.onToken)){var r=t.onToken;t.onToken=function(s){return r.push(s)}}return Fr(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 hi(this,a,o)),e.ranges&&(u.range=[s,n]),t.push(u)}}var Me=1,le=2,Ji=4,Kr=8,Xr=16,Yr=32,Zi=64,Jr=128,Ve=256,tr=Me|le|Ve;function er(e,t){return le|(e?Ji:0)|(t?Kr:0)}var ui=0,ir=1,It=2,Zr=3,ts=4,es=5,z=function(t,i,r){this.options=t=Un(t),this.sourceFile=t.sourceFile,this.keywords=zt(Mn[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var s="";t.allowReserved!==!0&&(s=Wi[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(s+=" await")),this.reservedWords=zt(s);var n=(s?s+" ":"")+Wi.strict;this.reservedWordsStrict=zt(n),this.reservedWordsStrictBind=zt(n+" "+Wi.strictBind),this.input=String(i),this.containsEsc=!1,r?(this.pos=r,this.lineStart=this.input.lastIndexOf(` `,r-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(ft).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=[]},vt={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}};z.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)};vt.inFunction.get=function(){return(this.currentVarScope().flags&le)>0};vt.inGenerator.get=function(){return(this.currentVarScope().flags&Kr)>0&&!this.currentVarScope().inClassFieldInit};vt.inAsync.get=function(){return(this.currentVarScope().flags&Ji)>0&&!this.currentVarScope().inClassFieldInit};vt.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e];if(t.inClassFieldInit||t.flags&Ve)return!1;if(t.flags&le)return(t.flags&Ji)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};vt.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(t&Zi)>0||i||this.options.allowSuperOutsideMethod};vt.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Jr)>0};vt.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};vt.allowNewDotTarget.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(t&(le|Ve))>0||i};vt.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Ve)>0};z.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};z.parse=function(t,i){return new this(i,t).parse()};z.parseExpressionAt=function(t,i,r){var s=new this(r,t,i);return s.nextToken(),s.parseExpression()};z.tokenizer=function(t,i){return new this(i,t)};Object.defineProperties(z.prototype,vt);var tt=z.prototype,zn=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;tt.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){ht.lastIndex=e,e+=ht.exec(this.input)[0].length;var t=zn.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){ht.lastIndex=e+t[0].length;var i=ht.exec(this.input),r=i.index+i[0].length,s=this.input.charAt(r);return s===";"||s==="}"||ft.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(s)||s==="!"&&this.input.charAt(r+1)==="=")}e+=t[0].length,ht.lastIndex=e,e+=ht.exec(this.input)[0].length,this.input[e]===";"&&e++}};tt.eat=function(e){return this.type===e?(this.next(),!0):!1};tt.isContextual=function(e){return this.type===h.name&&this.value===e&&!this.containsEsc};tt.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};tt.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};tt.canInsertSemicolon=function(){return this.type===h.eof||this.type===h.braceR||ft.test(this.input.slice(this.lastTokEnd,this.start))};tt.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};tt.semicolon=function(){!this.eat(h.semi)&&!this.insertSemicolon()&&this.unexpected()};tt.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0};tt.expect=function(e){this.eat(e)||this.unexpected()};tt.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var fi=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};tt.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")}};tt.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")};tt.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")};tt.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var I=z.prototype;I.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 rr={kind:"loop"},Qn={kind:"switch"};I.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;ht.lastIndex=this.pos;var t=ht.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(Ot(r,!0)){for(var s=i+1;ue(r=this.input.charCodeAt(s),!0);)++s;if(r===92||r>55295&&r<56320)return!0;var n=this.input.slice(i,s);if(!Dn.test(n))return!0}return!1};I.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;ht.lastIndex=this.pos;var e=ht.exec(this.input),t=this.pos+e[0].length,i;return!ft.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(ue(i=this.input.charCodeAt(t+8))||i>55295&&i<56320))};I.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){ht.lastIndex=this.pos;var a=ht.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 c=this.value,l=this.parseExpression();return r===h.name&&l.type==="Identifier"&&this.eat(h.colon)?this.parseLabeledStatement(s,c,l,e):this.parseExpressionStatement(s,l)}};I.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")};I.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")};I.parseDoStatement=function(e){return this.next(),this.labels.push(rr),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")};I.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(rr),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 fi,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))};I.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,Le|(i?0:Xi),!1,t)};I.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")};I.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")};I.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(h.braceL),this.labels.push(Qn),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")};I.parseThrowStatement=function(e){return this.next(),ft.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 Gn=[];I.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?Yr:0),this.checkLValPattern(t.param,i?ts:It),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")};I.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")};I.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(rr),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};I.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};I.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};I.parseLabeledStatement=function(e,t,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 c=this.labels[u];if(c.statementStart===e.start)c.statementStart=this.start,c.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")};I.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")};I.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")};I.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")};I.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")};I.parseVar=function(e,t,i){for(e.declarations=[],e.k