sveld 0.36.1 → 0.36.3
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/lib/browser.js +138 -138
- package/lib/{chunk-denfbw92.js → chunk-120ekvgm.js} +1 -1
- package/lib/{chunk-dcbq3977.js → chunk-5fcp13rt.js} +2 -2
- package/lib/chunk-5pnev3w1.js +20 -0
- package/lib/chunk-8avj9zpd.js +3 -0
- package/lib/{chunk-gc8z6pa7.js → chunk-9vv4gm0m.js} +2 -2
- package/lib/chunk-bng0x7cd.js +1 -0
- package/lib/chunk-eagrqdtg.js +1 -0
- package/lib/chunk-fwfazckg.js +4 -0
- package/lib/{chunk-t9d5k3p7.js → chunk-ndh639r1.js} +1 -1
- package/lib/chunk-vq3vjgvs.js +230 -0
- package/lib/chunk-zd76tr9f.js +6 -0
- package/lib/cli-entry.js +1 -1
- package/lib/index.d.ts +4 -4
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/lib/chunk-8myyzjb1.js +0 -4
- package/lib/chunk-a1rfbf45.js +0 -20
- package/lib/chunk-f7112d82.js +0 -1
- package/lib/chunk-h1r040pg.js +0 -6
- package/lib/chunk-nvawn7xk.js +0 -1
- package/lib/chunk-xryt7ad2.js +0 -3
- package/lib/chunk-zjxafk8n.js +0 -230
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ea as qU,fa as e,ha as p0}from"./chunk-t9d5k3p7.js";var H$=e((MY)=>{Object.defineProperty(MY,"__esModule",{value:!0});MY.boolean=oJ;MY.string=PY;MY.number=aJ;MY.error=tJ;MY.func=nJ;MY.array=DY;MY.stringArray=eJ;function oJ($){return $===!0||$===!1}function PY($){return typeof $==="string"||$ instanceof String}function aJ($){return typeof $==="number"||$ instanceof Number}function tJ($){return $ instanceof Error}function nJ($){return typeof $==="function"}function DY($){return Array.isArray($)}function eJ($){return DY($)&&$.every((Z)=>PY(Z))}});var Z6=e((j)=>{var U3=j&&j.__createBinding||(Object.create?function($,Z,Y,Q){if(Q===void 0)Q=Y;var G=Object.getOwnPropertyDescriptor(Z,Y);if(!G||("get"in G?!Z.__esModule:G.writable||G.configurable))G={enumerable:!0,get:function(){return Z[Y]}};Object.defineProperty($,Q,G)}:function($,Z,Y,Q){if(Q===void 0)Q=Y;$[Q]=Z[Y]}),W3=j&&j.__setModuleDefault||(Object.create?function($,Z){Object.defineProperty($,"default",{enumerable:!0,value:Z})}:function($,Z){$.default=Z}),V3=j&&j.__importStar||function(){var $=function(Z){return $=Object.getOwnPropertyNames||function(Y){var Q=[];for(var G in Y)if(Object.prototype.hasOwnProperty.call(Y,G))Q[Q.length]=G;return Q},$(Z)};return function(Z){if(Z&&Z.__esModule)return Z;var Y={};if(Z!=null){for(var Q=$(Z),G=0;G<Q.length;G++)if(Q[G]!=="default")U3(Y,Z,Q[G])}return W3(Y,Z),Y}}();Object.defineProperty(j,"__esModule",{value:!0});j.Message=j.NotificationType9=j.NotificationType8=j.NotificationType7=j.NotificationType6=j.NotificationType5=j.NotificationType4=j.NotificationType3=j.NotificationType2=j.NotificationType1=j.NotificationType0=j.NotificationType=j.RequestType9=j.RequestType8=j.RequestType7=j.RequestType6=j.RequestType5=j.RequestType4=j.RequestType3=j.RequestType2=j.RequestType1=j.RequestType=j.RequestType0=j.AbstractMessageSignature=j.ParameterStructures=j.ResponseError=j.ErrorCodes=void 0;var n0=V3(H$()),eZ;(function($){$.ParseError=-32700,$.InvalidRequest=-32600,$.MethodNotFound=-32601,$.InvalidParams=-32602,$.InternalError=-32603,$.jsonrpcReservedErrorRangeStart=-32099,$.serverErrorStart=-32099,$.MessageWriteError=-32099,$.MessageReadError=-32098,$.PendingResponseRejected=-32097,$.ConnectionInactive=-32096,$.ServerNotInitialized=-32002,$.UnknownErrorCode=-32001,$.jsonrpcReservedErrorRangeEnd=-32000,$.serverErrorEnd=-32000})(eZ||(j.ErrorCodes=eZ={}));class $6 extends Error{code;data;constructor($,Z,Y){super(Z);this.code=n0.number($)?$:eZ.UnknownErrorCode,this.data=Y,Object.setPrototypeOf(this,$6.prototype)}toJson(){let $={code:this.code,message:this.message};if(this.data!==void 0)$.data=this.data;return $}}j.ResponseError=$6;class V0{kind;static auto=new V0("auto");static byPosition=new V0("byPosition");static byName=new V0("byName");constructor($){this.kind=$}static is($){return $===V0.auto||$===V0.byName||$===V0.byPosition}toString(){return this.kind}}j.ParameterStructures=V0;class p{method;numberOfParams;constructor($,Z){this.method=$,this.numberOfParams=Z}get parameterStructures(){return V0.auto}}j.AbstractMessageSignature=p;class EY extends p{_;constructor($){super($,0)}}j.RequestType0=EY;class OY extends p{_parameterStructures;_;constructor($,Z=V0.auto){super($,1);this._parameterStructures=Z}get parameterStructures(){return this._parameterStructures}}j.RequestType=OY;class _Y extends p{_parameterStructures;_;constructor($,Z=V0.auto){super($,1);this._parameterStructures=Z}get parameterStructures(){return this._parameterStructures}}j.RequestType1=_Y;class TY extends p{_;constructor($){super($,2)}}j.RequestType2=TY;class vY extends p{_;constructor($){super($,3)}}j.RequestType3=vY;class fY extends p{_;constructor($){super($,4)}}j.RequestType4=fY;class kY extends p{_;constructor($){super($,5)}}j.RequestType5=kY;class CY extends p{_;constructor($){super($,6)}}j.RequestType6=CY;class FY extends p{_;constructor($){super($,7)}}j.RequestType7=FY;class hY extends p{_;constructor($){super($,8)}}j.RequestType8=hY;class NY extends p{_;constructor($){super($,9)}}j.RequestType9=NY;class uY extends p{_parameterStructures;_;constructor($,Z=V0.auto){super($,1);this._parameterStructures=Z}get parameterStructures(){return this._parameterStructures}}j.NotificationType=uY;class KY extends p{_;constructor($){super($,0)}}j.NotificationType0=KY;class bY extends p{_parameterStructures;_;constructor($,Z=V0.auto){super($,1);this._parameterStructures=Z}get parameterStructures(){return this._parameterStructures}}j.NotificationType1=bY;class SY extends p{_;constructor($){super($,2)}}j.NotificationType2=SY;class xY extends p{_;constructor($){super($,3)}}j.NotificationType3=xY;class gY extends p{_;constructor($){super($,4)}}j.NotificationType4=gY;class pY extends p{_;constructor($){super($,5)}}j.NotificationType5=pY;class yY extends p{_;constructor($){super($,6)}}j.NotificationType6=yY;class mY extends p{_;constructor($){super($,7)}}j.NotificationType7=mY;class cY extends p{_;constructor($){super($,8)}}j.NotificationType8=cY;class lY extends p{_;constructor($){super($,9)}}j.NotificationType9=lY;var jY;(function($){function Z(G){let J=G;return J&&n0.string(J.method)&&(n0.string(J.id)||n0.number(J.id))}$.isRequest=Z;function Y(G){let J=G;return J&&n0.string(J.method)&&G.id===void 0}$.isNotification=Y;function Q(G){let J=G;return J&&(J.result!==void 0||!!J.error)&&(n0.string(J.id)||n0.number(J.id)||J.id===null)}$.isResponse=Q})(jY||(j.Message=jY={}))});var X6=e((sY)=>{Object.defineProperty(sY,"__esModule",{value:!0});sY.LRUCache=sY.LinkedMap=sY.Touch=void 0;var $0;(function($){$.None=0,$.First=1,$.AsOld=$.First,$.Last=2,$.AsNew=$.Last})($0||(sY.Touch=$0={}));class Y6{[Symbol.toStringTag]="LinkedMap";_map;_head;_tail;_size;_state;constructor(){this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}before($){let Z=this._map.get($);return Z?Z.previous?.value:void 0}after($){let Z=this._map.get($);return Z?Z.next?.value:void 0}has($){return this._map.has($)}get($,Z=$0.None){let Y=this._map.get($);if(!Y)return;if(Z!==$0.None)this.touch(Y,Z);return Y.value}set($,Z,Y=$0.None){let Q=this._map.get($);if(Q){if(Q.value=Z,Y!==$0.None)this.touch(Q,Y)}else{switch(Q={key:$,value:Z,next:void 0,previous:void 0},Y){case $0.None:this.addItemLast(Q);break;case $0.First:this.addItemFirst(Q);break;case $0.Last:this.addItemLast(Q);break;default:this.addItemLast(Q);break}this._map.set($,Q),this._size++}return this}delete($){return!!this.remove($)}remove($){let Z=this._map.get($);if(!Z)return;return this._map.delete($),this.removeItem(Z),this._size--,Z.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw Error("Invalid list");let $=this._head;return this._map.delete($.key),this.removeItem($),this._size--,$.value}forEach($,Z){let Y=this._state,Q=this._head;while(Q){if(Z)$.bind(Z)(Q.value,Q.key,this);else $(Q.value,Q.key,this);if(this._state!==Y)throw Error("LinkedMap got modified during iteration.");Q=Q.next}}keys(){let $=this._state,Z=this._head,Y={[Symbol.iterator]:()=>{return Y},next:()=>{if(this._state!==$)throw Error("LinkedMap got modified during iteration.");if(Z){let Q={value:Z.key,done:!1};return Z=Z.next,Q}else return{value:void 0,done:!0}}};return Y}values(){let $=this._state,Z=this._head,Y={[Symbol.iterator]:()=>{return Y},next:()=>{if(this._state!==$)throw Error("LinkedMap got modified during iteration.");if(Z){let Q={value:Z.value,done:!1};return Z=Z.next,Q}else return{value:void 0,done:!0}}};return Y}entries(){let $=this._state,Z=this._head,Y={[Symbol.iterator]:()=>{return Y},next:()=>{if(this._state!==$)throw Error("LinkedMap got modified during iteration.");if(Z){let Q={value:[Z.key,Z.value],done:!1};return Z=Z.next,Q}else return{value:void 0,done:!0}}};return Y}[Symbol.iterator](){return this.entries()}trimOld($){if($>=this.size)return;if($===0){this.clear();return}let Z=this._head,Y=this.size;while(Z&&Y>$)this._map.delete(Z.key),Z=Z.next,Y--;if(this._head=Z,this._size=Y,Z)Z.previous=void 0;this._state++}addItemFirst($){if(!this._head&&!this._tail)this._tail=$;else if(!this._head)throw Error("Invalid list");else $.next=this._head,this._head.previous=$;this._head=$,this._state++}addItemLast($){if(!this._head&&!this._tail)this._head=$;else if(!this._tail)throw Error("Invalid list");else $.previous=this._tail,this._tail.next=$;this._tail=$,this._state++}removeItem($){if($===this._head&&$===this._tail)this._head=void 0,this._tail=void 0;else if($===this._head){if(!$.next)throw Error("Invalid list");$.next.previous=void 0,this._head=$.next}else if($===this._tail){if(!$.previous)throw Error("Invalid list");$.previous.next=void 0,this._tail=$.previous}else{let{next:Z,previous:Y}=$;if(!Z||!Y)throw Error("Invalid list");Z.previous=Y,Y.next=Z}$.next=void 0,$.previous=void 0,this._state++}touch($,Z){if(!this._head||!this._tail)throw Error("Invalid list");if(Z!==$0.First&&Z!==$0.Last)return;if(Z===$0.First){if($===this._head)return;let{next:Y,previous:Q}=$;if($===this._tail)Q.next=void 0,this._tail=Q;else Y.previous=Q,Q.next=Y;$.previous=void 0,$.next=this._head,this._head.previous=$,this._head=$,this._state++}else if(Z===$0.Last){if($===this._tail)return;let{next:Y,previous:Q}=$;if($===this._head)Y.previous=void 0,this._head=Y;else Y.previous=Q,Q.next=Y;$.next=void 0,$.previous=this._tail,this._tail.next=$,this._tail=$,this._state++}}toJSON(){let $=[];return this.forEach((Z,Y)=>{$.push([Y,Z])}),$}fromJSON($){this.clear();for(let[Z,Y]of $)this.set(Z,Y)}}sY.LinkedMap=Y6;class rY extends Y6{_limit;_ratio;constructor($,Z=1){super();this._limit=$,this._ratio=Math.min(Math.max(0,Z),1)}get limit(){return this._limit}set limit($){this._limit=$,this.checkTrim()}get ratio(){return this._ratio}set ratio($){this._ratio=Math.min(Math.max(0,$),1),this.checkTrim()}get($,Z=$0.AsNew){return super.get($,Z)}peek($){return super.get($,$0.None)}set($,Z){return super.set($,Z,$0.Last),this.checkTrim(),this}checkTrim(){if(this.size>this._limit)this.trimOld(Math.round(this._limit*this._ratio))}}sY.LRUCache=rY});var tY=e((oY)=>{Object.defineProperty(oY,"__esModule",{value:!0});oY.Disposable=void 0;var dY;(function($){function Z(Y){return{dispose:Y}}$.create=Z})(dY||(oY.Disposable=dY={}))});var x0=e((nY)=>{Object.defineProperty(nY,"__esModule",{value:!0});var Q6;function G6(){if(Q6===void 0)throw Error("No runtime abstraction layer installed");return Q6}(function($){function Z(Y){if(Y===void 0)throw Error("No runtime abstraction layer provided");Q6=Y}$.install=Z})(G6||(G6={}));nY.default=G6});var z$=e((g0)=>{var q3=g0&&g0.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(g0,"__esModule",{value:!0});g0.Emitter=g0.Event=void 0;var B3=q3(x0()),eY;(function($){let Z={dispose(){}};$.None=function(){return Z}})(eY||(g0.Event=eY={}));class $X{_callbacks;_contexts;add($,Z=null,Y){if(!this._callbacks)this._callbacks=[],this._contexts=[];if(this._callbacks.push($),this._contexts.push(Z),Array.isArray(Y))Y.push({dispose:()=>this.remove($,Z)})}remove($,Z=null){if(!this._callbacks)return;let Y=!1;for(let Q=0,G=this._callbacks.length;Q<G;Q++)if(this._callbacks[Q]===$)if(this._contexts[Q]===Z){this._callbacks.splice(Q,1),this._contexts.splice(Q,1);return}else Y=!0;if(Y)throw Error("When adding a listener with a context, you should remove it with the same context")}invoke(...$){if(!this._callbacks)return[];let Z=[],Y=this._callbacks.slice(0),Q=this._contexts.slice(0);for(let G=0,J=Y.length;G<J;G++)try{Z.push(Y[G].apply(Q[G],$))}catch(V){(0,B3.default)().console.error(V)}return Z}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}}class J6{_options;static _noop=function(){};_event;_callbacks;constructor($){this._options=$}get event(){if(!this._event)this._event=($,Z,Y)=>{if(!this._callbacks)this._callbacks=new $X;if(this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty())this._options.onFirstListenerAdd(this);this._callbacks.add($,Z);let Q={dispose:()=>{if(!this._callbacks)return;if(this._callbacks.remove($,Z),Q.dispose=J6._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty())this._options.onLastListenerRemove(this)}};if(Array.isArray(Y))Y.push(Q);return Q};return this._event}fire($){if(this._callbacks)this._callbacks.invoke.call(this._callbacks,$)}dispose(){if(this._callbacks)this._callbacks.dispose(),this._callbacks=void 0}}g0.Emitter=J6});var HZ=e((J0)=>{var L3=J0&&J0.__createBinding||(Object.create?function($,Z,Y,Q){if(Q===void 0)Q=Y;var G=Object.getOwnPropertyDescriptor(Z,Y);if(!G||("get"in G?!Z.__esModule:G.writable||G.configurable))G={enumerable:!0,get:function(){return Z[Y]}};Object.defineProperty($,Q,G)}:function($,Z,Y,Q){if(Q===void 0)Q=Y;$[Q]=Z[Y]}),A3=J0&&J0.__setModuleDefault||(Object.create?function($,Z){Object.defineProperty($,"default",{enumerable:!0,value:Z})}:function($,Z){$.default=Z}),R3=J0&&J0.__importStar||function(){var $=function(Z){return $=Object.getOwnPropertyNames||function(Y){var Q=[];for(var G in Y)if(Object.prototype.hasOwnProperty.call(Y,G))Q[Q.length]=G;return Q},$(Z)};return function(Z){if(Z&&Z.__esModule)return Z;var Y={};if(Z!=null){for(var Q=$(Z),G=0;G<Q.length;G++)if(Q[G]!=="default")L3(Y,Z,Q[G])}return A3(Y,Z),Y}}(),I3=J0&&J0.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(J0,"__esModule",{value:!0});J0.CancellationTokenSource=J0.CancellationToken=void 0;var P3=I3(x0()),D3=R3(H$()),U6=z$(),VZ;(function($){$.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:U6.Event.None}),$.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:U6.Event.None});function Z(Y){let Q=Y;return Q&&(Q===$.None||Q===$.Cancelled||D3.boolean(Q.isCancellationRequested)&&!!Q.onCancellationRequested)}$.is=Z})(VZ||(J0.CancellationToken=VZ={}));var M3=Object.freeze(function($,Z){let Y=(0,P3.default)().timer.setTimeout($.bind(Z),0);return{dispose(){Y.dispose()}}});class W6{_isCancelled=!1;_emitter;cancel(){if(!this._isCancelled){if(this._isCancelled=!0,this._emitter)this._emitter.fire(void 0),this.dispose()}}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){if(this._isCancelled)return M3;if(!this._emitter)this._emitter=new U6.Emitter;return this._emitter.event}dispose(){if(this._emitter)this._emitter.dispose(),this._emitter=void 0}}class ZX{_token;get token(){if(!this._token)this._token=new W6;return this._token}cancel(){if(!this._token)this._token=VZ.Cancelled;else this._token.cancel()}dispose(){if(!this._token)this._token=VZ.None;else if(this._token instanceof W6)this._token.dispose()}}J0.CancellationTokenSource=ZX});var WX=e((JX)=>{Object.defineProperty(JX,"__esModule",{value:!0});JX.SharedArrayReceiverStrategy=JX.SharedArraySenderStrategy=void 0;var j3=HZ(),h$;(function($){$.Continue=0,$.Cancelled=1})(h$||(h$={}));class YX{buffers;constructor(){this.buffers=new Map}enableCancellation($){if($.id===null)return;let Z=new SharedArrayBuffer(4),Y=new Int32Array(Z,0,1);Y[0]=h$.Continue,this.buffers.set($.id,Z),$.$cancellationData=Z}async sendCancellation($,Z){let Y=this.buffers.get(Z);if(Y===void 0)return;let Q=new Int32Array(Y,0,1);Atomics.store(Q,0,h$.Cancelled)}cleanup($){this.buffers.delete($)}dispose(){this.buffers.clear()}}JX.SharedArraySenderStrategy=YX;class XX{data;constructor($){this.data=new Int32Array($,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===h$.Cancelled}get onCancellationRequested(){throw Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class QX{token;constructor($){this.token=new XX($)}cancel(){}dispose(){}}class GX{kind="request";createCancellationTokenSource($){let Z=$.$cancellationData;if(Z===void 0)return new j3.CancellationTokenSource;return new QX(Z)}}JX.SharedArrayReceiverStrategy=GX});var V6=e((w$)=>{var O3=w$&&w$.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(w$,"__esModule",{value:!0});w$.Semaphore=void 0;var _3=O3(x0());class VX{_capacity;_active;_waiting;constructor($=1){if($<=0)throw Error("Capacity must be greater than 0");this._capacity=$,this._active=0,this._waiting=[]}lock($){return new Promise((Z,Y)=>{this._waiting.push({thunk:$,resolve:Z,reject:Y}),this.runNext()})}get active(){return this._active}runNext(){if(this._waiting.length===0||this._active===this._capacity)return;(0,_3.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let $=this._waiting.shift();if(this._active++,this._active>this._capacity)throw Error("Too many thunks active");try{let Z=$.thunk();if(Z instanceof Promise)Z.then((Y)=>{this._active--,$.resolve(Y),this.runNext()},(Y)=>{this._active--,$.reject(Y),this.runNext()});else this._active--,$.resolve(Z),this.runNext()}catch(Z){this._active--,$.reject(Z),this.runNext()}}}w$.Semaphore=VX});var wX=e((Z0)=>{var T3=Z0&&Z0.__createBinding||(Object.create?function($,Z,Y,Q){if(Q===void 0)Q=Y;var G=Object.getOwnPropertyDescriptor(Z,Y);if(!G||("get"in G?!Z.__esModule:G.writable||G.configurable))G={enumerable:!0,get:function(){return Z[Y]}};Object.defineProperty($,Q,G)}:function($,Z,Y,Q){if(Q===void 0)Q=Y;$[Q]=Z[Y]}),v3=Z0&&Z0.__setModuleDefault||(Object.create?function($,Z){Object.defineProperty($,"default",{enumerable:!0,value:Z})}:function($,Z){$.default=Z}),f3=Z0&&Z0.__importStar||function(){var $=function(Z){return $=Object.getOwnPropertyNames||function(Y){var Q=[];for(var G in Y)if(Object.prototype.hasOwnProperty.call(Y,G))Q[Q.length]=G;return Q},$(Z)};return function(Z){if(Z&&Z.__esModule)return Z;var Y={};if(Z!=null){for(var Q=$(Z),G=0;G<Q.length;G++)if(Q[G]!=="default")T3(Y,Z,Q[G])}return v3(Y,Z),Y}}(),k3=Z0&&Z0.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(Z0,"__esModule",{value:!0});Z0.ReadableStreamMessageReader=Z0.AbstractMessageReader=Z0.MessageReader=void 0;var z6=k3(x0()),q$=f3(H$()),H6=z$(),C3=V6(),HX;(function($){function Z(Y){let Q=Y;return Q&&q$.func(Q.listen)&&q$.func(Q.dispose)&&q$.func(Q.onError)&&q$.func(Q.onClose)&&q$.func(Q.onPartialMessage)}$.is=Z})(HX||(Z0.MessageReader=HX={}));class q6{errorEmitter;closeEmitter;partialMessageEmitter;constructor(){this.errorEmitter=new H6.Emitter,this.closeEmitter=new H6.Emitter,this.partialMessageEmitter=new H6.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose(),this.partialMessageEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError($){this.errorEmitter.fire(this.asError($))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage($){this.partialMessageEmitter.fire($)}asError($){if($ instanceof Error)return $;else return Error(`Reader received error. Reason: ${q$.string($.message)?$.message:"unknown"}`)}}Z0.AbstractMessageReader=q6;var w6;(function($){function Z(Y){let Q,G,J,V=new Map,L,P=new Map;if(Y===void 0||typeof Y==="string")Q=Y??"utf-8";else{if(Q=Y.charset??"utf-8",Y.contentDecoder!==void 0)J=Y.contentDecoder,V.set(J.name,J);if(Y.contentDecoders!==void 0)for(let _ of Y.contentDecoders)V.set(_.name,_);if(Y.contentTypeDecoder!==void 0)L=Y.contentTypeDecoder,P.set(L.name,L);if(Y.contentTypeDecoders!==void 0)for(let _ of Y.contentTypeDecoders)P.set(_.name,_)}if(L===void 0)L=(0,z6.default)().applicationJson.decoder,P.set(L.name,L);return{charset:Q,contentDecoder:J,contentDecoders:V,contentTypeDecoder:L,contentTypeDecoders:P}}$.fromOptions=Z})(w6||(w6={}));class zX extends q6{readable;options;callback;nextMessageLength;messageToken;buffer;partialMessageTimer;_partialMessageTimeout;readSemaphore;constructor($,Z){super();this.readable=$,this.options=w6.fromOptions(Z),this.buffer=(0,z6.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new C3.Semaphore(1)}set partialMessageTimeout($){this._partialMessageTimeout=$}get partialMessageTimeout(){return this._partialMessageTimeout}listen($){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=$;let Z=this.readable.onData((Y)=>{this.onData(Y)});return this.readable.onError((Y)=>this.fireError(Y)),this.readable.onClose(()=>this.fireClose()),Z}onData($){try{this.buffer.append($);while(!0){if(this.nextMessageLength===-1){let Y=this.buffer.tryReadHeaders(!0);if(!Y)return;let Q=Y.get("content-length");if(!Q){this.fireError(Error(`Header must provide a Content-Length property.
|
|
1
|
+
import{ga as qU,ha as e,ja as p0}from"./chunk-ndh639r1.js";var H$=e((MY)=>{Object.defineProperty(MY,"__esModule",{value:!0});MY.boolean=oJ;MY.string=PY;MY.number=aJ;MY.error=tJ;MY.func=nJ;MY.array=DY;MY.stringArray=eJ;function oJ($){return $===!0||$===!1}function PY($){return typeof $==="string"||$ instanceof String}function aJ($){return typeof $==="number"||$ instanceof Number}function tJ($){return $ instanceof Error}function nJ($){return typeof $==="function"}function DY($){return Array.isArray($)}function eJ($){return DY($)&&$.every((Z)=>PY(Z))}});var Z6=e((j)=>{var U3=j&&j.__createBinding||(Object.create?function($,Z,Y,Q){if(Q===void 0)Q=Y;var G=Object.getOwnPropertyDescriptor(Z,Y);if(!G||("get"in G?!Z.__esModule:G.writable||G.configurable))G={enumerable:!0,get:function(){return Z[Y]}};Object.defineProperty($,Q,G)}:function($,Z,Y,Q){if(Q===void 0)Q=Y;$[Q]=Z[Y]}),W3=j&&j.__setModuleDefault||(Object.create?function($,Z){Object.defineProperty($,"default",{enumerable:!0,value:Z})}:function($,Z){$.default=Z}),V3=j&&j.__importStar||function(){var $=function(Z){return $=Object.getOwnPropertyNames||function(Y){var Q=[];for(var G in Y)if(Object.prototype.hasOwnProperty.call(Y,G))Q[Q.length]=G;return Q},$(Z)};return function(Z){if(Z&&Z.__esModule)return Z;var Y={};if(Z!=null){for(var Q=$(Z),G=0;G<Q.length;G++)if(Q[G]!=="default")U3(Y,Z,Q[G])}return W3(Y,Z),Y}}();Object.defineProperty(j,"__esModule",{value:!0});j.Message=j.NotificationType9=j.NotificationType8=j.NotificationType7=j.NotificationType6=j.NotificationType5=j.NotificationType4=j.NotificationType3=j.NotificationType2=j.NotificationType1=j.NotificationType0=j.NotificationType=j.RequestType9=j.RequestType8=j.RequestType7=j.RequestType6=j.RequestType5=j.RequestType4=j.RequestType3=j.RequestType2=j.RequestType1=j.RequestType=j.RequestType0=j.AbstractMessageSignature=j.ParameterStructures=j.ResponseError=j.ErrorCodes=void 0;var n0=V3(H$()),eZ;(function($){$.ParseError=-32700,$.InvalidRequest=-32600,$.MethodNotFound=-32601,$.InvalidParams=-32602,$.InternalError=-32603,$.jsonrpcReservedErrorRangeStart=-32099,$.serverErrorStart=-32099,$.MessageWriteError=-32099,$.MessageReadError=-32098,$.PendingResponseRejected=-32097,$.ConnectionInactive=-32096,$.ServerNotInitialized=-32002,$.UnknownErrorCode=-32001,$.jsonrpcReservedErrorRangeEnd=-32000,$.serverErrorEnd=-32000})(eZ||(j.ErrorCodes=eZ={}));class $6 extends Error{code;data;constructor($,Z,Y){super(Z);this.code=n0.number($)?$:eZ.UnknownErrorCode,this.data=Y,Object.setPrototypeOf(this,$6.prototype)}toJson(){let $={code:this.code,message:this.message};if(this.data!==void 0)$.data=this.data;return $}}j.ResponseError=$6;class V0{kind;static auto=new V0("auto");static byPosition=new V0("byPosition");static byName=new V0("byName");constructor($){this.kind=$}static is($){return $===V0.auto||$===V0.byName||$===V0.byPosition}toString(){return this.kind}}j.ParameterStructures=V0;class p{method;numberOfParams;constructor($,Z){this.method=$,this.numberOfParams=Z}get parameterStructures(){return V0.auto}}j.AbstractMessageSignature=p;class EY extends p{_;constructor($){super($,0)}}j.RequestType0=EY;class OY extends p{_parameterStructures;_;constructor($,Z=V0.auto){super($,1);this._parameterStructures=Z}get parameterStructures(){return this._parameterStructures}}j.RequestType=OY;class _Y extends p{_parameterStructures;_;constructor($,Z=V0.auto){super($,1);this._parameterStructures=Z}get parameterStructures(){return this._parameterStructures}}j.RequestType1=_Y;class TY extends p{_;constructor($){super($,2)}}j.RequestType2=TY;class vY extends p{_;constructor($){super($,3)}}j.RequestType3=vY;class fY extends p{_;constructor($){super($,4)}}j.RequestType4=fY;class kY extends p{_;constructor($){super($,5)}}j.RequestType5=kY;class CY extends p{_;constructor($){super($,6)}}j.RequestType6=CY;class FY extends p{_;constructor($){super($,7)}}j.RequestType7=FY;class hY extends p{_;constructor($){super($,8)}}j.RequestType8=hY;class NY extends p{_;constructor($){super($,9)}}j.RequestType9=NY;class uY extends p{_parameterStructures;_;constructor($,Z=V0.auto){super($,1);this._parameterStructures=Z}get parameterStructures(){return this._parameterStructures}}j.NotificationType=uY;class KY extends p{_;constructor($){super($,0)}}j.NotificationType0=KY;class bY extends p{_parameterStructures;_;constructor($,Z=V0.auto){super($,1);this._parameterStructures=Z}get parameterStructures(){return this._parameterStructures}}j.NotificationType1=bY;class SY extends p{_;constructor($){super($,2)}}j.NotificationType2=SY;class xY extends p{_;constructor($){super($,3)}}j.NotificationType3=xY;class gY extends p{_;constructor($){super($,4)}}j.NotificationType4=gY;class pY extends p{_;constructor($){super($,5)}}j.NotificationType5=pY;class yY extends p{_;constructor($){super($,6)}}j.NotificationType6=yY;class mY extends p{_;constructor($){super($,7)}}j.NotificationType7=mY;class cY extends p{_;constructor($){super($,8)}}j.NotificationType8=cY;class lY extends p{_;constructor($){super($,9)}}j.NotificationType9=lY;var jY;(function($){function Z(G){let J=G;return J&&n0.string(J.method)&&(n0.string(J.id)||n0.number(J.id))}$.isRequest=Z;function Y(G){let J=G;return J&&n0.string(J.method)&&G.id===void 0}$.isNotification=Y;function Q(G){let J=G;return J&&(J.result!==void 0||!!J.error)&&(n0.string(J.id)||n0.number(J.id)||J.id===null)}$.isResponse=Q})(jY||(j.Message=jY={}))});var X6=e((sY)=>{Object.defineProperty(sY,"__esModule",{value:!0});sY.LRUCache=sY.LinkedMap=sY.Touch=void 0;var $0;(function($){$.None=0,$.First=1,$.AsOld=$.First,$.Last=2,$.AsNew=$.Last})($0||(sY.Touch=$0={}));class Y6{[Symbol.toStringTag]="LinkedMap";_map;_head;_tail;_size;_state;constructor(){this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}before($){let Z=this._map.get($);return Z?Z.previous?.value:void 0}after($){let Z=this._map.get($);return Z?Z.next?.value:void 0}has($){return this._map.has($)}get($,Z=$0.None){let Y=this._map.get($);if(!Y)return;if(Z!==$0.None)this.touch(Y,Z);return Y.value}set($,Z,Y=$0.None){let Q=this._map.get($);if(Q){if(Q.value=Z,Y!==$0.None)this.touch(Q,Y)}else{switch(Q={key:$,value:Z,next:void 0,previous:void 0},Y){case $0.None:this.addItemLast(Q);break;case $0.First:this.addItemFirst(Q);break;case $0.Last:this.addItemLast(Q);break;default:this.addItemLast(Q);break}this._map.set($,Q),this._size++}return this}delete($){return!!this.remove($)}remove($){let Z=this._map.get($);if(!Z)return;return this._map.delete($),this.removeItem(Z),this._size--,Z.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw Error("Invalid list");let $=this._head;return this._map.delete($.key),this.removeItem($),this._size--,$.value}forEach($,Z){let Y=this._state,Q=this._head;while(Q){if(Z)$.bind(Z)(Q.value,Q.key,this);else $(Q.value,Q.key,this);if(this._state!==Y)throw Error("LinkedMap got modified during iteration.");Q=Q.next}}keys(){let $=this._state,Z=this._head,Y={[Symbol.iterator]:()=>{return Y},next:()=>{if(this._state!==$)throw Error("LinkedMap got modified during iteration.");if(Z){let Q={value:Z.key,done:!1};return Z=Z.next,Q}else return{value:void 0,done:!0}}};return Y}values(){let $=this._state,Z=this._head,Y={[Symbol.iterator]:()=>{return Y},next:()=>{if(this._state!==$)throw Error("LinkedMap got modified during iteration.");if(Z){let Q={value:Z.value,done:!1};return Z=Z.next,Q}else return{value:void 0,done:!0}}};return Y}entries(){let $=this._state,Z=this._head,Y={[Symbol.iterator]:()=>{return Y},next:()=>{if(this._state!==$)throw Error("LinkedMap got modified during iteration.");if(Z){let Q={value:[Z.key,Z.value],done:!1};return Z=Z.next,Q}else return{value:void 0,done:!0}}};return Y}[Symbol.iterator](){return this.entries()}trimOld($){if($>=this.size)return;if($===0){this.clear();return}let Z=this._head,Y=this.size;while(Z&&Y>$)this._map.delete(Z.key),Z=Z.next,Y--;if(this._head=Z,this._size=Y,Z)Z.previous=void 0;this._state++}addItemFirst($){if(!this._head&&!this._tail)this._tail=$;else if(!this._head)throw Error("Invalid list");else $.next=this._head,this._head.previous=$;this._head=$,this._state++}addItemLast($){if(!this._head&&!this._tail)this._head=$;else if(!this._tail)throw Error("Invalid list");else $.previous=this._tail,this._tail.next=$;this._tail=$,this._state++}removeItem($){if($===this._head&&$===this._tail)this._head=void 0,this._tail=void 0;else if($===this._head){if(!$.next)throw Error("Invalid list");$.next.previous=void 0,this._head=$.next}else if($===this._tail){if(!$.previous)throw Error("Invalid list");$.previous.next=void 0,this._tail=$.previous}else{let{next:Z,previous:Y}=$;if(!Z||!Y)throw Error("Invalid list");Z.previous=Y,Y.next=Z}$.next=void 0,$.previous=void 0,this._state++}touch($,Z){if(!this._head||!this._tail)throw Error("Invalid list");if(Z!==$0.First&&Z!==$0.Last)return;if(Z===$0.First){if($===this._head)return;let{next:Y,previous:Q}=$;if($===this._tail)Q.next=void 0,this._tail=Q;else Y.previous=Q,Q.next=Y;$.previous=void 0,$.next=this._head,this._head.previous=$,this._head=$,this._state++}else if(Z===$0.Last){if($===this._tail)return;let{next:Y,previous:Q}=$;if($===this._head)Y.previous=void 0,this._head=Y;else Y.previous=Q,Q.next=Y;$.next=void 0,$.previous=this._tail,this._tail.next=$,this._tail=$,this._state++}}toJSON(){let $=[];return this.forEach((Z,Y)=>{$.push([Y,Z])}),$}fromJSON($){this.clear();for(let[Z,Y]of $)this.set(Z,Y)}}sY.LinkedMap=Y6;class rY extends Y6{_limit;_ratio;constructor($,Z=1){super();this._limit=$,this._ratio=Math.min(Math.max(0,Z),1)}get limit(){return this._limit}set limit($){this._limit=$,this.checkTrim()}get ratio(){return this._ratio}set ratio($){this._ratio=Math.min(Math.max(0,$),1),this.checkTrim()}get($,Z=$0.AsNew){return super.get($,Z)}peek($){return super.get($,$0.None)}set($,Z){return super.set($,Z,$0.Last),this.checkTrim(),this}checkTrim(){if(this.size>this._limit)this.trimOld(Math.round(this._limit*this._ratio))}}sY.LRUCache=rY});var tY=e((oY)=>{Object.defineProperty(oY,"__esModule",{value:!0});oY.Disposable=void 0;var dY;(function($){function Z(Y){return{dispose:Y}}$.create=Z})(dY||(oY.Disposable=dY={}))});var x0=e((nY)=>{Object.defineProperty(nY,"__esModule",{value:!0});var Q6;function G6(){if(Q6===void 0)throw Error("No runtime abstraction layer installed");return Q6}(function($){function Z(Y){if(Y===void 0)throw Error("No runtime abstraction layer provided");Q6=Y}$.install=Z})(G6||(G6={}));nY.default=G6});var z$=e((g0)=>{var q3=g0&&g0.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(g0,"__esModule",{value:!0});g0.Emitter=g0.Event=void 0;var B3=q3(x0()),eY;(function($){let Z={dispose(){}};$.None=function(){return Z}})(eY||(g0.Event=eY={}));class $X{_callbacks;_contexts;add($,Z=null,Y){if(!this._callbacks)this._callbacks=[],this._contexts=[];if(this._callbacks.push($),this._contexts.push(Z),Array.isArray(Y))Y.push({dispose:()=>this.remove($,Z)})}remove($,Z=null){if(!this._callbacks)return;let Y=!1;for(let Q=0,G=this._callbacks.length;Q<G;Q++)if(this._callbacks[Q]===$)if(this._contexts[Q]===Z){this._callbacks.splice(Q,1),this._contexts.splice(Q,1);return}else Y=!0;if(Y)throw Error("When adding a listener with a context, you should remove it with the same context")}invoke(...$){if(!this._callbacks)return[];let Z=[],Y=this._callbacks.slice(0),Q=this._contexts.slice(0);for(let G=0,J=Y.length;G<J;G++)try{Z.push(Y[G].apply(Q[G],$))}catch(V){(0,B3.default)().console.error(V)}return Z}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}}class J6{_options;static _noop=function(){};_event;_callbacks;constructor($){this._options=$}get event(){if(!this._event)this._event=($,Z,Y)=>{if(!this._callbacks)this._callbacks=new $X;if(this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty())this._options.onFirstListenerAdd(this);this._callbacks.add($,Z);let Q={dispose:()=>{if(!this._callbacks)return;if(this._callbacks.remove($,Z),Q.dispose=J6._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty())this._options.onLastListenerRemove(this)}};if(Array.isArray(Y))Y.push(Q);return Q};return this._event}fire($){if(this._callbacks)this._callbacks.invoke.call(this._callbacks,$)}dispose(){if(this._callbacks)this._callbacks.dispose(),this._callbacks=void 0}}g0.Emitter=J6});var HZ=e((J0)=>{var L3=J0&&J0.__createBinding||(Object.create?function($,Z,Y,Q){if(Q===void 0)Q=Y;var G=Object.getOwnPropertyDescriptor(Z,Y);if(!G||("get"in G?!Z.__esModule:G.writable||G.configurable))G={enumerable:!0,get:function(){return Z[Y]}};Object.defineProperty($,Q,G)}:function($,Z,Y,Q){if(Q===void 0)Q=Y;$[Q]=Z[Y]}),A3=J0&&J0.__setModuleDefault||(Object.create?function($,Z){Object.defineProperty($,"default",{enumerable:!0,value:Z})}:function($,Z){$.default=Z}),R3=J0&&J0.__importStar||function(){var $=function(Z){return $=Object.getOwnPropertyNames||function(Y){var Q=[];for(var G in Y)if(Object.prototype.hasOwnProperty.call(Y,G))Q[Q.length]=G;return Q},$(Z)};return function(Z){if(Z&&Z.__esModule)return Z;var Y={};if(Z!=null){for(var Q=$(Z),G=0;G<Q.length;G++)if(Q[G]!=="default")L3(Y,Z,Q[G])}return A3(Y,Z),Y}}(),I3=J0&&J0.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(J0,"__esModule",{value:!0});J0.CancellationTokenSource=J0.CancellationToken=void 0;var P3=I3(x0()),D3=R3(H$()),U6=z$(),VZ;(function($){$.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:U6.Event.None}),$.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:U6.Event.None});function Z(Y){let Q=Y;return Q&&(Q===$.None||Q===$.Cancelled||D3.boolean(Q.isCancellationRequested)&&!!Q.onCancellationRequested)}$.is=Z})(VZ||(J0.CancellationToken=VZ={}));var M3=Object.freeze(function($,Z){let Y=(0,P3.default)().timer.setTimeout($.bind(Z),0);return{dispose(){Y.dispose()}}});class W6{_isCancelled=!1;_emitter;cancel(){if(!this._isCancelled){if(this._isCancelled=!0,this._emitter)this._emitter.fire(void 0),this.dispose()}}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){if(this._isCancelled)return M3;if(!this._emitter)this._emitter=new U6.Emitter;return this._emitter.event}dispose(){if(this._emitter)this._emitter.dispose(),this._emitter=void 0}}class ZX{_token;get token(){if(!this._token)this._token=new W6;return this._token}cancel(){if(!this._token)this._token=VZ.Cancelled;else this._token.cancel()}dispose(){if(!this._token)this._token=VZ.None;else if(this._token instanceof W6)this._token.dispose()}}J0.CancellationTokenSource=ZX});var WX=e((JX)=>{Object.defineProperty(JX,"__esModule",{value:!0});JX.SharedArrayReceiverStrategy=JX.SharedArraySenderStrategy=void 0;var j3=HZ(),h$;(function($){$.Continue=0,$.Cancelled=1})(h$||(h$={}));class YX{buffers;constructor(){this.buffers=new Map}enableCancellation($){if($.id===null)return;let Z=new SharedArrayBuffer(4),Y=new Int32Array(Z,0,1);Y[0]=h$.Continue,this.buffers.set($.id,Z),$.$cancellationData=Z}async sendCancellation($,Z){let Y=this.buffers.get(Z);if(Y===void 0)return;let Q=new Int32Array(Y,0,1);Atomics.store(Q,0,h$.Cancelled)}cleanup($){this.buffers.delete($)}dispose(){this.buffers.clear()}}JX.SharedArraySenderStrategy=YX;class XX{data;constructor($){this.data=new Int32Array($,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===h$.Cancelled}get onCancellationRequested(){throw Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class QX{token;constructor($){this.token=new XX($)}cancel(){}dispose(){}}class GX{kind="request";createCancellationTokenSource($){let Z=$.$cancellationData;if(Z===void 0)return new j3.CancellationTokenSource;return new QX(Z)}}JX.SharedArrayReceiverStrategy=GX});var V6=e((w$)=>{var O3=w$&&w$.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(w$,"__esModule",{value:!0});w$.Semaphore=void 0;var _3=O3(x0());class VX{_capacity;_active;_waiting;constructor($=1){if($<=0)throw Error("Capacity must be greater than 0");this._capacity=$,this._active=0,this._waiting=[]}lock($){return new Promise((Z,Y)=>{this._waiting.push({thunk:$,resolve:Z,reject:Y}),this.runNext()})}get active(){return this._active}runNext(){if(this._waiting.length===0||this._active===this._capacity)return;(0,_3.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let $=this._waiting.shift();if(this._active++,this._active>this._capacity)throw Error("Too many thunks active");try{let Z=$.thunk();if(Z instanceof Promise)Z.then((Y)=>{this._active--,$.resolve(Y),this.runNext()},(Y)=>{this._active--,$.reject(Y),this.runNext()});else this._active--,$.resolve(Z),this.runNext()}catch(Z){this._active--,$.reject(Z),this.runNext()}}}w$.Semaphore=VX});var wX=e((Z0)=>{var T3=Z0&&Z0.__createBinding||(Object.create?function($,Z,Y,Q){if(Q===void 0)Q=Y;var G=Object.getOwnPropertyDescriptor(Z,Y);if(!G||("get"in G?!Z.__esModule:G.writable||G.configurable))G={enumerable:!0,get:function(){return Z[Y]}};Object.defineProperty($,Q,G)}:function($,Z,Y,Q){if(Q===void 0)Q=Y;$[Q]=Z[Y]}),v3=Z0&&Z0.__setModuleDefault||(Object.create?function($,Z){Object.defineProperty($,"default",{enumerable:!0,value:Z})}:function($,Z){$.default=Z}),f3=Z0&&Z0.__importStar||function(){var $=function(Z){return $=Object.getOwnPropertyNames||function(Y){var Q=[];for(var G in Y)if(Object.prototype.hasOwnProperty.call(Y,G))Q[Q.length]=G;return Q},$(Z)};return function(Z){if(Z&&Z.__esModule)return Z;var Y={};if(Z!=null){for(var Q=$(Z),G=0;G<Q.length;G++)if(Q[G]!=="default")T3(Y,Z,Q[G])}return v3(Y,Z),Y}}(),k3=Z0&&Z0.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(Z0,"__esModule",{value:!0});Z0.ReadableStreamMessageReader=Z0.AbstractMessageReader=Z0.MessageReader=void 0;var z6=k3(x0()),q$=f3(H$()),H6=z$(),C3=V6(),HX;(function($){function Z(Y){let Q=Y;return Q&&q$.func(Q.listen)&&q$.func(Q.dispose)&&q$.func(Q.onError)&&q$.func(Q.onClose)&&q$.func(Q.onPartialMessage)}$.is=Z})(HX||(Z0.MessageReader=HX={}));class q6{errorEmitter;closeEmitter;partialMessageEmitter;constructor(){this.errorEmitter=new H6.Emitter,this.closeEmitter=new H6.Emitter,this.partialMessageEmitter=new H6.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose(),this.partialMessageEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError($){this.errorEmitter.fire(this.asError($))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage($){this.partialMessageEmitter.fire($)}asError($){if($ instanceof Error)return $;else return Error(`Reader received error. Reason: ${q$.string($.message)?$.message:"unknown"}`)}}Z0.AbstractMessageReader=q6;var w6;(function($){function Z(Y){let Q,G,J,V=new Map,L,P=new Map;if(Y===void 0||typeof Y==="string")Q=Y??"utf-8";else{if(Q=Y.charset??"utf-8",Y.contentDecoder!==void 0)J=Y.contentDecoder,V.set(J.name,J);if(Y.contentDecoders!==void 0)for(let _ of Y.contentDecoders)V.set(_.name,_);if(Y.contentTypeDecoder!==void 0)L=Y.contentTypeDecoder,P.set(L.name,L);if(Y.contentTypeDecoders!==void 0)for(let _ of Y.contentTypeDecoders)P.set(_.name,_)}if(L===void 0)L=(0,z6.default)().applicationJson.decoder,P.set(L.name,L);return{charset:Q,contentDecoder:J,contentDecoders:V,contentTypeDecoder:L,contentTypeDecoders:P}}$.fromOptions=Z})(w6||(w6={}));class zX extends q6{readable;options;callback;nextMessageLength;messageToken;buffer;partialMessageTimer;_partialMessageTimeout;readSemaphore;constructor($,Z){super();this.readable=$,this.options=w6.fromOptions(Z),this.buffer=(0,z6.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new C3.Semaphore(1)}set partialMessageTimeout($){this._partialMessageTimeout=$}get partialMessageTimeout(){return this._partialMessageTimeout}listen($){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=$;let Z=this.readable.onData((Y)=>{this.onData(Y)});return this.readable.onError((Y)=>this.fireError(Y)),this.readable.onClose(()=>this.fireClose()),Z}onData($){try{this.buffer.append($);while(!0){if(this.nextMessageLength===-1){let Y=this.buffer.tryReadHeaders(!0);if(!Y)return;let Q=Y.get("content-length");if(!Q){this.fireError(Error(`Header must provide a Content-Length property.
|
|
2
2
|
${JSON.stringify(Object.fromEntries(Y))}`));return}let G=parseInt(Q);if(isNaN(G)){this.fireError(Error(`Content-Length value must be a number. Got ${Q}`));return}this.nextMessageLength=G}let Z=this.buffer.tryReadBody(this.nextMessageLength);if(Z===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let Y=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(Z):Z,Q=await this.options.contentTypeDecoder.decode(Y,this.options);this.callback(Q)}).catch((Y)=>{this.fireError(Y)})}}catch(Z){this.fireError(Z)}}clearPartialMessageTimer(){if(this.partialMessageTimer)this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0}setPartialMessageTimer(){if(this.clearPartialMessageTimer(),this._partialMessageTimeout<=0)return;this.partialMessageTimer=(0,z6.default)().timer.setTimeout(($,Z)=>{if(this.partialMessageTimer=void 0,$===this.messageToken)this.firePartialMessage({messageToken:$,waitingTime:Z}),this.setPartialMessageTimer()},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout)}}Z0.ReadableStreamMessageReader=zX});var IX=e((Y0)=>{var F3=Y0&&Y0.__createBinding||(Object.create?function($,Z,Y,Q){if(Q===void 0)Q=Y;var G=Object.getOwnPropertyDescriptor(Z,Y);if(!G||("get"in G?!Z.__esModule:G.writable||G.configurable))G={enumerable:!0,get:function(){return Z[Y]}};Object.defineProperty($,Q,G)}:function($,Z,Y,Q){if(Q===void 0)Q=Y;$[Q]=Z[Y]}),h3=Y0&&Y0.__setModuleDefault||(Object.create?function($,Z){Object.defineProperty($,"default",{enumerable:!0,value:Z})}:function($,Z){$.default=Z}),N3=Y0&&Y0.__importStar||function(){var $=function(Z){return $=Object.getOwnPropertyNames||function(Y){var Q=[];for(var G in Y)if(Object.prototype.hasOwnProperty.call(Y,G))Q[Q.length]=G;return Q},$(Z)};return function(Z){if(Z&&Z.__esModule)return Z;var Y={};if(Z!=null){for(var Q=$(Z),G=0;G<Q.length;G++)if(Q[G]!=="default")F3(Y,Z,Q[G])}return h3(Y,Z),Y}}(),u3=Y0&&Y0.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(Y0,"__esModule",{value:!0});Y0.WriteableStreamMessageWriter=Y0.AbstractMessageWriter=Y0.MessageWriter=void 0;var qX=u3(x0()),N$=N3(H$()),K3=V6(),BX=z$(),b3="Content-Length: ",LX=`\r
|
|
3
3
|
`,AX;(function($){function Z(Y){let Q=Y;return Q&&N$.func(Q.dispose)&&N$.func(Q.onClose)&&N$.func(Q.onError)&&N$.func(Q.write)}$.is=Z})(AX||(Y0.MessageWriter=AX={}));class L6{errorEmitter;closeEmitter;constructor(){this.errorEmitter=new BX.Emitter,this.closeEmitter=new BX.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError($,Z,Y){this.errorEmitter.fire([this.asError($),Z,Y])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError($){if($ instanceof Error)return $;else return Error(`Writer received error. Reason: ${N$.string($.message)?$.message:"unknown"}`)}}Y0.AbstractMessageWriter=L6;var B6;(function($){function Z(Y){if(Y===void 0||typeof Y==="string")return{charset:Y??"utf-8",contentTypeEncoder:(0,qX.default)().applicationJson.encoder};else return{charset:Y.charset??"utf-8",contentEncoder:Y.contentEncoder,contentTypeEncoder:Y.contentTypeEncoder??(0,qX.default)().applicationJson.encoder}}$.fromOptions=Z})(B6||(B6={}));class RX extends L6{writable;options;errorCount;writeSemaphore;constructor($,Z){super();this.writable=$,this.options=B6.fromOptions(Z),this.errorCount=0,this.writeSemaphore=new K3.Semaphore(1),this.writable.onError((Y)=>this.fireError(Y)),this.writable.onClose(()=>this.fireClose())}async write($){return this.writeSemaphore.lock(async()=>{return this.options.contentTypeEncoder.encode($,this.options).then((Y)=>{if(this.options.contentEncoder!==void 0)return this.options.contentEncoder.encode(Y);else return Y}).then((Y)=>{let Q=[];return Q.push(b3,Y.byteLength.toString(),LX),Q.push(LX),this.doWrite($,Q,Y)},(Y)=>{throw this.fireError(Y),Y})})}async doWrite($,Z,Y){try{return await this.writable.write(Z.join(""),"ascii"),this.writable.write(Y)}catch(Q){return this.handleError(Q,$),Promise.reject(Q)}}handleError($,Z){this.errorCount++,this.fireError($,Z,this.errorCount)}end(){this.writable.end()}}Y0.WriteableStreamMessageWriter=RX});var jX=e((DX)=>{Object.defineProperty(DX,"__esModule",{value:!0});DX.AbstractMessageBuffer=void 0;var S3=13,x3=10,g3=`\r
|
|
4
4
|
`;class PX{_encoding;_chunks;_totalLength;constructor($="utf-8"){this._encoding=$,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append($){let Z=typeof $==="string"?this.fromString($,this._encoding):$;this._chunks.push(Z),this._totalLength+=Z.byteLength}tryReadHeaders($=!1){if(this._chunks.length===0)return;let Z=0,Y=0,Q=0,G=0;$:while(Y<this._chunks.length){let P=this._chunks[Y];Q=0;while(Q<P.length){switch(P[Q]){case S3:switch(Z){case 0:Z=1;break;case 2:Z=3;break;default:Z=0}break;case x3:switch(Z){case 1:Z=2;break;case 3:Z=4,Q++;break $;default:Z=0}break;default:Z=0}Q++}G+=P.byteLength,Y++}if(Z!==4)return;let J=this._read(G+Q),V=new Map,L=this.toString(J,"ascii").split(g3);if(L.length<2)return V;for(let P=0;P<L.length-2;P++){let _=L[P],k=_.indexOf(":");if(k===-1)throw Error(`Message header must separate key and value using ':'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ga as VQ}from"./chunk-t9d5k3p7.js";var QZ={};VQ(QZ,{version:()=>FQ,tokenizer:()=>JZ,tokTypes:()=>X,tokContexts:()=>U,parseExpressionAt:()=>eQ,parse:()=>tQ,nonASCIIwhitespace:()=>IJ,lineBreakG:()=>xJ,lineBreak:()=>v,keywordTypes:()=>_J,isNewLine:()=>u,isIdentifierStart:()=>k,isIdentifierChar:()=>E,getLineInfo:()=>SJ,defaultOptions:()=>RJ,TokenType:()=>M,Token:()=>FJ,TokContext:()=>L,SourceLocation:()=>e,Position:()=>n,Parser:()=>N,Node:()=>QJ});var MQ=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,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,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,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,199,7,137,9,54,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,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,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,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],DJ=[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,4,51,13,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,7,25,39,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,39,27,10,22,251,41,7,1,17,5,57,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,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,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,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,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,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,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,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],BQ="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ--ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",EJ="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",VJ={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"},MJ="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",UQ={5:MJ,"5module":MJ+" export import",6:MJ+" const class extends export import super"},yJ=/^in(stanceof)?$/,NQ=new RegExp("["+EJ+"]"),CQ=new RegExp("["+EJ+BQ+"]");function BJ(J,Q){var Z=65536;for(var q=0;q<Q.length;q+=2){if(Z+=Q[q],Z>J)return!1;if(Z+=Q[q+1],Z>=J)return!0}return!1}function k(J,Q){if(J<65)return J===36;if(J<91)return!0;if(J<97)return J===95;if(J<123)return!0;if(J<=65535)return J>=170&&NQ.test(String.fromCharCode(J));if(Q===!1)return!1;return BJ(J,DJ)}function E(J,Q){if(J<48)return J===36;if(J<58)return!0;if(J<65)return!1;if(J<91)return!0;if(J<97)return J===95;if(J<123)return!0;if(J<=65535)return J>=170&&CQ.test(String.fromCharCode(J));if(Q===!1)return!1;return BJ(J,DJ)||BJ(J,MQ)}var M=function(Q,Z){if(Z===void 0)Z={};this.label=Q,this.keyword=Z.keyword,this.beforeExpr=!!Z.beforeExpr,this.startsExpr=!!Z.startsExpr,this.isLoop=!!Z.isLoop,this.isAssign=!!Z.isAssign,this.prefix=!!Z.prefix,this.postfix=!!Z.postfix,this.binop=Z.binop||null,this.updateContext=null};function b(J,Q){return new M(J,{beforeExpr:!0,binop:Q})}var T={beforeExpr:!0},A={startsExpr:!0},_J={};function V(J,Q){if(Q===void 0)Q={};return Q.keyword=J,_J[J]=new M(J,Q)}var X={num:new M("num",A),regexp:new M("regexp",A),string:new M("string",A),name:new M("name",A),privateId:new M("privateId",A),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(",",T),semi:new M(";",T),colon:new M(":",T),dot:new M("."),question:new M("?",T),questionDot:new M("?."),arrow:new M("=>",T),template:new M("template"),invalidTemplate:new M("invalidTemplate"),ellipsis:new M("...",T),backQuote:new M("`",A),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:b("||",1),logicalAND:b("&&",2),bitwiseOR:b("|",3),bitwiseXOR:b("^",4),bitwiseAND:b("&",5),equality:b("==/!=/===/!==",6),relational:b("</>/<=/>=",7),bitShift:b("<</>>/>>>",8),plusMin:new M("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:b("%",10),star:b("*",10),slash:b("/",10),starstar:new M("**",{beforeExpr:!0}),coalesce:b("??",1),_break:V("break"),_case:V("case",T),_catch:V("catch"),_continue:V("continue"),_debugger:V("debugger"),_default:V("default",T),_do:V("do",{isLoop:!0,beforeExpr:!0}),_else:V("else",T),_finally:V("finally"),_for:V("for",{isLoop:!0}),_function:V("function",A),_if:V("if"),_return:V("return",T),_switch:V("switch"),_throw:V("throw",T),_try:V("try"),_var:V("var"),_const:V("const"),_while:V("while",{isLoop:!0}),_with:V("with"),_new:V("new",{beforeExpr:!0,startsExpr:!0}),_this:V("this",A),_super:V("super",A),_class:V("class",A),_extends:V("extends",T),_export:V("export"),_import:V("import",A),_null:V("null",A),_true:V("true",A),_false:V("false",A),_in:V("in",{beforeExpr:!0,binop:7}),_instanceof:V("instanceof",{beforeExpr:!0,binop:7}),_typeof:V("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:V("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:V("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},v=/\r\n?|\n|\u2028|\u2029/,xJ=new RegExp(v.source,"g");function u(J){return J===10||J===13||J===8232||J===8233}function gJ(J,Q,Z){if(Z===void 0)Z=J.length;for(var q=Q;q<Z;q++){var R=J.charCodeAt(q);if(u(R))return q<Z-1&&R===13&&J.charCodeAt(q+1)===10?q+2:q+1}return-1}var IJ=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,C=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,mJ=Object.prototype,IQ=mJ.hasOwnProperty,SQ=mJ.toString,a=Object.hasOwn||function(J,Q){return IQ.call(J,Q)},wJ=Array.isArray||function(J){return SQ.call(J)==="[object Array]"},PJ=Object.create(null);function m(J){return PJ[J]||(PJ[J]=new RegExp("^(?:"+J.replace(/ /g,"|")+")$"))}function y(J){if(J<=65535)return String.fromCharCode(J);return J-=65536,String.fromCharCode((J>>10)+55296,(J&1023)+56320)}var vQ=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,n=function(Q,Z){this.line=Q,this.column=Z};n.prototype.offset=function(Q){return new n(this.line,this.column+Q)};var e=function(Q,Z,q){if(this.start=Z,this.end=q,Q.sourceFile!==null)this.source=Q.sourceFile};function SJ(J,Q){for(var Z=1,q=0;;){var R=gJ(J,q,Q);if(R<0)return new n(Z,Q-q);++Z,q=R}}var RJ={ecmaVersion:null,sourceType:"script",strict:!1,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,startLocation:null,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},$J=!1;function AQ(J){var Q={};for(var Z in RJ)Q[Z]=J&&a(J,Z)?J[Z]:RJ[Z];if(Q.ecmaVersion==="latest")Q.ecmaVersion=1e8;else if(Q.ecmaVersion==null){if(!$J&&typeof console==="object"&&console.warn)$J=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
1
|
+
import{ia as VQ}from"./chunk-ndh639r1.js";var QZ={};VQ(QZ,{version:()=>FQ,tokenizer:()=>JZ,tokTypes:()=>X,tokContexts:()=>U,parseExpressionAt:()=>eQ,parse:()=>tQ,nonASCIIwhitespace:()=>IJ,lineBreakG:()=>xJ,lineBreak:()=>v,keywordTypes:()=>_J,isNewLine:()=>u,isIdentifierStart:()=>k,isIdentifierChar:()=>E,getLineInfo:()=>SJ,defaultOptions:()=>RJ,TokenType:()=>M,Token:()=>FJ,TokContext:()=>L,SourceLocation:()=>e,Position:()=>n,Parser:()=>N,Node:()=>QJ});var MQ=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,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,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,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,199,7,137,9,54,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,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,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,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],DJ=[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,4,51,13,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,7,25,39,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,39,27,10,22,251,41,7,1,17,5,57,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,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,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,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,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,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,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,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],BQ="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ--ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",EJ="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",VJ={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"},MJ="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",UQ={5:MJ,"5module":MJ+" export import",6:MJ+" const class extends export import super"},yJ=/^in(stanceof)?$/,NQ=new RegExp("["+EJ+"]"),CQ=new RegExp("["+EJ+BQ+"]");function BJ(J,Q){var Z=65536;for(var q=0;q<Q.length;q+=2){if(Z+=Q[q],Z>J)return!1;if(Z+=Q[q+1],Z>=J)return!0}return!1}function k(J,Q){if(J<65)return J===36;if(J<91)return!0;if(J<97)return J===95;if(J<123)return!0;if(J<=65535)return J>=170&&NQ.test(String.fromCharCode(J));if(Q===!1)return!1;return BJ(J,DJ)}function E(J,Q){if(J<48)return J===36;if(J<58)return!0;if(J<65)return!1;if(J<91)return!0;if(J<97)return J===95;if(J<123)return!0;if(J<=65535)return J>=170&&CQ.test(String.fromCharCode(J));if(Q===!1)return!1;return BJ(J,DJ)||BJ(J,MQ)}var M=function(Q,Z){if(Z===void 0)Z={};this.label=Q,this.keyword=Z.keyword,this.beforeExpr=!!Z.beforeExpr,this.startsExpr=!!Z.startsExpr,this.isLoop=!!Z.isLoop,this.isAssign=!!Z.isAssign,this.prefix=!!Z.prefix,this.postfix=!!Z.postfix,this.binop=Z.binop||null,this.updateContext=null};function b(J,Q){return new M(J,{beforeExpr:!0,binop:Q})}var T={beforeExpr:!0},A={startsExpr:!0},_J={};function V(J,Q){if(Q===void 0)Q={};return Q.keyword=J,_J[J]=new M(J,Q)}var X={num:new M("num",A),regexp:new M("regexp",A),string:new M("string",A),name:new M("name",A),privateId:new M("privateId",A),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(",",T),semi:new M(";",T),colon:new M(":",T),dot:new M("."),question:new M("?",T),questionDot:new M("?."),arrow:new M("=>",T),template:new M("template"),invalidTemplate:new M("invalidTemplate"),ellipsis:new M("...",T),backQuote:new M("`",A),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:b("||",1),logicalAND:b("&&",2),bitwiseOR:b("|",3),bitwiseXOR:b("^",4),bitwiseAND:b("&",5),equality:b("==/!=/===/!==",6),relational:b("</>/<=/>=",7),bitShift:b("<</>>/>>>",8),plusMin:new M("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:b("%",10),star:b("*",10),slash:b("/",10),starstar:new M("**",{beforeExpr:!0}),coalesce:b("??",1),_break:V("break"),_case:V("case",T),_catch:V("catch"),_continue:V("continue"),_debugger:V("debugger"),_default:V("default",T),_do:V("do",{isLoop:!0,beforeExpr:!0}),_else:V("else",T),_finally:V("finally"),_for:V("for",{isLoop:!0}),_function:V("function",A),_if:V("if"),_return:V("return",T),_switch:V("switch"),_throw:V("throw",T),_try:V("try"),_var:V("var"),_const:V("const"),_while:V("while",{isLoop:!0}),_with:V("with"),_new:V("new",{beforeExpr:!0,startsExpr:!0}),_this:V("this",A),_super:V("super",A),_class:V("class",A),_extends:V("extends",T),_export:V("export"),_import:V("import",A),_null:V("null",A),_true:V("true",A),_false:V("false",A),_in:V("in",{beforeExpr:!0,binop:7}),_instanceof:V("instanceof",{beforeExpr:!0,binop:7}),_typeof:V("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:V("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:V("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},v=/\r\n?|\n|\u2028|\u2029/,xJ=new RegExp(v.source,"g");function u(J){return J===10||J===13||J===8232||J===8233}function gJ(J,Q,Z){if(Z===void 0)Z=J.length;for(var q=Q;q<Z;q++){var R=J.charCodeAt(q);if(u(R))return q<Z-1&&R===13&&J.charCodeAt(q+1)===10?q+2:q+1}return-1}var IJ=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,C=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,mJ=Object.prototype,IQ=mJ.hasOwnProperty,SQ=mJ.toString,a=Object.hasOwn||function(J,Q){return IQ.call(J,Q)},wJ=Array.isArray||function(J){return SQ.call(J)==="[object Array]"},PJ=Object.create(null);function m(J){return PJ[J]||(PJ[J]=new RegExp("^(?:"+J.replace(/ /g,"|")+")$"))}function y(J){if(J<=65535)return String.fromCharCode(J);return J-=65536,String.fromCharCode((J>>10)+55296,(J&1023)+56320)}var vQ=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,n=function(Q,Z){this.line=Q,this.column=Z};n.prototype.offset=function(Q){return new n(this.line,this.column+Q)};var e=function(Q,Z,q){if(this.start=Z,this.end=q,Q.sourceFile!==null)this.source=Q.sourceFile};function SJ(J,Q){for(var Z=1,q=0;;){var R=gJ(J,q,Q);if(R<0)return new n(Z,Q-q);++Z,q=R}}var RJ={ecmaVersion:null,sourceType:"script",strict:!1,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,startLocation:null,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},$J=!1;function AQ(J){var Q={};for(var Z in RJ)Q[Z]=J&&a(J,Z)?J[Z]:RJ[Z];if(Q.ecmaVersion==="latest")Q.ecmaVersion=1e8;else if(Q.ecmaVersion==null){if(!$J&&typeof console==="object"&&console.warn)$J=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
2
2
|
Defaulting to 2020, but this will stop working in the future.`);Q.ecmaVersion=11}else if(Q.ecmaVersion>=2015)Q.ecmaVersion-=2009;if(Q.allowReserved==null)Q.allowReserved=Q.ecmaVersion<5;if(!J||J.allowHashBang==null)Q.allowHashBang=Q.ecmaVersion>=14;if(wJ(Q.onToken)){var q=Q.onToken;Q.onToken=function(R){return q.push(R)}}if(wJ(Q.onComment))Q.onComment=bQ(Q,Q.onComment);if(Q.sourceType==="commonjs"&&Q.allowAwaitOutsideFunction)throw Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return Q}function bQ(J,Q){return function(Z,q,R,W,Y,j){var K={type:Z?"Block":"Line",value:q,start:R,end:W};if(J.locations)K.loc=new e(this,Y,j);if(J.ranges)K.range=[R,W];Q.push(K)}}var f=1,l=2,vJ=4,hJ=8,AJ=16,fJ=32,HJ=64,uJ=128,p=256,JJ=512,lJ=1024,zJ=f|l|p;function bJ(J,Q){return l|(J?vJ:0)|(Q?hJ:0)}var WJ=0,TJ=1,g=2,pJ=3,cJ=4,dJ=5,N=function(Q,Z,q){this.options=Q=AQ(Q),this.sourceFile=Q.sourceFile,this.keywords=m(UQ[Q.ecmaVersion>=6?6:Q.sourceType==="module"?"5module":5]);var R="";if(Q.allowReserved!==!0){if(R=VJ[Q.ecmaVersion>=6?6:Q.ecmaVersion===5?5:3],Q.sourceType==="module")R+=" await"}this.reservedWords=m(R);var W=(R?R+" ":"")+VJ.strict;if(this.reservedWordsStrict=m(W),this.reservedWordsStrictBind=m(W+" "+VJ.strictBind),this.input=String(Z),this.containsEsc=!1,this.pos=q||0,this.curLine=1,Q.startLocation)this.lineStart=this.pos-Q.startLocation.column,this.curLine=Q.startLocation.line;else if(q){if(this.lineStart=this.input.lastIndexOf(`
|
|
3
3
|
`,q-1)+1,this.options.locations)this.curLine=this.input.slice(0,this.lineStart).split(v).length}else this.lineStart=0;if(this.type=X.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=Q.sourceType==="module",this.strict=this.inModule||Q.strict===!0||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&&Q.allowHashBang&&this.input.slice(0,2)==="#!")this.skipLineComment(2);this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?l:f),this.regexpState=null,this.privateNameStack=[]},P={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};N.prototype.parse=function(){var Q=this,Z=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return Q.parseTopLevel(Z)})};P.inFunction.get=function(){return(this.currentVarScope().flags&l)>0};P.inGenerator.get=function(){return(this.currentVarScope().flags&hJ)>0};P.inAsync.get=function(){return(this.currentVarScope().flags&vJ)>0};P.canAwait.get=function(){for(var J=this.scopeStack.length-1;J>=0;J--){var Q=this.scopeStack[J],Z=Q.flags;if(Z&(p|JJ))return!1;if(Z&l)return(Z&vJ)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};P.allowReturn.get=function(){if(this.inFunction)return!0;if(this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&f)return!0;return!1};P.allowSuper.get=function(){var J=this.currentThisScope(),Q=J.flags;return(Q&HJ)>0||this.options.allowSuperOutsideMethod};P.allowDirectSuper.get=function(){return(this.currentThisScope().flags&uJ)>0};P.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};P.allowNewDotTarget.get=function(){for(var J=this.scopeStack.length-1;J>=0;J--){var Q=this.scopeStack[J],Z=Q.flags;if(Z&(p|JJ)||Z&l&&!(Z&AJ))return!0}return!1};P.allowUsing.get=function(){var J=this.currentScope(),Q=J.flags;if(Q&lJ)return!1;if(!this.inModule&&Q&f)return!1;return!0};P.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&p)>0};N.extend=function(){var Q=[],Z=arguments.length;while(Z--)Q[Z]=arguments[Z];var q=this;for(var R=0;R<Q.length;R++)q=Q[R](q);return q};N.parse=function(Q,Z){return new this(Z,Q).parse()};N.parseExpressionAt=function(Q,Z,q){var R=new this(q,Q,Z);return R.nextToken(),R.parseExpression()};N.tokenizer=function(Q,Z){return new this(Z,Q)};Object.defineProperties(N.prototype,P);var S=N.prototype,TQ=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;S.strictDirective=function(J){if(this.options.ecmaVersion<5)return!1;for(;;){C.lastIndex=J,J+=C.exec(this.input)[0].length;var Q=TQ.exec(this.input.slice(J));if(!Q)return!1;if((Q[1]||Q[2])==="use strict"){C.lastIndex=J+Q[0].length;var Z=C.exec(this.input),q=Z.index+Z[0].length,R=this.input.charAt(q);return R===";"||R==="}"||v.test(Z[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(R)||R==="!"&&this.input.charAt(q+1)==="=")}if(J+=Q[0].length,C.lastIndex=J,J+=C.exec(this.input)[0].length,this.input[J]===";")J++}};S.eat=function(J){if(this.type===J)return this.next(),!0;else return!1};S.isContextual=function(J){return this.type===X.name&&this.value===J&&!this.containsEsc};S.eatContextual=function(J){if(!this.isContextual(J))return!1;return this.next(),!0};S.catchStackOverflow=function(J){try{return J()}catch(Q){if(Q instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(Q.message)||/\btoo much recursion\b/i.test(Q.message)))this.raise(this.start,"Not enough stack space to parse input");else throw Q}};S.expectContextual=function(J){if(!this.eatContextual(J))this.unexpected()};S.canInsertSemicolon=function(){return this.type===X.eof||this.type===X.braceR||v.test(this.input.slice(this.lastTokEnd,this.start))};S.insertSemicolon=function(){if(this.canInsertSemicolon()){if(this.options.onInsertedSemicolon)this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc);return!0}};S.semicolon=function(){if(!this.eat(X.semi)&&!this.insertSemicolon())this.unexpected()};S.afterTrailingComma=function(J,Q){if(this.type===J){if(this.options.onTrailingComma)this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc);if(!Q)this.next();return!0}};S.expect=function(J){this.eat(J)||this.unexpected()};S.unexpected=function(J){this.raise(J!=null?J:this.start,"Unexpected token")};var OJ=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};S.checkPatternErrors=function(J,Q){if(!J)return;if(J.trailingComma>-1)this.raiseRecoverable(J.trailingComma,"Comma is not permitted after the rest element");var Z=Q?J.parenthesizedAssign:J.parenthesizedBind;if(Z>-1)this.raiseRecoverable(Z,Q?"Assigning to rvalue":"Parenthesized pattern")};S.checkExpressionErrors=function(J,Q){if(!J)return!1;var{shorthandAssign:Z,doubleProto:q}=J;if(!Q)return Z>=0||q>=0;if(Z>=0)this.raise(Z,"Shorthand property assignments are valid only in destructuring patterns");if(q>=0)this.raiseRecoverable(q,"Redefinition of __proto__ property")};S.checkYieldAwaitInDefaultParams=function(){if(this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos))this.raise(this.yieldPos,"Yield expression cannot be a default value");if(this.awaitPos)this.raise(this.awaitPos,"Await expression cannot be a default value")};S.isSimpleAssignTarget=function(J){if(J.type==="ParenthesizedExpression")return this.isSimpleAssignTarget(J.expression);return J.type==="Identifier"||J.type==="MemberExpression"};var H=N.prototype;H.parseTopLevel=function(J){var Q=Object.create(null);if(!J.body)J.body=[];while(this.type!==X.eof){var Z=this.parseStatement(null,!0,Q);J.body.push(Z)}if(this.inModule)for(var q=0,R=Object.keys(this.undefinedExports);q<R.length;q+=1){var W=R[q];this.raiseRecoverable(this.undefinedExports[W].start,"Export '"+W+"' is not defined")}return this.adaptDirectivePrologue(J.body),this.next(),J.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(J,"Program")};var LJ={kind:"loop"},LQ={kind:"switch"};H.isLet=function(J){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;C.lastIndex=this.pos;var Q=C.exec(this.input),Z=this.pos+Q[0].length,q=this.fullCharCodeAt(Z);if(q===91||q===92)return!0;if(J)return!1;if(q===123)return!0;if(k(q)){var R=Z;do Z+=q<=65535?1:2;while(E(q=this.fullCharCodeAt(Z)));if(q===92)return!0;var W=this.input.slice(R,Z);if(!yJ.test(W))return!0}return!1};H.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;C.lastIndex=this.pos;var J=C.exec(this.input),Q=this.pos+J[0].length,Z;return!v.test(this.input.slice(this.pos,Q))&&this.input.slice(Q,Q+8)==="function"&&(Q+8===this.input.length||!(E(Z=this.fullCharCodeAt(Q+8))||Z===92))};H.isUsingKeyword=function(J,Q){if(this.options.ecmaVersion<17||!this.isContextual(J?"await":"using"))return!1;C.lastIndex=this.pos;var Z=C.exec(this.input),q=this.pos+Z[0].length;if(v.test(this.input.slice(this.pos,q)))return!1;if(J){var R=q+5,W;if(this.input.slice(q,R)!=="using"||R===this.input.length||E(W=this.fullCharCodeAt(R))||W===92)return!1;C.lastIndex=R;var Y=C.exec(this.input);if(q=R+Y[0].length,Y&&v.test(this.input.slice(R,q)))return!1}var j=this.fullCharCodeAt(q);if(!k(j)&&j!==92)return!1;var K=q;do q+=j<=65535?1:2;while(E(j=this.fullCharCodeAt(q)));if(j===92)return!0;var z=this.input.slice(K,q);if(yJ.test(z))return!1;if(Q&&!J&&z==="of"){C.lastIndex=q;var G=C.exec(this.input);if(q=q+G[0].length,this.input.charCodeAt(q)!==61||(j=this.input.charCodeAt(q+1))===61||j===62)return!1}return!0};H.isAwaitUsing=function(J){return this.isUsingKeyword(!0,J)};H.isUsing=function(J){return this.isUsingKeyword(!1,J)};H.parseStatement=function(J,Q,Z){var q=this.type,R=this.startNode(),W;if(this.isLet(J))q=X._var,W="let";switch(q){case X._break:case X._continue:return this.parseBreakContinueStatement(R,q.keyword);case X._debugger:return this.parseDebuggerStatement(R);case X._do:return this.parseDoStatement(R);case X._for:return this.parseForStatement(R);case X._function:if(J&&(this.strict||J!=="if"&&J!=="label")&&this.options.ecmaVersion>=6)this.unexpected();return this.parseFunctionStatement(R,!1,!J);case X._class:if(J)this.unexpected();return this.parseClass(R,!0);case X._if:return this.parseIfStatement(R);case X._return:return this.parseReturnStatement(R);case X._switch:return this.parseSwitchStatement(R);case X._throw:return this.parseThrowStatement(R);case X._try:return this.parseTryStatement(R);case X._const:case X._var:if(W=W||this.value,J&&W!=="var")this.unexpected();return this.parseVarStatement(R,W);case X._while:return this.parseWhileStatement(R);case X._with:return this.parseWithStatement(R);case X.braceL:return this.parseBlock(!0,R);case X.semi:return this.parseEmptyStatement(R);case X._export:case X._import:if(this.options.ecmaVersion>10&&q===X._import){C.lastIndex=this.pos;var Y=C.exec(this.input),j=this.pos+Y[0].length,K=this.input.charCodeAt(j);if(K===40||K===46)return this.parseExpressionStatement(R,this.parseExpression())}if(!this.options.allowImportExportEverywhere){if(!Q)this.raise(this.start,"'import' and 'export' may only appear at the top level");if(!this.inModule)this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")}return q===X._import?this.parseImport(R):this.parseExport(R,Z);default:if(this.isAsyncFunction()){if(J)this.unexpected();return this.next(),this.parseFunctionStatement(R,!0,!J)}var z=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(z){if(!this.allowUsing)this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement");if(J)this.raise(this.start,"Using declaration is not allowed in single-statement positions");if(z==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.next(),this.parseVar(R,!1,z),this.semicolon(),this.finishNode(R,"VariableDeclaration")}var G=this.value,B=this.parseExpression();if(q===X.name&&B.type==="Identifier"&&this.eat(X.colon))return this.parseLabeledStatement(R,G,B,J);else return this.parseExpressionStatement(R,B)}};H.parseBreakContinueStatement=function(J,Q){var Z=Q==="break";if(this.next(),this.eat(X.semi)||this.insertSemicolon())J.label=null;else if(this.type!==X.name)this.unexpected();else J.label=this.parseIdent(),this.semicolon();var q=0;for(;q<this.labels.length;++q){var R=this.labels[q];if(J.label==null||R.name===J.label.name){if(R.kind!=null&&(Z||R.kind==="loop"))break;if(J.label&&Z)break}}if(q===this.labels.length)this.raise(J.start,"Unsyntactic "+Q);return this.finishNode(J,Z?"BreakStatement":"ContinueStatement")};H.parseDebuggerStatement=function(J){return this.next(),this.semicolon(),this.finishNode(J,"DebuggerStatement")};H.parseDoStatement=function(J){if(this.next(),this.labels.push(LJ),J.body=this.parseStatement("do"),this.labels.pop(),this.expect(X._while),J.test=this.parseParenExpression(),this.options.ecmaVersion>=6)this.eat(X.semi);else this.semicolon();return this.finishNode(J,"DoWhileStatement")};H.parseForStatement=function(J){this.next();var Q=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(LJ),this.enterScope(0),this.expect(X.parenL),this.type===X.semi){if(Q>-1)this.unexpected(Q);return this.parseFor(J,null)}var Z=this.isLet();if(this.type===X._var||this.type===X._const||Z){var q=this.startNode(),R=Z?"let":this.value;return this.next(),this.parseVar(q,!0,R),this.finishNode(q,"VariableDeclaration"),this.parseForAfterInit(J,q,Q)}var W=this.isContextual("let"),Y=!1,j=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(j){var K=this.startNode();if(this.next(),j==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.parseVar(K,!0,j),this.finishNode(K,"VariableDeclaration"),this.parseForAfterInit(J,K,Q)}var z=this.containsEsc,G=new OJ,B=this.start,I=Q>-1?this.parseExprSubscripts(G,"await"):this.parseExpression(!0,G);if(this.type===X._in||(Y=this.options.ecmaVersion>=6&&this.isContextual("of"))){if(Q>-1){if(this.type===X._in)this.unexpected(Q);J.await=!0}else if(Y&&this.options.ecmaVersion>=8){if(I.start===B&&!z&&I.type==="Identifier"&&I.name==="async")this.unexpected();else if(this.options.ecmaVersion>=9)J.await=!1}if(W&&Y)this.raise(I.start,"The left-hand side of a for-of loop may not start with 'let'.");return this.toAssignable(I,!1,G),this.checkLValPattern(I),this.parseForIn(J,I)}else this.checkExpressionErrors(G,!0);if(Q>-1)this.unexpected(Q);return this.parseFor(J,I)};H.parseForAfterInit=function(J,Q,Z){if((this.type===X._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&Q.declarations.length===1){if(this.type===X._in){if((Q.kind==="using"||Q.kind==="await using")&&!Q.declarations[0].init)this.raise(this.start,"Using declaration is not allowed in for-in loops");if(this.options.ecmaVersion>=9&&Z>-1)this.unexpected(Z)}else if(this.options.ecmaVersion>=9)J.await=Z>-1;return this.parseForIn(J,Q)}if(Z>-1)this.unexpected(Z);return this.parseFor(J,Q)};H.parseFunctionStatement=function(J,Q,Z){return this.next(),this.parseFunction(J,t|(Z?0:UJ),!1,Q)};H.parseIfStatement=function(J){return this.next(),J.test=this.parseParenExpression(),J.consequent=this.parseStatement("if"),J.alternate=this.eat(X._else)?this.parseStatement("if"):null,this.finishNode(J,"IfStatement")};H.parseReturnStatement=function(J){if(!this.allowReturn)this.raise(this.start,"'return' outside of function");if(this.next(),this.eat(X.semi)||this.insertSemicolon())J.argument=null;else J.argument=this.parseExpression(),this.semicolon();return this.finishNode(J,"ReturnStatement")};H.parseSwitchStatement=function(J){this.next(),J.discriminant=this.parseParenExpression(),J.cases=[],this.expect(X.braceL),this.labels.push(LQ),this.enterScope(lJ);var Q;for(var Z=!1;this.type!==X.braceR;)if(this.type===X._case||this.type===X._default){var q=this.type===X._case;if(Q)this.finishNode(Q,"SwitchCase");if(J.cases.push(Q=this.startNode()),Q.consequent=[],this.next(),q)Q.test=this.parseExpression();else{if(Z)this.raiseRecoverable(this.lastTokStart,"Multiple default clauses");Z=!0,Q.test=null}this.expect(X.colon)}else{if(!Q)this.unexpected();Q.consequent.push(this.parseStatement(null))}if(this.exitScope(),Q)this.finishNode(Q,"SwitchCase");return this.next(),this.labels.pop(),this.finishNode(J,"SwitchStatement")};H.parseThrowStatement=function(J){if(this.next(),v.test(this.input.slice(this.lastTokEnd,this.start)))this.raise(this.lastTokEnd,"Illegal newline after throw");return J.argument=this.parseExpression(),this.semicolon(),this.finishNode(J,"ThrowStatement")};var wQ=[];H.parseCatchClauseParam=function(){var J=this.parseBindingAtom(),Q=J.type==="Identifier";return this.enterScope(Q?fJ:0),this.checkLValPattern(J,Q?cJ:g),this.expect(X.parenR),J};H.parseTryStatement=function(J){if(this.next(),J.block=this.parseBlock(),J.handler=null,this.type===X._catch){var Q=this.startNode();if(this.next(),this.eat(X.parenL))Q.param=this.parseCatchClauseParam();else{if(this.options.ecmaVersion<10)this.unexpected();Q.param=null,this.enterScope(0)}Q.body=this.parseBlock(!1),this.exitScope(),J.handler=this.finishNode(Q,"CatchClause")}if(J.finalizer=this.eat(X._finally)?this.parseBlock():null,!J.handler&&!J.finalizer)this.raise(J.start,"Missing catch or finally clause");return this.finishNode(J,"TryStatement")};H.parseVarStatement=function(J,Q,Z){return this.next(),this.parseVar(J,!1,Q,Z),this.semicolon(),this.finishNode(J,"VariableDeclaration")};H.parseWhileStatement=function(J){return this.next(),J.test=this.parseParenExpression(),this.labels.push(LJ),J.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(J,"WhileStatement")};H.parseWithStatement=function(J){if(this.strict)this.raise(this.start,"'with' in strict mode");return this.next(),J.object=this.parseParenExpression(),J.body=this.parseStatement("with"),this.finishNode(J,"WithStatement")};H.parseEmptyStatement=function(J){return this.next(),this.finishNode(J,"EmptyStatement")};H.parseLabeledStatement=function(J,Q,Z,q){for(var R=0,W=this.labels;R<W.length;R+=1){var Y=W[R];if(Y.name===Q)this.raise(Z.start,"Label '"+Q+"' is already declared")}var j=this.type.isLoop?"loop":this.type===X._switch?"switch":null;for(var K=this.labels.length-1;K>=0;K--){var z=this.labels[K];if(z.statementStart===J.start)z.statementStart=this.start,z.kind=j;else break}return this.labels.push({name:Q,kind:j,statementStart:this.start}),J.body=this.parseStatement(q?q.indexOf("label")===-1?q+"label":q:"label"),this.labels.pop(),J.label=Z,this.finishNode(J,"LabeledStatement")};H.parseExpressionStatement=function(J,Q){return J.expression=Q,this.semicolon(),this.finishNode(J,"ExpressionStatement")};H.parseBlock=function(J,Q,Z){if(J===void 0)J=!0;if(Q===void 0)Q=this.startNode();if(Q.body=[],this.expect(X.braceL),J)this.enterScope(0);while(this.type!==X.braceR){var q=this.parseStatement(null);Q.body.push(q)}if(Z)this.strict=!1;if(this.next(),J)this.exitScope();return this.finishNode(Q,"BlockStatement")};H.parseFor=function(J,Q){return J.init=Q,this.expect(X.semi),J.test=this.type===X.semi?null:this.parseExpression(),this.expect(X.semi),J.update=this.type===X.parenR?null:this.parseExpression(),this.expect(X.parenR),J.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(J,"ForStatement")};H.parseForIn=function(J,Q){var Z=this.type===X._in;if(this.next(),Q.type==="VariableDeclaration"&&Q.declarations[0].init!=null&&(!Z||this.options.ecmaVersion<8||this.strict||Q.kind!=="var"||Q.declarations[0].id.type!=="Identifier"))this.raise(Q.start,(Z?"for-in":"for-of")+" loop variable declaration may not have an initializer");return J.left=Q,J.right=Z?this.parseExpression():this.parseMaybeAssign(),this.expect(X.parenR),J.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(J,Z?"ForInStatement":"ForOfStatement")};H.parseVar=function(J,Q,Z,q){J.declarations=[],J.kind=Z;for(;;){var R=this.startNode();if(this.parseVarId(R,Z),this.eat(X.eq))R.init=this.parseMaybeAssign(Q);else if(!q&&Z==="const"&&!(this.type===X._in||this.options.ecmaVersion>=6&&this.isContextual("of")))this.unexpected();else if(!q&&(Z==="using"||Z==="await using")&&this.options.ecmaVersion>=17&&this.type!==X._in&&!this.isContextual("of"))this.raise(this.lastTokEnd,"Missing initializer in "+Z+" declaration");else if(!q&&R.id.type!=="Identifier"&&!(Q&&(this.type===X._in||this.isContextual("of"))))this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value");else R.init=null;if(J.declarations.push(this.finishNode(R,"VariableDeclarator")),!this.eat(X.comma))break}return J};H.parseVarId=function(J,Q){J.id=Q==="using"||Q==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(J.id,Q==="var"?TJ:g,!1)};var t=1,UJ=2,iJ=4;H.parseFunction=function(J,Q,Z,q,R){if(this.initFunction(J),this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!q){if(this.type===X.star&&Q&UJ)this.unexpected();J.generator=this.eat(X.star)}if(this.options.ecmaVersion>=8)J.async=!!q;if(Q&t){if(J.id=Q&iJ&&this.type!==X.name?null:this.parseIdent(),J.id&&!(Q&UJ))this.checkLValSimple(J.id,this.strict||J.generator||J.async?this.treatFunctionsAsVar?TJ:g:pJ)}var W=this.yieldPos,Y=this.awaitPos,j=this.awaitIdentPos;if(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(bJ(J.async,J.generator)),!(Q&t))J.id=this.type===X.name?this.parseIdent():null;return this.parseFunctionParams(J),this.parseFunctionBody(J,Z,!1,R),this.yieldPos=W,this.awaitPos=Y,this.awaitIdentPos=j,this.finishNode(J,Q&t?"FunctionDeclaration":"FunctionExpression")};H.parseFunctionParams=function(J){this.expect(X.parenL),J.params=this.parseBindingList(X.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};H.parseClass=function(J,Q){this.next();var Z=this.strict;this.strict=!0,this.parseClassId(J,Q),this.parseClassSuper(J);var q=this.enterClassBody(),R=this.startNode(),W=!1;R.body=[],this.expect(X.braceL);while(this.type!==X.braceR){var Y=this.parseClassElement(J.superClass!==null);if(Y){if(R.body.push(Y),Y.type==="MethodDefinition"&&Y.kind==="constructor"){if(W)this.raiseRecoverable(Y.start,"Duplicate constructor in the same class");W=!0}else if(Y.key&&Y.key.type==="PrivateIdentifier"&&PQ(q,Y))this.raiseRecoverable(Y.key.start,"Identifier '#"+Y.key.name+"' has already been declared")}}return this.strict=Z,this.next(),J.body=this.finishNode(R,"ClassBody"),this.exitClassBody(),this.finishNode(J,Q?"ClassDeclaration":"ClassExpression")};H.parseClassElement=function(J){if(this.eat(X.semi))return null;var Q=this.options.ecmaVersion,Z=this.startNode(),q="",R=!1,W=!1,Y="method",j=!1;if(this.eatContextual("static")){if(Q>=13&&this.eat(X.braceL))return this.parseClassStaticBlock(Z),Z;if(this.isClassElementNameStart()||this.type===X.star)j=!0;else q="static"}if(Z.static=j,!q&&Q>=8&&this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===X.star)&&!this.canInsertSemicolon())W=!0;else q="async";if(!q&&(Q>=9||!W)&&this.eat(X.star))R=!0;if(!q&&!W&&!R){var K=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())Y=K;else q=K}if(q)Z.computed=!1,Z.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),Z.key.name=q,this.finishNode(Z.key,"Identifier");else this.parseClassElementName(Z);if(Q<13||this.type===X.parenL||Y!=="method"||R||W){var z=!Z.static&&YJ(Z,"constructor"),G=z&&J;if(z&&Y!=="method")this.raise(Z.key.start,"Constructor can't have get/set modifier");Z.kind=z?"constructor":Y,this.parseClassMethod(Z,R,W,G)}else this.parseClassField(Z);return Z};H.isClassElementNameStart=function(){return this.type===X.name||this.type===X.privateId||this.type===X.num||this.type===X.string||this.type===X.bracketL||this.type.keyword};H.parseClassElementName=function(J){if(this.type===X.privateId){if(this.value==="constructor")this.raise(this.start,"Classes can't have an element named '#constructor'");J.computed=!1,J.key=this.parsePrivateIdent()}else this.parsePropertyName(J)};H.parseClassMethod=function(J,Q,Z,q){var R=J.key;if(J.kind==="constructor"){if(Q)this.raise(R.start,"Constructor can't be a generator");if(Z)this.raise(R.start,"Constructor can't be an async method")}else if(J.static&&YJ(J,"prototype"))this.raise(R.start,"Classes may not have a static property named prototype");var W=J.value=this.parseMethod(Q,Z,q);if(J.kind==="get"&&W.params.length!==0)this.raiseRecoverable(W.start,"getter should have no params");if(J.kind==="set"&&W.params.length!==1)this.raiseRecoverable(W.start,"setter should have exactly one param");if(J.kind==="set"&&W.params[0].type==="RestElement")this.raiseRecoverable(W.params[0].start,"Setter cannot use rest params");return this.finishNode(J,"MethodDefinition")};H.parseClassField=function(J){if(YJ(J,"constructor"))this.raise(J.key.start,"Classes can't have a field named 'constructor'");else if(J.static&&YJ(J,"prototype"))this.raise(J.key.start,"Classes can't have a static field named 'prototype'");if(this.eat(X.eq))this.enterScope(JJ|HJ),J.value=this.parseMaybeAssign(),this.exitScope();else J.value=null;return this.semicolon(),this.finishNode(J,"PropertyDefinition")};H.parseClassStaticBlock=function(J){J.body=[];var Q=this.labels;this.labels=[],this.enterScope(p|HJ);while(this.type!==X.braceR){var Z=this.parseStatement(null);J.body.push(Z)}return this.next(),this.exitScope(),this.labels=Q,this.finishNode(J,"StaticBlock")};H.parseClassId=function(J,Q){if(this.type===X.name){if(J.id=this.parseIdent(),Q)this.checkLValSimple(J.id,g,!1)}else{if(Q===!0)this.unexpected();J.id=null}};H.parseClassSuper=function(J){J.superClass=this.eat(X._extends)?this.parseExprSubscripts(null,!1):null};H.enterClassBody=function(){var J={declared:Object.create(null),used:[]};return this.privateNameStack.push(J),J.declared};H.exitClassBody=function(){var J=this.privateNameStack.pop(),Q=J.declared,Z=J.used;if(!this.options.checkPrivateFields)return;var q=this.privateNameStack.length,R=q===0?null:this.privateNameStack[q-1];for(var W=0;W<Z.length;++W){var Y=Z[W];if(!a(Q,Y.name))if(R)R.used.push(Y);else this.raiseRecoverable(Y.start,"Private field '#"+Y.name+"' must be declared in an enclosing class")}};function PQ(J,Q){var Z=Q.key.name,q=J[Z],R="true";if(Q.type==="MethodDefinition"&&(Q.kind==="get"||Q.kind==="set"))R=(Q.static?"s":"i")+Q.kind;if(q==="iget"&&R==="iset"||q==="iset"&&R==="iget"||q==="sget"&&R==="sset"||q==="sset"&&R==="sget")return J[Z]="true",!1;else if(!q)return J[Z]=R,!1;else return!0}function YJ(J,Q){var{computed:Z,key:q}=J;return!Z&&(q.type==="Identifier"&&q.name===Q||q.type==="Literal"&&q.value===Q)}H.parseExportAllDeclaration=function(J,Q){if(this.options.ecmaVersion>=11)if(this.eatContextual("as"))J.exported=this.parseModuleExportName(),this.checkExport(Q,J.exported,this.lastTokStart);else J.exported=null;if(this.expectContextual("from"),this.type!==X.string)this.unexpected();if(J.source=this.parseExprAtom(),this.options.ecmaVersion>=16)J.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(J,"ExportAllDeclaration")};H.parseExport=function(J,Q){if(this.next(),this.eat(X.star))return this.parseExportAllDeclaration(J,Q);if(this.eat(X._default))return this.checkExport(Q,"default",this.lastTokStart),J.declaration=this.parseExportDefaultDeclaration(),this.finishNode(J,"ExportDefaultDeclaration");if(this.shouldParseExportStatement()){if(J.declaration=this.parseExportDeclaration(J),J.declaration.type==="VariableDeclaration")this.checkVariableExport(Q,J.declaration.declarations);else this.checkExport(Q,J.declaration.id,J.declaration.id.start);if(J.specifiers=[],J.source=null,this.options.ecmaVersion>=16)J.attributes=[]}else{if(J.declaration=null,J.specifiers=this.parseExportSpecifiers(Q),this.eatContextual("from")){if(this.type!==X.string)this.unexpected();if(J.source=this.parseExprAtom(),this.options.ecmaVersion>=16)J.attributes=this.parseWithClause()}else{for(var Z=0,q=J.specifiers;Z<q.length;Z+=1){var R=q[Z];if(this.checkUnreserved(R.local),this.checkLocalExport(R.local),R.local.type==="Literal")this.raise(R.local.start,"A string literal cannot be used as an exported binding without `from`.")}if(J.source=null,this.options.ecmaVersion>=16)J.attributes=[]}this.semicolon()}return this.finishNode(J,"ExportNamedDeclaration")};H.parseExportDeclaration=function(J){return this.parseStatement(null)};H.parseExportDefaultDeclaration=function(){var J;if(this.type===X._function||(J=this.isAsyncFunction())){var Q=this.startNode();if(this.next(),J)this.next();return this.parseFunction(Q,t|iJ,!1,J)}else if(this.type===X._class){var Z=this.startNode();return this.parseClass(Z,"nullableID")}else{var q=this.parseMaybeAssign();return this.semicolon(),q}};H.checkExport=function(J,Q,Z){if(!J)return;if(typeof Q!=="string")Q=Q.type==="Identifier"?Q.name:Q.value;if(a(J,Q))this.raiseRecoverable(Z,"Duplicate export '"+Q+"'");J[Q]=!0};H.checkPatternExport=function(J,Q){var Z=Q.type;if(Z==="Identifier")this.checkExport(J,Q,Q.start);else if(Z==="ObjectPattern")for(var q=0,R=Q.properties;q<R.length;q+=1){var W=R[q];this.checkPatternExport(J,W)}else if(Z==="ArrayPattern")for(var Y=0,j=Q.elements;Y<j.length;Y+=1){var K=j[Y];if(K)this.checkPatternExport(J,K)}else if(Z==="Property")this.checkPatternExport(J,Q.value);else if(Z==="AssignmentPattern")this.checkPatternExport(J,Q.left);else if(Z==="RestElement")this.checkPatternExport(J,Q.argument)};H.checkVariableExport=function(J,Q){if(!J)return;for(var Z=0,q=Q;Z<q.length;Z+=1){var R=q[Z];this.checkPatternExport(J,R.id)}};H.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};H.parseExportSpecifier=function(J){var Q=this.startNode();return Q.local=this.parseModuleExportName(),Q.exported=this.eatContextual("as")?this.parseModuleExportName():Q.local,this.checkExport(J,Q.exported,Q.exported.start),this.finishNode(Q,"ExportSpecifier")};H.parseExportSpecifiers=function(J){var Q=[],Z=!0;this.expect(X.braceL);while(!this.eat(X.braceR)){if(!Z){if(this.expect(X.comma),this.afterTrailingComma(X.braceR))break}else Z=!1;Q.push(this.parseExportSpecifier(J))}return Q};H.parseImport=function(J){if(this.next(),this.type===X.string)J.specifiers=wQ,J.source=this.parseExprAtom();else J.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),J.source=this.type===X.string?this.parseExprAtom():this.unexpected();if(this.options.ecmaVersion>=16)J.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(J,"ImportDeclaration")};H.parseImportSpecifier=function(){var J=this.startNode();if(J.imported=this.parseModuleExportName(),this.eatContextual("as"))J.local=this.parseIdent();else this.checkUnreserved(J.imported),J.local=J.imported;return this.checkLValSimple(J.local,g),this.finishNode(J,"ImportSpecifier")};H.parseImportDefaultSpecifier=function(){var J=this.startNode();return J.local=this.parseIdent(),this.checkLValSimple(J.local,g),this.finishNode(J,"ImportDefaultSpecifier")};H.parseImportNamespaceSpecifier=function(){var J=this.startNode();return this.next(),this.expectContextual("as"),J.local=this.parseIdent(),this.checkLValSimple(J.local,g),this.finishNode(J,"ImportNamespaceSpecifier")};H.parseImportSpecifiers=function(){var J=[],Q=!0;if(this.type===X.name){if(J.push(this.parseImportDefaultSpecifier()),!this.eat(X.comma))return J}if(this.type===X.star)return J.push(this.parseImportNamespaceSpecifier()),J;this.expect(X.braceL);while(!this.eat(X.braceR)){if(!Q){if(this.expect(X.comma),this.afterTrailingComma(X.braceR))break}else Q=!1;J.push(this.parseImportSpecifier())}return J};H.parseWithClause=function(){var J=[];if(!this.eat(X._with))return J;this.expect(X.braceL);var Q={},Z=!0;while(!this.eat(X.braceR)){if(!Z){if(this.expect(X.comma),this.afterTrailingComma(X.braceR))break}else Z=!1;var q=this.parseImportAttribute(),R=q.key.type==="Identifier"?q.key.name:q.key.value;if(a(Q,R))this.raiseRecoverable(q.key.start,"Duplicate attribute key '"+R+"'");Q[R]=!0,J.push(q)}return J};H.parseImportAttribute=function(){var J=this.startNode();if(J.key=this.type===X.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(X.colon),this.type!==X.string)this.unexpected();return J.value=this.parseExprAtom(),this.finishNode(J,"ImportAttribute")};H.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===X.string){var J=this.parseLiteral(this.value);if(vQ.test(J.value))this.raise(J.start,"An export name cannot include a lone surrogate.");return J}return this.parseIdent(!0)};H.adaptDirectivePrologue=function(J){for(var Q=0;Q<J.length&&this.isDirectiveCandidate(J[Q]);++Q)J[Q].directive=J[Q].expression.raw.slice(1,-1)};H.isDirectiveCandidate=function(J){return this.options.ecmaVersion>=5&&J.type==="ExpressionStatement"&&J.expression.type==="Literal"&&typeof J.expression.value==="string"&&(this.input[J.start]==='"'||this.input[J.start]==="'")};var $=N.prototype;$.toAssignable=function(J,Q,Z){if(this.options.ecmaVersion>=6&&J)switch(J.type){case"Identifier":if(this.inAsync&&J.name==="await")this.raise(J.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":if(J.type="ObjectPattern",Z)this.checkPatternErrors(Z,!0);for(var q=0,R=J.properties;q<R.length;q+=1){var W=R[q];if(this.toAssignable(W,Q),W.type==="RestElement"&&(W.argument.type==="ArrayPattern"||W.argument.type==="ObjectPattern"))this.raise(W.argument.start,"Unexpected token")}break;case"Property":if(J.kind!=="init")this.raise(J.key.start,"Object pattern can't contain getter or setter");this.toAssignable(J.value,Q);break;case"ArrayExpression":if(J.type="ArrayPattern",Z)this.checkPatternErrors(Z,!0);this.toAssignableList(J.elements,Q);break;case"SpreadElement":if(J.type="RestElement",this.toAssignable(J.argument,Q),J.argument.type==="AssignmentPattern")this.raise(J.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":if(J.operator!=="=")this.raise(J.left.end,"Only '=' operator can be used for specifying default value.");J.type="AssignmentPattern",delete J.operator,this.toAssignable(J.left,Q);break;case"ParenthesizedExpression":this.toAssignable(J.expression,Q,Z);break;case"ChainExpression":this.raiseRecoverable(J.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!Q)break;default:this.raise(J.start,"Assigning to rvalue")}else if(Z)this.checkPatternErrors(Z,!0);return J};$.toAssignableList=function(J,Q){var Z=J.length;for(var q=0;q<Z;q++){var R=J[q];if(R)this.toAssignable(R,Q)}if(Z){var W=J[Z-1];if(this.options.ecmaVersion===6&&Q&&W&&W.type==="RestElement"&&W.argument.type!=="Identifier")this.unexpected(W.argument.start)}return J};$.parseSpread=function(J){var Q=this.startNode();return this.next(),Q.argument=this.parseMaybeAssign(!1,J),this.finishNode(Q,"SpreadElement")};$.parseRestBinding=function(){var J=this.startNode();if(this.next(),this.options.ecmaVersion===6&&this.type!==X.name)this.unexpected();return J.argument=this.parseBindingAtom(),this.finishNode(J,"RestElement")};$.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case X.bracketL:var J=this.startNode();return this.next(),J.elements=this.parseBindingList(X.bracketR,!0,!0),this.finishNode(J,"ArrayPattern");case X.braceL:return this.parseObj(!0)}return this.parseIdent()};$.parseBindingList=function(J,Q,Z,q){var R=[],W=!0;while(!this.eat(J)){if(W)W=!1;else this.expect(X.comma);if(Q&&this.type===X.comma)R.push(null);else if(Z&&this.afterTrailingComma(J))break;else if(this.type===X.ellipsis){var Y=this.parseRestBinding();if(this.parseBindingListItem(Y),R.push(Y),this.type===X.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");this.expect(J);break}else R.push(this.parseAssignableListItem(q))}return R};$.parseAssignableListItem=function(J){var Q=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(Q),Q};$.parseBindingListItem=function(J){return J};$.parseMaybeDefault=function(J,Q,Z){if(Z=Z||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(X.eq))return Z;var q=this.startNodeAt(J,Q);return q.left=Z,q.right=this.parseMaybeAssign(),this.finishNode(q,"AssignmentPattern")};$.checkLValSimple=function(J,Q,Z){if(Q===void 0)Q=WJ;var q=Q!==WJ;switch(J.type){case"Identifier":if(this.strict&&this.reservedWordsStrictBind.test(J.name))this.raiseRecoverable(J.start,(q?"Binding ":"Assigning to ")+J.name+" in strict mode");if(q){if(Q===g&&J.name==="let")this.raiseRecoverable(J.start,"let is disallowed as a lexically bound name");if(Z){if(a(Z,J.name))this.raiseRecoverable(J.start,"Argument name clash");Z[J.name]=!0}if(Q!==dJ)this.declareName(J.name,Q,J.start)}break;case"ChainExpression":this.raiseRecoverable(J.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(q)this.raiseRecoverable(J.start,"Binding member expression");break;case"ParenthesizedExpression":if(q)this.raiseRecoverable(J.start,"Binding parenthesized expression");return this.checkLValSimple(J.expression,Q,Z);default:this.raise(J.start,(q?"Binding":"Assigning to")+" rvalue")}};$.checkLValPattern=function(J,Q,Z){if(Q===void 0)Q=WJ;switch(J.type){case"ObjectPattern":for(var q=0,R=J.properties;q<R.length;q+=1){var W=R[q];this.checkLValInnerPattern(W,Q,Z)}break;case"ArrayPattern":for(var Y=0,j=J.elements;Y<j.length;Y+=1){var K=j[Y];if(K)this.checkLValInnerPattern(K,Q,Z)}break;default:this.checkLValSimple(J,Q,Z)}};$.checkLValInnerPattern=function(J,Q,Z){if(Q===void 0)Q=WJ;switch(J.type){case"Property":this.checkLValInnerPattern(J.value,Q,Z);break;case"AssignmentPattern":this.checkLValPattern(J.left,Q,Z);break;case"RestElement":this.checkLValPattern(J.argument,Q,Z);break;default:this.checkLValPattern(J,Q,Z)}};var L=function(Q,Z,q,R,W){this.token=Q,this.isExpr=!!Z,this.preserveSpace=!!q,this.override=R,this.generator=!!W},U={b_stat:new L("{",!1),b_expr:new L("{",!0),b_tmpl:new L("${",!1),p_stat:new L("(",!1),p_expr:new L("(",!0),q_tmpl:new L("`",!0,!0,function(J){return J.tryReadTemplateToken()}),f_stat:new L("function",!1),f_expr:new L("function",!0),f_expr_gen:new L("function",!0,!1,null,!0),f_gen:new L("function",!1,!1,null,!0)},o=N.prototype;o.initialContext=function(){return[U.b_stat]};o.curContext=function(){return this.context[this.context.length-1]};o.braceIsBlock=function(J){var Q=this.curContext();if(Q===U.f_expr||Q===U.f_stat)return!0;if(J===X.colon&&(Q===U.b_stat||Q===U.b_expr))return!Q.isExpr;if(J===X._return||J===X.name&&this.exprAllowed)return v.test(this.input.slice(this.lastTokEnd,this.start));if(J===X._else||J===X.semi||J===X.eof||J===X.parenR||J===X.arrow)return!0;if(J===X.braceL)return Q===U.b_stat;if(J===X._var||J===X._const||J===X.name)return!1;return!this.exprAllowed};o.inGeneratorContext=function(){for(var J=this.context.length-1;J>=1;J--){var Q=this.context[J];if(Q.token==="function")return Q.generator}return!1};o.updateContext=function(J){var Q,Z=this.type;if(Z.keyword&&J===X.dot)this.exprAllowed=!1;else if(Q=Z.updateContext)Q.call(this,J);else this.exprAllowed=Z.beforeExpr};o.overrideContext=function(J){if(this.curContext()!==J)this.context[this.context.length-1]=J};X.parenR.updateContext=X.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var J=this.context.pop();if(J===U.b_stat&&this.curContext().token==="function")J=this.context.pop();this.exprAllowed=!J.isExpr};X.braceL.updateContext=function(J){this.context.push(this.braceIsBlock(J)?U.b_stat:U.b_expr),this.exprAllowed=!0};X.dollarBraceL.updateContext=function(){this.context.push(U.b_tmpl),this.exprAllowed=!0};X.parenL.updateContext=function(J){var Q=J===X._if||J===X._for||J===X._with||J===X._while;this.context.push(Q?U.p_stat:U.p_expr),this.exprAllowed=!0};X.incDec.updateContext=function(){};X._function.updateContext=X._class.updateContext=function(J){if(J.beforeExpr&&J!==X._else&&!(J===X.semi&&this.curContext()!==U.p_stat)&&!(J===X._return&&v.test(this.input.slice(this.lastTokEnd,this.start)))&&!((J===X.colon||J===X.braceL)&&this.curContext()===U.b_stat))this.context.push(U.f_expr);else this.context.push(U.f_stat);this.exprAllowed=!1};X.colon.updateContext=function(){if(this.curContext().token==="function")this.context.pop();this.exprAllowed=!0};X.backQuote.updateContext=function(){if(this.curContext()===U.q_tmpl)this.context.pop();else this.context.push(U.q_tmpl);this.exprAllowed=!1};X.star.updateContext=function(J){if(J===X._function){var Q=this.context.length-1;if(this.context[Q]===U.f_expr)this.context[Q]=U.f_expr_gen;else this.context[Q]=U.f_gen}this.exprAllowed=!0};X.name.updateContext=function(J){var Q=!1;if(this.options.ecmaVersion>=6&&J!==X.dot){if(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())Q=!0}this.exprAllowed=Q};var O=N.prototype;O.checkPropClash=function(J,Q,Z){if(this.options.ecmaVersion>=9&&J.type==="SpreadElement")return;if(this.options.ecmaVersion>=6&&(J.computed||J.method||J.shorthand))return;var q=J.key,R;switch(q.type){case"Identifier":R=q.name;break;case"Literal":R=String(q.value);break;default:return}var W=J.kind;if(this.options.ecmaVersion>=6){if(R==="__proto__"&&W==="init"){if(Q.proto)if(Z){if(Z.doubleProto<0)Z.doubleProto=q.start}else this.raiseRecoverable(q.start,"Redefinition of __proto__ property");Q.proto=!0}return}R="$"+R;var Y=Q[R];if(Y){var j;if(W==="init")j=this.strict&&Y.init||Y.get||Y.set;else j=Y.init||Y[W];if(j)this.raiseRecoverable(q.start,"Redefinition of property")}else Y=Q[R]={init:!1,get:!1,set:!1};Y[W]=!0};O.parseExpression=function(J,Q){var Z=this;return this.catchStackOverflow(function(){var{start:q,startLoc:R}=Z,W=Z.parseMaybeAssign(J,Q);if(Z.type===X.comma){var Y=Z.startNodeAt(q,R);Y.expressions=[W];while(Z.eat(X.comma))Y.expressions.push(Z.parseMaybeAssign(J,Q));return Z.finishNode(Y,"SequenceExpression")}return W})};O.parseMaybeAssign=function(J,Q,Z){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield(J);else this.exprAllowed=!1;var q=!1,R=-1,W=-1,Y=-1;if(Q)R=Q.parenthesizedAssign,W=Q.trailingComma,Y=Q.doubleProto,Q.parenthesizedAssign=Q.trailingComma=-1;else Q=new OJ,q=!0;var j=this.start,K=this.startLoc;if(this.type===X.parenL||this.type===X.name)this.potentialArrowAt=this.start,this.potentialArrowInForAwait=J==="await";var z=this.parseMaybeConditional(J,Q);if(Z)z=Z.call(this,z,j,K);if(this.type.isAssign){var G=this.startNodeAt(j,K);if(G.operator=this.value,this.type===X.eq)z=this.toAssignable(z,!1,Q);if(!q)Q.parenthesizedAssign=Q.trailingComma=Q.doubleProto=-1;if(Q.shorthandAssign>=z.start)Q.shorthandAssign=-1;if(this.type===X.eq)this.checkLValPattern(z);else this.checkLValSimple(z);if(G.left=z,this.next(),G.right=this.parseMaybeAssign(J),Y>-1)Q.doubleProto=Y;return this.finishNode(G,"AssignmentExpression")}else if(q)this.checkExpressionErrors(Q,!0);if(R>-1)Q.parenthesizedAssign=R;if(W>-1)Q.trailingComma=W;return z};O.parseMaybeConditional=function(J,Q){var Z=this.start,q=this.startLoc,R=this.parseExprOps(J,Q);if(this.checkExpressionErrors(Q))return R;if(!(R.type==="ArrowFunctionExpression"&&R.start===Z)&&this.eat(X.question)){var W=this.startNodeAt(Z,q);return W.test=R,W.consequent=this.parseMaybeAssign(),this.expect(X.colon),W.alternate=this.parseMaybeAssign(J),this.finishNode(W,"ConditionalExpression")}return R};O.parseExprOps=function(J,Q){var Z=this.start,q=this.startLoc,R=this.parseMaybeUnary(Q,!1,!1,J);if(this.checkExpressionErrors(Q))return R;return R.start===Z&&R.type==="ArrowFunctionExpression"?R:this.parseExprOp(R,Z,q,-1,J)};O.parseExprOp=function(J,Q,Z,q,R){var W=this.type.binop;if(W!=null&&(!R||this.type!==X._in)){if(W>q){var Y=this.type===X.logicalOR||this.type===X.logicalAND,j=this.type===X.coalesce;if(j)W=X.logicalAND.binop;var K=this.value;this.next();var z=this.start,G=this.startLoc,B=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,R),z,G,W,R),I=this.buildBinary(Q,Z,J,B,K,Y||j);if(Y&&this.type===X.coalesce||j&&(this.type===X.logicalOR||this.type===X.logicalAND))this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");return this.parseExprOp(I,Q,Z,q,R)}}return J};O.buildBinary=function(J,Q,Z,q,R,W){if(q.type==="PrivateIdentifier")this.raise(q.start,"Private identifier can only be left side of binary expression");var Y=this.startNodeAt(J,Q);return Y.left=Z,Y.operator=R,Y.right=q,this.finishNode(Y,W?"LogicalExpression":"BinaryExpression")};O.parseMaybeUnary=function(J,Q,Z,q){var R=this.start,W=this.startLoc,Y;if(this.isContextual("await")&&this.canAwait)Y=this.parseAwait(q),Q=!0;else if(this.type.prefix){var j=this.startNode(),K=this.type===X.incDec;if(j.operator=this.value,j.prefix=!0,this.next(),j.argument=this.parseMaybeUnary(null,!0,K,q),this.checkExpressionErrors(J,!0),K)this.checkLValSimple(j.argument);else if(this.strict&&j.operator==="delete"&&nJ(j.argument))this.raiseRecoverable(j.start,"Deleting local variable in strict mode");else if(j.operator==="delete"&&NJ(j.argument))this.raiseRecoverable(j.start,"Private fields can not be deleted");else Q=!0;Y=this.finishNode(j,K?"UpdateExpression":"UnaryExpression")}else if(!Q&&this.type===X.privateId){if((q||this.privateNameStack.length===0)&&this.options.checkPrivateFields)this.unexpected();if(Y=this.parsePrivateIdent(),this.type!==X._in)this.unexpected()}else{if(Y=this.parseExprSubscripts(J,q),this.checkExpressionErrors(J))return Y;while(this.type.postfix&&!this.canInsertSemicolon()){var z=this.startNodeAt(R,W);z.operator=this.value,z.prefix=!1,z.argument=Y,this.checkLValSimple(Y),this.next(),Y=this.finishNode(z,"UpdateExpression")}}if(!Z&&!(Y.type==="ArrowFunctionExpression"&&Y.start===R)&&this.eat(X.starstar))if(Q)this.unexpected(this.lastTokStart);else return this.buildBinary(R,W,Y,this.parseMaybeUnary(null,!1,!1,q),"**",!1);else return Y};function nJ(J){return J.type==="Identifier"||J.type==="ParenthesizedExpression"&&nJ(J.expression)}function NJ(J){return J.type==="MemberExpression"&&J.property.type==="PrivateIdentifier"||J.type==="ChainExpression"&&NJ(J.expression)||J.type==="ParenthesizedExpression"&&NJ(J.expression)}O.parseExprSubscripts=function(J,Q){var Z=this.start,q=this.startLoc,R=this.parseExprAtom(J,Q);if(R.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return R;var W=this.parseSubscripts(R,Z,q,!1,Q);if(J&&W.type==="MemberExpression"){if(J.parenthesizedAssign>=W.start)J.parenthesizedAssign=-1;if(J.parenthesizedBind>=W.start)J.parenthesizedBind=-1;if(J.trailingComma>=W.start)J.trailingComma=-1}return W};O.parseSubscripts=function(J,Q,Z,q,R){var W=this.options.ecmaVersion>=8&&J.type==="Identifier"&&J.name==="async"&&this.lastTokEnd===J.end&&!this.canInsertSemicolon()&&J.end-J.start===5&&this.potentialArrowAt===J.start,Y=!1;while(!0){var j=this.parseSubscript(J,Q,Z,q,W,Y,R);if(j.optional)Y=!0;if(j===J||j.type==="ArrowFunctionExpression"){if(Y){var K=this.startNodeAt(Q,Z);K.expression=j,j=this.finishNode(K,"ChainExpression")}return j}J=j}};O.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(X.arrow)};O.parseSubscriptAsyncArrow=function(J,Q,Z,q){return this.parseArrowExpression(this.startNodeAt(J,Q),Z,!0,q)};O.parseSubscript=function(J,Q,Z,q,R,W,Y){var j=this.options.ecmaVersion>=11,K=j&&this.eat(X.questionDot);if(q&&K)this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var z=this.eat(X.bracketL);if(z||K&&this.type!==X.parenL&&this.type!==X.backQuote||this.eat(X.dot)){var G=this.startNodeAt(Q,Z);if(G.object=J,z)G.property=this.parseExpression(),this.expect(X.bracketR);else if(this.type===X.privateId&&J.type!=="Super")G.property=this.parsePrivateIdent();else G.property=this.parseIdent(this.options.allowReserved!=="never");if(G.computed=!!z,j)G.optional=K;J=this.finishNode(G,"MemberExpression")}else if(!q&&this.eat(X.parenL)){var B=new OJ,I=this.yieldPos,r=this.awaitPos,c=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var qJ=this.parseExprList(X.parenR,this.options.ecmaVersion>=8,!1,B);if(R&&!K&&this.shouldParseAsyncArrow()){if(this.checkPatternErrors(B,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0)this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function");return this.yieldPos=I,this.awaitPos=r,this.awaitIdentPos=c,this.parseSubscriptAsyncArrow(Q,Z,qJ,Y)}this.checkExpressionErrors(B,!0),this.yieldPos=I||this.yieldPos,this.awaitPos=r||this.awaitPos,this.awaitIdentPos=c||this.awaitIdentPos;var d=this.startNodeAt(Q,Z);if(d.callee=J,d.arguments=qJ,j)d.optional=K;J=this.finishNode(d,"CallExpression")}else if(this.type===X.backQuote){if(K||W)this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var i=this.startNodeAt(Q,Z);i.tag=J,i.quasi=this.parseTemplate({isTagged:!0}),J=this.finishNode(i,"TaggedTemplateExpression")}return J};O.parseExprAtom=function(J,Q,Z){if(this.type===X.slash)this.readRegexp();var q,R=this.potentialArrowAt===this.start;switch(this.type){case X._super:if(!this.allowSuper)this.raise(this.start,"'super' keyword outside a method");if(q=this.startNode(),this.next(),this.type===X.parenL&&!this.allowDirectSuper)this.raise(q.start,"super() call outside constructor of a subclass");if(this.type!==X.dot&&this.type!==X.bracketL&&this.type!==X.parenL)this.unexpected();return this.finishNode(q,"Super");case X._this:return q=this.startNode(),this.next(),this.finishNode(q,"ThisExpression");case X.name:var W=this.start,Y=this.startLoc,j=this.containsEsc,K=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!j&&K.name==="async"&&!this.canInsertSemicolon()&&this.eat(X._function))return this.overrideContext(U.f_expr),this.parseFunction(this.startNodeAt(W,Y),0,!1,!0,Q);if(R&&!this.canInsertSemicolon()){if(this.eat(X.arrow))return this.parseArrowExpression(this.startNodeAt(W,Y),[K],!1,Q);if(this.options.ecmaVersion>=8&&K.name==="async"&&this.type===X.name&&!j&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){if(K=this.parseIdent(!1),this.canInsertSemicolon()||!this.eat(X.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAt(W,Y),[K],!0,Q)}}return K;case X.regexp:var z=this.value;return q=this.parseLiteral(z.value),q.regex={pattern:z.pattern,flags:z.flags},q;case X.num:case X.string:return this.parseLiteral(this.value);case X._null:case X._true:case X._false:return q=this.startNode(),q.value=this.type===X._null?null:this.type===X._true,q.raw=this.type.keyword,this.next(),this.finishNode(q,"Literal");case X.parenL:var G=this.start,B=this.parseParenAndDistinguishExpression(R,Q);if(J){if(J.parenthesizedAssign<0&&!this.isSimpleAssignTarget(B))J.parenthesizedAssign=G;if(J.parenthesizedBind<0)J.parenthesizedBind=G}return B;case X.bracketL:return q=this.startNode(),this.next(),q.elements=this.parseExprList(X.bracketR,!0,!0,J),this.finishNode(q,"ArrayExpression");case X.braceL:return this.overrideContext(U.b_expr),this.parseObj(!1,J);case X._function:return q=this.startNode(),this.next(),this.parseFunction(q,0);case X._class:return this.parseClass(this.startNode(),!1);case X._new:return this.parseNew();case X.backQuote:return this.parseTemplate();case X._import:if(this.options.ecmaVersion>=11)return this.parseExprImport(Z);else return this.unexpected();default:return this.parseExprAtomDefault()}};O.parseExprAtomDefault=function(){this.unexpected()};O.parseExprImport=function(J){var Q=this.startNode();if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword import");if(this.next(),this.type===X.parenL&&!J)return this.parseDynamicImport(Q);else if(this.type===X.dot){var Z=this.startNodeAt(Q.start,Q.loc&&Q.loc.start);return Z.name="import",Q.meta=this.finishNode(Z,"Identifier"),this.parseImportMeta(Q)}else this.unexpected()};O.parseDynamicImport=function(J){if(this.next(),J.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)if(!this.eat(X.parenR))if(this.expect(X.comma),!this.afterTrailingComma(X.parenR)){if(J.options=this.parseMaybeAssign(),!this.eat(X.parenR)){if(this.expect(X.comma),!this.afterTrailingComma(X.parenR))this.unexpected()}}else J.options=null;else J.options=null;else if(!this.eat(X.parenR)){var Q=this.start;if(this.eat(X.comma)&&this.eat(X.parenR))this.raiseRecoverable(Q,"Trailing comma is not allowed in import()");else this.unexpected(Q)}return this.finishNode(J,"ImportExpression")};O.parseImportMeta=function(J){this.next();var Q=this.containsEsc;if(J.property=this.parseIdent(!0),J.property.name!=="meta")this.raiseRecoverable(J.property.start,"The only valid meta property for import is 'import.meta'");if(Q)this.raiseRecoverable(J.start,"'import.meta' must not contain escaped characters");if(this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere)this.raiseRecoverable(J.start,"Cannot use 'import.meta' outside a module");return this.finishNode(J,"MetaProperty")};O.parseLiteral=function(J){var Q=this.startNode();if(Q.value=J,Q.raw=this.input.slice(this.start,this.end),Q.raw.charCodeAt(Q.raw.length-1)===110)Q.bigint=Q.value!=null?Q.value.toString():Q.raw.slice(0,-1).replace(/_/g,"");return this.next(),this.finishNode(Q,"Literal")};O.parseParenExpression=function(){this.expect(X.parenL);var J=this.parseExpression();return this.expect(X.parenR),J};O.shouldParseArrow=function(J){return!this.canInsertSemicolon()};O.parseParenAndDistinguishExpression=function(J,Q){var Z=this.start,q=this.startLoc,R,W=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var Y=this.start,j=this.startLoc,K=[],z=!0,G=!1,B=new OJ,I=this.yieldPos,r=this.awaitPos,c;this.yieldPos=0,this.awaitPos=0;while(this.type!==X.parenR)if(z?z=!1:this.expect(X.comma),W&&this.afterTrailingComma(X.parenR,!0)){G=!0;break}else if(this.type===X.ellipsis){if(c=this.start,K.push(this.parseParenItem(this.parseRestBinding())),this.type===X.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else K.push(this.parseMaybeAssign(!1,B,this.parseParenItem));var qJ=this.lastTokEnd,d=this.lastTokEndLoc;if(this.expect(X.parenR),J&&this.shouldParseArrow(K)&&this.eat(X.arrow))return this.checkPatternErrors(B,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=I,this.awaitPos=r,this.parseParenArrowList(Z,q,K,Q);if(!K.length||G)this.unexpected(this.lastTokStart);if(c)this.unexpected(c);if(this.checkExpressionErrors(B,!0),this.yieldPos=I||this.yieldPos,this.awaitPos=r||this.awaitPos,K.length>1)R=this.startNodeAt(Y,j),R.expressions=K,this.finishNodeAt(R,"SequenceExpression",qJ,d);else R=K[0]}else R=this.parseParenExpression();if(this.options.preserveParens){var i=this.startNodeAt(Z,q);return i.expression=R,this.finishNode(i,"ParenthesizedExpression")}else return R};O.parseParenItem=function(J){return J};O.parseParenArrowList=function(J,Q,Z,q){return this.parseArrowExpression(this.startNodeAt(J,Q),Z,!1,q)};var $Q=[];O.parseNew=function(){if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword new");var J=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===X.dot){var Q=this.startNodeAt(J.start,J.loc&&J.loc.start);Q.name="new",J.meta=this.finishNode(Q,"Identifier"),this.next();var Z=this.containsEsc;if(J.property=this.parseIdent(!0),J.property.name!=="target")this.raiseRecoverable(J.property.start,"The only valid meta property for new is 'new.target'");if(Z)this.raiseRecoverable(J.start,"'new.target' must not contain escaped characters");if(!this.allowNewDotTarget)this.raiseRecoverable(J.start,"'new.target' can only be used in functions and class static block");return this.finishNode(J,"MetaProperty")}var q=this.start,R=this.startLoc;if(J.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),q,R,!0,!1),J.callee.type==="Super")this.raiseRecoverable(q,"Invalid use of 'super'");if(this.eat(X.parenL))J.arguments=this.parseExprList(X.parenR,this.options.ecmaVersion>=8,!1);else J.arguments=$Q;return this.finishNode(J,"NewExpression")};O.parseTemplateElement=function(J){var Q=J.isTagged,Z=this.startNode();if(this.type===X.invalidTemplate){if(!Q)this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal");Z.value={raw:this.value.replace(/\r\n?/g,`
|
|
4
4
|
`),cooked:null}}else Z.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|
|
@@ -7,4 +7,4 @@ Defaulting to 2020, but this will stop working in the future.`);Q.ecmaVersion=11
|
|
|
7
7
|
`)++this.pos;case`
|
|
8
8
|
`:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")};F.readEscapedChar=function(J){var Q=this.input.charCodeAt(++this.pos);switch(++this.pos,Q){case 110:return`
|
|
9
9
|
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return y(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:if(this.options.locations)this.lineStart=this.pos,++this.curLine;return"";case 56:case 57:if(this.strict)this.invalidStringToken(this.pos-1,"Invalid escape sequence");if(J){var Z=this.pos-1;this.invalidStringToken(Z,"Invalid escape sequence in template string")}default:if(Q>=48&&Q<=55){var q=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],R=parseInt(q,8);if(R>255)q=q.slice(0,-1),R=parseInt(q,8);if(this.pos+=q.length-1,Q=this.input.charCodeAt(this.pos),(q!=="0"||Q===56||Q===57)&&(this.strict||J))this.invalidStringToken(this.pos-1-q.length,J?"Octal literal in template string":"Octal literal in strict mode");return String.fromCharCode(R)}if(u(Q)){if(this.options.locations)this.lineStart=this.pos,++this.curLine;return""}return String.fromCharCode(Q)}};F.readHexChar=function(J){var Q=this.pos,Z=this.readInt(16,J);if(Z===null)this.invalidStringToken(Q,"Bad character escape sequence");return Z};F.readWord1=function(){this.containsEsc=!1;var J="",Q=!0,Z=this.pos,q=this.options.ecmaVersion>=6;while(this.pos<this.input.length){var R=this.fullCharCodeAtPos();if(E(R,q))this.pos+=R<=65535?1:2;else if(R===92){this.containsEsc=!0,J+=this.input.slice(Z,this.pos);var W=this.pos;if(this.input.charCodeAt(++this.pos)!==117)this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX");++this.pos;var Y=this.readCodePoint();if(!(Q?k:E)(Y,q))this.invalidStringToken(W,"Invalid Unicode escape");J+=y(Y),Z=this.pos}else break;Q=!1}return J+this.input.slice(Z,this.pos)};F.readWord=function(){var J=this.readWord1(),Q=X.name;if(this.keywords.test(J))Q=_J[J];return this.finishToken(Q,J)};var FQ="8.18.0";N.acorn={Parser:N,version:FQ,defaultOptions:RJ,Position:n,SourceLocation:e,getLineInfo:SJ,Node:QJ,TokenType:M,tokTypes:X,keywordTypes:_J,TokContext:L,tokContexts:U,isIdentifierChar:E,isIdentifierStart:k,Token:FJ,isNewLine:u,lineBreak:v,lineBreakG:xJ,nonASCIIwhitespace:IJ};function tQ(J,Q){return N.parse(J,Q)}function eQ(J,Q,Z){return N.parseExpressionAt(J,Q,Z)}function JZ(J,Q){return N.tokenizer(J,Q)}
|
|
10
|
-
export{k as
|
|
10
|
+
export{k as Z,E as _,N as $,tQ as aa,QZ as ba};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import{A as $0,B as J0,C as xO,D as x0,E as QO,H as GO,I as Q1,J as v,K as n0,L as y,M as C0,N as uO,O as mO,P as lO,Q as k0,R as dO,S as cO,T as W1,U as CO,V as Y1,W as iO,v as bO,w as H0,x as Q0,y as $1,z as P0}from"./chunk-fwfazckg.js";import{Y as X1}from"./chunk-9vv4gm0m.js";class A0{constructor(){this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:()=>this.should_skip=!0,remove:()=>this.should_remove=!0,replace:(O)=>this.replacement=O}}replace(O,Z,$,Q){if(O&&Z)if($!=null)O[Z][$]=Q;else O[Z]=Q}remove(O,Z,$){if(O&&Z)if($!==null&&$!==void 0)O[Z].splice($,1);else delete O[Z]}}class N0 extends A0{constructor(O,Z){super();this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:()=>this.should_skip=!0,remove:()=>this.should_remove=!0,replace:($)=>this.replacement=$},this.enter=O,this.leave=Z}visit(O,Z,$,Q){if(O){if(this.enter){let Y=this.should_skip,X=this.should_remove,K=this.replacement;if(this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.enter.call(this.context,O,Z,$,Q),this.replacement)O=this.replacement,this.replace(Z,$,Q,O);if(this.should_remove)this.remove(Z,$,Q);let q=this.should_skip,z=this.should_remove;if(this.should_skip=Y,this.should_remove=X,this.replacement=K,q)return O;if(z)return null}let W;for(W in O){let Y=O[W];if(Y&&typeof Y==="object"){if(Array.isArray(Y)){let X=Y;for(let K=0;K<X.length;K+=1){let q=X[K];if(WO(q)){if(!this.visit(q,O,W,K))K--}}}else if(WO(Y))this.visit(Y,O,W,null)}}if(this.leave){let Y=this.replacement,X=this.should_remove;if(this.replacement=null,this.should_remove=!1,this.leave.call(this.context,O,Z,$,Q),this.replacement)O=this.replacement,this.replace(Z,$,Q,O);if(this.should_remove)this.remove(Z,$,Q);let K=this.should_remove;if(this.replacement=Y,this.should_remove=X,K)return null}}return O}}function WO(O){return O!==null&&typeof O==="object"&&"type"in O&&typeof O.type==="string"}function K0(O,{enter:Z,leave:$}){return new N0(Z,$).visit(O,null)}var YO={a:"HTMLAnchorElement",abbr:"HTMLElement",address:"HTMLElement",applet:"HTMLUnknownElement",area:"HTMLAreaElement",article:"HTMLElement",aside:"HTMLElement",audio:"HTMLAudioElement",b:"HTMLElement",base:"HTMLBaseElement",basefont:"HTMLElement",bdi:"HTMLElement",bdo:"HTMLElement",blockquote:"HTMLQuoteElement",body:"HTMLBodyElement",br:"HTMLBRElement",button:"HTMLButtonElement",canvas:"HTMLCanvasElement",caption:"HTMLTableCaptionElement",cite:"HTMLElement",code:"HTMLElement",col:"HTMLTableColElement",colgroup:"HTMLTableColElement",data:"HTMLDataElement",datalist:"HTMLDataListElement",dd:"HTMLElement",del:"HTMLModElement",details:"HTMLDetailsElement",dfn:"HTMLElement",dialog:"HTMLDialogElement",dir:"HTMLDirectoryElement",div:"HTMLDivElement",dl:"HTMLDListElement",dt:"HTMLElement",em:"HTMLElement",embed:"HTMLEmbedElement",fieldset:"HTMLFieldSetElement",figcaption:"HTMLElement",figure:"HTMLElement",font:"HTMLFontElement",footer:"HTMLElement",form:"HTMLFormElement",frame:"HTMLFrameElement",frameset:"HTMLFrameSetElement",h1:"HTMLHeadingElement",h2:"HTMLHeadingElement",h3:"HTMLHeadingElement",h4:"HTMLHeadingElement",h5:"HTMLHeadingElement",h6:"HTMLHeadingElement",head:"HTMLHeadElement",header:"HTMLElement",hgroup:"HTMLElement",hr:"HTMLHRElement",html:"HTMLHtmlElement",i:"HTMLElement",iframe:"HTMLIFrameElement",img:"HTMLImageElement",input:"HTMLInputElement",ins:"HTMLModElement",kbd:"HTMLElement",label:"HTMLLabelElement",legend:"HTMLLegendElement",li:"HTMLLIElement",link:"HTMLLinkElement",main:"HTMLElement",map:"HTMLMapElement",mark:"HTMLElement",marquee:"HTMLMarqueeElement",menu:"HTMLMenuElement",meta:"HTMLMetaElement",meter:"HTMLMeterElement",nav:"HTMLElement",noscript:"HTMLElement",object:"HTMLObjectElement",ol:"HTMLOListElement",optgroup:"HTMLOptGroupElement",option:"HTMLOptionElement",output:"HTMLOutputElement",p:"HTMLParagraphElement",param:"HTMLParamElement",picture:"HTMLPictureElement",pre:"HTMLPreElement",progress:"HTMLProgressElement",q:"HTMLQuoteElement",rp:"HTMLElement",rt:"HTMLElement",ruby:"HTMLElement",s:"HTMLElement",samp:"HTMLElement",script:"HTMLScriptElement",search:"HTMLElement",section:"HTMLElement",select:"HTMLSelectElement",slot:"HTMLSlotElement",small:"HTMLElement",source:"HTMLSourceElement",span:"HTMLSpanElement",strong:"HTMLElement",style:"HTMLStyleElement",sub:"HTMLElement",summary:"HTMLElement",sup:"HTMLElement",table:"HTMLTableElement",tbody:"HTMLTableSectionElement",td:"HTMLTableCellElement",template:"HTMLTemplateElement",textarea:"HTMLTextAreaElement",tfoot:"HTMLTableSectionElement",th:"HTMLTableCellElement",thead:"HTMLTableSectionElement",time:"HTMLTimeElement",title:"HTMLTitleElement",tr:"HTMLTableRowElement",track:"HTMLTrackElement",u:"HTMLElement",ul:"HTMLUListElement",var:"HTMLElement",video:"HTMLVideoElement",wbr:"HTMLElement"};function K1(O){return O in YO}function XO(O){if(K1(O))return YO[O];return"HTMLElement"}var q1=/\w/;function G1(O,Z){let $=O.trim();if(!$.startsWith("{")||!$.endsWith("}"))return;let Q=$.slice(1,-1),W=[],Y=0,X="";for(let K of Q)if(K==="{"||K==="<"||K==="("||K==="[")Y++,X+=K;else if(K==="}"||K===">"||K===")"||K==="]")Y--,X+=K;else if((K===";"||K===",")&&Y===0)W.push(X.trim()),X="";else X+=K;if(X.trim())W.push(X.trim());for(let K of W){if(!K.startsWith(Z))continue;let q=K.slice(Z.length);if(q.length>0&&q1.test(q[0]))continue;let z=q.trimStart();if(z.startsWith("?"))z=z.slice(1).trimStart();if(z.startsWith(":"))return z.slice(1).trim()}return}function F0(O,Z,$){let Q=$;if(Q.computed||Q.object?.type!=="Identifier"||Q.property?.type!=="Identifier")return;let W=Q.object.name,Y=Q.property.name;if(!W||!Y)return;if(O.wholePropsLocals.has(W))return Z.getPropTypeByLocalOrPublic(Y);let X=Z.getPropTypeByLocalOrPublic(W)??Z.findVariableTypeAndDescription(W)?.type;if(!X)return;return G1(X,Y)}function v0(){return{syntaxMode:"legacy",scriptLanguage:void 0,source:void 0,parsed:void 0,runesOptionOverride:void 0,sourceLineStartOffsetsCache:void 0,rest_props:void 0,extends:void 0,customElementTag:void 0,componentComment:void 0,componentCommentSource:void 0,generics:null,scriptGenericsAttribute:void 0,diagnosticRecords:[],componentFilePath:"",props:new Map,moduleExports:new Map,propLocalToPublicName:new Map,reactive_vars:new Set,funcDecls:new Map,vars:new Set,runesPropsDeclarationMetadataByDeclaratorStart:new Map,typedRunesPropsDeclarations:[],explicitPropTypesByName:new Map,explicitVariableTypesByName:new Map,typeImportBindingsByLocalName:new Map,localTypeDeclarationsByName:new Map,wholePropsLocals:new Set,restPropLocals:new Set,componentScope:new Map,scopeDeclarations:new WeakMap,activeScopes:[],slots:new Map,snippetPropLocals:new Set,deferredSlotBlockGenerics:[],events:new Map,eventDescriptions:new Map,forwardedEvents:new Map,jsDocEventNames:new Set,jsDocEventSources:new Map,bindings:new Map,contexts:new Map,typedefs:new Map,variableInfoCache:new Map,variableInfoCacheBuilt:!1}}function q0(O,Z,$,Q,W){O.diagnosticRecords.push({component:O.componentFilePath,kind:Z,name:$,message:Q,...W?{source:W}:{}})}function n(O){return O===void 0||O===""?void 0:O}function M0(O,Z,$,Q){if(n($)===void 0)return;if(O.trackPropLocalName($),Z.props.has($)){let W=Z.props.get($);Z.props.set($,{...W,...Q})}else Z.props.set($,Q)}function z0(O,Z,$,Q=0){let W,Y,X=!1;if(!$||typeof $!=="object"||!("type"in $))return{value:W,type:Y,isFunction:X};let K=qO(O,Z,$);if($.type==="ObjectExpression"||$.type==="BinaryExpression"||$.type==="ArrayExpression"||$.type==="ArrowFunctionExpression"||$.type==="FunctionExpression"){let q=$;if("start"in q&&"end"in q&&typeof q.start==="number"&&typeof q.end==="number")W=y(Z,q.start,q.end)?.replace(GO," ");if(Y=W,X=$.type==="ArrowFunctionExpression"||$.type==="FunctionExpression",$.type==="BinaryExpression"){let z=$;if(z.left&&typeof z.left==="object"&&"type"in z.left&&z.left.type==="Literal"&&"value"in z.left&&typeof z.left.value==="string")Y="string"}if($.type==="ArrowFunctionExpression"||$.type==="FunctionExpression")Y=zO($),W=KO(Z,$)}else if($.type==="UnaryExpression"){let q=$;if("start"in q&&"end"in q&&typeof q.start==="number"&&typeof q.end==="number")W=y(Z,q.start,q.end);if(q.argument){if(typeof q.argument==="object"&&"type"in q.argument&&q.argument.type==="UnaryExpression")Y=z0(O,Z,q.argument).type;else if(typeof q.argument==="object"&&"value"in q.argument)Y=typeof q.argument.value}}else if($.type==="NewExpression"){let q=$;if("start"in q&&"end"in q&&typeof q.start==="number"&&typeof q.end==="number")W=y(Z,q.start,q.end);if(q.callee&&typeof q.callee==="object"&&"type"in q.callee&&q.callee.type==="Identifier"){let z=q.callee.name;if(z==="Date")Y="Date";else if(z==="Map")Y="Map<any, any>";else if(z==="Set")Y="Set<any>";else if(z==="WeakMap")Y="WeakMap<object, any>";else if(z==="WeakSet")Y="WeakSet<object>";else if(z==="Array")Y="any[]";else if(z==="RegExp"||z==="Regexp")Y="RegExp";else if(z==="Error")Y="Error";else Y=z}}else if($.type==="CallExpression"){let q=$;if("start"in q&&"end"in q&&typeof q.start==="number"&&typeof q.end==="number")W=y(Z,q.start,q.end)}else if($.type==="Identifier"){let q=$;if(Q<5){let z=U1(Z,q.name);if(z){let U=z0(O,Z,z,Q+1),J=O.resolveLocalVarJSDoc(q.name);return{...U,resolvedType:J?.type??U.resolvedType,resolvedDescription:J?.description??U.resolvedDescription,resolvedParams:J?.params??U.resolvedParams,resolvedReturnType:J?.returnType??U.resolvedReturnType}}if(Z.funcDecls.has(q.name)){let U=O.resolveLocalVarJSDoc(q.name),J=Z.funcDecls.get(q.name);return{value:J?KO(Z,J):void 0,type:void 0,isFunction:!0,defaultValue:J?qO(O,Z,J):void 0,resolvedType:U?.type??z1(U,J),resolvedDescription:U?.description,resolvedParams:U?.params,resolvedReturnType:U?.returnType}}}if("start"in q&&"end"in q&&typeof q.start==="number"&&typeof q.end==="number")W=y(Z,q.start,q.end)}else if($.type==="MemberExpression"){let q=$;if("start"in q&&"end"in q&&typeof q.start==="number"&&typeof q.end==="number")W=y(Z,q.start,q.end);if(O.isNumericConstant($))Y="number"}else if($.type==="TemplateLiteral"){let q=$;if("start"in q&&"end"in q&&typeof q.start==="number"&&typeof q.end==="number")W=y(Z,q.start,q.end);Y="string"}else if("raw"in $&&typeof $.raw==="string"){if(W=$.raw,"value"in $)Y=$.value==null?void 0:typeof $.value}return{value:W,type:Y,isFunction:X,defaultValue:K}}function U1(O,Z){for(let $ of O.vars)for(let Q of $.declarations)if(Q.id&&typeof Q.id==="object"&&"type"in Q.id&&Q.id.type==="Identifier"&&"name"in Q.id&&Q.id.name===Z&&Q.init)return Q.init;return}function UO(O,Z){for(let $ of O.vars){if($.kind!=="const")continue;for(let Q of $.declarations)if(Q.id&&typeof Q.id==="object"&&"type"in Q.id&&Q.id.type==="Identifier"&&"name"in Q.id&&Q.id.name===Z&&Q.init)return Q.init}return}function z1(O,Z){let $=O?.returnType??"any",Q=O?.params;if(Q&&Q.length>0)return`(${Q.map((Y)=>`${Y.name}${Y.optional?"?":""}: ${Y.type}`).join(", ")}) => ${$}`;if(O?.returnType)return`() => ${$}`;if(Z)return zO(Z);return"(...args: any[]) => any"}function zO(O){return`(${H1(O)}) => ${j1(O)}`}function H1(O){let Z=O.params;if(!Array.isArray(Z)||Z.length===0)return"...args: any[]";let $=[];for(let Q of Z)if(Q&&typeof Q==="object"&&"type"in Q&&Q.type==="Identifier"&&"name"in Q&&typeof Q.name==="string")$.push(`${Q.name}: any`);else return"...args: any[]";return $.join(", ")}function j1(O){if(O.async||O.generator)return"any";let Z=O.body,$;if(Z&&typeof Z==="object"&&"type"in Z&&Z.type==="BlockStatement"){if($=J1(Z),$.length===0)return"any"}else $=[Z];let Q=null;for(let W of $){let Y=M1(W);if(!Y)return"any";if(Q===null)Q=Y;else if(Q!==Y)return"any"}return Q??"any"}function J1(O){let Z=[];return K0(O,{enter($){if($.type==="FunctionDeclaration"||$.type==="FunctionExpression"||$.type==="ArrowFunctionExpression"){this.skip();return}if($.type==="ReturnStatement")Z.push($.argument??null)}}),Z}function M1(O){if(!O||typeof O!=="object"||!("type"in O))return null;switch(O.type){case"Literal":{let Z=O.value;if(typeof Z==="string")return"string";if(typeof Z==="number")return"number";if(typeof Z==="boolean")return"boolean";return null}case"TemplateLiteral":return"string";case"CallExpression":{let Z=O.callee;if(Z&&typeof Z==="object"&&"type"in Z&&Z.type==="Identifier"){let $=Z.name;if($==="String")return"string";if($==="Number")return"number";if($==="Boolean")return"boolean"}return null}default:return null}}function HO(O){if($0(O,"$bindable"))return{init:O.arguments[0],bindable:!0};return{init:O,bindable:!1}}function B1(O,Z){let $=Z.params;if(!Array.isArray($)||$.length===0)return"";let Q=$[0],W=$[$.length-1];if(typeof Q.start!=="number"||typeof W.end!=="number")return"";return y(O,Q.start,W.end)??""}function KO(O,Z){if(Z.generator)return;let $=Z.body;if(!$||typeof $!=="object"||!("type"in $))return;let Q=B1(O,Z),W=Z.async?"async ":"",Y=(K,q)=>K&&typeof K==="object"&&("type"in K)&&K.type==="ObjectExpression"?`(${q})`:q;if($.type!=="BlockStatement"){let K=C0(O,$);return K===void 0?void 0:`${W}(${Q}) => ${Y($,K)}`}let X=$.body;if(X.length===0)return`${W}(${Q}) => {}`;if(X.length===1){let K=X[0];if(K&&typeof K==="object"&&"type"in K&&K.type==="ReturnStatement"){let q=K.argument;if(q){let z=C0(O,q);if(z!==void 0)return`${W}(${Q}) => ${Y(q,z)}`}}}return}function qO(O,Z,$){let Q=C0(Z,$);if(!Q||!$||typeof $!=="object"||!("type"in $))return;let W="expression";if($.type==="Literal"||$.type==="UnaryExpression")W="literal";else if($.type==="TemplateLiteral")W=$.expressions.length===0?"literal":"expression";else if($.type==="ArrayExpression")W="array";else if($.type==="ObjectExpression")W="object";else if($.type==="ArrowFunctionExpression"||$.type==="FunctionExpression"||$.type==="FunctionDeclaration")W="function";let Y={raw:Q,kind:W};if(W==="literal"||W==="array"||W==="object"){let X=g0(O,$);if(X.ok)Y.value=X.value}return Y}function g0(O,Z){if(!Z||typeof Z!=="object"||!("type"in Z))return{ok:!1};if(Z.type==="Literal"){let $=Z.value;return typeof $==="bigint"?{ok:!1}:{ok:!0,value:$}}if(Z.type==="UnaryExpression"){let $=Z,Q=$.argument;if(!Q||typeof Q!=="object"||!("type"in Q)||Q.type!=="Literal")return{ok:!1};let W=Q.value;if(typeof W==="number"){if($.operator==="-")return{ok:!0,value:-W};if($.operator==="+")return{ok:!0,value:W}}if(typeof W==="boolean"&&$.operator==="!")return{ok:!0,value:!W};return{ok:!1}}if(Z.type==="TemplateLiteral"){let $=Z;if($.expressions.length>0||$.quasis.length!==1)return{ok:!1};return{ok:!0,value:$.quasis[0].value.cooked??$.quasis[0].value.raw}}if(Z.type==="ArrayExpression"){let $=Z,Q=[];for(let W of $.elements){if(!W)return{ok:!1};let Y=g0(O,W);if(!Y.ok)return{ok:!1};Q.push(Y.value)}return{ok:!0,value:Q}}if(Z.type==="ObjectExpression"){let $=Z,Q={};for(let W of $.properties){if(W.type!=="Property"||W.computed)return{ok:!1};let Y=O.getPropertyName(W.key);if(!Y)return{ok:!1};let X=g0(O,W.value);if(!X.ok)return{ok:!1};Q[Y]=X.value}return{ok:!0,value:Q}}return{ok:!1}}var V1=/[-_.:/\s]+/;function y0(O){return`${O.split(V1).map((Q)=>Q.charAt(0).toUpperCase()+Q.slice(1)).join("")}Context`}function L1(O,Z,$,Q){if(!$||typeof $!=="object"||!("type"in $))return null;if($.type==="ObjectExpression"){let W=[];if(!P0($))return null;let Y=$;for(let X of Y.properties){if(X.type!=="Property")continue;let K=Z.getPropertyName(X.key);if(!K)continue;let q="any",z;if(Q0(X.value)){let U=X.value.name,J=Z.findVariableTypeAndDescription(U);if(J)q=J.type,z=J.description;else q0(O,"context-any-type",K,`Context "${Q}" property "${K}" has no type annotation; defaulted to "any".`,v(O,X))}else if(X.value&&typeof X.value==="object"&&"type"in X.value&&(X.value.type==="ArrowFunctionExpression"||X.value.type==="FunctionExpression"))q=`(${X.value.params?.map((V)=>{if(Q0(V))return`${V.name||"arg"}: any`;return"arg: any"}).join(", ")||""}) => any`;else if(H0(X.value))q=X.value.value==null?"null":typeof X.value.value;W.push({name:K,type:q,description:z,optional:!1})}return{key:Q,typeName:y0(Q),properties:W,description:void 0}}else if(Q0($)){let W=$.name,Y=Z.findVariableTypeAndDescription(W);if(Y)return{key:Q,typeName:y0(Q),properties:[{name:W,type:Y.type,description:Y.description,optional:!1}]};return q0(O,"context-any-type",W,`Context "${Q}" variable "${W}" has no type annotation; defaulted to "any".`,v(O,$)),{key:Q,typeName:y0(Q),properties:[{name:W,type:"any",description:void 0,optional:!1}]}}return null}function jO(O){let Z=O.callee;if(!Z||typeof Z!=="object"||!("type"in Z))return null;let $=Z.type==="Identifier"&&Z.name==="Symbol",Q=Z.type==="MemberExpression"&&!Z.computed&&Z.object.type==="Identifier"&&Z.object.name==="Symbol"&&Z.property.type==="Identifier"&&Z.property.name==="for";if(!$&&!Q)return null;let W=O.arguments[0];if(!W||typeof W!=="object"||!("type"in W))return"";if(W.type==="Literal"&&typeof W.value==="string")return W.value;if(W.type==="TemplateLiteral"&&W.quasis?.length===1)return W.quasis[0].value.cooked??"";return""}function JO(O,Z,$=0){if(!Z||typeof Z!=="object"||!("type"in Z))return null;let Q=Z;if(Q.type==="Literal")return typeof Q.value==="string"?Q.value:Q.value==null?null:String(Q.value);if(Q.type==="TemplateLiteral"){if(Q.quasis?.length===1){let W=Q.quasis[0].value.cooked;return W==null?null:W}return null}if(Q.type==="CallExpression"||Q.type==="NewExpression")return jO(Q);if(Q.type==="Identifier"){if($>=5)return null;let W=UO(O,Q.name);if(W&&typeof W==="object"&&"type"in W){let Y=W;if((Y.type==="CallExpression"||Y.type==="NewExpression")&&jO(Y)==="")return Q.name;return JO(O,Y,$+1)}return null}return null}function MO(O,Z,$,Q){if(!$||typeof $!=="object"||!("type"in $)||$.type!=="CallExpression")return;let W=$,Y=W.arguments[0];if(!Y)return;let X=JO(O,Y);if(!X){let z=O.componentFilePath?` in ${O.componentFilePath}`:"";console.warn(`Warning: Could not resolve setContext key${z}. Use a string literal, const-bound string, or Symbol(). Skipping context type generation.`);return}let K=W.arguments[1];if(!K)return;let q=L1(O,Z,K,X);if(q&&!O.contexts.has(X))O.contexts.set(X,q)}function u0(O){return typeof O==="string"?JSON.stringify(O):String(O)}function B0(O,{name:Z,detail:$,has_argument:Q,description:W,deprecated:Y,tags:X,source:K}){if(Z===void 0)return;let q=!Q&&!$?"null":n($),z=W,U=O.events.get(Z);if(U?.type==="forwarded")O.events.set(Z,{type:"dispatched",name:Z,detail:q,description:z||U.description,deprecated:Y??U.deprecated,tags:X??U.tags,source:K||U.source});else if(U){let J=U.tags??X;O.events.set(Z,{...U,detail:U.detail===void 0?q:U.detail,description:U.description||z,deprecated:U.deprecated??Y,tags:J,source:K||U.source})}else O.events.set(Z,{type:"dispatched",name:Z,detail:q,description:z,deprecated:Y,tags:X,source:K})}function BO(O,Z){let $=Z.arguments[0],Q=x0($,"CustomEvent");if(!Q&&!x0($,"Event"))return;let W=$.arguments[0],Y=H0(W)?W.value:void 0;if(Y==null)return;let X=Q?$.arguments[1]:void 0,K=!1,q;if(P0(X)){let z=X.properties.find((U)=>U.type==="Property"&&Q0(U.key)&&U.key.name==="detail");if(z?.type==="Property")K=!0,q=H0(z.value)?z.value.value:void 0}return B0(O,{name:String(Y),detail:q==null?"":u0(q),has_argument:K,source:v(O,Z)}),String(Y)}function m0(O,Z,$=!1){if(O.length===0)return"null";let Q=O.map(({name:W,type:Y,description:X,optional:K,default:q})=>{let z=K?"?":"",U=X||"";if(q&&U)U=`${U} @default ${q}`;else if(q)U=`@default ${q}`;if(U){if($)return`/** ${U} */
|
|
2
|
+
${W}${z}: ${Y};`;return`/** ${U} */ ${W}${z}: ${Y};`}return`${W}${z}: ${Y};`}).join($?`
|
|
3
|
+
`:" ");return $?`{
|
|
4
|
+
${Q}
|
|
5
|
+
}`:`{ ${Q} }`}var e;(function(O){O.start="/**",O.nostart="/***",O.delim="*",O.end="*/"})(e||(e={}));function l0(O){return/^\s+$/.test(O)}function VO(O){let Z=O.match(/\r+$/);return Z==null?["",O]:[O.slice(-Z[0].length),O.slice(0,-Z[0].length)]}function G0(O){let Z=O.match(/^\s+/);return Z==null?["",O]:[O.slice(0,Z[0].length),O.slice(Z[0].length)]}function LO(O){return O.split(/\n/)}function wO(O={}){return Object.assign({tag:"",name:"",type:"",optional:!1,description:"",problems:[],source:[]},O)}function d0(O={}){return Object.assign({start:"",delimiter:"",postDelimiter:"",tag:"",postTag:"",name:"",postName:"",type:"",postType:"",description:"",end:"",lineEnd:""},O)}var w1=/^@[^\s/]+(?=\s|$)/;function c0({fence:O="```"}={}){let Z=R1(O),$=(Q,W)=>Z(Q)?!W:W;return function(W){let Y=[[]],X=!1;for(let K of W){if(w1.test(K.tokens.description)&&!X)Y.push([K]);else Y[Y.length-1].push(K);X=$(K.tokens.description,X)}return Y}}function R1(O){if(typeof O==="string")return(Z)=>Z.split(O).length%2===0;return O}function i0({startLine:O=0,markers:Z=e}={}){let $=null,Q=O;return function(Y){let X=Y,K=d0();if([K.lineEnd,X]=VO(X),[K.start,X]=G0(X),$===null&&X.startsWith(Z.start)&&!X.startsWith(Z.nostart))$=[],K.delimiter=X.slice(0,Z.start.length),X=X.slice(Z.start.length),[K.postDelimiter,X]=G0(X);if($===null)return Q++,null;let q=X.trimRight().endsWith(Z.end);if(K.delimiter===""&&X.startsWith(Z.delim)&&!X.startsWith(Z.end))K.delimiter=Z.delim,X=X.slice(Z.delim.length),[K.postDelimiter,X]=G0(X);if(q){let z=X.trimRight();K.end=X.slice(z.length-Z.end.length),X=z.slice(0,-Z.end.length)}if(K.description=X,$.push({number:Q,source:Y,tokens:K}),Q++,q){let z=$.slice();return $=null,z}return null}}function s0({tokenizers:O}){return function($){var Q;let W=wO({source:$});for(let Y of O)if(W=Y(W),(Q=W.problems[W.problems.length-1])===null||Q===void 0?void 0:Q.critical)break;return W}}function h0(){return(O)=>{let{tokens:Z}=O.source[0],$=Z.description.match(/\s*(@(\S+))(\s*)/);if($===null)return O.problems.push({code:"spec:tag:prefix",message:'tag should start with "@" symbol',line:O.source[0].number,critical:!0}),O;if($[1].includes("/"))return O;return Z.tag=$[1],Z.postTag=$[3],Z.description=Z.description.slice($[0].length),O.tag=$[2],O}}function D0(O="compact"){let Z=A1(O);return($)=>{let Q=0,W=[],Y=!1,X=!0;for(let{tokens:z}of $.source.values()){let U="";if(!Y&&z.description.trim())Y=!0;else if(!Y)continue;if(X&&z.description[0]!=="{")return $;X=!1;for(let J of z.description){if(J==="{")Q++;if(J==="}")Q--;if(U+=J,Q===0)break}if(W.push([z,U]),Q===0)break}if(!Y)return $;if(Q!==0)return $.problems.push({code:"spec:type:unpaired-curlies",message:"unpaired curlies",line:$.source[0].number,critical:!0}),$;let K=[],q=W[0][0].postDelimiter.length;for(let[z,[U,J]]of W.entries()){if(U.type=J,z>0)U.type=U.postDelimiter.slice(q)+J,U.postDelimiter=U.postDelimiter.slice(0,q);[U.postType,U.description]=G0(U.description.slice(J.length)),K.push(U.type)}return K[0]=K[0].slice(1),K[K.length-1]=K[K.length-1].slice(0,-1),$.type=Z(K),$}}var I1=(O)=>O.trim();function A1(O){if(O==="compact")return(Z)=>Z.map(I1).join("");else if(O==="preserve")return(Z)=>Z.join(`
|
|
6
|
+
`);else return O}var RO=(O)=>O&&O.startsWith('"')&&O.endsWith('"');function S0(){let O=(Z,{tokens:$},Q)=>$.type===""?Z:Q;return(Z)=>{let $=Z.source.reduce(O,0),Q;if(Z.type)do{if({tokens:Q}=Z.source[$],Q.description.trim())break;$++}while(Z.source[$]);else({tokens:Q}=Z.source[$]);let W=Q.description.trimStart(),Y=W.split('"');if(Y.length>1&&Y[0]===""&&Y.length%2===1)return Z.name=Y[1],Q.name=`"${Y[1]}"`,[Q.postName,Q.description]=G0(W.slice(Q.name.length)),Z;let X=0,K="",q=!1,z;for(let J of W){if(X===0&&l0(J))break;if(J==="[")X++;if(J==="]")X--;K+=J}if(X!==0)return Z.problems.push({code:"spec:name:unpaired-brackets",message:"unpaired brackets",line:Z.source[0].number,critical:!0}),Z;let U=K;if(K[0]==="["&&K[K.length-1]==="]"){q=!0,K=K.slice(1,-1);let J=K.split("=");if(K=J[0].trim(),J[1]!==void 0)z=J.slice(1).join("=").trim();if(K==="")return Z.problems.push({code:"spec:name:empty-name",message:"empty name",line:Z.source[0].number,critical:!0}),Z;if(z==="")return Z.problems.push({code:"spec:name:empty-default",message:"empty default value",line:Z.source[0].number,critical:!0}),Z;if(!RO(z)&&/=(?!>)/.test(z))return Z.problems.push({code:"spec:name:invalid-default",message:"invalid default value syntax",line:Z.source[0].number,critical:!0}),Z}if(!q){let J=K.search(/=(?!>)/);if(J!==-1){let V=K.slice(0,J).trim(),I=K.slice(J+1).trim();if(V==="")return Z.problems.push({code:"spec:name:empty-name",message:"empty name",line:Z.source[0].number,critical:!0}),Z;if(I==="")return Z.problems.push({code:"spec:name:empty-default",message:"empty default value",line:Z.source[0].number,critical:!0}),Z;if(/^[\p{ID_Start}$_\.][\p{ID_Continue}$_\u200c\u200d\.]*=/u.test(K)){if(!RO(I)&&/=(?!>)/.test(I))return Z.problems.push({code:"spec:name:invalid-default",message:"invalid default value syntax",line:Z.source[0].number,critical:!0}),Z;K=V,z=I}}}if(Z.optional=q,Z.name=K,Q.name=U,z!==void 0)Z.default=z;return[Q.postName,Q.description]=G0(W.slice(Q.name.length)),Z}}function f0(O="compact",Z=e){let $=p0(O);return(Q)=>{return Q.description=$(Q.source,Z),Q}}function p0(O){if(O==="compact")return F1;if(O==="preserve")return h1;return O}function F1(O,Z=e){return O.map(({tokens:{description:$}})=>$.trim()).filter(($)=>$!=="").join(" ")}var C1=(O,{tokens:Z},$)=>Z.type===""?O:$,P1=({tokens:O})=>(O.delimiter===""?O.start:O.postDelimiter.slice(1))+O.description;function h1(O,Z=e){if(O.length===0)return"";if(O[0].tokens.description===""&&O[0].tokens.delimiter===Z.start)O=O.slice(1);let $=O[O.length-1];if($!==void 0&&$.tokens.description===""&&$.tokens.end.endsWith(Z.end))O=O.slice(0,-1);return O=O.slice(O.reduce(C1,0)),O.map(P1).join(`
|
|
7
|
+
`)}function o0({startLine:O=0,fence:Z="```",spacing:$="compact",markers:Q=e,tokenizers:W=[h0(),D0($),S0(),f0($)]}={}){if(O<0||O%1>0)throw Error("Invalid startLine");let Y=i0({startLine:O,markers:Q}),X=c0({fence:Z}),K=s0({tokenizers:W}),q=p0($);return function(z){let U=[];for(let J of LO(z)){let V=Y(J);if(V===null)continue;let I=X(V),k=I.slice(1).map(K);U.push({description:q(I[0],Q),tags:k,source:V,problems:k.reduce((u,m)=>u.concat(m.problems),[])})}return U}}function D1(O){return O.start+O.delimiter+O.postDelimiter+O.tag+O.postTag+O.type+O.postType+O.name+O.postName+O.description+O.end+O.lineEnd}function a0(){return(O)=>O.source.map(({tokens:Z})=>D1(Z)).join(`
|
|
8
|
+
`)}var S1={line:0,start:0,delimiter:0,postDelimiter:0,tag:0,postTag:0,name:0,postName:0,type:0,postType:0,description:0,end:0,lineEnd:0};var B3=Object.keys(S1);function V0(O,Z={}){return o0(Z)(O)}var v3=a0();var f1=null;function _1(O,Z,$){let Q={value:void 0,replace:!1};if(!$||typeof $!=="object"||!("type"in $))return Q;if($.type==="Identifier")Q.value=$.name,Q.replace=!0;else if($.type==="Literal")Q.value=String($.value);else if($.type==="MemberExpression")Q.value=F0(O,Z,$);else if(($.type==="ObjectExpression"||$.type==="TemplateLiteral")&&"start"in $&&"end"in $&&typeof $.start==="number"&&typeof $.end==="number")Q.value=y(O,$.start,$.end);return Q}function IO(O,Z,$){let Q={};for(let W of $.properties){if(W.type!=="Property"||W.computed)continue;let Y=Z.getPropertyName(W.key);if(!Y)continue;Q[Y]=_1(O,Z,W.value)}return Q}function b1(O,Z){if(!Z||typeof Z!=="object"||!("type"in Z))return null;if(Z.type==="Identifier"){let Y=Z,X=O.propLocalToPublicName.get(Y.name);if(!X)return null;return{publicName:X,trackingName:Y.name}}if(Z.type!=="MemberExpression")return null;let $=Z,Q=$.object&&typeof $.object==="object"&&"type"in $.object&&$.object.type==="Identifier"?$.object.name:void 0;if(!Q||!O.wholePropsLocals.has(Q))return null;let W;if(!$.computed&&$.property&&typeof $.property==="object"&&"type"in $.property){if($.property.type==="Identifier")W=$.property.name;else if($.property.type==="Literal"&&$.property.value!=null)W=String($.property.value)}else if($.computed&&$.property&&typeof $.property==="object"&&"type"in $.property&&$.property.type==="Literal"&&"value"in $.property&&$.property.value!=null)W=String($.property.value);if(!W)return null;return{publicName:W,trackingName:W}}function AO(O,Z){let $=Z;if($&&typeof $==="object"&&"type"in $&&$.type==="ChainExpression")$=$.expression;if(!$||typeof $!=="object"||!("type"in $)||$.type!=="CallExpression")return null;let Q=$;if(!Q.callee||typeof Q.callee!=="object"||!("type"in Q.callee))return null;let W=b1(O,Q.callee);if(!W)return null;return{...W,arguments:Q.arguments}}function L0(O,{slot_name:Z,slot_props:$,slot_fallback:Q,slot_description:W,slot_deprecated:Y,slot_tags:X,source:K}){let q=Z===void 0||Z==="",z=q?f1:Z??"",U=n(Q),J=$===void 0||$===""?void 0:$,V=W?.trim()||void 0;if(O.slots.has(z)){let I=O.slots.get(z);if(I)O.slots.set(z,{...I,default:I.default??q,fallback:U,slot_props:I.slot_props===void 0?J:I.slot_props,description:I.description||V,deprecated:I.deprecated??Y,tags:I.tags||X,source:K||I.source})}else O.slots.set(z,{name:z,default:q,fallback:U,slot_props:$,description:V,deprecated:Y,tags:X,source:K})}var E1=/\s*=\s*/;function FO(O){let Z=O.indexOf("<");if(Z===-1||!O.endsWith(">"))return O;let $=O.slice(0,Z),Q=O.slice(Z+1,-1),W=CO(Q).map((Y)=>Y.trim().replace(E1," = ")).join(", ");return`${$}<${W}>`}var t0=/^\s*$/,k1=/;$/,T1=/^-\s*/;function j0(O){if(O===void 0)return;let Z=O.replace(T1,"").trim();return Z===""?"":Z}function w0(O){if(!O||O.length===0)return;return O[0].tokens.description}var PO=new Set(["since","example"]);function hO(O){if(!O||O.length===0)return"";let Z=[];for(let $ of O){let Q=$.tokens;if((Q.end??"").trim()==="*/")break;if(Q.tag){let W=`${Q.name??""}${Q.postName??""}${Q.description??""}`.trimEnd();if(W)Z.push(W)}else Z.push(`${Q.postDelimiter??""}${Q.description??""}`)}return Z.join(`
|
|
9
|
+
`)}function N1(O){let Z=O.trim();return Z===""?!0:Z}function DO(O,Z){return N1(`${O??""}${Z?` ${Z}`:""}`)}function v1(O){let Z=O.trim().replace(k1,"").trimEnd();if(!Z.startsWith("{")||!Z.endsWith("}"))return!1;let $=0,Q=null;for(let W=0;W<Z.length;W++){let Y=Z[W];if(Q!==null){if(Y==="\\"){W++;continue}if(Y===Q)Q=null;continue}if(Y==='"'||Y==="'"||Y==="`"){Q=Y;continue}if(Y==="{"||Y==="["||Y==="(")$++;else if(Y==="}"||Y==="]"||Y===")"){if($--,$===0&&W<Z.length-1)return!1}}return $===0}function g1(O){let Z=O;if(!Z.startsWith("/*"))Z=`/*${Z}`;if(!Z.endsWith("*/"))Z+="*/";return Z}function e0(O){let Z=O[0]?.tags??[],$=new Set(["type","param","returns","return","extends","extendProps","restProps","slot","snippet","event","typedef","callback","bindable","deprecated"]),Q,W=[],Y,X,K,q=[],z=[];for(let U of Z)if(U.tag==="type")Q=U;else if(U.tag==="param")W.push(U);else if(U.tag==="returns"||U.tag==="return")Y=U;else if(U.tag==="deprecated")K??=DO(U.name,U.description);else if(PO.has(U.tag))z.push(U);else if(U.tag==="bindable"){if(U.type)continue;let J=`${U.name}${U.description?` ${U.description}`:""}`.trim();if(J==="readonly"||J==="writable")X??=J}else if(!$.has(U.tag))q.push(U);return{type:Q,param:W,returns:Y,binding:X,deprecated:K,additional:q,passthrough:z,description:O[0]?.description}}function y1(O){if(!O||O.length===0)return;let Z=O[O.length-1];return Z&&typeof Z==="object"&&"value"in Z?Z:void 0}function x1(O,Z,$){if(!Z||Z.length===0||$===void 0||!O.source)return;for(let Q=Z.length-1;Q>=0;Q--){let W=Z[Q];if(!W||typeof W!=="object"||!("value"in W)||!("end"in W))continue;if(typeof W.end!=="number")continue;let Y=O.source.slice(W.end,$);if(t0.test(Y))return W}return}function U0(O,Z,$){if(!$?.leadingComments)return;let Q=x1(O,$.leadingComments,$.start);if(!Q)return;return u1(Z,[Q])}function SO(O,Z,$){if(!$?.leadingComments)return;return U0(O,Z,$)}function u1(O,Z){if(!Z)return;let $=y1(Z);if(!$)return;let Q=V0(g1($.value),{spacing:"preserve"}),{type:W,param:Y,returns:X,binding:K,deprecated:q,additional:z,passthrough:U,description:J}=e0(Q),V,I,k,u;if(W)V=O.aliasType(W.type);if(Y.length>0)I=Y.filter((D)=>!D.name.includes(".")).map((D)=>({name:D.name,type:O.aliasType(D.type),description:j0(D.description),optional:D.optional||!1}));if(X)k=O.aliasType(X.type);let m=n(J?.trim());if(m||z.length>0){let D=[];if(m)D.push(m);for(let i of z){let t=`@${i.tag}${i.name?` ${i.name}`:""}${i.description?` ${i.description}`:""}`;D.push(t)}u=D.join(`
|
|
10
|
+
`)}let O0=U.length>0?U.map((D)=>({name:D.tag,body:hO(D.source)})):void 0;return{type:V,params:I,returnType:k,description:u,binding:K,deprecated:q,tags:O0}}function fO(O,Z,$=O.source){if(!$)return;let Q=0;for(let{tags:W,description:Y,source:X}of V0($,{spacing:"preserve"})){let K=X.map((B)=>B.source).join(`
|
|
11
|
+
`),q=$.indexOf(K,Q),z=q===-1?void 0:q;if(q!==-1)Q=q+K.length;let U,J,V,I,k,u,m=[],O0=[],D,i,t,W0=[],p,G,j=[],L,A=!1,H=!0,M=[],S,f=new Map,C=new Set,T=new Set;for(let B of W)if(B.source&&B.source.length>0)C.add(B.source[0].number);for(let B of X)if(!B.tokens.tag&&B.tokens.description&&B.tokens.description.trim()!=="}")f.set(B.number,B.tokens.description);let _=(B)=>{if(!B||B.length===0)return;let E=B[0].number,R=[],N=[],l=!1;for(let F=E-1;F>=1;F--){if(C.has(F))break;let P=f.get(F);if(P)R.unshift(P),N.unshift(F),l=!0;else if(l){let w=X.find((h)=>h.number===F);if(!(!w||!w.tokens.tag&&(!w.tokens.description||w.tokens.description.trim()==="")))break}}if(R.length===0)return;for(let F of N)T.add(F);return R.join(`
|
|
12
|
+
`).trim()},x=()=>{if(U!==void 0){let B=J&&J!=="object"&&J!=="Object"?J:void 0,E;if(B)E=B;else if(O0.length>0)E=m0(O0,U,!0);else E=J||"";if(u!==void 0){let R;for(let F of W){let P=F.source?.[0]?.number;if(typeof P!=="number")continue;if(P<=u)continue;if(F.tag==="property"||F.tag==="type")continue;R=P;break}let N=[],l=Array.from(f.keys()).sort((F,P)=>F-P);for(let F of l){if(F<=u)continue;if(R!==void 0&&F>=R)continue;if(T.has(F))continue;let w=f.get(F)?.trim();if(w)N.push(w),T.add(F)}if(N.length>0){let F=N.join(`
|
|
13
|
+
`);V=V?`${V}
|
|
14
|
+
${F}`:F}}B0(O,{name:U,detail:E,has_argument:!1,description:V,deprecated:I,tags:m.length>0?m:void 0,source:k}),O.eventDescriptions.set(U,V),O.jsDocEventNames.add(U),O.jsDocEventSources.set(U,k),O0.length=0,U=void 0,J=void 0,V=void 0,I=void 0,k=void 0,u=void 0,m=[]}},a=()=>{if(D!==void 0){let B,E;if(W0.length>0)B=m0(W0,void 0,!0),E=`type ${D} = ${B};`;else if(i)B=i,E=v1(B)?`interface ${D} ${B}`:`type ${D} = ${B};`;else B="{}",E=`type ${D} = ${B};`;O.typedefs.set(D,{type:B,name:D,description:n(t),ts:E}),W0.length=0,D=void 0,i=void 0,t=void 0}},Z0=()=>{if(p!==void 0){let R=`(${j.map(({name:l,type:F,optional:P})=>{return`${l}${P?"?":""}: ${F}`}).join(", ")}) => ${L||"void"}`,N=`type ${p} = ${R};`;O.typedefs.set(p,{type:R,name:p,description:n(G),ts:N}),j.length=0,L=void 0,p=void 0,G=void 0}},b=W.some((B)=>B.tag==="slot"||B.tag==="snippet"),r=W.some((B)=>B.tag==="extends"||B.tag==="extendProps");for(let{tag:B,type:E,name:R,description:N,optional:l,default:F,source:P}of W){let w=Z.aliasType(E),s=_(P);switch(B){case"extends":case"extendProps":if(O.extends={interface:R,import:w},H)H=!1;break;case"restProps":{let h=R?N?`${R} ${N}`:R:N,Y0=j0(h)||s;if(!Y0&&H&&!A&&Y)Y0=Y,A=!0;if(O.rest_props={type:"Element",name:w,description:Y0||void 0},H)H=!1;break}case"slot":case"snippet":{let o=j0(w0(P));if(!o&&H&&!A&&Y)o=Y,A=!0;if(!o&&M.length===0)o=s;if(H)H=!1;L0(O,{slot_name:R,slot_props:w,slot_description:o||void 0,slot_deprecated:S,slot_tags:M.length>0?[...M]:void 0,source:n0(O,X,P,z)}),M.length=0,S=void 0;break}case"event":{if(x(),U=R,J=w,u=P&&P.length>0?P[0].number:void 0,V=j0(w0(P))||s,!V&&H&&!A&&Y)V=Y,A=!0;if(k=n0(O,X,P,z),H)H=!1;break}case"type":if(U!==void 0)J=w;break;case"param":if(p!==void 0)j.push({name:R,type:w,optional:l||!1});break;case"returns":case"return":if(p!==void 0)L=w;break;case"property":{let h={name:R,type:w,description:j0(w0(P)),optional:l||!1,default:F};if(U!==void 0)O0.push(h);else if(D!==void 0)W0.push(h);break}case"typedef":{if(a(),D=FO(R),i=w,t=j0(w0(P))||s,!t&&H&&!A&&Y)t=Y,A=!0;if(H)H=!1;break}case"callback":{if(Z0(),p=FO(R),G=j0(w0(P))||s,!G&&H&&!A&&Y)G=Y,A=!0;if(H)H=!1;break}case"generics":if(O.generics=[R,w],H)H=!1;break;case"template":{let h=R;if(w)h=`${R} extends ${w}`;if(F)h+=` = ${F}`;if(b&&!r){O.deferredSlotBlockGenerics.push({name:R,constraint:h});break}if(Z.accumulateGeneric(R,h),H)H=!1;break}case"deprecated":{let h=DO(R,N);if(U===void 0)S??=h;else I??=h;break}case"enum":case"class":case"implements":case"this":case"namespace":case"memberof":case"module":case"file":case"overview":break;default:{let h={name:B,body:hO(P)};if(U!==void 0&&PO.has(B))m.push(h);else M.push(h)}break}}x(),a(),Z0()}}function m1({hasTypeScriptType:O,hasJSDocType:Z,inferredType:$,finalType:Q}){if(O)return"typescript";if(Z)return"jsdoc";if($!==void 0)return"default";if(Q!==void 0)return"inferred";return"unknown"}function R0(O){let Z=O.explicitType??O.jsdocType??O.resolvedType??O.typeSeed,$=O.jsdocParams??O.resolvedParams,Q=O.jsdocReturnType??O.resolvedReturnType;if(O.isFunctionDeclaration&&Z==="() => any"&&Q)Z=$&&$.length>0?`(${$.map((K)=>`${K.name}${K.optional?"?":""}: ${K.type}`).join(", ")}) => ${Q}`:`() => ${Q}`;let W=O.jsdocDescription??O.resolvedDescription;if(W===void 0&&Z!==void 0)W=O.typedefs?.get(Z)?.description;let Y=m1({hasTypeScriptType:O.explicitType!==void 0,hasJSDocType:O.jsdocType!==void 0||O.jsdocParams!==void 0||O.jsdocReturnType!==void 0||O.resolvedType!==void 0,inferredType:O.inferredTypeForSource,finalType:Z}),X=O.initializerIsFunction||O.isFunctionDeclaration||O.inferIsFunctionFromTypeSignature===!0&&(!!O.jsdocParams?.length||O.jsdocReturnType!==void 0||!!O.jsdocType?.includes("=>")||!!O.resolvedType?.includes("=>")||!!O.explicitType?.includes("=>"));return{type:Z,typeSource:Y,description:W,params:$,returnType:Q,isFunction:X}}function l1(O){if(!O||typeof O!=="object"||!("type"in O))return;let Z=String(O.type);if(Z!=="InlineComponent"&&Z!=="Element")return;let $="name"in O&&typeof O.name==="string"?O.name:void 0;if(!$)return;let Q=Z==="InlineComponent"?{type:"InlineComponent",name:$}:{type:"Element",name:$};if(Z==="Element"&&$==="svelte:element"&&"tag"in O&&typeof O.tag==="string")Q.thisValue=O.tag;return Q}function _O(O,Z){if(O.rest_props!==void 0)return;let $=l1(Z);if($)O.rest_props=$}function d(O,Z,$){if(!Z||O.has(Z))return;O.set(Z,$)}function _0(O,Z){for(let $=O.activeScopes.length-1;$>=0;$-=1){let Q=O.activeScopes[$]?.get(Z);if(!Q)continue;return Q.kind==="prop"?Q.publicPropName:void 0}return}function g(O,Z=new Set){if(!O||typeof O!=="object"||!("type"in O))return Z;switch(O.type){case"Identifier":Z.add(O.name);break;case"AssignmentPattern":g(O.left,Z);break;case"ArrayPattern":for(let $ of O.elements)g($??void 0,Z);break;case"ObjectPattern":for(let $ of O.properties)if($.type==="Property")g($.value,Z);else if($.type==="RestElement")g($.argument,Z);break;case"RestElement":g(O.argument,Z);break}return Z}function ZO(O,Z){let $=g(Z);if(!$)return;for(let Q of $){let W=_0(O,Q);if(W)O.reactive_vars.add(W)}}function b0(O){if(!O||typeof O!=="object"||!("type"in O))return!1;switch(String(O.type)){case"BlockStatement":case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"CatchClause":case"EachBlock":case"ThenBlock":case"CatchBlock":return!0;default:return!1}}function EO(O){if(!O||typeof O!=="object"||!("type"in O))return!1;let Z=String(O.type);return Z==="FunctionDeclaration"||Z==="FunctionExpression"||Z==="ArrowFunctionExpression"}function d1(O,Z){let $=O.scopeDeclarations.get(Z);if(!$)$=new Map,O.scopeDeclarations.set(Z,$);return $}function c1(O,Z,$){let Q=[];if($.id.type==="Identifier")return Q.push({kind:"local",name:$.id.name}),Q;if($.id.type!=="ObjectPattern")return Q;for(let W of $.id.properties){if(W.type==="RestElement"){if(W.argument.type==="Identifier")Q.push({kind:"local",name:W.argument.name});continue}if(W.computed)continue;let Y=O.getPropertyName(W.key);if(!Y)continue;let X;if(W.value.type==="Identifier")X=W.value.name;else if(W.value.type==="AssignmentPattern"&&W.value.left.type==="Identifier")X=W.value.left.name;if(!X)continue;Q.push({kind:"prop",name:X,publicPropName:Y})}return Q}function OO(O,Z,$,Q,W){if(!bO(Z))return;let Y=W?.allowRunesProps??!1,X=W?.forceProp??!1,K=Z;for(let q of K.declarations){if(Y&&$0(J0(q.init),"$props")){for(let J of c1(O,K,q))d(J.kind==="prop"?$:Q,J.name,J.kind==="prop"?{kind:"prop",publicPropName:J.publicPropName}:{kind:"local"});continue}let z=K.kind==="var"?Q:$,U=X?"prop":"local";for(let J of g(q.id))d(z,J,U==="prop"?{kind:"prop",publicPropName:J}:{kind:"local"})}}function i1(O,Z){if("id"in O&&O.id&&typeof O.id==="object"&&"name"in O.id&&typeof O.id.name==="string")d(Z,O.id.name,{kind:"local"});for(let $ of O.params)for(let Q of g($))d(Z,Q,{kind:"local"})}function s1(O,Z,$,Q){if(!Array.isArray(Z))return;for(let W of Z){if(!W||typeof W!=="object"||!("type"in W))continue;switch(W.type){case"VariableDeclaration":OO(O,W,$,Q);break;case"FunctionDeclaration":if(W.id?.name)d($,W.id.name,{kind:"local"});break;case"ClassDeclaration":if(W.id?.name)d($,W.id.name,{kind:"local"});break}}}function p1(O,Z,$){if(!$||typeof $!=="object")return;let Q="content"in $&&$.content&&typeof $.content==="object"&&"body"in $.content&&Array.isArray($.content.body)?$.content:("body"in $)&&Array.isArray($.body)?$:void 0;if(!Q||!("body"in Q)||!Array.isArray(Q.body))return;for(let W of Q.body){if(!W||typeof W!=="object"||!("type"in W))continue;switch(W.type){case"ImportDeclaration":for(let Y of W.specifiers??[])if(Y.local?.name)d(Z.componentScope,Y.local.name,{kind:"local"});break;case"VariableDeclaration":OO(O,W,Z.componentScope,Z.componentScope,{allowRunesProps:!0});break;case"FunctionDeclaration":if(W.id?.name)d(Z.componentScope,W.id.name,{kind:"local"});break;case"ClassDeclaration":if(W.id?.name)d(Z.componentScope,W.id.name,{kind:"local"});break;case"ExportNamedDeclaration":if(!W.declaration||typeof W.declaration!=="object"||!("type"in W.declaration))break;if(W.declaration.type==="VariableDeclaration")OO(O,W.declaration,Z.componentScope,Z.componentScope,{forceProp:!0});else if(W.declaration.type==="FunctionDeclaration"&&W.declaration.id?.name)d(Z.componentScope,W.declaration.id.name,{kind:"prop",publicPropName:W.declaration.id.name});break}}}function kO(O,Z){Z.componentScope.clear(),Z.scopeDeclarations=new WeakMap,Z.activeScopes.length=0,p1(O,Z,Z.parsed?.instance)}function TO(O){return{varScopeStack:[O.componentScope]}}function NO(O,Z,$,Q){if(!b0(Q))return;let W=d1(Z,Q),Y=$.varScopeStack[$.varScopeStack.length-1]??Z.componentScope;switch(String(Q.type)){case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":i1(Q,W);break;case"BlockStatement":s1(O,Q.body,W,Y);break;case"CatchClause":if("param"in Q)for(let K of g(Q.param))d(W,K,{kind:"local"});break;case"EachBlock":{let K=Q;for(let q of g(K.context))d(W,q,{kind:"local"});if(typeof K.index==="string")d(W,K.index,{kind:"local"});else if(K.index&&"name"in K.index)d(W,K.index.name,{kind:"local"});break}case"ThenBlock":if("value"in Q)for(let K of g(Q.value))d(W,K,{kind:"local"});break;case"CatchBlock":if("error"in Q)for(let K of g(Q.error))d(W,K,{kind:"local"});break}if(EO(Q))$.varScopeStack.push(W)}function vO(O,Z){if(EO(Z))O.varScopeStack.pop()}var o1=new Set(["$state","$derived","$effect","$props","$bindable","$inspect","$host"]);function a1(O,Z){switch(Z?.type){case"MemberExpression":return Z.computed||O===Z.object;case"MethodDefinition":return!!Z.computed;case"MetaProperty":return O===Z.meta;case"PropertyDefinition":return Z.computed||O===Z.value;case"Property":return Z.computed||O===Z.value;case"ExportSpecifier":case"ImportSpecifier":return O===Z.local;case"LabeledStatement":case"BreakStatement":case"ContinueStatement":return!1;default:return!0}}function r1(O,Z){for(let $=Z.length-1;$>=0;$-=1)if(Z[$]?.has(O))return!0;return!1}function n1(O){let Z=new Set;if(!O||typeof O!=="object"||!("type"in O))return Z;switch(String(O.type)){case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":{let $=O;if($.id?.name)Z.add($.id.name);for(let Q of $.params??[])g(Q,Z);break}case"BlockStatement":E0(O.body,Z);break;case"CatchClause":g(O.param,Z);break;case"EachBlock":{let $=O;if(g($.context,Z),typeof $.index==="string")Z.add($.index);else if($.index?.name)Z.add($.index.name);break}case"ThenBlock":g(O.value,Z);break;case"CatchBlock":g(O.error,Z);break}return Z}function E0(O,Z){if(!Array.isArray(O))return;for(let $ of O){if(!$||typeof $!=="object"||!("type"in $))continue;switch(String($.type)){case"ImportDeclaration":for(let Q of $.specifiers??[])if(Q.local?.name)Z.add(Q.local.name);break;case"VariableDeclaration":for(let Q of $.declarations??[])g(Q.id,Z);break;case"FunctionDeclaration":case"ClassDeclaration":{let Q=$.id?.name;if(Q)Z.add(Q);break}case"ExportNamedDeclaration":{let Q=$.declaration;if(Q&&typeof Q==="object"&&"type"in Q)E0([Q],Z);break}}}}function $O(O,Z){if(!O||typeof O!=="object")return!1;let $=[...Z],Q=!1;return K0(O,{enter(W,Y){if(Q){this.skip();return}if(b0(W))$.push(n1(W));if(Y&&W.type==="Identifier"&&o1.has(W.name)&&!Y.type.startsWith("TS")&&a1(W,Y)&&!r1(W.name,$))Q=!0,this.skip()},leave(W){if(b0(W))$.pop()}}),Q}function gO(O){if(!O||typeof O!=="object")return;if("content"in O){let Z=O.content,$=Z&&typeof Z==="object"&&"body"in Z?Z.body:void 0;if(Array.isArray($))return $}if("body"in O&&Array.isArray(O.body))return O.body;return}function yO(O){if(O.runesOptionOverride!==void 0)return O.runesOptionOverride?"runes":"legacy";let Z=O.parsed;if(!Z)return"legacy";let $=new Set;E0(gO(Z.module),$);let Q=new Set;return E0(gO(Z.instance),Q),$O(Z.module,[$])||$O(Z.instance,[$,Q])||$O(Z.html,[$,Q])?"runes":"legacy"}var t1=/[A-Za-z_$][\w$]*/g;function e1(O,Z,$){let Q=new Map,W=Z.typeParameters?.params,Y=$.typeArguments?.params;if(!W?.length||!Y?.length)return Q;for(let X=0;X<W.length;X++){let K=W[X]?.name,q=Y[X];if(!K||q?.start===void 0||q?.end===void 0)continue;let z=y(O,q.start,q.end)?.trim();if(z)Q.set(K,z)}return Q}function O2(O,Z){if(Z.size===0)return O;return O.replace(t1,($)=>Z.get($)??$)}function I0(O,Z,$,Q,W=new Set){let Y=new Map;if(!$?.type)return Y;let X=(K)=>{for(let q of K){if(q?.type!=="TSPropertySignature"||q.computed)continue;if(!q.key)continue;let z=O.getPropertyName(q.key);if(!z)continue;let U=q.typeAnnotation?.start,J=q.typeAnnotation?.end;if(U===void 0||J===void 0)continue;let V=y(Z,U+1,J)?.trim();if(!V)continue;Y.set(z,{type:V,optional:q.optional===!0,source:v(Z,q)})}};switch($.type){case"TSTypeLiteral":X($.members??[]);break;case"TSInterfaceDeclaration":X($.body?.body??[]);break;case"TSTypeAliasDeclaration":{let K=I0(O,Z,$.typeAnnotation,Q,W);for(let[q,z]of K)Y.set(q,z);break}case"TSTypeReference":{let K=lO($.typeName);if(!K||W.has(K))break;let q=Q.get(K);if(!q)break;W.add(K);let z=I0(O,Z,q,Q,W);W.delete(K);let U=e1(Z,q,$);for(let[J,V]of z)Y.set(J,U.size===0?V:{...V,type:O2(V.type,U)});break}case"TSIntersectionType":for(let K of $.types??[]){let q=I0(O,Z,K,Q,W);for(let[z,U]of q)Y.set(z,U)}break;case"TSParenthesizedType":{let K=I0(O,Z,$.typeAnnotation,Q,W);for(let[q,z]of K)Y.set(q,z);break}}return Y}function sO(O,Z,$){if(Z.runesPropsDeclarationMetadataByDeclaratorStart.clear(),Z.explicitPropTypesByName.clear(),Z.explicitVariableTypesByName.clear(),Z.typeImportBindingsByLocalName.clear(),Z.localTypeDeclarationsByName.clear(),Z.typedRunesPropsDeclarations.length=0,!Z.source)return;let Q=$;Z.scriptLanguage=O.resolveScriptLanguage(Q),Z.customElementTag=Q.options?.customElement?.tag,Z.runesOptionOverride=Q.options?.runes,Z.scriptGenericsAttribute=O.resolveScriptGenericsAttribute(Q);let W=Q.instance?.content?.body??[];for(let Y of W){if(!Y?.type)continue;if(Y.type==="ImportDeclaration"&&Y.source?.value)for(let X of Y.specifiers??[]){let K=X.local?.name;if(!K)continue;if(!(Y.importKind==="type"||X.importKind==="type"))continue;let z,U;if(X.type==="ImportSpecifier")z="named",U=X.imported?.type==="Identifier"?X.imported.name:typeof X.imported?.value==="string"?X.imported.value:void 0;else if(X.type==="ImportDefaultSpecifier")z="default";else if(X.type==="ImportNamespaceSpecifier")z="namespace";if(!z)continue;Z.typeImportBindingsByLocalName.set(K,{importedName:U,localName:K,source:String(Y.source.value),specifierType:z})}if((Y.type==="TSInterfaceDeclaration"||Y.type==="TSTypeAliasDeclaration")&&Y.id?.name&&Y.start!==void 0&&Y.end!==void 0)Z.localTypeDeclarationsByName.set(Y.id.name,{code:y(Z,Y.start,Y.end)?.trim()??"",node:Y,start:Y.start});if(Y.type==="ExportNamedDeclaration"&&Y.declaration?.type==="VariableDeclaration")for(let X of Y.declaration.declarations??[]){if(X.id?.type!=="Identifier"||!X.id.name)continue;let K=k0(Z,X.id.typeAnnotation);if(K)Z.explicitPropTypesByName.set(X.id.name,K)}else if(Y.type==="VariableDeclaration")for(let X of Y.declarations??[]){if(X.id?.type!=="Identifier"||!X.id.name)continue;let K=k0(Z,X.id.typeAnnotation);if(K)Z.explicitVariableTypesByName.set(X.id.name,K)}}for(let Y of W){if(!Y||typeof Y!=="object"||!("declarations"in Y))continue;for(let X of Y.declarations??[]){if(!$0(J0(X.init),"$props"))continue;let K=X.id?.typeAnnotation?void 0:xO(X.init),q=X.id?.typeAnnotation?.typeAnnotation??K,z=X.id?.typeAnnotation?k0(Z,X.id.typeAnnotation):dO(Z,K),U=I0(O,Z,q,new Map(Array.from(Z.localTypeDeclarationsByName.entries(),([I,k])=>[I,k.node]))),J=new Set,V=new Set;if(cO(Z,q,J,V),iO(Z,J,V),X.start!==void 0){let I={canonicalType:z,props:U,referencedImportedTypes:J,referencedLocalTypes:V};if(Z.runesPropsDeclarationMetadataByDeclaratorStart.set(X.start,I),z)Z.typedRunesPropsDeclarations.push(I)}}}}function pO(O,Z,$){for(let Q of $.declarations){if(!$0(J0(Q.init),"$props"))continue;if(Q.id.type==="Identifier"){Z.wholePropsLocals.add(Q.id.name),Z.restPropLocals.add(Q.id.name);let X=uO(Z,Q.start);if(X)for(let[K,q]of X.props)M0(O,Z,K,{name:K,kind:"let",type:q.type,typeSource:"typescript",isFunction:!1,isFunctionDeclaration:!1,isRequired:!q.optional,constant:!1,reactive:!1,source:q.source});continue}if(Q.id.type!=="ObjectPattern")continue;let W=U0(Z,O,$),Y=Q.id.properties.filter((X)=>{if(X.type!=="Property"||X.computed)return!1;if(!O.getPropertyName(X.key))return!1;if(X.value.type==="Identifier")return!0;return X.value.type==="AssignmentPattern"&&X.value.left.type==="Identifier"}).length;for(let X of Q.id.properties){if(X.type==="RestElement"){if(X.argument.type==="Identifier")Z.restPropLocals.add(X.argument.name);continue}let K=O.getPropertyName(X.key);if(!K)continue;let q,z;if(X.value.type==="Identifier")q=X.value.name;else{let A=X.value;q=A.left.name,z=A.right}if(!q)continue;if(O.trackPropLocalName(K,q),K==="children")Z.snippetPropLocals.add(q);let U=SO(Z,O,X)??(Y===1?W:void 0),J=mO(Z,Q.start,K),{init:V,bindable:I}=HO(z),k=V==null?{isFunction:!1}:z0(O,Z,V),{value:u,type:m,isFunction:O0,defaultValue:D}=k,i=J?.type===void 0&&U?.type===void 0?k.resolvedType:void 0,{type:t,typeSource:W0,description:p,params:G,returnType:j,isFunction:L}=R0({explicitType:J?.type,typeSeed:m,inferredTypeForSource:m,jsdocType:U?.type,jsdocDescription:U?.description,jsdocParams:U?.params,jsdocReturnType:U?.returnType,resolvedType:i,resolvedDescription:k.resolvedDescription,resolvedParams:k.resolvedParams,resolvedReturnType:k.resolvedReturnType,initializerIsFunction:O0,isFunctionDeclaration:!1,inferIsFunctionFromTypeSignature:!0});if(I)Z.reactive_vars.add(K);M0(O,Z,K,{name:K,...q===K?{}:{localName:q},kind:"let",description:p,binding:U?.binding,deprecated:U?.deprecated,tags:U?.tags,...I?{bindable:!0}:{},type:t,typeSource:W0,value:u,defaultValue:D,params:G,returnType:j,isFunction:L,isFunctionDeclaration:!1,isRequired:V==null&&J?.optional!==!0,constant:!1,reactive:I,source:v(Z,X)})}}}function oO(O,Z){if(O.syntaxMode!=="runes")return;for(let[$,Q]of Array.from(O.events.entries())){if(Q.type!=="dispatched")continue;if(Z.has($)||O.forwardedEvents.has($))continue;let W=`on${$}`,Y=O.props.get(W);if(!Y)continue;let X=Y.type!==void 0||Y.params!==void 0||Y.returnType!==void 0,K=Q.detail===void 0||Q.detail==="undefined"||Q.detail==="null"?"() => void":`(detail: ${Q.detail}) => void`;O.props.set(W,{...Y,description:Y.description??Q.description,type:X?Y.type:K,typeSource:X?Y.typeSource:"inferred",isFunction:!0}),O.events.delete($)}}var aO=new Set(["TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion","TSInstantiationExpression"]);function T0(O){if(!O||typeof O!=="object")return;K0(O,{enter(Z){if(!aO.has(Z.type))return;let $=Z.expression;while($&&aO.has($.type))$=$.expression;if($)this.replace($)}})}function nO(O,Z,$){let Q=Z+1;while(Q<O.length){if(O[Q]==="\\"){Q+=2;continue}if(O[Q]===$)return Q+1;Q++}return Q}function tO(O,Z){let $=Z+1,Q=0;while($<O.length){let W=O[$];if(W==="\\"){$+=2;continue}if(Q===0){if(W==="`")return $+1;if(W==="$"&&O[$+1]==="{"){Q=1,$+=2;continue}$++;continue}if(W==="{")Q++;else if(W==="}")Q--;else if(W==='"'||W==="'"){$=nO(O,$,W);continue}else if(W==="`"){$=tO(O,$);continue}$++}return $}function Z2(O,Z){let $=[],Q=O.length,W=0;while(W<Q){let Y=O[W];if(Y==='"'||Y==="'"){W=nO(O,W,Y);continue}if(Y==="`"){W=tO(O,W);continue}if(Y==="/"&&O[W+1]==="/"){let X=W+2;while(X<Q&&O[X]!==`
|
|
15
|
+
`)X++;W=X;continue}if(Y==="/"&&O[W+1]==="*"){let X=W,K=W+2;while(K<Q&&!(O[K]==="*"&&O[K+1]==="/"))K++;let q=Math.min(K+2,Q),z=O.slice(X,q);$.push({end:q+Z,isJsDoc:z.startsWith("/**")&&z.length>4,text:z}),W=q;continue}W++}return $}function rO(O,Z,$){if(!O||typeof O!=="object"||!("type"in O))return;let Q=O;if(Q.type==="FunctionDeclaration"){if(Q.id?.type==="Identifier"&&Q.id.name)$.push({name:Q.id.name,start:Z});return}if(Q.type==="VariableDeclaration"){for(let W of Q.declarations??[])if(W?.id?.type==="Identifier"&&W.id.name)$.push({name:W.id.name,start:Z})}}function $2(O){let Z=[];for(let $ of O){if(!$||typeof $!=="object"||!("type"in $))continue;let Q=$;if(Q.start===void 0)continue;if(Q.type==="ExportNamedDeclaration"&&Q.declaration)rO(Q.declaration,Q.start,Z);else rO(Q,Q.start,Z)}return Z}function Q2(O,Z,$){let Q;for(let W of O){if(W.end>Z)break;if(!W.isJsDoc)continue;if(!t0.test($.slice(W.end,Z)))continue;Q=W}return Q}function eO(O,Z){let $=new Map;if(!O.source)return $;let Q=[O.parsed?.module,O.parsed?.instance],W=[],Y=[];for(let X of Q){let K=X?.content;if(!K?.body||K.start===void 0||K.end===void 0)continue;W.push(...Z2(O.source.slice(K.start,K.end),K.start)),Y.push(...$2(K.body))}W.sort((X,K)=>X.end-K.end);for(let X of Y){let K=Q2(W,X.start,O.source);if(!K)continue;let q=V0(K.text,{spacing:"preserve"}),{type:z,description:U}=e0(q);if(!z)continue;$.set(X.name,{type:Z.aliasType(z.type),description:U||z.description})}return $}function O1(O){if(O==="var")return"let";if(O==="using"||O==="await using")return"const";return O}var W2=null,Z1=/^@component/,Y2=/\r/g,X2=/^\{\s*\}$/;class c{ctx=v0();static mapToArray(O){return Array.from(O,([Z,$])=>$)}static getStaticAttributeValue(O){if(!Array.isArray(O.value))return;return O.value.map((Z)=>Z.data??Z.raw??"").join("").trim()}resolveScriptLanguage(O){let Z=[O.instance,O.module].filter((Q)=>Q!==void 0),$=!1;for(let Q of Z){let W=Q.attributes?.find((X)=>X.name==="lang");if(!W){$=!0;continue}if(c.getStaticAttributeValue(W)?.toLowerCase()==="ts")return"ts"}return $?"js":void 0}resolveScriptGenericsAttribute(O){let Z=O.instance?.attributes?.find((X)=>X.name==="generics");if(!Z)return;let $=v(this.ctx,Z),Q=O.instance?.attributes?.find((X)=>X.name==="lang");if((Q?c.getStaticAttributeValue(Q)?.toLowerCase():void 0)!=="ts"){q0(this.ctx,"syntax-skipped","generics",'<script generics="..."> requires lang="ts"; the generics attribute was ignored because the script is not TypeScript.',$);return}let Y=c.getStaticAttributeValue(Z);if(!Y)return;return{value:Y,source:$}}resolvePublicPropName(O){return this.ctx.propLocalToPublicName.get(O)??O}trackPropLocalName(O,Z=O){this.ctx.propLocalToPublicName.set(Z,O)}getPropByLocalOrPublic(O){return this.ctx.props.get(this.resolvePublicPropName(O))}getPropTypeByLocalOrPublic(O){return this.getPropByLocalOrPublic(O)?.type}getExplicitPropType(O){return this.ctx.explicitPropTypesByName.get(O)}getPropertyName(O){if(!O||typeof O!=="object"||!("type"in O))return;if(Q0(O))return O.name;if(H0(O))return O.value==null?void 0:String(O.value);return}isNumericConstant(O){if(!O||typeof O!=="object"||!("type"in O))return!1;if(O.type!=="MemberExpression")return!1;let Z=O,$=Z.object&&"name"in Z.object?Z.object.name:void 0,Q=Z.property&&"name"in Z.property?Z.property.name:void 0;if(!$||!Q)return!1;if($==="Number")return["POSITIVE_INFINITY","NEGATIVE_INFINITY","MAX_VALUE","MIN_VALUE","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","EPSILON","NaN"].includes(Q);if($==="Math")return["PI","E","LN2","LN10","LOG2E","LOG10E","SQRT2","SQRT1_2"].includes(Q);return!1}resolveLocalVarJSDoc(O){for(let $ of this.ctx.vars)if($.declarations.some((W)=>W.id&&typeof W.id==="object"&&("type"in W.id)&&W.id.type==="Identifier"&&("name"in W.id)&&W.id.name===O))return U0(this.ctx,this,$);let Z=this.ctx.funcDecls.get(O);if(Z)return U0(this.ctx,this,Z);return}addModuleExport(O,Z){if(n(O)===void 0)return;if(this.ctx.moduleExports.has(O)){let $=this.ctx.moduleExports.get(O);this.ctx.moduleExports.set(O,{...$,...Z})}else this.ctx.moduleExports.set(O,Z)}aliasType(O){if(O==="*")return"any";return O.trim()}findVariableTypeAndDescription(O){let Z=this.getPropByLocalOrPublic(O);if(Z?.type)return{type:Z.type,description:Z.description};if(!this.ctx.variableInfoCacheBuilt)this.ctx.variableInfoCache=eO(this.ctx,this),this.ctx.variableInfoCacheBuilt=!0;let $=this.ctx.variableInfoCache.get(O),Q=this.ctx.explicitVariableTypesByName.get(O);if(Q)return{type:Q,description:$?.description};return $??null}accumulateGeneric(O,Z){if(this.ctx.generics)this.ctx.generics=[`${this.ctx.generics[0]}, ${O}`,`${this.ctx.generics[1]}, ${Z}`];else this.ctx.generics=[O,Z]}cleanup(){this.ctx=v0()}static SCRIPT_BLOCK_REGEX=/(<script[^>]*>)([\s\S]*?)(<\/script>)/gi;static TS_DIRECTIVE_REGEX=/\/\/\s*@ts-[^\n\r]*/g;static stripTypeScriptDirectivesFromScripts(O){return c.SCRIPT_BLOCK_REGEX.lastIndex=0,O.replace(c.SCRIPT_BLOCK_REGEX,(Z,$,Q,W)=>{c.TS_DIRECTIVE_REGEX.lastIndex=0;let Y=Q.replace(c.TS_DIRECTIVE_REGEX,"");return $+Y+W})}parseSvelteComponent(O,Z){this.cleanup(),this.ctx.componentFilePath=Z.filePath;let $=c.stripTypeScriptDirectivesFromScripts(O);this.ctx.source=$;let{modern:Q,legacy:W}=X1($);if(sO(this,this.ctx,Q),this.ctx.parsed=W,this.ctx.scriptLanguage==="ts")T0(this.ctx.parsed.module),T0(this.ctx.parsed.instance),T0(this.ctx.parsed.html);this.ctx.syntaxMode=yO(this.ctx);let Y=this.ctx.parsed.css,X=Y?.start!==void 0&&Y?.end!==void 0?$.slice(0,Y.start)+" ".repeat(Y.end-Y.start)+$.slice(Y.end):$;if(fO(this.ctx,this,X),this.ctx.parsed?.module)K0(this.ctx.parsed?.module,{enter:(G)=>{if(G.type==="ExportNamedDeclaration"){if(G.declaration==null)return;if(!G.declaration||typeof G.declaration!=="object"||!("type"in G.declaration))return;let j,L,A=!1,H,M,S,f=!1,C,T,_;if(G.declaration.type==="FunctionDeclaration"){let R=G.declaration;if(!R.id?.name)return;j=R.id.name,L="function",H=void 0,M="() => any",f=!0,A=!0}else if(G.declaration.type==="VariableDeclaration"){let R=G.declaration,N=R.declarations[0];if(!N||typeof N!=="object"||!("id"in N))return;let{id:l,init:F}=N;if(!l||typeof l!=="object"||!("name"in l))return;let P=l.name;j=P,L=O1(R.kind);let w=F==null?{isFunction:!1}:z0(this,this.ctx,F);({value:H,type:M,isFunction:f,defaultValue:C}=w),T=M,_=w,S=this.getExplicitPropType(P)}else return;let x=U0(this.ctx,this,G),{type:a,typeSource:Z0,description:b,params:r,returnType:B,isFunction:E}=R0({explicitType:S,typeSeed:M,inferredTypeForSource:T,jsdocType:x?.type,jsdocDescription:x?.description,jsdocParams:x?.params,jsdocReturnType:x?.returnType,resolvedType:_?.resolvedType,resolvedDescription:_?.resolvedDescription,resolvedParams:_?.resolvedParams,resolvedReturnType:_?.resolvedReturnType,initializerIsFunction:f,isFunctionDeclaration:A,typedefs:this.ctx.typedefs});this.addModuleExport(j,{name:j,kind:L,description:b,deprecated:x?.deprecated,tags:x?.tags,type:a,typeSource:Z0,value:H,defaultValue:C,params:r,returnType:B,isFunction:E,isFunctionDeclaration:A,isRequired:!1,constant:L==="const",reactive:!1,source:v(this.ctx,G)})}}});let K,q=new Set,z=new Set,U=[],J={type:"ComponentRoot",instance:this.ctx.parsed.instance,html:this.ctx.parsed.html};kO(this,this.ctx),this.ctx.activeScopes.push(this.ctx.componentScope);let V=TO(this.ctx);if(K0(J,{enter:(G,j,L)=>{NO(this,this.ctx,V,G);let A=this.ctx.scopeDeclarations.get(G);if(A)this.ctx.activeScopes.push(A);if(G.type==="AssignmentExpression")ZO(this.ctx,G.left);if(G.type==="UpdateExpression")ZO(this.ctx,G.argument);if(G.type==="CallExpression"){let H=G,M=H.callee&&typeof H.callee==="object"&&"name"in H.callee?H.callee.name:void 0;if(M==="createEventDispatcher"){if(j&&typeof j==="object"&&"id"in j&&j.id&&typeof j.id==="object"&&"name"in j.id)K=j.id.name}if(M==="$host"){if(j&&typeof j==="object"&&"id"in j&&j.id&&typeof j.id==="object"&&"name"in j.id)q.add(j.id.name)}if(M==="setContext")MO(this.ctx,this,G,j??void 0);if(M)U.push({name:M,arguments:H.arguments,source:v(this.ctx,H)});if($1(H.callee)&&Q0(H.callee.property)&&H.callee.property.name==="dispatchEvent"&&($0(H.callee.object,"$host")||Q0(H.callee.object)&&q.has(H.callee.object.name))){let S=BO(this.ctx,H);if(S)z.add(S)}}if(G&&typeof G==="object"&&"type"in G&&String(G.type)==="Spread"){let H=G;if(H.expression?.name==="$$restProps"||this.ctx.restPropLocals.has(H.expression?.name??""))_O(this.ctx,j)}if(G.type==="FunctionDeclaration"){let H=G;if(H.id?.name)this.ctx.funcDecls.set(H.id.name,H)}if(G.type==="VariableDeclaration"){if(this.ctx.vars.add(G),j&&typeof j==="object"&&"type"in j&&j.type==="Program"&&G.declarations.some((H)=>$0(J0(H.init),"$props")))pO(this,this.ctx,G)}if(G.type==="ExportNamedDeclaration"){if(G.declaration==null&&G.specifiers.length===0)return;let H;if(G.declaration==null&&G.specifiers[0]?.type==="ExportSpecifier"){let w=G.specifiers[0],s=w.local&&typeof w.local==="object"&&"name"in w.local?w.local.name:void 0,h=w.exported&&typeof w.exported==="object"&&"name"in w.exported?w.exported.name:void 0;if(!s||!h)return;let o;for(let Y0 of Array.from(this.ctx.vars))if(Y0.declarations.some((X0)=>X0.id&&typeof X0.id==="object"&&("type"in X0.id)&&X0.id.type==="Identifier"&&X0.id.name===s)){o=Y0;break}G.declaration=o,H=h}if(G.declaration==null)return;if(!G.declaration||typeof G.declaration!=="object"||!("type"in G.declaration))return;let M,S=!1,f,C,T,_=!1,x=!1,a,Z0,b,r;if(G.declaration.type==="FunctionDeclaration"){let w=G.declaration;if(!w.id?.name)return;H??=w.id.name,a=w.id.name,M="function",f=void 0,C="() => any",_=!0,S=!0,x=!1}else if(G.declaration.type==="VariableDeclaration"){let w=G.declaration,s=w.declarations[0];if(!s||typeof s!=="object"||!("id"in s))return;let{id:h,init:o}=s;if(h&&typeof h==="object"&&"name"in h){let X0=h.name;a=X0,H??=X0,T=this.getExplicitPropType(X0)}else return;M=O1(w.kind),x=M==="let"&&o==null;let Y0=o==null?{isFunction:!1}:z0(this,this.ctx,o);({value:f,type:C,isFunction:_,defaultValue:Z0}=Y0),b=C,r=Y0}else return;let B=U0(this.ctx,this,G),{type:E,typeSource:R,description:N,params:l,returnType:F,isFunction:P}=R0({explicitType:T,typeSeed:C,inferredTypeForSource:b,jsdocType:B?.type,jsdocDescription:B?.description,jsdocParams:B?.params,jsdocReturnType:B?.returnType,resolvedType:r?.resolvedType,resolvedDescription:r?.resolvedDescription,resolvedParams:r?.resolvedParams,resolvedReturnType:r?.resolvedReturnType,initializerIsFunction:_,isFunctionDeclaration:S,typedefs:this.ctx.typedefs});M0(this,this.ctx,H,{name:H,...a!==void 0&&a!==H?{localName:a}:{},kind:M,description:N,binding:B?.binding,deprecated:B?.deprecated,tags:B?.tags,type:E,typeSource:R,value:f,defaultValue:Z0,params:l,returnType:F,isFunction:P,isFunctionDeclaration:S,isRequired:x,constant:M==="const",reactive:this.ctx.reactive_vars.has(H),source:v(this.ctx,G)})}if(G&&typeof G==="object"&&"type"in G&&String(G.type)==="Comment"){let M=G?.data?.trim()??"";if(Z1.test(M))this.ctx.componentComment=M.replace(Z1,"").replace(Y2,""),this.ctx.componentCommentSource=v(this.ctx,G)}if(G&&typeof G==="object"&&"type"in G&&String(G.type)==="Slot"){let H=G,M=H.attributes?.find((C)=>C.name==="name")?.value?.[0]?.data,S=(H.attributes||[]).filter((C)=>C.name!=="name").reduce((C,T)=>{let _={value:void 0,replace:!1},x=T.value;if(x===void 0)return C;if(x[0]){let a=x[0],{type:Z0,expression:b,raw:r,start:B,end:E}=a;if(Z0==="Text"&&r!==void 0)_.value=JSON.stringify(r);else if(Z0==="AttributeShorthand"&&b&&typeof b==="object"&&"name"in b)_.value=b.name,_.replace=!0;if(b&&typeof b==="object"&&"type"in b){if(b.type==="Literal"&&"value"in b){let R=b.value;_.value=typeof R==="string"?JSON.stringify(R):String(R)}else if(b.type==="MemberExpression")_.value=F0(this.ctx,this,b);else if(b.type!=="Identifier"){if(B!==void 0&&E!==void 0){if(b.type==="ObjectExpression"||b.type==="TemplateLiteral")_.value=y(this.ctx,B+1,E-1)}}}}if(T.name)C[T.name]=_;return C},{}),f=H.children?.map(({start:C,end:T})=>{if(C===void 0||T===void 0)return"";return y(this.ctx,C,T)??""}).join("").trim();L0(this.ctx,{slot_name:M,slot_props:S,slot_fallback:f,source:v(this.ctx,G)})}if(G&&typeof G==="object"&&"type"in G&&String(G.type)==="RenderTag"){let H=G,M=AO(this.ctx,H.expression);if(M){let S;if(M.arguments.length===0)S={};else if(M.arguments.length===1&&typeof M.arguments[0]==="object"&&M.arguments[0]&&"type"in M.arguments[0]&&M.arguments[0].type==="ObjectExpression")S=IO(this.ctx,this,M.arguments[0]);else if(M.arguments.length===1)q0(this.ctx,"syntax-skipped",M.publicName,`{@render ${M.publicName}(...)} argument is not a plain object literal; the render call was not mapped to slot metadata.`,v(this.ctx,G));let f=M.publicName==="children"?void 0:M.publicName,C=f===void 0?W2:f;if(S!==void 0)L0(this.ctx,{slot_name:f,slot_props:S,source:v(this.ctx,G)});if(S!==void 0||this.ctx.slots.has(C))this.ctx.snippetPropLocals.add(M.trackingName)}}if(G&&typeof G==="object"&&"type"in G&&String(G.type)==="EventHandler"){let H=G;if(H.expression==null&&H.name){if(j!=null&&typeof j==="object"&&"name"in j){let M=typeof j.name==="string"?j.name:void 0,S="type"in j?String(j.type):void 0;if(M&&S){let f=S==="InlineComponent"?{type:"InlineComponent",name:M}:{type:"Element",name:M};this.ctx.forwardedEvents.set(H.name,f);let C=this.ctx.events.get(H.name),T=this.ctx.eventDescriptions.get(H.name),_=C?.deprecated;if(!C)this.ctx.events.set(H.name,{type:"forwarded",name:H.name,element:f,description:T,deprecated:_,source:v(this.ctx,G)});else if(C.type==="forwarded"&&T&&!C.description)this.ctx.events.set(H.name,{...C,description:T,deprecated:C.deprecated??_,source:C.source||v(this.ctx,G)})}}}}if(j&&typeof j==="object"&&"type"in j&&(String(j.type)==="Element"||String(j.type)==="InlineComponent")&&G&&typeof G==="object"&&"type"in G&&String(G.type)==="Binding"){let H=G;if(H.expression?.name){let M=_0(this.ctx,H.expression.name);if(M)this.ctx.reactive_vars.add(M)}if(String(j.type)==="Element"&&H.name==="this"&&H.expression?.name&&"name"in j&&typeof j.name==="string"){let M=_0(this.ctx,H.expression.name);if(!M)return;let S=j.name;if(this.ctx.bindings.has(M)){let f=this.ctx.bindings.get(M);if(f&&!f.elements.includes(S))this.ctx.bindings.set(M,{...f,elements:[...f.elements,S]})}else this.ctx.bindings.set(M,{elements:[S]})}}},leave:(G)=>{if(this.ctx.scopeDeclarations.has(G))this.ctx.activeScopes.pop();vO(V,G)}}),K!==void 0){for(let G of U)if(G.name===K){let j=G.arguments[0],L=j&&typeof j==="object"&&"value"in j?j.value:void 0,A=G.arguments[1],H=A&&typeof A==="object"&&"value"in A?A.value:void 0;if(L!=null)B0(this.ctx,{name:String(L),detail:H==null?"":u0(H),has_argument:Boolean(A),source:G.source})}}let I=new Set(z);if(K!==void 0){for(let G of U)if(G.name===K){let j=G.arguments[0],L=j&&typeof j==="object"&&"value"in j?j.value:void 0;if(L!=null)I.add(String(L))}}this.ctx.forwardedEvents.forEach((G,j)=>{let L=this.ctx.events.get(j);if(L&&L.type==="dispatched"&&!I.has(j)){let A=this.ctx.eventDescriptions.get(j),H={type:"forwarded",name:j,element:G,description:A,deprecated:L.deprecated,tags:L.tags,source:L.source};if(L.detail!==void 0&&L.detail!=="undefined")H.detail=L.detail;this.ctx.events.set(j,H)}}),oO(this.ctx,I);let k=this.ctx.syntaxMode==="runes"?new Set(Array.from(this.ctx.snippetPropLocals,(G)=>this.resolvePublicPropName(G))):new Set,u=c.mapToArray(this.ctx.props).filter((G)=>!k.has(G.name)).map((G)=>{if(this.ctx.bindings.has(G.name)){let j=this.ctx.bindings.get(G.name)?.elements.sort().map((L)=>XO(L)).join(" | ");return{...G,type:`null | ${j}`,typeSource:"inferred",reactive:G.reactive||this.ctx.reactive_vars.has(G.name)}}return{...G,reactive:G.reactive||this.ctx.reactive_vars.has(G.name)}});this.ctx.activeScopes.length=0;let m=c.mapToArray(this.ctx.slots).map((G)=>{if(!G.slot_props)return G;if(typeof G.slot_props==="string")return X2.test(G.slot_props)?{...G,slot_props:"Record<string, never>"}:G;let j=G.slot_props,L=[];for(let H of Object.keys(j)){if(j[H].replace&&j[H].value!==void 0)j[H].value=this.getPropTypeByLocalOrPublic(j[H].value);if(j[H].value===void 0)j[H].value="any";L.push(`${H}: ${j[H].value}`)}let A=L.length===0?"Record<string, never>":L.length===1?`{ ${L[0]} }`:`{
|
|
16
|
+
${L.join(`;
|
|
17
|
+
`)};
|
|
18
|
+
}`;return{...G,slot_props:A}}).sort((G,j)=>{let L=G.name??"",A=j.name??"";if(L<A)return-1;if(L>A)return 1;return 0});if(this.ctx.deferredSlotBlockGenerics.length>0){let G=[...u.map((j)=>j.type??""),...m.map((j)=>j.slot_props??"")].join(`
|
|
19
|
+
`);for(let{name:j,constraint:L}of this.ctx.deferredSlotBlockGenerics){let A=j.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(!new RegExp(`\\b${A}\\b`).test(G))continue;this.accumulateGeneric(j,L)}}if(this.ctx.scriptGenericsAttribute){if(this.ctx.generics)q0(this.ctx,"syntax-skipped","generics",'Both the "generics" script attribute and @generics/@template JSDoc tags declare component generics; the script attribute takes precedence and the JSDoc declaration was ignored.',this.ctx.scriptGenericsAttribute.source);this.ctx.generics=Y1(this.ctx.scriptGenericsAttribute.value)}let O0=c.mapToArray(this.ctx.moduleExports),D=c.mapToArray(this.ctx.events).map((G)=>{switch(G.type){case"forwarded":return{...G,element:G.element.name};case"dispatched":return G;default:return G}}).sort((G,j)=>{let L=G.name.localeCompare(j.name);if(L!==0)return L;let A=G.type.localeCompare(j.type);if(A!==0)return A;if(G.type==="forwarded"&&j.type==="forwarded"){let H=G.element.localeCompare(j.element);if(H!==0)return H}return(G.detail??"").localeCompare(j.detail??"")}),i=c.mapToArray(this.ctx.typedefs),t=c.mapToArray(this.ctx.contexts);for(let G of u)if(G.typeSource==="unknown")q0(this.ctx,"prop-unknown-type",G.name,`Prop "${G.name}" type could not be inferred; falling back to "${G.type??"any"}".`,G.source);for(let G of this.ctx.jsDocEventNames){if(I.has(G))continue;if(this.ctx.forwardedEvents.has(G))continue;if(this.ctx.props.has(`on${G}`))continue;q0(this.ctx,"event-no-source",G,`@event "${G}" has no matching dispatch or callback prop.`,this.ctx.jsDocEventSources.get(G))}let W0={source:Q1(this.ctx,0,this.ctx.source?.length),syntaxMode:this.ctx.syntaxMode,...this.ctx.scriptLanguage?{scriptLanguage:this.ctx.scriptLanguage}:{},props:u,moduleExports:O0,slots:m,events:D,typedefs:i,generics:this.ctx.generics,rest_props:this.ctx.rest_props,extends:this.ctx.extends,componentComment:this.ctx.componentComment,componentCommentSource:this.ctx.componentCommentSource,contexts:t,customElementTag:this.ctx.customElementTag,diagnostics:this.ctx.diagnosticRecords.slice()},p=W1(this.ctx);if(p)W0[QO]=p;return W0}}
|
|
20
|
+
export{c as t};
|