diff --git a/antlersls/package.json b/antlersls/package.json index 2bc541c..250aab8 100644 --- a/antlersls/package.json +++ b/antlersls/package.json @@ -1,6 +1,6 @@ { "name": "antlers-language-server", - "version": "1.0.2", + "version": "1.0.3", "description": "The Antlers language server.", "main": "server.js", "bin": { diff --git a/antlersls/server.js b/antlersls/server.js index c3cc9b8..0741963 100644 --- a/antlersls/server.js +++ b/antlersls/server.js @@ -1,40 +1,40 @@ #!/usr/bin/env node -var kC=Object.create;var fu=Object.defineProperty;var MC=Object.getOwnPropertyDescriptor;var FC=Object.getOwnPropertyNames;var VC=Object.getPrototypeOf,qC=Object.prototype.hasOwnProperty;var lg=t=>fu(t,"__esModule",{value:!0});var K=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),BC=(t,e)=>{for(var n in e)fu(t,n,{get:e[n],enumerable:!0})},ug=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of FC(e))!qC.call(t,i)&&(n||i!=="default")&&fu(t,i,{get:()=>e[i],enumerable:!(r=MC(e,i))||r.enumerable});return t},Q=(t,e)=>ug(lg(fu(t!=null?kC(VC(t)):{},"default",!e&&t&&t.__esModule?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),jC=(t=>(e,n)=>t&&t.get(e)||(n=ug(lg({}),e,1),t&&t.set(e,n),n))(typeof WeakMap!="undefined"?new WeakMap:0);var fg=K((cg,pu)=>{(function(t){if(typeof pu=="object"&&typeof pu.exports=="object"){var e=t(require,cg);e!==void 0&&(pu.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],t)})(function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function l(u,c,f,m){this._uri=u,this._languageId=c,this._version=f,this._content=m,this._lineOffsets=void 0}return Object.defineProperty(l.prototype,"uri",{get:function(){return this._uri},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"version",{get:function(){return this._version},enumerable:!0,configurable:!0}),l.prototype.getText=function(u){if(u){var c=this.offsetAt(u.start),f=this.offsetAt(u.end);return this._content.substring(c,f)}return this._content},l.prototype.update=function(u,c){for(var f=0,m=u;fu?m=d:f=d+1}var p=f-1;return{line:p,character:u-c[p]}},l.prototype.offsetAt=function(u){var c=this.getLineOffsets();if(u.line>=c.length)return this._content.length;if(u.line<0)return 0;var f=c[u.line],m=u.line+1C&&h.push(p.substring(C,S)),N.newText.length&&h.push(N.newText),C=m.offsetAt(N.range.end)}return h.push(p.substr(C)),h.join("")}l.applyEdits=f})(r=e.TextDocument||(e.TextDocument={}));function i(l,u){if(l.length<=1)return l;var c=l.length/2|0,f=l.slice(0,c),m=l.slice(c);i(f,u),i(m,u);for(var d=0,p=0,_=0;dc.line||u.line===c.line&&u.character>c.character?{start:c,end:u}:l}function a(l){var u=o(l.range);return u!==l.range?{newText:l.newText,range:u}:l}})});var du=K(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.thenable=xt.typedArray=xt.stringArray=xt.array=xt.func=xt.error=xt.number=xt.string=xt.boolean=void 0;function UC(t){return t===!0||t===!1}xt.boolean=UC;function pg(t){return typeof t=="string"||t instanceof String}xt.string=pg;function GC(t){return typeof t=="number"||t instanceof Number}xt.number=GC;function WC(t){return t instanceof Error}xt.error=WC;function dg(t){return typeof t=="function"}xt.func=dg;function mg(t){return Array.isArray(t)}xt.array=mg;function HC(t){return mg(t)&&t.every(e=>pg(e))}xt.stringArray=HC;function YC(t,e){return Array.isArray(t)&&t.every(e)}xt.typedArray=YC;function KC(t){return t&&dg(t.then)}xt.thenable=KC});var Ii=K($f=>{"use strict";Object.defineProperty($f,"__esModule",{value:!0});var Yf;function Kf(){if(Yf===void 0)throw new Error("No runtime abstraction layer installed");return Yf}(function(t){function e(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");Yf=n}t.install=e})(Kf||(Kf={}));$f.default=Kf});var zf=K(Ga=>{"use strict";Object.defineProperty(Ga,"__esModule",{value:!0});Ga.Disposable=void 0;var $C;(function(t){function e(n){return{dispose:n}}t.create=e})($C=Ga.Disposable||(Ga.Disposable={}))});var gg=K(mu=>{"use strict";Object.defineProperty(mu,"__esModule",{value:!0});mu.AbstractMessageBuffer=void 0;var zC=13,XC=10,QC=`\r -`,hg=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let n=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(n),this._totalLength+=n.byteLength}tryReadHeaders(){if(this._chunks.length===0)return;let e=0,n=0,r=0,i=0;e:for(;nthis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],o=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,o}let n=this.allocNative(e),r=0,i=0;for(;e>0;){let s=this._chunks[i];if(s.byteLength>e){let o=s.slice(0,e);n.set(o,r),r+=e,this._chunks[i]=s.slice(e),this._totalLength-=e,e-=e}else n.set(s,r),r+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return n}};mu.AbstractMessageBuffer=hg});var Ng=K(Qf=>{"use strict";Object.defineProperty(Qf,"__esModule",{value:!0});var JC=Ii(),_g=require("util"),As=zf(),ZC=gg(),Wa=class extends ZC.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return Wa.emptyBuffer}fromString(e,n){return Buffer.from(e,n)}toString(e,n){return e instanceof Buffer?e.toString(n):new _g.TextDecoder(n).decode(e)}asNative(e,n){return n===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,n):Buffer.from(e,0,n)}allocNative(e){return Buffer.allocUnsafe(e)}};Wa.emptyBuffer=Buffer.allocUnsafe(0);var yg=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),As.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),As.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),As.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),As.Disposable.create(()=>this.stream.off("data",e))}},bg=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),As.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),As.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),As.Disposable.create(()=>this.stream.off("end",e))}write(e,n){return new Promise((r,i)=>{let s=o=>{o==null?r():i(o)};typeof e=="string"?this.stream.write(e,n,s):this.stream.write(e,s)})}end(){this.stream.end()}},Tg=Object.freeze({messageBuffer:Object.freeze({create:t=>new Wa(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),e.charset))}catch(n){return Promise.reject(n)}}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(e.charset))):Promise.resolve(JSON.parse(new _g.TextDecoder(e.charset).decode(t)))}catch(n){return Promise.reject(n)}}})}),stream:Object.freeze({asReadableStream:t=>new yg(t),asWritableStream:t=>new bg(t)}),console,timer:Object.freeze({setTimeout(t,e,...n){return setTimeout(t,e,...n)},clearTimeout(t){clearTimeout(t)},setImmediate(t,...e){return setImmediate(t,...e)},clearImmediate(t){clearImmediate(t)}})});function Xf(){return Tg}(function(t){function e(){JC.default.install(Tg)}t.install=e})(Xf||(Xf={}));Qf.default=Xf});var Po=K(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.stringArray=fn.array=fn.func=fn.error=fn.number=fn.string=fn.boolean=void 0;function eR(t){return t===!0||t===!1}fn.boolean=eR;function vg(t){return typeof t=="string"||t instanceof String}fn.string=vg;function tR(t){return typeof t=="number"||t instanceof Number}fn.number=tR;function nR(t){return t instanceof Error}fn.error=nR;function rR(t){return typeof t=="function"}fn.func=rR;function Pg(t){return Array.isArray(t)}fn.array=Pg;function iR(t){return Pg(t)&&t.every(e=>vg(e))}fn.stringArray=iR});var Jf=K(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.isResponseMessage=ae.isNotificationMessage=ae.isRequestMessage=ae.NotificationType9=ae.NotificationType8=ae.NotificationType7=ae.NotificationType6=ae.NotificationType5=ae.NotificationType4=ae.NotificationType3=ae.NotificationType2=ae.NotificationType1=ae.NotificationType0=ae.NotificationType=ae.RequestType9=ae.RequestType8=ae.RequestType7=ae.RequestType6=ae.RequestType5=ae.RequestType4=ae.RequestType3=ae.RequestType2=ae.RequestType1=ae.RequestType=ae.RequestType0=ae.AbstractMessageSignature=ae.ParameterStructures=ae.ResponseError=ae.ErrorCodes=void 0;var xs=Po(),Ig;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=t.jsonrpcReservedErrorRangeStart,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=t.jsonrpcReservedErrorRangeEnd})(Ig=ae.ErrorCodes||(ae.ErrorCodes={}));var hu=class extends Error{constructor(e,n,r){super(n);this.code=xs.number(e)?e:Ig.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,hu.prototype)}toJson(){return{code:this.code,message:this.message,data:this.data}}};ae.ResponseError=hu;var tn=class{constructor(e){this.kind=e}static is(e){return e===tn.auto||e===tn.byName||e===tn.byPosition}toString(){return this.kind}};ae.ParameterStructures=tn;tn.auto=new tn("auto");tn.byPosition=new tn("byPosition");tn.byName=new tn("byName");var dt=class{constructor(e,n){this.method=e,this.numberOfParams=n}get parameterStructures(){return tn.auto}};ae.AbstractMessageSignature=dt;var Sg=class extends dt{constructor(e){super(e,0)}};ae.RequestType0=Sg;var Cg=class extends dt{constructor(e,n=tn.auto){super(e,1);this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ae.RequestType=Cg;var Rg=class extends dt{constructor(e,n=tn.auto){super(e,1);this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ae.RequestType1=Rg;var Ag=class extends dt{constructor(e){super(e,2)}};ae.RequestType2=Ag;var xg=class extends dt{constructor(e){super(e,3)}};ae.RequestType3=xg;var Eg=class extends dt{constructor(e){super(e,4)}};ae.RequestType4=Eg;var wg=class extends dt{constructor(e){super(e,5)}};ae.RequestType5=wg;var Og=class extends dt{constructor(e){super(e,6)}};ae.RequestType6=Og;var Lg=class extends dt{constructor(e){super(e,7)}};ae.RequestType7=Lg;var Dg=class extends dt{constructor(e){super(e,8)}};ae.RequestType8=Dg;var kg=class extends dt{constructor(e){super(e,9)}};ae.RequestType9=kg;var Mg=class extends dt{constructor(e,n=tn.auto){super(e,1);this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ae.NotificationType=Mg;var Fg=class extends dt{constructor(e){super(e,0)}};ae.NotificationType0=Fg;var Vg=class extends dt{constructor(e,n=tn.auto){super(e,1);this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ae.NotificationType1=Vg;var qg=class extends dt{constructor(e){super(e,2)}};ae.NotificationType2=qg;var Bg=class extends dt{constructor(e){super(e,3)}};ae.NotificationType3=Bg;var jg=class extends dt{constructor(e){super(e,4)}};ae.NotificationType4=jg;var Ug=class extends dt{constructor(e){super(e,5)}};ae.NotificationType5=Ug;var Gg=class extends dt{constructor(e){super(e,6)}};ae.NotificationType6=Gg;var Wg=class extends dt{constructor(e){super(e,7)}};ae.NotificationType7=Wg;var Hg=class extends dt{constructor(e){super(e,8)}};ae.NotificationType8=Hg;var Yg=class extends dt{constructor(e){super(e,9)}};ae.NotificationType9=Yg;function sR(t){let e=t;return e&&xs.string(e.method)&&(xs.string(e.id)||xs.number(e.id))}ae.isRequestMessage=sR;function oR(t){let e=t;return e&&xs.string(e.method)&&t.id===void 0}ae.isNotificationMessage=oR;function aR(t){let e=t;return e&&(e.result!==void 0||!!e.error)&&(xs.string(e.id)||xs.number(e.id)||e.id===null)}ae.isResponseMessage=aR});var Io=K(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.Emitter=Es.Event=void 0;var lR=Ii(),uR;(function(t){let e={dispose(){}};t.None=function(){return e}})(uR=Es.Event||(Es.Event={}));var Kg=class{add(e,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(e,n)})}remove(e,n=null){if(!this._callbacks)return;let r=!1;for(let i=0,s=this._callbacks.length;i{this._callbacks||(this._callbacks=new Kg),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,n);let i={dispose:()=>{!this._callbacks||(this._callbacks.remove(e,n),i.dispose=Ha._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};Es.Emitter=Ha;Ha._noop=function(){}});var np=K(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});ws.CancellationTokenSource=ws.CancellationToken=void 0;var $g=Ii(),cR=Po(),Zf=Io(),ep;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Zf.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Zf.Event.None});function e(n){let r=n;return r&&(r===t.None||r===t.Cancelled||cR.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.is=e})(ep=ws.CancellationToken||(ws.CancellationToken={}));var fR=Object.freeze(function(t,e){let n=$g.default().timer.setTimeout(t.bind(e),0);return{dispose(){$g.default().timer.clearTimeout(n)}}}),tp=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?fR:(this._emitter||(this._emitter=new Zf.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},zg=class{get token(){return this._token||(this._token=new tp),this._token}cancel(){this._token?this._token.cancel():this._token=ep.Cancelled}dispose(){this._token?this._token instanceof tp&&this._token.dispose():this._token=ep.None}};ws.CancellationTokenSource=zg});var Qg=K(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.ReadableStreamMessageReader=Si.AbstractMessageReader=Si.MessageReader=void 0;var gu=Ii(),So=Po(),rp=Io(),pR;(function(t){function e(n){let r=n;return r&&So.func(r.listen)&&So.func(r.dispose)&&So.func(r.onError)&&So.func(r.onClose)&&So.func(r.onPartialMessage)}t.is=e})(pR=Si.MessageReader||(Si.MessageReader={}));var ip=class{constructor(){this.errorEmitter=new rp.Emitter,this.closeEmitter=new rp.Emitter,this.partialMessageEmitter=new rp.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${So.string(e.message)?e.message:"unknown"}`)}};Si.AbstractMessageReader=ip;var sp;(function(t){function e(n){var r;let i,s,o,a=new Map,l,u=new Map;if(n===void 0||typeof n=="string")i=n??"utf-8";else{if(i=(r=n.charset)!==null&&r!==void 0?r:"utf-8",n.contentDecoder!==void 0&&(o=n.contentDecoder,a.set(o.name,o)),n.contentDecoders!==void 0)for(let c of n.contentDecoders)a.set(c.name,c);if(n.contentTypeDecoder!==void 0&&(l=n.contentTypeDecoder,u.set(l.name,l)),n.contentTypeDecoders!==void 0)for(let c of n.contentTypeDecoders)u.set(c.name,c)}return l===void 0&&(l=gu.default().applicationJson.decoder,u.set(l.name,l)),{charset:i,contentDecoder:o,contentDecoders:a,contentTypeDecoder:l,contentTypeDecoders:u}}t.fromOptions=e})(sp||(sp={}));var Xg=class extends ip{constructor(e,n){super();this.readable=e,this.options=sp.fromOptions(n),this.buffer=gu.default().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let n=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),n}onData(e){for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let i=this.buffer.tryReadHeaders();if(!i)return;let s=i.get("Content-Length");if(!s)throw new Error("Header must provide a Content-Length property.");let o=parseInt(s);if(isNaN(o))throw new Error("Content-Length value must be a number.");this.nextMessageLength=o}let n=this.buffer.tryReadBody(this.nextMessageLength);if(n===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1;let r;this.options.contentDecoder!==void 0?r=this.options.contentDecoder.decode(n):r=Promise.resolve(n),r.then(i=>{this.options.contentTypeDecoder.decode(i,this.options).then(s=>{this.callback(s)},s=>{this.fireError(s)})},i=>{this.fireError(i)})}}clearPartialMessageTimer(){this.partialMessageTimer&&(gu.default().timer.clearTimeout(this.partialMessageTimer),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=gu.default().timer.setTimeout((e,n)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:n}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};Si.ReadableStreamMessageReader=Xg});var Zg=K(_u=>{"use strict";Object.defineProperty(_u,"__esModule",{value:!0});_u.Semaphore=void 0;var dR=Ii(),Jg=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((n,r)=>{this._waiting.push({thunk:e,resolve:n,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||dR.default().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let n=e.thunk();n instanceof Promise?n.then(r=>{this._active--,e.resolve(r),this.runNext()},r=>{this._active--,e.reject(r),this.runNext()}):(this._active--,e.resolve(n),this.runNext())}catch(n){this._active--,e.reject(n),this.runNext()}}};_u.Semaphore=Jg});var i_=K(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.WriteableStreamMessageWriter=Ci.AbstractMessageWriter=Ci.MessageWriter=void 0;var e_=Ii(),Ya=Po(),mR=Zg(),t_=Io(),hR="Content-Length: ",n_=`\r -`,gR;(function(t){function e(n){let r=n;return r&&Ya.func(r.dispose)&&Ya.func(r.onClose)&&Ya.func(r.onError)&&Ya.func(r.write)}t.is=e})(gR=Ci.MessageWriter||(Ci.MessageWriter={}));var op=class{constructor(){this.errorEmitter=new t_.Emitter,this.closeEmitter=new t_.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,n,r){this.errorEmitter.fire([this.asError(e),n,r])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${Ya.string(e.message)?e.message:"unknown"}`)}};Ci.AbstractMessageWriter=op;var ap;(function(t){function e(n){var r,i;return n===void 0||typeof n=="string"?{charset:n??"utf-8",contentTypeEncoder:e_.default().applicationJson.encoder}:{charset:(r=n.charset)!==null&&r!==void 0?r:"utf-8",contentEncoder:n.contentEncoder,contentTypeEncoder:(i=n.contentTypeEncoder)!==null&&i!==void 0?i:e_.default().applicationJson.encoder}}t.fromOptions=e})(ap||(ap={}));var r_=class extends op{constructor(e,n){super();this.writable=e,this.options=ap.fromOptions(n),this.errorCount=0,this.writeSemaphore=new mR.Semaphore(1),this.writable.onError(r=>this.fireError(r)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(r=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(r):r).then(r=>{let i=[];return i.push(hR,r.byteLength.toString(),n_),i.push(n_),this.doWrite(e,i,r)},r=>{throw this.fireError(r),r}))}async doWrite(e,n,r){try{return await this.writable.write(n.join(""),"ascii"),this.writable.write(r)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){this.writable.end()}};Ci.WriteableStreamMessageWriter=r_});var o_=K(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.LRUCache=Ri.LinkedMap=Ri.Touch=void 0;var _n;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(_n=Ri.Touch||(Ri.Touch={}));var lp=class{constructor(){this[Symbol.toStringTag]="LinkedMap",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(){var e;return(e=this._head)===null||e===void 0?void 0:e.value}get last(){var e;return(e=this._tail)===null||e===void 0?void 0:e.value}has(e){return this._map.has(e)}get(e,n=_n.None){let r=this._map.get(e);if(!!r)return n!==_n.None&&this.touch(r,n),r.value}set(e,n,r=_n.None){let i=this._map.get(e);if(i)i.value=n,r!==_n.None&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case _n.None:this.addItemLast(i);break;case _n.First:this.addItemFirst(i);break;case _n.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let n=this._map.get(e);if(!!n)return this._map.delete(e),this.removeItem(n),this._size--,n.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,n){let r=this._state,i=this._head;for(;i;){if(n?e.bind(n)(i.value,i.key,this):e(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this,n=this._state,r=this._head,i={[Symbol.iterator](){return i},next(){if(e._state!==n)throw new Error("LinkedMap got modified during iteration.");if(r){let s={value:r.key,done:!1};return r=r.next,s}else return{value:void 0,done:!0}}};return i}values(){let e=this,n=this._state,r=this._head,i={[Symbol.iterator](){return i},next(){if(e._state!==n)throw new Error("LinkedMap got modified during iteration.");if(r){let s={value:r.value,done:!1};return r=r.next,s}else return{value:void 0,done:!0}}};return i}entries(){let e=this,n=this._state,r=this._head,i={[Symbol.iterator](){return i},next(){if(e._state!==n)throw new Error("LinkedMap got modified during iteration.");if(r){let s={value:[r.key,r.value],done:!1};return r=r.next,s}else return{value:void 0,done:!0}}};return i}[Symbol.iterator](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let n=this._head,r=this.size;for(;n&&r>e;)this._map.delete(n.key),n=n.next,r--;this._head=n,this._size=r,n&&(n.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let n=e.next,r=e.previous;if(!n||!r)throw new Error("Invalid list");n.previous=r,r.next=n}e.next=void 0,e.previous=void 0,this._state++}touch(e,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==_n.First&&n!==_n.Last)){if(n===_n.First){if(e===this._head)return;let r=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(n===_n.Last){if(e===this._tail)return;let r=e.next,i=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((n,r)=>{e.push([r,n])}),e}fromJSON(e){this.clear();for(let[n,r]of e)this.set(n,r)}};Ri.LinkedMap=lp;var s_=class extends lp{constructor(e,n=1){super();this._limit=e,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,n=_n.AsNew){return super.get(e,n)}peek(e){return super.get(e,_n.None)}set(e,n){return super.set(e,n,_n.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Ri.LRUCache=s_});var p_=K(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.createMessageConnection=ve.ConnectionOptions=ve.CancellationStrategy=ve.CancellationSenderStrategy=ve.CancellationReceiverStrategy=ve.ConnectionStrategy=ve.ConnectionError=ve.ConnectionErrors=ve.LogTraceNotification=ve.SetTraceNotification=ve.TraceFormat=ve.Trace=ve.NullLogger=ve.ProgressType=void 0;var a_=Ii(),Yt=Po(),ye=Jf(),l_=o_(),Ka=Io(),up=np(),$a;(function(t){t.type=new ye.NotificationType("$/cancelRequest")})($a||($a={}));var yu;(function(t){t.type=new ye.NotificationType("$/progress")})(yu||(yu={}));var u_=class{constructor(){}};ve.ProgressType=u_;var cp;(function(t){function e(n){return Yt.func(n)}t.is=e})(cp||(cp={}));ve.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var Et;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Verbose=2]="Verbose"})(Et=ve.Trace||(ve.Trace={}));(function(t){function e(r){if(!Yt.string(r))return t.Off;switch(r=r.toLowerCase(),r){case"off":return t.Off;case"messages":return t.Messages;case"verbose":return t.Verbose;default:return t.Off}}t.fromString=e;function n(r){switch(r){case t.Off:return"off";case t.Messages:return"messages";case t.Verbose:return"verbose";default:return"off"}}t.toString=n})(Et=ve.Trace||(ve.Trace={}));var Pr;(function(t){t.Text="text",t.JSON="json"})(Pr=ve.TraceFormat||(ve.TraceFormat={}));(function(t){function e(n){return n=n.toLowerCase(),n==="json"?t.JSON:t.Text}t.fromString=e})(Pr=ve.TraceFormat||(ve.TraceFormat={}));var c_;(function(t){t.type=new ye.NotificationType("$/setTrace")})(c_=ve.SetTraceNotification||(ve.SetTraceNotification={}));var fp;(function(t){t.type=new ye.NotificationType("$/logTrace")})(fp=ve.LogTraceNotification||(ve.LogTraceNotification={}));var bu;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(bu=ve.ConnectionErrors||(ve.ConnectionErrors={}));var Os=class extends Error{constructor(e,n){super(n);this.code=e,Object.setPrototypeOf(this,Os.prototype)}};ve.ConnectionError=Os;var f_;(function(t){function e(n){let r=n;return r&&Yt.func(r.cancelUndispatched)}t.is=e})(f_=ve.ConnectionStrategy||(ve.ConnectionStrategy={}));var pp;(function(t){t.Message=Object.freeze({createCancellationTokenSource(n){return new up.CancellationTokenSource}});function e(n){let r=n;return r&&Yt.func(r.createCancellationTokenSource)}t.is=e})(pp=ve.CancellationReceiverStrategy||(ve.CancellationReceiverStrategy={}));var dp;(function(t){t.Message=Object.freeze({sendCancellation(n,r){n.sendNotification($a.type,{id:r})},cleanup(n){}});function e(n){let r=n;return r&&Yt.func(r.sendCancellation)&&Yt.func(r.cleanup)}t.is=e})(dp=ve.CancellationSenderStrategy||(ve.CancellationSenderStrategy={}));var mp;(function(t){t.Message=Object.freeze({receiver:pp.Message,sender:dp.Message});function e(n){let r=n;return r&&pp.is(r.receiver)&&dp.is(r.sender)}t.is=e})(mp=ve.CancellationStrategy||(ve.CancellationStrategy={}));var _R;(function(t){function e(n){let r=n;return r&&(mp.is(r.cancellationStrategy)||f_.is(r.connectionStrategy))}t.is=e})(_R=ve.ConnectionOptions||(ve.ConnectionOptions={}));var Ir;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(Ir||(Ir={}));function yR(t,e,n,r){let i=n!==void 0?n:ve.NullLogger,s=0,o=0,a=0,l="2.0",u,c=Object.create(null),f,m=Object.create(null),d=new Map,p,_=new l_.LinkedMap,C=Object.create(null),h=Object.create(null),b=Et.Off,g=Pr.Text,N,S=Ir.New,V=new Ka.Emitter,O=new Ka.Emitter,$=new Ka.Emitter,X=new Ka.Emitter,ee=new Ka.Emitter,Y=r&&r.cancellationStrategy?r.cancellationStrategy:mp.Message;function ne(v){if(v===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+v.toString()}function Le(v){return v===null?"res-unknown-"+(++a).toString():"res-"+v.toString()}function de(){return"not-"+(++o).toString()}function Z(v,I){ye.isRequestMessage(I)?v.set(ne(I.id),I):ye.isResponseMessage(I)?v.set(Le(I.id),I):v.set(de(),I)}function Ge(v){}function lt(){return S===Ir.Listening}function Ft(){return S===Ir.Closed}function Ve(){return S===Ir.Disposed}function ut(){(S===Ir.New||S===Ir.Listening)&&(S=Ir.Closed,O.fire(void 0))}function bi(v){V.fire([v,void 0,void 0])}function Yi(v){V.fire(v)}t.onClose(ut),t.onError(bi),e.onClose(ut),e.onError(Yi);function le(){p||_.size===0||(p=a_.default().timer.setImmediate(()=>{p=void 0,ue()}))}function ue(){if(_.size===0)return;let v=_.shift();try{ye.isRequestMessage(v)?se(v):ye.isNotificationMessage(v)?Nt(v):ye.isResponseMessage(v)?Ne(v):Nr(v)}finally{le()}}let me=v=>{try{if(ye.isNotificationMessage(v)&&v.method===$a.type.method){let I=ne(v.params.id),y=_.get(I);if(ye.isRequestMessage(y)){let x=r==null?void 0:r.connectionStrategy,w=x&&x.cancelUndispatched?x.cancelUndispatched(y,Ge):void 0;if(w&&(w.error!==void 0||w.result!==void 0)){_.delete(I),w.id=y.id,ti(w,v.method,Date.now()),e.write(w);return}}}Z(_,v)}finally{le()}};function se(v){if(Ve())return;function I(F,ie,pe){let we={jsonrpc:l,id:v.id};F instanceof ye.ResponseError?we.error=F.toJson():we.result=F===void 0?null:F,ti(we,ie,pe),e.write(we)}function y(F,ie,pe){let we={jsonrpc:l,id:v.id,error:F.toJson()};ti(we,ie,pe),e.write(we)}function x(F,ie,pe){F===void 0&&(F=null);let we={jsonrpc:l,id:v.id,result:F};ti(we,ie,pe),e.write(we)}Rs(v);let w=c[v.method],R,T;w&&(R=w.type,T=w.handler);let L=Date.now();if(T||u){let F=String(v.id),ie=Y.receiver.createCancellationTokenSource(F);h[F]=ie;try{let pe;if(T)if(v.params===void 0){if(R!==void 0&&R.numberOfParams!==0){y(new ye.ResponseError(ye.ErrorCodes.InvalidParams,`Request ${v.method} defines ${R.numberOfParams} params but recevied none.`),v.method,L);return}pe=T(ie.token)}else if(Array.isArray(v.params)){if(R!==void 0&&R.parameterStructures===ye.ParameterStructures.byName){y(new ye.ResponseError(ye.ErrorCodes.InvalidParams,`Request ${v.method} defines parameters by name but received parameters by position`),v.method,L);return}pe=T(...v.params,ie.token)}else{if(R!==void 0&&R.parameterStructures===ye.ParameterStructures.byPosition){y(new ye.ResponseError(ye.ErrorCodes.InvalidParams,`Request ${v.method} defines parameters by position but received parameters by name`),v.method,L);return}pe=T(v.params,ie.token)}else u&&(pe=u(v.method,v.params,ie.token));let we=pe;pe?we.then?we.then(st=>{delete h[F],I(st,v.method,L)},st=>{delete h[F],st instanceof ye.ResponseError?y(st,v.method,L):st&&Yt.string(st.message)?y(new ye.ResponseError(ye.ErrorCodes.InternalError,`Request ${v.method} failed with message: ${st.message}`),v.method,L):y(new ye.ResponseError(ye.ErrorCodes.InternalError,`Request ${v.method} failed unexpectedly without providing any details.`),v.method,L)}):(delete h[F],I(pe,v.method,L)):(delete h[F],x(pe,v.method,L))}catch(pe){delete h[F],pe instanceof ye.ResponseError?I(pe,v.method,L):pe&&Yt.string(pe.message)?y(new ye.ResponseError(ye.ErrorCodes.InternalError,`Request ${v.method} failed with message: ${pe.message}`),v.method,L):y(new ye.ResponseError(ye.ErrorCodes.InternalError,`Request ${v.method} failed unexpectedly without providing any details.`),v.method,L)}}else y(new ye.ResponseError(ye.ErrorCodes.MethodNotFound,`Unhandled method ${v.method}`),v.method,L)}function Ne(v){if(!Ve())if(v.id===null)v.error?i.error(`Received response message without id: Error is: -${JSON.stringify(v.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let I=String(v.id),y=C[I];if(No(v,y),y){delete C[I];try{if(v.error){let x=v.error;y.reject(new ye.ResponseError(x.code,x.message,x.data))}else if(v.result!==void 0)y.resolve(v.result);else throw new Error("Should never happen.")}catch(x){x.message?i.error(`Response handler '${y.method}' failed with message: ${x.message}`):i.error(`Response handler '${y.method}' failed unexpectedly.`)}}}}function Nt(v){if(Ve())return;let I,y;if(v.method===$a.type.method)y=x=>{let w=x.id,R=h[String(w)];R&&R.cancel()};else{let x=m[v.method];x&&(y=x.handler,I=x.type)}if(y||f)try{To(v),y?v.params===void 0?(I!==void 0&&I.numberOfParams!==0&&I.parameterStructures!==ye.ParameterStructures.byName&&i.error(`Notification ${v.method} defines ${I.numberOfParams} params but recevied none.`),y()):Array.isArray(v.params)?(I!==void 0&&(I.parameterStructures===ye.ParameterStructures.byName&&i.error(`Notification ${v.method} defines parameters by name but received parameters by position`),I.numberOfParams!==v.params.length&&i.error(`Notification ${v.method} defines ${I.numberOfParams} params but received ${v.params.length} argumennts`)),y(...v.params)):(I!==void 0&&I.parameterStructures===ye.ParameterStructures.byPosition&&i.error(`Notification ${v.method} defines parameters by position but received parameters by name`),y(v.params)):f&&f(v.method,v.params)}catch(x){x.message?i.error(`Notification handler '${v.method}' failed with message: ${x.message}`):i.error(`Notification handler '${v.method}' failed unexpectedly.`)}else $.fire(v)}function Nr(v){if(!v){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message: -${JSON.stringify(v,null,4)}`);let I=v;if(Yt.string(I.id)||Yt.number(I.id)){let y=String(I.id),x=C[y];x&&x.reject(new Error("The received response has neither a result nor an error property."))}}function yo(v){if(!(b===Et.Off||!N))if(g===Pr.Text){let I;b===Et.Verbose&&v.params&&(I=`Params: ${JSON.stringify(v.params,null,4)} +var FC=Object.create;var pu=Object.defineProperty;var VC=Object.getOwnPropertyDescriptor;var qC=Object.getOwnPropertyNames;var BC=Object.getPrototypeOf,jC=Object.prototype.hasOwnProperty;var lg=t=>pu(t,"__esModule",{value:!0});var K=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),UC=(t,e)=>{for(var n in e)pu(t,n,{get:e[n],enumerable:!0})},ug=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of qC(e))!jC.call(t,i)&&(n||i!=="default")&&pu(t,i,{get:()=>e[i],enumerable:!(r=VC(e,i))||r.enumerable});return t},Q=(t,e)=>ug(lg(pu(t!=null?FC(BC(t)):{},"default",!e&&t&&t.__esModule?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),GC=(t=>(e,n)=>t&&t.get(e)||(n=ug(lg({}),e,1),t&&t.set(e,n),n))(typeof WeakMap!="undefined"?new WeakMap:0);var fg=K((cg,du)=>{(function(t){if(typeof du=="object"&&typeof du.exports=="object"){var e=t(require,cg);e!==void 0&&(du.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],t)})(function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function l(u,c,f,m){this._uri=u,this._languageId=c,this._version=f,this._content=m,this._lineOffsets=void 0}return Object.defineProperty(l.prototype,"uri",{get:function(){return this._uri},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"version",{get:function(){return this._version},enumerable:!0,configurable:!0}),l.prototype.getText=function(u){if(u){var c=this.offsetAt(u.start),f=this.offsetAt(u.end);return this._content.substring(c,f)}return this._content},l.prototype.update=function(u,c){for(var f=0,m=u;fu?m=p:f=p+1}var d=f-1;return{line:d,character:u-c[d]}},l.prototype.offsetAt=function(u){var c=this.getLineOffsets();if(u.line>=c.length)return this._content.length;if(u.line<0)return 0;var f=c[u.line],m=u.line+1C&&h.push(d.substring(C,S)),N.newText.length&&h.push(N.newText),C=m.offsetAt(N.range.end)}return h.push(d.substr(C)),h.join("")}l.applyEdits=f})(r=e.TextDocument||(e.TextDocument={}));function i(l,u){if(l.length<=1)return l;var c=l.length/2|0,f=l.slice(0,c),m=l.slice(c);i(f,u),i(m,u);for(var p=0,d=0,_=0;pc.line||u.line===c.line&&u.character>c.character?{start:c,end:u}:l}function a(l){var u=o(l.range);return u!==l.range?{newText:l.newText,range:u}:l}})});var mu=K(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.thenable=xt.typedArray=xt.stringArray=xt.array=xt.func=xt.error=xt.number=xt.string=xt.boolean=void 0;function WC(t){return t===!0||t===!1}xt.boolean=WC;function pg(t){return typeof t=="string"||t instanceof String}xt.string=pg;function HC(t){return typeof t=="number"||t instanceof Number}xt.number=HC;function YC(t){return t instanceof Error}xt.error=YC;function dg(t){return typeof t=="function"}xt.func=dg;function mg(t){return Array.isArray(t)}xt.array=mg;function KC(t){return mg(t)&&t.every(e=>pg(e))}xt.stringArray=KC;function $C(t,e){return Array.isArray(t)&&t.every(e)}xt.typedArray=$C;function zC(t){return t&&dg(t.then)}xt.thenable=zC});var Ii=K(zf=>{"use strict";Object.defineProperty(zf,"__esModule",{value:!0});var Kf;function $f(){if(Kf===void 0)throw new Error("No runtime abstraction layer installed");return Kf}(function(t){function e(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");Kf=n}t.install=e})($f||($f={}));zf.default=$f});var Xf=K(Ga=>{"use strict";Object.defineProperty(Ga,"__esModule",{value:!0});Ga.Disposable=void 0;var XC;(function(t){function e(n){return{dispose:n}}t.create=e})(XC=Ga.Disposable||(Ga.Disposable={}))});var gg=K(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});hu.AbstractMessageBuffer=void 0;var QC=13,JC=10,ZC=`\r +`,hg=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let n=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(n),this._totalLength+=n.byteLength}tryReadHeaders(){if(this._chunks.length===0)return;let e=0,n=0,r=0,i=0;e:for(;nthis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],o=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,o}let n=this.allocNative(e),r=0,i=0;for(;e>0;){let s=this._chunks[i];if(s.byteLength>e){let o=s.slice(0,e);n.set(o,r),r+=e,this._chunks[i]=s.slice(e),this._totalLength-=e,e-=e}else n.set(s,r),r+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return n}};hu.AbstractMessageBuffer=hg});var Ng=K(Jf=>{"use strict";Object.defineProperty(Jf,"__esModule",{value:!0});var eR=Ii(),_g=require("util"),As=Xf(),tR=gg(),Wa=class extends tR.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return Wa.emptyBuffer}fromString(e,n){return Buffer.from(e,n)}toString(e,n){return e instanceof Buffer?e.toString(n):new _g.TextDecoder(n).decode(e)}asNative(e,n){return n===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,n):Buffer.from(e,0,n)}allocNative(e){return Buffer.allocUnsafe(e)}};Wa.emptyBuffer=Buffer.allocUnsafe(0);var yg=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),As.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),As.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),As.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),As.Disposable.create(()=>this.stream.off("data",e))}},bg=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),As.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),As.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),As.Disposable.create(()=>this.stream.off("end",e))}write(e,n){return new Promise((r,i)=>{let s=o=>{o==null?r():i(o)};typeof e=="string"?this.stream.write(e,n,s):this.stream.write(e,s)})}end(){this.stream.end()}},Tg=Object.freeze({messageBuffer:Object.freeze({create:t=>new Wa(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),e.charset))}catch(n){return Promise.reject(n)}}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(e.charset))):Promise.resolve(JSON.parse(new _g.TextDecoder(e.charset).decode(t)))}catch(n){return Promise.reject(n)}}})}),stream:Object.freeze({asReadableStream:t=>new yg(t),asWritableStream:t=>new bg(t)}),console,timer:Object.freeze({setTimeout(t,e,...n){return setTimeout(t,e,...n)},clearTimeout(t){clearTimeout(t)},setImmediate(t,...e){return setImmediate(t,...e)},clearImmediate(t){clearImmediate(t)}})});function Qf(){return Tg}(function(t){function e(){eR.default.install(Tg)}t.install=e})(Qf||(Qf={}));Jf.default=Qf});var Po=K(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.stringArray=fn.array=fn.func=fn.error=fn.number=fn.string=fn.boolean=void 0;function nR(t){return t===!0||t===!1}fn.boolean=nR;function vg(t){return typeof t=="string"||t instanceof String}fn.string=vg;function rR(t){return typeof t=="number"||t instanceof Number}fn.number=rR;function iR(t){return t instanceof Error}fn.error=iR;function sR(t){return typeof t=="function"}fn.func=sR;function Pg(t){return Array.isArray(t)}fn.array=Pg;function oR(t){return Pg(t)&&t.every(e=>vg(e))}fn.stringArray=oR});var Zf=K(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.isResponseMessage=ae.isNotificationMessage=ae.isRequestMessage=ae.NotificationType9=ae.NotificationType8=ae.NotificationType7=ae.NotificationType6=ae.NotificationType5=ae.NotificationType4=ae.NotificationType3=ae.NotificationType2=ae.NotificationType1=ae.NotificationType0=ae.NotificationType=ae.RequestType9=ae.RequestType8=ae.RequestType7=ae.RequestType6=ae.RequestType5=ae.RequestType4=ae.RequestType3=ae.RequestType2=ae.RequestType1=ae.RequestType=ae.RequestType0=ae.AbstractMessageSignature=ae.ParameterStructures=ae.ResponseError=ae.ErrorCodes=void 0;var xs=Po(),Ig;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=t.jsonrpcReservedErrorRangeStart,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=t.jsonrpcReservedErrorRangeEnd})(Ig=ae.ErrorCodes||(ae.ErrorCodes={}));var gu=class extends Error{constructor(e,n,r){super(n);this.code=xs.number(e)?e:Ig.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,gu.prototype)}toJson(){return{code:this.code,message:this.message,data:this.data}}};ae.ResponseError=gu;var tn=class{constructor(e){this.kind=e}static is(e){return e===tn.auto||e===tn.byName||e===tn.byPosition}toString(){return this.kind}};ae.ParameterStructures=tn;tn.auto=new tn("auto");tn.byPosition=new tn("byPosition");tn.byName=new tn("byName");var dt=class{constructor(e,n){this.method=e,this.numberOfParams=n}get parameterStructures(){return tn.auto}};ae.AbstractMessageSignature=dt;var Sg=class extends dt{constructor(e){super(e,0)}};ae.RequestType0=Sg;var Cg=class extends dt{constructor(e,n=tn.auto){super(e,1);this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ae.RequestType=Cg;var Rg=class extends dt{constructor(e,n=tn.auto){super(e,1);this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ae.RequestType1=Rg;var Ag=class extends dt{constructor(e){super(e,2)}};ae.RequestType2=Ag;var xg=class extends dt{constructor(e){super(e,3)}};ae.RequestType3=xg;var Eg=class extends dt{constructor(e){super(e,4)}};ae.RequestType4=Eg;var wg=class extends dt{constructor(e){super(e,5)}};ae.RequestType5=wg;var Og=class extends dt{constructor(e){super(e,6)}};ae.RequestType6=Og;var Lg=class extends dt{constructor(e){super(e,7)}};ae.RequestType7=Lg;var Dg=class extends dt{constructor(e){super(e,8)}};ae.RequestType8=Dg;var kg=class extends dt{constructor(e){super(e,9)}};ae.RequestType9=kg;var Mg=class extends dt{constructor(e,n=tn.auto){super(e,1);this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ae.NotificationType=Mg;var Fg=class extends dt{constructor(e){super(e,0)}};ae.NotificationType0=Fg;var Vg=class extends dt{constructor(e,n=tn.auto){super(e,1);this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ae.NotificationType1=Vg;var qg=class extends dt{constructor(e){super(e,2)}};ae.NotificationType2=qg;var Bg=class extends dt{constructor(e){super(e,3)}};ae.NotificationType3=Bg;var jg=class extends dt{constructor(e){super(e,4)}};ae.NotificationType4=jg;var Ug=class extends dt{constructor(e){super(e,5)}};ae.NotificationType5=Ug;var Gg=class extends dt{constructor(e){super(e,6)}};ae.NotificationType6=Gg;var Wg=class extends dt{constructor(e){super(e,7)}};ae.NotificationType7=Wg;var Hg=class extends dt{constructor(e){super(e,8)}};ae.NotificationType8=Hg;var Yg=class extends dt{constructor(e){super(e,9)}};ae.NotificationType9=Yg;function aR(t){let e=t;return e&&xs.string(e.method)&&(xs.string(e.id)||xs.number(e.id))}ae.isRequestMessage=aR;function lR(t){let e=t;return e&&xs.string(e.method)&&t.id===void 0}ae.isNotificationMessage=lR;function uR(t){let e=t;return e&&(e.result!==void 0||!!e.error)&&(xs.string(e.id)||xs.number(e.id)||e.id===null)}ae.isResponseMessage=uR});var Io=K(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.Emitter=Es.Event=void 0;var cR=Ii(),fR;(function(t){let e={dispose(){}};t.None=function(){return e}})(fR=Es.Event||(Es.Event={}));var Kg=class{add(e,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(e,n)})}remove(e,n=null){if(!this._callbacks)return;let r=!1;for(let i=0,s=this._callbacks.length;i{this._callbacks||(this._callbacks=new Kg),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,n);let i={dispose:()=>{!this._callbacks||(this._callbacks.remove(e,n),i.dispose=Ha._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};Es.Emitter=Ha;Ha._noop=function(){}});var rp=K(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});ws.CancellationTokenSource=ws.CancellationToken=void 0;var $g=Ii(),pR=Po(),ep=Io(),tp;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:ep.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:ep.Event.None});function e(n){let r=n;return r&&(r===t.None||r===t.Cancelled||pR.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.is=e})(tp=ws.CancellationToken||(ws.CancellationToken={}));var dR=Object.freeze(function(t,e){let n=$g.default().timer.setTimeout(t.bind(e),0);return{dispose(){$g.default().timer.clearTimeout(n)}}}),np=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?dR:(this._emitter||(this._emitter=new ep.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},zg=class{get token(){return this._token||(this._token=new np),this._token}cancel(){this._token?this._token.cancel():this._token=tp.Cancelled}dispose(){this._token?this._token instanceof np&&this._token.dispose():this._token=tp.None}};ws.CancellationTokenSource=zg});var Qg=K(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.ReadableStreamMessageReader=Si.AbstractMessageReader=Si.MessageReader=void 0;var _u=Ii(),So=Po(),ip=Io(),mR;(function(t){function e(n){let r=n;return r&&So.func(r.listen)&&So.func(r.dispose)&&So.func(r.onError)&&So.func(r.onClose)&&So.func(r.onPartialMessage)}t.is=e})(mR=Si.MessageReader||(Si.MessageReader={}));var sp=class{constructor(){this.errorEmitter=new ip.Emitter,this.closeEmitter=new ip.Emitter,this.partialMessageEmitter=new ip.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${So.string(e.message)?e.message:"unknown"}`)}};Si.AbstractMessageReader=sp;var op;(function(t){function e(n){var r;let i,s,o,a=new Map,l,u=new Map;if(n===void 0||typeof n=="string")i=n??"utf-8";else{if(i=(r=n.charset)!==null&&r!==void 0?r:"utf-8",n.contentDecoder!==void 0&&(o=n.contentDecoder,a.set(o.name,o)),n.contentDecoders!==void 0)for(let c of n.contentDecoders)a.set(c.name,c);if(n.contentTypeDecoder!==void 0&&(l=n.contentTypeDecoder,u.set(l.name,l)),n.contentTypeDecoders!==void 0)for(let c of n.contentTypeDecoders)u.set(c.name,c)}return l===void 0&&(l=_u.default().applicationJson.decoder,u.set(l.name,l)),{charset:i,contentDecoder:o,contentDecoders:a,contentTypeDecoder:l,contentTypeDecoders:u}}t.fromOptions=e})(op||(op={}));var Xg=class extends sp{constructor(e,n){super();this.readable=e,this.options=op.fromOptions(n),this.buffer=_u.default().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let n=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),n}onData(e){for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let i=this.buffer.tryReadHeaders();if(!i)return;let s=i.get("Content-Length");if(!s)throw new Error("Header must provide a Content-Length property.");let o=parseInt(s);if(isNaN(o))throw new Error("Content-Length value must be a number.");this.nextMessageLength=o}let n=this.buffer.tryReadBody(this.nextMessageLength);if(n===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1;let r;this.options.contentDecoder!==void 0?r=this.options.contentDecoder.decode(n):r=Promise.resolve(n),r.then(i=>{this.options.contentTypeDecoder.decode(i,this.options).then(s=>{this.callback(s)},s=>{this.fireError(s)})},i=>{this.fireError(i)})}}clearPartialMessageTimer(){this.partialMessageTimer&&(_u.default().timer.clearTimeout(this.partialMessageTimer),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=_u.default().timer.setTimeout((e,n)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:n}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};Si.ReadableStreamMessageReader=Xg});var Zg=K(yu=>{"use strict";Object.defineProperty(yu,"__esModule",{value:!0});yu.Semaphore=void 0;var hR=Ii(),Jg=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((n,r)=>{this._waiting.push({thunk:e,resolve:n,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||hR.default().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let n=e.thunk();n instanceof Promise?n.then(r=>{this._active--,e.resolve(r),this.runNext()},r=>{this._active--,e.reject(r),this.runNext()}):(this._active--,e.resolve(n),this.runNext())}catch(n){this._active--,e.reject(n),this.runNext()}}};yu.Semaphore=Jg});var i_=K(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.WriteableStreamMessageWriter=Ci.AbstractMessageWriter=Ci.MessageWriter=void 0;var e_=Ii(),Ya=Po(),gR=Zg(),t_=Io(),_R="Content-Length: ",n_=`\r +`,yR;(function(t){function e(n){let r=n;return r&&Ya.func(r.dispose)&&Ya.func(r.onClose)&&Ya.func(r.onError)&&Ya.func(r.write)}t.is=e})(yR=Ci.MessageWriter||(Ci.MessageWriter={}));var ap=class{constructor(){this.errorEmitter=new t_.Emitter,this.closeEmitter=new t_.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,n,r){this.errorEmitter.fire([this.asError(e),n,r])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${Ya.string(e.message)?e.message:"unknown"}`)}};Ci.AbstractMessageWriter=ap;var lp;(function(t){function e(n){var r,i;return n===void 0||typeof n=="string"?{charset:n??"utf-8",contentTypeEncoder:e_.default().applicationJson.encoder}:{charset:(r=n.charset)!==null&&r!==void 0?r:"utf-8",contentEncoder:n.contentEncoder,contentTypeEncoder:(i=n.contentTypeEncoder)!==null&&i!==void 0?i:e_.default().applicationJson.encoder}}t.fromOptions=e})(lp||(lp={}));var r_=class extends ap{constructor(e,n){super();this.writable=e,this.options=lp.fromOptions(n),this.errorCount=0,this.writeSemaphore=new gR.Semaphore(1),this.writable.onError(r=>this.fireError(r)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(r=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(r):r).then(r=>{let i=[];return i.push(_R,r.byteLength.toString(),n_),i.push(n_),this.doWrite(e,i,r)},r=>{throw this.fireError(r),r}))}async doWrite(e,n,r){try{return await this.writable.write(n.join(""),"ascii"),this.writable.write(r)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){this.writable.end()}};Ci.WriteableStreamMessageWriter=r_});var o_=K(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.LRUCache=Ri.LinkedMap=Ri.Touch=void 0;var _n;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(_n=Ri.Touch||(Ri.Touch={}));var up=class{constructor(){this[Symbol.toStringTag]="LinkedMap",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(){var e;return(e=this._head)===null||e===void 0?void 0:e.value}get last(){var e;return(e=this._tail)===null||e===void 0?void 0:e.value}has(e){return this._map.has(e)}get(e,n=_n.None){let r=this._map.get(e);if(!!r)return n!==_n.None&&this.touch(r,n),r.value}set(e,n,r=_n.None){let i=this._map.get(e);if(i)i.value=n,r!==_n.None&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case _n.None:this.addItemLast(i);break;case _n.First:this.addItemFirst(i);break;case _n.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let n=this._map.get(e);if(!!n)return this._map.delete(e),this.removeItem(n),this._size--,n.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,n){let r=this._state,i=this._head;for(;i;){if(n?e.bind(n)(i.value,i.key,this):e(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this,n=this._state,r=this._head,i={[Symbol.iterator](){return i},next(){if(e._state!==n)throw new Error("LinkedMap got modified during iteration.");if(r){let s={value:r.key,done:!1};return r=r.next,s}else return{value:void 0,done:!0}}};return i}values(){let e=this,n=this._state,r=this._head,i={[Symbol.iterator](){return i},next(){if(e._state!==n)throw new Error("LinkedMap got modified during iteration.");if(r){let s={value:r.value,done:!1};return r=r.next,s}else return{value:void 0,done:!0}}};return i}entries(){let e=this,n=this._state,r=this._head,i={[Symbol.iterator](){return i},next(){if(e._state!==n)throw new Error("LinkedMap got modified during iteration.");if(r){let s={value:[r.key,r.value],done:!1};return r=r.next,s}else return{value:void 0,done:!0}}};return i}[Symbol.iterator](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let n=this._head,r=this.size;for(;n&&r>e;)this._map.delete(n.key),n=n.next,r--;this._head=n,this._size=r,n&&(n.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let n=e.next,r=e.previous;if(!n||!r)throw new Error("Invalid list");n.previous=r,r.next=n}e.next=void 0,e.previous=void 0,this._state++}touch(e,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==_n.First&&n!==_n.Last)){if(n===_n.First){if(e===this._head)return;let r=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(n===_n.Last){if(e===this._tail)return;let r=e.next,i=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((n,r)=>{e.push([r,n])}),e}fromJSON(e){this.clear();for(let[n,r]of e)this.set(n,r)}};Ri.LinkedMap=up;var s_=class extends up{constructor(e,n=1){super();this._limit=e,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,n=_n.AsNew){return super.get(e,n)}peek(e){return super.get(e,_n.None)}set(e,n){return super.set(e,n,_n.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Ri.LRUCache=s_});var p_=K(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.createMessageConnection=ve.ConnectionOptions=ve.CancellationStrategy=ve.CancellationSenderStrategy=ve.CancellationReceiverStrategy=ve.ConnectionStrategy=ve.ConnectionError=ve.ConnectionErrors=ve.LogTraceNotification=ve.SetTraceNotification=ve.TraceFormat=ve.Trace=ve.NullLogger=ve.ProgressType=void 0;var a_=Ii(),Yt=Po(),ye=Zf(),l_=o_(),Ka=Io(),cp=rp(),$a;(function(t){t.type=new ye.NotificationType("$/cancelRequest")})($a||($a={}));var bu;(function(t){t.type=new ye.NotificationType("$/progress")})(bu||(bu={}));var u_=class{constructor(){}};ve.ProgressType=u_;var fp;(function(t){function e(n){return Yt.func(n)}t.is=e})(fp||(fp={}));ve.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var Et;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Verbose=2]="Verbose"})(Et=ve.Trace||(ve.Trace={}));(function(t){function e(r){if(!Yt.string(r))return t.Off;switch(r=r.toLowerCase(),r){case"off":return t.Off;case"messages":return t.Messages;case"verbose":return t.Verbose;default:return t.Off}}t.fromString=e;function n(r){switch(r){case t.Off:return"off";case t.Messages:return"messages";case t.Verbose:return"verbose";default:return"off"}}t.toString=n})(Et=ve.Trace||(ve.Trace={}));var Ir;(function(t){t.Text="text",t.JSON="json"})(Ir=ve.TraceFormat||(ve.TraceFormat={}));(function(t){function e(n){return n=n.toLowerCase(),n==="json"?t.JSON:t.Text}t.fromString=e})(Ir=ve.TraceFormat||(ve.TraceFormat={}));var c_;(function(t){t.type=new ye.NotificationType("$/setTrace")})(c_=ve.SetTraceNotification||(ve.SetTraceNotification={}));var pp;(function(t){t.type=new ye.NotificationType("$/logTrace")})(pp=ve.LogTraceNotification||(ve.LogTraceNotification={}));var Tu;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(Tu=ve.ConnectionErrors||(ve.ConnectionErrors={}));var Os=class extends Error{constructor(e,n){super(n);this.code=e,Object.setPrototypeOf(this,Os.prototype)}};ve.ConnectionError=Os;var f_;(function(t){function e(n){let r=n;return r&&Yt.func(r.cancelUndispatched)}t.is=e})(f_=ve.ConnectionStrategy||(ve.ConnectionStrategy={}));var dp;(function(t){t.Message=Object.freeze({createCancellationTokenSource(n){return new cp.CancellationTokenSource}});function e(n){let r=n;return r&&Yt.func(r.createCancellationTokenSource)}t.is=e})(dp=ve.CancellationReceiverStrategy||(ve.CancellationReceiverStrategy={}));var mp;(function(t){t.Message=Object.freeze({sendCancellation(n,r){n.sendNotification($a.type,{id:r})},cleanup(n){}});function e(n){let r=n;return r&&Yt.func(r.sendCancellation)&&Yt.func(r.cleanup)}t.is=e})(mp=ve.CancellationSenderStrategy||(ve.CancellationSenderStrategy={}));var hp;(function(t){t.Message=Object.freeze({receiver:dp.Message,sender:mp.Message});function e(n){let r=n;return r&&dp.is(r.receiver)&&mp.is(r.sender)}t.is=e})(hp=ve.CancellationStrategy||(ve.CancellationStrategy={}));var bR;(function(t){function e(n){let r=n;return r&&(hp.is(r.cancellationStrategy)||f_.is(r.connectionStrategy))}t.is=e})(bR=ve.ConnectionOptions||(ve.ConnectionOptions={}));var Sr;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(Sr||(Sr={}));function TR(t,e,n,r){let i=n!==void 0?n:ve.NullLogger,s=0,o=0,a=0,l="2.0",u,c=Object.create(null),f,m=Object.create(null),p=new Map,d,_=new l_.LinkedMap,C=Object.create(null),h=Object.create(null),b=Et.Off,g=Ir.Text,N,S=Sr.New,V=new Ka.Emitter,O=new Ka.Emitter,$=new Ka.Emitter,X=new Ka.Emitter,ee=new Ka.Emitter,Y=r&&r.cancellationStrategy?r.cancellationStrategy:hp.Message;function ne(P){if(P===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+P.toString()}function De(P){return P===null?"res-unknown-"+(++a).toString():"res-"+P.toString()}function de(){return"not-"+(++o).toString()}function Z(P,I){ye.isRequestMessage(I)?P.set(ne(I.id),I):ye.isResponseMessage(I)?P.set(De(I.id),I):P.set(de(),I)}function Ge(P){}function lt(){return S===Sr.Listening}function Ft(){return S===Sr.Closed}function Ve(){return S===Sr.Disposed}function ut(){(S===Sr.New||S===Sr.Listening)&&(S=Sr.Closed,O.fire(void 0))}function bi(P){V.fire([P,void 0,void 0])}function Yi(P){V.fire(P)}t.onClose(ut),t.onError(bi),e.onClose(ut),e.onError(Yi);function le(){d||_.size===0||(d=a_.default().timer.setImmediate(()=>{d=void 0,ue()}))}function ue(){if(_.size===0)return;let P=_.shift();try{ye.isRequestMessage(P)?se(P):ye.isNotificationMessage(P)?Nt(P):ye.isResponseMessage(P)?Ne(P):vr(P)}finally{le()}}let me=P=>{try{if(ye.isNotificationMessage(P)&&P.method===$a.type.method){let I=ne(P.params.id),y=_.get(I);if(ye.isRequestMessage(y)){let x=r==null?void 0:r.connectionStrategy,w=x&&x.cancelUndispatched?x.cancelUndispatched(y,Ge):void 0;if(w&&(w.error!==void 0||w.result!==void 0)){_.delete(I),w.id=y.id,ti(w,P.method,Date.now()),e.write(w);return}}}Z(_,P)}finally{le()}};function se(P){if(Ve())return;function I(F,ie,pe){let Oe={jsonrpc:l,id:P.id};F instanceof ye.ResponseError?Oe.error=F.toJson():Oe.result=F===void 0?null:F,ti(Oe,ie,pe),e.write(Oe)}function y(F,ie,pe){let Oe={jsonrpc:l,id:P.id,error:F.toJson()};ti(Oe,ie,pe),e.write(Oe)}function x(F,ie,pe){F===void 0&&(F=null);let Oe={jsonrpc:l,id:P.id,result:F};ti(Oe,ie,pe),e.write(Oe)}Rs(P);let w=c[P.method],R,T;w&&(R=w.type,T=w.handler);let L=Date.now();if(T||u){let F=String(P.id),ie=Y.receiver.createCancellationTokenSource(F);h[F]=ie;try{let pe;if(T)if(P.params===void 0){if(R!==void 0&&R.numberOfParams!==0){y(new ye.ResponseError(ye.ErrorCodes.InvalidParams,`Request ${P.method} defines ${R.numberOfParams} params but recevied none.`),P.method,L);return}pe=T(ie.token)}else if(Array.isArray(P.params)){if(R!==void 0&&R.parameterStructures===ye.ParameterStructures.byName){y(new ye.ResponseError(ye.ErrorCodes.InvalidParams,`Request ${P.method} defines parameters by name but received parameters by position`),P.method,L);return}pe=T(...P.params,ie.token)}else{if(R!==void 0&&R.parameterStructures===ye.ParameterStructures.byPosition){y(new ye.ResponseError(ye.ErrorCodes.InvalidParams,`Request ${P.method} defines parameters by position but received parameters by name`),P.method,L);return}pe=T(P.params,ie.token)}else u&&(pe=u(P.method,P.params,ie.token));let Oe=pe;pe?Oe.then?Oe.then(st=>{delete h[F],I(st,P.method,L)},st=>{delete h[F],st instanceof ye.ResponseError?y(st,P.method,L):st&&Yt.string(st.message)?y(new ye.ResponseError(ye.ErrorCodes.InternalError,`Request ${P.method} failed with message: ${st.message}`),P.method,L):y(new ye.ResponseError(ye.ErrorCodes.InternalError,`Request ${P.method} failed unexpectedly without providing any details.`),P.method,L)}):(delete h[F],I(pe,P.method,L)):(delete h[F],x(pe,P.method,L))}catch(pe){delete h[F],pe instanceof ye.ResponseError?I(pe,P.method,L):pe&&Yt.string(pe.message)?y(new ye.ResponseError(ye.ErrorCodes.InternalError,`Request ${P.method} failed with message: ${pe.message}`),P.method,L):y(new ye.ResponseError(ye.ErrorCodes.InternalError,`Request ${P.method} failed unexpectedly without providing any details.`),P.method,L)}}else y(new ye.ResponseError(ye.ErrorCodes.MethodNotFound,`Unhandled method ${P.method}`),P.method,L)}function Ne(P){if(!Ve())if(P.id===null)P.error?i.error(`Received response message without id: Error is: +${JSON.stringify(P.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let I=String(P.id),y=C[I];if(No(P,y),y){delete C[I];try{if(P.error){let x=P.error;y.reject(new ye.ResponseError(x.code,x.message,x.data))}else if(P.result!==void 0)y.resolve(P.result);else throw new Error("Should never happen.")}catch(x){x.message?i.error(`Response handler '${y.method}' failed with message: ${x.message}`):i.error(`Response handler '${y.method}' failed unexpectedly.`)}}}}function Nt(P){if(Ve())return;let I,y;if(P.method===$a.type.method)y=x=>{let w=x.id,R=h[String(w)];R&&R.cancel()};else{let x=m[P.method];x&&(y=x.handler,I=x.type)}if(y||f)try{To(P),y?P.params===void 0?(I!==void 0&&I.numberOfParams!==0&&I.parameterStructures!==ye.ParameterStructures.byName&&i.error(`Notification ${P.method} defines ${I.numberOfParams} params but recevied none.`),y()):Array.isArray(P.params)?(I!==void 0&&(I.parameterStructures===ye.ParameterStructures.byName&&i.error(`Notification ${P.method} defines parameters by name but received parameters by position`),I.numberOfParams!==P.params.length&&i.error(`Notification ${P.method} defines ${I.numberOfParams} params but received ${P.params.length} argumennts`)),y(...P.params)):(I!==void 0&&I.parameterStructures===ye.ParameterStructures.byPosition&&i.error(`Notification ${P.method} defines parameters by position but received parameters by name`),y(P.params)):f&&f(P.method,P.params)}catch(x){x.message?i.error(`Notification handler '${P.method}' failed with message: ${x.message}`):i.error(`Notification handler '${P.method}' failed unexpectedly.`)}else $.fire(P)}function vr(P){if(!P){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message: +${JSON.stringify(P,null,4)}`);let I=P;if(Yt.string(I.id)||Yt.number(I.id)){let y=String(I.id),x=C[y];x&&x.reject(new Error("The received response has neither a result nor an error property."))}}function yo(P){if(!(b===Et.Off||!N))if(g===Ir.Text){let I;b===Et.Verbose&&P.params&&(I=`Params: ${JSON.stringify(P.params,null,4)} -`),N.log(`Sending request '${v.method} - (${v.id})'.`,I)}else qn("send-request",v)}function bo(v){if(!(b===Et.Off||!N))if(g===Pr.Text){let I;b===Et.Verbose&&(v.params?I=`Params: ${JSON.stringify(v.params,null,4)} +`),N.log(`Sending request '${P.method} - (${P.id})'.`,I)}else qn("send-request",P)}function bo(P){if(!(b===Et.Off||!N))if(g===Ir.Text){let I;b===Et.Verbose&&(P.params?I=`Params: ${JSON.stringify(P.params,null,4)} `:I=`No parameters provided. -`),N.log(`Sending notification '${v.method}'.`,I)}else qn("send-notification",v)}function ti(v,I,y){if(!(b===Et.Off||!N))if(g===Pr.Text){let x;b===Et.Verbose&&(v.error&&v.error.data?x=`Error data: ${JSON.stringify(v.error.data,null,4)} +`),N.log(`Sending notification '${P.method}'.`,I)}else qn("send-notification",P)}function ti(P,I,y){if(!(b===Et.Off||!N))if(g===Ir.Text){let x;b===Et.Verbose&&(P.error&&P.error.data?x=`Error data: ${JSON.stringify(P.error.data,null,4)} -`:v.result?x=`Result: ${JSON.stringify(v.result,null,4)} +`:P.result?x=`Result: ${JSON.stringify(P.result,null,4)} -`:v.error===void 0&&(x=`No result returned. +`:P.error===void 0&&(x=`No result returned. -`)),N.log(`Sending response '${I} - (${v.id})'. Processing request took ${Date.now()-y}ms`,x)}else qn("send-response",v)}function Rs(v){if(!(b===Et.Off||!N))if(g===Pr.Text){let I;b===Et.Verbose&&v.params&&(I=`Params: ${JSON.stringify(v.params,null,4)} +`)),N.log(`Sending response '${I} - (${P.id})'. Processing request took ${Date.now()-y}ms`,x)}else qn("send-response",P)}function Rs(P){if(!(b===Et.Off||!N))if(g===Ir.Text){let I;b===Et.Verbose&&P.params&&(I=`Params: ${JSON.stringify(P.params,null,4)} -`),N.log(`Received request '${v.method} - (${v.id})'.`,I)}else qn("receive-request",v)}function To(v){if(!(b===Et.Off||!N||v.method===fp.type.method))if(g===Pr.Text){let I;b===Et.Verbose&&(v.params?I=`Params: ${JSON.stringify(v.params,null,4)} +`),N.log(`Received request '${P.method} - (${P.id})'.`,I)}else qn("receive-request",P)}function To(P){if(!(b===Et.Off||!N||P.method===pp.type.method))if(g===Ir.Text){let I;b===Et.Verbose&&(P.params?I=`Params: ${JSON.stringify(P.params,null,4)} `:I=`No parameters provided. -`),N.log(`Received notification '${v.method}'.`,I)}else qn("receive-notification",v)}function No(v,I){if(!(b===Et.Off||!N))if(g===Pr.Text){let y;if(b===Et.Verbose&&(v.error&&v.error.data?y=`Error data: ${JSON.stringify(v.error.data,null,4)} +`),N.log(`Received notification '${P.method}'.`,I)}else qn("receive-notification",P)}function No(P,I){if(!(b===Et.Off||!N))if(g===Ir.Text){let y;if(b===Et.Verbose&&(P.error&&P.error.data?y=`Error data: ${JSON.stringify(P.error.data,null,4)} -`:v.result?y=`Result: ${JSON.stringify(v.result,null,4)} +`:P.result?y=`Result: ${JSON.stringify(P.result,null,4)} -`:v.error===void 0&&(y=`No result returned. +`:P.error===void 0&&(y=`No result returned. -`)),I){let x=v.error?` Request failed: ${v.error.message} (${v.error.code}).`:"";N.log(`Received response '${I.method} - (${v.id})' in ${Date.now()-I.timerStart}ms.${x}`,y)}else N.log(`Received response ${v.id} without active response promise.`,y)}else qn("receive-response",v)}function qn(v,I){if(!N||b===Et.Off)return;let y={isLSPMessage:!0,type:v,message:I,timestamp:Date.now()};N.log(y)}function St(){if(Ft())throw new Os(bu.Closed,"Connection is closed.");if(Ve())throw new Os(bu.Disposed,"Connection is disposed.")}function Ti(){if(lt())throw new Os(bu.AlreadyListening,"Connection is already listening")}function Ki(){if(!lt())throw new Error("Call listen() first.")}function vr(v){return v===void 0?null:v}function Ni(v){if(v!==null)return v}function vi(v){return v!=null&&!Array.isArray(v)&&typeof v=="object"}function Pi(v,I){switch(v){case ye.ParameterStructures.auto:return vi(I)?Ni(I):[vr(I)];case ye.ParameterStructures.byName:if(!vi(I))throw new Error("Recevied parameters by name but param is not an object literal.");return Ni(I);case ye.ParameterStructures.byPosition:return[vr(I)];default:throw new Error(`Unknown parameter structure ${v.toString()}`)}}function ni(v,I){let y,x=v.numberOfParams;switch(x){case 0:y=void 0;break;case 1:y=Pi(v.parameterStructures,I[0]);break;default:y=[];for(let w=0;w{St();let y,x;if(Yt.string(v)){y=v;let R=I[0],T=0,L=ye.ParameterStructures.auto;ye.ParameterStructures.is(R)&&(T=1,L=R);let F=I.length,ie=F-T;switch(ie){case 0:x=void 0;break;case 1:x=Pi(L,I[T]);break;default:if(L===ye.ParameterStructures.byName)throw new Error(`Recevied ${ie} parameters for 'by Name' notification parameter structure.`);x=I.slice(T,F).map(pe=>vr(pe));break}}else{let R=I;y=v.method,x=ni(v,R)}let w={jsonrpc:l,method:y,params:x};bo(w),e.write(w)},onNotification:(v,I)=>{St();let y;return Yt.func(v)?f=v:I&&(Yt.string(v)?(y=v,m[v]={type:void 0,handler:I}):(y=v.method,m[v.method]={type:v,handler:I})),{dispose:()=>{y!==void 0?delete m[y]:f=void 0}}},onProgress:(v,I,y)=>{if(d.has(I))throw new Error(`Progress handler for token ${I} already registered`);return d.set(I,y),{dispose:()=>{d.delete(I)}}},sendProgress:(v,I,y)=>{nr.sendNotification(yu.type,{token:I,value:y})},onUnhandledProgress:X.event,sendRequest:(v,...I)=>{St(),Ki();let y,x,w;if(Yt.string(v)){y=v;let F=I[0],ie=I[I.length-1],pe=0,we=ye.ParameterStructures.auto;ye.ParameterStructures.is(F)&&(pe=1,we=F);let st=I.length;up.CancellationToken.is(ie)&&(st=st-1,w=ie);let Vt=st-pe;switch(Vt){case 0:x=void 0;break;case 1:x=Pi(we,I[pe]);break;default:if(we===ye.ParameterStructures.byName)throw new Error(`Recevied ${Vt} parameters for 'by Name' request parameter structure.`);x=I.slice(pe,st).map(Ht=>vr(Ht));break}}else{let F=I;y=v.method,x=ni(v,F);let ie=v.numberOfParams;w=up.CancellationToken.is(F[ie])?F[ie]:void 0}let R=s++,T;return w&&(T=w.onCancellationRequested(()=>{Y.sender.sendCancellation(nr,R)})),new Promise((F,ie)=>{let pe={jsonrpc:l,id:R,method:y,params:x},we=Ht=>{F(Ht),Y.sender.cleanup(R),T==null||T.dispose()},st=Ht=>{ie(Ht),Y.sender.cleanup(R),T==null||T.dispose()},Vt={method:y,timerStart:Date.now(),resolve:we,reject:st};yo(pe);try{e.write(pe)}catch(Ht){Vt.reject(new ye.ResponseError(ye.ErrorCodes.MessageWriteError,Ht.message?Ht.message:"Unknown reason")),Vt=null}Vt&&(C[String(R)]=Vt)})},onRequest:(v,I)=>{St();let y=null;return cp.is(v)?(y=void 0,u=v):Yt.string(v)?(y=null,I!==void 0&&(y=v,c[v]={handler:I,type:void 0})):I!==void 0&&(y=v.method,c[v.method]={type:v,handler:I}),{dispose:()=>{y!==null&&(y!==void 0?delete c[y]:u=void 0)}}},trace:(v,I,y)=>{let x=!1,w=Pr.Text;y!==void 0&&(Yt.boolean(y)?x=y:(x=y.sendNotification||!1,w=y.traceFormat||Pr.Text)),b=v,g=w,b===Et.Off?N=void 0:N=I,x&&!Ft()&&!Ve()&&nr.sendNotification(c_.type,{value:Et.toString(v)})},onError:V.event,onClose:O.event,onUnhandledNotification:$.event,onDispose:ee.event,end:()=>{e.end()},dispose:()=>{if(Ve())return;S=Ir.Disposed,ee.fire(void 0);let v=new Error("Connection got disposed.");Object.keys(C).forEach(I=>{C[I].reject(v)}),C=Object.create(null),h=Object.create(null),_=new l_.LinkedMap,Yt.func(e.dispose)&&e.dispose(),Yt.func(t.dispose)&&t.dispose()},listen:()=>{St(),Ti(),S=Ir.Listening,t.listen(me)},inspect:()=>{a_.default().console.log("inspect")}};return nr.onNotification(fp.type,v=>{b===Et.Off||!N||N.log(v.message,b===Et.Verbose?v.verbose:void 0)}),nr.onNotification(yu.type,v=>{let I=d.get(v.token);I?I(v.value):X.fire(v)}),nr}ve.createMessageConnection=yR});var _p=K(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.CancellationSenderStrategy=U.CancellationReceiverStrategy=U.ConnectionError=U.ConnectionErrors=U.LogTraceNotification=U.SetTraceNotification=U.TraceFormat=U.Trace=U.ProgressType=U.createMessageConnection=U.NullLogger=U.ConnectionOptions=U.ConnectionStrategy=U.WriteableStreamMessageWriter=U.AbstractMessageWriter=U.MessageWriter=U.ReadableStreamMessageReader=U.AbstractMessageReader=U.MessageReader=U.CancellationToken=U.CancellationTokenSource=U.Emitter=U.Event=U.Disposable=U.ParameterStructures=U.NotificationType9=U.NotificationType8=U.NotificationType7=U.NotificationType6=U.NotificationType5=U.NotificationType4=U.NotificationType3=U.NotificationType2=U.NotificationType1=U.NotificationType0=U.NotificationType=U.ErrorCodes=U.ResponseError=U.RequestType9=U.RequestType8=U.RequestType7=U.RequestType6=U.RequestType5=U.RequestType4=U.RequestType3=U.RequestType2=U.RequestType1=U.RequestType0=U.RequestType=U.RAL=void 0;U.CancellationStrategy=void 0;var ct=Jf();Object.defineProperty(U,"RequestType",{enumerable:!0,get:function(){return ct.RequestType}});Object.defineProperty(U,"RequestType0",{enumerable:!0,get:function(){return ct.RequestType0}});Object.defineProperty(U,"RequestType1",{enumerable:!0,get:function(){return ct.RequestType1}});Object.defineProperty(U,"RequestType2",{enumerable:!0,get:function(){return ct.RequestType2}});Object.defineProperty(U,"RequestType3",{enumerable:!0,get:function(){return ct.RequestType3}});Object.defineProperty(U,"RequestType4",{enumerable:!0,get:function(){return ct.RequestType4}});Object.defineProperty(U,"RequestType5",{enumerable:!0,get:function(){return ct.RequestType5}});Object.defineProperty(U,"RequestType6",{enumerable:!0,get:function(){return ct.RequestType6}});Object.defineProperty(U,"RequestType7",{enumerable:!0,get:function(){return ct.RequestType7}});Object.defineProperty(U,"RequestType8",{enumerable:!0,get:function(){return ct.RequestType8}});Object.defineProperty(U,"RequestType9",{enumerable:!0,get:function(){return ct.RequestType9}});Object.defineProperty(U,"ResponseError",{enumerable:!0,get:function(){return ct.ResponseError}});Object.defineProperty(U,"ErrorCodes",{enumerable:!0,get:function(){return ct.ErrorCodes}});Object.defineProperty(U,"NotificationType",{enumerable:!0,get:function(){return ct.NotificationType}});Object.defineProperty(U,"NotificationType0",{enumerable:!0,get:function(){return ct.NotificationType0}});Object.defineProperty(U,"NotificationType1",{enumerable:!0,get:function(){return ct.NotificationType1}});Object.defineProperty(U,"NotificationType2",{enumerable:!0,get:function(){return ct.NotificationType2}});Object.defineProperty(U,"NotificationType3",{enumerable:!0,get:function(){return ct.NotificationType3}});Object.defineProperty(U,"NotificationType4",{enumerable:!0,get:function(){return ct.NotificationType4}});Object.defineProperty(U,"NotificationType5",{enumerable:!0,get:function(){return ct.NotificationType5}});Object.defineProperty(U,"NotificationType6",{enumerable:!0,get:function(){return ct.NotificationType6}});Object.defineProperty(U,"NotificationType7",{enumerable:!0,get:function(){return ct.NotificationType7}});Object.defineProperty(U,"NotificationType8",{enumerable:!0,get:function(){return ct.NotificationType8}});Object.defineProperty(U,"NotificationType9",{enumerable:!0,get:function(){return ct.NotificationType9}});Object.defineProperty(U,"ParameterStructures",{enumerable:!0,get:function(){return ct.ParameterStructures}});var bR=zf();Object.defineProperty(U,"Disposable",{enumerable:!0,get:function(){return bR.Disposable}});var d_=Io();Object.defineProperty(U,"Event",{enumerable:!0,get:function(){return d_.Event}});Object.defineProperty(U,"Emitter",{enumerable:!0,get:function(){return d_.Emitter}});var m_=np();Object.defineProperty(U,"CancellationTokenSource",{enumerable:!0,get:function(){return m_.CancellationTokenSource}});Object.defineProperty(U,"CancellationToken",{enumerable:!0,get:function(){return m_.CancellationToken}});var hp=Qg();Object.defineProperty(U,"MessageReader",{enumerable:!0,get:function(){return hp.MessageReader}});Object.defineProperty(U,"AbstractMessageReader",{enumerable:!0,get:function(){return hp.AbstractMessageReader}});Object.defineProperty(U,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return hp.ReadableStreamMessageReader}});var gp=i_();Object.defineProperty(U,"MessageWriter",{enumerable:!0,get:function(){return gp.MessageWriter}});Object.defineProperty(U,"AbstractMessageWriter",{enumerable:!0,get:function(){return gp.AbstractMessageWriter}});Object.defineProperty(U,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return gp.WriteableStreamMessageWriter}});var On=p_();Object.defineProperty(U,"ConnectionStrategy",{enumerable:!0,get:function(){return On.ConnectionStrategy}});Object.defineProperty(U,"ConnectionOptions",{enumerable:!0,get:function(){return On.ConnectionOptions}});Object.defineProperty(U,"NullLogger",{enumerable:!0,get:function(){return On.NullLogger}});Object.defineProperty(U,"createMessageConnection",{enumerable:!0,get:function(){return On.createMessageConnection}});Object.defineProperty(U,"ProgressType",{enumerable:!0,get:function(){return On.ProgressType}});Object.defineProperty(U,"Trace",{enumerable:!0,get:function(){return On.Trace}});Object.defineProperty(U,"TraceFormat",{enumerable:!0,get:function(){return On.TraceFormat}});Object.defineProperty(U,"SetTraceNotification",{enumerable:!0,get:function(){return On.SetTraceNotification}});Object.defineProperty(U,"LogTraceNotification",{enumerable:!0,get:function(){return On.LogTraceNotification}});Object.defineProperty(U,"ConnectionErrors",{enumerable:!0,get:function(){return On.ConnectionErrors}});Object.defineProperty(U,"ConnectionError",{enumerable:!0,get:function(){return On.ConnectionError}});Object.defineProperty(U,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return On.CancellationReceiverStrategy}});Object.defineProperty(U,"CancellationSenderStrategy",{enumerable:!0,get:function(){return On.CancellationSenderStrategy}});Object.defineProperty(U,"CancellationStrategy",{enumerable:!0,get:function(){return On.CancellationStrategy}});var TR=Ii();U.RAL=TR.default});var xo=K($e=>{"use strict";var NR=$e&&$e.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),vR=$e&&$e.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&NR(e,t,n)};Object.defineProperty($e,"__esModule",{value:!0});$e.createMessageConnection=$e.createServerSocketTransport=$e.createClientSocketTransport=$e.createServerPipeTransport=$e.createClientPipeTransport=$e.generateRandomPipeName=$e.StreamMessageWriter=$e.StreamMessageReader=$e.SocketMessageWriter=$e.SocketMessageReader=$e.IPCMessageWriter=$e.IPCMessageReader=void 0;var Co=Ng();Co.default.install();var ri=_p(),h_=require("path"),PR=require("os"),IR=require("crypto"),Tu=require("net");vR(_p(),$e);var g_=class extends ri.AbstractMessageReader{constructor(e){super();this.process=e;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),ri.Disposable.create(()=>this.process.off("message",e))}};$e.IPCMessageReader=g_;var __=class extends ri.AbstractMessageWriter{constructor(e){super();this.process=e,this.errorCount=0;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,n=>{n?(this.errorCount++,this.handleError(n,e)):this.errorCount=0}),Promise.resolve()}catch(n){return this.handleError(n,e),Promise.reject(n)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){}};$e.IPCMessageWriter=__;var Ro=class extends ri.ReadableStreamMessageReader{constructor(e,n="utf-8"){super(Co.default().stream.asReadableStream(e),n)}};$e.SocketMessageReader=Ro;var Ao=class extends ri.WriteableStreamMessageWriter{constructor(e,n){super(Co.default().stream.asWritableStream(e),n);this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};$e.SocketMessageWriter=Ao;var yp=class extends ri.ReadableStreamMessageReader{constructor(e,n){super(Co.default().stream.asReadableStream(e),n)}};$e.StreamMessageReader=yp;var bp=class extends ri.WriteableStreamMessageWriter{constructor(e,n){super(Co.default().stream.asWritableStream(e),n)}};$e.StreamMessageWriter=bp;var y_=process.env.XDG_RUNTIME_DIR,SR=new Map([["linux",107],["darwin",103]]);function CR(){let t=IR.randomBytes(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;y_?e=h_.join(y_,`vscode-ipc-${t}.sock`):e=h_.join(PR.tmpdir(),`vscode-${t}.sock`);let n=SR.get(process.platform);return n!==void 0&&e.length>=n&&Co.default().console.warn(`WARNING: IPC handle "${e}" is longer than ${n} characters.`),e}$e.generateRandomPipeName=CR;function RR(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=Tu.createServer(a=>{o.close(),n([new Ro(a,e),new Ao(a,e)])});o.on("error",s),o.listen(t,()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}$e.createClientPipeTransport=RR;function AR(t,e="utf-8"){let n=Tu.createConnection(t);return[new Ro(n,e),new Ao(n,e)]}$e.createServerPipeTransport=AR;function xR(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=Tu.createServer(a=>{o.close(),n([new Ro(a,e),new Ao(a,e)])});o.on("error",s),o.listen(t,"127.0.0.1",()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}$e.createClientSocketTransport=xR;function ER(t,e="utf-8"){let n=Tu.createConnection(t,"127.0.0.1");return[new Ro(n,e),new Ao(n,e)]}$e.createServerSocketTransport=ER;function wR(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function OR(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function LR(t,e,n,r){n||(n=ri.NullLogger);let i=wR(t)?new yp(t):t,s=OR(e)?new bp(e):e;return ri.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),ri.createMessageConnection(i,s,n,r)}$e.createMessageConnection=LR});var Tp=K((lV,b_)=>{"use strict";b_.exports=xo()});var ot=K((T_,Nu)=>{(function(t){if(typeof Nu=="object"&&typeof Nu.exports=="object"){var e=t(require,T_);e!==void 0&&(Nu.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],t)})(function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=e.EOL=e.SelectionRange=e.DocumentLink=e.FormattingOptions=e.CodeLens=e.CodeAction=e.CodeActionContext=e.CodeActionKind=e.DocumentSymbol=e.SymbolInformation=e.SymbolTag=e.SymbolKind=e.DocumentHighlight=e.DocumentHighlightKind=e.SignatureInformation=e.ParameterInformation=e.Hover=e.MarkedString=e.CompletionList=e.CompletionItem=e.InsertTextMode=e.InsertReplaceEdit=e.CompletionItemTag=e.InsertTextFormat=e.CompletionItemKind=e.MarkupContent=e.MarkupKind=e.TextDocumentItem=e.OptionalVersionedTextDocumentIdentifier=e.VersionedTextDocumentIdentifier=e.TextDocumentIdentifier=e.WorkspaceChange=e.WorkspaceEdit=e.DeleteFile=e.RenameFile=e.CreateFile=e.TextDocumentEdit=e.AnnotatedTextEdit=e.ChangeAnnotationIdentifier=e.ChangeAnnotation=e.TextEdit=e.Command=e.Diagnostic=e.CodeDescription=e.DiagnosticTag=e.DiagnosticSeverity=e.DiagnosticRelatedInformation=e.FoldingRange=e.FoldingRangeKind=e.ColorPresentation=e.ColorInformation=e.Color=e.LocationLink=e.Location=e.Range=e.Position=e.uinteger=e.integer=void 0;var n;(function(y){y.MIN_VALUE=-2147483648,y.MAX_VALUE=2147483647})(n=e.integer||(e.integer={}));var r;(function(y){y.MIN_VALUE=0,y.MAX_VALUE=2147483647})(r=e.uinteger||(e.uinteger={}));var i;(function(y){function x(R,T){return R===Number.MAX_VALUE&&(R=r.MAX_VALUE),T===Number.MAX_VALUE&&(T=r.MAX_VALUE),{line:R,character:T}}y.create=x;function w(R){var T=R;return I.objectLiteral(T)&&I.uinteger(T.line)&&I.uinteger(T.character)}y.is=w})(i=e.Position||(e.Position={}));var s;(function(y){function x(R,T,L,F){if(I.uinteger(R)&&I.uinteger(T)&&I.uinteger(L)&&I.uinteger(F))return{start:i.create(R,T),end:i.create(L,F)};if(i.is(R)&&i.is(T))return{start:R,end:T};throw new Error("Range#create called with invalid arguments["+R+", "+T+", "+L+", "+F+"]")}y.create=x;function w(R){var T=R;return I.objectLiteral(T)&&i.is(T.start)&&i.is(T.end)}y.is=w})(s=e.Range||(e.Range={}));var o;(function(y){function x(R,T){return{uri:R,range:T}}y.create=x;function w(R){var T=R;return I.defined(T)&&s.is(T.range)&&(I.string(T.uri)||I.undefined(T.uri))}y.is=w})(o=e.Location||(e.Location={}));var a;(function(y){function x(R,T,L,F){return{targetUri:R,targetRange:T,targetSelectionRange:L,originSelectionRange:F}}y.create=x;function w(R){var T=R;return I.defined(T)&&s.is(T.targetRange)&&I.string(T.targetUri)&&(s.is(T.targetSelectionRange)||I.undefined(T.targetSelectionRange))&&(s.is(T.originSelectionRange)||I.undefined(T.originSelectionRange))}y.is=w})(a=e.LocationLink||(e.LocationLink={}));var l;(function(y){function x(R,T,L,F){return{red:R,green:T,blue:L,alpha:F}}y.create=x;function w(R){var T=R;return I.numberRange(T.red,0,1)&&I.numberRange(T.green,0,1)&&I.numberRange(T.blue,0,1)&&I.numberRange(T.alpha,0,1)}y.is=w})(l=e.Color||(e.Color={}));var u;(function(y){function x(R,T){return{range:R,color:T}}y.create=x;function w(R){var T=R;return s.is(T.range)&&l.is(T.color)}y.is=w})(u=e.ColorInformation||(e.ColorInformation={}));var c;(function(y){function x(R,T,L){return{label:R,textEdit:T,additionalTextEdits:L}}y.create=x;function w(R){var T=R;return I.string(T.label)&&(I.undefined(T.textEdit)||g.is(T))&&(I.undefined(T.additionalTextEdits)||I.typedArray(T.additionalTextEdits,g.is))}y.is=w})(c=e.ColorPresentation||(e.ColorPresentation={}));var f;(function(y){y.Comment="comment",y.Imports="imports",y.Region="region"})(f=e.FoldingRangeKind||(e.FoldingRangeKind={}));var m;(function(y){function x(R,T,L,F,ie){var pe={startLine:R,endLine:T};return I.defined(L)&&(pe.startCharacter=L),I.defined(F)&&(pe.endCharacter=F),I.defined(ie)&&(pe.kind=ie),pe}y.create=x;function w(R){var T=R;return I.uinteger(T.startLine)&&I.uinteger(T.startLine)&&(I.undefined(T.startCharacter)||I.uinteger(T.startCharacter))&&(I.undefined(T.endCharacter)||I.uinteger(T.endCharacter))&&(I.undefined(T.kind)||I.string(T.kind))}y.is=w})(m=e.FoldingRange||(e.FoldingRange={}));var d;(function(y){function x(R,T){return{location:R,message:T}}y.create=x;function w(R){var T=R;return I.defined(T)&&o.is(T.location)&&I.string(T.message)}y.is=w})(d=e.DiagnosticRelatedInformation||(e.DiagnosticRelatedInformation={}));var p;(function(y){y.Error=1,y.Warning=2,y.Information=3,y.Hint=4})(p=e.DiagnosticSeverity||(e.DiagnosticSeverity={}));var _;(function(y){y.Unnecessary=1,y.Deprecated=2})(_=e.DiagnosticTag||(e.DiagnosticTag={}));var C;(function(y){function x(w){var R=w;return R!=null&&I.string(R.href)}y.is=x})(C=e.CodeDescription||(e.CodeDescription={}));var h;(function(y){function x(R,T,L,F,ie,pe){var we={range:R,message:T};return I.defined(L)&&(we.severity=L),I.defined(F)&&(we.code=F),I.defined(ie)&&(we.source=ie),I.defined(pe)&&(we.relatedInformation=pe),we}y.create=x;function w(R){var T,L=R;return I.defined(L)&&s.is(L.range)&&I.string(L.message)&&(I.number(L.severity)||I.undefined(L.severity))&&(I.integer(L.code)||I.string(L.code)||I.undefined(L.code))&&(I.undefined(L.codeDescription)||I.string((T=L.codeDescription)===null||T===void 0?void 0:T.href))&&(I.string(L.source)||I.undefined(L.source))&&(I.undefined(L.relatedInformation)||I.typedArray(L.relatedInformation,d.is))}y.is=w})(h=e.Diagnostic||(e.Diagnostic={}));var b;(function(y){function x(R,T){for(var L=[],F=2;F0&&(ie.arguments=L),ie}y.create=x;function w(R){var T=R;return I.defined(T)&&I.string(T.title)&&I.string(T.command)}y.is=w})(b=e.Command||(e.Command={}));var g;(function(y){function x(L,F){return{range:L,newText:F}}y.replace=x;function w(L,F){return{range:{start:L,end:L},newText:F}}y.insert=w;function R(L){return{range:L,newText:""}}y.del=R;function T(L){var F=L;return I.objectLiteral(F)&&I.string(F.newText)&&s.is(F.range)}y.is=T})(g=e.TextEdit||(e.TextEdit={}));var N;(function(y){function x(R,T,L){var F={label:R};return T!==void 0&&(F.needsConfirmation=T),L!==void 0&&(F.description=L),F}y.create=x;function w(R){var T=R;return T!==void 0&&I.objectLiteral(T)&&I.string(T.label)&&(I.boolean(T.needsConfirmation)||T.needsConfirmation===void 0)&&(I.string(T.description)||T.description===void 0)}y.is=w})(N=e.ChangeAnnotation||(e.ChangeAnnotation={}));var S;(function(y){function x(w){var R=w;return typeof R=="string"}y.is=x})(S=e.ChangeAnnotationIdentifier||(e.ChangeAnnotationIdentifier={}));var V;(function(y){function x(L,F,ie){return{range:L,newText:F,annotationId:ie}}y.replace=x;function w(L,F,ie){return{range:{start:L,end:L},newText:F,annotationId:ie}}y.insert=w;function R(L,F){return{range:L,newText:"",annotationId:F}}y.del=R;function T(L){var F=L;return g.is(F)&&(N.is(F.annotationId)||S.is(F.annotationId))}y.is=T})(V=e.AnnotatedTextEdit||(e.AnnotatedTextEdit={}));var O;(function(y){function x(R,T){return{textDocument:R,edits:T}}y.create=x;function w(R){var T=R;return I.defined(T)&<.is(T.textDocument)&&Array.isArray(T.edits)}y.is=w})(O=e.TextDocumentEdit||(e.TextDocumentEdit={}));var $;(function(y){function x(R,T,L){var F={kind:"create",uri:R};return T!==void 0&&(T.overwrite!==void 0||T.ignoreIfExists!==void 0)&&(F.options=T),L!==void 0&&(F.annotationId=L),F}y.create=x;function w(R){var T=R;return T&&T.kind==="create"&&I.string(T.uri)&&(T.options===void 0||(T.options.overwrite===void 0||I.boolean(T.options.overwrite))&&(T.options.ignoreIfExists===void 0||I.boolean(T.options.ignoreIfExists)))&&(T.annotationId===void 0||S.is(T.annotationId))}y.is=w})($=e.CreateFile||(e.CreateFile={}));var X;(function(y){function x(R,T,L,F){var ie={kind:"rename",oldUri:R,newUri:T};return L!==void 0&&(L.overwrite!==void 0||L.ignoreIfExists!==void 0)&&(ie.options=L),F!==void 0&&(ie.annotationId=F),ie}y.create=x;function w(R){var T=R;return T&&T.kind==="rename"&&I.string(T.oldUri)&&I.string(T.newUri)&&(T.options===void 0||(T.options.overwrite===void 0||I.boolean(T.options.overwrite))&&(T.options.ignoreIfExists===void 0||I.boolean(T.options.ignoreIfExists)))&&(T.annotationId===void 0||S.is(T.annotationId))}y.is=w})(X=e.RenameFile||(e.RenameFile={}));var ee;(function(y){function x(R,T,L){var F={kind:"delete",uri:R};return T!==void 0&&(T.recursive!==void 0||T.ignoreIfNotExists!==void 0)&&(F.options=T),L!==void 0&&(F.annotationId=L),F}y.create=x;function w(R){var T=R;return T&&T.kind==="delete"&&I.string(T.uri)&&(T.options===void 0||(T.options.recursive===void 0||I.boolean(T.options.recursive))&&(T.options.ignoreIfNotExists===void 0||I.boolean(T.options.ignoreIfNotExists)))&&(T.annotationId===void 0||S.is(T.annotationId))}y.is=w})(ee=e.DeleteFile||(e.DeleteFile={}));var Y;(function(y){function x(w){var R=w;return R&&(R.changes!==void 0||R.documentChanges!==void 0)&&(R.documentChanges===void 0||R.documentChanges.every(function(T){return I.string(T.kind)?$.is(T)||X.is(T)||ee.is(T):O.is(T)}))}y.is=x})(Y=e.WorkspaceEdit||(e.WorkspaceEdit={}));var ne=function(){function y(x,w){this.edits=x,this.changeAnnotations=w}return y.prototype.insert=function(x,w,R){var T,L;if(R===void 0?T=g.insert(x,w):S.is(R)?(L=R,T=V.insert(x,w,R)):(this.assertChangeAnnotations(this.changeAnnotations),L=this.changeAnnotations.manage(R),T=V.insert(x,w,L)),this.edits.push(T),L!==void 0)return L},y.prototype.replace=function(x,w,R){var T,L;if(R===void 0?T=g.replace(x,w):S.is(R)?(L=R,T=V.replace(x,w,R)):(this.assertChangeAnnotations(this.changeAnnotations),L=this.changeAnnotations.manage(R),T=V.replace(x,w,L)),this.edits.push(T),L!==void 0)return L},y.prototype.delete=function(x,w){var R,T;if(w===void 0?R=g.del(x):S.is(w)?(T=w,R=V.del(x,w)):(this.assertChangeAnnotations(this.changeAnnotations),T=this.changeAnnotations.manage(w),R=V.del(x,T)),this.edits.push(R),T!==void 0)return T},y.prototype.add=function(x){this.edits.push(x)},y.prototype.all=function(){return this.edits},y.prototype.clear=function(){this.edits.splice(0,this.edits.length)},y.prototype.assertChangeAnnotations=function(x){if(x===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},y}(),Le=function(){function y(x){this._annotations=x===void 0?Object.create(null):x,this._counter=0,this._size=0}return y.prototype.all=function(){return this._annotations},Object.defineProperty(y.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),y.prototype.manage=function(x,w){var R;if(S.is(x)?R=x:(R=this.nextId(),w=x),this._annotations[R]!==void 0)throw new Error("Id "+R+" is already in use.");if(w===void 0)throw new Error("No annotation provided for id "+R);return this._annotations[R]=w,this._size++,R},y.prototype.nextId=function(){return this._counter++,this._counter.toString()},y}(),de=function(){function y(x){var w=this;this._textEditChanges=Object.create(null),x!==void 0?(this._workspaceEdit=x,x.documentChanges?(this._changeAnnotations=new Le(x.changeAnnotations),x.changeAnnotations=this._changeAnnotations.all(),x.documentChanges.forEach(function(R){if(O.is(R)){var T=new ne(R.edits,w._changeAnnotations);w._textEditChanges[R.textDocument.uri]=T}})):x.changes&&Object.keys(x.changes).forEach(function(R){var T=new ne(x.changes[R]);w._textEditChanges[R]=T})):this._workspaceEdit={}}return Object.defineProperty(y.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),y.prototype.getTextEditChange=function(x){if(lt.is(x)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var w={uri:x.uri,version:x.version},R=this._textEditChanges[w.uri];if(!R){var T=[],L={textDocument:w,edits:T};this._workspaceEdit.documentChanges.push(L),R=new ne(T,this._changeAnnotations),this._textEditChanges[w.uri]=R}return R}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var R=this._textEditChanges[x];if(!R){var T=[];this._workspaceEdit.changes[x]=T,R=new ne(T),this._textEditChanges[x]=R}return R}},y.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Le,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},y.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},y.prototype.createFile=function(x,w,R){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var T;N.is(w)||S.is(w)?T=w:R=w;var L,F;if(T===void 0?L=$.create(x,R):(F=S.is(T)?T:this._changeAnnotations.manage(T),L=$.create(x,R,F)),this._workspaceEdit.documentChanges.push(L),F!==void 0)return F},y.prototype.renameFile=function(x,w,R,T){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var L;N.is(R)||S.is(R)?L=R:T=R;var F,ie;if(L===void 0?F=X.create(x,w,T):(ie=S.is(L)?L:this._changeAnnotations.manage(L),F=X.create(x,w,T,ie)),this._workspaceEdit.documentChanges.push(F),ie!==void 0)return ie},y.prototype.deleteFile=function(x,w,R){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var T;N.is(w)||S.is(w)?T=w:R=w;var L,F;if(T===void 0?L=ee.create(x,R):(F=S.is(T)?T:this._changeAnnotations.manage(T),L=ee.create(x,R,F)),this._workspaceEdit.documentChanges.push(L),F!==void 0)return F},y}();e.WorkspaceChange=de;var Z;(function(y){function x(R){return{uri:R}}y.create=x;function w(R){var T=R;return I.defined(T)&&I.string(T.uri)}y.is=w})(Z=e.TextDocumentIdentifier||(e.TextDocumentIdentifier={}));var Ge;(function(y){function x(R,T){return{uri:R,version:T}}y.create=x;function w(R){var T=R;return I.defined(T)&&I.string(T.uri)&&I.integer(T.version)}y.is=w})(Ge=e.VersionedTextDocumentIdentifier||(e.VersionedTextDocumentIdentifier={}));var lt;(function(y){function x(R,T){return{uri:R,version:T}}y.create=x;function w(R){var T=R;return I.defined(T)&&I.string(T.uri)&&(T.version===null||I.integer(T.version))}y.is=w})(lt=e.OptionalVersionedTextDocumentIdentifier||(e.OptionalVersionedTextDocumentIdentifier={}));var Ft;(function(y){function x(R,T,L,F){return{uri:R,languageId:T,version:L,text:F}}y.create=x;function w(R){var T=R;return I.defined(T)&&I.string(T.uri)&&I.string(T.languageId)&&I.integer(T.version)&&I.string(T.text)}y.is=w})(Ft=e.TextDocumentItem||(e.TextDocumentItem={}));var Ve;(function(y){y.PlainText="plaintext",y.Markdown="markdown"})(Ve=e.MarkupKind||(e.MarkupKind={})),function(y){function x(w){var R=w;return R===y.PlainText||R===y.Markdown}y.is=x}(Ve=e.MarkupKind||(e.MarkupKind={}));var ut;(function(y){function x(w){var R=w;return I.objectLiteral(w)&&Ve.is(R.kind)&&I.string(R.value)}y.is=x})(ut=e.MarkupContent||(e.MarkupContent={}));var bi;(function(y){y.Text=1,y.Method=2,y.Function=3,y.Constructor=4,y.Field=5,y.Variable=6,y.Class=7,y.Interface=8,y.Module=9,y.Property=10,y.Unit=11,y.Value=12,y.Enum=13,y.Keyword=14,y.Snippet=15,y.Color=16,y.File=17,y.Reference=18,y.Folder=19,y.EnumMember=20,y.Constant=21,y.Struct=22,y.Event=23,y.Operator=24,y.TypeParameter=25})(bi=e.CompletionItemKind||(e.CompletionItemKind={}));var Yi;(function(y){y.PlainText=1,y.Snippet=2})(Yi=e.InsertTextFormat||(e.InsertTextFormat={}));var le;(function(y){y.Deprecated=1})(le=e.CompletionItemTag||(e.CompletionItemTag={}));var ue;(function(y){function x(R,T,L){return{newText:R,insert:T,replace:L}}y.create=x;function w(R){var T=R;return T&&I.string(T.newText)&&s.is(T.insert)&&s.is(T.replace)}y.is=w})(ue=e.InsertReplaceEdit||(e.InsertReplaceEdit={}));var me;(function(y){y.asIs=1,y.adjustIndentation=2})(me=e.InsertTextMode||(e.InsertTextMode={}));var se;(function(y){function x(w){return{label:w}}y.create=x})(se=e.CompletionItem||(e.CompletionItem={}));var Ne;(function(y){function x(w,R){return{items:w||[],isIncomplete:!!R}}y.create=x})(Ne=e.CompletionList||(e.CompletionList={}));var Nt;(function(y){function x(R){return R.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}y.fromPlainText=x;function w(R){var T=R;return I.string(T)||I.objectLiteral(T)&&I.string(T.language)&&I.string(T.value)}y.is=w})(Nt=e.MarkedString||(e.MarkedString={}));var Nr;(function(y){function x(w){var R=w;return!!R&&I.objectLiteral(R)&&(ut.is(R.contents)||Nt.is(R.contents)||I.typedArray(R.contents,Nt.is))&&(w.range===void 0||s.is(w.range))}y.is=x})(Nr=e.Hover||(e.Hover={}));var yo;(function(y){function x(w,R){return R?{label:w,documentation:R}:{label:w}}y.create=x})(yo=e.ParameterInformation||(e.ParameterInformation={}));var bo;(function(y){function x(w,R){for(var T=[],L=2;L{St();let y,x;if(Yt.string(P)){y=P;let R=I[0],T=0,L=ye.ParameterStructures.auto;ye.ParameterStructures.is(R)&&(T=1,L=R);let F=I.length,ie=F-T;switch(ie){case 0:x=void 0;break;case 1:x=Pi(L,I[T]);break;default:if(L===ye.ParameterStructures.byName)throw new Error(`Recevied ${ie} parameters for 'by Name' notification parameter structure.`);x=I.slice(T,F).map(pe=>Pr(pe));break}}else{let R=I;y=P.method,x=ni(P,R)}let w={jsonrpc:l,method:y,params:x};bo(w),e.write(w)},onNotification:(P,I)=>{St();let y;return Yt.func(P)?f=P:I&&(Yt.string(P)?(y=P,m[P]={type:void 0,handler:I}):(y=P.method,m[P.method]={type:P,handler:I})),{dispose:()=>{y!==void 0?delete m[y]:f=void 0}}},onProgress:(P,I,y)=>{if(p.has(I))throw new Error(`Progress handler for token ${I} already registered`);return p.set(I,y),{dispose:()=>{p.delete(I)}}},sendProgress:(P,I,y)=>{nr.sendNotification(bu.type,{token:I,value:y})},onUnhandledProgress:X.event,sendRequest:(P,...I)=>{St(),Ki();let y,x,w;if(Yt.string(P)){y=P;let F=I[0],ie=I[I.length-1],pe=0,Oe=ye.ParameterStructures.auto;ye.ParameterStructures.is(F)&&(pe=1,Oe=F);let st=I.length;cp.CancellationToken.is(ie)&&(st=st-1,w=ie);let Vt=st-pe;switch(Vt){case 0:x=void 0;break;case 1:x=Pi(Oe,I[pe]);break;default:if(Oe===ye.ParameterStructures.byName)throw new Error(`Recevied ${Vt} parameters for 'by Name' request parameter structure.`);x=I.slice(pe,st).map(Ht=>Pr(Ht));break}}else{let F=I;y=P.method,x=ni(P,F);let ie=P.numberOfParams;w=cp.CancellationToken.is(F[ie])?F[ie]:void 0}let R=s++,T;return w&&(T=w.onCancellationRequested(()=>{Y.sender.sendCancellation(nr,R)})),new Promise((F,ie)=>{let pe={jsonrpc:l,id:R,method:y,params:x},Oe=Ht=>{F(Ht),Y.sender.cleanup(R),T==null||T.dispose()},st=Ht=>{ie(Ht),Y.sender.cleanup(R),T==null||T.dispose()},Vt={method:y,timerStart:Date.now(),resolve:Oe,reject:st};yo(pe);try{e.write(pe)}catch(Ht){Vt.reject(new ye.ResponseError(ye.ErrorCodes.MessageWriteError,Ht.message?Ht.message:"Unknown reason")),Vt=null}Vt&&(C[String(R)]=Vt)})},onRequest:(P,I)=>{St();let y=null;return fp.is(P)?(y=void 0,u=P):Yt.string(P)?(y=null,I!==void 0&&(y=P,c[P]={handler:I,type:void 0})):I!==void 0&&(y=P.method,c[P.method]={type:P,handler:I}),{dispose:()=>{y!==null&&(y!==void 0?delete c[y]:u=void 0)}}},trace:(P,I,y)=>{let x=!1,w=Ir.Text;y!==void 0&&(Yt.boolean(y)?x=y:(x=y.sendNotification||!1,w=y.traceFormat||Ir.Text)),b=P,g=w,b===Et.Off?N=void 0:N=I,x&&!Ft()&&!Ve()&&nr.sendNotification(c_.type,{value:Et.toString(P)})},onError:V.event,onClose:O.event,onUnhandledNotification:$.event,onDispose:ee.event,end:()=>{e.end()},dispose:()=>{if(Ve())return;S=Sr.Disposed,ee.fire(void 0);let P=new Error("Connection got disposed.");Object.keys(C).forEach(I=>{C[I].reject(P)}),C=Object.create(null),h=Object.create(null),_=new l_.LinkedMap,Yt.func(e.dispose)&&e.dispose(),Yt.func(t.dispose)&&t.dispose()},listen:()=>{St(),Ti(),S=Sr.Listening,t.listen(me)},inspect:()=>{a_.default().console.log("inspect")}};return nr.onNotification(pp.type,P=>{b===Et.Off||!N||N.log(P.message,b===Et.Verbose?P.verbose:void 0)}),nr.onNotification(bu.type,P=>{let I=p.get(P.token);I?I(P.value):X.fire(P)}),nr}ve.createMessageConnection=TR});var yp=K(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.CancellationSenderStrategy=U.CancellationReceiverStrategy=U.ConnectionError=U.ConnectionErrors=U.LogTraceNotification=U.SetTraceNotification=U.TraceFormat=U.Trace=U.ProgressType=U.createMessageConnection=U.NullLogger=U.ConnectionOptions=U.ConnectionStrategy=U.WriteableStreamMessageWriter=U.AbstractMessageWriter=U.MessageWriter=U.ReadableStreamMessageReader=U.AbstractMessageReader=U.MessageReader=U.CancellationToken=U.CancellationTokenSource=U.Emitter=U.Event=U.Disposable=U.ParameterStructures=U.NotificationType9=U.NotificationType8=U.NotificationType7=U.NotificationType6=U.NotificationType5=U.NotificationType4=U.NotificationType3=U.NotificationType2=U.NotificationType1=U.NotificationType0=U.NotificationType=U.ErrorCodes=U.ResponseError=U.RequestType9=U.RequestType8=U.RequestType7=U.RequestType6=U.RequestType5=U.RequestType4=U.RequestType3=U.RequestType2=U.RequestType1=U.RequestType0=U.RequestType=U.RAL=void 0;U.CancellationStrategy=void 0;var ct=Zf();Object.defineProperty(U,"RequestType",{enumerable:!0,get:function(){return ct.RequestType}});Object.defineProperty(U,"RequestType0",{enumerable:!0,get:function(){return ct.RequestType0}});Object.defineProperty(U,"RequestType1",{enumerable:!0,get:function(){return ct.RequestType1}});Object.defineProperty(U,"RequestType2",{enumerable:!0,get:function(){return ct.RequestType2}});Object.defineProperty(U,"RequestType3",{enumerable:!0,get:function(){return ct.RequestType3}});Object.defineProperty(U,"RequestType4",{enumerable:!0,get:function(){return ct.RequestType4}});Object.defineProperty(U,"RequestType5",{enumerable:!0,get:function(){return ct.RequestType5}});Object.defineProperty(U,"RequestType6",{enumerable:!0,get:function(){return ct.RequestType6}});Object.defineProperty(U,"RequestType7",{enumerable:!0,get:function(){return ct.RequestType7}});Object.defineProperty(U,"RequestType8",{enumerable:!0,get:function(){return ct.RequestType8}});Object.defineProperty(U,"RequestType9",{enumerable:!0,get:function(){return ct.RequestType9}});Object.defineProperty(U,"ResponseError",{enumerable:!0,get:function(){return ct.ResponseError}});Object.defineProperty(U,"ErrorCodes",{enumerable:!0,get:function(){return ct.ErrorCodes}});Object.defineProperty(U,"NotificationType",{enumerable:!0,get:function(){return ct.NotificationType}});Object.defineProperty(U,"NotificationType0",{enumerable:!0,get:function(){return ct.NotificationType0}});Object.defineProperty(U,"NotificationType1",{enumerable:!0,get:function(){return ct.NotificationType1}});Object.defineProperty(U,"NotificationType2",{enumerable:!0,get:function(){return ct.NotificationType2}});Object.defineProperty(U,"NotificationType3",{enumerable:!0,get:function(){return ct.NotificationType3}});Object.defineProperty(U,"NotificationType4",{enumerable:!0,get:function(){return ct.NotificationType4}});Object.defineProperty(U,"NotificationType5",{enumerable:!0,get:function(){return ct.NotificationType5}});Object.defineProperty(U,"NotificationType6",{enumerable:!0,get:function(){return ct.NotificationType6}});Object.defineProperty(U,"NotificationType7",{enumerable:!0,get:function(){return ct.NotificationType7}});Object.defineProperty(U,"NotificationType8",{enumerable:!0,get:function(){return ct.NotificationType8}});Object.defineProperty(U,"NotificationType9",{enumerable:!0,get:function(){return ct.NotificationType9}});Object.defineProperty(U,"ParameterStructures",{enumerable:!0,get:function(){return ct.ParameterStructures}});var NR=Xf();Object.defineProperty(U,"Disposable",{enumerable:!0,get:function(){return NR.Disposable}});var d_=Io();Object.defineProperty(U,"Event",{enumerable:!0,get:function(){return d_.Event}});Object.defineProperty(U,"Emitter",{enumerable:!0,get:function(){return d_.Emitter}});var m_=rp();Object.defineProperty(U,"CancellationTokenSource",{enumerable:!0,get:function(){return m_.CancellationTokenSource}});Object.defineProperty(U,"CancellationToken",{enumerable:!0,get:function(){return m_.CancellationToken}});var gp=Qg();Object.defineProperty(U,"MessageReader",{enumerable:!0,get:function(){return gp.MessageReader}});Object.defineProperty(U,"AbstractMessageReader",{enumerable:!0,get:function(){return gp.AbstractMessageReader}});Object.defineProperty(U,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return gp.ReadableStreamMessageReader}});var _p=i_();Object.defineProperty(U,"MessageWriter",{enumerable:!0,get:function(){return _p.MessageWriter}});Object.defineProperty(U,"AbstractMessageWriter",{enumerable:!0,get:function(){return _p.AbstractMessageWriter}});Object.defineProperty(U,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return _p.WriteableStreamMessageWriter}});var On=p_();Object.defineProperty(U,"ConnectionStrategy",{enumerable:!0,get:function(){return On.ConnectionStrategy}});Object.defineProperty(U,"ConnectionOptions",{enumerable:!0,get:function(){return On.ConnectionOptions}});Object.defineProperty(U,"NullLogger",{enumerable:!0,get:function(){return On.NullLogger}});Object.defineProperty(U,"createMessageConnection",{enumerable:!0,get:function(){return On.createMessageConnection}});Object.defineProperty(U,"ProgressType",{enumerable:!0,get:function(){return On.ProgressType}});Object.defineProperty(U,"Trace",{enumerable:!0,get:function(){return On.Trace}});Object.defineProperty(U,"TraceFormat",{enumerable:!0,get:function(){return On.TraceFormat}});Object.defineProperty(U,"SetTraceNotification",{enumerable:!0,get:function(){return On.SetTraceNotification}});Object.defineProperty(U,"LogTraceNotification",{enumerable:!0,get:function(){return On.LogTraceNotification}});Object.defineProperty(U,"ConnectionErrors",{enumerable:!0,get:function(){return On.ConnectionErrors}});Object.defineProperty(U,"ConnectionError",{enumerable:!0,get:function(){return On.ConnectionError}});Object.defineProperty(U,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return On.CancellationReceiverStrategy}});Object.defineProperty(U,"CancellationSenderStrategy",{enumerable:!0,get:function(){return On.CancellationSenderStrategy}});Object.defineProperty(U,"CancellationStrategy",{enumerable:!0,get:function(){return On.CancellationStrategy}});var vR=Ii();U.RAL=vR.default});var xo=K($e=>{"use strict";var PR=$e&&$e.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),IR=$e&&$e.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&PR(e,t,n)};Object.defineProperty($e,"__esModule",{value:!0});$e.createMessageConnection=$e.createServerSocketTransport=$e.createClientSocketTransport=$e.createServerPipeTransport=$e.createClientPipeTransport=$e.generateRandomPipeName=$e.StreamMessageWriter=$e.StreamMessageReader=$e.SocketMessageWriter=$e.SocketMessageReader=$e.IPCMessageWriter=$e.IPCMessageReader=void 0;var Co=Ng();Co.default.install();var ri=yp(),h_=require("path"),SR=require("os"),CR=require("crypto"),Nu=require("net");IR(yp(),$e);var g_=class extends ri.AbstractMessageReader{constructor(e){super();this.process=e;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),ri.Disposable.create(()=>this.process.off("message",e))}};$e.IPCMessageReader=g_;var __=class extends ri.AbstractMessageWriter{constructor(e){super();this.process=e,this.errorCount=0;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,n=>{n?(this.errorCount++,this.handleError(n,e)):this.errorCount=0}),Promise.resolve()}catch(n){return this.handleError(n,e),Promise.reject(n)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){}};$e.IPCMessageWriter=__;var Ro=class extends ri.ReadableStreamMessageReader{constructor(e,n="utf-8"){super(Co.default().stream.asReadableStream(e),n)}};$e.SocketMessageReader=Ro;var Ao=class extends ri.WriteableStreamMessageWriter{constructor(e,n){super(Co.default().stream.asWritableStream(e),n);this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};$e.SocketMessageWriter=Ao;var bp=class extends ri.ReadableStreamMessageReader{constructor(e,n){super(Co.default().stream.asReadableStream(e),n)}};$e.StreamMessageReader=bp;var Tp=class extends ri.WriteableStreamMessageWriter{constructor(e,n){super(Co.default().stream.asWritableStream(e),n)}};$e.StreamMessageWriter=Tp;var y_=process.env.XDG_RUNTIME_DIR,RR=new Map([["linux",107],["darwin",103]]);function AR(){let t=CR.randomBytes(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;y_?e=h_.join(y_,`vscode-ipc-${t}.sock`):e=h_.join(SR.tmpdir(),`vscode-${t}.sock`);let n=RR.get(process.platform);return n!==void 0&&e.length>=n&&Co.default().console.warn(`WARNING: IPC handle "${e}" is longer than ${n} characters.`),e}$e.generateRandomPipeName=AR;function xR(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=Nu.createServer(a=>{o.close(),n([new Ro(a,e),new Ao(a,e)])});o.on("error",s),o.listen(t,()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}$e.createClientPipeTransport=xR;function ER(t,e="utf-8"){let n=Nu.createConnection(t);return[new Ro(n,e),new Ao(n,e)]}$e.createServerPipeTransport=ER;function wR(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=Nu.createServer(a=>{o.close(),n([new Ro(a,e),new Ao(a,e)])});o.on("error",s),o.listen(t,"127.0.0.1",()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}$e.createClientSocketTransport=wR;function OR(t,e="utf-8"){let n=Nu.createConnection(t,"127.0.0.1");return[new Ro(n,e),new Ao(n,e)]}$e.createServerSocketTransport=OR;function LR(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function DR(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function kR(t,e,n,r){n||(n=ri.NullLogger);let i=LR(t)?new bp(t):t,s=DR(e)?new Tp(e):e;return ri.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),ri.createMessageConnection(i,s,n,r)}$e.createMessageConnection=kR});var Np=K((pV,b_)=>{"use strict";b_.exports=xo()});var ot=K((T_,vu)=>{(function(t){if(typeof vu=="object"&&typeof vu.exports=="object"){var e=t(require,T_);e!==void 0&&(vu.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],t)})(function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=e.EOL=e.SelectionRange=e.DocumentLink=e.FormattingOptions=e.CodeLens=e.CodeAction=e.CodeActionContext=e.CodeActionKind=e.DocumentSymbol=e.SymbolInformation=e.SymbolTag=e.SymbolKind=e.DocumentHighlight=e.DocumentHighlightKind=e.SignatureInformation=e.ParameterInformation=e.Hover=e.MarkedString=e.CompletionList=e.CompletionItem=e.InsertTextMode=e.InsertReplaceEdit=e.CompletionItemTag=e.InsertTextFormat=e.CompletionItemKind=e.MarkupContent=e.MarkupKind=e.TextDocumentItem=e.OptionalVersionedTextDocumentIdentifier=e.VersionedTextDocumentIdentifier=e.TextDocumentIdentifier=e.WorkspaceChange=e.WorkspaceEdit=e.DeleteFile=e.RenameFile=e.CreateFile=e.TextDocumentEdit=e.AnnotatedTextEdit=e.ChangeAnnotationIdentifier=e.ChangeAnnotation=e.TextEdit=e.Command=e.Diagnostic=e.CodeDescription=e.DiagnosticTag=e.DiagnosticSeverity=e.DiagnosticRelatedInformation=e.FoldingRange=e.FoldingRangeKind=e.ColorPresentation=e.ColorInformation=e.Color=e.LocationLink=e.Location=e.Range=e.Position=e.uinteger=e.integer=void 0;var n;(function(y){y.MIN_VALUE=-2147483648,y.MAX_VALUE=2147483647})(n=e.integer||(e.integer={}));var r;(function(y){y.MIN_VALUE=0,y.MAX_VALUE=2147483647})(r=e.uinteger||(e.uinteger={}));var i;(function(y){function x(R,T){return R===Number.MAX_VALUE&&(R=r.MAX_VALUE),T===Number.MAX_VALUE&&(T=r.MAX_VALUE),{line:R,character:T}}y.create=x;function w(R){var T=R;return I.objectLiteral(T)&&I.uinteger(T.line)&&I.uinteger(T.character)}y.is=w})(i=e.Position||(e.Position={}));var s;(function(y){function x(R,T,L,F){if(I.uinteger(R)&&I.uinteger(T)&&I.uinteger(L)&&I.uinteger(F))return{start:i.create(R,T),end:i.create(L,F)};if(i.is(R)&&i.is(T))return{start:R,end:T};throw new Error("Range#create called with invalid arguments["+R+", "+T+", "+L+", "+F+"]")}y.create=x;function w(R){var T=R;return I.objectLiteral(T)&&i.is(T.start)&&i.is(T.end)}y.is=w})(s=e.Range||(e.Range={}));var o;(function(y){function x(R,T){return{uri:R,range:T}}y.create=x;function w(R){var T=R;return I.defined(T)&&s.is(T.range)&&(I.string(T.uri)||I.undefined(T.uri))}y.is=w})(o=e.Location||(e.Location={}));var a;(function(y){function x(R,T,L,F){return{targetUri:R,targetRange:T,targetSelectionRange:L,originSelectionRange:F}}y.create=x;function w(R){var T=R;return I.defined(T)&&s.is(T.targetRange)&&I.string(T.targetUri)&&(s.is(T.targetSelectionRange)||I.undefined(T.targetSelectionRange))&&(s.is(T.originSelectionRange)||I.undefined(T.originSelectionRange))}y.is=w})(a=e.LocationLink||(e.LocationLink={}));var l;(function(y){function x(R,T,L,F){return{red:R,green:T,blue:L,alpha:F}}y.create=x;function w(R){var T=R;return I.numberRange(T.red,0,1)&&I.numberRange(T.green,0,1)&&I.numberRange(T.blue,0,1)&&I.numberRange(T.alpha,0,1)}y.is=w})(l=e.Color||(e.Color={}));var u;(function(y){function x(R,T){return{range:R,color:T}}y.create=x;function w(R){var T=R;return s.is(T.range)&&l.is(T.color)}y.is=w})(u=e.ColorInformation||(e.ColorInformation={}));var c;(function(y){function x(R,T,L){return{label:R,textEdit:T,additionalTextEdits:L}}y.create=x;function w(R){var T=R;return I.string(T.label)&&(I.undefined(T.textEdit)||g.is(T))&&(I.undefined(T.additionalTextEdits)||I.typedArray(T.additionalTextEdits,g.is))}y.is=w})(c=e.ColorPresentation||(e.ColorPresentation={}));var f;(function(y){y.Comment="comment",y.Imports="imports",y.Region="region"})(f=e.FoldingRangeKind||(e.FoldingRangeKind={}));var m;(function(y){function x(R,T,L,F,ie){var pe={startLine:R,endLine:T};return I.defined(L)&&(pe.startCharacter=L),I.defined(F)&&(pe.endCharacter=F),I.defined(ie)&&(pe.kind=ie),pe}y.create=x;function w(R){var T=R;return I.uinteger(T.startLine)&&I.uinteger(T.startLine)&&(I.undefined(T.startCharacter)||I.uinteger(T.startCharacter))&&(I.undefined(T.endCharacter)||I.uinteger(T.endCharacter))&&(I.undefined(T.kind)||I.string(T.kind))}y.is=w})(m=e.FoldingRange||(e.FoldingRange={}));var p;(function(y){function x(R,T){return{location:R,message:T}}y.create=x;function w(R){var T=R;return I.defined(T)&&o.is(T.location)&&I.string(T.message)}y.is=w})(p=e.DiagnosticRelatedInformation||(e.DiagnosticRelatedInformation={}));var d;(function(y){y.Error=1,y.Warning=2,y.Information=3,y.Hint=4})(d=e.DiagnosticSeverity||(e.DiagnosticSeverity={}));var _;(function(y){y.Unnecessary=1,y.Deprecated=2})(_=e.DiagnosticTag||(e.DiagnosticTag={}));var C;(function(y){function x(w){var R=w;return R!=null&&I.string(R.href)}y.is=x})(C=e.CodeDescription||(e.CodeDescription={}));var h;(function(y){function x(R,T,L,F,ie,pe){var Oe={range:R,message:T};return I.defined(L)&&(Oe.severity=L),I.defined(F)&&(Oe.code=F),I.defined(ie)&&(Oe.source=ie),I.defined(pe)&&(Oe.relatedInformation=pe),Oe}y.create=x;function w(R){var T,L=R;return I.defined(L)&&s.is(L.range)&&I.string(L.message)&&(I.number(L.severity)||I.undefined(L.severity))&&(I.integer(L.code)||I.string(L.code)||I.undefined(L.code))&&(I.undefined(L.codeDescription)||I.string((T=L.codeDescription)===null||T===void 0?void 0:T.href))&&(I.string(L.source)||I.undefined(L.source))&&(I.undefined(L.relatedInformation)||I.typedArray(L.relatedInformation,p.is))}y.is=w})(h=e.Diagnostic||(e.Diagnostic={}));var b;(function(y){function x(R,T){for(var L=[],F=2;F0&&(ie.arguments=L),ie}y.create=x;function w(R){var T=R;return I.defined(T)&&I.string(T.title)&&I.string(T.command)}y.is=w})(b=e.Command||(e.Command={}));var g;(function(y){function x(L,F){return{range:L,newText:F}}y.replace=x;function w(L,F){return{range:{start:L,end:L},newText:F}}y.insert=w;function R(L){return{range:L,newText:""}}y.del=R;function T(L){var F=L;return I.objectLiteral(F)&&I.string(F.newText)&&s.is(F.range)}y.is=T})(g=e.TextEdit||(e.TextEdit={}));var N;(function(y){function x(R,T,L){var F={label:R};return T!==void 0&&(F.needsConfirmation=T),L!==void 0&&(F.description=L),F}y.create=x;function w(R){var T=R;return T!==void 0&&I.objectLiteral(T)&&I.string(T.label)&&(I.boolean(T.needsConfirmation)||T.needsConfirmation===void 0)&&(I.string(T.description)||T.description===void 0)}y.is=w})(N=e.ChangeAnnotation||(e.ChangeAnnotation={}));var S;(function(y){function x(w){var R=w;return typeof R=="string"}y.is=x})(S=e.ChangeAnnotationIdentifier||(e.ChangeAnnotationIdentifier={}));var V;(function(y){function x(L,F,ie){return{range:L,newText:F,annotationId:ie}}y.replace=x;function w(L,F,ie){return{range:{start:L,end:L},newText:F,annotationId:ie}}y.insert=w;function R(L,F){return{range:L,newText:"",annotationId:F}}y.del=R;function T(L){var F=L;return g.is(F)&&(N.is(F.annotationId)||S.is(F.annotationId))}y.is=T})(V=e.AnnotatedTextEdit||(e.AnnotatedTextEdit={}));var O;(function(y){function x(R,T){return{textDocument:R,edits:T}}y.create=x;function w(R){var T=R;return I.defined(T)&<.is(T.textDocument)&&Array.isArray(T.edits)}y.is=w})(O=e.TextDocumentEdit||(e.TextDocumentEdit={}));var $;(function(y){function x(R,T,L){var F={kind:"create",uri:R};return T!==void 0&&(T.overwrite!==void 0||T.ignoreIfExists!==void 0)&&(F.options=T),L!==void 0&&(F.annotationId=L),F}y.create=x;function w(R){var T=R;return T&&T.kind==="create"&&I.string(T.uri)&&(T.options===void 0||(T.options.overwrite===void 0||I.boolean(T.options.overwrite))&&(T.options.ignoreIfExists===void 0||I.boolean(T.options.ignoreIfExists)))&&(T.annotationId===void 0||S.is(T.annotationId))}y.is=w})($=e.CreateFile||(e.CreateFile={}));var X;(function(y){function x(R,T,L,F){var ie={kind:"rename",oldUri:R,newUri:T};return L!==void 0&&(L.overwrite!==void 0||L.ignoreIfExists!==void 0)&&(ie.options=L),F!==void 0&&(ie.annotationId=F),ie}y.create=x;function w(R){var T=R;return T&&T.kind==="rename"&&I.string(T.oldUri)&&I.string(T.newUri)&&(T.options===void 0||(T.options.overwrite===void 0||I.boolean(T.options.overwrite))&&(T.options.ignoreIfExists===void 0||I.boolean(T.options.ignoreIfExists)))&&(T.annotationId===void 0||S.is(T.annotationId))}y.is=w})(X=e.RenameFile||(e.RenameFile={}));var ee;(function(y){function x(R,T,L){var F={kind:"delete",uri:R};return T!==void 0&&(T.recursive!==void 0||T.ignoreIfNotExists!==void 0)&&(F.options=T),L!==void 0&&(F.annotationId=L),F}y.create=x;function w(R){var T=R;return T&&T.kind==="delete"&&I.string(T.uri)&&(T.options===void 0||(T.options.recursive===void 0||I.boolean(T.options.recursive))&&(T.options.ignoreIfNotExists===void 0||I.boolean(T.options.ignoreIfNotExists)))&&(T.annotationId===void 0||S.is(T.annotationId))}y.is=w})(ee=e.DeleteFile||(e.DeleteFile={}));var Y;(function(y){function x(w){var R=w;return R&&(R.changes!==void 0||R.documentChanges!==void 0)&&(R.documentChanges===void 0||R.documentChanges.every(function(T){return I.string(T.kind)?$.is(T)||X.is(T)||ee.is(T):O.is(T)}))}y.is=x})(Y=e.WorkspaceEdit||(e.WorkspaceEdit={}));var ne=function(){function y(x,w){this.edits=x,this.changeAnnotations=w}return y.prototype.insert=function(x,w,R){var T,L;if(R===void 0?T=g.insert(x,w):S.is(R)?(L=R,T=V.insert(x,w,R)):(this.assertChangeAnnotations(this.changeAnnotations),L=this.changeAnnotations.manage(R),T=V.insert(x,w,L)),this.edits.push(T),L!==void 0)return L},y.prototype.replace=function(x,w,R){var T,L;if(R===void 0?T=g.replace(x,w):S.is(R)?(L=R,T=V.replace(x,w,R)):(this.assertChangeAnnotations(this.changeAnnotations),L=this.changeAnnotations.manage(R),T=V.replace(x,w,L)),this.edits.push(T),L!==void 0)return L},y.prototype.delete=function(x,w){var R,T;if(w===void 0?R=g.del(x):S.is(w)?(T=w,R=V.del(x,w)):(this.assertChangeAnnotations(this.changeAnnotations),T=this.changeAnnotations.manage(w),R=V.del(x,T)),this.edits.push(R),T!==void 0)return T},y.prototype.add=function(x){this.edits.push(x)},y.prototype.all=function(){return this.edits},y.prototype.clear=function(){this.edits.splice(0,this.edits.length)},y.prototype.assertChangeAnnotations=function(x){if(x===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},y}(),De=function(){function y(x){this._annotations=x===void 0?Object.create(null):x,this._counter=0,this._size=0}return y.prototype.all=function(){return this._annotations},Object.defineProperty(y.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),y.prototype.manage=function(x,w){var R;if(S.is(x)?R=x:(R=this.nextId(),w=x),this._annotations[R]!==void 0)throw new Error("Id "+R+" is already in use.");if(w===void 0)throw new Error("No annotation provided for id "+R);return this._annotations[R]=w,this._size++,R},y.prototype.nextId=function(){return this._counter++,this._counter.toString()},y}(),de=function(){function y(x){var w=this;this._textEditChanges=Object.create(null),x!==void 0?(this._workspaceEdit=x,x.documentChanges?(this._changeAnnotations=new De(x.changeAnnotations),x.changeAnnotations=this._changeAnnotations.all(),x.documentChanges.forEach(function(R){if(O.is(R)){var T=new ne(R.edits,w._changeAnnotations);w._textEditChanges[R.textDocument.uri]=T}})):x.changes&&Object.keys(x.changes).forEach(function(R){var T=new ne(x.changes[R]);w._textEditChanges[R]=T})):this._workspaceEdit={}}return Object.defineProperty(y.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),y.prototype.getTextEditChange=function(x){if(lt.is(x)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var w={uri:x.uri,version:x.version},R=this._textEditChanges[w.uri];if(!R){var T=[],L={textDocument:w,edits:T};this._workspaceEdit.documentChanges.push(L),R=new ne(T,this._changeAnnotations),this._textEditChanges[w.uri]=R}return R}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var R=this._textEditChanges[x];if(!R){var T=[];this._workspaceEdit.changes[x]=T,R=new ne(T),this._textEditChanges[x]=R}return R}},y.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new De,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},y.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},y.prototype.createFile=function(x,w,R){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var T;N.is(w)||S.is(w)?T=w:R=w;var L,F;if(T===void 0?L=$.create(x,R):(F=S.is(T)?T:this._changeAnnotations.manage(T),L=$.create(x,R,F)),this._workspaceEdit.documentChanges.push(L),F!==void 0)return F},y.prototype.renameFile=function(x,w,R,T){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var L;N.is(R)||S.is(R)?L=R:T=R;var F,ie;if(L===void 0?F=X.create(x,w,T):(ie=S.is(L)?L:this._changeAnnotations.manage(L),F=X.create(x,w,T,ie)),this._workspaceEdit.documentChanges.push(F),ie!==void 0)return ie},y.prototype.deleteFile=function(x,w,R){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var T;N.is(w)||S.is(w)?T=w:R=w;var L,F;if(T===void 0?L=ee.create(x,R):(F=S.is(T)?T:this._changeAnnotations.manage(T),L=ee.create(x,R,F)),this._workspaceEdit.documentChanges.push(L),F!==void 0)return F},y}();e.WorkspaceChange=de;var Z;(function(y){function x(R){return{uri:R}}y.create=x;function w(R){var T=R;return I.defined(T)&&I.string(T.uri)}y.is=w})(Z=e.TextDocumentIdentifier||(e.TextDocumentIdentifier={}));var Ge;(function(y){function x(R,T){return{uri:R,version:T}}y.create=x;function w(R){var T=R;return I.defined(T)&&I.string(T.uri)&&I.integer(T.version)}y.is=w})(Ge=e.VersionedTextDocumentIdentifier||(e.VersionedTextDocumentIdentifier={}));var lt;(function(y){function x(R,T){return{uri:R,version:T}}y.create=x;function w(R){var T=R;return I.defined(T)&&I.string(T.uri)&&(T.version===null||I.integer(T.version))}y.is=w})(lt=e.OptionalVersionedTextDocumentIdentifier||(e.OptionalVersionedTextDocumentIdentifier={}));var Ft;(function(y){function x(R,T,L,F){return{uri:R,languageId:T,version:L,text:F}}y.create=x;function w(R){var T=R;return I.defined(T)&&I.string(T.uri)&&I.string(T.languageId)&&I.integer(T.version)&&I.string(T.text)}y.is=w})(Ft=e.TextDocumentItem||(e.TextDocumentItem={}));var Ve;(function(y){y.PlainText="plaintext",y.Markdown="markdown"})(Ve=e.MarkupKind||(e.MarkupKind={})),function(y){function x(w){var R=w;return R===y.PlainText||R===y.Markdown}y.is=x}(Ve=e.MarkupKind||(e.MarkupKind={}));var ut;(function(y){function x(w){var R=w;return I.objectLiteral(w)&&Ve.is(R.kind)&&I.string(R.value)}y.is=x})(ut=e.MarkupContent||(e.MarkupContent={}));var bi;(function(y){y.Text=1,y.Method=2,y.Function=3,y.Constructor=4,y.Field=5,y.Variable=6,y.Class=7,y.Interface=8,y.Module=9,y.Property=10,y.Unit=11,y.Value=12,y.Enum=13,y.Keyword=14,y.Snippet=15,y.Color=16,y.File=17,y.Reference=18,y.Folder=19,y.EnumMember=20,y.Constant=21,y.Struct=22,y.Event=23,y.Operator=24,y.TypeParameter=25})(bi=e.CompletionItemKind||(e.CompletionItemKind={}));var Yi;(function(y){y.PlainText=1,y.Snippet=2})(Yi=e.InsertTextFormat||(e.InsertTextFormat={}));var le;(function(y){y.Deprecated=1})(le=e.CompletionItemTag||(e.CompletionItemTag={}));var ue;(function(y){function x(R,T,L){return{newText:R,insert:T,replace:L}}y.create=x;function w(R){var T=R;return T&&I.string(T.newText)&&s.is(T.insert)&&s.is(T.replace)}y.is=w})(ue=e.InsertReplaceEdit||(e.InsertReplaceEdit={}));var me;(function(y){y.asIs=1,y.adjustIndentation=2})(me=e.InsertTextMode||(e.InsertTextMode={}));var se;(function(y){function x(w){return{label:w}}y.create=x})(se=e.CompletionItem||(e.CompletionItem={}));var Ne;(function(y){function x(w,R){return{items:w||[],isIncomplete:!!R}}y.create=x})(Ne=e.CompletionList||(e.CompletionList={}));var Nt;(function(y){function x(R){return R.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}y.fromPlainText=x;function w(R){var T=R;return I.string(T)||I.objectLiteral(T)&&I.string(T.language)&&I.string(T.value)}y.is=w})(Nt=e.MarkedString||(e.MarkedString={}));var vr;(function(y){function x(w){var R=w;return!!R&&I.objectLiteral(R)&&(ut.is(R.contents)||Nt.is(R.contents)||I.typedArray(R.contents,Nt.is))&&(w.range===void 0||s.is(w.range))}y.is=x})(vr=e.Hover||(e.Hover={}));var yo;(function(y){function x(w,R){return R?{label:w,documentation:R}:{label:w}}y.create=x})(yo=e.ParameterInformation||(e.ParameterInformation={}));var bo;(function(y){function x(w,R){for(var T=[],L=2;L=0;st--){var Vt=pe[st],Ht=L.offsetAt(Vt.range.start),qe=L.offsetAt(Vt.range.end);if(qe<=we)ie=ie.substring(0,Ht)+Vt.newText+ie.substring(qe,ie.length);else throw new Error("Overlapping edit");we=Ht}return ie}y.applyEdits=R;function T(L,F){if(L.length<=1)return L;var ie=L.length/2|0,pe=L.slice(0,ie),we=L.slice(ie);T(pe,F),T(we,F);for(var st=0,Vt=0,Ht=0;st=0;st--){var Vt=pe[st],Ht=L.offsetAt(Vt.range.start),qe=L.offsetAt(Vt.range.end);if(qe<=Oe)ie=ie.substring(0,Ht)+Vt.newText+ie.substring(qe,ie.length);else throw new Error("Overlapping edit");Oe=Ht}return ie}y.applyEdits=R;function T(L,F){if(L.length<=1)return L;var ie=L.length/2|0,pe=L.slice(0,ie),Oe=L.slice(ie);T(pe,F),T(Oe,F);for(var st=0,Vt=0,Ht=0;st0&&x.push(w.length),this._lineOffsets=x}return this._lineOffsets},y.prototype.positionAt=function(x){x=Math.max(Math.min(x,this._content.length),0);var w=this.getLineOffsets(),R=0,T=w.length;if(T===0)return i.create(0,x);for(;Rx?T=L:R=L+1}var F=R-1;return i.create(F,x-w[F])},y.prototype.offsetAt=function(x){var w=this.getLineOffsets();if(x.line>=w.length)return this._content.length;if(x.line<0)return 0;var R=w[x.line],T=x.line+1{"use strict";Object.defineProperty(rr,"__esModule",{value:!0});rr.ProtocolNotificationType=rr.ProtocolNotificationType0=rr.ProtocolRequestType=rr.ProtocolRequestType0=rr.RegistrationType=void 0;var Eo=xo(),N_=class{constructor(e){this.method=e}};rr.RegistrationType=N_;var v_=class extends Eo.RequestType0{constructor(e){super(e)}};rr.ProtocolRequestType0=v_;var P_=class extends Eo.RequestType{constructor(e){super(e,Eo.ParameterStructures.byName)}};rr.ProtocolRequestType=P_;var I_=class extends Eo.NotificationType0{constructor(e){super(e)}};rr.ProtocolNotificationType0=I_;var S_=class extends Eo.NotificationType{constructor(e){super(e,Eo.ParameterStructures.byName)}};rr.ProtocolNotificationType=S_});var A_=K(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.objectLiteral=wt.typedArray=wt.stringArray=wt.array=wt.func=wt.error=wt.number=wt.string=wt.boolean=void 0;function DR(t){return t===!0||t===!1}wt.boolean=DR;function C_(t){return typeof t=="string"||t instanceof String}wt.string=C_;function kR(t){return typeof t=="number"||t instanceof Number}wt.number=kR;function MR(t){return t instanceof Error}wt.error=MR;function FR(t){return typeof t=="function"}wt.func=FR;function R_(t){return Array.isArray(t)}wt.array=R_;function VR(t){return R_(t)&&t.every(e=>C_(e))}wt.stringArray=VR;function qR(t,e){return Array.isArray(t)&&t.every(e)}wt.typedArray=qR;function BR(t){return t!==null&&typeof t=="object"}wt.objectLiteral=BR});var x_=K(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.ImplementationRequest=void 0;var jR=Kt(),UR;(function(t){t.method="textDocument/implementation",t.type=new jR.ProtocolRequestType(t.method)})(UR=za.ImplementationRequest||(za.ImplementationRequest={}))});var E_=K(Xa=>{"use strict";Object.defineProperty(Xa,"__esModule",{value:!0});Xa.TypeDefinitionRequest=void 0;var GR=Kt(),WR;(function(t){t.method="textDocument/typeDefinition",t.type=new GR.ProtocolRequestType(t.method)})(WR=Xa.TypeDefinitionRequest||(Xa.TypeDefinitionRequest={}))});var O_=K($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0});$i.DidChangeWorkspaceFoldersNotification=$i.WorkspaceFoldersRequest=void 0;var w_=Kt(),HR;(function(t){t.type=new w_.ProtocolRequestType0("workspace/workspaceFolders")})(HR=$i.WorkspaceFoldersRequest||($i.WorkspaceFoldersRequest={}));var YR;(function(t){t.type=new w_.ProtocolNotificationType("workspace/didChangeWorkspaceFolders")})(YR=$i.DidChangeWorkspaceFoldersNotification||($i.DidChangeWorkspaceFoldersNotification={}))});var L_=K(Qa=>{"use strict";Object.defineProperty(Qa,"__esModule",{value:!0});Qa.ConfigurationRequest=void 0;var KR=Kt(),$R;(function(t){t.type=new KR.ProtocolRequestType("workspace/configuration")})($R=Qa.ConfigurationRequest||(Qa.ConfigurationRequest={}))});var k_=K(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.ColorPresentationRequest=zi.DocumentColorRequest=void 0;var D_=Kt(),zR;(function(t){t.method="textDocument/documentColor",t.type=new D_.ProtocolRequestType(t.method)})(zR=zi.DocumentColorRequest||(zi.DocumentColorRequest={}));var XR;(function(t){t.type=new D_.ProtocolRequestType("textDocument/colorPresentation")})(XR=zi.ColorPresentationRequest||(zi.ColorPresentationRequest={}))});var Np=K(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.FoldingRangeRequest=Xi.FoldingRangeKind=void 0;var QR=Kt(),JR;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(JR=Xi.FoldingRangeKind||(Xi.FoldingRangeKind={}));var ZR;(function(t){t.method="textDocument/foldingRange",t.type=new QR.ProtocolRequestType(t.method)})(ZR=Xi.FoldingRangeRequest||(Xi.FoldingRangeRequest={}))});var M_=K(Ja=>{"use strict";Object.defineProperty(Ja,"__esModule",{value:!0});Ja.DeclarationRequest=void 0;var eA=Kt(),tA;(function(t){t.method="textDocument/declaration",t.type=new eA.ProtocolRequestType(t.method)})(tA=Ja.DeclarationRequest||(Ja.DeclarationRequest={}))});var F_=K(Za=>{"use strict";Object.defineProperty(Za,"__esModule",{value:!0});Za.SelectionRangeRequest=void 0;var nA=Kt(),rA;(function(t){t.method="textDocument/selectionRange",t.type=new nA.ProtocolRequestType(t.method)})(rA=Za.SelectionRangeRequest||(Za.SelectionRangeRequest={}))});var q_=K(Sr=>{"use strict";Object.defineProperty(Sr,"__esModule",{value:!0});Sr.WorkDoneProgressCancelNotification=Sr.WorkDoneProgressCreateRequest=Sr.WorkDoneProgress=void 0;var iA=xo(),V_=Kt(),sA;(function(t){t.type=new iA.ProgressType;function e(n){return n===t.type}t.is=e})(sA=Sr.WorkDoneProgress||(Sr.WorkDoneProgress={}));var oA;(function(t){t.type=new V_.ProtocolRequestType("window/workDoneProgress/create")})(oA=Sr.WorkDoneProgressCreateRequest||(Sr.WorkDoneProgressCreateRequest={}));var aA;(function(t){t.type=new V_.ProtocolNotificationType("window/workDoneProgress/cancel")})(aA=Sr.WorkDoneProgressCancelNotification||(Sr.WorkDoneProgressCancelNotification={}))});var B_=K(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.CallHierarchyOutgoingCallsRequest=Cr.CallHierarchyIncomingCallsRequest=Cr.CallHierarchyPrepareRequest=void 0;var vp=Kt(),lA;(function(t){t.method="textDocument/prepareCallHierarchy",t.type=new vp.ProtocolRequestType(t.method)})(lA=Cr.CallHierarchyPrepareRequest||(Cr.CallHierarchyPrepareRequest={}));var uA;(function(t){t.method="callHierarchy/incomingCalls",t.type=new vp.ProtocolRequestType(t.method)})(uA=Cr.CallHierarchyIncomingCallsRequest||(Cr.CallHierarchyIncomingCallsRequest={}));var cA;(function(t){t.method="callHierarchy/outgoingCalls",t.type=new vp.ProtocolRequestType(t.method)})(cA=Cr.CallHierarchyOutgoingCallsRequest||(Cr.CallHierarchyOutgoingCallsRequest={}))});var j_=K(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.SemanticTokensRefreshRequest=Je.SemanticTokensRangeRequest=Je.SemanticTokensDeltaRequest=Je.SemanticTokensRequest=Je.SemanticTokensRegistrationType=Je.TokenFormat=Je.SemanticTokens=Je.SemanticTokenModifiers=Je.SemanticTokenTypes=void 0;var el=Kt(),fA;(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator"})(fA=Je.SemanticTokenTypes||(Je.SemanticTokenTypes={}));var pA;(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})(pA=Je.SemanticTokenModifiers||(Je.SemanticTokenModifiers={}));var dA;(function(t){function e(n){let r=n;return r!==void 0&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}t.is=e})(dA=Je.SemanticTokens||(Je.SemanticTokens={}));var mA;(function(t){t.Relative="relative"})(mA=Je.TokenFormat||(Je.TokenFormat={}));var hA;(function(t){t.method="textDocument/semanticTokens",t.type=new el.RegistrationType(t.method)})(hA=Je.SemanticTokensRegistrationType||(Je.SemanticTokensRegistrationType={}));var gA;(function(t){t.method="textDocument/semanticTokens/full",t.type=new el.ProtocolRequestType(t.method)})(gA=Je.SemanticTokensRequest||(Je.SemanticTokensRequest={}));var _A;(function(t){t.method="textDocument/semanticTokens/full/delta",t.type=new el.ProtocolRequestType(t.method)})(_A=Je.SemanticTokensDeltaRequest||(Je.SemanticTokensDeltaRequest={}));var yA;(function(t){t.method="textDocument/semanticTokens/range",t.type=new el.ProtocolRequestType(t.method)})(yA=Je.SemanticTokensRangeRequest||(Je.SemanticTokensRangeRequest={}));var bA;(function(t){t.method="workspace/semanticTokens/refresh",t.type=new el.ProtocolRequestType0(t.method)})(bA=Je.SemanticTokensRefreshRequest||(Je.SemanticTokensRefreshRequest={}))});var U_=K(tl=>{"use strict";Object.defineProperty(tl,"__esModule",{value:!0});tl.ShowDocumentRequest=void 0;var TA=Kt(),NA;(function(t){t.method="window/showDocument",t.type=new TA.ProtocolRequestType(t.method)})(NA=tl.ShowDocumentRequest||(tl.ShowDocumentRequest={}))});var G_=K(nl=>{"use strict";Object.defineProperty(nl,"__esModule",{value:!0});nl.LinkedEditingRangeRequest=void 0;var vA=Kt(),PA;(function(t){t.method="textDocument/linkedEditingRange",t.type=new vA.ProtocolRequestType(t.method)})(PA=nl.LinkedEditingRangeRequest||(nl.LinkedEditingRangeRequest={}))});var W_=K(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.WillDeleteFilesRequest=yt.DidDeleteFilesNotification=yt.DidRenameFilesNotification=yt.WillRenameFilesRequest=yt.DidCreateFilesNotification=yt.WillCreateFilesRequest=yt.FileOperationPatternKind=void 0;var wo=Kt(),IA;(function(t){t.file="file",t.folder="folder"})(IA=yt.FileOperationPatternKind||(yt.FileOperationPatternKind={}));var SA;(function(t){t.method="workspace/willCreateFiles",t.type=new wo.ProtocolRequestType(t.method)})(SA=yt.WillCreateFilesRequest||(yt.WillCreateFilesRequest={}));var CA;(function(t){t.method="workspace/didCreateFiles",t.type=new wo.ProtocolNotificationType(t.method)})(CA=yt.DidCreateFilesNotification||(yt.DidCreateFilesNotification={}));var RA;(function(t){t.method="workspace/willRenameFiles",t.type=new wo.ProtocolRequestType(t.method)})(RA=yt.WillRenameFilesRequest||(yt.WillRenameFilesRequest={}));var AA;(function(t){t.method="workspace/didRenameFiles",t.type=new wo.ProtocolNotificationType(t.method)})(AA=yt.DidRenameFilesNotification||(yt.DidRenameFilesNotification={}));var xA;(function(t){t.method="workspace/didDeleteFiles",t.type=new wo.ProtocolNotificationType(t.method)})(xA=yt.DidDeleteFilesNotification||(yt.DidDeleteFilesNotification={}));var EA;(function(t){t.method="workspace/willDeleteFiles",t.type=new wo.ProtocolRequestType(t.method)})(EA=yt.WillDeleteFilesRequest||(yt.WillDeleteFilesRequest={}))});var H_=K(Rr=>{"use strict";Object.defineProperty(Rr,"__esModule",{value:!0});Rr.MonikerRequest=Rr.MonikerKind=Rr.UniquenessLevel=void 0;var wA=Kt(),OA;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(OA=Rr.UniquenessLevel||(Rr.UniquenessLevel={}));var LA;(function(t){t.import="import",t.export="export",t.local="local"})(LA=Rr.MonikerKind||(Rr.MonikerKind={}));var DA;(function(t){t.method="textDocument/moniker",t.type=new wA.ProtocolRequestType(t.method)})(DA=Rr.MonikerRequest||(Rr.MonikerRequest={}))});var X_=K(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.DocumentLinkRequest=A.CodeLensRefreshRequest=A.CodeLensResolveRequest=A.CodeLensRequest=A.WorkspaceSymbolRequest=A.CodeActionResolveRequest=A.CodeActionRequest=A.DocumentSymbolRequest=A.DocumentHighlightRequest=A.ReferencesRequest=A.DefinitionRequest=A.SignatureHelpRequest=A.SignatureHelpTriggerKind=A.HoverRequest=A.CompletionResolveRequest=A.CompletionRequest=A.CompletionTriggerKind=A.PublishDiagnosticsNotification=A.WatchKind=A.FileChangeType=A.DidChangeWatchedFilesNotification=A.WillSaveTextDocumentWaitUntilRequest=A.WillSaveTextDocumentNotification=A.TextDocumentSaveReason=A.DidSaveTextDocumentNotification=A.DidCloseTextDocumentNotification=A.DidChangeTextDocumentNotification=A.TextDocumentContentChangeEvent=A.DidOpenTextDocumentNotification=A.TextDocumentSyncKind=A.TelemetryEventNotification=A.LogMessageNotification=A.ShowMessageRequest=A.ShowMessageNotification=A.MessageType=A.DidChangeConfigurationNotification=A.ExitNotification=A.ShutdownRequest=A.InitializedNotification=A.InitializeError=A.InitializeRequest=A.WorkDoneProgressOptions=A.TextDocumentRegistrationOptions=A.StaticRegistrationOptions=A.FailureHandlingKind=A.ResourceOperationKind=A.UnregistrationRequest=A.RegistrationRequest=A.DocumentSelector=A.DocumentFilter=void 0;A.MonikerRequest=A.MonikerKind=A.UniquenessLevel=A.WillDeleteFilesRequest=A.DidDeleteFilesNotification=A.WillRenameFilesRequest=A.DidRenameFilesNotification=A.WillCreateFilesRequest=A.DidCreateFilesNotification=A.FileOperationPatternKind=A.LinkedEditingRangeRequest=A.ShowDocumentRequest=A.SemanticTokensRegistrationType=A.SemanticTokensRefreshRequest=A.SemanticTokensRangeRequest=A.SemanticTokensDeltaRequest=A.SemanticTokensRequest=A.TokenFormat=A.SemanticTokens=A.SemanticTokenModifiers=A.SemanticTokenTypes=A.CallHierarchyPrepareRequest=A.CallHierarchyOutgoingCallsRequest=A.CallHierarchyIncomingCallsRequest=A.WorkDoneProgressCancelNotification=A.WorkDoneProgressCreateRequest=A.WorkDoneProgress=A.SelectionRangeRequest=A.DeclarationRequest=A.FoldingRangeRequest=A.ColorPresentationRequest=A.DocumentColorRequest=A.ConfigurationRequest=A.DidChangeWorkspaceFoldersNotification=A.WorkspaceFoldersRequest=A.TypeDefinitionRequest=A.ImplementationRequest=A.ApplyWorkspaceEditRequest=A.ExecuteCommandRequest=A.PrepareRenameRequest=A.RenameRequest=A.PrepareSupportDefaultBehavior=A.DocumentOnTypeFormattingRequest=A.DocumentRangeFormattingRequest=A.DocumentFormattingRequest=A.DocumentLinkResolveRequest=void 0;var Qi=A_(),Re=Kt(),kA=x_();Object.defineProperty(A,"ImplementationRequest",{enumerable:!0,get:function(){return kA.ImplementationRequest}});var MA=E_();Object.defineProperty(A,"TypeDefinitionRequest",{enumerable:!0,get:function(){return MA.TypeDefinitionRequest}});var Y_=O_();Object.defineProperty(A,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return Y_.WorkspaceFoldersRequest}});Object.defineProperty(A,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return Y_.DidChangeWorkspaceFoldersNotification}});var FA=L_();Object.defineProperty(A,"ConfigurationRequest",{enumerable:!0,get:function(){return FA.ConfigurationRequest}});var K_=k_();Object.defineProperty(A,"DocumentColorRequest",{enumerable:!0,get:function(){return K_.DocumentColorRequest}});Object.defineProperty(A,"ColorPresentationRequest",{enumerable:!0,get:function(){return K_.ColorPresentationRequest}});var VA=Np();Object.defineProperty(A,"FoldingRangeRequest",{enumerable:!0,get:function(){return VA.FoldingRangeRequest}});var qA=M_();Object.defineProperty(A,"DeclarationRequest",{enumerable:!0,get:function(){return qA.DeclarationRequest}});var BA=F_();Object.defineProperty(A,"SelectionRangeRequest",{enumerable:!0,get:function(){return BA.SelectionRangeRequest}});var Pp=q_();Object.defineProperty(A,"WorkDoneProgress",{enumerable:!0,get:function(){return Pp.WorkDoneProgress}});Object.defineProperty(A,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return Pp.WorkDoneProgressCreateRequest}});Object.defineProperty(A,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return Pp.WorkDoneProgressCancelNotification}});var Ip=B_();Object.defineProperty(A,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return Ip.CallHierarchyIncomingCallsRequest}});Object.defineProperty(A,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return Ip.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(A,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return Ip.CallHierarchyPrepareRequest}});var Ai=j_();Object.defineProperty(A,"SemanticTokenTypes",{enumerable:!0,get:function(){return Ai.SemanticTokenTypes}});Object.defineProperty(A,"SemanticTokenModifiers",{enumerable:!0,get:function(){return Ai.SemanticTokenModifiers}});Object.defineProperty(A,"SemanticTokens",{enumerable:!0,get:function(){return Ai.SemanticTokens}});Object.defineProperty(A,"TokenFormat",{enumerable:!0,get:function(){return Ai.TokenFormat}});Object.defineProperty(A,"SemanticTokensRequest",{enumerable:!0,get:function(){return Ai.SemanticTokensRequest}});Object.defineProperty(A,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return Ai.SemanticTokensDeltaRequest}});Object.defineProperty(A,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return Ai.SemanticTokensRangeRequest}});Object.defineProperty(A,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return Ai.SemanticTokensRefreshRequest}});Object.defineProperty(A,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return Ai.SemanticTokensRegistrationType}});var jA=U_();Object.defineProperty(A,"ShowDocumentRequest",{enumerable:!0,get:function(){return jA.ShowDocumentRequest}});var UA=G_();Object.defineProperty(A,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return UA.LinkedEditingRangeRequest}});var Ls=W_();Object.defineProperty(A,"FileOperationPatternKind",{enumerable:!0,get:function(){return Ls.FileOperationPatternKind}});Object.defineProperty(A,"DidCreateFilesNotification",{enumerable:!0,get:function(){return Ls.DidCreateFilesNotification}});Object.defineProperty(A,"WillCreateFilesRequest",{enumerable:!0,get:function(){return Ls.WillCreateFilesRequest}});Object.defineProperty(A,"DidRenameFilesNotification",{enumerable:!0,get:function(){return Ls.DidRenameFilesNotification}});Object.defineProperty(A,"WillRenameFilesRequest",{enumerable:!0,get:function(){return Ls.WillRenameFilesRequest}});Object.defineProperty(A,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return Ls.DidDeleteFilesNotification}});Object.defineProperty(A,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return Ls.WillDeleteFilesRequest}});var Sp=H_();Object.defineProperty(A,"UniquenessLevel",{enumerable:!0,get:function(){return Sp.UniquenessLevel}});Object.defineProperty(A,"MonikerKind",{enumerable:!0,get:function(){return Sp.MonikerKind}});Object.defineProperty(A,"MonikerRequest",{enumerable:!0,get:function(){return Sp.MonikerRequest}});var $_;(function(t){function e(n){let r=n;return Qi.string(r.language)||Qi.string(r.scheme)||Qi.string(r.pattern)}t.is=e})($_=A.DocumentFilter||(A.DocumentFilter={}));var z_;(function(t){function e(n){if(!Array.isArray(n))return!1;for(let r of n)if(!Qi.string(r)&&!$_.is(r))return!1;return!0}t.is=e})(z_=A.DocumentSelector||(A.DocumentSelector={}));var GA;(function(t){t.type=new Re.ProtocolRequestType("client/registerCapability")})(GA=A.RegistrationRequest||(A.RegistrationRequest={}));var WA;(function(t){t.type=new Re.ProtocolRequestType("client/unregisterCapability")})(WA=A.UnregistrationRequest||(A.UnregistrationRequest={}));var HA;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(HA=A.ResourceOperationKind||(A.ResourceOperationKind={}));var YA;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(YA=A.FailureHandlingKind||(A.FailureHandlingKind={}));var KA;(function(t){function e(n){let r=n;return r&&Qi.string(r.id)&&r.id.length>0}t.hasId=e})(KA=A.StaticRegistrationOptions||(A.StaticRegistrationOptions={}));var $A;(function(t){function e(n){let r=n;return r&&(r.documentSelector===null||z_.is(r.documentSelector))}t.is=e})($A=A.TextDocumentRegistrationOptions||(A.TextDocumentRegistrationOptions={}));var zA;(function(t){function e(r){let i=r;return Qi.objectLiteral(i)&&(i.workDoneProgress===void 0||Qi.boolean(i.workDoneProgress))}t.is=e;function n(r){let i=r;return i&&Qi.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=n})(zA=A.WorkDoneProgressOptions||(A.WorkDoneProgressOptions={}));var XA;(function(t){t.type=new Re.ProtocolRequestType("initialize")})(XA=A.InitializeRequest||(A.InitializeRequest={}));var QA;(function(t){t.unknownProtocolVersion=1})(QA=A.InitializeError||(A.InitializeError={}));var JA;(function(t){t.type=new Re.ProtocolNotificationType("initialized")})(JA=A.InitializedNotification||(A.InitializedNotification={}));var ZA;(function(t){t.type=new Re.ProtocolRequestType0("shutdown")})(ZA=A.ShutdownRequest||(A.ShutdownRequest={}));var ex;(function(t){t.type=new Re.ProtocolNotificationType0("exit")})(ex=A.ExitNotification||(A.ExitNotification={}));var tx;(function(t){t.type=new Re.ProtocolNotificationType("workspace/didChangeConfiguration")})(tx=A.DidChangeConfigurationNotification||(A.DidChangeConfigurationNotification={}));var nx;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4})(nx=A.MessageType||(A.MessageType={}));var rx;(function(t){t.type=new Re.ProtocolNotificationType("window/showMessage")})(rx=A.ShowMessageNotification||(A.ShowMessageNotification={}));var ix;(function(t){t.type=new Re.ProtocolRequestType("window/showMessageRequest")})(ix=A.ShowMessageRequest||(A.ShowMessageRequest={}));var sx;(function(t){t.type=new Re.ProtocolNotificationType("window/logMessage")})(sx=A.LogMessageNotification||(A.LogMessageNotification={}));var ox;(function(t){t.type=new Re.ProtocolNotificationType("telemetry/event")})(ox=A.TelemetryEventNotification||(A.TelemetryEventNotification={}));var ax;(function(t){t.None=0,t.Full=1,t.Incremental=2})(ax=A.TextDocumentSyncKind||(A.TextDocumentSyncKind={}));var lx;(function(t){t.method="textDocument/didOpen",t.type=new Re.ProtocolNotificationType(t.method)})(lx=A.DidOpenTextDocumentNotification||(A.DidOpenTextDocumentNotification={}));var ux;(function(t){function e(r){let i=r;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}t.isIncremental=e;function n(r){let i=r;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}t.isFull=n})(ux=A.TextDocumentContentChangeEvent||(A.TextDocumentContentChangeEvent={}));var cx;(function(t){t.method="textDocument/didChange",t.type=new Re.ProtocolNotificationType(t.method)})(cx=A.DidChangeTextDocumentNotification||(A.DidChangeTextDocumentNotification={}));var fx;(function(t){t.method="textDocument/didClose",t.type=new Re.ProtocolNotificationType(t.method)})(fx=A.DidCloseTextDocumentNotification||(A.DidCloseTextDocumentNotification={}));var px;(function(t){t.method="textDocument/didSave",t.type=new Re.ProtocolNotificationType(t.method)})(px=A.DidSaveTextDocumentNotification||(A.DidSaveTextDocumentNotification={}));var dx;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(dx=A.TextDocumentSaveReason||(A.TextDocumentSaveReason={}));var mx;(function(t){t.method="textDocument/willSave",t.type=new Re.ProtocolNotificationType(t.method)})(mx=A.WillSaveTextDocumentNotification||(A.WillSaveTextDocumentNotification={}));var hx;(function(t){t.method="textDocument/willSaveWaitUntil",t.type=new Re.ProtocolRequestType(t.method)})(hx=A.WillSaveTextDocumentWaitUntilRequest||(A.WillSaveTextDocumentWaitUntilRequest={}));var gx;(function(t){t.type=new Re.ProtocolNotificationType("workspace/didChangeWatchedFiles")})(gx=A.DidChangeWatchedFilesNotification||(A.DidChangeWatchedFilesNotification={}));var _x;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(_x=A.FileChangeType||(A.FileChangeType={}));var yx;(function(t){t.Create=1,t.Change=2,t.Delete=4})(yx=A.WatchKind||(A.WatchKind={}));var bx;(function(t){t.type=new Re.ProtocolNotificationType("textDocument/publishDiagnostics")})(bx=A.PublishDiagnosticsNotification||(A.PublishDiagnosticsNotification={}));var Tx;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(Tx=A.CompletionTriggerKind||(A.CompletionTriggerKind={}));var Nx;(function(t){t.method="textDocument/completion",t.type=new Re.ProtocolRequestType(t.method)})(Nx=A.CompletionRequest||(A.CompletionRequest={}));var vx;(function(t){t.method="completionItem/resolve",t.type=new Re.ProtocolRequestType(t.method)})(vx=A.CompletionResolveRequest||(A.CompletionResolveRequest={}));var Px;(function(t){t.method="textDocument/hover",t.type=new Re.ProtocolRequestType(t.method)})(Px=A.HoverRequest||(A.HoverRequest={}));var Ix;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(Ix=A.SignatureHelpTriggerKind||(A.SignatureHelpTriggerKind={}));var Sx;(function(t){t.method="textDocument/signatureHelp",t.type=new Re.ProtocolRequestType(t.method)})(Sx=A.SignatureHelpRequest||(A.SignatureHelpRequest={}));var Cx;(function(t){t.method="textDocument/definition",t.type=new Re.ProtocolRequestType(t.method)})(Cx=A.DefinitionRequest||(A.DefinitionRequest={}));var Rx;(function(t){t.method="textDocument/references",t.type=new Re.ProtocolRequestType(t.method)})(Rx=A.ReferencesRequest||(A.ReferencesRequest={}));var Ax;(function(t){t.method="textDocument/documentHighlight",t.type=new Re.ProtocolRequestType(t.method)})(Ax=A.DocumentHighlightRequest||(A.DocumentHighlightRequest={}));var xx;(function(t){t.method="textDocument/documentSymbol",t.type=new Re.ProtocolRequestType(t.method)})(xx=A.DocumentSymbolRequest||(A.DocumentSymbolRequest={}));var Ex;(function(t){t.method="textDocument/codeAction",t.type=new Re.ProtocolRequestType(t.method)})(Ex=A.CodeActionRequest||(A.CodeActionRequest={}));var wx;(function(t){t.method="codeAction/resolve",t.type=new Re.ProtocolRequestType(t.method)})(wx=A.CodeActionResolveRequest||(A.CodeActionResolveRequest={}));var Ox;(function(t){t.method="workspace/symbol",t.type=new Re.ProtocolRequestType(t.method)})(Ox=A.WorkspaceSymbolRequest||(A.WorkspaceSymbolRequest={}));var Lx;(function(t){t.method="textDocument/codeLens",t.type=new Re.ProtocolRequestType(t.method)})(Lx=A.CodeLensRequest||(A.CodeLensRequest={}));var Dx;(function(t){t.method="codeLens/resolve",t.type=new Re.ProtocolRequestType(t.method)})(Dx=A.CodeLensResolveRequest||(A.CodeLensResolveRequest={}));var kx;(function(t){t.method="workspace/codeLens/refresh",t.type=new Re.ProtocolRequestType0(t.method)})(kx=A.CodeLensRefreshRequest||(A.CodeLensRefreshRequest={}));var Mx;(function(t){t.method="textDocument/documentLink",t.type=new Re.ProtocolRequestType(t.method)})(Mx=A.DocumentLinkRequest||(A.DocumentLinkRequest={}));var Fx;(function(t){t.method="documentLink/resolve",t.type=new Re.ProtocolRequestType(t.method)})(Fx=A.DocumentLinkResolveRequest||(A.DocumentLinkResolveRequest={}));var Vx;(function(t){t.method="textDocument/formatting",t.type=new Re.ProtocolRequestType(t.method)})(Vx=A.DocumentFormattingRequest||(A.DocumentFormattingRequest={}));var qx;(function(t){t.method="textDocument/rangeFormatting",t.type=new Re.ProtocolRequestType(t.method)})(qx=A.DocumentRangeFormattingRequest||(A.DocumentRangeFormattingRequest={}));var Bx;(function(t){t.method="textDocument/onTypeFormatting",t.type=new Re.ProtocolRequestType(t.method)})(Bx=A.DocumentOnTypeFormattingRequest||(A.DocumentOnTypeFormattingRequest={}));var jx;(function(t){t.Identifier=1})(jx=A.PrepareSupportDefaultBehavior||(A.PrepareSupportDefaultBehavior={}));var Ux;(function(t){t.method="textDocument/rename",t.type=new Re.ProtocolRequestType(t.method)})(Ux=A.RenameRequest||(A.RenameRequest={}));var Gx;(function(t){t.method="textDocument/prepareRename",t.type=new Re.ProtocolRequestType(t.method)})(Gx=A.PrepareRenameRequest||(A.PrepareRenameRequest={}));var Wx;(function(t){t.type=new Re.ProtocolRequestType("workspace/executeCommand")})(Wx=A.ExecuteCommandRequest||(A.ExecuteCommandRequest={}));var Hx;(function(t){t.type=new Re.ProtocolRequestType("workspace/applyEdit")})(Hx=A.ApplyWorkspaceEditRequest||(A.ApplyWorkspaceEditRequest={}))});var J_=K(vu=>{"use strict";Object.defineProperty(vu,"__esModule",{value:!0});vu.createProtocolConnection=void 0;var Q_=xo();function Yx(t,e,n,r){return Q_.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),Q_.createMessageConnection(t,e,n,r)}vu.createProtocolConnection=Yx});var Z_=K(yn=>{"use strict";var Kx=yn&&yn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Pu=yn&&yn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Kx(e,t,n)};Object.defineProperty(yn,"__esModule",{value:!0});yn.LSPErrorCodes=yn.createProtocolConnection=void 0;Pu(xo(),yn);Pu(ot(),yn);Pu(Kt(),yn);Pu(X_(),yn);var $x=J_();Object.defineProperty(yn,"createProtocolConnection",{enumerable:!0,get:function(){return $x.createProtocolConnection}});var zx;(function(t){t.lspReservedErrorRangeStart=-32899,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(zx=yn.LSPErrorCodes||(yn.LSPErrorCodes={}))});var pn=K(ii=>{"use strict";var Xx=ii&&ii.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),ey=ii&&ii.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Xx(e,t,n)};Object.defineProperty(ii,"__esModule",{value:!0});ii.createProtocolConnection=void 0;var Qx=Tp();ey(Tp(),ii);ey(Z_(),ii);function Jx(t,e,n,r){return Qx.createMessageConnection(t,e,n,r)}ii.createProtocolConnection=Jx});var Cp=K(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.generateUuid=ir.parse=ir.isUUID=ir.v4=ir.empty=void 0;var Iu=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},Oe=class extends Iu{constructor(){super([Oe._randomHex(),Oe._randomHex(),Oe._randomHex(),Oe._randomHex(),Oe._randomHex(),Oe._randomHex(),Oe._randomHex(),Oe._randomHex(),"-",Oe._randomHex(),Oe._randomHex(),Oe._randomHex(),Oe._randomHex(),"-","4",Oe._randomHex(),Oe._randomHex(),Oe._randomHex(),"-",Oe._oneOf(Oe._timeHighBits),Oe._randomHex(),Oe._randomHex(),Oe._randomHex(),"-",Oe._randomHex(),Oe._randomHex(),Oe._randomHex(),Oe._randomHex(),Oe._randomHex(),Oe._randomHex(),Oe._randomHex(),Oe._randomHex(),Oe._randomHex(),Oe._randomHex(),Oe._randomHex(),Oe._randomHex()].join(""))}static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return Oe._oneOf(Oe._chars)}};Oe._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];Oe._timeHighBits=["8","9","a","b"];ir.empty=new Iu("00000000-0000-0000-0000-000000000000");function ty(){return new Oe}ir.v4=ty;var Zx=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function ny(t){return Zx.test(t)}ir.isUUID=ny;function e0(t){if(!ny(t))throw new Error("invalid uuid");return new Iu(t)}ir.parse=e0;function t0(){return ty().asHex()}ir.generateUuid=t0});var iy=K(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});Zi.attachPartialResult=Zi.ProgressFeature=Zi.attachWorkDone=void 0;var Ji=pn(),n0=Cp(),xi=class{constructor(e,n){this._connection=e,this._token=n,xi.Instances.set(this._token,this)}begin(e,n,r,i){let s={kind:"begin",title:e,percentage:n,message:r,cancellable:i};this._connection.sendProgress(Ji.WorkDoneProgress.type,this._token,s)}report(e,n){let r={kind:"report"};typeof e=="number"?(r.percentage=e,n!==void 0&&(r.message=n)):r.message=e,this._connection.sendProgress(Ji.WorkDoneProgress.type,this._token,r)}done(){xi.Instances.delete(this._token),this._connection.sendProgress(Ji.WorkDoneProgress.type,this._token,{kind:"end"})}};xi.Instances=new Map;var Rp=class extends xi{constructor(e,n){super(e,n);this._source=new Ji.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},Su=class{constructor(){}begin(){}report(){}done(){}},Ap=class extends Su{constructor(){super();this._source=new Ji.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function r0(t,e){if(e===void 0||e.workDoneToken===void 0)return new Su;let n=e.workDoneToken;return delete e.workDoneToken,new xi(t,n)}Zi.attachWorkDone=r0;var i0=t=>class extends t{constructor(){super();this._progressSupported=!1}initialize(e){var n;((n=e==null?void 0:e.window)===null||n===void 0?void 0:n.workDoneProgress)===!0&&(this._progressSupported=!0,this.connection.onNotification(Ji.WorkDoneProgressCancelNotification.type,r=>{let i=xi.Instances.get(r.token);(i instanceof Rp||i instanceof Ap)&&i.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new Su:new xi(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=n0.generateUuid();return this.connection.sendRequest(Ji.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new Rp(this.connection,e))}else return Promise.resolve(new Ap)}};Zi.ProgressFeature=i0;var xp;(function(t){t.type=new Ji.ProgressType})(xp||(xp={}));var ry=class{constructor(e,n){this._connection=e,this._token=n}report(e){this._connection.sendProgress(xp.type,this._token,e)}};function s0(t,e){if(e===void 0||e.partialResultToken===void 0)return;let n=e.partialResultToken;return delete e.partialResultToken,new ry(t,n)}Zi.attachPartialResult=s0});var sy=K(Cu=>{"use strict";Object.defineProperty(Cu,"__esModule",{value:!0});Cu.ConfigurationFeature=void 0;var o0=pn(),a0=du(),l0=t=>class extends t{getConfiguration(e){return e?a0.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let n={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(o0.ConfigurationRequest.type,n).then(r=>Array.isArray(e)?r:r[0])}};Cu.ConfigurationFeature=l0});var oy=K(Au=>{"use strict";Object.defineProperty(Au,"__esModule",{value:!0});Au.WorkspaceFoldersFeature=void 0;var Ru=pn(),u0=t=>class extends t{initialize(e){let n=e.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Ru.Emitter,this.connection.onNotification(Ru.DidChangeWorkspaceFoldersNotification.type,r=>{this._onDidChangeWorkspaceFolders.fire(r.event)}))}getWorkspaceFolders(){return this.connection.sendRequest(Ru.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return this._unregistration||(this._unregistration=this.connection.client.register(Ru.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};Au.WorkspaceFoldersFeature=u0});var ay=K(xu=>{"use strict";Object.defineProperty(xu,"__esModule",{value:!0});xu.CallHierarchyFeature=void 0;var Ep=pn(),c0=t=>class extends t{get callHierarchy(){return{onPrepare:e=>{this.connection.onRequest(Ep.CallHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0))},onIncomingCalls:e=>{let n=Ep.CallHierarchyIncomingCallsRequest.type;this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onOutgoingCalls:e=>{let n=Ep.CallHierarchyOutgoingCallsRequest.type;this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};xu.CallHierarchyFeature=c0});var Op=K(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.SemanticTokensBuilder=Oo.SemanticTokensFeature=void 0;var wp=pn(),f0=t=>class extends t{get semanticTokens(){return{on:e=>{let n=wp.SemanticTokensRequest.type;this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onDelta:e=>{let n=wp.SemanticTokensDeltaRequest.type;this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onRange:e=>{let n=wp.SemanticTokensRangeRequest.type;this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Oo.SemanticTokensFeature=f0;var ly=class{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(e,n,r,i,s){let o=e,a=n;this._dataLen>0&&(o-=this._prevLine,o===0&&(a-=this._prevChar)),this._data[this._dataLen++]=o,this._data[this._dataLen++]=a,this._data[this._dataLen++]=r,this._data[this._dataLen++]=i,this._data[this._dataLen++]=s,this._prevLine=e,this._prevChar=n}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){if(this._prevData!==void 0){let e=this._prevData.length,n=this._data.length,r=0;for(;r{"use strict";Object.defineProperty(Eu,"__esModule",{value:!0});Eu.ShowDocumentFeature=void 0;var p0=pn(),d0=t=>class extends t{showDocument(e){return this.connection.sendRequest(p0.ShowDocumentRequest.type,e)}};Eu.ShowDocumentFeature=d0});var cy=K(wu=>{"use strict";Object.defineProperty(wu,"__esModule",{value:!0});wu.FileOperationsFeature=void 0;var Lo=pn(),m0=t=>class extends t{onDidCreateFiles(e){this.connection.onNotification(Lo.DidCreateFilesNotification.type,n=>{e(n)})}onDidRenameFiles(e){this.connection.onNotification(Lo.DidRenameFilesNotification.type,n=>{e(n)})}onDidDeleteFiles(e){this.connection.onNotification(Lo.DidDeleteFilesNotification.type,n=>{e(n)})}onWillCreateFiles(e){return this.connection.onRequest(Lo.WillCreateFilesRequest.type,(n,r)=>e(n,r))}onWillRenameFiles(e){return this.connection.onRequest(Lo.WillRenameFilesRequest.type,(n,r)=>e(n,r))}onWillDeleteFiles(e){return this.connection.onRequest(Lo.WillDeleteFilesRequest.type,(n,r)=>e(n,r))}};wu.FileOperationsFeature=m0});var fy=K(Ou=>{"use strict";Object.defineProperty(Ou,"__esModule",{value:!0});Ou.LinkedEditingRangeFeature=void 0;var h0=pn(),g0=t=>class extends t{onLinkedEditingRange(e){this.connection.onRequest(h0.LinkedEditingRangeRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0))}};Ou.LinkedEditingRangeFeature=g0});var py=K(Lu=>{"use strict";Object.defineProperty(Lu,"__esModule",{value:!0});Lu.MonikerFeature=void 0;var _0=pn(),y0=t=>class extends t{get moniker(){return{on:e=>{let n=_0.MonikerRequest.type;this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Lu.MonikerFeature=y0});var jp=K(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.createConnection=He.combineFeatures=He.combineLanguagesFeatures=He.combineWorkspaceFeatures=He.combineWindowFeatures=He.combineClientFeatures=He.combineTracerFeatures=He.combineTelemetryFeatures=He.combineConsoleFeatures=He._LanguagesImpl=He.BulkUnregistration=He.BulkRegistration=He.ErrorMessageTracker=He.TextDocuments=void 0;var z=pn(),sr=du(),Lp=Cp(),Ae=iy(),b0=sy(),T0=oy(),N0=ay(),v0=Op(),P0=uy(),I0=cy(),S0=fy(),C0=py();function Dp(t){if(t!==null)return t}var dy=class{constructor(e){this._documents=Object.create(null),this._configuration=e,this._onDidChangeContent=new z.Emitter,this._onDidOpen=new z.Emitter,this._onDidClose=new z.Emitter,this._onDidSave=new z.Emitter,this._onWillSave=new z.Emitter}get onDidChangeContent(){return this._onDidChangeContent.event}get onDidOpen(){return this._onDidOpen.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._documents[e]}all(){return Object.keys(this._documents).map(e=>this._documents[e])}keys(){return Object.keys(this._documents)}listen(e){e.__textDocumentSync=z.TextDocumentSyncKind.Full,e.onDidOpenTextDocument(n=>{let r=n.textDocument,i=this._configuration.create(r.uri,r.languageId,r.version,r.text);this._documents[r.uri]=i;let s=Object.freeze({document:i});this._onDidOpen.fire(s),this._onDidChangeContent.fire(s)}),e.onDidChangeTextDocument(n=>{let r=n.textDocument,i=n.contentChanges;if(i.length===0)return;let s=this._documents[r.uri],{version:o}=r;if(o==null)throw new Error(`Received document change event for ${r.uri} without valid version identifier`);s=this._configuration.update(s,i,o),this._documents[r.uri]=s,this._onDidChangeContent.fire(Object.freeze({document:s}))}),e.onDidCloseTextDocument(n=>{let r=this._documents[n.textDocument.uri];r&&(delete this._documents[n.textDocument.uri],this._onDidClose.fire(Object.freeze({document:r})))}),e.onWillSaveTextDocument(n=>{let r=this._documents[n.textDocument.uri];r&&this._onWillSave.fire(Object.freeze({document:r,reason:n.reason}))}),e.onWillSaveTextDocumentWaitUntil((n,r)=>{let i=this._documents[n.textDocument.uri];return i&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:i,reason:n.reason}),r):[]}),e.onDidSaveTextDocument(n=>{let r=this._documents[n.textDocument.uri];r&&this._onDidSave.fire(Object.freeze({document:r}))})}};He.TextDocuments=dy;var my=class{constructor(){this._messages=Object.create(null)}add(e){let n=this._messages[e];n||(n=0),n++,this._messages[e]=n}sendErrors(e){Object.keys(this._messages).forEach(n=>{e.window.showErrorMessage(n)})}};He.ErrorMessageTracker=my;var kp=class{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(z.MessageType.Error,e)}warn(e){this.send(z.MessageType.Warning,e)}info(e){this.send(z.MessageType.Info,e)}log(e){this.send(z.MessageType.Log,e)}send(e,n){this._rawConnection&&this._rawConnection.sendNotification(z.LogMessageNotification.type,{type:e,message:n})}},hy=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...n){let r={type:z.MessageType.Error,message:e,actions:n};return this.connection.sendRequest(z.ShowMessageRequest.type,r).then(Dp)}showWarningMessage(e,...n){let r={type:z.MessageType.Warning,message:e,actions:n};return this.connection.sendRequest(z.ShowMessageRequest.type,r).then(Dp)}showInformationMessage(e,...n){let r={type:z.MessageType.Info,message:e,actions:n};return this.connection.sendRequest(z.ShowMessageRequest.type,r).then(Dp)}},gy=P0.ShowDocumentFeature(Ae.ProgressFeature(hy)),R0;(function(t){function e(){return new Mp}t.create=e})(R0=He.BulkRegistration||(He.BulkRegistration={}));var Mp=class{constructor(){this._registrations=[],this._registered=new Set}add(e,n){let r=sr.string(e)?e:e.method;if(this._registered.has(r))throw new Error(`${r} is already added to this registration`);let i=Lp.generateUuid();this._registrations.push({id:i,method:r,registerOptions:n||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}},A0;(function(t){function e(){return new Du(void 0,[])}t.create=e})(A0=He.BulkUnregistration||(He.BulkUnregistration={}));var Du=class{constructor(e,n){this._connection=e,this._unregistrations=new Map,n.forEach(r=>{this._unregistrations.set(r.method,r)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let r of this._unregistrations.values())e.push(r);let n={unregisterations:e};this._connection.sendRequest(z.UnregistrationRequest.type,n).then(void 0,r=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let n=sr.string(e)?e:e.method,r=this._unregistrations.get(n);if(!r)return!1;let i={unregisterations:[r]};return this._connection.sendRequest(z.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(n)},s=>{this._connection.console.info(`Un-registering request handler for ${r.id} failed.`)}),!0}},Fp=class{attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,n,r){return e instanceof Mp?this.registerMany(e):e instanceof Du?this.registerSingle1(e,n,r):this.registerSingle2(e,n)}registerSingle1(e,n,r){let i=sr.string(n)?n:n.method,s=Lp.generateUuid(),o={registrations:[{id:s,method:i,registerOptions:r||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(z.RegistrationRequest.type,o).then(a=>(e.add({id:s,method:i}),e),a=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(a)))}registerSingle2(e,n){let r=sr.string(e)?e:e.method,i=Lp.generateUuid(),s={registrations:[{id:i,method:r,registerOptions:n||{}}]};return this.connection.sendRequest(z.RegistrationRequest.type,s).then(o=>z.Disposable.create(()=>{this.unregisterSingle(i,r)}),o=>(this.connection.console.info(`Registering request handler for ${r} failed.`),Promise.reject(o)))}unregisterSingle(e,n){let r={unregisterations:[{id:e,method:n}]};return this.connection.sendRequest(z.UnregistrationRequest.type,r).then(void 0,i=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let n=e.asRegistrationParams();return this.connection.sendRequest(z.RegistrationRequest.type,n).then(()=>new Du(this._connection,n.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}},_y=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function n(i){return i&&!!i.edit}let r=n(e)?e:{edit:e};return this.connection.sendRequest(z.ApplyWorkspaceEditRequest.type,r)}},yy=I0.FileOperationsFeature(T0.WorkspaceFoldersFeature(b0.ConfigurationFeature(_y))),Vp=class{constructor(){this._trace=z.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,n){this._trace!==z.Trace.Off&&this.connection.sendNotification(z.LogTraceNotification.type,{message:e,verbose:this._trace===z.Trace.Verbose?n:void 0})}},qp=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(z.TelemetryEventNotification.type,e)}},Bp=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return Ae.attachWorkDone(this.connection,e)}attachPartialResultProgress(e,n){return Ae.attachPartialResult(this.connection,n)}};He._LanguagesImpl=Bp;var by=C0.MonikerFeature(S0.LinkedEditingRangeFeature(v0.SemanticTokensFeature(N0.CallHierarchyFeature(Bp))));function Ty(t,e){return function(n){return e(t(n))}}He.combineConsoleFeatures=Ty;function Ny(t,e){return function(n){return e(t(n))}}He.combineTelemetryFeatures=Ny;function vy(t,e){return function(n){return e(t(n))}}He.combineTracerFeatures=vy;function Py(t,e){return function(n){return e(t(n))}}He.combineClientFeatures=Py;function Iy(t,e){return function(n){return e(t(n))}}He.combineWindowFeatures=Iy;function Sy(t,e){return function(n){return e(t(n))}}He.combineWorkspaceFeatures=Sy;function x0(t,e){return function(n){return e(t(n))}}He.combineLanguagesFeatures=x0;function E0(t,e){function n(i,s,o){return i&&s?o(i,s):i||s}return{__brand:"features",console:n(t.console,e.console,Ty),tracer:n(t.tracer,e.tracer,vy),telemetry:n(t.telemetry,e.telemetry,Ny),client:n(t.client,e.client,Py),window:n(t.window,e.window,Iy),workspace:n(t.workspace,e.workspace,Sy)}}He.combineFeatures=E0;function w0(t,e,n){let r=n&&n.console?new(n.console(kp)):new kp,i=t(r);r.rawAttach(i);let s=n&&n.tracer?new(n.tracer(Vp)):new Vp,o=n&&n.telemetry?new(n.telemetry(qp)):new qp,a=n&&n.client?new(n.client(Fp)):new Fp,l=n&&n.window?new(n.window(gy)):new gy,u=n&&n.workspace?new(n.workspace(yy)):new yy,c=n&&n.languages?new(n.languages(by)):new by,f=[r,s,o,a,l,u,c];function m(h){return h instanceof Promise?h:sr.thenable(h)?new Promise((b,g)=>{h.then(N=>b(N),N=>g(N))}):Promise.resolve(h)}let d,p,_,C={listen:()=>i.listen(),sendRequest:(h,...b)=>i.sendRequest(sr.string(h)?h:h.method,...b),onRequest:(h,b)=>i.onRequest(h,b),sendNotification:(h,b)=>{let g=sr.string(h)?h:h.method;arguments.length===1?i.sendNotification(g):i.sendNotification(g,b)},onNotification:(h,b)=>i.onNotification(h,b),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:h=>p=h,onInitialized:h=>i.onNotification(z.InitializedNotification.type,h),onShutdown:h=>d=h,onExit:h=>_=h,get console(){return r},get telemetry(){return o},get tracer(){return s},get client(){return a},get window(){return l},get workspace(){return u},get languages(){return c},onDidChangeConfiguration:h=>i.onNotification(z.DidChangeConfigurationNotification.type,h),onDidChangeWatchedFiles:h=>i.onNotification(z.DidChangeWatchedFilesNotification.type,h),__textDocumentSync:void 0,onDidOpenTextDocument:h=>i.onNotification(z.DidOpenTextDocumentNotification.type,h),onDidChangeTextDocument:h=>i.onNotification(z.DidChangeTextDocumentNotification.type,h),onDidCloseTextDocument:h=>i.onNotification(z.DidCloseTextDocumentNotification.type,h),onWillSaveTextDocument:h=>i.onNotification(z.WillSaveTextDocumentNotification.type,h),onWillSaveTextDocumentWaitUntil:h=>i.onRequest(z.WillSaveTextDocumentWaitUntilRequest.type,h),onDidSaveTextDocument:h=>i.onNotification(z.DidSaveTextDocumentNotification.type,h),sendDiagnostics:h=>i.sendNotification(z.PublishDiagnosticsNotification.type,h),onHover:h=>i.onRequest(z.HoverRequest.type,(b,g)=>h(b,g,Ae.attachWorkDone(i,b),void 0)),onCompletion:h=>i.onRequest(z.CompletionRequest.type,(b,g)=>h(b,g,Ae.attachWorkDone(i,b),Ae.attachPartialResult(i,b))),onCompletionResolve:h=>i.onRequest(z.CompletionResolveRequest.type,h),onSignatureHelp:h=>i.onRequest(z.SignatureHelpRequest.type,(b,g)=>h(b,g,Ae.attachWorkDone(i,b),void 0)),onDeclaration:h=>i.onRequest(z.DeclarationRequest.type,(b,g)=>h(b,g,Ae.attachWorkDone(i,b),Ae.attachPartialResult(i,b))),onDefinition:h=>i.onRequest(z.DefinitionRequest.type,(b,g)=>h(b,g,Ae.attachWorkDone(i,b),Ae.attachPartialResult(i,b))),onTypeDefinition:h=>i.onRequest(z.TypeDefinitionRequest.type,(b,g)=>h(b,g,Ae.attachWorkDone(i,b),Ae.attachPartialResult(i,b))),onImplementation:h=>i.onRequest(z.ImplementationRequest.type,(b,g)=>h(b,g,Ae.attachWorkDone(i,b),Ae.attachPartialResult(i,b))),onReferences:h=>i.onRequest(z.ReferencesRequest.type,(b,g)=>h(b,g,Ae.attachWorkDone(i,b),Ae.attachPartialResult(i,b))),onDocumentHighlight:h=>i.onRequest(z.DocumentHighlightRequest.type,(b,g)=>h(b,g,Ae.attachWorkDone(i,b),Ae.attachPartialResult(i,b))),onDocumentSymbol:h=>i.onRequest(z.DocumentSymbolRequest.type,(b,g)=>h(b,g,Ae.attachWorkDone(i,b),Ae.attachPartialResult(i,b))),onWorkspaceSymbol:h=>i.onRequest(z.WorkspaceSymbolRequest.type,(b,g)=>h(b,g,Ae.attachWorkDone(i,b),Ae.attachPartialResult(i,b))),onCodeAction:h=>i.onRequest(z.CodeActionRequest.type,(b,g)=>h(b,g,Ae.attachWorkDone(i,b),Ae.attachPartialResult(i,b))),onCodeActionResolve:h=>i.onRequest(z.CodeActionResolveRequest.type,(b,g)=>h(b,g)),onCodeLens:h=>i.onRequest(z.CodeLensRequest.type,(b,g)=>h(b,g,Ae.attachWorkDone(i,b),Ae.attachPartialResult(i,b))),onCodeLensResolve:h=>i.onRequest(z.CodeLensResolveRequest.type,(b,g)=>h(b,g)),onDocumentFormatting:h=>i.onRequest(z.DocumentFormattingRequest.type,(b,g)=>h(b,g,Ae.attachWorkDone(i,b),void 0)),onDocumentRangeFormatting:h=>i.onRequest(z.DocumentRangeFormattingRequest.type,(b,g)=>h(b,g,Ae.attachWorkDone(i,b),void 0)),onDocumentOnTypeFormatting:h=>i.onRequest(z.DocumentOnTypeFormattingRequest.type,(b,g)=>h(b,g)),onRenameRequest:h=>i.onRequest(z.RenameRequest.type,(b,g)=>h(b,g,Ae.attachWorkDone(i,b),void 0)),onPrepareRename:h=>i.onRequest(z.PrepareRenameRequest.type,(b,g)=>h(b,g)),onDocumentLinks:h=>i.onRequest(z.DocumentLinkRequest.type,(b,g)=>h(b,g,Ae.attachWorkDone(i,b),Ae.attachPartialResult(i,b))),onDocumentLinkResolve:h=>i.onRequest(z.DocumentLinkResolveRequest.type,(b,g)=>h(b,g)),onDocumentColor:h=>i.onRequest(z.DocumentColorRequest.type,(b,g)=>h(b,g,Ae.attachWorkDone(i,b),Ae.attachPartialResult(i,b))),onColorPresentation:h=>i.onRequest(z.ColorPresentationRequest.type,(b,g)=>h(b,g,Ae.attachWorkDone(i,b),Ae.attachPartialResult(i,b))),onFoldingRanges:h=>i.onRequest(z.FoldingRangeRequest.type,(b,g)=>h(b,g,Ae.attachWorkDone(i,b),Ae.attachPartialResult(i,b))),onSelectionRanges:h=>i.onRequest(z.SelectionRangeRequest.type,(b,g)=>h(b,g,Ae.attachWorkDone(i,b),Ae.attachPartialResult(i,b))),onExecuteCommand:h=>i.onRequest(z.ExecuteCommandRequest.type,(b,g)=>h(b,g,Ae.attachWorkDone(i,b),void 0)),dispose:()=>i.dispose()};for(let h of f)h.attach(C);return i.onRequest(z.InitializeRequest.type,h=>{e.initialize(h),sr.string(h.trace)&&(s.trace=z.Trace.fromString(h.trace));for(let b of f)b.initialize(h.capabilities);if(p){let b=p(h,new z.CancellationTokenSource().token,Ae.attachWorkDone(i,h),void 0);return m(b).then(g=>{if(g instanceof z.ResponseError)return g;let N=g;N||(N={capabilities:{}});let S=N.capabilities;S||(S={},N.capabilities=S),S.textDocumentSync===void 0||S.textDocumentSync===null?S.textDocumentSync=sr.number(C.__textDocumentSync)?C.__textDocumentSync:z.TextDocumentSyncKind.None:!sr.number(S.textDocumentSync)&&!sr.number(S.textDocumentSync.change)&&(S.textDocumentSync.change=sr.number(C.__textDocumentSync)?C.__textDocumentSync:z.TextDocumentSyncKind.None);for(let V of f)V.fillServerCapabilities(S);return N})}else{let b={capabilities:{textDocumentSync:z.TextDocumentSyncKind.None}};for(let g of f)g.fillServerCapabilities(b.capabilities);return b}}),i.onRequest(z.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,d)return d(new z.CancellationTokenSource().token)}),i.onNotification(z.ExitNotification.type,()=>{try{_&&_()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(z.SetTraceNotification.type,h=>{s.trace=z.Trace.fromString(h.value)}),C}He.createConnection=w0});var Ry=K(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.resolveModulePath=bn.FileSystem=bn.resolveGlobalYarnPath=bn.resolveGlobalNodePath=bn.resolve=bn.uriToFilePath=void 0;var O0=require("url"),Ar=require("path"),Up=require("fs"),Gp=require("child_process");function L0(t){let e=O0.parse(t);if(e.protocol!=="file:"||!e.path)return;let n=e.path.split("/");for(var r=0,i=n.length;r1){let s=n[0],o=n[1];s.length===0&&o.length>1&&o[1]===":"&&n.shift()}return Ar.normalize(n.join("/"))}bn.uriToFilePath=L0;function Wp(){return process.platform==="win32"}function ku(t,e,n,r){let i="NODE_PATH",s=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((o,a)=>{let l=process.env,u=Object.create(null);Object.keys(l).forEach(c=>u[c]=l[c]),e&&Up.existsSync(e)&&(u[i]?u[i]=e+Ar.delimiter+u[i]:u[i]=e,r&&r(`NODE_PATH value is: ${u[i]}`)),u.ELECTRON_RUN_AS_NODE="1";try{let c=Gp.fork("",[],{cwd:n,env:u,execArgv:["-e",s]});if(c.pid===void 0){a(new Error(`Starting process to resolve node module ${t} failed`));return}c.on("error",m=>{a(m)}),c.on("message",m=>{m.c==="r"&&(c.send({c:"e"}),m.s?o(m.r):a(new Error(`Failed to resolve module: ${t}`)))});let f={c:"rs",a:t};c.send(f)}catch(c){a(c)}})}bn.resolve=ku;function Hp(t){let e="npm",n=Object.create(null);Object.keys(process.env).forEach(s=>n[s]=process.env[s]),n.NO_UPDATE_NOTIFIER="true";let r={encoding:"utf8",env:n};Wp()&&(e="npm.cmd",r.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let s=Gp.spawnSync(e,["config","get","prefix"],r).stdout;if(!s){t&&t("'npm config get prefix' didn't return a value.");return}let o=s.trim();return t&&t(`'npm config get prefix' value is: ${o}`),o.length>0?Wp()?Ar.join(o,"node_modules"):Ar.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",i)}}bn.resolveGlobalNodePath=Hp;function D0(t){let e="yarn",n={encoding:"utf8"};Wp()&&(e="yarn.cmd",n.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let i=Gp.spawnSync(e,["global","dir","--json"],n),s=i.stdout;if(!s){t&&(t("'yarn global dir' didn't return a value."),i.stderr&&t(i.stderr));return}let o=s.trim().split(/\r?\n/);for(let a of o)try{let l=JSON.parse(a);if(l.type==="log")return Ar.join(l.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",r)}}bn.resolveGlobalYarnPath=D0;var Cy;(function(t){let e;function n(){return e!==void 0||(process.platform==="win32"?e=!1:e=!Up.existsSync(__filename.toUpperCase())||!Up.existsSync(__filename.toLowerCase())),e}t.isCaseSensitive=n;function r(i,s){return n()?Ar.normalize(s).indexOf(Ar.normalize(i))===0:Ar.normalize(s).toLowerCase().indexOf(Ar.normalize(i).toLowerCase())===0}t.isParent=r})(Cy=bn.FileSystem||(bn.FileSystem={}));function k0(t,e,n,r){return n?(Ar.isAbsolute(n)||(n=Ar.join(t,n)),ku(e,n,n,r).then(i=>Cy.isParent(n,i)?i:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,i=>ku(e,Hp(r),t,r))):ku(e,Hp(r),t,r)}bn.resolveModulePath=k0});var Yp=K((UV,Ay)=>{"use strict";Ay.exports=pn()});var Ey=K(Bn=>{"use strict";var M0=Bn&&Bn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),xy=Bn&&Bn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&M0(e,t,n)};Object.defineProperty(Bn,"__esModule",{value:!0});Bn.ProposedFeatures=Bn.SemanticTokensBuilder=void 0;var F0=Op();Object.defineProperty(Bn,"SemanticTokensBuilder",{enumerable:!0,get:function(){return F0.SemanticTokensBuilder}});xy(pn(),Bn);xy(jp(),Bn);var V0;(function(t){t.all={__brand:"features"}})(V0=Bn.ProposedFeatures||(Bn.ProposedFeatures={}))});var nn=K(jn=>{"use strict";var q0=jn&&jn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),wy=jn&&jn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&q0(e,t,n)};Object.defineProperty(jn,"__esModule",{value:!0});jn.createConnection=jn.Files=void 0;var Kp=du(),B0=jp(),rl=Ry(),Ds=Yp();wy(Yp(),jn);wy(Ey(),jn);var j0;(function(t){t.uriToFilePath=rl.uriToFilePath,t.resolveGlobalNodePath=rl.resolveGlobalNodePath,t.resolveGlobalYarnPath=rl.resolveGlobalYarnPath,t.resolve=rl.resolve,t.resolveModulePath=rl.resolveModulePath})(j0=jn.Files||(jn.Files={}));var Oy;function Mu(){if(Oy!==void 0)try{Oy.end()}catch{}}var Do=!1,Ly;function U0(){let t="--clientProcessId";function e(n){try{let r=parseInt(n);isNaN(r)||(Ly=setInterval(()=>{try{process.kill(r,0)}catch{Mu(),process.exit(Do?0:1)}},3e3))}catch{}}for(let n=2;n{let e=t.processId;Kp.number(e)&&Ly===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(Do?0:1)}},3e3)},get shutdownReceived(){return Do},set shutdownReceived(t){Do=t},exit:t=>{Mu(),process.exit(t)}};function W0(t,e,n,r){let i,s,o,a;return t!==void 0&&t.__brand==="features"&&(i=t,t=e,e=n,n=r),Ds.ConnectionStrategy.is(t)||Ds.ConnectionOptions.is(t)?a=t:(s=t,o=e,a=n),H0(s,o,a,i)}jn.createConnection=W0;function H0(t,e,n,r){if(!t&&!e&&process.argv.length>2){let a,l,u=process.argv.slice(2);for(let c=0;c{Mu(),process.exit(Do?0:1)}),a.on("close",()=>{Mu(),process.exit(Do?0:1)})}let o=a=>Ds.createProtocolConnection(t,e,a,n);return B0.createConnection(o,G0,r)}});var ky=K((HV,Dy)=>{"use strict";Dy.exports=nn()});var Vu=K(Jp=>{"use strict";Object.defineProperty(Jp,"__esModule",{value:!0});var sb=function(){function t(){this._state=new Int32Array(4),this._buffer=new ArrayBuffer(68),this._buffer8=new Uint8Array(this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()}return t.hashStr=function(e,n){return n===void 0&&(n=!1),this.onePassHasher.start().appendStr(e).end(n)},t.hashAsciiStr=function(e,n){return n===void 0&&(n=!1),this.onePassHasher.start().appendAsciiStr(e).end(n)},t._hex=function(e){var n=t.hexChars,r=t.hexOut,i,s,o,a;for(a=0;a<4;a+=1)for(s=a*8,i=e[a],o=0;o<8;o+=2)r[s+1+o]=n.charAt(i&15),i>>>=4,r[s+0+o]=n.charAt(i&15),i>>>=4;return r.join("")},t._md5cycle=function(e,n){var r=e[0],i=e[1],s=e[2],o=e[3];r+=(i&s|~i&o)+n[0]-680876936|0,r=(r<<7|r>>>25)+i|0,o+=(r&i|~r&s)+n[1]-389564586|0,o=(o<<12|o>>>20)+r|0,s+=(o&r|~o&i)+n[2]+606105819|0,s=(s<<17|s>>>15)+o|0,i+=(s&o|~s&r)+n[3]-1044525330|0,i=(i<<22|i>>>10)+s|0,r+=(i&s|~i&o)+n[4]-176418897|0,r=(r<<7|r>>>25)+i|0,o+=(r&i|~r&s)+n[5]+1200080426|0,o=(o<<12|o>>>20)+r|0,s+=(o&r|~o&i)+n[6]-1473231341|0,s=(s<<17|s>>>15)+o|0,i+=(s&o|~s&r)+n[7]-45705983|0,i=(i<<22|i>>>10)+s|0,r+=(i&s|~i&o)+n[8]+1770035416|0,r=(r<<7|r>>>25)+i|0,o+=(r&i|~r&s)+n[9]-1958414417|0,o=(o<<12|o>>>20)+r|0,s+=(o&r|~o&i)+n[10]-42063|0,s=(s<<17|s>>>15)+o|0,i+=(s&o|~s&r)+n[11]-1990404162|0,i=(i<<22|i>>>10)+s|0,r+=(i&s|~i&o)+n[12]+1804603682|0,r=(r<<7|r>>>25)+i|0,o+=(r&i|~r&s)+n[13]-40341101|0,o=(o<<12|o>>>20)+r|0,s+=(o&r|~o&i)+n[14]-1502002290|0,s=(s<<17|s>>>15)+o|0,i+=(s&o|~s&r)+n[15]+1236535329|0,i=(i<<22|i>>>10)+s|0,r+=(i&o|s&~o)+n[1]-165796510|0,r=(r<<5|r>>>27)+i|0,o+=(r&s|i&~s)+n[6]-1069501632|0,o=(o<<9|o>>>23)+r|0,s+=(o&i|r&~i)+n[11]+643717713|0,s=(s<<14|s>>>18)+o|0,i+=(s&r|o&~r)+n[0]-373897302|0,i=(i<<20|i>>>12)+s|0,r+=(i&o|s&~o)+n[5]-701558691|0,r=(r<<5|r>>>27)+i|0,o+=(r&s|i&~s)+n[10]+38016083|0,o=(o<<9|o>>>23)+r|0,s+=(o&i|r&~i)+n[15]-660478335|0,s=(s<<14|s>>>18)+o|0,i+=(s&r|o&~r)+n[4]-405537848|0,i=(i<<20|i>>>12)+s|0,r+=(i&o|s&~o)+n[9]+568446438|0,r=(r<<5|r>>>27)+i|0,o+=(r&s|i&~s)+n[14]-1019803690|0,o=(o<<9|o>>>23)+r|0,s+=(o&i|r&~i)+n[3]-187363961|0,s=(s<<14|s>>>18)+o|0,i+=(s&r|o&~r)+n[8]+1163531501|0,i=(i<<20|i>>>12)+s|0,r+=(i&o|s&~o)+n[13]-1444681467|0,r=(r<<5|r>>>27)+i|0,o+=(r&s|i&~s)+n[2]-51403784|0,o=(o<<9|o>>>23)+r|0,s+=(o&i|r&~i)+n[7]+1735328473|0,s=(s<<14|s>>>18)+o|0,i+=(s&r|o&~r)+n[12]-1926607734|0,i=(i<<20|i>>>12)+s|0,r+=(i^s^o)+n[5]-378558|0,r=(r<<4|r>>>28)+i|0,o+=(r^i^s)+n[8]-2022574463|0,o=(o<<11|o>>>21)+r|0,s+=(o^r^i)+n[11]+1839030562|0,s=(s<<16|s>>>16)+o|0,i+=(s^o^r)+n[14]-35309556|0,i=(i<<23|i>>>9)+s|0,r+=(i^s^o)+n[1]-1530992060|0,r=(r<<4|r>>>28)+i|0,o+=(r^i^s)+n[4]+1272893353|0,o=(o<<11|o>>>21)+r|0,s+=(o^r^i)+n[7]-155497632|0,s=(s<<16|s>>>16)+o|0,i+=(s^o^r)+n[10]-1094730640|0,i=(i<<23|i>>>9)+s|0,r+=(i^s^o)+n[13]+681279174|0,r=(r<<4|r>>>28)+i|0,o+=(r^i^s)+n[0]-358537222|0,o=(o<<11|o>>>21)+r|0,s+=(o^r^i)+n[3]-722521979|0,s=(s<<16|s>>>16)+o|0,i+=(s^o^r)+n[6]+76029189|0,i=(i<<23|i>>>9)+s|0,r+=(i^s^o)+n[9]-640364487|0,r=(r<<4|r>>>28)+i|0,o+=(r^i^s)+n[12]-421815835|0,o=(o<<11|o>>>21)+r|0,s+=(o^r^i)+n[15]+530742520|0,s=(s<<16|s>>>16)+o|0,i+=(s^o^r)+n[2]-995338651|0,i=(i<<23|i>>>9)+s|0,r+=(s^(i|~o))+n[0]-198630844|0,r=(r<<6|r>>>26)+i|0,o+=(i^(r|~s))+n[7]+1126891415|0,o=(o<<10|o>>>22)+r|0,s+=(r^(o|~i))+n[14]-1416354905|0,s=(s<<15|s>>>17)+o|0,i+=(o^(s|~r))+n[5]-57434055|0,i=(i<<21|i>>>11)+s|0,r+=(s^(i|~o))+n[12]+1700485571|0,r=(r<<6|r>>>26)+i|0,o+=(i^(r|~s))+n[3]-1894986606|0,o=(o<<10|o>>>22)+r|0,s+=(r^(o|~i))+n[10]-1051523|0,s=(s<<15|s>>>17)+o|0,i+=(o^(s|~r))+n[1]-2054922799|0,i=(i<<21|i>>>11)+s|0,r+=(s^(i|~o))+n[8]+1873313359|0,r=(r<<6|r>>>26)+i|0,o+=(i^(r|~s))+n[15]-30611744|0,o=(o<<10|o>>>22)+r|0,s+=(r^(o|~i))+n[6]-1560198380|0,s=(s<<15|s>>>17)+o|0,i+=(o^(s|~r))+n[13]+1309151649|0,i=(i<<21|i>>>11)+s|0,r+=(s^(i|~o))+n[4]-145523070|0,r=(r<<6|r>>>26)+i|0,o+=(i^(r|~s))+n[11]-1120210379|0,o=(o<<10|o>>>22)+r|0,s+=(r^(o|~i))+n[2]+718787259|0,s=(s<<15|s>>>17)+o|0,i+=(o^(s|~r))+n[9]-343485551|0,i=(i<<21|i>>>11)+s|0,e[0]=r+e[0]|0,e[1]=i+e[1]|0,e[2]=s+e[2]|0,e[3]=o+e[3]|0},t.prototype.start=function(){return this._dataLength=0,this._bufferLength=0,this._state.set(t.stateIdentity),this},t.prototype.appendStr=function(e){var n=this._buffer8,r=this._buffer32,i=this._bufferLength,s,o;for(o=0;o>>6)+192,n[i++]=s&63|128;else if(s<55296||s>56319)n[i++]=(s>>>12)+224,n[i++]=s>>>6&63|128,n[i++]=s&63|128;else{if(s=(s-55296)*1024+(e.charCodeAt(++o)-56320)+65536,s>1114111)throw new Error("Unicode standard supports code points up to U+10FFFF");n[i++]=(s>>>18)+240,n[i++]=s>>>12&63|128,n[i++]=s>>>6&63|128,n[i++]=s&63|128}i>=64&&(this._dataLength+=64,t._md5cycle(this._state,r),i-=64,r[0]=r[16])}return this._bufferLength=i,this},t.prototype.appendAsciiStr=function(e){for(var n=this._buffer8,r=this._buffer32,i=this._bufferLength,s,o=0;;){for(s=Math.min(e.length-o,64-i);s--;)n[i++]=e.charCodeAt(o++);if(i<64)break;this._dataLength+=64,t._md5cycle(this._state,r),i=0}return this._bufferLength=i,this},t.prototype.appendByteArray=function(e){for(var n=this._buffer8,r=this._buffer32,i=this._bufferLength,s,o=0;;){for(s=Math.min(e.length-o,64-i);s--;)n[i++]=e[o++];if(i<64)break;this._dataLength+=64,t._md5cycle(this._state,r),i=0}return this._bufferLength=i,this},t.prototype.getState=function(){var e=this,n=e._state;return{buffer:String.fromCharCode.apply(null,e._buffer8),buflen:e._bufferLength,length:e._dataLength,state:[n[0],n[1],n[2],n[3]]}},t.prototype.setState=function(e){var n=e.buffer,r=e.state,i=this._state,s;for(this._dataLength=e.length,this._bufferLength=e.buflen,i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],s=0;s>2)+1,o;if(this._dataLength+=n,r[n]=128,r[n+1]=r[n+2]=r[n+3]=0,i.set(t.buffer32Identity.subarray(s),s),n>55&&(t._md5cycle(this._state,i),i.set(t.buffer32Identity)),o=this._dataLength*8,o<=4294967295)i[14]=o;else{var a=o.toString(16).match(/(.*?)(.{0,8})$/);if(a===null)return;var l=parseInt(a[2],16),u=parseInt(a[1],16)||0;i[14]=l,i[15]=u}return t._md5cycle(this._state,i),e?this._state:t._hex(this._state)},t.stateIdentity=new Int32Array([1732584193,-271733879,-1732584194,271733878]),t.buffer32Identity=new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),t.hexChars="0123456789abcdef",t.hexOut=[],t.onePassHasher=new t,t}();Jp.Md5=sb;sb.hashStr("hello")!=="5d41402abc4b2a76b9719d911017c592"&&console.error("Md5 self test failed.")});var hs=K(Dn=>{"use strict";var Vi={ANCHOR:"&",COMMENT:"#",TAG:"!",DIRECTIVES_END:"-",DOCUMENT_END:"."},Sl={ALIAS:"ALIAS",BLANK_LINE:"BLANK_LINE",BLOCK_FOLDED:"BLOCK_FOLDED",BLOCK_LITERAL:"BLOCK_LITERAL",COMMENT:"COMMENT",DIRECTIVE:"DIRECTIVE",DOCUMENT:"DOCUMENT",FLOW_MAP:"FLOW_MAP",FLOW_SEQ:"FLOW_SEQ",MAP:"MAP",MAP_KEY:"MAP_KEY",MAP_VALUE:"MAP_VALUE",PLAIN:"PLAIN",QUOTE_DOUBLE:"QUOTE_DOUBLE",QUOTE_SINGLE:"QUOTE_SINGLE",SEQ:"SEQ",SEQ_ITEM:"SEQ_ITEM"},IO="tag:yaml.org,2002:",SO={MAP:"tag:yaml.org,2002:map",SEQ:"tag:yaml.org,2002:seq",STR:"tag:yaml.org,2002:str"};function ZN(t){let e=[0],n=t.indexOf(` +`&&T++}R&&w.length>0&&x.push(w.length),this._lineOffsets=x}return this._lineOffsets},y.prototype.positionAt=function(x){x=Math.max(Math.min(x,this._content.length),0);var w=this.getLineOffsets(),R=0,T=w.length;if(T===0)return i.create(0,x);for(;Rx?T=L:R=L+1}var F=R-1;return i.create(F,x-w[F])},y.prototype.offsetAt=function(x){var w=this.getLineOffsets();if(x.line>=w.length)return this._content.length;if(x.line<0)return 0;var R=w[x.line],T=x.line+1{"use strict";Object.defineProperty(rr,"__esModule",{value:!0});rr.ProtocolNotificationType=rr.ProtocolNotificationType0=rr.ProtocolRequestType=rr.ProtocolRequestType0=rr.RegistrationType=void 0;var Eo=xo(),N_=class{constructor(e){this.method=e}};rr.RegistrationType=N_;var v_=class extends Eo.RequestType0{constructor(e){super(e)}};rr.ProtocolRequestType0=v_;var P_=class extends Eo.RequestType{constructor(e){super(e,Eo.ParameterStructures.byName)}};rr.ProtocolRequestType=P_;var I_=class extends Eo.NotificationType0{constructor(e){super(e)}};rr.ProtocolNotificationType0=I_;var S_=class extends Eo.NotificationType{constructor(e){super(e,Eo.ParameterStructures.byName)}};rr.ProtocolNotificationType=S_});var A_=K(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.objectLiteral=wt.typedArray=wt.stringArray=wt.array=wt.func=wt.error=wt.number=wt.string=wt.boolean=void 0;function MR(t){return t===!0||t===!1}wt.boolean=MR;function C_(t){return typeof t=="string"||t instanceof String}wt.string=C_;function FR(t){return typeof t=="number"||t instanceof Number}wt.number=FR;function VR(t){return t instanceof Error}wt.error=VR;function qR(t){return typeof t=="function"}wt.func=qR;function R_(t){return Array.isArray(t)}wt.array=R_;function BR(t){return R_(t)&&t.every(e=>C_(e))}wt.stringArray=BR;function jR(t,e){return Array.isArray(t)&&t.every(e)}wt.typedArray=jR;function UR(t){return t!==null&&typeof t=="object"}wt.objectLiteral=UR});var x_=K(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.ImplementationRequest=void 0;var GR=Kt(),WR;(function(t){t.method="textDocument/implementation",t.type=new GR.ProtocolRequestType(t.method)})(WR=za.ImplementationRequest||(za.ImplementationRequest={}))});var E_=K(Xa=>{"use strict";Object.defineProperty(Xa,"__esModule",{value:!0});Xa.TypeDefinitionRequest=void 0;var HR=Kt(),YR;(function(t){t.method="textDocument/typeDefinition",t.type=new HR.ProtocolRequestType(t.method)})(YR=Xa.TypeDefinitionRequest||(Xa.TypeDefinitionRequest={}))});var O_=K($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0});$i.DidChangeWorkspaceFoldersNotification=$i.WorkspaceFoldersRequest=void 0;var w_=Kt(),KR;(function(t){t.type=new w_.ProtocolRequestType0("workspace/workspaceFolders")})(KR=$i.WorkspaceFoldersRequest||($i.WorkspaceFoldersRequest={}));var $R;(function(t){t.type=new w_.ProtocolNotificationType("workspace/didChangeWorkspaceFolders")})($R=$i.DidChangeWorkspaceFoldersNotification||($i.DidChangeWorkspaceFoldersNotification={}))});var L_=K(Qa=>{"use strict";Object.defineProperty(Qa,"__esModule",{value:!0});Qa.ConfigurationRequest=void 0;var zR=Kt(),XR;(function(t){t.type=new zR.ProtocolRequestType("workspace/configuration")})(XR=Qa.ConfigurationRequest||(Qa.ConfigurationRequest={}))});var k_=K(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.ColorPresentationRequest=zi.DocumentColorRequest=void 0;var D_=Kt(),QR;(function(t){t.method="textDocument/documentColor",t.type=new D_.ProtocolRequestType(t.method)})(QR=zi.DocumentColorRequest||(zi.DocumentColorRequest={}));var JR;(function(t){t.type=new D_.ProtocolRequestType("textDocument/colorPresentation")})(JR=zi.ColorPresentationRequest||(zi.ColorPresentationRequest={}))});var vp=K(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.FoldingRangeRequest=Xi.FoldingRangeKind=void 0;var ZR=Kt(),eA;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(eA=Xi.FoldingRangeKind||(Xi.FoldingRangeKind={}));var tA;(function(t){t.method="textDocument/foldingRange",t.type=new ZR.ProtocolRequestType(t.method)})(tA=Xi.FoldingRangeRequest||(Xi.FoldingRangeRequest={}))});var M_=K(Ja=>{"use strict";Object.defineProperty(Ja,"__esModule",{value:!0});Ja.DeclarationRequest=void 0;var nA=Kt(),rA;(function(t){t.method="textDocument/declaration",t.type=new nA.ProtocolRequestType(t.method)})(rA=Ja.DeclarationRequest||(Ja.DeclarationRequest={}))});var F_=K(Za=>{"use strict";Object.defineProperty(Za,"__esModule",{value:!0});Za.SelectionRangeRequest=void 0;var iA=Kt(),sA;(function(t){t.method="textDocument/selectionRange",t.type=new iA.ProtocolRequestType(t.method)})(sA=Za.SelectionRangeRequest||(Za.SelectionRangeRequest={}))});var q_=K(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.WorkDoneProgressCancelNotification=Cr.WorkDoneProgressCreateRequest=Cr.WorkDoneProgress=void 0;var oA=xo(),V_=Kt(),aA;(function(t){t.type=new oA.ProgressType;function e(n){return n===t.type}t.is=e})(aA=Cr.WorkDoneProgress||(Cr.WorkDoneProgress={}));var lA;(function(t){t.type=new V_.ProtocolRequestType("window/workDoneProgress/create")})(lA=Cr.WorkDoneProgressCreateRequest||(Cr.WorkDoneProgressCreateRequest={}));var uA;(function(t){t.type=new V_.ProtocolNotificationType("window/workDoneProgress/cancel")})(uA=Cr.WorkDoneProgressCancelNotification||(Cr.WorkDoneProgressCancelNotification={}))});var B_=K(Rr=>{"use strict";Object.defineProperty(Rr,"__esModule",{value:!0});Rr.CallHierarchyOutgoingCallsRequest=Rr.CallHierarchyIncomingCallsRequest=Rr.CallHierarchyPrepareRequest=void 0;var Pp=Kt(),cA;(function(t){t.method="textDocument/prepareCallHierarchy",t.type=new Pp.ProtocolRequestType(t.method)})(cA=Rr.CallHierarchyPrepareRequest||(Rr.CallHierarchyPrepareRequest={}));var fA;(function(t){t.method="callHierarchy/incomingCalls",t.type=new Pp.ProtocolRequestType(t.method)})(fA=Rr.CallHierarchyIncomingCallsRequest||(Rr.CallHierarchyIncomingCallsRequest={}));var pA;(function(t){t.method="callHierarchy/outgoingCalls",t.type=new Pp.ProtocolRequestType(t.method)})(pA=Rr.CallHierarchyOutgoingCallsRequest||(Rr.CallHierarchyOutgoingCallsRequest={}))});var j_=K(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.SemanticTokensRefreshRequest=Je.SemanticTokensRangeRequest=Je.SemanticTokensDeltaRequest=Je.SemanticTokensRequest=Je.SemanticTokensRegistrationType=Je.TokenFormat=Je.SemanticTokens=Je.SemanticTokenModifiers=Je.SemanticTokenTypes=void 0;var el=Kt(),dA;(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator"})(dA=Je.SemanticTokenTypes||(Je.SemanticTokenTypes={}));var mA;(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})(mA=Je.SemanticTokenModifiers||(Je.SemanticTokenModifiers={}));var hA;(function(t){function e(n){let r=n;return r!==void 0&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}t.is=e})(hA=Je.SemanticTokens||(Je.SemanticTokens={}));var gA;(function(t){t.Relative="relative"})(gA=Je.TokenFormat||(Je.TokenFormat={}));var _A;(function(t){t.method="textDocument/semanticTokens",t.type=new el.RegistrationType(t.method)})(_A=Je.SemanticTokensRegistrationType||(Je.SemanticTokensRegistrationType={}));var yA;(function(t){t.method="textDocument/semanticTokens/full",t.type=new el.ProtocolRequestType(t.method)})(yA=Je.SemanticTokensRequest||(Je.SemanticTokensRequest={}));var bA;(function(t){t.method="textDocument/semanticTokens/full/delta",t.type=new el.ProtocolRequestType(t.method)})(bA=Je.SemanticTokensDeltaRequest||(Je.SemanticTokensDeltaRequest={}));var TA;(function(t){t.method="textDocument/semanticTokens/range",t.type=new el.ProtocolRequestType(t.method)})(TA=Je.SemanticTokensRangeRequest||(Je.SemanticTokensRangeRequest={}));var NA;(function(t){t.method="workspace/semanticTokens/refresh",t.type=new el.ProtocolRequestType0(t.method)})(NA=Je.SemanticTokensRefreshRequest||(Je.SemanticTokensRefreshRequest={}))});var U_=K(tl=>{"use strict";Object.defineProperty(tl,"__esModule",{value:!0});tl.ShowDocumentRequest=void 0;var vA=Kt(),PA;(function(t){t.method="window/showDocument",t.type=new vA.ProtocolRequestType(t.method)})(PA=tl.ShowDocumentRequest||(tl.ShowDocumentRequest={}))});var G_=K(nl=>{"use strict";Object.defineProperty(nl,"__esModule",{value:!0});nl.LinkedEditingRangeRequest=void 0;var IA=Kt(),SA;(function(t){t.method="textDocument/linkedEditingRange",t.type=new IA.ProtocolRequestType(t.method)})(SA=nl.LinkedEditingRangeRequest||(nl.LinkedEditingRangeRequest={}))});var W_=K(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.WillDeleteFilesRequest=yt.DidDeleteFilesNotification=yt.DidRenameFilesNotification=yt.WillRenameFilesRequest=yt.DidCreateFilesNotification=yt.WillCreateFilesRequest=yt.FileOperationPatternKind=void 0;var wo=Kt(),CA;(function(t){t.file="file",t.folder="folder"})(CA=yt.FileOperationPatternKind||(yt.FileOperationPatternKind={}));var RA;(function(t){t.method="workspace/willCreateFiles",t.type=new wo.ProtocolRequestType(t.method)})(RA=yt.WillCreateFilesRequest||(yt.WillCreateFilesRequest={}));var AA;(function(t){t.method="workspace/didCreateFiles",t.type=new wo.ProtocolNotificationType(t.method)})(AA=yt.DidCreateFilesNotification||(yt.DidCreateFilesNotification={}));var xA;(function(t){t.method="workspace/willRenameFiles",t.type=new wo.ProtocolRequestType(t.method)})(xA=yt.WillRenameFilesRequest||(yt.WillRenameFilesRequest={}));var EA;(function(t){t.method="workspace/didRenameFiles",t.type=new wo.ProtocolNotificationType(t.method)})(EA=yt.DidRenameFilesNotification||(yt.DidRenameFilesNotification={}));var wA;(function(t){t.method="workspace/didDeleteFiles",t.type=new wo.ProtocolNotificationType(t.method)})(wA=yt.DidDeleteFilesNotification||(yt.DidDeleteFilesNotification={}));var OA;(function(t){t.method="workspace/willDeleteFiles",t.type=new wo.ProtocolRequestType(t.method)})(OA=yt.WillDeleteFilesRequest||(yt.WillDeleteFilesRequest={}))});var H_=K(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.MonikerRequest=Ar.MonikerKind=Ar.UniquenessLevel=void 0;var LA=Kt(),DA;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(DA=Ar.UniquenessLevel||(Ar.UniquenessLevel={}));var kA;(function(t){t.import="import",t.export="export",t.local="local"})(kA=Ar.MonikerKind||(Ar.MonikerKind={}));var MA;(function(t){t.method="textDocument/moniker",t.type=new LA.ProtocolRequestType(t.method)})(MA=Ar.MonikerRequest||(Ar.MonikerRequest={}))});var X_=K(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.DocumentLinkRequest=A.CodeLensRefreshRequest=A.CodeLensResolveRequest=A.CodeLensRequest=A.WorkspaceSymbolRequest=A.CodeActionResolveRequest=A.CodeActionRequest=A.DocumentSymbolRequest=A.DocumentHighlightRequest=A.ReferencesRequest=A.DefinitionRequest=A.SignatureHelpRequest=A.SignatureHelpTriggerKind=A.HoverRequest=A.CompletionResolveRequest=A.CompletionRequest=A.CompletionTriggerKind=A.PublishDiagnosticsNotification=A.WatchKind=A.FileChangeType=A.DidChangeWatchedFilesNotification=A.WillSaveTextDocumentWaitUntilRequest=A.WillSaveTextDocumentNotification=A.TextDocumentSaveReason=A.DidSaveTextDocumentNotification=A.DidCloseTextDocumentNotification=A.DidChangeTextDocumentNotification=A.TextDocumentContentChangeEvent=A.DidOpenTextDocumentNotification=A.TextDocumentSyncKind=A.TelemetryEventNotification=A.LogMessageNotification=A.ShowMessageRequest=A.ShowMessageNotification=A.MessageType=A.DidChangeConfigurationNotification=A.ExitNotification=A.ShutdownRequest=A.InitializedNotification=A.InitializeError=A.InitializeRequest=A.WorkDoneProgressOptions=A.TextDocumentRegistrationOptions=A.StaticRegistrationOptions=A.FailureHandlingKind=A.ResourceOperationKind=A.UnregistrationRequest=A.RegistrationRequest=A.DocumentSelector=A.DocumentFilter=void 0;A.MonikerRequest=A.MonikerKind=A.UniquenessLevel=A.WillDeleteFilesRequest=A.DidDeleteFilesNotification=A.WillRenameFilesRequest=A.DidRenameFilesNotification=A.WillCreateFilesRequest=A.DidCreateFilesNotification=A.FileOperationPatternKind=A.LinkedEditingRangeRequest=A.ShowDocumentRequest=A.SemanticTokensRegistrationType=A.SemanticTokensRefreshRequest=A.SemanticTokensRangeRequest=A.SemanticTokensDeltaRequest=A.SemanticTokensRequest=A.TokenFormat=A.SemanticTokens=A.SemanticTokenModifiers=A.SemanticTokenTypes=A.CallHierarchyPrepareRequest=A.CallHierarchyOutgoingCallsRequest=A.CallHierarchyIncomingCallsRequest=A.WorkDoneProgressCancelNotification=A.WorkDoneProgressCreateRequest=A.WorkDoneProgress=A.SelectionRangeRequest=A.DeclarationRequest=A.FoldingRangeRequest=A.ColorPresentationRequest=A.DocumentColorRequest=A.ConfigurationRequest=A.DidChangeWorkspaceFoldersNotification=A.WorkspaceFoldersRequest=A.TypeDefinitionRequest=A.ImplementationRequest=A.ApplyWorkspaceEditRequest=A.ExecuteCommandRequest=A.PrepareRenameRequest=A.RenameRequest=A.PrepareSupportDefaultBehavior=A.DocumentOnTypeFormattingRequest=A.DocumentRangeFormattingRequest=A.DocumentFormattingRequest=A.DocumentLinkResolveRequest=void 0;var Qi=A_(),Ae=Kt(),FA=x_();Object.defineProperty(A,"ImplementationRequest",{enumerable:!0,get:function(){return FA.ImplementationRequest}});var VA=E_();Object.defineProperty(A,"TypeDefinitionRequest",{enumerable:!0,get:function(){return VA.TypeDefinitionRequest}});var Y_=O_();Object.defineProperty(A,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return Y_.WorkspaceFoldersRequest}});Object.defineProperty(A,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return Y_.DidChangeWorkspaceFoldersNotification}});var qA=L_();Object.defineProperty(A,"ConfigurationRequest",{enumerable:!0,get:function(){return qA.ConfigurationRequest}});var K_=k_();Object.defineProperty(A,"DocumentColorRequest",{enumerable:!0,get:function(){return K_.DocumentColorRequest}});Object.defineProperty(A,"ColorPresentationRequest",{enumerable:!0,get:function(){return K_.ColorPresentationRequest}});var BA=vp();Object.defineProperty(A,"FoldingRangeRequest",{enumerable:!0,get:function(){return BA.FoldingRangeRequest}});var jA=M_();Object.defineProperty(A,"DeclarationRequest",{enumerable:!0,get:function(){return jA.DeclarationRequest}});var UA=F_();Object.defineProperty(A,"SelectionRangeRequest",{enumerable:!0,get:function(){return UA.SelectionRangeRequest}});var Ip=q_();Object.defineProperty(A,"WorkDoneProgress",{enumerable:!0,get:function(){return Ip.WorkDoneProgress}});Object.defineProperty(A,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return Ip.WorkDoneProgressCreateRequest}});Object.defineProperty(A,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return Ip.WorkDoneProgressCancelNotification}});var Sp=B_();Object.defineProperty(A,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return Sp.CallHierarchyIncomingCallsRequest}});Object.defineProperty(A,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return Sp.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(A,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return Sp.CallHierarchyPrepareRequest}});var Ai=j_();Object.defineProperty(A,"SemanticTokenTypes",{enumerable:!0,get:function(){return Ai.SemanticTokenTypes}});Object.defineProperty(A,"SemanticTokenModifiers",{enumerable:!0,get:function(){return Ai.SemanticTokenModifiers}});Object.defineProperty(A,"SemanticTokens",{enumerable:!0,get:function(){return Ai.SemanticTokens}});Object.defineProperty(A,"TokenFormat",{enumerable:!0,get:function(){return Ai.TokenFormat}});Object.defineProperty(A,"SemanticTokensRequest",{enumerable:!0,get:function(){return Ai.SemanticTokensRequest}});Object.defineProperty(A,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return Ai.SemanticTokensDeltaRequest}});Object.defineProperty(A,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return Ai.SemanticTokensRangeRequest}});Object.defineProperty(A,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return Ai.SemanticTokensRefreshRequest}});Object.defineProperty(A,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return Ai.SemanticTokensRegistrationType}});var GA=U_();Object.defineProperty(A,"ShowDocumentRequest",{enumerable:!0,get:function(){return GA.ShowDocumentRequest}});var WA=G_();Object.defineProperty(A,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return WA.LinkedEditingRangeRequest}});var Ls=W_();Object.defineProperty(A,"FileOperationPatternKind",{enumerable:!0,get:function(){return Ls.FileOperationPatternKind}});Object.defineProperty(A,"DidCreateFilesNotification",{enumerable:!0,get:function(){return Ls.DidCreateFilesNotification}});Object.defineProperty(A,"WillCreateFilesRequest",{enumerable:!0,get:function(){return Ls.WillCreateFilesRequest}});Object.defineProperty(A,"DidRenameFilesNotification",{enumerable:!0,get:function(){return Ls.DidRenameFilesNotification}});Object.defineProperty(A,"WillRenameFilesRequest",{enumerable:!0,get:function(){return Ls.WillRenameFilesRequest}});Object.defineProperty(A,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return Ls.DidDeleteFilesNotification}});Object.defineProperty(A,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return Ls.WillDeleteFilesRequest}});var Cp=H_();Object.defineProperty(A,"UniquenessLevel",{enumerable:!0,get:function(){return Cp.UniquenessLevel}});Object.defineProperty(A,"MonikerKind",{enumerable:!0,get:function(){return Cp.MonikerKind}});Object.defineProperty(A,"MonikerRequest",{enumerable:!0,get:function(){return Cp.MonikerRequest}});var $_;(function(t){function e(n){let r=n;return Qi.string(r.language)||Qi.string(r.scheme)||Qi.string(r.pattern)}t.is=e})($_=A.DocumentFilter||(A.DocumentFilter={}));var z_;(function(t){function e(n){if(!Array.isArray(n))return!1;for(let r of n)if(!Qi.string(r)&&!$_.is(r))return!1;return!0}t.is=e})(z_=A.DocumentSelector||(A.DocumentSelector={}));var HA;(function(t){t.type=new Ae.ProtocolRequestType("client/registerCapability")})(HA=A.RegistrationRequest||(A.RegistrationRequest={}));var YA;(function(t){t.type=new Ae.ProtocolRequestType("client/unregisterCapability")})(YA=A.UnregistrationRequest||(A.UnregistrationRequest={}));var KA;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(KA=A.ResourceOperationKind||(A.ResourceOperationKind={}));var $A;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})($A=A.FailureHandlingKind||(A.FailureHandlingKind={}));var zA;(function(t){function e(n){let r=n;return r&&Qi.string(r.id)&&r.id.length>0}t.hasId=e})(zA=A.StaticRegistrationOptions||(A.StaticRegistrationOptions={}));var XA;(function(t){function e(n){let r=n;return r&&(r.documentSelector===null||z_.is(r.documentSelector))}t.is=e})(XA=A.TextDocumentRegistrationOptions||(A.TextDocumentRegistrationOptions={}));var QA;(function(t){function e(r){let i=r;return Qi.objectLiteral(i)&&(i.workDoneProgress===void 0||Qi.boolean(i.workDoneProgress))}t.is=e;function n(r){let i=r;return i&&Qi.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=n})(QA=A.WorkDoneProgressOptions||(A.WorkDoneProgressOptions={}));var JA;(function(t){t.type=new Ae.ProtocolRequestType("initialize")})(JA=A.InitializeRequest||(A.InitializeRequest={}));var ZA;(function(t){t.unknownProtocolVersion=1})(ZA=A.InitializeError||(A.InitializeError={}));var ex;(function(t){t.type=new Ae.ProtocolNotificationType("initialized")})(ex=A.InitializedNotification||(A.InitializedNotification={}));var tx;(function(t){t.type=new Ae.ProtocolRequestType0("shutdown")})(tx=A.ShutdownRequest||(A.ShutdownRequest={}));var nx;(function(t){t.type=new Ae.ProtocolNotificationType0("exit")})(nx=A.ExitNotification||(A.ExitNotification={}));var rx;(function(t){t.type=new Ae.ProtocolNotificationType("workspace/didChangeConfiguration")})(rx=A.DidChangeConfigurationNotification||(A.DidChangeConfigurationNotification={}));var ix;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4})(ix=A.MessageType||(A.MessageType={}));var sx;(function(t){t.type=new Ae.ProtocolNotificationType("window/showMessage")})(sx=A.ShowMessageNotification||(A.ShowMessageNotification={}));var ox;(function(t){t.type=new Ae.ProtocolRequestType("window/showMessageRequest")})(ox=A.ShowMessageRequest||(A.ShowMessageRequest={}));var ax;(function(t){t.type=new Ae.ProtocolNotificationType("window/logMessage")})(ax=A.LogMessageNotification||(A.LogMessageNotification={}));var lx;(function(t){t.type=new Ae.ProtocolNotificationType("telemetry/event")})(lx=A.TelemetryEventNotification||(A.TelemetryEventNotification={}));var ux;(function(t){t.None=0,t.Full=1,t.Incremental=2})(ux=A.TextDocumentSyncKind||(A.TextDocumentSyncKind={}));var cx;(function(t){t.method="textDocument/didOpen",t.type=new Ae.ProtocolNotificationType(t.method)})(cx=A.DidOpenTextDocumentNotification||(A.DidOpenTextDocumentNotification={}));var fx;(function(t){function e(r){let i=r;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}t.isIncremental=e;function n(r){let i=r;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}t.isFull=n})(fx=A.TextDocumentContentChangeEvent||(A.TextDocumentContentChangeEvent={}));var px;(function(t){t.method="textDocument/didChange",t.type=new Ae.ProtocolNotificationType(t.method)})(px=A.DidChangeTextDocumentNotification||(A.DidChangeTextDocumentNotification={}));var dx;(function(t){t.method="textDocument/didClose",t.type=new Ae.ProtocolNotificationType(t.method)})(dx=A.DidCloseTextDocumentNotification||(A.DidCloseTextDocumentNotification={}));var mx;(function(t){t.method="textDocument/didSave",t.type=new Ae.ProtocolNotificationType(t.method)})(mx=A.DidSaveTextDocumentNotification||(A.DidSaveTextDocumentNotification={}));var hx;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(hx=A.TextDocumentSaveReason||(A.TextDocumentSaveReason={}));var gx;(function(t){t.method="textDocument/willSave",t.type=new Ae.ProtocolNotificationType(t.method)})(gx=A.WillSaveTextDocumentNotification||(A.WillSaveTextDocumentNotification={}));var _x;(function(t){t.method="textDocument/willSaveWaitUntil",t.type=new Ae.ProtocolRequestType(t.method)})(_x=A.WillSaveTextDocumentWaitUntilRequest||(A.WillSaveTextDocumentWaitUntilRequest={}));var yx;(function(t){t.type=new Ae.ProtocolNotificationType("workspace/didChangeWatchedFiles")})(yx=A.DidChangeWatchedFilesNotification||(A.DidChangeWatchedFilesNotification={}));var bx;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(bx=A.FileChangeType||(A.FileChangeType={}));var Tx;(function(t){t.Create=1,t.Change=2,t.Delete=4})(Tx=A.WatchKind||(A.WatchKind={}));var Nx;(function(t){t.type=new Ae.ProtocolNotificationType("textDocument/publishDiagnostics")})(Nx=A.PublishDiagnosticsNotification||(A.PublishDiagnosticsNotification={}));var vx;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(vx=A.CompletionTriggerKind||(A.CompletionTriggerKind={}));var Px;(function(t){t.method="textDocument/completion",t.type=new Ae.ProtocolRequestType(t.method)})(Px=A.CompletionRequest||(A.CompletionRequest={}));var Ix;(function(t){t.method="completionItem/resolve",t.type=new Ae.ProtocolRequestType(t.method)})(Ix=A.CompletionResolveRequest||(A.CompletionResolveRequest={}));var Sx;(function(t){t.method="textDocument/hover",t.type=new Ae.ProtocolRequestType(t.method)})(Sx=A.HoverRequest||(A.HoverRequest={}));var Cx;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(Cx=A.SignatureHelpTriggerKind||(A.SignatureHelpTriggerKind={}));var Rx;(function(t){t.method="textDocument/signatureHelp",t.type=new Ae.ProtocolRequestType(t.method)})(Rx=A.SignatureHelpRequest||(A.SignatureHelpRequest={}));var Ax;(function(t){t.method="textDocument/definition",t.type=new Ae.ProtocolRequestType(t.method)})(Ax=A.DefinitionRequest||(A.DefinitionRequest={}));var xx;(function(t){t.method="textDocument/references",t.type=new Ae.ProtocolRequestType(t.method)})(xx=A.ReferencesRequest||(A.ReferencesRequest={}));var Ex;(function(t){t.method="textDocument/documentHighlight",t.type=new Ae.ProtocolRequestType(t.method)})(Ex=A.DocumentHighlightRequest||(A.DocumentHighlightRequest={}));var wx;(function(t){t.method="textDocument/documentSymbol",t.type=new Ae.ProtocolRequestType(t.method)})(wx=A.DocumentSymbolRequest||(A.DocumentSymbolRequest={}));var Ox;(function(t){t.method="textDocument/codeAction",t.type=new Ae.ProtocolRequestType(t.method)})(Ox=A.CodeActionRequest||(A.CodeActionRequest={}));var Lx;(function(t){t.method="codeAction/resolve",t.type=new Ae.ProtocolRequestType(t.method)})(Lx=A.CodeActionResolveRequest||(A.CodeActionResolveRequest={}));var Dx;(function(t){t.method="workspace/symbol",t.type=new Ae.ProtocolRequestType(t.method)})(Dx=A.WorkspaceSymbolRequest||(A.WorkspaceSymbolRequest={}));var kx;(function(t){t.method="textDocument/codeLens",t.type=new Ae.ProtocolRequestType(t.method)})(kx=A.CodeLensRequest||(A.CodeLensRequest={}));var Mx;(function(t){t.method="codeLens/resolve",t.type=new Ae.ProtocolRequestType(t.method)})(Mx=A.CodeLensResolveRequest||(A.CodeLensResolveRequest={}));var Fx;(function(t){t.method="workspace/codeLens/refresh",t.type=new Ae.ProtocolRequestType0(t.method)})(Fx=A.CodeLensRefreshRequest||(A.CodeLensRefreshRequest={}));var Vx;(function(t){t.method="textDocument/documentLink",t.type=new Ae.ProtocolRequestType(t.method)})(Vx=A.DocumentLinkRequest||(A.DocumentLinkRequest={}));var qx;(function(t){t.method="documentLink/resolve",t.type=new Ae.ProtocolRequestType(t.method)})(qx=A.DocumentLinkResolveRequest||(A.DocumentLinkResolveRequest={}));var Bx;(function(t){t.method="textDocument/formatting",t.type=new Ae.ProtocolRequestType(t.method)})(Bx=A.DocumentFormattingRequest||(A.DocumentFormattingRequest={}));var jx;(function(t){t.method="textDocument/rangeFormatting",t.type=new Ae.ProtocolRequestType(t.method)})(jx=A.DocumentRangeFormattingRequest||(A.DocumentRangeFormattingRequest={}));var Ux;(function(t){t.method="textDocument/onTypeFormatting",t.type=new Ae.ProtocolRequestType(t.method)})(Ux=A.DocumentOnTypeFormattingRequest||(A.DocumentOnTypeFormattingRequest={}));var Gx;(function(t){t.Identifier=1})(Gx=A.PrepareSupportDefaultBehavior||(A.PrepareSupportDefaultBehavior={}));var Wx;(function(t){t.method="textDocument/rename",t.type=new Ae.ProtocolRequestType(t.method)})(Wx=A.RenameRequest||(A.RenameRequest={}));var Hx;(function(t){t.method="textDocument/prepareRename",t.type=new Ae.ProtocolRequestType(t.method)})(Hx=A.PrepareRenameRequest||(A.PrepareRenameRequest={}));var Yx;(function(t){t.type=new Ae.ProtocolRequestType("workspace/executeCommand")})(Yx=A.ExecuteCommandRequest||(A.ExecuteCommandRequest={}));var Kx;(function(t){t.type=new Ae.ProtocolRequestType("workspace/applyEdit")})(Kx=A.ApplyWorkspaceEditRequest||(A.ApplyWorkspaceEditRequest={}))});var J_=K(Pu=>{"use strict";Object.defineProperty(Pu,"__esModule",{value:!0});Pu.createProtocolConnection=void 0;var Q_=xo();function $x(t,e,n,r){return Q_.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),Q_.createMessageConnection(t,e,n,r)}Pu.createProtocolConnection=$x});var Z_=K(yn=>{"use strict";var zx=yn&&yn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Iu=yn&&yn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&zx(e,t,n)};Object.defineProperty(yn,"__esModule",{value:!0});yn.LSPErrorCodes=yn.createProtocolConnection=void 0;Iu(xo(),yn);Iu(ot(),yn);Iu(Kt(),yn);Iu(X_(),yn);var Xx=J_();Object.defineProperty(yn,"createProtocolConnection",{enumerable:!0,get:function(){return Xx.createProtocolConnection}});var Qx;(function(t){t.lspReservedErrorRangeStart=-32899,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(Qx=yn.LSPErrorCodes||(yn.LSPErrorCodes={}))});var pn=K(ii=>{"use strict";var Jx=ii&&ii.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),ey=ii&&ii.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Jx(e,t,n)};Object.defineProperty(ii,"__esModule",{value:!0});ii.createProtocolConnection=void 0;var Zx=Np();ey(Np(),ii);ey(Z_(),ii);function e0(t,e,n,r){return Zx.createMessageConnection(t,e,n,r)}ii.createProtocolConnection=e0});var Rp=K(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.generateUuid=ir.parse=ir.isUUID=ir.v4=ir.empty=void 0;var Su=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},Le=class extends Su{constructor(){super([Le._randomHex(),Le._randomHex(),Le._randomHex(),Le._randomHex(),Le._randomHex(),Le._randomHex(),Le._randomHex(),Le._randomHex(),"-",Le._randomHex(),Le._randomHex(),Le._randomHex(),Le._randomHex(),"-","4",Le._randomHex(),Le._randomHex(),Le._randomHex(),"-",Le._oneOf(Le._timeHighBits),Le._randomHex(),Le._randomHex(),Le._randomHex(),"-",Le._randomHex(),Le._randomHex(),Le._randomHex(),Le._randomHex(),Le._randomHex(),Le._randomHex(),Le._randomHex(),Le._randomHex(),Le._randomHex(),Le._randomHex(),Le._randomHex(),Le._randomHex()].join(""))}static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return Le._oneOf(Le._chars)}};Le._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];Le._timeHighBits=["8","9","a","b"];ir.empty=new Su("00000000-0000-0000-0000-000000000000");function ty(){return new Le}ir.v4=ty;var t0=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function ny(t){return t0.test(t)}ir.isUUID=ny;function n0(t){if(!ny(t))throw new Error("invalid uuid");return new Su(t)}ir.parse=n0;function r0(){return ty().asHex()}ir.generateUuid=r0});var iy=K(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});Zi.attachPartialResult=Zi.ProgressFeature=Zi.attachWorkDone=void 0;var Ji=pn(),i0=Rp(),xi=class{constructor(e,n){this._connection=e,this._token=n,xi.Instances.set(this._token,this)}begin(e,n,r,i){let s={kind:"begin",title:e,percentage:n,message:r,cancellable:i};this._connection.sendProgress(Ji.WorkDoneProgress.type,this._token,s)}report(e,n){let r={kind:"report"};typeof e=="number"?(r.percentage=e,n!==void 0&&(r.message=n)):r.message=e,this._connection.sendProgress(Ji.WorkDoneProgress.type,this._token,r)}done(){xi.Instances.delete(this._token),this._connection.sendProgress(Ji.WorkDoneProgress.type,this._token,{kind:"end"})}};xi.Instances=new Map;var Ap=class extends xi{constructor(e,n){super(e,n);this._source=new Ji.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},Cu=class{constructor(){}begin(){}report(){}done(){}},xp=class extends Cu{constructor(){super();this._source=new Ji.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function s0(t,e){if(e===void 0||e.workDoneToken===void 0)return new Cu;let n=e.workDoneToken;return delete e.workDoneToken,new xi(t,n)}Zi.attachWorkDone=s0;var o0=t=>class extends t{constructor(){super();this._progressSupported=!1}initialize(e){var n;((n=e==null?void 0:e.window)===null||n===void 0?void 0:n.workDoneProgress)===!0&&(this._progressSupported=!0,this.connection.onNotification(Ji.WorkDoneProgressCancelNotification.type,r=>{let i=xi.Instances.get(r.token);(i instanceof Ap||i instanceof xp)&&i.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new Cu:new xi(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=i0.generateUuid();return this.connection.sendRequest(Ji.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new Ap(this.connection,e))}else return Promise.resolve(new xp)}};Zi.ProgressFeature=o0;var Ep;(function(t){t.type=new Ji.ProgressType})(Ep||(Ep={}));var ry=class{constructor(e,n){this._connection=e,this._token=n}report(e){this._connection.sendProgress(Ep.type,this._token,e)}};function a0(t,e){if(e===void 0||e.partialResultToken===void 0)return;let n=e.partialResultToken;return delete e.partialResultToken,new ry(t,n)}Zi.attachPartialResult=a0});var sy=K(Ru=>{"use strict";Object.defineProperty(Ru,"__esModule",{value:!0});Ru.ConfigurationFeature=void 0;var l0=pn(),u0=mu(),c0=t=>class extends t{getConfiguration(e){return e?u0.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let n={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(l0.ConfigurationRequest.type,n).then(r=>Array.isArray(e)?r:r[0])}};Ru.ConfigurationFeature=c0});var oy=K(xu=>{"use strict";Object.defineProperty(xu,"__esModule",{value:!0});xu.WorkspaceFoldersFeature=void 0;var Au=pn(),f0=t=>class extends t{initialize(e){let n=e.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Au.Emitter,this.connection.onNotification(Au.DidChangeWorkspaceFoldersNotification.type,r=>{this._onDidChangeWorkspaceFolders.fire(r.event)}))}getWorkspaceFolders(){return this.connection.sendRequest(Au.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return this._unregistration||(this._unregistration=this.connection.client.register(Au.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};xu.WorkspaceFoldersFeature=f0});var ay=K(Eu=>{"use strict";Object.defineProperty(Eu,"__esModule",{value:!0});Eu.CallHierarchyFeature=void 0;var wp=pn(),p0=t=>class extends t{get callHierarchy(){return{onPrepare:e=>{this.connection.onRequest(wp.CallHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0))},onIncomingCalls:e=>{let n=wp.CallHierarchyIncomingCallsRequest.type;this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onOutgoingCalls:e=>{let n=wp.CallHierarchyOutgoingCallsRequest.type;this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Eu.CallHierarchyFeature=p0});var Lp=K(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.SemanticTokensBuilder=Oo.SemanticTokensFeature=void 0;var Op=pn(),d0=t=>class extends t{get semanticTokens(){return{on:e=>{let n=Op.SemanticTokensRequest.type;this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onDelta:e=>{let n=Op.SemanticTokensDeltaRequest.type;this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onRange:e=>{let n=Op.SemanticTokensRangeRequest.type;this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Oo.SemanticTokensFeature=d0;var ly=class{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(e,n,r,i,s){let o=e,a=n;this._dataLen>0&&(o-=this._prevLine,o===0&&(a-=this._prevChar)),this._data[this._dataLen++]=o,this._data[this._dataLen++]=a,this._data[this._dataLen++]=r,this._data[this._dataLen++]=i,this._data[this._dataLen++]=s,this._prevLine=e,this._prevChar=n}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){if(this._prevData!==void 0){let e=this._prevData.length,n=this._data.length,r=0;for(;r{"use strict";Object.defineProperty(wu,"__esModule",{value:!0});wu.ShowDocumentFeature=void 0;var m0=pn(),h0=t=>class extends t{showDocument(e){return this.connection.sendRequest(m0.ShowDocumentRequest.type,e)}};wu.ShowDocumentFeature=h0});var cy=K(Ou=>{"use strict";Object.defineProperty(Ou,"__esModule",{value:!0});Ou.FileOperationsFeature=void 0;var Lo=pn(),g0=t=>class extends t{onDidCreateFiles(e){this.connection.onNotification(Lo.DidCreateFilesNotification.type,n=>{e(n)})}onDidRenameFiles(e){this.connection.onNotification(Lo.DidRenameFilesNotification.type,n=>{e(n)})}onDidDeleteFiles(e){this.connection.onNotification(Lo.DidDeleteFilesNotification.type,n=>{e(n)})}onWillCreateFiles(e){return this.connection.onRequest(Lo.WillCreateFilesRequest.type,(n,r)=>e(n,r))}onWillRenameFiles(e){return this.connection.onRequest(Lo.WillRenameFilesRequest.type,(n,r)=>e(n,r))}onWillDeleteFiles(e){return this.connection.onRequest(Lo.WillDeleteFilesRequest.type,(n,r)=>e(n,r))}};Ou.FileOperationsFeature=g0});var fy=K(Lu=>{"use strict";Object.defineProperty(Lu,"__esModule",{value:!0});Lu.LinkedEditingRangeFeature=void 0;var _0=pn(),y0=t=>class extends t{onLinkedEditingRange(e){this.connection.onRequest(_0.LinkedEditingRangeRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0))}};Lu.LinkedEditingRangeFeature=y0});var py=K(Du=>{"use strict";Object.defineProperty(Du,"__esModule",{value:!0});Du.MonikerFeature=void 0;var b0=pn(),T0=t=>class extends t{get moniker(){return{on:e=>{let n=b0.MonikerRequest.type;this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Du.MonikerFeature=T0});var Up=K(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.createConnection=He.combineFeatures=He.combineLanguagesFeatures=He.combineWorkspaceFeatures=He.combineWindowFeatures=He.combineClientFeatures=He.combineTracerFeatures=He.combineTelemetryFeatures=He.combineConsoleFeatures=He._LanguagesImpl=He.BulkUnregistration=He.BulkRegistration=He.ErrorMessageTracker=He.TextDocuments=void 0;var z=pn(),sr=mu(),Dp=Rp(),xe=iy(),N0=sy(),v0=oy(),P0=ay(),I0=Lp(),S0=uy(),C0=cy(),R0=fy(),A0=py();function kp(t){if(t!==null)return t}var dy=class{constructor(e){this._documents=Object.create(null),this._configuration=e,this._onDidChangeContent=new z.Emitter,this._onDidOpen=new z.Emitter,this._onDidClose=new z.Emitter,this._onDidSave=new z.Emitter,this._onWillSave=new z.Emitter}get onDidChangeContent(){return this._onDidChangeContent.event}get onDidOpen(){return this._onDidOpen.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._documents[e]}all(){return Object.keys(this._documents).map(e=>this._documents[e])}keys(){return Object.keys(this._documents)}listen(e){e.__textDocumentSync=z.TextDocumentSyncKind.Full,e.onDidOpenTextDocument(n=>{let r=n.textDocument,i=this._configuration.create(r.uri,r.languageId,r.version,r.text);this._documents[r.uri]=i;let s=Object.freeze({document:i});this._onDidOpen.fire(s),this._onDidChangeContent.fire(s)}),e.onDidChangeTextDocument(n=>{let r=n.textDocument,i=n.contentChanges;if(i.length===0)return;let s=this._documents[r.uri],{version:o}=r;if(o==null)throw new Error(`Received document change event for ${r.uri} without valid version identifier`);s=this._configuration.update(s,i,o),this._documents[r.uri]=s,this._onDidChangeContent.fire(Object.freeze({document:s}))}),e.onDidCloseTextDocument(n=>{let r=this._documents[n.textDocument.uri];r&&(delete this._documents[n.textDocument.uri],this._onDidClose.fire(Object.freeze({document:r})))}),e.onWillSaveTextDocument(n=>{let r=this._documents[n.textDocument.uri];r&&this._onWillSave.fire(Object.freeze({document:r,reason:n.reason}))}),e.onWillSaveTextDocumentWaitUntil((n,r)=>{let i=this._documents[n.textDocument.uri];return i&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:i,reason:n.reason}),r):[]}),e.onDidSaveTextDocument(n=>{let r=this._documents[n.textDocument.uri];r&&this._onDidSave.fire(Object.freeze({document:r}))})}};He.TextDocuments=dy;var my=class{constructor(){this._messages=Object.create(null)}add(e){let n=this._messages[e];n||(n=0),n++,this._messages[e]=n}sendErrors(e){Object.keys(this._messages).forEach(n=>{e.window.showErrorMessage(n)})}};He.ErrorMessageTracker=my;var Mp=class{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(z.MessageType.Error,e)}warn(e){this.send(z.MessageType.Warning,e)}info(e){this.send(z.MessageType.Info,e)}log(e){this.send(z.MessageType.Log,e)}send(e,n){this._rawConnection&&this._rawConnection.sendNotification(z.LogMessageNotification.type,{type:e,message:n})}},hy=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...n){let r={type:z.MessageType.Error,message:e,actions:n};return this.connection.sendRequest(z.ShowMessageRequest.type,r).then(kp)}showWarningMessage(e,...n){let r={type:z.MessageType.Warning,message:e,actions:n};return this.connection.sendRequest(z.ShowMessageRequest.type,r).then(kp)}showInformationMessage(e,...n){let r={type:z.MessageType.Info,message:e,actions:n};return this.connection.sendRequest(z.ShowMessageRequest.type,r).then(kp)}},gy=S0.ShowDocumentFeature(xe.ProgressFeature(hy)),x0;(function(t){function e(){return new Fp}t.create=e})(x0=He.BulkRegistration||(He.BulkRegistration={}));var Fp=class{constructor(){this._registrations=[],this._registered=new Set}add(e,n){let r=sr.string(e)?e:e.method;if(this._registered.has(r))throw new Error(`${r} is already added to this registration`);let i=Dp.generateUuid();this._registrations.push({id:i,method:r,registerOptions:n||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}},E0;(function(t){function e(){return new ku(void 0,[])}t.create=e})(E0=He.BulkUnregistration||(He.BulkUnregistration={}));var ku=class{constructor(e,n){this._connection=e,this._unregistrations=new Map,n.forEach(r=>{this._unregistrations.set(r.method,r)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let r of this._unregistrations.values())e.push(r);let n={unregisterations:e};this._connection.sendRequest(z.UnregistrationRequest.type,n).then(void 0,r=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let n=sr.string(e)?e:e.method,r=this._unregistrations.get(n);if(!r)return!1;let i={unregisterations:[r]};return this._connection.sendRequest(z.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(n)},s=>{this._connection.console.info(`Un-registering request handler for ${r.id} failed.`)}),!0}},Vp=class{attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,n,r){return e instanceof Fp?this.registerMany(e):e instanceof ku?this.registerSingle1(e,n,r):this.registerSingle2(e,n)}registerSingle1(e,n,r){let i=sr.string(n)?n:n.method,s=Dp.generateUuid(),o={registrations:[{id:s,method:i,registerOptions:r||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(z.RegistrationRequest.type,o).then(a=>(e.add({id:s,method:i}),e),a=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(a)))}registerSingle2(e,n){let r=sr.string(e)?e:e.method,i=Dp.generateUuid(),s={registrations:[{id:i,method:r,registerOptions:n||{}}]};return this.connection.sendRequest(z.RegistrationRequest.type,s).then(o=>z.Disposable.create(()=>{this.unregisterSingle(i,r)}),o=>(this.connection.console.info(`Registering request handler for ${r} failed.`),Promise.reject(o)))}unregisterSingle(e,n){let r={unregisterations:[{id:e,method:n}]};return this.connection.sendRequest(z.UnregistrationRequest.type,r).then(void 0,i=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let n=e.asRegistrationParams();return this.connection.sendRequest(z.RegistrationRequest.type,n).then(()=>new ku(this._connection,n.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}},_y=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function n(i){return i&&!!i.edit}let r=n(e)?e:{edit:e};return this.connection.sendRequest(z.ApplyWorkspaceEditRequest.type,r)}},yy=C0.FileOperationsFeature(v0.WorkspaceFoldersFeature(N0.ConfigurationFeature(_y))),qp=class{constructor(){this._trace=z.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,n){this._trace!==z.Trace.Off&&this.connection.sendNotification(z.LogTraceNotification.type,{message:e,verbose:this._trace===z.Trace.Verbose?n:void 0})}},Bp=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(z.TelemetryEventNotification.type,e)}},jp=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return xe.attachWorkDone(this.connection,e)}attachPartialResultProgress(e,n){return xe.attachPartialResult(this.connection,n)}};He._LanguagesImpl=jp;var by=A0.MonikerFeature(R0.LinkedEditingRangeFeature(I0.SemanticTokensFeature(P0.CallHierarchyFeature(jp))));function Ty(t,e){return function(n){return e(t(n))}}He.combineConsoleFeatures=Ty;function Ny(t,e){return function(n){return e(t(n))}}He.combineTelemetryFeatures=Ny;function vy(t,e){return function(n){return e(t(n))}}He.combineTracerFeatures=vy;function Py(t,e){return function(n){return e(t(n))}}He.combineClientFeatures=Py;function Iy(t,e){return function(n){return e(t(n))}}He.combineWindowFeatures=Iy;function Sy(t,e){return function(n){return e(t(n))}}He.combineWorkspaceFeatures=Sy;function w0(t,e){return function(n){return e(t(n))}}He.combineLanguagesFeatures=w0;function O0(t,e){function n(i,s,o){return i&&s?o(i,s):i||s}return{__brand:"features",console:n(t.console,e.console,Ty),tracer:n(t.tracer,e.tracer,vy),telemetry:n(t.telemetry,e.telemetry,Ny),client:n(t.client,e.client,Py),window:n(t.window,e.window,Iy),workspace:n(t.workspace,e.workspace,Sy)}}He.combineFeatures=O0;function L0(t,e,n){let r=n&&n.console?new(n.console(Mp)):new Mp,i=t(r);r.rawAttach(i);let s=n&&n.tracer?new(n.tracer(qp)):new qp,o=n&&n.telemetry?new(n.telemetry(Bp)):new Bp,a=n&&n.client?new(n.client(Vp)):new Vp,l=n&&n.window?new(n.window(gy)):new gy,u=n&&n.workspace?new(n.workspace(yy)):new yy,c=n&&n.languages?new(n.languages(by)):new by,f=[r,s,o,a,l,u,c];function m(h){return h instanceof Promise?h:sr.thenable(h)?new Promise((b,g)=>{h.then(N=>b(N),N=>g(N))}):Promise.resolve(h)}let p,d,_,C={listen:()=>i.listen(),sendRequest:(h,...b)=>i.sendRequest(sr.string(h)?h:h.method,...b),onRequest:(h,b)=>i.onRequest(h,b),sendNotification:(h,b)=>{let g=sr.string(h)?h:h.method;arguments.length===1?i.sendNotification(g):i.sendNotification(g,b)},onNotification:(h,b)=>i.onNotification(h,b),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:h=>d=h,onInitialized:h=>i.onNotification(z.InitializedNotification.type,h),onShutdown:h=>p=h,onExit:h=>_=h,get console(){return r},get telemetry(){return o},get tracer(){return s},get client(){return a},get window(){return l},get workspace(){return u},get languages(){return c},onDidChangeConfiguration:h=>i.onNotification(z.DidChangeConfigurationNotification.type,h),onDidChangeWatchedFiles:h=>i.onNotification(z.DidChangeWatchedFilesNotification.type,h),__textDocumentSync:void 0,onDidOpenTextDocument:h=>i.onNotification(z.DidOpenTextDocumentNotification.type,h),onDidChangeTextDocument:h=>i.onNotification(z.DidChangeTextDocumentNotification.type,h),onDidCloseTextDocument:h=>i.onNotification(z.DidCloseTextDocumentNotification.type,h),onWillSaveTextDocument:h=>i.onNotification(z.WillSaveTextDocumentNotification.type,h),onWillSaveTextDocumentWaitUntil:h=>i.onRequest(z.WillSaveTextDocumentWaitUntilRequest.type,h),onDidSaveTextDocument:h=>i.onNotification(z.DidSaveTextDocumentNotification.type,h),sendDiagnostics:h=>i.sendNotification(z.PublishDiagnosticsNotification.type,h),onHover:h=>i.onRequest(z.HoverRequest.type,(b,g)=>h(b,g,xe.attachWorkDone(i,b),void 0)),onCompletion:h=>i.onRequest(z.CompletionRequest.type,(b,g)=>h(b,g,xe.attachWorkDone(i,b),xe.attachPartialResult(i,b))),onCompletionResolve:h=>i.onRequest(z.CompletionResolveRequest.type,h),onSignatureHelp:h=>i.onRequest(z.SignatureHelpRequest.type,(b,g)=>h(b,g,xe.attachWorkDone(i,b),void 0)),onDeclaration:h=>i.onRequest(z.DeclarationRequest.type,(b,g)=>h(b,g,xe.attachWorkDone(i,b),xe.attachPartialResult(i,b))),onDefinition:h=>i.onRequest(z.DefinitionRequest.type,(b,g)=>h(b,g,xe.attachWorkDone(i,b),xe.attachPartialResult(i,b))),onTypeDefinition:h=>i.onRequest(z.TypeDefinitionRequest.type,(b,g)=>h(b,g,xe.attachWorkDone(i,b),xe.attachPartialResult(i,b))),onImplementation:h=>i.onRequest(z.ImplementationRequest.type,(b,g)=>h(b,g,xe.attachWorkDone(i,b),xe.attachPartialResult(i,b))),onReferences:h=>i.onRequest(z.ReferencesRequest.type,(b,g)=>h(b,g,xe.attachWorkDone(i,b),xe.attachPartialResult(i,b))),onDocumentHighlight:h=>i.onRequest(z.DocumentHighlightRequest.type,(b,g)=>h(b,g,xe.attachWorkDone(i,b),xe.attachPartialResult(i,b))),onDocumentSymbol:h=>i.onRequest(z.DocumentSymbolRequest.type,(b,g)=>h(b,g,xe.attachWorkDone(i,b),xe.attachPartialResult(i,b))),onWorkspaceSymbol:h=>i.onRequest(z.WorkspaceSymbolRequest.type,(b,g)=>h(b,g,xe.attachWorkDone(i,b),xe.attachPartialResult(i,b))),onCodeAction:h=>i.onRequest(z.CodeActionRequest.type,(b,g)=>h(b,g,xe.attachWorkDone(i,b),xe.attachPartialResult(i,b))),onCodeActionResolve:h=>i.onRequest(z.CodeActionResolveRequest.type,(b,g)=>h(b,g)),onCodeLens:h=>i.onRequest(z.CodeLensRequest.type,(b,g)=>h(b,g,xe.attachWorkDone(i,b),xe.attachPartialResult(i,b))),onCodeLensResolve:h=>i.onRequest(z.CodeLensResolveRequest.type,(b,g)=>h(b,g)),onDocumentFormatting:h=>i.onRequest(z.DocumentFormattingRequest.type,(b,g)=>h(b,g,xe.attachWorkDone(i,b),void 0)),onDocumentRangeFormatting:h=>i.onRequest(z.DocumentRangeFormattingRequest.type,(b,g)=>h(b,g,xe.attachWorkDone(i,b),void 0)),onDocumentOnTypeFormatting:h=>i.onRequest(z.DocumentOnTypeFormattingRequest.type,(b,g)=>h(b,g)),onRenameRequest:h=>i.onRequest(z.RenameRequest.type,(b,g)=>h(b,g,xe.attachWorkDone(i,b),void 0)),onPrepareRename:h=>i.onRequest(z.PrepareRenameRequest.type,(b,g)=>h(b,g)),onDocumentLinks:h=>i.onRequest(z.DocumentLinkRequest.type,(b,g)=>h(b,g,xe.attachWorkDone(i,b),xe.attachPartialResult(i,b))),onDocumentLinkResolve:h=>i.onRequest(z.DocumentLinkResolveRequest.type,(b,g)=>h(b,g)),onDocumentColor:h=>i.onRequest(z.DocumentColorRequest.type,(b,g)=>h(b,g,xe.attachWorkDone(i,b),xe.attachPartialResult(i,b))),onColorPresentation:h=>i.onRequest(z.ColorPresentationRequest.type,(b,g)=>h(b,g,xe.attachWorkDone(i,b),xe.attachPartialResult(i,b))),onFoldingRanges:h=>i.onRequest(z.FoldingRangeRequest.type,(b,g)=>h(b,g,xe.attachWorkDone(i,b),xe.attachPartialResult(i,b))),onSelectionRanges:h=>i.onRequest(z.SelectionRangeRequest.type,(b,g)=>h(b,g,xe.attachWorkDone(i,b),xe.attachPartialResult(i,b))),onExecuteCommand:h=>i.onRequest(z.ExecuteCommandRequest.type,(b,g)=>h(b,g,xe.attachWorkDone(i,b),void 0)),dispose:()=>i.dispose()};for(let h of f)h.attach(C);return i.onRequest(z.InitializeRequest.type,h=>{e.initialize(h),sr.string(h.trace)&&(s.trace=z.Trace.fromString(h.trace));for(let b of f)b.initialize(h.capabilities);if(d){let b=d(h,new z.CancellationTokenSource().token,xe.attachWorkDone(i,h),void 0);return m(b).then(g=>{if(g instanceof z.ResponseError)return g;let N=g;N||(N={capabilities:{}});let S=N.capabilities;S||(S={},N.capabilities=S),S.textDocumentSync===void 0||S.textDocumentSync===null?S.textDocumentSync=sr.number(C.__textDocumentSync)?C.__textDocumentSync:z.TextDocumentSyncKind.None:!sr.number(S.textDocumentSync)&&!sr.number(S.textDocumentSync.change)&&(S.textDocumentSync.change=sr.number(C.__textDocumentSync)?C.__textDocumentSync:z.TextDocumentSyncKind.None);for(let V of f)V.fillServerCapabilities(S);return N})}else{let b={capabilities:{textDocumentSync:z.TextDocumentSyncKind.None}};for(let g of f)g.fillServerCapabilities(b.capabilities);return b}}),i.onRequest(z.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,p)return p(new z.CancellationTokenSource().token)}),i.onNotification(z.ExitNotification.type,()=>{try{_&&_()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(z.SetTraceNotification.type,h=>{s.trace=z.Trace.fromString(h.value)}),C}He.createConnection=L0});var Ry=K(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.resolveModulePath=bn.FileSystem=bn.resolveGlobalYarnPath=bn.resolveGlobalNodePath=bn.resolve=bn.uriToFilePath=void 0;var D0=require("url"),xr=require("path"),Gp=require("fs"),Wp=require("child_process");function k0(t){let e=D0.parse(t);if(e.protocol!=="file:"||!e.path)return;let n=e.path.split("/");for(var r=0,i=n.length;r1){let s=n[0],o=n[1];s.length===0&&o.length>1&&o[1]===":"&&n.shift()}return xr.normalize(n.join("/"))}bn.uriToFilePath=k0;function Hp(){return process.platform==="win32"}function Mu(t,e,n,r){let i="NODE_PATH",s=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((o,a)=>{let l=process.env,u=Object.create(null);Object.keys(l).forEach(c=>u[c]=l[c]),e&&Gp.existsSync(e)&&(u[i]?u[i]=e+xr.delimiter+u[i]:u[i]=e,r&&r(`NODE_PATH value is: ${u[i]}`)),u.ELECTRON_RUN_AS_NODE="1";try{let c=Wp.fork("",[],{cwd:n,env:u,execArgv:["-e",s]});if(c.pid===void 0){a(new Error(`Starting process to resolve node module ${t} failed`));return}c.on("error",m=>{a(m)}),c.on("message",m=>{m.c==="r"&&(c.send({c:"e"}),m.s?o(m.r):a(new Error(`Failed to resolve module: ${t}`)))});let f={c:"rs",a:t};c.send(f)}catch(c){a(c)}})}bn.resolve=Mu;function Yp(t){let e="npm",n=Object.create(null);Object.keys(process.env).forEach(s=>n[s]=process.env[s]),n.NO_UPDATE_NOTIFIER="true";let r={encoding:"utf8",env:n};Hp()&&(e="npm.cmd",r.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let s=Wp.spawnSync(e,["config","get","prefix"],r).stdout;if(!s){t&&t("'npm config get prefix' didn't return a value.");return}let o=s.trim();return t&&t(`'npm config get prefix' value is: ${o}`),o.length>0?Hp()?xr.join(o,"node_modules"):xr.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",i)}}bn.resolveGlobalNodePath=Yp;function M0(t){let e="yarn",n={encoding:"utf8"};Hp()&&(e="yarn.cmd",n.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let i=Wp.spawnSync(e,["global","dir","--json"],n),s=i.stdout;if(!s){t&&(t("'yarn global dir' didn't return a value."),i.stderr&&t(i.stderr));return}let o=s.trim().split(/\r?\n/);for(let a of o)try{let l=JSON.parse(a);if(l.type==="log")return xr.join(l.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",r)}}bn.resolveGlobalYarnPath=M0;var Cy;(function(t){let e;function n(){return e!==void 0||(process.platform==="win32"?e=!1:e=!Gp.existsSync(__filename.toUpperCase())||!Gp.existsSync(__filename.toLowerCase())),e}t.isCaseSensitive=n;function r(i,s){return n()?xr.normalize(s).indexOf(xr.normalize(i))===0:xr.normalize(s).toLowerCase().indexOf(xr.normalize(i).toLowerCase())===0}t.isParent=r})(Cy=bn.FileSystem||(bn.FileSystem={}));function F0(t,e,n,r){return n?(xr.isAbsolute(n)||(n=xr.join(t,n)),Mu(e,n,n,r).then(i=>Cy.isParent(n,i)?i:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,i=>Mu(e,Yp(r),t,r))):Mu(e,Yp(r),t,r)}bn.resolveModulePath=F0});var Kp=K((YV,Ay)=>{"use strict";Ay.exports=pn()});var Ey=K(Bn=>{"use strict";var V0=Bn&&Bn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),xy=Bn&&Bn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&V0(e,t,n)};Object.defineProperty(Bn,"__esModule",{value:!0});Bn.ProposedFeatures=Bn.SemanticTokensBuilder=void 0;var q0=Lp();Object.defineProperty(Bn,"SemanticTokensBuilder",{enumerable:!0,get:function(){return q0.SemanticTokensBuilder}});xy(pn(),Bn);xy(Up(),Bn);var B0;(function(t){t.all={__brand:"features"}})(B0=Bn.ProposedFeatures||(Bn.ProposedFeatures={}))});var nn=K(jn=>{"use strict";var j0=jn&&jn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),wy=jn&&jn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&j0(e,t,n)};Object.defineProperty(jn,"__esModule",{value:!0});jn.createConnection=jn.Files=void 0;var $p=mu(),U0=Up(),rl=Ry(),Ds=Kp();wy(Kp(),jn);wy(Ey(),jn);var G0;(function(t){t.uriToFilePath=rl.uriToFilePath,t.resolveGlobalNodePath=rl.resolveGlobalNodePath,t.resolveGlobalYarnPath=rl.resolveGlobalYarnPath,t.resolve=rl.resolve,t.resolveModulePath=rl.resolveModulePath})(G0=jn.Files||(jn.Files={}));var Oy;function Fu(){if(Oy!==void 0)try{Oy.end()}catch{}}var Do=!1,Ly;function W0(){let t="--clientProcessId";function e(n){try{let r=parseInt(n);isNaN(r)||(Ly=setInterval(()=>{try{process.kill(r,0)}catch{Fu(),process.exit(Do?0:1)}},3e3))}catch{}}for(let n=2;n{let e=t.processId;$p.number(e)&&Ly===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(Do?0:1)}},3e3)},get shutdownReceived(){return Do},set shutdownReceived(t){Do=t},exit:t=>{Fu(),process.exit(t)}};function Y0(t,e,n,r){let i,s,o,a;return t!==void 0&&t.__brand==="features"&&(i=t,t=e,e=n,n=r),Ds.ConnectionStrategy.is(t)||Ds.ConnectionOptions.is(t)?a=t:(s=t,o=e,a=n),K0(s,o,a,i)}jn.createConnection=Y0;function K0(t,e,n,r){if(!t&&!e&&process.argv.length>2){let a,l,u=process.argv.slice(2);for(let c=0;c{Fu(),process.exit(Do?0:1)}),a.on("close",()=>{Fu(),process.exit(Do?0:1)})}let o=a=>Ds.createProtocolConnection(t,e,a,n);return U0.createConnection(o,H0,r)}});var ky=K((zV,Dy)=>{"use strict";Dy.exports=nn()});var qu=K(Zp=>{"use strict";Object.defineProperty(Zp,"__esModule",{value:!0});var sb=function(){function t(){this._state=new Int32Array(4),this._buffer=new ArrayBuffer(68),this._buffer8=new Uint8Array(this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()}return t.hashStr=function(e,n){return n===void 0&&(n=!1),this.onePassHasher.start().appendStr(e).end(n)},t.hashAsciiStr=function(e,n){return n===void 0&&(n=!1),this.onePassHasher.start().appendAsciiStr(e).end(n)},t._hex=function(e){var n=t.hexChars,r=t.hexOut,i,s,o,a;for(a=0;a<4;a+=1)for(s=a*8,i=e[a],o=0;o<8;o+=2)r[s+1+o]=n.charAt(i&15),i>>>=4,r[s+0+o]=n.charAt(i&15),i>>>=4;return r.join("")},t._md5cycle=function(e,n){var r=e[0],i=e[1],s=e[2],o=e[3];r+=(i&s|~i&o)+n[0]-680876936|0,r=(r<<7|r>>>25)+i|0,o+=(r&i|~r&s)+n[1]-389564586|0,o=(o<<12|o>>>20)+r|0,s+=(o&r|~o&i)+n[2]+606105819|0,s=(s<<17|s>>>15)+o|0,i+=(s&o|~s&r)+n[3]-1044525330|0,i=(i<<22|i>>>10)+s|0,r+=(i&s|~i&o)+n[4]-176418897|0,r=(r<<7|r>>>25)+i|0,o+=(r&i|~r&s)+n[5]+1200080426|0,o=(o<<12|o>>>20)+r|0,s+=(o&r|~o&i)+n[6]-1473231341|0,s=(s<<17|s>>>15)+o|0,i+=(s&o|~s&r)+n[7]-45705983|0,i=(i<<22|i>>>10)+s|0,r+=(i&s|~i&o)+n[8]+1770035416|0,r=(r<<7|r>>>25)+i|0,o+=(r&i|~r&s)+n[9]-1958414417|0,o=(o<<12|o>>>20)+r|0,s+=(o&r|~o&i)+n[10]-42063|0,s=(s<<17|s>>>15)+o|0,i+=(s&o|~s&r)+n[11]-1990404162|0,i=(i<<22|i>>>10)+s|0,r+=(i&s|~i&o)+n[12]+1804603682|0,r=(r<<7|r>>>25)+i|0,o+=(r&i|~r&s)+n[13]-40341101|0,o=(o<<12|o>>>20)+r|0,s+=(o&r|~o&i)+n[14]-1502002290|0,s=(s<<17|s>>>15)+o|0,i+=(s&o|~s&r)+n[15]+1236535329|0,i=(i<<22|i>>>10)+s|0,r+=(i&o|s&~o)+n[1]-165796510|0,r=(r<<5|r>>>27)+i|0,o+=(r&s|i&~s)+n[6]-1069501632|0,o=(o<<9|o>>>23)+r|0,s+=(o&i|r&~i)+n[11]+643717713|0,s=(s<<14|s>>>18)+o|0,i+=(s&r|o&~r)+n[0]-373897302|0,i=(i<<20|i>>>12)+s|0,r+=(i&o|s&~o)+n[5]-701558691|0,r=(r<<5|r>>>27)+i|0,o+=(r&s|i&~s)+n[10]+38016083|0,o=(o<<9|o>>>23)+r|0,s+=(o&i|r&~i)+n[15]-660478335|0,s=(s<<14|s>>>18)+o|0,i+=(s&r|o&~r)+n[4]-405537848|0,i=(i<<20|i>>>12)+s|0,r+=(i&o|s&~o)+n[9]+568446438|0,r=(r<<5|r>>>27)+i|0,o+=(r&s|i&~s)+n[14]-1019803690|0,o=(o<<9|o>>>23)+r|0,s+=(o&i|r&~i)+n[3]-187363961|0,s=(s<<14|s>>>18)+o|0,i+=(s&r|o&~r)+n[8]+1163531501|0,i=(i<<20|i>>>12)+s|0,r+=(i&o|s&~o)+n[13]-1444681467|0,r=(r<<5|r>>>27)+i|0,o+=(r&s|i&~s)+n[2]-51403784|0,o=(o<<9|o>>>23)+r|0,s+=(o&i|r&~i)+n[7]+1735328473|0,s=(s<<14|s>>>18)+o|0,i+=(s&r|o&~r)+n[12]-1926607734|0,i=(i<<20|i>>>12)+s|0,r+=(i^s^o)+n[5]-378558|0,r=(r<<4|r>>>28)+i|0,o+=(r^i^s)+n[8]-2022574463|0,o=(o<<11|o>>>21)+r|0,s+=(o^r^i)+n[11]+1839030562|0,s=(s<<16|s>>>16)+o|0,i+=(s^o^r)+n[14]-35309556|0,i=(i<<23|i>>>9)+s|0,r+=(i^s^o)+n[1]-1530992060|0,r=(r<<4|r>>>28)+i|0,o+=(r^i^s)+n[4]+1272893353|0,o=(o<<11|o>>>21)+r|0,s+=(o^r^i)+n[7]-155497632|0,s=(s<<16|s>>>16)+o|0,i+=(s^o^r)+n[10]-1094730640|0,i=(i<<23|i>>>9)+s|0,r+=(i^s^o)+n[13]+681279174|0,r=(r<<4|r>>>28)+i|0,o+=(r^i^s)+n[0]-358537222|0,o=(o<<11|o>>>21)+r|0,s+=(o^r^i)+n[3]-722521979|0,s=(s<<16|s>>>16)+o|0,i+=(s^o^r)+n[6]+76029189|0,i=(i<<23|i>>>9)+s|0,r+=(i^s^o)+n[9]-640364487|0,r=(r<<4|r>>>28)+i|0,o+=(r^i^s)+n[12]-421815835|0,o=(o<<11|o>>>21)+r|0,s+=(o^r^i)+n[15]+530742520|0,s=(s<<16|s>>>16)+o|0,i+=(s^o^r)+n[2]-995338651|0,i=(i<<23|i>>>9)+s|0,r+=(s^(i|~o))+n[0]-198630844|0,r=(r<<6|r>>>26)+i|0,o+=(i^(r|~s))+n[7]+1126891415|0,o=(o<<10|o>>>22)+r|0,s+=(r^(o|~i))+n[14]-1416354905|0,s=(s<<15|s>>>17)+o|0,i+=(o^(s|~r))+n[5]-57434055|0,i=(i<<21|i>>>11)+s|0,r+=(s^(i|~o))+n[12]+1700485571|0,r=(r<<6|r>>>26)+i|0,o+=(i^(r|~s))+n[3]-1894986606|0,o=(o<<10|o>>>22)+r|0,s+=(r^(o|~i))+n[10]-1051523|0,s=(s<<15|s>>>17)+o|0,i+=(o^(s|~r))+n[1]-2054922799|0,i=(i<<21|i>>>11)+s|0,r+=(s^(i|~o))+n[8]+1873313359|0,r=(r<<6|r>>>26)+i|0,o+=(i^(r|~s))+n[15]-30611744|0,o=(o<<10|o>>>22)+r|0,s+=(r^(o|~i))+n[6]-1560198380|0,s=(s<<15|s>>>17)+o|0,i+=(o^(s|~r))+n[13]+1309151649|0,i=(i<<21|i>>>11)+s|0,r+=(s^(i|~o))+n[4]-145523070|0,r=(r<<6|r>>>26)+i|0,o+=(i^(r|~s))+n[11]-1120210379|0,o=(o<<10|o>>>22)+r|0,s+=(r^(o|~i))+n[2]+718787259|0,s=(s<<15|s>>>17)+o|0,i+=(o^(s|~r))+n[9]-343485551|0,i=(i<<21|i>>>11)+s|0,e[0]=r+e[0]|0,e[1]=i+e[1]|0,e[2]=s+e[2]|0,e[3]=o+e[3]|0},t.prototype.start=function(){return this._dataLength=0,this._bufferLength=0,this._state.set(t.stateIdentity),this},t.prototype.appendStr=function(e){var n=this._buffer8,r=this._buffer32,i=this._bufferLength,s,o;for(o=0;o>>6)+192,n[i++]=s&63|128;else if(s<55296||s>56319)n[i++]=(s>>>12)+224,n[i++]=s>>>6&63|128,n[i++]=s&63|128;else{if(s=(s-55296)*1024+(e.charCodeAt(++o)-56320)+65536,s>1114111)throw new Error("Unicode standard supports code points up to U+10FFFF");n[i++]=(s>>>18)+240,n[i++]=s>>>12&63|128,n[i++]=s>>>6&63|128,n[i++]=s&63|128}i>=64&&(this._dataLength+=64,t._md5cycle(this._state,r),i-=64,r[0]=r[16])}return this._bufferLength=i,this},t.prototype.appendAsciiStr=function(e){for(var n=this._buffer8,r=this._buffer32,i=this._bufferLength,s,o=0;;){for(s=Math.min(e.length-o,64-i);s--;)n[i++]=e.charCodeAt(o++);if(i<64)break;this._dataLength+=64,t._md5cycle(this._state,r),i=0}return this._bufferLength=i,this},t.prototype.appendByteArray=function(e){for(var n=this._buffer8,r=this._buffer32,i=this._bufferLength,s,o=0;;){for(s=Math.min(e.length-o,64-i);s--;)n[i++]=e[o++];if(i<64)break;this._dataLength+=64,t._md5cycle(this._state,r),i=0}return this._bufferLength=i,this},t.prototype.getState=function(){var e=this,n=e._state;return{buffer:String.fromCharCode.apply(null,e._buffer8),buflen:e._bufferLength,length:e._dataLength,state:[n[0],n[1],n[2],n[3]]}},t.prototype.setState=function(e){var n=e.buffer,r=e.state,i=this._state,s;for(this._dataLength=e.length,this._bufferLength=e.buflen,i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],s=0;s>2)+1,o;if(this._dataLength+=n,r[n]=128,r[n+1]=r[n+2]=r[n+3]=0,i.set(t.buffer32Identity.subarray(s),s),n>55&&(t._md5cycle(this._state,i),i.set(t.buffer32Identity)),o=this._dataLength*8,o<=4294967295)i[14]=o;else{var a=o.toString(16).match(/(.*?)(.{0,8})$/);if(a===null)return;var l=parseInt(a[2],16),u=parseInt(a[1],16)||0;i[14]=l,i[15]=u}return t._md5cycle(this._state,i),e?this._state:t._hex(this._state)},t.stateIdentity=new Int32Array([1732584193,-271733879,-1732584194,271733878]),t.buffer32Identity=new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),t.hexChars="0123456789abcdef",t.hexOut=[],t.onePassHasher=new t,t}();Zp.Md5=sb;sb.hashStr("hello")!=="5d41402abc4b2a76b9719d911017c592"&&console.error("Md5 self test failed.")});var hs=K(Dn=>{"use strict";var Vi={ANCHOR:"&",COMMENT:"#",TAG:"!",DIRECTIVES_END:"-",DOCUMENT_END:"."},Cl={ALIAS:"ALIAS",BLANK_LINE:"BLANK_LINE",BLOCK_FOLDED:"BLOCK_FOLDED",BLOCK_LITERAL:"BLOCK_LITERAL",COMMENT:"COMMENT",DIRECTIVE:"DIRECTIVE",DOCUMENT:"DOCUMENT",FLOW_MAP:"FLOW_MAP",FLOW_SEQ:"FLOW_SEQ",MAP:"MAP",MAP_KEY:"MAP_KEY",MAP_VALUE:"MAP_VALUE",PLAIN:"PLAIN",QUOTE_DOUBLE:"QUOTE_DOUBLE",QUOTE_SINGLE:"QUOTE_SINGLE",SEQ:"SEQ",SEQ_ITEM:"SEQ_ITEM"},RO="tag:yaml.org,2002:",AO={MAP:"tag:yaml.org,2002:map",SEQ:"tag:yaml.org,2002:seq",STR:"tag:yaml.org,2002:str"};function ev(t){let e=[0],n=t.indexOf(` `);for(;n!==-1;)n+=1,e.push(n),n=t.indexOf(` -`,n);return e}function ev(t){let e,n;return typeof t=="string"?(e=ZN(t),n=t):(Array.isArray(t)&&(t=t[0]),t&&t.context&&(t.lineStarts||(t.lineStarts=ZN(t.context.src)),e=t.lineStarts,n=t.context.src)),{lineStarts:e,src:n}}function pm(t,e){if(typeof t!="number"||t<0)return null;let{lineStarts:n,src:r}=ev(e);if(!n||!r||t>r.length)return null;for(let s=0;s=1)||t>n.length)return null;let i=n[t-1],s=n[t];for(;s&&s>i&&r[s-1]===` -`;)--s;return r.slice(i,s)}function RO({start:t,end:e},n,r=80){let i=CO(t.line,n);if(!i)return null;let{col:s}=t;if(i.length>r)if(s<=r-10)i=i.substr(0,r-1)+"\u2026";else{let c=Math.round(r/2);i.length>s+c&&(i=i.substr(0,s+c-1)+"\u2026"),s-=i.length-r,i="\u2026"+i.substr(1-r)}let o=1,a="";e&&(e.line===t.line&&s+(e.col-t.col)<=r+1?o=e.col-t.col:(o=Math.min(i.length+1,r)-s,a="\u2026"));let l=s>1?" ".repeat(s-1):"",u="^".repeat(o);return`${i} +`,n);return e}function tv(t){let e,n;return typeof t=="string"?(e=ev(t),n=t):(Array.isArray(t)&&(t=t[0]),t&&t.context&&(t.lineStarts||(t.lineStarts=ev(t.context.src)),e=t.lineStarts,n=t.context.src)),{lineStarts:e,src:n}}function pm(t,e){if(typeof t!="number"||t<0)return null;let{lineStarts:n,src:r}=tv(e);if(!n||!r||t>r.length)return null;for(let s=0;s=1)||t>n.length)return null;let i=n[t-1],s=n[t];for(;s&&s>i&&r[s-1]===` +`;)--s;return r.slice(i,s)}function EO({start:t,end:e},n,r=80){let i=xO(t.line,n);if(!i)return null;let{col:s}=t;if(i.length>r)if(s<=r-10)i=i.substr(0,r-1)+"\u2026";else{let c=Math.round(r/2);i.length>s+c&&(i=i.substr(0,s+c-1)+"\u2026"),s-=i.length-r,i="\u2026"+i.substr(1-r)}let o=1,a="";e&&(e.line===t.line&&s+(e.col-t.col)<=r+1?o=e.col-t.col:(o=Math.min(i.length+1,r)-s,a="\u2026"));let l=s>1?" ".repeat(s-1):"",u="^".repeat(o);return`${i} ${l}${u}${a}`}var Zs=class{static copy(e){return new Zs(e.start,e.end)}constructor(e,n){this.start=e,this.end=n||e}isEmpty(){return typeof this.start!="number"||!this.end||this.end<=this.start}setOrigRange(e,n){let{start:r,end:i}=this;if(e.length===0||i<=e[0])return this.origStart=r,this.origEnd=i,n;let s=n;for(;sr);)++s;this.origStart=r+s;let o=s;for(;s=i);)++s;return this.origEnd=i+s,o}},an=class{static addStringTerminator(e,n,r){if(r[r.length-1]===` `)return r;let i=an.endOfWhiteSpace(e,n);return i>=e.length||e[i]===` `?r+` @@ -53,189 +53,189 @@ ${l}${u}${a}`}var Zs=class{static copy(e){return new Zs(e.start,e.end)}construct `;){switch(a){case` `:i=0,n+=1,o+=` `;break;case" ":i<=r&&(s=!0),n=an.endOfWhiteSpace(e,n+2)-1;break;case" ":i+=1,n+=1;break}a=e[n+1]}return o||(o=" "),a&&i<=r&&(s=!0),{fold:o,offset:n,error:s}}constructor(e,n,r){Object.defineProperty(this,"context",{value:r||null,writable:!0}),this.error=null,this.range=null,this.valueRange=null,this.props=n||[],this.type=e,this.value=null}getPropValue(e,n,r){if(!this.context)return null;let{src:i}=this.context,s=this.props[e];return s&&i[s.start]===n?i.slice(s.start+(r?1:0),s.end):null}get anchor(){for(let e=0;e0?e.join(` -`):null}commentHasRequiredWhitespace(e){let{src:n}=this.context;if(this.header&&e===this.header.end||!this.valueRange)return!1;let{end:r}=this.valueRange;return e!==r||an.atBlank(n,r-1)}get hasComment(){if(this.context){let{src:e}=this.context;for(let n=0;nr.setOrigRange(e,n)),n}toString(){let{context:{src:e},range:n,value:r}=this;if(r!=null)return r;let i=e.slice(n.start,n.end);return an.addStringTerminator(e,n.end,i)}},ba=class extends Error{constructor(e,n,r){if(!r||!(n instanceof an))throw new Error(`Invalid arguments for new ${e}`);super();this.name=e,this.message=r,this.source=n}makePretty(){if(!this.source)return;this.nodeType=this.source.type;let e=this.source.context&&this.source.context.root;if(typeof this.offset=="number"){this.range=new Zs(this.offset,this.offset+1);let n=e&&pm(this.offset,e);if(n){let r={line:n.line,col:n.col+1};this.linePos={start:n,end:r}}delete this.offset}else this.range=this.source.range,this.linePos=this.source.rangeAsLinePos;if(this.linePos){let{line:n,col:r}=this.linePos.start;this.message+=` at line ${n}, column ${r}`;let i=e&&RO(this.linePos,e);i&&(this.message+=`: +`):null}commentHasRequiredWhitespace(e){let{src:n}=this.context;if(this.header&&e===this.header.end||!this.valueRange)return!1;let{end:r}=this.valueRange;return e!==r||an.atBlank(n,r-1)}get hasComment(){if(this.context){let{src:e}=this.context;for(let n=0;nr.setOrigRange(e,n)),n}toString(){let{context:{src:e},range:n,value:r}=this;if(r!=null)return r;let i=e.slice(n.start,n.end);return an.addStringTerminator(e,n.end,i)}},ba=class extends Error{constructor(e,n,r){if(!r||!(n instanceof an))throw new Error(`Invalid arguments for new ${e}`);super();this.name=e,this.message=r,this.source=n}makePretty(){if(!this.source)return;this.nodeType=this.source.type;let e=this.source.context&&this.source.context.root;if(typeof this.offset=="number"){this.range=new Zs(this.offset,this.offset+1);let n=e&&pm(this.offset,e);if(n){let r={line:n.line,col:n.col+1};this.linePos={start:n,end:r}}delete this.offset}else this.range=this.source.range,this.linePos=this.source.rangeAsLinePos;if(this.linePos){let{line:n,col:r}=this.linePos.start;this.message+=` at line ${n}, column ${r}`;let i=e&&EO(this.linePos,e);i&&(this.message+=`: ${i} -`)}delete this.source}},tv=class extends ba{constructor(e,n){super("YAMLReferenceError",e,n)}},Vc=class extends ba{constructor(e,n){super("YAMLSemanticError",e,n)}},nv=class extends ba{constructor(e,n){super("YAMLSyntaxError",e,n)}},rv=class extends ba{constructor(e,n){super("YAMLWarning",e,n)}};function AO(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Cl=class extends an{static endOfLine(e,n,r){let i=e[n],s=n;for(;i&&i!==` +`)}delete this.source}},nv=class extends ba{constructor(e,n){super("YAMLReferenceError",e,n)}},qc=class extends ba{constructor(e,n){super("YAMLSemanticError",e,n)}},rv=class extends ba{constructor(e,n){super("YAMLSyntaxError",e,n)}},iv=class extends ba{constructor(e,n){super("YAMLWarning",e,n)}};function wO(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Rl=class extends an{static endOfLine(e,n,r){let i=e[n],s=n;for(;i&&i!==` `&&!(r&&(i==="["||i==="]"||i==="{"||i==="}"||i===","));){let o=e[s+1];if(i===":"&&(!o||o===` `||o===" "||o===" "||r&&o===",")||(i===" "||i===" ")&&o==="#")break;s+=1,i=o}return s}get strValue(){if(!this.valueRange||!this.context)return null;let{start:e,end:n}=this.valueRange,{src:r}=this.context,i=r[n-1];for(;eu?r.slice(u,a+1):l)}else s+=l}let o=r[e];switch(o){case" ":{let a="Plain value cannot start with a tab character";return{errors:[new Vc(this,a)],str:s}}case"@":case"`":{let a=`Plain value cannot start with reserved character ${o}`;return{errors:[new Vc(this,a)],str:s}}default:return s}}parseBlockValue(e){let{indent:n,inFlow:r,src:i}=this.context,s=e,o=e;for(let a=i[s];a===` +`&&(s+=a>u?r.slice(u,a+1):l)}else s+=l}let o=r[e];switch(o){case" ":{let a="Plain value cannot start with a tab character";return{errors:[new qc(this,a)],str:s}}case"@":case"`":{let a=`Plain value cannot start with reserved character ${o}`;return{errors:[new qc(this,a)],str:s}}default:return s}}parseBlockValue(e){let{indent:n,inFlow:r,src:i}=this.context,s=e,o=e;for(let a=i[s];a===` `&&!an.atDocumentBoundary(i,s+1);a=i[s]){let l=an.endOfBlockIndent(i,n,s+1);if(l===null||i[l]==="#")break;i[l]===` -`?s=l:(o=Cl.endOfLine(i,l,r),s=o)}return this.valueRange.isEmpty()&&(this.valueRange.start=e),this.valueRange.end=o,o}parse(e,n){this.context=e;let{inFlow:r,src:i}=e,s=n,o=i[s];return o&&o!=="#"&&o!==` -`&&(s=Cl.endOfLine(i,n,r)),this.valueRange=new Zs(n,s),s=an.endOfWhiteSpace(i,s),s=this.parseComment(s),(!this.hasComment||this.valueRange.isEmpty())&&(s=this.parseBlockValue(s)),s}};Dn.Char=Vi;Dn.Node=an;Dn.PlainValue=Cl;Dn.Range=Zs;Dn.Type=Sl;Dn.YAMLError=ba;Dn.YAMLReferenceError=tv;Dn.YAMLSemanticError=Vc;Dn.YAMLSyntaxError=nv;Dn.YAMLWarning=rv;Dn._defineProperty=AO;Dn.defaultTagPrefix=IO;Dn.defaultTags=SO});var uv=K(lv=>{"use strict";var D=hs(),Ta=class extends D.Node{constructor(){super(D.Type.BLANK_LINE)}get includesTrailingLines(){return!0}parse(e,n){return this.context=e,this.range=new D.Range(n,n+1),n+1}},qc=class extends D.Node{constructor(e,n){super(e,n);this.node=null}get includesTrailingLines(){return!!this.node&&this.node.includesTrailingLines}parse(e,n){this.context=e;let{parseNode:r,src:i}=e,{atLineStart:s,lineStart:o}=e;!s&&this.type===D.Type.SEQ_ITEM&&(this.error=new D.YAMLSemanticError(this,"Sequence items must not have preceding content on the same line"));let a=s?n-o:e.indent,l=D.Node.endOfWhiteSpace(i,n+1),u=i[l],c=u==="#",f=[],m=null;for(;u===` -`||u==="#";){if(u==="#"){let p=D.Node.endOfLine(i,l+1);f.push(new D.Range(l,p)),l=p}else{s=!0,o=l+1;let p=D.Node.endOfWhiteSpace(i,o);i[p]===` -`&&f.length===0&&(m=new Ta,o=m.parse({src:i},o)),l=D.Node.endOfIndent(i,o)}u=i[l]}if(D.Node.nextNodeIsIndented(u,l-(o+a),this.type!==D.Type.SEQ_ITEM)?this.node=r({atLineStart:s,inCollection:!1,indent:a,lineStart:o,parent:this},l):u&&o>n+1&&(l=o-1),this.node){if(m){let p=e.parent.items||e.parent.contents;p&&p.push(m)}f.length&&Array.prototype.push.apply(this.props,f),l=this.node.range.end}else if(c){let p=f[0];this.props.push(p),l=p.end}else l=D.Node.endOfLine(i,n+1);let d=this.node?this.node.valueRange.end:l;return this.valueRange=new D.Range(n,d),l}setOrigRanges(e,n){return n=super.setOrigRanges(e,n),this.node?this.node.setOrigRanges(e,n):n}toString(){let{context:{src:e},node:n,range:r,value:i}=this;if(i!=null)return i;let s=n?e.slice(r.start,n.range.start)+String(n):e.slice(r.start,r.end);return D.Node.addStringTerminator(e,r.end,s)}},Na=class extends D.Node{constructor(){super(D.Type.COMMENT)}parse(e,n){this.context=e;let r=this.parseComment(n);return this.range=new D.Range(n,r),r}};function dm(t){let e=t;for(;e instanceof qc;)e=e.node;if(!(e instanceof va))return null;let n=e.items.length,r=-1;for(let o=n-1;o>=0;--o){let a=e.items[o];if(a.type===D.Type.COMMENT){let{indent:l,lineStart:u}=a.context;if(l>0&&a.range.start>=u+l)break;r=o}else if(a.type===D.Type.BLANK_LINE)r=o;else break}if(r===-1)return null;let i=e.items.splice(r,n-r),s=i[0].range.start;for(;e.range.end=s,e.valueRange&&e.valueRange.end>s&&(e.valueRange.end=s),e!==t;)e=e.context.parent;return i}var va=class extends D.Node{static nextContentHasIndent(e,n,r){let i=D.Node.endOfLine(e,n)+1;n=D.Node.endOfWhiteSpace(e,i);let s=e[n];return s?n>=i+r?!0:s!=="#"&&s!==` +`?s=l:(o=Rl.endOfLine(i,l,r),s=o)}return this.valueRange.isEmpty()&&(this.valueRange.start=e),this.valueRange.end=o,o}parse(e,n){this.context=e;let{inFlow:r,src:i}=e,s=n,o=i[s];return o&&o!=="#"&&o!==` +`&&(s=Rl.endOfLine(i,n,r)),this.valueRange=new Zs(n,s),s=an.endOfWhiteSpace(i,s),s=this.parseComment(s),(!this.hasComment||this.valueRange.isEmpty())&&(s=this.parseBlockValue(s)),s}};Dn.Char=Vi;Dn.Node=an;Dn.PlainValue=Rl;Dn.Range=Zs;Dn.Type=Cl;Dn.YAMLError=ba;Dn.YAMLReferenceError=nv;Dn.YAMLSemanticError=qc;Dn.YAMLSyntaxError=rv;Dn.YAMLWarning=iv;Dn._defineProperty=wO;Dn.defaultTagPrefix=RO;Dn.defaultTags=AO});var cv=K(uv=>{"use strict";var D=hs(),Ta=class extends D.Node{constructor(){super(D.Type.BLANK_LINE)}get includesTrailingLines(){return!0}parse(e,n){return this.context=e,this.range=new D.Range(n,n+1),n+1}},Bc=class extends D.Node{constructor(e,n){super(e,n);this.node=null}get includesTrailingLines(){return!!this.node&&this.node.includesTrailingLines}parse(e,n){this.context=e;let{parseNode:r,src:i}=e,{atLineStart:s,lineStart:o}=e;!s&&this.type===D.Type.SEQ_ITEM&&(this.error=new D.YAMLSemanticError(this,"Sequence items must not have preceding content on the same line"));let a=s?n-o:e.indent,l=D.Node.endOfWhiteSpace(i,n+1),u=i[l],c=u==="#",f=[],m=null;for(;u===` +`||u==="#";){if(u==="#"){let d=D.Node.endOfLine(i,l+1);f.push(new D.Range(l,d)),l=d}else{s=!0,o=l+1;let d=D.Node.endOfWhiteSpace(i,o);i[d]===` +`&&f.length===0&&(m=new Ta,o=m.parse({src:i},o)),l=D.Node.endOfIndent(i,o)}u=i[l]}if(D.Node.nextNodeIsIndented(u,l-(o+a),this.type!==D.Type.SEQ_ITEM)?this.node=r({atLineStart:s,inCollection:!1,indent:a,lineStart:o,parent:this},l):u&&o>n+1&&(l=o-1),this.node){if(m){let d=e.parent.items||e.parent.contents;d&&d.push(m)}f.length&&Array.prototype.push.apply(this.props,f),l=this.node.range.end}else if(c){let d=f[0];this.props.push(d),l=d.end}else l=D.Node.endOfLine(i,n+1);let p=this.node?this.node.valueRange.end:l;return this.valueRange=new D.Range(n,p),l}setOrigRanges(e,n){return n=super.setOrigRanges(e,n),this.node?this.node.setOrigRanges(e,n):n}toString(){let{context:{src:e},node:n,range:r,value:i}=this;if(i!=null)return i;let s=n?e.slice(r.start,n.range.start)+String(n):e.slice(r.start,r.end);return D.Node.addStringTerminator(e,r.end,s)}},Na=class extends D.Node{constructor(){super(D.Type.COMMENT)}parse(e,n){this.context=e;let r=this.parseComment(n);return this.range=new D.Range(n,r),r}};function dm(t){let e=t;for(;e instanceof Bc;)e=e.node;if(!(e instanceof va))return null;let n=e.items.length,r=-1;for(let o=n-1;o>=0;--o){let a=e.items[o];if(a.type===D.Type.COMMENT){let{indent:l,lineStart:u}=a.context;if(l>0&&a.range.start>=u+l)break;r=o}else if(a.type===D.Type.BLANK_LINE)r=o;else break}if(r===-1)return null;let i=e.items.splice(r,n-r),s=i[0].range.start;for(;e.range.end=s,e.valueRange&&e.valueRange.end>s&&(e.valueRange.end=s),e!==t;)e=e.context.parent;return i}var va=class extends D.Node{static nextContentHasIndent(e,n,r){let i=D.Node.endOfLine(e,n)+1;n=D.Node.endOfWhiteSpace(e,i);let s=e[n];return s?n>=i+r?!0:s!=="#"&&s!==` `?!1:va.nextContentHasIndent(e,n,r):!1}constructor(e){super(e.type===D.Type.SEQ_ITEM?D.Type.SEQ:D.Type.MAP);for(let r=e.props.length-1;r>=0;--r)if(e.props[r].start0}parse(e,n){this.context=e;let{parseNode:r,src:i}=e,s=D.Node.startOfLine(i,n),o=this.items[0];o.context.parent=this,this.valueRange=D.Range.copy(o.valueRange);let a=o.range.start-o.context.lineStart,l=n;l=D.Node.normalizeOffset(i,l);let u=i[l],c=D.Node.endOfWhiteSpace(i,s)===l,f=!1;for(;u;){for(;u===` `||u==="#";){if(c&&u===` -`&&!f){let p=new Ta;if(l=p.parse({src:i},l),this.valueRange.end=l,l>=i.length){u=null;break}this.items.push(p),l-=1}else if(u==="#"){if(l=i.length){u=null;break}}if(s=l+1,l=D.Node.endOfIndent(i,s),D.Node.atBlank(i,l)){let p=D.Node.endOfWhiteSpace(i,l),_=i[p];(!_||_===` -`||_==="#")&&(l=p)}u=i[l],c=!0}if(!u)break;if(l!==s+a&&(c||u!==":")){if(ln&&(l=s);break}else if(!this.error){let p="All collection items must start at the same column";this.error=new D.YAMLSyntaxError(this,p)}}if(o.type===D.Type.SEQ_ITEM){if(u!=="-"){s>n&&(l=s);break}}else if(u==="-"&&!this.error){let p=i[l+1];if(!p||p===` -`||p===" "||p===" "){let _="A collection cannot be both a mapping and a sequence";this.error=new D.YAMLSyntaxError(this,_)}}let m=r({atLineStart:c,inCollection:!0,indent:a,lineStart:s,parent:this},l);if(!m)return l;if(this.items.push(m),this.valueRange.end=m.valueRange.end,l=D.Node.normalizeOffset(i,m.range.end),u=i[l],c=!1,f=m.includesTrailingLines,u){let p=l-1,_=i[p];for(;_===" "||_===" ";)_=i[--p];_===` -`&&(s=p+1,c=!0)}let d=dm(m);d&&Array.prototype.push.apply(this.items,d)}return l}setOrigRanges(e,n){return n=super.setOrigRanges(e,n),this.items.forEach(r=>{n=r.setOrigRanges(e,n)}),n}toString(){let{context:{src:e},items:n,range:r,value:i}=this;if(i!=null)return i;let s=e.slice(r.start,n[0].range.start)+String(n[0]);for(let o=1;o=i.length){u=null;break}this.items.push(d),l-=1}else if(u==="#"){if(l=i.length){u=null;break}}if(s=l+1,l=D.Node.endOfIndent(i,s),D.Node.atBlank(i,l)){let d=D.Node.endOfWhiteSpace(i,l),_=i[d];(!_||_===` +`||_==="#")&&(l=d)}u=i[l],c=!0}if(!u)break;if(l!==s+a&&(c||u!==":")){if(ln&&(l=s);break}else if(!this.error){let d="All collection items must start at the same column";this.error=new D.YAMLSyntaxError(this,d)}}if(o.type===D.Type.SEQ_ITEM){if(u!=="-"){s>n&&(l=s);break}}else if(u==="-"&&!this.error){let d=i[l+1];if(!d||d===` +`||d===" "||d===" "){let _="A collection cannot be both a mapping and a sequence";this.error=new D.YAMLSyntaxError(this,_)}}let m=r({atLineStart:c,inCollection:!0,indent:a,lineStart:s,parent:this},l);if(!m)return l;if(this.items.push(m),this.valueRange.end=m.valueRange.end,l=D.Node.normalizeOffset(i,m.range.end),u=i[l],c=!1,f=m.includesTrailingLines,u){let d=l-1,_=i[d];for(;_===" "||_===" ";)_=i[--d];_===` +`&&(s=d+1,c=!0)}let p=dm(m);p&&Array.prototype.push.apply(this.items,p)}return l}setOrigRanges(e,n){return n=super.setOrigRanges(e,n),this.items.forEach(r=>{n=r.setOrigRanges(e,n)}),n}toString(){let{context:{src:e},items:n,range:r,value:i}=this;if(i!=null)return i;let s=e.slice(r.start,n[0].range.start)+String(n[0]);for(let o=1;o0&&(this.contents=this.directives,this.directives=[]),s}return n[s]?(this.directivesEndMarker=new D.Range(s,s+3),s+3):(i?this.error=new D.YAMLSemanticError(this,"Missing directives-end indicator line"):this.directives.length>0&&(this.contents=this.directives,this.directives=[]),s)}parseContents(e){let{parseNode:n,src:r}=this.context;this.contents||(this.contents=[]);let i=e;for(;r[i-1]==="-";)i-=1;let s=D.Node.endOfWhiteSpace(r,e),o=i===e;for(this.valueRange=new D.Range(s);!D.Node.atDocumentBoundary(r,s,D.Char.DOCUMENT_END);){switch(r[s]){case` -`:if(o){let a=new Ta;s=a.parse({src:r},s),s0&&(this.contents=this.directives,this.directives=[]),s}return n[s]?(this.directivesEndMarker=new D.Range(s,s+3),s+3):(i?this.error=new D.YAMLSemanticError(this,"Missing directives-end indicator line"):this.directives.length>0&&(this.contents=this.directives,this.directives=[]),s)}parseContents(e){let{parseNode:n,src:r}=this.context;this.contents||(this.contents=[]);let i=e;for(;r[i-1]==="-";)i-=1;let s=D.Node.endOfWhiteSpace(r,e),o=i===e;for(this.valueRange=new D.Range(s);!D.Node.atDocumentBoundary(r,s,D.Char.DOCUMENT_END);){switch(r[s]){case` +`:if(o){let a=new Ta;s=a.parse({src:r},s),s{n=r.setOrigRanges(e,n)}),this.directivesEndMarker&&(n=this.directivesEndMarker.setOrigRange(e,n)),this.contents.forEach(r=>{n=r.setOrigRanges(e,n)}),this.documentEndMarker&&(n=this.documentEndMarker.setOrigRange(e,n)),n}toString(){let{contents:e,directives:n,value:r}=this;if(r!=null)return r;let i=n.join("");return e.length>0&&((n.length>0||e[0].type===D.Type.COMMENT)&&(i+=`--- `),i+=e.join("")),i[i.length-1]!==` `&&(i+=` -`),i}},sv=class extends D.Node{parse(e,n){this.context=e;let{src:r}=e,i=D.Node.endOfIdentifier(r,n+1);return this.valueRange=new D.Range(n+1,i),i=D.Node.endOfWhiteSpace(r,i),i=this.parseComment(i),i}},gs={CLIP:"CLIP",KEEP:"KEEP",STRIP:"STRIP"},ov=class extends D.Node{constructor(e,n){super(e,n);this.blockIndent=null,this.chomping=gs.CLIP,this.header=null}get includesTrailingLines(){return this.chomping===gs.KEEP}get strValue(){if(!this.valueRange||!this.context)return null;let{start:e,end:n}=this.valueRange,{indent:r,src:i}=this.context;if(this.valueRange.isEmpty())return"";let s=null,o=i[n-1];for(;o===` +`),i}},ov=class extends D.Node{parse(e,n){this.context=e;let{src:r}=e,i=D.Node.endOfIdentifier(r,n+1);return this.valueRange=new D.Range(n+1,i),i=D.Node.endOfWhiteSpace(r,i),i=this.parseComment(i),i}},gs={CLIP:"CLIP",KEEP:"KEEP",STRIP:"STRIP"},av=class extends D.Node{constructor(e,n){super(e,n);this.blockIndent=null,this.chomping=gs.CLIP,this.header=null}get includesTrailingLines(){return this.chomping===gs.KEEP}get strValue(){if(!this.valueRange||!this.context)return null;let{start:e,end:n}=this.valueRange,{indent:r,src:i}=this.context;if(this.valueRange.isEmpty())return"";let s=null,o=i[n-1];for(;o===` `||o===" "||o===" ";){if(n-=1,n<=e){if(this.chomping===gs.KEEP)break;return""}o===` -`&&(s=n),o=i[n-1]}let a=n+1;s&&(this.chomping===gs.KEEP?(a=s,n=this.valueRange.end):n=s);let l=r+this.blockIndent,u=this.type===D.Type.BLOCK_FOLDED,c=!0,f="",m="",d=!1;for(let p=e;pa&&(a=f);r[u]===` -`?s=u:s=o=D.Node.endOfLine(r,u)}return this.chomping!==gs.KEEP&&(s=r[o]?o+1:o),this.valueRange=new D.Range(e+1,s),s}parse(e,n){this.context=e;let{src:r}=e,i=this.parseBlockHeader(n);return i=D.Node.endOfWhiteSpace(r,i),i=this.parseComment(i),i=this.parseBlockValue(i),i}setOrigRanges(e,n){return n=super.setOrigRanges(e,n),this.header?this.header.setOrigRange(e,n):n}},av=class extends D.Node{constructor(e,n){super(e,n);this.items=null}prevNodeIsJsonLike(e=this.items.length){let n=this.items[e-1];return!!n&&(n.jsonLike||n.type===D.Type.COMMENT&&this.prevNodeIsJsonLike(e-1))}parse(e,n){this.context=e;let{parseNode:r,src:i}=e,{indent:s,lineStart:o}=e,a=i[n];this.items=[{char:a,offset:n}];let l=D.Node.endOfWhiteSpace(i,n+1);for(a=i[l];a&&a!=="]"&&a!=="}";){switch(a){case` +`?s=u:s=o=D.Node.endOfLine(r,u)}return this.chomping!==gs.KEEP&&(s=r[o]?o+1:o),this.valueRange=new D.Range(e+1,s),s}parse(e,n){this.context=e;let{src:r}=e,i=this.parseBlockHeader(n);return i=D.Node.endOfWhiteSpace(r,i),i=this.parseComment(i),i=this.parseBlockValue(i),i}setOrigRanges(e,n){return n=super.setOrigRanges(e,n),this.header?this.header.setOrigRange(e,n):n}},lv=class extends D.Node{constructor(e,n){super(e,n);this.items=null}prevNodeIsJsonLike(e=this.items.length){let n=this.items[e-1];return!!n&&(n.jsonLike||n.type===D.Type.COMMENT&&this.prevNodeIsJsonLike(e-1))}parse(e,n){this.context=e;let{parseNode:r,src:i}=e,{indent:s,lineStart:o}=e,a=i[n];this.items=[{char:a,offset:n}];let l=D.Node.endOfWhiteSpace(i,n+1);for(a=i[l];a&&a!=="]"&&a!=="}";){switch(a){case` `:{o=l+1;let u=D.Node.endOfWhiteSpace(i,o);if(i[u]===` `){let c=new Ta;o=c.parse({src:i},o),this.items.push(c)}if(l=D.Node.endOfIndent(i,o),l<=o+s&&(a=i[l],l{if(r instanceof D.Node)n=r.setOrigRanges(e,n);else if(e.length===0)r.origOffset=r.offset;else{let i=n;for(;ir.offset);)++i;r.origOffset=r.offset+i,n=i}}),n}toString(){let{context:{src:e},items:n,range:r,value:i}=this;if(i!=null)return i;let s=n.filter(l=>l instanceof D.Node),o="",a=r.start;return s.forEach(l=>{let u=e.slice(a,l.range.start);a=l.range.end,o+=u+String(l),o[o.length-1]===` `&&e[a-1]!==` `&&e[a]===` -`&&(a+=1)}),o+=e.slice(a,r.end),D.Node.addStringTerminator(e,r.end,o)}},Bc=class extends D.Node{static endOfQuote(e,n){let r=e[n];for(;r&&r!=='"';)n+=r==="\\"?2:1,r=e[n];return n+1}get strValue(){if(!this.valueRange||!this.context)return null;let e=[],{start:n,end:r}=this.valueRange,{indent:i,src:s}=this.context;s[r-1]!=='"'&&e.push(new D.YAMLSyntaxError(this,'Missing closing "quote'));let o="";for(let a=n+1;au?s.slice(u,a+1):l)}else o+=l}return e.length>0?{errors:e,str:o}:o}parseCharCode(e,n,r){let{src:i}=this.context,s=i.substr(e,n),a=s.length===n&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;return isNaN(a)?(r.push(new D.YAMLSyntaxError(this,`Invalid escape sequence ${i.substr(e-2,n+2)}`)),i.substr(e-2,n+2)):String.fromCodePoint(a)}parse(e,n){this.context=e;let{src:r}=e,i=Bc.endOfQuote(r,n+1);return this.valueRange=new D.Range(n,i),i=D.Node.endOfWhiteSpace(r,i),i=this.parseComment(i),i}},jc=class extends D.Node{static endOfQuote(e,n){let r=e[n];for(;r;)if(r==="'"){if(e[n+1]!=="'")break;r=e[n+=2]}else r=e[n+=1];return n+1}get strValue(){if(!this.valueRange||!this.context)return null;let e=[],{start:n,end:r}=this.valueRange,{indent:i,src:s}=this.context;s[r-1]!=="'"&&e.push(new D.YAMLSyntaxError(this,"Missing closing 'quote"));let o="";for(let a=n+1;au?s.slice(u,a+1):l)}else o+=l}return e.length>0?{errors:e,str:o}:o}parseCharCode(e,n,r){let{src:i}=this.context,s=i.substr(e,n),a=s.length===n&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;return isNaN(a)?(r.push(new D.YAMLSyntaxError(this,`Invalid escape sequence ${i.substr(e-2,n+2)}`)),i.substr(e-2,n+2)):String.fromCodePoint(a)}parse(e,n){this.context=e;let{src:r}=e,i=jc.endOfQuote(r,n+1);return this.valueRange=new D.Range(n,i),i=D.Node.endOfWhiteSpace(r,i),i=this.parseComment(i),i}},Uc=class extends D.Node{static endOfQuote(e,n){let r=e[n];for(;r;)if(r==="'"){if(e[n+1]!=="'")break;r=e[n+=2]}else r=e[n+=1];return n+1}get strValue(){if(!this.valueRange||!this.context)return null;let e=[],{start:n,end:r}=this.valueRange,{indent:i,src:s}=this.context;s[r-1]!=="'"&&e.push(new D.YAMLSyntaxError(this,"Missing closing 'quote"));let o="";for(let a=n+1;au?s.slice(u,a+1):l)}else o+=l}return e.length>0?{errors:e,str:o}:o}parse(e,n){this.context=e;let{src:r}=e,i=jc.endOfQuote(r,n+1);return this.valueRange=new D.Range(n,i),i=D.Node.endOfWhiteSpace(r,i),i=this.parseComment(i),i}};function xO(t,e){switch(t){case D.Type.ALIAS:return new sv(t,e);case D.Type.BLOCK_FOLDED:case D.Type.BLOCK_LITERAL:return new ov(t,e);case D.Type.FLOW_MAP:case D.Type.FLOW_SEQ:return new av(t,e);case D.Type.MAP_KEY:case D.Type.MAP_VALUE:case D.Type.SEQ_ITEM:return new qc(t,e);case D.Type.COMMENT:case D.Type.PLAIN:return new D.PlainValue(t,e);case D.Type.QUOTE_DOUBLE:return new Bc(t,e);case D.Type.QUOTE_SINGLE:return new jc(t,e);default:return null}}var Pa=class{static parseType(e,n,r){switch(e[n]){case"*":return D.Type.ALIAS;case">":return D.Type.BLOCK_FOLDED;case"|":return D.Type.BLOCK_LITERAL;case"{":return D.Type.FLOW_MAP;case"[":return D.Type.FLOW_SEQ;case"?":return!r&&D.Node.atBlank(e,n+1,!0)?D.Type.MAP_KEY:D.Type.PLAIN;case":":return!r&&D.Node.atBlank(e,n+1,!0)?D.Type.MAP_VALUE:D.Type.PLAIN;case"-":return!r&&D.Node.atBlank(e,n+1,!0)?D.Type.SEQ_ITEM:D.Type.PLAIN;case'"':return D.Type.QUOTE_DOUBLE;case"'":return D.Type.QUOTE_SINGLE;default:return D.Type.PLAIN}}constructor(e={},{atLineStart:n,inCollection:r,inFlow:i,indent:s,lineStart:o,parent:a}={}){D._defineProperty(this,"parseNode",(l,u)=>{if(D.Node.atDocumentBoundary(this.src,u))return null;let c=new Pa(this,l),{props:f,type:m,valueStart:d}=c.parseProps(u),p=xO(m,f),_=p.parse(c,d);if(p.range=new D.Range(u,_),_<=u&&(p.error=new Error("Node#parse consumed no characters"),p.error.parseEnd=_,p.error.source=p,p.range.end=u+1),c.nodeStartsCollection(p)){!p.error&&!c.atLineStart&&c.parent.type===D.Type.DOCUMENT&&(p.error=new D.YAMLSyntaxError(p,"Block collection must not have preceding content here (e.g. directives-end indicator)"));let C=new va(p);return _=C.parse(new Pa(c),_),C.range=new D.Range(u,_),C}return p}),this.atLineStart=n??(e.atLineStart||!1),this.inCollection=r??(e.inCollection||!1),this.inFlow=i??(e.inFlow||!1),this.indent=s??e.indent,this.lineStart=o??e.lineStart,this.parent=a??(e.parent||{}),this.root=e.root,this.src=e.src}nodeStartsCollection(e){let{inCollection:n,inFlow:r,src:i}=this;if(n||r)return!1;if(e instanceof qc)return!0;let s=e.range.end;return i[s]===` +`&&(o+=a>u?s.slice(u,a+1):l)}else o+=l}return e.length>0?{errors:e,str:o}:o}parse(e,n){this.context=e;let{src:r}=e,i=Uc.endOfQuote(r,n+1);return this.valueRange=new D.Range(n,i),i=D.Node.endOfWhiteSpace(r,i),i=this.parseComment(i),i}};function OO(t,e){switch(t){case D.Type.ALIAS:return new ov(t,e);case D.Type.BLOCK_FOLDED:case D.Type.BLOCK_LITERAL:return new av(t,e);case D.Type.FLOW_MAP:case D.Type.FLOW_SEQ:return new lv(t,e);case D.Type.MAP_KEY:case D.Type.MAP_VALUE:case D.Type.SEQ_ITEM:return new Bc(t,e);case D.Type.COMMENT:case D.Type.PLAIN:return new D.PlainValue(t,e);case D.Type.QUOTE_DOUBLE:return new jc(t,e);case D.Type.QUOTE_SINGLE:return new Uc(t,e);default:return null}}var Pa=class{static parseType(e,n,r){switch(e[n]){case"*":return D.Type.ALIAS;case">":return D.Type.BLOCK_FOLDED;case"|":return D.Type.BLOCK_LITERAL;case"{":return D.Type.FLOW_MAP;case"[":return D.Type.FLOW_SEQ;case"?":return!r&&D.Node.atBlank(e,n+1,!0)?D.Type.MAP_KEY:D.Type.PLAIN;case":":return!r&&D.Node.atBlank(e,n+1,!0)?D.Type.MAP_VALUE:D.Type.PLAIN;case"-":return!r&&D.Node.atBlank(e,n+1,!0)?D.Type.SEQ_ITEM:D.Type.PLAIN;case'"':return D.Type.QUOTE_DOUBLE;case"'":return D.Type.QUOTE_SINGLE;default:return D.Type.PLAIN}}constructor(e={},{atLineStart:n,inCollection:r,inFlow:i,indent:s,lineStart:o,parent:a}={}){D._defineProperty(this,"parseNode",(l,u)=>{if(D.Node.atDocumentBoundary(this.src,u))return null;let c=new Pa(this,l),{props:f,type:m,valueStart:p}=c.parseProps(u),d=OO(m,f),_=d.parse(c,p);if(d.range=new D.Range(u,_),_<=u&&(d.error=new Error("Node#parse consumed no characters"),d.error.parseEnd=_,d.error.source=d,d.range.end=u+1),c.nodeStartsCollection(d)){!d.error&&!c.atLineStart&&c.parent.type===D.Type.DOCUMENT&&(d.error=new D.YAMLSyntaxError(d,"Block collection must not have preceding content here (e.g. directives-end indicator)"));let C=new va(d);return _=C.parse(new Pa(c),_),C.range=new D.Range(u,_),C}return d}),this.atLineStart=n??(e.atLineStart||!1),this.inCollection=r??(e.inCollection||!1),this.inFlow=i??(e.inFlow||!1),this.indent=s??e.indent,this.lineStart=o??e.lineStart,this.parent=a??(e.parent||{}),this.root=e.root,this.src=e.src}nodeStartsCollection(e){let{inCollection:n,inFlow:r,src:i}=this;if(n||r)return!1;if(e instanceof Bc)return!0;let s=e.range.end;return i[s]===` `||i[s-1]===` `?!1:(s=D.Node.endOfWhiteSpace(i,s),i[s]===":")}parseProps(e){let{inFlow:n,parent:r,src:i}=this,s=[],o=!1;e=this.atLineStart?D.Node.endOfIndent(i,e):D.Node.endOfWhiteSpace(i,e);let a=i[e];for(;a===D.Char.ANCHOR||a===D.Char.COMMENT||a===D.Char.TAG||a===` `;){if(a===` `){let u=e,c;do c=u+1,u=D.Node.endOfIndent(i,c);while(i[u]===` -`);let f=u-(c+this.indent),m=r.type===D.Type.SEQ_ITEM&&r.context.atLineStart;if(i[u]!=="#"&&!D.Node.nextNodeIsIndented(i[u],f,!m))break;this.atLineStart=!0,this.lineStart=c,o=!1,e=u}else if(a===D.Char.COMMENT){let u=D.Node.endOfLine(i,e+1);s.push(new D.Range(e,u)),e=u}else{let u=D.Node.endOfIdentifier(i,e+1);a===D.Char.TAG&&i[u]===","&&/^[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+,\d\d\d\d(-\d\d){0,2}\/\S/.test(i.slice(e+1,u+13))&&(u=D.Node.endOfIdentifier(i,u+5)),s.push(new D.Range(e,u)),o=!0,e=D.Node.endOfWhiteSpace(i,u)}a=i[e]}o&&a===":"&&D.Node.atBlank(i,e+1,!0)&&(e-=1);let l=Pa.parseType(i,e,n);return{props:s,type:l,valueStart:e}}};function EO(t){let e=[];t.indexOf("\r")!==-1&&(t=t.replace(/\r\n?/g,(i,s)=>(i.length>1&&e.push(s),` -`)));let n=[],r=0;do{let i=new Rl,s=new Pa({src:t});r=i.parse(s,r),n.push(i)}while(r{if(e.length===0)return!1;for(let s=1;sn.join(`... -`),n}lv.parse=EO});var Sa=K(_t=>{"use strict";var j=hs();function wO(t,e,n){return n?`#${n.replace(/[\s\S]^/gm,`$&${e}#`)} +`);let f=u-(c+this.indent),m=r.type===D.Type.SEQ_ITEM&&r.context.atLineStart;if(i[u]!=="#"&&!D.Node.nextNodeIsIndented(i[u],f,!m))break;this.atLineStart=!0,this.lineStart=c,o=!1,e=u}else if(a===D.Char.COMMENT){let u=D.Node.endOfLine(i,e+1);s.push(new D.Range(e,u)),e=u}else{let u=D.Node.endOfIdentifier(i,e+1);a===D.Char.TAG&&i[u]===","&&/^[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+,\d\d\d\d(-\d\d){0,2}\/\S/.test(i.slice(e+1,u+13))&&(u=D.Node.endOfIdentifier(i,u+5)),s.push(new D.Range(e,u)),o=!0,e=D.Node.endOfWhiteSpace(i,u)}a=i[e]}o&&a===":"&&D.Node.atBlank(i,e+1,!0)&&(e-=1);let l=Pa.parseType(i,e,n);return{props:s,type:l,valueStart:e}}};function LO(t){let e=[];t.indexOf("\r")!==-1&&(t=t.replace(/\r\n?/g,(i,s)=>(i.length>1&&e.push(s),` +`)));let n=[],r=0;do{let i=new Al,s=new Pa({src:t});r=i.parse(s,r),n.push(i)}while(r{if(e.length===0)return!1;for(let s=1;sn.join(`... +`),n}uv.parse=LO});var Sa=K(_t=>{"use strict";var j=hs();function DO(t,e,n){return n?`#${n.replace(/[\s\S]^/gm,`$&${e}#`)} ${e}${t}`:t}function Ia(t,e,n){return n?n.indexOf(` `)===-1?`${t} #${n}`:`${t} -`+n.replace(/^/gm,`${e||""}#`):t}var hr=class{};function _s(t,e,n){if(Array.isArray(t))return t.map((r,i)=>_s(r,String(i),n));if(t&&typeof t.toJSON=="function"){let r=n&&n.anchors&&n.anchors.get(t);r&&(n.onCreate=s=>{r.res=s,delete n.onCreate});let i=t.toJSON(e,n);return r&&n.onCreate&&n.onCreate(i),i}return(!n||!n.keep)&&typeof t=="bigint"?Number(t):t}var Sn=class extends hr{constructor(e){super();this.value=e}toJSON(e,n){return n&&n.keep?this.value:_s(this.value,e,n)}toString(){return String(this.value)}};function cv(t,e,n){let r=n;for(let i=e.length-1;i>=0;--i){let s=e[i];if(Number.isInteger(s)&&s>=0){let o=[];o[s]=r,r=o}else{let o={};Object.defineProperty(o,s,{value:r,writable:!0,enumerable:!0,configurable:!0}),r=o}}return t.createNode(r,!1)}var fv=t=>t==null||typeof t=="object"&&t[Symbol.iterator]().next().done,Gt=class extends hr{constructor(e){super();j._defineProperty(this,"items",[]),this.schema=e}addIn(e,n){if(fv(e))this.add(n);else{let[r,...i]=e,s=this.get(r,!0);if(s instanceof Gt)s.addIn(i,n);else if(s===void 0&&this.schema)this.set(r,cv(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn([e,...n]){if(n.length===0)return this.delete(e);let r=this.get(e,!0);if(r instanceof Gt)return r.deleteIn(n);throw new Error(`Expected YAML collection at ${e}. Remaining path: ${n}`)}getIn([e,...n],r){let i=this.get(e,!0);return n.length===0?!r&&i instanceof Sn?i.value:i:i instanceof Gt?i.getIn(n,r):void 0}hasAllNullValues(){return this.items.every(e=>{if(!e||e.type!=="PAIR")return!1;let n=e.value;return n==null||n instanceof Sn&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn([e,...n]){if(n.length===0)return this.has(e);let r=this.get(e,!0);return r instanceof Gt?r.hasIn(n):!1}setIn([e,...n],r){if(n.length===0)this.set(e,r);else{let i=this.get(e,!0);if(i instanceof Gt)i.setIn(n,r);else if(i===void 0&&this.schema)this.set(e,cv(this.schema,n,r));else throw new Error(`Expected YAML collection at ${e}. Remaining path: ${n}`)}}toJSON(){return null}toString(e,{blockItem:n,flowChars:r,isMap:i,itemIndent:s},o,a){let{indent:l,indentStep:u,stringify:c}=e,f=this.type===j.Type.FLOW_MAP||this.type===j.Type.FLOW_SEQ||e.inFlow;f&&(s+=u);let m=i&&this.hasAllNullValues();e=Object.assign({},e,{allNullValues:m,indent:s,inFlow:f,type:null});let d=!1,p=!1,_=this.items.reduce((h,b,g)=>{let N;b&&(!d&&b.spaceBefore&&h.push({type:"comment",str:""}),b.commentBefore&&b.commentBefore.match(/^.*$/gm).forEach(V=>{h.push({type:"comment",str:`#${V}`})}),b.comment&&(N=b.comment),f&&(!d&&b.spaceBefore||b.commentBefore||b.comment||b.key&&(b.key.commentBefore||b.key.comment)||b.value&&(b.value.commentBefore||b.value.comment))&&(p=!0)),d=!1;let S=c(b,e,()=>N=null,()=>d=!0);return f&&!p&&S.includes(` -`)&&(p=!0),f&&gN.str);if(p||g.reduce((N,S)=>N+S.length+2,2)>Gt.maxFlowStringSingleLineLength){C=h;for(let N of g)C+=N?` +`+n.replace(/^/gm,`${e||""}#`):t}var gr=class{};function _s(t,e,n){if(Array.isArray(t))return t.map((r,i)=>_s(r,String(i),n));if(t&&typeof t.toJSON=="function"){let r=n&&n.anchors&&n.anchors.get(t);r&&(n.onCreate=s=>{r.res=s,delete n.onCreate});let i=t.toJSON(e,n);return r&&n.onCreate&&n.onCreate(i),i}return(!n||!n.keep)&&typeof t=="bigint"?Number(t):t}var Sn=class extends gr{constructor(e){super();this.value=e}toJSON(e,n){return n&&n.keep?this.value:_s(this.value,e,n)}toString(){return String(this.value)}};function fv(t,e,n){let r=n;for(let i=e.length-1;i>=0;--i){let s=e[i];if(Number.isInteger(s)&&s>=0){let o=[];o[s]=r,r=o}else{let o={};Object.defineProperty(o,s,{value:r,writable:!0,enumerable:!0,configurable:!0}),r=o}}return t.createNode(r,!1)}var pv=t=>t==null||typeof t=="object"&&t[Symbol.iterator]().next().done,Gt=class extends gr{constructor(e){super();j._defineProperty(this,"items",[]),this.schema=e}addIn(e,n){if(pv(e))this.add(n);else{let[r,...i]=e,s=this.get(r,!0);if(s instanceof Gt)s.addIn(i,n);else if(s===void 0&&this.schema)this.set(r,fv(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn([e,...n]){if(n.length===0)return this.delete(e);let r=this.get(e,!0);if(r instanceof Gt)return r.deleteIn(n);throw new Error(`Expected YAML collection at ${e}. Remaining path: ${n}`)}getIn([e,...n],r){let i=this.get(e,!0);return n.length===0?!r&&i instanceof Sn?i.value:i:i instanceof Gt?i.getIn(n,r):void 0}hasAllNullValues(){return this.items.every(e=>{if(!e||e.type!=="PAIR")return!1;let n=e.value;return n==null||n instanceof Sn&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn([e,...n]){if(n.length===0)return this.has(e);let r=this.get(e,!0);return r instanceof Gt?r.hasIn(n):!1}setIn([e,...n],r){if(n.length===0)this.set(e,r);else{let i=this.get(e,!0);if(i instanceof Gt)i.setIn(n,r);else if(i===void 0&&this.schema)this.set(e,fv(this.schema,n,r));else throw new Error(`Expected YAML collection at ${e}. Remaining path: ${n}`)}}toJSON(){return null}toString(e,{blockItem:n,flowChars:r,isMap:i,itemIndent:s},o,a){let{indent:l,indentStep:u,stringify:c}=e,f=this.type===j.Type.FLOW_MAP||this.type===j.Type.FLOW_SEQ||e.inFlow;f&&(s+=u);let m=i&&this.hasAllNullValues();e=Object.assign({},e,{allNullValues:m,indent:s,inFlow:f,type:null});let p=!1,d=!1,_=this.items.reduce((h,b,g)=>{let N;b&&(!p&&b.spaceBefore&&h.push({type:"comment",str:""}),b.commentBefore&&b.commentBefore.match(/^.*$/gm).forEach(V=>{h.push({type:"comment",str:`#${V}`})}),b.comment&&(N=b.comment),f&&(!p&&b.spaceBefore||b.commentBefore||b.comment||b.key&&(b.key.commentBefore||b.key.comment)||b.value&&(b.value.commentBefore||b.value.comment))&&(d=!0)),p=!1;let S=c(b,e,()=>N=null,()=>p=!0);return f&&!d&&S.includes(` +`)&&(d=!0),f&&gN.str);if(d||g.reduce((N,S)=>N+S.length+2,2)>Gt.maxFlowStringSingleLineLength){C=h;for(let N of g)C+=N?` ${u}${l}${N}`:` `;C+=` ${l}${b}`}else C=`${h} ${g.join(" ")} ${b}`}else{let h=_.map(n);C=h.shift();for(let b of h)C+=b?` ${l}${b}`:` `}return this.comment?(C+=` -`+this.comment.replace(/^/gm,`${l}#`),o&&o()):d&&a&&a(),C}};j._defineProperty(Gt,"maxFlowStringSingleLineLength",60);function Uc(t){let e=t instanceof Sn?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),Number.isInteger(e)&&e>=0?e:null}var eo=class extends Gt{add(e){this.items.push(e)}delete(e){let n=Uc(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){let r=Uc(e);if(typeof r!="number")return;let i=this.items[r];return!n&&i instanceof Sn?i.value:i}has(e){let n=Uc(e);return typeof n=="number"&&ni.type==="comment"?i.str:`- ${i.str}`,flowChars:{start:"[",end:"]"},isMap:!1,itemIndent:(e.indent||"")+" "},n,r):JSON.stringify(this)}},OO=(t,e,n)=>e===null?"":typeof e!="object"?String(e):t instanceof hr&&n&&n.doc?t.toString({anchors:Object.create(null),doc:n.doc,indent:"",indentStep:n.indentStep,inFlow:!0,inStringifyKey:!0,stringify:n.stringify}):JSON.stringify(e),rt=class extends hr{constructor(e,n=null){super();this.key=e,this.value=n,this.type=rt.Type.PAIR}get commentBefore(){return this.key instanceof hr?this.key.commentBefore:void 0}set commentBefore(e){if(this.key==null&&(this.key=new Sn(null)),this.key instanceof hr)this.key.commentBefore=e;else{let n="Pair.commentBefore is an alias for Pair.key.commentBefore. To set it, the key must be a Node.";throw new Error(n)}}addToJSMap(e,n){let r=_s(this.key,"",e);if(n instanceof Map){let i=_s(this.value,r,e);n.set(r,i)}else if(n instanceof Set)n.add(r);else{let i=OO(this.key,r,e),s=_s(this.value,i,e);i in n?Object.defineProperty(n,i,{value:s,writable:!0,enumerable:!0,configurable:!0}):n[i]=s}return n}toJSON(e,n){let r=n&&n.mapAsMap?new Map:{};return this.addToJSMap(n,r)}toString(e,n,r){if(!e||!e.doc)return JSON.stringify(this);let{indent:i,indentSeq:s,simpleKeys:o}=e.doc.options,{key:a,value:l}=this,u=a instanceof hr&&a.comment;if(o){if(u)throw new Error("With simple keys, key nodes cannot have comments");if(a instanceof Gt){let S="With simple keys, collection cannot be used as a key value";throw new Error(S)}}let c=!o&&(!a||u||(a instanceof hr?a instanceof Gt||a.type===j.Type.BLOCK_FOLDED||a.type===j.Type.BLOCK_LITERAL:typeof a=="object")),{doc:f,indent:m,indentStep:d,stringify:p}=e;e=Object.assign({},e,{implicitKey:!c,indent:m+d});let _=!1,C=p(a,e,()=>u=null,()=>_=!0);if(C=Ia(C,e.indent,u),!c&&C.length>1024){if(o)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");c=!0}if(e.allNullValues&&!o)return this.comment?(C=Ia(C,e.indent,this.comment),n&&n()):_&&!u&&r&&r(),e.inFlow&&!c?C:`? ${C}`;C=c?`? ${C} -${m}:`:`${C}:`,this.comment&&(C=Ia(C,e.indent,this.comment),n&&n());let h="",b=null;l instanceof hr?(l.spaceBefore&&(h=` +`+this.comment.replace(/^/gm,`${l}#`),o&&o()):p&&a&&a(),C}};j._defineProperty(Gt,"maxFlowStringSingleLineLength",60);function Gc(t){let e=t instanceof Sn?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),Number.isInteger(e)&&e>=0?e:null}var eo=class extends Gt{add(e){this.items.push(e)}delete(e){let n=Gc(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){let r=Gc(e);if(typeof r!="number")return;let i=this.items[r];return!n&&i instanceof Sn?i.value:i}has(e){let n=Gc(e);return typeof n=="number"&&ni.type==="comment"?i.str:`- ${i.str}`,flowChars:{start:"[",end:"]"},isMap:!1,itemIndent:(e.indent||"")+" "},n,r):JSON.stringify(this)}},kO=(t,e,n)=>e===null?"":typeof e!="object"?String(e):t instanceof gr&&n&&n.doc?t.toString({anchors:Object.create(null),doc:n.doc,indent:"",indentStep:n.indentStep,inFlow:!0,inStringifyKey:!0,stringify:n.stringify}):JSON.stringify(e),rt=class extends gr{constructor(e,n=null){super();this.key=e,this.value=n,this.type=rt.Type.PAIR}get commentBefore(){return this.key instanceof gr?this.key.commentBefore:void 0}set commentBefore(e){if(this.key==null&&(this.key=new Sn(null)),this.key instanceof gr)this.key.commentBefore=e;else{let n="Pair.commentBefore is an alias for Pair.key.commentBefore. To set it, the key must be a Node.";throw new Error(n)}}addToJSMap(e,n){let r=_s(this.key,"",e);if(n instanceof Map){let i=_s(this.value,r,e);n.set(r,i)}else if(n instanceof Set)n.add(r);else{let i=kO(this.key,r,e),s=_s(this.value,i,e);i in n?Object.defineProperty(n,i,{value:s,writable:!0,enumerable:!0,configurable:!0}):n[i]=s}return n}toJSON(e,n){let r=n&&n.mapAsMap?new Map:{};return this.addToJSMap(n,r)}toString(e,n,r){if(!e||!e.doc)return JSON.stringify(this);let{indent:i,indentSeq:s,simpleKeys:o}=e.doc.options,{key:a,value:l}=this,u=a instanceof gr&&a.comment;if(o){if(u)throw new Error("With simple keys, key nodes cannot have comments");if(a instanceof Gt){let S="With simple keys, collection cannot be used as a key value";throw new Error(S)}}let c=!o&&(!a||u||(a instanceof gr?a instanceof Gt||a.type===j.Type.BLOCK_FOLDED||a.type===j.Type.BLOCK_LITERAL:typeof a=="object")),{doc:f,indent:m,indentStep:p,stringify:d}=e;e=Object.assign({},e,{implicitKey:!c,indent:m+p});let _=!1,C=d(a,e,()=>u=null,()=>_=!0);if(C=Ia(C,e.indent,u),!c&&C.length>1024){if(o)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");c=!0}if(e.allNullValues&&!o)return this.comment?(C=Ia(C,e.indent,this.comment),n&&n()):_&&!u&&r&&r(),e.inFlow&&!c?C:`? ${C}`;C=c?`? ${C} +${m}:`:`${C}:`,this.comment&&(C=Ia(C,e.indent,this.comment),n&&n());let h="",b=null;l instanceof gr?(l.spaceBefore&&(h=` `),l.commentBefore&&(h+=` -${l.commentBefore.replace(/^/gm,`${e.indent}#`)}`),b=l.comment):l&&typeof l=="object"&&(l=f.schema.createNode(l,!0)),e.implicitKey=!1,!c&&!this.comment&&l instanceof Sn&&(e.indentAtStart=C.length+1),_=!1,!s&&i>=2&&!e.inFlow&&!c&&l instanceof eo&&l.type!==j.Type.FLOW_SEQ&&!l.tag&&!f.anchors.getName(l)&&(e.indent=e.indent.substr(2));let g=p(l,e,()=>b=null,()=>_=!0),N=" ";return h||this.comment?N=`${h} +${l.commentBefore.replace(/^/gm,`${e.indent}#`)}`),b=l.comment):l&&typeof l=="object"&&(l=f.schema.createNode(l,!0)),e.implicitKey=!1,!c&&!this.comment&&l instanceof Sn&&(e.indentAtStart=C.length+1),_=!1,!s&&i>=2&&!e.inFlow&&!c&&l instanceof eo&&l.type!==j.Type.FLOW_SEQ&&!l.tag&&!f.anchors.getName(l)&&(e.indent=e.indent.substr(2));let g=d(l,e,()=>b=null,()=>_=!0),N=" ";return h||this.comment?N=`${h} ${e.indent}`:!c&&l instanceof Gt?(!(g[0]==="["||g[0]==="{")||g.includes(` `))&&(N=` ${e.indent}`):g[0]===` -`&&(N=""),_&&!b&&r&&r(),Ia(C+N+g,e.indent,b)}};j._defineProperty(rt,"Type",{PAIR:"PAIR",MERGE_PAIR:"MERGE_PAIR"});var Gc=(t,e)=>{if(t instanceof ys){let n=e.get(t.source);return n.count*n.aliasCount}else if(t instanceof Gt){let n=0;for(let r of t.items){let i=Gc(r,e);i>n&&(n=i)}return n}else if(t instanceof rt){let n=Gc(t.key,e),r=Gc(t.value,e);return Math.max(n,r)}return 1},ys=class extends hr{static stringify({range:e,source:n},{anchors:r,doc:i,implicitKey:s,inStringifyKey:o}){let a=Object.keys(r).find(u=>r[u]===n);if(!a&&o&&(a=i.anchors.getName(n)||i.anchors.newName()),a)return`*${a}${s?" ":""}`;let l=i.anchors.getName(n)?"Alias node must be after source node":"Source node not found for alias node";throw new Error(`${l} [${e}]`)}constructor(e){super();this.source=e,this.type=j.Type.ALIAS}set tag(e){throw new Error("Alias nodes cannot have tags")}toJSON(e,n){if(!n)return _s(this.source,e,n);let{anchors:r,maxAliasCount:i}=n,s=r.get(this.source);if(!s||s.res===void 0){let o="This should not happen: Alias anchor was not resolved?";throw this.cstNode?new j.YAMLReferenceError(this.cstNode,o):new ReferenceError(o)}if(i>=0&&(s.count+=1,s.aliasCount===0&&(s.aliasCount=Gc(this.source,r)),s.count*s.aliasCount>i)){let o="Excessive alias count indicates a resource exhaustion attack";throw this.cstNode?new j.YAMLReferenceError(this.cstNode,o):new ReferenceError(o)}return s.res}toString(e){return ys.stringify(this,e)}};j._defineProperty(ys,"default",!0);function Al(t,e){let n=e instanceof Sn?e.value:e;for(let r of t)if(r instanceof rt&&(r.key===e||r.key===n||r.key&&r.key.value===n))return r}var Wc=class extends Gt{add(e,n){e?e instanceof rt||(e=new rt(e.key||e,e.value)):e=new rt(e);let r=Al(this.items,e.key),i=this.schema&&this.schema.sortMapEntries;if(r)if(n)r.value=e.value;else throw new Error(`Key ${e.key} already set`);else if(i){let s=this.items.findIndex(o=>i(e,o)<0);s===-1?this.items.push(e):this.items.splice(s,0,e)}else this.items.push(e)}delete(e){let n=Al(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){let r=Al(this.items,e),i=r&&r.value;return!n&&i instanceof Sn?i.value:i}has(e){return!!Al(this.items,e)}set(e,n){this.add(new rt(e,n),!0)}toJSON(e,n,r){let i=r?new r:n&&n.mapAsMap?new Map:{};n&&n.onCreate&&n.onCreate(i);for(let s of this.items)s.addToJSMap(n,i);return i}toString(e,n,r){if(!e)return JSON.stringify(this);for(let i of this.items)if(!(i instanceof rt))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return super.toString(e,{blockItem:i=>i.str,flowChars:{start:"{",end:"}"},isMap:!0,itemIndent:e.indent||""},n,r)}},pv="<<",mm=class extends rt{constructor(e){if(e instanceof rt){let n=e.value;n instanceof eo||(n=new eo,n.items.push(e.value),n.range=e.value.range);super(e.key,n);this.range=e.range}else super(new Sn(pv),new eo);this.type=rt.Type.MERGE_PAIR}addToJSMap(e,n){for(let{source:r}of this.value.items){if(!(r instanceof Wc))throw new Error("Merge sources must be maps");let i=r.toJSON(null,e,Map);for(let[s,o]of i)n instanceof Map?n.has(s)||n.set(s,o):n instanceof Set?n.add(s):Object.prototype.hasOwnProperty.call(n,s)||Object.defineProperty(n,s,{value:o,writable:!0,enumerable:!0,configurable:!0})}return n}toString(e,n){let r=this.value;if(r.items.length>1)return super.toString(e,n);this.value=r.items[0];let i=super.toString(e,n);return this.value=r,i}},LO={defaultType:j.Type.BLOCK_LITERAL,lineWidth:76},DO={trueStr:"true",falseStr:"false"},kO={asBigInt:!1},MO={nullStr:"null"},to={defaultType:j.Type.PLAIN,doubleQuoted:{jsonEncoding:!1,minMultiLineLength:40},fold:{lineWidth:80,minContentWidth:20}};function hm(t,e,n){for(let{format:r,test:i,resolve:s}of e)if(i){let o=t.match(i);if(o){let a=s.apply(null,o);return a instanceof Sn||(a=new Sn(a)),r&&(a.format=r),a}}return n&&(t=n(t)),new Sn(t)}var dv="flow",gm="block",Hc="quoted",mv=(t,e)=>{let n=t[e+1];for(;n===" "||n===" ";){do n=t[e+=1];while(n&&n!==` -`);n=t[e+1]}return e};function Yc(t,e,n,{indentAtStart:r,lineWidth:i=80,minContentWidth:s=20,onFold:o,onOverflow:a}){if(!i||i<0)return t;let l=Math.max(1+s,1+i-e.length);if(t.length<=l)return t;let u=[],c={},f=i-e.length;typeof r=="number"&&(r>i-Math.max(2,s)?u.push(0):f=i-r);let m,d,p=!1,_=-1,C=-1,h=-1;n===gm&&(_=mv(t,_),_!==-1&&(f=_+l));for(let g;g=t[_+=1];){if(n===Hc&&g==="\\"){switch(C=_,t[_+1]){case"x":_+=3;break;case"u":_+=5;break;case"U":_+=9;break;default:_+=1}h=_}if(g===` -`)n===gm&&(_=mv(t,_)),f=_+l,m=void 0;else{if(g===" "&&d&&d!==" "&&d!==` -`&&d!==" "){let N=t[_+1];N&&N!==" "&&N!==` -`&&N!==" "&&(m=_)}if(_>=f)if(m)u.push(m),f=m+l,m=void 0;else if(n===Hc){for(;d===" "||d===" ";)d=g,g=t[_+=1],p=!0;let N=_>h+1?_-2:C-1;if(c[N])return t;u.push(N),c[N]=!0,f=N+l,m=void 0}else p=!0}d=g}if(p&&a&&a(),u.length===0)return t;o&&o();let b=t.slice(0,u[0]);for(let g=0;gt?Object.assign({indentAtStart:t},to.fold):to.fold,Kc=t=>/^(%|---|\.\.\.)/m.test(t);function FO(t,e,n){if(!e||e<0)return!1;let r=e-n,i=t.length;if(i<=r)return!1;for(let s=0,o=0;sr)return!0;if(o=s+1,i-o<=r)return!1}return!0}function no(t,e){let{implicitKey:n}=e,{jsonEncoding:r,minMultiLineLength:i}=to.doubleQuoted,s=JSON.stringify(t);if(r)return s;let o=e.indent||(Kc(t)?" ":""),a="",l=0;for(let u=0,c=s[u];c;c=s[++u])if(c===" "&&s[u+1]==="\\"&&s[u+2]==="n"&&(a+=s.slice(l,u)+"\\ ",u+=1,l=u,c="\\"),c==="\\")switch(s[u+1]){case"u":{a+=s.slice(l,u);let f=s.substr(u+2,4);switch(f){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:f.substr(0,2)==="00"?a+="\\x"+f.substr(2):a+=s.substr(u,6)}u+=5,l=u+1}break;case"n":if(n||s[u+2]==='"'||s.length{if(t instanceof ys){let n=e.get(t.source);return n.count*n.aliasCount}else if(t instanceof Gt){let n=0;for(let r of t.items){let i=Wc(r,e);i>n&&(n=i)}return n}else if(t instanceof rt){let n=Wc(t.key,e),r=Wc(t.value,e);return Math.max(n,r)}return 1},ys=class extends gr{static stringify({range:e,source:n},{anchors:r,doc:i,implicitKey:s,inStringifyKey:o}){let a=Object.keys(r).find(u=>r[u]===n);if(!a&&o&&(a=i.anchors.getName(n)||i.anchors.newName()),a)return`*${a}${s?" ":""}`;let l=i.anchors.getName(n)?"Alias node must be after source node":"Source node not found for alias node";throw new Error(`${l} [${e}]`)}constructor(e){super();this.source=e,this.type=j.Type.ALIAS}set tag(e){throw new Error("Alias nodes cannot have tags")}toJSON(e,n){if(!n)return _s(this.source,e,n);let{anchors:r,maxAliasCount:i}=n,s=r.get(this.source);if(!s||s.res===void 0){let o="This should not happen: Alias anchor was not resolved?";throw this.cstNode?new j.YAMLReferenceError(this.cstNode,o):new ReferenceError(o)}if(i>=0&&(s.count+=1,s.aliasCount===0&&(s.aliasCount=Wc(this.source,r)),s.count*s.aliasCount>i)){let o="Excessive alias count indicates a resource exhaustion attack";throw this.cstNode?new j.YAMLReferenceError(this.cstNode,o):new ReferenceError(o)}return s.res}toString(e){return ys.stringify(this,e)}};j._defineProperty(ys,"default",!0);function xl(t,e){let n=e instanceof Sn?e.value:e;for(let r of t)if(r instanceof rt&&(r.key===e||r.key===n||r.key&&r.key.value===n))return r}var Hc=class extends Gt{add(e,n){e?e instanceof rt||(e=new rt(e.key||e,e.value)):e=new rt(e);let r=xl(this.items,e.key),i=this.schema&&this.schema.sortMapEntries;if(r)if(n)r.value=e.value;else throw new Error(`Key ${e.key} already set`);else if(i){let s=this.items.findIndex(o=>i(e,o)<0);s===-1?this.items.push(e):this.items.splice(s,0,e)}else this.items.push(e)}delete(e){let n=xl(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){let r=xl(this.items,e),i=r&&r.value;return!n&&i instanceof Sn?i.value:i}has(e){return!!xl(this.items,e)}set(e,n){this.add(new rt(e,n),!0)}toJSON(e,n,r){let i=r?new r:n&&n.mapAsMap?new Map:{};n&&n.onCreate&&n.onCreate(i);for(let s of this.items)s.addToJSMap(n,i);return i}toString(e,n,r){if(!e)return JSON.stringify(this);for(let i of this.items)if(!(i instanceof rt))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return super.toString(e,{blockItem:i=>i.str,flowChars:{start:"{",end:"}"},isMap:!0,itemIndent:e.indent||""},n,r)}},dv="<<",mm=class extends rt{constructor(e){if(e instanceof rt){let n=e.value;n instanceof eo||(n=new eo,n.items.push(e.value),n.range=e.value.range);super(e.key,n);this.range=e.range}else super(new Sn(dv),new eo);this.type=rt.Type.MERGE_PAIR}addToJSMap(e,n){for(let{source:r}of this.value.items){if(!(r instanceof Hc))throw new Error("Merge sources must be maps");let i=r.toJSON(null,e,Map);for(let[s,o]of i)n instanceof Map?n.has(s)||n.set(s,o):n instanceof Set?n.add(s):Object.prototype.hasOwnProperty.call(n,s)||Object.defineProperty(n,s,{value:o,writable:!0,enumerable:!0,configurable:!0})}return n}toString(e,n){let r=this.value;if(r.items.length>1)return super.toString(e,n);this.value=r.items[0];let i=super.toString(e,n);return this.value=r,i}},MO={defaultType:j.Type.BLOCK_LITERAL,lineWidth:76},FO={trueStr:"true",falseStr:"false"},VO={asBigInt:!1},qO={nullStr:"null"},to={defaultType:j.Type.PLAIN,doubleQuoted:{jsonEncoding:!1,minMultiLineLength:40},fold:{lineWidth:80,minContentWidth:20}};function hm(t,e,n){for(let{format:r,test:i,resolve:s}of e)if(i){let o=t.match(i);if(o){let a=s.apply(null,o);return a instanceof Sn||(a=new Sn(a)),r&&(a.format=r),a}}return n&&(t=n(t)),new Sn(t)}var mv="flow",gm="block",Yc="quoted",hv=(t,e)=>{let n=t[e+1];for(;n===" "||n===" ";){do n=t[e+=1];while(n&&n!==` +`);n=t[e+1]}return e};function Kc(t,e,n,{indentAtStart:r,lineWidth:i=80,minContentWidth:s=20,onFold:o,onOverflow:a}){if(!i||i<0)return t;let l=Math.max(1+s,1+i-e.length);if(t.length<=l)return t;let u=[],c={},f=i-e.length;typeof r=="number"&&(r>i-Math.max(2,s)?u.push(0):f=i-r);let m,p,d=!1,_=-1,C=-1,h=-1;n===gm&&(_=hv(t,_),_!==-1&&(f=_+l));for(let g;g=t[_+=1];){if(n===Yc&&g==="\\"){switch(C=_,t[_+1]){case"x":_+=3;break;case"u":_+=5;break;case"U":_+=9;break;default:_+=1}h=_}if(g===` +`)n===gm&&(_=hv(t,_)),f=_+l,m=void 0;else{if(g===" "&&p&&p!==" "&&p!==` +`&&p!==" "){let N=t[_+1];N&&N!==" "&&N!==` +`&&N!==" "&&(m=_)}if(_>=f)if(m)u.push(m),f=m+l,m=void 0;else if(n===Yc){for(;p===" "||p===" ";)p=g,g=t[_+=1],d=!0;let N=_>h+1?_-2:C-1;if(c[N])return t;u.push(N),c[N]=!0,f=N+l,m=void 0}else d=!0}p=g}if(d&&a&&a(),u.length===0)return t;o&&o();let b=t.slice(0,u[0]);for(let g=0;gt?Object.assign({indentAtStart:t},to.fold):to.fold,$c=t=>/^(%|---|\.\.\.)/m.test(t);function BO(t,e,n){if(!e||e<0)return!1;let r=e-n,i=t.length;if(i<=r)return!1;for(let s=0,o=0;sr)return!0;if(o=s+1,i-o<=r)return!1}return!0}function no(t,e){let{implicitKey:n}=e,{jsonEncoding:r,minMultiLineLength:i}=to.doubleQuoted,s=JSON.stringify(t);if(r)return s;let o=e.indent||($c(t)?" ":""),a="",l=0;for(let u=0,c=s[u];c;c=s[++u])if(c===" "&&s[u+1]==="\\"&&s[u+2]==="n"&&(a+=s.slice(l,u)+"\\ ",u+=1,l=u,c="\\"),c==="\\")switch(s[u+1]){case"u":{a+=s.slice(l,u);let f=s.substr(u+2,4);switch(f){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:f.substr(0,2)==="00"?a+="\\x"+f.substr(2):a+=s.substr(u,6)}u+=5,l=u+1}break;case"n":if(n||s[u+2]==='"'||s.length";if(!n)return u+` -`;let c="",f="";if(n=n.replace(/[\n\t ]*$/,d=>{let p=d.indexOf(` -`);return p===-1?u+="-":(n===d||p!==d.length-1)&&(u+="+",s&&s()),f=d.replace(/\n$/,""),""}).replace(/^[\n ]*/,d=>{d.indexOf(" ")!==-1&&(u+=a);let p=d.match(/ +$/);return p?(c=d.slice(0,-p[0].length),p[0]):(c=d,"")}),f&&(f=f.replace(/\n+(?!\n|$)/g,`$&${o}`)),c&&(c=c.replace(/\n+/g,`$&${o}`)),t&&(u+=" #"+t.replace(/ ?[\r\n]+/g," "),i&&i()),!n)return`${u}${a} +`,u+=2;a+=o,s[u+2]===" "&&(a+="\\"),u+=1,l=u+1}break;default:u+=1}return a=l?a+s.slice(l):s,n?a:Kc(a,o,Yc,_m(e))}function gv(t,e){if(e.implicitKey){if(/\n/.test(t))return no(t,e)}else if(/[ \t]\n|\n[ \t]/.test(t))return no(t,e);let n=e.indent||($c(t)?" ":""),r="'"+t.replace(/'/g,"''").replace(/\n+/g,`$& +${n}`)+"'";return e.implicitKey?r:Kc(r,n,mv,_m(e))}function zc({comment:t,type:e,value:n},r,i,s){if(/\n[\t ]+$/.test(n)||/^\s*$/.test(n))return no(n,r);let o=r.indent||(r.forceBlockIndent||$c(n)?" ":""),a=o?"2":"1",l=e===j.Type.BLOCK_FOLDED?!1:e===j.Type.BLOCK_LITERAL?!0:!BO(n,to.fold.lineWidth,o.length),u=l?"|":">";if(!n)return u+` +`;let c="",f="";if(n=n.replace(/[\n\t ]*$/,p=>{let d=p.indexOf(` +`);return d===-1?u+="-":(n===p||d!==p.length-1)&&(u+="+",s&&s()),f=p.replace(/\n$/,""),""}).replace(/^[\n ]*/,p=>{p.indexOf(" ")!==-1&&(u+=a);let d=p.match(/ +$/);return d?(c=p.slice(0,-d[0].length),d[0]):(c=p,"")}),f&&(f=f.replace(/\n+(?!\n|$)/g,`$&${o}`)),c&&(c=c.replace(/\n+/g,`$&${o}`)),t&&(u+=" #"+t.replace(/ ?[\r\n]+/g," "),i&&i()),!n)return`${u}${a} ${o}${f}`;if(l)return n=n.replace(/\n+/g,`$&${o}`),`${u} ${o}${c}${n}${f}`;n=n.replace(/\n+/g,` -$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${o}`);let m=Yc(`${c}${n}${f}`,o,gm,to.fold);return`${u} -${o}${m}`}function VO(t,e,n,r){let{comment:i,type:s,value:o}=t,{actualString:a,implicitKey:l,indent:u,inFlow:c}=e;if(l&&/[\n[\]{},]/.test(o)||c&&/[[\]{},]/.test(o))return no(o,e);if(!o||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return l||c||o.indexOf(` -`)===-1?o.indexOf('"')!==-1&&o.indexOf("'")===-1?hv(o,e):no(o,e):$c(t,e,n,r);if(!l&&!c&&s!==j.Type.PLAIN&&o.indexOf(` -`)!==-1)return $c(t,e,n,r);if(u===""&&Kc(o))return e.forceBlockIndent=!0,$c(t,e,n,r);let f=o.replace(/\n+/g,`$& -${u}`);if(a){let{tags:d}=e.doc.schema;if(typeof hm(f,d,d.scalarFallback).value!="string")return no(o,e)}let m=l?f:Yc(f,u,dv,_m(e));return i&&!c&&(m.indexOf(` +$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${o}`);let m=Kc(`${c}${n}${f}`,o,gm,to.fold);return`${u} +${o}${m}`}function jO(t,e,n,r){let{comment:i,type:s,value:o}=t,{actualString:a,implicitKey:l,indent:u,inFlow:c}=e;if(l&&/[\n[\]{},]/.test(o)||c&&/[[\]{},]/.test(o))return no(o,e);if(!o||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return l||c||o.indexOf(` +`)===-1?o.indexOf('"')!==-1&&o.indexOf("'")===-1?gv(o,e):no(o,e):zc(t,e,n,r);if(!l&&!c&&s!==j.Type.PLAIN&&o.indexOf(` +`)!==-1)return zc(t,e,n,r);if(u===""&&$c(o))return e.forceBlockIndent=!0,zc(t,e,n,r);let f=o.replace(/\n+/g,`$& +${u}`);if(a){let{tags:p}=e.doc.schema;if(typeof hm(f,p,p.scalarFallback).value!="string")return no(o,e)}let m=l?f:Kc(f,u,mv,_m(e));return i&&!c&&(m.indexOf(` `)!==-1||i.indexOf(` -`)!==-1)?(n&&n(),wO(m,u,i)):m}function qO(t,e,n,r){let{defaultType:i}=to,{implicitKey:s,inFlow:o}=e,{type:a,value:l}=t;typeof l!="string"&&(l=String(l),t=Object.assign({},t,{value:l}));let u=f=>{switch(f){case j.Type.BLOCK_FOLDED:case j.Type.BLOCK_LITERAL:return $c(t,e,n,r);case j.Type.QUOTE_DOUBLE:return no(l,e);case j.Type.QUOTE_SINGLE:return hv(l,e);case j.Type.PLAIN:return VO(t,e,n,r);default:return null}};(a!==j.Type.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f]/.test(l)||(s||o)&&(a===j.Type.BLOCK_FOLDED||a===j.Type.BLOCK_LITERAL))&&(a=j.Type.QUOTE_DOUBLE);let c=u(a);if(c===null&&(c=u(i),c===null))throw new Error(`Unsupported default string type ${i}`);return c}function BO({format:t,minFractionDigits:e,tag:n,value:r}){if(typeof r=="bigint")return String(r);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let i=JSON.stringify(r);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(i)){let s=i.indexOf(".");s<0&&(s=i.length,i+=".");let o=e-(i.length-s-1);for(;o-- >0;)i+="0"}return i}function gv(t,e){let n,r;switch(e.type){case j.Type.FLOW_MAP:n="}",r="flow map";break;case j.Type.FLOW_SEQ:n="]",r="flow sequence";break;default:t.push(new j.YAMLSemanticError(e,"Not a flow collection!?"));return}let i;for(let s=e.items.length-1;s>=0;--s){let o=e.items[s];if(!o||o.type!==j.Type.COMMENT){i=o;break}}if(i&&i.char!==n){let s=`Expected ${r} to end with ${n}`,o;typeof i.offset=="number"?(o=new j.YAMLSemanticError(e,s),o.offset=i.offset+1):(o=new j.YAMLSemanticError(i,s),i.range&&i.range.end&&(o.offset=i.range.end-i.range.start)),t.push(o)}}function _v(t,e){let n=e.context.src[e.range.start-1];if(n!==` -`&&n!==" "&&n!==" "){let r="Comments must be separated from other tokens by white space characters";t.push(new j.YAMLSemanticError(e,r))}}function yv(t,e){let n=String(e),r=n.substr(0,8)+"..."+n.substr(-8);return new j.YAMLSemanticError(t,`The "${r}" key is too long`)}function bv(t,e){for(let{afterKey:n,before:r,comment:i}of e){let s=t.items[r];s?(n&&s.value&&(s=s.value),i===void 0?(n||!s.commentBefore)&&(s.spaceBefore=!0):s.commentBefore?s.commentBefore+=` +`)!==-1)?(n&&n(),DO(m,u,i)):m}function UO(t,e,n,r){let{defaultType:i}=to,{implicitKey:s,inFlow:o}=e,{type:a,value:l}=t;typeof l!="string"&&(l=String(l),t=Object.assign({},t,{value:l}));let u=f=>{switch(f){case j.Type.BLOCK_FOLDED:case j.Type.BLOCK_LITERAL:return zc(t,e,n,r);case j.Type.QUOTE_DOUBLE:return no(l,e);case j.Type.QUOTE_SINGLE:return gv(l,e);case j.Type.PLAIN:return jO(t,e,n,r);default:return null}};(a!==j.Type.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f]/.test(l)||(s||o)&&(a===j.Type.BLOCK_FOLDED||a===j.Type.BLOCK_LITERAL))&&(a=j.Type.QUOTE_DOUBLE);let c=u(a);if(c===null&&(c=u(i),c===null))throw new Error(`Unsupported default string type ${i}`);return c}function GO({format:t,minFractionDigits:e,tag:n,value:r}){if(typeof r=="bigint")return String(r);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let i=JSON.stringify(r);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(i)){let s=i.indexOf(".");s<0&&(s=i.length,i+=".");let o=e-(i.length-s-1);for(;o-- >0;)i+="0"}return i}function _v(t,e){let n,r;switch(e.type){case j.Type.FLOW_MAP:n="}",r="flow map";break;case j.Type.FLOW_SEQ:n="]",r="flow sequence";break;default:t.push(new j.YAMLSemanticError(e,"Not a flow collection!?"));return}let i;for(let s=e.items.length-1;s>=0;--s){let o=e.items[s];if(!o||o.type!==j.Type.COMMENT){i=o;break}}if(i&&i.char!==n){let s=`Expected ${r} to end with ${n}`,o;typeof i.offset=="number"?(o=new j.YAMLSemanticError(e,s),o.offset=i.offset+1):(o=new j.YAMLSemanticError(i,s),i.range&&i.range.end&&(o.offset=i.range.end-i.range.start)),t.push(o)}}function yv(t,e){let n=e.context.src[e.range.start-1];if(n!==` +`&&n!==" "&&n!==" "){let r="Comments must be separated from other tokens by white space characters";t.push(new j.YAMLSemanticError(e,r))}}function bv(t,e){let n=String(e),r=n.substr(0,8)+"..."+n.substr(-8);return new j.YAMLSemanticError(t,`The "${r}" key is too long`)}function Tv(t,e){for(let{afterKey:n,before:r,comment:i}of e){let s=t.items[r];s?(n&&s.value&&(s=s.value),i===void 0?(n||!s.commentBefore)&&(s.spaceBefore=!0):s.commentBefore?s.commentBefore+=` `+i:s.commentBefore=i):i!==void 0&&(t.comment?t.comment+=` -`+i:t.comment=i)}}function ym(t,e){let n=e.strValue;return n?typeof n=="string"?n:(n.errors.forEach(r=>{r.source||(r.source=e),t.errors.push(r)}),n.str):""}function jO(t,e){let{handle:n,suffix:r}=e.tag,i=t.tagPrefixes.find(s=>s.handle===n);if(!i){let s=t.getDefaults().tagPrefixes;if(s&&(i=s.find(o=>o.handle===n)),!i)throw new j.YAMLSemanticError(e,`The ${n} tag handle is non-default and was not declared.`)}if(!r)throw new j.YAMLSemanticError(e,`The ${n} tag has no suffix.`);if(n==="!"&&(t.version||t.options.version)==="1.0"){if(r[0]==="^")return t.warnings.push(new j.YAMLWarning(e,"YAML 1.0 ^ tag expansion is not supported")),r;if(/[:/]/.test(r)){let s=r.match(/^([a-z0-9-]+)\/(.*)/i);return s?`tag:${s[1]}.yaml.org,2002:${s[2]}`:`tag:${r}`}}return i.prefix+decodeURIComponent(r)}function UO(t,e){let{tag:n,type:r}=e,i=!1;if(n){let{handle:s,suffix:o,verbatim:a}=n;if(a){if(a!=="!"&&a!=="!!")return a;let l=`Verbatim tags aren't resolved, so ${a} is invalid.`;t.errors.push(new j.YAMLSemanticError(e,l))}else if(s==="!"&&!o)i=!0;else try{return jO(t,e)}catch(l){t.errors.push(l)}}switch(r){case j.Type.BLOCK_FOLDED:case j.Type.BLOCK_LITERAL:case j.Type.QUOTE_DOUBLE:case j.Type.QUOTE_SINGLE:return j.defaultTags.STR;case j.Type.FLOW_MAP:case j.Type.MAP:return j.defaultTags.MAP;case j.Type.FLOW_SEQ:case j.Type.SEQ:return j.defaultTags.SEQ;case j.Type.PLAIN:return i?j.defaultTags.STR:null;default:return null}}function Tv(t,e,n){let{tags:r}=t.schema,i=[];for(let o of r)if(o.tag===n)if(o.test)i.push(o);else{let a=o.resolve(t,e);return a instanceof Gt?a:new Sn(a)}let s=ym(t,e);return typeof s=="string"&&i.length>0?hm(s,i,r.scalarFallback):null}function GO({type:t}){switch(t){case j.Type.FLOW_MAP:case j.Type.MAP:return j.defaultTags.MAP;case j.Type.FLOW_SEQ:case j.Type.SEQ:return j.defaultTags.SEQ;default:return j.defaultTags.STR}}function WO(t,e,n){try{let r=Tv(t,e,n);if(r)return n&&e.tag&&(r.tag=n),r}catch(r){return r.source||(r.source=e),t.errors.push(r),null}try{let r=GO(e);if(!r)throw new Error(`The tag ${n} is unavailable`);let i=`The tag ${n} is unavailable, falling back to ${r}`;t.warnings.push(new j.YAMLWarning(e,i));let s=Tv(t,e,r);return s.tag=n,s}catch(r){let i=new j.YAMLReferenceError(e,r.message);return i.stack=r.stack,t.errors.push(i),null}}var HO=t=>{if(!t)return!1;let{type:e}=t;return e===j.Type.MAP_KEY||e===j.Type.MAP_VALUE||e===j.Type.SEQ_ITEM};function YO(t,e){let n={before:[],after:[]},r=!1,i=!1,s=HO(e.context.parent)?e.context.parent.props.concat(e.props):e.props;for(let{start:o,end:a}of s)switch(e.context.src[o]){case j.Char.COMMENT:{if(!e.commentHasRequiredWhitespace(o)){let f="Comments must be separated from other tokens by white space characters";t.push(new j.YAMLSemanticError(e,f))}let{header:l,valueRange:u}=e;(u&&(o>u.start||l&&o>l.start)?n.after:n.before).push(e.context.src.slice(o+1,a));break}case j.Char.ANCHOR:if(r){let l="A node can have at most one anchor";t.push(new j.YAMLSemanticError(e,l))}r=!0;break;case j.Char.TAG:if(i){let l="A node can have at most one tag";t.push(new j.YAMLSemanticError(e,l))}i=!0;break}return{comments:n,hasAnchor:r,hasTag:i}}function KO(t,e){let{anchors:n,errors:r,schema:i}=t;if(e.type===j.Type.ALIAS){let o=e.rawValue,a=n.getNode(o);if(!a){let u=`Aliased anchor not found: ${o}`;return r.push(new j.YAMLReferenceError(e,u)),null}let l=new ys(a);return n._cstAliases.push(l),l}let s=UO(t,e);if(s)return WO(t,e,s);if(e.type!==j.Type.PLAIN){let o=`Failed to resolve ${e.type} node here`;return r.push(new j.YAMLSyntaxError(e,o)),null}try{let o=ym(t,e);return hm(o,i.tags,i.tags.scalarFallback)}catch(o){return o.source||(o.source=e),r.push(o),null}}function bs(t,e){if(!e)return null;e.error&&t.errors.push(e.error);let{comments:n,hasAnchor:r,hasTag:i}=YO(t.errors,e);if(r){let{anchors:o}=t,a=e.anchor,l=o.getNode(a);l&&(o.map[o.newName(a)]=l),o.map[a]=e}if(e.type===j.Type.ALIAS&&(r||i)){let o="An alias node must not specify any properties";t.errors.push(new j.YAMLSemanticError(e,o))}let s=KO(t,e);if(s){s.range=[e.range.start,e.range.end],t.options.keepCstNodes&&(s.cstNode=e),t.options.keepNodeTypes&&(s.type=e.type);let o=n.before.join(` +`+i:t.comment=i)}}function ym(t,e){let n=e.strValue;return n?typeof n=="string"?n:(n.errors.forEach(r=>{r.source||(r.source=e),t.errors.push(r)}),n.str):""}function WO(t,e){let{handle:n,suffix:r}=e.tag,i=t.tagPrefixes.find(s=>s.handle===n);if(!i){let s=t.getDefaults().tagPrefixes;if(s&&(i=s.find(o=>o.handle===n)),!i)throw new j.YAMLSemanticError(e,`The ${n} tag handle is non-default and was not declared.`)}if(!r)throw new j.YAMLSemanticError(e,`The ${n} tag has no suffix.`);if(n==="!"&&(t.version||t.options.version)==="1.0"){if(r[0]==="^")return t.warnings.push(new j.YAMLWarning(e,"YAML 1.0 ^ tag expansion is not supported")),r;if(/[:/]/.test(r)){let s=r.match(/^([a-z0-9-]+)\/(.*)/i);return s?`tag:${s[1]}.yaml.org,2002:${s[2]}`:`tag:${r}`}}return i.prefix+decodeURIComponent(r)}function HO(t,e){let{tag:n,type:r}=e,i=!1;if(n){let{handle:s,suffix:o,verbatim:a}=n;if(a){if(a!=="!"&&a!=="!!")return a;let l=`Verbatim tags aren't resolved, so ${a} is invalid.`;t.errors.push(new j.YAMLSemanticError(e,l))}else if(s==="!"&&!o)i=!0;else try{return WO(t,e)}catch(l){t.errors.push(l)}}switch(r){case j.Type.BLOCK_FOLDED:case j.Type.BLOCK_LITERAL:case j.Type.QUOTE_DOUBLE:case j.Type.QUOTE_SINGLE:return j.defaultTags.STR;case j.Type.FLOW_MAP:case j.Type.MAP:return j.defaultTags.MAP;case j.Type.FLOW_SEQ:case j.Type.SEQ:return j.defaultTags.SEQ;case j.Type.PLAIN:return i?j.defaultTags.STR:null;default:return null}}function Nv(t,e,n){let{tags:r}=t.schema,i=[];for(let o of r)if(o.tag===n)if(o.test)i.push(o);else{let a=o.resolve(t,e);return a instanceof Gt?a:new Sn(a)}let s=ym(t,e);return typeof s=="string"&&i.length>0?hm(s,i,r.scalarFallback):null}function YO({type:t}){switch(t){case j.Type.FLOW_MAP:case j.Type.MAP:return j.defaultTags.MAP;case j.Type.FLOW_SEQ:case j.Type.SEQ:return j.defaultTags.SEQ;default:return j.defaultTags.STR}}function KO(t,e,n){try{let r=Nv(t,e,n);if(r)return n&&e.tag&&(r.tag=n),r}catch(r){return r.source||(r.source=e),t.errors.push(r),null}try{let r=YO(e);if(!r)throw new Error(`The tag ${n} is unavailable`);let i=`The tag ${n} is unavailable, falling back to ${r}`;t.warnings.push(new j.YAMLWarning(e,i));let s=Nv(t,e,r);return s.tag=n,s}catch(r){let i=new j.YAMLReferenceError(e,r.message);return i.stack=r.stack,t.errors.push(i),null}}var $O=t=>{if(!t)return!1;let{type:e}=t;return e===j.Type.MAP_KEY||e===j.Type.MAP_VALUE||e===j.Type.SEQ_ITEM};function zO(t,e){let n={before:[],after:[]},r=!1,i=!1,s=$O(e.context.parent)?e.context.parent.props.concat(e.props):e.props;for(let{start:o,end:a}of s)switch(e.context.src[o]){case j.Char.COMMENT:{if(!e.commentHasRequiredWhitespace(o)){let f="Comments must be separated from other tokens by white space characters";t.push(new j.YAMLSemanticError(e,f))}let{header:l,valueRange:u}=e;(u&&(o>u.start||l&&o>l.start)?n.after:n.before).push(e.context.src.slice(o+1,a));break}case j.Char.ANCHOR:if(r){let l="A node can have at most one anchor";t.push(new j.YAMLSemanticError(e,l))}r=!0;break;case j.Char.TAG:if(i){let l="A node can have at most one tag";t.push(new j.YAMLSemanticError(e,l))}i=!0;break}return{comments:n,hasAnchor:r,hasTag:i}}function XO(t,e){let{anchors:n,errors:r,schema:i}=t;if(e.type===j.Type.ALIAS){let o=e.rawValue,a=n.getNode(o);if(!a){let u=`Aliased anchor not found: ${o}`;return r.push(new j.YAMLReferenceError(e,u)),null}let l=new ys(a);return n._cstAliases.push(l),l}let s=HO(t,e);if(s)return KO(t,e,s);if(e.type!==j.Type.PLAIN){let o=`Failed to resolve ${e.type} node here`;return r.push(new j.YAMLSyntaxError(e,o)),null}try{let o=ym(t,e);return hm(o,i.tags,i.tags.scalarFallback)}catch(o){return o.source||(o.source=e),r.push(o),null}}function bs(t,e){if(!e)return null;e.error&&t.errors.push(e.error);let{comments:n,hasAnchor:r,hasTag:i}=zO(t.errors,e);if(r){let{anchors:o}=t,a=e.anchor,l=o.getNode(a);l&&(o.map[o.newName(a)]=l),o.map[a]=e}if(e.type===j.Type.ALIAS&&(r||i)){let o="An alias node must not specify any properties";t.errors.push(new j.YAMLSemanticError(e,o))}let s=XO(t,e);if(s){s.range=[e.range.start,e.range.end],t.options.keepCstNodes&&(s.cstNode=e),t.options.keepNodeTypes&&(s.type=e.type);let o=n.before.join(` `);o&&(s.commentBefore=s.commentBefore?`${s.commentBefore} ${o}`:o);let a=n.after.join(` `);a&&(s.comment=s.comment?`${s.comment} -${a}`:a)}return e.resolved=s}function $O(t,e){if(e.type!==j.Type.MAP&&e.type!==j.Type.FLOW_MAP){let o=`A ${e.type} node cannot be resolved as a mapping`;return t.errors.push(new j.YAMLSyntaxError(e,o)),null}let{comments:n,items:r}=e.type===j.Type.FLOW_MAP?JO(t,e):QO(t,e),i=new Wc;i.items=r,bv(i,n);let s=!1;for(let o=0;o{if(c instanceof ys){let{type:f}=c.source;return f===j.Type.MAP||f===j.Type.FLOW_MAP?!1:u="Merge nodes aliases can only point to maps"}return u="Merge nodes can only have Alias nodes as values"}),u&&t.errors.push(new j.YAMLSemanticError(e,u))}else for(let l=o+1;l{if(r.length===0)return!1;let{start:i}=r[0];if(e&&i>e.valueRange.start||n[i]!==j.Char.COMMENT)return!1;for(let s=t;s0){l=new j.PlainValue(j.Type.PLAIN,[]),l.context={parent:a,src:a.context.src};let c=a.range.start+1;if(l.range={start:c,end:c},l.valueRange={start:c,end:c},typeof a.range.origStart=="number"){let f=a.range.origStart+1;l.range.origStart=l.range.origEnd=f,l.valueRange.origStart=l.valueRange.origEnd=f}}let u=new rt(i,bs(t,l));XO(a,u),r.push(u),i&&typeof s=="number"&&a.range.start>s+1024&&t.errors.push(yv(e,i)),i=void 0,s=null}break;default:i!==void 0&&r.push(new rt(i)),i=bs(t,a),s=a.range.start,a.error&&t.errors.push(a.error);e:for(let l=o+1;;++l){let u=e.items[l];switch(u&&u.type){case j.Type.BLANK_LINE:case j.Type.COMMENT:continue e;case j.Type.MAP_VALUE:break e;default:{let c="Implicit map keys need to be followed by map values";t.errors.push(new j.YAMLSemanticError(a,c));break e}}}if(a.valueRangeContainsNewline){let l="Implicit map keys need to be on a single line";t.errors.push(new j.YAMLSemanticError(a,l))}}}return i!==void 0&&r.push(new rt(i)),{comments:n,items:r}}function JO(t,e){let n=[],r=[],i,s=!1,o="{";for(let a=0;as instanceof rt&&s.key instanceof Gt)){let s="Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.";t.warnings.push(new j.YAMLWarning(e,s))}return e.resolved=i,i}function eL(t,e){let n=[],r=[];for(let i=0;io+1024&&t.errors.push(yv(e,s));let{src:p}=l.context;for(let _=o;_{"use strict";var Jn=hs(),Ue=Sa(),nL={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve:(t,e)=>{let n=Ue.resolveString(t,e);if(typeof Buffer=="function")return Buffer.from(n,"base64");if(typeof atob=="function"){let r=atob(n.replace(/[\n\r]/g,"")),i=new Uint8Array(r.length);for(let s=0;s{let o;if(typeof Buffer=="function")o=n instanceof Buffer?n.toString("base64"):Buffer.from(n.buffer).toString("base64");else if(typeof btoa=="function"){let a="";for(let l=0;l1){let o="Each pair must have its own sequence indicator";throw new Jn.YAMLSemanticError(e,o)}let s=i.items[0]||new Ue.Pair;i.commentBefore&&(s.commentBefore=s.commentBefore?`${i.commentBefore} +${a}`:a)}return e.resolved=s}function QO(t,e){if(e.type!==j.Type.MAP&&e.type!==j.Type.FLOW_MAP){let o=`A ${e.type} node cannot be resolved as a mapping`;return t.errors.push(new j.YAMLSyntaxError(e,o)),null}let{comments:n,items:r}=e.type===j.Type.FLOW_MAP?tL(t,e):eL(t,e),i=new Hc;i.items=r,Tv(i,n);let s=!1;for(let o=0;o{if(c instanceof ys){let{type:f}=c.source;return f===j.Type.MAP||f===j.Type.FLOW_MAP?!1:u="Merge nodes aliases can only point to maps"}return u="Merge nodes can only have Alias nodes as values"}),u&&t.errors.push(new j.YAMLSemanticError(e,u))}else for(let l=o+1;l{if(r.length===0)return!1;let{start:i}=r[0];if(e&&i>e.valueRange.start||n[i]!==j.Char.COMMENT)return!1;for(let s=t;s0){l=new j.PlainValue(j.Type.PLAIN,[]),l.context={parent:a,src:a.context.src};let c=a.range.start+1;if(l.range={start:c,end:c},l.valueRange={start:c,end:c},typeof a.range.origStart=="number"){let f=a.range.origStart+1;l.range.origStart=l.range.origEnd=f,l.valueRange.origStart=l.valueRange.origEnd=f}}let u=new rt(i,bs(t,l));ZO(a,u),r.push(u),i&&typeof s=="number"&&a.range.start>s+1024&&t.errors.push(bv(e,i)),i=void 0,s=null}break;default:i!==void 0&&r.push(new rt(i)),i=bs(t,a),s=a.range.start,a.error&&t.errors.push(a.error);e:for(let l=o+1;;++l){let u=e.items[l];switch(u&&u.type){case j.Type.BLANK_LINE:case j.Type.COMMENT:continue e;case j.Type.MAP_VALUE:break e;default:{let c="Implicit map keys need to be followed by map values";t.errors.push(new j.YAMLSemanticError(a,c));break e}}}if(a.valueRangeContainsNewline){let l="Implicit map keys need to be on a single line";t.errors.push(new j.YAMLSemanticError(a,l))}}}return i!==void 0&&r.push(new rt(i)),{comments:n,items:r}}function tL(t,e){let n=[],r=[],i,s=!1,o="{";for(let a=0;as instanceof rt&&s.key instanceof Gt)){let s="Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.";t.warnings.push(new j.YAMLWarning(e,s))}return e.resolved=i,i}function rL(t,e){let n=[],r=[];for(let i=0;io+1024&&t.errors.push(bv(e,s));let{src:d}=l.context;for(let _=o;_{"use strict";var Jn=hs(),Ue=Sa(),sL={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve:(t,e)=>{let n=Ue.resolveString(t,e);if(typeof Buffer=="function")return Buffer.from(n,"base64");if(typeof atob=="function"){let r=atob(n.replace(/[\n\r]/g,"")),i=new Uint8Array(r.length);for(let s=0;s{let o;if(typeof Buffer=="function")o=n instanceof Buffer?n.toString("base64"):Buffer.from(n.buffer).toString("base64");else if(typeof btoa=="function"){let a="";for(let l=0;l1){let o="Each pair must have its own sequence indicator";throw new Jn.YAMLSemanticError(e,o)}let s=i.items[0]||new Ue.Pair;i.commentBefore&&(s.commentBefore=s.commentBefore?`${i.commentBefore} ${s.commentBefore}`:i.commentBefore),i.comment&&(s.comment=s.comment?`${i.comment} -${s.comment}`:i.comment),i=s}n.items[r]=i instanceof Ue.Pair?i:new Ue.Pair(i)}}return n}function vv(t,e,n){let r=new Ue.YAMLSeq(t);r.tag="tag:yaml.org,2002:pairs";for(let i of e){let s,o;if(Array.isArray(i))if(i.length===2)s=i[0],o=i[1];else throw new TypeError(`Expected [key, value] tuple: ${i}`);else if(i&&i instanceof Object){let l=Object.keys(i);if(l.length===1)s=l[0],o=i[s];else throw new TypeError(`Expected { key: value } tuple: ${i}`)}else s=i;let a=t.createPair(s,o,n);r.items.push(a)}return r}var rL={default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Nv,createNode:vv},ro=class extends Ue.YAMLSeq{constructor(){super();Jn._defineProperty(this,"add",Ue.YAMLMap.prototype.add.bind(this)),Jn._defineProperty(this,"delete",Ue.YAMLMap.prototype.delete.bind(this)),Jn._defineProperty(this,"get",Ue.YAMLMap.prototype.get.bind(this)),Jn._defineProperty(this,"has",Ue.YAMLMap.prototype.has.bind(this)),Jn._defineProperty(this,"set",Ue.YAMLMap.prototype.set.bind(this)),this.tag=ro.tag}toJSON(e,n){let r=new Map;n&&n.onCreate&&n.onCreate(r);for(let i of this.items){let s,o;if(i instanceof Ue.Pair?(s=Ue.toJSON(i.key,"",n),o=Ue.toJSON(i.value,s,n)):s=Ue.toJSON(i,"",n),r.has(s))throw new Error("Ordered maps must not include duplicate keys");r.set(s,o)}return r}};Jn._defineProperty(ro,"tag","tag:yaml.org,2002:omap");function iL(t,e){let n=Nv(t,e),r=[];for(let{key:i}of n.items)if(i instanceof Ue.Scalar)if(r.includes(i.value)){let s="Ordered maps must not include duplicate keys";throw new Jn.YAMLSemanticError(e,s)}else r.push(i.value);return Object.assign(new ro,n)}function sL(t,e,n){let r=vv(t,e,n),i=new ro;return i.items=r.items,i}var oL={identify:t=>t instanceof Map,nodeClass:ro,default:!1,tag:"tag:yaml.org,2002:omap",resolve:iL,createNode:sL},io=class extends Ue.YAMLMap{constructor(){super();this.tag=io.tag}add(e){let n=e instanceof Ue.Pair?e:new Ue.Pair(e);Ue.findPair(this.items,n.key)||this.items.push(n)}get(e,n){let r=Ue.findPair(this.items,e);return!n&&r instanceof Ue.Pair?r.key instanceof Ue.Scalar?r.key.value:r.key:r}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let r=Ue.findPair(this.items,e);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Ue.Pair(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues())return super.toString(e,n,r);throw new Error("Set items must all have null values")}};Jn._defineProperty(io,"tag","tag:yaml.org,2002:set");function aL(t,e){let n=Ue.resolveMap(t,e);if(!n.hasAllNullValues())throw new Jn.YAMLSemanticError(e,"Set items must all have null values");return Object.assign(new io,n)}function lL(t,e,n){let r=new io;for(let i of e)r.items.push(t.createPair(i,null,n));return r}var uL={identify:t=>t instanceof Set,nodeClass:io,default:!1,tag:"tag:yaml.org,2002:set",resolve:aL,createNode:lL},bm=(t,e)=>{let n=e.split(":").reduce((r,i)=>r*60+Number(i),0);return t==="-"?-n:n},Pv=({value:t})=>{if(isNaN(t)||!isFinite(t))return Ue.stringifyNumber(t);let e="";t<0&&(e="-",t=Math.abs(t));let n=[t%60];return t<60?n.unshift(0):(t=Math.round((t-n[0])/60),n.unshift(t%60),t>=60&&(t=Math.round((t-n[0])/60),n.unshift(t))),e+n.map(r=>r<10?"0"+String(r):String(r)).join(":").replace(/000000\d*$/,"")},cL={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+)$/,resolve:(t,e,n)=>bm(e,n.replace(/_/g,"")),stringify:Pv},fL={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*)$/,resolve:(t,e,n)=>bm(e,n.replace(/_/g,"")),stringify:Pv},pL={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^(?:([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?)$"),resolve:(t,e,n,r,i,s,o,a,l)=>{a&&(a=(a+"00").substr(1,3));let u=Date.UTC(e,n-1,r,i||0,s||0,o||0,a||0);if(l&&l!=="Z"){let c=bm(l[0],l.slice(1));Math.abs(c)<30&&(c*=60),u-=6e4*c}return new Date(u)},stringify:({value:t})=>t.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")};function Tm(t){let e=typeof process!="undefined"&&process.env||{};return t?typeof YAML_SILENCE_DEPRECATION_WARNINGS!="undefined"?!YAML_SILENCE_DEPRECATION_WARNINGS:!e.YAML_SILENCE_DEPRECATION_WARNINGS:typeof YAML_SILENCE_WARNINGS!="undefined"?!YAML_SILENCE_WARNINGS:!e.YAML_SILENCE_WARNINGS}function Nm(t,e){if(Tm(!1)){let n=typeof process!="undefined"&&process.emitWarning;n?n(t,e):console.warn(e?`${e}: ${t}`:t)}}function dL(t){if(Tm(!0)){let e=t.replace(/.*yaml[/\\]/i,"").replace(/\.js$/,"").replace(/\\/g,"/");Nm(`The endpoint 'yaml/${e}' will be removed in a future release.`,"DeprecationWarning")}}var Iv={};function mL(t,e){if(!Iv[t]&&Tm(!0)){Iv[t]=!0;let n=`The option '${t}' will be removed in a future release`;n+=e?`, use '${e}' instead.`:".",Nm(n,"DeprecationWarning")}}Qr.binary=nL;Qr.floatTime=fL;Qr.intTime=cL;Qr.omap=oL;Qr.pairs=rL;Qr.set=uL;Qr.timestamp=pL;Qr.warn=Nm;Qr.warnFileDeprecation=dL;Qr.warnOptionDeprecation=mL});var tf=K(Fv=>{"use strict";var Xc=hs(),Te=Sa(),Cn=zc();function hL(t,e,n){let r=new Te.YAMLMap(t);if(e instanceof Map)for(let[i,s]of e)r.items.push(t.createPair(i,s,n));else if(e&&typeof e=="object")for(let i of Object.keys(e))r.items.push(t.createPair(i,e[i],n));return typeof t.sortMapEntries=="function"&&r.items.sort(t.sortMapEntries),r}var xl={createNode:hL,default:!0,nodeClass:Te.YAMLMap,tag:"tag:yaml.org,2002:map",resolve:Te.resolveMap};function gL(t,e,n){let r=new Te.YAMLSeq(t);if(e&&e[Symbol.iterator])for(let i of e){let s=t.createNode(i,n.wrapScalars,null,n);r.items.push(s)}return r}var Qc={createNode:gL,default:!0,nodeClass:Te.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve:Te.resolveSeq},_L={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:Te.resolveString,stringify(t,e,n,r){return e=Object.assign({actualString:!0},e),Te.stringifyString(t,e,n,r)},options:Te.strOptions},vm=[xl,Qc,_L],Jc=t=>typeof t=="bigint"||Number.isInteger(t),Pm=(t,e,n)=>Te.intOptions.asBigInt?BigInt(t):parseInt(e,n);function Sv(t,e,n){let{value:r}=t;return Jc(r)&&r>=0?n+r.toString(e):Te.stringifyNumber(t)}var Cv={identify:t=>t==null,createNode:(t,e,n)=>n.wrapScalars?new Te.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:Te.nullOptions,stringify:()=>Te.nullOptions.nullStr},Rv={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>t[0]==="t"||t[0]==="T",options:Te.boolOptions,stringify:({value:t})=>t?Te.boolOptions.trueStr:Te.boolOptions.falseStr},Av={identify:t=>Jc(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o([0-7]+)$/,resolve:(t,e)=>Pm(t,e,8),options:Te.intOptions,stringify:t=>Sv(t,8,"0o")},xv={identify:Jc,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:t=>Pm(t,t,10),options:Te.intOptions,stringify:Te.stringifyNumber},Ev={identify:t=>Jc(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x([0-9a-fA-F]+)$/,resolve:(t,e)=>Pm(t,e,16),options:Te.intOptions,stringify:t=>Sv(t,16,"0x")},wv={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(t,e)=>e?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Te.stringifyNumber},Ov={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify:({value:t})=>Number(t).toExponential()},Lv={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.([0-9]+)|[0-9]+\.([0-9]*))$/,resolve(t,e,n){let r=e||n,i=new Te.Scalar(parseFloat(t));return r&&r[r.length-1]==="0"&&(i.minFractionDigits=r.length),i},stringify:Te.stringifyNumber},yL=vm.concat([Cv,Rv,Av,xv,Ev,wv,Ov,Lv]),Dv=t=>typeof t=="bigint"||Number.isInteger(t),Zc=({value:t})=>JSON.stringify(t),kv=[xl,Qc,{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:Te.resolveString,stringify:Zc},{identify:t=>t==null,createNode:(t,e,n)=>n.wrapScalars?new Te.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Zc},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:t=>t==="true",stringify:Zc},{identify:Dv,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:t=>Te.intOptions.asBigInt?BigInt(t):parseInt(t,10),stringify:({value:t})=>Dv(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Zc}];kv.scalarFallback=t=>{throw new SyntaxError(`Unresolved plain scalar ${JSON.stringify(t)}`)};var Mv=({value:t})=>t?Te.boolOptions.trueStr:Te.boolOptions.falseStr,El=t=>typeof t=="bigint"||Number.isInteger(t);function ef(t,e,n){let r=e.replace(/_/g,"");if(Te.intOptions.asBigInt){switch(n){case 2:r=`0b${r}`;break;case 8:r=`0o${r}`;break;case 16:r=`0x${r}`;break}let s=BigInt(r);return t==="-"?BigInt(-1)*s:s}let i=parseInt(r,n);return t==="-"?-1*i:i}function Im(t,e,n){let{value:r}=t;if(El(r)){let i=r.toString(e);return r<0?"-"+n+i.substr(1):n+i}return Te.stringifyNumber(t)}var bL=vm.concat([{identify:t=>t==null,createNode:(t,e,n)=>n.wrapScalars?new Te.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:Te.nullOptions,stringify:()=>Te.nullOptions.nullStr},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>!0,options:Te.boolOptions,stringify:Mv},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i,resolve:()=>!1,options:Te.boolOptions,stringify:Mv},{identify:El,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^([-+]?)0b([0-1_]+)$/,resolve:(t,e,n)=>ef(e,n,2),stringify:t=>Im(t,2,"0b")},{identify:El,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^([-+]?)0([0-7_]+)$/,resolve:(t,e,n)=>ef(e,n,8),stringify:t=>Im(t,8,"0")},{identify:El,default:!0,tag:"tag:yaml.org,2002:int",test:/^([-+]?)([0-9][0-9_]*)$/,resolve:(t,e,n)=>ef(e,n,10),stringify:Te.stringifyNumber},{identify:El,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^([-+]?)0x([0-9a-fA-F_]+)$/,resolve:(t,e,n)=>ef(e,n,16),stringify:t=>Im(t,16,"0x")},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(t,e)=>e?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Te.stringifyNumber},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?([0-9][0-9_]*)?(\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify:({value:t})=>Number(t).toExponential()},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.([0-9_]*)$/,resolve(t,e){let n=new Te.Scalar(parseFloat(t.replace(/_/g,"")));if(e){let r=e.replace(/_/g,"");r[r.length-1]==="0"&&(n.minFractionDigits=r.length)}return n},stringify:Te.stringifyNumber}],Cn.binary,Cn.omap,Cn.pairs,Cn.set,Cn.intTime,Cn.floatTime,Cn.timestamp),TL={core:yL,failsafe:vm,json:kv,yaml11:bL},NL={binary:Cn.binary,bool:Rv,float:Lv,floatExp:Ov,floatNaN:wv,floatTime:Cn.floatTime,int:xv,intHex:Ev,intOct:Av,intTime:Cn.intTime,map:xl,null:Cv,omap:Cn.omap,pairs:Cn.pairs,seq:Qc,set:Cn.set,timestamp:Cn.timestamp};function vL(t,e,n){if(e){let r=n.filter(s=>s.tag===e),i=r.find(s=>!s.format)||r[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return n.find(r=>(r.identify&&r.identify(t)||r.class&&t instanceof r.class)&&!r.format)}function PL(t,e,n){if(t instanceof Te.Node)return t;let{defaultPrefix:r,onTagObj:i,prevObjects:s,schema:o,wrapScalars:a}=n;e&&e.startsWith("!!")&&(e=r+e.slice(2));let l=vL(t,e,o.tags);if(!l){if(typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object")return a?new Te.Scalar(t):t;l=t instanceof Map?xl:t[Symbol.iterator]?Qc:xl}i&&(i(l),delete n.onTagObj);let u={value:void 0,node:void 0};if(t&&typeof t=="object"&&s){let c=s.get(t);if(c){let f=new Te.Alias(c);return n.aliasNodes.push(f),f}u.value=t,s.set(t,u)}return u.node=l.createNode?l.createNode(n.schema,t,n):a?new Te.Scalar(t):t,e&&u.node instanceof Te.Node&&(u.node.tag=e),u.node}function IL(t,e,n,r){let i=t[r.replace(/\W/g,"")];if(!i){let s=Object.keys(t).map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${r}"; use one of ${s}`)}if(Array.isArray(n))for(let s of n)i=i.concat(s);else typeof n=="function"&&(i=n(i.slice()));for(let s=0;sJSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag "${o}"; use one of ${l}`)}i[s]=a}}return i}var SL=(t,e)=>t.keye.key?1:0,Ca=class{constructor({customTags:e,merge:n,schema:r,sortMapEntries:i,tags:s}){this.merge=!!n,this.name=r,this.sortMapEntries=i===!0?SL:i||null,!e&&s&&Cn.warnOptionDeprecation("tags","customTags"),this.tags=IL(TL,NL,e||s,r)}createNode(e,n,r,i){let s={defaultPrefix:Ca.defaultPrefix,schema:this,wrapScalars:n},o=i?Object.assign(i,s):s;return PL(e,r,o)}createPair(e,n,r){r||(r={wrapScalars:!0});let i=this.createNode(e,r.wrapScalars,null,r),s=this.createNode(n,r.wrapScalars,null,r);return new Te.Pair(i,s)}};Xc._defineProperty(Ca,"defaultPrefix",Xc.defaultTagPrefix);Xc._defineProperty(Ca,"defaultTags",Xc.defaultTags);Fv.Schema=Ca});var jv=K(of=>{"use strict";var Rn=hs(),Pe=Sa(),Vv=tf(),CL={anchorPrefix:"a",customTags:null,indent:2,indentSeq:!0,keepCstNodes:!1,keepNodeTypes:!0,keepBlobsInJSON:!0,mapAsMap:!1,maxAliasCount:100,prettyErrors:!1,simpleKeys:!1,version:"1.2"},RL={get binary(){return Pe.binaryOptions},set binary(t){Object.assign(Pe.binaryOptions,t)},get bool(){return Pe.boolOptions},set bool(t){Object.assign(Pe.boolOptions,t)},get int(){return Pe.intOptions},set int(t){Object.assign(Pe.intOptions,t)},get null(){return Pe.nullOptions},set null(t){Object.assign(Pe.nullOptions,t)},get str(){return Pe.strOptions},set str(t){Object.assign(Pe.strOptions,t)}},qv={"1.0":{schema:"yaml-1.1",merge:!0,tagPrefixes:[{handle:"!",prefix:Rn.defaultTagPrefix},{handle:"!!",prefix:"tag:private.yaml.org,2002:"}]},1.1:{schema:"yaml-1.1",merge:!0,tagPrefixes:[{handle:"!",prefix:"!"},{handle:"!!",prefix:Rn.defaultTagPrefix}]},1.2:{schema:"core",merge:!1,tagPrefixes:[{handle:"!",prefix:"!"},{handle:"!!",prefix:Rn.defaultTagPrefix}]}};function Bv(t,e){if((t.version||t.options.version)==="1.0"){let i=e.match(/^tag:private\.yaml\.org,2002:([^:/]+)$/);if(i)return"!"+i[1];let s=e.match(/^tag:([a-zA-Z0-9-]+)\.yaml\.org,2002:(.*)/);return s?`!${s[1]}/${s[2]}`:`!${e.replace(/^tag:/,"")}`}let n=t.tagPrefixes.find(i=>e.indexOf(i.prefix)===0);if(!n){let i=t.getDefaults().tagPrefixes;n=i&&i.find(s=>e.indexOf(s.prefix)===0)}if(!n)return e[0]==="!"?e:`!<${e}>`;let r=e.substr(n.prefix.length).replace(/[!,[\]{}]/g,i=>({"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"})[i]);return n.handle+r}function AL(t,e){if(e instanceof Pe.Alias)return Pe.Alias;if(e.tag){let i=t.filter(s=>s.tag===e.tag);if(i.length>0)return i.find(s=>s.format===e.format)||i[0]}let n,r;if(e instanceof Pe.Scalar){r=e.value;let i=t.filter(s=>s.identify&&s.identify(r)||s.class&&r instanceof s.class);n=i.find(s=>s.format===e.format)||i.find(s=>!s.format)}else r=e,n=t.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){let i=r&&r.constructor?r.constructor.name:typeof r;throw new Error(`Tag not resolved for ${i} value`)}return n}function xL(t,e,{anchors:n,doc:r}){let i=[],s=r.anchors.getName(t);return s&&(n[s]=t,i.push(`&${s}`)),t.tag?i.push(Bv(r,t.tag)):e.default||i.push(Bv(r,e.tag)),i.join(" ")}function nf(t,e,n,r){let{anchors:i,schema:s}=e.doc,o;if(!(t instanceof Pe.Node)){let u={aliasNodes:[],onTagObj:c=>o=c,prevObjects:new Map};t=s.createNode(t,!0,null,u);for(let c of u.aliasNodes){c.source=c.source.node;let f=i.getName(c.source);f||(f=i.newName(),i.map[f]=c.source)}}if(t instanceof Pe.Pair)return t.toString(e,n,r);o||(o=AL(s.tags,t));let a=xL(t,o,e);a.length>0&&(e.indentAtStart=(e.indentAtStart||0)+a.length+1);let l=typeof o.stringify=="function"?o.stringify(t,e,n,r):t instanceof Pe.Scalar?Pe.stringifyString(t,e,n,r):t.toString(e,n,r);return a?t instanceof Pe.Scalar||l[0]==="{"||l[0]==="["?`${a} ${l}`:`${a} -${e.indent}${l}`:l}var rf=class{static validAnchorNode(e){return e instanceof Pe.Scalar||e instanceof Pe.YAMLSeq||e instanceof Pe.YAMLMap}constructor(e){Rn._defineProperty(this,"map",Object.create(null)),this.prefix=e}createAlias(e,n){return this.setAnchor(e,n),new Pe.Alias(e)}createMergePair(...e){let n=new Pe.Merge;return n.value.items=e.map(r=>{if(r instanceof Pe.Alias){if(r.source instanceof Pe.YAMLMap)return r}else if(r instanceof Pe.YAMLMap)return this.createAlias(r);throw new Error("Merge sources must be Map nodes or their Aliases")}),n}getName(e){let{map:n}=this;return Object.keys(n).find(r=>n[r]===e)}getNames(){return Object.keys(this.map)}getNode(e){return this.map[e]}newName(e){e||(e=this.prefix);let n=Object.keys(this.map);for(let r=1;;++r){let i=`${e}${r}`;if(!n.includes(i))return i}}resolveNodes(){let{map:e,_cstAliases:n}=this;Object.keys(e).forEach(r=>{e[r]=e[r].resolved}),n.forEach(r=>{r.source=r.source.resolved}),delete this._cstAliases}setAnchor(e,n){if(e!=null&&!rf.validAnchorNode(e))throw new Error("Anchors may only be set for Scalar, Seq and Map nodes");if(n&&/[\x00-\x19\s,[\]{}]/.test(n))throw new Error("Anchor names must not contain whitespace or control characters");let{map:r}=this,i=e&&Object.keys(r).find(s=>r[s]===e);if(i)if(n)i!==n&&(delete r[i],r[n]=e);else return i;else{if(!n){if(!e)return null;n=this.newName()}r[n]=e}return n}},sf=(t,e)=>{if(t&&typeof t=="object"){let{tag:n}=t;t instanceof Pe.Collection?(n&&(e[n]=!0),t.items.forEach(r=>sf(r,e))):t instanceof Pe.Pair?(sf(t.key,e),sf(t.value,e)):t instanceof Pe.Scalar&&n&&(e[n]=!0)}return e},EL=t=>Object.keys(sf(t,{}));function wL(t,e){let n={before:[],after:[]},r,i=!1;for(let s of e)if(s.valueRange){if(r!==void 0){let a="Document contains trailing content not separated by a ... or --- line";t.errors.push(new Rn.YAMLSyntaxError(s,a));break}let o=Pe.resolveNode(t,s);i&&(o.spaceBefore=!0,i=!1),r=o}else s.comment!==null?(r===void 0?n.before:n.after).push(s.comment):s.type===Rn.Type.BLANK_LINE&&(i=!0,r===void 0&&n.before.length>0&&!t.commentBefore&&(t.commentBefore=n.before.join(` +${s.comment}`:i.comment),i=s}n.items[r]=i instanceof Ue.Pair?i:new Ue.Pair(i)}}return n}function Pv(t,e,n){let r=new Ue.YAMLSeq(t);r.tag="tag:yaml.org,2002:pairs";for(let i of e){let s,o;if(Array.isArray(i))if(i.length===2)s=i[0],o=i[1];else throw new TypeError(`Expected [key, value] tuple: ${i}`);else if(i&&i instanceof Object){let l=Object.keys(i);if(l.length===1)s=l[0],o=i[s];else throw new TypeError(`Expected { key: value } tuple: ${i}`)}else s=i;let a=t.createPair(s,o,n);r.items.push(a)}return r}var oL={default:!1,tag:"tag:yaml.org,2002:pairs",resolve:vv,createNode:Pv},ro=class extends Ue.YAMLSeq{constructor(){super();Jn._defineProperty(this,"add",Ue.YAMLMap.prototype.add.bind(this)),Jn._defineProperty(this,"delete",Ue.YAMLMap.prototype.delete.bind(this)),Jn._defineProperty(this,"get",Ue.YAMLMap.prototype.get.bind(this)),Jn._defineProperty(this,"has",Ue.YAMLMap.prototype.has.bind(this)),Jn._defineProperty(this,"set",Ue.YAMLMap.prototype.set.bind(this)),this.tag=ro.tag}toJSON(e,n){let r=new Map;n&&n.onCreate&&n.onCreate(r);for(let i of this.items){let s,o;if(i instanceof Ue.Pair?(s=Ue.toJSON(i.key,"",n),o=Ue.toJSON(i.value,s,n)):s=Ue.toJSON(i,"",n),r.has(s))throw new Error("Ordered maps must not include duplicate keys");r.set(s,o)}return r}};Jn._defineProperty(ro,"tag","tag:yaml.org,2002:omap");function aL(t,e){let n=vv(t,e),r=[];for(let{key:i}of n.items)if(i instanceof Ue.Scalar)if(r.includes(i.value)){let s="Ordered maps must not include duplicate keys";throw new Jn.YAMLSemanticError(e,s)}else r.push(i.value);return Object.assign(new ro,n)}function lL(t,e,n){let r=Pv(t,e,n),i=new ro;return i.items=r.items,i}var uL={identify:t=>t instanceof Map,nodeClass:ro,default:!1,tag:"tag:yaml.org,2002:omap",resolve:aL,createNode:lL},io=class extends Ue.YAMLMap{constructor(){super();this.tag=io.tag}add(e){let n=e instanceof Ue.Pair?e:new Ue.Pair(e);Ue.findPair(this.items,n.key)||this.items.push(n)}get(e,n){let r=Ue.findPair(this.items,e);return!n&&r instanceof Ue.Pair?r.key instanceof Ue.Scalar?r.key.value:r.key:r}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let r=Ue.findPair(this.items,e);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Ue.Pair(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues())return super.toString(e,n,r);throw new Error("Set items must all have null values")}};Jn._defineProperty(io,"tag","tag:yaml.org,2002:set");function cL(t,e){let n=Ue.resolveMap(t,e);if(!n.hasAllNullValues())throw new Jn.YAMLSemanticError(e,"Set items must all have null values");return Object.assign(new io,n)}function fL(t,e,n){let r=new io;for(let i of e)r.items.push(t.createPair(i,null,n));return r}var pL={identify:t=>t instanceof Set,nodeClass:io,default:!1,tag:"tag:yaml.org,2002:set",resolve:cL,createNode:fL},bm=(t,e)=>{let n=e.split(":").reduce((r,i)=>r*60+Number(i),0);return t==="-"?-n:n},Iv=({value:t})=>{if(isNaN(t)||!isFinite(t))return Ue.stringifyNumber(t);let e="";t<0&&(e="-",t=Math.abs(t));let n=[t%60];return t<60?n.unshift(0):(t=Math.round((t-n[0])/60),n.unshift(t%60),t>=60&&(t=Math.round((t-n[0])/60),n.unshift(t))),e+n.map(r=>r<10?"0"+String(r):String(r)).join(":").replace(/000000\d*$/,"")},dL={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+)$/,resolve:(t,e,n)=>bm(e,n.replace(/_/g,"")),stringify:Iv},mL={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*)$/,resolve:(t,e,n)=>bm(e,n.replace(/_/g,"")),stringify:Iv},hL={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^(?:([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?)$"),resolve:(t,e,n,r,i,s,o,a,l)=>{a&&(a=(a+"00").substr(1,3));let u=Date.UTC(e,n-1,r,i||0,s||0,o||0,a||0);if(l&&l!=="Z"){let c=bm(l[0],l.slice(1));Math.abs(c)<30&&(c*=60),u-=6e4*c}return new Date(u)},stringify:({value:t})=>t.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")};function Tm(t){let e=typeof process!="undefined"&&process.env||{};return t?typeof YAML_SILENCE_DEPRECATION_WARNINGS!="undefined"?!YAML_SILENCE_DEPRECATION_WARNINGS:!e.YAML_SILENCE_DEPRECATION_WARNINGS:typeof YAML_SILENCE_WARNINGS!="undefined"?!YAML_SILENCE_WARNINGS:!e.YAML_SILENCE_WARNINGS}function Nm(t,e){if(Tm(!1)){let n=typeof process!="undefined"&&process.emitWarning;n?n(t,e):console.warn(e?`${e}: ${t}`:t)}}function gL(t){if(Tm(!0)){let e=t.replace(/.*yaml[/\\]/i,"").replace(/\.js$/,"").replace(/\\/g,"/");Nm(`The endpoint 'yaml/${e}' will be removed in a future release.`,"DeprecationWarning")}}var Sv={};function _L(t,e){if(!Sv[t]&&Tm(!0)){Sv[t]=!0;let n=`The option '${t}' will be removed in a future release`;n+=e?`, use '${e}' instead.`:".",Nm(n,"DeprecationWarning")}}Qr.binary=sL;Qr.floatTime=mL;Qr.intTime=dL;Qr.omap=uL;Qr.pairs=oL;Qr.set=pL;Qr.timestamp=hL;Qr.warn=Nm;Qr.warnFileDeprecation=gL;Qr.warnOptionDeprecation=_L});var nf=K(Vv=>{"use strict";var Qc=hs(),Te=Sa(),Cn=Xc();function yL(t,e,n){let r=new Te.YAMLMap(t);if(e instanceof Map)for(let[i,s]of e)r.items.push(t.createPair(i,s,n));else if(e&&typeof e=="object")for(let i of Object.keys(e))r.items.push(t.createPair(i,e[i],n));return typeof t.sortMapEntries=="function"&&r.items.sort(t.sortMapEntries),r}var El={createNode:yL,default:!0,nodeClass:Te.YAMLMap,tag:"tag:yaml.org,2002:map",resolve:Te.resolveMap};function bL(t,e,n){let r=new Te.YAMLSeq(t);if(e&&e[Symbol.iterator])for(let i of e){let s=t.createNode(i,n.wrapScalars,null,n);r.items.push(s)}return r}var Jc={createNode:bL,default:!0,nodeClass:Te.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve:Te.resolveSeq},TL={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:Te.resolveString,stringify(t,e,n,r){return e=Object.assign({actualString:!0},e),Te.stringifyString(t,e,n,r)},options:Te.strOptions},vm=[El,Jc,TL],Zc=t=>typeof t=="bigint"||Number.isInteger(t),Pm=(t,e,n)=>Te.intOptions.asBigInt?BigInt(t):parseInt(e,n);function Cv(t,e,n){let{value:r}=t;return Zc(r)&&r>=0?n+r.toString(e):Te.stringifyNumber(t)}var Rv={identify:t=>t==null,createNode:(t,e,n)=>n.wrapScalars?new Te.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:Te.nullOptions,stringify:()=>Te.nullOptions.nullStr},Av={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>t[0]==="t"||t[0]==="T",options:Te.boolOptions,stringify:({value:t})=>t?Te.boolOptions.trueStr:Te.boolOptions.falseStr},xv={identify:t=>Zc(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o([0-7]+)$/,resolve:(t,e)=>Pm(t,e,8),options:Te.intOptions,stringify:t=>Cv(t,8,"0o")},Ev={identify:Zc,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:t=>Pm(t,t,10),options:Te.intOptions,stringify:Te.stringifyNumber},wv={identify:t=>Zc(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x([0-9a-fA-F]+)$/,resolve:(t,e)=>Pm(t,e,16),options:Te.intOptions,stringify:t=>Cv(t,16,"0x")},Ov={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(t,e)=>e?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Te.stringifyNumber},Lv={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify:({value:t})=>Number(t).toExponential()},Dv={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.([0-9]+)|[0-9]+\.([0-9]*))$/,resolve(t,e,n){let r=e||n,i=new Te.Scalar(parseFloat(t));return r&&r[r.length-1]==="0"&&(i.minFractionDigits=r.length),i},stringify:Te.stringifyNumber},NL=vm.concat([Rv,Av,xv,Ev,wv,Ov,Lv,Dv]),kv=t=>typeof t=="bigint"||Number.isInteger(t),ef=({value:t})=>JSON.stringify(t),Mv=[El,Jc,{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:Te.resolveString,stringify:ef},{identify:t=>t==null,createNode:(t,e,n)=>n.wrapScalars?new Te.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:ef},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:t=>t==="true",stringify:ef},{identify:kv,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:t=>Te.intOptions.asBigInt?BigInt(t):parseInt(t,10),stringify:({value:t})=>kv(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:ef}];Mv.scalarFallback=t=>{throw new SyntaxError(`Unresolved plain scalar ${JSON.stringify(t)}`)};var Fv=({value:t})=>t?Te.boolOptions.trueStr:Te.boolOptions.falseStr,wl=t=>typeof t=="bigint"||Number.isInteger(t);function tf(t,e,n){let r=e.replace(/_/g,"");if(Te.intOptions.asBigInt){switch(n){case 2:r=`0b${r}`;break;case 8:r=`0o${r}`;break;case 16:r=`0x${r}`;break}let s=BigInt(r);return t==="-"?BigInt(-1)*s:s}let i=parseInt(r,n);return t==="-"?-1*i:i}function Im(t,e,n){let{value:r}=t;if(wl(r)){let i=r.toString(e);return r<0?"-"+n+i.substr(1):n+i}return Te.stringifyNumber(t)}var vL=vm.concat([{identify:t=>t==null,createNode:(t,e,n)=>n.wrapScalars?new Te.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:Te.nullOptions,stringify:()=>Te.nullOptions.nullStr},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>!0,options:Te.boolOptions,stringify:Fv},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i,resolve:()=>!1,options:Te.boolOptions,stringify:Fv},{identify:wl,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^([-+]?)0b([0-1_]+)$/,resolve:(t,e,n)=>tf(e,n,2),stringify:t=>Im(t,2,"0b")},{identify:wl,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^([-+]?)0([0-7_]+)$/,resolve:(t,e,n)=>tf(e,n,8),stringify:t=>Im(t,8,"0")},{identify:wl,default:!0,tag:"tag:yaml.org,2002:int",test:/^([-+]?)([0-9][0-9_]*)$/,resolve:(t,e,n)=>tf(e,n,10),stringify:Te.stringifyNumber},{identify:wl,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^([-+]?)0x([0-9a-fA-F_]+)$/,resolve:(t,e,n)=>tf(e,n,16),stringify:t=>Im(t,16,"0x")},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(t,e)=>e?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Te.stringifyNumber},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?([0-9][0-9_]*)?(\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify:({value:t})=>Number(t).toExponential()},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.([0-9_]*)$/,resolve(t,e){let n=new Te.Scalar(parseFloat(t.replace(/_/g,"")));if(e){let r=e.replace(/_/g,"");r[r.length-1]==="0"&&(n.minFractionDigits=r.length)}return n},stringify:Te.stringifyNumber}],Cn.binary,Cn.omap,Cn.pairs,Cn.set,Cn.intTime,Cn.floatTime,Cn.timestamp),PL={core:NL,failsafe:vm,json:Mv,yaml11:vL},IL={binary:Cn.binary,bool:Av,float:Dv,floatExp:Lv,floatNaN:Ov,floatTime:Cn.floatTime,int:Ev,intHex:wv,intOct:xv,intTime:Cn.intTime,map:El,null:Rv,omap:Cn.omap,pairs:Cn.pairs,seq:Jc,set:Cn.set,timestamp:Cn.timestamp};function SL(t,e,n){if(e){let r=n.filter(s=>s.tag===e),i=r.find(s=>!s.format)||r[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return n.find(r=>(r.identify&&r.identify(t)||r.class&&t instanceof r.class)&&!r.format)}function CL(t,e,n){if(t instanceof Te.Node)return t;let{defaultPrefix:r,onTagObj:i,prevObjects:s,schema:o,wrapScalars:a}=n;e&&e.startsWith("!!")&&(e=r+e.slice(2));let l=SL(t,e,o.tags);if(!l){if(typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object")return a?new Te.Scalar(t):t;l=t instanceof Map?El:t[Symbol.iterator]?Jc:El}i&&(i(l),delete n.onTagObj);let u={value:void 0,node:void 0};if(t&&typeof t=="object"&&s){let c=s.get(t);if(c){let f=new Te.Alias(c);return n.aliasNodes.push(f),f}u.value=t,s.set(t,u)}return u.node=l.createNode?l.createNode(n.schema,t,n):a?new Te.Scalar(t):t,e&&u.node instanceof Te.Node&&(u.node.tag=e),u.node}function RL(t,e,n,r){let i=t[r.replace(/\W/g,"")];if(!i){let s=Object.keys(t).map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${r}"; use one of ${s}`)}if(Array.isArray(n))for(let s of n)i=i.concat(s);else typeof n=="function"&&(i=n(i.slice()));for(let s=0;sJSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag "${o}"; use one of ${l}`)}i[s]=a}}return i}var AL=(t,e)=>t.keye.key?1:0,Ca=class{constructor({customTags:e,merge:n,schema:r,sortMapEntries:i,tags:s}){this.merge=!!n,this.name=r,this.sortMapEntries=i===!0?AL:i||null,!e&&s&&Cn.warnOptionDeprecation("tags","customTags"),this.tags=RL(PL,IL,e||s,r)}createNode(e,n,r,i){let s={defaultPrefix:Ca.defaultPrefix,schema:this,wrapScalars:n},o=i?Object.assign(i,s):s;return CL(e,r,o)}createPair(e,n,r){r||(r={wrapScalars:!0});let i=this.createNode(e,r.wrapScalars,null,r),s=this.createNode(n,r.wrapScalars,null,r);return new Te.Pair(i,s)}};Qc._defineProperty(Ca,"defaultPrefix",Qc.defaultTagPrefix);Qc._defineProperty(Ca,"defaultTags",Qc.defaultTags);Vv.Schema=Ca});var Uv=K(af=>{"use strict";var Rn=hs(),Pe=Sa(),qv=nf(),xL={anchorPrefix:"a",customTags:null,indent:2,indentSeq:!0,keepCstNodes:!1,keepNodeTypes:!0,keepBlobsInJSON:!0,mapAsMap:!1,maxAliasCount:100,prettyErrors:!1,simpleKeys:!1,version:"1.2"},EL={get binary(){return Pe.binaryOptions},set binary(t){Object.assign(Pe.binaryOptions,t)},get bool(){return Pe.boolOptions},set bool(t){Object.assign(Pe.boolOptions,t)},get int(){return Pe.intOptions},set int(t){Object.assign(Pe.intOptions,t)},get null(){return Pe.nullOptions},set null(t){Object.assign(Pe.nullOptions,t)},get str(){return Pe.strOptions},set str(t){Object.assign(Pe.strOptions,t)}},Bv={"1.0":{schema:"yaml-1.1",merge:!0,tagPrefixes:[{handle:"!",prefix:Rn.defaultTagPrefix},{handle:"!!",prefix:"tag:private.yaml.org,2002:"}]},1.1:{schema:"yaml-1.1",merge:!0,tagPrefixes:[{handle:"!",prefix:"!"},{handle:"!!",prefix:Rn.defaultTagPrefix}]},1.2:{schema:"core",merge:!1,tagPrefixes:[{handle:"!",prefix:"!"},{handle:"!!",prefix:Rn.defaultTagPrefix}]}};function jv(t,e){if((t.version||t.options.version)==="1.0"){let i=e.match(/^tag:private\.yaml\.org,2002:([^:/]+)$/);if(i)return"!"+i[1];let s=e.match(/^tag:([a-zA-Z0-9-]+)\.yaml\.org,2002:(.*)/);return s?`!${s[1]}/${s[2]}`:`!${e.replace(/^tag:/,"")}`}let n=t.tagPrefixes.find(i=>e.indexOf(i.prefix)===0);if(!n){let i=t.getDefaults().tagPrefixes;n=i&&i.find(s=>e.indexOf(s.prefix)===0)}if(!n)return e[0]==="!"?e:`!<${e}>`;let r=e.substr(n.prefix.length).replace(/[!,[\]{}]/g,i=>({"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"})[i]);return n.handle+r}function wL(t,e){if(e instanceof Pe.Alias)return Pe.Alias;if(e.tag){let i=t.filter(s=>s.tag===e.tag);if(i.length>0)return i.find(s=>s.format===e.format)||i[0]}let n,r;if(e instanceof Pe.Scalar){r=e.value;let i=t.filter(s=>s.identify&&s.identify(r)||s.class&&r instanceof s.class);n=i.find(s=>s.format===e.format)||i.find(s=>!s.format)}else r=e,n=t.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){let i=r&&r.constructor?r.constructor.name:typeof r;throw new Error(`Tag not resolved for ${i} value`)}return n}function OL(t,e,{anchors:n,doc:r}){let i=[],s=r.anchors.getName(t);return s&&(n[s]=t,i.push(`&${s}`)),t.tag?i.push(jv(r,t.tag)):e.default||i.push(jv(r,e.tag)),i.join(" ")}function rf(t,e,n,r){let{anchors:i,schema:s}=e.doc,o;if(!(t instanceof Pe.Node)){let u={aliasNodes:[],onTagObj:c=>o=c,prevObjects:new Map};t=s.createNode(t,!0,null,u);for(let c of u.aliasNodes){c.source=c.source.node;let f=i.getName(c.source);f||(f=i.newName(),i.map[f]=c.source)}}if(t instanceof Pe.Pair)return t.toString(e,n,r);o||(o=wL(s.tags,t));let a=OL(t,o,e);a.length>0&&(e.indentAtStart=(e.indentAtStart||0)+a.length+1);let l=typeof o.stringify=="function"?o.stringify(t,e,n,r):t instanceof Pe.Scalar?Pe.stringifyString(t,e,n,r):t.toString(e,n,r);return a?t instanceof Pe.Scalar||l[0]==="{"||l[0]==="["?`${a} ${l}`:`${a} +${e.indent}${l}`:l}var sf=class{static validAnchorNode(e){return e instanceof Pe.Scalar||e instanceof Pe.YAMLSeq||e instanceof Pe.YAMLMap}constructor(e){Rn._defineProperty(this,"map",Object.create(null)),this.prefix=e}createAlias(e,n){return this.setAnchor(e,n),new Pe.Alias(e)}createMergePair(...e){let n=new Pe.Merge;return n.value.items=e.map(r=>{if(r instanceof Pe.Alias){if(r.source instanceof Pe.YAMLMap)return r}else if(r instanceof Pe.YAMLMap)return this.createAlias(r);throw new Error("Merge sources must be Map nodes or their Aliases")}),n}getName(e){let{map:n}=this;return Object.keys(n).find(r=>n[r]===e)}getNames(){return Object.keys(this.map)}getNode(e){return this.map[e]}newName(e){e||(e=this.prefix);let n=Object.keys(this.map);for(let r=1;;++r){let i=`${e}${r}`;if(!n.includes(i))return i}}resolveNodes(){let{map:e,_cstAliases:n}=this;Object.keys(e).forEach(r=>{e[r]=e[r].resolved}),n.forEach(r=>{r.source=r.source.resolved}),delete this._cstAliases}setAnchor(e,n){if(e!=null&&!sf.validAnchorNode(e))throw new Error("Anchors may only be set for Scalar, Seq and Map nodes");if(n&&/[\x00-\x19\s,[\]{}]/.test(n))throw new Error("Anchor names must not contain whitespace or control characters");let{map:r}=this,i=e&&Object.keys(r).find(s=>r[s]===e);if(i)if(n)i!==n&&(delete r[i],r[n]=e);else return i;else{if(!n){if(!e)return null;n=this.newName()}r[n]=e}return n}},of=(t,e)=>{if(t&&typeof t=="object"){let{tag:n}=t;t instanceof Pe.Collection?(n&&(e[n]=!0),t.items.forEach(r=>of(r,e))):t instanceof Pe.Pair?(of(t.key,e),of(t.value,e)):t instanceof Pe.Scalar&&n&&(e[n]=!0)}return e},LL=t=>Object.keys(of(t,{}));function DL(t,e){let n={before:[],after:[]},r,i=!1;for(let s of e)if(s.valueRange){if(r!==void 0){let a="Document contains trailing content not separated by a ... or --- line";t.errors.push(new Rn.YAMLSyntaxError(s,a));break}let o=Pe.resolveNode(t,s);i&&(o.spaceBefore=!0,i=!1),r=o}else s.comment!==null?(r===void 0?n.before:n.after).push(s.comment):s.type===Rn.Type.BLANK_LINE&&(i=!0,r===void 0&&n.before.length>0&&!t.commentBefore&&(t.commentBefore=n.before.join(` `),n.before=[]));if(t.contents=r||null,!r)t.comment=n.before.concat(n.after).join(` `)||null;else{let s=n.before.join(` `);if(s){let o=r instanceof Pe.Collection&&r.items[0]?r.items[0]:r;o.commentBefore=o.commentBefore?`${s} ${o.commentBefore}`:s}t.comment=n.after.join(` -`)||null}}function OL({tagPrefixes:t},e){let[n,r]=e.parameters;if(!n||!r){let i="Insufficient parameters given for %TAG directive";throw new Rn.YAMLSemanticError(e,i)}if(t.some(i=>i.handle===n)){let i="The %TAG directive must only be given at most once per handle in the same document.";throw new Rn.YAMLSemanticError(e,i)}return{handle:n,prefix:r}}function LL(t,e){let[n]=e.parameters;if(e.name==="YAML:1.0"&&(n="1.0"),!n){let r="Insufficient parameters given for %YAML directive";throw new Rn.YAMLSemanticError(e,r)}if(!qv[n]){let i=`Document will be parsed as YAML ${t.version||t.options.version} rather than YAML ${n}`;t.warnings.push(new Rn.YAMLWarning(e,i))}return n}function DL(t,e,n){let r=[],i=!1;for(let s of e){let{comment:o,name:a}=s;switch(a){case"TAG":try{t.tagPrefixes.push(OL(t,s))}catch(l){t.errors.push(l)}i=!0;break;case"YAML":case"YAML:1.0":if(t.version){let l="The %YAML directive must only be given at most once per document.";t.errors.push(new Rn.YAMLSemanticError(s,l))}try{t.version=LL(t,s)}catch(l){t.errors.push(l)}i=!0;break;default:if(a){let l=`YAML only supports %TAG and %YAML directives, and not %${a}`;t.warnings.push(new Rn.YAMLWarning(s,l))}}o&&r.push(o)}if(n&&!i&&(t.version||n.version||t.options.version)==="1.1"){let s=({handle:o,prefix:a})=>({handle:o,prefix:a});t.tagPrefixes=n.tagPrefixes.map(s),t.version=n.version}t.commentBefore=r.join(` -`)||null}function Ra(t){if(t instanceof Pe.Collection)return!0;throw new Error("Expected a YAML collection as document contents")}var Aa=class{constructor(e){this.anchors=new rf(e.anchorPrefix),this.commentBefore=null,this.comment=null,this.contents=null,this.directivesEndMarker=null,this.errors=[],this.options=e,this.schema=null,this.tagPrefixes=[],this.version=null,this.warnings=[]}add(e){return Ra(this.contents),this.contents.add(e)}addIn(e,n){Ra(this.contents),this.contents.addIn(e,n)}delete(e){return Ra(this.contents),this.contents.delete(e)}deleteIn(e){return Pe.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):(Ra(this.contents),this.contents.deleteIn(e))}getDefaults(){return Aa.defaults[this.version]||Aa.defaults[this.options.version]||{}}get(e,n){return this.contents instanceof Pe.Collection?this.contents.get(e,n):void 0}getIn(e,n){return Pe.isEmptyPath(e)?!n&&this.contents instanceof Pe.Scalar?this.contents.value:this.contents:this.contents instanceof Pe.Collection?this.contents.getIn(e,n):void 0}has(e){return this.contents instanceof Pe.Collection?this.contents.has(e):!1}hasIn(e){return Pe.isEmptyPath(e)?this.contents!==void 0:this.contents instanceof Pe.Collection?this.contents.hasIn(e):!1}set(e,n){Ra(this.contents),this.contents.set(e,n)}setIn(e,n){Pe.isEmptyPath(e)?this.contents=n:(Ra(this.contents),this.contents.setIn(e,n))}setSchema(e,n){if(!e&&!n&&this.schema)return;typeof e=="number"&&(e=e.toFixed(1)),e==="1.0"||e==="1.1"||e==="1.2"?(this.version?this.version=e:this.options.version=e,delete this.options.schema):e&&typeof e=="string"&&(this.options.schema=e),Array.isArray(n)&&(this.options.customTags=n);let r=Object.assign({},this.getDefaults(),this.options);this.schema=new Vv.Schema(r)}parse(e,n){this.options.keepCstNodes&&(this.cstNode=e),this.options.keepNodeTypes&&(this.type="DOCUMENT");let{directives:r=[],contents:i=[],directivesEndMarker:s,error:o,valueRange:a}=e;if(o&&(o.source||(o.source=this),this.errors.push(o)),DL(this,r,n),s&&(this.directivesEndMarker=!0),this.range=a?[a.start,a.end]:null,this.setSchema(),this.anchors._cstAliases=[],wL(this,i),this.anchors.resolveNodes(),this.options.prettyErrors){for(let l of this.errors)l instanceof Rn.YAMLError&&l.makePretty();for(let l of this.warnings)l instanceof Rn.YAMLError&&l.makePretty()}return this}listNonDefaultTags(){return EL(this.contents).filter(e=>e.indexOf(Vv.Schema.defaultPrefix)!==0)}setTagPrefix(e,n){if(e[0]!=="!"||e[e.length-1]!=="!")throw new Error("Handle must start and end with !");if(n){let r=this.tagPrefixes.find(i=>i.handle===e);r?r.prefix=n:this.tagPrefixes.push({handle:e,prefix:n})}else this.tagPrefixes=this.tagPrefixes.filter(r=>r.handle!==e)}toJSON(e,n){let{keepBlobsInJSON:r,mapAsMap:i,maxAliasCount:s}=this.options,o=r&&(typeof e!="string"||!(this.contents instanceof Pe.Scalar)),a={doc:this,indentStep:" ",keep:o,mapAsMap:o&&!!i,maxAliasCount:s,stringify:nf},l=Object.keys(this.anchors.map);l.length>0&&(a.anchors=new Map(l.map(c=>[this.anchors.map[c],{alias:[],aliasCount:0,count:1}])));let u=Pe.toJSON(this.contents,e,a);if(typeof n=="function"&&a.anchors)for(let{count:c,res:f}of a.anchors.values())n(f,c);return u}toString(){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");let e=this.options.indent;if(!Number.isInteger(e)||e<=0){let l=JSON.stringify(e);throw new Error(`"indent" option must be a positive integer, not ${l}`)}this.setSchema();let n=[],r=!1;if(this.version){let l="%YAML 1.2";this.schema.name==="yaml-1.1"&&(this.version==="1.0"?l="%YAML:1.0":this.version==="1.1"&&(l="%YAML 1.1")),n.push(l),r=!0}let i=this.listNonDefaultTags();this.tagPrefixes.forEach(({handle:l,prefix:u})=>{i.some(c=>c.indexOf(u)===0)&&(n.push(`%TAG ${l} ${u}`),r=!0)}),(r||this.directivesEndMarker)&&n.push("---"),this.commentBefore&&((r||!this.directivesEndMarker)&&n.unshift(""),n.unshift(this.commentBefore.replace(/^/gm,"#")));let s={anchors:Object.create(null),doc:this,indent:"",indentStep:" ".repeat(e),stringify:nf},o=!1,a=null;if(this.contents){this.contents instanceof Pe.Node&&(this.contents.spaceBefore&&(r||this.directivesEndMarker)&&n.push(""),this.contents.commentBefore&&n.push(this.contents.commentBefore.replace(/^/gm,"#")),s.forceBlockIndent=!!this.comment,a=this.contents.comment);let l=a?null:()=>o=!0,u=nf(this.contents,s,()=>a=null,l);n.push(Pe.addComment(u,"",a))}else this.contents!==void 0&&n.push(nf(this.contents,s));return this.comment&&((!o||a)&&n[n.length-1]!==""&&n.push(""),n.push(this.comment.replace(/^/gm,"#"))),n.join(` +`)||null}}function kL({tagPrefixes:t},e){let[n,r]=e.parameters;if(!n||!r){let i="Insufficient parameters given for %TAG directive";throw new Rn.YAMLSemanticError(e,i)}if(t.some(i=>i.handle===n)){let i="The %TAG directive must only be given at most once per handle in the same document.";throw new Rn.YAMLSemanticError(e,i)}return{handle:n,prefix:r}}function ML(t,e){let[n]=e.parameters;if(e.name==="YAML:1.0"&&(n="1.0"),!n){let r="Insufficient parameters given for %YAML directive";throw new Rn.YAMLSemanticError(e,r)}if(!Bv[n]){let i=`Document will be parsed as YAML ${t.version||t.options.version} rather than YAML ${n}`;t.warnings.push(new Rn.YAMLWarning(e,i))}return n}function FL(t,e,n){let r=[],i=!1;for(let s of e){let{comment:o,name:a}=s;switch(a){case"TAG":try{t.tagPrefixes.push(kL(t,s))}catch(l){t.errors.push(l)}i=!0;break;case"YAML":case"YAML:1.0":if(t.version){let l="The %YAML directive must only be given at most once per document.";t.errors.push(new Rn.YAMLSemanticError(s,l))}try{t.version=ML(t,s)}catch(l){t.errors.push(l)}i=!0;break;default:if(a){let l=`YAML only supports %TAG and %YAML directives, and not %${a}`;t.warnings.push(new Rn.YAMLWarning(s,l))}}o&&r.push(o)}if(n&&!i&&(t.version||n.version||t.options.version)==="1.1"){let s=({handle:o,prefix:a})=>({handle:o,prefix:a});t.tagPrefixes=n.tagPrefixes.map(s),t.version=n.version}t.commentBefore=r.join(` +`)||null}function Ra(t){if(t instanceof Pe.Collection)return!0;throw new Error("Expected a YAML collection as document contents")}var Aa=class{constructor(e){this.anchors=new sf(e.anchorPrefix),this.commentBefore=null,this.comment=null,this.contents=null,this.directivesEndMarker=null,this.errors=[],this.options=e,this.schema=null,this.tagPrefixes=[],this.version=null,this.warnings=[]}add(e){return Ra(this.contents),this.contents.add(e)}addIn(e,n){Ra(this.contents),this.contents.addIn(e,n)}delete(e){return Ra(this.contents),this.contents.delete(e)}deleteIn(e){return Pe.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):(Ra(this.contents),this.contents.deleteIn(e))}getDefaults(){return Aa.defaults[this.version]||Aa.defaults[this.options.version]||{}}get(e,n){return this.contents instanceof Pe.Collection?this.contents.get(e,n):void 0}getIn(e,n){return Pe.isEmptyPath(e)?!n&&this.contents instanceof Pe.Scalar?this.contents.value:this.contents:this.contents instanceof Pe.Collection?this.contents.getIn(e,n):void 0}has(e){return this.contents instanceof Pe.Collection?this.contents.has(e):!1}hasIn(e){return Pe.isEmptyPath(e)?this.contents!==void 0:this.contents instanceof Pe.Collection?this.contents.hasIn(e):!1}set(e,n){Ra(this.contents),this.contents.set(e,n)}setIn(e,n){Pe.isEmptyPath(e)?this.contents=n:(Ra(this.contents),this.contents.setIn(e,n))}setSchema(e,n){if(!e&&!n&&this.schema)return;typeof e=="number"&&(e=e.toFixed(1)),e==="1.0"||e==="1.1"||e==="1.2"?(this.version?this.version=e:this.options.version=e,delete this.options.schema):e&&typeof e=="string"&&(this.options.schema=e),Array.isArray(n)&&(this.options.customTags=n);let r=Object.assign({},this.getDefaults(),this.options);this.schema=new qv.Schema(r)}parse(e,n){this.options.keepCstNodes&&(this.cstNode=e),this.options.keepNodeTypes&&(this.type="DOCUMENT");let{directives:r=[],contents:i=[],directivesEndMarker:s,error:o,valueRange:a}=e;if(o&&(o.source||(o.source=this),this.errors.push(o)),FL(this,r,n),s&&(this.directivesEndMarker=!0),this.range=a?[a.start,a.end]:null,this.setSchema(),this.anchors._cstAliases=[],DL(this,i),this.anchors.resolveNodes(),this.options.prettyErrors){for(let l of this.errors)l instanceof Rn.YAMLError&&l.makePretty();for(let l of this.warnings)l instanceof Rn.YAMLError&&l.makePretty()}return this}listNonDefaultTags(){return LL(this.contents).filter(e=>e.indexOf(qv.Schema.defaultPrefix)!==0)}setTagPrefix(e,n){if(e[0]!=="!"||e[e.length-1]!=="!")throw new Error("Handle must start and end with !");if(n){let r=this.tagPrefixes.find(i=>i.handle===e);r?r.prefix=n:this.tagPrefixes.push({handle:e,prefix:n})}else this.tagPrefixes=this.tagPrefixes.filter(r=>r.handle!==e)}toJSON(e,n){let{keepBlobsInJSON:r,mapAsMap:i,maxAliasCount:s}=this.options,o=r&&(typeof e!="string"||!(this.contents instanceof Pe.Scalar)),a={doc:this,indentStep:" ",keep:o,mapAsMap:o&&!!i,maxAliasCount:s,stringify:rf},l=Object.keys(this.anchors.map);l.length>0&&(a.anchors=new Map(l.map(c=>[this.anchors.map[c],{alias:[],aliasCount:0,count:1}])));let u=Pe.toJSON(this.contents,e,a);if(typeof n=="function"&&a.anchors)for(let{count:c,res:f}of a.anchors.values())n(f,c);return u}toString(){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");let e=this.options.indent;if(!Number.isInteger(e)||e<=0){let l=JSON.stringify(e);throw new Error(`"indent" option must be a positive integer, not ${l}`)}this.setSchema();let n=[],r=!1;if(this.version){let l="%YAML 1.2";this.schema.name==="yaml-1.1"&&(this.version==="1.0"?l="%YAML:1.0":this.version==="1.1"&&(l="%YAML 1.1")),n.push(l),r=!0}let i=this.listNonDefaultTags();this.tagPrefixes.forEach(({handle:l,prefix:u})=>{i.some(c=>c.indexOf(u)===0)&&(n.push(`%TAG ${l} ${u}`),r=!0)}),(r||this.directivesEndMarker)&&n.push("---"),this.commentBefore&&((r||!this.directivesEndMarker)&&n.unshift(""),n.unshift(this.commentBefore.replace(/^/gm,"#")));let s={anchors:Object.create(null),doc:this,indent:"",indentStep:" ".repeat(e),stringify:rf},o=!1,a=null;if(this.contents){this.contents instanceof Pe.Node&&(this.contents.spaceBefore&&(r||this.directivesEndMarker)&&n.push(""),this.contents.commentBefore&&n.push(this.contents.commentBefore.replace(/^/gm,"#")),s.forceBlockIndent=!!this.comment,a=this.contents.comment);let l=a?null:()=>o=!0,u=rf(this.contents,s,()=>a=null,l);n.push(Pe.addComment(u,"",a))}else this.contents!==void 0&&n.push(rf(this.contents,s));return this.comment&&((!o||a)&&n[n.length-1]!==""&&n.push(""),n.push(this.comment.replace(/^/gm,"#"))),n.join(` `)+` -`}};Rn._defineProperty(Aa,"defaults",qv);of.Document=Aa;of.defaultOptions=CL;of.scalarOptions=RL});var Wv=K(Gv=>{"use strict";var Sm=uv(),so=jv(),kL=tf(),ML=hs(),FL=zc();Sa();function VL(t,e=!0,n){n===void 0&&typeof e=="string"&&(n=e,e=!0);let r=Object.assign({},so.Document.defaults[so.defaultOptions.version],so.defaultOptions);return new kL.Schema(r).createNode(t,e,n)}var wl=class extends so.Document{constructor(e){super(Object.assign({},so.defaultOptions,e))}};function qL(t,e){let n=[],r;for(let i of Sm.parse(t)){let s=new wl(e);s.parse(i,r),n.push(s),r=s}return n}function Uv(t,e){let n=Sm.parse(t),r=new wl(e).parse(n[0]);if(n.length>1){let i="Source contains multiple documents; please use YAML.parseAllDocuments()";r.errors.unshift(new ML.YAMLSemanticError(n[1],i))}return r}function BL(t,e){let n=Uv(t,e);if(n.warnings.forEach(r=>FL.warn(r)),n.errors.length>0)throw n.errors[0];return n.toJSON()}function jL(t,e){let n=new wl(e);return n.contents=t,String(n)}var UL={createNode:VL,defaultOptions:so.defaultOptions,Document:wl,parse:BL,parseAllDocuments:qL,parseCST:Sm.parse,parseDocument:Uv,scalarOptions:so.scalarOptions,stringify:jL};Gv.YAML=UL});var mi=K((cJ,Hv)=>{Hv.exports=Wv().YAML});var Yv=K(An=>{"use strict";var Zn=Sa(),GL=tf();hs();zc();An.Alias=Zn.Alias;An.Collection=Zn.Collection;An.Merge=Zn.Merge;An.Node=Zn.Node;An.Pair=Zn.Pair;An.Scalar=Zn.Scalar;An.YAMLMap=Zn.YAMLMap;An.YAMLSeq=Zn.YAMLSeq;An.binaryOptions=Zn.binaryOptions;An.boolOptions=Zn.boolOptions;An.intOptions=Zn.intOptions;An.nullOptions=Zn.nullOptions;An.strOptions=Zn.strOptions;An.Schema=GL.Schema});var uh=K((Ce,SI)=>{Ce=SI.exports=Be;var Ze;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?Ze=function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)}:Ze=function(){};Ce.SEMVER_SPEC_VERSION="2.0.0";var Ym=256,_f=Number.MAX_SAFE_INTEGER||9007199254740991,Km=16,it=Ce.re=[],H=Ce.src=[],Fe=0,Ma=Fe++;H[Ma]="0|[1-9]\\d*";var Fa=Fe++;H[Fa]="[0-9]+";var $m=Fe++;H[$m]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var cI=Fe++;H[cI]="("+H[Ma]+")\\.("+H[Ma]+")\\.("+H[Ma]+")";var fI=Fe++;H[fI]="("+H[Fa]+")\\.("+H[Fa]+")\\.("+H[Fa]+")";var zm=Fe++;H[zm]="(?:"+H[Ma]+"|"+H[$m]+")";var Xm=Fe++;H[Xm]="(?:"+H[Fa]+"|"+H[$m]+")";var Qm=Fe++;H[Qm]="(?:-("+H[zm]+"(?:\\."+H[zm]+")*))";var Jm=Fe++;H[Jm]="(?:-?("+H[Xm]+"(?:\\."+H[Xm]+")*))";var Zm=Fe++;H[Zm]="[0-9A-Za-z-]+";var Gl=Fe++;H[Gl]="(?:\\+("+H[Zm]+"(?:\\."+H[Zm]+")*))";var eh=Fe++,pI="v?"+H[cI]+H[Qm]+"?"+H[Gl]+"?";H[eh]="^"+pI+"$";var th="[v=\\s]*"+H[fI]+H[Jm]+"?"+H[Gl]+"?",nh=Fe++;H[nh]="^"+th+"$";var Va=Fe++;H[Va]="((?:<|>)?=?)";var yf=Fe++;H[yf]=H[Fa]+"|x|X|\\*";var bf=Fe++;H[bf]=H[Ma]+"|x|X|\\*";var co=Fe++;H[co]="[v=\\s]*("+H[bf]+")(?:\\.("+H[bf]+")(?:\\.("+H[bf]+")(?:"+H[Qm]+")?"+H[Gl]+"?)?)?";var qa=Fe++;H[qa]="[v=\\s]*("+H[yf]+")(?:\\.("+H[yf]+")(?:\\.("+H[yf]+")(?:"+H[Jm]+")?"+H[Gl]+"?)?)?";var dI=Fe++;H[dI]="^"+H[Va]+"\\s*"+H[co]+"$";var mI=Fe++;H[mI]="^"+H[Va]+"\\s*"+H[qa]+"$";var hI=Fe++;H[hI]="(?:^|[^\\d])(\\d{1,"+Km+"})(?:\\.(\\d{1,"+Km+"}))?(?:\\.(\\d{1,"+Km+"}))?(?:$|[^\\d])";var Tf=Fe++;H[Tf]="(?:~>?)";var Nf=Fe++;H[Nf]="(\\s*)"+H[Tf]+"\\s+";it[Nf]=new RegExp(H[Nf],"g");var x1="$1~",gI=Fe++;H[gI]="^"+H[Tf]+H[co]+"$";var _I=Fe++;H[_I]="^"+H[Tf]+H[qa]+"$";var vf=Fe++;H[vf]="(?:\\^)";var Pf=Fe++;H[Pf]="(\\s*)"+H[vf]+"\\s+";it[Pf]=new RegExp(H[Pf],"g");var E1="$1^",yI=Fe++;H[yI]="^"+H[vf]+H[co]+"$";var bI=Fe++;H[bI]="^"+H[vf]+H[qa]+"$";var rh=Fe++;H[rh]="^"+H[Va]+"\\s*("+th+")$|^$";var ih=Fe++;H[ih]="^"+H[Va]+"\\s*("+pI+")$|^$";var Wl=Fe++;H[Wl]="(\\s*)"+H[Va]+"\\s*("+th+"|"+H[co]+")";it[Wl]=new RegExp(H[Wl],"g");var w1="$1$2$3",TI=Fe++;H[TI]="^\\s*("+H[co]+")\\s+-\\s+("+H[co]+")\\s*$";var NI=Fe++;H[NI]="^\\s*("+H[qa]+")\\s+-\\s+("+H[qa]+")\\s*$";var vI=Fe++;H[vI]="(<|>)?=?\\s*\\*";for(vs=0;vsYm)return null;var n=e.loose?it[nh]:it[eh];if(!n.test(t))return null;try{return new Be(t,e)}catch{return null}}Ce.valid=O1;function O1(t,e){var n=fo(t,e);return n?n.version:null}Ce.clean=L1;function L1(t,e){var n=fo(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null}Ce.SemVer=Be;function Be(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Be){if(t.loose===e.loose)return t;t=t.version}else if(typeof t!="string")throw new TypeError("Invalid Version: "+t);if(t.length>Ym)throw new TypeError("version is longer than "+Ym+" characters");if(!(this instanceof Be))return new Be(t,e);Ze("SemVer",t,e),this.options=e,this.loose=!!e.loose;var n=t.trim().match(e.loose?it[nh]:it[eh]);if(!n)throw new TypeError("Invalid Version: "+t);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>_f||this.major<0)throw new TypeError("Invalid major version");if(this.minor>_f||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>_f||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(function(r){if(/^[0-9]+$/.test(r)){var i=+r;if(i>=0&&i<_f)return i}return r}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}Be.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version};Be.prototype.toString=function(){return this.version};Be.prototype.compare=function(t){return Ze("SemVer.compare",this.version,this.options,t),t instanceof Be||(t=new Be(t,this.options)),this.compareMain(t)||this.comparePre(t)};Be.prototype.compareMain=function(t){return t instanceof Be||(t=new Be(t,this.options)),Ba(this.major,t.major)||Ba(this.minor,t.minor)||Ba(this.patch,t.patch)};Be.prototype.comparePre=function(t){if(t instanceof Be||(t=new Be(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;var e=0;do{var n=this.prerelease[e],r=t.prerelease[e];if(Ze("prerelease compare",e,n,r),n===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(n===void 0)return-1;if(n===r)continue;return Ba(n,r)}while(++e)};Be.prototype.inc=function(t,e){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",e);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",e);break;case"prepatch":this.prerelease.length=0,this.inc("patch",e),this.inc("pre",e);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",e),this.inc("pre",e);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{for(var n=this.prerelease.length;--n>=0;)typeof this.prerelease[n]=="number"&&(this.prerelease[n]++,n=-2);n===-1&&this.prerelease.push(0)}e&&(this.prerelease[0]===e?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error("invalid increment argument: "+t)}return this.format(),this.raw=this.version,this};Ce.inc=D1;function D1(t,e,n,r){typeof n=="string"&&(r=n,n=void 0);try{return new Be(t,n).inc(e,r).version}catch{return null}}Ce.diff=k1;function k1(t,e){if(sh(t,e))return null;var n=fo(t),r=fo(e),i="";if(n.prerelease.length||r.prerelease.length){i="pre";var s="prerelease"}for(var o in n)if((o==="major"||o==="minor"||o==="patch")&&n[o]!==r[o])return i+o;return s}Ce.compareIdentifiers=Ba;var PI=/^[0-9]+$/;function Ba(t,e){var n=PI.test(t),r=PI.test(e);return n&&r&&(t=+t,e=+e),t===e?0:n&&!r?-1:r&&!n?1:t0}Ce.lt=If;function If(t,e,n){return ji(t,e,n)<0}Ce.eq=sh;function sh(t,e,n){return ji(t,e,n)===0}Ce.neq=II;function II(t,e,n){return ji(t,e,n)!==0}Ce.gte=oh;function oh(t,e,n){return ji(t,e,n)>=0}Ce.lte=ah;function ah(t,e,n){return ji(t,e,n)<=0}Ce.cmp=Sf;function Sf(t,e,n,r){switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t===n;case"!==":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t!==n;case"":case"=":case"==":return sh(t,n,r);case"!=":return II(t,n,r);case">":return Hl(t,n,r);case">=":return oh(t,n,r);case"<":return If(t,n,r);case"<=":return ah(t,n,r);default:throw new TypeError("Invalid operator: "+e)}}Ce.Comparator=gr;function gr(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof gr){if(t.loose===!!e.loose)return t;t=t.value}if(!(this instanceof gr))return new gr(t,e);Ze("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===Yl?this.value="":this.value=this.operator+this.semver.version,Ze("comp",this)}var Yl={};gr.prototype.parse=function(t){var e=this.options.loose?it[rh]:it[ih],n=t.match(e);if(!n)throw new TypeError("Invalid comparator: "+t);this.operator=n[1],this.operator==="="&&(this.operator=""),n[2]?this.semver=new Be(n[2],this.options.loose):this.semver=Yl};gr.prototype.toString=function(){return this.value};gr.prototype.test=function(t){return Ze("Comparator.test",t,this.options.loose),this.semver===Yl?!0:(typeof t=="string"&&(t=new Be(t,this.options)),Sf(t,this.operator,this.semver,this.options))};gr.prototype.intersects=function(t,e){if(!(t instanceof gr))throw new TypeError("a Comparator is required");(!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1});var n;if(this.operator==="")return n=new Tt(t.value,e),Cf(this.value,n,e);if(t.operator==="")return n=new Tt(this.value,e),Cf(t.semver,n,e);var r=(this.operator===">="||this.operator===">")&&(t.operator===">="||t.operator===">"),i=(this.operator==="<="||this.operator==="<")&&(t.operator==="<="||t.operator==="<"),s=this.semver.version===t.semver.version,o=(this.operator===">="||this.operator==="<=")&&(t.operator===">="||t.operator==="<="),a=Sf(this.semver,"<",t.semver,e)&&(this.operator===">="||this.operator===">")&&(t.operator==="<="||t.operator==="<"),l=Sf(this.semver,">",t.semver,e)&&(this.operator==="<="||this.operator==="<")&&(t.operator===">="||t.operator===">");return r||i||s&&o||a||l};Ce.Range=Tt;function Tt(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Tt)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new Tt(t.raw,e);if(t instanceof gr)return new Tt(t.value,e);if(!(this instanceof Tt))return new Tt(t,e);if(this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease,this.raw=t,this.set=t.split(/\s*\|\|\s*/).map(function(n){return this.parseRange(n.trim())},this).filter(function(n){return n.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+t);this.format()}Tt.prototype.format=function(){return this.range=this.set.map(function(t){return t.join(" ").trim()}).join("||").trim(),this.range};Tt.prototype.toString=function(){return this.range};Tt.prototype.parseRange=function(t){var e=this.options.loose;t=t.trim();var n=e?it[NI]:it[TI];t=t.replace(n,Z1),Ze("hyphen replace",t),t=t.replace(it[Wl],w1),Ze("comparator trim",t,it[Wl]),t=t.replace(it[Nf],x1),t=t.replace(it[Pf],E1),t=t.split(/\s+/).join(" ");var r=e?it[rh]:it[ih],i=t.split(" ").map(function(s){return H1(s,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(i=i.filter(function(s){return!!s.match(r)})),i=i.map(function(s){return new gr(s,this.options)},this),i};Tt.prototype.intersects=function(t,e){if(!(t instanceof Tt))throw new TypeError("a Range is required");return this.set.some(function(n){return n.every(function(r){return t.set.some(function(i){return i.every(function(s){return r.intersects(s,e)})})})})};Ce.toComparators=W1;function W1(t,e){return new Tt(t,e).set.map(function(n){return n.map(function(r){return r.value}).join(" ").trim().split(" ")})}function H1(t,e){return Ze("comp",t,e),t=$1(t,e),Ze("caret",t),t=Y1(t,e),Ze("tildes",t),t=X1(t,e),Ze("xrange",t),t=J1(t,e),Ze("stars",t),t}function wn(t){return!t||t.toLowerCase()==="x"||t==="*"}function Y1(t,e){return t.trim().split(/\s+/).map(function(n){return K1(n,e)}).join(" ")}function K1(t,e){var n=e.loose?it[_I]:it[gI];return t.replace(n,function(r,i,s,o,a){Ze("tilde",t,r,i,s,o,a);var l;return wn(i)?l="":wn(s)?l=">="+i+".0.0 <"+(+i+1)+".0.0":wn(o)?l=">="+i+"."+s+".0 <"+i+"."+(+s+1)+".0":a?(Ze("replaceTilde pr",a),l=">="+i+"."+s+"."+o+"-"+a+" <"+i+"."+(+s+1)+".0"):l=">="+i+"."+s+"."+o+" <"+i+"."+(+s+1)+".0",Ze("tilde return",l),l})}function $1(t,e){return t.trim().split(/\s+/).map(function(n){return z1(n,e)}).join(" ")}function z1(t,e){Ze("caret",t,e);var n=e.loose?it[bI]:it[yI];return t.replace(n,function(r,i,s,o,a){Ze("caret",t,r,i,s,o,a);var l;return wn(i)?l="":wn(s)?l=">="+i+".0.0 <"+(+i+1)+".0.0":wn(o)?i==="0"?l=">="+i+"."+s+".0 <"+i+"."+(+s+1)+".0":l=">="+i+"."+s+".0 <"+(+i+1)+".0.0":a?(Ze("replaceCaret pr",a),i==="0"?s==="0"?l=">="+i+"."+s+"."+o+"-"+a+" <"+i+"."+s+"."+(+o+1):l=">="+i+"."+s+"."+o+"-"+a+" <"+i+"."+(+s+1)+".0":l=">="+i+"."+s+"."+o+"-"+a+" <"+(+i+1)+".0.0"):(Ze("no pr"),i==="0"?s==="0"?l=">="+i+"."+s+"."+o+" <"+i+"."+s+"."+(+o+1):l=">="+i+"."+s+"."+o+" <"+i+"."+(+s+1)+".0":l=">="+i+"."+s+"."+o+" <"+(+i+1)+".0.0"),Ze("caret return",l),l})}function X1(t,e){return Ze("replaceXRanges",t,e),t.split(/\s+/).map(function(n){return Q1(n,e)}).join(" ")}function Q1(t,e){t=t.trim();var n=e.loose?it[mI]:it[dI];return t.replace(n,function(r,i,s,o,a,l){Ze("xRange",t,r,i,s,o,a,l);var u=wn(s),c=u||wn(o),f=c||wn(a),m=f;return i==="="&&m&&(i=""),u?i===">"||i==="<"?r="<0.0.0":r="*":i&&m?(c&&(o=0),a=0,i===">"?(i=">=",c?(s=+s+1,o=0,a=0):(o=+o+1,a=0)):i==="<="&&(i="<",c?s=+s+1:o=+o+1),r=i+s+"."+o+"."+a):c?r=">="+s+".0.0 <"+(+s+1)+".0.0":f&&(r=">="+s+"."+o+".0 <"+s+"."+(+o+1)+".0"),Ze("xRange return",r),r})}function J1(t,e){return Ze("replaceStars",t,e),t.trim().replace(it[vI],"")}function Z1(t,e,n,r,i,s,o,a,l,u,c,f,m){return wn(n)?e="":wn(r)?e=">="+n+".0.0":wn(i)?e=">="+n+"."+r+".0":e=">="+e,wn(l)?a="":wn(u)?a="<"+(+l+1)+".0.0":wn(c)?a="<"+l+"."+(+u+1)+".0":f?a="<="+l+"."+u+"."+c+"-"+f:a="<="+a,(e+" "+a).trim()}Tt.prototype.test=function(t){if(!t)return!1;typeof t=="string"&&(t=new Be(t,this.options));for(var e=0;e0){var i=t[r].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}Ce.satisfies=Cf;function Cf(t,e,n){try{e=new Tt(e,n)}catch{return!1}return e.test(t)}Ce.maxSatisfying=tM;function tM(t,e,n){var r=null,i=null;try{var s=new Tt(e,n)}catch{return null}return t.forEach(function(o){s.test(o)&&(!r||i.compare(o)===-1)&&(r=o,i=new Be(r,n))}),r}Ce.minSatisfying=nM;function nM(t,e,n){var r=null,i=null;try{var s=new Tt(e,n)}catch{return null}return t.forEach(function(o){s.test(o)&&(!r||i.compare(o)===1)&&(r=o,i=new Be(r,n))}),r}Ce.minVersion=rM;function rM(t,e){t=new Tt(t,e);var n=new Be("0.0.0");if(t.test(n)||(n=new Be("0.0.0-0"),t.test(n)))return n;n=null;for(var r=0;r":o.prerelease.length===0?o.patch++:o.prerelease.push(0),o.raw=o.format();case"":case">=":(!n||Hl(n,o))&&(n=o);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+s.operator)}})}return n&&t.test(n)?n:null}Ce.validRange=iM;function iM(t,e){try{return new Tt(t,e).range||"*"}catch{return null}}Ce.ltr=sM;function sM(t,e,n){return lh(t,e,"<",n)}Ce.gtr=oM;function oM(t,e,n){return lh(t,e,">",n)}Ce.outside=lh;function lh(t,e,n,r){t=new Be(t,r),e=new Tt(e,r);var i,s,o,a,l;switch(n){case">":i=Hl,s=ah,o=If,a=">",l=">=";break;case"<":i=If,s=oh,o=Hl,a="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Cf(t,e,r))return!1;for(var u=0;u=0.0.0")),f=f||d,m=m||d,i(d.semver,f.semver,r)?f=d:o(d.semver,m.semver,r)&&(m=d)}),f.operator===a||f.operator===l||(!m.operator||m.operator===a)&&s(t,m.semver))return!1;if(m.operator===l&&o(t,m.semver))return!1}return!0}Ce.prerelease=aM;function aM(t,e){var n=fo(t,e);return n&&n.prerelease.length?n.prerelease:null}Ce.intersects=lM;function lM(t,e,n){return t=new Tt(t,n),e=new Tt(e,n),t.intersects(e)}Ce.coerce=uM;function uM(t){if(t instanceof Be)return t;if(typeof t!="string")return null;var e=t.match(it[hI]);return e==null?null:fo(e[1]+"."+(e[2]||"0")+"."+(e[3]||"0"))}});var Rf=K((jte,OI)=>{"use strict";function Qt(t){this.__parent=t,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}Qt.prototype.clone_empty=function(){var t=new Qt(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t};Qt.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]};Qt.prototype.has_match=function(t){for(var e=this.__items.length-1;e>=0;e--)if(this.__items[e].match(t))return!0;return!1};Qt.prototype.set_indent=function(t,e){this.is_empty()&&(this.__indent_count=t||0,this.__alignment_count=e||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))};Qt.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)};Qt.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count};Qt.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,t.__items[0]===" "&&(t.__items.splice(0,1),t.__character_count-=1),!0}return!1};Qt.prototype.is_empty=function(){return this.__items.length===0};Qt.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]};Qt.prototype.push=function(t){this.__items.push(t);var e=t.lastIndexOf(` -`);e!==-1?this.__character_count=t.length-e:this.__character_count+=t.length};Qt.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t};Qt.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)};Qt.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)};Qt.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1};Qt.prototype.toString=function(){var t="";return this.is_empty()?this.__parent.indent_empty_lines&&(t=this.__parent.get_indent_string(this.__indent_count)):(t=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),t+=this.__items.join("")),t};function $l(t,e){this.__cache=[""],this.__indent_size=t.indent_size,this.__indent_string=t.indent_char,t.indent_with_tabs||(this.__indent_string=new Array(t.indent_size+1).join(t.indent_char)),e=e||"",t.indent_level>0&&(e=new Array(t.indent_level+1).join(this.__indent_string)),this.__base_string=e,this.__base_string_length=e.length}$l.prototype.get_indent_size=function(t,e){var n=this.__base_string_length;return e=e||0,t<0&&(n=0),n+=t*this.__indent_size,n+=e,n};$l.prototype.get_indent_string=function(t,e){var n=this.__base_string;return e=e||0,t<0&&(t=0,n=""),e+=t*this.__indent_size,this.__ensure_cache(e),n+=this.__cache[e],n};$l.prototype.__ensure_cache=function(t){for(;t>=this.__cache.length;)this.__add_column()};$l.prototype.__add_column=function(){var t=this.__cache.length,e=0,n="";this.__indent_size&&t>=this.__indent_size&&(e=Math.floor(t/this.__indent_size),t-=e*this.__indent_size,n=new Array(e+1).join(this.__indent_string)),t&&(n+=new Array(t+1).join(" ")),this.__cache.push(n)};function Jt(t,e){this.__indent_cache=new $l(t,e),this.raw=!1,this._end_with_newline=t.end_with_newline,this.indent_size=t.indent_size,this.wrap_line_length=t.wrap_line_length,this.indent_empty_lines=t.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new Qt(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}Jt.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)};Jt.prototype.get_line_number=function(){return this.__lines.length};Jt.prototype.get_indent_string=function(t,e){return this.__indent_cache.get_indent_string(t,e)};Jt.prototype.get_indent_size=function(t,e){return this.__indent_cache.get_indent_size(t,e)};Jt.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()};Jt.prototype.add_new_line=function(t){return this.is_empty()||!t&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)};Jt.prototype.get_code=function(t){this.trim(!0);var e=this.current_line.pop();e&&(e[e.length-1]===` +`}};Rn._defineProperty(Aa,"defaults",Bv);af.Document=Aa;af.defaultOptions=xL;af.scalarOptions=EL});var Hv=K(Wv=>{"use strict";var Sm=cv(),so=Uv(),VL=nf(),qL=hs(),BL=Xc();Sa();function jL(t,e=!0,n){n===void 0&&typeof e=="string"&&(n=e,e=!0);let r=Object.assign({},so.Document.defaults[so.defaultOptions.version],so.defaultOptions);return new VL.Schema(r).createNode(t,e,n)}var Ol=class extends so.Document{constructor(e){super(Object.assign({},so.defaultOptions,e))}};function UL(t,e){let n=[],r;for(let i of Sm.parse(t)){let s=new Ol(e);s.parse(i,r),n.push(s),r=s}return n}function Gv(t,e){let n=Sm.parse(t),r=new Ol(e).parse(n[0]);if(n.length>1){let i="Source contains multiple documents; please use YAML.parseAllDocuments()";r.errors.unshift(new qL.YAMLSemanticError(n[1],i))}return r}function GL(t,e){let n=Gv(t,e);if(n.warnings.forEach(r=>BL.warn(r)),n.errors.length>0)throw n.errors[0];return n.toJSON()}function WL(t,e){let n=new Ol(e);return n.contents=t,String(n)}var HL={createNode:jL,defaultOptions:so.defaultOptions,Document:Ol,parse:GL,parseAllDocuments:UL,parseCST:Sm.parse,parseDocument:Gv,scalarOptions:so.scalarOptions,stringify:WL};Wv.YAML=HL});var mi=K((_J,Yv)=>{Yv.exports=Hv().YAML});var Kv=K(An=>{"use strict";var Zn=Sa(),YL=nf();hs();Xc();An.Alias=Zn.Alias;An.Collection=Zn.Collection;An.Merge=Zn.Merge;An.Node=Zn.Node;An.Pair=Zn.Pair;An.Scalar=Zn.Scalar;An.YAMLMap=Zn.YAMLMap;An.YAMLSeq=Zn.YAMLSeq;An.binaryOptions=Zn.binaryOptions;An.boolOptions=Zn.boolOptions;An.intOptions=Zn.intOptions;An.nullOptions=Zn.nullOptions;An.strOptions=Zn.strOptions;An.Schema=YL.Schema});var uh=K((Ce,CI)=>{Ce=CI.exports=Be;var Ze;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?Ze=function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)}:Ze=function(){};Ce.SEMVER_SPEC_VERSION="2.0.0";var Ym=256,yf=Number.MAX_SAFE_INTEGER||9007199254740991,Km=16,it=Ce.re=[],H=Ce.src=[],Fe=0,Ma=Fe++;H[Ma]="0|[1-9]\\d*";var Fa=Fe++;H[Fa]="[0-9]+";var $m=Fe++;H[$m]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var fI=Fe++;H[fI]="("+H[Ma]+")\\.("+H[Ma]+")\\.("+H[Ma]+")";var pI=Fe++;H[pI]="("+H[Fa]+")\\.("+H[Fa]+")\\.("+H[Fa]+")";var zm=Fe++;H[zm]="(?:"+H[Ma]+"|"+H[$m]+")";var Xm=Fe++;H[Xm]="(?:"+H[Fa]+"|"+H[$m]+")";var Qm=Fe++;H[Qm]="(?:-("+H[zm]+"(?:\\."+H[zm]+")*))";var Jm=Fe++;H[Jm]="(?:-?("+H[Xm]+"(?:\\."+H[Xm]+")*))";var Zm=Fe++;H[Zm]="[0-9A-Za-z-]+";var Wl=Fe++;H[Wl]="(?:\\+("+H[Zm]+"(?:\\."+H[Zm]+")*))";var eh=Fe++,dI="v?"+H[fI]+H[Qm]+"?"+H[Wl]+"?";H[eh]="^"+dI+"$";var th="[v=\\s]*"+H[pI]+H[Jm]+"?"+H[Wl]+"?",nh=Fe++;H[nh]="^"+th+"$";var Va=Fe++;H[Va]="((?:<|>)?=?)";var bf=Fe++;H[bf]=H[Fa]+"|x|X|\\*";var Tf=Fe++;H[Tf]=H[Ma]+"|x|X|\\*";var co=Fe++;H[co]="[v=\\s]*("+H[Tf]+")(?:\\.("+H[Tf]+")(?:\\.("+H[Tf]+")(?:"+H[Qm]+")?"+H[Wl]+"?)?)?";var qa=Fe++;H[qa]="[v=\\s]*("+H[bf]+")(?:\\.("+H[bf]+")(?:\\.("+H[bf]+")(?:"+H[Jm]+")?"+H[Wl]+"?)?)?";var mI=Fe++;H[mI]="^"+H[Va]+"\\s*"+H[co]+"$";var hI=Fe++;H[hI]="^"+H[Va]+"\\s*"+H[qa]+"$";var gI=Fe++;H[gI]="(?:^|[^\\d])(\\d{1,"+Km+"})(?:\\.(\\d{1,"+Km+"}))?(?:\\.(\\d{1,"+Km+"}))?(?:$|[^\\d])";var Nf=Fe++;H[Nf]="(?:~>?)";var vf=Fe++;H[vf]="(\\s*)"+H[Nf]+"\\s+";it[vf]=new RegExp(H[vf],"g");var O1="$1~",_I=Fe++;H[_I]="^"+H[Nf]+H[co]+"$";var yI=Fe++;H[yI]="^"+H[Nf]+H[qa]+"$";var Pf=Fe++;H[Pf]="(?:\\^)";var If=Fe++;H[If]="(\\s*)"+H[Pf]+"\\s+";it[If]=new RegExp(H[If],"g");var L1="$1^",bI=Fe++;H[bI]="^"+H[Pf]+H[co]+"$";var TI=Fe++;H[TI]="^"+H[Pf]+H[qa]+"$";var rh=Fe++;H[rh]="^"+H[Va]+"\\s*("+th+")$|^$";var ih=Fe++;H[ih]="^"+H[Va]+"\\s*("+dI+")$|^$";var Hl=Fe++;H[Hl]="(\\s*)"+H[Va]+"\\s*("+th+"|"+H[co]+")";it[Hl]=new RegExp(H[Hl],"g");var D1="$1$2$3",NI=Fe++;H[NI]="^\\s*("+H[co]+")\\s+-\\s+("+H[co]+")\\s*$";var vI=Fe++;H[vI]="^\\s*("+H[qa]+")\\s+-\\s+("+H[qa]+")\\s*$";var PI=Fe++;H[PI]="(<|>)?=?\\s*\\*";for(vs=0;vsYm)return null;var n=e.loose?it[nh]:it[eh];if(!n.test(t))return null;try{return new Be(t,e)}catch{return null}}Ce.valid=k1;function k1(t,e){var n=fo(t,e);return n?n.version:null}Ce.clean=M1;function M1(t,e){var n=fo(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null}Ce.SemVer=Be;function Be(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Be){if(t.loose===e.loose)return t;t=t.version}else if(typeof t!="string")throw new TypeError("Invalid Version: "+t);if(t.length>Ym)throw new TypeError("version is longer than "+Ym+" characters");if(!(this instanceof Be))return new Be(t,e);Ze("SemVer",t,e),this.options=e,this.loose=!!e.loose;var n=t.trim().match(e.loose?it[nh]:it[eh]);if(!n)throw new TypeError("Invalid Version: "+t);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>yf||this.major<0)throw new TypeError("Invalid major version");if(this.minor>yf||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>yf||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(function(r){if(/^[0-9]+$/.test(r)){var i=+r;if(i>=0&&i=0;)typeof this.prerelease[n]=="number"&&(this.prerelease[n]++,n=-2);n===-1&&this.prerelease.push(0)}e&&(this.prerelease[0]===e?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error("invalid increment argument: "+t)}return this.format(),this.raw=this.version,this};Ce.inc=F1;function F1(t,e,n,r){typeof n=="string"&&(r=n,n=void 0);try{return new Be(t,n).inc(e,r).version}catch{return null}}Ce.diff=V1;function V1(t,e){if(sh(t,e))return null;var n=fo(t),r=fo(e),i="";if(n.prerelease.length||r.prerelease.length){i="pre";var s="prerelease"}for(var o in n)if((o==="major"||o==="minor"||o==="patch")&&n[o]!==r[o])return i+o;return s}Ce.compareIdentifiers=Ba;var II=/^[0-9]+$/;function Ba(t,e){var n=II.test(t),r=II.test(e);return n&&r&&(t=+t,e=+e),t===e?0:n&&!r?-1:r&&!n?1:t0}Ce.lt=Sf;function Sf(t,e,n){return ji(t,e,n)<0}Ce.eq=sh;function sh(t,e,n){return ji(t,e,n)===0}Ce.neq=SI;function SI(t,e,n){return ji(t,e,n)!==0}Ce.gte=oh;function oh(t,e,n){return ji(t,e,n)>=0}Ce.lte=ah;function ah(t,e,n){return ji(t,e,n)<=0}Ce.cmp=Cf;function Cf(t,e,n,r){switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t===n;case"!==":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t!==n;case"":case"=":case"==":return sh(t,n,r);case"!=":return SI(t,n,r);case">":return Yl(t,n,r);case">=":return oh(t,n,r);case"<":return Sf(t,n,r);case"<=":return ah(t,n,r);default:throw new TypeError("Invalid operator: "+e)}}Ce.Comparator=_r;function _r(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof _r){if(t.loose===!!e.loose)return t;t=t.value}if(!(this instanceof _r))return new _r(t,e);Ze("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===Kl?this.value="":this.value=this.operator+this.semver.version,Ze("comp",this)}var Kl={};_r.prototype.parse=function(t){var e=this.options.loose?it[rh]:it[ih],n=t.match(e);if(!n)throw new TypeError("Invalid comparator: "+t);this.operator=n[1],this.operator==="="&&(this.operator=""),n[2]?this.semver=new Be(n[2],this.options.loose):this.semver=Kl};_r.prototype.toString=function(){return this.value};_r.prototype.test=function(t){return Ze("Comparator.test",t,this.options.loose),this.semver===Kl?!0:(typeof t=="string"&&(t=new Be(t,this.options)),Cf(t,this.operator,this.semver,this.options))};_r.prototype.intersects=function(t,e){if(!(t instanceof _r))throw new TypeError("a Comparator is required");(!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1});var n;if(this.operator==="")return n=new Tt(t.value,e),Rf(this.value,n,e);if(t.operator==="")return n=new Tt(this.value,e),Rf(t.semver,n,e);var r=(this.operator===">="||this.operator===">")&&(t.operator===">="||t.operator===">"),i=(this.operator==="<="||this.operator==="<")&&(t.operator==="<="||t.operator==="<"),s=this.semver.version===t.semver.version,o=(this.operator===">="||this.operator==="<=")&&(t.operator===">="||t.operator==="<="),a=Cf(this.semver,"<",t.semver,e)&&(this.operator===">="||this.operator===">")&&(t.operator==="<="||t.operator==="<"),l=Cf(this.semver,">",t.semver,e)&&(this.operator==="<="||this.operator==="<")&&(t.operator===">="||t.operator===">");return r||i||s&&o||a||l};Ce.Range=Tt;function Tt(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Tt)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new Tt(t.raw,e);if(t instanceof _r)return new Tt(t.value,e);if(!(this instanceof Tt))return new Tt(t,e);if(this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease,this.raw=t,this.set=t.split(/\s*\|\|\s*/).map(function(n){return this.parseRange(n.trim())},this).filter(function(n){return n.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+t);this.format()}Tt.prototype.format=function(){return this.range=this.set.map(function(t){return t.join(" ").trim()}).join("||").trim(),this.range};Tt.prototype.toString=function(){return this.range};Tt.prototype.parseRange=function(t){var e=this.options.loose;t=t.trim();var n=e?it[vI]:it[NI];t=t.replace(n,nM),Ze("hyphen replace",t),t=t.replace(it[Hl],D1),Ze("comparator trim",t,it[Hl]),t=t.replace(it[vf],O1),t=t.replace(it[If],L1),t=t.split(/\s+/).join(" ");var r=e?it[rh]:it[ih],i=t.split(" ").map(function(s){return $1(s,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(i=i.filter(function(s){return!!s.match(r)})),i=i.map(function(s){return new _r(s,this.options)},this),i};Tt.prototype.intersects=function(t,e){if(!(t instanceof Tt))throw new TypeError("a Range is required");return this.set.some(function(n){return n.every(function(r){return t.set.some(function(i){return i.every(function(s){return r.intersects(s,e)})})})})};Ce.toComparators=K1;function K1(t,e){return new Tt(t,e).set.map(function(n){return n.map(function(r){return r.value}).join(" ").trim().split(" ")})}function $1(t,e){return Ze("comp",t,e),t=Q1(t,e),Ze("caret",t),t=z1(t,e),Ze("tildes",t),t=Z1(t,e),Ze("xrange",t),t=tM(t,e),Ze("stars",t),t}function wn(t){return!t||t.toLowerCase()==="x"||t==="*"}function z1(t,e){return t.trim().split(/\s+/).map(function(n){return X1(n,e)}).join(" ")}function X1(t,e){var n=e.loose?it[yI]:it[_I];return t.replace(n,function(r,i,s,o,a){Ze("tilde",t,r,i,s,o,a);var l;return wn(i)?l="":wn(s)?l=">="+i+".0.0 <"+(+i+1)+".0.0":wn(o)?l=">="+i+"."+s+".0 <"+i+"."+(+s+1)+".0":a?(Ze("replaceTilde pr",a),l=">="+i+"."+s+"."+o+"-"+a+" <"+i+"."+(+s+1)+".0"):l=">="+i+"."+s+"."+o+" <"+i+"."+(+s+1)+".0",Ze("tilde return",l),l})}function Q1(t,e){return t.trim().split(/\s+/).map(function(n){return J1(n,e)}).join(" ")}function J1(t,e){Ze("caret",t,e);var n=e.loose?it[TI]:it[bI];return t.replace(n,function(r,i,s,o,a){Ze("caret",t,r,i,s,o,a);var l;return wn(i)?l="":wn(s)?l=">="+i+".0.0 <"+(+i+1)+".0.0":wn(o)?i==="0"?l=">="+i+"."+s+".0 <"+i+"."+(+s+1)+".0":l=">="+i+"."+s+".0 <"+(+i+1)+".0.0":a?(Ze("replaceCaret pr",a),i==="0"?s==="0"?l=">="+i+"."+s+"."+o+"-"+a+" <"+i+"."+s+"."+(+o+1):l=">="+i+"."+s+"."+o+"-"+a+" <"+i+"."+(+s+1)+".0":l=">="+i+"."+s+"."+o+"-"+a+" <"+(+i+1)+".0.0"):(Ze("no pr"),i==="0"?s==="0"?l=">="+i+"."+s+"."+o+" <"+i+"."+s+"."+(+o+1):l=">="+i+"."+s+"."+o+" <"+i+"."+(+s+1)+".0":l=">="+i+"."+s+"."+o+" <"+(+i+1)+".0.0"),Ze("caret return",l),l})}function Z1(t,e){return Ze("replaceXRanges",t,e),t.split(/\s+/).map(function(n){return eM(n,e)}).join(" ")}function eM(t,e){t=t.trim();var n=e.loose?it[hI]:it[mI];return t.replace(n,function(r,i,s,o,a,l){Ze("xRange",t,r,i,s,o,a,l);var u=wn(s),c=u||wn(o),f=c||wn(a),m=f;return i==="="&&m&&(i=""),u?i===">"||i==="<"?r="<0.0.0":r="*":i&&m?(c&&(o=0),a=0,i===">"?(i=">=",c?(s=+s+1,o=0,a=0):(o=+o+1,a=0)):i==="<="&&(i="<",c?s=+s+1:o=+o+1),r=i+s+"."+o+"."+a):c?r=">="+s+".0.0 <"+(+s+1)+".0.0":f&&(r=">="+s+"."+o+".0 <"+s+"."+(+o+1)+".0"),Ze("xRange return",r),r})}function tM(t,e){return Ze("replaceStars",t,e),t.trim().replace(it[PI],"")}function nM(t,e,n,r,i,s,o,a,l,u,c,f,m){return wn(n)?e="":wn(r)?e=">="+n+".0.0":wn(i)?e=">="+n+"."+r+".0":e=">="+e,wn(l)?a="":wn(u)?a="<"+(+l+1)+".0.0":wn(c)?a="<"+l+"."+(+u+1)+".0":f?a="<="+l+"."+u+"."+c+"-"+f:a="<="+a,(e+" "+a).trim()}Tt.prototype.test=function(t){if(!t)return!1;typeof t=="string"&&(t=new Be(t,this.options));for(var e=0;e0){var i=t[r].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}Ce.satisfies=Rf;function Rf(t,e,n){try{e=new Tt(e,n)}catch{return!1}return e.test(t)}Ce.maxSatisfying=iM;function iM(t,e,n){var r=null,i=null;try{var s=new Tt(e,n)}catch{return null}return t.forEach(function(o){s.test(o)&&(!r||i.compare(o)===-1)&&(r=o,i=new Be(r,n))}),r}Ce.minSatisfying=sM;function sM(t,e,n){var r=null,i=null;try{var s=new Tt(e,n)}catch{return null}return t.forEach(function(o){s.test(o)&&(!r||i.compare(o)===1)&&(r=o,i=new Be(r,n))}),r}Ce.minVersion=oM;function oM(t,e){t=new Tt(t,e);var n=new Be("0.0.0");if(t.test(n)||(n=new Be("0.0.0-0"),t.test(n)))return n;n=null;for(var r=0;r":o.prerelease.length===0?o.patch++:o.prerelease.push(0),o.raw=o.format();case"":case">=":(!n||Yl(n,o))&&(n=o);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+s.operator)}})}return n&&t.test(n)?n:null}Ce.validRange=aM;function aM(t,e){try{return new Tt(t,e).range||"*"}catch{return null}}Ce.ltr=lM;function lM(t,e,n){return lh(t,e,"<",n)}Ce.gtr=uM;function uM(t,e,n){return lh(t,e,">",n)}Ce.outside=lh;function lh(t,e,n,r){t=new Be(t,r),e=new Tt(e,r);var i,s,o,a,l;switch(n){case">":i=Yl,s=ah,o=Sf,a=">",l=">=";break;case"<":i=Sf,s=oh,o=Yl,a="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Rf(t,e,r))return!1;for(var u=0;u=0.0.0")),f=f||p,m=m||p,i(p.semver,f.semver,r)?f=p:o(p.semver,m.semver,r)&&(m=p)}),f.operator===a||f.operator===l||(!m.operator||m.operator===a)&&s(t,m.semver))return!1;if(m.operator===l&&o(t,m.semver))return!1}return!0}Ce.prerelease=cM;function cM(t,e){var n=fo(t,e);return n&&n.prerelease.length?n.prerelease:null}Ce.intersects=fM;function fM(t,e,n){return t=new Tt(t,n),e=new Tt(e,n),t.intersects(e)}Ce.coerce=pM;function pM(t){if(t instanceof Be)return t;if(typeof t!="string")return null;var e=t.match(it[gI]);return e==null?null:fo(e[1]+"."+(e[2]||"0")+"."+(e[3]||"0"))}});var Af=K((ene,DI)=>{"use strict";function Qt(t){this.__parent=t,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}Qt.prototype.clone_empty=function(){var t=new Qt(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t};Qt.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]};Qt.prototype.has_match=function(t){for(var e=this.__items.length-1;e>=0;e--)if(this.__items[e].match(t))return!0;return!1};Qt.prototype.set_indent=function(t,e){this.is_empty()&&(this.__indent_count=t||0,this.__alignment_count=e||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))};Qt.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)};Qt.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count};Qt.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,t.__items[0]===" "&&(t.__items.splice(0,1),t.__character_count-=1),!0}return!1};Qt.prototype.is_empty=function(){return this.__items.length===0};Qt.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]};Qt.prototype.push=function(t){this.__items.push(t);var e=t.lastIndexOf(` +`);e!==-1?this.__character_count=t.length-e:this.__character_count+=t.length};Qt.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t};Qt.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)};Qt.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)};Qt.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1};Qt.prototype.toString=function(){var t="";return this.is_empty()?this.__parent.indent_empty_lines&&(t=this.__parent.get_indent_string(this.__indent_count)):(t=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),t+=this.__items.join("")),t};function zl(t,e){this.__cache=[""],this.__indent_size=t.indent_size,this.__indent_string=t.indent_char,t.indent_with_tabs||(this.__indent_string=new Array(t.indent_size+1).join(t.indent_char)),e=e||"",t.indent_level>0&&(e=new Array(t.indent_level+1).join(this.__indent_string)),this.__base_string=e,this.__base_string_length=e.length}zl.prototype.get_indent_size=function(t,e){var n=this.__base_string_length;return e=e||0,t<0&&(n=0),n+=t*this.__indent_size,n+=e,n};zl.prototype.get_indent_string=function(t,e){var n=this.__base_string;return e=e||0,t<0&&(t=0,n=""),e+=t*this.__indent_size,this.__ensure_cache(e),n+=this.__cache[e],n};zl.prototype.__ensure_cache=function(t){for(;t>=this.__cache.length;)this.__add_column()};zl.prototype.__add_column=function(){var t=this.__cache.length,e=0,n="";this.__indent_size&&t>=this.__indent_size&&(e=Math.floor(t/this.__indent_size),t-=e*this.__indent_size,n=new Array(e+1).join(this.__indent_string)),t&&(n+=new Array(t+1).join(" ")),this.__cache.push(n)};function Jt(t,e){this.__indent_cache=new zl(t,e),this.raw=!1,this._end_with_newline=t.end_with_newline,this.indent_size=t.indent_size,this.wrap_line_length=t.wrap_line_length,this.indent_empty_lines=t.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new Qt(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}Jt.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)};Jt.prototype.get_line_number=function(){return this.__lines.length};Jt.prototype.get_indent_string=function(t,e){return this.__indent_cache.get_indent_string(t,e)};Jt.prototype.get_indent_size=function(t,e){return this.__indent_cache.get_indent_size(t,e)};Jt.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()};Jt.prototype.add_new_line=function(t){return this.is_empty()||!t&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)};Jt.prototype.get_code=function(t){this.trim(!0);var e=this.current_line.pop();e&&(e[e.length-1]===` `&&(e=e.replace(/\n+$/g,"")),this.current_line.push(e)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join(` `);return t!==` -`&&(n=n.replace(/[\n]/g,t)),n};Jt.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()};Jt.prototype.set_indent=function(t,e){return t=t||0,e=e||0,this.next_line.set_indent(t,e),this.__lines.length>1?(this.current_line.set_indent(t,e),!0):(this.current_line.set_indent(),!1)};Jt.prototype.add_raw_token=function(t){for(var e=0;e1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null};Jt.prototype.just_added_newline=function(){return this.current_line.is_empty()};Jt.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()};Jt.prototype.ensure_empty_line_above=function(t,e){for(var n=this.__lines.length-2;n>=0;){var r=this.__lines[n];if(r.is_empty())break;if(r.item(0).indexOf(t)!==0&&r.item(-1)!==e){this.__lines.splice(n+1,0,new Qt(this)),this.previous_line=this.__lines[this.__lines.length-2];break}n--}};OI.exports.Output=Jt});var hh=K((Ute,LI)=>{"use strict";function mM(t,e,n,r){this.type=t,this.text=e,this.comments_before=null,this.newlines=n||0,this.whitespace_before=r||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}LI.exports.Token=mM});var _h=K(Ui=>{"use strict";var hM="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",DI="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",gh="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",kI="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",MI="(?:\\\\u[0-9a-fA-F]{4}|["+hM+gh+"])",gM="(?:\\\\u[0-9a-fA-F]{4}|["+DI+gh+kI+"])*";Ui.identifier=new RegExp(MI+gM,"g");Ui.identifierStart=new RegExp(MI);Ui.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+DI+gh+kI+"])+");Ui.newline=/[\n\r\u2028\u2029]/;Ui.lineBreak=new RegExp(`\r -|`+Ui.newline.source);Ui.allLineBreaks=new RegExp(Ui.lineBreak.source,"g")});var xf=K((Wte,Af)=>{"use strict";function Is(t,e){this.raw_options=FI(t,e),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}Is.prototype._get_array=function(t,e){var n=this.raw_options[t],r=e||[];return typeof n=="object"?n!==null&&typeof n.concat=="function"&&(r=n.concat()):typeof n=="string"&&(r=n.split(/[^a-zA-Z0-9_\/\-]+/)),r};Is.prototype._get_boolean=function(t,e){var n=this.raw_options[t],r=n===void 0?!!e:!!n;return r};Is.prototype._get_characters=function(t,e){var n=this.raw_options[t],r=e||"";return typeof n=="string"&&(r=n.replace(/\\r/,"\r").replace(/\\n/,` +`&&(n=n.replace(/[\n]/g,t)),n};Jt.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()};Jt.prototype.set_indent=function(t,e){return t=t||0,e=e||0,this.next_line.set_indent(t,e),this.__lines.length>1?(this.current_line.set_indent(t,e),!0):(this.current_line.set_indent(),!1)};Jt.prototype.add_raw_token=function(t){for(var e=0;e1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null};Jt.prototype.just_added_newline=function(){return this.current_line.is_empty()};Jt.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()};Jt.prototype.ensure_empty_line_above=function(t,e){for(var n=this.__lines.length-2;n>=0;){var r=this.__lines[n];if(r.is_empty())break;if(r.item(0).indexOf(t)!==0&&r.item(-1)!==e){this.__lines.splice(n+1,0,new Qt(this)),this.previous_line=this.__lines[this.__lines.length-2];break}n--}};DI.exports.Output=Jt});var hh=K((tne,kI)=>{"use strict";function yM(t,e,n,r){this.type=t,this.text=e,this.comments_before=null,this.newlines=n||0,this.whitespace_before=r||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}kI.exports.Token=yM});var _h=K(Ui=>{"use strict";var bM="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",MI="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",gh="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",FI="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",VI="(?:\\\\u[0-9a-fA-F]{4}|["+bM+gh+"])",TM="(?:\\\\u[0-9a-fA-F]{4}|["+MI+gh+FI+"])*";Ui.identifier=new RegExp(VI+TM,"g");Ui.identifierStart=new RegExp(VI);Ui.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+MI+gh+FI+"])+");Ui.newline=/[\n\r\u2028\u2029]/;Ui.lineBreak=new RegExp(`\r +|`+Ui.newline.source);Ui.allLineBreaks=new RegExp(Ui.lineBreak.source,"g")});var Ef=K((rne,xf)=>{"use strict";function Is(t,e){this.raw_options=qI(t,e),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}Is.prototype._get_array=function(t,e){var n=this.raw_options[t],r=e||[];return typeof n=="object"?n!==null&&typeof n.concat=="function"&&(r=n.concat()):typeof n=="string"&&(r=n.split(/[^a-zA-Z0-9_\/\-]+/)),r};Is.prototype._get_boolean=function(t,e){var n=this.raw_options[t],r=n===void 0?!!e:!!n;return r};Is.prototype._get_characters=function(t,e){var n=this.raw_options[t],r=e||"";return typeof n=="string"&&(r=n.replace(/\\r/,"\r").replace(/\\n/,` `).replace(/\\t/," ")),r};Is.prototype._get_number=function(t,e){var n=this.raw_options[t];e=parseInt(e,10),isNaN(e)&&(e=0);var r=parseInt(n,10);return isNaN(r)&&(r=e),r};Is.prototype._get_selection=function(t,e,n){var r=this._get_selection_list(t,e,n);if(r.length!==1)throw new Error("Invalid Option Value: The option '"+t+`' can only be one of the following values: `+e+` You passed in: '`+this.raw_options[t]+"'");return r[0]};Is.prototype._get_selection_list=function(t,e,n){if(!e||e.length===0)throw new Error("Selection list cannot be empty.");if(n=n||[e[0]],!this._is_valid_selection(n,e))throw new Error("Invalid Default Value!");var r=this._get_array(t,n);if(!this._is_valid_selection(r,e))throw new Error("Invalid Option Value: The option '"+t+`' can contain only the following values: `+e+` -You passed in: '`+this.raw_options[t]+"'");return r};Is.prototype._is_valid_selection=function(t,e){return t.length&&e.length&&!t.some(function(n){return e.indexOf(n)===-1})};function FI(t,e){var n={};t=VI(t);var r;for(r in t)r!==e&&(n[r]=t[r]);if(e&&t[e])for(r in t[e])n[r]=t[e][r];return n}function VI(t){var e={},n;for(n in t){var r=n.replace(/-/g,"_");e[r]=t[n]}return e}Af.exports.Options=Is;Af.exports.normalizeOpts=VI;Af.exports.mergeOpts=FI});var yh=K((Hte,jI)=>{"use strict";var qI=xf().Options,_M=["before-newline","after-newline","preserve-newline"];function BI(t){qI.call(this,t,"js");var e=this.raw_options.brace_style||null;e==="expand-strict"?this.raw_options.brace_style="expand":e==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var n=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var r=0;r{"use strict";var UI=RegExp.prototype.hasOwnProperty("sticky");function un(t){this.__input=t||"",this.__input_length=this.__input.length,this.__position=0}un.prototype.restart=function(){this.__position=0};un.prototype.back=function(){this.__position>0&&(this.__position-=1)};un.prototype.hasNext=function(){return this.__position=0&&t=0&&e=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t};GI.exports.InputScanner=un});var HI=K((Kte,WI)=>{"use strict";function po(t){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=t}po.prototype.restart=function(){this.__position=0};po.prototype.isEmpty=function(){return this.__tokens_length===0};po.prototype.hasNext=function(){return this.__position=0&&t{"use strict";function gi(t,e){this._input=t,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,e&&(this._starting_pattern=this._input.get_regexp(e._starting_pattern,!0),this._match_pattern=this._input.get_regexp(e._match_pattern,!0),this._until_pattern=this._input.get_regexp(e._until_pattern),this._until_after=e._until_after)}gi.prototype.read=function(){var t=this._input.read(this._starting_pattern);return(!this._starting_pattern||t)&&(t+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),t};gi.prototype.read_match=function(){return this._input.match(this._match_pattern)};gi.prototype.until_after=function(t){var e=this._create();return e._until_after=!0,e._until_pattern=this._input.get_regexp(t),e._update(),e};gi.prototype.until=function(t){var e=this._create();return e._until_after=!1,e._until_pattern=this._input.get_regexp(t),e._update(),e};gi.prototype.starting_with=function(t){var e=this._create();return e._starting_pattern=this._input.get_regexp(t,!0),e._update(),e};gi.prototype.matching=function(t){var e=this._create();return e._match_pattern=this._input.get_regexp(t,!0),e._update(),e};gi.prototype._create=function(){return new gi(this._input,this)};gi.prototype._update=function(){};YI.exports.Pattern=gi});var zI=K((zte,$I)=>{"use strict";var KI=zl().Pattern;function Ss(t,e){KI.call(this,t,e),e?this._line_regexp=this._input.get_regexp(e._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}Ss.prototype=new KI;Ss.prototype.__set_whitespace_patterns=function(t,e){t+="\\t ",e+="\\n\\r",this._match_pattern=this._input.get_regexp("["+t+e+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+e+"]")};Ss.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var t=this._input.read(this._match_pattern);if(t===" ")this.whitespace_before_token=" ";else if(t){var e=this.__split(this._newline_regexp,t);this.newline_count=e.length-1,this.whitespace_before_token=e[this.newline_count]}return t};Ss.prototype.matching=function(t,e){var n=this._create();return n.__set_whitespace_patterns(t,e),n._update(),n};Ss.prototype._create=function(){return new Ss(this._input,this)};Ss.prototype.__split=function(t,e){t.lastIndex=0;for(var n=0,r=[],i=t.exec(e);i;)r.push(e.substring(n,i.index)),n=i.index+i[0].length,i=t.exec(e);return n{"use strict";var yM=Ef().InputScanner,XI=hh().Token,bh=HI().TokenStream,bM=zI().WhitespacePattern,Xl={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},_i=function(t,e){this._input=new yM(t),this._options=e||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new bM(this._input)};_i.prototype.tokenize=function(){this._input.restart(),this.__tokens=new bh,this._reset();for(var t,e=new XI(Xl.START,""),n=null,r=[],i=new bh;e.type!==Xl.EOF;){for(t=this._get_next_token(e,n);this._is_comment(t);)i.add(t),t=this._get_next_token(e,n);i.isEmpty()||(t.comments_before=i,i=new bh),t.parent=n,this._is_opening(t)?(r.push(n),n=t):n&&this._is_closing(t,n)&&(t.opened=n,n.closed=t,n=r.pop(),t.parent=n),t.previous=e,e.next=t,this.__tokens.add(t),e=t}return this.__tokens};_i.prototype._is_first_token=function(){return this.__tokens.isEmpty()};_i.prototype._reset=function(){};_i.prototype._get_next_token=function(t,e){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(Xl.RAW,n):this._create_token(Xl.EOF,"")};_i.prototype._is_comment=function(t){return!1};_i.prototype._is_opening=function(t){return!1};_i.prototype._is_closing=function(t,e){return!1};_i.prototype._create_token=function(t,e){var n=new XI(t,e,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return n};_i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()};Th.exports.Tokenizer=_i;Th.exports.TOKEN=Xl});var wf=K((Qte,QI)=>{"use strict";function Nh(t,e){t=typeof t=="string"?t:t.source,e=typeof e=="string"?e:e.source,this.__directives_block_pattern=new RegExp(t+/ beautify( \w+[:]\w+)+ /.source+e,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(t+/\sbeautify\signore:end\s/.source+e,"g")}Nh.prototype.get_directives=function(t){if(!t.match(this.__directives_block_pattern))return null;var e={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(t);n;)e[n[1]]=n[2],n=this.__directive_pattern.exec(t);return e};Nh.prototype.readIgnored=function(t){return t.readUntilAfter(this.__directives_end_ignore_pattern)};QI.exports.Directives=Nh});var Ih=K((Jte,JI)=>{"use strict";var vh=zl().Pattern,Ph={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function ei(t,e){vh.call(this,t,e),this.__template_pattern=null,this._disabled=Object.assign({},Ph),this._excluded=Object.assign({},Ph),e&&(this.__template_pattern=this._input.get_regexp(e.__template_pattern),this._excluded=Object.assign(this._excluded,e._excluded),this._disabled=Object.assign(this._disabled,e._disabled));var n=new vh(t);this.__patterns={handlebars_comment:n.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:n.starting_with(/{{{/).until_after(/}}}/),handlebars:n.starting_with(/{{/).until_after(/}}/),php:n.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/),smarty:n.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:n.starting_with(/{\*/).until_after(/\*}/),smarty_literal:n.starting_with(/{literal}/).until_after(/{\/literal}/)}}ei.prototype=new vh;ei.prototype._create=function(){return new ei(this._input,this)};ei.prototype._update=function(){this.__set_templated_pattern()};ei.prototype.disable=function(t){var e=this._create();return e._disabled[t]=!0,e._update(),e};ei.prototype.read_options=function(t){var e=this._create();for(var n in Ph)e._disabled[n]=t.templating.indexOf(n)===-1;return e._update(),e};ei.prototype.exclude=function(t){var e=this._create();return e._excluded[t]=!0,e._update(),e};ei.prototype.read=function(){var t="";this._match_pattern?t=this._input.read(this._starting_pattern):t=this._input.read(this._starting_pattern,this.__template_pattern);for(var e=this._read_template();e;)this._match_pattern?e+=this._input.read(this._match_pattern):e+=this._input.readUntil(this.__template_pattern),t+=e,e=this._read_template();return this._until_after&&(t+=this._input.readUntilAfter(this._until_pattern)),t};ei.prototype.__set_templated_pattern=function(){var t=[];this._disabled.php||t.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||t.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(t.push(this.__patterns.django._starting_pattern.source),t.push(this.__patterns.django_value._starting_pattern.source),t.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||t.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&t.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+t.join("|")+")")};ei.prototype._read_template=function(){var t="",e=this._input.peek();if(e==="<"){var n=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&n==="?"&&(t=t||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&n==="%"&&(t=t||this.__patterns.erb.read())}else e==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(t=t||this.__patterns.handlebars_comment.read(),t=t||this.__patterns.handlebars_unescaped.read(),t=t||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(t=t||this.__patterns.django_value.read()),this._excluded.django||(t=t||this.__patterns.django_comment.read(),t=t||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(t=t||this.__patterns.smarty_comment.read(),t=t||this.__patterns.smarty_literal.read(),t=t||this.__patterns.smarty.read()));return t};JI.exports.TemplatablePattern=ei});var Zl=K((Zte,Jl)=>{"use strict";var TM=Ef().InputScanner,ZI=Ql().Tokenizer,Sh=Ql().TOKEN,NM=wf().Directives,_r=_h(),vM=zl().Pattern,PM=Ih().TemplatablePattern;function Ch(t,e){return e.indexOf(t)!==-1}var ge={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:Sh.START,RAW:Sh.RAW,EOF:Sh.EOF},eS=new NM(/\/\*/,/\*\//),IM=/0[xX][0123456789abcdefABCDEF]*|0[oO][01234567]*|0[bB][01]*|\d+n|(?:\.\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?/,SM=/[0-9]/,CM=/[^\d\.]/,RM=">>> === !== << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),mo=">>>= ... >>= <<= === >>> !== **= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";mo=mo.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&");mo="\\?\\.(?!\\d) "+mo;mo=mo.replace(/ /g,"|");var AM=new RegExp(mo),tS="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),xM=tS.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as"]),EM=new RegExp("^(?:"+xM.join("|")+")$"),Of,cn=function(t,e){ZI.call(this,t,e),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var n=new vM(this._input),r=new PM(this._input).read_options(this._options);this.__patterns={template:r,identifier:r.starting_with(_r.identifier).matching(_r.identifierMatch),number:n.matching(IM),punct:n.matching(AM),comment:n.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:n.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:n.matching(//),include:n.starting_with(/#include/).until_after(_r.lineBreak),shebang:n.starting_with(/#!/).until_after(_r.lineBreak),xml:n.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\]|)(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/),single_quote:r.until(/['\\\n\r\u2028\u2029]/),double_quote:r.until(/["\\\n\r\u2028\u2029]/),template_text:r.until(/[`\\$]/),template_expression:r.until(/[`}\\]/)}};cn.prototype=new ZI;cn.prototype._is_comment=function(t){return t.type===ge.COMMENT||t.type===ge.BLOCK_COMMENT||t.type===ge.UNKNOWN};cn.prototype._is_opening=function(t){return t.type===ge.START_BLOCK||t.type===ge.START_EXPR};cn.prototype._is_closing=function(t,e){return(t.type===ge.END_BLOCK||t.type===ge.END_EXPR)&&e&&(t.text==="]"&&e.text==="["||t.text===")"&&e.text==="("||t.text==="}"&&e.text==="{")};cn.prototype._reset=function(){Of=!1};cn.prototype._get_next_token=function(t,e){var n=null;this._readWhitespace();var r=this._input.peek();return r===null?this._create_token(ge.EOF,""):(n=n||this._read_non_javascript(r),n=n||this._read_string(r),n=n||this._read_word(t),n=n||this._read_singles(r),n=n||this._read_comment(r),n=n||this._read_regexp(r,t),n=n||this._read_xml(r,t),n=n||this._read_punctuation(),n=n||this._create_token(ge.UNKNOWN,this._input.next()),n)};cn.prototype._read_word=function(t){var e;if(e=this.__patterns.identifier.read(),e!=="")return e=e.replace(_r.allLineBreaks,` -`),!(t.type===ge.DOT||t.type===ge.RESERVED&&(t.text==="set"||t.text==="get"))&&EM.test(e)?e==="in"||e==="of"?this._create_token(ge.OPERATOR,e):this._create_token(ge.RESERVED,e):this._create_token(ge.WORD,e);if(e=this.__patterns.number.read(),e!=="")return this._create_token(ge.WORD,e)};cn.prototype._read_singles=function(t){var e=null;return t==="("||t==="["?e=this._create_token(ge.START_EXPR,t):t===")"||t==="]"?e=this._create_token(ge.END_EXPR,t):t==="{"?e=this._create_token(ge.START_BLOCK,t):t==="}"?e=this._create_token(ge.END_BLOCK,t):t===";"?e=this._create_token(ge.SEMICOLON,t):t==="."&&CM.test(this._input.peek(1))?e=this._create_token(ge.DOT,t):t===","&&(e=this._create_token(ge.COMMA,t)),e&&this._input.next(),e};cn.prototype._read_punctuation=function(){var t=this.__patterns.punct.read();if(t!=="")return t==="="?this._create_token(ge.EQUALS,t):t==="?."?this._create_token(ge.DOT,t):this._create_token(ge.OPERATOR,t)};cn.prototype._read_non_javascript=function(t){var e="";if(t==="#"){if(this._is_first_token()&&(e=this.__patterns.shebang.read(),e))return this._create_token(ge.UNKNOWN,e.trim()+` +You passed in: '`+this.raw_options[t]+"'");return r};Is.prototype._is_valid_selection=function(t,e){return t.length&&e.length&&!t.some(function(n){return e.indexOf(n)===-1})};function qI(t,e){var n={};t=BI(t);var r;for(r in t)r!==e&&(n[r]=t[r]);if(e&&t[e])for(r in t[e])n[r]=t[e][r];return n}function BI(t){var e={},n;for(n in t){var r=n.replace(/-/g,"_");e[r]=t[n]}return e}xf.exports.Options=Is;xf.exports.normalizeOpts=BI;xf.exports.mergeOpts=qI});var yh=K((ine,GI)=>{"use strict";var jI=Ef().Options,NM=["before-newline","after-newline","preserve-newline"];function UI(t){jI.call(this,t,"js");var e=this.raw_options.brace_style||null;e==="expand-strict"?this.raw_options.brace_style="expand":e==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var n=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var r=0;r{"use strict";var WI=RegExp.prototype.hasOwnProperty("sticky");function un(t){this.__input=t||"",this.__input_length=this.__input.length,this.__position=0}un.prototype.restart=function(){this.__position=0};un.prototype.back=function(){this.__position>0&&(this.__position-=1)};un.prototype.hasNext=function(){return this.__position=0&&t=0&&e=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t};HI.exports.InputScanner=un});var KI=K((one,YI)=>{"use strict";function po(t){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=t}po.prototype.restart=function(){this.__position=0};po.prototype.isEmpty=function(){return this.__tokens_length===0};po.prototype.hasNext=function(){return this.__position=0&&t{"use strict";function gi(t,e){this._input=t,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,e&&(this._starting_pattern=this._input.get_regexp(e._starting_pattern,!0),this._match_pattern=this._input.get_regexp(e._match_pattern,!0),this._until_pattern=this._input.get_regexp(e._until_pattern),this._until_after=e._until_after)}gi.prototype.read=function(){var t=this._input.read(this._starting_pattern);return(!this._starting_pattern||t)&&(t+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),t};gi.prototype.read_match=function(){return this._input.match(this._match_pattern)};gi.prototype.until_after=function(t){var e=this._create();return e._until_after=!0,e._until_pattern=this._input.get_regexp(t),e._update(),e};gi.prototype.until=function(t){var e=this._create();return e._until_after=!1,e._until_pattern=this._input.get_regexp(t),e._update(),e};gi.prototype.starting_with=function(t){var e=this._create();return e._starting_pattern=this._input.get_regexp(t,!0),e._update(),e};gi.prototype.matching=function(t){var e=this._create();return e._match_pattern=this._input.get_regexp(t,!0),e._update(),e};gi.prototype._create=function(){return new gi(this._input,this)};gi.prototype._update=function(){};$I.exports.Pattern=gi});var QI=K((lne,XI)=>{"use strict";var zI=Xl().Pattern;function Ss(t,e){zI.call(this,t,e),e?this._line_regexp=this._input.get_regexp(e._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}Ss.prototype=new zI;Ss.prototype.__set_whitespace_patterns=function(t,e){t+="\\t ",e+="\\n\\r",this._match_pattern=this._input.get_regexp("["+t+e+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+e+"]")};Ss.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var t=this._input.read(this._match_pattern);if(t===" ")this.whitespace_before_token=" ";else if(t){var e=this.__split(this._newline_regexp,t);this.newline_count=e.length-1,this.whitespace_before_token=e[this.newline_count]}return t};Ss.prototype.matching=function(t,e){var n=this._create();return n.__set_whitespace_patterns(t,e),n._update(),n};Ss.prototype._create=function(){return new Ss(this._input,this)};Ss.prototype.__split=function(t,e){t.lastIndex=0;for(var n=0,r=[],i=t.exec(e);i;)r.push(e.substring(n,i.index)),n=i.index+i[0].length,i=t.exec(e);return n{"use strict";var vM=wf().InputScanner,JI=hh().Token,bh=KI().TokenStream,PM=QI().WhitespacePattern,Ql={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},_i=function(t,e){this._input=new vM(t),this._options=e||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new PM(this._input)};_i.prototype.tokenize=function(){this._input.restart(),this.__tokens=new bh,this._reset();for(var t,e=new JI(Ql.START,""),n=null,r=[],i=new bh;e.type!==Ql.EOF;){for(t=this._get_next_token(e,n);this._is_comment(t);)i.add(t),t=this._get_next_token(e,n);i.isEmpty()||(t.comments_before=i,i=new bh),t.parent=n,this._is_opening(t)?(r.push(n),n=t):n&&this._is_closing(t,n)&&(t.opened=n,n.closed=t,n=r.pop(),t.parent=n),t.previous=e,e.next=t,this.__tokens.add(t),e=t}return this.__tokens};_i.prototype._is_first_token=function(){return this.__tokens.isEmpty()};_i.prototype._reset=function(){};_i.prototype._get_next_token=function(t,e){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(Ql.RAW,n):this._create_token(Ql.EOF,"")};_i.prototype._is_comment=function(t){return!1};_i.prototype._is_opening=function(t){return!1};_i.prototype._is_closing=function(t,e){return!1};_i.prototype._create_token=function(t,e){var n=new JI(t,e,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return n};_i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()};Th.exports.Tokenizer=_i;Th.exports.TOKEN=Ql});var Of=K((cne,ZI)=>{"use strict";function Nh(t,e){t=typeof t=="string"?t:t.source,e=typeof e=="string"?e:e.source,this.__directives_block_pattern=new RegExp(t+/ beautify( \w+[:]\w+)+ /.source+e,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(t+/\sbeautify\signore:end\s/.source+e,"g")}Nh.prototype.get_directives=function(t){if(!t.match(this.__directives_block_pattern))return null;var e={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(t);n;)e[n[1]]=n[2],n=this.__directive_pattern.exec(t);return e};Nh.prototype.readIgnored=function(t){return t.readUntilAfter(this.__directives_end_ignore_pattern)};ZI.exports.Directives=Nh});var Ih=K((fne,eS)=>{"use strict";var vh=Xl().Pattern,Ph={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function ei(t,e){vh.call(this,t,e),this.__template_pattern=null,this._disabled=Object.assign({},Ph),this._excluded=Object.assign({},Ph),e&&(this.__template_pattern=this._input.get_regexp(e.__template_pattern),this._excluded=Object.assign(this._excluded,e._excluded),this._disabled=Object.assign(this._disabled,e._disabled));var n=new vh(t);this.__patterns={handlebars_comment:n.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:n.starting_with(/{{{/).until_after(/}}}/),handlebars:n.starting_with(/{{/).until_after(/}}/),php:n.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/),smarty:n.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:n.starting_with(/{\*/).until_after(/\*}/),smarty_literal:n.starting_with(/{literal}/).until_after(/{\/literal}/)}}ei.prototype=new vh;ei.prototype._create=function(){return new ei(this._input,this)};ei.prototype._update=function(){this.__set_templated_pattern()};ei.prototype.disable=function(t){var e=this._create();return e._disabled[t]=!0,e._update(),e};ei.prototype.read_options=function(t){var e=this._create();for(var n in Ph)e._disabled[n]=t.templating.indexOf(n)===-1;return e._update(),e};ei.prototype.exclude=function(t){var e=this._create();return e._excluded[t]=!0,e._update(),e};ei.prototype.read=function(){var t="";this._match_pattern?t=this._input.read(this._starting_pattern):t=this._input.read(this._starting_pattern,this.__template_pattern);for(var e=this._read_template();e;)this._match_pattern?e+=this._input.read(this._match_pattern):e+=this._input.readUntil(this.__template_pattern),t+=e,e=this._read_template();return this._until_after&&(t+=this._input.readUntilAfter(this._until_pattern)),t};ei.prototype.__set_templated_pattern=function(){var t=[];this._disabled.php||t.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||t.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(t.push(this.__patterns.django._starting_pattern.source),t.push(this.__patterns.django_value._starting_pattern.source),t.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||t.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&t.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+t.join("|")+")")};ei.prototype._read_template=function(){var t="",e=this._input.peek();if(e==="<"){var n=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&n==="?"&&(t=t||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&n==="%"&&(t=t||this.__patterns.erb.read())}else e==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(t=t||this.__patterns.handlebars_comment.read(),t=t||this.__patterns.handlebars_unescaped.read(),t=t||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(t=t||this.__patterns.django_value.read()),this._excluded.django||(t=t||this.__patterns.django_comment.read(),t=t||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(t=t||this.__patterns.smarty_comment.read(),t=t||this.__patterns.smarty_literal.read(),t=t||this.__patterns.smarty.read()));return t};eS.exports.TemplatablePattern=ei});var eu=K((pne,Zl)=>{"use strict";var IM=wf().InputScanner,tS=Jl().Tokenizer,Sh=Jl().TOKEN,SM=Of().Directives,yr=_h(),CM=Xl().Pattern,RM=Ih().TemplatablePattern;function Ch(t,e){return e.indexOf(t)!==-1}var ge={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:Sh.START,RAW:Sh.RAW,EOF:Sh.EOF},nS=new SM(/\/\*/,/\*\//),AM=/0[xX][0123456789abcdefABCDEF]*|0[oO][01234567]*|0[bB][01]*|\d+n|(?:\.\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?/,xM=/[0-9]/,EM=/[^\d\.]/,wM=">>> === !== << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),mo=">>>= ... >>= <<= === >>> !== **= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";mo=mo.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&");mo="\\?\\.(?!\\d) "+mo;mo=mo.replace(/ /g,"|");var OM=new RegExp(mo),rS="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),LM=rS.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as"]),DM=new RegExp("^(?:"+LM.join("|")+")$"),Lf,cn=function(t,e){tS.call(this,t,e),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var n=new CM(this._input),r=new RM(this._input).read_options(this._options);this.__patterns={template:r,identifier:r.starting_with(yr.identifier).matching(yr.identifierMatch),number:n.matching(AM),punct:n.matching(OM),comment:n.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:n.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:n.matching(//),include:n.starting_with(/#include/).until_after(yr.lineBreak),shebang:n.starting_with(/#!/).until_after(yr.lineBreak),xml:n.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\]|)(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/),single_quote:r.until(/['\\\n\r\u2028\u2029]/),double_quote:r.until(/["\\\n\r\u2028\u2029]/),template_text:r.until(/[`\\$]/),template_expression:r.until(/[`}\\]/)}};cn.prototype=new tS;cn.prototype._is_comment=function(t){return t.type===ge.COMMENT||t.type===ge.BLOCK_COMMENT||t.type===ge.UNKNOWN};cn.prototype._is_opening=function(t){return t.type===ge.START_BLOCK||t.type===ge.START_EXPR};cn.prototype._is_closing=function(t,e){return(t.type===ge.END_BLOCK||t.type===ge.END_EXPR)&&e&&(t.text==="]"&&e.text==="["||t.text===")"&&e.text==="("||t.text==="}"&&e.text==="{")};cn.prototype._reset=function(){Lf=!1};cn.prototype._get_next_token=function(t,e){var n=null;this._readWhitespace();var r=this._input.peek();return r===null?this._create_token(ge.EOF,""):(n=n||this._read_non_javascript(r),n=n||this._read_string(r),n=n||this._read_word(t),n=n||this._read_singles(r),n=n||this._read_comment(r),n=n||this._read_regexp(r,t),n=n||this._read_xml(r,t),n=n||this._read_punctuation(),n=n||this._create_token(ge.UNKNOWN,this._input.next()),n)};cn.prototype._read_word=function(t){var e;if(e=this.__patterns.identifier.read(),e!=="")return e=e.replace(yr.allLineBreaks,` +`),!(t.type===ge.DOT||t.type===ge.RESERVED&&(t.text==="set"||t.text==="get"))&&DM.test(e)?e==="in"||e==="of"?this._create_token(ge.OPERATOR,e):this._create_token(ge.RESERVED,e):this._create_token(ge.WORD,e);if(e=this.__patterns.number.read(),e!=="")return this._create_token(ge.WORD,e)};cn.prototype._read_singles=function(t){var e=null;return t==="("||t==="["?e=this._create_token(ge.START_EXPR,t):t===")"||t==="]"?e=this._create_token(ge.END_EXPR,t):t==="{"?e=this._create_token(ge.START_BLOCK,t):t==="}"?e=this._create_token(ge.END_BLOCK,t):t===";"?e=this._create_token(ge.SEMICOLON,t):t==="."&&EM.test(this._input.peek(1))?e=this._create_token(ge.DOT,t):t===","&&(e=this._create_token(ge.COMMA,t)),e&&this._input.next(),e};cn.prototype._read_punctuation=function(){var t=this.__patterns.punct.read();if(t!=="")return t==="="?this._create_token(ge.EQUALS,t):t==="?."?this._create_token(ge.DOT,t):this._create_token(ge.OPERATOR,t)};cn.prototype._read_non_javascript=function(t){var e="";if(t==="#"){if(this._is_first_token()&&(e=this.__patterns.shebang.read(),e))return this._create_token(ge.UNKNOWN,e.trim()+` `);if(e=this.__patterns.include.read(),e)return this._create_token(ge.UNKNOWN,e.trim()+` -`);t=this._input.next();var n="#";if(this._input.hasNext()&&this._input.testChar(SM)){do t=this._input.next(),n+=t;while(this._input.hasNext()&&t!=="#"&&t!=="=");return t==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(n+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(n+="{}",this._input.next(),this._input.next())),this._create_token(ge.WORD,n)}this._input.back()}else if(t==="<"&&this._is_first_token()){if(e=this.__patterns.html_comment_start.read(),e){for(;this._input.hasNext()&&!this._input.testChar(_r.newline);)e+=this._input.next();return Of=!0,this._create_token(ge.COMMENT,e)}}else if(Of&&t==="-"&&(e=this.__patterns.html_comment_end.read(),e))return Of=!1,this._create_token(ge.COMMENT,e);return null};cn.prototype._read_comment=function(t){var e=null;if(t==="/"){var n="";if(this._input.peek(1)==="*"){n=this.__patterns.block_comment.read();var r=eS.get_directives(n);r&&r.ignore==="start"&&(n+=eS.readIgnored(this._input)),n=n.replace(_r.allLineBreaks,` -`),e=this._create_token(ge.BLOCK_COMMENT,n),e.directives=r}else this._input.peek(1)==="/"&&(n=this.__patterns.comment.read(),e=this._create_token(ge.COMMENT,n))}return e};cn.prototype._read_string=function(t){if(t==="`"||t==="'"||t==='"'){var e=this._input.next();return this.has_char_escapes=!1,t==="`"?e+=this._read_string_recursive("`",!0,"${"):e+=this._read_string_recursive(t),this.has_char_escapes&&this._options.unescape_strings&&(e=wM(e)),this._input.peek()===t&&(e+=this._input.next()),e=e.replace(_r.allLineBreaks,` -`),this._create_token(ge.STRING,e)}return null};cn.prototype._allow_regexp_or_xml=function(t){return t.type===ge.RESERVED&&Ch(t.text,["return","case","throw","else","do","typeof","yield"])||t.type===ge.END_EXPR&&t.text===")"&&t.opened.previous.type===ge.RESERVED&&Ch(t.opened.previous.text,["if","while","for"])||Ch(t.type,[ge.COMMENT,ge.START_EXPR,ge.START_BLOCK,ge.START,ge.END_BLOCK,ge.OPERATOR,ge.EQUALS,ge.EOF,ge.SEMICOLON,ge.COMMA])};cn.prototype._read_regexp=function(t,e){if(t==="/"&&this._allow_regexp_or_xml(e)){for(var n=this._input.next(),r=!1,i=!1;this._input.hasNext()&&(r||i||this._input.peek()!==t)&&!this._input.testChar(_r.newline);)n+=this._input.peek(),r?r=!1:(r=this._input.peek()==="\\",this._input.peek()==="["?i=!0:this._input.peek()==="]"&&(i=!1)),this._input.next();return this._input.peek()===t&&(n+=this._input.next(),n+=this._input.read(_r.identifier)),this._create_token(ge.STRING,n)}return null};cn.prototype._read_xml=function(t,e){if(this._options.e4x&&t==="<"&&this._allow_regexp_or_xml(e)){var n="",r=this.__patterns.xml.read_match();if(r){for(var i=r[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),s=i.indexOf("{")===0,o=0;r;){var a=!!r[1],l=r[2],u=!!r[r.length-1]||l.slice(0,8)==="![CDATA[";if(!u&&(l===i||s&&l.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(a?--o:++o),n+=r[0],o<=0)break;r=this.__patterns.xml.read_match()}return r||(n+=this._input.match(/[\s\S]*/g)[0]),n=n.replace(_r.allLineBreaks,` -`),this._create_token(ge.STRING,n)}}return null};function wM(t){for(var e="",n=0,r=new TM(t),i=null;r.hasNext();)if(i=r.match(/([\s]|[^\\]|\\\\)+/g),i&&(e+=i[0]),r.peek()==="\\"){if(r.next(),r.peek()==="x")i=r.match(/x([0-9A-Fa-f]{2})/g);else if(r.peek()==="u")i=r.match(/u([0-9A-Fa-f]{4})/g);else{e+="\\",r.hasNext()&&(e+=r.next());continue}if(!i||(n=parseInt(i[1],16),n>126&&n<=255&&i[0].indexOf("x")===0))return t;if(n>=0&&n<32){e+="\\"+i[0];continue}else n===34||n===39||n===92?e+="\\"+String.fromCharCode(n):e+=String.fromCharCode(n)}return e}cn.prototype._read_string_recursive=function(t,e,n){var r,i;t==="'"?i=this.__patterns.single_quote:t==='"'?i=this.__patterns.double_quote:t==="`"?i=this.__patterns.template_text:t==="}"&&(i=this.__patterns.template_expression);for(var s=i.read(),o="";this._input.hasNext();){if(o=this._input.next(),o===t||!e&&_r.newline.test(o)){this._input.back();break}else o==="\\"&&this._input.hasNext()?(r=this._input.peek(),r==="x"||r==="u"?this.has_char_escapes=!0:r==="\r"&&this._input.peek(1)===` -`&&this._input.next(),o+=this._input.next()):n&&(n==="${"&&o==="$"&&this._input.peek()==="{"&&(o+=this._input.next()),n===o&&(t==="`"?o+=this._read_string_recursive("}",e,"`"):o+=this._read_string_recursive("`",e,"${"),this._input.hasNext()&&(o+=this._input.next())));o+=i.read(),s+=o}return s};Jl.exports.Tokenizer=cn;Jl.exports.TOKEN=ge;Jl.exports.positionable_operators=RM.slice();Jl.exports.line_starters=tS.slice()});var sS=K((ene,iS)=>{"use strict";var OM=Rf().Output,LM=hh().Token,Lf=_h(),DM=yh().Options,kM=Zl().Tokenizer,eu=Zl().line_starters,tu=Zl().positionable_operators,q=Zl().TOKEN;function ke(t,e){return e.indexOf(t)!==-1}function MM(t){return t.replace(/^\s+/g,"")}function FM(t){for(var e={},n=0;n126&&n<=255&&i[0].indexOf("x")===0))return t;if(n>=0&&n<32){e+="\\"+i[0];continue}else n===34||n===39||n===92?e+="\\"+String.fromCharCode(n):e+=String.fromCharCode(n)}return e}cn.prototype._read_string_recursive=function(t,e,n){var r,i;t==="'"?i=this.__patterns.single_quote:t==='"'?i=this.__patterns.double_quote:t==="`"?i=this.__patterns.template_text:t==="}"&&(i=this.__patterns.template_expression);for(var s=i.read(),o="";this._input.hasNext();){if(o=this._input.next(),o===t||!e&&yr.newline.test(o)){this._input.back();break}else o==="\\"&&this._input.hasNext()?(r=this._input.peek(),r==="x"||r==="u"?this.has_char_escapes=!0:r==="\r"&&this._input.peek(1)===` +`&&this._input.next(),o+=this._input.next()):n&&(n==="${"&&o==="$"&&this._input.peek()==="{"&&(o+=this._input.next()),n===o&&(t==="`"?o+=this._read_string_recursive("}",e,"`"):o+=this._read_string_recursive("`",e,"${"),this._input.hasNext()&&(o+=this._input.next())));o+=i.read(),s+=o}return s};Zl.exports.Tokenizer=cn;Zl.exports.TOKEN=ge;Zl.exports.positionable_operators=wM.slice();Zl.exports.line_starters=rS.slice()});var aS=K((dne,oS)=>{"use strict";var MM=Af().Output,FM=hh().Token,Df=_h(),VM=yh().Options,qM=eu().Tokenizer,tu=eu().line_starters,nu=eu().positionable_operators,q=eu().TOKEN;function Me(t,e){return e.indexOf(t)!==-1}function BM(t){return t.replace(/^\s+/g,"")}function jM(t){for(var e={},n=0;nn&&(n=t.line_indent_level));var r={mode:e,parent:t,last_token:t?t.last_token:new LM(q.START_BLOCK,""),last_word:t?t.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:n,alignment:0,line_indent_level:t?t.line_indent_level:n,start_line_index:this._output.get_line_number(),ternary_depth:0};return r};Ke.prototype._reset=function(t){var e=t.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new OM(this._options,e),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(_e.BlockStatement);var n=new kM(t,this._options);return this._tokens=n.tokenize(),t};Ke.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t,e=this._reset(this._source_text),n=this._options.eol;this._options.eol==="auto"&&(n=` -`,e&&Lf.lineBreak.test(e||"")&&(n=e.match(Lf.lineBreak)[0]));for(var r=this._tokens.next();r;)this.handle_token(r),this._last_last_text=this._flags.last_token.text,this._flags.last_token=r,r=this._tokens.next();return t=this._output.get_code(n),t};Ke.prototype.handle_token=function(t,e){t.type===q.START_EXPR?this.handle_start_expr(t):t.type===q.END_EXPR?this.handle_end_expr(t):t.type===q.START_BLOCK?this.handle_start_block(t):t.type===q.END_BLOCK?this.handle_end_block(t):t.type===q.WORD?this.handle_word(t):t.type===q.RESERVED?this.handle_word(t):t.type===q.SEMICOLON?this.handle_semicolon(t):t.type===q.STRING?this.handle_string(t):t.type===q.EQUALS?this.handle_equals(t):t.type===q.OPERATOR?this.handle_operator(t):t.type===q.COMMA?this.handle_comma(t):t.type===q.BLOCK_COMMENT?this.handle_block_comment(t,e):t.type===q.COMMENT?this.handle_comment(t,e):t.type===q.DOT?this.handle_dot(t):t.type===q.EOF?this.handle_eof(t):t.type===q.UNKNOWN?this.handle_unknown(t,e):this.handle_unknown(t,e)};Ke.prototype.handle_whitespace_and_comments=function(t,e){var n=t.newlines,r=this._options.keep_array_indentation&&Cs(this._flags.mode);if(t.comments_before)for(var i=t.comments_before.next();i;)this.handle_whitespace_and_comments(i,e),this.handle_token(i,e),i=t.comments_before.next();if(r)for(var s=0;s0,e);else if(this._options.max_preserve_newlines&&n>this._options.max_preserve_newlines&&(n=this._options.max_preserve_newlines),this._options.preserve_newlines&&n>1){this.print_newline(!1,e);for(var o=1;o0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))};Ke.prototype.set_mode=function(t){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,t),this._flags=this.create_flags(this._previous_flags,t),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)};Ke.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===_e.Statement&&rS(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))};Ke.prototype.start_of_object_property=function(){return this._flags.parent.mode===_e.ObjectLiteral&&this._flags.mode===_e.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||at(this._flags.last_token,["get","set"]))};Ke.prototype.start_of_statement=function(t){var e=!1;return e=e||at(this._flags.last_token,["var","let","const"])&&t.type===q.WORD,e=e||yr(this._flags.last_token,"do"),e=e||!(this._flags.parent.mode===_e.ObjectLiteral&&this._flags.mode===_e.Statement)&&at(this._flags.last_token,Rh)&&!t.newlines,e=e||yr(this._flags.last_token,"else")&&!(yr(t,"if")&&!t.comments_before),e=e||this._flags.last_token.type===q.END_EXPR&&(this._previous_flags.mode===_e.ForInitializer||this._previous_flags.mode===_e.Conditional),e=e||this._flags.last_token.type===q.WORD&&this._flags.mode===_e.BlockStatement&&!this._flags.in_case&&!(t.text==="--"||t.text==="++")&&this._last_last_text!=="function"&&t.type!==q.WORD&&t.type!==q.RESERVED,e=e||this._flags.mode===_e.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||at(this._flags.last_token,["get","set"])),e?(this.set_mode(_e.Statement),this.indent(),this.handle_whitespace_and_comments(t,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t,at(t,["do","for","if","while"])),!0):!1};Ke.prototype.handle_start_expr=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t);var e=_e.Expression;if(t.text==="["){if(this._flags.last_token.type===q.WORD||this._flags.last_token.text===")"){at(this._flags.last_token,eu)&&(this._output.space_before_token=!0),this.print_token(t),this.set_mode(e),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}e=_e.ArrayLiteral,Cs(this._flags.mode)&&(this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline()),ke(this._flags.last_token.type,[q.START_EXPR,q.END_EXPR,q.WORD,q.OPERATOR,q.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===q.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,e=_e.ForInitializer):ke(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,e=_e.Conditional):ke(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&t.whitespace_before===""?this._output.space_before_token=!1:(ke(this._flags.last_token.text,eu)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===q.EQUALS||this._flags.last_token.type===q.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t);else if(this._flags.last_token.type===q.WORD){this._output.space_before_token=!1;var n=this._tokens.peek(-3);if(this._options.space_after_named_function&&n){var r=this._tokens.peek(-4);at(n,["async","function"])||n.text==="*"&&at(r,["async","function"])?this._output.space_before_token=!0:this._flags.mode===_e.ObjectLiteral&&(n.text==="{"||n.text===","||n.text==="*"&&(r.text==="{"||r.text===","))&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(t);(this._flags.last_token.type===q.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(ke(this._last_last_text,["function","yield"])||this._flags.mode===_e.ObjectLiteral&&ke(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===q.START_BLOCK?this.print_newline():(this._flags.last_token.type===q.END_EXPR||this._flags.last_token.type===q.START_EXPR||this._flags.last_token.type===q.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===q.COMMA)&&this.allow_wrap_or_preserved_newline(t,t.newlines),this.print_token(t),this.set_mode(e),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()};Ke.prototype.handle_end_expr=function(t){for(;this._flags.mode===_e.Statement;)this.restore_mode();this.handle_whitespace_and_comments(t),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(t,t.text==="]"&&Cs(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===q.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(t),this.restore_mode(),rS(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===_e.Conditional&&(this._previous_flags.mode=_e.Expression,this._flags.do_block=!1,this._flags.do_while=!1)};Ke.prototype.handle_start_block=function(t){this.handle_whitespace_and_comments(t);var e=this._tokens.peek(),n=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===q.END_EXPR?(this.set_mode(_e.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(_e.BlockStatement):n&&(ke(n.text,[":",","])&&ke(e.type,[q.STRING,q.WORD,q.RESERVED])||ke(e.text,["get","set","..."])&&ke(n.type,[q.WORD,q.RESERVED]))?ke(this._last_last_text,["class","interface"])?this.set_mode(_e.BlockStatement):this.set_mode(_e.ObjectLiteral):this._flags.last_token.type===q.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(_e.BlockStatement):ke(this._flags.last_token.type,[q.EQUALS,q.START_EXPR,q.COMMA,q.OPERATOR])||at(this._flags.last_token,["return","throw","import","default"])?this.set_mode(_e.ObjectLiteral):this.set_mode(_e.BlockStatement);var r=!e.comments_before&&e.text==="}",i=r&&this._flags.last_word==="function"&&this._flags.last_token.type===q.END_EXPR;if(this._options.brace_preserve_inline){var s=0,o=null;this._flags.inline_frame=!0;do if(s+=1,o=this._tokens.peek(s-1),o.newlines){this._flags.inline_frame=!1;break}while(o.type!==q.EOF&&!(o.type===q.END_BLOCK&&o.opened===t))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&t.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==q.OPERATOR&&(i||this._flags.last_token.type===q.EQUALS||at(this._flags.last_token,Df)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(Cs(this._previous_flags.mode)&&(this._flags.last_token.type===q.START_EXPR||this._flags.last_token.type===q.COMMA)&&((this._flags.last_token.type===q.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===q.COMMA||this._flags.last_token.type===q.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(t),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==q.OPERATOR&&this._flags.last_token.type!==q.START_EXPR&&(this._flags.last_token.type===q.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(t),this.indent(),!r&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()};Ke.prototype.handle_end_block=function(t){for(this.handle_whitespace_and_comments(t);this._flags.mode===_e.Statement;)this.restore_mode();var e=this._flags.last_token.type===q.START_BLOCK;this._flags.inline_frame&&!e?this._output.space_before_token=!0:this._options.brace_style==="expand"?e||this.print_newline():e||(Cs(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(t)};Ke.prototype.handle_word=function(t){if(t.type===q.RESERVED){if(ke(t.text,["set","get"])&&this._flags.mode!==_e.ObjectLiteral)t.type=q.WORD;else if(t.text==="import"&&this._tokens.peek().text==="(")t.type=q.WORD;else if(ke(t.text,["as","from"])&&!this._flags.import_block)t.type=q.WORD;else if(this._flags.mode===_e.ObjectLiteral){var e=this._tokens.peek();e.text===":"&&(t.type=q.WORD)}}if(this.start_of_statement(t)?at(this._flags.last_token,["var","let","const"])&&t.type===q.WORD&&(this._flags.declaration_statement=!0):t.newlines&&!ru(this._flags.mode)&&(this._flags.last_token.type!==q.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==q.EQUALS&&(this._options.preserve_newlines||!at(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(t),this.print_newline()):this.handle_whitespace_and_comments(t),this._flags.do_block&&!this._flags.do_while)if(yr(t,"while")){this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&yr(t,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===_e.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&at(t,["case","default"])){this.print_newline(),this._flags.last_token.type!==q.END_BLOCK&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(t),this._flags.in_case=!0;return}if((this._flags.last_token.type===q.COMMA||this._flags.last_token.type===q.START_EXPR||this._flags.last_token.type===q.EQUALS||this._flags.last_token.type===q.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t)),yr(t,"function")){(ke(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(ke(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===q.OPERATOR))&&!this._output.just_added_blankline()&&!t.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===q.RESERVED||this._flags.last_token.type===q.WORD?at(this._flags.last_token,["get","set","new","export"])||at(this._flags.last_token,Rh)?this._output.space_before_token=!0:yr(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===q.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(ru(this._flags.mode)||Cs(this._flags.mode))||this.print_newline(),this.print_token(t),this._flags.last_word=t.text;return}var n="NONE";if(this._flags.last_token.type===q.END_BLOCK?this._previous_flags.inline_frame?n="SPACE":at(t,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&t.newlines?n="NEWLINE":(n="SPACE",this._output.space_before_token=!0):n="NEWLINE":this._flags.last_token.type===q.SEMICOLON&&this._flags.mode===_e.BlockStatement?n="NEWLINE":this._flags.last_token.type===q.SEMICOLON&&ru(this._flags.mode)?n="SPACE":this._flags.last_token.type===q.STRING?n="NEWLINE":this._flags.last_token.type===q.RESERVED||this._flags.last_token.type===q.WORD||this._flags.last_token.text==="*"&&(ke(this._last_last_text,["function","yield"])||this._flags.mode===_e.ObjectLiteral&&ke(this._last_last_text,["{",","]))?n="SPACE":this._flags.last_token.type===q.START_BLOCK?this._flags.inline_frame?n="SPACE":n="NEWLINE":this._flags.last_token.type===q.END_EXPR&&(this._output.space_before_token=!0,n="NEWLINE"),at(t,eu)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?n="SPACE":n="NEWLINE"),at(t,["else","catch","finally"]))if((!(this._flags.last_token.type===q.END_BLOCK&&this._previous_flags.mode===_e.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&t.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var r=this._output.current_line;r.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else n==="NEWLINE"?at(this._flags.last_token,Df)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&at(t,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==q.END_EXPR?(this._flags.last_token.type!==q.START_EXPR||!at(t,["var","let","const"]))&&this._flags.last_token.text!==":"&&(yr(t,"if")&&yr(t.previous,"else")?this._output.space_before_token=!0:this.print_newline()):at(t,eu)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&Cs(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():n==="SPACE"&&(this._output.space_before_token=!0);t.previous&&(t.previous.type===q.WORD||t.previous.type===q.RESERVED)&&(this._output.space_before_token=!0),this.print_token(t),this._flags.last_word=t.text,t.type===q.RESERVED&&(t.text==="do"?this._flags.do_block=!0:t.text==="if"?this._flags.if_block=!0:t.text==="import"?this._flags.import_block=!0:this._flags.import_block&&yr(t,"from")&&(this._flags.import_block=!1))};Ke.prototype.handle_semicolon=function(t){this.start_of_statement(t)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(t);for(var e=this._tokens.peek();this._flags.mode===_e.Statement&&!(this._flags.if_block&&yr(e,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(t)};Ke.prototype.handle_string=function(t){t.text.startsWith("`")&&t.newlines===0&&t.whitespace_before===""&&(t.previous.text===")"||this._flags.last_token.type===q.WORD)||(this.start_of_statement(t)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(t),this._flags.last_token.type===q.RESERVED||this._flags.last_token.type===q.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===q.COMMA||this._flags.last_token.type===q.START_EXPR||this._flags.last_token.type===q.EQUALS||this._flags.last_token.type===q.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t):t.text.startsWith("`")&&this._flags.last_token.type===q.END_EXPR&&(t.previous.text==="]"||t.previous.text===")")&&t.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(t)};Ke.prototype.handle_equals=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0};Ke.prototype.handle_comma=function(t){this.handle_whitespace_and_comments(t,!0),this.print_token(t),this._output.space_before_token=!0,this._flags.declaration_statement?(ru(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)):this._flags.mode===_e.ObjectLiteral||this._flags.mode===_e.Statement&&this._flags.parent.mode===_e.ObjectLiteral?(this._flags.mode===_e.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)};Ke.prototype.handle_operator=function(t){var e=t.text==="*"&&(at(this._flags.last_token,["function","yield"])||ke(this._flags.last_token.type,[q.START_BLOCK,q.COMMA,q.END_BLOCK,q.SEMICOLON])),n=ke(t.text,["-","+"])&&(ke(this._flags.last_token.type,[q.START_BLOCK,q.START_EXPR,q.EQUALS,q.OPERATOR])||ke(this._flags.last_token.text,eu)||this._flags.last_token.text===",");if(!this.start_of_statement(t)){var r=!e;this.handle_whitespace_and_comments(t,r)}if(at(this._flags.last_token,Df)){this._output.space_before_token=!0,this.print_token(t);return}if(t.text==="*"&&this._flags.last_token.type===q.DOT){this.print_token(t);return}if(t.text==="::"){this.print_token(t);return}if(this._flags.last_token.type===q.OPERATOR&&ke(this._options.operator_position,nS)&&this.allow_wrap_or_preserved_newline(t),t.text===":"&&this._flags.in_case){this.print_token(t),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==q.START_BLOCK?(this.indent(),this.print_newline()):this._output.space_before_token=!0;return}var i=!0,s=!0,o=!1;if(t.text===":"?this._flags.ternary_depth===0?i=!1:(this._flags.ternary_depth-=1,o=!0):t.text==="?"&&(this._flags.ternary_depth+=1),!n&&!e&&this._options.preserve_newlines&&ke(t.text,tu)){var a=t.text===":",l=a&&o,u=a&&!o;switch(this._options.operator_position){case nu.before_newline:this._output.space_before_token=!u,this.print_token(t),(!a||l)&&this.allow_wrap_or_preserved_newline(t),this._output.space_before_token=!0;return;case nu.after_newline:this._output.space_before_token=!0,!a||l?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(t):this._output.space_before_token=!1,this.print_token(t),this._output.space_before_token=!0;return;case nu.preserve_newline:u||this.allow_wrap_or_preserved_newline(t),i=!(this._output.just_added_newline()||u),this._output.space_before_token=i,this.print_token(t),this._output.space_before_token=!0;return}}if(e){this.allow_wrap_or_preserved_newline(t),i=!1;var c=this._tokens.peek();s=c&&ke(c.type,[q.WORD,q.RESERVED])}else t.text==="..."?(this.allow_wrap_or_preserved_newline(t),i=this._flags.last_token.type===q.START_BLOCK,s=!1):(ke(t.text,["--","++","!","~"])||n)&&((this._flags.last_token.type===q.COMMA||this._flags.last_token.type===q.START_EXPR)&&this.allow_wrap_or_preserved_newline(t),i=!1,s=!1,t.newlines&&(t.text==="--"||t.text==="++")&&this.print_newline(!1,!0),this._flags.last_token.text===";"&&ru(this._flags.mode)&&(i=!0),this._flags.last_token.type===q.RESERVED?i=!0:this._flags.last_token.type===q.END_EXPR?i=!(this._flags.last_token.text==="]"&&(t.text==="--"||t.text==="++")):this._flags.last_token.type===q.OPERATOR&&(i=ke(t.text,["--","-","++","+"])&&ke(this._flags.last_token.text,["--","-","++","+"]),ke(t.text,["+","-"])&&ke(this._flags.last_token.text,["--","++"])&&(s=!0)),(this._flags.mode===_e.BlockStatement&&!this._flags.inline_frame||this._flags.mode===_e.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline());this._output.space_before_token=this._output.space_before_token||i,this.print_token(t),this._output.space_before_token=s};Ke.prototype.handle_block_comment=function(t,e){if(this._output.raw){this._output.add_raw_token(t),t.directives&&t.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(t.directives){this.print_newline(!1,e),this.print_token(t),t.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!Lf.newline.test(t.text)&&!t.newlines){this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0;return}else this.print_block_commment(t,e)};Ke.prototype.print_block_commment=function(t,e){var n=qM(t.text),r,i=!1,s=!1,o=t.whitespace_before,a=o.length;if(this.print_newline(!1,e),this.print_token_line_indentation(t),this._output.add_token(n[0]),this.print_newline(!1,e),n.length>1){for(n=n.slice(1),i=BM(n,"*"),s=jM(n,o),i&&(this._flags.alignment=1),r=0;r{"use strict";var UM=sS().Beautifier,GM=yh().Options;function WM(t,e){var n=new UM(t,e);return n.beautify()}Ah.exports=WM;Ah.exports.defaultOptions=function(){return new GM}});var xh=K((nne,uS)=>{"use strict";var aS=xf().Options;function lS(t){aS.call(this,t,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var e=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||e;var n=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var r=0;r{"use strict";var HM=xh().Options,YM=Rf().Output,KM=Ef().InputScanner,$M=wf().Directives,cS=new $M(/\/\*/,/\*\//),fS=/\r\n|[\r\n]/,zM=/\r\n|[\r\n]/g,kf=/\s/,XM=/(?:\s|\n)+/g,QM=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,JM=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function Gi(t,e){this._source_text=t||"",this._options=new HM(e),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0}}Gi.prototype.eatString=function(t){var e="";for(this._ch=this._input.next();this._ch;){if(e+=this._ch,this._ch==="\\")e+=this._input.next();else if(t.indexOf(this._ch)!==-1||this._ch===` -`)break;this._ch=this._input.next()}return e};Gi.prototype.eatWhitespace=function(t){for(var e=kf.test(this._input.peek()),n=0;kf.test(this._input.peek());)this._ch=this._input.next(),t&&this._ch===` +`);return t.length&&e.push(t),e}function Cs(t){return t===_e.ArrayLiteral}function iu(t){return Me(t,[_e.Expression,_e.ForInitializer,_e.Conditional])}function WM(t,e){for(var n=0;nn&&(n=t.line_indent_level));var r={mode:e,parent:t,last_token:t?t.last_token:new FM(q.START_BLOCK,""),last_word:t?t.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:n,alignment:0,line_indent_level:t?t.line_indent_level:n,start_line_index:this._output.get_line_number(),ternary_depth:0};return r};Ke.prototype._reset=function(t){var e=t.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new MM(this._options,e),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(_e.BlockStatement);var n=new qM(t,this._options);return this._tokens=n.tokenize(),t};Ke.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t,e=this._reset(this._source_text),n=this._options.eol;this._options.eol==="auto"&&(n=` +`,e&&Df.lineBreak.test(e||"")&&(n=e.match(Df.lineBreak)[0]));for(var r=this._tokens.next();r;)this.handle_token(r),this._last_last_text=this._flags.last_token.text,this._flags.last_token=r,r=this._tokens.next();return t=this._output.get_code(n),t};Ke.prototype.handle_token=function(t,e){t.type===q.START_EXPR?this.handle_start_expr(t):t.type===q.END_EXPR?this.handle_end_expr(t):t.type===q.START_BLOCK?this.handle_start_block(t):t.type===q.END_BLOCK?this.handle_end_block(t):t.type===q.WORD?this.handle_word(t):t.type===q.RESERVED?this.handle_word(t):t.type===q.SEMICOLON?this.handle_semicolon(t):t.type===q.STRING?this.handle_string(t):t.type===q.EQUALS?this.handle_equals(t):t.type===q.OPERATOR?this.handle_operator(t):t.type===q.COMMA?this.handle_comma(t):t.type===q.BLOCK_COMMENT?this.handle_block_comment(t,e):t.type===q.COMMENT?this.handle_comment(t,e):t.type===q.DOT?this.handle_dot(t):t.type===q.EOF?this.handle_eof(t):t.type===q.UNKNOWN?this.handle_unknown(t,e):this.handle_unknown(t,e)};Ke.prototype.handle_whitespace_and_comments=function(t,e){var n=t.newlines,r=this._options.keep_array_indentation&&Cs(this._flags.mode);if(t.comments_before)for(var i=t.comments_before.next();i;)this.handle_whitespace_and_comments(i,e),this.handle_token(i,e),i=t.comments_before.next();if(r)for(var s=0;s0,e);else if(this._options.max_preserve_newlines&&n>this._options.max_preserve_newlines&&(n=this._options.max_preserve_newlines),this._options.preserve_newlines&&n>1){this.print_newline(!1,e);for(var o=1;o0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))};Ke.prototype.set_mode=function(t){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,t),this._flags=this.create_flags(this._previous_flags,t),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)};Ke.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===_e.Statement&&sS(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))};Ke.prototype.start_of_object_property=function(){return this._flags.parent.mode===_e.ObjectLiteral&&this._flags.mode===_e.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||at(this._flags.last_token,["get","set"]))};Ke.prototype.start_of_statement=function(t){var e=!1;return e=e||at(this._flags.last_token,["var","let","const"])&&t.type===q.WORD,e=e||br(this._flags.last_token,"do"),e=e||!(this._flags.parent.mode===_e.ObjectLiteral&&this._flags.mode===_e.Statement)&&at(this._flags.last_token,Rh)&&!t.newlines,e=e||br(this._flags.last_token,"else")&&!(br(t,"if")&&!t.comments_before),e=e||this._flags.last_token.type===q.END_EXPR&&(this._previous_flags.mode===_e.ForInitializer||this._previous_flags.mode===_e.Conditional),e=e||this._flags.last_token.type===q.WORD&&this._flags.mode===_e.BlockStatement&&!this._flags.in_case&&!(t.text==="--"||t.text==="++")&&this._last_last_text!=="function"&&t.type!==q.WORD&&t.type!==q.RESERVED,e=e||this._flags.mode===_e.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||at(this._flags.last_token,["get","set"])),e?(this.set_mode(_e.Statement),this.indent(),this.handle_whitespace_and_comments(t,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t,at(t,["do","for","if","while"])),!0):!1};Ke.prototype.handle_start_expr=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t);var e=_e.Expression;if(t.text==="["){if(this._flags.last_token.type===q.WORD||this._flags.last_token.text===")"){at(this._flags.last_token,tu)&&(this._output.space_before_token=!0),this.print_token(t),this.set_mode(e),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}e=_e.ArrayLiteral,Cs(this._flags.mode)&&(this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline()),Me(this._flags.last_token.type,[q.START_EXPR,q.END_EXPR,q.WORD,q.OPERATOR,q.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===q.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,e=_e.ForInitializer):Me(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,e=_e.Conditional):Me(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&t.whitespace_before===""?this._output.space_before_token=!1:(Me(this._flags.last_token.text,tu)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===q.EQUALS||this._flags.last_token.type===q.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t);else if(this._flags.last_token.type===q.WORD){this._output.space_before_token=!1;var n=this._tokens.peek(-3);if(this._options.space_after_named_function&&n){var r=this._tokens.peek(-4);at(n,["async","function"])||n.text==="*"&&at(r,["async","function"])?this._output.space_before_token=!0:this._flags.mode===_e.ObjectLiteral&&(n.text==="{"||n.text===","||n.text==="*"&&(r.text==="{"||r.text===","))&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(t);(this._flags.last_token.type===q.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(Me(this._last_last_text,["function","yield"])||this._flags.mode===_e.ObjectLiteral&&Me(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===q.START_BLOCK?this.print_newline():(this._flags.last_token.type===q.END_EXPR||this._flags.last_token.type===q.START_EXPR||this._flags.last_token.type===q.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===q.COMMA)&&this.allow_wrap_or_preserved_newline(t,t.newlines),this.print_token(t),this.set_mode(e),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()};Ke.prototype.handle_end_expr=function(t){for(;this._flags.mode===_e.Statement;)this.restore_mode();this.handle_whitespace_and_comments(t),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(t,t.text==="]"&&Cs(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===q.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(t),this.restore_mode(),sS(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===_e.Conditional&&(this._previous_flags.mode=_e.Expression,this._flags.do_block=!1,this._flags.do_while=!1)};Ke.prototype.handle_start_block=function(t){this.handle_whitespace_and_comments(t);var e=this._tokens.peek(),n=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===q.END_EXPR?(this.set_mode(_e.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(_e.BlockStatement):n&&(Me(n.text,[":",","])&&Me(e.type,[q.STRING,q.WORD,q.RESERVED])||Me(e.text,["get","set","..."])&&Me(n.type,[q.WORD,q.RESERVED]))?Me(this._last_last_text,["class","interface"])?this.set_mode(_e.BlockStatement):this.set_mode(_e.ObjectLiteral):this._flags.last_token.type===q.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(_e.BlockStatement):Me(this._flags.last_token.type,[q.EQUALS,q.START_EXPR,q.COMMA,q.OPERATOR])||at(this._flags.last_token,["return","throw","import","default"])?this.set_mode(_e.ObjectLiteral):this.set_mode(_e.BlockStatement);var r=!e.comments_before&&e.text==="}",i=r&&this._flags.last_word==="function"&&this._flags.last_token.type===q.END_EXPR;if(this._options.brace_preserve_inline){var s=0,o=null;this._flags.inline_frame=!0;do if(s+=1,o=this._tokens.peek(s-1),o.newlines){this._flags.inline_frame=!1;break}while(o.type!==q.EOF&&!(o.type===q.END_BLOCK&&o.opened===t))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&t.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==q.OPERATOR&&(i||this._flags.last_token.type===q.EQUALS||at(this._flags.last_token,kf)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(Cs(this._previous_flags.mode)&&(this._flags.last_token.type===q.START_EXPR||this._flags.last_token.type===q.COMMA)&&((this._flags.last_token.type===q.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===q.COMMA||this._flags.last_token.type===q.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(t),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==q.OPERATOR&&this._flags.last_token.type!==q.START_EXPR&&(this._flags.last_token.type===q.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(t),this.indent(),!r&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()};Ke.prototype.handle_end_block=function(t){for(this.handle_whitespace_and_comments(t);this._flags.mode===_e.Statement;)this.restore_mode();var e=this._flags.last_token.type===q.START_BLOCK;this._flags.inline_frame&&!e?this._output.space_before_token=!0:this._options.brace_style==="expand"?e||this.print_newline():e||(Cs(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(t)};Ke.prototype.handle_word=function(t){if(t.type===q.RESERVED){if(Me(t.text,["set","get"])&&this._flags.mode!==_e.ObjectLiteral)t.type=q.WORD;else if(t.text==="import"&&this._tokens.peek().text==="(")t.type=q.WORD;else if(Me(t.text,["as","from"])&&!this._flags.import_block)t.type=q.WORD;else if(this._flags.mode===_e.ObjectLiteral){var e=this._tokens.peek();e.text===":"&&(t.type=q.WORD)}}if(this.start_of_statement(t)?at(this._flags.last_token,["var","let","const"])&&t.type===q.WORD&&(this._flags.declaration_statement=!0):t.newlines&&!iu(this._flags.mode)&&(this._flags.last_token.type!==q.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==q.EQUALS&&(this._options.preserve_newlines||!at(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(t),this.print_newline()):this.handle_whitespace_and_comments(t),this._flags.do_block&&!this._flags.do_while)if(br(t,"while")){this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&br(t,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===_e.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&at(t,["case","default"])){this.print_newline(),this._flags.last_token.type!==q.END_BLOCK&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(t),this._flags.in_case=!0;return}if((this._flags.last_token.type===q.COMMA||this._flags.last_token.type===q.START_EXPR||this._flags.last_token.type===q.EQUALS||this._flags.last_token.type===q.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t)),br(t,"function")){(Me(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(Me(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===q.OPERATOR))&&!this._output.just_added_blankline()&&!t.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===q.RESERVED||this._flags.last_token.type===q.WORD?at(this._flags.last_token,["get","set","new","export"])||at(this._flags.last_token,Rh)?this._output.space_before_token=!0:br(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===q.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(iu(this._flags.mode)||Cs(this._flags.mode))||this.print_newline(),this.print_token(t),this._flags.last_word=t.text;return}var n="NONE";if(this._flags.last_token.type===q.END_BLOCK?this._previous_flags.inline_frame?n="SPACE":at(t,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&t.newlines?n="NEWLINE":(n="SPACE",this._output.space_before_token=!0):n="NEWLINE":this._flags.last_token.type===q.SEMICOLON&&this._flags.mode===_e.BlockStatement?n="NEWLINE":this._flags.last_token.type===q.SEMICOLON&&iu(this._flags.mode)?n="SPACE":this._flags.last_token.type===q.STRING?n="NEWLINE":this._flags.last_token.type===q.RESERVED||this._flags.last_token.type===q.WORD||this._flags.last_token.text==="*"&&(Me(this._last_last_text,["function","yield"])||this._flags.mode===_e.ObjectLiteral&&Me(this._last_last_text,["{",","]))?n="SPACE":this._flags.last_token.type===q.START_BLOCK?this._flags.inline_frame?n="SPACE":n="NEWLINE":this._flags.last_token.type===q.END_EXPR&&(this._output.space_before_token=!0,n="NEWLINE"),at(t,tu)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?n="SPACE":n="NEWLINE"),at(t,["else","catch","finally"]))if((!(this._flags.last_token.type===q.END_BLOCK&&this._previous_flags.mode===_e.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&t.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var r=this._output.current_line;r.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else n==="NEWLINE"?at(this._flags.last_token,kf)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&at(t,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==q.END_EXPR?(this._flags.last_token.type!==q.START_EXPR||!at(t,["var","let","const"]))&&this._flags.last_token.text!==":"&&(br(t,"if")&&br(t.previous,"else")?this._output.space_before_token=!0:this.print_newline()):at(t,tu)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&Cs(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():n==="SPACE"&&(this._output.space_before_token=!0);t.previous&&(t.previous.type===q.WORD||t.previous.type===q.RESERVED)&&(this._output.space_before_token=!0),this.print_token(t),this._flags.last_word=t.text,t.type===q.RESERVED&&(t.text==="do"?this._flags.do_block=!0:t.text==="if"?this._flags.if_block=!0:t.text==="import"?this._flags.import_block=!0:this._flags.import_block&&br(t,"from")&&(this._flags.import_block=!1))};Ke.prototype.handle_semicolon=function(t){this.start_of_statement(t)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(t);for(var e=this._tokens.peek();this._flags.mode===_e.Statement&&!(this._flags.if_block&&br(e,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(t)};Ke.prototype.handle_string=function(t){t.text.startsWith("`")&&t.newlines===0&&t.whitespace_before===""&&(t.previous.text===")"||this._flags.last_token.type===q.WORD)||(this.start_of_statement(t)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(t),this._flags.last_token.type===q.RESERVED||this._flags.last_token.type===q.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===q.COMMA||this._flags.last_token.type===q.START_EXPR||this._flags.last_token.type===q.EQUALS||this._flags.last_token.type===q.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t):t.text.startsWith("`")&&this._flags.last_token.type===q.END_EXPR&&(t.previous.text==="]"||t.previous.text===")")&&t.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(t)};Ke.prototype.handle_equals=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0};Ke.prototype.handle_comma=function(t){this.handle_whitespace_and_comments(t,!0),this.print_token(t),this._output.space_before_token=!0,this._flags.declaration_statement?(iu(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)):this._flags.mode===_e.ObjectLiteral||this._flags.mode===_e.Statement&&this._flags.parent.mode===_e.ObjectLiteral?(this._flags.mode===_e.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)};Ke.prototype.handle_operator=function(t){var e=t.text==="*"&&(at(this._flags.last_token,["function","yield"])||Me(this._flags.last_token.type,[q.START_BLOCK,q.COMMA,q.END_BLOCK,q.SEMICOLON])),n=Me(t.text,["-","+"])&&(Me(this._flags.last_token.type,[q.START_BLOCK,q.START_EXPR,q.EQUALS,q.OPERATOR])||Me(this._flags.last_token.text,tu)||this._flags.last_token.text===",");if(!this.start_of_statement(t)){var r=!e;this.handle_whitespace_and_comments(t,r)}if(at(this._flags.last_token,kf)){this._output.space_before_token=!0,this.print_token(t);return}if(t.text==="*"&&this._flags.last_token.type===q.DOT){this.print_token(t);return}if(t.text==="::"){this.print_token(t);return}if(this._flags.last_token.type===q.OPERATOR&&Me(this._options.operator_position,iS)&&this.allow_wrap_or_preserved_newline(t),t.text===":"&&this._flags.in_case){this.print_token(t),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==q.START_BLOCK?(this.indent(),this.print_newline()):this._output.space_before_token=!0;return}var i=!0,s=!0,o=!1;if(t.text===":"?this._flags.ternary_depth===0?i=!1:(this._flags.ternary_depth-=1,o=!0):t.text==="?"&&(this._flags.ternary_depth+=1),!n&&!e&&this._options.preserve_newlines&&Me(t.text,nu)){var a=t.text===":",l=a&&o,u=a&&!o;switch(this._options.operator_position){case ru.before_newline:this._output.space_before_token=!u,this.print_token(t),(!a||l)&&this.allow_wrap_or_preserved_newline(t),this._output.space_before_token=!0;return;case ru.after_newline:this._output.space_before_token=!0,!a||l?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(t):this._output.space_before_token=!1,this.print_token(t),this._output.space_before_token=!0;return;case ru.preserve_newline:u||this.allow_wrap_or_preserved_newline(t),i=!(this._output.just_added_newline()||u),this._output.space_before_token=i,this.print_token(t),this._output.space_before_token=!0;return}}if(e){this.allow_wrap_or_preserved_newline(t),i=!1;var c=this._tokens.peek();s=c&&Me(c.type,[q.WORD,q.RESERVED])}else t.text==="..."?(this.allow_wrap_or_preserved_newline(t),i=this._flags.last_token.type===q.START_BLOCK,s=!1):(Me(t.text,["--","++","!","~"])||n)&&((this._flags.last_token.type===q.COMMA||this._flags.last_token.type===q.START_EXPR)&&this.allow_wrap_or_preserved_newline(t),i=!1,s=!1,t.newlines&&(t.text==="--"||t.text==="++")&&this.print_newline(!1,!0),this._flags.last_token.text===";"&&iu(this._flags.mode)&&(i=!0),this._flags.last_token.type===q.RESERVED?i=!0:this._flags.last_token.type===q.END_EXPR?i=!(this._flags.last_token.text==="]"&&(t.text==="--"||t.text==="++")):this._flags.last_token.type===q.OPERATOR&&(i=Me(t.text,["--","-","++","+"])&&Me(this._flags.last_token.text,["--","-","++","+"]),Me(t.text,["+","-"])&&Me(this._flags.last_token.text,["--","++"])&&(s=!0)),(this._flags.mode===_e.BlockStatement&&!this._flags.inline_frame||this._flags.mode===_e.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline());this._output.space_before_token=this._output.space_before_token||i,this.print_token(t),this._output.space_before_token=s};Ke.prototype.handle_block_comment=function(t,e){if(this._output.raw){this._output.add_raw_token(t),t.directives&&t.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(t.directives){this.print_newline(!1,e),this.print_token(t),t.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!Df.newline.test(t.text)&&!t.newlines){this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0;return}else this.print_block_commment(t,e)};Ke.prototype.print_block_commment=function(t,e){var n=GM(t.text),r,i=!1,s=!1,o=t.whitespace_before,a=o.length;if(this.print_newline(!1,e),this.print_token_line_indentation(t),this._output.add_token(n[0]),this.print_newline(!1,e),n.length>1){for(n=n.slice(1),i=WM(n,"*"),s=HM(n,o),i&&(this._flags.alignment=1),r=0;r{"use strict";var YM=aS().Beautifier,KM=yh().Options;function $M(t,e){var n=new YM(t,e);return n.beautify()}Ah.exports=$M;Ah.exports.defaultOptions=function(){return new KM}});var xh=K((hne,fS)=>{"use strict";var uS=Ef().Options;function cS(t){uS.call(this,t,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var e=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||e;var n=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var r=0;r{"use strict";var zM=xh().Options,XM=Af().Output,QM=wf().InputScanner,JM=Of().Directives,pS=new JM(/\/\*/,/\*\//),dS=/\r\n|[\r\n]/,ZM=/\r\n|[\r\n]/g,Mf=/\s/,eF=/(?:\s|\n)+/g,tF=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,nF=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function Gi(t,e){this._source_text=t||"",this._options=new zM(e),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0}}Gi.prototype.eatString=function(t){var e="";for(this._ch=this._input.next();this._ch;){if(e+=this._ch,this._ch==="\\")e+=this._input.next();else if(t.indexOf(this._ch)!==-1||this._ch===` +`)break;this._ch=this._input.next()}return e};Gi.prototype.eatWhitespace=function(t){for(var e=Mf.test(this._input.peek()),n=0;Mf.test(this._input.peek());)this._ch=this._input.next(),t&&this._ch===` `&&(n===0||n0&&this._indentLevel--};Gi.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;e==="auto"&&(e=` -`,t&&fS.test(t||"")&&(e=t.match(fS)[0])),t=t.replace(zM,` -`);var n=t.match(/^[\t ]*/)[0];this._output=new YM(this._options,n),this._input=new KM(t),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var r=0,i=!1,s=!1,o=!1,a=!1,l=!1,u=this._ch,c,f,m;c=this._input.read(XM),f=c!=="",m=u,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),u=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var d=this._input.read(QM),p=cS.get_directives(d);p&&p.ignore==="start"&&(d+=cS.readIgnored(this._input)),this.print_string(d),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(JM)),this.eatWhitespace(!0);else if(this._ch==="@")if(this.preserveSingleSpace(f),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var _=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);_.match(/[ :]$/)&&(_=this.eatString(": ").replace(/\s$/,""),this.print_string(_),this._output.space_before_token=!0),_=_.replace(/\s$/,""),_==="extend"?a=!0:_==="import"&&(l=!0),_ in this.NESTED_AT_RULE?(this._nestedLevel+=1,_ in this.CONDITIONAL_GROUP_RULE&&(o=!0)):!i&&r===0&&_.indexOf(":")!==-1&&(s=!0,this.indent())}else this._ch==="#"&&this._input.peek()==="{"?(this.preserveSingleSpace(f),this.print_string(this._ch+this.eatString("}"))):this._ch==="{"?(s&&(s=!1,this.outdent()),o?(o=!1,i=this._indentLevel>=this._nestedLevel):i=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&i&&this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line()):this._ch==="}"?(this.outdent(),this._output.add_new_line(),m==="{"&&this._output.trim(!0),l=!1,a=!1,s&&(this.outdent(),s=!1),this.print_string(this._ch),i=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&this._input.peek()!=="}"&&this._output.add_new_line(!0)):this._ch===":"?(i||o)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!a&&r===0?(this.print_string(":"),s||(s=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":")):this._ch==='"'||this._ch==="'"?(this.preserveSingleSpace(f),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)):this._ch===";"?r===0?(s&&(this.outdent(),s=!1),a=!1,l=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0):this._ch==="("?this._input.lookBack("url")?(this.print_string(this._ch),this.eatWhitespace(),r++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),r&&(r--,this.outdent()))):(this.preserveSingleSpace(f),this.print_string(this._ch),this.eatWhitespace(),r++,this.indent()):this._ch===")"?(r&&(r--,this.outdent()),this.print_string(this._ch)):this._ch===","?(this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&!s&&r===0&&!l?this._output.add_new_line():this._output.space_before_token=!0):(this._ch===">"||this._ch==="+"||this._ch==="~")&&!s&&r===0?this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&kf.test(this._ch)&&(this._ch="")):this._ch==="]"?this.print_string(this._ch):this._ch==="["?(this.preserveSingleSpace(f),this.print_string(this._ch)):this._ch==="="?(this.eatWhitespace(),this.print_string("="),kf.test(this._ch)&&(this._ch="")):this._ch==="!"&&!this._input.lookBack("\\")?(this.print_string(" "),this.print_string(this._ch)):(this.preserveSingleSpace(f),this.print_string(this._ch));var C=this._output.get_code(e);return C};pS.exports.Beautifier=Gi});var mS=K((ine,Eh)=>{"use strict";var ZM=dS().Beautifier,eF=xh().Options;function tF(t,e){var n=new ZM(t,e);return n.beautify()}Eh.exports=tF;Eh.exports.defaultOptions=function(){return new eF}});var wh=K((sne,_S)=>{"use strict";var hS=xf().Options;function gS(t){hS.call(this,t,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}gS.prototype=new hS;_S.exports.Options=gS});var Dh=K((one,Lh)=>{"use strict";var yS=Ql().Tokenizer,Oh=Ql().TOKEN,nF=wf().Directives,rF=Ih().TemplatablePattern,iF=zl().Pattern,At={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:Oh.START,RAW:Oh.RAW,EOF:Oh.EOF},bS=new nF(/<\!--/,/-->/),gn=function(t,e){yS.call(this,t,e),this._current_tag_name="";var n=new rF(this._input).read_options(this._options),r=new iF(this._input);if(this.__patterns={word:n.until(/[\n\r\t <]/),single_quote:n.until_after(/'/),double_quote:n.until_after(/"/),attribute:n.until(/[\n\r\t =>]|\/>/),element_name:n.until(/[\n\r\t >\/]/),handlebars_comment:r.starting_with(/{{!--/).until_after(/--}}/),handlebars:r.starting_with(/{{/).until_after(/}}/),handlebars_open:r.until(/[\n\r\t }]/),handlebars_raw_close:r.until(/}}/),comment:r.starting_with(//),cdata:r.starting_with(//),conditional_comment:r.starting_with(//),processing:r.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var i=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=r.matching(i).until_after(i)}};gn.prototype=new yS;gn.prototype._is_comment=function(t){return!1};gn.prototype._is_opening=function(t){return t.type===At.TAG_OPEN};gn.prototype._is_closing=function(t,e){return t.type===At.TAG_CLOSE&&e&&((t.text===">"||t.text==="/>")&&e.text[0]==="<"||t.text==="}}"&&e.text[0]==="{"&&e.text[1]==="{")};gn.prototype._reset=function(){this._current_tag_name=""};gn.prototype._get_next_token=function(t,e){var n=null;this._readWhitespace();var r=this._input.peek();return r===null?this._create_token(At.EOF,""):(n=n||this._read_open_handlebars(r,e),n=n||this._read_attribute(r,t,e),n=n||this._read_close(r,e),n=n||this._read_raw_content(r,t,e),n=n||this._read_content_word(r),n=n||this._read_comment_or_cdata(r),n=n||this._read_processing(r),n=n||this._read_open(r,e),n=n||this._create_token(At.UNKNOWN,this._input.next()),n)};gn.prototype._read_comment_or_cdata=function(t){var e=null,n=null,r=null;if(t==="<"){var i=this._input.peek(1);i==="!"&&(n=this.__patterns.comment.read(),n?(r=bS.get_directives(n),r&&r.ignore==="start"&&(n+=bS.readIgnored(this._input))):n=this.__patterns.cdata.read()),n&&(e=this._create_token(At.COMMENT,n),e.directives=r)}return e};gn.prototype._read_processing=function(t){var e=null,n=null,r=null;if(t==="<"){var i=this._input.peek(1);(i==="!"||i==="?")&&(n=this.__patterns.conditional_comment.read(),n=n||this.__patterns.processing.read()),n&&(e=this._create_token(At.COMMENT,n),e.directives=r)}return e};gn.prototype._read_open=function(t,e){var n=null,r=null;return e||t==="<"&&(n=this._input.next(),this._input.peek()==="/"&&(n+=this._input.next()),n+=this.__patterns.element_name.read(),r=this._create_token(At.TAG_OPEN,n)),r};gn.prototype._read_open_handlebars=function(t,e){var n=null,r=null;return e||this._options.indent_handlebars&&t==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(n=this.__patterns.handlebars_comment.read(),n=n||this.__patterns.handlebars.read(),r=this._create_token(At.COMMENT,n)):(n=this.__patterns.handlebars_open.read(),r=this._create_token(At.TAG_OPEN,n))),r};gn.prototype._read_close=function(t,e){var n=null,r=null;return e&&(e.text[0]==="<"&&(t===">"||t==="/"&&this._input.peek(1)===">")?(n=this._input.next(),t==="/"&&(n+=this._input.next()),r=this._create_token(At.TAG_CLOSE,n)):e.text[0]==="{"&&t==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),r=this._create_token(At.TAG_CLOSE,"}}"))),r};gn.prototype._read_attribute=function(t,e,n){var r=null,i="";if(n&&n.text[0]==="<")if(t==="=")r=this._create_token(At.EQUALS,this._input.next());else if(t==='"'||t==="'"){var s=this._input.next();t==='"'?s+=this.__patterns.double_quote.read():s+=this.__patterns.single_quote.read(),r=this._create_token(At.VALUE,s)}else i=this.__patterns.attribute.read(),i&&(e.type===At.EQUALS?r=this._create_token(At.VALUE,i):r=this._create_token(At.ATTRIBUTE,i));return r};gn.prototype._is_content_unformatted=function(t){return this._options.void_elements.indexOf(t)===-1&&(this._options.content_unformatted.indexOf(t)!==-1||this._options.unformatted.indexOf(t)!==-1)};gn.prototype._read_raw_content=function(t,e,n){var r="";if(n&&n.text[0]==="{")r=this.__patterns.handlebars_raw_close.read();else if(e.type===At.TAG_CLOSE&&e.opened.text[0]==="<"&&e.text[0]!=="/"){var i=e.opened.text.substr(1).toLowerCase();if(i==="script"||i==="style"){var s=this._read_comment_or_cdata(t);if(s)return s.type=At.TEXT,s;r=this._input.readUntil(new RegExp("","ig"))}else this._is_content_unformatted(i)&&(r=this._input.readUntil(new RegExp("","ig")))}return r?this._create_token(At.TEXT,r):null};gn.prototype._read_content_word=function(t){var e="";if(this._options.unformatted_content_delimiter&&t===this._options.unformatted_content_delimiter[0]&&(e=this.__patterns.unformatted_content_delimiter.read()),e||(e=this.__patterns.word.read()),e)return this._create_token(At.TEXT,e)};Lh.exports.Tokenizer=gn;Lh.exports.TOKEN=At});var PS=K((ane,vS)=>{"use strict";var sF=wh().Options,oF=Rf().Output,aF=Dh().Tokenizer,tt=Dh().TOKEN,TS=/\r\n|[\r\n]/,lF=/\r\n|[\r\n]/g,br=function(t,e){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=t.max_preserve_newlines,this.preserve_newlines=t.preserve_newlines,this._output=new oF(t,e)};br.prototype.current_line_has_match=function(t){return this._output.current_line.has_match(t)};br.prototype.set_space_before_token=function(t,e){this._output.space_before_token=t,this._output.non_breaking_space=e};br.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()};br.prototype.add_raw_token=function(t){this._output.add_raw_token(t)};br.prototype.print_preserved_newlines=function(t){var e=0;t.type!==tt.TEXT&&t.previous.type!==tt.TEXT&&(e=t.newlines?1:0),this.preserve_newlines&&(e=t.newlines0);return e!==0};br.prototype.traverse_whitespace=function(t){return t.whitespace_before||t.newlines?(this.print_preserved_newlines(t)||(this._output.space_before_token=!0),!0):!1};br.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped};br.prototype.print_newline=function(t){this._output.add_new_line(t)};br.prototype.print_token=function(t){t.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(t.text))};br.prototype.indent=function(){this.indent_level++};br.prototype.get_full_indent=function(t){return t=this.indent_level+(t||0),t<1?"":this._output.get_indent_string(t)};var uF=function(t){for(var e=null,n=t.next;n.type!==tt.EOF&&t.closed!==n;){if(n.type===tt.ATTRIBUTE&&n.text==="type"){n.next&&n.next.type===tt.EQUALS&&n.next.next&&n.next.next.type===tt.VALUE&&(e=n.next.next.text);break}n=n.next}return e},cF=function(t,e){var n=null,r=null;return e.closed?(t==="script"?n="text/javascript":t==="style"&&(n="text/css"),n=uF(e)||n,n.search("text/css")>-1?r="css":n.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?r="javascript":n.search(/(text|application|dojo)\/(x-)?(html)/)>-1?r="html":n.search(/test\/null/)>-1&&(r="null"),r):null};function iu(t,e){return e.indexOf(t)!==-1}function fF(t,e,n){this.parent=t||null,this.tag=e?e.tag_name:"",this.indent_level=n||0,this.parser_token=e||null}function ho(t){this._printer=t,this._current_frame=null}ho.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null};ho.prototype.record_tag=function(t){var e=new fF(this._current_frame,t,this._printer.indent_level);this._current_frame=e};ho.prototype._try_pop_frame=function(t){var e=null;return t&&(e=t.parser_token,this._printer.indent_level=t.indent_level,this._current_frame=t.parent),e};ho.prototype._get_frame=function(t,e){for(var n=this._current_frame;n&&t.indexOf(n.tag)===-1;){if(e&&e.indexOf(n.tag)!==-1){n=null;break}n=n.parent}return n};ho.prototype.try_pop=function(t,e){var n=this._get_frame([t],e);return this._try_pop_frame(n)};ho.prototype.indent_to_tag=function(t){var e=this._get_frame(t);e&&(this._printer.indent_level=e.indent_level)};function Tr(t,e,n,r){this._source_text=t||"",e=e||{},this._js_beautify=n,this._css_beautify=r,this._tag_stack=null;var i=new sF(e,"html");this._options=i,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}Tr.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;this._options.eol==="auto"&&(e=` -`,t&&TS.test(t)&&(e=t.match(TS)[0])),t=t.replace(lF,` -`);var n=t.match(/^[\t ]*/)[0],r={text:"",type:""},i=new NS,s=new br(this._options,n),o=new aF(t,this._options).tokenize();this._tag_stack=new ho(s);for(var a=null,l=o.next();l.type!==tt.EOF;)l.type===tt.TAG_OPEN||l.type===tt.COMMENT?(a=this._handle_tag_open(s,l,i,r),i=a):l.type===tt.ATTRIBUTE||l.type===tt.EQUALS||l.type===tt.VALUE||l.type===tt.TEXT&&!i.tag_complete?a=this._handle_inside_tag(s,l,i,o):l.type===tt.TAG_CLOSE?a=this._handle_tag_close(s,l,i):l.type===tt.TEXT?a=this._handle_text(s,l,i):s.add_raw_token(l),r=a,l=o.next();var u=s._output.get_code(e);return u};Tr.prototype._handle_tag_close=function(t,e,n){var r={text:e.text,type:e.type};return t.alignment_size=0,n.tag_complete=!0,t.set_space_before_token(e.newlines||e.whitespace_before!=="",!0),n.is_unformatted?t.add_raw_token(e):(n.tag_start_char==="<"&&(t.set_space_before_token(e.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&n.has_wrapped_attrs&&t.print_newline(!1)),t.print_token(e)),n.indent_content&&!(n.is_unformatted||n.is_content_unformatted)&&(t.indent(),n.indent_content=!1),!n.is_inline_element&&!(n.is_unformatted||n.is_content_unformatted)&&t.set_wrap_point(),r};Tr.prototype._handle_inside_tag=function(t,e,n,r){var i=n.has_wrapped_attrs,s={text:e.text,type:e.type};if(t.set_space_before_token(e.newlines||e.whitespace_before!=="",!0),n.is_unformatted)t.add_raw_token(e);else if(n.tag_start_char==="{"&&e.type===tt.TEXT)t.print_preserved_newlines(e)?(e.newlines=0,t.add_raw_token(e)):t.print_token(e);else{if(e.type===tt.ATTRIBUTE?(t.set_space_before_token(!0),n.attr_count+=1):(e.type===tt.EQUALS||e.type===tt.VALUE&&e.previous.type===tt.EQUALS)&&t.set_space_before_token(!1),e.type===tt.ATTRIBUTE&&n.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(t.traverse_whitespace(e),i=i||e.newlines!==0),this._is_wrap_attributes_force)){var o=n.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&n.attr_count===1){var a=!0,l=0,u;do{if(u=r.peek(l),u.type===tt.ATTRIBUTE){a=!1;break}l+=1}while(l<4&&u.type!==tt.EOF&&u.type!==tt.TAG_CLOSE);o=!a}o&&(t.print_newline(!1),i=!0)}t.print_token(e),i=i||t.previous_token_wrapped(),n.has_wrapped_attrs=i}return s};Tr.prototype._handle_text=function(t,e,n){var r={text:e.text,type:"TK_CONTENT"};return n.custom_beautifier_name?this._print_custom_beatifier_text(t,e,n):n.is_unformatted||n.is_content_unformatted?t.add_raw_token(e):(t.traverse_whitespace(e),t.print_token(e)),r};Tr.prototype._print_custom_beatifier_text=function(t,e,n){var r=this;if(e.text!==""){var i=e.text,s,o=1,a="",l="";n.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?s=this._js_beautify:n.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?s=this._css_beautify:n.custom_beautifier_name==="html"&&(s=function(p,_){var C=new Tr(p,_,r._js_beautify,r._css_beautify);return C.beautify()}),this._options.indent_scripts==="keep"?o=0:this._options.indent_scripts==="separate"&&(o=-t.indent_level);var u=t.get_full_indent(o);if(i=i.replace(/\n[ \t]*$/,""),n.custom_beautifier_name!=="html"&&i[0]==="<"&&i.match(/^(|]]>)$/.exec(i);if(!c){t.add_raw_token(e);return}a=u+c[1]+` +`,t&&dS.test(t||"")&&(e=t.match(dS)[0])),t=t.replace(ZM,` +`);var n=t.match(/^[\t ]*/)[0];this._output=new XM(this._options,n),this._input=new QM(t),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var r=0,i=!1,s=!1,o=!1,a=!1,l=!1,u=this._ch,c,f,m;c=this._input.read(eF),f=c!=="",m=u,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),u=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var p=this._input.read(tF),d=pS.get_directives(p);d&&d.ignore==="start"&&(p+=pS.readIgnored(this._input)),this.print_string(p),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(nF)),this.eatWhitespace(!0);else if(this._ch==="@")if(this.preserveSingleSpace(f),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var _=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);_.match(/[ :]$/)&&(_=this.eatString(": ").replace(/\s$/,""),this.print_string(_),this._output.space_before_token=!0),_=_.replace(/\s$/,""),_==="extend"?a=!0:_==="import"&&(l=!0),_ in this.NESTED_AT_RULE?(this._nestedLevel+=1,_ in this.CONDITIONAL_GROUP_RULE&&(o=!0)):!i&&r===0&&_.indexOf(":")!==-1&&(s=!0,this.indent())}else this._ch==="#"&&this._input.peek()==="{"?(this.preserveSingleSpace(f),this.print_string(this._ch+this.eatString("}"))):this._ch==="{"?(s&&(s=!1,this.outdent()),o?(o=!1,i=this._indentLevel>=this._nestedLevel):i=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&i&&this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line()):this._ch==="}"?(this.outdent(),this._output.add_new_line(),m==="{"&&this._output.trim(!0),l=!1,a=!1,s&&(this.outdent(),s=!1),this.print_string(this._ch),i=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&this._input.peek()!=="}"&&this._output.add_new_line(!0)):this._ch===":"?(i||o)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!a&&r===0?(this.print_string(":"),s||(s=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":")):this._ch==='"'||this._ch==="'"?(this.preserveSingleSpace(f),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)):this._ch===";"?r===0?(s&&(this.outdent(),s=!1),a=!1,l=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0):this._ch==="("?this._input.lookBack("url")?(this.print_string(this._ch),this.eatWhitespace(),r++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),r&&(r--,this.outdent()))):(this.preserveSingleSpace(f),this.print_string(this._ch),this.eatWhitespace(),r++,this.indent()):this._ch===")"?(r&&(r--,this.outdent()),this.print_string(this._ch)):this._ch===","?(this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&!s&&r===0&&!l?this._output.add_new_line():this._output.space_before_token=!0):(this._ch===">"||this._ch==="+"||this._ch==="~")&&!s&&r===0?this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&Mf.test(this._ch)&&(this._ch="")):this._ch==="]"?this.print_string(this._ch):this._ch==="["?(this.preserveSingleSpace(f),this.print_string(this._ch)):this._ch==="="?(this.eatWhitespace(),this.print_string("="),Mf.test(this._ch)&&(this._ch="")):this._ch==="!"&&!this._input.lookBack("\\")?(this.print_string(" "),this.print_string(this._ch)):(this.preserveSingleSpace(f),this.print_string(this._ch));var C=this._output.get_code(e);return C};mS.exports.Beautifier=Gi});var gS=K((_ne,Eh)=>{"use strict";var rF=hS().Beautifier,iF=xh().Options;function sF(t,e){var n=new rF(t,e);return n.beautify()}Eh.exports=sF;Eh.exports.defaultOptions=function(){return new iF}});var wh=K((yne,bS)=>{"use strict";var _S=Ef().Options;function yS(t){_S.call(this,t,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}yS.prototype=new _S;bS.exports.Options=yS});var Dh=K((bne,Lh)=>{"use strict";var TS=Jl().Tokenizer,Oh=Jl().TOKEN,oF=Of().Directives,aF=Ih().TemplatablePattern,lF=Xl().Pattern,At={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:Oh.START,RAW:Oh.RAW,EOF:Oh.EOF},NS=new oF(/<\!--/,/-->/),gn=function(t,e){TS.call(this,t,e),this._current_tag_name="";var n=new aF(this._input).read_options(this._options),r=new lF(this._input);if(this.__patterns={word:n.until(/[\n\r\t <]/),single_quote:n.until_after(/'/),double_quote:n.until_after(/"/),attribute:n.until(/[\n\r\t =>]|\/>/),element_name:n.until(/[\n\r\t >\/]/),handlebars_comment:r.starting_with(/{{!--/).until_after(/--}}/),handlebars:r.starting_with(/{{/).until_after(/}}/),handlebars_open:r.until(/[\n\r\t }]/),handlebars_raw_close:r.until(/}}/),comment:r.starting_with(//),cdata:r.starting_with(//),conditional_comment:r.starting_with(//),processing:r.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var i=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=r.matching(i).until_after(i)}};gn.prototype=new TS;gn.prototype._is_comment=function(t){return!1};gn.prototype._is_opening=function(t){return t.type===At.TAG_OPEN};gn.prototype._is_closing=function(t,e){return t.type===At.TAG_CLOSE&&e&&((t.text===">"||t.text==="/>")&&e.text[0]==="<"||t.text==="}}"&&e.text[0]==="{"&&e.text[1]==="{")};gn.prototype._reset=function(){this._current_tag_name=""};gn.prototype._get_next_token=function(t,e){var n=null;this._readWhitespace();var r=this._input.peek();return r===null?this._create_token(At.EOF,""):(n=n||this._read_open_handlebars(r,e),n=n||this._read_attribute(r,t,e),n=n||this._read_close(r,e),n=n||this._read_raw_content(r,t,e),n=n||this._read_content_word(r),n=n||this._read_comment_or_cdata(r),n=n||this._read_processing(r),n=n||this._read_open(r,e),n=n||this._create_token(At.UNKNOWN,this._input.next()),n)};gn.prototype._read_comment_or_cdata=function(t){var e=null,n=null,r=null;if(t==="<"){var i=this._input.peek(1);i==="!"&&(n=this.__patterns.comment.read(),n?(r=NS.get_directives(n),r&&r.ignore==="start"&&(n+=NS.readIgnored(this._input))):n=this.__patterns.cdata.read()),n&&(e=this._create_token(At.COMMENT,n),e.directives=r)}return e};gn.prototype._read_processing=function(t){var e=null,n=null,r=null;if(t==="<"){var i=this._input.peek(1);(i==="!"||i==="?")&&(n=this.__patterns.conditional_comment.read(),n=n||this.__patterns.processing.read()),n&&(e=this._create_token(At.COMMENT,n),e.directives=r)}return e};gn.prototype._read_open=function(t,e){var n=null,r=null;return e||t==="<"&&(n=this._input.next(),this._input.peek()==="/"&&(n+=this._input.next()),n+=this.__patterns.element_name.read(),r=this._create_token(At.TAG_OPEN,n)),r};gn.prototype._read_open_handlebars=function(t,e){var n=null,r=null;return e||this._options.indent_handlebars&&t==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(n=this.__patterns.handlebars_comment.read(),n=n||this.__patterns.handlebars.read(),r=this._create_token(At.COMMENT,n)):(n=this.__patterns.handlebars_open.read(),r=this._create_token(At.TAG_OPEN,n))),r};gn.prototype._read_close=function(t,e){var n=null,r=null;return e&&(e.text[0]==="<"&&(t===">"||t==="/"&&this._input.peek(1)===">")?(n=this._input.next(),t==="/"&&(n+=this._input.next()),r=this._create_token(At.TAG_CLOSE,n)):e.text[0]==="{"&&t==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),r=this._create_token(At.TAG_CLOSE,"}}"))),r};gn.prototype._read_attribute=function(t,e,n){var r=null,i="";if(n&&n.text[0]==="<")if(t==="=")r=this._create_token(At.EQUALS,this._input.next());else if(t==='"'||t==="'"){var s=this._input.next();t==='"'?s+=this.__patterns.double_quote.read():s+=this.__patterns.single_quote.read(),r=this._create_token(At.VALUE,s)}else i=this.__patterns.attribute.read(),i&&(e.type===At.EQUALS?r=this._create_token(At.VALUE,i):r=this._create_token(At.ATTRIBUTE,i));return r};gn.prototype._is_content_unformatted=function(t){return this._options.void_elements.indexOf(t)===-1&&(this._options.content_unformatted.indexOf(t)!==-1||this._options.unformatted.indexOf(t)!==-1)};gn.prototype._read_raw_content=function(t,e,n){var r="";if(n&&n.text[0]==="{")r=this.__patterns.handlebars_raw_close.read();else if(e.type===At.TAG_CLOSE&&e.opened.text[0]==="<"&&e.text[0]!=="/"){var i=e.opened.text.substr(1).toLowerCase();if(i==="script"||i==="style"){var s=this._read_comment_or_cdata(t);if(s)return s.type=At.TEXT,s;r=this._input.readUntil(new RegExp("","ig"))}else this._is_content_unformatted(i)&&(r=this._input.readUntil(new RegExp("","ig")))}return r?this._create_token(At.TEXT,r):null};gn.prototype._read_content_word=function(t){var e="";if(this._options.unformatted_content_delimiter&&t===this._options.unformatted_content_delimiter[0]&&(e=this.__patterns.unformatted_content_delimiter.read()),e||(e=this.__patterns.word.read()),e)return this._create_token(At.TEXT,e)};Lh.exports.Tokenizer=gn;Lh.exports.TOKEN=At});var SS=K((Tne,IS)=>{"use strict";var uF=wh().Options,cF=Af().Output,fF=Dh().Tokenizer,tt=Dh().TOKEN,vS=/\r\n|[\r\n]/,pF=/\r\n|[\r\n]/g,Tr=function(t,e){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=t.max_preserve_newlines,this.preserve_newlines=t.preserve_newlines,this._output=new cF(t,e)};Tr.prototype.current_line_has_match=function(t){return this._output.current_line.has_match(t)};Tr.prototype.set_space_before_token=function(t,e){this._output.space_before_token=t,this._output.non_breaking_space=e};Tr.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()};Tr.prototype.add_raw_token=function(t){this._output.add_raw_token(t)};Tr.prototype.print_preserved_newlines=function(t){var e=0;t.type!==tt.TEXT&&t.previous.type!==tt.TEXT&&(e=t.newlines?1:0),this.preserve_newlines&&(e=t.newlines0);return e!==0};Tr.prototype.traverse_whitespace=function(t){return t.whitespace_before||t.newlines?(this.print_preserved_newlines(t)||(this._output.space_before_token=!0),!0):!1};Tr.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped};Tr.prototype.print_newline=function(t){this._output.add_new_line(t)};Tr.prototype.print_token=function(t){t.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(t.text))};Tr.prototype.indent=function(){this.indent_level++};Tr.prototype.get_full_indent=function(t){return t=this.indent_level+(t||0),t<1?"":this._output.get_indent_string(t)};var dF=function(t){for(var e=null,n=t.next;n.type!==tt.EOF&&t.closed!==n;){if(n.type===tt.ATTRIBUTE&&n.text==="type"){n.next&&n.next.type===tt.EQUALS&&n.next.next&&n.next.next.type===tt.VALUE&&(e=n.next.next.text);break}n=n.next}return e},mF=function(t,e){var n=null,r=null;return e.closed?(t==="script"?n="text/javascript":t==="style"&&(n="text/css"),n=dF(e)||n,n.search("text/css")>-1?r="css":n.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?r="javascript":n.search(/(text|application|dojo)\/(x-)?(html)/)>-1?r="html":n.search(/test\/null/)>-1&&(r="null"),r):null};function su(t,e){return e.indexOf(t)!==-1}function hF(t,e,n){this.parent=t||null,this.tag=e?e.tag_name:"",this.indent_level=n||0,this.parser_token=e||null}function ho(t){this._printer=t,this._current_frame=null}ho.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null};ho.prototype.record_tag=function(t){var e=new hF(this._current_frame,t,this._printer.indent_level);this._current_frame=e};ho.prototype._try_pop_frame=function(t){var e=null;return t&&(e=t.parser_token,this._printer.indent_level=t.indent_level,this._current_frame=t.parent),e};ho.prototype._get_frame=function(t,e){for(var n=this._current_frame;n&&t.indexOf(n.tag)===-1;){if(e&&e.indexOf(n.tag)!==-1){n=null;break}n=n.parent}return n};ho.prototype.try_pop=function(t,e){var n=this._get_frame([t],e);return this._try_pop_frame(n)};ho.prototype.indent_to_tag=function(t){var e=this._get_frame(t);e&&(this._printer.indent_level=e.indent_level)};function Nr(t,e,n,r){this._source_text=t||"",e=e||{},this._js_beautify=n,this._css_beautify=r,this._tag_stack=null;var i=new uF(e,"html");this._options=i,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}Nr.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;this._options.eol==="auto"&&(e=` +`,t&&vS.test(t)&&(e=t.match(vS)[0])),t=t.replace(pF,` +`);var n=t.match(/^[\t ]*/)[0],r={text:"",type:""},i=new PS,s=new Tr(this._options,n),o=new fF(t,this._options).tokenize();this._tag_stack=new ho(s);for(var a=null,l=o.next();l.type!==tt.EOF;)l.type===tt.TAG_OPEN||l.type===tt.COMMENT?(a=this._handle_tag_open(s,l,i,r),i=a):l.type===tt.ATTRIBUTE||l.type===tt.EQUALS||l.type===tt.VALUE||l.type===tt.TEXT&&!i.tag_complete?a=this._handle_inside_tag(s,l,i,o):l.type===tt.TAG_CLOSE?a=this._handle_tag_close(s,l,i):l.type===tt.TEXT?a=this._handle_text(s,l,i):s.add_raw_token(l),r=a,l=o.next();var u=s._output.get_code(e);return u};Nr.prototype._handle_tag_close=function(t,e,n){var r={text:e.text,type:e.type};return t.alignment_size=0,n.tag_complete=!0,t.set_space_before_token(e.newlines||e.whitespace_before!=="",!0),n.is_unformatted?t.add_raw_token(e):(n.tag_start_char==="<"&&(t.set_space_before_token(e.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&n.has_wrapped_attrs&&t.print_newline(!1)),t.print_token(e)),n.indent_content&&!(n.is_unformatted||n.is_content_unformatted)&&(t.indent(),n.indent_content=!1),!n.is_inline_element&&!(n.is_unformatted||n.is_content_unformatted)&&t.set_wrap_point(),r};Nr.prototype._handle_inside_tag=function(t,e,n,r){var i=n.has_wrapped_attrs,s={text:e.text,type:e.type};if(t.set_space_before_token(e.newlines||e.whitespace_before!=="",!0),n.is_unformatted)t.add_raw_token(e);else if(n.tag_start_char==="{"&&e.type===tt.TEXT)t.print_preserved_newlines(e)?(e.newlines=0,t.add_raw_token(e)):t.print_token(e);else{if(e.type===tt.ATTRIBUTE?(t.set_space_before_token(!0),n.attr_count+=1):(e.type===tt.EQUALS||e.type===tt.VALUE&&e.previous.type===tt.EQUALS)&&t.set_space_before_token(!1),e.type===tt.ATTRIBUTE&&n.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(t.traverse_whitespace(e),i=i||e.newlines!==0),this._is_wrap_attributes_force)){var o=n.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&n.attr_count===1){var a=!0,l=0,u;do{if(u=r.peek(l),u.type===tt.ATTRIBUTE){a=!1;break}l+=1}while(l<4&&u.type!==tt.EOF&&u.type!==tt.TAG_CLOSE);o=!a}o&&(t.print_newline(!1),i=!0)}t.print_token(e),i=i||t.previous_token_wrapped(),n.has_wrapped_attrs=i}return s};Nr.prototype._handle_text=function(t,e,n){var r={text:e.text,type:"TK_CONTENT"};return n.custom_beautifier_name?this._print_custom_beatifier_text(t,e,n):n.is_unformatted||n.is_content_unformatted?t.add_raw_token(e):(t.traverse_whitespace(e),t.print_token(e)),r};Nr.prototype._print_custom_beatifier_text=function(t,e,n){var r=this;if(e.text!==""){var i=e.text,s,o=1,a="",l="";n.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?s=this._js_beautify:n.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?s=this._css_beautify:n.custom_beautifier_name==="html"&&(s=function(d,_){var C=new Nr(d,_,r._js_beautify,r._css_beautify);return C.beautify()}),this._options.indent_scripts==="keep"?o=0:this._options.indent_scripts==="separate"&&(o=-t.indent_level);var u=t.get_full_indent(o);if(i=i.replace(/\n[ \t]*$/,""),n.custom_beautifier_name!=="html"&&i[0]==="<"&&i.match(/^(|]]>)$/.exec(i);if(!c){t.add_raw_token(e);return}a=u+c[1]+` `,i=c[4],c[5]&&(l=u+c[5]),i=i.replace(/\n[ \t]*$/,""),(c[2]||c[3].indexOf(` `)!==-1)&&(c=c[3].match(/[ \t]+$/),c&&(e.whitespace_before=c[0]))}if(i)if(s){var f=function(){this.eol=` -`};f.prototype=this._options.raw_options;var m=new f;i=s(u+i,m)}else{var d=e.whitespace_before;d&&(i=i.replace(new RegExp(` -(`+d+")?","g"),` +`};f.prototype=this._options.raw_options;var m=new f;i=s(u+i,m)}else{var p=e.whitespace_before;p&&(i=i.replace(new RegExp(` +(`+p+")?","g"),` `)),i=u+i.replace(/\n/g,` `+u)}a&&(i?i=a+i+` -`+l:i=a+l),t.print_newline(!1),i&&(e.text=i,e.whitespace_before="",e.newlines=0,t.add_raw_token(e),t.print_newline(!0))}};Tr.prototype._handle_tag_open=function(t,e,n,r){var i=this._get_tag_open_token(e);return(n.is_unformatted||n.is_content_unformatted)&&!n.is_empty_element&&e.type===tt.TAG_OPEN&&e.text.indexOf("]*)/),this.tag_check=n?n[1]:""):(n=e.text.match(/^{{(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=n?n[1]:"",e.text==="{{#>"&&this.tag_check===">"&&e.next!==null&&(this.tag_check=e.next.text)),this.tag_check=this.tag_check.toLowerCase(),e.type===tt.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||e.closed&&e.closed.text==="/>",this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(2)))}};Tr.prototype._get_tag_open_token=function(t){var e=new NS(this._tag_stack.get_parser_token(),t);return e.alignment_size=this._options.wrap_attributes_indent_size,e.is_end_tag=e.is_end_tag||iu(e.tag_check,this._options.void_elements),e.is_empty_element=e.tag_complete||e.is_start_tag&&e.is_end_tag,e.is_unformatted=!e.tag_complete&&iu(e.tag_check,this._options.unformatted),e.is_content_unformatted=!e.is_empty_element&&iu(e.tag_check,this._options.content_unformatted),e.is_inline_element=iu(e.tag_name,this._options.inline)||e.tag_start_char==="{",e};Tr.prototype._set_tag_position=function(t,e,n,r,i){if(n.is_empty_element||(n.is_end_tag?n.start_tag_token=this._tag_stack.try_pop(n.tag_name):(this._do_optional_end_element(n)&&(n.is_inline_element||t.print_newline(!1)),this._tag_stack.record_tag(n),(n.tag_name==="script"||n.tag_name==="style")&&!(n.is_unformatted||n.is_content_unformatted)&&(n.custom_beautifier_name=cF(n.tag_check,e)))),iu(n.tag_check,this._options.extra_liners)&&(t.print_newline(!1),t._output.just_added_blankline()||t.print_newline(!0)),n.is_empty_element){if(n.tag_start_char==="{"&&n.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),n.indent_content=!0;var s=t.current_line_has_match(/{{#if/);s||t.print_newline(!1)}n.tag_name==="!--"&&i.type===tt.TAG_CLOSE&&r.is_end_tag&&n.text.indexOf(` -`)===-1||(n.is_inline_element||n.is_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,n))}else if(n.is_end_tag){var o=!1;o=n.start_tag_token&&n.start_tag_token.multiline_content,o=o||!n.is_inline_element&&!(r.is_inline_element||r.is_unformatted)&&!(i.type===tt.TAG_CLOSE&&n.start_tag_token===r)&&i.type!=="TK_CONTENT",(n.is_content_unformatted||n.is_unformatted)&&(o=!1),o&&t.print_newline(!1)}else n.indent_content=!n.custom_beautifier_name,n.tag_start_char==="<"&&(n.tag_name==="html"?n.indent_content=this._options.indent_inner_html:n.tag_name==="head"?n.indent_content=this._options.indent_head_inner_html:n.tag_name==="body"&&(n.indent_content=this._options.indent_body_inner_html)),!(n.is_inline_element||n.is_unformatted)&&(i.type!=="TK_CONTENT"||n.is_content_unformatted)&&t.print_newline(!1),this._calcluate_parent_multiline(t,n)};Tr.prototype._calcluate_parent_multiline=function(t,e){e.parent&&t._output.just_added_newline()&&!((e.is_inline_element||e.is_unformatted)&&e.parent.is_inline_element)&&(e.parent.multiline_content=!0)};var pF=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],dF=["a","audio","del","ins","map","noscript","video"];Tr.prototype._do_optional_end_element=function(t){var e=null;if(!(t.is_empty_element||!t.is_start_tag||!t.parent)){if(t.tag_name==="body")e=e||this._tag_stack.try_pop("head");else if(t.tag_name==="li")e=e||this._tag_stack.try_pop("li",["ol","ul"]);else if(t.tag_name==="dd"||t.tag_name==="dt")e=e||this._tag_stack.try_pop("dt",["dl"]),e=e||this._tag_stack.try_pop("dd",["dl"]);else if(t.parent.tag_name==="p"&&pF.indexOf(t.tag_name)!==-1){var n=t.parent.parent;(!n||dF.indexOf(n.tag_name)===-1)&&(e=e||this._tag_stack.try_pop("p"))}else t.tag_name==="rp"||t.tag_name==="rt"?(e=e||this._tag_stack.try_pop("rt",["ruby","rtc"]),e=e||this._tag_stack.try_pop("rp",["ruby","rtc"])):t.tag_name==="optgroup"?e=e||this._tag_stack.try_pop("optgroup",["select"]):t.tag_name==="option"?e=e||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):t.tag_name==="colgroup"?e=e||this._tag_stack.try_pop("caption",["table"]):t.tag_name==="thead"?(e=e||this._tag_stack.try_pop("caption",["table"]),e=e||this._tag_stack.try_pop("colgroup",["table"])):t.tag_name==="tbody"||t.tag_name==="tfoot"?(e=e||this._tag_stack.try_pop("caption",["table"]),e=e||this._tag_stack.try_pop("colgroup",["table"]),e=e||this._tag_stack.try_pop("thead",["table"]),e=e||this._tag_stack.try_pop("tbody",["table"])):t.tag_name==="tr"?(e=e||this._tag_stack.try_pop("caption",["table"]),e=e||this._tag_stack.try_pop("colgroup",["table"]),e=e||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(t.tag_name==="th"||t.tag_name==="td")&&(e=e||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),e=e||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return t.parent=this._tag_stack.get_parser_token(),e}};vS.exports.Beautifier=Tr});var IS=K((lne,kh)=>{"use strict";var mF=PS().Beautifier,hF=wh().Options;function gF(t,e,n,r){var i=new mF(t,e,n,r);return i.beautify()}kh.exports=gF;kh.exports.defaultOptions=function(){return new hF}});var xS=K((une,Mf)=>{"use strict";var SS=oS(),CS=mS(),RS=IS();function AS(t,e,n,r){return n=n||SS,r=r||CS,RS(t,e,n,r)}AS.defaultOptions=RS.defaultOptions;Mf.exports.js=SS;Mf.exports.css=CS;Mf.exports.html=AS});var OS=K((cne,wS)=>{"use strict";function ES(t,e,n){var r=function(i,s){return t.js_beautify(i,s)};return r.js=t.js_beautify,r.css=e.css_beautify,r.html=n.html_beautify,r.js_beautify=t.js_beautify,r.css_beautify=e.css_beautify,r.html_beautify=n.html_beautify,r}typeof define=="function"&&define.amd?define(["./lib/beautify","./lib/beautify-css","./lib/beautify-html"],function(t,e,n){return ES(t,e,n)}):function(t){var e=xS();e.js_beautify=e.js,e.css_beautify=e.css,e.html_beautify=e.html,t.exports=ES(e,e,e)}(wS)});var Wh=K((Tre,mC)=>{"use strict";var jf=require("path");function TF(t){if(typeof t!="string"||t.length<=7||t.substring(0,7)!=="file://")throw new TypeError("must pass in a file:// URI to convert to a file path");let e=decodeURI(t.substring(7)),n=e.indexOf("/"),r=e.substring(0,n),i=e.substring(n+1);return r==="localhost"&&(r=""),r&&(r=jf.sep+jf.sep+r),i=i.replace(/^(.+)\|/,"$1:"),jf.sep==="\\"&&(i=i.replace(/\//g,"\\")),/^.+:/.test(i)||(i=jf.sep+i),r+i}mC.exports=TF});var WF={};BC(WF,{getAntlersSettings:()=>Ff,globalSettings:()=>qi,requestEdits:()=>Qh});var EC=Q(require("fs")),wC=Q(fg()),en=Q(ky());var ks=class{constructor(){this.currentStructure=null;this.isReloading=!1;this.isDirtyState=!0}setActiveProject(e){this.currentStructure=e}getStructure(){return this.currentStructure}hasStructure(){return this.currentStructure!=null}setDirtyState(e){this.isDirtyState=e}reloadDetails(){this.isReloading||this.isDirtyState!=!1&&this.currentStructure!=null&&(this.isReloading=!0,this.currentStructure=this.currentStructure.reloadDetails(),this.isReloading=!1,this.isDirtyState=!1)}};ks.instance=null;(typeof ks.instance=="undefined"||ks.instance==null)&&(ks.instance=new ks);var ce=ks;var si=class{static registerDetails(e,n){this.documentDetails.set(e,n)}static hasDetails(e){return this.documentDetails.has(e)}};si.documentDetails=new Map;var Y0={documentDescription:"",documentName:"",collectionInjections:[],blueprints:[],variableHelper:null,injectsParameters:[],varReferenceNames:new Map,formatterEnabled:!0},My="@name",Fy="@description",Vy="@desc",qy="@entry",By="@collection",jy="@blueprint",Uy="@var",Gy="@set",Wy="@param",Hy="@param*",K0="@front",Yy="@format";function il(t,e){if(e==null||e.isComment==!1)return Y0;let n=e.content.replace(/(\r\n|\n|\r)/gm,` +`+l:i=a+l),t.print_newline(!1),i&&(e.text=i,e.whitespace_before="",e.newlines=0,t.add_raw_token(e),t.print_newline(!0))}};Nr.prototype._handle_tag_open=function(t,e,n,r){var i=this._get_tag_open_token(e);return(n.is_unformatted||n.is_content_unformatted)&&!n.is_empty_element&&e.type===tt.TAG_OPEN&&e.text.indexOf("]*)/),this.tag_check=n?n[1]:""):(n=e.text.match(/^{{(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=n?n[1]:"",e.text==="{{#>"&&this.tag_check===">"&&e.next!==null&&(this.tag_check=e.next.text)),this.tag_check=this.tag_check.toLowerCase(),e.type===tt.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||e.closed&&e.closed.text==="/>",this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(2)))}};Nr.prototype._get_tag_open_token=function(t){var e=new PS(this._tag_stack.get_parser_token(),t);return e.alignment_size=this._options.wrap_attributes_indent_size,e.is_end_tag=e.is_end_tag||su(e.tag_check,this._options.void_elements),e.is_empty_element=e.tag_complete||e.is_start_tag&&e.is_end_tag,e.is_unformatted=!e.tag_complete&&su(e.tag_check,this._options.unformatted),e.is_content_unformatted=!e.is_empty_element&&su(e.tag_check,this._options.content_unformatted),e.is_inline_element=su(e.tag_name,this._options.inline)||e.tag_start_char==="{",e};Nr.prototype._set_tag_position=function(t,e,n,r,i){if(n.is_empty_element||(n.is_end_tag?n.start_tag_token=this._tag_stack.try_pop(n.tag_name):(this._do_optional_end_element(n)&&(n.is_inline_element||t.print_newline(!1)),this._tag_stack.record_tag(n),(n.tag_name==="script"||n.tag_name==="style")&&!(n.is_unformatted||n.is_content_unformatted)&&(n.custom_beautifier_name=mF(n.tag_check,e)))),su(n.tag_check,this._options.extra_liners)&&(t.print_newline(!1),t._output.just_added_blankline()||t.print_newline(!0)),n.is_empty_element){if(n.tag_start_char==="{"&&n.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),n.indent_content=!0;var s=t.current_line_has_match(/{{#if/);s||t.print_newline(!1)}n.tag_name==="!--"&&i.type===tt.TAG_CLOSE&&r.is_end_tag&&n.text.indexOf(` +`)===-1||(n.is_inline_element||n.is_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,n))}else if(n.is_end_tag){var o=!1;o=n.start_tag_token&&n.start_tag_token.multiline_content,o=o||!n.is_inline_element&&!(r.is_inline_element||r.is_unformatted)&&!(i.type===tt.TAG_CLOSE&&n.start_tag_token===r)&&i.type!=="TK_CONTENT",(n.is_content_unformatted||n.is_unformatted)&&(o=!1),o&&t.print_newline(!1)}else n.indent_content=!n.custom_beautifier_name,n.tag_start_char==="<"&&(n.tag_name==="html"?n.indent_content=this._options.indent_inner_html:n.tag_name==="head"?n.indent_content=this._options.indent_head_inner_html:n.tag_name==="body"&&(n.indent_content=this._options.indent_body_inner_html)),!(n.is_inline_element||n.is_unformatted)&&(i.type!=="TK_CONTENT"||n.is_content_unformatted)&&t.print_newline(!1),this._calcluate_parent_multiline(t,n)};Nr.prototype._calcluate_parent_multiline=function(t,e){e.parent&&t._output.just_added_newline()&&!((e.is_inline_element||e.is_unformatted)&&e.parent.is_inline_element)&&(e.parent.multiline_content=!0)};var gF=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],_F=["a","audio","del","ins","map","noscript","video"];Nr.prototype._do_optional_end_element=function(t){var e=null;if(!(t.is_empty_element||!t.is_start_tag||!t.parent)){if(t.tag_name==="body")e=e||this._tag_stack.try_pop("head");else if(t.tag_name==="li")e=e||this._tag_stack.try_pop("li",["ol","ul"]);else if(t.tag_name==="dd"||t.tag_name==="dt")e=e||this._tag_stack.try_pop("dt",["dl"]),e=e||this._tag_stack.try_pop("dd",["dl"]);else if(t.parent.tag_name==="p"&&gF.indexOf(t.tag_name)!==-1){var n=t.parent.parent;(!n||_F.indexOf(n.tag_name)===-1)&&(e=e||this._tag_stack.try_pop("p"))}else t.tag_name==="rp"||t.tag_name==="rt"?(e=e||this._tag_stack.try_pop("rt",["ruby","rtc"]),e=e||this._tag_stack.try_pop("rp",["ruby","rtc"])):t.tag_name==="optgroup"?e=e||this._tag_stack.try_pop("optgroup",["select"]):t.tag_name==="option"?e=e||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):t.tag_name==="colgroup"?e=e||this._tag_stack.try_pop("caption",["table"]):t.tag_name==="thead"?(e=e||this._tag_stack.try_pop("caption",["table"]),e=e||this._tag_stack.try_pop("colgroup",["table"])):t.tag_name==="tbody"||t.tag_name==="tfoot"?(e=e||this._tag_stack.try_pop("caption",["table"]),e=e||this._tag_stack.try_pop("colgroup",["table"]),e=e||this._tag_stack.try_pop("thead",["table"]),e=e||this._tag_stack.try_pop("tbody",["table"])):t.tag_name==="tr"?(e=e||this._tag_stack.try_pop("caption",["table"]),e=e||this._tag_stack.try_pop("colgroup",["table"]),e=e||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(t.tag_name==="th"||t.tag_name==="td")&&(e=e||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),e=e||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return t.parent=this._tag_stack.get_parser_token(),e}};IS.exports.Beautifier=Nr});var CS=K((Nne,kh)=>{"use strict";var yF=SS().Beautifier,bF=wh().Options;function TF(t,e,n,r){var i=new yF(t,e,n,r);return i.beautify()}kh.exports=TF;kh.exports.defaultOptions=function(){return new bF}});var wS=K((vne,Ff)=>{"use strict";var RS=lS(),AS=gS(),xS=CS();function ES(t,e,n,r){return n=n||RS,r=r||AS,xS(t,e,n,r)}ES.defaultOptions=xS.defaultOptions;Ff.exports.js=RS;Ff.exports.css=AS;Ff.exports.html=ES});var DS=K((Pne,LS)=>{"use strict";function OS(t,e,n){var r=function(i,s){return t.js_beautify(i,s)};return r.js=t.js_beautify,r.css=e.css_beautify,r.html=n.html_beautify,r.js_beautify=t.js_beautify,r.css_beautify=e.css_beautify,r.html_beautify=n.html_beautify,r}typeof define=="function"&&define.amd?define(["./lib/beautify","./lib/beautify-css","./lib/beautify-html"],function(t,e,n){return OS(t,e,n)}):function(t){var e=wS();e.js_beautify=e.js,e.css_beautify=e.css,e.html_beautify=e.html,t.exports=OS(e,e,e)}(LS)});var Wh=K((Lre,gC)=>{"use strict";var Uf=require("path");function IF(t){if(typeof t!="string"||t.length<=7||t.substring(0,7)!=="file://")throw new TypeError("must pass in a file:// URI to convert to a file path");let e=decodeURI(t.substring(7)),n=e.indexOf("/"),r=e.substring(0,n),i=e.substring(n+1);return r==="localhost"&&(r=""),r&&(r=Uf.sep+Uf.sep+r),i=i.replace(/^(.+)\|/,"$1:"),Uf.sep==="\\"&&(i=i.replace(/\//g,"\\")),/^.+:/.test(i)||(i=Uf.sep+i),r+i}gC.exports=IF});var $F={};UC($F,{getAntlersSettings:()=>Vf,globalSettings:()=>qi,requestEdits:()=>Qh});var OC=Q(require("fs")),LC=Q(fg()),en=Q(ky());var ks=class{constructor(){this.currentStructure=null;this.isReloading=!1;this.isDirtyState=!0}setActiveProject(e){this.currentStructure=e}getStructure(){return this.currentStructure}hasStructure(){return this.currentStructure!=null}setDirtyState(e){this.isDirtyState=e}reloadDetails(){this.isReloading||this.isDirtyState!=!1&&this.currentStructure!=null&&(this.isReloading=!0,this.currentStructure=this.currentStructure.reloadDetails(),this.isReloading=!1,this.isDirtyState=!1)}};ks.instance=null;(typeof ks.instance=="undefined"||ks.instance==null)&&(ks.instance=new ks);var ce=ks;var si=class{static registerDetails(e,n){this.documentDetails.set(e,n)}static hasDetails(e){return this.documentDetails.has(e)}};si.documentDetails=new Map;var $0={documentDescription:"",documentName:"",collectionInjections:[],blueprints:[],variableHelper:null,injectsParameters:[],varReferenceNames:new Map,formatterEnabled:!0},My="@name",Fy="@description",Vy="@desc",qy="@entry",By="@collection",jy="@blueprint",Uy="@var",Gy="@set",Wy="@param",Hy="@param*",z0="@front",Yy="@format";function il(t,e){if(e==null||e.isComment==!1)return $0;let n=e.content.replace(/(\r\n|\n|\r)/gm,` `).split(` -`).map(p=>p.trim()),r=[],i=new Map,s="",o="",a=[],l=[],u="",c=null,f=!1,m=!0;for(let p=0;pC.trim())),f=!1;else if(_.startsWith(By))a=a.concat(_.slice(By.length).split(",").map(C=>C.trim())),f=!1;else if(_.startsWith(jy))l=l.concat(_.slice(jy.length).split(",").map(C=>C.trim())),f=!1;else if(_.startsWith(My))s=_.slice(My.length).trim(),f=!1;else if(_.startsWith(Fy))o=_.slice(Fy.length).trim(),f=!0;else if(_.startsWith(Vy))o=_.slice(Vy.length).trim(),f=!0;else if(_.startsWith(Uy))u=_.slice(Uy.length).trim(),f=!1;else if(_.startsWith(Gy))u="@page "+_.slice(Gy.length).trim(),f=!1;else if(_.startsWith(Wy)){let C=Wy.length,h=!1;_.startsWith(Hy)&&(C=Hy.length,h=!0);let g=_.slice(C).trim().split(" ");if(g.length>0)if(g[0]==K0&&g.length>=4){g.shift();let N=g.shift(),S=g.shift(),V=g.join(" ");r.push({acceptsVariableInterpolation:!0,aliases:[],allowsVariableReference:!0,description:V,expectsTypes:["*"],isDynamic:!0,isRequired:h,name:S}),i.set(S,N)}else{let N=g.shift(),S=g.join(" ");r.push({acceptsVariableInterpolation:!0,aliases:[],allowsVariableReference:!0,description:S,expectsTypes:["*"],isDynamic:!0,isRequired:h,name:N})}}else _.startsWith(Yy)?_.slice(Yy.length).trim().toLowerCase()=="true"?m=!0:m=!1:f&&(o+=` -`+_.trim())}if(u.length>0){let p=u.split(" ");if(p.length==2){let _=p[0],C=p[1];if(C.includes(".")){let h=C.split(".");if(h.length==2){let b=h[0],g=h[1];c={variableName:_,collectionName:b,fieldHandle:g,setHandle:""}}else if(h.length==3){let b=h[0],g=h[1],N=h[2];c={variableName:_,collectionName:b,fieldHandle:g,setHandle:N}}}else c={variableName:_,setHandle:"",collectionName:"",fieldHandle:C}}}if(t.trim().length>0&&ce.instance!=null&&ce.instance.hasStructure()){let p=ce.instance.getStructure().findView(t);p!=null&&(p.injectsParameters=r,p.varReferenceNames=i)}let d={documentName:s,documentDescription:o,collectionInjections:a,blueprints:l,variableHelper:c,injectsParameters:r,varReferenceNames:i,formatterEnabled:m};return t.trim().length>0&&e.startPosition!=null&&(e.startPosition.line<=1||e.index<=1)&&si.registerDetails(t,d),d}var $0=["markdown","text","textarea","slug","button_group","code","color","date","form","link","structures","select","taxonomies","terms","template","time","video","users","user_groups","user_roles"],z0=["array","assets","bard","blueprints","collections","entries","list","grid","replicator","structures_multiple","sites","select_multiple","form_multiple","table","tags","terms_multiple","taxonomies_multiple","users_multiple","checkboxes","select_multiple","yaml","user_groups_multiple","user_roles_multiple"],X0=["integer","range"],Q0=["toggle"];function Fu(t){return $0.includes(t)?"string":z0.includes(t)?"array":X0.includes(t)?"number":Q0.includes(t)?"boolean":t}var Ms=class{constructor(){this.partialReferences=new Map;this.cacheReferences=new Map;this.removesPageScope=new Map}clearAllReferences(e){this.clearPartialReferences(e),this.clearCacheReferences(e)}registerPartialReferences(e,n){this.partialReferences.has(e)==!1&&this.partialReferences.set(e,[]),this.partialReferences.set(e,n)}registerCacheReferences(e,n){this.cacheReferences.has(e)==!1&&this.cacheReferences.set(e,[]),this.cacheReferences.set(e,n)}clearPartialReferences(e){this.partialReferences.has(e)&&this.partialReferences.set(e,[])}clearRemovesPageScope(e){this.removesPageScope.has(e)&&this.removesPageScope.delete(e)}pageScopeDisabled(e){return this.removesPageScope.has(e)}clearCacheReferences(e){this.cacheReferences.has(e)&&this.cacheReferences.set(e,[])}setRemovesPageScope(e,n){this.removesPageScope.set(e,n)}getPartialReferences(e){return this.partialReferences.has(e)==!1?[]:this.partialReferences.get(e)}getCacheReferencnes(e){return this.cacheReferences.has(e)==!1?[]:this.cacheReferences.get(e)}hasPartialReferences(e){return this.partialReferences.has(e)}hasCacheReferences(e){return this.cacheReferences.has(e)}};Ms.instance=null;(typeof Ms.instance=="undefined"||Ms.instance==null)&&(Ms.instance=new Ms);var xr=Ms;var qt=class{constructor(){this.index=-1;this.offset=0;this.line=0;this.char=0}shiftRight(e){let n=new qt;return n.offset=this.offset+e,n.index=this.index+e,n.line=this.line,n.char=this.char+e,n}isBefore(e){return e==null?!1:e.line>this.line||e.line==this.line&&this.offset=e.index&&this.index<=n.index+r}isWithinRange(e){return e==null?!1:e.start!=null&&e.end!=null?this.isWithin(e.start,e.end):!1}};var $p=class{constructor(){this.start=null;this.end=null}},sl=$p;sl.Empty=new $p;function Ky(t,e){let n=e.copy(),r=e.copy();return r.addVariable({sourceName:"*internal.group_by",sourceField:null,dataType:"string",name:"group",introducedBy:t}),r.addVariable({sourceName:"*internal.group_by",sourceField:null,dataType:"string",name:"key",introducedBy:t}),r.addScopeList("items",n),e.addScopeList("groups",r),e}function $y(t,e){let n=e.copy();return e.addScopeList("items",n),e}var zy=[{name:"as",acceptsType:["array"],returnsType:["array"],description:"Alias the array variable with a key.",docLink:"https://statamic.dev/modifiers/as",parameters:[{name:"alias",description:"The alias name."}],canBeParameter:!0},{name:"ampersand_list",acceptsType:["array"],returnsType:["string"],description:"Converts the array into a comma delimited string, with an ampersand before the last item.",docLink:"https://statamic.dev/modifiers/ampersand_list",parameters:[],canBeParameter:!1},{name:"collapse",acceptsType:["array"],returnsType:["array"],description:"Collapses an array of arrays into a single, flat, array.",docLink:"https://statamic.dev/modifiers/collapse",parameters:[],canBeParameter:!1},{name:"contains",acceptsType:["array","string"],returnsType:["boolean"],description:"Tests if the value contains another value.",docLink:"https://statamic.dev/modifiers/contains",parameters:[{name:"needle",description:"The value to check for."}],canBeParameter:!1},{name:"count",acceptsType:["array"],returnsType:["number"],description:"Returns the number of items in the array.",docLink:"https://statamic.dev/modifiers/count",parameters:[],canBeParameter:!1},{name:"dl",acceptsType:["array"],returnsType:["string"],description:"Turns an associative array into an HTML definition list.",docLink:"https://statamic.dev/modifiers/dl",parameters:[],canBeParameter:!1},{name:"explode",acceptsType:["string"],returnsType:["array"],description:"Breaks a string into an array on a given delimiter.",docLink:"https://statamic.dev/modifiers/explode",parameters:[{name:"delimiter",description:"The delimiter to break the string apart on."}],canBeParameter:!0},{name:"flatten",acceptsType:["array"],returnsType:["array"],description:"Flattens a multi-dimensional array.",docLink:"https://statamic.dev/modifiers/flatten",parameters:[],canBeParameter:!1},{name:"flip",acceptsType:["array"],returnsType:["array"],description:"Swaps the array keys with their values.",docLink:"https://statamic.dev/modifiers/flip",parameters:[],canBeParameter:!1},{name:"group_by",acceptsType:["array"],returnsType:["array"],description:"Groups the array items by the given key.",docLink:"https://statamic.dev/modifiers/group_by",parameters:[{name:"key",description:"The key to group by."}],canBeParameter:!0,augmentScope:Ky},{name:"in_array",acceptsType:["array"],returnsType:["boolean"],description:"Tests if an array contains a specific value.",docLink:"https://statamic.dev/modifiers/in_array",parameters:[{name:"needle",description:"The value to check for."}],canBeParameter:!1},{name:"is_empty",acceptsType:["array"],returnsType:["boolean"],description:"Tests if the array is empty.",docLink:"https://statamic.dev/modifiers/is_empty",parameters:[],canBeParameter:!1},{name:"join",acceptsType:["array"],returnsType:["string"],description:"Turn an array into a string by gluing together all the data.",docLink:"https://statamic.dev/modifiers/join",parameters:[{name:"glue",description:"The string to combine the parts by."}],canBeParameter:!0},{name:"joinplode",acceptsType:["array"],returnsType:["string"],description:"Turn an array into a string by gluing together all the data.",docLink:null,parameters:[{name:"glue",description:"The string to combine the parts by."}],canBeParameter:!0},{name:"limit",acceptsType:["array"],returnsType:["array"],description:"Limits the number of items returned in the array",docLink:"https://statamic.dev/modifiers/limit",parameters:[{name:"count",description:"The maximum number of items to return."}],canBeParameter:!0},{name:"list",acceptsType:["array"],returnsType:["string"],description:"Converts the array into a comma-separated string.",docLink:"https://statamic.dev/modifiers/list",parameters:[],canBeParameter:!1},{name:"offset",acceptsType:["array"],returnsType:["array"],description:"Offsets the items returned in the array.",docLink:"https://statamic.dev/modifiers/offset",parameters:[{name:"offset",description:"The one-based index to start retrieving items."}],canBeParameter:!0},{name:"ol",acceptsType:["array"],returnsType:["string"],description:"Turns the array into an HTML ordered list.",docLink:"https://statamic.dev/modifiers/ol",parameters:[],canBeParameter:!1},{name:"option_list",acceptsType:["array"],returnsType:["string"],description:"Turns an array into a pipe-delimited string.",docLink:"https://statamic.dev/modifiers/option_list",parameters:[],canBeParameter:!1},{name:"pluck",acceptsType:["array"],returnsType:["array"],description:"Plucks a value from a collection of items.",parameters:[{name:"value",description:"The value to pluck from the array or collection."}],canBeParameter:!0,docLink:null},{name:"pad",acceptsType:["array"],returnsType:["array"],description:"Pads the array to a specified length with the given value.",docLink:"https://statamic.dev/modifiers/pad",parameters:[{name:"length",description:"The desired length of the array."},{name:"value",description:"The value to pad the array with."}],canBeParameter:!0},{name:"piped",acceptsType:["array"],returnsType:["string"],description:"Turns an array into a pipe-delimited string.",docLink:"https://statamic.dev/modifiers/piped",parameters:[],canBeParameter:!1},{name:"sentence_list",acceptsType:["array"],returnsType:["string"],description:'Turns the array into a comma-delimited list, with the word "and" before the last item.',docLink:"https://statamic.dev/modifiers/sentence_list",parameters:[],canBeParameter:!1},{name:"shuffle",acceptsType:["array"],returnsType:["array"],description:"Randomizes the order of array elements.",docLink:"https://statamic.dev/modifiers/shuffle",parameters:[],canBeParameter:!1},{name:"sort",acceptsType:["array"],returnsType:["array"],description:"Sorts the array by a key in ascending or descending order.",docLink:"https://statamic.dev/modifiers/sort",parameters:[{name:"key",description:"The key to sort by."},{name:"order",description:"The sort direction. `asc` or `desc`."}],canBeParameter:!0},{name:"sum",acceptsType:["array"],returnsType:["number"],description:"Returns the sum of all items in the array.",docLink:"https://statamic.dev/modifiers/sum",parameters:[{name:"key",description:"The value to sum."}],canBeParameter:!1},{name:"ul",acceptsType:["array"],returnsType:["string"],description:"Turns the array into an HTML unordered list.",docLink:"https://statamic.dev/modifiers/ul",parameters:[],canBeParameter:!1},{name:"unique",acceptsType:["array"],returnsType:["array"],description:"Returns all unique items in the array.",docLink:"https://statamic.dev/modifiers/unique",parameters:[],canBeParameter:!1},{name:"where",acceptsType:["array"],returnsType:["array"],description:"Filters the array by a given key and value.",docLink:"https://statamic.dev/modifiers/where",parameters:[{name:"key",description:"The property to filter by."},{name:"value",description:"The value to compare to."}],canBeParameter:!0},{name:"split",acceptsType:["array"],returnsType:["array"],description:"Splits an array into smaller arrays with the provided size.",canBeParameter:!0,docLink:"",parameters:[{name:"size",description:"The size of each new array"}],augmentScope:$y},{name:"compact",acceptsType:["string"],returnsType:["array"],description:"Accepts a comma-delimited list of variable names and return an array with their values.",canBeParameter:!0,docLink:"",parameters:[{name:"variables",description:"A comma-delimited list of variable names."}]}];var Xy=[{name:"background_position",acceptsType:["string"],returnsType:["string"],description:"Converts an asset focal point into a background-position CSS property.",docLink:"https://statamic.dev/modifiers/background_position",parameters:[],canBeParameter:!1},{name:"image",acceptsType:["string"],returnsType:["string"],description:"Generates an HTML image element with the variable's value as the src.",docLink:"https://statamic.dev/modifiers/image",parameters:[],canBeParameter:!1},{name:"output",acceptsType:["string"],returnsType:["string"],description:"Returns the string output of an Asset file's contents.",docLink:"https://statamic.dev/modifiers/output",parameters:[],canBeParameter:!1}];var Qy=[{name:"contains_all",acceptsType:["string"],returnsType:["boolean"],description:"Tests if a string contains all of the provided needles.",docLink:"https://statamic.dev/modifiers/contains_all",parameters:[{name:"needle",description:"The string(s) to search for."}],canBeParameter:!1},{name:"contains_any",acceptsType:["string"],returnsType:["boolean"],description:"Tests if a string contains all of the provided needles.",docLink:"https://statamic.dev/modifiers/contains_any",parameters:[{name:"needle",description:"The string(s) to search for."}],canBeParameter:!1},{name:"ends_with",acceptsType:["string"],returnsType:["boolean"],description:"Tests if a string ends with another string.",docLink:"https://statamic.dev/modifiers/ends_with",parameters:[{name:"value",description:"The value to check against."}],canBeParameter:!1},{name:"has_lower_case",acceptsType:["string"],returnsType:["boolean"],description:"Tests if the string contains any lowercase characters.",docLink:"https://statamic.dev/modifiers/has_lower_case",parameters:[],canBeParameter:!1},{name:"has_upper_case",acceptsType:["string"],returnsType:["boolean"],description:"Tests if the string contains any uppercase characters.",docLink:"https://statamic.dev/modifiers/has_upper_case",parameters:[],canBeParameter:!1},{name:"in_array",acceptsType:["array"],returnsType:["boolean"],description:"Tests if an array contains a specific value.",docLink:"https://statamic.dev/modifiers/in_array",parameters:[{name:"needle",description:"The value(s) to search for."}],canBeParameter:!1},{name:"is_after",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the string contains only alphanumeric characters.",docLink:"https://statamic.dev/modifiers/is_after",parameters:[{name:"date",description:"The date to compare to."}],canBeParameter:!1},{name:"is_alphanumeric",acceptsType:["string"],returnsType:["boolean"],description:"Tests if the string contains only alphanumeric characters.",docLink:"https://statamic.dev/modifiers/is_alphanumeric",parameters:[],canBeParameter:!1},{name:"is_before",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if a date is before another date.",docLink:"https://statamic.dev/modifiers/is_before",parameters:[{name:"date",description:"The date to compare to."}],canBeParameter:!1},{name:"is_between",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if a date is between two other dates.",docLink:"https://statamic.dev/modifiers/is_between",parameters:[{name:"start_date",description:"The start date to compare."},{name:"end_date",description:"The end date to compare."}],canBeParameter:!1},{name:"is_blank",acceptsType:["string"],returnsType:["boolean"],description:"Tests if the string contains only whitespace characters.",docLink:"https://statamic.dev/modifiers/is_blank",parameters:[],canBeParameter:!1},{name:"is_email",acceptsType:["string"],returnsType:["boolean"],description:"Tests if the string is a valid email address.",docLink:"https://statamic.dev/modifiers/is_email",parameters:[],canBeParameter:!1},{name:"is_future",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the date is in the future.",docLink:"https://statamic.dev/modifiers/is_future",parameters:[],canBeParameter:!1},{name:"is_json",acceptsType:["string"],returnsType:["boolean"],description:"Tests if the string is valid JSON.",docLink:"https://statamic.dev/modifiers/is_json",parameters:[],canBeParameter:!1},{name:"is_leap_year",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the date is a leap year.",docLink:"https://statamic.dev/modifiers/is_leap_year",parameters:[],canBeParameter:!1},{name:"is_numeric",acceptsType:["string","number"],returnsType:["boolean"],description:"Tests if the value is a number or numeric string.",docLink:"https://statamic.dev/modifiers/is_numeric",parameters:[],canBeParameter:!1},{name:"is_past",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the date is in the past.",docLink:"https://statamic.dev/modifiers/is_past",parameters:[],canBeParameter:!1},{name:"is_today",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the date is today.",docLink:"https://statamic.dev/modifiers/is_today",parameters:[],canBeParameter:!1},{name:"is_uppercase",acceptsType:["string"],returnsType:["boolean"],description:"Tests if the string contains only uppercase characters.",docLink:"https://statamic.dev/modifiers/is_uppercase",parameters:[],canBeParameter:!1},{name:"is_url",acceptsType:["string"],returnsType:["boolean"],description:"Tests if the string is a valid URL.",docLink:"https://statamic.dev/modifiers/is_url",parameters:[],canBeParameter:!1},{name:"is_weekday",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the date is a week day.",docLink:"https://statamic.dev/modifiers/is_weekday",parameters:[],canBeParameter:!1},{name:"is_weekend",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the date is a weekend day.",docLink:"https://statamic.dev/modifiers/is_weekend",parameters:[],canBeParameter:!1},{name:"is_yesterday",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the date is yesterday.",docLink:"https://statamic.dev/modifiers/is_yesterday",parameters:[],canBeParameter:!1},{name:"is_tomorrow",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the date is tomorrow.",docLink:null,parameters:[],canBeParameter:!1},{name:"starts_with",acceptsType:["string"],returnsType:["boolean"],description:"Tests if a value starts with the provided value.",docLink:"https://statamic.dev/modifiers/starts_with",parameters:[{name:"value",description:"The value to test for."}],canBeParameter:!1}];var Jy=[{name:"days_ago",acceptsType:["string","date"],returnsType:["number"],description:"Returns the number of days since a given date.",docLink:"https://statamic.dev/modifiers/days_ago",parameters:[],canBeParameter:!1},{name:"format_translated",acceptsType:["string","date"],returnsType:["string","date"],description:"Returns a formatted Carbon datetime/string.",docLink:"https://statamic.dev/modifiers/format",parameters:[{name:"format",description:"The format to use."}],canBeParameter:!0},{name:"format",acceptsType:["string","date"],returnsType:["string","date"],description:"Formats the date using the provided format using PHP's [date variables](https://www.php.net/date).",docLink:"https://statamic.dev/modifiers/format",parameters:[{name:"format",description:"The format to use."}],canBeParameter:!0},{name:"format_localized",acceptsType:["string","date"],returnsType:["string","date"],description:"Forms the date using server's locale, using PHP's [strftime format variables](https://www.php.net/strftime).",docLink:"https://statamic.dev/modifiers/format_localized",parameters:[{name:"format",description:"The format to use."}],canBeParameter:!0},{name:"hours_ago",acceptsType:["string","date"],returnsType:["number"],description:"Returns the number of hours since the date.",docLink:"https://statamic.dev/modifiers/hours_ago",parameters:[],canBeParameter:!1},{name:"iso_format",acceptsType:["string","date"],returnsType:["string","date"],description:"Formats the date using an ISO format.",docLink:"https://statamic.dev/modifiers/iso_format",parameters:[{name:"format",description:"The format to use."}],canBeParameter:!1},{name:"minutes_ago",acceptsType:["string","date"],returnsType:["number"],description:"Returns the number of minutes since the date.",docLink:"https://statamic.dev/modifiers/minutes_ago",parameters:[],canBeParameter:!1},{name:"modify_date",acceptsType:["string","date"],returnsType:["string","date"],description:"Alters the date by incrementing or decrementing it in a format accepted by PHP's [strtotime](https://www.php.net/strtotime) function.",docLink:"https://statamic.dev/modifiers/modify_date",parameters:[],canBeParameter:!0},{name:"months_ago",acceptsType:["string","date"],returnsType:["number"],description:"Returns the number of months since the date.",docLink:"https://statamic.dev/modifiers/months_ago",parameters:[],canBeParameter:!1},{name:"relative",acceptsType:["string","date"],returnsType:["string"],description:"Returns a human readable date difference.",docLink:"https://statamic.dev/modifiers/relative",parameters:[{name:"add_ago",description:"Whether to add the relative suffix words at the end of the string."}],canBeParameter:!1},{name:"seconds_ago",acceptsType:["string","date"],returnsType:["number"],description:"Returns the number of seconds since the date.",docLink:"https://statamic.dev/modifiers/seconds_ago",parameters:[],canBeParameter:!1},{name:"timezone",acceptsType:["string","date"],returnsType:["string","date"],description:"Applies a timezone to the date.",docLink:"https://statamic.dev/modifiers/timezone",parameters:[{name:"timezone",description:"The timezone to apply."}],canBeParameter:!1},{name:"weeks_ago",acceptsType:["string","date"],returnsType:["number"],description:"Returns the number of weeks since the date.",docLink:"https://statamic.dev/modifiers/weeks_ago",parameters:[],canBeParameter:!1},{name:"years_ago",acceptsType:["string","date"],returnsType:["number"],description:"Returns the number of years since the date.",docLink:"https://statamic.dev/modifiers/years_ago",parameters:[],canBeParameter:!1}];var Zy=[{name:"chunk",acceptsType:["array"],returnsType:["array"],description:"Breaks the array or collection into smaller arrays of a given size.",docLink:"https://statamic.dev/modifiers/chunk",parameters:[{name:"chunk_size",description:"The maximum length of each new chunk."}],canBeParameter:!0},{name:"favicon",acceptsType:["string"],returnsType:["string"],description:"Generates a favicon HTML meta tag for the given value.",docLink:"https://statamic.dev/modifiers/favicon",parameters:[],canBeParameter:!1},{name:"first",acceptsType:["string","array"],returnsType:["*"],description:"Returns the specified number of characters from the beginning of the string.",docLink:"https://statamic.dev/modifiers/first",parameters:[{name:"count",description:"The number of characters to return."}],canBeParameter:!0},{name:"last",acceptsType:["string","array"],returnsType:["*"],description:"Returns the specified number of characters from the end of the string.",docLink:"https://statamic.dev/modifiers/last",parameters:[{name:"count",description:"The number of characters to return."}],canBeParameter:!0},{name:"link",acceptsType:["string"],returnsType:["string"],description:"Generates an HTML link for the provided value.",docLink:"https://statamic.dev/modifiers/link",parameters:[],canBeParameter:!1},{name:"mailto",acceptsType:["string"],returnsType:["string"],description:"Generates a mailto HTML link for the provided value.",docLink:"https://statamic.dev/modifiers/mailto",parameters:[],canBeParameter:!1},{name:"markdown",acceptsType:["string"],returnsType:["string"],description:"Parses the value as Markdown and returns the HTML.",docLink:"https://statamic.dev/modifiers/markdown",parameters:[],canBeParameter:!1},{name:"nl2br",acceptsType:["string"],returnsType:["string"],description:"Replaces line breaks with HTML `
` tags.",docLink:"https://statamic.dev/modifiers/nl2br",parameters:[],canBeParameter:!1},{name:"obfuscate",acceptsType:["string"],returnsType:["string"],description:"Modifies the input string by replacing it with special characters, making it harder for bots but remains readable to site visitors.",docLink:"https://statamic.dev/modifiers/obfuscate",parameters:[],canBeParameter:!1},{name:"obfuscate_email",acceptsType:["string"],returnsType:["string"],description:"Obfuscates an email address with special HTML characters.",docLink:"https://statamic.dev/modifiers/obfuscate_email",parameters:[],canBeParameter:!1},{name:"strip_tags",acceptsType:["string"],returnsType:["string"],description:"Removes HTML tags from the string.",docLink:"https://statamic.dev/modifiers/strip_tags",parameters:[{name:"tags",description:"The HTML tag(s) to remove from the string."}],canBeParameter:!1},{name:"table",acceptsType:["array"],returnsType:["string"],description:"Turns a [Table FieldType](https://statamic.dev/fieldtypes/table) array into an HTML table.",docLink:"https://statamic.dev/modifiers/table",parameters:[{name:"content_markdown",description:"Whether to parse cell contents as Markdown."}],canBeParameter:!1},{name:"textile",acceptsType:["string"],returnsType:["string"],description:"Parses a string with [Textile](http://demo.textilewiki.com/theme-default/) and returns the HTML.",docLink:"https://statamic.dev/modifiers/textile",parameters:[],canBeParameter:!1},{name:"wrap",acceptsType:["string"],returnsType:["string"],description:"Wraps a string with a given HTML tag.",docLink:"https://statamic.dev/modifiers/wrap",parameters:[{name:"expression",description:"The HTML tag or Emmet-style expression to wrap the value in."}],canBeParameter:!1}];var eb=[{name:"add",acceptsType:["number"],returnsType:["number"],description:"Adds two values together.",docLink:"https://statamic.dev/modifiers/add",parameters:[{name:"value",description:"The value to add."}],canBeParameter:!0},{name:"+",acceptsType:["number"],returnsType:["number"],description:"Adds two values together.",docLink:"https://statamic.dev/modifiers/add",parameters:[{name:"value",description:"The value to add."}],canBeParameter:!1},{name:"ceil",acceptsType:["number"],returnsType:["number"],description:"Rounds the value to the next whole number.",docLink:"https://statamic.dev/modifiers/ceil",parameters:[],canBeParameter:!1},{name:"divide",acceptsType:["number"],returnsType:["number"],description:"Divides two values.",docLink:"https://statamic.dev/modifiers/divide",parameters:[{name:"value",description:"The value to divide."}],canBeParameter:!0},{name:"floor",acceptsType:["number"],returnsType:["number"],description:"Rounds a number down to the next whole number.",docLink:"https://statamic.dev/modifiers/floor",parameters:[],canBeParameter:!0},{name:"format_number",acceptsType:["number"],returnsType:["string"],description:"Formats a number.",docLink:"https://statamic.dev/modifiers/format_number",parameters:[{name:"precision",description:"Number of decimal places before rounding."},{name:"decimal_separator",description:"The decimal separator (defaults to `.`)."},{name:"thousands_separator",description:"The thousands separator (default `,`)."}],canBeParameter:!0},{name:"mode",acceptsType:["number"],returnsType:["number"],description:"",docLink:"",parameters:[],canBeParameter:!0},{name:"multiply",acceptsType:["number"],returnsType:["number"],description:"Multiplies two values.",docLink:"https://statamic.dev/modifiers/multiply",parameters:[{name:"value",description:"The value to multiply."}],canBeParameter:!0},{name:"*",acceptsType:["number"],returnsType:["number"],description:"Multiplies two values.",docLink:"https://statamic.dev/modifiers/multiply",parameters:[{name:"value",description:"The value to multiply."}],canBeParameter:!1},{name:"round",acceptsType:["number"],returnsType:["number"],description:"Rounds a number to a specified precision.",docLink:"https://statamic.dev/modifiers/round",parameters:[{name:"precision",description:"The number of digits after the decimal point."}],canBeParameter:!0},{name:"subtract",acceptsType:["number"],returnsType:["number"],description:"Subtracts two values.",docLink:"https://statamic.dev/modifiers/subtract",parameters:[{name:"value",description:"The value to subtract."}],canBeParameter:!0},{name:"-",acceptsType:["number"],returnsType:["number"],description:"Subtracts two values.",docLink:"https://statamic.dev/modifiers/subtract",parameters:[{name:"value",description:"The value to subtract."}],canBeParameter:!1}];var tb=[{name:"partial",acceptsType:["*"],returnsType:["*view*"],description:"Injects data into a partial and renders it.",docLink:"https://statamic.dev/modifiers/partial",parameters:[{name:"partial",description:"The name of the partial."}],canBeParameter:!1},{name:"macro",acceptsType:["*"],returnsType:["*"],description:"Runs a pre-configured macro on the data.",docLink:"https://statamic.dev/modifiers/macro",parameters:[{name:"macro",description:"The macro name."}],canBeParameter:!1},{name:"url",acceptsType:["string","*"],returnsType:["string"],description:"Locates the URL of an asset, page, entry, or taxonomy term based on the variable contents.",docLink:"https://statamic.dev/modifiers/url",parameters:[],canBeParameter:!1}];var nb=[{name:"ascii",acceptsType:["string"],returnsType:["string"],description:"Replaces all non-ASCII characters with their closest ASCII counterparts.",docLink:"https://statamic.dev/modifiers/ascii",parameters:[],canBeParameter:!1},{name:"at",acceptsType:["string"],returnsType:["string"],description:"Returns the character at a given zero-based position.",docLink:"https://statamic.dev/modifiers/at",parameters:[{name:"position",description:"The zero-based position to retrieve a character from."}],canBeParameter:!0},{name:"backspace",acceptsType:["string"],returnsType:["string"],description:"Removes a specified number of characters from the end of a string.",docLink:"https://statamic.dev/modifiers/backspace",parameters:[{name:"character_count",description:"The number of characters to remove from the end of the string."}],canBeParameter:!0},{name:"camelize",acceptsType:["string"],returnsType:["string"],description:"Converts the string into camelCase.",docLink:"https://statamic.dev/modifiers/camelize",parameters:[],canBeParameter:!1},{name:"cdata",acceptsType:["string"],returnsType:["string"],description:"Wraps the string in CDATA XML tags.",docLink:"https://statamic.dev/modifiers/cdata",parameters:[],canBeParameter:!1},{name:"collapse_whitespace",acceptsType:["string"],returnsType:["string"],description:"Trims a string and replaces consecutive whitespace characters with a single space.",docLink:"https://statamic.dev/modifiers/collapse_whitespace",parameters:[],canBeParameter:!1},{name:"count_substring",acceptsType:["string"],returnsType:["number"],description:"Counts the number of occurrences of a term within the string.",docLink:"https://statamic.dev/modifiers/count_substring",parameters:[{name:"term",description:"The sub-string to search for"}],canBeParameter:!0},{name:"dashify",acceptsType:["string"],returnsType:["string"],description:"Returns a lower-cased and trimmed string, separated by dashes.",docLink:"https://statamic.dev/modifiers/dashify",parameters:[],canBeParameter:!1},{name:"deslugify",acceptsType:["string"],returnsType:["string"],description:"Replaces all hyphens and underscores with spaces.",docLink:"https://statamic.dev/modifiers/deslugify",parameters:[],canBeParameter:!1},{name:"embed_url",acceptsType:["string"],returnsType:["string"],description:"Converts a YouTube or Viemo link into their embed URLs.",docLink:"https://statamic.dev/modifiers/embed_url",parameters:[],canBeParameter:!1},{name:"trackable_embed_url",acceptsType:["string"],returnsType:["string"],description:"Get the embed URL when given a youtube or vimeo link that's direct to the page.",docLink:null,parameters:[],canBeParameter:!1},{name:"ensure_left",acceptsType:["string"],returnsType:["string"],description:"Ensures that the string begins with the specified string.",docLink:"https://statamic.dev/modifiers/ensure_left",parameters:[{name:"start_string",description:"The value that should be at the start of the string."}],canBeParameter:!0},{name:"ensure_right",acceptsType:["string"],returnsType:["string"],description:"Ensures that the string ends with the specified string.",docLink:"https://statamic.dev/modifiers/ensure_right",parameters:[{name:"end_string",description:"The value that should be at the end of the string."}],canBeParameter:!0},{name:"entities",acceptsType:["string"],returnsType:["string"],description:"Encode a string with HTML entities.",docLink:"https://statamic.dev/modifiers/entities",parameters:[],canBeParameter:!1},{name:"excerpt",acceptsType:["string"],returnsType:["string"],description:"Breaks a string at a given marker.",docLink:"https://statamic.dev/modifiers/excerpt",parameters:[{name:"marker",description:"The string to break by."}],canBeParameter:!1},{name:"explode",acceptsType:["string"],returnsType:["array"],description:"Breaks a string into an array of strings.",docLink:"https://statamic.dev/modifiers/explode",parameters:[{name:"delimiter",description:"The string to split the larger string by."}],canBeParameter:!0},{name:"gravatar",acceptsType:["string"],returnsType:["string"],description:"Converts an email string to a Gravatar image URL.",docLink:"https://statamic.dev/modifiers/gravatar",parameters:[{name:"image size",description:"The desired image size."}],canBeParameter:!0},{name:"insert",acceptsType:["string"],returnsType:["string"],description:"Inserts a string at the position provided.",docLink:"https://statamic.dev/modifiers/insert",parameters:[{name:"value",description:"The value to insert."},{name:"position",description:"The zero based position to insert the text at."}],canBeParameter:!0},{name:"is_email",acceptsType:["string"],returnsType:["boolean"],description:"Returns true if the string is a valid email address.",docLink:"https://statamic.dev/modifiers/is_email",parameters:[],canBeParameter:!1},{name:"is_embeddable",acceptsType:["string"],returnsType:["boolean"],description:"Checks to see if a video URL is embeddable.",docLink:"https://statamic.dev/modifiers/is_embeddable",parameters:[],canBeParameter:!1},{name:"is_lowercase",acceptsType:["string"],returnsType:["boolean"],description:"Returns true if the string contains only lowercase characters.",docLink:"https://statamic.dev/modifiers/is_lowercase",parameters:[],canBeParameter:!1},{name:"is_url",acceptsType:["string"],returnsType:["boolean"],description:"Returns true if a string is a valid URL.",docLink:"https://statamic.dev/modifiers/is_url",parameters:[],canBeParameter:!1},{name:"lcfirst",acceptsType:["string"],returnsType:["string"],description:"Converts the first character of the value to lower case.",docLink:"https://statamic.dev/modifiers/lcfirst",parameters:[],canBeParameter:!1},{name:"length",acceptsType:["string"],returnsType:["number"],description:"Returns the number of items in an array or number of characters in a string.",docLink:"https://statamic.dev/modifiers/length",parameters:[],canBeParameter:!1},{name:"lower",acceptsType:["string"],returnsType:["string"],description:"Converts all characters to lowercase.",docLink:"https://statamic.dev/modifiers/lower",parameters:[],canBeParameter:!1},{name:"md5",acceptsType:["string"],returnsType:["string"],description:"Creates an MD5 hash of the variable.",docLink:"https://statamic.dev/modifiers/md5",parameters:[],canBeParameter:!1},{name:"rawurlencode",acceptsType:["string"],returnsType:["string"],description:"URL-encode a variable according to RFC-3986.",docLink:"https://statamic.dev/modifiers/rawurlencode",parameters:[],canBeParameter:!1},{name:"read_time",acceptsType:["string"],returnsType:["string"],description:"Returns an estimated read time, in minutes.",docLink:"https://statamic.dev/modifiers/read_time",parameters:[{name:"words per minute",description:"The words per minute to use as an estimate."}],canBeParameter:!0},{name:"regex_replace",acceptsType:["string"],returnsType:["string"],description:"Replaces all regex matches with a string.",docLink:"https://statamic.dev/modifiers/regex_replace",parameters:[{name:"pattern",description:"The regex pattern."},{name:"replace",description:"The replacement value."}],canBeParameter:!0},{name:"remove_left",acceptsType:["string"],returnsType:["string"],description:"Ensures that the string never begins with a specified string.",docLink:"https://statamic.dev/modifiers/remove_left/",parameters:[{name:"value",description:"The value to remove."}],canBeParameter:!0},{name:"remove_right",acceptsType:["string"],returnsType:["string"],description:"Ensures that a string never ends with a specified string.",docLink:"https://statamic.dev/modifiers/remove_right",parameters:[{name:"value",description:"The value to remove."}],canBeParameter:!0},{name:"replace",acceptsType:["string"],returnsType:["string"],description:"Replaces all occurrences of a string with a different value.",docLink:"https://statamic.dev/modifiers/replace",parameters:[{name:"needle",description:"The string to search for."},{name:"value",description:"The value to replace all occurrences with."}],canBeParameter:!0},{name:"reverse",acceptsType:["string","array"],returnsType:["string","array"],description:"Reverses all characters in a string, or all items in an array.",docLink:"https://statamic.dev/modifiers/reverse",parameters:[],canBeParameter:!1},{name:"safe_truncate",acceptsType:["string"],returnsType:["string"],description:"Truncates a string to a given length.",docLink:"https://statamic.dev/modifiers/safe_truncate",parameters:[{name:"length",description:"The desired string length."},{name:"suffix",description:"An optional suffix to append to the string if truncation occurs."}],canBeParameter:!1},{name:"sanitize",acceptsType:["string"],returnsType:["string"],description:"Converts special characters to HTML entities.",docLink:"https://statamic.dev/modifiers/sanitize",parameters:[],canBeParameter:!1},{name:"segment",acceptsType:["string"],returnsType:["string"],description:"Returns a segment by number from any valid URL or URI.",docLink:"https://statamic.dev/modifiers/segment",parameters:[{name:"segment",description:"The one-based segment to return."}],canBeParameter:!0},{name:"singular",acceptsType:["string"],returnsType:["string"],description:"Returns the singular form of an English word.",docLink:"https://statamic.dev/modifiers/singular",parameters:[],canBeParameter:!1},{name:"slugify",acceptsType:["string"],returnsType:["string"],description:"Converts the string into an URL slug.",docLink:"https://statamic.dev/modifiers/slugify",parameters:[],canBeParameter:!1},{name:"smartypants",acceptsType:["string"],returnsType:["string"],description:"Translates plain ASCII punctuation characters into typographic punctuation HTML entities.",docLink:"https://statamic.dev/modifiers/smartypants",parameters:[],canBeParameter:!1},{name:"spaceless",acceptsType:["string"],returnsType:["string"],description:"Removes excess whitespace and line breaks from a string.",docLink:"https://statamic.dev/modifiers/spaceless",parameters:[],canBeParameter:!1},{name:"substr",acceptsType:["string"],returnsType:["string"],description:"Returns a portion of a string based on provided a start index, and optional length.",docLink:"https://statamic.dev/modifiers/substr",parameters:[{name:"start",description:"The 0-based index to start searching."},{name:"length",description:"An optional length for the string to find."}],canBeParameter:!1},{name:"surround",acceptsType:["string"],returnsType:["string"],description:"Surrounds a string with another string.",docLink:"https://statamic.dev/modifiers/surround",parameters:[{name:"value",description:"The value to surround the string with."}],canBeParameter:!1},{name:"swap_case",acceptsType:["string"],returnsType:["string"],description:"Returns a case swapped version of the string.",docLink:"https://statamic.dev/modifiers/swap_case",parameters:[],canBeParameter:!1},{name:"tidy",acceptsType:["string"],returnsType:["string"],description:"Returns a string with smart quotes, ellipsis characters, and dashes from Windows-1252 replaced by ASCII equivalents.",docLink:"https://statamic.dev/modifiers/tidy",parameters:[],canBeParameter:!1},{name:"title",acceptsType:["string"],returnsType:["string"],description:"Returns a Title Cased version of the string.",docLink:"https://statamic.dev/modifiers/title",parameters:[],canBeParameter:!1},{name:"trim",acceptsType:["string"],returnsType:["string"],description:"Removes whitespace from the start and end of the string.",docLink:"https://statamic.dev/modifiers/trim",parameters:[],canBeParameter:!1},{name:"truncate",acceptsType:["string"],returnsType:["string"],description:"Truncates a string to a given length.",docLink:"https://statamic.dev/modifiers/truncate",parameters:[{name:"length",description:"The maximum string length."},{name:"suffix",description:"An optional suffix to append to the string if truncation occurs."}],canBeParameter:!1},{name:"ucfirst",acceptsType:["string"],returnsType:["string"],description:"Upper cases the first character in the string.",docLink:"https://statamic.dev/modifiers/ucfirst",parameters:[],canBeParameter:!1},{name:"underscored",acceptsType:["string"],returnsType:["string"],description:"Returns a lower-cased and trimmed version of the string, separated by underscores.",docLink:"https://statamic.dev/modifiers/underscored",parameters:[],canBeParameter:!1},{name:"upper",acceptsType:["string"],returnsType:["string"],description:"Transforms the string to uppercase.",docLink:"https://statamic.dev/modifiers/upper",parameters:[],canBeParameter:!1},{name:"urldecode",acceptsType:["string"],returnsType:["string"],description:"URL-decodes the string.",docLink:"https://statamic.dev/modifiers/urldecode",parameters:[],canBeParameter:!1},{name:"urlencode",acceptsType:["string"],returnsType:["string"],description:"URL-encodes the string.",docLink:"https://statamic.dev/modifiers/urlencode",parameters:[],canBeParameter:!1},{name:"widont",acceptsType:["string"],returnsType:["string"],description:"Attempts to prevent lines with single words.",docLink:"https://statamic.dev/modifiers/widont",parameters:[],canBeParameter:!1},{name:"word_count",acceptsType:["string"],returnsType:["number"],description:"Returns the number of words in the string.",docLink:"https://statamic.dev/modifiers/word_count",parameters:[],canBeParameter:!1},{name:"add_slashes",acceptsType:["string"],returnsType:["string"],description:"Adds slashes before characters that need to be escaped.",docLink:"https://statamic.dev/modifiers/add_slashes",canBeParameter:!1,parameters:[]}];var rb=[{name:"console_log",acceptsType:["*"],returnsType:["null"],description:"Displays variable data in the browser's JavaScript console.",docLink:"https://statamic.dev/modifiers/console_log",parameters:[],canBeParameter:!1},{name:"decode",acceptsType:["string"],returnsType:["string"],description:"Converts all HTML entities to their applicable character codes.",docLink:"https://statamic.dev/modifiers/decode",parameters:[],canBeParameter:!1},{name:"dump",acceptsType:["*"],returnsType:["null"],description:"Displays variable data in the browser.",docLink:"https://statamic.dev/modifiers/dump",parameters:[],canBeParameter:!1},{name:"full_urls",acceptsType:["string"],returnsType:["string"],description:"Replaces root-relative URLs with absolute URLs.",docLink:"https://statamic.dev/modifiers/full_urls",parameters:[],canBeParameter:!1},{name:"repeat",acceptsType:["string"],returnsType:["string"],description:"Repeats a value a given number of times.",docLink:"https://statamic.dev/modifiers/repeat",parameters:[{name:"repeat_count",description:"The number of times to repeat the value."}],canBeParameter:!0},{name:"to_spaces",acceptsType:["string"],returnsType:["string"],description:"Converts all tabs to spaces.",docLink:"https://statamic.dev/modifiers/to_spaces",parameters:[{name:"space_count",description:"The number of spaces to replace tabs with."}],canBeParameter:!1},{name:"to_tabs",acceptsType:["string"],returnsType:["string"],description:"Converts spaces to tabs.",docLink:"https://statamic.dev/modifiers/to_tabs",parameters:[{name:"space_count",description:"The number of spaces to convert to tabs."}],canBeParameter:!1},{name:"to_json",acceptsType:["*"],returnsType:["string"],description:"Converts the data to JSON.",docLink:"https://statamic.dev/modifiers/to_json",parameters:[],canBeParameter:!1},{name:"to_bool",acceptsType:["*"],returnsType:["boolean"],description:"Converst the data to a boolean",parameters:[],canBeParameter:!1,docLink:null}];var es=class{constructor(){this.registeredModifiers=new Map;this.acceptTypedModifierReference=new Map;this.returnTypeModifierReference=new Map;this.macros=new Map;this.modifierNameCache=[]}reset(){this.modifierNameCache=[],this.registeredModifiers.clear(),this.acceptTypedModifierReference.clear(),this.returnTypeModifierReference.clear()}getRegisteredModifiers(){return this.registeredModifiers}resetMacros(){this.macros.clear()}loadCoreModifiers(){this.registerModifiers(zy),this.registerModifiers(Xy),this.registerModifiers(Qy),this.registerModifiers(Jy),this.registerModifiers(Zy),this.registerModifiers(eb),this.registerModifiers(rb),this.registerModifiers(nb),this.registerModifiers(tb)}getModifierNames(){return this.modifierNameCache}registerMacro(e){this.macros.set(e.name,e)}registerMacros(e){for(let n=0;n0)for(let r=0;r0?i.valueNodes[0].content:""}if(this.hasParameterModifiers())for(let r=0;r0)for(let r=0;r0?{start:i.startPosition,end:i.endPosition}:null}if(this.hasParameterModifiers())for(let r=0;r0&&this.node.modifierChain.lastManifestedModifier!=null){if(this.node.modifierChain.lastManifestedModifier.parameters.length>0&&this.node.modifierChain.lastManifestedModifier.modifier!=null&&Me.instance!=null){let e=this.node.modifierChain.lastManifestedModifier.modifier;return Me.instance.getProbableReturnType(e,this.isPaired())}return"*"}if(this.parameterModifiers.length>0){let e=this.parameterModifiers.reverse();for(let n=0;n0&&this.node.modifierChain.lastManifestedModifier!=null)return this.node.modifierChain.lastManifestedModifier.parameters.length>0?this.node.modifierChain.lastManifestedModifier.parameters[0].value:"";if(this.parameterModifiers.length>0){let e=this.parameterModifiers.reverse();for(let n=0;n0&&this.node.modifierChain.lastModifier!=null)return this.node.modifierChain.lastModifier;if(this.parameterModifiers.length>0){let e=this.parameterModifiers.reverse();for(let n=0;n0:!0}hasParameterModifiers(){return this.parameterModifiers.length>0}hasShorthandModifiers(){return this.node.modifierChain!=null&&this.node.modifierChain.modifierChain.length>0}hasModifier(e){return this.modifierNames.includes(e)}};function Xp(t){let e=[];return t.forEach(n=>{n instanceof B?e.push(n):n instanceof vt&&n.logicBranches.length>0&&n.logicBranches.forEach(r=>{if(r.head!=null){let i=r.head;i.originalNode!=null?e.push(i.originalNode):e.push(i)}})}),e}var J0=[" ",` -`,"\r"," ","\f","\v","\xA0","\u2000","\u2001","\u2002","\u2003","\u2004","\u2005","\u2006","\u2007","\u2008","\u2009","\u200A","\u200B","\u2028","\u2029","\u3000"].join("");function ib(t){return(typeof t=="number"||typeof t=="string"&&J0.indexOf(t.slice(-1))===-1)&&t!==""&&!isNaN(t)}var G=class{static normalizeLineEndings(e,n=` +`).map(d=>d.trim()),r=[],i=new Map,s="",o="",a=[],l=[],u="",c=null,f=!1,m=!0;for(let d=0;dC.trim())),f=!1;else if(_.startsWith(By))a=a.concat(_.slice(By.length).split(",").map(C=>C.trim())),f=!1;else if(_.startsWith(jy))l=l.concat(_.slice(jy.length).split(",").map(C=>C.trim())),f=!1;else if(_.startsWith(My))s=_.slice(My.length).trim(),f=!1;else if(_.startsWith(Fy))o=_.slice(Fy.length).trim(),f=!0;else if(_.startsWith(Vy))o=_.slice(Vy.length).trim(),f=!0;else if(_.startsWith(Uy))u=_.slice(Uy.length).trim(),f=!1;else if(_.startsWith(Gy))u="@page "+_.slice(Gy.length).trim(),f=!1;else if(_.startsWith(Wy)){let C=Wy.length,h=!1;_.startsWith(Hy)&&(C=Hy.length,h=!0);let g=_.slice(C).trim().split(" ");if(g.length>0)if(g[0]==z0&&g.length>=4){g.shift();let N=g.shift(),S=g.shift(),V=g.join(" ");r.push({acceptsVariableInterpolation:!0,aliases:[],allowsVariableReference:!0,description:V,expectsTypes:["*"],isDynamic:!0,isRequired:h,name:S}),i.set(S,N)}else{let N=g.shift(),S=g.join(" ");r.push({acceptsVariableInterpolation:!0,aliases:[],allowsVariableReference:!0,description:S,expectsTypes:["*"],isDynamic:!0,isRequired:h,name:N})}}else _.startsWith(Yy)?_.slice(Yy.length).trim().toLowerCase()=="true"?m=!0:m=!1:f&&(o+=` +`+_.trim())}if(u.length>0){let d=u.split(" ");if(d.length==2){let _=d[0],C=d[1];if(C.includes(".")){let h=C.split(".");if(h.length==2){let b=h[0],g=h[1];c={variableName:_,collectionName:b,fieldHandle:g,setHandle:""}}else if(h.length==3){let b=h[0],g=h[1],N=h[2];c={variableName:_,collectionName:b,fieldHandle:g,setHandle:N}}}else c={variableName:_,setHandle:"",collectionName:"",fieldHandle:C}}}if(t.trim().length>0&&ce.instance!=null&&ce.instance.hasStructure()){let d=ce.instance.getStructure().findView(t);d!=null&&(d.injectsParameters=r,d.varReferenceNames=i)}let p={documentName:s,documentDescription:o,collectionInjections:a,blueprints:l,variableHelper:c,injectsParameters:r,varReferenceNames:i,formatterEnabled:m};return t.trim().length>0&&e.startPosition!=null&&(e.startPosition.line<=1||e.index<=1)&&si.registerDetails(t,p),p}var X0=["markdown","text","textarea","slug","button_group","code","color","date","form","link","structures","select","taxonomies","terms","template","time","video","users","user_groups","user_roles"],Q0=["array","assets","bard","blueprints","collections","entries","list","grid","replicator","structures_multiple","sites","select_multiple","form_multiple","table","tags","terms_multiple","taxonomies_multiple","users_multiple","checkboxes","select_multiple","yaml","user_groups_multiple","user_roles_multiple"],J0=["integer","range"],Z0=["toggle"];function Vu(t){return X0.includes(t)?"string":Q0.includes(t)?"array":J0.includes(t)?"number":Z0.includes(t)?"boolean":t}var Ms=class{constructor(){this.partialReferences=new Map;this.cacheReferences=new Map;this.removesPageScope=new Map}clearAllReferences(e){this.clearPartialReferences(e),this.clearCacheReferences(e)}registerPartialReferences(e,n){this.partialReferences.has(e)==!1&&this.partialReferences.set(e,[]),this.partialReferences.set(e,n)}registerCacheReferences(e,n){this.cacheReferences.has(e)==!1&&this.cacheReferences.set(e,[]),this.cacheReferences.set(e,n)}clearPartialReferences(e){this.partialReferences.has(e)&&this.partialReferences.set(e,[])}clearRemovesPageScope(e){this.removesPageScope.has(e)&&this.removesPageScope.delete(e)}pageScopeDisabled(e){return this.removesPageScope.has(e)}clearCacheReferences(e){this.cacheReferences.has(e)&&this.cacheReferences.set(e,[])}setRemovesPageScope(e,n){this.removesPageScope.set(e,n)}getPartialReferences(e){return this.partialReferences.has(e)==!1?[]:this.partialReferences.get(e)}getCacheReferencnes(e){return this.cacheReferences.has(e)==!1?[]:this.cacheReferences.get(e)}hasPartialReferences(e){return this.partialReferences.has(e)}hasCacheReferences(e){return this.cacheReferences.has(e)}};Ms.instance=null;(typeof Ms.instance=="undefined"||Ms.instance==null)&&(Ms.instance=new Ms);var Er=Ms;var qt=class{constructor(){this.index=-1;this.offset=0;this.line=0;this.char=0}shiftRight(e){let n=new qt;return n.offset=this.offset+e,n.index=this.index+e,n.line=this.line,n.char=this.char+e,n}isBefore(e){return e==null?!1:e.line>this.line||e.line==this.line&&this.offset=e.index&&this.index<=n.index+r}isWithinRange(e){return e==null?!1:e.start!=null&&e.end!=null?this.isWithin(e.start,e.end):!1}};var zp=class{constructor(){this.start=null;this.end=null}},sl=zp;sl.Empty=new zp;function Ky(t,e){let n=e.copy(),r=e.copy();return r.addVariable({sourceName:"*internal.group_by",sourceField:null,dataType:"string",name:"group",introducedBy:t}),r.addVariable({sourceName:"*internal.group_by",sourceField:null,dataType:"string",name:"key",introducedBy:t}),r.addScopeList("items",n),e.addScopeList("groups",r),e}function $y(t,e){let n=e.copy();return e.addScopeList("items",n),e}var zy=[{name:"as",acceptsType:["array"],returnsType:["array"],description:"Alias the array variable with a key.",docLink:"https://statamic.dev/modifiers/as",parameters:[{name:"alias",description:"The alias name."}],canBeParameter:!0},{name:"ampersand_list",acceptsType:["array"],returnsType:["string"],description:"Converts the array into a comma delimited string, with an ampersand before the last item.",docLink:"https://statamic.dev/modifiers/ampersand_list",parameters:[],canBeParameter:!1},{name:"collapse",acceptsType:["array"],returnsType:["array"],description:"Collapses an array of arrays into a single, flat, array.",docLink:"https://statamic.dev/modifiers/collapse",parameters:[],canBeParameter:!1},{name:"contains",acceptsType:["array","string"],returnsType:["boolean"],description:"Tests if the value contains another value.",docLink:"https://statamic.dev/modifiers/contains",parameters:[{name:"needle",description:"The value to check for."}],canBeParameter:!1},{name:"count",acceptsType:["array"],returnsType:["number"],description:"Returns the number of items in the array.",docLink:"https://statamic.dev/modifiers/count",parameters:[],canBeParameter:!1},{name:"dl",acceptsType:["array"],returnsType:["string"],description:"Turns an associative array into an HTML definition list.",docLink:"https://statamic.dev/modifiers/dl",parameters:[],canBeParameter:!1},{name:"explode",acceptsType:["string"],returnsType:["array"],description:"Breaks a string into an array on a given delimiter.",docLink:"https://statamic.dev/modifiers/explode",parameters:[{name:"delimiter",description:"The delimiter to break the string apart on."}],canBeParameter:!0},{name:"flatten",acceptsType:["array"],returnsType:["array"],description:"Flattens a multi-dimensional array.",docLink:"https://statamic.dev/modifiers/flatten",parameters:[],canBeParameter:!1},{name:"flip",acceptsType:["array"],returnsType:["array"],description:"Swaps the array keys with their values.",docLink:"https://statamic.dev/modifiers/flip",parameters:[],canBeParameter:!1},{name:"group_by",acceptsType:["array"],returnsType:["array"],description:"Groups the array items by the given key.",docLink:"https://statamic.dev/modifiers/group_by",parameters:[{name:"key",description:"The key to group by."}],canBeParameter:!0,augmentScope:Ky},{name:"in_array",acceptsType:["array"],returnsType:["boolean"],description:"Tests if an array contains a specific value.",docLink:"https://statamic.dev/modifiers/in_array",parameters:[{name:"needle",description:"The value to check for."}],canBeParameter:!1},{name:"is_empty",acceptsType:["array"],returnsType:["boolean"],description:"Tests if the array is empty.",docLink:"https://statamic.dev/modifiers/is_empty",parameters:[],canBeParameter:!1},{name:"join",acceptsType:["array"],returnsType:["string"],description:"Turn an array into a string by gluing together all the data.",docLink:"https://statamic.dev/modifiers/join",parameters:[{name:"glue",description:"The string to combine the parts by."}],canBeParameter:!0},{name:"joinplode",acceptsType:["array"],returnsType:["string"],description:"Turn an array into a string by gluing together all the data.",docLink:null,parameters:[{name:"glue",description:"The string to combine the parts by."}],canBeParameter:!0},{name:"limit",acceptsType:["array"],returnsType:["array"],description:"Limits the number of items returned in the array",docLink:"https://statamic.dev/modifiers/limit",parameters:[{name:"count",description:"The maximum number of items to return."}],canBeParameter:!0},{name:"list",acceptsType:["array"],returnsType:["string"],description:"Converts the array into a comma-separated string.",docLink:"https://statamic.dev/modifiers/list",parameters:[],canBeParameter:!1},{name:"offset",acceptsType:["array"],returnsType:["array"],description:"Offsets the items returned in the array.",docLink:"https://statamic.dev/modifiers/offset",parameters:[{name:"offset",description:"The one-based index to start retrieving items."}],canBeParameter:!0},{name:"ol",acceptsType:["array"],returnsType:["string"],description:"Turns the array into an HTML ordered list.",docLink:"https://statamic.dev/modifiers/ol",parameters:[],canBeParameter:!1},{name:"option_list",acceptsType:["array"],returnsType:["string"],description:"Turns an array into a pipe-delimited string.",docLink:"https://statamic.dev/modifiers/option_list",parameters:[],canBeParameter:!1},{name:"pluck",acceptsType:["array"],returnsType:["array"],description:"Plucks a value from a collection of items.",parameters:[{name:"value",description:"The value to pluck from the array or collection."}],canBeParameter:!0,docLink:null},{name:"pad",acceptsType:["array"],returnsType:["array"],description:"Pads the array to a specified length with the given value.",docLink:"https://statamic.dev/modifiers/pad",parameters:[{name:"length",description:"The desired length of the array."},{name:"value",description:"The value to pad the array with."}],canBeParameter:!0},{name:"piped",acceptsType:["array"],returnsType:["string"],description:"Turns an array into a pipe-delimited string.",docLink:"https://statamic.dev/modifiers/piped",parameters:[],canBeParameter:!1},{name:"sentence_list",acceptsType:["array"],returnsType:["string"],description:'Turns the array into a comma-delimited list, with the word "and" before the last item.',docLink:"https://statamic.dev/modifiers/sentence_list",parameters:[],canBeParameter:!1},{name:"shuffle",acceptsType:["array"],returnsType:["array"],description:"Randomizes the order of array elements.",docLink:"https://statamic.dev/modifiers/shuffle",parameters:[],canBeParameter:!1},{name:"sort",acceptsType:["array"],returnsType:["array"],description:"Sorts the array by a key in ascending or descending order.",docLink:"https://statamic.dev/modifiers/sort",parameters:[{name:"key",description:"The key to sort by."},{name:"order",description:"The sort direction. `asc` or `desc`."}],canBeParameter:!0},{name:"sum",acceptsType:["array"],returnsType:["number"],description:"Returns the sum of all items in the array.",docLink:"https://statamic.dev/modifiers/sum",parameters:[{name:"key",description:"The value to sum."}],canBeParameter:!1},{name:"ul",acceptsType:["array"],returnsType:["string"],description:"Turns the array into an HTML unordered list.",docLink:"https://statamic.dev/modifiers/ul",parameters:[],canBeParameter:!1},{name:"unique",acceptsType:["array"],returnsType:["array"],description:"Returns all unique items in the array.",docLink:"https://statamic.dev/modifiers/unique",parameters:[],canBeParameter:!1},{name:"where",acceptsType:["array"],returnsType:["array"],description:"Filters the array by a given key and value.",docLink:"https://statamic.dev/modifiers/where",parameters:[{name:"key",description:"The property to filter by."},{name:"value",description:"The value to compare to."}],canBeParameter:!0},{name:"split",acceptsType:["array"],returnsType:["array"],description:"Splits an array into smaller arrays with the provided size.",canBeParameter:!0,docLink:"",parameters:[{name:"size",description:"The size of each new array"}],augmentScope:$y},{name:"compact",acceptsType:["string"],returnsType:["array"],description:"Accepts a comma-delimited list of variable names and return an array with their values.",canBeParameter:!0,docLink:"",parameters:[{name:"variables",description:"A comma-delimited list of variable names."}]}];var Xy=[{name:"background_position",acceptsType:["string"],returnsType:["string"],description:"Converts an asset focal point into a background-position CSS property.",docLink:"https://statamic.dev/modifiers/background_position",parameters:[],canBeParameter:!1},{name:"image",acceptsType:["string"],returnsType:["string"],description:"Generates an HTML image element with the variable's value as the src.",docLink:"https://statamic.dev/modifiers/image",parameters:[],canBeParameter:!1},{name:"output",acceptsType:["string"],returnsType:["string"],description:"Returns the string output of an Asset file's contents.",docLink:"https://statamic.dev/modifiers/output",parameters:[],canBeParameter:!1}];var Qy=[{name:"contains_all",acceptsType:["string"],returnsType:["boolean"],description:"Tests if a string contains all of the provided needles.",docLink:"https://statamic.dev/modifiers/contains_all",parameters:[{name:"needle",description:"The string(s) to search for."}],canBeParameter:!1},{name:"contains_any",acceptsType:["string"],returnsType:["boolean"],description:"Tests if a string contains all of the provided needles.",docLink:"https://statamic.dev/modifiers/contains_any",parameters:[{name:"needle",description:"The string(s) to search for."}],canBeParameter:!1},{name:"ends_with",acceptsType:["string"],returnsType:["boolean"],description:"Tests if a string ends with another string.",docLink:"https://statamic.dev/modifiers/ends_with",parameters:[{name:"value",description:"The value to check against."}],canBeParameter:!1},{name:"has_lower_case",acceptsType:["string"],returnsType:["boolean"],description:"Tests if the string contains any lowercase characters.",docLink:"https://statamic.dev/modifiers/has_lower_case",parameters:[],canBeParameter:!1},{name:"has_upper_case",acceptsType:["string"],returnsType:["boolean"],description:"Tests if the string contains any uppercase characters.",docLink:"https://statamic.dev/modifiers/has_upper_case",parameters:[],canBeParameter:!1},{name:"in_array",acceptsType:["array"],returnsType:["boolean"],description:"Tests if an array contains a specific value.",docLink:"https://statamic.dev/modifiers/in_array",parameters:[{name:"needle",description:"The value(s) to search for."}],canBeParameter:!1},{name:"is_after",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the string contains only alphanumeric characters.",docLink:"https://statamic.dev/modifiers/is_after",parameters:[{name:"date",description:"The date to compare to."}],canBeParameter:!1},{name:"is_alphanumeric",acceptsType:["string"],returnsType:["boolean"],description:"Tests if the string contains only alphanumeric characters.",docLink:"https://statamic.dev/modifiers/is_alphanumeric",parameters:[],canBeParameter:!1},{name:"is_before",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if a date is before another date.",docLink:"https://statamic.dev/modifiers/is_before",parameters:[{name:"date",description:"The date to compare to."}],canBeParameter:!1},{name:"is_between",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if a date is between two other dates.",docLink:"https://statamic.dev/modifiers/is_between",parameters:[{name:"start_date",description:"The start date to compare."},{name:"end_date",description:"The end date to compare."}],canBeParameter:!1},{name:"is_blank",acceptsType:["string"],returnsType:["boolean"],description:"Tests if the string contains only whitespace characters.",docLink:"https://statamic.dev/modifiers/is_blank",parameters:[],canBeParameter:!1},{name:"is_email",acceptsType:["string"],returnsType:["boolean"],description:"Tests if the string is a valid email address.",docLink:"https://statamic.dev/modifiers/is_email",parameters:[],canBeParameter:!1},{name:"is_future",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the date is in the future.",docLink:"https://statamic.dev/modifiers/is_future",parameters:[],canBeParameter:!1},{name:"is_json",acceptsType:["string"],returnsType:["boolean"],description:"Tests if the string is valid JSON.",docLink:"https://statamic.dev/modifiers/is_json",parameters:[],canBeParameter:!1},{name:"is_leap_year",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the date is a leap year.",docLink:"https://statamic.dev/modifiers/is_leap_year",parameters:[],canBeParameter:!1},{name:"is_numeric",acceptsType:["string","number"],returnsType:["boolean"],description:"Tests if the value is a number or numeric string.",docLink:"https://statamic.dev/modifiers/is_numeric",parameters:[],canBeParameter:!1},{name:"is_past",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the date is in the past.",docLink:"https://statamic.dev/modifiers/is_past",parameters:[],canBeParameter:!1},{name:"is_today",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the date is today.",docLink:"https://statamic.dev/modifiers/is_today",parameters:[],canBeParameter:!1},{name:"is_uppercase",acceptsType:["string"],returnsType:["boolean"],description:"Tests if the string contains only uppercase characters.",docLink:"https://statamic.dev/modifiers/is_uppercase",parameters:[],canBeParameter:!1},{name:"is_url",acceptsType:["string"],returnsType:["boolean"],description:"Tests if the string is a valid URL.",docLink:"https://statamic.dev/modifiers/is_url",parameters:[],canBeParameter:!1},{name:"is_weekday",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the date is a week day.",docLink:"https://statamic.dev/modifiers/is_weekday",parameters:[],canBeParameter:!1},{name:"is_weekend",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the date is a weekend day.",docLink:"https://statamic.dev/modifiers/is_weekend",parameters:[],canBeParameter:!1},{name:"is_yesterday",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the date is yesterday.",docLink:"https://statamic.dev/modifiers/is_yesterday",parameters:[],canBeParameter:!1},{name:"is_tomorrow",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the date is tomorrow.",docLink:null,parameters:[],canBeParameter:!1},{name:"starts_with",acceptsType:["string"],returnsType:["boolean"],description:"Tests if a value starts with the provided value.",docLink:"https://statamic.dev/modifiers/starts_with",parameters:[{name:"value",description:"The value to test for."}],canBeParameter:!1}];var Jy=[{name:"days_ago",acceptsType:["string","date"],returnsType:["number"],description:"Returns the number of days since a given date.",docLink:"https://statamic.dev/modifiers/days_ago",parameters:[],canBeParameter:!1},{name:"format_translated",acceptsType:["string","date"],returnsType:["string","date"],description:"Returns a formatted Carbon datetime/string.",docLink:"https://statamic.dev/modifiers/format",parameters:[{name:"format",description:"The format to use."}],canBeParameter:!0},{name:"format",acceptsType:["string","date"],returnsType:["string","date"],description:"Formats the date using the provided format using PHP's [date variables](https://www.php.net/date).",docLink:"https://statamic.dev/modifiers/format",parameters:[{name:"format",description:"The format to use."}],canBeParameter:!0},{name:"format_localized",acceptsType:["string","date"],returnsType:["string","date"],description:"Forms the date using server's locale, using PHP's [strftime format variables](https://www.php.net/strftime).",docLink:"https://statamic.dev/modifiers/format_localized",parameters:[{name:"format",description:"The format to use."}],canBeParameter:!0},{name:"hours_ago",acceptsType:["string","date"],returnsType:["number"],description:"Returns the number of hours since the date.",docLink:"https://statamic.dev/modifiers/hours_ago",parameters:[],canBeParameter:!1},{name:"iso_format",acceptsType:["string","date"],returnsType:["string","date"],description:"Formats the date using an ISO format.",docLink:"https://statamic.dev/modifiers/iso_format",parameters:[{name:"format",description:"The format to use."}],canBeParameter:!1},{name:"minutes_ago",acceptsType:["string","date"],returnsType:["number"],description:"Returns the number of minutes since the date.",docLink:"https://statamic.dev/modifiers/minutes_ago",parameters:[],canBeParameter:!1},{name:"modify_date",acceptsType:["string","date"],returnsType:["string","date"],description:"Alters the date by incrementing or decrementing it in a format accepted by PHP's [strtotime](https://www.php.net/strtotime) function.",docLink:"https://statamic.dev/modifiers/modify_date",parameters:[],canBeParameter:!0},{name:"months_ago",acceptsType:["string","date"],returnsType:["number"],description:"Returns the number of months since the date.",docLink:"https://statamic.dev/modifiers/months_ago",parameters:[],canBeParameter:!1},{name:"relative",acceptsType:["string","date"],returnsType:["string"],description:"Returns a human readable date difference.",docLink:"https://statamic.dev/modifiers/relative",parameters:[{name:"add_ago",description:"Whether to add the relative suffix words at the end of the string."}],canBeParameter:!1},{name:"seconds_ago",acceptsType:["string","date"],returnsType:["number"],description:"Returns the number of seconds since the date.",docLink:"https://statamic.dev/modifiers/seconds_ago",parameters:[],canBeParameter:!1},{name:"timezone",acceptsType:["string","date"],returnsType:["string","date"],description:"Applies a timezone to the date.",docLink:"https://statamic.dev/modifiers/timezone",parameters:[{name:"timezone",description:"The timezone to apply."}],canBeParameter:!1},{name:"weeks_ago",acceptsType:["string","date"],returnsType:["number"],description:"Returns the number of weeks since the date.",docLink:"https://statamic.dev/modifiers/weeks_ago",parameters:[],canBeParameter:!1},{name:"years_ago",acceptsType:["string","date"],returnsType:["number"],description:"Returns the number of years since the date.",docLink:"https://statamic.dev/modifiers/years_ago",parameters:[],canBeParameter:!1}];var Zy=[{name:"chunk",acceptsType:["array"],returnsType:["array"],description:"Breaks the array or collection into smaller arrays of a given size.",docLink:"https://statamic.dev/modifiers/chunk",parameters:[{name:"chunk_size",description:"The maximum length of each new chunk."}],canBeParameter:!0},{name:"favicon",acceptsType:["string"],returnsType:["string"],description:"Generates a favicon HTML meta tag for the given value.",docLink:"https://statamic.dev/modifiers/favicon",parameters:[],canBeParameter:!1},{name:"first",acceptsType:["string","array"],returnsType:["*"],description:"Returns the specified number of characters from the beginning of the string.",docLink:"https://statamic.dev/modifiers/first",parameters:[{name:"count",description:"The number of characters to return."}],canBeParameter:!0},{name:"last",acceptsType:["string","array"],returnsType:["*"],description:"Returns the specified number of characters from the end of the string.",docLink:"https://statamic.dev/modifiers/last",parameters:[{name:"count",description:"The number of characters to return."}],canBeParameter:!0},{name:"link",acceptsType:["string"],returnsType:["string"],description:"Generates an HTML link for the provided value.",docLink:"https://statamic.dev/modifiers/link",parameters:[],canBeParameter:!1},{name:"mailto",acceptsType:["string"],returnsType:["string"],description:"Generates a mailto HTML link for the provided value.",docLink:"https://statamic.dev/modifiers/mailto",parameters:[],canBeParameter:!1},{name:"markdown",acceptsType:["string"],returnsType:["string"],description:"Parses the value as Markdown and returns the HTML.",docLink:"https://statamic.dev/modifiers/markdown",parameters:[],canBeParameter:!1},{name:"nl2br",acceptsType:["string"],returnsType:["string"],description:"Replaces line breaks with HTML `
` tags.",docLink:"https://statamic.dev/modifiers/nl2br",parameters:[],canBeParameter:!1},{name:"obfuscate",acceptsType:["string"],returnsType:["string"],description:"Modifies the input string by replacing it with special characters, making it harder for bots but remains readable to site visitors.",docLink:"https://statamic.dev/modifiers/obfuscate",parameters:[],canBeParameter:!1},{name:"obfuscate_email",acceptsType:["string"],returnsType:["string"],description:"Obfuscates an email address with special HTML characters.",docLink:"https://statamic.dev/modifiers/obfuscate_email",parameters:[],canBeParameter:!1},{name:"strip_tags",acceptsType:["string"],returnsType:["string"],description:"Removes HTML tags from the string.",docLink:"https://statamic.dev/modifiers/strip_tags",parameters:[{name:"tags",description:"The HTML tag(s) to remove from the string."}],canBeParameter:!1},{name:"table",acceptsType:["array"],returnsType:["string"],description:"Turns a [Table FieldType](https://statamic.dev/fieldtypes/table) array into an HTML table.",docLink:"https://statamic.dev/modifiers/table",parameters:[{name:"content_markdown",description:"Whether to parse cell contents as Markdown."}],canBeParameter:!1},{name:"textile",acceptsType:["string"],returnsType:["string"],description:"Parses a string with [Textile](http://demo.textilewiki.com/theme-default/) and returns the HTML.",docLink:"https://statamic.dev/modifiers/textile",parameters:[],canBeParameter:!1},{name:"wrap",acceptsType:["string"],returnsType:["string"],description:"Wraps a string with a given HTML tag.",docLink:"https://statamic.dev/modifiers/wrap",parameters:[{name:"expression",description:"The HTML tag or Emmet-style expression to wrap the value in."}],canBeParameter:!1}];var eb=[{name:"add",acceptsType:["number"],returnsType:["number"],description:"Adds two values together.",docLink:"https://statamic.dev/modifiers/add",parameters:[{name:"value",description:"The value to add."}],canBeParameter:!0},{name:"+",acceptsType:["number"],returnsType:["number"],description:"Adds two values together.",docLink:"https://statamic.dev/modifiers/add",parameters:[{name:"value",description:"The value to add."}],canBeParameter:!1},{name:"ceil",acceptsType:["number"],returnsType:["number"],description:"Rounds the value to the next whole number.",docLink:"https://statamic.dev/modifiers/ceil",parameters:[],canBeParameter:!1},{name:"divide",acceptsType:["number"],returnsType:["number"],description:"Divides two values.",docLink:"https://statamic.dev/modifiers/divide",parameters:[{name:"value",description:"The value to divide."}],canBeParameter:!0},{name:"floor",acceptsType:["number"],returnsType:["number"],description:"Rounds a number down to the next whole number.",docLink:"https://statamic.dev/modifiers/floor",parameters:[],canBeParameter:!0},{name:"format_number",acceptsType:["number"],returnsType:["string"],description:"Formats a number.",docLink:"https://statamic.dev/modifiers/format_number",parameters:[{name:"precision",description:"Number of decimal places before rounding."},{name:"decimal_separator",description:"The decimal separator (defaults to `.`)."},{name:"thousands_separator",description:"The thousands separator (default `,`)."}],canBeParameter:!0},{name:"mode",acceptsType:["number"],returnsType:["number"],description:"",docLink:"",parameters:[],canBeParameter:!0},{name:"multiply",acceptsType:["number"],returnsType:["number"],description:"Multiplies two values.",docLink:"https://statamic.dev/modifiers/multiply",parameters:[{name:"value",description:"The value to multiply."}],canBeParameter:!0},{name:"*",acceptsType:["number"],returnsType:["number"],description:"Multiplies two values.",docLink:"https://statamic.dev/modifiers/multiply",parameters:[{name:"value",description:"The value to multiply."}],canBeParameter:!1},{name:"round",acceptsType:["number"],returnsType:["number"],description:"Rounds a number to a specified precision.",docLink:"https://statamic.dev/modifiers/round",parameters:[{name:"precision",description:"The number of digits after the decimal point."}],canBeParameter:!0},{name:"subtract",acceptsType:["number"],returnsType:["number"],description:"Subtracts two values.",docLink:"https://statamic.dev/modifiers/subtract",parameters:[{name:"value",description:"The value to subtract."}],canBeParameter:!0},{name:"-",acceptsType:["number"],returnsType:["number"],description:"Subtracts two values.",docLink:"https://statamic.dev/modifiers/subtract",parameters:[{name:"value",description:"The value to subtract."}],canBeParameter:!1}];var tb=[{name:"partial",acceptsType:["*"],returnsType:["*view*"],description:"Injects data into a partial and renders it.",docLink:"https://statamic.dev/modifiers/partial",parameters:[{name:"partial",description:"The name of the partial."}],canBeParameter:!1},{name:"macro",acceptsType:["*"],returnsType:["*"],description:"Runs a pre-configured macro on the data.",docLink:"https://statamic.dev/modifiers/macro",parameters:[{name:"macro",description:"The macro name."}],canBeParameter:!1},{name:"url",acceptsType:["string","*"],returnsType:["string"],description:"Locates the URL of an asset, page, entry, or taxonomy term based on the variable contents.",docLink:"https://statamic.dev/modifiers/url",parameters:[],canBeParameter:!1}];var nb=[{name:"ascii",acceptsType:["string"],returnsType:["string"],description:"Replaces all non-ASCII characters with their closest ASCII counterparts.",docLink:"https://statamic.dev/modifiers/ascii",parameters:[],canBeParameter:!1},{name:"at",acceptsType:["string"],returnsType:["string"],description:"Returns the character at a given zero-based position.",docLink:"https://statamic.dev/modifiers/at",parameters:[{name:"position",description:"The zero-based position to retrieve a character from."}],canBeParameter:!0},{name:"backspace",acceptsType:["string"],returnsType:["string"],description:"Removes a specified number of characters from the end of a string.",docLink:"https://statamic.dev/modifiers/backspace",parameters:[{name:"character_count",description:"The number of characters to remove from the end of the string."}],canBeParameter:!0},{name:"camelize",acceptsType:["string"],returnsType:["string"],description:"Converts the string into camelCase.",docLink:"https://statamic.dev/modifiers/camelize",parameters:[],canBeParameter:!1},{name:"cdata",acceptsType:["string"],returnsType:["string"],description:"Wraps the string in CDATA XML tags.",docLink:"https://statamic.dev/modifiers/cdata",parameters:[],canBeParameter:!1},{name:"collapse_whitespace",acceptsType:["string"],returnsType:["string"],description:"Trims a string and replaces consecutive whitespace characters with a single space.",docLink:"https://statamic.dev/modifiers/collapse_whitespace",parameters:[],canBeParameter:!1},{name:"count_substring",acceptsType:["string"],returnsType:["number"],description:"Counts the number of occurrences of a term within the string.",docLink:"https://statamic.dev/modifiers/count_substring",parameters:[{name:"term",description:"The sub-string to search for"}],canBeParameter:!0},{name:"dashify",acceptsType:["string"],returnsType:["string"],description:"Returns a lower-cased and trimmed string, separated by dashes.",docLink:"https://statamic.dev/modifiers/dashify",parameters:[],canBeParameter:!1},{name:"deslugify",acceptsType:["string"],returnsType:["string"],description:"Replaces all hyphens and underscores with spaces.",docLink:"https://statamic.dev/modifiers/deslugify",parameters:[],canBeParameter:!1},{name:"embed_url",acceptsType:["string"],returnsType:["string"],description:"Converts a YouTube or Viemo link into their embed URLs.",docLink:"https://statamic.dev/modifiers/embed_url",parameters:[],canBeParameter:!1},{name:"trackable_embed_url",acceptsType:["string"],returnsType:["string"],description:"Get the embed URL when given a youtube or vimeo link that's direct to the page.",docLink:null,parameters:[],canBeParameter:!1},{name:"ensure_left",acceptsType:["string"],returnsType:["string"],description:"Ensures that the string begins with the specified string.",docLink:"https://statamic.dev/modifiers/ensure_left",parameters:[{name:"start_string",description:"The value that should be at the start of the string."}],canBeParameter:!0},{name:"ensure_right",acceptsType:["string"],returnsType:["string"],description:"Ensures that the string ends with the specified string.",docLink:"https://statamic.dev/modifiers/ensure_right",parameters:[{name:"end_string",description:"The value that should be at the end of the string."}],canBeParameter:!0},{name:"entities",acceptsType:["string"],returnsType:["string"],description:"Encode a string with HTML entities.",docLink:"https://statamic.dev/modifiers/entities",parameters:[],canBeParameter:!1},{name:"excerpt",acceptsType:["string"],returnsType:["string"],description:"Breaks a string at a given marker.",docLink:"https://statamic.dev/modifiers/excerpt",parameters:[{name:"marker",description:"The string to break by."}],canBeParameter:!1},{name:"explode",acceptsType:["string"],returnsType:["array"],description:"Breaks a string into an array of strings.",docLink:"https://statamic.dev/modifiers/explode",parameters:[{name:"delimiter",description:"The string to split the larger string by."}],canBeParameter:!0},{name:"gravatar",acceptsType:["string"],returnsType:["string"],description:"Converts an email string to a Gravatar image URL.",docLink:"https://statamic.dev/modifiers/gravatar",parameters:[{name:"image size",description:"The desired image size."}],canBeParameter:!0},{name:"insert",acceptsType:["string"],returnsType:["string"],description:"Inserts a string at the position provided.",docLink:"https://statamic.dev/modifiers/insert",parameters:[{name:"value",description:"The value to insert."},{name:"position",description:"The zero based position to insert the text at."}],canBeParameter:!0},{name:"is_email",acceptsType:["string"],returnsType:["boolean"],description:"Returns true if the string is a valid email address.",docLink:"https://statamic.dev/modifiers/is_email",parameters:[],canBeParameter:!1},{name:"is_embeddable",acceptsType:["string"],returnsType:["boolean"],description:"Checks to see if a video URL is embeddable.",docLink:"https://statamic.dev/modifiers/is_embeddable",parameters:[],canBeParameter:!1},{name:"is_lowercase",acceptsType:["string"],returnsType:["boolean"],description:"Returns true if the string contains only lowercase characters.",docLink:"https://statamic.dev/modifiers/is_lowercase",parameters:[],canBeParameter:!1},{name:"is_url",acceptsType:["string"],returnsType:["boolean"],description:"Returns true if a string is a valid URL.",docLink:"https://statamic.dev/modifiers/is_url",parameters:[],canBeParameter:!1},{name:"lcfirst",acceptsType:["string"],returnsType:["string"],description:"Converts the first character of the value to lower case.",docLink:"https://statamic.dev/modifiers/lcfirst",parameters:[],canBeParameter:!1},{name:"length",acceptsType:["string"],returnsType:["number"],description:"Returns the number of items in an array or number of characters in a string.",docLink:"https://statamic.dev/modifiers/length",parameters:[],canBeParameter:!1},{name:"lower",acceptsType:["string"],returnsType:["string"],description:"Converts all characters to lowercase.",docLink:"https://statamic.dev/modifiers/lower",parameters:[],canBeParameter:!1},{name:"md5",acceptsType:["string"],returnsType:["string"],description:"Creates an MD5 hash of the variable.",docLink:"https://statamic.dev/modifiers/md5",parameters:[],canBeParameter:!1},{name:"rawurlencode",acceptsType:["string"],returnsType:["string"],description:"URL-encode a variable according to RFC-3986.",docLink:"https://statamic.dev/modifiers/rawurlencode",parameters:[],canBeParameter:!1},{name:"read_time",acceptsType:["string"],returnsType:["string"],description:"Returns an estimated read time, in minutes.",docLink:"https://statamic.dev/modifiers/read_time",parameters:[{name:"words per minute",description:"The words per minute to use as an estimate."}],canBeParameter:!0},{name:"regex_replace",acceptsType:["string"],returnsType:["string"],description:"Replaces all regex matches with a string.",docLink:"https://statamic.dev/modifiers/regex_replace",parameters:[{name:"pattern",description:"The regex pattern."},{name:"replace",description:"The replacement value."}],canBeParameter:!0},{name:"remove_left",acceptsType:["string"],returnsType:["string"],description:"Ensures that the string never begins with a specified string.",docLink:"https://statamic.dev/modifiers/remove_left/",parameters:[{name:"value",description:"The value to remove."}],canBeParameter:!0},{name:"remove_right",acceptsType:["string"],returnsType:["string"],description:"Ensures that a string never ends with a specified string.",docLink:"https://statamic.dev/modifiers/remove_right",parameters:[{name:"value",description:"The value to remove."}],canBeParameter:!0},{name:"replace",acceptsType:["string"],returnsType:["string"],description:"Replaces all occurrences of a string with a different value.",docLink:"https://statamic.dev/modifiers/replace",parameters:[{name:"needle",description:"The string to search for."},{name:"value",description:"The value to replace all occurrences with."}],canBeParameter:!0},{name:"reverse",acceptsType:["string","array"],returnsType:["string","array"],description:"Reverses all characters in a string, or all items in an array.",docLink:"https://statamic.dev/modifiers/reverse",parameters:[],canBeParameter:!1},{name:"safe_truncate",acceptsType:["string"],returnsType:["string"],description:"Truncates a string to a given length.",docLink:"https://statamic.dev/modifiers/safe_truncate",parameters:[{name:"length",description:"The desired string length."},{name:"suffix",description:"An optional suffix to append to the string if truncation occurs."}],canBeParameter:!1},{name:"sanitize",acceptsType:["string"],returnsType:["string"],description:"Converts special characters to HTML entities.",docLink:"https://statamic.dev/modifiers/sanitize",parameters:[],canBeParameter:!1},{name:"segment",acceptsType:["string"],returnsType:["string"],description:"Returns a segment by number from any valid URL or URI.",docLink:"https://statamic.dev/modifiers/segment",parameters:[{name:"segment",description:"The one-based segment to return."}],canBeParameter:!0},{name:"singular",acceptsType:["string"],returnsType:["string"],description:"Returns the singular form of an English word.",docLink:"https://statamic.dev/modifiers/singular",parameters:[],canBeParameter:!1},{name:"slugify",acceptsType:["string"],returnsType:["string"],description:"Converts the string into an URL slug.",docLink:"https://statamic.dev/modifiers/slugify",parameters:[],canBeParameter:!1},{name:"smartypants",acceptsType:["string"],returnsType:["string"],description:"Translates plain ASCII punctuation characters into typographic punctuation HTML entities.",docLink:"https://statamic.dev/modifiers/smartypants",parameters:[],canBeParameter:!1},{name:"spaceless",acceptsType:["string"],returnsType:["string"],description:"Removes excess whitespace and line breaks from a string.",docLink:"https://statamic.dev/modifiers/spaceless",parameters:[],canBeParameter:!1},{name:"substr",acceptsType:["string"],returnsType:["string"],description:"Returns a portion of a string based on provided a start index, and optional length.",docLink:"https://statamic.dev/modifiers/substr",parameters:[{name:"start",description:"The 0-based index to start searching."},{name:"length",description:"An optional length for the string to find."}],canBeParameter:!1},{name:"surround",acceptsType:["string"],returnsType:["string"],description:"Surrounds a string with another string.",docLink:"https://statamic.dev/modifiers/surround",parameters:[{name:"value",description:"The value to surround the string with."}],canBeParameter:!1},{name:"swap_case",acceptsType:["string"],returnsType:["string"],description:"Returns a case swapped version of the string.",docLink:"https://statamic.dev/modifiers/swap_case",parameters:[],canBeParameter:!1},{name:"tidy",acceptsType:["string"],returnsType:["string"],description:"Returns a string with smart quotes, ellipsis characters, and dashes from Windows-1252 replaced by ASCII equivalents.",docLink:"https://statamic.dev/modifiers/tidy",parameters:[],canBeParameter:!1},{name:"title",acceptsType:["string"],returnsType:["string"],description:"Returns a Title Cased version of the string.",docLink:"https://statamic.dev/modifiers/title",parameters:[],canBeParameter:!1},{name:"trim",acceptsType:["string"],returnsType:["string"],description:"Removes whitespace from the start and end of the string.",docLink:"https://statamic.dev/modifiers/trim",parameters:[],canBeParameter:!1},{name:"truncate",acceptsType:["string"],returnsType:["string"],description:"Truncates a string to a given length.",docLink:"https://statamic.dev/modifiers/truncate",parameters:[{name:"length",description:"The maximum string length."},{name:"suffix",description:"An optional suffix to append to the string if truncation occurs."}],canBeParameter:!1},{name:"ucfirst",acceptsType:["string"],returnsType:["string"],description:"Upper cases the first character in the string.",docLink:"https://statamic.dev/modifiers/ucfirst",parameters:[],canBeParameter:!1},{name:"underscored",acceptsType:["string"],returnsType:["string"],description:"Returns a lower-cased and trimmed version of the string, separated by underscores.",docLink:"https://statamic.dev/modifiers/underscored",parameters:[],canBeParameter:!1},{name:"upper",acceptsType:["string"],returnsType:["string"],description:"Transforms the string to uppercase.",docLink:"https://statamic.dev/modifiers/upper",parameters:[],canBeParameter:!1},{name:"urldecode",acceptsType:["string"],returnsType:["string"],description:"URL-decodes the string.",docLink:"https://statamic.dev/modifiers/urldecode",parameters:[],canBeParameter:!1},{name:"urlencode",acceptsType:["string"],returnsType:["string"],description:"URL-encodes the string.",docLink:"https://statamic.dev/modifiers/urlencode",parameters:[],canBeParameter:!1},{name:"widont",acceptsType:["string"],returnsType:["string"],description:"Attempts to prevent lines with single words.",docLink:"https://statamic.dev/modifiers/widont",parameters:[],canBeParameter:!1},{name:"word_count",acceptsType:["string"],returnsType:["number"],description:"Returns the number of words in the string.",docLink:"https://statamic.dev/modifiers/word_count",parameters:[],canBeParameter:!1},{name:"add_slashes",acceptsType:["string"],returnsType:["string"],description:"Adds slashes before characters that need to be escaped.",docLink:"https://statamic.dev/modifiers/add_slashes",canBeParameter:!1,parameters:[]}];var rb=[{name:"console_log",acceptsType:["*"],returnsType:["null"],description:"Displays variable data in the browser's JavaScript console.",docLink:"https://statamic.dev/modifiers/console_log",parameters:[],canBeParameter:!1},{name:"decode",acceptsType:["string"],returnsType:["string"],description:"Converts all HTML entities to their applicable character codes.",docLink:"https://statamic.dev/modifiers/decode",parameters:[],canBeParameter:!1},{name:"dump",acceptsType:["*"],returnsType:["null"],description:"Displays variable data in the browser.",docLink:"https://statamic.dev/modifiers/dump",parameters:[],canBeParameter:!1},{name:"full_urls",acceptsType:["string"],returnsType:["string"],description:"Replaces root-relative URLs with absolute URLs.",docLink:"https://statamic.dev/modifiers/full_urls",parameters:[],canBeParameter:!1},{name:"repeat",acceptsType:["string"],returnsType:["string"],description:"Repeats a value a given number of times.",docLink:"https://statamic.dev/modifiers/repeat",parameters:[{name:"repeat_count",description:"The number of times to repeat the value."}],canBeParameter:!0},{name:"to_spaces",acceptsType:["string"],returnsType:["string"],description:"Converts all tabs to spaces.",docLink:"https://statamic.dev/modifiers/to_spaces",parameters:[{name:"space_count",description:"The number of spaces to replace tabs with."}],canBeParameter:!1},{name:"to_tabs",acceptsType:["string"],returnsType:["string"],description:"Converts spaces to tabs.",docLink:"https://statamic.dev/modifiers/to_tabs",parameters:[{name:"space_count",description:"The number of spaces to convert to tabs."}],canBeParameter:!1},{name:"to_json",acceptsType:["*"],returnsType:["string"],description:"Converts the data to JSON.",docLink:"https://statamic.dev/modifiers/to_json",parameters:[],canBeParameter:!1},{name:"to_bool",acceptsType:["*"],returnsType:["boolean"],description:"Converst the data to a boolean",parameters:[],canBeParameter:!1,docLink:null}];var es=class{constructor(){this.registeredModifiers=new Map;this.acceptTypedModifierReference=new Map;this.returnTypeModifierReference=new Map;this.macros=new Map;this.modifierNameCache=[]}reset(){this.modifierNameCache=[],this.registeredModifiers.clear(),this.acceptTypedModifierReference.clear(),this.returnTypeModifierReference.clear()}getRegisteredModifiers(){return this.registeredModifiers}resetMacros(){this.macros.clear()}loadCoreModifiers(){this.registerModifiers(zy),this.registerModifiers(Xy),this.registerModifiers(Qy),this.registerModifiers(Jy),this.registerModifiers(Zy),this.registerModifiers(eb),this.registerModifiers(rb),this.registerModifiers(nb),this.registerModifiers(tb)}getModifierNames(){return this.modifierNameCache}registerMacro(e){this.macros.set(e.name,e)}registerMacros(e){for(let n=0;n0)for(let r=0;r0?i.valueNodes[0].content:""}if(this.hasParameterModifiers())for(let r=0;r0)for(let r=0;r0?{start:i.startPosition,end:i.endPosition}:null}if(this.hasParameterModifiers())for(let r=0;r0&&this.node.modifierChain.lastManifestedModifier!=null){if(this.node.modifierChain.lastManifestedModifier.parameters.length>0&&this.node.modifierChain.lastManifestedModifier.modifier!=null&&we.instance!=null){let e=this.node.modifierChain.lastManifestedModifier.modifier;return we.instance.getProbableReturnType(e,this.isPaired())}return"*"}if(this.parameterModifiers.length>0){let e=this.parameterModifiers.reverse();for(let n=0;n0&&this.node.modifierChain.lastManifestedModifier!=null)return this.node.modifierChain.lastManifestedModifier.parameters.length>0?this.node.modifierChain.lastManifestedModifier.parameters[0].value:"";if(this.parameterModifiers.length>0){let e=this.parameterModifiers.reverse();for(let n=0;n0&&this.node.modifierChain.lastModifier!=null)return this.node.modifierChain.lastModifier;if(this.parameterModifiers.length>0){let e=this.parameterModifiers.reverse();for(let n=0;n0:!0}hasParameterModifiers(){return this.parameterModifiers.length>0}hasShorthandModifiers(){return this.node.modifierChain!=null&&this.node.modifierChain.modifierChain.length>0}hasModifier(e){return this.modifierNames.includes(e)}};function Qp(t){let e=[];return t.forEach(n=>{n instanceof B?e.push(n):n instanceof vt&&n.logicBranches.length>0&&n.logicBranches.forEach(r=>{if(r.head!=null){let i=r.head;i.originalNode!=null?e.push(i.originalNode):e.push(i)}})}),e}var eE=[" ",` +`,"\r"," ","\f","\v","\xA0","\u2000","\u2001","\u2002","\u2003","\u2004","\u2005","\u2006","\u2007","\u2008","\u2009","\u200A","\u200B","\u2028","\u2029","\u3000"].join("");function ib(t){return(typeof t=="number"||typeof t=="string"&&eE.indexOf(t.slice(-1))===-1)&&t!==""&&!isNaN(t)}var G=class{static normalizeLineEndings(e,n=` `){return e.replace(/\r?\n/g,n)}static breakByNewLine(e){return e.replace(/(\r\n|\n|\r)/gm,` `).split(` -`)}static split(e){return e.split("")}static substring(e,n,r){return e.substr(n,r)}static ctypeSpace(e){return(e==null?void 0:e.search(/^[\f\n\r\t\v ]+$/g))!==-1}static ctypeAlpha(e){return(e==null?void 0:e.search(/^[A-Za-z]+$/g))!==-1}static ctypeDigit(e){return(e==null?void 0:e.search(/^[\d]+$/g))!==-1}static ctypePunct(e){return(e==null?void 0:e.search(/^[\u0021-\u002F\u003A-\u0040\u005B-\u0060\u007B-\u007E]+$/g))!==-1}static trimLeft(e,n="\\s"){return e.replace(new RegExp("^["+n+"]+"),"")}static trimRight(e,n="\\s"){return e.replace(new RegExp("["+n+"]+$"),"")}static isNumeric(e){return ib(e)}static substringCount(e,n){let r=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return(e.match(new RegExp(r,"gi"))||[]).length}static getLastLine(e){let n=G.breakByNewLine(e);return n.length==0?"":n[n.length-1]}static getFirstLine(e){let n=G.breakByNewLine(e);return n.length==0?"":n[0]}};var Qp=class{constructor(e){this.node=e}findParentWithName(e){let n=this.node.getParser();return n==null?null:n.structure.findParentWithName(e,this.node)}};var ob=Q(Vu());var M=class{constructor(){this.node=null;this.errorCode="";this.message="";this.level=0;this.range=null}hash(){var n,r,i,s;let e="";return this.node!=null&&(e=((r=(n=this.node.endPosition)==null?void 0:n.offset)!=null?r:0).toString()+"|"+((s=(i=this.node.startPosition)==null?void 0:i.offset)!=null?s:0).toString()+"|"),ob.Md5.hashStr(e+"|"+this.errorCode)}static makeSyntaxError(e,n,r,i){i==null&&(i=0);let s=new M;return s.errorCode=e,s.node=n,s.message=r,s.level=i,s}};var P=class{};P.TYPE_EXPECTING_OPERAND="ANTLR_001",P.TYPE_UNEXPECTED_END_OF_INPUT="ANTLR_002",P.TYPE_RUNTIME_TYPE_MISMATCH="ANTLR_003",P.TYPE_RUNTIME_DIVIDE_BY_ZERO="ANTLR_004",P.TYPE_RUNTIME_UNKNOWN_LANG_OPERATOR="ANTLR_005",P.TYPE_RUNTIME_UNEXPECTED_STACK_CONDITION="ANTLR_006",P.TYPE_RUNTIME_PARSE_VALUE_VIOLATION="ANTLR_007",P.TYPE_PARSE_UNCLOSED_CONDITIONAL="ANTLR_008",P.TYPE_PARSE_EMPTY_CONDITIONAL="ANTLR_009",P.TYPE_PARSE_UNPAIRED_CONDITIONAL="ANTLR_008",P.TYPE_ILLEGAL_STRING_ESCAPE_SEQUENCE="ANTLR_009",P.TYPE_INCOMPLETE_ANTLERS_REGION="ANTLR_010",P.TYPE_INCOMPLETE_ANTELRS_COMMENT_REGION="ANTLR_011",P.TYPE_ILLEGAL_VARPATH_RIGHT="ANTLR_012",P.TYPE_ILLEGAL_DOTVARPATH_RIGHT="ANTLR_013",P.TYPE_ILLEGAL_VARPATH_SUBPATH_START="ANTLR_014",P.TYPE_ILLEGAL_VARPATH_SPACE_RIGHT="ANTLR_015",P.TYPE_UNEXPECTED_EOI_VARPATH_ACCESSOR="ANTLR_016",P.TYPE_ILLEGAL_VARIABLE_NAME="ANTLR_017",P.TYPE_UNSET_MODIFIER_DETAILS="ANTLR_018",P.TYPE_MODIFIER_NAME_NOT_START_OF_DETAILS="ANTLR_019",P.TYPE_MODIFIER_UNEXPECTED_VALUE="ANTLR_020",P.TYPE_MODIFIER_UNEXPECTED_END_OF_VALUE_LIST="ANTLR_021",P.TYPE_TERNARY_EXPECTING_BRANCH_SEPARATOR="ANTLR_022",P.TYPE_TERNARY_UNEXPECTED_EXPRESSION_LENGTH="ANTLR_023",P.TYPE_RECURSIVE_UNPAIRED_NODE="ANTLR_024",P.TYPE_RECURSIVE_NODE_INVALID_POSITION="ANTLR_025",P.TYPE_NO_PARSE_UNASSOCIATED="ANTLR_026",P.TYPE_RECURSIVE_NODE_UNASSOCIATED_PARENT="ANTLR_027",P.TYPE_LOGIC_GROUP_NO_END="ANTLR_028",P.TYPE_LOGIC_GROUP_NO_START="ANTLR_029",P.TYPE_UNEXPECTED_BRANCH_SEPARATOR="ANTLR_030",P.TYPE_UNEXPECTED_BRANCH_SEPARATOR_FOR_VARCOMBINE="ANTLR_031",P.TYPE_UNEXPECTED_MODIFIER_SEPARATOR="ANTLR_032",P.TYPE_UNEXPECTED_EOI_WHILE_PARSING_MODIFIER_DETAILS="ANTLR_033",P.TYPE_UNEXPECTED_EOI_WHILE_PARSING_MODIFIER_VALUE="ANTLR_034",P.TYPE_UNEXPECTED_EOI_WHILE_PARSING_NODE_PARAMETER="ANTLR_035",P.TYPE_UNEXPECTED_EOI_WHILE_MANIFESTING_ANTLERS_NODE="ANTLR_036",P.TYPE_UNEXPECTED_EOI_WHILE_REDUCING_NEGATION_OPERATORS="ANTLR_037",P.TYPE_UNEXPECTED_EOI_WHILE_PARSING_SEMANTIC_GROUP="ANTLR_038",P.TYPE_UNEXPECTED_EOI_WHILE_PARSING_NULL_COALESCENCE_GROUP="ANTLR_039",P.TYPE_UNEXPECTED_EOI_WHILE_PARSING_TERNARY_GROUP="ANTLR_040",P.TYPE_UNEXPECTED_EOI_WHILE_PARSING_TERNARY_GROUP_FALSE_BRANCH="ANTLR_041",P.TYPE_UNEXPECTED_EOI_WHILE_EXITING_TERNARY_GROUP="ANTLR_042",P.TYPE_UNEXPECTED_EOI_WHILE_PARSING_LOGIC_GROUP_NEGATION_OFFSET="ANTLR_043",P.TYPE_UNEXPECTED_EOI_WHILE_PARSING_LOGIC_GROUP_END_DUE_TO_NEGATION="ANTLR_044",P.TYPE_UNEXPECTED_EOI_WHILE_PARSING_LOGIC_GROUP_END="ANTLR_045",P.TYPE_RUNTIME_UNKNOWN_LIBRARY="ANTLR_046",P.TYPE_RUNTIME_LIBRARY_BAD_METHOD_CALL="ANTLR_047",P.TYPE_UNEXPECTED_FACTORIAL_WHILE_CREATING_GROUPS="ANTLR_048",P.TYPE_UNEXPECTED_FACTORIAL_OPERAND="ANTLR_049",P.TYPE_UNEXPECTED_LOGIC_NEGATION_OPERATOR="ANTLR_050",P.TYPE_FACTORIAL_MATERIALIZED_BOOL_DETECTED="ANTLR_051",P.TYPE_ARG_UNEXPECTED_NAMED_ARGUMENT="ANTLR_052",P.TYPE_UNEXPECTED_EOI_PARSING_BRANCH_GROUP="ANTLR_053",P.TYPE_UNEXPECTED_UNNAMED_METHOD_ARGUMENT="ANTLR_054",P.TYPE_LIBRARY_CALL_NO_ARGS_PROVIDED="ANTLR_055",P.TYPE_LIBRARY_CALL_MISSING_REQUIRED_FORMAL_ARG="ANTLR_056",P.TYPE_LIBRARY_CALL_RUNTIME_TYPE_MISMATCH="ANTLR_057",P.TYPE_LIBRARY_CALL_UNEXPECTED_ARG_RESOLVE_FAULT="ANTLR_058",P.TYPE_LIBRARY_CALL_TOO_MANY_ARGUMENTS="ANTLR_059",P.TYPE_UNEXPECTED_TOKEN_WHILE_PARSING_METHOD="ANTLR_060",P.TYPE_INVALID_NAMED_ARG_IDENTIFIER="ANTLR_061",P.TYPE_LIBRARY_CALL_INVALID_ARGUMENT_NAME="ANTLR_062",P.TYPE_RUNTIME_ATTEMPT_TO_OVERWRITE_LOADED_LIBRARY="ANTLR_063",P.TYPE_UNEXPECTED_EOI_WHILE_PARSING_ARG_GROUP="ANTLR_064",P.TYPE_EXPECTING_ARGUMENT_GROUP="ANTLR_065",P.TYPE_RUNTIME_PROTECTED_LIBRARY_ACCESS_VIOLATION="ANTLR_066",P.TYPE_RUNTIME_FATAL_UNPAIRED_LOOP_END="ANTLR_067",P.TYPE_UNEXPECTED_OPERATOR="ANTLR_068",P.TYPE_OPERATOR_INVALID_ON_RIGHT="ANTLR_069",P.TYPE_INVALID_ASSIGNMENT_LOOP_PAIR="ANTLR_070",P.TYPE_UNEXPECTED_EOI_PARSING_ORDER_GROUP="ANTLR_071",P.TYPE_EXPECTING_ORDER_GROUP_FOR_ORDER_BY_OPERAND="ANTLR_072",P.TYPE_QUERY_UNSUPPORTED_VALUE_TYPE="ANTLR_073",P.TYPE_UNEXPECTED_RUNTIME_RESULT_FOR_ORDER_BY_CLAUSE="ANTLR_074",P.TYPE_UNEXPECTED_EMPTY_DIRECTION_GROUP="ANTLR_075",P.TYPE_INVALID_ORDER_BY_NAME_VALUE="ANTLR_076",P.TYPE_INVALID_ORDER_BY_SORT_VALUE="ANTLR_077",P.TYPE_UNEXPECTED_TOKEN_FOR_GROUP_BY="ANTLR_78",P.TYPE_UNEXPECTED_EOI_WHILE_PARSING_GROUP_BY="ANTLR_079",P.TYPE_UNEXPECTED_GROUP_BY_AS_ALIAS_TYPE="ANTLR_080",P.TYPE_UNEXPECTED_EOI_WHILE_PARSING_SWITCH_GROUP="ANTLR_081",P.TYPE_UNEXPECTED_TOKEN_FOR_SWITCH_GROUP="ANTLR_082",P.TYPE_UNEXPECTED_SWITCH_START_VALUE="ANTLR_083",P.TYPE_UNEXPECTED_SWITCH_START_VALUE_NO_VALUE="ANTLR_084",P.TYPE_UNEXPECTED_SWITCH_START_VALUE_NO_SEMANTIC_VALUE="ANTLR_085",P.TYPE_SWITCH_DEFAULT_MUST_BE_LAST="ANTLR_086",P.TYPE_PARSER_INVALID_SWITCH_TOKEN="ANTLR_087",P.TYPE_ORDER_BY_INVALID_RETURN_TYPE="ANTLR_088",P.TYPE_GROUP_BY_SCOPED_GROUP_MUST_BE_ENCLOSED="ANTLR_089",P.TYPE_PLUCK_INTO_MISSING_VARIABLE_TARGET="ANTLR_090",P.TYPE_PLUCK_INTO_INVALID_VARIABLE_TARGET="ANTLR_091",P.TYPE_PLUCK_INTO_NO_PREDICATE="ANTLR_092",P.TYPE_PLUCK_INTO_INVALID_PREDICATE_VALUE="ANTLR_093",P.TYPE_PLUCK_INTO_EMPTY_LOGIC_GROUP="ANTLR_094",P.TYPE_PLUCK_INTO_INVALID_NUMBER_OF_TUPLE_VARIABLES="ANTLR_095",P.TYPE_PLUCK_INTO_UNKNOWN_ALIAS_VARNAME="ANTLR_096",P.TYPE_PLUCK_INTO_UNEXPECTED_EMPTY_T_LOGIC_GROUP="ANTLR_097",P.TYPE_PLUCK_INTO_REFERENCE_TYPE_DYNAMIC="ANTLR_098",P.TYPE_PLUCK_INTO_REFERENCE_AMBIGUOUS="ANTLR_099",P.TYPE_RUNTIME_ASSIGNMENT_TO_NON_VAR="ANTLR_100",P.TYPE_ARR_MAKE_MISSING_TARGET="ANTLR_101",P.TYPE_ARR_MAKE_UNEXPECTED_TYPE="ANTLR_102",P.TYPE_ARR_MAKE_MISSING_ARR_KEY_PAIR_VALUE="ANTLR_103",P.TYPE_ARR_KEY_PAIR_INVALID_KEY_TYPE="ANTLR_104",P.TYPE_ARR_UNEXPECT_ARG_SEPARATOR="ANTLR_105",P.TYPE_ARR_KEY_PAIR_MISSING_KEY="ANTLR_106",P.RUNTIME_PROTECTED_VAR_ACCESS="ANTLR_107",P.RUNTIME_PROTECTED_TAG_ACCESS="ANTLR_108",P.RUNTIME_PROTECTED_MODIFIER_ACCESS="ANTLR_109",P.TYPE_INCOMPLETE_PHP_EVALUATION_REGION="ANTLR_110",P.RUNTIME_PHP_NODE_WHEN_PHP_DISABLED="ANTLR_111",P.RUNTIME_PHP_NODE_USER_CONTENT_TAG="ANTLR_112",P.TYPE_UNEXPECTED_TYPE_FOR_TUPLE_LIST="ANTLR_113",P.TYPE_UNEXPECTED_EOI_PARSING_TUPLE_LIST="ANTLR_114",P.TYPE_MISSING_BODY_TUPLE_LIST="ANTLR_115",P.TYPE_MISSING_NAMES_TUPLE_LIST="ANTLR_116",P.TYPE_VALUE_NAME_LENGTH_MISMATCH_TUPLE_LIST="ANTLR_117",P.TYPE_INVALID_TUPLE_LIST_NAME_TYPE="ANTLR_118",P.TYPE_INVALID_MANIFESTED_NAME_GROUP="ANTLR_119",P.TYPE_INVALID_TUPLE_LIST_VALUE_TYPE_GROUP="ANTLR_120",P.TYPE_INVALID_TUPLE_LIST_VALUE_TYPE="ANTLR_121",P.TYPE_RUNTIME_BAD_METHOD_CALL="ANTLR_122",P.TYPE_METHOD_CALL_MISSING_ARG_GROUP="ANTLR_123",P.TYPE_INVALID_METHOD_CALL_ARG_GROUP="ANTLR_124",P.TYPE_METHOD_CALL_MISSING_METHOD="ANTLR_125",P.TYPE_MODIFIER_NOT_FOUND="ANTLR_126",P.TYPE_RUNTIME_GENERAL_FAULT="ANTLR_127",P.TYPE_MODIFIER_INCORRECT_VALUE_POSITION="ANTLR_128",P.TYPE_MODIFIER_UNEXPECTED_TOKEN_METHOD_SYNTAX="ANTLR_129",P.TYPE_RUNTIME_ATTEMPTING_TO_RENDER_OBJECT_AS_STRING="ANTLR_130",P.TYPE_UNPAIRED_CLOSING_TAG="ANTLR_131",P.PARSER_CANNOT_PARSE_PATH_RECURSIVE="ANTLR_200",P.PATH_STRING_NOT_INSIDE_ARRAY_ACCESSOR="ANTLR_201",P.LINT_UNKNOWN_PARAMETER="ANTLR_500",P.LINT_GENERAL_INVALID_PARAMETER_CONTENTS="ANTLR_501",P.LINT_PARAMETER_CONTENT_INVALID_INTEGER="ANTLR_502",P.LINT_PARAMETER_CONTENT_INVALID_BOOLEAN="ANT LR_503",P.LINT_PAGINATE_INVALID_VALUE="ANTLR_504",P.LINT_DEBUG_DATA_EXPOSED="ANTLR_505",P.LINT_DOUBLE_COLON_IN_TAG_IDENTIFIER="ANTLR_506",P.LINT_MIXED_MODIFIERS="ANTLR_507",P.LINT_MODIFIER_UNEXPECTED_TYPE="ANTLR_508",P.LINT_REMOVE_RELATE_TAG="ANTLR_509",P.LINT_SET_PRODUCES_RUNTIME_ERROR="ANTLR_510",P.LINT_FRONT_MATTER_EMPTY_DOCUMENT="ANTLR_511",P.LINT_SHORTHAND_MODIFIER_TAG_MUST_MATCH="ANTLR_512",P.LINT_INVALID_FRONT_MATTER="ANTLR_513",P.LINT_DUPLICATE_CODE="ANTLR_514",P.LINT_VERSION_NOT_COMPATIBLE="ANTLR_515",P.LINT_INTERLEAVED_TAG_PAIRS="ANTLR_516",P.LINT_MISSING_REQUIRED_PARAMETER="ANTLR_517",P.LINT_POSSIBLE_PARTIAL_RECURSION="ANTLR_518";var nt=class{static distance(e,n){return e.endPosition==null||n.startPosition==null?this.DistMax:n.startPosition.index-e.endPosition.index}static getTrueName(e){var n,r,i,s;return e.originalNode!=null?(r=(n=e.originalNode.name)==null?void 0:n.name)!=null?r:"":(s=(i=e.name)==null?void 0:i.name)!=null?s:""}static getSimpleVarName(e){return e.variableReference!=null&&e.variableReference.pathParts.length==1&&e.variableReference.pathParts[0]instanceof Un?e.variableReference.pathParts[0].name:""}static isVariableMatching(e,n){return e instanceof oe?e.name==n:!1}static mergeVarContentLeft(e,n,r){return r.mergeRefName=r.name,r.endPosition=n.endPosition,r.name=r.name+e,r}static mergeVarContentRight(e,n,r){return r.mergeRefName=r.name,r.startPosition=n.startPosition,r.name=e+r.name,r}static mergeVarRight(e,n){return n.mergeRefName=n.name,n.startPosition=e.startPosition,n.name=e.name+n.name,n}static getUnrefName(e){return G.trimLeft(e,":.")}};nt.DistMax=65e3;var or=class{static isConditionalStructure(e){var r,i;if(e.isComment)return!1;let n=(i=(r=e.name)==null?void 0:r.name)!=null?i:"";return n=="if"||n=="elseif"||n=="else"}static requiresClose(e){var r,i;let n=(i=(r=e.name)==null?void 0:r.name)!=null?i:"";return n=="elseif"||n=="else"?e.isClosedBy==null:!(e.isClosingTag||e.isClosedBy!=null)}static getValidClosingPairs(e){return e=="if"||e=="elseif"?or.conditionClosingPairs:[]}static findClosestStructurePair(e,n,r){var u,c,f,m,d,p,_,C;let i=[],s=e.length,o=new Map,a=null;i.push({node:n,index:r});for(let h=0;h0;){let h=i.pop();if(h==null)continue;if(h.node._conditionParserAbandonPairing)break;let b=h.node,g=or.getValidClosingPairs((m=(f=b.name)==null?void 0:f.name)!=null?m:""),N=h.index,S=!1;if(l>50&&a!=null){for(let[V,O]of o)if(V>N){N=V;break}}for(let V=N;V{var r,i;if(n instanceof B&&or.isConditionalStructure(n)){let s=(i=(r=n.name)==null?void 0:r.name)!=null?i:"";if((s=="elseif"||s=="else")&&n.isOpenedBy==null){n.pushError(M.makeSyntaxError(P.TYPE_PARSE_UNPAIRED_CONDITIONAL,n,'Unpaired "'+nt.getTrueName(n)+'" control structure.'));return}if(n.isClosedBy==null&&or.requiresClose(n)){n.pushError(M.makeSyntaxError(P.TYPE_PARSE_UNCLOSED_CONDITIONAL,n,"Unclosed "+nt.getTrueName(n)+" control structure."));return}}}),e}},$t=or;$t.conditionClosingPairs=["elseif","else"];function ar(t,e){return e==null&&(e="s"),t.replace(new RegExp("^["+e+"]+"),"")}function Pt(t,e,n){return t.replace(new RegExp(e,"g"),n)}function Er(t,e){return e==null&&(e="s"),t.replace(new RegExp("["+e+"]+$"),"")}function ko(){return(Date.now().toString(32)+Math.random().toString(16)).replace(/\./g,"")}function ab(){return Pt(ko(),"-","_")}var qu=class{constructor(){this.startPosition=null;this.endPosition=null;this.index=0;this.embeddedIndex=0;this.refId=null;this.parameters=[];this.isSelfClosing=!1;this.isClosingFragment=!1;this.name="";this.containsStructures=!1;this.refId=ab()}},Zp=class{constructor(){this.startPosition=null;this.endPosition=null}};function Z0(t){let e=[],n=[];for(let r=0;r{n.node==null&&(n.node=this),this.antlersErrors.push(n)})}getErrors(){return this.antlersErrors}innerContent(){return this.content}rawContent(){return this.content}},ed=class extends J{constructor(){super(...arguments);this.head=null;this.tail=null;this.nodes=[];this.documentText="";this.childDocument=null}getImmediateChildren(){return this.head==null?[]:this.head.getImmediateChildren()}},vt=class extends J{constructor(){super(...arguments);this.logicBranches=[];this.chain=[];this.nodeContent="";this.fragment=null;this.fragmentPosition=3;this.containsAnyFragments=!1;this.containsChildStructures=!1}},B=class extends J{constructor(){super(...arguments);this.isNodeAbanonded=!1;this.isComment=!1;this.isTagNode=!1;this.isConditionNode=!1;this.runtimeContent="";this.name=null;this.pathReference=null;this.isClosingTag=!1;this.isInterpolationNode=!1;this.isOpenedBy=null;this.isClosedBy=null;this.isSelfClosing=!1;this.children=[];this.runtimeNodes=[];this.parsedRuntimeNodes=[];this.hasParsedRuntimeNodes=!1;this.parameters=[];this.hasParameters=!1;this.contentOffset=null;this.cachedContent=null;this.cachedInnerContent=null;this.hasRecursiveNode=!1;this.recursiveReference=null;this.rawStart="";this.rawEnd="";this.originalNode=null;this.interpolationRegions=new Map;this.processedInterpolationRegions=new Map;this.hasProcessedInterpolationRegions=!1;this.ref=0;this.contentStartRelativeIndex=null;this.antlersNodeIndex=0;this.nameStartsOn=null;this.nameEndsOn=null;this.nameMethodPartStartsOn=null;this.documentText="";this.nodeContent="";this.childDocument=null;this.structure=new Qp(this);this.isInlineAntlers=!1;this.mustClose=!1;this.reference=null;this._conditionParserAbandonPairing=!1;this._isEndVirtual=!1}getOriginalContent(){return this.startPosition==null||this.endPosition==null||this.parser==null?"":this.isClosedBy!=null?this.isClosedBy.startPosition==null||this.isClosedBy.endPosition==null?"":this.parser.getText(this.startPosition.index,this.isClosedBy.endPosition.index+1):this.parser.getText(this.startPosition.index,this.endPosition.index+1)}getNodeDocumentText(){return this.startPosition==null||this.endPosition==null||this.parser==null?"":this.parser.getText(this.startPosition.index,this.endPosition.index+1)}getImmediateChildren(){let e=[];for(let n=0;n0){let o=0,a=this.parameters[0];a.startPosition!=null&&(o=a.startPosition.index-1);let l=e,u=l.trimLeft(),c=l.length-u.length,f=n;e=e.substr(0,o)}let r=e.trimLeft(),i=e.length-r.length,s=n+i+2;if(this.parser!=null){let o=0;this.startPosition!=null&&(o=this.startPosition.offset),this.contentOffset==this.parser.positionFromOffset(o+s,0)}this.name!=null?this.name.name=="if"||this.name.name=="elseif"||this.name.name=="unless"||this.name.name=="elseunless"?(e=" "+e.trimLeft(),this.cachedContent=e.substr(this.name.compound.length+1)):this.cachedContent=e:this.cachedContent=e}else if(this.parameters.length>0){let e=this.parameters[0],n=0;e.startPosition!=null&&(n=e.startPosition.index-1),this.contentOffset=this.startPosition,this.cachedContent=this.content.substr(0,n)}else this.contentOffset=this.startPosition,this.cachedContent=this.content;return this.cachedContent}relativePositionFromOffset(e,n){var r,i;return this.parser==null?null:this.parser.positionFromOffset(((i=(r=this.contentOffset)==null?void 0:r.offset)!=null?i:0)+e,n)}getInterpolationNode(e){if(this.processedInterpolationRegions.has(e)){let n=this.processedInterpolationRegions.get(e);if(n.length>0&&n[0]instanceof B)return n[0]}return null}_lexerRelativeOffset(e,n=null){var o,a;let r=e;if(n!=null&&(r=n),this.parser==null){let l=new qt;return l.index=e,l.offset=e,l}let i=e+this.rawStart.length+((a=(o=this.startPosition)==null?void 0:o.index)!=null?a:0);return this.isTagNode&&this.nameStartsOn!=null&&(i=this.nameStartsOn.index+e,$t.isConditionalStructure(this)||(i-=this.rawStart.length)),this.parser.positionFromOffset(i,i,!0)}relativeOffset(e,n=null){var o,a;let r=e;if(n!=null&&(r=n),this.parser==null){let l=new qt;return l.index=e,l.offset=e,l}let i=e+this.rawStart.length+((a=(o=this.startPosition)==null?void 0:o.index)!=null?a:0);return this.parser.positionFromOffset(i,i,!0)}isPaired(){return this.isClosingTag&&this.isSelfClosing==!1&&this.isOpenedBy!=null?!0:!(this.isClosedBy==null||this.isSelfClosing)}getFinalClosingTag(){return this.isClosedBy==null?this:this.isClosedBy.getFinalClosingTag()}rawContent(){return this.rawStart+this.content+this.rawEnd}getTrueRuntimeNodes(){return this.originalNode!=null&&this.originalNode!=this?this.originalNode.getTrueRuntimeNodes():this.runtimeNodes}getTrueRawContent(){return this.originalNode!=null&&this.originalNode!=this?this.originalNode.getTrueRawContent():this.rawContent()}getTrueNode(){return this.originalNode!=null&&this.originalNode!=this?this.originalNode.getTrueNode():this}getStructuralChildren(){return this.isClosedBy!=null?Xp(this.children.slice(0,-1)):Xp(this.children)}findParentOfType(e){return this.parent==null?null:this.parent instanceof B?this.parent.name!=null&&e.includes(this.parent.getTagName())?this.parent:this.parent.findParentOfType(e):null}},Gn=class extends B{static makeWithStartPosition(e){let n=new Gn;return n.startPosition=e,n.endPosition=e,n}},ft=class extends Gn{},lr=class extends B{constructor(){super(...arguments);this.recursiveParent=null;this.isNestedRecursive=!1}},Fs=class extends B{constructor(){super(...arguments);this.isEchoNode=!1}},ol=class extends Gn{},td=class extends Gn{},rn=class extends B{constructor(){super(...arguments);this.isNoParseRegion=!1}},Vs=class extends J{constructor(){super(...arguments);this.modifier=null;this.isModifierParameter=!1;this.nameDelimiter='"';this.isVariableReference=!1;this.name="";this.value="";this.interpolations=[];this.parent=null;this.blockPosition=null;this.namePosition=null;this.valuePosition=null}containsSimpleValue(){return this.hasInterpolations()==!1&&this.isVariableReference==!1}hasInterpolations(){return this.interpolations.length>0}getArrayValue(){return this.value.split("|")}getValue(){return this.value}},al=class{constructor(){this.modifierTarget=null;this.modifierChain=[];this.startPosition=null;this.endPosition=null;this.lastManifestedModifier=null;this.lastModifier=null}updateValues(){if(this.modifierChain.length==0)this.startPosition=null,this.endPosition=null;else{let e=this.modifierChain[0],n=this.modifierChain[this.modifierChain.length-1];this.startPosition=e.startPosition,this.endPosition=n.endPosition}}},Mo=class extends J{constructor(){super(...arguments);this.modifier=null;this.methodStyleArguments=null;this.nameNode=null;this.name="";this.valueNodes=[];this.parameters=[]}getParameterValues(){let e=[];return this.parameters.forEach(n=>{e.push(n.value)}),e}},ll=class extends J{constructor(){super(...arguments);this.order=0;this.name=null;this.directionNode=null}},nd=class extends J{constructor(){super(...arguments);this.value=""}},wr=class extends J{},ur=class extends J{},Or=class extends J{},Wn=class extends J{},Hn=class extends J{},oi=class extends J{},ts=class extends J{constructor(){super(...arguments);this.repeat=1}},ai=class extends J{},Yn=class extends J{},Tn=class extends J{},Lr=class extends J{},Dr=class extends J{},Kn=class extends J{},kr=class extends J{},Mr=class extends J{},li=class extends J{},Nn=class extends J{},cr=class extends J{},Ei=class extends J{},Fr=class extends J{},Vr=class extends J{},qr=class extends J{},Br=class extends J{},jr=class extends J{},Ur=class extends J{},wi=class extends J{},Gr=class extends J{},sn=class extends J{},qs=class extends J{constructor(){super(...arguments);this.orderClauses=[]}},It=class extends J{},vn=class extends J{},ul=class extends J{constructor(){super(...arguments);this.left=null;this.right=null}},Pn=class extends J{constructor(){super(...arguments);this.isTenaryBranchSeparator=!1}},Wr=class extends J{},fr=class extends J{},on=class extends J{},Hr=class extends J{},ui=class extends J{},pr=class extends J{},In=class extends J{},ci=class extends J{},Bt=class extends J{},zt=class extends J{},Fo=class extends J{constructor(){super(...arguments);this.values=[];this.isNamedNode=!1;this.parsedName=null}},De=class extends J{constructor(){super(...arguments);this.start=null;this.end=null;this.nodes=[];this.scopeOperator=null}},Vo=class extends J{constructor(){super(...arguments);this.condition=null;this.expression=null}},Bs=class extends J{constructor(){super(...arguments);this.cases=[]}},rd=class extends J{constructor(){super(...arguments);this.left=null;this.right=null}},Oi=class extends J{constructor(){super(...arguments);this.nodes=[]}},cl=class extends J{constructor(){super(...arguments);this.head=null;this.truthBranch=null;this.falseBranch=null}},Ct=class extends J{},Ot=class extends J{constructor(){super(...arguments);this.nodes=[];this.separatorToken=null}},dr=class extends De{constructor(){super(...arguments);this.scope=null}extract(){let e=null;this.scope!=null&&(e=this.scope.name);let n=this.nodes[0];return[e,n.nodes]}},Li=class extends dr{constructor(){super(...arguments);this.alias=null}},qo=class extends J{constructor(){super(...arguments);this.args=[];this.hasNamedArguments=!1;this.numberOfNamedArguments=0}},Yr=class extends J{},id=class extends J{};var ns=class extends J{constructor(){super(...arguments);this.libraryName="";this.methodName="";this.arguments=null}},Qe=class extends J{constructor(){super(...arguments);this.sourceContent=""}},Xt=class extends J{constructor(){super(...arguments);this.method=null;this.args=null}},jt=class extends J{constructor(){super(...arguments);this.name=""}},Ut=class extends J{constructor(){super(...arguments);this.value="";this.name=""}},Bu=class extends J{constructor(){super(...arguments);this.name=null;this.value=null}},fl=class extends J{constructor(){super(...arguments);this.name=null;this.value=null}},Lt=class extends J{constructor(){super(...arguments);this.value=null}},bt=class extends J{constructor(){super(...arguments);this.value="";this.sourceTerminator="";this.sourceContent=""}},oe=class extends J{constructor(){super(...arguments);this.name="";this.mergeRefName="";this.variableReference=null;this.interpolationNodes=[];this.isInterpolationReference=!1}},sd=class extends J{constructor(){super(...arguments);this.name=""}},Un=class extends J{constructor(){super(...arguments);this.delimiter="";this.name="";this.isStringVar=!1;this.isFinal=!1}},rs=class{constructor(){this.originalContent="";this.normalizedReference="";this.isStrictTagReference=!1;this.isStrictVariableReference=!1;this.isExplicitVariableReference=!1;this.isVariableVariable=!1;this.pathParts=[];this.isFinal=!1;this._isFromEmptyFailState=!1}clone(){let e=new rs;return e.originalContent=this.originalContent,e.normalizedReference=this.normalizedReference,e.isStrictVariableReference=this.isStrictVariableReference,e.isExplicitVariableReference=this.isExplicitVariableReference,e.pathParts=this.pathParts,e.isFinal=this.isFinal,e}implodePaths(){let e=[];return this.pathParts.forEach(n=>{n instanceof Un?e.push(n.name):n instanceof rs&&e.push(n.implodePaths())}),e.join(".")}},od=class{constructor(e,n,r){this.target=e,this.value=n,this.operator=r}};var HN=Q(nn());var Bo=Q(ot());function ad(t,e){let n=[];if(t.currentNode==null)return n;let r={start:{line:t.position.line,character:t.position.character-0},end:t.position};for(let i=0;i0&&(n=e.join(", ")),"**"+t+"** `"+n+"` \n"}function ju(t){let e=eE(t.name,t.acceptsType),n="";if(t.parameters.length>0){let s=[];t.parameters.forEach(o=>{s.push("$"+o.name)}),n=s.join(", ")}let r="";if(t.returnsType.length==1)r=t.returnsType[0];else{let s=[];t.returnsType.forEach(o=>{s.push(o)}),r=s.join(", ")}return e+=t.description+` +`)}static split(e){return e.split("")}static substring(e,n,r){return e.substr(n,r)}static ctypeSpace(e){return(e==null?void 0:e.search(/^[\f\n\r\t\v ]+$/g))!==-1}static ctypeAlpha(e){return(e==null?void 0:e.search(/^[A-Za-z]+$/g))!==-1}static ctypeDigit(e){return(e==null?void 0:e.search(/^[\d]+$/g))!==-1}static ctypePunct(e){return(e==null?void 0:e.search(/^[\u0021-\u002F\u003A-\u0040\u005B-\u0060\u007B-\u007E]+$/g))!==-1}static trimLeft(e,n="\\s"){return e.replace(new RegExp("^["+n+"]+"),"")}static trimRight(e,n="\\s"){return e.replace(new RegExp("["+n+"]+$"),"")}static isNumeric(e){return ib(e)}static substringCount(e,n){let r=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return(e.match(new RegExp(r,"gi"))||[]).length}static getLastLine(e){let n=G.breakByNewLine(e);return n.length==0?"":n[n.length-1]}static getFirstLine(e){let n=G.breakByNewLine(e);return n.length==0?"":n[0]}};var Jp=class{constructor(e){this.node=e}findParentWithName(e){let n=this.node.getParser();return n==null?null:n.structure.findParentWithName(e,this.node)}};var ob=Q(qu());var M=class{constructor(){this.node=null;this.errorCode="";this.message="";this.level=0;this.range=null}hash(){var n,r,i,s;let e="";return this.node!=null&&(e=((r=(n=this.node.endPosition)==null?void 0:n.offset)!=null?r:0).toString()+"|"+((s=(i=this.node.startPosition)==null?void 0:i.offset)!=null?s:0).toString()+"|"),ob.Md5.hashStr(e+"|"+this.errorCode)}static makeSyntaxError(e,n,r,i){i==null&&(i=0);let s=new M;return s.errorCode=e,s.node=n,s.message=r,s.level=i,s}};var v=class{};v.TYPE_EXPECTING_OPERAND="ANTLR_001",v.TYPE_UNEXPECTED_END_OF_INPUT="ANTLR_002",v.TYPE_RUNTIME_TYPE_MISMATCH="ANTLR_003",v.TYPE_RUNTIME_DIVIDE_BY_ZERO="ANTLR_004",v.TYPE_RUNTIME_UNKNOWN_LANG_OPERATOR="ANTLR_005",v.TYPE_RUNTIME_UNEXPECTED_STACK_CONDITION="ANTLR_006",v.TYPE_RUNTIME_PARSE_VALUE_VIOLATION="ANTLR_007",v.TYPE_PARSE_UNCLOSED_CONDITIONAL="ANTLR_008",v.TYPE_PARSE_EMPTY_CONDITIONAL="ANTLR_009",v.TYPE_PARSE_UNPAIRED_CONDITIONAL="ANTLR_008",v.TYPE_ILLEGAL_STRING_ESCAPE_SEQUENCE="ANTLR_009",v.TYPE_INCOMPLETE_ANTLERS_REGION="ANTLR_010",v.TYPE_INCOMPLETE_ANTELRS_COMMENT_REGION="ANTLR_011",v.TYPE_ILLEGAL_VARPATH_RIGHT="ANTLR_012",v.TYPE_ILLEGAL_DOTVARPATH_RIGHT="ANTLR_013",v.TYPE_ILLEGAL_VARPATH_SUBPATH_START="ANTLR_014",v.TYPE_ILLEGAL_VARPATH_SPACE_RIGHT="ANTLR_015",v.TYPE_UNEXPECTED_EOI_VARPATH_ACCESSOR="ANTLR_016",v.TYPE_ILLEGAL_VARIABLE_NAME="ANTLR_017",v.TYPE_UNSET_MODIFIER_DETAILS="ANTLR_018",v.TYPE_MODIFIER_NAME_NOT_START_OF_DETAILS="ANTLR_019",v.TYPE_MODIFIER_UNEXPECTED_VALUE="ANTLR_020",v.TYPE_MODIFIER_UNEXPECTED_END_OF_VALUE_LIST="ANTLR_021",v.TYPE_TERNARY_EXPECTING_BRANCH_SEPARATOR="ANTLR_022",v.TYPE_TERNARY_UNEXPECTED_EXPRESSION_LENGTH="ANTLR_023",v.TYPE_RECURSIVE_UNPAIRED_NODE="ANTLR_024",v.TYPE_RECURSIVE_NODE_INVALID_POSITION="ANTLR_025",v.TYPE_NO_PARSE_UNASSOCIATED="ANTLR_026",v.TYPE_RECURSIVE_NODE_UNASSOCIATED_PARENT="ANTLR_027",v.TYPE_LOGIC_GROUP_NO_END="ANTLR_028",v.TYPE_LOGIC_GROUP_NO_START="ANTLR_029",v.TYPE_UNEXPECTED_BRANCH_SEPARATOR="ANTLR_030",v.TYPE_UNEXPECTED_BRANCH_SEPARATOR_FOR_VARCOMBINE="ANTLR_031",v.TYPE_UNEXPECTED_MODIFIER_SEPARATOR="ANTLR_032",v.TYPE_UNEXPECTED_EOI_WHILE_PARSING_MODIFIER_DETAILS="ANTLR_033",v.TYPE_UNEXPECTED_EOI_WHILE_PARSING_MODIFIER_VALUE="ANTLR_034",v.TYPE_UNEXPECTED_EOI_WHILE_PARSING_NODE_PARAMETER="ANTLR_035",v.TYPE_UNEXPECTED_EOI_WHILE_MANIFESTING_ANTLERS_NODE="ANTLR_036",v.TYPE_UNEXPECTED_EOI_WHILE_REDUCING_NEGATION_OPERATORS="ANTLR_037",v.TYPE_UNEXPECTED_EOI_WHILE_PARSING_SEMANTIC_GROUP="ANTLR_038",v.TYPE_UNEXPECTED_EOI_WHILE_PARSING_NULL_COALESCENCE_GROUP="ANTLR_039",v.TYPE_UNEXPECTED_EOI_WHILE_PARSING_TERNARY_GROUP="ANTLR_040",v.TYPE_UNEXPECTED_EOI_WHILE_PARSING_TERNARY_GROUP_FALSE_BRANCH="ANTLR_041",v.TYPE_UNEXPECTED_EOI_WHILE_EXITING_TERNARY_GROUP="ANTLR_042",v.TYPE_UNEXPECTED_EOI_WHILE_PARSING_LOGIC_GROUP_NEGATION_OFFSET="ANTLR_043",v.TYPE_UNEXPECTED_EOI_WHILE_PARSING_LOGIC_GROUP_END_DUE_TO_NEGATION="ANTLR_044",v.TYPE_UNEXPECTED_EOI_WHILE_PARSING_LOGIC_GROUP_END="ANTLR_045",v.TYPE_RUNTIME_UNKNOWN_LIBRARY="ANTLR_046",v.TYPE_RUNTIME_LIBRARY_BAD_METHOD_CALL="ANTLR_047",v.TYPE_UNEXPECTED_FACTORIAL_WHILE_CREATING_GROUPS="ANTLR_048",v.TYPE_UNEXPECTED_FACTORIAL_OPERAND="ANTLR_049",v.TYPE_UNEXPECTED_LOGIC_NEGATION_OPERATOR="ANTLR_050",v.TYPE_FACTORIAL_MATERIALIZED_BOOL_DETECTED="ANTLR_051",v.TYPE_ARG_UNEXPECTED_NAMED_ARGUMENT="ANTLR_052",v.TYPE_UNEXPECTED_EOI_PARSING_BRANCH_GROUP="ANTLR_053",v.TYPE_UNEXPECTED_UNNAMED_METHOD_ARGUMENT="ANTLR_054",v.TYPE_LIBRARY_CALL_NO_ARGS_PROVIDED="ANTLR_055",v.TYPE_LIBRARY_CALL_MISSING_REQUIRED_FORMAL_ARG="ANTLR_056",v.TYPE_LIBRARY_CALL_RUNTIME_TYPE_MISMATCH="ANTLR_057",v.TYPE_LIBRARY_CALL_UNEXPECTED_ARG_RESOLVE_FAULT="ANTLR_058",v.TYPE_LIBRARY_CALL_TOO_MANY_ARGUMENTS="ANTLR_059",v.TYPE_UNEXPECTED_TOKEN_WHILE_PARSING_METHOD="ANTLR_060",v.TYPE_INVALID_NAMED_ARG_IDENTIFIER="ANTLR_061",v.TYPE_LIBRARY_CALL_INVALID_ARGUMENT_NAME="ANTLR_062",v.TYPE_RUNTIME_ATTEMPT_TO_OVERWRITE_LOADED_LIBRARY="ANTLR_063",v.TYPE_UNEXPECTED_EOI_WHILE_PARSING_ARG_GROUP="ANTLR_064",v.TYPE_EXPECTING_ARGUMENT_GROUP="ANTLR_065",v.TYPE_RUNTIME_PROTECTED_LIBRARY_ACCESS_VIOLATION="ANTLR_066",v.TYPE_RUNTIME_FATAL_UNPAIRED_LOOP_END="ANTLR_067",v.TYPE_UNEXPECTED_OPERATOR="ANTLR_068",v.TYPE_OPERATOR_INVALID_ON_RIGHT="ANTLR_069",v.TYPE_INVALID_ASSIGNMENT_LOOP_PAIR="ANTLR_070",v.TYPE_UNEXPECTED_EOI_PARSING_ORDER_GROUP="ANTLR_071",v.TYPE_EXPECTING_ORDER_GROUP_FOR_ORDER_BY_OPERAND="ANTLR_072",v.TYPE_QUERY_UNSUPPORTED_VALUE_TYPE="ANTLR_073",v.TYPE_UNEXPECTED_RUNTIME_RESULT_FOR_ORDER_BY_CLAUSE="ANTLR_074",v.TYPE_UNEXPECTED_EMPTY_DIRECTION_GROUP="ANTLR_075",v.TYPE_INVALID_ORDER_BY_NAME_VALUE="ANTLR_076",v.TYPE_INVALID_ORDER_BY_SORT_VALUE="ANTLR_077",v.TYPE_UNEXPECTED_TOKEN_FOR_GROUP_BY="ANTLR_78",v.TYPE_UNEXPECTED_EOI_WHILE_PARSING_GROUP_BY="ANTLR_079",v.TYPE_UNEXPECTED_GROUP_BY_AS_ALIAS_TYPE="ANTLR_080",v.TYPE_UNEXPECTED_EOI_WHILE_PARSING_SWITCH_GROUP="ANTLR_081",v.TYPE_UNEXPECTED_TOKEN_FOR_SWITCH_GROUP="ANTLR_082",v.TYPE_UNEXPECTED_SWITCH_START_VALUE="ANTLR_083",v.TYPE_UNEXPECTED_SWITCH_START_VALUE_NO_VALUE="ANTLR_084",v.TYPE_UNEXPECTED_SWITCH_START_VALUE_NO_SEMANTIC_VALUE="ANTLR_085",v.TYPE_SWITCH_DEFAULT_MUST_BE_LAST="ANTLR_086",v.TYPE_PARSER_INVALID_SWITCH_TOKEN="ANTLR_087",v.TYPE_ORDER_BY_INVALID_RETURN_TYPE="ANTLR_088",v.TYPE_GROUP_BY_SCOPED_GROUP_MUST_BE_ENCLOSED="ANTLR_089",v.TYPE_PLUCK_INTO_MISSING_VARIABLE_TARGET="ANTLR_090",v.TYPE_PLUCK_INTO_INVALID_VARIABLE_TARGET="ANTLR_091",v.TYPE_PLUCK_INTO_NO_PREDICATE="ANTLR_092",v.TYPE_PLUCK_INTO_INVALID_PREDICATE_VALUE="ANTLR_093",v.TYPE_PLUCK_INTO_EMPTY_LOGIC_GROUP="ANTLR_094",v.TYPE_PLUCK_INTO_INVALID_NUMBER_OF_TUPLE_VARIABLES="ANTLR_095",v.TYPE_PLUCK_INTO_UNKNOWN_ALIAS_VARNAME="ANTLR_096",v.TYPE_PLUCK_INTO_UNEXPECTED_EMPTY_T_LOGIC_GROUP="ANTLR_097",v.TYPE_PLUCK_INTO_REFERENCE_TYPE_DYNAMIC="ANTLR_098",v.TYPE_PLUCK_INTO_REFERENCE_AMBIGUOUS="ANTLR_099",v.TYPE_RUNTIME_ASSIGNMENT_TO_NON_VAR="ANTLR_100",v.TYPE_ARR_MAKE_MISSING_TARGET="ANTLR_101",v.TYPE_ARR_MAKE_UNEXPECTED_TYPE="ANTLR_102",v.TYPE_ARR_MAKE_MISSING_ARR_KEY_PAIR_VALUE="ANTLR_103",v.TYPE_ARR_KEY_PAIR_INVALID_KEY_TYPE="ANTLR_104",v.TYPE_ARR_UNEXPECT_ARG_SEPARATOR="ANTLR_105",v.TYPE_ARR_KEY_PAIR_MISSING_KEY="ANTLR_106",v.RUNTIME_PROTECTED_VAR_ACCESS="ANTLR_107",v.RUNTIME_PROTECTED_TAG_ACCESS="ANTLR_108",v.RUNTIME_PROTECTED_MODIFIER_ACCESS="ANTLR_109",v.TYPE_INCOMPLETE_PHP_EVALUATION_REGION="ANTLR_110",v.RUNTIME_PHP_NODE_WHEN_PHP_DISABLED="ANTLR_111",v.RUNTIME_PHP_NODE_USER_CONTENT_TAG="ANTLR_112",v.TYPE_UNEXPECTED_TYPE_FOR_TUPLE_LIST="ANTLR_113",v.TYPE_UNEXPECTED_EOI_PARSING_TUPLE_LIST="ANTLR_114",v.TYPE_MISSING_BODY_TUPLE_LIST="ANTLR_115",v.TYPE_MISSING_NAMES_TUPLE_LIST="ANTLR_116",v.TYPE_VALUE_NAME_LENGTH_MISMATCH_TUPLE_LIST="ANTLR_117",v.TYPE_INVALID_TUPLE_LIST_NAME_TYPE="ANTLR_118",v.TYPE_INVALID_MANIFESTED_NAME_GROUP="ANTLR_119",v.TYPE_INVALID_TUPLE_LIST_VALUE_TYPE_GROUP="ANTLR_120",v.TYPE_INVALID_TUPLE_LIST_VALUE_TYPE="ANTLR_121",v.TYPE_RUNTIME_BAD_METHOD_CALL="ANTLR_122",v.TYPE_METHOD_CALL_MISSING_ARG_GROUP="ANTLR_123",v.TYPE_INVALID_METHOD_CALL_ARG_GROUP="ANTLR_124",v.TYPE_METHOD_CALL_MISSING_METHOD="ANTLR_125",v.TYPE_MODIFIER_NOT_FOUND="ANTLR_126",v.TYPE_RUNTIME_GENERAL_FAULT="ANTLR_127",v.TYPE_MODIFIER_INCORRECT_VALUE_POSITION="ANTLR_128",v.TYPE_MODIFIER_UNEXPECTED_TOKEN_METHOD_SYNTAX="ANTLR_129",v.TYPE_RUNTIME_ATTEMPTING_TO_RENDER_OBJECT_AS_STRING="ANTLR_130",v.TYPE_UNPAIRED_CLOSING_TAG="ANTLR_131",v.PARSER_CANNOT_PARSE_PATH_RECURSIVE="ANTLR_200",v.PATH_STRING_NOT_INSIDE_ARRAY_ACCESSOR="ANTLR_201",v.LINT_UNKNOWN_PARAMETER="ANTLR_500",v.LINT_GENERAL_INVALID_PARAMETER_CONTENTS="ANTLR_501",v.LINT_PARAMETER_CONTENT_INVALID_INTEGER="ANTLR_502",v.LINT_PARAMETER_CONTENT_INVALID_BOOLEAN="ANT LR_503",v.LINT_PAGINATE_INVALID_VALUE="ANTLR_504",v.LINT_DEBUG_DATA_EXPOSED="ANTLR_505",v.LINT_DOUBLE_COLON_IN_TAG_IDENTIFIER="ANTLR_506",v.LINT_MIXED_MODIFIERS="ANTLR_507",v.LINT_MODIFIER_UNEXPECTED_TYPE="ANTLR_508",v.LINT_REMOVE_RELATE_TAG="ANTLR_509",v.LINT_SET_PRODUCES_RUNTIME_ERROR="ANTLR_510",v.LINT_FRONT_MATTER_EMPTY_DOCUMENT="ANTLR_511",v.LINT_SHORTHAND_MODIFIER_TAG_MUST_MATCH="ANTLR_512",v.LINT_INVALID_FRONT_MATTER="ANTLR_513",v.LINT_DUPLICATE_CODE="ANTLR_514",v.LINT_VERSION_NOT_COMPATIBLE="ANTLR_515",v.LINT_INTERLEAVED_TAG_PAIRS="ANTLR_516",v.LINT_MISSING_REQUIRED_PARAMETER="ANTLR_517",v.LINT_POSSIBLE_PARTIAL_RECURSION="ANTLR_518",v.LINT_URL_VARIABLE_WITHOUT_SANITIZE="ANTLR_519";var nt=class{static distance(e,n){return e.endPosition==null||n.startPosition==null?this.DistMax:n.startPosition.index-e.endPosition.index}static getTrueName(e){var n,r,i,s;return e.originalNode!=null?(r=(n=e.originalNode.name)==null?void 0:n.name)!=null?r:"":(s=(i=e.name)==null?void 0:i.name)!=null?s:""}static getSimpleVarName(e){return e.variableReference!=null&&e.variableReference.pathParts.length==1&&e.variableReference.pathParts[0]instanceof Un?e.variableReference.pathParts[0].name:""}static isVariableMatching(e,n){return e instanceof oe?e.name==n:!1}static mergeVarContentLeft(e,n,r){return r.mergeRefName=r.name,r.endPosition=n.endPosition,r.name=r.name+e,r}static mergeVarContentRight(e,n,r){return r.mergeRefName=r.name,r.startPosition=n.startPosition,r.name=e+r.name,r}static mergeVarRight(e,n){return n.mergeRefName=n.name,n.startPosition=e.startPosition,n.name=e.name+n.name,n}static getUnrefName(e){return G.trimLeft(e,":.")}};nt.DistMax=65e3;var or=class{static isConditionalStructure(e){var r,i;if(e.isComment)return!1;let n=(i=(r=e.name)==null?void 0:r.name)!=null?i:"";return n=="if"||n=="elseif"||n=="else"}static requiresClose(e){var r,i;let n=(i=(r=e.name)==null?void 0:r.name)!=null?i:"";return n=="elseif"||n=="else"?e.isClosedBy==null:!(e.isClosingTag||e.isClosedBy!=null)}static getValidClosingPairs(e){return e=="if"||e=="elseif"?or.conditionClosingPairs:[]}static findClosestStructurePair(e,n,r){var u,c,f,m,p,d,_,C;let i=[],s=e.length,o=new Map,a=null;i.push({node:n,index:r});for(let h=0;h0;){let h=i.pop();if(h==null)continue;if(h.node._conditionParserAbandonPairing)break;let b=h.node,g=or.getValidClosingPairs((m=(f=b.name)==null?void 0:f.name)!=null?m:""),N=h.index,S=!1;if(l>50&&a!=null){for(let[V,O]of o)if(V>N){N=V;break}}for(let V=N;V{var r,i;if(n instanceof B&&or.isConditionalStructure(n)){let s=(i=(r=n.name)==null?void 0:r.name)!=null?i:"";if((s=="elseif"||s=="else")&&n.isOpenedBy==null){n.pushError(M.makeSyntaxError(v.TYPE_PARSE_UNPAIRED_CONDITIONAL,n,'Unpaired "'+nt.getTrueName(n)+'" control structure.'));return}if(n.isClosedBy==null&&or.requiresClose(n)){n.pushError(M.makeSyntaxError(v.TYPE_PARSE_UNCLOSED_CONDITIONAL,n,"Unclosed "+nt.getTrueName(n)+" control structure."));return}}}),e}},$t=or;$t.conditionClosingPairs=["elseif","else"];function ar(t,e){return e==null&&(e="s"),t.replace(new RegExp("^["+e+"]+"),"")}function Pt(t,e,n){return t.replace(new RegExp(e,"g"),n)}function wr(t,e){return e==null&&(e="s"),t.replace(new RegExp("["+e+"]+$"),"")}function ko(){return(Date.now().toString(32)+Math.random().toString(16)).replace(/\./g,"")}function ab(){return Pt(ko(),"-","_")}var Bu=class{constructor(){this.startPosition=null;this.endPosition=null;this.index=0;this.embeddedIndex=0;this.refId=null;this.parameters=[];this.isSelfClosing=!1;this.isClosingFragment=!1;this.name="";this.containsStructures=!1;this.refId=ab()}},ed=class{constructor(){this.startPosition=null;this.endPosition=null}};function tE(t){let e=[],n=[];for(let r=0;r{n.node==null&&(n.node=this),this.antlersErrors.push(n)})}getErrors(){return this.antlersErrors}innerContent(){return this.content}rawContent(){return this.content}},td=class extends J{constructor(){super(...arguments);this.head=null;this.tail=null;this.nodes=[];this.documentText="";this.childDocument=null}getImmediateChildren(){return this.head==null?[]:this.head.getImmediateChildren()}},vt=class extends J{constructor(){super(...arguments);this.logicBranches=[];this.chain=[];this.nodeContent="";this.fragment=null;this.fragmentPosition=3;this.containsAnyFragments=!1;this.containsChildStructures=!1}},B=class extends J{constructor(){super(...arguments);this.isNodeAbanonded=!1;this.isComment=!1;this.isTagNode=!1;this.isConditionNode=!1;this.runtimeContent="";this.name=null;this.pathReference=null;this.isClosingTag=!1;this.isInterpolationNode=!1;this.isOpenedBy=null;this.isClosedBy=null;this.isSelfClosing=!1;this.children=[];this.runtimeNodes=[];this.parsedRuntimeNodes=[];this.hasParsedRuntimeNodes=!1;this.parameters=[];this.hasParameters=!1;this.contentOffset=null;this.cachedContent=null;this.cachedInnerContent=null;this.hasRecursiveNode=!1;this.recursiveReference=null;this.rawStart="";this.rawEnd="";this.originalNode=null;this.interpolationRegions=new Map;this.processedInterpolationRegions=new Map;this.hasProcessedInterpolationRegions=!1;this.ref=0;this.contentStartRelativeIndex=null;this.antlersNodeIndex=0;this.nameStartsOn=null;this.nameEndsOn=null;this.nameMethodPartStartsOn=null;this.documentText="";this.nodeContent="";this.childDocument=null;this.structure=new Jp(this);this.isInlineAntlers=!1;this.mustClose=!1;this.reference=null;this._conditionParserAbandonPairing=!1;this._isEndVirtual=!1}getOriginalContent(){return this.startPosition==null||this.endPosition==null||this.parser==null?"":this.isClosedBy!=null?this.isClosedBy.startPosition==null||this.isClosedBy.endPosition==null?"":this.parser.getText(this.startPosition.index,this.isClosedBy.endPosition.index+1):this.parser.getText(this.startPosition.index,this.endPosition.index+1)}getNodeDocumentText(){return this.startPosition==null||this.endPosition==null||this.parser==null?"":this.parser.getText(this.startPosition.index,this.endPosition.index+1)}getImmediateChildren(){let e=[];for(let n=0;n0){let o=0,a=this.parameters[0];a.startPosition!=null&&(o=a.startPosition.index-1);let l=e,u=l.trimLeft(),c=l.length-u.length,f=n;e=e.substr(0,o)}let r=e.trimLeft(),i=e.length-r.length,s=n+i+2;if(this.parser!=null){let o=0;this.startPosition!=null&&(o=this.startPosition.offset),this.contentOffset==this.parser.positionFromOffset(o+s,0)}this.name!=null?this.name.name=="if"||this.name.name=="elseif"||this.name.name=="unless"||this.name.name=="elseunless"?(e=" "+e.trimLeft(),this.cachedContent=e.substr(this.name.compound.length+1)):this.cachedContent=e:this.cachedContent=e}else if(this.parameters.length>0){let e=this.parameters[0],n=0;e.startPosition!=null&&(n=e.startPosition.index-1),this.contentOffset=this.startPosition,this.cachedContent=this.content.substr(0,n)}else this.contentOffset=this.startPosition,this.cachedContent=this.content;return this.cachedContent}relativePositionFromOffset(e,n){var r,i;return this.parser==null?null:this.parser.positionFromOffset(((i=(r=this.contentOffset)==null?void 0:r.offset)!=null?i:0)+e,n)}getInterpolationNode(e){if(this.processedInterpolationRegions.has(e)){let n=this.processedInterpolationRegions.get(e);if(n.length>0&&n[0]instanceof B)return n[0]}return null}_lexerRelativeOffset(e,n=null){var o,a;let r=e;if(n!=null&&(r=n),this.parser==null){let l=new qt;return l.index=e,l.offset=e,l}let i=e+this.rawStart.length+((a=(o=this.startPosition)==null?void 0:o.index)!=null?a:0);return this.isTagNode&&this.nameStartsOn!=null&&(i=this.nameStartsOn.index+e,$t.isConditionalStructure(this)||(i-=this.rawStart.length)),this.parser.positionFromOffset(i,i,!0)}relativeOffset(e,n=null){var o,a;let r=e;if(n!=null&&(r=n),this.parser==null){let l=new qt;return l.index=e,l.offset=e,l}let i=e+this.rawStart.length+((a=(o=this.startPosition)==null?void 0:o.index)!=null?a:0);return this.parser.positionFromOffset(i,i,!0)}isPaired(){return this.isClosingTag&&this.isSelfClosing==!1&&this.isOpenedBy!=null?!0:!(this.isClosedBy==null||this.isSelfClosing)}getFinalClosingTag(){return this.isClosedBy==null?this:this.isClosedBy.getFinalClosingTag()}rawContent(){return this.rawStart+this.content+this.rawEnd}getTrueRuntimeNodes(){return this.originalNode!=null&&this.originalNode!=this?this.originalNode.getTrueRuntimeNodes():this.runtimeNodes}getTrueRawContent(){return this.originalNode!=null&&this.originalNode!=this?this.originalNode.getTrueRawContent():this.rawContent()}getTrueNode(){return this.originalNode!=null&&this.originalNode!=this?this.originalNode.getTrueNode():this}getStructuralChildren(){return this.isClosedBy!=null?Qp(this.children.slice(0,-1)):Qp(this.children)}findParentOfType(e){return this.parent==null?null:this.parent instanceof B?this.parent.name!=null&&e.includes(this.parent.getTagName())?this.parent:this.parent.findParentOfType(e):null}},Gn=class extends B{static makeWithStartPosition(e){let n=new Gn;return n.startPosition=e,n.endPosition=e,n}},ft=class extends Gn{},lr=class extends B{constructor(){super(...arguments);this.recursiveParent=null;this.isNestedRecursive=!1}},Fs=class extends B{constructor(){super(...arguments);this.isEchoNode=!1}},ol=class extends Gn{},nd=class extends Gn{},rn=class extends B{constructor(){super(...arguments);this.isNoParseRegion=!1}},Vs=class extends J{constructor(){super(...arguments);this.modifier=null;this.isModifierParameter=!1;this.nameDelimiter='"';this.isVariableReference=!1;this.name="";this.value="";this.interpolations=[];this.parent=null;this.blockPosition=null;this.namePosition=null;this.valuePosition=null}containsSimpleValue(){return this.hasInterpolations()==!1&&this.isVariableReference==!1}hasInterpolations(){return this.interpolations.length>0}getArrayValue(){return this.value.split("|")}getValue(){return this.value}},al=class{constructor(){this.modifierTarget=null;this.modifierChain=[];this.startPosition=null;this.endPosition=null;this.lastManifestedModifier=null;this.lastModifier=null}updateValues(){if(this.modifierChain.length==0)this.startPosition=null,this.endPosition=null;else{let e=this.modifierChain[0],n=this.modifierChain[this.modifierChain.length-1];this.startPosition=e.startPosition,this.endPosition=n.endPosition}}},Mo=class extends J{constructor(){super(...arguments);this.modifier=null;this.methodStyleArguments=null;this.nameNode=null;this.name="";this.valueNodes=[];this.parameters=[]}getParameterValues(){let e=[];return this.parameters.forEach(n=>{e.push(n.value)}),e}},ll=class extends J{constructor(){super(...arguments);this.order=0;this.name=null;this.directionNode=null}},rd=class extends J{constructor(){super(...arguments);this.value=""}},Or=class extends J{},ur=class extends J{},Lr=class extends J{},Wn=class extends J{},Hn=class extends J{},oi=class extends J{},ts=class extends J{constructor(){super(...arguments);this.repeat=1}},ai=class extends J{},Yn=class extends J{},Tn=class extends J{},Dr=class extends J{},kr=class extends J{},Kn=class extends J{},Mr=class extends J{},Fr=class extends J{},li=class extends J{},Nn=class extends J{},cr=class extends J{},Ei=class extends J{},Vr=class extends J{},qr=class extends J{},Br=class extends J{},jr=class extends J{},Ur=class extends J{},Gr=class extends J{},wi=class extends J{},Wr=class extends J{},sn=class extends J{},qs=class extends J{constructor(){super(...arguments);this.orderClauses=[]}},It=class extends J{},vn=class extends J{},ul=class extends J{constructor(){super(...arguments);this.left=null;this.right=null}},Pn=class extends J{constructor(){super(...arguments);this.isTenaryBranchSeparator=!1}},Hr=class extends J{},fr=class extends J{},on=class extends J{},Yr=class extends J{},ui=class extends J{},pr=class extends J{},In=class extends J{},ci=class extends J{},Bt=class extends J{},zt=class extends J{},Fo=class extends J{constructor(){super(...arguments);this.values=[];this.isNamedNode=!1;this.parsedName=null}},ke=class extends J{constructor(){super(...arguments);this.start=null;this.end=null;this.nodes=[];this.scopeOperator=null}},Vo=class extends J{constructor(){super(...arguments);this.condition=null;this.expression=null}},Bs=class extends J{constructor(){super(...arguments);this.cases=[]}},id=class extends J{constructor(){super(...arguments);this.left=null;this.right=null}},Oi=class extends J{constructor(){super(...arguments);this.nodes=[]}},cl=class extends J{constructor(){super(...arguments);this.head=null;this.truthBranch=null;this.falseBranch=null}},Ct=class extends J{},Ot=class extends J{constructor(){super(...arguments);this.nodes=[];this.separatorToken=null}},dr=class extends ke{constructor(){super(...arguments);this.scope=null}extract(){let e=null;this.scope!=null&&(e=this.scope.name);let n=this.nodes[0];return[e,n.nodes]}},Li=class extends dr{constructor(){super(...arguments);this.alias=null}},qo=class extends J{constructor(){super(...arguments);this.args=[];this.hasNamedArguments=!1;this.numberOfNamedArguments=0}},Kr=class extends J{},sd=class extends J{};var ns=class extends J{constructor(){super(...arguments);this.libraryName="";this.methodName="";this.arguments=null}},Qe=class extends J{constructor(){super(...arguments);this.sourceContent=""}},Xt=class extends J{constructor(){super(...arguments);this.method=null;this.args=null}},jt=class extends J{constructor(){super(...arguments);this.name=""}},Ut=class extends J{constructor(){super(...arguments);this.value="";this.name=""}},ju=class extends J{constructor(){super(...arguments);this.name=null;this.value=null}},fl=class extends J{constructor(){super(...arguments);this.name=null;this.value=null}},Lt=class extends J{constructor(){super(...arguments);this.value=null}},bt=class extends J{constructor(){super(...arguments);this.value="";this.sourceTerminator="";this.sourceContent=""}},oe=class extends J{constructor(){super(...arguments);this.name="";this.mergeRefName="";this.variableReference=null;this.interpolationNodes=[];this.isInterpolationReference=!1}},od=class extends J{constructor(){super(...arguments);this.name=""}},Un=class extends J{constructor(){super(...arguments);this.delimiter="";this.name="";this.isStringVar=!1;this.isFinal=!1}},rs=class{constructor(){this.originalContent="";this.normalizedReference="";this.isStrictTagReference=!1;this.isStrictVariableReference=!1;this.isExplicitVariableReference=!1;this.isVariableVariable=!1;this.pathParts=[];this.isFinal=!1;this._isFromEmptyFailState=!1}clone(){let e=new rs;return e.originalContent=this.originalContent,e.normalizedReference=this.normalizedReference,e.isStrictVariableReference=this.isStrictVariableReference,e.isExplicitVariableReference=this.isExplicitVariableReference,e.pathParts=this.pathParts,e.isFinal=this.isFinal,e}implodePaths(){let e=[];return this.pathParts.forEach(n=>{n instanceof Un?e.push(n.name):n instanceof rs&&e.push(n.implodePaths())}),e.join(".")}},ad=class{constructor(e,n,r){this.target=e,this.value=n,this.operator=r}};var YN=Q(nn());var Bo=Q(ot());function ld(t,e){let n=[];if(t.currentNode==null)return n;let r={start:{line:t.position.line,character:t.position.character-0},end:t.position};for(let i=0;i0&&(n=e.join(", ")),"**"+t+"** `"+n+"` \n"}function Uu(t){let e=nE(t.name,t.acceptsType),n="";if(t.parameters.length>0){let s=[];t.parameters.forEach(o=>{s.push("$"+o.name)}),n=s.join(", ")}let r="";if(t.returnsType.length==1)r=t.returnsType[0];else{let s=[];t.returnsType.forEach(o=>{s.push(o)}),r=s.join(", ")}return e+=t.description+` `,e+="```js\n",e+="function "+t.name+"("+n+"):"+r,e+="\n```",t.docLink!=null&&t.docLink.trim().length>0&&(e+=` -`,e+="[Documentation Reference]("+t.docLink+")"),{label:t.name,insertText:t.name,documentation:{kind:jo.MarkupKind.Markdown,value:e},kind:jo.CompletionItemKind.Function}}function Uu(t){let e=[];for(let n=0;n0&&(e+=` -`),e+="Blueprint: "+t.blueprintName),t.type!=null&&(n+=": "+t.type),{label:t.name,insertText:t.name,kind:jo.CompletionItemKind.Field,documentation:e,detail:n}}function Ee(t,e,n,r){let i="**"+t+"** ";return i+=` +`,e+="[Documentation Reference]("+t.docLink+")"),{label:t.name,insertText:t.name,documentation:{kind:jo.MarkupKind.Markdown,value:e},kind:jo.CompletionItemKind.Function}}function Gu(t){let e=[];for(let n=0;n0&&(e+=` +`),e+="Blueprint: "+t.blueprintName),t.type!=null&&(n+=": "+t.type),{label:t.name,insertText:t.name,kind:jo.CompletionItemKind.Field,documentation:e,detail:n}}function Re(t,e,n,r){let i="**"+t+"** ";return i+=` `,i+=e+" ",i+="\n```antlers\n",i+=n,i+="\n```",r!=null&&(i+=` `,i+="[Documentation Reference]("+r+")"),i}function k(t,e,n){let r="**"+t+"** ";return r+=` `,r+=e+" ",n!=null&&(r+=` -`,r+="[Documentation Reference]("+n+")"),r}function Uo(t){let e=[];return t=="order"&&e.push("sort"),e}var lb=["replicator","bard"];function tE(t){return{blueprintName:t.sourceName,displayName:t.name,instructionText:"",maxItems:-1,name:t.name,refFieldSetField:null,type:t.dataType,sets:null,import:null}}function Gu(t){let e=[];for(let n=0;n1)&&(t=="form"?t="form_multiple":t=="sites"?t="sites_multiple":t=="taxonomies"?t="taxonomies_multiple":t=="user_groups"?t="user_groups_multiple":t=="user_roles"?t="user_roles_multiple":t=="terms"?t="terms_multiple":t=="users"?t="users_multiple":t=="structures"&&(t="structures_multiple")),t}function cb(t){let e=[];for(let n=0;n!t.includes(r));for(let r=0;r!t.includes(o));for(let o=0;o!t.includes(i));for(let i=0;ic.endPosition.char||s>((l=(a=c.endPosition)==null?void 0:a.line)!=null?l:0))&&r.push(c)}return r}static hasUnclosedTags(e,n){return this.unclosedNodes.has(e)==!1?!1:this.getUnclosedTags(e,n).length>0}};js.unclosedNodes=new Map;var Tb=["edit_url","id","last_modified","permalink","published","slug","template","url"];function as(t){return[{name:"edit_url",dataType:"string",sourceName:"*internal.entry",sourceField:null,introducedBy:t},{name:"id",dataType:"string",sourceName:"*internal.entry",sourceField:null,introducedBy:t},{name:"last_modified",dataType:"string",sourceName:"*internal.entry",sourceField:null,introducedBy:t},{name:"permalink",dataType:"string",sourceName:"*internal.entry",sourceField:null,introducedBy:t},{name:"published",dataType:"boolean",sourceName:"*internal.entry",sourceField:null,introducedBy:t},{name:"slug",dataType:"string",sourceName:"*internal.entry",sourceField:null,introducedBy:t},{name:"template",dataType:"string",sourceName:"*internal.entry",sourceField:null,introducedBy:t},{name:"url",dataType:"string",sourceName:"*internal.entry",sourceField:null,introducedBy:t}]}var $n=Q(nn()),Nb=[{label:"name",kind:$n.CompletionItemKind.Property},{label:"description",kind:$n.CompletionItemKind.Property},{label:"desc",kind:$n.CompletionItemKind.Property},{label:"entry",kind:$n.CompletionItemKind.Property},{label:"collection",kind:$n.CompletionItemKind.Property},{label:"blueprint",kind:$n.CompletionItemKind.Property},{label:"var",kind:$n.CompletionItemKind.Property},{label:"set",kind:$n.CompletionItemKind.Property},{label:"param",kind:$n.CompletionItemKind.Property},{label:"param*",kind:$n.CompletionItemKind.Property},{label:"front",kind:$n.CompletionItemKind.Property},{label:"format",kind:$n.CompletionItemKind.Property}];var Yu=Q(ot()),nE=[{label:"if",kind:Yu.CompletionItemKind.Keyword},{label:"elseif",kind:Yu.CompletionItemKind.Keyword},{label:"else",kind:Yu.CompletionItemKind.Keyword}],vb=nE;var Yo=Q(nn()),Pb=Q(ot());var fd=class{static getCompletions(e,n){var o;let r=[],i=0;e.leftWord!=e.leftMeaningfulWord&&(i=e.leftWord.length);let s={start:{line:e.position.line,character:e.position.character-i},end:e.position};return(o=Me.instance)==null||o.getModifiersForType(n.dataType).filter(a=>a.canBeParameter).forEach(a=>{r.push({label:a.name,documentation:{kind:Pb.MarkupKind.Markdown,value:a.description},insertTextFormat:Yo.InsertTextFormat.Snippet,kind:Yo.CompletionItemKind.Value,textEdit:Yo.TextEdit.replace(s,a.name+'="$1" '),command:{title:"Suggest",command:"editor.action.triggerSuggest"}})}),r}};var pd=Q(ot()),Ko=[];Ko.push({label:"true",kind:pd.CompletionItemKind.Keyword});Ko.push({label:"false",kind:pd.CompletionItemKind.Keyword});function Ib(t){let e=[];for(let n=0;n{e.addVariables(ze(t)),e.addVariables(Ye(t))}},Sb=rE;var iE={name:"bard",augmentScope:(t,e)=>{e.addVariable({name:"type",dataType:"string",sourceField:null,sourceName:"*internal.bard",introducedBy:t})},injectCompletions:(t,e,n)=>[]},Cb=iE;var sE={name:"form_multiple",augmentScope:(t,e)=>{e.addVariables(ze(t)),e.addVariables(Ye(t))}},Rb=sE;var oE={name:"list",augmentScope:(t,e)=>{e.addVariables(ze(t)),e.addVariables(Ye(t))}},Ab=oE;function xb(t){return[{name:"type",dataType:"string",sourceName:"*internal.replicator",sourceField:null,introducedBy:t}]}var aE={name:"replicator",augmentScope:(t,e)=>{e.addVariables(xb(t)),e.addVariables(Ye(t))},injectCompletions:(t,e,n)=>[]},Eb=aE;var lE={name:"select_multiple",augmentScope:(t,e)=>{e.addVariables(ze(t)),e.addVariables(Ye(t))}},wb=lE;var uE={name:"sites_multiple",augmentScope:(t,e)=>{e.addVariables(ze(t)),e.addVariables(Ye(t))}},Ob=uE;var cE={name:"structures_multiple",augmentScope:(t,e)=>{e.addVariables(ze(t)),e.addVariables(Ye(t))}},Lb=cE;var fE={name:"table",augmentScope:(t,e)=>{e.addVariable({name:"cells",dataType:"array",sourceName:"*internal.fieldtype.table",sourceField:null,introducedBy:t})}},Db=fE;var pE={name:"tags",augmentScope:(t,e)=>{e.addVariables(ze(t)),e.addVariables(Ye(t))}},kb=pE;function Ku(t){return as(t).concat([{name:"entries_count",dataType:"number",sourceName:"*internal.term",sourceField:null,introducedBy:t},{name:"is_term",dataType:"boolean",sourceName:"*internal.term",sourceField:null,introducedBy:t},{name:"taxonomy",dataType:"string",sourceName:"*internal.term",sourceField:null,introducedBy:t}])}var dE={name:"taxonomies_multiple",augmentScope:(t,e)=>{e.addVariables(ze(t)),e.addVariables(Ye(t)),e.addVariables(Ku(t))}},Mb=dE;var mE={name:"terms_multiple",augmentScope:(t,e)=>{e.addVariables(ze(t)),e.addVariables(Ye(t)),e.addVariables(Ku(t))}},Fb=mE;var hE={name:"user_groups_multiple",augmentScope:(t,e)=>{e.addVariables(ze(t)),e.addVariables(Ye(t))}},Vb=hE;var gE={name:"user_roles_multiple",augmentScope:(t,e)=>{e.addVariables(ze(t)),e.addVariables(Ye(t))}},qb=gE;var _E={name:"users_multiple",augmentScope:(t,e)=>{e.addVariables(ze(t)),e.addVariables(Ye(t)),e.injectBlueprint(t,"user")}},Bb=_E;var yE={name:"yaml",augmentScope:(t,e)=>{e.addVariables(ze(t)),e.addVariables(Ye(t))}},jb=yE;var bE=[Sb,Cb,Rb,Ab,Eb,wb,Ob,Lb,jb,Db,Mb,kb,Fb,Bb,Vb,qb],Ub=bE;var ls=class{constructor(){this.fieldTypes=new Map}getFieldTypes(){return this.fieldTypes}getFieldType(e){return this.fieldTypes.get(e)}registerFieldtypes(e){for(let n=0;ni&&a<=s||o==n&&a>i&&a<=s||o==r&&an&&o1?e[e.length-1]:e[0].trim()}function zu(t){return t.includes(":")==!1?t:t.split(":")[0]}function Wb(t){var n;if(t.nodesInScope.length==0)return[];let e=t.nodesInScope[t.nodesInScope.length-1];return((n=t.context)==null?void 0:n.node)!=null&&(e=t.context.node),e.currentScope==null?[]:Us(t,e.currentScope)}function Us(t,e){let n=[];return e.values.forEach(r=>{var i;if(r.sourceField!=null?n.push({label:r.name,detail:r.sourceField.blueprintName,documentation:(i=r.sourceField.instructionText)!=null?i:"",kind:Dt.CompletionItemKind.Field}):n.push(is(r.name,"","")),r.dataType.trim().length>0&&r.dataType=="array"){let s=r.name+` }} +`,r+="[Documentation Reference]("+n+")"),r}function Uo(t){let e=[];return t=="order"&&e.push("sort"),e}var lb=["replicator","bard"];function rE(t){return{blueprintName:t.sourceName,displayName:t.name,instructionText:"",maxItems:-1,name:t.name,refFieldSetField:null,type:t.dataType,sets:null,import:null}}function Wu(t){let e=[];for(let n=0;n1)&&(t=="form"?t="form_multiple":t=="sites"?t="sites_multiple":t=="taxonomies"?t="taxonomies_multiple":t=="user_groups"?t="user_groups_multiple":t=="user_roles"?t="user_roles_multiple":t=="terms"?t="terms_multiple":t=="users"?t="users_multiple":t=="structures"&&(t="structures_multiple")),t}function cb(t){let e=[];for(let n=0;n!t.includes(r));for(let r=0;r!t.includes(o));for(let o=0;o!t.includes(i));for(let i=0;ic.endPosition.char||s>((l=(a=c.endPosition)==null?void 0:a.line)!=null?l:0))&&r.push(c)}return r}static hasUnclosedTags(e,n){return this.unclosedNodes.has(e)==!1?!1:this.getUnclosedTags(e,n).length>0}};js.unclosedNodes=new Map;var Tb=["edit_url","id","last_modified","permalink","published","slug","template","url"];function as(t){return[{name:"edit_url",dataType:"string",sourceName:"*internal.entry",sourceField:null,introducedBy:t},{name:"id",dataType:"string",sourceName:"*internal.entry",sourceField:null,introducedBy:t},{name:"last_modified",dataType:"string",sourceName:"*internal.entry",sourceField:null,introducedBy:t},{name:"permalink",dataType:"string",sourceName:"*internal.entry",sourceField:null,introducedBy:t},{name:"published",dataType:"boolean",sourceName:"*internal.entry",sourceField:null,introducedBy:t},{name:"slug",dataType:"string",sourceName:"*internal.entry",sourceField:null,introducedBy:t},{name:"template",dataType:"string",sourceName:"*internal.entry",sourceField:null,introducedBy:t},{name:"url",dataType:"string",sourceName:"*internal.entry",sourceField:null,introducedBy:t}]}var $n=Q(nn()),Nb=[{label:"name",kind:$n.CompletionItemKind.Property},{label:"description",kind:$n.CompletionItemKind.Property},{label:"desc",kind:$n.CompletionItemKind.Property},{label:"entry",kind:$n.CompletionItemKind.Property},{label:"collection",kind:$n.CompletionItemKind.Property},{label:"blueprint",kind:$n.CompletionItemKind.Property},{label:"var",kind:$n.CompletionItemKind.Property},{label:"set",kind:$n.CompletionItemKind.Property},{label:"param",kind:$n.CompletionItemKind.Property},{label:"param*",kind:$n.CompletionItemKind.Property},{label:"front",kind:$n.CompletionItemKind.Property},{label:"format",kind:$n.CompletionItemKind.Property}];var Ku=Q(ot()),iE=[{label:"if",kind:Ku.CompletionItemKind.Keyword},{label:"elseif",kind:Ku.CompletionItemKind.Keyword},{label:"else",kind:Ku.CompletionItemKind.Keyword}],vb=iE;var Yo=Q(nn()),Pb=Q(ot());var pd=class{static getCompletions(e,n){var o;let r=[],i=0;e.leftWord!=e.leftMeaningfulWord&&(i=e.leftWord.length);let s={start:{line:e.position.line,character:e.position.character-i},end:e.position};return(o=we.instance)==null||o.getModifiersForType(n.dataType).filter(a=>a.canBeParameter).forEach(a=>{r.push({label:a.name,documentation:{kind:Pb.MarkupKind.Markdown,value:a.description},insertTextFormat:Yo.InsertTextFormat.Snippet,kind:Yo.CompletionItemKind.Value,textEdit:Yo.TextEdit.replace(s,a.name+'="$1" '),command:{title:"Suggest",command:"editor.action.triggerSuggest"}})}),r}};var dd=Q(ot()),Ko=[];Ko.push({label:"true",kind:dd.CompletionItemKind.Keyword});Ko.push({label:"false",kind:dd.CompletionItemKind.Keyword});function Ib(t){let e=[];for(let n=0;n{e.addVariables(ze(t)),e.addVariables(Ye(t))}},Sb=sE;var oE={name:"bard",augmentScope:(t,e)=>{e.addVariable({name:"type",dataType:"string",sourceField:null,sourceName:"*internal.bard",introducedBy:t})},injectCompletions:(t,e,n)=>[]},Cb=oE;var aE={name:"form_multiple",augmentScope:(t,e)=>{e.addVariables(ze(t)),e.addVariables(Ye(t))}},Rb=aE;var lE={name:"list",augmentScope:(t,e)=>{e.addVariables(ze(t)),e.addVariables(Ye(t))}},Ab=lE;function xb(t){return[{name:"type",dataType:"string",sourceName:"*internal.replicator",sourceField:null,introducedBy:t}]}var uE={name:"replicator",augmentScope:(t,e)=>{e.addVariables(xb(t)),e.addVariables(Ye(t))},injectCompletions:(t,e,n)=>[]},Eb=uE;var cE={name:"select_multiple",augmentScope:(t,e)=>{e.addVariables(ze(t)),e.addVariables(Ye(t))}},wb=cE;var fE={name:"sites_multiple",augmentScope:(t,e)=>{e.addVariables(ze(t)),e.addVariables(Ye(t))}},Ob=fE;var pE={name:"structures_multiple",augmentScope:(t,e)=>{e.addVariables(ze(t)),e.addVariables(Ye(t))}},Lb=pE;var dE={name:"table",augmentScope:(t,e)=>{e.addVariable({name:"cells",dataType:"array",sourceName:"*internal.fieldtype.table",sourceField:null,introducedBy:t})}},Db=dE;var mE={name:"tags",augmentScope:(t,e)=>{e.addVariables(ze(t)),e.addVariables(Ye(t))}},kb=mE;function $u(t){return as(t).concat([{name:"entries_count",dataType:"number",sourceName:"*internal.term",sourceField:null,introducedBy:t},{name:"is_term",dataType:"boolean",sourceName:"*internal.term",sourceField:null,introducedBy:t},{name:"taxonomy",dataType:"string",sourceName:"*internal.term",sourceField:null,introducedBy:t}])}var hE={name:"taxonomies_multiple",augmentScope:(t,e)=>{e.addVariables(ze(t)),e.addVariables(Ye(t)),e.addVariables($u(t))}},Mb=hE;var gE={name:"terms_multiple",augmentScope:(t,e)=>{e.addVariables(ze(t)),e.addVariables(Ye(t)),e.addVariables($u(t))}},Fb=gE;var _E={name:"user_groups_multiple",augmentScope:(t,e)=>{e.addVariables(ze(t)),e.addVariables(Ye(t))}},Vb=_E;var yE={name:"user_roles_multiple",augmentScope:(t,e)=>{e.addVariables(ze(t)),e.addVariables(Ye(t))}},qb=yE;var bE={name:"users_multiple",augmentScope:(t,e)=>{e.addVariables(ze(t)),e.addVariables(Ye(t)),e.injectBlueprint(t,"user")}},Bb=bE;var TE={name:"yaml",augmentScope:(t,e)=>{e.addVariables(ze(t)),e.addVariables(Ye(t))}},jb=TE;var NE=[Sb,Cb,Rb,Ab,Eb,wb,Ob,Lb,jb,Db,Mb,kb,Fb,Bb,Vb,qb],Ub=NE;var ls=class{constructor(){this.fieldTypes=new Map}getFieldTypes(){return this.fieldTypes}getFieldType(e){return this.fieldTypes.get(e)}registerFieldtypes(e){for(let n=0;ni&&a<=s||o==n&&a>i&&a<=s||o==r&&an&&o1?e[e.length-1]:e[0].trim()}function Xu(t){return t.includes(":")==!1?t:t.split(":")[0]}function Wb(t){var n;if(t.nodesInScope.length==0)return[];let e=t.nodesInScope[t.nodesInScope.length-1];return((n=t.context)==null?void 0:n.node)!=null&&(e=t.context.node),e.currentScope==null?[]:Us(t,e.currentScope)}function Us(t,e){let n=[];return e.values.forEach(r=>{var i;if(r.sourceField!=null?n.push({label:r.name,detail:r.sourceField.blueprintName,documentation:(i=r.sourceField.instructionText)!=null?i:"",kind:Dt.CompletionItemKind.Field}):n.push(is(r.name,"","")),r.dataType.trim().length>0&&r.dataType=="array"){let s=r.name+` }} $1 -{{ /`+r.name+" ",o={start:{line:t.position.line,character:t.position.character-t.originalLeftWord.length},end:t.position};n.push({label:r.name+" loop",insertTextFormat:Dt.InsertTextFormat.Snippet,kind:Dt.CompletionItemKind.Snippet,textEdit:Dt.TextEdit.replace(o,s),command:{title:"Suggest",command:"editor.action.triggerSuggest"}})}}),e.lists.forEach((r,i)=>{n.push(is(i,"",""))}),n}function vE(){var e;let t=[];return(e=Me.instance)==null||e.getRegisteredModifiers().forEach(n=>{t.push(ju(n))}),t}var md=class{static getSuggestions(e){var s,o,a,l,u,c,f,m,d,p,_,C,h,b,g,N,S,V,O,$,X,ee,Y,ne,Le,de,Z,Ge,lt,Ft,Ve,ut,bi,Yi;if(e==null)return[];if(e.context!=null&&e.context.node!=null&&e.context.node.isComment)return e.context.node.antlersNodeIndex==1?Nb:[];if(e.nodesInScope.length==0)return[];if(e.leftMeaningfulWord==null&&e.leftChar=="/"){let le=js.getUnclosedTags(e.document,e.position);if(le.length>0){let ue=[],me="";e.rightChar=="}"&&(me=" ");for(let se=0;se0){if(n.currentScope.hasListInHistory(e.context.variableContext.varPathText)){let le=n.currentScope.getList(e.context.variableContext.varPathText);le!=null&&Us(e,le).forEach(ue=>{r.push({...ue,sortText:"00"})})}else if(n.currentScope.containsPath(e.context.variableContext.varPathText)){let le=n.currentScope.findNestedScope(e.context.variableContext.varPathText);le!=null&&Us(e,le).forEach(ue=>{r.push({...ue,sortText:"00"})})}}if(((o=e.context)==null?void 0:o.modifierContext)!=null&&(e.context.modifierContext.inModifierName||e.context.modifierContext.inModifierName==!1&&e.context.modifierContext.inModifierParameter==!1||e.context.feature==null||e.leftChar=="|"&&e.context.char==" ")&&(r=r.concat(vE())),e.nodesInScope.length>=2){let le=e.nodesInScope.length-2,ue=[];for(let me=le;me>=0;me--){let se=e.nodesInScope[me];ue=ue.concat(dd.getVariableSuggestions(e,se))}ue.length>0&&(r=r.concat(ue))}if((((a=e.currentNode)==null?void 0:a.isEmpty())||((l=e.context)==null?void 0:l.isCursorInIdentifier)&&e.leftChar!=":"&&e.leftChar!=" ")&&((u=e.context)==null?void 0:u.modifierContext)==null){let le=(f=(c=Ie.instance)==null?void 0:c.getVisibleTagsWithDocumentation())!=null?f:[],ue=[],me=[];for(let se=0;se0&&le.forEach(ue=>{ue.target instanceof oe&&r.push({label:ue.target.name,kind:Dt.CompletionItemKind.Variable})})}if(TE.includes(n.getTagName())&&e.context.feature!=null&&e.context.feature instanceof bt&&e.context.feature.prev instanceof Nn&&e.context.feature.prev.prev instanceof oe){let le=n.getParser();if(le!=null&&e.project!=null&&le.getLanguageParser().isMergedVariableComponent(e.context.feature.prev.prev)){let me=le.getLanguageParser().getMergedVariable(e.context.feature.prev.prev),se=[];return me.name=="collection:handle"?se=e.project.getUniqueCollectionNames():me.name=="site:handle"?se=e.project.getSiteNames():me.name=="blueprint:handle"&&(se=e.project.getBlueprintNames()),se.forEach(Ne=>{r.push({label:Ne,sortText:Ne,kind:Dt.CompletionItemKind.EnumMember})}),r}if(["collection","current_template","status","blueprint","response_code"].includes(e.context.feature.prev.prev.name)){if(e.project!=null){let me=e.context.feature.prev.prev.name,se=[];return me=="collection"?se=e.project.getUniqueCollectionNames():me=="current_template"?se=e.project.getTemplateNames():me=="status"?se=["draft","scheduled","expired","published"]:me=="blueprint"?se=e.project.getBlueprintNames():me=="response_code"&&(se=["404","200"]),se.forEach(Ne=>{r.push({label:Ne,sortText:Ne,kind:Dt.CompletionItemKind.EnumMember})}),r}}else if(e.context.feature.prev.prev.scopeVariable!=null){let me=e.context.feature.prev.prev.scopeVariable.dataType;if(me=="replicator"||me=="bard"){let se=e.context.feature.prev.prev.scopeVariable.sourceField;return(_=se.sets)==null||_.forEach(Ne=>{let Nt="**"+Ne.displayName+"** `"+Ne.handle+"` ";Nt+=` +{{ /`+r.name+" ",o={start:{line:t.position.line,character:t.position.character-t.originalLeftWord.length},end:t.position};n.push({label:r.name+" loop",insertTextFormat:Dt.InsertTextFormat.Snippet,kind:Dt.CompletionItemKind.Snippet,textEdit:Dt.TextEdit.replace(o,s),command:{title:"Suggest",command:"editor.action.triggerSuggest"}})}}),e.lists.forEach((r,i)=>{n.push(is(i,"",""))}),n}function IE(){var e;let t=[];return(e=we.instance)==null||e.getRegisteredModifiers().forEach(n=>{t.push(Uu(n))}),t}var hd=class{static getSuggestions(e){var s,o,a,l,u,c,f,m,p,d,_,C,h,b,g,N,S,V,O,$,X,ee,Y,ne,De,de,Z,Ge,lt,Ft,Ve,ut,bi,Yi;if(e==null)return[];if(e.context!=null&&e.context.node!=null&&e.context.node.isComment)return e.context.node.antlersNodeIndex==1?Nb:[];if(e.nodesInScope.length==0)return[];if(e.leftMeaningfulWord==null&&e.leftChar=="/"){let le=js.getUnclosedTags(e.document,e.position);if(le.length>0){let ue=[],me="";e.rightChar=="}"&&(me=" ");for(let se=0;se0){if(n.currentScope.hasListInHistory(e.context.variableContext.varPathText)){let le=n.currentScope.getList(e.context.variableContext.varPathText);le!=null&&Us(e,le).forEach(ue=>{r.push({...ue,sortText:"00"})})}else if(n.currentScope.containsPath(e.context.variableContext.varPathText)){let le=n.currentScope.findNestedScope(e.context.variableContext.varPathText);le!=null&&Us(e,le).forEach(ue=>{r.push({...ue,sortText:"00"})})}}if(((o=e.context)==null?void 0:o.modifierContext)!=null&&(e.context.modifierContext.inModifierName||e.context.modifierContext.inModifierName==!1&&e.context.modifierContext.inModifierParameter==!1||e.context.feature==null||e.leftChar=="|"&&e.context.char==" ")&&(r=r.concat(IE())),e.nodesInScope.length>=2){let le=e.nodesInScope.length-2,ue=[];for(let me=le;me>=0;me--){let se=e.nodesInScope[me];ue=ue.concat(md.getVariableSuggestions(e,se))}ue.length>0&&(r=r.concat(ue))}if((((a=e.currentNode)==null?void 0:a.isEmpty())||((l=e.context)==null?void 0:l.isCursorInIdentifier)&&e.leftChar!=":"&&e.leftChar!=" ")&&((u=e.context)==null?void 0:u.modifierContext)==null){let le=(f=(c=Ie.instance)==null?void 0:c.getVisibleTagsWithDocumentation())!=null?f:[],ue=[],me=[];for(let se=0;se0&&le.forEach(ue=>{ue.target instanceof oe&&r.push({label:ue.target.name,kind:Dt.CompletionItemKind.Variable})})}if(vE.includes(n.getTagName())&&e.context.feature!=null&&e.context.feature instanceof bt&&e.context.feature.prev instanceof Nn&&e.context.feature.prev.prev instanceof oe){let le=n.getParser();if(le!=null&&e.project!=null&&le.getLanguageParser().isMergedVariableComponent(e.context.feature.prev.prev)){let me=le.getLanguageParser().getMergedVariable(e.context.feature.prev.prev),se=[];return me.name=="collection:handle"?se=e.project.getUniqueCollectionNames():me.name=="site:handle"?se=e.project.getSiteNames():me.name=="blueprint:handle"&&(se=e.project.getBlueprintNames()),se.forEach(Ne=>{r.push({label:Ne,sortText:Ne,kind:Dt.CompletionItemKind.EnumMember})}),r}if(["collection","current_template","status","blueprint","response_code"].includes(e.context.feature.prev.prev.name)){if(e.project!=null){let me=e.context.feature.prev.prev.name,se=[];return me=="collection"?se=e.project.getUniqueCollectionNames():me=="current_template"?se=e.project.getTemplateNames():me=="status"?se=["draft","scheduled","expired","published"]:me=="blueprint"?se=e.project.getBlueprintNames():me=="response_code"&&(se=["404","200"]),se.forEach(Ne=>{r.push({label:Ne,sortText:Ne,kind:Dt.CompletionItemKind.EnumMember})}),r}}else if(e.context.feature.prev.prev.scopeVariable!=null){let me=e.context.feature.prev.prev.scopeVariable.dataType;if(me=="replicator"||me=="bard"){let se=e.context.feature.prev.prev.scopeVariable.sourceField;return(_=se.sets)==null||_.forEach(Ne=>{let Nt="**"+Ne.displayName+"** `"+Ne.handle+"` ";Nt+=` - Blueprint: \``+se.blueprintName+"` \n",Ne.fields.forEach(Nr=>{Nt+=` - * `+Nr.displayName+" `"+Nr.name+":"+Nr.type+"` "}),me=="replicator"?Nt+=` + Blueprint: \``+se.blueprintName+"` \n",Ne.fields.forEach(vr=>{Nt+=` + * `+vr.displayName+" `"+vr.name+":"+vr.type+"` "}),me=="replicator"?Nt+=` [Replicator Templating Documentation](https://statamic.dev/fieldtypes/replicator#templating)`:Nt+=` @@ -243,76 +243,78 @@ You passed in: '`+this.raw_options[t]+"'");return r};Is.prototype._is_valid_sele $2 {{ else }} -{{ /if `;r.push({label:"ifelse",insertTextFormat:Dt.InsertTextFormat.Snippet,kind:Dt.CompletionItemKind.Snippet,textEdit:Dt.TextEdit.replace(le,ue),command:{title:"Suggest",command:"editor.action.triggerSuggest"}}),n.scopeVariable!=null&&(r=r.concat(fd.getCompletions(e,n.scopeVariable)))}if(n.currentScope.hasListInHistory(n.runtimeName())==!1&&n.currentScope.hasPristineReference(n.runtimeName())==!1?i=(h=(C=Ie.instance)==null?void 0:C.injectParentScope(n.runtimeName()))!=null?h:!1:i=!1,((b=e.context)==null?void 0:b.parameterContext)!=null&&e.context.parameterContext.parameter!=null&&(e.context.parameterContext.parameter.isVariableReference==!1?i=!1:i=!0),e.currentNode!=null&&(e.currentNode.isEmpty()||e.currentNode.parent!=null)&&(i=!0),n.runtimeName().includes(":")&&n.currentScope.containsPath(Er(n.runtimeName(),":"))){let le=Er(n.runtimeName(),":"),ue=ar(Er(e.leftWord,":"),"{");if(le==ue){let me=n.currentScope.findNestedScope(le);if(me!=null)return me.lists.forEach((se,Ne)=>{r.push(is(Ne,"",""))}),me.values.forEach(se=>{var Ne;se.sourceField!=null?r.push({label:se.name,detail:se.sourceField.blueprintName,documentation:(Ne=se.sourceField.instructionText)!=null?Ne:"",kind:Dt.CompletionItemKind.Field}):r.push(is(se.name,"",""))}),r}}if(n.isTagNode){if(e.isInVariableInterpolation&&e.currentNode==null)r=r.concat(Us(e,n.currentScope.ancestor()));else if(((g=e.context)==null?void 0:g.parameterContext)!=null&&e.context.parameterContext.parameter!=null){let le=e.context.parameterContext.parameter;if(le.isVariableReference&&e.position.character<=((V=(S=(N=le.valuePosition)==null?void 0:N.end)==null?void 0:S.char)!=null?V:-1)){if(r=r.concat(Us(e,n.currentScope.ancestor())),Ie.instance!=null){let ue=Ie.instance.getCompletionItems(e);r=r.concat(ue.items)}}else if(e.position.character<=((X=($=(O=le.valuePosition)==null?void 0:O.end)==null?void 0:$.char)!=null?X:-1)){let ue=null,me=!1;if((ee=Ie.instance)==null?void 0:ee.canResolveDynamicParameter(n.runtimeName())){let se=Ie.instance.findTag(n.runtimeName());typeof se!="undefined"&&typeof se.resolveDynamicParameter!="undefined"&&se.resolveDynamicParameter!=null&&(ue=se.resolveDynamicParameter(n,le.name),me=!0)}else ue=(ne=(Y=Ie.instance)==null?void 0:Y.getParameter(n.runtimeName(),le.name))!=null?ne:null;if(ue==null&&me&&(ue=(de=(Le=Ie.instance)==null?void 0:Le.getParameter(n.runtimeName(),le.name))!=null?de:null),typeof ue!="undefined"&&ue!==null){let se=(Ge=(Z=Ie.instance)==null?void 0:Z.resolveParameterCompletions(n.runtimeName(),ue,e))!=null?Ge:null;se!==null&&se.items.length>0?se.items.forEach(Ne=>{Ne.sortText="000",r.push(Ne)}):Ib(ue).forEach(Ne=>{Ne.sortText="000",r.push(Ne)})}if(le.hasInterpolations()&&e.isInVariableInterpolation&&n.isTagNode){let se=(lt=Ie.instance)==null?void 0:lt.findTag(n.runtimeName());if(se.resolveCompletionItems!=null){let Ne=se.resolveCompletionItems(e);Ne.items.length>0&&(r=Ne.items)}}}}else if(e.isInVariableInterpolation==!1||e.currentNode==n){let le=Gb(n,e.position);if(e.isCaretInTag=le,e.currentNode=n,Ie.instance!=null){let ue=Ie.instance.getCompletionItems(e);ue.isExclusive?r=ue.items:r=r.concat(ue.items)}}}else e.isInVariableInterpolation&&e.currentNode==null&&(r=r.concat(Us(e,n.currentScope.ancestor())));if(i){e.context.node!=null&&e.context.node.currentScope!=null&&(e.context.modifierContext==null||e.context.modifierContext.activeModifier==null)&&(r=r.concat(Us(e,e.context.node.currentScope)));let le=decodeURIComponent(e.document);if(e.project.hasViewCollectionInjections(le)){let ue=e.project.getCollectionNamesForView(le);for(let me=0;me0)for(let Ne=0;Ne{r.push({label:me,kind:Dt.CompletionItemKind.Field})})}}return e.context.node!=null&&(e.context.node.manifestType=="array"&&e.context.node.isClosedBy!=null?e.context.modifierContext!=null&&((ut=(Ve=Me.instance)==null?void 0:Ve.getModifiersForType("array"))!=null?ut:[]).forEach(ue=>{let me=ju(ue);me.sortText="000",r.push(me)}):e.context.modifierContext!=null&&((Yi=(bi=Me.instance)==null?void 0:bi.getModifiersForType(e.context.node.manifestType))!=null?Yi:[]).forEach(ue=>{let me=ju(ue);me.sortText="000",r.push(me)})),r}for(let le=0;lee.currentNode.currentScope.generation&&(me=!1),ue.isTagNode&&me){let se=Gb(ue,e.position);if(e.isCaretInTag=se,e.currentNode=ue,Ie.instance!=null){let Ne=Ie.instance.getCompletionItems(e);if(Ne.isExclusive){r=Ne.items;break}r=r.concat(Ne.items)}continue}}return r}};var Hb=Q(nn());function be(t){let e="";typeof t!="undefined"&&typeof t.resolveDocumentation!="undefined"&&t.resolveDocumentation!=null&&(e=t.resolveDocumentation());let n=t.tagName;if(n.includes(":")){let r=n.split(":");n=r[r.length-1]}return{label:n,kind:Hb.CompletionItemKind.Text,sortText:"1",documentation:{kind:"markdown",value:e}}}var hd=Q(ot());function Yb(t,e,n){return{name:t,acceptsVariableInterpolation:!0,aliases:[],allowsVariableReference:!0,description:e,expectsTypes:["string"],isDynamic:!0,isRequired:!1,documentationLink:n,docLinkName:"MDN Reference"}}var Kb=Yb("class","A space-separated list of the classes of the element.","https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class"),$b=Yb("style","Contains CSS styling declarations to be applied to the element. Note that it is recommended for styles to be defined in a separate file or files.","https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/style");function Xu(t){return t=="class"?Kb:t=="style"?$b:{name:t,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,description:"",expectsTypes:["string","number","array"],isRequired:!1,isDynamic:!0}}function zb(t){let e=[];for(let n=0;n{n instanceof B&&n.manifestType==="array"&&(n.mustClose=!0)})}function IE(t){return t.findParameterValueOrNull("as")}var SE=["count","next","previous"];function CE(t,e){let n=[];if(t.hasMethodPart()){let a=t.getMethodNameValue();if(SE.includes(a)==!1)return n.push(a),n}let r=t.findAnyParameter(db),i=t.findAnyParameter(mb),s=[],o=[];return typeof r!="undefined"&&r!==null&&(r.value.trim()==="*"?(s=e.getUniqueCollectionNames(),typeof i!="undefined"&&i!==null&&i.isVariableReference==!1&&i.hasInterpolations()==!1&&(o=i.getArrayValue())):r.isVariableReference==!1&&r.hasInterpolations()==!1&&(s=r.getArrayValue())),o.length>0?n=s.filter(function(a){return o.includes(a)==!1}):n=s,n}function us(t,e){var u,c,f,m,d,p;let n=CE(t,e),r=!1,i=!1,s=!1,o=null,a="";if(t.isClosingTag==!1){let _=IE(t),C=Xb(t);_!=null&&(r=!0,a=_),C!=null&&(s=!0,o=C),i=t.hasParameter("paginate")}return{context:{collectionNames:n!=null?n:[],endPosition:(c=(u=t.endPosition)==null?void 0:u.char)!=null?c:0,aliasName:a,isAliased:r,isScoped:s,scopeName:o,isStartOfScope:!t.isClosingTag,line:(m=(f=t.startPosition)==null?void 0:f.line)!=null?m:0,startPosition:(p=(d=t.startPosition)==null?void 0:d.char)!=null?p:0,isPaginated:i,excludeCollections:[],includeCollections:[]},issues:[]}}function zo(t,e){if(t==null)return null;let n=ar(e,":");return n.includes(":")&&(n=n.split(":")[0]),n=="status"||n=="taxonomy"||t.currentScope!=null&&t.currentScope.containsReference(n)?Xu(e):null}var RE=["from","folder","use","not_from","not_folder"],AE=["previous","next"],xE=["in","collection"];function cs(t,e){var n,r,i,s,o,a,l,u,c,f;if(t.isDynamic){let m=zu(t.name);if(e.nodesInScope.length>0){let d=e.nodesInScope[e.nodesInScope.length-1];if(d!=null&&d.currentScope!=null){let p=Go(d,d.currentScope),_=p.map(h=>h.name),C=Di(e.leftWord);if(_.includes(C))return te(os(e))}}if(m=="status"&&((n=e.context)==null?void 0:n.parameterContext)!=null)return te(_b((i=(r=e.context.parameterContext.parameter)==null?void 0:r.getArrayValue())!=null?i:[]));if(m=="taxonomy"){let d=Di(t.name);if(e.project.hasTaxonomy(d)&&((s=e.context)==null?void 0:s.parameterContext)!=null)return te(yb((a=(o=e.context.parameterContext.parameter)==null?void 0:o.getArrayValue())!=null?a:[],d,e.project))}}if(t.name=="filter"||t.name=="query_scope")return te(Wu(e.project));if(e.nodesInScope.length>0){let m=e.nodesInScope[e.nodesInScope.length-1];if(m.hasMethodPart()&&AE.includes(m.getMethodNameValue())&&xE.includes(t.name))return te(bb(e.project))}return RE.includes(t.name)&&((l=e.context)==null?void 0:l.parameterContext)!=null?te(Wo((f=(c=(u=e.context)==null?void 0:u.parameterContext.parameter)==null?void 0:c.getArrayValue())!=null?f:[],e.project)):null}var EE={tagName:"collection:previous",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[...ss,{name:"in",aliases:["collection"],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"The collection to search in",expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"current",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Sets the current entry by ID",expectsTypes:["string"],isDynamic:!1,isRequired:!1}],augmentScope:Ho,resolveDynamicParameter:zo,resolveSpecialType:us,suggestAlternativeParams:Uo,resovleParameterCompletionItems:cs,resolveCompletionItems:Xo,resolveDocumentation:t=>Ee("collection:previous Tag","The `collection:previous` tag is used to show the entries that appear before the current entry, based on some entry order (publish date, alphabetical, or manual).",`{{# Retrieve the previous two entries, based on dates in ascending order. #}} +{{ /if `;r.push({label:"ifelse",insertTextFormat:Dt.InsertTextFormat.Snippet,kind:Dt.CompletionItemKind.Snippet,textEdit:Dt.TextEdit.replace(le,ue),command:{title:"Suggest",command:"editor.action.triggerSuggest"}}),n.scopeVariable!=null&&(r=r.concat(pd.getCompletions(e,n.scopeVariable)))}if(n.currentScope.hasListInHistory(n.runtimeName())==!1&&n.currentScope.hasPristineReference(n.runtimeName())==!1?i=(h=(C=Ie.instance)==null?void 0:C.injectParentScope(n.runtimeName()))!=null?h:!1:i=!1,((b=e.context)==null?void 0:b.parameterContext)!=null&&e.context.parameterContext.parameter!=null&&(e.context.parameterContext.parameter.isVariableReference==!1?i=!1:i=!0),e.currentNode!=null&&(e.currentNode.isEmpty()||e.currentNode.parent!=null)&&(i=!0),n.runtimeName().includes(":")&&n.currentScope.containsPath(wr(n.runtimeName(),":"))){let le=wr(n.runtimeName(),":"),ue=ar(wr(e.leftWord,":"),"{");if(le==ue){let me=n.currentScope.findNestedScope(le);if(me!=null)return me.lists.forEach((se,Ne)=>{r.push(is(Ne,"",""))}),me.values.forEach(se=>{var Ne;se.sourceField!=null?r.push({label:se.name,detail:se.sourceField.blueprintName,documentation:(Ne=se.sourceField.instructionText)!=null?Ne:"",kind:Dt.CompletionItemKind.Field}):r.push(is(se.name,"",""))}),r}}if(n.isTagNode){if(e.isInVariableInterpolation&&e.currentNode==null)r=r.concat(Us(e,n.currentScope.ancestor()));else if(((g=e.context)==null?void 0:g.parameterContext)!=null&&e.context.parameterContext.parameter!=null){let le=e.context.parameterContext.parameter;if(le.isVariableReference&&e.position.character<=((V=(S=(N=le.valuePosition)==null?void 0:N.end)==null?void 0:S.char)!=null?V:-1)){if(r=r.concat(Us(e,n.currentScope.ancestor())),Ie.instance!=null){let ue=Ie.instance.getCompletionItems(e);r=r.concat(ue.items)}}else if(e.position.character<=((X=($=(O=le.valuePosition)==null?void 0:O.end)==null?void 0:$.char)!=null?X:-1)){let ue=null,me=!1;if((ee=Ie.instance)==null?void 0:ee.canResolveDynamicParameter(n.runtimeName())){let se=Ie.instance.findTag(n.runtimeName());typeof se!="undefined"&&typeof se.resolveDynamicParameter!="undefined"&&se.resolveDynamicParameter!=null&&(ue=se.resolveDynamicParameter(n,le.name),me=!0)}else ue=(ne=(Y=Ie.instance)==null?void 0:Y.getParameter(n.runtimeName(),le.name))!=null?ne:null;if(ue==null&&me&&(ue=(de=(De=Ie.instance)==null?void 0:De.getParameter(n.runtimeName(),le.name))!=null?de:null),typeof ue!="undefined"&&ue!==null){let se=(Ge=(Z=Ie.instance)==null?void 0:Z.resolveParameterCompletions(n.runtimeName(),ue,e))!=null?Ge:null;se!==null&&se.items.length>0?se.items.forEach(Ne=>{Ne.sortText="000",r.push(Ne)}):Ib(ue).forEach(Ne=>{Ne.sortText="000",r.push(Ne)})}if(le.hasInterpolations()&&e.isInVariableInterpolation&&n.isTagNode){let se=(lt=Ie.instance)==null?void 0:lt.findTag(n.runtimeName());if(se.resolveCompletionItems!=null){let Ne=se.resolveCompletionItems(e);Ne.items.length>0&&(r=Ne.items)}}}}else if(e.isInVariableInterpolation==!1||e.currentNode==n){let le=Gb(n,e.position);if(e.isCaretInTag=le,e.currentNode=n,Ie.instance!=null){let ue=Ie.instance.getCompletionItems(e);ue.isExclusive?r=ue.items:r=r.concat(ue.items)}}}else e.isInVariableInterpolation&&e.currentNode==null&&(r=r.concat(Us(e,n.currentScope.ancestor())));if(i){e.context.node!=null&&e.context.node.currentScope!=null&&(e.context.modifierContext==null||e.context.modifierContext.activeModifier==null)&&(r=r.concat(Us(e,e.context.node.currentScope)));let le=decodeURIComponent(e.document);if(e.project.hasViewCollectionInjections(le)){let ue=e.project.getCollectionNamesForView(le);for(let me=0;me0)for(let Ne=0;Ne{r.push({label:me,kind:Dt.CompletionItemKind.Field})})}}return e.context.node!=null&&(e.context.node.manifestType=="array"&&e.context.node.isClosedBy!=null?e.context.modifierContext!=null&&((ut=(Ve=we.instance)==null?void 0:Ve.getModifiersForType("array"))!=null?ut:[]).forEach(ue=>{let me=Uu(ue);me.sortText="000",r.push(me)}):e.context.modifierContext!=null&&((Yi=(bi=we.instance)==null?void 0:bi.getModifiersForType(e.context.node.manifestType))!=null?Yi:[]).forEach(ue=>{let me=Uu(ue);me.sortText="000",r.push(me)})),r}for(let le=0;lee.currentNode.currentScope.generation&&(me=!1),ue.isTagNode&&me){let se=Gb(ue,e.position);if(e.isCaretInTag=se,e.currentNode=ue,Ie.instance!=null){let Ne=Ie.instance.getCompletionItems(e);if(Ne.isExclusive){r=Ne.items;break}r=r.concat(Ne.items)}continue}}return r}};var Hb=Q(nn());function be(t){let e="";typeof t!="undefined"&&typeof t.resolveDocumentation!="undefined"&&t.resolveDocumentation!=null&&(e=t.resolveDocumentation());let n=t.tagName;if(n.includes(":")){let r=n.split(":");n=r[r.length-1]}return{label:n,kind:Hb.CompletionItemKind.Text,sortText:"1",documentation:{kind:"markdown",value:e}}}var gd=Q(ot());function Yb(t,e,n){return{name:t,acceptsVariableInterpolation:!0,aliases:[],allowsVariableReference:!0,description:e,expectsTypes:["string"],isDynamic:!0,isRequired:!1,documentationLink:n,docLinkName:"MDN Reference"}}var Kb=Yb("class","A space-separated list of the classes of the element.","https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class"),$b=Yb("style","Contains CSS styling declarations to be applied to the element. Note that it is recommended for styles to be defined in a separate file or files.","https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/style");function Qu(t){return t=="class"?Kb:t=="style"?$b:{name:t,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,description:"",expectsTypes:["string","number","array"],isRequired:!1,isDynamic:!0}}function zb(t){let e=[];for(let n=0;n{n instanceof B&&n.manifestType==="array"&&(n.mustClose=!0)})}function CE(t){return t.findParameterValueOrNull("as")}var RE=["count","next","previous"];function AE(t,e){let n=[];if(t.hasMethodPart()){let a=t.getMethodNameValue();if(RE.includes(a)==!1)return n.push(a),n}let r=t.findAnyParameter(db),i=t.findAnyParameter(mb),s=[],o=[];return typeof r!="undefined"&&r!==null&&(r.value.trim()==="*"?(s=e.getUniqueCollectionNames(),typeof i!="undefined"&&i!==null&&i.isVariableReference==!1&&i.hasInterpolations()==!1&&(o=i.getArrayValue())):r.isVariableReference==!1&&r.hasInterpolations()==!1&&(s=r.getArrayValue())),o.length>0?n=s.filter(function(a){return o.includes(a)==!1}):n=s,n}function us(t,e){var u,c,f,m,p,d;let n=AE(t,e),r=!1,i=!1,s=!1,o=null,a="";if(t.isClosingTag==!1){let _=CE(t),C=Xb(t);_!=null&&(r=!0,a=_),C!=null&&(s=!0,o=C),i=t.hasParameter("paginate")}return{context:{collectionNames:n!=null?n:[],endPosition:(c=(u=t.endPosition)==null?void 0:u.char)!=null?c:0,aliasName:a,isAliased:r,isScoped:s,scopeName:o,isStartOfScope:!t.isClosingTag,line:(m=(f=t.startPosition)==null?void 0:f.line)!=null?m:0,startPosition:(d=(p=t.startPosition)==null?void 0:p.char)!=null?d:0,isPaginated:i,excludeCollections:[],includeCollections:[]},issues:[]}}function zo(t,e){if(t==null)return null;let n=ar(e,":");return n.includes(":")&&(n=n.split(":")[0]),n=="status"||n=="taxonomy"||t.currentScope!=null&&t.currentScope.containsReference(n)?Qu(e):null}var xE=["from","folder","use","not_from","not_folder"],EE=["previous","next"],wE=["in","collection"];function cs(t,e){var n,r,i,s,o,a,l,u,c,f;if(t.isDynamic){let m=Xu(t.name);if(e.nodesInScope.length>0){let p=e.nodesInScope[e.nodesInScope.length-1];if(p!=null&&p.currentScope!=null){let d=Go(p,p.currentScope),_=d.map(h=>h.name),C=Di(e.leftWord);if(_.includes(C))return te(os(e))}}if(m=="status"&&((n=e.context)==null?void 0:n.parameterContext)!=null)return te(_b((i=(r=e.context.parameterContext.parameter)==null?void 0:r.getArrayValue())!=null?i:[]));if(m=="taxonomy"){let p=Di(t.name);if(e.project.hasTaxonomy(p)&&((s=e.context)==null?void 0:s.parameterContext)!=null)return te(yb((a=(o=e.context.parameterContext.parameter)==null?void 0:o.getArrayValue())!=null?a:[],p,e.project))}}if(t.name=="filter"||t.name=="query_scope")return te(Hu(e.project));if(e.nodesInScope.length>0){let m=e.nodesInScope[e.nodesInScope.length-1];if(m.hasMethodPart()&&EE.includes(m.getMethodNameValue())&&wE.includes(t.name))return te(bb(e.project))}return xE.includes(t.name)&&((l=e.context)==null?void 0:l.parameterContext)!=null?te(Wo((f=(c=(u=e.context)==null?void 0:u.parameterContext.parameter)==null?void 0:c.getArrayValue())!=null?f:[],e.project)):null}var OE={tagName:"collection:previous",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[...ss,{name:"in",aliases:["collection"],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"The collection to search in",expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"current",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Sets the current entry by ID",expectsTypes:["string"],isDynamic:!1,isRequired:!1}],augmentScope:Ho,resolveDynamicParameter:zo,resolveSpecialType:us,suggestAlternativeParams:Uo,resovleParameterCompletionItems:cs,resolveCompletionItems:Xo,resolveDocumentation:t=>Re("collection:previous Tag","The `collection:previous` tag is used to show the entries that appear before the current entry, based on some entry order (publish date, alphabetical, or manual).",`{{# Retrieve the previous two entries, based on dates in ascending order. #}} {{ collection:previous in="articles" limit="2" sort="date:asc" }} -{{ /collection:previous }}`,"https://statamic.dev/tags/collection-previous")},Gs=EE;var Qu=et(Gs,"collection:older"),Ju=et(Gs,"collection:newer");var wE={tagName:"collection:count",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[...ss,{isRequired:!0,name:"in",aliases:["from"],description:"The collection from which to count entries",acceptsVariableInterpolation:!0,allowsVariableReference:!0,expectsTypes:["string"],isDynamic:!1}],resolveSpecialType:us,resovleParameterCompletionItems:cs,resolveDocumentation:t=>Ee("collection:count Tag","The `collection:count` tag returns the total number of entries in the specified collection(s). The collection count tag accepts the same parameters as the collection tag, allowing developers to count entries that meet specific conditions.",`Total entry count: {{ collection:count in="collection-name" }} -Draft count: {{ collection:count in="collection-name" status:in="draft" }}`,"https://statamic.dev/tags/collection-count")},Zu=wE;var OE={tagName:"collection:next",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[...ss,{name:"in",aliases:["collection"],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"The collection to search in",expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"current",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Sets the current entry by ID",expectsTypes:["string"],isDynamic:!1,isRequired:!1}],augmentScope:Ho,resolveDynamicParameter:zo,resolveSpecialType:us,suggestAlternativeParams:Uo,resovleParameterCompletionItems:cs,resolveCompletionItems:Xo,resolveDocumentation:t=>Ee("collection:next Tag","The `collection:next` tag is used to show the entries that will appear after the current entry, based on some entry order (publish date, alphabetical, or manual).",`{{# Retrieve the next two entries, based on dates in ascending order. #}} +{{ /collection:previous }}`,"https://statamic.dev/tags/collection-previous")},Gs=OE;var Ju=et(Gs,"collection:older"),Zu=et(Gs,"collection:newer");var LE={tagName:"collection:count",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[...ss,{isRequired:!0,name:"in",aliases:["from"],description:"The collection from which to count entries",acceptsVariableInterpolation:!0,allowsVariableReference:!0,expectsTypes:["string"],isDynamic:!1}],resolveSpecialType:us,resovleParameterCompletionItems:cs,resolveDocumentation:t=>Re("collection:count Tag","The `collection:count` tag returns the total number of entries in the specified collection(s). The collection count tag accepts the same parameters as the collection tag, allowing developers to count entries that meet specific conditions.",`Total entry count: {{ collection:count in="collection-name" }} +Draft count: {{ collection:count in="collection-name" status:in="draft" }}`,"https://statamic.dev/tags/collection-count")},ec=LE;var DE={tagName:"collection:next",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[...ss,{name:"in",aliases:["collection"],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"The collection to search in",expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"current",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Sets the current entry by ID",expectsTypes:["string"],isDynamic:!1,isRequired:!1}],augmentScope:Ho,resolveDynamicParameter:zo,resolveSpecialType:us,suggestAlternativeParams:Uo,resovleParameterCompletionItems:cs,resolveCompletionItems:Xo,resolveDocumentation:t=>Re("collection:next Tag","The `collection:next` tag is used to show the entries that will appear after the current entry, based on some entry order (publish date, alphabetical, or manual).",`{{# Retrieve the next two entries, based on dates in ascending order. #}} {{ collection:next in="articles" limit="2" sort="date:asc" }} -{{ /collection:next }}`,"https://statamic.dev/tags/collection-next")},ec=OE;function Xo(t){var n,r;let e=[];if(t.isPastTagPart==!1&&(t.leftWord=="collection"||t.leftWord=="/collection")&&t.leftChar==":"){let i=t.project.getCollectionNames();for(let s=0;sa.name),o=Di(t.leftWord);if(o==="taxonomy")return te(gb(t));if(s.includes(o))return e=os(t),te(e);if(t.isCaretInTag&&!((n=t.context)==null?void 0:n.isInParameter)&&["collection","/collection"].includes(t.leftWord)==!1&&t.leftChar!=" "){let a=[];for(let l=0;l0)return dn(e)}}return he}var LE={tagName:"collection",hideFromCompletions:!1,introducedIn:null,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,parameters:ss,augmentScope:Ho,resolveDynamicParameter:zo,resolveSpecialType:us,suggestAlternativeParams:Uo,resovleParameterCompletionItems:cs,resolveCompletionItems:Xo,resolveDocumentation:t=>Ee("collection Tag","The `collection` tag provides access to entry data such as blog posts, products, etc.",`{{ collection:articles as="posts" }} +{{ /collection:next }}`,"https://statamic.dev/tags/collection-next")},tc=DE;function Xo(t){var n,r;let e=[];if(t.isPastTagPart==!1&&(t.leftWord=="collection"||t.leftWord=="/collection")&&t.leftChar==":"){let i=t.project.getCollectionNames();for(let s=0;sa.name),o=Di(t.leftWord);if(o==="taxonomy")return te(gb(t));if(s.includes(o))return e=os(t),te(e);if(t.isCaretInTag&&!((n=t.context)==null?void 0:n.isInParameter)&&["collection","/collection"].includes(t.leftWord)==!1&&t.leftChar!=" "){let a=[];for(let l=0;l0)return dn(e)}}return he}var kE={tagName:"collection",hideFromCompletions:!1,introducedIn:null,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,parameters:ss,augmentScope:Ho,resolveDynamicParameter:zo,resolveSpecialType:us,suggestAlternativeParams:Uo,resovleParameterCompletionItems:cs,resolveCompletionItems:Xo,resolveDocumentation:t=>Re("collection Tag","The `collection` tag provides access to entry data such as blog posts, products, etc.",`{{ collection:articles as="posts" }} {{ posts }} {{ title }} {{ /posts }} -{{ /collection:articles }}`,"https://statamic.dev/tags/collection")},Jb=LE;var DE={tagName:"cache",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,introducedIn:null,allowsContentClose:!1,allowsArbitraryParameters:!1,resovleParameterCompletionItems:(t,e)=>t.name=="scope"?pt(["page","site"]):null,parameters:[{isRequired:!1,name:"for",description:"The duration the cache is valid for",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"key",description:"An arbitrary name the cache entry may be referenced by",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"scope",description:" The scope of the cached value. Either site or page.",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1}],resolveSpecialType:(t,e)=>{let n=t.findParameter("key"),r=null;if(n!=null){let i=n.value;i.trim().length>0&&(r={key:i,reference:t})}return{context:r,issues:[]}},resolveDocumentation:t=>Ee("cache Tag","The `cache` tag can be used to save the results of an expensive template operation. The duration of the cache can be configured.",`{{ cache for="10 minutes" }} +{{ /collection:articles }}`,"https://statamic.dev/tags/collection")},Jb=kE;var ME={tagName:"cache",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,introducedIn:null,allowsContentClose:!1,allowsArbitraryParameters:!1,resovleParameterCompletionItems:(t,e)=>t.name=="scope"?pt(["page","site"]):null,parameters:[{isRequired:!1,name:"for",description:"The duration the cache is valid for",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"key",description:"An arbitrary name the cache entry may be referenced by",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"scope",description:" The scope of the cached value. Either site or page.",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1}],resolveSpecialType:(t,e)=>{let n=t.findParameter("key"),r=null;if(n!=null){let i=n.value;i.trim().length>0&&(r={key:i,reference:t})}return{context:r,issues:[]}},resolveDocumentation:t=>Re("cache Tag","The `cache` tag can be used to save the results of an expensive template operation. The duration of the cache can be configured.",`{{ cache for="10 minutes" }} {{# Template code that won't be re-rendered for at least 10 minutes. #}} -{{ /cache }}`,"https://statamic.dev/tags/cache")},Zb=DE;var kE={tagName:"dump",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[],resolveCompletionItems:t=>t.leftWord=="dump"&&t.leftChar==":"?te(Wb(t)):he,resolveDocumentation:t=>Ee("dump Tag","The `dump` tag is a useful tag for debugging, and will display the raw data available at the point the tag is rendered.",`{{ collection:articles }} +{{ /cache }}`,"https://statamic.dev/tags/cache")},Zb=ME;var FE={tagName:"dump",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[],resolveCompletionItems:t=>t.leftWord=="dump"&&t.leftChar==":"?te(Wb(t)):he,resolveDocumentation:t=>Re("dump Tag","The `dump` tag is a useful tag for debugging, and will display the raw data available at the point the tag is rendered.",`{{ collection:articles }} {{# View all data available, for each entry. #}} {{ dump }} -{{ /collection:articles }}`,"https://statamic.dev/tags/dump")},eT=kE;var ME={tagName:"404",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[],resolveDocumentation:t=>Ee("404 (Not Found) Tag","The `404` (Not Found) tag will trigger a 404 status code, and display the 404 template to the site visitor.",`{{ unless logged_in }} +{{ /collection:articles }}`,"https://statamic.dev/tags/dump")},eT=FE;var VE={tagName:"404",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[],resolveDocumentation:t=>Re("404 (Not Found) Tag","The `404` (Not Found) tag will trigger a 404 status code, and display the 404 template to the site visitor.",`{{ unless logged_in }} {{# Display the 404 Not Found page. #}} {{ 404 }} -{{ /unless }}`,"https://statamic.dev/tags/404")},tT=ME;var FE={tagName:"link",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[{name:"to",description:"The relative path",expectsTypes:["string"],allowsVariableReference:!1,acceptsVariableInterpolation:!1,aliases:[],isRequired:!0,isDynamic:!1},{name:"absolute",description:"Whether to generate absolute URLs. Default false",expectsTypes:["boolean"],allowsVariableReference:!1,acceptsVariableInterpolation:!1,aliases:[],isRequired:!1,isDynamic:!1},{name:"id",description:"The ID of the entry to link to",expectsTypes:["string"],allowsVariableReference:!0,acceptsVariableInterpolation:!0,aliases:[],isDynamic:!1,isRequired:!1},{name:"in",description:"The handle of the site to link to.",expectsTypes:["string"],allowsVariableReference:!0,acceptsVariableInterpolation:!0,aliases:[],isDynamic:!1,isRequired:!1}],resolveDocumentation:t=>k("link Tag","The `link` tag accepts relative URLs or entry IDs and generates fully-qualified URLs to the desired content.","https://statamic.dev/tags/link")},nT=FE;var rT={tagName:"loop",hideFromCompletions:!1,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,introducedIn:null,augmentScope:(t,e)=>(e.addVariable({name:"value",dataType:"*",sourceName:"*internal.loop.value",sourceField:null,introducedBy:t}),e),parameters:[{name:"times",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["number"],description:"The number of iterations",isRequired:!1,isDynamic:!1},{name:"from",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["number"],description:"The value to start iterating from. Default 1",isRequired:!1,isDynamic:!1},{name:"to",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["number"],description:"The value to stop iterating at",isRequired:!1,isDynamic:!1}],resolveDocumentation:t=>k("loop Tag","The `loop` tag is used to create an array of items between two values, and then iterate the created array. Alternatively, a max value can be set using the `times` parameter to loop that number of times.","https://statamic.dev/tags/loop")},iT={tagName:"range",hideFromCompletions:!1,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,introducedIn:null,augmentScope:(t,e)=>(e.addVariable({name:"value",dataType:"*",sourceName:"*internal.loop.value",sourceField:null,introducedBy:t}),e),parameters:[{name:"times",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["number"],description:"The number of iterations",isRequired:!1,isDynamic:!1},{name:"from",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["number"],description:"The value to start iterating from. Default 1",isRequired:!1,isDynamic:!1},{name:"to",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["number"],description:"The value to stop iterating at",isRequired:!1,isDynamic:!1}],resolveDocumentation:t=>k("range Tag","The `range` tag is used to create an array of items between two values, and then iterate the created array. Alternatively, a max value can be set using the `times` parameter to loop that number of times.","https://statamic.dev/tags/loop")};var zn=Q(nn());function je(t,e){return e.trim().length>0?Xu(e):null}var Qo=[{isRequired:!1,name:"src",description:"The name of the partial view",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["string"],isDynamic:!1}];var dl=Q(nn());function Jo(t,e){var n;if(t.isDynamic&&e.currentNode!=null&&e.currentNode.getTagName()=="partial"&&e.currentNode.hasMethodPart()){let r=e.currentNode.getMethodNameValue();if(r.trim().length>0&&((n=ce.instance)==null?void 0:n.hasStructure())){let i=ce.instance.getStructure().findRelativeView(r);if(i!=null&&i.varReferenceNames.has(t.name)){let s=i.varReferenceNames.get(t.name);if(i.document!=null&&i.document.hasFrontMatter()){let o=i.document.getFrontMatterScope();if(o!=null){let a=o.getList(s);if(a!=null)return zb(a.getVariableNames())}}}}}if(t.name=="src"){let r=e.project.getViews(),i=[];return r.forEach(s=>{if(si.hasDetails(s.documentUri)){let o=si.documentDetails.get(s.documentUri);i.push({label:o.documentName+"("+s.relativeDisplayName+")",insertText:s.relativeDisplayName,detail:o.documentName,documentation:{kind:dl.MarkupKind.Markdown,value:o.documentDescription},kind:dl.CompletionItemKind.File})}else i.push({label:s.relativeDisplayName,kind:dl.CompletionItemKind.File})}),te(i)}return null}var VE={tagName:"partial:exists",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,parameters:Qo,introducedIn:"3.2.7",resovleParameterCompletionItems:Jo,resolveDocumentation:t=>k("partial:exists Tag","The `partial:exists` can be used within conditional statements to test if a partial exists.","https://statamic.dev/tags/partial-exists")},tc=VE;var qE={tagName:"partial:if_exists",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,parameters:Qo,introducedIn:"3.2.7",resovleParameterCompletionItems:Jo,resolveDocumentation:t=>k("partial:if_exists Tag","The `partial:if_exists` can be used to output the contents of a partial if it exists.","https://statamic.dev/tags/partial-if-exists")},nc=qE;function Zo(t){if(t.getTagName()!="partial")return null;let e="";if(t.hasMethodPart())e=t.getMethodNameValue();else{let n=t.findParameter("src");n!=null&&(e=n.value)}return e}var BE=[be(tc),be(nc)],jE={tagName:"partial",hideFromCompletions:!1,injectParentScope:!1,allowsArbitraryParameters:!0,parameters:Qo,requiresClose:!1,allowsContentClose:!0,introducedIn:null,resolveDocumentation:t=>`**Partial Tag** +{{ /unless }}`,"https://statamic.dev/tags/404")},tT=VE;var qE={tagName:"link",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[{name:"to",description:"The relative path",expectsTypes:["string"],allowsVariableReference:!1,acceptsVariableInterpolation:!1,aliases:[],isRequired:!0,isDynamic:!1},{name:"absolute",description:"Whether to generate absolute URLs. Default false",expectsTypes:["boolean"],allowsVariableReference:!1,acceptsVariableInterpolation:!1,aliases:[],isRequired:!1,isDynamic:!1},{name:"id",description:"The ID of the entry to link to",expectsTypes:["string"],allowsVariableReference:!0,acceptsVariableInterpolation:!0,aliases:[],isDynamic:!1,isRequired:!1},{name:"in",description:"The handle of the site to link to.",expectsTypes:["string"],allowsVariableReference:!0,acceptsVariableInterpolation:!0,aliases:[],isDynamic:!1,isRequired:!1}],resolveDocumentation:t=>k("link Tag","The `link` tag accepts relative URLs or entry IDs and generates fully-qualified URLs to the desired content.","https://statamic.dev/tags/link")},nT=qE;var rT={tagName:"loop",hideFromCompletions:!1,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,introducedIn:null,augmentScope:(t,e)=>(e.addVariable({name:"value",dataType:"*",sourceName:"*internal.loop.value",sourceField:null,introducedBy:t}),e),parameters:[{name:"times",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["number"],description:"The number of iterations",isRequired:!1,isDynamic:!1},{name:"from",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["number"],description:"The value to start iterating from. Default 1",isRequired:!1,isDynamic:!1},{name:"to",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["number"],description:"The value to stop iterating at",isRequired:!1,isDynamic:!1}],resolveDocumentation:t=>k("loop Tag","The `loop` tag is used to create an array of items between two values, and then iterate the created array. Alternatively, a max value can be set using the `times` parameter to loop that number of times.","https://statamic.dev/tags/loop")},iT={tagName:"range",hideFromCompletions:!1,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,introducedIn:null,augmentScope:(t,e)=>(e.addVariable({name:"value",dataType:"*",sourceName:"*internal.loop.value",sourceField:null,introducedBy:t}),e),parameters:[{name:"times",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["number"],description:"The number of iterations",isRequired:!1,isDynamic:!1},{name:"from",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["number"],description:"The value to start iterating from. Default 1",isRequired:!1,isDynamic:!1},{name:"to",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["number"],description:"The value to stop iterating at",isRequired:!1,isDynamic:!1}],resolveDocumentation:t=>k("range Tag","The `range` tag is used to create an array of items between two values, and then iterate the created array. Alternatively, a max value can be set using the `times` parameter to loop that number of times.","https://statamic.dev/tags/loop")};var zn=Q(nn());function je(t,e){return e.trim().length>0?Qu(e):null}var Qo=[{isRequired:!1,name:"src",description:"The name of the partial view",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["string"],isDynamic:!1}];var dl=Q(nn());function Jo(t,e){var n;if(t.isDynamic&&e.currentNode!=null&&e.currentNode.getTagName()=="partial"&&e.currentNode.hasMethodPart()){let r=e.currentNode.getMethodNameValue();if(r.trim().length>0&&((n=ce.instance)==null?void 0:n.hasStructure())){let i=ce.instance.getStructure().findRelativeView(r);if(i!=null&&i.varReferenceNames.has(t.name)){let s=i.varReferenceNames.get(t.name);if(i.document!=null&&i.document.hasFrontMatter()){let o=i.document.getFrontMatterScope();if(o!=null){let a=o.getList(s);if(a!=null)return zb(a.getVariableNames())}}}}}if(t.name=="src"){let r=e.project.getViews(),i=[];return r.forEach(s=>{if(si.hasDetails(s.documentUri)){let o=si.documentDetails.get(s.documentUri);i.push({label:o.documentName+"("+s.relativeDisplayName+")",insertText:s.relativeDisplayName,detail:o.documentName,documentation:{kind:dl.MarkupKind.Markdown,value:o.documentDescription},kind:dl.CompletionItemKind.File})}else i.push({label:s.relativeDisplayName,kind:dl.CompletionItemKind.File})}),te(i)}return null}var BE={tagName:"partial:exists",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,parameters:Qo,introducedIn:"3.2.7",resovleParameterCompletionItems:Jo,resolveDocumentation:t=>k("partial:exists Tag","The `partial:exists` can be used within conditional statements to test if a partial exists.","https://statamic.dev/tags/partial-exists")},nc=BE;var jE={tagName:"partial:if_exists",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,parameters:Qo,introducedIn:"3.2.7",resovleParameterCompletionItems:Jo,resolveDocumentation:t=>k("partial:if_exists Tag","The `partial:if_exists` can be used to output the contents of a partial if it exists.","https://statamic.dev/tags/partial-if-exists")},rc=jE;function Zo(t){if(t.getTagName()!="partial")return null;let e="";if(t.hasMethodPart())e=t.getMethodNameValue();else{let n=t.findParameter("src");n!=null&&(e=n.value)}return e}var UE=[be(nc),be(rc)],GE={tagName:"partial",hideFromCompletions:!1,injectParentScope:!1,allowsArbitraryParameters:!0,parameters:Qo,requiresClose:!1,allowsContentClose:!0,introducedIn:null,resolveDocumentation:t=>`**Partial Tag** Includes another view into the current template. [Documentation Reference](https://statamic.dev/tags/partial) -`,resolveDynamicParameter:je,resovleParameterCompletionItems:Jo,resolveCompletionItems:t=>{let e=[];if(t.leftChar=='"'&&t.leftWord==':src="')return{items:[],analyzeDefaults:!0,isExclusiveResult:!1};if((t.leftWord=="partial"||t.leftWord=="/partial")&&t.leftChar==":"||t.leftWord=='src="'&&t.leftChar=='"')return t.project.getViews().forEach(r=>{let i=decodeURIComponent(r.documentUri);if(si.hasDetails(i)){let s=si.documentDetails.get(i);e.push({label:s.documentName+"("+r.relativeDisplayName+")",insertText:r.relativeDisplayName,detail:s.documentName,documentation:{kind:zn.MarkupKind.Markdown,value:s.documentDescription},kind:zn.CompletionItemKind.File})}else e.push({label:r.relativeDisplayName,kind:zn.CompletionItemKind.File})}),t.leftWord!='src="'&&(e=e.concat(BE)),{analyzeDefaults:!1,isExclusiveResult:!0,items:e};if(t.currentNode!=null&&t.project!=null){let n=Zo(t.currentNode);if(n!=null&&n.trim().length>0){let r=t.project.findRelativeView(n);if(r!=null&&Se.hasDocument(r.documentUri)){let i=Se.getDocument(r.documentUri);if(i!=null){let s=i.getAllAntlersNodes(),o=UE(s),a=[];r.varReferenceNames!=null&&r.varReferenceNames.forEach((u,c)=>{o.push(c)});let l=[];if(r.injectsParameters.length>0){let u={start:{line:t.position.line,character:t.position.character-0},end:t.position};r.injectsParameters.forEach(c=>{let f=c.name+'="$1"';a.includes(c.name)||(a.push(c.name),l.push({label:c.name,kind:zn.CompletionItemKind.Value,insertTextFormat:zn.InsertTextFormat.Snippet,textEdit:zn.TextEdit.replace(u,f),command:{title:"Suggest",command:"editor.action.triggerSuggest"}}))})}if(o.length>0){let u={start:{line:t.position.line,character:t.position.character-0},end:t.position};o.forEach(c=>{let f=c+'="$1"';a.includes(c)||(a.push(c),l.push({label:c,kind:zn.CompletionItemKind.Value,insertTextFormat:zn.InsertTextFormat.Snippet,textEdit:zn.TextEdit.replace(u,f),command:{title:"Suggest",command:"editor.action.triggerSuggest"}}))})}return dn(l)}}}}return{analyzeDefaults:!0,isExclusiveResult:!1,items:[]}}};function UE(t){let e=[];return t.forEach(n=>{if(n.isTagNode||n.isClosingTag||n.isComment||n.hasMethodPart()&&n.getMethodNameValue().length>0||n.name!=null&&n.name.content.includes("["))return;let r=n.getTagName();!e.includes(r)&&r!="#"&&r!="slot"&&e.push(r)}),e}var sT=jE;var GE={tagName:"increment:reset",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:"3.2.28",parameters:[{isRequired:!0,name:"counter",aliases:[],description:"The incrementing counter to reset",acceptsVariableInterpolation:!1,allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"to",aliases:[],description:"An optional value to reset the counter to before incrementing starts again",acceptsVariableInterpolation:!1,allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1}],resolveDocumentation:t=>Ee("increment:reset Tag","The `increment:reset` tag can be used to reset the value of an incrementing counter.",`{{ array_variable }} +`,resolveDynamicParameter:je,resovleParameterCompletionItems:Jo,resolveCompletionItems:t=>{let e=[];if(t.leftChar=='"'&&t.leftWord==':src="')return{items:[],analyzeDefaults:!0,isExclusiveResult:!1};if((t.leftWord=="partial"||t.leftWord=="/partial")&&t.leftChar==":"||t.leftWord=='src="'&&t.leftChar=='"')return t.project.getViews().forEach(r=>{let i=decodeURIComponent(r.documentUri);if(si.hasDetails(i)){let s=si.documentDetails.get(i);e.push({label:s.documentName+"("+r.relativeDisplayName+")",insertText:r.relativeDisplayName,detail:s.documentName,documentation:{kind:zn.MarkupKind.Markdown,value:s.documentDescription},kind:zn.CompletionItemKind.File})}else e.push({label:r.relativeDisplayName,kind:zn.CompletionItemKind.File})}),t.leftWord!='src="'&&(e=e.concat(UE)),{analyzeDefaults:!1,isExclusiveResult:!0,items:e};if(t.currentNode!=null&&t.project!=null){let n=Zo(t.currentNode);if(n!=null&&n.trim().length>0){let r=t.project.findRelativeView(n);if(r!=null&&Se.hasDocument(r.documentUri)){let i=Se.getDocument(r.documentUri);if(i!=null){let s=i.getAllAntlersNodes(),o=WE(s),a=[];r.varReferenceNames!=null&&r.varReferenceNames.forEach((u,c)=>{o.push(c)});let l=[];if(r.injectsParameters.length>0){let u={start:{line:t.position.line,character:t.position.character-0},end:t.position};r.injectsParameters.forEach(c=>{let f=c.name+'="$1"';a.includes(c.name)||(a.push(c.name),l.push({label:c.name,kind:zn.CompletionItemKind.Value,insertTextFormat:zn.InsertTextFormat.Snippet,textEdit:zn.TextEdit.replace(u,f),command:{title:"Suggest",command:"editor.action.triggerSuggest"}}))})}if(o.length>0){let u={start:{line:t.position.line,character:t.position.character-0},end:t.position};o.forEach(c=>{let f=c+'="$1"';a.includes(c)||(a.push(c),l.push({label:c,kind:zn.CompletionItemKind.Value,insertTextFormat:zn.InsertTextFormat.Snippet,textEdit:zn.TextEdit.replace(u,f),command:{title:"Suggest",command:"editor.action.triggerSuggest"}}))})}return dn(l)}}}}return{analyzeDefaults:!0,isExclusiveResult:!1,items:[]}}};function WE(t){let e=[];return t.forEach(n=>{if(n.isTagNode||n.isClosingTag||n.isComment||n.hasMethodPart()&&n.getMethodNameValue().length>0||n.name!=null&&n.name.content.includes("["))return;let r=n.getTagName();!e.includes(r)&&r!="#"&&r!="slot"&&e.push(r)}),e}var sT=GE;var HE={tagName:"increment:reset",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:"3.2.28",parameters:[{isRequired:!0,name:"counter",aliases:[],description:"The incrementing counter to reset",acceptsVariableInterpolation:!1,allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"to",aliases:[],description:"An optional value to reset the counter to before incrementing starts again",acceptsVariableInterpolation:!1,allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1}],resolveDocumentation:t=>Re("increment:reset Tag","The `increment:reset` tag can be used to reset the value of an incrementing counter.",`{{ array_variable }} {{ increment:counter_name }} {{ /array_variable }} {{ increment:reset counter="counter_name" }} -`,null)},rc=GE;var WE=[be(rc)],HE={tagName:"increment",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[{isRequired:!1,name:"from",aliases:[],description:"The number to start incrementing by",acceptsVariableInterpolation:!1,allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1},{isRequired:!1,name:"by",aliases:[],description:"The number to increment by",acceptsVariableInterpolation:!1,allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1}],resolveCompletionItems:t=>t.leftWord=="increment"||t.leftWord=="/increment"&&t.leftChar==":"?te(WE):he,resolveDocumentation:t=>k("increment Tag","The `increment` tag can be used to increment a value each time the tag is encountered.","https://statamic.dev/tags/increment")},oT=HE;var ml=class{constructor(e){this.node=e}},aT={tagName:"yields",hideFromCompletions:!1,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!0,parameters:[],introducedIn:null,requiresClose:!1,resolveSpecialType:(t,e)=>({context:new ml(t),issues:[]})},lT={tagName:"yield",hideFromCompletions:!1,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!0,parameters:[],introducedIn:null,requiresClose:!1,resolveSpecialType:(t,e)=>({context:new ml(t),issues:[]}),resolveDocumentation:t=>k("yield Tag","The `yield` tag may be used to push rendered content to named regions within a template's structure.","https://statamic.dev/tags/yield")};var ic=Q(ot());var uT=[{handle:"access cp"},{handle:"configure collections"},{handle:"[view edit create delete publish reorder] {collection} entries"},{handle:"configure structures"},{handle:"[view edit] {structure} structure"},{handle:"edit {global} globals"},{handle:"[view upload edit move rename delete] {container} assets"},{handle:"[view perform] updates"},{handle:"[view edit create delete] users"},{handle:"change passwords"},{handle:"edit roles"},{handle:"configure forms"},{handle:"[view delete] {form} submissions"}];var fs=class{constructor(){this.contextItems=new Map;this.triggerNames=[];this.collectionTriggers=[];this.collectionTriggerCaps=[];this.globalTriggers=[];this.globalTriggerCaps=[];this.formTriggers=[];this.formTriggerCaps=[];this.structureTriggers=[];this.structureTriggerCaps=[];this.assetTriggers=[];this.assetTriggerCaps=[]}getCollectionTriggerCaps(){return this.collectionTriggerCaps}getGlobalTriggerCaps(){return this.globalTriggerCaps}getFormTriggerCaps(){return this.formTriggerCaps}getStructureTriggerCaps(){return this.structureTriggerCaps}getAssetTriggerCaps(){return this.assetTriggerCaps}loadCorePermissions(){this.registerPermissions(uT)}getTriggerNames(){return this.triggerNames}isCollectionTrigger(e){return this.collectionTriggers.includes(e)}isGlobalTrigger(e){return this.globalTriggers.includes(e)}isFormTrigger(e){return this.formTriggers.includes(e)}isStructureTrigger(e){return this.structureTriggers.includes(e)}isAssetTrigger(e){return this.assetTriggers.includes(e)}getTriggerContextItems(e){return this.contextItems.has(e)?this.contextItems.get(e):[]}registerSpecialTrigger(e,n,r){n=="{collection}"?(this.collectionTriggerCaps.includes(r)==!1&&this.collectionTriggerCaps.push(r),this.collectionTriggers.includes(e)==!1&&this.collectionTriggers.push(e)):n=="{structure}"?(this.structureTriggerCaps.includes(r)==!1&&this.structureTriggerCaps.push(r),this.structureTriggers.includes(e)==!1&&this.structureTriggers.push(e)):n=="{container}"?(this.assetTriggerCaps.includes(r)==!1&&this.assetTriggerCaps.push(r),this.assetTriggers.includes(e)==!1&&this.assetTriggers.push(e)):n=="{global}"?(this.globalTriggerCaps.includes(r)==!1&&this.globalTriggerCaps.push(r),this.globalTriggers.includes(e)==!1&&this.globalTriggers.push(e)):n=="{form}"&&(this.formTriggerCaps.includes(r)==!1&&this.formTriggerCaps.push(r),this.formTriggers.includes(e)==!1&&this.formTriggers.push(e))}addContextToTrigger(e,n){var r;this.triggerNames.includes(e)==!1&&this.triggerNames.push(e),this.contextItems.has(e)==!1?this.contextItems.set(e,[n]):(r=this.contextItems.get(e))==null||r.push(n)}registerPermissions(e){for(let n=0;nm.trim().length>0),f=r.handle.substr(l+1).split(" ").filter(m=>m.trim().length>0);i=c,f.length==2?(s=f[0],o=f[1]):f.length==1&&(s="",o=f[0])}else{let a=r.handle.split(" ").filter(l=>l.trim().length>0);a.length==2&&(i=[a[0]],o=a[1])}for(let a=0;a0?this.registerSpecialTrigger(l,s,o):this.addContextToTrigger(l,o)}}}};fs.instance=null;(typeof fs.instance=="undefined"||fs.instance==null)&&(fs.instance=new fs,fs.instance.loadCorePermissions());var Xn=fs;function cT(t,e){var r,i,s,o,a,l,u,c,f,m,d,p,_,C,h,b,g,N,S;let n=[];if(t.trim().length==0){let V=(i=(r=Xn.instance)==null?void 0:r.getTriggerNames())!=null?i:[];for(let O=0;OZ.trim().length>0),O=V[0],$=(o=(s=Xn.instance)==null?void 0:s.getTriggerContextItems(O))!=null?o:[],X=(a=Xn.instance)==null?void 0:a.isCollectionTrigger(O),ee=(l=Xn.instance)==null?void 0:l.isGlobalTrigger(O),Y=(u=Xn.instance)==null?void 0:u.isFormTrigger(O),ne=(c=Xn.instance)==null?void 0:c.isStructureTrigger(O),Le=(f=Xn.instance)==null?void 0:f.isAssetTrigger(O),de=[];if(V.length<=2){X?de=de.concat(e.project.getUniqueCollectionNames()):ee?de=de.concat(e.project.getUniqueGlobalsNames()):Y?de=de.concat(e.project.getUniqueFormNames()):ne?de=de.concat(e.project.getUniqueNavigationMenuNames()):Le&&(de=de.concat(e.project.getUniqueAssetNames())),$.length>0&&(de=de.concat($)),de=[...new Set(de)];for(let Z=0;Zk("user:can Tag","The `user:can` tag is used to check if the currently authenticated user has a specific set of permissions. When used as a tag pair, the tag contents will only be rendered if the user has the specified permissions.","https://statamic.dev/tags/user-can")},ea=YE;var KE={tagName:"user:logout",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[{name:"redirect",description:"An optional URL to redirect the user after being logged out",aliases:[],isRequired:!1,acceptsVariableInterpolation:!0,allowsVariableReference:!1,isDynamic:!1,expectsTypes:["string"]}],resolveDocumentation:t=>k("user:logout Tag","The `user:logout` tag will sign out the currently authenticated user. An optional `redirect` parameter may be used to redirect the visitor to a different page after being logged out.","https://statamic.dev/tags/user-logout")},ta=KE;var $E={tagName:"user:logout_url",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[{name:"redirect",description:"An optional URL to redirect the user after being logged out",aliases:[],isRequired:!1,acceptsVariableInterpolation:!0,allowsVariableReference:!1,isDynamic:!1,expectsTypes:["string"]}],resolveDocumentation:t=>Ee("user:logout_url","The `user:logout_url` tag can be used to retrieve the URL that will sign the current user out.",'Log out',"https://statamic.dev/tags/user-logout_url")},na=$E;var fT={tagName:"switch",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[{name:"between",description:"A set of values to iterate over",aliases:[],isRequired:!1,acceptsVariableInterpolation:!0,allowsVariableReference:!1,isDynamic:!1,expectsTypes:["string","array"]},{name:"for",description:"A unique name for the switch instance",aliases:[],isRequired:!1,acceptsVariableInterpolation:!0,allowsVariableReference:!1,isDynamic:!1,expectsTypes:["string"]}],resolveDocumentation:t=>k("switch Tag","The `switch` tag can be used to alternate between a set of values each time the tag is evaluated.","https://statamic.dev/tags/switch")},pT={tagName:"rotate",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,introducedIn:null,allowsArbitraryParameters:!1,allowsContentClose:!1,parameters:[{name:"between",description:"A set of values to iterate over",aliases:[],isRequired:!1,acceptsVariableInterpolation:!0,allowsVariableReference:!1,isDynamic:!1,expectsTypes:["string","array"]},{name:"for",description:"A unique name for the switch instance",aliases:[],isRequired:!1,acceptsVariableInterpolation:!0,allowsVariableReference:!1,isDynamic:!1,expectsTypes:["string"]}],resolveDocumentation:t=>k("rotate Tag","The `rotate` tag can be used to alternate between a set of values each time the tag is evaluated.","https://statamic.dev/tags/switch")};var zE={tagName:"oauth",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[{name:"provider",description:"The OAuth provider to be used",aliases:[],isRequired:!0,acceptsVariableInterpolation:!0,allowsVariableReference:!1,isDynamic:!1,expectsTypes:["string"]},{name:"redirect",description:"The URL to be taken to after authenticating",aliases:[],isRequired:!0,acceptsVariableInterpolation:!0,allowsVariableReference:!1,isDynamic:!1,expectsTypes:["string"]}],resovleParameterCompletionItems:(t,e)=>t.name=="provider"?pt(e.project.getOAuthProviders()):null,resolveDocumentation:t=>Ee("oauth Tag","The `oauth` tag can be used to generate login URls for various third-party services.",'Sign In with Github',"https://statamic.dev/tags/oauth")},dT=zE;var XE={tagName:"session:dump",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,parameters:[],introducedIn:null,resolveDocumentation:t=>k("session:dump Tag","The `session:dump` tag will display the contents of the user's session to the browser. This tag behaves similarly to the `dd` helper functions, but returns just the session data.","https://statamic.dev/tags/session-dump")},oc=XE;var Ws=class{constructor(e){this.node=e}};var QE={tagName:"session:set",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!0,allowsContentClose:!0,parameters:[],introducedIn:null,resolveDynamicParameter:je,resolveSpecialType:(t,e)=>({context:new Ws(t),issues:[]}),resolveDocumentation:t=>k("session:set Tag","The `session:set` tag is used to add new data to the user's session.","https://statamic.dev/tags/session-set")},ac=QE;var Hs=class{constructor(){this.knownVariables=new Map}registerDocumentSessionVariables(e,n){this.knownVariables.has(e)||this.knownVariables.set(e,new Map);let r=this.knownVariables.get(e);r.clear();for(let i=0;i{n.forEach((r,i)=>{e.includes(i)==!1&&e.push(i)})}),e}};Hs.instance=null;(typeof Hs.instance=="undefined"||Hs.instance==null)&&(Hs.instance=new Hs);var Ys=Hs;var mT=Q(ot());function hT(t,e){let n=[],r=t.getArrayValue(),i=e.filter(s=>!r.includes(s));for(let s=0;s{var n,r,i;if(t.name=="keys"&&((n=e.context)==null?void 0:n.parameterContext)!=null){let s=(i=(r=Ys.instance)==null?void 0:r.getKnownSessionVariableNames())!=null?i:[];if(e.context.parameterContext.parameter!=null)return hT(e.context.parameterContext.parameter,s)}return null},resolveDocumentation:t=>k("session:forget Tag","The `session:forget` tag is used to remove variables from the user's session.","https://statamic.dev/tags/session-forget")},lc=JE;var ZE={tagName:"session:flush",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,parameters:[],introducedIn:null,resolveDocumentation:t=>k("session:flush Tag","The `session:flush` tag will clear all values from the visitor's session. If the visitor is currently signed in they will also be signed out.","https://statamic.dev/tags/session-flush")},uc=ZE;var ew={tagName:"session:flash",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!0,allowsContentClose:!1,parameters:[],introducedIn:null,resolveDynamicParameter:je,resolveSpecialType:(t,e)=>({context:new Ws(t),issues:[]}),resolveDocumentation:t=>k("session:flash Tag","The `session:flash` tag can be used to add a value to the user's session. Flashed values only persist for a single request, and are then removed.","https://statamic.dev/tags/session-flash")},cc=ew;var tw={tagName:"markdown:indent",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!0,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[],resolveDocumentation:t=>k("markdown:indent Tag","The `markdown:indent` tag is similar to the markdown tag, but will ignore leading whitepsace while rendering the tag's content as markdown.","https://statamic.dev/tags/markdown-indent")},fc=tw;var nw=[be(fc)],rw={tagName:"markdown",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!0,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[],resolveCompletionItems:t=>t.isPastTagPart==!1&&(t.leftWord=="markdown"||t.leftWord=="/markdown")&&t.leftChar==":"?te(nw):he,resolveDocumentation:t=>k("markdown Tag","The `markdown` tag can be used to render the tags contents as markdown.","https://statamic.dev/tags/markdown")},gT=rw;var _T=Q(nn());function pc(t,e){let n=[],r=e;if(t.trim().length>0&&t.includes(".")&&t.endsWith(".")){let i=t.substr(0,t.length-1);r=r.filter(s=>s.startsWith(i))}for(let i=0;i{if(t.leftMeaningfulWord=="route"){let e=$u(t);return te(yT(e,t.project))}return he},resolveDocumentation:t=>k("route Tag","The `route` tag can be used to generate a full URL [to a named route](https://laravel.com/docs/8.x/routing#named-routes), including any defined route parameters.","https://statamic.dev/tags/route")},bT=iw;var dc=Q(ot()),TT=[{label:"301 Permanent",insertText:"301",kind:dc.CompletionItemKind.EnumMember},{label:"302 Temporary",insertText:"302",kind:dc.CompletionItemKind.EnumMember},{label:"404 Not Found",insertText:"404",kind:dc.CompletionItemKind.EnumMember}];var sw={tagName:"redirect",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[{name:"to",description:"The destination URL",aliases:["url"],allowsVariableReference:!1,acceptsVariableInterpolation:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!0},{name:"response",description:"The HTTP response code to use",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1,isRequired:!1}],resovleParameterCompletionItems:t=>t.name=="response"?te(TT):he,resolveDocumentation:t=>k("redirect Tag","The `redirect` tag can be used to redirect the site visitor to a URL or named route. An optional HTTP status code can also be specified on the response using the `response` parameter.","https://statamic.dev/tags/redirect")},NT=sw;var vT=Q(ot());var Ks=class{constructor(){this.knownSections=new Map}registerDocumentSections(e,n){this.knownSections.has(e)||this.knownSections.set(e,new Map);let r=this.knownSections.get(e);r.clear();for(let i=0;i{n.forEach((r,i)=>{e.includes(i)==!1&&e.push(i)})}),e}};Ks.instance=null;(typeof Ks.instance=="undefined"||Ks.instance==null)&&(Ks.instance=new Ks);var mc=Ks;var ow={tagName:"section",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!0,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[],resolveCompletionItems:t=>{var e,n;if((t.leftWord=="section"||t.leftWord=="/section")&&t.leftChar==":"){let r=[],i=(n=(e=mc.instance)==null?void 0:e.getKnownSectionNames())!=null?n:[];for(let s=0;sk("section Tag","The `section` tag is used to push content to a named region defined by the `yield` tag.","https://statamic.dev/tags/section")},PT=ow;var aw={tagName:"obfuscate",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[],resolveDocumentation:t=>k("obfuscate Tag","The `obfuscate` tag converts the tags's content into a format that is difficult for bots to read, but can easily be viewed by users within their browser.","https://statamic.dev/tags/obfuscate")},IT=aw;var lw={tagName:"parent",hideFromCompletions:!1,requiresClose:!1,allowsContentClose:!0,allowsArbitraryParameters:!1,injectParentScope:!0,introducedIn:null,parameters:[],resolveDocumentation:t=>k("parent Tag","The `parent` tag provides access to data from the current page's parent (the URL one level above the current page).","https://statamic.dev/tags/parent")},ST=lw;function gd(t,e){return pc(t,e.getTranslationKeys())}var uw=["translate","trans","trans_choice"],hc={tagName:"translate",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsContentClose:!1,introducedIn:null,allowsArbitraryParameters:!0,parameters:[{isRequired:!1,name:"key",description:"The key of the translation string to find",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"locale",description:"The locale to be used when translating",acceptsVariableInterpolation:!1,aliases:["site"],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"count",description:"The number of items to use for pluralization",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1}],resovleParameterCompletionItems:(t,e)=>{var n;if(t.name=="key"){let r="";return((n=e.context)==null?void 0:n.parameterContext)!=null&&e.context.parameterContext.parameter!=null&&(r=e.context.parameterContext.parameter.value),te(gd(r,e.project))}return he},resolveDynamicParameter:je,resolveCompletionItems:t=>{if(t.leftMeaningfulWord!=null&&uw.includes(t.leftMeaningfulWord)){let e=$u(t);return te(gd(e,t.project))}return he},resolveDocumentation:t=>k("trans Tag","The `trans` tag can be used to retrieve a string for the current locale's language file.","https://statamic.dev/tags/trans")},CT=et(hc,"trans"),_d=et(hc,"trans_choice");_d.resolveDocumentation=t=>k("trans_choice Tag","The `trans_choice` tag can be used to retrieve a pluralized string for the current locale's language file.","https://statamic.dev/tags/trans#pluralization");var cw={tagName:"svg",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsArbitraryParameters:!0,allowsContentClose:!1,introducedIn:null,parameters:[{isRequired:!1,name:"src",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"The SVG filename relative to the project root",expectsTypes:["string"],isDynamic:!1}],resolveDynamicParameter:je,resolveDocumentation:t=>k("svg Tag","The `svg` tag can be used to render inline SVGs, as well as set attributes on the rendered `` element.","https://statamic.dev/tags/svg")},RT=cw;function gc(t){return[{name:"basename",dataType:"string",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"extension",dataType:"string",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"filename",dataType:"string",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"focus",dataType:"string",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"focus_css",dataType:"string",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"height",dataType:"number",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"is_asset",dataType:"boolean",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"is_image",dataType:"boolean",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"path",dataType:"string",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"size",dataType:"string",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"size_bytes",dataType:"number",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"size_gigabytes",dataType:"number",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"size_kilobytes",dataType:"number",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"size_megabytes",dataType:"number",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"width",dataType:"number",sourceName:"*internal.asset",sourceField:null,introducedBy:t}]}var fw={tagName:"asset",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[{isRequired:!0,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"The path to the file",expectsTypes:["string"],isDynamic:!1,name:"url"}],augmentScope:(t,e)=>(e.addVariables(gc(t)),e),resolveDocumentation:t=>Ee("asset Tag","The `asset` tag can be used to retrive Assets by supplying a URL.",`{{ asset url="/url/for/asset.png" }} +`,null)},ic=HE;var YE=[be(ic)],KE={tagName:"increment",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[{isRequired:!1,name:"from",aliases:[],description:"The number to start incrementing by",acceptsVariableInterpolation:!1,allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1},{isRequired:!1,name:"by",aliases:[],description:"The number to increment by",acceptsVariableInterpolation:!1,allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1}],resolveCompletionItems:t=>t.leftWord=="increment"||t.leftWord=="/increment"&&t.leftChar==":"?te(YE):he,resolveDocumentation:t=>k("increment Tag","The `increment` tag can be used to increment a value each time the tag is encountered.","https://statamic.dev/tags/increment")},oT=KE;var ml=class{constructor(e){this.node=e}},aT={tagName:"yields",hideFromCompletions:!1,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!0,parameters:[],introducedIn:null,requiresClose:!1,resolveSpecialType:(t,e)=>({context:new ml(t),issues:[]})},lT={tagName:"yield",hideFromCompletions:!1,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!0,parameters:[],introducedIn:null,requiresClose:!1,resolveSpecialType:(t,e)=>({context:new ml(t),issues:[]}),resolveDocumentation:t=>k("yield Tag","The `yield` tag may be used to push rendered content to named regions within a template's structure.","https://statamic.dev/tags/yield")};var sc=Q(ot());var uT=[{handle:"access cp"},{handle:"configure collections"},{handle:"[view edit create delete publish reorder] {collection} entries"},{handle:"configure structures"},{handle:"[view edit] {structure} structure"},{handle:"edit {global} globals"},{handle:"[view upload edit move rename delete] {container} assets"},{handle:"[view perform] updates"},{handle:"[view edit create delete] users"},{handle:"change passwords"},{handle:"edit roles"},{handle:"configure forms"},{handle:"[view delete] {form} submissions"}];var fs=class{constructor(){this.contextItems=new Map;this.triggerNames=[];this.collectionTriggers=[];this.collectionTriggerCaps=[];this.globalTriggers=[];this.globalTriggerCaps=[];this.formTriggers=[];this.formTriggerCaps=[];this.structureTriggers=[];this.structureTriggerCaps=[];this.assetTriggers=[];this.assetTriggerCaps=[]}getCollectionTriggerCaps(){return this.collectionTriggerCaps}getGlobalTriggerCaps(){return this.globalTriggerCaps}getFormTriggerCaps(){return this.formTriggerCaps}getStructureTriggerCaps(){return this.structureTriggerCaps}getAssetTriggerCaps(){return this.assetTriggerCaps}loadCorePermissions(){this.registerPermissions(uT)}getTriggerNames(){return this.triggerNames}isCollectionTrigger(e){return this.collectionTriggers.includes(e)}isGlobalTrigger(e){return this.globalTriggers.includes(e)}isFormTrigger(e){return this.formTriggers.includes(e)}isStructureTrigger(e){return this.structureTriggers.includes(e)}isAssetTrigger(e){return this.assetTriggers.includes(e)}getTriggerContextItems(e){return this.contextItems.has(e)?this.contextItems.get(e):[]}registerSpecialTrigger(e,n,r){n=="{collection}"?(this.collectionTriggerCaps.includes(r)==!1&&this.collectionTriggerCaps.push(r),this.collectionTriggers.includes(e)==!1&&this.collectionTriggers.push(e)):n=="{structure}"?(this.structureTriggerCaps.includes(r)==!1&&this.structureTriggerCaps.push(r),this.structureTriggers.includes(e)==!1&&this.structureTriggers.push(e)):n=="{container}"?(this.assetTriggerCaps.includes(r)==!1&&this.assetTriggerCaps.push(r),this.assetTriggers.includes(e)==!1&&this.assetTriggers.push(e)):n=="{global}"?(this.globalTriggerCaps.includes(r)==!1&&this.globalTriggerCaps.push(r),this.globalTriggers.includes(e)==!1&&this.globalTriggers.push(e)):n=="{form}"&&(this.formTriggerCaps.includes(r)==!1&&this.formTriggerCaps.push(r),this.formTriggers.includes(e)==!1&&this.formTriggers.push(e))}addContextToTrigger(e,n){var r;this.triggerNames.includes(e)==!1&&this.triggerNames.push(e),this.contextItems.has(e)==!1?this.contextItems.set(e,[n]):(r=this.contextItems.get(e))==null||r.push(n)}registerPermissions(e){for(let n=0;nm.trim().length>0),f=r.handle.substr(l+1).split(" ").filter(m=>m.trim().length>0);i=c,f.length==2?(s=f[0],o=f[1]):f.length==1&&(s="",o=f[0])}else{let a=r.handle.split(" ").filter(l=>l.trim().length>0);a.length==2&&(i=[a[0]],o=a[1])}for(let a=0;a0?this.registerSpecialTrigger(l,s,o):this.addContextToTrigger(l,o)}}}};fs.instance=null;(typeof fs.instance=="undefined"||fs.instance==null)&&(fs.instance=new fs,fs.instance.loadCorePermissions());var Xn=fs;function cT(t,e){var r,i,s,o,a,l,u,c,f,m,p,d,_,C,h,b,g,N,S;let n=[];if(t.trim().length==0){let V=(i=(r=Xn.instance)==null?void 0:r.getTriggerNames())!=null?i:[];for(let O=0;OZ.trim().length>0),O=V[0],$=(o=(s=Xn.instance)==null?void 0:s.getTriggerContextItems(O))!=null?o:[],X=(a=Xn.instance)==null?void 0:a.isCollectionTrigger(O),ee=(l=Xn.instance)==null?void 0:l.isGlobalTrigger(O),Y=(u=Xn.instance)==null?void 0:u.isFormTrigger(O),ne=(c=Xn.instance)==null?void 0:c.isStructureTrigger(O),De=(f=Xn.instance)==null?void 0:f.isAssetTrigger(O),de=[];if(V.length<=2){X?de=de.concat(e.project.getUniqueCollectionNames()):ee?de=de.concat(e.project.getUniqueGlobalsNames()):Y?de=de.concat(e.project.getUniqueFormNames()):ne?de=de.concat(e.project.getUniqueNavigationMenuNames()):De&&(de=de.concat(e.project.getUniqueAssetNames())),$.length>0&&(de=de.concat($)),de=[...new Set(de)];for(let Z=0;Zk("user:can Tag","The `user:can` tag is used to check if the currently authenticated user has a specific set of permissions. When used as a tag pair, the tag contents will only be rendered if the user has the specified permissions.","https://statamic.dev/tags/user-can")},ea=$E;var zE={tagName:"user:logout",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[{name:"redirect",description:"An optional URL to redirect the user after being logged out",aliases:[],isRequired:!1,acceptsVariableInterpolation:!0,allowsVariableReference:!1,isDynamic:!1,expectsTypes:["string"]}],resolveDocumentation:t=>k("user:logout Tag","The `user:logout` tag will sign out the currently authenticated user. An optional `redirect` parameter may be used to redirect the visitor to a different page after being logged out.","https://statamic.dev/tags/user-logout")},ta=zE;var XE={tagName:"user:logout_url",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[{name:"redirect",description:"An optional URL to redirect the user after being logged out",aliases:[],isRequired:!1,acceptsVariableInterpolation:!0,allowsVariableReference:!1,isDynamic:!1,expectsTypes:["string"]}],resolveDocumentation:t=>Re("user:logout_url","The `user:logout_url` tag can be used to retrieve the URL that will sign the current user out.",'Log out',"https://statamic.dev/tags/user-logout_url")},na=XE;var fT={tagName:"switch",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[{name:"between",description:"A set of values to iterate over",aliases:[],isRequired:!1,acceptsVariableInterpolation:!0,allowsVariableReference:!1,isDynamic:!1,expectsTypes:["string","array"]},{name:"for",description:"A unique name for the switch instance",aliases:[],isRequired:!1,acceptsVariableInterpolation:!0,allowsVariableReference:!1,isDynamic:!1,expectsTypes:["string"]}],resolveDocumentation:t=>k("switch Tag","The `switch` tag can be used to alternate between a set of values each time the tag is evaluated.","https://statamic.dev/tags/switch")},pT={tagName:"rotate",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,introducedIn:null,allowsArbitraryParameters:!1,allowsContentClose:!1,parameters:[{name:"between",description:"A set of values to iterate over",aliases:[],isRequired:!1,acceptsVariableInterpolation:!0,allowsVariableReference:!1,isDynamic:!1,expectsTypes:["string","array"]},{name:"for",description:"A unique name for the switch instance",aliases:[],isRequired:!1,acceptsVariableInterpolation:!0,allowsVariableReference:!1,isDynamic:!1,expectsTypes:["string"]}],resolveDocumentation:t=>k("rotate Tag","The `rotate` tag can be used to alternate between a set of values each time the tag is evaluated.","https://statamic.dev/tags/switch")};var QE={tagName:"oauth",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[{name:"provider",description:"The OAuth provider to be used",aliases:[],isRequired:!0,acceptsVariableInterpolation:!0,allowsVariableReference:!1,isDynamic:!1,expectsTypes:["string"]},{name:"redirect",description:"The URL to be taken to after authenticating",aliases:[],isRequired:!0,acceptsVariableInterpolation:!0,allowsVariableReference:!1,isDynamic:!1,expectsTypes:["string"]}],resovleParameterCompletionItems:(t,e)=>t.name=="provider"?pt(e.project.getOAuthProviders()):null,resolveDocumentation:t=>Re("oauth Tag","The `oauth` tag can be used to generate login URls for various third-party services.",'Sign In with Github',"https://statamic.dev/tags/oauth")},dT=QE;var JE={tagName:"session:dump",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,parameters:[],introducedIn:null,resolveDocumentation:t=>k("session:dump Tag","The `session:dump` tag will display the contents of the user's session to the browser. This tag behaves similarly to the `dd` helper functions, but returns just the session data.","https://statamic.dev/tags/session-dump")},ac=JE;var Ws=class{constructor(e){this.node=e}};var ZE={tagName:"session:set",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!0,allowsContentClose:!0,parameters:[],introducedIn:null,resolveDynamicParameter:je,resolveSpecialType:(t,e)=>({context:new Ws(t),issues:[]}),resolveDocumentation:t=>k("session:set Tag","The `session:set` tag is used to add new data to the user's session.","https://statamic.dev/tags/session-set")},lc=ZE;var Hs=class{constructor(){this.knownVariables=new Map}registerDocumentSessionVariables(e,n){this.knownVariables.has(e)||this.knownVariables.set(e,new Map);let r=this.knownVariables.get(e);r.clear();for(let i=0;i{n.forEach((r,i)=>{e.includes(i)==!1&&e.push(i)})}),e}};Hs.instance=null;(typeof Hs.instance=="undefined"||Hs.instance==null)&&(Hs.instance=new Hs);var Ys=Hs;var mT=Q(ot());function hT(t,e){let n=[],r=t.getArrayValue(),i=e.filter(s=>!r.includes(s));for(let s=0;s{var n,r,i;if(t.name=="keys"&&((n=e.context)==null?void 0:n.parameterContext)!=null){let s=(i=(r=Ys.instance)==null?void 0:r.getKnownSessionVariableNames())!=null?i:[];if(e.context.parameterContext.parameter!=null)return hT(e.context.parameterContext.parameter,s)}return null},resolveDocumentation:t=>k("session:forget Tag","The `session:forget` tag is used to remove variables from the user's session.","https://statamic.dev/tags/session-forget")},uc=ew;var tw={tagName:"session:flush",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,parameters:[],introducedIn:null,resolveDocumentation:t=>k("session:flush Tag","The `session:flush` tag will clear all values from the visitor's session. If the visitor is currently signed in they will also be signed out.","https://statamic.dev/tags/session-flush")},cc=tw;var nw={tagName:"session:flash",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!0,allowsContentClose:!1,parameters:[],introducedIn:null,resolveDynamicParameter:je,resolveSpecialType:(t,e)=>({context:new Ws(t),issues:[]}),resolveDocumentation:t=>k("session:flash Tag","The `session:flash` tag can be used to add a value to the user's session. Flashed values only persist for a single request, and are then removed.","https://statamic.dev/tags/session-flash")},fc=nw;var rw={tagName:"markdown:indent",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!0,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[],resolveDocumentation:t=>k("markdown:indent Tag","The `markdown:indent` tag is similar to the markdown tag, but will ignore leading whitepsace while rendering the tag's content as markdown.","https://statamic.dev/tags/markdown-indent")},pc=rw;var iw=[be(pc)],sw={tagName:"markdown",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!0,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[],resolveCompletionItems:t=>t.isPastTagPart==!1&&(t.leftWord=="markdown"||t.leftWord=="/markdown")&&t.leftChar==":"?te(iw):he,resolveDocumentation:t=>k("markdown Tag","The `markdown` tag can be used to render the tags contents as markdown.","https://statamic.dev/tags/markdown")},gT=sw;var _T=Q(nn());function dc(t,e){let n=[],r=e;if(t.trim().length>0&&t.includes(".")&&t.endsWith(".")){let i=t.substr(0,t.length-1);r=r.filter(s=>s.startsWith(i))}for(let i=0;i{if(t.leftMeaningfulWord=="route"){let e=zu(t);return te(yT(e,t.project))}return he},resolveDocumentation:t=>k("route Tag","The `route` tag can be used to generate a full URL [to a named route](https://laravel.com/docs/8.x/routing#named-routes), including any defined route parameters.","https://statamic.dev/tags/route")},bT=ow;var mc=Q(ot()),TT=[{label:"301 Permanent",insertText:"301",kind:mc.CompletionItemKind.EnumMember},{label:"302 Temporary",insertText:"302",kind:mc.CompletionItemKind.EnumMember},{label:"404 Not Found",insertText:"404",kind:mc.CompletionItemKind.EnumMember}];var aw={tagName:"redirect",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[{name:"to",description:"The destination URL",aliases:["url"],allowsVariableReference:!1,acceptsVariableInterpolation:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!0},{name:"response",description:"The HTTP response code to use",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1,isRequired:!1}],resovleParameterCompletionItems:t=>t.name=="response"?te(TT):he,resolveDocumentation:t=>k("redirect Tag","The `redirect` tag can be used to redirect the site visitor to a URL or named route. An optional HTTP status code can also be specified on the response using the `response` parameter.","https://statamic.dev/tags/redirect")},NT=aw;var vT=Q(ot());var Ks=class{constructor(){this.knownSections=new Map}registerDocumentSections(e,n){this.knownSections.has(e)||this.knownSections.set(e,new Map);let r=this.knownSections.get(e);r.clear();for(let i=0;i{n.forEach((r,i)=>{e.includes(i)==!1&&e.push(i)})}),e}};Ks.instance=null;(typeof Ks.instance=="undefined"||Ks.instance==null)&&(Ks.instance=new Ks);var hc=Ks;var lw={tagName:"section",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!0,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[],resolveCompletionItems:t=>{var e,n;if((t.leftWord=="section"||t.leftWord=="/section")&&t.leftChar==":"){let r=[],i=(n=(e=hc.instance)==null?void 0:e.getKnownSectionNames())!=null?n:[];for(let s=0;sk("section Tag","The `section` tag is used to push content to a named region defined by the `yield` tag.","https://statamic.dev/tags/section")},PT=lw;var uw={tagName:"obfuscate",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[],resolveDocumentation:t=>k("obfuscate Tag","The `obfuscate` tag converts the tags's content into a format that is difficult for bots to read, but can easily be viewed by users within their browser.","https://statamic.dev/tags/obfuscate")},IT=uw;var cw={tagName:"parent",hideFromCompletions:!1,requiresClose:!1,allowsContentClose:!0,allowsArbitraryParameters:!1,injectParentScope:!0,introducedIn:null,parameters:[],resolveDocumentation:t=>k("parent Tag","The `parent` tag provides access to data from the current page's parent (the URL one level above the current page).","https://statamic.dev/tags/parent")},ST=cw;function _d(t,e){return dc(t,e.getTranslationKeys())}var fw=["translate","trans","trans_choice"],gc={tagName:"translate",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsContentClose:!1,introducedIn:null,allowsArbitraryParameters:!0,parameters:[{isRequired:!1,name:"key",description:"The key of the translation string to find",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"locale",description:"The locale to be used when translating",acceptsVariableInterpolation:!1,aliases:["site"],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"count",description:"The number of items to use for pluralization",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1}],resovleParameterCompletionItems:(t,e)=>{var n;if(t.name=="key"){let r="";return((n=e.context)==null?void 0:n.parameterContext)!=null&&e.context.parameterContext.parameter!=null&&(r=e.context.parameterContext.parameter.value),te(_d(r,e.project))}return he},resolveDynamicParameter:je,resolveCompletionItems:t=>{if(t.leftMeaningfulWord!=null&&fw.includes(t.leftMeaningfulWord)){let e=zu(t);return te(_d(e,t.project))}return he},resolveDocumentation:t=>k("trans Tag","The `trans` tag can be used to retrieve a string for the current locale's language file.","https://statamic.dev/tags/trans")},CT=et(gc,"trans"),yd=et(gc,"trans_choice");yd.resolveDocumentation=t=>k("trans_choice Tag","The `trans_choice` tag can be used to retrieve a pluralized string for the current locale's language file.","https://statamic.dev/tags/trans#pluralization");var pw={tagName:"svg",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsArbitraryParameters:!0,allowsContentClose:!1,introducedIn:null,parameters:[{isRequired:!1,name:"src",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"The SVG filename relative to the project root",expectsTypes:["string"],isDynamic:!1}],resolveDynamicParameter:je,resolveDocumentation:t=>k("svg Tag","The `svg` tag can be used to render inline SVGs, as well as set attributes on the rendered `` element.","https://statamic.dev/tags/svg")},RT=pw;function _c(t){return[{name:"basename",dataType:"string",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"extension",dataType:"string",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"filename",dataType:"string",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"focus",dataType:"string",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"focus_css",dataType:"string",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"height",dataType:"number",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"is_asset",dataType:"boolean",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"is_image",dataType:"boolean",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"path",dataType:"string",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"size",dataType:"string",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"size_bytes",dataType:"number",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"size_gigabytes",dataType:"number",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"size_kilobytes",dataType:"number",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"size_megabytes",dataType:"number",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"width",dataType:"number",sourceName:"*internal.asset",sourceField:null,introducedBy:t}]}var dw={tagName:"asset",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[{isRequired:!0,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"The path to the file",expectsTypes:["string"],isDynamic:!1,name:"url"}],augmentScope:(t,e)=>(e.addVariables(_c(t)),e),resolveDocumentation:t=>Re("asset Tag","The `asset` tag can be used to retrive Assets by supplying a URL.",`{{ asset url="/url/for/asset.png" }} {{ alt }} -{{ /asset }}`,"https://statamic.dev/tags/asset")},AT=fw;var xT=Q(ot());function yd(t){let e=[],n=t.getUniqueAssetNames();for(let r=0;rET.includes(t.name)?te(yd(e.project)):he,augmentScope:(t,e)=>{e.addVariables(gc(t));let n="";if(t.name!=null&&t.name.getMethodName()!=null)n=t.name.getMethodName();else{let r=t.findAnyParameter(ET);r!=null&&r.containsSimpleValue()&&(n=r.value)}return n.length>0&&e.injectAssetContainer(t,n),e},resolveCompletionItems:t=>(t.leftWord=="assets"||t.leftWord=="/assets")&&t.leftChar==":"?te(yd(t.project)):he,resolveDocumentation:t=>Ee("assets Tag","The `assets` tag can be used to retrieve multiple Assets from an Asset container.",`{{ assets container="container-name" }} +{{ /asset }}`,"https://statamic.dev/tags/asset")},AT=dw;var xT=Q(ot());function bd(t){let e=[],n=t.getUniqueAssetNames();for(let r=0;rET.includes(t.name)?te(bd(e.project)):he,augmentScope:(t,e)=>{e.addVariables(_c(t));let n="";if(t.name!=null&&t.name.getMethodName()!=null)n=t.name.getMethodName();else{let r=t.findAnyParameter(ET);r!=null&&r.containsSimpleValue()&&(n=r.value)}return n.length>0&&e.injectAssetContainer(t,n),e},resolveCompletionItems:t=>(t.leftWord=="assets"||t.leftWord=="/assets")&&t.leftChar==":"?te(bd(t.project)):he,resolveDocumentation:t=>Re("assets Tag","The `assets` tag can be used to retrieve multiple Assets from an Asset container.",`{{ assets container="container-name" }} {{# Loop over all assets in the container. #}} {{ alt }} -{{ /assets }}`,"https://statamic.dev/tags/assets")},wT=pw;var dw={tagName:"get_content",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,introducedIn:null,allowsArbitraryParameters:!1,parameters:[{isRequired:!1,name:"from",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,description:"The ID to retrieve data for",expectsTypes:["string","array"],isDynamic:!1},{isRequired:!1,name:"locale",aliases:["site"],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"The locale to show the content in",expectsTypes:["string"],isDynamic:!1}],resovleParameterCompletionItems:(t,e)=>t.name=="locale"||t.name=="site"?pt(e.project.getSiteNames()):null,resolveDocumentation:t=>Ee("get_content Tag","The `get_content` tag can be used to retrieve content from other entries. This tag accepts the ID of another entry, and will return access to all data for that entry.",`{{ get_content from="the-entry-id" }} -{{ /get_content }}`,"https://statamic.dev/tags/get_content")},OT=dw;function LT(t){return[{name:"basename",dataType:"string",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"extension",dataType:"string",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"filename",dataType:"string",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"is_image",dataType:"boolean",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"file",dataType:"string",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"file",dataType:"last_modified",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size",dataType:"string",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size_bytes",dataType:"number",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size_b",dataType:"number",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size_gigabytes",dataType:"number",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size_gb",dataType:"number",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size_kilobytes",dataType:"number",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size_kb",dataType:"number",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size_megabytes",dataType:"number",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size_mb",dataType:"number",sourceName:"*internal.file",sourceField:null,introducedBy:t}]}var mw={tagName:"get_files",hideFromCompletions:!1,requiresClose:!0,allowsArbitraryParameters:!1,allowsContentClose:!1,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!1,name:"in",aliases:["from"],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"The directory to find files in relative to the public directory",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"depth",aliases:[],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"The depth of the subdirectories",expectsTypes:["number"],isDynamic:!1},{isRequired:!1,name:"not_in",allowsVariableReference:!1,acceptsVariableInterpolation:!1,aliases:[],description:"The subdirectories or pattern to exclude",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"file_size",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["string"],description:"The file size filter to use",isDynamic:!1},{isRequired:!1,name:"ext",aliases:["extension"],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"The extension(s) to filter by",expectsTypes:["string","array"],isDynamic:!1},{isRequired:!1,name:"include",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:["match"],description:"Filter files by a regular expression",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"exclude",description:"Excludes files by a regular expression",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"file_date",description:"Filters files by last modified date",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"limit",description:"Limits the total number of results",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1},{isRequired:!1,name:"offset",description:"The number of entries the results should be offset by",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1},{isRequired:!1,name:"sort",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Sorts the listing by extension, size, last_modified, or random",expectsTypes:["string"],isDynamic:!1}],augmentScope:(t,e)=>(e.addVariables(LT(t)),e),resolveDocumentation:t=>k("get_files Tag","The `get_files` tag can be used to display information about files on the site's local filesystem.","https://statamic.dev/tags/get_files")},DT=mw;function _c(t){return[{name:"width",dataType:"number",sourceName:"*internal.glide",sourceField:null,introducedBy:t},{name:"height",dataType:"number",sourceName:"*internal.glide",sourceField:null,introducedBy:t},{name:"url",dataType:"string",sourceName:"*internal.glide",sourceField:null,introducedBy:t}]}var kT=Q(ot());function $r(t,e,n){var r,i,s,o,a,l,u,c,f,m,d,p;return{endLine:(s=(i=(r=n.valuePosition)==null?void 0:r.end)==null?void 0:i.line)!=null?s:0,startLine:(l=(a=(o=n.namePosition)==null?void 0:o.start)==null?void 0:a.line)!=null?l:0,endPos:(f=(c=(u=n.valuePosition)==null?void 0:u.end)==null?void 0:c.char)!=null?f:0,startPos:(p=(d=(m=n.namePosition)==null?void 0:m.start)==null?void 0:d.char)!=null?p:0,message:t,severity:kT.DiagnosticSeverity.Error}}var bd=["greyscale","sepia"],Td=["jpg","pjpg","png","gif","webp","avif","tif","bmp","psd"],MT=["auto","0","90","180","270"],yc=[{isRequired:!1,name:"src",aliases:["path","id"],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"The URL of the image when not using shorthand syntax",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"tag",aliases:[],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"Outputs an image tag when set to true",expectsTypes:["boolean"],isDynamic:!1},{isRequired:!1,name:"alt",description:"The alt attribute value to use when generating tags",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"absolute",description:"Whether to output full URLs",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["boolean"],isDynamic:!1},{name:"width",expectsTypes:["number"],isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"The width of the image, in pixels",isDynamic:!1},{name:"height",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],description:"The height of the image, in pixels",expectsTypes:["number"],isDynamic:!1,isRequired:!1},{name:"square",expectsTypes:["number"],acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Sets both then height and width of the iamge",isDynamic:!1,isRequired:!1},{name:"fit",expectsTypes:["string"],acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"How the image is fitted to its target dimensions",isDynamic:!1,isRequired:!1},{name:"crop",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Crops the image to the specific dimensions",expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"orient",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Rotates the image",expectsTypes:["*"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=[];return e.containsSimpleValue()&&e.value.trim().length>0&&!MT.includes(e.value)&&n.push($r("Invalid orient value",t,e)),n}},{name:"quality",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Defines the quality of the image",expectsTypes:["number"],isDynamic:!1,isRequired:!1},{name:"dpr",allowsVariableReference:!1,acceptsVariableInterpolation:!1,aliases:[],description:"Defines the device pixel ratio",expectsTypes:["number"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=parseInt(e.value),r=[];return e.containsSimpleValue()&&(n<1||n>8)&&r.push($r("dpr must be an integer between 1 and 8.",t,e)),r}},{name:"format",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Encodes the image to a specific format",expectsTypes:["string"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=[];return e.containsSimpleValue()&&e.value.trim().length>0&&!Td.includes(e.value)&&n.push($r("Format must be one of: "+Td.join(","),t,e)),n}},{name:"bg",description:"Sets the background color for transparent images",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"blur",description:"Adds a blur effect to the image",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=parseInt(e.value),r=[];return e.containsSimpleValue()&&(n<0||n>100)&&r.push($r("blur must be a value between 0 and 100.",t,e)),r}},{name:"brightness",description:"Adjusts the image brightness",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=parseInt(e.value),r=[];return e.containsSimpleValue()&&(n<-100||n>100)&&r.push($r("brightness must be a value between -100 and 100.",t,e)),r}},{name:"contrast",description:"Adjusts the image contrast",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=parseInt(e.value),r=[];return e.containsSimpleValue()&&(n<-100||n>100)&&r.push($r("contrast must be a value between -100 and 100.",t,e)),r}},{name:"gamma",description:"Adjusts the image gamma",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=parseFloat(e.value),r=[];return e.containsSimpleValue()&&(n<.1||n>9.99)&&r.push($r("gamma must be a value between 0.1 and 9.99.",t,e)),r}},{name:"sharpen",description:"Sharpens the iamge",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=parseInt(e.value),r=[];return e.containsSimpleValue()&&(n<0||n>100)&&r.push($r("sharpen must be a value between 0 and 100.",t,e)),r}},{name:"pixelate",description:"Applies a pixelation effect to the image",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=parseInt(e.value),r=[];return e.containsSimpleValue()&&(n<0||n>100)&&r.push($r("pixelate must be a value between 0 and 100.",t,e)),r}},{name:"filter",description:"Applies a filter effect to the image",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=[];return e.containsSimpleValue()&&e.value.trim().length>0&&!bd.includes(e.value)&&n.push($r("Filter must be one of: "+bd.join(","),t,e)),n}},{name:"preset",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,expectsTypes:["string"],description:"A collection of pre-configured image manipulation parameters.",isDynamic:!1,isRequired:!1}];function bc(t,e){return t.name=="orient"?pt(MT):t.name=="format"?pt(Td):t.name=="filter"?pt(bd):t.name=="preset"?pt(e.project.getAssetPresets()):he}var hw={tagName:"glide:batch",hideFromCompletions:!1,requiresClose:!0,allowsContentClose:!1,allowsArbitraryParameters:!1,injectParentScope:!1,parameters:yc,introducedIn:null,augmentScope:(t,e)=>(e.addVariables(_c(t)),e),resovleParameterCompletionItems:bc,resolveDocumentation:t=>k("glide:batch Tag","The `glide:batch` tag is similar to the glide tag, but can be used to apply image manipulations to multiple images within a piece of content.","https://statamic.dev/tags/glide-batch")},Tc=hw;var gw=[be(Tc)],_w={tagName:"glide",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,injectParentScope:!1,requiresClose:!1,parameters:yc,introducedIn:null,augmentScope:(t,e)=>(e.addVariables(_c(t)),e),resovleParameterCompletionItems:bc,resolveCompletionItems:t=>t.isPastTagPart==!1&&(t.leftWord=="glide"||t.leftWord=="/glide")&&t.leftChar==":"?te(gw):he,resolveDocumentation:t=>k("glide Tag","The `glide` tag is used to manipulate images on the fly. Image manipulations may include resizing, cropping, or adjusting sharpness and constrast, amongst many others.","https://statamic.dev/tags/glide")},FT=_w;var VT={tagName:"iterate",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,injectParentScope:!1,introducedIn:null,parameters:[{name:"as",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Optionally rename the key/value variables",expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"array",acceptsVariableInterpolation:!0,aliases:[],allowsVariableReference:!0,description:"The array to iterate",expectsTypes:["array"],isDynamic:!1,isRequired:!1}],resolveDocumentation:t=>k("iterate Tag","The `iterate` tag can be used to iterate over arbitrary arrays.","https://statamic.dev/tags/foreach")},qT={tagName:"foreach",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,injectParentScope:!1,introducedIn:null,parameters:[{name:"as",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Optionally rename the key/value variables",expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"array",acceptsVariableInterpolation:!0,aliases:[],allowsVariableReference:!0,description:"The array to iterate",expectsTypes:["array"],isDynamic:!1,isRequired:!1}],resolveDocumentation:t=>k("foreach Tag","The `foreach` tag can be used to iterate over arbitrary arrays.","https://statamic.dev/tags/foreach")};function BT(t){return[{name:"url",dataType:"string",sourceField:null,sourceName:"*internal.locale",introducedBy:t},{name:"name",dataType:"string",sourceField:null,sourceName:"*internal.locale",introducedBy:t}]}var Nc=[{isRequired:!1,name:"id",description:"The ID of the content to localize",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,name:"sort",description:"Sort by a sites key",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"current_first",description:"When true, ensures that the current locale is first",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["boolean"],isDynamic:!1},{isRequired:!1,name:"all",description:"When true, all locale data will be returned.",acceptsVariableInterpolation:!0,aliases:[],allowsVariableReference:!0,expectsTypes:["boolean"],isDynamic:!1},{isRequired:!0,name:"self",description:"When true, the current locale will be included.",acceptsVariableInterpolation:!0,aliases:[],allowsVariableReference:!0,expectsTypes:["boolean"],isDynamic:!1}];var yw={tagName:"locales:count",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,injectParentScope:!1,requiresClose:!0,parameters:Nc,introducedIn:"3.0.36",resolveDocumentation:t=>k("locales:count Tag","The `locales:count` tag can be used to count the number of locales the current content is available in.","https://statamic.dev/tags/locales-count")},vc=yw;var bw=[be(vc)],Tw={tagName:"locales",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,injectParentScope:!1,requiresClose:!0,parameters:Nc,introducedIn:null,augmentScope:(t,e)=>(e.addVariableArray("locale",BT(t)),e.addVariable({name:"current",dataType:"string",sourceField:null,sourceName:"*internal.locale",introducedBy:t}),e.addVariable({name:"is_current",dataType:"boolean",sourceField:null,sourceName:"*internal.locale",introducedBy:t}),e.addVariable({name:"exists",dataType:"boolean",sourceField:null,sourceName:"*internal.locale",introducedBy:t}),e.addVariable({name:"permalink",dataType:"string",sourceField:null,sourceName:"*internal.locale",introducedBy:t}),e),resolveDocumentation:t=>k("locales Tag","The `locales` tag can be used to access all the locales the current content is available in.","https://statamic.dev/tags/locales"),resolveCompletionItems:t=>t.isPastTagPart==!1&&(t.leftWord=="locale"||t.leftWord=="/locale")&&t.leftChar==":"?te(bw):he},jT=Tw;var Nw={tagName:"mix",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!1,name:"src",description:"The path to the versioned file, relative to the public directory",acceptsVariableInterpolation:!1,aliases:["path"],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"in",description:"The location of the mix manifest file",acceptsVariableInterpolation:!1,aliases:["from"],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1}],resolveDocumentation:t=>k("mix Tag","The `mix` tag is used to return the path of CSS and JavaScript files versioned with [Laravel Mix](https://laravel.com/docs/8.x/mix).","https://statamic.dev/tags/mix")},UT=Nw;var hl=Q(ot());function GT(t){let e=[],n=t.getUniqueUserGroupNames();for(let r=0;r!t.includes(s));for(let s=0;s!t.includes(s));for(let s=0;s{var n,r,i;return(t.name=="groups"||t.name=="group")&&((n=e.context)==null?void 0:n.parameterContext)!=null?te(ra((i=(r=e.context.parameterContext.parameter)==null?void 0:r.getArrayValue())!=null?i:[],e.project)):null},resolveDocumentation:t=>k("user:in Tag","The `user:in` tag can be used to check if the currently authenticated user belongs to one or more user groups. When used as a tag pair, the tag contents will only be rendered if the user belongs to the specified groups.","https://statamic.dev/tags/user-in")},Pc=vw;var Pw={tagName:"user:not_in",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!0,acceptsVariableInterpolation:!1,aliases:["groups"],allowsVariableReference:!1,name:"group",description:"The groups to check against",expectsTypes:["string","array"],isDynamic:!1}],resovleParameterCompletionItems:(t,e)=>{var n,r,i;return(t.name=="groups"||t.name=="group")&&((n=e.context)==null?void 0:n.parameterContext)!=null?te(ra((i=(r=e.context.parameterContext.parameter)==null?void 0:r.getArrayValue())!=null?i:[],e.project)):null},resolveDocumentation:t=>k("user:not_in Tag","The `user:not_in` tag can be used to check if the currently authenticated user does not belong to one or more user groups. When used as a tag pair, the tag contents will be rendered if the user does not belong to the specified groups.","https://statamic.dev/tags/user-in#not-in")},sa=Pw;var Iw={tagName:"user:is",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!0,acceptsVariableInterpolation:!1,aliases:["roles"],allowsVariableReference:!1,name:"role",description:"The roles to check against",expectsTypes:["string","array"],isDynamic:!1}],resovleParameterCompletionItems:(t,e)=>{var n,r,i;return(t.name=="roles"||t.name=="role")&&((n=e.context)==null?void 0:n.parameterContext)!=null?te(ia((i=(r=e.context.parameterContext.parameter)==null?void 0:r.getArrayValue())!=null?i:[],e.project)):null},resolveDocumentation:t=>k("user:is Tag","The `user:is` tag can be used to check whether the currently authenticated user has one or more roles.","https://statamic.dev/tags/user-is")},oa=Iw;var Sw={tagName:"user:isnt",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!0,acceptsVariableInterpolation:!1,aliases:["roles"],allowsVariableReference:!1,name:"role",description:"The roles to check against",expectsTypes:["string","array"],isDynamic:!1}],resovleParameterCompletionItems:(t,e)=>{var n,r,i;return(t.name=="roles"||t.name=="role")&&((n=e.context)==null?void 0:n.parameterContext)!=null?te(ia((i=(r=e.context.parameterContext.parameter)==null?void 0:r.getArrayValue())!=null?i:[],e.project)):null},resolveDocumentation:t=>k("user:isnt Tag","The `user:isnt` tag can be used to check whether the currently authenticated user does not have one or more roles.","https://statamic.dev/tags/user-is#isnt")},aa=Sw;var Cw={tagName:"in",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!0,acceptsVariableInterpolation:!1,aliases:["groups"],allowsVariableReference:!1,name:"group",description:"The groups to check against",expectsTypes:["string","array"],isDynamic:!1}],resovleParameterCompletionItems:(t,e)=>{var n,r,i;return(t.name=="groups"||t.name=="group")&&((n=e.context)==null?void 0:n.parameterContext)!=null?te(ra((i=(r=e.context.parameterContext.parameter)==null?void 0:r.getArrayValue())!=null?i:[],e.project)):null},resolveCompletionItems:t=>(t.leftWord=="in"||t.leftWord=="/in")&&t.leftChar==":"?te(GT(t.project)):he,resolveDocumentation:t=>k("in Tag","The `in` tag can be used to check if the authenticated user belongs to one or more groups. This tag operates similarly to the `user:in` tag.","https://statamic.dev/tags/user-in")},HT=Cw;var Rw={tagName:"not_found",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,parameters:[],introducedIn:null,resolveDocumentation:t=>Ee("404 (Not Found) Tag","The `not_found` tag will trigger a 404 status code, and display the 404 template to the site visitor.",`{{ unless logged_in }} +{{ /assets }}`,"https://statamic.dev/tags/assets")},wT=mw;var hw={tagName:"get_content",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,introducedIn:null,allowsArbitraryParameters:!1,parameters:[{isRequired:!1,name:"from",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,description:"The ID to retrieve data for",expectsTypes:["string","array"],isDynamic:!1},{isRequired:!1,name:"locale",aliases:["site"],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"The locale to show the content in",expectsTypes:["string"],isDynamic:!1}],resovleParameterCompletionItems:(t,e)=>t.name=="locale"||t.name=="site"?pt(e.project.getSiteNames()):null,resolveDocumentation:t=>Re("get_content Tag","The `get_content` tag can be used to retrieve content from other entries. This tag accepts the ID of another entry, and will return access to all data for that entry.",`{{ get_content from="the-entry-id" }} +{{ /get_content }}`,"https://statamic.dev/tags/get_content")},OT=hw;function LT(t){return[{name:"basename",dataType:"string",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"extension",dataType:"string",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"filename",dataType:"string",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"is_image",dataType:"boolean",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"file",dataType:"string",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"file",dataType:"last_modified",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size",dataType:"string",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size_bytes",dataType:"number",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size_b",dataType:"number",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size_gigabytes",dataType:"number",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size_gb",dataType:"number",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size_kilobytes",dataType:"number",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size_kb",dataType:"number",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size_megabytes",dataType:"number",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size_mb",dataType:"number",sourceName:"*internal.file",sourceField:null,introducedBy:t}]}var gw={tagName:"get_files",hideFromCompletions:!1,requiresClose:!0,allowsArbitraryParameters:!1,allowsContentClose:!1,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!1,name:"in",aliases:["from"],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"The directory to find files in relative to the public directory",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"depth",aliases:[],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"The depth of the subdirectories",expectsTypes:["number"],isDynamic:!1},{isRequired:!1,name:"not_in",allowsVariableReference:!1,acceptsVariableInterpolation:!1,aliases:[],description:"The subdirectories or pattern to exclude",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"file_size",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["string"],description:"The file size filter to use",isDynamic:!1},{isRequired:!1,name:"ext",aliases:["extension"],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"The extension(s) to filter by",expectsTypes:["string","array"],isDynamic:!1},{isRequired:!1,name:"include",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:["match"],description:"Filter files by a regular expression",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"exclude",description:"Excludes files by a regular expression",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"file_date",description:"Filters files by last modified date",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"limit",description:"Limits the total number of results",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1},{isRequired:!1,name:"offset",description:"The number of entries the results should be offset by",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1},{isRequired:!1,name:"sort",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Sorts the listing by extension, size, last_modified, or random",expectsTypes:["string"],isDynamic:!1}],augmentScope:(t,e)=>(e.addVariables(LT(t)),e),resolveDocumentation:t=>k("get_files Tag","The `get_files` tag can be used to display information about files on the site's local filesystem.","https://statamic.dev/tags/get_files")},DT=gw;function yc(t){return[{name:"width",dataType:"number",sourceName:"*internal.glide",sourceField:null,introducedBy:t},{name:"height",dataType:"number",sourceName:"*internal.glide",sourceField:null,introducedBy:t},{name:"url",dataType:"string",sourceName:"*internal.glide",sourceField:null,introducedBy:t}]}var kT=Q(ot());function zr(t,e,n){var r,i,s,o,a,l,u,c,f,m,p,d;return{endLine:(s=(i=(r=n.valuePosition)==null?void 0:r.end)==null?void 0:i.line)!=null?s:0,startLine:(l=(a=(o=n.namePosition)==null?void 0:o.start)==null?void 0:a.line)!=null?l:0,endPos:(f=(c=(u=n.valuePosition)==null?void 0:u.end)==null?void 0:c.char)!=null?f:0,startPos:(d=(p=(m=n.namePosition)==null?void 0:m.start)==null?void 0:p.char)!=null?d:0,message:t,severity:kT.DiagnosticSeverity.Error}}var Td=["greyscale","sepia"],Nd=["jpg","pjpg","png","gif","webp","avif","tif","bmp","psd"],MT=["auto","0","90","180","270"],bc=[{isRequired:!1,name:"src",aliases:["path","id"],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"The URL of the image when not using shorthand syntax",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"tag",aliases:[],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"Outputs an image tag when set to true",expectsTypes:["boolean"],isDynamic:!1},{isRequired:!1,name:"alt",description:"The alt attribute value to use when generating tags",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"absolute",description:"Whether to output full URLs",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["boolean"],isDynamic:!1},{name:"width",expectsTypes:["number"],isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"The width of the image, in pixels",isDynamic:!1},{name:"height",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],description:"The height of the image, in pixels",expectsTypes:["number"],isDynamic:!1,isRequired:!1},{name:"square",expectsTypes:["number"],acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Sets both then height and width of the iamge",isDynamic:!1,isRequired:!1},{name:"fit",expectsTypes:["string"],acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"How the image is fitted to its target dimensions",isDynamic:!1,isRequired:!1},{name:"crop",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Crops the image to the specific dimensions",expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"orient",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Rotates the image",expectsTypes:["*"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=[];return e.containsSimpleValue()&&e.value.trim().length>0&&!MT.includes(e.value)&&n.push(zr("Invalid orient value",t,e)),n}},{name:"quality",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Defines the quality of the image",expectsTypes:["number"],isDynamic:!1,isRequired:!1},{name:"dpr",allowsVariableReference:!1,acceptsVariableInterpolation:!1,aliases:[],description:"Defines the device pixel ratio",expectsTypes:["number"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=parseInt(e.value),r=[];return e.containsSimpleValue()&&(n<1||n>8)&&r.push(zr("dpr must be an integer between 1 and 8.",t,e)),r}},{name:"format",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Encodes the image to a specific format",expectsTypes:["string"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=[];return e.containsSimpleValue()&&e.value.trim().length>0&&!Nd.includes(e.value)&&n.push(zr("Format must be one of: "+Nd.join(","),t,e)),n}},{name:"bg",description:"Sets the background color for transparent images",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"blur",description:"Adds a blur effect to the image",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=parseInt(e.value),r=[];return e.containsSimpleValue()&&(n<0||n>100)&&r.push(zr("blur must be a value between 0 and 100.",t,e)),r}},{name:"brightness",description:"Adjusts the image brightness",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=parseInt(e.value),r=[];return e.containsSimpleValue()&&(n<-100||n>100)&&r.push(zr("brightness must be a value between -100 and 100.",t,e)),r}},{name:"contrast",description:"Adjusts the image contrast",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=parseInt(e.value),r=[];return e.containsSimpleValue()&&(n<-100||n>100)&&r.push(zr("contrast must be a value between -100 and 100.",t,e)),r}},{name:"gamma",description:"Adjusts the image gamma",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=parseFloat(e.value),r=[];return e.containsSimpleValue()&&(n<.1||n>9.99)&&r.push(zr("gamma must be a value between 0.1 and 9.99.",t,e)),r}},{name:"sharpen",description:"Sharpens the iamge",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=parseInt(e.value),r=[];return e.containsSimpleValue()&&(n<0||n>100)&&r.push(zr("sharpen must be a value between 0 and 100.",t,e)),r}},{name:"pixelate",description:"Applies a pixelation effect to the image",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=parseInt(e.value),r=[];return e.containsSimpleValue()&&(n<0||n>100)&&r.push(zr("pixelate must be a value between 0 and 100.",t,e)),r}},{name:"filter",description:"Applies a filter effect to the image",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=[];return e.containsSimpleValue()&&e.value.trim().length>0&&!Td.includes(e.value)&&n.push(zr("Filter must be one of: "+Td.join(","),t,e)),n}},{name:"preset",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,expectsTypes:["string"],description:"A collection of pre-configured image manipulation parameters.",isDynamic:!1,isRequired:!1}];function Tc(t,e){return t.name=="orient"?pt(MT):t.name=="format"?pt(Nd):t.name=="filter"?pt(Td):t.name=="preset"?pt(e.project.getAssetPresets()):he}var _w={tagName:"glide:batch",hideFromCompletions:!1,requiresClose:!0,allowsContentClose:!1,allowsArbitraryParameters:!1,injectParentScope:!1,parameters:bc,introducedIn:null,augmentScope:(t,e)=>(e.addVariables(yc(t)),e),resovleParameterCompletionItems:Tc,resolveDocumentation:t=>k("glide:batch Tag","The `glide:batch` tag is similar to the glide tag, but can be used to apply image manipulations to multiple images within a piece of content.","https://statamic.dev/tags/glide-batch")},Nc=_w;var yw=[be(Nc)],bw={tagName:"glide",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,injectParentScope:!1,requiresClose:!1,parameters:bc,introducedIn:null,augmentScope:(t,e)=>(e.addVariables(yc(t)),e),resovleParameterCompletionItems:Tc,resolveCompletionItems:t=>t.isPastTagPart==!1&&(t.leftWord=="glide"||t.leftWord=="/glide")&&t.leftChar==":"?te(yw):he,resolveDocumentation:t=>k("glide Tag","The `glide` tag is used to manipulate images on the fly. Image manipulations may include resizing, cropping, or adjusting sharpness and constrast, amongst many others.","https://statamic.dev/tags/glide")},FT=bw;var VT={tagName:"iterate",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,injectParentScope:!1,introducedIn:null,parameters:[{name:"as",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Optionally rename the key/value variables",expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"array",acceptsVariableInterpolation:!0,aliases:[],allowsVariableReference:!0,description:"The array to iterate",expectsTypes:["array"],isDynamic:!1,isRequired:!1}],resolveDocumentation:t=>k("iterate Tag","The `iterate` tag can be used to iterate over arbitrary arrays.","https://statamic.dev/tags/foreach")},qT={tagName:"foreach",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,injectParentScope:!1,introducedIn:null,parameters:[{name:"as",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Optionally rename the key/value variables",expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"array",acceptsVariableInterpolation:!0,aliases:[],allowsVariableReference:!0,description:"The array to iterate",expectsTypes:["array"],isDynamic:!1,isRequired:!1}],resolveDocumentation:t=>k("foreach Tag","The `foreach` tag can be used to iterate over arbitrary arrays.","https://statamic.dev/tags/foreach")};function BT(t){return[{name:"url",dataType:"string",sourceField:null,sourceName:"*internal.locale",introducedBy:t},{name:"name",dataType:"string",sourceField:null,sourceName:"*internal.locale",introducedBy:t}]}var vc=[{isRequired:!1,name:"id",description:"The ID of the content to localize",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,name:"sort",description:"Sort by a sites key",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"current_first",description:"When true, ensures that the current locale is first",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["boolean"],isDynamic:!1},{isRequired:!1,name:"all",description:"When true, all locale data will be returned.",acceptsVariableInterpolation:!0,aliases:[],allowsVariableReference:!0,expectsTypes:["boolean"],isDynamic:!1},{isRequired:!0,name:"self",description:"When true, the current locale will be included.",acceptsVariableInterpolation:!0,aliases:[],allowsVariableReference:!0,expectsTypes:["boolean"],isDynamic:!1}];var Tw={tagName:"locales:count",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,injectParentScope:!1,requiresClose:!0,parameters:vc,introducedIn:"3.0.36",resolveDocumentation:t=>k("locales:count Tag","The `locales:count` tag can be used to count the number of locales the current content is available in.","https://statamic.dev/tags/locales-count")},Pc=Tw;var Nw=[be(Pc)],vw={tagName:"locales",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,injectParentScope:!1,requiresClose:!0,parameters:vc,introducedIn:null,augmentScope:(t,e)=>(e.addVariableArray("locale",BT(t)),e.addVariable({name:"current",dataType:"string",sourceField:null,sourceName:"*internal.locale",introducedBy:t}),e.addVariable({name:"is_current",dataType:"boolean",sourceField:null,sourceName:"*internal.locale",introducedBy:t}),e.addVariable({name:"exists",dataType:"boolean",sourceField:null,sourceName:"*internal.locale",introducedBy:t}),e.addVariable({name:"permalink",dataType:"string",sourceField:null,sourceName:"*internal.locale",introducedBy:t}),e),resolveDocumentation:t=>k("locales Tag","The `locales` tag can be used to access all the locales the current content is available in.","https://statamic.dev/tags/locales"),resolveCompletionItems:t=>t.isPastTagPart==!1&&(t.leftWord=="locale"||t.leftWord=="/locale")&&t.leftChar==":"?te(Nw):he},jT=vw;var Pw={tagName:"mix",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!1,name:"src",description:"The path to the versioned file, relative to the public directory",acceptsVariableInterpolation:!1,aliases:["path"],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"in",description:"The location of the mix manifest file",acceptsVariableInterpolation:!1,aliases:["from"],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1}],resolveDocumentation:t=>k("mix Tag","The `mix` tag is used to return the path of CSS and JavaScript files versioned with [Laravel Mix](https://laravel.com/docs/8.x/mix).","https://statamic.dev/tags/mix")},UT=Pw;var hl=Q(ot());function GT(t){let e=[],n=t.getUniqueUserGroupNames();for(let r=0;r!t.includes(s));for(let s=0;s!t.includes(s));for(let s=0;s{var n,r,i;return(t.name=="groups"||t.name=="group")&&((n=e.context)==null?void 0:n.parameterContext)!=null?te(ra((i=(r=e.context.parameterContext.parameter)==null?void 0:r.getArrayValue())!=null?i:[],e.project)):null},resolveDocumentation:t=>k("user:in Tag","The `user:in` tag can be used to check if the currently authenticated user belongs to one or more user groups. When used as a tag pair, the tag contents will only be rendered if the user belongs to the specified groups.","https://statamic.dev/tags/user-in")},Ic=Iw;var Sw={tagName:"user:not_in",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!0,acceptsVariableInterpolation:!1,aliases:["groups"],allowsVariableReference:!1,name:"group",description:"The groups to check against",expectsTypes:["string","array"],isDynamic:!1}],resovleParameterCompletionItems:(t,e)=>{var n,r,i;return(t.name=="groups"||t.name=="group")&&((n=e.context)==null?void 0:n.parameterContext)!=null?te(ra((i=(r=e.context.parameterContext.parameter)==null?void 0:r.getArrayValue())!=null?i:[],e.project)):null},resolveDocumentation:t=>k("user:not_in Tag","The `user:not_in` tag can be used to check if the currently authenticated user does not belong to one or more user groups. When used as a tag pair, the tag contents will be rendered if the user does not belong to the specified groups.","https://statamic.dev/tags/user-in#not-in")},sa=Sw;var Cw={tagName:"user:is",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!0,acceptsVariableInterpolation:!1,aliases:["roles"],allowsVariableReference:!1,name:"role",description:"The roles to check against",expectsTypes:["string","array"],isDynamic:!1}],resovleParameterCompletionItems:(t,e)=>{var n,r,i;return(t.name=="roles"||t.name=="role")&&((n=e.context)==null?void 0:n.parameterContext)!=null?te(ia((i=(r=e.context.parameterContext.parameter)==null?void 0:r.getArrayValue())!=null?i:[],e.project)):null},resolveDocumentation:t=>k("user:is Tag","The `user:is` tag can be used to check whether the currently authenticated user has one or more roles.","https://statamic.dev/tags/user-is")},oa=Cw;var Rw={tagName:"user:isnt",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!0,acceptsVariableInterpolation:!1,aliases:["roles"],allowsVariableReference:!1,name:"role",description:"The roles to check against",expectsTypes:["string","array"],isDynamic:!1}],resovleParameterCompletionItems:(t,e)=>{var n,r,i;return(t.name=="roles"||t.name=="role")&&((n=e.context)==null?void 0:n.parameterContext)!=null?te(ia((i=(r=e.context.parameterContext.parameter)==null?void 0:r.getArrayValue())!=null?i:[],e.project)):null},resolveDocumentation:t=>k("user:isnt Tag","The `user:isnt` tag can be used to check whether the currently authenticated user does not have one or more roles.","https://statamic.dev/tags/user-is#isnt")},aa=Rw;var Aw={tagName:"in",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!0,acceptsVariableInterpolation:!1,aliases:["groups"],allowsVariableReference:!1,name:"group",description:"The groups to check against",expectsTypes:["string","array"],isDynamic:!1}],resovleParameterCompletionItems:(t,e)=>{var n,r,i;return(t.name=="groups"||t.name=="group")&&((n=e.context)==null?void 0:n.parameterContext)!=null?te(ra((i=(r=e.context.parameterContext.parameter)==null?void 0:r.getArrayValue())!=null?i:[],e.project)):null},resolveCompletionItems:t=>(t.leftWord=="in"||t.leftWord=="/in")&&t.leftChar==":"?te(GT(t.project)):he,resolveDocumentation:t=>k("in Tag","The `in` tag can be used to check if the authenticated user belongs to one or more groups. This tag operates similarly to the `user:in` tag.","https://statamic.dev/tags/user-in")},HT=Aw;var xw={tagName:"not_found",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,parameters:[],introducedIn:null,resolveDocumentation:t=>Re("404 (Not Found) Tag","The `not_found` tag will trigger a 404 status code, and display the 404 template to the site visitor.",`{{ unless logged_in }} {{# Display the 404 Not Found page. #}} {{ not_found }} -{{ /unless }}`,"https://statamic.dev/tags/404")},YT=Rw;var Aw={tagName:"is",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!0,acceptsVariableInterpolation:!1,aliases:["roles"],allowsVariableReference:!1,name:"role",description:"The roles to check against",expectsTypes:["string","array"],isDynamic:!1}],resovleParameterCompletionItems:(t,e)=>{var n,r,i;return(t.name=="roles"||t.name=="role")&&((n=e.context)==null?void 0:n.parameterContext)!=null?te(ia((i=(r=e.context.parameterContext.parameter)==null?void 0:r.getArrayValue())!=null?i:[],e.project)):null},resolveCompletionItems:t=>(t.leftWord=="is"||t.leftWord=="/is")&&t.leftChar==":"?te(WT(t.project)):he,resolveDocumentation:t=>k("is Tag","The `is` tag can be used to check whether the currently authenticated user has one or more roles. This tag behaves the same as the `user:is` tag.","https://statamic.dev/tags/user-is")},KT=Aw;var xw={tagName:"widont",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[],resolveDocumentation:t=>Ee("widont Tag","The `widont` tag is similar to the [widont modifier](https://statamic.dev/modifiers/widont), and will attempt to prevent lines with a single word from appearing within the tags rendered output.",`{{ widont }} +{{ /unless }}`,"https://statamic.dev/tags/404")},YT=xw;var Ew={tagName:"is",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!0,acceptsVariableInterpolation:!1,aliases:["roles"],allowsVariableReference:!1,name:"role",description:"The roles to check against",expectsTypes:["string","array"],isDynamic:!1}],resovleParameterCompletionItems:(t,e)=>{var n,r,i;return(t.name=="roles"||t.name=="role")&&((n=e.context)==null?void 0:n.parameterContext)!=null?te(ia((i=(r=e.context.parameterContext.parameter)==null?void 0:r.getArrayValue())!=null?i:[],e.project)):null},resolveCompletionItems:t=>(t.leftWord=="is"||t.leftWord=="/is")&&t.leftChar==":"?te(WT(t.project)):he,resolveDocumentation:t=>k("is Tag","The `is` tag can be used to check whether the currently authenticated user has one or more roles. This tag behaves the same as the `user:is` tag.","https://statamic.dev/tags/user-is")},KT=Ew;var ww={tagName:"widont",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[],resolveDocumentation:t=>Re("widont Tag","The `widont` tag is similar to the [widont modifier](https://statamic.dev/modifiers/widont), and will attempt to prevent lines with a single word from appearing within the tags rendered output.",`{{ widont }} {{ content }} -{{ /widont }}`,null)},$T=xw;var Ic=[{isRequired:!1,acceptsVariableInterpolation:!1,allowsVariableReference:!0,aliases:[],name:"id",description:"The user ID to fetch",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,allowsVariableReference:!0,aliases:[],name:"email",description:"The email address to find the user by",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,allowsVariableReference:!0,aliases:[],name:"field",description:"The field to fetch the user by",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,allowsVariableReference:!0,aliases:[],name:"value",description:"The value to search for",expectsTypes:["string"],isDynamic:!1}];var Ew={tagName:"user:profile",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,parameters:Ic,introducedIn:null,augmentScope:(t,e)=>(e.injectBlueprint(t,"user"),e),resovleParameterCompletionItems:(t,e)=>t.name=="field"?te(Uu(e.project.getUserFields())):he,resolveDocumentation:t=>k("user:profile Tag","The `user:profile` tag provides access to the currently logged in user information, or for a specific user when using the `id`, `email`, or `field` parameter",null)},la=Ew;var zT={tagName:"dd",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[],resolveDocumentation:t=>Ee("dd Tag","The `dd` tag is a useful tag for debugging, and will display the raw data available at the point the tag is rendered. This tag will stop the template from rendering after it is encountered. If Ignition is available, this tag will use the [ddd](https://flareapp.io/blog/1-introducing-ddd-a-new-global-helper-for-laravel) method.",`{{ collection:articles }} +{{ /widont }}`,null)},$T=ww;var Sc=[{isRequired:!1,acceptsVariableInterpolation:!1,allowsVariableReference:!0,aliases:[],name:"id",description:"The user ID to fetch",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,allowsVariableReference:!0,aliases:[],name:"email",description:"The email address to find the user by",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,allowsVariableReference:!0,aliases:[],name:"field",description:"The field to fetch the user by",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,allowsVariableReference:!0,aliases:[],name:"value",description:"The value to search for",expectsTypes:["string"],isDynamic:!1}];var Ow={tagName:"user:profile",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,parameters:Sc,introducedIn:null,augmentScope:(t,e)=>(e.injectBlueprint(t,"user"),e),resovleParameterCompletionItems:(t,e)=>t.name=="field"?te(Gu(e.project.getUserFields())):he,resolveDocumentation:t=>k("user:profile Tag","The `user:profile` tag provides access to the currently logged in user information, or for a specific user when using the `id`, `email`, or `field` parameter",null)},la=Ow;var zT={tagName:"dd",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[],resolveDocumentation:t=>Re("dd Tag","The `dd` tag is a useful tag for debugging, and will display the raw data available at the point the tag is rendered. This tag will stop the template from rendering after it is encountered. If Ignition is available, this tag will use the [ddd](https://flareapp.io/blog/1-introducing-ddd-a-new-global-helper-for-laravel) method.",`{{ collection:articles }} {{# View all data available, for the first entry that renders the dd tag. #}} {{ dd }} -{{ /collection:articles }}`,null)},XT={tagName:"ddd",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[],resolveDocumentation:t=>Ee("ddd Tag","The `ddd` tag is a useful tag for debugging, and will display the raw data available at the point the tag is rendered. This tag will stop the template from rendering after it is encountered. If Ignition is available, this tag will use the [ddd](https://flareapp.io/blog/1-introducing-ddd-a-new-global-helper-for-laravel) method.",`{{ collection:articles }} +{{ /collection:articles }}`,null)},XT={tagName:"ddd",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[],resolveDocumentation:t=>Re("ddd Tag","The `ddd` tag is a useful tag for debugging, and will display the raw data available at the point the tag is rendered. This tag will stop the template from rendering after it is encountered. If Ignition is available, this tag will use the [ddd](https://flareapp.io/blog/1-introducing-ddd-a-new-global-helper-for-laravel) method.",`{{ collection:articles }} {{# View all data available, for the first entry that renders the ddd tag. #}} {{ ddd }} -{{ /collection:articles }}`,null)};var ww={tagName:"path",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!1,acceptsVariableInterpolation:!1,aliases:["src"],allowsVariableReference:!0,description:"The path source",name:"to",isDynamic:!1,expectsTypes:["string"]},{isRequired:!1,allowsVariableReference:!0,acceptsVariableInterpolation:!1,aliases:[],description:"Whether to generate absolute paths",expectsTypes:["boolean"],isDynamic:!1,name:"absolute"}],resolveDocumentation:t=>k("path Tag","The `path` tag can be used to generate URLs from relative URLs, or an entry ID.",null)},QT=ww;var Ow={tagName:"user:cant",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!1,allowsContentClose:!0,introducedIn:null,resovleParameterCompletionItems:sc,parameters:[{name:"do",acceptsVariableInterpolation:!1,aliases:["permission"],allowsVariableReference:!1,description:"The permissions to check against",expectsTypes:["string"],isRequired:!0,isDynamic:!1}],resolveDocumentation:t=>k("user:cant Tag","The `user:cant` tag is used to check if the currently authenticated user does not have a specific set of permissions. When used as a tag pair, the tag contents will only be rendered if the user does not have the specified permissions.","https://statamic.dev/tags/user-can#cant")},Sc=Ow;var Lw={tagName:"query",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!0,allowsArbitraryParameters:!1,allowsContentClose:!0,introducedIn:null,parameters:[{name:"builder",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"The query to evaluate",expectsTypes:["string"],isRequired:!0,isDynamic:!1}]},JT=Lw;var $s=Q(ot());var fi=[{isRequired:!0,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,name:"src",description:"The relative path to the file",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,name:"cache_bust",description:"Whether to output the last modified date",expectsTypes:["boolean"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,name:"version",description:"Whether to check a versioning manifest to produce the final URL",expectsTypes:["boolean"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,name:"absolute",description:"Generate absolute URLs or not",expectsTypes:["boolean"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,name:"locale",description:"The locale the path should be generated in",expectsTypes:["string"],isDynamic:!1}];var Dw=[{label:"asset",kind:$s.CompletionItemKind.Text},{label:"css",kind:$s.CompletionItemKind.Text},{label:"img",kind:$s.CompletionItemKind.Text},{label:"js",kind:$s.CompletionItemKind.Text},{label:"output",kind:$s.CompletionItemKind.Text},{label:"path",kind:$s.CompletionItemKind.Text}],kw={tagName:"theme",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,introducedIn:null,injectParentScope:!1,parameters:fi,resolveCompletionItems:t=>t.isPastTagPart==!1&&(t.leftWord=="theme"||t.leftWord=="/theme")&&t.leftChar==":"?te(Dw):he},ZT=kw;var Nd={tagName:"theme:path",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,introducedIn:null,parameters:fi,resolveDocumentation:t=>k("theme:path Tag","The `theme:path` tag may be used to generate URLs for public assets. This tag may also optionally add the current locale, generate relative URLs, or add cache busting URL parameters to the end of the generated URL.",null)},eN=et(Nd,"theme:asset");var Mw={tagName:"theme:css",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,introducedIn:null,parameters:[...fi,{isRequired:!1,isDynamic:!1,aliases:[],acceptsVariableInterpolation:!1,allowsVariableReference:!0,name:"tag",description:"Whether to generate an HTML tag",expectsTypes:["boolean"]}],resolveDocumentation:t=>k("theme:css Tag","The `theme:css` tag may be used to generate a CSS path relative to a public `css/` directory for any arbitrary file path. This tag may also optionally create the HTML `link` tag.",null)},tN=Mw;var Fw={tagName:"theme:img",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,introducedIn:null,parameters:[...fi,{isRequired:!1,isDynamic:!1,aliases:[],acceptsVariableInterpolation:!1,allowsVariableReference:!0,name:"tag",description:"Whether to generate an HTML tag",expectsTypes:["boolean"]},{isRequired:!1,isDynamic:!1,aliases:[],acceptsVariableInterpolation:!1,allowsVariableReference:!0,name:"alt",description:"The alt text to use when generating the HTML tag",expectsTypes:["string"]}],resolveDocumentation:t=>k("theme:img Tag","The `theme:img` tag may be used to generate an image path relative to a public `img/` directory for any arbitrary file path. This tag may also optionally create the HTML `img` tag.",null)},nN=Fw;var Vw={tagName:"theme:js",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,introducedIn:null,parameters:[...fi,{isRequired:!1,isDynamic:!1,aliases:[],acceptsVariableInterpolation:!1,allowsVariableReference:!0,name:"tag",description:"Whether to generate an HTML tag",expectsTypes:["boolean"]}],resolveDocumentation:t=>k("theme:js Tag","The `theme:js` tag may be used to generate a JavaScript path relative to a public `js/` directory for any arbitrary file path. This tag may also optionally create the HTML `script` tag.",null)},rN=Vw;var qw={tagName:"theme:output",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!0,requiresClose:!1,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!0,allowsVariableReference:!0,acceptsVariableInterpolation:!1,aliases:[],name:"src",description:"The path to the file",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,allowsVariableReference:!0,acceptsVariableInterpolation:!1,aliases:[],name:"as",description:"An optional alias for the contents variable",expectsTypes:["string"],isDynamic:!1}],augmentScope:(t,e)=>{if(t.isClosedBy!=null){let n=t.findParameter("as");n!=null?e.addVariable({name:n.value,dataType:"string",sourceField:null,sourceName:"*internal.theme.context",introducedBy:t}):e.addVariable({name:"output_contents",dataType:"string",sourceField:null,sourceName:"*internal.theme.context",introducedBy:t})}return e},resolveDocumentation:t=>k("theme:output Tag","The `theme:output` tag may be used to output the contents of any arbitrary file, relative to the site's `resources/` directory.",null)},iN=qw;var Bw={tagName:"scope",hideFromCompletions:!1,requiresClose:!0,allowsArbitraryParameters:!1,allowsContentClose:!1,injectParentScope:!1,introducedIn:null,parameters:[],resolveDocumentation:t=>Ee("scope Tag","The `scope` tag creates a copy of all available variables, and saves them to a new *array* variable defined by the tag's method part.",`{{ scope:scope_name }} +{{ /collection:articles }}`,null)};var Lw={tagName:"path",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!1,acceptsVariableInterpolation:!1,aliases:["src"],allowsVariableReference:!0,description:"The path source",name:"to",isDynamic:!1,expectsTypes:["string"]},{isRequired:!1,allowsVariableReference:!0,acceptsVariableInterpolation:!1,aliases:[],description:"Whether to generate absolute paths",expectsTypes:["boolean"],isDynamic:!1,name:"absolute"}],resolveDocumentation:t=>k("path Tag","The `path` tag can be used to generate URLs from relative URLs, or an entry ID.",null)},QT=Lw;var Dw={tagName:"user:cant",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!1,allowsContentClose:!0,introducedIn:null,resovleParameterCompletionItems:oc,parameters:[{name:"do",acceptsVariableInterpolation:!1,aliases:["permission"],allowsVariableReference:!1,description:"The permissions to check against",expectsTypes:["string"],isRequired:!0,isDynamic:!1}],resolveDocumentation:t=>k("user:cant Tag","The `user:cant` tag is used to check if the currently authenticated user does not have a specific set of permissions. When used as a tag pair, the tag contents will only be rendered if the user does not have the specified permissions.","https://statamic.dev/tags/user-can#cant")},Cc=Dw;var kw={tagName:"query",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!0,allowsArbitraryParameters:!1,allowsContentClose:!0,introducedIn:null,parameters:[{name:"builder",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"The query to evaluate",expectsTypes:["string"],isRequired:!0,isDynamic:!1}]},JT=kw;var $s=Q(ot());var fi=[{isRequired:!0,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,name:"src",description:"The relative path to the file",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,name:"cache_bust",description:"Whether to output the last modified date",expectsTypes:["boolean"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,name:"version",description:"Whether to check a versioning manifest to produce the final URL",expectsTypes:["boolean"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,name:"absolute",description:"Generate absolute URLs or not",expectsTypes:["boolean"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,name:"locale",description:"The locale the path should be generated in",expectsTypes:["string"],isDynamic:!1}];var Mw=[{label:"asset",kind:$s.CompletionItemKind.Text},{label:"css",kind:$s.CompletionItemKind.Text},{label:"img",kind:$s.CompletionItemKind.Text},{label:"js",kind:$s.CompletionItemKind.Text},{label:"output",kind:$s.CompletionItemKind.Text},{label:"path",kind:$s.CompletionItemKind.Text}],Fw={tagName:"theme",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,introducedIn:null,injectParentScope:!1,parameters:fi,resolveCompletionItems:t=>t.isPastTagPart==!1&&(t.leftWord=="theme"||t.leftWord=="/theme")&&t.leftChar==":"?te(Mw):he},ZT=Fw;var vd={tagName:"theme:path",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,introducedIn:null,parameters:fi,resolveDocumentation:t=>k("theme:path Tag","The `theme:path` tag may be used to generate URLs for public assets. This tag may also optionally add the current locale, generate relative URLs, or add cache busting URL parameters to the end of the generated URL.",null)},eN=et(vd,"theme:asset");var Vw={tagName:"theme:css",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,introducedIn:null,parameters:[...fi,{isRequired:!1,isDynamic:!1,aliases:[],acceptsVariableInterpolation:!1,allowsVariableReference:!0,name:"tag",description:"Whether to generate an HTML tag",expectsTypes:["boolean"]}],resolveDocumentation:t=>k("theme:css Tag","The `theme:css` tag may be used to generate a CSS path relative to a public `css/` directory for any arbitrary file path. This tag may also optionally create the HTML `link` tag.",null)},tN=Vw;var qw={tagName:"theme:img",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,introducedIn:null,parameters:[...fi,{isRequired:!1,isDynamic:!1,aliases:[],acceptsVariableInterpolation:!1,allowsVariableReference:!0,name:"tag",description:"Whether to generate an HTML tag",expectsTypes:["boolean"]},{isRequired:!1,isDynamic:!1,aliases:[],acceptsVariableInterpolation:!1,allowsVariableReference:!0,name:"alt",description:"The alt text to use when generating the HTML tag",expectsTypes:["string"]}],resolveDocumentation:t=>k("theme:img Tag","The `theme:img` tag may be used to generate an image path relative to a public `img/` directory for any arbitrary file path. This tag may also optionally create the HTML `img` tag.",null)},nN=qw;var Bw={tagName:"theme:js",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,introducedIn:null,parameters:[...fi,{isRequired:!1,isDynamic:!1,aliases:[],acceptsVariableInterpolation:!1,allowsVariableReference:!0,name:"tag",description:"Whether to generate an HTML tag",expectsTypes:["boolean"]}],resolveDocumentation:t=>k("theme:js Tag","The `theme:js` tag may be used to generate a JavaScript path relative to a public `js/` directory for any arbitrary file path. This tag may also optionally create the HTML `script` tag.",null)},rN=Bw;var jw={tagName:"theme:output",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!0,requiresClose:!1,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!0,allowsVariableReference:!0,acceptsVariableInterpolation:!1,aliases:[],name:"src",description:"The path to the file",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,allowsVariableReference:!0,acceptsVariableInterpolation:!1,aliases:[],name:"as",description:"An optional alias for the contents variable",expectsTypes:["string"],isDynamic:!1}],augmentScope:(t,e)=>{if(t.isClosedBy!=null){let n=t.findParameter("as");n!=null?e.addVariable({name:n.value,dataType:"string",sourceField:null,sourceName:"*internal.theme.context",introducedBy:t}):e.addVariable({name:"output_contents",dataType:"string",sourceField:null,sourceName:"*internal.theme.context",introducedBy:t})}return e},resolveDocumentation:t=>k("theme:output Tag","The `theme:output` tag may be used to output the contents of any arbitrary file, relative to the site's `resources/` directory.",null)},iN=jw;var Uw={tagName:"scope",hideFromCompletions:!1,requiresClose:!0,allowsArbitraryParameters:!1,allowsContentClose:!1,injectParentScope:!1,introducedIn:null,parameters:[],resolveDocumentation:t=>Re("scope Tag","The `scope` tag creates a copy of all available variables, and saves them to a new *array* variable defined by the tag's method part.",`{{ scope:scope_name }} {{ scope_name:title }} {{ /scope:scope_name }} -`,null)},sN=Bw;var jw={tagName:"if",hideFromCompletions:!0,allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!0,injectParentScope:!0,introducedIn:null,parameters:[],resolveDynamicParameter:je,resolveDocumentation:t=>k("if Conditional Control Structure","The contents of the `if` tag will be rendered when it's expression evaluates to `true`.","https://statamic.dev/antlers#conditions")},oN=jw;var Uw={tagName:"elseif",hideFromCompletions:!0,allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!0,injectParentScope:!0,introducedIn:null,parameters:[],resolveDynamicParameter:je,resolveDocumentation:t=>k("elseif Conditional Control Structure","The contents of the `elseif` tag will be rendered when it's expression evaluates to `true`.","https://statamic.dev/antlers#conditions")},aN=Uw;var Gw={tagName:"else",hideFromCompletions:!0,allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!0,injectParentScope:!0,introducedIn:null,parameters:[],resolveDocumentation:t=>k("else Conditional Control Structure","The contents of the `else` control structure will be evaluated when all previous conditional branch conditions were not met.","https://statamic.dev/antlers#conditions")},lN=Gw;var uN=Q(ot());var Ww={tagName:"session:has",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!0,allowsContentClose:!0,parameters:[],introducedIn:"3.1.28",resolveDynamicParameter:je,resolveDocumentation:t=>k("session:has Tag","The `session:has` tag can be used to determine of the user's session contains a specific variable.","https://statamic.dev/tags/session-has")},Cc=Ww;var Hw=[be(ac),be(cc),be(lc),be(uc),be(Cc),be(oc)],Yw={tagName:"session",requiresClose:!1,allowsContentClose:!0,allowsArbitraryParameters:!1,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[{name:"as",description:"An optional alias for the session data",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1}],resolveCompletionItems:t=>{var e,n;if(t.isPastTagPart==!1&&(t.leftWord=="session"||t.leftWord=="/session")&&t.leftChar==":"){let r=(n=(e=Ys.instance)==null?void 0:e.getKnownSessionVariableNames())!=null?n:[],i=[];i=i.concat(Hw);for(let s=0;s{var s,o;let n=t.findParameter("as"),r=(o=(s=Ys.instance)==null?void 0:s.getKnownSessionVariableNames())!=null?o:[],i=[];for(let a=0;a(e.addVariables([{name:"success",dataType:"boolean",sourceField:null,sourceName:"*internal.user.reset_password",introducedBy:t},{name:"url_invalid",dataType:"boolean",sourceField:null,sourceName:"*internal.user.reset_password",introducedBy:t},{name:"errors",dataType:"array",sourceField:null,sourceName:"*internal.user.reset_password",introducedBy:t}]),e),resolveDocumentation:t=>k("user:forgot_password_form Tag",'The `user:forgot_password_form` tag is used to quickly create a "forgot password" form for site users.',"https://statamic.dev/tags/user-forgot_password_form")},vd=et(gl,"member:forgot_password_form");vd.resolveDocumentation=t=>k("member:forgot_password_form Tag",'The `member:forgot_password_form` tag is used to quickly create a "forgot password" form for site users.',"https://statamic.dev/tags/user-forgot_password_form");var _l={tagName:"user:reset_password_form",allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!0,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[{name:"redirect",description:"Where the user should be taken after submitting the form",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,expectsTypes:["string"],isDynamic:!1,isRequired:!1}],resolveDynamicParameter:je,augmentScope:(t,e)=>(e.addVariables([{name:"success",dataType:"boolean",sourceField:null,sourceName:"*internal.user.password_reset",introducedBy:t},{name:"url_invalid",dataType:"boolean",sourceField:null,sourceName:"*internal.user.password_reset",introducedBy:t},{name:"errors",dataType:"array",sourceField:null,sourceName:"*internal.user.password_reset",introducedBy:t}]),e),resolveDocumentation:t=>k("user:reset_password_form Tag","The `user:reset_password_form` tag is used to quickly create password reset forms. Forms created with this tag should be displayed after a user has received and clicked a password reset email link.","https://statamic.dev/tags/user-reset_password_form")},Pd=et(_l,"member:reset_password_form");Pd.resolveDocumentation=t=>k("member:reset_password_form Tag","The `member:reset_password_form` tag is used to quickly create password reset forms. Forms created with this tag should be displayed after a user has received and clicked a password reset email link.","https://statamic.dev/tags/user-reset_password_form");function fN(t,e){return{sourceName:e.blueprintName,dataType:e.type,name:e.name,sourceField:e,introducedBy:t}}function pN(t){let e=new Map;for(let n=0;n{e.addVariableArray("fields",Rc(t)),e.addVariable({name:"errors",dataType:"array",sourceName:"*internal.user.register_form",sourceField:null,introducedBy:t}),e.addVariable({name:"old",dataType:"array",sourceName:"*internal.user.register_form",sourceField:null,introducedBy:t}),e.addVariable({name:"error",dataType:"array",sourceName:"*internal.user.register_form",sourceField:null,introducedBy:t}),e.addVariable({name:"success",dataType:"string",sourceName:"*internal.user.register_form",sourceField:null,introducedBy:t});let n=e.statamicProject.getUserFields();if(n.length>0){let r=ua(t,n);e.addVariableArray("old",r),e.addVariableArray("error",r)}return e},resolveDocumentation:t=>k("user:register_form Form Tag","The `user:register_form` tag can be used to build out public registration forms for new users.","https://statamic.dev/tags/user-register_form")},Id=et(yl,"member:register_form");Id.resolveDocumentation=t=>k("member:register_form Tag","The `member:register_form` tag can be used to build out public registration forms for new users.","https://statamic.dev/tags/user-register_form");var Kw=[be(oa),be(sa),be(aa),be(la),be(ea),be(Sc),be(gl),be(ta),be(na),be(yl),be(_l)],$w={tagName:"user",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,parameters:Ic,introducedIn:null,resovleParameterCompletionItems:(t,e)=>e.isPastTagPart==!1&&e.currentNode!=null&&e.currentNode.methodIsEmptyOrMatches("profile")&&t.name=="field"?te(Uu(e.project.getUserFields())):he,augmentScope:(t,e)=>(t.methodIsEmptyOrMatches("profile")&&e.injectUserFields(t),e),resolveCompletionItems:t=>(t.leftWord=="user"||t.leftWord=="/user"||t.leftWord=="member"||t.leftWord=="/member")&&t.leftChar==":"?te(Kw):he,resolveDocumentation:t=>k("user Tag","The `user` tag provides access to the currently logged in user information, or for a specific user when using the `id`, `email`, or `field` parameter",null)},Ac=$w;var xc=et(Ac,"member"),Sd=et(oa,"member:is"),Cd=et(aa,"member:isnt"),Rd=et(la,"member:profile"),Ad=et(ea,"member:can"),xd=et(ta,"member:logout"),Ed=et(na,"member:logout_url"),wd=et(Pc,"member:in"),Od=et(sa,"member:not_in");xc.hideFromCompletions=!0;xc.resolveDocumentation=t=>k("member Tag","The `member` tag provides access to the currently logged in user information, or for a specific user when using the `id`, `email`, or `field` parameter",null);Sd.resolveDocumentation=t=>k("member:is Tag","The `member:is` tag can be used to check whether the currently authenticated user has one or more roles.","https://statamic.dev/tags/user-is");Cd.resolveDocumentation=t=>k("member:isnt Tag","The `member:isnt` tag can be used to check whether the currently authenticated user does not have one or more roles.","https://statamic.dev/tags/user-is#isnt");Rd.resolveDocumentation=t=>k("member:profile Tag","The `member:profile` tag provides access to the currently logged in user information, or for a specific user when using the `id`, `email`, or `field` parameter",null);Ad.resolveDocumentation=t=>k("member:can Tag","The `member:can` tag is used to check if the currently authenticated user has a specific set of permissions. When used as a tag pair, the tag contents will only be rendered if the user has the specified permissions.","https://statamic.dev/tags/user-can");xd.resolveDocumentation=t=>k("member:logout Tag","The `member:logout` tag will sign out the currently authenticated user. An optional `redirect` parameter may be used to redirect the visitor to a different page after being logged out.","https://statamic.dev/tags/user-logout");Ed.resolveDocumentation=t=>Ee("member:logout_url","The `member:logout_url` tag can be used to retrieve the URL that will sign the current user out.",'Log out',"https://statamic.dev/tags/user-logout_url");wd.resolveDocumentation=t=>k("member:in Tag","The `member:in` tag can be used to check if the currently authenticated user belongs to one or more user groups. When used as a tag pair, the tag contents will only be rendered if the user belongs to the specified groups.","https://statamic.dev/tags/user-in");Od.resolveDocumentation=t=>k("member:not_in Tag","The `member:not_in` tag can be used to check if the currently authenticated user does not belong to one or more user groups. When used as a tag pair, the tag contents will be rendered if the user does not belong to the specified groups.","https://statamic.dev/tags/user-in#not-in");function ps(t){return[{name:"title",dataType:"string",sourceField:null,sourceName:"*internal.routeable",introducedBy:t},{name:"url",dataType:"string",sourceField:null,sourceName:"*internal.routeable",introducedBy:t}]}var hN=Q(ot());var Ld=["from","taxonomy","is","use","folder"],Dd=["not_from","not_in","dont_use","not_taxonomy"];var kd=Ld;kd=kd.concat(Dd);function dN(t,e){var n,r,i,s,o,a,l,u;if(e.nodesInScope.length>0){let c=e.nodesInScope[e.nodesInScope.length-1];if(c!=null&&c.currentScope!=null){let f=ca(c,e.project),m=e.project.getTaxonomyBlueprintFields(f),d=m.map(_=>_.name),p=Di(e.leftWord);if(d.includes(p))return te(os(e))}}return t.name=="collection"&&((n=e.context)==null?void 0:n.parameterContext)!=null?te(Wo((s=(i=(r=e.context)==null?void 0:r.parameterContext.parameter)==null?void 0:i.getArrayValue())!=null?s:[],e.project)):t.name=="filter"||t.name=="query_scope"?te(Wu(e.project)):kd.includes(t.name)&&((o=e.context)==null?void 0:o.parameterContext)!=null?te(mN((u=(l=(a=e.context)==null?void 0:a.parameterContext.parameter)==null?void 0:l.getArrayValue())!=null?u:[],e.project)):null}function ca(t,e){let n=[];if(t.hasMethodPart())return n.push(t.getMethodNameValue()),n;let r=t.findAnyParameter(Ld),i=t.findAnyParameter(Dd),s=[],o=[];return typeof r!="undefined"&&r!==null&&(r.value.trim()==="*"?(s=e.getUniqueTaxonomyNames(),typeof i!="undefined"&&i!==null&&i.isVariableReference==!1&&i.hasInterpolations()==!1&&(o=i.getArrayValue())):r.isVariableReference==!1&&r.hasInterpolations()==!1&&(s=r.getArrayValue())),o.length>0?n=s.filter(function(a){return o.includes(a)==!1}):n=s,n}function mN(t,e){let n=[],r=e.getUniqueTaxonomyNames().filter(i=>!t.includes(i));for(let i=0;i0){let o=e.statamicProject.getBlueprintFields(s);e.introduceScopedAliasScope(t,"entries","entries",o).addVariables(as(t))}else e.addVariableArray("entries",ps(t).concat(as(t)))}else e.addVariableArray("entries",ps(t).concat(as(t)));return e}var zw=[{name:"from",description:"The taxonomy to use",aliases:["taxonomy","is","use","folder"],acceptsVariableInterpolation:!1,allowsVariableReference:!1,expectsTypes:["string","array"],isDynamic:!1,isRequired:!1},{name:"not_from",description:"Taxonomies to exclude",aliases:["not_in","not_folder","dont_use","not_taxonomy"],allowsVariableReference:!1,acceptsVariableInterpolation:!1,expectsTypes:["string","array"],isRequired:!1,isDynamic:!1},{name:"min_count",description:"The minimum number of entries a taxonomy term must have to be returned",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1,isRequired:!1},{name:"collection",description:"Filter the terms to those that appear in the specified collections",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["string","array"],isDynamic:!1,isRequired:!1},{name:"sort",description:"The field to sort terms by",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1},{isRequired:!1,name:"filter",aliases:["query_scope"],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"Specifies a custom query scope",expectsTypes:["string"],isDynamic:!1}],_N=zw;var Md=Q(ot());function yN(t){var n,r;let e=[];if(t.currentNode!=null&&t.currentNode.currentScope!=null){let i=ca(t.currentNode,t.project),s=t.project.getTaxonomyBlueprintFields(i),o=s.map(l=>l.name),a=Di(t.leftWord);if(o.includes(a))return te(os(t));if(t.isCaretInTag&&!((n=t.context)==null?void 0:n.interpolatedContext)&&["taxonomy","/taxonomy"].includes(t.leftWord)==!1){let l=[];for(let u=0;u0)return dn(e)}}if((t.leftWord=="taxonomy"||t.leftWord=="/taxonomy")&&t.leftChar==":"){let i=t.project.getUniqueTaxonomyNames();for(let s=0;sk("taxonomy Tag","The `taxonomy` tag may be used to retrieve taxonomy entries. The taxonomy tag can also be used to access entries associated with any given taxonomy term.","https://statamic.dev/tags/taxonomy")},bN=Xw;var Fd=Q(ot());function TN(t,e){e.addVariables([{name:"is_published",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"is_page",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"is_entry",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"has_entries",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"is_parent",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"is_current",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"is_external",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"depth",dataType:"number",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"children",dataType:"array",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"first",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"last",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"count",dataType:"integer",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"index",dataType:"integer",sourceField:null,sourceName:"*internal.nav",introducedBy:t}]);let n=e.statamicProject.getUniqueCollectionNames(),r=[],i=!1;if(t.hasMethodPart()){let s=t.getMethodNameValue().trim().toLowerCase();if(s.startsWith("collection:")){let o=s.split(":").pop();i=!0,r.push(o)}else s=="pages"?(i=!0,r.push("pages")):(i=!1,r.push(s))}else{let s=t.findParameter("handle");s!=null&&(n.includes(s.value)?i=!0:i=!1,r.push(s.value))}if(i){let s=e.statamicProject.getBlueprintFields(r);e.addBlueprintFields(t,s),e.expandScopedAliasScope(t,"page","page",s)}else{let s=Gu(ps(t));e.addBlueprintFields(t,s),e.expandScopedAliasScope(t,"page","page",s)}return e}var Qw={tagName:"nav:breadcrumbs",allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,hideFromCompletions:!1,introducedIn:null,injectParentScope:!1,parameters:[{name:"include_home",description:"Whether to include the home page in the first level",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["boolean"],isDynamic:!1,isRequired:!1},{name:"reverse",description:"Whether to reverse the order of links",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["boolean"],isRequired:!1,isDynamic:!1},{name:"trim",description:"Whether to trim the whitespace after each iteration of the loop",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["boolean"],isDynamic:!1,isRequired:!1}],augmentScope:(t,e)=>(e.addVariables([{name:"is_current",dataType:"boolean",sourceName:"*internal.nav.breadcrumbs",sourceField:null,introducedBy:t}]),e.addVariables(ps(t)),e),resolveDocumentation:t=>k("nav:breadcrumbs Tag","The `nav:breadcrumbs` tag can be used to retrieve the URLs of all pages that make up the current URL back to the site's home page.","https://statamic.dev/tags/nav-breadcrumbs")},Ec=Qw;function NN(t,e){if(t.name=="handle"){let n=e.project.getUniqueCollectionNames(),r=e.project.getUniqueNavigationMenuNames(),i=[];return i=n,i=i.concat(r),i=[...new Set(i)],pt(i)}return null}var Jw=[{isRequired:!1,acceptsVariableInterpolation:!1,aliases:["handle"],allowsVariableReference:!1,name:"for",description:"The navigation or collection to use",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],name:"from",description:"The starting point for the navigation",allowsVariableReference:!0,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,name:"show_unpublished",description:"Whether to include unpublished content",expectsTypes:["boolean"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,name:"include_home",description:"Whether to include the home page in the tree",expectsTypes:["boolean"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,name:"max_depth",description:"The maximum depth of the navigation or structure",expectsTypes:["number"],isDynamic:!1}],vN=Jw;var Vd={tagName:"structure",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,introducedIn:null,injectParentScope:!1,parameters:vN,augmentScope:TN,resovleParameterCompletionItems:NN,resolveCompletionItems:t=>{let e=[];if(t.isPastTagPart==!1&&(t.leftWord=="nav"||t.leftWord=="/nav"||t.leftWord=="structure"||t.leftWord=="/structure")&&t.leftChar==":"){let n=t.project.getUniqueNavigationMenuNames();for(let r=0;rk("nav Tag","The `nav` tag can be used to iterate structured collections or navigation menus.","https://statamic.dev/tags/nav")},PN=et(Vd,"nav");var CN=Q(ot());function IN(t){return[{name:"success",dataType:"string",sourceField:null,sourceName:"*internal.forms",introducedBy:t},{name:"submission_created",dataType:"boolean",sourceField:null,sourceName:"*internal.forms",introducedBy:t}]}var Zw={name:"in",description:"The form to use",acceptsVariableInterpolation:!0,aliases:["handle","is","form","formset"],allowsVariableReference:!0,expectsTypes:["string"],isDynamic:!1,isRequired:!1},pi=Zw;var qd=Q(ot()),eO=[{label:"GET",kind:qd.CompletionItemKind.EnumMember},{label:"POST",kind:qd.CompletionItemKind.EnumMember}],SN=eO;var zr=["in","handle","is","form","formset"];function fa(t,e){return zr.includes(t.name)?pt(e.project.getUniqueFormNames()):t.name=="method"?te(SN):t.name=="files"?te(Ko):null}function di(t,e){let n=t.structure.findParentWithName("form:set");return n!=null?{context:n,issues:[]}:{context:null,issues:[]}}var tO=["set","create","errors","success","submissions","submission"];function zs(t){if(t.reference!=null&&"tagPart"in t.reference){let r=t.reference;if(r.nameMatches("form:set"))return zs(r)}let e=t.findAnyParameter(zr),n=t.getMethodNameValue();return n!=null&&tO.includes(n)==!1?n:typeof e!="undefined"&&e!==null&&e.containsSimpleValue()?e.value:""}var nO={tagName:"form:create",allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!0,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[pi,{name:"method",description:"The HTTP method to use",allowsVariableReference:!1,acceptsVariableInterpolation:!1,aliases:[],expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"files",description:"Indicates if the form sends file data",aliases:[],allowsVariableReference:!1,acceptsVariableInterpolation:!1,expectsTypes:["boolean"],isDynamic:!1,isRequired:!1},{name:"redirect",description:"The location to redirect users after a successful form submission",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"error_redirect",description:"The location to redirect users to after a failed form submission",allowsVariableReference:!1,acceptsVariableInterpolation:!1,aliases:[],expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"allow_request_redirect",description:"Indicates if query parameters can override redirect or error_redirect",aliases:[],acceptsVariableInterpolation:!1,allowsVariableReference:!1,expectsTypes:["boolean"],isDynamic:!1,isRequired:!1}],resolveSpecialType:di,resovleParameterCompletionItems:fa,resolveDynamicParameter:je,augmentScope:(t,e)=>{e.addVariables(IN(t)),e.addVariable({dataType:"array",name:"errors",sourceField:null,sourceName:"*internal.forms",introducedBy:t}),e.addVariableArray("fields",Rc(t));let n=zs(t);if(n.length>0){let r=e.statamicProject.getFormBlueprintFields(n),i=ua(t,r);e.addVariableArray("old",i),e.addVariableArray("error",i)}return e},resolveDocumentation:t=>k("form:create Tag","The `form:create` tag can be used to access form data, generate field HTML markup, and handle form validation errors.","https://statamic.dev/tags/form-create")},wc=nO;var rO={tagName:"form:errors",allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[pi],resolveSpecialType:di,resovleParameterCompletionItems:(t,e)=>zr.includes(t.name)?pt(e.project.getUniqueFormNames()):null,resolveDocumentation:t=>k("form:errors Tag","The `form:errors` tag can be used to retrieve validation errors after a user has submitted a form.","https://statamic.dev/tags/form-errors")},Oc=rO;var iO={tagName:"form:set",allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[{name:"in",description:"The form to use",acceptsVariableInterpolation:!0,aliases:["handle","is","form","formset"],allowsVariableReference:!0,expectsTypes:["string"],isDynamic:!1,isRequired:!0}],resovleParameterCompletionItems:fa,resolveDocumentation:t=>k("form:set Tag","The `form:set` tag can be used to set the form handle on all nested form tags.","https://statamic.dev/tags/form-set")},Lc=iO;var sO={tagName:"form:submission",requiresClose:!0,allowsContentClose:!1,allowsArbitraryParameters:!1,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[pi],resolveSpecialType:di,resovleParameterCompletionItems:(t,e)=>zr.includes(t.name)?pt(e.project.getUniqueFormNames()):null,augmentScope:(t,e)=>{let n=zs(t);if(n.length>0){let r=e.statamicProject.getFormBlueprintFields(n);e.addBlueprintFields(t,r)}return e},resolveDocumentation:t=>k("form:submission Tag","The `form:submission` tag can be used to access the form submission submitted by the current user.","https://statamic.dev/tags/form-submission")},Dc=sO;var oO={tagName:"form:submissions",allowsArbitraryParameters:!1,allowsContentClose:!1,hideFromCompletions:!1,injectParentScope:!1,requiresClose:!0,introducedIn:null,parameters:[pi],resolveSpecialType:di,resovleParameterCompletionItems:(t,e)=>zr.includes(t.name)?pt(e.project.getUniqueFormNames()):null,augmentScope:(t,e)=>{if(t.isClosingTag)return e;let n=zs(t);if(n.length>0){let r=e.statamicProject.getFormBlueprintFields(n);e.addBlueprintFields(t,r)}return e.addVariable({name:"date",dataType:"date",sourceField:null,sourceName:"*internal.forms.submissions",introducedBy:t}),e.addVariable({name:"no_results",dataType:"boolean",sourceField:null,sourceName:"*internal.forms.submissions",introducedBy:t}),e.addVariable({name:"total_results",dataType:"number",sourceField:null,sourceName:"*internal.forms.submissions",introducedBy:t}),e},resolveDocumentation:t=>k("form:submissions Tag","The `form:submissions` tag can be used to fetch previously saved submissions for a form.","https://statamic.dev/tags/form-submissions")},kc=oO;var aO={tagName:"form:success",allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[pi],resolveSpecialType:di,resovleParameterCompletionItems:(t,e)=>zr.includes(t.name)?pt(e.project.getUniqueFormNames()):null,resolveDocumentation:t=>k("form:success Tag","The `form:success` tag can be used to check if a form submission was successful or not.","https://statamic.dev/tags/form-success")},Mc=aO;var lO=[be(Lc),be(wc),be(Oc),be(Mc),be(kc),be(Dc)],uO={tagName:"form",allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[],resovleParameterCompletionItems:fa,resolveCompletionItems:t=>{let e=[];if(t.isPastTagPart==!1&&(t.leftWord=="form"||t.leftWord=="/form")&&t.leftChar==":"){let n=t.project.getUniqueFormNames();e=e.concat(lO);for(let r=0;rt.name=="index"?pt(e.project.getSearchIndexes()):null,augmentScope:(t,e)=>{e.addVariables([{name:"no_results",dataType:"boolean",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"total_results",dataType:"number",sourceField:null,sourceName:"*internal.search.results",introducedBy:t}]);let n=t.findParameter("as");return n!=null&&n.value.trim().length>0?e.addVariableArray(n.value,AN(t)):e.addVariables(AN(t)),e},resolveDocumentation:t=>k("search:results Tag","The `search:results` tag provides access to all data that was returned as a result of a user's search.","https://statamic.dev/tags/search")},cO=[be(Bd)];function AN(t){return[{name:"url",dataType:"string",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"title",dataType:"string",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"content",dataType:"string",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"first",dataType:"boolean",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"last",dataType:"boolean",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"is_entry",dataType:"boolean",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"is_term",dataType:"boolean",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"count",dataType:"number",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"index",dataType:"number",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"search_score",dataType:"number",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"_highlightResult",dataType:"array",sourceField:null,sourceName:"*internal.search.results",introducedBy:t}]}var xN={tagName:"search",allowsArbitraryParameters:!1,requiresClose:!0,allowsContentClose:!1,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[],resolveCompletionItems:t=>t.isPastTagPart==!1&&(t.leftWord=="search"||t.leftWord=="/search")&&t.leftChar==":"?dn(cO):he};function jd(t){return[{name:"email",dataType:"string",sourceName:"*internal.user.login",sourceField:null,introducedBy:t},{name:"password",dataType:"string",sourceName:"*internal.user.login",sourceField:null,introducedBy:t}]}var Ud={tagName:"user:login_form",allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!0,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[{name:"redirect",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,description:"Where the user should be redirected after logging in",expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"error_redirect",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,description:"Where the user should be redirected after failed login attempts",expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"allow_request_redirect",description:"Indicates if query parameters can override the redirect and error_redirect parameters",acceptsVariableInterpolation:!1,allowsVariableReference:!0,aliases:[],expectsTypes:["boolean"],isDynamic:!1,isRequired:!1}],resolveDynamicParameter:je,augmentScope:(t,e)=>(e.addVariables([{name:"errors",dataType:"array",sourceName:"*internal.user.login",sourceField:null,introducedBy:t},{name:"success",dataType:"string",sourceName:"*internal.user.login",sourceField:null,introducedBy:t}]),e.addVariables(jd(t)),e.addVariableArray("old",jd(t)),e.addVariableArray("error",jd(t)),e),resolveDocumentation:t=>k("user:login_form Tag","The `user:login_form` tag can be used to quickly create a form that users can use to authenticate with the site.","https://statamic.dev/tags/user-login_form")},EN=et(Ud,"member:login_form");var fO={tagName:"noparse",requiresClose:!0,allowsArbitraryParameters:!1,allowsContentClose:!1,hideFromCompletions:!1,injectParentScope:!1,parameters:[],introducedIn:null,resolveDocumentation:t=>k("noparse Tag","The `noparse` tag is used prevent blocks of Antlers code from being parsed, removing the need to escape individual Antlers code regions.","https://statamic.dev/antlers#the-noparse-tag")},wN=fO;var pO={tagName:"unless",hideFromCompletions:!0,allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!0,injectParentScope:!0,introducedIn:null,parameters:[],resolveDynamicParameter:je,resolveDocumentation:t=>k("unless Conditional Control Structure","The `unless` control structure operates the same as an `if` statement, but has it's logic inverted.","https://statamic.dev/antlers#conditions")},ON=pO;var dO={tagName:"elseunless",hideFromCompletions:!0,allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!0,injectParentScope:!0,introducedIn:null,parameters:[],resolveDynamicParameter:je,resolveDocumentation:t=>k("elseunless Conditional Control Structure","The `elseunless` control structure operates the same as an `elseif` statement, but has it's logic inverted.","https://statamic.dev/antlers#conditions")},LN=dO;var DN=Q(nn());var kN={tagName:"installed",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!0,introducedIn:"3.1.19",parameters:[],resolveCompletionItems:t=>{if(t.project!=null){let e=t.project.getComposerPackages(),n=[];return e.forEach((r,i)=>{n.push({label:r.name,kind:DN.CompletionItemKind.Text})}),te(n)}return he},resolveDocumentation:t=>Ee("installed Tag","The `installed` tag is used to check if the site has a specific Composer package available.",`{{ if {installed:composer/package-name} }} +`,null)},sN=Uw;var Gw={tagName:"if",hideFromCompletions:!0,allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!0,injectParentScope:!0,introducedIn:null,parameters:[],resolveDynamicParameter:je,resolveDocumentation:t=>k("if Conditional Control Structure","The contents of the `if` tag will be rendered when it's expression evaluates to `true`.","https://statamic.dev/antlers#conditions")},oN=Gw;var Ww={tagName:"elseif",hideFromCompletions:!0,allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!0,injectParentScope:!0,introducedIn:null,parameters:[],resolveDynamicParameter:je,resolveDocumentation:t=>k("elseif Conditional Control Structure","The contents of the `elseif` tag will be rendered when it's expression evaluates to `true`.","https://statamic.dev/antlers#conditions")},aN=Ww;var Hw={tagName:"else",hideFromCompletions:!0,allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!0,injectParentScope:!0,introducedIn:null,parameters:[],resolveDocumentation:t=>k("else Conditional Control Structure","The contents of the `else` control structure will be evaluated when all previous conditional branch conditions were not met.","https://statamic.dev/antlers#conditions")},lN=Hw;var uN=Q(ot());var Yw={tagName:"session:has",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!0,allowsContentClose:!0,parameters:[],introducedIn:"3.1.28",resolveDynamicParameter:je,resolveDocumentation:t=>k("session:has Tag","The `session:has` tag can be used to determine of the user's session contains a specific variable.","https://statamic.dev/tags/session-has")},Rc=Yw;var Kw=[be(lc),be(fc),be(uc),be(cc),be(Rc),be(ac)],$w={tagName:"session",requiresClose:!1,allowsContentClose:!0,allowsArbitraryParameters:!1,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[{name:"as",description:"An optional alias for the session data",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1}],resolveCompletionItems:t=>{var e,n;if(t.isPastTagPart==!1&&(t.leftWord=="session"||t.leftWord=="/session")&&t.leftChar==":"){let r=(n=(e=Ys.instance)==null?void 0:e.getKnownSessionVariableNames())!=null?n:[],i=[];i=i.concat(Kw);for(let s=0;s{var s,o;let n=t.findParameter("as"),r=(o=(s=Ys.instance)==null?void 0:s.getKnownSessionVariableNames())!=null?o:[],i=[];for(let a=0;a(e.addVariables([{name:"success",dataType:"boolean",sourceField:null,sourceName:"*internal.user.reset_password",introducedBy:t},{name:"url_invalid",dataType:"boolean",sourceField:null,sourceName:"*internal.user.reset_password",introducedBy:t},{name:"errors",dataType:"array",sourceField:null,sourceName:"*internal.user.reset_password",introducedBy:t}]),e),resolveDocumentation:t=>k("user:forgot_password_form Tag",'The `user:forgot_password_form` tag is used to quickly create a "forgot password" form for site users.',"https://statamic.dev/tags/user-forgot_password_form")},Pd=et(gl,"member:forgot_password_form");Pd.resolveDocumentation=t=>k("member:forgot_password_form Tag",'The `member:forgot_password_form` tag is used to quickly create a "forgot password" form for site users.',"https://statamic.dev/tags/user-forgot_password_form");var _l={tagName:"user:reset_password_form",allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!0,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[{name:"redirect",description:"Where the user should be taken after submitting the form",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,expectsTypes:["string"],isDynamic:!1,isRequired:!1}],resolveDynamicParameter:je,augmentScope:(t,e)=>(e.addVariables([{name:"success",dataType:"boolean",sourceField:null,sourceName:"*internal.user.password_reset",introducedBy:t},{name:"url_invalid",dataType:"boolean",sourceField:null,sourceName:"*internal.user.password_reset",introducedBy:t},{name:"errors",dataType:"array",sourceField:null,sourceName:"*internal.user.password_reset",introducedBy:t}]),e),resolveDocumentation:t=>k("user:reset_password_form Tag","The `user:reset_password_form` tag is used to quickly create password reset forms. Forms created with this tag should be displayed after a user has received and clicked a password reset email link.","https://statamic.dev/tags/user-reset_password_form")},Id=et(_l,"member:reset_password_form");Id.resolveDocumentation=t=>k("member:reset_password_form Tag","The `member:reset_password_form` tag is used to quickly create password reset forms. Forms created with this tag should be displayed after a user has received and clicked a password reset email link.","https://statamic.dev/tags/user-reset_password_form");function fN(t,e){return{sourceName:e.blueprintName,dataType:e.type,name:e.name,sourceField:e,introducedBy:t}}function pN(t){let e=new Map;for(let n=0;n{e.addVariableArray("fields",Ac(t)),e.addVariable({name:"errors",dataType:"array",sourceName:"*internal.user.register_form",sourceField:null,introducedBy:t}),e.addVariable({name:"old",dataType:"array",sourceName:"*internal.user.register_form",sourceField:null,introducedBy:t}),e.addVariable({name:"error",dataType:"array",sourceName:"*internal.user.register_form",sourceField:null,introducedBy:t}),e.addVariable({name:"success",dataType:"string",sourceName:"*internal.user.register_form",sourceField:null,introducedBy:t});let n=e.statamicProject.getUserFields();if(n.length>0){let r=ua(t,n);e.addVariableArray("old",r),e.addVariableArray("error",r)}return e},resolveDocumentation:t=>k("user:register_form Form Tag","The `user:register_form` tag can be used to build out public registration forms for new users.","https://statamic.dev/tags/user-register_form")},Sd=et(yl,"member:register_form");Sd.resolveDocumentation=t=>k("member:register_form Tag","The `member:register_form` tag can be used to build out public registration forms for new users.","https://statamic.dev/tags/user-register_form");var zw=[be(oa),be(sa),be(aa),be(la),be(ea),be(Cc),be(gl),be(ta),be(na),be(yl),be(_l)],Xw={tagName:"user",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,parameters:Sc,introducedIn:null,resovleParameterCompletionItems:(t,e)=>e.isPastTagPart==!1&&e.currentNode!=null&&e.currentNode.methodIsEmptyOrMatches("profile")&&t.name=="field"?te(Gu(e.project.getUserFields())):he,augmentScope:(t,e)=>(t.methodIsEmptyOrMatches("profile")&&e.injectUserFields(t),e),resolveCompletionItems:t=>(t.leftWord=="user"||t.leftWord=="/user"||t.leftWord=="member"||t.leftWord=="/member")&&t.leftChar==":"?te(zw):he,resolveDocumentation:t=>k("user Tag","The `user` tag provides access to the currently logged in user information, or for a specific user when using the `id`, `email`, or `field` parameter",null)},xc=Xw;var Ec=et(xc,"member"),Cd=et(oa,"member:is"),Rd=et(aa,"member:isnt"),Ad=et(la,"member:profile"),xd=et(ea,"member:can"),Ed=et(ta,"member:logout"),wd=et(na,"member:logout_url"),Od=et(Ic,"member:in"),Ld=et(sa,"member:not_in");Ec.hideFromCompletions=!0;Ec.resolveDocumentation=t=>k("member Tag","The `member` tag provides access to the currently logged in user information, or for a specific user when using the `id`, `email`, or `field` parameter",null);Cd.resolveDocumentation=t=>k("member:is Tag","The `member:is` tag can be used to check whether the currently authenticated user has one or more roles.","https://statamic.dev/tags/user-is");Rd.resolveDocumentation=t=>k("member:isnt Tag","The `member:isnt` tag can be used to check whether the currently authenticated user does not have one or more roles.","https://statamic.dev/tags/user-is#isnt");Ad.resolveDocumentation=t=>k("member:profile Tag","The `member:profile` tag provides access to the currently logged in user information, or for a specific user when using the `id`, `email`, or `field` parameter",null);xd.resolveDocumentation=t=>k("member:can Tag","The `member:can` tag is used to check if the currently authenticated user has a specific set of permissions. When used as a tag pair, the tag contents will only be rendered if the user has the specified permissions.","https://statamic.dev/tags/user-can");Ed.resolveDocumentation=t=>k("member:logout Tag","The `member:logout` tag will sign out the currently authenticated user. An optional `redirect` parameter may be used to redirect the visitor to a different page after being logged out.","https://statamic.dev/tags/user-logout");wd.resolveDocumentation=t=>Re("member:logout_url","The `member:logout_url` tag can be used to retrieve the URL that will sign the current user out.",'Log out',"https://statamic.dev/tags/user-logout_url");Od.resolveDocumentation=t=>k("member:in Tag","The `member:in` tag can be used to check if the currently authenticated user belongs to one or more user groups. When used as a tag pair, the tag contents will only be rendered if the user belongs to the specified groups.","https://statamic.dev/tags/user-in");Ld.resolveDocumentation=t=>k("member:not_in Tag","The `member:not_in` tag can be used to check if the currently authenticated user does not belong to one or more user groups. When used as a tag pair, the tag contents will be rendered if the user does not belong to the specified groups.","https://statamic.dev/tags/user-in#not-in");function ps(t){return[{name:"title",dataType:"string",sourceField:null,sourceName:"*internal.routeable",introducedBy:t},{name:"url",dataType:"string",sourceField:null,sourceName:"*internal.routeable",introducedBy:t}]}var hN=Q(ot());var Dd=["from","taxonomy","is","use","folder"],kd=["not_from","not_in","dont_use","not_taxonomy"];var Md=Dd;Md=Md.concat(kd);function dN(t,e){var n,r,i,s,o,a,l,u;if(e.nodesInScope.length>0){let c=e.nodesInScope[e.nodesInScope.length-1];if(c!=null&&c.currentScope!=null){let f=ca(c,e.project),m=e.project.getTaxonomyBlueprintFields(f),p=m.map(_=>_.name),d=Di(e.leftWord);if(p.includes(d))return te(os(e))}}return t.name=="collection"&&((n=e.context)==null?void 0:n.parameterContext)!=null?te(Wo((s=(i=(r=e.context)==null?void 0:r.parameterContext.parameter)==null?void 0:i.getArrayValue())!=null?s:[],e.project)):t.name=="filter"||t.name=="query_scope"?te(Hu(e.project)):Md.includes(t.name)&&((o=e.context)==null?void 0:o.parameterContext)!=null?te(mN((u=(l=(a=e.context)==null?void 0:a.parameterContext.parameter)==null?void 0:l.getArrayValue())!=null?u:[],e.project)):null}function ca(t,e){let n=[];if(t.hasMethodPart())return n.push(t.getMethodNameValue()),n;let r=t.findAnyParameter(Dd),i=t.findAnyParameter(kd),s=[],o=[];return typeof r!="undefined"&&r!==null&&(r.value.trim()==="*"?(s=e.getUniqueTaxonomyNames(),typeof i!="undefined"&&i!==null&&i.isVariableReference==!1&&i.hasInterpolations()==!1&&(o=i.getArrayValue())):r.isVariableReference==!1&&r.hasInterpolations()==!1&&(s=r.getArrayValue())),o.length>0?n=s.filter(function(a){return o.includes(a)==!1}):n=s,n}function mN(t,e){let n=[],r=e.getUniqueTaxonomyNames().filter(i=>!t.includes(i));for(let i=0;i0){let o=e.statamicProject.getBlueprintFields(s);e.introduceScopedAliasScope(t,"entries","entries",o).addVariables(as(t))}else e.addVariableArray("entries",ps(t).concat(as(t)))}else e.addVariableArray("entries",ps(t).concat(as(t)));return e}var Qw=[{name:"from",description:"The taxonomy to use",aliases:["taxonomy","is","use","folder"],acceptsVariableInterpolation:!1,allowsVariableReference:!1,expectsTypes:["string","array"],isDynamic:!1,isRequired:!1},{name:"not_from",description:"Taxonomies to exclude",aliases:["not_in","not_folder","dont_use","not_taxonomy"],allowsVariableReference:!1,acceptsVariableInterpolation:!1,expectsTypes:["string","array"],isRequired:!1,isDynamic:!1},{name:"min_count",description:"The minimum number of entries a taxonomy term must have to be returned",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1,isRequired:!1},{name:"collection",description:"Filter the terms to those that appear in the specified collections",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["string","array"],isDynamic:!1,isRequired:!1},{name:"sort",description:"The field to sort terms by",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1},{isRequired:!1,name:"filter",aliases:["query_scope"],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"Specifies a custom query scope",expectsTypes:["string"],isDynamic:!1}],_N=Qw;var Fd=Q(ot());function yN(t){var n,r;let e=[];if(t.currentNode!=null&&t.currentNode.currentScope!=null){let i=ca(t.currentNode,t.project),s=t.project.getTaxonomyBlueprintFields(i),o=s.map(l=>l.name),a=Di(t.leftWord);if(o.includes(a))return te(os(t));if(t.isCaretInTag&&!((n=t.context)==null?void 0:n.interpolatedContext)&&["taxonomy","/taxonomy"].includes(t.leftWord)==!1){let l=[];for(let u=0;u0)return dn(e)}}if((t.leftWord=="taxonomy"||t.leftWord=="/taxonomy")&&t.leftChar==":"){let i=t.project.getUniqueTaxonomyNames();for(let s=0;sk("taxonomy Tag","The `taxonomy` tag may be used to retrieve taxonomy entries. The taxonomy tag can also be used to access entries associated with any given taxonomy term.","https://statamic.dev/tags/taxonomy")},bN=Jw;var Vd=Q(ot());function TN(t,e){e.addVariables([{name:"is_published",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"is_page",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"is_entry",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"has_entries",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"is_parent",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"is_current",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"is_external",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"depth",dataType:"number",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"children",dataType:"array",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"first",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"last",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"count",dataType:"integer",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"index",dataType:"integer",sourceField:null,sourceName:"*internal.nav",introducedBy:t}]);let n=e.statamicProject.getUniqueCollectionNames(),r=[],i=!1;if(t.hasMethodPart()){let s=t.getMethodNameValue().trim().toLowerCase();if(s.startsWith("collection:")){let o=s.split(":").pop();i=!0,r.push(o)}else s=="pages"?(i=!0,r.push("pages")):(i=!1,r.push(s))}else{let s=t.findParameter("handle");s!=null&&(n.includes(s.value)?i=!0:i=!1,r.push(s.value))}if(i){let s=e.statamicProject.getBlueprintFields(r);e.addBlueprintFields(t,s),e.expandScopedAliasScope(t,"page","page",s)}else{let s=Wu(ps(t));e.addBlueprintFields(t,s),e.expandScopedAliasScope(t,"page","page",s)}return e}var Zw={tagName:"nav:breadcrumbs",allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,hideFromCompletions:!1,introducedIn:null,injectParentScope:!1,parameters:[{name:"include_home",description:"Whether to include the home page in the first level",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["boolean"],isDynamic:!1,isRequired:!1},{name:"reverse",description:"Whether to reverse the order of links",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["boolean"],isRequired:!1,isDynamic:!1},{name:"trim",description:"Whether to trim the whitespace after each iteration of the loop",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["boolean"],isDynamic:!1,isRequired:!1}],augmentScope:(t,e)=>(e.addVariables([{name:"is_current",dataType:"boolean",sourceName:"*internal.nav.breadcrumbs",sourceField:null,introducedBy:t}]),e.addVariables(ps(t)),e),resolveDocumentation:t=>k("nav:breadcrumbs Tag","The `nav:breadcrumbs` tag can be used to retrieve the URLs of all pages that make up the current URL back to the site's home page.","https://statamic.dev/tags/nav-breadcrumbs")},wc=Zw;function NN(t,e){if(t.name=="handle"){let n=e.project.getUniqueCollectionNames(),r=e.project.getUniqueNavigationMenuNames(),i=[];return i=n,i=i.concat(r),i=[...new Set(i)],pt(i)}return null}var eO=[{isRequired:!1,acceptsVariableInterpolation:!1,aliases:["handle"],allowsVariableReference:!1,name:"for",description:"The navigation or collection to use",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],name:"from",description:"The starting point for the navigation",allowsVariableReference:!0,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,name:"show_unpublished",description:"Whether to include unpublished content",expectsTypes:["boolean"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,name:"include_home",description:"Whether to include the home page in the tree",expectsTypes:["boolean"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,name:"max_depth",description:"The maximum depth of the navigation or structure",expectsTypes:["number"],isDynamic:!1}],vN=eO;var qd={tagName:"structure",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,introducedIn:null,injectParentScope:!1,parameters:vN,augmentScope:TN,resovleParameterCompletionItems:NN,resolveCompletionItems:t=>{let e=[];if(t.isPastTagPart==!1&&(t.leftWord=="nav"||t.leftWord=="/nav"||t.leftWord=="structure"||t.leftWord=="/structure")&&t.leftChar==":"){let n=t.project.getUniqueNavigationMenuNames();for(let r=0;rk("nav Tag","The `nav` tag can be used to iterate structured collections or navigation menus.","https://statamic.dev/tags/nav")},PN=et(qd,"nav");var CN=Q(ot());function IN(t){return[{name:"success",dataType:"string",sourceField:null,sourceName:"*internal.forms",introducedBy:t},{name:"submission_created",dataType:"boolean",sourceField:null,sourceName:"*internal.forms",introducedBy:t}]}var tO={name:"in",description:"The form to use",acceptsVariableInterpolation:!0,aliases:["handle","is","form","formset"],allowsVariableReference:!0,expectsTypes:["string"],isDynamic:!1,isRequired:!1},pi=tO;var Bd=Q(ot()),nO=[{label:"GET",kind:Bd.CompletionItemKind.EnumMember},{label:"POST",kind:Bd.CompletionItemKind.EnumMember}],SN=nO;var Xr=["in","handle","is","form","formset"];function fa(t,e){return Xr.includes(t.name)?pt(e.project.getUniqueFormNames()):t.name=="method"?te(SN):t.name=="files"?te(Ko):null}function di(t,e){let n=t.structure.findParentWithName("form:set");return n!=null?{context:n,issues:[]}:{context:null,issues:[]}}var rO=["set","create","errors","success","submissions","submission"];function zs(t){if(t.reference!=null&&"tagPart"in t.reference){let r=t.reference;if(r.nameMatches("form:set"))return zs(r)}let e=t.findAnyParameter(Xr),n=t.getMethodNameValue();return n!=null&&rO.includes(n)==!1?n:typeof e!="undefined"&&e!==null&&e.containsSimpleValue()?e.value:""}var iO={tagName:"form:create",allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!0,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[pi,{name:"method",description:"The HTTP method to use",allowsVariableReference:!1,acceptsVariableInterpolation:!1,aliases:[],expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"files",description:"Indicates if the form sends file data",aliases:[],allowsVariableReference:!1,acceptsVariableInterpolation:!1,expectsTypes:["boolean"],isDynamic:!1,isRequired:!1},{name:"redirect",description:"The location to redirect users after a successful form submission",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"error_redirect",description:"The location to redirect users to after a failed form submission",allowsVariableReference:!1,acceptsVariableInterpolation:!1,aliases:[],expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"allow_request_redirect",description:"Indicates if query parameters can override redirect or error_redirect",aliases:[],acceptsVariableInterpolation:!1,allowsVariableReference:!1,expectsTypes:["boolean"],isDynamic:!1,isRequired:!1}],resolveSpecialType:di,resovleParameterCompletionItems:fa,resolveDynamicParameter:je,augmentScope:(t,e)=>{e.addVariables(IN(t)),e.addVariable({dataType:"array",name:"errors",sourceField:null,sourceName:"*internal.forms",introducedBy:t}),e.addVariableArray("fields",Ac(t));let n=zs(t);if(n.length>0){let r=e.statamicProject.getFormBlueprintFields(n),i=ua(t,r);e.addVariableArray("old",i),e.addVariableArray("error",i)}return e},resolveDocumentation:t=>k("form:create Tag","The `form:create` tag can be used to access form data, generate field HTML markup, and handle form validation errors.","https://statamic.dev/tags/form-create")},Oc=iO;var sO={tagName:"form:errors",allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[pi],resolveSpecialType:di,resovleParameterCompletionItems:(t,e)=>Xr.includes(t.name)?pt(e.project.getUniqueFormNames()):null,resolveDocumentation:t=>k("form:errors Tag","The `form:errors` tag can be used to retrieve validation errors after a user has submitted a form.","https://statamic.dev/tags/form-errors")},Lc=sO;var oO={tagName:"form:set",allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[{name:"in",description:"The form to use",acceptsVariableInterpolation:!0,aliases:["handle","is","form","formset"],allowsVariableReference:!0,expectsTypes:["string"],isDynamic:!1,isRequired:!0}],resovleParameterCompletionItems:fa,resolveDocumentation:t=>k("form:set Tag","The `form:set` tag can be used to set the form handle on all nested form tags.","https://statamic.dev/tags/form-set")},Dc=oO;var aO={tagName:"form:submission",requiresClose:!0,allowsContentClose:!1,allowsArbitraryParameters:!1,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[pi],resolveSpecialType:di,resovleParameterCompletionItems:(t,e)=>Xr.includes(t.name)?pt(e.project.getUniqueFormNames()):null,augmentScope:(t,e)=>{let n=zs(t);if(n.length>0){let r=e.statamicProject.getFormBlueprintFields(n);e.addBlueprintFields(t,r)}return e},resolveDocumentation:t=>k("form:submission Tag","The `form:submission` tag can be used to access the form submission submitted by the current user.","https://statamic.dev/tags/form-submission")},kc=aO;var lO={tagName:"form:submissions",allowsArbitraryParameters:!1,allowsContentClose:!1,hideFromCompletions:!1,injectParentScope:!1,requiresClose:!0,introducedIn:null,parameters:[pi],resolveSpecialType:di,resovleParameterCompletionItems:(t,e)=>Xr.includes(t.name)?pt(e.project.getUniqueFormNames()):null,augmentScope:(t,e)=>{if(t.isClosingTag)return e;let n=zs(t);if(n.length>0){let r=e.statamicProject.getFormBlueprintFields(n);e.addBlueprintFields(t,r)}return e.addVariable({name:"date",dataType:"date",sourceField:null,sourceName:"*internal.forms.submissions",introducedBy:t}),e.addVariable({name:"no_results",dataType:"boolean",sourceField:null,sourceName:"*internal.forms.submissions",introducedBy:t}),e.addVariable({name:"total_results",dataType:"number",sourceField:null,sourceName:"*internal.forms.submissions",introducedBy:t}),e},resolveDocumentation:t=>k("form:submissions Tag","The `form:submissions` tag can be used to fetch previously saved submissions for a form.","https://statamic.dev/tags/form-submissions")},Mc=lO;var uO={tagName:"form:success",allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[pi],resolveSpecialType:di,resovleParameterCompletionItems:(t,e)=>Xr.includes(t.name)?pt(e.project.getUniqueFormNames()):null,resolveDocumentation:t=>k("form:success Tag","The `form:success` tag can be used to check if a form submission was successful or not.","https://statamic.dev/tags/form-success")},Fc=uO;var cO=[be(Dc),be(Oc),be(Lc),be(Fc),be(Mc),be(kc)],fO={tagName:"form",allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[],resovleParameterCompletionItems:fa,resolveCompletionItems:t=>{let e=[];if(t.isPastTagPart==!1&&(t.leftWord=="form"||t.leftWord=="/form")&&t.leftChar==":"){let n=t.project.getUniqueFormNames();e=e.concat(cO);for(let r=0;rt.name=="index"?pt(e.project.getSearchIndexes()):null,augmentScope:(t,e)=>{e.addVariables([{name:"no_results",dataType:"boolean",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"total_results",dataType:"number",sourceField:null,sourceName:"*internal.search.results",introducedBy:t}]);let n=t.findParameter("as");return n!=null&&n.value.trim().length>0?e.addVariableArray(n.value,AN(t)):e.addVariables(AN(t)),e},resolveDocumentation:t=>k("search:results Tag","The `search:results` tag provides access to all data that was returned as a result of a user's search.","https://statamic.dev/tags/search")},pO=[be(jd)];function AN(t){return[{name:"url",dataType:"string",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"title",dataType:"string",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"content",dataType:"string",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"first",dataType:"boolean",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"last",dataType:"boolean",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"is_entry",dataType:"boolean",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"is_term",dataType:"boolean",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"count",dataType:"number",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"index",dataType:"number",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"search_score",dataType:"number",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"_highlightResult",dataType:"array",sourceField:null,sourceName:"*internal.search.results",introducedBy:t}]}var xN={tagName:"search",allowsArbitraryParameters:!1,requiresClose:!0,allowsContentClose:!1,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[],resolveCompletionItems:t=>t.isPastTagPart==!1&&(t.leftWord=="search"||t.leftWord=="/search")&&t.leftChar==":"?dn(pO):he};function Ud(t){return[{name:"email",dataType:"string",sourceName:"*internal.user.login",sourceField:null,introducedBy:t},{name:"password",dataType:"string",sourceName:"*internal.user.login",sourceField:null,introducedBy:t}]}var Gd={tagName:"user:login_form",allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!0,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[{name:"redirect",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,description:"Where the user should be redirected after logging in",expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"error_redirect",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,description:"Where the user should be redirected after failed login attempts",expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"allow_request_redirect",description:"Indicates if query parameters can override the redirect and error_redirect parameters",acceptsVariableInterpolation:!1,allowsVariableReference:!0,aliases:[],expectsTypes:["boolean"],isDynamic:!1,isRequired:!1}],resolveDynamicParameter:je,augmentScope:(t,e)=>(e.addVariables([{name:"errors",dataType:"array",sourceName:"*internal.user.login",sourceField:null,introducedBy:t},{name:"success",dataType:"string",sourceName:"*internal.user.login",sourceField:null,introducedBy:t}]),e.addVariables(Ud(t)),e.addVariableArray("old",Ud(t)),e.addVariableArray("error",Ud(t)),e),resolveDocumentation:t=>k("user:login_form Tag","The `user:login_form` tag can be used to quickly create a form that users can use to authenticate with the site.","https://statamic.dev/tags/user-login_form")},EN=et(Gd,"member:login_form");var dO={tagName:"noparse",requiresClose:!0,allowsArbitraryParameters:!1,allowsContentClose:!1,hideFromCompletions:!1,injectParentScope:!1,parameters:[],introducedIn:null,resolveDocumentation:t=>k("noparse Tag","The `noparse` tag is used prevent blocks of Antlers code from being parsed, removing the need to escape individual Antlers code regions.","https://statamic.dev/antlers#the-noparse-tag")},wN=dO;var mO={tagName:"unless",hideFromCompletions:!0,allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!0,injectParentScope:!0,introducedIn:null,parameters:[],resolveDynamicParameter:je,resolveDocumentation:t=>k("unless Conditional Control Structure","The `unless` control structure operates the same as an `if` statement, but has it's logic inverted.","https://statamic.dev/antlers#conditions")},ON=mO;var hO={tagName:"elseunless",hideFromCompletions:!0,allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!0,injectParentScope:!0,introducedIn:null,parameters:[],resolveDynamicParameter:je,resolveDocumentation:t=>k("elseunless Conditional Control Structure","The `elseunless` control structure operates the same as an `elseif` statement, but has it's logic inverted.","https://statamic.dev/antlers#conditions")},LN=hO;var DN=Q(nn());var kN={tagName:"installed",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!0,introducedIn:"3.1.19",parameters:[],resolveCompletionItems:t=>{if(t.project!=null){let e=t.project.getComposerPackages(),n=[];return e.forEach((r,i)=>{n.push({label:r.name,kind:DN.CompletionItemKind.Text})}),te(n)}return he},resolveDocumentation:t=>Re("installed Tag","The `installed` tag is used to check if the site has a specific Composer package available.",`{{ if {installed:composer/package-name} }} {{# Package is availabl.e #}} {{ else }} {{# Something else. #}} -{{ /if }}`,"https://statamic.dev/tags/installed")};var mO={tagName:"relate",hideFromCompletions:!0,allowsArbitraryParameters:!1,allowsContentClose:!1,injectParentScope:!1,requiresClose:!0,introducedIn:null,parameters:[]},MN=mO;var pa=[{name:"bag",description:"The error message bag to retrieve errors from.",aliases:[],acceptsVariableInterpolation:!1,allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1}];var hO={tagName:"get_errors",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,parameters:pa,introducedIn:"3.2.23",augmentScope:(t,e)=>{var n;if(t.isClosingTag)return e;if(((n=t.name)==null?void 0:n.methodPart)==null){let r=e.copy();r.addVariable({dataType:"string",introducedBy:t,name:"field",sourceName:"*internal.tag.get_errors",sourceField:{blueprintName:"*internal.tag.get_errors",displayName:"get_errors",import:null,instructionText:null,maxItems:null,name:"field",refFieldSetField:null,sets:null,type:"string"}});let i=r.copy();i.addVariable({dataType:"string",introducedBy:t,name:"message",sourceName:"*internal.tag.get_errors",sourceField:{blueprintName:"*internal.tag.get_errors",displayName:"get_errors",import:null,instructionText:null,maxItems:null,name:"message",refFieldSetField:null,sets:null,type:"string"}}),r.addScopeList("messages",i),e.addScopeList("fields",r)}else{let r=e.copy();r.addVariable({dataType:"string",introducedBy:t,name:"message",sourceName:"*internal.tag.get_errors",sourceField:{blueprintName:"*internal.tag.get_errors",displayName:"get_errors",import:null,instructionText:null,maxItems:null,name:"message",refFieldSetField:null,sets:null,type:"string"}}),e.addScopeList("messages",r)}return e},resolveDocumentation:t=>k("get_errors Tag","The `get_errors` tag can be used to retrieve form validation errors.","https://statamic.dev/tags/get_errors")},FN=hO;var gO={tagName:"get_errors:all",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,parameters:pa,introducedIn:null,augmentScope:(t,e)=>{if(t.isClosingTag)return e;let n=e.copy();return n.addVariable({dataType:"string",introducedBy:t,name:"message",sourceName:"*internal.tag.get_errors.all",sourceField:{blueprintName:"*internal.tag.get_errors.all",displayName:"get_errors:all",import:null,instructionText:null,maxItems:null,name:"message",refFieldSetField:null,sets:null,type:"string"}}),e.addScopeList("messages",n),e},resolveDocumentation:t=>k("get_errors:all Tag","The `get_errors:all` tag can be used to retrieve all form validation errors.","https://statamic.dev/tags/get_errors#list-all-validation-errors")},VN=gO;var _O={tagName:"get_error",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,parameters:pa,introducedIn:null,augmentScope:(t,e)=>(t.isClosingTag||e.addVariable({dataType:"string",introducedBy:t,name:"message",sourceName:"*internal.tag.get_error",sourceField:{blueprintName:"*internal.tag.get_error",displayName:"get_error",import:null,instructionText:null,maxItems:null,name:"message",refFieldSetField:null,sets:null,type:"string"}}),e),resolveDocumentation:t=>k("get_error Tag","The `get_error` tag can be used to retrieve the first error message for a specific field.","https://statamic.dev/tags/get_errors#get-the-first-error-for-a-specific-field")},qN=_O;var yO={tagName:"set",hideFromCompletions:!0,allowsArbitraryParameters:!0,requiresClose:!1,allowsContentClose:!1,injectParentScope:!1,introducedIn:null,parameters:[]},BN=yO;var jN=Q(nn());var bO={tagName:"mount_url",hideFromCompletions:!1,allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,introducedIn:"3.3.15",parameters:[{isRequired:!1,acceptsVariableInterpolation:!0,aliases:[],allowsVariableReference:!0,description:"The collection handle",name:"handle",isDynamic:!1,expectsTypes:["string"]}],resolveDocumentation:t=>k("mount Tag","The `mount` tag can be used to retrieve the mount URL for a given collection.",null),resovleParameterCompletionItems:(t,e)=>{var n,r,i,s;return t.name=="handle"&&((n=e.context)==null?void 0:n.parameterContext)!=null?te(Wo((s=(i=(r=e.context)==null?void 0:r.parameterContext.parameter)==null?void 0:i.getArrayValue())!=null?s:[],e.project)):null},resolveCompletionItems:t=>{let e=[];if(t.isPastTagPart==!1&&(t.leftWord=="mount_url"||t.leftWord=="/mount_url")&&t.leftChar==":"){let n=t.project.getCollectionNames();for(let r=0;rEe("vite Tag","Generates Vite tags for an entrypoint.",'{{ vite src="entry/point" }}',null)},GN=TO;var WN=[oN,aN,lN,ON,LN,AT,wT,Jb,Zu,Gs,ec,Ju,Qu,MN,RN,wc,Dc,kc,Lc,Mc,Oc,BN,FN,qN,VN,xN,Bd,sT,tc,nc,tT,YT,eT,XT,zT,Zb,OT,DT,FT,Tc,nT,rT,iT,VT,qT,oT,rc,jT,vc,UT,UN,PN,Vd,Ec,lT,aT,Pc,HT,sa,oa,KT,kN,Ac,aa,ea,Sc,ta,na,la,Ud,_l,gl,yl,xc,Sd,Cd,Rd,Ad,xd,Ed,wd,Od,EN,Pd,vd,Id,wN,fT,pT,dT,IT,ST,QT,NT,bT,sN,PT,cN,cc,uc,lc,ac,Cc,oc,RT,bN,ZT,Nd,eN,tN,nN,rN,iN,hc,CT,_d,JT,gT,fc,$T,GN];var ds=class{constructor(){this.tags=new Map;this.parameters=new Map}reset(){this.tags.clear(),this.parameters.clear(),this.loadCoreTags()}getVisibleTagsWithDocumentation(){let e=[];return this.tags.forEach((n,r)=>{if(n.hideFromCompletions==!1){let i="";n.resolveDocumentation!=null&&(i=n.resolveDocumentation()),e.push({label:r,documentation:i})}}),e}getVisibleTagNames(){let e=[];return this.tags.forEach((n,r)=>{n.hideFromCompletions==!1&&e.push(r)}),[...new Set(e)]}getPossibleTagMethods(e){let n=[],r=e.length+1;return this.tags.forEach((i,s)=>{if(s.startsWith(e)){let o=s.substr(r).trim();o.length>0&&n.push(o)}}),[...new Set(n)]}getTagNames(){let e=[];return this.tags.forEach((n,r)=>{e.push(r)}),[...new Set(e)]}loadCoreTags(){this.registerTags(WN)}cleanTagName(e){return ar(e,"/")}findTag(e){return this.tags.get(this.resolveTagName(e))}isKnownTag(e){return this.tags.has(this.resolveTagName(e))}isSymbolKnownTag(e){return this.isKnownTag(e.runtimeName())}resolveTagName(e){return e=this.cleanTagName(e.trim()),this.tags.has(e)||e.includes(":")&&(e=e.split(":")[0]),e}canResolveSpecialTypes(e){e=this.resolveTagName(e);let n=this.tags.get(e);return!(typeof n=="undefined"||n==null||n.resolveSpecialType==null)}resolveSpecialType(e,n,r){e=this.resolveTagName(e);let i=this.findTag(e);if(i.resolveSpecialType==null)throw new Error(e+" does not support special types.");return i.resolveSpecialType(n,r)}getCompletionItems(e){var s;let n=null,r=[],i=!0;if(e.nodesInScope.length>0&&(n=e.nodesInScope[e.nodesInScope.length-1]),e.currentNode!=null&&this.isKnownTag(e.currentNode.runtimeName())){let o=this.findTag(e.currentNode.runtimeName());if(typeof o=="undefined")return{isExclusive:!1,items:[]};let a=[];if(o.resolveCompletionItems!=null){let l=o.resolveCompletionItems(e);if(l.isExclusiveResult)return{isExclusive:!0,items:l.items};i=l.analyzeDefaults,r=r.concat(l.items)}if(e.isPastTagPart==!1){let l=this.getPossibleTagMethods(o.tagName);for(let u=0;u0&&(r=r.concat(ad(e,o.parameters)),o.tagName=="partial"&&(n==null?void 0:n.hasMethodPart()))){let l=n.getMethodNameValue();if(l.trim().length>0&&((s=ce.instance)==null?void 0:s.hasStructure())){let u=ce.instance.getStructure().findPartial(l);u!=null&&u.injectsParameters.length>0&&(r=r.concat(ad(e,u.injectsParameters)))}}for(let l=0;l0){let n=this.parameters.get(e.tagName);for(let r=0;r{e.push(r)}),e}getVariableNames(){let e=[];return this.values.forEach(n=>{e.push(n.name)}),e}getList(e){return this.lists.has(e)?this.lists.get(e):this.parentScope!=null&&this.parentScope!=this?this.parentScope.getList(e):null}hasValue(e){return this.values.has(e)}findAncestorWithList(e){return this.hasList(e)?this:this.parentScope!=null&&this.parentScope!=this?this.parentScope.findAncestorWithList(e):null}findReferenceNotIntroducedBy(e,n){if(this.hasValue(e)){let r=this.values.get(e);if(r.introducedBy!=null&&r.introducedBy!=n)return r}return this.parentScope!=null&&this.parentScope!=this?this.parentScope.findReferenceNotIntroducedBy(e,n):null}removeThroughIntroduction(e,n){if(this.values.delete(e),this.parentScope!=null){let r=this.findReferenceNotIntroducedBy(e,n);r!=null&&this.addVariable(r)}}wasIntroducedBySymbol(e,n){if(this.values.has(e)==!1)return!1;let r=this.values.get(e);return r.introducedBy!=null?r.introducedBy==n:!1}referencesArray(e){return this.values.has(e)==!1?!1:this.values.get(e).dataType=="array"}addScopeList(e,n){return this.lists.set(e,n),this}mergeAndList(e,n){let r=new mr(this.statamicProject);return r.values=pN(n),this.lists.set(e,r),this.mergeVariableScope(n),this}mergeScope(e){return e==this||e==null?this:(typeof e.values!="undefined"&&e.values!==null&&e.values.forEach((n,r)=>{this.values.set(r,n)}),typeof e.lists!="undefined"&&e.lists!==null&&e.lists.forEach((n,r)=>{this.lists.set(r,n)}),this)}mergeVariableScope(e){for(let n=0;n0&&this.addBlueprintFields(e,r)}copy(){let e=new mr(this.statamicProject);return e.pristine=new Map(this.pristine),e.values=new Map(this.values),e.lists=new Map(this.lists),e.parentScope=this,e}},Qn=mr;Qn.generationCounter=0;function Gd(t){let e=new Qn(t);return e.addVariable({dataType:"string",name:"handle",sourceField:null,sourceName:"*internal.system",introducedBy:null}),e.addVariable({dataType:"string",name:"name",sourceField:null,sourceName:"*internal.system",introducedBy:null}),e.addVariable({dataType:"string",name:"locale",sourceField:null,sourceName:"*internal.system",introducedBy:null}),e.addVariable({dataType:"string",name:"short_locale",sourceField:null,sourceName:"*internal.system",introducedBy:null}),e.addVariable({dataType:"string",name:"url",sourceField:null,sourceName:"*internal.system",introducedBy:null}),e}function YN(){let t=[];return t.push({dataType:"number",name:"response_code",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"csrf_field",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"csrf_token",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"environment",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"template",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"xml_header",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"last_segment",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"homepage",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"current_uri",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"current_url",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"amp_url",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"api_url",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"current_full_url",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"current_template",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"boolean",name:"logged_in",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"boolean",name:"logged_out",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"boolean",name:"is_homepage",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"date",name:"now",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"date",name:"today",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"date",name:"current_date",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"array",name:"get",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"array",name:"get_post",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"array",name:"post",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"array",name:"old",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t}function KN(t,e){let n=t.findParameter("paginate");if(n!=null&&(n.value.toLowerCase()=="true"||parseInt(n.value).toString()==n.value)){let r=e.makeNew(),i=e.makeNew(),s=e.makeNew(),o=e.makeNew();r.addVariable({name:"next_page",dataType:"string",sourceName:"*internal.pagination",sourceField:null,introducedBy:t}),r.addVariable({name:"prev_page",dataType:"string",sourceName:"*internal.pagination",sourceField:null,introducedBy:t}),r.addVariable({name:"total_items",dataType:"integer",sourceName:"*internal.pagination",sourceField:null,introducedBy:t}),r.addVariable({name:"total_pages",dataType:"integer",sourceName:"*internal.pagination",sourceField:null,introducedBy:t}),r.addVariable({name:"current_page",dataType:"integer",sourceName:"*internal.pagination",sourceField:null,introducedBy:t}),r.addVariable({name:"auto_links",dataType:"string",sourceName:"*internal.pagination",sourceField:null,introducedBy:t}),s.addVariable({name:"url",dataType:"string",sourceField:null,sourceName:"*internal.pagination.all",introducedBy:t}),s.addVariable({name:"page",dataType:"integer",sourceField:null,sourceName:"*internal.pagination.all",introducedBy:t}),o.addVariable({name:"first",dataType:"boolean",sourceName:"*internal.pagination.segments",sourceField:null,introducedBy:t}),o.addVariable({name:"last",dataType:"boolean",sourceName:"*internal.pagination.segments",sourceField:null,introducedBy:t}),o.addVariable({name:"slider",dataType:"boolean",sourceName:"*internal.pagination.segments",sourceField:null,introducedBy:t}),i.addScopeList("all",s),i.addScopeList("segments",o),r.addScopeList("links",i),e.addScopeList("paginate",r)}}var Xs=class{constructor(){this.fileInjections=new Map;this.project=null}updateProject(e){this.project=e}registerInjections(e,n){if(n.length==0)return;let r=[];for(let i=0;i0){let i=r[0].getMethodNameValue();if(i!=null&&this.project!=null){let s=this.project.findPartial(i);s!=null&&(this.fileInjections.has(s.documentUri)||this.fileInjections.set(s.documentUri,new Map),this.fileInjections.get(s.documentUri).set(e,r))}}}hasAvailableInjections(e){return this.fileInjections.has(e)}getScopeInjection(e,n){let r=new Qn(n);return r.name="*injection*",this.fileInjections.get(e).forEach((s,o)=>{for(let a=0;a{r.addBlueprintField(null,g)}),n.addScopeList("current_user",r),((c=xr.instance)==null?void 0:c.pageScopeDisabled(this.documentUri))?this.viewDataVars!=null&&n.addScopeList("view",this.viewDataVars):this.viewDataVars!=null?n.mergeAndList("page",this.pageVars).addScopeList("view",this.viewDataVars):n.mergeAndList("page",this.pageVars);let i=null;e.length>0&&e[0].isComment&&(i=il(this.documentUri,e[0]));for(let g=0;g0&&(s=s.concat(i.collectionInjections)),i.blueprints.length>0&&(s=s.concat(i.blueprints)),i.variableHelper!=null&&i.variableHelper.variableName=="@page")){let g=this.statamicProject.getBlueprintField(i.variableHelper.collectionName,i.variableHelper.fieldHandle);if(g!=null)if(i.variableHelper.setHandle.length>0){if(g.sets!=null){for(let N=0;N0){for(let g=0;g0&&a.includes(N.id())&&(o.pop(),u.pop(),u.length==0&&u.push(n));let S=u[u.length-1];if(N.hasParameters){for(let O=0;O0)for(let $=0;${Y instanceof B&&(Y.currentScope=S)})}}if(((d=Ie.instance)==null?void 0:d.isKnownTag(N.getTagName()))==!1){if(N.scopeVariable=S.findReference(N.runtimeName()),g>0){let O=e[g-1];if(O.isComment&&this.ideHelperMap.has(O.id())&&!O.isClosingTag&&!N.isClosingTag){let $=this.ideHelperMap.get(O.id());if($.variableName==N.getTagName()){let X=this.statamicProject.getBlueprintField($.collectionName,$.fieldHandle);X!=null&&(N.scopeVariable=fN(N,X))}}}if(N.scopeVariable==null){let O=N.runtimeName().trim();if(S.hasList(O)||((p=N.currentScope)==null?void 0:p.hasListInHistory(O))){N.sourceType="array";let $=S.getList(O);if($!=null&&$.values.size>0){let X=$.values.entries().next().value[1];N.scopeVariable={dataType:"array",introducedBy:X.introducedBy,name:O,sourceField:null,sourceName:X.sourceName}}}}else N.sourceType=Fu(N.scopeVariable.dataType),N.scopeVariable.sourceField!=null&&((_=$o.instance)==null?void 0:_.hasFieldtype(N.scopeVariable.sourceField.type))&&((C=$o.instance)==null?void 0:C.getFieldType(N.scopeVariable.sourceField.type)).augmentScope(N,S)}if(N.hasParameters&&KN(N,S),N.modifiers!=null&&N.modifiers.hasModifiers()?N.manifestType=N.modifiers.getLastManifestedModifierRuntimeType():N.manifestType=N.sourceType,N.isClosedBy!=null&&(o.push(N.id()),a.push(N.isClosedBy.id()),S=S.copy(),u.push(S)),N.getTagName()=="scope"&&N.hasMethodPart()){let O=u[u.length-2].copy();S.addScopeList(N.getMethodNameValue(),O)}if(S.containsPath(N.runtimeName())&&(o.push(N.id()),N.isClosedBy!=null&&a.push(N.isClosedBy.id()),S=S.copy().bringListIntoMainScope(N.runtimeName()),u.push(S)),N.currentScope=S,N.getTagName()!="cache"){let O=N.findParameter("scope");O!=null&&S.canShiftScope(N.runtimeName())&&(S=S.shiftScope(N,N.runtimeName(),O.value),N.currentScope=S,u.pop(),u.push(S))}if((h=Ie.instance)==null?void 0:h.isKnownTag(N.runtimeName())){let O=(b=Ie.instance)==null?void 0:b.findTag(N.runtimeName());typeof O!="undefined"&&O.augmentScope!=null&&O.augmentScope(N,S)}if(N.modifierChain!=null&&N.modifierChain.modifierChain.length>0&&N.modifierChain.modifierChain.forEach(O=>{O.modifier!=null&&typeof O.modifier.augmentScope!="undefined"&&O.modifier.augmentScope!=null&&O.modifier.augmentScope(N,S)}),N.modifiers.hasParameterModifiers()&&N.modifiers.parameterModifiers.forEach(O=>{O.modifier!=null&&typeof O.modifier.augmentScope!="undefined"&&O.modifier.augmentScope!=null&&O.modifier.augmentScope(N,S)}),N.sourceType=="array"){let O=N.findParameter("chunk"),$=!0;if(N.parent!=null&&N.parent instanceof B&&NO.includes(N.parent.runtimeName())&&($=!1),typeof O!="undefined"&&O!==null)if(N.currentScope.parentScope!=null&&(N.currentScope.parentScope.hasList(N.runtimeName())||S.referencesArray(N.runtimeName()))){let X=N.currentScope.parentScope.copy(),ee=X.liftList(N.runtimeName());if(ee==null&&S.referencesArray(N.runtimeName())){if(ee=new Qn(S.statamicProject),$){let Y=ze(N);for(let ne=0;ne0&&N.runtimeNodes.forEach(O=>{var $;if(O instanceof oe&&(($=N.currentScope)==null?void 0:$.hasValue(O.name))){let X=N.currentScope.findReferenceWithField(O.name);O.currentScope=N.currentScope,O.scopeName=N.scopeName,O.scopeVariable=X}}),vO.includes(N.runtimeName())&&N.runtimeNodes.length==3&&N.runtimeNodes[0]instanceof oe&&N.runtimeNodes[1]instanceof Nn&&N.runtimeNodes[2]instanceof bt&&N.runtimeNodes[0].scopeVariable!=null&&N.runtimeNodes[0].scopeVariable.sourceField!=null){let O=N.runtimeNodes[0].scopeVariable,$=N.runtimeNodes[2].value,X=O.sourceField;if(X.sets!=null)for(let ee=0;ee0}getMethodName(){return this.methodPart==""?"index":this.methodPart=="null"?"":this.methodPart}getRuntimeMethodName(){}getCompoundTagName(){if(this.cachedCompoundTagName==null){let e=this.getMethodName();this.cachedCompoundTagName=this.name,e!=null&&e!=""&&(this.cachedCompoundTagName=this.cachedCompoundTagName+":"+e)}return this.cachedCompoundTagName}};var Hd=class{constructor(){this.tagNames=[];this.modifierNames=[]}getModifierNames(){var e,n;return this.modifierNames.concat((n=(e=Me.instance)==null?void 0:e.getModifierNames())!=null?n:[])}getTagNames(){var e,n;return this.tagNames.concat((n=(e=Ie.instance)==null?void 0:e.getTagNames())!=null?n:[])}setTagNames(e){this.tagNames=e}setModifierNames(e){this.modifierNames=e}isTag(e){var n;return Hd.alwaysLikeTag.includes(e)||((n=Ie.instance)==null?void 0:n.isKnownTag(e))?!0:this.tagNames.includes(e)}isModifier(e){var n;return((n=Me.instance)==null?void 0:n.hasModifier(e))?!0:this.modifierNames.includes(e)}},da=Hd;da.alwaysLikeTag=["if","endif","elseif","else","unless","elseunless"];var ha=class{static analyze(e,n){e.forEach(r=>{if(r instanceof B){if(r.pathReference!=null&&r.pathReference.isStrictVariableReference){r.isTagNode=!1;return}r.name!=null&&(r.isTagNode=n.isTag(r.name.name))}})}static analyzeNode(e){if(e.pathReference!=null&&e.pathReference.isStrictVariableReference){e.isTagNode=!1;return}ha.environmentDetails!=null&&e.name!=null&&(e.isTagNode=ha.environmentDetails.isTag(e.name.name)),e.name!=null&&(e.isConditionNode=da.alwaysLikeTag.includes(e.name.name))}static analyzeParametersForModifiers(e){e.parameters.forEach(n=>{ha.environmentDetails!=null&&(n.isModifierParameter=ha.environmentDetails.isModifier(n.name))})}},ma=ha;ma.environmentDetails=null;(typeof ma.environmentDetails=="undefined"||ma.environmentDetails==null)&&(ma.environmentDetails=new da);var Yd=ma;var Kd=class{static getIdentifier(e){var i;let n=new Ln;n.content=e.trim();let r=e.split(":");if(r.length==1)n.name=r[0].trim(),n.methodPart=null,n.compound=n.name;else if(r.length>1){let s=(i=r.shift())!=null?i:"",o=r.join(":");n.name=s.trim(),n.methodPart=o.trim(),n.compound=n.name+":"+n.methodPart}else n.name=e.trim(),n.methodPart="";return n.name.startsWith("/")&&(n.name=n.name.substr(1),n.compound=n.compound.substr(1)),n}};var re=class{static getPrettyTypeName(e){return e instanceof Gr?re.TOKEN_LANG_OPERATOR:e instanceof Wn?re.TOKEN_OP_A_ADD:e instanceof oe?re.TOKEN_VARIABLE:e instanceof bt?re.TOKEN_STRING:e instanceof Lt?re.TOKEN_NUMBER:e instanceof wr?re.TOKEN_CONSTANT_FALSE:e instanceof ur?re.TOKEN_CONSTANT_NULL:e instanceof Or?re.TOKEN_CONSTANT_TRUE:e instanceof Mo?re.TOKEN_MODIFIER_NODE:e instanceof al?re.TOKEN_MODIFIER_CHAIN:e instanceof nd?re.TOKEN_MODIFIER_PARAMETER:e instanceof Hn?re.TOKEN_OP_A_DIVIDE:e instanceof oi?re.TOKEN_OP_A_EXPONENTIATION:e instanceof ai?re.TOKEN_OP_A_MODULUS:e instanceof Yn?re.TOKEN_OP_A_MULTIPLY:e instanceof Tn?re.TOKEN_OP_A_SUBTRACT:e instanceof Lr?re.TOKEN_ASG_ADD:e instanceof Dr?re.TOKEN_ASG_DIVIDE:e instanceof kr?re.TOKEN_ASG_MODULUS:e instanceof Mr?re.TOKEN_ASG_MULTIPLY:e instanceof Kn?re.TOKEN_ASG_ASSIGN:e instanceof li?re.TOKEN_ASG_SUBTRACT:e instanceof Nn?re.TOKEN_CMP_EQUAL:e instanceof Ur?re.TOKEN_CMP_SEQUAL:e instanceof cr?re.TOKEN_CMP_GT:e instanceof Ei?re.TOKEN_CMP_GTE:e instanceof Fr?re.TOKEN_CMP_LT:e instanceof Vr?re.TOKEN_CMP_LTE:e instanceof qr?re.TOKEN_CMP_NEQ:e instanceof Br?re.TOKEN_CMP_SNEQ:e instanceof jr?re.TOKEN_CMP_SPACESHIP:e instanceof wi?re.TOKEN_OP_VARIABLE_FALLBACK:e instanceof rd?re.TOKEN_COND_FALLBACK_GROUP:e instanceof It?re.TOKEN_BRANCH_SEPARATOR:e instanceof Wr?re.TOKEN_TERNARY_SEPARATOR:e instanceof zt?re.TOKEN_GROUP_BEGIN:e instanceof Bt?re.TOKEN_GROUP_END:e instanceof vn?re.TOKEN_MODIFIER_SEPARATOR:e instanceof jt?re.TOKEN_MODIFIER_NAME:e instanceof Ut?re.TOKEN_MODIFIER_VALUE:e instanceof Pn?re.TOKEN_MODIFIER_VALUE_SEPARATOR:e instanceof ul?re.TOKEN_NULL_COALESCE_GROUP:e instanceof Ot?re.TOKEN_SEMANTIC_GROUP:e instanceof sn?re.TOKEN_STATEMENT_SEPARATOR:e instanceof cl?re.TOKEN_TERNARY_CONDITION:e instanceof fr?re.TOKEN_OP_AND:e instanceof on?re.TOKEN_OP_LOGIC_NEGATION:e instanceof Hr?re.TOKEN_OP_OR:e instanceof ui?re.TOKEN_OP_XOR:e instanceof pr?re.TOKEN_OP_NULL_COALESCE:e instanceof Vs?re.TOKEN_PARAM:e instanceof Un?re.TOKEN_PATH_ACCESSOR:e instanceof ts?re.TOKEN_OP_A_FACTORIAL:e instanceof lr?re.TOKEN_RECURSIVE:e instanceof qo?re.TOKEN_ARG_GROUP:e instanceof Ct?re.TOKEN_ARG_SEPARATOR:e instanceof ci?re.TOKEN_OP_STRING_CONCAT:e instanceof In?re.TOKEN_OP_SCOPE_REASSIGNMENT:e instanceof Vo?re.TOKEN_STRUCT_SWITCH_CASE:e instanceof Bs?re.TOKEN_STRUCT_SWITCH_GROUP:e instanceof qs?re.TOKEN_STRUCT_DIRECTION_GROUP:e instanceof dr?re.TOKEN_STRUCT_SCOPED_LOGIC_GROUP:e instanceof De?re.TOKEN_STRUCT_LOGIC_GROUP:e instanceof ll?re.TOKEN_STRUCT_VALUE_DIRECTION:e instanceof Oi?re.TOKEN_STRUCT_ARRAY:e instanceof Yr?re.TOKEN_STRUCT_T_LIST_START:e instanceof id?re.TOKEN_STRUCT_TUPLE_LIST:e instanceof Xt?re.TOKEN_STRUCT_METHOD_CALL:typeof e}},W=re;W.TOKEN_LANG_OPERATOR="T_LANG_OPERATOR",W.TOKEN_VARIABLE="T_VAR",W.TOKEN_NUMBER="T_NUMERIC",W.TOKEN_STRING="T_STRING",W.TOKEN_RECURSIVE="T_RECURSIVE",W.TOKEN_CONSTANT_FALSE="T_FALSE",W.TOKEN_CONSTANT_NULL="T_NULL",W.TOKEN_CONSTANT_TRUE="T_TRUE",W.TOKEN_MODIFIER_NODE="T_MODIFIER",W.TOKEN_MODIFIER_CHAIN="T_MODIFIER_CHAIN",W.TOKEN_MODIFIER_PARAMETER="T_MODIFIER_PARAM",W.TOKEN_OP_A_ADD="T_AOP_ADD",W.TOKEN_OP_A_DIVIDE="T_AOP_DIVIDE",W.TOKEN_OP_A_EXPONENTIATION="T_AOP_EXP",W.TOKEN_OP_A_MODULUS="T_AOP_MOD",W.TOKEN_OP_A_MULTIPLY="T_AOP_MULTIPLY",W.TOKEN_OP_A_SUBTRACT="T_AOP_SUBTRACT",W.TOKEN_OP_A_FACTORIAL="T_AOP_FACTORIAL",W.TOKEN_ASG_ADD="T_ASG_ADD",W.TOKEN_ASG_DIVIDE="T_ASG_DIVIDE",W.TOKEN_ASG_ASSIGN="T_ASG",W.TOKEN_ASG_MODULUS="T_ASG_MODULUS",W.TOKEN_ASG_MULTIPLY="T_ASG_MULTIPLY",W.TOKEN_ASG_SUBTRACT="T_ASG_SUBTRACT",W.TOKEN_CMP_EQUAL="T_CMP_EQ",W.TOKEN_CMP_SEQUAL="T_CMP_SEQ",W.TOKEN_CMP_GT="T_CMP_GT",W.TOKEN_CMP_GTE="T_CMP_GTE",W.TOKEN_CMP_LT="T_CMP_LT",W.TOKEN_CMP_LTE="T_CMP_LTE",W.TOKEN_CMP_NEQ="T_CMP_NEQ",W.TOKEN_CMP_SNEQ="T_CMP_SNEQ",W.TOKEN_CMP_SPACESHIP="T_CMP_SPSHP",W.TOKEN_OP_VARIABLE_FALLBACK="T_VFBK",W.TOKEN_COND_FALLBACK_GROUP="T_VFBK_GROUP",W.TOKEN_BRANCH_SEPARATOR="T_BRANCH_SEPARATOR",W.TOKEN_TERNARY_SEPARATOR="T_TERNARY_SEPARATOR",W.TOKEN_GROUP_BEGIN="T_LOGIC_BEGIN",W.TOKEN_GROUP_END="T_LOGIC_END",W.TOKEN_MODIFIER_SEPARATOR="T_MODIFIER_SEPARATOR",W.TOKEN_MODIFIER_NAME="T_MODIFIER_NAME",W.TOKEN_MODIFIER_VALUE="T_MODIFIER_VALUE",W.TOKEN_MODIFIER_VALUE_SEPARATOR="T_MODIFIER_VALUE_SEPARATOR",W.TOKEN_NULL_COALESCE_GROUP="T_NULL_COALESCE_GROUP",W.TOKEN_SEMANTIC_GROUP="T_SEMANTIC_GROUP",W.TOKEN_STATEMENT_SEPARATOR="T_STATEMENT_SEPARATOR",W.TOKEN_TERNARY_CONDITION="T_TERNARY_CONDITION",W.TOKEN_OP_AND="T_AND",W.TOKEN_OP_LOGIC_NEGATION="T_LOGIC_INVERSE",W.TOKEN_OP_OR="T_OR",W.TOKEN_OP_XOR="T_XOR",W.TOKEN_OP_NULL_COALESCE="T_NULL_COALESCE",W.TOKEN_PARAM="T_PARAM",W.TOKEN_PATH_ACCESSOR="T_VAR_SEPARATOR",W.TOKEN_ARG_GROUP="T_ARG_GROUP",W.TOKEN_ARG_SEPARATOR="T_ARG_SEPARATOR",W.TOKEN_OP_STRING_CONCAT="T_STR_CONCAT",W.TOKEN_OP_SCOPE_REASSIGNMENT="T_SCOPE_ASSIGNMENT",W.TOKEN_STRUCT_SWITCH_CASE="T_SWITCH_CASE",W.TOKEN_STRUCT_SWITCH_GROUP="T_SWITCH_GROUP",W.TOKEN_STRUCT_DIRECTION_GROUP="T_DIRECTION_GROUP",W.TOKEN_STRUCT_VALUE_DIRECTION="T_ORDER_DIRECTION",W.TOKEN_STRUCT_SCOPED_LOGIC_GROUP="T_SCOPED_LOGIC_GROUP",W.TOKEN_STRUCT_LOGIC_GROUP="T_LOGIC_GROUP",W.TOKEN_STRUCT_ARRAY="T_ARRAY",W.TOKEN_STRUCT_T_LIST_START="T_LIST_START",W.TOKEN_STRUCT_TUPLE_LIST="T_LIST",W.TOKEN_STRUCT_METHOD_CALL="T_METHOD_CALL";var Xe=class{static isLanguageLogicalKeyword(e){return e==this.LogicalAnd||e==this.LogicalNot||e==this.LogicalOr||e==this.LogicalXor}};Xe.LogicalAnd="and",Xe.LogicalNot="not",Xe.LogicalOr="or",Xe.LogicalXor="xor",Xe.ConstTrue="true",Xe.ConstFalse="false",Xe.ConstNull="null",Xe.ArrList="list",Xe.ScopeAs="as";var $d=class{constructor(){this.chars=[];this.inputLen=0;this.currentIndex=0;this.currentContent=[];this.rawContent=[];this.startIndex=0;this.cur=null;this.next=null;this.prev=null;this.isParsingString=!1;this.isParsingModifierName=!1;this.isInModifierParameterValue=!1;this.runtimeNodes=[];this.ignorePrevious=!1;this.lastNode=null;this.referenceParser=null;this.activeNode=null}reset(){this.ignorePrevious=!1,this.runtimeNodes=[],this.chars=[],this.inputLen=0,this.currentIndex=0,this.currentContent=[],this.rawContent=[],this.startIndex=0,this.cur=null,this.next=null,this.prev=null,this.isParsingString=!1,this.isParsingModifierName=!1,this.isInModifierParameterValue=!1,this.referenceParser=null,this.activeNode=null}checkCurrentOffsets(){this.cur=this.chars[this.currentIndex],this.prev=null,this.next=null,this.ignorePrevious?(this.prev="",this.ignorePrevious=!1):this.currentIndex>0&&(this.prev=this.chars[this.currentIndex-1]),this.currentIndex+10)||G.ctypeAlpha(this.cur)||G.ctypeDigit(this.cur))?!0:G.ctypeSpace(e)?!1:this.isParsingModifierName&&(e==E.Punctuation_Minus||e==E.Punctuation_Underscore)?!0:!G.ctypePunct(e)}isRightOfInterpolationRegion(){if(this.activeNode==null||this.referenceParser==null)return!1;let e=this.activeNode._lexerRelativeOffset(this.currentIndex);return this.referenceParser.bordersInterpolationRegion(e)}scanForwardTo(e,n=0){let r=[];for(let i=this.currentIndex+1+n;i0&&Xe.isLanguageLogicalKeyword(l)&&(a=!0)}if(this.next==E.String_Terminator_SingleQuote||this.next==E.String_Terminator_DoubleQuote||this.next==null||a){this.appendContent(this.cur);let l=this.currentContent.join("");if(l.length>0){let u=l;if(this.currentContent=[],this.rawContent=[],u.trimRight().length==0){let f=this.nextNonWhitespace();if(f==E.String_Terminator_SingleQuote||f==E.String_Terminator_DoubleQuote){this.currentContent=[],this.rawContent=[];continue}}let c=new Ut;c.isVirtual=!1,c.name=u,c.value=u.trimRight(),c.startPosition=e._lexerRelativeOffset(this.currentIndex-u.length),c.endPosition=e._lexerRelativeOffset(this.currentIndex),c.parent=this.activeNode,this.guardAgainstNeighboringTypesInModifier(c),this.runtimeNodes.push(c),this.lastNode=c}if(l.length==0)continue;this.currentContent=[],this.rawContent=[],this.isInModifierParameterValue=!1;continue}if(this.next==E.Punctuation_Pipe||this.next==E.Punctuation_Colon||this.next==E.RightParent){this.isInModifierParameterValue=!1,this.appendContent(this.cur);let l=0,u=!1;if(this.currentContent[0]==E.String_Terminator_SingleQuote||this.currentContent[0]==E.String_Terminator_DoubleQuote){let m=this.scanForwardTo(this.currentContent[0]);m.length>0&&(this.currentContent=this.currentContent.concat(m),l=m.length,u=!0)}let c=this.currentContent.join("");u&&(c=c.substr(1),c=c.slice(0,-1)),this.currentContent=[],this.rawContent=[];let f=new Ut;f.isVirtual=!1,f.name=c,f.value=c,f.startPosition=e._lexerRelativeOffset(this.currentIndex-c.length),f.endPosition=e._lexerRelativeOffset(this.currentIndex),f.parent=this.activeNode,this.runtimeNodes.push(f),this.guardAgainstNeighboringTypesInModifier(f),this.lastNode=f,this.currentIndex+=l}else this.appendContent(this.cur);continue}if(this.isParsingString&&this.cur==i){if(this.prev==E.String_EscapeCharacter)this.appendContent(i);else{if(this.isInModifierParameterValue){let l=this.currentContent.join(""),u=new Ut;u.isVirtual=!1,u.name=l,u.value=l,u.startPosition=e._lexerRelativeOffset(r!=null?r:0),u.endPosition=e._lexerRelativeOffset(this.currentIndex),u.parent=this.activeNode,this.runtimeNodes.push(u),this.guardAgainstNeighboringTypesInModifier(u),this.lastNode=u,this.currentContent=[],this.rawContent=[],this.isParsingString=!1,this.isInModifierParameterValue=!1;continue}let a=new bt;a.isVirtual=!1,a.startPosition=e._lexerRelativeOffset(r!=null?r:0),a.endPosition=e._lexerRelativeOffset(this.currentIndex),this.referenceParser!=null&&(a.sourceContent=this.referenceParser.getText(a.startPosition.index,a.endPosition.index+1)),a.parent=this.activeNode,i!=null&&(a.sourceTerminator=i),i=null,this.isParsingString=!1,a.value=this.currentContent.join(""),a.rawLexContent=this.rawContent.join("").trim(),this.currentContent=[],this.rawContent=[],this.guardAgainstNeighboringTypesInModifier(a),this.runtimeNodes.push(a),this.lastNode=a}continue}if(this.isParsingString&&this.cur==E.String_EscapeCharacter){if(this.next==E.String_EscapeCharacter){this.appendContent(E.String_EscapeCharacter),this.ignorePrevious=!0,this.currentIndex+=1;continue}else if(this.next==E.String_Terminator_SingleQuote){this.appendContent(E.String_Terminator_SingleQuote),this.currentIndex+=1;continue}else if(this.next==E.String_Terminator_DoubleQuote){this.appendContent(E.String_Terminator_DoubleQuote),this.currentIndex+=1;continue}else if(this.next=="n"){this.appendContent(` -`),this.currentIndex+=1;continue}else if(this.next=="t"){this.appendContent(" "),this.currentIndex+=1;continue}else if(this.next=="r"){this.appendContent("\r"),this.currentIndex+=1;continue}}if(this.isParsingString==!1){if(this.isValidChar(this.cur)&&this.isValidChar(this.next)==!1&&this.currentContent.length==0&&(this.appendContent(this.cur),o=!1),(this.next==null||this.isValidChar(this.next)==!1)&&this.currentContent.length>0){o&&this.appendContent(this.cur);let a=this.currentContent.join("").trim(),l=a.length,u=this.currentIndex-l,c=e._lexerRelativeOffset(u),f=e._lexerRelativeOffset(this.currentIndex);if(this.currentContent=[],this.rawContent=[],a==Xe.LogicalAnd){let d=new fr;d.isVirtual=!1,d.content=Xe.LogicalAnd,d.startPosition=c,d.endPosition=f,d.parent=this.activeNode,this.runtimeNodes.push(d),this.lastNode=d;continue}else if(a==Xe.LogicalOr){let d=new Hr;d.isVirtual=!1,d.content=Xe.LogicalOr,d.startPosition=c,d.endPosition=f,d.parent=this.activeNode,this.runtimeNodes.push(d),this.lastNode=d;continue}else if(a==Xe.LogicalXor){let d=new ui;d.isVirtual=!1,d.content=Xe.LogicalXor,d.startPosition=c,d.endPosition=f,d.parent=this.activeNode,this.runtimeNodes.push(d),this.lastNode=d;continue}else if(a==Xe.ConstNull){let d=new ur;d.isVirtual=!1,d.content=Xe.ConstNull,d.startPosition=c,d.endPosition=f,d.parent=this.activeNode,this.runtimeNodes.push(d),this.lastNode=d;continue}else if(a==Xe.ConstTrue){let d=new Or;d.isVirtual=!1,d.content=Xe.ConstTrue,d.startPosition=c,d.endPosition=f,d.parent=this.activeNode,this.runtimeNodes.push(d),this.lastNode=d;continue}else if(a==Xe.ConstFalse){let d=new wr;d.isVirtual=!1,d.content=Xe.ConstFalse,d.startPosition=c,d.endPosition=f,d.parent=this.activeNode,this.runtimeNodes.push(d),this.lastNode=d;continue}else if(a==Xe.LogicalNot){let d=new on;d.isVirtual=!1,d.content=Xe.LogicalNot,d.startPosition=c,d.endPosition=f,d.parent=this.activeNode,this.runtimeNodes.push(d),this.lastNode=d;continue}else if(a==Xe.ArrList&&this.next==E.LeftParen){let d=new Yr;d.isVirtual=!1,d.content=Xe.ArrList,d.startPosition=c,d.endPosition=f,d.parent=this.activeNode,this.runtimeNodes.push(d),this.lastNode=d;continue}if(G.isNumeric(a)){let d=new Lt;d.isVirtual=!1,d.startPosition=c,d.endPosition=f,d.parent=this.activeNode,a.includes(".")?d.value=parseFloat(a):d.value=parseInt(a),d.rawLexContent=a,this.guardAgainstNeighboringTypesInModifier(d),this.runtimeNodes.push(d),this.lastNode=d;continue}if(this.runtimeNodes.length>0){let d=this.runtimeNodes[this.runtimeNodes.length-1];if(d instanceof vn){let p=new jt;p.isVirtual=!1,p.name=a,p.content=a,p.startPosition=c,p.endPosition=f,p.parent=this.activeNode,this.runtimeNodes.push(p),this.lastNode=p;continue}else if(d instanceof Pn){let p=new Ut;p.isVirtual=!1,p.name=a,p.value=a,p.startPosition=c,p.endPosition=f,p.parent=this.activeNode,this.runtimeNodes.push(p),this.lastNode=p,this.isParsingModifierName=!1;continue}}let m=new oe;m.isVirtual=!1,m.name=a,m.startPosition=c,m.endPosition=f,m.parent=this.activeNode,this.runtimeNodes.push(m),this.lastNode=m;continue}}else{this.appendContent(this.cur);continue}if(!G.ctypeSpace(this.cur)){if(this.isParsingString==!1){if(this.cur==E.Punctuation_Equals&&this.next==E.Punctuation_GreaterThan){let a=new In;a.isVirtual=!1,a.content="=>",a.startPosition=e._lexerRelativeOffset(this.currentIndex),a.endPosition=e._lexerRelativeOffset(this.currentIndex+1),a.parent=this.activeNode,this.runtimeNodes.push(a),this.lastNode=a,this.currentContent=[],this.rawContent=[],this.currentIndex+=1;continue}if(this.cur==E.Punctuation_Comma){let a=new Ct;a.isVirtual=!1,a.content=E.Punctuation_Comma,a.startPosition=e._lexerRelativeOffset(this.currentIndex),a.endPosition=e._lexerRelativeOffset(this.currentIndex+1),a.parent=this.activeNode,this.runtimeNodes.push(a),this.lastNode=a;continue}if(this.cur==E.Punctuation_Semicolon){let a=new sn;a.isVirtual=!1,a.content=E.Punctuation_Semicolon,a.startPosition=e._lexerRelativeOffset(this.currentIndex),a.endPosition=e._lexerRelativeOffset(this.currentIndex+1),a.parent=this.activeNode,this.runtimeNodes.push(a),this.lastNode=a;continue}if(this.cur==E.Punctuation_Plus){if(this.next==E.Punctuation_Equals){let l=new Lr;l.isVirtual=!1,l.content="+=",l.startPosition=e._lexerRelativeOffset(this.currentIndex),l.endPosition=e._lexerRelativeOffset(this.currentIndex+2),l.parent=this.activeNode,this.runtimeNodes.push(l),this.lastNode=l,this.currentIndex+=1;continue}let a=new Wn;a.isVirtual=!1,a.content="+",a.startPosition=e._lexerRelativeOffset(this.currentIndex),a.endPosition=e._lexerRelativeOffset(this.currentIndex+1),a.parent=this.activeNode,this.runtimeNodes.push(a),this.lastNode=a;continue}if(this.isParsingModifierName==!1&&this.cur==E.Punctuation_Minus){if(G.ctypeDigit(this.next)&&G.ctypeDigit(this.prev)==!1&&this.prev!=E.RightParent&&this.isRightOfInterpolationRegion()==!1){this.appendContent(this.cur);continue}if(this.next==E.Punctuation_Equals){let l=new li;l.isVirtual=!1,l.content="-=",l.startPosition=e._lexerRelativeOffset(this.currentIndex),l.endPosition=e._lexerRelativeOffset(this.currentIndex+2),l.parent=this.activeNode,this.runtimeNodes.push(l),this.lastNode=l,this.currentIndex+=1;continue}else if(this.next==E.Punctuation_GreaterThan){let l=new Xt;l.isVirtual=!1,l.content="->",l.startPosition=e._lexerRelativeOffset(this.currentIndex),l.endPosition=e._lexerRelativeOffset(this.currentIndex+2),l.parent=this.activeNode,this.runtimeNodes.push(l),this.lastNode=l,this.currentIndex+=1;continue}let a=new Tn;a.isVirtual=!1,a.content="-",a.startPosition=e._lexerRelativeOffset(this.currentIndex),a.endPosition=e._lexerRelativeOffset(this.currentIndex+1),a.parent=this.activeNode,this.runtimeNodes.push(a),this.lastNode=a;continue}if(this.cur==E.Punctuation_Asterisk){if(this.next==E.Punctuation_Asterisk){let l=new oi;l.isVirtual=!1,l.content="**",l.startPosition=e._lexerRelativeOffset(this.currentIndex),l.endPosition=e._lexerRelativeOffset(this.currentIndex+2),l.parent=this.activeNode,this.runtimeNodes.push(l),this.lastNode=l,this.currentIndex+=1;continue}else if(this.next==E.Punctuation_Equals){let l=new Mr;l.isVirtual=!1,l.content="*=",l.startPosition=e._lexerRelativeOffset(this.currentIndex),l.endPosition=e._lexerRelativeOffset(this.currentIndex+2),l.parent=this.activeNode,this.runtimeNodes.push(l),this.lastNode=l,this.currentIndex+=1;continue}let a=new Yn;a.isVirtual=!1,a.content="*",a.startPosition=e._lexerRelativeOffset(this.currentIndex),a.endPosition=e._lexerRelativeOffset(this.currentIndex+1),a.parent=this.activeNode,this.runtimeNodes.push(a),this.lastNode=a;continue}if(this.cur==E.Punctuation_ForwardSlash){if(this.next==E.Punctuation_Equals){let l=new Dr;l.isVirtual=!1,l.content="/=",l.startPosition=e._lexerRelativeOffset(this.currentIndex),l.endPosition=e._lexerRelativeOffset(this.currentIndex+2),l.parent=this.activeNode,this.runtimeNodes.push(l),this.lastNode=l,this.currentIndex+=1;continue}let a=new Hn;a.isVirtual=!1,a.content="/",a.startPosition=e._lexerRelativeOffset(this.currentIndex),a.endPosition=e._lexerRelativeOffset(this.currentIndex+1),a.parent=this.activeNode,this.runtimeNodes.push(a),this.lastNode=a;continue}if(this.cur==E.Punctuation_Percent){if(this.next==E.Punctuation_Equals){let l=new kr;l.isVirtual=!1,l.content="%=",l.startPosition=e._lexerRelativeOffset(this.currentIndex),l.endPosition=e._lexerRelativeOffset(this.currentIndex+2),l.parent=this.activeNode,this.runtimeNodes.push(l),this.lastNode=l,this.currentIndex+=1;continue}let a=new ai;a.isVirtual=!1,a.content="%",a.startPosition=e._lexerRelativeOffset(this.currentIndex),a.endPosition=e._lexerRelativeOffset(this.currentIndex+1),a.parent=this.activeNode,this.runtimeNodes.push(a),this.lastNode=a;continue}if(this.cur==E.Punctuation_LessThan){if(this.next==E.Punctuation_Equals){let l=null;if(this.currentIndex+2",c.startPosition=e._lexerRelativeOffset(this.currentIndex),c.endPosition=e._lexerRelativeOffset(this.currentIndex+3),c.parent=this.activeNode,this.runtimeNodes.push(c),this.lastNode=c,this.currentIndex+=2;continue}let u=new Vr;u.isVirtual=!1,u.content="<=",u.startPosition=e._lexerRelativeOffset(this.currentIndex),u.endPosition=e._lexerRelativeOffset(this.currentIndex+2),u.parent=this.activeNode,this.runtimeNodes.push(u),this.lastNode=u,this.currentIndex+=1;continue}let a=new Fr;a.isVirtual=!1,a.content="<",a.startPosition=e._lexerRelativeOffset(this.currentIndex),a.endPosition=e._lexerRelativeOffset(this.currentIndex+1),a.parent=this.activeNode,this.runtimeNodes.push(a),this.lastNode=a;continue}if(this.cur==E.Punctuation_GreaterThan){if(this.next==E.Punctuation_Equals){let l=new cr;l.isVirtual=!1,l.content=">=",l.startPosition=e._lexerRelativeOffset(this.currentIndex),l.endPosition=e._lexerRelativeOffset(this.currentIndex+2),l.parent=this.activeNode,this.runtimeNodes.push(l),this.lastNode=l,this.currentIndex+=1;continue}let a=new cr;a.isVirtual=!1,a.content=">",a.startPosition=e._lexerRelativeOffset(this.currentIndex),a.endPosition=e._lexerRelativeOffset(this.currentIndex+1),a.parent=this.activeNode,this.runtimeNodes.push(a),this.lastNode=a;continue}if(this.cur==E.Punctuation_Equals&&this.next!=E.Punctuation_Equals){let a=new Kn;a.isVirtual=!1,a.content="=",a.startPosition=e._lexerRelativeOffset(this.currentIndex),a.endPosition=e._lexerRelativeOffset(this.currentIndex+1),a.parent=this.activeNode,this.runtimeNodes.push(a),this.lastNode=a;continue}if(this.cur==E.Punctuation_Equals&&this.next==E.Punctuation_Equals){let a=null;if(this.currentIndex+20&&this.runtimeNodes[this.runtimeNodes.length-1]instanceof jt){let u=new Pn;u.isVirtual=!1,u.content=":",u.startPosition=e._lexerRelativeOffset(this.currentIndex),u.endPosition=e._lexerRelativeOffset(this.currentIndex+1),u.parent=this.activeNode,this.runtimeNodes.push(u),this.isInModifierParameterValue==!1?this.isInModifierParameterValue=!0:this.isInModifierParameterValue=!1;continue}let a=new It;a.isVirtual=!1,a.content=":",a.startPosition=e._lexerRelativeOffset(this.currentIndex),a.endPosition=e._lexerRelativeOffset(this.currentIndex+1),a.parent=this.activeNode,this.runtimeNodes.push(a),this.lastNode=a,this.isParsingModifierName=!1;continue}}o&&this.appendContent(this.cur)}}let s=this.runtimeNodes.length-1;for(let o=0;o0&&(a=this.runtimeNodes[o-1]),o!=s&&(l=this.runtimeNodes[o+1]);let u=this.runtimeNodes[o];u.prev=a,u.next=l}return this.runtimeNodes}};var kt=class{constructor(){this.chars=[];this.currentIndex=0;this.lastIndex=0;this.inputLength=0;this.prev=null;this.cur=null;this.next=null;this.isParsingString=!1;this.isStringKeyPath=!1;this.antlersErrors=[];this._recusriveEntryCheck=new Map}isValidChar(e){return!(this.isParsingString==!1&&G.ctypeSpace(e)||this.isParsingString==!1&&e==kt.LeftBracket||this.isParsingString==!1&&e==kt.RightBracket)}normalizePath(e){return e=e.replace(":","_"),e=e.replace(".","_"),e=e.replace("[","_"),e=e.replace("]","_"),e.replace("]","_")}getAntlersErrors(){return this.antlersErrors}mergeErrors(e){e.forEach(n=>{this.antlersErrors.push(n)})}parse(e){this.antlersErrors=[],this._recusriveEntryCheck.clear();let n=e,r=!1,i=!1,s=!1,o=!1;e.startsWith(E.AtChar)&&(s=!0,e=e.substr(1)),e.startsWith(E.Punctuation_Caret)?(o=!0,e=e.substr(1)):(e.startsWith(E.Punctuation_Dollar)&&(r=!0,e=e.substr(1)),e.startsWith(E.Punctuation_Dollar)&&(i=!0,e=e.substr(1))),this.chars=[],this.currentIndex=0,this.lastIndex=0,this.inputLength=0,this.cur=null,this.prev=null,this.next=null,this.chars=e.split(""),this.inputLength=this.chars.length,this.lastIndex=this.inputLength-1;let a=[],l=!1,u=[],c=kt.ColonSeparator,f=!1,m=null,d=!1,p=!0;if(this.isParsingString=!1,this.inputLength==0){let h=new rs;return h._isFromEmptyFailState=!0,h}for(this.currentIndex;this.currentIndex0&&(this.prev=this.chars[this.currentIndex-1]),this.currentIndex+10){let g=new Un;g.name=a.join(""),g.delimiter=c,u.push(g),a=[]}if(this.next==null||G.ctypeSpace(this.next)){this.antlersErrors.push(M.makeSyntaxError(P.TYPE_ILLEGAL_VARPATH_SPACE_RIGHT,null,"Unexpected end of input or whitespace while parsing variable accessor path."));continue}let h=this.locateEndOfAccessor();this.currentIndex=h.foundOn;let b=new kt;if(u.push(b.parse(h.nestedContent)),this.mergeErrors(b.getAntlersErrors()),l=!0,this.currentIndex==-1){this.antlersErrors.push(M.makeSyntaxError(P.PARSER_CANNOT_PARSE_PATH_RECURSIVE,null,"Cannot parse variable path.")),l=!1;break}continue}if(this.isParsingString==!1&&this.next==kt.RightBracket&&l){p?a.push(this.cur):p=!0;let h=new sd;h.name=a.join(""),u.push(h),a=[],c=kt.ColonSeparator,this.currentIndex+=1,l=!1;continue}if(this.isParsingString==!1&&(this.cur==kt.LeftBracket||this.cur==kt.ColonSeparator||this.cur==kt.DotPathSeparator||this.currentIndex==this.lastIndex)){if(this.next==null||G.ctypeSpace(this.next)){if(this.cur==kt.ColonSeparator){if(a.length==0){this.antlersErrors.push(M.makeSyntaxError(P.TYPE_UNEXPECTED_BRANCH_SEPARATOR,null,"Unexpected [T_BRANCH_SEPARATOR] while parsing input text."));continue}this.antlersErrors.push(M.makeSyntaxError(P.TYPE_ILLEGAL_VARPATH_RIGHT,null,'Variable paths cannot end with the ":" character.'));continue}if(this.cur==kt.LeftBracket){this.antlersErrors.push(M.makeSyntaxError(P.TYPE_ILLEGAL_VARPATH_SUBPATH_START,null,"Illegal variable sub-path start."));continue}}this.currentIndex==this.lastIndex&&this.isValidChar(this.cur)&&(p?a.push(this.cur):p=!0);let h=new Un;h.delimiter=c,h.name=a.join(""),d&&(h.isStringVar=d,h.name=n.substr(1),h.name=h.name.slice(0,-1),d=!1),u.push(h),a=[];continue}else{a.push(this.cur);continue}}let _=u.length;if(_>0){let h=u[_-1];(h instanceof Un||h instanceof rs)&&(h.isFinal=!0)}let C=new rs;return C.isStrictTagReference=o,C.isStrictVariableReference=r,C.isExplicitVariableReference=i,C.pathParts=u,C.originalContent=e,C.isVariableVariable=s,C.normalizedReference=e.replace(":","."),C}locateEndOfAccessor(){let e=[],n=1,r=-1,i="",s=!1,o=null;if(this._recusriveEntryCheck.has(this.currentIndex+1)==!1)this._recusriveEntryCheck.set(this.currentIndex+1,!0);else return{foundOn:r,nestedContent:""};for(let a=this.currentIndex+1;a0&&(c=this.chars[a-1]),a+10&&(this.prev=this.chars[this.currentIndex-1]),r==!1){if(s==!1&&(this.cur==E.String_Terminator_DoubleQuote||this.cur==E.String_Terminator_SingleQuote)){o=this.cur,s=!0,n.push(this.cur);continue}if(s&&G.ctypeSpace(this.cur)){n.push(this.cur);continue}if(s&&this.cur==o&&this.prev!=E.String_EscapeCharacter){o=null,s=!1,n.push(this.cur);continue}if(G.ctypeSpace(this.cur)||this.currentIndex==this.inputLen-1||this.cur==E.Punctuation_Pipe){if(n.length==0)continue;G.ctypeSpace(this.cur)||this.cur!=E.Punctuation_Pipe&&n.push(this.cur),i=n.join(""),r=!0;break}n.push(this.cur)}let a=e.getContentRelativeStartIndex();if(e.nameStartsOn=e.relativeOffset(a,a),e.nameStartsOn!=null&&(e.nameEndsOn=e.nameStartsOn.shiftRight(i.length-1),i.includes(E.Punctuation_Colon))){let p=i.indexOf(E.Punctuation_Colon);e.nameMethodPartStartsOn=e.nameStartsOn.shiftRight(p+1)}e.name=Kd.getIdentifier(i),Yd.analyzeNode(e),e.parameters=this.getParameters(e),e.hasParameters=e.parameters.length>0,e.hasParameters&&(Yd.analyzeParametersForModifiers(e),e.resetContentCache()),e.pathReference=this.pathParser.parse(i),e.mergeErrors(this.pathParser.getAntlersErrors()),e.pathReference!=null&&e.pathReference.isStrictTagReference&&(e.name.name=e.name.name.substr(1),e.name.content=e.name.content.substr(1)),e.isClosingTag=this.canBeClosingTag(e);let l=[];e.isClosingTag==!1&&(l=this.lexer.tokenize(e,e.getContent())),e.runtimeNodes=l;let u=e.content.trim();if($t.isConditionalStructure(e)&&e.name.name!="else"&&l.length==0&&u!="/if"&&u!="/unless"&&u!="/endunless"&&u!="endif"&&u!="endunless"&&u!="/endif"&&e.getContent().trim().length==0&&this.pushConditionWithoutExpression(e),e.name.name=="endif"){let p=e.copyBasicDetails(),_=e.getParser();return _!=null&&p.withParser(_),p.name=new Ln,p.name.name="if",p.name.compound="if",p.isClosingTag=!0,p.content=" /if ",p.originalNode=e,p}if(e.name.name=="unless"){let p=e.copyBasicDetails(),_=e.getParser();if(_!=null&&p.withParser(_),p.name=new Ln,p.name.name="if",p.name.compound="if",e.isClosingTag==!1){let C=(c=e.getContent())!=null?c:"",h=" if !("+C+") ";p.content=h,p.originalNode=e,p.resetContentCache(),p.runtimeNodes=this.lexer.tokenize(p,(f=p.getContent())!=null?f:""),this.testUnlessContent(p)}else p.originalNode=e,p.content=" /if ";return p}else if(e.name.name=="elseunless"){let p=e.copyBasicDetails(),_=e.getParser();_!=null&&p.withParser(_),p.name=new Ln,p.name.name="elseif",p.name.compound="elseif";let C=(m=e.getContent())!=null?m:"",h=" elseif !("+C+") ";return p.content=h,p.originalNode=e,p.resetContentCache(),p.runtimeNodes=this.lexer.tokenize(p,(d=p.getContent())!=null?d:""),this.testUnlessContent(p),p}else if(e.name.name=="endunless"){let p=e.copyBasicDetails(),_=e.getParser();return _!=null&&p.withParser(_),p.name=new Ln,p.name.name="if",p.name.compound="if",p.isClosingTag=!0,p.content=" /if ",p.originalNode=e,p}return e}pushError(e){this.activeNode!=null&&this.activeNode.pushError(e)}testUnlessContent(e){var r;let n=(r=e.getContent())!=null?r:"";if(n=n.replace("!",""),n=n.replace("(",""),n=n.replace(")","").trim(),n.length==0){this.pushConditionWithoutExpression(e);return}}pushConditionWithoutExpression(e){this.pushError(M.makeSyntaxError(P.TYPE_PARSE_EMPTY_CONDITIONAL,e,"Condition structure lacks comparison expression."))}getParameters(e){var V,O,$,X,ee,Y,ne,Le,de;let n=(V=e.getContent())!=null?V:"",r=n.split(""),i=[],s=[],o=r.length,a=0;if(e.name!=null){let Z=G.trimLeft(e.content," "),Ge=e.content.length-Z.length,lt=e.name.content.length;Ge>0?a=Ge+lt:a=lt}let l=!1,u=[],c="",f=0,m=0,d=!1,p=null,_=-1,C=-1,h=-1,b=-1,g=-1,N=-1,S='"';for(let Z=0;Z0&&(lt=r[Z-1]),l==!1&&G.ctypeSpace(Ge)){u=[],_=-1,C=-1,h=-1,b=-1,g=-1,N=-1;continue}if(l==!1&&Ge==E.Punctuation_Equals){if(u.length>0&&(G.ctypeAlpha(u[0])||G.ctypeDigit(u[0])||u[0]==E.Punctuation_Colon||u[0]==E.AtChar)==!1){u=[];continue}if(Z+1>=o){this.pushError(M.makeSyntaxError(P.TYPE_UNEXPECTED_END_OF_INPUT,e,"Unexpected end of input"));continue}let Ve=null;if(Z+10&&(b=Z,g=Z,c=u.join(""),f=m,l=!0,u=[]),Ft==E.String_Terminator_DoubleQuote&&(p=E.String_Terminator_DoubleQuote,S=E.String_Terminator_DoubleQuote,Z+=1),Ft==E.String_Terminator_SingleQuote&&(p=E.String_Terminator_SingleQuote,S=E.String_Terminator_SingleQuote,Z+=1);continue}if(l&&Ge==E.String_EscapeCharacter){let Ve=null;if(Z+1o){this.pushError(M.makeSyntaxError(P.TYPE_UNEXPECTED_EOI_WHILE_PARSING_NODE_PARAMETER,e,"Unexpected end of input while parsing parameter content.")),ut.parent=e,s.push(ut),c="";continue}ut.endPosition=($=e.relativePositionFromOffset(Z+1,Z+1))!=null?$:null,ut.parent=e,ut.blockPosition={start:(X=e.relativeOffset(_,_))!=null?X:null,end:(ee=e.relativeOffset(C,C))!=null?ee:null},ut.namePosition={start:(Y=e.relativeOffset(h,h))!=null?Y:null,end:(ne=e.relativeOffset(b,b))!=null?ne:null},ut.valuePosition={start:(Le=e.relativeOffset(g+2,g+2))!=null?Le:null,end:(de=e.relativeOffset(N,N))!=null?de:null},s.push(ut),c="",_=-1,C=-1,h=-1,b=-1,g=-1,N=-1;continue}if(l==!1&&(Ge==E.String_Terminator_DoubleQuote||Ge==E.String_Terminator_SingleQuote)&&Z>a)break;u.push(Ge),_==-1&&(_=Z),h==-1&&(h=Z),u.length==1&&(m=Z+1)}if(p!=null){let Z=e;if(i.length>0){let Ge=i[i.length-1],lt=e.content.indexOf(Ge);if(lt>=0){let Ft=new J;Ft.startPosition=e.relativeOffset(lt-2,lt-2),Ft.endPosition=e.relativeOffset(lt+Ge.length,lt+Ge.length),Z=Ft}}this.pushError(M.makeSyntaxError(P.TYPE_UNEXPECTED_END_OF_INPUT,Z,"Unexpected string literal while parsing parameters."))}return s}};function bl(t){return t.length==0?null:t[0].startPosition}var $N=Q(Vu()),Fc=class{static regions(){return this.noParseRegions}static clear(){this.noParseRegions.clear()}static registerNoParseContent(e){let n=$N.Md5.hashStr(e);return this.noParseRegions.set(n,e),n}};Fc.noParseRegions=new Map;function Xd(t,e){let n=new Set(t),r=new Set(e),i=new Set([...n].filter(s=>r.has(s)));return Array.from(i)}var Qd=class{constructor(){this.closingTagIndex=new Map;this.closingTagIndexCount=new Map;this.openTagIndexCount=new Map;this.closingTagNames=new Map;this.parentNode=null;this.stackCount=0;this.createdExecutionBranches=[];this.document=null}getClosingCandidates(e){var n,r;if((e instanceof B||e instanceof ft)&&e.isClosingTag==!1){let i=(r=(n=e.name)==null?void 0:n.compound)!=null?r:"";return i=="if"?["if","elseif","else"]:i=="elseif"?["elseif","else","if"]:i=="else"?["if"]:[i]}return[]}buildCloseIndex(e){var n,r,i;e.forEach(s=>{var o,a,l,u,c,f,m,d,p,_;if(!(s instanceof lr)&&!((s instanceof B||s instanceof ft)&&s.isSelfClosing)&&(s instanceof B||s instanceof ft)&&s.isClosingTag){this.closingTagIndex.has(this.stackCount)==!1&&this.closingTagIndex.set(this.stackCount,new Map),this.closingTagIndexCount.has(this.stackCount)==!1&&this.closingTagIndexCount.set(this.stackCount,new Map);let C=(a=(o=s.name)==null?void 0:o.compound)!=null?a:"";((l=this.closingTagIndex.get(this.stackCount))==null?void 0:l.has(C))==!1&&((u=this.closingTagIndex.get(this.stackCount))==null||u.set(C,[]),(c=this.closingTagIndexCount.get(this.stackCount))==null||c.set(C,0)),(m=(f=this.closingTagIndex.get(this.stackCount))==null?void 0:f.get(C))==null||m.push(s);let h=(p=(d=this.closingTagIndexCount.get(this.stackCount))==null?void 0:d.get(C))!=null?p:0;(_=this.closingTagIndexCount.get(this.stackCount))==null||_.set(C,h+1)}}),this.closingTagNames.has(this.stackCount)==!1&&this.closingTagNames.set(this.stackCount,[]),this.closingTagIndex.has(this.stackCount)&&(this.closingTagNames.set(this.stackCount,Array.from((r=(n=this.closingTagIndex.get(this.stackCount))==null?void 0:n.keys())!=null?r:[])),(i=this.closingTagIndex.get(this.stackCount))==null||i.forEach((s,o)=>{var u,c,f,m,d,p,_;let a=s.length;if(a==0)return;let l=s[a-1];for(let C=0;C=l.index)break;let b=(c=(u=h.name)==null?void 0:u.compound)!=null?c:"";if(h.isClosingTag==!1&&o==b&&!h.isSelfClosing){this.openTagIndexCount.has(this.stackCount)==!1&&this.openTagIndexCount.set(this.stackCount,new Map),((f=this.openTagIndexCount.get(this.stackCount))==null?void 0:f.has(o))==!1&&((m=this.openTagIndexCount.get(this.stackCount))==null||m.set(o,0));let g=(p=(d=this.openTagIndexCount.get(this.stackCount))==null?void 0:d.get(o))!=null?p:0;(_=this.openTagIndexCount.get(this.stackCount))==null||_.set(o,g+1)}}}}))}getScanForList(e){var n;if(e instanceof B||e instanceof ft){let r=(n=e.name)==null?void 0:n.compound;if(r=="else")return["if"];if(r=="elseif")return["elseif","else","if"];if(e.isClosingTag==!1){let i=this.getClosingCandidates(e),s=this.closingTagNames.get(this.stackCount);return Xd(i,s)}}return[]}canPossiblyClose(e){var n,r;if(e instanceof lr)return!1;if(e instanceof ft||e instanceof B){if(e.isComment||e.isSelfClosing)return!1;let i=(r=(n=e.name)==null?void 0:n.compound)!=null?r:"";if(i=="else"||i=="elseif")return!0;if(e.isClosingTag==!1){let s=this.getClosingCandidates(e),o=this.closingTagNames.get(this.stackCount);return Xd(s,o).length>0}}return!1}findClosingPair(e,n,r){var a,l,u,c;let i=n.runtimeNodes.length,s=e.length,o=0;for(let f=0;f=i,o+=1}continue}if(r.includes(d)&&o>0){o-=1;continue}if(o==0&&r.includes(d)){m.isOpenedBy=n,n.isClosedBy=m;break}}}else continue}}associate(e,n){var s,o,a,l,u,c,f;this.document=n;let r=[{documentNodes:e,parent:null}],i=[];for(;r.length>0;){let m=r.pop();if(m==null)continue;let d=m.documentNodes;this.parentNode=m.parent,this.stackCount+=1,this.buildCloseIndex(d),d=$t.pairConditionals(d),d.forEach(h=>{if((h instanceof B||h instanceof ft)&&this.canPossiblyClose(h)){if($t.isConditionalStructure(h))return;let b=this.getScanForList(h);this.findClosingPair(d,h,b)}});let p=d.length;for(let h=0;hb.isClosedBy.index)break;if(N.parent=b,b.children.push(N),N instanceof B&&N.index==b.index){N.parent=b;break}}}d.forEach(h=>{if((h instanceof B||h instanceof ft)&&h.children.length>0){let b=[];h.children.forEach(g=>{g.parent!=null&&g.parent.index==h.index&&(g.parent=h,b.push(g))}),r.push({documentNodes:b,parent:h})}});let _=[];d.forEach(h=>{this.parentNode==null?h.parent==null&&_.push(h):h.parent==this.parentNode&&_.push(h)}),_=this.reduceConditionals(_,n);let C=new Map;d.forEach(h=>{var b,g,N,S;if((h instanceof B||h instanceof ft)&&h.isClosedBy!=null&&this.document!=null){let V=this.document.getText(((g=(b=h.endPosition)==null?void 0:b.index)!=null?g:0)+1,(S=(N=h.isClosedBy.startPosition)==null?void 0:N.index)!=null?S:0);h.runtimeContent=V}});for(let h=0;h<_.length;h++){let b=_[h],g=(s=b.refId)!=null?s:"";if(C.set(g,1),(b instanceof B||b instanceof ft)&&b.isComment==!1&&((o=b.name)==null?void 0:o.name)=="noparse"&&!(b instanceof rn)&&b.isClosingTag==!1){if(b.isClosedBy==null){b.pushError(M.makeSyntaxError(P.TYPE_NO_PARSE_UNASSOCIATED,b,"Encountered noparse region without a closing tag. All noparse regions must be closed."));continue}let N=b.content;this.document!=null&&(N=this.document.getText(((l=(a=b.endPosition)==null?void 0:a.index)!=null?l:0)+1,(f=(c=(u=b.isClosedBy)==null?void 0:u.startPosition)==null?void 0:c.index)!=null?f:0));let S=new rn,V=b.getParser();V!=null&&S.withParser(V),b.copyBasicDetailsTo(S),S.name=new Ln,S.name.name="noparse",S.name.compound="noparse",S.content=Fc.registerNoParseContent(N),S.originalNode=b,S.isClosedBy=b.isClosedBy,S.parent=b.parent,_[h]=S}}if(this.parentNode!=null&&(this.parentNode instanceof ft||this.parentNode instanceof B)&&(this.parentNode.children=this.cleanNodes(_),this.parentNode.parent!=null&&this.parentNode.parent instanceof B)){let h=this.parentNode.parent.children,b=[];h.forEach(g=>{var N;C.has((N=g.refId)!=null?N:"")==!1&&b.push(g)}),this.parentNode.parent.children=this.cleanNodes(b)}this.stackCount<=1&&(i=_)}return this.createdExecutionBranches.length>0&&this.createdExecutionBranches.forEach(m=>{m.head!=null&&(m.nodes=m.head.children)}),i}cleanNodes(e){let n=[],r=[];for(let i=0;iQd.ForceBreakLimit){$=!1;break}if(h instanceof B||h instanceof ft){let ee=this.findEndOfBranch(e.slice(C+1),h,C),Y=new ed,ne=ee.tail;Y.head=h,Y.tail=ne,Y.nodes=this.cleanNodes(h.children);let Le=((f=(c=h.endPosition)==null?void 0:c.offset)!=null?f:0)+1,de=(p=(d=(m=h.isClosedBy)==null?void 0:m.startPosition)==null?void 0:d.offset)!=null?p:0,Z=n.getText(Le,de);if(Y.documentText=Z,n.shouldParseChildDocument()&&(Y.childDocument=mt.childFromText(Y.documentText,bl(Y.nodes))),ne==null&&(ne=Y.head.isClosedBy),ne!=null&&ne.startPosition!=null&&(Y.startPosition=ne.startPosition),ne!=null&&(Y.index=ne.index),Y.nodes.length>0){let Ge=Y.nodes[Y.nodes.length-1];Ge.endPosition!=null&&(Y.endPosition=Ge.endPosition)}else ne!=null&&ne.endPosition!=null&&(Y.endPosition=ne.endPosition);if(this.createdExecutionBranches.push(Y),g.logicBranches.push(Y),(ne==null?void 0:ne.isClosingTag)&&((_=ne.name)==null?void 0:_.compound)=="if"){O=ee.offset,$=!1;break}else ne!=null&&g.chain.push(ne.index),C=ee.offset,ne instanceof B&&(h=ne)}else $=!1}if(g.logicBranches.length>0){let ee=g.logicBranches[0],Y=g.logicBranches[g.logicBranches.length-1];ee.startPosition!=null&&(g.startPosition=ee.startPosition),Y.endPosition!=null&&(g.endPosition=Y.endPosition)}if(r.push(g),O!=null&&O==e.length)break}else r.push(h);else r.push(h)}return r}},ga=Qd;ga.ForceBreakLimit=1e5;var Jd=class{static associateRecursiveParent(e){var n,r;for(let i=0;i=0;l-=1){let u=e[l];if(!(u instanceof Qe)&&u instanceof B&&u.isClosedBy!=null){if(s.isNestedRecursive){if(u.content.trim()==((r=s.name)==null?void 0:r.name)){a=u;break}}else if(u.runtimeContent.includes(o)&&G.substringCount(s.runtimeContent,"*recursive")==1){a=u;continue}else if(a!=null)break}}if(a==null)continue;s.isNestedRecursive?(a.hasRecursiveNode=!0,s.recursiveParent=a,a.recursiveReference=s):a.parent!=null?a.parent instanceof B&&(a.parent.hasRecursiveNode=!0,a.parent.recursiveReference=s,s.recursiveParent=a.parent):(a.hasRecursiveNode=!0,s.recursiveParent=a,a.recursiveReference=s)}}}};var _a=class{static getNearText(e){var r,i,s,o;if(e instanceof oe)return e.name;if(e instanceof Lt)return(i=(r=e.value)==null?void 0:r.toString())!=null?i:"";if(e instanceof bt)return e.value;if(e instanceof jt)return e.name;if(e instanceof Ut)return e.value;if(e instanceof Yr||e instanceof ui||e instanceof ur||e instanceof Or||e instanceof wr||e instanceof on||e instanceof Gr||e instanceof Ct||e instanceof sn||e instanceof Lr||e instanceof Wn||e instanceof li||e instanceof Tn||e instanceof oi||e instanceof Mr||e instanceof Yn||e instanceof Dr||e instanceof Hn||e instanceof kr||e instanceof ai||e instanceof jr||e instanceof Vr||e instanceof Fr||e instanceof Ei||e instanceof cr||e instanceof Kn||e instanceof Ur||e instanceof Nn||e instanceof fr||e instanceof vn||e instanceof Hr||e instanceof Br||e instanceof qr||e instanceof wi||e instanceof pr||e instanceof Wr||e instanceof zt||e instanceof Bt||e instanceof Pn||e instanceof It||e instanceof ts||e instanceof In||e instanceof ci||e instanceof Xt)return e.content;let n="";return e instanceof B?e.originalNode!=null?n=e.originalNode.getContent():n=(o=(s=e.startPosition)==null?void 0:s.line.toString())!=null?o:"":e.originalAbstractNode!=null?n=e.originalAbstractNode.rawContent():n=e.rawContent(),n.length>15&&(n=n.substr(0,-15)),n}};var ya=class{};ya.deferredCoreLibraries=["arr","array","str","string","method","math","sys","convert","scope","stopwatch","file","path","url","request","json","datetime"];var ht=class{};ht.ARR_PLUCK="pluck",ht.ARR_TAKE="take",ht.ARR_SKIP="skip",ht.ARR_MAKE="arr",ht.ARR_ORDERBY="orderby",ht.ARR_GROUPBY="groupby",ht.ARR_MERGE="merge",ht.QUERY_WHERE="where",ht.STRUCT_SWITCH="switch",ht.BITWISE_AND="bwa",ht.BITWISE_OR="bwo",ht.BITWISE_XOR="bxor",ht.BITWISE_NOT="bnot",ht.BITWISE_SHIFT_LEFT="bsl",ht.BITWISE_SHIFT_RIGHT="bsr",ht.operators=["pluck","take","arr","skip","orderby","groupby","merge","where","switch","bwa","bwo","bxor","bsl","bsr"];var Rt=class{constructor(){this.pathParser=new ki;this.tokens=[];this.createdModifierChains=[];this.createdLanguageOperators=[];this.createdArrays=[];this.tracedAssignments=[];this.mergedVariablePaths=[];this.mergedComponents=new Map;this.modifierNameMapping=new Map;this.isRealModifierSeparator=new Map;this.isRoot=!0;this.retriggerNonVirtualGroupMembers=[]}hasModifierConstruct(e){return this.modifierNameMapping.has(e)}getModifierConstruct(e){return this.modifierNameMapping.get(e)}isActualModifierSeparator(e){return this.isRealModifierSeparator.has(e)}isMergedVariableComponent(e){return this.mergedComponents.has(e)}getMergedVariable(e){return this.mergedComponents.get(e)}getMergedVariablePaths(){return this.mergedVariablePaths}getCreatedModifierChains(){return this.createdModifierChains}getCreatedLangaugeOperators(){return this.createdLanguageOperators}getCreatedArrays(){return this.createdArrays}getRuntimeAssignments(){return this.tracedAssignments}getAssignedVariables(){let e=[],n=[];for(let r=0;r0&&this.retriggerNonVirtualGroupMembers.forEach(n=>{this.markAllNonVirtualAsListGroupMember(n)})),this.createSemanticGroups(this.tokens)}setIsRoot(e){return this.isRoot=e,this}validateNeighboringOperators(e){let n=e.length;for(let r=0;r=n){i.pushError(M.makeSyntaxError(P.TYPE_UNEXPECTED_OPERATOR,i,"Unexpected operator while parsing input text."));return}let s=e[r+1];if(Rt.isOperatorType(s)){s.pushError(M.makeSyntaxError(P.TYPE_OPERATOR_INVALID_ON_RIGHT,s,"Unexpected operator while parsing input text."));continue}}}}static isAssignmentOperator(e){return e instanceof Lr||e instanceof Dr||e instanceof Kn||e instanceof kr||e instanceof Mr||e instanceof li}static isOperatorType(e){return e instanceof Lr||e instanceof Dr||e instanceof Kn||e instanceof kr||e instanceof Mr||e instanceof li||e instanceof wi||e instanceof Gr||e instanceof fr||e instanceof on||e instanceof Hr||e instanceof ui||e instanceof pr||e instanceof ci||e instanceof Wn||e instanceof Hn||e instanceof oi||e instanceof ai||e instanceof Yn||e instanceof Tn||e instanceof Nn||e instanceof cr||e instanceof Ei||e instanceof Fr||e instanceof Vr||e instanceof qr||e instanceof Br||e instanceof jr||e instanceof Ur}markAllNonVirtualAsListGroupMember(e){e.forEach(n=>{if(n instanceof De||n instanceof dr||n instanceof Li){n.start!=null&&n.start.isVirtual==!1&&(n.start.isListGroupMember=!0),n.end!=null&&n.end.isVirtual==!1&&(n.end.isListGroupMember=!0),n.scopeOperator!=null&&(n.scopeOperator.isListGroupMember=!0),n.nodes.forEach(r=>{this.markAllNonVirtualAsListGroupMember([r])});return}else n instanceof Ot&&(n.separatorToken!=null&&n.separatorToken.isVirtual==!1&&(n.separatorToken.isListGroupMember=!0),this.markAllNonVirtualAsListGroupMember(n.nodes));n.isVirtual==!1&&(n.isListGroupMember=!0),n.originalAbstractNode!=null&&n.originalAbstractNode!=n&&this.markAllNonVirtualAsListGroupMember([n.originalAbstractNode])})}markAllNonVirtualAsSwitch(e){e.forEach(n=>{if(n instanceof De||n instanceof dr||n instanceof Li){n.start!=null&&n.start.isVirtual==!1&&(n.start.isSwitchGroupMember=!0),n.end!=null&&n.end.isVirtual==!1&&(n.end.isSwitchGroupMember=!0),n.scopeOperator!=null&&(n.scopeOperator.isSwitchGroupMember=!0),n.nodes.forEach(r=>{this.markAllNonVirtualAsSwitch([r])});return}else n instanceof Ot&&(n.separatorToken!=null&&n.separatorToken.isVirtual==!1&&(n.separatorToken.isSwitchGroupMember=!0),this.markAllNonVirtualAsSwitch(n.nodes));n.isVirtual==!1&&(n.isSwitchGroupMember=!0),n.originalAbstractNode!=null&&n.originalAbstractNode!=n&&this.markAllNonVirtualAsSwitch([n.originalAbstractNode])})}validateNoDanglingLogicGroupEnds(e){e.forEach(n=>{n instanceof Bt&&n.pushError(M.makeSyntaxError(P.TYPE_LOGIC_GROUP_NO_START,n,"Unexpected [T_LOGIC_END] while parsing input text."))})}isValidModifierValue(e){return e instanceof Ut||e instanceof oe||e instanceof Or||e instanceof wr||e instanceof ur||e instanceof Lt||e instanceof bt}wrapNumberInVariable(e){var r,i,s,o;let n=new oe;return n.startPosition=e.startPosition,n.endPosition=e.endPosition,n.name=(i=(r=e.value)==null?void 0:r.toString())!=null?i:"",n.content=(o=(s=e.value)==null?void 0:s.toString())!=null?o:"",n.originalAbstractNode=e,n.refId=e.refId,n.modifierChain=e.modifierChain,n.index=e.index,n}wrapArithmeticModifier(e,n){let r=new jt;return r.startPosition=e.startPosition,r.endPosition=e.endPosition,r.originalAbstractNode=e,r.content=n,r.name=n,r.index=e.index,r}combineVariablePaths(e){let n=[],r=e.length;for(let i=0;ir){let u="";if(i>0){let c=e[i-1];u=_a.getNearText(c)}s.pushError(M.makeSyntaxError(P.TYPE_UNEXPECTED_EOI_PARSING_BRANCH_GROUP,s,'Unexpected end of input while parsing input text near "'+u+_a.getNearText(s)+'".'));continue}let a=n[o-1],l=e[i+1];if(l instanceof Lt&&nt.distance(a,l)==1&&(l=this.wrapNumberInVariable(l)),a instanceof oe&&l instanceof oe&&nt.distance(a,l)==1){n.pop(),nt.mergeVarContentRight(":",s,l),nt.mergeVarRight(a,l),n.push(l),this.mergedVariablePaths.push(l),this.mergedComponents.set(s,l),this.mergedComponents.set(a,l),this.mergedComponents.set(l,l),i+=1;continue}else{n.push(s);continue}}else if(s instanceof bt&&o>0){if(i+1>=r){n.push(s);continue}let a=n[o-1],l=e[i+1];if(a instanceof oe&&l instanceof oe&&nt.distance(a,s)<=1&&nt.distance(s,l)<=1){n.pop(),nt.mergeVarContentLeft(s.sourceTerminator+s.value+s.sourceTerminator,s,a),nt.mergeVarContentLeft(l.name,l,a),n.push(a),this.mergedVariablePaths.push(a),this.mergedComponents.set(s,a),this.mergedComponents.set(a,a),this.mergedComponents.set(l,a),i+=1;continue}else n.push(s)}else if(s instanceof Tn&&o>0){let a=n[o-1],l=e[i+1];if(a instanceof oe&&l instanceof oe){let u=nt.distance(a,s),c=nt.distance(s,l);u<=1&&c<=1?(a.endPosition=l.endPosition,this.mergedComponents.set(s,a),this.mergedComponents.set(a,a),this.mergedComponents.set(l,a),i+=1):n.push(s)}else n.push(s)}else n.push(s)}return n.forEach(i=>{i instanceof oe&&(i.variableReference=this.pathParser.parse(i.name),i.mergeErrors(this.pathParser.getAntlersErrors()))}),n}convertVarNodeToOperator(e){let n=new Gr;return n.content=e.name,n.startPosition=e.startPosition,n.endPosition=e.endPosition,n.originalAbstractNode=e,e.convertedToOperator=!0,this.createdLanguageOperators.push(n),n}convertOperatorToVarNode(e){let n=new oe;return n.startPosition=e.startPosition,n.endPosition=e.endPosition,n.content=e.content,n.name=e.content,n.originalAbstractNode=e,n}createLanguageOperators(e){let n=e.length;for(let r=0;r=n){e[r]=this.convertOperatorToVarNode(i);continue}if(e[r+1]instanceof sn){e[r]=this.convertOperatorToVarNode(i);continue}}}return e}createLogicalGroups(e){let n=[],r=e.length,i=[];for(let o=0;o0&&i.length>0){let f=i[i.length-1];if(f instanceof Lt||f instanceof Bt||f instanceof De){if(f instanceof De&&f.start instanceof on){f.start.pushError(M.makeSyntaxError(P.TYPE_FACTORIAL_MATERIALIZED_BOOL_DETECTED,f.start,"[T_AOP_FACTORIAL] operand will always materialize boolean type."));continue}let m=new ts;m.startPosition=a.startPosition,m.endPosition=a.endPosition,m.content="!".repeat(l),m.originalAbstractNode=a,m.repeat=l,i.push(m),l>0&&(o+=l-1);continue}}if(l%2==0){o+=l-1;continue}let u=e[o+l];if(u instanceof zt){let f=o+l+1;if(f>=r){u.pushError(M.makeSyntaxError(P.TYPE_UNEXPECTED_EOI_WHILE_PARSING_LOGIC_GROUP_NEGATION_OFFSET,u,"Unexpected end of input while parsing input text."));continue}let m=this.findLogicalGroupEnd(e[o+l],e.slice(f));if(m.found){let d=m.logicalGroup,p=new De;p.start=a,p.end=d,p.nodes.push(a),p.nodes.push(d),p.startPosition=a.startPosition,p.endPosition=d.endPosition,i.push(p),o+=m.skipCount+l}continue}let c=this.resolveValueRight(e,o);c.value!=null&&i.push(c.value),o+=c.negationCount}else i.push(a)}let s=i.length;for(let o=0;o=s){a.pushError(M.makeSyntaxError(P.TYPE_UNEXPECTED_EOI_WHILE_PARSING_LOGIC_GROUP_END_DUE_TO_NEGATION,a,"Unexpected end of input while parsing input text."));continue}let l=this.findLogicalGroupEnd(a,i.slice(o+1));l.found&&l.logicalGroup!=null&&n.push(l.logicalGroup),o+=l.skipCount}else if(a instanceof ts){if(n.length==0){a.pushError(M.makeSyntaxError(P.TYPE_UNEXPECTED_FACTORIAL_WHILE_CREATING_GROUPS,a,"Unexpected [T_AOP_FACTORIAL] while parsing input text."));continue}let l=n[n.length-1];if(!(l instanceof De)&&!(l instanceof Lt)){a.pushError(M.makeSyntaxError(P.TYPE_UNEXPECTED_FACTORIAL_OPERAND,a,"Unexpected left operand encountered for [T_AOP_FACTORIAL] while parsing input text."));continue}l=n.pop();let u=new De;u.startPosition=l.startPosition,u.endPosition=a.endPosition,u.originalAbstractNode=a,u.nodes.push(l),u.nodes.push(a),n.push(u)}else n.push(a)}return n}makeArgGroup(e){let n=new qo,r=e.length;for(let s=0;s=r){o.pushError(M.makeSyntaxError(P.TYPE_ARG_UNEXPECTED_NAMED_ARGUMENT,o,"Unexpected end of input while parsing named argument."));continue}let l=e[s+2],u=new Bu;u.startPosition=o.startPosition,u.endPosition=l.endPosition,u.content=o.content+l.content,u.name=o,u.value=l,o instanceof oe||o.pushError(M.makeSyntaxError(P.TYPE_INVALID_NAMED_ARG_IDENTIFIER,o,"Invalid type ["+W.getPrettyTypeName(o)+"] supplied for named argument name.")),n.hasNamedArguments=!0,n.numberOfNamedArguments+=1,n.args.push(u),s+3{s instanceof Bu?i=!0:i&&s.pushError(M.makeSyntaxError(P.TYPE_UNEXPECTED_UNNAMED_METHOD_ARGUMENT,s,"Unnamed arguments are not allowed to appear after a named argument."))}),n}cleanVariableForMethodInvocation(e){(e.name.startsWith(":")||e.name.startsWith("."))&&(e.name=e.name.substr(1),e.variableReference!=null&&(e.variableReference.originalContent=e.variableReference.originalContent.substr(1),e.variableReference.normalizedReference=e.variableReference.normalizedReference.substr(1)),e.startPosition!=null&&(e.startPosition.offset+=1,e.startPosition.char+=1))}reduceVariableReferenceForObjectAccessor(e){var s;let n=(s=e.variableReference)==null?void 0:s.pathParts.pop(),r=n.name,i=r.length+1;return e.name=e.name.substr(0,-i),e.variableReference!=null&&(e.variableReference.originalContent=e.variableReference.originalContent.substr(0,-i),e.variableReference.normalizedReference=e.variableReference.normalizedReference.substr(0,-i),e.variableReference.pathParts[e.variableReference.pathParts.length-1].isFinal=!0),e.endPosition!=null&&(e.endPosition.offset-=i,e.endPosition.char-=i),{accessor:r,accessorLen:i}}associateMethodCalls(e){var i,s;let n=[],r=e.length;for(let o=0;o0&&(l=n[n.length-1]),o+10&&(c.nodes[0]instanceof Ot?f=c.nodes[0].nodes:f=c.nodes);let m=new Xt;if(m.startPosition=a.startPosition,l instanceof It){let d=n.pop();m.startPosition=d.startPosition}this.cleanVariableForMethodInvocation(a),m.endPosition=c.endPosition,m.args=this.makeArgGroup(f),m.method=a,l.methodTarget=m,l instanceof oe&&l.mergeRefName.length>0&&(l.name=nt.getUnrefName(l.mergeRefName)),n.push(m),o+=1;continue}else if(a instanceof De&&l instanceof oe&&l.variableReference!=null&&l.variableReference.pathParts.length>=2){let c=[];if(a.nodes.length>0&&(a.nodes[0]instanceof Ot?c=a.nodes[0].nodes:c=a.nodes),l.variableReference.pathParts[0]instanceof Un&&ya.deferredCoreLibraries.includes(l.variableReference.pathParts[0].name)){let _=n.pop(),C=new ns;C.startPosition=_.startPosition,C.endPosition=a.endPosition,C.content=_.content,C.originalAbstractNode=a;let b=((i=_.variableReference)==null?void 0:i.pathParts.shift()).name,g=(s=_.variableReference)==null?void 0:s.implodePaths();C.libraryName=b,C.methodName=g,C.arguments=this.makeArgGroup(c),n.push(C),o+=1;continue}let f=this.reduceVariableReferenceForObjectAccessor(l),m=new Xt;m.startPosition=a.startPosition,m.endPosition=a.endPosition,l.methodTarget=m,l instanceof oe&&l.mergeRefName.length>0&&(l.name=nt.getUnrefName(l.mergeRefName)),a.start!=null&&(a.start.isPartOfMethodChain=!0),a.end!=null&&(a.end.isPartOfMethodChain=!0);let d=new oe;d.name=f.accessor,d.isPartOfMethodChain=!0;let p=this.makeArgGroup(c);if(m.startPosition!=null&&(m.startPosition.offset-=f.accessorLen,m.startPosition.char-=f.accessorLen),m.method=d,m.args=p,G.isNumeric(l.name)){let _=n.pop();n.push(this.convertOperatorToVarNode(_))}n.push(m);continue}else if(a instanceof oe&&l instanceof Xt){if(this.cleanVariableForMethodInvocation(a),o+1>r){a.pushError(M.makeSyntaxError(P.TYPE_METHOD_CALL_MISSING_ARG_GROUP,a,"Unexpected end of input while parsing method call."));continue}let c=e[o+1];if(!(c instanceof De)){a.pushError(M.makeSyntaxError(P.TYPE_INVALID_METHOD_CALL_ARG_GROUP,a,"Unexpected ["+W.getPrettyTypeName(c)+"] while parsing [T_METHOD_CALL]; expecting [T_ARG_GROUP]."));continue}let f=c,m=[];f.nodes.length>0&&(f.nodes[0]instanceof Ot?m=f.nodes[0].nodes:m=f.nodes);let d=new Xt;d.startPosition=a.startPosition,d.endPosition=f.endPosition,d.args=this.makeArgGroup(m),d.method=a,l.methodTarget=d,n.push(d),o+=1;continue}else if(a instanceof It&&l instanceof Xt){if(o+1>r){a.pushError(M.makeSyntaxError(P.TYPE_METHOD_CALL_MISSING_METHOD,a,"Unexpected end of input while parsing method call."));continue}let c=e[o+1];if(o+2>r){a.pushError(M.makeSyntaxError(P.TYPE_METHOD_CALL_MISSING_ARG_GROUP,a,"Unexpected end of input while parsing method call."));continue}let f=e[o+2];if(!(f instanceof De)){a.pushError(M.makeSyntaxError(P.TYPE_INVALID_METHOD_CALL_ARG_GROUP,a,"Unexpected ["+W.getPrettyTypeName(f)+"] while parsing [T_METHOD_CALL]; expecting [T_ARG_GROUP]."));continue}let m=f,d=[];m.nodes.length>0&&(m.nodes[0]instanceof Ot?d=m.nodes[0].nodes:d=m.nodes);let p=new Xt;p.startPosition=a.startPosition,p.endPosition=f.endPosition,p.args=this.makeArgGroup(d),p.method=c,l.methodTarget=p,n.push(p),o+=2;continue}else if(a instanceof Xt){if(o+1>r){a.pushError(M.makeSyntaxError(P.TYPE_METHOD_CALL_MISSING_METHOD,a,"Unexpected end of input while parsing method call."));continue}let c=e[o+1];if(o+2>r){a.pushError(M.makeSyntaxError(P.TYPE_INVALID_METHOD_CALL_ARG_GROUP,a,"Unexpected end of input while parsing method call."));continue}let f=e[o+2];if(!(f instanceof De)){a.pushError(M.makeSyntaxError(P.TYPE_INVALID_METHOD_CALL_ARG_GROUP,a,"Unexpected ["+W.getPrettyTypeName(f)+"] while parsing [T_METHOD_CALL]; expecting [T_ARG_GROUP]."));continue}let m=f,d=[];m.nodes.length>0&&(m.nodes[0]instanceof Ot?d=m.nodes[0].nodes:d=m.nodes);let p=this.makeArgGroup(d);if(l instanceof oe&&ya.deferredCoreLibraries.includes(l.name)){let _=n.pop(),C=new ns;C.startPosition=_.startPosition,C.endPosition=m.endPosition,C.libraryName=_.name,C.methodName=c.name,C.content=C.libraryName+"->"+C.methodName,C.arguments=p,l.libraryTarget=C,n.push(C),o+=2;continue}a.method=c,a.args=p,n.length>0&&(n[n.length-1].methodTarget=a),o+=2,n.push(a);continue}else n.push(a)}return n}convertVariableToStringNode(e){let n=new bt;return n.content=e.name,n.value=e.name,n.originalAbstractNode=e,n.startPosition=e.startPosition,n.endPosition=e.endPosition,n.index=e.index,n}createTupleLists(e){let n=e.length,r=[];for(let i=0;i=n){s.pushError(M.makeSyntaxError(P.TYPE_UNEXPECTED_EOI_PARSING_TUPLE_LIST,s,"Unexpected end of input while parsing tuple list."));continue}let o=e[i+1];if(!(o instanceof De)){o.pushError(M.makeSyntaxError(P.TYPE_UNEXPECTED_TYPE_FOR_TUPLE_LIST,o,"Unexpected ["+W.getPrettyTypeName(o)+"] while parsing tuple list."));continue}let a=o;if(this.markAllNonVirtualAsListGroupMember([a]),this.retriggerNonVirtualGroupMembers.push([a]),a.nodes.length==0){a.pushError(M.makeSyntaxError(P.TYPE_MISSING_BODY_TUPLE_LIST,a,"Missing tuple list body while parsing tuple list."));continue}let u=a.nodes.shift(),c=u.nodes.length,f=[];for(let p=0;p1&&(C=!0),_.name.trim().length==0&&(C=!0)),C||!(_ instanceof oe)){a.pushError(M.makeSyntaxError(P.TYPE_INVALID_TUPLE_LIST_NAME_TYPE,a,"Invalid ["+W.getPrettyTypeName(_)+"] name type found while parsing tuple list."));continue}let h=_;f.push(this.convertVariableToStringNode(h))}}let m=f.length;if(m==0){a.pushError(M.makeSyntaxError(P.TYPE_INVALID_MANIFESTED_NAME_GROUP,a,"Invalid Name expression produced an invalid name group while parsing tuple list."));continue}let d=new Oi;this.createdArrays.push(d),d.startPosition=s.startPosition,d.endPosition=s.endPosition,a.nodes.forEach(p=>{if(!(p instanceof Ot)){p.pushError(M.makeSyntaxError(P.TYPE_INVALID_TUPLE_LIST_VALUE_TYPE_GROUP,p,"Invalid ["+W.getPrettyTypeName(p)+"] name type found while parsing tuple list value expression."));return}let _=p,C=new Oi;this.createdArrays.push(C),C.startPosition=_.startPosition;let h=[];for(let b=0;bh.length);b++){let g=h[b],N=new fl;N.startPosition=g.startPosition,N.endPosition=g.endPosition,N.name=f[b],N.value=g,C.nodes.push(N),d.endPosition=g.endPosition,C.endPosition=g.endPosition}d.nodes.push(C)}),r.push(d),i+=1;continue}else r.push(s)}return e}makeOrderGroup(e){let n=[],r=e.length,i=0;for(let s=0;s0&&(a==null||a instanceof Ct)){i+=1;let l=new ll;l.order=i,l.name=e[s-1],l.directionNode=o,this.isOperand(l.name)==!1&&l.name.pushError(M.makeSyntaxError(P.TYPE_INVALID_ORDER_BY_NAME_VALUE,l.name,"Invalid value or expression supplied for order by name.")),this.isOperand(l.directionNode)==!1&&l.directionNode.pushError(M.makeSyntaxError(P.TYPE_INVALID_ORDER_BY_SORT_VALUE,l.directionNode,"Invalid value or expression supplied for order by direction.")),l.startPosition=l.name.startPosition,l.endPosition=l.directionNode.endPosition,n.push(l),s+=1;continue}}return n}getValues(e){let n=new Fo,r=e.length,i=[];for(let s=0;s=r){s.pushError(M.makeSyntaxError(P.TYPE_UNEXPECTED_EOI_WHILE_PARSING_ARG_GROUP,s,"Unexpected end of input while parsing argument group."));continue}if(!(e[i+1]instanceof De)){s.pushError(M.makeSyntaxError(P.TYPE_EXPECTING_ARGUMENT_GROUP,s,"Unexpected token while parsing method call. Expecting [T_ARG_SEPARATOR] got ["+W.getPrettyTypeName(s)+"]."));continue}let c=e[i+1],f=null;if(c.nodes.length>0){let m=c.nodes[0];f=this.makeArgGroup(m.nodes)}f==null&&(f=new qo,f.startPosition=c.startPosition,f.endPosition=c.endPosition,f.originalAbstractNode=c),u.arguments=f,n.push(u),i+=1;continue}else if(s.content==ht.ARR_ORDERBY){if(i+1>=r){s.pushError(M.makeSyntaxError(P.TYPE_UNEXPECTED_EOI_PARSING_ORDER_GROUP,s,"Unexpected end of input while parsing order group."));continue}let o=e[i+1];if(!(o instanceof De)){o.pushError(M.makeSyntaxError(P.TYPE_EXPECTING_ORDER_GROUP_FOR_ORDER_BY_OPERAND,o,"Unexpected ["+W.getPrettyTypeName(o)+"] while parsing order group."));continue}let l=o.nodes;l[0]instanceof Ot&&(l=l[0].nodes);let u=this.makeOrderGroup(l);u.length==0&&s.pushError(M.makeSyntaxError(P.TYPE_UNEXPECTED_EMPTY_DIRECTION_GROUP,s,"Unexpected empty [T_DIRECTION_GROUP]. Must have at least one order clause, and each property must have a direction specified."));let c=new qs;if(c.orderClauses=u,u.length>0){u[0].directionNode!=null&&(c.startPosition=u[0].directionNode.startPosition);let f=u[u.length-1].directionNode;f!=null&&(c.endPosition=f.endPosition)}n.push(s),n.push(c),i+=1;continue}else if(s.content==ht.ARR_GROUPBY){if(i+1>=r){s.pushError(M.makeSyntaxError(P.TYPE_UNEXPECTED_EOI_WHILE_PARSING_GROUP_BY,s,"Unexpected end of input while parsing group by clause."));continue}let o=e[i+1];if(o instanceof Li||o instanceof dr){o.pushError(M.makeSyntaxError(P.TYPE_GROUP_BY_SCOPED_GROUP_MUST_BE_ENCLOSED,o,"Type ["+W.getPrettyTypeName(o)+"] must be enclosed with parenthesis to be used with groupby."));continue}if(!(o instanceof De)){o.pushError(M.makeSyntaxError(P.TYPE_UNEXPECTED_TOKEN_FOR_GROUP_BY,o,"Unexpected ["+W.getPrettyTypeName(o)+"] while parsing group by."));continue}let l=o.nodes;l[0]instanceof Ot&&(l=l[0].nodes);let u=this.getValues(l);if(n.push(s),n.push(u),i+2=r){s.pushError(M.makeSyntaxError(P.TYPE_UNEXPECTED_EOI_WHILE_PARSING_SWITCH_GROUP,s,"Unexpected end of input while parsing [T_SWITCH_GROUP]."));continue}let o=e[i+1];if(!(o instanceof dr)){o.pushError(M.makeSyntaxError(P.TYPE_UNEXPECTED_TOKEN_FOR_SWITCH_GROUP,o,"Unexpected ["+W.getPrettyTypeName(o)+"] while parsing [T_SWITCH_GROUP]."));continue}let a=o;if(this.markAllNonVirtualAsSwitch([o]),a.scope==null||!(a.scope instanceof De)){a.pushError(M.makeSyntaxError(P.TYPE_UNEXPECTED_SWITCH_START_VALUE,a,"Unexpected input while parsing [T_SWITCH_GROUP]."));continue}let l=a.scope;if(l.nodes.length==0||!(l.nodes[0]instanceof Ot)){a.pushError(M.makeSyntaxError(P.TYPE_UNEXPECTED_SWITCH_START_VALUE_NO_VALUE,a,"Unexpected input while parsing [T_SWITCH_GROUP]."));continue}let u=l.nodes[0];if(this.markAllNonVirtualAsSwitch([l]),u.nodes.length==0||!(u.nodes[0]instanceof De)){s.pushError(M.makeSyntaxError(P.TYPE_UNEXPECTED_SWITCH_START_VALUE_NO_VALUE,s,"Unexpected input while parsing [T_SWITCH_GROUP]."));continue}this.markAllNonVirtualAsSwitch([s]),this.markAllNonVirtualAsSwitch(u.nodes);let c=u.nodes;if(a.nodes.length==0&&s.pushError(M.makeSyntaxError(P.TYPE_UNEXPECTED_SWITCH_START_VALUE_NO_VALUE,s,"Unexpected input while parsing [T_SWITCH_GROUP].")),!(l.nodes[0]instanceof Ot)){s.pushError(M.makeSyntaxError(P.TYPE_UNEXPECTED_SWITCH_START_VALUE_NO_VALUE,s,"Unexpected input while parsing [T_SWITCH_GROUP]."));continue}let m=l.nodes[0];this.markAllNonVirtualAsSwitch(m.nodes);let d=m.nodes,p=new Bs,_=new De;_.nodes=c,_.startPosition=_.nodes[0].startPosition,_.endPosition=_.nodes[_.nodes.length-1].endPosition;let C=new Vo;C.condition=_;let h=new De;h.nodes.push(d.shift()),h.startPosition=h.nodes[0].startPosition,h.endPosition=h.nodes[h.nodes.length-1].endPosition,C.expression=h,C.startPosition=C.condition.startPosition,C.endPosition=C.expression.nodes[C.expression.nodes.length-1].endPosition,d.shift(),p.cases.push(C);let b=d.length;if(b>0){if(!(d[0]instanceof De)){s.pushError(M.makeSyntaxError(P.TYPE_PARSER_INVALID_SWITCH_TOKEN,s,"Invalid ["+W.getPrettyTypeName(d[0])+"] while parsing case statement."));continue}for(let g=0;g=r){s.pushError(M.makeSyntaxError(P.TYPE_ARR_MAKE_MISSING_TARGET,s,"Missing target variable for arr operator."));continue}let o=e[i+1];if(!(o instanceof De)){o.pushError(M.makeSyntaxError(P.TYPE_ARR_MAKE_UNEXPECTED_TYPE,o,"Unexpected ["+W.getPrettyTypeName(o)+"] while parsing array."));continue}let a=o instanceof dr,l=o,u=l.nodes;if(u[0]instanceof Ot&&(u=u[0].nodes),a){let d=o;u.unshift(new In),u.unshift(d.scope)}let c=this.getArrayValues(u),f=new Oi;f.startPosition=s.startPosition;let m=c.values.length;m>0?f.endPosition=c.values[m-1].endPosition:f.endPosition=s.endPosition,l.end!=null&&(f.endPosition=l.end.endPosition),f.nodes=c.values,this.createdArrays.push(f),n.push(f),i+=1}else n.push(s);else n.push(s)}return n}getArrayValues(e){let n=new Fo,r=e.length,i=[];for(let s=0;s=r){a.pushError(M.makeSyntaxError(P.TYPE_ARR_MAKE_MISSING_ARR_KEY_PAIR_VALUE,a,"Missing key/pair value while parsing array."));continue}let l=e[s+2],u=new fl;if(this.isValidArrayKeyNode(o)==!1){o.pushError(M.makeSyntaxError(P.TYPE_ARR_KEY_PAIR_INVALID_KEY_TYPE,o,"Invalid ["+W.getPrettyTypeName(o)+"] type for key/value key."));continue}u.name=o,u.value=l,u.startPosition=o.startPosition,u.endPosition=l.endPosition,i.push(u),s+=3;continue}if(a==null||a instanceof Ct){let l=new fl;l.value=o,l.startPosition=o.startPosition,l.endPosition=o.endPosition,i.push(l),s+=1;continue}}return n.values=i,n}isValidArrayKeyNode(e){return e instanceof Lt||e instanceof bt}associateModifiers(e){let n=[],r=e.length,i=null;for(let s=0;s=r){o.pushError(M.makeSyntaxError(P.TYPE_UNEXPECTED_EOI_WHILE_PARSING_MODIFIER_DETAILS,o,"Unexpected end of input while preparing to gather modifier details."));continue}let l=this.scanToEndOfModifier(e.slice(s+1)),u=l.length;if(u>1&&l[1]instanceof It){this.isRealModifierSeparator.set(l[1],!0);let f=l[0];f instanceof Wn?l[0]=this.wrapArithmeticModifier(f,"add"):f instanceof Tn?l[0]=this.wrapArithmeticModifier(f,"subtract"):f instanceof Hn?l[0]=this.wrapArithmeticModifier(f,"divide"):f instanceof Yn?l[0]=this.wrapArithmeticModifier(f,"multiply"):f instanceof ai&&(l[0]=this.wrapArithmeticModifier(f,"mod"))}if(u==0){o.pushError(M.makeSyntaxError(P.TYPE_UNSET_MODIFIER_DETAILS,o,"Invalid or missing modifier details."));continue}if(!(l[0]instanceof jt)){o.pushError(M.makeSyntaxError(P.TYPE_MODIFIER_NAME_NOT_START_OF_DETAILS,o,"Invalid ["+W.getPrettyTypeName(l[0])+"]; expecting [T_MODIFIER_NAME]"));continue}let c=this.createModifier(l);c.nameNode!=null&&this.modifierNameMapping.set(c.nameNode,c),s+=u,i.modifierChain.modifierChain.push(c),i.modifierChain.updateValues();continue}else n.push(o)}return n}createNullCoalescenceGroups(e){let n=[],r=e.length;for(let i=0;i=r){s.pushError(M.makeSyntaxError(P.TYPE_UNEXPECTED_EOI_WHILE_PARSING_NULL_COALESCENCE_GROUP,s,"Unexpected end of input while parsing input text."));continue}let a=e[i+1],l=new ul;l.left=o,l.right=a,n.push(l),i+=1;continue}else n.push(s)}return n}isOperand(e){return e instanceof oe||e instanceof De||e instanceof bt||e instanceof Lt||e instanceof wr||e instanceof ur||e instanceof Or||e instanceof ns||e instanceof qs||e instanceof Fo||e instanceof Bs||e instanceof Oi}isProperMethodChainTargetStrict(e){return e instanceof De||e instanceof bt||e instanceof Lt||e instanceof wr||e instanceof ur||e instanceof Or||e instanceof ns||e instanceof qs||e instanceof Fo||e instanceof Bs||e instanceof Oi}assertOperandRight(e,n){if(n+1>e.length-1)return e[n].pushError(M.makeSyntaxError(P.TYPE_UNEXPECTED_END_OF_INPUT,e[n],"Unexpected end of input; expecting operand for operator "+W.getPrettyTypeName(e[n])+' near "'+_a.getNearText(e[n])+'".')),!1;let r=e[n+1];return this.isOperand(r)?!0:(r.pushError(M.makeSyntaxError(P.TYPE_EXPECTING_OPERAND,e[n],"Expecting operand, found "+W.getPrettyTypeName(r)+' near "'+_a.getNearText(e[n])+'".')),!1)}resolveValueRight(e,n){let r=null,i=0,s=null;if(e.length>0){let o=!0;for(;o;){let a=e[n];if(a instanceof on){s=a,i+=1,n+=1,o=!1;continue}else if(this.isOperand(a)){r=a,o=!1;break}else{o=!1;break}}}if(i%2!=0){let o=new De;return o.nodes=[],s!=null&&r!=null&&(o.nodes.push(s),o.nodes.push(r)),{value:o,negationCount:i}}return{value:r,negationCount:i}}correctTypes(e){let n=[];return e.forEach(r=>{if(r instanceof Pn){let i=new It;i.startPosition=r.startPosition,i.endPosition=r.endPosition,i.originalAbstractNode=r,n.push(i)}else if(r instanceof Ut){let i=new oe;i.name=r.value,i.startPosition=r.startPosition,i.endPosition=r.endPosition,i.modifierChain=r.modifierChain,i.originalAbstractNode=r,n.push(i)}else n.push(r)}),n}createTernaryGroups(e){var i,s,o,a;let n=[],r=e.length;for(let l=0;l=r){u.pushError(M.makeSyntaxError(P.TYPE_UNEXPECTED_EOI_WHILE_PARSING_TERNARY_GROUP,u,"Unexpected end of input while parsing ternary group."));continue}let p=e.slice(l+1,d);if(p.length>1||p.length==0){u.pushError(M.makeSyntaxError(P.TYPE_TERNARY_UNEXPECTED_EXPRESSION_LENGTH,u,"Unexpected number of operations within ternary truth branch."));continue}let _=p[0],C=((o=c.foundAt)!=null?o:0)+1;if(C>=r){u.pushError(M.makeSyntaxError(P.TYPE_UNEXPECTED_EOI_WHILE_PARSING_TERNARY_GROUP_FALSE_BRANCH,u,"Unexpected end of input while parsing ternary false execution branch."));continue}let h=e[C],b=new cl;b.head=m,b.truthBranch=_,b.falseBranch=h,n.push(b),l=((a=c.foundAt)!=null?a:0)+1;continue}else n.push(u)}return n}groupNodesByType(e,n){let r=[],i=e.length;for(let s=0;s0&&o instanceof n){let a=[],l=r.pop();if(a.push(l),!this.assertOperandRight(e,s))continue;if(s+1>=i){o.pushError(M.makeSyntaxError(P.TYPE_UNEXPECTED_EOI_WHILE_REDUCING_NEGATION_OPERATORS,o,"Unexpected end of input while parsing input text."));continue}let u=e[s+1];typeof u!="undefined"&&(u.isVirtualGroupMember=!0),typeof l!="undefined"&&(l.isVirtualGroupMember=!0),o.isVirtualGroupMember=!0;let c=new De;c.nodes=a,c.nodes.push(o),c.nodes.push(u),s+=1,r.push(c);continue}else r.push(o)}return r}flagNodeAsOperatorResolve(e){if(e instanceof De){if(e.nodes.length==0)return;this.flagNodeAsOperatorResolve(e.nodes[e.nodes.length-1])}e.isVirtualGroupOperatorResolve=!0,e.next instanceof sn||(e.producesVirtualStatementTerminator=!0)}groupNodesByOperatorType(e){let n=[],r=e.length;for(let i=0;i0&&Rt.isOperatorType(s)){let o=[],a=n.pop();if(o.push(a),!this.assertOperandRight(e,i))continue;if(i+1>=r){s.pushError(M.makeSyntaxError(P.TYPE_UNEXPECTED_EOI_WHILE_REDUCING_NEGATION_OPERATORS,s,"Unexpected end of input while parsing input text."));continue}let l=e[i+1];this.flagNodeAsOperatorResolve(l),Rt.isAssignmentOperator(s)&&this.tracedAssignments.push(new od(a,l,s)),typeof a!="undefined"&&(a.isVirtualGroupMember=!0),typeof l!="undefined"&&(l.isVirtualGroupMember=!0),s.isVirtualGroupMember=!0;let u=new De;u.nodes=o,u.nodes.push(s),u.nodes.push(l),i+=1,n.push(u);continue}else n.push(s)}return n}applyOperationOrder(e){return e=this.groupNodesByType(e,oi),e=this.groupNodesByType(e,Yn),e=this.groupNodesByType(e,Hn),e=this.groupNodesByType(e,Wn),e=this.groupNodesByType(e,Tn),e}createLogicGroupsToRemoveMethodInvocationAmbiguity(e){let n=[],r=e.length,i=r-1;for(let s=0;s0&&e[0]instanceof De){let o=this.unpack(e[0].nodes),a=this.makeArgGroup(o),l=new Mo;if(l.nameNode=n,l.methodStyleArguments=a,e.length>1)for(let u=1;u=i)return e[o].pushError(M.makeSyntaxError(P.TYPE_MODIFIER_UNEXPECTED_END_OF_VALUE_LIST,e[o],"Unexpected end of modifier value list while parsing modifier.")),e;let a=e[o+1];if(this.isValidModifierValue(a)){if(a instanceof oe)if(a.variableReference!=null&&a.variableReference.pathParts.length>0)a.variableReference.pathParts.forEach(l=>{if(l instanceof Un){let u=new Ut;u.startPosition=l.startPosition,u.endPosition=l.endPosition,u.value=l.name,u.name=l.name,u.originalAbstractNode=l,u.endPosition==null&&u.startPosition==null&&(u.startPosition=a.startPosition,u.endPosition=a.endPosition),r.push(u)}});else{let l=new Ut;l.startPosition=a.startPosition,l.endPosition=a.endPosition,l.value=a.name,l.name=a.name,l.originalAbstractNode=a,r.push(l)}else r.push(a);o+=1;continue}else return a.pushError(M.makeSyntaxError(P.TYPE_MODIFIER_UNEXPECTED_VALUE,a,"Unexpected ["+W.getPrettyTypeName(a)+"] while parsing modifier value.")),e}let s=new Mo;return s.nameNode=n,s.valueNodes=r,s.startPosition=s.nameNode.startPosition,s.valueNodes.length>0?s.endPosition=s.valueNodes[s.valueNodes.length-1].endPosition:s.endPosition=s.nameNode.endPosition,s}scanToEndOfModifier(e){let n=[],r=e.length;for(let i=0;i1)break}if(s instanceof bt||s instanceof oe||s instanceof Lt){let o=n.length;if(o>0&&n[o-1]instanceof De)break}if(s instanceof vn||s instanceof Bt||s instanceof zt||s instanceof Nn||s instanceof cr||s instanceof Ei||s instanceof Fr||s instanceof Vr||s instanceof qr||s instanceof Br||s instanceof jr||s instanceof Ur||s instanceof fr||s instanceof Hr||s instanceof ui||s instanceof pr||s instanceof ci||s instanceof Gr||s instanceof ns||s instanceof Xt||s instanceof on)break;n.push(s)}return n}static isAssignmentOperatorNode(e){return e instanceof Lr||e instanceof Dr||e instanceof Kn||e instanceof kr||e instanceof Mr||e instanceof Tn}insertAutomaticStatementSeparators(e){let n=e.length,r=[];for(let i=0;i=r){let o=new Ot;o.nodes=i,n.push(o);break}return n}findLogicalGroupEnd(e,n){let r=[],i=n.length,s=null,o=0,a=0;for(a;a=i)return c.pushError(M.makeSyntaxError(P.TYPE_UNEXPECTED_EOI_WHILE_PARSING_LOGIC_GROUP_END,c,"Unexpected end of input while parsing input text.")),{found:!1,logicalGroup:null,skipCount:o};let f=this.findLogicalGroupEnd(c,n.slice(a+1));if(f.found){f.logicalGroup!=null&&r.push(f.logicalGroup),o+=f.skipCount,a+=f.skipCount;continue}else continue}else r.push(c)}if(s==null)return e.pushError(M.makeSyntaxError(P.TYPE_LOGIC_GROUP_NO_END,e,"Unexpected end of input while parsing logic group.")),{found:!1,logicalGroup:null,skipCount:o};let l=new Rt;l.setIsRoot(!1);let u=new De;if(r.length>=2&&r[1]instanceof In){if(u=new dr,u.scopeOperator=r[1],a+2=0&&!Rt.isAssignmentOperator(e[i]);i--){let s=e.pop();r.push(s)}if(r=r.reverse(),r.length>=3){let i=new Rt;return i.setIsRoot(!1),{collectedTokens:this.unpack(i.parse(r)),tokens:e}}return{collectedTokens:r,tokens:e}}seek(e,n){for(let r=n;r=0;s--){let o=n[s];if(G.ctypeSpace(o)&&(i=!0),i&&(G.ctypeAlpha(o)||G.ctypeDigit(o)))return null;if(G.ctypePunct(o))return o}return null}static findLeftNeighboringNextAlphaNumeric(e,n,r=4){n=n.replace(" "," ".repeat(r));let i=!1;for(let s=e-1;s>=0;s--){let o=n[s];if((G.ctypeSpace(o)||G.ctypePunct(o)&&o!=E.Punctuation_Underscore)&&(i=!0),i&&(G.ctypeAlpha(o)||G.ctypeDigit(o)))return s+1}return null}static scanWordAt(e,n,r=4){if(n=n.replace(" "," ".repeat(r)),e<0||e>n.length)return null;let i=[],s=[];for(let o=e-1;o>=0;o--){let a=n[o];if(G.ctypePunct(a)&&a!=E.Punctuation_Underscore||G.ctypeSpace(a))break;i.push(a)}for(let o=e;o{var l,u,c,f;a.isModifierParameter=(u=(l=Me.instance)==null?void 0:l.hasModifier(a.name))!=null?u:!1,a.isModifierParameter&&(e.modifiers.parameterModifiers.push(a),a.modifier=(f=(c=Me.instance)==null?void 0:c.getModifier(a.name))!=null?f:null,e.modifiers.modifierNames.includes(a.name)==!1&&e.modifiers.modifierNames.push(a.name))}),e.modifierChain!=null&&e.modifierChain.modifierChain.length>0){let a=null;e.modifierChain.modifierChain.forEach(l=>{var u,c;l.nameNode!=null&&(l.modifier=(c=(u=Me.instance)==null?void 0:u.getModifier(l.nameNode.content))!=null?c:null,e.modifiers.modifierNames.includes(l.nameNode.content)==!1&&e.modifiers.modifierNames.push(l.nameNode.content),l.modifier!=null&&(a=l.modifier,e.modifierChain!=null&&(e.modifierChain.lastManifestedModifier=l)))}),e.modifierChain.lastModifier=a,e.modifiers.parameterModifiers.length>0&&(e.modifiers.hasMixedModifierStyles=!0)}e.runtimeNodes.length>0&&e.runtimeNodes.forEach(a=>{if(a.modifierChain!=null&&a.modifierChain.modifierChain.length>0){let l=null;a.modifierChain.modifierChain.forEach(u=>{var c,f;u.nameNode!=null&&(u.modifier=(f=(c=Me.instance)==null?void 0:c.getModifier(u.nameNode.content))!=null?f:null,e.modifiers.modifierNames.includes(u.nameNode.content)==!1&&e.modifiers.modifierNames.push(u.nameNode.content),u.modifier!=null&&(l=u.modifier,e.modifierChain!=null&&(e.modifierChain.lastManifestedModifier=u)))}),e.modifierChain!=null&&(e.modifierChain.lastModifier=l),e.modifiers.parameterModifiers.length>0&&(e.modifiers.hasMixedModifierStyles=!0)}});let n=e.modifiers.getLastManifestedModifier();if(n!=null)if(n.name=="macro"){let a=e.modifiers.getLastManifestedModifierValue();e.manifestType=(i=(r=Me.instance)==null?void 0:r.getMacroManifestingType(a))!=null?i:""}else e.manifestType=(o=(s=Me.instance)==null?void 0:s.getProbableReturnType(n,e.isPaired()))!=null?o:""}};var zN={warnUnknownParameters:!1};var tm=class{static validateInteger(e){return parseInt(e).toString()!==e?{isValid:!1,message:'"'+e+'" is not a valid integer.'}:{isValid:!0,message:""}}static validateBoolean(e){return e=="true"||e=="false"?{isValid:!0,message:""}:{isValid:!1,message:'"'+e+'" is not a valid value. Expecting true/false.'}}static validateParameters(e){var n,r,i,s,o;if(e.isTagNode&&((n=Ie.instance)==null?void 0:n.isKnownTag(e.runtimeName()))){let a=(r=Ie.instance)==null?void 0:r.findTag(e.runtimeName());if(e.hasParameters)for(let l=0;l1&&(d=". Try one of the following: "+_.join(", "))}let p='Unknown parameter name: "'+m+'"'+d;e.pushError(M.makeSyntaxError(P.LINT_UNKNOWN_PARAMETER,e,p,1))}}else if(c.validate!=null){let d=c.validate(e,u);d.length>0&&d.forEach(p=>{e.pushError(M.makeSyntaxError(P.LINT_GENERAL_INVALID_PARAMETER_CONTENTS,u,p.message,1))})}else{if(u.hasInterpolations())continue;for(let d=0;de.index)return i}return null}getContentSubstring(e,n){return this.content.substr(e,n)}resetState(){return this.fragments=[],this.inputLen=0,this.fragmentStartIndex=[],this.fragmentOpeningIndex.clear(),this}resetIntermediateState(){this.chars=[],this.charLen=0,this.currentIndex=0,this.seedOffset=0,this.cur=null,this.next=null,this.prev=null}positionFromOffset(e,n,r=!1){let i=0,s=0;if(this.documentOffsets.has(e)){let a=this.documentOffsets.get(e);i=a.line,s=a.char}else if(this.documentOffsets.size==0)i=1,s=e+1;else{let a=null,l=null,u=null,c=null;for(let f of this.documentOffsets.keys()){if(f>=e){c!=null&&e>c?(a=u,l=c):(a=this.documentOffsets.get(f),l=f);break}u=this.documentOffsets.get(f),c=f}a==null&&(a=u,l=c),a!=null?(s=e-(l!=null?l:0),i=a.line,e<=(l!=null?l:0)?(i=a.line,s=e+1):i=a.line+1):this.lastDocumentOffsetKey!=null&&(i=this.documentOffsets.get(this.lastDocumentOffsetKey).line+1,s=e+this.lastDocumentOffsetKey)}let o=new qt;return o.index=n,o.offset=e,o.line=i+this.shiftLine,o.char=s,o}getFragments(){return this.fragments}getFragmentsBetween(e,n){let r=[];return this.fragments.forEach(i=>{var a,l,u,c;let s=(l=(a=i.startPosition)==null?void 0:a.index)!=null?l:0,o=(c=(u=i.endPosition)==null?void 0:u.index)!=null?c:0;s>e&&oe.index)return a}return null}checkCurrentOffsets(){if(this.currentIndex>this.chars.length){this.cur=null,this.prev=null,this.next=null;return}if(this.cur=this.chars[this.currentIndex],this.prev=null,this.next=null,this.currentIndex>0&&(this.prev=this.chars[this.currentIndex-1]),this.currentIndex+1{this.chars.push(r),this.charLen+=1})}e&&this.currentIndex+1{var o;let s=(o=i.index)!=null?o:0;for(let a=0;a=l.start&&s<=l.end)return}r.push(s)}),this.fragmentStartIndex=r}setIndexRanges(e){return this.nodeIndex=e,this}fetchAt(e,n){return this.content.substr(e,n)}getFragmentsContainingStructures(){let e=[];return this.fragments.forEach(n=>{let r=n.name.toLowerCase();if(!(r!="script"&&r!="style")&&!n.isClosingFragment&&!n.isSelfClosing&&n.containsStructures){let i=this.getClosingFragmentAfter(n);i!=null&&e.push({start:n,end:i})}}),e}parse(e){if(this.resetState().processInputText(e),this.fragmentStartIndex.length==0)return[];for(let s=0;s{let o=s.name.toLowerCase();(o=="script"||o=="style")&&(s.embeddedIndex=i,this.embeddedIndexedFragments.set(i,s),i+=1),s.index=r,this.indexedFragments.set(r,s),r+=1}),this.fragments}getFragment(e){return this.indexedFragments.get(e)}getEmbeddedFragment(e){return this.embeddedIndexedFragments.has(e)?this.embeddedIndexedFragments.get(e):null}hasFragments(){return this.fragments.length>0}skipToEndOfPhp(){for(this.currentIndex;this.currentIndex0&&this.cur==E.Punctuation_LessThan||this.next==null&&this.cur!=E.Punctuation_GreaterThan)break;if(!i&&this.cur==E.Punctuation_LessThan&&this.next==E.Punctuation_ForwardSlash&&(s=!0),!i&&this.cur!=E.Punctuation_LessThan&&this.cur!=E.Punctuation_ForwardSlash&&this.cur!=E.Punctuation_GreaterThan&&r.push(this.cur),nm(this.cur)){let o=this.currentIndex;rm(this);let a=new Zp;a.startPosition=this.positionFromOffset(o+this.seedOffset,o+this.seedOffset),a.endPosition=this.positionFromOffset(this.currentIndex+this.seedOffset,this.currentIndex+this.seedOffset),n.push(a);continue}if(this.cur==E.Punctuation_ForwardSlash&&this.next==E.Punctuation_GreaterThan){let o=new qu;o.startPosition=this.positionFromOffset(e+this.seedOffset,e+this.seedOffset),o.endPosition=this.positionFromOffset(this.currentIndex+this.seedOffset+1,this.currentIndex+this.seedOffset+1),o.parameters=n,o.isSelfClosing=!0,o.name=r.join(""),o.isClosingFragment=s,this.fragments.push(o),s?this.fragmentOpeningIndex.set(o.startPosition.index+1,1):this.fragmentOpeningIndex.set(o.startPosition.index,1);break}if(this.cur==E.Punctuation_GreaterThan){let o=new qu;o.startPosition=this.positionFromOffset(e+this.seedOffset,e+this.seedOffset),o.endPosition=this.positionFromOffset(this.currentIndex+this.seedOffset,this.currentIndex+this.seedOffset),o.parameters=n,o.name=r.join(""),o.isClosingFragment=s,this.fragments.push(o),s?this.fragmentOpeningIndex.set(o.startPosition.index+1,1):this.fragmentOpeningIndex.set(o.startPosition.index,1),o.name.toLowerCase()=="script"&&o.isClosingFragment==!1&&(this.isScript=!0);break}}}};var sm=class{constructor(e,n){this.documentParser=e,this.fragmentsParser=n}doesContainFragments(e){var i,s,o,a,l;let n=(s=(i=e.endPosition)==null?void 0:i.index)!=null?s:0,r=(l=(a=(o=e.isClosedBy)==null?void 0:o.startPosition)==null?void 0:a.index)!=null?l:0;return this.fragmentsParser.getFragmentsBetween(n,r).length>0}analyze(){let e=this.documentParser.getNodes();!this.fragmentsParser.hasFragments()||(this.fragmentsParser.getFragments().forEach(n=>{let r=n.name.toLowerCase();if(n.isClosingFragment==!1&&n.isSelfClosing==!1&&(r=="script"||r=="style")){let i=this.fragmentsParser.getClosingFragmentAfter(n);if(i==null)return;n.endPosition!=null&&i.startPosition!=null&&this.documentParser.getNodesBetween(n.endPosition,i.startPosition).forEach(o=>{(o instanceof vt||o instanceof B&&o.isClosedBy!=null)&&(n.containsStructures=!0),r=="style"?o.isInStyleTag=!0:o.isInScriptTag=!0})}}),e.forEach(n=>{var o,a,l,u,c,f;if(n instanceof Qe||n.startPosition==null)return;n instanceof B&&($t.isConditionalStructure(n)||!n.isClosingTag)&&n.isClosedBy!=null&&(n.containsAnyFragments=this.doesContainFragments(n));let r=this.fragmentsParser.getFragmentContaining(n.startPosition);if(r==null)return;if(n.fragment=r,n.startPosition.index-((a=(o=r.startPosition)==null?void 0:o.index)!=null?a:0)<=3){n.fragmentPosition=0;return}if(r.parameters.length==0){n.fragmentPosition=2;return}let s=!1;for(let m=0;mn.startPosition.index){n.fragmentPosition=1,s=!0;break}}s||(n.fragmentPosition=2)}))}};var om=class{static analyze(e){e.forEach(n=>{var r,i,s,o;if(n instanceof B){if(n.prev instanceof B&&n.isPaired()&&n.prev.isInlineAntlers==!0){n.isInlineAntlers=!1,n.isClosedBy!=null&&(n.isClosedBy.isInlineAntlers=!1);return}let a=!1,l=!1;if(n.next==null)a=!0;else if(n.next instanceof Qe){let u=G.getFirstLine(n.next.content);(n.next.next==null&&u.trim().length==0||G.trimLeft(u," ").startsWith(` +{{ /if }}`,"https://statamic.dev/tags/installed")};var gO={tagName:"relate",hideFromCompletions:!0,allowsArbitraryParameters:!1,allowsContentClose:!1,injectParentScope:!1,requiresClose:!0,introducedIn:null,parameters:[]},MN=gO;var pa=[{name:"bag",description:"The error message bag to retrieve errors from.",aliases:[],acceptsVariableInterpolation:!1,allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1}];var _O={tagName:"get_errors",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,parameters:pa,introducedIn:"3.2.23",augmentScope:(t,e)=>{var n;if(t.isClosingTag)return e;if(((n=t.name)==null?void 0:n.methodPart)==null){let r=e.copy();r.addVariable({dataType:"string",introducedBy:t,name:"field",sourceName:"*internal.tag.get_errors",sourceField:{blueprintName:"*internal.tag.get_errors",displayName:"get_errors",import:null,instructionText:null,maxItems:null,name:"field",refFieldSetField:null,sets:null,type:"string"}});let i=r.copy();i.addVariable({dataType:"string",introducedBy:t,name:"message",sourceName:"*internal.tag.get_errors",sourceField:{blueprintName:"*internal.tag.get_errors",displayName:"get_errors",import:null,instructionText:null,maxItems:null,name:"message",refFieldSetField:null,sets:null,type:"string"}}),r.addScopeList("messages",i),e.addScopeList("fields",r)}else{let r=e.copy();r.addVariable({dataType:"string",introducedBy:t,name:"message",sourceName:"*internal.tag.get_errors",sourceField:{blueprintName:"*internal.tag.get_errors",displayName:"get_errors",import:null,instructionText:null,maxItems:null,name:"message",refFieldSetField:null,sets:null,type:"string"}}),e.addScopeList("messages",r)}return e},resolveDocumentation:t=>k("get_errors Tag","The `get_errors` tag can be used to retrieve form validation errors.","https://statamic.dev/tags/get_errors")},FN=_O;var yO={tagName:"get_errors:all",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,parameters:pa,introducedIn:null,augmentScope:(t,e)=>{if(t.isClosingTag)return e;let n=e.copy();return n.addVariable({dataType:"string",introducedBy:t,name:"message",sourceName:"*internal.tag.get_errors.all",sourceField:{blueprintName:"*internal.tag.get_errors.all",displayName:"get_errors:all",import:null,instructionText:null,maxItems:null,name:"message",refFieldSetField:null,sets:null,type:"string"}}),e.addScopeList("messages",n),e},resolveDocumentation:t=>k("get_errors:all Tag","The `get_errors:all` tag can be used to retrieve all form validation errors.","https://statamic.dev/tags/get_errors#list-all-validation-errors")},VN=yO;var bO={tagName:"get_error",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,parameters:pa,introducedIn:null,augmentScope:(t,e)=>(t.isClosingTag||e.addVariable({dataType:"string",introducedBy:t,name:"message",sourceName:"*internal.tag.get_error",sourceField:{blueprintName:"*internal.tag.get_error",displayName:"get_error",import:null,instructionText:null,maxItems:null,name:"message",refFieldSetField:null,sets:null,type:"string"}}),e),resolveDocumentation:t=>k("get_error Tag","The `get_error` tag can be used to retrieve the first error message for a specific field.","https://statamic.dev/tags/get_errors#get-the-first-error-for-a-specific-field")},qN=bO;var TO={tagName:"set",hideFromCompletions:!0,allowsArbitraryParameters:!0,requiresClose:!1,allowsContentClose:!1,injectParentScope:!1,introducedIn:null,parameters:[]},BN=TO;var jN=Q(nn());var NO={tagName:"mount_url",hideFromCompletions:!1,allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,introducedIn:"3.3.15",parameters:[{isRequired:!1,acceptsVariableInterpolation:!0,aliases:[],allowsVariableReference:!0,description:"The collection handle",name:"handle",isDynamic:!1,expectsTypes:["string"]}],resolveDocumentation:t=>k("mount Tag","The `mount` tag can be used to retrieve the mount URL for a given collection.",null),resovleParameterCompletionItems:(t,e)=>{var n,r,i,s;return t.name=="handle"&&((n=e.context)==null?void 0:n.parameterContext)!=null?te(Wo((s=(i=(r=e.context)==null?void 0:r.parameterContext.parameter)==null?void 0:i.getArrayValue())!=null?s:[],e.project)):null},resolveCompletionItems:t=>{let e=[];if(t.isPastTagPart==!1&&(t.leftWord=="mount_url"||t.leftWord=="/mount_url")&&t.leftChar==":"){let n=t.project.getCollectionNames();for(let r=0;rRe("vite Tag","Generates Vite tags for an entrypoint.",'{{ vite src="entry/point" }}',null)},GN=vO;var PO={tagName:"nocache",requiresClose:!0,allowsArbitraryParameters:!1,allowsContentClose:!1,hideFromCompletions:!1,injectParentScope:!1,parameters:[],introducedIn:null,resolveDocumentation:t=>Re("nocache Tag","The `nocache` tag is used to mark regions of a template. These regions will continue to update even when using caching strategies such as the full or half-measure cache.",`{{ nocache }} + +{{ /nocache }}`,"https://statamic.dev/tags/nocache")},WN=PO;var HN=[oN,aN,lN,ON,LN,AT,wT,Jb,ec,Gs,tc,Zu,Ju,MN,RN,Oc,kc,Mc,Dc,Fc,Lc,BN,FN,qN,VN,xN,jd,sT,nc,rc,tT,YT,eT,XT,zT,Zb,OT,DT,FT,Nc,nT,rT,iT,VT,qT,oT,ic,jT,Pc,UT,UN,PN,qd,wc,lT,aT,Ic,HT,sa,oa,KT,kN,xc,aa,ea,Cc,ta,na,la,Gd,_l,gl,yl,Ec,Cd,Rd,Ad,xd,Ed,wd,Od,Ld,EN,Id,Pd,Sd,wN,WN,fT,pT,dT,IT,ST,QT,NT,bT,sN,PT,cN,fc,cc,uc,lc,Rc,ac,RT,bN,ZT,vd,eN,tN,nN,rN,iN,gc,CT,yd,JT,gT,pc,$T,GN];var ds=class{constructor(){this.tags=new Map;this.parameters=new Map}reset(){this.tags.clear(),this.parameters.clear(),this.loadCoreTags()}getVisibleTagsWithDocumentation(){let e=[];return this.tags.forEach((n,r)=>{if(n.hideFromCompletions==!1){let i="";n.resolveDocumentation!=null&&(i=n.resolveDocumentation()),e.push({label:r,documentation:i})}}),e}getVisibleTagNames(){let e=[];return this.tags.forEach((n,r)=>{n.hideFromCompletions==!1&&e.push(r)}),[...new Set(e)]}getPossibleTagMethods(e){let n=[],r=e.length+1;return this.tags.forEach((i,s)=>{if(s.startsWith(e)){let o=s.substr(r).trim();o.length>0&&n.push(o)}}),[...new Set(n)]}getTagNames(){let e=[];return this.tags.forEach((n,r)=>{e.push(r)}),[...new Set(e)]}loadCoreTags(){this.registerTags(HN)}cleanTagName(e){return ar(e,"/")}findTag(e){return this.tags.get(this.resolveTagName(e))}isKnownTag(e){return this.tags.has(this.resolveTagName(e))}isSymbolKnownTag(e){return this.isKnownTag(e.runtimeName())}resolveTagName(e){return e=this.cleanTagName(e.trim()),this.tags.has(e)||e.includes(":")&&(e=e.split(":")[0]),e}canResolveSpecialTypes(e){e=this.resolveTagName(e);let n=this.tags.get(e);return!(typeof n=="undefined"||n==null||n.resolveSpecialType==null)}resolveSpecialType(e,n,r){e=this.resolveTagName(e);let i=this.findTag(e);if(i.resolveSpecialType==null)throw new Error(e+" does not support special types.");return i.resolveSpecialType(n,r)}getCompletionItems(e){var s;let n=null,r=[],i=!0;if(e.nodesInScope.length>0&&(n=e.nodesInScope[e.nodesInScope.length-1]),e.currentNode!=null&&this.isKnownTag(e.currentNode.runtimeName())){let o=this.findTag(e.currentNode.runtimeName());if(typeof o=="undefined")return{isExclusive:!1,items:[]};let a=[];if(o.resolveCompletionItems!=null){let l=o.resolveCompletionItems(e);if(l.isExclusiveResult)return{isExclusive:!0,items:l.items};i=l.analyzeDefaults,r=r.concat(l.items)}if(e.isPastTagPart==!1){let l=this.getPossibleTagMethods(o.tagName);for(let u=0;u0&&(r=r.concat(ld(e,o.parameters)),o.tagName=="partial"&&(n==null?void 0:n.hasMethodPart()))){let l=n.getMethodNameValue();if(l.trim().length>0&&((s=ce.instance)==null?void 0:s.hasStructure())){let u=ce.instance.getStructure().findPartial(l);u!=null&&u.injectsParameters.length>0&&(r=r.concat(ld(e,u.injectsParameters)))}}for(let l=0;l0){let n=this.parameters.get(e.tagName);for(let r=0;r{e.push(r)}),e}getVariableNames(){let e=[];return this.values.forEach(n=>{e.push(n.name)}),e}getList(e){return this.lists.has(e)?this.lists.get(e):this.parentScope!=null&&this.parentScope!=this?this.parentScope.getList(e):null}hasValue(e){return this.values.has(e)}findAncestorWithList(e){return this.hasList(e)?this:this.parentScope!=null&&this.parentScope!=this?this.parentScope.findAncestorWithList(e):null}findReferenceNotIntroducedBy(e,n){if(this.hasValue(e)){let r=this.values.get(e);if(r.introducedBy!=null&&r.introducedBy!=n)return r}return this.parentScope!=null&&this.parentScope!=this?this.parentScope.findReferenceNotIntroducedBy(e,n):null}removeThroughIntroduction(e,n){if(this.values.delete(e),this.parentScope!=null){let r=this.findReferenceNotIntroducedBy(e,n);r!=null&&this.addVariable(r)}}wasIntroducedBySymbol(e,n){if(this.values.has(e)==!1)return!1;let r=this.values.get(e);return r.introducedBy!=null?r.introducedBy==n:!1}referencesArray(e){return this.values.has(e)==!1?!1:this.values.get(e).dataType=="array"}addScopeList(e,n){return this.lists.set(e,n),this}mergeAndList(e,n){let r=new mr(this.statamicProject);return r.values=pN(n),this.lists.set(e,r),this.mergeVariableScope(n),this}mergeScope(e){return e==this||e==null?this:(typeof e.values!="undefined"&&e.values!==null&&e.values.forEach((n,r)=>{this.values.set(r,n)}),typeof e.lists!="undefined"&&e.lists!==null&&e.lists.forEach((n,r)=>{this.lists.set(r,n)}),this)}mergeVariableScope(e){for(let n=0;n0&&this.addBlueprintFields(e,r)}copy(){let e=new mr(this.statamicProject);return e.pristine=new Map(this.pristine),e.values=new Map(this.values),e.lists=new Map(this.lists),e.parentScope=this,e}},Qn=mr;Qn.generationCounter=0;function Wd(t){let e=new Qn(t);return e.addVariable({dataType:"string",name:"handle",sourceField:null,sourceName:"*internal.system",introducedBy:null}),e.addVariable({dataType:"string",name:"name",sourceField:null,sourceName:"*internal.system",introducedBy:null}),e.addVariable({dataType:"string",name:"locale",sourceField:null,sourceName:"*internal.system",introducedBy:null}),e.addVariable({dataType:"string",name:"short_locale",sourceField:null,sourceName:"*internal.system",introducedBy:null}),e.addVariable({dataType:"string",name:"url",sourceField:null,sourceName:"*internal.system",introducedBy:null}),e}function KN(){let t=[];return t.push({dataType:"number",name:"response_code",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"csrf_field",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"csrf_token",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"environment",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"template",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"xml_header",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"last_segment",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"homepage",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"current_uri",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"current_url",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"amp_url",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"api_url",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"current_full_url",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"current_template",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"boolean",name:"logged_in",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"boolean",name:"logged_out",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"boolean",name:"is_homepage",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"date",name:"now",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"date",name:"today",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"date",name:"current_date",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"array",name:"get",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"array",name:"get_post",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"array",name:"post",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"array",name:"old",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t}function $N(t,e){let n=t.findParameter("paginate");if(n!=null&&(n.value.toLowerCase()=="true"||parseInt(n.value).toString()==n.value)){let r=e.makeNew(),i=e.makeNew(),s=e.makeNew(),o=e.makeNew();r.addVariable({name:"next_page",dataType:"string",sourceName:"*internal.pagination",sourceField:null,introducedBy:t}),r.addVariable({name:"prev_page",dataType:"string",sourceName:"*internal.pagination",sourceField:null,introducedBy:t}),r.addVariable({name:"total_items",dataType:"integer",sourceName:"*internal.pagination",sourceField:null,introducedBy:t}),r.addVariable({name:"total_pages",dataType:"integer",sourceName:"*internal.pagination",sourceField:null,introducedBy:t}),r.addVariable({name:"current_page",dataType:"integer",sourceName:"*internal.pagination",sourceField:null,introducedBy:t}),r.addVariable({name:"auto_links",dataType:"string",sourceName:"*internal.pagination",sourceField:null,introducedBy:t}),s.addVariable({name:"url",dataType:"string",sourceField:null,sourceName:"*internal.pagination.all",introducedBy:t}),s.addVariable({name:"page",dataType:"integer",sourceField:null,sourceName:"*internal.pagination.all",introducedBy:t}),o.addVariable({name:"first",dataType:"boolean",sourceName:"*internal.pagination.segments",sourceField:null,introducedBy:t}),o.addVariable({name:"last",dataType:"boolean",sourceName:"*internal.pagination.segments",sourceField:null,introducedBy:t}),o.addVariable({name:"slider",dataType:"boolean",sourceName:"*internal.pagination.segments",sourceField:null,introducedBy:t}),i.addScopeList("all",s),i.addScopeList("segments",o),r.addScopeList("links",i),e.addScopeList("paginate",r)}}var Xs=class{constructor(){this.fileInjections=new Map;this.project=null}updateProject(e){this.project=e}registerInjections(e,n){if(n.length==0)return;let r=[];for(let i=0;i0){let i=r[0].getMethodNameValue();if(i!=null&&this.project!=null){let s=this.project.findPartial(i);s!=null&&(this.fileInjections.has(s.documentUri)||this.fileInjections.set(s.documentUri,new Map),this.fileInjections.get(s.documentUri).set(e,r))}}}hasAvailableInjections(e){return this.fileInjections.has(e)}getScopeInjection(e,n){let r=new Qn(n);return r.name="*injection*",this.fileInjections.get(e).forEach((s,o)=>{for(let a=0;a{r.addBlueprintField(null,g)}),n.addScopeList("current_user",r),((c=Er.instance)==null?void 0:c.pageScopeDisabled(this.documentUri))?this.viewDataVars!=null&&n.addScopeList("view",this.viewDataVars):this.viewDataVars!=null?n.mergeAndList("page",this.pageVars).addScopeList("view",this.viewDataVars):n.mergeAndList("page",this.pageVars);let i=null;e.length>0&&e[0].isComment&&(i=il(this.documentUri,e[0]));for(let g=0;g0&&(s=s.concat(i.collectionInjections)),i.blueprints.length>0&&(s=s.concat(i.blueprints)),i.variableHelper!=null&&i.variableHelper.variableName=="@page")){let g=this.statamicProject.getBlueprintField(i.variableHelper.collectionName,i.variableHelper.fieldHandle);if(g!=null)if(i.variableHelper.setHandle.length>0){if(g.sets!=null){for(let N=0;N0){for(let g=0;g0&&a.includes(N.id())&&(o.pop(),u.pop(),u.length==0&&u.push(n));let S=u[u.length-1];if(N.hasParameters){for(let O=0;O0)for(let $=0;${Y instanceof B&&(Y.currentScope=S)})}}if(((p=Ie.instance)==null?void 0:p.isKnownTag(N.getTagName()))==!1){if(N.scopeVariable=S.findReference(N.runtimeName()),g>0){let O=e[g-1];if(O.isComment&&this.ideHelperMap.has(O.id())&&!O.isClosingTag&&!N.isClosingTag){let $=this.ideHelperMap.get(O.id());if($.variableName==N.getTagName()){let X=this.statamicProject.getBlueprintField($.collectionName,$.fieldHandle);X!=null&&(N.scopeVariable=fN(N,X))}}}if(N.scopeVariable==null){let O=N.runtimeName().trim();if(S.hasList(O)||((d=N.currentScope)==null?void 0:d.hasListInHistory(O))){N.sourceType="array";let $=S.getList(O);if($!=null&&$.values.size>0){let X=$.values.entries().next().value[1];N.scopeVariable={dataType:"array",introducedBy:X.introducedBy,name:O,sourceField:null,sourceName:X.sourceName}}}}else N.sourceType=Vu(N.scopeVariable.dataType),N.scopeVariable.sourceField!=null&&((_=$o.instance)==null?void 0:_.hasFieldtype(N.scopeVariable.sourceField.type))&&((C=$o.instance)==null?void 0:C.getFieldType(N.scopeVariable.sourceField.type)).augmentScope(N,S)}if(N.hasParameters&&$N(N,S),N.modifiers!=null&&N.modifiers.hasModifiers()?N.manifestType=N.modifiers.getLastManifestedModifierRuntimeType():N.manifestType=N.sourceType,N.isClosedBy!=null&&(o.push(N.id()),a.push(N.isClosedBy.id()),S=S.copy(),u.push(S)),N.getTagName()=="scope"&&N.hasMethodPart()){let O=u[u.length-2].copy();S.addScopeList(N.getMethodNameValue(),O)}if(S.containsPath(N.runtimeName())&&(o.push(N.id()),N.isClosedBy!=null&&a.push(N.isClosedBy.id()),S=S.copy().bringListIntoMainScope(N.runtimeName()),u.push(S)),N.currentScope=S,N.getTagName()!="cache"){let O=N.findParameter("scope");O!=null&&S.canShiftScope(N.runtimeName())&&(S=S.shiftScope(N,N.runtimeName(),O.value),N.currentScope=S,u.pop(),u.push(S))}if((h=Ie.instance)==null?void 0:h.isKnownTag(N.runtimeName())){let O=(b=Ie.instance)==null?void 0:b.findTag(N.runtimeName());typeof O!="undefined"&&O.augmentScope!=null&&O.augmentScope(N,S)}if(N.modifierChain!=null&&N.modifierChain.modifierChain.length>0&&N.modifierChain.modifierChain.forEach(O=>{O.modifier!=null&&typeof O.modifier.augmentScope!="undefined"&&O.modifier.augmentScope!=null&&O.modifier.augmentScope(N,S)}),N.modifiers.hasParameterModifiers()&&N.modifiers.parameterModifiers.forEach(O=>{O.modifier!=null&&typeof O.modifier.augmentScope!="undefined"&&O.modifier.augmentScope!=null&&O.modifier.augmentScope(N,S)}),N.sourceType=="array"){let O=N.findParameter("chunk"),$=!0;if(N.parent!=null&&N.parent instanceof B&&IO.includes(N.parent.runtimeName())&&($=!1),typeof O!="undefined"&&O!==null)if(N.currentScope.parentScope!=null&&(N.currentScope.parentScope.hasList(N.runtimeName())||S.referencesArray(N.runtimeName()))){let X=N.currentScope.parentScope.copy(),ee=X.liftList(N.runtimeName());if(ee==null&&S.referencesArray(N.runtimeName())){if(ee=new Qn(S.statamicProject),$){let Y=ze(N);for(let ne=0;ne0&&N.runtimeNodes.forEach(O=>{var $;if(O instanceof oe&&(($=N.currentScope)==null?void 0:$.hasValue(O.name))){let X=N.currentScope.findReferenceWithField(O.name);O.currentScope=N.currentScope,O.scopeName=N.scopeName,O.scopeVariable=X}}),SO.includes(N.runtimeName())&&N.runtimeNodes.length==3&&N.runtimeNodes[0]instanceof oe&&N.runtimeNodes[1]instanceof Nn&&N.runtimeNodes[2]instanceof bt&&N.runtimeNodes[0].scopeVariable!=null&&N.runtimeNodes[0].scopeVariable.sourceField!=null){let O=N.runtimeNodes[0].scopeVariable,$=N.runtimeNodes[2].value,X=O.sourceField;if(X.sets!=null)for(let ee=0;ee0}getMethodName(){return this.methodPart==""?"index":this.methodPart=="null"?"":this.methodPart}getRuntimeMethodName(){}getCompoundTagName(){if(this.cachedCompoundTagName==null){let e=this.getMethodName();this.cachedCompoundTagName=this.name,e!=null&&e!=""&&(this.cachedCompoundTagName=this.cachedCompoundTagName+":"+e)}return this.cachedCompoundTagName}};var Yd=class{constructor(){this.tagNames=[];this.modifierNames=[]}getModifierNames(){var e,n;return this.modifierNames.concat((n=(e=we.instance)==null?void 0:e.getModifierNames())!=null?n:[])}getTagNames(){var e,n;return this.tagNames.concat((n=(e=Ie.instance)==null?void 0:e.getTagNames())!=null?n:[])}setTagNames(e){this.tagNames=e}setModifierNames(e){this.modifierNames=e}isTag(e){var n;return Yd.alwaysLikeTag.includes(e)||((n=Ie.instance)==null?void 0:n.isKnownTag(e))?!0:this.tagNames.includes(e)}isModifier(e){var n;return((n=we.instance)==null?void 0:n.hasModifier(e))?!0:this.modifierNames.includes(e)}},da=Yd;da.alwaysLikeTag=["if","endif","elseif","else","unless","elseunless"];var ha=class{static analyze(e,n){e.forEach(r=>{if(r instanceof B){if(r.pathReference!=null&&r.pathReference.isStrictVariableReference){r.isTagNode=!1;return}r.name!=null&&(r.isTagNode=n.isTag(r.name.name))}})}static analyzeNode(e){if(e.pathReference!=null&&e.pathReference.isStrictVariableReference){e.isTagNode=!1;return}ha.environmentDetails!=null&&e.name!=null&&(e.isTagNode=ha.environmentDetails.isTag(e.name.name)),e.name!=null&&(e.isConditionNode=da.alwaysLikeTag.includes(e.name.name))}static analyzeParametersForModifiers(e){e.parameters.forEach(n=>{ha.environmentDetails!=null&&(n.isModifierParameter=ha.environmentDetails.isModifier(n.name))})}},ma=ha;ma.environmentDetails=null;(typeof ma.environmentDetails=="undefined"||ma.environmentDetails==null)&&(ma.environmentDetails=new da);var Kd=ma;var $d=class{static getIdentifier(e){var i;let n=new Ln;n.content=e.trim();let r=e.split(":");if(r.length==1)n.name=r[0].trim(),n.methodPart=null,n.compound=n.name;else if(r.length>1){let s=(i=r.shift())!=null?i:"",o=r.join(":");n.name=s.trim(),n.methodPart=o.trim(),n.compound=n.name+":"+n.methodPart}else n.name=e.trim(),n.methodPart="";return n.name.startsWith("/")&&(n.name=n.name.substr(1),n.compound=n.compound.substr(1)),n}};var re=class{static getPrettyTypeName(e){return e instanceof Wr?re.TOKEN_LANG_OPERATOR:e instanceof Wn?re.TOKEN_OP_A_ADD:e instanceof oe?re.TOKEN_VARIABLE:e instanceof bt?re.TOKEN_STRING:e instanceof Lt?re.TOKEN_NUMBER:e instanceof Or?re.TOKEN_CONSTANT_FALSE:e instanceof ur?re.TOKEN_CONSTANT_NULL:e instanceof Lr?re.TOKEN_CONSTANT_TRUE:e instanceof Mo?re.TOKEN_MODIFIER_NODE:e instanceof al?re.TOKEN_MODIFIER_CHAIN:e instanceof rd?re.TOKEN_MODIFIER_PARAMETER:e instanceof Hn?re.TOKEN_OP_A_DIVIDE:e instanceof oi?re.TOKEN_OP_A_EXPONENTIATION:e instanceof ai?re.TOKEN_OP_A_MODULUS:e instanceof Yn?re.TOKEN_OP_A_MULTIPLY:e instanceof Tn?re.TOKEN_OP_A_SUBTRACT:e instanceof Dr?re.TOKEN_ASG_ADD:e instanceof kr?re.TOKEN_ASG_DIVIDE:e instanceof Mr?re.TOKEN_ASG_MODULUS:e instanceof Fr?re.TOKEN_ASG_MULTIPLY:e instanceof Kn?re.TOKEN_ASG_ASSIGN:e instanceof li?re.TOKEN_ASG_SUBTRACT:e instanceof Nn?re.TOKEN_CMP_EQUAL:e instanceof Gr?re.TOKEN_CMP_SEQUAL:e instanceof cr?re.TOKEN_CMP_GT:e instanceof Ei?re.TOKEN_CMP_GTE:e instanceof Vr?re.TOKEN_CMP_LT:e instanceof qr?re.TOKEN_CMP_LTE:e instanceof Br?re.TOKEN_CMP_NEQ:e instanceof jr?re.TOKEN_CMP_SNEQ:e instanceof Ur?re.TOKEN_CMP_SPACESHIP:e instanceof wi?re.TOKEN_OP_VARIABLE_FALLBACK:e instanceof id?re.TOKEN_COND_FALLBACK_GROUP:e instanceof It?re.TOKEN_BRANCH_SEPARATOR:e instanceof Hr?re.TOKEN_TERNARY_SEPARATOR:e instanceof zt?re.TOKEN_GROUP_BEGIN:e instanceof Bt?re.TOKEN_GROUP_END:e instanceof vn?re.TOKEN_MODIFIER_SEPARATOR:e instanceof jt?re.TOKEN_MODIFIER_NAME:e instanceof Ut?re.TOKEN_MODIFIER_VALUE:e instanceof Pn?re.TOKEN_MODIFIER_VALUE_SEPARATOR:e instanceof ul?re.TOKEN_NULL_COALESCE_GROUP:e instanceof Ot?re.TOKEN_SEMANTIC_GROUP:e instanceof sn?re.TOKEN_STATEMENT_SEPARATOR:e instanceof cl?re.TOKEN_TERNARY_CONDITION:e instanceof fr?re.TOKEN_OP_AND:e instanceof on?re.TOKEN_OP_LOGIC_NEGATION:e instanceof Yr?re.TOKEN_OP_OR:e instanceof ui?re.TOKEN_OP_XOR:e instanceof pr?re.TOKEN_OP_NULL_COALESCE:e instanceof Vs?re.TOKEN_PARAM:e instanceof Un?re.TOKEN_PATH_ACCESSOR:e instanceof ts?re.TOKEN_OP_A_FACTORIAL:e instanceof lr?re.TOKEN_RECURSIVE:e instanceof qo?re.TOKEN_ARG_GROUP:e instanceof Ct?re.TOKEN_ARG_SEPARATOR:e instanceof ci?re.TOKEN_OP_STRING_CONCAT:e instanceof In?re.TOKEN_OP_SCOPE_REASSIGNMENT:e instanceof Vo?re.TOKEN_STRUCT_SWITCH_CASE:e instanceof Bs?re.TOKEN_STRUCT_SWITCH_GROUP:e instanceof qs?re.TOKEN_STRUCT_DIRECTION_GROUP:e instanceof dr?re.TOKEN_STRUCT_SCOPED_LOGIC_GROUP:e instanceof ke?re.TOKEN_STRUCT_LOGIC_GROUP:e instanceof ll?re.TOKEN_STRUCT_VALUE_DIRECTION:e instanceof Oi?re.TOKEN_STRUCT_ARRAY:e instanceof Kr?re.TOKEN_STRUCT_T_LIST_START:e instanceof sd?re.TOKEN_STRUCT_TUPLE_LIST:e instanceof Xt?re.TOKEN_STRUCT_METHOD_CALL:typeof e}},W=re;W.TOKEN_LANG_OPERATOR="T_LANG_OPERATOR",W.TOKEN_VARIABLE="T_VAR",W.TOKEN_NUMBER="T_NUMERIC",W.TOKEN_STRING="T_STRING",W.TOKEN_RECURSIVE="T_RECURSIVE",W.TOKEN_CONSTANT_FALSE="T_FALSE",W.TOKEN_CONSTANT_NULL="T_NULL",W.TOKEN_CONSTANT_TRUE="T_TRUE",W.TOKEN_MODIFIER_NODE="T_MODIFIER",W.TOKEN_MODIFIER_CHAIN="T_MODIFIER_CHAIN",W.TOKEN_MODIFIER_PARAMETER="T_MODIFIER_PARAM",W.TOKEN_OP_A_ADD="T_AOP_ADD",W.TOKEN_OP_A_DIVIDE="T_AOP_DIVIDE",W.TOKEN_OP_A_EXPONENTIATION="T_AOP_EXP",W.TOKEN_OP_A_MODULUS="T_AOP_MOD",W.TOKEN_OP_A_MULTIPLY="T_AOP_MULTIPLY",W.TOKEN_OP_A_SUBTRACT="T_AOP_SUBTRACT",W.TOKEN_OP_A_FACTORIAL="T_AOP_FACTORIAL",W.TOKEN_ASG_ADD="T_ASG_ADD",W.TOKEN_ASG_DIVIDE="T_ASG_DIVIDE",W.TOKEN_ASG_ASSIGN="T_ASG",W.TOKEN_ASG_MODULUS="T_ASG_MODULUS",W.TOKEN_ASG_MULTIPLY="T_ASG_MULTIPLY",W.TOKEN_ASG_SUBTRACT="T_ASG_SUBTRACT",W.TOKEN_CMP_EQUAL="T_CMP_EQ",W.TOKEN_CMP_SEQUAL="T_CMP_SEQ",W.TOKEN_CMP_GT="T_CMP_GT",W.TOKEN_CMP_GTE="T_CMP_GTE",W.TOKEN_CMP_LT="T_CMP_LT",W.TOKEN_CMP_LTE="T_CMP_LTE",W.TOKEN_CMP_NEQ="T_CMP_NEQ",W.TOKEN_CMP_SNEQ="T_CMP_SNEQ",W.TOKEN_CMP_SPACESHIP="T_CMP_SPSHP",W.TOKEN_OP_VARIABLE_FALLBACK="T_VFBK",W.TOKEN_COND_FALLBACK_GROUP="T_VFBK_GROUP",W.TOKEN_BRANCH_SEPARATOR="T_BRANCH_SEPARATOR",W.TOKEN_TERNARY_SEPARATOR="T_TERNARY_SEPARATOR",W.TOKEN_GROUP_BEGIN="T_LOGIC_BEGIN",W.TOKEN_GROUP_END="T_LOGIC_END",W.TOKEN_MODIFIER_SEPARATOR="T_MODIFIER_SEPARATOR",W.TOKEN_MODIFIER_NAME="T_MODIFIER_NAME",W.TOKEN_MODIFIER_VALUE="T_MODIFIER_VALUE",W.TOKEN_MODIFIER_VALUE_SEPARATOR="T_MODIFIER_VALUE_SEPARATOR",W.TOKEN_NULL_COALESCE_GROUP="T_NULL_COALESCE_GROUP",W.TOKEN_SEMANTIC_GROUP="T_SEMANTIC_GROUP",W.TOKEN_STATEMENT_SEPARATOR="T_STATEMENT_SEPARATOR",W.TOKEN_TERNARY_CONDITION="T_TERNARY_CONDITION",W.TOKEN_OP_AND="T_AND",W.TOKEN_OP_LOGIC_NEGATION="T_LOGIC_INVERSE",W.TOKEN_OP_OR="T_OR",W.TOKEN_OP_XOR="T_XOR",W.TOKEN_OP_NULL_COALESCE="T_NULL_COALESCE",W.TOKEN_PARAM="T_PARAM",W.TOKEN_PATH_ACCESSOR="T_VAR_SEPARATOR",W.TOKEN_ARG_GROUP="T_ARG_GROUP",W.TOKEN_ARG_SEPARATOR="T_ARG_SEPARATOR",W.TOKEN_OP_STRING_CONCAT="T_STR_CONCAT",W.TOKEN_OP_SCOPE_REASSIGNMENT="T_SCOPE_ASSIGNMENT",W.TOKEN_STRUCT_SWITCH_CASE="T_SWITCH_CASE",W.TOKEN_STRUCT_SWITCH_GROUP="T_SWITCH_GROUP",W.TOKEN_STRUCT_DIRECTION_GROUP="T_DIRECTION_GROUP",W.TOKEN_STRUCT_VALUE_DIRECTION="T_ORDER_DIRECTION",W.TOKEN_STRUCT_SCOPED_LOGIC_GROUP="T_SCOPED_LOGIC_GROUP",W.TOKEN_STRUCT_LOGIC_GROUP="T_LOGIC_GROUP",W.TOKEN_STRUCT_ARRAY="T_ARRAY",W.TOKEN_STRUCT_T_LIST_START="T_LIST_START",W.TOKEN_STRUCT_TUPLE_LIST="T_LIST",W.TOKEN_STRUCT_METHOD_CALL="T_METHOD_CALL";var Xe=class{static isLanguageLogicalKeyword(e){return e==this.LogicalAnd||e==this.LogicalNot||e==this.LogicalOr||e==this.LogicalXor}};Xe.LogicalAnd="and",Xe.LogicalNot="not",Xe.LogicalOr="or",Xe.LogicalXor="xor",Xe.ConstTrue="true",Xe.ConstFalse="false",Xe.ConstNull="null",Xe.ArrList="list",Xe.ScopeAs="as";var zd=class{constructor(){this.chars=[];this.inputLen=0;this.currentIndex=0;this.currentContent=[];this.rawContent=[];this.startIndex=0;this.cur=null;this.next=null;this.prev=null;this.isParsingString=!1;this.isParsingModifierName=!1;this.isInModifierParameterValue=!1;this.runtimeNodes=[];this.ignorePrevious=!1;this.lastNode=null;this.referenceParser=null;this.activeNode=null}reset(){this.ignorePrevious=!1,this.runtimeNodes=[],this.chars=[],this.inputLen=0,this.currentIndex=0,this.currentContent=[],this.rawContent=[],this.startIndex=0,this.cur=null,this.next=null,this.prev=null,this.isParsingString=!1,this.isParsingModifierName=!1,this.isInModifierParameterValue=!1,this.referenceParser=null,this.activeNode=null}checkCurrentOffsets(){this.cur=this.chars[this.currentIndex],this.prev=null,this.next=null,this.ignorePrevious?(this.prev="",this.ignorePrevious=!1):this.currentIndex>0&&(this.prev=this.chars[this.currentIndex-1]),this.currentIndex+10)||G.ctypeAlpha(this.cur)||G.ctypeDigit(this.cur))?!0:G.ctypeSpace(e)?!1:this.isParsingModifierName&&(e==E.Punctuation_Minus||e==E.Punctuation_Underscore)?!0:!G.ctypePunct(e)}isRightOfInterpolationRegion(){if(this.activeNode==null||this.referenceParser==null)return!1;let e=this.activeNode._lexerRelativeOffset(this.currentIndex);return this.referenceParser.bordersInterpolationRegion(e)}scanForwardTo(e,n=0){let r=[];for(let i=this.currentIndex+1+n;i0&&Xe.isLanguageLogicalKeyword(l)&&(a=!0)}if(this.next==E.String_Terminator_SingleQuote||this.next==E.String_Terminator_DoubleQuote||this.next==null||a){this.appendContent(this.cur);let l=this.currentContent.join("");if(l.length>0){let u=l;if(this.currentContent=[],this.rawContent=[],u.trimRight().length==0){let f=this.nextNonWhitespace();if(f==E.String_Terminator_SingleQuote||f==E.String_Terminator_DoubleQuote){this.currentContent=[],this.rawContent=[];continue}}let c=new Ut;c.isVirtual=!1,c.name=u,c.value=u.trimRight(),c.startPosition=e._lexerRelativeOffset(this.currentIndex-u.length),c.endPosition=e._lexerRelativeOffset(this.currentIndex),c.parent=this.activeNode,this.guardAgainstNeighboringTypesInModifier(c),this.runtimeNodes.push(c),this.lastNode=c}if(l.length==0)continue;this.currentContent=[],this.rawContent=[],this.isInModifierParameterValue=!1;continue}if(this.next==E.Punctuation_Pipe||this.next==E.Punctuation_Colon||this.next==E.RightParent){this.isInModifierParameterValue=!1,this.appendContent(this.cur);let l=0,u=!1;if(this.currentContent[0]==E.String_Terminator_SingleQuote||this.currentContent[0]==E.String_Terminator_DoubleQuote){let m=this.scanForwardTo(this.currentContent[0]);m.length>0&&(this.currentContent=this.currentContent.concat(m),l=m.length,u=!0)}let c=this.currentContent.join("");u&&(c=c.substr(1),c=c.slice(0,-1)),this.currentContent=[],this.rawContent=[];let f=new Ut;f.isVirtual=!1,f.name=c,f.value=c,f.startPosition=e._lexerRelativeOffset(this.currentIndex-c.length),f.endPosition=e._lexerRelativeOffset(this.currentIndex),f.parent=this.activeNode,this.runtimeNodes.push(f),this.guardAgainstNeighboringTypesInModifier(f),this.lastNode=f,this.currentIndex+=l}else this.appendContent(this.cur);continue}if(this.isParsingString&&this.cur==i){if(this.prev==E.String_EscapeCharacter)this.appendContent(i);else{if(this.isInModifierParameterValue){let l=this.currentContent.join(""),u=new Ut;u.isVirtual=!1,u.name=l,u.value=l,u.startPosition=e._lexerRelativeOffset(r!=null?r:0),u.endPosition=e._lexerRelativeOffset(this.currentIndex),u.parent=this.activeNode,this.runtimeNodes.push(u),this.guardAgainstNeighboringTypesInModifier(u),this.lastNode=u,this.currentContent=[],this.rawContent=[],this.isParsingString=!1,this.isInModifierParameterValue=!1;continue}let a=new bt;a.isVirtual=!1,a.startPosition=e._lexerRelativeOffset(r!=null?r:0),a.endPosition=e._lexerRelativeOffset(this.currentIndex),this.referenceParser!=null&&(a.sourceContent=this.referenceParser.getText(a.startPosition.index,a.endPosition.index+1)),a.parent=this.activeNode,i!=null&&(a.sourceTerminator=i),i=null,this.isParsingString=!1,a.value=this.currentContent.join(""),a.rawLexContent=this.rawContent.join("").trim(),this.currentContent=[],this.rawContent=[],this.guardAgainstNeighboringTypesInModifier(a),this.runtimeNodes.push(a),this.lastNode=a}continue}if(this.isParsingString&&this.cur==E.String_EscapeCharacter){if(this.next==E.String_EscapeCharacter){this.appendContent(E.String_EscapeCharacter),this.ignorePrevious=!0,this.currentIndex+=1;continue}else if(this.next==E.String_Terminator_SingleQuote){this.appendContent(E.String_Terminator_SingleQuote),this.currentIndex+=1;continue}else if(this.next==E.String_Terminator_DoubleQuote){this.appendContent(E.String_Terminator_DoubleQuote),this.currentIndex+=1;continue}else if(this.next=="n"){this.appendContent(` +`),this.currentIndex+=1;continue}else if(this.next=="t"){this.appendContent(" "),this.currentIndex+=1;continue}else if(this.next=="r"){this.appendContent("\r"),this.currentIndex+=1;continue}}if(this.isParsingString==!1){if(this.isValidChar(this.cur)&&this.isValidChar(this.next)==!1&&this.currentContent.length==0&&(this.appendContent(this.cur),o=!1),(this.next==null||this.isValidChar(this.next)==!1)&&this.currentContent.length>0){o&&this.appendContent(this.cur);let a=this.currentContent.join("").trim(),l=a.length,u=this.currentIndex-l,c=e._lexerRelativeOffset(u),f=e._lexerRelativeOffset(this.currentIndex);if(this.currentContent=[],this.rawContent=[],a==Xe.LogicalAnd){let p=new fr;p.isVirtual=!1,p.content=Xe.LogicalAnd,p.startPosition=c,p.endPosition=f,p.parent=this.activeNode,this.runtimeNodes.push(p),this.lastNode=p;continue}else if(a==Xe.LogicalOr){let p=new Yr;p.isVirtual=!1,p.content=Xe.LogicalOr,p.startPosition=c,p.endPosition=f,p.parent=this.activeNode,this.runtimeNodes.push(p),this.lastNode=p;continue}else if(a==Xe.LogicalXor){let p=new ui;p.isVirtual=!1,p.content=Xe.LogicalXor,p.startPosition=c,p.endPosition=f,p.parent=this.activeNode,this.runtimeNodes.push(p),this.lastNode=p;continue}else if(a==Xe.ConstNull){let p=new ur;p.isVirtual=!1,p.content=Xe.ConstNull,p.startPosition=c,p.endPosition=f,p.parent=this.activeNode,this.runtimeNodes.push(p),this.lastNode=p;continue}else if(a==Xe.ConstTrue){let p=new Lr;p.isVirtual=!1,p.content=Xe.ConstTrue,p.startPosition=c,p.endPosition=f,p.parent=this.activeNode,this.runtimeNodes.push(p),this.lastNode=p;continue}else if(a==Xe.ConstFalse){let p=new Or;p.isVirtual=!1,p.content=Xe.ConstFalse,p.startPosition=c,p.endPosition=f,p.parent=this.activeNode,this.runtimeNodes.push(p),this.lastNode=p;continue}else if(a==Xe.LogicalNot){let p=new on;p.isVirtual=!1,p.content=Xe.LogicalNot,p.startPosition=c,p.endPosition=f,p.parent=this.activeNode,this.runtimeNodes.push(p),this.lastNode=p;continue}else if(a==Xe.ArrList&&this.next==E.LeftParen){let p=new Kr;p.isVirtual=!1,p.content=Xe.ArrList,p.startPosition=c,p.endPosition=f,p.parent=this.activeNode,this.runtimeNodes.push(p),this.lastNode=p;continue}if(G.isNumeric(a)){let p=new Lt;p.isVirtual=!1,p.startPosition=c,p.endPosition=f,p.parent=this.activeNode,a.includes(".")?p.value=parseFloat(a):p.value=parseInt(a),p.rawLexContent=a,this.guardAgainstNeighboringTypesInModifier(p),this.runtimeNodes.push(p),this.lastNode=p;continue}if(this.runtimeNodes.length>0){let p=this.runtimeNodes[this.runtimeNodes.length-1];if(p instanceof vn){let d=new jt;d.isVirtual=!1,d.name=a,d.content=a,d.startPosition=c,d.endPosition=f,d.parent=this.activeNode,this.runtimeNodes.push(d),this.lastNode=d;continue}else if(p instanceof Pn){let d=new Ut;d.isVirtual=!1,d.name=a,d.value=a,d.startPosition=c,d.endPosition=f,d.parent=this.activeNode,this.runtimeNodes.push(d),this.lastNode=d,this.isParsingModifierName=!1;continue}}let m=new oe;m.isVirtual=!1,m.name=a,m.startPosition=c,m.endPosition=f,m.parent=this.activeNode,this.runtimeNodes.push(m),this.lastNode=m;continue}}else{this.appendContent(this.cur);continue}if(!G.ctypeSpace(this.cur)){if(this.isParsingString==!1){if(this.cur==E.Punctuation_Equals&&this.next==E.Punctuation_GreaterThan){let a=new In;a.isVirtual=!1,a.content="=>",a.startPosition=e._lexerRelativeOffset(this.currentIndex),a.endPosition=e._lexerRelativeOffset(this.currentIndex+1),a.parent=this.activeNode,this.runtimeNodes.push(a),this.lastNode=a,this.currentContent=[],this.rawContent=[],this.currentIndex+=1;continue}if(this.cur==E.Punctuation_Comma){let a=new Ct;a.isVirtual=!1,a.content=E.Punctuation_Comma,a.startPosition=e._lexerRelativeOffset(this.currentIndex),a.endPosition=e._lexerRelativeOffset(this.currentIndex+1),a.parent=this.activeNode,this.runtimeNodes.push(a),this.lastNode=a;continue}if(this.cur==E.Punctuation_Semicolon){let a=new sn;a.isVirtual=!1,a.content=E.Punctuation_Semicolon,a.startPosition=e._lexerRelativeOffset(this.currentIndex),a.endPosition=e._lexerRelativeOffset(this.currentIndex+1),a.parent=this.activeNode,this.runtimeNodes.push(a),this.lastNode=a;continue}if(this.cur==E.Punctuation_Plus){if(this.next==E.Punctuation_Equals){let l=new Dr;l.isVirtual=!1,l.content="+=",l.startPosition=e._lexerRelativeOffset(this.currentIndex),l.endPosition=e._lexerRelativeOffset(this.currentIndex+2),l.parent=this.activeNode,this.runtimeNodes.push(l),this.lastNode=l,this.currentIndex+=1;continue}let a=new Wn;a.isVirtual=!1,a.content="+",a.startPosition=e._lexerRelativeOffset(this.currentIndex),a.endPosition=e._lexerRelativeOffset(this.currentIndex+1),a.parent=this.activeNode,this.runtimeNodes.push(a),this.lastNode=a;continue}if(this.isParsingModifierName==!1&&this.cur==E.Punctuation_Minus){if(G.ctypeDigit(this.next)&&G.ctypeDigit(this.prev)==!1&&this.prev!=E.RightParent&&this.isRightOfInterpolationRegion()==!1){this.appendContent(this.cur);continue}if(this.next==E.Punctuation_Equals){let l=new li;l.isVirtual=!1,l.content="-=",l.startPosition=e._lexerRelativeOffset(this.currentIndex),l.endPosition=e._lexerRelativeOffset(this.currentIndex+2),l.parent=this.activeNode,this.runtimeNodes.push(l),this.lastNode=l,this.currentIndex+=1;continue}else if(this.next==E.Punctuation_GreaterThan){let l=new Xt;l.isVirtual=!1,l.content="->",l.startPosition=e._lexerRelativeOffset(this.currentIndex),l.endPosition=e._lexerRelativeOffset(this.currentIndex+2),l.parent=this.activeNode,this.runtimeNodes.push(l),this.lastNode=l,this.currentIndex+=1;continue}let a=new Tn;a.isVirtual=!1,a.content="-",a.startPosition=e._lexerRelativeOffset(this.currentIndex),a.endPosition=e._lexerRelativeOffset(this.currentIndex+1),a.parent=this.activeNode,this.runtimeNodes.push(a),this.lastNode=a;continue}if(this.cur==E.Punctuation_Asterisk){if(this.next==E.Punctuation_Asterisk){let l=new oi;l.isVirtual=!1,l.content="**",l.startPosition=e._lexerRelativeOffset(this.currentIndex),l.endPosition=e._lexerRelativeOffset(this.currentIndex+2),l.parent=this.activeNode,this.runtimeNodes.push(l),this.lastNode=l,this.currentIndex+=1;continue}else if(this.next==E.Punctuation_Equals){let l=new Fr;l.isVirtual=!1,l.content="*=",l.startPosition=e._lexerRelativeOffset(this.currentIndex),l.endPosition=e._lexerRelativeOffset(this.currentIndex+2),l.parent=this.activeNode,this.runtimeNodes.push(l),this.lastNode=l,this.currentIndex+=1;continue}let a=new Yn;a.isVirtual=!1,a.content="*",a.startPosition=e._lexerRelativeOffset(this.currentIndex),a.endPosition=e._lexerRelativeOffset(this.currentIndex+1),a.parent=this.activeNode,this.runtimeNodes.push(a),this.lastNode=a;continue}if(this.cur==E.Punctuation_ForwardSlash){if(this.next==E.Punctuation_Equals){let l=new kr;l.isVirtual=!1,l.content="/=",l.startPosition=e._lexerRelativeOffset(this.currentIndex),l.endPosition=e._lexerRelativeOffset(this.currentIndex+2),l.parent=this.activeNode,this.runtimeNodes.push(l),this.lastNode=l,this.currentIndex+=1;continue}let a=new Hn;a.isVirtual=!1,a.content="/",a.startPosition=e._lexerRelativeOffset(this.currentIndex),a.endPosition=e._lexerRelativeOffset(this.currentIndex+1),a.parent=this.activeNode,this.runtimeNodes.push(a),this.lastNode=a;continue}if(this.cur==E.Punctuation_Percent){if(this.next==E.Punctuation_Equals){let l=new Mr;l.isVirtual=!1,l.content="%=",l.startPosition=e._lexerRelativeOffset(this.currentIndex),l.endPosition=e._lexerRelativeOffset(this.currentIndex+2),l.parent=this.activeNode,this.runtimeNodes.push(l),this.lastNode=l,this.currentIndex+=1;continue}let a=new ai;a.isVirtual=!1,a.content="%",a.startPosition=e._lexerRelativeOffset(this.currentIndex),a.endPosition=e._lexerRelativeOffset(this.currentIndex+1),a.parent=this.activeNode,this.runtimeNodes.push(a),this.lastNode=a;continue}if(this.cur==E.Punctuation_LessThan){if(this.next==E.Punctuation_Equals){let l=null;if(this.currentIndex+2",c.startPosition=e._lexerRelativeOffset(this.currentIndex),c.endPosition=e._lexerRelativeOffset(this.currentIndex+3),c.parent=this.activeNode,this.runtimeNodes.push(c),this.lastNode=c,this.currentIndex+=2;continue}let u=new qr;u.isVirtual=!1,u.content="<=",u.startPosition=e._lexerRelativeOffset(this.currentIndex),u.endPosition=e._lexerRelativeOffset(this.currentIndex+2),u.parent=this.activeNode,this.runtimeNodes.push(u),this.lastNode=u,this.currentIndex+=1;continue}let a=new Vr;a.isVirtual=!1,a.content="<",a.startPosition=e._lexerRelativeOffset(this.currentIndex),a.endPosition=e._lexerRelativeOffset(this.currentIndex+1),a.parent=this.activeNode,this.runtimeNodes.push(a),this.lastNode=a;continue}if(this.cur==E.Punctuation_GreaterThan){if(this.next==E.Punctuation_Equals){let l=new cr;l.isVirtual=!1,l.content=">=",l.startPosition=e._lexerRelativeOffset(this.currentIndex),l.endPosition=e._lexerRelativeOffset(this.currentIndex+2),l.parent=this.activeNode,this.runtimeNodes.push(l),this.lastNode=l,this.currentIndex+=1;continue}let a=new cr;a.isVirtual=!1,a.content=">",a.startPosition=e._lexerRelativeOffset(this.currentIndex),a.endPosition=e._lexerRelativeOffset(this.currentIndex+1),a.parent=this.activeNode,this.runtimeNodes.push(a),this.lastNode=a;continue}if(this.cur==E.Punctuation_Equals&&this.next!=E.Punctuation_Equals){let a=new Kn;a.isVirtual=!1,a.content="=",a.startPosition=e._lexerRelativeOffset(this.currentIndex),a.endPosition=e._lexerRelativeOffset(this.currentIndex+1),a.parent=this.activeNode,this.runtimeNodes.push(a),this.lastNode=a;continue}if(this.cur==E.Punctuation_Equals&&this.next==E.Punctuation_Equals){let a=null;if(this.currentIndex+20&&this.runtimeNodes[this.runtimeNodes.length-1]instanceof jt){let u=new Pn;u.isVirtual=!1,u.content=":",u.startPosition=e._lexerRelativeOffset(this.currentIndex),u.endPosition=e._lexerRelativeOffset(this.currentIndex+1),u.parent=this.activeNode,this.runtimeNodes.push(u),this.isInModifierParameterValue==!1?this.isInModifierParameterValue=!0:this.isInModifierParameterValue=!1;continue}let a=new It;a.isVirtual=!1,a.content=":",a.startPosition=e._lexerRelativeOffset(this.currentIndex),a.endPosition=e._lexerRelativeOffset(this.currentIndex+1),a.parent=this.activeNode,this.runtimeNodes.push(a),this.lastNode=a,this.isParsingModifierName=!1;continue}}o&&this.appendContent(this.cur)}}let s=this.runtimeNodes.length-1;for(let o=0;o0&&(a=this.runtimeNodes[o-1]),o!=s&&(l=this.runtimeNodes[o+1]);let u=this.runtimeNodes[o];u.prev=a,u.next=l}return this.runtimeNodes}};var kt=class{constructor(){this.chars=[];this.currentIndex=0;this.lastIndex=0;this.inputLength=0;this.prev=null;this.cur=null;this.next=null;this.isParsingString=!1;this.isStringKeyPath=!1;this.antlersErrors=[];this._recusriveEntryCheck=new Map}isValidChar(e){return!(this.isParsingString==!1&&G.ctypeSpace(e)||this.isParsingString==!1&&e==kt.LeftBracket||this.isParsingString==!1&&e==kt.RightBracket)}normalizePath(e){return e=e.replace(":","_"),e=e.replace(".","_"),e=e.replace("[","_"),e=e.replace("]","_"),e.replace("]","_")}getAntlersErrors(){return this.antlersErrors}mergeErrors(e){e.forEach(n=>{this.antlersErrors.push(n)})}parse(e){this.antlersErrors=[],this._recusriveEntryCheck.clear();let n=e,r=!1,i=!1,s=!1,o=!1;e.startsWith(E.AtChar)&&(s=!0,e=e.substr(1)),e.startsWith(E.Punctuation_Caret)?(o=!0,e=e.substr(1)):(e.startsWith(E.Punctuation_Dollar)&&(r=!0,e=e.substr(1)),e.startsWith(E.Punctuation_Dollar)&&(i=!0,e=e.substr(1))),this.chars=[],this.currentIndex=0,this.lastIndex=0,this.inputLength=0,this.cur=null,this.prev=null,this.next=null,this.chars=e.split(""),this.inputLength=this.chars.length,this.lastIndex=this.inputLength-1;let a=[],l=!1,u=[],c=kt.ColonSeparator,f=!1,m=null,p=!1,d=!0;if(this.isParsingString=!1,this.inputLength==0){let h=new rs;return h._isFromEmptyFailState=!0,h}for(this.currentIndex;this.currentIndex0&&(this.prev=this.chars[this.currentIndex-1]),this.currentIndex+10){let g=new Un;g.name=a.join(""),g.delimiter=c,u.push(g),a=[]}if(this.next==null||G.ctypeSpace(this.next)){this.antlersErrors.push(M.makeSyntaxError(v.TYPE_ILLEGAL_VARPATH_SPACE_RIGHT,null,"Unexpected end of input or whitespace while parsing variable accessor path."));continue}let h=this.locateEndOfAccessor();this.currentIndex=h.foundOn;let b=new kt;if(u.push(b.parse(h.nestedContent)),this.mergeErrors(b.getAntlersErrors()),l=!0,this.currentIndex==-1){this.antlersErrors.push(M.makeSyntaxError(v.PARSER_CANNOT_PARSE_PATH_RECURSIVE,null,"Cannot parse variable path.")),l=!1;break}continue}if(this.isParsingString==!1&&this.next==kt.RightBracket&&l){d?a.push(this.cur):d=!0;let h=new od;h.name=a.join(""),u.push(h),a=[],c=kt.ColonSeparator,this.currentIndex+=1,l=!1;continue}if(this.isParsingString==!1&&(this.cur==kt.LeftBracket||this.cur==kt.ColonSeparator||this.cur==kt.DotPathSeparator||this.currentIndex==this.lastIndex)){if(this.next==null||G.ctypeSpace(this.next)){if(this.cur==kt.ColonSeparator){if(a.length==0){this.antlersErrors.push(M.makeSyntaxError(v.TYPE_UNEXPECTED_BRANCH_SEPARATOR,null,"Unexpected [T_BRANCH_SEPARATOR] while parsing input text."));continue}this.antlersErrors.push(M.makeSyntaxError(v.TYPE_ILLEGAL_VARPATH_RIGHT,null,'Variable paths cannot end with the ":" character.'));continue}if(this.cur==kt.LeftBracket){this.antlersErrors.push(M.makeSyntaxError(v.TYPE_ILLEGAL_VARPATH_SUBPATH_START,null,"Illegal variable sub-path start."));continue}}this.currentIndex==this.lastIndex&&this.isValidChar(this.cur)&&(d?a.push(this.cur):d=!0);let h=new Un;h.delimiter=c,h.name=a.join(""),p&&(h.isStringVar=p,h.name=n.substr(1),h.name=h.name.slice(0,-1),p=!1),u.push(h),a=[];continue}else{a.push(this.cur);continue}}let _=u.length;if(_>0){let h=u[_-1];(h instanceof Un||h instanceof rs)&&(h.isFinal=!0)}let C=new rs;return C.isStrictTagReference=o,C.isStrictVariableReference=r,C.isExplicitVariableReference=i,C.pathParts=u,C.originalContent=e,C.isVariableVariable=s,C.normalizedReference=e.replace(":","."),C}locateEndOfAccessor(){let e=[],n=1,r=-1,i="",s=!1,o=null;if(this._recusriveEntryCheck.has(this.currentIndex+1)==!1)this._recusriveEntryCheck.set(this.currentIndex+1,!0);else return{foundOn:r,nestedContent:""};for(let a=this.currentIndex+1;a0&&(c=this.chars[a-1]),a+10&&(this.prev=this.chars[this.currentIndex-1]),r==!1){if(s==!1&&(this.cur==E.String_Terminator_DoubleQuote||this.cur==E.String_Terminator_SingleQuote)){o=this.cur,s=!0,n.push(this.cur);continue}if(s&&G.ctypeSpace(this.cur)){n.push(this.cur);continue}if(s&&this.cur==o&&this.prev!=E.String_EscapeCharacter){o=null,s=!1,n.push(this.cur);continue}if(G.ctypeSpace(this.cur)||this.currentIndex==this.inputLen-1||this.cur==E.Punctuation_Pipe){if(n.length==0)continue;G.ctypeSpace(this.cur)||this.cur!=E.Punctuation_Pipe&&n.push(this.cur),i=n.join(""),r=!0;break}n.push(this.cur)}let a=e.getContentRelativeStartIndex();if(e.nameStartsOn=e.relativeOffset(a,a),e.nameStartsOn!=null&&(e.nameEndsOn=e.nameStartsOn.shiftRight(i.length-1),i.includes(E.Punctuation_Colon))){let d=i.indexOf(E.Punctuation_Colon);e.nameMethodPartStartsOn=e.nameStartsOn.shiftRight(d+1)}e.name=$d.getIdentifier(i),Kd.analyzeNode(e),e.parameters=this.getParameters(e),e.hasParameters=e.parameters.length>0,e.hasParameters&&(Kd.analyzeParametersForModifiers(e),e.resetContentCache()),e.pathReference=this.pathParser.parse(i),e.mergeErrors(this.pathParser.getAntlersErrors()),e.pathReference!=null&&e.pathReference.isStrictTagReference&&(e.name.name=e.name.name.substr(1),e.name.content=e.name.content.substr(1)),e.isClosingTag=this.canBeClosingTag(e);let l=[];e.isClosingTag==!1&&(l=this.lexer.tokenize(e,e.getContent())),e.runtimeNodes=l;let u=e.content.trim();if($t.isConditionalStructure(e)&&e.name.name!="else"&&l.length==0&&u!="/if"&&u!="/unless"&&u!="/endunless"&&u!="endif"&&u!="endunless"&&u!="/endif"&&e.getContent().trim().length==0&&this.pushConditionWithoutExpression(e),e.name.name=="endif"){let d=e.copyBasicDetails(),_=e.getParser();return _!=null&&d.withParser(_),d.name=new Ln,d.name.name="if",d.name.compound="if",d.isClosingTag=!0,d.content=" /if ",d.originalNode=e,d}if(e.name.name=="unless"){let d=e.copyBasicDetails(),_=e.getParser();if(_!=null&&d.withParser(_),d.name=new Ln,d.name.name="if",d.name.compound="if",e.isClosingTag==!1){let C=(c=e.getContent())!=null?c:"",h=" if !("+C+") ";d.content=h,d.originalNode=e,d.resetContentCache(),d.runtimeNodes=this.lexer.tokenize(d,(f=d.getContent())!=null?f:""),this.testUnlessContent(d)}else d.originalNode=e,d.content=" /if ";return d}else if(e.name.name=="elseunless"){let d=e.copyBasicDetails(),_=e.getParser();_!=null&&d.withParser(_),d.name=new Ln,d.name.name="elseif",d.name.compound="elseif";let C=(m=e.getContent())!=null?m:"",h=" elseif !("+C+") ";return d.content=h,d.originalNode=e,d.resetContentCache(),d.runtimeNodes=this.lexer.tokenize(d,(p=d.getContent())!=null?p:""),this.testUnlessContent(d),d}else if(e.name.name=="endunless"){let d=e.copyBasicDetails(),_=e.getParser();return _!=null&&d.withParser(_),d.name=new Ln,d.name.name="if",d.name.compound="if",d.isClosingTag=!0,d.content=" /if ",d.originalNode=e,d}return e}pushError(e){this.activeNode!=null&&this.activeNode.pushError(e)}testUnlessContent(e){var r;let n=(r=e.getContent())!=null?r:"";if(n=n.replace("!",""),n=n.replace("(",""),n=n.replace(")","").trim(),n.length==0){this.pushConditionWithoutExpression(e);return}}pushConditionWithoutExpression(e){this.pushError(M.makeSyntaxError(v.TYPE_PARSE_EMPTY_CONDITIONAL,e,"Condition structure lacks comparison expression."))}getParameters(e){var V,O,$,X,ee,Y,ne,De,de;let n=(V=e.getContent())!=null?V:"",r=n.split(""),i=[],s=[],o=r.length,a=0;if(e.name!=null){let Z=G.trimLeft(e.content," "),Ge=e.content.length-Z.length,lt=e.name.content.length;Ge>0?a=Ge+lt:a=lt}let l=!1,u=[],c="",f=0,m=0,p=!1,d=null,_=-1,C=-1,h=-1,b=-1,g=-1,N=-1,S='"';for(let Z=0;Z0&&(lt=r[Z-1]),l==!1&&G.ctypeSpace(Ge)){u=[],_=-1,C=-1,h=-1,b=-1,g=-1,N=-1;continue}if(l==!1&&Ge==E.Punctuation_Equals){if(u.length>0&&(G.ctypeAlpha(u[0])||G.ctypeDigit(u[0])||u[0]==E.Punctuation_Colon||u[0]==E.AtChar)==!1){u=[];continue}if(Z+1>=o){this.pushError(M.makeSyntaxError(v.TYPE_UNEXPECTED_END_OF_INPUT,e,"Unexpected end of input"));continue}let Ve=null;if(Z+10&&(b=Z,g=Z,c=u.join(""),f=m,l=!0,u=[]),Ft==E.String_Terminator_DoubleQuote&&(d=E.String_Terminator_DoubleQuote,S=E.String_Terminator_DoubleQuote,Z+=1),Ft==E.String_Terminator_SingleQuote&&(d=E.String_Terminator_SingleQuote,S=E.String_Terminator_SingleQuote,Z+=1);continue}if(l&&Ge==E.String_EscapeCharacter){let Ve=null;if(Z+1o){this.pushError(M.makeSyntaxError(v.TYPE_UNEXPECTED_EOI_WHILE_PARSING_NODE_PARAMETER,e,"Unexpected end of input while parsing parameter content.")),ut.parent=e,s.push(ut),c="";continue}ut.endPosition=($=e.relativePositionFromOffset(Z+1,Z+1))!=null?$:null,ut.parent=e,ut.blockPosition={start:(X=e.relativeOffset(_,_))!=null?X:null,end:(ee=e.relativeOffset(C,C))!=null?ee:null},ut.namePosition={start:(Y=e.relativeOffset(h,h))!=null?Y:null,end:(ne=e.relativeOffset(b,b))!=null?ne:null},ut.valuePosition={start:(De=e.relativeOffset(g+2,g+2))!=null?De:null,end:(de=e.relativeOffset(N,N))!=null?de:null},s.push(ut),c="",_=-1,C=-1,h=-1,b=-1,g=-1,N=-1;continue}if(l==!1&&(Ge==E.String_Terminator_DoubleQuote||Ge==E.String_Terminator_SingleQuote)&&Z>a)break;u.push(Ge),_==-1&&(_=Z),h==-1&&(h=Z),u.length==1&&(m=Z+1)}if(d!=null){let Z=e;if(i.length>0){let Ge=i[i.length-1],lt=e.content.indexOf(Ge);if(lt>=0){let Ft=new J;Ft.startPosition=e.relativeOffset(lt-2,lt-2),Ft.endPosition=e.relativeOffset(lt+Ge.length,lt+Ge.length),Z=Ft}}this.pushError(M.makeSyntaxError(v.TYPE_UNEXPECTED_END_OF_INPUT,Z,"Unexpected string literal while parsing parameters."))}return s}};function bl(t){return t.length==0?null:t[0].startPosition}var zN=Q(qu()),Vc=class{static regions(){return this.noParseRegions}static clear(){this.noParseRegions.clear()}static registerNoParseContent(e){let n=zN.Md5.hashStr(e);return this.noParseRegions.set(n,e),n}};Vc.noParseRegions=new Map;function Tl(t,e){let n=new Set(t),r=new Set(e),i=new Set([...n].filter(s=>r.has(s)));return Array.from(i)}var Qd=class{constructor(){this.closingTagIndex=new Map;this.closingTagIndexCount=new Map;this.openTagIndexCount=new Map;this.closingTagNames=new Map;this.parentNode=null;this.stackCount=0;this.createdExecutionBranches=[];this.document=null}getClosingCandidates(e){var n,r;if((e instanceof B||e instanceof ft)&&e.isClosingTag==!1){let i=(r=(n=e.name)==null?void 0:n.compound)!=null?r:"";return i=="if"?["if","elseif","else"]:i=="elseif"?["elseif","else","if"]:i=="else"?["if"]:[i]}return[]}buildCloseIndex(e){var n,r,i;e.forEach(s=>{var o,a,l,u,c,f,m,p,d,_;if(!(s instanceof lr)&&!((s instanceof B||s instanceof ft)&&s.isSelfClosing)&&(s instanceof B||s instanceof ft)&&s.isClosingTag){this.closingTagIndex.has(this.stackCount)==!1&&this.closingTagIndex.set(this.stackCount,new Map),this.closingTagIndexCount.has(this.stackCount)==!1&&this.closingTagIndexCount.set(this.stackCount,new Map);let C=(a=(o=s.name)==null?void 0:o.compound)!=null?a:"";((l=this.closingTagIndex.get(this.stackCount))==null?void 0:l.has(C))==!1&&((u=this.closingTagIndex.get(this.stackCount))==null||u.set(C,[]),(c=this.closingTagIndexCount.get(this.stackCount))==null||c.set(C,0)),(m=(f=this.closingTagIndex.get(this.stackCount))==null?void 0:f.get(C))==null||m.push(s);let h=(d=(p=this.closingTagIndexCount.get(this.stackCount))==null?void 0:p.get(C))!=null?d:0;(_=this.closingTagIndexCount.get(this.stackCount))==null||_.set(C,h+1)}}),this.closingTagNames.has(this.stackCount)==!1&&this.closingTagNames.set(this.stackCount,[]),this.closingTagIndex.has(this.stackCount)&&(this.closingTagNames.set(this.stackCount,Array.from((r=(n=this.closingTagIndex.get(this.stackCount))==null?void 0:n.keys())!=null?r:[])),(i=this.closingTagIndex.get(this.stackCount))==null||i.forEach((s,o)=>{var u,c,f,m,p,d,_;let a=s.length;if(a==0)return;let l=s[a-1];for(let C=0;C=l.index)break;let b=(c=(u=h.name)==null?void 0:u.compound)!=null?c:"";if(h.isClosingTag==!1&&o==b&&!h.isSelfClosing){this.openTagIndexCount.has(this.stackCount)==!1&&this.openTagIndexCount.set(this.stackCount,new Map),((f=this.openTagIndexCount.get(this.stackCount))==null?void 0:f.has(o))==!1&&((m=this.openTagIndexCount.get(this.stackCount))==null||m.set(o,0));let g=(d=(p=this.openTagIndexCount.get(this.stackCount))==null?void 0:p.get(o))!=null?d:0;(_=this.openTagIndexCount.get(this.stackCount))==null||_.set(o,g+1)}}}}))}getScanForList(e){var n;if(e instanceof B||e instanceof ft){let r=(n=e.name)==null?void 0:n.compound;if(r=="else")return["if"];if(r=="elseif")return["elseif","else","if"];if(e.isClosingTag==!1){let i=this.getClosingCandidates(e),s=this.closingTagNames.get(this.stackCount);return Tl(i,s)}}return[]}canPossiblyClose(e){var n,r;if(e instanceof lr)return!1;if(e instanceof ft||e instanceof B){if(e.isComment||e.isSelfClosing)return!1;let i=(r=(n=e.name)==null?void 0:n.compound)!=null?r:"";if(i=="else"||i=="elseif")return!0;if(e.isClosingTag==!1){let s=this.getClosingCandidates(e),o=this.closingTagNames.get(this.stackCount);return Tl(s,o).length>0}}return!1}findClosingPair(e,n,r){var a,l,u,c;let i=n.runtimeNodes.length,s=e.length,o=0;for(let f=0;f=i,o+=1}continue}if(r.includes(p)&&o>0){o-=1;continue}if(o==0&&r.includes(p)){m.isOpenedBy=n,n.isClosedBy=m;break}}}else continue}}associate(e,n){var s,o,a,l,u,c,f;this.document=n;let r=[{documentNodes:e,parent:null}],i=[];for(;r.length>0;){let m=r.pop();if(m==null)continue;let p=m.documentNodes;this.parentNode=m.parent,this.stackCount+=1,this.buildCloseIndex(p),p=$t.pairConditionals(p),p.forEach(h=>{if((h instanceof B||h instanceof ft)&&this.canPossiblyClose(h)){if($t.isConditionalStructure(h))return;let b=this.getScanForList(h);this.findClosingPair(p,h,b)}});let d=p.length;for(let h=0;hb.isClosedBy.index)break;if(N.parent=b,b.children.push(N),N instanceof B&&N.index==b.index){N.parent=b;break}}}p.forEach(h=>{if((h instanceof B||h instanceof ft)&&h.children.length>0){let b=[];h.children.forEach(g=>{g.parent!=null&&g.parent.index==h.index&&(g.parent=h,b.push(g))}),r.push({documentNodes:b,parent:h})}});let _=[];p.forEach(h=>{this.parentNode==null?h.parent==null&&_.push(h):h.parent==this.parentNode&&_.push(h)}),_=this.reduceConditionals(_,n);let C=new Map;p.forEach(h=>{var b,g,N,S;if((h instanceof B||h instanceof ft)&&h.isClosedBy!=null&&this.document!=null){let V=this.document.getText(((g=(b=h.endPosition)==null?void 0:b.index)!=null?g:0)+1,(S=(N=h.isClosedBy.startPosition)==null?void 0:N.index)!=null?S:0);h.runtimeContent=V}});for(let h=0;h<_.length;h++){let b=_[h],g=(s=b.refId)!=null?s:"";if(C.set(g,1),(b instanceof B||b instanceof ft)&&b.isComment==!1&&((o=b.name)==null?void 0:o.name)=="noparse"&&!(b instanceof rn)&&b.isClosingTag==!1){if(b.isClosedBy==null){b.pushError(M.makeSyntaxError(v.TYPE_NO_PARSE_UNASSOCIATED,b,"Encountered noparse region without a closing tag. All noparse regions must be closed."));continue}let N=b.content;this.document!=null&&(N=this.document.getText(((l=(a=b.endPosition)==null?void 0:a.index)!=null?l:0)+1,(f=(c=(u=b.isClosedBy)==null?void 0:u.startPosition)==null?void 0:c.index)!=null?f:0));let S=new rn,V=b.getParser();V!=null&&S.withParser(V),b.copyBasicDetailsTo(S),S.name=new Ln,S.name.name="noparse",S.name.compound="noparse",S.content=Vc.registerNoParseContent(N),S.originalNode=b,S.isClosedBy=b.isClosedBy,S.parent=b.parent,_[h]=S}}if(this.parentNode!=null&&(this.parentNode instanceof ft||this.parentNode instanceof B)&&(this.parentNode.children=this.cleanNodes(_),this.parentNode.parent!=null&&this.parentNode.parent instanceof B)){let h=this.parentNode.parent.children,b=[];h.forEach(g=>{var N;C.has((N=g.refId)!=null?N:"")==!1&&b.push(g)}),this.parentNode.parent.children=this.cleanNodes(b)}this.stackCount<=1&&(i=_)}return this.createdExecutionBranches.length>0&&this.createdExecutionBranches.forEach(m=>{m.head!=null&&(m.nodes=m.head.children)}),i}cleanNodes(e){let n=[],r=[];for(let i=0;iQd.ForceBreakLimit){$=!1;break}if(h instanceof B||h instanceof ft){let ee=this.findEndOfBranch(e.slice(C+1),h,C),Y=new td,ne=ee.tail;Y.head=h,Y.tail=ne,Y.nodes=this.cleanNodes(h.children);let De=((f=(c=h.endPosition)==null?void 0:c.offset)!=null?f:0)+1,de=(d=(p=(m=h.isClosedBy)==null?void 0:m.startPosition)==null?void 0:p.offset)!=null?d:0,Z=n.getText(De,de);if(Y.documentText=Z,n.shouldParseChildDocument()&&(Y.childDocument=mt.childFromText(Y.documentText,bl(Y.nodes))),ne==null&&(ne=Y.head.isClosedBy),ne!=null&&ne.startPosition!=null&&(Y.startPosition=ne.startPosition),ne!=null&&(Y.index=ne.index),Y.nodes.length>0){let Ge=Y.nodes[Y.nodes.length-1];Ge.endPosition!=null&&(Y.endPosition=Ge.endPosition)}else ne!=null&&ne.endPosition!=null&&(Y.endPosition=ne.endPosition);if(this.createdExecutionBranches.push(Y),g.logicBranches.push(Y),(ne==null?void 0:ne.isClosingTag)&&((_=ne.name)==null?void 0:_.compound)=="if"){O=ee.offset,$=!1;break}else ne!=null&&g.chain.push(ne.index),C=ee.offset,ne instanceof B&&(h=ne)}else $=!1}if(g.logicBranches.length>0){let ee=g.logicBranches[0],Y=g.logicBranches[g.logicBranches.length-1];ee.startPosition!=null&&(g.startPosition=ee.startPosition),Y.endPosition!=null&&(g.endPosition=Y.endPosition)}if(r.push(g),O!=null&&O==e.length)break}else r.push(h);else r.push(h)}return r}},ga=Qd;ga.ForceBreakLimit=1e5;var Jd=class{static associateRecursiveParent(e){var n,r;for(let i=0;i=0;l-=1){let u=e[l];if(!(u instanceof Qe)&&u instanceof B&&u.isClosedBy!=null){if(s.isNestedRecursive){if(u.content.trim()==((r=s.name)==null?void 0:r.name)){a=u;break}}else if(u.runtimeContent.includes(o)&&G.substringCount(s.runtimeContent,"*recursive")==1){a=u;continue}else if(a!=null)break}}if(a==null)continue;s.isNestedRecursive?(a.hasRecursiveNode=!0,s.recursiveParent=a,a.recursiveReference=s):a.parent!=null?a.parent instanceof B&&(a.parent.hasRecursiveNode=!0,a.parent.recursiveReference=s,s.recursiveParent=a.parent):(a.hasRecursiveNode=!0,s.recursiveParent=a,a.recursiveReference=s)}}}};var _a=class{static getNearText(e){var r,i,s,o;if(e instanceof oe)return e.name;if(e instanceof Lt)return(i=(r=e.value)==null?void 0:r.toString())!=null?i:"";if(e instanceof bt)return e.value;if(e instanceof jt)return e.name;if(e instanceof Ut)return e.value;if(e instanceof Kr||e instanceof ui||e instanceof ur||e instanceof Lr||e instanceof Or||e instanceof on||e instanceof Wr||e instanceof Ct||e instanceof sn||e instanceof Dr||e instanceof Wn||e instanceof li||e instanceof Tn||e instanceof oi||e instanceof Fr||e instanceof Yn||e instanceof kr||e instanceof Hn||e instanceof Mr||e instanceof ai||e instanceof Ur||e instanceof qr||e instanceof Vr||e instanceof Ei||e instanceof cr||e instanceof Kn||e instanceof Gr||e instanceof Nn||e instanceof fr||e instanceof vn||e instanceof Yr||e instanceof jr||e instanceof Br||e instanceof wi||e instanceof pr||e instanceof Hr||e instanceof zt||e instanceof Bt||e instanceof Pn||e instanceof It||e instanceof ts||e instanceof In||e instanceof ci||e instanceof Xt)return e.content;let n="";return e instanceof B?e.originalNode!=null?n=e.originalNode.getContent():n=(o=(s=e.startPosition)==null?void 0:s.line.toString())!=null?o:"":e.originalAbstractNode!=null?n=e.originalAbstractNode.rawContent():n=e.rawContent(),n.length>15&&(n=n.substr(0,-15)),n}};var ya=class{};ya.deferredCoreLibraries=["arr","array","str","string","method","math","sys","convert","scope","stopwatch","file","path","url","request","json","datetime"];var ht=class{};ht.ARR_PLUCK="pluck",ht.ARR_TAKE="take",ht.ARR_SKIP="skip",ht.ARR_MAKE="arr",ht.ARR_ORDERBY="orderby",ht.ARR_GROUPBY="groupby",ht.ARR_MERGE="merge",ht.QUERY_WHERE="where",ht.STRUCT_SWITCH="switch",ht.BITWISE_AND="bwa",ht.BITWISE_OR="bwo",ht.BITWISE_XOR="bxor",ht.BITWISE_NOT="bnot",ht.BITWISE_SHIFT_LEFT="bsl",ht.BITWISE_SHIFT_RIGHT="bsr",ht.operators=["pluck","take","arr","skip","orderby","groupby","merge","where","switch","bwa","bwo","bxor","bsl","bsr"];var Rt=class{constructor(){this.pathParser=new ki;this.tokens=[];this.createdVariables=[];this.createdModifierChains=[];this.createdLanguageOperators=[];this.createdArrays=[];this.tracedAssignments=[];this.mergedVariablePaths=[];this.mergedComponents=new Map;this.modifierNameMapping=new Map;this.isRealModifierSeparator=new Map;this.isRoot=!0;this.retriggerNonVirtualGroupMembers=[]}hasModifierConstruct(e){return this.modifierNameMapping.has(e)}getModifierConstruct(e){return this.modifierNameMapping.get(e)}isActualModifierSeparator(e){return this.isRealModifierSeparator.has(e)}isMergedVariableComponent(e){return this.mergedComponents.has(e)}getMergedVariable(e){return this.mergedComponents.get(e)}getMergedVariablePaths(){return this.mergedVariablePaths}getCreatedModifierChains(){return this.createdModifierChains}getCreatedLangaugeOperators(){return this.createdLanguageOperators}getCreatedArrays(){return this.createdArrays}getCreatedVariables(){return this.createdVariables}getRuntimeAssignments(){return this.tracedAssignments}getAssignedVariables(){let e=[],n=[];for(let r=0;r0&&this.retriggerNonVirtualGroupMembers.forEach(n=>{this.markAllNonVirtualAsListGroupMember(n)})),this.createSemanticGroups(this.tokens)}setIsRoot(e){return this.isRoot=e,this}validateNeighboringOperators(e){let n=e.length;for(let r=0;r=n){i.pushError(M.makeSyntaxError(v.TYPE_UNEXPECTED_OPERATOR,i,"Unexpected operator while parsing input text."));return}let s=e[r+1];if(Rt.isOperatorType(s)){s.pushError(M.makeSyntaxError(v.TYPE_OPERATOR_INVALID_ON_RIGHT,s,"Unexpected operator while parsing input text."));continue}}}}static isAssignmentOperator(e){return e instanceof Dr||e instanceof kr||e instanceof Kn||e instanceof Mr||e instanceof Fr||e instanceof li}static isOperatorType(e){return e instanceof Dr||e instanceof kr||e instanceof Kn||e instanceof Mr||e instanceof Fr||e instanceof li||e instanceof wi||e instanceof Wr||e instanceof fr||e instanceof on||e instanceof Yr||e instanceof ui||e instanceof pr||e instanceof ci||e instanceof Wn||e instanceof Hn||e instanceof oi||e instanceof ai||e instanceof Yn||e instanceof Tn||e instanceof Nn||e instanceof cr||e instanceof Ei||e instanceof Vr||e instanceof qr||e instanceof Br||e instanceof jr||e instanceof Ur||e instanceof Gr}markAllNonVirtualAsListGroupMember(e){e.forEach(n=>{if(n instanceof ke||n instanceof dr||n instanceof Li){n.start!=null&&n.start.isVirtual==!1&&(n.start.isListGroupMember=!0),n.end!=null&&n.end.isVirtual==!1&&(n.end.isListGroupMember=!0),n.scopeOperator!=null&&(n.scopeOperator.isListGroupMember=!0),n.nodes.forEach(r=>{this.markAllNonVirtualAsListGroupMember([r])});return}else n instanceof Ot&&(n.separatorToken!=null&&n.separatorToken.isVirtual==!1&&(n.separatorToken.isListGroupMember=!0),this.markAllNonVirtualAsListGroupMember(n.nodes));n.isVirtual==!1&&(n.isListGroupMember=!0),n.originalAbstractNode!=null&&n.originalAbstractNode!=n&&this.markAllNonVirtualAsListGroupMember([n.originalAbstractNode])})}markAllNonVirtualAsSwitch(e){e.forEach(n=>{if(n instanceof ke||n instanceof dr||n instanceof Li){n.start!=null&&n.start.isVirtual==!1&&(n.start.isSwitchGroupMember=!0),n.end!=null&&n.end.isVirtual==!1&&(n.end.isSwitchGroupMember=!0),n.scopeOperator!=null&&(n.scopeOperator.isSwitchGroupMember=!0),n.nodes.forEach(r=>{this.markAllNonVirtualAsSwitch([r])});return}else n instanceof Ot&&(n.separatorToken!=null&&n.separatorToken.isVirtual==!1&&(n.separatorToken.isSwitchGroupMember=!0),this.markAllNonVirtualAsSwitch(n.nodes));n.isVirtual==!1&&(n.isSwitchGroupMember=!0),n.originalAbstractNode!=null&&n.originalAbstractNode!=n&&this.markAllNonVirtualAsSwitch([n.originalAbstractNode])})}validateNoDanglingLogicGroupEnds(e){e.forEach(n=>{n instanceof Bt&&n.pushError(M.makeSyntaxError(v.TYPE_LOGIC_GROUP_NO_START,n,"Unexpected [T_LOGIC_END] while parsing input text."))})}isValidModifierValue(e){return e instanceof Ut||e instanceof oe||e instanceof Lr||e instanceof Or||e instanceof ur||e instanceof Lt||e instanceof bt}wrapNumberInVariable(e){var r,i,s,o;let n=new oe;return n.startPosition=e.startPosition,n.endPosition=e.endPosition,n.name=(i=(r=e.value)==null?void 0:r.toString())!=null?i:"",n.content=(o=(s=e.value)==null?void 0:s.toString())!=null?o:"",n.originalAbstractNode=e,n.refId=e.refId,n.modifierChain=e.modifierChain,n.index=e.index,this.createdVariables.push(n),n}wrapArithmeticModifier(e,n){let r=new jt;return r.startPosition=e.startPosition,r.endPosition=e.endPosition,r.originalAbstractNode=e,r.content=n,r.name=n,r.index=e.index,r}combineVariablePaths(e){let n=[],r=e.length;for(let i=0;ir){let u="";if(i>0){let c=e[i-1];u=_a.getNearText(c)}s.pushError(M.makeSyntaxError(v.TYPE_UNEXPECTED_EOI_PARSING_BRANCH_GROUP,s,'Unexpected end of input while parsing input text near "'+u+_a.getNearText(s)+'".'));continue}let a=n[o-1],l=e[i+1];if(l instanceof Lt&&nt.distance(a,l)==1&&(l=this.wrapNumberInVariable(l)),a instanceof oe&&l instanceof oe&&nt.distance(a,l)==1){n.pop(),nt.mergeVarContentRight(":",s,l),nt.mergeVarRight(a,l),n.push(l),this.createdVariables.push(l),this.mergedVariablePaths.push(l),this.mergedComponents.set(s,l),this.mergedComponents.set(a,l),this.mergedComponents.set(l,l),i+=1;continue}else{n.push(s);continue}}else if(s instanceof bt&&o>0){if(i+1>=r){n.push(s);continue}let a=n[o-1],l=e[i+1];if(a instanceof oe&&l instanceof oe&&nt.distance(a,s)<=1&&nt.distance(s,l)<=1){n.pop(),nt.mergeVarContentLeft(s.sourceTerminator+s.value+s.sourceTerminator,s,a),nt.mergeVarContentLeft(l.name,l,a),this.createdVariables.push(a),n.push(a),this.mergedVariablePaths.push(a),this.mergedComponents.set(s,a),this.mergedComponents.set(a,a),this.mergedComponents.set(l,a),i+=1;continue}else n.push(s)}else if(s instanceof Tn&&o>0){let a=n[o-1],l=e[i+1];if(a instanceof oe&&l instanceof oe){let u=nt.distance(a,s),c=nt.distance(s,l);u<=1&&c<=1?(a.endPosition=l.endPosition,this.mergedComponents.set(s,a),this.mergedComponents.set(a,a),this.mergedComponents.set(l,a),i+=1):n.push(s)}else n.push(s)}else n.push(s)}return n.forEach(i=>{i instanceof oe&&(i.variableReference=this.pathParser.parse(i.name),i.mergeErrors(this.pathParser.getAntlersErrors()))}),n}convertVarNodeToOperator(e){let n=new Wr;return n.content=e.name,n.startPosition=e.startPosition,n.endPosition=e.endPosition,n.originalAbstractNode=e,e.convertedToOperator=!0,this.createdLanguageOperators.push(n),n}convertOperatorToVarNode(e){let n=new oe;return n.startPosition=e.startPosition,n.endPosition=e.endPosition,n.content=e.content,n.name=e.content,n.originalAbstractNode=e,this.createdVariables.push(n),n}createLanguageOperators(e){let n=e.length;for(let r=0;r=n){e[r]=this.convertOperatorToVarNode(i);continue}if(e[r+1]instanceof sn){e[r]=this.convertOperatorToVarNode(i);continue}}}return e}createLogicalGroups(e){let n=[],r=e.length,i=[];for(let o=0;o0&&i.length>0){let f=i[i.length-1];if(f instanceof Lt||f instanceof Bt||f instanceof ke){if(f instanceof ke&&f.start instanceof on){f.start.pushError(M.makeSyntaxError(v.TYPE_FACTORIAL_MATERIALIZED_BOOL_DETECTED,f.start,"[T_AOP_FACTORIAL] operand will always materialize boolean type."));continue}let m=new ts;m.startPosition=a.startPosition,m.endPosition=a.endPosition,m.content="!".repeat(l),m.originalAbstractNode=a,m.repeat=l,i.push(m),l>0&&(o+=l-1);continue}}if(l%2==0){o+=l-1;continue}let u=e[o+l];if(u instanceof zt){let f=o+l+1;if(f>=r){u.pushError(M.makeSyntaxError(v.TYPE_UNEXPECTED_EOI_WHILE_PARSING_LOGIC_GROUP_NEGATION_OFFSET,u,"Unexpected end of input while parsing input text."));continue}let m=this.findLogicalGroupEnd(e[o+l],e.slice(f));if(m.found){let p=m.logicalGroup,d=new ke;d.start=a,d.end=p,d.nodes.push(a),d.nodes.push(p),d.startPosition=a.startPosition,d.endPosition=p.endPosition,i.push(d),o+=m.skipCount+l}continue}let c=this.resolveValueRight(e,o);c.value!=null&&i.push(c.value),o+=c.negationCount}else i.push(a)}let s=i.length;for(let o=0;o=s){a.pushError(M.makeSyntaxError(v.TYPE_UNEXPECTED_EOI_WHILE_PARSING_LOGIC_GROUP_END_DUE_TO_NEGATION,a,"Unexpected end of input while parsing input text."));continue}let l=this.findLogicalGroupEnd(a,i.slice(o+1));l.found&&l.logicalGroup!=null&&n.push(l.logicalGroup),o+=l.skipCount}else if(a instanceof ts){if(n.length==0){a.pushError(M.makeSyntaxError(v.TYPE_UNEXPECTED_FACTORIAL_WHILE_CREATING_GROUPS,a,"Unexpected [T_AOP_FACTORIAL] while parsing input text."));continue}let l=n[n.length-1];if(!(l instanceof ke)&&!(l instanceof Lt)){a.pushError(M.makeSyntaxError(v.TYPE_UNEXPECTED_FACTORIAL_OPERAND,a,"Unexpected left operand encountered for [T_AOP_FACTORIAL] while parsing input text."));continue}l=n.pop();let u=new ke;u.startPosition=l.startPosition,u.endPosition=a.endPosition,u.originalAbstractNode=a,u.nodes.push(l),u.nodes.push(a),n.push(u)}else n.push(a)}return n}makeArgGroup(e){let n=new qo,r=e.length;for(let s=0;s=r){o.pushError(M.makeSyntaxError(v.TYPE_ARG_UNEXPECTED_NAMED_ARGUMENT,o,"Unexpected end of input while parsing named argument."));continue}let l=e[s+2],u=new ju;u.startPosition=o.startPosition,u.endPosition=l.endPosition,u.content=o.content+l.content,u.name=o,u.value=l,o instanceof oe||o.pushError(M.makeSyntaxError(v.TYPE_INVALID_NAMED_ARG_IDENTIFIER,o,"Invalid type ["+W.getPrettyTypeName(o)+"] supplied for named argument name.")),n.hasNamedArguments=!0,n.numberOfNamedArguments+=1,n.args.push(u),s+3{s instanceof ju?i=!0:i&&s.pushError(M.makeSyntaxError(v.TYPE_UNEXPECTED_UNNAMED_METHOD_ARGUMENT,s,"Unnamed arguments are not allowed to appear after a named argument."))}),n}cleanVariableForMethodInvocation(e){(e.name.startsWith(":")||e.name.startsWith("."))&&(e.name=e.name.substr(1),e.variableReference!=null&&(e.variableReference.originalContent=e.variableReference.originalContent.substr(1),e.variableReference.normalizedReference=e.variableReference.normalizedReference.substr(1)),e.startPosition!=null&&(e.startPosition.offset+=1,e.startPosition.char+=1))}reduceVariableReferenceForObjectAccessor(e){var s;let n=(s=e.variableReference)==null?void 0:s.pathParts.pop(),r=n.name,i=r.length+1;return e.name=e.name.substr(0,-i),e.variableReference!=null&&(e.variableReference.originalContent=e.variableReference.originalContent.substr(0,-i),e.variableReference.normalizedReference=e.variableReference.normalizedReference.substr(0,-i),e.variableReference.pathParts[e.variableReference.pathParts.length-1].isFinal=!0),e.endPosition!=null&&(e.endPosition.offset-=i,e.endPosition.char-=i),{accessor:r,accessorLen:i}}associateMethodCalls(e){var i,s;let n=[],r=e.length;for(let o=0;o0&&(l=n[n.length-1]),o+10&&(c.nodes[0]instanceof Ot?f=c.nodes[0].nodes:f=c.nodes);let m=new Xt;if(m.startPosition=a.startPosition,l instanceof It){let p=n.pop();m.startPosition=p.startPosition}this.cleanVariableForMethodInvocation(a),m.endPosition=c.endPosition,m.args=this.makeArgGroup(f),m.method=a,l.methodTarget=m,l instanceof oe&&l.mergeRefName.length>0&&(l.name=nt.getUnrefName(l.mergeRefName)),n.push(m),o+=1;continue}else if(a instanceof ke&&l instanceof oe&&l.variableReference!=null&&l.variableReference.pathParts.length>=2){let c=[];if(a.nodes.length>0&&(a.nodes[0]instanceof Ot?c=a.nodes[0].nodes:c=a.nodes),l.variableReference.pathParts[0]instanceof Un&&ya.deferredCoreLibraries.includes(l.variableReference.pathParts[0].name)){let _=n.pop(),C=new ns;C.startPosition=_.startPosition,C.endPosition=a.endPosition,C.content=_.content,C.originalAbstractNode=a;let b=((i=_.variableReference)==null?void 0:i.pathParts.shift()).name,g=(s=_.variableReference)==null?void 0:s.implodePaths();C.libraryName=b,C.methodName=g,C.arguments=this.makeArgGroup(c),n.push(C),o+=1;continue}let f=this.reduceVariableReferenceForObjectAccessor(l),m=new Xt;m.startPosition=a.startPosition,m.endPosition=a.endPosition,l.methodTarget=m,l instanceof oe&&l.mergeRefName.length>0&&(l.name=nt.getUnrefName(l.mergeRefName)),a.start!=null&&(a.start.isPartOfMethodChain=!0),a.end!=null&&(a.end.isPartOfMethodChain=!0);let p=new oe;p.name=f.accessor,p.isPartOfMethodChain=!0;let d=this.makeArgGroup(c);if(m.startPosition!=null&&(m.startPosition.offset-=f.accessorLen,m.startPosition.char-=f.accessorLen),m.method=p,m.args=d,G.isNumeric(l.name)){let _=n.pop();n.push(this.convertOperatorToVarNode(_))}n.push(m);continue}else if(a instanceof oe&&l instanceof Xt){if(this.cleanVariableForMethodInvocation(a),o+1>r){a.pushError(M.makeSyntaxError(v.TYPE_METHOD_CALL_MISSING_ARG_GROUP,a,"Unexpected end of input while parsing method call."));continue}let c=e[o+1];if(!(c instanceof ke)){a.pushError(M.makeSyntaxError(v.TYPE_INVALID_METHOD_CALL_ARG_GROUP,a,"Unexpected ["+W.getPrettyTypeName(c)+"] while parsing [T_METHOD_CALL]; expecting [T_ARG_GROUP]."));continue}let f=c,m=[];f.nodes.length>0&&(f.nodes[0]instanceof Ot?m=f.nodes[0].nodes:m=f.nodes);let p=new Xt;p.startPosition=a.startPosition,p.endPosition=f.endPosition,p.args=this.makeArgGroup(m),p.method=a,l.methodTarget=p,n.push(p),o+=1;continue}else if(a instanceof It&&l instanceof Xt){if(o+1>r){a.pushError(M.makeSyntaxError(v.TYPE_METHOD_CALL_MISSING_METHOD,a,"Unexpected end of input while parsing method call."));continue}let c=e[o+1];if(o+2>r){a.pushError(M.makeSyntaxError(v.TYPE_METHOD_CALL_MISSING_ARG_GROUP,a,"Unexpected end of input while parsing method call."));continue}let f=e[o+2];if(!(f instanceof ke)){a.pushError(M.makeSyntaxError(v.TYPE_INVALID_METHOD_CALL_ARG_GROUP,a,"Unexpected ["+W.getPrettyTypeName(f)+"] while parsing [T_METHOD_CALL]; expecting [T_ARG_GROUP]."));continue}let m=f,p=[];m.nodes.length>0&&(m.nodes[0]instanceof Ot?p=m.nodes[0].nodes:p=m.nodes);let d=new Xt;d.startPosition=a.startPosition,d.endPosition=f.endPosition,d.args=this.makeArgGroup(p),d.method=c,l.methodTarget=d,n.push(d),o+=2;continue}else if(a instanceof Xt){if(o+1>r){a.pushError(M.makeSyntaxError(v.TYPE_METHOD_CALL_MISSING_METHOD,a,"Unexpected end of input while parsing method call."));continue}let c=e[o+1];if(o+2>r){a.pushError(M.makeSyntaxError(v.TYPE_INVALID_METHOD_CALL_ARG_GROUP,a,"Unexpected end of input while parsing method call."));continue}let f=e[o+2];if(!(f instanceof ke)){a.pushError(M.makeSyntaxError(v.TYPE_INVALID_METHOD_CALL_ARG_GROUP,a,"Unexpected ["+W.getPrettyTypeName(f)+"] while parsing [T_METHOD_CALL]; expecting [T_ARG_GROUP]."));continue}let m=f,p=[];m.nodes.length>0&&(m.nodes[0]instanceof Ot?p=m.nodes[0].nodes:p=m.nodes);let d=this.makeArgGroup(p);if(l instanceof oe&&ya.deferredCoreLibraries.includes(l.name)){let _=n.pop(),C=new ns;C.startPosition=_.startPosition,C.endPosition=m.endPosition,C.libraryName=_.name,C.methodName=c.name,C.content=C.libraryName+"->"+C.methodName,C.arguments=d,l.libraryTarget=C,n.push(C),o+=2;continue}a.method=c,a.args=d,n.length>0&&(n[n.length-1].methodTarget=a),o+=2,n.push(a);continue}else n.push(a)}return n}convertVariableToStringNode(e){let n=new bt;return n.content=e.name,n.value=e.name,n.originalAbstractNode=e,n.startPosition=e.startPosition,n.endPosition=e.endPosition,n.index=e.index,n}createTupleLists(e){let n=e.length,r=[];for(let i=0;i=n){s.pushError(M.makeSyntaxError(v.TYPE_UNEXPECTED_EOI_PARSING_TUPLE_LIST,s,"Unexpected end of input while parsing tuple list."));continue}let o=e[i+1];if(!(o instanceof ke)){o.pushError(M.makeSyntaxError(v.TYPE_UNEXPECTED_TYPE_FOR_TUPLE_LIST,o,"Unexpected ["+W.getPrettyTypeName(o)+"] while parsing tuple list."));continue}let a=o;if(this.markAllNonVirtualAsListGroupMember([a]),this.retriggerNonVirtualGroupMembers.push([a]),a.nodes.length==0){a.pushError(M.makeSyntaxError(v.TYPE_MISSING_BODY_TUPLE_LIST,a,"Missing tuple list body while parsing tuple list."));continue}let u=a.nodes.shift(),c=u.nodes.length,f=[];for(let d=0;d1&&(C=!0),_.name.trim().length==0&&(C=!0)),C||!(_ instanceof oe)){a.pushError(M.makeSyntaxError(v.TYPE_INVALID_TUPLE_LIST_NAME_TYPE,a,"Invalid ["+W.getPrettyTypeName(_)+"] name type found while parsing tuple list."));continue}let h=_;f.push(this.convertVariableToStringNode(h))}}let m=f.length;if(m==0){a.pushError(M.makeSyntaxError(v.TYPE_INVALID_MANIFESTED_NAME_GROUP,a,"Invalid Name expression produced an invalid name group while parsing tuple list."));continue}let p=new Oi;this.createdArrays.push(p),p.startPosition=s.startPosition,p.endPosition=s.endPosition,a.nodes.forEach(d=>{if(!(d instanceof Ot)){d.pushError(M.makeSyntaxError(v.TYPE_INVALID_TUPLE_LIST_VALUE_TYPE_GROUP,d,"Invalid ["+W.getPrettyTypeName(d)+"] name type found while parsing tuple list value expression."));return}let _=d,C=new Oi;this.createdArrays.push(C),C.startPosition=_.startPosition;let h=[];for(let b=0;bh.length);b++){let g=h[b],N=new fl;N.startPosition=g.startPosition,N.endPosition=g.endPosition,N.name=f[b],N.value=g,C.nodes.push(N),p.endPosition=g.endPosition,C.endPosition=g.endPosition}p.nodes.push(C)}),r.push(p),i+=1;continue}else r.push(s)}return e}makeOrderGroup(e){let n=[],r=e.length,i=0;for(let s=0;s0&&(a==null||a instanceof Ct)){i+=1;let l=new ll;l.order=i,l.name=e[s-1],l.directionNode=o,this.isOperand(l.name)==!1&&l.name.pushError(M.makeSyntaxError(v.TYPE_INVALID_ORDER_BY_NAME_VALUE,l.name,"Invalid value or expression supplied for order by name.")),this.isOperand(l.directionNode)==!1&&l.directionNode.pushError(M.makeSyntaxError(v.TYPE_INVALID_ORDER_BY_SORT_VALUE,l.directionNode,"Invalid value or expression supplied for order by direction.")),l.startPosition=l.name.startPosition,l.endPosition=l.directionNode.endPosition,n.push(l),s+=1;continue}}return n}getValues(e){let n=new Fo,r=e.length,i=[];for(let s=0;s=r){s.pushError(M.makeSyntaxError(v.TYPE_UNEXPECTED_EOI_WHILE_PARSING_ARG_GROUP,s,"Unexpected end of input while parsing argument group."));continue}if(!(e[i+1]instanceof ke)){s.pushError(M.makeSyntaxError(v.TYPE_EXPECTING_ARGUMENT_GROUP,s,"Unexpected token while parsing method call. Expecting [T_ARG_SEPARATOR] got ["+W.getPrettyTypeName(s)+"]."));continue}let c=e[i+1],f=null;if(c.nodes.length>0){let m=c.nodes[0];f=this.makeArgGroup(m.nodes)}f==null&&(f=new qo,f.startPosition=c.startPosition,f.endPosition=c.endPosition,f.originalAbstractNode=c),u.arguments=f,n.push(u),i+=1;continue}else if(s.content==ht.ARR_ORDERBY){if(i+1>=r){s.pushError(M.makeSyntaxError(v.TYPE_UNEXPECTED_EOI_PARSING_ORDER_GROUP,s,"Unexpected end of input while parsing order group."));continue}let o=e[i+1];if(!(o instanceof ke)){o.pushError(M.makeSyntaxError(v.TYPE_EXPECTING_ORDER_GROUP_FOR_ORDER_BY_OPERAND,o,"Unexpected ["+W.getPrettyTypeName(o)+"] while parsing order group."));continue}let l=o.nodes;l[0]instanceof Ot&&(l=l[0].nodes);let u=this.makeOrderGroup(l);u.length==0&&s.pushError(M.makeSyntaxError(v.TYPE_UNEXPECTED_EMPTY_DIRECTION_GROUP,s,"Unexpected empty [T_DIRECTION_GROUP]. Must have at least one order clause, and each property must have a direction specified."));let c=new qs;if(c.orderClauses=u,u.length>0){u[0].directionNode!=null&&(c.startPosition=u[0].directionNode.startPosition);let f=u[u.length-1].directionNode;f!=null&&(c.endPosition=f.endPosition)}n.push(s),n.push(c),i+=1;continue}else if(s.content==ht.ARR_GROUPBY){if(i+1>=r){s.pushError(M.makeSyntaxError(v.TYPE_UNEXPECTED_EOI_WHILE_PARSING_GROUP_BY,s,"Unexpected end of input while parsing group by clause."));continue}let o=e[i+1];if(o instanceof Li||o instanceof dr){o.pushError(M.makeSyntaxError(v.TYPE_GROUP_BY_SCOPED_GROUP_MUST_BE_ENCLOSED,o,"Type ["+W.getPrettyTypeName(o)+"] must be enclosed with parenthesis to be used with groupby."));continue}if(!(o instanceof ke)){o.pushError(M.makeSyntaxError(v.TYPE_UNEXPECTED_TOKEN_FOR_GROUP_BY,o,"Unexpected ["+W.getPrettyTypeName(o)+"] while parsing group by."));continue}let l=o.nodes;l[0]instanceof Ot&&(l=l[0].nodes);let u=this.getValues(l);if(n.push(s),n.push(u),i+2=r){s.pushError(M.makeSyntaxError(v.TYPE_UNEXPECTED_EOI_WHILE_PARSING_SWITCH_GROUP,s,"Unexpected end of input while parsing [T_SWITCH_GROUP]."));continue}let o=e[i+1];if(!(o instanceof dr)){o.pushError(M.makeSyntaxError(v.TYPE_UNEXPECTED_TOKEN_FOR_SWITCH_GROUP,o,"Unexpected ["+W.getPrettyTypeName(o)+"] while parsing [T_SWITCH_GROUP]."));continue}let a=o;if(this.markAllNonVirtualAsSwitch([o]),a.scope==null||!(a.scope instanceof ke)){a.pushError(M.makeSyntaxError(v.TYPE_UNEXPECTED_SWITCH_START_VALUE,a,"Unexpected input while parsing [T_SWITCH_GROUP]."));continue}let l=a.scope;if(l.nodes.length==0||!(l.nodes[0]instanceof Ot)){a.pushError(M.makeSyntaxError(v.TYPE_UNEXPECTED_SWITCH_START_VALUE_NO_VALUE,a,"Unexpected input while parsing [T_SWITCH_GROUP]."));continue}let u=l.nodes[0];if(this.markAllNonVirtualAsSwitch([l]),u.nodes.length==0||!(u.nodes[0]instanceof ke)){s.pushError(M.makeSyntaxError(v.TYPE_UNEXPECTED_SWITCH_START_VALUE_NO_VALUE,s,"Unexpected input while parsing [T_SWITCH_GROUP]."));continue}this.markAllNonVirtualAsSwitch([s]),this.markAllNonVirtualAsSwitch(u.nodes);let c=u.nodes;if(a.nodes.length==0&&s.pushError(M.makeSyntaxError(v.TYPE_UNEXPECTED_SWITCH_START_VALUE_NO_VALUE,s,"Unexpected input while parsing [T_SWITCH_GROUP].")),!(l.nodes[0]instanceof Ot)){s.pushError(M.makeSyntaxError(v.TYPE_UNEXPECTED_SWITCH_START_VALUE_NO_VALUE,s,"Unexpected input while parsing [T_SWITCH_GROUP]."));continue}let m=l.nodes[0];this.markAllNonVirtualAsSwitch(m.nodes);let p=m.nodes,d=new Bs,_=new ke;_.nodes=c,_.startPosition=_.nodes[0].startPosition,_.endPosition=_.nodes[_.nodes.length-1].endPosition;let C=new Vo;C.condition=_;let h=new ke;h.nodes.push(p.shift()),h.startPosition=h.nodes[0].startPosition,h.endPosition=h.nodes[h.nodes.length-1].endPosition,C.expression=h,C.startPosition=C.condition.startPosition,C.endPosition=C.expression.nodes[C.expression.nodes.length-1].endPosition,p.shift(),d.cases.push(C);let b=p.length;if(b>0){if(!(p[0]instanceof ke)){s.pushError(M.makeSyntaxError(v.TYPE_PARSER_INVALID_SWITCH_TOKEN,s,"Invalid ["+W.getPrettyTypeName(p[0])+"] while parsing case statement."));continue}for(let g=0;g=r){s.pushError(M.makeSyntaxError(v.TYPE_ARR_MAKE_MISSING_TARGET,s,"Missing target variable for arr operator."));continue}let o=e[i+1];if(!(o instanceof ke)){o.pushError(M.makeSyntaxError(v.TYPE_ARR_MAKE_UNEXPECTED_TYPE,o,"Unexpected ["+W.getPrettyTypeName(o)+"] while parsing array."));continue}let a=o instanceof dr,l=o,u=l.nodes;if(u[0]instanceof Ot&&(u=u[0].nodes),a){let p=o;u.unshift(new In),u.unshift(p.scope)}let c=this.getArrayValues(u),f=new Oi;f.startPosition=s.startPosition;let m=c.values.length;m>0?f.endPosition=c.values[m-1].endPosition:f.endPosition=s.endPosition,l.end!=null&&(f.endPosition=l.end.endPosition),f.nodes=c.values,this.createdArrays.push(f),n.push(f),i+=1}else n.push(s);else n.push(s)}return n}getArrayValues(e){let n=new Fo,r=e.length,i=[];for(let s=0;s=r){a.pushError(M.makeSyntaxError(v.TYPE_ARR_MAKE_MISSING_ARR_KEY_PAIR_VALUE,a,"Missing key/pair value while parsing array."));continue}let l=e[s+2],u=new fl;if(this.isValidArrayKeyNode(o)==!1){o.pushError(M.makeSyntaxError(v.TYPE_ARR_KEY_PAIR_INVALID_KEY_TYPE,o,"Invalid ["+W.getPrettyTypeName(o)+"] type for key/value key."));continue}u.name=o,u.value=l,u.startPosition=o.startPosition,u.endPosition=l.endPosition,i.push(u),s+=3;continue}if(a==null||a instanceof Ct){let l=new fl;l.value=o,l.startPosition=o.startPosition,l.endPosition=o.endPosition,i.push(l),s+=1;continue}}return n.values=i,n}isValidArrayKeyNode(e){return e instanceof Lt||e instanceof bt}associateModifiers(e){let n=[],r=e.length,i=null;for(let s=0;s=r){o.pushError(M.makeSyntaxError(v.TYPE_UNEXPECTED_EOI_WHILE_PARSING_MODIFIER_DETAILS,o,"Unexpected end of input while preparing to gather modifier details."));continue}let l=this.scanToEndOfModifier(e.slice(s+1)),u=l.length;if(u>1&&l[1]instanceof It){this.isRealModifierSeparator.set(l[1],!0);let f=l[0];f instanceof Wn?l[0]=this.wrapArithmeticModifier(f,"add"):f instanceof Tn?l[0]=this.wrapArithmeticModifier(f,"subtract"):f instanceof Hn?l[0]=this.wrapArithmeticModifier(f,"divide"):f instanceof Yn?l[0]=this.wrapArithmeticModifier(f,"multiply"):f instanceof ai&&(l[0]=this.wrapArithmeticModifier(f,"mod"))}if(u==0){o.pushError(M.makeSyntaxError(v.TYPE_UNSET_MODIFIER_DETAILS,o,"Invalid or missing modifier details."));continue}if(!(l[0]instanceof jt)){o.pushError(M.makeSyntaxError(v.TYPE_MODIFIER_NAME_NOT_START_OF_DETAILS,o,"Invalid ["+W.getPrettyTypeName(l[0])+"]; expecting [T_MODIFIER_NAME]"));continue}let c=this.createModifier(l);c.nameNode!=null&&this.modifierNameMapping.set(c.nameNode,c),s+=u,i.modifierChain.modifierChain.push(c),i.modifierChain.updateValues();continue}else n.push(o)}return n}createNullCoalescenceGroups(e){let n=[],r=e.length;for(let i=0;i=r){s.pushError(M.makeSyntaxError(v.TYPE_UNEXPECTED_EOI_WHILE_PARSING_NULL_COALESCENCE_GROUP,s,"Unexpected end of input while parsing input text."));continue}let a=e[i+1],l=new ul;l.left=o,l.right=a,n.push(l),i+=1;continue}else n.push(s)}return n}isOperand(e){return e instanceof oe||e instanceof ke||e instanceof bt||e instanceof Lt||e instanceof Or||e instanceof ur||e instanceof Lr||e instanceof ns||e instanceof qs||e instanceof Fo||e instanceof Bs||e instanceof Oi}isProperMethodChainTargetStrict(e){return e instanceof ke||e instanceof bt||e instanceof Lt||e instanceof Or||e instanceof ur||e instanceof Lr||e instanceof ns||e instanceof qs||e instanceof Fo||e instanceof Bs||e instanceof Oi}assertOperandRight(e,n){if(n+1>e.length-1)return e[n].pushError(M.makeSyntaxError(v.TYPE_UNEXPECTED_END_OF_INPUT,e[n],"Unexpected end of input; expecting operand for operator "+W.getPrettyTypeName(e[n])+' near "'+_a.getNearText(e[n])+'".')),!1;let r=e[n+1];return this.isOperand(r)?!0:(r.pushError(M.makeSyntaxError(v.TYPE_EXPECTING_OPERAND,e[n],"Expecting operand, found "+W.getPrettyTypeName(r)+' near "'+_a.getNearText(e[n])+'".')),!1)}resolveValueRight(e,n){let r=null,i=0,s=null;if(e.length>0){let o=!0;for(;o;){let a=e[n];if(a instanceof on){s=a,i+=1,n+=1,o=!1;continue}else if(this.isOperand(a)){r=a,o=!1;break}else{o=!1;break}}}if(i%2!=0){let o=new ke;return o.nodes=[],s!=null&&r!=null&&(o.nodes.push(s),o.nodes.push(r)),{value:o,negationCount:i}}return{value:r,negationCount:i}}correctTypes(e){let n=[];return e.forEach(r=>{if(r instanceof Pn){let i=new It;i.startPosition=r.startPosition,i.endPosition=r.endPosition,i.originalAbstractNode=r,n.push(i)}else if(r instanceof Ut){let i=new oe;i.name=r.value,i.startPosition=r.startPosition,i.endPosition=r.endPosition,i.modifierChain=r.modifierChain,i.originalAbstractNode=r,this.createdVariables.push(i),n.push(i)}else n.push(r)}),n}createTernaryGroups(e){var i,s,o,a;let n=[],r=e.length;for(let l=0;l=r){u.pushError(M.makeSyntaxError(v.TYPE_UNEXPECTED_EOI_WHILE_PARSING_TERNARY_GROUP,u,"Unexpected end of input while parsing ternary group."));continue}let d=e.slice(l+1,p);if(d.length>1||d.length==0){u.pushError(M.makeSyntaxError(v.TYPE_TERNARY_UNEXPECTED_EXPRESSION_LENGTH,u,"Unexpected number of operations within ternary truth branch."));continue}let _=d[0],C=((o=c.foundAt)!=null?o:0)+1;if(C>=r){u.pushError(M.makeSyntaxError(v.TYPE_UNEXPECTED_EOI_WHILE_PARSING_TERNARY_GROUP_FALSE_BRANCH,u,"Unexpected end of input while parsing ternary false execution branch."));continue}let h=e[C],b=new cl;b.head=m,b.truthBranch=_,b.falseBranch=h,n.push(b),l=((a=c.foundAt)!=null?a:0)+1;continue}else n.push(u)}return n}groupNodesByType(e,n){let r=[],i=e.length;for(let s=0;s0&&o instanceof n){let a=[],l=r.pop();if(a.push(l),!this.assertOperandRight(e,s))continue;if(s+1>=i){o.pushError(M.makeSyntaxError(v.TYPE_UNEXPECTED_EOI_WHILE_REDUCING_NEGATION_OPERATORS,o,"Unexpected end of input while parsing input text."));continue}let u=e[s+1];typeof u!="undefined"&&(u.isVirtualGroupMember=!0),typeof l!="undefined"&&(l.isVirtualGroupMember=!0),o.isVirtualGroupMember=!0;let c=new ke;c.nodes=a,c.nodes.push(o),c.nodes.push(u),s+=1,r.push(c);continue}else r.push(o)}return r}flagNodeAsOperatorResolve(e){if(e instanceof ke){if(e.nodes.length==0)return;this.flagNodeAsOperatorResolve(e.nodes[e.nodes.length-1])}e.isVirtualGroupOperatorResolve=!0,e.next instanceof sn||(e.producesVirtualStatementTerminator=!0)}groupNodesByOperatorType(e){let n=[],r=e.length;for(let i=0;i0&&Rt.isOperatorType(s)){let o=[],a=n.pop();if(o.push(a),!this.assertOperandRight(e,i))continue;if(i+1>=r){s.pushError(M.makeSyntaxError(v.TYPE_UNEXPECTED_EOI_WHILE_REDUCING_NEGATION_OPERATORS,s,"Unexpected end of input while parsing input text."));continue}let l=e[i+1];this.flagNodeAsOperatorResolve(l),Rt.isAssignmentOperator(s)&&this.tracedAssignments.push(new ad(a,l,s)),typeof a!="undefined"&&(a.isVirtualGroupMember=!0),typeof l!="undefined"&&(l.isVirtualGroupMember=!0),s.isVirtualGroupMember=!0;let u=new ke;u.nodes=o,u.nodes.push(s),u.nodes.push(l),i+=1,n.push(u);continue}else n.push(s)}return n}applyOperationOrder(e){return e=this.groupNodesByType(e,oi),e=this.groupNodesByType(e,Yn),e=this.groupNodesByType(e,Hn),e=this.groupNodesByType(e,Wn),e=this.groupNodesByType(e,Tn),e}createLogicGroupsToRemoveMethodInvocationAmbiguity(e){let n=[],r=e.length,i=r-1;for(let s=0;s0&&e[0]instanceof ke){let o=this.unpack(e[0].nodes),a=this.makeArgGroup(o),l=new Mo;if(l.nameNode=n,l.methodStyleArguments=a,e.length>1)for(let u=1;u=i)return e[o].pushError(M.makeSyntaxError(v.TYPE_MODIFIER_UNEXPECTED_END_OF_VALUE_LIST,e[o],"Unexpected end of modifier value list while parsing modifier.")),e;let a=e[o+1];if(this.isValidModifierValue(a)){if(a instanceof oe)if(a.variableReference!=null&&a.variableReference.pathParts.length>0)a.variableReference.pathParts.forEach(l=>{if(l instanceof Un){let u=new Ut;u.startPosition=l.startPosition,u.endPosition=l.endPosition,u.value=l.name,u.name=l.name,u.originalAbstractNode=l,u.endPosition==null&&u.startPosition==null&&(u.startPosition=a.startPosition,u.endPosition=a.endPosition),r.push(u)}});else{let l=new Ut;l.startPosition=a.startPosition,l.endPosition=a.endPosition,l.value=a.name,l.name=a.name,l.originalAbstractNode=a,r.push(l)}else r.push(a);o+=1;continue}else return a.pushError(M.makeSyntaxError(v.TYPE_MODIFIER_UNEXPECTED_VALUE,a,"Unexpected ["+W.getPrettyTypeName(a)+"] while parsing modifier value.")),e}let s=new Mo;return s.nameNode=n,s.valueNodes=r,s.startPosition=s.nameNode.startPosition,s.valueNodes.length>0?s.endPosition=s.valueNodes[s.valueNodes.length-1].endPosition:s.endPosition=s.nameNode.endPosition,s}scanToEndOfModifier(e){let n=[],r=e.length;for(let i=0;i1)break}if(s instanceof bt||s instanceof oe||s instanceof Lt){let o=n.length;if(o>0&&n[o-1]instanceof ke)break}if(s instanceof vn||s instanceof Bt||s instanceof zt||s instanceof Nn||s instanceof cr||s instanceof Ei||s instanceof Vr||s instanceof qr||s instanceof Br||s instanceof jr||s instanceof Ur||s instanceof Gr||s instanceof fr||s instanceof Yr||s instanceof ui||s instanceof pr||s instanceof ci||s instanceof Wr||s instanceof ns||s instanceof Xt||s instanceof on)break;n.push(s)}return n}static isAssignmentOperatorNode(e){return e instanceof Dr||e instanceof kr||e instanceof Kn||e instanceof Mr||e instanceof Fr||e instanceof Tn}insertAutomaticStatementSeparators(e){let n=e.length,r=[];for(let i=0;i=r){let o=new Ot;o.nodes=i,n.push(o);break}return n}findLogicalGroupEnd(e,n){let r=[],i=n.length,s=null,o=0,a=0;for(a;a=i)return c.pushError(M.makeSyntaxError(v.TYPE_UNEXPECTED_EOI_WHILE_PARSING_LOGIC_GROUP_END,c,"Unexpected end of input while parsing input text.")),{found:!1,logicalGroup:null,skipCount:o};let f=this.findLogicalGroupEnd(c,n.slice(a+1));if(f.found){f.logicalGroup!=null&&r.push(f.logicalGroup),o+=f.skipCount,a+=f.skipCount;continue}else continue}else r.push(c)}if(s==null)return e.pushError(M.makeSyntaxError(v.TYPE_LOGIC_GROUP_NO_END,e,"Unexpected end of input while parsing logic group.")),{found:!1,logicalGroup:null,skipCount:o};let l=new Rt;l.setIsRoot(!1);let u=new ke;if(r.length>=2&&r[1]instanceof In){if(u=new dr,u.scopeOperator=r[1],a+2=0&&!Rt.isAssignmentOperator(e[i]);i--){let s=e.pop();r.push(s)}if(r=r.reverse(),r.length>=3){let i=new Rt;return i.setIsRoot(!1),{collectedTokens:this.unpack(i.parse(r)),tokens:e}}return{collectedTokens:r,tokens:e}}seek(e,n){for(let r=n;r=0;s--){let o=n[s];if(G.ctypeSpace(o)&&(i=!0),i&&(G.ctypeAlpha(o)||G.ctypeDigit(o)))return null;if(G.ctypePunct(o))return o}return null}static findLeftNeighboringNextAlphaNumeric(e,n,r=4){n=n.replace(" "," ".repeat(r));let i=!1;for(let s=e-1;s>=0;s--){let o=n[s];if((G.ctypeSpace(o)||G.ctypePunct(o)&&o!=E.Punctuation_Underscore)&&(i=!0),i&&(G.ctypeAlpha(o)||G.ctypeDigit(o)))return s+1}return null}static scanWordAt(e,n,r=4){if(n=n.replace(" "," ".repeat(r)),e<0||e>n.length)return null;let i=[],s=[];for(let o=e-1;o>=0;o--){let a=n[o];if(G.ctypePunct(a)&&a!=E.Punctuation_Underscore||G.ctypeSpace(a))break;i.push(a)}for(let o=e;o{var l,u,c,f;a.isModifierParameter=(u=(l=we.instance)==null?void 0:l.hasModifier(a.name))!=null?u:!1,a.isModifierParameter&&(e.modifiers.parameterModifiers.push(a),a.modifier=(f=(c=we.instance)==null?void 0:c.getModifier(a.name))!=null?f:null,e.modifiers.modifierNames.includes(a.name)==!1&&e.modifiers.modifierNames.push(a.name))}),e.modifierChain!=null&&e.modifierChain.modifierChain.length>0){let a=null;e.modifierChain.modifierChain.forEach(l=>{var u,c;l.nameNode!=null&&(l.modifier=(c=(u=we.instance)==null?void 0:u.getModifier(l.nameNode.content))!=null?c:null,e.modifiers.modifierNames.includes(l.nameNode.content)==!1&&e.modifiers.modifierNames.push(l.nameNode.content),l.modifier!=null&&(a=l.modifier,e.modifierChain!=null&&(e.modifierChain.lastManifestedModifier=l)))}),e.modifierChain.lastModifier=a,e.modifiers.parameterModifiers.length>0&&(e.modifiers.hasMixedModifierStyles=!0)}e.runtimeNodes.length>0&&e.runtimeNodes.forEach(a=>{if(a.modifierChain!=null&&a.modifierChain.modifierChain.length>0){let l=null;a.modifierChain.modifierChain.forEach(u=>{var c,f;u.nameNode!=null&&(u.modifier=(f=(c=we.instance)==null?void 0:c.getModifier(u.nameNode.content))!=null?f:null,e.modifiers.modifierNames.includes(u.nameNode.content)==!1&&e.modifiers.modifierNames.push(u.nameNode.content),u.modifier!=null&&(l=u.modifier,e.modifierChain!=null&&(e.modifierChain.lastManifestedModifier=u)))}),e.modifierChain!=null&&(e.modifierChain.lastModifier=l),e.modifiers.parameterModifiers.length>0&&(e.modifiers.hasMixedModifierStyles=!0)}});let n=e.modifiers.getLastManifestedModifier();if(n!=null)if(n.name=="macro"){let a=e.modifiers.getLastManifestedModifierValue();e.manifestType=(i=(r=we.instance)==null?void 0:r.getMacroManifestingType(a))!=null?i:""}else e.manifestType=(o=(s=we.instance)==null?void 0:s.getProbableReturnType(n,e.isPaired()))!=null?o:""}};var XN={warnUnknownParameters:!1};var tm=class{static validateInteger(e){return parseInt(e).toString()!==e?{isValid:!1,message:'"'+e+'" is not a valid integer.'}:{isValid:!0,message:""}}static validateBoolean(e){return e=="true"||e=="false"?{isValid:!0,message:""}:{isValid:!1,message:'"'+e+'" is not a valid value. Expecting true/false.'}}static validateParameters(e){var n,r,i,s,o;if(e.isTagNode&&((n=Ie.instance)==null?void 0:n.isKnownTag(e.runtimeName()))){let a=(r=Ie.instance)==null?void 0:r.findTag(e.runtimeName());if(e.hasParameters)for(let l=0;l1&&(p=". Try one of the following: "+_.join(", "))}let d='Unknown parameter name: "'+m+'"'+p;e.pushError(M.makeSyntaxError(v.LINT_UNKNOWN_PARAMETER,e,d,1))}}else if(c.validate!=null){let p=c.validate(e,u);p.length>0&&p.forEach(d=>{e.pushError(M.makeSyntaxError(v.LINT_GENERAL_INVALID_PARAMETER_CONTENTS,u,d.message,1))})}else{if(u.hasInterpolations())continue;for(let p=0;pe.index)return i}return null}getContentSubstring(e,n){return this.content.substr(e,n)}resetState(){return this.fragments=[],this.inputLen=0,this.fragmentStartIndex=[],this.fragmentOpeningIndex.clear(),this}resetIntermediateState(){this.chars=[],this.charLen=0,this.currentIndex=0,this.seedOffset=0,this.cur=null,this.next=null,this.prev=null}positionFromOffset(e,n,r=!1){let i=0,s=0;if(this.documentOffsets.has(e)){let a=this.documentOffsets.get(e);i=a.line,s=a.char}else if(this.documentOffsets.size==0)i=1,s=e+1;else{let a=null,l=null,u=null,c=null;for(let f of this.documentOffsets.keys()){if(f>=e){c!=null&&e>c?(a=u,l=c):(a=this.documentOffsets.get(f),l=f);break}u=this.documentOffsets.get(f),c=f}a==null&&(a=u,l=c),a!=null?(s=e-(l!=null?l:0),i=a.line,e<=(l!=null?l:0)?(i=a.line,s=e+1):i=a.line+1):this.lastDocumentOffsetKey!=null&&(i=this.documentOffsets.get(this.lastDocumentOffsetKey).line+1,s=e+this.lastDocumentOffsetKey)}let o=new qt;return o.index=n,o.offset=e,o.line=i+this.shiftLine,o.char=s,o}getFragments(){return this.fragments}getFragmentsBetween(e,n){let r=[];return this.fragments.forEach(i=>{var a,l,u,c;let s=(l=(a=i.startPosition)==null?void 0:a.index)!=null?l:0,o=(c=(u=i.endPosition)==null?void 0:u.index)!=null?c:0;s>e&&oe.index)return a}return null}checkCurrentOffsets(){if(this.currentIndex>this.chars.length){this.cur=null,this.prev=null,this.next=null;return}if(this.cur=this.chars[this.currentIndex],this.prev=null,this.next=null,this.currentIndex>0&&(this.prev=this.chars[this.currentIndex-1]),this.currentIndex+1{this.chars.push(r),this.charLen+=1})}e&&this.currentIndex+1{var o;let s=(o=i.index)!=null?o:0;for(let a=0;a=l.start&&s<=l.end)return}r.push(s)}),this.fragmentStartIndex=r}setIndexRanges(e){return this.nodeIndex=e,this}fetchAt(e,n){return this.content.substr(e,n)}getFragmentsContainingStructures(){let e=[];return this.fragments.forEach(n=>{let r=n.name.toLowerCase();if(!(r!="script"&&r!="style")&&!n.isClosingFragment&&!n.isSelfClosing&&n.containsStructures){let i=this.getClosingFragmentAfter(n);i!=null&&e.push({start:n,end:i})}}),e}parse(e){if(this.resetState().processInputText(e),this.fragmentStartIndex.length==0)return[];for(let s=0;s{let o=s.name.toLowerCase();(o=="script"||o=="style")&&(s.embeddedIndex=i,this.embeddedIndexedFragments.set(i,s),i+=1),s.index=r,this.indexedFragments.set(r,s),r+=1}),this.fragments}getFragment(e){return this.indexedFragments.get(e)}getEmbeddedFragment(e){return this.embeddedIndexedFragments.has(e)?this.embeddedIndexedFragments.get(e):null}hasFragments(){return this.fragments.length>0}skipToEndOfPhp(){for(this.currentIndex;this.currentIndex0&&this.cur==E.Punctuation_LessThan||this.next==null&&this.cur!=E.Punctuation_GreaterThan)break;if(!i&&this.cur==E.Punctuation_LessThan&&this.next==E.Punctuation_ForwardSlash&&(s=!0),!i&&this.cur!=E.Punctuation_LessThan&&this.cur!=E.Punctuation_ForwardSlash&&this.cur!=E.Punctuation_GreaterThan&&r.push(this.cur),nm(this.cur)){let o=this.currentIndex;rm(this);let a=new ed;a.startPosition=this.positionFromOffset(o+this.seedOffset,o+this.seedOffset),a.endPosition=this.positionFromOffset(this.currentIndex+this.seedOffset,this.currentIndex+this.seedOffset),n.push(a);continue}if(this.cur==E.Punctuation_ForwardSlash&&this.next==E.Punctuation_GreaterThan){let o=new Bu;o.startPosition=this.positionFromOffset(e+this.seedOffset,e+this.seedOffset),o.endPosition=this.positionFromOffset(this.currentIndex+this.seedOffset+1,this.currentIndex+this.seedOffset+1),o.parameters=n,o.isSelfClosing=!0,o.name=r.join(""),o.isClosingFragment=s,this.fragments.push(o),s?this.fragmentOpeningIndex.set(o.startPosition.index+1,1):this.fragmentOpeningIndex.set(o.startPosition.index,1);break}if(this.cur==E.Punctuation_GreaterThan){let o=new Bu;o.startPosition=this.positionFromOffset(e+this.seedOffset,e+this.seedOffset),o.endPosition=this.positionFromOffset(this.currentIndex+this.seedOffset,this.currentIndex+this.seedOffset),o.parameters=n,o.name=r.join(""),o.isClosingFragment=s,this.fragments.push(o),s?this.fragmentOpeningIndex.set(o.startPosition.index+1,1):this.fragmentOpeningIndex.set(o.startPosition.index,1),o.name.toLowerCase()=="script"&&o.isClosingFragment==!1&&(this.isScript=!0);break}}}};var sm=class{constructor(e,n){this.documentParser=e,this.fragmentsParser=n}doesContainFragments(e){var i,s,o,a,l;let n=(s=(i=e.endPosition)==null?void 0:i.index)!=null?s:0,r=(l=(a=(o=e.isClosedBy)==null?void 0:o.startPosition)==null?void 0:a.index)!=null?l:0;return this.fragmentsParser.getFragmentsBetween(n,r).length>0}analyze(){let e=this.documentParser.getNodes();!this.fragmentsParser.hasFragments()||(this.fragmentsParser.getFragments().forEach(n=>{let r=n.name.toLowerCase();if(n.isClosingFragment==!1&&n.isSelfClosing==!1&&(r=="script"||r=="style")){let i=this.fragmentsParser.getClosingFragmentAfter(n);if(i==null)return;n.endPosition!=null&&i.startPosition!=null&&this.documentParser.getNodesBetween(n.endPosition,i.startPosition).forEach(o=>{(o instanceof vt||o instanceof B&&o.isClosedBy!=null)&&(n.containsStructures=!0),r=="style"?o.isInStyleTag=!0:o.isInScriptTag=!0})}}),e.forEach(n=>{var o,a,l,u,c,f;if(n instanceof Qe||n.startPosition==null)return;n instanceof B&&($t.isConditionalStructure(n)||!n.isClosingTag)&&n.isClosedBy!=null&&(n.containsAnyFragments=this.doesContainFragments(n));let r=this.fragmentsParser.getFragmentContaining(n.startPosition);if(r==null)return;if(n.fragment=r,n.startPosition.index-((a=(o=r.startPosition)==null?void 0:o.index)!=null?a:0)<=3){n.fragmentPosition=0;return}if(r.parameters.length==0){n.fragmentPosition=2;return}let s=!1;for(let m=0;mn.startPosition.index){n.fragmentPosition=1,s=!0;break}}s||(n.fragmentPosition=2)}))}};var om=class{static analyze(e){e.forEach(n=>{var r,i,s,o;if(n instanceof B){if(n.prev instanceof B&&n.isPaired()&&n.prev.isInlineAntlers==!0){n.isInlineAntlers=!1,n.isClosedBy!=null&&(n.isClosedBy.isInlineAntlers=!1);return}let a=!1,l=!1;if(n.next==null)a=!0;else if(n.next instanceof Qe){let u=G.getFirstLine(n.next.content);(n.next.next==null&&u.trim().length==0||G.trimLeft(u," ").startsWith(` `)==!1&&u.trim().length>0||n.next.next instanceof rn||n.next.next instanceof B&&(n.next.next.isPaired()==!1||((i=(r=n.next.next.startPosition)==null?void 0:r.line)!=null?i:0)!=((o=(s=n.startPosition)==null?void 0:s.line)!=null?o:0)))&&(a=!0)}else n.next instanceof B&&n.next.isPaired()&&(a=!0);if(n.prev==null)l=!0;else if(n.prev instanceof Qe){let u=G.getLastLine(n.prev.content);G.trimRight(u," ").endsWith(` -`)==!1&&u.trim().length>0||n.prev.prev instanceof rn?l=!0:n.prev.prev instanceof B&&(n.prev.prev.isInlineAntlers?l=!0:n.prev.prev.isClosingTag&&n.prev.prev.isOpenedBy!=null&&(n.prev.prev.isOpenedBy instanceof rn||n.prev.prev.runtimeName()=="noparse")&&(n.prev.prev.isInlineAntlers=!0,l=!0))}else n.prev instanceof B&&n.prev.isPaired()&&(l=!0);n.isInlineAntlers=a&&l}})}};var xe=class{constructor(){this.interpolationRegions=new Map;this.nodeParser=new zd;this.chars=[];this.charLen=0;this.lastAntlersNode=null;this.content="";this.originalContent="";this.currentIndex=0;this.currentContent=[];this.sourceContent=[];this.startIndex=0;this._recoveryStartIndex=0;this.cur=null;this.next=null;this.prev=null;this.nodes=[];this.renderNodes=[];this.isInterpolatedParser=!1;this.inputLen=0;this.documentOffsets=new Map;this.lineIndex=new Map;this.lastDocumentOffsetKey=null;this.isDoubleBrace=!1;this.interpolationEndOffsets=new Map;this.isScanningInterpolations=!1;this.seedStartLine=1;this.seedStartchar=1;this.frontMatterEndLine=-1;this.lastAntlersEndIndex=-1;this.seedOffset=0;this.antlersStartIndex=[];this.antlersStartPositionIndex=new Map;this.chunkSize=5;this.maxLine=1;this.currentChunkOffset=0;this.isNoParse=!1;this.antlersErrors=[];this.languageParser=new Rt;this.documentPath=null;this.pushedErrors=new Map;this.frontMatter="";this.shiftLine=0;this.doesHaveUncloseIfStructures=!1;this.doesHaveUnclosedStructures=!1;this.parseChildDocuments=!1;this.structure=new Zd(this);this.fragmentsParser=new im,this.fragmentsAnalyzer=new sm(this,this.fragmentsParser)}withChildDocuments(e){return this.parseChildDocuments=e,this}shouldParseChildDocument(){return this.parseChildDocuments}hasUnclosedIfStructures(){return this.doesHaveUncloseIfStructures}hasUnclosedStructures(){return this.doesHaveUnclosedStructures}getFrontMatter(){return this.frontMatter}setDocumentPath(e){this.documentPath=e}getFrontMatterEndLine(){return this.frontMatterEndLine}pushError(e){(e.errorCode==P.TYPE_PARSE_UNCLOSED_CONDITIONAL||e.errorCode==P.TYPE_PARSE_UNPAIRED_CONDITIONAL)&&(this.doesHaveUncloseIfStructures=!0);let n=e.hash();this.pushedErrors.has(n)||(this.pushedErrors.set(n,e),this.antlersErrors.push(e))}getInterpolationRegions(){return this.interpolationRegions}getDocumentPath(){return this.documentPath}checkCurrentOffsets(){if(this.currentIndex>this.chars.length){this.cur=null,this.prev=null,this.next=null;return}if(this.cur=this.chars[this.currentIndex],this.prev=null,this.next=null,this.currentIndex>0&&(this.prev=this.chars[this.currentIndex-1]),this.currentIndex+1{this.chars.push(r),this.charLen+=1})}e&&this.currentIndex+10&&!this.isNoParse){let V=new Qe;if(V.withParser(this),V.content=this.prepareLiteralContent(this.content.substr(0,N)),V.content.length>0){V.startPosition=this.positionFromOffset(0,0),V.endPosition=this.positionFromOffset(N,N-1);let O=(u=V.startPosition.index)!=null?u:0,$=V.endPosition.index+1;V.sourceContent=this.content.substr(O,$-O),this.nodes.push(V)}}if(Nthis.lastAntlersNode.endPosition.offset){O=$;break}if(O==null){let $=this.prepareLiteralContent(this.content.substr(this.lastAntlersNode.endPosition.offset+1));if($.length>0&&!this.isNoParse){let X=new Qe;X.withParser(this),X.content=$;let ee=this.lastAntlersNode.endPosition.offset+1;X.startPosition=this.positionFromOffset(ee,ee),X.endPosition=this.positionFromOffset(this.inputLen,this.inputLen);let Y=(c=X.startPosition.index)!=null?c:0,ne=X.endPosition.index+1;X.sourceContent=this.content.substr(Y,ne-Y),this.nodes.push(X)}break}else{let $=this.antlersStartIndex[O],X=$-this.lastAntlersNode.endPosition.offset-1;if(X>0){let ee=this.lastAntlersNode.endPosition.offset,Y=$-1;ee+=1,Y-=1;let ne=this.content.substr(ee,X);if(ne.length>0&&!this.isNoParse){let Le=new Qe;Le.withParser(this),Le.content=ne,Le.startPosition=this.positionFromOffset(ee,ee),Le.endPosition=this.positionFromOffset(Y,Y);let de=(f=Le.startPosition.index)!=null?f:0,Z=Le.endPosition.index+1;Le.sourceContent=this.content.substr(de,Z-de),this.nodes.push(Le)}continue}g=O-1;continue}}}let S=!1;if(this.antlersStartPositionIndex.has(this.currentChunkOffset)?this.lastAntlersEndIndexV)g+20){ee.startPosition=this.positionFromOffset($,$),ee.endPosition=this.positionFromOffset(V,V-1);let Y=(m=ee.startPosition.index)!=null?m:0,ne=ee.endPosition.index+1;ee.sourceContent=this.content.substr(Y,ne-Y),this.nodes.push(ee)}break}else{let $=V-this.lastAntlersEndIndex-1;if($==0||this.isNoParse)continue;let ee=this.currentChunkOffset;this.lastAntlersNode instanceof ol&&(O=((p=(d=this.lastAntlersNode.endPosition)==null?void 0:d.offset)!=null?p:0)+1,$-=((C=(_=this.lastAntlersNode.endPosition)==null?void 0:_.offset)!=null?C:0)+1,ee=O),this.lastAntlersNode instanceof Fs&&(O-=1,$+=1);let Y=this.content.substr(O,$),ne=new Qe;if(ne.withParser(this),ne.content=this.prepareLiteralContent(Y),ne.content.length>0){ne.startPosition=this.positionFromOffset(O,O),ne.endPosition=this.positionFromOffset(V,V-1);let Le=(h=ne.startPosition.index)!=null?h:0,de=ne.endPosition.index+1;ne.sourceContent=this.content.substr(Le,de-Le),this.nodes.push(ne)}}continue}if(g!==r&&this.lastAntlersNode!=null&&this.lastAntlersNode.endPosition!=null&&this.positionFromOffset(N,N).isBefore(this.lastAntlersNode.endPosition)){if(g+10){O.startPosition=this.positionFromOffset(V,V),O.endPosition=this.positionFromOffset(this.inputLen-1,this.inputLen-1);let $=(b=O.startPosition.index)!=null?b:0,X=O.endPosition.index+1;O.sourceContent=this.content.substr($,X-$),this.nodes.push(O)}break}}}}let i=0;this.nodes.forEach(g=>{g.index=i,i+=1}),this.nodes.length>500&&(this.parseChildDocuments=!1),this.nodes.forEach(g=>{g instanceof B&&g.isComment||g instanceof B&&g.interpolationRegions.size>0&&(g.interpolationRegions.forEach((N,S)=>{let V=new xe;V.withChildDocuments(this.parseChildDocuments),V.setIsInterpolatedParser(!0);let O=V.parse(N.parseContent);O.length>1&&O[1]instanceof B&&(O=[O[1]]),V.hasUnclosedIfStructures()&&(this.doesHaveUncloseIfStructures=!0),V.hasUnclosedStructures()&&(this.doesHaveUnclosedStructures=!0),g.processedInterpolationRegions.set(S,O),this.mergeErrors(V.getAntlersErrors())}),g.hasProcessedInterpolationRegions=!0)}),this.content.length>0&&this.fragmentsParser.setIndexRanges(this.getNodeIndexRanges()).parse(this.content);let s=new ga;this.renderNodes=s.associate(this.nodes,this),this.createChildDocuments(this.renderNodes);let o=null,a=null;for(let g=0;g{if(g instanceof B&&g.isClosedBy!=null){let N=g.getImmediateChildren();for(let S=0;S{if(g instanceof B&&g.isClosingTag&&g.isOpenedBy==null){let N="Unpaired closing tag.";g.isInterpolationNode&&(N+=" Tag pairs are not supported within Antlers tags."),g.pushError(M.makeSyntaxError(P.TYPE_UNPAIRED_CLOSING_TAG,g,N))}}),Jd.associateRecursiveParent(this.nodes),this.nodes.forEach(g=>{var N;if(!(g instanceof B&&g.isComment)&&((g instanceof B||g instanceof ft)&&(g.isInterpolationNode=this.isInterpolatedParser),(g instanceof B||g instanceof ft)&&g.interpolationRegions.size>0&&g.runtimeNodes.forEach(S=>{S instanceof oe&&g.interpolationRegions.has(S.name)&&(S.isInterpolationReference=!0,S.interpolationNodes=g.processedInterpolationRegions.get(S.name))}),(g instanceof B||g instanceof ft)&&g.hasParameters&&g.interpolationRegions.size>0&&g.parameters.forEach(S=>{g.interpolationRegions.forEach((V,O)=>{S.value.includes(O)&&S.interpolations.push(O)})}),g instanceof B&&g.runtimeNodes.length>0&&g.isClosingTag==!1&&!g.isComment&&(g.parsedRuntimeNodes=this.languageParser.parse(g.runtimeNodes),g.hasParsedRuntimeNodes=!0,!g.isTagNode&&g.parsedRuntimeNodes.length>0))){let S=g.nodeAtIndex(0);S!=null&&S instanceof oe&&S.name==((N=g.name)==null?void 0:N.name)&&(g.modifierChain=S.modifierChain)}}),this.languageParser.getCreatedModifierChains().forEach(g=>{g.modifierChain.length>0&&g.modifierChain.forEach(N=>{var S,V;N.nameNode!=null&&Me.instance!=null&&Me.instance.hasModifier((S=N.nameNode)==null?void 0:S.name)&&(N.modifier=(V=Me.instance)==null?void 0:V.getModifier(N.nameNode.name))})});let l=1;return this.nodes.forEach(g=>{var N,S;if(g instanceof B){if(g.isComment)return;g.isTagNode=(S=(N=Ie.instance)==null?void 0:N.isKnownTag(g.runtimeName()))!=null?S:!1,g.scopeName=g.findParameterValue("scope",""),g.antlersNodeIndex=l,l+=1,em.analyzeModifierNodeParameters(g),tm.validateParameters(g)}}),this.nodes.forEach(g=>{var N,S,V,O,$,X,ee,Y;if(g instanceof B&&g.isClosedBy!=null){let ne=((S=(N=g.endPosition)==null?void 0:N.offset)!=null?S:0)+1,Le=(O=(V=g.isClosedBy.startPosition)==null?void 0:V.offset)!=null?O:0,de=(X=($=g.startPosition)==null?void 0:$.offset)!=null?X:0,Z=((Y=(ee=g.isClosedBy.endPosition)==null?void 0:ee.offset)!=null?Y:0)+1;g.documentText=this.content.substr(ne,Le-ne),g.nodeContent=this.content.substr(de,Z-de),this.parseChildDocuments&&(g.childDocument=mt.childFromText(g.documentText,bl(g.children)))}}),this.renderNodes}createChildDocuments(e){e.forEach(n=>{var r,i,s,o,a,l,u,c;if(n instanceof B&&n.isClosedBy!=null){let f=n.isClosedBy,m=((i=(r=n.startPosition)==null?void 0:r.index)!=null?i:0)-1,d=((o=(s=f.endPosition)==null?void 0:s.index)!=null?o:0)-m;if(n.documentText=this.content.substr(m,d),this.parseChildDocuments){let p=(l=(a=n.endPosition)==null?void 0:a.index)!=null?l:0,_=((c=(u=f.startPosition)==null?void 0:u.index)!=null?c:0)-1-p,C=this.content.substr(p,_);n.childDocument=mt.childFromText(C,bl(n.getChildren()))}}})}getNodeIndexRanges(){let e=[];return this.nodes.forEach(n=>{var r,i,s,o;n instanceof Qe||e.push({start:(i=(r=n.startPosition)==null?void 0:r.index)!=null?i:0,end:(o=(s=n.endPosition)==null?void 0:s.index)!=null?o:0})}),e}positionFromOffset(e,n,r=!1){let i=0,s=0;if(this.documentOffsets.has(e)){let a=this.documentOffsets.get(e);i=a.line,s=a.char}else if(this.documentOffsets.size==0)i=1,s=e+1;else{let a=null,l=null,u=null,c=null;for(let f of this.documentOffsets.keys()){if(f>=e){c!=null&&e>c?(a=u,l=c):(a=this.documentOffsets.get(f),l=f);break}u=this.documentOffsets.get(f),c=f}if(a==null&&(a=u,l=c),a!=null)if(r){let f=this.content.split(""),m=e-(l!=null?l:0),d=a.char-(l!=null?l:0)+e;s=m,i=a.line,e<=(l!=null?l:0)?(i=a.line,s=e+1):i=a.line+1}else{let f=this.content.split(""),m=e-(l!=null?l:0),d=a.char-(l!=null?l:0)+e;s=m,i=a.line,e<=(l!=null?l:0)?(i=a.line,s=e+1):i=a.line+1}else this.lastDocumentOffsetKey!=null&&(i=this.documentOffsets.get(this.lastDocumentOffsetKey).line+1,s=e+this.lastDocumentOffsetKey)}let o=new qt;return o.index=n,o.offset=e,o.line=i+this.shiftLine,o.char=s,o}getLanguageParser(){return this.languageParser}getText(e,n){return this.content.substr(e,n-e)}getOriginalContent(){return this.originalContent}getContent(){return this.content}getFragments(){return this.fragmentsParser.getFragments()}getFragmentsParser(){return this.fragmentsParser}getFragmentsContainingStructures(){return this.fragmentsParser.getFragmentsContainingStructures()}setIsInterpolatedParser(e){return this.isInterpolatedParser=e,this}setStartLineSeed(e){return this.seedStartLine=e,this}setSeedStartChar(e){return this.seedStartchar=e,this}resetIntermediateState(){this.chars=[],this.charLen=0,this.currentIndex=0,this.currentContent=[],this.sourceContent=[],this.cur=null,this.next=null,this.prev=null}setSeedPosition(e){return e==null?this.shiftLine=0:this.shiftLine=e.line,this}resetState(){if(this.languageParser.reset(),this.charLen=0,this.antlersStartIndex=[],this.antlersErrors=[],this.pushedErrors.clear(),this.antlersStartPositionIndex.clear(),this.lastAntlersEndIndex=-1,this.renderNodes=[],this.nodes=[],ms.globalTagEnterStack.length>0){let e=ms.globalTagEnterStack[ms.length-1];e!=null&&e.endPosition!=null&&this.setStartLineSeed(e.endPosition.line)}this.seedOffset=0,this.isScanningInterpolations=!1,this.content="",this.chars=[],this.currentIndex=0,this.startIndex=0,this._recoveryStartIndex=0,this.cur=null,this.next=null,this.prev=null,this.inputLen=0,this.documentOffsets.clear(),this.isDoubleBrace=!1,this.interpolationRegions.clear(),this.interpolationEndOffsets.clear()}fetch(e){let n=this.currentChunkOffset+this.chunkSize-this.chars.length;return G.substring(this.content,n,e)}getParsedContent(){return this.content}peek(e){if(e==this.charLen){let n=G.split(G.substring(this.content,this.currentChunkOffset+this.chunkSize,this.chunkSize));this.currentChunkOffset+=this.chunkSize,n.forEach(r=>{this.chars.push(r),this.charLen+=1})}return this.chars[e]}parseIntermediateText(){for(this.currentContent=[],this.sourceContent=[],this.startIndex=0,this.chars=this.content.substr(this.currentChunkOffset,this.chunkSize).split(""),this.charLen=this.chars.length,this.currentIndex=0;this.currentIndex=this.inputLen){this.appendContent(this.next),this.dumpLiteralNode(this.currentIndex+1);break}let e=0;for(let n=this.currentIndex+1;n0&&this.dumpLiteralNode(this.currentIndex)}}getRenderNodes(){return this.renderNodes}processInputText(e){var f;if(this.originalContent=e,this.content=G.normalizeLineEndings(e),this.inputLen=this.content.length,this.content.startsWith("---")){let m=this.content.split(` -`),d=[],p=[];p.push("");for(let _=1;_{let d=m[0];if(d.startsWith(xe.AtChar)){u=this.content.indexOf(d,u)+2,c=!0;return}let p=this.content.indexOf(d,u);if(c&&u==p){u=p;return}this.antlersStartIndex.push(p),this.antlersStartPositionIndex.set(p,1),u=p+2,c=!1}),!0}prepareLiteralContent(e){return e.replace("@{{","{{")}scanToEndOfPhpRegion(e){for(this.currentIndex==this.inputLen&&(this.doesHaveUnclosedStructures=!0),this.currentIndex;this.currentIndexthis.inputLen?(r.endPosition=this.positionFromOffset(this.inputLen,this.inputLen-1),this.doesHaveUnclosedStructures=!0,this.antlersErrors.push(M.makeSyntaxError(P.TYPE_UNEXPECTED_EOI_WHILE_MANIFESTING_ANTLERS_NODE,r,"Unexpected end of input while locating end of Antlers region.")),r):(this.lastAntlersEndIndex=e+3+this.seedOffset,r.endPosition=this.positionFromOffset(e+this.seedOffset,e+3+this.seedOffset),r)}makeAntlersPhpFailedNode(e){let n=new td;n.rawStart="{{$",n.rawEnd="$}}",n._isEndVirtual=!0,n.content=this.currentContent.join(""),n.sourceContent=this.sourceContent.join(""),n.startPosition=this.positionFromOffset(this.startIndex+this.seedOffset,this.startIndex+this.seedOffset);let r=this.getLineText(n.startPosition.line),i=this.getLineIndex(n.startPosition.line);if(r!=null){let o=r.substr(this._recoveryStartIndex);n.content=o,n.sourceContent=o}let s=e+this.seedOffset;return i!=null&&(this.currentIndex=i.end,s=i.end),n.endPosition=this.positionFromOffset(s,s),n}makeAntlersCommentFailedNode(e){let n=new ol;this.isDoubleBrace?(n.rawStart="{{",n.rawEnd="}}"):(n.rawStart="{",n.rawEnd="}"),n._isEndVirtual=!0;let r=!1,i=this.currentContent.length;i>0&&this.currentContent[i-1]==xe.Punctuation_ForwardSlash&&(this.currentContent.pop(),r=!0),n.isComment=!0,n.isSelfClosing=r,n.withParser(this),n.content=this.currentContent.join(""),n.sourceContent=this.sourceContent.join(""),n.startPosition=this.positionFromOffset(this.startIndex+this.seedOffset,this.startIndex+this.seedOffset);let s=this.getLineText(n.startPosition.line),o=this.getLineIndex(n.startPosition.line);if(s!=null){let l=s.substr(this._recoveryStartIndex);n.content=l,n.sourceContent=l}let a=e+this.seedOffset;return o!=null&&(this.currentIndex=o.end,a=o.end),n.endPosition=this.positionFromOffset(a,a),n.interpolationRegions=new Map,this.interpolationRegions.forEach((l,u)=>{n.content.includes(u)&&n.interpolationRegions.set(u,l)}),n}makeAntlersFailedNode(e,n){let r=new ft;this.isDoubleBrace?(r.rawStart="{{",r.rawEnd="}}"):(r.rawStart="{",r.rawEnd="}"),r._isEndVirtual=!0;let i=!1,s=this.currentContent.length;s>0&&this.currentContent[s-1]==xe.Punctuation_ForwardSlash&&(this.currentContent.pop(),i=!0),r.isComment=n,r.isSelfClosing=i,r.withParser(this),r.content=this.currentContent.join(""),r.sourceContent=this.sourceContent.join(""),r.startPosition=this.positionFromOffset(this.startIndex+this.seedOffset,this.startIndex+this.seedOffset);let o=this.getLineText(r.startPosition.line),a=this.getLineIndex(r.startPosition.line);if(o!=null){let c=G.trimLeft(this.content.substring(r.startPosition.offset+r.rawStart.length-1,a==null?void 0:a.end),"{");r.content=c,r.sourceContent=c}let l=e+this.seedOffset;a!=null&&(this.currentIndex=a.end,l=a.end),r.endPosition=this.positionFromOffset(l,l),r.interpolationRegions=new Map,this.interpolationRegions.forEach((c,f)=>{r.content.includes(f)&&r.interpolationRegions.set(f,c)});let u=this.nodeParser.parseNode(r);return this.mergeErrors(u.getErrors()),u}makeAntlersTagNode(e,n){let r=new B;this.isDoubleBrace?(r.rawStart="{{",r.rawEnd="}}"):(r.rawStart="{",r.rawEnd="}");let i=!1,s=this.currentContent.length;if(s>0&&this.currentContent[s-1]==xe.Punctuation_ForwardSlash&&(this.currentContent.pop(),i=!0),r.isInterpolationNode=this.isInterpolatedParser,r.isComment=n,r.isSelfClosing=i,r.withParser(this),r.content=this.currentContent.join(""),r.sourceContent=this.sourceContent.join(""),r.startPosition=this.positionFromOffset(this.startIndex+this.seedOffset,this.startIndex+this.seedOffset),e+2>this.inputLen)return r.endPosition=this.positionFromOffset(this.inputLen,this.inputLen-1),this.doesHaveUnclosedStructures=!0,this.antlersErrors.push(M.makeSyntaxError(P.TYPE_UNEXPECTED_EOI_WHILE_MANIFESTING_ANTLERS_NODE,r,"Unexpected end of input while locating end of Antlers region.")),r;if(n?this.lastAntlersEndIndex=e+2+this.seedOffset:this.lastAntlersEndIndex=e+1+this.seedOffset,r.endPosition=this.positionFromOffset(this.lastAntlersEndIndex,this.lastAntlersEndIndex),r.interpolationRegions=new Map,this.interpolationRegions.forEach((a,l)=>{r.content.includes(l)&&r.interpolationRegions.set(l,a)}),r.isComment)return r;let o=this.nodeParser.parseNode(r);return this.mergeErrors(o.getErrors()),o}mergeErrors(e){e.forEach(n=>{this.antlersErrors.push(n)})}getNodes(){return this.nodes}getNodesBetween(e,n){let r=[];return this.nodes.forEach(i=>{var s,o,a,l;((o=(s=i.startPosition)==null?void 0:s.offset)!=null?o:0)>e.offset&&((l=(a=i.endPosition)==null?void 0:a.offset)!=null?l:0)0&&this.nodes.push(this.makeLiteralNode(this.currentContent,this.startIndex,e)),this.currentContent=[],this.sourceContent=[])}makeLiteralNode(e,n,r){let i=new Qe;return i.content=e.join(""),i.sourceContent=this.sourceContent.join(""),i.startPosition=this.positionFromOffset(n,n),i.endPosition=this.positionFromOffset(r,r),i.sourceContent=this.content.substr(n,r),i.withParser(this),i}addAntlersError(e){this.antlersErrors.push(e)}getAntlersErrors(){return this.antlersErrors}},E=xe;E.K_CHAR="char",E.K_LINE="line",E.NewLine=` -`,E.AtChar="@",E.LeftBrace="{",E.RightBrace="}",E.LeftBracket="[",E.RightBracket="]",E.String_EscapeCharacter="\\",E.String_Terminator_DoubleQuote='"',E.String_Terminator_SingleQuote="'",E.Punctuation_Question="?",E.Punctuation_Equals="=",E.Punctuation_Comma=",",E.Punctuation_Colon=":",E.Punctuation_Semicolon=";",E.Punctuation_Exclamation="!",E.Punctuation_Pipe="|",E.Punctuation_Ampersand="&",E.Punctuation_LessThan="<",E.Punctuation_GreaterThan=">",E.Punctuation_Octothorp="#",E.Punctuation_Tilde="~",E.Punctuation_FullStop=".",E.Punctuation_Dollar="$",E.Punctuation_Asterisk="*",E.Punctuation_Percent="%",E.Punctuation_Plus="+",E.Punctuation_Minus="-",E.Punctuation_Underscore="_",E.Punctuation_ForwardSlash="/",E.Punctuation_Caret="^",E.LeftParen="(",E.RightParent=")";var gt=class{static findAssignmentNodes(e){let n=[];for(let r=0;re.index)break;r.push(s)}}return r}static isBefore(e,n){return e.startPosition==null?!1:e.startPosition.indexn.index}static findNodesBeforePosition(e,n){let r=[];if(e==null)return r;for(let i=0;ie.index)break;r.push(s)}}return r}static findNodesAfterPosition(e,n){let r=[];if(e==null)return r;for(let i=0;ie.index&&r.push(s)}return r}static findNodeBeforePosition(e,n){if(e==null)return null;let r=null;for(let i=0;ie.index)break;r=s}}return r}static findNodeAfterPosition(e,n){if(e==null)return null;for(let r=0;re.index)return i}return null}static findNodeAtPosition(e,n){if(e==null)return null;for(let r=0;r=i.startPosition.index&&e.index<=i.endPosition.index)return i}return null}static isLiteralType(e){return e instanceof rn||e instanceof Qe}};var Tl=class{static isModifierLeftOf(e,n){return Tl.isModifierLeftOfPosition(e.startPosition,n)}static isModifierLeftOfPosition(e,n){let r=gt.findAbstractNodesBeforePosition(e,n);for(let i=r.length-1;i>=0;i--){let s=r[i];if(s instanceof zt||s instanceof Bt)return!1;if(s instanceof vn)return!0}return!1}};var Nl=class{constructor(){this.isRightOfOperator=!1;this.isLeftOfOperator=!1}static resolveContext(e,n,r){let i=new Nl;return r!=null&&(r.prev!=null&&Rt.isOperatorType(r.prev)&&(i.isRightOfOperator=!0),r.next!=null&&Rt.isOperatorType(r.next)&&(i.isLeftOfOperator=!0)),i}};var am=class{constructor(){this.inTagPart=!1;this.inMethodPart=!1}};var vl=class{constructor(){this.modifierChain=null;this.activeModifier=null;this.name="";this.inModifierName=!1;this.inModifierParameter=!1;this.valueCount=0;this.activeValueIndex=-1;this.activeValue=null}static resolveContext(e,n,r,i){let s=n.getParser(),o=new vl,a=s.getLanguageParser().getCreatedModifierChains(),l=null;for(let u=0;u(o[o.Unknown=0]="Unknown",o[o.Variable=1]="Variable",o[o.Modifier=2]="Modifier",o[o.Parameter=3]="Parameter",o[o.General=4]="General",o[o.LanguageOperator=5]="LanguageOperator",o))(um||{});var Il=class{constructor(){this.variableNode=null;this.varPathText=""}static resolveContext(e,n,r,i){var f;if(r==null)return null;let s=r,o=i.getDocumentParser().getLanguageParser(),a=new Il,l=(f=i.wordAt(e))!=null?f:"";r instanceof It&&o.isMergedVariableComponent(r)==!1&&r.prev instanceof oe&&(s=r.prev);let u="";if(o.isMergedVariableComponent(s)){let m=o.getMergedVariable(s);m.startPosition!=null&&(u=i.getText(m.startPosition.index,e.index).trim()),a.variableNode=m}else s instanceof oe&&(a.variableNode=s,u=s.name,s.variableReference!=null&&(u=s.variableReference.normalizedReference));u.length>0&&(u=Pt(u,"\\.",":"));let c=u.split(":");return l.trim().length>0&&c.pop(),u=c.join(":"),u.endsWith(":")&&(u=Er(u,":")),a.varPathText=u,a}};var Fi=class{static resolveIdentifierContext(e,n){let r=new am;return n.nameMethodPartStartsOn!=null?e.char=n.nameStartsOn.char&&(_=!0),n.nameEndsOn!=null&&e.char>n.nameEndsOn.char&&(_=!1),_&&(m.isCursorInIdentifier=!0,m.identifierContext=Fi.resolveIdentifierContext(e,n))}n.addContext(m),s!=null&&s.addContext(m),m.interpolatedContext=i,m.node=n,m.position=e,m.root=s,m.leftPunctuation=r.punctuationLeftAt(e),m.rightPunctuation=r.punctuationRightAt(e),m.leftChar=r.charLeftAt(e),m.rightChar=r.charRightAt(e),m.word=r.wordAt(e),m.char=r.charAt(e),m.leftWord=r.wordLeftAt(e),m.rightWord=r.wordRightAt(e);let d=!1;if(n.parameters.length>0)for(let _=0;_C.blockPosition.start.char&&e.char<=C.blockPosition.end.char+1&&e.line>=((l=(a=(o=C.namePosition)==null?void 0:o.start)==null?void 0:a.line)!=null?l:C.blockPosition.start.line)&&e.line<=((f=(c=(u=C.valuePosition)==null?void 0:u.end)==null?void 0:c.line)!=null?f:C.blockPosition.end.line)){m.cursorContext=3,m.parameterContext=Pl.resolveContext(e,C),m.isInParameter=!0,m.feature=C,d=!0;break}}if(d||n.runtimeNodes.forEach(_=>{_.startPosition!=null&&_.endPosition!=null&&e.isWithin(_.startPosition,_.endPosition,1)&&(m.feature=_)}),d&&n.interpolationRegions.size>0){let _=Array.from(n.interpolationRegions,([C,h])=>h);for(let C=0;C<_.length;C++){let h=_[C];if(e.index>=h.startOffset&&e.index<=h.endOffset){let b=n.getInterpolationNode(h.varContent);return Fi.resolveContext(e,b,r,!0,s)}}}return m.feature instanceof oe&&m.feature.isInterpolationReference&&m.feature.parent!=null&&m.feature.parent instanceof B&&m.feature.parent.processedInterpolationRegions.has(m.feature.name)?Fi.resolveContext(e,m.feature.parent.getInterpolationNode(m.feature.name),r,!0,s):(Tl.isModifierLeftOfPosition(e,n.runtimeNodes)?(m.cursorContext=2,m.modifierContext=vl.resolveContext(e,n,m.feature,r)):d||(m.cursorContext=4,m.generalContext=Nl.resolveContext(e,n,m.feature)),m.variableContext=Il.resolveContext(e,n,m.feature,r),m)}return null}};var Js=class{static isPairedNode(e){return e instanceof vt?!0:e instanceof Gn||e instanceof B?e.isClosedBy!=null:!1}static findAncestorsBeforePosition(e,n){var a,l,u,c,f,m;let r=[],i=[],s=-1,o=-1;for(let d=0;d-1&&p.endPosition!=null&&(p.endPosition.line-1&&p.endPosition.char{gt.isBefore(o.target,s)&&i.push(o)}),i}getAssignmentsAfter(e,n){let r=this.doc.getDocumentParser().getLanguageParser().getRuntimeAssignments(),i=[],s=this.position(e,n);return s!=null&&r.forEach(o=>{gt.isAfter(o.target,s)&&i.push(o)}),i}getNodesAfter(e,n){return gt.findNodesAfterPosition(this.position(e,n),this.doc.getDocumentParser().getNodes())}getIsWithinPairedNode(e,n){let r=this.getNodeBefore(e,n);return r==null?!1:Js.isPairedNode(r)}position(e,n){return this.doc.getDocumentParser().positionFromCursor(e,n)}charLeftAt(e,n){return this.doc.getDocumentParser().charLeftAtCursor(e,n)}charAt(e,n){return this.doc.getDocumentParser().charAtCursor(e,n)}charRightAt(e,n){return this.doc.getDocumentParser().charRightAtCursor(e,n)}wordLeftAt(e,n,r=4){return this.doc.getDocumentParser().wordLeftAtCursor(e,n,r)}wordRightAt(e,n,r=4){return this.doc.getDocumentParser().wordRightAtCursor(e,n,r)}wordAt(e,n,r=4){return this.doc.getDocumentParser().wordAtCursor(e,n,r)}punctuationLeftAt(e,n,r=4){return this.doc.getDocumentParser().punctuationLeftAtCursor(e,n,r)}punctuationRightAt(e,n,r=4){return this.doc.getDocumentParser().punctuationRightAtCursor(e,n,r)}};var fm=class{constructor(e){this.doc=e}hasAny(){return this.all().length>0}all(){let e=[],n=[];return this.doc.getAllAntlersNodes().forEach(r=>{r.getErrors().forEach(i=>{e.includes(i.hash())==!1&&(e.push(i.hash()),n.push(i))})}),this.doc.getDocumentParser().getAntlersErrors().forEach(r=>{e.includes(r.hash())==!1&&(e.push(r.hash()),n.push(r))}),n}};var $v=Q(mi());var xn=Q(Yv(),1),pJ=xn.default.binaryOptions,dJ=xn.default.boolOptions,mJ=xn.default.intOptions,hJ=xn.default.nullOptions,gJ=xn.default.strOptions,_J=xn.default.Schema,yJ=xn.default.Alias,bJ=xn.default.Collection,TJ=xn.default.Merge,NJ=xn.default.Node,Kv=xn.default.Pair,Ol=xn.default.Scalar,Ll=xn.default.YAMLMap,xa=xn.default.YAMLSeq;var Cm=class{constructor(e){this.documentScope=null;this.project=e}getKeyValue(e){return e instanceof Ol?e.value:""}getNodeValue(e){return e instanceof Ol?e.value:e instanceof Ll?this.analyzeDocument(e.items):e instanceof xa?this.analyzeDocument(e.items):""}getScalarRuntimeType(e){return parseFloat(e).toString()==e||parseInt(e).toString()==e?"number":"string"}analyzeDocument(e){let n=new Qn(this.project);return e.forEach(r=>{if(r instanceof Kv){let i=this.getKeyValue(r.key),s=this.getNodeValue(r.value);if(r.value instanceof Ol)n.addVariable({dataType:this.getScalarRuntimeType(s),introducedBy:null,name:i,sourceField:null,sourceName:"*frontmatter"});else if(r.value instanceof xa&&r.key instanceof Ol){let o=new Qn(this.project);r.value.items.forEach(a=>{let l=this.getNodeValue(a);o.addVariable({dataType:this.getScalarRuntimeType(l),introducedBy:null,name:a.value,sourceField:null,sourceName:"*frontmatter"})}),n.addScopeList(r.key.value,o)}else n.addScopeList(i,s)}}),n}parse(e){let n=$v.parseDocument(e);try{n.contents instanceof Ll&&(this.documentScope=this.analyzeDocument(n.contents.items))}catch{this.documentScope=null}}hasScope(){return this.documentScope!=null}getScope(){return this.documentScope}};var Rm=class{constructor(e){this.doc=e}getAncestors(e){return Js.findAncestorsBeforePosition(e,this.doc.getAllAntlersNodes())}getNodeAt(e){return gt.findNodeAtPosition(e,this.doc.getDocumentParser().getNodes())}getNodesBefore(e){return gt.findNodesBeforePosition(e,this.doc.getDocumentParser().getNodes())}getNodeBefore(e){return gt.findNodeBeforePosition(e,this.doc.getDocumentParser().getNodes())}getNodeAfter(e){return gt.findNodeAfterPosition(e,this.doc.getDocumentParser().getNodes())}getNodesAfter(e){return gt.findNodesAfterPosition(e,this.doc.getDocumentParser().getNodes())}getIsWithinPairedNode(e){let n=this.getNodeBefore(e);return n==null?!1:Js.isPairedNode(n)}filter(e){return this.doc.getDocumentParser().getNodes().filter(e)}getComments(){let e=[];return this.doc.getAllNodes().forEach(n=>{n instanceof B&&n.isComment&&e.push(n)}),e}getMultilineNodes(){let e=[];return this.doc.getAllNodes().forEach(n=>{var r,i;n instanceof B&&!n.isComment&&((r=n.startPosition)==null?void 0:r.line)!=((i=n.endPosition)==null?void 0:i.line)&&e.push(n)}),e}getMultiLineComments(){let e=[];return this.getComments().forEach(n=>{var r,i;((r=n.startPosition)==null?void 0:r.line)!=((i=n.endPosition)==null?void 0:i.line)&&e.push(n)}),e}getAllLiteralNodes(){let e=[];return this.doc.getAllNodes().forEach(n=>{(n instanceof Qe||n instanceof rn)&&e.push(n)}),e}getStructuralNodes(){let e=[];return this.doc.getDocumentParser().getRenderNodes().forEach(n=>{n instanceof B?e.push(n):n instanceof vt&&n.logicBranches.length>0&&n.logicBranches.forEach(r=>{if(r.head!=null){let i=r.head;i.originalNode!=null?e.push(i.originalNode):e.push(i)}})}),e}getAllRuntimeNodes(){let e=[];return this.doc.getAllNodes().forEach(n=>{(n instanceof Gn||n instanceof B)&&n.runtimeNodes.length>0&&n.runtimeNodes.forEach(r=>{e.push(r)})}),e}getAllParameterNodes(){let e=[];return this.doc.getAllNodes().forEach(n=>{(n instanceof Gn||n instanceof B)&&n.hasParameters&&n.parameters.forEach(r=>{e.push(r)})}),e}getAssignmentNodes(){return gt.findAssignmentNodes(this.getAllRuntimeNodes())}};var Am=class{constructor(e){this.doc=e}getAllSelfClosingNodes(){let e=[];return this.doc.getAllNodes().forEach(n=>{n instanceof B&&n.isSelfClosing&&e.push(n)}),e}getAllPairedNodes(){let e=[];return this.doc.getAllNodes().forEach(n=>{(n instanceof B||n instanceof ft)&&n.isClosedBy!=null&&!n.isSelfClosing&&e.push(n)}),e}};var af=class{static printComment(e,n,r){let i=e.getContent(),s=i.trim();if(s.includes(` +`)==!1&&u.trim().length>0||n.prev.prev instanceof rn?l=!0:n.prev.prev instanceof B&&(n.prev.prev.isInlineAntlers?l=!0:n.prev.prev.isClosingTag&&n.prev.prev.isOpenedBy!=null&&(n.prev.prev.isOpenedBy instanceof rn||n.prev.prev.runtimeName()=="noparse")&&(n.prev.prev.isInlineAntlers=!0,l=!0))}else n.prev instanceof B&&n.prev.isPaired()&&(l=!0);n.isInlineAntlers=a&&l}})}};var Ee=class{constructor(){this.interpolationRegions=new Map;this.nodeParser=new Xd;this.chars=[];this.charLen=0;this.lastAntlersNode=null;this.content="";this.originalContent="";this.currentIndex=0;this.currentContent=[];this.sourceContent=[];this.startIndex=0;this._recoveryStartIndex=0;this.cur=null;this.next=null;this.prev=null;this.nodes=[];this.renderNodes=[];this.isInterpolatedParser=!1;this.inputLen=0;this.documentOffsets=new Map;this.lineIndex=new Map;this.lastDocumentOffsetKey=null;this.isDoubleBrace=!1;this.interpolationEndOffsets=new Map;this.isScanningInterpolations=!1;this.seedStartLine=1;this.seedStartchar=1;this.frontMatterEndLine=-1;this.lastAntlersEndIndex=-1;this.seedOffset=0;this.antlersStartIndex=[];this.antlersStartPositionIndex=new Map;this.chunkSize=5;this.maxLine=1;this.currentChunkOffset=0;this.isNoParse=!1;this.antlersErrors=[];this.structureErrors=[];this.languageParser=new Rt;this.documentPath=null;this.pushedErrors=new Map;this.frontMatter="";this.shiftLine=0;this.doesHaveUncloseIfStructures=!1;this.doesHaveUnclosedStructures=!1;this.parseChildDocuments=!1;this.structuralErrorCodes=[v.TYPE_PARSE_UNCLOSED_CONDITIONAL,v.TYPE_PARSE_UNPAIRED_CONDITIONAL,v.TYPE_RECURSIVE_UNPAIRED_NODE,v.TYPE_RUNTIME_FATAL_UNPAIRED_LOOP_END,v.TYPE_UNPAIRED_CLOSING_TAG];this.structure=new Zd(this);this.fragmentsParser=new im,this.fragmentsAnalyzer=new sm(this,this.fragmentsParser)}withChildDocuments(e){return this.parseChildDocuments=e,this}shouldParseChildDocument(){return this.parseChildDocuments}hasUnclosedIfStructures(){return this.doesHaveUncloseIfStructures}hasUnclosedStructures(){return this.doesHaveUnclosedStructures}getFrontMatter(){return this.frontMatter}setDocumentPath(e){this.documentPath=e}getFrontMatterEndLine(){return this.frontMatterEndLine}pushError(e){(e.errorCode==v.TYPE_PARSE_UNCLOSED_CONDITIONAL||e.errorCode==v.TYPE_PARSE_UNPAIRED_CONDITIONAL)&&(this.doesHaveUncloseIfStructures=!0);let n=e.hash();this.pushedErrors.has(n)||(this.pushedErrors.set(n,e),this.antlersErrors.push(e),this.structuralErrorCodes.includes(e.errorCode)&&this.structureErrors.push(e))}getInterpolationRegions(){return this.interpolationRegions}getDocumentPath(){return this.documentPath}checkCurrentOffsets(){if(this.currentIndex>this.chars.length){this.cur=null,this.prev=null,this.next=null;return}if(this.cur=this.chars[this.currentIndex],this.prev=null,this.next=null,this.currentIndex>0&&(this.prev=this.chars[this.currentIndex-1]),this.currentIndex+1{this.chars.push(r),this.charLen+=1})}e&&this.currentIndex+1this.maxLine&&(i=this.maxLine);for(let o=r;o<=i;o++)n.set(o,(s=this.getLineText(o))!=null?s:"");return n}charAtCursor(e,n){return this.charAt(this.positionFromCursor(e,n))}getLineIndex(e){if(e==this.maxLine){let r=this.lineIndex.get(e-1);if(r!=null){let i=r.endIndex+1;return{end:this.inputLen-1,start:i}}return null}let n=this.lineIndex.get(e);return n!=null?{start:n.startIndex,end:n.endIndex}:null}positionFromCursor(e,n){if(e==this.maxLine){let i=this.lineIndex.get(e-1);if(i!=null){let s=i.endIndex+1,o=s+(n-1),a=new qt;return a.offset=o,a.line=e,a.char=n,a.index=o,a}return null}let r=this.lineIndex.get(e);if(r!=null){let i=new qt;return i.offset=r.startIndex+(n-1),i.line=r.line,i.char=n,i.index=r.startIndex+(n-1),i}return null}parse(e){var u,c,f,m,p,d,_,C,h,b;if(this.resetState(),!this.processInputText(e))return[];let n=this.antlersStartIndex.length,r=n-1;if(n==0&&!this.isNoParse){let g=new Qe;g.withParser(this),g.content=this.prepareLiteralContent(this.content),g.startPosition=this.positionFromOffset(0,0),g.endPosition=this.positionFromOffset(this.inputLen-1,this.inputLen-1),g.sourceContent=this.content,this.nodes.push(g)}else for(let g=0;g0&&!this.isNoParse){let V=new Qe;if(V.withParser(this),V.content=this.prepareLiteralContent(this.content.substr(0,N)),V.content.length>0){V.startPosition=this.positionFromOffset(0,0),V.endPosition=this.positionFromOffset(N,N-1);let O=(u=V.startPosition.index)!=null?u:0,$=V.endPosition.index+1;V.sourceContent=this.content.substr(O,$-O),this.nodes.push(V)}}if(Nthis.lastAntlersNode.endPosition.offset){O=$;break}if(O==null){let $=this.prepareLiteralContent(this.content.substr(this.lastAntlersNode.endPosition.offset+1));if($.length>0&&!this.isNoParse){let X=new Qe;X.withParser(this),X.content=$;let ee=this.lastAntlersNode.endPosition.offset+1;X.startPosition=this.positionFromOffset(ee,ee),X.endPosition=this.positionFromOffset(this.inputLen,this.inputLen);let Y=(c=X.startPosition.index)!=null?c:0,ne=X.endPosition.index+1;X.sourceContent=this.content.substr(Y,ne-Y),this.nodes.push(X)}break}else{let $=this.antlersStartIndex[O],X=$-this.lastAntlersNode.endPosition.offset-1;if(X>0){let ee=this.lastAntlersNode.endPosition.offset,Y=$-1;ee+=1,Y-=1;let ne=this.content.substr(ee,X);if(ne.length>0&&!this.isNoParse){let De=new Qe;De.withParser(this),De.content=ne,De.startPosition=this.positionFromOffset(ee,ee),De.endPosition=this.positionFromOffset(Y,Y);let de=(f=De.startPosition.index)!=null?f:0,Z=De.endPosition.index+1;De.sourceContent=this.content.substr(de,Z-de),this.nodes.push(De)}continue}g=O-1;continue}}}let S=!1;if(this.antlersStartPositionIndex.has(this.currentChunkOffset)?this.lastAntlersEndIndexV)g+20){ee.startPosition=this.positionFromOffset($,$),ee.endPosition=this.positionFromOffset(V,V-1);let Y=(m=ee.startPosition.index)!=null?m:0,ne=ee.endPosition.index+1;ee.sourceContent=this.content.substr(Y,ne-Y),this.nodes.push(ee)}break}else{let $=V-this.lastAntlersEndIndex-1;if($==0||this.isNoParse)continue;let ee=this.currentChunkOffset;this.lastAntlersNode instanceof ol&&(O=((d=(p=this.lastAntlersNode.endPosition)==null?void 0:p.offset)!=null?d:0)+1,$-=((C=(_=this.lastAntlersNode.endPosition)==null?void 0:_.offset)!=null?C:0)+1,ee=O),this.lastAntlersNode instanceof Fs&&(O-=1,$+=1);let Y=this.content.substr(O,$),ne=new Qe;if(ne.withParser(this),ne.content=this.prepareLiteralContent(Y),ne.content.length>0){ne.startPosition=this.positionFromOffset(O,O),ne.endPosition=this.positionFromOffset(V,V-1);let De=(h=ne.startPosition.index)!=null?h:0,de=ne.endPosition.index+1;ne.sourceContent=this.content.substr(De,de-De),this.nodes.push(ne)}}continue}if(g!==r&&this.lastAntlersNode!=null&&this.lastAntlersNode.endPosition!=null&&this.positionFromOffset(N,N).isBefore(this.lastAntlersNode.endPosition)){if(g+10){O.startPosition=this.positionFromOffset(V,V),O.endPosition=this.positionFromOffset(this.inputLen-1,this.inputLen-1);let $=(b=O.startPosition.index)!=null?b:0,X=O.endPosition.index+1;O.sourceContent=this.content.substr($,X-$),this.nodes.push(O)}break}}}}let i=0;this.nodes.forEach(g=>{g.index=i,i+=1}),this.nodes.length>500&&(this.parseChildDocuments=!1),this.nodes.forEach(g=>{g instanceof B&&g.isComment||g instanceof B&&g.interpolationRegions.size>0&&(g.interpolationRegions.forEach((N,S)=>{let V=new Ee;V.withChildDocuments(this.parseChildDocuments),V.setIsInterpolatedParser(!0);let O=V.parse(N.parseContent);O.length>1&&O[1]instanceof B&&(O=[O[1]]),V.hasUnclosedIfStructures()&&(this.doesHaveUncloseIfStructures=!0),V.hasUnclosedStructures()&&(this.doesHaveUnclosedStructures=!0),g.processedInterpolationRegions.set(S,O),this.mergeErrors(V.getAntlersErrors())}),g.hasProcessedInterpolationRegions=!0)}),this.content.length>0&&this.fragmentsParser.setIndexRanges(this.getNodeIndexRanges()).parse(this.content);let s=new ga;this.renderNodes=s.associate(this.nodes,this),this.createChildDocuments(this.renderNodes);let o=null,a=null;for(let g=0;g{if(g instanceof B&&g.isClosedBy!=null){let N=g.getImmediateChildren();for(let S=0;S{if(g instanceof B&&g.isClosingTag&&g.isOpenedBy==null){let N="Unpaired closing tag.";g.isInterpolationNode&&(N+=" Tag pairs are not supported within Antlers tags."),g.pushError(M.makeSyntaxError(v.TYPE_UNPAIRED_CLOSING_TAG,g,N))}}),Jd.associateRecursiveParent(this.nodes),this.nodes.forEach(g=>{var N;if(!(g instanceof B&&g.isComment)&&((g instanceof B||g instanceof ft)&&(g.isInterpolationNode=this.isInterpolatedParser),(g instanceof B||g instanceof ft)&&g.interpolationRegions.size>0&&g.runtimeNodes.forEach(S=>{S instanceof oe&&g.interpolationRegions.has(S.name)&&(S.isInterpolationReference=!0,S.interpolationNodes=g.processedInterpolationRegions.get(S.name))}),(g instanceof B||g instanceof ft)&&g.hasParameters&&g.interpolationRegions.size>0&&g.parameters.forEach(S=>{g.interpolationRegions.forEach((V,O)=>{S.value.includes(O)&&S.interpolations.push(O)})}),g instanceof B&&g.runtimeNodes.length>0&&g.isClosingTag==!1&&!g.isComment&&(g.parsedRuntimeNodes=this.languageParser.parse(g.runtimeNodes),g.hasParsedRuntimeNodes=!0,!g.isTagNode&&g.parsedRuntimeNodes.length>0))){let S=g.nodeAtIndex(0);S!=null&&S instanceof oe&&S.name==((N=g.name)==null?void 0:N.name)&&(g.modifierChain=S.modifierChain)}}),this.languageParser.getCreatedModifierChains().forEach(g=>{g.modifierChain.length>0&&g.modifierChain.forEach(N=>{var S,V;N.nameNode!=null&&we.instance!=null&&we.instance.hasModifier((S=N.nameNode)==null?void 0:S.name)&&(N.modifier=(V=we.instance)==null?void 0:V.getModifier(N.nameNode.name))})});let l=1;return this.nodes.forEach(g=>{var N,S;if(g instanceof B){if(g.isComment)return;g.isTagNode=(S=(N=Ie.instance)==null?void 0:N.isKnownTag(g.runtimeName()))!=null?S:!1,g.scopeName=g.findParameterValue("scope",""),g.antlersNodeIndex=l,l+=1,em.analyzeModifierNodeParameters(g),tm.validateParameters(g)}}),this.nodes.forEach(g=>{var N,S,V,O,$,X,ee,Y;if(g instanceof B&&g.isClosedBy!=null){let ne=((S=(N=g.endPosition)==null?void 0:N.offset)!=null?S:0)+1,De=(O=(V=g.isClosedBy.startPosition)==null?void 0:V.offset)!=null?O:0,de=(X=($=g.startPosition)==null?void 0:$.offset)!=null?X:0,Z=((Y=(ee=g.isClosedBy.endPosition)==null?void 0:ee.offset)!=null?Y:0)+1;g.documentText=this.content.substr(ne,De-ne),g.nodeContent=this.content.substr(de,Z-de),this.parseChildDocuments&&(g.childDocument=mt.childFromText(g.documentText,bl(g.children)))}}),this.renderNodes}createChildDocuments(e){e.forEach(n=>{var r,i,s,o,a,l,u,c;if(n instanceof B&&n.isClosedBy!=null){let f=n.isClosedBy,m=((i=(r=n.startPosition)==null?void 0:r.index)!=null?i:0)-1,p=((o=(s=f.endPosition)==null?void 0:s.index)!=null?o:0)-m;if(n.documentText=this.content.substr(m,p),this.parseChildDocuments){let d=(l=(a=n.endPosition)==null?void 0:a.index)!=null?l:0,_=((c=(u=f.startPosition)==null?void 0:u.index)!=null?c:0)-1-d,C=this.content.substr(d,_);n.childDocument=mt.childFromText(C,bl(n.getChildren()))}}})}getNodeIndexRanges(){let e=[];return this.nodes.forEach(n=>{var r,i,s,o;n instanceof Qe||e.push({start:(i=(r=n.startPosition)==null?void 0:r.index)!=null?i:0,end:(o=(s=n.endPosition)==null?void 0:s.index)!=null?o:0})}),e}positionFromOffset(e,n,r=!1){let i=0,s=0;if(this.documentOffsets.has(e)){let a=this.documentOffsets.get(e);i=a.line,s=a.char}else if(this.documentOffsets.size==0)i=1,s=e+1;else{let a=null,l=null,u=null,c=null;for(let f of this.documentOffsets.keys()){if(f>=e){c!=null&&e>c?(a=u,l=c):(a=this.documentOffsets.get(f),l=f);break}u=this.documentOffsets.get(f),c=f}if(a==null&&(a=u,l=c),a!=null)if(r){let f=this.content.split(""),m=e-(l!=null?l:0),p=a.char-(l!=null?l:0)+e;s=m,i=a.line,e<=(l!=null?l:0)?(i=a.line,s=e+1):i=a.line+1}else{let f=this.content.split(""),m=e-(l!=null?l:0),p=a.char-(l!=null?l:0)+e;s=m,i=a.line,e<=(l!=null?l:0)?(i=a.line,s=e+1):i=a.line+1}else this.lastDocumentOffsetKey!=null&&(i=this.documentOffsets.get(this.lastDocumentOffsetKey).line+1,s=e+this.lastDocumentOffsetKey)}let o=new qt;return o.index=n,o.offset=e,o.line=i+this.shiftLine,o.char=s,o}getLanguageParser(){return this.languageParser}getText(e,n){return this.content.substr(e,n-e)}getOriginalContent(){return this.originalContent}getContent(){return this.content}getFragments(){return this.fragmentsParser.getFragments()}getFragmentsParser(){return this.fragmentsParser}getFragmentsContainingStructures(){return this.fragmentsParser.getFragmentsContainingStructures()}setIsInterpolatedParser(e){return this.isInterpolatedParser=e,this}setStartLineSeed(e){return this.seedStartLine=e,this}setSeedStartChar(e){return this.seedStartchar=e,this}resetIntermediateState(){this.chars=[],this.charLen=0,this.currentIndex=0,this.currentContent=[],this.sourceContent=[],this.cur=null,this.next=null,this.prev=null}setSeedPosition(e){return e==null?this.shiftLine=0:this.shiftLine=e.line,this}resetState(){if(this.languageParser.reset(),this.charLen=0,this.antlersStartIndex=[],this.antlersErrors=[],this.pushedErrors.clear(),this.antlersStartPositionIndex.clear(),this.lastAntlersEndIndex=-1,this.renderNodes=[],this.nodes=[],ms.globalTagEnterStack.length>0){let e=ms.globalTagEnterStack[ms.length-1];e!=null&&e.endPosition!=null&&this.setStartLineSeed(e.endPosition.line)}this.seedOffset=0,this.isScanningInterpolations=!1,this.content="",this.chars=[],this.currentIndex=0,this.startIndex=0,this._recoveryStartIndex=0,this.cur=null,this.next=null,this.prev=null,this.inputLen=0,this.documentOffsets.clear(),this.isDoubleBrace=!1,this.interpolationRegions.clear(),this.interpolationEndOffsets.clear()}fetch(e){let n=this.currentChunkOffset+this.chunkSize-this.chars.length;return G.substring(this.content,n,e)}getParsedContent(){return this.content}peek(e){if(e==this.charLen){let n=G.split(G.substring(this.content,this.currentChunkOffset+this.chunkSize,this.chunkSize));this.currentChunkOffset+=this.chunkSize,n.forEach(r=>{this.chars.push(r),this.charLen+=1})}return this.chars[e]}parseIntermediateText(){for(this.currentContent=[],this.sourceContent=[],this.startIndex=0,this.chars=this.content.substr(this.currentChunkOffset,this.chunkSize).split(""),this.charLen=this.chars.length,this.currentIndex=0;this.currentIndex=this.inputLen){this.appendContent(this.next),this.dumpLiteralNode(this.currentIndex+1);break}let e=0;for(let n=this.currentIndex+1;n0&&this.dumpLiteralNode(this.currentIndex)}}getRenderNodes(){return this.renderNodes}processInputText(e){var f;if(this.originalContent=e,this.content=G.normalizeLineEndings(e),this.inputLen=this.content.length,this.content.startsWith("---")){let m=this.content.split(` +`),p=[],d=[];d.push("");for(let _=1;_{let p=m[0];if(p.startsWith(Ee.AtChar)){u=this.content.indexOf(p,u)+2,c=!0;return}let d=this.content.indexOf(p,u);if(c&&u==d){u=d;return}this.antlersStartIndex.push(d),this.antlersStartPositionIndex.set(d,1),u=d+2,c=!1}),!0}prepareLiteralContent(e){return e.replace("@{{","{{")}scanToEndOfPhpRegion(e){for(this.currentIndex==this.inputLen&&(this.doesHaveUnclosedStructures=!0),this.currentIndex;this.currentIndexthis.inputLen?(r.endPosition=this.positionFromOffset(this.inputLen,this.inputLen-1),this.doesHaveUnclosedStructures=!0,this.antlersErrors.push(M.makeSyntaxError(v.TYPE_UNEXPECTED_EOI_WHILE_MANIFESTING_ANTLERS_NODE,r,"Unexpected end of input while locating end of Antlers region.")),r):(this.lastAntlersEndIndex=e+3+this.seedOffset,r.endPosition=this.positionFromOffset(e+this.seedOffset,e+3+this.seedOffset),r)}makeAntlersPhpFailedNode(e){let n=new nd;n.rawStart="{{$",n.rawEnd="$}}",n._isEndVirtual=!0,n.content=this.currentContent.join(""),n.sourceContent=this.sourceContent.join(""),n.startPosition=this.positionFromOffset(this.startIndex+this.seedOffset,this.startIndex+this.seedOffset);let r=this.getLineText(n.startPosition.line),i=this.getLineIndex(n.startPosition.line);if(r!=null){let o=r.substr(this._recoveryStartIndex);n.content=o,n.sourceContent=o}let s=e+this.seedOffset;return i!=null&&(this.currentIndex=i.end,s=i.end),n.endPosition=this.positionFromOffset(s,s),n}makeAntlersCommentFailedNode(e){let n=new ol;this.isDoubleBrace?(n.rawStart="{{",n.rawEnd="}}"):(n.rawStart="{",n.rawEnd="}"),n._isEndVirtual=!0;let r=!1,i=this.currentContent.length;i>0&&this.currentContent[i-1]==Ee.Punctuation_ForwardSlash&&(this.currentContent.pop(),r=!0),n.isComment=!0,n.isSelfClosing=r,n.withParser(this),n.content=this.currentContent.join(""),n.sourceContent=this.sourceContent.join(""),n.startPosition=this.positionFromOffset(this.startIndex+this.seedOffset,this.startIndex+this.seedOffset);let s=this.getLineText(n.startPosition.line),o=this.getLineIndex(n.startPosition.line);if(s!=null){let l=s.substr(this._recoveryStartIndex);n.content=l,n.sourceContent=l}let a=e+this.seedOffset;return o!=null&&(this.currentIndex=o.end,a=o.end),n.endPosition=this.positionFromOffset(a,a),n.interpolationRegions=new Map,this.interpolationRegions.forEach((l,u)=>{n.content.includes(u)&&n.interpolationRegions.set(u,l)}),n}makeAntlersFailedNode(e,n){let r=new ft;this.isDoubleBrace?(r.rawStart="{{",r.rawEnd="}}"):(r.rawStart="{",r.rawEnd="}"),r._isEndVirtual=!0;let i=!1,s=this.currentContent.length;s>0&&this.currentContent[s-1]==Ee.Punctuation_ForwardSlash&&(this.currentContent.pop(),i=!0),r.isComment=n,r.isSelfClosing=i,r.withParser(this),r.content=this.currentContent.join(""),r.sourceContent=this.sourceContent.join(""),r.startPosition=this.positionFromOffset(this.startIndex+this.seedOffset,this.startIndex+this.seedOffset);let o=this.getLineText(r.startPosition.line),a=this.getLineIndex(r.startPosition.line);if(o!=null){let c=G.trimLeft(this.content.substring(r.startPosition.offset+r.rawStart.length-1,a==null?void 0:a.end),"{");r.content=c,r.sourceContent=c}let l=e+this.seedOffset;a!=null&&(this.currentIndex=a.end,l=a.end),r.endPosition=this.positionFromOffset(l,l),r.interpolationRegions=new Map,this.interpolationRegions.forEach((c,f)=>{r.content.includes(f)&&r.interpolationRegions.set(f,c)});let u=this.nodeParser.parseNode(r);return this.mergeErrors(u.getErrors()),u}makeAntlersTagNode(e,n){let r=new B;this.isDoubleBrace?(r.rawStart="{{",r.rawEnd="}}"):(r.rawStart="{",r.rawEnd="}");let i=!1,s=this.currentContent.length;if(s>0&&this.currentContent[s-1]==Ee.Punctuation_ForwardSlash&&(this.currentContent.pop(),i=!0),r.isInterpolationNode=this.isInterpolatedParser,r.isComment=n,r.isSelfClosing=i,r.withParser(this),r.content=this.currentContent.join(""),r.sourceContent=this.sourceContent.join(""),r.startPosition=this.positionFromOffset(this.startIndex+this.seedOffset,this.startIndex+this.seedOffset),e+2>this.inputLen)return r.endPosition=this.positionFromOffset(this.inputLen,this.inputLen-1),this.doesHaveUnclosedStructures=!0,this.antlersErrors.push(M.makeSyntaxError(v.TYPE_UNEXPECTED_EOI_WHILE_MANIFESTING_ANTLERS_NODE,r,"Unexpected end of input while locating end of Antlers region.")),r;if(n?this.lastAntlersEndIndex=e+2+this.seedOffset:this.lastAntlersEndIndex=e+1+this.seedOffset,r.endPosition=this.positionFromOffset(this.lastAntlersEndIndex,this.lastAntlersEndIndex),r.interpolationRegions=new Map,this.interpolationRegions.forEach((a,l)=>{r.content.includes(l)&&r.interpolationRegions.set(l,a)}),r.isComment)return r;let o=this.nodeParser.parseNode(r);return this.mergeErrors(o.getErrors()),o}mergeErrors(e){e.forEach(n=>{this.antlersErrors.push(n)})}getNodes(){return this.nodes}getNodesBetween(e,n){let r=[];return this.nodes.forEach(i=>{var s,o,a,l;((o=(s=i.startPosition)==null?void 0:s.offset)!=null?o:0)>e.offset&&((l=(a=i.endPosition)==null?void 0:a.offset)!=null?l:0)0&&this.nodes.push(this.makeLiteralNode(this.currentContent,this.startIndex,e)),this.currentContent=[],this.sourceContent=[])}makeLiteralNode(e,n,r){let i=new Qe;return i.content=e.join(""),i.sourceContent=this.sourceContent.join(""),i.startPosition=this.positionFromOffset(n,n),i.endPosition=this.positionFromOffset(r,r),i.sourceContent=this.content.substr(n,r),i.withParser(this),i}addAntlersError(e){this.antlersErrors.push(e)}getAntlersErrors(){return this.antlersErrors}getStructureErrors(){return this.structureErrors}},E=Ee;E.K_CHAR="char",E.K_LINE="line",E.NewLine=` +`,E.AtChar="@",E.LeftBrace="{",E.RightBrace="}",E.LeftBracket="[",E.RightBracket="]",E.String_EscapeCharacter="\\",E.String_Terminator_DoubleQuote='"',E.String_Terminator_SingleQuote="'",E.Punctuation_Question="?",E.Punctuation_Equals="=",E.Punctuation_Comma=",",E.Punctuation_Colon=":",E.Punctuation_Semicolon=";",E.Punctuation_Exclamation="!",E.Punctuation_Pipe="|",E.Punctuation_Ampersand="&",E.Punctuation_LessThan="<",E.Punctuation_GreaterThan=">",E.Punctuation_Octothorp="#",E.Punctuation_Tilde="~",E.Punctuation_FullStop=".",E.Punctuation_Dollar="$",E.Punctuation_Asterisk="*",E.Punctuation_Percent="%",E.Punctuation_Plus="+",E.Punctuation_Minus="-",E.Punctuation_Underscore="_",E.Punctuation_ForwardSlash="/",E.Punctuation_Caret="^",E.LeftParen="(",E.RightParent=")";var gt=class{static findAssignmentNodes(e){let n=[];for(let r=0;re.index)break;r.push(s)}}return r}static isBefore(e,n){return e.startPosition==null?!1:e.startPosition.indexn.index}static findNodesBeforePosition(e,n){let r=[];if(e==null)return r;for(let i=0;ie.index)break;r.push(s)}}return r}static findNodesAfterPosition(e,n){let r=[];if(e==null)return r;for(let i=0;ie.index&&r.push(s)}return r}static findNodeBeforePosition(e,n){if(e==null)return null;let r=null;for(let i=0;ie.index)break;r=s}}return r}static findNodeAfterPosition(e,n){if(e==null)return null;for(let r=0;re.index)return i}return null}static findNodeAtPosition(e,n){if(e==null)return null;for(let r=0;r=i.startPosition.index&&e.index<=i.endPosition.index)return i}return null}static isLiteralType(e){return e instanceof rn||e instanceof Qe}};var Nl=class{static isModifierLeftOf(e,n){return Nl.isModifierLeftOfPosition(e.startPosition,n)}static isModifierLeftOfPosition(e,n){let r=gt.findAbstractNodesBeforePosition(e,n);for(let i=r.length-1;i>=0;i--){let s=r[i];if(s instanceof zt||s instanceof Bt)return!1;if(s instanceof vn)return!0}return!1}};var vl=class{constructor(){this.isRightOfOperator=!1;this.isLeftOfOperator=!1}static resolveContext(e,n,r){let i=new vl;return r!=null&&(r.prev!=null&&Rt.isOperatorType(r.prev)&&(i.isRightOfOperator=!0),r.next!=null&&Rt.isOperatorType(r.next)&&(i.isLeftOfOperator=!0)),i}};var am=class{constructor(){this.inTagPart=!1;this.inMethodPart=!1}};var Pl=class{constructor(){this.modifierChain=null;this.activeModifier=null;this.name="";this.inModifierName=!1;this.inModifierParameter=!1;this.valueCount=0;this.activeValueIndex=-1;this.activeValue=null}static resolveContext(e,n,r,i){let s=n.getParser(),o=new Pl,a=s.getLanguageParser().getCreatedModifierChains(),l=null;for(let u=0;u(o[o.Unknown=0]="Unknown",o[o.Variable=1]="Variable",o[o.Modifier=2]="Modifier",o[o.Parameter=3]="Parameter",o[o.General=4]="General",o[o.LanguageOperator=5]="LanguageOperator",o))(um||{});var Sl=class{constructor(){this.variableNode=null;this.varPathText=""}static resolveContext(e,n,r,i){var f;if(r==null)return null;let s=r,o=i.getDocumentParser().getLanguageParser(),a=new Sl,l=(f=i.wordAt(e))!=null?f:"";r instanceof It&&o.isMergedVariableComponent(r)==!1&&r.prev instanceof oe&&(s=r.prev);let u="";if(o.isMergedVariableComponent(s)){let m=o.getMergedVariable(s);m.startPosition!=null&&(u=i.getText(m.startPosition.index,e.index).trim()),a.variableNode=m}else s instanceof oe&&(a.variableNode=s,u=s.name,s.variableReference!=null&&(u=s.variableReference.normalizedReference));u.length>0&&(u=Pt(u,"\\.",":"));let c=u.split(":");return l.trim().length>0&&c.pop(),u=c.join(":"),u.endsWith(":")&&(u=wr(u,":")),a.varPathText=u,a}};var Fi=class{static resolveIdentifierContext(e,n){let r=new am;return n.nameMethodPartStartsOn!=null?e.char=n.nameStartsOn.char&&(_=!0),n.nameEndsOn!=null&&e.char>n.nameEndsOn.char&&(_=!1),_&&(m.isCursorInIdentifier=!0,m.identifierContext=Fi.resolveIdentifierContext(e,n))}n.addContext(m),s!=null&&s.addContext(m),m.interpolatedContext=i,m.node=n,m.position=e,m.root=s,m.leftPunctuation=r.punctuationLeftAt(e),m.rightPunctuation=r.punctuationRightAt(e),m.leftChar=r.charLeftAt(e),m.rightChar=r.charRightAt(e),m.word=r.wordAt(e),m.char=r.charAt(e),m.leftWord=r.wordLeftAt(e),m.rightWord=r.wordRightAt(e);let p=!1;if(n.parameters.length>0)for(let _=0;_C.blockPosition.start.char&&e.char<=C.blockPosition.end.char+1&&e.line>=((l=(a=(o=C.namePosition)==null?void 0:o.start)==null?void 0:a.line)!=null?l:C.blockPosition.start.line)&&e.line<=((f=(c=(u=C.valuePosition)==null?void 0:u.end)==null?void 0:c.line)!=null?f:C.blockPosition.end.line)){m.cursorContext=3,m.parameterContext=Il.resolveContext(e,C),m.isInParameter=!0,m.feature=C,p=!0;break}}if(p||n.runtimeNodes.forEach(_=>{_.startPosition!=null&&_.endPosition!=null&&e.isWithin(_.startPosition,_.endPosition,1)&&(m.feature=_)}),p&&n.interpolationRegions.size>0){let _=Array.from(n.interpolationRegions,([C,h])=>h);for(let C=0;C<_.length;C++){let h=_[C];if(e.index>=h.startOffset&&e.index<=h.endOffset){let b=n.getInterpolationNode(h.varContent);return Fi.resolveContext(e,b,r,!0,s)}}}return m.feature instanceof oe&&m.feature.isInterpolationReference&&m.feature.parent!=null&&m.feature.parent instanceof B&&m.feature.parent.processedInterpolationRegions.has(m.feature.name)?Fi.resolveContext(e,m.feature.parent.getInterpolationNode(m.feature.name),r,!0,s):(Nl.isModifierLeftOfPosition(e,n.runtimeNodes)?(m.cursorContext=2,m.modifierContext=Pl.resolveContext(e,n,m.feature,r)):p||(m.cursorContext=4,m.generalContext=vl.resolveContext(e,n,m.feature)),m.variableContext=Sl.resolveContext(e,n,m.feature,r),m)}return null}};var Js=class{static isPairedNode(e){return e instanceof vt?!0:e instanceof Gn||e instanceof B?e.isClosedBy!=null:!1}static findAncestorsBeforePosition(e,n){var a,l,u,c,f,m;let r=[],i=[],s=-1,o=-1;for(let p=0;p-1&&d.endPosition!=null&&(d.endPosition.line-1&&d.endPosition.char{gt.isBefore(o.target,s)&&i.push(o)}),i}getAssignmentsAfter(e,n){let r=this.doc.getDocumentParser().getLanguageParser().getRuntimeAssignments(),i=[],s=this.position(e,n);return s!=null&&r.forEach(o=>{gt.isAfter(o.target,s)&&i.push(o)}),i}getNodesAfter(e,n){return gt.findNodesAfterPosition(this.position(e,n),this.doc.getDocumentParser().getNodes())}getIsWithinPairedNode(e,n){let r=this.getNodeBefore(e,n);return r==null?!1:Js.isPairedNode(r)}position(e,n){return this.doc.getDocumentParser().positionFromCursor(e,n)}charLeftAt(e,n){return this.doc.getDocumentParser().charLeftAtCursor(e,n)}charAt(e,n){return this.doc.getDocumentParser().charAtCursor(e,n)}charRightAt(e,n){return this.doc.getDocumentParser().charRightAtCursor(e,n)}wordLeftAt(e,n,r=4){return this.doc.getDocumentParser().wordLeftAtCursor(e,n,r)}wordRightAt(e,n,r=4){return this.doc.getDocumentParser().wordRightAtCursor(e,n,r)}wordAt(e,n,r=4){return this.doc.getDocumentParser().wordAtCursor(e,n,r)}punctuationLeftAt(e,n,r=4){return this.doc.getDocumentParser().punctuationLeftAtCursor(e,n,r)}punctuationRightAt(e,n,r=4){return this.doc.getDocumentParser().punctuationRightAtCursor(e,n,r)}};var fm=class{constructor(e){this.doc=e}hasStructureErrors(){return this.doc.getDocumentParser().getStructureErrors().length>0}getFirstStructureError(){return this.doc.getDocumentParser().getStructureErrors()[0]}hasAny(){return this.all().length>0}all(){let e=[],n=[];return this.doc.getAllAntlersNodes().forEach(r=>{r.getErrors().forEach(i=>{e.includes(i.hash())==!1&&(e.push(i.hash()),n.push(i))})}),this.doc.getDocumentParser().getAntlersErrors().forEach(r=>{e.includes(r.hash())==!1&&(e.push(r.hash()),n.push(r))}),n}};var zv=Q(mi());var xn=Q(Kv(),1),bJ=xn.default.binaryOptions,TJ=xn.default.boolOptions,NJ=xn.default.intOptions,vJ=xn.default.nullOptions,PJ=xn.default.strOptions,IJ=xn.default.Schema,SJ=xn.default.Alias,CJ=xn.default.Collection,RJ=xn.default.Merge,AJ=xn.default.Node,$v=xn.default.Pair,Ll=xn.default.Scalar,Dl=xn.default.YAMLMap,xa=xn.default.YAMLSeq;var Cm=class{constructor(e){this.documentScope=null;this.project=e}getKeyValue(e){return e instanceof Ll?e.value:""}getNodeValue(e){return e instanceof Ll?e.value:e instanceof Dl?this.analyzeDocument(e.items):e instanceof xa?this.analyzeDocument(e.items):""}getScalarRuntimeType(e){return parseFloat(e).toString()==e||parseInt(e).toString()==e?"number":"string"}analyzeDocument(e){let n=new Qn(this.project);return e.forEach(r=>{if(r instanceof $v){let i=this.getKeyValue(r.key),s=this.getNodeValue(r.value);if(r.value instanceof Ll)n.addVariable({dataType:this.getScalarRuntimeType(s),introducedBy:null,name:i,sourceField:null,sourceName:"*frontmatter"});else if(r.value instanceof xa&&r.key instanceof Ll){let o=new Qn(this.project);r.value.items.forEach(a=>{let l=this.getNodeValue(a);o.addVariable({dataType:this.getScalarRuntimeType(l),introducedBy:null,name:a.value,sourceField:null,sourceName:"*frontmatter"})}),n.addScopeList(r.key.value,o)}else n.addScopeList(i,s)}}),n}parse(e){let n=zv.parseDocument(e);try{n.contents instanceof Dl&&(this.documentScope=this.analyzeDocument(n.contents.items))}catch{this.documentScope=null}}hasScope(){return this.documentScope!=null}getScope(){return this.documentScope}};var Rm=class{constructor(e){this.doc=e}getAncestors(e){return Js.findAncestorsBeforePosition(e,this.doc.getAllAntlersNodes())}getNodeAt(e){return gt.findNodeAtPosition(e,this.doc.getDocumentParser().getNodes())}getNodesBefore(e){return gt.findNodesBeforePosition(e,this.doc.getDocumentParser().getNodes())}getNodeBefore(e){return gt.findNodeBeforePosition(e,this.doc.getDocumentParser().getNodes())}getNodeAfter(e){return gt.findNodeAfterPosition(e,this.doc.getDocumentParser().getNodes())}getNodesAfter(e){return gt.findNodesAfterPosition(e,this.doc.getDocumentParser().getNodes())}getIsWithinPairedNode(e){let n=this.getNodeBefore(e);return n==null?!1:Js.isPairedNode(n)}filter(e){return this.doc.getDocumentParser().getNodes().filter(e)}getComments(){let e=[];return this.doc.getAllNodes().forEach(n=>{n instanceof B&&n.isComment&&e.push(n)}),e}getMultilineNodes(){let e=[];return this.doc.getAllNodes().forEach(n=>{var r,i;n instanceof B&&!n.isComment&&((r=n.startPosition)==null?void 0:r.line)!=((i=n.endPosition)==null?void 0:i.line)&&e.push(n)}),e}getMultiLineComments(){let e=[];return this.getComments().forEach(n=>{var r,i;((r=n.startPosition)==null?void 0:r.line)!=((i=n.endPosition)==null?void 0:i.line)&&e.push(n)}),e}getAllLiteralNodes(){let e=[];return this.doc.getAllNodes().forEach(n=>{(n instanceof Qe||n instanceof rn)&&e.push(n)}),e}getStructuralNodes(){let e=[];return this.doc.getDocumentParser().getRenderNodes().forEach(n=>{n instanceof B?e.push(n):n instanceof vt&&n.logicBranches.length>0&&n.logicBranches.forEach(r=>{if(r.head!=null){let i=r.head;i.originalNode!=null?e.push(i.originalNode):e.push(i)}})}),e}getAllRuntimeNodes(){let e=[];return this.doc.getAllNodes().forEach(n=>{(n instanceof Gn||n instanceof B)&&n.runtimeNodes.length>0&&n.runtimeNodes.forEach(r=>{e.push(r)})}),e}getAllParameterNodes(){let e=[];return this.doc.getAllNodes().forEach(n=>{(n instanceof Gn||n instanceof B)&&n.hasParameters&&n.parameters.forEach(r=>{e.push(r)})}),e}getAssignmentNodes(){return gt.findAssignmentNodes(this.getAllRuntimeNodes())}};var Am=class{constructor(e){this.doc=e}getAllSelfClosingNodes(){let e=[];return this.doc.getAllNodes().forEach(n=>{n instanceof B&&n.isSelfClosing&&e.push(n)}),e}getAllPairedNodes(){let e=[];return this.doc.getAllNodes().forEach(n=>{(n instanceof B||n instanceof ft)&&n.isClosedBy!=null&&!n.isSelfClosing&&e.push(n)}),e}};var lf=class{static printComment(e,n,r){let i=e.getContent(),s=i.trim();if(s.includes(` `)){let o=G.breakByNewLine(i.trim()),a=[];o.forEach(c=>{a.push(" ".repeat(n+r)+c.trim())});let l=a.join(` `),u=`{{# `;return u+=l,u+=` @@ -322,34 +324,34 @@ Includes another view into the current template. `)}return l}static shiftClean(e,n){let r=G.breakByNewLine(e),i=[],s=" ".repeat(n),o=!1;return r.forEach(a=>{a.trim().length>0&&(o=!0),!!o&&i.push(s+a)}),i.join(` `)}static inferIndentLevel(e,n,r){let i=0,s=-1;for(let o=0;o0)for(let o=s-1;o>=0;o--){let a=e[o],l=a.trim(),u=a.trimLeft(),c=a.length-l.length;if(u.length!=0&&c!=i&&c0&&(this.buffer+=r+" ")}setIndentSeed(e){return this.indentSeed=e,this}close(){return this.closeString==" }}"?this.buffer.endsWith(" ")?this.buffer+="}}":this.buffer+=this.closeString:this.buffer+=this.closeString,this}appendT(e){return this.buffer.endsWith(" ")&&(this.buffer=this.buffer.trimEnd()),this.buffer+=e,this}appendTS(e){return this.buffer.endsWith(" ")&&(this.buffer=this.buffer.trimEnd()),this.buffer.endsWith("{")&&(e=e.trimStart()),this.buffer+=e,this}append(e){return this.buffer+=e,this}appendOS(e){return this.buffer.endsWith(" ")==!1&&this.buffer.endsWith("(")==!1&&this.buffer.endsWith("{")==!1&&this.buffer.endsWith("[")==!1&&this.buffer.endsWith(":")==!1&&(this.buffer+=" "),this.append(e)}appendS(e){let n="";return this.buffer.endsWith(" ")==!1&&(n+=" "),n+=e+" ",this.buffer+=n,this}indent(){let e=this.baseIndent;return e==0?e=1:e+=2,this.relativeIndentSize>0&&(e+=this.relativeIndentSize),this.buffer+=" ".repeat(e),this}addIndent(e){return e<=0?this:(this.buffer+=" ".repeat(e),this)}paramS(e){let n=" ";return e.isVariableReference&&(n+=":"),n+=e.name+"="+e.nameDelimiter+e.value+e.nameDelimiter,this.append(n),this}replace(e,n){return this.buffer=Pt(this.buffer,e,n),this}relativeIndent(e){let n=this.buffer.split(` `);if(n.length==0)return this;let r=n[n.length-1].trimEnd();return r.endsWith("(")&&(r=r.slice(0,-1)),r.endsWith(e)==!1?this:(this.relativeIndentSize=r.lastIndexOf(e),this)}newlineIndent(){return this.newLine(),this.indent(),this}newlineNDIndent(){return this.buffer=this.buffer.trimEnd(),this.newLine(),this.indent(),this}newLine(){return this.buffer+=` -`,this}getContent(){return this.buffer}endsWith(e){return this.buffer.endsWith(e)}};var Dl=class{static prettyPrintNode(e,n,r,i,s,o){var c,f,m,d,p,_,C;let a=e.getTrueRuntimeNodes(),l=0,u=0;if(a.length>0){let h=new xm(e,r,s);o!=null&&h.setIndentSeed(o);let b=null;for(let N=0;N1?h.newlineNDIndent().indent().addIndent(6).appendS(S.name):h.appendS(S.name);b=S;continue}S.mergeRefName!=null&&S.mergeRefName.trim().length>0&&S.mergeRefName!=S.name?h.append(S.mergeRefName.trim()):S.name=="as"?h.appendOS("as"):h.append(S.name.trim())}else if(S instanceof Yr)if(h.appendTS(" list"),N+10&&(O=S.rawLexContent.trim()),h.append(O)}else if(S instanceof Kn)h.appendS("=");else if(S instanceof In)h.appendS("=>");else if(S instanceof Wn)h.appendS("+");else if(S instanceof Tn){if(n.getDocumentParser().getLanguageParser().isMergedVariableComponent(S)){h.append("-");continue}if(S.prev!=null&&S.next!=null&&nt.distance(S.prev,S)<=1&&nt.distance(S.next,S)<=1){S.next instanceof Lt&&S.prev instanceof Lt?h.appendS("-"):h.append("-"),b=S;continue}h.appendS("-")}else if(S instanceof Yn)h.appendS("*");else if(S instanceof Hn){if(b=S,(C=S.startPosition)==null?void 0:C.isBefore(e.nameEndsOn)){h.append("/");continue}if(n.getDocumentParser().getLanguageParser().isMergedVariableComponent(S))continue;h.appendS("/");continue}else S instanceof sn?S.isListGroupMember?(h.append(";").newlineIndent().indent().addIndent(7),N+1{h.paramS(N)}),h.close();let g=h.getContent();return e.processedInterpolationRegions.size>0&&e.processedInterpolationRegions.forEach((N,S)=>{let V=Dl.prettyPrintNode(N[0],n,r,i,null,null);g=Pt(g,S,V)}),g}return e.getTrueRawContent()}};var kl=class{constructor(e){this.htmlFormatter=null;this.yamlFormatter=null;this.phpFormatter=null;this.slugs=[];this.removeLines=[];this.virtualStructureOpens=[];this.virtualStructureClose=[];this.structureLines=[];this.parentTransformer=null;this.tagPairs=new Map;this.conditions=[];this.inlineIfs=new Map;this.createExraStructuralPairs=!1;this.spanNodes=new Map;this.inlineNodes=new Map;this.virtualBlocks=[];this.inlineComments=new Map;this.blockComments=[];this.extractedEmbeddedDocuments=new Map;this.dynamicElementAntlers=new Map;this.dynamicElementAntlersNodes=new Map;this.dynamicElementPairedAntlers=new Map;this.dynamicElementPairedAntlersNodes=new Map;this.dynamicElementConditionAntlers=new Map;this.dynamicElementConditionAntlersNodes=new Map;this.noParses=new Map;this.forceBreaks=[];this.forceCleanLines=["{{ /if","{{ /unless","{{ /noparse","{{ else","{{ unless"];this.doc=e,this.options={tabSize:4,newlinesAfterFrontMatter:1,maxAntlersStatementsPerLine:3,endNewline:!0}}withHtmlFormatter(e){return this.htmlFormatter=e,this}withYamlFormatter(e){return this.yamlFormatter=e,this}withPhpFormatter(e){return this.phpFormatter=e,this}withOptions(e){return this.options=e,this.options.tabSize<=0&&(this.options.tabSize=4),this.options.newlinesAfterFrontMatter<0&&(this.options.newlinesAfterFrontMatter=1),this}setParentTransformer(e){return this.parentTransformer=e,this}close(e){return""}open(e){return"<"+e+">"}selfClosing(e){return"<"+e+" />"}pair(e,n=""){return"<"+e+">"+n+""}makeSlug(e){e<=2&&(e=7);let n="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=r.length;for(let o=0;o{n=n.replace(i,r.nodeContent)}),n}registerCondition(e){this.parentTransformer!=null?this.parentTransformer.registerCondition(e):this.conditions.push(e)}registerInlineCondition(e,n){this.parentTransformer!=null?this.parentTransformer.registerInlineCondition(e,n):this.inlineIfs.set(e,n)}registerVirtualBlock(e){this.parentTransformer!=null?this.parentTransformer.registerVirtualBlock(e):this.virtualBlocks.push(e)}registerNoParse(e,n){this.parentTransformer!=null?this.parentTransformer.registerNoParse(e,n):this.noParses.set(e,n)}prepareNoParse(e){let n=this.makeSlug(35);return this.registerNoParse(n,e),n}registerForcedBreak(){if(this.parentTransformer!=null)return this.parentTransformer.registerForcedBreak();{let e=this.makeSlug(15),n=this.makeSlug(10);return this.forceBreaks.push(e),this.forceBreaks.push(n),this.removeLines.push(this.open(e)),this.removeLines.push(this.close(e)),this.removeLines.push(this.selfClosing(n)),this.pair(e,this.selfClosing(n))}}transformVirtualStructures(e){let n=e;return this.virtualBlocks.forEach(r=>{var s;this.removeLines.push(r.pairClose);let i=this.indentLevel(r.pairOpen);if(r.virtualElement.length>0&&(this.removeLines.push(this.open(r.virtualElement)),this.removeLines.push(this.close(r.virtualElement))),r.node instanceof rn){let o="{{ noparse }}"+r.node.getInnerDocumentText();n=n.replace(r.pairOpen,o)}if(r.node instanceof B){let o=r.node;n=n.replace(r.pairClose,(s=o.isClosedBy)==null?void 0:s.getOriginalContent())}else this.removeLines.push(r.pairClose)}),this.noParses.forEach((r,i)=>{n=n.replace(i,`{{ noparse }}${r.getInnerDocumentText()}{{ /noparse }}`)}),n}printNode(e,n=null){let r=e.getTrueNode(),i=this.doc;e.childDocument!=null&&(i=e.childDocument.document);let s=null;if($t.isConditionalStructure(e)&&(s=r.runtimeName(),e.isClosingTag&&(s=="if"||s=="unless")))return`{{ /${s} }}`;if(e.isClosingTag)return r.runtimeName()=="endunless"?"{{ /unless }}":`{{ ${r.content.trim()} }}`;let o=Dl.prettyPrintNode(r,i,0,this.options,s,null);return n!=null&&o.includes(` -`)&&(o=Ea.shiftIndent(o,n-this.options.tabSize*2,!0)),o}transformConditions(e){let n=e;return this.conditions.forEach(r=>{r.structures.forEach(i=>{let s=i.branch.head;i.virtualBreakOpen.length>0&&this.removeLines.push(i.virtualBreakOpen),i.virtualBreakClose.length>0&&(n=n.replace(i.virtualBreakClose,i.virtualBreakClose+` -`),this.removeLines.push(i.virtualBreakClose)),this.virtualStructureOpens.push(i.virtualOpen),this.removeLines.push(i.virtualOpen),this.removeLines.push(i.virtualClose),i.isLast?(n=n.replace(i.pairOpen,this.printNode(s,this.indentLevel(i.pairOpen))),n=n.replace(i.pairClose,this.printNode(s.isClosedBy))):(this.removeLines.push(i.pairClose),n=n.replace(i.pairOpen,this.printNode(s,this.indentLevel(i.pairOpen))))})}),n}transformExtractedDocuments(e){let n=e;return this.extractedEmbeddedDocuments.forEach((r,i)=>{let s="",o=0;r.isScript?s="//"+i:s="/*"+i+"*/",o=this.indentLevel(s),n.includes(s)&&(n=n.replace(s,Ea.indentRelative(r.content,o)))}),n}getAntlersChildDoc(e){return e.childDocument!=null?e.childDocument.document.transform().setParentTransformer(this).toStructure():this.clone().toStructure(e.getImmediateChildren())}prepareCondition(e){let n=e.logicBranches[0].head;if(n.fragmentPosition==2||n.fragmentPosition==1){let l=this.makeSlug(e.nodeContent.length);return this.registerInlineCondition(l,e),l}if(n.fragmentPosition==0)return this.prepareDynamicCondition(e);let r=[],i="";n.prev instanceof B&&n.prev.isInlineAntlers&&(i+=this.registerForcedBreak()),e.logicBranches.forEach((l,u)=>{var _,C,h,b;let c=l.head,f=this.getAntlersChildDoc(l),m=this.makeSlug(c.sourceContent.length),d=this.makeSlug(10),p={branch:l,slug:m,doc:f,pairOpen:this.open(m),pairClose:this.close(m),virtualOpen:this.open(d),virtualClose:this.close(d),isFirst:u==0,isLast:u==e.logicBranches.length-1,virtualBreakClose:"",virtualBreakOpen:""};if(((C=(_=l.head)==null?void 0:_.name)==null?void 0:C.getCompoundTagName())=="else"){i+=` -`+p.pairOpen;let g=this.makeSlug(25);this.createExraStructuralPairs&&l.head.containsChildStructures==!1&&l.head.containsAnyFragments==!1?(p.virtualBreakOpen=this.open(g),p.virtualBreakClose=this.close(g),i+=p.virtualBreakOpen+` +`,this}getContent(){return this.buffer}endsWith(e){return this.buffer.endsWith(e)}};var kl=class{static prettyPrintNode(e,n,r,i,s,o){var c,f,m,p,d,_,C;let a=e.getTrueRuntimeNodes(),l=0,u=0;if(a.length>0){let h=new xm(e,r,s);o!=null&&h.setIndentSeed(o);let b=null;for(let N=0;N1?h.newlineNDIndent().indent().addIndent(6).appendS(S.name):h.appendS(S.name);b=S;continue}S.mergeRefName!=null&&S.mergeRefName.trim().length>0&&S.mergeRefName!=S.name?h.append(S.mergeRefName.trim()):S.name=="as"?h.appendOS("as"):h.append(S.name.trim())}else if(S instanceof Kr)if(h.appendTS(" list"),N+10&&(O=S.rawLexContent.trim()),h.append(O)}else if(S instanceof Kn)h.appendS("=");else if(S instanceof In)h.appendS("=>");else if(S instanceof Wn)h.appendS("+");else if(S instanceof Tn){if(n.getDocumentParser().getLanguageParser().isMergedVariableComponent(S)){h.append("-");continue}if(S.prev!=null&&S.next!=null&&nt.distance(S.prev,S)<=1&&nt.distance(S.next,S)<=1){S.next instanceof Lt&&S.prev instanceof Lt?h.appendS("-"):h.append("-"),b=S;continue}h.appendS("-")}else if(S instanceof Yn)h.appendS("*");else if(S instanceof Hn){if(b=S,(C=S.startPosition)==null?void 0:C.isBefore(e.nameEndsOn)){h.append("/");continue}if(n.getDocumentParser().getLanguageParser().isMergedVariableComponent(S))continue;h.appendS("/");continue}else S instanceof sn?S.isListGroupMember?(h.append(";").newlineIndent().indent().addIndent(7),N+1{h.paramS(N)}),h.close();let g=h.getContent();return e.processedInterpolationRegions.size>0&&e.processedInterpolationRegions.forEach((N,S)=>{let V=kl.prettyPrintNode(N[0],n,r,i,null,null);g=Pt(g,S,V)}),g}return e.getTrueRawContent()}};var Ml=class{constructor(e){this.htmlFormatter=null;this.yamlFormatter=null;this.phpFormatter=null;this.slugs=[];this.removeLines=[];this.virtualStructureOpens=[];this.virtualStructureClose=[];this.structureLines=[];this.parentTransformer=null;this.tagPairs=new Map;this.conditions=[];this.inlineIfs=new Map;this.createExraStructuralPairs=!1;this.spanNodes=new Map;this.inlineNodes=new Map;this.virtualBlocks=[];this.inlineComments=new Map;this.blockComments=[];this.extractedEmbeddedDocuments=new Map;this.dynamicElementAntlers=new Map;this.dynamicElementAntlersNodes=new Map;this.dynamicElementPairedAntlers=new Map;this.dynamicElementPairedAntlersNodes=new Map;this.dynamicElementConditionAntlers=new Map;this.dynamicElementConditionAntlersNodes=new Map;this.noParses=new Map;this.forceBreaks=[];this.forceCleanLines=["{{ if ","{{ /if","{{ /unless","{{ /noparse","{{ else","{{ unless"];this.doc=e,this.options={tabSize:4,newlinesAfterFrontMatter:1,maxAntlersStatementsPerLine:3,endNewline:!0}}produceExtraStructuralPairs(e){return this.createExraStructuralPairs=e,this}withHtmlFormatter(e){return this.htmlFormatter=e,this}withYamlFormatter(e){return this.yamlFormatter=e,this}withPhpFormatter(e){return this.phpFormatter=e,this}withOptions(e){return this.options=e,this.options.tabSize<=0&&(this.options.tabSize=4),this.options.newlinesAfterFrontMatter<0&&(this.options.newlinesAfterFrontMatter=1),this}setParentTransformer(e){return this.parentTransformer=e,this}close(e){return""}open(e){return"<"+e+">"}selfClosing(e){return"<"+e+" />"}pair(e,n=""){return"<"+e+">"+n+""}makeSlug(e){e<=2&&(e=7);let n="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=r.length;for(let o=0;o{n=n.replace(i,r.nodeContent)}),n}registerCondition(e){this.parentTransformer!=null?this.parentTransformer.registerCondition(e):this.conditions.push(e)}registerInlineCondition(e,n){this.parentTransformer!=null?this.parentTransformer.registerInlineCondition(e,n):this.inlineIfs.set(e,n)}registerVirtualBlock(e){this.parentTransformer!=null?this.parentTransformer.registerVirtualBlock(e):this.virtualBlocks.push(e)}registerNoParse(e,n){this.parentTransformer!=null?this.parentTransformer.registerNoParse(e,n):this.noParses.set(e,n)}prepareNoParse(e){let n=this.makeSlug(35);return this.registerNoParse(n,e),n}registerForcedBreak(){if(this.parentTransformer!=null)return this.parentTransformer.registerForcedBreak();{let e=this.makeSlug(15),n=this.makeSlug(10);return this.forceBreaks.push(e),this.forceBreaks.push(n),this.removeLines.push(this.open(e)),this.removeLines.push(this.close(e)),this.removeLines.push(this.selfClosing(n)),this.pair(e,this.selfClosing(n))}}transformVirtualStructures(e){let n=e;return this.virtualBlocks.forEach(r=>{var s;this.removeLines.push(r.pairClose);let i=this.indentLevel(r.pairOpen);if(r.virtualElement.length>0&&(this.removeLines.push(this.open(r.virtualElement)),this.removeLines.push(this.close(r.virtualElement))),r.node instanceof rn){let o="{{ noparse }}"+r.node.getInnerDocumentText();n=n.replace(r.pairOpen,o)}if(r.node instanceof B){let o=r.node;n=n.replace(r.pairClose,(s=o.isClosedBy)==null?void 0:s.getOriginalContent())}else this.removeLines.push(r.pairClose)}),this.noParses.forEach((r,i)=>{n=n.replace(i,`{{ noparse }}${r.getInnerDocumentText()}{{ /noparse }}`)}),n}printNode(e,n=null){let r=e.getTrueNode();if((r.rawStart=="{{?"||r.rawStart=="{{$")&&this.phpFormatter!=null)try{let a=this.phpFormatter(r.content);return`${r.rawStart} ${a} ${r.rawEnd}`}catch{}let i=this.doc;e.childDocument!=null&&(i=e.childDocument.document);let s=null;if($t.isConditionalStructure(e)&&(s=r.runtimeName(),e.isClosingTag&&(s=="if"||s=="unless")))return`{{ /${s} }}`;if(e.isClosingTag)return r.runtimeName()=="endunless"?"{{ /unless }}":`{{ ${r.content.trim()} }}`;let o=kl.prettyPrintNode(r,i,0,this.options,s,null);return n!=null&&o.includes(` +`)&&(o=Ea.shiftIndent(o,n-this.options.tabSize*2,!0)),o}transformConditions(e){let n=e;return this.conditions.forEach(r=>{r.structures.forEach(i=>{let s=i.branch.head;if(i.virtualBreakOpen.length>0&&this.removeLines.push(i.virtualBreakOpen),i.virtualBreakClose.length>0&&(n=n.replace(i.virtualBreakClose,i.virtualBreakClose+` +`),this.removeLines.push(i.virtualBreakClose)),this.virtualStructureOpens.push(i.virtualOpen),this.removeLines.push(i.virtualOpen),this.removeLines.push(i.virtualClose),i.isLast){let o=this.selfClosing(i.virtualSlug);n.includes(o)&&(n=n.replace(o,i.doc.trim())),n=n.replace(i.pairOpen,this.printNode(s,this.indentLevel(i.pairOpen))),n=n.replace(i.pairClose,this.printNode(s.isClosedBy))}else{let o=this.selfClosing(i.virtualSlug);n.includes(o)&&(n=n.replace(o,i.doc.trim())),this.removeLines.push(i.pairClose),n=n.replace(i.pairOpen,this.printNode(s,this.indentLevel(i.pairOpen)))}})}),n}transformExtractedDocuments(e){let n=e;return this.extractedEmbeddedDocuments.forEach((r,i)=>{let s="",o=0;r.isScript?s="//"+i:s="/*"+i+"*/",o=this.indentLevel(s),n.includes(s)&&(n=n.replace(s,Ea.indentRelative(r.content,o)))}),n}getAntlersChildDoc(e){return e.childDocument!=null?e.childDocument.document.transform().setParentTransformer(this).toStructure():this.clone().toStructure(e.getImmediateChildren())}prepareCondition(e){let n=e.logicBranches[0].head;if(n.fragmentPosition==2||n.fragmentPosition==1){let l=this.makeSlug(e.nodeContent.length);return this.registerInlineCondition(l,e),l}if(n.fragmentPosition==0)return this.prepareDynamicCondition(e);let r=[],i="";n.prev instanceof B&&n.prev.isInlineAntlers&&(i+=this.registerForcedBreak()),e.logicBranches.forEach((l,u)=>{var _,C,h,b;let c=l.head,f=this.getAntlersChildDoc(l),m=this.makeSlug(c.sourceContent.length),p=this.makeSlug(10),d={branch:l,slug:m,doc:f,pairOpen:this.open(m),pairClose:this.close(m),virtualOpen:this.open(p),virtualClose:this.close(p),virtualSlug:p,isFirst:u==0,isLast:u==e.logicBranches.length-1,virtualBreakClose:"",virtualBreakOpen:""};if(((C=(_=l.head)==null?void 0:_.name)==null?void 0:C.getCompoundTagName())=="else"){i+=` +`+d.pairOpen;let g=this.makeSlug(25);this.createExraStructuralPairs&&l.head.containsChildStructures==!1&&l.head.containsAnyFragments==!1?(d.virtualBreakOpen=this.open(g),d.virtualBreakClose=this.close(g),d.virtualSlug=g,i+=` +`+this.selfClosing(g),i+=d.pairClose+` +`):(d.virtualBreakOpen=this.selfClosing(g),i+=d.virtualBreakOpen+` `,i+=f,i+=` -`+p.virtualBreakClose+` -`+p.pairClose):(p.virtualBreakOpen=this.selfClosing(g),i+=p.virtualBreakOpen+` +`+d.pairClose)}else if(this.createExraStructuralPairs&&((h=l.head)==null?void 0:h.containsAnyFragments)==!1&&((b=l.head)==null?void 0:b.containsChildStructures)==!1){let g=this.makeSlug(25);d.virtualBreakOpen=this.open(g),d.virtualBreakClose=this.close(g),d.virtualSlug=g,i+=` +`+d.pairOpen,i+=` +`+this.selfClosing(g),i+=d.pairClose+` +`}else i+=d.pairOpen,i+=` `,i+=f,i+=` -`+p.pairClose)}else if(this.createExraStructuralPairs&&((h=l.head)==null?void 0:h.containsAnyFragments)==!1&&((b=l.head)==null?void 0:b.containsChildStructures)==!1){let g=this.makeSlug(25);p.virtualBreakOpen=this.open(g),p.virtualBreakClose=this.close(g),i+=p.pairOpen,i+=` -`+p.virtualBreakOpen,i+=f,i+=` -`+p.virtualBreakClose,i+=p.pairClose}else i+=p.pairOpen,i+=` -`,i+=f,i+=` -`,i+=p.pairClose;r.push(p)});let s=r[0].pairOpen,o=r[r.length-1].pairClose,a={pairOpen:s,pairClose:o,structures:r,condition:e};return this.registerCondition(a),i}registerPairedAntlers(e,n){this.parentTransformer!=null?this.parentTransformer.registerPairedAntlers(e,n):this.tagPairs.set(e,n)}preparePairedAntlers(e){let n=this.makeSlug(e.getOriginalContent().length),r=this.getAntlersChildDoc(e);if(e.fragmentPosition!=0){let i="",s="";if(e.prev instanceof B&&e.prev.isPaired()==!1&&(s+=this.registerForcedBreak()),s+=`${this.open(n)} +`,i+=d.pairClose;r.push(d)});let s=r[0].pairOpen,o=r[r.length-1].pairClose,a={pairOpen:s,pairClose:o,structures:r,condition:e};return this.registerCondition(a),i}registerPairedAntlers(e,n){this.parentTransformer!=null?this.parentTransformer.registerPairedAntlers(e,n):this.tagPairs.set(e,n)}preparePairedAntlers(e){let n=this.makeSlug(e.getOriginalContent().length),r=this.getAntlersChildDoc(e);if(e.fragmentPosition!=0){let i="",s="";if(e.prev instanceof B&&e.prev.isPaired()==!1&&(s+=this.registerForcedBreak()),s+=`${this.open(n)} `,e.containsChildStructures==!1&&e.containsAnyFragments==!1){let o=!1,a=!0,l=!0,u=0;for(let f=0;f0){o=!0,a=!1;break}}e.children.length==2&&e.children[0]instanceof B&&(o=!0);let c=0;for(let f=0;f{let s=this.printNode(r);n=Pt(n,i,s)}),this.dynamicElementPairedAntlersNodes.forEach((r,i)=>{let s=r.nodeContent;n=Pt(n,i,s)}),this.dynamicElementConditionAntlersNodes.forEach((r,i)=>{let s=r.nodeContent;n=Pt(n,i,s)}),n}transformPairedAntlers(e){let n=e;return this.tagPairs.forEach((r,i)=>{let s=r.tag;if(r.virtualElementSlug.length>0){let l=this.open(r.virtualElementSlug),u=this.close(r.virtualElementSlug);this.virtualStructureOpens.push(l),this.removeLines.push(l),this.removeLines.push(u)}let o=this.open(i),a=this.close(i);n=n.replace(o,this.printNode(s,this.indentLevel(o))),n=n.replace(a,this.printNode(s.isClosedBy))}),n}transformInlineAntlers(e){let n=e;return this.inlineNodes.forEach((r,i)=>{let s=this.selfClosing(i);n=n.replace(s,this.printNode(r,this.indentLevel(s)))}),this.spanNodes.forEach((r,i)=>{n=n.replace(i,this.printNode(r))}),n}transformComments(e){let n=e;return this.inlineComments.forEach((r,i)=>{let s=this.selfClosing(i);n=n.replace(s,af.printComment(r,this.options.tabSize,0))}),this.blockComments.forEach(r=>{let i=r.node;n=n.replace(r.pairOpen,af.printComment(i,this.options.tabSize,this.indentLevel(r.pairOpen))),this.removeLines.push(r.pairClose),this.removeLines.push(r.virtualElement)}),n}registerEmbeddedDocument(e,n,r){return this.parentTransformer!=null?this.parentTransformer.registerEmbeddedDocument(e,n,r):(this.extractedEmbeddedDocuments.set(e,{slug:e,content:n,isScript:r}),e)}clone(){let e=new kl(this.doc);return e.withOptions(this.options).setParentTransformer(this),e}toStructure(e=null){let n="";e==null&&(e=this.doc.getDocumentParser().getRenderNodes()),e.forEach(i=>{i instanceof Qe?n+=i.sourceContent:i instanceof vt?n+=this.prepareCondition(i):i instanceof rn?n+=this.prepareNoParse(i):i instanceof B&&(i.isComment?n+=this.prepareComment(i):n+=this.prepareAntlers(i))});let r=this.doc.getDocumentParser().getFragmentsContainingStructures();if(r.length>0){let i=new mt;i.loadString(n),r.forEach(s=>{var d,p,_,C,h,b,g,N;let o=this.doc.getDocumentParser().getText(((p=(d=s.start.endPosition)==null?void 0:d.offset)!=null?p:0)+1,(C=(_=s.end.startPosition)==null?void 0:_.offset)!=null?C:0),a=i.getDocumentParser().getFragmentsParser().getEmbeddedFragment(s.start.embeddedIndex);if(a==null)return;let l=i.getDocumentParser().getFragmentsParser().getClosingFragmentAfter(a);if(l==null)return;let u=i.getDocumentParser().getText(((b=(h=a.endPosition)==null?void 0:h.offset)!=null?b:0)+1,(N=(g=l==null?void 0:l.startPosition)==null?void 0:g.offset)!=null?N:0),c=this.makeSlug(16),f=s.start.name.toLowerCase()=="script",m=c;f?m="//"+c:m="/*"+c+"*/",n=n.replace(u,m),this.registerEmbeddedDocument(c,o,f)})}return n}removeVirtualStructures(e){let n=e;return this.removeLines.forEach(r=>{n=n.replace(r,"")}),n}indentLevel(e){for(let n=0;n0&&n[a].trim().length==0;a--)n.pop();if(!this.removeLines.includes(o)){let a=r[s];this.removeLines.forEach(l=>{a.includes(l)&&(a=a.replace(l,""))}),n.push(a)}}return n.join(` +`+a.pairClose}let i=this.makeSlug(n.length);return this.registerComment(i,e),this.selfClosing(i)}registerDynamicAntlersPair(e,n){this.parentTransformer!=null?(this.dynamicElementPairedAntlers.set(n.nodeContent,e),this.parentTransformer.registerDynamicAntlersPair(e,n)):(this.dynamicElementPairedAntlers.set(n.nodeContent,e),this.dynamicElementPairedAntlersNodes.set(e,n))}prepareConditionalAntlersPair(e){if(this.dynamicElementPairedAntlers.has(e.nodeContent))return this.dynamicElementPairedAntlers.get(e.nodeContent);let n=this.makeSlug(e.nodeContent.length);return this.registerDynamicAntlersPair(n,e),n}registerDynamicCondition(e,n){this.parentTransformer!=null?(this.dynamicElementConditionAntlers.set(n.nodeContent,e),this.parentTransformer.registerDynamicCondition(e,n)):(this.dynamicElementConditionAntlers.set(n.nodeContent,e),this.dynamicElementConditionAntlersNodes.set(e,n))}prepareDynamicCondition(e){if(this.dynamicElementConditionAntlers.has(e.nodeContent))return this.dynamicElementConditionAntlers.get(e.nodeContent);let n=this.makeSlug(e.nodeContent.length);return this.registerDynamicCondition(n,e),n}registerDynamicAntlers(e,n){this.parentTransformer!=null?(this.dynamicElementAntlers.set(n.content,e),this.parentTransformer.registerDynamicAntlers(e,n)):(this.dynamicElementAntlers.set(n.content,e),this.dynamicElementAntlersNodes.set(e,n))}prepareConditionalAntlers(e){if(this.dynamicElementAntlers.has(e.content))return this.dynamicElementAntlers.get(e.content);let n=this.makeSlug(e.content.length);return this.registerDynamicAntlers(n,e),n}prepareAntlers(e){return e.isClosedBy!=null?this.preparePairedAntlers(e):e.fragmentPosition==0?this.prepareConditionalAntlers(e):this.registerInlineAntlers(e)}transformDynamicAntlers(e){let n=e;return this.dynamicElementAntlersNodes.forEach((r,i)=>{let s=this.printNode(r);n=Pt(n,i,s)}),this.dynamicElementPairedAntlersNodes.forEach((r,i)=>{let s=r.nodeContent;n=Pt(n,i,s)}),this.dynamicElementConditionAntlersNodes.forEach((r,i)=>{let s=r.nodeContent;n=Pt(n,i,s)}),n}transformPairedAntlers(e){let n=e;return this.tagPairs.forEach((r,i)=>{let s=r.tag;if(r.virtualElementSlug.length>0){let l=this.open(r.virtualElementSlug),u=this.close(r.virtualElementSlug);this.virtualStructureOpens.push(l),this.removeLines.push(l),this.removeLines.push(u)}let o=this.open(i),a=this.close(i);n=n.replace(o,this.printNode(s,this.indentLevel(o))),n=n.replace(a,this.printNode(s.isClosedBy))}),n}transformInlineAntlers(e){let n=e;return this.inlineNodes.forEach((r,i)=>{let s=this.selfClosing(i);n=n.replace(s,this.printNode(r,this.indentLevel(s)))}),this.spanNodes.forEach((r,i)=>{n=n.replace(i,this.printNode(r))}),n}transformComments(e){let n=e;return this.inlineComments.forEach((r,i)=>{let s=this.selfClosing(i);n=n.replace(s,lf.printComment(r,this.options.tabSize,0))}),this.blockComments.forEach(r=>{let i=r.node;n=n.replace(r.pairOpen,lf.printComment(i,this.options.tabSize,this.indentLevel(r.pairOpen))),this.removeLines.push(r.pairClose),this.removeLines.push(r.virtualElement)}),n}registerEmbeddedDocument(e,n,r){return this.parentTransformer!=null?this.parentTransformer.registerEmbeddedDocument(e,n,r):(this.extractedEmbeddedDocuments.set(e,{slug:e,content:n,isScript:r}),e)}clone(){let e=new Ml(this.doc);return e.withOptions(this.options).setParentTransformer(this),e}toStructure(e=null){let n="";e==null&&(e=this.doc.getDocumentParser().getRenderNodes()),e.forEach(i=>{i instanceof Qe?n+=i.sourceContent:i instanceof vt?n+=this.prepareCondition(i):i instanceof rn?n+=this.prepareNoParse(i):i instanceof B&&(i.isComment?n+=this.prepareComment(i):n+=this.prepareAntlers(i))});let r=this.doc.getDocumentParser().getFragmentsContainingStructures();if(r.length>0){let i=new mt;i.loadString(n),r.forEach(s=>{var p,d,_,C,h,b,g,N;let o=this.doc.getDocumentParser().getText(((d=(p=s.start.endPosition)==null?void 0:p.offset)!=null?d:0)+1,(C=(_=s.end.startPosition)==null?void 0:_.offset)!=null?C:0),a=i.getDocumentParser().getFragmentsParser().getEmbeddedFragment(s.start.embeddedIndex);if(a==null)return;let l=i.getDocumentParser().getFragmentsParser().getClosingFragmentAfter(a);if(l==null)return;let u=i.getDocumentParser().getText(((b=(h=a.endPosition)==null?void 0:h.offset)!=null?b:0)+1,(N=(g=l==null?void 0:l.startPosition)==null?void 0:g.offset)!=null?N:0),c=this.makeSlug(16),f=s.start.name.toLowerCase()=="script",m=c;f?m="//"+c:m="/*"+c+"*/",n=n.replace(u,m),this.registerEmbeddedDocument(c,o,f)})}return n}removeVirtualStructures(e){let n=e;return this.removeLines.forEach(r=>{n=n.replace(r,"")}),n}indentLevel(e){for(let n=0;n0&&n[a].trim().length==0;a--)n.pop();if(!this.removeLines.includes(o)){let a=r[s];this.removeLines.forEach(l=>{a.includes(l)&&(a=a.replace(l,""))}),n.push(a)}}return n.join(` `)}cleanStructuralNewLines(e){let n=G.breakByNewLine(e),r=[],i=!1;return n.forEach(s=>{let o=s.trim();if(o.startsWith("{{")&&o.endsWith("}}")){r.push(s),i=!0;return}i&&o.length>0&&(i=!1),i||r.push(s)}),r.join(` `)}reflowSlugs(e){let n=e;return this.slugs.forEach(r=>{let i=this.open(r),s=this.close(r),o=this.selfClosing(r),a="/<"+r+"(.*?)>/gms",l="//gms",u="/<"+r+"(.*?)/>/gms";n=n.replace(a,i),n=n.replace(l,s),n=n.replace(u,o)}),n}fromStructure(e){let n=this.reflowSlugs(e);this.structureLines=G.breakByNewLine(n);let r=this.transformInlineConditions(n);if(r=this.transformConditions(r),r=this.transformInlineAntlers(r),r=this.transformComments(r),r=this.transformVirtualStructures(r),r=this.transformDynamicAntlers(r),r=this.transformPairedAntlers(r),r=this.transformExtractedDocuments(r),r=this.cleanVirtualStructures(r),r=this.removeVirtualStructures(r),r=this.cleanStructuralNewLines(r),this.doc.hasFrontMatter()){let i=this.doc.getFrontMatter(),s=this.doc.getFrontMatterDoc();s!=null&&s.isValid&&this.yamlFormatter!=null&&(i=this.yamlFormatter(i)),r=`--- ${i} --- `+` `.repeat(this.options.newlinesAfterFrontMatter)+r.trimLeft()}return r=r.trimRight(),this.options.endNewline&&(r+=` -`),r}};var zv=Q(mi());var Em=class{constructor(){this.content="";this.ranges=[];this.lastDocumentOffsetKey=null;this.documentOffsets=new Map;this.lineIndex=new Map;this.keys=[];this.values=[];this.isValid=!1;this.parseError=null}loadString(e){var c;this.content=G.normalizeLineEndings(e);let n=null;try{n=zv.parseDocument(this.content),this.isValid=!0}catch(f){this.isValid=!1,this.parseError=f}if(n==null)return;let r=[...this.content.matchAll(/(\n)/gm)],i=r.length,s=2,o=null,a=0,l=0;for(let f=0;f{this.processItem(n)})}processItem(e){if(e.type=="PAIR"){if(e.value instanceof Ll||e.value instanceof xa){let s=e.key;if(s.range!=null){let o=this.positionFromOffset(s.range[0],s.range[0]),a=this.positionFromOffset(s.range[1],s.range[1]);this.ranges.push({start:o,end:a,length:a.char-o.char+1,content:"property"}),this.keys.push({start:o,end:a,length:a.char-o.char+1,content:s.value}),e.value instanceof xa?this.processMap(e.value.items[0]):this.processMap(e.value);return}}let n=e,r=n.key,i=n.value;if(r.range!=null&&i.range!=null){let s=this.positionFromOffset(r.range[0],r.range[0]),o=this.positionFromOffset(r.range[1],r.range[1]),a=this.positionFromOffset(i.range[0],i.range[0]),l=this.positionFromOffset(i.range[1],i.range[1]),u="string";parseInt(i.value)==i.value&&(u="number"),this.ranges.push({start:s,end:o,length:o.char-s.char+1,content:"property"}),this.keys.push({start:s,end:o,length:o.char-s.char+1,content:r.value}),this.ranges.push({start:a,end:l,length:l.char-a.char+1,content:u}),this.values.push({start:a,end:l,length:l.char-a.char+1,content:i.value})}}}positionFromOffset(e,n,r=!1){let i=0,s=0;if(this.documentOffsets.has(e)){let a=this.documentOffsets.get(e);i=a.line,s=a.char}else if(this.documentOffsets.size==0)i=1,s=e+1;else{let a=null,l=null,u=null,c=null;for(let f of this.documentOffsets.keys()){if(f>=e){c!=null&&e>c?(a=u,l=c):(a=this.documentOffsets.get(f),l=f);break}u=this.documentOffsets.get(f),c=f}if(a==null&&(a=u,l=c),a!=null)if(r){let f=this.content.split(""),m=e-(l!=null?l:0),d=a.char-(l!=null?l:0)+e;s=m,i=a.line,e<=(l!=null?l:0)?(i=a.line,s=e+1):i=a.line+1}else{let f=this.content.split(""),m=e-(l!=null?l:0),d=a.char-(l!=null?l:0)+e;s=m,i=a.line,e<=(l!=null?l:0)?(i=a.line,s=e+1):i=a.line+1}else this.lastDocumentOffsetKey!=null&&(i=this.documentOffsets.get(this.lastDocumentOffsetKey).line+1,s=e+this.lastDocumentOffsetKey)}let o=new qt;return o.index=n,o.offset=e,o.line=i,o.char=s,o}getRanges(){return this.ranges}getKeys(){return this.keys}getValues(){return this.values}};var mt=class{constructor(){this.documentParser=new E;this.transformer=null;this.ranges=new Am(this);this.nodes=new Rm(this);this.cursor=new cm(this);this.errors=new fm(this);this.project=null;this.documentUri=""}static fromText(e,n){let r=new mt;return typeof n!="undefined"&&(r.project=n),r.loadString(e)}static childFromText(e,n=null){let r=new mt;return n!=null&&r.getDocumentParser().setSeedPosition(n),r.getDocumentParser().withChildDocuments(!0),r.loadString(e),{renderNodes:r.getDocumentParser().getRenderNodes(),content:e,document:r}}isValid(){return!(this.hasInvalidControlFlowStructures()||this.hasUnclosedStructures())}getDocumentOptions(){let e=this.getAllNodes();if(e.length==0||!(e[0]instanceof B))return null;let n=e[0];return n.isComment==!1?null:il(this.documentUri,n)}isFormattingEnabled(){let e=this.getDocumentOptions();return e==null?!0:e.formatterEnabled}hasInvalidControlFlowStructures(){return this.documentParser.hasUnclosedIfStructures()}hasUnclosedStructures(){return this.documentParser.hasUnclosedStructures()}getFrontMatterDoc(){if(this.hasFrontMatter()){let e=new Em;return e.loadString(this.getFrontMatter()),e}return null}hasFrontMatter(){return this.documentParser.getFrontMatter().trim().length>0}getFrontMatter(){return this.documentParser.getFrontMatter()}getFrontMatterScope(){if(this.project==null)return null;let e=new Cm(this.project);return e.parse(this.getFrontMatter()),e.getScope()}updateProject(e){this.project=e,this.updateProjectDetails()}updateProjectDetails(){try{if(this.project!=null){let e=new Wd(this.project,this.documentUri,this),n=this.documentParser.antlersNodes();n.forEach(r=>{var i,s;if(this.project!=null&&((i=Ie.instance)==null?void 0:i.canResolveSpecialTypes(r.getTagName()))){let o=(s=Ie.instance)==null?void 0:s.resolveSpecialType(r.getTagName(),r,this.project);o.context!=null&&(r.reference=o.context)}}),e.analyzeScope(n);for(let r=0;r{c instanceof B&&(c.currentScope=i.currentScope)})}}}Qb(this)}}catch(e){console.log(e)}}loadString(e){return this.documentParser.parse(e),this.updateProjectDetails(),this}getDocumentParser(){return this.documentParser}getParsedContent(){return this.documentParser.getParsedContent()}getAllNodes(){return this.documentParser.getNodes()}getAllAntlersNodes(){return this.documentParser.antlersNodes()}extractText(){let e=[];return this.nodes.getAllLiteralNodes().forEach(n=>{e.push(n.content)}),e.join("")}getNameAt(e){let n=this.nodes.getNodeAt(e);return n instanceof B?n.name:null}getContent(){return this.documentParser.getContent()}getOriginalContent(){return this.documentParser.getOriginalContent()}getFeaturesAt(e){let n=this.nodes.getNodeAt(e);return Fi.resolveContext(e,n,this,!1,n)}getText(e,n){return this.documentParser.getText(e,n)}charLeftAt(e){return this.documentParser.charLeftAt(e)}charAt(e){return this.documentParser.charAt(e)}charRightAt(e){return this.documentParser.charRightAt(e)}getLineIndex(e){return this.documentParser.getLineIndex(e)}getLineText(e){return this.documentParser.getLineText(e)}wordAt(e,n=4){return this.documentParser.wordAt(e,n)}wordLeftAt(e,n=4){return this.documentParser.wordLeftAt(e,n)}wordRightAt(e,n=4){return this.documentParser.wordRightAt(e,n)}punctuationLeftAt(e,n=4){return this.documentParser.punctuationLeftAt(e,n)}punctuationRightAt(e,n=4){return this.documentParser.punctuationRightAt(e,n)}getLineChars(e){let n=this.getLineText(e);return n!=null?n.split(""):null}transform(){return this.transformer==null&&(this.transformer=new kl(this)),this.transformer}};var oo=class{constructor(){this.loadedDocuments=new Map;this.activeProject=null}getDocuments(){let e=[];return this.loadedDocuments.forEach(n=>{e.push(n)}),e}setProject(e){this.activeProject=e,this.loadedDocuments.forEach(n=>{this.activeProject!=null&&n.updateProject(this.activeProject)})}refreshDocumentState(){this.activeProject!=null&&this.setProject(this.activeProject)}hasDocument(e){return this.loadedDocuments.has(e)}createDocument(e){if(!this.loadedDocuments.has(e)){let n=new mt;n.documentUri=e,this.loadedDocuments.set(e,n)}}loadDocument(e,n){this.loadedDocuments.set(e,mt.fromText(n))}getDocument(e){return this.loadedDocuments.get(e)}updateDocument(e,n){var r,i;if(this.loadedDocuments.has(e)){let s=this.loadedDocuments.get(e);s.loadString(n);let o=(i=(r=ce.instance)==null?void 0:r.getStructure())==null?void 0:i.findView(e);o!=null&&(o.document=s)}}createOrUpdate(e,n){this.createDocument(e),this.updateDocument(e,n)}getDocumentErrors(e){return this.loadedDocuments.has(e)?this.loadedDocuments.get(e).errors.all():[]}};oo.instance=null;(typeof oo.instance=="undefined"||oo.instance)&&(oo.instance=new oo);var Xv=oo;var Jr=new Map,Se=new Xv;function Qv(t,e){let n=[];return t.processedInterpolationRegions.size>0&&t.processedInterpolationRegions.forEach((r,i)=>{var s;for(let o=0;o0&&(n=n.concat(Qv(a,e)));break}}}),n}function kn(t,e,n=!0){var m,d,p,_,C,h,b,g,N,S,V;if(!Se.hasDocument(e)||ce.instance==null||ce.instance.hasStructure()==!1)return null;let r=Se.getDocument(e),i=t.line+1,s=t.character+1,o=r.cursor.getFeaturesAt(i,s),a=r.cursor.position(i,s),l=ce.instance.getStructure(),u=r.cursor.getAncestorsAt(i,s);if(a!=null&&u.length>0){let O=u[u.length-1];Qv(O,a).forEach($=>{u.push($)})}let c=(o==null?void 0:o.isCursorInIdentifier)==!1;return c==!1&&((m=o==null?void 0:o.leftChar)!=null?m:"")==" "&&(c=!0),{hasFrontMatter:r.hasFrontMatter(),antlersDocument:r,frontMatterEndsOn:r.getDocumentParser().getFrontMatterEndLine(),document:e,leftMeaningfulWord:(d=o==null?void 0:o.leftWord)!=null?d:null,leftChar:(p=o==null?void 0:o.leftChar)!=null?p:"",leftWord:(C=(_=o==null?void 0:o.leftWord)==null?void 0:_.trim())!=null?C:"",originalLeftWord:(h=o==null?void 0:o.leftWord)!=null?h:"",rightWord:(b=o==null?void 0:o.rightWord)!=null?b:"",rightChar:(g=o==null?void 0:o.rightChar)!=null?g:"",context:o,position:t,project:l,nodesInScope:u,isInDoubleBraces:((N=o==null?void 0:o.node)==null?void 0:N.rawStart)=="{{",isInVariableInterpolation:(S=o==null?void 0:o.interpolatedContext)!=null?S:!1,interpolationStartsOn:null,currentNode:(V=o==null?void 0:o.node)!=null?V:null,isCaretInTag:(o==null?void 0:o.node)!=null,isPastTagPart:c,showGeneralSnippets:n}}var wa=Q(nn());var WL=`{{ collection:$1 $2 }} +`),r}};var Xv=Q(mi());var Em=class{constructor(){this.content="";this.ranges=[];this.lastDocumentOffsetKey=null;this.documentOffsets=new Map;this.lineIndex=new Map;this.keys=[];this.values=[];this.isValid=!1;this.parseError=null}loadString(e){var c;this.content=G.normalizeLineEndings(e);let n=null;try{n=Xv.parseDocument(this.content),this.isValid=!0}catch(f){this.isValid=!1,this.parseError=f}if(n==null)return;let r=[...this.content.matchAll(/(\n)/gm)],i=r.length,s=2,o=null,a=0,l=0;for(let f=0;f{this.processItem(n)})}processItem(e){if(e.type=="PAIR"){if(e.value instanceof Dl||e.value instanceof xa){let s=e.key;if(s.range!=null){let o=this.positionFromOffset(s.range[0],s.range[0]),a=this.positionFromOffset(s.range[1],s.range[1]);this.ranges.push({start:o,end:a,length:a.char-o.char+1,content:"property"}),this.keys.push({start:o,end:a,length:a.char-o.char+1,content:s.value}),e.value instanceof xa?this.processMap(e.value.items[0]):this.processMap(e.value);return}}let n=e,r=n.key,i=n.value;if(r.range!=null&&i.range!=null){let s=this.positionFromOffset(r.range[0],r.range[0]),o=this.positionFromOffset(r.range[1],r.range[1]),a=this.positionFromOffset(i.range[0],i.range[0]),l=this.positionFromOffset(i.range[1],i.range[1]),u="string";parseInt(i.value)==i.value&&(u="number"),this.ranges.push({start:s,end:o,length:o.char-s.char+1,content:"property"}),this.keys.push({start:s,end:o,length:o.char-s.char+1,content:r.value}),this.ranges.push({start:a,end:l,length:l.char-a.char+1,content:u}),this.values.push({start:a,end:l,length:l.char-a.char+1,content:i.value})}}}positionFromOffset(e,n,r=!1){let i=0,s=0;if(this.documentOffsets.has(e)){let a=this.documentOffsets.get(e);i=a.line,s=a.char}else if(this.documentOffsets.size==0)i=1,s=e+1;else{let a=null,l=null,u=null,c=null;for(let f of this.documentOffsets.keys()){if(f>=e){c!=null&&e>c?(a=u,l=c):(a=this.documentOffsets.get(f),l=f);break}u=this.documentOffsets.get(f),c=f}if(a==null&&(a=u,l=c),a!=null)if(r){let f=this.content.split(""),m=e-(l!=null?l:0),p=a.char-(l!=null?l:0)+e;s=m,i=a.line,e<=(l!=null?l:0)?(i=a.line,s=e+1):i=a.line+1}else{let f=this.content.split(""),m=e-(l!=null?l:0),p=a.char-(l!=null?l:0)+e;s=m,i=a.line,e<=(l!=null?l:0)?(i=a.line,s=e+1):i=a.line+1}else this.lastDocumentOffsetKey!=null&&(i=this.documentOffsets.get(this.lastDocumentOffsetKey).line+1,s=e+this.lastDocumentOffsetKey)}let o=new qt;return o.index=n,o.offset=e,o.line=i,o.char=s,o}getRanges(){return this.ranges}getKeys(){return this.keys}getValues(){return this.values}};var mt=class{constructor(){this.documentParser=new E;this.transformer=null;this.ranges=new Am(this);this.nodes=new Rm(this);this.cursor=new cm(this);this.errors=new fm(this);this.project=null;this.documentUri=""}static fromText(e,n){let r=new mt;return typeof n!="undefined"&&(r.project=n),r.loadString(e)}static childFromText(e,n=null){let r=new mt;return n!=null&&r.getDocumentParser().setSeedPosition(n),r.getDocumentParser().withChildDocuments(!0),r.loadString(e),{renderNodes:r.getDocumentParser().getRenderNodes(),content:e,document:r}}isValid(){return!(this.hasInvalidControlFlowStructures()||this.hasUnclosedStructures())}getDocumentOptions(){let e=this.getAllNodes();if(e.length==0||!(e[0]instanceof B))return null;let n=e[0];return n.isComment==!1?null:il(this.documentUri,n)}isFormattingEnabled(){let e=this.getDocumentOptions();return e==null?!0:e.formatterEnabled}hasInvalidControlFlowStructures(){return this.documentParser.hasUnclosedIfStructures()}hasUnclosedStructures(){return this.documentParser.hasUnclosedStructures()}getFrontMatterDoc(){if(this.hasFrontMatter()){let e=new Em;return e.loadString(this.getFrontMatter()),e}return null}hasFrontMatter(){return this.documentParser.getFrontMatter().trim().length>0}getFrontMatter(){return this.documentParser.getFrontMatter()}getFrontMatterScope(){if(this.project==null)return null;let e=new Cm(this.project);return e.parse(this.getFrontMatter()),e.getScope()}updateProject(e){this.project=e,this.updateProjectDetails()}updateProjectDetails(){try{if(this.project!=null){let e=new Hd(this.project,this.documentUri,this),n=this.documentParser.antlersNodes();n.forEach(r=>{var i,s;if(this.project!=null&&((i=Ie.instance)==null?void 0:i.canResolveSpecialTypes(r.getTagName()))){let o=(s=Ie.instance)==null?void 0:s.resolveSpecialType(r.getTagName(),r,this.project);o.context!=null&&(r.reference=o.context)}}),e.analyzeScope(n);for(let r=0;r{c instanceof B&&(c.currentScope=i.currentScope)})}}}Qb(this)}}catch(e){console.log(e)}}loadString(e){return this.documentParser.parse(e),this.updateProjectDetails(),this}getDocumentParser(){return this.documentParser}getParsedContent(){return this.documentParser.getParsedContent()}getAllNodes(){return this.documentParser.getNodes()}getAllAntlersNodes(){return this.documentParser.antlersNodes()}extractText(){let e=[];return this.nodes.getAllLiteralNodes().forEach(n=>{e.push(n.content)}),e.join("")}getNameAt(e){let n=this.nodes.getNodeAt(e);return n instanceof B?n.name:null}getLinesAround(e){return this.documentParser.getLinesAround(e)}getContent(){return this.documentParser.getContent()}getOriginalContent(){return this.documentParser.getOriginalContent()}getFeaturesAt(e){let n=this.nodes.getNodeAt(e);return Fi.resolveContext(e,n,this,!1,n)}getText(e,n){return this.documentParser.getText(e,n)}charLeftAt(e){return this.documentParser.charLeftAt(e)}charAt(e){return this.documentParser.charAt(e)}charRightAt(e){return this.documentParser.charRightAt(e)}getLineIndex(e){return this.documentParser.getLineIndex(e)}getLineText(e){return this.documentParser.getLineText(e)}wordAt(e,n=4){return this.documentParser.wordAt(e,n)}wordLeftAt(e,n=4){return this.documentParser.wordLeftAt(e,n)}wordRightAt(e,n=4){return this.documentParser.wordRightAt(e,n)}punctuationLeftAt(e,n=4){return this.documentParser.punctuationLeftAt(e,n)}punctuationRightAt(e,n=4){return this.documentParser.punctuationRightAt(e,n)}getLineChars(e){let n=this.getLineText(e);return n!=null?n.split(""):null}transform(){return this.transformer==null&&(this.transformer=new Ml(this)),this.transformer}};var oo=class{constructor(){this.loadedDocuments=new Map;this.activeProject=null}getDocuments(){let e=[];return this.loadedDocuments.forEach(n=>{e.push(n)}),e}setProject(e){this.activeProject=e,this.loadedDocuments.forEach(n=>{this.activeProject!=null&&n.updateProject(this.activeProject)})}refreshDocumentState(){this.activeProject!=null&&this.setProject(this.activeProject)}hasDocument(e){return this.loadedDocuments.has(e)}createDocument(e){if(!this.loadedDocuments.has(e)){let n=new mt;n.documentUri=e,this.loadedDocuments.set(e,n)}}loadDocument(e,n){this.loadedDocuments.set(e,mt.fromText(n))}getDocument(e){return this.loadedDocuments.get(e)}updateDocument(e,n){var r,i;if(this.loadedDocuments.has(e)){let s=this.loadedDocuments.get(e);s.loadString(n);let o=(i=(r=ce.instance)==null?void 0:r.getStructure())==null?void 0:i.findView(e);o!=null&&(o.document=s)}}createOrUpdate(e,n){this.createDocument(e),this.updateDocument(e,n)}getDocumentErrors(e){return this.loadedDocuments.has(e)?this.loadedDocuments.get(e).errors.all():[]}};oo.instance=null;(typeof oo.instance=="undefined"||oo.instance)&&(oo.instance=new oo);var Qv=oo;var Jr=new Map,Se=new Qv;function Jv(t,e){let n=[];return t.processedInterpolationRegions.size>0&&t.processedInterpolationRegions.forEach((r,i)=>{var s;for(let o=0;o0&&(n=n.concat(Jv(a,e)));break}}}),n}function kn(t,e,n=!0){var m,p,d,_,C,h,b,g,N,S,V;if(!Se.hasDocument(e)||ce.instance==null||ce.instance.hasStructure()==!1)return null;let r=Se.getDocument(e),i=t.line+1,s=t.character+1,o=r.cursor.getFeaturesAt(i,s),a=r.cursor.position(i,s),l=ce.instance.getStructure(),u=r.cursor.getAncestorsAt(i,s);if(a!=null&&u.length>0){let O=u[u.length-1];Jv(O,a).forEach($=>{u.push($)})}let c=(o==null?void 0:o.isCursorInIdentifier)==!1;return c==!1&&((m=o==null?void 0:o.leftChar)!=null?m:"")==" "&&(c=!0),{hasFrontMatter:r.hasFrontMatter(),antlersDocument:r,frontMatterEndsOn:r.getDocumentParser().getFrontMatterEndLine(),document:e,leftMeaningfulWord:(p=o==null?void 0:o.leftWord)!=null?p:null,leftChar:(d=o==null?void 0:o.leftChar)!=null?d:"",leftWord:(C=(_=o==null?void 0:o.leftWord)==null?void 0:_.trim())!=null?C:"",originalLeftWord:(h=o==null?void 0:o.leftWord)!=null?h:"",rightWord:(b=o==null?void 0:o.rightWord)!=null?b:"",rightChar:(g=o==null?void 0:o.rightChar)!=null?g:"",context:o,position:t,project:l,nodesInScope:u,isInDoubleBraces:((N=o==null?void 0:o.node)==null?void 0:N.rawStart)=="{{",isInVariableInterpolation:(S=o==null?void 0:o.interpolatedContext)!=null?S:!1,interpolationStartsOn:null,currentNode:(V=o==null?void 0:o.node)!=null?V:null,isCaretInTag:(o==null?void 0:o.node)!=null,isPastTagPart:c,showGeneralSnippets:n}}var wa=Q(nn());var KL=`{{ collection:$1 $2 }} -{{ /collection:$1 }}`,Jv=WL;var HL='© {{ now format="Y" }}',Zv=HL;var YL=`{{ form:set in="$1" }} +{{ /collection:$1 }}`,Zv=KL;var $L='© {{ now format="Y" }}',eP=$L;var zL=`{{ form:set in="$1" }} {{ if {form:errors} }} {{ form:errors }} @@ -365,7 +367,7 @@ ${i} $2 {{ /form:create }} -{{ /form:set }}`,eP=YL;var tP=`{{# Displays your site's current locale. #}} +{{ /form:set }}`,tP=zL;var nP=`{{# Displays your site's current locale. #}} {{ site:short_locale }} {{# Displays all available locales. #}} @@ -375,7 +377,7 @@ ${i} {{ locale:short }} {{ /locales }} -`;var KL=`
    +
`;var XL=`
    {{ nav }} {{ if depth == 1 }} $1 @@ -386,41 +388,41 @@ ${i} {{ /if }} {{ /nav }} -
`,nP=KL;function Ml(t,e,n,r){return{label:t,detail:e,insertTextFormat:wa.InsertTextFormat.Snippet,kind:wa.CompletionItemKind.Snippet,textEdit:wa.TextEdit.replace(r,n),command:{title:"Suggest",command:"editor.action.triggerSuggest"}}}function $L(t){var l,u,c,f,m;let e=[];if(t.showGeneralSnippets==!1)return e;let n={start:{line:t.position.line,character:t.position.character-t.originalLeftWord.length},end:t.position},r=(l=er.instance)==null?void 0:l.getContent("collection"),i=(u=er.instance)==null?void 0:u.getContent("formset"),s=(c=er.instance)==null?void 0:c.getContent("nav_depth2"),o=(f=er.instance)==null?void 0:f.getContent("copyright_year"),a=(m=er.instance)==null?void 0:m.getContent("multisite_lang_generic");return r!=null&&e.push(Ml("coll","Statamic Collection",r,n)),i!=null&&e.push(Ml("formset","Statamic Form Set",i,n)),s!=null&&e.push(Ml("nav-depth2","Statamic Nav with Depth Two",s,n)),o!=null&&e.push(Ml("copyright_year","Copyright year using Antlers tags.",o,n)),a!=null&&e.push(Ml("multisite_locales","Displays the current locale, and a list of all available locales.",a,n)),e}var er=class{constructor(){this.registeredSnippets=new Map}loadCoreSnippets(){this.registeredSnippets.set("collection",Jv),this.registeredSnippets.set("formset",eP),this.registeredSnippets.set("nav_depth2",nP),this.registeredSnippets.set("copyright_year",Zv),this.registeredSnippets.set("multisite_lang_generic",tP)}getContent(e){return this.registeredSnippets.has(e)?this.registeredSnippets.get(e):""}getSnippets(e){let n=[];return e==null||(n=n.concat($L(e))),n}};er.instance=null;(typeof er.instance=="undefined"||er.instance==null)&&(er.instance=new er,er.instance.loadCoreSnippets());var rP=er;var iP=new Map;function sP(t){var o,a,l;if(((o=ce.instance)==null?void 0:o.hasStructure())==!1)return[];Se.refreshDocumentState();let e=decodeURIComponent(t.textDocument.uri);if(Se.hasDocument(e)==!1)return[];let n=kn(t.position,e,qi.showGeneralSnippetCompletions);if(n==null)return[];if(n.hasFrontMatter&&n.frontMatterEndsOn>-1&&n.position.line0&&(n.isInDoubleBraces==!1||n.nodesInScope.length==0)&&(i=i.concat(r));let s=[];return i.filter(u=>s.includes(u.label)?!1:(s.push(u.label),!0))}function oP(t){if(iP.has(t.data)){let e=iP.get(t.data);e!=null&&(t.detail=e.detail,t.documentation=e.docs)}return t}var Fl=Q(Np());var wm=Q(ot());function lf(t){let e=[];return t.forEach(n=>{let r=null;n.node!=null?r=ao(n.node):n.range!=null?r={start:ln(n.range.start),end:ln(n.range.end)}:r={start:{line:1,character:1},end:{line:1,character:1}};let i=1;n.level==1&&(i=2),e.push({severity:i,range:r,message:"["+n.errorCode+"] "+n.message,source:"antlers"})}),e}function ln(t){return t==null?{character:0,line:0}:{character:t.char,line:t.line-1}}function ao(t){var e,n,r,i,s,o,a,l;if(t instanceof Vs){let u=ln((i=(r=(e=t.valuePosition)==null?void 0:e.end)!=null?r:(n=t.blockPosition)==null?void 0:n.end)!=null?i:t.endPosition);return{start:ln((l=(a=(s=t.namePosition)==null?void 0:s.start)!=null?a:(o=t.blockPosition)==null?void 0:o.start)!=null?l:t.startPosition),end:{character:u.character+1,line:u.line}}}return{start:ln(t.startPosition),end:ln(t.endPosition)}}function aP(t){if(t.isClosedBy==null)return null;let e=-1,n=-1,r=-1,i=-1;return t.startPosition!=null&&(e=t.startPosition.line-1,n=t.startPosition.char),t.isClosedBy.endPosition!=null?(r=t.isClosedBy.endPosition.char,i=t.isClosedBy.endPosition.line-1):t.isClosedBy.startPosition!=null&&(r=t.isClosedBy.startPosition.char,i=t.isClosedBy.startPosition.line-1),e==-1||i==-1||n==-1||r==-1?null:{kind:wm.FoldingRangeKind.Region,startLine:e,endLine:i,startCharacter:n,endCharacter:r}}function Om(t){let e=-1,n=-1,r=-1,i=-1;return t.startPosition!=null&&(e=t.startPosition.line-1,n=t.startPosition.char),t.endPosition!=null&&(r=t.endPosition.char,i=t.endPosition.line-1),e==-1||n==-1||r==-1||i==-1?null:{kind:wm.FoldingRangeKind.Comment,startLine:e,endLine:i,startCharacter:n,endCharacter:r}}function lP(t){let e=decodeURIComponent(t.textDocument.uri);if(Se.hasDocument(e)){let n=Se.getDocument(e),r=n.ranges.getAllPairedNodes(),i=n.nodes.getMultiLineComments(),s=n.nodes.getMultilineNodes(),o=[];if(n.hasFrontMatter()){let a=n.getDocumentParser().getFrontMatterEndLine();o.push({startLine:0,endLine:a-1,kind:Fl.FoldingRangeKind.Imports})}return r.length>0&&r.forEach(a=>{var u,c,f;if(((u=a.startPosition)==null?void 0:u.line)==((f=(c=a.isClosedBy)==null?void 0:c.startPosition)==null?void 0:f.line))return;let l=aP(a);l!=null&&(l.kind=Fl.FoldingRangeKind.Region,o.push(l))}),i.length>0&&i.forEach(a=>{let l=Om(a);l!=null&&(l.kind=Fl.FoldingRangeKind.Comment,o.push(l))}),s.length>0&&s.forEach(a=>{if(a.isClosedBy!=null)return;let l=Om(a);l!=null&&(l.kind=Fl.FoldingRangeKind.Region,o.push(l))}),o}return[]}var zL={checkDocument(t){let e=[];return t.hasFrontMatter()&&t.getContent().trim().length==0&&e.push(M.makeSyntaxError(P.LINT_FRONT_MATTER_EMPTY_DOCUMENT,null,'Empty document content with Front Matter will result in "[ErrorException] Undefined index: content".')),e}},uP=zL;function cP(t){return typeof t=="undefined"||t===null}function XL(t){return typeof t=="object"&&t!==null}function QL(t){return Array.isArray(t)?t:cP(t)?[]:[t]}function JL(t,e){var n,r,i,s;if(e)for(s=Object.keys(e),n=0,r=s.length;n`,rP=XL;function Fl(t,e,n,r){return{label:t,detail:e,insertTextFormat:wa.InsertTextFormat.Snippet,kind:wa.CompletionItemKind.Snippet,textEdit:wa.TextEdit.replace(r,n),command:{title:"Suggest",command:"editor.action.triggerSuggest"}}}function QL(t){var l,u,c,f,m;let e=[];if(t.showGeneralSnippets==!1)return e;let n={start:{line:t.position.line,character:t.position.character-t.originalLeftWord.length},end:t.position},r=(l=er.instance)==null?void 0:l.getContent("collection"),i=(u=er.instance)==null?void 0:u.getContent("formset"),s=(c=er.instance)==null?void 0:c.getContent("nav_depth2"),o=(f=er.instance)==null?void 0:f.getContent("copyright_year"),a=(m=er.instance)==null?void 0:m.getContent("multisite_lang_generic");return r!=null&&e.push(Fl("coll","Statamic Collection",r,n)),i!=null&&e.push(Fl("formset","Statamic Form Set",i,n)),s!=null&&e.push(Fl("nav-depth2","Statamic Nav with Depth Two",s,n)),o!=null&&e.push(Fl("copyright_year","Copyright year using Antlers tags.",o,n)),a!=null&&e.push(Fl("multisite_locales","Displays the current locale, and a list of all available locales.",a,n)),e}var er=class{constructor(){this.registeredSnippets=new Map}loadCoreSnippets(){this.registeredSnippets.set("collection",Zv),this.registeredSnippets.set("formset",tP),this.registeredSnippets.set("nav_depth2",rP),this.registeredSnippets.set("copyright_year",eP),this.registeredSnippets.set("multisite_lang_generic",nP)}getContent(e){return this.registeredSnippets.has(e)?this.registeredSnippets.get(e):""}getSnippets(e){let n=[];return e==null||(n=n.concat(QL(e))),n}};er.instance=null;(typeof er.instance=="undefined"||er.instance==null)&&(er.instance=new er,er.instance.loadCoreSnippets());var iP=er;var sP=new Map;function oP(t){var o,a,l;if(((o=ce.instance)==null?void 0:o.hasStructure())==!1)return[];Se.refreshDocumentState();let e=decodeURIComponent(t.textDocument.uri);if(Se.hasDocument(e)==!1)return[];let n=kn(t.position,e,qi.showGeneralSnippetCompletions);if(n==null)return[];if(n.hasFrontMatter&&n.frontMatterEndsOn>-1&&n.position.line0&&(n.isInDoubleBraces==!1||n.nodesInScope.length==0)&&(i=i.concat(r));let s=[];return i.filter(u=>s.includes(u.label)?!1:(s.push(u.label),!0))}function aP(t){if(sP.has(t.data)){let e=sP.get(t.data);e!=null&&(t.detail=e.detail,t.documentation=e.docs)}return t}var Vl=Q(vp());var wm=Q(ot());function uf(t){let e=[];return t.forEach(n=>{let r=null;n.node!=null?r=ao(n.node):n.range!=null?r={start:ln(n.range.start),end:ln(n.range.end)}:r={start:{line:1,character:1},end:{line:1,character:1}};let i=1;n.level==1&&(i=2),e.push({severity:i,range:r,message:"["+n.errorCode+"] "+n.message,source:"antlers"})}),e}function ln(t){return t==null?{character:0,line:0}:{character:t.char,line:t.line-1}}function ao(t){var e,n,r,i,s,o,a,l;if(t instanceof Vs){let u=ln((i=(r=(e=t.valuePosition)==null?void 0:e.end)!=null?r:(n=t.blockPosition)==null?void 0:n.end)!=null?i:t.endPosition);return{start:ln((l=(a=(s=t.namePosition)==null?void 0:s.start)!=null?a:(o=t.blockPosition)==null?void 0:o.start)!=null?l:t.startPosition),end:{character:u.character+1,line:u.line}}}return{start:ln(t.startPosition),end:ln(t.endPosition)}}function lP(t){if(t.isClosedBy==null)return null;let e=-1,n=-1,r=-1,i=-1;return t.startPosition!=null&&(e=t.startPosition.line-1,n=t.startPosition.char),t.isClosedBy.endPosition!=null?(r=t.isClosedBy.endPosition.char,i=t.isClosedBy.endPosition.line-1):t.isClosedBy.startPosition!=null&&(r=t.isClosedBy.startPosition.char,i=t.isClosedBy.startPosition.line-1),e==-1||i==-1||n==-1||r==-1?null:{kind:wm.FoldingRangeKind.Region,startLine:e,endLine:i,startCharacter:n,endCharacter:r}}function Om(t){let e=-1,n=-1,r=-1,i=-1;return t.startPosition!=null&&(e=t.startPosition.line-1,n=t.startPosition.char),t.endPosition!=null&&(r=t.endPosition.char,i=t.endPosition.line-1),e==-1||n==-1||r==-1||i==-1?null:{kind:wm.FoldingRangeKind.Comment,startLine:e,endLine:i,startCharacter:n,endCharacter:r}}function uP(t){let e=decodeURIComponent(t.textDocument.uri);if(Se.hasDocument(e)){let n=Se.getDocument(e),r=n.ranges.getAllPairedNodes(),i=n.nodes.getMultiLineComments(),s=n.nodes.getMultilineNodes(),o=[];if(n.hasFrontMatter()){let a=n.getDocumentParser().getFrontMatterEndLine();o.push({startLine:0,endLine:a-1,kind:Vl.FoldingRangeKind.Imports})}return r.length>0&&r.forEach(a=>{var u,c,f;if(((u=a.startPosition)==null?void 0:u.line)==((f=(c=a.isClosedBy)==null?void 0:c.startPosition)==null?void 0:f.line))return;let l=lP(a);l!=null&&(l.kind=Vl.FoldingRangeKind.Region,o.push(l))}),i.length>0&&i.forEach(a=>{let l=Om(a);l!=null&&(l.kind=Vl.FoldingRangeKind.Comment,o.push(l))}),s.length>0&&s.forEach(a=>{if(a.isClosedBy!=null)return;let l=Om(a);l!=null&&(l.kind=Vl.FoldingRangeKind.Region,o.push(l))}),o}return[]}var JL={checkDocument(t){let e=[];return t.hasFrontMatter()&&t.getContent().trim().length==0&&e.push(M.makeSyntaxError(v.LINT_FRONT_MATTER_EMPTY_DOCUMENT,null,'Empty document content with Front Matter will result in "[ErrorException] Undefined index: content".')),e}},cP=JL;function fP(t){return typeof t=="undefined"||t===null}function ZL(t){return typeof t=="object"&&t!==null}function eD(t){return Array.isArray(t)?t:fP(t)?[]:[t]}function tD(t,e){var n,r,i,s;if(e)for(s=Object.keys(e),n=0,r=s.length;na&&(s=" ... ",e=r-a+s.length),n-r>a&&(o=" ...",n=r+a-o.length),{str:s+t.slice(e,n).replace(/\t/g,"\u2192")+o,pos:r-e+s.length}}function Dm(t,e){return Wt.repeat(" ",e-t.length)+t}function aD(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var n=/\r?\n|\r|\0/g,r=[0],i=[],s,o=-1;s=n.exec(t.buffer);)i.push(s.index),r.push(s.index+s[0].length),t.position<=s.index&&o<0&&(o=r.length-2);o<0&&(o=r.length-1);var a="",l,u,c=Math.min(t.line+e.linesAfter,i.length).toString().length,f=e.maxLength-(e.indent+c+3);for(l=1;l<=e.linesBefore&&!(o-l<0);l++)u=Lm(t.buffer,r[o-l],i[o-l],t.position-(r[o]-r[o-l]),f),a=Wt.repeat(" ",e.indent)+Dm((t.line-l+1).toString(),c)+" | "+u.str+` +`+t.mark.snippet),r+" "+n):r}function ql(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=pP(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}ql.prototype=Object.create(Error.prototype);ql.prototype.constructor=ql;ql.prototype.toString=function(e){return this.name+": "+pP(this,e)};var En=ql;function Lm(t,e,n,r,i){var s="",o="",a=Math.floor(i/2)-1;return r-e>a&&(s=" ... ",e=r-a+s.length),n-r>a&&(o=" ...",n=r+a-o.length),{str:s+t.slice(e,n).replace(/\t/g,"\u2192")+o,pos:r-e+s.length}}function Dm(t,e){return Wt.repeat(" ",e-t.length)+t}function cD(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var n=/\r?\n|\r|\0/g,r=[0],i=[],s,o=-1;s=n.exec(t.buffer);)i.push(s.index),r.push(s.index+s[0].length),t.position<=s.index&&o<0&&(o=r.length-2);o<0&&(o=r.length-1);var a="",l,u,c=Math.min(t.line+e.linesAfter,i.length).toString().length,f=e.maxLength-(e.indent+c+3);for(l=1;l<=e.linesBefore&&!(o-l<0);l++)u=Lm(t.buffer,r[o-l],i[o-l],t.position-(r[o]-r[o-l]),f),a=Wt.repeat(" ",e.indent)+Dm((t.line-l+1).toString(),c)+" | "+u.str+` `+a;for(u=Lm(t.buffer,r[o],i[o],t.position,f),a+=Wt.repeat(" ",e.indent)+Dm((t.line+1).toString(),c)+" | "+u.str+` `,a+=Wt.repeat("-",e.indent+c+3+u.pos)+`^ `,l=1;l<=e.linesAfter&&!(o+l>=i.length);l++)u=Lm(t.buffer,r[o+l],i[o+l],t.position-(r[o]-r[o+l]),f),a+=Wt.repeat(" ",e.indent)+Dm((t.line+l+1).toString(),c)+" | "+u.str+` -`;return a.replace(/\n$/,"")}var lD=aD,uD=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],cD=["scalar","sequence","mapping"];function fD(t){var e={};return t!==null&&Object.keys(t).forEach(function(n){t[n].forEach(function(r){e[String(r)]=n})}),e}function pD(t,e){if(e=e||{},Object.keys(e).forEach(function(n){if(uD.indexOf(n)===-1)throw new En('Unknown option "'+n+'" is met in definition of "'+t+'" YAML type.')}),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(n){return n},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=fD(e.styleAliases||null),cD.indexOf(this.kind)===-1)throw new En('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}var mn=pD;function pP(t,e){var n=[];return t[e].forEach(function(r){var i=n.length;n.forEach(function(s,o){s.tag===r.tag&&s.kind===r.kind&&s.multi===r.multi&&(i=o)}),n[i]=r}),n}function dD(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,n;function r(i){i.multi?(t.multi[i.kind].push(i),t.multi.fallback.push(i)):t[i.kind][i.tag]=t.fallback[i.tag]=i}for(e=0,n=arguments.length;e=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),DD=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function kD(t){return!(t===null||!DD.test(t)||t[t.length-1]==="_")}function MD(t){var e,n;return e=t.replace(/_/g,"").toLowerCase(),n=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:n*parseFloat(e,10)}var FD=/^[-+]?[0-9]+e/;function VD(t,e){var n;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Wt.isNegativeZero(t))return"-0.0";return n=t.toString(10),FD.test(n)?n.replace("e",".e"):n}function qD(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||Wt.isNegativeZero(t))}var BD=new mn("tag:yaml.org,2002:float",{kind:"scalar",resolve:kD,construct:MD,predicate:qD,represent:VD,defaultStyle:"lowercase"}),jD=yD.extend({implicit:[vD,CD,LD,BD]}),UD=jD,dP=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),mP=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function GD(t){return t===null?!1:dP.exec(t)!==null||mP.exec(t)!==null}function WD(t){var e,n,r,i,s,o,a,l=0,u=null,c,f,m;if(e=dP.exec(t),e===null&&(e=mP.exec(t)),e===null)throw new Error("Date resolve error");if(n=+e[1],r=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(n,r,i));if(s=+e[4],o=+e[5],a=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(c=+e[10],f=+(e[11]||0),u=(c*60+f)*6e4,e[9]==="-"&&(u=-u)),m=new Date(Date.UTC(n,r,i,s,o,a,l)),u&&m.setTime(m.getTime()-u),m}function HD(t){return t.toISOString()}var YD=new mn("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:GD,construct:WD,instanceOf:Date,represent:HD});function KD(t){return t==="<<"||t===null}var $D=new mn("tag:yaml.org,2002:merge",{kind:"scalar",resolve:KD}),Mm=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= -\r`;function zD(t){if(t===null)return!1;var e,n,r=0,i=t.length,s=Mm;for(n=0;n64)){if(e<0)return!1;r+=6}return r%8===0}function XD(t){var e,n,r=t.replace(/[\r\n=]/g,""),i=r.length,s=Mm,o=0,a=[];for(e=0;e>16&255),a.push(o>>8&255),a.push(o&255)),o=o<<6|s.indexOf(r.charAt(e));return n=i%4*6,n===0?(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)):n===18?(a.push(o>>10&255),a.push(o>>2&255)):n===12&&a.push(o>>4&255),new Uint8Array(a)}function QD(t){var e="",n=0,r,i,s=t.length,o=Mm;for(r=0;r>18&63],e+=o[n>>12&63],e+=o[n>>6&63],e+=o[n&63]),n=(n<<8)+t[r];return i=s%3,i===0?(e+=o[n>>18&63],e+=o[n>>12&63],e+=o[n>>6&63],e+=o[n&63]):i===2?(e+=o[n>>10&63],e+=o[n>>4&63],e+=o[n<<2&63],e+=o[64]):i===1&&(e+=o[n>>2&63],e+=o[n<<4&63],e+=o[64],e+=o[64]),e}function JD(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}var ZD=new mn("tag:yaml.org,2002:binary",{kind:"scalar",resolve:zD,construct:XD,predicate:JD,represent:QD}),ek=Object.prototype.hasOwnProperty,tk=Object.prototype.toString;function nk(t){if(t===null)return!0;var e=[],n,r,i,s,o,a=t;for(n=0,r=a.length;n>10)+55296,(t-65536&1023)+56320)}var PP=new Array(256),IP=new Array(256);for(uo=0;uo<256;uo++)PP[uo]=vP(uo)?1:0,IP[uo]=vP(uo);var uo;function Nk(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||hP,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function SP(t,e){var n={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return n.snippet=lD(n),new En(e,n)}function fe(t,e){throw SP(t,e)}function ff(t,e){t.onWarning&&t.onWarning.call(null,SP(t,e))}var CP={YAML:function(e,n,r){var i,s,o;e.version!==null&&fe(e,"duplication of %YAML directive"),r.length!==1&&fe(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&fe(e,"ill-formed argument of the YAML directive"),s=parseInt(i[1],10),o=parseInt(i[2],10),s!==1&&fe(e,"unacceptable YAML version of the document"),e.version=r[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&ff(e,"unsupported YAML version of the document")},TAG:function(e,n,r){var i,s;r.length!==2&&fe(e,"TAG directive accepts exactly two arguments"),i=r[0],s=r[1],bP.test(i)||fe(e,"ill-formed tag handle (first argument) of the TAG directive"),Ts.call(e.tagMap,i)&&fe(e,'there is a previously declared suffix for "'+i+'" tag handle'),TP.test(s)||fe(e,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{fe(e,"tag prefix is malformed: "+s)}e.tagMap[i]=s}};function Ns(t,e,n,r){var i,s,o,a;if(e1&&(t.result+=Wt.repeat(` -`,e-1))}function vk(t,e,n){var r,i,s,o,a,l,u,c,f=t.kind,m=t.result,d;if(d=t.input.charCodeAt(t.position),Mn(d)||Oa(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96||(d===63||d===45)&&(i=t.input.charCodeAt(t.position+1),Mn(i)||n&&Oa(i)))return!1;for(t.kind="scalar",t.result="",s=o=t.position,a=!1;d!==0;){if(d===58){if(i=t.input.charCodeAt(t.position+1),Mn(i)||n&&Oa(i))break}else if(d===35){if(r=t.input.charCodeAt(t.position-1),Mn(r))break}else{if(t.position===t.lineStart&&pf(t)||n&&Oa(d))break;if(hi(d))if(l=t.line,u=t.lineStart,c=t.lineIndent,Mt(t,!1,-1),t.lineIndent>=e){a=!0,d=t.input.charCodeAt(t.position);continue}else{t.position=o,t.line=l,t.lineStart=u,t.lineIndent=c;break}}a&&(Ns(t,s,o,!1),qm(t,t.line-l),s=o=t.position,a=!1),lo(d)||(o=t.position+1),d=t.input.charCodeAt(++t.position)}return Ns(t,s,o,!1),t.result?!0:(t.kind=f,t.result=m,!1)}function Pk(t,e){var n,r,i;if(n=t.input.charCodeAt(t.position),n!==39)return!1;for(t.kind="scalar",t.result="",t.position++,r=i=t.position;(n=t.input.charCodeAt(t.position))!==0;)if(n===39)if(Ns(t,r,t.position,!0),n=t.input.charCodeAt(++t.position),n===39)r=t.position,t.position++,i=t.position;else return!0;else hi(n)?(Ns(t,r,i,!0),qm(t,Mt(t,!1,e)),r=i=t.position):t.position===t.lineStart&&pf(t)?fe(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);fe(t,"unexpected end of the stream within a single quoted scalar")}function Ik(t,e){var n,r,i,s,o,a;if(a=t.input.charCodeAt(t.position),a!==34)return!1;for(t.kind="scalar",t.result="",t.position++,n=r=t.position;(a=t.input.charCodeAt(t.position))!==0;){if(a===34)return Ns(t,n,t.position,!0),t.position++,!0;if(a===92){if(Ns(t,n,t.position,!0),a=t.input.charCodeAt(++t.position),hi(a))Mt(t,!1,e);else if(a<256&&PP[a])t.result+=IP[a],t.position++;else if((o=yk(a))>0){for(i=o,s=0;i>0;i--)a=t.input.charCodeAt(++t.position),(o=_k(a))>=0?s=(s<<4)+o:fe(t,"expected hexadecimal character");t.result+=Tk(s),t.position++}else fe(t,"unknown escape sequence");n=r=t.position}else hi(a)?(Ns(t,n,r,!0),qm(t,Mt(t,!1,e)),n=r=t.position):t.position===t.lineStart&&pf(t)?fe(t,"unexpected end of the document within a double quoted scalar"):(t.position++,r=t.position)}fe(t,"unexpected end of the stream within a double quoted scalar")}function Sk(t,e){var n=!0,r,i,s,o=t.tag,a,l=t.anchor,u,c,f,m,d,p=Object.create(null),_,C,h,b;if(b=t.input.charCodeAt(t.position),b===91)c=93,d=!1,a=[];else if(b===123)c=125,d=!0,a={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=a),b=t.input.charCodeAt(++t.position);b!==0;){if(Mt(t,!0,e),b=t.input.charCodeAt(t.position),b===c)return t.position++,t.tag=o,t.anchor=l,t.kind=d?"mapping":"sequence",t.result=a,!0;n?b===44&&fe(t,"expected the node content, but found ','"):fe(t,"missed comma between flow collection entries"),C=_=h=null,f=m=!1,b===63&&(u=t.input.charCodeAt(t.position+1),Mn(u)&&(f=m=!0,t.position++,Mt(t,!0,e))),r=t.line,i=t.lineStart,s=t.position,Da(t,e,uf,!1,!0),C=t.tag,_=t.result,Mt(t,!0,e),b=t.input.charCodeAt(t.position),(m||t.line===r)&&b===58&&(f=!0,b=t.input.charCodeAt(++t.position),Mt(t,!0,e),Da(t,e,uf,!1,!0),h=t.result),d?La(t,a,p,C,_,h,r,i,s):f?a.push(La(t,null,p,C,_,h,r,i,s)):a.push(_),Mt(t,!0,e),b=t.input.charCodeAt(t.position),b===44?(n=!0,b=t.input.charCodeAt(++t.position)):n=!1}fe(t,"unexpected end of the stream within a flow collection")}function Ck(t,e){var n,r,i=Fm,s=!1,o=!1,a=e,l=0,u=!1,c,f;if(f=t.input.charCodeAt(t.position),f===124)r=!1;else if(f===62)r=!0;else return!1;for(t.kind="scalar",t.result="";f!==0;)if(f=t.input.charCodeAt(++t.position),f===43||f===45)Fm===i?i=f===43?yP:dk:fe(t,"repeat of a chomping mode identifier");else if((c=bk(f))>=0)c===0?fe(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?fe(t,"repeat of an indentation width identifier"):(a=e+c-1,o=!0);else break;if(lo(f)){do f=t.input.charCodeAt(++t.position);while(lo(f));if(f===35)do f=t.input.charCodeAt(++t.position);while(!hi(f)&&f!==0)}for(;f!==0;){for(Vm(t),t.lineIndent=0,f=t.input.charCodeAt(t.position);(!o||t.lineIndenta&&(a=t.lineIndent),hi(f)){l++;continue}if(t.lineIndent=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),FD=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function VD(t){return!(t===null||!FD.test(t)||t[t.length-1]==="_")}function qD(t){var e,n;return e=t.replace(/_/g,"").toLowerCase(),n=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:n*parseFloat(e,10)}var BD=/^[-+]?[0-9]+e/;function jD(t,e){var n;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Wt.isNegativeZero(t))return"-0.0";return n=t.toString(10),BD.test(n)?n.replace("e",".e"):n}function UD(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||Wt.isNegativeZero(t))}var GD=new mn("tag:yaml.org,2002:float",{kind:"scalar",resolve:VD,construct:qD,predicate:UD,represent:jD,defaultStyle:"lowercase"}),WD=ND.extend({implicit:[SD,xD,MD,GD]}),HD=WD,mP=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),hP=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function YD(t){return t===null?!1:mP.exec(t)!==null||hP.exec(t)!==null}function KD(t){var e,n,r,i,s,o,a,l=0,u=null,c,f,m;if(e=mP.exec(t),e===null&&(e=hP.exec(t)),e===null)throw new Error("Date resolve error");if(n=+e[1],r=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(n,r,i));if(s=+e[4],o=+e[5],a=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(c=+e[10],f=+(e[11]||0),u=(c*60+f)*6e4,e[9]==="-"&&(u=-u)),m=new Date(Date.UTC(n,r,i,s,o,a,l)),u&&m.setTime(m.getTime()-u),m}function $D(t){return t.toISOString()}var zD=new mn("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:YD,construct:KD,instanceOf:Date,represent:$D});function XD(t){return t==="<<"||t===null}var QD=new mn("tag:yaml.org,2002:merge",{kind:"scalar",resolve:XD}),Mm=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= +\r`;function JD(t){if(t===null)return!1;var e,n,r=0,i=t.length,s=Mm;for(n=0;n64)){if(e<0)return!1;r+=6}return r%8===0}function ZD(t){var e,n,r=t.replace(/[\r\n=]/g,""),i=r.length,s=Mm,o=0,a=[];for(e=0;e>16&255),a.push(o>>8&255),a.push(o&255)),o=o<<6|s.indexOf(r.charAt(e));return n=i%4*6,n===0?(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)):n===18?(a.push(o>>10&255),a.push(o>>2&255)):n===12&&a.push(o>>4&255),new Uint8Array(a)}function ek(t){var e="",n=0,r,i,s=t.length,o=Mm;for(r=0;r>18&63],e+=o[n>>12&63],e+=o[n>>6&63],e+=o[n&63]),n=(n<<8)+t[r];return i=s%3,i===0?(e+=o[n>>18&63],e+=o[n>>12&63],e+=o[n>>6&63],e+=o[n&63]):i===2?(e+=o[n>>10&63],e+=o[n>>4&63],e+=o[n<<2&63],e+=o[64]):i===1&&(e+=o[n>>2&63],e+=o[n<<4&63],e+=o[64],e+=o[64]),e}function tk(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}var nk=new mn("tag:yaml.org,2002:binary",{kind:"scalar",resolve:JD,construct:ZD,predicate:tk,represent:ek}),rk=Object.prototype.hasOwnProperty,ik=Object.prototype.toString;function sk(t){if(t===null)return!0;var e=[],n,r,i,s,o,a=t;for(n=0,r=a.length;n>10)+55296,(t-65536&1023)+56320)}var IP=new Array(256),SP=new Array(256);for(uo=0;uo<256;uo++)IP[uo]=PP(uo)?1:0,SP[uo]=PP(uo);var uo;function Ik(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||gP,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function CP(t,e){var n={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return n.snippet=fD(n),new En(e,n)}function fe(t,e){throw CP(t,e)}function pf(t,e){t.onWarning&&t.onWarning.call(null,CP(t,e))}var RP={YAML:function(e,n,r){var i,s,o;e.version!==null&&fe(e,"duplication of %YAML directive"),r.length!==1&&fe(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&fe(e,"ill-formed argument of the YAML directive"),s=parseInt(i[1],10),o=parseInt(i[2],10),s!==1&&fe(e,"unacceptable YAML version of the document"),e.version=r[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&pf(e,"unsupported YAML version of the document")},TAG:function(e,n,r){var i,s;r.length!==2&&fe(e,"TAG directive accepts exactly two arguments"),i=r[0],s=r[1],TP.test(i)||fe(e,"ill-formed tag handle (first argument) of the TAG directive"),Ts.call(e.tagMap,i)&&fe(e,'there is a previously declared suffix for "'+i+'" tag handle'),NP.test(s)||fe(e,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{fe(e,"tag prefix is malformed: "+s)}e.tagMap[i]=s}};function Ns(t,e,n,r){var i,s,o,a;if(e1&&(t.result+=Wt.repeat(` +`,e-1))}function Sk(t,e,n){var r,i,s,o,a,l,u,c,f=t.kind,m=t.result,p;if(p=t.input.charCodeAt(t.position),Mn(p)||Oa(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=t.input.charCodeAt(t.position+1),Mn(i)||n&&Oa(i)))return!1;for(t.kind="scalar",t.result="",s=o=t.position,a=!1;p!==0;){if(p===58){if(i=t.input.charCodeAt(t.position+1),Mn(i)||n&&Oa(i))break}else if(p===35){if(r=t.input.charCodeAt(t.position-1),Mn(r))break}else{if(t.position===t.lineStart&&df(t)||n&&Oa(p))break;if(hi(p))if(l=t.line,u=t.lineStart,c=t.lineIndent,Mt(t,!1,-1),t.lineIndent>=e){a=!0,p=t.input.charCodeAt(t.position);continue}else{t.position=o,t.line=l,t.lineStart=u,t.lineIndent=c;break}}a&&(Ns(t,s,o,!1),qm(t,t.line-l),s=o=t.position,a=!1),lo(p)||(o=t.position+1),p=t.input.charCodeAt(++t.position)}return Ns(t,s,o,!1),t.result?!0:(t.kind=f,t.result=m,!1)}function Ck(t,e){var n,r,i;if(n=t.input.charCodeAt(t.position),n!==39)return!1;for(t.kind="scalar",t.result="",t.position++,r=i=t.position;(n=t.input.charCodeAt(t.position))!==0;)if(n===39)if(Ns(t,r,t.position,!0),n=t.input.charCodeAt(++t.position),n===39)r=t.position,t.position++,i=t.position;else return!0;else hi(n)?(Ns(t,r,i,!0),qm(t,Mt(t,!1,e)),r=i=t.position):t.position===t.lineStart&&df(t)?fe(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);fe(t,"unexpected end of the stream within a single quoted scalar")}function Rk(t,e){var n,r,i,s,o,a;if(a=t.input.charCodeAt(t.position),a!==34)return!1;for(t.kind="scalar",t.result="",t.position++,n=r=t.position;(a=t.input.charCodeAt(t.position))!==0;){if(a===34)return Ns(t,n,t.position,!0),t.position++,!0;if(a===92){if(Ns(t,n,t.position,!0),a=t.input.charCodeAt(++t.position),hi(a))Mt(t,!1,e);else if(a<256&&IP[a])t.result+=SP[a],t.position++;else if((o=Nk(a))>0){for(i=o,s=0;i>0;i--)a=t.input.charCodeAt(++t.position),(o=Tk(a))>=0?s=(s<<4)+o:fe(t,"expected hexadecimal character");t.result+=Pk(s),t.position++}else fe(t,"unknown escape sequence");n=r=t.position}else hi(a)?(Ns(t,n,r,!0),qm(t,Mt(t,!1,e)),n=r=t.position):t.position===t.lineStart&&df(t)?fe(t,"unexpected end of the document within a double quoted scalar"):(t.position++,r=t.position)}fe(t,"unexpected end of the stream within a double quoted scalar")}function Ak(t,e){var n=!0,r,i,s,o=t.tag,a,l=t.anchor,u,c,f,m,p,d=Object.create(null),_,C,h,b;if(b=t.input.charCodeAt(t.position),b===91)c=93,p=!1,a=[];else if(b===123)c=125,p=!0,a={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=a),b=t.input.charCodeAt(++t.position);b!==0;){if(Mt(t,!0,e),b=t.input.charCodeAt(t.position),b===c)return t.position++,t.tag=o,t.anchor=l,t.kind=p?"mapping":"sequence",t.result=a,!0;n?b===44&&fe(t,"expected the node content, but found ','"):fe(t,"missed comma between flow collection entries"),C=_=h=null,f=m=!1,b===63&&(u=t.input.charCodeAt(t.position+1),Mn(u)&&(f=m=!0,t.position++,Mt(t,!0,e))),r=t.line,i=t.lineStart,s=t.position,Da(t,e,cf,!1,!0),C=t.tag,_=t.result,Mt(t,!0,e),b=t.input.charCodeAt(t.position),(m||t.line===r)&&b===58&&(f=!0,b=t.input.charCodeAt(++t.position),Mt(t,!0,e),Da(t,e,cf,!1,!0),h=t.result),p?La(t,a,d,C,_,h,r,i,s):f?a.push(La(t,null,d,C,_,h,r,i,s)):a.push(_),Mt(t,!0,e),b=t.input.charCodeAt(t.position),b===44?(n=!0,b=t.input.charCodeAt(++t.position)):n=!1}fe(t,"unexpected end of the stream within a flow collection")}function xk(t,e){var n,r,i=Fm,s=!1,o=!1,a=e,l=0,u=!1,c,f;if(f=t.input.charCodeAt(t.position),f===124)r=!1;else if(f===62)r=!0;else return!1;for(t.kind="scalar",t.result="";f!==0;)if(f=t.input.charCodeAt(++t.position),f===43||f===45)Fm===i?i=f===43?bP:gk:fe(t,"repeat of a chomping mode identifier");else if((c=vk(f))>=0)c===0?fe(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?fe(t,"repeat of an indentation width identifier"):(a=e+c-1,o=!0);else break;if(lo(f)){do f=t.input.charCodeAt(++t.position);while(lo(f));if(f===35)do f=t.input.charCodeAt(++t.position);while(!hi(f)&&f!==0)}for(;f!==0;){for(Vm(t),t.lineIndent=0,f=t.input.charCodeAt(t.position);(!o||t.lineIndenta&&(a=t.lineIndent),hi(f)){l++;continue}if(t.lineIndente)&&l!==0)fe(t,"bad indentation of a sequence entry");else if(t.lineIndente)&&(C&&(o=t.line,a=t.lineStart,l=t.position),Da(t,e,cf,!0,i)&&(C?p=t.result:_=t.result),C||(La(t,f,m,d,p,_,o,a,l),d=p=_=null),Mt(t,!0,-1),b=t.input.charCodeAt(t.position)),(t.line===s||t.lineIndent>e)&&b!==0)fe(t,"bad indentation of a mapping entry");else if(t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndent tag; it should be "scalar", not "'+t.kind+'"'),f=0,m=t.implicitTypes.length;f"),t.result!==null&&p.kind!==t.kind&&fe(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+p.kind+'", not "'+t.kind+'"'),p.resolve(t.result,t.tag)?(t.result=p.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):fe(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||c}function wk(t){var e=t.position,n,r,i,s=!1,o;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(o=t.input.charCodeAt(t.position))!==0&&(Mt(t,!0,-1),o=t.input.charCodeAt(t.position),!(t.lineIndent>0||o!==37));){for(s=!0,o=t.input.charCodeAt(++t.position),n=t.position;o!==0&&!Mn(o);)o=t.input.charCodeAt(++t.position);for(r=t.input.slice(n,t.position),i=[],r.length<1&&fe(t,"directive name must not be less than one character in length");o!==0;){for(;lo(o);)o=t.input.charCodeAt(++t.position);if(o===35){do o=t.input.charCodeAt(++t.position);while(o!==0&&!hi(o));break}if(hi(o))break;for(n=t.position;o!==0&&!Mn(o);)o=t.input.charCodeAt(++t.position);i.push(t.input.slice(n,t.position))}o!==0&&Vm(t),Ts.call(CP,r)?CP[r](t,r,i):ff(t,'unknown document directive "'+r+'"')}if(Mt(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,Mt(t,!0,-1)):s&&fe(t,"directives end mark is expected"),Da(t,t.lineIndent-1,cf,!1,!0),Mt(t,!0,-1),t.checkLineBreaks&&hk.test(t.input.slice(e,t.position))&&ff(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&pf(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,Mt(t,!0,-1));return}if(t.positione)&&l!==0)fe(t,"bad indentation of a sequence entry");else if(t.lineIndente)&&(C&&(o=t.line,a=t.lineStart,l=t.position),Da(t,e,ff,!0,i)&&(C?d=t.result:_=t.result),C||(La(t,f,m,p,d,_,o,a,l),p=d=_=null),Mt(t,!0,-1),b=t.input.charCodeAt(t.position)),(t.line===s||t.lineIndent>e)&&b!==0)fe(t,"bad indentation of a mapping entry");else if(t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndent tag; it should be "scalar", not "'+t.kind+'"'),f=0,m=t.implicitTypes.length;f"),t.result!==null&&d.kind!==t.kind&&fe(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+d.kind+'", not "'+t.kind+'"'),d.resolve(t.result,t.tag)?(t.result=d.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):fe(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||c}function Dk(t){var e=t.position,n,r,i,s=!1,o;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(o=t.input.charCodeAt(t.position))!==0&&(Mt(t,!0,-1),o=t.input.charCodeAt(t.position),!(t.lineIndent>0||o!==37));){for(s=!0,o=t.input.charCodeAt(++t.position),n=t.position;o!==0&&!Mn(o);)o=t.input.charCodeAt(++t.position);for(r=t.input.slice(n,t.position),i=[],r.length<1&&fe(t,"directive name must not be less than one character in length");o!==0;){for(;lo(o);)o=t.input.charCodeAt(++t.position);if(o===35){do o=t.input.charCodeAt(++t.position);while(o!==0&&!hi(o));break}if(hi(o))break;for(n=t.position;o!==0&&!Mn(o);)o=t.input.charCodeAt(++t.position);i.push(t.input.slice(n,t.position))}o!==0&&Vm(t),Ts.call(RP,r)?RP[r](t,r,i):pf(t,'unknown document directive "'+r+'"')}if(Mt(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,Mt(t,!0,-1)):s&&fe(t,"directives end mark is expected"),Da(t,t.lineIndent-1,ff,!1,!0),Mt(t,!0,-1),t.checkLineBreaks&&yk.test(t.input.slice(e,t.position))&&pf(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&df(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,Mt(t,!0,-1));return}if(t.position=55296&&n<=56319&&e+1=56320&&r<=57343)?(n-55296)*1024+r-56320+65536:n}function jP(t){var e=/^\n* /;return e.test(t)}var UP=1,Gm=2,GP=3,WP=4,ka=5;function a1(t,e,n,r,i,s,o,a){var l,u=0,c=null,f=!1,m=!1,d=r!==-1,p=-1,_=s1(Ul(t,0))&&o1(Ul(t,t.length-1));if(e||o)for(l=0;l=65536?l+=2:l++){if(u=Ul(t,l),!jl(u))return ka;_=_&&BP(u,c,a),c=u}else{for(l=0;l=65536?l+=2:l++){if(u=Ul(t,l),u===ql)f=!0,d&&(m=m||l-p-1>r&&t[p+1]!==" ",p=l);else if(!jl(u))return ka;_=_&&BP(u,c,a),c=u}m=m||d&&l-p-1>r&&t[p+1]!==" "}return!f&&!m?_&&!o&&!i(t)?UP:s===Bl?ka:Gm:n>9&&jP(t)?ka:o?s===Bl?ka:Gm:m?WP:GP}function l1(t,e,n,r,i){t.dump=function(){if(e.length===0)return t.quotingType===Bl?'""':"''";if(!t.noCompatMode&&(Jk.indexOf(e)!==-1||Zk.test(e)))return t.quotingType===Bl?'"'+e+'"':"'"+e+"'";var s=t.indent*Math.max(1,n),o=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-s),a=r||t.flowLevel>-1&&n>=t.flowLevel;function l(u){return i1(t,u)}switch(a1(e,a,t.indent,o,l,t.quotingType,t.forceQuotes&&!r,i)){case UP:return e;case Gm:return"'"+e.replace(/'/g,"''")+"'";case GP:return"|"+HP(e,t.indent)+YP(VP(e,s));case WP:return">"+HP(e,t.indent)+YP(VP(u1(e,o),s));case ka:return'"'+c1(e)+'"';default:throw new En("impossible error: invalid scalar style")}}()}function HP(t,e){var n=jP(t)?String(e):"",r=t[t.length-1]===` +`+Wt.repeat(" ",t.indent*e)}function a1(t,e){var n,r,i;for(n=0,r=t.implicitTypes.length;n=55296&&n<=56319&&e+1=56320&&r<=57343)?(n-55296)*1024+r-56320+65536:n}function UP(t){var e=/^\n* /;return e.test(t)}var GP=1,Gm=2,WP=3,HP=4,ka=5;function c1(t,e,n,r,i,s,o,a){var l,u=0,c=null,f=!1,m=!1,p=r!==-1,d=-1,_=l1(Gl(t,0))&&u1(Gl(t,t.length-1));if(e||o)for(l=0;l=65536?l+=2:l++){if(u=Gl(t,l),!Ul(u))return ka;_=_&&jP(u,c,a),c=u}else{for(l=0;l=65536?l+=2:l++){if(u=Gl(t,l),u===Bl)f=!0,p&&(m=m||l-d-1>r&&t[d+1]!==" ",d=l);else if(!Ul(u))return ka;_=_&&jP(u,c,a),c=u}m=m||p&&l-d-1>r&&t[d+1]!==" "}return!f&&!m?_&&!o&&!i(t)?GP:s===jl?ka:Gm:n>9&&UP(t)?ka:o?s===jl?ka:Gm:m?HP:WP}function f1(t,e,n,r,i){t.dump=function(){if(e.length===0)return t.quotingType===jl?'""':"''";if(!t.noCompatMode&&(t1.indexOf(e)!==-1||n1.test(e)))return t.quotingType===jl?'"'+e+'"':"'"+e+"'";var s=t.indent*Math.max(1,n),o=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-s),a=r||t.flowLevel>-1&&n>=t.flowLevel;function l(u){return a1(t,u)}switch(c1(e,a,t.indent,o,l,t.quotingType,t.forceQuotes&&!r,i)){case GP:return e;case Gm:return"'"+e.replace(/'/g,"''")+"'";case WP:return"|"+YP(e,t.indent)+KP(qP(e,s));case HP:return">"+YP(e,t.indent)+KP(qP(p1(e,o),s));case ka:return'"'+d1(e)+'"';default:throw new En("impossible error: invalid scalar style")}}()}function YP(t,e){var n=UP(t)?String(e):"",r=t[t.length-1]===` `,i=r&&(t[t.length-2]===` `||t===` `),s=i?"+":r?"":"-";return n+s+` -`}function YP(t){return t[t.length-1]===` -`?t.slice(0,-1):t}function u1(t,e){for(var n=/(\n+)([^\n]*)/g,r=function(){var u=t.indexOf(` -`);return u=u!==-1?u:t.length,n.lastIndex=u,KP(t.slice(0,u),e)}(),i=t[0]===` +`}function KP(t){return t[t.length-1]===` +`?t.slice(0,-1):t}function p1(t,e){for(var n=/(\n+)([^\n]*)/g,r=function(){var u=t.indexOf(` +`);return u=u!==-1?u:t.length,n.lastIndex=u,$P(t.slice(0,u),e)}(),i=t[0]===` `||t[0]===" ",s,o;o=n.exec(t);){var a=o[1],l=o[2];s=l[0]===" ",r+=a+(!i&&!s&&l!==""?` -`:"")+KP(l,e),i=s}return r}function KP(t,e){if(t===""||t[0]===" ")return t;for(var n=/ [^ ]/g,r,i=0,s,o=0,a=0,l="";r=n.exec(t);)a=r.index,a-i>e&&(s=o>i?o:a,l+=` +`:"")+$P(l,e),i=s}return r}function $P(t,e){if(t===""||t[0]===" ")return t;for(var n=/ [^ ]/g,r,i=0,s,o=0,a=0,l="";r=n.exec(t);)a=r.index,a-i>e&&(s=o>i?o:a,l+=` `+t.slice(i,s),i=s+1),o=a;return l+=` `,t.length-i>e&&o>i?l+=t.slice(i,o)+` -`+t.slice(o+1):l+=t.slice(i),l.slice(1)}function c1(t){for(var e="",n=0,r,i=0;i=65536?i+=2:i++)n=Ul(t,i),r=hn[n],!r&&jl(n)?(e+=t[i],n>=65536&&(e+=t[i+1])):e+=r||t1(n);return e}function f1(t,e,n){var r="",i=t.tag,s,o,a;for(s=0,o=n.length;s1024&&(c+="? "),c+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),!!Bi(t,e,u,!1,!1)&&(c+=t.dump,r+=c));t.tag=i,t.dump="{"+r+"}"}function d1(t,e,n,r){var i="",s=t.tag,o=Object.keys(n),a,l,u,c,f,m;if(t.sortKeys===!0)o.sort();else if(typeof t.sortKeys=="function")o.sort(t.sortKeys);else if(t.sortKeys)throw new En("sortKeys must be a boolean or a function");for(a=0,l=o.length;a1024,f&&(t.dump&&ql===t.dump.charCodeAt(0)?m+="?":m+="? "),m+=t.dump,f&&(m+=Um(t,e)),!!Bi(t,e+1,c,!0,f)&&(t.dump&&ql===t.dump.charCodeAt(0)?m+=":":m+=": ",m+=t.dump,i+=m));t.tag=s,t.dump=i||"{}"}function zP(t,e,n){var r,i,s,o,a,l;for(i=n?t.explicitTypes:t.implicitTypes,s=0,o=i.length;s tag resolver accepts not "'+l+'" style');t.dump=r}return!0}return!1}function Bi(t,e,n,r,i,s,o){t.tag=null,t.dump=n,zP(t,n,!1)||zP(t,n,!0);var a=wP.call(t.dump),l=r,u;r&&(r=t.flowLevel<0||t.flowLevel>e);var c=a==="[object Object]"||a==="[object Array]",f,m;if(c&&(f=t.duplicates.indexOf(n),m=f!==-1),(t.tag!==null&&t.tag!=="?"||m||t.indent!==2&&e>0)&&(i=!1),m&&t.usedDuplicates[f])t.dump="*ref_"+f;else{if(c&&m&&!t.usedDuplicates[f]&&(t.usedDuplicates[f]=!0),a==="[object Object]")r&&Object.keys(t.dump).length!==0?(d1(t,e,t.dump,i),m&&(t.dump="&ref_"+f+t.dump)):(p1(t,e,t.dump),m&&(t.dump="&ref_"+f+" "+t.dump));else if(a==="[object Array]")r&&t.dump.length!==0?(t.noArrayIndent&&!o&&e>0?$P(t,e-1,t.dump,i):$P(t,e,t.dump,i),m&&(t.dump="&ref_"+f+t.dump)):(f1(t,e,t.dump),m&&(t.dump="&ref_"+f+" "+t.dump));else if(a==="[object String]")t.tag!=="?"&&l1(t,t.dump,e,s,l);else{if(a==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new En("unacceptable kind of an object to dump "+a)}t.tag!==null&&t.tag!=="?"&&(u=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",t.dump=u+" "+t.dump)}return!0}function m1(t,e){var n=[],r=[],i,s;for(Wm(t,n,r),i=0,s=r.length;i{let i=r.split("|");if(i.length==1)n.push(r);else if(i.length>1){let s=i[0];if(parseInt(s.trim()).toString()==s.trim()){let o=parseInt(s)+1;i.shift();let a=i.join("|"),l=" ".repeat(s.length-o.toString().length);n.push(l+o.toString()+"|"+a)}else n.push(r)}}),n.join(` -`)}var y1={checkDocument(t){let e=[];if(t.hasFrontMatter()){let n=t.getFrontMatter();try{hf(n,{onWarning:r=>{let i=new qt,s=new qt;i.line=r.mark.line+2,i.char=r.mark.column,s.line=r.mark.line+2,s.char=r.mark.snippet.length+r.mark.column;let o={start:i,end:s},a=new M;a.errorCode=P.LINT_INVALID_FRONT_MATTER,a.level=1,a.message=ZP(r.message),a.range=o,e.push(a)}})}catch(r){if(r instanceof QP){let i=new qt,s=new qt;i.line=r.mark.line+2,i.char=r.mark.column,s.line=r.mark.line+2,s.char=r.mark.snippet.length+r.mark.column;let o={start:i,end:s},a=new M;a.errorCode=P.LINT_INVALID_FRONT_MATTER,a.level=0,a.message=ZP(r.message),a.range=o,e.push(a)}}}return e}},eI=y1;var b1={checkDocument(t){let e=[];return t.getAllAntlersNodes().forEach(n=>{var r,i;if(n.isTagNode&&n.name!=null&&n.getTagName()=="partial"){let s=Zo(n);if(s==null)return;let o=(i=(r=ce.instance)==null?void 0:r.getStructure())==null?void 0:i.findRelativeView(s);if(typeof o=="undefined"||o==null)return;o.documentUri==t.documentUri&&n.findParentOfType(["if","elseif","else"])==null&&e.push(M.makeSyntaxError(P.LINT_POSSIBLE_PARTIAL_RECURSION,n,"Possible partial recursion detected",1))}}),e}},tI=b1;var nI=[uP,eI,tI];var T1=["dump","dd","ddd"],N1={checkNode(t){let e=t.getTagName(),n=[];return T1.includes(e)&&n.push(M.makeSyntaxError(P.LINT_DEBUG_DATA_EXPOSED,t,e+" exposes data and should be removed after debugging.",1)),t.modifiers.hasModifier("dump")&&n.push(M.makeSyntaxError(P.LINT_DEBUG_DATA_EXPOSED,t,"dump modifier exposes data and should be removed after debugging.",1)),n}},rI=N1;var v1={checkNode(t){let e=[];return t.runtimeName().includes("::")&&e.push(M.makeSyntaxError(P.LINT_DOUBLE_COLON_IN_TAG_IDENTIFIER,t,":: in tag part leads to ErrorException call_user_func() runtime exception.",1)),e}},iI=v1;var P1={checkNode(t){var i;let e=[];if(t.isClosedBy==null||t.parent==null||!(t.parent instanceof B))return e;let n=t.parent;if(n.isClosedBy==null)return e;let r=t.runtimeName();return r=="if"||r=="if:index"||r=="else"||r=="else:index"||r=="elseif"||r=="elseif:index"||r=="elseunless"||r=="elseunless:index"||((i=n.isClosedBy.startPosition)==null?void 0:i.isBefore(t.isClosedBy.endPosition))&&(e.push(M.makeSyntaxError(P.LINT_INTERLEAVED_TAG_PAIRS,t,"Closing tag cannot appear after parent closing tag.")),e.push(M.makeSyntaxError(P.LINT_INTERLEAVED_TAG_PAIRS,t.isClosedBy,"Closing tag cannot appear after parent closing tag."))),e}},gf=P1;var I1={checkNode(t){let e=[];return t.modifiers!=null&&t.modifiers.hasMixedModifierStyles&&e.push(M.makeSyntaxError(P.LINT_MIXED_MODIFIERS,t,"Mixed modifier styles is not supported",0)),e}},sI=I1;var S1={checkNode(t){let e=[];if(t.modifiers==null)return e;let n=[];if(t.modifiers.hasParameterModifiers()){let r=null;for(let i=0;io.includes(c));if(o.length>0&&(a=o[o.length-1]),s.modifier.acceptsType.length>0&&(l=s.modifier.acceptsType[0]),!u){e.push(M.makeSyntaxError(P.LINT_MODIFIER_UNEXPECTED_TYPE,s,"Unexpected type supplied to modifier "+s.name+". Expected "+l+" got "+a+".",1));break}}}}}if(t.modifiers.hasShorthandModifiers()&&t.modifierChain!=null){let r=null;for(let i=0;io.includes(c));if(o.length>0&&(a=o[o.length-1]),s.modifier.acceptsType.length>0&&(l=s.modifier.acceptsType[0]),!u){s.refId!=null&&!n.includes(s.refId)&&(e.push(M.makeSyntaxError(P.LINT_MODIFIER_UNEXPECTED_TYPE,s,"Unexpected type supplied to modifier "+s.name+". Expected "+l+" got "+a+".",1)),n.push(s.refId));break}}}}}if(t.runtimeNodes!=null&&t.runtimeNodes.length>0)for(let r=0;rl.includes(m));if(l.length>0&&(u=l[l.length-1]),a.modifier.acceptsType.length>0&&(c=a.modifier.acceptsType[0]),!f){a.refId!=null&&n.includes(a.refId)==!1&&(e.push(M.makeSyntaxError(P.LINT_MODIFIER_UNEXPECTED_TYPE,a,"Unexpected type supplied to modifier "+a.name+". Expected "+c+" got "+u+".",1)),n.push(a.refId));break}}}}}return e}},oI=S1;var C1={checkNode(t){var n,r;let e=[];if(t.isTagNode&&t.name!=null&&t.getTagName()=="partial"){let i=Zo(t);if(i==null)return e;let s=(r=(n=ce.instance)==null?void 0:n.getStructure())==null?void 0:r.findRelativeView(i);if(typeof s=="undefined"||s==null)return e;s.injectsParameters.length>0&&s.injectsParameters.forEach(o=>{o.isRequired&&!t.hasParameter(o.name)&&e.push(M.makeSyntaxError(P.LINT_MISSING_REQUIRED_PARAMETER,t,"Missing required parameter: "+o.name,0))})}return e}},aI=C1;var R1={checkNode(t){let e=[];return t.isTagNode&&t.name!=null&&t.getTagName()=="relate"&&e.push(M.makeSyntaxError(P.LINT_REMOVE_RELATE_TAG,t,"The `relate` tag is not necessary here, and can be removed.",1)),e}},lI=R1;var A1={checkNode(t){let e=[];if(qi.languageVersion=="runtime")return[];if(t.isClosedBy!=null&&t.modifierChain!=null){let n=t.content.trim(),r=t.isClosedBy.content.trim(),i="/"+n;r!=i&&(e.push(M.makeSyntaxError(P.LINT_SHORTHAND_MODIFIER_TAG_MUST_MATCH,t,"Closing tags must match exactly when using shorthand modifiers in tag pairs.",0)),e.push(M.makeSyntaxError(P.LINT_SHORTHAND_MODIFIER_TAG_MUST_MATCH,t.isClosedBy,'Closing tags must match exactly when using shorthand modifiers in tag pairs. Expecting: "'+i+'".',0)))}return e}},uI=A1;var CI=Q(uh()),cM={checkNode(t){var i,s,o;let e=[];if(t.isOpenedBy!=null||!((i=ce.instance)==null?void 0:i.hasStructure()))return e;let n=ce.instance.getStructure().getStatamicVersion();if(n==null||n.trim().length==0||!((s=Ie.instance)==null?void 0:s.isKnownTag(t.runtimeName())))return e;let r=(o=Ie.instance)==null?void 0:o.findTag(t.runtimeName());if((r==null?void 0:r.introducedIn)==null)return e;try{CI.lt(n,r.introducedIn)&&e.push(M.makeSyntaxError(P.LINT_VERSION_NOT_COMPATIBLE,t,t.runtimeName()+" requires at least Statamic "+r.introducedIn+". Current project version: "+n,1))}catch{}return e}},RI=cM;var fM={checkNode(t){let e=[];return t.isTagNode&&t.getTagName()=="set"&&e.push(M.makeSyntaxError(P.LINT_SET_PRODUCES_RUNTIME_ERROR,t,'`set` tag will produce "array_merge(): Expected parameter 1 to be an array, object given" runtime exception.')),e}},AI=fM;var pM=[rI,sI,oI,iI,lI,AI,uI,RI,gf,aI],xI=pM;var Ps=class{constructor(){this.fileDiagnostics=new Map;this.handlers=[];this.docHandlers=[]}registerHandler(e){this.handlers.push(e)}registerDocumentHandler(e){this.docHandlers.push(e)}registerDocumentHandlers(e){for(let n=0;n0}registerDiagnostics(e,n){this.fileDiagnostics.set(e,n)}clearIssues(e){this.fileDiagnostics.set(e,[])}getDiagnostics(e){return this.hasDiagnosticsIssues(e)?this.fileDiagnostics.get(e):[]}checkDocument(e){let n=[];return this.docHandlers.forEach(r=>{r.checkDocument(e).forEach(i=>{n.push(i)})}),n}checkNode(e){let n=[];return e.isComment||this.handlers.forEach(r=>{r.checkNode(e).forEach(i=>{n.push(i)})}),n}getAllDiagnostics(){let e=[];return this.fileDiagnostics.forEach((n,r)=>{for(let i=0;i{i.push(l)}),((s=Zr.instance)==null?void 0:s.hasDiagnosticsIssues(n))&&lf(Zr.instance.getDiagnostics(n)).forEach(l=>{i.push(l)})}e.sendDiagnostics({uri:t.uri,diagnostics:i}),dM(t.uri,e)}function dM(t,e){var n,r,i;if((n=ce.instance)==null?void 0:n.hasStructure()){let s=ce.instance.getStructure().getViews();for(let o=0;o{l.push(c)}),e.sendDiagnostics({uri:s[o].originalDocumentUri,diagnostics:l})}}}}var LS=Q(pn());var Kl=null;function ph(t){Kl=t}var dh=class{constructor(){this.htmlFormatter=null;this.yamlFormatter=null;this.phpFormatter=null;this.preFormatter=null;this.transformOptions=null}withTransformOptions(e){return this.transformOptions=e,this}withPreFormatter(e){return this.preFormatter=e,this}withHtmlFormatter(e){return this.htmlFormatter=e,this}withYamlFormatter(e){return this.yamlFormatter=e,this}withPhpFormatter(e){return this.phpFormatter=e,this}formatText(e){let n=new mt;return n.getDocumentParser().withChildDocuments(!0),n.loadString(e),this.formatDocument(n)}formatDocument(e){if(!e.isFormattingEnabled())return e.getOriginalContent();if(this.preFormatter!=null){let s=this.preFormatter(e);if(s!=null)return s}let n=e.getAllAntlersNodes();for(let s=0;s0)return e.getOriginalContent();if(this.htmlFormatter==null||e.isValid()==!1)return e.getOriginalContent();e.transform().withHtmlFormatter(this.htmlFormatter).withPhpFormatter(this.phpFormatter).withYamlFormatter(this.yamlFormatter),this.transformOptions!=null&&e.transform().withOptions(this.transformOptions);let r=e.transform().toStructure(),i=this.htmlFormatter(r);return e.transform().fromStructure(i)}};var mh=class{static formatFrontMatter(e){try{let n=hf(e,{}),r=XP(n,{indent:2,noArrayIndent:!1,condenseFlow:!1,forceQuotes:!0,noRefs:!0,skipInvalid:!0});return r.endsWith(` -`)&&(r=r.trimEnd()),r}catch{return e}}};function Fn(t,e,n){if(t&&t.hasOwnProperty(e)){let r=t[e];if(r!==null)return r}return n}function wI(t,e,n){let r=Fn(t,e,null);return typeof r=="string"?r.length>0?r.split(",").map(i=>i.trim().toLowerCase()):[]:n}var _F=OS().html,su=class extends dh{constructor(e){super();this.options=e,this.withHtmlFormatter(this.formatHtml).withYamlFormatter(mh.formatFrontMatter).withTransformOptions({endNewline:Fn(e.htmlOptions,"endWithNewline",!1),maxAntlersStatementsPerLine:e.maxStatementsPerLine,newlinesAfterFrontMatter:1,tabSize:e.tabSize})}formatHtml(e){var n;return _F(e,{indent_size:this.options.tabSize,indent_char:this.options.insertSpaces?" ":" ",indent_empty_lines:Fn(this.options.htmlOptions,"indentEmptyLines",!1),wrap_line_length:Fn(this.options.htmlOptions,"wrapLineLength",120),unformatted:(n=wI(this.options.htmlOptions,"unformatted",[]))!=null?n:[],content_unformatted:[],indent_inner_html:Fn(this.options.htmlOptions,"indentInnerHtml",!1),preserve_newlines:Fn(this.options.htmlOptions,"preserveNewLines",!0),max_preserve_newlines:Fn(this.options.htmlOptions,"maxPreserveNewLines",32786),indent_handlebars:Fn(this.options.htmlOptions,"indentHandlebars",!1),end_with_newline:Fn(this.options.htmlOptions,"endWithNewline",!1),extra_liners:[],wrap_attributes:Fn(this.options.htmlOptions,"wrapAttributes","auto"),wrap_attributes_indent_size:Fn(this.options.htmlOptions,"wrapAttributesIndentSize",void 0),eol:` -`,indent_scripts:Fn(this.options.htmlOptions,"indentScripts","normal"),unformatted_content_delimiter:Fn(this.options.htmlOptions,"unformattedContentDelimiter","")})}};function DS(t){let e=Ff(),n=decodeURIComponent(t.textDocument.uri),r=Kl.format;if(e.formatterIgnoreExtensions.length>0){for(let i=0;i{o.push({label:l.name,documentation:l.description})});let a=n.context.modifierContext.activeValueIndex;return a>o.length&&(a=o.length-1),(a<0||o.length==0)&&(a=0),{signatures:[{label:s.name,documentation:{kind:kS.MarkupKind.Markdown,value:s.description},parameters:o,activeParameter:a}],activeParameter:a,activeSignature:0}}return yF}var go=Q(ot());var Mh=class{static getTypedHeader(e,n){let r="";return n.length>0&&(r=n.join(", ")),"**"+e+"** `"+r+"` \n"}static formatParameterHover(e){let n=this.getTypedHeader(e.name,e.expectsTypes);if(n+=e.description,e.documentationLink!=null&&e.documentationLink.trim().length>0){n+=` +`+t.slice(o+1):l+=t.slice(i),l.slice(1)}function d1(t){for(var e="",n=0,r,i=0;i=65536?i+=2:i++)n=Gl(t,i),r=hn[n],!r&&Ul(n)?(e+=t[i],n>=65536&&(e+=t[i+1])):e+=r||i1(n);return e}function m1(t,e,n){var r="",i=t.tag,s,o,a;for(s=0,o=n.length;s1024&&(c+="? "),c+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),!!Bi(t,e,u,!1,!1)&&(c+=t.dump,r+=c));t.tag=i,t.dump="{"+r+"}"}function g1(t,e,n,r){var i="",s=t.tag,o=Object.keys(n),a,l,u,c,f,m;if(t.sortKeys===!0)o.sort();else if(typeof t.sortKeys=="function")o.sort(t.sortKeys);else if(t.sortKeys)throw new En("sortKeys must be a boolean or a function");for(a=0,l=o.length;a1024,f&&(t.dump&&Bl===t.dump.charCodeAt(0)?m+="?":m+="? "),m+=t.dump,f&&(m+=Um(t,e)),!!Bi(t,e+1,c,!0,f)&&(t.dump&&Bl===t.dump.charCodeAt(0)?m+=":":m+=": ",m+=t.dump,i+=m));t.tag=s,t.dump=i||"{}"}function XP(t,e,n){var r,i,s,o,a,l;for(i=n?t.explicitTypes:t.implicitTypes,s=0,o=i.length;s tag resolver accepts not "'+l+'" style');t.dump=r}return!0}return!1}function Bi(t,e,n,r,i,s,o){t.tag=null,t.dump=n,XP(t,n,!1)||XP(t,n,!0);var a=OP.call(t.dump),l=r,u;r&&(r=t.flowLevel<0||t.flowLevel>e);var c=a==="[object Object]"||a==="[object Array]",f,m;if(c&&(f=t.duplicates.indexOf(n),m=f!==-1),(t.tag!==null&&t.tag!=="?"||m||t.indent!==2&&e>0)&&(i=!1),m&&t.usedDuplicates[f])t.dump="*ref_"+f;else{if(c&&m&&!t.usedDuplicates[f]&&(t.usedDuplicates[f]=!0),a==="[object Object]")r&&Object.keys(t.dump).length!==0?(g1(t,e,t.dump,i),m&&(t.dump="&ref_"+f+t.dump)):(h1(t,e,t.dump),m&&(t.dump="&ref_"+f+" "+t.dump));else if(a==="[object Array]")r&&t.dump.length!==0?(t.noArrayIndent&&!o&&e>0?zP(t,e-1,t.dump,i):zP(t,e,t.dump,i),m&&(t.dump="&ref_"+f+t.dump)):(m1(t,e,t.dump),m&&(t.dump="&ref_"+f+" "+t.dump));else if(a==="[object String]")t.tag!=="?"&&f1(t,t.dump,e,s,l);else{if(a==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new En("unacceptable kind of an object to dump "+a)}t.tag!==null&&t.tag!=="?"&&(u=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",t.dump=u+" "+t.dump)}return!0}function _1(t,e){var n=[],r=[],i,s;for(Wm(t,n,r),i=0,s=r.length;i{let i=r.split("|");if(i.length==1)n.push(r);else if(i.length>1){let s=i[0];if(parseInt(s.trim()).toString()==s.trim()){let o=parseInt(s)+1;i.shift();let a=i.join("|"),l=" ".repeat(s.length-o.toString().length);n.push(l+o.toString()+"|"+a)}else n.push(r)}}),n.join(` +`)}var N1={checkDocument(t){let e=[];if(t.hasFrontMatter()){let n=t.getFrontMatter();try{gf(n,{onWarning:r=>{let i=new qt,s=new qt;i.line=r.mark.line+2,i.char=r.mark.column,s.line=r.mark.line+2,s.char=r.mark.snippet.length+r.mark.column;let o={start:i,end:s},a=new M;a.errorCode=v.LINT_INVALID_FRONT_MATTER,a.level=1,a.message=eI(r.message),a.range=o,e.push(a)}})}catch(r){if(r instanceof JP){let i=new qt,s=new qt;i.line=r.mark.line+2,i.char=r.mark.column,s.line=r.mark.line+2,s.char=r.mark.snippet.length+r.mark.column;let o={start:i,end:s},a=new M;a.errorCode=v.LINT_INVALID_FRONT_MATTER,a.level=0,a.message=eI(r.message),a.range=o,e.push(a)}}}return e}},tI=N1;var v1={checkDocument(t){let e=[];return t.getAllAntlersNodes().forEach(n=>{var r,i;if(n.isTagNode&&n.name!=null&&n.getTagName()=="partial"){let s=Zo(n);if(s==null)return;let o=(i=(r=ce.instance)==null?void 0:r.getStructure())==null?void 0:i.findRelativeView(s);if(typeof o=="undefined"||o==null)return;o.documentUri==t.documentUri&&n.findParentOfType(["if","elseif","else"])==null&&e.push(M.makeSyntaxError(v.LINT_POSSIBLE_PARTIAL_RECURSION,n,"Possible partial recursion detected",1))}}),e}},nI=v1;var rI=[cP,tI,nI];var P1=["dump","dd","ddd"],I1={checkNode(t){let e=t.getTagName(),n=[];return P1.includes(e)&&n.push(M.makeSyntaxError(v.LINT_DEBUG_DATA_EXPOSED,t,e+" exposes data and should be removed after debugging.",1)),t.modifiers.hasModifier("dump")&&n.push(M.makeSyntaxError(v.LINT_DEBUG_DATA_EXPOSED,t,"dump modifier exposes data and should be removed after debugging.",1)),n}},iI=I1;var S1={checkNode(t){let e=[];return t.runtimeName().includes("::")&&e.push(M.makeSyntaxError(v.LINT_DOUBLE_COLON_IN_TAG_IDENTIFIER,t,":: in tag part leads to ErrorException call_user_func() runtime exception.",1)),e}},sI=S1;var C1={checkNode(t){var i;let e=[];if(t.isClosedBy==null||t.parent==null||!(t.parent instanceof B))return e;let n=t.parent;if(n.isClosedBy==null)return e;let r=t.runtimeName();return r=="if"||r=="if:index"||r=="else"||r=="else:index"||r=="elseif"||r=="elseif:index"||r=="elseunless"||r=="elseunless:index"||((i=n.isClosedBy.startPosition)==null?void 0:i.isBefore(t.isClosedBy.endPosition))&&(e.push(M.makeSyntaxError(v.LINT_INTERLEAVED_TAG_PAIRS,t,"Closing tag cannot appear after parent closing tag.")),e.push(M.makeSyntaxError(v.LINT_INTERLEAVED_TAG_PAIRS,t.isClosedBy,"Closing tag cannot appear after parent closing tag."))),e}},_f=C1;var R1={checkNode(t){let e=[];return t.modifiers!=null&&t.modifiers.hasMixedModifierStyles&&e.push(M.makeSyntaxError(v.LINT_MIXED_MODIFIERS,t,"Mixed modifier styles is not supported",0)),e}},oI=R1;var A1={checkNode(t){let e=[];if(t.modifiers==null)return e;let n=[];if(t.modifiers.hasParameterModifiers()){let r=null;for(let i=0;io.includes(c));if(o.length>0&&(a=o[o.length-1]),s.modifier.acceptsType.length>0&&(l=s.modifier.acceptsType[0]),!u){e.push(M.makeSyntaxError(v.LINT_MODIFIER_UNEXPECTED_TYPE,s,"Unexpected type supplied to modifier "+s.name+". Expected "+l+" got "+a+".",1));break}}}}}if(t.modifiers.hasShorthandModifiers()&&t.modifierChain!=null){let r=null;for(let i=0;io.includes(c));if(o.length>0&&(a=o[o.length-1]),s.modifier.acceptsType.length>0&&(l=s.modifier.acceptsType[0]),!u){s.refId!=null&&!n.includes(s.refId)&&(e.push(M.makeSyntaxError(v.LINT_MODIFIER_UNEXPECTED_TYPE,s,"Unexpected type supplied to modifier "+s.name+". Expected "+l+" got "+a+".",1)),n.push(s.refId));break}}}}}if(t.runtimeNodes!=null&&t.runtimeNodes.length>0)for(let r=0;rl.includes(m));if(l.length>0&&(u=l[l.length-1]),a.modifier.acceptsType.length>0&&(c=a.modifier.acceptsType[0]),!f){a.refId!=null&&n.includes(a.refId)==!1&&(e.push(M.makeSyntaxError(v.LINT_MODIFIER_UNEXPECTED_TYPE,a,"Unexpected type supplied to modifier "+a.name+". Expected "+c+" got "+u+".",1)),n.push(a.refId));break}}}}}return e}},aI=A1;var x1={checkNode(t){var n,r;let e=[];if(t.isTagNode&&t.name!=null&&t.getTagName()=="partial"){let i=Zo(t);if(i==null)return e;let s=(r=(n=ce.instance)==null?void 0:n.getStructure())==null?void 0:r.findRelativeView(i);if(typeof s=="undefined"||s==null)return e;s.injectsParameters.length>0&&s.injectsParameters.forEach(o=>{o.isRequired&&!t.hasParameter(o.name)&&e.push(M.makeSyntaxError(v.LINT_MISSING_REQUIRED_PARAMETER,t,"Missing required parameter: "+o.name,0))})}return e}},lI=x1;var E1={checkNode(t){let e=[];return t.isTagNode&&t.name!=null&&t.getTagName()=="relate"&&e.push(M.makeSyntaxError(v.LINT_REMOVE_RELATE_TAG,t,"The `relate` tag is not necessary here, and can be removed.",1)),e}},uI=E1;var w1={checkNode(t){let e=[];if(qi.languageVersion=="runtime")return[];if(t.isClosedBy!=null&&t.modifierChain!=null){let n=t.content.trim(),r=t.isClosedBy.content.trim(),i="/"+n;r!=i&&(e.push(M.makeSyntaxError(v.LINT_SHORTHAND_MODIFIER_TAG_MUST_MATCH,t,"Closing tags must match exactly when using shorthand modifiers in tag pairs.",0)),e.push(M.makeSyntaxError(v.LINT_SHORTHAND_MODIFIER_TAG_MUST_MATCH,t.isClosedBy,'Closing tags must match exactly when using shorthand modifiers in tag pairs. Expecting: "'+i+'".',0)))}return e}},cI=w1;var RI=Q(uh()),dM={checkNode(t){var i,s,o;let e=[];if(t.isOpenedBy!=null||!((i=ce.instance)==null?void 0:i.hasStructure()))return e;let n=ce.instance.getStructure().getStatamicVersion();if(n==null||n.trim().length==0||!((s=Ie.instance)==null?void 0:s.isKnownTag(t.runtimeName())))return e;let r=(o=Ie.instance)==null?void 0:o.findTag(t.runtimeName());if((r==null?void 0:r.introducedIn)==null)return e;try{RI.lt(n,r.introducedIn)&&e.push(M.makeSyntaxError(v.LINT_VERSION_NOT_COMPATIBLE,t,t.runtimeName()+" requires at least Statamic "+r.introducedIn+". Current project version: "+n,1))}catch{}return e}},AI=dM;var mM={checkNode(t){let e=[];return t.isTagNode&&t.getTagName()=="set"&&e.push(M.makeSyntaxError(v.LINT_SET_PRODUCES_RUNTIME_ERROR,t,'`set` tag will produce "array_merge(): Expected parameter 1 to be an array, object given" runtime exception.')),e}},xI=mM;var hM={checkNode(t){var r,i,s,o,a,l;let e=t.getTagName().toLowerCase(),n=[];if(e=="get"||e=="post"){if(Tl((i=(r=we.instance)==null?void 0:r.getModifierNames())!=null?i:[],t.modifiers.modifierNames).length==0&&t.modifiers.modifierNames.length>0&&(t.modifiers.modifierNames.length==1&&((o=(s=we)==null?void 0:s.instance)==null?void 0:o.hasMacro(t.modifiers.modifierNames[0])))==!1)return n;let c=!1;for(let f=0;f0}registerDiagnostics(e,n){this.fileDiagnostics.set(e,n)}clearIssues(e){this.fileDiagnostics.set(e,[])}getDiagnostics(e){return this.hasDiagnosticsIssues(e)?this.fileDiagnostics.get(e):[]}checkDocument(e){let n=[];return this.docHandlers.forEach(r=>{r.checkDocument(e).forEach(i=>{n.push(i)})}),n}checkNode(e){let n=[];return e.isComment||this.handlers.forEach(r=>{r.checkNode(e).forEach(i=>{n.push(i)})}),n}getAllDiagnostics(){let e=[];return this.fileDiagnostics.forEach((n,r)=>{for(let i=0;i{i.push(l)}),((s=Zr.instance)==null?void 0:s.hasDiagnosticsIssues(n))&&uf(Zr.instance.getDiagnostics(n)).forEach(l=>{i.push(l)})}e.sendDiagnostics({uri:t.uri,diagnostics:i}),_M(t.uri,e)}function _M(t,e){var n,r,i;if((n=ce.instance)==null?void 0:n.hasStructure()){let s=ce.instance.getStructure().getViews();for(let o=0;o{l.push(c)}),e.sendDiagnostics({uri:s[o].originalDocumentUri,diagnostics:l})}}}}var kS=Q(pn());var $l=null;function ph(t){$l=t}var dh=class{constructor(){this.htmlFormatter=null;this.yamlFormatter=null;this.phpFormatter=null;this.preFormatter=null;this.transformOptions=null;this.createExtraVirtualStructures=!1}withTransformOptions(e){return this.transformOptions=e,this}withPreFormatter(e){return this.preFormatter=e,this}withHtmlFormatter(e){return this.htmlFormatter=e,this}withYamlFormatter(e){return this.yamlFormatter=e,this}withPhpFormatter(e){return this.phpFormatter=e,this}formatText(e){let n=new mt;return n.getDocumentParser().withChildDocuments(!0),n.loadString(e),this.formatDocument(n)}formatDocument(e){if(!e.isFormattingEnabled())return e.getOriginalContent();if(this.preFormatter!=null){let s=this.preFormatter(e);if(s!=null)return s}let n=e.getAllAntlersNodes();for(let s=0;s0)return e.getOriginalContent();if(this.htmlFormatter==null||e.isValid()==!1)return e.getOriginalContent();e.transform().produceExtraStructuralPairs(this.createExtraVirtualStructures).withHtmlFormatter(this.htmlFormatter).withPhpFormatter(this.phpFormatter).withYamlFormatter(this.yamlFormatter),this.transformOptions!=null&&e.transform().withOptions(this.transformOptions);let r=e.transform().toStructure(),i=this.htmlFormatter(r);return e.transform().fromStructure(i)}};var mh=class{static formatFrontMatter(e){try{let n=gf(e,{}),r=QP(n,{indent:2,noArrayIndent:!1,condenseFlow:!1,forceQuotes:!0,noRefs:!0,skipInvalid:!0});return r.endsWith(` +`)&&(r=r.trimEnd()),r}catch{return e}}};function Fn(t,e,n){if(t&&t.hasOwnProperty(e)){let r=t[e];if(r!==null)return r}return n}function LI(t,e,n){let r=Fn(t,e,null);return typeof r=="string"?r.length>0?r.split(",").map(i=>i.trim().toLowerCase()):[]:n}var NF=DS().html,ou=class extends dh{constructor(e){super();this.options=e,this.withHtmlFormatter(this.formatHtml).withYamlFormatter(mh.formatFrontMatter).withTransformOptions({endNewline:Fn(e.htmlOptions,"endWithNewline",!1),maxAntlersStatementsPerLine:e.maxStatementsPerLine,newlinesAfterFrontMatter:1,tabSize:e.tabSize})}formatHtml(e){var n;return NF(e,{indent_size:this.options.tabSize,indent_char:this.options.insertSpaces?" ":" ",indent_empty_lines:Fn(this.options.htmlOptions,"indentEmptyLines",!1),wrap_line_length:Fn(this.options.htmlOptions,"wrapLineLength",120),unformatted:(n=LI(this.options.htmlOptions,"unformatted",[]))!=null?n:[],content_unformatted:[],indent_inner_html:Fn(this.options.htmlOptions,"indentInnerHtml",!1),preserve_newlines:Fn(this.options.htmlOptions,"preserveNewLines",!0),max_preserve_newlines:Fn(this.options.htmlOptions,"maxPreserveNewLines",32786),indent_handlebars:Fn(this.options.htmlOptions,"indentHandlebars",!1),end_with_newline:Fn(this.options.htmlOptions,"endWithNewline",!1),extra_liners:[],wrap_attributes:Fn(this.options.htmlOptions,"wrapAttributes","auto"),wrap_attributes_indent_size:Fn(this.options.htmlOptions,"wrapAttributesIndentSize",void 0),eol:` +`,indent_scripts:Fn(this.options.htmlOptions,"indentScripts","normal"),unformatted_content_delimiter:Fn(this.options.htmlOptions,"unformattedContentDelimiter","")})}};function MS(t){let e=Vf(),n=decodeURIComponent(t.textDocument.uri),r=$l.format;if(e.formatterIgnoreExtensions.length>0){for(let i=0;i{o.push({label:l.name,documentation:l.description})});let a=n.context.modifierContext.activeValueIndex;return a>o.length&&(a=o.length-1),(a<0||o.length==0)&&(a=0),{signatures:[{label:s.name,documentation:{kind:FS.MarkupKind.Markdown,value:s.description},parameters:o,activeParameter:a}],activeParameter:a,activeSignature:0}}return vF}var go=Q(ot());var Mh=class{static getTypedHeader(e,n){let r="";return n.length>0&&(r=n.join(", ")),"**"+e+"** `"+r+"` \n"}static formatParameterHover(e){let n=this.getTypedHeader(e.name,e.expectsTypes);if(n+=e.description,e.documentationLink!=null&&e.documentationLink.trim().length>0){n+=` `;let r="Documentation Reference]";e.docLinkName!=null&&e.docLinkName.trim().length>0&&(r=e.docLinkName.trim()),n+="["+r+"]("+e.documentationLink+")"}return{contents:{kind:go.MarkupKind.Markdown,value:n}}}static formatModifierHover(e){let n=this.getTypedHeader(e.name,e.acceptsType),r="";if(e.parameters.length>0){let s=[];e.parameters.forEach(o=>{s.push("$"+o.name)}),r=s.join(", ")}let i="";if(e.returnsType.length==1)i=e.returnsType[0];else{let s=[];e.returnsType.forEach(o=>{s.push(o)}),i=s.join(", ")}return n+=e.description+` `,n+="```js\n",n+="function "+e.name+"("+r+"):"+i,n+="\n```",e.docLink!=null&&e.docLink.trim().length>0&&(n+=` @@ -440,5 +442,5 @@ ${i} **From**: `+n.runtimeName()),{contents:{kind:go.MarkupKind.Markdown,value:r}}}static formatScopeVariableHover(e){if(e.sourceField!=null)return this.formatBlueprintHover(e.sourceField,e.introducedBy);let n="**"+e.name+`** `;return n+="**Type**: "+e.dataType,e.introducedBy!=null&&(n+=` -**From**: `+e.introducedBy.runtimeName()),{contents:{kind:go.MarkupKind.Markdown,value:n}}}static getHover(e){var r,i,s,o,a,l,u,c,f;if(e==null||e.nodesInScope.length==0)return null;let n=e.nodesInScope[e.nodesInScope.length-1];if(e.context!=null&&e.context.node!=null&&(n=e.context.node),n!=null){if((r=Ie.instance)==null?void 0:r.isKnownTag(n.runtimeName())){let _=(i=Ie.instance)==null?void 0:i.findTag(n.runtimeName());if(e.context!=null&&e.context.isCursorInIdentifier&&typeof(_==null?void 0:_.resolveDocumentation)!="undefined"){let C=_.resolveDocumentation(e);if(C.trim().length>0)return{contents:{kind:go.MarkupKind.Markdown,value:C},range:{start:ln(n.startPosition),end:ln(n.endPosition)}}}if(_!=null&&((o=(s=e.context)==null?void 0:s.parameterContext)==null?void 0:o.parameter)!=null){let C=e.context.parameterContext.parameter,h=Ie.instance.getParameter(_.tagName,C.name);if(h!=null){if(typeof h.providesDocumentation!="undefined"){let b=h.providesDocumentation(e);if(b.trim().length>0)return{contents:{kind:go.MarkupKind.Markdown,value:b},range:{start:ln(n.startPosition),end:ln(n.endPosition)}}}return this.formatParameterHover(h)}else if(C.isModifierParameter&&C.modifier!=null)return this.formatModifierHover(C.modifier)}}if(((a=e.context)==null?void 0:a.parameterContext)!=null&&((u=(l=e.context)==null?void 0:l.parameterContext.parameter)==null?void 0:u.modifier)!=null)return this.formatModifierHover(e.context.parameterContext.parameter.modifier);if(((c=e.context)==null?void 0:c.modifierContext)!=null){let _=(f=Me.instance)==null?void 0:f.getModifier(e.context.modifierContext.name);if(_!=null)return this.formatModifierHover(_)}let m=e.position.line+1,d=e.position.character+1,p=e.antlersDocument.cursor.position(m,d);return n.scopeVariable!=null&&p!=null&&p.isWithin(n.startPosition,n.endPosition)?this.formatScopeVariableHover(n.scopeVariable):null}return null}};function FS(t){var r;if(((r=ce.instance)==null?void 0:r.hasStructure())==!1)return null;let e=decodeURIComponent(t.textDocument.uri);if(Se.hasDocument(e)==!1)return null;let n=kn(t.position,e);return Mh.getHover(n)}var Fh=class{static findLocations(e,n){if(e==null||e.nodesInScope.length==0)return null;let r=e.nodesInScope[e.nodesInScope.length-1];if(e.context!=null&&e.context.node!=null&&(r=e.context.node),r!=null&&r.scopeVariable!=null&&r.scopeVariable.introducedBy!=null){let i=[];return i.push({uri:n.textDocument.uri,range:{start:ln(r.scopeVariable.introducedBy.startPosition),end:ln(r.scopeVariable.introducedBy.endPosition)}}),i}return null}};function VS(t){var r;if(((r=ce.instance)==null?void 0:r.hasStructure())==!1)return null;let e=decodeURIComponent(t.textDocument.uri);if(Se.hasDocument(e)==!1)return null;let n=kn(t.position,e);return Fh.findLocations(n,t)}var qS=Q(nn());var Vf=new Map,qf=new Map;function Vh(){let t={types:["comment","string","keyword","number","regexp","operator","namespace","type","struct","class","interface","enum","typeParameter","function","method","macro","variable","parameter","property","label","antlersAttribute"],modifiers:["declaration","documentation","readonly","static","abstract","deprecated","modification","async"]};return t.types.forEach((e,n)=>Vf.set(e,n)),t.modifiers.forEach((e,n)=>qf.set(e,n)),{legend:t,async getSemanticTokens(e,n){let r=decodeURIComponent(e.uri),i=new qS.SemanticTokensBuilder,s=[];if(Se.hasDocument(r)){let o=Se.getDocument(r);o.nodes.getAllRuntimeNodes().forEach(d=>{d instanceof jt&&s.push(d)});let l=new Map;s.forEach(d=>{var p;d.startPosition!=null&&(l.has(d.startPosition.line)||l.set(d.startPosition.line,[]),(p=l.get(d.startPosition.line))==null||p.push(d))});let u=[];Array.from(l.keys()).sort((d,p)=>d-p).forEach(d=>{l.get(d).sort((C,h)=>{var b,g,N,S;return((g=(b=C.startPosition)==null?void 0:b.char)!=null?g:0)-((S=(N=h.startPosition)==null?void 0:N.char)!=null?S:0)}).forEach(C=>{u.push(C)})}),u.forEach(d=>{d instanceof jt&&d.startPosition!=null&&d.endPosition!=null&&i.push(d.startPosition.line-1,d.startPosition.char,d.endPosition.char-d.startPosition.char,jS("function"),BS([]))}),o.nodes.getAllParameterNodes().forEach(d=>{d.namePosition!=null&&d.namePosition.start!=null&&d.namePosition.end!=null&&i.push(d.namePosition.start.line-1,d.namePosition.start.char-1,d.namePosition.end.char-d.namePosition.start.char,jS("antlersAttribute"),BS([]))})}return i.build().data}}}function BS(t){let e=0;for(let n=0;n{if(n.isComment||n.isClosingTag&&!n.isConditionNode||n.isConditionNode&&n.name!=null&&n.isClosingTag&&(n.name.name=="if"||n.name.name=="unless"))return;let r=ao(n),i=[];if(n.children.length>0){let u=n.getStructuralChildren();u.length>0&&(i=US(u))}let s=Bf.SymbolKind.Field;n.isTagNode&&(s=Bf.SymbolKind.Class);let o=n.getNameContent().trim(),a=n.getContent().trim(),l=o+" "+a;o==a&&(l=a),l=n.sourceContent,n.name!=null&&n.name.name=="partial"&&(s=Bf.SymbolKind.File),e.push({range:r,kind:s,name:l,selectionRange:r,children:i})}),e}function GS(t){let e=decodeURIComponent(t.textDocument.uri);if(Se.hasDocument(e)){let n=Se.getDocument(e),r=n.nodes.getStructuralNodes();return US(r)}return[]}var qh=class{static getDocumentLinks(e){var r,i,s;let n=[];if((r=ce.instance)==null?void 0:r.hasStructure()){let o=(s=(i=xr.instance)==null?void 0:i.getPartialReferences(e))!=null?s:[];for(let a=0;a0&&(o=o.concat(u))}}else if(typeof i.fields!="undefined"){let a=ou(i,e,"fields",e,n);a.length>0&&(o=o.concat(a))}return o}var $S=Q(mi()),zS=Q(require("fs"));function XS(t,e){let n=zS.readFileSync(t,{encoding:"utf8"}),r=$S.parse(n);if(typeof r=="undefined"||r===null)return[];let i=[];if(typeof r.fields!="undefined")for(let s of Object.keys(r.fields)){let o=r.fields[s],a=o.handle,l="",u="",c="",f=null,m=null,d=null;if(typeof o.import!="undefined"&&(d=o.import),typeof o.field!="undefined"&&(typeof o.field.display!="undefined"&&(l=o.field.display),typeof o.field.type!="undefined"&&(c=o.field.type),typeof o.field.instructions!="undefined"&&(u=o.field.instructions),typeof o.field.max_items!="undefined"&&(f=o.field.max_items),typeof o.field.sets!="undefined")){m=[];for(let p of Object.keys(o.field.sets)){let _=o.field.sets[p],C=ou(_,e,"fields","set:"+p,new Map),h="";typeof _.display!="undefined"&&(h=_.display),m.push({handle:p,displayName:h,fields:C})}}i.push({handle:a,instructionText:u,name:l,type:c,maxItems:f,sets:m,import:d})}return i}var QS=Q(require("path")),JS=Q(require("fs")),ZS=Q(mi());function eC(t){let e=QS.basename(t).split(".").slice(0,-1).join("."),n=e;try{let r=JS.readFileSync(t,{encoding:"utf8"}),i=ZS.parse(r);typeof i.title!="undefined"&&i.title!==null&&(n=i.title)}catch(r){console.error(r)}return{handle:e,title:n}}var tC=Q(require("path")),nC=Q(require("fs")),rC=Q(mi());function iC(t){let e=tC.basename(t).split(".").slice(0,-1).join("."),n=e,r="";try{let i=nC.readFileSync(t,{encoding:"utf8"}),s=rC.parse(i);typeof s!="undefined"&&s!==null&&(typeof s.title!="undefined"&&s.title!==null&&(n=s.title),typeof s.disk!="undefined"&&s.disk!==null&&(r=s.disk))}catch(i){console.error(i)}return{handle:e,title:n,diskName:r}}var sC=Q(require("path")),oC=Q(require("fs")),aC=Q(mi());function lC(t){let e=sC.basename(t).split(".").slice(0,-1).join("."),n=oC.readFileSync(t,{encoding:"utf8"}),r="",i="",s="",o=!1,a=[],l=null,u=null,c=[];try{let f=aC.parse(n);if(typeof f!="undefined"&&f!==null){if(typeof f.title!="undefined"&&f.title!==null&&(r=f.title),typeof f.inject!="undefined"&&f.inject!==null){let m=Object.keys(f.inject);for(let d=0;d{i.push(l)}),typeof this.sourceStructure.forms.forEach!="undefined"&&this.sourceStructure.forms.forEach((a,l)=>{a.forEach(u=>{this.blueprintCollectionRef.set(u.blueprintName,l)}),e.push(l),this.blueprintRef.set(l,a)}),typeof this.sourceStructure.globals.forEach!="undefined"&&this.sourceStructure.globals.forEach((a,l)=>{a.forEach(u=>{this.blueprintCollectionRef.set(u.blueprintName,l)}),n.push(l),this.blueprintRef.set(l,a)}),typeof this.sourceStructure.miscFields.forEach!="undefined"&&this.sourceStructure.miscFields.forEach((a,l)=>{a.forEach(u=>{this.blueprintCollectionRef.set(u.blueprintName,l)}),this.blueprintRef.set(l,a)}),typeof this.sourceStructure.taxonomies.forEach!="undefined"&&this.sourceStructure.taxonomies.forEach((a,l)=>{a.forEach(u=>{this.blueprintCollectionRef.set(u.blueprintName,l)}),this.blueprintRef.set(l,a)}),typeof this.sourceStructure.fields.forEach!="undefined"&&this.sourceStructure.fields.forEach((a,l)=>{a.forEach(u=>{this.blueprintCollectionRef.set(u.blueprintName,l)}),this.blueprintRef.set(l,a)}),typeof this.sourceStructure.navigationMenus.forEach!="undefined"&&this.sourceStructure.navigationMenus.forEach((a,l)=>{r.push(l)}),typeof this.sourceStructure.views.forEach!="undefined"&&this.sourceStructure.views.forEach((a,l)=>{this.viewMap.set(a.documentUri,a)}),typeof this.sourceStructure.composerPackages.forEach!="undefined"&&this.sourceStructure.composerPackages.forEach(a=>{a.isStatamicAddon&&this.statamicAddonMapping.set(a.name,a),this.packageMapping.set(a.name,a)}),this.uniqueAssetNames=[...new Set(i)],this.uniqueNavigationNames=[...new Set(r)],this.uniqueGlobalSettingNames=[...new Set(n)],this.uniqueFormNames=[...new Set(e)],this.uniqueCollectionNames=[...new Set(this.collectionNames)],this.uniquePartialViewNames=[...new Set(this.partialViewNames)],this.uniqueTaxonomyNames=[...new Set(this.taxonomyNames)],(s=Me.instance)==null||s.resetMacros(),this.hasMacroFile){let a=dC(this.macroFilePath);a.length>0&&((o=Me.instance)==null||o.registerMacros(a))}this.uniqueUserRoles=[...new Set(this.sourceStructure.userRoleNames)],this.uniqueUserGroups=[...new Set(this.sourceStructure.userGroupNames)],this.sourceStructure.searchIndexes.length==0&&this.sourceStructure.searchIndexes.push("default");for(let a=0;a{r.startsWith("*")==!1&&e.includes(r)==!1&&e.push(r)}),e}getBlueprintDetails(e){if(this.blueprintRef.has(e)==!1){let n=[];return n.push(Hh(e,"title","text")),n.push(Hh(e,"content","markdown")),n.push(Hh(e,"slug","slug")),n}return this.blueprintRef.get(e)}hasViewCollectionInjections(e){return this.viewMap.has(e)==!1?!1:this.viewMap.get(e).injectsCollections.length>0}getCollectionNames(){return this.collectionNames}getCollectionNamesForView(e){return this.viewMap.has(e)==!1?[]:this.viewMap.get(e).injectsCollections}getPublicAssetPaths(){return this.publicAssets}getTaxonomyTerms(e){return this.hasTaxonomy(e)?this.taxonomyTerms.get(e):[]}hasTaxonomy(e){return this.taxonomyNames.includes(e)}getCollectionQueryScopes(){return this.collectionQueryScopes}getBlueprintFields(e){let n=[];for(let r=0;r{let r=Pt(n.relativeDisplayName,"/",".");e.includes(r)==!1&&e.push(r)}),e}getViews(){return this.views}findView(e){if(e.trim()=="")return null;let n=hC(e);for(let r=0;r=0&&r.push(o)}return[...new Set(r)]}function Hi(t,e){if(!Vn.existsSync(t))return[];let n=[],r=Vn.readdirSync(t);for(let i=0;i0&&(O=Vn.existsSync(g));for(let v=0;v0){let y=XS(qn[v],I);ee.set(I,y)}}let Ti=lu(a,".yaml",[]);for(let v=0;v0){Y.set(I,y);let x=_o(Ti[v],I,ee);de.set(I,x),St=St.concat(x),Ve.includes(I)==!1&&Ve.push(I)}}if(Ve.length>0){for(let v=0;v0){let y=_o(Ki[v],I,ee);Z.set(I,y),St=St.concat(y)}}for(let v=0;v0&&(I=x,Ft.includes(x)==!1&&Ft.push(x)),lt.set(I,y)}let vr=Hi(f,".yaml");for(let v=0;v{v.template.trim().length>0&&nr.has(v.template)&&nr.get(v.template).injectsCollections.push(v.handle)}),new _C({composerPackages:X,statamicPackage:$,isMocked:!1,workingDirectory:N,taxonomyPluralizedMapping:Y,collectionScopes:Yi,blueprintFiles:h,collectionBlueprintsPath:n,collections:Nr,rootPath:e,fields:lt,fieldsetsPath:o,fieldsets:ee,collectionNames:Ft,formBlueprintsPath:i,taxonomiesBlueprintsPath:a,globalBlueprintsPath:l,miscBlueprintsPath:u,viewsPath:r,views:b,globalFiles:[],forms:ne,globals:Le,miscFields:Z,taxonomies:de,taxonomyNames:Ve,templates:Ge,partialCache:ut,partialViewNames:bi,macroFilePath:g,hasMacrosFile:O,contentDirectory:c,taxonomyContentDirectory:m,taxonomyTerms:le,assets:yo,assetFields:bo,oauthProviders:[],navigationMenus:Nt,userPermissionsPath:d,userGroupNames:me,userGroups:ue,userRoleNames:Ne,userRoles:se,searchIndexes:[],internalFieldReference:St,restoreProperties:null},t)}var _C=class extends Yh{reloadDetails(){return Kh(this.baseResourcePath)}};var $h=class{static getReferences(e){var n;if(e==null)return null;if(((n=e.context)==null?void 0:n.feature)instanceof oe){let r=e.context.feature;if(r.scopeVariable==null||r.scopeVariable.sourceField==null)return null;let i=new Map;Se.getDocuments().forEach(o=>{let a=o.getAllAntlersNodes(),l=[];a.forEach(u=>{u.runtimeNodes.forEach(c=>{var f;(c.scopeVariable!=null&&c.scopeVariable==r.scopeVariable||c.scopeVariable!=null&&c.scopeVariable.sourceName==((f=r.scopeVariable)==null?void 0:f.sourceName)&&c instanceof oe&&c.name==r.name)&&l.push(c)})}),i.set(o.documentUri,l)});let s=[];return i.forEach((o,a)=>{o.forEach(l=>{s.push({uri:a,range:ao(l)})})}),s}return[]}};function yC(t){var r;if(((r=ce.instance)==null?void 0:r.hasStructure())==!1)return null;let e=decodeURIComponent(t.textDocument.uri);if(Se.hasDocument(e)==!1)return null;let n=kn(t.position,e);return $h.getReferences(n)}function bC(t){var r;let e=decodeURIComponent(t.textDocument.uri),n=kn(t.position,e);if(n==null)return null;if(((r=n.context)==null?void 0:r.feature)instanceof oe){let i=n.context.feature,s=n.antlersDocument.getAllAntlersNodes();if(i.scopeVariable==null||i.scopeVariable.sourceField==null)return null;let o=[],a=[];return s.forEach(l=>{l.runtimeNodes.forEach(u=>{var c;(u.scopeVariable!=null&&u.scopeVariable==i.scopeVariable||u.scopeVariable!=null&&u.scopeVariable.sourceName==((c=i.scopeVariable)==null?void 0:c.sourceName)&&u instanceof oe&&u.name==i.name)&&o.push(u)})}),o.length>0&&o.push(i),o.forEach(l=>{a.push({range:ao(l)})}),a}return[]}var TC=class{constructor(){this._nodes=[];this._extractedAntlers=new Map;this._buffer="";this._shouldFormat=!0}load(e){let n=new mt;return n.getDocumentParser().withChildDocuments(!0),n.loadString(e),this._nodes=n.getAllNodes(),this._buffer=n.getParsedContent(),(!n.isValid()||!n.isFormattingEnabled())&&(this._shouldFormat=!1),this._nodes.forEach(r=>{if(r instanceof B){let i=r.getNodeDocumentText(),s="ANTLERS:"+r.refId;this._buffer=this._buffer.replace(i,s),this._extractedAntlers.set(s,i)}}),this}getShouldFormat(){return this._shouldFormat}getBuffer(){return this._buffer}getMapping(){return this._extractedAntlers}transform(e){return this._buffer=e(this._buffer),this}getTemplate(){let e=this._buffer;return this._extractedAntlers.forEach((n,r)=>{e=e.replace(r,n)}),e}},NC=TC;var ja=Q(nn());var vC=Q(require("fs")),PC=Q(require("path"));var Xh=class{constructor(){this.activeRequest=null}getName(e){return"Extract to Partial"}canHandle(e){return e.selectedText.trim().length>0}refactor(e){this.activeRequest=e,Xh.currentAction=this;let n=this.getName(e);return[ja.CodeAction.create(n+"...",ja.Command.create(n,"antlers.extractToPartial",e.documentUri),ja.CodeActionKind.RefactorExtract)]}completeRefactor(e){var r;let n=(r=ce.instance)==null?void 0:r.getStructure();if(n!=null&&this.activeRequest!=null){let i=Wi(n.getViewPath()),s=Wi(e.fsPath);if(s.startsWith(i)){vC.writeFileSync(e.fsPath,this.activeRequest.selectedText);let o=s.substring(i.length),a=PC.basename(s);a.startsWith("_")&&(a=a.substr(1)),o=o.substr(0,o.length-a.length),a.endsWith(".antlers.html")?a=a.substring(0,a.length-13):a.endsWith(".antlers.xml")||a.endsWith("antlers.php")?a=a.substring(0,a.length-12):a.endsWith(".blade.php")?a=a.substring(0,a.length-10):a.endsWith(".html")&&(a=a.substring(0,a.length-5)),o.length>1&&o.endsWith("/")==!1&&(o=o+"/");let l="{{ partial:"+o+a+" }}",u={range:this.activeRequest.actionParams.range,newText:l},c={changes:{[this.activeRequest.actionParams.textDocument.uri]:[u]}};Qh(c)}}}},zh=Xh;zh.currentAction=null;var uu=zh;var IC=Q(nn());var Uf=class{static isFlatCondition(e){var i;if(e.chain.length>1&&((i=e.logicBranches[1].head)==null?void 0:i.getTagName())!="else")return!1;let n=e.logicBranches[0].nodes,r=!1;for(let s=0;s0&&n.push(s):n.push(s),r.push(s.startPosition.index);else break}return n.pop(),n}static unwrapFlattenedConditions(e){let n={body:[],conditions:[]};return e.logicBranches.forEach(r=>{if(r.head==null)return;n.conditions.push(r.head);let i=this.getCleanChildren(r);if(i.length==1&&i[0]instanceof vt){let s=this.unwrapFlattenedConditions(i[0]);n.conditions=n.conditions.concat(s.conditions),n.body=n.body.concat(s.body)}else i.length==1?n.body.push(i[0]):i.forEach(s=>{if(s instanceof vt){let o=this.unwrapFlattenedConditions(s);n.conditions=n.conditions.concat(o.conditions),n.body=n.body.concat(o.body)}else{if(s instanceof B&&$t.isConditionalStructure(s))return;n.body.push(s)}})}),n}},Gf=Uf;var Wf=class{constructor(e){this.refactoredStyle=0;this.params=e}isSimpleElse(e){var n;return e.logicBranches.length==2&&((n=e.logicBranches[1].head)==null?void 0:n.getTagName())=="else"}getRefactorMode(){return this.refactoredStyle}refactor(e){let n="";return this.params.refactorNested?(n=this.createdNestedGatekeeper(e),this.refactoredStyle=1):e.logicBranches.length==1?(n=this.createGatekeeper(e),this.refactoredStyle=1):this.isSimpleElse(e)&&(n=this.createTernary(e),this.refactoredStyle=0),this.params.isInInterpolation?"{"+n+"}":"{{ "+n+" }}"}createdNestedGatekeeper(e){let n=Gf.unwrapFlattenedConditions(e),r=[],i=[];n.conditions.forEach(a=>{let l=a.getContent().trim();a.runtimeNodes.length>1&&(l.startsWith("(")==!1&&(l="("+l),l.endsWith(")")==!1&&(l=l+")"),this.shouldAddEndingParenthesis(a)&&(l+=")")),r.push(l)}),n.body.forEach(a=>{a instanceof B?i.push(a.getNodeDocumentText()):a instanceof Qe&&i.push(a.content)}),i.length>0&&(i[0]=i[0].trimLeft(),i[i.length-1]=i[i.length-1].trimRight());let s=r.join(" && "),o=i.join("");return"("+s+") ?= "+this.convertToString(o)}convertToString(e){let n=e;return n=Pt(n,"{{","{"),n=Pt(n,"}}","}"),"'"+Pt(n,"'","\\'")+"'"}createTernary(e){var l;let n=e.logicBranches[0].head,r=e.logicBranches[1].head,i=this.convertToString((l=n.getInnerDocumentText())!=null?l:""),s=this.convertToString(r.getInnerDocumentText()),a=n.getContent().trim();return a.startsWith("(")==!1&&(a="("+a),a.endsWith(")")==!1&&(a=a+")"),this.shouldAddEndingParenthesis(n)&&(a+=")"),a+" ? "+i+" : "+s}shouldAddEndingParenthesis(e){return e.originalNode==null?!1:e.originalNode.getTagName()=="unless"}createGatekeeper(e){var o;let n=e.logicBranches[0].head,r=(o=n.getInnerDocumentText())!=null?o:"",i=this.convertToString(r),s="";return n.runtimeNodes.length>1?s="("+n.getContent().trim()+")":s=n.getContent(),s.trim()+" ?= "+i}};var SC=class{constructor(){this.condition=null;this.isNestedConditions=!1;this.refactorStyle=0}getName(e){return this.refactorStyle==1?"Convert Condition to Gatekeeper operator":"Convert Condition to Ternary"}canHandle(e){if(e.selectedDocument.hasUnclosedStructures()||e.selectedDocument.hasUnclosedStructures()||e.selectedDocument.errors.hasAny())return!1;let n=e.selectedDocument.getAllAntlersNodes(),r=new ga,i=0,s=0;for(let a=0;a1)return!1}let o=r.associate(n,e.ownerDocument.getDocumentParser());if(o.length==1&&o[0]instanceof vt){if(this.condition=o[0],this.isNestedConditions=!1,s>2){if(!Gf.isFlatCondition(this.condition))return this.isNestedConditions=!1,!1;this.isNestedConditions=!0}return!0}return!1}refactor(e){if(this.condition==null)return[];let n=[],r=!1;e.params.currentNode!=null&&e.params.currentNode.getTagName()!="if"&&(r=!0);let i=new Wf({isInInterpolation:r,refactorNested:this.isNestedConditions}),s=i.refactor(this.condition);this.refactorStyle=i.getRefactorMode();let o={range:e.actionParams.range,newText:s};return n.push({title:this.getName(e),kind:IC.CodeActionKind.RefactorRewrite,edit:{changes:{[e.documentUri]:[o]}}}),n}},CC=SC;var RC=class{static getRefactors(e){let n=[],r=[];return r.push(new uu),r.push(new CC),r.forEach(i=>{i.canHandle(e)&&i.refactor(e).forEach(s=>{n.push(s)})}),n}},AC=RC;function xC(t){var l;if(((l=ce.instance)==null?void 0:l.hasStructure())==!1)return[];Se.refreshDocumentState();let e=decodeURIComponent(t.textDocument.uri);if(Se.hasDocument(e)==!1)return[];if(!Jr.has(e))return[];let n=t.range.start,r=kn(n,e,qi.showGeneralSnippetCompletions);if(r==null)return[];let i=Jr.get(e),s=i.getText(t.range),o=mt.fromText(s.trim()),a={params:r,selectedText:s,selectedDocument:o,ownerDocument:Se.getDocument(e),documentUri:t.textDocument.uri,actionParams:t};return AC.getRefactors(a)}var UF=Wh(),Jh={formatFrontMatter:!1,showGeneralSnippetCompletions:!0,trace:{server:"off"},formatterIgnoreExtensions:["xml"],languageVersion:"runtime"},qi=Jh;function Hf(t){qi=t}function Ff(){return qi}var We=(0,en.createConnection)(en.ProposedFeatures.all),Ua=new en.TextDocuments(wC.TextDocument),OC=!1,LC=!1,GF=!1,Zh;(e=>e.type=new en.RequestType("antlers/lockedits"))(Zh||(Zh={}));var eg;(e=>e.type=new en.RequestType("antlers/forcedFormat"))(eg||(eg={}));var tg;(e=>e.type=new en.RequestType("antlers/projectUpdate"))(tg||(tg={}));var ng;(e=>e.type=new en.RequestType("antlers/transform"))(ng||(ng={}));var rg;(e=>e.type=new en.RequestType0("antlers/semanticTokenLegend"))(rg||(rg={}));var ig;(e=>e.type=new en.RequestType("antlers/semanticTokens"))(ig||(ig={}));We.onInitialize(t=>{let e=t.capabilities;OC=!!(e.workspace&&!!e.workspace.configuration),LC=!!(e.workspace&&!!e.workspace.workspaceFolders),GF=!!(e.textDocument&&e.textDocument.publishDiagnostics&&e.textDocument.publishDiagnostics.relatedInformation);let n={capabilities:{textDocumentSync:en.TextDocumentSyncKind.Full,completionProvider:{resolveProvider:!0,triggerCharacters:[":",'"',"'","{","/","|","@"," "]},documentFormattingProvider:{},foldingRangeProvider:{},signatureHelpProvider:{triggerCharacters:[":",","]},documentLinkProvider:{},hoverProvider:{},definitionProvider:{},documentSymbolProvider:{},referencesProvider:{},documentHighlightProvider:{},codeActionProvider:{},executeCommandProvider:{commands:["antlers.extractToPartial"]}}};return LC&&(n.capabilities.workspace={workspaceFolders:{supported:!0}}),n});We.onInitialized(()=>{OC&&We.client.register(en.DidChangeConfigurationNotification.type,void 0);let t=We.workspace.getConfiguration("html").then(function(n){ph(n)}),e=We.workspace.getConfiguration("antlersLanguageServer").then(function(n){n!=null?Hf(n):Hf(Jh)})});We.onExecuteCommand(async t=>{var e;t.command=="antlers.extractToPartial"&&uu.currentAction!=null&&((e=t.arguments)==null?void 0:e.length)==3&&uu.currentAction.completeRefactor({path:t.arguments[1],fsPath:t.arguments[2]})});We.onDidChangeConfiguration(t=>{let e=We.workspace.getConfiguration("html").then(function(r){ph(r)}),n=We.workspace.getConfiguration("antlersLanguageServer").then(function(r){r!=null?Hf(r):Hf(Jh)});Ua.all().forEach(DC),Ua.all().forEach(ch),Ua.all().forEach(r=>{og(encodeURIComponent(r.uri))}),Ua.all().forEach(r=>{fh(r,We)})});We.onDocumentLinks(t=>{let e=decodeURIComponent(t.textDocument.uri);return qh.getDocumentLinks(e)});var sg=!1;We.onRequest(Zh.type,()=>{sg=!0});Ua.onDidChangeContent(t=>{if(sg){sg=!1;return}DC(t.document),ch(t.document),og(decodeURIComponent(t.document.uri)),fh(t.document,We)});We.onDidChangeWatchedFiles(t=>{});We.onHover(t=>FS(t));We.onDocumentSymbol(t=>GS(t));We.onDocumentHighlight(bC);We.onReferences(yC);We.onDefinition(VS);We.onFoldingRanges(lP);We.onSignatureHelp(MS);We.onDocumentFormatting(DS);We.onCompletion(sP);We.onCompletionResolve(oP);Ua.listen(We);We.onRequest(rg.type,t=>Vh().legend);We.onRequest(eg.type,t=>{let e=Ff(),n=Kl.format;return new su({tabSize:t.tabSize,formatFrontMatter:e.formatFrontMatter,insertSpaces:t.insertSpaces,formatExtensions:[],maxStatementsPerLine:3,htmlOptions:n}).formatDocument(mt.fromText(t.content))});We.onRequest(ng.type,t=>{let e=new NC;e.load(t.content);let n=[];return e.getMapping().forEach((i,s)=>{n.push({find:s,replace:i})}),{shouldParse:e.getShouldFormat(),transformedText:e.getBuffer(),replacements:n}});We.onCodeAction(xC);We.onRequest(tg.type,()=>{var t,e,n,r,i;if((t=ce.instance)==null||t.setDirtyState(!0),(e=ce.instance)==null||e.reloadDetails(),(n=ce.instance)==null?void 0:n.hasStructure()){let s=(r=ce.instance)==null?void 0:r.getStructure();Se.setProject(s),(i=Qs.instance)==null||i.updateProject(s)}});We.onRequest(ig.type,(t,e)=>{let n=decodeURIComponent(t.textDocument.uri);if(Jr.has(n)){let r=Jr.get(n);return Vh().getSemanticTokens(r,t.ranges)}return null});async function DC(t){var i,s,o,a,l,u,c,f,m;if((i=ce.instance)==null?void 0:i.hasStructure()){ce.instance.reloadDetails(),Se.setProject(ce.instance.getStructure());return}let e=decodeURIComponent(t.uri),n=UF(e),r=Kh(n);if((s=ce.instance)==null||s.setActiveProject(r),((o=ce.instance)==null?void 0:o.hasStructure())&&(Se.setProject((a=ce.instance)==null?void 0:a.getStructure()),(u=Qs.instance)==null||u.updateProject((l=ce.instance)==null?void 0:l.getStructure())),(c=xr.instance)==null||c.clearPartialReferences(e),(f=Zr.instance)==null||f.clearIssues(e),(m=ce.instance)==null?void 0:m.hasStructure()){let d=ce.instance.getStructure().getViews();for(let p=0;p0&&($=$.concat(Le))}let X=(c=(u=Zr.instance)==null?void 0:u.checkDocument(h))!=null?c:[];X.length>0&&($=$.concat(X)),O.length>0&&js.registerNodes(t,O),(f=Qs.instance)==null||f.registerInjections(t,S),(m=mc.instance)==null||m.registerDocumentSections(t,g),(d=xr.instance)==null||d.registerPartialReferences(t,S),(p=xr.instance)==null||p.registerCacheReferences(t,V),(_=Zr.instance)==null||_.registerDiagnostics(t,$),(C=Ys.instance)==null||C.registerDocumentSessionVariables(t,N)}}We.listen();module.exports=jC(WF);0&&(module.exports={getAntlersSettings,globalSettings,requestEdits}); +**From**: `+e.introducedBy.runtimeName()),{contents:{kind:go.MarkupKind.Markdown,value:n}}}static getHover(e){var r,i,s,o,a,l,u,c,f;if(e==null||e.nodesInScope.length==0)return null;let n=e.nodesInScope[e.nodesInScope.length-1];if(e.context!=null&&e.context.node!=null&&(n=e.context.node),n!=null){if((r=Ie.instance)==null?void 0:r.isKnownTag(n.runtimeName())){let _=(i=Ie.instance)==null?void 0:i.findTag(n.runtimeName());if(e.context!=null&&e.context.isCursorInIdentifier&&typeof(_==null?void 0:_.resolveDocumentation)!="undefined"){let C=_.resolveDocumentation(e);if(C.trim().length>0)return{contents:{kind:go.MarkupKind.Markdown,value:C},range:{start:ln(n.startPosition),end:ln(n.endPosition)}}}if(_!=null&&((o=(s=e.context)==null?void 0:s.parameterContext)==null?void 0:o.parameter)!=null){let C=e.context.parameterContext.parameter,h=Ie.instance.getParameter(_.tagName,C.name);if(h!=null){if(typeof h.providesDocumentation!="undefined"){let b=h.providesDocumentation(e);if(b.trim().length>0)return{contents:{kind:go.MarkupKind.Markdown,value:b},range:{start:ln(n.startPosition),end:ln(n.endPosition)}}}return this.formatParameterHover(h)}else if(C.isModifierParameter&&C.modifier!=null)return this.formatModifierHover(C.modifier)}}if(((a=e.context)==null?void 0:a.parameterContext)!=null&&((u=(l=e.context)==null?void 0:l.parameterContext.parameter)==null?void 0:u.modifier)!=null)return this.formatModifierHover(e.context.parameterContext.parameter.modifier);if(((c=e.context)==null?void 0:c.modifierContext)!=null){let _=(f=we.instance)==null?void 0:f.getModifier(e.context.modifierContext.name);if(_!=null)return this.formatModifierHover(_)}let m=e.position.line+1,p=e.position.character+1,d=e.antlersDocument.cursor.position(m,p);return n.scopeVariable!=null&&d!=null&&d.isWithin(n.startPosition,n.endPosition)?this.formatScopeVariableHover(n.scopeVariable):null}return null}};function qS(t){var r;if(((r=ce.instance)==null?void 0:r.hasStructure())==!1)return null;let e=decodeURIComponent(t.textDocument.uri);if(Se.hasDocument(e)==!1)return null;let n=kn(t.position,e);return Mh.getHover(n)}var Fh=class{static findLocations(e,n){if(e==null||e.nodesInScope.length==0)return null;let r=e.nodesInScope[e.nodesInScope.length-1];if(e.context!=null&&e.context.node!=null&&(r=e.context.node),r!=null&&r.scopeVariable!=null&&r.scopeVariable.introducedBy!=null){let i=[];return i.push({uri:n.textDocument.uri,range:{start:ln(r.scopeVariable.introducedBy.startPosition),end:ln(r.scopeVariable.introducedBy.endPosition)}}),i}return null}};function BS(t){var r;if(((r=ce.instance)==null?void 0:r.hasStructure())==!1)return null;let e=decodeURIComponent(t.textDocument.uri);if(Se.hasDocument(e)==!1)return null;let n=kn(t.position,e);return Fh.findLocations(n,t)}var jS=Q(nn());var qf=new Map,Bf=new Map;function Vh(){let t={types:["comment","string","keyword","number","regexp","operator","namespace","type","struct","class","interface","enum","typeParameter","function","method","macro","variable","parameter","property","label","antlersAttribute"],modifiers:["declaration","documentation","readonly","static","abstract","deprecated","modification","async"]};return t.types.forEach((e,n)=>qf.set(e,n)),t.modifiers.forEach((e,n)=>Bf.set(e,n)),{legend:t,async getSemanticTokens(e,n){let r=decodeURIComponent(e.uri),i=new jS.SemanticTokensBuilder,s=[];if(Se.hasDocument(r)){let o=Se.getDocument(r);o.nodes.getAllRuntimeNodes().forEach(p=>{p instanceof jt&&s.push(p)});let l=new Map;s.forEach(p=>{var d;p.startPosition!=null&&(l.has(p.startPosition.line)||l.set(p.startPosition.line,[]),(d=l.get(p.startPosition.line))==null||d.push(p))});let u=[];Array.from(l.keys()).sort((p,d)=>p-d).forEach(p=>{l.get(p).sort((C,h)=>{var b,g,N,S;return((g=(b=C.startPosition)==null?void 0:b.char)!=null?g:0)-((S=(N=h.startPosition)==null?void 0:N.char)!=null?S:0)}).forEach(C=>{u.push(C)})}),u.forEach(p=>{p instanceof jt&&p.startPosition!=null&&p.endPosition!=null&&i.push(p.startPosition.line-1,p.startPosition.char,p.endPosition.char-p.startPosition.char,GS("function"),US([]))}),o.nodes.getAllParameterNodes().forEach(p=>{p.namePosition!=null&&p.namePosition.start!=null&&p.namePosition.end!=null&&i.push(p.namePosition.start.line-1,p.namePosition.start.char-1,p.namePosition.end.char-p.namePosition.start.char,GS("antlersAttribute"),US([]))})}return i.build().data}}}function US(t){let e=0;for(let n=0;n{if(n.isComment||n.isClosingTag&&!n.isConditionNode||n.isConditionNode&&n.name!=null&&n.isClosingTag&&(n.name.name=="if"||n.name.name=="unless"))return;let r=ao(n),i=[];if(n.children.length>0){let u=n.getStructuralChildren();u.length>0&&(i=WS(u))}let s=jf.SymbolKind.Field;n.isTagNode&&(s=jf.SymbolKind.Class);let o=n.getNameContent().trim(),a=n.getContent().trim(),l=o+" "+a;o==a&&(l=a),l=n.sourceContent,n.name!=null&&n.name.name=="partial"&&(s=jf.SymbolKind.File),e.push({range:r,kind:s,name:l,selectionRange:r,children:i})}),e}function HS(t){let e=decodeURIComponent(t.textDocument.uri);if(Se.hasDocument(e)){let n=Se.getDocument(e),r=n.nodes.getStructuralNodes();return WS(r)}return[]}var qh=class{static getDocumentLinks(e){var r,i,s;let n=[];if((r=ce.instance)==null?void 0:r.hasStructure()){let o=(s=(i=Er.instance)==null?void 0:i.getPartialReferences(e))!=null?s:[];for(let a=0;a0&&(o=o.concat(u))}}else if(typeof i.fields!="undefined"){let a=au(i,e,"fields",e,n);a.length>0&&(o=o.concat(a))}return o}var XS=Q(mi()),QS=Q(require("fs"));function JS(t,e){let n=QS.readFileSync(t,{encoding:"utf8"}),r=XS.parse(n);if(typeof r=="undefined"||r===null)return[];let i=[];if(typeof r.fields!="undefined")for(let s of Object.keys(r.fields)){let o=r.fields[s],a=o.handle,l="",u="",c="",f=null,m=null,p=null;if(typeof o.import!="undefined"&&(p=o.import),typeof o.field!="undefined"&&(typeof o.field.display!="undefined"&&(l=o.field.display),typeof o.field.type!="undefined"&&(c=o.field.type),typeof o.field.instructions!="undefined"&&(u=o.field.instructions),typeof o.field.max_items!="undefined"&&(f=o.field.max_items),typeof o.field.sets!="undefined")){m=[];for(let d of Object.keys(o.field.sets)){let _=o.field.sets[d],C=au(_,e,"fields","set:"+d,new Map),h="";typeof _.display!="undefined"&&(h=_.display),m.push({handle:d,displayName:h,fields:C})}}i.push({handle:a,instructionText:u,name:l,type:c,maxItems:f,sets:m,import:p})}return i}var ZS=Q(require("path")),eC=Q(require("fs")),tC=Q(mi());function nC(t){let e=ZS.basename(t).split(".").slice(0,-1).join("."),n=e;try{let r=eC.readFileSync(t,{encoding:"utf8"}),i=tC.parse(r);typeof i.title!="undefined"&&i.title!==null&&(n=i.title)}catch(r){console.error(r)}return{handle:e,title:n}}var rC=Q(require("path")),iC=Q(require("fs")),sC=Q(mi());function oC(t){let e=rC.basename(t).split(".").slice(0,-1).join("."),n=e,r="";try{let i=iC.readFileSync(t,{encoding:"utf8"}),s=sC.parse(i);typeof s!="undefined"&&s!==null&&(typeof s.title!="undefined"&&s.title!==null&&(n=s.title),typeof s.disk!="undefined"&&s.disk!==null&&(r=s.disk))}catch(i){console.error(i)}return{handle:e,title:n,diskName:r}}var aC=Q(require("path")),lC=Q(require("fs")),uC=Q(mi());function cC(t){let e=aC.basename(t).split(".").slice(0,-1).join("."),n=lC.readFileSync(t,{encoding:"utf8"}),r="",i="",s="",o=!1,a=[],l=null,u=null,c=[];try{let f=uC.parse(n);if(typeof f!="undefined"&&f!==null){if(typeof f.title!="undefined"&&f.title!==null&&(r=f.title),typeof f.inject!="undefined"&&f.inject!==null){let m=Object.keys(f.inject);for(let p=0;p{i.push(l)}),typeof this.sourceStructure.forms.forEach!="undefined"&&this.sourceStructure.forms.forEach((a,l)=>{a.forEach(u=>{this.blueprintCollectionRef.set(u.blueprintName,l)}),e.push(l),this.blueprintRef.set(l,a)}),typeof this.sourceStructure.globals.forEach!="undefined"&&this.sourceStructure.globals.forEach((a,l)=>{a.forEach(u=>{this.blueprintCollectionRef.set(u.blueprintName,l)}),n.push(l),this.blueprintRef.set(l,a)}),typeof this.sourceStructure.miscFields.forEach!="undefined"&&this.sourceStructure.miscFields.forEach((a,l)=>{a.forEach(u=>{this.blueprintCollectionRef.set(u.blueprintName,l)}),this.blueprintRef.set(l,a)}),typeof this.sourceStructure.taxonomies.forEach!="undefined"&&this.sourceStructure.taxonomies.forEach((a,l)=>{a.forEach(u=>{this.blueprintCollectionRef.set(u.blueprintName,l)}),this.blueprintRef.set(l,a)}),typeof this.sourceStructure.fields.forEach!="undefined"&&this.sourceStructure.fields.forEach((a,l)=>{a.forEach(u=>{this.blueprintCollectionRef.set(u.blueprintName,l)}),this.blueprintRef.set(l,a)}),typeof this.sourceStructure.navigationMenus.forEach!="undefined"&&this.sourceStructure.navigationMenus.forEach((a,l)=>{r.push(l)}),typeof this.sourceStructure.views.forEach!="undefined"&&this.sourceStructure.views.forEach((a,l)=>{this.viewMap.set(a.documentUri,a)}),typeof this.sourceStructure.composerPackages.forEach!="undefined"&&this.sourceStructure.composerPackages.forEach(a=>{a.isStatamicAddon&&this.statamicAddonMapping.set(a.name,a),this.packageMapping.set(a.name,a)}),this.uniqueAssetNames=[...new Set(i)],this.uniqueNavigationNames=[...new Set(r)],this.uniqueGlobalSettingNames=[...new Set(n)],this.uniqueFormNames=[...new Set(e)],this.uniqueCollectionNames=[...new Set(this.collectionNames)],this.uniquePartialViewNames=[...new Set(this.partialViewNames)],this.uniqueTaxonomyNames=[...new Set(this.taxonomyNames)],(s=we.instance)==null||s.resetMacros(),this.hasMacroFile){let a=hC(this.macroFilePath);a.length>0&&((o=we.instance)==null||o.registerMacros(a))}this.uniqueUserRoles=[...new Set(this.sourceStructure.userRoleNames)],this.uniqueUserGroups=[...new Set(this.sourceStructure.userGroupNames)],this.sourceStructure.searchIndexes.length==0&&this.sourceStructure.searchIndexes.push("default");for(let a=0;a{r.startsWith("*")==!1&&e.includes(r)==!1&&e.push(r)}),e}getBlueprintDetails(e){if(this.blueprintRef.has(e)==!1){let n=[];return n.push(Hh(e,"title","text")),n.push(Hh(e,"content","markdown")),n.push(Hh(e,"slug","slug")),n}return this.blueprintRef.get(e)}hasViewCollectionInjections(e){return this.viewMap.has(e)==!1?!1:this.viewMap.get(e).injectsCollections.length>0}getCollectionNames(){return this.collectionNames}getCollectionNamesForView(e){return this.viewMap.has(e)==!1?[]:this.viewMap.get(e).injectsCollections}getPublicAssetPaths(){return this.publicAssets}getTaxonomyTerms(e){return this.hasTaxonomy(e)?this.taxonomyTerms.get(e):[]}hasTaxonomy(e){return this.taxonomyNames.includes(e)}getCollectionQueryScopes(){return this.collectionQueryScopes}getBlueprintFields(e){let n=[];for(let r=0;r{let r=Pt(n.relativeDisplayName,"/",".");e.includes(r)==!1&&e.push(r)}),e}getViews(){return this.views}findView(e){if(e.trim()=="")return null;let n=_C(e);for(let r=0;r=0&&r.push(o)}return[...new Set(r)]}function Hi(t,e){if(!Vn.existsSync(t))return[];let n=[],r=Vn.readdirSync(t);for(let i=0;i0&&(O=Vn.existsSync(g));for(let P=0;P0){let y=JS(qn[P],I);ee.set(I,y)}}let Ti=uu(a,".yaml",[]);for(let P=0;P0){Y.set(I,y);let x=_o(Ti[P],I,ee);de.set(I,x),St=St.concat(x),Ve.includes(I)==!1&&Ve.push(I)}}if(Ve.length>0){for(let P=0;P0){let y=_o(Ki[P],I,ee);Z.set(I,y),St=St.concat(y)}}for(let P=0;P0&&(I=x,Ft.includes(x)==!1&&Ft.push(x)),lt.set(I,y)}let Pr=Hi(f,".yaml");for(let P=0;P{P.template.trim().length>0&&nr.has(P.template)&&nr.get(P.template).injectsCollections.push(P.handle)}),new bC({composerPackages:X,statamicPackage:$,isMocked:!1,workingDirectory:N,taxonomyPluralizedMapping:Y,collectionScopes:Yi,blueprintFiles:h,collectionBlueprintsPath:n,collections:vr,rootPath:e,fields:lt,fieldsetsPath:o,fieldsets:ee,collectionNames:Ft,formBlueprintsPath:i,taxonomiesBlueprintsPath:a,globalBlueprintsPath:l,miscBlueprintsPath:u,viewsPath:r,views:b,globalFiles:[],forms:ne,globals:De,miscFields:Z,taxonomies:de,taxonomyNames:Ve,templates:Ge,partialCache:ut,partialViewNames:bi,macroFilePath:g,hasMacrosFile:O,contentDirectory:c,taxonomyContentDirectory:m,taxonomyTerms:le,assets:yo,assetFields:bo,oauthProviders:[],navigationMenus:Nt,userPermissionsPath:p,userGroupNames:me,userGroups:ue,userRoleNames:Ne,userRoles:se,searchIndexes:[],internalFieldReference:St,restoreProperties:null},t)}var bC=class extends Yh{reloadDetails(){return Kh(this.baseResourcePath)}};var $h=class{static getReferences(e){var n;if(e==null)return null;if(((n=e.context)==null?void 0:n.feature)instanceof oe){let r=e.context.feature;if(r.scopeVariable==null||r.scopeVariable.sourceField==null)return null;let i=new Map;Se.getDocuments().forEach(o=>{let a=o.getAllAntlersNodes(),l=[];a.forEach(u=>{u.runtimeNodes.forEach(c=>{var f;(c.scopeVariable!=null&&c.scopeVariable==r.scopeVariable||c.scopeVariable!=null&&c.scopeVariable.sourceName==((f=r.scopeVariable)==null?void 0:f.sourceName)&&c instanceof oe&&c.name==r.name)&&l.push(c)})}),i.set(o.documentUri,l)});let s=[];return i.forEach((o,a)=>{o.forEach(l=>{s.push({uri:a,range:ao(l)})})}),s}return[]}};function TC(t){var r;if(((r=ce.instance)==null?void 0:r.hasStructure())==!1)return null;let e=decodeURIComponent(t.textDocument.uri);if(Se.hasDocument(e)==!1)return null;let n=kn(t.position,e);return $h.getReferences(n)}function NC(t){var r;let e=decodeURIComponent(t.textDocument.uri),n=kn(t.position,e);if(n==null)return null;if(((r=n.context)==null?void 0:r.feature)instanceof oe){let i=n.context.feature,s=n.antlersDocument.getAllAntlersNodes();if(i.scopeVariable==null||i.scopeVariable.sourceField==null)return null;let o=[],a=[];return s.forEach(l=>{l.runtimeNodes.forEach(u=>{var c;(u.scopeVariable!=null&&u.scopeVariable==i.scopeVariable||u.scopeVariable!=null&&u.scopeVariable.sourceName==((c=i.scopeVariable)==null?void 0:c.sourceName)&&u instanceof oe&&u.name==i.name)&&o.push(u)})}),o.length>0&&o.push(i),o.forEach(l=>{a.push({range:ao(l)})}),a}return[]}var vC=class{constructor(){this._nodes=[];this._extractedAntlers=new Map;this._buffer="";this._shouldFormat=!0}load(e){let n=new mt;return n.getDocumentParser().withChildDocuments(!0),n.loadString(e),this._nodes=n.getAllNodes(),this._buffer=n.getParsedContent(),(!n.isValid()||!n.isFormattingEnabled())&&(this._shouldFormat=!1),this._nodes.forEach(r=>{if(r instanceof B){let i=r.getNodeDocumentText(),s="ANTLERS:"+r.refId;this._buffer=this._buffer.replace(i,s),this._extractedAntlers.set(s,i)}}),this}getShouldFormat(){return this._shouldFormat}getBuffer(){return this._buffer}getMapping(){return this._extractedAntlers}transform(e){return this._buffer=e(this._buffer),this}getTemplate(){let e=this._buffer;return this._extractedAntlers.forEach((n,r)=>{e=e.replace(r,n)}),e}},PC=vC;var ja=Q(nn());var IC=Q(require("fs")),SC=Q(require("path"));var Xh=class{constructor(){this.activeRequest=null}getName(e){return"Extract to Partial"}canHandle(e){return e.selectedText.trim().length>0}refactor(e){this.activeRequest=e,Xh.currentAction=this;let n=this.getName(e);return[ja.CodeAction.create(n+"...",ja.Command.create(n,"antlers.extractToPartial",e.documentUri),ja.CodeActionKind.RefactorExtract)]}completeRefactor(e){var r;let n=(r=ce.instance)==null?void 0:r.getStructure();if(n!=null&&this.activeRequest!=null){let i=Wi(n.getViewPath()),s=Wi(e.fsPath);if(s.startsWith(i)){IC.writeFileSync(e.fsPath,this.activeRequest.selectedText);let o=s.substring(i.length),a=SC.basename(s);a.startsWith("_")&&(a=a.substr(1)),o=o.substr(0,o.length-a.length),a.endsWith(".antlers.html")?a=a.substring(0,a.length-13):a.endsWith(".antlers.xml")||a.endsWith("antlers.php")?a=a.substring(0,a.length-12):a.endsWith(".blade.php")?a=a.substring(0,a.length-10):a.endsWith(".html")&&(a=a.substring(0,a.length-5)),o.length>1&&o.endsWith("/")==!1&&(o=o+"/");let l="{{ partial:"+o+a+" }}",u={range:this.activeRequest.actionParams.range,newText:l},c={changes:{[this.activeRequest.actionParams.textDocument.uri]:[u]}};Qh(c)}}}},zh=Xh;zh.currentAction=null;var cu=zh;var CC=Q(nn());var Gf=class{static isFlatCondition(e){var i;if(e.chain.length>1&&((i=e.logicBranches[1].head)==null?void 0:i.getTagName())!="else")return!1;let n=e.logicBranches[0].nodes,r=!1;for(let s=0;s0&&n.push(s):n.push(s),r.push(s.startPosition.index);else break}return n.pop(),n}static unwrapFlattenedConditions(e){let n={body:[],conditions:[]};return e.logicBranches.forEach(r=>{if(r.head==null)return;n.conditions.push(r.head);let i=this.getCleanChildren(r);if(i.length==1&&i[0]instanceof vt){let s=this.unwrapFlattenedConditions(i[0]);n.conditions=n.conditions.concat(s.conditions),n.body=n.body.concat(s.body)}else i.length==1?n.body.push(i[0]):i.forEach(s=>{if(s instanceof vt){let o=this.unwrapFlattenedConditions(s);n.conditions=n.conditions.concat(o.conditions),n.body=n.body.concat(o.body)}else{if(s instanceof B&&$t.isConditionalStructure(s))return;n.body.push(s)}})}),n}},Wf=Gf;var Hf=class{constructor(e){this.refactoredStyle=0;this.params=e}isSimpleElse(e){var n;return e.logicBranches.length==2&&((n=e.logicBranches[1].head)==null?void 0:n.getTagName())=="else"}getRefactorMode(){return this.refactoredStyle}refactor(e){let n="";return this.params.refactorNested?(n=this.createdNestedGatekeeper(e),this.refactoredStyle=1):e.logicBranches.length==1?(n=this.createGatekeeper(e),this.refactoredStyle=1):this.isSimpleElse(e)&&(n=this.createTernary(e),this.refactoredStyle=0),this.params.isInInterpolation?"{"+n+"}":"{{ "+n+" }}"}createdNestedGatekeeper(e){let n=Wf.unwrapFlattenedConditions(e),r=[],i=[];n.conditions.forEach(a=>{let l=a.getContent().trim();a.runtimeNodes.length>1&&(l.startsWith("(")==!1&&(l="("+l),l.endsWith(")")==!1&&(l=l+")"),this.shouldAddEndingParenthesis(a)&&(l+=")")),r.push(l)}),n.body.forEach(a=>{a instanceof B?i.push(a.getNodeDocumentText()):a instanceof Qe&&i.push(a.content)}),i.length>0&&(i[0]=i[0].trimLeft(),i[i.length-1]=i[i.length-1].trimRight());let s=r.join(" && "),o=i.join("");return"("+s+") ?= "+this.convertToString(o)}convertToString(e){let n=e;return n=Pt(n,"{{","{"),n=Pt(n,"}}","}"),"'"+Pt(n,"'","\\'")+"'"}createTernary(e){var l;let n=e.logicBranches[0].head,r=e.logicBranches[1].head,i=this.convertToString((l=n.getInnerDocumentText())!=null?l:""),s=this.convertToString(r.getInnerDocumentText()),a=n.getContent().trim();return a.startsWith("(")==!1&&(a="("+a),a.endsWith(")")==!1&&(a=a+")"),this.shouldAddEndingParenthesis(n)&&(a+=")"),a+" ? "+i+" : "+s}shouldAddEndingParenthesis(e){return e.originalNode==null?!1:e.originalNode.getTagName()=="unless"}createGatekeeper(e){var o;let n=e.logicBranches[0].head,r=(o=n.getInnerDocumentText())!=null?o:"",i=this.convertToString(r),s="";return n.runtimeNodes.length>1?s="("+n.getContent().trim()+")":s=n.getContent(),s.trim()+" ?= "+i}};var RC=class{constructor(){this.condition=null;this.isNestedConditions=!1;this.refactorStyle=0}getName(e){return this.refactorStyle==1?"Convert Condition to Gatekeeper operator":"Convert Condition to Ternary"}canHandle(e){if(e.selectedDocument.hasUnclosedStructures()||e.selectedDocument.hasUnclosedStructures()||e.selectedDocument.errors.hasAny())return!1;let n=e.selectedDocument.getAllAntlersNodes(),r=new ga,i=0,s=0;for(let a=0;a1)return!1}let o=r.associate(n,e.ownerDocument.getDocumentParser());if(o.length==1&&o[0]instanceof vt){if(this.condition=o[0],this.isNestedConditions=!1,s>2){if(!Wf.isFlatCondition(this.condition))return this.isNestedConditions=!1,!1;this.isNestedConditions=!0}return!0}return!1}refactor(e){if(this.condition==null)return[];let n=[],r=!1;e.params.currentNode!=null&&e.params.currentNode.getTagName()!="if"&&(r=!0);let i=new Hf({isInInterpolation:r,refactorNested:this.isNestedConditions}),s=i.refactor(this.condition);this.refactorStyle=i.getRefactorMode();let o={range:e.actionParams.range,newText:s};return n.push({title:this.getName(e),kind:CC.CodeActionKind.RefactorRewrite,edit:{changes:{[e.documentUri]:[o]}}}),n}},AC=RC;var xC=class{static getRefactors(e){let n=[],r=[];return r.push(new cu),r.push(new AC),r.forEach(i=>{i.canHandle(e)&&i.refactor(e).forEach(s=>{n.push(s)})}),n}},EC=xC;function wC(t){var l;if(((l=ce.instance)==null?void 0:l.hasStructure())==!1)return[];Se.refreshDocumentState();let e=decodeURIComponent(t.textDocument.uri);if(Se.hasDocument(e)==!1)return[];if(!Jr.has(e))return[];let n=t.range.start,r=kn(n,e,qi.showGeneralSnippetCompletions);if(r==null)return[];let i=Jr.get(e),s=i.getText(t.range),o=mt.fromText(s.trim()),a={params:r,selectedText:s,selectedDocument:o,ownerDocument:Se.getDocument(e),documentUri:t.textDocument.uri,actionParams:t};return EC.getRefactors(a)}var YF=Wh(),Jh={formatFrontMatter:!1,showGeneralSnippetCompletions:!0,trace:{server:"off"},formatterIgnoreExtensions:["xml"],languageVersion:"runtime"},qi=Jh;function Yf(t){qi=t}function Vf(){return qi}var We=(0,en.createConnection)(en.ProposedFeatures.all),Ua=new en.TextDocuments(LC.TextDocument),DC=!1,kC=!1,KF=!1,Zh;(e=>e.type=new en.RequestType("antlers/lockedits"))(Zh||(Zh={}));var eg;(e=>e.type=new en.RequestType("antlers/forcedFormat"))(eg||(eg={}));var tg;(e=>e.type=new en.RequestType("antlers/projectUpdate"))(tg||(tg={}));var ng;(e=>e.type=new en.RequestType("antlers/transform"))(ng||(ng={}));var rg;(e=>e.type=new en.RequestType0("antlers/semanticTokenLegend"))(rg||(rg={}));var ig;(e=>e.type=new en.RequestType("antlers/semanticTokens"))(ig||(ig={}));We.onInitialize(t=>{let e=t.capabilities;DC=!!(e.workspace&&!!e.workspace.configuration),kC=!!(e.workspace&&!!e.workspace.workspaceFolders),KF=!!(e.textDocument&&e.textDocument.publishDiagnostics&&e.textDocument.publishDiagnostics.relatedInformation);let n={capabilities:{textDocumentSync:en.TextDocumentSyncKind.Full,completionProvider:{resolveProvider:!0,triggerCharacters:[":",'"',"'","{","/","|","@"," "]},documentFormattingProvider:{},foldingRangeProvider:{},signatureHelpProvider:{triggerCharacters:[":",","]},documentLinkProvider:{},hoverProvider:{},definitionProvider:{},documentSymbolProvider:{},referencesProvider:{},documentHighlightProvider:{},codeActionProvider:{},executeCommandProvider:{commands:["antlers.extractToPartial"]}}};return kC&&(n.capabilities.workspace={workspaceFolders:{supported:!0}}),n});We.onInitialized(()=>{DC&&We.client.register(en.DidChangeConfigurationNotification.type,void 0);let t=We.workspace.getConfiguration("html").then(function(n){ph(n)}),e=We.workspace.getConfiguration("antlersLanguageServer").then(function(n){n!=null?Yf(n):Yf(Jh)})});We.onExecuteCommand(async t=>{var e;t.command=="antlers.extractToPartial"&&cu.currentAction!=null&&((e=t.arguments)==null?void 0:e.length)==3&&cu.currentAction.completeRefactor({path:t.arguments[1],fsPath:t.arguments[2]})});We.onDidChangeConfiguration(t=>{let e=We.workspace.getConfiguration("html").then(function(r){ph(r)}),n=We.workspace.getConfiguration("antlersLanguageServer").then(function(r){r!=null?Yf(r):Yf(Jh)});Ua.all().forEach(MC),Ua.all().forEach(ch),Ua.all().forEach(r=>{og(encodeURIComponent(r.uri))}),Ua.all().forEach(r=>{fh(r,We)})});We.onDocumentLinks(t=>{let e=decodeURIComponent(t.textDocument.uri);return qh.getDocumentLinks(e)});var sg=!1;We.onRequest(Zh.type,()=>{sg=!0});Ua.onDidChangeContent(t=>{if(sg){sg=!1;return}MC(t.document),ch(t.document),og(decodeURIComponent(t.document.uri)),fh(t.document,We)});We.onDidChangeWatchedFiles(t=>{});We.onHover(t=>qS(t));We.onDocumentSymbol(t=>HS(t));We.onDocumentHighlight(NC);We.onReferences(TC);We.onDefinition(BS);We.onFoldingRanges(uP);We.onSignatureHelp(VS);We.onDocumentFormatting(MS);We.onCompletion(oP);We.onCompletionResolve(aP);Ua.listen(We);We.onRequest(rg.type,t=>Vh().legend);We.onRequest(eg.type,t=>{let e=Vf(),n=$l.format;return new ou({tabSize:t.tabSize,formatFrontMatter:e.formatFrontMatter,insertSpaces:t.insertSpaces,formatExtensions:[],maxStatementsPerLine:3,htmlOptions:n}).formatDocument(mt.fromText(t.content))});We.onRequest(ng.type,t=>{let e=new PC;e.load(t.content);let n=[];return e.getMapping().forEach((i,s)=>{n.push({find:s,replace:i})}),{shouldParse:e.getShouldFormat(),transformedText:e.getBuffer(),replacements:n}});We.onCodeAction(wC);We.onRequest(tg.type,()=>{var t,e,n,r,i;if((t=ce.instance)==null||t.setDirtyState(!0),(e=ce.instance)==null||e.reloadDetails(),(n=ce.instance)==null?void 0:n.hasStructure()){let s=(r=ce.instance)==null?void 0:r.getStructure();Se.setProject(s),(i=Qs.instance)==null||i.updateProject(s)}});We.onRequest(ig.type,(t,e)=>{let n=decodeURIComponent(t.textDocument.uri);if(Jr.has(n)){let r=Jr.get(n);return Vh().getSemanticTokens(r,t.ranges)}return null});async function MC(t){var i,s,o,a,l,u,c,f,m;if((i=ce.instance)==null?void 0:i.hasStructure()){ce.instance.reloadDetails(),Se.setProject(ce.instance.getStructure());return}let e=decodeURIComponent(t.uri),n=YF(e),r=Kh(n);if((s=ce.instance)==null||s.setActiveProject(r),((o=ce.instance)==null?void 0:o.hasStructure())&&(Se.setProject((a=ce.instance)==null?void 0:a.getStructure()),(u=Qs.instance)==null||u.updateProject((l=ce.instance)==null?void 0:l.getStructure())),(c=Er.instance)==null||c.clearPartialReferences(e),(f=Zr.instance)==null||f.clearIssues(e),(m=ce.instance)==null?void 0:m.hasStructure()){let p=ce.instance.getStructure().getViews();for(let d=0;d0&&($=$.concat(De))}let X=(c=(u=Zr.instance)==null?void 0:u.checkDocument(h))!=null?c:[];X.length>0&&($=$.concat(X)),O.length>0&&js.registerNodes(t,O),(f=Qs.instance)==null||f.registerInjections(t,S),(m=hc.instance)==null||m.registerDocumentSections(t,g),(p=Er.instance)==null||p.registerPartialReferences(t,S),(d=Er.instance)==null||d.registerCacheReferences(t,V),(_=Zr.instance)==null||_.registerDiagnostics(t,$),(C=Ys.instance)==null||C.registerDocumentSessionVariables(t,N)}}We.listen();module.exports=GC($F);0&&(module.exports={getAntlersSettings,globalSettings,requestEdits}); /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */ diff --git a/changelog.md b/changelog.md index c49cc5e..2d75e7a 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,15 @@ Bugs fixed, what's new, and more! :) +## v2.2.0 + +> Note: This version removes the `Antlers: Use Prettier First` configuration option. This option has been removed in favor of an Antlers Prettier Plugin. Impacted users should consider installing and configuring this plugin: [https://www.npmjs.com/package/prettier-plugin-antlers](https://www.npmjs.com/package/prettier-plugin-antlers) + +- Introduces a new underlying formatting engine +- Removes the `Antlers: Use Prettier First` configuration option +- Adds support for the `nocache` tag +- Emits warnings when request variables (`get` or `post`) do not have the `sanitize` modifier applied to their output + ## v2.1.6 - Improves parsing of parameters that begin with numbers diff --git a/client/package.json b/client/package.json index ea8fb23..da13dc4 100644 --- a/client/package.json +++ b/client/package.json @@ -3,7 +3,7 @@ "description": "Provides Antlers syntax highlighting, formatting, error reporting, project-specific suggestions, and more.", "author": "John Koster", "license": "MIT", - "version": "0.1.26", + "version": "0.1.27", "publisher": "stillat", "engines": { "vscode": "^1.67.0" diff --git a/formatcli/package/cli.js b/formatcli/package/cli.js index 0ed1412..a519fc6 100644 --- a/formatcli/package/cli.js +++ b/formatcli/package/cli.js @@ -1,8 +1,8 @@ #!/usr/bin/env node -var ZP=Object.create;var Vf=Object.defineProperty;var eA=Object.getOwnPropertyDescriptor;var tA=Object.getOwnPropertyNames;var nA=Object.getPrototypeOf,rA=Object.prototype.hasOwnProperty;var iA=t=>Vf(t,"__esModule",{value:!0});var X=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var sA=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of tA(e))!rA.call(t,i)&&(n||i!=="default")&&Vf(t,i,{get:()=>e[i],enumerable:!(r=eA(e,i))||r.enumerable});return t},je=(t,e)=>sA(iA(Vf(t!=null?ZP(nA(t)):{},"default",!e&&t&&t.__esModule?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var uu=X(Yf=>{"use strict";Object.defineProperty(Yf,"__esModule",{value:!0});var hg=function(){function t(){this._state=new Int32Array(4),this._buffer=new ArrayBuffer(68),this._buffer8=new Uint8Array(this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()}return t.hashStr=function(e,n){return n===void 0&&(n=!1),this.onePassHasher.start().appendStr(e).end(n)},t.hashAsciiStr=function(e,n){return n===void 0&&(n=!1),this.onePassHasher.start().appendAsciiStr(e).end(n)},t._hex=function(e){var n=t.hexChars,r=t.hexOut,i,s,a,o;for(o=0;o<4;o+=1)for(s=o*8,i=e[o],a=0;a<8;a+=2)r[s+1+a]=n.charAt(i&15),i>>>=4,r[s+0+a]=n.charAt(i&15),i>>>=4;return r.join("")},t._md5cycle=function(e,n){var r=e[0],i=e[1],s=e[2],a=e[3];r+=(i&s|~i&a)+n[0]-680876936|0,r=(r<<7|r>>>25)+i|0,a+=(r&i|~r&s)+n[1]-389564586|0,a=(a<<12|a>>>20)+r|0,s+=(a&r|~a&i)+n[2]+606105819|0,s=(s<<17|s>>>15)+a|0,i+=(s&a|~s&r)+n[3]-1044525330|0,i=(i<<22|i>>>10)+s|0,r+=(i&s|~i&a)+n[4]-176418897|0,r=(r<<7|r>>>25)+i|0,a+=(r&i|~r&s)+n[5]+1200080426|0,a=(a<<12|a>>>20)+r|0,s+=(a&r|~a&i)+n[6]-1473231341|0,s=(s<<17|s>>>15)+a|0,i+=(s&a|~s&r)+n[7]-45705983|0,i=(i<<22|i>>>10)+s|0,r+=(i&s|~i&a)+n[8]+1770035416|0,r=(r<<7|r>>>25)+i|0,a+=(r&i|~r&s)+n[9]-1958414417|0,a=(a<<12|a>>>20)+r|0,s+=(a&r|~a&i)+n[10]-42063|0,s=(s<<17|s>>>15)+a|0,i+=(s&a|~s&r)+n[11]-1990404162|0,i=(i<<22|i>>>10)+s|0,r+=(i&s|~i&a)+n[12]+1804603682|0,r=(r<<7|r>>>25)+i|0,a+=(r&i|~r&s)+n[13]-40341101|0,a=(a<<12|a>>>20)+r|0,s+=(a&r|~a&i)+n[14]-1502002290|0,s=(s<<17|s>>>15)+a|0,i+=(s&a|~s&r)+n[15]+1236535329|0,i=(i<<22|i>>>10)+s|0,r+=(i&a|s&~a)+n[1]-165796510|0,r=(r<<5|r>>>27)+i|0,a+=(r&s|i&~s)+n[6]-1069501632|0,a=(a<<9|a>>>23)+r|0,s+=(a&i|r&~i)+n[11]+643717713|0,s=(s<<14|s>>>18)+a|0,i+=(s&r|a&~r)+n[0]-373897302|0,i=(i<<20|i>>>12)+s|0,r+=(i&a|s&~a)+n[5]-701558691|0,r=(r<<5|r>>>27)+i|0,a+=(r&s|i&~s)+n[10]+38016083|0,a=(a<<9|a>>>23)+r|0,s+=(a&i|r&~i)+n[15]-660478335|0,s=(s<<14|s>>>18)+a|0,i+=(s&r|a&~r)+n[4]-405537848|0,i=(i<<20|i>>>12)+s|0,r+=(i&a|s&~a)+n[9]+568446438|0,r=(r<<5|r>>>27)+i|0,a+=(r&s|i&~s)+n[14]-1019803690|0,a=(a<<9|a>>>23)+r|0,s+=(a&i|r&~i)+n[3]-187363961|0,s=(s<<14|s>>>18)+a|0,i+=(s&r|a&~r)+n[8]+1163531501|0,i=(i<<20|i>>>12)+s|0,r+=(i&a|s&~a)+n[13]-1444681467|0,r=(r<<5|r>>>27)+i|0,a+=(r&s|i&~s)+n[2]-51403784|0,a=(a<<9|a>>>23)+r|0,s+=(a&i|r&~i)+n[7]+1735328473|0,s=(s<<14|s>>>18)+a|0,i+=(s&r|a&~r)+n[12]-1926607734|0,i=(i<<20|i>>>12)+s|0,r+=(i^s^a)+n[5]-378558|0,r=(r<<4|r>>>28)+i|0,a+=(r^i^s)+n[8]-2022574463|0,a=(a<<11|a>>>21)+r|0,s+=(a^r^i)+n[11]+1839030562|0,s=(s<<16|s>>>16)+a|0,i+=(s^a^r)+n[14]-35309556|0,i=(i<<23|i>>>9)+s|0,r+=(i^s^a)+n[1]-1530992060|0,r=(r<<4|r>>>28)+i|0,a+=(r^i^s)+n[4]+1272893353|0,a=(a<<11|a>>>21)+r|0,s+=(a^r^i)+n[7]-155497632|0,s=(s<<16|s>>>16)+a|0,i+=(s^a^r)+n[10]-1094730640|0,i=(i<<23|i>>>9)+s|0,r+=(i^s^a)+n[13]+681279174|0,r=(r<<4|r>>>28)+i|0,a+=(r^i^s)+n[0]-358537222|0,a=(a<<11|a>>>21)+r|0,s+=(a^r^i)+n[3]-722521979|0,s=(s<<16|s>>>16)+a|0,i+=(s^a^r)+n[6]+76029189|0,i=(i<<23|i>>>9)+s|0,r+=(i^s^a)+n[9]-640364487|0,r=(r<<4|r>>>28)+i|0,a+=(r^i^s)+n[12]-421815835|0,a=(a<<11|a>>>21)+r|0,s+=(a^r^i)+n[15]+530742520|0,s=(s<<16|s>>>16)+a|0,i+=(s^a^r)+n[2]-995338651|0,i=(i<<23|i>>>9)+s|0,r+=(s^(i|~a))+n[0]-198630844|0,r=(r<<6|r>>>26)+i|0,a+=(i^(r|~s))+n[7]+1126891415|0,a=(a<<10|a>>>22)+r|0,s+=(r^(a|~i))+n[14]-1416354905|0,s=(s<<15|s>>>17)+a|0,i+=(a^(s|~r))+n[5]-57434055|0,i=(i<<21|i>>>11)+s|0,r+=(s^(i|~a))+n[12]+1700485571|0,r=(r<<6|r>>>26)+i|0,a+=(i^(r|~s))+n[3]-1894986606|0,a=(a<<10|a>>>22)+r|0,s+=(r^(a|~i))+n[10]-1051523|0,s=(s<<15|s>>>17)+a|0,i+=(a^(s|~r))+n[1]-2054922799|0,i=(i<<21|i>>>11)+s|0,r+=(s^(i|~a))+n[8]+1873313359|0,r=(r<<6|r>>>26)+i|0,a+=(i^(r|~s))+n[15]-30611744|0,a=(a<<10|a>>>22)+r|0,s+=(r^(a|~i))+n[6]-1560198380|0,s=(s<<15|s>>>17)+a|0,i+=(a^(s|~r))+n[13]+1309151649|0,i=(i<<21|i>>>11)+s|0,r+=(s^(i|~a))+n[4]-145523070|0,r=(r<<6|r>>>26)+i|0,a+=(i^(r|~s))+n[11]-1120210379|0,a=(a<<10|a>>>22)+r|0,s+=(r^(a|~i))+n[2]+718787259|0,s=(s<<15|s>>>17)+a|0,i+=(a^(s|~r))+n[9]-343485551|0,i=(i<<21|i>>>11)+s|0,e[0]=r+e[0]|0,e[1]=i+e[1]|0,e[2]=s+e[2]|0,e[3]=a+e[3]|0},t.prototype.start=function(){return this._dataLength=0,this._bufferLength=0,this._state.set(t.stateIdentity),this},t.prototype.appendStr=function(e){var n=this._buffer8,r=this._buffer32,i=this._bufferLength,s,a;for(a=0;a>>6)+192,n[i++]=s&63|128;else if(s<55296||s>56319)n[i++]=(s>>>12)+224,n[i++]=s>>>6&63|128,n[i++]=s&63|128;else{if(s=(s-55296)*1024+(e.charCodeAt(++a)-56320)+65536,s>1114111)throw new Error("Unicode standard supports code points up to U+10FFFF");n[i++]=(s>>>18)+240,n[i++]=s>>>12&63|128,n[i++]=s>>>6&63|128,n[i++]=s&63|128}i>=64&&(this._dataLength+=64,t._md5cycle(this._state,r),i-=64,r[0]=r[16])}return this._bufferLength=i,this},t.prototype.appendAsciiStr=function(e){for(var n=this._buffer8,r=this._buffer32,i=this._bufferLength,s,a=0;;){for(s=Math.min(e.length-a,64-i);s--;)n[i++]=e.charCodeAt(a++);if(i<64)break;this._dataLength+=64,t._md5cycle(this._state,r),i=0}return this._bufferLength=i,this},t.prototype.appendByteArray=function(e){for(var n=this._buffer8,r=this._buffer32,i=this._bufferLength,s,a=0;;){for(s=Math.min(e.length-a,64-i);s--;)n[i++]=e[a++];if(i<64)break;this._dataLength+=64,t._md5cycle(this._state,r),i=0}return this._bufferLength=i,this},t.prototype.getState=function(){var e=this,n=e._state;return{buffer:String.fromCharCode.apply(null,e._buffer8),buflen:e._bufferLength,length:e._dataLength,state:[n[0],n[1],n[2],n[3]]}},t.prototype.setState=function(e){var n=e.buffer,r=e.state,i=this._state,s;for(this._dataLength=e.length,this._bufferLength=e.buflen,i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],s=0;s>2)+1,a;if(this._dataLength+=n,r[n]=128,r[n+1]=r[n+2]=r[n+3]=0,i.set(t.buffer32Identity.subarray(s),s),n>55&&(t._md5cycle(this._state,i),i.set(t.buffer32Identity)),a=this._dataLength*8,a<=4294967295)i[14]=a;else{var o=a.toString(16).match(/(.*?)(.{0,8})$/);if(o===null)return;var l=parseInt(o[2],16),u=parseInt(o[1],16)||0;i[14]=l,i[15]=u}return t._md5cycle(this._state,i),e?this._state:t._hex(this._state)},t.stateIdentity=new Int32Array([1732584193,-271733879,-1732584194,271733878]),t.buffer32Identity=new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),t.hexChars="0123456789abcdef",t.hexOut=[],t.onePassHasher=new t,t}();Yf.Md5=hg;hg.hashStr("hello")!=="5d41402abc4b2a76b9719d911017c592"&&console.error("Md5 self test failed.")});var pu=X(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.thenable=qt.typedArray=qt.stringArray=qt.array=qt.func=qt.error=qt.number=qt.string=qt.boolean=void 0;function hA(t){return t===!0||t===!1}qt.boolean=hA;function _g(t){return typeof t=="string"||t instanceof String}qt.string=_g;function mA(t){return typeof t=="number"||t instanceof Number}qt.number=mA;function gA(t){return t instanceof Error}qt.error=gA;function yg(t){return typeof t=="function"}qt.func=yg;function bg(t){return Array.isArray(t)}qt.array=bg;function _A(t){return bg(t)&&t.every(e=>_g(e))}qt.stringArray=_A;function yA(t,e){return Array.isArray(t)&&t.every(e)}qt.typedArray=yA;function bA(t){return t&&yg(t.then)}qt.thenable=bA});var wi=X(rp=>{"use strict";Object.defineProperty(rp,"__esModule",{value:!0});var tp;function np(){if(tp===void 0)throw new Error("No runtime abstraction layer installed");return tp}(function(t){function e(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");tp=n}t.install=e})(np||(np={}));rp.default=np});var ip=X($o=>{"use strict";Object.defineProperty($o,"__esModule",{value:!0});$o.Disposable=void 0;var TA;(function(t){function e(n){return{dispose:n}}t.create=e})(TA=$o.Disposable||($o.Disposable={}))});var vg=X(du=>{"use strict";Object.defineProperty(du,"__esModule",{value:!0});du.AbstractMessageBuffer=void 0;var vA=13,NA=10,CA=`\r -`,Tg=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let n=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(n),this._totalLength+=n.byteLength}tryReadHeaders(){if(this._chunks.length===0)return;let e=0,n=0,r=0,i=0;e:for(;nthis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],a=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,a}let n=this.allocNative(e),r=0,i=0;for(;e>0;){let s=this._chunks[i];if(s.byteLength>e){let a=s.slice(0,e);n.set(a,r),r+=e,this._chunks[i]=s.slice(e),this._totalLength-=e,e-=e}else n.set(s,r),r+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return n}};du.AbstractMessageBuffer=Tg});var Sg=X(ap=>{"use strict";Object.defineProperty(ap,"__esModule",{value:!0});var PA=wi(),Ng=require("util"),ws=ip(),AA=vg(),Ko=class extends AA.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return Ko.emptyBuffer}fromString(e,n){return Buffer.from(e,n)}toString(e,n){return e instanceof Buffer?e.toString(n):new Ng.TextDecoder(n).decode(e)}asNative(e,n){return n===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,n):Buffer.from(e,0,n)}allocNative(e){return Buffer.allocUnsafe(e)}};Ko.emptyBuffer=Buffer.allocUnsafe(0);var Cg=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),ws.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),ws.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),ws.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),ws.Disposable.create(()=>this.stream.off("data",e))}},Pg=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),ws.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),ws.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),ws.Disposable.create(()=>this.stream.off("end",e))}write(e,n){return new Promise((r,i)=>{let s=a=>{a==null?r():i(a)};typeof e=="string"?this.stream.write(e,n,s):this.stream.write(e,s)})}end(){this.stream.end()}},Ag=Object.freeze({messageBuffer:Object.freeze({create:t=>new Ko(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),e.charset))}catch(n){return Promise.reject(n)}}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(e.charset))):Promise.resolve(JSON.parse(new Ng.TextDecoder(e.charset).decode(t)))}catch(n){return Promise.reject(n)}}})}),stream:Object.freeze({asReadableStream:t=>new Cg(t),asWritableStream:t=>new Pg(t)}),console,timer:Object.freeze({setTimeout(t,e,...n){return setTimeout(t,e,...n)},clearTimeout(t){clearTimeout(t)},setImmediate(t,...e){return setImmediate(t,...e)},clearImmediate(t){clearImmediate(t)}})});function sp(){return Ag}(function(t){function e(){PA.default.install(Ag)}t.install=e})(sp||(sp={}));ap.default=sp});var Ca=X(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.stringArray=gn.array=gn.func=gn.error=gn.number=gn.string=gn.boolean=void 0;function SA(t){return t===!0||t===!1}gn.boolean=SA;function Eg(t){return typeof t=="string"||t instanceof String}gn.string=Eg;function EA(t){return typeof t=="number"||t instanceof Number}gn.number=EA;function IA(t){return t instanceof Error}gn.error=IA;function DA(t){return typeof t=="function"}gn.func=DA;function Ig(t){return Array.isArray(t)}gn.array=Ig;function xA(t){return Ig(t)&&t.every(e=>Eg(e))}gn.stringArray=xA});var op=X(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.isResponseMessage=ge.isNotificationMessage=ge.isRequestMessage=ge.NotificationType9=ge.NotificationType8=ge.NotificationType7=ge.NotificationType6=ge.NotificationType5=ge.NotificationType4=ge.NotificationType3=ge.NotificationType2=ge.NotificationType1=ge.NotificationType0=ge.NotificationType=ge.RequestType9=ge.RequestType8=ge.RequestType7=ge.RequestType6=ge.RequestType5=ge.RequestType4=ge.RequestType3=ge.RequestType2=ge.RequestType1=ge.RequestType=ge.RequestType0=ge.AbstractMessageSignature=ge.ParameterStructures=ge.ResponseError=ge.ErrorCodes=void 0;var Os=Ca(),Dg;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=t.jsonrpcReservedErrorRangeStart,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=t.jsonrpcReservedErrorRangeEnd})(Dg=ge.ErrorCodes||(ge.ErrorCodes={}));var hu=class extends Error{constructor(e,n,r){super(n);this.code=Os.number(e)?e:Dg.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,hu.prototype)}toJson(){return{code:this.code,message:this.message,data:this.data}}};ge.ResponseError=hu;var fn=class{constructor(e){this.kind=e}static is(e){return e===fn.auto||e===fn.byName||e===fn.byPosition}toString(){return this.kind}};ge.ParameterStructures=fn;fn.auto=new fn("auto");fn.byPosition=new fn("byPosition");fn.byName=new fn("byName");var Tt=class{constructor(e,n){this.method=e,this.numberOfParams=n}get parameterStructures(){return fn.auto}};ge.AbstractMessageSignature=Tt;var xg=class extends Tt{constructor(e){super(e,0)}};ge.RequestType0=xg;var Rg=class extends Tt{constructor(e,n=fn.auto){super(e,1);this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ge.RequestType=Rg;var wg=class extends Tt{constructor(e,n=fn.auto){super(e,1);this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ge.RequestType1=wg;var Og=class extends Tt{constructor(e){super(e,2)}};ge.RequestType2=Og;var Lg=class extends Tt{constructor(e){super(e,3)}};ge.RequestType3=Lg;var Fg=class extends Tt{constructor(e){super(e,4)}};ge.RequestType4=Fg;var kg=class extends Tt{constructor(e){super(e,5)}};ge.RequestType5=kg;var Mg=class extends Tt{constructor(e){super(e,6)}};ge.RequestType6=Mg;var Bg=class extends Tt{constructor(e){super(e,7)}};ge.RequestType7=Bg;var qg=class extends Tt{constructor(e){super(e,8)}};ge.RequestType8=qg;var Vg=class extends Tt{constructor(e){super(e,9)}};ge.RequestType9=Vg;var jg=class extends Tt{constructor(e,n=fn.auto){super(e,1);this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ge.NotificationType=jg;var Ug=class extends Tt{constructor(e){super(e,0)}};ge.NotificationType0=Ug;var Wg=class extends Tt{constructor(e,n=fn.auto){super(e,1);this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ge.NotificationType1=Wg;var Gg=class extends Tt{constructor(e){super(e,2)}};ge.NotificationType2=Gg;var Yg=class extends Tt{constructor(e){super(e,3)}};ge.NotificationType3=Yg;var Hg=class extends Tt{constructor(e){super(e,4)}};ge.NotificationType4=Hg;var $g=class extends Tt{constructor(e){super(e,5)}};ge.NotificationType5=$g;var Kg=class extends Tt{constructor(e){super(e,6)}};ge.NotificationType6=Kg;var zg=class extends Tt{constructor(e){super(e,7)}};ge.NotificationType7=zg;var Xg=class extends Tt{constructor(e){super(e,8)}};ge.NotificationType8=Xg;var Qg=class extends Tt{constructor(e){super(e,9)}};ge.NotificationType9=Qg;function RA(t){let e=t;return e&&Os.string(e.method)&&(Os.string(e.id)||Os.number(e.id))}ge.isRequestMessage=RA;function wA(t){let e=t;return e&&Os.string(e.method)&&t.id===void 0}ge.isNotificationMessage=wA;function OA(t){let e=t;return e&&(e.result!==void 0||!!e.error)&&(Os.string(e.id)||Os.number(e.id)||e.id===null)}ge.isResponseMessage=OA});var Pa=X(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.Emitter=Ls.Event=void 0;var LA=wi(),FA;(function(t){let e={dispose(){}};t.None=function(){return e}})(FA=Ls.Event||(Ls.Event={}));var Jg=class{add(e,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(e,n)})}remove(e,n=null){if(!this._callbacks)return;let r=!1;for(let i=0,s=this._callbacks.length;i{this._callbacks||(this._callbacks=new Jg),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,n);let i={dispose:()=>{!this._callbacks||(this._callbacks.remove(e,n),i.dispose=zo._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};Ls.Emitter=zo;zo._noop=function(){}});var fp=X(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.CancellationTokenSource=Fs.CancellationToken=void 0;var Zg=wi(),kA=Ca(),lp=Pa(),up;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:lp.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:lp.Event.None});function e(n){let r=n;return r&&(r===t.None||r===t.Cancelled||kA.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.is=e})(up=Fs.CancellationToken||(Fs.CancellationToken={}));var MA=Object.freeze(function(t,e){let n=Zg.default().timer.setTimeout(t.bind(e),0);return{dispose(){Zg.default().timer.clearTimeout(n)}}}),cp=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?MA:(this._emitter||(this._emitter=new lp.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},e_=class{get token(){return this._token||(this._token=new cp),this._token}cancel(){this._token?this._token.cancel():this._token=up.Cancelled}dispose(){this._token?this._token instanceof cp&&this._token.dispose():this._token=up.None}};Fs.CancellationTokenSource=e_});var n_=X(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.ReadableStreamMessageReader=Oi.AbstractMessageReader=Oi.MessageReader=void 0;var mu=wi(),Aa=Ca(),pp=Pa(),BA;(function(t){function e(n){let r=n;return r&&Aa.func(r.listen)&&Aa.func(r.dispose)&&Aa.func(r.onError)&&Aa.func(r.onClose)&&Aa.func(r.onPartialMessage)}t.is=e})(BA=Oi.MessageReader||(Oi.MessageReader={}));var dp=class{constructor(){this.errorEmitter=new pp.Emitter,this.closeEmitter=new pp.Emitter,this.partialMessageEmitter=new pp.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${Aa.string(e.message)?e.message:"unknown"}`)}};Oi.AbstractMessageReader=dp;var hp;(function(t){function e(n){var r;let i,s,a,o=new Map,l,u=new Map;if(n===void 0||typeof n=="string")i=n??"utf-8";else{if(i=(r=n.charset)!==null&&r!==void 0?r:"utf-8",n.contentDecoder!==void 0&&(a=n.contentDecoder,o.set(a.name,a)),n.contentDecoders!==void 0)for(let c of n.contentDecoders)o.set(c.name,c);if(n.contentTypeDecoder!==void 0&&(l=n.contentTypeDecoder,u.set(l.name,l)),n.contentTypeDecoders!==void 0)for(let c of n.contentTypeDecoders)u.set(c.name,c)}return l===void 0&&(l=mu.default().applicationJson.decoder,u.set(l.name,l)),{charset:i,contentDecoder:a,contentDecoders:o,contentTypeDecoder:l,contentTypeDecoders:u}}t.fromOptions=e})(hp||(hp={}));var t_=class extends dp{constructor(e,n){super();this.readable=e,this.options=hp.fromOptions(n),this.buffer=mu.default().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let n=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),n}onData(e){for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let i=this.buffer.tryReadHeaders();if(!i)return;let s=i.get("Content-Length");if(!s)throw new Error("Header must provide a Content-Length property.");let a=parseInt(s);if(isNaN(a))throw new Error("Content-Length value must be a number.");this.nextMessageLength=a}let n=this.buffer.tryReadBody(this.nextMessageLength);if(n===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1;let r;this.options.contentDecoder!==void 0?r=this.options.contentDecoder.decode(n):r=Promise.resolve(n),r.then(i=>{this.options.contentTypeDecoder.decode(i,this.options).then(s=>{this.callback(s)},s=>{this.fireError(s)})},i=>{this.fireError(i)})}}clearPartialMessageTimer(){this.partialMessageTimer&&(mu.default().timer.clearTimeout(this.partialMessageTimer),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=mu.default().timer.setTimeout((e,n)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:n}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};Oi.ReadableStreamMessageReader=t_});var i_=X(gu=>{"use strict";Object.defineProperty(gu,"__esModule",{value:!0});gu.Semaphore=void 0;var qA=wi(),r_=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((n,r)=>{this._waiting.push({thunk:e,resolve:n,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||qA.default().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let n=e.thunk();n instanceof Promise?n.then(r=>{this._active--,e.resolve(r),this.runNext()},r=>{this._active--,e.reject(r),this.runNext()}):(this._active--,e.resolve(n),this.runNext())}catch(n){this._active--,e.reject(n),this.runNext()}}};gu.Semaphore=r_});var u_=X(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.WriteableStreamMessageWriter=Li.AbstractMessageWriter=Li.MessageWriter=void 0;var s_=wi(),Xo=Ca(),VA=i_(),a_=Pa(),jA="Content-Length: ",o_=`\r -`,UA;(function(t){function e(n){let r=n;return r&&Xo.func(r.dispose)&&Xo.func(r.onClose)&&Xo.func(r.onError)&&Xo.func(r.write)}t.is=e})(UA=Li.MessageWriter||(Li.MessageWriter={}));var mp=class{constructor(){this.errorEmitter=new a_.Emitter,this.closeEmitter=new a_.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,n,r){this.errorEmitter.fire([this.asError(e),n,r])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${Xo.string(e.message)?e.message:"unknown"}`)}};Li.AbstractMessageWriter=mp;var gp;(function(t){function e(n){var r,i;return n===void 0||typeof n=="string"?{charset:n??"utf-8",contentTypeEncoder:s_.default().applicationJson.encoder}:{charset:(r=n.charset)!==null&&r!==void 0?r:"utf-8",contentEncoder:n.contentEncoder,contentTypeEncoder:(i=n.contentTypeEncoder)!==null&&i!==void 0?i:s_.default().applicationJson.encoder}}t.fromOptions=e})(gp||(gp={}));var l_=class extends mp{constructor(e,n){super();this.writable=e,this.options=gp.fromOptions(n),this.errorCount=0,this.writeSemaphore=new VA.Semaphore(1),this.writable.onError(r=>this.fireError(r)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(r=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(r):r).then(r=>{let i=[];return i.push(jA,r.byteLength.toString(),o_),i.push(o_),this.doWrite(e,i,r)},r=>{throw this.fireError(r),r}))}async doWrite(e,n,r){try{return await this.writable.write(n.join(""),"ascii"),this.writable.write(r)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){this.writable.end()}};Li.WriteableStreamMessageWriter=l_});var f_=X(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});Fi.LRUCache=Fi.LinkedMap=Fi.Touch=void 0;var En;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(En=Fi.Touch||(Fi.Touch={}));var _p=class{constructor(){this[Symbol.toStringTag]="LinkedMap",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(){var e;return(e=this._head)===null||e===void 0?void 0:e.value}get last(){var e;return(e=this._tail)===null||e===void 0?void 0:e.value}has(e){return this._map.has(e)}get(e,n=En.None){let r=this._map.get(e);if(!!r)return n!==En.None&&this.touch(r,n),r.value}set(e,n,r=En.None){let i=this._map.get(e);if(i)i.value=n,r!==En.None&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case En.None:this.addItemLast(i);break;case En.First:this.addItemFirst(i);break;case En.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let n=this._map.get(e);if(!!n)return this._map.delete(e),this.removeItem(n),this._size--,n.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,n){let r=this._state,i=this._head;for(;i;){if(n?e.bind(n)(i.value,i.key,this):e(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this,n=this._state,r=this._head,i={[Symbol.iterator](){return i},next(){if(e._state!==n)throw new Error("LinkedMap got modified during iteration.");if(r){let s={value:r.key,done:!1};return r=r.next,s}else return{value:void 0,done:!0}}};return i}values(){let e=this,n=this._state,r=this._head,i={[Symbol.iterator](){return i},next(){if(e._state!==n)throw new Error("LinkedMap got modified during iteration.");if(r){let s={value:r.value,done:!1};return r=r.next,s}else return{value:void 0,done:!0}}};return i}entries(){let e=this,n=this._state,r=this._head,i={[Symbol.iterator](){return i},next(){if(e._state!==n)throw new Error("LinkedMap got modified during iteration.");if(r){let s={value:[r.key,r.value],done:!1};return r=r.next,s}else return{value:void 0,done:!0}}};return i}[Symbol.iterator](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let n=this._head,r=this.size;for(;n&&r>e;)this._map.delete(n.key),n=n.next,r--;this._head=n,this._size=r,n&&(n.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let n=e.next,r=e.previous;if(!n||!r)throw new Error("Invalid list");n.previous=r,r.next=n}e.next=void 0,e.previous=void 0,this._state++}touch(e,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==En.First&&n!==En.Last)){if(n===En.First){if(e===this._head)return;let r=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(n===En.Last){if(e===this._tail)return;let r=e.next,i=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((n,r)=>{e.push([r,n])}),e}fromJSON(e){this.clear();for(let[n,r]of e)this.set(n,r)}};Fi.LinkedMap=_p;var c_=class extends _p{constructor(e,n=1){super();this._limit=e,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,n=En.AsNew){return super.get(e,n)}peek(e){return super.get(e,En.None)}set(e,n){return super.set(e,n,En.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Fi.LRUCache=c_});var __=X(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.createMessageConnection=Oe.ConnectionOptions=Oe.CancellationStrategy=Oe.CancellationSenderStrategy=Oe.CancellationReceiverStrategy=Oe.ConnectionStrategy=Oe.ConnectionError=Oe.ConnectionErrors=Oe.LogTraceNotification=Oe.SetTraceNotification=Oe.TraceFormat=Oe.Trace=Oe.NullLogger=Oe.ProgressType=void 0;var p_=wi(),nn=Ca(),De=op(),d_=f_(),Qo=Pa(),yp=fp(),Jo;(function(t){t.type=new De.NotificationType("$/cancelRequest")})(Jo||(Jo={}));var _u;(function(t){t.type=new De.NotificationType("$/progress")})(_u||(_u={}));var h_=class{constructor(){}};Oe.ProgressType=h_;var bp;(function(t){function e(n){return nn.func(n)}t.is=e})(bp||(bp={}));Oe.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var Vt;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Verbose=2]="Verbose"})(Vt=Oe.Trace||(Oe.Trace={}));(function(t){function e(r){if(!nn.string(r))return t.Off;switch(r=r.toLowerCase(),r){case"off":return t.Off;case"messages":return t.Messages;case"verbose":return t.Verbose;default:return t.Off}}t.fromString=e;function n(r){switch(r){case t.Off:return"off";case t.Messages:return"messages";case t.Verbose:return"verbose";default:return"off"}}t.toString=n})(Vt=Oe.Trace||(Oe.Trace={}));var Kr;(function(t){t.Text="text",t.JSON="json"})(Kr=Oe.TraceFormat||(Oe.TraceFormat={}));(function(t){function e(n){return n=n.toLowerCase(),n==="json"?t.JSON:t.Text}t.fromString=e})(Kr=Oe.TraceFormat||(Oe.TraceFormat={}));var m_;(function(t){t.type=new De.NotificationType("$/setTrace")})(m_=Oe.SetTraceNotification||(Oe.SetTraceNotification={}));var Tp;(function(t){t.type=new De.NotificationType("$/logTrace")})(Tp=Oe.LogTraceNotification||(Oe.LogTraceNotification={}));var yu;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(yu=Oe.ConnectionErrors||(Oe.ConnectionErrors={}));var ks=class extends Error{constructor(e,n){super(n);this.code=e,Object.setPrototypeOf(this,ks.prototype)}};Oe.ConnectionError=ks;var g_;(function(t){function e(n){let r=n;return r&&nn.func(r.cancelUndispatched)}t.is=e})(g_=Oe.ConnectionStrategy||(Oe.ConnectionStrategy={}));var vp;(function(t){t.Message=Object.freeze({createCancellationTokenSource(n){return new yp.CancellationTokenSource}});function e(n){let r=n;return r&&nn.func(r.createCancellationTokenSource)}t.is=e})(vp=Oe.CancellationReceiverStrategy||(Oe.CancellationReceiverStrategy={}));var Np;(function(t){t.Message=Object.freeze({sendCancellation(n,r){n.sendNotification(Jo.type,{id:r})},cleanup(n){}});function e(n){let r=n;return r&&nn.func(r.sendCancellation)&&nn.func(r.cleanup)}t.is=e})(Np=Oe.CancellationSenderStrategy||(Oe.CancellationSenderStrategy={}));var Cp;(function(t){t.Message=Object.freeze({receiver:vp.Message,sender:Np.Message});function e(n){let r=n;return r&&vp.is(r.receiver)&&Np.is(r.sender)}t.is=e})(Cp=Oe.CancellationStrategy||(Oe.CancellationStrategy={}));var WA;(function(t){function e(n){let r=n;return r&&(Cp.is(r.cancellationStrategy)||g_.is(r.connectionStrategy))}t.is=e})(WA=Oe.ConnectionOptions||(Oe.ConnectionOptions={}));var zr;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(zr||(zr={}));function GA(t,e,n,r){let i=n!==void 0?n:Oe.NullLogger,s=0,a=0,o=0,l="2.0",u,c=Object.create(null),f,h=Object.create(null),y=new Map,p,d=new d_.LinkedMap,g=Object.create(null),m=Object.create(null),b=Vt.Off,_=Kr.Text,N,C=zr.New,G=new Qo.Emitter,L=new Qo.Emitter,M=new Qo.Emitter,$=new Qo.Emitter,K=new Qo.Emitter,ne=r&&r.cancellationStrategy?r.cancellationStrategy:Cp.Message;function re(x){if(x===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+x.toString()}function ye(x){return x===null?"res-unknown-"+(++o).toString():"res-"+x.toString()}function Ce(){return"not-"+(++a).toString()}function ae(x,I){De.isRequestMessage(I)?x.set(re(I.id),I):De.isResponseMessage(I)?x.set(ye(I.id),I):x.set(Ce(),I)}function Pe(x){}function ct(){return C===zr.Listening}function Jt(){return C===zr.Closed}function Je(){return C===zr.Disposed}function ft(){(C===zr.New||C===zr.Listening)&&(C=zr.Closed,L.fire(void 0))}function pe(x){G.fire([x,void 0,void 0])}function Re(x){G.fire(x)}t.onClose(ft),t.onError(pe),e.onClose(ft),e.onError(Re);function Ge(){p||d.size===0||(p=p_.default().timer.setImmediate(()=>{p=void 0,J()}))}function J(){if(d.size===0)return;let x=d.shift();try{De.isRequestMessage(x)?st(x):De.isNotificationMessage(x)?vn(x):De.isResponseMessage(x)?Dt(x):Si(x)}finally{Ge()}}let pt=x=>{try{if(De.isNotificationMessage(x)&&x.method===Jo.type.method){let I=re(x.params.id),v=d.get(I);if(De.isRequestMessage(v)){let D=r==null?void 0:r.connectionStrategy,O=D&&D.cancelUndispatched?D.cancelUndispatched(v,Pe):void 0;if(O&&(O.error!==void 0||O.result!==void 0)){d.delete(I),O.id=v.id,$i(O,x.method,Date.now()),e.write(O);return}}}ae(d,x)}finally{Ge()}};function st(x){if(Je())return;function I(j,fe,ve){let Ve={jsonrpc:l,id:x.id};j instanceof De.ResponseError?Ve.error=j.toJson():Ve.result=j===void 0?null:j,$i(Ve,fe,ve),e.write(Ve)}function v(j,fe,ve){let Ve={jsonrpc:l,id:x.id,error:j.toJson()};$i(Ve,fe,ve),e.write(Ve)}function D(j,fe,ve){j===void 0&&(j=null);let Ve={jsonrpc:l,id:x.id,result:j};$i(Ve,fe,ve),e.write(Ve)}Gn(x);let O=c[x.method],S,T;O&&(S=O.type,T=O.handler);let F=Date.now();if(T||u){let j=String(x.id),fe=ne.receiver.createCancellationTokenSource(j);m[j]=fe;try{let ve;if(T)if(x.params===void 0){if(S!==void 0&&S.numberOfParams!==0){v(new De.ResponseError(De.ErrorCodes.InvalidParams,`Request ${x.method} defines ${S.numberOfParams} params but recevied none.`),x.method,F);return}ve=T(fe.token)}else if(Array.isArray(x.params)){if(S!==void 0&&S.parameterStructures===De.ParameterStructures.byName){v(new De.ResponseError(De.ErrorCodes.InvalidParams,`Request ${x.method} defines parameters by name but received parameters by position`),x.method,F);return}ve=T(...x.params,fe.token)}else{if(S!==void 0&&S.parameterStructures===De.ParameterStructures.byPosition){v(new De.ResponseError(De.ErrorCodes.InvalidParams,`Request ${x.method} defines parameters by position but received parameters by name`),x.method,F);return}ve=T(x.params,fe.token)}else u&&(ve=u(x.method,x.params,fe.token));let Ve=ve;ve?Ve.then?Ve.then(dt=>{delete m[j],I(dt,x.method,F)},dt=>{delete m[j],dt instanceof De.ResponseError?v(dt,x.method,F):dt&&nn.string(dt.message)?v(new De.ResponseError(De.ErrorCodes.InternalError,`Request ${x.method} failed with message: ${dt.message}`),x.method,F):v(new De.ResponseError(De.ErrorCodes.InternalError,`Request ${x.method} failed unexpectedly without providing any details.`),x.method,F)}):(delete m[j],I(ve,x.method,F)):(delete m[j],D(ve,x.method,F))}catch(ve){delete m[j],ve instanceof De.ResponseError?I(ve,x.method,F):ve&&nn.string(ve.message)?v(new De.ResponseError(De.ErrorCodes.InternalError,`Request ${x.method} failed with message: ${ve.message}`),x.method,F):v(new De.ResponseError(De.ErrorCodes.InternalError,`Request ${x.method} failed unexpectedly without providing any details.`),x.method,F)}}else v(new De.ResponseError(De.ErrorCodes.MethodNotFound,`Unhandled method ${x.method}`),x.method,F)}function Dt(x){if(!Je())if(x.id===null)x.error?i.error(`Received response message without id: Error is: -${JSON.stringify(x.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let I=String(x.id),v=g[I];if(R(x,v),v){delete g[I];try{if(x.error){let D=x.error;v.reject(new De.ResponseError(D.code,D.message,D.data))}else if(x.result!==void 0)v.resolve(x.result);else throw new Error("Should never happen.")}catch(D){D.message?i.error(`Response handler '${v.method}' failed with message: ${D.message}`):i.error(`Response handler '${v.method}' failed unexpectedly.`)}}}}function vn(x){if(Je())return;let I,v;if(x.method===Jo.type.method)v=D=>{let O=D.id,S=m[String(O)];S&&S.cancel()};else{let D=h[x.method];D&&(v=D.handler,I=D.type)}if(v||f)try{Mo(x),v?x.params===void 0?(I!==void 0&&I.numberOfParams!==0&&I.parameterStructures!==De.ParameterStructures.byName&&i.error(`Notification ${x.method} defines ${I.numberOfParams} params but recevied none.`),v()):Array.isArray(x.params)?(I!==void 0&&(I.parameterStructures===De.ParameterStructures.byName&&i.error(`Notification ${x.method} defines parameters by name but received parameters by position`),I.numberOfParams!==x.params.length&&i.error(`Notification ${x.method} defines ${I.numberOfParams} params but received ${x.params.length} argumennts`)),v(...x.params)):(I!==void 0&&I.parameterStructures===De.ParameterStructures.byPosition&&i.error(`Notification ${x.method} defines parameters by position but received parameters by name`),v(x.params)):f&&f(x.method,x.params)}catch(D){D.message?i.error(`Notification handler '${x.method}' failed with message: ${D.message}`):i.error(`Notification handler '${x.method}' failed unexpectedly.`)}else M.fire(x)}function Si(x){if(!x){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message: +var eS=Object.create;var Vf=Object.defineProperty;var tS=Object.getOwnPropertyDescriptor;var nS=Object.getOwnPropertyNames;var rS=Object.getPrototypeOf,iS=Object.prototype.hasOwnProperty;var sS=t=>Vf(t,"__esModule",{value:!0});var X=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var aS=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of nS(e))!iS.call(t,i)&&(n||i!=="default")&&Vf(t,i,{get:()=>e[i],enumerable:!(r=tS(e,i))||r.enumerable});return t},je=(t,e)=>aS(sS(Vf(t!=null?eS(rS(t)):{},"default",!e&&t&&t.__esModule?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var uu=X(Yf=>{"use strict";Object.defineProperty(Yf,"__esModule",{value:!0});var hg=function(){function t(){this._state=new Int32Array(4),this._buffer=new ArrayBuffer(68),this._buffer8=new Uint8Array(this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()}return t.hashStr=function(e,n){return n===void 0&&(n=!1),this.onePassHasher.start().appendStr(e).end(n)},t.hashAsciiStr=function(e,n){return n===void 0&&(n=!1),this.onePassHasher.start().appendAsciiStr(e).end(n)},t._hex=function(e){var n=t.hexChars,r=t.hexOut,i,s,a,o;for(o=0;o<4;o+=1)for(s=o*8,i=e[o],a=0;a<8;a+=2)r[s+1+a]=n.charAt(i&15),i>>>=4,r[s+0+a]=n.charAt(i&15),i>>>=4;return r.join("")},t._md5cycle=function(e,n){var r=e[0],i=e[1],s=e[2],a=e[3];r+=(i&s|~i&a)+n[0]-680876936|0,r=(r<<7|r>>>25)+i|0,a+=(r&i|~r&s)+n[1]-389564586|0,a=(a<<12|a>>>20)+r|0,s+=(a&r|~a&i)+n[2]+606105819|0,s=(s<<17|s>>>15)+a|0,i+=(s&a|~s&r)+n[3]-1044525330|0,i=(i<<22|i>>>10)+s|0,r+=(i&s|~i&a)+n[4]-176418897|0,r=(r<<7|r>>>25)+i|0,a+=(r&i|~r&s)+n[5]+1200080426|0,a=(a<<12|a>>>20)+r|0,s+=(a&r|~a&i)+n[6]-1473231341|0,s=(s<<17|s>>>15)+a|0,i+=(s&a|~s&r)+n[7]-45705983|0,i=(i<<22|i>>>10)+s|0,r+=(i&s|~i&a)+n[8]+1770035416|0,r=(r<<7|r>>>25)+i|0,a+=(r&i|~r&s)+n[9]-1958414417|0,a=(a<<12|a>>>20)+r|0,s+=(a&r|~a&i)+n[10]-42063|0,s=(s<<17|s>>>15)+a|0,i+=(s&a|~s&r)+n[11]-1990404162|0,i=(i<<22|i>>>10)+s|0,r+=(i&s|~i&a)+n[12]+1804603682|0,r=(r<<7|r>>>25)+i|0,a+=(r&i|~r&s)+n[13]-40341101|0,a=(a<<12|a>>>20)+r|0,s+=(a&r|~a&i)+n[14]-1502002290|0,s=(s<<17|s>>>15)+a|0,i+=(s&a|~s&r)+n[15]+1236535329|0,i=(i<<22|i>>>10)+s|0,r+=(i&a|s&~a)+n[1]-165796510|0,r=(r<<5|r>>>27)+i|0,a+=(r&s|i&~s)+n[6]-1069501632|0,a=(a<<9|a>>>23)+r|0,s+=(a&i|r&~i)+n[11]+643717713|0,s=(s<<14|s>>>18)+a|0,i+=(s&r|a&~r)+n[0]-373897302|0,i=(i<<20|i>>>12)+s|0,r+=(i&a|s&~a)+n[5]-701558691|0,r=(r<<5|r>>>27)+i|0,a+=(r&s|i&~s)+n[10]+38016083|0,a=(a<<9|a>>>23)+r|0,s+=(a&i|r&~i)+n[15]-660478335|0,s=(s<<14|s>>>18)+a|0,i+=(s&r|a&~r)+n[4]-405537848|0,i=(i<<20|i>>>12)+s|0,r+=(i&a|s&~a)+n[9]+568446438|0,r=(r<<5|r>>>27)+i|0,a+=(r&s|i&~s)+n[14]-1019803690|0,a=(a<<9|a>>>23)+r|0,s+=(a&i|r&~i)+n[3]-187363961|0,s=(s<<14|s>>>18)+a|0,i+=(s&r|a&~r)+n[8]+1163531501|0,i=(i<<20|i>>>12)+s|0,r+=(i&a|s&~a)+n[13]-1444681467|0,r=(r<<5|r>>>27)+i|0,a+=(r&s|i&~s)+n[2]-51403784|0,a=(a<<9|a>>>23)+r|0,s+=(a&i|r&~i)+n[7]+1735328473|0,s=(s<<14|s>>>18)+a|0,i+=(s&r|a&~r)+n[12]-1926607734|0,i=(i<<20|i>>>12)+s|0,r+=(i^s^a)+n[5]-378558|0,r=(r<<4|r>>>28)+i|0,a+=(r^i^s)+n[8]-2022574463|0,a=(a<<11|a>>>21)+r|0,s+=(a^r^i)+n[11]+1839030562|0,s=(s<<16|s>>>16)+a|0,i+=(s^a^r)+n[14]-35309556|0,i=(i<<23|i>>>9)+s|0,r+=(i^s^a)+n[1]-1530992060|0,r=(r<<4|r>>>28)+i|0,a+=(r^i^s)+n[4]+1272893353|0,a=(a<<11|a>>>21)+r|0,s+=(a^r^i)+n[7]-155497632|0,s=(s<<16|s>>>16)+a|0,i+=(s^a^r)+n[10]-1094730640|0,i=(i<<23|i>>>9)+s|0,r+=(i^s^a)+n[13]+681279174|0,r=(r<<4|r>>>28)+i|0,a+=(r^i^s)+n[0]-358537222|0,a=(a<<11|a>>>21)+r|0,s+=(a^r^i)+n[3]-722521979|0,s=(s<<16|s>>>16)+a|0,i+=(s^a^r)+n[6]+76029189|0,i=(i<<23|i>>>9)+s|0,r+=(i^s^a)+n[9]-640364487|0,r=(r<<4|r>>>28)+i|0,a+=(r^i^s)+n[12]-421815835|0,a=(a<<11|a>>>21)+r|0,s+=(a^r^i)+n[15]+530742520|0,s=(s<<16|s>>>16)+a|0,i+=(s^a^r)+n[2]-995338651|0,i=(i<<23|i>>>9)+s|0,r+=(s^(i|~a))+n[0]-198630844|0,r=(r<<6|r>>>26)+i|0,a+=(i^(r|~s))+n[7]+1126891415|0,a=(a<<10|a>>>22)+r|0,s+=(r^(a|~i))+n[14]-1416354905|0,s=(s<<15|s>>>17)+a|0,i+=(a^(s|~r))+n[5]-57434055|0,i=(i<<21|i>>>11)+s|0,r+=(s^(i|~a))+n[12]+1700485571|0,r=(r<<6|r>>>26)+i|0,a+=(i^(r|~s))+n[3]-1894986606|0,a=(a<<10|a>>>22)+r|0,s+=(r^(a|~i))+n[10]-1051523|0,s=(s<<15|s>>>17)+a|0,i+=(a^(s|~r))+n[1]-2054922799|0,i=(i<<21|i>>>11)+s|0,r+=(s^(i|~a))+n[8]+1873313359|0,r=(r<<6|r>>>26)+i|0,a+=(i^(r|~s))+n[15]-30611744|0,a=(a<<10|a>>>22)+r|0,s+=(r^(a|~i))+n[6]-1560198380|0,s=(s<<15|s>>>17)+a|0,i+=(a^(s|~r))+n[13]+1309151649|0,i=(i<<21|i>>>11)+s|0,r+=(s^(i|~a))+n[4]-145523070|0,r=(r<<6|r>>>26)+i|0,a+=(i^(r|~s))+n[11]-1120210379|0,a=(a<<10|a>>>22)+r|0,s+=(r^(a|~i))+n[2]+718787259|0,s=(s<<15|s>>>17)+a|0,i+=(a^(s|~r))+n[9]-343485551|0,i=(i<<21|i>>>11)+s|0,e[0]=r+e[0]|0,e[1]=i+e[1]|0,e[2]=s+e[2]|0,e[3]=a+e[3]|0},t.prototype.start=function(){return this._dataLength=0,this._bufferLength=0,this._state.set(t.stateIdentity),this},t.prototype.appendStr=function(e){var n=this._buffer8,r=this._buffer32,i=this._bufferLength,s,a;for(a=0;a>>6)+192,n[i++]=s&63|128;else if(s<55296||s>56319)n[i++]=(s>>>12)+224,n[i++]=s>>>6&63|128,n[i++]=s&63|128;else{if(s=(s-55296)*1024+(e.charCodeAt(++a)-56320)+65536,s>1114111)throw new Error("Unicode standard supports code points up to U+10FFFF");n[i++]=(s>>>18)+240,n[i++]=s>>>12&63|128,n[i++]=s>>>6&63|128,n[i++]=s&63|128}i>=64&&(this._dataLength+=64,t._md5cycle(this._state,r),i-=64,r[0]=r[16])}return this._bufferLength=i,this},t.prototype.appendAsciiStr=function(e){for(var n=this._buffer8,r=this._buffer32,i=this._bufferLength,s,a=0;;){for(s=Math.min(e.length-a,64-i);s--;)n[i++]=e.charCodeAt(a++);if(i<64)break;this._dataLength+=64,t._md5cycle(this._state,r),i=0}return this._bufferLength=i,this},t.prototype.appendByteArray=function(e){for(var n=this._buffer8,r=this._buffer32,i=this._bufferLength,s,a=0;;){for(s=Math.min(e.length-a,64-i);s--;)n[i++]=e[a++];if(i<64)break;this._dataLength+=64,t._md5cycle(this._state,r),i=0}return this._bufferLength=i,this},t.prototype.getState=function(){var e=this,n=e._state;return{buffer:String.fromCharCode.apply(null,e._buffer8),buflen:e._bufferLength,length:e._dataLength,state:[n[0],n[1],n[2],n[3]]}},t.prototype.setState=function(e){var n=e.buffer,r=e.state,i=this._state,s;for(this._dataLength=e.length,this._bufferLength=e.buflen,i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],s=0;s>2)+1,a;if(this._dataLength+=n,r[n]=128,r[n+1]=r[n+2]=r[n+3]=0,i.set(t.buffer32Identity.subarray(s),s),n>55&&(t._md5cycle(this._state,i),i.set(t.buffer32Identity)),a=this._dataLength*8,a<=4294967295)i[14]=a;else{var o=a.toString(16).match(/(.*?)(.{0,8})$/);if(o===null)return;var l=parseInt(o[2],16),u=parseInt(o[1],16)||0;i[14]=l,i[15]=u}return t._md5cycle(this._state,i),e?this._state:t._hex(this._state)},t.stateIdentity=new Int32Array([1732584193,-271733879,-1732584194,271733878]),t.buffer32Identity=new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),t.hexChars="0123456789abcdef",t.hexOut=[],t.onePassHasher=new t,t}();Yf.Md5=hg;hg.hashStr("hello")!=="5d41402abc4b2a76b9719d911017c592"&&console.error("Md5 self test failed.")});var pu=X(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.thenable=qt.typedArray=qt.stringArray=qt.array=qt.func=qt.error=qt.number=qt.string=qt.boolean=void 0;function mS(t){return t===!0||t===!1}qt.boolean=mS;function _g(t){return typeof t=="string"||t instanceof String}qt.string=_g;function gS(t){return typeof t=="number"||t instanceof Number}qt.number=gS;function _S(t){return t instanceof Error}qt.error=_S;function yg(t){return typeof t=="function"}qt.func=yg;function bg(t){return Array.isArray(t)}qt.array=bg;function yS(t){return bg(t)&&t.every(e=>_g(e))}qt.stringArray=yS;function bS(t,e){return Array.isArray(t)&&t.every(e)}qt.typedArray=bS;function TS(t){return t&&yg(t.then)}qt.thenable=TS});var wi=X(rp=>{"use strict";Object.defineProperty(rp,"__esModule",{value:!0});var tp;function np(){if(tp===void 0)throw new Error("No runtime abstraction layer installed");return tp}(function(t){function e(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");tp=n}t.install=e})(np||(np={}));rp.default=np});var ip=X($o=>{"use strict";Object.defineProperty($o,"__esModule",{value:!0});$o.Disposable=void 0;var vS;(function(t){function e(n){return{dispose:n}}t.create=e})(vS=$o.Disposable||($o.Disposable={}))});var vg=X(du=>{"use strict";Object.defineProperty(du,"__esModule",{value:!0});du.AbstractMessageBuffer=void 0;var NS=13,CS=10,PS=`\r +`,Tg=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let n=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(n),this._totalLength+=n.byteLength}tryReadHeaders(){if(this._chunks.length===0)return;let e=0,n=0,r=0,i=0;e:for(;nthis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],a=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,a}let n=this.allocNative(e),r=0,i=0;for(;e>0;){let s=this._chunks[i];if(s.byteLength>e){let a=s.slice(0,e);n.set(a,r),r+=e,this._chunks[i]=s.slice(e),this._totalLength-=e,e-=e}else n.set(s,r),r+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return n}};du.AbstractMessageBuffer=Tg});var Ag=X(ap=>{"use strict";Object.defineProperty(ap,"__esModule",{value:!0});var SS=wi(),Ng=require("util"),ws=ip(),AS=vg(),Ko=class extends AS.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return Ko.emptyBuffer}fromString(e,n){return Buffer.from(e,n)}toString(e,n){return e instanceof Buffer?e.toString(n):new Ng.TextDecoder(n).decode(e)}asNative(e,n){return n===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,n):Buffer.from(e,0,n)}allocNative(e){return Buffer.allocUnsafe(e)}};Ko.emptyBuffer=Buffer.allocUnsafe(0);var Cg=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),ws.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),ws.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),ws.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),ws.Disposable.create(()=>this.stream.off("data",e))}},Pg=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),ws.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),ws.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),ws.Disposable.create(()=>this.stream.off("end",e))}write(e,n){return new Promise((r,i)=>{let s=a=>{a==null?r():i(a)};typeof e=="string"?this.stream.write(e,n,s):this.stream.write(e,s)})}end(){this.stream.end()}},Sg=Object.freeze({messageBuffer:Object.freeze({create:t=>new Ko(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),e.charset))}catch(n){return Promise.reject(n)}}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(e.charset))):Promise.resolve(JSON.parse(new Ng.TextDecoder(e.charset).decode(t)))}catch(n){return Promise.reject(n)}}})}),stream:Object.freeze({asReadableStream:t=>new Cg(t),asWritableStream:t=>new Pg(t)}),console,timer:Object.freeze({setTimeout(t,e,...n){return setTimeout(t,e,...n)},clearTimeout(t){clearTimeout(t)},setImmediate(t,...e){return setImmediate(t,...e)},clearImmediate(t){clearImmediate(t)}})});function sp(){return Sg}(function(t){function e(){SS.default.install(Sg)}t.install=e})(sp||(sp={}));ap.default=sp});var Ca=X(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.stringArray=gn.array=gn.func=gn.error=gn.number=gn.string=gn.boolean=void 0;function ES(t){return t===!0||t===!1}gn.boolean=ES;function Eg(t){return typeof t=="string"||t instanceof String}gn.string=Eg;function IS(t){return typeof t=="number"||t instanceof Number}gn.number=IS;function DS(t){return t instanceof Error}gn.error=DS;function xS(t){return typeof t=="function"}gn.func=xS;function Ig(t){return Array.isArray(t)}gn.array=Ig;function RS(t){return Ig(t)&&t.every(e=>Eg(e))}gn.stringArray=RS});var op=X(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.isResponseMessage=ge.isNotificationMessage=ge.isRequestMessage=ge.NotificationType9=ge.NotificationType8=ge.NotificationType7=ge.NotificationType6=ge.NotificationType5=ge.NotificationType4=ge.NotificationType3=ge.NotificationType2=ge.NotificationType1=ge.NotificationType0=ge.NotificationType=ge.RequestType9=ge.RequestType8=ge.RequestType7=ge.RequestType6=ge.RequestType5=ge.RequestType4=ge.RequestType3=ge.RequestType2=ge.RequestType1=ge.RequestType=ge.RequestType0=ge.AbstractMessageSignature=ge.ParameterStructures=ge.ResponseError=ge.ErrorCodes=void 0;var Os=Ca(),Dg;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=t.jsonrpcReservedErrorRangeStart,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=t.jsonrpcReservedErrorRangeEnd})(Dg=ge.ErrorCodes||(ge.ErrorCodes={}));var hu=class extends Error{constructor(e,n,r){super(n);this.code=Os.number(e)?e:Dg.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,hu.prototype)}toJson(){return{code:this.code,message:this.message,data:this.data}}};ge.ResponseError=hu;var fn=class{constructor(e){this.kind=e}static is(e){return e===fn.auto||e===fn.byName||e===fn.byPosition}toString(){return this.kind}};ge.ParameterStructures=fn;fn.auto=new fn("auto");fn.byPosition=new fn("byPosition");fn.byName=new fn("byName");var Tt=class{constructor(e,n){this.method=e,this.numberOfParams=n}get parameterStructures(){return fn.auto}};ge.AbstractMessageSignature=Tt;var xg=class extends Tt{constructor(e){super(e,0)}};ge.RequestType0=xg;var Rg=class extends Tt{constructor(e,n=fn.auto){super(e,1);this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ge.RequestType=Rg;var wg=class extends Tt{constructor(e,n=fn.auto){super(e,1);this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ge.RequestType1=wg;var Og=class extends Tt{constructor(e){super(e,2)}};ge.RequestType2=Og;var Lg=class extends Tt{constructor(e){super(e,3)}};ge.RequestType3=Lg;var Fg=class extends Tt{constructor(e){super(e,4)}};ge.RequestType4=Fg;var kg=class extends Tt{constructor(e){super(e,5)}};ge.RequestType5=kg;var Mg=class extends Tt{constructor(e){super(e,6)}};ge.RequestType6=Mg;var Bg=class extends Tt{constructor(e){super(e,7)}};ge.RequestType7=Bg;var qg=class extends Tt{constructor(e){super(e,8)}};ge.RequestType8=qg;var Vg=class extends Tt{constructor(e){super(e,9)}};ge.RequestType9=Vg;var jg=class extends Tt{constructor(e,n=fn.auto){super(e,1);this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ge.NotificationType=jg;var Ug=class extends Tt{constructor(e){super(e,0)}};ge.NotificationType0=Ug;var Wg=class extends Tt{constructor(e,n=fn.auto){super(e,1);this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ge.NotificationType1=Wg;var Gg=class extends Tt{constructor(e){super(e,2)}};ge.NotificationType2=Gg;var Yg=class extends Tt{constructor(e){super(e,3)}};ge.NotificationType3=Yg;var Hg=class extends Tt{constructor(e){super(e,4)}};ge.NotificationType4=Hg;var $g=class extends Tt{constructor(e){super(e,5)}};ge.NotificationType5=$g;var Kg=class extends Tt{constructor(e){super(e,6)}};ge.NotificationType6=Kg;var zg=class extends Tt{constructor(e){super(e,7)}};ge.NotificationType7=zg;var Xg=class extends Tt{constructor(e){super(e,8)}};ge.NotificationType8=Xg;var Qg=class extends Tt{constructor(e){super(e,9)}};ge.NotificationType9=Qg;function wS(t){let e=t;return e&&Os.string(e.method)&&(Os.string(e.id)||Os.number(e.id))}ge.isRequestMessage=wS;function OS(t){let e=t;return e&&Os.string(e.method)&&t.id===void 0}ge.isNotificationMessage=OS;function LS(t){let e=t;return e&&(e.result!==void 0||!!e.error)&&(Os.string(e.id)||Os.number(e.id)||e.id===null)}ge.isResponseMessage=LS});var Pa=X(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.Emitter=Ls.Event=void 0;var FS=wi(),kS;(function(t){let e={dispose(){}};t.None=function(){return e}})(kS=Ls.Event||(Ls.Event={}));var Jg=class{add(e,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(e,n)})}remove(e,n=null){if(!this._callbacks)return;let r=!1;for(let i=0,s=this._callbacks.length;i{this._callbacks||(this._callbacks=new Jg),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,n);let i={dispose:()=>{!this._callbacks||(this._callbacks.remove(e,n),i.dispose=zo._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};Ls.Emitter=zo;zo._noop=function(){}});var fp=X(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.CancellationTokenSource=Fs.CancellationToken=void 0;var Zg=wi(),MS=Ca(),lp=Pa(),up;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:lp.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:lp.Event.None});function e(n){let r=n;return r&&(r===t.None||r===t.Cancelled||MS.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.is=e})(up=Fs.CancellationToken||(Fs.CancellationToken={}));var BS=Object.freeze(function(t,e){let n=Zg.default().timer.setTimeout(t.bind(e),0);return{dispose(){Zg.default().timer.clearTimeout(n)}}}),cp=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?BS:(this._emitter||(this._emitter=new lp.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},e_=class{get token(){return this._token||(this._token=new cp),this._token}cancel(){this._token?this._token.cancel():this._token=up.Cancelled}dispose(){this._token?this._token instanceof cp&&this._token.dispose():this._token=up.None}};Fs.CancellationTokenSource=e_});var n_=X(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.ReadableStreamMessageReader=Oi.AbstractMessageReader=Oi.MessageReader=void 0;var mu=wi(),Sa=Ca(),pp=Pa(),qS;(function(t){function e(n){let r=n;return r&&Sa.func(r.listen)&&Sa.func(r.dispose)&&Sa.func(r.onError)&&Sa.func(r.onClose)&&Sa.func(r.onPartialMessage)}t.is=e})(qS=Oi.MessageReader||(Oi.MessageReader={}));var dp=class{constructor(){this.errorEmitter=new pp.Emitter,this.closeEmitter=new pp.Emitter,this.partialMessageEmitter=new pp.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${Sa.string(e.message)?e.message:"unknown"}`)}};Oi.AbstractMessageReader=dp;var hp;(function(t){function e(n){var r;let i,s,a,o=new Map,l,u=new Map;if(n===void 0||typeof n=="string")i=n??"utf-8";else{if(i=(r=n.charset)!==null&&r!==void 0?r:"utf-8",n.contentDecoder!==void 0&&(a=n.contentDecoder,o.set(a.name,a)),n.contentDecoders!==void 0)for(let c of n.contentDecoders)o.set(c.name,c);if(n.contentTypeDecoder!==void 0&&(l=n.contentTypeDecoder,u.set(l.name,l)),n.contentTypeDecoders!==void 0)for(let c of n.contentTypeDecoders)u.set(c.name,c)}return l===void 0&&(l=mu.default().applicationJson.decoder,u.set(l.name,l)),{charset:i,contentDecoder:a,contentDecoders:o,contentTypeDecoder:l,contentTypeDecoders:u}}t.fromOptions=e})(hp||(hp={}));var t_=class extends dp{constructor(e,n){super();this.readable=e,this.options=hp.fromOptions(n),this.buffer=mu.default().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let n=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),n}onData(e){for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let i=this.buffer.tryReadHeaders();if(!i)return;let s=i.get("Content-Length");if(!s)throw new Error("Header must provide a Content-Length property.");let a=parseInt(s);if(isNaN(a))throw new Error("Content-Length value must be a number.");this.nextMessageLength=a}let n=this.buffer.tryReadBody(this.nextMessageLength);if(n===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1;let r;this.options.contentDecoder!==void 0?r=this.options.contentDecoder.decode(n):r=Promise.resolve(n),r.then(i=>{this.options.contentTypeDecoder.decode(i,this.options).then(s=>{this.callback(s)},s=>{this.fireError(s)})},i=>{this.fireError(i)})}}clearPartialMessageTimer(){this.partialMessageTimer&&(mu.default().timer.clearTimeout(this.partialMessageTimer),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=mu.default().timer.setTimeout((e,n)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:n}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};Oi.ReadableStreamMessageReader=t_});var i_=X(gu=>{"use strict";Object.defineProperty(gu,"__esModule",{value:!0});gu.Semaphore=void 0;var VS=wi(),r_=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((n,r)=>{this._waiting.push({thunk:e,resolve:n,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||VS.default().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let n=e.thunk();n instanceof Promise?n.then(r=>{this._active--,e.resolve(r),this.runNext()},r=>{this._active--,e.reject(r),this.runNext()}):(this._active--,e.resolve(n),this.runNext())}catch(n){this._active--,e.reject(n),this.runNext()}}};gu.Semaphore=r_});var u_=X(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.WriteableStreamMessageWriter=Li.AbstractMessageWriter=Li.MessageWriter=void 0;var s_=wi(),Xo=Ca(),jS=i_(),a_=Pa(),US="Content-Length: ",o_=`\r +`,WS;(function(t){function e(n){let r=n;return r&&Xo.func(r.dispose)&&Xo.func(r.onClose)&&Xo.func(r.onError)&&Xo.func(r.write)}t.is=e})(WS=Li.MessageWriter||(Li.MessageWriter={}));var mp=class{constructor(){this.errorEmitter=new a_.Emitter,this.closeEmitter=new a_.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,n,r){this.errorEmitter.fire([this.asError(e),n,r])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${Xo.string(e.message)?e.message:"unknown"}`)}};Li.AbstractMessageWriter=mp;var gp;(function(t){function e(n){var r,i;return n===void 0||typeof n=="string"?{charset:n??"utf-8",contentTypeEncoder:s_.default().applicationJson.encoder}:{charset:(r=n.charset)!==null&&r!==void 0?r:"utf-8",contentEncoder:n.contentEncoder,contentTypeEncoder:(i=n.contentTypeEncoder)!==null&&i!==void 0?i:s_.default().applicationJson.encoder}}t.fromOptions=e})(gp||(gp={}));var l_=class extends mp{constructor(e,n){super();this.writable=e,this.options=gp.fromOptions(n),this.errorCount=0,this.writeSemaphore=new jS.Semaphore(1),this.writable.onError(r=>this.fireError(r)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(r=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(r):r).then(r=>{let i=[];return i.push(US,r.byteLength.toString(),o_),i.push(o_),this.doWrite(e,i,r)},r=>{throw this.fireError(r),r}))}async doWrite(e,n,r){try{return await this.writable.write(n.join(""),"ascii"),this.writable.write(r)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){this.writable.end()}};Li.WriteableStreamMessageWriter=l_});var f_=X(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});Fi.LRUCache=Fi.LinkedMap=Fi.Touch=void 0;var En;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(En=Fi.Touch||(Fi.Touch={}));var _p=class{constructor(){this[Symbol.toStringTag]="LinkedMap",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(){var e;return(e=this._head)===null||e===void 0?void 0:e.value}get last(){var e;return(e=this._tail)===null||e===void 0?void 0:e.value}has(e){return this._map.has(e)}get(e,n=En.None){let r=this._map.get(e);if(!!r)return n!==En.None&&this.touch(r,n),r.value}set(e,n,r=En.None){let i=this._map.get(e);if(i)i.value=n,r!==En.None&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case En.None:this.addItemLast(i);break;case En.First:this.addItemFirst(i);break;case En.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let n=this._map.get(e);if(!!n)return this._map.delete(e),this.removeItem(n),this._size--,n.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,n){let r=this._state,i=this._head;for(;i;){if(n?e.bind(n)(i.value,i.key,this):e(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this,n=this._state,r=this._head,i={[Symbol.iterator](){return i},next(){if(e._state!==n)throw new Error("LinkedMap got modified during iteration.");if(r){let s={value:r.key,done:!1};return r=r.next,s}else return{value:void 0,done:!0}}};return i}values(){let e=this,n=this._state,r=this._head,i={[Symbol.iterator](){return i},next(){if(e._state!==n)throw new Error("LinkedMap got modified during iteration.");if(r){let s={value:r.value,done:!1};return r=r.next,s}else return{value:void 0,done:!0}}};return i}entries(){let e=this,n=this._state,r=this._head,i={[Symbol.iterator](){return i},next(){if(e._state!==n)throw new Error("LinkedMap got modified during iteration.");if(r){let s={value:[r.key,r.value],done:!1};return r=r.next,s}else return{value:void 0,done:!0}}};return i}[Symbol.iterator](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let n=this._head,r=this.size;for(;n&&r>e;)this._map.delete(n.key),n=n.next,r--;this._head=n,this._size=r,n&&(n.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let n=e.next,r=e.previous;if(!n||!r)throw new Error("Invalid list");n.previous=r,r.next=n}e.next=void 0,e.previous=void 0,this._state++}touch(e,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==En.First&&n!==En.Last)){if(n===En.First){if(e===this._head)return;let r=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(n===En.Last){if(e===this._tail)return;let r=e.next,i=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((n,r)=>{e.push([r,n])}),e}fromJSON(e){this.clear();for(let[n,r]of e)this.set(n,r)}};Fi.LinkedMap=_p;var c_=class extends _p{constructor(e,n=1){super();this._limit=e,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,n=En.AsNew){return super.get(e,n)}peek(e){return super.get(e,En.None)}set(e,n){return super.set(e,n,En.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Fi.LRUCache=c_});var __=X(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.createMessageConnection=Oe.ConnectionOptions=Oe.CancellationStrategy=Oe.CancellationSenderStrategy=Oe.CancellationReceiverStrategy=Oe.ConnectionStrategy=Oe.ConnectionError=Oe.ConnectionErrors=Oe.LogTraceNotification=Oe.SetTraceNotification=Oe.TraceFormat=Oe.Trace=Oe.NullLogger=Oe.ProgressType=void 0;var p_=wi(),nn=Ca(),De=op(),d_=f_(),Qo=Pa(),yp=fp(),Jo;(function(t){t.type=new De.NotificationType("$/cancelRequest")})(Jo||(Jo={}));var _u;(function(t){t.type=new De.NotificationType("$/progress")})(_u||(_u={}));var h_=class{constructor(){}};Oe.ProgressType=h_;var bp;(function(t){function e(n){return nn.func(n)}t.is=e})(bp||(bp={}));Oe.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var Vt;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Verbose=2]="Verbose"})(Vt=Oe.Trace||(Oe.Trace={}));(function(t){function e(r){if(!nn.string(r))return t.Off;switch(r=r.toLowerCase(),r){case"off":return t.Off;case"messages":return t.Messages;case"verbose":return t.Verbose;default:return t.Off}}t.fromString=e;function n(r){switch(r){case t.Off:return"off";case t.Messages:return"messages";case t.Verbose:return"verbose";default:return"off"}}t.toString=n})(Vt=Oe.Trace||(Oe.Trace={}));var Kr;(function(t){t.Text="text",t.JSON="json"})(Kr=Oe.TraceFormat||(Oe.TraceFormat={}));(function(t){function e(n){return n=n.toLowerCase(),n==="json"?t.JSON:t.Text}t.fromString=e})(Kr=Oe.TraceFormat||(Oe.TraceFormat={}));var m_;(function(t){t.type=new De.NotificationType("$/setTrace")})(m_=Oe.SetTraceNotification||(Oe.SetTraceNotification={}));var Tp;(function(t){t.type=new De.NotificationType("$/logTrace")})(Tp=Oe.LogTraceNotification||(Oe.LogTraceNotification={}));var yu;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(yu=Oe.ConnectionErrors||(Oe.ConnectionErrors={}));var ks=class extends Error{constructor(e,n){super(n);this.code=e,Object.setPrototypeOf(this,ks.prototype)}};Oe.ConnectionError=ks;var g_;(function(t){function e(n){let r=n;return r&&nn.func(r.cancelUndispatched)}t.is=e})(g_=Oe.ConnectionStrategy||(Oe.ConnectionStrategy={}));var vp;(function(t){t.Message=Object.freeze({createCancellationTokenSource(n){return new yp.CancellationTokenSource}});function e(n){let r=n;return r&&nn.func(r.createCancellationTokenSource)}t.is=e})(vp=Oe.CancellationReceiverStrategy||(Oe.CancellationReceiverStrategy={}));var Np;(function(t){t.Message=Object.freeze({sendCancellation(n,r){n.sendNotification(Jo.type,{id:r})},cleanup(n){}});function e(n){let r=n;return r&&nn.func(r.sendCancellation)&&nn.func(r.cleanup)}t.is=e})(Np=Oe.CancellationSenderStrategy||(Oe.CancellationSenderStrategy={}));var Cp;(function(t){t.Message=Object.freeze({receiver:vp.Message,sender:Np.Message});function e(n){let r=n;return r&&vp.is(r.receiver)&&Np.is(r.sender)}t.is=e})(Cp=Oe.CancellationStrategy||(Oe.CancellationStrategy={}));var GS;(function(t){function e(n){let r=n;return r&&(Cp.is(r.cancellationStrategy)||g_.is(r.connectionStrategy))}t.is=e})(GS=Oe.ConnectionOptions||(Oe.ConnectionOptions={}));var zr;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(zr||(zr={}));function YS(t,e,n,r){let i=n!==void 0?n:Oe.NullLogger,s=0,a=0,o=0,l="2.0",u,c=Object.create(null),f,h=Object.create(null),y=new Map,p,d=new d_.LinkedMap,g=Object.create(null),m=Object.create(null),b=Vt.Off,_=Kr.Text,N,C=zr.New,G=new Qo.Emitter,L=new Qo.Emitter,M=new Qo.Emitter,$=new Qo.Emitter,K=new Qo.Emitter,ne=r&&r.cancellationStrategy?r.cancellationStrategy:Cp.Message;function re(x){if(x===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+x.toString()}function ye(x){return x===null?"res-unknown-"+(++o).toString():"res-"+x.toString()}function Ce(){return"not-"+(++a).toString()}function ae(x,I){De.isRequestMessage(I)?x.set(re(I.id),I):De.isResponseMessage(I)?x.set(ye(I.id),I):x.set(Ce(),I)}function Pe(x){}function ct(){return C===zr.Listening}function Jt(){return C===zr.Closed}function Je(){return C===zr.Disposed}function ft(){(C===zr.New||C===zr.Listening)&&(C=zr.Closed,L.fire(void 0))}function pe(x){G.fire([x,void 0,void 0])}function Re(x){G.fire(x)}t.onClose(ft),t.onError(pe),e.onClose(ft),e.onError(Re);function Ge(){p||d.size===0||(p=p_.default().timer.setImmediate(()=>{p=void 0,J()}))}function J(){if(d.size===0)return;let x=d.shift();try{De.isRequestMessage(x)?st(x):De.isNotificationMessage(x)?vn(x):De.isResponseMessage(x)?Dt(x):Ai(x)}finally{Ge()}}let pt=x=>{try{if(De.isNotificationMessage(x)&&x.method===Jo.type.method){let I=re(x.params.id),v=d.get(I);if(De.isRequestMessage(v)){let D=r==null?void 0:r.connectionStrategy,O=D&&D.cancelUndispatched?D.cancelUndispatched(v,Pe):void 0;if(O&&(O.error!==void 0||O.result!==void 0)){d.delete(I),O.id=v.id,$i(O,x.method,Date.now()),e.write(O);return}}}ae(d,x)}finally{Ge()}};function st(x){if(Je())return;function I(j,fe,ve){let Ve={jsonrpc:l,id:x.id};j instanceof De.ResponseError?Ve.error=j.toJson():Ve.result=j===void 0?null:j,$i(Ve,fe,ve),e.write(Ve)}function v(j,fe,ve){let Ve={jsonrpc:l,id:x.id,error:j.toJson()};$i(Ve,fe,ve),e.write(Ve)}function D(j,fe,ve){j===void 0&&(j=null);let Ve={jsonrpc:l,id:x.id,result:j};$i(Ve,fe,ve),e.write(Ve)}Gn(x);let O=c[x.method],A,T;O&&(A=O.type,T=O.handler);let F=Date.now();if(T||u){let j=String(x.id),fe=ne.receiver.createCancellationTokenSource(j);m[j]=fe;try{let ve;if(T)if(x.params===void 0){if(A!==void 0&&A.numberOfParams!==0){v(new De.ResponseError(De.ErrorCodes.InvalidParams,`Request ${x.method} defines ${A.numberOfParams} params but recevied none.`),x.method,F);return}ve=T(fe.token)}else if(Array.isArray(x.params)){if(A!==void 0&&A.parameterStructures===De.ParameterStructures.byName){v(new De.ResponseError(De.ErrorCodes.InvalidParams,`Request ${x.method} defines parameters by name but received parameters by position`),x.method,F);return}ve=T(...x.params,fe.token)}else{if(A!==void 0&&A.parameterStructures===De.ParameterStructures.byPosition){v(new De.ResponseError(De.ErrorCodes.InvalidParams,`Request ${x.method} defines parameters by position but received parameters by name`),x.method,F);return}ve=T(x.params,fe.token)}else u&&(ve=u(x.method,x.params,fe.token));let Ve=ve;ve?Ve.then?Ve.then(dt=>{delete m[j],I(dt,x.method,F)},dt=>{delete m[j],dt instanceof De.ResponseError?v(dt,x.method,F):dt&&nn.string(dt.message)?v(new De.ResponseError(De.ErrorCodes.InternalError,`Request ${x.method} failed with message: ${dt.message}`),x.method,F):v(new De.ResponseError(De.ErrorCodes.InternalError,`Request ${x.method} failed unexpectedly without providing any details.`),x.method,F)}):(delete m[j],I(ve,x.method,F)):(delete m[j],D(ve,x.method,F))}catch(ve){delete m[j],ve instanceof De.ResponseError?I(ve,x.method,F):ve&&nn.string(ve.message)?v(new De.ResponseError(De.ErrorCodes.InternalError,`Request ${x.method} failed with message: ${ve.message}`),x.method,F):v(new De.ResponseError(De.ErrorCodes.InternalError,`Request ${x.method} failed unexpectedly without providing any details.`),x.method,F)}}else v(new De.ResponseError(De.ErrorCodes.MethodNotFound,`Unhandled method ${x.method}`),x.method,F)}function Dt(x){if(!Je())if(x.id===null)x.error?i.error(`Received response message without id: Error is: +${JSON.stringify(x.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let I=String(x.id),v=g[I];if(R(x,v),v){delete g[I];try{if(x.error){let D=x.error;v.reject(new De.ResponseError(D.code,D.message,D.data))}else if(x.result!==void 0)v.resolve(x.result);else throw new Error("Should never happen.")}catch(D){D.message?i.error(`Response handler '${v.method}' failed with message: ${D.message}`):i.error(`Response handler '${v.method}' failed unexpectedly.`)}}}}function vn(x){if(Je())return;let I,v;if(x.method===Jo.type.method)v=D=>{let O=D.id,A=m[String(O)];A&&A.cancel()};else{let D=h[x.method];D&&(v=D.handler,I=D.type)}if(v||f)try{Mo(x),v?x.params===void 0?(I!==void 0&&I.numberOfParams!==0&&I.parameterStructures!==De.ParameterStructures.byName&&i.error(`Notification ${x.method} defines ${I.numberOfParams} params but recevied none.`),v()):Array.isArray(x.params)?(I!==void 0&&(I.parameterStructures===De.ParameterStructures.byName&&i.error(`Notification ${x.method} defines parameters by name but received parameters by position`),I.numberOfParams!==x.params.length&&i.error(`Notification ${x.method} defines ${I.numberOfParams} params but received ${x.params.length} argumennts`)),v(...x.params)):(I!==void 0&&I.parameterStructures===De.ParameterStructures.byPosition&&i.error(`Notification ${x.method} defines parameters by position but received parameters by name`),v(x.params)):f&&f(x.method,x.params)}catch(D){D.message?i.error(`Notification handler '${x.method}' failed with message: ${D.message}`):i.error(`Notification handler '${x.method}' failed unexpectedly.`)}else M.fire(x)}function Ai(x){if(!x){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message: ${JSON.stringify(x,null,4)}`);let I=x;if(nn.string(I.id)||nn.number(I.id)){let v=String(I.id),D=g[v];D&&D.reject(new Error("The received response has neither a result nor an error property."))}}function ui(x){if(!(b===Vt.Off||!N))if(_===Kr.Text){let I;b===Vt.Verbose&&x.params&&(I=`Params: ${JSON.stringify(x.params,null,4)} `),N.log(`Sending request '${x.method} - (${x.id})'.`,I)}else B("send-request",x)}function ko(x){if(!(b===Vt.Off||!N))if(_===Kr.Text){let I;b===Vt.Verbose&&(x.params?I=`Params: ${JSON.stringify(x.params,null,4)} @@ -27,14 +27,14 @@ ${JSON.stringify(x,null,4)}`);let I=x;if(nn.string(I.id)||nn.number(I.id)){let v `:x.error===void 0&&(v=`No result returned. -`)),I){let D=x.error?` Request failed: ${x.error.message} (${x.error.code}).`:"";N.log(`Received response '${I.method} - (${x.id})' in ${Date.now()-I.timerStart}ms.${D}`,v)}else N.log(`Received response ${x.id} without active response promise.`,v)}else B("receive-response",x)}function B(x,I){if(!N||b===Vt.Off)return;let v={isLSPMessage:!0,type:x,message:I,timestamp:Date.now()};N.log(v)}function te(){if(Jt())throw new ks(yu.Closed,"Connection is closed.");if(Je())throw new ks(yu.Disposed,"Connection is disposed.")}function Y(){if(ct())throw new ks(yu.AlreadyListening,"Connection is already listening")}function k(){if(!ct())throw new Error("Call listen() first.")}function ce(x){return x===void 0?null:x}function le(x){if(x!==null)return x}function me(x){return x!=null&&!Array.isArray(x)&&typeof x=="object"}function bt(x,I){switch(x){case De.ParameterStructures.auto:return me(I)?le(I):[ce(I)];case De.ParameterStructures.byName:if(!me(I))throw new Error("Recevied parameters by name but param is not an object literal.");return le(I);case De.ParameterStructures.byPosition:return[ce(I)];default:throw new Error(`Unknown parameter structure ${x.toString()}`)}}function kt(x,I){let v,D=x.numberOfParams;switch(D){case 0:v=void 0;break;case 1:v=bt(x.parameterStructures,I[0]);break;default:v=[];for(let O=0;O{te();let v,D;if(nn.string(x)){v=x;let S=I[0],T=0,F=De.ParameterStructures.auto;De.ParameterStructures.is(S)&&(T=1,F=S);let j=I.length,fe=j-T;switch(fe){case 0:D=void 0;break;case 1:D=bt(F,I[T]);break;default:if(F===De.ParameterStructures.byName)throw new Error(`Recevied ${fe} parameters for 'by Name' notification parameter structure.`);D=I.slice(T,j).map(ve=>ce(ve));break}}else{let S=I;v=x.method,D=kt(x,S)}let O={jsonrpc:l,method:v,params:D};ko(O),e.write(O)},onNotification:(x,I)=>{te();let v;return nn.func(x)?f=x:I&&(nn.string(x)?(v=x,h[x]={type:void 0,handler:I}):(v=x.method,h[x.method]={type:x,handler:I})),{dispose:()=>{v!==void 0?delete h[v]:f=void 0}}},onProgress:(x,I,v)=>{if(y.has(I))throw new Error(`Progress handler for token ${I} already registered`);return y.set(I,v),{dispose:()=>{y.delete(I)}}},sendProgress:(x,I,v)=>{Ki.sendNotification(_u.type,{token:I,value:v})},onUnhandledProgress:$.event,sendRequest:(x,...I)=>{te(),k();let v,D,O;if(nn.string(x)){v=x;let j=I[0],fe=I[I.length-1],ve=0,Ve=De.ParameterStructures.auto;De.ParameterStructures.is(j)&&(ve=1,Ve=j);let dt=I.length;yp.CancellationToken.is(fe)&&(dt=dt-1,O=fe);let Yt=dt-ve;switch(Yt){case 0:D=void 0;break;case 1:D=bt(Ve,I[ve]);break;default:if(Ve===De.ParameterStructures.byName)throw new Error(`Recevied ${Yt} parameters for 'by Name' request parameter structure.`);D=I.slice(ve,dt).map(Zt=>ce(Zt));break}}else{let j=I;v=x.method,D=kt(x,j);let fe=x.numberOfParams;O=yp.CancellationToken.is(j[fe])?j[fe]:void 0}let S=s++,T;return O&&(T=O.onCancellationRequested(()=>{ne.sender.sendCancellation(Ki,S)})),new Promise((j,fe)=>{let ve={jsonrpc:l,id:S,method:v,params:D},Ve=Zt=>{j(Zt),ne.sender.cleanup(S),T==null||T.dispose()},dt=Zt=>{fe(Zt),ne.sender.cleanup(S),T==null||T.dispose()},Yt={method:v,timerStart:Date.now(),resolve:Ve,reject:dt};ui(ve);try{e.write(ve)}catch(Zt){Yt.reject(new De.ResponseError(De.ErrorCodes.MessageWriteError,Zt.message?Zt.message:"Unknown reason")),Yt=null}Yt&&(g[String(S)]=Yt)})},onRequest:(x,I)=>{te();let v=null;return bp.is(x)?(v=void 0,u=x):nn.string(x)?(v=null,I!==void 0&&(v=x,c[x]={handler:I,type:void 0})):I!==void 0&&(v=x.method,c[x.method]={type:x,handler:I}),{dispose:()=>{v!==null&&(v!==void 0?delete c[v]:u=void 0)}}},trace:(x,I,v)=>{let D=!1,O=Kr.Text;v!==void 0&&(nn.boolean(v)?D=v:(D=v.sendNotification||!1,O=v.traceFormat||Kr.Text)),b=x,_=O,b===Vt.Off?N=void 0:N=I,D&&!Jt()&&!Je()&&Ki.sendNotification(m_.type,{value:Vt.toString(x)})},onError:G.event,onClose:L.event,onUnhandledNotification:M.event,onDispose:K.event,end:()=>{e.end()},dispose:()=>{if(Je())return;C=zr.Disposed,K.fire(void 0);let x=new Error("Connection got disposed.");Object.keys(g).forEach(I=>{g[I].reject(x)}),g=Object.create(null),m=Object.create(null),d=new d_.LinkedMap,nn.func(e.dispose)&&e.dispose(),nn.func(t.dispose)&&t.dispose()},listen:()=>{te(),Y(),C=zr.Listening,t.listen(pt)},inspect:()=>{p_.default().console.log("inspect")}};return Ki.onNotification(Tp.type,x=>{b===Vt.Off||!N||N.log(x.message,b===Vt.Verbose?x.verbose:void 0)}),Ki.onNotification(_u.type,x=>{let I=y.get(x.token);I?I(x.value):$.fire(x)}),Ki}Oe.createMessageConnection=GA});var Sp=X(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.CancellationSenderStrategy=Q.CancellationReceiverStrategy=Q.ConnectionError=Q.ConnectionErrors=Q.LogTraceNotification=Q.SetTraceNotification=Q.TraceFormat=Q.Trace=Q.ProgressType=Q.createMessageConnection=Q.NullLogger=Q.ConnectionOptions=Q.ConnectionStrategy=Q.WriteableStreamMessageWriter=Q.AbstractMessageWriter=Q.MessageWriter=Q.ReadableStreamMessageReader=Q.AbstractMessageReader=Q.MessageReader=Q.CancellationToken=Q.CancellationTokenSource=Q.Emitter=Q.Event=Q.Disposable=Q.ParameterStructures=Q.NotificationType9=Q.NotificationType8=Q.NotificationType7=Q.NotificationType6=Q.NotificationType5=Q.NotificationType4=Q.NotificationType3=Q.NotificationType2=Q.NotificationType1=Q.NotificationType0=Q.NotificationType=Q.ErrorCodes=Q.ResponseError=Q.RequestType9=Q.RequestType8=Q.RequestType7=Q.RequestType6=Q.RequestType5=Q.RequestType4=Q.RequestType3=Q.RequestType2=Q.RequestType1=Q.RequestType0=Q.RequestType=Q.RAL=void 0;Q.CancellationStrategy=void 0;var _t=op();Object.defineProperty(Q,"RequestType",{enumerable:!0,get:function(){return _t.RequestType}});Object.defineProperty(Q,"RequestType0",{enumerable:!0,get:function(){return _t.RequestType0}});Object.defineProperty(Q,"RequestType1",{enumerable:!0,get:function(){return _t.RequestType1}});Object.defineProperty(Q,"RequestType2",{enumerable:!0,get:function(){return _t.RequestType2}});Object.defineProperty(Q,"RequestType3",{enumerable:!0,get:function(){return _t.RequestType3}});Object.defineProperty(Q,"RequestType4",{enumerable:!0,get:function(){return _t.RequestType4}});Object.defineProperty(Q,"RequestType5",{enumerable:!0,get:function(){return _t.RequestType5}});Object.defineProperty(Q,"RequestType6",{enumerable:!0,get:function(){return _t.RequestType6}});Object.defineProperty(Q,"RequestType7",{enumerable:!0,get:function(){return _t.RequestType7}});Object.defineProperty(Q,"RequestType8",{enumerable:!0,get:function(){return _t.RequestType8}});Object.defineProperty(Q,"RequestType9",{enumerable:!0,get:function(){return _t.RequestType9}});Object.defineProperty(Q,"ResponseError",{enumerable:!0,get:function(){return _t.ResponseError}});Object.defineProperty(Q,"ErrorCodes",{enumerable:!0,get:function(){return _t.ErrorCodes}});Object.defineProperty(Q,"NotificationType",{enumerable:!0,get:function(){return _t.NotificationType}});Object.defineProperty(Q,"NotificationType0",{enumerable:!0,get:function(){return _t.NotificationType0}});Object.defineProperty(Q,"NotificationType1",{enumerable:!0,get:function(){return _t.NotificationType1}});Object.defineProperty(Q,"NotificationType2",{enumerable:!0,get:function(){return _t.NotificationType2}});Object.defineProperty(Q,"NotificationType3",{enumerable:!0,get:function(){return _t.NotificationType3}});Object.defineProperty(Q,"NotificationType4",{enumerable:!0,get:function(){return _t.NotificationType4}});Object.defineProperty(Q,"NotificationType5",{enumerable:!0,get:function(){return _t.NotificationType5}});Object.defineProperty(Q,"NotificationType6",{enumerable:!0,get:function(){return _t.NotificationType6}});Object.defineProperty(Q,"NotificationType7",{enumerable:!0,get:function(){return _t.NotificationType7}});Object.defineProperty(Q,"NotificationType8",{enumerable:!0,get:function(){return _t.NotificationType8}});Object.defineProperty(Q,"NotificationType9",{enumerable:!0,get:function(){return _t.NotificationType9}});Object.defineProperty(Q,"ParameterStructures",{enumerable:!0,get:function(){return _t.ParameterStructures}});var YA=ip();Object.defineProperty(Q,"Disposable",{enumerable:!0,get:function(){return YA.Disposable}});var y_=Pa();Object.defineProperty(Q,"Event",{enumerable:!0,get:function(){return y_.Event}});Object.defineProperty(Q,"Emitter",{enumerable:!0,get:function(){return y_.Emitter}});var b_=fp();Object.defineProperty(Q,"CancellationTokenSource",{enumerable:!0,get:function(){return b_.CancellationTokenSource}});Object.defineProperty(Q,"CancellationToken",{enumerable:!0,get:function(){return b_.CancellationToken}});var Pp=n_();Object.defineProperty(Q,"MessageReader",{enumerable:!0,get:function(){return Pp.MessageReader}});Object.defineProperty(Q,"AbstractMessageReader",{enumerable:!0,get:function(){return Pp.AbstractMessageReader}});Object.defineProperty(Q,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return Pp.ReadableStreamMessageReader}});var Ap=u_();Object.defineProperty(Q,"MessageWriter",{enumerable:!0,get:function(){return Ap.MessageWriter}});Object.defineProperty(Q,"AbstractMessageWriter",{enumerable:!0,get:function(){return Ap.AbstractMessageWriter}});Object.defineProperty(Q,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return Ap.WriteableStreamMessageWriter}});var Mn=__();Object.defineProperty(Q,"ConnectionStrategy",{enumerable:!0,get:function(){return Mn.ConnectionStrategy}});Object.defineProperty(Q,"ConnectionOptions",{enumerable:!0,get:function(){return Mn.ConnectionOptions}});Object.defineProperty(Q,"NullLogger",{enumerable:!0,get:function(){return Mn.NullLogger}});Object.defineProperty(Q,"createMessageConnection",{enumerable:!0,get:function(){return Mn.createMessageConnection}});Object.defineProperty(Q,"ProgressType",{enumerable:!0,get:function(){return Mn.ProgressType}});Object.defineProperty(Q,"Trace",{enumerable:!0,get:function(){return Mn.Trace}});Object.defineProperty(Q,"TraceFormat",{enumerable:!0,get:function(){return Mn.TraceFormat}});Object.defineProperty(Q,"SetTraceNotification",{enumerable:!0,get:function(){return Mn.SetTraceNotification}});Object.defineProperty(Q,"LogTraceNotification",{enumerable:!0,get:function(){return Mn.LogTraceNotification}});Object.defineProperty(Q,"ConnectionErrors",{enumerable:!0,get:function(){return Mn.ConnectionErrors}});Object.defineProperty(Q,"ConnectionError",{enumerable:!0,get:function(){return Mn.ConnectionError}});Object.defineProperty(Q,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Mn.CancellationReceiverStrategy}});Object.defineProperty(Q,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Mn.CancellationSenderStrategy}});Object.defineProperty(Q,"CancellationStrategy",{enumerable:!0,get:function(){return Mn.CancellationStrategy}});var HA=wi();Q.RAL=HA.default});var Da=X(Ze=>{"use strict";var $A=Ze&&Ze.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),KA=Ze&&Ze.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&$A(e,t,n)};Object.defineProperty(Ze,"__esModule",{value:!0});Ze.createMessageConnection=Ze.createServerSocketTransport=Ze.createClientSocketTransport=Ze.createServerPipeTransport=Ze.createClientPipeTransport=Ze.generateRandomPipeName=Ze.StreamMessageWriter=Ze.StreamMessageReader=Ze.SocketMessageWriter=Ze.SocketMessageReader=Ze.IPCMessageWriter=Ze.IPCMessageReader=void 0;var Sa=Sg();Sa.default.install();var gi=Sp(),T_=require("path"),zA=require("os"),XA=require("crypto"),bu=require("net");KA(Sp(),Ze);var v_=class extends gi.AbstractMessageReader{constructor(e){super();this.process=e;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),gi.Disposable.create(()=>this.process.off("message",e))}};Ze.IPCMessageReader=v_;var N_=class extends gi.AbstractMessageWriter{constructor(e){super();this.process=e,this.errorCount=0;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,n=>{n?(this.errorCount++,this.handleError(n,e)):this.errorCount=0}),Promise.resolve()}catch(n){return this.handleError(n,e),Promise.reject(n)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){}};Ze.IPCMessageWriter=N_;var Ea=class extends gi.ReadableStreamMessageReader{constructor(e,n="utf-8"){super(Sa.default().stream.asReadableStream(e),n)}};Ze.SocketMessageReader=Ea;var Ia=class extends gi.WriteableStreamMessageWriter{constructor(e,n){super(Sa.default().stream.asWritableStream(e),n);this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};Ze.SocketMessageWriter=Ia;var Ep=class extends gi.ReadableStreamMessageReader{constructor(e,n){super(Sa.default().stream.asReadableStream(e),n)}};Ze.StreamMessageReader=Ep;var Ip=class extends gi.WriteableStreamMessageWriter{constructor(e,n){super(Sa.default().stream.asWritableStream(e),n)}};Ze.StreamMessageWriter=Ip;var C_=process.env.XDG_RUNTIME_DIR,QA=new Map([["linux",107],["darwin",103]]);function JA(){let t=XA.randomBytes(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;C_?e=T_.join(C_,`vscode-ipc-${t}.sock`):e=T_.join(zA.tmpdir(),`vscode-${t}.sock`);let n=QA.get(process.platform);return n!==void 0&&e.length>=n&&Sa.default().console.warn(`WARNING: IPC handle "${e}" is longer than ${n} characters.`),e}Ze.generateRandomPipeName=JA;function ZA(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let a=bu.createServer(o=>{a.close(),n([new Ea(o,e),new Ia(o,e)])});a.on("error",s),a.listen(t,()=>{a.removeListener("error",s),i({onConnected:()=>r})})})}Ze.createClientPipeTransport=ZA;function eS(t,e="utf-8"){let n=bu.createConnection(t);return[new Ea(n,e),new Ia(n,e)]}Ze.createServerPipeTransport=eS;function tS(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let a=bu.createServer(o=>{a.close(),n([new Ea(o,e),new Ia(o,e)])});a.on("error",s),a.listen(t,"127.0.0.1",()=>{a.removeListener("error",s),i({onConnected:()=>r})})})}Ze.createClientSocketTransport=tS;function nS(t,e="utf-8"){let n=bu.createConnection(t,"127.0.0.1");return[new Ea(n,e),new Ia(n,e)]}Ze.createServerSocketTransport=nS;function rS(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function iS(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function sS(t,e,n,r){n||(n=gi.NullLogger);let i=rS(t)?new Ep(t):t,s=iS(e)?new Ip(e):e;return gi.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),gi.createMessageConnection(i,s,n,r)}Ze.createMessageConnection=sS});var Dp=X((w2,P_)=>{"use strict";P_.exports=Da()});var vt=X((A_,Tu)=>{(function(t){if(typeof Tu=="object"&&typeof Tu.exports=="object"){var e=t(require,A_);e!==void 0&&(Tu.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],t)})(function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=e.EOL=e.SelectionRange=e.DocumentLink=e.FormattingOptions=e.CodeLens=e.CodeAction=e.CodeActionContext=e.CodeActionKind=e.DocumentSymbol=e.SymbolInformation=e.SymbolTag=e.SymbolKind=e.DocumentHighlight=e.DocumentHighlightKind=e.SignatureInformation=e.ParameterInformation=e.Hover=e.MarkedString=e.CompletionList=e.CompletionItem=e.InsertTextMode=e.InsertReplaceEdit=e.CompletionItemTag=e.InsertTextFormat=e.CompletionItemKind=e.MarkupContent=e.MarkupKind=e.TextDocumentItem=e.OptionalVersionedTextDocumentIdentifier=e.VersionedTextDocumentIdentifier=e.TextDocumentIdentifier=e.WorkspaceChange=e.WorkspaceEdit=e.DeleteFile=e.RenameFile=e.CreateFile=e.TextDocumentEdit=e.AnnotatedTextEdit=e.ChangeAnnotationIdentifier=e.ChangeAnnotation=e.TextEdit=e.Command=e.Diagnostic=e.CodeDescription=e.DiagnosticTag=e.DiagnosticSeverity=e.DiagnosticRelatedInformation=e.FoldingRange=e.FoldingRangeKind=e.ColorPresentation=e.ColorInformation=e.Color=e.LocationLink=e.Location=e.Range=e.Position=e.uinteger=e.integer=void 0;var n;(function(v){v.MIN_VALUE=-2147483648,v.MAX_VALUE=2147483647})(n=e.integer||(e.integer={}));var r;(function(v){v.MIN_VALUE=0,v.MAX_VALUE=2147483647})(r=e.uinteger||(e.uinteger={}));var i;(function(v){function D(S,T){return S===Number.MAX_VALUE&&(S=r.MAX_VALUE),T===Number.MAX_VALUE&&(T=r.MAX_VALUE),{line:S,character:T}}v.create=D;function O(S){var T=S;return I.objectLiteral(T)&&I.uinteger(T.line)&&I.uinteger(T.character)}v.is=O})(i=e.Position||(e.Position={}));var s;(function(v){function D(S,T,F,j){if(I.uinteger(S)&&I.uinteger(T)&&I.uinteger(F)&&I.uinteger(j))return{start:i.create(S,T),end:i.create(F,j)};if(i.is(S)&&i.is(T))return{start:S,end:T};throw new Error("Range#create called with invalid arguments["+S+", "+T+", "+F+", "+j+"]")}v.create=D;function O(S){var T=S;return I.objectLiteral(T)&&i.is(T.start)&&i.is(T.end)}v.is=O})(s=e.Range||(e.Range={}));var a;(function(v){function D(S,T){return{uri:S,range:T}}v.create=D;function O(S){var T=S;return I.defined(T)&&s.is(T.range)&&(I.string(T.uri)||I.undefined(T.uri))}v.is=O})(a=e.Location||(e.Location={}));var o;(function(v){function D(S,T,F,j){return{targetUri:S,targetRange:T,targetSelectionRange:F,originSelectionRange:j}}v.create=D;function O(S){var T=S;return I.defined(T)&&s.is(T.targetRange)&&I.string(T.targetUri)&&(s.is(T.targetSelectionRange)||I.undefined(T.targetSelectionRange))&&(s.is(T.originSelectionRange)||I.undefined(T.originSelectionRange))}v.is=O})(o=e.LocationLink||(e.LocationLink={}));var l;(function(v){function D(S,T,F,j){return{red:S,green:T,blue:F,alpha:j}}v.create=D;function O(S){var T=S;return I.numberRange(T.red,0,1)&&I.numberRange(T.green,0,1)&&I.numberRange(T.blue,0,1)&&I.numberRange(T.alpha,0,1)}v.is=O})(l=e.Color||(e.Color={}));var u;(function(v){function D(S,T){return{range:S,color:T}}v.create=D;function O(S){var T=S;return s.is(T.range)&&l.is(T.color)}v.is=O})(u=e.ColorInformation||(e.ColorInformation={}));var c;(function(v){function D(S,T,F){return{label:S,textEdit:T,additionalTextEdits:F}}v.create=D;function O(S){var T=S;return I.string(T.label)&&(I.undefined(T.textEdit)||_.is(T))&&(I.undefined(T.additionalTextEdits)||I.typedArray(T.additionalTextEdits,_.is))}v.is=O})(c=e.ColorPresentation||(e.ColorPresentation={}));var f;(function(v){v.Comment="comment",v.Imports="imports",v.Region="region"})(f=e.FoldingRangeKind||(e.FoldingRangeKind={}));var h;(function(v){function D(S,T,F,j,fe){var ve={startLine:S,endLine:T};return I.defined(F)&&(ve.startCharacter=F),I.defined(j)&&(ve.endCharacter=j),I.defined(fe)&&(ve.kind=fe),ve}v.create=D;function O(S){var T=S;return I.uinteger(T.startLine)&&I.uinteger(T.startLine)&&(I.undefined(T.startCharacter)||I.uinteger(T.startCharacter))&&(I.undefined(T.endCharacter)||I.uinteger(T.endCharacter))&&(I.undefined(T.kind)||I.string(T.kind))}v.is=O})(h=e.FoldingRange||(e.FoldingRange={}));var y;(function(v){function D(S,T){return{location:S,message:T}}v.create=D;function O(S){var T=S;return I.defined(T)&&a.is(T.location)&&I.string(T.message)}v.is=O})(y=e.DiagnosticRelatedInformation||(e.DiagnosticRelatedInformation={}));var p;(function(v){v.Error=1,v.Warning=2,v.Information=3,v.Hint=4})(p=e.DiagnosticSeverity||(e.DiagnosticSeverity={}));var d;(function(v){v.Unnecessary=1,v.Deprecated=2})(d=e.DiagnosticTag||(e.DiagnosticTag={}));var g;(function(v){function D(O){var S=O;return S!=null&&I.string(S.href)}v.is=D})(g=e.CodeDescription||(e.CodeDescription={}));var m;(function(v){function D(S,T,F,j,fe,ve){var Ve={range:S,message:T};return I.defined(F)&&(Ve.severity=F),I.defined(j)&&(Ve.code=j),I.defined(fe)&&(Ve.source=fe),I.defined(ve)&&(Ve.relatedInformation=ve),Ve}v.create=D;function O(S){var T,F=S;return I.defined(F)&&s.is(F.range)&&I.string(F.message)&&(I.number(F.severity)||I.undefined(F.severity))&&(I.integer(F.code)||I.string(F.code)||I.undefined(F.code))&&(I.undefined(F.codeDescription)||I.string((T=F.codeDescription)===null||T===void 0?void 0:T.href))&&(I.string(F.source)||I.undefined(F.source))&&(I.undefined(F.relatedInformation)||I.typedArray(F.relatedInformation,y.is))}v.is=O})(m=e.Diagnostic||(e.Diagnostic={}));var b;(function(v){function D(S,T){for(var F=[],j=2;j0&&(fe.arguments=F),fe}v.create=D;function O(S){var T=S;return I.defined(T)&&I.string(T.title)&&I.string(T.command)}v.is=O})(b=e.Command||(e.Command={}));var _;(function(v){function D(F,j){return{range:F,newText:j}}v.replace=D;function O(F,j){return{range:{start:F,end:F},newText:j}}v.insert=O;function S(F){return{range:F,newText:""}}v.del=S;function T(F){var j=F;return I.objectLiteral(j)&&I.string(j.newText)&&s.is(j.range)}v.is=T})(_=e.TextEdit||(e.TextEdit={}));var N;(function(v){function D(S,T,F){var j={label:S};return T!==void 0&&(j.needsConfirmation=T),F!==void 0&&(j.description=F),j}v.create=D;function O(S){var T=S;return T!==void 0&&I.objectLiteral(T)&&I.string(T.label)&&(I.boolean(T.needsConfirmation)||T.needsConfirmation===void 0)&&(I.string(T.description)||T.description===void 0)}v.is=O})(N=e.ChangeAnnotation||(e.ChangeAnnotation={}));var C;(function(v){function D(O){var S=O;return typeof S=="string"}v.is=D})(C=e.ChangeAnnotationIdentifier||(e.ChangeAnnotationIdentifier={}));var G;(function(v){function D(F,j,fe){return{range:F,newText:j,annotationId:fe}}v.replace=D;function O(F,j,fe){return{range:{start:F,end:F},newText:j,annotationId:fe}}v.insert=O;function S(F,j){return{range:F,newText:"",annotationId:j}}v.del=S;function T(F){var j=F;return _.is(j)&&(N.is(j.annotationId)||C.is(j.annotationId))}v.is=T})(G=e.AnnotatedTextEdit||(e.AnnotatedTextEdit={}));var L;(function(v){function D(S,T){return{textDocument:S,edits:T}}v.create=D;function O(S){var T=S;return I.defined(T)&&ct.is(T.textDocument)&&Array.isArray(T.edits)}v.is=O})(L=e.TextDocumentEdit||(e.TextDocumentEdit={}));var M;(function(v){function D(S,T,F){var j={kind:"create",uri:S};return T!==void 0&&(T.overwrite!==void 0||T.ignoreIfExists!==void 0)&&(j.options=T),F!==void 0&&(j.annotationId=F),j}v.create=D;function O(S){var T=S;return T&&T.kind==="create"&&I.string(T.uri)&&(T.options===void 0||(T.options.overwrite===void 0||I.boolean(T.options.overwrite))&&(T.options.ignoreIfExists===void 0||I.boolean(T.options.ignoreIfExists)))&&(T.annotationId===void 0||C.is(T.annotationId))}v.is=O})(M=e.CreateFile||(e.CreateFile={}));var $;(function(v){function D(S,T,F,j){var fe={kind:"rename",oldUri:S,newUri:T};return F!==void 0&&(F.overwrite!==void 0||F.ignoreIfExists!==void 0)&&(fe.options=F),j!==void 0&&(fe.annotationId=j),fe}v.create=D;function O(S){var T=S;return T&&T.kind==="rename"&&I.string(T.oldUri)&&I.string(T.newUri)&&(T.options===void 0||(T.options.overwrite===void 0||I.boolean(T.options.overwrite))&&(T.options.ignoreIfExists===void 0||I.boolean(T.options.ignoreIfExists)))&&(T.annotationId===void 0||C.is(T.annotationId))}v.is=O})($=e.RenameFile||(e.RenameFile={}));var K;(function(v){function D(S,T,F){var j={kind:"delete",uri:S};return T!==void 0&&(T.recursive!==void 0||T.ignoreIfNotExists!==void 0)&&(j.options=T),F!==void 0&&(j.annotationId=F),j}v.create=D;function O(S){var T=S;return T&&T.kind==="delete"&&I.string(T.uri)&&(T.options===void 0||(T.options.recursive===void 0||I.boolean(T.options.recursive))&&(T.options.ignoreIfNotExists===void 0||I.boolean(T.options.ignoreIfNotExists)))&&(T.annotationId===void 0||C.is(T.annotationId))}v.is=O})(K=e.DeleteFile||(e.DeleteFile={}));var ne;(function(v){function D(O){var S=O;return S&&(S.changes!==void 0||S.documentChanges!==void 0)&&(S.documentChanges===void 0||S.documentChanges.every(function(T){return I.string(T.kind)?M.is(T)||$.is(T)||K.is(T):L.is(T)}))}v.is=D})(ne=e.WorkspaceEdit||(e.WorkspaceEdit={}));var re=function(){function v(D,O){this.edits=D,this.changeAnnotations=O}return v.prototype.insert=function(D,O,S){var T,F;if(S===void 0?T=_.insert(D,O):C.is(S)?(F=S,T=G.insert(D,O,S)):(this.assertChangeAnnotations(this.changeAnnotations),F=this.changeAnnotations.manage(S),T=G.insert(D,O,F)),this.edits.push(T),F!==void 0)return F},v.prototype.replace=function(D,O,S){var T,F;if(S===void 0?T=_.replace(D,O):C.is(S)?(F=S,T=G.replace(D,O,S)):(this.assertChangeAnnotations(this.changeAnnotations),F=this.changeAnnotations.manage(S),T=G.replace(D,O,F)),this.edits.push(T),F!==void 0)return F},v.prototype.delete=function(D,O){var S,T;if(O===void 0?S=_.del(D):C.is(O)?(T=O,S=G.del(D,O)):(this.assertChangeAnnotations(this.changeAnnotations),T=this.changeAnnotations.manage(O),S=G.del(D,T)),this.edits.push(S),T!==void 0)return T},v.prototype.add=function(D){this.edits.push(D)},v.prototype.all=function(){return this.edits},v.prototype.clear=function(){this.edits.splice(0,this.edits.length)},v.prototype.assertChangeAnnotations=function(D){if(D===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},v}(),ye=function(){function v(D){this._annotations=D===void 0?Object.create(null):D,this._counter=0,this._size=0}return v.prototype.all=function(){return this._annotations},Object.defineProperty(v.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),v.prototype.manage=function(D,O){var S;if(C.is(D)?S=D:(S=this.nextId(),O=D),this._annotations[S]!==void 0)throw new Error("Id "+S+" is already in use.");if(O===void 0)throw new Error("No annotation provided for id "+S);return this._annotations[S]=O,this._size++,S},v.prototype.nextId=function(){return this._counter++,this._counter.toString()},v}(),Ce=function(){function v(D){var O=this;this._textEditChanges=Object.create(null),D!==void 0?(this._workspaceEdit=D,D.documentChanges?(this._changeAnnotations=new ye(D.changeAnnotations),D.changeAnnotations=this._changeAnnotations.all(),D.documentChanges.forEach(function(S){if(L.is(S)){var T=new re(S.edits,O._changeAnnotations);O._textEditChanges[S.textDocument.uri]=T}})):D.changes&&Object.keys(D.changes).forEach(function(S){var T=new re(D.changes[S]);O._textEditChanges[S]=T})):this._workspaceEdit={}}return Object.defineProperty(v.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),v.prototype.getTextEditChange=function(D){if(ct.is(D)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var O={uri:D.uri,version:D.version},S=this._textEditChanges[O.uri];if(!S){var T=[],F={textDocument:O,edits:T};this._workspaceEdit.documentChanges.push(F),S=new re(T,this._changeAnnotations),this._textEditChanges[O.uri]=S}return S}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var S=this._textEditChanges[D];if(!S){var T=[];this._workspaceEdit.changes[D]=T,S=new re(T),this._textEditChanges[D]=S}return S}},v.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new ye,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},v.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},v.prototype.createFile=function(D,O,S){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var T;N.is(O)||C.is(O)?T=O:S=O;var F,j;if(T===void 0?F=M.create(D,S):(j=C.is(T)?T:this._changeAnnotations.manage(T),F=M.create(D,S,j)),this._workspaceEdit.documentChanges.push(F),j!==void 0)return j},v.prototype.renameFile=function(D,O,S,T){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var F;N.is(S)||C.is(S)?F=S:T=S;var j,fe;if(F===void 0?j=$.create(D,O,T):(fe=C.is(F)?F:this._changeAnnotations.manage(F),j=$.create(D,O,T,fe)),this._workspaceEdit.documentChanges.push(j),fe!==void 0)return fe},v.prototype.deleteFile=function(D,O,S){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var T;N.is(O)||C.is(O)?T=O:S=O;var F,j;if(T===void 0?F=K.create(D,S):(j=C.is(T)?T:this._changeAnnotations.manage(T),F=K.create(D,S,j)),this._workspaceEdit.documentChanges.push(F),j!==void 0)return j},v}();e.WorkspaceChange=Ce;var ae;(function(v){function D(S){return{uri:S}}v.create=D;function O(S){var T=S;return I.defined(T)&&I.string(T.uri)}v.is=O})(ae=e.TextDocumentIdentifier||(e.TextDocumentIdentifier={}));var Pe;(function(v){function D(S,T){return{uri:S,version:T}}v.create=D;function O(S){var T=S;return I.defined(T)&&I.string(T.uri)&&I.integer(T.version)}v.is=O})(Pe=e.VersionedTextDocumentIdentifier||(e.VersionedTextDocumentIdentifier={}));var ct;(function(v){function D(S,T){return{uri:S,version:T}}v.create=D;function O(S){var T=S;return I.defined(T)&&I.string(T.uri)&&(T.version===null||I.integer(T.version))}v.is=O})(ct=e.OptionalVersionedTextDocumentIdentifier||(e.OptionalVersionedTextDocumentIdentifier={}));var Jt;(function(v){function D(S,T,F,j){return{uri:S,languageId:T,version:F,text:j}}v.create=D;function O(S){var T=S;return I.defined(T)&&I.string(T.uri)&&I.string(T.languageId)&&I.integer(T.version)&&I.string(T.text)}v.is=O})(Jt=e.TextDocumentItem||(e.TextDocumentItem={}));var Je;(function(v){v.PlainText="plaintext",v.Markdown="markdown"})(Je=e.MarkupKind||(e.MarkupKind={})),function(v){function D(O){var S=O;return S===v.PlainText||S===v.Markdown}v.is=D}(Je=e.MarkupKind||(e.MarkupKind={}));var ft;(function(v){function D(O){var S=O;return I.objectLiteral(O)&&Je.is(S.kind)&&I.string(S.value)}v.is=D})(ft=e.MarkupContent||(e.MarkupContent={}));var pe;(function(v){v.Text=1,v.Method=2,v.Function=3,v.Constructor=4,v.Field=5,v.Variable=6,v.Class=7,v.Interface=8,v.Module=9,v.Property=10,v.Unit=11,v.Value=12,v.Enum=13,v.Keyword=14,v.Snippet=15,v.Color=16,v.File=17,v.Reference=18,v.Folder=19,v.EnumMember=20,v.Constant=21,v.Struct=22,v.Event=23,v.Operator=24,v.TypeParameter=25})(pe=e.CompletionItemKind||(e.CompletionItemKind={}));var Re;(function(v){v.PlainText=1,v.Snippet=2})(Re=e.InsertTextFormat||(e.InsertTextFormat={}));var Ge;(function(v){v.Deprecated=1})(Ge=e.CompletionItemTag||(e.CompletionItemTag={}));var J;(function(v){function D(S,T,F){return{newText:S,insert:T,replace:F}}v.create=D;function O(S){var T=S;return T&&I.string(T.newText)&&s.is(T.insert)&&s.is(T.replace)}v.is=O})(J=e.InsertReplaceEdit||(e.InsertReplaceEdit={}));var pt;(function(v){v.asIs=1,v.adjustIndentation=2})(pt=e.InsertTextMode||(e.InsertTextMode={}));var st;(function(v){function D(O){return{label:O}}v.create=D})(st=e.CompletionItem||(e.CompletionItem={}));var Dt;(function(v){function D(O,S){return{items:O||[],isIncomplete:!!S}}v.create=D})(Dt=e.CompletionList||(e.CompletionList={}));var vn;(function(v){function D(S){return S.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}v.fromPlainText=D;function O(S){var T=S;return I.string(T)||I.objectLiteral(T)&&I.string(T.language)&&I.string(T.value)}v.is=O})(vn=e.MarkedString||(e.MarkedString={}));var Si;(function(v){function D(O){var S=O;return!!S&&I.objectLiteral(S)&&(ft.is(S.contents)||vn.is(S.contents)||I.typedArray(S.contents,vn.is))&&(O.range===void 0||s.is(O.range))}v.is=D})(Si=e.Hover||(e.Hover={}));var ui;(function(v){function D(O,S){return S?{label:O,documentation:S}:{label:O}}v.create=D})(ui=e.ParameterInformation||(e.ParameterInformation={}));var ko;(function(v){function D(O,S){for(var T=[],F=2;F{te();let v,D;if(nn.string(x)){v=x;let A=I[0],T=0,F=De.ParameterStructures.auto;De.ParameterStructures.is(A)&&(T=1,F=A);let j=I.length,fe=j-T;switch(fe){case 0:D=void 0;break;case 1:D=bt(F,I[T]);break;default:if(F===De.ParameterStructures.byName)throw new Error(`Recevied ${fe} parameters for 'by Name' notification parameter structure.`);D=I.slice(T,j).map(ve=>ce(ve));break}}else{let A=I;v=x.method,D=kt(x,A)}let O={jsonrpc:l,method:v,params:D};ko(O),e.write(O)},onNotification:(x,I)=>{te();let v;return nn.func(x)?f=x:I&&(nn.string(x)?(v=x,h[x]={type:void 0,handler:I}):(v=x.method,h[x.method]={type:x,handler:I})),{dispose:()=>{v!==void 0?delete h[v]:f=void 0}}},onProgress:(x,I,v)=>{if(y.has(I))throw new Error(`Progress handler for token ${I} already registered`);return y.set(I,v),{dispose:()=>{y.delete(I)}}},sendProgress:(x,I,v)=>{Ki.sendNotification(_u.type,{token:I,value:v})},onUnhandledProgress:$.event,sendRequest:(x,...I)=>{te(),k();let v,D,O;if(nn.string(x)){v=x;let j=I[0],fe=I[I.length-1],ve=0,Ve=De.ParameterStructures.auto;De.ParameterStructures.is(j)&&(ve=1,Ve=j);let dt=I.length;yp.CancellationToken.is(fe)&&(dt=dt-1,O=fe);let Yt=dt-ve;switch(Yt){case 0:D=void 0;break;case 1:D=bt(Ve,I[ve]);break;default:if(Ve===De.ParameterStructures.byName)throw new Error(`Recevied ${Yt} parameters for 'by Name' request parameter structure.`);D=I.slice(ve,dt).map(Zt=>ce(Zt));break}}else{let j=I;v=x.method,D=kt(x,j);let fe=x.numberOfParams;O=yp.CancellationToken.is(j[fe])?j[fe]:void 0}let A=s++,T;return O&&(T=O.onCancellationRequested(()=>{ne.sender.sendCancellation(Ki,A)})),new Promise((j,fe)=>{let ve={jsonrpc:l,id:A,method:v,params:D},Ve=Zt=>{j(Zt),ne.sender.cleanup(A),T==null||T.dispose()},dt=Zt=>{fe(Zt),ne.sender.cleanup(A),T==null||T.dispose()},Yt={method:v,timerStart:Date.now(),resolve:Ve,reject:dt};ui(ve);try{e.write(ve)}catch(Zt){Yt.reject(new De.ResponseError(De.ErrorCodes.MessageWriteError,Zt.message?Zt.message:"Unknown reason")),Yt=null}Yt&&(g[String(A)]=Yt)})},onRequest:(x,I)=>{te();let v=null;return bp.is(x)?(v=void 0,u=x):nn.string(x)?(v=null,I!==void 0&&(v=x,c[x]={handler:I,type:void 0})):I!==void 0&&(v=x.method,c[x.method]={type:x,handler:I}),{dispose:()=>{v!==null&&(v!==void 0?delete c[v]:u=void 0)}}},trace:(x,I,v)=>{let D=!1,O=Kr.Text;v!==void 0&&(nn.boolean(v)?D=v:(D=v.sendNotification||!1,O=v.traceFormat||Kr.Text)),b=x,_=O,b===Vt.Off?N=void 0:N=I,D&&!Jt()&&!Je()&&Ki.sendNotification(m_.type,{value:Vt.toString(x)})},onError:G.event,onClose:L.event,onUnhandledNotification:M.event,onDispose:K.event,end:()=>{e.end()},dispose:()=>{if(Je())return;C=zr.Disposed,K.fire(void 0);let x=new Error("Connection got disposed.");Object.keys(g).forEach(I=>{g[I].reject(x)}),g=Object.create(null),m=Object.create(null),d=new d_.LinkedMap,nn.func(e.dispose)&&e.dispose(),nn.func(t.dispose)&&t.dispose()},listen:()=>{te(),Y(),C=zr.Listening,t.listen(pt)},inspect:()=>{p_.default().console.log("inspect")}};return Ki.onNotification(Tp.type,x=>{b===Vt.Off||!N||N.log(x.message,b===Vt.Verbose?x.verbose:void 0)}),Ki.onNotification(_u.type,x=>{let I=y.get(x.token);I?I(x.value):$.fire(x)}),Ki}Oe.createMessageConnection=YS});var Ap=X(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.CancellationSenderStrategy=Q.CancellationReceiverStrategy=Q.ConnectionError=Q.ConnectionErrors=Q.LogTraceNotification=Q.SetTraceNotification=Q.TraceFormat=Q.Trace=Q.ProgressType=Q.createMessageConnection=Q.NullLogger=Q.ConnectionOptions=Q.ConnectionStrategy=Q.WriteableStreamMessageWriter=Q.AbstractMessageWriter=Q.MessageWriter=Q.ReadableStreamMessageReader=Q.AbstractMessageReader=Q.MessageReader=Q.CancellationToken=Q.CancellationTokenSource=Q.Emitter=Q.Event=Q.Disposable=Q.ParameterStructures=Q.NotificationType9=Q.NotificationType8=Q.NotificationType7=Q.NotificationType6=Q.NotificationType5=Q.NotificationType4=Q.NotificationType3=Q.NotificationType2=Q.NotificationType1=Q.NotificationType0=Q.NotificationType=Q.ErrorCodes=Q.ResponseError=Q.RequestType9=Q.RequestType8=Q.RequestType7=Q.RequestType6=Q.RequestType5=Q.RequestType4=Q.RequestType3=Q.RequestType2=Q.RequestType1=Q.RequestType0=Q.RequestType=Q.RAL=void 0;Q.CancellationStrategy=void 0;var _t=op();Object.defineProperty(Q,"RequestType",{enumerable:!0,get:function(){return _t.RequestType}});Object.defineProperty(Q,"RequestType0",{enumerable:!0,get:function(){return _t.RequestType0}});Object.defineProperty(Q,"RequestType1",{enumerable:!0,get:function(){return _t.RequestType1}});Object.defineProperty(Q,"RequestType2",{enumerable:!0,get:function(){return _t.RequestType2}});Object.defineProperty(Q,"RequestType3",{enumerable:!0,get:function(){return _t.RequestType3}});Object.defineProperty(Q,"RequestType4",{enumerable:!0,get:function(){return _t.RequestType4}});Object.defineProperty(Q,"RequestType5",{enumerable:!0,get:function(){return _t.RequestType5}});Object.defineProperty(Q,"RequestType6",{enumerable:!0,get:function(){return _t.RequestType6}});Object.defineProperty(Q,"RequestType7",{enumerable:!0,get:function(){return _t.RequestType7}});Object.defineProperty(Q,"RequestType8",{enumerable:!0,get:function(){return _t.RequestType8}});Object.defineProperty(Q,"RequestType9",{enumerable:!0,get:function(){return _t.RequestType9}});Object.defineProperty(Q,"ResponseError",{enumerable:!0,get:function(){return _t.ResponseError}});Object.defineProperty(Q,"ErrorCodes",{enumerable:!0,get:function(){return _t.ErrorCodes}});Object.defineProperty(Q,"NotificationType",{enumerable:!0,get:function(){return _t.NotificationType}});Object.defineProperty(Q,"NotificationType0",{enumerable:!0,get:function(){return _t.NotificationType0}});Object.defineProperty(Q,"NotificationType1",{enumerable:!0,get:function(){return _t.NotificationType1}});Object.defineProperty(Q,"NotificationType2",{enumerable:!0,get:function(){return _t.NotificationType2}});Object.defineProperty(Q,"NotificationType3",{enumerable:!0,get:function(){return _t.NotificationType3}});Object.defineProperty(Q,"NotificationType4",{enumerable:!0,get:function(){return _t.NotificationType4}});Object.defineProperty(Q,"NotificationType5",{enumerable:!0,get:function(){return _t.NotificationType5}});Object.defineProperty(Q,"NotificationType6",{enumerable:!0,get:function(){return _t.NotificationType6}});Object.defineProperty(Q,"NotificationType7",{enumerable:!0,get:function(){return _t.NotificationType7}});Object.defineProperty(Q,"NotificationType8",{enumerable:!0,get:function(){return _t.NotificationType8}});Object.defineProperty(Q,"NotificationType9",{enumerable:!0,get:function(){return _t.NotificationType9}});Object.defineProperty(Q,"ParameterStructures",{enumerable:!0,get:function(){return _t.ParameterStructures}});var HS=ip();Object.defineProperty(Q,"Disposable",{enumerable:!0,get:function(){return HS.Disposable}});var y_=Pa();Object.defineProperty(Q,"Event",{enumerable:!0,get:function(){return y_.Event}});Object.defineProperty(Q,"Emitter",{enumerable:!0,get:function(){return y_.Emitter}});var b_=fp();Object.defineProperty(Q,"CancellationTokenSource",{enumerable:!0,get:function(){return b_.CancellationTokenSource}});Object.defineProperty(Q,"CancellationToken",{enumerable:!0,get:function(){return b_.CancellationToken}});var Pp=n_();Object.defineProperty(Q,"MessageReader",{enumerable:!0,get:function(){return Pp.MessageReader}});Object.defineProperty(Q,"AbstractMessageReader",{enumerable:!0,get:function(){return Pp.AbstractMessageReader}});Object.defineProperty(Q,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return Pp.ReadableStreamMessageReader}});var Sp=u_();Object.defineProperty(Q,"MessageWriter",{enumerable:!0,get:function(){return Sp.MessageWriter}});Object.defineProperty(Q,"AbstractMessageWriter",{enumerable:!0,get:function(){return Sp.AbstractMessageWriter}});Object.defineProperty(Q,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return Sp.WriteableStreamMessageWriter}});var Mn=__();Object.defineProperty(Q,"ConnectionStrategy",{enumerable:!0,get:function(){return Mn.ConnectionStrategy}});Object.defineProperty(Q,"ConnectionOptions",{enumerable:!0,get:function(){return Mn.ConnectionOptions}});Object.defineProperty(Q,"NullLogger",{enumerable:!0,get:function(){return Mn.NullLogger}});Object.defineProperty(Q,"createMessageConnection",{enumerable:!0,get:function(){return Mn.createMessageConnection}});Object.defineProperty(Q,"ProgressType",{enumerable:!0,get:function(){return Mn.ProgressType}});Object.defineProperty(Q,"Trace",{enumerable:!0,get:function(){return Mn.Trace}});Object.defineProperty(Q,"TraceFormat",{enumerable:!0,get:function(){return Mn.TraceFormat}});Object.defineProperty(Q,"SetTraceNotification",{enumerable:!0,get:function(){return Mn.SetTraceNotification}});Object.defineProperty(Q,"LogTraceNotification",{enumerable:!0,get:function(){return Mn.LogTraceNotification}});Object.defineProperty(Q,"ConnectionErrors",{enumerable:!0,get:function(){return Mn.ConnectionErrors}});Object.defineProperty(Q,"ConnectionError",{enumerable:!0,get:function(){return Mn.ConnectionError}});Object.defineProperty(Q,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Mn.CancellationReceiverStrategy}});Object.defineProperty(Q,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Mn.CancellationSenderStrategy}});Object.defineProperty(Q,"CancellationStrategy",{enumerable:!0,get:function(){return Mn.CancellationStrategy}});var $S=wi();Q.RAL=$S.default});var Da=X(Ze=>{"use strict";var KS=Ze&&Ze.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),zS=Ze&&Ze.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&KS(e,t,n)};Object.defineProperty(Ze,"__esModule",{value:!0});Ze.createMessageConnection=Ze.createServerSocketTransport=Ze.createClientSocketTransport=Ze.createServerPipeTransport=Ze.createClientPipeTransport=Ze.generateRandomPipeName=Ze.StreamMessageWriter=Ze.StreamMessageReader=Ze.SocketMessageWriter=Ze.SocketMessageReader=Ze.IPCMessageWriter=Ze.IPCMessageReader=void 0;var Aa=Ag();Aa.default.install();var gi=Ap(),T_=require("path"),XS=require("os"),QS=require("crypto"),bu=require("net");zS(Ap(),Ze);var v_=class extends gi.AbstractMessageReader{constructor(e){super();this.process=e;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),gi.Disposable.create(()=>this.process.off("message",e))}};Ze.IPCMessageReader=v_;var N_=class extends gi.AbstractMessageWriter{constructor(e){super();this.process=e,this.errorCount=0;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,n=>{n?(this.errorCount++,this.handleError(n,e)):this.errorCount=0}),Promise.resolve()}catch(n){return this.handleError(n,e),Promise.reject(n)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){}};Ze.IPCMessageWriter=N_;var Ea=class extends gi.ReadableStreamMessageReader{constructor(e,n="utf-8"){super(Aa.default().stream.asReadableStream(e),n)}};Ze.SocketMessageReader=Ea;var Ia=class extends gi.WriteableStreamMessageWriter{constructor(e,n){super(Aa.default().stream.asWritableStream(e),n);this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};Ze.SocketMessageWriter=Ia;var Ep=class extends gi.ReadableStreamMessageReader{constructor(e,n){super(Aa.default().stream.asReadableStream(e),n)}};Ze.StreamMessageReader=Ep;var Ip=class extends gi.WriteableStreamMessageWriter{constructor(e,n){super(Aa.default().stream.asWritableStream(e),n)}};Ze.StreamMessageWriter=Ip;var C_=process.env.XDG_RUNTIME_DIR,JS=new Map([["linux",107],["darwin",103]]);function ZS(){let t=QS.randomBytes(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;C_?e=T_.join(C_,`vscode-ipc-${t}.sock`):e=T_.join(XS.tmpdir(),`vscode-${t}.sock`);let n=JS.get(process.platform);return n!==void 0&&e.length>=n&&Aa.default().console.warn(`WARNING: IPC handle "${e}" is longer than ${n} characters.`),e}Ze.generateRandomPipeName=ZS;function eA(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let a=bu.createServer(o=>{a.close(),n([new Ea(o,e),new Ia(o,e)])});a.on("error",s),a.listen(t,()=>{a.removeListener("error",s),i({onConnected:()=>r})})})}Ze.createClientPipeTransport=eA;function tA(t,e="utf-8"){let n=bu.createConnection(t);return[new Ea(n,e),new Ia(n,e)]}Ze.createServerPipeTransport=tA;function nA(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let a=bu.createServer(o=>{a.close(),n([new Ea(o,e),new Ia(o,e)])});a.on("error",s),a.listen(t,"127.0.0.1",()=>{a.removeListener("error",s),i({onConnected:()=>r})})})}Ze.createClientSocketTransport=nA;function rA(t,e="utf-8"){let n=bu.createConnection(t,"127.0.0.1");return[new Ea(n,e),new Ia(n,e)]}Ze.createServerSocketTransport=rA;function iA(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function sA(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function aA(t,e,n,r){n||(n=gi.NullLogger);let i=iA(t)?new Ep(t):t,s=sA(e)?new Ip(e):e;return gi.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),gi.createMessageConnection(i,s,n,r)}Ze.createMessageConnection=aA});var Dp=X((L2,P_)=>{"use strict";P_.exports=Da()});var vt=X((S_,Tu)=>{(function(t){if(typeof Tu=="object"&&typeof Tu.exports=="object"){var e=t(require,S_);e!==void 0&&(Tu.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],t)})(function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=e.EOL=e.SelectionRange=e.DocumentLink=e.FormattingOptions=e.CodeLens=e.CodeAction=e.CodeActionContext=e.CodeActionKind=e.DocumentSymbol=e.SymbolInformation=e.SymbolTag=e.SymbolKind=e.DocumentHighlight=e.DocumentHighlightKind=e.SignatureInformation=e.ParameterInformation=e.Hover=e.MarkedString=e.CompletionList=e.CompletionItem=e.InsertTextMode=e.InsertReplaceEdit=e.CompletionItemTag=e.InsertTextFormat=e.CompletionItemKind=e.MarkupContent=e.MarkupKind=e.TextDocumentItem=e.OptionalVersionedTextDocumentIdentifier=e.VersionedTextDocumentIdentifier=e.TextDocumentIdentifier=e.WorkspaceChange=e.WorkspaceEdit=e.DeleteFile=e.RenameFile=e.CreateFile=e.TextDocumentEdit=e.AnnotatedTextEdit=e.ChangeAnnotationIdentifier=e.ChangeAnnotation=e.TextEdit=e.Command=e.Diagnostic=e.CodeDescription=e.DiagnosticTag=e.DiagnosticSeverity=e.DiagnosticRelatedInformation=e.FoldingRange=e.FoldingRangeKind=e.ColorPresentation=e.ColorInformation=e.Color=e.LocationLink=e.Location=e.Range=e.Position=e.uinteger=e.integer=void 0;var n;(function(v){v.MIN_VALUE=-2147483648,v.MAX_VALUE=2147483647})(n=e.integer||(e.integer={}));var r;(function(v){v.MIN_VALUE=0,v.MAX_VALUE=2147483647})(r=e.uinteger||(e.uinteger={}));var i;(function(v){function D(A,T){return A===Number.MAX_VALUE&&(A=r.MAX_VALUE),T===Number.MAX_VALUE&&(T=r.MAX_VALUE),{line:A,character:T}}v.create=D;function O(A){var T=A;return I.objectLiteral(T)&&I.uinteger(T.line)&&I.uinteger(T.character)}v.is=O})(i=e.Position||(e.Position={}));var s;(function(v){function D(A,T,F,j){if(I.uinteger(A)&&I.uinteger(T)&&I.uinteger(F)&&I.uinteger(j))return{start:i.create(A,T),end:i.create(F,j)};if(i.is(A)&&i.is(T))return{start:A,end:T};throw new Error("Range#create called with invalid arguments["+A+", "+T+", "+F+", "+j+"]")}v.create=D;function O(A){var T=A;return I.objectLiteral(T)&&i.is(T.start)&&i.is(T.end)}v.is=O})(s=e.Range||(e.Range={}));var a;(function(v){function D(A,T){return{uri:A,range:T}}v.create=D;function O(A){var T=A;return I.defined(T)&&s.is(T.range)&&(I.string(T.uri)||I.undefined(T.uri))}v.is=O})(a=e.Location||(e.Location={}));var o;(function(v){function D(A,T,F,j){return{targetUri:A,targetRange:T,targetSelectionRange:F,originSelectionRange:j}}v.create=D;function O(A){var T=A;return I.defined(T)&&s.is(T.targetRange)&&I.string(T.targetUri)&&(s.is(T.targetSelectionRange)||I.undefined(T.targetSelectionRange))&&(s.is(T.originSelectionRange)||I.undefined(T.originSelectionRange))}v.is=O})(o=e.LocationLink||(e.LocationLink={}));var l;(function(v){function D(A,T,F,j){return{red:A,green:T,blue:F,alpha:j}}v.create=D;function O(A){var T=A;return I.numberRange(T.red,0,1)&&I.numberRange(T.green,0,1)&&I.numberRange(T.blue,0,1)&&I.numberRange(T.alpha,0,1)}v.is=O})(l=e.Color||(e.Color={}));var u;(function(v){function D(A,T){return{range:A,color:T}}v.create=D;function O(A){var T=A;return s.is(T.range)&&l.is(T.color)}v.is=O})(u=e.ColorInformation||(e.ColorInformation={}));var c;(function(v){function D(A,T,F){return{label:A,textEdit:T,additionalTextEdits:F}}v.create=D;function O(A){var T=A;return I.string(T.label)&&(I.undefined(T.textEdit)||_.is(T))&&(I.undefined(T.additionalTextEdits)||I.typedArray(T.additionalTextEdits,_.is))}v.is=O})(c=e.ColorPresentation||(e.ColorPresentation={}));var f;(function(v){v.Comment="comment",v.Imports="imports",v.Region="region"})(f=e.FoldingRangeKind||(e.FoldingRangeKind={}));var h;(function(v){function D(A,T,F,j,fe){var ve={startLine:A,endLine:T};return I.defined(F)&&(ve.startCharacter=F),I.defined(j)&&(ve.endCharacter=j),I.defined(fe)&&(ve.kind=fe),ve}v.create=D;function O(A){var T=A;return I.uinteger(T.startLine)&&I.uinteger(T.startLine)&&(I.undefined(T.startCharacter)||I.uinteger(T.startCharacter))&&(I.undefined(T.endCharacter)||I.uinteger(T.endCharacter))&&(I.undefined(T.kind)||I.string(T.kind))}v.is=O})(h=e.FoldingRange||(e.FoldingRange={}));var y;(function(v){function D(A,T){return{location:A,message:T}}v.create=D;function O(A){var T=A;return I.defined(T)&&a.is(T.location)&&I.string(T.message)}v.is=O})(y=e.DiagnosticRelatedInformation||(e.DiagnosticRelatedInformation={}));var p;(function(v){v.Error=1,v.Warning=2,v.Information=3,v.Hint=4})(p=e.DiagnosticSeverity||(e.DiagnosticSeverity={}));var d;(function(v){v.Unnecessary=1,v.Deprecated=2})(d=e.DiagnosticTag||(e.DiagnosticTag={}));var g;(function(v){function D(O){var A=O;return A!=null&&I.string(A.href)}v.is=D})(g=e.CodeDescription||(e.CodeDescription={}));var m;(function(v){function D(A,T,F,j,fe,ve){var Ve={range:A,message:T};return I.defined(F)&&(Ve.severity=F),I.defined(j)&&(Ve.code=j),I.defined(fe)&&(Ve.source=fe),I.defined(ve)&&(Ve.relatedInformation=ve),Ve}v.create=D;function O(A){var T,F=A;return I.defined(F)&&s.is(F.range)&&I.string(F.message)&&(I.number(F.severity)||I.undefined(F.severity))&&(I.integer(F.code)||I.string(F.code)||I.undefined(F.code))&&(I.undefined(F.codeDescription)||I.string((T=F.codeDescription)===null||T===void 0?void 0:T.href))&&(I.string(F.source)||I.undefined(F.source))&&(I.undefined(F.relatedInformation)||I.typedArray(F.relatedInformation,y.is))}v.is=O})(m=e.Diagnostic||(e.Diagnostic={}));var b;(function(v){function D(A,T){for(var F=[],j=2;j0&&(fe.arguments=F),fe}v.create=D;function O(A){var T=A;return I.defined(T)&&I.string(T.title)&&I.string(T.command)}v.is=O})(b=e.Command||(e.Command={}));var _;(function(v){function D(F,j){return{range:F,newText:j}}v.replace=D;function O(F,j){return{range:{start:F,end:F},newText:j}}v.insert=O;function A(F){return{range:F,newText:""}}v.del=A;function T(F){var j=F;return I.objectLiteral(j)&&I.string(j.newText)&&s.is(j.range)}v.is=T})(_=e.TextEdit||(e.TextEdit={}));var N;(function(v){function D(A,T,F){var j={label:A};return T!==void 0&&(j.needsConfirmation=T),F!==void 0&&(j.description=F),j}v.create=D;function O(A){var T=A;return T!==void 0&&I.objectLiteral(T)&&I.string(T.label)&&(I.boolean(T.needsConfirmation)||T.needsConfirmation===void 0)&&(I.string(T.description)||T.description===void 0)}v.is=O})(N=e.ChangeAnnotation||(e.ChangeAnnotation={}));var C;(function(v){function D(O){var A=O;return typeof A=="string"}v.is=D})(C=e.ChangeAnnotationIdentifier||(e.ChangeAnnotationIdentifier={}));var G;(function(v){function D(F,j,fe){return{range:F,newText:j,annotationId:fe}}v.replace=D;function O(F,j,fe){return{range:{start:F,end:F},newText:j,annotationId:fe}}v.insert=O;function A(F,j){return{range:F,newText:"",annotationId:j}}v.del=A;function T(F){var j=F;return _.is(j)&&(N.is(j.annotationId)||C.is(j.annotationId))}v.is=T})(G=e.AnnotatedTextEdit||(e.AnnotatedTextEdit={}));var L;(function(v){function D(A,T){return{textDocument:A,edits:T}}v.create=D;function O(A){var T=A;return I.defined(T)&&ct.is(T.textDocument)&&Array.isArray(T.edits)}v.is=O})(L=e.TextDocumentEdit||(e.TextDocumentEdit={}));var M;(function(v){function D(A,T,F){var j={kind:"create",uri:A};return T!==void 0&&(T.overwrite!==void 0||T.ignoreIfExists!==void 0)&&(j.options=T),F!==void 0&&(j.annotationId=F),j}v.create=D;function O(A){var T=A;return T&&T.kind==="create"&&I.string(T.uri)&&(T.options===void 0||(T.options.overwrite===void 0||I.boolean(T.options.overwrite))&&(T.options.ignoreIfExists===void 0||I.boolean(T.options.ignoreIfExists)))&&(T.annotationId===void 0||C.is(T.annotationId))}v.is=O})(M=e.CreateFile||(e.CreateFile={}));var $;(function(v){function D(A,T,F,j){var fe={kind:"rename",oldUri:A,newUri:T};return F!==void 0&&(F.overwrite!==void 0||F.ignoreIfExists!==void 0)&&(fe.options=F),j!==void 0&&(fe.annotationId=j),fe}v.create=D;function O(A){var T=A;return T&&T.kind==="rename"&&I.string(T.oldUri)&&I.string(T.newUri)&&(T.options===void 0||(T.options.overwrite===void 0||I.boolean(T.options.overwrite))&&(T.options.ignoreIfExists===void 0||I.boolean(T.options.ignoreIfExists)))&&(T.annotationId===void 0||C.is(T.annotationId))}v.is=O})($=e.RenameFile||(e.RenameFile={}));var K;(function(v){function D(A,T,F){var j={kind:"delete",uri:A};return T!==void 0&&(T.recursive!==void 0||T.ignoreIfNotExists!==void 0)&&(j.options=T),F!==void 0&&(j.annotationId=F),j}v.create=D;function O(A){var T=A;return T&&T.kind==="delete"&&I.string(T.uri)&&(T.options===void 0||(T.options.recursive===void 0||I.boolean(T.options.recursive))&&(T.options.ignoreIfNotExists===void 0||I.boolean(T.options.ignoreIfNotExists)))&&(T.annotationId===void 0||C.is(T.annotationId))}v.is=O})(K=e.DeleteFile||(e.DeleteFile={}));var ne;(function(v){function D(O){var A=O;return A&&(A.changes!==void 0||A.documentChanges!==void 0)&&(A.documentChanges===void 0||A.documentChanges.every(function(T){return I.string(T.kind)?M.is(T)||$.is(T)||K.is(T):L.is(T)}))}v.is=D})(ne=e.WorkspaceEdit||(e.WorkspaceEdit={}));var re=function(){function v(D,O){this.edits=D,this.changeAnnotations=O}return v.prototype.insert=function(D,O,A){var T,F;if(A===void 0?T=_.insert(D,O):C.is(A)?(F=A,T=G.insert(D,O,A)):(this.assertChangeAnnotations(this.changeAnnotations),F=this.changeAnnotations.manage(A),T=G.insert(D,O,F)),this.edits.push(T),F!==void 0)return F},v.prototype.replace=function(D,O,A){var T,F;if(A===void 0?T=_.replace(D,O):C.is(A)?(F=A,T=G.replace(D,O,A)):(this.assertChangeAnnotations(this.changeAnnotations),F=this.changeAnnotations.manage(A),T=G.replace(D,O,F)),this.edits.push(T),F!==void 0)return F},v.prototype.delete=function(D,O){var A,T;if(O===void 0?A=_.del(D):C.is(O)?(T=O,A=G.del(D,O)):(this.assertChangeAnnotations(this.changeAnnotations),T=this.changeAnnotations.manage(O),A=G.del(D,T)),this.edits.push(A),T!==void 0)return T},v.prototype.add=function(D){this.edits.push(D)},v.prototype.all=function(){return this.edits},v.prototype.clear=function(){this.edits.splice(0,this.edits.length)},v.prototype.assertChangeAnnotations=function(D){if(D===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},v}(),ye=function(){function v(D){this._annotations=D===void 0?Object.create(null):D,this._counter=0,this._size=0}return v.prototype.all=function(){return this._annotations},Object.defineProperty(v.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),v.prototype.manage=function(D,O){var A;if(C.is(D)?A=D:(A=this.nextId(),O=D),this._annotations[A]!==void 0)throw new Error("Id "+A+" is already in use.");if(O===void 0)throw new Error("No annotation provided for id "+A);return this._annotations[A]=O,this._size++,A},v.prototype.nextId=function(){return this._counter++,this._counter.toString()},v}(),Ce=function(){function v(D){var O=this;this._textEditChanges=Object.create(null),D!==void 0?(this._workspaceEdit=D,D.documentChanges?(this._changeAnnotations=new ye(D.changeAnnotations),D.changeAnnotations=this._changeAnnotations.all(),D.documentChanges.forEach(function(A){if(L.is(A)){var T=new re(A.edits,O._changeAnnotations);O._textEditChanges[A.textDocument.uri]=T}})):D.changes&&Object.keys(D.changes).forEach(function(A){var T=new re(D.changes[A]);O._textEditChanges[A]=T})):this._workspaceEdit={}}return Object.defineProperty(v.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),v.prototype.getTextEditChange=function(D){if(ct.is(D)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var O={uri:D.uri,version:D.version},A=this._textEditChanges[O.uri];if(!A){var T=[],F={textDocument:O,edits:T};this._workspaceEdit.documentChanges.push(F),A=new re(T,this._changeAnnotations),this._textEditChanges[O.uri]=A}return A}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var A=this._textEditChanges[D];if(!A){var T=[];this._workspaceEdit.changes[D]=T,A=new re(T),this._textEditChanges[D]=A}return A}},v.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new ye,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},v.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},v.prototype.createFile=function(D,O,A){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var T;N.is(O)||C.is(O)?T=O:A=O;var F,j;if(T===void 0?F=M.create(D,A):(j=C.is(T)?T:this._changeAnnotations.manage(T),F=M.create(D,A,j)),this._workspaceEdit.documentChanges.push(F),j!==void 0)return j},v.prototype.renameFile=function(D,O,A,T){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var F;N.is(A)||C.is(A)?F=A:T=A;var j,fe;if(F===void 0?j=$.create(D,O,T):(fe=C.is(F)?F:this._changeAnnotations.manage(F),j=$.create(D,O,T,fe)),this._workspaceEdit.documentChanges.push(j),fe!==void 0)return fe},v.prototype.deleteFile=function(D,O,A){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var T;N.is(O)||C.is(O)?T=O:A=O;var F,j;if(T===void 0?F=K.create(D,A):(j=C.is(T)?T:this._changeAnnotations.manage(T),F=K.create(D,A,j)),this._workspaceEdit.documentChanges.push(F),j!==void 0)return j},v}();e.WorkspaceChange=Ce;var ae;(function(v){function D(A){return{uri:A}}v.create=D;function O(A){var T=A;return I.defined(T)&&I.string(T.uri)}v.is=O})(ae=e.TextDocumentIdentifier||(e.TextDocumentIdentifier={}));var Pe;(function(v){function D(A,T){return{uri:A,version:T}}v.create=D;function O(A){var T=A;return I.defined(T)&&I.string(T.uri)&&I.integer(T.version)}v.is=O})(Pe=e.VersionedTextDocumentIdentifier||(e.VersionedTextDocumentIdentifier={}));var ct;(function(v){function D(A,T){return{uri:A,version:T}}v.create=D;function O(A){var T=A;return I.defined(T)&&I.string(T.uri)&&(T.version===null||I.integer(T.version))}v.is=O})(ct=e.OptionalVersionedTextDocumentIdentifier||(e.OptionalVersionedTextDocumentIdentifier={}));var Jt;(function(v){function D(A,T,F,j){return{uri:A,languageId:T,version:F,text:j}}v.create=D;function O(A){var T=A;return I.defined(T)&&I.string(T.uri)&&I.string(T.languageId)&&I.integer(T.version)&&I.string(T.text)}v.is=O})(Jt=e.TextDocumentItem||(e.TextDocumentItem={}));var Je;(function(v){v.PlainText="plaintext",v.Markdown="markdown"})(Je=e.MarkupKind||(e.MarkupKind={})),function(v){function D(O){var A=O;return A===v.PlainText||A===v.Markdown}v.is=D}(Je=e.MarkupKind||(e.MarkupKind={}));var ft;(function(v){function D(O){var A=O;return I.objectLiteral(O)&&Je.is(A.kind)&&I.string(A.value)}v.is=D})(ft=e.MarkupContent||(e.MarkupContent={}));var pe;(function(v){v.Text=1,v.Method=2,v.Function=3,v.Constructor=4,v.Field=5,v.Variable=6,v.Class=7,v.Interface=8,v.Module=9,v.Property=10,v.Unit=11,v.Value=12,v.Enum=13,v.Keyword=14,v.Snippet=15,v.Color=16,v.File=17,v.Reference=18,v.Folder=19,v.EnumMember=20,v.Constant=21,v.Struct=22,v.Event=23,v.Operator=24,v.TypeParameter=25})(pe=e.CompletionItemKind||(e.CompletionItemKind={}));var Re;(function(v){v.PlainText=1,v.Snippet=2})(Re=e.InsertTextFormat||(e.InsertTextFormat={}));var Ge;(function(v){v.Deprecated=1})(Ge=e.CompletionItemTag||(e.CompletionItemTag={}));var J;(function(v){function D(A,T,F){return{newText:A,insert:T,replace:F}}v.create=D;function O(A){var T=A;return T&&I.string(T.newText)&&s.is(T.insert)&&s.is(T.replace)}v.is=O})(J=e.InsertReplaceEdit||(e.InsertReplaceEdit={}));var pt;(function(v){v.asIs=1,v.adjustIndentation=2})(pt=e.InsertTextMode||(e.InsertTextMode={}));var st;(function(v){function D(O){return{label:O}}v.create=D})(st=e.CompletionItem||(e.CompletionItem={}));var Dt;(function(v){function D(O,A){return{items:O||[],isIncomplete:!!A}}v.create=D})(Dt=e.CompletionList||(e.CompletionList={}));var vn;(function(v){function D(A){return A.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}v.fromPlainText=D;function O(A){var T=A;return I.string(T)||I.objectLiteral(T)&&I.string(T.language)&&I.string(T.value)}v.is=O})(vn=e.MarkedString||(e.MarkedString={}));var Ai;(function(v){function D(O){var A=O;return!!A&&I.objectLiteral(A)&&(ft.is(A.contents)||vn.is(A.contents)||I.typedArray(A.contents,vn.is))&&(O.range===void 0||s.is(O.range))}v.is=D})(Ai=e.Hover||(e.Hover={}));var ui;(function(v){function D(O,A){return A?{label:O,documentation:A}:{label:O}}v.create=D})(ui=e.ParameterInformation||(e.ParameterInformation={}));var ko;(function(v){function D(O,A){for(var T=[],F=2;F=0;dt--){var Yt=ve[dt],Zt=F.offsetAt(Yt.range.start),He=F.offsetAt(Yt.range.end);if(He<=Ve)fe=fe.substring(0,Zt)+Yt.newText+fe.substring(He,fe.length);else throw new Error("Overlapping edit");Ve=Zt}return fe}v.applyEdits=S;function T(F,j){if(F.length<=1)return F;var fe=F.length/2|0,ve=F.slice(0,fe),Ve=F.slice(fe);T(ve,j),T(Ve,j);for(var dt=0,Yt=0,Zt=0;dt=0;dt--){var Yt=ve[dt],Zt=F.offsetAt(Yt.range.start),He=F.offsetAt(Yt.range.end);if(He<=Ve)fe=fe.substring(0,Zt)+Yt.newText+fe.substring(He,fe.length);else throw new Error("Overlapping edit");Ve=Zt}return fe}v.applyEdits=A;function T(F,j){if(F.length<=1)return F;var fe=F.length/2|0,ve=F.slice(0,fe),Ve=F.slice(fe);T(ve,j),T(Ve,j);for(var dt=0,Yt=0,Zt=0;dt0&&D.push(O.length),this._lineOffsets=D}return this._lineOffsets},v.prototype.positionAt=function(D){D=Math.max(Math.min(D,this._content.length),0);var O=this.getLineOffsets(),S=0,T=O.length;if(T===0)return i.create(0,D);for(;SD?T=F:S=F+1}var j=S-1;return i.create(j,D-O[j])},v.prototype.offsetAt=function(D){var O=this.getLineOffsets();if(D.line>=O.length)return this._content.length;if(D.line<0)return 0;var S=O[D.line],T=D.line+1{"use strict";Object.defineProperty(br,"__esModule",{value:!0});br.ProtocolNotificationType=br.ProtocolNotificationType0=br.ProtocolRequestType=br.ProtocolRequestType0=br.RegistrationType=void 0;var xa=Da(),S_=class{constructor(e){this.method=e}};br.RegistrationType=S_;var E_=class extends xa.RequestType0{constructor(e){super(e)}};br.ProtocolRequestType0=E_;var I_=class extends xa.RequestType{constructor(e){super(e,xa.ParameterStructures.byName)}};br.ProtocolRequestType=I_;var D_=class extends xa.NotificationType0{constructor(e){super(e)}};br.ProtocolNotificationType0=D_;var x_=class extends xa.NotificationType{constructor(e){super(e,xa.ParameterStructures.byName)}};br.ProtocolNotificationType=x_});var O_=X(jt=>{"use strict";Object.defineProperty(jt,"__esModule",{value:!0});jt.objectLiteral=jt.typedArray=jt.stringArray=jt.array=jt.func=jt.error=jt.number=jt.string=jt.boolean=void 0;function aS(t){return t===!0||t===!1}jt.boolean=aS;function R_(t){return typeof t=="string"||t instanceof String}jt.string=R_;function oS(t){return typeof t=="number"||t instanceof Number}jt.number=oS;function lS(t){return t instanceof Error}jt.error=lS;function uS(t){return typeof t=="function"}jt.func=uS;function w_(t){return Array.isArray(t)}jt.array=w_;function cS(t){return w_(t)&&t.every(e=>R_(e))}jt.stringArray=cS;function fS(t,e){return Array.isArray(t)&&t.every(e)}jt.typedArray=fS;function pS(t){return t!==null&&typeof t=="object"}jt.objectLiteral=pS});var L_=X(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.ImplementationRequest=void 0;var dS=rn(),hS;(function(t){t.method="textDocument/implementation",t.type=new dS.ProtocolRequestType(t.method)})(hS=Zo.ImplementationRequest||(Zo.ImplementationRequest={}))});var F_=X(el=>{"use strict";Object.defineProperty(el,"__esModule",{value:!0});el.TypeDefinitionRequest=void 0;var mS=rn(),gS;(function(t){t.method="textDocument/typeDefinition",t.type=new mS.ProtocolRequestType(t.method)})(gS=el.TypeDefinitionRequest||(el.TypeDefinitionRequest={}))});var M_=X(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});Zi.DidChangeWorkspaceFoldersNotification=Zi.WorkspaceFoldersRequest=void 0;var k_=rn(),_S;(function(t){t.type=new k_.ProtocolRequestType0("workspace/workspaceFolders")})(_S=Zi.WorkspaceFoldersRequest||(Zi.WorkspaceFoldersRequest={}));var yS;(function(t){t.type=new k_.ProtocolNotificationType("workspace/didChangeWorkspaceFolders")})(yS=Zi.DidChangeWorkspaceFoldersNotification||(Zi.DidChangeWorkspaceFoldersNotification={}))});var B_=X(tl=>{"use strict";Object.defineProperty(tl,"__esModule",{value:!0});tl.ConfigurationRequest=void 0;var bS=rn(),TS;(function(t){t.type=new bS.ProtocolRequestType("workspace/configuration")})(TS=tl.ConfigurationRequest||(tl.ConfigurationRequest={}))});var V_=X(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.ColorPresentationRequest=es.DocumentColorRequest=void 0;var q_=rn(),vS;(function(t){t.method="textDocument/documentColor",t.type=new q_.ProtocolRequestType(t.method)})(vS=es.DocumentColorRequest||(es.DocumentColorRequest={}));var NS;(function(t){t.type=new q_.ProtocolRequestType("textDocument/colorPresentation")})(NS=es.ColorPresentationRequest||(es.ColorPresentationRequest={}))});var j_=X(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.FoldingRangeRequest=ts.FoldingRangeKind=void 0;var CS=rn(),PS;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(PS=ts.FoldingRangeKind||(ts.FoldingRangeKind={}));var AS;(function(t){t.method="textDocument/foldingRange",t.type=new CS.ProtocolRequestType(t.method)})(AS=ts.FoldingRangeRequest||(ts.FoldingRangeRequest={}))});var U_=X(nl=>{"use strict";Object.defineProperty(nl,"__esModule",{value:!0});nl.DeclarationRequest=void 0;var SS=rn(),ES;(function(t){t.method="textDocument/declaration",t.type=new SS.ProtocolRequestType(t.method)})(ES=nl.DeclarationRequest||(nl.DeclarationRequest={}))});var W_=X(rl=>{"use strict";Object.defineProperty(rl,"__esModule",{value:!0});rl.SelectionRangeRequest=void 0;var IS=rn(),DS;(function(t){t.method="textDocument/selectionRange",t.type=new IS.ProtocolRequestType(t.method)})(DS=rl.SelectionRangeRequest||(rl.SelectionRangeRequest={}))});var Y_=X(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.WorkDoneProgressCancelNotification=Xr.WorkDoneProgressCreateRequest=Xr.WorkDoneProgress=void 0;var xS=Da(),G_=rn(),RS;(function(t){t.type=new xS.ProgressType;function e(n){return n===t.type}t.is=e})(RS=Xr.WorkDoneProgress||(Xr.WorkDoneProgress={}));var wS;(function(t){t.type=new G_.ProtocolRequestType("window/workDoneProgress/create")})(wS=Xr.WorkDoneProgressCreateRequest||(Xr.WorkDoneProgressCreateRequest={}));var OS;(function(t){t.type=new G_.ProtocolNotificationType("window/workDoneProgress/cancel")})(OS=Xr.WorkDoneProgressCancelNotification||(Xr.WorkDoneProgressCancelNotification={}))});var H_=X(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.CallHierarchyOutgoingCallsRequest=Qr.CallHierarchyIncomingCallsRequest=Qr.CallHierarchyPrepareRequest=void 0;var xp=rn(),LS;(function(t){t.method="textDocument/prepareCallHierarchy",t.type=new xp.ProtocolRequestType(t.method)})(LS=Qr.CallHierarchyPrepareRequest||(Qr.CallHierarchyPrepareRequest={}));var FS;(function(t){t.method="callHierarchy/incomingCalls",t.type=new xp.ProtocolRequestType(t.method)})(FS=Qr.CallHierarchyIncomingCallsRequest||(Qr.CallHierarchyIncomingCallsRequest={}));var kS;(function(t){t.method="callHierarchy/outgoingCalls",t.type=new xp.ProtocolRequestType(t.method)})(kS=Qr.CallHierarchyOutgoingCallsRequest||(Qr.CallHierarchyOutgoingCallsRequest={}))});var $_=X(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.SemanticTokensRefreshRequest=rt.SemanticTokensRangeRequest=rt.SemanticTokensDeltaRequest=rt.SemanticTokensRequest=rt.SemanticTokensRegistrationType=rt.TokenFormat=rt.SemanticTokens=rt.SemanticTokenModifiers=rt.SemanticTokenTypes=void 0;var il=rn(),MS;(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator"})(MS=rt.SemanticTokenTypes||(rt.SemanticTokenTypes={}));var BS;(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})(BS=rt.SemanticTokenModifiers||(rt.SemanticTokenModifiers={}));var qS;(function(t){function e(n){let r=n;return r!==void 0&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}t.is=e})(qS=rt.SemanticTokens||(rt.SemanticTokens={}));var VS;(function(t){t.Relative="relative"})(VS=rt.TokenFormat||(rt.TokenFormat={}));var jS;(function(t){t.method="textDocument/semanticTokens",t.type=new il.RegistrationType(t.method)})(jS=rt.SemanticTokensRegistrationType||(rt.SemanticTokensRegistrationType={}));var US;(function(t){t.method="textDocument/semanticTokens/full",t.type=new il.ProtocolRequestType(t.method)})(US=rt.SemanticTokensRequest||(rt.SemanticTokensRequest={}));var WS;(function(t){t.method="textDocument/semanticTokens/full/delta",t.type=new il.ProtocolRequestType(t.method)})(WS=rt.SemanticTokensDeltaRequest||(rt.SemanticTokensDeltaRequest={}));var GS;(function(t){t.method="textDocument/semanticTokens/range",t.type=new il.ProtocolRequestType(t.method)})(GS=rt.SemanticTokensRangeRequest||(rt.SemanticTokensRangeRequest={}));var YS;(function(t){t.method="workspace/semanticTokens/refresh",t.type=new il.ProtocolRequestType0(t.method)})(YS=rt.SemanticTokensRefreshRequest||(rt.SemanticTokensRefreshRequest={}))});var K_=X(sl=>{"use strict";Object.defineProperty(sl,"__esModule",{value:!0});sl.ShowDocumentRequest=void 0;var HS=rn(),$S;(function(t){t.method="window/showDocument",t.type=new HS.ProtocolRequestType(t.method)})($S=sl.ShowDocumentRequest||(sl.ShowDocumentRequest={}))});var z_=X(al=>{"use strict";Object.defineProperty(al,"__esModule",{value:!0});al.LinkedEditingRangeRequest=void 0;var KS=rn(),zS;(function(t){t.method="textDocument/linkedEditingRange",t.type=new KS.ProtocolRequestType(t.method)})(zS=al.LinkedEditingRangeRequest||(al.LinkedEditingRangeRequest={}))});var X_=X(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.WillDeleteFilesRequest=At.DidDeleteFilesNotification=At.DidRenameFilesNotification=At.WillRenameFilesRequest=At.DidCreateFilesNotification=At.WillCreateFilesRequest=At.FileOperationPatternKind=void 0;var Ra=rn(),XS;(function(t){t.file="file",t.folder="folder"})(XS=At.FileOperationPatternKind||(At.FileOperationPatternKind={}));var QS;(function(t){t.method="workspace/willCreateFiles",t.type=new Ra.ProtocolRequestType(t.method)})(QS=At.WillCreateFilesRequest||(At.WillCreateFilesRequest={}));var JS;(function(t){t.method="workspace/didCreateFiles",t.type=new Ra.ProtocolNotificationType(t.method)})(JS=At.DidCreateFilesNotification||(At.DidCreateFilesNotification={}));var ZS;(function(t){t.method="workspace/willRenameFiles",t.type=new Ra.ProtocolRequestType(t.method)})(ZS=At.WillRenameFilesRequest||(At.WillRenameFilesRequest={}));var eE;(function(t){t.method="workspace/didRenameFiles",t.type=new Ra.ProtocolNotificationType(t.method)})(eE=At.DidRenameFilesNotification||(At.DidRenameFilesNotification={}));var tE;(function(t){t.method="workspace/didDeleteFiles",t.type=new Ra.ProtocolNotificationType(t.method)})(tE=At.DidDeleteFilesNotification||(At.DidDeleteFilesNotification={}));var nE;(function(t){t.method="workspace/willDeleteFiles",t.type=new Ra.ProtocolRequestType(t.method)})(nE=At.WillDeleteFilesRequest||(At.WillDeleteFilesRequest={}))});var Q_=X(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.MonikerRequest=Jr.MonikerKind=Jr.UniquenessLevel=void 0;var rE=rn(),iE;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(iE=Jr.UniquenessLevel||(Jr.UniquenessLevel={}));var sE;(function(t){t.import="import",t.export="export",t.local="local"})(sE=Jr.MonikerKind||(Jr.MonikerKind={}));var aE;(function(t){t.method="textDocument/moniker",t.type=new rE.ProtocolRequestType(t.method)})(aE=Jr.MonikerRequest||(Jr.MonikerRequest={}))});var ny=X(E=>{"use strict";Object.defineProperty(E,"__esModule",{value:!0});E.DocumentLinkRequest=E.CodeLensRefreshRequest=E.CodeLensResolveRequest=E.CodeLensRequest=E.WorkspaceSymbolRequest=E.CodeActionResolveRequest=E.CodeActionRequest=E.DocumentSymbolRequest=E.DocumentHighlightRequest=E.ReferencesRequest=E.DefinitionRequest=E.SignatureHelpRequest=E.SignatureHelpTriggerKind=E.HoverRequest=E.CompletionResolveRequest=E.CompletionRequest=E.CompletionTriggerKind=E.PublishDiagnosticsNotification=E.WatchKind=E.FileChangeType=E.DidChangeWatchedFilesNotification=E.WillSaveTextDocumentWaitUntilRequest=E.WillSaveTextDocumentNotification=E.TextDocumentSaveReason=E.DidSaveTextDocumentNotification=E.DidCloseTextDocumentNotification=E.DidChangeTextDocumentNotification=E.TextDocumentContentChangeEvent=E.DidOpenTextDocumentNotification=E.TextDocumentSyncKind=E.TelemetryEventNotification=E.LogMessageNotification=E.ShowMessageRequest=E.ShowMessageNotification=E.MessageType=E.DidChangeConfigurationNotification=E.ExitNotification=E.ShutdownRequest=E.InitializedNotification=E.InitializeError=E.InitializeRequest=E.WorkDoneProgressOptions=E.TextDocumentRegistrationOptions=E.StaticRegistrationOptions=E.FailureHandlingKind=E.ResourceOperationKind=E.UnregistrationRequest=E.RegistrationRequest=E.DocumentSelector=E.DocumentFilter=void 0;E.MonikerRequest=E.MonikerKind=E.UniquenessLevel=E.WillDeleteFilesRequest=E.DidDeleteFilesNotification=E.WillRenameFilesRequest=E.DidRenameFilesNotification=E.WillCreateFilesRequest=E.DidCreateFilesNotification=E.FileOperationPatternKind=E.LinkedEditingRangeRequest=E.ShowDocumentRequest=E.SemanticTokensRegistrationType=E.SemanticTokensRefreshRequest=E.SemanticTokensRangeRequest=E.SemanticTokensDeltaRequest=E.SemanticTokensRequest=E.TokenFormat=E.SemanticTokens=E.SemanticTokenModifiers=E.SemanticTokenTypes=E.CallHierarchyPrepareRequest=E.CallHierarchyOutgoingCallsRequest=E.CallHierarchyIncomingCallsRequest=E.WorkDoneProgressCancelNotification=E.WorkDoneProgressCreateRequest=E.WorkDoneProgress=E.SelectionRangeRequest=E.DeclarationRequest=E.FoldingRangeRequest=E.ColorPresentationRequest=E.DocumentColorRequest=E.ConfigurationRequest=E.DidChangeWorkspaceFoldersNotification=E.WorkspaceFoldersRequest=E.TypeDefinitionRequest=E.ImplementationRequest=E.ApplyWorkspaceEditRequest=E.ExecuteCommandRequest=E.PrepareRenameRequest=E.RenameRequest=E.PrepareSupportDefaultBehavior=E.DocumentOnTypeFormattingRequest=E.DocumentRangeFormattingRequest=E.DocumentFormattingRequest=E.DocumentLinkResolveRequest=void 0;var ns=O_(),ke=rn(),oE=L_();Object.defineProperty(E,"ImplementationRequest",{enumerable:!0,get:function(){return oE.ImplementationRequest}});var lE=F_();Object.defineProperty(E,"TypeDefinitionRequest",{enumerable:!0,get:function(){return lE.TypeDefinitionRequest}});var J_=M_();Object.defineProperty(E,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return J_.WorkspaceFoldersRequest}});Object.defineProperty(E,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return J_.DidChangeWorkspaceFoldersNotification}});var uE=B_();Object.defineProperty(E,"ConfigurationRequest",{enumerable:!0,get:function(){return uE.ConfigurationRequest}});var Z_=V_();Object.defineProperty(E,"DocumentColorRequest",{enumerable:!0,get:function(){return Z_.DocumentColorRequest}});Object.defineProperty(E,"ColorPresentationRequest",{enumerable:!0,get:function(){return Z_.ColorPresentationRequest}});var cE=j_();Object.defineProperty(E,"FoldingRangeRequest",{enumerable:!0,get:function(){return cE.FoldingRangeRequest}});var fE=U_();Object.defineProperty(E,"DeclarationRequest",{enumerable:!0,get:function(){return fE.DeclarationRequest}});var pE=W_();Object.defineProperty(E,"SelectionRangeRequest",{enumerable:!0,get:function(){return pE.SelectionRangeRequest}});var Rp=Y_();Object.defineProperty(E,"WorkDoneProgress",{enumerable:!0,get:function(){return Rp.WorkDoneProgress}});Object.defineProperty(E,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return Rp.WorkDoneProgressCreateRequest}});Object.defineProperty(E,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return Rp.WorkDoneProgressCancelNotification}});var wp=H_();Object.defineProperty(E,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return wp.CallHierarchyIncomingCallsRequest}});Object.defineProperty(E,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return wp.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(E,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return wp.CallHierarchyPrepareRequest}});var ki=$_();Object.defineProperty(E,"SemanticTokenTypes",{enumerable:!0,get:function(){return ki.SemanticTokenTypes}});Object.defineProperty(E,"SemanticTokenModifiers",{enumerable:!0,get:function(){return ki.SemanticTokenModifiers}});Object.defineProperty(E,"SemanticTokens",{enumerable:!0,get:function(){return ki.SemanticTokens}});Object.defineProperty(E,"TokenFormat",{enumerable:!0,get:function(){return ki.TokenFormat}});Object.defineProperty(E,"SemanticTokensRequest",{enumerable:!0,get:function(){return ki.SemanticTokensRequest}});Object.defineProperty(E,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return ki.SemanticTokensDeltaRequest}});Object.defineProperty(E,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return ki.SemanticTokensRangeRequest}});Object.defineProperty(E,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return ki.SemanticTokensRefreshRequest}});Object.defineProperty(E,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return ki.SemanticTokensRegistrationType}});var dE=K_();Object.defineProperty(E,"ShowDocumentRequest",{enumerable:!0,get:function(){return dE.ShowDocumentRequest}});var hE=z_();Object.defineProperty(E,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return hE.LinkedEditingRangeRequest}});var Ms=X_();Object.defineProperty(E,"FileOperationPatternKind",{enumerable:!0,get:function(){return Ms.FileOperationPatternKind}});Object.defineProperty(E,"DidCreateFilesNotification",{enumerable:!0,get:function(){return Ms.DidCreateFilesNotification}});Object.defineProperty(E,"WillCreateFilesRequest",{enumerable:!0,get:function(){return Ms.WillCreateFilesRequest}});Object.defineProperty(E,"DidRenameFilesNotification",{enumerable:!0,get:function(){return Ms.DidRenameFilesNotification}});Object.defineProperty(E,"WillRenameFilesRequest",{enumerable:!0,get:function(){return Ms.WillRenameFilesRequest}});Object.defineProperty(E,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return Ms.DidDeleteFilesNotification}});Object.defineProperty(E,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return Ms.WillDeleteFilesRequest}});var Op=Q_();Object.defineProperty(E,"UniquenessLevel",{enumerable:!0,get:function(){return Op.UniquenessLevel}});Object.defineProperty(E,"MonikerKind",{enumerable:!0,get:function(){return Op.MonikerKind}});Object.defineProperty(E,"MonikerRequest",{enumerable:!0,get:function(){return Op.MonikerRequest}});var ey;(function(t){function e(n){let r=n;return ns.string(r.language)||ns.string(r.scheme)||ns.string(r.pattern)}t.is=e})(ey=E.DocumentFilter||(E.DocumentFilter={}));var ty;(function(t){function e(n){if(!Array.isArray(n))return!1;for(let r of n)if(!ns.string(r)&&!ey.is(r))return!1;return!0}t.is=e})(ty=E.DocumentSelector||(E.DocumentSelector={}));var mE;(function(t){t.type=new ke.ProtocolRequestType("client/registerCapability")})(mE=E.RegistrationRequest||(E.RegistrationRequest={}));var gE;(function(t){t.type=new ke.ProtocolRequestType("client/unregisterCapability")})(gE=E.UnregistrationRequest||(E.UnregistrationRequest={}));var _E;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(_E=E.ResourceOperationKind||(E.ResourceOperationKind={}));var yE;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(yE=E.FailureHandlingKind||(E.FailureHandlingKind={}));var bE;(function(t){function e(n){let r=n;return r&&ns.string(r.id)&&r.id.length>0}t.hasId=e})(bE=E.StaticRegistrationOptions||(E.StaticRegistrationOptions={}));var TE;(function(t){function e(n){let r=n;return r&&(r.documentSelector===null||ty.is(r.documentSelector))}t.is=e})(TE=E.TextDocumentRegistrationOptions||(E.TextDocumentRegistrationOptions={}));var vE;(function(t){function e(r){let i=r;return ns.objectLiteral(i)&&(i.workDoneProgress===void 0||ns.boolean(i.workDoneProgress))}t.is=e;function n(r){let i=r;return i&&ns.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=n})(vE=E.WorkDoneProgressOptions||(E.WorkDoneProgressOptions={}));var NE;(function(t){t.type=new ke.ProtocolRequestType("initialize")})(NE=E.InitializeRequest||(E.InitializeRequest={}));var CE;(function(t){t.unknownProtocolVersion=1})(CE=E.InitializeError||(E.InitializeError={}));var PE;(function(t){t.type=new ke.ProtocolNotificationType("initialized")})(PE=E.InitializedNotification||(E.InitializedNotification={}));var AE;(function(t){t.type=new ke.ProtocolRequestType0("shutdown")})(AE=E.ShutdownRequest||(E.ShutdownRequest={}));var SE;(function(t){t.type=new ke.ProtocolNotificationType0("exit")})(SE=E.ExitNotification||(E.ExitNotification={}));var EE;(function(t){t.type=new ke.ProtocolNotificationType("workspace/didChangeConfiguration")})(EE=E.DidChangeConfigurationNotification||(E.DidChangeConfigurationNotification={}));var IE;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4})(IE=E.MessageType||(E.MessageType={}));var DE;(function(t){t.type=new ke.ProtocolNotificationType("window/showMessage")})(DE=E.ShowMessageNotification||(E.ShowMessageNotification={}));var xE;(function(t){t.type=new ke.ProtocolRequestType("window/showMessageRequest")})(xE=E.ShowMessageRequest||(E.ShowMessageRequest={}));var RE;(function(t){t.type=new ke.ProtocolNotificationType("window/logMessage")})(RE=E.LogMessageNotification||(E.LogMessageNotification={}));var wE;(function(t){t.type=new ke.ProtocolNotificationType("telemetry/event")})(wE=E.TelemetryEventNotification||(E.TelemetryEventNotification={}));var OE;(function(t){t.None=0,t.Full=1,t.Incremental=2})(OE=E.TextDocumentSyncKind||(E.TextDocumentSyncKind={}));var LE;(function(t){t.method="textDocument/didOpen",t.type=new ke.ProtocolNotificationType(t.method)})(LE=E.DidOpenTextDocumentNotification||(E.DidOpenTextDocumentNotification={}));var FE;(function(t){function e(r){let i=r;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}t.isIncremental=e;function n(r){let i=r;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}t.isFull=n})(FE=E.TextDocumentContentChangeEvent||(E.TextDocumentContentChangeEvent={}));var kE;(function(t){t.method="textDocument/didChange",t.type=new ke.ProtocolNotificationType(t.method)})(kE=E.DidChangeTextDocumentNotification||(E.DidChangeTextDocumentNotification={}));var ME;(function(t){t.method="textDocument/didClose",t.type=new ke.ProtocolNotificationType(t.method)})(ME=E.DidCloseTextDocumentNotification||(E.DidCloseTextDocumentNotification={}));var BE;(function(t){t.method="textDocument/didSave",t.type=new ke.ProtocolNotificationType(t.method)})(BE=E.DidSaveTextDocumentNotification||(E.DidSaveTextDocumentNotification={}));var qE;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(qE=E.TextDocumentSaveReason||(E.TextDocumentSaveReason={}));var VE;(function(t){t.method="textDocument/willSave",t.type=new ke.ProtocolNotificationType(t.method)})(VE=E.WillSaveTextDocumentNotification||(E.WillSaveTextDocumentNotification={}));var jE;(function(t){t.method="textDocument/willSaveWaitUntil",t.type=new ke.ProtocolRequestType(t.method)})(jE=E.WillSaveTextDocumentWaitUntilRequest||(E.WillSaveTextDocumentWaitUntilRequest={}));var UE;(function(t){t.type=new ke.ProtocolNotificationType("workspace/didChangeWatchedFiles")})(UE=E.DidChangeWatchedFilesNotification||(E.DidChangeWatchedFilesNotification={}));var WE;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(WE=E.FileChangeType||(E.FileChangeType={}));var GE;(function(t){t.Create=1,t.Change=2,t.Delete=4})(GE=E.WatchKind||(E.WatchKind={}));var YE;(function(t){t.type=new ke.ProtocolNotificationType("textDocument/publishDiagnostics")})(YE=E.PublishDiagnosticsNotification||(E.PublishDiagnosticsNotification={}));var HE;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(HE=E.CompletionTriggerKind||(E.CompletionTriggerKind={}));var $E;(function(t){t.method="textDocument/completion",t.type=new ke.ProtocolRequestType(t.method)})($E=E.CompletionRequest||(E.CompletionRequest={}));var KE;(function(t){t.method="completionItem/resolve",t.type=new ke.ProtocolRequestType(t.method)})(KE=E.CompletionResolveRequest||(E.CompletionResolveRequest={}));var zE;(function(t){t.method="textDocument/hover",t.type=new ke.ProtocolRequestType(t.method)})(zE=E.HoverRequest||(E.HoverRequest={}));var XE;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(XE=E.SignatureHelpTriggerKind||(E.SignatureHelpTriggerKind={}));var QE;(function(t){t.method="textDocument/signatureHelp",t.type=new ke.ProtocolRequestType(t.method)})(QE=E.SignatureHelpRequest||(E.SignatureHelpRequest={}));var JE;(function(t){t.method="textDocument/definition",t.type=new ke.ProtocolRequestType(t.method)})(JE=E.DefinitionRequest||(E.DefinitionRequest={}));var ZE;(function(t){t.method="textDocument/references",t.type=new ke.ProtocolRequestType(t.method)})(ZE=E.ReferencesRequest||(E.ReferencesRequest={}));var eI;(function(t){t.method="textDocument/documentHighlight",t.type=new ke.ProtocolRequestType(t.method)})(eI=E.DocumentHighlightRequest||(E.DocumentHighlightRequest={}));var tI;(function(t){t.method="textDocument/documentSymbol",t.type=new ke.ProtocolRequestType(t.method)})(tI=E.DocumentSymbolRequest||(E.DocumentSymbolRequest={}));var nI;(function(t){t.method="textDocument/codeAction",t.type=new ke.ProtocolRequestType(t.method)})(nI=E.CodeActionRequest||(E.CodeActionRequest={}));var rI;(function(t){t.method="codeAction/resolve",t.type=new ke.ProtocolRequestType(t.method)})(rI=E.CodeActionResolveRequest||(E.CodeActionResolveRequest={}));var iI;(function(t){t.method="workspace/symbol",t.type=new ke.ProtocolRequestType(t.method)})(iI=E.WorkspaceSymbolRequest||(E.WorkspaceSymbolRequest={}));var sI;(function(t){t.method="textDocument/codeLens",t.type=new ke.ProtocolRequestType(t.method)})(sI=E.CodeLensRequest||(E.CodeLensRequest={}));var aI;(function(t){t.method="codeLens/resolve",t.type=new ke.ProtocolRequestType(t.method)})(aI=E.CodeLensResolveRequest||(E.CodeLensResolveRequest={}));var oI;(function(t){t.method="workspace/codeLens/refresh",t.type=new ke.ProtocolRequestType0(t.method)})(oI=E.CodeLensRefreshRequest||(E.CodeLensRefreshRequest={}));var lI;(function(t){t.method="textDocument/documentLink",t.type=new ke.ProtocolRequestType(t.method)})(lI=E.DocumentLinkRequest||(E.DocumentLinkRequest={}));var uI;(function(t){t.method="documentLink/resolve",t.type=new ke.ProtocolRequestType(t.method)})(uI=E.DocumentLinkResolveRequest||(E.DocumentLinkResolveRequest={}));var cI;(function(t){t.method="textDocument/formatting",t.type=new ke.ProtocolRequestType(t.method)})(cI=E.DocumentFormattingRequest||(E.DocumentFormattingRequest={}));var fI;(function(t){t.method="textDocument/rangeFormatting",t.type=new ke.ProtocolRequestType(t.method)})(fI=E.DocumentRangeFormattingRequest||(E.DocumentRangeFormattingRequest={}));var pI;(function(t){t.method="textDocument/onTypeFormatting",t.type=new ke.ProtocolRequestType(t.method)})(pI=E.DocumentOnTypeFormattingRequest||(E.DocumentOnTypeFormattingRequest={}));var dI;(function(t){t.Identifier=1})(dI=E.PrepareSupportDefaultBehavior||(E.PrepareSupportDefaultBehavior={}));var hI;(function(t){t.method="textDocument/rename",t.type=new ke.ProtocolRequestType(t.method)})(hI=E.RenameRequest||(E.RenameRequest={}));var mI;(function(t){t.method="textDocument/prepareRename",t.type=new ke.ProtocolRequestType(t.method)})(mI=E.PrepareRenameRequest||(E.PrepareRenameRequest={}));var gI;(function(t){t.type=new ke.ProtocolRequestType("workspace/executeCommand")})(gI=E.ExecuteCommandRequest||(E.ExecuteCommandRequest={}));var _I;(function(t){t.type=new ke.ProtocolRequestType("workspace/applyEdit")})(_I=E.ApplyWorkspaceEditRequest||(E.ApplyWorkspaceEditRequest={}))});var iy=X(vu=>{"use strict";Object.defineProperty(vu,"__esModule",{value:!0});vu.createProtocolConnection=void 0;var ry=Da();function yI(t,e,n,r){return ry.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),ry.createMessageConnection(t,e,n,r)}vu.createProtocolConnection=yI});var sy=X(In=>{"use strict";var bI=In&&In.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Nu=In&&In.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&bI(e,t,n)};Object.defineProperty(In,"__esModule",{value:!0});In.LSPErrorCodes=In.createProtocolConnection=void 0;Nu(Da(),In);Nu(vt(),In);Nu(rn(),In);Nu(ny(),In);var TI=iy();Object.defineProperty(In,"createProtocolConnection",{enumerable:!0,get:function(){return TI.createProtocolConnection}});var vI;(function(t){t.lspReservedErrorRangeStart=-32899,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(vI=In.LSPErrorCodes||(In.LSPErrorCodes={}))});var Bn=X(_i=>{"use strict";var NI=_i&&_i.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),ay=_i&&_i.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&NI(e,t,n)};Object.defineProperty(_i,"__esModule",{value:!0});_i.createProtocolConnection=void 0;var CI=Dp();ay(Dp(),_i);ay(sy(),_i);function PI(t,e,n,r){return CI.createMessageConnection(t,e,n,r)}_i.createProtocolConnection=PI});var Lp=X(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:!0});Tr.generateUuid=Tr.parse=Tr.isUUID=Tr.v4=Tr.empty=void 0;var Cu=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},Ue=class extends Cu{constructor(){super([Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),"-",Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),"-","4",Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),"-",Ue._oneOf(Ue._timeHighBits),Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),"-",Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),Ue._randomHex()].join(""))}static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return Ue._oneOf(Ue._chars)}};Ue._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];Ue._timeHighBits=["8","9","a","b"];Tr.empty=new Cu("00000000-0000-0000-0000-000000000000");function oy(){return new Ue}Tr.v4=oy;var AI=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function ly(t){return AI.test(t)}Tr.isUUID=ly;function SI(t){if(!ly(t))throw new Error("invalid uuid");return new Cu(t)}Tr.parse=SI;function EI(){return oy().asHex()}Tr.generateUuid=EI});var cy=X(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.attachPartialResult=is.ProgressFeature=is.attachWorkDone=void 0;var rs=Bn(),II=Lp(),Mi=class{constructor(e,n){this._connection=e,this._token=n,Mi.Instances.set(this._token,this)}begin(e,n,r,i){let s={kind:"begin",title:e,percentage:n,message:r,cancellable:i};this._connection.sendProgress(rs.WorkDoneProgress.type,this._token,s)}report(e,n){let r={kind:"report"};typeof e=="number"?(r.percentage=e,n!==void 0&&(r.message=n)):r.message=e,this._connection.sendProgress(rs.WorkDoneProgress.type,this._token,r)}done(){Mi.Instances.delete(this._token),this._connection.sendProgress(rs.WorkDoneProgress.type,this._token,{kind:"end"})}};Mi.Instances=new Map;var Fp=class extends Mi{constructor(e,n){super(e,n);this._source=new rs.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},Pu=class{constructor(){}begin(){}report(){}done(){}},kp=class extends Pu{constructor(){super();this._source=new rs.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function DI(t,e){if(e===void 0||e.workDoneToken===void 0)return new Pu;let n=e.workDoneToken;return delete e.workDoneToken,new Mi(t,n)}is.attachWorkDone=DI;var xI=t=>class extends t{constructor(){super();this._progressSupported=!1}initialize(e){var n;((n=e==null?void 0:e.window)===null||n===void 0?void 0:n.workDoneProgress)===!0&&(this._progressSupported=!0,this.connection.onNotification(rs.WorkDoneProgressCancelNotification.type,r=>{let i=Mi.Instances.get(r.token);(i instanceof Fp||i instanceof kp)&&i.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new Pu:new Mi(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=II.generateUuid();return this.connection.sendRequest(rs.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new Fp(this.connection,e))}else return Promise.resolve(new kp)}};is.ProgressFeature=xI;var Mp;(function(t){t.type=new rs.ProgressType})(Mp||(Mp={}));var uy=class{constructor(e,n){this._connection=e,this._token=n}report(e){this._connection.sendProgress(Mp.type,this._token,e)}};function RI(t,e){if(e===void 0||e.partialResultToken===void 0)return;let n=e.partialResultToken;return delete e.partialResultToken,new uy(t,n)}is.attachPartialResult=RI});var fy=X(Au=>{"use strict";Object.defineProperty(Au,"__esModule",{value:!0});Au.ConfigurationFeature=void 0;var wI=Bn(),OI=pu(),LI=t=>class extends t{getConfiguration(e){return e?OI.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let n={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(wI.ConfigurationRequest.type,n).then(r=>Array.isArray(e)?r:r[0])}};Au.ConfigurationFeature=LI});var py=X(Eu=>{"use strict";Object.defineProperty(Eu,"__esModule",{value:!0});Eu.WorkspaceFoldersFeature=void 0;var Su=Bn(),FI=t=>class extends t{initialize(e){let n=e.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Su.Emitter,this.connection.onNotification(Su.DidChangeWorkspaceFoldersNotification.type,r=>{this._onDidChangeWorkspaceFolders.fire(r.event)}))}getWorkspaceFolders(){return this.connection.sendRequest(Su.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return this._unregistration||(this._unregistration=this.connection.client.register(Su.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};Eu.WorkspaceFoldersFeature=FI});var dy=X(Iu=>{"use strict";Object.defineProperty(Iu,"__esModule",{value:!0});Iu.CallHierarchyFeature=void 0;var Bp=Bn(),kI=t=>class extends t{get callHierarchy(){return{onPrepare:e=>{this.connection.onRequest(Bp.CallHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0))},onIncomingCalls:e=>{let n=Bp.CallHierarchyIncomingCallsRequest.type;this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onOutgoingCalls:e=>{let n=Bp.CallHierarchyOutgoingCallsRequest.type;this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Iu.CallHierarchyFeature=kI});var Vp=X(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});wa.SemanticTokensBuilder=wa.SemanticTokensFeature=void 0;var qp=Bn(),MI=t=>class extends t{get semanticTokens(){return{on:e=>{let n=qp.SemanticTokensRequest.type;this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onDelta:e=>{let n=qp.SemanticTokensDeltaRequest.type;this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onRange:e=>{let n=qp.SemanticTokensRangeRequest.type;this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};wa.SemanticTokensFeature=MI;var hy=class{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(e,n,r,i,s){let a=e,o=n;this._dataLen>0&&(a-=this._prevLine,a===0&&(o-=this._prevChar)),this._data[this._dataLen++]=a,this._data[this._dataLen++]=o,this._data[this._dataLen++]=r,this._data[this._dataLen++]=i,this._data[this._dataLen++]=s,this._prevLine=e,this._prevChar=n}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){if(this._prevData!==void 0){let e=this._prevData.length,n=this._data.length,r=0;for(;r{"use strict";Object.defineProperty(Du,"__esModule",{value:!0});Du.ShowDocumentFeature=void 0;var BI=Bn(),qI=t=>class extends t{showDocument(e){return this.connection.sendRequest(BI.ShowDocumentRequest.type,e)}};Du.ShowDocumentFeature=qI});var gy=X(xu=>{"use strict";Object.defineProperty(xu,"__esModule",{value:!0});xu.FileOperationsFeature=void 0;var Oa=Bn(),VI=t=>class extends t{onDidCreateFiles(e){this.connection.onNotification(Oa.DidCreateFilesNotification.type,n=>{e(n)})}onDidRenameFiles(e){this.connection.onNotification(Oa.DidRenameFilesNotification.type,n=>{e(n)})}onDidDeleteFiles(e){this.connection.onNotification(Oa.DidDeleteFilesNotification.type,n=>{e(n)})}onWillCreateFiles(e){return this.connection.onRequest(Oa.WillCreateFilesRequest.type,(n,r)=>e(n,r))}onWillRenameFiles(e){return this.connection.onRequest(Oa.WillRenameFilesRequest.type,(n,r)=>e(n,r))}onWillDeleteFiles(e){return this.connection.onRequest(Oa.WillDeleteFilesRequest.type,(n,r)=>e(n,r))}};xu.FileOperationsFeature=VI});var _y=X(Ru=>{"use strict";Object.defineProperty(Ru,"__esModule",{value:!0});Ru.LinkedEditingRangeFeature=void 0;var jI=Bn(),UI=t=>class extends t{onLinkedEditingRange(e){this.connection.onRequest(jI.LinkedEditingRangeRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0))}};Ru.LinkedEditingRangeFeature=UI});var yy=X(wu=>{"use strict";Object.defineProperty(wu,"__esModule",{value:!0});wu.MonikerFeature=void 0;var WI=Bn(),GI=t=>class extends t{get moniker(){return{on:e=>{let n=WI.MonikerRequest.type;this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};wu.MonikerFeature=GI});var zp=X(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});ze.createConnection=ze.combineFeatures=ze.combineLanguagesFeatures=ze.combineWorkspaceFeatures=ze.combineWindowFeatures=ze.combineClientFeatures=ze.combineTracerFeatures=ze.combineTelemetryFeatures=ze.combineConsoleFeatures=ze._LanguagesImpl=ze.BulkUnregistration=ze.BulkRegistration=ze.ErrorMessageTracker=ze.TextDocuments=void 0;var ie=Bn(),vr=pu(),jp=Lp(),Me=cy(),YI=fy(),HI=py(),$I=dy(),KI=Vp(),zI=my(),XI=gy(),QI=_y(),JI=yy();function Up(t){if(t!==null)return t}var by=class{constructor(e){this._documents=Object.create(null),this._configuration=e,this._onDidChangeContent=new ie.Emitter,this._onDidOpen=new ie.Emitter,this._onDidClose=new ie.Emitter,this._onDidSave=new ie.Emitter,this._onWillSave=new ie.Emitter}get onDidChangeContent(){return this._onDidChangeContent.event}get onDidOpen(){return this._onDidOpen.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._documents[e]}all(){return Object.keys(this._documents).map(e=>this._documents[e])}keys(){return Object.keys(this._documents)}listen(e){e.__textDocumentSync=ie.TextDocumentSyncKind.Full,e.onDidOpenTextDocument(n=>{let r=n.textDocument,i=this._configuration.create(r.uri,r.languageId,r.version,r.text);this._documents[r.uri]=i;let s=Object.freeze({document:i});this._onDidOpen.fire(s),this._onDidChangeContent.fire(s)}),e.onDidChangeTextDocument(n=>{let r=n.textDocument,i=n.contentChanges;if(i.length===0)return;let s=this._documents[r.uri],{version:a}=r;if(a==null)throw new Error(`Received document change event for ${r.uri} without valid version identifier`);s=this._configuration.update(s,i,a),this._documents[r.uri]=s,this._onDidChangeContent.fire(Object.freeze({document:s}))}),e.onDidCloseTextDocument(n=>{let r=this._documents[n.textDocument.uri];r&&(delete this._documents[n.textDocument.uri],this._onDidClose.fire(Object.freeze({document:r})))}),e.onWillSaveTextDocument(n=>{let r=this._documents[n.textDocument.uri];r&&this._onWillSave.fire(Object.freeze({document:r,reason:n.reason}))}),e.onWillSaveTextDocumentWaitUntil((n,r)=>{let i=this._documents[n.textDocument.uri];return i&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:i,reason:n.reason}),r):[]}),e.onDidSaveTextDocument(n=>{let r=this._documents[n.textDocument.uri];r&&this._onDidSave.fire(Object.freeze({document:r}))})}};ze.TextDocuments=by;var Ty=class{constructor(){this._messages=Object.create(null)}add(e){let n=this._messages[e];n||(n=0),n++,this._messages[e]=n}sendErrors(e){Object.keys(this._messages).forEach(n=>{e.window.showErrorMessage(n)})}};ze.ErrorMessageTracker=Ty;var Wp=class{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(ie.MessageType.Error,e)}warn(e){this.send(ie.MessageType.Warning,e)}info(e){this.send(ie.MessageType.Info,e)}log(e){this.send(ie.MessageType.Log,e)}send(e,n){this._rawConnection&&this._rawConnection.sendNotification(ie.LogMessageNotification.type,{type:e,message:n})}},vy=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...n){let r={type:ie.MessageType.Error,message:e,actions:n};return this.connection.sendRequest(ie.ShowMessageRequest.type,r).then(Up)}showWarningMessage(e,...n){let r={type:ie.MessageType.Warning,message:e,actions:n};return this.connection.sendRequest(ie.ShowMessageRequest.type,r).then(Up)}showInformationMessage(e,...n){let r={type:ie.MessageType.Info,message:e,actions:n};return this.connection.sendRequest(ie.ShowMessageRequest.type,r).then(Up)}},Ny=zI.ShowDocumentFeature(Me.ProgressFeature(vy)),ZI;(function(t){function e(){return new Gp}t.create=e})(ZI=ze.BulkRegistration||(ze.BulkRegistration={}));var Gp=class{constructor(){this._registrations=[],this._registered=new Set}add(e,n){let r=vr.string(e)?e:e.method;if(this._registered.has(r))throw new Error(`${r} is already added to this registration`);let i=jp.generateUuid();this._registrations.push({id:i,method:r,registerOptions:n||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}},eD;(function(t){function e(){return new Ou(void 0,[])}t.create=e})(eD=ze.BulkUnregistration||(ze.BulkUnregistration={}));var Ou=class{constructor(e,n){this._connection=e,this._unregistrations=new Map,n.forEach(r=>{this._unregistrations.set(r.method,r)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let r of this._unregistrations.values())e.push(r);let n={unregisterations:e};this._connection.sendRequest(ie.UnregistrationRequest.type,n).then(void 0,r=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let n=vr.string(e)?e:e.method,r=this._unregistrations.get(n);if(!r)return!1;let i={unregisterations:[r]};return this._connection.sendRequest(ie.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(n)},s=>{this._connection.console.info(`Un-registering request handler for ${r.id} failed.`)}),!0}},Yp=class{attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,n,r){return e instanceof Gp?this.registerMany(e):e instanceof Ou?this.registerSingle1(e,n,r):this.registerSingle2(e,n)}registerSingle1(e,n,r){let i=vr.string(n)?n:n.method,s=jp.generateUuid(),a={registrations:[{id:s,method:i,registerOptions:r||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(ie.RegistrationRequest.type,a).then(o=>(e.add({id:s,method:i}),e),o=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(o)))}registerSingle2(e,n){let r=vr.string(e)?e:e.method,i=jp.generateUuid(),s={registrations:[{id:i,method:r,registerOptions:n||{}}]};return this.connection.sendRequest(ie.RegistrationRequest.type,s).then(a=>ie.Disposable.create(()=>{this.unregisterSingle(i,r)}),a=>(this.connection.console.info(`Registering request handler for ${r} failed.`),Promise.reject(a)))}unregisterSingle(e,n){let r={unregisterations:[{id:e,method:n}]};return this.connection.sendRequest(ie.UnregistrationRequest.type,r).then(void 0,i=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let n=e.asRegistrationParams();return this.connection.sendRequest(ie.RegistrationRequest.type,n).then(()=>new Ou(this._connection,n.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}},Cy=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function n(i){return i&&!!i.edit}let r=n(e)?e:{edit:e};return this.connection.sendRequest(ie.ApplyWorkspaceEditRequest.type,r)}},Py=XI.FileOperationsFeature(HI.WorkspaceFoldersFeature(YI.ConfigurationFeature(Cy))),Hp=class{constructor(){this._trace=ie.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,n){this._trace!==ie.Trace.Off&&this.connection.sendNotification(ie.LogTraceNotification.type,{message:e,verbose:this._trace===ie.Trace.Verbose?n:void 0})}},$p=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(ie.TelemetryEventNotification.type,e)}},Kp=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return Me.attachWorkDone(this.connection,e)}attachPartialResultProgress(e,n){return Me.attachPartialResult(this.connection,n)}};ze._LanguagesImpl=Kp;var Ay=JI.MonikerFeature(QI.LinkedEditingRangeFeature(KI.SemanticTokensFeature($I.CallHierarchyFeature(Kp))));function Sy(t,e){return function(n){return e(t(n))}}ze.combineConsoleFeatures=Sy;function Ey(t,e){return function(n){return e(t(n))}}ze.combineTelemetryFeatures=Ey;function Iy(t,e){return function(n){return e(t(n))}}ze.combineTracerFeatures=Iy;function Dy(t,e){return function(n){return e(t(n))}}ze.combineClientFeatures=Dy;function xy(t,e){return function(n){return e(t(n))}}ze.combineWindowFeatures=xy;function Ry(t,e){return function(n){return e(t(n))}}ze.combineWorkspaceFeatures=Ry;function tD(t,e){return function(n){return e(t(n))}}ze.combineLanguagesFeatures=tD;function nD(t,e){function n(i,s,a){return i&&s?a(i,s):i||s}return{__brand:"features",console:n(t.console,e.console,Sy),tracer:n(t.tracer,e.tracer,Iy),telemetry:n(t.telemetry,e.telemetry,Ey),client:n(t.client,e.client,Dy),window:n(t.window,e.window,xy),workspace:n(t.workspace,e.workspace,Ry)}}ze.combineFeatures=nD;function rD(t,e,n){let r=n&&n.console?new(n.console(Wp)):new Wp,i=t(r);r.rawAttach(i);let s=n&&n.tracer?new(n.tracer(Hp)):new Hp,a=n&&n.telemetry?new(n.telemetry($p)):new $p,o=n&&n.client?new(n.client(Yp)):new Yp,l=n&&n.window?new(n.window(Ny)):new Ny,u=n&&n.workspace?new(n.workspace(Py)):new Py,c=n&&n.languages?new(n.languages(Ay)):new Ay,f=[r,s,a,o,l,u,c];function h(m){return m instanceof Promise?m:vr.thenable(m)?new Promise((b,_)=>{m.then(N=>b(N),N=>_(N))}):Promise.resolve(m)}let y,p,d,g={listen:()=>i.listen(),sendRequest:(m,...b)=>i.sendRequest(vr.string(m)?m:m.method,...b),onRequest:(m,b)=>i.onRequest(m,b),sendNotification:(m,b)=>{let _=vr.string(m)?m:m.method;arguments.length===1?i.sendNotification(_):i.sendNotification(_,b)},onNotification:(m,b)=>i.onNotification(m,b),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:m=>p=m,onInitialized:m=>i.onNotification(ie.InitializedNotification.type,m),onShutdown:m=>y=m,onExit:m=>d=m,get console(){return r},get telemetry(){return a},get tracer(){return s},get client(){return o},get window(){return l},get workspace(){return u},get languages(){return c},onDidChangeConfiguration:m=>i.onNotification(ie.DidChangeConfigurationNotification.type,m),onDidChangeWatchedFiles:m=>i.onNotification(ie.DidChangeWatchedFilesNotification.type,m),__textDocumentSync:void 0,onDidOpenTextDocument:m=>i.onNotification(ie.DidOpenTextDocumentNotification.type,m),onDidChangeTextDocument:m=>i.onNotification(ie.DidChangeTextDocumentNotification.type,m),onDidCloseTextDocument:m=>i.onNotification(ie.DidCloseTextDocumentNotification.type,m),onWillSaveTextDocument:m=>i.onNotification(ie.WillSaveTextDocumentNotification.type,m),onWillSaveTextDocumentWaitUntil:m=>i.onRequest(ie.WillSaveTextDocumentWaitUntilRequest.type,m),onDidSaveTextDocument:m=>i.onNotification(ie.DidSaveTextDocumentNotification.type,m),sendDiagnostics:m=>i.sendNotification(ie.PublishDiagnosticsNotification.type,m),onHover:m=>i.onRequest(ie.HoverRequest.type,(b,_)=>m(b,_,Me.attachWorkDone(i,b),void 0)),onCompletion:m=>i.onRequest(ie.CompletionRequest.type,(b,_)=>m(b,_,Me.attachWorkDone(i,b),Me.attachPartialResult(i,b))),onCompletionResolve:m=>i.onRequest(ie.CompletionResolveRequest.type,m),onSignatureHelp:m=>i.onRequest(ie.SignatureHelpRequest.type,(b,_)=>m(b,_,Me.attachWorkDone(i,b),void 0)),onDeclaration:m=>i.onRequest(ie.DeclarationRequest.type,(b,_)=>m(b,_,Me.attachWorkDone(i,b),Me.attachPartialResult(i,b))),onDefinition:m=>i.onRequest(ie.DefinitionRequest.type,(b,_)=>m(b,_,Me.attachWorkDone(i,b),Me.attachPartialResult(i,b))),onTypeDefinition:m=>i.onRequest(ie.TypeDefinitionRequest.type,(b,_)=>m(b,_,Me.attachWorkDone(i,b),Me.attachPartialResult(i,b))),onImplementation:m=>i.onRequest(ie.ImplementationRequest.type,(b,_)=>m(b,_,Me.attachWorkDone(i,b),Me.attachPartialResult(i,b))),onReferences:m=>i.onRequest(ie.ReferencesRequest.type,(b,_)=>m(b,_,Me.attachWorkDone(i,b),Me.attachPartialResult(i,b))),onDocumentHighlight:m=>i.onRequest(ie.DocumentHighlightRequest.type,(b,_)=>m(b,_,Me.attachWorkDone(i,b),Me.attachPartialResult(i,b))),onDocumentSymbol:m=>i.onRequest(ie.DocumentSymbolRequest.type,(b,_)=>m(b,_,Me.attachWorkDone(i,b),Me.attachPartialResult(i,b))),onWorkspaceSymbol:m=>i.onRequest(ie.WorkspaceSymbolRequest.type,(b,_)=>m(b,_,Me.attachWorkDone(i,b),Me.attachPartialResult(i,b))),onCodeAction:m=>i.onRequest(ie.CodeActionRequest.type,(b,_)=>m(b,_,Me.attachWorkDone(i,b),Me.attachPartialResult(i,b))),onCodeActionResolve:m=>i.onRequest(ie.CodeActionResolveRequest.type,(b,_)=>m(b,_)),onCodeLens:m=>i.onRequest(ie.CodeLensRequest.type,(b,_)=>m(b,_,Me.attachWorkDone(i,b),Me.attachPartialResult(i,b))),onCodeLensResolve:m=>i.onRequest(ie.CodeLensResolveRequest.type,(b,_)=>m(b,_)),onDocumentFormatting:m=>i.onRequest(ie.DocumentFormattingRequest.type,(b,_)=>m(b,_,Me.attachWorkDone(i,b),void 0)),onDocumentRangeFormatting:m=>i.onRequest(ie.DocumentRangeFormattingRequest.type,(b,_)=>m(b,_,Me.attachWorkDone(i,b),void 0)),onDocumentOnTypeFormatting:m=>i.onRequest(ie.DocumentOnTypeFormattingRequest.type,(b,_)=>m(b,_)),onRenameRequest:m=>i.onRequest(ie.RenameRequest.type,(b,_)=>m(b,_,Me.attachWorkDone(i,b),void 0)),onPrepareRename:m=>i.onRequest(ie.PrepareRenameRequest.type,(b,_)=>m(b,_)),onDocumentLinks:m=>i.onRequest(ie.DocumentLinkRequest.type,(b,_)=>m(b,_,Me.attachWorkDone(i,b),Me.attachPartialResult(i,b))),onDocumentLinkResolve:m=>i.onRequest(ie.DocumentLinkResolveRequest.type,(b,_)=>m(b,_)),onDocumentColor:m=>i.onRequest(ie.DocumentColorRequest.type,(b,_)=>m(b,_,Me.attachWorkDone(i,b),Me.attachPartialResult(i,b))),onColorPresentation:m=>i.onRequest(ie.ColorPresentationRequest.type,(b,_)=>m(b,_,Me.attachWorkDone(i,b),Me.attachPartialResult(i,b))),onFoldingRanges:m=>i.onRequest(ie.FoldingRangeRequest.type,(b,_)=>m(b,_,Me.attachWorkDone(i,b),Me.attachPartialResult(i,b))),onSelectionRanges:m=>i.onRequest(ie.SelectionRangeRequest.type,(b,_)=>m(b,_,Me.attachWorkDone(i,b),Me.attachPartialResult(i,b))),onExecuteCommand:m=>i.onRequest(ie.ExecuteCommandRequest.type,(b,_)=>m(b,_,Me.attachWorkDone(i,b),void 0)),dispose:()=>i.dispose()};for(let m of f)m.attach(g);return i.onRequest(ie.InitializeRequest.type,m=>{e.initialize(m),vr.string(m.trace)&&(s.trace=ie.Trace.fromString(m.trace));for(let b of f)b.initialize(m.capabilities);if(p){let b=p(m,new ie.CancellationTokenSource().token,Me.attachWorkDone(i,m),void 0);return h(b).then(_=>{if(_ instanceof ie.ResponseError)return _;let N=_;N||(N={capabilities:{}});let C=N.capabilities;C||(C={},N.capabilities=C),C.textDocumentSync===void 0||C.textDocumentSync===null?C.textDocumentSync=vr.number(g.__textDocumentSync)?g.__textDocumentSync:ie.TextDocumentSyncKind.None:!vr.number(C.textDocumentSync)&&!vr.number(C.textDocumentSync.change)&&(C.textDocumentSync.change=vr.number(g.__textDocumentSync)?g.__textDocumentSync:ie.TextDocumentSyncKind.None);for(let G of f)G.fillServerCapabilities(C);return N})}else{let b={capabilities:{textDocumentSync:ie.TextDocumentSyncKind.None}};for(let _ of f)_.fillServerCapabilities(b.capabilities);return b}}),i.onRequest(ie.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,y)return y(new ie.CancellationTokenSource().token)}),i.onNotification(ie.ExitNotification.type,()=>{try{d&&d()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(ie.SetTraceNotification.type,m=>{s.trace=ie.Trace.fromString(m.value)}),g}ze.createConnection=rD});var Oy=X(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.resolveModulePath=Dn.FileSystem=Dn.resolveGlobalYarnPath=Dn.resolveGlobalNodePath=Dn.resolve=Dn.uriToFilePath=void 0;var iD=require("url"),Zr=require("path"),Xp=require("fs"),Qp=require("child_process");function sD(t){let e=iD.parse(t);if(e.protocol!=="file:"||!e.path)return;let n=e.path.split("/");for(var r=0,i=n.length;r1){let s=n[0],a=n[1];s.length===0&&a.length>1&&a[1]===":"&&n.shift()}return Zr.normalize(n.join("/"))}Dn.uriToFilePath=sD;function Jp(){return process.platform==="win32"}function Lu(t,e,n,r){let i="NODE_PATH",s=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((a,o)=>{let l=process.env,u=Object.create(null);Object.keys(l).forEach(c=>u[c]=l[c]),e&&Xp.existsSync(e)&&(u[i]?u[i]=e+Zr.delimiter+u[i]:u[i]=e,r&&r(`NODE_PATH value is: ${u[i]}`)),u.ELECTRON_RUN_AS_NODE="1";try{let c=Qp.fork("",[],{cwd:n,env:u,execArgv:["-e",s]});if(c.pid===void 0){o(new Error(`Starting process to resolve node module ${t} failed`));return}c.on("error",h=>{o(h)}),c.on("message",h=>{h.c==="r"&&(c.send({c:"e"}),h.s?a(h.r):o(new Error(`Failed to resolve module: ${t}`)))});let f={c:"rs",a:t};c.send(f)}catch(c){o(c)}})}Dn.resolve=Lu;function Zp(t){let e="npm",n=Object.create(null);Object.keys(process.env).forEach(s=>n[s]=process.env[s]),n.NO_UPDATE_NOTIFIER="true";let r={encoding:"utf8",env:n};Jp()&&(e="npm.cmd",r.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let s=Qp.spawnSync(e,["config","get","prefix"],r).stdout;if(!s){t&&t("'npm config get prefix' didn't return a value.");return}let a=s.trim();return t&&t(`'npm config get prefix' value is: ${a}`),a.length>0?Jp()?Zr.join(a,"node_modules"):Zr.join(a,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",i)}}Dn.resolveGlobalNodePath=Zp;function aD(t){let e="yarn",n={encoding:"utf8"};Jp()&&(e="yarn.cmd",n.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let i=Qp.spawnSync(e,["global","dir","--json"],n),s=i.stdout;if(!s){t&&(t("'yarn global dir' didn't return a value."),i.stderr&&t(i.stderr));return}let a=s.trim().split(/\r?\n/);for(let o of a)try{let l=JSON.parse(o);if(l.type==="log")return Zr.join(l.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",r)}}Dn.resolveGlobalYarnPath=aD;var wy;(function(t){let e;function n(){return e!==void 0||(process.platform==="win32"?e=!1:e=!Xp.existsSync(__filename.toUpperCase())||!Xp.existsSync(__filename.toLowerCase())),e}t.isCaseSensitive=n;function r(i,s){return n()?Zr.normalize(s).indexOf(Zr.normalize(i))===0:Zr.normalize(s).toLowerCase().indexOf(Zr.normalize(i).toLowerCase())===0}t.isParent=r})(wy=Dn.FileSystem||(Dn.FileSystem={}));function oD(t,e,n,r){return n?(Zr.isAbsolute(n)||(n=Zr.join(t,n)),Lu(e,n,n,r).then(i=>wy.isParent(n,i)?i:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,i=>Lu(e,Zp(r),t,r))):Lu(e,Zp(r),t,r)}Dn.resolveModulePath=oD});var ed=X((pB,Ly)=>{"use strict";Ly.exports=Bn()});var ky=X(Jn=>{"use strict";var lD=Jn&&Jn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Fy=Jn&&Jn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&lD(e,t,n)};Object.defineProperty(Jn,"__esModule",{value:!0});Jn.ProposedFeatures=Jn.SemanticTokensBuilder=void 0;var uD=Vp();Object.defineProperty(Jn,"SemanticTokensBuilder",{enumerable:!0,get:function(){return uD.SemanticTokensBuilder}});Fy(Bn(),Jn);Fy(zp(),Jn);var cD;(function(t){t.all={__brand:"features"}})(cD=Jn.ProposedFeatures||(Jn.ProposedFeatures={}))});var ei=X(Zn=>{"use strict";var fD=Zn&&Zn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),My=Zn&&Zn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&fD(e,t,n)};Object.defineProperty(Zn,"__esModule",{value:!0});Zn.createConnection=Zn.Files=void 0;var td=pu(),pD=zp(),ol=Oy(),Bs=ed();My(ed(),Zn);My(ky(),Zn);var dD;(function(t){t.uriToFilePath=ol.uriToFilePath,t.resolveGlobalNodePath=ol.resolveGlobalNodePath,t.resolveGlobalYarnPath=ol.resolveGlobalYarnPath,t.resolve=ol.resolve,t.resolveModulePath=ol.resolveModulePath})(dD=Zn.Files||(Zn.Files={}));var By;function Fu(){if(By!==void 0)try{By.end()}catch{}}var La=!1,qy;function hD(){let t="--clientProcessId";function e(n){try{let r=parseInt(n);isNaN(r)||(qy=setInterval(()=>{try{process.kill(r,0)}catch{Fu(),process.exit(La?0:1)}},3e3))}catch{}}for(let n=2;n{let e=t.processId;td.number(e)&&qy===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(La?0:1)}},3e3)},get shutdownReceived(){return La},set shutdownReceived(t){La=t},exit:t=>{Fu(),process.exit(t)}};function gD(t,e,n,r){let i,s,a,o;return t!==void 0&&t.__brand==="features"&&(i=t,t=e,e=n,n=r),Bs.ConnectionStrategy.is(t)||Bs.ConnectionOptions.is(t)?o=t:(s=t,a=e,o=n),_D(s,a,o,i)}Zn.createConnection=gD;function _D(t,e,n,r){if(!t&&!e&&process.argv.length>2){let o,l,u=process.argv.slice(2);for(let c=0;c{Fu(),process.exit(La?0:1)}),o.on("close",()=>{Fu(),process.exit(La?0:1)})}let a=o=>Bs.createProtocolConnection(t,e,o,n);return pD.createConnection(a,mD,r)}});var ms=X(Vn=>{"use strict";var Ui={ANCHOR:"&",COMMENT:"#",TAG:"!",DIRECTIVES_END:"-",DOCUMENT_END:"."},Cl={ALIAS:"ALIAS",BLANK_LINE:"BLANK_LINE",BLOCK_FOLDED:"BLOCK_FOLDED",BLOCK_LITERAL:"BLOCK_LITERAL",COMMENT:"COMMENT",DIRECTIVE:"DIRECTIVE",DOCUMENT:"DOCUMENT",FLOW_MAP:"FLOW_MAP",FLOW_SEQ:"FLOW_SEQ",MAP:"MAP",MAP_KEY:"MAP_KEY",MAP_VALUE:"MAP_VALUE",PLAIN:"PLAIN",QUOTE_DOUBLE:"QUOTE_DOUBLE",QUOTE_SINGLE:"QUOTE_SINGLE",SEQ:"SEQ",SEQ_ITEM:"SEQ_ITEM"},VR="tag:yaml.org,2002:",jR={MAP:"tag:yaml.org,2002:map",SEQ:"tag:yaml.org,2002:seq",STR:"tag:yaml.org,2002:str"};function A0(t){let e=[0],n=t.indexOf(` +`&&T++}A&&O.length>0&&D.push(O.length),this._lineOffsets=D}return this._lineOffsets},v.prototype.positionAt=function(D){D=Math.max(Math.min(D,this._content.length),0);var O=this.getLineOffsets(),A=0,T=O.length;if(T===0)return i.create(0,D);for(;AD?T=F:A=F+1}var j=A-1;return i.create(j,D-O[j])},v.prototype.offsetAt=function(D){var O=this.getLineOffsets();if(D.line>=O.length)return this._content.length;if(D.line<0)return 0;var A=O[D.line],T=D.line+1{"use strict";Object.defineProperty(br,"__esModule",{value:!0});br.ProtocolNotificationType=br.ProtocolNotificationType0=br.ProtocolRequestType=br.ProtocolRequestType0=br.RegistrationType=void 0;var xa=Da(),A_=class{constructor(e){this.method=e}};br.RegistrationType=A_;var E_=class extends xa.RequestType0{constructor(e){super(e)}};br.ProtocolRequestType0=E_;var I_=class extends xa.RequestType{constructor(e){super(e,xa.ParameterStructures.byName)}};br.ProtocolRequestType=I_;var D_=class extends xa.NotificationType0{constructor(e){super(e)}};br.ProtocolNotificationType0=D_;var x_=class extends xa.NotificationType{constructor(e){super(e,xa.ParameterStructures.byName)}};br.ProtocolNotificationType=x_});var O_=X(jt=>{"use strict";Object.defineProperty(jt,"__esModule",{value:!0});jt.objectLiteral=jt.typedArray=jt.stringArray=jt.array=jt.func=jt.error=jt.number=jt.string=jt.boolean=void 0;function oA(t){return t===!0||t===!1}jt.boolean=oA;function R_(t){return typeof t=="string"||t instanceof String}jt.string=R_;function lA(t){return typeof t=="number"||t instanceof Number}jt.number=lA;function uA(t){return t instanceof Error}jt.error=uA;function cA(t){return typeof t=="function"}jt.func=cA;function w_(t){return Array.isArray(t)}jt.array=w_;function fA(t){return w_(t)&&t.every(e=>R_(e))}jt.stringArray=fA;function pA(t,e){return Array.isArray(t)&&t.every(e)}jt.typedArray=pA;function dA(t){return t!==null&&typeof t=="object"}jt.objectLiteral=dA});var L_=X(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.ImplementationRequest=void 0;var hA=rn(),mA;(function(t){t.method="textDocument/implementation",t.type=new hA.ProtocolRequestType(t.method)})(mA=Zo.ImplementationRequest||(Zo.ImplementationRequest={}))});var F_=X(el=>{"use strict";Object.defineProperty(el,"__esModule",{value:!0});el.TypeDefinitionRequest=void 0;var gA=rn(),_A;(function(t){t.method="textDocument/typeDefinition",t.type=new gA.ProtocolRequestType(t.method)})(_A=el.TypeDefinitionRequest||(el.TypeDefinitionRequest={}))});var M_=X(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});Zi.DidChangeWorkspaceFoldersNotification=Zi.WorkspaceFoldersRequest=void 0;var k_=rn(),yA;(function(t){t.type=new k_.ProtocolRequestType0("workspace/workspaceFolders")})(yA=Zi.WorkspaceFoldersRequest||(Zi.WorkspaceFoldersRequest={}));var bA;(function(t){t.type=new k_.ProtocolNotificationType("workspace/didChangeWorkspaceFolders")})(bA=Zi.DidChangeWorkspaceFoldersNotification||(Zi.DidChangeWorkspaceFoldersNotification={}))});var B_=X(tl=>{"use strict";Object.defineProperty(tl,"__esModule",{value:!0});tl.ConfigurationRequest=void 0;var TA=rn(),vA;(function(t){t.type=new TA.ProtocolRequestType("workspace/configuration")})(vA=tl.ConfigurationRequest||(tl.ConfigurationRequest={}))});var V_=X(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.ColorPresentationRequest=es.DocumentColorRequest=void 0;var q_=rn(),NA;(function(t){t.method="textDocument/documentColor",t.type=new q_.ProtocolRequestType(t.method)})(NA=es.DocumentColorRequest||(es.DocumentColorRequest={}));var CA;(function(t){t.type=new q_.ProtocolRequestType("textDocument/colorPresentation")})(CA=es.ColorPresentationRequest||(es.ColorPresentationRequest={}))});var j_=X(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.FoldingRangeRequest=ts.FoldingRangeKind=void 0;var PA=rn(),SA;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(SA=ts.FoldingRangeKind||(ts.FoldingRangeKind={}));var AA;(function(t){t.method="textDocument/foldingRange",t.type=new PA.ProtocolRequestType(t.method)})(AA=ts.FoldingRangeRequest||(ts.FoldingRangeRequest={}))});var U_=X(nl=>{"use strict";Object.defineProperty(nl,"__esModule",{value:!0});nl.DeclarationRequest=void 0;var EA=rn(),IA;(function(t){t.method="textDocument/declaration",t.type=new EA.ProtocolRequestType(t.method)})(IA=nl.DeclarationRequest||(nl.DeclarationRequest={}))});var W_=X(rl=>{"use strict";Object.defineProperty(rl,"__esModule",{value:!0});rl.SelectionRangeRequest=void 0;var DA=rn(),xA;(function(t){t.method="textDocument/selectionRange",t.type=new DA.ProtocolRequestType(t.method)})(xA=rl.SelectionRangeRequest||(rl.SelectionRangeRequest={}))});var Y_=X(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.WorkDoneProgressCancelNotification=Xr.WorkDoneProgressCreateRequest=Xr.WorkDoneProgress=void 0;var RA=Da(),G_=rn(),wA;(function(t){t.type=new RA.ProgressType;function e(n){return n===t.type}t.is=e})(wA=Xr.WorkDoneProgress||(Xr.WorkDoneProgress={}));var OA;(function(t){t.type=new G_.ProtocolRequestType("window/workDoneProgress/create")})(OA=Xr.WorkDoneProgressCreateRequest||(Xr.WorkDoneProgressCreateRequest={}));var LA;(function(t){t.type=new G_.ProtocolNotificationType("window/workDoneProgress/cancel")})(LA=Xr.WorkDoneProgressCancelNotification||(Xr.WorkDoneProgressCancelNotification={}))});var H_=X(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.CallHierarchyOutgoingCallsRequest=Qr.CallHierarchyIncomingCallsRequest=Qr.CallHierarchyPrepareRequest=void 0;var xp=rn(),FA;(function(t){t.method="textDocument/prepareCallHierarchy",t.type=new xp.ProtocolRequestType(t.method)})(FA=Qr.CallHierarchyPrepareRequest||(Qr.CallHierarchyPrepareRequest={}));var kA;(function(t){t.method="callHierarchy/incomingCalls",t.type=new xp.ProtocolRequestType(t.method)})(kA=Qr.CallHierarchyIncomingCallsRequest||(Qr.CallHierarchyIncomingCallsRequest={}));var MA;(function(t){t.method="callHierarchy/outgoingCalls",t.type=new xp.ProtocolRequestType(t.method)})(MA=Qr.CallHierarchyOutgoingCallsRequest||(Qr.CallHierarchyOutgoingCallsRequest={}))});var $_=X(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.SemanticTokensRefreshRequest=rt.SemanticTokensRangeRequest=rt.SemanticTokensDeltaRequest=rt.SemanticTokensRequest=rt.SemanticTokensRegistrationType=rt.TokenFormat=rt.SemanticTokens=rt.SemanticTokenModifiers=rt.SemanticTokenTypes=void 0;var il=rn(),BA;(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator"})(BA=rt.SemanticTokenTypes||(rt.SemanticTokenTypes={}));var qA;(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})(qA=rt.SemanticTokenModifiers||(rt.SemanticTokenModifiers={}));var VA;(function(t){function e(n){let r=n;return r!==void 0&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}t.is=e})(VA=rt.SemanticTokens||(rt.SemanticTokens={}));var jA;(function(t){t.Relative="relative"})(jA=rt.TokenFormat||(rt.TokenFormat={}));var UA;(function(t){t.method="textDocument/semanticTokens",t.type=new il.RegistrationType(t.method)})(UA=rt.SemanticTokensRegistrationType||(rt.SemanticTokensRegistrationType={}));var WA;(function(t){t.method="textDocument/semanticTokens/full",t.type=new il.ProtocolRequestType(t.method)})(WA=rt.SemanticTokensRequest||(rt.SemanticTokensRequest={}));var GA;(function(t){t.method="textDocument/semanticTokens/full/delta",t.type=new il.ProtocolRequestType(t.method)})(GA=rt.SemanticTokensDeltaRequest||(rt.SemanticTokensDeltaRequest={}));var YA;(function(t){t.method="textDocument/semanticTokens/range",t.type=new il.ProtocolRequestType(t.method)})(YA=rt.SemanticTokensRangeRequest||(rt.SemanticTokensRangeRequest={}));var HA;(function(t){t.method="workspace/semanticTokens/refresh",t.type=new il.ProtocolRequestType0(t.method)})(HA=rt.SemanticTokensRefreshRequest||(rt.SemanticTokensRefreshRequest={}))});var K_=X(sl=>{"use strict";Object.defineProperty(sl,"__esModule",{value:!0});sl.ShowDocumentRequest=void 0;var $A=rn(),KA;(function(t){t.method="window/showDocument",t.type=new $A.ProtocolRequestType(t.method)})(KA=sl.ShowDocumentRequest||(sl.ShowDocumentRequest={}))});var z_=X(al=>{"use strict";Object.defineProperty(al,"__esModule",{value:!0});al.LinkedEditingRangeRequest=void 0;var zA=rn(),XA;(function(t){t.method="textDocument/linkedEditingRange",t.type=new zA.ProtocolRequestType(t.method)})(XA=al.LinkedEditingRangeRequest||(al.LinkedEditingRangeRequest={}))});var X_=X(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.WillDeleteFilesRequest=St.DidDeleteFilesNotification=St.DidRenameFilesNotification=St.WillRenameFilesRequest=St.DidCreateFilesNotification=St.WillCreateFilesRequest=St.FileOperationPatternKind=void 0;var Ra=rn(),QA;(function(t){t.file="file",t.folder="folder"})(QA=St.FileOperationPatternKind||(St.FileOperationPatternKind={}));var JA;(function(t){t.method="workspace/willCreateFiles",t.type=new Ra.ProtocolRequestType(t.method)})(JA=St.WillCreateFilesRequest||(St.WillCreateFilesRequest={}));var ZA;(function(t){t.method="workspace/didCreateFiles",t.type=new Ra.ProtocolNotificationType(t.method)})(ZA=St.DidCreateFilesNotification||(St.DidCreateFilesNotification={}));var eE;(function(t){t.method="workspace/willRenameFiles",t.type=new Ra.ProtocolRequestType(t.method)})(eE=St.WillRenameFilesRequest||(St.WillRenameFilesRequest={}));var tE;(function(t){t.method="workspace/didRenameFiles",t.type=new Ra.ProtocolNotificationType(t.method)})(tE=St.DidRenameFilesNotification||(St.DidRenameFilesNotification={}));var nE;(function(t){t.method="workspace/didDeleteFiles",t.type=new Ra.ProtocolNotificationType(t.method)})(nE=St.DidDeleteFilesNotification||(St.DidDeleteFilesNotification={}));var rE;(function(t){t.method="workspace/willDeleteFiles",t.type=new Ra.ProtocolRequestType(t.method)})(rE=St.WillDeleteFilesRequest||(St.WillDeleteFilesRequest={}))});var Q_=X(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.MonikerRequest=Jr.MonikerKind=Jr.UniquenessLevel=void 0;var iE=rn(),sE;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(sE=Jr.UniquenessLevel||(Jr.UniquenessLevel={}));var aE;(function(t){t.import="import",t.export="export",t.local="local"})(aE=Jr.MonikerKind||(Jr.MonikerKind={}));var oE;(function(t){t.method="textDocument/moniker",t.type=new iE.ProtocolRequestType(t.method)})(oE=Jr.MonikerRequest||(Jr.MonikerRequest={}))});var ny=X(E=>{"use strict";Object.defineProperty(E,"__esModule",{value:!0});E.DocumentLinkRequest=E.CodeLensRefreshRequest=E.CodeLensResolveRequest=E.CodeLensRequest=E.WorkspaceSymbolRequest=E.CodeActionResolveRequest=E.CodeActionRequest=E.DocumentSymbolRequest=E.DocumentHighlightRequest=E.ReferencesRequest=E.DefinitionRequest=E.SignatureHelpRequest=E.SignatureHelpTriggerKind=E.HoverRequest=E.CompletionResolveRequest=E.CompletionRequest=E.CompletionTriggerKind=E.PublishDiagnosticsNotification=E.WatchKind=E.FileChangeType=E.DidChangeWatchedFilesNotification=E.WillSaveTextDocumentWaitUntilRequest=E.WillSaveTextDocumentNotification=E.TextDocumentSaveReason=E.DidSaveTextDocumentNotification=E.DidCloseTextDocumentNotification=E.DidChangeTextDocumentNotification=E.TextDocumentContentChangeEvent=E.DidOpenTextDocumentNotification=E.TextDocumentSyncKind=E.TelemetryEventNotification=E.LogMessageNotification=E.ShowMessageRequest=E.ShowMessageNotification=E.MessageType=E.DidChangeConfigurationNotification=E.ExitNotification=E.ShutdownRequest=E.InitializedNotification=E.InitializeError=E.InitializeRequest=E.WorkDoneProgressOptions=E.TextDocumentRegistrationOptions=E.StaticRegistrationOptions=E.FailureHandlingKind=E.ResourceOperationKind=E.UnregistrationRequest=E.RegistrationRequest=E.DocumentSelector=E.DocumentFilter=void 0;E.MonikerRequest=E.MonikerKind=E.UniquenessLevel=E.WillDeleteFilesRequest=E.DidDeleteFilesNotification=E.WillRenameFilesRequest=E.DidRenameFilesNotification=E.WillCreateFilesRequest=E.DidCreateFilesNotification=E.FileOperationPatternKind=E.LinkedEditingRangeRequest=E.ShowDocumentRequest=E.SemanticTokensRegistrationType=E.SemanticTokensRefreshRequest=E.SemanticTokensRangeRequest=E.SemanticTokensDeltaRequest=E.SemanticTokensRequest=E.TokenFormat=E.SemanticTokens=E.SemanticTokenModifiers=E.SemanticTokenTypes=E.CallHierarchyPrepareRequest=E.CallHierarchyOutgoingCallsRequest=E.CallHierarchyIncomingCallsRequest=E.WorkDoneProgressCancelNotification=E.WorkDoneProgressCreateRequest=E.WorkDoneProgress=E.SelectionRangeRequest=E.DeclarationRequest=E.FoldingRangeRequest=E.ColorPresentationRequest=E.DocumentColorRequest=E.ConfigurationRequest=E.DidChangeWorkspaceFoldersNotification=E.WorkspaceFoldersRequest=E.TypeDefinitionRequest=E.ImplementationRequest=E.ApplyWorkspaceEditRequest=E.ExecuteCommandRequest=E.PrepareRenameRequest=E.RenameRequest=E.PrepareSupportDefaultBehavior=E.DocumentOnTypeFormattingRequest=E.DocumentRangeFormattingRequest=E.DocumentFormattingRequest=E.DocumentLinkResolveRequest=void 0;var ns=O_(),Me=rn(),lE=L_();Object.defineProperty(E,"ImplementationRequest",{enumerable:!0,get:function(){return lE.ImplementationRequest}});var uE=F_();Object.defineProperty(E,"TypeDefinitionRequest",{enumerable:!0,get:function(){return uE.TypeDefinitionRequest}});var J_=M_();Object.defineProperty(E,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return J_.WorkspaceFoldersRequest}});Object.defineProperty(E,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return J_.DidChangeWorkspaceFoldersNotification}});var cE=B_();Object.defineProperty(E,"ConfigurationRequest",{enumerable:!0,get:function(){return cE.ConfigurationRequest}});var Z_=V_();Object.defineProperty(E,"DocumentColorRequest",{enumerable:!0,get:function(){return Z_.DocumentColorRequest}});Object.defineProperty(E,"ColorPresentationRequest",{enumerable:!0,get:function(){return Z_.ColorPresentationRequest}});var fE=j_();Object.defineProperty(E,"FoldingRangeRequest",{enumerable:!0,get:function(){return fE.FoldingRangeRequest}});var pE=U_();Object.defineProperty(E,"DeclarationRequest",{enumerable:!0,get:function(){return pE.DeclarationRequest}});var dE=W_();Object.defineProperty(E,"SelectionRangeRequest",{enumerable:!0,get:function(){return dE.SelectionRangeRequest}});var Rp=Y_();Object.defineProperty(E,"WorkDoneProgress",{enumerable:!0,get:function(){return Rp.WorkDoneProgress}});Object.defineProperty(E,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return Rp.WorkDoneProgressCreateRequest}});Object.defineProperty(E,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return Rp.WorkDoneProgressCancelNotification}});var wp=H_();Object.defineProperty(E,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return wp.CallHierarchyIncomingCallsRequest}});Object.defineProperty(E,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return wp.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(E,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return wp.CallHierarchyPrepareRequest}});var ki=$_();Object.defineProperty(E,"SemanticTokenTypes",{enumerable:!0,get:function(){return ki.SemanticTokenTypes}});Object.defineProperty(E,"SemanticTokenModifiers",{enumerable:!0,get:function(){return ki.SemanticTokenModifiers}});Object.defineProperty(E,"SemanticTokens",{enumerable:!0,get:function(){return ki.SemanticTokens}});Object.defineProperty(E,"TokenFormat",{enumerable:!0,get:function(){return ki.TokenFormat}});Object.defineProperty(E,"SemanticTokensRequest",{enumerable:!0,get:function(){return ki.SemanticTokensRequest}});Object.defineProperty(E,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return ki.SemanticTokensDeltaRequest}});Object.defineProperty(E,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return ki.SemanticTokensRangeRequest}});Object.defineProperty(E,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return ki.SemanticTokensRefreshRequest}});Object.defineProperty(E,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return ki.SemanticTokensRegistrationType}});var hE=K_();Object.defineProperty(E,"ShowDocumentRequest",{enumerable:!0,get:function(){return hE.ShowDocumentRequest}});var mE=z_();Object.defineProperty(E,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return mE.LinkedEditingRangeRequest}});var Ms=X_();Object.defineProperty(E,"FileOperationPatternKind",{enumerable:!0,get:function(){return Ms.FileOperationPatternKind}});Object.defineProperty(E,"DidCreateFilesNotification",{enumerable:!0,get:function(){return Ms.DidCreateFilesNotification}});Object.defineProperty(E,"WillCreateFilesRequest",{enumerable:!0,get:function(){return Ms.WillCreateFilesRequest}});Object.defineProperty(E,"DidRenameFilesNotification",{enumerable:!0,get:function(){return Ms.DidRenameFilesNotification}});Object.defineProperty(E,"WillRenameFilesRequest",{enumerable:!0,get:function(){return Ms.WillRenameFilesRequest}});Object.defineProperty(E,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return Ms.DidDeleteFilesNotification}});Object.defineProperty(E,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return Ms.WillDeleteFilesRequest}});var Op=Q_();Object.defineProperty(E,"UniquenessLevel",{enumerable:!0,get:function(){return Op.UniquenessLevel}});Object.defineProperty(E,"MonikerKind",{enumerable:!0,get:function(){return Op.MonikerKind}});Object.defineProperty(E,"MonikerRequest",{enumerable:!0,get:function(){return Op.MonikerRequest}});var ey;(function(t){function e(n){let r=n;return ns.string(r.language)||ns.string(r.scheme)||ns.string(r.pattern)}t.is=e})(ey=E.DocumentFilter||(E.DocumentFilter={}));var ty;(function(t){function e(n){if(!Array.isArray(n))return!1;for(let r of n)if(!ns.string(r)&&!ey.is(r))return!1;return!0}t.is=e})(ty=E.DocumentSelector||(E.DocumentSelector={}));var gE;(function(t){t.type=new Me.ProtocolRequestType("client/registerCapability")})(gE=E.RegistrationRequest||(E.RegistrationRequest={}));var _E;(function(t){t.type=new Me.ProtocolRequestType("client/unregisterCapability")})(_E=E.UnregistrationRequest||(E.UnregistrationRequest={}));var yE;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(yE=E.ResourceOperationKind||(E.ResourceOperationKind={}));var bE;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(bE=E.FailureHandlingKind||(E.FailureHandlingKind={}));var TE;(function(t){function e(n){let r=n;return r&&ns.string(r.id)&&r.id.length>0}t.hasId=e})(TE=E.StaticRegistrationOptions||(E.StaticRegistrationOptions={}));var vE;(function(t){function e(n){let r=n;return r&&(r.documentSelector===null||ty.is(r.documentSelector))}t.is=e})(vE=E.TextDocumentRegistrationOptions||(E.TextDocumentRegistrationOptions={}));var NE;(function(t){function e(r){let i=r;return ns.objectLiteral(i)&&(i.workDoneProgress===void 0||ns.boolean(i.workDoneProgress))}t.is=e;function n(r){let i=r;return i&&ns.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=n})(NE=E.WorkDoneProgressOptions||(E.WorkDoneProgressOptions={}));var CE;(function(t){t.type=new Me.ProtocolRequestType("initialize")})(CE=E.InitializeRequest||(E.InitializeRequest={}));var PE;(function(t){t.unknownProtocolVersion=1})(PE=E.InitializeError||(E.InitializeError={}));var SE;(function(t){t.type=new Me.ProtocolNotificationType("initialized")})(SE=E.InitializedNotification||(E.InitializedNotification={}));var AE;(function(t){t.type=new Me.ProtocolRequestType0("shutdown")})(AE=E.ShutdownRequest||(E.ShutdownRequest={}));var EE;(function(t){t.type=new Me.ProtocolNotificationType0("exit")})(EE=E.ExitNotification||(E.ExitNotification={}));var IE;(function(t){t.type=new Me.ProtocolNotificationType("workspace/didChangeConfiguration")})(IE=E.DidChangeConfigurationNotification||(E.DidChangeConfigurationNotification={}));var DE;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4})(DE=E.MessageType||(E.MessageType={}));var xE;(function(t){t.type=new Me.ProtocolNotificationType("window/showMessage")})(xE=E.ShowMessageNotification||(E.ShowMessageNotification={}));var RE;(function(t){t.type=new Me.ProtocolRequestType("window/showMessageRequest")})(RE=E.ShowMessageRequest||(E.ShowMessageRequest={}));var wE;(function(t){t.type=new Me.ProtocolNotificationType("window/logMessage")})(wE=E.LogMessageNotification||(E.LogMessageNotification={}));var OE;(function(t){t.type=new Me.ProtocolNotificationType("telemetry/event")})(OE=E.TelemetryEventNotification||(E.TelemetryEventNotification={}));var LE;(function(t){t.None=0,t.Full=1,t.Incremental=2})(LE=E.TextDocumentSyncKind||(E.TextDocumentSyncKind={}));var FE;(function(t){t.method="textDocument/didOpen",t.type=new Me.ProtocolNotificationType(t.method)})(FE=E.DidOpenTextDocumentNotification||(E.DidOpenTextDocumentNotification={}));var kE;(function(t){function e(r){let i=r;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}t.isIncremental=e;function n(r){let i=r;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}t.isFull=n})(kE=E.TextDocumentContentChangeEvent||(E.TextDocumentContentChangeEvent={}));var ME;(function(t){t.method="textDocument/didChange",t.type=new Me.ProtocolNotificationType(t.method)})(ME=E.DidChangeTextDocumentNotification||(E.DidChangeTextDocumentNotification={}));var BE;(function(t){t.method="textDocument/didClose",t.type=new Me.ProtocolNotificationType(t.method)})(BE=E.DidCloseTextDocumentNotification||(E.DidCloseTextDocumentNotification={}));var qE;(function(t){t.method="textDocument/didSave",t.type=new Me.ProtocolNotificationType(t.method)})(qE=E.DidSaveTextDocumentNotification||(E.DidSaveTextDocumentNotification={}));var VE;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(VE=E.TextDocumentSaveReason||(E.TextDocumentSaveReason={}));var jE;(function(t){t.method="textDocument/willSave",t.type=new Me.ProtocolNotificationType(t.method)})(jE=E.WillSaveTextDocumentNotification||(E.WillSaveTextDocumentNotification={}));var UE;(function(t){t.method="textDocument/willSaveWaitUntil",t.type=new Me.ProtocolRequestType(t.method)})(UE=E.WillSaveTextDocumentWaitUntilRequest||(E.WillSaveTextDocumentWaitUntilRequest={}));var WE;(function(t){t.type=new Me.ProtocolNotificationType("workspace/didChangeWatchedFiles")})(WE=E.DidChangeWatchedFilesNotification||(E.DidChangeWatchedFilesNotification={}));var GE;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(GE=E.FileChangeType||(E.FileChangeType={}));var YE;(function(t){t.Create=1,t.Change=2,t.Delete=4})(YE=E.WatchKind||(E.WatchKind={}));var HE;(function(t){t.type=new Me.ProtocolNotificationType("textDocument/publishDiagnostics")})(HE=E.PublishDiagnosticsNotification||(E.PublishDiagnosticsNotification={}));var $E;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})($E=E.CompletionTriggerKind||(E.CompletionTriggerKind={}));var KE;(function(t){t.method="textDocument/completion",t.type=new Me.ProtocolRequestType(t.method)})(KE=E.CompletionRequest||(E.CompletionRequest={}));var zE;(function(t){t.method="completionItem/resolve",t.type=new Me.ProtocolRequestType(t.method)})(zE=E.CompletionResolveRequest||(E.CompletionResolveRequest={}));var XE;(function(t){t.method="textDocument/hover",t.type=new Me.ProtocolRequestType(t.method)})(XE=E.HoverRequest||(E.HoverRequest={}));var QE;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(QE=E.SignatureHelpTriggerKind||(E.SignatureHelpTriggerKind={}));var JE;(function(t){t.method="textDocument/signatureHelp",t.type=new Me.ProtocolRequestType(t.method)})(JE=E.SignatureHelpRequest||(E.SignatureHelpRequest={}));var ZE;(function(t){t.method="textDocument/definition",t.type=new Me.ProtocolRequestType(t.method)})(ZE=E.DefinitionRequest||(E.DefinitionRequest={}));var eI;(function(t){t.method="textDocument/references",t.type=new Me.ProtocolRequestType(t.method)})(eI=E.ReferencesRequest||(E.ReferencesRequest={}));var tI;(function(t){t.method="textDocument/documentHighlight",t.type=new Me.ProtocolRequestType(t.method)})(tI=E.DocumentHighlightRequest||(E.DocumentHighlightRequest={}));var nI;(function(t){t.method="textDocument/documentSymbol",t.type=new Me.ProtocolRequestType(t.method)})(nI=E.DocumentSymbolRequest||(E.DocumentSymbolRequest={}));var rI;(function(t){t.method="textDocument/codeAction",t.type=new Me.ProtocolRequestType(t.method)})(rI=E.CodeActionRequest||(E.CodeActionRequest={}));var iI;(function(t){t.method="codeAction/resolve",t.type=new Me.ProtocolRequestType(t.method)})(iI=E.CodeActionResolveRequest||(E.CodeActionResolveRequest={}));var sI;(function(t){t.method="workspace/symbol",t.type=new Me.ProtocolRequestType(t.method)})(sI=E.WorkspaceSymbolRequest||(E.WorkspaceSymbolRequest={}));var aI;(function(t){t.method="textDocument/codeLens",t.type=new Me.ProtocolRequestType(t.method)})(aI=E.CodeLensRequest||(E.CodeLensRequest={}));var oI;(function(t){t.method="codeLens/resolve",t.type=new Me.ProtocolRequestType(t.method)})(oI=E.CodeLensResolveRequest||(E.CodeLensResolveRequest={}));var lI;(function(t){t.method="workspace/codeLens/refresh",t.type=new Me.ProtocolRequestType0(t.method)})(lI=E.CodeLensRefreshRequest||(E.CodeLensRefreshRequest={}));var uI;(function(t){t.method="textDocument/documentLink",t.type=new Me.ProtocolRequestType(t.method)})(uI=E.DocumentLinkRequest||(E.DocumentLinkRequest={}));var cI;(function(t){t.method="documentLink/resolve",t.type=new Me.ProtocolRequestType(t.method)})(cI=E.DocumentLinkResolveRequest||(E.DocumentLinkResolveRequest={}));var fI;(function(t){t.method="textDocument/formatting",t.type=new Me.ProtocolRequestType(t.method)})(fI=E.DocumentFormattingRequest||(E.DocumentFormattingRequest={}));var pI;(function(t){t.method="textDocument/rangeFormatting",t.type=new Me.ProtocolRequestType(t.method)})(pI=E.DocumentRangeFormattingRequest||(E.DocumentRangeFormattingRequest={}));var dI;(function(t){t.method="textDocument/onTypeFormatting",t.type=new Me.ProtocolRequestType(t.method)})(dI=E.DocumentOnTypeFormattingRequest||(E.DocumentOnTypeFormattingRequest={}));var hI;(function(t){t.Identifier=1})(hI=E.PrepareSupportDefaultBehavior||(E.PrepareSupportDefaultBehavior={}));var mI;(function(t){t.method="textDocument/rename",t.type=new Me.ProtocolRequestType(t.method)})(mI=E.RenameRequest||(E.RenameRequest={}));var gI;(function(t){t.method="textDocument/prepareRename",t.type=new Me.ProtocolRequestType(t.method)})(gI=E.PrepareRenameRequest||(E.PrepareRenameRequest={}));var _I;(function(t){t.type=new Me.ProtocolRequestType("workspace/executeCommand")})(_I=E.ExecuteCommandRequest||(E.ExecuteCommandRequest={}));var yI;(function(t){t.type=new Me.ProtocolRequestType("workspace/applyEdit")})(yI=E.ApplyWorkspaceEditRequest||(E.ApplyWorkspaceEditRequest={}))});var iy=X(vu=>{"use strict";Object.defineProperty(vu,"__esModule",{value:!0});vu.createProtocolConnection=void 0;var ry=Da();function bI(t,e,n,r){return ry.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),ry.createMessageConnection(t,e,n,r)}vu.createProtocolConnection=bI});var sy=X(In=>{"use strict";var TI=In&&In.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Nu=In&&In.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&TI(e,t,n)};Object.defineProperty(In,"__esModule",{value:!0});In.LSPErrorCodes=In.createProtocolConnection=void 0;Nu(Da(),In);Nu(vt(),In);Nu(rn(),In);Nu(ny(),In);var vI=iy();Object.defineProperty(In,"createProtocolConnection",{enumerable:!0,get:function(){return vI.createProtocolConnection}});var NI;(function(t){t.lspReservedErrorRangeStart=-32899,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(NI=In.LSPErrorCodes||(In.LSPErrorCodes={}))});var Bn=X(_i=>{"use strict";var CI=_i&&_i.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),ay=_i&&_i.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&CI(e,t,n)};Object.defineProperty(_i,"__esModule",{value:!0});_i.createProtocolConnection=void 0;var PI=Dp();ay(Dp(),_i);ay(sy(),_i);function SI(t,e,n,r){return PI.createMessageConnection(t,e,n,r)}_i.createProtocolConnection=SI});var Lp=X(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:!0});Tr.generateUuid=Tr.parse=Tr.isUUID=Tr.v4=Tr.empty=void 0;var Cu=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},Ue=class extends Cu{constructor(){super([Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),"-",Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),"-","4",Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),"-",Ue._oneOf(Ue._timeHighBits),Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),"-",Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),Ue._randomHex(),Ue._randomHex()].join(""))}static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return Ue._oneOf(Ue._chars)}};Ue._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];Ue._timeHighBits=["8","9","a","b"];Tr.empty=new Cu("00000000-0000-0000-0000-000000000000");function oy(){return new Ue}Tr.v4=oy;var AI=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function ly(t){return AI.test(t)}Tr.isUUID=ly;function EI(t){if(!ly(t))throw new Error("invalid uuid");return new Cu(t)}Tr.parse=EI;function II(){return oy().asHex()}Tr.generateUuid=II});var cy=X(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.attachPartialResult=is.ProgressFeature=is.attachWorkDone=void 0;var rs=Bn(),DI=Lp(),Mi=class{constructor(e,n){this._connection=e,this._token=n,Mi.Instances.set(this._token,this)}begin(e,n,r,i){let s={kind:"begin",title:e,percentage:n,message:r,cancellable:i};this._connection.sendProgress(rs.WorkDoneProgress.type,this._token,s)}report(e,n){let r={kind:"report"};typeof e=="number"?(r.percentage=e,n!==void 0&&(r.message=n)):r.message=e,this._connection.sendProgress(rs.WorkDoneProgress.type,this._token,r)}done(){Mi.Instances.delete(this._token),this._connection.sendProgress(rs.WorkDoneProgress.type,this._token,{kind:"end"})}};Mi.Instances=new Map;var Fp=class extends Mi{constructor(e,n){super(e,n);this._source=new rs.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},Pu=class{constructor(){}begin(){}report(){}done(){}},kp=class extends Pu{constructor(){super();this._source=new rs.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function xI(t,e){if(e===void 0||e.workDoneToken===void 0)return new Pu;let n=e.workDoneToken;return delete e.workDoneToken,new Mi(t,n)}is.attachWorkDone=xI;var RI=t=>class extends t{constructor(){super();this._progressSupported=!1}initialize(e){var n;((n=e==null?void 0:e.window)===null||n===void 0?void 0:n.workDoneProgress)===!0&&(this._progressSupported=!0,this.connection.onNotification(rs.WorkDoneProgressCancelNotification.type,r=>{let i=Mi.Instances.get(r.token);(i instanceof Fp||i instanceof kp)&&i.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new Pu:new Mi(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=DI.generateUuid();return this.connection.sendRequest(rs.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new Fp(this.connection,e))}else return Promise.resolve(new kp)}};is.ProgressFeature=RI;var Mp;(function(t){t.type=new rs.ProgressType})(Mp||(Mp={}));var uy=class{constructor(e,n){this._connection=e,this._token=n}report(e){this._connection.sendProgress(Mp.type,this._token,e)}};function wI(t,e){if(e===void 0||e.partialResultToken===void 0)return;let n=e.partialResultToken;return delete e.partialResultToken,new uy(t,n)}is.attachPartialResult=wI});var fy=X(Su=>{"use strict";Object.defineProperty(Su,"__esModule",{value:!0});Su.ConfigurationFeature=void 0;var OI=Bn(),LI=pu(),FI=t=>class extends t{getConfiguration(e){return e?LI.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let n={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(OI.ConfigurationRequest.type,n).then(r=>Array.isArray(e)?r:r[0])}};Su.ConfigurationFeature=FI});var py=X(Eu=>{"use strict";Object.defineProperty(Eu,"__esModule",{value:!0});Eu.WorkspaceFoldersFeature=void 0;var Au=Bn(),kI=t=>class extends t{initialize(e){let n=e.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Au.Emitter,this.connection.onNotification(Au.DidChangeWorkspaceFoldersNotification.type,r=>{this._onDidChangeWorkspaceFolders.fire(r.event)}))}getWorkspaceFolders(){return this.connection.sendRequest(Au.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return this._unregistration||(this._unregistration=this.connection.client.register(Au.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};Eu.WorkspaceFoldersFeature=kI});var dy=X(Iu=>{"use strict";Object.defineProperty(Iu,"__esModule",{value:!0});Iu.CallHierarchyFeature=void 0;var Bp=Bn(),MI=t=>class extends t{get callHierarchy(){return{onPrepare:e=>{this.connection.onRequest(Bp.CallHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0))},onIncomingCalls:e=>{let n=Bp.CallHierarchyIncomingCallsRequest.type;this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onOutgoingCalls:e=>{let n=Bp.CallHierarchyOutgoingCallsRequest.type;this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Iu.CallHierarchyFeature=MI});var Vp=X(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});wa.SemanticTokensBuilder=wa.SemanticTokensFeature=void 0;var qp=Bn(),BI=t=>class extends t{get semanticTokens(){return{on:e=>{let n=qp.SemanticTokensRequest.type;this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onDelta:e=>{let n=qp.SemanticTokensDeltaRequest.type;this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onRange:e=>{let n=qp.SemanticTokensRangeRequest.type;this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};wa.SemanticTokensFeature=BI;var hy=class{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(e,n,r,i,s){let a=e,o=n;this._dataLen>0&&(a-=this._prevLine,a===0&&(o-=this._prevChar)),this._data[this._dataLen++]=a,this._data[this._dataLen++]=o,this._data[this._dataLen++]=r,this._data[this._dataLen++]=i,this._data[this._dataLen++]=s,this._prevLine=e,this._prevChar=n}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){if(this._prevData!==void 0){let e=this._prevData.length,n=this._data.length,r=0;for(;r{"use strict";Object.defineProperty(Du,"__esModule",{value:!0});Du.ShowDocumentFeature=void 0;var qI=Bn(),VI=t=>class extends t{showDocument(e){return this.connection.sendRequest(qI.ShowDocumentRequest.type,e)}};Du.ShowDocumentFeature=VI});var gy=X(xu=>{"use strict";Object.defineProperty(xu,"__esModule",{value:!0});xu.FileOperationsFeature=void 0;var Oa=Bn(),jI=t=>class extends t{onDidCreateFiles(e){this.connection.onNotification(Oa.DidCreateFilesNotification.type,n=>{e(n)})}onDidRenameFiles(e){this.connection.onNotification(Oa.DidRenameFilesNotification.type,n=>{e(n)})}onDidDeleteFiles(e){this.connection.onNotification(Oa.DidDeleteFilesNotification.type,n=>{e(n)})}onWillCreateFiles(e){return this.connection.onRequest(Oa.WillCreateFilesRequest.type,(n,r)=>e(n,r))}onWillRenameFiles(e){return this.connection.onRequest(Oa.WillRenameFilesRequest.type,(n,r)=>e(n,r))}onWillDeleteFiles(e){return this.connection.onRequest(Oa.WillDeleteFilesRequest.type,(n,r)=>e(n,r))}};xu.FileOperationsFeature=jI});var _y=X(Ru=>{"use strict";Object.defineProperty(Ru,"__esModule",{value:!0});Ru.LinkedEditingRangeFeature=void 0;var UI=Bn(),WI=t=>class extends t{onLinkedEditingRange(e){this.connection.onRequest(UI.LinkedEditingRangeRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0))}};Ru.LinkedEditingRangeFeature=WI});var yy=X(wu=>{"use strict";Object.defineProperty(wu,"__esModule",{value:!0});wu.MonikerFeature=void 0;var GI=Bn(),YI=t=>class extends t{get moniker(){return{on:e=>{let n=GI.MonikerRequest.type;this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};wu.MonikerFeature=YI});var zp=X(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});ze.createConnection=ze.combineFeatures=ze.combineLanguagesFeatures=ze.combineWorkspaceFeatures=ze.combineWindowFeatures=ze.combineClientFeatures=ze.combineTracerFeatures=ze.combineTelemetryFeatures=ze.combineConsoleFeatures=ze._LanguagesImpl=ze.BulkUnregistration=ze.BulkRegistration=ze.ErrorMessageTracker=ze.TextDocuments=void 0;var ie=Bn(),vr=pu(),jp=Lp(),Be=cy(),HI=fy(),$I=py(),KI=dy(),zI=Vp(),XI=my(),QI=gy(),JI=_y(),ZI=yy();function Up(t){if(t!==null)return t}var by=class{constructor(e){this._documents=Object.create(null),this._configuration=e,this._onDidChangeContent=new ie.Emitter,this._onDidOpen=new ie.Emitter,this._onDidClose=new ie.Emitter,this._onDidSave=new ie.Emitter,this._onWillSave=new ie.Emitter}get onDidChangeContent(){return this._onDidChangeContent.event}get onDidOpen(){return this._onDidOpen.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._documents[e]}all(){return Object.keys(this._documents).map(e=>this._documents[e])}keys(){return Object.keys(this._documents)}listen(e){e.__textDocumentSync=ie.TextDocumentSyncKind.Full,e.onDidOpenTextDocument(n=>{let r=n.textDocument,i=this._configuration.create(r.uri,r.languageId,r.version,r.text);this._documents[r.uri]=i;let s=Object.freeze({document:i});this._onDidOpen.fire(s),this._onDidChangeContent.fire(s)}),e.onDidChangeTextDocument(n=>{let r=n.textDocument,i=n.contentChanges;if(i.length===0)return;let s=this._documents[r.uri],{version:a}=r;if(a==null)throw new Error(`Received document change event for ${r.uri} without valid version identifier`);s=this._configuration.update(s,i,a),this._documents[r.uri]=s,this._onDidChangeContent.fire(Object.freeze({document:s}))}),e.onDidCloseTextDocument(n=>{let r=this._documents[n.textDocument.uri];r&&(delete this._documents[n.textDocument.uri],this._onDidClose.fire(Object.freeze({document:r})))}),e.onWillSaveTextDocument(n=>{let r=this._documents[n.textDocument.uri];r&&this._onWillSave.fire(Object.freeze({document:r,reason:n.reason}))}),e.onWillSaveTextDocumentWaitUntil((n,r)=>{let i=this._documents[n.textDocument.uri];return i&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:i,reason:n.reason}),r):[]}),e.onDidSaveTextDocument(n=>{let r=this._documents[n.textDocument.uri];r&&this._onDidSave.fire(Object.freeze({document:r}))})}};ze.TextDocuments=by;var Ty=class{constructor(){this._messages=Object.create(null)}add(e){let n=this._messages[e];n||(n=0),n++,this._messages[e]=n}sendErrors(e){Object.keys(this._messages).forEach(n=>{e.window.showErrorMessage(n)})}};ze.ErrorMessageTracker=Ty;var Wp=class{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(ie.MessageType.Error,e)}warn(e){this.send(ie.MessageType.Warning,e)}info(e){this.send(ie.MessageType.Info,e)}log(e){this.send(ie.MessageType.Log,e)}send(e,n){this._rawConnection&&this._rawConnection.sendNotification(ie.LogMessageNotification.type,{type:e,message:n})}},vy=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...n){let r={type:ie.MessageType.Error,message:e,actions:n};return this.connection.sendRequest(ie.ShowMessageRequest.type,r).then(Up)}showWarningMessage(e,...n){let r={type:ie.MessageType.Warning,message:e,actions:n};return this.connection.sendRequest(ie.ShowMessageRequest.type,r).then(Up)}showInformationMessage(e,...n){let r={type:ie.MessageType.Info,message:e,actions:n};return this.connection.sendRequest(ie.ShowMessageRequest.type,r).then(Up)}},Ny=XI.ShowDocumentFeature(Be.ProgressFeature(vy)),eD;(function(t){function e(){return new Gp}t.create=e})(eD=ze.BulkRegistration||(ze.BulkRegistration={}));var Gp=class{constructor(){this._registrations=[],this._registered=new Set}add(e,n){let r=vr.string(e)?e:e.method;if(this._registered.has(r))throw new Error(`${r} is already added to this registration`);let i=jp.generateUuid();this._registrations.push({id:i,method:r,registerOptions:n||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}},tD;(function(t){function e(){return new Ou(void 0,[])}t.create=e})(tD=ze.BulkUnregistration||(ze.BulkUnregistration={}));var Ou=class{constructor(e,n){this._connection=e,this._unregistrations=new Map,n.forEach(r=>{this._unregistrations.set(r.method,r)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let r of this._unregistrations.values())e.push(r);let n={unregisterations:e};this._connection.sendRequest(ie.UnregistrationRequest.type,n).then(void 0,r=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let n=vr.string(e)?e:e.method,r=this._unregistrations.get(n);if(!r)return!1;let i={unregisterations:[r]};return this._connection.sendRequest(ie.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(n)},s=>{this._connection.console.info(`Un-registering request handler for ${r.id} failed.`)}),!0}},Yp=class{attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,n,r){return e instanceof Gp?this.registerMany(e):e instanceof Ou?this.registerSingle1(e,n,r):this.registerSingle2(e,n)}registerSingle1(e,n,r){let i=vr.string(n)?n:n.method,s=jp.generateUuid(),a={registrations:[{id:s,method:i,registerOptions:r||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(ie.RegistrationRequest.type,a).then(o=>(e.add({id:s,method:i}),e),o=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(o)))}registerSingle2(e,n){let r=vr.string(e)?e:e.method,i=jp.generateUuid(),s={registrations:[{id:i,method:r,registerOptions:n||{}}]};return this.connection.sendRequest(ie.RegistrationRequest.type,s).then(a=>ie.Disposable.create(()=>{this.unregisterSingle(i,r)}),a=>(this.connection.console.info(`Registering request handler for ${r} failed.`),Promise.reject(a)))}unregisterSingle(e,n){let r={unregisterations:[{id:e,method:n}]};return this.connection.sendRequest(ie.UnregistrationRequest.type,r).then(void 0,i=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let n=e.asRegistrationParams();return this.connection.sendRequest(ie.RegistrationRequest.type,n).then(()=>new Ou(this._connection,n.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}},Cy=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function n(i){return i&&!!i.edit}let r=n(e)?e:{edit:e};return this.connection.sendRequest(ie.ApplyWorkspaceEditRequest.type,r)}},Py=QI.FileOperationsFeature($I.WorkspaceFoldersFeature(HI.ConfigurationFeature(Cy))),Hp=class{constructor(){this._trace=ie.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,n){this._trace!==ie.Trace.Off&&this.connection.sendNotification(ie.LogTraceNotification.type,{message:e,verbose:this._trace===ie.Trace.Verbose?n:void 0})}},$p=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(ie.TelemetryEventNotification.type,e)}},Kp=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return Be.attachWorkDone(this.connection,e)}attachPartialResultProgress(e,n){return Be.attachPartialResult(this.connection,n)}};ze._LanguagesImpl=Kp;var Sy=ZI.MonikerFeature(JI.LinkedEditingRangeFeature(zI.SemanticTokensFeature(KI.CallHierarchyFeature(Kp))));function Ay(t,e){return function(n){return e(t(n))}}ze.combineConsoleFeatures=Ay;function Ey(t,e){return function(n){return e(t(n))}}ze.combineTelemetryFeatures=Ey;function Iy(t,e){return function(n){return e(t(n))}}ze.combineTracerFeatures=Iy;function Dy(t,e){return function(n){return e(t(n))}}ze.combineClientFeatures=Dy;function xy(t,e){return function(n){return e(t(n))}}ze.combineWindowFeatures=xy;function Ry(t,e){return function(n){return e(t(n))}}ze.combineWorkspaceFeatures=Ry;function nD(t,e){return function(n){return e(t(n))}}ze.combineLanguagesFeatures=nD;function rD(t,e){function n(i,s,a){return i&&s?a(i,s):i||s}return{__brand:"features",console:n(t.console,e.console,Ay),tracer:n(t.tracer,e.tracer,Iy),telemetry:n(t.telemetry,e.telemetry,Ey),client:n(t.client,e.client,Dy),window:n(t.window,e.window,xy),workspace:n(t.workspace,e.workspace,Ry)}}ze.combineFeatures=rD;function iD(t,e,n){let r=n&&n.console?new(n.console(Wp)):new Wp,i=t(r);r.rawAttach(i);let s=n&&n.tracer?new(n.tracer(Hp)):new Hp,a=n&&n.telemetry?new(n.telemetry($p)):new $p,o=n&&n.client?new(n.client(Yp)):new Yp,l=n&&n.window?new(n.window(Ny)):new Ny,u=n&&n.workspace?new(n.workspace(Py)):new Py,c=n&&n.languages?new(n.languages(Sy)):new Sy,f=[r,s,a,o,l,u,c];function h(m){return m instanceof Promise?m:vr.thenable(m)?new Promise((b,_)=>{m.then(N=>b(N),N=>_(N))}):Promise.resolve(m)}let y,p,d,g={listen:()=>i.listen(),sendRequest:(m,...b)=>i.sendRequest(vr.string(m)?m:m.method,...b),onRequest:(m,b)=>i.onRequest(m,b),sendNotification:(m,b)=>{let _=vr.string(m)?m:m.method;arguments.length===1?i.sendNotification(_):i.sendNotification(_,b)},onNotification:(m,b)=>i.onNotification(m,b),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:m=>p=m,onInitialized:m=>i.onNotification(ie.InitializedNotification.type,m),onShutdown:m=>y=m,onExit:m=>d=m,get console(){return r},get telemetry(){return a},get tracer(){return s},get client(){return o},get window(){return l},get workspace(){return u},get languages(){return c},onDidChangeConfiguration:m=>i.onNotification(ie.DidChangeConfigurationNotification.type,m),onDidChangeWatchedFiles:m=>i.onNotification(ie.DidChangeWatchedFilesNotification.type,m),__textDocumentSync:void 0,onDidOpenTextDocument:m=>i.onNotification(ie.DidOpenTextDocumentNotification.type,m),onDidChangeTextDocument:m=>i.onNotification(ie.DidChangeTextDocumentNotification.type,m),onDidCloseTextDocument:m=>i.onNotification(ie.DidCloseTextDocumentNotification.type,m),onWillSaveTextDocument:m=>i.onNotification(ie.WillSaveTextDocumentNotification.type,m),onWillSaveTextDocumentWaitUntil:m=>i.onRequest(ie.WillSaveTextDocumentWaitUntilRequest.type,m),onDidSaveTextDocument:m=>i.onNotification(ie.DidSaveTextDocumentNotification.type,m),sendDiagnostics:m=>i.sendNotification(ie.PublishDiagnosticsNotification.type,m),onHover:m=>i.onRequest(ie.HoverRequest.type,(b,_)=>m(b,_,Be.attachWorkDone(i,b),void 0)),onCompletion:m=>i.onRequest(ie.CompletionRequest.type,(b,_)=>m(b,_,Be.attachWorkDone(i,b),Be.attachPartialResult(i,b))),onCompletionResolve:m=>i.onRequest(ie.CompletionResolveRequest.type,m),onSignatureHelp:m=>i.onRequest(ie.SignatureHelpRequest.type,(b,_)=>m(b,_,Be.attachWorkDone(i,b),void 0)),onDeclaration:m=>i.onRequest(ie.DeclarationRequest.type,(b,_)=>m(b,_,Be.attachWorkDone(i,b),Be.attachPartialResult(i,b))),onDefinition:m=>i.onRequest(ie.DefinitionRequest.type,(b,_)=>m(b,_,Be.attachWorkDone(i,b),Be.attachPartialResult(i,b))),onTypeDefinition:m=>i.onRequest(ie.TypeDefinitionRequest.type,(b,_)=>m(b,_,Be.attachWorkDone(i,b),Be.attachPartialResult(i,b))),onImplementation:m=>i.onRequest(ie.ImplementationRequest.type,(b,_)=>m(b,_,Be.attachWorkDone(i,b),Be.attachPartialResult(i,b))),onReferences:m=>i.onRequest(ie.ReferencesRequest.type,(b,_)=>m(b,_,Be.attachWorkDone(i,b),Be.attachPartialResult(i,b))),onDocumentHighlight:m=>i.onRequest(ie.DocumentHighlightRequest.type,(b,_)=>m(b,_,Be.attachWorkDone(i,b),Be.attachPartialResult(i,b))),onDocumentSymbol:m=>i.onRequest(ie.DocumentSymbolRequest.type,(b,_)=>m(b,_,Be.attachWorkDone(i,b),Be.attachPartialResult(i,b))),onWorkspaceSymbol:m=>i.onRequest(ie.WorkspaceSymbolRequest.type,(b,_)=>m(b,_,Be.attachWorkDone(i,b),Be.attachPartialResult(i,b))),onCodeAction:m=>i.onRequest(ie.CodeActionRequest.type,(b,_)=>m(b,_,Be.attachWorkDone(i,b),Be.attachPartialResult(i,b))),onCodeActionResolve:m=>i.onRequest(ie.CodeActionResolveRequest.type,(b,_)=>m(b,_)),onCodeLens:m=>i.onRequest(ie.CodeLensRequest.type,(b,_)=>m(b,_,Be.attachWorkDone(i,b),Be.attachPartialResult(i,b))),onCodeLensResolve:m=>i.onRequest(ie.CodeLensResolveRequest.type,(b,_)=>m(b,_)),onDocumentFormatting:m=>i.onRequest(ie.DocumentFormattingRequest.type,(b,_)=>m(b,_,Be.attachWorkDone(i,b),void 0)),onDocumentRangeFormatting:m=>i.onRequest(ie.DocumentRangeFormattingRequest.type,(b,_)=>m(b,_,Be.attachWorkDone(i,b),void 0)),onDocumentOnTypeFormatting:m=>i.onRequest(ie.DocumentOnTypeFormattingRequest.type,(b,_)=>m(b,_)),onRenameRequest:m=>i.onRequest(ie.RenameRequest.type,(b,_)=>m(b,_,Be.attachWorkDone(i,b),void 0)),onPrepareRename:m=>i.onRequest(ie.PrepareRenameRequest.type,(b,_)=>m(b,_)),onDocumentLinks:m=>i.onRequest(ie.DocumentLinkRequest.type,(b,_)=>m(b,_,Be.attachWorkDone(i,b),Be.attachPartialResult(i,b))),onDocumentLinkResolve:m=>i.onRequest(ie.DocumentLinkResolveRequest.type,(b,_)=>m(b,_)),onDocumentColor:m=>i.onRequest(ie.DocumentColorRequest.type,(b,_)=>m(b,_,Be.attachWorkDone(i,b),Be.attachPartialResult(i,b))),onColorPresentation:m=>i.onRequest(ie.ColorPresentationRequest.type,(b,_)=>m(b,_,Be.attachWorkDone(i,b),Be.attachPartialResult(i,b))),onFoldingRanges:m=>i.onRequest(ie.FoldingRangeRequest.type,(b,_)=>m(b,_,Be.attachWorkDone(i,b),Be.attachPartialResult(i,b))),onSelectionRanges:m=>i.onRequest(ie.SelectionRangeRequest.type,(b,_)=>m(b,_,Be.attachWorkDone(i,b),Be.attachPartialResult(i,b))),onExecuteCommand:m=>i.onRequest(ie.ExecuteCommandRequest.type,(b,_)=>m(b,_,Be.attachWorkDone(i,b),void 0)),dispose:()=>i.dispose()};for(let m of f)m.attach(g);return i.onRequest(ie.InitializeRequest.type,m=>{e.initialize(m),vr.string(m.trace)&&(s.trace=ie.Trace.fromString(m.trace));for(let b of f)b.initialize(m.capabilities);if(p){let b=p(m,new ie.CancellationTokenSource().token,Be.attachWorkDone(i,m),void 0);return h(b).then(_=>{if(_ instanceof ie.ResponseError)return _;let N=_;N||(N={capabilities:{}});let C=N.capabilities;C||(C={},N.capabilities=C),C.textDocumentSync===void 0||C.textDocumentSync===null?C.textDocumentSync=vr.number(g.__textDocumentSync)?g.__textDocumentSync:ie.TextDocumentSyncKind.None:!vr.number(C.textDocumentSync)&&!vr.number(C.textDocumentSync.change)&&(C.textDocumentSync.change=vr.number(g.__textDocumentSync)?g.__textDocumentSync:ie.TextDocumentSyncKind.None);for(let G of f)G.fillServerCapabilities(C);return N})}else{let b={capabilities:{textDocumentSync:ie.TextDocumentSyncKind.None}};for(let _ of f)_.fillServerCapabilities(b.capabilities);return b}}),i.onRequest(ie.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,y)return y(new ie.CancellationTokenSource().token)}),i.onNotification(ie.ExitNotification.type,()=>{try{d&&d()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(ie.SetTraceNotification.type,m=>{s.trace=ie.Trace.fromString(m.value)}),g}ze.createConnection=iD});var Oy=X(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.resolveModulePath=Dn.FileSystem=Dn.resolveGlobalYarnPath=Dn.resolveGlobalNodePath=Dn.resolve=Dn.uriToFilePath=void 0;var sD=require("url"),Zr=require("path"),Xp=require("fs"),Qp=require("child_process");function aD(t){let e=sD.parse(t);if(e.protocol!=="file:"||!e.path)return;let n=e.path.split("/");for(var r=0,i=n.length;r1){let s=n[0],a=n[1];s.length===0&&a.length>1&&a[1]===":"&&n.shift()}return Zr.normalize(n.join("/"))}Dn.uriToFilePath=aD;function Jp(){return process.platform==="win32"}function Lu(t,e,n,r){let i="NODE_PATH",s=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((a,o)=>{let l=process.env,u=Object.create(null);Object.keys(l).forEach(c=>u[c]=l[c]),e&&Xp.existsSync(e)&&(u[i]?u[i]=e+Zr.delimiter+u[i]:u[i]=e,r&&r(`NODE_PATH value is: ${u[i]}`)),u.ELECTRON_RUN_AS_NODE="1";try{let c=Qp.fork("",[],{cwd:n,env:u,execArgv:["-e",s]});if(c.pid===void 0){o(new Error(`Starting process to resolve node module ${t} failed`));return}c.on("error",h=>{o(h)}),c.on("message",h=>{h.c==="r"&&(c.send({c:"e"}),h.s?a(h.r):o(new Error(`Failed to resolve module: ${t}`)))});let f={c:"rs",a:t};c.send(f)}catch(c){o(c)}})}Dn.resolve=Lu;function Zp(t){let e="npm",n=Object.create(null);Object.keys(process.env).forEach(s=>n[s]=process.env[s]),n.NO_UPDATE_NOTIFIER="true";let r={encoding:"utf8",env:n};Jp()&&(e="npm.cmd",r.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let s=Qp.spawnSync(e,["config","get","prefix"],r).stdout;if(!s){t&&t("'npm config get prefix' didn't return a value.");return}let a=s.trim();return t&&t(`'npm config get prefix' value is: ${a}`),a.length>0?Jp()?Zr.join(a,"node_modules"):Zr.join(a,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",i)}}Dn.resolveGlobalNodePath=Zp;function oD(t){let e="yarn",n={encoding:"utf8"};Jp()&&(e="yarn.cmd",n.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let i=Qp.spawnSync(e,["global","dir","--json"],n),s=i.stdout;if(!s){t&&(t("'yarn global dir' didn't return a value."),i.stderr&&t(i.stderr));return}let a=s.trim().split(/\r?\n/);for(let o of a)try{let l=JSON.parse(o);if(l.type==="log")return Zr.join(l.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",r)}}Dn.resolveGlobalYarnPath=oD;var wy;(function(t){let e;function n(){return e!==void 0||(process.platform==="win32"?e=!1:e=!Xp.existsSync(__filename.toUpperCase())||!Xp.existsSync(__filename.toLowerCase())),e}t.isCaseSensitive=n;function r(i,s){return n()?Zr.normalize(s).indexOf(Zr.normalize(i))===0:Zr.normalize(s).toLowerCase().indexOf(Zr.normalize(i).toLowerCase())===0}t.isParent=r})(wy=Dn.FileSystem||(Dn.FileSystem={}));function lD(t,e,n,r){return n?(Zr.isAbsolute(n)||(n=Zr.join(t,n)),Lu(e,n,n,r).then(i=>wy.isParent(n,i)?i:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,i=>Lu(e,Zp(r),t,r))):Lu(e,Zp(r),t,r)}Dn.resolveModulePath=lD});var ed=X((hB,Ly)=>{"use strict";Ly.exports=Bn()});var ky=X(Jn=>{"use strict";var uD=Jn&&Jn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Fy=Jn&&Jn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&uD(e,t,n)};Object.defineProperty(Jn,"__esModule",{value:!0});Jn.ProposedFeatures=Jn.SemanticTokensBuilder=void 0;var cD=Vp();Object.defineProperty(Jn,"SemanticTokensBuilder",{enumerable:!0,get:function(){return cD.SemanticTokensBuilder}});Fy(Bn(),Jn);Fy(zp(),Jn);var fD;(function(t){t.all={__brand:"features"}})(fD=Jn.ProposedFeatures||(Jn.ProposedFeatures={}))});var ei=X(Zn=>{"use strict";var pD=Zn&&Zn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),My=Zn&&Zn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&pD(e,t,n)};Object.defineProperty(Zn,"__esModule",{value:!0});Zn.createConnection=Zn.Files=void 0;var td=pu(),dD=zp(),ol=Oy(),Bs=ed();My(ed(),Zn);My(ky(),Zn);var hD;(function(t){t.uriToFilePath=ol.uriToFilePath,t.resolveGlobalNodePath=ol.resolveGlobalNodePath,t.resolveGlobalYarnPath=ol.resolveGlobalYarnPath,t.resolve=ol.resolve,t.resolveModulePath=ol.resolveModulePath})(hD=Zn.Files||(Zn.Files={}));var By;function Fu(){if(By!==void 0)try{By.end()}catch{}}var La=!1,qy;function mD(){let t="--clientProcessId";function e(n){try{let r=parseInt(n);isNaN(r)||(qy=setInterval(()=>{try{process.kill(r,0)}catch{Fu(),process.exit(La?0:1)}},3e3))}catch{}}for(let n=2;n{let e=t.processId;td.number(e)&&qy===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(La?0:1)}},3e3)},get shutdownReceived(){return La},set shutdownReceived(t){La=t},exit:t=>{Fu(),process.exit(t)}};function _D(t,e,n,r){let i,s,a,o;return t!==void 0&&t.__brand==="features"&&(i=t,t=e,e=n,n=r),Bs.ConnectionStrategy.is(t)||Bs.ConnectionOptions.is(t)?o=t:(s=t,a=e,o=n),yD(s,a,o,i)}Zn.createConnection=_D;function yD(t,e,n,r){if(!t&&!e&&process.argv.length>2){let o,l,u=process.argv.slice(2);for(let c=0;c{Fu(),process.exit(La?0:1)}),o.on("close",()=>{Fu(),process.exit(La?0:1)})}let a=o=>Bs.createProtocolConnection(t,e,o,n);return dD.createConnection(a,gD,r)}});var ms=X(Vn=>{"use strict";var Ui={ANCHOR:"&",COMMENT:"#",TAG:"!",DIRECTIVES_END:"-",DOCUMENT_END:"."},Cl={ALIAS:"ALIAS",BLANK_LINE:"BLANK_LINE",BLOCK_FOLDED:"BLOCK_FOLDED",BLOCK_LITERAL:"BLOCK_LITERAL",COMMENT:"COMMENT",DIRECTIVE:"DIRECTIVE",DOCUMENT:"DOCUMENT",FLOW_MAP:"FLOW_MAP",FLOW_SEQ:"FLOW_SEQ",MAP:"MAP",MAP_KEY:"MAP_KEY",MAP_VALUE:"MAP_VALUE",PLAIN:"PLAIN",QUOTE_DOUBLE:"QUOTE_DOUBLE",QUOTE_SINGLE:"QUOTE_SINGLE",SEQ:"SEQ",SEQ_ITEM:"SEQ_ITEM"},UR="tag:yaml.org,2002:",WR={MAP:"tag:yaml.org,2002:map",SEQ:"tag:yaml.org,2002:seq",STR:"tag:yaml.org,2002:str"};function A0(t){let e=[0],n=t.indexOf(` `);for(;n!==-1;)n+=1,e.push(n),n=t.indexOf(` -`,n);return e}function S0(t){let e,n;return typeof t=="string"?(e=A0(t),n=t):(Array.isArray(t)&&(t=t[0]),t&&t.context&&(t.lineStarts||(t.lineStarts=A0(t.context.src)),e=t.lineStarts,n=t.context.src)),{lineStarts:e,src:n}}function lh(t,e){if(typeof t!="number"||t<0)return null;let{lineStarts:n,src:r}=S0(e);if(!n||!r||t>r.length)return null;for(let s=0;s=1)||t>n.length)return null;let i=n[t-1],s=n[t];for(;s&&s>i&&r[s-1]===` -`;)--s;return r.slice(i,s)}function WR({start:t,end:e},n,r=80){let i=UR(t.line,n);if(!i)return null;let{col:s}=t;if(i.length>r)if(s<=r-10)i=i.substr(0,r-1)+"\u2026";else{let c=Math.round(r/2);i.length>s+c&&(i=i.substr(0,s+c-1)+"\u2026"),s-=i.length-r,i="\u2026"+i.substr(1-r)}let a=1,o="";e&&(e.line===t.line&&s+(e.col-t.col)<=r+1?a=e.col-t.col:(a=Math.min(i.length+1,r)-s,o="\u2026"));let l=s>1?" ".repeat(s-1):"",u="^".repeat(a);return`${i} +`,n);return e}function E0(t){let e,n;return typeof t=="string"?(e=A0(t),n=t):(Array.isArray(t)&&(t=t[0]),t&&t.context&&(t.lineStarts||(t.lineStarts=A0(t.context.src)),e=t.lineStarts,n=t.context.src)),{lineStarts:e,src:n}}function lh(t,e){if(typeof t!="number"||t<0)return null;let{lineStarts:n,src:r}=E0(e);if(!n||!r||t>r.length)return null;for(let s=0;s=1)||t>n.length)return null;let i=n[t-1],s=n[t];for(;s&&s>i&&r[s-1]===` +`;)--s;return r.slice(i,s)}function YR({start:t,end:e},n,r=80){let i=GR(t.line,n);if(!i)return null;let{col:s}=t;if(i.length>r)if(s<=r-10)i=i.substr(0,r-1)+"\u2026";else{let c=Math.round(r/2);i.length>s+c&&(i=i.substr(0,s+c-1)+"\u2026"),s-=i.length-r,i="\u2026"+i.substr(1-r)}let a=1,o="";e&&(e.line===t.line&&s+(e.col-t.col)<=r+1?a=e.col-t.col:(a=Math.min(i.length+1,r)-s,o="\u2026"));let l=s>1?" ".repeat(s-1):"",u="^".repeat(a);return`${i} ${l}${u}${o}`}var Ks=class{static copy(e){return new Ks(e.start,e.end)}constructor(e,n){this.start=e,this.end=n||e}isEmpty(){return typeof this.start!="number"||!this.end||this.end<=this.start}setOrigRange(e,n){let{start:r,end:i}=this;if(e.length===0||i<=e[0])return this.origStart=r,this.origEnd=i,n;let s=n;for(;sr);)++s;this.origStart=r+s;let a=s;for(;s=i);)++s;return this.origEnd=i+s,a}},pn=class{static addStringTerminator(e,n,r){if(r[r.length-1]===` `)return r;let i=pn.endOfWhiteSpace(e,n);return i>=e.length||e[i]===` `?r+` @@ -54,10 +54,10 @@ ${l}${u}${o}`}var Ks=class{static copy(e){return new Ks(e.start,e.end)}construct `:i=0,n+=1,a+=` `;break;case" ":i<=r&&(s=!0),n=pn.endOfWhiteSpace(e,n+2)-1;break;case" ":i+=1,n+=1;break}o=e[n+1]}return a||(a=" "),o&&i<=r&&(s=!0),{fold:a,offset:n,error:s}}constructor(e,n,r){Object.defineProperty(this,"context",{value:r||null,writable:!0}),this.error=null,this.range=null,this.valueRange=null,this.props=n||[],this.type=e,this.value=null}getPropValue(e,n,r){if(!this.context)return null;let{src:i}=this.context,s=this.props[e];return s&&i[s.start]===n?i.slice(s.start+(r?1:0),s.end):null}get anchor(){for(let e=0;e0?e.join(` `):null}commentHasRequiredWhitespace(e){let{src:n}=this.context;if(this.header&&e===this.header.end||!this.valueRange)return!1;let{end:r}=this.valueRange;return e!==r||pn.atBlank(n,r-1)}get hasComment(){if(this.context){let{src:e}=this.context;for(let n=0;nr.setOrigRange(e,n)),n}toString(){let{context:{src:e},range:n,value:r}=this;if(r!=null)return r;let i=e.slice(n.start,n.end);return pn.addStringTerminator(e,n.end,i)}},uo=class extends Error{constructor(e,n,r){if(!r||!(n instanceof pn))throw new Error(`Invalid arguments for new ${e}`);super();this.name=e,this.message=r,this.source=n}makePretty(){if(!this.source)return;this.nodeType=this.source.type;let e=this.source.context&&this.source.context.root;if(typeof this.offset=="number"){this.range=new Ks(this.offset,this.offset+1);let n=e&&lh(this.offset,e);if(n){let r={line:n.line,col:n.col+1};this.linePos={start:n,end:r}}delete this.offset}else this.range=this.source.range,this.linePos=this.source.rangeAsLinePos;if(this.linePos){let{line:n,col:r}=this.linePos.start;this.message+=` at line ${n}, column ${r}`;let i=e&&WR(this.linePos,e);i&&(this.message+=`: +`)return!0;return!1}parseComment(e){let{src:n}=this.context;if(n[e]===Ui.COMMENT){let r=pn.endOfLine(n,e+1),i=new Ks(e,r);return this.props.push(i),r}return e}setOrigRanges(e,n){return this.range&&(n=this.range.setOrigRange(e,n)),this.valueRange&&this.valueRange.setOrigRange(e,n),this.props.forEach(r=>r.setOrigRange(e,n)),n}toString(){let{context:{src:e},range:n,value:r}=this;if(r!=null)return r;let i=e.slice(n.start,n.end);return pn.addStringTerminator(e,n.end,i)}},uo=class extends Error{constructor(e,n,r){if(!r||!(n instanceof pn))throw new Error(`Invalid arguments for new ${e}`);super();this.name=e,this.message=r,this.source=n}makePretty(){if(!this.source)return;this.nodeType=this.source.type;let e=this.source.context&&this.source.context.root;if(typeof this.offset=="number"){this.range=new Ks(this.offset,this.offset+1);let n=e&&lh(this.offset,e);if(n){let r={line:n.line,col:n.col+1};this.linePos={start:n,end:r}}delete this.offset}else this.range=this.source.range,this.linePos=this.source.rangeAsLinePos;if(this.linePos){let{line:n,col:r}=this.linePos.start;this.message+=` at line ${n}, column ${r}`;let i=e&&YR(this.linePos,e);i&&(this.message+=`: ${i} -`)}delete this.source}},E0=class extends uo{constructor(e,n){super("YAMLReferenceError",e,n)}},Lc=class extends uo{constructor(e,n){super("YAMLSemanticError",e,n)}},I0=class extends uo{constructor(e,n){super("YAMLSyntaxError",e,n)}},D0=class extends uo{constructor(e,n){super("YAMLWarning",e,n)}};function GR(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Pl=class extends pn{static endOfLine(e,n,r){let i=e[n],s=n;for(;i&&i!==` +`)}delete this.source}},I0=class extends uo{constructor(e,n){super("YAMLReferenceError",e,n)}},Lc=class extends uo{constructor(e,n){super("YAMLSemanticError",e,n)}},D0=class extends uo{constructor(e,n){super("YAMLSyntaxError",e,n)}},x0=class extends uo{constructor(e,n){super("YAMLWarning",e,n)}};function HR(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Pl=class extends pn{static endOfLine(e,n,r){let i=e[n],s=n;for(;i&&i!==` `&&!(r&&(i==="["||i==="]"||i==="{"||i==="}"||i===","));){let a=e[s+1];if(i===":"&&(!a||a===` `||a===" "||a===" "||r&&a===",")||(i===" "||i===" ")&&a==="#")break;s+=1,i=a}return s}get strValue(){if(!this.valueRange||!this.context)return null;let{start:e,end:n}=this.valueRange,{src:r}=this.context,i=r[n-1];for(;eu?r.slice(u,o+1):l)}else s+=l}let a=r[e];switch(a){case" ":{let o="Plain value cannot start with a tab character";return{errors:[new Lc(this,o)],str:s}}case"@":case"`":{let o=`Plain value cannot start with reserved character ${a}`;return{errors:[new Lc(this,o)],str:s}}default:return s}}parseBlockValue(e){let{indent:n,inFlow:r,src:i}=this.context,s=e,a=e;for(let o=i[s];o===` `&&!pn.atDocumentBoundary(i,s+1);o=i[s]){let l=pn.endOfBlockIndent(i,n,s+1);if(l===null||i[l]==="#")break;i[l]===` `?s=l:(a=Pl.endOfLine(i,l,r),s=a)}return this.valueRange.isEmpty()&&(this.valueRange.start=e),this.valueRange.end=a,a}parse(e,n){this.context=e;let{inFlow:r,src:i}=e,s=n,a=i[s];return a&&a!=="#"&&a!==` -`&&(s=Pl.endOfLine(i,n,r)),this.valueRange=new Ks(n,s),s=pn.endOfWhiteSpace(i,s),s=this.parseComment(s),(!this.hasComment||this.valueRange.isEmpty())&&(s=this.parseBlockValue(s)),s}};Vn.Char=Ui;Vn.Node=pn;Vn.PlainValue=Pl;Vn.Range=Ks;Vn.Type=Cl;Vn.YAMLError=uo;Vn.YAMLReferenceError=E0;Vn.YAMLSemanticError=Lc;Vn.YAMLSyntaxError=I0;Vn.YAMLWarning=D0;Vn._defineProperty=GR;Vn.defaultTagPrefix=VR;Vn.defaultTags=jR});var F0=X(L0=>{"use strict";var q=ms(),co=class extends q.Node{constructor(){super(q.Type.BLANK_LINE)}get includesTrailingLines(){return!0}parse(e,n){return this.context=e,this.range=new q.Range(n,n+1),n+1}},Fc=class extends q.Node{constructor(e,n){super(e,n);this.node=null}get includesTrailingLines(){return!!this.node&&this.node.includesTrailingLines}parse(e,n){this.context=e;let{parseNode:r,src:i}=e,{atLineStart:s,lineStart:a}=e;!s&&this.type===q.Type.SEQ_ITEM&&(this.error=new q.YAMLSemanticError(this,"Sequence items must not have preceding content on the same line"));let o=s?n-a:e.indent,l=q.Node.endOfWhiteSpace(i,n+1),u=i[l],c=u==="#",f=[],h=null;for(;u===` +`&&(s=Pl.endOfLine(i,n,r)),this.valueRange=new Ks(n,s),s=pn.endOfWhiteSpace(i,s),s=this.parseComment(s),(!this.hasComment||this.valueRange.isEmpty())&&(s=this.parseBlockValue(s)),s}};Vn.Char=Ui;Vn.Node=pn;Vn.PlainValue=Pl;Vn.Range=Ks;Vn.Type=Cl;Vn.YAMLError=uo;Vn.YAMLReferenceError=I0;Vn.YAMLSemanticError=Lc;Vn.YAMLSyntaxError=D0;Vn.YAMLWarning=x0;Vn._defineProperty=HR;Vn.defaultTagPrefix=UR;Vn.defaultTags=WR});var k0=X(F0=>{"use strict";var q=ms(),co=class extends q.Node{constructor(){super(q.Type.BLANK_LINE)}get includesTrailingLines(){return!0}parse(e,n){return this.context=e,this.range=new q.Range(n,n+1),n+1}},Fc=class extends q.Node{constructor(e,n){super(e,n);this.node=null}get includesTrailingLines(){return!!this.node&&this.node.includesTrailingLines}parse(e,n){this.context=e;let{parseNode:r,src:i}=e,{atLineStart:s,lineStart:a}=e;!s&&this.type===q.Type.SEQ_ITEM&&(this.error=new q.YAMLSemanticError(this,"Sequence items must not have preceding content on the same line"));let o=s?n-a:e.indent,l=q.Node.endOfWhiteSpace(i,n+1),u=i[l],c=u==="#",f=[],h=null;for(;u===` `||u==="#";){if(u==="#"){let p=q.Node.endOfLine(i,l+1);f.push(new q.Range(l,p)),l=p}else{s=!0,a=l+1;let p=q.Node.endOfWhiteSpace(i,a);i[p]===` `&&f.length===0&&(h=new co,a=h.parse({src:i},a)),l=q.Node.endOfIndent(i,a)}u=i[l]}if(q.Node.nextNodeIsIndented(u,l-(a+o),this.type!==q.Type.SEQ_ITEM)?this.node=r({atLineStart:s,inCollection:!1,indent:o,lineStart:a,parent:this},l):u&&a>n+1&&(l=a-1),this.node){if(h){let p=e.parent.items||e.parent.contents;p&&p.push(h)}f.length&&Array.prototype.push.apply(this.props,f),l=this.node.range.end}else if(c){let p=f[0];this.props.push(p),l=p.end}else l=q.Node.endOfLine(i,n+1);let y=this.node?this.node.valueRange.end:l;return this.valueRange=new q.Range(n,y),l}setOrigRanges(e,n){return n=super.setOrigRanges(e,n),this.node?this.node.setOrigRanges(e,n):n}toString(){let{context:{src:e},node:n,range:r,value:i}=this;if(i!=null)return i;let s=n?e.slice(r.start,n.range.start)+String(n):e.slice(r.start,r.end);return q.Node.addStringTerminator(e,r.end,s)}},fo=class extends q.Node{constructor(){super(q.Type.COMMENT)}parse(e,n){this.context=e;let r=this.parseComment(n);return this.range=new q.Range(n,r),r}};function uh(t){let e=t;for(;e instanceof Fc;)e=e.node;if(!(e instanceof po))return null;let n=e.items.length,r=-1;for(let a=n-1;a>=0;--a){let o=e.items[a];if(o.type===q.Type.COMMENT){let{indent:l,lineStart:u}=o.context;if(l>0&&o.range.start>=u+l)break;r=a}else if(o.type===q.Type.BLANK_LINE)r=a;else break}if(r===-1)return null;let i=e.items.splice(r,n-r),s=i[0].range.start;for(;e.range.end=s,e.valueRange&&e.valueRange.end>s&&(e.valueRange.end=s),e!==t;)e=e.context.parent;return i}var po=class extends q.Node{static nextContentHasIndent(e,n,r){let i=q.Node.endOfLine(e,n)+1;n=q.Node.endOfWhiteSpace(e,i);let s=e[n];return s?n>=i+r?!0:s!=="#"&&s!==` `?!1:po.nextContentHasIndent(e,n,r):!1}constructor(e){super(e.type===q.Type.SEQ_ITEM?q.Type.SEQ:q.Type.MAP);for(let r=e.props.length-1;r>=0;--r)if(e.props[r].start0}parse(e,n){this.context=e;let{parseNode:r,src:i}=e,s=q.Node.startOfLine(i,n),a=this.items[0];a.context.parent=this,this.valueRange=q.Range.copy(a.valueRange);let o=a.range.start-a.context.lineStart,l=n;l=q.Node.normalizeOffset(i,l);let u=i[l],c=q.Node.endOfWhiteSpace(i,s)===l,f=!1;for(;u;){for(;u===` @@ -73,16 +73,16 @@ ${i} `&&!f){let p=new co;if(l=p.parse({src:i},l),this.valueRange.end=l,l>=i.length){u=null;break}this.items.push(p),l-=1}else if(u==="#"){if(l=i.length){u=null;break}}if(s=l+1,l=q.Node.endOfIndent(i,s),q.Node.atBlank(i,l)){let p=q.Node.endOfWhiteSpace(i,l),d=i[p];(!d||d===` `||d==="#")&&(l=p)}u=i[l],c=!0}if(!u)break;if(l!==s+o&&(c||u!==":")){if(ln&&(l=s);break}else if(!this.error){let p="All collection items must start at the same column";this.error=new q.YAMLSyntaxError(this,p)}}if(a.type===q.Type.SEQ_ITEM){if(u!=="-"){s>n&&(l=s);break}}else if(u==="-"&&!this.error){let p=i[l+1];if(!p||p===` `||p===" "||p===" "){let d="A collection cannot be both a mapping and a sequence";this.error=new q.YAMLSyntaxError(this,d)}}let h=r({atLineStart:c,inCollection:!0,indent:o,lineStart:s,parent:this},l);if(!h)return l;if(this.items.push(h),this.valueRange.end=h.valueRange.end,l=q.Node.normalizeOffset(i,h.range.end),u=i[l],c=!1,f=h.includesTrailingLines,u){let p=l-1,d=i[p];for(;d===" "||d===" ";)d=i[--p];d===` -`&&(s=p+1,c=!0)}let y=uh(h);y&&Array.prototype.push.apply(this.items,y)}return l}setOrigRanges(e,n){return n=super.setOrigRanges(e,n),this.items.forEach(r=>{n=r.setOrigRanges(e,n)}),n}toString(){let{context:{src:e},items:n,range:r,value:i}=this;if(i!=null)return i;let s=e.slice(r.start,n[0].range.start)+String(n[0]);for(let a=1;a{n=r.setOrigRanges(e,n)}),n}toString(){let{context:{src:e},items:n,range:r,value:i}=this;if(i!=null)return i;let s=e.slice(r.start,n[0].range.start)+String(n[0]);for(let a=1;a0&&(this.contents=this.directives,this.directives=[]),s}return n[s]?(this.directivesEndMarker=new q.Range(s,s+3),s+3):(i?this.error=new q.YAMLSemanticError(this,"Missing directives-end indicator line"):this.directives.length>0&&(this.contents=this.directives,this.directives=[]),s)}parseContents(e){let{parseNode:n,src:r}=this.context;this.contents||(this.contents=[]);let i=e;for(;r[i-1]==="-";)i-=1;let s=q.Node.endOfWhiteSpace(r,e),a=i===e;for(this.valueRange=new q.Range(s);!q.Node.atDocumentBoundary(r,s,q.Char.DOCUMENT_END);){switch(r[s]){case` -`:if(a){let o=new co;s=o.parse({src:r},s),s0&&(this.contents=this.directives,this.directives=[]),s}return n[s]?(this.directivesEndMarker=new q.Range(s,s+3),s+3):(i?this.error=new q.YAMLSemanticError(this,"Missing directives-end indicator line"):this.directives.length>0&&(this.contents=this.directives,this.directives=[]),s)}parseContents(e){let{parseNode:n,src:r}=this.context;this.contents||(this.contents=[]);let i=e;for(;r[i-1]==="-";)i-=1;let s=q.Node.endOfWhiteSpace(r,e),a=i===e;for(this.valueRange=new q.Range(s);!q.Node.atDocumentBoundary(r,s,q.Char.DOCUMENT_END);){switch(r[s]){case` +`:if(a){let o=new co;s=o.parse({src:r},s),s{n=r.setOrigRanges(e,n)}),this.directivesEndMarker&&(n=this.directivesEndMarker.setOrigRange(e,n)),this.contents.forEach(r=>{n=r.setOrigRanges(e,n)}),this.documentEndMarker&&(n=this.documentEndMarker.setOrigRange(e,n)),n}toString(){let{contents:e,directives:n,value:r}=this;if(r!=null)return r;let i=n.join("");return e.length>0&&((n.length>0||e[0].type===q.Type.COMMENT)&&(i+=`--- `),i+=e.join("")),i[i.length-1]!==` `&&(i+=` -`),i}},R0=class extends q.Node{parse(e,n){this.context=e;let{src:r}=e,i=q.Node.endOfIdentifier(r,n+1);return this.valueRange=new q.Range(n+1,i),i=q.Node.endOfWhiteSpace(r,i),i=this.parseComment(i),i}},gs={CLIP:"CLIP",KEEP:"KEEP",STRIP:"STRIP"},w0=class extends q.Node{constructor(e,n){super(e,n);this.blockIndent=null,this.chomping=gs.CLIP,this.header=null}get includesTrailingLines(){return this.chomping===gs.KEEP}get strValue(){if(!this.valueRange||!this.context)return null;let{start:e,end:n}=this.valueRange,{indent:r,src:i}=this.context;if(this.valueRange.isEmpty())return"";let s=null,a=i[n-1];for(;a===` +`),i}},w0=class extends q.Node{parse(e,n){this.context=e;let{src:r}=e,i=q.Node.endOfIdentifier(r,n+1);return this.valueRange=new q.Range(n+1,i),i=q.Node.endOfWhiteSpace(r,i),i=this.parseComment(i),i}},gs={CLIP:"CLIP",KEEP:"KEEP",STRIP:"STRIP"},O0=class extends q.Node{constructor(e,n){super(e,n);this.blockIndent=null,this.chomping=gs.CLIP,this.header=null}get includesTrailingLines(){return this.chomping===gs.KEEP}get strValue(){if(!this.valueRange||!this.context)return null;let{start:e,end:n}=this.valueRange,{indent:r,src:i}=this.context;if(this.valueRange.isEmpty())return"";let s=null,a=i[n-1];for(;a===` `||a===" "||a===" ";){if(n-=1,n<=e){if(this.chomping===gs.KEEP)break;return""}a===` `&&(s=n),a=i[n-1]}let o=n+1;s&&(this.chomping===gs.KEEP?(o=s,n=this.valueRange.end):n=s);let l=r+this.blockIndent,u=this.type===q.Type.BLOCK_FOLDED,c=!0,f="",h="",y=!1;for(let p=e;po&&(o=f);r[u]===` -`?s=u:s=a=q.Node.endOfLine(r,u)}return this.chomping!==gs.KEEP&&(s=r[a]?a+1:a),this.valueRange=new q.Range(e+1,s),s}parse(e,n){this.context=e;let{src:r}=e,i=this.parseBlockHeader(n);return i=q.Node.endOfWhiteSpace(r,i),i=this.parseComment(i),i=this.parseBlockValue(i),i}setOrigRanges(e,n){return n=super.setOrigRanges(e,n),this.header?this.header.setOrigRange(e,n):n}},O0=class extends q.Node{constructor(e,n){super(e,n);this.items=null}prevNodeIsJsonLike(e=this.items.length){let n=this.items[e-1];return!!n&&(n.jsonLike||n.type===q.Type.COMMENT&&this.prevNodeIsJsonLike(e-1))}parse(e,n){this.context=e;let{parseNode:r,src:i}=e,{indent:s,lineStart:a}=e,o=i[n];this.items=[{char:o,offset:n}];let l=q.Node.endOfWhiteSpace(i,n+1);for(o=i[l];o&&o!=="]"&&o!=="}";){switch(o){case` +`?s=u:s=a=q.Node.endOfLine(r,u)}return this.chomping!==gs.KEEP&&(s=r[a]?a+1:a),this.valueRange=new q.Range(e+1,s),s}parse(e,n){this.context=e;let{src:r}=e,i=this.parseBlockHeader(n);return i=q.Node.endOfWhiteSpace(r,i),i=this.parseComment(i),i=this.parseBlockValue(i),i}setOrigRanges(e,n){return n=super.setOrigRanges(e,n),this.header?this.header.setOrigRange(e,n):n}},L0=class extends q.Node{constructor(e,n){super(e,n);this.items=null}prevNodeIsJsonLike(e=this.items.length){let n=this.items[e-1];return!!n&&(n.jsonLike||n.type===q.Type.COMMENT&&this.prevNodeIsJsonLike(e-1))}parse(e,n){this.context=e;let{parseNode:r,src:i}=e,{indent:s,lineStart:a}=e,o=i[n];this.items=[{char:o,offset:n}];let l=q.Node.endOfWhiteSpace(i,n+1);for(o=i[l];o&&o!=="]"&&o!=="}";){switch(o){case` `:{a=l+1;let u=q.Node.endOfWhiteSpace(i,a);if(i[u]===` `){let c=new co;a=c.parse({src:i},a),this.items.push(c)}if(l=q.Node.endOfIndent(i,a),l<=a+s&&(o=i[l],l{if(r instanceof q.Node)n=r.setOrigRanges(e,n);else if(e.length===0)r.origOffset=r.offset;else{let i=n;for(;ir.offset);)++i;r.origOffset=r.offset+i,n=i}}),n}toString(){let{context:{src:e},items:n,range:r,value:i}=this;if(i!=null)return i;let s=n.filter(l=>l instanceof q.Node),a="",o=r.start;return s.forEach(l=>{let u=e.slice(o,l.range.start);o=l.range.end,a+=u+String(l),a[a.length-1]===` @@ -110,124 +110,124 @@ ${i} `:for(;s[o+1]===" "||s[o+1]===" ";)o+=1;break;default:e.push(new q.YAMLSyntaxError(this,`Invalid escape sequence ${s.substr(o-1,2)}`)),a+="\\"+s[o]}else if(l===" "||l===" "){let u=o,c=s[o+1];for(;c===" "||c===" ";)o+=1,c=s[o+1];c!==` `&&(a+=o>u?s.slice(u,o+1):l)}else a+=l}return e.length>0?{errors:e,str:a}:a}parseCharCode(e,n,r){let{src:i}=this.context,s=i.substr(e,n),o=s.length===n&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;return isNaN(o)?(r.push(new q.YAMLSyntaxError(this,`Invalid escape sequence ${i.substr(e-2,n+2)}`)),i.substr(e-2,n+2)):String.fromCodePoint(o)}parse(e,n){this.context=e;let{src:r}=e,i=kc.endOfQuote(r,n+1);return this.valueRange=new q.Range(n,i),i=q.Node.endOfWhiteSpace(r,i),i=this.parseComment(i),i}},Mc=class extends q.Node{static endOfQuote(e,n){let r=e[n];for(;r;)if(r==="'"){if(e[n+1]!=="'")break;r=e[n+=2]}else r=e[n+=1];return n+1}get strValue(){if(!this.valueRange||!this.context)return null;let e=[],{start:n,end:r}=this.valueRange,{indent:i,src:s}=this.context;s[r-1]!=="'"&&e.push(new q.YAMLSyntaxError(this,"Missing closing 'quote"));let a="";for(let o=n+1;ou?s.slice(u,o+1):l)}else a+=l}return e.length>0?{errors:e,str:a}:a}parse(e,n){this.context=e;let{src:r}=e,i=Mc.endOfQuote(r,n+1);return this.valueRange=new q.Range(n,i),i=q.Node.endOfWhiteSpace(r,i),i=this.parseComment(i),i}};function YR(t,e){switch(t){case q.Type.ALIAS:return new R0(t,e);case q.Type.BLOCK_FOLDED:case q.Type.BLOCK_LITERAL:return new w0(t,e);case q.Type.FLOW_MAP:case q.Type.FLOW_SEQ:return new O0(t,e);case q.Type.MAP_KEY:case q.Type.MAP_VALUE:case q.Type.SEQ_ITEM:return new Fc(t,e);case q.Type.COMMENT:case q.Type.PLAIN:return new q.PlainValue(t,e);case q.Type.QUOTE_DOUBLE:return new kc(t,e);case q.Type.QUOTE_SINGLE:return new Mc(t,e);default:return null}}var ho=class{static parseType(e,n,r){switch(e[n]){case"*":return q.Type.ALIAS;case">":return q.Type.BLOCK_FOLDED;case"|":return q.Type.BLOCK_LITERAL;case"{":return q.Type.FLOW_MAP;case"[":return q.Type.FLOW_SEQ;case"?":return!r&&q.Node.atBlank(e,n+1,!0)?q.Type.MAP_KEY:q.Type.PLAIN;case":":return!r&&q.Node.atBlank(e,n+1,!0)?q.Type.MAP_VALUE:q.Type.PLAIN;case"-":return!r&&q.Node.atBlank(e,n+1,!0)?q.Type.SEQ_ITEM:q.Type.PLAIN;case'"':return q.Type.QUOTE_DOUBLE;case"'":return q.Type.QUOTE_SINGLE;default:return q.Type.PLAIN}}constructor(e={},{atLineStart:n,inCollection:r,inFlow:i,indent:s,lineStart:a,parent:o}={}){q._defineProperty(this,"parseNode",(l,u)=>{if(q.Node.atDocumentBoundary(this.src,u))return null;let c=new ho(this,l),{props:f,type:h,valueStart:y}=c.parseProps(u),p=YR(h,f),d=p.parse(c,y);if(p.range=new q.Range(u,d),d<=u&&(p.error=new Error("Node#parse consumed no characters"),p.error.parseEnd=d,p.error.source=p,p.range.end=u+1),c.nodeStartsCollection(p)){!p.error&&!c.atLineStart&&c.parent.type===q.Type.DOCUMENT&&(p.error=new q.YAMLSyntaxError(p,"Block collection must not have preceding content here (e.g. directives-end indicator)"));let g=new po(p);return d=g.parse(new ho(c),d),g.range=new q.Range(u,d),g}return p}),this.atLineStart=n??(e.atLineStart||!1),this.inCollection=r??(e.inCollection||!1),this.inFlow=i??(e.inFlow||!1),this.indent=s??e.indent,this.lineStart=a??e.lineStart,this.parent=o??(e.parent||{}),this.root=e.root,this.src=e.src}nodeStartsCollection(e){let{inCollection:n,inFlow:r,src:i}=this;if(n||r)return!1;if(e instanceof Fc)return!0;let s=e.range.end;return i[s]===` +`&&(a+=o>u?s.slice(u,o+1):l)}else a+=l}return e.length>0?{errors:e,str:a}:a}parse(e,n){this.context=e;let{src:r}=e,i=Mc.endOfQuote(r,n+1);return this.valueRange=new q.Range(n,i),i=q.Node.endOfWhiteSpace(r,i),i=this.parseComment(i),i}};function $R(t,e){switch(t){case q.Type.ALIAS:return new w0(t,e);case q.Type.BLOCK_FOLDED:case q.Type.BLOCK_LITERAL:return new O0(t,e);case q.Type.FLOW_MAP:case q.Type.FLOW_SEQ:return new L0(t,e);case q.Type.MAP_KEY:case q.Type.MAP_VALUE:case q.Type.SEQ_ITEM:return new Fc(t,e);case q.Type.COMMENT:case q.Type.PLAIN:return new q.PlainValue(t,e);case q.Type.QUOTE_DOUBLE:return new kc(t,e);case q.Type.QUOTE_SINGLE:return new Mc(t,e);default:return null}}var ho=class{static parseType(e,n,r){switch(e[n]){case"*":return q.Type.ALIAS;case">":return q.Type.BLOCK_FOLDED;case"|":return q.Type.BLOCK_LITERAL;case"{":return q.Type.FLOW_MAP;case"[":return q.Type.FLOW_SEQ;case"?":return!r&&q.Node.atBlank(e,n+1,!0)?q.Type.MAP_KEY:q.Type.PLAIN;case":":return!r&&q.Node.atBlank(e,n+1,!0)?q.Type.MAP_VALUE:q.Type.PLAIN;case"-":return!r&&q.Node.atBlank(e,n+1,!0)?q.Type.SEQ_ITEM:q.Type.PLAIN;case'"':return q.Type.QUOTE_DOUBLE;case"'":return q.Type.QUOTE_SINGLE;default:return q.Type.PLAIN}}constructor(e={},{atLineStart:n,inCollection:r,inFlow:i,indent:s,lineStart:a,parent:o}={}){q._defineProperty(this,"parseNode",(l,u)=>{if(q.Node.atDocumentBoundary(this.src,u))return null;let c=new ho(this,l),{props:f,type:h,valueStart:y}=c.parseProps(u),p=$R(h,f),d=p.parse(c,y);if(p.range=new q.Range(u,d),d<=u&&(p.error=new Error("Node#parse consumed no characters"),p.error.parseEnd=d,p.error.source=p,p.range.end=u+1),c.nodeStartsCollection(p)){!p.error&&!c.atLineStart&&c.parent.type===q.Type.DOCUMENT&&(p.error=new q.YAMLSyntaxError(p,"Block collection must not have preceding content here (e.g. directives-end indicator)"));let g=new po(p);return d=g.parse(new ho(c),d),g.range=new q.Range(u,d),g}return p}),this.atLineStart=n??(e.atLineStart||!1),this.inCollection=r??(e.inCollection||!1),this.inFlow=i??(e.inFlow||!1),this.indent=s??e.indent,this.lineStart=a??e.lineStart,this.parent=o??(e.parent||{}),this.root=e.root,this.src=e.src}nodeStartsCollection(e){let{inCollection:n,inFlow:r,src:i}=this;if(n||r)return!1;if(e instanceof Fc)return!0;let s=e.range.end;return i[s]===` `||i[s-1]===` `?!1:(s=q.Node.endOfWhiteSpace(i,s),i[s]===":")}parseProps(e){let{inFlow:n,parent:r,src:i}=this,s=[],a=!1;e=this.atLineStart?q.Node.endOfIndent(i,e):q.Node.endOfWhiteSpace(i,e);let o=i[e];for(;o===q.Char.ANCHOR||o===q.Char.COMMENT||o===q.Char.TAG||o===` `;){if(o===` `){let u=e,c;do c=u+1,u=q.Node.endOfIndent(i,c);while(i[u]===` -`);let f=u-(c+this.indent),h=r.type===q.Type.SEQ_ITEM&&r.context.atLineStart;if(i[u]!=="#"&&!q.Node.nextNodeIsIndented(i[u],f,!h))break;this.atLineStart=!0,this.lineStart=c,a=!1,e=u}else if(o===q.Char.COMMENT){let u=q.Node.endOfLine(i,e+1);s.push(new q.Range(e,u)),e=u}else{let u=q.Node.endOfIdentifier(i,e+1);o===q.Char.TAG&&i[u]===","&&/^[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+,\d\d\d\d(-\d\d){0,2}\/\S/.test(i.slice(e+1,u+13))&&(u=q.Node.endOfIdentifier(i,u+5)),s.push(new q.Range(e,u)),a=!0,e=q.Node.endOfWhiteSpace(i,u)}o=i[e]}a&&o===":"&&q.Node.atBlank(i,e+1,!0)&&(e-=1);let l=ho.parseType(i,e,n);return{props:s,type:l,valueStart:e}}};function HR(t){let e=[];t.indexOf("\r")!==-1&&(t=t.replace(/\r\n?/g,(i,s)=>(i.length>1&&e.push(s),` -`)));let n=[],r=0;do{let i=new Al,s=new ho({src:t});r=i.parse(s,r),n.push(i)}while(r{if(e.length===0)return!1;for(let s=1;sn.join(`... -`),n}L0.parse=HR});var go=X(Pt=>{"use strict";var H=ms();function $R(t,e,n){return n?`#${n.replace(/[\s\S]^/gm,`$&${e}#`)} +`);let f=u-(c+this.indent),h=r.type===q.Type.SEQ_ITEM&&r.context.atLineStart;if(i[u]!=="#"&&!q.Node.nextNodeIsIndented(i[u],f,!h))break;this.atLineStart=!0,this.lineStart=c,a=!1,e=u}else if(o===q.Char.COMMENT){let u=q.Node.endOfLine(i,e+1);s.push(new q.Range(e,u)),e=u}else{let u=q.Node.endOfIdentifier(i,e+1);o===q.Char.TAG&&i[u]===","&&/^[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+,\d\d\d\d(-\d\d){0,2}\/\S/.test(i.slice(e+1,u+13))&&(u=q.Node.endOfIdentifier(i,u+5)),s.push(new q.Range(e,u)),a=!0,e=q.Node.endOfWhiteSpace(i,u)}o=i[e]}a&&o===":"&&q.Node.atBlank(i,e+1,!0)&&(e-=1);let l=ho.parseType(i,e,n);return{props:s,type:l,valueStart:e}}};function KR(t){let e=[];t.indexOf("\r")!==-1&&(t=t.replace(/\r\n?/g,(i,s)=>(i.length>1&&e.push(s),` +`)));let n=[],r=0;do{let i=new Sl,s=new ho({src:t});r=i.parse(s,r),n.push(i)}while(r{if(e.length===0)return!1;for(let s=1;sn.join(`... +`),n}F0.parse=KR});var go=X(Pt=>{"use strict";var H=ms();function zR(t,e,n){return n?`#${n.replace(/[\s\S]^/gm,`$&${e}#`)} ${e}${t}`:t}function mo(t,e,n){return n?n.indexOf(` `)===-1?`${t} #${n}`:`${t} -`+n.replace(/^/gm,`${e||""}#`):t}var Cr=class{};function _s(t,e,n){if(Array.isArray(t))return t.map((r,i)=>_s(r,String(i),n));if(t&&typeof t.toJSON=="function"){let r=n&&n.anchors&&n.anchors.get(t);r&&(n.onCreate=s=>{r.res=s,delete n.onCreate});let i=t.toJSON(e,n);return r&&n.onCreate&&n.onCreate(i),i}return(!n||!n.keep)&&typeof t=="bigint"?Number(t):t}var xn=class extends Cr{constructor(e){super();this.value=e}toJSON(e,n){return n&&n.keep?this.value:_s(this.value,e,n)}toString(){return String(this.value)}};function k0(t,e,n){let r=n;for(let i=e.length-1;i>=0;--i){let s=e[i];if(Number.isInteger(s)&&s>=0){let a=[];a[s]=r,r=a}else{let a={};Object.defineProperty(a,s,{value:r,writable:!0,enumerable:!0,configurable:!0}),r=a}}return t.createNode(r,!1)}var M0=t=>t==null||typeof t=="object"&&t[Symbol.iterator]().next().done,zt=class extends Cr{constructor(e){super();H._defineProperty(this,"items",[]),this.schema=e}addIn(e,n){if(M0(e))this.add(n);else{let[r,...i]=e,s=this.get(r,!0);if(s instanceof zt)s.addIn(i,n);else if(s===void 0&&this.schema)this.set(r,k0(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn([e,...n]){if(n.length===0)return this.delete(e);let r=this.get(e,!0);if(r instanceof zt)return r.deleteIn(n);throw new Error(`Expected YAML collection at ${e}. Remaining path: ${n}`)}getIn([e,...n],r){let i=this.get(e,!0);return n.length===0?!r&&i instanceof xn?i.value:i:i instanceof zt?i.getIn(n,r):void 0}hasAllNullValues(){return this.items.every(e=>{if(!e||e.type!=="PAIR")return!1;let n=e.value;return n==null||n instanceof xn&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn([e,...n]){if(n.length===0)return this.has(e);let r=this.get(e,!0);return r instanceof zt?r.hasIn(n):!1}setIn([e,...n],r){if(n.length===0)this.set(e,r);else{let i=this.get(e,!0);if(i instanceof zt)i.setIn(n,r);else if(i===void 0&&this.schema)this.set(e,k0(this.schema,n,r));else throw new Error(`Expected YAML collection at ${e}. Remaining path: ${n}`)}}toJSON(){return null}toString(e,{blockItem:n,flowChars:r,isMap:i,itemIndent:s},a,o){let{indent:l,indentStep:u,stringify:c}=e,f=this.type===H.Type.FLOW_MAP||this.type===H.Type.FLOW_SEQ||e.inFlow;f&&(s+=u);let h=i&&this.hasAllNullValues();e=Object.assign({},e,{allNullValues:h,indent:s,inFlow:f,type:null});let y=!1,p=!1,d=this.items.reduce((m,b,_)=>{let N;b&&(!y&&b.spaceBefore&&m.push({type:"comment",str:""}),b.commentBefore&&b.commentBefore.match(/^.*$/gm).forEach(G=>{m.push({type:"comment",str:`#${G}`})}),b.comment&&(N=b.comment),f&&(!y&&b.spaceBefore||b.commentBefore||b.comment||b.key&&(b.key.commentBefore||b.key.comment)||b.value&&(b.value.commentBefore||b.value.comment))&&(p=!0)),y=!1;let C=c(b,e,()=>N=null,()=>y=!0);return f&&!p&&C.includes(` +`+n.replace(/^/gm,`${e||""}#`):t}var Cr=class{};function _s(t,e,n){if(Array.isArray(t))return t.map((r,i)=>_s(r,String(i),n));if(t&&typeof t.toJSON=="function"){let r=n&&n.anchors&&n.anchors.get(t);r&&(n.onCreate=s=>{r.res=s,delete n.onCreate});let i=t.toJSON(e,n);return r&&n.onCreate&&n.onCreate(i),i}return(!n||!n.keep)&&typeof t=="bigint"?Number(t):t}var xn=class extends Cr{constructor(e){super();this.value=e}toJSON(e,n){return n&&n.keep?this.value:_s(this.value,e,n)}toString(){return String(this.value)}};function M0(t,e,n){let r=n;for(let i=e.length-1;i>=0;--i){let s=e[i];if(Number.isInteger(s)&&s>=0){let a=[];a[s]=r,r=a}else{let a={};Object.defineProperty(a,s,{value:r,writable:!0,enumerable:!0,configurable:!0}),r=a}}return t.createNode(r,!1)}var B0=t=>t==null||typeof t=="object"&&t[Symbol.iterator]().next().done,zt=class extends Cr{constructor(e){super();H._defineProperty(this,"items",[]),this.schema=e}addIn(e,n){if(B0(e))this.add(n);else{let[r,...i]=e,s=this.get(r,!0);if(s instanceof zt)s.addIn(i,n);else if(s===void 0&&this.schema)this.set(r,M0(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn([e,...n]){if(n.length===0)return this.delete(e);let r=this.get(e,!0);if(r instanceof zt)return r.deleteIn(n);throw new Error(`Expected YAML collection at ${e}. Remaining path: ${n}`)}getIn([e,...n],r){let i=this.get(e,!0);return n.length===0?!r&&i instanceof xn?i.value:i:i instanceof zt?i.getIn(n,r):void 0}hasAllNullValues(){return this.items.every(e=>{if(!e||e.type!=="PAIR")return!1;let n=e.value;return n==null||n instanceof xn&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn([e,...n]){if(n.length===0)return this.has(e);let r=this.get(e,!0);return r instanceof zt?r.hasIn(n):!1}setIn([e,...n],r){if(n.length===0)this.set(e,r);else{let i=this.get(e,!0);if(i instanceof zt)i.setIn(n,r);else if(i===void 0&&this.schema)this.set(e,M0(this.schema,n,r));else throw new Error(`Expected YAML collection at ${e}. Remaining path: ${n}`)}}toJSON(){return null}toString(e,{blockItem:n,flowChars:r,isMap:i,itemIndent:s},a,o){let{indent:l,indentStep:u,stringify:c}=e,f=this.type===H.Type.FLOW_MAP||this.type===H.Type.FLOW_SEQ||e.inFlow;f&&(s+=u);let h=i&&this.hasAllNullValues();e=Object.assign({},e,{allNullValues:h,indent:s,inFlow:f,type:null});let y=!1,p=!1,d=this.items.reduce((m,b,_)=>{let N;b&&(!y&&b.spaceBefore&&m.push({type:"comment",str:""}),b.commentBefore&&b.commentBefore.match(/^.*$/gm).forEach(G=>{m.push({type:"comment",str:`#${G}`})}),b.comment&&(N=b.comment),f&&(!y&&b.spaceBefore||b.commentBefore||b.comment||b.key&&(b.key.commentBefore||b.key.comment)||b.value&&(b.value.commentBefore||b.value.comment))&&(p=!0)),y=!1;let C=c(b,e,()=>N=null,()=>y=!0);return f&&!p&&C.includes(` `)&&(p=!0),f&&_N.str);if(p||_.reduce((N,C)=>N+C.length+2,2)>zt.maxFlowStringSingleLineLength){g=m;for(let N of _)g+=N?` ${u}${l}${N}`:` `;g+=` ${l}${b}`}else g=`${m} ${_.join(" ")} ${b}`}else{let m=d.map(n);g=m.shift();for(let b of m)g+=b?` ${l}${b}`:` `}return this.comment?(g+=` -`+this.comment.replace(/^/gm,`${l}#`),a&&a()):y&&o&&o(),g}};H._defineProperty(zt,"maxFlowStringSingleLineLength",60);function Bc(t){let e=t instanceof xn?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),Number.isInteger(e)&&e>=0?e:null}var zs=class extends zt{add(e){this.items.push(e)}delete(e){let n=Bc(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){let r=Bc(e);if(typeof r!="number")return;let i=this.items[r];return!n&&i instanceof xn?i.value:i}has(e){let n=Bc(e);return typeof n=="number"&&ni.type==="comment"?i.str:`- ${i.str}`,flowChars:{start:"[",end:"]"},isMap:!1,itemIndent:(e.indent||"")+" "},n,r):JSON.stringify(this)}},KR=(t,e,n)=>e===null?"":typeof e!="object"?String(e):t instanceof Cr&&n&&n.doc?t.toString({anchors:Object.create(null),doc:n.doc,indent:"",indentStep:n.indentStep,inFlow:!0,inStringifyKey:!0,stringify:n.stringify}):JSON.stringify(e),ut=class extends Cr{constructor(e,n=null){super();this.key=e,this.value=n,this.type=ut.Type.PAIR}get commentBefore(){return this.key instanceof Cr?this.key.commentBefore:void 0}set commentBefore(e){if(this.key==null&&(this.key=new xn(null)),this.key instanceof Cr)this.key.commentBefore=e;else{let n="Pair.commentBefore is an alias for Pair.key.commentBefore. To set it, the key must be a Node.";throw new Error(n)}}addToJSMap(e,n){let r=_s(this.key,"",e);if(n instanceof Map){let i=_s(this.value,r,e);n.set(r,i)}else if(n instanceof Set)n.add(r);else{let i=KR(this.key,r,e),s=_s(this.value,i,e);i in n?Object.defineProperty(n,i,{value:s,writable:!0,enumerable:!0,configurable:!0}):n[i]=s}return n}toJSON(e,n){let r=n&&n.mapAsMap?new Map:{};return this.addToJSMap(n,r)}toString(e,n,r){if(!e||!e.doc)return JSON.stringify(this);let{indent:i,indentSeq:s,simpleKeys:a}=e.doc.options,{key:o,value:l}=this,u=o instanceof Cr&&o.comment;if(a){if(u)throw new Error("With simple keys, key nodes cannot have comments");if(o instanceof zt){let C="With simple keys, collection cannot be used as a key value";throw new Error(C)}}let c=!a&&(!o||u||(o instanceof Cr?o instanceof zt||o.type===H.Type.BLOCK_FOLDED||o.type===H.Type.BLOCK_LITERAL:typeof o=="object")),{doc:f,indent:h,indentStep:y,stringify:p}=e;e=Object.assign({},e,{implicitKey:!c,indent:h+y});let d=!1,g=p(o,e,()=>u=null,()=>d=!0);if(g=mo(g,e.indent,u),!c&&g.length>1024){if(a)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");c=!0}if(e.allNullValues&&!a)return this.comment?(g=mo(g,e.indent,this.comment),n&&n()):d&&!u&&r&&r(),e.inFlow&&!c?g:`? ${g}`;g=c?`? ${g} +`+this.comment.replace(/^/gm,`${l}#`),a&&a()):y&&o&&o(),g}};H._defineProperty(zt,"maxFlowStringSingleLineLength",60);function Bc(t){let e=t instanceof xn?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),Number.isInteger(e)&&e>=0?e:null}var zs=class extends zt{add(e){this.items.push(e)}delete(e){let n=Bc(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){let r=Bc(e);if(typeof r!="number")return;let i=this.items[r];return!n&&i instanceof xn?i.value:i}has(e){let n=Bc(e);return typeof n=="number"&&ni.type==="comment"?i.str:`- ${i.str}`,flowChars:{start:"[",end:"]"},isMap:!1,itemIndent:(e.indent||"")+" "},n,r):JSON.stringify(this)}},XR=(t,e,n)=>e===null?"":typeof e!="object"?String(e):t instanceof Cr&&n&&n.doc?t.toString({anchors:Object.create(null),doc:n.doc,indent:"",indentStep:n.indentStep,inFlow:!0,inStringifyKey:!0,stringify:n.stringify}):JSON.stringify(e),ut=class extends Cr{constructor(e,n=null){super();this.key=e,this.value=n,this.type=ut.Type.PAIR}get commentBefore(){return this.key instanceof Cr?this.key.commentBefore:void 0}set commentBefore(e){if(this.key==null&&(this.key=new xn(null)),this.key instanceof Cr)this.key.commentBefore=e;else{let n="Pair.commentBefore is an alias for Pair.key.commentBefore. To set it, the key must be a Node.";throw new Error(n)}}addToJSMap(e,n){let r=_s(this.key,"",e);if(n instanceof Map){let i=_s(this.value,r,e);n.set(r,i)}else if(n instanceof Set)n.add(r);else{let i=XR(this.key,r,e),s=_s(this.value,i,e);i in n?Object.defineProperty(n,i,{value:s,writable:!0,enumerable:!0,configurable:!0}):n[i]=s}return n}toJSON(e,n){let r=n&&n.mapAsMap?new Map:{};return this.addToJSMap(n,r)}toString(e,n,r){if(!e||!e.doc)return JSON.stringify(this);let{indent:i,indentSeq:s,simpleKeys:a}=e.doc.options,{key:o,value:l}=this,u=o instanceof Cr&&o.comment;if(a){if(u)throw new Error("With simple keys, key nodes cannot have comments");if(o instanceof zt){let C="With simple keys, collection cannot be used as a key value";throw new Error(C)}}let c=!a&&(!o||u||(o instanceof Cr?o instanceof zt||o.type===H.Type.BLOCK_FOLDED||o.type===H.Type.BLOCK_LITERAL:typeof o=="object")),{doc:f,indent:h,indentStep:y,stringify:p}=e;e=Object.assign({},e,{implicitKey:!c,indent:h+y});let d=!1,g=p(o,e,()=>u=null,()=>d=!0);if(g=mo(g,e.indent,u),!c&&g.length>1024){if(a)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");c=!0}if(e.allNullValues&&!a)return this.comment?(g=mo(g,e.indent,this.comment),n&&n()):d&&!u&&r&&r(),e.inFlow&&!c?g:`? ${g}`;g=c?`? ${g} ${h}:`:`${g}:`,this.comment&&(g=mo(g,e.indent,this.comment),n&&n());let m="",b=null;l instanceof Cr?(l.spaceBefore&&(m=` `),l.commentBefore&&(m+=` ${l.commentBefore.replace(/^/gm,`${e.indent}#`)}`),b=l.comment):l&&typeof l=="object"&&(l=f.schema.createNode(l,!0)),e.implicitKey=!1,!c&&!this.comment&&l instanceof xn&&(e.indentAtStart=g.length+1),d=!1,!s&&i>=2&&!e.inFlow&&!c&&l instanceof zs&&l.type!==H.Type.FLOW_SEQ&&!l.tag&&!f.anchors.getName(l)&&(e.indent=e.indent.substr(2));let _=p(l,e,()=>b=null,()=>d=!0),N=" ";return m||this.comment?N=`${m} ${e.indent}`:!c&&l instanceof zt?(!(_[0]==="["||_[0]==="{")||_.includes(` `))&&(N=` ${e.indent}`):_[0]===` -`&&(N=""),d&&!b&&r&&r(),mo(g+N+_,e.indent,b)}};H._defineProperty(ut,"Type",{PAIR:"PAIR",MERGE_PAIR:"MERGE_PAIR"});var qc=(t,e)=>{if(t instanceof ys){let n=e.get(t.source);return n.count*n.aliasCount}else if(t instanceof zt){let n=0;for(let r of t.items){let i=qc(r,e);i>n&&(n=i)}return n}else if(t instanceof ut){let n=qc(t.key,e),r=qc(t.value,e);return Math.max(n,r)}return 1},ys=class extends Cr{static stringify({range:e,source:n},{anchors:r,doc:i,implicitKey:s,inStringifyKey:a}){let o=Object.keys(r).find(u=>r[u]===n);if(!o&&a&&(o=i.anchors.getName(n)||i.anchors.newName()),o)return`*${o}${s?" ":""}`;let l=i.anchors.getName(n)?"Alias node must be after source node":"Source node not found for alias node";throw new Error(`${l} [${e}]`)}constructor(e){super();this.source=e,this.type=H.Type.ALIAS}set tag(e){throw new Error("Alias nodes cannot have tags")}toJSON(e,n){if(!n)return _s(this.source,e,n);let{anchors:r,maxAliasCount:i}=n,s=r.get(this.source);if(!s||s.res===void 0){let a="This should not happen: Alias anchor was not resolved?";throw this.cstNode?new H.YAMLReferenceError(this.cstNode,a):new ReferenceError(a)}if(i>=0&&(s.count+=1,s.aliasCount===0&&(s.aliasCount=qc(this.source,r)),s.count*s.aliasCount>i)){let a="Excessive alias count indicates a resource exhaustion attack";throw this.cstNode?new H.YAMLReferenceError(this.cstNode,a):new ReferenceError(a)}return s.res}toString(e){return ys.stringify(this,e)}};H._defineProperty(ys,"default",!0);function Sl(t,e){let n=e instanceof xn?e.value:e;for(let r of t)if(r instanceof ut&&(r.key===e||r.key===n||r.key&&r.key.value===n))return r}var Vc=class extends zt{add(e,n){e?e instanceof ut||(e=new ut(e.key||e,e.value)):e=new ut(e);let r=Sl(this.items,e.key),i=this.schema&&this.schema.sortMapEntries;if(r)if(n)r.value=e.value;else throw new Error(`Key ${e.key} already set`);else if(i){let s=this.items.findIndex(a=>i(e,a)<0);s===-1?this.items.push(e):this.items.splice(s,0,e)}else this.items.push(e)}delete(e){let n=Sl(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){let r=Sl(this.items,e),i=r&&r.value;return!n&&i instanceof xn?i.value:i}has(e){return!!Sl(this.items,e)}set(e,n){this.add(new ut(e,n),!0)}toJSON(e,n,r){let i=r?new r:n&&n.mapAsMap?new Map:{};n&&n.onCreate&&n.onCreate(i);for(let s of this.items)s.addToJSMap(n,i);return i}toString(e,n,r){if(!e)return JSON.stringify(this);for(let i of this.items)if(!(i instanceof ut))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return super.toString(e,{blockItem:i=>i.str,flowChars:{start:"{",end:"}"},isMap:!0,itemIndent:e.indent||""},n,r)}},B0="<<",ch=class extends ut{constructor(e){if(e instanceof ut){let n=e.value;n instanceof zs||(n=new zs,n.items.push(e.value),n.range=e.value.range);super(e.key,n);this.range=e.range}else super(new xn(B0),new zs);this.type=ut.Type.MERGE_PAIR}addToJSMap(e,n){for(let{source:r}of this.value.items){if(!(r instanceof Vc))throw new Error("Merge sources must be maps");let i=r.toJSON(null,e,Map);for(let[s,a]of i)n instanceof Map?n.has(s)||n.set(s,a):n instanceof Set?n.add(s):Object.prototype.hasOwnProperty.call(n,s)||Object.defineProperty(n,s,{value:a,writable:!0,enumerable:!0,configurable:!0})}return n}toString(e,n){let r=this.value;if(r.items.length>1)return super.toString(e,n);this.value=r.items[0];let i=super.toString(e,n);return this.value=r,i}},zR={defaultType:H.Type.BLOCK_LITERAL,lineWidth:76},XR={trueStr:"true",falseStr:"false"},QR={asBigInt:!1},JR={nullStr:"null"},Xs={defaultType:H.Type.PLAIN,doubleQuoted:{jsonEncoding:!1,minMultiLineLength:40},fold:{lineWidth:80,minContentWidth:20}};function fh(t,e,n){for(let{format:r,test:i,resolve:s}of e)if(i){let a=t.match(i);if(a){let o=s.apply(null,a);return o instanceof xn||(o=new xn(o)),r&&(o.format=r),o}}return n&&(t=n(t)),new xn(t)}var q0="flow",ph="block",jc="quoted",V0=(t,e)=>{let n=t[e+1];for(;n===" "||n===" ";){do n=t[e+=1];while(n&&n!==` -`);n=t[e+1]}return e};function Uc(t,e,n,{indentAtStart:r,lineWidth:i=80,minContentWidth:s=20,onFold:a,onOverflow:o}){if(!i||i<0)return t;let l=Math.max(1+s,1+i-e.length);if(t.length<=l)return t;let u=[],c={},f=i-e.length;typeof r=="number"&&(r>i-Math.max(2,s)?u.push(0):f=i-r);let h,y,p=!1,d=-1,g=-1,m=-1;n===ph&&(d=V0(t,d),d!==-1&&(f=d+l));for(let _;_=t[d+=1];){if(n===jc&&_==="\\"){switch(g=d,t[d+1]){case"x":d+=3;break;case"u":d+=5;break;case"U":d+=9;break;default:d+=1}m=d}if(_===` -`)n===ph&&(d=V0(t,d)),f=d+l,h=void 0;else{if(_===" "&&y&&y!==" "&&y!==` +`&&(N=""),d&&!b&&r&&r(),mo(g+N+_,e.indent,b)}};H._defineProperty(ut,"Type",{PAIR:"PAIR",MERGE_PAIR:"MERGE_PAIR"});var qc=(t,e)=>{if(t instanceof ys){let n=e.get(t.source);return n.count*n.aliasCount}else if(t instanceof zt){let n=0;for(let r of t.items){let i=qc(r,e);i>n&&(n=i)}return n}else if(t instanceof ut){let n=qc(t.key,e),r=qc(t.value,e);return Math.max(n,r)}return 1},ys=class extends Cr{static stringify({range:e,source:n},{anchors:r,doc:i,implicitKey:s,inStringifyKey:a}){let o=Object.keys(r).find(u=>r[u]===n);if(!o&&a&&(o=i.anchors.getName(n)||i.anchors.newName()),o)return`*${o}${s?" ":""}`;let l=i.anchors.getName(n)?"Alias node must be after source node":"Source node not found for alias node";throw new Error(`${l} [${e}]`)}constructor(e){super();this.source=e,this.type=H.Type.ALIAS}set tag(e){throw new Error("Alias nodes cannot have tags")}toJSON(e,n){if(!n)return _s(this.source,e,n);let{anchors:r,maxAliasCount:i}=n,s=r.get(this.source);if(!s||s.res===void 0){let a="This should not happen: Alias anchor was not resolved?";throw this.cstNode?new H.YAMLReferenceError(this.cstNode,a):new ReferenceError(a)}if(i>=0&&(s.count+=1,s.aliasCount===0&&(s.aliasCount=qc(this.source,r)),s.count*s.aliasCount>i)){let a="Excessive alias count indicates a resource exhaustion attack";throw this.cstNode?new H.YAMLReferenceError(this.cstNode,a):new ReferenceError(a)}return s.res}toString(e){return ys.stringify(this,e)}};H._defineProperty(ys,"default",!0);function Al(t,e){let n=e instanceof xn?e.value:e;for(let r of t)if(r instanceof ut&&(r.key===e||r.key===n||r.key&&r.key.value===n))return r}var Vc=class extends zt{add(e,n){e?e instanceof ut||(e=new ut(e.key||e,e.value)):e=new ut(e);let r=Al(this.items,e.key),i=this.schema&&this.schema.sortMapEntries;if(r)if(n)r.value=e.value;else throw new Error(`Key ${e.key} already set`);else if(i){let s=this.items.findIndex(a=>i(e,a)<0);s===-1?this.items.push(e):this.items.splice(s,0,e)}else this.items.push(e)}delete(e){let n=Al(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){let r=Al(this.items,e),i=r&&r.value;return!n&&i instanceof xn?i.value:i}has(e){return!!Al(this.items,e)}set(e,n){this.add(new ut(e,n),!0)}toJSON(e,n,r){let i=r?new r:n&&n.mapAsMap?new Map:{};n&&n.onCreate&&n.onCreate(i);for(let s of this.items)s.addToJSMap(n,i);return i}toString(e,n,r){if(!e)return JSON.stringify(this);for(let i of this.items)if(!(i instanceof ut))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return super.toString(e,{blockItem:i=>i.str,flowChars:{start:"{",end:"}"},isMap:!0,itemIndent:e.indent||""},n,r)}},q0="<<",ch=class extends ut{constructor(e){if(e instanceof ut){let n=e.value;n instanceof zs||(n=new zs,n.items.push(e.value),n.range=e.value.range);super(e.key,n);this.range=e.range}else super(new xn(q0),new zs);this.type=ut.Type.MERGE_PAIR}addToJSMap(e,n){for(let{source:r}of this.value.items){if(!(r instanceof Vc))throw new Error("Merge sources must be maps");let i=r.toJSON(null,e,Map);for(let[s,a]of i)n instanceof Map?n.has(s)||n.set(s,a):n instanceof Set?n.add(s):Object.prototype.hasOwnProperty.call(n,s)||Object.defineProperty(n,s,{value:a,writable:!0,enumerable:!0,configurable:!0})}return n}toString(e,n){let r=this.value;if(r.items.length>1)return super.toString(e,n);this.value=r.items[0];let i=super.toString(e,n);return this.value=r,i}},QR={defaultType:H.Type.BLOCK_LITERAL,lineWidth:76},JR={trueStr:"true",falseStr:"false"},ZR={asBigInt:!1},ew={nullStr:"null"},Xs={defaultType:H.Type.PLAIN,doubleQuoted:{jsonEncoding:!1,minMultiLineLength:40},fold:{lineWidth:80,minContentWidth:20}};function fh(t,e,n){for(let{format:r,test:i,resolve:s}of e)if(i){let a=t.match(i);if(a){let o=s.apply(null,a);return o instanceof xn||(o=new xn(o)),r&&(o.format=r),o}}return n&&(t=n(t)),new xn(t)}var V0="flow",ph="block",jc="quoted",j0=(t,e)=>{let n=t[e+1];for(;n===" "||n===" ";){do n=t[e+=1];while(n&&n!==` +`);n=t[e+1]}return e};function Uc(t,e,n,{indentAtStart:r,lineWidth:i=80,minContentWidth:s=20,onFold:a,onOverflow:o}){if(!i||i<0)return t;let l=Math.max(1+s,1+i-e.length);if(t.length<=l)return t;let u=[],c={},f=i-e.length;typeof r=="number"&&(r>i-Math.max(2,s)?u.push(0):f=i-r);let h,y,p=!1,d=-1,g=-1,m=-1;n===ph&&(d=j0(t,d),d!==-1&&(f=d+l));for(let _;_=t[d+=1];){if(n===jc&&_==="\\"){switch(g=d,t[d+1]){case"x":d+=3;break;case"u":d+=5;break;case"U":d+=9;break;default:d+=1}m=d}if(_===` +`)n===ph&&(d=j0(t,d)),f=d+l,h=void 0;else{if(_===" "&&y&&y!==" "&&y!==` `&&y!==" "){let N=t[d+1];N&&N!==" "&&N!==` `&&N!==" "&&(h=d)}if(d>=f)if(h)u.push(h),f=h+l,h=void 0;else if(n===jc){for(;y===" "||y===" ";)y=_,_=t[d+=1],p=!0;let N=d>m+1?d-2:g-1;if(c[N])return t;u.push(N),c[N]=!0,f=N+l,h=void 0}else p=!0}y=_}if(p&&o&&o(),u.length===0)return t;a&&a();let b=t.slice(0,u[0]);for(let _=0;_t?Object.assign({indentAtStart:t},Xs.fold):Xs.fold,Wc=t=>/^(%|---|\.\.\.)/m.test(t);function ZR(t,e,n){if(!e||e<0)return!1;let r=e-n,i=t.length;if(i<=r)return!1;for(let s=0,a=0;st?Object.assign({indentAtStart:t},Xs.fold):Xs.fold,Wc=t=>/^(%|---|\.\.\.)/m.test(t);function tw(t,e,n){if(!e||e<0)return!1;let r=e-n,i=t.length;if(i<=r)return!1;for(let s=0,a=0;sr)return!0;if(a=s+1,i-a<=r)return!1}return!0}function Qs(t,e){let{implicitKey:n}=e,{jsonEncoding:r,minMultiLineLength:i}=Xs.doubleQuoted,s=JSON.stringify(t);if(r)return s;let a=e.indent||(Wc(t)?" ":""),o="",l=0;for(let u=0,c=s[u];c;c=s[++u])if(c===" "&&s[u+1]==="\\"&&s[u+2]==="n"&&(o+=s.slice(l,u)+"\\ ",u+=1,l=u,c="\\"),c==="\\")switch(s[u+1]){case"u":{o+=s.slice(l,u);let f=s.substr(u+2,4);switch(f){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:f.substr(0,2)==="00"?o+="\\x"+f.substr(2):o+=s.substr(u,6)}u+=5,l=u+1}break;case"n":if(n||s[u+2]==='"'||s.length";if(!n)return u+` +`,u+=2;o+=a,s[u+2]===" "&&(o+="\\"),u+=1,l=u+1}break;default:u+=1}return o=l?o+s.slice(l):s,n?o:Uc(o,a,jc,dh(e))}function U0(t,e){if(e.implicitKey){if(/\n/.test(t))return Qs(t,e)}else if(/[ \t]\n|\n[ \t]/.test(t))return Qs(t,e);let n=e.indent||(Wc(t)?" ":""),r="'"+t.replace(/'/g,"''").replace(/\n+/g,`$& +${n}`)+"'";return e.implicitKey?r:Uc(r,n,V0,dh(e))}function Gc({comment:t,type:e,value:n},r,i,s){if(/\n[\t ]+$/.test(n)||/^\s*$/.test(n))return Qs(n,r);let a=r.indent||(r.forceBlockIndent||Wc(n)?" ":""),o=a?"2":"1",l=e===H.Type.BLOCK_FOLDED?!1:e===H.Type.BLOCK_LITERAL?!0:!tw(n,Xs.fold.lineWidth,a.length),u=l?"|":">";if(!n)return u+` `;let c="",f="";if(n=n.replace(/[\n\t ]*$/,y=>{let p=y.indexOf(` `);return p===-1?u+="-":(n===y||p!==y.length-1)&&(u+="+",s&&s()),f=y.replace(/\n$/,""),""}).replace(/^[\n ]*/,y=>{y.indexOf(" ")!==-1&&(u+=o);let p=y.match(/ +$/);return p?(c=y.slice(0,-p[0].length),p[0]):(c=y,"")}),f&&(f=f.replace(/\n+(?!\n|$)/g,`$&${a}`)),c&&(c=c.replace(/\n+/g,`$&${a}`)),t&&(u+=" #"+t.replace(/ ?[\r\n]+/g," "),i&&i()),!n)return`${u}${o} ${a}${f}`;if(l)return n=n.replace(/\n+/g,`$&${a}`),`${u} ${a}${c}${n}${f}`;n=n.replace(/\n+/g,` $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${a}`);let h=Uc(`${c}${n}${f}`,a,ph,Xs.fold);return`${u} -${a}${h}`}function ew(t,e,n,r){let{comment:i,type:s,value:a}=t,{actualString:o,implicitKey:l,indent:u,inFlow:c}=e;if(l&&/[\n[\]{},]/.test(a)||c&&/[[\]{},]/.test(a))return Qs(a,e);if(!a||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return l||c||a.indexOf(` -`)===-1?a.indexOf('"')!==-1&&a.indexOf("'")===-1?j0(a,e):Qs(a,e):Gc(t,e,n,r);if(!l&&!c&&s!==H.Type.PLAIN&&a.indexOf(` +${a}${h}`}function nw(t,e,n,r){let{comment:i,type:s,value:a}=t,{actualString:o,implicitKey:l,indent:u,inFlow:c}=e;if(l&&/[\n[\]{},]/.test(a)||c&&/[[\]{},]/.test(a))return Qs(a,e);if(!a||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return l||c||a.indexOf(` +`)===-1?a.indexOf('"')!==-1&&a.indexOf("'")===-1?U0(a,e):Qs(a,e):Gc(t,e,n,r);if(!l&&!c&&s!==H.Type.PLAIN&&a.indexOf(` `)!==-1)return Gc(t,e,n,r);if(u===""&&Wc(a))return e.forceBlockIndent=!0,Gc(t,e,n,r);let f=a.replace(/\n+/g,`$& -${u}`);if(o){let{tags:y}=e.doc.schema;if(typeof fh(f,y,y.scalarFallback).value!="string")return Qs(a,e)}let h=l?f:Uc(f,u,q0,dh(e));return i&&!c&&(h.indexOf(` +${u}`);if(o){let{tags:y}=e.doc.schema;if(typeof fh(f,y,y.scalarFallback).value!="string")return Qs(a,e)}let h=l?f:Uc(f,u,V0,dh(e));return i&&!c&&(h.indexOf(` `)!==-1||i.indexOf(` -`)!==-1)?(n&&n(),$R(h,u,i)):h}function tw(t,e,n,r){let{defaultType:i}=Xs,{implicitKey:s,inFlow:a}=e,{type:o,value:l}=t;typeof l!="string"&&(l=String(l),t=Object.assign({},t,{value:l}));let u=f=>{switch(f){case H.Type.BLOCK_FOLDED:case H.Type.BLOCK_LITERAL:return Gc(t,e,n,r);case H.Type.QUOTE_DOUBLE:return Qs(l,e);case H.Type.QUOTE_SINGLE:return j0(l,e);case H.Type.PLAIN:return ew(t,e,n,r);default:return null}};(o!==H.Type.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f]/.test(l)||(s||a)&&(o===H.Type.BLOCK_FOLDED||o===H.Type.BLOCK_LITERAL))&&(o=H.Type.QUOTE_DOUBLE);let c=u(o);if(c===null&&(c=u(i),c===null))throw new Error(`Unsupported default string type ${i}`);return c}function nw({format:t,minFractionDigits:e,tag:n,value:r}){if(typeof r=="bigint")return String(r);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let i=JSON.stringify(r);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(i)){let s=i.indexOf(".");s<0&&(s=i.length,i+=".");let a=e-(i.length-s-1);for(;a-- >0;)i+="0"}return i}function U0(t,e){let n,r;switch(e.type){case H.Type.FLOW_MAP:n="}",r="flow map";break;case H.Type.FLOW_SEQ:n="]",r="flow sequence";break;default:t.push(new H.YAMLSemanticError(e,"Not a flow collection!?"));return}let i;for(let s=e.items.length-1;s>=0;--s){let a=e.items[s];if(!a||a.type!==H.Type.COMMENT){i=a;break}}if(i&&i.char!==n){let s=`Expected ${r} to end with ${n}`,a;typeof i.offset=="number"?(a=new H.YAMLSemanticError(e,s),a.offset=i.offset+1):(a=new H.YAMLSemanticError(i,s),i.range&&i.range.end&&(a.offset=i.range.end-i.range.start)),t.push(a)}}function W0(t,e){let n=e.context.src[e.range.start-1];if(n!==` -`&&n!==" "&&n!==" "){let r="Comments must be separated from other tokens by white space characters";t.push(new H.YAMLSemanticError(e,r))}}function G0(t,e){let n=String(e),r=n.substr(0,8)+"..."+n.substr(-8);return new H.YAMLSemanticError(t,`The "${r}" key is too long`)}function Y0(t,e){for(let{afterKey:n,before:r,comment:i}of e){let s=t.items[r];s?(n&&s.value&&(s=s.value),i===void 0?(n||!s.commentBefore)&&(s.spaceBefore=!0):s.commentBefore?s.commentBefore+=` +`)!==-1)?(n&&n(),zR(h,u,i)):h}function rw(t,e,n,r){let{defaultType:i}=Xs,{implicitKey:s,inFlow:a}=e,{type:o,value:l}=t;typeof l!="string"&&(l=String(l),t=Object.assign({},t,{value:l}));let u=f=>{switch(f){case H.Type.BLOCK_FOLDED:case H.Type.BLOCK_LITERAL:return Gc(t,e,n,r);case H.Type.QUOTE_DOUBLE:return Qs(l,e);case H.Type.QUOTE_SINGLE:return U0(l,e);case H.Type.PLAIN:return nw(t,e,n,r);default:return null}};(o!==H.Type.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f]/.test(l)||(s||a)&&(o===H.Type.BLOCK_FOLDED||o===H.Type.BLOCK_LITERAL))&&(o=H.Type.QUOTE_DOUBLE);let c=u(o);if(c===null&&(c=u(i),c===null))throw new Error(`Unsupported default string type ${i}`);return c}function iw({format:t,minFractionDigits:e,tag:n,value:r}){if(typeof r=="bigint")return String(r);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let i=JSON.stringify(r);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(i)){let s=i.indexOf(".");s<0&&(s=i.length,i+=".");let a=e-(i.length-s-1);for(;a-- >0;)i+="0"}return i}function W0(t,e){let n,r;switch(e.type){case H.Type.FLOW_MAP:n="}",r="flow map";break;case H.Type.FLOW_SEQ:n="]",r="flow sequence";break;default:t.push(new H.YAMLSemanticError(e,"Not a flow collection!?"));return}let i;for(let s=e.items.length-1;s>=0;--s){let a=e.items[s];if(!a||a.type!==H.Type.COMMENT){i=a;break}}if(i&&i.char!==n){let s=`Expected ${r} to end with ${n}`,a;typeof i.offset=="number"?(a=new H.YAMLSemanticError(e,s),a.offset=i.offset+1):(a=new H.YAMLSemanticError(i,s),i.range&&i.range.end&&(a.offset=i.range.end-i.range.start)),t.push(a)}}function G0(t,e){let n=e.context.src[e.range.start-1];if(n!==` +`&&n!==" "&&n!==" "){let r="Comments must be separated from other tokens by white space characters";t.push(new H.YAMLSemanticError(e,r))}}function Y0(t,e){let n=String(e),r=n.substr(0,8)+"..."+n.substr(-8);return new H.YAMLSemanticError(t,`The "${r}" key is too long`)}function H0(t,e){for(let{afterKey:n,before:r,comment:i}of e){let s=t.items[r];s?(n&&s.value&&(s=s.value),i===void 0?(n||!s.commentBefore)&&(s.spaceBefore=!0):s.commentBefore?s.commentBefore+=` `+i:s.commentBefore=i):i!==void 0&&(t.comment?t.comment+=` -`+i:t.comment=i)}}function hh(t,e){let n=e.strValue;return n?typeof n=="string"?n:(n.errors.forEach(r=>{r.source||(r.source=e),t.errors.push(r)}),n.str):""}function rw(t,e){let{handle:n,suffix:r}=e.tag,i=t.tagPrefixes.find(s=>s.handle===n);if(!i){let s=t.getDefaults().tagPrefixes;if(s&&(i=s.find(a=>a.handle===n)),!i)throw new H.YAMLSemanticError(e,`The ${n} tag handle is non-default and was not declared.`)}if(!r)throw new H.YAMLSemanticError(e,`The ${n} tag has no suffix.`);if(n==="!"&&(t.version||t.options.version)==="1.0"){if(r[0]==="^")return t.warnings.push(new H.YAMLWarning(e,"YAML 1.0 ^ tag expansion is not supported")),r;if(/[:/]/.test(r)){let s=r.match(/^([a-z0-9-]+)\/(.*)/i);return s?`tag:${s[1]}.yaml.org,2002:${s[2]}`:`tag:${r}`}}return i.prefix+decodeURIComponent(r)}function iw(t,e){let{tag:n,type:r}=e,i=!1;if(n){let{handle:s,suffix:a,verbatim:o}=n;if(o){if(o!=="!"&&o!=="!!")return o;let l=`Verbatim tags aren't resolved, so ${o} is invalid.`;t.errors.push(new H.YAMLSemanticError(e,l))}else if(s==="!"&&!a)i=!0;else try{return rw(t,e)}catch(l){t.errors.push(l)}}switch(r){case H.Type.BLOCK_FOLDED:case H.Type.BLOCK_LITERAL:case H.Type.QUOTE_DOUBLE:case H.Type.QUOTE_SINGLE:return H.defaultTags.STR;case H.Type.FLOW_MAP:case H.Type.MAP:return H.defaultTags.MAP;case H.Type.FLOW_SEQ:case H.Type.SEQ:return H.defaultTags.SEQ;case H.Type.PLAIN:return i?H.defaultTags.STR:null;default:return null}}function H0(t,e,n){let{tags:r}=t.schema,i=[];for(let a of r)if(a.tag===n)if(a.test)i.push(a);else{let o=a.resolve(t,e);return o instanceof zt?o:new xn(o)}let s=hh(t,e);return typeof s=="string"&&i.length>0?fh(s,i,r.scalarFallback):null}function sw({type:t}){switch(t){case H.Type.FLOW_MAP:case H.Type.MAP:return H.defaultTags.MAP;case H.Type.FLOW_SEQ:case H.Type.SEQ:return H.defaultTags.SEQ;default:return H.defaultTags.STR}}function aw(t,e,n){try{let r=H0(t,e,n);if(r)return n&&e.tag&&(r.tag=n),r}catch(r){return r.source||(r.source=e),t.errors.push(r),null}try{let r=sw(e);if(!r)throw new Error(`The tag ${n} is unavailable`);let i=`The tag ${n} is unavailable, falling back to ${r}`;t.warnings.push(new H.YAMLWarning(e,i));let s=H0(t,e,r);return s.tag=n,s}catch(r){let i=new H.YAMLReferenceError(e,r.message);return i.stack=r.stack,t.errors.push(i),null}}var ow=t=>{if(!t)return!1;let{type:e}=t;return e===H.Type.MAP_KEY||e===H.Type.MAP_VALUE||e===H.Type.SEQ_ITEM};function lw(t,e){let n={before:[],after:[]},r=!1,i=!1,s=ow(e.context.parent)?e.context.parent.props.concat(e.props):e.props;for(let{start:a,end:o}of s)switch(e.context.src[a]){case H.Char.COMMENT:{if(!e.commentHasRequiredWhitespace(a)){let f="Comments must be separated from other tokens by white space characters";t.push(new H.YAMLSemanticError(e,f))}let{header:l,valueRange:u}=e;(u&&(a>u.start||l&&a>l.start)?n.after:n.before).push(e.context.src.slice(a+1,o));break}case H.Char.ANCHOR:if(r){let l="A node can have at most one anchor";t.push(new H.YAMLSemanticError(e,l))}r=!0;break;case H.Char.TAG:if(i){let l="A node can have at most one tag";t.push(new H.YAMLSemanticError(e,l))}i=!0;break}return{comments:n,hasAnchor:r,hasTag:i}}function uw(t,e){let{anchors:n,errors:r,schema:i}=t;if(e.type===H.Type.ALIAS){let a=e.rawValue,o=n.getNode(a);if(!o){let u=`Aliased anchor not found: ${a}`;return r.push(new H.YAMLReferenceError(e,u)),null}let l=new ys(o);return n._cstAliases.push(l),l}let s=iw(t,e);if(s)return aw(t,e,s);if(e.type!==H.Type.PLAIN){let a=`Failed to resolve ${e.type} node here`;return r.push(new H.YAMLSyntaxError(e,a)),null}try{let a=hh(t,e);return fh(a,i.tags,i.tags.scalarFallback)}catch(a){return a.source||(a.source=e),r.push(a),null}}function bs(t,e){if(!e)return null;e.error&&t.errors.push(e.error);let{comments:n,hasAnchor:r,hasTag:i}=lw(t.errors,e);if(r){let{anchors:a}=t,o=e.anchor,l=a.getNode(o);l&&(a.map[a.newName(o)]=l),a.map[o]=e}if(e.type===H.Type.ALIAS&&(r||i)){let a="An alias node must not specify any properties";t.errors.push(new H.YAMLSemanticError(e,a))}let s=uw(t,e);if(s){s.range=[e.range.start,e.range.end],t.options.keepCstNodes&&(s.cstNode=e),t.options.keepNodeTypes&&(s.type=e.type);let a=n.before.join(` +`+i:t.comment=i)}}function hh(t,e){let n=e.strValue;return n?typeof n=="string"?n:(n.errors.forEach(r=>{r.source||(r.source=e),t.errors.push(r)}),n.str):""}function sw(t,e){let{handle:n,suffix:r}=e.tag,i=t.tagPrefixes.find(s=>s.handle===n);if(!i){let s=t.getDefaults().tagPrefixes;if(s&&(i=s.find(a=>a.handle===n)),!i)throw new H.YAMLSemanticError(e,`The ${n} tag handle is non-default and was not declared.`)}if(!r)throw new H.YAMLSemanticError(e,`The ${n} tag has no suffix.`);if(n==="!"&&(t.version||t.options.version)==="1.0"){if(r[0]==="^")return t.warnings.push(new H.YAMLWarning(e,"YAML 1.0 ^ tag expansion is not supported")),r;if(/[:/]/.test(r)){let s=r.match(/^([a-z0-9-]+)\/(.*)/i);return s?`tag:${s[1]}.yaml.org,2002:${s[2]}`:`tag:${r}`}}return i.prefix+decodeURIComponent(r)}function aw(t,e){let{tag:n,type:r}=e,i=!1;if(n){let{handle:s,suffix:a,verbatim:o}=n;if(o){if(o!=="!"&&o!=="!!")return o;let l=`Verbatim tags aren't resolved, so ${o} is invalid.`;t.errors.push(new H.YAMLSemanticError(e,l))}else if(s==="!"&&!a)i=!0;else try{return sw(t,e)}catch(l){t.errors.push(l)}}switch(r){case H.Type.BLOCK_FOLDED:case H.Type.BLOCK_LITERAL:case H.Type.QUOTE_DOUBLE:case H.Type.QUOTE_SINGLE:return H.defaultTags.STR;case H.Type.FLOW_MAP:case H.Type.MAP:return H.defaultTags.MAP;case H.Type.FLOW_SEQ:case H.Type.SEQ:return H.defaultTags.SEQ;case H.Type.PLAIN:return i?H.defaultTags.STR:null;default:return null}}function $0(t,e,n){let{tags:r}=t.schema,i=[];for(let a of r)if(a.tag===n)if(a.test)i.push(a);else{let o=a.resolve(t,e);return o instanceof zt?o:new xn(o)}let s=hh(t,e);return typeof s=="string"&&i.length>0?fh(s,i,r.scalarFallback):null}function ow({type:t}){switch(t){case H.Type.FLOW_MAP:case H.Type.MAP:return H.defaultTags.MAP;case H.Type.FLOW_SEQ:case H.Type.SEQ:return H.defaultTags.SEQ;default:return H.defaultTags.STR}}function lw(t,e,n){try{let r=$0(t,e,n);if(r)return n&&e.tag&&(r.tag=n),r}catch(r){return r.source||(r.source=e),t.errors.push(r),null}try{let r=ow(e);if(!r)throw new Error(`The tag ${n} is unavailable`);let i=`The tag ${n} is unavailable, falling back to ${r}`;t.warnings.push(new H.YAMLWarning(e,i));let s=$0(t,e,r);return s.tag=n,s}catch(r){let i=new H.YAMLReferenceError(e,r.message);return i.stack=r.stack,t.errors.push(i),null}}var uw=t=>{if(!t)return!1;let{type:e}=t;return e===H.Type.MAP_KEY||e===H.Type.MAP_VALUE||e===H.Type.SEQ_ITEM};function cw(t,e){let n={before:[],after:[]},r=!1,i=!1,s=uw(e.context.parent)?e.context.parent.props.concat(e.props):e.props;for(let{start:a,end:o}of s)switch(e.context.src[a]){case H.Char.COMMENT:{if(!e.commentHasRequiredWhitespace(a)){let f="Comments must be separated from other tokens by white space characters";t.push(new H.YAMLSemanticError(e,f))}let{header:l,valueRange:u}=e;(u&&(a>u.start||l&&a>l.start)?n.after:n.before).push(e.context.src.slice(a+1,o));break}case H.Char.ANCHOR:if(r){let l="A node can have at most one anchor";t.push(new H.YAMLSemanticError(e,l))}r=!0;break;case H.Char.TAG:if(i){let l="A node can have at most one tag";t.push(new H.YAMLSemanticError(e,l))}i=!0;break}return{comments:n,hasAnchor:r,hasTag:i}}function fw(t,e){let{anchors:n,errors:r,schema:i}=t;if(e.type===H.Type.ALIAS){let a=e.rawValue,o=n.getNode(a);if(!o){let u=`Aliased anchor not found: ${a}`;return r.push(new H.YAMLReferenceError(e,u)),null}let l=new ys(o);return n._cstAliases.push(l),l}let s=aw(t,e);if(s)return lw(t,e,s);if(e.type!==H.Type.PLAIN){let a=`Failed to resolve ${e.type} node here`;return r.push(new H.YAMLSyntaxError(e,a)),null}try{let a=hh(t,e);return fh(a,i.tags,i.tags.scalarFallback)}catch(a){return a.source||(a.source=e),r.push(a),null}}function bs(t,e){if(!e)return null;e.error&&t.errors.push(e.error);let{comments:n,hasAnchor:r,hasTag:i}=cw(t.errors,e);if(r){let{anchors:a}=t,o=e.anchor,l=a.getNode(o);l&&(a.map[a.newName(o)]=l),a.map[o]=e}if(e.type===H.Type.ALIAS&&(r||i)){let a="An alias node must not specify any properties";t.errors.push(new H.YAMLSemanticError(e,a))}let s=fw(t,e);if(s){s.range=[e.range.start,e.range.end],t.options.keepCstNodes&&(s.cstNode=e),t.options.keepNodeTypes&&(s.type=e.type);let a=n.before.join(` `);a&&(s.commentBefore=s.commentBefore?`${s.commentBefore} ${a}`:a);let o=n.after.join(` `);o&&(s.comment=s.comment?`${s.comment} -${o}`:o)}return e.resolved=s}function cw(t,e){if(e.type!==H.Type.MAP&&e.type!==H.Type.FLOW_MAP){let a=`A ${e.type} node cannot be resolved as a mapping`;return t.errors.push(new H.YAMLSyntaxError(e,a)),null}let{comments:n,items:r}=e.type===H.Type.FLOW_MAP?hw(t,e):dw(t,e),i=new Vc;i.items=r,Y0(i,n);let s=!1;for(let a=0;a{if(c instanceof ys){let{type:f}=c.source;return f===H.Type.MAP||f===H.Type.FLOW_MAP?!1:u="Merge nodes aliases can only point to maps"}return u="Merge nodes can only have Alias nodes as values"}),u&&t.errors.push(new H.YAMLSemanticError(e,u))}else for(let l=a+1;l{if(r.length===0)return!1;let{start:i}=r[0];if(e&&i>e.valueRange.start||n[i]!==H.Char.COMMENT)return!1;for(let s=t;s0){l=new H.PlainValue(H.Type.PLAIN,[]),l.context={parent:o,src:o.context.src};let c=o.range.start+1;if(l.range={start:c,end:c},l.valueRange={start:c,end:c},typeof o.range.origStart=="number"){let f=o.range.origStart+1;l.range.origStart=l.range.origEnd=f,l.valueRange.origStart=l.valueRange.origEnd=f}}let u=new ut(i,bs(t,l));pw(o,u),r.push(u),i&&typeof s=="number"&&o.range.start>s+1024&&t.errors.push(G0(e,i)),i=void 0,s=null}break;default:i!==void 0&&r.push(new ut(i)),i=bs(t,o),s=o.range.start,o.error&&t.errors.push(o.error);e:for(let l=a+1;;++l){let u=e.items[l];switch(u&&u.type){case H.Type.BLANK_LINE:case H.Type.COMMENT:continue e;case H.Type.MAP_VALUE:break e;default:{let c="Implicit map keys need to be followed by map values";t.errors.push(new H.YAMLSemanticError(o,c));break e}}}if(o.valueRangeContainsNewline){let l="Implicit map keys need to be on a single line";t.errors.push(new H.YAMLSemanticError(o,l))}}}return i!==void 0&&r.push(new ut(i)),{comments:n,items:r}}function hw(t,e){let n=[],r=[],i,s=!1,a="{";for(let o=0;os instanceof ut&&s.key instanceof zt)){let s="Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.";t.warnings.push(new H.YAMLWarning(e,s))}return e.resolved=i,i}function gw(t,e){let n=[],r=[];for(let i=0;ia+1024&&t.errors.push(G0(e,s));let{src:p}=l.context;for(let d=a;d{"use strict";var ir=ms(),Ke=go(),yw={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve:(t,e)=>{let n=Ke.resolveString(t,e);if(typeof Buffer=="function")return Buffer.from(n,"base64");if(typeof atob=="function"){let r=atob(n.replace(/[\n\r]/g,"")),i=new Uint8Array(r.length);for(let s=0;s{let a;if(typeof Buffer=="function")a=n instanceof Buffer?n.toString("base64"):Buffer.from(n.buffer).toString("base64");else if(typeof btoa=="function"){let o="";for(let l=0;l1){let a="Each pair must have its own sequence indicator";throw new ir.YAMLSemanticError(e,a)}let s=i.items[0]||new Ke.Pair;i.commentBefore&&(s.commentBefore=s.commentBefore?`${i.commentBefore} +${o}`:o)}return e.resolved=s}function pw(t,e){if(e.type!==H.Type.MAP&&e.type!==H.Type.FLOW_MAP){let a=`A ${e.type} node cannot be resolved as a mapping`;return t.errors.push(new H.YAMLSyntaxError(e,a)),null}let{comments:n,items:r}=e.type===H.Type.FLOW_MAP?gw(t,e):mw(t,e),i=new Vc;i.items=r,H0(i,n);let s=!1;for(let a=0;a{if(c instanceof ys){let{type:f}=c.source;return f===H.Type.MAP||f===H.Type.FLOW_MAP?!1:u="Merge nodes aliases can only point to maps"}return u="Merge nodes can only have Alias nodes as values"}),u&&t.errors.push(new H.YAMLSemanticError(e,u))}else for(let l=a+1;l{if(r.length===0)return!1;let{start:i}=r[0];if(e&&i>e.valueRange.start||n[i]!==H.Char.COMMENT)return!1;for(let s=t;s0){l=new H.PlainValue(H.Type.PLAIN,[]),l.context={parent:o,src:o.context.src};let c=o.range.start+1;if(l.range={start:c,end:c},l.valueRange={start:c,end:c},typeof o.range.origStart=="number"){let f=o.range.origStart+1;l.range.origStart=l.range.origEnd=f,l.valueRange.origStart=l.valueRange.origEnd=f}}let u=new ut(i,bs(t,l));hw(o,u),r.push(u),i&&typeof s=="number"&&o.range.start>s+1024&&t.errors.push(Y0(e,i)),i=void 0,s=null}break;default:i!==void 0&&r.push(new ut(i)),i=bs(t,o),s=o.range.start,o.error&&t.errors.push(o.error);e:for(let l=a+1;;++l){let u=e.items[l];switch(u&&u.type){case H.Type.BLANK_LINE:case H.Type.COMMENT:continue e;case H.Type.MAP_VALUE:break e;default:{let c="Implicit map keys need to be followed by map values";t.errors.push(new H.YAMLSemanticError(o,c));break e}}}if(o.valueRangeContainsNewline){let l="Implicit map keys need to be on a single line";t.errors.push(new H.YAMLSemanticError(o,l))}}}return i!==void 0&&r.push(new ut(i)),{comments:n,items:r}}function gw(t,e){let n=[],r=[],i,s=!1,a="{";for(let o=0;os instanceof ut&&s.key instanceof zt)){let s="Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.";t.warnings.push(new H.YAMLWarning(e,s))}return e.resolved=i,i}function yw(t,e){let n=[],r=[];for(let i=0;ia+1024&&t.errors.push(Y0(e,s));let{src:p}=l.context;for(let d=a;d{"use strict";var ir=ms(),Ke=go(),Tw={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve:(t,e)=>{let n=Ke.resolveString(t,e);if(typeof Buffer=="function")return Buffer.from(n,"base64");if(typeof atob=="function"){let r=atob(n.replace(/[\n\r]/g,"")),i=new Uint8Array(r.length);for(let s=0;s{let a;if(typeof Buffer=="function")a=n instanceof Buffer?n.toString("base64"):Buffer.from(n.buffer).toString("base64");else if(typeof btoa=="function"){let o="";for(let l=0;l1){let a="Each pair must have its own sequence indicator";throw new ir.YAMLSemanticError(e,a)}let s=i.items[0]||new Ke.Pair;i.commentBefore&&(s.commentBefore=s.commentBefore?`${i.commentBefore} ${s.commentBefore}`:i.commentBefore),i.comment&&(s.comment=s.comment?`${i.comment} -${s.comment}`:i.comment),i=s}n.items[r]=i instanceof Ke.Pair?i:new Ke.Pair(i)}}return n}function K0(t,e,n){let r=new Ke.YAMLSeq(t);r.tag="tag:yaml.org,2002:pairs";for(let i of e){let s,a;if(Array.isArray(i))if(i.length===2)s=i[0],a=i[1];else throw new TypeError(`Expected [key, value] tuple: ${i}`);else if(i&&i instanceof Object){let l=Object.keys(i);if(l.length===1)s=l[0],a=i[s];else throw new TypeError(`Expected { key: value } tuple: ${i}`)}else s=i;let o=t.createPair(s,a,n);r.items.push(o)}return r}var bw={default:!1,tag:"tag:yaml.org,2002:pairs",resolve:$0,createNode:K0},Js=class extends Ke.YAMLSeq{constructor(){super();ir._defineProperty(this,"add",Ke.YAMLMap.prototype.add.bind(this)),ir._defineProperty(this,"delete",Ke.YAMLMap.prototype.delete.bind(this)),ir._defineProperty(this,"get",Ke.YAMLMap.prototype.get.bind(this)),ir._defineProperty(this,"has",Ke.YAMLMap.prototype.has.bind(this)),ir._defineProperty(this,"set",Ke.YAMLMap.prototype.set.bind(this)),this.tag=Js.tag}toJSON(e,n){let r=new Map;n&&n.onCreate&&n.onCreate(r);for(let i of this.items){let s,a;if(i instanceof Ke.Pair?(s=Ke.toJSON(i.key,"",n),a=Ke.toJSON(i.value,s,n)):s=Ke.toJSON(i,"",n),r.has(s))throw new Error("Ordered maps must not include duplicate keys");r.set(s,a)}return r}};ir._defineProperty(Js,"tag","tag:yaml.org,2002:omap");function Tw(t,e){let n=$0(t,e),r=[];for(let{key:i}of n.items)if(i instanceof Ke.Scalar)if(r.includes(i.value)){let s="Ordered maps must not include duplicate keys";throw new ir.YAMLSemanticError(e,s)}else r.push(i.value);return Object.assign(new Js,n)}function vw(t,e,n){let r=K0(t,e,n),i=new Js;return i.items=r.items,i}var Nw={identify:t=>t instanceof Map,nodeClass:Js,default:!1,tag:"tag:yaml.org,2002:omap",resolve:Tw,createNode:vw},Zs=class extends Ke.YAMLMap{constructor(){super();this.tag=Zs.tag}add(e){let n=e instanceof Ke.Pair?e:new Ke.Pair(e);Ke.findPair(this.items,n.key)||this.items.push(n)}get(e,n){let r=Ke.findPair(this.items,e);return!n&&r instanceof Ke.Pair?r.key instanceof Ke.Scalar?r.key.value:r.key:r}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let r=Ke.findPair(this.items,e);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Ke.Pair(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues())return super.toString(e,n,r);throw new Error("Set items must all have null values")}};ir._defineProperty(Zs,"tag","tag:yaml.org,2002:set");function Cw(t,e){let n=Ke.resolveMap(t,e);if(!n.hasAllNullValues())throw new ir.YAMLSemanticError(e,"Set items must all have null values");return Object.assign(new Zs,n)}function Pw(t,e,n){let r=new Zs;for(let i of e)r.items.push(t.createPair(i,null,n));return r}var Aw={identify:t=>t instanceof Set,nodeClass:Zs,default:!1,tag:"tag:yaml.org,2002:set",resolve:Cw,createNode:Pw},mh=(t,e)=>{let n=e.split(":").reduce((r,i)=>r*60+Number(i),0);return t==="-"?-n:n},z0=({value:t})=>{if(isNaN(t)||!isFinite(t))return Ke.stringifyNumber(t);let e="";t<0&&(e="-",t=Math.abs(t));let n=[t%60];return t<60?n.unshift(0):(t=Math.round((t-n[0])/60),n.unshift(t%60),t>=60&&(t=Math.round((t-n[0])/60),n.unshift(t))),e+n.map(r=>r<10?"0"+String(r):String(r)).join(":").replace(/000000\d*$/,"")},Sw={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+)$/,resolve:(t,e,n)=>mh(e,n.replace(/_/g,"")),stringify:z0},Ew={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*)$/,resolve:(t,e,n)=>mh(e,n.replace(/_/g,"")),stringify:z0},Iw={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^(?:([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?)$"),resolve:(t,e,n,r,i,s,a,o,l)=>{o&&(o=(o+"00").substr(1,3));let u=Date.UTC(e,n-1,r,i||0,s||0,a||0,o||0);if(l&&l!=="Z"){let c=mh(l[0],l.slice(1));Math.abs(c)<30&&(c*=60),u-=6e4*c}return new Date(u)},stringify:({value:t})=>t.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")};function gh(t){let e=typeof process!="undefined"&&process.env||{};return t?typeof YAML_SILENCE_DEPRECATION_WARNINGS!="undefined"?!YAML_SILENCE_DEPRECATION_WARNINGS:!e.YAML_SILENCE_DEPRECATION_WARNINGS:typeof YAML_SILENCE_WARNINGS!="undefined"?!YAML_SILENCE_WARNINGS:!e.YAML_SILENCE_WARNINGS}function _h(t,e){if(gh(!1)){let n=typeof process!="undefined"&&process.emitWarning;n?n(t,e):console.warn(e?`${e}: ${t}`:t)}}function Dw(t){if(gh(!0)){let e=t.replace(/.*yaml[/\\]/i,"").replace(/\.js$/,"").replace(/\\/g,"/");_h(`The endpoint 'yaml/${e}' will be removed in a future release.`,"DeprecationWarning")}}var X0={};function xw(t,e){if(!X0[t]&&gh(!0)){X0[t]=!0;let n=`The option '${t}' will be removed in a future release`;n+=e?`, use '${e}' instead.`:".",_h(n,"DeprecationWarning")}}ii.binary=yw;ii.floatTime=Ew;ii.intTime=Sw;ii.omap=Nw;ii.pairs=bw;ii.set=Aw;ii.timestamp=Iw;ii.warn=_h;ii.warnFileDeprecation=Dw;ii.warnOptionDeprecation=xw});var Qc=X(uv=>{"use strict";var Hc=ms(),we=go(),Rn=Yc();function Rw(t,e,n){let r=new we.YAMLMap(t);if(e instanceof Map)for(let[i,s]of e)r.items.push(t.createPair(i,s,n));else if(e&&typeof e=="object")for(let i of Object.keys(e))r.items.push(t.createPair(i,e[i],n));return typeof t.sortMapEntries=="function"&&r.items.sort(t.sortMapEntries),r}var El={createNode:Rw,default:!0,nodeClass:we.YAMLMap,tag:"tag:yaml.org,2002:map",resolve:we.resolveMap};function ww(t,e,n){let r=new we.YAMLSeq(t);if(e&&e[Symbol.iterator])for(let i of e){let s=t.createNode(i,n.wrapScalars,null,n);r.items.push(s)}return r}var $c={createNode:ww,default:!0,nodeClass:we.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve:we.resolveSeq},Ow={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:we.resolveString,stringify(t,e,n,r){return e=Object.assign({actualString:!0},e),we.stringifyString(t,e,n,r)},options:we.strOptions},yh=[El,$c,Ow],Kc=t=>typeof t=="bigint"||Number.isInteger(t),bh=(t,e,n)=>we.intOptions.asBigInt?BigInt(t):parseInt(e,n);function Q0(t,e,n){let{value:r}=t;return Kc(r)&&r>=0?n+r.toString(e):we.stringifyNumber(t)}var J0={identify:t=>t==null,createNode:(t,e,n)=>n.wrapScalars?new we.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:we.nullOptions,stringify:()=>we.nullOptions.nullStr},Z0={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>t[0]==="t"||t[0]==="T",options:we.boolOptions,stringify:({value:t})=>t?we.boolOptions.trueStr:we.boolOptions.falseStr},ev={identify:t=>Kc(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o([0-7]+)$/,resolve:(t,e)=>bh(t,e,8),options:we.intOptions,stringify:t=>Q0(t,8,"0o")},tv={identify:Kc,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:t=>bh(t,t,10),options:we.intOptions,stringify:we.stringifyNumber},nv={identify:t=>Kc(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x([0-9a-fA-F]+)$/,resolve:(t,e)=>bh(t,e,16),options:we.intOptions,stringify:t=>Q0(t,16,"0x")},rv={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(t,e)=>e?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:we.stringifyNumber},iv={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify:({value:t})=>Number(t).toExponential()},sv={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.([0-9]+)|[0-9]+\.([0-9]*))$/,resolve(t,e,n){let r=e||n,i=new we.Scalar(parseFloat(t));return r&&r[r.length-1]==="0"&&(i.minFractionDigits=r.length),i},stringify:we.stringifyNumber},Lw=yh.concat([J0,Z0,ev,tv,nv,rv,iv,sv]),av=t=>typeof t=="bigint"||Number.isInteger(t),zc=({value:t})=>JSON.stringify(t),ov=[El,$c,{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:we.resolveString,stringify:zc},{identify:t=>t==null,createNode:(t,e,n)=>n.wrapScalars?new we.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:zc},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:t=>t==="true",stringify:zc},{identify:av,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:t=>we.intOptions.asBigInt?BigInt(t):parseInt(t,10),stringify:({value:t})=>av(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:zc}];ov.scalarFallback=t=>{throw new SyntaxError(`Unresolved plain scalar ${JSON.stringify(t)}`)};var lv=({value:t})=>t?we.boolOptions.trueStr:we.boolOptions.falseStr,Il=t=>typeof t=="bigint"||Number.isInteger(t);function Xc(t,e,n){let r=e.replace(/_/g,"");if(we.intOptions.asBigInt){switch(n){case 2:r=`0b${r}`;break;case 8:r=`0o${r}`;break;case 16:r=`0x${r}`;break}let s=BigInt(r);return t==="-"?BigInt(-1)*s:s}let i=parseInt(r,n);return t==="-"?-1*i:i}function Th(t,e,n){let{value:r}=t;if(Il(r)){let i=r.toString(e);return r<0?"-"+n+i.substr(1):n+i}return we.stringifyNumber(t)}var Fw=yh.concat([{identify:t=>t==null,createNode:(t,e,n)=>n.wrapScalars?new we.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:we.nullOptions,stringify:()=>we.nullOptions.nullStr},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>!0,options:we.boolOptions,stringify:lv},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i,resolve:()=>!1,options:we.boolOptions,stringify:lv},{identify:Il,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^([-+]?)0b([0-1_]+)$/,resolve:(t,e,n)=>Xc(e,n,2),stringify:t=>Th(t,2,"0b")},{identify:Il,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^([-+]?)0([0-7_]+)$/,resolve:(t,e,n)=>Xc(e,n,8),stringify:t=>Th(t,8,"0")},{identify:Il,default:!0,tag:"tag:yaml.org,2002:int",test:/^([-+]?)([0-9][0-9_]*)$/,resolve:(t,e,n)=>Xc(e,n,10),stringify:we.stringifyNumber},{identify:Il,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^([-+]?)0x([0-9a-fA-F_]+)$/,resolve:(t,e,n)=>Xc(e,n,16),stringify:t=>Th(t,16,"0x")},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(t,e)=>e?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:we.stringifyNumber},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?([0-9][0-9_]*)?(\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify:({value:t})=>Number(t).toExponential()},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.([0-9_]*)$/,resolve(t,e){let n=new we.Scalar(parseFloat(t.replace(/_/g,"")));if(e){let r=e.replace(/_/g,"");r[r.length-1]==="0"&&(n.minFractionDigits=r.length)}return n},stringify:we.stringifyNumber}],Rn.binary,Rn.omap,Rn.pairs,Rn.set,Rn.intTime,Rn.floatTime,Rn.timestamp),kw={core:Lw,failsafe:yh,json:ov,yaml11:Fw},Mw={binary:Rn.binary,bool:Z0,float:sv,floatExp:iv,floatNaN:rv,floatTime:Rn.floatTime,int:tv,intHex:nv,intOct:ev,intTime:Rn.intTime,map:El,null:J0,omap:Rn.omap,pairs:Rn.pairs,seq:$c,set:Rn.set,timestamp:Rn.timestamp};function Bw(t,e,n){if(e){let r=n.filter(s=>s.tag===e),i=r.find(s=>!s.format)||r[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return n.find(r=>(r.identify&&r.identify(t)||r.class&&t instanceof r.class)&&!r.format)}function qw(t,e,n){if(t instanceof we.Node)return t;let{defaultPrefix:r,onTagObj:i,prevObjects:s,schema:a,wrapScalars:o}=n;e&&e.startsWith("!!")&&(e=r+e.slice(2));let l=Bw(t,e,a.tags);if(!l){if(typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object")return o?new we.Scalar(t):t;l=t instanceof Map?El:t[Symbol.iterator]?$c:El}i&&(i(l),delete n.onTagObj);let u={value:void 0,node:void 0};if(t&&typeof t=="object"&&s){let c=s.get(t);if(c){let f=new we.Alias(c);return n.aliasNodes.push(f),f}u.value=t,s.set(t,u)}return u.node=l.createNode?l.createNode(n.schema,t,n):o?new we.Scalar(t):t,e&&u.node instanceof we.Node&&(u.node.tag=e),u.node}function Vw(t,e,n,r){let i=t[r.replace(/\W/g,"")];if(!i){let s=Object.keys(t).map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${r}"; use one of ${s}`)}if(Array.isArray(n))for(let s of n)i=i.concat(s);else typeof n=="function"&&(i=n(i.slice()));for(let s=0;sJSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag "${a}"; use one of ${l}`)}i[s]=o}}return i}var jw=(t,e)=>t.keye.key?1:0,_o=class{constructor({customTags:e,merge:n,schema:r,sortMapEntries:i,tags:s}){this.merge=!!n,this.name=r,this.sortMapEntries=i===!0?jw:i||null,!e&&s&&Rn.warnOptionDeprecation("tags","customTags"),this.tags=Vw(kw,Mw,e||s,r)}createNode(e,n,r,i){let s={defaultPrefix:_o.defaultPrefix,schema:this,wrapScalars:n},a=i?Object.assign(i,s):s;return qw(e,r,a)}createPair(e,n,r){r||(r={wrapScalars:!0});let i=this.createNode(e,r.wrapScalars,null,r),s=this.createNode(n,r.wrapScalars,null,r);return new we.Pair(i,s)}};Hc._defineProperty(_o,"defaultPrefix",Hc.defaultTagPrefix);Hc._defineProperty(_o,"defaultTags",Hc.defaultTags);uv.Schema=_o});var dv=X(tf=>{"use strict";var wn=ms(),Le=go(),cv=Qc(),Uw={anchorPrefix:"a",customTags:null,indent:2,indentSeq:!0,keepCstNodes:!1,keepNodeTypes:!0,keepBlobsInJSON:!0,mapAsMap:!1,maxAliasCount:100,prettyErrors:!1,simpleKeys:!1,version:"1.2"},Ww={get binary(){return Le.binaryOptions},set binary(t){Object.assign(Le.binaryOptions,t)},get bool(){return Le.boolOptions},set bool(t){Object.assign(Le.boolOptions,t)},get int(){return Le.intOptions},set int(t){Object.assign(Le.intOptions,t)},get null(){return Le.nullOptions},set null(t){Object.assign(Le.nullOptions,t)},get str(){return Le.strOptions},set str(t){Object.assign(Le.strOptions,t)}},fv={"1.0":{schema:"yaml-1.1",merge:!0,tagPrefixes:[{handle:"!",prefix:wn.defaultTagPrefix},{handle:"!!",prefix:"tag:private.yaml.org,2002:"}]},1.1:{schema:"yaml-1.1",merge:!0,tagPrefixes:[{handle:"!",prefix:"!"},{handle:"!!",prefix:wn.defaultTagPrefix}]},1.2:{schema:"core",merge:!1,tagPrefixes:[{handle:"!",prefix:"!"},{handle:"!!",prefix:wn.defaultTagPrefix}]}};function pv(t,e){if((t.version||t.options.version)==="1.0"){let i=e.match(/^tag:private\.yaml\.org,2002:([^:/]+)$/);if(i)return"!"+i[1];let s=e.match(/^tag:([a-zA-Z0-9-]+)\.yaml\.org,2002:(.*)/);return s?`!${s[1]}/${s[2]}`:`!${e.replace(/^tag:/,"")}`}let n=t.tagPrefixes.find(i=>e.indexOf(i.prefix)===0);if(!n){let i=t.getDefaults().tagPrefixes;n=i&&i.find(s=>e.indexOf(s.prefix)===0)}if(!n)return e[0]==="!"?e:`!<${e}>`;let r=e.substr(n.prefix.length).replace(/[!,[\]{}]/g,i=>({"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"})[i]);return n.handle+r}function Gw(t,e){if(e instanceof Le.Alias)return Le.Alias;if(e.tag){let i=t.filter(s=>s.tag===e.tag);if(i.length>0)return i.find(s=>s.format===e.format)||i[0]}let n,r;if(e instanceof Le.Scalar){r=e.value;let i=t.filter(s=>s.identify&&s.identify(r)||s.class&&r instanceof s.class);n=i.find(s=>s.format===e.format)||i.find(s=>!s.format)}else r=e,n=t.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){let i=r&&r.constructor?r.constructor.name:typeof r;throw new Error(`Tag not resolved for ${i} value`)}return n}function Yw(t,e,{anchors:n,doc:r}){let i=[],s=r.anchors.getName(t);return s&&(n[s]=t,i.push(`&${s}`)),t.tag?i.push(pv(r,t.tag)):e.default||i.push(pv(r,e.tag)),i.join(" ")}function Jc(t,e,n,r){let{anchors:i,schema:s}=e.doc,a;if(!(t instanceof Le.Node)){let u={aliasNodes:[],onTagObj:c=>a=c,prevObjects:new Map};t=s.createNode(t,!0,null,u);for(let c of u.aliasNodes){c.source=c.source.node;let f=i.getName(c.source);f||(f=i.newName(),i.map[f]=c.source)}}if(t instanceof Le.Pair)return t.toString(e,n,r);a||(a=Gw(s.tags,t));let o=Yw(t,a,e);o.length>0&&(e.indentAtStart=(e.indentAtStart||0)+o.length+1);let l=typeof a.stringify=="function"?a.stringify(t,e,n,r):t instanceof Le.Scalar?Le.stringifyString(t,e,n,r):t.toString(e,n,r);return o?t instanceof Le.Scalar||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o} -${e.indent}${l}`:l}var Zc=class{static validAnchorNode(e){return e instanceof Le.Scalar||e instanceof Le.YAMLSeq||e instanceof Le.YAMLMap}constructor(e){wn._defineProperty(this,"map",Object.create(null)),this.prefix=e}createAlias(e,n){return this.setAnchor(e,n),new Le.Alias(e)}createMergePair(...e){let n=new Le.Merge;return n.value.items=e.map(r=>{if(r instanceof Le.Alias){if(r.source instanceof Le.YAMLMap)return r}else if(r instanceof Le.YAMLMap)return this.createAlias(r);throw new Error("Merge sources must be Map nodes or their Aliases")}),n}getName(e){let{map:n}=this;return Object.keys(n).find(r=>n[r]===e)}getNames(){return Object.keys(this.map)}getNode(e){return this.map[e]}newName(e){e||(e=this.prefix);let n=Object.keys(this.map);for(let r=1;;++r){let i=`${e}${r}`;if(!n.includes(i))return i}}resolveNodes(){let{map:e,_cstAliases:n}=this;Object.keys(e).forEach(r=>{e[r]=e[r].resolved}),n.forEach(r=>{r.source=r.source.resolved}),delete this._cstAliases}setAnchor(e,n){if(e!=null&&!Zc.validAnchorNode(e))throw new Error("Anchors may only be set for Scalar, Seq and Map nodes");if(n&&/[\x00-\x19\s,[\]{}]/.test(n))throw new Error("Anchor names must not contain whitespace or control characters");let{map:r}=this,i=e&&Object.keys(r).find(s=>r[s]===e);if(i)if(n)i!==n&&(delete r[i],r[n]=e);else return i;else{if(!n){if(!e)return null;n=this.newName()}r[n]=e}return n}},ef=(t,e)=>{if(t&&typeof t=="object"){let{tag:n}=t;t instanceof Le.Collection?(n&&(e[n]=!0),t.items.forEach(r=>ef(r,e))):t instanceof Le.Pair?(ef(t.key,e),ef(t.value,e)):t instanceof Le.Scalar&&n&&(e[n]=!0)}return e},Hw=t=>Object.keys(ef(t,{}));function $w(t,e){let n={before:[],after:[]},r,i=!1;for(let s of e)if(s.valueRange){if(r!==void 0){let o="Document contains trailing content not separated by a ... or --- line";t.errors.push(new wn.YAMLSyntaxError(s,o));break}let a=Le.resolveNode(t,s);i&&(a.spaceBefore=!0,i=!1),r=a}else s.comment!==null?(r===void 0?n.before:n.after).push(s.comment):s.type===wn.Type.BLANK_LINE&&(i=!0,r===void 0&&n.before.length>0&&!t.commentBefore&&(t.commentBefore=n.before.join(` +${s.comment}`:i.comment),i=s}n.items[r]=i instanceof Ke.Pair?i:new Ke.Pair(i)}}return n}function z0(t,e,n){let r=new Ke.YAMLSeq(t);r.tag="tag:yaml.org,2002:pairs";for(let i of e){let s,a;if(Array.isArray(i))if(i.length===2)s=i[0],a=i[1];else throw new TypeError(`Expected [key, value] tuple: ${i}`);else if(i&&i instanceof Object){let l=Object.keys(i);if(l.length===1)s=l[0],a=i[s];else throw new TypeError(`Expected { key: value } tuple: ${i}`)}else s=i;let o=t.createPair(s,a,n);r.items.push(o)}return r}var vw={default:!1,tag:"tag:yaml.org,2002:pairs",resolve:K0,createNode:z0},Js=class extends Ke.YAMLSeq{constructor(){super();ir._defineProperty(this,"add",Ke.YAMLMap.prototype.add.bind(this)),ir._defineProperty(this,"delete",Ke.YAMLMap.prototype.delete.bind(this)),ir._defineProperty(this,"get",Ke.YAMLMap.prototype.get.bind(this)),ir._defineProperty(this,"has",Ke.YAMLMap.prototype.has.bind(this)),ir._defineProperty(this,"set",Ke.YAMLMap.prototype.set.bind(this)),this.tag=Js.tag}toJSON(e,n){let r=new Map;n&&n.onCreate&&n.onCreate(r);for(let i of this.items){let s,a;if(i instanceof Ke.Pair?(s=Ke.toJSON(i.key,"",n),a=Ke.toJSON(i.value,s,n)):s=Ke.toJSON(i,"",n),r.has(s))throw new Error("Ordered maps must not include duplicate keys");r.set(s,a)}return r}};ir._defineProperty(Js,"tag","tag:yaml.org,2002:omap");function Nw(t,e){let n=K0(t,e),r=[];for(let{key:i}of n.items)if(i instanceof Ke.Scalar)if(r.includes(i.value)){let s="Ordered maps must not include duplicate keys";throw new ir.YAMLSemanticError(e,s)}else r.push(i.value);return Object.assign(new Js,n)}function Cw(t,e,n){let r=z0(t,e,n),i=new Js;return i.items=r.items,i}var Pw={identify:t=>t instanceof Map,nodeClass:Js,default:!1,tag:"tag:yaml.org,2002:omap",resolve:Nw,createNode:Cw},Zs=class extends Ke.YAMLMap{constructor(){super();this.tag=Zs.tag}add(e){let n=e instanceof Ke.Pair?e:new Ke.Pair(e);Ke.findPair(this.items,n.key)||this.items.push(n)}get(e,n){let r=Ke.findPair(this.items,e);return!n&&r instanceof Ke.Pair?r.key instanceof Ke.Scalar?r.key.value:r.key:r}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let r=Ke.findPair(this.items,e);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Ke.Pair(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues())return super.toString(e,n,r);throw new Error("Set items must all have null values")}};ir._defineProperty(Zs,"tag","tag:yaml.org,2002:set");function Sw(t,e){let n=Ke.resolveMap(t,e);if(!n.hasAllNullValues())throw new ir.YAMLSemanticError(e,"Set items must all have null values");return Object.assign(new Zs,n)}function Aw(t,e,n){let r=new Zs;for(let i of e)r.items.push(t.createPair(i,null,n));return r}var Ew={identify:t=>t instanceof Set,nodeClass:Zs,default:!1,tag:"tag:yaml.org,2002:set",resolve:Sw,createNode:Aw},mh=(t,e)=>{let n=e.split(":").reduce((r,i)=>r*60+Number(i),0);return t==="-"?-n:n},X0=({value:t})=>{if(isNaN(t)||!isFinite(t))return Ke.stringifyNumber(t);let e="";t<0&&(e="-",t=Math.abs(t));let n=[t%60];return t<60?n.unshift(0):(t=Math.round((t-n[0])/60),n.unshift(t%60),t>=60&&(t=Math.round((t-n[0])/60),n.unshift(t))),e+n.map(r=>r<10?"0"+String(r):String(r)).join(":").replace(/000000\d*$/,"")},Iw={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+)$/,resolve:(t,e,n)=>mh(e,n.replace(/_/g,"")),stringify:X0},Dw={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*)$/,resolve:(t,e,n)=>mh(e,n.replace(/_/g,"")),stringify:X0},xw={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^(?:([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?)$"),resolve:(t,e,n,r,i,s,a,o,l)=>{o&&(o=(o+"00").substr(1,3));let u=Date.UTC(e,n-1,r,i||0,s||0,a||0,o||0);if(l&&l!=="Z"){let c=mh(l[0],l.slice(1));Math.abs(c)<30&&(c*=60),u-=6e4*c}return new Date(u)},stringify:({value:t})=>t.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")};function gh(t){let e=typeof process!="undefined"&&process.env||{};return t?typeof YAML_SILENCE_DEPRECATION_WARNINGS!="undefined"?!YAML_SILENCE_DEPRECATION_WARNINGS:!e.YAML_SILENCE_DEPRECATION_WARNINGS:typeof YAML_SILENCE_WARNINGS!="undefined"?!YAML_SILENCE_WARNINGS:!e.YAML_SILENCE_WARNINGS}function _h(t,e){if(gh(!1)){let n=typeof process!="undefined"&&process.emitWarning;n?n(t,e):console.warn(e?`${e}: ${t}`:t)}}function Rw(t){if(gh(!0)){let e=t.replace(/.*yaml[/\\]/i,"").replace(/\.js$/,"").replace(/\\/g,"/");_h(`The endpoint 'yaml/${e}' will be removed in a future release.`,"DeprecationWarning")}}var Q0={};function ww(t,e){if(!Q0[t]&&gh(!0)){Q0[t]=!0;let n=`The option '${t}' will be removed in a future release`;n+=e?`, use '${e}' instead.`:".",_h(n,"DeprecationWarning")}}ii.binary=Tw;ii.floatTime=Dw;ii.intTime=Iw;ii.omap=Pw;ii.pairs=vw;ii.set=Ew;ii.timestamp=xw;ii.warn=_h;ii.warnFileDeprecation=Rw;ii.warnOptionDeprecation=ww});var Qc=X(cv=>{"use strict";var Hc=ms(),we=go(),Rn=Yc();function Ow(t,e,n){let r=new we.YAMLMap(t);if(e instanceof Map)for(let[i,s]of e)r.items.push(t.createPair(i,s,n));else if(e&&typeof e=="object")for(let i of Object.keys(e))r.items.push(t.createPair(i,e[i],n));return typeof t.sortMapEntries=="function"&&r.items.sort(t.sortMapEntries),r}var El={createNode:Ow,default:!0,nodeClass:we.YAMLMap,tag:"tag:yaml.org,2002:map",resolve:we.resolveMap};function Lw(t,e,n){let r=new we.YAMLSeq(t);if(e&&e[Symbol.iterator])for(let i of e){let s=t.createNode(i,n.wrapScalars,null,n);r.items.push(s)}return r}var $c={createNode:Lw,default:!0,nodeClass:we.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve:we.resolveSeq},Fw={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:we.resolveString,stringify(t,e,n,r){return e=Object.assign({actualString:!0},e),we.stringifyString(t,e,n,r)},options:we.strOptions},yh=[El,$c,Fw],Kc=t=>typeof t=="bigint"||Number.isInteger(t),bh=(t,e,n)=>we.intOptions.asBigInt?BigInt(t):parseInt(e,n);function J0(t,e,n){let{value:r}=t;return Kc(r)&&r>=0?n+r.toString(e):we.stringifyNumber(t)}var Z0={identify:t=>t==null,createNode:(t,e,n)=>n.wrapScalars?new we.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:we.nullOptions,stringify:()=>we.nullOptions.nullStr},ev={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>t[0]==="t"||t[0]==="T",options:we.boolOptions,stringify:({value:t})=>t?we.boolOptions.trueStr:we.boolOptions.falseStr},tv={identify:t=>Kc(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o([0-7]+)$/,resolve:(t,e)=>bh(t,e,8),options:we.intOptions,stringify:t=>J0(t,8,"0o")},nv={identify:Kc,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:t=>bh(t,t,10),options:we.intOptions,stringify:we.stringifyNumber},rv={identify:t=>Kc(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x([0-9a-fA-F]+)$/,resolve:(t,e)=>bh(t,e,16),options:we.intOptions,stringify:t=>J0(t,16,"0x")},iv={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(t,e)=>e?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:we.stringifyNumber},sv={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify:({value:t})=>Number(t).toExponential()},av={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.([0-9]+)|[0-9]+\.([0-9]*))$/,resolve(t,e,n){let r=e||n,i=new we.Scalar(parseFloat(t));return r&&r[r.length-1]==="0"&&(i.minFractionDigits=r.length),i},stringify:we.stringifyNumber},kw=yh.concat([Z0,ev,tv,nv,rv,iv,sv,av]),ov=t=>typeof t=="bigint"||Number.isInteger(t),zc=({value:t})=>JSON.stringify(t),lv=[El,$c,{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:we.resolveString,stringify:zc},{identify:t=>t==null,createNode:(t,e,n)=>n.wrapScalars?new we.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:zc},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:t=>t==="true",stringify:zc},{identify:ov,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:t=>we.intOptions.asBigInt?BigInt(t):parseInt(t,10),stringify:({value:t})=>ov(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:zc}];lv.scalarFallback=t=>{throw new SyntaxError(`Unresolved plain scalar ${JSON.stringify(t)}`)};var uv=({value:t})=>t?we.boolOptions.trueStr:we.boolOptions.falseStr,Il=t=>typeof t=="bigint"||Number.isInteger(t);function Xc(t,e,n){let r=e.replace(/_/g,"");if(we.intOptions.asBigInt){switch(n){case 2:r=`0b${r}`;break;case 8:r=`0o${r}`;break;case 16:r=`0x${r}`;break}let s=BigInt(r);return t==="-"?BigInt(-1)*s:s}let i=parseInt(r,n);return t==="-"?-1*i:i}function Th(t,e,n){let{value:r}=t;if(Il(r)){let i=r.toString(e);return r<0?"-"+n+i.substr(1):n+i}return we.stringifyNumber(t)}var Mw=yh.concat([{identify:t=>t==null,createNode:(t,e,n)=>n.wrapScalars?new we.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:we.nullOptions,stringify:()=>we.nullOptions.nullStr},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>!0,options:we.boolOptions,stringify:uv},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i,resolve:()=>!1,options:we.boolOptions,stringify:uv},{identify:Il,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^([-+]?)0b([0-1_]+)$/,resolve:(t,e,n)=>Xc(e,n,2),stringify:t=>Th(t,2,"0b")},{identify:Il,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^([-+]?)0([0-7_]+)$/,resolve:(t,e,n)=>Xc(e,n,8),stringify:t=>Th(t,8,"0")},{identify:Il,default:!0,tag:"tag:yaml.org,2002:int",test:/^([-+]?)([0-9][0-9_]*)$/,resolve:(t,e,n)=>Xc(e,n,10),stringify:we.stringifyNumber},{identify:Il,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^([-+]?)0x([0-9a-fA-F_]+)$/,resolve:(t,e,n)=>Xc(e,n,16),stringify:t=>Th(t,16,"0x")},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(t,e)=>e?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:we.stringifyNumber},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?([0-9][0-9_]*)?(\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify:({value:t})=>Number(t).toExponential()},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.([0-9_]*)$/,resolve(t,e){let n=new we.Scalar(parseFloat(t.replace(/_/g,"")));if(e){let r=e.replace(/_/g,"");r[r.length-1]==="0"&&(n.minFractionDigits=r.length)}return n},stringify:we.stringifyNumber}],Rn.binary,Rn.omap,Rn.pairs,Rn.set,Rn.intTime,Rn.floatTime,Rn.timestamp),Bw={core:kw,failsafe:yh,json:lv,yaml11:Mw},qw={binary:Rn.binary,bool:ev,float:av,floatExp:sv,floatNaN:iv,floatTime:Rn.floatTime,int:nv,intHex:rv,intOct:tv,intTime:Rn.intTime,map:El,null:Z0,omap:Rn.omap,pairs:Rn.pairs,seq:$c,set:Rn.set,timestamp:Rn.timestamp};function Vw(t,e,n){if(e){let r=n.filter(s=>s.tag===e),i=r.find(s=>!s.format)||r[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return n.find(r=>(r.identify&&r.identify(t)||r.class&&t instanceof r.class)&&!r.format)}function jw(t,e,n){if(t instanceof we.Node)return t;let{defaultPrefix:r,onTagObj:i,prevObjects:s,schema:a,wrapScalars:o}=n;e&&e.startsWith("!!")&&(e=r+e.slice(2));let l=Vw(t,e,a.tags);if(!l){if(typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object")return o?new we.Scalar(t):t;l=t instanceof Map?El:t[Symbol.iterator]?$c:El}i&&(i(l),delete n.onTagObj);let u={value:void 0,node:void 0};if(t&&typeof t=="object"&&s){let c=s.get(t);if(c){let f=new we.Alias(c);return n.aliasNodes.push(f),f}u.value=t,s.set(t,u)}return u.node=l.createNode?l.createNode(n.schema,t,n):o?new we.Scalar(t):t,e&&u.node instanceof we.Node&&(u.node.tag=e),u.node}function Uw(t,e,n,r){let i=t[r.replace(/\W/g,"")];if(!i){let s=Object.keys(t).map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${r}"; use one of ${s}`)}if(Array.isArray(n))for(let s of n)i=i.concat(s);else typeof n=="function"&&(i=n(i.slice()));for(let s=0;sJSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag "${a}"; use one of ${l}`)}i[s]=o}}return i}var Ww=(t,e)=>t.keye.key?1:0,_o=class{constructor({customTags:e,merge:n,schema:r,sortMapEntries:i,tags:s}){this.merge=!!n,this.name=r,this.sortMapEntries=i===!0?Ww:i||null,!e&&s&&Rn.warnOptionDeprecation("tags","customTags"),this.tags=Uw(Bw,qw,e||s,r)}createNode(e,n,r,i){let s={defaultPrefix:_o.defaultPrefix,schema:this,wrapScalars:n},a=i?Object.assign(i,s):s;return jw(e,r,a)}createPair(e,n,r){r||(r={wrapScalars:!0});let i=this.createNode(e,r.wrapScalars,null,r),s=this.createNode(n,r.wrapScalars,null,r);return new we.Pair(i,s)}};Hc._defineProperty(_o,"defaultPrefix",Hc.defaultTagPrefix);Hc._defineProperty(_o,"defaultTags",Hc.defaultTags);cv.Schema=_o});var hv=X(tf=>{"use strict";var wn=ms(),Le=go(),fv=Qc(),Gw={anchorPrefix:"a",customTags:null,indent:2,indentSeq:!0,keepCstNodes:!1,keepNodeTypes:!0,keepBlobsInJSON:!0,mapAsMap:!1,maxAliasCount:100,prettyErrors:!1,simpleKeys:!1,version:"1.2"},Yw={get binary(){return Le.binaryOptions},set binary(t){Object.assign(Le.binaryOptions,t)},get bool(){return Le.boolOptions},set bool(t){Object.assign(Le.boolOptions,t)},get int(){return Le.intOptions},set int(t){Object.assign(Le.intOptions,t)},get null(){return Le.nullOptions},set null(t){Object.assign(Le.nullOptions,t)},get str(){return Le.strOptions},set str(t){Object.assign(Le.strOptions,t)}},pv={"1.0":{schema:"yaml-1.1",merge:!0,tagPrefixes:[{handle:"!",prefix:wn.defaultTagPrefix},{handle:"!!",prefix:"tag:private.yaml.org,2002:"}]},1.1:{schema:"yaml-1.1",merge:!0,tagPrefixes:[{handle:"!",prefix:"!"},{handle:"!!",prefix:wn.defaultTagPrefix}]},1.2:{schema:"core",merge:!1,tagPrefixes:[{handle:"!",prefix:"!"},{handle:"!!",prefix:wn.defaultTagPrefix}]}};function dv(t,e){if((t.version||t.options.version)==="1.0"){let i=e.match(/^tag:private\.yaml\.org,2002:([^:/]+)$/);if(i)return"!"+i[1];let s=e.match(/^tag:([a-zA-Z0-9-]+)\.yaml\.org,2002:(.*)/);return s?`!${s[1]}/${s[2]}`:`!${e.replace(/^tag:/,"")}`}let n=t.tagPrefixes.find(i=>e.indexOf(i.prefix)===0);if(!n){let i=t.getDefaults().tagPrefixes;n=i&&i.find(s=>e.indexOf(s.prefix)===0)}if(!n)return e[0]==="!"?e:`!<${e}>`;let r=e.substr(n.prefix.length).replace(/[!,[\]{}]/g,i=>({"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"})[i]);return n.handle+r}function Hw(t,e){if(e instanceof Le.Alias)return Le.Alias;if(e.tag){let i=t.filter(s=>s.tag===e.tag);if(i.length>0)return i.find(s=>s.format===e.format)||i[0]}let n,r;if(e instanceof Le.Scalar){r=e.value;let i=t.filter(s=>s.identify&&s.identify(r)||s.class&&r instanceof s.class);n=i.find(s=>s.format===e.format)||i.find(s=>!s.format)}else r=e,n=t.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){let i=r&&r.constructor?r.constructor.name:typeof r;throw new Error(`Tag not resolved for ${i} value`)}return n}function $w(t,e,{anchors:n,doc:r}){let i=[],s=r.anchors.getName(t);return s&&(n[s]=t,i.push(`&${s}`)),t.tag?i.push(dv(r,t.tag)):e.default||i.push(dv(r,e.tag)),i.join(" ")}function Jc(t,e,n,r){let{anchors:i,schema:s}=e.doc,a;if(!(t instanceof Le.Node)){let u={aliasNodes:[],onTagObj:c=>a=c,prevObjects:new Map};t=s.createNode(t,!0,null,u);for(let c of u.aliasNodes){c.source=c.source.node;let f=i.getName(c.source);f||(f=i.newName(),i.map[f]=c.source)}}if(t instanceof Le.Pair)return t.toString(e,n,r);a||(a=Hw(s.tags,t));let o=$w(t,a,e);o.length>0&&(e.indentAtStart=(e.indentAtStart||0)+o.length+1);let l=typeof a.stringify=="function"?a.stringify(t,e,n,r):t instanceof Le.Scalar?Le.stringifyString(t,e,n,r):t.toString(e,n,r);return o?t instanceof Le.Scalar||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o} +${e.indent}${l}`:l}var Zc=class{static validAnchorNode(e){return e instanceof Le.Scalar||e instanceof Le.YAMLSeq||e instanceof Le.YAMLMap}constructor(e){wn._defineProperty(this,"map",Object.create(null)),this.prefix=e}createAlias(e,n){return this.setAnchor(e,n),new Le.Alias(e)}createMergePair(...e){let n=new Le.Merge;return n.value.items=e.map(r=>{if(r instanceof Le.Alias){if(r.source instanceof Le.YAMLMap)return r}else if(r instanceof Le.YAMLMap)return this.createAlias(r);throw new Error("Merge sources must be Map nodes or their Aliases")}),n}getName(e){let{map:n}=this;return Object.keys(n).find(r=>n[r]===e)}getNames(){return Object.keys(this.map)}getNode(e){return this.map[e]}newName(e){e||(e=this.prefix);let n=Object.keys(this.map);for(let r=1;;++r){let i=`${e}${r}`;if(!n.includes(i))return i}}resolveNodes(){let{map:e,_cstAliases:n}=this;Object.keys(e).forEach(r=>{e[r]=e[r].resolved}),n.forEach(r=>{r.source=r.source.resolved}),delete this._cstAliases}setAnchor(e,n){if(e!=null&&!Zc.validAnchorNode(e))throw new Error("Anchors may only be set for Scalar, Seq and Map nodes");if(n&&/[\x00-\x19\s,[\]{}]/.test(n))throw new Error("Anchor names must not contain whitespace or control characters");let{map:r}=this,i=e&&Object.keys(r).find(s=>r[s]===e);if(i)if(n)i!==n&&(delete r[i],r[n]=e);else return i;else{if(!n){if(!e)return null;n=this.newName()}r[n]=e}return n}},ef=(t,e)=>{if(t&&typeof t=="object"){let{tag:n}=t;t instanceof Le.Collection?(n&&(e[n]=!0),t.items.forEach(r=>ef(r,e))):t instanceof Le.Pair?(ef(t.key,e),ef(t.value,e)):t instanceof Le.Scalar&&n&&(e[n]=!0)}return e},Kw=t=>Object.keys(ef(t,{}));function zw(t,e){let n={before:[],after:[]},r,i=!1;for(let s of e)if(s.valueRange){if(r!==void 0){let o="Document contains trailing content not separated by a ... or --- line";t.errors.push(new wn.YAMLSyntaxError(s,o));break}let a=Le.resolveNode(t,s);i&&(a.spaceBefore=!0,i=!1),r=a}else s.comment!==null?(r===void 0?n.before:n.after).push(s.comment):s.type===wn.Type.BLANK_LINE&&(i=!0,r===void 0&&n.before.length>0&&!t.commentBefore&&(t.commentBefore=n.before.join(` `),n.before=[]));if(t.contents=r||null,!r)t.comment=n.before.concat(n.after).join(` `)||null;else{let s=n.before.join(` `);if(s){let a=r instanceof Le.Collection&&r.items[0]?r.items[0]:r;a.commentBefore=a.commentBefore?`${s} ${a.commentBefore}`:s}t.comment=n.after.join(` -`)||null}}function Kw({tagPrefixes:t},e){let[n,r]=e.parameters;if(!n||!r){let i="Insufficient parameters given for %TAG directive";throw new wn.YAMLSemanticError(e,i)}if(t.some(i=>i.handle===n)){let i="The %TAG directive must only be given at most once per handle in the same document.";throw new wn.YAMLSemanticError(e,i)}return{handle:n,prefix:r}}function zw(t,e){let[n]=e.parameters;if(e.name==="YAML:1.0"&&(n="1.0"),!n){let r="Insufficient parameters given for %YAML directive";throw new wn.YAMLSemanticError(e,r)}if(!fv[n]){let i=`Document will be parsed as YAML ${t.version||t.options.version} rather than YAML ${n}`;t.warnings.push(new wn.YAMLWarning(e,i))}return n}function Xw(t,e,n){let r=[],i=!1;for(let s of e){let{comment:a,name:o}=s;switch(o){case"TAG":try{t.tagPrefixes.push(Kw(t,s))}catch(l){t.errors.push(l)}i=!0;break;case"YAML":case"YAML:1.0":if(t.version){let l="The %YAML directive must only be given at most once per document.";t.errors.push(new wn.YAMLSemanticError(s,l))}try{t.version=zw(t,s)}catch(l){t.errors.push(l)}i=!0;break;default:if(o){let l=`YAML only supports %TAG and %YAML directives, and not %${o}`;t.warnings.push(new wn.YAMLWarning(s,l))}}a&&r.push(a)}if(n&&!i&&(t.version||n.version||t.options.version)==="1.1"){let s=({handle:a,prefix:o})=>({handle:a,prefix:o});t.tagPrefixes=n.tagPrefixes.map(s),t.version=n.version}t.commentBefore=r.join(` -`)||null}function yo(t){if(t instanceof Le.Collection)return!0;throw new Error("Expected a YAML collection as document contents")}var bo=class{constructor(e){this.anchors=new Zc(e.anchorPrefix),this.commentBefore=null,this.comment=null,this.contents=null,this.directivesEndMarker=null,this.errors=[],this.options=e,this.schema=null,this.tagPrefixes=[],this.version=null,this.warnings=[]}add(e){return yo(this.contents),this.contents.add(e)}addIn(e,n){yo(this.contents),this.contents.addIn(e,n)}delete(e){return yo(this.contents),this.contents.delete(e)}deleteIn(e){return Le.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):(yo(this.contents),this.contents.deleteIn(e))}getDefaults(){return bo.defaults[this.version]||bo.defaults[this.options.version]||{}}get(e,n){return this.contents instanceof Le.Collection?this.contents.get(e,n):void 0}getIn(e,n){return Le.isEmptyPath(e)?!n&&this.contents instanceof Le.Scalar?this.contents.value:this.contents:this.contents instanceof Le.Collection?this.contents.getIn(e,n):void 0}has(e){return this.contents instanceof Le.Collection?this.contents.has(e):!1}hasIn(e){return Le.isEmptyPath(e)?this.contents!==void 0:this.contents instanceof Le.Collection?this.contents.hasIn(e):!1}set(e,n){yo(this.contents),this.contents.set(e,n)}setIn(e,n){Le.isEmptyPath(e)?this.contents=n:(yo(this.contents),this.contents.setIn(e,n))}setSchema(e,n){if(!e&&!n&&this.schema)return;typeof e=="number"&&(e=e.toFixed(1)),e==="1.0"||e==="1.1"||e==="1.2"?(this.version?this.version=e:this.options.version=e,delete this.options.schema):e&&typeof e=="string"&&(this.options.schema=e),Array.isArray(n)&&(this.options.customTags=n);let r=Object.assign({},this.getDefaults(),this.options);this.schema=new cv.Schema(r)}parse(e,n){this.options.keepCstNodes&&(this.cstNode=e),this.options.keepNodeTypes&&(this.type="DOCUMENT");let{directives:r=[],contents:i=[],directivesEndMarker:s,error:a,valueRange:o}=e;if(a&&(a.source||(a.source=this),this.errors.push(a)),Xw(this,r,n),s&&(this.directivesEndMarker=!0),this.range=o?[o.start,o.end]:null,this.setSchema(),this.anchors._cstAliases=[],$w(this,i),this.anchors.resolveNodes(),this.options.prettyErrors){for(let l of this.errors)l instanceof wn.YAMLError&&l.makePretty();for(let l of this.warnings)l instanceof wn.YAMLError&&l.makePretty()}return this}listNonDefaultTags(){return Hw(this.contents).filter(e=>e.indexOf(cv.Schema.defaultPrefix)!==0)}setTagPrefix(e,n){if(e[0]!=="!"||e[e.length-1]!=="!")throw new Error("Handle must start and end with !");if(n){let r=this.tagPrefixes.find(i=>i.handle===e);r?r.prefix=n:this.tagPrefixes.push({handle:e,prefix:n})}else this.tagPrefixes=this.tagPrefixes.filter(r=>r.handle!==e)}toJSON(e,n){let{keepBlobsInJSON:r,mapAsMap:i,maxAliasCount:s}=this.options,a=r&&(typeof e!="string"||!(this.contents instanceof Le.Scalar)),o={doc:this,indentStep:" ",keep:a,mapAsMap:a&&!!i,maxAliasCount:s,stringify:Jc},l=Object.keys(this.anchors.map);l.length>0&&(o.anchors=new Map(l.map(c=>[this.anchors.map[c],{alias:[],aliasCount:0,count:1}])));let u=Le.toJSON(this.contents,e,o);if(typeof n=="function"&&o.anchors)for(let{count:c,res:f}of o.anchors.values())n(f,c);return u}toString(){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");let e=this.options.indent;if(!Number.isInteger(e)||e<=0){let l=JSON.stringify(e);throw new Error(`"indent" option must be a positive integer, not ${l}`)}this.setSchema();let n=[],r=!1;if(this.version){let l="%YAML 1.2";this.schema.name==="yaml-1.1"&&(this.version==="1.0"?l="%YAML:1.0":this.version==="1.1"&&(l="%YAML 1.1")),n.push(l),r=!0}let i=this.listNonDefaultTags();this.tagPrefixes.forEach(({handle:l,prefix:u})=>{i.some(c=>c.indexOf(u)===0)&&(n.push(`%TAG ${l} ${u}`),r=!0)}),(r||this.directivesEndMarker)&&n.push("---"),this.commentBefore&&((r||!this.directivesEndMarker)&&n.unshift(""),n.unshift(this.commentBefore.replace(/^/gm,"#")));let s={anchors:Object.create(null),doc:this,indent:"",indentStep:" ".repeat(e),stringify:Jc},a=!1,o=null;if(this.contents){this.contents instanceof Le.Node&&(this.contents.spaceBefore&&(r||this.directivesEndMarker)&&n.push(""),this.contents.commentBefore&&n.push(this.contents.commentBefore.replace(/^/gm,"#")),s.forceBlockIndent=!!this.comment,o=this.contents.comment);let l=o?null:()=>a=!0,u=Jc(this.contents,s,()=>o=null,l);n.push(Le.addComment(u,"",o))}else this.contents!==void 0&&n.push(Jc(this.contents,s));return this.comment&&((!a||o)&&n[n.length-1]!==""&&n.push(""),n.push(this.comment.replace(/^/gm,"#"))),n.join(` +`)||null}}function Xw({tagPrefixes:t},e){let[n,r]=e.parameters;if(!n||!r){let i="Insufficient parameters given for %TAG directive";throw new wn.YAMLSemanticError(e,i)}if(t.some(i=>i.handle===n)){let i="The %TAG directive must only be given at most once per handle in the same document.";throw new wn.YAMLSemanticError(e,i)}return{handle:n,prefix:r}}function Qw(t,e){let[n]=e.parameters;if(e.name==="YAML:1.0"&&(n="1.0"),!n){let r="Insufficient parameters given for %YAML directive";throw new wn.YAMLSemanticError(e,r)}if(!pv[n]){let i=`Document will be parsed as YAML ${t.version||t.options.version} rather than YAML ${n}`;t.warnings.push(new wn.YAMLWarning(e,i))}return n}function Jw(t,e,n){let r=[],i=!1;for(let s of e){let{comment:a,name:o}=s;switch(o){case"TAG":try{t.tagPrefixes.push(Xw(t,s))}catch(l){t.errors.push(l)}i=!0;break;case"YAML":case"YAML:1.0":if(t.version){let l="The %YAML directive must only be given at most once per document.";t.errors.push(new wn.YAMLSemanticError(s,l))}try{t.version=Qw(t,s)}catch(l){t.errors.push(l)}i=!0;break;default:if(o){let l=`YAML only supports %TAG and %YAML directives, and not %${o}`;t.warnings.push(new wn.YAMLWarning(s,l))}}a&&r.push(a)}if(n&&!i&&(t.version||n.version||t.options.version)==="1.1"){let s=({handle:a,prefix:o})=>({handle:a,prefix:o});t.tagPrefixes=n.tagPrefixes.map(s),t.version=n.version}t.commentBefore=r.join(` +`)||null}function yo(t){if(t instanceof Le.Collection)return!0;throw new Error("Expected a YAML collection as document contents")}var bo=class{constructor(e){this.anchors=new Zc(e.anchorPrefix),this.commentBefore=null,this.comment=null,this.contents=null,this.directivesEndMarker=null,this.errors=[],this.options=e,this.schema=null,this.tagPrefixes=[],this.version=null,this.warnings=[]}add(e){return yo(this.contents),this.contents.add(e)}addIn(e,n){yo(this.contents),this.contents.addIn(e,n)}delete(e){return yo(this.contents),this.contents.delete(e)}deleteIn(e){return Le.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):(yo(this.contents),this.contents.deleteIn(e))}getDefaults(){return bo.defaults[this.version]||bo.defaults[this.options.version]||{}}get(e,n){return this.contents instanceof Le.Collection?this.contents.get(e,n):void 0}getIn(e,n){return Le.isEmptyPath(e)?!n&&this.contents instanceof Le.Scalar?this.contents.value:this.contents:this.contents instanceof Le.Collection?this.contents.getIn(e,n):void 0}has(e){return this.contents instanceof Le.Collection?this.contents.has(e):!1}hasIn(e){return Le.isEmptyPath(e)?this.contents!==void 0:this.contents instanceof Le.Collection?this.contents.hasIn(e):!1}set(e,n){yo(this.contents),this.contents.set(e,n)}setIn(e,n){Le.isEmptyPath(e)?this.contents=n:(yo(this.contents),this.contents.setIn(e,n))}setSchema(e,n){if(!e&&!n&&this.schema)return;typeof e=="number"&&(e=e.toFixed(1)),e==="1.0"||e==="1.1"||e==="1.2"?(this.version?this.version=e:this.options.version=e,delete this.options.schema):e&&typeof e=="string"&&(this.options.schema=e),Array.isArray(n)&&(this.options.customTags=n);let r=Object.assign({},this.getDefaults(),this.options);this.schema=new fv.Schema(r)}parse(e,n){this.options.keepCstNodes&&(this.cstNode=e),this.options.keepNodeTypes&&(this.type="DOCUMENT");let{directives:r=[],contents:i=[],directivesEndMarker:s,error:a,valueRange:o}=e;if(a&&(a.source||(a.source=this),this.errors.push(a)),Jw(this,r,n),s&&(this.directivesEndMarker=!0),this.range=o?[o.start,o.end]:null,this.setSchema(),this.anchors._cstAliases=[],zw(this,i),this.anchors.resolveNodes(),this.options.prettyErrors){for(let l of this.errors)l instanceof wn.YAMLError&&l.makePretty();for(let l of this.warnings)l instanceof wn.YAMLError&&l.makePretty()}return this}listNonDefaultTags(){return Kw(this.contents).filter(e=>e.indexOf(fv.Schema.defaultPrefix)!==0)}setTagPrefix(e,n){if(e[0]!=="!"||e[e.length-1]!=="!")throw new Error("Handle must start and end with !");if(n){let r=this.tagPrefixes.find(i=>i.handle===e);r?r.prefix=n:this.tagPrefixes.push({handle:e,prefix:n})}else this.tagPrefixes=this.tagPrefixes.filter(r=>r.handle!==e)}toJSON(e,n){let{keepBlobsInJSON:r,mapAsMap:i,maxAliasCount:s}=this.options,a=r&&(typeof e!="string"||!(this.contents instanceof Le.Scalar)),o={doc:this,indentStep:" ",keep:a,mapAsMap:a&&!!i,maxAliasCount:s,stringify:Jc},l=Object.keys(this.anchors.map);l.length>0&&(o.anchors=new Map(l.map(c=>[this.anchors.map[c],{alias:[],aliasCount:0,count:1}])));let u=Le.toJSON(this.contents,e,o);if(typeof n=="function"&&o.anchors)for(let{count:c,res:f}of o.anchors.values())n(f,c);return u}toString(){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");let e=this.options.indent;if(!Number.isInteger(e)||e<=0){let l=JSON.stringify(e);throw new Error(`"indent" option must be a positive integer, not ${l}`)}this.setSchema();let n=[],r=!1;if(this.version){let l="%YAML 1.2";this.schema.name==="yaml-1.1"&&(this.version==="1.0"?l="%YAML:1.0":this.version==="1.1"&&(l="%YAML 1.1")),n.push(l),r=!0}let i=this.listNonDefaultTags();this.tagPrefixes.forEach(({handle:l,prefix:u})=>{i.some(c=>c.indexOf(u)===0)&&(n.push(`%TAG ${l} ${u}`),r=!0)}),(r||this.directivesEndMarker)&&n.push("---"),this.commentBefore&&((r||!this.directivesEndMarker)&&n.unshift(""),n.unshift(this.commentBefore.replace(/^/gm,"#")));let s={anchors:Object.create(null),doc:this,indent:"",indentStep:" ".repeat(e),stringify:Jc},a=!1,o=null;if(this.contents){this.contents instanceof Le.Node&&(this.contents.spaceBefore&&(r||this.directivesEndMarker)&&n.push(""),this.contents.commentBefore&&n.push(this.contents.commentBefore.replace(/^/gm,"#")),s.forceBlockIndent=!!this.comment,o=this.contents.comment);let l=o?null:()=>a=!0,u=Jc(this.contents,s,()=>o=null,l);n.push(Le.addComment(u,"",o))}else this.contents!==void 0&&n.push(Jc(this.contents,s));return this.comment&&((!a||o)&&n[n.length-1]!==""&&n.push(""),n.push(this.comment.replace(/^/gm,"#"))),n.join(` `)+` -`}};wn._defineProperty(bo,"defaults",fv);tf.Document=bo;tf.defaultOptions=Uw;tf.scalarOptions=Ww});var gv=X(mv=>{"use strict";var vh=F0(),ea=dv(),Qw=Qc(),Jw=ms(),Zw=Yc();go();function eO(t,e=!0,n){n===void 0&&typeof e=="string"&&(n=e,e=!0);let r=Object.assign({},ea.Document.defaults[ea.defaultOptions.version],ea.defaultOptions);return new Qw.Schema(r).createNode(t,e,n)}var Dl=class extends ea.Document{constructor(e){super(Object.assign({},ea.defaultOptions,e))}};function tO(t,e){let n=[],r;for(let i of vh.parse(t)){let s=new Dl(e);s.parse(i,r),n.push(s),r=s}return n}function hv(t,e){let n=vh.parse(t),r=new Dl(e).parse(n[0]);if(n.length>1){let i="Source contains multiple documents; please use YAML.parseAllDocuments()";r.errors.unshift(new Jw.YAMLSemanticError(n[1],i))}return r}function nO(t,e){let n=hv(t,e);if(n.warnings.forEach(r=>Zw.warn(r)),n.errors.length>0)throw n.errors[0];return n.toJSON()}function rO(t,e){let n=new Dl(e);return n.contents=t,String(n)}var iO={createNode:eO,defaultOptions:ea.defaultOptions,Document:Dl,parse:nO,parseAllDocuments:tO,parseCST:vh.parse,parseDocument:hv,scalarOptions:ea.scalarOptions,stringify:rO};mv.YAML=iO});var Nh=X((IQ,_v)=>{_v.exports=gv().YAML});var yv=X(On=>{"use strict";var sr=go(),sO=Qc();ms();Yc();On.Alias=sr.Alias;On.Collection=sr.Collection;On.Merge=sr.Merge;On.Node=sr.Node;On.Pair=sr.Pair;On.Scalar=sr.Scalar;On.YAMLMap=sr.YAMLMap;On.YAMLSeq=sr.YAMLSeq;On.binaryOptions=sr.binaryOptions;On.boolOptions=sr.boolOptions;On.intOptions=sr.intOptions;On.nullOptions=sr.nullOptions;On.strOptions=sr.strOptions;On.Schema=sO.Schema});var cf=X((oZ,pN)=>{"use strict";function sn(t){this.__parent=t,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}sn.prototype.clone_empty=function(){var t=new sn(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t};sn.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]};sn.prototype.has_match=function(t){for(var e=this.__items.length-1;e>=0;e--)if(this.__items[e].match(t))return!0;return!1};sn.prototype.set_indent=function(t,e){this.is_empty()&&(this.__indent_count=t||0,this.__alignment_count=e||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))};sn.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)};sn.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count};sn.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,t.__items[0]===" "&&(t.__items.splice(0,1),t.__character_count-=1),!0}return!1};sn.prototype.is_empty=function(){return this.__items.length===0};sn.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]};sn.prototype.push=function(t){this.__items.push(t);var e=t.lastIndexOf(` +`}};wn._defineProperty(bo,"defaults",pv);tf.Document=bo;tf.defaultOptions=Gw;tf.scalarOptions=Yw});var _v=X(gv=>{"use strict";var vh=k0(),ea=hv(),Zw=Qc(),eO=ms(),tO=Yc();go();function nO(t,e=!0,n){n===void 0&&typeof e=="string"&&(n=e,e=!0);let r=Object.assign({},ea.Document.defaults[ea.defaultOptions.version],ea.defaultOptions);return new Zw.Schema(r).createNode(t,e,n)}var Dl=class extends ea.Document{constructor(e){super(Object.assign({},ea.defaultOptions,e))}};function rO(t,e){let n=[],r;for(let i of vh.parse(t)){let s=new Dl(e);s.parse(i,r),n.push(s),r=s}return n}function mv(t,e){let n=vh.parse(t),r=new Dl(e).parse(n[0]);if(n.length>1){let i="Source contains multiple documents; please use YAML.parseAllDocuments()";r.errors.unshift(new eO.YAMLSemanticError(n[1],i))}return r}function iO(t,e){let n=mv(t,e);if(n.warnings.forEach(r=>tO.warn(r)),n.errors.length>0)throw n.errors[0];return n.toJSON()}function sO(t,e){let n=new Dl(e);return n.contents=t,String(n)}var aO={createNode:nO,defaultOptions:ea.defaultOptions,Document:Dl,parse:iO,parseAllDocuments:rO,parseCST:vh.parse,parseDocument:mv,scalarOptions:ea.scalarOptions,stringify:sO};gv.YAML=aO});var Nh=X((OQ,yv)=>{yv.exports=_v().YAML});var bv=X(On=>{"use strict";var sr=go(),oO=Qc();ms();Yc();On.Alias=sr.Alias;On.Collection=sr.Collection;On.Merge=sr.Merge;On.Node=sr.Node;On.Pair=sr.Pair;On.Scalar=sr.Scalar;On.YAMLMap=sr.YAMLMap;On.YAMLSeq=sr.YAMLSeq;On.binaryOptions=sr.binaryOptions;On.boolOptions=sr.boolOptions;On.intOptions=sr.intOptions;On.nullOptions=sr.nullOptions;On.strOptions=sr.strOptions;On.Schema=oO.Schema});var cf=X((pZ,dN)=>{"use strict";function sn(t){this.__parent=t,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}sn.prototype.clone_empty=function(){var t=new sn(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t};sn.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]};sn.prototype.has_match=function(t){for(var e=this.__items.length-1;e>=0;e--)if(this.__items[e].match(t))return!0;return!1};sn.prototype.set_indent=function(t,e){this.is_empty()&&(this.__indent_count=t||0,this.__alignment_count=e||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))};sn.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)};sn.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count};sn.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,t.__items[0]===" "&&(t.__items.splice(0,1),t.__character_count-=1),!0}return!1};sn.prototype.is_empty=function(){return this.__items.length===0};sn.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]};sn.prototype.push=function(t){this.__items.push(t);var e=t.lastIndexOf(` `);e!==-1?this.__character_count=t.length-e:this.__character_count+=t.length};sn.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t};sn.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)};sn.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)};sn.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1};sn.prototype.toString=function(){var t="";return this.is_empty()?this.__parent.indent_empty_lines&&(t=this.__parent.get_indent_string(this.__indent_count)):(t=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),t+=this.__items.join("")),t};function ql(t,e){this.__cache=[""],this.__indent_size=t.indent_size,this.__indent_string=t.indent_char,t.indent_with_tabs||(this.__indent_string=new Array(t.indent_size+1).join(t.indent_char)),e=e||"",t.indent_level>0&&(e=new Array(t.indent_level+1).join(this.__indent_string)),this.__base_string=e,this.__base_string_length=e.length}ql.prototype.get_indent_size=function(t,e){var n=this.__base_string_length;return e=e||0,t<0&&(n=0),n+=t*this.__indent_size,n+=e,n};ql.prototype.get_indent_string=function(t,e){var n=this.__base_string;return e=e||0,t<0&&(t=0,n=""),e+=t*this.__indent_size,this.__ensure_cache(e),n+=this.__cache[e],n};ql.prototype.__ensure_cache=function(t){for(;t>=this.__cache.length;)this.__add_column()};ql.prototype.__add_column=function(){var t=this.__cache.length,e=0,n="";this.__indent_size&&t>=this.__indent_size&&(e=Math.floor(t/this.__indent_size),t-=e*this.__indent_size,n=new Array(e+1).join(this.__indent_string)),t&&(n+=new Array(t+1).join(" ")),this.__cache.push(n)};function an(t,e){this.__indent_cache=new ql(t,e),this.raw=!1,this._end_with_newline=t.end_with_newline,this.indent_size=t.indent_size,this.wrap_line_length=t.wrap_line_length,this.indent_empty_lines=t.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new sn(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}an.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)};an.prototype.get_line_number=function(){return this.__lines.length};an.prototype.get_indent_string=function(t,e){return this.__indent_cache.get_indent_string(t,e)};an.prototype.get_indent_size=function(t,e){return this.__indent_cache.get_indent_size(t,e)};an.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()};an.prototype.add_new_line=function(t){return this.is_empty()||!t&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)};an.prototype.get_code=function(t){this.trim(!0);var e=this.current_line.pop();e&&(e[e.length-1]===` `&&(e=e.replace(/\n+$/g,"")),this.current_line.push(e)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join(` `);return t!==` -`&&(n=n.replace(/[\n]/g,t)),n};an.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()};an.prototype.set_indent=function(t,e){return t=t||0,e=e||0,this.next_line.set_indent(t,e),this.__lines.length>1?(this.current_line.set_indent(t,e),!0):(this.current_line.set_indent(),!1)};an.prototype.add_raw_token=function(t){for(var e=0;e1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null};an.prototype.just_added_newline=function(){return this.current_line.is_empty()};an.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()};an.prototype.ensure_empty_line_above=function(t,e){for(var n=this.__lines.length-2;n>=0;){var r=this.__lines[n];if(r.is_empty())break;if(r.item(0).indexOf(t)!==0&&r.item(-1)!==e){this.__lines.splice(n+1,0,new sn(this)),this.previous_line=this.__lines[this.__lines.length-2];break}n--}};pN.exports.Output=an});var Wh=X((lZ,dN)=>{"use strict";function xL(t,e,n,r){this.type=t,this.text=e,this.comments_before=null,this.newlines=n||0,this.whitespace_before=r||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}dN.exports.Token=xL});var Yh=X(Gi=>{"use strict";var RL="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",hN="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",Gh="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",mN="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",gN="(?:\\\\u[0-9a-fA-F]{4}|["+RL+Gh+"])",wL="(?:\\\\u[0-9a-fA-F]{4}|["+hN+Gh+mN+"])*";Gi.identifier=new RegExp(gN+wL,"g");Gi.identifierStart=new RegExp(gN);Gi.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+hN+Gh+mN+"])+");Gi.newline=/[\n\r\u2028\u2029]/;Gi.lineBreak=new RegExp(`\r -|`+Gi.newline.source);Gi.allLineBreaks=new RegExp(Gi.lineBreak.source,"g")});var pf=X((cZ,ff)=>{"use strict";function Ns(t,e){this.raw_options=_N(t,e),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}Ns.prototype._get_array=function(t,e){var n=this.raw_options[t],r=e||[];return typeof n=="object"?n!==null&&typeof n.concat=="function"&&(r=n.concat()):typeof n=="string"&&(r=n.split(/[^a-zA-Z0-9_\/\-]+/)),r};Ns.prototype._get_boolean=function(t,e){var n=this.raw_options[t],r=n===void 0?!!e:!!n;return r};Ns.prototype._get_characters=function(t,e){var n=this.raw_options[t],r=e||"";return typeof n=="string"&&(r=n.replace(/\\r/,"\r").replace(/\\n/,` +`&&(n=n.replace(/[\n]/g,t)),n};an.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()};an.prototype.set_indent=function(t,e){return t=t||0,e=e||0,this.next_line.set_indent(t,e),this.__lines.length>1?(this.current_line.set_indent(t,e),!0):(this.current_line.set_indent(),!1)};an.prototype.add_raw_token=function(t){for(var e=0;e1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null};an.prototype.just_added_newline=function(){return this.current_line.is_empty()};an.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()};an.prototype.ensure_empty_line_above=function(t,e){for(var n=this.__lines.length-2;n>=0;){var r=this.__lines[n];if(r.is_empty())break;if(r.item(0).indexOf(t)!==0&&r.item(-1)!==e){this.__lines.splice(n+1,0,new sn(this)),this.previous_line=this.__lines[this.__lines.length-2];break}n--}};dN.exports.Output=an});var Wh=X((dZ,hN)=>{"use strict";function wL(t,e,n,r){this.type=t,this.text=e,this.comments_before=null,this.newlines=n||0,this.whitespace_before=r||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}hN.exports.Token=wL});var Yh=X(Gi=>{"use strict";var OL="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",mN="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",Gh="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",gN="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",_N="(?:\\\\u[0-9a-fA-F]{4}|["+OL+Gh+"])",LL="(?:\\\\u[0-9a-fA-F]{4}|["+mN+Gh+gN+"])*";Gi.identifier=new RegExp(_N+LL,"g");Gi.identifierStart=new RegExp(_N);Gi.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+mN+Gh+gN+"])+");Gi.newline=/[\n\r\u2028\u2029]/;Gi.lineBreak=new RegExp(`\r +|`+Gi.newline.source);Gi.allLineBreaks=new RegExp(Gi.lineBreak.source,"g")});var pf=X((mZ,ff)=>{"use strict";function Ns(t,e){this.raw_options=yN(t,e),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}Ns.prototype._get_array=function(t,e){var n=this.raw_options[t],r=e||[];return typeof n=="object"?n!==null&&typeof n.concat=="function"&&(r=n.concat()):typeof n=="string"&&(r=n.split(/[^a-zA-Z0-9_\/\-]+/)),r};Ns.prototype._get_boolean=function(t,e){var n=this.raw_options[t],r=n===void 0?!!e:!!n;return r};Ns.prototype._get_characters=function(t,e){var n=this.raw_options[t],r=e||"";return typeof n=="string"&&(r=n.replace(/\\r/,"\r").replace(/\\n/,` `).replace(/\\t/," ")),r};Ns.prototype._get_number=function(t,e){var n=this.raw_options[t];e=parseInt(e,10),isNaN(e)&&(e=0);var r=parseInt(n,10);return isNaN(r)&&(r=e),r};Ns.prototype._get_selection=function(t,e,n){var r=this._get_selection_list(t,e,n);if(r.length!==1)throw new Error("Invalid Option Value: The option '"+t+`' can only be one of the following values: `+e+` You passed in: '`+this.raw_options[t]+"'");return r[0]};Ns.prototype._get_selection_list=function(t,e,n){if(!e||e.length===0)throw new Error("Selection list cannot be empty.");if(n=n||[e[0]],!this._is_valid_selection(n,e))throw new Error("Invalid Default Value!");var r=this._get_array(t,n);if(!this._is_valid_selection(r,e))throw new Error("Invalid Option Value: The option '"+t+`' can contain only the following values: `+e+` -You passed in: '`+this.raw_options[t]+"'");return r};Ns.prototype._is_valid_selection=function(t,e){return t.length&&e.length&&!t.some(function(n){return e.indexOf(n)===-1})};function _N(t,e){var n={};t=yN(t);var r;for(r in t)r!==e&&(n[r]=t[r]);if(e&&t[e])for(r in t[e])n[r]=t[e][r];return n}function yN(t){var e={},n;for(n in t){var r=n.replace(/-/g,"_");e[r]=t[n]}return e}ff.exports.Options=Ns;ff.exports.normalizeOpts=yN;ff.exports.mergeOpts=_N});var Hh=X((fZ,vN)=>{"use strict";var bN=pf().Options,OL=["before-newline","after-newline","preserve-newline"];function TN(t){bN.call(this,t,"js");var e=this.raw_options.brace_style||null;e==="expand-strict"?this.raw_options.brace_style="expand":e==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var n=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var r=0;r{"use strict";var NN=RegExp.prototype.hasOwnProperty("sticky");function dn(t){this.__input=t||"",this.__input_length=this.__input.length,this.__position=0}dn.prototype.restart=function(){this.__position=0};dn.prototype.back=function(){this.__position>0&&(this.__position-=1)};dn.prototype.hasNext=function(){return this.__position=0&&t=0&&e=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t};CN.exports.InputScanner=dn});var AN=X((dZ,PN)=>{"use strict";function ra(t){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=t}ra.prototype.restart=function(){this.__position=0};ra.prototype.isEmpty=function(){return this.__tokens_length===0};ra.prototype.hasNext=function(){return this.__position=0&&t{"use strict";function Ni(t,e){this._input=t,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,e&&(this._starting_pattern=this._input.get_regexp(e._starting_pattern,!0),this._match_pattern=this._input.get_regexp(e._match_pattern,!0),this._until_pattern=this._input.get_regexp(e._until_pattern),this._until_after=e._until_after)}Ni.prototype.read=function(){var t=this._input.read(this._starting_pattern);return(!this._starting_pattern||t)&&(t+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),t};Ni.prototype.read_match=function(){return this._input.match(this._match_pattern)};Ni.prototype.until_after=function(t){var e=this._create();return e._until_after=!0,e._until_pattern=this._input.get_regexp(t),e._update(),e};Ni.prototype.until=function(t){var e=this._create();return e._until_after=!1,e._until_pattern=this._input.get_regexp(t),e._update(),e};Ni.prototype.starting_with=function(t){var e=this._create();return e._starting_pattern=this._input.get_regexp(t,!0),e._update(),e};Ni.prototype.matching=function(t){var e=this._create();return e._match_pattern=this._input.get_regexp(t,!0),e._update(),e};Ni.prototype._create=function(){return new Ni(this._input,this)};Ni.prototype._update=function(){};SN.exports.Pattern=Ni});var DN=X((mZ,IN)=>{"use strict";var EN=Vl().Pattern;function Cs(t,e){EN.call(this,t,e),e?this._line_regexp=this._input.get_regexp(e._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}Cs.prototype=new EN;Cs.prototype.__set_whitespace_patterns=function(t,e){t+="\\t ",e+="\\n\\r",this._match_pattern=this._input.get_regexp("["+t+e+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+e+"]")};Cs.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var t=this._input.read(this._match_pattern);if(t===" ")this.whitespace_before_token=" ";else if(t){var e=this.__split(this._newline_regexp,t);this.newline_count=e.length-1,this.whitespace_before_token=e[this.newline_count]}return t};Cs.prototype.matching=function(t,e){var n=this._create();return n.__set_whitespace_patterns(t,e),n._update(),n};Cs.prototype._create=function(){return new Cs(this._input,this)};Cs.prototype.__split=function(t,e){t.lastIndex=0;for(var n=0,r=[],i=t.exec(e);i;)r.push(e.substring(n,i.index)),n=i.index+i[0].length,i=t.exec(e);return n{"use strict";var LL=df().InputScanner,xN=Wh().Token,$h=AN().TokenStream,FL=DN().WhitespacePattern,jl={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},Ci=function(t,e){this._input=new LL(t),this._options=e||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new FL(this._input)};Ci.prototype.tokenize=function(){this._input.restart(),this.__tokens=new $h,this._reset();for(var t,e=new xN(jl.START,""),n=null,r=[],i=new $h;e.type!==jl.EOF;){for(t=this._get_next_token(e,n);this._is_comment(t);)i.add(t),t=this._get_next_token(e,n);i.isEmpty()||(t.comments_before=i,i=new $h),t.parent=n,this._is_opening(t)?(r.push(n),n=t):n&&this._is_closing(t,n)&&(t.opened=n,n.closed=t,n=r.pop(),t.parent=n),t.previous=e,e.next=t,this.__tokens.add(t),e=t}return this.__tokens};Ci.prototype._is_first_token=function(){return this.__tokens.isEmpty()};Ci.prototype._reset=function(){};Ci.prototype._get_next_token=function(t,e){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(jl.RAW,n):this._create_token(jl.EOF,"")};Ci.prototype._is_comment=function(t){return!1};Ci.prototype._is_opening=function(t){return!1};Ci.prototype._is_closing=function(t,e){return!1};Ci.prototype._create_token=function(t,e){var n=new xN(t,e,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return n};Ci.prototype._readWhitespace=function(){return this._patterns.whitespace.read()};Kh.exports.Tokenizer=Ci;Kh.exports.TOKEN=jl});var hf=X((_Z,RN)=>{"use strict";function zh(t,e){t=typeof t=="string"?t:t.source,e=typeof e=="string"?e:e.source,this.__directives_block_pattern=new RegExp(t+/ beautify( \w+[:]\w+)+ /.source+e,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(t+/\sbeautify\signore:end\s/.source+e,"g")}zh.prototype.get_directives=function(t){if(!t.match(this.__directives_block_pattern))return null;var e={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(t);n;)e[n[1]]=n[2],n=this.__directive_pattern.exec(t);return e};zh.prototype.readIgnored=function(t){return t.readUntilAfter(this.__directives_end_ignore_pattern)};RN.exports.Directives=zh});var Jh=X((yZ,wN)=>{"use strict";var Xh=Vl().Pattern,Qh={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function si(t,e){Xh.call(this,t,e),this.__template_pattern=null,this._disabled=Object.assign({},Qh),this._excluded=Object.assign({},Qh),e&&(this.__template_pattern=this._input.get_regexp(e.__template_pattern),this._excluded=Object.assign(this._excluded,e._excluded),this._disabled=Object.assign(this._disabled,e._disabled));var n=new Xh(t);this.__patterns={handlebars_comment:n.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:n.starting_with(/{{{/).until_after(/}}}/),handlebars:n.starting_with(/{{/).until_after(/}}/),php:n.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/),smarty:n.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:n.starting_with(/{\*/).until_after(/\*}/),smarty_literal:n.starting_with(/{literal}/).until_after(/{\/literal}/)}}si.prototype=new Xh;si.prototype._create=function(){return new si(this._input,this)};si.prototype._update=function(){this.__set_templated_pattern()};si.prototype.disable=function(t){var e=this._create();return e._disabled[t]=!0,e._update(),e};si.prototype.read_options=function(t){var e=this._create();for(var n in Qh)e._disabled[n]=t.templating.indexOf(n)===-1;return e._update(),e};si.prototype.exclude=function(t){var e=this._create();return e._excluded[t]=!0,e._update(),e};si.prototype.read=function(){var t="";this._match_pattern?t=this._input.read(this._starting_pattern):t=this._input.read(this._starting_pattern,this.__template_pattern);for(var e=this._read_template();e;)this._match_pattern?e+=this._input.read(this._match_pattern):e+=this._input.readUntil(this.__template_pattern),t+=e,e=this._read_template();return this._until_after&&(t+=this._input.readUntilAfter(this._until_pattern)),t};si.prototype.__set_templated_pattern=function(){var t=[];this._disabled.php||t.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||t.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(t.push(this.__patterns.django._starting_pattern.source),t.push(this.__patterns.django_value._starting_pattern.source),t.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||t.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&t.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+t.join("|")+")")};si.prototype._read_template=function(){var t="",e=this._input.peek();if(e==="<"){var n=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&n==="?"&&(t=t||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&n==="%"&&(t=t||this.__patterns.erb.read())}else e==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(t=t||this.__patterns.handlebars_comment.read(),t=t||this.__patterns.handlebars_unescaped.read(),t=t||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(t=t||this.__patterns.django_value.read()),this._excluded.django||(t=t||this.__patterns.django_comment.read(),t=t||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(t=t||this.__patterns.smarty_comment.read(),t=t||this.__patterns.smarty_literal.read(),t=t||this.__patterns.smarty.read()));return t};wN.exports.TemplatablePattern=si});var Gl=X((bZ,Wl)=>{"use strict";var kL=df().InputScanner,ON=Ul().Tokenizer,Zh=Ul().TOKEN,ML=hf().Directives,Pr=Yh(),BL=Vl().Pattern,qL=Jh().TemplatablePattern;function em(t,e){return e.indexOf(t)!==-1}var Se={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:Zh.START,RAW:Zh.RAW,EOF:Zh.EOF},LN=new ML(/\/\*/,/\*\//),VL=/0[xX][0123456789abcdefABCDEF]*|0[oO][01234567]*|0[bB][01]*|\d+n|(?:\.\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?/,jL=/[0-9]/,UL=/[^\d\.]/,WL=">>> === !== << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),ia=">>>= ... >>= <<= === >>> !== **= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";ia=ia.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&");ia="\\?\\.(?!\\d) "+ia;ia=ia.replace(/ /g,"|");var GL=new RegExp(ia),FN="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),YL=FN.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as"]),HL=new RegExp("^(?:"+YL.join("|")+")$"),mf,hn=function(t,e){ON.call(this,t,e),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var n=new BL(this._input),r=new qL(this._input).read_options(this._options);this.__patterns={template:r,identifier:r.starting_with(Pr.identifier).matching(Pr.identifierMatch),number:n.matching(VL),punct:n.matching(GL),comment:n.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:n.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:n.matching(//),include:n.starting_with(/#include/).until_after(Pr.lineBreak),shebang:n.starting_with(/#!/).until_after(Pr.lineBreak),xml:n.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\]|)(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/),single_quote:r.until(/['\\\n\r\u2028\u2029]/),double_quote:r.until(/["\\\n\r\u2028\u2029]/),template_text:r.until(/[`\\$]/),template_expression:r.until(/[`}\\]/)}};hn.prototype=new ON;hn.prototype._is_comment=function(t){return t.type===Se.COMMENT||t.type===Se.BLOCK_COMMENT||t.type===Se.UNKNOWN};hn.prototype._is_opening=function(t){return t.type===Se.START_BLOCK||t.type===Se.START_EXPR};hn.prototype._is_closing=function(t,e){return(t.type===Se.END_BLOCK||t.type===Se.END_EXPR)&&e&&(t.text==="]"&&e.text==="["||t.text===")"&&e.text==="("||t.text==="}"&&e.text==="{")};hn.prototype._reset=function(){mf=!1};hn.prototype._get_next_token=function(t,e){var n=null;this._readWhitespace();var r=this._input.peek();return r===null?this._create_token(Se.EOF,""):(n=n||this._read_non_javascript(r),n=n||this._read_string(r),n=n||this._read_word(t),n=n||this._read_singles(r),n=n||this._read_comment(r),n=n||this._read_regexp(r,t),n=n||this._read_xml(r,t),n=n||this._read_punctuation(),n=n||this._create_token(Se.UNKNOWN,this._input.next()),n)};hn.prototype._read_word=function(t){var e;if(e=this.__patterns.identifier.read(),e!=="")return e=e.replace(Pr.allLineBreaks,` -`),!(t.type===Se.DOT||t.type===Se.RESERVED&&(t.text==="set"||t.text==="get"))&&HL.test(e)?e==="in"||e==="of"?this._create_token(Se.OPERATOR,e):this._create_token(Se.RESERVED,e):this._create_token(Se.WORD,e);if(e=this.__patterns.number.read(),e!=="")return this._create_token(Se.WORD,e)};hn.prototype._read_singles=function(t){var e=null;return t==="("||t==="["?e=this._create_token(Se.START_EXPR,t):t===")"||t==="]"?e=this._create_token(Se.END_EXPR,t):t==="{"?e=this._create_token(Se.START_BLOCK,t):t==="}"?e=this._create_token(Se.END_BLOCK,t):t===";"?e=this._create_token(Se.SEMICOLON,t):t==="."&&UL.test(this._input.peek(1))?e=this._create_token(Se.DOT,t):t===","&&(e=this._create_token(Se.COMMA,t)),e&&this._input.next(),e};hn.prototype._read_punctuation=function(){var t=this.__patterns.punct.read();if(t!=="")return t==="="?this._create_token(Se.EQUALS,t):t==="?."?this._create_token(Se.DOT,t):this._create_token(Se.OPERATOR,t)};hn.prototype._read_non_javascript=function(t){var e="";if(t==="#"){if(this._is_first_token()&&(e=this.__patterns.shebang.read(),e))return this._create_token(Se.UNKNOWN,e.trim()+` -`);if(e=this.__patterns.include.read(),e)return this._create_token(Se.UNKNOWN,e.trim()+` -`);t=this._input.next();var n="#";if(this._input.hasNext()&&this._input.testChar(jL)){do t=this._input.next(),n+=t;while(this._input.hasNext()&&t!=="#"&&t!=="=");return t==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(n+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(n+="{}",this._input.next(),this._input.next())),this._create_token(Se.WORD,n)}this._input.back()}else if(t==="<"&&this._is_first_token()){if(e=this.__patterns.html_comment_start.read(),e){for(;this._input.hasNext()&&!this._input.testChar(Pr.newline);)e+=this._input.next();return mf=!0,this._create_token(Se.COMMENT,e)}}else if(mf&&t==="-"&&(e=this.__patterns.html_comment_end.read(),e))return mf=!1,this._create_token(Se.COMMENT,e);return null};hn.prototype._read_comment=function(t){var e=null;if(t==="/"){var n="";if(this._input.peek(1)==="*"){n=this.__patterns.block_comment.read();var r=LN.get_directives(n);r&&r.ignore==="start"&&(n+=LN.readIgnored(this._input)),n=n.replace(Pr.allLineBreaks,` -`),e=this._create_token(Se.BLOCK_COMMENT,n),e.directives=r}else this._input.peek(1)==="/"&&(n=this.__patterns.comment.read(),e=this._create_token(Se.COMMENT,n))}return e};hn.prototype._read_string=function(t){if(t==="`"||t==="'"||t==='"'){var e=this._input.next();return this.has_char_escapes=!1,t==="`"?e+=this._read_string_recursive("`",!0,"${"):e+=this._read_string_recursive(t),this.has_char_escapes&&this._options.unescape_strings&&(e=$L(e)),this._input.peek()===t&&(e+=this._input.next()),e=e.replace(Pr.allLineBreaks,` -`),this._create_token(Se.STRING,e)}return null};hn.prototype._allow_regexp_or_xml=function(t){return t.type===Se.RESERVED&&em(t.text,["return","case","throw","else","do","typeof","yield"])||t.type===Se.END_EXPR&&t.text===")"&&t.opened.previous.type===Se.RESERVED&&em(t.opened.previous.text,["if","while","for"])||em(t.type,[Se.COMMENT,Se.START_EXPR,Se.START_BLOCK,Se.START,Se.END_BLOCK,Se.OPERATOR,Se.EQUALS,Se.EOF,Se.SEMICOLON,Se.COMMA])};hn.prototype._read_regexp=function(t,e){if(t==="/"&&this._allow_regexp_or_xml(e)){for(var n=this._input.next(),r=!1,i=!1;this._input.hasNext()&&(r||i||this._input.peek()!==t)&&!this._input.testChar(Pr.newline);)n+=this._input.peek(),r?r=!1:(r=this._input.peek()==="\\",this._input.peek()==="["?i=!0:this._input.peek()==="]"&&(i=!1)),this._input.next();return this._input.peek()===t&&(n+=this._input.next(),n+=this._input.read(Pr.identifier)),this._create_token(Se.STRING,n)}return null};hn.prototype._read_xml=function(t,e){if(this._options.e4x&&t==="<"&&this._allow_regexp_or_xml(e)){var n="",r=this.__patterns.xml.read_match();if(r){for(var i=r[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),s=i.indexOf("{")===0,a=0;r;){var o=!!r[1],l=r[2],u=!!r[r.length-1]||l.slice(0,8)==="![CDATA[";if(!u&&(l===i||s&&l.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(o?--a:++a),n+=r[0],a<=0)break;r=this.__patterns.xml.read_match()}return r||(n+=this._input.match(/[\s\S]*/g)[0]),n=n.replace(Pr.allLineBreaks,` -`),this._create_token(Se.STRING,n)}}return null};function $L(t){for(var e="",n=0,r=new kL(t),i=null;r.hasNext();)if(i=r.match(/([\s]|[^\\]|\\\\)+/g),i&&(e+=i[0]),r.peek()==="\\"){if(r.next(),r.peek()==="x")i=r.match(/x([0-9A-Fa-f]{2})/g);else if(r.peek()==="u")i=r.match(/u([0-9A-Fa-f]{4})/g);else{e+="\\",r.hasNext()&&(e+=r.next());continue}if(!i||(n=parseInt(i[1],16),n>126&&n<=255&&i[0].indexOf("x")===0))return t;if(n>=0&&n<32){e+="\\"+i[0];continue}else n===34||n===39||n===92?e+="\\"+String.fromCharCode(n):e+=String.fromCharCode(n)}return e}hn.prototype._read_string_recursive=function(t,e,n){var r,i;t==="'"?i=this.__patterns.single_quote:t==='"'?i=this.__patterns.double_quote:t==="`"?i=this.__patterns.template_text:t==="}"&&(i=this.__patterns.template_expression);for(var s=i.read(),a="";this._input.hasNext();){if(a=this._input.next(),a===t||!e&&Pr.newline.test(a)){this._input.back();break}else a==="\\"&&this._input.hasNext()?(r=this._input.peek(),r==="x"||r==="u"?this.has_char_escapes=!0:r==="\r"&&this._input.peek(1)===` -`&&this._input.next(),a+=this._input.next()):n&&(n==="${"&&a==="$"&&this._input.peek()==="{"&&(a+=this._input.next()),n===a&&(t==="`"?a+=this._read_string_recursive("}",e,"`"):a+=this._read_string_recursive("`",e,"${"),this._input.hasNext()&&(a+=this._input.next())));a+=i.read(),s+=a}return s};Wl.exports.Tokenizer=hn;Wl.exports.TOKEN=Se;Wl.exports.positionable_operators=WL.slice();Wl.exports.line_starters=FN.slice()});var qN=X((TZ,BN)=>{"use strict";var KL=cf().Output,zL=Wh().Token,gf=Yh(),XL=Hh().Options,QL=Gl().Tokenizer,Yl=Gl().line_starters,Hl=Gl().positionable_operators,U=Gl().TOKEN;function Ye(t,e){return e.indexOf(t)!==-1}function JL(t){return t.replace(/^\s+/g,"")}function ZL(t){for(var e={},n=0;n{"use strict";var TN=pf().Options,FL=["before-newline","after-newline","preserve-newline"];function vN(t){TN.call(this,t,"js");var e=this.raw_options.brace_style||null;e==="expand-strict"?this.raw_options.brace_style="expand":e==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var n=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var r=0;r{"use strict";var CN=RegExp.prototype.hasOwnProperty("sticky");function dn(t){this.__input=t||"",this.__input_length=this.__input.length,this.__position=0}dn.prototype.restart=function(){this.__position=0};dn.prototype.back=function(){this.__position>0&&(this.__position-=1)};dn.prototype.hasNext=function(){return this.__position=0&&t=0&&e=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t};PN.exports.InputScanner=dn});var AN=X((yZ,SN)=>{"use strict";function ra(t){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=t}ra.prototype.restart=function(){this.__position=0};ra.prototype.isEmpty=function(){return this.__tokens_length===0};ra.prototype.hasNext=function(){return this.__position=0&&t{"use strict";function Ni(t,e){this._input=t,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,e&&(this._starting_pattern=this._input.get_regexp(e._starting_pattern,!0),this._match_pattern=this._input.get_regexp(e._match_pattern,!0),this._until_pattern=this._input.get_regexp(e._until_pattern),this._until_after=e._until_after)}Ni.prototype.read=function(){var t=this._input.read(this._starting_pattern);return(!this._starting_pattern||t)&&(t+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),t};Ni.prototype.read_match=function(){return this._input.match(this._match_pattern)};Ni.prototype.until_after=function(t){var e=this._create();return e._until_after=!0,e._until_pattern=this._input.get_regexp(t),e._update(),e};Ni.prototype.until=function(t){var e=this._create();return e._until_after=!1,e._until_pattern=this._input.get_regexp(t),e._update(),e};Ni.prototype.starting_with=function(t){var e=this._create();return e._starting_pattern=this._input.get_regexp(t,!0),e._update(),e};Ni.prototype.matching=function(t){var e=this._create();return e._match_pattern=this._input.get_regexp(t,!0),e._update(),e};Ni.prototype._create=function(){return new Ni(this._input,this)};Ni.prototype._update=function(){};EN.exports.Pattern=Ni});var xN=X((TZ,DN)=>{"use strict";var IN=Vl().Pattern;function Cs(t,e){IN.call(this,t,e),e?this._line_regexp=this._input.get_regexp(e._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}Cs.prototype=new IN;Cs.prototype.__set_whitespace_patterns=function(t,e){t+="\\t ",e+="\\n\\r",this._match_pattern=this._input.get_regexp("["+t+e+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+e+"]")};Cs.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var t=this._input.read(this._match_pattern);if(t===" ")this.whitespace_before_token=" ";else if(t){var e=this.__split(this._newline_regexp,t);this.newline_count=e.length-1,this.whitespace_before_token=e[this.newline_count]}return t};Cs.prototype.matching=function(t,e){var n=this._create();return n.__set_whitespace_patterns(t,e),n._update(),n};Cs.prototype._create=function(){return new Cs(this._input,this)};Cs.prototype.__split=function(t,e){t.lastIndex=0;for(var n=0,r=[],i=t.exec(e);i;)r.push(e.substring(n,i.index)),n=i.index+i[0].length,i=t.exec(e);return n{"use strict";var kL=df().InputScanner,RN=Wh().Token,$h=AN().TokenStream,ML=xN().WhitespacePattern,jl={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},Ci=function(t,e){this._input=new kL(t),this._options=e||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new ML(this._input)};Ci.prototype.tokenize=function(){this._input.restart(),this.__tokens=new $h,this._reset();for(var t,e=new RN(jl.START,""),n=null,r=[],i=new $h;e.type!==jl.EOF;){for(t=this._get_next_token(e,n);this._is_comment(t);)i.add(t),t=this._get_next_token(e,n);i.isEmpty()||(t.comments_before=i,i=new $h),t.parent=n,this._is_opening(t)?(r.push(n),n=t):n&&this._is_closing(t,n)&&(t.opened=n,n.closed=t,n=r.pop(),t.parent=n),t.previous=e,e.next=t,this.__tokens.add(t),e=t}return this.__tokens};Ci.prototype._is_first_token=function(){return this.__tokens.isEmpty()};Ci.prototype._reset=function(){};Ci.prototype._get_next_token=function(t,e){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(jl.RAW,n):this._create_token(jl.EOF,"")};Ci.prototype._is_comment=function(t){return!1};Ci.prototype._is_opening=function(t){return!1};Ci.prototype._is_closing=function(t,e){return!1};Ci.prototype._create_token=function(t,e){var n=new RN(t,e,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return n};Ci.prototype._readWhitespace=function(){return this._patterns.whitespace.read()};Kh.exports.Tokenizer=Ci;Kh.exports.TOKEN=jl});var hf=X((NZ,wN)=>{"use strict";function zh(t,e){t=typeof t=="string"?t:t.source,e=typeof e=="string"?e:e.source,this.__directives_block_pattern=new RegExp(t+/ beautify( \w+[:]\w+)+ /.source+e,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(t+/\sbeautify\signore:end\s/.source+e,"g")}zh.prototype.get_directives=function(t){if(!t.match(this.__directives_block_pattern))return null;var e={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(t);n;)e[n[1]]=n[2],n=this.__directive_pattern.exec(t);return e};zh.prototype.readIgnored=function(t){return t.readUntilAfter(this.__directives_end_ignore_pattern)};wN.exports.Directives=zh});var Jh=X((CZ,ON)=>{"use strict";var Xh=Vl().Pattern,Qh={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function si(t,e){Xh.call(this,t,e),this.__template_pattern=null,this._disabled=Object.assign({},Qh),this._excluded=Object.assign({},Qh),e&&(this.__template_pattern=this._input.get_regexp(e.__template_pattern),this._excluded=Object.assign(this._excluded,e._excluded),this._disabled=Object.assign(this._disabled,e._disabled));var n=new Xh(t);this.__patterns={handlebars_comment:n.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:n.starting_with(/{{{/).until_after(/}}}/),handlebars:n.starting_with(/{{/).until_after(/}}/),php:n.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/),smarty:n.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:n.starting_with(/{\*/).until_after(/\*}/),smarty_literal:n.starting_with(/{literal}/).until_after(/{\/literal}/)}}si.prototype=new Xh;si.prototype._create=function(){return new si(this._input,this)};si.prototype._update=function(){this.__set_templated_pattern()};si.prototype.disable=function(t){var e=this._create();return e._disabled[t]=!0,e._update(),e};si.prototype.read_options=function(t){var e=this._create();for(var n in Qh)e._disabled[n]=t.templating.indexOf(n)===-1;return e._update(),e};si.prototype.exclude=function(t){var e=this._create();return e._excluded[t]=!0,e._update(),e};si.prototype.read=function(){var t="";this._match_pattern?t=this._input.read(this._starting_pattern):t=this._input.read(this._starting_pattern,this.__template_pattern);for(var e=this._read_template();e;)this._match_pattern?e+=this._input.read(this._match_pattern):e+=this._input.readUntil(this.__template_pattern),t+=e,e=this._read_template();return this._until_after&&(t+=this._input.readUntilAfter(this._until_pattern)),t};si.prototype.__set_templated_pattern=function(){var t=[];this._disabled.php||t.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||t.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(t.push(this.__patterns.django._starting_pattern.source),t.push(this.__patterns.django_value._starting_pattern.source),t.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||t.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&t.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+t.join("|")+")")};si.prototype._read_template=function(){var t="",e=this._input.peek();if(e==="<"){var n=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&n==="?"&&(t=t||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&n==="%"&&(t=t||this.__patterns.erb.read())}else e==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(t=t||this.__patterns.handlebars_comment.read(),t=t||this.__patterns.handlebars_unescaped.read(),t=t||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(t=t||this.__patterns.django_value.read()),this._excluded.django||(t=t||this.__patterns.django_comment.read(),t=t||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(t=t||this.__patterns.smarty_comment.read(),t=t||this.__patterns.smarty_literal.read(),t=t||this.__patterns.smarty.read()));return t};ON.exports.TemplatablePattern=si});var Gl=X((PZ,Wl)=>{"use strict";var BL=df().InputScanner,LN=Ul().Tokenizer,Zh=Ul().TOKEN,qL=hf().Directives,Pr=Yh(),VL=Vl().Pattern,jL=Jh().TemplatablePattern;function em(t,e){return e.indexOf(t)!==-1}var Ae={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:Zh.START,RAW:Zh.RAW,EOF:Zh.EOF},FN=new qL(/\/\*/,/\*\//),UL=/0[xX][0123456789abcdefABCDEF]*|0[oO][01234567]*|0[bB][01]*|\d+n|(?:\.\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?/,WL=/[0-9]/,GL=/[^\d\.]/,YL=">>> === !== << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),ia=">>>= ... >>= <<= === >>> !== **= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";ia=ia.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&");ia="\\?\\.(?!\\d) "+ia;ia=ia.replace(/ /g,"|");var HL=new RegExp(ia),kN="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),$L=kN.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as"]),KL=new RegExp("^(?:"+$L.join("|")+")$"),mf,hn=function(t,e){LN.call(this,t,e),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var n=new VL(this._input),r=new jL(this._input).read_options(this._options);this.__patterns={template:r,identifier:r.starting_with(Pr.identifier).matching(Pr.identifierMatch),number:n.matching(UL),punct:n.matching(HL),comment:n.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:n.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:n.matching(//),include:n.starting_with(/#include/).until_after(Pr.lineBreak),shebang:n.starting_with(/#!/).until_after(Pr.lineBreak),xml:n.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\]|)(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/),single_quote:r.until(/['\\\n\r\u2028\u2029]/),double_quote:r.until(/["\\\n\r\u2028\u2029]/),template_text:r.until(/[`\\$]/),template_expression:r.until(/[`}\\]/)}};hn.prototype=new LN;hn.prototype._is_comment=function(t){return t.type===Ae.COMMENT||t.type===Ae.BLOCK_COMMENT||t.type===Ae.UNKNOWN};hn.prototype._is_opening=function(t){return t.type===Ae.START_BLOCK||t.type===Ae.START_EXPR};hn.prototype._is_closing=function(t,e){return(t.type===Ae.END_BLOCK||t.type===Ae.END_EXPR)&&e&&(t.text==="]"&&e.text==="["||t.text===")"&&e.text==="("||t.text==="}"&&e.text==="{")};hn.prototype._reset=function(){mf=!1};hn.prototype._get_next_token=function(t,e){var n=null;this._readWhitespace();var r=this._input.peek();return r===null?this._create_token(Ae.EOF,""):(n=n||this._read_non_javascript(r),n=n||this._read_string(r),n=n||this._read_word(t),n=n||this._read_singles(r),n=n||this._read_comment(r),n=n||this._read_regexp(r,t),n=n||this._read_xml(r,t),n=n||this._read_punctuation(),n=n||this._create_token(Ae.UNKNOWN,this._input.next()),n)};hn.prototype._read_word=function(t){var e;if(e=this.__patterns.identifier.read(),e!=="")return e=e.replace(Pr.allLineBreaks,` +`),!(t.type===Ae.DOT||t.type===Ae.RESERVED&&(t.text==="set"||t.text==="get"))&&KL.test(e)?e==="in"||e==="of"?this._create_token(Ae.OPERATOR,e):this._create_token(Ae.RESERVED,e):this._create_token(Ae.WORD,e);if(e=this.__patterns.number.read(),e!=="")return this._create_token(Ae.WORD,e)};hn.prototype._read_singles=function(t){var e=null;return t==="("||t==="["?e=this._create_token(Ae.START_EXPR,t):t===")"||t==="]"?e=this._create_token(Ae.END_EXPR,t):t==="{"?e=this._create_token(Ae.START_BLOCK,t):t==="}"?e=this._create_token(Ae.END_BLOCK,t):t===";"?e=this._create_token(Ae.SEMICOLON,t):t==="."&&GL.test(this._input.peek(1))?e=this._create_token(Ae.DOT,t):t===","&&(e=this._create_token(Ae.COMMA,t)),e&&this._input.next(),e};hn.prototype._read_punctuation=function(){var t=this.__patterns.punct.read();if(t!=="")return t==="="?this._create_token(Ae.EQUALS,t):t==="?."?this._create_token(Ae.DOT,t):this._create_token(Ae.OPERATOR,t)};hn.prototype._read_non_javascript=function(t){var e="";if(t==="#"){if(this._is_first_token()&&(e=this.__patterns.shebang.read(),e))return this._create_token(Ae.UNKNOWN,e.trim()+` +`);if(e=this.__patterns.include.read(),e)return this._create_token(Ae.UNKNOWN,e.trim()+` +`);t=this._input.next();var n="#";if(this._input.hasNext()&&this._input.testChar(WL)){do t=this._input.next(),n+=t;while(this._input.hasNext()&&t!=="#"&&t!=="=");return t==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(n+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(n+="{}",this._input.next(),this._input.next())),this._create_token(Ae.WORD,n)}this._input.back()}else if(t==="<"&&this._is_first_token()){if(e=this.__patterns.html_comment_start.read(),e){for(;this._input.hasNext()&&!this._input.testChar(Pr.newline);)e+=this._input.next();return mf=!0,this._create_token(Ae.COMMENT,e)}}else if(mf&&t==="-"&&(e=this.__patterns.html_comment_end.read(),e))return mf=!1,this._create_token(Ae.COMMENT,e);return null};hn.prototype._read_comment=function(t){var e=null;if(t==="/"){var n="";if(this._input.peek(1)==="*"){n=this.__patterns.block_comment.read();var r=FN.get_directives(n);r&&r.ignore==="start"&&(n+=FN.readIgnored(this._input)),n=n.replace(Pr.allLineBreaks,` +`),e=this._create_token(Ae.BLOCK_COMMENT,n),e.directives=r}else this._input.peek(1)==="/"&&(n=this.__patterns.comment.read(),e=this._create_token(Ae.COMMENT,n))}return e};hn.prototype._read_string=function(t){if(t==="`"||t==="'"||t==='"'){var e=this._input.next();return this.has_char_escapes=!1,t==="`"?e+=this._read_string_recursive("`",!0,"${"):e+=this._read_string_recursive(t),this.has_char_escapes&&this._options.unescape_strings&&(e=zL(e)),this._input.peek()===t&&(e+=this._input.next()),e=e.replace(Pr.allLineBreaks,` +`),this._create_token(Ae.STRING,e)}return null};hn.prototype._allow_regexp_or_xml=function(t){return t.type===Ae.RESERVED&&em(t.text,["return","case","throw","else","do","typeof","yield"])||t.type===Ae.END_EXPR&&t.text===")"&&t.opened.previous.type===Ae.RESERVED&&em(t.opened.previous.text,["if","while","for"])||em(t.type,[Ae.COMMENT,Ae.START_EXPR,Ae.START_BLOCK,Ae.START,Ae.END_BLOCK,Ae.OPERATOR,Ae.EQUALS,Ae.EOF,Ae.SEMICOLON,Ae.COMMA])};hn.prototype._read_regexp=function(t,e){if(t==="/"&&this._allow_regexp_or_xml(e)){for(var n=this._input.next(),r=!1,i=!1;this._input.hasNext()&&(r||i||this._input.peek()!==t)&&!this._input.testChar(Pr.newline);)n+=this._input.peek(),r?r=!1:(r=this._input.peek()==="\\",this._input.peek()==="["?i=!0:this._input.peek()==="]"&&(i=!1)),this._input.next();return this._input.peek()===t&&(n+=this._input.next(),n+=this._input.read(Pr.identifier)),this._create_token(Ae.STRING,n)}return null};hn.prototype._read_xml=function(t,e){if(this._options.e4x&&t==="<"&&this._allow_regexp_or_xml(e)){var n="",r=this.__patterns.xml.read_match();if(r){for(var i=r[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),s=i.indexOf("{")===0,a=0;r;){var o=!!r[1],l=r[2],u=!!r[r.length-1]||l.slice(0,8)==="![CDATA[";if(!u&&(l===i||s&&l.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(o?--a:++a),n+=r[0],a<=0)break;r=this.__patterns.xml.read_match()}return r||(n+=this._input.match(/[\s\S]*/g)[0]),n=n.replace(Pr.allLineBreaks,` +`),this._create_token(Ae.STRING,n)}}return null};function zL(t){for(var e="",n=0,r=new BL(t),i=null;r.hasNext();)if(i=r.match(/([\s]|[^\\]|\\\\)+/g),i&&(e+=i[0]),r.peek()==="\\"){if(r.next(),r.peek()==="x")i=r.match(/x([0-9A-Fa-f]{2})/g);else if(r.peek()==="u")i=r.match(/u([0-9A-Fa-f]{4})/g);else{e+="\\",r.hasNext()&&(e+=r.next());continue}if(!i||(n=parseInt(i[1],16),n>126&&n<=255&&i[0].indexOf("x")===0))return t;if(n>=0&&n<32){e+="\\"+i[0];continue}else n===34||n===39||n===92?e+="\\"+String.fromCharCode(n):e+=String.fromCharCode(n)}return e}hn.prototype._read_string_recursive=function(t,e,n){var r,i;t==="'"?i=this.__patterns.single_quote:t==='"'?i=this.__patterns.double_quote:t==="`"?i=this.__patterns.template_text:t==="}"&&(i=this.__patterns.template_expression);for(var s=i.read(),a="";this._input.hasNext();){if(a=this._input.next(),a===t||!e&&Pr.newline.test(a)){this._input.back();break}else a==="\\"&&this._input.hasNext()?(r=this._input.peek(),r==="x"||r==="u"?this.has_char_escapes=!0:r==="\r"&&this._input.peek(1)===` +`&&this._input.next(),a+=this._input.next()):n&&(n==="${"&&a==="$"&&this._input.peek()==="{"&&(a+=this._input.next()),n===a&&(t==="`"?a+=this._read_string_recursive("}",e,"`"):a+=this._read_string_recursive("`",e,"${"),this._input.hasNext()&&(a+=this._input.next())));a+=i.read(),s+=a}return s};Wl.exports.Tokenizer=hn;Wl.exports.TOKEN=Ae;Wl.exports.positionable_operators=YL.slice();Wl.exports.line_starters=kN.slice()});var VN=X((SZ,qN)=>{"use strict";var XL=cf().Output,QL=Wh().Token,gf=Yh(),JL=Hh().Options,ZL=Gl().Tokenizer,Yl=Gl().line_starters,Hl=Gl().positionable_operators,U=Gl().TOKEN;function Ye(t,e){return e.indexOf(t)!==-1}function eF(t){return t.replace(/^\s+/g,"")}function tF(t){for(var e={},n=0;nn&&(n=t.line_indent_level));var r={mode:e,parent:t,last_token:t?t.last_token:new zL(U.START_BLOCK,""),last_word:t?t.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:n,alignment:0,line_indent_level:t?t.line_indent_level:n,start_line_index:this._output.get_line_number(),ternary_depth:0};return r};Qe.prototype._reset=function(t){var e=t.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new KL(this._options,e),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(Ee.BlockStatement);var n=new QL(t,this._options);return this._tokens=n.tokenize(),t};Qe.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t,e=this._reset(this._source_text),n=this._options.eol;this._options.eol==="auto"&&(n=` -`,e&&gf.lineBreak.test(e||"")&&(n=e.match(gf.lineBreak)[0]));for(var r=this._tokens.next();r;)this.handle_token(r),this._last_last_text=this._flags.last_token.text,this._flags.last_token=r,r=this._tokens.next();return t=this._output.get_code(n),t};Qe.prototype.handle_token=function(t,e){t.type===U.START_EXPR?this.handle_start_expr(t):t.type===U.END_EXPR?this.handle_end_expr(t):t.type===U.START_BLOCK?this.handle_start_block(t):t.type===U.END_BLOCK?this.handle_end_block(t):t.type===U.WORD?this.handle_word(t):t.type===U.RESERVED?this.handle_word(t):t.type===U.SEMICOLON?this.handle_semicolon(t):t.type===U.STRING?this.handle_string(t):t.type===U.EQUALS?this.handle_equals(t):t.type===U.OPERATOR?this.handle_operator(t):t.type===U.COMMA?this.handle_comma(t):t.type===U.BLOCK_COMMENT?this.handle_block_comment(t,e):t.type===U.COMMENT?this.handle_comment(t,e):t.type===U.DOT?this.handle_dot(t):t.type===U.EOF?this.handle_eof(t):t.type===U.UNKNOWN?this.handle_unknown(t,e):this.handle_unknown(t,e)};Qe.prototype.handle_whitespace_and_comments=function(t,e){var n=t.newlines,r=this._options.keep_array_indentation&&Ps(this._flags.mode);if(t.comments_before)for(var i=t.comments_before.next();i;)this.handle_whitespace_and_comments(i,e),this.handle_token(i,e),i=t.comments_before.next();if(r)for(var s=0;s0,e);else if(this._options.max_preserve_newlines&&n>this._options.max_preserve_newlines&&(n=this._options.max_preserve_newlines),this._options.preserve_newlines&&n>1){this.print_newline(!1,e);for(var a=1;a0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))};Qe.prototype.set_mode=function(t){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,t),this._flags=this.create_flags(this._previous_flags,t),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)};Qe.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===Ee.Statement&&MN(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))};Qe.prototype.start_of_object_property=function(){return this._flags.parent.mode===Ee.ObjectLiteral&&this._flags.mode===Ee.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||ht(this._flags.last_token,["get","set"]))};Qe.prototype.start_of_statement=function(t){var e=!1;return e=e||ht(this._flags.last_token,["var","let","const"])&&t.type===U.WORD,e=e||Ar(this._flags.last_token,"do"),e=e||!(this._flags.parent.mode===Ee.ObjectLiteral&&this._flags.mode===Ee.Statement)&&ht(this._flags.last_token,tm)&&!t.newlines,e=e||Ar(this._flags.last_token,"else")&&!(Ar(t,"if")&&!t.comments_before),e=e||this._flags.last_token.type===U.END_EXPR&&(this._previous_flags.mode===Ee.ForInitializer||this._previous_flags.mode===Ee.Conditional),e=e||this._flags.last_token.type===U.WORD&&this._flags.mode===Ee.BlockStatement&&!this._flags.in_case&&!(t.text==="--"||t.text==="++")&&this._last_last_text!=="function"&&t.type!==U.WORD&&t.type!==U.RESERVED,e=e||this._flags.mode===Ee.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||ht(this._flags.last_token,["get","set"])),e?(this.set_mode(Ee.Statement),this.indent(),this.handle_whitespace_and_comments(t,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t,ht(t,["do","for","if","while"])),!0):!1};Qe.prototype.handle_start_expr=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t);var e=Ee.Expression;if(t.text==="["){if(this._flags.last_token.type===U.WORD||this._flags.last_token.text===")"){ht(this._flags.last_token,Yl)&&(this._output.space_before_token=!0),this.print_token(t),this.set_mode(e),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}e=Ee.ArrayLiteral,Ps(this._flags.mode)&&(this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline()),Ye(this._flags.last_token.type,[U.START_EXPR,U.END_EXPR,U.WORD,U.OPERATOR,U.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===U.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,e=Ee.ForInitializer):Ye(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,e=Ee.Conditional):Ye(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&t.whitespace_before===""?this._output.space_before_token=!1:(Ye(this._flags.last_token.text,Yl)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===U.EQUALS||this._flags.last_token.type===U.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t);else if(this._flags.last_token.type===U.WORD){this._output.space_before_token=!1;var n=this._tokens.peek(-3);if(this._options.space_after_named_function&&n){var r=this._tokens.peek(-4);ht(n,["async","function"])||n.text==="*"&&ht(r,["async","function"])?this._output.space_before_token=!0:this._flags.mode===Ee.ObjectLiteral&&(n.text==="{"||n.text===","||n.text==="*"&&(r.text==="{"||r.text===","))&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(t);(this._flags.last_token.type===U.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(Ye(this._last_last_text,["function","yield"])||this._flags.mode===Ee.ObjectLiteral&&Ye(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===U.START_BLOCK?this.print_newline():(this._flags.last_token.type===U.END_EXPR||this._flags.last_token.type===U.START_EXPR||this._flags.last_token.type===U.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===U.COMMA)&&this.allow_wrap_or_preserved_newline(t,t.newlines),this.print_token(t),this.set_mode(e),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()};Qe.prototype.handle_end_expr=function(t){for(;this._flags.mode===Ee.Statement;)this.restore_mode();this.handle_whitespace_and_comments(t),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(t,t.text==="]"&&Ps(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===U.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(t),this.restore_mode(),MN(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===Ee.Conditional&&(this._previous_flags.mode=Ee.Expression,this._flags.do_block=!1,this._flags.do_while=!1)};Qe.prototype.handle_start_block=function(t){this.handle_whitespace_and_comments(t);var e=this._tokens.peek(),n=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===U.END_EXPR?(this.set_mode(Ee.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(Ee.BlockStatement):n&&(Ye(n.text,[":",","])&&Ye(e.type,[U.STRING,U.WORD,U.RESERVED])||Ye(e.text,["get","set","..."])&&Ye(n.type,[U.WORD,U.RESERVED]))?Ye(this._last_last_text,["class","interface"])?this.set_mode(Ee.BlockStatement):this.set_mode(Ee.ObjectLiteral):this._flags.last_token.type===U.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(Ee.BlockStatement):Ye(this._flags.last_token.type,[U.EQUALS,U.START_EXPR,U.COMMA,U.OPERATOR])||ht(this._flags.last_token,["return","throw","import","default"])?this.set_mode(Ee.ObjectLiteral):this.set_mode(Ee.BlockStatement);var r=!e.comments_before&&e.text==="}",i=r&&this._flags.last_word==="function"&&this._flags.last_token.type===U.END_EXPR;if(this._options.brace_preserve_inline){var s=0,a=null;this._flags.inline_frame=!0;do if(s+=1,a=this._tokens.peek(s-1),a.newlines){this._flags.inline_frame=!1;break}while(a.type!==U.EOF&&!(a.type===U.END_BLOCK&&a.opened===t))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&t.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==U.OPERATOR&&(i||this._flags.last_token.type===U.EQUALS||ht(this._flags.last_token,_f)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(Ps(this._previous_flags.mode)&&(this._flags.last_token.type===U.START_EXPR||this._flags.last_token.type===U.COMMA)&&((this._flags.last_token.type===U.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===U.COMMA||this._flags.last_token.type===U.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(t),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==U.OPERATOR&&this._flags.last_token.type!==U.START_EXPR&&(this._flags.last_token.type===U.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(t),this.indent(),!r&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()};Qe.prototype.handle_end_block=function(t){for(this.handle_whitespace_and_comments(t);this._flags.mode===Ee.Statement;)this.restore_mode();var e=this._flags.last_token.type===U.START_BLOCK;this._flags.inline_frame&&!e?this._output.space_before_token=!0:this._options.brace_style==="expand"?e||this.print_newline():e||(Ps(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(t)};Qe.prototype.handle_word=function(t){if(t.type===U.RESERVED){if(Ye(t.text,["set","get"])&&this._flags.mode!==Ee.ObjectLiteral)t.type=U.WORD;else if(t.text==="import"&&this._tokens.peek().text==="(")t.type=U.WORD;else if(Ye(t.text,["as","from"])&&!this._flags.import_block)t.type=U.WORD;else if(this._flags.mode===Ee.ObjectLiteral){var e=this._tokens.peek();e.text===":"&&(t.type=U.WORD)}}if(this.start_of_statement(t)?ht(this._flags.last_token,["var","let","const"])&&t.type===U.WORD&&(this._flags.declaration_statement=!0):t.newlines&&!Kl(this._flags.mode)&&(this._flags.last_token.type!==U.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==U.EQUALS&&(this._options.preserve_newlines||!ht(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(t),this.print_newline()):this.handle_whitespace_and_comments(t),this._flags.do_block&&!this._flags.do_while)if(Ar(t,"while")){this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&Ar(t,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===Ee.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&ht(t,["case","default"])){this.print_newline(),this._flags.last_token.type!==U.END_BLOCK&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(t),this._flags.in_case=!0;return}if((this._flags.last_token.type===U.COMMA||this._flags.last_token.type===U.START_EXPR||this._flags.last_token.type===U.EQUALS||this._flags.last_token.type===U.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t)),Ar(t,"function")){(Ye(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(Ye(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===U.OPERATOR))&&!this._output.just_added_blankline()&&!t.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===U.RESERVED||this._flags.last_token.type===U.WORD?ht(this._flags.last_token,["get","set","new","export"])||ht(this._flags.last_token,tm)?this._output.space_before_token=!0:Ar(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===U.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(Kl(this._flags.mode)||Ps(this._flags.mode))||this.print_newline(),this.print_token(t),this._flags.last_word=t.text;return}var n="NONE";if(this._flags.last_token.type===U.END_BLOCK?this._previous_flags.inline_frame?n="SPACE":ht(t,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&t.newlines?n="NEWLINE":(n="SPACE",this._output.space_before_token=!0):n="NEWLINE":this._flags.last_token.type===U.SEMICOLON&&this._flags.mode===Ee.BlockStatement?n="NEWLINE":this._flags.last_token.type===U.SEMICOLON&&Kl(this._flags.mode)?n="SPACE":this._flags.last_token.type===U.STRING?n="NEWLINE":this._flags.last_token.type===U.RESERVED||this._flags.last_token.type===U.WORD||this._flags.last_token.text==="*"&&(Ye(this._last_last_text,["function","yield"])||this._flags.mode===Ee.ObjectLiteral&&Ye(this._last_last_text,["{",","]))?n="SPACE":this._flags.last_token.type===U.START_BLOCK?this._flags.inline_frame?n="SPACE":n="NEWLINE":this._flags.last_token.type===U.END_EXPR&&(this._output.space_before_token=!0,n="NEWLINE"),ht(t,Yl)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?n="SPACE":n="NEWLINE"),ht(t,["else","catch","finally"]))if((!(this._flags.last_token.type===U.END_BLOCK&&this._previous_flags.mode===Ee.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&t.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var r=this._output.current_line;r.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else n==="NEWLINE"?ht(this._flags.last_token,_f)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&ht(t,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==U.END_EXPR?(this._flags.last_token.type!==U.START_EXPR||!ht(t,["var","let","const"]))&&this._flags.last_token.text!==":"&&(Ar(t,"if")&&Ar(t.previous,"else")?this._output.space_before_token=!0:this.print_newline()):ht(t,Yl)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&Ps(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():n==="SPACE"&&(this._output.space_before_token=!0);t.previous&&(t.previous.type===U.WORD||t.previous.type===U.RESERVED)&&(this._output.space_before_token=!0),this.print_token(t),this._flags.last_word=t.text,t.type===U.RESERVED&&(t.text==="do"?this._flags.do_block=!0:t.text==="if"?this._flags.if_block=!0:t.text==="import"?this._flags.import_block=!0:this._flags.import_block&&Ar(t,"from")&&(this._flags.import_block=!1))};Qe.prototype.handle_semicolon=function(t){this.start_of_statement(t)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(t);for(var e=this._tokens.peek();this._flags.mode===Ee.Statement&&!(this._flags.if_block&&Ar(e,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(t)};Qe.prototype.handle_string=function(t){t.text.startsWith("`")&&t.newlines===0&&t.whitespace_before===""&&(t.previous.text===")"||this._flags.last_token.type===U.WORD)||(this.start_of_statement(t)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(t),this._flags.last_token.type===U.RESERVED||this._flags.last_token.type===U.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===U.COMMA||this._flags.last_token.type===U.START_EXPR||this._flags.last_token.type===U.EQUALS||this._flags.last_token.type===U.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t):t.text.startsWith("`")&&this._flags.last_token.type===U.END_EXPR&&(t.previous.text==="]"||t.previous.text===")")&&t.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(t)};Qe.prototype.handle_equals=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0};Qe.prototype.handle_comma=function(t){this.handle_whitespace_and_comments(t,!0),this.print_token(t),this._output.space_before_token=!0,this._flags.declaration_statement?(Kl(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)):this._flags.mode===Ee.ObjectLiteral||this._flags.mode===Ee.Statement&&this._flags.parent.mode===Ee.ObjectLiteral?(this._flags.mode===Ee.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)};Qe.prototype.handle_operator=function(t){var e=t.text==="*"&&(ht(this._flags.last_token,["function","yield"])||Ye(this._flags.last_token.type,[U.START_BLOCK,U.COMMA,U.END_BLOCK,U.SEMICOLON])),n=Ye(t.text,["-","+"])&&(Ye(this._flags.last_token.type,[U.START_BLOCK,U.START_EXPR,U.EQUALS,U.OPERATOR])||Ye(this._flags.last_token.text,Yl)||this._flags.last_token.text===",");if(!this.start_of_statement(t)){var r=!e;this.handle_whitespace_and_comments(t,r)}if(ht(this._flags.last_token,_f)){this._output.space_before_token=!0,this.print_token(t);return}if(t.text==="*"&&this._flags.last_token.type===U.DOT){this.print_token(t);return}if(t.text==="::"){this.print_token(t);return}if(this._flags.last_token.type===U.OPERATOR&&Ye(this._options.operator_position,kN)&&this.allow_wrap_or_preserved_newline(t),t.text===":"&&this._flags.in_case){this.print_token(t),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==U.START_BLOCK?(this.indent(),this.print_newline()):this._output.space_before_token=!0;return}var i=!0,s=!0,a=!1;if(t.text===":"?this._flags.ternary_depth===0?i=!1:(this._flags.ternary_depth-=1,a=!0):t.text==="?"&&(this._flags.ternary_depth+=1),!n&&!e&&this._options.preserve_newlines&&Ye(t.text,Hl)){var o=t.text===":",l=o&&a,u=o&&!a;switch(this._options.operator_position){case $l.before_newline:this._output.space_before_token=!u,this.print_token(t),(!o||l)&&this.allow_wrap_or_preserved_newline(t),this._output.space_before_token=!0;return;case $l.after_newline:this._output.space_before_token=!0,!o||l?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(t):this._output.space_before_token=!1,this.print_token(t),this._output.space_before_token=!0;return;case $l.preserve_newline:u||this.allow_wrap_or_preserved_newline(t),i=!(this._output.just_added_newline()||u),this._output.space_before_token=i,this.print_token(t),this._output.space_before_token=!0;return}}if(e){this.allow_wrap_or_preserved_newline(t),i=!1;var c=this._tokens.peek();s=c&&Ye(c.type,[U.WORD,U.RESERVED])}else t.text==="..."?(this.allow_wrap_or_preserved_newline(t),i=this._flags.last_token.type===U.START_BLOCK,s=!1):(Ye(t.text,["--","++","!","~"])||n)&&((this._flags.last_token.type===U.COMMA||this._flags.last_token.type===U.START_EXPR)&&this.allow_wrap_or_preserved_newline(t),i=!1,s=!1,t.newlines&&(t.text==="--"||t.text==="++")&&this.print_newline(!1,!0),this._flags.last_token.text===";"&&Kl(this._flags.mode)&&(i=!0),this._flags.last_token.type===U.RESERVED?i=!0:this._flags.last_token.type===U.END_EXPR?i=!(this._flags.last_token.text==="]"&&(t.text==="--"||t.text==="++")):this._flags.last_token.type===U.OPERATOR&&(i=Ye(t.text,["--","-","++","+"])&&Ye(this._flags.last_token.text,["--","-","++","+"]),Ye(t.text,["+","-"])&&Ye(this._flags.last_token.text,["--","++"])&&(s=!0)),(this._flags.mode===Ee.BlockStatement&&!this._flags.inline_frame||this._flags.mode===Ee.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline());this._output.space_before_token=this._output.space_before_token||i,this.print_token(t),this._output.space_before_token=s};Qe.prototype.handle_block_comment=function(t,e){if(this._output.raw){this._output.add_raw_token(t),t.directives&&t.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(t.directives){this.print_newline(!1,e),this.print_token(t),t.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!gf.newline.test(t.text)&&!t.newlines){this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0;return}else this.print_block_commment(t,e)};Qe.prototype.print_block_commment=function(t,e){var n=tF(t.text),r,i=!1,s=!1,a=t.whitespace_before,o=a.length;if(this.print_newline(!1,e),this.print_token_line_indentation(t),this._output.add_token(n[0]),this.print_newline(!1,e),n.length>1){for(n=n.slice(1),i=nF(n,"*"),s=rF(n,a),i&&(this._flags.alignment=1),r=0;r{"use strict";var iF=qN().Beautifier,sF=Hh().Options;function aF(t,e){var n=new iF(t,e);return n.beautify()}nm.exports=aF;nm.exports.defaultOptions=function(){return new sF}});var rm=X((NZ,WN)=>{"use strict";var jN=pf().Options;function UN(t){jN.call(this,t,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var e=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||e;var n=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var r=0;r{"use strict";var oF=rm().Options,lF=cf().Output,uF=df().InputScanner,cF=hf().Directives,GN=new cF(/\/\*/,/\*\//),YN=/\r\n|[\r\n]/,fF=/\r\n|[\r\n]/g,yf=/\s/,pF=/(?:\s|\n)+/g,dF=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,hF=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function Yi(t,e){this._source_text=t||"",this._options=new oF(e),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0}}Yi.prototype.eatString=function(t){var e="";for(this._ch=this._input.next();this._ch;){if(e+=this._ch,this._ch==="\\")e+=this._input.next();else if(t.indexOf(this._ch)!==-1||this._ch===` +`);return t.length&&e.push(t),e}function Ps(t){return t===Ee.ArrayLiteral}function Kl(t){return Ye(t,[Ee.Expression,Ee.ForInitializer,Ee.Conditional])}function iF(t,e){for(var n=0;nn&&(n=t.line_indent_level));var r={mode:e,parent:t,last_token:t?t.last_token:new QL(U.START_BLOCK,""),last_word:t?t.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:n,alignment:0,line_indent_level:t?t.line_indent_level:n,start_line_index:this._output.get_line_number(),ternary_depth:0};return r};Qe.prototype._reset=function(t){var e=t.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new XL(this._options,e),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(Ee.BlockStatement);var n=new ZL(t,this._options);return this._tokens=n.tokenize(),t};Qe.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t,e=this._reset(this._source_text),n=this._options.eol;this._options.eol==="auto"&&(n=` +`,e&&gf.lineBreak.test(e||"")&&(n=e.match(gf.lineBreak)[0]));for(var r=this._tokens.next();r;)this.handle_token(r),this._last_last_text=this._flags.last_token.text,this._flags.last_token=r,r=this._tokens.next();return t=this._output.get_code(n),t};Qe.prototype.handle_token=function(t,e){t.type===U.START_EXPR?this.handle_start_expr(t):t.type===U.END_EXPR?this.handle_end_expr(t):t.type===U.START_BLOCK?this.handle_start_block(t):t.type===U.END_BLOCK?this.handle_end_block(t):t.type===U.WORD?this.handle_word(t):t.type===U.RESERVED?this.handle_word(t):t.type===U.SEMICOLON?this.handle_semicolon(t):t.type===U.STRING?this.handle_string(t):t.type===U.EQUALS?this.handle_equals(t):t.type===U.OPERATOR?this.handle_operator(t):t.type===U.COMMA?this.handle_comma(t):t.type===U.BLOCK_COMMENT?this.handle_block_comment(t,e):t.type===U.COMMENT?this.handle_comment(t,e):t.type===U.DOT?this.handle_dot(t):t.type===U.EOF?this.handle_eof(t):t.type===U.UNKNOWN?this.handle_unknown(t,e):this.handle_unknown(t,e)};Qe.prototype.handle_whitespace_and_comments=function(t,e){var n=t.newlines,r=this._options.keep_array_indentation&&Ps(this._flags.mode);if(t.comments_before)for(var i=t.comments_before.next();i;)this.handle_whitespace_and_comments(i,e),this.handle_token(i,e),i=t.comments_before.next();if(r)for(var s=0;s0,e);else if(this._options.max_preserve_newlines&&n>this._options.max_preserve_newlines&&(n=this._options.max_preserve_newlines),this._options.preserve_newlines&&n>1){this.print_newline(!1,e);for(var a=1;a0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))};Qe.prototype.set_mode=function(t){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,t),this._flags=this.create_flags(this._previous_flags,t),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)};Qe.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===Ee.Statement&&BN(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))};Qe.prototype.start_of_object_property=function(){return this._flags.parent.mode===Ee.ObjectLiteral&&this._flags.mode===Ee.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||ht(this._flags.last_token,["get","set"]))};Qe.prototype.start_of_statement=function(t){var e=!1;return e=e||ht(this._flags.last_token,["var","let","const"])&&t.type===U.WORD,e=e||Sr(this._flags.last_token,"do"),e=e||!(this._flags.parent.mode===Ee.ObjectLiteral&&this._flags.mode===Ee.Statement)&&ht(this._flags.last_token,tm)&&!t.newlines,e=e||Sr(this._flags.last_token,"else")&&!(Sr(t,"if")&&!t.comments_before),e=e||this._flags.last_token.type===U.END_EXPR&&(this._previous_flags.mode===Ee.ForInitializer||this._previous_flags.mode===Ee.Conditional),e=e||this._flags.last_token.type===U.WORD&&this._flags.mode===Ee.BlockStatement&&!this._flags.in_case&&!(t.text==="--"||t.text==="++")&&this._last_last_text!=="function"&&t.type!==U.WORD&&t.type!==U.RESERVED,e=e||this._flags.mode===Ee.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||ht(this._flags.last_token,["get","set"])),e?(this.set_mode(Ee.Statement),this.indent(),this.handle_whitespace_and_comments(t,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t,ht(t,["do","for","if","while"])),!0):!1};Qe.prototype.handle_start_expr=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t);var e=Ee.Expression;if(t.text==="["){if(this._flags.last_token.type===U.WORD||this._flags.last_token.text===")"){ht(this._flags.last_token,Yl)&&(this._output.space_before_token=!0),this.print_token(t),this.set_mode(e),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}e=Ee.ArrayLiteral,Ps(this._flags.mode)&&(this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline()),Ye(this._flags.last_token.type,[U.START_EXPR,U.END_EXPR,U.WORD,U.OPERATOR,U.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===U.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,e=Ee.ForInitializer):Ye(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,e=Ee.Conditional):Ye(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&t.whitespace_before===""?this._output.space_before_token=!1:(Ye(this._flags.last_token.text,Yl)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===U.EQUALS||this._flags.last_token.type===U.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t);else if(this._flags.last_token.type===U.WORD){this._output.space_before_token=!1;var n=this._tokens.peek(-3);if(this._options.space_after_named_function&&n){var r=this._tokens.peek(-4);ht(n,["async","function"])||n.text==="*"&&ht(r,["async","function"])?this._output.space_before_token=!0:this._flags.mode===Ee.ObjectLiteral&&(n.text==="{"||n.text===","||n.text==="*"&&(r.text==="{"||r.text===","))&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(t);(this._flags.last_token.type===U.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(Ye(this._last_last_text,["function","yield"])||this._flags.mode===Ee.ObjectLiteral&&Ye(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===U.START_BLOCK?this.print_newline():(this._flags.last_token.type===U.END_EXPR||this._flags.last_token.type===U.START_EXPR||this._flags.last_token.type===U.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===U.COMMA)&&this.allow_wrap_or_preserved_newline(t,t.newlines),this.print_token(t),this.set_mode(e),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()};Qe.prototype.handle_end_expr=function(t){for(;this._flags.mode===Ee.Statement;)this.restore_mode();this.handle_whitespace_and_comments(t),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(t,t.text==="]"&&Ps(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===U.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(t),this.restore_mode(),BN(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===Ee.Conditional&&(this._previous_flags.mode=Ee.Expression,this._flags.do_block=!1,this._flags.do_while=!1)};Qe.prototype.handle_start_block=function(t){this.handle_whitespace_and_comments(t);var e=this._tokens.peek(),n=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===U.END_EXPR?(this.set_mode(Ee.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(Ee.BlockStatement):n&&(Ye(n.text,[":",","])&&Ye(e.type,[U.STRING,U.WORD,U.RESERVED])||Ye(e.text,["get","set","..."])&&Ye(n.type,[U.WORD,U.RESERVED]))?Ye(this._last_last_text,["class","interface"])?this.set_mode(Ee.BlockStatement):this.set_mode(Ee.ObjectLiteral):this._flags.last_token.type===U.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(Ee.BlockStatement):Ye(this._flags.last_token.type,[U.EQUALS,U.START_EXPR,U.COMMA,U.OPERATOR])||ht(this._flags.last_token,["return","throw","import","default"])?this.set_mode(Ee.ObjectLiteral):this.set_mode(Ee.BlockStatement);var r=!e.comments_before&&e.text==="}",i=r&&this._flags.last_word==="function"&&this._flags.last_token.type===U.END_EXPR;if(this._options.brace_preserve_inline){var s=0,a=null;this._flags.inline_frame=!0;do if(s+=1,a=this._tokens.peek(s-1),a.newlines){this._flags.inline_frame=!1;break}while(a.type!==U.EOF&&!(a.type===U.END_BLOCK&&a.opened===t))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&t.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==U.OPERATOR&&(i||this._flags.last_token.type===U.EQUALS||ht(this._flags.last_token,_f)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(Ps(this._previous_flags.mode)&&(this._flags.last_token.type===U.START_EXPR||this._flags.last_token.type===U.COMMA)&&((this._flags.last_token.type===U.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===U.COMMA||this._flags.last_token.type===U.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(t),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==U.OPERATOR&&this._flags.last_token.type!==U.START_EXPR&&(this._flags.last_token.type===U.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(t),this.indent(),!r&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()};Qe.prototype.handle_end_block=function(t){for(this.handle_whitespace_and_comments(t);this._flags.mode===Ee.Statement;)this.restore_mode();var e=this._flags.last_token.type===U.START_BLOCK;this._flags.inline_frame&&!e?this._output.space_before_token=!0:this._options.brace_style==="expand"?e||this.print_newline():e||(Ps(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(t)};Qe.prototype.handle_word=function(t){if(t.type===U.RESERVED){if(Ye(t.text,["set","get"])&&this._flags.mode!==Ee.ObjectLiteral)t.type=U.WORD;else if(t.text==="import"&&this._tokens.peek().text==="(")t.type=U.WORD;else if(Ye(t.text,["as","from"])&&!this._flags.import_block)t.type=U.WORD;else if(this._flags.mode===Ee.ObjectLiteral){var e=this._tokens.peek();e.text===":"&&(t.type=U.WORD)}}if(this.start_of_statement(t)?ht(this._flags.last_token,["var","let","const"])&&t.type===U.WORD&&(this._flags.declaration_statement=!0):t.newlines&&!Kl(this._flags.mode)&&(this._flags.last_token.type!==U.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==U.EQUALS&&(this._options.preserve_newlines||!ht(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(t),this.print_newline()):this.handle_whitespace_and_comments(t),this._flags.do_block&&!this._flags.do_while)if(Sr(t,"while")){this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&Sr(t,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===Ee.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&ht(t,["case","default"])){this.print_newline(),this._flags.last_token.type!==U.END_BLOCK&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(t),this._flags.in_case=!0;return}if((this._flags.last_token.type===U.COMMA||this._flags.last_token.type===U.START_EXPR||this._flags.last_token.type===U.EQUALS||this._flags.last_token.type===U.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t)),Sr(t,"function")){(Ye(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(Ye(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===U.OPERATOR))&&!this._output.just_added_blankline()&&!t.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===U.RESERVED||this._flags.last_token.type===U.WORD?ht(this._flags.last_token,["get","set","new","export"])||ht(this._flags.last_token,tm)?this._output.space_before_token=!0:Sr(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===U.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(Kl(this._flags.mode)||Ps(this._flags.mode))||this.print_newline(),this.print_token(t),this._flags.last_word=t.text;return}var n="NONE";if(this._flags.last_token.type===U.END_BLOCK?this._previous_flags.inline_frame?n="SPACE":ht(t,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&t.newlines?n="NEWLINE":(n="SPACE",this._output.space_before_token=!0):n="NEWLINE":this._flags.last_token.type===U.SEMICOLON&&this._flags.mode===Ee.BlockStatement?n="NEWLINE":this._flags.last_token.type===U.SEMICOLON&&Kl(this._flags.mode)?n="SPACE":this._flags.last_token.type===U.STRING?n="NEWLINE":this._flags.last_token.type===U.RESERVED||this._flags.last_token.type===U.WORD||this._flags.last_token.text==="*"&&(Ye(this._last_last_text,["function","yield"])||this._flags.mode===Ee.ObjectLiteral&&Ye(this._last_last_text,["{",","]))?n="SPACE":this._flags.last_token.type===U.START_BLOCK?this._flags.inline_frame?n="SPACE":n="NEWLINE":this._flags.last_token.type===U.END_EXPR&&(this._output.space_before_token=!0,n="NEWLINE"),ht(t,Yl)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?n="SPACE":n="NEWLINE"),ht(t,["else","catch","finally"]))if((!(this._flags.last_token.type===U.END_BLOCK&&this._previous_flags.mode===Ee.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&t.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var r=this._output.current_line;r.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else n==="NEWLINE"?ht(this._flags.last_token,_f)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&ht(t,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==U.END_EXPR?(this._flags.last_token.type!==U.START_EXPR||!ht(t,["var","let","const"]))&&this._flags.last_token.text!==":"&&(Sr(t,"if")&&Sr(t.previous,"else")?this._output.space_before_token=!0:this.print_newline()):ht(t,Yl)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&Ps(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():n==="SPACE"&&(this._output.space_before_token=!0);t.previous&&(t.previous.type===U.WORD||t.previous.type===U.RESERVED)&&(this._output.space_before_token=!0),this.print_token(t),this._flags.last_word=t.text,t.type===U.RESERVED&&(t.text==="do"?this._flags.do_block=!0:t.text==="if"?this._flags.if_block=!0:t.text==="import"?this._flags.import_block=!0:this._flags.import_block&&Sr(t,"from")&&(this._flags.import_block=!1))};Qe.prototype.handle_semicolon=function(t){this.start_of_statement(t)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(t);for(var e=this._tokens.peek();this._flags.mode===Ee.Statement&&!(this._flags.if_block&&Sr(e,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(t)};Qe.prototype.handle_string=function(t){t.text.startsWith("`")&&t.newlines===0&&t.whitespace_before===""&&(t.previous.text===")"||this._flags.last_token.type===U.WORD)||(this.start_of_statement(t)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(t),this._flags.last_token.type===U.RESERVED||this._flags.last_token.type===U.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===U.COMMA||this._flags.last_token.type===U.START_EXPR||this._flags.last_token.type===U.EQUALS||this._flags.last_token.type===U.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t):t.text.startsWith("`")&&this._flags.last_token.type===U.END_EXPR&&(t.previous.text==="]"||t.previous.text===")")&&t.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(t)};Qe.prototype.handle_equals=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0};Qe.prototype.handle_comma=function(t){this.handle_whitespace_and_comments(t,!0),this.print_token(t),this._output.space_before_token=!0,this._flags.declaration_statement?(Kl(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)):this._flags.mode===Ee.ObjectLiteral||this._flags.mode===Ee.Statement&&this._flags.parent.mode===Ee.ObjectLiteral?(this._flags.mode===Ee.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)};Qe.prototype.handle_operator=function(t){var e=t.text==="*"&&(ht(this._flags.last_token,["function","yield"])||Ye(this._flags.last_token.type,[U.START_BLOCK,U.COMMA,U.END_BLOCK,U.SEMICOLON])),n=Ye(t.text,["-","+"])&&(Ye(this._flags.last_token.type,[U.START_BLOCK,U.START_EXPR,U.EQUALS,U.OPERATOR])||Ye(this._flags.last_token.text,Yl)||this._flags.last_token.text===",");if(!this.start_of_statement(t)){var r=!e;this.handle_whitespace_and_comments(t,r)}if(ht(this._flags.last_token,_f)){this._output.space_before_token=!0,this.print_token(t);return}if(t.text==="*"&&this._flags.last_token.type===U.DOT){this.print_token(t);return}if(t.text==="::"){this.print_token(t);return}if(this._flags.last_token.type===U.OPERATOR&&Ye(this._options.operator_position,MN)&&this.allow_wrap_or_preserved_newline(t),t.text===":"&&this._flags.in_case){this.print_token(t),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==U.START_BLOCK?(this.indent(),this.print_newline()):this._output.space_before_token=!0;return}var i=!0,s=!0,a=!1;if(t.text===":"?this._flags.ternary_depth===0?i=!1:(this._flags.ternary_depth-=1,a=!0):t.text==="?"&&(this._flags.ternary_depth+=1),!n&&!e&&this._options.preserve_newlines&&Ye(t.text,Hl)){var o=t.text===":",l=o&&a,u=o&&!a;switch(this._options.operator_position){case $l.before_newline:this._output.space_before_token=!u,this.print_token(t),(!o||l)&&this.allow_wrap_or_preserved_newline(t),this._output.space_before_token=!0;return;case $l.after_newline:this._output.space_before_token=!0,!o||l?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(t):this._output.space_before_token=!1,this.print_token(t),this._output.space_before_token=!0;return;case $l.preserve_newline:u||this.allow_wrap_or_preserved_newline(t),i=!(this._output.just_added_newline()||u),this._output.space_before_token=i,this.print_token(t),this._output.space_before_token=!0;return}}if(e){this.allow_wrap_or_preserved_newline(t),i=!1;var c=this._tokens.peek();s=c&&Ye(c.type,[U.WORD,U.RESERVED])}else t.text==="..."?(this.allow_wrap_or_preserved_newline(t),i=this._flags.last_token.type===U.START_BLOCK,s=!1):(Ye(t.text,["--","++","!","~"])||n)&&((this._flags.last_token.type===U.COMMA||this._flags.last_token.type===U.START_EXPR)&&this.allow_wrap_or_preserved_newline(t),i=!1,s=!1,t.newlines&&(t.text==="--"||t.text==="++")&&this.print_newline(!1,!0),this._flags.last_token.text===";"&&Kl(this._flags.mode)&&(i=!0),this._flags.last_token.type===U.RESERVED?i=!0:this._flags.last_token.type===U.END_EXPR?i=!(this._flags.last_token.text==="]"&&(t.text==="--"||t.text==="++")):this._flags.last_token.type===U.OPERATOR&&(i=Ye(t.text,["--","-","++","+"])&&Ye(this._flags.last_token.text,["--","-","++","+"]),Ye(t.text,["+","-"])&&Ye(this._flags.last_token.text,["--","++"])&&(s=!0)),(this._flags.mode===Ee.BlockStatement&&!this._flags.inline_frame||this._flags.mode===Ee.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline());this._output.space_before_token=this._output.space_before_token||i,this.print_token(t),this._output.space_before_token=s};Qe.prototype.handle_block_comment=function(t,e){if(this._output.raw){this._output.add_raw_token(t),t.directives&&t.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(t.directives){this.print_newline(!1,e),this.print_token(t),t.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!gf.newline.test(t.text)&&!t.newlines){this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0;return}else this.print_block_commment(t,e)};Qe.prototype.print_block_commment=function(t,e){var n=rF(t.text),r,i=!1,s=!1,a=t.whitespace_before,o=a.length;if(this.print_newline(!1,e),this.print_token_line_indentation(t),this._output.add_token(n[0]),this.print_newline(!1,e),n.length>1){for(n=n.slice(1),i=iF(n,"*"),s=sF(n,a),i&&(this._flags.alignment=1),r=0;r{"use strict";var aF=VN().Beautifier,oF=Hh().Options;function lF(t,e){var n=new aF(t,e);return n.beautify()}nm.exports=lF;nm.exports.defaultOptions=function(){return new oF}});var rm=X((EZ,GN)=>{"use strict";var UN=pf().Options;function WN(t){UN.call(this,t,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var e=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||e;var n=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var r=0;r{"use strict";var uF=rm().Options,cF=cf().Output,fF=df().InputScanner,pF=hf().Directives,YN=new pF(/\/\*/,/\*\//),HN=/\r\n|[\r\n]/,dF=/\r\n|[\r\n]/g,yf=/\s/,hF=/(?:\s|\n)+/g,mF=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,gF=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function Yi(t,e){this._source_text=t||"",this._options=new uF(e),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0}}Yi.prototype.eatString=function(t){var e="";for(this._ch=this._input.next();this._ch;){if(e+=this._ch,this._ch==="\\")e+=this._input.next();else if(t.indexOf(this._ch)!==-1||this._ch===` `)break;this._ch=this._input.next()}return e};Yi.prototype.eatWhitespace=function(t){for(var e=yf.test(this._input.peek()),n=0;yf.test(this._input.peek());)this._ch=this._input.next(),t&&this._ch===` `&&(n===0||n0&&this._indentLevel--};Yi.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;e==="auto"&&(e=` -`,t&&YN.test(t||"")&&(e=t.match(YN)[0])),t=t.replace(fF,` -`);var n=t.match(/^[\t ]*/)[0];this._output=new lF(this._options,n),this._input=new uF(t),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var r=0,i=!1,s=!1,a=!1,o=!1,l=!1,u=this._ch,c,f,h;c=this._input.read(pF),f=c!=="",h=u,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),u=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var y=this._input.read(dF),p=GN.get_directives(y);p&&p.ignore==="start"&&(y+=GN.readIgnored(this._input)),this.print_string(y),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(hF)),this.eatWhitespace(!0);else if(this._ch==="@")if(this.preserveSingleSpace(f),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var d=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);d.match(/[ :]$/)&&(d=this.eatString(": ").replace(/\s$/,""),this.print_string(d),this._output.space_before_token=!0),d=d.replace(/\s$/,""),d==="extend"?o=!0:d==="import"&&(l=!0),d in this.NESTED_AT_RULE?(this._nestedLevel+=1,d in this.CONDITIONAL_GROUP_RULE&&(a=!0)):!i&&r===0&&d.indexOf(":")!==-1&&(s=!0,this.indent())}else this._ch==="#"&&this._input.peek()==="{"?(this.preserveSingleSpace(f),this.print_string(this._ch+this.eatString("}"))):this._ch==="{"?(s&&(s=!1,this.outdent()),a?(a=!1,i=this._indentLevel>=this._nestedLevel):i=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&i&&this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line()):this._ch==="}"?(this.outdent(),this._output.add_new_line(),h==="{"&&this._output.trim(!0),l=!1,o=!1,s&&(this.outdent(),s=!1),this.print_string(this._ch),i=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&this._input.peek()!=="}"&&this._output.add_new_line(!0)):this._ch===":"?(i||a)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!o&&r===0?(this.print_string(":"),s||(s=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":")):this._ch==='"'||this._ch==="'"?(this.preserveSingleSpace(f),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)):this._ch===";"?r===0?(s&&(this.outdent(),s=!1),o=!1,l=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0):this._ch==="("?this._input.lookBack("url")?(this.print_string(this._ch),this.eatWhitespace(),r++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),r&&(r--,this.outdent()))):(this.preserveSingleSpace(f),this.print_string(this._ch),this.eatWhitespace(),r++,this.indent()):this._ch===")"?(r&&(r--,this.outdent()),this.print_string(this._ch)):this._ch===","?(this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&!s&&r===0&&!l?this._output.add_new_line():this._output.space_before_token=!0):(this._ch===">"||this._ch==="+"||this._ch==="~")&&!s&&r===0?this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&yf.test(this._ch)&&(this._ch="")):this._ch==="]"?this.print_string(this._ch):this._ch==="["?(this.preserveSingleSpace(f),this.print_string(this._ch)):this._ch==="="?(this.eatWhitespace(),this.print_string("="),yf.test(this._ch)&&(this._ch="")):this._ch==="!"&&!this._input.lookBack("\\")?(this.print_string(" "),this.print_string(this._ch)):(this.preserveSingleSpace(f),this.print_string(this._ch));var g=this._output.get_code(e);return g};HN.exports.Beautifier=Yi});var KN=X((PZ,im)=>{"use strict";var mF=$N().Beautifier,gF=rm().Options;function _F(t,e){var n=new mF(t,e);return n.beautify()}im.exports=_F;im.exports.defaultOptions=function(){return new gF}});var sm=X((AZ,QN)=>{"use strict";var zN=pf().Options;function XN(t){zN.call(this,t,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}XN.prototype=new zN;QN.exports.Options=XN});var lm=X((SZ,om)=>{"use strict";var JN=Ul().Tokenizer,am=Ul().TOKEN,yF=hf().Directives,bF=Jh().TemplatablePattern,TF=Vl().Pattern,Lt={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:am.START,RAW:am.RAW,EOF:am.EOF},ZN=new yF(/<\!--/,/-->/),Tn=function(t,e){JN.call(this,t,e),this._current_tag_name="";var n=new bF(this._input).read_options(this._options),r=new TF(this._input);if(this.__patterns={word:n.until(/[\n\r\t <]/),single_quote:n.until_after(/'/),double_quote:n.until_after(/"/),attribute:n.until(/[\n\r\t =>]|\/>/),element_name:n.until(/[\n\r\t >\/]/),handlebars_comment:r.starting_with(/{{!--/).until_after(/--}}/),handlebars:r.starting_with(/{{/).until_after(/}}/),handlebars_open:r.until(/[\n\r\t }]/),handlebars_raw_close:r.until(/}}/),comment:r.starting_with(//),cdata:r.starting_with(//),conditional_comment:r.starting_with(//),processing:r.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var i=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=r.matching(i).until_after(i)}};Tn.prototype=new JN;Tn.prototype._is_comment=function(t){return!1};Tn.prototype._is_opening=function(t){return t.type===Lt.TAG_OPEN};Tn.prototype._is_closing=function(t,e){return t.type===Lt.TAG_CLOSE&&e&&((t.text===">"||t.text==="/>")&&e.text[0]==="<"||t.text==="}}"&&e.text[0]==="{"&&e.text[1]==="{")};Tn.prototype._reset=function(){this._current_tag_name=""};Tn.prototype._get_next_token=function(t,e){var n=null;this._readWhitespace();var r=this._input.peek();return r===null?this._create_token(Lt.EOF,""):(n=n||this._read_open_handlebars(r,e),n=n||this._read_attribute(r,t,e),n=n||this._read_close(r,e),n=n||this._read_raw_content(r,t,e),n=n||this._read_content_word(r),n=n||this._read_comment_or_cdata(r),n=n||this._read_processing(r),n=n||this._read_open(r,e),n=n||this._create_token(Lt.UNKNOWN,this._input.next()),n)};Tn.prototype._read_comment_or_cdata=function(t){var e=null,n=null,r=null;if(t==="<"){var i=this._input.peek(1);i==="!"&&(n=this.__patterns.comment.read(),n?(r=ZN.get_directives(n),r&&r.ignore==="start"&&(n+=ZN.readIgnored(this._input))):n=this.__patterns.cdata.read()),n&&(e=this._create_token(Lt.COMMENT,n),e.directives=r)}return e};Tn.prototype._read_processing=function(t){var e=null,n=null,r=null;if(t==="<"){var i=this._input.peek(1);(i==="!"||i==="?")&&(n=this.__patterns.conditional_comment.read(),n=n||this.__patterns.processing.read()),n&&(e=this._create_token(Lt.COMMENT,n),e.directives=r)}return e};Tn.prototype._read_open=function(t,e){var n=null,r=null;return e||t==="<"&&(n=this._input.next(),this._input.peek()==="/"&&(n+=this._input.next()),n+=this.__patterns.element_name.read(),r=this._create_token(Lt.TAG_OPEN,n)),r};Tn.prototype._read_open_handlebars=function(t,e){var n=null,r=null;return e||this._options.indent_handlebars&&t==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(n=this.__patterns.handlebars_comment.read(),n=n||this.__patterns.handlebars.read(),r=this._create_token(Lt.COMMENT,n)):(n=this.__patterns.handlebars_open.read(),r=this._create_token(Lt.TAG_OPEN,n))),r};Tn.prototype._read_close=function(t,e){var n=null,r=null;return e&&(e.text[0]==="<"&&(t===">"||t==="/"&&this._input.peek(1)===">")?(n=this._input.next(),t==="/"&&(n+=this._input.next()),r=this._create_token(Lt.TAG_CLOSE,n)):e.text[0]==="{"&&t==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),r=this._create_token(Lt.TAG_CLOSE,"}}"))),r};Tn.prototype._read_attribute=function(t,e,n){var r=null,i="";if(n&&n.text[0]==="<")if(t==="=")r=this._create_token(Lt.EQUALS,this._input.next());else if(t==='"'||t==="'"){var s=this._input.next();t==='"'?s+=this.__patterns.double_quote.read():s+=this.__patterns.single_quote.read(),r=this._create_token(Lt.VALUE,s)}else i=this.__patterns.attribute.read(),i&&(e.type===Lt.EQUALS?r=this._create_token(Lt.VALUE,i):r=this._create_token(Lt.ATTRIBUTE,i));return r};Tn.prototype._is_content_unformatted=function(t){return this._options.void_elements.indexOf(t)===-1&&(this._options.content_unformatted.indexOf(t)!==-1||this._options.unformatted.indexOf(t)!==-1)};Tn.prototype._read_raw_content=function(t,e,n){var r="";if(n&&n.text[0]==="{")r=this.__patterns.handlebars_raw_close.read();else if(e.type===Lt.TAG_CLOSE&&e.opened.text[0]==="<"&&e.text[0]!=="/"){var i=e.opened.text.substr(1).toLowerCase();if(i==="script"||i==="style"){var s=this._read_comment_or_cdata(t);if(s)return s.type=Lt.TEXT,s;r=this._input.readUntil(new RegExp("","ig"))}else this._is_content_unformatted(i)&&(r=this._input.readUntil(new RegExp("","ig")))}return r?this._create_token(Lt.TEXT,r):null};Tn.prototype._read_content_word=function(t){var e="";if(this._options.unformatted_content_delimiter&&t===this._options.unformatted_content_delimiter[0]&&(e=this.__patterns.unformatted_content_delimiter.read()),e||(e=this.__patterns.word.read()),e)return this._create_token(Lt.TEXT,e)};om.exports.Tokenizer=Tn;om.exports.TOKEN=Lt});var rC=X((EZ,nC)=>{"use strict";var vF=sm().Options,NF=cf().Output,CF=lm().Tokenizer,ot=lm().TOKEN,eC=/\r\n|[\r\n]/,PF=/\r\n|[\r\n]/g,Sr=function(t,e){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=t.max_preserve_newlines,this.preserve_newlines=t.preserve_newlines,this._output=new NF(t,e)};Sr.prototype.current_line_has_match=function(t){return this._output.current_line.has_match(t)};Sr.prototype.set_space_before_token=function(t,e){this._output.space_before_token=t,this._output.non_breaking_space=e};Sr.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()};Sr.prototype.add_raw_token=function(t){this._output.add_raw_token(t)};Sr.prototype.print_preserved_newlines=function(t){var e=0;t.type!==ot.TEXT&&t.previous.type!==ot.TEXT&&(e=t.newlines?1:0),this.preserve_newlines&&(e=t.newlines0);return e!==0};Sr.prototype.traverse_whitespace=function(t){return t.whitespace_before||t.newlines?(this.print_preserved_newlines(t)||(this._output.space_before_token=!0),!0):!1};Sr.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped};Sr.prototype.print_newline=function(t){this._output.add_new_line(t)};Sr.prototype.print_token=function(t){t.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(t.text))};Sr.prototype.indent=function(){this.indent_level++};Sr.prototype.get_full_indent=function(t){return t=this.indent_level+(t||0),t<1?"":this._output.get_indent_string(t)};var AF=function(t){for(var e=null,n=t.next;n.type!==ot.EOF&&t.closed!==n;){if(n.type===ot.ATTRIBUTE&&n.text==="type"){n.next&&n.next.type===ot.EQUALS&&n.next.next&&n.next.next.type===ot.VALUE&&(e=n.next.next.text);break}n=n.next}return e},SF=function(t,e){var n=null,r=null;return e.closed?(t==="script"?n="text/javascript":t==="style"&&(n="text/css"),n=AF(e)||n,n.search("text/css")>-1?r="css":n.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?r="javascript":n.search(/(text|application|dojo)\/(x-)?(html)/)>-1?r="html":n.search(/test\/null/)>-1&&(r="null"),r):null};function zl(t,e){return e.indexOf(t)!==-1}function EF(t,e,n){this.parent=t||null,this.tag=e?e.tag_name:"",this.indent_level=n||0,this.parser_token=e||null}function sa(t){this._printer=t,this._current_frame=null}sa.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null};sa.prototype.record_tag=function(t){var e=new EF(this._current_frame,t,this._printer.indent_level);this._current_frame=e};sa.prototype._try_pop_frame=function(t){var e=null;return t&&(e=t.parser_token,this._printer.indent_level=t.indent_level,this._current_frame=t.parent),e};sa.prototype._get_frame=function(t,e){for(var n=this._current_frame;n&&t.indexOf(n.tag)===-1;){if(e&&e.indexOf(n.tag)!==-1){n=null;break}n=n.parent}return n};sa.prototype.try_pop=function(t,e){var n=this._get_frame([t],e);return this._try_pop_frame(n)};sa.prototype.indent_to_tag=function(t){var e=this._get_frame(t);e&&(this._printer.indent_level=e.indent_level)};function Er(t,e,n,r){this._source_text=t||"",e=e||{},this._js_beautify=n,this._css_beautify=r,this._tag_stack=null;var i=new vF(e,"html");this._options=i,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}Er.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;this._options.eol==="auto"&&(e=` -`,t&&eC.test(t)&&(e=t.match(eC)[0])),t=t.replace(PF,` -`);var n=t.match(/^[\t ]*/)[0],r={text:"",type:""},i=new tC,s=new Sr(this._options,n),a=new CF(t,this._options).tokenize();this._tag_stack=new sa(s);for(var o=null,l=a.next();l.type!==ot.EOF;)l.type===ot.TAG_OPEN||l.type===ot.COMMENT?(o=this._handle_tag_open(s,l,i,r),i=o):l.type===ot.ATTRIBUTE||l.type===ot.EQUALS||l.type===ot.VALUE||l.type===ot.TEXT&&!i.tag_complete?o=this._handle_inside_tag(s,l,i,a):l.type===ot.TAG_CLOSE?o=this._handle_tag_close(s,l,i):l.type===ot.TEXT?o=this._handle_text(s,l,i):s.add_raw_token(l),r=o,l=a.next();var u=s._output.get_code(e);return u};Er.prototype._handle_tag_close=function(t,e,n){var r={text:e.text,type:e.type};return t.alignment_size=0,n.tag_complete=!0,t.set_space_before_token(e.newlines||e.whitespace_before!=="",!0),n.is_unformatted?t.add_raw_token(e):(n.tag_start_char==="<"&&(t.set_space_before_token(e.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&n.has_wrapped_attrs&&t.print_newline(!1)),t.print_token(e)),n.indent_content&&!(n.is_unformatted||n.is_content_unformatted)&&(t.indent(),n.indent_content=!1),!n.is_inline_element&&!(n.is_unformatted||n.is_content_unformatted)&&t.set_wrap_point(),r};Er.prototype._handle_inside_tag=function(t,e,n,r){var i=n.has_wrapped_attrs,s={text:e.text,type:e.type};if(t.set_space_before_token(e.newlines||e.whitespace_before!=="",!0),n.is_unformatted)t.add_raw_token(e);else if(n.tag_start_char==="{"&&e.type===ot.TEXT)t.print_preserved_newlines(e)?(e.newlines=0,t.add_raw_token(e)):t.print_token(e);else{if(e.type===ot.ATTRIBUTE?(t.set_space_before_token(!0),n.attr_count+=1):(e.type===ot.EQUALS||e.type===ot.VALUE&&e.previous.type===ot.EQUALS)&&t.set_space_before_token(!1),e.type===ot.ATTRIBUTE&&n.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(t.traverse_whitespace(e),i=i||e.newlines!==0),this._is_wrap_attributes_force)){var a=n.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&n.attr_count===1){var o=!0,l=0,u;do{if(u=r.peek(l),u.type===ot.ATTRIBUTE){o=!1;break}l+=1}while(l<4&&u.type!==ot.EOF&&u.type!==ot.TAG_CLOSE);a=!o}a&&(t.print_newline(!1),i=!0)}t.print_token(e),i=i||t.previous_token_wrapped(),n.has_wrapped_attrs=i}return s};Er.prototype._handle_text=function(t,e,n){var r={text:e.text,type:"TK_CONTENT"};return n.custom_beautifier_name?this._print_custom_beatifier_text(t,e,n):n.is_unformatted||n.is_content_unformatted?t.add_raw_token(e):(t.traverse_whitespace(e),t.print_token(e)),r};Er.prototype._print_custom_beatifier_text=function(t,e,n){var r=this;if(e.text!==""){var i=e.text,s,a=1,o="",l="";n.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?s=this._js_beautify:n.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?s=this._css_beautify:n.custom_beautifier_name==="html"&&(s=function(p,d){var g=new Er(p,d,r._js_beautify,r._css_beautify);return g.beautify()}),this._options.indent_scripts==="keep"?a=0:this._options.indent_scripts==="separate"&&(a=-t.indent_level);var u=t.get_full_indent(a);if(i=i.replace(/\n[ \t]*$/,""),n.custom_beautifier_name!=="html"&&i[0]==="<"&&i.match(/^(|]]>)$/.exec(i);if(!c){t.add_raw_token(e);return}o=u+c[1]+` +`,t&&HN.test(t||"")&&(e=t.match(HN)[0])),t=t.replace(dF,` +`);var n=t.match(/^[\t ]*/)[0];this._output=new cF(this._options,n),this._input=new fF(t),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var r=0,i=!1,s=!1,a=!1,o=!1,l=!1,u=this._ch,c,f,h;c=this._input.read(hF),f=c!=="",h=u,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),u=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var y=this._input.read(mF),p=YN.get_directives(y);p&&p.ignore==="start"&&(y+=YN.readIgnored(this._input)),this.print_string(y),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(gF)),this.eatWhitespace(!0);else if(this._ch==="@")if(this.preserveSingleSpace(f),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var d=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);d.match(/[ :]$/)&&(d=this.eatString(": ").replace(/\s$/,""),this.print_string(d),this._output.space_before_token=!0),d=d.replace(/\s$/,""),d==="extend"?o=!0:d==="import"&&(l=!0),d in this.NESTED_AT_RULE?(this._nestedLevel+=1,d in this.CONDITIONAL_GROUP_RULE&&(a=!0)):!i&&r===0&&d.indexOf(":")!==-1&&(s=!0,this.indent())}else this._ch==="#"&&this._input.peek()==="{"?(this.preserveSingleSpace(f),this.print_string(this._ch+this.eatString("}"))):this._ch==="{"?(s&&(s=!1,this.outdent()),a?(a=!1,i=this._indentLevel>=this._nestedLevel):i=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&i&&this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line()):this._ch==="}"?(this.outdent(),this._output.add_new_line(),h==="{"&&this._output.trim(!0),l=!1,o=!1,s&&(this.outdent(),s=!1),this.print_string(this._ch),i=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&this._input.peek()!=="}"&&this._output.add_new_line(!0)):this._ch===":"?(i||a)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!o&&r===0?(this.print_string(":"),s||(s=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":")):this._ch==='"'||this._ch==="'"?(this.preserveSingleSpace(f),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)):this._ch===";"?r===0?(s&&(this.outdent(),s=!1),o=!1,l=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0):this._ch==="("?this._input.lookBack("url")?(this.print_string(this._ch),this.eatWhitespace(),r++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),r&&(r--,this.outdent()))):(this.preserveSingleSpace(f),this.print_string(this._ch),this.eatWhitespace(),r++,this.indent()):this._ch===")"?(r&&(r--,this.outdent()),this.print_string(this._ch)):this._ch===","?(this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&!s&&r===0&&!l?this._output.add_new_line():this._output.space_before_token=!0):(this._ch===">"||this._ch==="+"||this._ch==="~")&&!s&&r===0?this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&yf.test(this._ch)&&(this._ch="")):this._ch==="]"?this.print_string(this._ch):this._ch==="["?(this.preserveSingleSpace(f),this.print_string(this._ch)):this._ch==="="?(this.eatWhitespace(),this.print_string("="),yf.test(this._ch)&&(this._ch="")):this._ch==="!"&&!this._input.lookBack("\\")?(this.print_string(" "),this.print_string(this._ch)):(this.preserveSingleSpace(f),this.print_string(this._ch));var g=this._output.get_code(e);return g};$N.exports.Beautifier=Yi});var zN=X((DZ,im)=>{"use strict";var _F=KN().Beautifier,yF=rm().Options;function bF(t,e){var n=new _F(t,e);return n.beautify()}im.exports=bF;im.exports.defaultOptions=function(){return new yF}});var sm=X((xZ,JN)=>{"use strict";var XN=pf().Options;function QN(t){XN.call(this,t,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}QN.prototype=new XN;JN.exports.Options=QN});var lm=X((RZ,om)=>{"use strict";var ZN=Ul().Tokenizer,am=Ul().TOKEN,TF=hf().Directives,vF=Jh().TemplatablePattern,NF=Vl().Pattern,Lt={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:am.START,RAW:am.RAW,EOF:am.EOF},eC=new TF(/<\!--/,/-->/),Tn=function(t,e){ZN.call(this,t,e),this._current_tag_name="";var n=new vF(this._input).read_options(this._options),r=new NF(this._input);if(this.__patterns={word:n.until(/[\n\r\t <]/),single_quote:n.until_after(/'/),double_quote:n.until_after(/"/),attribute:n.until(/[\n\r\t =>]|\/>/),element_name:n.until(/[\n\r\t >\/]/),handlebars_comment:r.starting_with(/{{!--/).until_after(/--}}/),handlebars:r.starting_with(/{{/).until_after(/}}/),handlebars_open:r.until(/[\n\r\t }]/),handlebars_raw_close:r.until(/}}/),comment:r.starting_with(//),cdata:r.starting_with(//),conditional_comment:r.starting_with(//),processing:r.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var i=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=r.matching(i).until_after(i)}};Tn.prototype=new ZN;Tn.prototype._is_comment=function(t){return!1};Tn.prototype._is_opening=function(t){return t.type===Lt.TAG_OPEN};Tn.prototype._is_closing=function(t,e){return t.type===Lt.TAG_CLOSE&&e&&((t.text===">"||t.text==="/>")&&e.text[0]==="<"||t.text==="}}"&&e.text[0]==="{"&&e.text[1]==="{")};Tn.prototype._reset=function(){this._current_tag_name=""};Tn.prototype._get_next_token=function(t,e){var n=null;this._readWhitespace();var r=this._input.peek();return r===null?this._create_token(Lt.EOF,""):(n=n||this._read_open_handlebars(r,e),n=n||this._read_attribute(r,t,e),n=n||this._read_close(r,e),n=n||this._read_raw_content(r,t,e),n=n||this._read_content_word(r),n=n||this._read_comment_or_cdata(r),n=n||this._read_processing(r),n=n||this._read_open(r,e),n=n||this._create_token(Lt.UNKNOWN,this._input.next()),n)};Tn.prototype._read_comment_or_cdata=function(t){var e=null,n=null,r=null;if(t==="<"){var i=this._input.peek(1);i==="!"&&(n=this.__patterns.comment.read(),n?(r=eC.get_directives(n),r&&r.ignore==="start"&&(n+=eC.readIgnored(this._input))):n=this.__patterns.cdata.read()),n&&(e=this._create_token(Lt.COMMENT,n),e.directives=r)}return e};Tn.prototype._read_processing=function(t){var e=null,n=null,r=null;if(t==="<"){var i=this._input.peek(1);(i==="!"||i==="?")&&(n=this.__patterns.conditional_comment.read(),n=n||this.__patterns.processing.read()),n&&(e=this._create_token(Lt.COMMENT,n),e.directives=r)}return e};Tn.prototype._read_open=function(t,e){var n=null,r=null;return e||t==="<"&&(n=this._input.next(),this._input.peek()==="/"&&(n+=this._input.next()),n+=this.__patterns.element_name.read(),r=this._create_token(Lt.TAG_OPEN,n)),r};Tn.prototype._read_open_handlebars=function(t,e){var n=null,r=null;return e||this._options.indent_handlebars&&t==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(n=this.__patterns.handlebars_comment.read(),n=n||this.__patterns.handlebars.read(),r=this._create_token(Lt.COMMENT,n)):(n=this.__patterns.handlebars_open.read(),r=this._create_token(Lt.TAG_OPEN,n))),r};Tn.prototype._read_close=function(t,e){var n=null,r=null;return e&&(e.text[0]==="<"&&(t===">"||t==="/"&&this._input.peek(1)===">")?(n=this._input.next(),t==="/"&&(n+=this._input.next()),r=this._create_token(Lt.TAG_CLOSE,n)):e.text[0]==="{"&&t==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),r=this._create_token(Lt.TAG_CLOSE,"}}"))),r};Tn.prototype._read_attribute=function(t,e,n){var r=null,i="";if(n&&n.text[0]==="<")if(t==="=")r=this._create_token(Lt.EQUALS,this._input.next());else if(t==='"'||t==="'"){var s=this._input.next();t==='"'?s+=this.__patterns.double_quote.read():s+=this.__patterns.single_quote.read(),r=this._create_token(Lt.VALUE,s)}else i=this.__patterns.attribute.read(),i&&(e.type===Lt.EQUALS?r=this._create_token(Lt.VALUE,i):r=this._create_token(Lt.ATTRIBUTE,i));return r};Tn.prototype._is_content_unformatted=function(t){return this._options.void_elements.indexOf(t)===-1&&(this._options.content_unformatted.indexOf(t)!==-1||this._options.unformatted.indexOf(t)!==-1)};Tn.prototype._read_raw_content=function(t,e,n){var r="";if(n&&n.text[0]==="{")r=this.__patterns.handlebars_raw_close.read();else if(e.type===Lt.TAG_CLOSE&&e.opened.text[0]==="<"&&e.text[0]!=="/"){var i=e.opened.text.substr(1).toLowerCase();if(i==="script"||i==="style"){var s=this._read_comment_or_cdata(t);if(s)return s.type=Lt.TEXT,s;r=this._input.readUntil(new RegExp("","ig"))}else this._is_content_unformatted(i)&&(r=this._input.readUntil(new RegExp("","ig")))}return r?this._create_token(Lt.TEXT,r):null};Tn.prototype._read_content_word=function(t){var e="";if(this._options.unformatted_content_delimiter&&t===this._options.unformatted_content_delimiter[0]&&(e=this.__patterns.unformatted_content_delimiter.read()),e||(e=this.__patterns.word.read()),e)return this._create_token(Lt.TEXT,e)};om.exports.Tokenizer=Tn;om.exports.TOKEN=Lt});var iC=X((wZ,rC)=>{"use strict";var CF=sm().Options,PF=cf().Output,SF=lm().Tokenizer,ot=lm().TOKEN,tC=/\r\n|[\r\n]/,AF=/\r\n|[\r\n]/g,Ar=function(t,e){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=t.max_preserve_newlines,this.preserve_newlines=t.preserve_newlines,this._output=new PF(t,e)};Ar.prototype.current_line_has_match=function(t){return this._output.current_line.has_match(t)};Ar.prototype.set_space_before_token=function(t,e){this._output.space_before_token=t,this._output.non_breaking_space=e};Ar.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()};Ar.prototype.add_raw_token=function(t){this._output.add_raw_token(t)};Ar.prototype.print_preserved_newlines=function(t){var e=0;t.type!==ot.TEXT&&t.previous.type!==ot.TEXT&&(e=t.newlines?1:0),this.preserve_newlines&&(e=t.newlines0);return e!==0};Ar.prototype.traverse_whitespace=function(t){return t.whitespace_before||t.newlines?(this.print_preserved_newlines(t)||(this._output.space_before_token=!0),!0):!1};Ar.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped};Ar.prototype.print_newline=function(t){this._output.add_new_line(t)};Ar.prototype.print_token=function(t){t.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(t.text))};Ar.prototype.indent=function(){this.indent_level++};Ar.prototype.get_full_indent=function(t){return t=this.indent_level+(t||0),t<1?"":this._output.get_indent_string(t)};var EF=function(t){for(var e=null,n=t.next;n.type!==ot.EOF&&t.closed!==n;){if(n.type===ot.ATTRIBUTE&&n.text==="type"){n.next&&n.next.type===ot.EQUALS&&n.next.next&&n.next.next.type===ot.VALUE&&(e=n.next.next.text);break}n=n.next}return e},IF=function(t,e){var n=null,r=null;return e.closed?(t==="script"?n="text/javascript":t==="style"&&(n="text/css"),n=EF(e)||n,n.search("text/css")>-1?r="css":n.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?r="javascript":n.search(/(text|application|dojo)\/(x-)?(html)/)>-1?r="html":n.search(/test\/null/)>-1&&(r="null"),r):null};function zl(t,e){return e.indexOf(t)!==-1}function DF(t,e,n){this.parent=t||null,this.tag=e?e.tag_name:"",this.indent_level=n||0,this.parser_token=e||null}function sa(t){this._printer=t,this._current_frame=null}sa.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null};sa.prototype.record_tag=function(t){var e=new DF(this._current_frame,t,this._printer.indent_level);this._current_frame=e};sa.prototype._try_pop_frame=function(t){var e=null;return t&&(e=t.parser_token,this._printer.indent_level=t.indent_level,this._current_frame=t.parent),e};sa.prototype._get_frame=function(t,e){for(var n=this._current_frame;n&&t.indexOf(n.tag)===-1;){if(e&&e.indexOf(n.tag)!==-1){n=null;break}n=n.parent}return n};sa.prototype.try_pop=function(t,e){var n=this._get_frame([t],e);return this._try_pop_frame(n)};sa.prototype.indent_to_tag=function(t){var e=this._get_frame(t);e&&(this._printer.indent_level=e.indent_level)};function Er(t,e,n,r){this._source_text=t||"",e=e||{},this._js_beautify=n,this._css_beautify=r,this._tag_stack=null;var i=new CF(e,"html");this._options=i,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}Er.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;this._options.eol==="auto"&&(e=` +`,t&&tC.test(t)&&(e=t.match(tC)[0])),t=t.replace(AF,` +`);var n=t.match(/^[\t ]*/)[0],r={text:"",type:""},i=new nC,s=new Ar(this._options,n),a=new SF(t,this._options).tokenize();this._tag_stack=new sa(s);for(var o=null,l=a.next();l.type!==ot.EOF;)l.type===ot.TAG_OPEN||l.type===ot.COMMENT?(o=this._handle_tag_open(s,l,i,r),i=o):l.type===ot.ATTRIBUTE||l.type===ot.EQUALS||l.type===ot.VALUE||l.type===ot.TEXT&&!i.tag_complete?o=this._handle_inside_tag(s,l,i,a):l.type===ot.TAG_CLOSE?o=this._handle_tag_close(s,l,i):l.type===ot.TEXT?o=this._handle_text(s,l,i):s.add_raw_token(l),r=o,l=a.next();var u=s._output.get_code(e);return u};Er.prototype._handle_tag_close=function(t,e,n){var r={text:e.text,type:e.type};return t.alignment_size=0,n.tag_complete=!0,t.set_space_before_token(e.newlines||e.whitespace_before!=="",!0),n.is_unformatted?t.add_raw_token(e):(n.tag_start_char==="<"&&(t.set_space_before_token(e.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&n.has_wrapped_attrs&&t.print_newline(!1)),t.print_token(e)),n.indent_content&&!(n.is_unformatted||n.is_content_unformatted)&&(t.indent(),n.indent_content=!1),!n.is_inline_element&&!(n.is_unformatted||n.is_content_unformatted)&&t.set_wrap_point(),r};Er.prototype._handle_inside_tag=function(t,e,n,r){var i=n.has_wrapped_attrs,s={text:e.text,type:e.type};if(t.set_space_before_token(e.newlines||e.whitespace_before!=="",!0),n.is_unformatted)t.add_raw_token(e);else if(n.tag_start_char==="{"&&e.type===ot.TEXT)t.print_preserved_newlines(e)?(e.newlines=0,t.add_raw_token(e)):t.print_token(e);else{if(e.type===ot.ATTRIBUTE?(t.set_space_before_token(!0),n.attr_count+=1):(e.type===ot.EQUALS||e.type===ot.VALUE&&e.previous.type===ot.EQUALS)&&t.set_space_before_token(!1),e.type===ot.ATTRIBUTE&&n.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(t.traverse_whitespace(e),i=i||e.newlines!==0),this._is_wrap_attributes_force)){var a=n.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&n.attr_count===1){var o=!0,l=0,u;do{if(u=r.peek(l),u.type===ot.ATTRIBUTE){o=!1;break}l+=1}while(l<4&&u.type!==ot.EOF&&u.type!==ot.TAG_CLOSE);a=!o}a&&(t.print_newline(!1),i=!0)}t.print_token(e),i=i||t.previous_token_wrapped(),n.has_wrapped_attrs=i}return s};Er.prototype._handle_text=function(t,e,n){var r={text:e.text,type:"TK_CONTENT"};return n.custom_beautifier_name?this._print_custom_beatifier_text(t,e,n):n.is_unformatted||n.is_content_unformatted?t.add_raw_token(e):(t.traverse_whitespace(e),t.print_token(e)),r};Er.prototype._print_custom_beatifier_text=function(t,e,n){var r=this;if(e.text!==""){var i=e.text,s,a=1,o="",l="";n.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?s=this._js_beautify:n.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?s=this._css_beautify:n.custom_beautifier_name==="html"&&(s=function(p,d){var g=new Er(p,d,r._js_beautify,r._css_beautify);return g.beautify()}),this._options.indent_scripts==="keep"?a=0:this._options.indent_scripts==="separate"&&(a=-t.indent_level);var u=t.get_full_indent(a);if(i=i.replace(/\n[ \t]*$/,""),n.custom_beautifier_name!=="html"&&i[0]==="<"&&i.match(/^(|]]>)$/.exec(i);if(!c){t.add_raw_token(e);return}o=u+c[1]+` `,i=c[4],c[5]&&(l=u+c[5]),i=i.replace(/\n[ \t]*$/,""),(c[2]||c[3].indexOf(` `)!==-1)&&(c=c[3].match(/[ \t]+$/),c&&(e.whitespace_before=c[0]))}if(i)if(s){var f=function(){this.eol=` `};f.prototype=this._options.raw_options;var h=new f;i=s(u+i,h)}else{var y=e.whitespace_before;y&&(i=i.replace(new RegExp(` (`+y+")?","g"),` `)),i=u+i.replace(/\n/g,` `+u)}o&&(i?i=o+i+` -`+l:i=o+l),t.print_newline(!1),i&&(e.text=i,e.whitespace_before="",e.newlines=0,t.add_raw_token(e),t.print_newline(!0))}};Er.prototype._handle_tag_open=function(t,e,n,r){var i=this._get_tag_open_token(e);return(n.is_unformatted||n.is_content_unformatted)&&!n.is_empty_element&&e.type===ot.TAG_OPEN&&e.text.indexOf("]*)/),this.tag_check=n?n[1]:""):(n=e.text.match(/^{{(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=n?n[1]:"",e.text==="{{#>"&&this.tag_check===">"&&e.next!==null&&(this.tag_check=e.next.text)),this.tag_check=this.tag_check.toLowerCase(),e.type===ot.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||e.closed&&e.closed.text==="/>",this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(2)))}};Er.prototype._get_tag_open_token=function(t){var e=new tC(this._tag_stack.get_parser_token(),t);return e.alignment_size=this._options.wrap_attributes_indent_size,e.is_end_tag=e.is_end_tag||zl(e.tag_check,this._options.void_elements),e.is_empty_element=e.tag_complete||e.is_start_tag&&e.is_end_tag,e.is_unformatted=!e.tag_complete&&zl(e.tag_check,this._options.unformatted),e.is_content_unformatted=!e.is_empty_element&&zl(e.tag_check,this._options.content_unformatted),e.is_inline_element=zl(e.tag_name,this._options.inline)||e.tag_start_char==="{",e};Er.prototype._set_tag_position=function(t,e,n,r,i){if(n.is_empty_element||(n.is_end_tag?n.start_tag_token=this._tag_stack.try_pop(n.tag_name):(this._do_optional_end_element(n)&&(n.is_inline_element||t.print_newline(!1)),this._tag_stack.record_tag(n),(n.tag_name==="script"||n.tag_name==="style")&&!(n.is_unformatted||n.is_content_unformatted)&&(n.custom_beautifier_name=SF(n.tag_check,e)))),zl(n.tag_check,this._options.extra_liners)&&(t.print_newline(!1),t._output.just_added_blankline()||t.print_newline(!0)),n.is_empty_element){if(n.tag_start_char==="{"&&n.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),n.indent_content=!0;var s=t.current_line_has_match(/{{#if/);s||t.print_newline(!1)}n.tag_name==="!--"&&i.type===ot.TAG_CLOSE&&r.is_end_tag&&n.text.indexOf(` -`)===-1||(n.is_inline_element||n.is_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,n))}else if(n.is_end_tag){var a=!1;a=n.start_tag_token&&n.start_tag_token.multiline_content,a=a||!n.is_inline_element&&!(r.is_inline_element||r.is_unformatted)&&!(i.type===ot.TAG_CLOSE&&n.start_tag_token===r)&&i.type!=="TK_CONTENT",(n.is_content_unformatted||n.is_unformatted)&&(a=!1),a&&t.print_newline(!1)}else n.indent_content=!n.custom_beautifier_name,n.tag_start_char==="<"&&(n.tag_name==="html"?n.indent_content=this._options.indent_inner_html:n.tag_name==="head"?n.indent_content=this._options.indent_head_inner_html:n.tag_name==="body"&&(n.indent_content=this._options.indent_body_inner_html)),!(n.is_inline_element||n.is_unformatted)&&(i.type!=="TK_CONTENT"||n.is_content_unformatted)&&t.print_newline(!1),this._calcluate_parent_multiline(t,n)};Er.prototype._calcluate_parent_multiline=function(t,e){e.parent&&t._output.just_added_newline()&&!((e.is_inline_element||e.is_unformatted)&&e.parent.is_inline_element)&&(e.parent.multiline_content=!0)};var IF=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],DF=["a","audio","del","ins","map","noscript","video"];Er.prototype._do_optional_end_element=function(t){var e=null;if(!(t.is_empty_element||!t.is_start_tag||!t.parent)){if(t.tag_name==="body")e=e||this._tag_stack.try_pop("head");else if(t.tag_name==="li")e=e||this._tag_stack.try_pop("li",["ol","ul"]);else if(t.tag_name==="dd"||t.tag_name==="dt")e=e||this._tag_stack.try_pop("dt",["dl"]),e=e||this._tag_stack.try_pop("dd",["dl"]);else if(t.parent.tag_name==="p"&&IF.indexOf(t.tag_name)!==-1){var n=t.parent.parent;(!n||DF.indexOf(n.tag_name)===-1)&&(e=e||this._tag_stack.try_pop("p"))}else t.tag_name==="rp"||t.tag_name==="rt"?(e=e||this._tag_stack.try_pop("rt",["ruby","rtc"]),e=e||this._tag_stack.try_pop("rp",["ruby","rtc"])):t.tag_name==="optgroup"?e=e||this._tag_stack.try_pop("optgroup",["select"]):t.tag_name==="option"?e=e||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):t.tag_name==="colgroup"?e=e||this._tag_stack.try_pop("caption",["table"]):t.tag_name==="thead"?(e=e||this._tag_stack.try_pop("caption",["table"]),e=e||this._tag_stack.try_pop("colgroup",["table"])):t.tag_name==="tbody"||t.tag_name==="tfoot"?(e=e||this._tag_stack.try_pop("caption",["table"]),e=e||this._tag_stack.try_pop("colgroup",["table"]),e=e||this._tag_stack.try_pop("thead",["table"]),e=e||this._tag_stack.try_pop("tbody",["table"])):t.tag_name==="tr"?(e=e||this._tag_stack.try_pop("caption",["table"]),e=e||this._tag_stack.try_pop("colgroup",["table"]),e=e||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(t.tag_name==="th"||t.tag_name==="td")&&(e=e||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),e=e||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return t.parent=this._tag_stack.get_parser_token(),e}};nC.exports.Beautifier=Er});var iC=X((IZ,um)=>{"use strict";var xF=rC().Beautifier,RF=sm().Options;function wF(t,e,n,r){var i=new xF(t,e,n,r);return i.beautify()}um.exports=wF;um.exports.defaultOptions=function(){return new RF}});var uC=X((DZ,bf)=>{"use strict";var sC=VN(),aC=KN(),oC=iC();function lC(t,e,n,r){return n=n||sC,r=r||aC,oC(t,e,n,r)}lC.defaultOptions=oC.defaultOptions;bf.exports.js=sC;bf.exports.css=aC;bf.exports.html=lC});var pC=X((xZ,fC)=>{"use strict";function cC(t,e,n){var r=function(i,s){return t.js_beautify(i,s)};return r.js=t.js_beautify,r.css=e.css_beautify,r.html=n.html_beautify,r.js_beautify=t.js_beautify,r.css_beautify=e.css_beautify,r.html_beautify=n.html_beautify,r}typeof define=="function"&&define.amd?define(["./lib/beautify","./lib/beautify-css","./lib/beautify-html"],function(t,e,n){return cC(t,e,n)}):function(t){var e=uC();e.js_beautify=e.js,e.css_beautify=e.css,e.html_beautify=e.html,t.exports=cC(e,e,e)}(fC)});var mC=X((FZ,hC)=>{"use strict";var cm=require("fs"),LF=require("util"),FF=require("path"),ai,dC=class{constructor(e){e=e||{},this.directory=e.directory||"./locales",this.updateFiles=typeof e.updateFiles=="boolean"?e.updateFiles:!0,this.locale=e.locale||"en",this.fallbackToLanguage=typeof e.fallbackToLanguage=="boolean"?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let n=e.shift(),r=function(){};return typeof e[e.length-1]=="function"&&(r=e.pop()),r=r||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][n]&&this.updateFiles?(this.cache[this.locale][n]=n,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:r})):r(),ai.format.apply(ai.format,[this.cache[this.locale][n]||n].concat(e))}__n(){let e=Array.prototype.slice.call(arguments),n=e.shift(),r=e.shift(),i=e.shift(),s=function(){};typeof e[e.length-1]=="function"&&(s=e.pop()),this.cache[this.locale]||this._readLocaleFile();let a=i===1?n:r;this.cache[this.locale][n]&&(a=this.cache[this.locale][n][i===1?"one":"other"]),!this.cache[this.locale][n]&&this.updateFiles?(this.cache[this.locale][n]={one:n,other:r},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();let o=[a];return~a.indexOf("%d")&&o.push(i),ai.format.apply(ai.format,o.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(this.cache[this.locale][n]=e[n])}_taggedLiteral(e,...n){let r="";return e.forEach(function(i,s){let a=n[s+1];r+=i,typeof a!="undefined"&&(r+="%s")}),this.__.apply(this,[r].concat([].slice.call(n,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let e=this,n=this.writeQueue[0],r=n.directory,i=n.locale,s=n.cb,a=this._resolveLocaleFile(r,i),o=JSON.stringify(this.cache[i],null,2);ai.fs.writeFile(a,o,"utf-8",function(l){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),s(l)})}_readLocaleFile(){let e={},n=this._resolveLocaleFile(this.directory,this.locale);try{ai.fs.readFileSync&&(e=JSON.parse(ai.fs.readFileSync(n,"utf-8")))}catch(r){if(r instanceof SyntaxError&&(r.message="syntax error in "+n),r.code==="ENOENT")e={};else throw r}this.cache[this.locale]=e}_resolveLocaleFile(e,n){let r=ai.resolve(e,"./",n+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(r)&&~n.lastIndexOf("_")){let i=ai.resolve(e,"./",n.split("_")[0]+".json");this._fileExistsSync(i)&&(r=i)}return r}_fileExistsSync(e){return ai.exists(e)}};function kF(t,e){ai=e;let n=new dC(t);return{__:n.__.bind(n),__n:n.__n.bind(n),setLocale:n.setLocale.bind(n),getLocale:n.getLocale.bind(n),updateLocale:n.updateLocale.bind(n),locale:n.locale}}var MF={fs:{readFileSync:cm.readFileSync,writeFile:cm.writeFile},format:LF.format,resolve:FF.resolve,exists:t=>{try{return cm.statSync(t).isFile()}catch{return!1}}},BF=t=>kF(t,MF);hC.exports=BF});var pm=X((kZ,CC)=>{"use strict";var qF=require("util"),gC=require("path"),VF=require("fs");function Xl(t){if(t!==t.toLowerCase()&&t!==t.toUpperCase()||(t=t.toLowerCase()),t.indexOf("-")===-1&&t.indexOf("_")===-1)return t;{let n="",r=!1,i=t.match(/^-+/);for(let s=i?i[0].length:0;s0?r+=`${e}${n.charAt(i)}`:r+=a}return r}function yC(t){return t==null?!1:typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^0[^.]/.test(t)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function jF(t){if(Array.isArray(t))return t.map(a=>typeof a!="string"?a+"":a);t=t.trim();let e=0,n=null,r=null,i=null,s=[];for(let a=0;a{typeof B=="number"&&(g.nargs[R]=B,g.keys.push(R))}),typeof r.coerce=="object"&&Object.entries(r.coerce).forEach(([R,B])=>{typeof B=="function"&&(g.coercions[R]=B,g.keys.push(R))}),typeof r.config!="undefined"&&(Array.isArray(r.config)||typeof r.config=="string"?[].concat(r.config).filter(Boolean).forEach(function(R){g.configs[R]=!0}):typeof r.config=="object"&&Object.entries(r.config).forEach(([R,B])=>{(typeof B=="boolean"||typeof B=="function")&&(g.configs[R]=B)})),Ge(r.key,a,r.default,g.arrays),Object.keys(l).forEach(function(R){(g.aliases[R]||[]).forEach(function(B){l[B]=l[R]})});let _=null;Mo();let N=[],C=Object.assign(Object.create(null),{_:[]}),G={};for(let R=0;R=3&&(J(le[1],g.arrays)?R=$(R,le[1],i,le[2]):J(le[1],g.nargs)!==!1?R=M(R,le[1],i,le[2]):K(le[1],le[2],!0));else if(B.match(b)&&o["boolean-negation"])le=B.match(b),le!==null&&Array.isArray(le)&&le.length>=2&&(k=le[1],K(k,J(k,g.arrays)?[!1]:!1));else if(B.match(/^--.+/)||!o["short-option-groups"]&&B.match(/^-[^-]+/))le=B.match(/^--?(.+)/),le!==null&&Array.isArray(le)&&le.length>=2&&(k=le[1],J(k,g.arrays)?R=$(R,k,i):J(k,g.nargs)!==!1?R=M(R,k,i):(me=i[R+1],me!==void 0&&(!me.match(/^-/)||me.match(m))&&!J(k,g.bools)&&!J(k,g.counts)||/^(true|false)$/.test(me)?(K(k,me),R++):K(k,ui(k))));else if(B.match(/^-.\..+=/))le=B.match(/^-([^=]+)=([\s\S]*)$/),le!==null&&Array.isArray(le)&&le.length>=3&&K(le[1],le[2]);else if(B.match(/^-.\..+/)&&!B.match(m))me=i[R+1],le=B.match(/^-(.\..+)/),le!==null&&Array.isArray(le)&&le.length>=2&&(k=le[1],me!==void 0&&!me.match(/^-/)&&!J(k,g.bools)&&!J(k,g.counts)?(K(k,me),R++):K(k,ui(k)));else if(B.match(/^-[^-]+/)&&!B.match(m)){ce=B.slice(1,-1).split(""),Y=!1;for(let kt=0;ktR!=="--"&&R.includes("-")).forEach(R=>{delete C[R]}),o["strip-aliased"]&&[].concat(...Object.keys(a).map(R=>a[R])).forEach(R=>{o["camel-case-expansion"]&&R.includes("-")&&delete C[R.split(".").map(B=>Xl(B)).join(".")],delete C[R]});function L(R){let B=ye("_",R);(typeof B=="string"||typeof B=="number")&&C._.push(B)}function M(R,B,te,Y){let k,ce=J(B,g.nargs);if(ce=typeof ce!="number"||isNaN(ce)?1:ce,ce===0)return Gn(Y)||(_=Error(d("Argument unexpected for: %s",B))),K(B,ui(B)),R;let le=Gn(Y)?0:1;if(o["nargs-eats-options"])te.length-(R+1)+le0&&(K(B,Y),me--),k=R+1;k0||le&&typeof le=="number"&&k.length>=le||(ce=te[me],/^-/.test(ce)&&!m.test(ce)&&!vn(ce)));me++)R=me,k.push(re(B,ce,s))}return typeof le=="number"&&(le&&k.length1&&o["dot-notation"]&&(g.aliases[k[0]]||[]).forEach(function(ce){let le=ce.split("."),me=[].concat(k);me.shift(),le=le.concat(me),(g.aliases[R]||[]).includes(le.join("."))||Re(C,le,Y)}),J(R,g.normalize)&&!J(R,g.arrays)&&[R].concat(g.aliases[R]||[]).forEach(function(le){Object.defineProperty(G,le,{enumerable:!0,get(){return B},set(me){B=typeof me=="string"?Hi.normalize(me):me}})})}function ne(R,B){g.aliases[R]&&g.aliases[R].length||(g.aliases[R]=[B],y[B]=!0),g.aliases[B]&&g.aliases[B].length||ne(B,R)}function re(R,B,te){te&&(B=WF(B)),(J(R,g.bools)||J(R,g.counts))&&typeof B=="string"&&(B=B==="true");let Y=Array.isArray(B)?B.map(function(k){return ye(R,k)}):ye(R,B);return J(R,g.counts)&&(Gn(Y)||typeof Y=="boolean")&&(Y=fm()),J(R,g.normalize)&&J(R,g.arrays)&&(Array.isArray(B)?Y=B.map(k=>Hi.normalize(k)):Y=Hi.normalize(B)),Y}function ye(R,B){return!o["parse-positional-numbers"]&&R==="_"||!J(R,g.strings)&&!J(R,g.bools)&&!Array.isArray(B)&&(yC(B)&&o["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${B}`)))||!Gn(B)&&J(R,g.numbers))&&(B=Number(B)),B}function Ce(R){let B=Object.create(null);ft(B,g.aliases,l),Object.keys(g.configs).forEach(function(te){let Y=R[te]||B[te];if(Y)try{let k=null,ce=Hi.resolve(Hi.cwd(),Y),le=g.configs[te];if(typeof le=="function"){try{k=le(ce)}catch(me){k=me}if(k instanceof Error){_=k;return}}else k=Hi.require(ce);ae(k)}catch(k){k.name==="PermissionDenied"?_=k:R[te]&&(_=Error(d("Invalid JSON config file: %s",Y)))}})}function ae(R,B){Object.keys(R).forEach(function(te){let Y=R[te],k=B?B+"."+te:te;typeof Y=="object"&&Y!==null&&!Array.isArray(Y)&&o["dot-notation"]?ae(Y,k):(!pe(C,k.split("."))||J(k,g.arrays)&&o["combine-arrays"])&&K(k,Y)})}function Pe(){typeof u!="undefined"&&u.forEach(function(R){ae(R)})}function ct(R,B){if(typeof c=="undefined")return;let te=typeof c=="string"?c:"",Y=Hi.env();Object.keys(Y).forEach(function(k){if(te===""||k.lastIndexOf(te,0)===0){let ce=k.split("__").map(function(le,me){return me===0&&(le=le.substring(te.length)),Xl(le)});(B&&g.configs[ce.join(".")]||!B)&&!pe(R,ce)&&K(ce.join("."),Y[k])}})}function Jt(R){let B,te=new Set;Object.keys(R).forEach(function(Y){if(!te.has(Y)&&(B=J(Y,g.coercions),typeof B=="function"))try{let k=ye(Y,B(R[Y]));[].concat(g.aliases[Y]||[],Y).forEach(ce=>{te.add(ce),R[ce]=k})}catch(k){_=k}})}function Je(R){return g.keys.forEach(B=>{~B.indexOf(".")||typeof R[B]=="undefined"&&(R[B]=void 0)}),R}function ft(R,B,te,Y=!1){Object.keys(te).forEach(function(k){pe(R,k.split("."))||(Re(R,k.split("."),te[k]),Y&&(p[k]=!0),(B[k]||[]).forEach(function(ce){pe(R,ce.split("."))||Re(R,ce.split("."),te[k])}))})}function pe(R,B){let te=R;o["dot-notation"]||(B=[B.join(".")]),B.slice(0,-1).forEach(function(k){te=te[k]||{}});let Y=B[B.length-1];return typeof te!="object"?!1:Y in te}function Re(R,B,te){let Y=R;o["dot-notation"]||(B=[B.join(".")]),B.slice(0,-1).forEach(function(bt){bt=TC(bt),typeof Y=="object"&&Y[bt]===void 0&&(Y[bt]={}),typeof Y[bt]!="object"||Array.isArray(Y[bt])?(Array.isArray(Y[bt])?Y[bt].push({}):Y[bt]=[Y[bt],{}],Y=Y[bt][Y[bt].length-1]):Y=Y[bt]});let k=TC(B[B.length-1]),ce=J(B.join("."),g.arrays),le=Array.isArray(te),me=o["duplicate-arguments-array"];!me&&J(k,g.nargs)&&(me=!0,(!Gn(Y[k])&&g.nargs[k]===1||Array.isArray(Y[k])&&Y[k].length===g.nargs[k])&&(Y[k]=void 0)),te===fm()?Y[k]=fm(Y[k]):Array.isArray(Y[k])?me&&ce&&le?Y[k]=o["flatten-duplicate-arrays"]?Y[k].concat(te):(Array.isArray(Y[k][0])?Y[k]:[Y[k]]).concat([te]):!me&&Boolean(ce)===Boolean(le)?Y[k]=te:Y[k]=Y[k].concat([te]):Y[k]===void 0&&ce?Y[k]=le?te:[te]:me&&!(Y[k]===void 0||J(k,g.counts)||J(k,g.bools))?Y[k]=[Y[k],te]:Y[k]=te}function Ge(...R){R.forEach(function(B){Object.keys(B||{}).forEach(function(te){g.aliases[te]||(g.aliases[te]=[].concat(a[te]||[]),g.aliases[te].concat(te).forEach(function(Y){if(/-/.test(Y)&&o["camel-case-expansion"]){let k=Xl(Y);k!==te&&g.aliases[te].indexOf(k)===-1&&(g.aliases[te].push(k),y[k]=!0)}}),g.aliases[te].concat(te).forEach(function(Y){if(Y.length>1&&/[A-Z]/.test(Y)&&o["camel-case-expansion"]){let k=_C(Y,"-");k!==te&&g.aliases[te].indexOf(k)===-1&&(g.aliases[te].push(k),y[k]=!0)}}),g.aliases[te].forEach(function(Y){g.aliases[Y]=[te].concat(g.aliases[te].filter(function(k){return Y!==k}))}))})})}function J(R,B){let te=[].concat(g.aliases[R]||[],R),Y=Object.keys(B),k=te.find(ce=>Y.includes(ce));return k?B[k]:!1}function pt(R){let B=Object.keys(g);return[].concat(B.map(Y=>g[Y])).some(function(Y){return Array.isArray(Y)?Y.includes(R):Y[R]})}function st(R,...B){return[].concat(...B).some(function(Y){let k=R.match(Y);return k&&pt(k[1])})}function Dt(R){if(R.match(m)||!R.match(/^-[^-]+/))return!1;let B=!0,te,Y=R.slice(1).split("");for(let k=0;kJ(R,g.arrays)?(_=Error(d("Invalid configuration: %s, opts.count excludes opts.array.",R)),!0):J(R,g.nargs)?(_=Error(d("Invalid configuration: %s, opts.count excludes opts.narg.",R)),!0):!1)}return{aliases:Object.assign({},g.aliases),argv:Object.assign(G,C),configuration:o,defaulted:Object.assign({},p),error:_,newAliases:Object.assign({},y)}}};function UF(t){let e=[],n=Object.create(null),r=!0;for(Object.keys(t).forEach(function(i){e.push([].concat(t[i],i))});r;){r=!1;for(let i=0;iGF,format:qF.format,normalize:gC.normalize,resolve:gC.resolve,require:t=>{if(typeof require!="undefined")return require(t);if(t.match(/\.json$/))return JSON.parse(VF.readFileSync(t,"utf8"));throw Error("only .json config files are supported in ESM")}}),Ql=function(e,n){return NC.parse(e.slice(),n).argv};Ql.detailed=function(t,e){return NC.parse(t.slice(),e)};Ql.camelCase=Xl;Ql.decamelize=_C;Ql.looksLikeNumber=yC;CC.exports=Ql});var AC=X((MZ,PC)=>{"use strict";PC.exports=({onlyFirst:t=!1}={})=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}});var vf=X((BZ,SC)=>{"use strict";var YF=AC();SC.exports=t=>typeof t=="string"?t.replace(YF(),""):t});var IC=X((qZ,dm)=>{"use strict";var EC=t=>Number.isNaN(t)?!1:t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141);dm.exports=EC;dm.exports.default=EC});var xC=X((VZ,DC)=>{"use strict";DC.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var Nf=X((jZ,hm)=>{"use strict";var HF=vf(),$F=IC(),KF=xC(),RC=t=>{if(typeof t!="string"||t.length===0||(t=HF(t),t.length===0))return 0;t=t.replace(KF()," ");let e=0;for(let n=0;n=127&&r<=159||r>=768&&r<=879||(r>65535&&n++,e+=$F(r)?2:1)}return e};hm.exports=RC;hm.exports.default=RC});var OC=X((UZ,wC)=>{"use strict";wC.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var mm=X((WZ,FC)=>{var Jl=OC(),LC={};for(let t of Object.keys(Jl))LC[Jl[t]]=t;var _e={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};FC.exports=_e;for(let t of Object.keys(_e)){if(!("channels"in _e[t]))throw new Error("missing channels property: "+t);if(!("labels"in _e[t]))throw new Error("missing channel labels property: "+t);if(_e[t].labels.length!==_e[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:n}=_e[t];delete _e[t].channels,delete _e[t].labels,Object.defineProperty(_e[t],"channels",{value:e}),Object.defineProperty(_e[t],"labels",{value:n})}_e.rgb.hsl=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(e,n,r),s=Math.max(e,n,r),a=s-i,o,l;s===i?o=0:e===s?o=(n-r)/a:n===s?o=2+(r-e)/a:r===s&&(o=4+(e-n)/a),o=Math.min(o*60,360),o<0&&(o+=360);let u=(i+s)/2;return s===i?l=0:u<=.5?l=a/(s+i):l=a/(2-s-i),[o,l*100,u*100]};_e.rgb.hsv=function(t){let e,n,r,i,s,a=t[0]/255,o=t[1]/255,l=t[2]/255,u=Math.max(a,o,l),c=u-Math.min(a,o,l),f=function(h){return(u-h)/6/c+1/2};return c===0?(i=0,s=0):(s=c/u,e=f(a),n=f(o),r=f(l),a===u?i=r-n:o===u?i=1/3+e-r:l===u&&(i=2/3+n-e),i<0?i+=1:i>1&&(i-=1)),[i*360,s*100,u*100]};_e.rgb.hwb=function(t){let e=t[0],n=t[1],r=t[2],i=_e.rgb.hsl(t)[0],s=1/255*Math.min(e,Math.min(n,r));return r=1-1/255*Math.max(e,Math.max(n,r)),[i,s*100,r*100]};_e.rgb.cmyk=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(1-e,1-n,1-r),s=(1-e-i)/(1-i)||0,a=(1-n-i)/(1-i)||0,o=(1-r-i)/(1-i)||0;return[s*100,a*100,o*100,i*100]};function zF(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}_e.rgb.keyword=function(t){let e=LC[t];if(e)return e;let n=1/0,r;for(let i of Object.keys(Jl)){let s=Jl[i],a=zF(t,s);a.04045?((e+.055)/1.055)**2.4:e/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;let i=e*.4124+n*.3576+r*.1805,s=e*.2126+n*.7152+r*.0722,a=e*.0193+n*.1192+r*.9505;return[i*100,s*100,a*100]};_e.rgb.lab=function(t){let e=_e.rgb.xyz(t),n=e[0],r=e[1],i=e[2];n/=95.047,r/=100,i/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let s=116*r-16,a=500*(n-r),o=200*(r-i);return[s,a,o]};_e.hsl.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100,i,s,a;if(n===0)return a=r*255,[a,a,a];r<.5?i=r*(1+n):i=r+n-r*n;let o=2*r-i,l=[0,0,0];for(let u=0;u<3;u++)s=e+1/3*-(u-1),s<0&&s++,s>1&&s--,6*s<1?a=o+(i-o)*6*s:2*s<1?a=i:3*s<2?a=o+(i-o)*(2/3-s)*6:a=o,l[u]=a*255;return l};_e.hsl.hsv=function(t){let e=t[0],n=t[1]/100,r=t[2]/100,i=n,s=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=s<=1?s:2-s;let a=(r+n)/2,o=r===0?2*i/(s+i):2*n/(r+n);return[e,o*100,a*100]};_e.hsv.rgb=function(t){let e=t[0]/60,n=t[1]/100,r=t[2]/100,i=Math.floor(e)%6,s=e-Math.floor(e),a=255*r*(1-n),o=255*r*(1-n*s),l=255*r*(1-n*(1-s));switch(r*=255,i){case 0:return[r,l,a];case 1:return[o,r,a];case 2:return[a,r,l];case 3:return[a,o,r];case 4:return[l,a,r];case 5:return[r,a,o]}};_e.hsv.hsl=function(t){let e=t[0],n=t[1]/100,r=t[2]/100,i=Math.max(r,.01),s,a;a=(2-n)*r;let o=(2-n)*i;return s=n*i,s/=o<=1?o:2-o,s=s||0,a/=2,[e,s*100,a*100]};_e.hwb.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100,i=n+r,s;i>1&&(n/=i,r/=i);let a=Math.floor(6*e),o=1-r;s=6*e-a,(a&1)!==0&&(s=1-s);let l=n+s*(o-n),u,c,f;switch(a){default:case 6:case 0:u=o,c=l,f=n;break;case 1:u=l,c=o,f=n;break;case 2:u=n,c=o,f=l;break;case 3:u=n,c=l,f=o;break;case 4:u=l,c=n,f=o;break;case 5:u=o,c=n,f=l;break}return[u*255,c*255,f*255]};_e.cmyk.rgb=function(t){let e=t[0]/100,n=t[1]/100,r=t[2]/100,i=t[3]/100,s=1-Math.min(1,e*(1-i)+i),a=1-Math.min(1,n*(1-i)+i),o=1-Math.min(1,r*(1-i)+i);return[s*255,a*255,o*255]};_e.xyz.rgb=function(t){let e=t[0]/100,n=t[1]/100,r=t[2]/100,i,s,a;return i=e*3.2406+n*-1.5372+r*-.4986,s=e*-.9689+n*1.8758+r*.0415,a=e*.0557+n*-.204+r*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,i=Math.min(Math.max(0,i),1),s=Math.min(Math.max(0,s),1),a=Math.min(Math.max(0,a),1),[i*255,s*255,a*255]};_e.xyz.lab=function(t){let e=t[0],n=t[1],r=t[2];e/=95.047,n/=100,r/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;let i=116*n-16,s=500*(e-n),a=200*(n-r);return[i,s,a]};_e.lab.xyz=function(t){let e=t[0],n=t[1],r=t[2],i,s,a;s=(e+16)/116,i=n/500+s,a=s-r/200;let o=s**3,l=i**3,u=a**3;return s=o>.008856?o:(s-16/116)/7.787,i=l>.008856?l:(i-16/116)/7.787,a=u>.008856?u:(a-16/116)/7.787,i*=95.047,s*=100,a*=108.883,[i,s,a]};_e.lab.lch=function(t){let e=t[0],n=t[1],r=t[2],i;i=Math.atan2(r,n)*360/2/Math.PI,i<0&&(i+=360);let a=Math.sqrt(n*n+r*r);return[e,a,i]};_e.lch.lab=function(t){let e=t[0],n=t[1],i=t[2]/360*2*Math.PI,s=n*Math.cos(i),a=n*Math.sin(i);return[e,s,a]};_e.rgb.ansi16=function(t,e=null){let[n,r,i]=t,s=e===null?_e.rgb.hsv(t)[2]:e;if(s=Math.round(s/50),s===0)return 30;let a=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return s===2&&(a+=60),a};_e.hsv.ansi16=function(t){return _e.rgb.ansi16(_e.hsv.rgb(t),t[2])};_e.rgb.ansi256=function(t){let e=t[0],n=t[1],r=t[2];return e===n&&n===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)};_e.ansi16.rgb=function(t){let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let n=(~~(t>50)+1)*.5,r=(e&1)*n*255,i=(e>>1&1)*n*255,s=(e>>2&1)*n*255;return[r,i,s]};_e.ansi256.rgb=function(t){if(t>=232){let s=(t-232)*10+8;return[s,s,s]}t-=16;let e,n=Math.floor(t/36)/5*255,r=Math.floor((e=t%36)/6)/5*255,i=e%6/5*255;return[n,r,i]};_e.rgb.hex=function(t){let n=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".substring(n.length)+n};_e.hex.rgb=function(t){let e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let n=e[0];e[0].length===3&&(n=n.split("").map(o=>o+o).join(""));let r=parseInt(n,16),i=r>>16&255,s=r>>8&255,a=r&255;return[i,s,a]};_e.rgb.hcg=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.max(Math.max(e,n),r),s=Math.min(Math.min(e,n),r),a=i-s,o,l;return a<1?o=s/(1-a):o=0,a<=0?l=0:i===e?l=(n-r)/a%6:i===n?l=2+(r-e)/a:l=4+(e-n)/a,l/=6,l%=1,[l*360,a*100,o*100]};_e.hsl.hcg=function(t){let e=t[1]/100,n=t[2]/100,r=n<.5?2*e*n:2*e*(1-n),i=0;return r<1&&(i=(n-.5*r)/(1-r)),[t[0],r*100,i*100]};_e.hsv.hcg=function(t){let e=t[1]/100,n=t[2]/100,r=e*n,i=0;return r<1&&(i=(n-r)/(1-r)),[t[0],r*100,i*100]};_e.hcg.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100;if(n===0)return[r*255,r*255,r*255];let i=[0,0,0],s=e%1*6,a=s%1,o=1-a,l=0;switch(Math.floor(s)){case 0:i[0]=1,i[1]=a,i[2]=0;break;case 1:i[0]=o,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=a;break;case 3:i[0]=0,i[1]=o,i[2]=1;break;case 4:i[0]=a,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=o}return l=(1-n)*r,[(n*i[0]+l)*255,(n*i[1]+l)*255,(n*i[2]+l)*255]};_e.hcg.hsv=function(t){let e=t[1]/100,n=t[2]/100,r=e+n*(1-e),i=0;return r>0&&(i=e/r),[t[0],i*100,r*100]};_e.hcg.hsl=function(t){let e=t[1]/100,r=t[2]/100*(1-e)+.5*e,i=0;return r>0&&r<.5?i=e/(2*r):r>=.5&&r<1&&(i=e/(2*(1-r))),[t[0],i*100,r*100]};_e.hcg.hwb=function(t){let e=t[1]/100,n=t[2]/100,r=e+n*(1-e);return[t[0],(r-e)*100,(1-r)*100]};_e.hwb.hcg=function(t){let e=t[1]/100,n=t[2]/100,r=1-n,i=r-e,s=0;return i<1&&(s=(r-i)/(1-i)),[t[0],i*100,s*100]};_e.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};_e.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};_e.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};_e.gray.hsl=function(t){return[0,0,t[0]]};_e.gray.hsv=_e.gray.hsl;_e.gray.hwb=function(t){return[0,100,t[0]]};_e.gray.cmyk=function(t){return[0,0,0,t[0]]};_e.gray.lab=function(t){return[t[0],0,0]};_e.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,r=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(r.length)+r};_e.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var MC=X((GZ,kC)=>{var Cf=mm();function XF(){let t={},e=Object.keys(Cf);for(let n=e.length,r=0;r{var gm=mm(),ek=MC(),So={},tk=Object.keys(gm);function nk(t){let e=function(...n){let r=n[0];return r==null?r:(r.length>1&&(n=r),t(n))};return"conversion"in t&&(e.conversion=t.conversion),e}function rk(t){let e=function(...n){let r=n[0];if(r==null)return r;r.length>1&&(n=r);let i=t(n);if(typeof i=="object")for(let s=i.length,a=0;a{So[t]={},Object.defineProperty(So[t],"channels",{value:gm[t].channels}),Object.defineProperty(So[t],"labels",{value:gm[t].labels});let e=ek(t);Object.keys(e).forEach(r=>{let i=e[r];So[t][r]=rk(i),So[t][r].raw=nk(i)})});BC.exports=So});var YC=X((HZ,GC)=>{"use strict";var VC=(t,e)=>(...n)=>`\x1B[${t(...n)+e}m`,jC=(t,e)=>(...n)=>{let r=t(...n);return`\x1B[${38+e};5;${r}m`},UC=(t,e)=>(...n)=>{let r=t(...n);return`\x1B[${38+e};2;${r[0]};${r[1]};${r[2]}m`},Pf=t=>t,WC=(t,e,n)=>[t,e,n],Eo=(t,e,n)=>{Object.defineProperty(t,e,{get:()=>{let r=n();return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0}),r},enumerable:!0,configurable:!0})},_m,Io=(t,e,n,r)=>{_m===void 0&&(_m=qC());let i=r?10:0,s={};for(let[a,o]of Object.entries(_m)){let l=a==="ansi16"?"ansi":a;a===e?s[l]=t(n,i):typeof o=="object"&&(s[l]=t(o[e],i))}return s};function ik(){let t=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[n,r]of Object.entries(e)){for(let[i,s]of Object.entries(r))e[i]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[i]=e[i],t.set(s[0],s[1]);Object.defineProperty(e,n,{value:r,enumerable:!1})}return Object.defineProperty(e,"codes",{value:t,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",Eo(e.color,"ansi",()=>Io(VC,"ansi16",Pf,!1)),Eo(e.color,"ansi256",()=>Io(jC,"ansi256",Pf,!1)),Eo(e.color,"ansi16m",()=>Io(UC,"rgb",WC,!1)),Eo(e.bgColor,"ansi",()=>Io(VC,"ansi16",Pf,!0)),Eo(e.bgColor,"ansi256",()=>Io(jC,"ansi256",Pf,!0)),Eo(e.bgColor,"ansi16m",()=>Io(UC,"rgb",WC,!0)),e}Object.defineProperty(GC,"exports",{enumerable:!0,get:ik})});var QC=X(($Z,XC)=>{"use strict";var Zl=Nf(),sk=vf(),ak=YC(),Af=new Set(["\x1B","\x9B"]),ok=39,ym="\x07",HC="[",lk="]",$C="m",bm=`${lk}8;;`,KC=t=>`${Af.values().next().value}${HC}${t}${$C}`,zC=t=>`${Af.values().next().value}${bm}${t}${ym}`,uk=t=>t.split(" ").map(e=>Zl(e)),Tm=(t,e,n)=>{let r=[...e],i=!1,s=!1,a=Zl(sk(t[t.length-1]));for(let[o,l]of r.entries()){let u=Zl(l);if(a+u<=n?t[t.length-1]+=l:(t.push(l),a=0),Af.has(l)&&(i=!0,s=r.slice(o+1).join("").startsWith(bm)),i){s?l===ym&&(i=!1,s=!1):l===$C&&(i=!1);continue}a+=u,a===n&&o0&&t.length>1&&(t[t.length-2]+=t.pop())},ck=t=>{let e=t.split(" "),n=e.length;for(;n>0&&!(Zl(e[n-1])>0);)n--;return n===e.length?t:e.slice(0,n).join(" ")+e.slice(n).join("")},fk=(t,e,n={})=>{if(n.trim!==!1&&t.trim()==="")return"";let r="",i,s,a=uk(t),o=[""];for(let[u,c]of t.split(" ").entries()){n.trim!==!1&&(o[o.length-1]=o[o.length-1].trimStart());let f=Zl(o[o.length-1]);if(u!==0&&(f>=e&&(n.wordWrap===!1||n.trim===!1)&&(o.push(""),f=0),(f>0||n.trim===!1)&&(o[o.length-1]+=" ",f++)),n.hard&&a[u]>e){let h=e-f,y=1+Math.floor((a[u]-h-1)/e);Math.floor((a[u]-1)/e)e&&f>0&&a[u]>0){if(n.wordWrap===!1&&fe&&n.wordWrap===!1){Tm(o,c,e);continue}o[o.length-1]+=c}n.trim!==!1&&(o=o.map(ck));let l=[...o.join(` -`)];for(let[u,c]of l.entries()){if(r+=c,Af.has(c)){let{groups:h}=new RegExp(`(?:\\${HC}(?\\d+)m|\\${bm}(?.*)${ym})`).exec(l.slice(u).join(""))||{groups:{}};if(h.code!==void 0){let y=Number.parseFloat(h.code);i=y===ok?void 0:y}else h.uri!==void 0&&(s=h.uri.length===0?void 0:h.uri)}let f=ak.codes.get(Number(i));l[u+1]===` -`?(s&&(r+=zC("")),i&&f&&(r+=KC(f))):c===` -`&&(i&&f&&(r+=KC(i)),s&&(r+=zC(s)))}return r};XC.exports=(t,e,n)=>String(t).normalize().replace(/\r\n/g,` +`+l:i=o+l),t.print_newline(!1),i&&(e.text=i,e.whitespace_before="",e.newlines=0,t.add_raw_token(e),t.print_newline(!0))}};Er.prototype._handle_tag_open=function(t,e,n,r){var i=this._get_tag_open_token(e);return(n.is_unformatted||n.is_content_unformatted)&&!n.is_empty_element&&e.type===ot.TAG_OPEN&&e.text.indexOf("]*)/),this.tag_check=n?n[1]:""):(n=e.text.match(/^{{(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=n?n[1]:"",e.text==="{{#>"&&this.tag_check===">"&&e.next!==null&&(this.tag_check=e.next.text)),this.tag_check=this.tag_check.toLowerCase(),e.type===ot.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||e.closed&&e.closed.text==="/>",this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(2)))}};Er.prototype._get_tag_open_token=function(t){var e=new nC(this._tag_stack.get_parser_token(),t);return e.alignment_size=this._options.wrap_attributes_indent_size,e.is_end_tag=e.is_end_tag||zl(e.tag_check,this._options.void_elements),e.is_empty_element=e.tag_complete||e.is_start_tag&&e.is_end_tag,e.is_unformatted=!e.tag_complete&&zl(e.tag_check,this._options.unformatted),e.is_content_unformatted=!e.is_empty_element&&zl(e.tag_check,this._options.content_unformatted),e.is_inline_element=zl(e.tag_name,this._options.inline)||e.tag_start_char==="{",e};Er.prototype._set_tag_position=function(t,e,n,r,i){if(n.is_empty_element||(n.is_end_tag?n.start_tag_token=this._tag_stack.try_pop(n.tag_name):(this._do_optional_end_element(n)&&(n.is_inline_element||t.print_newline(!1)),this._tag_stack.record_tag(n),(n.tag_name==="script"||n.tag_name==="style")&&!(n.is_unformatted||n.is_content_unformatted)&&(n.custom_beautifier_name=IF(n.tag_check,e)))),zl(n.tag_check,this._options.extra_liners)&&(t.print_newline(!1),t._output.just_added_blankline()||t.print_newline(!0)),n.is_empty_element){if(n.tag_start_char==="{"&&n.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),n.indent_content=!0;var s=t.current_line_has_match(/{{#if/);s||t.print_newline(!1)}n.tag_name==="!--"&&i.type===ot.TAG_CLOSE&&r.is_end_tag&&n.text.indexOf(` +`)===-1||(n.is_inline_element||n.is_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,n))}else if(n.is_end_tag){var a=!1;a=n.start_tag_token&&n.start_tag_token.multiline_content,a=a||!n.is_inline_element&&!(r.is_inline_element||r.is_unformatted)&&!(i.type===ot.TAG_CLOSE&&n.start_tag_token===r)&&i.type!=="TK_CONTENT",(n.is_content_unformatted||n.is_unformatted)&&(a=!1),a&&t.print_newline(!1)}else n.indent_content=!n.custom_beautifier_name,n.tag_start_char==="<"&&(n.tag_name==="html"?n.indent_content=this._options.indent_inner_html:n.tag_name==="head"?n.indent_content=this._options.indent_head_inner_html:n.tag_name==="body"&&(n.indent_content=this._options.indent_body_inner_html)),!(n.is_inline_element||n.is_unformatted)&&(i.type!=="TK_CONTENT"||n.is_content_unformatted)&&t.print_newline(!1),this._calcluate_parent_multiline(t,n)};Er.prototype._calcluate_parent_multiline=function(t,e){e.parent&&t._output.just_added_newline()&&!((e.is_inline_element||e.is_unformatted)&&e.parent.is_inline_element)&&(e.parent.multiline_content=!0)};var xF=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],RF=["a","audio","del","ins","map","noscript","video"];Er.prototype._do_optional_end_element=function(t){var e=null;if(!(t.is_empty_element||!t.is_start_tag||!t.parent)){if(t.tag_name==="body")e=e||this._tag_stack.try_pop("head");else if(t.tag_name==="li")e=e||this._tag_stack.try_pop("li",["ol","ul"]);else if(t.tag_name==="dd"||t.tag_name==="dt")e=e||this._tag_stack.try_pop("dt",["dl"]),e=e||this._tag_stack.try_pop("dd",["dl"]);else if(t.parent.tag_name==="p"&&xF.indexOf(t.tag_name)!==-1){var n=t.parent.parent;(!n||RF.indexOf(n.tag_name)===-1)&&(e=e||this._tag_stack.try_pop("p"))}else t.tag_name==="rp"||t.tag_name==="rt"?(e=e||this._tag_stack.try_pop("rt",["ruby","rtc"]),e=e||this._tag_stack.try_pop("rp",["ruby","rtc"])):t.tag_name==="optgroup"?e=e||this._tag_stack.try_pop("optgroup",["select"]):t.tag_name==="option"?e=e||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):t.tag_name==="colgroup"?e=e||this._tag_stack.try_pop("caption",["table"]):t.tag_name==="thead"?(e=e||this._tag_stack.try_pop("caption",["table"]),e=e||this._tag_stack.try_pop("colgroup",["table"])):t.tag_name==="tbody"||t.tag_name==="tfoot"?(e=e||this._tag_stack.try_pop("caption",["table"]),e=e||this._tag_stack.try_pop("colgroup",["table"]),e=e||this._tag_stack.try_pop("thead",["table"]),e=e||this._tag_stack.try_pop("tbody",["table"])):t.tag_name==="tr"?(e=e||this._tag_stack.try_pop("caption",["table"]),e=e||this._tag_stack.try_pop("colgroup",["table"]),e=e||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(t.tag_name==="th"||t.tag_name==="td")&&(e=e||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),e=e||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return t.parent=this._tag_stack.get_parser_token(),e}};rC.exports.Beautifier=Er});var sC=X((OZ,um)=>{"use strict";var wF=iC().Beautifier,OF=sm().Options;function LF(t,e,n,r){var i=new wF(t,e,n,r);return i.beautify()}um.exports=LF;um.exports.defaultOptions=function(){return new OF}});var cC=X((LZ,bf)=>{"use strict";var aC=jN(),oC=zN(),lC=sC();function uC(t,e,n,r){return n=n||aC,r=r||oC,lC(t,e,n,r)}uC.defaultOptions=lC.defaultOptions;bf.exports.js=aC;bf.exports.css=oC;bf.exports.html=uC});var dC=X((FZ,pC)=>{"use strict";function fC(t,e,n){var r=function(i,s){return t.js_beautify(i,s)};return r.js=t.js_beautify,r.css=e.css_beautify,r.html=n.html_beautify,r.js_beautify=t.js_beautify,r.css_beautify=e.css_beautify,r.html_beautify=n.html_beautify,r}typeof define=="function"&&define.amd?define(["./lib/beautify","./lib/beautify-css","./lib/beautify-html"],function(t,e,n){return fC(t,e,n)}):function(t){var e=cC();e.js_beautify=e.js,e.css_beautify=e.css,e.html_beautify=e.html,t.exports=fC(e,e,e)}(pC)});var gC=X((VZ,mC)=>{"use strict";var cm=require("fs"),kF=require("util"),MF=require("path"),ai,hC=class{constructor(e){e=e||{},this.directory=e.directory||"./locales",this.updateFiles=typeof e.updateFiles=="boolean"?e.updateFiles:!0,this.locale=e.locale||"en",this.fallbackToLanguage=typeof e.fallbackToLanguage=="boolean"?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let n=e.shift(),r=function(){};return typeof e[e.length-1]=="function"&&(r=e.pop()),r=r||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][n]&&this.updateFiles?(this.cache[this.locale][n]=n,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:r})):r(),ai.format.apply(ai.format,[this.cache[this.locale][n]||n].concat(e))}__n(){let e=Array.prototype.slice.call(arguments),n=e.shift(),r=e.shift(),i=e.shift(),s=function(){};typeof e[e.length-1]=="function"&&(s=e.pop()),this.cache[this.locale]||this._readLocaleFile();let a=i===1?n:r;this.cache[this.locale][n]&&(a=this.cache[this.locale][n][i===1?"one":"other"]),!this.cache[this.locale][n]&&this.updateFiles?(this.cache[this.locale][n]={one:n,other:r},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();let o=[a];return~a.indexOf("%d")&&o.push(i),ai.format.apply(ai.format,o.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(this.cache[this.locale][n]=e[n])}_taggedLiteral(e,...n){let r="";return e.forEach(function(i,s){let a=n[s+1];r+=i,typeof a!="undefined"&&(r+="%s")}),this.__.apply(this,[r].concat([].slice.call(n,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let e=this,n=this.writeQueue[0],r=n.directory,i=n.locale,s=n.cb,a=this._resolveLocaleFile(r,i),o=JSON.stringify(this.cache[i],null,2);ai.fs.writeFile(a,o,"utf-8",function(l){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),s(l)})}_readLocaleFile(){let e={},n=this._resolveLocaleFile(this.directory,this.locale);try{ai.fs.readFileSync&&(e=JSON.parse(ai.fs.readFileSync(n,"utf-8")))}catch(r){if(r instanceof SyntaxError&&(r.message="syntax error in "+n),r.code==="ENOENT")e={};else throw r}this.cache[this.locale]=e}_resolveLocaleFile(e,n){let r=ai.resolve(e,"./",n+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(r)&&~n.lastIndexOf("_")){let i=ai.resolve(e,"./",n.split("_")[0]+".json");this._fileExistsSync(i)&&(r=i)}return r}_fileExistsSync(e){return ai.exists(e)}};function BF(t,e){ai=e;let n=new hC(t);return{__:n.__.bind(n),__n:n.__n.bind(n),setLocale:n.setLocale.bind(n),getLocale:n.getLocale.bind(n),updateLocale:n.updateLocale.bind(n),locale:n.locale}}var qF={fs:{readFileSync:cm.readFileSync,writeFile:cm.writeFile},format:kF.format,resolve:MF.resolve,exists:t=>{try{return cm.statSync(t).isFile()}catch{return!1}}},VF=t=>BF(t,qF);mC.exports=VF});var pm=X((jZ,PC)=>{"use strict";var jF=require("util"),_C=require("path"),UF=require("fs");function Xl(t){if(t!==t.toLowerCase()&&t!==t.toUpperCase()||(t=t.toLowerCase()),t.indexOf("-")===-1&&t.indexOf("_")===-1)return t;{let n="",r=!1,i=t.match(/^-+/);for(let s=i?i[0].length:0;s0?r+=`${e}${n.charAt(i)}`:r+=a}return r}function bC(t){return t==null?!1:typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^0[^.]/.test(t)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function WF(t){if(Array.isArray(t))return t.map(a=>typeof a!="string"?a+"":a);t=t.trim();let e=0,n=null,r=null,i=null,s=[];for(let a=0;a{typeof B=="number"&&(g.nargs[R]=B,g.keys.push(R))}),typeof r.coerce=="object"&&Object.entries(r.coerce).forEach(([R,B])=>{typeof B=="function"&&(g.coercions[R]=B,g.keys.push(R))}),typeof r.config!="undefined"&&(Array.isArray(r.config)||typeof r.config=="string"?[].concat(r.config).filter(Boolean).forEach(function(R){g.configs[R]=!0}):typeof r.config=="object"&&Object.entries(r.config).forEach(([R,B])=>{(typeof B=="boolean"||typeof B=="function")&&(g.configs[R]=B)})),Ge(r.key,a,r.default,g.arrays),Object.keys(l).forEach(function(R){(g.aliases[R]||[]).forEach(function(B){l[B]=l[R]})});let _=null;Mo();let N=[],C=Object.assign(Object.create(null),{_:[]}),G={};for(let R=0;R=3&&(J(le[1],g.arrays)?R=$(R,le[1],i,le[2]):J(le[1],g.nargs)!==!1?R=M(R,le[1],i,le[2]):K(le[1],le[2],!0));else if(B.match(b)&&o["boolean-negation"])le=B.match(b),le!==null&&Array.isArray(le)&&le.length>=2&&(k=le[1],K(k,J(k,g.arrays)?[!1]:!1));else if(B.match(/^--.+/)||!o["short-option-groups"]&&B.match(/^-[^-]+/))le=B.match(/^--?(.+)/),le!==null&&Array.isArray(le)&&le.length>=2&&(k=le[1],J(k,g.arrays)?R=$(R,k,i):J(k,g.nargs)!==!1?R=M(R,k,i):(me=i[R+1],me!==void 0&&(!me.match(/^-/)||me.match(m))&&!J(k,g.bools)&&!J(k,g.counts)||/^(true|false)$/.test(me)?(K(k,me),R++):K(k,ui(k))));else if(B.match(/^-.\..+=/))le=B.match(/^-([^=]+)=([\s\S]*)$/),le!==null&&Array.isArray(le)&&le.length>=3&&K(le[1],le[2]);else if(B.match(/^-.\..+/)&&!B.match(m))me=i[R+1],le=B.match(/^-(.\..+)/),le!==null&&Array.isArray(le)&&le.length>=2&&(k=le[1],me!==void 0&&!me.match(/^-/)&&!J(k,g.bools)&&!J(k,g.counts)?(K(k,me),R++):K(k,ui(k)));else if(B.match(/^-[^-]+/)&&!B.match(m)){ce=B.slice(1,-1).split(""),Y=!1;for(let kt=0;ktR!=="--"&&R.includes("-")).forEach(R=>{delete C[R]}),o["strip-aliased"]&&[].concat(...Object.keys(a).map(R=>a[R])).forEach(R=>{o["camel-case-expansion"]&&R.includes("-")&&delete C[R.split(".").map(B=>Xl(B)).join(".")],delete C[R]});function L(R){let B=ye("_",R);(typeof B=="string"||typeof B=="number")&&C._.push(B)}function M(R,B,te,Y){let k,ce=J(B,g.nargs);if(ce=typeof ce!="number"||isNaN(ce)?1:ce,ce===0)return Gn(Y)||(_=Error(d("Argument unexpected for: %s",B))),K(B,ui(B)),R;let le=Gn(Y)?0:1;if(o["nargs-eats-options"])te.length-(R+1)+le0&&(K(B,Y),me--),k=R+1;k0||le&&typeof le=="number"&&k.length>=le||(ce=te[me],/^-/.test(ce)&&!m.test(ce)&&!vn(ce)));me++)R=me,k.push(re(B,ce,s))}return typeof le=="number"&&(le&&k.length1&&o["dot-notation"]&&(g.aliases[k[0]]||[]).forEach(function(ce){let le=ce.split("."),me=[].concat(k);me.shift(),le=le.concat(me),(g.aliases[R]||[]).includes(le.join("."))||Re(C,le,Y)}),J(R,g.normalize)&&!J(R,g.arrays)&&[R].concat(g.aliases[R]||[]).forEach(function(le){Object.defineProperty(G,le,{enumerable:!0,get(){return B},set(me){B=typeof me=="string"?Hi.normalize(me):me}})})}function ne(R,B){g.aliases[R]&&g.aliases[R].length||(g.aliases[R]=[B],y[B]=!0),g.aliases[B]&&g.aliases[B].length||ne(B,R)}function re(R,B,te){te&&(B=YF(B)),(J(R,g.bools)||J(R,g.counts))&&typeof B=="string"&&(B=B==="true");let Y=Array.isArray(B)?B.map(function(k){return ye(R,k)}):ye(R,B);return J(R,g.counts)&&(Gn(Y)||typeof Y=="boolean")&&(Y=fm()),J(R,g.normalize)&&J(R,g.arrays)&&(Array.isArray(B)?Y=B.map(k=>Hi.normalize(k)):Y=Hi.normalize(B)),Y}function ye(R,B){return!o["parse-positional-numbers"]&&R==="_"||!J(R,g.strings)&&!J(R,g.bools)&&!Array.isArray(B)&&(bC(B)&&o["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${B}`)))||!Gn(B)&&J(R,g.numbers))&&(B=Number(B)),B}function Ce(R){let B=Object.create(null);ft(B,g.aliases,l),Object.keys(g.configs).forEach(function(te){let Y=R[te]||B[te];if(Y)try{let k=null,ce=Hi.resolve(Hi.cwd(),Y),le=g.configs[te];if(typeof le=="function"){try{k=le(ce)}catch(me){k=me}if(k instanceof Error){_=k;return}}else k=Hi.require(ce);ae(k)}catch(k){k.name==="PermissionDenied"?_=k:R[te]&&(_=Error(d("Invalid JSON config file: %s",Y)))}})}function ae(R,B){Object.keys(R).forEach(function(te){let Y=R[te],k=B?B+"."+te:te;typeof Y=="object"&&Y!==null&&!Array.isArray(Y)&&o["dot-notation"]?ae(Y,k):(!pe(C,k.split("."))||J(k,g.arrays)&&o["combine-arrays"])&&K(k,Y)})}function Pe(){typeof u!="undefined"&&u.forEach(function(R){ae(R)})}function ct(R,B){if(typeof c=="undefined")return;let te=typeof c=="string"?c:"",Y=Hi.env();Object.keys(Y).forEach(function(k){if(te===""||k.lastIndexOf(te,0)===0){let ce=k.split("__").map(function(le,me){return me===0&&(le=le.substring(te.length)),Xl(le)});(B&&g.configs[ce.join(".")]||!B)&&!pe(R,ce)&&K(ce.join("."),Y[k])}})}function Jt(R){let B,te=new Set;Object.keys(R).forEach(function(Y){if(!te.has(Y)&&(B=J(Y,g.coercions),typeof B=="function"))try{let k=ye(Y,B(R[Y]));[].concat(g.aliases[Y]||[],Y).forEach(ce=>{te.add(ce),R[ce]=k})}catch(k){_=k}})}function Je(R){return g.keys.forEach(B=>{~B.indexOf(".")||typeof R[B]=="undefined"&&(R[B]=void 0)}),R}function ft(R,B,te,Y=!1){Object.keys(te).forEach(function(k){pe(R,k.split("."))||(Re(R,k.split("."),te[k]),Y&&(p[k]=!0),(B[k]||[]).forEach(function(ce){pe(R,ce.split("."))||Re(R,ce.split("."),te[k])}))})}function pe(R,B){let te=R;o["dot-notation"]||(B=[B.join(".")]),B.slice(0,-1).forEach(function(k){te=te[k]||{}});let Y=B[B.length-1];return typeof te!="object"?!1:Y in te}function Re(R,B,te){let Y=R;o["dot-notation"]||(B=[B.join(".")]),B.slice(0,-1).forEach(function(bt){bt=vC(bt),typeof Y=="object"&&Y[bt]===void 0&&(Y[bt]={}),typeof Y[bt]!="object"||Array.isArray(Y[bt])?(Array.isArray(Y[bt])?Y[bt].push({}):Y[bt]=[Y[bt],{}],Y=Y[bt][Y[bt].length-1]):Y=Y[bt]});let k=vC(B[B.length-1]),ce=J(B.join("."),g.arrays),le=Array.isArray(te),me=o["duplicate-arguments-array"];!me&&J(k,g.nargs)&&(me=!0,(!Gn(Y[k])&&g.nargs[k]===1||Array.isArray(Y[k])&&Y[k].length===g.nargs[k])&&(Y[k]=void 0)),te===fm()?Y[k]=fm(Y[k]):Array.isArray(Y[k])?me&&ce&&le?Y[k]=o["flatten-duplicate-arrays"]?Y[k].concat(te):(Array.isArray(Y[k][0])?Y[k]:[Y[k]]).concat([te]):!me&&Boolean(ce)===Boolean(le)?Y[k]=te:Y[k]=Y[k].concat([te]):Y[k]===void 0&&ce?Y[k]=le?te:[te]:me&&!(Y[k]===void 0||J(k,g.counts)||J(k,g.bools))?Y[k]=[Y[k],te]:Y[k]=te}function Ge(...R){R.forEach(function(B){Object.keys(B||{}).forEach(function(te){g.aliases[te]||(g.aliases[te]=[].concat(a[te]||[]),g.aliases[te].concat(te).forEach(function(Y){if(/-/.test(Y)&&o["camel-case-expansion"]){let k=Xl(Y);k!==te&&g.aliases[te].indexOf(k)===-1&&(g.aliases[te].push(k),y[k]=!0)}}),g.aliases[te].concat(te).forEach(function(Y){if(Y.length>1&&/[A-Z]/.test(Y)&&o["camel-case-expansion"]){let k=yC(Y,"-");k!==te&&g.aliases[te].indexOf(k)===-1&&(g.aliases[te].push(k),y[k]=!0)}}),g.aliases[te].forEach(function(Y){g.aliases[Y]=[te].concat(g.aliases[te].filter(function(k){return Y!==k}))}))})})}function J(R,B){let te=[].concat(g.aliases[R]||[],R),Y=Object.keys(B),k=te.find(ce=>Y.includes(ce));return k?B[k]:!1}function pt(R){let B=Object.keys(g);return[].concat(B.map(Y=>g[Y])).some(function(Y){return Array.isArray(Y)?Y.includes(R):Y[R]})}function st(R,...B){return[].concat(...B).some(function(Y){let k=R.match(Y);return k&&pt(k[1])})}function Dt(R){if(R.match(m)||!R.match(/^-[^-]+/))return!1;let B=!0,te,Y=R.slice(1).split("");for(let k=0;kJ(R,g.arrays)?(_=Error(d("Invalid configuration: %s, opts.count excludes opts.array.",R)),!0):J(R,g.nargs)?(_=Error(d("Invalid configuration: %s, opts.count excludes opts.narg.",R)),!0):!1)}return{aliases:Object.assign({},g.aliases),argv:Object.assign(G,C),configuration:o,defaulted:Object.assign({},p),error:_,newAliases:Object.assign({},y)}}};function GF(t){let e=[],n=Object.create(null),r=!0;for(Object.keys(t).forEach(function(i){e.push([].concat(t[i],i))});r;){r=!1;for(let i=0;iHF,format:jF.format,normalize:_C.normalize,resolve:_C.resolve,require:t=>{if(typeof require!="undefined")return require(t);if(t.match(/\.json$/))return JSON.parse(UF.readFileSync(t,"utf8"));throw Error("only .json config files are supported in ESM")}}),Ql=function(e,n){return CC.parse(e.slice(),n).argv};Ql.detailed=function(t,e){return CC.parse(t.slice(),e)};Ql.camelCase=Xl;Ql.decamelize=yC;Ql.looksLikeNumber=bC;PC.exports=Ql});var AC=X((UZ,SC)=>{"use strict";SC.exports=({onlyFirst:t=!1}={})=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}});var vf=X((WZ,EC)=>{"use strict";var $F=AC();EC.exports=t=>typeof t=="string"?t.replace($F(),""):t});var DC=X((GZ,dm)=>{"use strict";var IC=t=>Number.isNaN(t)?!1:t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141);dm.exports=IC;dm.exports.default=IC});var RC=X((YZ,xC)=>{"use strict";xC.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var Nf=X((HZ,hm)=>{"use strict";var KF=vf(),zF=DC(),XF=RC(),wC=t=>{if(typeof t!="string"||t.length===0||(t=KF(t),t.length===0))return 0;t=t.replace(XF()," ");let e=0;for(let n=0;n=127&&r<=159||r>=768&&r<=879||(r>65535&&n++,e+=zF(r)?2:1)}return e};hm.exports=wC;hm.exports.default=wC});var LC=X(($Z,OC)=>{"use strict";OC.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var mm=X((KZ,kC)=>{var Jl=LC(),FC={};for(let t of Object.keys(Jl))FC[Jl[t]]=t;var _e={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};kC.exports=_e;for(let t of Object.keys(_e)){if(!("channels"in _e[t]))throw new Error("missing channels property: "+t);if(!("labels"in _e[t]))throw new Error("missing channel labels property: "+t);if(_e[t].labels.length!==_e[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:n}=_e[t];delete _e[t].channels,delete _e[t].labels,Object.defineProperty(_e[t],"channels",{value:e}),Object.defineProperty(_e[t],"labels",{value:n})}_e.rgb.hsl=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(e,n,r),s=Math.max(e,n,r),a=s-i,o,l;s===i?o=0:e===s?o=(n-r)/a:n===s?o=2+(r-e)/a:r===s&&(o=4+(e-n)/a),o=Math.min(o*60,360),o<0&&(o+=360);let u=(i+s)/2;return s===i?l=0:u<=.5?l=a/(s+i):l=a/(2-s-i),[o,l*100,u*100]};_e.rgb.hsv=function(t){let e,n,r,i,s,a=t[0]/255,o=t[1]/255,l=t[2]/255,u=Math.max(a,o,l),c=u-Math.min(a,o,l),f=function(h){return(u-h)/6/c+1/2};return c===0?(i=0,s=0):(s=c/u,e=f(a),n=f(o),r=f(l),a===u?i=r-n:o===u?i=1/3+e-r:l===u&&(i=2/3+n-e),i<0?i+=1:i>1&&(i-=1)),[i*360,s*100,u*100]};_e.rgb.hwb=function(t){let e=t[0],n=t[1],r=t[2],i=_e.rgb.hsl(t)[0],s=1/255*Math.min(e,Math.min(n,r));return r=1-1/255*Math.max(e,Math.max(n,r)),[i,s*100,r*100]};_e.rgb.cmyk=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(1-e,1-n,1-r),s=(1-e-i)/(1-i)||0,a=(1-n-i)/(1-i)||0,o=(1-r-i)/(1-i)||0;return[s*100,a*100,o*100,i*100]};function QF(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}_e.rgb.keyword=function(t){let e=FC[t];if(e)return e;let n=1/0,r;for(let i of Object.keys(Jl)){let s=Jl[i],a=QF(t,s);a.04045?((e+.055)/1.055)**2.4:e/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;let i=e*.4124+n*.3576+r*.1805,s=e*.2126+n*.7152+r*.0722,a=e*.0193+n*.1192+r*.9505;return[i*100,s*100,a*100]};_e.rgb.lab=function(t){let e=_e.rgb.xyz(t),n=e[0],r=e[1],i=e[2];n/=95.047,r/=100,i/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let s=116*r-16,a=500*(n-r),o=200*(r-i);return[s,a,o]};_e.hsl.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100,i,s,a;if(n===0)return a=r*255,[a,a,a];r<.5?i=r*(1+n):i=r+n-r*n;let o=2*r-i,l=[0,0,0];for(let u=0;u<3;u++)s=e+1/3*-(u-1),s<0&&s++,s>1&&s--,6*s<1?a=o+(i-o)*6*s:2*s<1?a=i:3*s<2?a=o+(i-o)*(2/3-s)*6:a=o,l[u]=a*255;return l};_e.hsl.hsv=function(t){let e=t[0],n=t[1]/100,r=t[2]/100,i=n,s=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=s<=1?s:2-s;let a=(r+n)/2,o=r===0?2*i/(s+i):2*n/(r+n);return[e,o*100,a*100]};_e.hsv.rgb=function(t){let e=t[0]/60,n=t[1]/100,r=t[2]/100,i=Math.floor(e)%6,s=e-Math.floor(e),a=255*r*(1-n),o=255*r*(1-n*s),l=255*r*(1-n*(1-s));switch(r*=255,i){case 0:return[r,l,a];case 1:return[o,r,a];case 2:return[a,r,l];case 3:return[a,o,r];case 4:return[l,a,r];case 5:return[r,a,o]}};_e.hsv.hsl=function(t){let e=t[0],n=t[1]/100,r=t[2]/100,i=Math.max(r,.01),s,a;a=(2-n)*r;let o=(2-n)*i;return s=n*i,s/=o<=1?o:2-o,s=s||0,a/=2,[e,s*100,a*100]};_e.hwb.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100,i=n+r,s;i>1&&(n/=i,r/=i);let a=Math.floor(6*e),o=1-r;s=6*e-a,(a&1)!==0&&(s=1-s);let l=n+s*(o-n),u,c,f;switch(a){default:case 6:case 0:u=o,c=l,f=n;break;case 1:u=l,c=o,f=n;break;case 2:u=n,c=o,f=l;break;case 3:u=n,c=l,f=o;break;case 4:u=l,c=n,f=o;break;case 5:u=o,c=n,f=l;break}return[u*255,c*255,f*255]};_e.cmyk.rgb=function(t){let e=t[0]/100,n=t[1]/100,r=t[2]/100,i=t[3]/100,s=1-Math.min(1,e*(1-i)+i),a=1-Math.min(1,n*(1-i)+i),o=1-Math.min(1,r*(1-i)+i);return[s*255,a*255,o*255]};_e.xyz.rgb=function(t){let e=t[0]/100,n=t[1]/100,r=t[2]/100,i,s,a;return i=e*3.2406+n*-1.5372+r*-.4986,s=e*-.9689+n*1.8758+r*.0415,a=e*.0557+n*-.204+r*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,i=Math.min(Math.max(0,i),1),s=Math.min(Math.max(0,s),1),a=Math.min(Math.max(0,a),1),[i*255,s*255,a*255]};_e.xyz.lab=function(t){let e=t[0],n=t[1],r=t[2];e/=95.047,n/=100,r/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;let i=116*n-16,s=500*(e-n),a=200*(n-r);return[i,s,a]};_e.lab.xyz=function(t){let e=t[0],n=t[1],r=t[2],i,s,a;s=(e+16)/116,i=n/500+s,a=s-r/200;let o=s**3,l=i**3,u=a**3;return s=o>.008856?o:(s-16/116)/7.787,i=l>.008856?l:(i-16/116)/7.787,a=u>.008856?u:(a-16/116)/7.787,i*=95.047,s*=100,a*=108.883,[i,s,a]};_e.lab.lch=function(t){let e=t[0],n=t[1],r=t[2],i;i=Math.atan2(r,n)*360/2/Math.PI,i<0&&(i+=360);let a=Math.sqrt(n*n+r*r);return[e,a,i]};_e.lch.lab=function(t){let e=t[0],n=t[1],i=t[2]/360*2*Math.PI,s=n*Math.cos(i),a=n*Math.sin(i);return[e,s,a]};_e.rgb.ansi16=function(t,e=null){let[n,r,i]=t,s=e===null?_e.rgb.hsv(t)[2]:e;if(s=Math.round(s/50),s===0)return 30;let a=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return s===2&&(a+=60),a};_e.hsv.ansi16=function(t){return _e.rgb.ansi16(_e.hsv.rgb(t),t[2])};_e.rgb.ansi256=function(t){let e=t[0],n=t[1],r=t[2];return e===n&&n===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)};_e.ansi16.rgb=function(t){let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let n=(~~(t>50)+1)*.5,r=(e&1)*n*255,i=(e>>1&1)*n*255,s=(e>>2&1)*n*255;return[r,i,s]};_e.ansi256.rgb=function(t){if(t>=232){let s=(t-232)*10+8;return[s,s,s]}t-=16;let e,n=Math.floor(t/36)/5*255,r=Math.floor((e=t%36)/6)/5*255,i=e%6/5*255;return[n,r,i]};_e.rgb.hex=function(t){let n=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".substring(n.length)+n};_e.hex.rgb=function(t){let e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let n=e[0];e[0].length===3&&(n=n.split("").map(o=>o+o).join(""));let r=parseInt(n,16),i=r>>16&255,s=r>>8&255,a=r&255;return[i,s,a]};_e.rgb.hcg=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.max(Math.max(e,n),r),s=Math.min(Math.min(e,n),r),a=i-s,o,l;return a<1?o=s/(1-a):o=0,a<=0?l=0:i===e?l=(n-r)/a%6:i===n?l=2+(r-e)/a:l=4+(e-n)/a,l/=6,l%=1,[l*360,a*100,o*100]};_e.hsl.hcg=function(t){let e=t[1]/100,n=t[2]/100,r=n<.5?2*e*n:2*e*(1-n),i=0;return r<1&&(i=(n-.5*r)/(1-r)),[t[0],r*100,i*100]};_e.hsv.hcg=function(t){let e=t[1]/100,n=t[2]/100,r=e*n,i=0;return r<1&&(i=(n-r)/(1-r)),[t[0],r*100,i*100]};_e.hcg.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100;if(n===0)return[r*255,r*255,r*255];let i=[0,0,0],s=e%1*6,a=s%1,o=1-a,l=0;switch(Math.floor(s)){case 0:i[0]=1,i[1]=a,i[2]=0;break;case 1:i[0]=o,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=a;break;case 3:i[0]=0,i[1]=o,i[2]=1;break;case 4:i[0]=a,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=o}return l=(1-n)*r,[(n*i[0]+l)*255,(n*i[1]+l)*255,(n*i[2]+l)*255]};_e.hcg.hsv=function(t){let e=t[1]/100,n=t[2]/100,r=e+n*(1-e),i=0;return r>0&&(i=e/r),[t[0],i*100,r*100]};_e.hcg.hsl=function(t){let e=t[1]/100,r=t[2]/100*(1-e)+.5*e,i=0;return r>0&&r<.5?i=e/(2*r):r>=.5&&r<1&&(i=e/(2*(1-r))),[t[0],i*100,r*100]};_e.hcg.hwb=function(t){let e=t[1]/100,n=t[2]/100,r=e+n*(1-e);return[t[0],(r-e)*100,(1-r)*100]};_e.hwb.hcg=function(t){let e=t[1]/100,n=t[2]/100,r=1-n,i=r-e,s=0;return i<1&&(s=(r-i)/(1-i)),[t[0],i*100,s*100]};_e.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};_e.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};_e.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};_e.gray.hsl=function(t){return[0,0,t[0]]};_e.gray.hsv=_e.gray.hsl;_e.gray.hwb=function(t){return[0,100,t[0]]};_e.gray.cmyk=function(t){return[0,0,0,t[0]]};_e.gray.lab=function(t){return[t[0],0,0]};_e.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,r=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(r.length)+r};_e.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var BC=X((zZ,MC)=>{var Cf=mm();function JF(){let t={},e=Object.keys(Cf);for(let n=e.length,r=0;r{var gm=mm(),nk=BC(),Ao={},rk=Object.keys(gm);function ik(t){let e=function(...n){let r=n[0];return r==null?r:(r.length>1&&(n=r),t(n))};return"conversion"in t&&(e.conversion=t.conversion),e}function sk(t){let e=function(...n){let r=n[0];if(r==null)return r;r.length>1&&(n=r);let i=t(n);if(typeof i=="object")for(let s=i.length,a=0;a{Ao[t]={},Object.defineProperty(Ao[t],"channels",{value:gm[t].channels}),Object.defineProperty(Ao[t],"labels",{value:gm[t].labels});let e=nk(t);Object.keys(e).forEach(r=>{let i=e[r];Ao[t][r]=sk(i),Ao[t][r].raw=ik(i)})});qC.exports=Ao});var HC=X((QZ,YC)=>{"use strict";var jC=(t,e)=>(...n)=>`\x1B[${t(...n)+e}m`,UC=(t,e)=>(...n)=>{let r=t(...n);return`\x1B[${38+e};5;${r}m`},WC=(t,e)=>(...n)=>{let r=t(...n);return`\x1B[${38+e};2;${r[0]};${r[1]};${r[2]}m`},Pf=t=>t,GC=(t,e,n)=>[t,e,n],Eo=(t,e,n)=>{Object.defineProperty(t,e,{get:()=>{let r=n();return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0}),r},enumerable:!0,configurable:!0})},_m,Io=(t,e,n,r)=>{_m===void 0&&(_m=VC());let i=r?10:0,s={};for(let[a,o]of Object.entries(_m)){let l=a==="ansi16"?"ansi":a;a===e?s[l]=t(n,i):typeof o=="object"&&(s[l]=t(o[e],i))}return s};function ak(){let t=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[n,r]of Object.entries(e)){for(let[i,s]of Object.entries(r))e[i]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[i]=e[i],t.set(s[0],s[1]);Object.defineProperty(e,n,{value:r,enumerable:!1})}return Object.defineProperty(e,"codes",{value:t,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",Eo(e.color,"ansi",()=>Io(jC,"ansi16",Pf,!1)),Eo(e.color,"ansi256",()=>Io(UC,"ansi256",Pf,!1)),Eo(e.color,"ansi16m",()=>Io(WC,"rgb",GC,!1)),Eo(e.bgColor,"ansi",()=>Io(jC,"ansi16",Pf,!0)),Eo(e.bgColor,"ansi256",()=>Io(UC,"ansi256",Pf,!0)),Eo(e.bgColor,"ansi16m",()=>Io(WC,"rgb",GC,!0)),e}Object.defineProperty(YC,"exports",{enumerable:!0,get:ak})});var JC=X((JZ,QC)=>{"use strict";var Zl=Nf(),ok=vf(),lk=HC(),Sf=new Set(["\x1B","\x9B"]),uk=39,ym="\x07",$C="[",ck="]",KC="m",bm=`${ck}8;;`,zC=t=>`${Sf.values().next().value}${$C}${t}${KC}`,XC=t=>`${Sf.values().next().value}${bm}${t}${ym}`,fk=t=>t.split(" ").map(e=>Zl(e)),Tm=(t,e,n)=>{let r=[...e],i=!1,s=!1,a=Zl(ok(t[t.length-1]));for(let[o,l]of r.entries()){let u=Zl(l);if(a+u<=n?t[t.length-1]+=l:(t.push(l),a=0),Sf.has(l)&&(i=!0,s=r.slice(o+1).join("").startsWith(bm)),i){s?l===ym&&(i=!1,s=!1):l===KC&&(i=!1);continue}a+=u,a===n&&o0&&t.length>1&&(t[t.length-2]+=t.pop())},pk=t=>{let e=t.split(" "),n=e.length;for(;n>0&&!(Zl(e[n-1])>0);)n--;return n===e.length?t:e.slice(0,n).join(" ")+e.slice(n).join("")},dk=(t,e,n={})=>{if(n.trim!==!1&&t.trim()==="")return"";let r="",i,s,a=fk(t),o=[""];for(let[u,c]of t.split(" ").entries()){n.trim!==!1&&(o[o.length-1]=o[o.length-1].trimStart());let f=Zl(o[o.length-1]);if(u!==0&&(f>=e&&(n.wordWrap===!1||n.trim===!1)&&(o.push(""),f=0),(f>0||n.trim===!1)&&(o[o.length-1]+=" ",f++)),n.hard&&a[u]>e){let h=e-f,y=1+Math.floor((a[u]-h-1)/e);Math.floor((a[u]-1)/e)e&&f>0&&a[u]>0){if(n.wordWrap===!1&&fe&&n.wordWrap===!1){Tm(o,c,e);continue}o[o.length-1]+=c}n.trim!==!1&&(o=o.map(pk));let l=[...o.join(` +`)];for(let[u,c]of l.entries()){if(r+=c,Sf.has(c)){let{groups:h}=new RegExp(`(?:\\${$C}(?\\d+)m|\\${bm}(?.*)${ym})`).exec(l.slice(u).join(""))||{groups:{}};if(h.code!==void 0){let y=Number.parseFloat(h.code);i=y===uk?void 0:y}else h.uri!==void 0&&(s=h.uri.length===0?void 0:h.uri)}let f=lk.codes.get(Number(i));l[u+1]===` +`?(s&&(r+=XC("")),i&&f&&(r+=zC(f))):c===` +`&&(i&&f&&(r+=zC(i)),s&&(r+=XC(s)))}return r};QC.exports=(t,e,n)=>String(t).normalize().replace(/\r\n/g,` `).split(` -`).map(r=>fk(r,e,n)).join(` -`)});var tP=X((KZ,eP)=>{"use strict";var pk={right:_k,center:yk},dk=0,Sf=1,hk=2,Ef=3,JC=class{constructor(e){var n;this.width=e.width,this.wrap=(n=e.wrap)!==null&&n!==void 0?n:!0,this.rows=[]}span(...e){let n=this.div(...e);n.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]=="string")return this.applyLayoutDSL(e[0]);let n=e.map(r=>typeof r=="string"?this.colFromString(r):r);return this.rows.push(n),n}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]=="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){let n=e.split(` +`).map(r=>dk(r,e,n)).join(` +`)});var nP=X((ZZ,tP)=>{"use strict";var hk={right:bk,center:Tk},mk=0,Af=1,gk=2,Ef=3,ZC=class{constructor(e){var n;this.width=e.width,this.wrap=(n=e.wrap)!==null&&n!==void 0?n:!0,this.rows=[]}span(...e){let n=this.div(...e);n.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]=="string")return this.applyLayoutDSL(e[0]);let n=e.map(r=>typeof r=="string"?this.colFromString(r):r);return this.rows.push(n),n}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]=="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){let n=e.split(` `).map(i=>i.split(" ")),r=0;return n.forEach(i=>{i.length>1&&ar.stringWidth(i[0])>r&&(r=Math.min(Math.floor(this.width*.5),ar.stringWidth(i[0])))}),n.forEach(i=>{this.div(...i.map((s,a)=>({text:s.trim(),padding:this.measurePadding(s),width:a===0&&i.length>1?r:void 0})))}),this.rows[this.rows.length-1]}colFromString(e){return{text:e,padding:this.measurePadding(e)}}measurePadding(e){let n=ar.stripAnsi(e);return[0,n.match(/\s*$/)[0].length,0,n.match(/^\s*/)[0].length]}toString(){let e=[];return this.rows.forEach(n=>{this.rowToString(n,e)}),e.filter(n=>!n.hidden).map(n=>n.text).join(` -`)}rowToString(e,n){return this.rasterize(e).forEach((r,i)=>{let s="";r.forEach((a,o)=>{let{width:l}=e[o],u=this.negatePadding(e[o]),c=a;u>ar.stringWidth(a)&&(c+=" ".repeat(u-ar.stringWidth(a))),e[o].align&&e[o].align!=="left"&&this.wrap&&(c=pk[e[o].align](c,u),ar.stringWidth(c)0&&(s=this.renderInline(s,n[n.length-1]))}),n.push({text:s.replace(/ +$/,""),span:e.span})}),n}renderInline(e,n){let r=e.match(/^ */),i=r?r[0].length:0,s=n.text,a=ar.stringWidth(s.trimRight());return n.span?this.wrap?i{s.width=r[a],this.wrap?i=ar.wrap(s.text,this.negatePadding(s),{hard:!0}).split(` +`)}rowToString(e,n){return this.rasterize(e).forEach((r,i)=>{let s="";r.forEach((a,o)=>{let{width:l}=e[o],u=this.negatePadding(e[o]),c=a;u>ar.stringWidth(a)&&(c+=" ".repeat(u-ar.stringWidth(a))),e[o].align&&e[o].align!=="left"&&this.wrap&&(c=hk[e[o].align](c,u),ar.stringWidth(c)0&&(s=this.renderInline(s,n[n.length-1]))}),n.push({text:s.replace(/ +$/,""),span:e.span})}),n}renderInline(e,n){let r=e.match(/^ */),i=r?r[0].length:0,s=n.text,a=ar.stringWidth(s.trimRight());return n.span?this.wrap?i{s.width=r[a],this.wrap?i=ar.wrap(s.text,this.negatePadding(s),{hard:!0}).split(` `):i=s.text.split(` -`),s.border&&(i.unshift("."+"-".repeat(this.negatePadding(s)+2)+"."),i.push("'"+"-".repeat(this.negatePadding(s)+2)+"'")),s.padding&&(i.unshift(...new Array(s.padding[dk]||0).fill("")),i.push(...new Array(s.padding[hk]||0).fill(""))),i.forEach((o,l)=>{n[l]||n.push([]);let u=n[l];for(let c=0;ca.width||ar.stringWidth(a.text));let n=e.length,r=this.width,i=e.map(a=>{if(a.width)return n--,r-=a.width,a.width}),s=n?Math.floor(r/n):0;return i.map((a,o)=>a===void 0?Math.max(s,mk(e[o])):a)}};function ZC(t,e,n){return t.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?n:" ":""}function mk(t){let e=t.padding||[],n=1+(e[Ef]||0)+(e[Sf]||0);return t.border?n+4:n}function gk(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function _k(t,e){t=t.trim();let n=ar.stringWidth(t);return n=e?t:" ".repeat(e-n>>1)+t}var ar;function bk(t,e){return ar=e,new JC({width:(t==null?void 0:t.width)||gk(),wrap:t==null?void 0:t.wrap})}var Tk=Nf(),vk=vf(),Nk=QC();function Ck(t){return bk(t,{stringWidth:Tk,stripAnsi:vk,wrap:Nk})}eP.exports=Ck});var sP=X((zZ,iP)=>{var{dirname:nP,resolve:rP}=require("path"),{readdirSync:Pk,statSync:Ak}=require("fs");iP.exports=function(t,e){let n=rP(".",t),r;for(Ak(n).isDirectory()||(n=nP(n));;){if(r=e(n,Pk(n)),r)return rP(n,r);if(n=nP(r=n),r===n)break}}});var oP=X((XZ,aP)=>{"use strict";aP.exports=function(e){if(e===void 0&&(e=2),e>=Error.stackTraceLimit)throw new TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `"+e+"` and Error.stackTraceLimit was: `"+Error.stackTraceLimit+"`");var n=Error.prepareStackTrace;Error.prepareStackTrace=function(i,s){return s};var r=new Error().stack;if(Error.prepareStackTrace=n,r!==null&&typeof r=="object")return r[e]?r[e].getFileName():void 0}});var fP=X((QZ,Nm)=>{"use strict";var lP=require("fs"),Sk=require("path").join,Ek=require("path").resolve,uP=require("path").dirname,vm={extensions:["js","json","coffee"],recurse:!0,rename:function(t){return t},visit:function(t){return t}};function Ik(t,e,n){return new RegExp("\\.("+n.extensions.join("|")+")$","i").test(e)&&!(n.include&&n.include instanceof RegExp&&!n.include.test(t))&&!(n.include&&typeof n.include=="function"&&!n.include(t,e))&&!(n.exclude&&n.exclude instanceof RegExp&&n.exclude.test(t))&&!(n.exclude&&typeof n.exclude=="function"&&n.exclude(t,e))}function cP(t,e,n){var r={};e&&!n&&typeof e!="string"&&(n=e,e=null),n=n||{};for(var i in vm)typeof n[i]=="undefined"&&(n[i]=vm[i]);return e=e?Ek(uP(t.filename),e):uP(t.filename),lP.readdirSync(e).forEach(function(s){var a=Sk(e,s),o,l,u;lP.statSync(a).isDirectory()&&n.recurse?(o=cP(t,a,n),Object.keys(o).length&&(r[n.rename(s,a,s)]=o)):a!==t.filename&&Ik(a,s,n)&&(l=s.substring(0,s.lastIndexOf(".")),u=t.require(a),r[n.rename(l,a,s)]=n.visit(u,a,s)||u)}),r}Nm.exports=cP;Nm.exports.defaults=vm});var HP=X((JZ,YP)=>{"use strict";var pP=require("assert"),Qt=class extends Error{constructor(e){super(e||"yargs error"),this.name="YError",Error.captureStackTrace(this,Qt)}},eu,Cm=[];function If(t,e,n,r){eu=r;let i={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if(typeof t.extends!="string")return i;let s=/\.json|\..*rc$/.test(t.extends),a=null;if(s)a=function(o,l){return eu.path.resolve(o,l)}(e,t.extends);else try{a=require.resolve(t.extends)}catch{return t}(function(o){if(Cm.indexOf(o)>-1)throw new Qt(`Circular extended configurations: '${o}'.`)})(a),Cm.push(a),i=s?JSON.parse(eu.readFileSync(a,"utf8")):require(t.extends),delete t.extends,i=If(i,eu.path.dirname(a),n,eu)}return Cm=[],n?dP(i,t):Object.assign({},i,t)}function dP(t,e){let n={};function r(i){return i&&typeof i=="object"&&!Array.isArray(i)}Object.assign(n,t);for(let i of Object.keys(e))r(e[i])&&r(n[i])?n[i]=dP(t[i],e[i]):n[i]=e[i];return n}function Do(t){let e=t.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,r=e.shift();if(!r)throw new Error(`No command found in: ${t}`);let i={cmd:r.replace(n,""),demanded:[],optional:[]};return e.forEach((s,a)=>{let o=!1;s=s.replace(/\s/g,""),/\.+[\]>]/.test(s)&&a===e.length-1&&(o=!0),/^\[/.test(s)?i.optional.push({cmd:s.replace(n,"").split("|"),variadic:o}):i.demanded.push({cmd:s.replace(n,"").split("|"),variadic:o})}),i}var Dk=["first","second","third","fourth","fifth","sixth"];function de(t,e,n){try{let r=0,[i,s,a]=typeof t=="object"?[{demanded:[],optional:[]},t,e]:[Do(`cmd ${t}`),e,n],o=[].slice.call(s);for(;o.length&&o[o.length-1]===void 0;)o.pop();let l=a||o.length;if(lu)throw new Qt(`Too many arguments provided. Expected max ${u} but received ${l}.`);i.demanded.forEach(c=>{let f=hP(o.shift());c.cmd.filter(h=>h===f||h==="*").length===0&&mP(f,c.cmd,r),r+=1}),i.optional.forEach(c=>{if(o.length===0)return;let f=hP(o.shift());c.cmd.filter(h=>h===f||h==="*").length===0&&mP(f,c.cmd,r),r+=1})}catch(r){console.warn(r.stack)}}function hP(t){return Array.isArray(t)?"array":t===null?"null":typeof t}function mP(t,e,n){throw new Qt(`Invalid ${Dk[n]||"manyith"} argument. Expected ${e.join(" or ")} but received ${t}.`)}function Gt(t){return!!t&&!!t.then&&typeof t.then=="function"}function li(t,e,n,r){n.assert.notStrictEqual(t,e,r)}function gP(t,e){e.assert.strictEqual(typeof t,"string")}function Df(t){return Object.keys(t)}function xo(t={},e=()=>!0){let n={};return Df(t).forEach(r=>{e(r,t[r])&&(n[r]=t[r])}),n}function _P(){return process.versions.electron&&!process.defaultApp?0:1}function yP(){return process.argv[_P()]}var xk=Object.freeze({__proto__:null,hideBin:function(t){return t.slice(_P()+1)},getProcessArgvBin:yP});function P(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)}function he(t,e,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(t,n):i?i.value=n:e.set(t,n),n}var bP=class{constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,n,r=!0,i=!1){if(de(" [boolean] [boolean] [boolean]",[e,n,r],arguments.length),Array.isArray(e)){for(let s=0;s{let s=[...r[n]||[],n];return!i.option||!s.includes(i.option)}),e.option=n,this.addMiddleware(e,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let e=this.frozens.pop();e!==void 0&&(this.globalMiddleware=e)}reset(){this.globalMiddleware=this.globalMiddleware.filter(e=>e.global)}};function tu(t,e,n,r){return n.reduce((i,s)=>{if(s.applyBeforeValidation!==r)return i;if(s.mutates){if(s.applied)return i;s.applied=!0}if(Gt(i))return i.then(a=>Promise.all([a,s(a,e)])).then(([a,o])=>Object.assign(a,o));{let a=s(i,e);return Gt(a)?a.then(o=>Object.assign(i,o)):Object.assign(i,a)}},t)}function nu(t,e,n=r=>{throw r}){try{let r=typeof t=="function"?t():t;return Gt(r)?r.then(i=>e(i)):e(r)}catch(r){return n(r)}}var Ro=/(^\*)|(^\$0)/,TP=class{constructor(e,n,r,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=e,this.globalMiddleware=r,this.validation=n}addDirectory(e,n,r,i){typeof(i=i||{}).recurse!="boolean"&&(i.recurse=!1),Array.isArray(i.extensions)||(i.extensions=["js"]);let s=typeof i.visit=="function"?i.visit:a=>a;i.visit=(a,o,l)=>{let u=s(a,o,l);if(u){if(this.requireCache.has(o))return u;this.requireCache.add(o),this.addHandler(u)}return u},this.shim.requireDirectory({require:n,filename:r},e,i)}addHandler(e,n,r,i,s,a){let o=[],l=function(u){return u?u.map(c=>(c.applyBeforeValidation=!1,c)):[]}(s);if(i=i||(()=>{}),Array.isArray(e))if(function(u){return u.every(c=>typeof c=="string")}(e))[e,...o]=e;else for(let u of e)this.addHandler(u);else{if(function(u){return typeof u=="object"&&!Array.isArray(u)}(e)){let u=Array.isArray(e.command)||typeof e.command=="string"?e.command:this.moduleName(e);return e.aliases&&(u=[].concat(u).concat(e.aliases)),void this.addHandler(u,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated)}if(vP(r))return void this.addHandler([e].concat(o),n,r.builder,r.handler,r.middlewares,r.deprecated)}if(typeof e=="string"){let u=Do(e);o=o.map(h=>Do(h).cmd);let c=!1,f=[u.cmd].concat(o).filter(h=>!Ro.test(h)||(c=!0,!1));f.length===0&&c&&f.push("$0"),c&&(u.cmd=f[0],o=f.slice(1),e=e.replace(Ro,u.cmd)),o.forEach(h=>{this.aliasMap[h]=u.cmd}),n!==!1&&this.usage.command(e,n,c,o,a),this.handlers[u.cmd]={original:e,description:n,handler:i,builder:r||{},middlewares:l,deprecated:a,demanded:u.demanded,optional:u.optional},c&&(this.defaultCommand=this.handlers[u.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,n,r,i,s,a){let o=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand,l=n.getInternalMethods().getContext(),u=l.commands.slice(),c=!e;e&&(l.commands.push(e),l.fullCommands.push(o.original));let f=this.applyBuilderUpdateUsageAndParse(c,o,n,r.aliases,u,i,s,a);return Gt(f)?f.then(h=>this.applyMiddlewareAndGetResult(c,o,h.innerArgv,l,s,h.aliases,n)):this.applyMiddlewareAndGetResult(c,o,f.innerArgv,l,s,f.aliases,n)}applyBuilderUpdateUsageAndParse(e,n,r,i,s,a,o,l){let u=n.builder,c=r;if(Pm(u)){let f=u(r.getInternalMethods().reset(i),l);if(Gt(f))return f.then(h=>{var y;return c=(y=h)&&typeof y.getInternalMethods=="function"?h:r,this.parseAndUpdateUsage(e,n,c,s,a,o)})}else(function(f){return typeof f=="object"})(u)&&(c=r.getInternalMethods().reset(i),Object.keys(n.builder).forEach(f=>{c.option(f,u[f])}));return this.parseAndUpdateUsage(e,n,c,s,a,o)}parseAndUpdateUsage(e,n,r,i,s,a){e&&r.getInternalMethods().getUsageInstance().unfreeze(),this.shouldUpdateUsage(r)&&r.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,n),n.description);let o=r.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,s,a);return Gt(o)?o.then(l=>({aliases:r.parsed.aliases,innerArgv:l})):{aliases:r.parsed.aliases,innerArgv:o}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,n){let r=Ro.test(n.original)?n.original.replace(Ro,"").trim():n.original,i=e.filter(s=>!Ro.test(s));return i.push(r),`$0 ${i.join(" ")}`}applyMiddlewareAndGetResult(e,n,r,i,s,a,o){let l={};if(s)return r;o.getInternalMethods().getHasOutput()||(l=this.populatePositionals(n,r,i,o));let u=this.globalMiddleware.getMiddleware().slice(0).concat(n.middlewares);if(r=tu(r,o,u,!0),!o.getInternalMethods().getHasOutput()){let c=o.getInternalMethods().runValidation(a,l,o.parsed.error,e);r=nu(r,f=>(c(f),f))}if(n.handler&&!o.getInternalMethods().getHasOutput()){o.getInternalMethods().setHasOutput();let c=!!o.getOptions().configuration["populate--"];o.getInternalMethods().postProcess(r,c,!1,!1),r=nu(r=tu(r,o,u,!1),f=>{let h=n.handler(f);return Gt(h)?h.then(()=>f):f}),e||o.getInternalMethods().getUsageInstance().cacheHelpMessage(),Gt(r)&&!o.getInternalMethods().hasParseCallback()&&r.catch(f=>{try{o.getInternalMethods().getUsageInstance().fail(null,f)}catch{}})}return e||(i.commands.pop(),i.fullCommands.pop()),r}populatePositionals(e,n,r,i){n._=n._.slice(r.commands.length);let s=e.demanded.slice(0),a=e.optional.slice(0),o={};for(this.validation.positionalCount(s.length,n._.length);s.length;){let l=s.shift();this.populatePositional(l,n,o)}for(;a.length;){let l=a.shift();this.populatePositional(l,n,o)}return n._=r.commands.concat(n._.map(l=>""+l)),this.postProcessPositionals(n,o,this.cmdToParseOptions(e.original),i),o}populatePositional(e,n,r){let i=e.cmd[0];e.variadic?r[i]=n._.splice(0).map(String):n._.length&&(r[i]=[String(n._.shift())])}cmdToParseOptions(e){let n={array:[],default:{},alias:{},demand:{}},r=Do(e);return r.demanded.forEach(i=>{let[s,...a]=i.cmd;i.variadic&&(n.array.push(s),n.default[s]=[]),n.alias[s]=a,n.demand[s]=!0}),r.optional.forEach(i=>{let[s,...a]=i.cmd;i.variadic&&(n.array.push(s),n.default[s]=[]),n.alias[s]=a}),n}postProcessPositionals(e,n,r,i){let s=Object.assign({},i.getOptions());s.default=Object.assign(r.default,s.default);for(let u of Object.keys(r.alias))s.alias[u]=(s.alias[u]||[]).concat(r.alias[u]);s.array=s.array.concat(r.array),s.config={};let a=[];if(Object.keys(n).forEach(u=>{n[u].map(c=>{s.configuration["unknown-options-as-args"]&&(s.key[u]=!0),a.push(`--${u}`),a.push(c)})}),!a.length)return;let o=Object.assign({},s.configuration,{"populate--":!1}),l=this.shim.Parser.detailed(a,Object.assign({},s,{configuration:o}));if(l.error)i.getInternalMethods().getUsageInstance().fail(l.error.message,l.error);else{let u=Object.keys(n);Object.keys(n).forEach(f=>{u.push(...l.aliases[f])});let c=i.getOptions().default;Object.keys(l.argv).forEach(f=>{u.includes(f)&&(n[f]||(n[f]=l.argv[f]),!Object.prototype.hasOwnProperty.call(c,f)&&Object.prototype.hasOwnProperty.call(e,f)&&Object.prototype.hasOwnProperty.call(l.argv,f)&&(Array.isArray(e[f])||Array.isArray(l.argv[f]))?e[f]=[].concat(e[f],l.argv[f]):e[f]=l.argv[f])})}}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){let r=Ro.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(r,this.defaultCommand.description)}let n=this.defaultCommand.builder;if(Pm(n))return n(e,!0);vP(n)||Object.keys(n).forEach(r=>{e.option(r,n[r])})}moduleName(e){let n=function(r){if(typeof require=="undefined")return null;for(let i,s=0,a=Object.keys(require.cache);s{let n=e;n._handle&&n.isTTY&&typeof n._handle.setBlocking=="function"&&n._handle.setBlocking(t)})}function Rk(t){return typeof t=="boolean"}function wk(t,e){let n=e.y18n.__,r={},i=[];r.failFn=function(M){i.push(M)};let s=null,a=!0;r.showHelpOnFail=function(M=!0,$){let[K,ne]=typeof M=="string"?[!0,M]:[M,$];return s=ne,a=K,r};let o=!1;r.fail=function(M,$){let K=t.getInternalMethods().getLoggerInstance();if(!i.length){if(t.getExitProcess()&&ru(!0),o||(o=!0,a&&(t.showHelp("error"),K.error()),(M||$)&&K.error(M||$),s&&((M||$)&&K.error(""),K.error(s))),$=$||new Qt(M),t.getExitProcess())return t.exit(1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,$);throw $}for(let ne=i.length-1;ne>=0;--ne){let re=i[ne];if(Rk(re)){if($)throw $;if(M)throw Error(M)}else re(M,$,r)}};let l=[],u=!1;r.usage=(M,$)=>M===null?(u=!0,l=[],r):(u=!1,l.push([M,$||""]),r),r.getUsage=()=>l,r.getUsageDisabled=()=>u,r.getPositionalGroupName=()=>n("Positionals:");let c=[];r.example=(M,$)=>{c.push([M,$||""])};let f=[];r.command=function(M,$,K,ne,re=!1){K&&(f=f.map(ye=>(ye[2]=!1,ye))),f.push([M,$||"",K,ne,re])},r.getCommands=()=>f;let h={};r.describe=function(M,$){Array.isArray(M)?M.forEach(K=>{r.describe(K,$)}):typeof M=="object"?Object.keys(M).forEach(K=>{r.describe(K,M[K])}):h[M]=$},r.getDescriptions=()=>h;let y=[];r.epilog=M=>{y.push(M)};let p,d=!1;function g(){return d||(p=function(){let M=80;return e.process.stdColumns?Math.min(M,e.process.stdColumns):M}(),d=!0),p}r.wrap=M=>{d=!0,p=M};let m="__yargsString__:";function b(M,$,K){let ne=0;return Array.isArray(M)||(M=Object.values(M).map(re=>[re])),M.forEach(re=>{ne=Math.max(e.stringWidth(K?`${K} ${xf(re[0])}`:xf(re[0]))+NP(re[0]),ne)}),$&&(ne=Math.min(ne,parseInt((.5*$).toString(),10))),ne}let _;function N(M){return t.getOptions().hiddenOptions.indexOf(M)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}function C(M,$){let K=`[${n("default:")} `;if(M===void 0&&!$)return null;if($)K+=$;else switch(typeof M){case"string":K+=`"${M}"`;break;case"object":K+=JSON.stringify(M);break;default:K+=M}return`${K}]`}r.deferY18nLookup=M=>m+M,r.help=function(){if(_)return _;(function(){let pe=t.getDemandedOptions(),Re=t.getOptions();(Object.keys(Re.alias)||[]).forEach(Ge=>{Re.alias[Ge].forEach(J=>{h[J]&&r.describe(Ge,h[J]),J in pe&&t.demandOption(Ge,pe[J]),Re.boolean.includes(J)&&t.boolean(Ge),Re.count.includes(J)&&t.count(Ge),Re.string.includes(J)&&t.string(Ge),Re.normalize.includes(J)&&t.normalize(Ge),Re.array.includes(J)&&t.array(Ge),Re.number.includes(J)&&t.number(Ge)})})})();let M=t.customScriptName?t.$0:e.path.basename(t.$0),$=t.getDemandedOptions(),K=t.getDemandedCommands(),ne=t.getDeprecatedOptions(),re=t.getGroups(),ye=t.getOptions(),Ce=[];Ce=Ce.concat(Object.keys(h)),Ce=Ce.concat(Object.keys($)),Ce=Ce.concat(Object.keys(K)),Ce=Ce.concat(Object.keys(ye.default)),Ce=Ce.filter(N),Ce=Object.keys(Ce.reduce((pe,Re)=>(Re!=="_"&&(pe[Re]=!0),pe),{}));let ae=g(),Pe=e.cliui({width:ae,wrap:!!ae});if(!u){if(l.length)l.forEach(pe=>{Pe.div({text:`${pe[0].replace(/\$0/g,M)}`}),pe[1]&&Pe.div({text:`${pe[1]}`,padding:[1,0,0,0]})}),Pe.div();else if(f.length){let pe=null;pe=K._?`${M} <${n("command")}> +`),s.border&&(i.unshift("."+"-".repeat(this.negatePadding(s)+2)+"."),i.push("'"+"-".repeat(this.negatePadding(s)+2)+"'")),s.padding&&(i.unshift(...new Array(s.padding[mk]||0).fill("")),i.push(...new Array(s.padding[gk]||0).fill(""))),i.forEach((o,l)=>{n[l]||n.push([]);let u=n[l];for(let c=0;ca.width||ar.stringWidth(a.text));let n=e.length,r=this.width,i=e.map(a=>{if(a.width)return n--,r-=a.width,a.width}),s=n?Math.floor(r/n):0;return i.map((a,o)=>a===void 0?Math.max(s,_k(e[o])):a)}};function eP(t,e,n){return t.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?n:" ":""}function _k(t){let e=t.padding||[],n=1+(e[Ef]||0)+(e[Af]||0);return t.border?n+4:n}function yk(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function bk(t,e){t=t.trim();let n=ar.stringWidth(t);return n=e?t:" ".repeat(e-n>>1)+t}var ar;function vk(t,e){return ar=e,new ZC({width:(t==null?void 0:t.width)||yk(),wrap:t==null?void 0:t.wrap})}var Nk=Nf(),Ck=vf(),Pk=JC();function Sk(t){return vk(t,{stringWidth:Nk,stripAnsi:Ck,wrap:Pk})}tP.exports=Sk});var aP=X((eee,sP)=>{var{dirname:rP,resolve:iP}=require("path"),{readdirSync:Ak,statSync:Ek}=require("fs");sP.exports=function(t,e){let n=iP(".",t),r;for(Ek(n).isDirectory()||(n=rP(n));;){if(r=e(n,Ak(n)),r)return iP(n,r);if(n=rP(r=n),r===n)break}}});var lP=X((tee,oP)=>{"use strict";oP.exports=function(e){if(e===void 0&&(e=2),e>=Error.stackTraceLimit)throw new TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `"+e+"` and Error.stackTraceLimit was: `"+Error.stackTraceLimit+"`");var n=Error.prepareStackTrace;Error.prepareStackTrace=function(i,s){return s};var r=new Error().stack;if(Error.prepareStackTrace=n,r!==null&&typeof r=="object")return r[e]?r[e].getFileName():void 0}});var pP=X((nee,Nm)=>{"use strict";var uP=require("fs"),Ik=require("path").join,Dk=require("path").resolve,cP=require("path").dirname,vm={extensions:["js","json","coffee"],recurse:!0,rename:function(t){return t},visit:function(t){return t}};function xk(t,e,n){return new RegExp("\\.("+n.extensions.join("|")+")$","i").test(e)&&!(n.include&&n.include instanceof RegExp&&!n.include.test(t))&&!(n.include&&typeof n.include=="function"&&!n.include(t,e))&&!(n.exclude&&n.exclude instanceof RegExp&&n.exclude.test(t))&&!(n.exclude&&typeof n.exclude=="function"&&n.exclude(t,e))}function fP(t,e,n){var r={};e&&!n&&typeof e!="string"&&(n=e,e=null),n=n||{};for(var i in vm)typeof n[i]=="undefined"&&(n[i]=vm[i]);return e=e?Dk(cP(t.filename),e):cP(t.filename),uP.readdirSync(e).forEach(function(s){var a=Ik(e,s),o,l,u;uP.statSync(a).isDirectory()&&n.recurse?(o=fP(t,a,n),Object.keys(o).length&&(r[n.rename(s,a,s)]=o)):a!==t.filename&&xk(a,s,n)&&(l=s.substring(0,s.lastIndexOf(".")),u=t.require(a),r[n.rename(l,a,s)]=n.visit(u,a,s)||u)}),r}Nm.exports=fP;Nm.exports.defaults=vm});var $P=X((ree,HP)=>{"use strict";var dP=require("assert"),Qt=class extends Error{constructor(e){super(e||"yargs error"),this.name="YError",Error.captureStackTrace(this,Qt)}},eu,Cm=[];function If(t,e,n,r){eu=r;let i={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if(typeof t.extends!="string")return i;let s=/\.json|\..*rc$/.test(t.extends),a=null;if(s)a=function(o,l){return eu.path.resolve(o,l)}(e,t.extends);else try{a=require.resolve(t.extends)}catch{return t}(function(o){if(Cm.indexOf(o)>-1)throw new Qt(`Circular extended configurations: '${o}'.`)})(a),Cm.push(a),i=s?JSON.parse(eu.readFileSync(a,"utf8")):require(t.extends),delete t.extends,i=If(i,eu.path.dirname(a),n,eu)}return Cm=[],n?hP(i,t):Object.assign({},i,t)}function hP(t,e){let n={};function r(i){return i&&typeof i=="object"&&!Array.isArray(i)}Object.assign(n,t);for(let i of Object.keys(e))r(e[i])&&r(n[i])?n[i]=hP(t[i],e[i]):n[i]=e[i];return n}function Do(t){let e=t.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,r=e.shift();if(!r)throw new Error(`No command found in: ${t}`);let i={cmd:r.replace(n,""),demanded:[],optional:[]};return e.forEach((s,a)=>{let o=!1;s=s.replace(/\s/g,""),/\.+[\]>]/.test(s)&&a===e.length-1&&(o=!0),/^\[/.test(s)?i.optional.push({cmd:s.replace(n,"").split("|"),variadic:o}):i.demanded.push({cmd:s.replace(n,"").split("|"),variadic:o})}),i}var Rk=["first","second","third","fourth","fifth","sixth"];function de(t,e,n){try{let r=0,[i,s,a]=typeof t=="object"?[{demanded:[],optional:[]},t,e]:[Do(`cmd ${t}`),e,n],o=[].slice.call(s);for(;o.length&&o[o.length-1]===void 0;)o.pop();let l=a||o.length;if(lu)throw new Qt(`Too many arguments provided. Expected max ${u} but received ${l}.`);i.demanded.forEach(c=>{let f=mP(o.shift());c.cmd.filter(h=>h===f||h==="*").length===0&&gP(f,c.cmd,r),r+=1}),i.optional.forEach(c=>{if(o.length===0)return;let f=mP(o.shift());c.cmd.filter(h=>h===f||h==="*").length===0&&gP(f,c.cmd,r),r+=1})}catch(r){console.warn(r.stack)}}function mP(t){return Array.isArray(t)?"array":t===null?"null":typeof t}function gP(t,e,n){throw new Qt(`Invalid ${Rk[n]||"manyith"} argument. Expected ${e.join(" or ")} but received ${t}.`)}function Gt(t){return!!t&&!!t.then&&typeof t.then=="function"}function li(t,e,n,r){n.assert.notStrictEqual(t,e,r)}function _P(t,e){e.assert.strictEqual(typeof t,"string")}function Df(t){return Object.keys(t)}function xo(t={},e=()=>!0){let n={};return Df(t).forEach(r=>{e(r,t[r])&&(n[r]=t[r])}),n}function yP(){return process.versions.electron&&!process.defaultApp?0:1}function bP(){return process.argv[yP()]}var wk=Object.freeze({__proto__:null,hideBin:function(t){return t.slice(yP()+1)},getProcessArgvBin:bP});function P(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)}function he(t,e,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(t,n):i?i.value=n:e.set(t,n),n}var TP=class{constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,n,r=!0,i=!1){if(de(" [boolean] [boolean] [boolean]",[e,n,r],arguments.length),Array.isArray(e)){for(let s=0;s{let s=[...r[n]||[],n];return!i.option||!s.includes(i.option)}),e.option=n,this.addMiddleware(e,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let e=this.frozens.pop();e!==void 0&&(this.globalMiddleware=e)}reset(){this.globalMiddleware=this.globalMiddleware.filter(e=>e.global)}};function tu(t,e,n,r){return n.reduce((i,s)=>{if(s.applyBeforeValidation!==r)return i;if(s.mutates){if(s.applied)return i;s.applied=!0}if(Gt(i))return i.then(a=>Promise.all([a,s(a,e)])).then(([a,o])=>Object.assign(a,o));{let a=s(i,e);return Gt(a)?a.then(o=>Object.assign(i,o)):Object.assign(i,a)}},t)}function nu(t,e,n=r=>{throw r}){try{let r=typeof t=="function"?t():t;return Gt(r)?r.then(i=>e(i)):e(r)}catch(r){return n(r)}}var Ro=/(^\*)|(^\$0)/,vP=class{constructor(e,n,r,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=e,this.globalMiddleware=r,this.validation=n}addDirectory(e,n,r,i){typeof(i=i||{}).recurse!="boolean"&&(i.recurse=!1),Array.isArray(i.extensions)||(i.extensions=["js"]);let s=typeof i.visit=="function"?i.visit:a=>a;i.visit=(a,o,l)=>{let u=s(a,o,l);if(u){if(this.requireCache.has(o))return u;this.requireCache.add(o),this.addHandler(u)}return u},this.shim.requireDirectory({require:n,filename:r},e,i)}addHandler(e,n,r,i,s,a){let o=[],l=function(u){return u?u.map(c=>(c.applyBeforeValidation=!1,c)):[]}(s);if(i=i||(()=>{}),Array.isArray(e))if(function(u){return u.every(c=>typeof c=="string")}(e))[e,...o]=e;else for(let u of e)this.addHandler(u);else{if(function(u){return typeof u=="object"&&!Array.isArray(u)}(e)){let u=Array.isArray(e.command)||typeof e.command=="string"?e.command:this.moduleName(e);return e.aliases&&(u=[].concat(u).concat(e.aliases)),void this.addHandler(u,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated)}if(NP(r))return void this.addHandler([e].concat(o),n,r.builder,r.handler,r.middlewares,r.deprecated)}if(typeof e=="string"){let u=Do(e);o=o.map(h=>Do(h).cmd);let c=!1,f=[u.cmd].concat(o).filter(h=>!Ro.test(h)||(c=!0,!1));f.length===0&&c&&f.push("$0"),c&&(u.cmd=f[0],o=f.slice(1),e=e.replace(Ro,u.cmd)),o.forEach(h=>{this.aliasMap[h]=u.cmd}),n!==!1&&this.usage.command(e,n,c,o,a),this.handlers[u.cmd]={original:e,description:n,handler:i,builder:r||{},middlewares:l,deprecated:a,demanded:u.demanded,optional:u.optional},c&&(this.defaultCommand=this.handlers[u.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,n,r,i,s,a){let o=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand,l=n.getInternalMethods().getContext(),u=l.commands.slice(),c=!e;e&&(l.commands.push(e),l.fullCommands.push(o.original));let f=this.applyBuilderUpdateUsageAndParse(c,o,n,r.aliases,u,i,s,a);return Gt(f)?f.then(h=>this.applyMiddlewareAndGetResult(c,o,h.innerArgv,l,s,h.aliases,n)):this.applyMiddlewareAndGetResult(c,o,f.innerArgv,l,s,f.aliases,n)}applyBuilderUpdateUsageAndParse(e,n,r,i,s,a,o,l){let u=n.builder,c=r;if(Pm(u)){let f=u(r.getInternalMethods().reset(i),l);if(Gt(f))return f.then(h=>{var y;return c=(y=h)&&typeof y.getInternalMethods=="function"?h:r,this.parseAndUpdateUsage(e,n,c,s,a,o)})}else(function(f){return typeof f=="object"})(u)&&(c=r.getInternalMethods().reset(i),Object.keys(n.builder).forEach(f=>{c.option(f,u[f])}));return this.parseAndUpdateUsage(e,n,c,s,a,o)}parseAndUpdateUsage(e,n,r,i,s,a){e&&r.getInternalMethods().getUsageInstance().unfreeze(),this.shouldUpdateUsage(r)&&r.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,n),n.description);let o=r.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,s,a);return Gt(o)?o.then(l=>({aliases:r.parsed.aliases,innerArgv:l})):{aliases:r.parsed.aliases,innerArgv:o}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,n){let r=Ro.test(n.original)?n.original.replace(Ro,"").trim():n.original,i=e.filter(s=>!Ro.test(s));return i.push(r),`$0 ${i.join(" ")}`}applyMiddlewareAndGetResult(e,n,r,i,s,a,o){let l={};if(s)return r;o.getInternalMethods().getHasOutput()||(l=this.populatePositionals(n,r,i,o));let u=this.globalMiddleware.getMiddleware().slice(0).concat(n.middlewares);if(r=tu(r,o,u,!0),!o.getInternalMethods().getHasOutput()){let c=o.getInternalMethods().runValidation(a,l,o.parsed.error,e);r=nu(r,f=>(c(f),f))}if(n.handler&&!o.getInternalMethods().getHasOutput()){o.getInternalMethods().setHasOutput();let c=!!o.getOptions().configuration["populate--"];o.getInternalMethods().postProcess(r,c,!1,!1),r=nu(r=tu(r,o,u,!1),f=>{let h=n.handler(f);return Gt(h)?h.then(()=>f):f}),e||o.getInternalMethods().getUsageInstance().cacheHelpMessage(),Gt(r)&&!o.getInternalMethods().hasParseCallback()&&r.catch(f=>{try{o.getInternalMethods().getUsageInstance().fail(null,f)}catch{}})}return e||(i.commands.pop(),i.fullCommands.pop()),r}populatePositionals(e,n,r,i){n._=n._.slice(r.commands.length);let s=e.demanded.slice(0),a=e.optional.slice(0),o={};for(this.validation.positionalCount(s.length,n._.length);s.length;){let l=s.shift();this.populatePositional(l,n,o)}for(;a.length;){let l=a.shift();this.populatePositional(l,n,o)}return n._=r.commands.concat(n._.map(l=>""+l)),this.postProcessPositionals(n,o,this.cmdToParseOptions(e.original),i),o}populatePositional(e,n,r){let i=e.cmd[0];e.variadic?r[i]=n._.splice(0).map(String):n._.length&&(r[i]=[String(n._.shift())])}cmdToParseOptions(e){let n={array:[],default:{},alias:{},demand:{}},r=Do(e);return r.demanded.forEach(i=>{let[s,...a]=i.cmd;i.variadic&&(n.array.push(s),n.default[s]=[]),n.alias[s]=a,n.demand[s]=!0}),r.optional.forEach(i=>{let[s,...a]=i.cmd;i.variadic&&(n.array.push(s),n.default[s]=[]),n.alias[s]=a}),n}postProcessPositionals(e,n,r,i){let s=Object.assign({},i.getOptions());s.default=Object.assign(r.default,s.default);for(let u of Object.keys(r.alias))s.alias[u]=(s.alias[u]||[]).concat(r.alias[u]);s.array=s.array.concat(r.array),s.config={};let a=[];if(Object.keys(n).forEach(u=>{n[u].map(c=>{s.configuration["unknown-options-as-args"]&&(s.key[u]=!0),a.push(`--${u}`),a.push(c)})}),!a.length)return;let o=Object.assign({},s.configuration,{"populate--":!1}),l=this.shim.Parser.detailed(a,Object.assign({},s,{configuration:o}));if(l.error)i.getInternalMethods().getUsageInstance().fail(l.error.message,l.error);else{let u=Object.keys(n);Object.keys(n).forEach(f=>{u.push(...l.aliases[f])});let c=i.getOptions().default;Object.keys(l.argv).forEach(f=>{u.includes(f)&&(n[f]||(n[f]=l.argv[f]),!Object.prototype.hasOwnProperty.call(c,f)&&Object.prototype.hasOwnProperty.call(e,f)&&Object.prototype.hasOwnProperty.call(l.argv,f)&&(Array.isArray(e[f])||Array.isArray(l.argv[f]))?e[f]=[].concat(e[f],l.argv[f]):e[f]=l.argv[f])})}}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){let r=Ro.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(r,this.defaultCommand.description)}let n=this.defaultCommand.builder;if(Pm(n))return n(e,!0);NP(n)||Object.keys(n).forEach(r=>{e.option(r,n[r])})}moduleName(e){let n=function(r){if(typeof require=="undefined")return null;for(let i,s=0,a=Object.keys(require.cache);s{let n=e;n._handle&&n.isTTY&&typeof n._handle.setBlocking=="function"&&n._handle.setBlocking(t)})}function Ok(t){return typeof t=="boolean"}function Lk(t,e){let n=e.y18n.__,r={},i=[];r.failFn=function(M){i.push(M)};let s=null,a=!0;r.showHelpOnFail=function(M=!0,$){let[K,ne]=typeof M=="string"?[!0,M]:[M,$];return s=ne,a=K,r};let o=!1;r.fail=function(M,$){let K=t.getInternalMethods().getLoggerInstance();if(!i.length){if(t.getExitProcess()&&ru(!0),o||(o=!0,a&&(t.showHelp("error"),K.error()),(M||$)&&K.error(M||$),s&&((M||$)&&K.error(""),K.error(s))),$=$||new Qt(M),t.getExitProcess())return t.exit(1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,$);throw $}for(let ne=i.length-1;ne>=0;--ne){let re=i[ne];if(Ok(re)){if($)throw $;if(M)throw Error(M)}else re(M,$,r)}};let l=[],u=!1;r.usage=(M,$)=>M===null?(u=!0,l=[],r):(u=!1,l.push([M,$||""]),r),r.getUsage=()=>l,r.getUsageDisabled=()=>u,r.getPositionalGroupName=()=>n("Positionals:");let c=[];r.example=(M,$)=>{c.push([M,$||""])};let f=[];r.command=function(M,$,K,ne,re=!1){K&&(f=f.map(ye=>(ye[2]=!1,ye))),f.push([M,$||"",K,ne,re])},r.getCommands=()=>f;let h={};r.describe=function(M,$){Array.isArray(M)?M.forEach(K=>{r.describe(K,$)}):typeof M=="object"?Object.keys(M).forEach(K=>{r.describe(K,M[K])}):h[M]=$},r.getDescriptions=()=>h;let y=[];r.epilog=M=>{y.push(M)};let p,d=!1;function g(){return d||(p=function(){let M=80;return e.process.stdColumns?Math.min(M,e.process.stdColumns):M}(),d=!0),p}r.wrap=M=>{d=!0,p=M};let m="__yargsString__:";function b(M,$,K){let ne=0;return Array.isArray(M)||(M=Object.values(M).map(re=>[re])),M.forEach(re=>{ne=Math.max(e.stringWidth(K?`${K} ${xf(re[0])}`:xf(re[0]))+CP(re[0]),ne)}),$&&(ne=Math.min(ne,parseInt((.5*$).toString(),10))),ne}let _;function N(M){return t.getOptions().hiddenOptions.indexOf(M)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}function C(M,$){let K=`[${n("default:")} `;if(M===void 0&&!$)return null;if($)K+=$;else switch(typeof M){case"string":K+=`"${M}"`;break;case"object":K+=JSON.stringify(M);break;default:K+=M}return`${K}]`}r.deferY18nLookup=M=>m+M,r.help=function(){if(_)return _;(function(){let pe=t.getDemandedOptions(),Re=t.getOptions();(Object.keys(Re.alias)||[]).forEach(Ge=>{Re.alias[Ge].forEach(J=>{h[J]&&r.describe(Ge,h[J]),J in pe&&t.demandOption(Ge,pe[J]),Re.boolean.includes(J)&&t.boolean(Ge),Re.count.includes(J)&&t.count(Ge),Re.string.includes(J)&&t.string(Ge),Re.normalize.includes(J)&&t.normalize(Ge),Re.array.includes(J)&&t.array(Ge),Re.number.includes(J)&&t.number(Ge)})})})();let M=t.customScriptName?t.$0:e.path.basename(t.$0),$=t.getDemandedOptions(),K=t.getDemandedCommands(),ne=t.getDeprecatedOptions(),re=t.getGroups(),ye=t.getOptions(),Ce=[];Ce=Ce.concat(Object.keys(h)),Ce=Ce.concat(Object.keys($)),Ce=Ce.concat(Object.keys(K)),Ce=Ce.concat(Object.keys(ye.default)),Ce=Ce.filter(N),Ce=Object.keys(Ce.reduce((pe,Re)=>(Re!=="_"&&(pe[Re]=!0),pe),{}));let ae=g(),Pe=e.cliui({width:ae,wrap:!!ae});if(!u){if(l.length)l.forEach(pe=>{Pe.div({text:`${pe[0].replace(/\$0/g,M)}`}),pe[1]&&Pe.div({text:`${pe[1]}`,padding:[1,0,0,0]})}),Pe.div();else if(f.length){let pe=null;pe=K._?`${M} <${n("command")}> `:`${M} [${n("command")}] -`,Pe.div(`${pe}`)}}if(f.length>1||f.length===1&&!f[0][2]){Pe.div(n("Commands:"));let pe=t.getInternalMethods().getContext(),Re=pe.commands.length?`${pe.commands.join(" ")} `:"";t.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(f=f.sort((J,pt)=>J[0].localeCompare(pt[0])));let Ge=M?`${M} `:"";f.forEach(J=>{let pt=`${Ge}${Re}${J[0].replace(/^\$0 ?/,"")}`;Pe.span({text:pt,padding:[0,2,0,2],width:b(f,ae,`${M}${Re}`)+4},{text:J[1]});let st=[];J[2]&&st.push(`[${n("default")}]`),J[3]&&J[3].length&&st.push(`[${n("aliases:")} ${J[3].join(", ")}]`),J[4]&&(typeof J[4]=="string"?st.push(`[${n("deprecated: %s",J[4])}]`):st.push(`[${n("deprecated")}]`)),st.length?Pe.div({text:st.join(" "),padding:[0,0,0,2],align:"right"}):Pe.div()}),Pe.div()}let ct=(Object.keys(ye.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);Ce=Ce.filter(pe=>!t.parsed.newAliases[pe]&&ct.every(Re=>(ye.alias[Re]||[]).indexOf(pe)===-1));let Jt=n("Options:");re[Jt]||(re[Jt]=[]),function(pe,Re,Ge,J){let pt=[],st=null;Object.keys(Ge).forEach(Dt=>{pt=pt.concat(Ge[Dt])}),pe.forEach(Dt=>{st=[Dt].concat(Re[Dt]),st.some(vn=>pt.indexOf(vn)!==-1)||Ge[J].push(Dt)})}(Ce,ye.alias,re,Jt);let Je=pe=>/^--/.test(xf(pe)),ft=Object.keys(re).filter(pe=>re[pe].length>0).map(pe=>({groupName:pe,normalizedKeys:re[pe].filter(N).map(Re=>{if(ct.includes(Re))return Re;for(let Ge,J=0;(Ge=ct[J])!==void 0;J++)if((ye.alias[Ge]||[]).includes(Re))return Ge;return Re})})).filter(({normalizedKeys:pe})=>pe.length>0).map(({groupName:pe,normalizedKeys:Re})=>{let Ge=Re.reduce((J,pt)=>(J[pt]=[pt].concat(ye.alias[pt]||[]).map(st=>pe===r.getPositionalGroupName()?st:(/^[0-9]$/.test(st)?ye.boolean.includes(pt)?"-":"--":st.length>1?"--":"-")+st).sort((st,Dt)=>Je(st)===Je(Dt)?0:Je(st)?1:-1).join(", "),J),{});return{groupName:pe,normalizedKeys:Re,switches:Ge}});if(ft.filter(({groupName:pe})=>pe!==r.getPositionalGroupName()).some(({normalizedKeys:pe,switches:Re})=>!pe.every(Ge=>Je(Re[Ge])))&&ft.filter(({groupName:pe})=>pe!==r.getPositionalGroupName()).forEach(({normalizedKeys:pe,switches:Re})=>{pe.forEach(Ge=>{var J,pt;Je(Re[Ge])&&(Re[Ge]=(J=Re[Ge],pt="-x, ".length,Am(J)?{text:J.text,indentation:J.indentation+pt}:{text:J,indentation:pt}))})}),ft.forEach(({groupName:pe,normalizedKeys:Re,switches:Ge})=>{Pe.div(pe),Re.forEach(J=>{let pt=Ge[J],st=h[J]||"",Dt=null;st.includes(m)&&(st=n(st.substring(m.length))),ye.boolean.includes(J)&&(Dt=`[${n("boolean")}]`),ye.count.includes(J)&&(Dt=`[${n("count")}]`),ye.string.includes(J)&&(Dt=`[${n("string")}]`),ye.normalize.includes(J)&&(Dt=`[${n("string")}]`),ye.array.includes(J)&&(Dt=`[${n("array")}]`),ye.number.includes(J)&&(Dt=`[${n("number")}]`);let vn=[J in ne?(Si=ne[J],typeof Si=="string"?`[${n("deprecated: %s",Si)}]`:`[${n("deprecated")}]`):null,Dt,J in $?`[${n("required")}]`:null,ye.choices&&ye.choices[J]?`[${n("choices:")} ${r.stringifiedValues(ye.choices[J])}]`:null,C(ye.default[J],ye.defaultDescription[J])].filter(Boolean).join(" ");var Si;Pe.span({text:xf(pt),padding:[0,2,0,2+NP(pt)],width:b(Ge,ae)+4},st),vn?Pe.div({text:vn,padding:[0,0,0,2],align:"right"}):Pe.div()}),Pe.div()}),c.length&&(Pe.div(n("Examples:")),c.forEach(pe=>{pe[0]=pe[0].replace(/\$0/g,M)}),c.forEach(pe=>{pe[1]===""?Pe.div({text:pe[0],padding:[0,2,0,2]}):Pe.div({text:pe[0],padding:[0,2,0,2],width:b(c,ae)+4},{text:pe[1]})}),Pe.div()),y.length>0){let pe=y.map(Re=>Re.replace(/\$0/g,M)).join(` +`,Pe.div(`${pe}`)}}if(f.length>1||f.length===1&&!f[0][2]){Pe.div(n("Commands:"));let pe=t.getInternalMethods().getContext(),Re=pe.commands.length?`${pe.commands.join(" ")} `:"";t.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(f=f.sort((J,pt)=>J[0].localeCompare(pt[0])));let Ge=M?`${M} `:"";f.forEach(J=>{let pt=`${Ge}${Re}${J[0].replace(/^\$0 ?/,"")}`;Pe.span({text:pt,padding:[0,2,0,2],width:b(f,ae,`${M}${Re}`)+4},{text:J[1]});let st=[];J[2]&&st.push(`[${n("default")}]`),J[3]&&J[3].length&&st.push(`[${n("aliases:")} ${J[3].join(", ")}]`),J[4]&&(typeof J[4]=="string"?st.push(`[${n("deprecated: %s",J[4])}]`):st.push(`[${n("deprecated")}]`)),st.length?Pe.div({text:st.join(" "),padding:[0,0,0,2],align:"right"}):Pe.div()}),Pe.div()}let ct=(Object.keys(ye.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);Ce=Ce.filter(pe=>!t.parsed.newAliases[pe]&&ct.every(Re=>(ye.alias[Re]||[]).indexOf(pe)===-1));let Jt=n("Options:");re[Jt]||(re[Jt]=[]),function(pe,Re,Ge,J){let pt=[],st=null;Object.keys(Ge).forEach(Dt=>{pt=pt.concat(Ge[Dt])}),pe.forEach(Dt=>{st=[Dt].concat(Re[Dt]),st.some(vn=>pt.indexOf(vn)!==-1)||Ge[J].push(Dt)})}(Ce,ye.alias,re,Jt);let Je=pe=>/^--/.test(xf(pe)),ft=Object.keys(re).filter(pe=>re[pe].length>0).map(pe=>({groupName:pe,normalizedKeys:re[pe].filter(N).map(Re=>{if(ct.includes(Re))return Re;for(let Ge,J=0;(Ge=ct[J])!==void 0;J++)if((ye.alias[Ge]||[]).includes(Re))return Ge;return Re})})).filter(({normalizedKeys:pe})=>pe.length>0).map(({groupName:pe,normalizedKeys:Re})=>{let Ge=Re.reduce((J,pt)=>(J[pt]=[pt].concat(ye.alias[pt]||[]).map(st=>pe===r.getPositionalGroupName()?st:(/^[0-9]$/.test(st)?ye.boolean.includes(pt)?"-":"--":st.length>1?"--":"-")+st).sort((st,Dt)=>Je(st)===Je(Dt)?0:Je(st)?1:-1).join(", "),J),{});return{groupName:pe,normalizedKeys:Re,switches:Ge}});if(ft.filter(({groupName:pe})=>pe!==r.getPositionalGroupName()).some(({normalizedKeys:pe,switches:Re})=>!pe.every(Ge=>Je(Re[Ge])))&&ft.filter(({groupName:pe})=>pe!==r.getPositionalGroupName()).forEach(({normalizedKeys:pe,switches:Re})=>{pe.forEach(Ge=>{var J,pt;Je(Re[Ge])&&(Re[Ge]=(J=Re[Ge],pt="-x, ".length,Sm(J)?{text:J.text,indentation:J.indentation+pt}:{text:J,indentation:pt}))})}),ft.forEach(({groupName:pe,normalizedKeys:Re,switches:Ge})=>{Pe.div(pe),Re.forEach(J=>{let pt=Ge[J],st=h[J]||"",Dt=null;st.includes(m)&&(st=n(st.substring(m.length))),ye.boolean.includes(J)&&(Dt=`[${n("boolean")}]`),ye.count.includes(J)&&(Dt=`[${n("count")}]`),ye.string.includes(J)&&(Dt=`[${n("string")}]`),ye.normalize.includes(J)&&(Dt=`[${n("string")}]`),ye.array.includes(J)&&(Dt=`[${n("array")}]`),ye.number.includes(J)&&(Dt=`[${n("number")}]`);let vn=[J in ne?(Ai=ne[J],typeof Ai=="string"?`[${n("deprecated: %s",Ai)}]`:`[${n("deprecated")}]`):null,Dt,J in $?`[${n("required")}]`:null,ye.choices&&ye.choices[J]?`[${n("choices:")} ${r.stringifiedValues(ye.choices[J])}]`:null,C(ye.default[J],ye.defaultDescription[J])].filter(Boolean).join(" ");var Ai;Pe.span({text:xf(pt),padding:[0,2,0,2+CP(pt)],width:b(Ge,ae)+4},st),vn?Pe.div({text:vn,padding:[0,0,0,2],align:"right"}):Pe.div()}),Pe.div()}),c.length&&(Pe.div(n("Examples:")),c.forEach(pe=>{pe[0]=pe[0].replace(/\$0/g,M)}),c.forEach(pe=>{pe[1]===""?Pe.div({text:pe[0],padding:[0,2,0,2]}):Pe.div({text:pe[0],padding:[0,2,0,2],width:b(c,ae)+4},{text:pe[1]})}),Pe.div()),y.length>0){let pe=y.map(Re=>Re.replace(/\$0/g,M)).join(` `);Pe.div(`${pe} -`)}return Pe.toString().replace(/\s*$/,"")},r.cacheHelpMessage=function(){_=this.help()},r.clearCachedHelpMessage=function(){_=void 0},r.hasCachedHelpMessage=function(){return!!_},r.showHelp=M=>{let $=t.getInternalMethods().getLoggerInstance();M||(M="error"),(typeof M=="function"?M:$[M])(r.help())},r.functionDescription=M=>["(",M.name?e.Parser.decamelize(M.name,"-"):n("generated-value"),")"].join(""),r.stringifiedValues=function(M,$){let K="",ne=$||", ",re=[].concat(M);return M&&re.length&&re.forEach(ye=>{K.length&&(K+=ne),K+=JSON.stringify(ye)}),K};let G=null;r.version=M=>{G=M},r.showVersion=M=>{let $=t.getInternalMethods().getLoggerInstance();M||(M="error"),(typeof M=="function"?M:$[M])(G)},r.reset=function(M){return s=null,o=!1,l=[],u=!1,y=[],c=[],f=[],h=xo(h,$=>!M[$]),r};let L=[];return r.freeze=function(){L.push({failMessage:s,failureOutput:o,usages:l,usageDisabled:u,epilogs:y,examples:c,commands:f,descriptions:h})},r.unfreeze=function(){let M=L.pop();M&&({failMessage:s,failureOutput:o,usages:l,usageDisabled:u,epilogs:y,examples:c,commands:f,descriptions:h}=M)},r}function Am(t){return typeof t=="object"}function NP(t){return Am(t)?t.indentation:0}function xf(t){return Am(t)?t.text:t}var CP=class{constructor(e,n,r,i){var s,a,o;this.yargs=e,this.usage=n,this.command=r,this.shim=i,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.zshShell=(o=((s=this.shim.getEnv("SHELL"))===null||s===void 0?void 0:s.includes("zsh"))||((a=this.shim.getEnv("ZSH_NAME"))===null||a===void 0?void 0:a.includes("zsh")))!==null&&o!==void 0&&o}defaultCompletion(e,n,r,i){let s=this.command.getCommandHandlers();for(let o=0,l=e.length;o{let a=Do(s[0]).cmd;if(n.indexOf(a)===-1)if(this.zshShell){let o=s[1]||"";e.push(a.replace(/:/g,"\\:")+":"+o)}else e.push(a)})}optionCompletions(e,n,r,i){if((i.match(/^-/)||i===""&&e.length===0)&&!this.previousArgHasChoices(n)){let s=this.yargs.getOptions(),a=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(s.key).forEach(o=>{let l=!!s.configuration["boolean-negation"]&&s.boolean.includes(o);a.includes(o)||this.argsContainKey(n,r,o,l)||(this.completeOptionKey(o,e,i),l&&s.default[o]&&this.completeOptionKey(`no-${o}`,e,i))})}}choicesCompletions(e,n,r,i){if(this.previousArgHasChoices(n)){let s=this.getPreviousArgChoices(n);s&&s.length>0&&e.push(...s)}}getPreviousArgChoices(e){if(e.length<1)return;let n=e[e.length-1],r="";if(!n.startsWith("--")&&e.length>1&&(r=n,n=e[e.length-2]),!n.startsWith("--"))return;let i=n.replace(/-/g,""),s=this.yargs.getOptions();return Object.keys(s.key).some(a=>a===i)&&Array.isArray(s.choices[i])?s.choices[i].filter(a=>!r||a.startsWith(r)):void 0}previousArgHasChoices(e){let n=this.getPreviousArgChoices(e);return n!==void 0&&n.length>0}argsContainKey(e,n,r,i){if(e.indexOf(`--${r}`)!==-1||i&&e.indexOf(`--no-${r}`)!==-1)return!0;if(this.aliases){for(let s of this.aliases[r])if(n[s]!==void 0)return!0}return!1}completeOptionKey(e,n,r){let i=this.usage.getDescriptions(),s=!/^--/.test(r)&&(a=>/^[^0-9]$/.test(a))(e)?"-":"--";if(this.zshShell){let a=i[e]||"";n.push(s+`${e.replace(/:/g,"\\:")}:${a.replace("__yargsString__:","")}`)}else n.push(s+e)}customCompletion(e,n,r,i){if(li(this.customCompletionFunction,null,this.shim),this.customCompletionFunction.length<3){let s=this.customCompletionFunction(r,n);return Gt(s)?s.then(a=>{this.shim.process.nextTick(()=>{i(null,a)})}).catch(a=>{this.shim.process.nextTick(()=>{i(a,void 0)})}):i(null,s)}return function(s){return s.length>3}(this.customCompletionFunction)?this.customCompletionFunction(r,n,(s=i)=>this.defaultCompletion(e,n,r,s),s=>{i(null,s)}):this.customCompletionFunction(r,n,s=>{i(null,s)})}getCompletion(e,n){let r=e.length?e[e.length-1]:"",i=this.yargs.parse(e,!0),s=this.customCompletionFunction?a=>this.customCompletion(e,a,r,n):a=>this.defaultCompletion(e,a,r,n);return Gt(i)?i.then(s):s(i)}generateCompletionScript(e,n){let r=this.zshShell?`#compdef {{app_name}} +`)}return Pe.toString().replace(/\s*$/,"")},r.cacheHelpMessage=function(){_=this.help()},r.clearCachedHelpMessage=function(){_=void 0},r.hasCachedHelpMessage=function(){return!!_},r.showHelp=M=>{let $=t.getInternalMethods().getLoggerInstance();M||(M="error"),(typeof M=="function"?M:$[M])(r.help())},r.functionDescription=M=>["(",M.name?e.Parser.decamelize(M.name,"-"):n("generated-value"),")"].join(""),r.stringifiedValues=function(M,$){let K="",ne=$||", ",re=[].concat(M);return M&&re.length&&re.forEach(ye=>{K.length&&(K+=ne),K+=JSON.stringify(ye)}),K};let G=null;r.version=M=>{G=M},r.showVersion=M=>{let $=t.getInternalMethods().getLoggerInstance();M||(M="error"),(typeof M=="function"?M:$[M])(G)},r.reset=function(M){return s=null,o=!1,l=[],u=!1,y=[],c=[],f=[],h=xo(h,$=>!M[$]),r};let L=[];return r.freeze=function(){L.push({failMessage:s,failureOutput:o,usages:l,usageDisabled:u,epilogs:y,examples:c,commands:f,descriptions:h})},r.unfreeze=function(){let M=L.pop();M&&({failMessage:s,failureOutput:o,usages:l,usageDisabled:u,epilogs:y,examples:c,commands:f,descriptions:h}=M)},r}function Sm(t){return typeof t=="object"}function CP(t){return Sm(t)?t.indentation:0}function xf(t){return Sm(t)?t.text:t}var PP=class{constructor(e,n,r,i){var s,a,o;this.yargs=e,this.usage=n,this.command=r,this.shim=i,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.zshShell=(o=((s=this.shim.getEnv("SHELL"))===null||s===void 0?void 0:s.includes("zsh"))||((a=this.shim.getEnv("ZSH_NAME"))===null||a===void 0?void 0:a.includes("zsh")))!==null&&o!==void 0&&o}defaultCompletion(e,n,r,i){let s=this.command.getCommandHandlers();for(let o=0,l=e.length;o{let a=Do(s[0]).cmd;if(n.indexOf(a)===-1)if(this.zshShell){let o=s[1]||"";e.push(a.replace(/:/g,"\\:")+":"+o)}else e.push(a)})}optionCompletions(e,n,r,i){if((i.match(/^-/)||i===""&&e.length===0)&&!this.previousArgHasChoices(n)){let s=this.yargs.getOptions(),a=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(s.key).forEach(o=>{let l=!!s.configuration["boolean-negation"]&&s.boolean.includes(o);a.includes(o)||this.argsContainKey(n,r,o,l)||(this.completeOptionKey(o,e,i),l&&s.default[o]&&this.completeOptionKey(`no-${o}`,e,i))})}}choicesCompletions(e,n,r,i){if(this.previousArgHasChoices(n)){let s=this.getPreviousArgChoices(n);s&&s.length>0&&e.push(...s)}}getPreviousArgChoices(e){if(e.length<1)return;let n=e[e.length-1],r="";if(!n.startsWith("--")&&e.length>1&&(r=n,n=e[e.length-2]),!n.startsWith("--"))return;let i=n.replace(/-/g,""),s=this.yargs.getOptions();return Object.keys(s.key).some(a=>a===i)&&Array.isArray(s.choices[i])?s.choices[i].filter(a=>!r||a.startsWith(r)):void 0}previousArgHasChoices(e){let n=this.getPreviousArgChoices(e);return n!==void 0&&n.length>0}argsContainKey(e,n,r,i){if(e.indexOf(`--${r}`)!==-1||i&&e.indexOf(`--no-${r}`)!==-1)return!0;if(this.aliases){for(let s of this.aliases[r])if(n[s]!==void 0)return!0}return!1}completeOptionKey(e,n,r){let i=this.usage.getDescriptions(),s=!/^--/.test(r)&&(a=>/^[^0-9]$/.test(a))(e)?"-":"--";if(this.zshShell){let a=i[e]||"";n.push(s+`${e.replace(/:/g,"\\:")}:${a.replace("__yargsString__:","")}`)}else n.push(s+e)}customCompletion(e,n,r,i){if(li(this.customCompletionFunction,null,this.shim),this.customCompletionFunction.length<3){let s=this.customCompletionFunction(r,n);return Gt(s)?s.then(a=>{this.shim.process.nextTick(()=>{i(null,a)})}).catch(a=>{this.shim.process.nextTick(()=>{i(a,void 0)})}):i(null,s)}return function(s){return s.length>3}(this.customCompletionFunction)?this.customCompletionFunction(r,n,(s=i)=>this.defaultCompletion(e,n,r,s),s=>{i(null,s)}):this.customCompletionFunction(r,n,s=>{i(null,s)})}getCompletion(e,n){let r=e.length?e[e.length-1]:"",i=this.yargs.parse(e,!0),s=this.customCompletionFunction?a=>this.customCompletion(e,a,r,n):a=>this.defaultCompletion(e,a,r,n);return Gt(i)?i.then(s):s(i)}generateCompletionScript(e,n){let r=this.zshShell?`#compdef {{app_name}} ###-begin-{{app_name}}-completions-### # # yargs command completion script @@ -274,99 +274,101 @@ _{{app_name}}_yargs_completions() } complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}} ###-end-{{app_name}}-completions-### -`,i=this.shim.path.basename(e);return e.match(/\.js$/)&&(e=`./${e}`),r=r.replace(/{{app_name}}/g,i),r=r.replace(/{{completion_command}}/g,n),r.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}};function Ok(t,e){if(t.length===0)return e.length;if(e.length===0)return t.length;let n=[],r,i;for(r=0;r<=e.length;r++)n[r]=[r];for(i=0;i<=t.length;i++)n[0][i]=i;for(r=1;r<=e.length;r++)for(i=1;i<=t.length;i++)e.charAt(r-1)===t.charAt(i-1)?n[r][i]=n[r-1][i-1]:r>1&&i>1&&e.charAt(r-2)===t.charAt(i-1)&&e.charAt(r-1)===t.charAt(i-2)?n[r][i]=n[r-2][i-2]+1:n[r][i]=Math.min(n[r-1][i-1]+1,Math.min(n[r][i-1]+1,n[r-1][i]+1));return n[e.length][t.length]}var PP=["$0","--","_"],Ft,aa,iu,Ir,or,Rf,As,oa,wf,Dr,Of,xr,Pi,lr,Rr,wo,on,be,Lf,Ff,ur,la,Oo,ua,Ss,kf,Ie,ca,fa,pa,Fe,Ai,It,AP=Symbol("copyDoubleDash"),SP=Symbol("copyDoubleDash"),Sm=Symbol("deleteFromParserHintObject"),EP=Symbol("emitWarning"),IP=Symbol("freeze"),DP=Symbol("getDollarZero"),da=Symbol("getParserConfiguration"),Em=Symbol("guessLocale"),xP=Symbol("guessVersion"),RP=Symbol("parsePositionalNumbers"),Im=Symbol("pkgUp"),Es=Symbol("populateParserHintArray"),Lo=Symbol("populateParserHintSingleValueDictionary"),Dm=Symbol("populateParserHintArrayDictionary"),xm=Symbol("populateParserHintDictionary"),Rm=Symbol("sanitizeKey"),wm=Symbol("setKey"),Om=Symbol("unfreeze"),wP=Symbol("validateAsync"),OP=Symbol("getCommandInstance"),LP=Symbol("getContext"),FP=Symbol("getHasOutput"),kP=Symbol("getLoggerInstance"),MP=Symbol("getParseContext"),BP=Symbol("getUsageInstance"),qP=Symbol("getValidationInstance"),Mf=Symbol("hasParseCallback"),ha=Symbol("postProcess"),VP=Symbol("rebase"),Lm=Symbol("reset"),su=Symbol("runYargsParserAndExecuteCommands"),Fm=Symbol("runValidation"),jP=Symbol("setHasOutput"),ma=Symbol("kTrackManuallySetKeys"),UP=class{constructor(e=[],n,r,i){this.customScriptName=!1,this.parsed=!1,Ft.set(this,void 0),aa.set(this,void 0),iu.set(this,{commands:[],fullCommands:[]}),Ir.set(this,null),or.set(this,null),Rf.set(this,"show-hidden"),As.set(this,null),oa.set(this,!0),wf.set(this,{}),Dr.set(this,!0),Of.set(this,[]),xr.set(this,void 0),Pi.set(this,{}),lr.set(this,!1),Rr.set(this,null),wo.set(this,void 0),on.set(this,""),be.set(this,void 0),Lf.set(this,void 0),Ff.set(this,{}),ur.set(this,null),la.set(this,null),Oo.set(this,{}),ua.set(this,{}),Ss.set(this,void 0),kf.set(this,!1),Ie.set(this,void 0),ca.set(this,!1),fa.set(this,!1),pa.set(this,!1),Fe.set(this,void 0),Ai.set(this,null),It.set(this,void 0),he(this,Ie,i,"f"),he(this,Ss,e,"f"),he(this,aa,n,"f"),he(this,Lf,r,"f"),he(this,xr,new bP(this),"f"),this.$0=this[DP](),this[Lm](),he(this,Ft,P(this,Ft,"f"),"f"),he(this,Fe,P(this,Fe,"f"),"f"),he(this,It,P(this,It,"f"),"f"),he(this,be,P(this,be,"f"),"f"),P(this,be,"f").showHiddenOpt=P(this,Rf,"f"),he(this,wo,this[SP](),"f")}addHelpOpt(e,n){return de("[string|boolean] [string]",[e,n],arguments.length),P(this,Rr,"f")&&(this[Sm](P(this,Rr,"f")),he(this,Rr,null,"f")),e===!1&&n===void 0||(he(this,Rr,typeof e=="string"?e:"help","f"),this.boolean(P(this,Rr,"f")),this.describe(P(this,Rr,"f"),n||P(this,Fe,"f").deferY18nLookup("Show help"))),this}help(e,n){return this.addHelpOpt(e,n)}addShowHiddenOpt(e,n){if(de("[string|boolean] [string]",[e,n],arguments.length),e===!1&&n===void 0)return this;let r=typeof e=="string"?e:P(this,Rf,"f");return this.boolean(r),this.describe(r,n||P(this,Fe,"f").deferY18nLookup("Show hidden options")),P(this,be,"f").showHiddenOpt=r,this}showHidden(e,n){return this.addShowHiddenOpt(e,n)}alias(e,n){return de(" [string|array]",[e,n],arguments.length),this[Dm](this.alias.bind(this),"alias",e,n),this}array(e){return de("",[e],arguments.length),this[Es]("array",e),this[ma](e),this}boolean(e){return de("",[e],arguments.length),this[Es]("boolean",e),this[ma](e),this}check(e,n){return de(" [boolean]",[e,n],arguments.length),this.middleware((r,i)=>nu(()=>e(r,i.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&P(this,Fe,"f").fail(s.toString(),s):P(this,Fe,"f").fail(P(this,Ie,"f").y18n.__("Argument check failed: %s",e.toString())),r),s=>(P(this,Fe,"f").fail(s.message?s.message:s.toString(),s),r)),!1,n),this}choices(e,n){return de(" [string|array]",[e,n],arguments.length),this[Dm](this.choices.bind(this),"choices",e,n),this}coerce(e,n){if(de(" [function]",[e,n],arguments.length),Array.isArray(e)){if(!n)throw new Qt("coerce callback must be provided");for(let r of e)this.coerce(r,n);return this}if(typeof e=="object"){for(let r of Object.keys(e))this.coerce(r,e[r]);return this}if(!n)throw new Qt("coerce callback must be provided");return P(this,be,"f").key[e]=!0,P(this,xr,"f").addCoerceMiddleware((r,i)=>{let s;return nu(()=>(s=i.getAliases(),n(r[e])),a=>{if(r[e]=a,s[e])for(let o of s[e])r[o]=a;return r},a=>{throw new Qt(a.message)})},e),this}conflicts(e,n){return de(" [string|array]",[e,n],arguments.length),P(this,It,"f").conflicts(e,n),this}config(e="config",n,r){return de("[object|string] [string|function] [function]",[e,n,r],arguments.length),typeof e!="object"||Array.isArray(e)?(typeof n=="function"&&(r=n,n=void 0),this.describe(e,n||P(this,Fe,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(i=>{P(this,be,"f").config[i]=r||!0}),this):(e=If(e,P(this,aa,"f"),this[da]()["deep-merge-config"]||!1,P(this,Ie,"f")),P(this,be,"f").configObjects=(P(this,be,"f").configObjects||[]).concat(e),this)}completion(e,n,r){return de("[string] [string|boolean|function] [function]",[e,n,r],arguments.length),typeof n=="function"&&(r=n,n=void 0),he(this,or,e||P(this,or,"f")||"completion","f"),n||n===!1||(n="generate completion script"),this.command(P(this,or,"f"),n),r&&P(this,Ir,"f").registerFunction(r),this}command(e,n,r,i,s,a){return de(" [string|boolean] [function|object] [function] [array] [boolean|string]",[e,n,r,i,s,a],arguments.length),P(this,Ft,"f").addHandler(e,n,r,i,s,a),this}commands(e,n,r,i,s,a){return this.command(e,n,r,i,s,a)}commandDir(e,n){de(" [object]",[e,n],arguments.length);let r=P(this,Lf,"f")||P(this,Ie,"f").require;return P(this,Ft,"f").addDirectory(e,r,P(this,Ie,"f").getCallerFile(),n),this}count(e){return de("",[e],arguments.length),this[Es]("count",e),this[ma](e),this}default(e,n,r){return de(" [*] [string]",[e,n,r],arguments.length),r&&(gP(e,P(this,Ie,"f")),P(this,be,"f").defaultDescription[e]=r),typeof n=="function"&&(gP(e,P(this,Ie,"f")),P(this,be,"f").defaultDescription[e]||(P(this,be,"f").defaultDescription[e]=P(this,Fe,"f").functionDescription(n)),n=n.call()),this[Lo](this.default.bind(this),"default",e,n),this}defaults(e,n,r){return this.default(e,n,r)}demandCommand(e=1,n,r,i){return de("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,n,r,i],arguments.length),typeof n!="number"&&(r=n,n=1/0),this.global("_",!1),P(this,be,"f").demandedCommands._={min:e,max:n,minMsg:r,maxMsg:i},this}demand(e,n,r){return Array.isArray(n)?(n.forEach(i=>{li(r,!0,P(this,Ie,"f")),this.demandOption(i,r)}),n=1/0):typeof n!="number"&&(r=n,n=1/0),typeof e=="number"?(li(r,!0,P(this,Ie,"f")),this.demandCommand(e,n,r,r)):Array.isArray(e)?e.forEach(i=>{li(r,!0,P(this,Ie,"f")),this.demandOption(i,r)}):typeof r=="string"?this.demandOption(e,r):r!==!0&&r!==void 0||this.demandOption(e),this}demandOption(e,n){return de(" [string]",[e,n],arguments.length),this[Lo](this.demandOption.bind(this),"demandedOptions",e,n),this}deprecateOption(e,n){return de(" [string|boolean]",[e,n],arguments.length),P(this,be,"f").deprecatedOptions[e]=n,this}describe(e,n){return de(" [string]",[e,n],arguments.length),this[wm](e,!0),P(this,Fe,"f").describe(e,n),this}detectLocale(e){return de("",[e],arguments.length),he(this,oa,e,"f"),this}env(e){return de("[string|boolean]",[e],arguments.length),e===!1?delete P(this,be,"f").envPrefix:P(this,be,"f").envPrefix=e||"",this}epilogue(e){return de("",[e],arguments.length),P(this,Fe,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,n){return de(" [string]",[e,n],arguments.length),Array.isArray(e)?e.forEach(r=>this.example(...r)):P(this,Fe,"f").example(e,n),this}exit(e,n){he(this,lr,!0,"f"),he(this,As,n,"f"),P(this,Dr,"f")&&P(this,Ie,"f").process.exit(e)}exitProcess(e=!0){return de("[boolean]",[e],arguments.length),he(this,Dr,e,"f"),this}fail(e){if(de("",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new Qt("Invalid first argument. Expected function or boolean 'false'");return P(this,Fe,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,n){return de(" [function]",[e,n],arguments.length),n?P(this,Ir,"f").getCompletion(e,n):new Promise((r,i)=>{P(this,Ir,"f").getCompletion(e,(s,a)=>{s?i(s):r(a)})})}getDemandedOptions(){return de([],0),P(this,be,"f").demandedOptions}getDemandedCommands(){return de([],0),P(this,be,"f").demandedCommands}getDeprecatedOptions(){return de([],0),P(this,be,"f").deprecatedOptions}getDetectLocale(){return P(this,oa,"f")}getExitProcess(){return P(this,Dr,"f")}getGroups(){return Object.assign({},P(this,Pi,"f"),P(this,ua,"f"))}getHelp(){if(he(this,lr,!0,"f"),!P(this,Fe,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[su](P(this,Ss,"f"),void 0,void 0,0,!0);if(Gt(n))return n.then(()=>P(this,Fe,"f").help())}let e=P(this,Ft,"f").runDefaultBuilderOn(this);if(Gt(e))return e.then(()=>P(this,Fe,"f").help())}return Promise.resolve(P(this,Fe,"f").help())}getOptions(){return P(this,be,"f")}getStrict(){return P(this,ca,"f")}getStrictCommands(){return P(this,fa,"f")}getStrictOptions(){return P(this,pa,"f")}global(e,n){return de(" [boolean]",[e,n],arguments.length),e=[].concat(e),n!==!1?P(this,be,"f").local=P(this,be,"f").local.filter(r=>e.indexOf(r)===-1):e.forEach(r=>{P(this,be,"f").local.includes(r)||P(this,be,"f").local.push(r)}),this}group(e,n){de(" ",[e,n],arguments.length);let r=P(this,ua,"f")[n]||P(this,Pi,"f")[n];P(this,ua,"f")[n]&&delete P(this,ua,"f")[n];let i={};return P(this,Pi,"f")[n]=(r||[]).concat(e).filter(s=>!i[s]&&(i[s]=!0)),this}hide(e){return de("",[e],arguments.length),P(this,be,"f").hiddenOptions.push(e),this}implies(e,n){return de(" [number|string|array]",[e,n],arguments.length),P(this,It,"f").implies(e,n),this}locale(e){return de("[string]",[e],arguments.length),e?(he(this,oa,!1,"f"),P(this,Ie,"f").y18n.setLocale(e),this):(this[Em](),P(this,Ie,"f").y18n.getLocale())}middleware(e,n,r){return P(this,xr,"f").addMiddleware(e,!!n,r)}nargs(e,n){return de(" [number]",[e,n],arguments.length),this[Lo](this.nargs.bind(this),"narg",e,n),this}normalize(e){return de("",[e],arguments.length),this[Es]("normalize",e),this}number(e){return de("",[e],arguments.length),this[Es]("number",e),this[ma](e),this}option(e,n){if(de(" [object]",[e,n],arguments.length),typeof e=="object")Object.keys(e).forEach(r=>{this.options(r,e[r])});else{typeof n!="object"&&(n={}),this[ma](e),!P(this,Ai,"f")||e!=="version"&&(n==null?void 0:n.alias)!=="version"||this[EP](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(` -`),void 0,"versionWarning"),P(this,be,"f").key[e]=!0,n.alias&&this.alias(e,n.alias);let r=n.deprecate||n.deprecated;r&&this.deprecateOption(e,r);let i=n.demand||n.required||n.require;i&&this.demand(e,i),n.demandOption&&this.demandOption(e,typeof n.demandOption=="string"?n.demandOption:void 0),n.conflicts&&this.conflicts(e,n.conflicts),"default"in n&&this.default(e,n.default),n.implies!==void 0&&this.implies(e,n.implies),n.nargs!==void 0&&this.nargs(e,n.nargs),n.config&&this.config(e,n.configParser),n.normalize&&this.normalize(e),n.choices&&this.choices(e,n.choices),n.coerce&&this.coerce(e,n.coerce),n.group&&this.group(e,n.group),(n.boolean||n.type==="boolean")&&(this.boolean(e),n.alias&&this.boolean(n.alias)),(n.array||n.type==="array")&&(this.array(e),n.alias&&this.array(n.alias)),(n.number||n.type==="number")&&(this.number(e),n.alias&&this.number(n.alias)),(n.string||n.type==="string")&&(this.string(e),n.alias&&this.string(n.alias)),(n.count||n.type==="count")&&this.count(e),typeof n.global=="boolean"&&this.global(e,n.global),n.defaultDescription&&(P(this,be,"f").defaultDescription[e]=n.defaultDescription),n.skipValidation&&this.skipValidation(e);let s=n.describe||n.description||n.desc;this.describe(e,s),n.hidden&&this.hide(e),n.requiresArg&&this.requiresArg(e)}return this}options(e,n){return this.option(e,n)}parse(e,n,r){de("[string|array] [function|boolean|object] [function]",[e,n,r],arguments.length),this[IP](),e===void 0&&(e=P(this,Ss,"f")),typeof n=="object"&&(he(this,la,n,"f"),n=r),typeof n=="function"&&(he(this,ur,n,"f"),n=!1),n||he(this,Ss,e,"f"),P(this,ur,"f")&&he(this,Dr,!1,"f");let i=this[su](e,!!n),s=this.parsed;return P(this,Ir,"f").setParsed(this.parsed),Gt(i)?i.then(a=>(P(this,ur,"f")&&P(this,ur,"f").call(this,P(this,As,"f"),a,P(this,on,"f")),a)).catch(a=>{throw P(this,ur,"f")&&P(this,ur,"f")(a,this.parsed.argv,P(this,on,"f")),a}).finally(()=>{this[Om](),this.parsed=s}):(P(this,ur,"f")&&P(this,ur,"f").call(this,P(this,As,"f"),i,P(this,on,"f")),this[Om](),this.parsed=s,i)}parseAsync(e,n,r){let i=this.parse(e,n,r);return Gt(i)?i:Promise.resolve(i)}parseSync(e,n,r){let i=this.parse(e,n,r);if(Gt(i))throw new Qt(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return i}parserConfiguration(e){return de("",[e],arguments.length),he(this,Ff,e,"f"),this}pkgConf(e,n){de(" [string]",[e,n],arguments.length);let r=null,i=this[Im](n||P(this,aa,"f"));return i[e]&&typeof i[e]=="object"&&(r=If(i[e],n||P(this,aa,"f"),this[da]()["deep-merge-config"]||!1,P(this,Ie,"f")),P(this,be,"f").configObjects=(P(this,be,"f").configObjects||[]).concat(r)),this}positional(e,n){de(" ",[e,n],arguments.length);let r=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];n=xo(n,(a,o)=>!(a==="type"&&!["string","number","boolean"].includes(o))&&r.includes(a));let i=P(this,iu,"f").fullCommands[P(this,iu,"f").fullCommands.length-1],s=i?P(this,Ft,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return Df(s).forEach(a=>{let o=s[a];Array.isArray(o)?o.indexOf(e)!==-1&&(n[a]=!0):o[e]&&!(a in n)&&(n[a]=o[e])}),this.group(e,P(this,Fe,"f").getPositionalGroupName()),this.option(e,n)}recommendCommands(e=!0){return de("[boolean]",[e],arguments.length),he(this,kf,e,"f"),this}required(e,n,r){return this.demand(e,n,r)}require(e,n,r){return this.demand(e,n,r)}requiresArg(e){return de(" [number]",[e],arguments.length),typeof e=="string"&&P(this,be,"f").narg[e]||this[Lo](this.requiresArg.bind(this),"narg",e,NaN),this}showCompletionScript(e,n){return de("[string] [string]",[e,n],arguments.length),e=e||this.$0,P(this,wo,"f").log(P(this,Ir,"f").generateCompletionScript(e,n||P(this,or,"f")||"completion")),this}showHelp(e){if(de("[string|function]",[e],arguments.length),he(this,lr,!0,"f"),!P(this,Fe,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[su](P(this,Ss,"f"),void 0,void 0,0,!0);if(Gt(r))return r.then(()=>{P(this,Fe,"f").showHelp(e)}),this}let n=P(this,Ft,"f").runDefaultBuilderOn(this);if(Gt(n))return n.then(()=>{P(this,Fe,"f").showHelp(e)}),this}return P(this,Fe,"f").showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,n){return de("[boolean|string] [string]",[e,n],arguments.length),P(this,Fe,"f").showHelpOnFail(e,n),this}showVersion(e){return de("[string|function]",[e],arguments.length),P(this,Fe,"f").showVersion(e),this}skipValidation(e){return de("",[e],arguments.length),this[Es]("skipValidation",e),this}strict(e){return de("[boolean]",[e],arguments.length),he(this,ca,e!==!1,"f"),this}strictCommands(e){return de("[boolean]",[e],arguments.length),he(this,fa,e!==!1,"f"),this}strictOptions(e){return de("[boolean]",[e],arguments.length),he(this,pa,e!==!1,"f"),this}string(e){return de("",[e],arguments.length),this[Es]("string",e),this[ma](e),this}terminalWidth(){return de([],0),P(this,Ie,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return de("",[e],arguments.length),he(this,oa,!1,"f"),P(this,Ie,"f").y18n.updateLocale(e),this}usage(e,n,r,i){if(de(" [string|boolean] [function|object] [function]",[e,n,r,i],arguments.length),n!==void 0){if(li(e,null,P(this,Ie,"f")),(e||"").match(/^\$0( |$)/))return this.command(e,n,r,i);throw new Qt(".usage() description must start with $0 if being used as alias for .command()")}return P(this,Fe,"f").usage(e),this}version(e,n,r){let i="version";if(de("[boolean|string] [string] [string]",[e,n,r],arguments.length),P(this,Ai,"f")&&(this[Sm](P(this,Ai,"f")),P(this,Fe,"f").version(void 0),he(this,Ai,null,"f")),arguments.length===0)r=this[xP](),e=i;else if(arguments.length===1){if(e===!1)return this;r=e,e=i}else arguments.length===2&&(r=n,n=void 0);return he(this,Ai,typeof e=="string"?e:i,"f"),n=n||P(this,Fe,"f").deferY18nLookup("Show version number"),P(this,Fe,"f").version(r||void 0),this.boolean(P(this,Ai,"f")),this.describe(P(this,Ai,"f"),n),this}wrap(e){return de("",[e],arguments.length),P(this,Fe,"f").wrap(e),this}[(Ft=new WeakMap,aa=new WeakMap,iu=new WeakMap,Ir=new WeakMap,or=new WeakMap,Rf=new WeakMap,As=new WeakMap,oa=new WeakMap,wf=new WeakMap,Dr=new WeakMap,Of=new WeakMap,xr=new WeakMap,Pi=new WeakMap,lr=new WeakMap,Rr=new WeakMap,wo=new WeakMap,on=new WeakMap,be=new WeakMap,Lf=new WeakMap,Ff=new WeakMap,ur=new WeakMap,la=new WeakMap,Oo=new WeakMap,ua=new WeakMap,Ss=new WeakMap,kf=new WeakMap,Ie=new WeakMap,ca=new WeakMap,fa=new WeakMap,pa=new WeakMap,Fe=new WeakMap,Ai=new WeakMap,It=new WeakMap,AP)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[SP](){return{log:(...e)=>{this[Mf]()||console.log(...e),he(this,lr,!0,"f"),P(this,on,"f").length&&he(this,on,P(this,on,"f")+` +`,i=this.shim.path.basename(e);return e.match(/\.js$/)&&(e=`./${e}`),r=r.replace(/{{app_name}}/g,i),r=r.replace(/{{completion_command}}/g,n),r.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}};function Fk(t,e){if(t.length===0)return e.length;if(e.length===0)return t.length;let n=[],r,i;for(r=0;r<=e.length;r++)n[r]=[r];for(i=0;i<=t.length;i++)n[0][i]=i;for(r=1;r<=e.length;r++)for(i=1;i<=t.length;i++)e.charAt(r-1)===t.charAt(i-1)?n[r][i]=n[r-1][i-1]:r>1&&i>1&&e.charAt(r-2)===t.charAt(i-1)&&e.charAt(r-1)===t.charAt(i-2)?n[r][i]=n[r-2][i-2]+1:n[r][i]=Math.min(n[r-1][i-1]+1,Math.min(n[r][i-1]+1,n[r-1][i]+1));return n[e.length][t.length]}var SP=["$0","--","_"],Ft,aa,iu,Ir,or,Rf,Ss,oa,wf,Dr,Of,xr,Pi,lr,Rr,wo,on,be,Lf,Ff,ur,la,Oo,ua,As,kf,Ie,ca,fa,pa,Fe,Si,It,AP=Symbol("copyDoubleDash"),EP=Symbol("copyDoubleDash"),Am=Symbol("deleteFromParserHintObject"),IP=Symbol("emitWarning"),DP=Symbol("freeze"),xP=Symbol("getDollarZero"),da=Symbol("getParserConfiguration"),Em=Symbol("guessLocale"),RP=Symbol("guessVersion"),wP=Symbol("parsePositionalNumbers"),Im=Symbol("pkgUp"),Es=Symbol("populateParserHintArray"),Lo=Symbol("populateParserHintSingleValueDictionary"),Dm=Symbol("populateParserHintArrayDictionary"),xm=Symbol("populateParserHintDictionary"),Rm=Symbol("sanitizeKey"),wm=Symbol("setKey"),Om=Symbol("unfreeze"),OP=Symbol("validateAsync"),LP=Symbol("getCommandInstance"),FP=Symbol("getContext"),kP=Symbol("getHasOutput"),MP=Symbol("getLoggerInstance"),BP=Symbol("getParseContext"),qP=Symbol("getUsageInstance"),VP=Symbol("getValidationInstance"),Mf=Symbol("hasParseCallback"),ha=Symbol("postProcess"),jP=Symbol("rebase"),Lm=Symbol("reset"),su=Symbol("runYargsParserAndExecuteCommands"),Fm=Symbol("runValidation"),UP=Symbol("setHasOutput"),ma=Symbol("kTrackManuallySetKeys"),WP=class{constructor(e=[],n,r,i){this.customScriptName=!1,this.parsed=!1,Ft.set(this,void 0),aa.set(this,void 0),iu.set(this,{commands:[],fullCommands:[]}),Ir.set(this,null),or.set(this,null),Rf.set(this,"show-hidden"),Ss.set(this,null),oa.set(this,!0),wf.set(this,{}),Dr.set(this,!0),Of.set(this,[]),xr.set(this,void 0),Pi.set(this,{}),lr.set(this,!1),Rr.set(this,null),wo.set(this,void 0),on.set(this,""),be.set(this,void 0),Lf.set(this,void 0),Ff.set(this,{}),ur.set(this,null),la.set(this,null),Oo.set(this,{}),ua.set(this,{}),As.set(this,void 0),kf.set(this,!1),Ie.set(this,void 0),ca.set(this,!1),fa.set(this,!1),pa.set(this,!1),Fe.set(this,void 0),Si.set(this,null),It.set(this,void 0),he(this,Ie,i,"f"),he(this,As,e,"f"),he(this,aa,n,"f"),he(this,Lf,r,"f"),he(this,xr,new TP(this),"f"),this.$0=this[xP](),this[Lm](),he(this,Ft,P(this,Ft,"f"),"f"),he(this,Fe,P(this,Fe,"f"),"f"),he(this,It,P(this,It,"f"),"f"),he(this,be,P(this,be,"f"),"f"),P(this,be,"f").showHiddenOpt=P(this,Rf,"f"),he(this,wo,this[EP](),"f")}addHelpOpt(e,n){return de("[string|boolean] [string]",[e,n],arguments.length),P(this,Rr,"f")&&(this[Am](P(this,Rr,"f")),he(this,Rr,null,"f")),e===!1&&n===void 0||(he(this,Rr,typeof e=="string"?e:"help","f"),this.boolean(P(this,Rr,"f")),this.describe(P(this,Rr,"f"),n||P(this,Fe,"f").deferY18nLookup("Show help"))),this}help(e,n){return this.addHelpOpt(e,n)}addShowHiddenOpt(e,n){if(de("[string|boolean] [string]",[e,n],arguments.length),e===!1&&n===void 0)return this;let r=typeof e=="string"?e:P(this,Rf,"f");return this.boolean(r),this.describe(r,n||P(this,Fe,"f").deferY18nLookup("Show hidden options")),P(this,be,"f").showHiddenOpt=r,this}showHidden(e,n){return this.addShowHiddenOpt(e,n)}alias(e,n){return de(" [string|array]",[e,n],arguments.length),this[Dm](this.alias.bind(this),"alias",e,n),this}array(e){return de("",[e],arguments.length),this[Es]("array",e),this[ma](e),this}boolean(e){return de("",[e],arguments.length),this[Es]("boolean",e),this[ma](e),this}check(e,n){return de(" [boolean]",[e,n],arguments.length),this.middleware((r,i)=>nu(()=>e(r,i.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&P(this,Fe,"f").fail(s.toString(),s):P(this,Fe,"f").fail(P(this,Ie,"f").y18n.__("Argument check failed: %s",e.toString())),r),s=>(P(this,Fe,"f").fail(s.message?s.message:s.toString(),s),r)),!1,n),this}choices(e,n){return de(" [string|array]",[e,n],arguments.length),this[Dm](this.choices.bind(this),"choices",e,n),this}coerce(e,n){if(de(" [function]",[e,n],arguments.length),Array.isArray(e)){if(!n)throw new Qt("coerce callback must be provided");for(let r of e)this.coerce(r,n);return this}if(typeof e=="object"){for(let r of Object.keys(e))this.coerce(r,e[r]);return this}if(!n)throw new Qt("coerce callback must be provided");return P(this,be,"f").key[e]=!0,P(this,xr,"f").addCoerceMiddleware((r,i)=>{let s;return nu(()=>(s=i.getAliases(),n(r[e])),a=>{if(r[e]=a,s[e])for(let o of s[e])r[o]=a;return r},a=>{throw new Qt(a.message)})},e),this}conflicts(e,n){return de(" [string|array]",[e,n],arguments.length),P(this,It,"f").conflicts(e,n),this}config(e="config",n,r){return de("[object|string] [string|function] [function]",[e,n,r],arguments.length),typeof e!="object"||Array.isArray(e)?(typeof n=="function"&&(r=n,n=void 0),this.describe(e,n||P(this,Fe,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(i=>{P(this,be,"f").config[i]=r||!0}),this):(e=If(e,P(this,aa,"f"),this[da]()["deep-merge-config"]||!1,P(this,Ie,"f")),P(this,be,"f").configObjects=(P(this,be,"f").configObjects||[]).concat(e),this)}completion(e,n,r){return de("[string] [string|boolean|function] [function]",[e,n,r],arguments.length),typeof n=="function"&&(r=n,n=void 0),he(this,or,e||P(this,or,"f")||"completion","f"),n||n===!1||(n="generate completion script"),this.command(P(this,or,"f"),n),r&&P(this,Ir,"f").registerFunction(r),this}command(e,n,r,i,s,a){return de(" [string|boolean] [function|object] [function] [array] [boolean|string]",[e,n,r,i,s,a],arguments.length),P(this,Ft,"f").addHandler(e,n,r,i,s,a),this}commands(e,n,r,i,s,a){return this.command(e,n,r,i,s,a)}commandDir(e,n){de(" [object]",[e,n],arguments.length);let r=P(this,Lf,"f")||P(this,Ie,"f").require;return P(this,Ft,"f").addDirectory(e,r,P(this,Ie,"f").getCallerFile(),n),this}count(e){return de("",[e],arguments.length),this[Es]("count",e),this[ma](e),this}default(e,n,r){return de(" [*] [string]",[e,n,r],arguments.length),r&&(_P(e,P(this,Ie,"f")),P(this,be,"f").defaultDescription[e]=r),typeof n=="function"&&(_P(e,P(this,Ie,"f")),P(this,be,"f").defaultDescription[e]||(P(this,be,"f").defaultDescription[e]=P(this,Fe,"f").functionDescription(n)),n=n.call()),this[Lo](this.default.bind(this),"default",e,n),this}defaults(e,n,r){return this.default(e,n,r)}demandCommand(e=1,n,r,i){return de("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,n,r,i],arguments.length),typeof n!="number"&&(r=n,n=1/0),this.global("_",!1),P(this,be,"f").demandedCommands._={min:e,max:n,minMsg:r,maxMsg:i},this}demand(e,n,r){return Array.isArray(n)?(n.forEach(i=>{li(r,!0,P(this,Ie,"f")),this.demandOption(i,r)}),n=1/0):typeof n!="number"&&(r=n,n=1/0),typeof e=="number"?(li(r,!0,P(this,Ie,"f")),this.demandCommand(e,n,r,r)):Array.isArray(e)?e.forEach(i=>{li(r,!0,P(this,Ie,"f")),this.demandOption(i,r)}):typeof r=="string"?this.demandOption(e,r):r!==!0&&r!==void 0||this.demandOption(e),this}demandOption(e,n){return de(" [string]",[e,n],arguments.length),this[Lo](this.demandOption.bind(this),"demandedOptions",e,n),this}deprecateOption(e,n){return de(" [string|boolean]",[e,n],arguments.length),P(this,be,"f").deprecatedOptions[e]=n,this}describe(e,n){return de(" [string]",[e,n],arguments.length),this[wm](e,!0),P(this,Fe,"f").describe(e,n),this}detectLocale(e){return de("",[e],arguments.length),he(this,oa,e,"f"),this}env(e){return de("[string|boolean]",[e],arguments.length),e===!1?delete P(this,be,"f").envPrefix:P(this,be,"f").envPrefix=e||"",this}epilogue(e){return de("",[e],arguments.length),P(this,Fe,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,n){return de(" [string]",[e,n],arguments.length),Array.isArray(e)?e.forEach(r=>this.example(...r)):P(this,Fe,"f").example(e,n),this}exit(e,n){he(this,lr,!0,"f"),he(this,Ss,n,"f"),P(this,Dr,"f")&&P(this,Ie,"f").process.exit(e)}exitProcess(e=!0){return de("[boolean]",[e],arguments.length),he(this,Dr,e,"f"),this}fail(e){if(de("",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new Qt("Invalid first argument. Expected function or boolean 'false'");return P(this,Fe,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,n){return de(" [function]",[e,n],arguments.length),n?P(this,Ir,"f").getCompletion(e,n):new Promise((r,i)=>{P(this,Ir,"f").getCompletion(e,(s,a)=>{s?i(s):r(a)})})}getDemandedOptions(){return de([],0),P(this,be,"f").demandedOptions}getDemandedCommands(){return de([],0),P(this,be,"f").demandedCommands}getDeprecatedOptions(){return de([],0),P(this,be,"f").deprecatedOptions}getDetectLocale(){return P(this,oa,"f")}getExitProcess(){return P(this,Dr,"f")}getGroups(){return Object.assign({},P(this,Pi,"f"),P(this,ua,"f"))}getHelp(){if(he(this,lr,!0,"f"),!P(this,Fe,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[su](P(this,As,"f"),void 0,void 0,0,!0);if(Gt(n))return n.then(()=>P(this,Fe,"f").help())}let e=P(this,Ft,"f").runDefaultBuilderOn(this);if(Gt(e))return e.then(()=>P(this,Fe,"f").help())}return Promise.resolve(P(this,Fe,"f").help())}getOptions(){return P(this,be,"f")}getStrict(){return P(this,ca,"f")}getStrictCommands(){return P(this,fa,"f")}getStrictOptions(){return P(this,pa,"f")}global(e,n){return de(" [boolean]",[e,n],arguments.length),e=[].concat(e),n!==!1?P(this,be,"f").local=P(this,be,"f").local.filter(r=>e.indexOf(r)===-1):e.forEach(r=>{P(this,be,"f").local.includes(r)||P(this,be,"f").local.push(r)}),this}group(e,n){de(" ",[e,n],arguments.length);let r=P(this,ua,"f")[n]||P(this,Pi,"f")[n];P(this,ua,"f")[n]&&delete P(this,ua,"f")[n];let i={};return P(this,Pi,"f")[n]=(r||[]).concat(e).filter(s=>!i[s]&&(i[s]=!0)),this}hide(e){return de("",[e],arguments.length),P(this,be,"f").hiddenOptions.push(e),this}implies(e,n){return de(" [number|string|array]",[e,n],arguments.length),P(this,It,"f").implies(e,n),this}locale(e){return de("[string]",[e],arguments.length),e?(he(this,oa,!1,"f"),P(this,Ie,"f").y18n.setLocale(e),this):(this[Em](),P(this,Ie,"f").y18n.getLocale())}middleware(e,n,r){return P(this,xr,"f").addMiddleware(e,!!n,r)}nargs(e,n){return de(" [number]",[e,n],arguments.length),this[Lo](this.nargs.bind(this),"narg",e,n),this}normalize(e){return de("",[e],arguments.length),this[Es]("normalize",e),this}number(e){return de("",[e],arguments.length),this[Es]("number",e),this[ma](e),this}option(e,n){if(de(" [object]",[e,n],arguments.length),typeof e=="object")Object.keys(e).forEach(r=>{this.options(r,e[r])});else{typeof n!="object"&&(n={}),this[ma](e),!P(this,Si,"f")||e!=="version"&&(n==null?void 0:n.alias)!=="version"||this[IP](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(` +`),void 0,"versionWarning"),P(this,be,"f").key[e]=!0,n.alias&&this.alias(e,n.alias);let r=n.deprecate||n.deprecated;r&&this.deprecateOption(e,r);let i=n.demand||n.required||n.require;i&&this.demand(e,i),n.demandOption&&this.demandOption(e,typeof n.demandOption=="string"?n.demandOption:void 0),n.conflicts&&this.conflicts(e,n.conflicts),"default"in n&&this.default(e,n.default),n.implies!==void 0&&this.implies(e,n.implies),n.nargs!==void 0&&this.nargs(e,n.nargs),n.config&&this.config(e,n.configParser),n.normalize&&this.normalize(e),n.choices&&this.choices(e,n.choices),n.coerce&&this.coerce(e,n.coerce),n.group&&this.group(e,n.group),(n.boolean||n.type==="boolean")&&(this.boolean(e),n.alias&&this.boolean(n.alias)),(n.array||n.type==="array")&&(this.array(e),n.alias&&this.array(n.alias)),(n.number||n.type==="number")&&(this.number(e),n.alias&&this.number(n.alias)),(n.string||n.type==="string")&&(this.string(e),n.alias&&this.string(n.alias)),(n.count||n.type==="count")&&this.count(e),typeof n.global=="boolean"&&this.global(e,n.global),n.defaultDescription&&(P(this,be,"f").defaultDescription[e]=n.defaultDescription),n.skipValidation&&this.skipValidation(e);let s=n.describe||n.description||n.desc;this.describe(e,s),n.hidden&&this.hide(e),n.requiresArg&&this.requiresArg(e)}return this}options(e,n){return this.option(e,n)}parse(e,n,r){de("[string|array] [function|boolean|object] [function]",[e,n,r],arguments.length),this[DP](),e===void 0&&(e=P(this,As,"f")),typeof n=="object"&&(he(this,la,n,"f"),n=r),typeof n=="function"&&(he(this,ur,n,"f"),n=!1),n||he(this,As,e,"f"),P(this,ur,"f")&&he(this,Dr,!1,"f");let i=this[su](e,!!n),s=this.parsed;return P(this,Ir,"f").setParsed(this.parsed),Gt(i)?i.then(a=>(P(this,ur,"f")&&P(this,ur,"f").call(this,P(this,Ss,"f"),a,P(this,on,"f")),a)).catch(a=>{throw P(this,ur,"f")&&P(this,ur,"f")(a,this.parsed.argv,P(this,on,"f")),a}).finally(()=>{this[Om](),this.parsed=s}):(P(this,ur,"f")&&P(this,ur,"f").call(this,P(this,Ss,"f"),i,P(this,on,"f")),this[Om](),this.parsed=s,i)}parseAsync(e,n,r){let i=this.parse(e,n,r);return Gt(i)?i:Promise.resolve(i)}parseSync(e,n,r){let i=this.parse(e,n,r);if(Gt(i))throw new Qt(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return i}parserConfiguration(e){return de("",[e],arguments.length),he(this,Ff,e,"f"),this}pkgConf(e,n){de(" [string]",[e,n],arguments.length);let r=null,i=this[Im](n||P(this,aa,"f"));return i[e]&&typeof i[e]=="object"&&(r=If(i[e],n||P(this,aa,"f"),this[da]()["deep-merge-config"]||!1,P(this,Ie,"f")),P(this,be,"f").configObjects=(P(this,be,"f").configObjects||[]).concat(r)),this}positional(e,n){de(" ",[e,n],arguments.length);let r=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];n=xo(n,(a,o)=>!(a==="type"&&!["string","number","boolean"].includes(o))&&r.includes(a));let i=P(this,iu,"f").fullCommands[P(this,iu,"f").fullCommands.length-1],s=i?P(this,Ft,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return Df(s).forEach(a=>{let o=s[a];Array.isArray(o)?o.indexOf(e)!==-1&&(n[a]=!0):o[e]&&!(a in n)&&(n[a]=o[e])}),this.group(e,P(this,Fe,"f").getPositionalGroupName()),this.option(e,n)}recommendCommands(e=!0){return de("[boolean]",[e],arguments.length),he(this,kf,e,"f"),this}required(e,n,r){return this.demand(e,n,r)}require(e,n,r){return this.demand(e,n,r)}requiresArg(e){return de(" [number]",[e],arguments.length),typeof e=="string"&&P(this,be,"f").narg[e]||this[Lo](this.requiresArg.bind(this),"narg",e,NaN),this}showCompletionScript(e,n){return de("[string] [string]",[e,n],arguments.length),e=e||this.$0,P(this,wo,"f").log(P(this,Ir,"f").generateCompletionScript(e,n||P(this,or,"f")||"completion")),this}showHelp(e){if(de("[string|function]",[e],arguments.length),he(this,lr,!0,"f"),!P(this,Fe,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[su](P(this,As,"f"),void 0,void 0,0,!0);if(Gt(r))return r.then(()=>{P(this,Fe,"f").showHelp(e)}),this}let n=P(this,Ft,"f").runDefaultBuilderOn(this);if(Gt(n))return n.then(()=>{P(this,Fe,"f").showHelp(e)}),this}return P(this,Fe,"f").showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,n){return de("[boolean|string] [string]",[e,n],arguments.length),P(this,Fe,"f").showHelpOnFail(e,n),this}showVersion(e){return de("[string|function]",[e],arguments.length),P(this,Fe,"f").showVersion(e),this}skipValidation(e){return de("",[e],arguments.length),this[Es]("skipValidation",e),this}strict(e){return de("[boolean]",[e],arguments.length),he(this,ca,e!==!1,"f"),this}strictCommands(e){return de("[boolean]",[e],arguments.length),he(this,fa,e!==!1,"f"),this}strictOptions(e){return de("[boolean]",[e],arguments.length),he(this,pa,e!==!1,"f"),this}string(e){return de("",[e],arguments.length),this[Es]("string",e),this[ma](e),this}terminalWidth(){return de([],0),P(this,Ie,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return de("",[e],arguments.length),he(this,oa,!1,"f"),P(this,Ie,"f").y18n.updateLocale(e),this}usage(e,n,r,i){if(de(" [string|boolean] [function|object] [function]",[e,n,r,i],arguments.length),n!==void 0){if(li(e,null,P(this,Ie,"f")),(e||"").match(/^\$0( |$)/))return this.command(e,n,r,i);throw new Qt(".usage() description must start with $0 if being used as alias for .command()")}return P(this,Fe,"f").usage(e),this}version(e,n,r){let i="version";if(de("[boolean|string] [string] [string]",[e,n,r],arguments.length),P(this,Si,"f")&&(this[Am](P(this,Si,"f")),P(this,Fe,"f").version(void 0),he(this,Si,null,"f")),arguments.length===0)r=this[RP](),e=i;else if(arguments.length===1){if(e===!1)return this;r=e,e=i}else arguments.length===2&&(r=n,n=void 0);return he(this,Si,typeof e=="string"?e:i,"f"),n=n||P(this,Fe,"f").deferY18nLookup("Show version number"),P(this,Fe,"f").version(r||void 0),this.boolean(P(this,Si,"f")),this.describe(P(this,Si,"f"),n),this}wrap(e){return de("",[e],arguments.length),P(this,Fe,"f").wrap(e),this}[(Ft=new WeakMap,aa=new WeakMap,iu=new WeakMap,Ir=new WeakMap,or=new WeakMap,Rf=new WeakMap,Ss=new WeakMap,oa=new WeakMap,wf=new WeakMap,Dr=new WeakMap,Of=new WeakMap,xr=new WeakMap,Pi=new WeakMap,lr=new WeakMap,Rr=new WeakMap,wo=new WeakMap,on=new WeakMap,be=new WeakMap,Lf=new WeakMap,Ff=new WeakMap,ur=new WeakMap,la=new WeakMap,Oo=new WeakMap,ua=new WeakMap,As=new WeakMap,kf=new WeakMap,Ie=new WeakMap,ca=new WeakMap,fa=new WeakMap,pa=new WeakMap,Fe=new WeakMap,Si=new WeakMap,It=new WeakMap,AP)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[EP](){return{log:(...e)=>{this[Mf]()||console.log(...e),he(this,lr,!0,"f"),P(this,on,"f").length&&he(this,on,P(this,on,"f")+` `,"f"),he(this,on,P(this,on,"f")+e.join(" "),"f")},error:(...e)=>{this[Mf]()||console.error(...e),he(this,lr,!0,"f"),P(this,on,"f").length&&he(this,on,P(this,on,"f")+` -`,"f"),he(this,on,P(this,on,"f")+e.join(" "),"f")}}}[Sm](e){Df(P(this,be,"f")).forEach(n=>{if(n==="configObjects")return;let r=P(this,be,"f")[n];Array.isArray(r)?r.includes(e)&&r.splice(r.indexOf(e),1):typeof r=="object"&&delete r[e]}),delete P(this,Fe,"f").getDescriptions()[e]}[EP](e,n,r){P(this,wf,"f")[r]||(P(this,Ie,"f").process.emitWarning(e,n),P(this,wf,"f")[r]=!0)}[IP](){P(this,Of,"f").push({options:P(this,be,"f"),configObjects:P(this,be,"f").configObjects.slice(0),exitProcess:P(this,Dr,"f"),groups:P(this,Pi,"f"),strict:P(this,ca,"f"),strictCommands:P(this,fa,"f"),strictOptions:P(this,pa,"f"),completionCommand:P(this,or,"f"),output:P(this,on,"f"),exitError:P(this,As,"f"),hasOutput:P(this,lr,"f"),parsed:this.parsed,parseFn:P(this,ur,"f"),parseContext:P(this,la,"f")}),P(this,Fe,"f").freeze(),P(this,It,"f").freeze(),P(this,Ft,"f").freeze(),P(this,xr,"f").freeze()}[DP](){let e,n="";return e=/\b(node|iojs|electron)(\.exe)?$/.test(P(this,Ie,"f").process.argv()[0])?P(this,Ie,"f").process.argv().slice(1,2):P(this,Ie,"f").process.argv().slice(0,1),n=e.map(r=>{let i=this[VP](P(this,aa,"f"),r);return r.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.lengtho.includes("package.json")?"package.json":void 0);li(s,void 0,P(this,Ie,"f")),r=JSON.parse(P(this,Ie,"f").readFileSync(s,"utf8"))}catch{}return P(this,Oo,"f")[n]=r||{},P(this,Oo,"f")[n]}[Es](e,n){(n=[].concat(n)).forEach(r=>{r=this[Rm](r),P(this,be,"f")[e].push(r)})}[Lo](e,n,r,i){this[xm](e,n,r,i,(s,a,o)=>{P(this,be,"f")[s][a]=o})}[Dm](e,n,r,i){this[xm](e,n,r,i,(s,a,o)=>{P(this,be,"f")[s][a]=(P(this,be,"f")[s][a]||[]).concat(o)})}[xm](e,n,r,i,s){if(Array.isArray(r))r.forEach(a=>{e(a,i)});else if((a=>typeof a=="object")(r))for(let a of Df(r))e(a,r[a]);else s(n,this[Rm](r),i)}[Rm](e){return e==="__proto__"?"___proto___":e}[wm](e,n){return this[Lo](this[wm].bind(this),"key",e,n),this}[Om](){var e,n,r,i,s,a,o,l,u,c,f,h;let y=P(this,Of,"f").pop(),p;li(y,void 0,P(this,Ie,"f")),e=this,n=this,r=this,i=this,s=this,a=this,o=this,l=this,u=this,c=this,f=this,h=this,{options:{set value(d){he(e,be,d,"f")}}.value,configObjects:p,exitProcess:{set value(d){he(n,Dr,d,"f")}}.value,groups:{set value(d){he(r,Pi,d,"f")}}.value,output:{set value(d){he(i,on,d,"f")}}.value,exitError:{set value(d){he(s,As,d,"f")}}.value,hasOutput:{set value(d){he(a,lr,d,"f")}}.value,parsed:this.parsed,strict:{set value(d){he(o,ca,d,"f")}}.value,strictCommands:{set value(d){he(l,fa,d,"f")}}.value,strictOptions:{set value(d){he(u,pa,d,"f")}}.value,completionCommand:{set value(d){he(c,or,d,"f")}}.value,parseFn:{set value(d){he(f,ur,d,"f")}}.value,parseContext:{set value(d){he(h,la,d,"f")}}.value}=y,P(this,be,"f").configObjects=p,P(this,Fe,"f").unfreeze(),P(this,It,"f").unfreeze(),P(this,Ft,"f").unfreeze(),P(this,xr,"f").unfreeze()}[wP](e,n){return nu(n,r=>(e(r),r))}getInternalMethods(){return{getCommandInstance:this[OP].bind(this),getContext:this[LP].bind(this),getHasOutput:this[FP].bind(this),getLoggerInstance:this[kP].bind(this),getParseContext:this[MP].bind(this),getParserConfiguration:this[da].bind(this),getUsageInstance:this[BP].bind(this),getValidationInstance:this[qP].bind(this),hasParseCallback:this[Mf].bind(this),postProcess:this[ha].bind(this),reset:this[Lm].bind(this),runValidation:this[Fm].bind(this),runYargsParserAndExecuteCommands:this[su].bind(this),setHasOutput:this[jP].bind(this)}}[OP](){return P(this,Ft,"f")}[LP](){return P(this,iu,"f")}[FP](){return P(this,lr,"f")}[kP](){return P(this,wo,"f")}[MP](){return P(this,la,"f")||{}}[BP](){return P(this,Fe,"f")}[qP](){return P(this,It,"f")}[Mf](){return!!P(this,ur,"f")}[ha](e,n,r,i){return r||Gt(e)?e:(n||(e=this[AP](e)),(this[da]()["parse-positional-numbers"]||this[da]()["parse-positional-numbers"]===void 0)&&(e=this[RP](e)),i&&(e=tu(e,this,P(this,xr,"f").getMiddleware(),!1)),e)}[Lm](e={}){he(this,be,P(this,be,"f")||{},"f");let n={};n.local=P(this,be,"f").local||[],n.configObjects=P(this,be,"f").configObjects||[];let r={};return n.local.forEach(i=>{r[i]=!0,(e[i]||[]).forEach(s=>{r[s]=!0})}),Object.assign(P(this,ua,"f"),Object.keys(P(this,Pi,"f")).reduce((i,s)=>{let a=P(this,Pi,"f")[s].filter(o=>!(o in r));return a.length>0&&(i[s]=a),i},{})),he(this,Pi,{},"f"),["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"].forEach(i=>{n[i]=(P(this,be,"f")[i]||[]).filter(s=>!r[s])}),["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"].forEach(i=>{n[i]=xo(P(this,be,"f")[i],s=>!r[s])}),n.envPrefix=P(this,be,"f").envPrefix,he(this,be,n,"f"),he(this,Fe,P(this,Fe,"f")?P(this,Fe,"f").reset(r):wk(this,P(this,Ie,"f")),"f"),he(this,It,P(this,It,"f")?P(this,It,"f").reset(r):function(i,s,a){let o=a.y18n.__,l=a.y18n.__n,u={nonOptionCount:function(p){let d=i.getDemandedCommands(),g=p._.length+(p["--"]?p["--"].length:0)-i.getInternalMethods().getContext().commands.length;d._&&(gd._.max)&&(gd._.max&&(d._.maxMsg!==void 0?s.fail(d._.maxMsg?d._.maxMsg.replace(/\$0/g,g.toString()).replace(/\$1/,d._.max.toString()):null):s.fail(l("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",g,g.toString(),d._.max.toString()))))},positionalCount:function(p,d){d{if(n==="configObjects")return;let r=P(this,be,"f")[n];Array.isArray(r)?r.includes(e)&&r.splice(r.indexOf(e),1):typeof r=="object"&&delete r[e]}),delete P(this,Fe,"f").getDescriptions()[e]}[IP](e,n,r){P(this,wf,"f")[r]||(P(this,Ie,"f").process.emitWarning(e,n),P(this,wf,"f")[r]=!0)}[DP](){P(this,Of,"f").push({options:P(this,be,"f"),configObjects:P(this,be,"f").configObjects.slice(0),exitProcess:P(this,Dr,"f"),groups:P(this,Pi,"f"),strict:P(this,ca,"f"),strictCommands:P(this,fa,"f"),strictOptions:P(this,pa,"f"),completionCommand:P(this,or,"f"),output:P(this,on,"f"),exitError:P(this,Ss,"f"),hasOutput:P(this,lr,"f"),parsed:this.parsed,parseFn:P(this,ur,"f"),parseContext:P(this,la,"f")}),P(this,Fe,"f").freeze(),P(this,It,"f").freeze(),P(this,Ft,"f").freeze(),P(this,xr,"f").freeze()}[xP](){let e,n="";return e=/\b(node|iojs|electron)(\.exe)?$/.test(P(this,Ie,"f").process.argv()[0])?P(this,Ie,"f").process.argv().slice(1,2):P(this,Ie,"f").process.argv().slice(0,1),n=e.map(r=>{let i=this[jP](P(this,aa,"f"),r);return r.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.lengtho.includes("package.json")?"package.json":void 0);li(s,void 0,P(this,Ie,"f")),r=JSON.parse(P(this,Ie,"f").readFileSync(s,"utf8"))}catch{}return P(this,Oo,"f")[n]=r||{},P(this,Oo,"f")[n]}[Es](e,n){(n=[].concat(n)).forEach(r=>{r=this[Rm](r),P(this,be,"f")[e].push(r)})}[Lo](e,n,r,i){this[xm](e,n,r,i,(s,a,o)=>{P(this,be,"f")[s][a]=o})}[Dm](e,n,r,i){this[xm](e,n,r,i,(s,a,o)=>{P(this,be,"f")[s][a]=(P(this,be,"f")[s][a]||[]).concat(o)})}[xm](e,n,r,i,s){if(Array.isArray(r))r.forEach(a=>{e(a,i)});else if((a=>typeof a=="object")(r))for(let a of Df(r))e(a,r[a]);else s(n,this[Rm](r),i)}[Rm](e){return e==="__proto__"?"___proto___":e}[wm](e,n){return this[Lo](this[wm].bind(this),"key",e,n),this}[Om](){var e,n,r,i,s,a,o,l,u,c,f,h;let y=P(this,Of,"f").pop(),p;li(y,void 0,P(this,Ie,"f")),e=this,n=this,r=this,i=this,s=this,a=this,o=this,l=this,u=this,c=this,f=this,h=this,{options:{set value(d){he(e,be,d,"f")}}.value,configObjects:p,exitProcess:{set value(d){he(n,Dr,d,"f")}}.value,groups:{set value(d){he(r,Pi,d,"f")}}.value,output:{set value(d){he(i,on,d,"f")}}.value,exitError:{set value(d){he(s,Ss,d,"f")}}.value,hasOutput:{set value(d){he(a,lr,d,"f")}}.value,parsed:this.parsed,strict:{set value(d){he(o,ca,d,"f")}}.value,strictCommands:{set value(d){he(l,fa,d,"f")}}.value,strictOptions:{set value(d){he(u,pa,d,"f")}}.value,completionCommand:{set value(d){he(c,or,d,"f")}}.value,parseFn:{set value(d){he(f,ur,d,"f")}}.value,parseContext:{set value(d){he(h,la,d,"f")}}.value}=y,P(this,be,"f").configObjects=p,P(this,Fe,"f").unfreeze(),P(this,It,"f").unfreeze(),P(this,Ft,"f").unfreeze(),P(this,xr,"f").unfreeze()}[OP](e,n){return nu(n,r=>(e(r),r))}getInternalMethods(){return{getCommandInstance:this[LP].bind(this),getContext:this[FP].bind(this),getHasOutput:this[kP].bind(this),getLoggerInstance:this[MP].bind(this),getParseContext:this[BP].bind(this),getParserConfiguration:this[da].bind(this),getUsageInstance:this[qP].bind(this),getValidationInstance:this[VP].bind(this),hasParseCallback:this[Mf].bind(this),postProcess:this[ha].bind(this),reset:this[Lm].bind(this),runValidation:this[Fm].bind(this),runYargsParserAndExecuteCommands:this[su].bind(this),setHasOutput:this[UP].bind(this)}}[LP](){return P(this,Ft,"f")}[FP](){return P(this,iu,"f")}[kP](){return P(this,lr,"f")}[MP](){return P(this,wo,"f")}[BP](){return P(this,la,"f")||{}}[qP](){return P(this,Fe,"f")}[VP](){return P(this,It,"f")}[Mf](){return!!P(this,ur,"f")}[ha](e,n,r,i){return r||Gt(e)?e:(n||(e=this[AP](e)),(this[da]()["parse-positional-numbers"]||this[da]()["parse-positional-numbers"]===void 0)&&(e=this[wP](e)),i&&(e=tu(e,this,P(this,xr,"f").getMiddleware(),!1)),e)}[Lm](e={}){he(this,be,P(this,be,"f")||{},"f");let n={};n.local=P(this,be,"f").local||[],n.configObjects=P(this,be,"f").configObjects||[];let r={};return n.local.forEach(i=>{r[i]=!0,(e[i]||[]).forEach(s=>{r[s]=!0})}),Object.assign(P(this,ua,"f"),Object.keys(P(this,Pi,"f")).reduce((i,s)=>{let a=P(this,Pi,"f")[s].filter(o=>!(o in r));return a.length>0&&(i[s]=a),i},{})),he(this,Pi,{},"f"),["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"].forEach(i=>{n[i]=(P(this,be,"f")[i]||[]).filter(s=>!r[s])}),["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"].forEach(i=>{n[i]=xo(P(this,be,"f")[i],s=>!r[s])}),n.envPrefix=P(this,be,"f").envPrefix,he(this,be,n,"f"),he(this,Fe,P(this,Fe,"f")?P(this,Fe,"f").reset(r):Lk(this,P(this,Ie,"f")),"f"),he(this,It,P(this,It,"f")?P(this,It,"f").reset(r):function(i,s,a){let o=a.y18n.__,l=a.y18n.__n,u={nonOptionCount:function(p){let d=i.getDemandedCommands(),g=p._.length+(p["--"]?p["--"].length:0)-i.getInternalMethods().getContext().commands.length;d._&&(gd._.max)&&(gd._.max&&(d._.maxMsg!==void 0?s.fail(d._.maxMsg?d._.maxMsg.replace(/\$0/g,g.toString()).replace(/\$1/,d._.max.toString()):null):s.fail(l("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",g,g.toString(),d._.max.toString()))))},positionalCount:function(p,d){d{PP.includes(L)||Object.prototype.hasOwnProperty.call(g,L)||Object.prototype.hasOwnProperty.call(i.getInternalMethods().getParseContext(),L)||u.isValidAndSomeAliasIsNotNew(L,d)||C.push(L)}),b&&(G.commands.length>0||N.length>0||m)&&p._.slice(G.commands.length).forEach(L=>{N.includes(""+L)||C.push(""+L)}),b){let L=((_=i.getDemandedCommands()._)===null||_===void 0?void 0:_.max)||0,M=G.commands.length+L;M{$=String($),G.commands.includes($)||C.includes($)||C.push($)})}C.length&&s.fail(l("Unknown argument: %s","Unknown arguments: %s",C.length,C.join(", ")))},unknownCommands:function(p){let d=i.getInternalMethods().getCommandInstance().getCommands(),g=[],m=i.getInternalMethods().getContext();return(m.commands.length>0||d.length>0)&&p._.slice(m.commands.length).forEach(b=>{d.includes(""+b)||g.push(""+b)}),g.length>0&&(s.fail(l("Unknown command: %s","Unknown commands: %s",g.length,g.join(", "))),!0)},isValidAndSomeAliasIsNotNew:function(p,d){if(!Object.prototype.hasOwnProperty.call(d,p))return!1;let g=i.parsed.newAliases;return[p,...d[p]].some(m=>!Object.prototype.hasOwnProperty.call(g,m)||!g[p])},limitedChoices:function(p){let d=i.getOptions(),g={};if(!Object.keys(d.choices).length)return;Object.keys(p).forEach(_=>{PP.indexOf(_)===-1&&Object.prototype.hasOwnProperty.call(d.choices,_)&&[].concat(p[_]).forEach(N=>{d.choices[_].indexOf(N)===-1&&N!==void 0&&(g[_]=(g[_]||[]).concat(N))})});let m=Object.keys(g);if(!m.length)return;let b=o("Invalid values:");m.forEach(_=>{b+=` +`)}`:"";s.fail(l("Missing required argument: %s","Missing required arguments: %s",Object.keys(g).length,Object.keys(g).join(", ")+b))}},unknownArguments:function(p,d,g,m,b=!0){var _;let N=i.getInternalMethods().getCommandInstance().getCommands(),C=[],G=i.getInternalMethods().getContext();if(Object.keys(p).forEach(L=>{SP.includes(L)||Object.prototype.hasOwnProperty.call(g,L)||Object.prototype.hasOwnProperty.call(i.getInternalMethods().getParseContext(),L)||u.isValidAndSomeAliasIsNotNew(L,d)||C.push(L)}),b&&(G.commands.length>0||N.length>0||m)&&p._.slice(G.commands.length).forEach(L=>{N.includes(""+L)||C.push(""+L)}),b){let L=((_=i.getDemandedCommands()._)===null||_===void 0?void 0:_.max)||0,M=G.commands.length+L;M{$=String($),G.commands.includes($)||C.includes($)||C.push($)})}C.length&&s.fail(l("Unknown argument: %s","Unknown arguments: %s",C.length,C.join(", ")))},unknownCommands:function(p){let d=i.getInternalMethods().getCommandInstance().getCommands(),g=[],m=i.getInternalMethods().getContext();return(m.commands.length>0||d.length>0)&&p._.slice(m.commands.length).forEach(b=>{d.includes(""+b)||g.push(""+b)}),g.length>0&&(s.fail(l("Unknown command: %s","Unknown commands: %s",g.length,g.join(", "))),!0)},isValidAndSomeAliasIsNotNew:function(p,d){if(!Object.prototype.hasOwnProperty.call(d,p))return!1;let g=i.parsed.newAliases;return[p,...d[p]].some(m=>!Object.prototype.hasOwnProperty.call(g,m)||!g[p])},limitedChoices:function(p){let d=i.getOptions(),g={};if(!Object.keys(d.choices).length)return;Object.keys(p).forEach(_=>{SP.indexOf(_)===-1&&Object.prototype.hasOwnProperty.call(d.choices,_)&&[].concat(p[_]).forEach(N=>{d.choices[_].indexOf(N)===-1&&N!==void 0&&(g[_]=(g[_]||[]).concat(N))})});let m=Object.keys(g);if(!m.length)return;let b=o("Invalid values:");m.forEach(_=>{b+=` ${o("Argument: %s, Given: %s, Choices: %s",_,s.stringifiedValues(g[_]),s.stringifiedValues(d.choices[_]))}`}),s.fail(b)}},c={};function f(p,d){let g=Number(d);return typeof(d=isNaN(g)?d:g)=="number"?d=p._.length>=d:d.match(/^--no-.+/)?(d=d.match(/^--no-(.+)/)[1],d=!Object.prototype.hasOwnProperty.call(p,d)):d=Object.prototype.hasOwnProperty.call(p,d),d}u.implies=function(p,d){de(" [array|number|string]",[p,d],arguments.length),typeof p=="object"?Object.keys(p).forEach(g=>{u.implies(g,p[g])}):(i.global(p),c[p]||(c[p]=[]),Array.isArray(d)?d.forEach(g=>u.implies(p,g)):(li(d,void 0,a),c[p].push(d)))},u.getImplied=function(){return c},u.implications=function(p){let d=[];if(Object.keys(c).forEach(g=>{let m=g;(c[g]||[]).forEach(b=>{let _=m,N=b;_=f(p,_),b=f(p,b),_&&!b&&d.push(` ${m} -> ${N}`)})}),d.length){let g=`${o("Implications failed:")} -`;d.forEach(m=>{g+=m}),s.fail(g)}};let h={};u.conflicts=function(p,d){de(" [array|string]",[p,d],arguments.length),typeof p=="object"?Object.keys(p).forEach(g=>{u.conflicts(g,p[g])}):(i.global(p),h[p]||(h[p]=[]),Array.isArray(d)?d.forEach(g=>u.conflicts(p,g)):h[p].push(d))},u.getConflicting=()=>h,u.conflicting=function(p){Object.keys(p).forEach(d=>{h[d]&&h[d].forEach(g=>{g&&p[d]!==void 0&&p[g]!==void 0&&s.fail(o("Arguments %s and %s are mutually exclusive",d,g))})}),i.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(h).forEach(d=>{h[d].forEach(g=>{g&&p[a.Parser.camelCase(d)]!==void 0&&p[a.Parser.camelCase(g)]!==void 0&&s.fail(o("Arguments %s and %s are mutually exclusive",d,g))})})},u.recommendCommands=function(p,d){d=d.sort((b,_)=>_.length-b.length);let g=null,m=1/0;for(let b,_=0;(b=d[_])!==void 0;_++){let N=Ok(p,b);N<=3&&N!p[d]),h=xo(h,d=>!p[d]),u};let y=[];return u.freeze=function(){y.push({implied:c,conflicting:h})},u.unfreeze=function(){let p=y.pop();li(p,void 0,a),{implied:c,conflicting:h}=p},u}(this,P(this,Fe,"f"),P(this,Ie,"f")),"f"),he(this,Ft,P(this,Ft,"f")?P(this,Ft,"f").reset():function(i,s,a,o){return new TP(i,s,a,o)}(P(this,Fe,"f"),P(this,It,"f"),P(this,xr,"f"),P(this,Ie,"f")),"f"),P(this,Ir,"f")||he(this,Ir,function(i,s,a,o){return new CP(i,s,a,o)}(this,P(this,Fe,"f"),P(this,Ft,"f"),P(this,Ie,"f")),"f"),P(this,xr,"f").reset(),he(this,or,null,"f"),he(this,on,"","f"),he(this,As,null,"f"),he(this,lr,!1,"f"),this.parsed=!1,this}[VP](e,n){return P(this,Ie,"f").path.relative(e,n)}[su](e,n,r,i=0,s=!1){let a=!!r||s;e=e||P(this,Ss,"f"),P(this,be,"f").__=P(this,Ie,"f").y18n.__,P(this,be,"f").configuration=this[da]();let o=!!P(this,be,"f").configuration["populate--"],l=Object.assign({},P(this,be,"f").configuration,{"populate--":!0}),u=P(this,Ie,"f").Parser.detailed(e,Object.assign({},P(this,be,"f"),{configuration:{"parse-positional-numbers":!1,...l}})),c=Object.assign(u.argv,P(this,la,"f")),f,h=u.aliases,y=!1,p=!1;Object.keys(c).forEach(d=>{d===P(this,Rr,"f")&&c[d]?y=!0:d===P(this,Ai,"f")&&c[d]&&(p=!0)}),c.$0=this.$0,this.parsed=u,i===0&&P(this,Fe,"f").clearCachedHelpMessage();try{if(this[Em](),n)return this[ha](c,o,!!r,!1);P(this,Rr,"f")&&[P(this,Rr,"f")].concat(h[P(this,Rr,"f")]||[]).filter(b=>b.length>1).includes(""+c._[c._.length-1])&&(c._.pop(),y=!0);let d=P(this,Ft,"f").getCommands(),g=P(this,Ir,"f").completionKey in c,m=y||g||s;if(c._.length){if(d.length){let b;for(let _,N=i||0;c._[N]!==void 0;N++){if(_=String(c._[N]),d.includes(_)&&_!==P(this,or,"f")){let C=P(this,Ft,"f").runCommand(_,this,u,N+1,s,y||p||s);return this[ha](C,o,!!r,!1)}if(!b&&_!==P(this,or,"f")){b=_;break}}!P(this,Ft,"f").hasDefaultCommand()&&P(this,kf,"f")&&b&&!m&&P(this,It,"f").recommendCommands(b,d)}P(this,or,"f")&&c._.includes(P(this,or,"f"))&&!g&&(P(this,Dr,"f")&&ru(!0),this.showCompletionScript(),this.exit(0))}if(P(this,Ft,"f").hasDefaultCommand()&&!m){let b=P(this,Ft,"f").runCommand(null,this,u,0,s,y||p||s);return this[ha](b,o,!!r,!1)}if(g){P(this,Dr,"f")&&ru(!0);let b=(e=[].concat(e)).slice(e.indexOf(`--${P(this,Ir,"f").completionKey}`)+1);return P(this,Ir,"f").getCompletion(b,(_,N)=>{if(_)throw new Qt(_.message);(N||[]).forEach(C=>{P(this,wo,"f").log(C)}),this.exit(0)}),this[ha](c,!o,!!r,!1)}if(P(this,lr,"f")||(y?(P(this,Dr,"f")&&ru(!0),a=!0,this.showHelp("log"),this.exit(0)):p&&(P(this,Dr,"f")&&ru(!0),a=!0,P(this,Fe,"f").showVersion("log"),this.exit(0))),!a&&P(this,be,"f").skipValidation.length>0&&(a=Object.keys(c).some(b=>P(this,be,"f").skipValidation.indexOf(b)>=0&&c[b]===!0)),!a){if(u.error)throw new Qt(u.error.message);if(!g){let b=this[Fm](h,{},u.error);r||(f=tu(c,this,P(this,xr,"f").getMiddleware(),!0)),f=this[wP](b,f??c),Gt(f)&&!r&&(f=f.then(()=>tu(c,this,P(this,xr,"f").getMiddleware(),!1)))}}}catch(d){if(!(d instanceof Qt))throw d;P(this,Fe,"f").fail(d.message,d)}return this[ha](f??c,o,!!r,!0)}[Fm](e,n,r,i){let s={...this.getDemandedOptions()};return a=>{if(r)throw new Qt(r.message);P(this,It,"f").nonOptionCount(a),P(this,It,"f").requiredArguments(a,s);let o=!1;P(this,fa,"f")&&(o=P(this,It,"f").unknownCommands(a)),P(this,ca,"f")&&!o?P(this,It,"f").unknownArguments(a,e,n,!!i):P(this,pa,"f")&&P(this,It,"f").unknownArguments(a,e,{},!1,!1),P(this,It,"f").limitedChoices(a),P(this,It,"f").implications(a),P(this,It,"f").conflicting(a)}}[jP](){he(this,lr,!0,"f")}[ma](e){if(typeof e=="string")P(this,be,"f").key[e]=!0;else for(let n of e)P(this,be,"f").key[n]=!0}},km,Mm,{readFileSync:Lk}=require("fs"),{inspect:Fk}=require("util"),{resolve:kk}=require("path"),Mk=mC(),Bk=pm(),Bm,WP={assert:{notStrictEqual:pP.notStrictEqual,strictEqual:pP.strictEqual},cliui:tP(),findUp:sP(),getEnv:t=>process.env[t],getCallerFile:oP(),getProcessArgvBin:yP,inspect:Fk,mainFilename:(Mm=(km=require==null?void 0:require.main)===null||km===void 0?void 0:km.filename)!==null&&Mm!==void 0?Mm:process.cwd(),Parser:Bk,path:require("path"),process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(t,e)=>process.emitWarning(t,e),execPath:()=>process.execPath,exit:t=>{process.exit(t)},nextTick:process.nextTick,stdColumns:process.stdout.columns!==void 0?process.stdout.columns:null},readFileSync:Lk,require,requireDirectory:fP(),stringWidth:Nf(),y18n:Mk({directory:kk(__dirname,"../locales"),updateFiles:!1})},GP=((Bm=process==null?void 0:process.env)===null||Bm===void 0?void 0:Bm.YARGS_MIN_NODE_VERSION)?Number(process.env.YARGS_MIN_NODE_VERSION):12;if(process&&process.version&&Number(process.version.match(/v([^.]+)/)[1]){let r=new UP(t,e,n,qm);return Object.defineProperty(r,"argv",{get:()=>r.parse(),enumerable:!0}),r.help(),r.version(),r}),argsert:de,isPromise:Gt,objFilter:xo,parseCommand:Do,Parser:qk,processArgv:xk,YError:Qt};YP.exports=Vk});var KP=X((ZZ,$P)=>{"use strict";var{Yargs:jk,processArgv:Uk}=HP();Fo(Uk.hideBin(process.argv));$P.exports=Fo;function Fo(t,e){let n=jk(t,e,require);return Gk(n),n}function Vm(t,e,n){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:n})}function Wk(t,e){let n=Object.getOwnPropertyDescriptor(t,e);if(typeof n!="undefined")return n.get}function Gk(t){[...Object.keys(t),...Object.getOwnPropertyNames(t.constructor.prototype)].forEach(e=>{e==="argv"?Vm(Fo,e,Wk(t,e)):typeof t[e]=="function"?Fo[e]=t[e].bind(t):(Vm(Fo,"$0",()=>t.$0),Vm(Fo,"parsed",()=>t.parsed))})}});var nt=je(require("fs"));var Is=class{constructor(){this.currentStructure=null;this.isReloading=!1;this.isDirtyState=!0}setActiveProject(e){this.currentStructure=e}getStructure(){return this.currentStructure}hasStructure(){return this.currentStructure!=null}setDirtyState(e){this.isDirtyState=e}reloadDetails(){this.isReloading||this.isDirtyState!=!1&&this.currentStructure!=null&&(this.isReloading=!0,this.currentStructure=this.currentStructure.reloadDetails(),this.isReloading=!1,this.isDirtyState=!1)}};Is.instance=null;(typeof Is.instance=="undefined"||Is.instance==null)&&(Is.instance=new Is);var cr=Is;var ci=class{static registerDetails(e,n){this.documentDetails.set(e,n)}static hasDetails(e){return this.documentDetails.has(e)}};ci.documentDetails=new Map;var aA={documentDescription:"",documentName:"",collectionInjections:[],blueprints:[],variableHelper:null,injectsParameters:[],varReferenceNames:new Map,formatterEnabled:!0},Gm="@name",Ym="@description",Hm="@desc",$m="@entry",Km="@collection",zm="@blueprint",Xm="@var",Qm="@set",Jm="@param",Zm="@param*",oA="@front",eg="@format";function Bo(t,e){if(e==null||e.isComment==!1)return aA;let n=e.content.replace(/(\r\n|\n|\r)/gm,` +`;d.forEach(m=>{g+=m}),s.fail(g)}};let h={};u.conflicts=function(p,d){de(" [array|string]",[p,d],arguments.length),typeof p=="object"?Object.keys(p).forEach(g=>{u.conflicts(g,p[g])}):(i.global(p),h[p]||(h[p]=[]),Array.isArray(d)?d.forEach(g=>u.conflicts(p,g)):h[p].push(d))},u.getConflicting=()=>h,u.conflicting=function(p){Object.keys(p).forEach(d=>{h[d]&&h[d].forEach(g=>{g&&p[d]!==void 0&&p[g]!==void 0&&s.fail(o("Arguments %s and %s are mutually exclusive",d,g))})}),i.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(h).forEach(d=>{h[d].forEach(g=>{g&&p[a.Parser.camelCase(d)]!==void 0&&p[a.Parser.camelCase(g)]!==void 0&&s.fail(o("Arguments %s and %s are mutually exclusive",d,g))})})},u.recommendCommands=function(p,d){d=d.sort((b,_)=>_.length-b.length);let g=null,m=1/0;for(let b,_=0;(b=d[_])!==void 0;_++){let N=Fk(p,b);N<=3&&N!p[d]),h=xo(h,d=>!p[d]),u};let y=[];return u.freeze=function(){y.push({implied:c,conflicting:h})},u.unfreeze=function(){let p=y.pop();li(p,void 0,a),{implied:c,conflicting:h}=p},u}(this,P(this,Fe,"f"),P(this,Ie,"f")),"f"),he(this,Ft,P(this,Ft,"f")?P(this,Ft,"f").reset():function(i,s,a,o){return new vP(i,s,a,o)}(P(this,Fe,"f"),P(this,It,"f"),P(this,xr,"f"),P(this,Ie,"f")),"f"),P(this,Ir,"f")||he(this,Ir,function(i,s,a,o){return new PP(i,s,a,o)}(this,P(this,Fe,"f"),P(this,Ft,"f"),P(this,Ie,"f")),"f"),P(this,xr,"f").reset(),he(this,or,null,"f"),he(this,on,"","f"),he(this,Ss,null,"f"),he(this,lr,!1,"f"),this.parsed=!1,this}[jP](e,n){return P(this,Ie,"f").path.relative(e,n)}[su](e,n,r,i=0,s=!1){let a=!!r||s;e=e||P(this,As,"f"),P(this,be,"f").__=P(this,Ie,"f").y18n.__,P(this,be,"f").configuration=this[da]();let o=!!P(this,be,"f").configuration["populate--"],l=Object.assign({},P(this,be,"f").configuration,{"populate--":!0}),u=P(this,Ie,"f").Parser.detailed(e,Object.assign({},P(this,be,"f"),{configuration:{"parse-positional-numbers":!1,...l}})),c=Object.assign(u.argv,P(this,la,"f")),f,h=u.aliases,y=!1,p=!1;Object.keys(c).forEach(d=>{d===P(this,Rr,"f")&&c[d]?y=!0:d===P(this,Si,"f")&&c[d]&&(p=!0)}),c.$0=this.$0,this.parsed=u,i===0&&P(this,Fe,"f").clearCachedHelpMessage();try{if(this[Em](),n)return this[ha](c,o,!!r,!1);P(this,Rr,"f")&&[P(this,Rr,"f")].concat(h[P(this,Rr,"f")]||[]).filter(b=>b.length>1).includes(""+c._[c._.length-1])&&(c._.pop(),y=!0);let d=P(this,Ft,"f").getCommands(),g=P(this,Ir,"f").completionKey in c,m=y||g||s;if(c._.length){if(d.length){let b;for(let _,N=i||0;c._[N]!==void 0;N++){if(_=String(c._[N]),d.includes(_)&&_!==P(this,or,"f")){let C=P(this,Ft,"f").runCommand(_,this,u,N+1,s,y||p||s);return this[ha](C,o,!!r,!1)}if(!b&&_!==P(this,or,"f")){b=_;break}}!P(this,Ft,"f").hasDefaultCommand()&&P(this,kf,"f")&&b&&!m&&P(this,It,"f").recommendCommands(b,d)}P(this,or,"f")&&c._.includes(P(this,or,"f"))&&!g&&(P(this,Dr,"f")&&ru(!0),this.showCompletionScript(),this.exit(0))}if(P(this,Ft,"f").hasDefaultCommand()&&!m){let b=P(this,Ft,"f").runCommand(null,this,u,0,s,y||p||s);return this[ha](b,o,!!r,!1)}if(g){P(this,Dr,"f")&&ru(!0);let b=(e=[].concat(e)).slice(e.indexOf(`--${P(this,Ir,"f").completionKey}`)+1);return P(this,Ir,"f").getCompletion(b,(_,N)=>{if(_)throw new Qt(_.message);(N||[]).forEach(C=>{P(this,wo,"f").log(C)}),this.exit(0)}),this[ha](c,!o,!!r,!1)}if(P(this,lr,"f")||(y?(P(this,Dr,"f")&&ru(!0),a=!0,this.showHelp("log"),this.exit(0)):p&&(P(this,Dr,"f")&&ru(!0),a=!0,P(this,Fe,"f").showVersion("log"),this.exit(0))),!a&&P(this,be,"f").skipValidation.length>0&&(a=Object.keys(c).some(b=>P(this,be,"f").skipValidation.indexOf(b)>=0&&c[b]===!0)),!a){if(u.error)throw new Qt(u.error.message);if(!g){let b=this[Fm](h,{},u.error);r||(f=tu(c,this,P(this,xr,"f").getMiddleware(),!0)),f=this[OP](b,f??c),Gt(f)&&!r&&(f=f.then(()=>tu(c,this,P(this,xr,"f").getMiddleware(),!1)))}}}catch(d){if(!(d instanceof Qt))throw d;P(this,Fe,"f").fail(d.message,d)}return this[ha](f??c,o,!!r,!0)}[Fm](e,n,r,i){let s={...this.getDemandedOptions()};return a=>{if(r)throw new Qt(r.message);P(this,It,"f").nonOptionCount(a),P(this,It,"f").requiredArguments(a,s);let o=!1;P(this,fa,"f")&&(o=P(this,It,"f").unknownCommands(a)),P(this,ca,"f")&&!o?P(this,It,"f").unknownArguments(a,e,n,!!i):P(this,pa,"f")&&P(this,It,"f").unknownArguments(a,e,{},!1,!1),P(this,It,"f").limitedChoices(a),P(this,It,"f").implications(a),P(this,It,"f").conflicting(a)}}[UP](){he(this,lr,!0,"f")}[ma](e){if(typeof e=="string")P(this,be,"f").key[e]=!0;else for(let n of e)P(this,be,"f").key[n]=!0}},km,Mm,{readFileSync:kk}=require("fs"),{inspect:Mk}=require("util"),{resolve:Bk}=require("path"),qk=gC(),Vk=pm(),Bm,GP={assert:{notStrictEqual:dP.notStrictEqual,strictEqual:dP.strictEqual},cliui:nP(),findUp:aP(),getEnv:t=>process.env[t],getCallerFile:lP(),getProcessArgvBin:bP,inspect:Mk,mainFilename:(Mm=(km=require==null?void 0:require.main)===null||km===void 0?void 0:km.filename)!==null&&Mm!==void 0?Mm:process.cwd(),Parser:Vk,path:require("path"),process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(t,e)=>process.emitWarning(t,e),execPath:()=>process.execPath,exit:t=>{process.exit(t)},nextTick:process.nextTick,stdColumns:process.stdout.columns!==void 0?process.stdout.columns:null},readFileSync:kk,require,requireDirectory:pP(),stringWidth:Nf(),y18n:qk({directory:Bk(__dirname,"../locales"),updateFiles:!1})},YP=((Bm=process==null?void 0:process.env)===null||Bm===void 0?void 0:Bm.YARGS_MIN_NODE_VERSION)?Number(process.env.YARGS_MIN_NODE_VERSION):12;if(process&&process.version&&Number(process.version.match(/v([^.]+)/)[1]){let r=new WP(t,e,n,qm);return Object.defineProperty(r,"argv",{get:()=>r.parse(),enumerable:!0}),r.help(),r.version(),r}),argsert:de,isPromise:Gt,objFilter:xo,parseCommand:Do,Parser:jk,processArgv:wk,YError:Qt};HP.exports=Uk});var zP=X((iee,KP)=>{"use strict";var{Yargs:Wk,processArgv:Gk}=$P();Fo(Gk.hideBin(process.argv));KP.exports=Fo;function Fo(t,e){let n=Wk(t,e,require);return Hk(n),n}function Vm(t,e,n){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:n})}function Yk(t,e){let n=Object.getOwnPropertyDescriptor(t,e);if(typeof n!="undefined")return n.get}function Hk(t){[...Object.keys(t),...Object.getOwnPropertyNames(t.constructor.prototype)].forEach(e=>{e==="argv"?Vm(Fo,e,Yk(t,e)):typeof t[e]=="function"?Fo[e]=t[e].bind(t):(Vm(Fo,"$0",()=>t.$0),Vm(Fo,"parsed",()=>t.parsed))})}});var nt=je(require("fs"));var Is=class{constructor(){this.currentStructure=null;this.isReloading=!1;this.isDirtyState=!0}setActiveProject(e){this.currentStructure=e}getStructure(){return this.currentStructure}hasStructure(){return this.currentStructure!=null}setDirtyState(e){this.isDirtyState=e}reloadDetails(){this.isReloading||this.isDirtyState!=!1&&this.currentStructure!=null&&(this.isReloading=!0,this.currentStructure=this.currentStructure.reloadDetails(),this.isReloading=!1,this.isDirtyState=!1)}};Is.instance=null;(typeof Is.instance=="undefined"||Is.instance==null)&&(Is.instance=new Is);var cr=Is;var ci=class{static registerDetails(e,n){this.documentDetails.set(e,n)}static hasDetails(e){return this.documentDetails.has(e)}};ci.documentDetails=new Map;var oS={documentDescription:"",documentName:"",collectionInjections:[],blueprints:[],variableHelper:null,injectsParameters:[],varReferenceNames:new Map,formatterEnabled:!0},Gm="@name",Ym="@description",Hm="@desc",$m="@entry",Km="@collection",zm="@blueprint",Xm="@var",Qm="@set",Jm="@param",Zm="@param*",lS="@front",eg="@format";function Bo(t,e){if(e==null||e.isComment==!1)return oS;let n=e.content.replace(/(\r\n|\n|\r)/gm,` `).split(` -`).map(p=>p.trim()),r=[],i=new Map,s="",a="",o=[],l=[],u="",c=null,f=!1,h=!0;for(let p=0;pg.trim())),f=!1;else if(d.startsWith(Km))o=o.concat(d.slice(Km.length).split(",").map(g=>g.trim())),f=!1;else if(d.startsWith(zm))l=l.concat(d.slice(zm.length).split(",").map(g=>g.trim())),f=!1;else if(d.startsWith(Gm))s=d.slice(Gm.length).trim(),f=!1;else if(d.startsWith(Ym))a=d.slice(Ym.length).trim(),f=!0;else if(d.startsWith(Hm))a=d.slice(Hm.length).trim(),f=!0;else if(d.startsWith(Xm))u=d.slice(Xm.length).trim(),f=!1;else if(d.startsWith(Qm))u="@page "+d.slice(Qm.length).trim(),f=!1;else if(d.startsWith(Jm)){let g=Jm.length,m=!1;d.startsWith(Zm)&&(g=Zm.length,m=!0);let _=d.slice(g).trim().split(" ");if(_.length>0)if(_[0]==oA&&_.length>=4){_.shift();let N=_.shift(),C=_.shift(),G=_.join(" ");r.push({acceptsVariableInterpolation:!0,aliases:[],allowsVariableReference:!0,description:G,expectsTypes:["*"],isDynamic:!0,isRequired:m,name:C}),i.set(C,N)}else{let N=_.shift(),C=_.join(" ");r.push({acceptsVariableInterpolation:!0,aliases:[],allowsVariableReference:!0,description:C,expectsTypes:["*"],isDynamic:!0,isRequired:m,name:N})}}else d.startsWith(eg)?d.slice(eg.length).trim().toLowerCase()=="true"?h=!0:h=!1:f&&(a+=` -`+d.trim())}if(u.length>0){let p=u.split(" ");if(p.length==2){let d=p[0],g=p[1];if(g.includes(".")){let m=g.split(".");if(m.length==2){let b=m[0],_=m[1];c={variableName:d,collectionName:b,fieldHandle:_,setHandle:""}}else if(m.length==3){let b=m[0],_=m[1],N=m[2];c={variableName:d,collectionName:b,fieldHandle:_,setHandle:N}}}else c={variableName:d,setHandle:"",collectionName:"",fieldHandle:g}}}if(t.trim().length>0&&cr.instance!=null&&cr.instance.hasStructure()){let p=cr.instance.getStructure().findView(t);p!=null&&(p.injectsParameters=r,p.varReferenceNames=i)}let y={documentName:s,documentDescription:a,collectionInjections:o,blueprints:l,variableHelper:c,injectsParameters:r,varReferenceNames:i,formatterEnabled:h};return t.trim().length>0&&e.startPosition!=null&&(e.startPosition.line<=1||e.index<=1)&&ci.registerDetails(t,y),y}var lA=["markdown","text","textarea","slug","button_group","code","color","date","form","link","structures","select","taxonomies","terms","template","time","video","users","user_groups","user_roles"],uA=["array","assets","bard","blueprints","collections","entries","list","grid","replicator","structures_multiple","sites","select_multiple","form_multiple","table","tags","terms_multiple","taxonomies_multiple","users_multiple","checkboxes","select_multiple","yaml","user_groups_multiple","user_roles_multiple"],cA=["integer","range"],fA=["toggle"];function lu(t){return lA.includes(t)?"string":uA.includes(t)?"array":cA.includes(t)?"number":fA.includes(t)?"boolean":t}var Ds=class{constructor(){this.partialReferences=new Map;this.cacheReferences=new Map;this.removesPageScope=new Map}clearAllReferences(e){this.clearPartialReferences(e),this.clearCacheReferences(e)}registerPartialReferences(e,n){this.partialReferences.has(e)==!1&&this.partialReferences.set(e,[]),this.partialReferences.set(e,n)}registerCacheReferences(e,n){this.cacheReferences.has(e)==!1&&this.cacheReferences.set(e,[]),this.cacheReferences.set(e,n)}clearPartialReferences(e){this.partialReferences.has(e)&&this.partialReferences.set(e,[])}clearRemovesPageScope(e){this.removesPageScope.has(e)&&this.removesPageScope.delete(e)}pageScopeDisabled(e){return this.removesPageScope.has(e)}clearCacheReferences(e){this.cacheReferences.has(e)&&this.cacheReferences.set(e,[])}setRemovesPageScope(e,n){this.removesPageScope.set(e,n)}getPartialReferences(e){return this.partialReferences.has(e)==!1?[]:this.partialReferences.get(e)}getCacheReferencnes(e){return this.cacheReferences.has(e)==!1?[]:this.cacheReferences.get(e)}hasPartialReferences(e){return this.partialReferences.has(e)}hasCacheReferences(e){return this.cacheReferences.has(e)}};Ds.instance=null;(typeof Ds.instance=="undefined"||Ds.instance==null)&&(Ds.instance=new Ds);var tg=Ds;var Fn=class{constructor(){this.index=-1;this.offset=0;this.line=0;this.char=0}shiftRight(e){let n=new Fn;return n.offset=this.offset+e,n.index=this.index+e,n.line=this.line,n.char=this.char+e,n}isBefore(e){return e==null?!1:e.line>this.line||e.line==this.line&&this.offset=e.index&&this.index<=n.index+r}isWithinRange(e){return e==null?!1:e.start!=null&&e.end!=null?this.isWithin(e.start,e.end):!1}};var jf=class{constructor(){this.start=null;this.end=null}},qo=jf;qo.Empty=new jf;function ng(t,e){let n=e.copy(),r=e.copy();return r.addVariable({sourceName:"*internal.group_by",sourceField:null,dataType:"string",name:"group",introducedBy:t}),r.addVariable({sourceName:"*internal.group_by",sourceField:null,dataType:"string",name:"key",introducedBy:t}),r.addScopeList("items",n),e.addScopeList("groups",r),e}function rg(t,e){let n=e.copy();return e.addScopeList("items",n),e}var ig=[{name:"as",acceptsType:["array"],returnsType:["array"],description:"Alias the array variable with a key.",docLink:"https://statamic.dev/modifiers/as",parameters:[{name:"alias",description:"The alias name."}],canBeParameter:!0},{name:"ampersand_list",acceptsType:["array"],returnsType:["string"],description:"Converts the array into a comma delimited string, with an ampersand before the last item.",docLink:"https://statamic.dev/modifiers/ampersand_list",parameters:[],canBeParameter:!1},{name:"collapse",acceptsType:["array"],returnsType:["array"],description:"Collapses an array of arrays into a single, flat, array.",docLink:"https://statamic.dev/modifiers/collapse",parameters:[],canBeParameter:!1},{name:"contains",acceptsType:["array","string"],returnsType:["boolean"],description:"Tests if the value contains another value.",docLink:"https://statamic.dev/modifiers/contains",parameters:[{name:"needle",description:"The value to check for."}],canBeParameter:!1},{name:"count",acceptsType:["array"],returnsType:["number"],description:"Returns the number of items in the array.",docLink:"https://statamic.dev/modifiers/count",parameters:[],canBeParameter:!1},{name:"dl",acceptsType:["array"],returnsType:["string"],description:"Turns an associative array into an HTML definition list.",docLink:"https://statamic.dev/modifiers/dl",parameters:[],canBeParameter:!1},{name:"explode",acceptsType:["string"],returnsType:["array"],description:"Breaks a string into an array on a given delimiter.",docLink:"https://statamic.dev/modifiers/explode",parameters:[{name:"delimiter",description:"The delimiter to break the string apart on."}],canBeParameter:!0},{name:"flatten",acceptsType:["array"],returnsType:["array"],description:"Flattens a multi-dimensional array.",docLink:"https://statamic.dev/modifiers/flatten",parameters:[],canBeParameter:!1},{name:"flip",acceptsType:["array"],returnsType:["array"],description:"Swaps the array keys with their values.",docLink:"https://statamic.dev/modifiers/flip",parameters:[],canBeParameter:!1},{name:"group_by",acceptsType:["array"],returnsType:["array"],description:"Groups the array items by the given key.",docLink:"https://statamic.dev/modifiers/group_by",parameters:[{name:"key",description:"The key to group by."}],canBeParameter:!0,augmentScope:ng},{name:"in_array",acceptsType:["array"],returnsType:["boolean"],description:"Tests if an array contains a specific value.",docLink:"https://statamic.dev/modifiers/in_array",parameters:[{name:"needle",description:"The value to check for."}],canBeParameter:!1},{name:"is_empty",acceptsType:["array"],returnsType:["boolean"],description:"Tests if the array is empty.",docLink:"https://statamic.dev/modifiers/is_empty",parameters:[],canBeParameter:!1},{name:"join",acceptsType:["array"],returnsType:["string"],description:"Turn an array into a string by gluing together all the data.",docLink:"https://statamic.dev/modifiers/join",parameters:[{name:"glue",description:"The string to combine the parts by."}],canBeParameter:!0},{name:"joinplode",acceptsType:["array"],returnsType:["string"],description:"Turn an array into a string by gluing together all the data.",docLink:null,parameters:[{name:"glue",description:"The string to combine the parts by."}],canBeParameter:!0},{name:"limit",acceptsType:["array"],returnsType:["array"],description:"Limits the number of items returned in the array",docLink:"https://statamic.dev/modifiers/limit",parameters:[{name:"count",description:"The maximum number of items to return."}],canBeParameter:!0},{name:"list",acceptsType:["array"],returnsType:["string"],description:"Converts the array into a comma-separated string.",docLink:"https://statamic.dev/modifiers/list",parameters:[],canBeParameter:!1},{name:"offset",acceptsType:["array"],returnsType:["array"],description:"Offsets the items returned in the array.",docLink:"https://statamic.dev/modifiers/offset",parameters:[{name:"offset",description:"The one-based index to start retrieving items."}],canBeParameter:!0},{name:"ol",acceptsType:["array"],returnsType:["string"],description:"Turns the array into an HTML ordered list.",docLink:"https://statamic.dev/modifiers/ol",parameters:[],canBeParameter:!1},{name:"option_list",acceptsType:["array"],returnsType:["string"],description:"Turns an array into a pipe-delimited string.",docLink:"https://statamic.dev/modifiers/option_list",parameters:[],canBeParameter:!1},{name:"pluck",acceptsType:["array"],returnsType:["array"],description:"Plucks a value from a collection of items.",parameters:[{name:"value",description:"The value to pluck from the array or collection."}],canBeParameter:!0,docLink:null},{name:"pad",acceptsType:["array"],returnsType:["array"],description:"Pads the array to a specified length with the given value.",docLink:"https://statamic.dev/modifiers/pad",parameters:[{name:"length",description:"The desired length of the array."},{name:"value",description:"The value to pad the array with."}],canBeParameter:!0},{name:"piped",acceptsType:["array"],returnsType:["string"],description:"Turns an array into a pipe-delimited string.",docLink:"https://statamic.dev/modifiers/piped",parameters:[],canBeParameter:!1},{name:"sentence_list",acceptsType:["array"],returnsType:["string"],description:'Turns the array into a comma-delimited list, with the word "and" before the last item.',docLink:"https://statamic.dev/modifiers/sentence_list",parameters:[],canBeParameter:!1},{name:"shuffle",acceptsType:["array"],returnsType:["array"],description:"Randomizes the order of array elements.",docLink:"https://statamic.dev/modifiers/shuffle",parameters:[],canBeParameter:!1},{name:"sort",acceptsType:["array"],returnsType:["array"],description:"Sorts the array by a key in ascending or descending order.",docLink:"https://statamic.dev/modifiers/sort",parameters:[{name:"key",description:"The key to sort by."},{name:"order",description:"The sort direction. `asc` or `desc`."}],canBeParameter:!0},{name:"sum",acceptsType:["array"],returnsType:["number"],description:"Returns the sum of all items in the array.",docLink:"https://statamic.dev/modifiers/sum",parameters:[{name:"key",description:"The value to sum."}],canBeParameter:!1},{name:"ul",acceptsType:["array"],returnsType:["string"],description:"Turns the array into an HTML unordered list.",docLink:"https://statamic.dev/modifiers/ul",parameters:[],canBeParameter:!1},{name:"unique",acceptsType:["array"],returnsType:["array"],description:"Returns all unique items in the array.",docLink:"https://statamic.dev/modifiers/unique",parameters:[],canBeParameter:!1},{name:"where",acceptsType:["array"],returnsType:["array"],description:"Filters the array by a given key and value.",docLink:"https://statamic.dev/modifiers/where",parameters:[{name:"key",description:"The property to filter by."},{name:"value",description:"The value to compare to."}],canBeParameter:!0},{name:"split",acceptsType:["array"],returnsType:["array"],description:"Splits an array into smaller arrays with the provided size.",canBeParameter:!0,docLink:"",parameters:[{name:"size",description:"The size of each new array"}],augmentScope:rg},{name:"compact",acceptsType:["string"],returnsType:["array"],description:"Accepts a comma-delimited list of variable names and return an array with their values.",canBeParameter:!0,docLink:"",parameters:[{name:"variables",description:"A comma-delimited list of variable names."}]}];var sg=[{name:"background_position",acceptsType:["string"],returnsType:["string"],description:"Converts an asset focal point into a background-position CSS property.",docLink:"https://statamic.dev/modifiers/background_position",parameters:[],canBeParameter:!1},{name:"image",acceptsType:["string"],returnsType:["string"],description:"Generates an HTML image element with the variable's value as the src.",docLink:"https://statamic.dev/modifiers/image",parameters:[],canBeParameter:!1},{name:"output",acceptsType:["string"],returnsType:["string"],description:"Returns the string output of an Asset file's contents.",docLink:"https://statamic.dev/modifiers/output",parameters:[],canBeParameter:!1}];var ag=[{name:"contains_all",acceptsType:["string"],returnsType:["boolean"],description:"Tests if a string contains all of the provided needles.",docLink:"https://statamic.dev/modifiers/contains_all",parameters:[{name:"needle",description:"The string(s) to search for."}],canBeParameter:!1},{name:"contains_any",acceptsType:["string"],returnsType:["boolean"],description:"Tests if a string contains all of the provided needles.",docLink:"https://statamic.dev/modifiers/contains_any",parameters:[{name:"needle",description:"The string(s) to search for."}],canBeParameter:!1},{name:"ends_with",acceptsType:["string"],returnsType:["boolean"],description:"Tests if a string ends with another string.",docLink:"https://statamic.dev/modifiers/ends_with",parameters:[{name:"value",description:"The value to check against."}],canBeParameter:!1},{name:"has_lower_case",acceptsType:["string"],returnsType:["boolean"],description:"Tests if the string contains any lowercase characters.",docLink:"https://statamic.dev/modifiers/has_lower_case",parameters:[],canBeParameter:!1},{name:"has_upper_case",acceptsType:["string"],returnsType:["boolean"],description:"Tests if the string contains any uppercase characters.",docLink:"https://statamic.dev/modifiers/has_upper_case",parameters:[],canBeParameter:!1},{name:"in_array",acceptsType:["array"],returnsType:["boolean"],description:"Tests if an array contains a specific value.",docLink:"https://statamic.dev/modifiers/in_array",parameters:[{name:"needle",description:"The value(s) to search for."}],canBeParameter:!1},{name:"is_after",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the string contains only alphanumeric characters.",docLink:"https://statamic.dev/modifiers/is_after",parameters:[{name:"date",description:"The date to compare to."}],canBeParameter:!1},{name:"is_alphanumeric",acceptsType:["string"],returnsType:["boolean"],description:"Tests if the string contains only alphanumeric characters.",docLink:"https://statamic.dev/modifiers/is_alphanumeric",parameters:[],canBeParameter:!1},{name:"is_before",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if a date is before another date.",docLink:"https://statamic.dev/modifiers/is_before",parameters:[{name:"date",description:"The date to compare to."}],canBeParameter:!1},{name:"is_between",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if a date is between two other dates.",docLink:"https://statamic.dev/modifiers/is_between",parameters:[{name:"start_date",description:"The start date to compare."},{name:"end_date",description:"The end date to compare."}],canBeParameter:!1},{name:"is_blank",acceptsType:["string"],returnsType:["boolean"],description:"Tests if the string contains only whitespace characters.",docLink:"https://statamic.dev/modifiers/is_blank",parameters:[],canBeParameter:!1},{name:"is_email",acceptsType:["string"],returnsType:["boolean"],description:"Tests if the string is a valid email address.",docLink:"https://statamic.dev/modifiers/is_email",parameters:[],canBeParameter:!1},{name:"is_future",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the date is in the future.",docLink:"https://statamic.dev/modifiers/is_future",parameters:[],canBeParameter:!1},{name:"is_json",acceptsType:["string"],returnsType:["boolean"],description:"Tests if the string is valid JSON.",docLink:"https://statamic.dev/modifiers/is_json",parameters:[],canBeParameter:!1},{name:"is_leap_year",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the date is a leap year.",docLink:"https://statamic.dev/modifiers/is_leap_year",parameters:[],canBeParameter:!1},{name:"is_numeric",acceptsType:["string","number"],returnsType:["boolean"],description:"Tests if the value is a number or numeric string.",docLink:"https://statamic.dev/modifiers/is_numeric",parameters:[],canBeParameter:!1},{name:"is_past",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the date is in the past.",docLink:"https://statamic.dev/modifiers/is_past",parameters:[],canBeParameter:!1},{name:"is_today",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the date is today.",docLink:"https://statamic.dev/modifiers/is_today",parameters:[],canBeParameter:!1},{name:"is_uppercase",acceptsType:["string"],returnsType:["boolean"],description:"Tests if the string contains only uppercase characters.",docLink:"https://statamic.dev/modifiers/is_uppercase",parameters:[],canBeParameter:!1},{name:"is_url",acceptsType:["string"],returnsType:["boolean"],description:"Tests if the string is a valid URL.",docLink:"https://statamic.dev/modifiers/is_url",parameters:[],canBeParameter:!1},{name:"is_weekday",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the date is a week day.",docLink:"https://statamic.dev/modifiers/is_weekday",parameters:[],canBeParameter:!1},{name:"is_weekend",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the date is a weekend day.",docLink:"https://statamic.dev/modifiers/is_weekend",parameters:[],canBeParameter:!1},{name:"is_yesterday",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the date is yesterday.",docLink:"https://statamic.dev/modifiers/is_yesterday",parameters:[],canBeParameter:!1},{name:"is_tomorrow",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the date is tomorrow.",docLink:null,parameters:[],canBeParameter:!1},{name:"starts_with",acceptsType:["string"],returnsType:["boolean"],description:"Tests if a value starts with the provided value.",docLink:"https://statamic.dev/modifiers/starts_with",parameters:[{name:"value",description:"The value to test for."}],canBeParameter:!1}];var og=[{name:"days_ago",acceptsType:["string","date"],returnsType:["number"],description:"Returns the number of days since a given date.",docLink:"https://statamic.dev/modifiers/days_ago",parameters:[],canBeParameter:!1},{name:"format_translated",acceptsType:["string","date"],returnsType:["string","date"],description:"Returns a formatted Carbon datetime/string.",docLink:"https://statamic.dev/modifiers/format",parameters:[{name:"format",description:"The format to use."}],canBeParameter:!0},{name:"format",acceptsType:["string","date"],returnsType:["string","date"],description:"Formats the date using the provided format using PHP's [date variables](https://www.php.net/date).",docLink:"https://statamic.dev/modifiers/format",parameters:[{name:"format",description:"The format to use."}],canBeParameter:!0},{name:"format_localized",acceptsType:["string","date"],returnsType:["string","date"],description:"Forms the date using server's locale, using PHP's [strftime format variables](https://www.php.net/strftime).",docLink:"https://statamic.dev/modifiers/format_localized",parameters:[{name:"format",description:"The format to use."}],canBeParameter:!0},{name:"hours_ago",acceptsType:["string","date"],returnsType:["number"],description:"Returns the number of hours since the date.",docLink:"https://statamic.dev/modifiers/hours_ago",parameters:[],canBeParameter:!1},{name:"iso_format",acceptsType:["string","date"],returnsType:["string","date"],description:"Formats the date using an ISO format.",docLink:"https://statamic.dev/modifiers/iso_format",parameters:[{name:"format",description:"The format to use."}],canBeParameter:!1},{name:"minutes_ago",acceptsType:["string","date"],returnsType:["number"],description:"Returns the number of minutes since the date.",docLink:"https://statamic.dev/modifiers/minutes_ago",parameters:[],canBeParameter:!1},{name:"modify_date",acceptsType:["string","date"],returnsType:["string","date"],description:"Alters the date by incrementing or decrementing it in a format accepted by PHP's [strtotime](https://www.php.net/strtotime) function.",docLink:"https://statamic.dev/modifiers/modify_date",parameters:[],canBeParameter:!0},{name:"months_ago",acceptsType:["string","date"],returnsType:["number"],description:"Returns the number of months since the date.",docLink:"https://statamic.dev/modifiers/months_ago",parameters:[],canBeParameter:!1},{name:"relative",acceptsType:["string","date"],returnsType:["string"],description:"Returns a human readable date difference.",docLink:"https://statamic.dev/modifiers/relative",parameters:[{name:"add_ago",description:"Whether to add the relative suffix words at the end of the string."}],canBeParameter:!1},{name:"seconds_ago",acceptsType:["string","date"],returnsType:["number"],description:"Returns the number of seconds since the date.",docLink:"https://statamic.dev/modifiers/seconds_ago",parameters:[],canBeParameter:!1},{name:"timezone",acceptsType:["string","date"],returnsType:["string","date"],description:"Applies a timezone to the date.",docLink:"https://statamic.dev/modifiers/timezone",parameters:[{name:"timezone",description:"The timezone to apply."}],canBeParameter:!1},{name:"weeks_ago",acceptsType:["string","date"],returnsType:["number"],description:"Returns the number of weeks since the date.",docLink:"https://statamic.dev/modifiers/weeks_ago",parameters:[],canBeParameter:!1},{name:"years_ago",acceptsType:["string","date"],returnsType:["number"],description:"Returns the number of years since the date.",docLink:"https://statamic.dev/modifiers/years_ago",parameters:[],canBeParameter:!1}];var lg=[{name:"chunk",acceptsType:["array"],returnsType:["array"],description:"Breaks the array or collection into smaller arrays of a given size.",docLink:"https://statamic.dev/modifiers/chunk",parameters:[{name:"chunk_size",description:"The maximum length of each new chunk."}],canBeParameter:!0},{name:"favicon",acceptsType:["string"],returnsType:["string"],description:"Generates a favicon HTML meta tag for the given value.",docLink:"https://statamic.dev/modifiers/favicon",parameters:[],canBeParameter:!1},{name:"first",acceptsType:["string","array"],returnsType:["*"],description:"Returns the specified number of characters from the beginning of the string.",docLink:"https://statamic.dev/modifiers/first",parameters:[{name:"count",description:"The number of characters to return."}],canBeParameter:!0},{name:"last",acceptsType:["string","array"],returnsType:["*"],description:"Returns the specified number of characters from the end of the string.",docLink:"https://statamic.dev/modifiers/last",parameters:[{name:"count",description:"The number of characters to return."}],canBeParameter:!0},{name:"link",acceptsType:["string"],returnsType:["string"],description:"Generates an HTML link for the provided value.",docLink:"https://statamic.dev/modifiers/link",parameters:[],canBeParameter:!1},{name:"mailto",acceptsType:["string"],returnsType:["string"],description:"Generates a mailto HTML link for the provided value.",docLink:"https://statamic.dev/modifiers/mailto",parameters:[],canBeParameter:!1},{name:"markdown",acceptsType:["string"],returnsType:["string"],description:"Parses the value as Markdown and returns the HTML.",docLink:"https://statamic.dev/modifiers/markdown",parameters:[],canBeParameter:!1},{name:"nl2br",acceptsType:["string"],returnsType:["string"],description:"Replaces line breaks with HTML `
` tags.",docLink:"https://statamic.dev/modifiers/nl2br",parameters:[],canBeParameter:!1},{name:"obfuscate",acceptsType:["string"],returnsType:["string"],description:"Modifies the input string by replacing it with special characters, making it harder for bots but remains readable to site visitors.",docLink:"https://statamic.dev/modifiers/obfuscate",parameters:[],canBeParameter:!1},{name:"obfuscate_email",acceptsType:["string"],returnsType:["string"],description:"Obfuscates an email address with special HTML characters.",docLink:"https://statamic.dev/modifiers/obfuscate_email",parameters:[],canBeParameter:!1},{name:"strip_tags",acceptsType:["string"],returnsType:["string"],description:"Removes HTML tags from the string.",docLink:"https://statamic.dev/modifiers/strip_tags",parameters:[{name:"tags",description:"The HTML tag(s) to remove from the string."}],canBeParameter:!1},{name:"table",acceptsType:["array"],returnsType:["string"],description:"Turns a [Table FieldType](https://statamic.dev/fieldtypes/table) array into an HTML table.",docLink:"https://statamic.dev/modifiers/table",parameters:[{name:"content_markdown",description:"Whether to parse cell contents as Markdown."}],canBeParameter:!1},{name:"textile",acceptsType:["string"],returnsType:["string"],description:"Parses a string with [Textile](http://demo.textilewiki.com/theme-default/) and returns the HTML.",docLink:"https://statamic.dev/modifiers/textile",parameters:[],canBeParameter:!1},{name:"wrap",acceptsType:["string"],returnsType:["string"],description:"Wraps a string with a given HTML tag.",docLink:"https://statamic.dev/modifiers/wrap",parameters:[{name:"expression",description:"The HTML tag or Emmet-style expression to wrap the value in."}],canBeParameter:!1}];var ug=[{name:"add",acceptsType:["number"],returnsType:["number"],description:"Adds two values together.",docLink:"https://statamic.dev/modifiers/add",parameters:[{name:"value",description:"The value to add."}],canBeParameter:!0},{name:"+",acceptsType:["number"],returnsType:["number"],description:"Adds two values together.",docLink:"https://statamic.dev/modifiers/add",parameters:[{name:"value",description:"The value to add."}],canBeParameter:!1},{name:"ceil",acceptsType:["number"],returnsType:["number"],description:"Rounds the value to the next whole number.",docLink:"https://statamic.dev/modifiers/ceil",parameters:[],canBeParameter:!1},{name:"divide",acceptsType:["number"],returnsType:["number"],description:"Divides two values.",docLink:"https://statamic.dev/modifiers/divide",parameters:[{name:"value",description:"The value to divide."}],canBeParameter:!0},{name:"floor",acceptsType:["number"],returnsType:["number"],description:"Rounds a number down to the next whole number.",docLink:"https://statamic.dev/modifiers/floor",parameters:[],canBeParameter:!0},{name:"format_number",acceptsType:["number"],returnsType:["string"],description:"Formats a number.",docLink:"https://statamic.dev/modifiers/format_number",parameters:[{name:"precision",description:"Number of decimal places before rounding."},{name:"decimal_separator",description:"The decimal separator (defaults to `.`)."},{name:"thousands_separator",description:"The thousands separator (default `,`)."}],canBeParameter:!0},{name:"mode",acceptsType:["number"],returnsType:["number"],description:"",docLink:"",parameters:[],canBeParameter:!0},{name:"multiply",acceptsType:["number"],returnsType:["number"],description:"Multiplies two values.",docLink:"https://statamic.dev/modifiers/multiply",parameters:[{name:"value",description:"The value to multiply."}],canBeParameter:!0},{name:"*",acceptsType:["number"],returnsType:["number"],description:"Multiplies two values.",docLink:"https://statamic.dev/modifiers/multiply",parameters:[{name:"value",description:"The value to multiply."}],canBeParameter:!1},{name:"round",acceptsType:["number"],returnsType:["number"],description:"Rounds a number to a specified precision.",docLink:"https://statamic.dev/modifiers/round",parameters:[{name:"precision",description:"The number of digits after the decimal point."}],canBeParameter:!0},{name:"subtract",acceptsType:["number"],returnsType:["number"],description:"Subtracts two values.",docLink:"https://statamic.dev/modifiers/subtract",parameters:[{name:"value",description:"The value to subtract."}],canBeParameter:!0},{name:"-",acceptsType:["number"],returnsType:["number"],description:"Subtracts two values.",docLink:"https://statamic.dev/modifiers/subtract",parameters:[{name:"value",description:"The value to subtract."}],canBeParameter:!1}];var cg=[{name:"partial",acceptsType:["*"],returnsType:["*view*"],description:"Injects data into a partial and renders it.",docLink:"https://statamic.dev/modifiers/partial",parameters:[{name:"partial",description:"The name of the partial."}],canBeParameter:!1},{name:"macro",acceptsType:["*"],returnsType:["*"],description:"Runs a pre-configured macro on the data.",docLink:"https://statamic.dev/modifiers/macro",parameters:[{name:"macro",description:"The macro name."}],canBeParameter:!1},{name:"url",acceptsType:["string","*"],returnsType:["string"],description:"Locates the URL of an asset, page, entry, or taxonomy term based on the variable contents.",docLink:"https://statamic.dev/modifiers/url",parameters:[],canBeParameter:!1}];var fg=[{name:"ascii",acceptsType:["string"],returnsType:["string"],description:"Replaces all non-ASCII characters with their closest ASCII counterparts.",docLink:"https://statamic.dev/modifiers/ascii",parameters:[],canBeParameter:!1},{name:"at",acceptsType:["string"],returnsType:["string"],description:"Returns the character at a given zero-based position.",docLink:"https://statamic.dev/modifiers/at",parameters:[{name:"position",description:"The zero-based position to retrieve a character from."}],canBeParameter:!0},{name:"backspace",acceptsType:["string"],returnsType:["string"],description:"Removes a specified number of characters from the end of a string.",docLink:"https://statamic.dev/modifiers/backspace",parameters:[{name:"character_count",description:"The number of characters to remove from the end of the string."}],canBeParameter:!0},{name:"camelize",acceptsType:["string"],returnsType:["string"],description:"Converts the string into camelCase.",docLink:"https://statamic.dev/modifiers/camelize",parameters:[],canBeParameter:!1},{name:"cdata",acceptsType:["string"],returnsType:["string"],description:"Wraps the string in CDATA XML tags.",docLink:"https://statamic.dev/modifiers/cdata",parameters:[],canBeParameter:!1},{name:"collapse_whitespace",acceptsType:["string"],returnsType:["string"],description:"Trims a string and replaces consecutive whitespace characters with a single space.",docLink:"https://statamic.dev/modifiers/collapse_whitespace",parameters:[],canBeParameter:!1},{name:"count_substring",acceptsType:["string"],returnsType:["number"],description:"Counts the number of occurrences of a term within the string.",docLink:"https://statamic.dev/modifiers/count_substring",parameters:[{name:"term",description:"The sub-string to search for"}],canBeParameter:!0},{name:"dashify",acceptsType:["string"],returnsType:["string"],description:"Returns a lower-cased and trimmed string, separated by dashes.",docLink:"https://statamic.dev/modifiers/dashify",parameters:[],canBeParameter:!1},{name:"deslugify",acceptsType:["string"],returnsType:["string"],description:"Replaces all hyphens and underscores with spaces.",docLink:"https://statamic.dev/modifiers/deslugify",parameters:[],canBeParameter:!1},{name:"embed_url",acceptsType:["string"],returnsType:["string"],description:"Converts a YouTube or Viemo link into their embed URLs.",docLink:"https://statamic.dev/modifiers/embed_url",parameters:[],canBeParameter:!1},{name:"trackable_embed_url",acceptsType:["string"],returnsType:["string"],description:"Get the embed URL when given a youtube or vimeo link that's direct to the page.",docLink:null,parameters:[],canBeParameter:!1},{name:"ensure_left",acceptsType:["string"],returnsType:["string"],description:"Ensures that the string begins with the specified string.",docLink:"https://statamic.dev/modifiers/ensure_left",parameters:[{name:"start_string",description:"The value that should be at the start of the string."}],canBeParameter:!0},{name:"ensure_right",acceptsType:["string"],returnsType:["string"],description:"Ensures that the string ends with the specified string.",docLink:"https://statamic.dev/modifiers/ensure_right",parameters:[{name:"end_string",description:"The value that should be at the end of the string."}],canBeParameter:!0},{name:"entities",acceptsType:["string"],returnsType:["string"],description:"Encode a string with HTML entities.",docLink:"https://statamic.dev/modifiers/entities",parameters:[],canBeParameter:!1},{name:"excerpt",acceptsType:["string"],returnsType:["string"],description:"Breaks a string at a given marker.",docLink:"https://statamic.dev/modifiers/excerpt",parameters:[{name:"marker",description:"The string to break by."}],canBeParameter:!1},{name:"explode",acceptsType:["string"],returnsType:["array"],description:"Breaks a string into an array of strings.",docLink:"https://statamic.dev/modifiers/explode",parameters:[{name:"delimiter",description:"The string to split the larger string by."}],canBeParameter:!0},{name:"gravatar",acceptsType:["string"],returnsType:["string"],description:"Converts an email string to a Gravatar image URL.",docLink:"https://statamic.dev/modifiers/gravatar",parameters:[{name:"image size",description:"The desired image size."}],canBeParameter:!0},{name:"insert",acceptsType:["string"],returnsType:["string"],description:"Inserts a string at the position provided.",docLink:"https://statamic.dev/modifiers/insert",parameters:[{name:"value",description:"The value to insert."},{name:"position",description:"The zero based position to insert the text at."}],canBeParameter:!0},{name:"is_email",acceptsType:["string"],returnsType:["boolean"],description:"Returns true if the string is a valid email address.",docLink:"https://statamic.dev/modifiers/is_email",parameters:[],canBeParameter:!1},{name:"is_embeddable",acceptsType:["string"],returnsType:["boolean"],description:"Checks to see if a video URL is embeddable.",docLink:"https://statamic.dev/modifiers/is_embeddable",parameters:[],canBeParameter:!1},{name:"is_lowercase",acceptsType:["string"],returnsType:["boolean"],description:"Returns true if the string contains only lowercase characters.",docLink:"https://statamic.dev/modifiers/is_lowercase",parameters:[],canBeParameter:!1},{name:"is_url",acceptsType:["string"],returnsType:["boolean"],description:"Returns true if a string is a valid URL.",docLink:"https://statamic.dev/modifiers/is_url",parameters:[],canBeParameter:!1},{name:"lcfirst",acceptsType:["string"],returnsType:["string"],description:"Converts the first character of the value to lower case.",docLink:"https://statamic.dev/modifiers/lcfirst",parameters:[],canBeParameter:!1},{name:"length",acceptsType:["string"],returnsType:["number"],description:"Returns the number of items in an array or number of characters in a string.",docLink:"https://statamic.dev/modifiers/length",parameters:[],canBeParameter:!1},{name:"lower",acceptsType:["string"],returnsType:["string"],description:"Converts all characters to lowercase.",docLink:"https://statamic.dev/modifiers/lower",parameters:[],canBeParameter:!1},{name:"md5",acceptsType:["string"],returnsType:["string"],description:"Creates an MD5 hash of the variable.",docLink:"https://statamic.dev/modifiers/md5",parameters:[],canBeParameter:!1},{name:"rawurlencode",acceptsType:["string"],returnsType:["string"],description:"URL-encode a variable according to RFC-3986.",docLink:"https://statamic.dev/modifiers/rawurlencode",parameters:[],canBeParameter:!1},{name:"read_time",acceptsType:["string"],returnsType:["string"],description:"Returns an estimated read time, in minutes.",docLink:"https://statamic.dev/modifiers/read_time",parameters:[{name:"words per minute",description:"The words per minute to use as an estimate."}],canBeParameter:!0},{name:"regex_replace",acceptsType:["string"],returnsType:["string"],description:"Replaces all regex matches with a string.",docLink:"https://statamic.dev/modifiers/regex_replace",parameters:[{name:"pattern",description:"The regex pattern."},{name:"replace",description:"The replacement value."}],canBeParameter:!0},{name:"remove_left",acceptsType:["string"],returnsType:["string"],description:"Ensures that the string never begins with a specified string.",docLink:"https://statamic.dev/modifiers/remove_left/",parameters:[{name:"value",description:"The value to remove."}],canBeParameter:!0},{name:"remove_right",acceptsType:["string"],returnsType:["string"],description:"Ensures that a string never ends with a specified string.",docLink:"https://statamic.dev/modifiers/remove_right",parameters:[{name:"value",description:"The value to remove."}],canBeParameter:!0},{name:"replace",acceptsType:["string"],returnsType:["string"],description:"Replaces all occurrences of a string with a different value.",docLink:"https://statamic.dev/modifiers/replace",parameters:[{name:"needle",description:"The string to search for."},{name:"value",description:"The value to replace all occurrences with."}],canBeParameter:!0},{name:"reverse",acceptsType:["string","array"],returnsType:["string","array"],description:"Reverses all characters in a string, or all items in an array.",docLink:"https://statamic.dev/modifiers/reverse",parameters:[],canBeParameter:!1},{name:"safe_truncate",acceptsType:["string"],returnsType:["string"],description:"Truncates a string to a given length.",docLink:"https://statamic.dev/modifiers/safe_truncate",parameters:[{name:"length",description:"The desired string length."},{name:"suffix",description:"An optional suffix to append to the string if truncation occurs."}],canBeParameter:!1},{name:"sanitize",acceptsType:["string"],returnsType:["string"],description:"Converts special characters to HTML entities.",docLink:"https://statamic.dev/modifiers/sanitize",parameters:[],canBeParameter:!1},{name:"segment",acceptsType:["string"],returnsType:["string"],description:"Returns a segment by number from any valid URL or URI.",docLink:"https://statamic.dev/modifiers/segment",parameters:[{name:"segment",description:"The one-based segment to return."}],canBeParameter:!0},{name:"singular",acceptsType:["string"],returnsType:["string"],description:"Returns the singular form of an English word.",docLink:"https://statamic.dev/modifiers/singular",parameters:[],canBeParameter:!1},{name:"slugify",acceptsType:["string"],returnsType:["string"],description:"Converts the string into an URL slug.",docLink:"https://statamic.dev/modifiers/slugify",parameters:[],canBeParameter:!1},{name:"smartypants",acceptsType:["string"],returnsType:["string"],description:"Translates plain ASCII punctuation characters into typographic punctuation HTML entities.",docLink:"https://statamic.dev/modifiers/smartypants",parameters:[],canBeParameter:!1},{name:"spaceless",acceptsType:["string"],returnsType:["string"],description:"Removes excess whitespace and line breaks from a string.",docLink:"https://statamic.dev/modifiers/spaceless",parameters:[],canBeParameter:!1},{name:"substr",acceptsType:["string"],returnsType:["string"],description:"Returns a portion of a string based on provided a start index, and optional length.",docLink:"https://statamic.dev/modifiers/substr",parameters:[{name:"start",description:"The 0-based index to start searching."},{name:"length",description:"An optional length for the string to find."}],canBeParameter:!1},{name:"surround",acceptsType:["string"],returnsType:["string"],description:"Surrounds a string with another string.",docLink:"https://statamic.dev/modifiers/surround",parameters:[{name:"value",description:"The value to surround the string with."}],canBeParameter:!1},{name:"swap_case",acceptsType:["string"],returnsType:["string"],description:"Returns a case swapped version of the string.",docLink:"https://statamic.dev/modifiers/swap_case",parameters:[],canBeParameter:!1},{name:"tidy",acceptsType:["string"],returnsType:["string"],description:"Returns a string with smart quotes, ellipsis characters, and dashes from Windows-1252 replaced by ASCII equivalents.",docLink:"https://statamic.dev/modifiers/tidy",parameters:[],canBeParameter:!1},{name:"title",acceptsType:["string"],returnsType:["string"],description:"Returns a Title Cased version of the string.",docLink:"https://statamic.dev/modifiers/title",parameters:[],canBeParameter:!1},{name:"trim",acceptsType:["string"],returnsType:["string"],description:"Removes whitespace from the start and end of the string.",docLink:"https://statamic.dev/modifiers/trim",parameters:[],canBeParameter:!1},{name:"truncate",acceptsType:["string"],returnsType:["string"],description:"Truncates a string to a given length.",docLink:"https://statamic.dev/modifiers/truncate",parameters:[{name:"length",description:"The maximum string length."},{name:"suffix",description:"An optional suffix to append to the string if truncation occurs."}],canBeParameter:!1},{name:"ucfirst",acceptsType:["string"],returnsType:["string"],description:"Upper cases the first character in the string.",docLink:"https://statamic.dev/modifiers/ucfirst",parameters:[],canBeParameter:!1},{name:"underscored",acceptsType:["string"],returnsType:["string"],description:"Returns a lower-cased and trimmed version of the string, separated by underscores.",docLink:"https://statamic.dev/modifiers/underscored",parameters:[],canBeParameter:!1},{name:"upper",acceptsType:["string"],returnsType:["string"],description:"Transforms the string to uppercase.",docLink:"https://statamic.dev/modifiers/upper",parameters:[],canBeParameter:!1},{name:"urldecode",acceptsType:["string"],returnsType:["string"],description:"URL-decodes the string.",docLink:"https://statamic.dev/modifiers/urldecode",parameters:[],canBeParameter:!1},{name:"urlencode",acceptsType:["string"],returnsType:["string"],description:"URL-encodes the string.",docLink:"https://statamic.dev/modifiers/urlencode",parameters:[],canBeParameter:!1},{name:"widont",acceptsType:["string"],returnsType:["string"],description:"Attempts to prevent lines with single words.",docLink:"https://statamic.dev/modifiers/widont",parameters:[],canBeParameter:!1},{name:"word_count",acceptsType:["string"],returnsType:["number"],description:"Returns the number of words in the string.",docLink:"https://statamic.dev/modifiers/word_count",parameters:[],canBeParameter:!1},{name:"add_slashes",acceptsType:["string"],returnsType:["string"],description:"Adds slashes before characters that need to be escaped.",docLink:"https://statamic.dev/modifiers/add_slashes",canBeParameter:!1,parameters:[]}];var pg=[{name:"console_log",acceptsType:["*"],returnsType:["null"],description:"Displays variable data in the browser's JavaScript console.",docLink:"https://statamic.dev/modifiers/console_log",parameters:[],canBeParameter:!1},{name:"decode",acceptsType:["string"],returnsType:["string"],description:"Converts all HTML entities to their applicable character codes.",docLink:"https://statamic.dev/modifiers/decode",parameters:[],canBeParameter:!1},{name:"dump",acceptsType:["*"],returnsType:["null"],description:"Displays variable data in the browser.",docLink:"https://statamic.dev/modifiers/dump",parameters:[],canBeParameter:!1},{name:"full_urls",acceptsType:["string"],returnsType:["string"],description:"Replaces root-relative URLs with absolute URLs.",docLink:"https://statamic.dev/modifiers/full_urls",parameters:[],canBeParameter:!1},{name:"repeat",acceptsType:["string"],returnsType:["string"],description:"Repeats a value a given number of times.",docLink:"https://statamic.dev/modifiers/repeat",parameters:[{name:"repeat_count",description:"The number of times to repeat the value."}],canBeParameter:!0},{name:"to_spaces",acceptsType:["string"],returnsType:["string"],description:"Converts all tabs to spaces.",docLink:"https://statamic.dev/modifiers/to_spaces",parameters:[{name:"space_count",description:"The number of spaces to replace tabs with."}],canBeParameter:!1},{name:"to_tabs",acceptsType:["string"],returnsType:["string"],description:"Converts spaces to tabs.",docLink:"https://statamic.dev/modifiers/to_tabs",parameters:[{name:"space_count",description:"The number of spaces to convert to tabs."}],canBeParameter:!1},{name:"to_json",acceptsType:["*"],returnsType:["string"],description:"Converts the data to JSON.",docLink:"https://statamic.dev/modifiers/to_json",parameters:[],canBeParameter:!1},{name:"to_bool",acceptsType:["*"],returnsType:["boolean"],description:"Converst the data to a boolean",parameters:[],canBeParameter:!1,docLink:null}];var zi=class{constructor(){this.registeredModifiers=new Map;this.acceptTypedModifierReference=new Map;this.returnTypeModifierReference=new Map;this.macros=new Map;this.modifierNameCache=[]}reset(){this.modifierNameCache=[],this.registeredModifiers.clear(),this.acceptTypedModifierReference.clear(),this.returnTypeModifierReference.clear()}getRegisteredModifiers(){return this.registeredModifiers}resetMacros(){this.macros.clear()}loadCoreModifiers(){this.registerModifiers(ig),this.registerModifiers(sg),this.registerModifiers(ag),this.registerModifiers(og),this.registerModifiers(lg),this.registerModifiers(ug),this.registerModifiers(pg),this.registerModifiers(fg),this.registerModifiers(cg)}getModifierNames(){return this.modifierNameCache}registerMacro(e){this.macros.set(e.name,e)}registerMacros(e){for(let n=0;n0)for(let r=0;r0?i.valueNodes[0].content:""}if(this.hasParameterModifiers())for(let r=0;r0)for(let r=0;r0?{start:i.startPosition,end:i.endPosition}:null}if(this.hasParameterModifiers())for(let r=0;r0&&this.node.modifierChain.lastManifestedModifier!=null){if(this.node.modifierChain.lastManifestedModifier.parameters.length>0&&this.node.modifierChain.lastManifestedModifier.modifier!=null&&xt.instance!=null){let e=this.node.modifierChain.lastManifestedModifier.modifier;return xt.instance.getProbableReturnType(e,this.isPaired())}return"*"}if(this.parameterModifiers.length>0){let e=this.parameterModifiers.reverse();for(let n=0;n0&&this.node.modifierChain.lastManifestedModifier!=null)return this.node.modifierChain.lastManifestedModifier.parameters.length>0?this.node.modifierChain.lastManifestedModifier.parameters[0].value:"";if(this.parameterModifiers.length>0){let e=this.parameterModifiers.reverse();for(let n=0;n0&&this.node.modifierChain.lastModifier!=null)return this.node.modifierChain.lastModifier;if(this.parameterModifiers.length>0){let e=this.parameterModifiers.reverse();for(let n=0;n0:!0}hasParameterModifiers(){return this.parameterModifiers.length>0}hasShorthandModifiers(){return this.node.modifierChain!=null&&this.node.modifierChain.modifierChain.length>0}hasModifier(e){return this.modifierNames.includes(e)}};function Wf(t){let e=[];return t.forEach(n=>{n instanceof z?e.push(n):n instanceof Nn&&n.logicBranches.length>0&&n.logicBranches.forEach(r=>{if(r.head!=null){let i=r.head;i.originalNode!=null?e.push(i.originalNode):e.push(i)}})}),e}var pA=[" ",` -`,"\r"," ","\f","\v","\xA0","\u2000","\u2001","\u2002","\u2003","\u2004","\u2005","\u2006","\u2007","\u2008","\u2009","\u200A","\u200B","\u2028","\u2029","\u3000"].join("");function dg(t){return(typeof t=="number"||typeof t=="string"&&pA.indexOf(t.slice(-1))===-1)&&t!==""&&!isNaN(t)}var Z=class{static normalizeLineEndings(e,n=` +`).map(p=>p.trim()),r=[],i=new Map,s="",a="",o=[],l=[],u="",c=null,f=!1,h=!0;for(let p=0;pg.trim())),f=!1;else if(d.startsWith(Km))o=o.concat(d.slice(Km.length).split(",").map(g=>g.trim())),f=!1;else if(d.startsWith(zm))l=l.concat(d.slice(zm.length).split(",").map(g=>g.trim())),f=!1;else if(d.startsWith(Gm))s=d.slice(Gm.length).trim(),f=!1;else if(d.startsWith(Ym))a=d.slice(Ym.length).trim(),f=!0;else if(d.startsWith(Hm))a=d.slice(Hm.length).trim(),f=!0;else if(d.startsWith(Xm))u=d.slice(Xm.length).trim(),f=!1;else if(d.startsWith(Qm))u="@page "+d.slice(Qm.length).trim(),f=!1;else if(d.startsWith(Jm)){let g=Jm.length,m=!1;d.startsWith(Zm)&&(g=Zm.length,m=!0);let _=d.slice(g).trim().split(" ");if(_.length>0)if(_[0]==lS&&_.length>=4){_.shift();let N=_.shift(),C=_.shift(),G=_.join(" ");r.push({acceptsVariableInterpolation:!0,aliases:[],allowsVariableReference:!0,description:G,expectsTypes:["*"],isDynamic:!0,isRequired:m,name:C}),i.set(C,N)}else{let N=_.shift(),C=_.join(" ");r.push({acceptsVariableInterpolation:!0,aliases:[],allowsVariableReference:!0,description:C,expectsTypes:["*"],isDynamic:!0,isRequired:m,name:N})}}else d.startsWith(eg)?d.slice(eg.length).trim().toLowerCase()=="true"?h=!0:h=!1:f&&(a+=` +`+d.trim())}if(u.length>0){let p=u.split(" ");if(p.length==2){let d=p[0],g=p[1];if(g.includes(".")){let m=g.split(".");if(m.length==2){let b=m[0],_=m[1];c={variableName:d,collectionName:b,fieldHandle:_,setHandle:""}}else if(m.length==3){let b=m[0],_=m[1],N=m[2];c={variableName:d,collectionName:b,fieldHandle:_,setHandle:N}}}else c={variableName:d,setHandle:"",collectionName:"",fieldHandle:g}}}if(t.trim().length>0&&cr.instance!=null&&cr.instance.hasStructure()){let p=cr.instance.getStructure().findView(t);p!=null&&(p.injectsParameters=r,p.varReferenceNames=i)}let y={documentName:s,documentDescription:a,collectionInjections:o,blueprints:l,variableHelper:c,injectsParameters:r,varReferenceNames:i,formatterEnabled:h};return t.trim().length>0&&e.startPosition!=null&&(e.startPosition.line<=1||e.index<=1)&&ci.registerDetails(t,y),y}var uS=["markdown","text","textarea","slug","button_group","code","color","date","form","link","structures","select","taxonomies","terms","template","time","video","users","user_groups","user_roles"],cS=["array","assets","bard","blueprints","collections","entries","list","grid","replicator","structures_multiple","sites","select_multiple","form_multiple","table","tags","terms_multiple","taxonomies_multiple","users_multiple","checkboxes","select_multiple","yaml","user_groups_multiple","user_roles_multiple"],fS=["integer","range"],pS=["toggle"];function lu(t){return uS.includes(t)?"string":cS.includes(t)?"array":fS.includes(t)?"number":pS.includes(t)?"boolean":t}var Ds=class{constructor(){this.partialReferences=new Map;this.cacheReferences=new Map;this.removesPageScope=new Map}clearAllReferences(e){this.clearPartialReferences(e),this.clearCacheReferences(e)}registerPartialReferences(e,n){this.partialReferences.has(e)==!1&&this.partialReferences.set(e,[]),this.partialReferences.set(e,n)}registerCacheReferences(e,n){this.cacheReferences.has(e)==!1&&this.cacheReferences.set(e,[]),this.cacheReferences.set(e,n)}clearPartialReferences(e){this.partialReferences.has(e)&&this.partialReferences.set(e,[])}clearRemovesPageScope(e){this.removesPageScope.has(e)&&this.removesPageScope.delete(e)}pageScopeDisabled(e){return this.removesPageScope.has(e)}clearCacheReferences(e){this.cacheReferences.has(e)&&this.cacheReferences.set(e,[])}setRemovesPageScope(e,n){this.removesPageScope.set(e,n)}getPartialReferences(e){return this.partialReferences.has(e)==!1?[]:this.partialReferences.get(e)}getCacheReferencnes(e){return this.cacheReferences.has(e)==!1?[]:this.cacheReferences.get(e)}hasPartialReferences(e){return this.partialReferences.has(e)}hasCacheReferences(e){return this.cacheReferences.has(e)}};Ds.instance=null;(typeof Ds.instance=="undefined"||Ds.instance==null)&&(Ds.instance=new Ds);var tg=Ds;var Fn=class{constructor(){this.index=-1;this.offset=0;this.line=0;this.char=0}shiftRight(e){let n=new Fn;return n.offset=this.offset+e,n.index=this.index+e,n.line=this.line,n.char=this.char+e,n}isBefore(e){return e==null?!1:e.line>this.line||e.line==this.line&&this.offset=e.index&&this.index<=n.index+r}isWithinRange(e){return e==null?!1:e.start!=null&&e.end!=null?this.isWithin(e.start,e.end):!1}};var jf=class{constructor(){this.start=null;this.end=null}},qo=jf;qo.Empty=new jf;function ng(t,e){let n=e.copy(),r=e.copy();return r.addVariable({sourceName:"*internal.group_by",sourceField:null,dataType:"string",name:"group",introducedBy:t}),r.addVariable({sourceName:"*internal.group_by",sourceField:null,dataType:"string",name:"key",introducedBy:t}),r.addScopeList("items",n),e.addScopeList("groups",r),e}function rg(t,e){let n=e.copy();return e.addScopeList("items",n),e}var ig=[{name:"as",acceptsType:["array"],returnsType:["array"],description:"Alias the array variable with a key.",docLink:"https://statamic.dev/modifiers/as",parameters:[{name:"alias",description:"The alias name."}],canBeParameter:!0},{name:"ampersand_list",acceptsType:["array"],returnsType:["string"],description:"Converts the array into a comma delimited string, with an ampersand before the last item.",docLink:"https://statamic.dev/modifiers/ampersand_list",parameters:[],canBeParameter:!1},{name:"collapse",acceptsType:["array"],returnsType:["array"],description:"Collapses an array of arrays into a single, flat, array.",docLink:"https://statamic.dev/modifiers/collapse",parameters:[],canBeParameter:!1},{name:"contains",acceptsType:["array","string"],returnsType:["boolean"],description:"Tests if the value contains another value.",docLink:"https://statamic.dev/modifiers/contains",parameters:[{name:"needle",description:"The value to check for."}],canBeParameter:!1},{name:"count",acceptsType:["array"],returnsType:["number"],description:"Returns the number of items in the array.",docLink:"https://statamic.dev/modifiers/count",parameters:[],canBeParameter:!1},{name:"dl",acceptsType:["array"],returnsType:["string"],description:"Turns an associative array into an HTML definition list.",docLink:"https://statamic.dev/modifiers/dl",parameters:[],canBeParameter:!1},{name:"explode",acceptsType:["string"],returnsType:["array"],description:"Breaks a string into an array on a given delimiter.",docLink:"https://statamic.dev/modifiers/explode",parameters:[{name:"delimiter",description:"The delimiter to break the string apart on."}],canBeParameter:!0},{name:"flatten",acceptsType:["array"],returnsType:["array"],description:"Flattens a multi-dimensional array.",docLink:"https://statamic.dev/modifiers/flatten",parameters:[],canBeParameter:!1},{name:"flip",acceptsType:["array"],returnsType:["array"],description:"Swaps the array keys with their values.",docLink:"https://statamic.dev/modifiers/flip",parameters:[],canBeParameter:!1},{name:"group_by",acceptsType:["array"],returnsType:["array"],description:"Groups the array items by the given key.",docLink:"https://statamic.dev/modifiers/group_by",parameters:[{name:"key",description:"The key to group by."}],canBeParameter:!0,augmentScope:ng},{name:"in_array",acceptsType:["array"],returnsType:["boolean"],description:"Tests if an array contains a specific value.",docLink:"https://statamic.dev/modifiers/in_array",parameters:[{name:"needle",description:"The value to check for."}],canBeParameter:!1},{name:"is_empty",acceptsType:["array"],returnsType:["boolean"],description:"Tests if the array is empty.",docLink:"https://statamic.dev/modifiers/is_empty",parameters:[],canBeParameter:!1},{name:"join",acceptsType:["array"],returnsType:["string"],description:"Turn an array into a string by gluing together all the data.",docLink:"https://statamic.dev/modifiers/join",parameters:[{name:"glue",description:"The string to combine the parts by."}],canBeParameter:!0},{name:"joinplode",acceptsType:["array"],returnsType:["string"],description:"Turn an array into a string by gluing together all the data.",docLink:null,parameters:[{name:"glue",description:"The string to combine the parts by."}],canBeParameter:!0},{name:"limit",acceptsType:["array"],returnsType:["array"],description:"Limits the number of items returned in the array",docLink:"https://statamic.dev/modifiers/limit",parameters:[{name:"count",description:"The maximum number of items to return."}],canBeParameter:!0},{name:"list",acceptsType:["array"],returnsType:["string"],description:"Converts the array into a comma-separated string.",docLink:"https://statamic.dev/modifiers/list",parameters:[],canBeParameter:!1},{name:"offset",acceptsType:["array"],returnsType:["array"],description:"Offsets the items returned in the array.",docLink:"https://statamic.dev/modifiers/offset",parameters:[{name:"offset",description:"The one-based index to start retrieving items."}],canBeParameter:!0},{name:"ol",acceptsType:["array"],returnsType:["string"],description:"Turns the array into an HTML ordered list.",docLink:"https://statamic.dev/modifiers/ol",parameters:[],canBeParameter:!1},{name:"option_list",acceptsType:["array"],returnsType:["string"],description:"Turns an array into a pipe-delimited string.",docLink:"https://statamic.dev/modifiers/option_list",parameters:[],canBeParameter:!1},{name:"pluck",acceptsType:["array"],returnsType:["array"],description:"Plucks a value from a collection of items.",parameters:[{name:"value",description:"The value to pluck from the array or collection."}],canBeParameter:!0,docLink:null},{name:"pad",acceptsType:["array"],returnsType:["array"],description:"Pads the array to a specified length with the given value.",docLink:"https://statamic.dev/modifiers/pad",parameters:[{name:"length",description:"The desired length of the array."},{name:"value",description:"The value to pad the array with."}],canBeParameter:!0},{name:"piped",acceptsType:["array"],returnsType:["string"],description:"Turns an array into a pipe-delimited string.",docLink:"https://statamic.dev/modifiers/piped",parameters:[],canBeParameter:!1},{name:"sentence_list",acceptsType:["array"],returnsType:["string"],description:'Turns the array into a comma-delimited list, with the word "and" before the last item.',docLink:"https://statamic.dev/modifiers/sentence_list",parameters:[],canBeParameter:!1},{name:"shuffle",acceptsType:["array"],returnsType:["array"],description:"Randomizes the order of array elements.",docLink:"https://statamic.dev/modifiers/shuffle",parameters:[],canBeParameter:!1},{name:"sort",acceptsType:["array"],returnsType:["array"],description:"Sorts the array by a key in ascending or descending order.",docLink:"https://statamic.dev/modifiers/sort",parameters:[{name:"key",description:"The key to sort by."},{name:"order",description:"The sort direction. `asc` or `desc`."}],canBeParameter:!0},{name:"sum",acceptsType:["array"],returnsType:["number"],description:"Returns the sum of all items in the array.",docLink:"https://statamic.dev/modifiers/sum",parameters:[{name:"key",description:"The value to sum."}],canBeParameter:!1},{name:"ul",acceptsType:["array"],returnsType:["string"],description:"Turns the array into an HTML unordered list.",docLink:"https://statamic.dev/modifiers/ul",parameters:[],canBeParameter:!1},{name:"unique",acceptsType:["array"],returnsType:["array"],description:"Returns all unique items in the array.",docLink:"https://statamic.dev/modifiers/unique",parameters:[],canBeParameter:!1},{name:"where",acceptsType:["array"],returnsType:["array"],description:"Filters the array by a given key and value.",docLink:"https://statamic.dev/modifiers/where",parameters:[{name:"key",description:"The property to filter by."},{name:"value",description:"The value to compare to."}],canBeParameter:!0},{name:"split",acceptsType:["array"],returnsType:["array"],description:"Splits an array into smaller arrays with the provided size.",canBeParameter:!0,docLink:"",parameters:[{name:"size",description:"The size of each new array"}],augmentScope:rg},{name:"compact",acceptsType:["string"],returnsType:["array"],description:"Accepts a comma-delimited list of variable names and return an array with their values.",canBeParameter:!0,docLink:"",parameters:[{name:"variables",description:"A comma-delimited list of variable names."}]}];var sg=[{name:"background_position",acceptsType:["string"],returnsType:["string"],description:"Converts an asset focal point into a background-position CSS property.",docLink:"https://statamic.dev/modifiers/background_position",parameters:[],canBeParameter:!1},{name:"image",acceptsType:["string"],returnsType:["string"],description:"Generates an HTML image element with the variable's value as the src.",docLink:"https://statamic.dev/modifiers/image",parameters:[],canBeParameter:!1},{name:"output",acceptsType:["string"],returnsType:["string"],description:"Returns the string output of an Asset file's contents.",docLink:"https://statamic.dev/modifiers/output",parameters:[],canBeParameter:!1}];var ag=[{name:"contains_all",acceptsType:["string"],returnsType:["boolean"],description:"Tests if a string contains all of the provided needles.",docLink:"https://statamic.dev/modifiers/contains_all",parameters:[{name:"needle",description:"The string(s) to search for."}],canBeParameter:!1},{name:"contains_any",acceptsType:["string"],returnsType:["boolean"],description:"Tests if a string contains all of the provided needles.",docLink:"https://statamic.dev/modifiers/contains_any",parameters:[{name:"needle",description:"The string(s) to search for."}],canBeParameter:!1},{name:"ends_with",acceptsType:["string"],returnsType:["boolean"],description:"Tests if a string ends with another string.",docLink:"https://statamic.dev/modifiers/ends_with",parameters:[{name:"value",description:"The value to check against."}],canBeParameter:!1},{name:"has_lower_case",acceptsType:["string"],returnsType:["boolean"],description:"Tests if the string contains any lowercase characters.",docLink:"https://statamic.dev/modifiers/has_lower_case",parameters:[],canBeParameter:!1},{name:"has_upper_case",acceptsType:["string"],returnsType:["boolean"],description:"Tests if the string contains any uppercase characters.",docLink:"https://statamic.dev/modifiers/has_upper_case",parameters:[],canBeParameter:!1},{name:"in_array",acceptsType:["array"],returnsType:["boolean"],description:"Tests if an array contains a specific value.",docLink:"https://statamic.dev/modifiers/in_array",parameters:[{name:"needle",description:"The value(s) to search for."}],canBeParameter:!1},{name:"is_after",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the string contains only alphanumeric characters.",docLink:"https://statamic.dev/modifiers/is_after",parameters:[{name:"date",description:"The date to compare to."}],canBeParameter:!1},{name:"is_alphanumeric",acceptsType:["string"],returnsType:["boolean"],description:"Tests if the string contains only alphanumeric characters.",docLink:"https://statamic.dev/modifiers/is_alphanumeric",parameters:[],canBeParameter:!1},{name:"is_before",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if a date is before another date.",docLink:"https://statamic.dev/modifiers/is_before",parameters:[{name:"date",description:"The date to compare to."}],canBeParameter:!1},{name:"is_between",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if a date is between two other dates.",docLink:"https://statamic.dev/modifiers/is_between",parameters:[{name:"start_date",description:"The start date to compare."},{name:"end_date",description:"The end date to compare."}],canBeParameter:!1},{name:"is_blank",acceptsType:["string"],returnsType:["boolean"],description:"Tests if the string contains only whitespace characters.",docLink:"https://statamic.dev/modifiers/is_blank",parameters:[],canBeParameter:!1},{name:"is_email",acceptsType:["string"],returnsType:["boolean"],description:"Tests if the string is a valid email address.",docLink:"https://statamic.dev/modifiers/is_email",parameters:[],canBeParameter:!1},{name:"is_future",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the date is in the future.",docLink:"https://statamic.dev/modifiers/is_future",parameters:[],canBeParameter:!1},{name:"is_json",acceptsType:["string"],returnsType:["boolean"],description:"Tests if the string is valid JSON.",docLink:"https://statamic.dev/modifiers/is_json",parameters:[],canBeParameter:!1},{name:"is_leap_year",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the date is a leap year.",docLink:"https://statamic.dev/modifiers/is_leap_year",parameters:[],canBeParameter:!1},{name:"is_numeric",acceptsType:["string","number"],returnsType:["boolean"],description:"Tests if the value is a number or numeric string.",docLink:"https://statamic.dev/modifiers/is_numeric",parameters:[],canBeParameter:!1},{name:"is_past",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the date is in the past.",docLink:"https://statamic.dev/modifiers/is_past",parameters:[],canBeParameter:!1},{name:"is_today",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the date is today.",docLink:"https://statamic.dev/modifiers/is_today",parameters:[],canBeParameter:!1},{name:"is_uppercase",acceptsType:["string"],returnsType:["boolean"],description:"Tests if the string contains only uppercase characters.",docLink:"https://statamic.dev/modifiers/is_uppercase",parameters:[],canBeParameter:!1},{name:"is_url",acceptsType:["string"],returnsType:["boolean"],description:"Tests if the string is a valid URL.",docLink:"https://statamic.dev/modifiers/is_url",parameters:[],canBeParameter:!1},{name:"is_weekday",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the date is a week day.",docLink:"https://statamic.dev/modifiers/is_weekday",parameters:[],canBeParameter:!1},{name:"is_weekend",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the date is a weekend day.",docLink:"https://statamic.dev/modifiers/is_weekend",parameters:[],canBeParameter:!1},{name:"is_yesterday",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the date is yesterday.",docLink:"https://statamic.dev/modifiers/is_yesterday",parameters:[],canBeParameter:!1},{name:"is_tomorrow",acceptsType:["string","date"],returnsType:["boolean"],description:"Tests if the date is tomorrow.",docLink:null,parameters:[],canBeParameter:!1},{name:"starts_with",acceptsType:["string"],returnsType:["boolean"],description:"Tests if a value starts with the provided value.",docLink:"https://statamic.dev/modifiers/starts_with",parameters:[{name:"value",description:"The value to test for."}],canBeParameter:!1}];var og=[{name:"days_ago",acceptsType:["string","date"],returnsType:["number"],description:"Returns the number of days since a given date.",docLink:"https://statamic.dev/modifiers/days_ago",parameters:[],canBeParameter:!1},{name:"format_translated",acceptsType:["string","date"],returnsType:["string","date"],description:"Returns a formatted Carbon datetime/string.",docLink:"https://statamic.dev/modifiers/format",parameters:[{name:"format",description:"The format to use."}],canBeParameter:!0},{name:"format",acceptsType:["string","date"],returnsType:["string","date"],description:"Formats the date using the provided format using PHP's [date variables](https://www.php.net/date).",docLink:"https://statamic.dev/modifiers/format",parameters:[{name:"format",description:"The format to use."}],canBeParameter:!0},{name:"format_localized",acceptsType:["string","date"],returnsType:["string","date"],description:"Forms the date using server's locale, using PHP's [strftime format variables](https://www.php.net/strftime).",docLink:"https://statamic.dev/modifiers/format_localized",parameters:[{name:"format",description:"The format to use."}],canBeParameter:!0},{name:"hours_ago",acceptsType:["string","date"],returnsType:["number"],description:"Returns the number of hours since the date.",docLink:"https://statamic.dev/modifiers/hours_ago",parameters:[],canBeParameter:!1},{name:"iso_format",acceptsType:["string","date"],returnsType:["string","date"],description:"Formats the date using an ISO format.",docLink:"https://statamic.dev/modifiers/iso_format",parameters:[{name:"format",description:"The format to use."}],canBeParameter:!1},{name:"minutes_ago",acceptsType:["string","date"],returnsType:["number"],description:"Returns the number of minutes since the date.",docLink:"https://statamic.dev/modifiers/minutes_ago",parameters:[],canBeParameter:!1},{name:"modify_date",acceptsType:["string","date"],returnsType:["string","date"],description:"Alters the date by incrementing or decrementing it in a format accepted by PHP's [strtotime](https://www.php.net/strtotime) function.",docLink:"https://statamic.dev/modifiers/modify_date",parameters:[],canBeParameter:!0},{name:"months_ago",acceptsType:["string","date"],returnsType:["number"],description:"Returns the number of months since the date.",docLink:"https://statamic.dev/modifiers/months_ago",parameters:[],canBeParameter:!1},{name:"relative",acceptsType:["string","date"],returnsType:["string"],description:"Returns a human readable date difference.",docLink:"https://statamic.dev/modifiers/relative",parameters:[{name:"add_ago",description:"Whether to add the relative suffix words at the end of the string."}],canBeParameter:!1},{name:"seconds_ago",acceptsType:["string","date"],returnsType:["number"],description:"Returns the number of seconds since the date.",docLink:"https://statamic.dev/modifiers/seconds_ago",parameters:[],canBeParameter:!1},{name:"timezone",acceptsType:["string","date"],returnsType:["string","date"],description:"Applies a timezone to the date.",docLink:"https://statamic.dev/modifiers/timezone",parameters:[{name:"timezone",description:"The timezone to apply."}],canBeParameter:!1},{name:"weeks_ago",acceptsType:["string","date"],returnsType:["number"],description:"Returns the number of weeks since the date.",docLink:"https://statamic.dev/modifiers/weeks_ago",parameters:[],canBeParameter:!1},{name:"years_ago",acceptsType:["string","date"],returnsType:["number"],description:"Returns the number of years since the date.",docLink:"https://statamic.dev/modifiers/years_ago",parameters:[],canBeParameter:!1}];var lg=[{name:"chunk",acceptsType:["array"],returnsType:["array"],description:"Breaks the array or collection into smaller arrays of a given size.",docLink:"https://statamic.dev/modifiers/chunk",parameters:[{name:"chunk_size",description:"The maximum length of each new chunk."}],canBeParameter:!0},{name:"favicon",acceptsType:["string"],returnsType:["string"],description:"Generates a favicon HTML meta tag for the given value.",docLink:"https://statamic.dev/modifiers/favicon",parameters:[],canBeParameter:!1},{name:"first",acceptsType:["string","array"],returnsType:["*"],description:"Returns the specified number of characters from the beginning of the string.",docLink:"https://statamic.dev/modifiers/first",parameters:[{name:"count",description:"The number of characters to return."}],canBeParameter:!0},{name:"last",acceptsType:["string","array"],returnsType:["*"],description:"Returns the specified number of characters from the end of the string.",docLink:"https://statamic.dev/modifiers/last",parameters:[{name:"count",description:"The number of characters to return."}],canBeParameter:!0},{name:"link",acceptsType:["string"],returnsType:["string"],description:"Generates an HTML link for the provided value.",docLink:"https://statamic.dev/modifiers/link",parameters:[],canBeParameter:!1},{name:"mailto",acceptsType:["string"],returnsType:["string"],description:"Generates a mailto HTML link for the provided value.",docLink:"https://statamic.dev/modifiers/mailto",parameters:[],canBeParameter:!1},{name:"markdown",acceptsType:["string"],returnsType:["string"],description:"Parses the value as Markdown and returns the HTML.",docLink:"https://statamic.dev/modifiers/markdown",parameters:[],canBeParameter:!1},{name:"nl2br",acceptsType:["string"],returnsType:["string"],description:"Replaces line breaks with HTML `
` tags.",docLink:"https://statamic.dev/modifiers/nl2br",parameters:[],canBeParameter:!1},{name:"obfuscate",acceptsType:["string"],returnsType:["string"],description:"Modifies the input string by replacing it with special characters, making it harder for bots but remains readable to site visitors.",docLink:"https://statamic.dev/modifiers/obfuscate",parameters:[],canBeParameter:!1},{name:"obfuscate_email",acceptsType:["string"],returnsType:["string"],description:"Obfuscates an email address with special HTML characters.",docLink:"https://statamic.dev/modifiers/obfuscate_email",parameters:[],canBeParameter:!1},{name:"strip_tags",acceptsType:["string"],returnsType:["string"],description:"Removes HTML tags from the string.",docLink:"https://statamic.dev/modifiers/strip_tags",parameters:[{name:"tags",description:"The HTML tag(s) to remove from the string."}],canBeParameter:!1},{name:"table",acceptsType:["array"],returnsType:["string"],description:"Turns a [Table FieldType](https://statamic.dev/fieldtypes/table) array into an HTML table.",docLink:"https://statamic.dev/modifiers/table",parameters:[{name:"content_markdown",description:"Whether to parse cell contents as Markdown."}],canBeParameter:!1},{name:"textile",acceptsType:["string"],returnsType:["string"],description:"Parses a string with [Textile](http://demo.textilewiki.com/theme-default/) and returns the HTML.",docLink:"https://statamic.dev/modifiers/textile",parameters:[],canBeParameter:!1},{name:"wrap",acceptsType:["string"],returnsType:["string"],description:"Wraps a string with a given HTML tag.",docLink:"https://statamic.dev/modifiers/wrap",parameters:[{name:"expression",description:"The HTML tag or Emmet-style expression to wrap the value in."}],canBeParameter:!1}];var ug=[{name:"add",acceptsType:["number"],returnsType:["number"],description:"Adds two values together.",docLink:"https://statamic.dev/modifiers/add",parameters:[{name:"value",description:"The value to add."}],canBeParameter:!0},{name:"+",acceptsType:["number"],returnsType:["number"],description:"Adds two values together.",docLink:"https://statamic.dev/modifiers/add",parameters:[{name:"value",description:"The value to add."}],canBeParameter:!1},{name:"ceil",acceptsType:["number"],returnsType:["number"],description:"Rounds the value to the next whole number.",docLink:"https://statamic.dev/modifiers/ceil",parameters:[],canBeParameter:!1},{name:"divide",acceptsType:["number"],returnsType:["number"],description:"Divides two values.",docLink:"https://statamic.dev/modifiers/divide",parameters:[{name:"value",description:"The value to divide."}],canBeParameter:!0},{name:"floor",acceptsType:["number"],returnsType:["number"],description:"Rounds a number down to the next whole number.",docLink:"https://statamic.dev/modifiers/floor",parameters:[],canBeParameter:!0},{name:"format_number",acceptsType:["number"],returnsType:["string"],description:"Formats a number.",docLink:"https://statamic.dev/modifiers/format_number",parameters:[{name:"precision",description:"Number of decimal places before rounding."},{name:"decimal_separator",description:"The decimal separator (defaults to `.`)."},{name:"thousands_separator",description:"The thousands separator (default `,`)."}],canBeParameter:!0},{name:"mode",acceptsType:["number"],returnsType:["number"],description:"",docLink:"",parameters:[],canBeParameter:!0},{name:"multiply",acceptsType:["number"],returnsType:["number"],description:"Multiplies two values.",docLink:"https://statamic.dev/modifiers/multiply",parameters:[{name:"value",description:"The value to multiply."}],canBeParameter:!0},{name:"*",acceptsType:["number"],returnsType:["number"],description:"Multiplies two values.",docLink:"https://statamic.dev/modifiers/multiply",parameters:[{name:"value",description:"The value to multiply."}],canBeParameter:!1},{name:"round",acceptsType:["number"],returnsType:["number"],description:"Rounds a number to a specified precision.",docLink:"https://statamic.dev/modifiers/round",parameters:[{name:"precision",description:"The number of digits after the decimal point."}],canBeParameter:!0},{name:"subtract",acceptsType:["number"],returnsType:["number"],description:"Subtracts two values.",docLink:"https://statamic.dev/modifiers/subtract",parameters:[{name:"value",description:"The value to subtract."}],canBeParameter:!0},{name:"-",acceptsType:["number"],returnsType:["number"],description:"Subtracts two values.",docLink:"https://statamic.dev/modifiers/subtract",parameters:[{name:"value",description:"The value to subtract."}],canBeParameter:!1}];var cg=[{name:"partial",acceptsType:["*"],returnsType:["*view*"],description:"Injects data into a partial and renders it.",docLink:"https://statamic.dev/modifiers/partial",parameters:[{name:"partial",description:"The name of the partial."}],canBeParameter:!1},{name:"macro",acceptsType:["*"],returnsType:["*"],description:"Runs a pre-configured macro on the data.",docLink:"https://statamic.dev/modifiers/macro",parameters:[{name:"macro",description:"The macro name."}],canBeParameter:!1},{name:"url",acceptsType:["string","*"],returnsType:["string"],description:"Locates the URL of an asset, page, entry, or taxonomy term based on the variable contents.",docLink:"https://statamic.dev/modifiers/url",parameters:[],canBeParameter:!1}];var fg=[{name:"ascii",acceptsType:["string"],returnsType:["string"],description:"Replaces all non-ASCII characters with their closest ASCII counterparts.",docLink:"https://statamic.dev/modifiers/ascii",parameters:[],canBeParameter:!1},{name:"at",acceptsType:["string"],returnsType:["string"],description:"Returns the character at a given zero-based position.",docLink:"https://statamic.dev/modifiers/at",parameters:[{name:"position",description:"The zero-based position to retrieve a character from."}],canBeParameter:!0},{name:"backspace",acceptsType:["string"],returnsType:["string"],description:"Removes a specified number of characters from the end of a string.",docLink:"https://statamic.dev/modifiers/backspace",parameters:[{name:"character_count",description:"The number of characters to remove from the end of the string."}],canBeParameter:!0},{name:"camelize",acceptsType:["string"],returnsType:["string"],description:"Converts the string into camelCase.",docLink:"https://statamic.dev/modifiers/camelize",parameters:[],canBeParameter:!1},{name:"cdata",acceptsType:["string"],returnsType:["string"],description:"Wraps the string in CDATA XML tags.",docLink:"https://statamic.dev/modifiers/cdata",parameters:[],canBeParameter:!1},{name:"collapse_whitespace",acceptsType:["string"],returnsType:["string"],description:"Trims a string and replaces consecutive whitespace characters with a single space.",docLink:"https://statamic.dev/modifiers/collapse_whitespace",parameters:[],canBeParameter:!1},{name:"count_substring",acceptsType:["string"],returnsType:["number"],description:"Counts the number of occurrences of a term within the string.",docLink:"https://statamic.dev/modifiers/count_substring",parameters:[{name:"term",description:"The sub-string to search for"}],canBeParameter:!0},{name:"dashify",acceptsType:["string"],returnsType:["string"],description:"Returns a lower-cased and trimmed string, separated by dashes.",docLink:"https://statamic.dev/modifiers/dashify",parameters:[],canBeParameter:!1},{name:"deslugify",acceptsType:["string"],returnsType:["string"],description:"Replaces all hyphens and underscores with spaces.",docLink:"https://statamic.dev/modifiers/deslugify",parameters:[],canBeParameter:!1},{name:"embed_url",acceptsType:["string"],returnsType:["string"],description:"Converts a YouTube or Viemo link into their embed URLs.",docLink:"https://statamic.dev/modifiers/embed_url",parameters:[],canBeParameter:!1},{name:"trackable_embed_url",acceptsType:["string"],returnsType:["string"],description:"Get the embed URL when given a youtube or vimeo link that's direct to the page.",docLink:null,parameters:[],canBeParameter:!1},{name:"ensure_left",acceptsType:["string"],returnsType:["string"],description:"Ensures that the string begins with the specified string.",docLink:"https://statamic.dev/modifiers/ensure_left",parameters:[{name:"start_string",description:"The value that should be at the start of the string."}],canBeParameter:!0},{name:"ensure_right",acceptsType:["string"],returnsType:["string"],description:"Ensures that the string ends with the specified string.",docLink:"https://statamic.dev/modifiers/ensure_right",parameters:[{name:"end_string",description:"The value that should be at the end of the string."}],canBeParameter:!0},{name:"entities",acceptsType:["string"],returnsType:["string"],description:"Encode a string with HTML entities.",docLink:"https://statamic.dev/modifiers/entities",parameters:[],canBeParameter:!1},{name:"excerpt",acceptsType:["string"],returnsType:["string"],description:"Breaks a string at a given marker.",docLink:"https://statamic.dev/modifiers/excerpt",parameters:[{name:"marker",description:"The string to break by."}],canBeParameter:!1},{name:"explode",acceptsType:["string"],returnsType:["array"],description:"Breaks a string into an array of strings.",docLink:"https://statamic.dev/modifiers/explode",parameters:[{name:"delimiter",description:"The string to split the larger string by."}],canBeParameter:!0},{name:"gravatar",acceptsType:["string"],returnsType:["string"],description:"Converts an email string to a Gravatar image URL.",docLink:"https://statamic.dev/modifiers/gravatar",parameters:[{name:"image size",description:"The desired image size."}],canBeParameter:!0},{name:"insert",acceptsType:["string"],returnsType:["string"],description:"Inserts a string at the position provided.",docLink:"https://statamic.dev/modifiers/insert",parameters:[{name:"value",description:"The value to insert."},{name:"position",description:"The zero based position to insert the text at."}],canBeParameter:!0},{name:"is_email",acceptsType:["string"],returnsType:["boolean"],description:"Returns true if the string is a valid email address.",docLink:"https://statamic.dev/modifiers/is_email",parameters:[],canBeParameter:!1},{name:"is_embeddable",acceptsType:["string"],returnsType:["boolean"],description:"Checks to see if a video URL is embeddable.",docLink:"https://statamic.dev/modifiers/is_embeddable",parameters:[],canBeParameter:!1},{name:"is_lowercase",acceptsType:["string"],returnsType:["boolean"],description:"Returns true if the string contains only lowercase characters.",docLink:"https://statamic.dev/modifiers/is_lowercase",parameters:[],canBeParameter:!1},{name:"is_url",acceptsType:["string"],returnsType:["boolean"],description:"Returns true if a string is a valid URL.",docLink:"https://statamic.dev/modifiers/is_url",parameters:[],canBeParameter:!1},{name:"lcfirst",acceptsType:["string"],returnsType:["string"],description:"Converts the first character of the value to lower case.",docLink:"https://statamic.dev/modifiers/lcfirst",parameters:[],canBeParameter:!1},{name:"length",acceptsType:["string"],returnsType:["number"],description:"Returns the number of items in an array or number of characters in a string.",docLink:"https://statamic.dev/modifiers/length",parameters:[],canBeParameter:!1},{name:"lower",acceptsType:["string"],returnsType:["string"],description:"Converts all characters to lowercase.",docLink:"https://statamic.dev/modifiers/lower",parameters:[],canBeParameter:!1},{name:"md5",acceptsType:["string"],returnsType:["string"],description:"Creates an MD5 hash of the variable.",docLink:"https://statamic.dev/modifiers/md5",parameters:[],canBeParameter:!1},{name:"rawurlencode",acceptsType:["string"],returnsType:["string"],description:"URL-encode a variable according to RFC-3986.",docLink:"https://statamic.dev/modifiers/rawurlencode",parameters:[],canBeParameter:!1},{name:"read_time",acceptsType:["string"],returnsType:["string"],description:"Returns an estimated read time, in minutes.",docLink:"https://statamic.dev/modifiers/read_time",parameters:[{name:"words per minute",description:"The words per minute to use as an estimate."}],canBeParameter:!0},{name:"regex_replace",acceptsType:["string"],returnsType:["string"],description:"Replaces all regex matches with a string.",docLink:"https://statamic.dev/modifiers/regex_replace",parameters:[{name:"pattern",description:"The regex pattern."},{name:"replace",description:"The replacement value."}],canBeParameter:!0},{name:"remove_left",acceptsType:["string"],returnsType:["string"],description:"Ensures that the string never begins with a specified string.",docLink:"https://statamic.dev/modifiers/remove_left/",parameters:[{name:"value",description:"The value to remove."}],canBeParameter:!0},{name:"remove_right",acceptsType:["string"],returnsType:["string"],description:"Ensures that a string never ends with a specified string.",docLink:"https://statamic.dev/modifiers/remove_right",parameters:[{name:"value",description:"The value to remove."}],canBeParameter:!0},{name:"replace",acceptsType:["string"],returnsType:["string"],description:"Replaces all occurrences of a string with a different value.",docLink:"https://statamic.dev/modifiers/replace",parameters:[{name:"needle",description:"The string to search for."},{name:"value",description:"The value to replace all occurrences with."}],canBeParameter:!0},{name:"reverse",acceptsType:["string","array"],returnsType:["string","array"],description:"Reverses all characters in a string, or all items in an array.",docLink:"https://statamic.dev/modifiers/reverse",parameters:[],canBeParameter:!1},{name:"safe_truncate",acceptsType:["string"],returnsType:["string"],description:"Truncates a string to a given length.",docLink:"https://statamic.dev/modifiers/safe_truncate",parameters:[{name:"length",description:"The desired string length."},{name:"suffix",description:"An optional suffix to append to the string if truncation occurs."}],canBeParameter:!1},{name:"sanitize",acceptsType:["string"],returnsType:["string"],description:"Converts special characters to HTML entities.",docLink:"https://statamic.dev/modifiers/sanitize",parameters:[],canBeParameter:!1},{name:"segment",acceptsType:["string"],returnsType:["string"],description:"Returns a segment by number from any valid URL or URI.",docLink:"https://statamic.dev/modifiers/segment",parameters:[{name:"segment",description:"The one-based segment to return."}],canBeParameter:!0},{name:"singular",acceptsType:["string"],returnsType:["string"],description:"Returns the singular form of an English word.",docLink:"https://statamic.dev/modifiers/singular",parameters:[],canBeParameter:!1},{name:"slugify",acceptsType:["string"],returnsType:["string"],description:"Converts the string into an URL slug.",docLink:"https://statamic.dev/modifiers/slugify",parameters:[],canBeParameter:!1},{name:"smartypants",acceptsType:["string"],returnsType:["string"],description:"Translates plain ASCII punctuation characters into typographic punctuation HTML entities.",docLink:"https://statamic.dev/modifiers/smartypants",parameters:[],canBeParameter:!1},{name:"spaceless",acceptsType:["string"],returnsType:["string"],description:"Removes excess whitespace and line breaks from a string.",docLink:"https://statamic.dev/modifiers/spaceless",parameters:[],canBeParameter:!1},{name:"substr",acceptsType:["string"],returnsType:["string"],description:"Returns a portion of a string based on provided a start index, and optional length.",docLink:"https://statamic.dev/modifiers/substr",parameters:[{name:"start",description:"The 0-based index to start searching."},{name:"length",description:"An optional length for the string to find."}],canBeParameter:!1},{name:"surround",acceptsType:["string"],returnsType:["string"],description:"Surrounds a string with another string.",docLink:"https://statamic.dev/modifiers/surround",parameters:[{name:"value",description:"The value to surround the string with."}],canBeParameter:!1},{name:"swap_case",acceptsType:["string"],returnsType:["string"],description:"Returns a case swapped version of the string.",docLink:"https://statamic.dev/modifiers/swap_case",parameters:[],canBeParameter:!1},{name:"tidy",acceptsType:["string"],returnsType:["string"],description:"Returns a string with smart quotes, ellipsis characters, and dashes from Windows-1252 replaced by ASCII equivalents.",docLink:"https://statamic.dev/modifiers/tidy",parameters:[],canBeParameter:!1},{name:"title",acceptsType:["string"],returnsType:["string"],description:"Returns a Title Cased version of the string.",docLink:"https://statamic.dev/modifiers/title",parameters:[],canBeParameter:!1},{name:"trim",acceptsType:["string"],returnsType:["string"],description:"Removes whitespace from the start and end of the string.",docLink:"https://statamic.dev/modifiers/trim",parameters:[],canBeParameter:!1},{name:"truncate",acceptsType:["string"],returnsType:["string"],description:"Truncates a string to a given length.",docLink:"https://statamic.dev/modifiers/truncate",parameters:[{name:"length",description:"The maximum string length."},{name:"suffix",description:"An optional suffix to append to the string if truncation occurs."}],canBeParameter:!1},{name:"ucfirst",acceptsType:["string"],returnsType:["string"],description:"Upper cases the first character in the string.",docLink:"https://statamic.dev/modifiers/ucfirst",parameters:[],canBeParameter:!1},{name:"underscored",acceptsType:["string"],returnsType:["string"],description:"Returns a lower-cased and trimmed version of the string, separated by underscores.",docLink:"https://statamic.dev/modifiers/underscored",parameters:[],canBeParameter:!1},{name:"upper",acceptsType:["string"],returnsType:["string"],description:"Transforms the string to uppercase.",docLink:"https://statamic.dev/modifiers/upper",parameters:[],canBeParameter:!1},{name:"urldecode",acceptsType:["string"],returnsType:["string"],description:"URL-decodes the string.",docLink:"https://statamic.dev/modifiers/urldecode",parameters:[],canBeParameter:!1},{name:"urlencode",acceptsType:["string"],returnsType:["string"],description:"URL-encodes the string.",docLink:"https://statamic.dev/modifiers/urlencode",parameters:[],canBeParameter:!1},{name:"widont",acceptsType:["string"],returnsType:["string"],description:"Attempts to prevent lines with single words.",docLink:"https://statamic.dev/modifiers/widont",parameters:[],canBeParameter:!1},{name:"word_count",acceptsType:["string"],returnsType:["number"],description:"Returns the number of words in the string.",docLink:"https://statamic.dev/modifiers/word_count",parameters:[],canBeParameter:!1},{name:"add_slashes",acceptsType:["string"],returnsType:["string"],description:"Adds slashes before characters that need to be escaped.",docLink:"https://statamic.dev/modifiers/add_slashes",canBeParameter:!1,parameters:[]}];var pg=[{name:"console_log",acceptsType:["*"],returnsType:["null"],description:"Displays variable data in the browser's JavaScript console.",docLink:"https://statamic.dev/modifiers/console_log",parameters:[],canBeParameter:!1},{name:"decode",acceptsType:["string"],returnsType:["string"],description:"Converts all HTML entities to their applicable character codes.",docLink:"https://statamic.dev/modifiers/decode",parameters:[],canBeParameter:!1},{name:"dump",acceptsType:["*"],returnsType:["null"],description:"Displays variable data in the browser.",docLink:"https://statamic.dev/modifiers/dump",parameters:[],canBeParameter:!1},{name:"full_urls",acceptsType:["string"],returnsType:["string"],description:"Replaces root-relative URLs with absolute URLs.",docLink:"https://statamic.dev/modifiers/full_urls",parameters:[],canBeParameter:!1},{name:"repeat",acceptsType:["string"],returnsType:["string"],description:"Repeats a value a given number of times.",docLink:"https://statamic.dev/modifiers/repeat",parameters:[{name:"repeat_count",description:"The number of times to repeat the value."}],canBeParameter:!0},{name:"to_spaces",acceptsType:["string"],returnsType:["string"],description:"Converts all tabs to spaces.",docLink:"https://statamic.dev/modifiers/to_spaces",parameters:[{name:"space_count",description:"The number of spaces to replace tabs with."}],canBeParameter:!1},{name:"to_tabs",acceptsType:["string"],returnsType:["string"],description:"Converts spaces to tabs.",docLink:"https://statamic.dev/modifiers/to_tabs",parameters:[{name:"space_count",description:"The number of spaces to convert to tabs."}],canBeParameter:!1},{name:"to_json",acceptsType:["*"],returnsType:["string"],description:"Converts the data to JSON.",docLink:"https://statamic.dev/modifiers/to_json",parameters:[],canBeParameter:!1},{name:"to_bool",acceptsType:["*"],returnsType:["boolean"],description:"Converst the data to a boolean",parameters:[],canBeParameter:!1,docLink:null}];var zi=class{constructor(){this.registeredModifiers=new Map;this.acceptTypedModifierReference=new Map;this.returnTypeModifierReference=new Map;this.macros=new Map;this.modifierNameCache=[]}reset(){this.modifierNameCache=[],this.registeredModifiers.clear(),this.acceptTypedModifierReference.clear(),this.returnTypeModifierReference.clear()}getRegisteredModifiers(){return this.registeredModifiers}resetMacros(){this.macros.clear()}loadCoreModifiers(){this.registerModifiers(ig),this.registerModifiers(sg),this.registerModifiers(ag),this.registerModifiers(og),this.registerModifiers(lg),this.registerModifiers(ug),this.registerModifiers(pg),this.registerModifiers(fg),this.registerModifiers(cg)}getModifierNames(){return this.modifierNameCache}registerMacro(e){this.macros.set(e.name,e)}registerMacros(e){for(let n=0;n0)for(let r=0;r0?i.valueNodes[0].content:""}if(this.hasParameterModifiers())for(let r=0;r0)for(let r=0;r0?{start:i.startPosition,end:i.endPosition}:null}if(this.hasParameterModifiers())for(let r=0;r0&&this.node.modifierChain.lastManifestedModifier!=null){if(this.node.modifierChain.lastManifestedModifier.parameters.length>0&&this.node.modifierChain.lastManifestedModifier.modifier!=null&&xt.instance!=null){let e=this.node.modifierChain.lastManifestedModifier.modifier;return xt.instance.getProbableReturnType(e,this.isPaired())}return"*"}if(this.parameterModifiers.length>0){let e=this.parameterModifiers.reverse();for(let n=0;n0&&this.node.modifierChain.lastManifestedModifier!=null)return this.node.modifierChain.lastManifestedModifier.parameters.length>0?this.node.modifierChain.lastManifestedModifier.parameters[0].value:"";if(this.parameterModifiers.length>0){let e=this.parameterModifiers.reverse();for(let n=0;n0&&this.node.modifierChain.lastModifier!=null)return this.node.modifierChain.lastModifier;if(this.parameterModifiers.length>0){let e=this.parameterModifiers.reverse();for(let n=0;n0:!0}hasParameterModifiers(){return this.parameterModifiers.length>0}hasShorthandModifiers(){return this.node.modifierChain!=null&&this.node.modifierChain.modifierChain.length>0}hasModifier(e){return this.modifierNames.includes(e)}};function Wf(t){let e=[];return t.forEach(n=>{n instanceof z?e.push(n):n instanceof Nn&&n.logicBranches.length>0&&n.logicBranches.forEach(r=>{if(r.head!=null){let i=r.head;i.originalNode!=null?e.push(i.originalNode):e.push(i)}})}),e}var dS=[" ",` +`,"\r"," ","\f","\v","\xA0","\u2000","\u2001","\u2002","\u2003","\u2004","\u2005","\u2006","\u2007","\u2008","\u2009","\u200A","\u200B","\u2028","\u2029","\u3000"].join("");function dg(t){return(typeof t=="number"||typeof t=="string"&&dS.indexOf(t.slice(-1))===-1)&&t!==""&&!isNaN(t)}var Z=class{static normalizeLineEndings(e,n=` `){return e.replace(/\r?\n/g,n)}static breakByNewLine(e){return e.replace(/(\r\n|\n|\r)/gm,` `).split(` -`)}static split(e){return e.split("")}static substring(e,n,r){return e.substr(n,r)}static ctypeSpace(e){return(e==null?void 0:e.search(/^[\f\n\r\t\v ]+$/g))!==-1}static ctypeAlpha(e){return(e==null?void 0:e.search(/^[A-Za-z]+$/g))!==-1}static ctypeDigit(e){return(e==null?void 0:e.search(/^[\d]+$/g))!==-1}static ctypePunct(e){return(e==null?void 0:e.search(/^[\u0021-\u002F\u003A-\u0040\u005B-\u0060\u007B-\u007E]+$/g))!==-1}static trimLeft(e,n="\\s"){return e.replace(new RegExp("^["+n+"]+"),"")}static trimRight(e,n="\\s"){return e.replace(new RegExp("["+n+"]+$"),"")}static isNumeric(e){return dg(e)}static substringCount(e,n){let r=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return(e.match(new RegExp(r,"gi"))||[]).length}static getLastLine(e){let n=Z.breakByNewLine(e);return n.length==0?"":n[n.length-1]}static getFirstLine(e){let n=Z.breakByNewLine(e);return n.length==0?"":n[0]}};var Gf=class{constructor(e){this.node=e}findParentWithName(e){let n=this.node.getParser();return n==null?null:n.structure.findParentWithName(e,this.node)}};var mg=je(uu());var W=class{constructor(){this.node=null;this.errorCode="";this.message="";this.level=0;this.range=null}hash(){var n,r,i,s;let e="";return this.node!=null&&(e=((r=(n=this.node.endPosition)==null?void 0:n.offset)!=null?r:0).toString()+"|"+((s=(i=this.node.startPosition)==null?void 0:i.offset)!=null?s:0).toString()+"|"),mg.Md5.hashStr(e+"|"+this.errorCode)}static makeSyntaxError(e,n,r,i){i==null&&(i=0);let s=new W;return s.errorCode=e,s.node=n,s.message=r,s.level=i,s}};var A=class{};A.TYPE_EXPECTING_OPERAND="ANTLR_001",A.TYPE_UNEXPECTED_END_OF_INPUT="ANTLR_002",A.TYPE_RUNTIME_TYPE_MISMATCH="ANTLR_003",A.TYPE_RUNTIME_DIVIDE_BY_ZERO="ANTLR_004",A.TYPE_RUNTIME_UNKNOWN_LANG_OPERATOR="ANTLR_005",A.TYPE_RUNTIME_UNEXPECTED_STACK_CONDITION="ANTLR_006",A.TYPE_RUNTIME_PARSE_VALUE_VIOLATION="ANTLR_007",A.TYPE_PARSE_UNCLOSED_CONDITIONAL="ANTLR_008",A.TYPE_PARSE_EMPTY_CONDITIONAL="ANTLR_009",A.TYPE_PARSE_UNPAIRED_CONDITIONAL="ANTLR_008",A.TYPE_ILLEGAL_STRING_ESCAPE_SEQUENCE="ANTLR_009",A.TYPE_INCOMPLETE_ANTLERS_REGION="ANTLR_010",A.TYPE_INCOMPLETE_ANTELRS_COMMENT_REGION="ANTLR_011",A.TYPE_ILLEGAL_VARPATH_RIGHT="ANTLR_012",A.TYPE_ILLEGAL_DOTVARPATH_RIGHT="ANTLR_013",A.TYPE_ILLEGAL_VARPATH_SUBPATH_START="ANTLR_014",A.TYPE_ILLEGAL_VARPATH_SPACE_RIGHT="ANTLR_015",A.TYPE_UNEXPECTED_EOI_VARPATH_ACCESSOR="ANTLR_016",A.TYPE_ILLEGAL_VARIABLE_NAME="ANTLR_017",A.TYPE_UNSET_MODIFIER_DETAILS="ANTLR_018",A.TYPE_MODIFIER_NAME_NOT_START_OF_DETAILS="ANTLR_019",A.TYPE_MODIFIER_UNEXPECTED_VALUE="ANTLR_020",A.TYPE_MODIFIER_UNEXPECTED_END_OF_VALUE_LIST="ANTLR_021",A.TYPE_TERNARY_EXPECTING_BRANCH_SEPARATOR="ANTLR_022",A.TYPE_TERNARY_UNEXPECTED_EXPRESSION_LENGTH="ANTLR_023",A.TYPE_RECURSIVE_UNPAIRED_NODE="ANTLR_024",A.TYPE_RECURSIVE_NODE_INVALID_POSITION="ANTLR_025",A.TYPE_NO_PARSE_UNASSOCIATED="ANTLR_026",A.TYPE_RECURSIVE_NODE_UNASSOCIATED_PARENT="ANTLR_027",A.TYPE_LOGIC_GROUP_NO_END="ANTLR_028",A.TYPE_LOGIC_GROUP_NO_START="ANTLR_029",A.TYPE_UNEXPECTED_BRANCH_SEPARATOR="ANTLR_030",A.TYPE_UNEXPECTED_BRANCH_SEPARATOR_FOR_VARCOMBINE="ANTLR_031",A.TYPE_UNEXPECTED_MODIFIER_SEPARATOR="ANTLR_032",A.TYPE_UNEXPECTED_EOI_WHILE_PARSING_MODIFIER_DETAILS="ANTLR_033",A.TYPE_UNEXPECTED_EOI_WHILE_PARSING_MODIFIER_VALUE="ANTLR_034",A.TYPE_UNEXPECTED_EOI_WHILE_PARSING_NODE_PARAMETER="ANTLR_035",A.TYPE_UNEXPECTED_EOI_WHILE_MANIFESTING_ANTLERS_NODE="ANTLR_036",A.TYPE_UNEXPECTED_EOI_WHILE_REDUCING_NEGATION_OPERATORS="ANTLR_037",A.TYPE_UNEXPECTED_EOI_WHILE_PARSING_SEMANTIC_GROUP="ANTLR_038",A.TYPE_UNEXPECTED_EOI_WHILE_PARSING_NULL_COALESCENCE_GROUP="ANTLR_039",A.TYPE_UNEXPECTED_EOI_WHILE_PARSING_TERNARY_GROUP="ANTLR_040",A.TYPE_UNEXPECTED_EOI_WHILE_PARSING_TERNARY_GROUP_FALSE_BRANCH="ANTLR_041",A.TYPE_UNEXPECTED_EOI_WHILE_EXITING_TERNARY_GROUP="ANTLR_042",A.TYPE_UNEXPECTED_EOI_WHILE_PARSING_LOGIC_GROUP_NEGATION_OFFSET="ANTLR_043",A.TYPE_UNEXPECTED_EOI_WHILE_PARSING_LOGIC_GROUP_END_DUE_TO_NEGATION="ANTLR_044",A.TYPE_UNEXPECTED_EOI_WHILE_PARSING_LOGIC_GROUP_END="ANTLR_045",A.TYPE_RUNTIME_UNKNOWN_LIBRARY="ANTLR_046",A.TYPE_RUNTIME_LIBRARY_BAD_METHOD_CALL="ANTLR_047",A.TYPE_UNEXPECTED_FACTORIAL_WHILE_CREATING_GROUPS="ANTLR_048",A.TYPE_UNEXPECTED_FACTORIAL_OPERAND="ANTLR_049",A.TYPE_UNEXPECTED_LOGIC_NEGATION_OPERATOR="ANTLR_050",A.TYPE_FACTORIAL_MATERIALIZED_BOOL_DETECTED="ANTLR_051",A.TYPE_ARG_UNEXPECTED_NAMED_ARGUMENT="ANTLR_052",A.TYPE_UNEXPECTED_EOI_PARSING_BRANCH_GROUP="ANTLR_053",A.TYPE_UNEXPECTED_UNNAMED_METHOD_ARGUMENT="ANTLR_054",A.TYPE_LIBRARY_CALL_NO_ARGS_PROVIDED="ANTLR_055",A.TYPE_LIBRARY_CALL_MISSING_REQUIRED_FORMAL_ARG="ANTLR_056",A.TYPE_LIBRARY_CALL_RUNTIME_TYPE_MISMATCH="ANTLR_057",A.TYPE_LIBRARY_CALL_UNEXPECTED_ARG_RESOLVE_FAULT="ANTLR_058",A.TYPE_LIBRARY_CALL_TOO_MANY_ARGUMENTS="ANTLR_059",A.TYPE_UNEXPECTED_TOKEN_WHILE_PARSING_METHOD="ANTLR_060",A.TYPE_INVALID_NAMED_ARG_IDENTIFIER="ANTLR_061",A.TYPE_LIBRARY_CALL_INVALID_ARGUMENT_NAME="ANTLR_062",A.TYPE_RUNTIME_ATTEMPT_TO_OVERWRITE_LOADED_LIBRARY="ANTLR_063",A.TYPE_UNEXPECTED_EOI_WHILE_PARSING_ARG_GROUP="ANTLR_064",A.TYPE_EXPECTING_ARGUMENT_GROUP="ANTLR_065",A.TYPE_RUNTIME_PROTECTED_LIBRARY_ACCESS_VIOLATION="ANTLR_066",A.TYPE_RUNTIME_FATAL_UNPAIRED_LOOP_END="ANTLR_067",A.TYPE_UNEXPECTED_OPERATOR="ANTLR_068",A.TYPE_OPERATOR_INVALID_ON_RIGHT="ANTLR_069",A.TYPE_INVALID_ASSIGNMENT_LOOP_PAIR="ANTLR_070",A.TYPE_UNEXPECTED_EOI_PARSING_ORDER_GROUP="ANTLR_071",A.TYPE_EXPECTING_ORDER_GROUP_FOR_ORDER_BY_OPERAND="ANTLR_072",A.TYPE_QUERY_UNSUPPORTED_VALUE_TYPE="ANTLR_073",A.TYPE_UNEXPECTED_RUNTIME_RESULT_FOR_ORDER_BY_CLAUSE="ANTLR_074",A.TYPE_UNEXPECTED_EMPTY_DIRECTION_GROUP="ANTLR_075",A.TYPE_INVALID_ORDER_BY_NAME_VALUE="ANTLR_076",A.TYPE_INVALID_ORDER_BY_SORT_VALUE="ANTLR_077",A.TYPE_UNEXPECTED_TOKEN_FOR_GROUP_BY="ANTLR_78",A.TYPE_UNEXPECTED_EOI_WHILE_PARSING_GROUP_BY="ANTLR_079",A.TYPE_UNEXPECTED_GROUP_BY_AS_ALIAS_TYPE="ANTLR_080",A.TYPE_UNEXPECTED_EOI_WHILE_PARSING_SWITCH_GROUP="ANTLR_081",A.TYPE_UNEXPECTED_TOKEN_FOR_SWITCH_GROUP="ANTLR_082",A.TYPE_UNEXPECTED_SWITCH_START_VALUE="ANTLR_083",A.TYPE_UNEXPECTED_SWITCH_START_VALUE_NO_VALUE="ANTLR_084",A.TYPE_UNEXPECTED_SWITCH_START_VALUE_NO_SEMANTIC_VALUE="ANTLR_085",A.TYPE_SWITCH_DEFAULT_MUST_BE_LAST="ANTLR_086",A.TYPE_PARSER_INVALID_SWITCH_TOKEN="ANTLR_087",A.TYPE_ORDER_BY_INVALID_RETURN_TYPE="ANTLR_088",A.TYPE_GROUP_BY_SCOPED_GROUP_MUST_BE_ENCLOSED="ANTLR_089",A.TYPE_PLUCK_INTO_MISSING_VARIABLE_TARGET="ANTLR_090",A.TYPE_PLUCK_INTO_INVALID_VARIABLE_TARGET="ANTLR_091",A.TYPE_PLUCK_INTO_NO_PREDICATE="ANTLR_092",A.TYPE_PLUCK_INTO_INVALID_PREDICATE_VALUE="ANTLR_093",A.TYPE_PLUCK_INTO_EMPTY_LOGIC_GROUP="ANTLR_094",A.TYPE_PLUCK_INTO_INVALID_NUMBER_OF_TUPLE_VARIABLES="ANTLR_095",A.TYPE_PLUCK_INTO_UNKNOWN_ALIAS_VARNAME="ANTLR_096",A.TYPE_PLUCK_INTO_UNEXPECTED_EMPTY_T_LOGIC_GROUP="ANTLR_097",A.TYPE_PLUCK_INTO_REFERENCE_TYPE_DYNAMIC="ANTLR_098",A.TYPE_PLUCK_INTO_REFERENCE_AMBIGUOUS="ANTLR_099",A.TYPE_RUNTIME_ASSIGNMENT_TO_NON_VAR="ANTLR_100",A.TYPE_ARR_MAKE_MISSING_TARGET="ANTLR_101",A.TYPE_ARR_MAKE_UNEXPECTED_TYPE="ANTLR_102",A.TYPE_ARR_MAKE_MISSING_ARR_KEY_PAIR_VALUE="ANTLR_103",A.TYPE_ARR_KEY_PAIR_INVALID_KEY_TYPE="ANTLR_104",A.TYPE_ARR_UNEXPECT_ARG_SEPARATOR="ANTLR_105",A.TYPE_ARR_KEY_PAIR_MISSING_KEY="ANTLR_106",A.RUNTIME_PROTECTED_VAR_ACCESS="ANTLR_107",A.RUNTIME_PROTECTED_TAG_ACCESS="ANTLR_108",A.RUNTIME_PROTECTED_MODIFIER_ACCESS="ANTLR_109",A.TYPE_INCOMPLETE_PHP_EVALUATION_REGION="ANTLR_110",A.RUNTIME_PHP_NODE_WHEN_PHP_DISABLED="ANTLR_111",A.RUNTIME_PHP_NODE_USER_CONTENT_TAG="ANTLR_112",A.TYPE_UNEXPECTED_TYPE_FOR_TUPLE_LIST="ANTLR_113",A.TYPE_UNEXPECTED_EOI_PARSING_TUPLE_LIST="ANTLR_114",A.TYPE_MISSING_BODY_TUPLE_LIST="ANTLR_115",A.TYPE_MISSING_NAMES_TUPLE_LIST="ANTLR_116",A.TYPE_VALUE_NAME_LENGTH_MISMATCH_TUPLE_LIST="ANTLR_117",A.TYPE_INVALID_TUPLE_LIST_NAME_TYPE="ANTLR_118",A.TYPE_INVALID_MANIFESTED_NAME_GROUP="ANTLR_119",A.TYPE_INVALID_TUPLE_LIST_VALUE_TYPE_GROUP="ANTLR_120",A.TYPE_INVALID_TUPLE_LIST_VALUE_TYPE="ANTLR_121",A.TYPE_RUNTIME_BAD_METHOD_CALL="ANTLR_122",A.TYPE_METHOD_CALL_MISSING_ARG_GROUP="ANTLR_123",A.TYPE_INVALID_METHOD_CALL_ARG_GROUP="ANTLR_124",A.TYPE_METHOD_CALL_MISSING_METHOD="ANTLR_125",A.TYPE_MODIFIER_NOT_FOUND="ANTLR_126",A.TYPE_RUNTIME_GENERAL_FAULT="ANTLR_127",A.TYPE_MODIFIER_INCORRECT_VALUE_POSITION="ANTLR_128",A.TYPE_MODIFIER_UNEXPECTED_TOKEN_METHOD_SYNTAX="ANTLR_129",A.TYPE_RUNTIME_ATTEMPTING_TO_RENDER_OBJECT_AS_STRING="ANTLR_130",A.TYPE_UNPAIRED_CLOSING_TAG="ANTLR_131",A.PARSER_CANNOT_PARSE_PATH_RECURSIVE="ANTLR_200",A.PATH_STRING_NOT_INSIDE_ARRAY_ACCESSOR="ANTLR_201",A.LINT_UNKNOWN_PARAMETER="ANTLR_500",A.LINT_GENERAL_INVALID_PARAMETER_CONTENTS="ANTLR_501",A.LINT_PARAMETER_CONTENT_INVALID_INTEGER="ANTLR_502",A.LINT_PARAMETER_CONTENT_INVALID_BOOLEAN="ANT LR_503",A.LINT_PAGINATE_INVALID_VALUE="ANTLR_504",A.LINT_DEBUG_DATA_EXPOSED="ANTLR_505",A.LINT_DOUBLE_COLON_IN_TAG_IDENTIFIER="ANTLR_506",A.LINT_MIXED_MODIFIERS="ANTLR_507",A.LINT_MODIFIER_UNEXPECTED_TYPE="ANTLR_508",A.LINT_REMOVE_RELATE_TAG="ANTLR_509",A.LINT_SET_PRODUCES_RUNTIME_ERROR="ANTLR_510",A.LINT_FRONT_MATTER_EMPTY_DOCUMENT="ANTLR_511",A.LINT_SHORTHAND_MODIFIER_TAG_MUST_MATCH="ANTLR_512",A.LINT_INVALID_FRONT_MATTER="ANTLR_513",A.LINT_DUPLICATE_CODE="ANTLR_514",A.LINT_VERSION_NOT_COMPATIBLE="ANTLR_515",A.LINT_INTERLEAVED_TAG_PAIRS="ANTLR_516",A.LINT_MISSING_REQUIRED_PARAMETER="ANTLR_517",A.LINT_POSSIBLE_PARTIAL_RECURSION="ANTLR_518";var lt=class{static distance(e,n){return e.endPosition==null||n.startPosition==null?this.DistMax:n.startPosition.index-e.endPosition.index}static getTrueName(e){var n,r,i,s;return e.originalNode!=null?(r=(n=e.originalNode.name)==null?void 0:n.name)!=null?r:"":(s=(i=e.name)==null?void 0:i.name)!=null?s:""}static getSimpleVarName(e){return e.variableReference!=null&&e.variableReference.pathParts.length==1&&e.variableReference.pathParts[0]instanceof Yn?e.variableReference.pathParts[0].name:""}static isVariableMatching(e,n){return e instanceof Ne?e.name==n:!1}static mergeVarContentLeft(e,n,r){return r.mergeRefName=r.name,r.endPosition=n.endPosition,r.name=r.name+e,r}static mergeVarContentRight(e,n,r){return r.mergeRefName=r.name,r.startPosition=n.startPosition,r.name=e+r.name,r}static mergeVarRight(e,n){return n.mergeRefName=n.name,n.startPosition=e.startPosition,n.name=e.name+n.name,n}static getUnrefName(e){return Z.trimLeft(e,":.")}};lt.DistMax=65e3;var fr=class{static isConditionalStructure(e){var r,i;if(e.isComment)return!1;let n=(i=(r=e.name)==null?void 0:r.name)!=null?i:"";return n=="if"||n=="elseif"||n=="else"}static requiresClose(e){var r,i;let n=(i=(r=e.name)==null?void 0:r.name)!=null?i:"";return n=="elseif"||n=="else"?e.isClosedBy==null:!(e.isClosingTag||e.isClosedBy!=null)}static getValidClosingPairs(e){return e=="if"||e=="elseif"?fr.conditionClosingPairs:[]}static findClosestStructurePair(e,n,r){var u,c,f,h,y,p,d,g;let i=[],s=e.length,a=new Map,o=null;i.push({node:n,index:r});for(let m=0;m0;){let m=i.pop();if(m==null)continue;if(m.node._conditionParserAbandonPairing)break;let b=m.node,_=fr.getValidClosingPairs((h=(f=b.name)==null?void 0:f.name)!=null?h:""),N=m.index,C=!1;if(l>50&&o!=null){for(let[G,L]of a)if(G>N){N=G;break}}for(let G=N;G{var r,i;if(n instanceof z&&fr.isConditionalStructure(n)){let s=(i=(r=n.name)==null?void 0:r.name)!=null?i:"";if((s=="elseif"||s=="else")&&n.isOpenedBy==null){n.pushError(W.makeSyntaxError(A.TYPE_PARSE_UNPAIRED_CONDITIONAL,n,'Unpaired "'+lt.getTrueName(n)+'" control structure.'));return}if(n.isClosedBy==null&&fr.requiresClose(n)){n.pushError(W.makeSyntaxError(A.TYPE_PARSE_UNCLOSED_CONDITIONAL,n,"Unclosed "+lt.getTrueName(n)+" control structure."));return}}}),e}},Hn=fr;Hn.conditionClosingPairs=["elseif","else"];function Ei(t,e){return e==null&&(e="s"),t.replace(new RegExp("^["+e+"]+"),"")}function pr(t,e,n){return t.replace(new RegExp(e,"g"),n)}function Hf(t,e){return e==null&&(e="s"),t.replace(new RegExp("["+e+"]+$"),"")}function _a(){return(Date.now().toString(32)+Math.random().toString(16)).replace(/\./g,"")}function gg(){return pr(_a(),"-","_")}var cu=class{constructor(){this.startPosition=null;this.endPosition=null;this.index=0;this.embeddedIndex=0;this.refId=null;this.parameters=[];this.isSelfClosing=!1;this.isClosingFragment=!1;this.name="";this.containsStructures=!1;this.refId=gg()}},$f=class{constructor(){this.startPosition=null;this.endPosition=null}};function dA(t){let e=[],n=[];for(let r=0;r{n.node==null&&(n.node=this),this.antlersErrors.push(n)})}getErrors(){return this.antlersErrors}innerContent(){return this.content}rawContent(){return this.content}},Kf=class extends se{constructor(){super(...arguments);this.head=null;this.tail=null;this.nodes=[];this.documentText="";this.childDocument=null}getImmediateChildren(){return this.head==null?[]:this.head.getImmediateChildren()}},Nn=class extends se{constructor(){super(...arguments);this.logicBranches=[];this.chain=[];this.nodeContent="";this.fragment=null;this.fragmentPosition=3;this.containsAnyFragments=!1;this.containsChildStructures=!1}},z=class extends se{constructor(){super(...arguments);this.isNodeAbanonded=!1;this.isComment=!1;this.isTagNode=!1;this.isConditionNode=!1;this.runtimeContent="";this.name=null;this.pathReference=null;this.isClosingTag=!1;this.isInterpolationNode=!1;this.isOpenedBy=null;this.isClosedBy=null;this.isSelfClosing=!1;this.children=[];this.runtimeNodes=[];this.parsedRuntimeNodes=[];this.hasParsedRuntimeNodes=!1;this.parameters=[];this.hasParameters=!1;this.contentOffset=null;this.cachedContent=null;this.cachedInnerContent=null;this.hasRecursiveNode=!1;this.recursiveReference=null;this.rawStart="";this.rawEnd="";this.originalNode=null;this.interpolationRegions=new Map;this.processedInterpolationRegions=new Map;this.hasProcessedInterpolationRegions=!1;this.ref=0;this.contentStartRelativeIndex=null;this.antlersNodeIndex=0;this.nameStartsOn=null;this.nameEndsOn=null;this.nameMethodPartStartsOn=null;this.documentText="";this.nodeContent="";this.childDocument=null;this.structure=new Gf(this);this.isInlineAntlers=!1;this.mustClose=!1;this.reference=null;this._conditionParserAbandonPairing=!1;this._isEndVirtual=!1}getOriginalContent(){return this.startPosition==null||this.endPosition==null||this.parser==null?"":this.isClosedBy!=null?this.isClosedBy.startPosition==null||this.isClosedBy.endPosition==null?"":this.parser.getText(this.startPosition.index,this.isClosedBy.endPosition.index+1):this.parser.getText(this.startPosition.index,this.endPosition.index+1)}getNodeDocumentText(){return this.startPosition==null||this.endPosition==null||this.parser==null?"":this.parser.getText(this.startPosition.index,this.endPosition.index+1)}getImmediateChildren(){let e=[];for(let n=0;n0){let a=0,o=this.parameters[0];o.startPosition!=null&&(a=o.startPosition.index-1);let l=e,u=l.trimLeft(),c=l.length-u.length,f=n;e=e.substr(0,a)}let r=e.trimLeft(),i=e.length-r.length,s=n+i+2;if(this.parser!=null){let a=0;this.startPosition!=null&&(a=this.startPosition.offset),this.contentOffset==this.parser.positionFromOffset(a+s,0)}this.name!=null?this.name.name=="if"||this.name.name=="elseif"||this.name.name=="unless"||this.name.name=="elseunless"?(e=" "+e.trimLeft(),this.cachedContent=e.substr(this.name.compound.length+1)):this.cachedContent=e:this.cachedContent=e}else if(this.parameters.length>0){let e=this.parameters[0],n=0;e.startPosition!=null&&(n=e.startPosition.index-1),this.contentOffset=this.startPosition,this.cachedContent=this.content.substr(0,n)}else this.contentOffset=this.startPosition,this.cachedContent=this.content;return this.cachedContent}relativePositionFromOffset(e,n){var r,i;return this.parser==null?null:this.parser.positionFromOffset(((i=(r=this.contentOffset)==null?void 0:r.offset)!=null?i:0)+e,n)}getInterpolationNode(e){if(this.processedInterpolationRegions.has(e)){let n=this.processedInterpolationRegions.get(e);if(n.length>0&&n[0]instanceof z)return n[0]}return null}_lexerRelativeOffset(e,n=null){var a,o;let r=e;if(n!=null&&(r=n),this.parser==null){let l=new Fn;return l.index=e,l.offset=e,l}let i=e+this.rawStart.length+((o=(a=this.startPosition)==null?void 0:a.index)!=null?o:0);return this.isTagNode&&this.nameStartsOn!=null&&(i=this.nameStartsOn.index+e,Hn.isConditionalStructure(this)||(i-=this.rawStart.length)),this.parser.positionFromOffset(i,i,!0)}relativeOffset(e,n=null){var a,o;let r=e;if(n!=null&&(r=n),this.parser==null){let l=new Fn;return l.index=e,l.offset=e,l}let i=e+this.rawStart.length+((o=(a=this.startPosition)==null?void 0:a.index)!=null?o:0);return this.parser.positionFromOffset(i,i,!0)}isPaired(){return this.isClosingTag&&this.isSelfClosing==!1&&this.isOpenedBy!=null?!0:!(this.isClosedBy==null||this.isSelfClosing)}getFinalClosingTag(){return this.isClosedBy==null?this:this.isClosedBy.getFinalClosingTag()}rawContent(){return this.rawStart+this.content+this.rawEnd}getTrueRuntimeNodes(){return this.originalNode!=null&&this.originalNode!=this?this.originalNode.getTrueRuntimeNodes():this.runtimeNodes}getTrueRawContent(){return this.originalNode!=null&&this.originalNode!=this?this.originalNode.getTrueRawContent():this.rawContent()}getTrueNode(){return this.originalNode!=null&&this.originalNode!=this?this.originalNode.getTrueNode():this}getStructuralChildren(){return this.isClosedBy!=null?Wf(this.children.slice(0,-1)):Wf(this.children)}findParentOfType(e){return this.parent==null?null:this.parent instanceof z?this.parent.name!=null&&e.includes(this.parent.getTagName())?this.parent:this.parent.findParentOfType(e):null}},$n=class extends z{static makeWithStartPosition(e){let n=new $n;return n.startPosition=e,n.endPosition=e,n}},mt=class extends $n{},dr=class extends z{constructor(){super(...arguments);this.recursiveParent=null;this.isNestedRecursive=!1}},ya=class extends z{constructor(){super(...arguments);this.isEchoNode=!1}},Vo=class extends $n{},zf=class extends $n{},ln=class extends z{constructor(){super(...arguments);this.isNoParseRegion=!1}},jo=class extends se{constructor(){super(...arguments);this.modifier=null;this.isModifierParameter=!1;this.nameDelimiter='"';this.isVariableReference=!1;this.name="";this.value="";this.interpolations=[];this.parent=null;this.blockPosition=null;this.namePosition=null;this.valuePosition=null}containsSimpleValue(){return this.hasInterpolations()==!1&&this.isVariableReference==!1}hasInterpolations(){return this.interpolations.length>0}getArrayValue(){return this.value.split("|")}getValue(){return this.value}},Uo=class{constructor(){this.modifierTarget=null;this.modifierChain=[];this.startPosition=null;this.endPosition=null;this.lastManifestedModifier=null;this.lastModifier=null}updateValues(){if(this.modifierChain.length==0)this.startPosition=null,this.endPosition=null;else{let e=this.modifierChain[0],n=this.modifierChain[this.modifierChain.length-1];this.startPosition=e.startPosition,this.endPosition=n.endPosition}}},ba=class extends se{constructor(){super(...arguments);this.modifier=null;this.methodStyleArguments=null;this.nameNode=null;this.name="";this.valueNodes=[];this.parameters=[]}getParameterValues(){let e=[];return this.parameters.forEach(n=>{e.push(n.value)}),e}},Wo=class extends se{constructor(){super(...arguments);this.order=0;this.name=null;this.directionNode=null}},Xf=class extends se{constructor(){super(...arguments);this.value=""}},wr=class extends se{},hr=class extends se{},Or=class extends se{},Kn=class extends se{},zn=class extends se{},fi=class extends se{},Xi=class extends se{constructor(){super(...arguments);this.repeat=1}},pi=class extends se{},Xn=class extends se{},Cn=class extends se{},Lr=class extends se{},Fr=class extends se{},Qn=class extends se{},kr=class extends se{},Mr=class extends se{},di=class extends se{},kn=class extends se{},mr=class extends se{},Ii=class extends se{},Br=class extends se{},qr=class extends se{},Vr=class extends se{},jr=class extends se{},Ur=class extends se{},Wr=class extends se{},Di=class extends se{},Gr=class extends se{},un=class extends se{},xs=class extends se{constructor(){super(...arguments);this.orderClauses=[]}},St=class extends se{},Pn=class extends se{},Go=class extends se{constructor(){super(...arguments);this.left=null;this.right=null}},An=class extends se{constructor(){super(...arguments);this.isTenaryBranchSeparator=!1}},Yr=class extends se{},gr=class extends se{},cn=class extends se{},Hr=class extends se{},hi=class extends se{},_r=class extends se{},Sn=class extends se{},mi=class extends se{},Ht=class extends se{},en=class extends se{},Ta=class extends se{constructor(){super(...arguments);this.values=[];this.isNamedNode=!1;this.parsedName=null}},We=class extends se{constructor(){super(...arguments);this.start=null;this.end=null;this.nodes=[];this.scopeOperator=null}},va=class extends se{constructor(){super(...arguments);this.condition=null;this.expression=null}},Rs=class extends se{constructor(){super(...arguments);this.cases=[]}},Qf=class extends se{constructor(){super(...arguments);this.left=null;this.right=null}},xi=class extends se{constructor(){super(...arguments);this.nodes=[]}},Yo=class extends se{constructor(){super(...arguments);this.head=null;this.truthBranch=null;this.falseBranch=null}},Rt=class extends se{},Mt=class extends se{constructor(){super(...arguments);this.nodes=[];this.separatorToken=null}},yr=class extends We{constructor(){super(...arguments);this.scope=null}extract(){let e=null;this.scope!=null&&(e=this.scope.name);let n=this.nodes[0];return[e,n.nodes]}},Ri=class extends yr{constructor(){super(...arguments);this.alias=null}},Na=class extends se{constructor(){super(...arguments);this.args=[];this.hasNamedArguments=!1;this.numberOfNamedArguments=0}},$r=class extends se{},Jf=class extends se{};var Qi=class extends se{constructor(){super(...arguments);this.libraryName="";this.methodName="";this.arguments=null}},gt=class extends se{constructor(){super(...arguments);this.sourceContent=""}},tn=class extends se{constructor(){super(...arguments);this.method=null;this.args=null}},mn=class extends se{constructor(){super(...arguments);this.name=""}},$t=class extends se{constructor(){super(...arguments);this.value="";this.name=""}},fu=class extends se{constructor(){super(...arguments);this.name=null;this.value=null}},Ho=class extends se{constructor(){super(...arguments);this.name=null;this.value=null}},Bt=class extends se{constructor(){super(...arguments);this.value=null}},Et=class extends se{constructor(){super(...arguments);this.value="";this.sourceTerminator="";this.sourceContent=""}},Ne=class extends se{constructor(){super(...arguments);this.name="";this.mergeRefName="";this.variableReference=null;this.interpolationNodes=[];this.isInterpolationReference=!1}},Zf=class extends se{constructor(){super(...arguments);this.name=""}},Yn=class extends se{constructor(){super(...arguments);this.delimiter="";this.name="";this.isStringVar=!1;this.isFinal=!1}},Ji=class{constructor(){this.originalContent="";this.normalizedReference="";this.isStrictTagReference=!1;this.isStrictVariableReference=!1;this.isExplicitVariableReference=!1;this.isVariableVariable=!1;this.pathParts=[];this.isFinal=!1;this._isFromEmptyFailState=!1}clone(){let e=new Ji;return e.originalContent=this.originalContent,e.normalizedReference=this.normalizedReference,e.isStrictVariableReference=this.isStrictVariableReference,e.isExplicitVariableReference=this.isExplicitVariableReference,e.pathParts=this.pathParts,e.isFinal=this.isFinal,e}implodePaths(){let e=[];return this.pathParts.forEach(n=>{n instanceof Yn?e.push(n.name):n instanceof Ji&&e.push(n.implodePaths())}),e.join(".")}},ep=class{constructor(e,n,r){this.target=e,this.value=n,this.operator=r}};var _0=je(ei());var Fa=je(vt());function nd(t,e){let n=[];if(t.currentNode==null)return n;let r={start:{line:t.position.line,character:t.position.character-0},end:t.position};for(let i=0;i0&&(e+=` -`),e+="Blueprint: "+t.blueprintName),t.type!=null&&(n+=": "+t.type),{label:t.name,insertText:t.name,kind:ku.CompletionItemKind.Field,documentation:e,detail:n}}function qe(t,e,n,r){let i="**"+t+"** ";return i+=` +`)}static split(e){return e.split("")}static substring(e,n,r){return e.substr(n,r)}static ctypeSpace(e){return(e==null?void 0:e.search(/^[\f\n\r\t\v ]+$/g))!==-1}static ctypeAlpha(e){return(e==null?void 0:e.search(/^[A-Za-z]+$/g))!==-1}static ctypeDigit(e){return(e==null?void 0:e.search(/^[\d]+$/g))!==-1}static ctypePunct(e){return(e==null?void 0:e.search(/^[\u0021-\u002F\u003A-\u0040\u005B-\u0060\u007B-\u007E]+$/g))!==-1}static trimLeft(e,n="\\s"){return e.replace(new RegExp("^["+n+"]+"),"")}static trimRight(e,n="\\s"){return e.replace(new RegExp("["+n+"]+$"),"")}static isNumeric(e){return dg(e)}static substringCount(e,n){let r=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return(e.match(new RegExp(r,"gi"))||[]).length}static getLastLine(e){let n=Z.breakByNewLine(e);return n.length==0?"":n[n.length-1]}static getFirstLine(e){let n=Z.breakByNewLine(e);return n.length==0?"":n[0]}};var Gf=class{constructor(e){this.node=e}findParentWithName(e){let n=this.node.getParser();return n==null?null:n.structure.findParentWithName(e,this.node)}};var mg=je(uu());var W=class{constructor(){this.node=null;this.errorCode="";this.message="";this.level=0;this.range=null}hash(){var n,r,i,s;let e="";return this.node!=null&&(e=((r=(n=this.node.endPosition)==null?void 0:n.offset)!=null?r:0).toString()+"|"+((s=(i=this.node.startPosition)==null?void 0:i.offset)!=null?s:0).toString()+"|"),mg.Md5.hashStr(e+"|"+this.errorCode)}static makeSyntaxError(e,n,r,i){i==null&&(i=0);let s=new W;return s.errorCode=e,s.node=n,s.message=r,s.level=i,s}};var S=class{};S.TYPE_EXPECTING_OPERAND="ANTLR_001",S.TYPE_UNEXPECTED_END_OF_INPUT="ANTLR_002",S.TYPE_RUNTIME_TYPE_MISMATCH="ANTLR_003",S.TYPE_RUNTIME_DIVIDE_BY_ZERO="ANTLR_004",S.TYPE_RUNTIME_UNKNOWN_LANG_OPERATOR="ANTLR_005",S.TYPE_RUNTIME_UNEXPECTED_STACK_CONDITION="ANTLR_006",S.TYPE_RUNTIME_PARSE_VALUE_VIOLATION="ANTLR_007",S.TYPE_PARSE_UNCLOSED_CONDITIONAL="ANTLR_008",S.TYPE_PARSE_EMPTY_CONDITIONAL="ANTLR_009",S.TYPE_PARSE_UNPAIRED_CONDITIONAL="ANTLR_008",S.TYPE_ILLEGAL_STRING_ESCAPE_SEQUENCE="ANTLR_009",S.TYPE_INCOMPLETE_ANTLERS_REGION="ANTLR_010",S.TYPE_INCOMPLETE_ANTELRS_COMMENT_REGION="ANTLR_011",S.TYPE_ILLEGAL_VARPATH_RIGHT="ANTLR_012",S.TYPE_ILLEGAL_DOTVARPATH_RIGHT="ANTLR_013",S.TYPE_ILLEGAL_VARPATH_SUBPATH_START="ANTLR_014",S.TYPE_ILLEGAL_VARPATH_SPACE_RIGHT="ANTLR_015",S.TYPE_UNEXPECTED_EOI_VARPATH_ACCESSOR="ANTLR_016",S.TYPE_ILLEGAL_VARIABLE_NAME="ANTLR_017",S.TYPE_UNSET_MODIFIER_DETAILS="ANTLR_018",S.TYPE_MODIFIER_NAME_NOT_START_OF_DETAILS="ANTLR_019",S.TYPE_MODIFIER_UNEXPECTED_VALUE="ANTLR_020",S.TYPE_MODIFIER_UNEXPECTED_END_OF_VALUE_LIST="ANTLR_021",S.TYPE_TERNARY_EXPECTING_BRANCH_SEPARATOR="ANTLR_022",S.TYPE_TERNARY_UNEXPECTED_EXPRESSION_LENGTH="ANTLR_023",S.TYPE_RECURSIVE_UNPAIRED_NODE="ANTLR_024",S.TYPE_RECURSIVE_NODE_INVALID_POSITION="ANTLR_025",S.TYPE_NO_PARSE_UNASSOCIATED="ANTLR_026",S.TYPE_RECURSIVE_NODE_UNASSOCIATED_PARENT="ANTLR_027",S.TYPE_LOGIC_GROUP_NO_END="ANTLR_028",S.TYPE_LOGIC_GROUP_NO_START="ANTLR_029",S.TYPE_UNEXPECTED_BRANCH_SEPARATOR="ANTLR_030",S.TYPE_UNEXPECTED_BRANCH_SEPARATOR_FOR_VARCOMBINE="ANTLR_031",S.TYPE_UNEXPECTED_MODIFIER_SEPARATOR="ANTLR_032",S.TYPE_UNEXPECTED_EOI_WHILE_PARSING_MODIFIER_DETAILS="ANTLR_033",S.TYPE_UNEXPECTED_EOI_WHILE_PARSING_MODIFIER_VALUE="ANTLR_034",S.TYPE_UNEXPECTED_EOI_WHILE_PARSING_NODE_PARAMETER="ANTLR_035",S.TYPE_UNEXPECTED_EOI_WHILE_MANIFESTING_ANTLERS_NODE="ANTLR_036",S.TYPE_UNEXPECTED_EOI_WHILE_REDUCING_NEGATION_OPERATORS="ANTLR_037",S.TYPE_UNEXPECTED_EOI_WHILE_PARSING_SEMANTIC_GROUP="ANTLR_038",S.TYPE_UNEXPECTED_EOI_WHILE_PARSING_NULL_COALESCENCE_GROUP="ANTLR_039",S.TYPE_UNEXPECTED_EOI_WHILE_PARSING_TERNARY_GROUP="ANTLR_040",S.TYPE_UNEXPECTED_EOI_WHILE_PARSING_TERNARY_GROUP_FALSE_BRANCH="ANTLR_041",S.TYPE_UNEXPECTED_EOI_WHILE_EXITING_TERNARY_GROUP="ANTLR_042",S.TYPE_UNEXPECTED_EOI_WHILE_PARSING_LOGIC_GROUP_NEGATION_OFFSET="ANTLR_043",S.TYPE_UNEXPECTED_EOI_WHILE_PARSING_LOGIC_GROUP_END_DUE_TO_NEGATION="ANTLR_044",S.TYPE_UNEXPECTED_EOI_WHILE_PARSING_LOGIC_GROUP_END="ANTLR_045",S.TYPE_RUNTIME_UNKNOWN_LIBRARY="ANTLR_046",S.TYPE_RUNTIME_LIBRARY_BAD_METHOD_CALL="ANTLR_047",S.TYPE_UNEXPECTED_FACTORIAL_WHILE_CREATING_GROUPS="ANTLR_048",S.TYPE_UNEXPECTED_FACTORIAL_OPERAND="ANTLR_049",S.TYPE_UNEXPECTED_LOGIC_NEGATION_OPERATOR="ANTLR_050",S.TYPE_FACTORIAL_MATERIALIZED_BOOL_DETECTED="ANTLR_051",S.TYPE_ARG_UNEXPECTED_NAMED_ARGUMENT="ANTLR_052",S.TYPE_UNEXPECTED_EOI_PARSING_BRANCH_GROUP="ANTLR_053",S.TYPE_UNEXPECTED_UNNAMED_METHOD_ARGUMENT="ANTLR_054",S.TYPE_LIBRARY_CALL_NO_ARGS_PROVIDED="ANTLR_055",S.TYPE_LIBRARY_CALL_MISSING_REQUIRED_FORMAL_ARG="ANTLR_056",S.TYPE_LIBRARY_CALL_RUNTIME_TYPE_MISMATCH="ANTLR_057",S.TYPE_LIBRARY_CALL_UNEXPECTED_ARG_RESOLVE_FAULT="ANTLR_058",S.TYPE_LIBRARY_CALL_TOO_MANY_ARGUMENTS="ANTLR_059",S.TYPE_UNEXPECTED_TOKEN_WHILE_PARSING_METHOD="ANTLR_060",S.TYPE_INVALID_NAMED_ARG_IDENTIFIER="ANTLR_061",S.TYPE_LIBRARY_CALL_INVALID_ARGUMENT_NAME="ANTLR_062",S.TYPE_RUNTIME_ATTEMPT_TO_OVERWRITE_LOADED_LIBRARY="ANTLR_063",S.TYPE_UNEXPECTED_EOI_WHILE_PARSING_ARG_GROUP="ANTLR_064",S.TYPE_EXPECTING_ARGUMENT_GROUP="ANTLR_065",S.TYPE_RUNTIME_PROTECTED_LIBRARY_ACCESS_VIOLATION="ANTLR_066",S.TYPE_RUNTIME_FATAL_UNPAIRED_LOOP_END="ANTLR_067",S.TYPE_UNEXPECTED_OPERATOR="ANTLR_068",S.TYPE_OPERATOR_INVALID_ON_RIGHT="ANTLR_069",S.TYPE_INVALID_ASSIGNMENT_LOOP_PAIR="ANTLR_070",S.TYPE_UNEXPECTED_EOI_PARSING_ORDER_GROUP="ANTLR_071",S.TYPE_EXPECTING_ORDER_GROUP_FOR_ORDER_BY_OPERAND="ANTLR_072",S.TYPE_QUERY_UNSUPPORTED_VALUE_TYPE="ANTLR_073",S.TYPE_UNEXPECTED_RUNTIME_RESULT_FOR_ORDER_BY_CLAUSE="ANTLR_074",S.TYPE_UNEXPECTED_EMPTY_DIRECTION_GROUP="ANTLR_075",S.TYPE_INVALID_ORDER_BY_NAME_VALUE="ANTLR_076",S.TYPE_INVALID_ORDER_BY_SORT_VALUE="ANTLR_077",S.TYPE_UNEXPECTED_TOKEN_FOR_GROUP_BY="ANTLR_78",S.TYPE_UNEXPECTED_EOI_WHILE_PARSING_GROUP_BY="ANTLR_079",S.TYPE_UNEXPECTED_GROUP_BY_AS_ALIAS_TYPE="ANTLR_080",S.TYPE_UNEXPECTED_EOI_WHILE_PARSING_SWITCH_GROUP="ANTLR_081",S.TYPE_UNEXPECTED_TOKEN_FOR_SWITCH_GROUP="ANTLR_082",S.TYPE_UNEXPECTED_SWITCH_START_VALUE="ANTLR_083",S.TYPE_UNEXPECTED_SWITCH_START_VALUE_NO_VALUE="ANTLR_084",S.TYPE_UNEXPECTED_SWITCH_START_VALUE_NO_SEMANTIC_VALUE="ANTLR_085",S.TYPE_SWITCH_DEFAULT_MUST_BE_LAST="ANTLR_086",S.TYPE_PARSER_INVALID_SWITCH_TOKEN="ANTLR_087",S.TYPE_ORDER_BY_INVALID_RETURN_TYPE="ANTLR_088",S.TYPE_GROUP_BY_SCOPED_GROUP_MUST_BE_ENCLOSED="ANTLR_089",S.TYPE_PLUCK_INTO_MISSING_VARIABLE_TARGET="ANTLR_090",S.TYPE_PLUCK_INTO_INVALID_VARIABLE_TARGET="ANTLR_091",S.TYPE_PLUCK_INTO_NO_PREDICATE="ANTLR_092",S.TYPE_PLUCK_INTO_INVALID_PREDICATE_VALUE="ANTLR_093",S.TYPE_PLUCK_INTO_EMPTY_LOGIC_GROUP="ANTLR_094",S.TYPE_PLUCK_INTO_INVALID_NUMBER_OF_TUPLE_VARIABLES="ANTLR_095",S.TYPE_PLUCK_INTO_UNKNOWN_ALIAS_VARNAME="ANTLR_096",S.TYPE_PLUCK_INTO_UNEXPECTED_EMPTY_T_LOGIC_GROUP="ANTLR_097",S.TYPE_PLUCK_INTO_REFERENCE_TYPE_DYNAMIC="ANTLR_098",S.TYPE_PLUCK_INTO_REFERENCE_AMBIGUOUS="ANTLR_099",S.TYPE_RUNTIME_ASSIGNMENT_TO_NON_VAR="ANTLR_100",S.TYPE_ARR_MAKE_MISSING_TARGET="ANTLR_101",S.TYPE_ARR_MAKE_UNEXPECTED_TYPE="ANTLR_102",S.TYPE_ARR_MAKE_MISSING_ARR_KEY_PAIR_VALUE="ANTLR_103",S.TYPE_ARR_KEY_PAIR_INVALID_KEY_TYPE="ANTLR_104",S.TYPE_ARR_UNEXPECT_ARG_SEPARATOR="ANTLR_105",S.TYPE_ARR_KEY_PAIR_MISSING_KEY="ANTLR_106",S.RUNTIME_PROTECTED_VAR_ACCESS="ANTLR_107",S.RUNTIME_PROTECTED_TAG_ACCESS="ANTLR_108",S.RUNTIME_PROTECTED_MODIFIER_ACCESS="ANTLR_109",S.TYPE_INCOMPLETE_PHP_EVALUATION_REGION="ANTLR_110",S.RUNTIME_PHP_NODE_WHEN_PHP_DISABLED="ANTLR_111",S.RUNTIME_PHP_NODE_USER_CONTENT_TAG="ANTLR_112",S.TYPE_UNEXPECTED_TYPE_FOR_TUPLE_LIST="ANTLR_113",S.TYPE_UNEXPECTED_EOI_PARSING_TUPLE_LIST="ANTLR_114",S.TYPE_MISSING_BODY_TUPLE_LIST="ANTLR_115",S.TYPE_MISSING_NAMES_TUPLE_LIST="ANTLR_116",S.TYPE_VALUE_NAME_LENGTH_MISMATCH_TUPLE_LIST="ANTLR_117",S.TYPE_INVALID_TUPLE_LIST_NAME_TYPE="ANTLR_118",S.TYPE_INVALID_MANIFESTED_NAME_GROUP="ANTLR_119",S.TYPE_INVALID_TUPLE_LIST_VALUE_TYPE_GROUP="ANTLR_120",S.TYPE_INVALID_TUPLE_LIST_VALUE_TYPE="ANTLR_121",S.TYPE_RUNTIME_BAD_METHOD_CALL="ANTLR_122",S.TYPE_METHOD_CALL_MISSING_ARG_GROUP="ANTLR_123",S.TYPE_INVALID_METHOD_CALL_ARG_GROUP="ANTLR_124",S.TYPE_METHOD_CALL_MISSING_METHOD="ANTLR_125",S.TYPE_MODIFIER_NOT_FOUND="ANTLR_126",S.TYPE_RUNTIME_GENERAL_FAULT="ANTLR_127",S.TYPE_MODIFIER_INCORRECT_VALUE_POSITION="ANTLR_128",S.TYPE_MODIFIER_UNEXPECTED_TOKEN_METHOD_SYNTAX="ANTLR_129",S.TYPE_RUNTIME_ATTEMPTING_TO_RENDER_OBJECT_AS_STRING="ANTLR_130",S.TYPE_UNPAIRED_CLOSING_TAG="ANTLR_131",S.PARSER_CANNOT_PARSE_PATH_RECURSIVE="ANTLR_200",S.PATH_STRING_NOT_INSIDE_ARRAY_ACCESSOR="ANTLR_201",S.LINT_UNKNOWN_PARAMETER="ANTLR_500",S.LINT_GENERAL_INVALID_PARAMETER_CONTENTS="ANTLR_501",S.LINT_PARAMETER_CONTENT_INVALID_INTEGER="ANTLR_502",S.LINT_PARAMETER_CONTENT_INVALID_BOOLEAN="ANT LR_503",S.LINT_PAGINATE_INVALID_VALUE="ANTLR_504",S.LINT_DEBUG_DATA_EXPOSED="ANTLR_505",S.LINT_DOUBLE_COLON_IN_TAG_IDENTIFIER="ANTLR_506",S.LINT_MIXED_MODIFIERS="ANTLR_507",S.LINT_MODIFIER_UNEXPECTED_TYPE="ANTLR_508",S.LINT_REMOVE_RELATE_TAG="ANTLR_509",S.LINT_SET_PRODUCES_RUNTIME_ERROR="ANTLR_510",S.LINT_FRONT_MATTER_EMPTY_DOCUMENT="ANTLR_511",S.LINT_SHORTHAND_MODIFIER_TAG_MUST_MATCH="ANTLR_512",S.LINT_INVALID_FRONT_MATTER="ANTLR_513",S.LINT_DUPLICATE_CODE="ANTLR_514",S.LINT_VERSION_NOT_COMPATIBLE="ANTLR_515",S.LINT_INTERLEAVED_TAG_PAIRS="ANTLR_516",S.LINT_MISSING_REQUIRED_PARAMETER="ANTLR_517",S.LINT_POSSIBLE_PARTIAL_RECURSION="ANTLR_518",S.LINT_URL_VARIABLE_WITHOUT_SANITIZE="ANTLR_519";var lt=class{static distance(e,n){return e.endPosition==null||n.startPosition==null?this.DistMax:n.startPosition.index-e.endPosition.index}static getTrueName(e){var n,r,i,s;return e.originalNode!=null?(r=(n=e.originalNode.name)==null?void 0:n.name)!=null?r:"":(s=(i=e.name)==null?void 0:i.name)!=null?s:""}static getSimpleVarName(e){return e.variableReference!=null&&e.variableReference.pathParts.length==1&&e.variableReference.pathParts[0]instanceof Yn?e.variableReference.pathParts[0].name:""}static isVariableMatching(e,n){return e instanceof Ne?e.name==n:!1}static mergeVarContentLeft(e,n,r){return r.mergeRefName=r.name,r.endPosition=n.endPosition,r.name=r.name+e,r}static mergeVarContentRight(e,n,r){return r.mergeRefName=r.name,r.startPosition=n.startPosition,r.name=e+r.name,r}static mergeVarRight(e,n){return n.mergeRefName=n.name,n.startPosition=e.startPosition,n.name=e.name+n.name,n}static getUnrefName(e){return Z.trimLeft(e,":.")}};lt.DistMax=65e3;var fr=class{static isConditionalStructure(e){var r,i;if(e.isComment)return!1;let n=(i=(r=e.name)==null?void 0:r.name)!=null?i:"";return n=="if"||n=="elseif"||n=="else"}static requiresClose(e){var r,i;let n=(i=(r=e.name)==null?void 0:r.name)!=null?i:"";return n=="elseif"||n=="else"?e.isClosedBy==null:!(e.isClosingTag||e.isClosedBy!=null)}static getValidClosingPairs(e){return e=="if"||e=="elseif"?fr.conditionClosingPairs:[]}static findClosestStructurePair(e,n,r){var u,c,f,h,y,p,d,g;let i=[],s=e.length,a=new Map,o=null;i.push({node:n,index:r});for(let m=0;m0;){let m=i.pop();if(m==null)continue;if(m.node._conditionParserAbandonPairing)break;let b=m.node,_=fr.getValidClosingPairs((h=(f=b.name)==null?void 0:f.name)!=null?h:""),N=m.index,C=!1;if(l>50&&o!=null){for(let[G,L]of a)if(G>N){N=G;break}}for(let G=N;G{var r,i;if(n instanceof z&&fr.isConditionalStructure(n)){let s=(i=(r=n.name)==null?void 0:r.name)!=null?i:"";if((s=="elseif"||s=="else")&&n.isOpenedBy==null){n.pushError(W.makeSyntaxError(S.TYPE_PARSE_UNPAIRED_CONDITIONAL,n,'Unpaired "'+lt.getTrueName(n)+'" control structure.'));return}if(n.isClosedBy==null&&fr.requiresClose(n)){n.pushError(W.makeSyntaxError(S.TYPE_PARSE_UNCLOSED_CONDITIONAL,n,"Unclosed "+lt.getTrueName(n)+" control structure."));return}}}),e}},Hn=fr;Hn.conditionClosingPairs=["elseif","else"];function Ei(t,e){return e==null&&(e="s"),t.replace(new RegExp("^["+e+"]+"),"")}function pr(t,e,n){return t.replace(new RegExp(e,"g"),n)}function Hf(t,e){return e==null&&(e="s"),t.replace(new RegExp("["+e+"]+$"),"")}function _a(){return(Date.now().toString(32)+Math.random().toString(16)).replace(/\./g,"")}function gg(){return pr(_a(),"-","_")}var cu=class{constructor(){this.startPosition=null;this.endPosition=null;this.index=0;this.embeddedIndex=0;this.refId=null;this.parameters=[];this.isSelfClosing=!1;this.isClosingFragment=!1;this.name="";this.containsStructures=!1;this.refId=gg()}},$f=class{constructor(){this.startPosition=null;this.endPosition=null}};function hS(t){let e=[],n=[];for(let r=0;r{n.node==null&&(n.node=this),this.antlersErrors.push(n)})}getErrors(){return this.antlersErrors}innerContent(){return this.content}rawContent(){return this.content}},Kf=class extends se{constructor(){super(...arguments);this.head=null;this.tail=null;this.nodes=[];this.documentText="";this.childDocument=null}getImmediateChildren(){return this.head==null?[]:this.head.getImmediateChildren()}},Nn=class extends se{constructor(){super(...arguments);this.logicBranches=[];this.chain=[];this.nodeContent="";this.fragment=null;this.fragmentPosition=3;this.containsAnyFragments=!1;this.containsChildStructures=!1}},z=class extends se{constructor(){super(...arguments);this.isNodeAbanonded=!1;this.isComment=!1;this.isTagNode=!1;this.isConditionNode=!1;this.runtimeContent="";this.name=null;this.pathReference=null;this.isClosingTag=!1;this.isInterpolationNode=!1;this.isOpenedBy=null;this.isClosedBy=null;this.isSelfClosing=!1;this.children=[];this.runtimeNodes=[];this.parsedRuntimeNodes=[];this.hasParsedRuntimeNodes=!1;this.parameters=[];this.hasParameters=!1;this.contentOffset=null;this.cachedContent=null;this.cachedInnerContent=null;this.hasRecursiveNode=!1;this.recursiveReference=null;this.rawStart="";this.rawEnd="";this.originalNode=null;this.interpolationRegions=new Map;this.processedInterpolationRegions=new Map;this.hasProcessedInterpolationRegions=!1;this.ref=0;this.contentStartRelativeIndex=null;this.antlersNodeIndex=0;this.nameStartsOn=null;this.nameEndsOn=null;this.nameMethodPartStartsOn=null;this.documentText="";this.nodeContent="";this.childDocument=null;this.structure=new Gf(this);this.isInlineAntlers=!1;this.mustClose=!1;this.reference=null;this._conditionParserAbandonPairing=!1;this._isEndVirtual=!1}getOriginalContent(){return this.startPosition==null||this.endPosition==null||this.parser==null?"":this.isClosedBy!=null?this.isClosedBy.startPosition==null||this.isClosedBy.endPosition==null?"":this.parser.getText(this.startPosition.index,this.isClosedBy.endPosition.index+1):this.parser.getText(this.startPosition.index,this.endPosition.index+1)}getNodeDocumentText(){return this.startPosition==null||this.endPosition==null||this.parser==null?"":this.parser.getText(this.startPosition.index,this.endPosition.index+1)}getImmediateChildren(){let e=[];for(let n=0;n0){let a=0,o=this.parameters[0];o.startPosition!=null&&(a=o.startPosition.index-1);let l=e,u=l.trimLeft(),c=l.length-u.length,f=n;e=e.substr(0,a)}let r=e.trimLeft(),i=e.length-r.length,s=n+i+2;if(this.parser!=null){let a=0;this.startPosition!=null&&(a=this.startPosition.offset),this.contentOffset==this.parser.positionFromOffset(a+s,0)}this.name!=null?this.name.name=="if"||this.name.name=="elseif"||this.name.name=="unless"||this.name.name=="elseunless"?(e=" "+e.trimLeft(),this.cachedContent=e.substr(this.name.compound.length+1)):this.cachedContent=e:this.cachedContent=e}else if(this.parameters.length>0){let e=this.parameters[0],n=0;e.startPosition!=null&&(n=e.startPosition.index-1),this.contentOffset=this.startPosition,this.cachedContent=this.content.substr(0,n)}else this.contentOffset=this.startPosition,this.cachedContent=this.content;return this.cachedContent}relativePositionFromOffset(e,n){var r,i;return this.parser==null?null:this.parser.positionFromOffset(((i=(r=this.contentOffset)==null?void 0:r.offset)!=null?i:0)+e,n)}getInterpolationNode(e){if(this.processedInterpolationRegions.has(e)){let n=this.processedInterpolationRegions.get(e);if(n.length>0&&n[0]instanceof z)return n[0]}return null}_lexerRelativeOffset(e,n=null){var a,o;let r=e;if(n!=null&&(r=n),this.parser==null){let l=new Fn;return l.index=e,l.offset=e,l}let i=e+this.rawStart.length+((o=(a=this.startPosition)==null?void 0:a.index)!=null?o:0);return this.isTagNode&&this.nameStartsOn!=null&&(i=this.nameStartsOn.index+e,Hn.isConditionalStructure(this)||(i-=this.rawStart.length)),this.parser.positionFromOffset(i,i,!0)}relativeOffset(e,n=null){var a,o;let r=e;if(n!=null&&(r=n),this.parser==null){let l=new Fn;return l.index=e,l.offset=e,l}let i=e+this.rawStart.length+((o=(a=this.startPosition)==null?void 0:a.index)!=null?o:0);return this.parser.positionFromOffset(i,i,!0)}isPaired(){return this.isClosingTag&&this.isSelfClosing==!1&&this.isOpenedBy!=null?!0:!(this.isClosedBy==null||this.isSelfClosing)}getFinalClosingTag(){return this.isClosedBy==null?this:this.isClosedBy.getFinalClosingTag()}rawContent(){return this.rawStart+this.content+this.rawEnd}getTrueRuntimeNodes(){return this.originalNode!=null&&this.originalNode!=this?this.originalNode.getTrueRuntimeNodes():this.runtimeNodes}getTrueRawContent(){return this.originalNode!=null&&this.originalNode!=this?this.originalNode.getTrueRawContent():this.rawContent()}getTrueNode(){return this.originalNode!=null&&this.originalNode!=this?this.originalNode.getTrueNode():this}getStructuralChildren(){return this.isClosedBy!=null?Wf(this.children.slice(0,-1)):Wf(this.children)}findParentOfType(e){return this.parent==null?null:this.parent instanceof z?this.parent.name!=null&&e.includes(this.parent.getTagName())?this.parent:this.parent.findParentOfType(e):null}},$n=class extends z{static makeWithStartPosition(e){let n=new $n;return n.startPosition=e,n.endPosition=e,n}},mt=class extends $n{},dr=class extends z{constructor(){super(...arguments);this.recursiveParent=null;this.isNestedRecursive=!1}},ya=class extends z{constructor(){super(...arguments);this.isEchoNode=!1}},Vo=class extends $n{},zf=class extends $n{},ln=class extends z{constructor(){super(...arguments);this.isNoParseRegion=!1}},jo=class extends se{constructor(){super(...arguments);this.modifier=null;this.isModifierParameter=!1;this.nameDelimiter='"';this.isVariableReference=!1;this.name="";this.value="";this.interpolations=[];this.parent=null;this.blockPosition=null;this.namePosition=null;this.valuePosition=null}containsSimpleValue(){return this.hasInterpolations()==!1&&this.isVariableReference==!1}hasInterpolations(){return this.interpolations.length>0}getArrayValue(){return this.value.split("|")}getValue(){return this.value}},Uo=class{constructor(){this.modifierTarget=null;this.modifierChain=[];this.startPosition=null;this.endPosition=null;this.lastManifestedModifier=null;this.lastModifier=null}updateValues(){if(this.modifierChain.length==0)this.startPosition=null,this.endPosition=null;else{let e=this.modifierChain[0],n=this.modifierChain[this.modifierChain.length-1];this.startPosition=e.startPosition,this.endPosition=n.endPosition}}},ba=class extends se{constructor(){super(...arguments);this.modifier=null;this.methodStyleArguments=null;this.nameNode=null;this.name="";this.valueNodes=[];this.parameters=[]}getParameterValues(){let e=[];return this.parameters.forEach(n=>{e.push(n.value)}),e}},Wo=class extends se{constructor(){super(...arguments);this.order=0;this.name=null;this.directionNode=null}},Xf=class extends se{constructor(){super(...arguments);this.value=""}},wr=class extends se{},hr=class extends se{},Or=class extends se{},Kn=class extends se{},zn=class extends se{},fi=class extends se{},Xi=class extends se{constructor(){super(...arguments);this.repeat=1}},pi=class extends se{},Xn=class extends se{},Cn=class extends se{},Lr=class extends se{},Fr=class extends se{},Qn=class extends se{},kr=class extends se{},Mr=class extends se{},di=class extends se{},kn=class extends se{},mr=class extends se{},Ii=class extends se{},Br=class extends se{},qr=class extends se{},Vr=class extends se{},jr=class extends se{},Ur=class extends se{},Wr=class extends se{},Di=class extends se{},Gr=class extends se{},un=class extends se{},xs=class extends se{constructor(){super(...arguments);this.orderClauses=[]}},At=class extends se{},Pn=class extends se{},Go=class extends se{constructor(){super(...arguments);this.left=null;this.right=null}},Sn=class extends se{constructor(){super(...arguments);this.isTenaryBranchSeparator=!1}},Yr=class extends se{},gr=class extends se{},cn=class extends se{},Hr=class extends se{},hi=class extends se{},_r=class extends se{},An=class extends se{},mi=class extends se{},Ht=class extends se{},en=class extends se{},Ta=class extends se{constructor(){super(...arguments);this.values=[];this.isNamedNode=!1;this.parsedName=null}},We=class extends se{constructor(){super(...arguments);this.start=null;this.end=null;this.nodes=[];this.scopeOperator=null}},va=class extends se{constructor(){super(...arguments);this.condition=null;this.expression=null}},Rs=class extends se{constructor(){super(...arguments);this.cases=[]}},Qf=class extends se{constructor(){super(...arguments);this.left=null;this.right=null}},xi=class extends se{constructor(){super(...arguments);this.nodes=[]}},Yo=class extends se{constructor(){super(...arguments);this.head=null;this.truthBranch=null;this.falseBranch=null}},Rt=class extends se{},Mt=class extends se{constructor(){super(...arguments);this.nodes=[];this.separatorToken=null}},yr=class extends We{constructor(){super(...arguments);this.scope=null}extract(){let e=null;this.scope!=null&&(e=this.scope.name);let n=this.nodes[0];return[e,n.nodes]}},Ri=class extends yr{constructor(){super(...arguments);this.alias=null}},Na=class extends se{constructor(){super(...arguments);this.args=[];this.hasNamedArguments=!1;this.numberOfNamedArguments=0}},$r=class extends se{},Jf=class extends se{};var Qi=class extends se{constructor(){super(...arguments);this.libraryName="";this.methodName="";this.arguments=null}},gt=class extends se{constructor(){super(...arguments);this.sourceContent=""}},tn=class extends se{constructor(){super(...arguments);this.method=null;this.args=null}},mn=class extends se{constructor(){super(...arguments);this.name=""}},$t=class extends se{constructor(){super(...arguments);this.value="";this.name=""}},fu=class extends se{constructor(){super(...arguments);this.name=null;this.value=null}},Ho=class extends se{constructor(){super(...arguments);this.name=null;this.value=null}},Bt=class extends se{constructor(){super(...arguments);this.value=null}},Et=class extends se{constructor(){super(...arguments);this.value="";this.sourceTerminator="";this.sourceContent=""}},Ne=class extends se{constructor(){super(...arguments);this.name="";this.mergeRefName="";this.variableReference=null;this.interpolationNodes=[];this.isInterpolationReference=!1}},Zf=class extends se{constructor(){super(...arguments);this.name=""}},Yn=class extends se{constructor(){super(...arguments);this.delimiter="";this.name="";this.isStringVar=!1;this.isFinal=!1}},Ji=class{constructor(){this.originalContent="";this.normalizedReference="";this.isStrictTagReference=!1;this.isStrictVariableReference=!1;this.isExplicitVariableReference=!1;this.isVariableVariable=!1;this.pathParts=[];this.isFinal=!1;this._isFromEmptyFailState=!1}clone(){let e=new Ji;return e.originalContent=this.originalContent,e.normalizedReference=this.normalizedReference,e.isStrictVariableReference=this.isStrictVariableReference,e.isExplicitVariableReference=this.isExplicitVariableReference,e.pathParts=this.pathParts,e.isFinal=this.isFinal,e}implodePaths(){let e=[];return this.pathParts.forEach(n=>{n instanceof Yn?e.push(n.name):n instanceof Ji&&e.push(n.implodePaths())}),e.join(".")}},ep=class{constructor(e,n,r){this.target=e,this.value=n,this.operator=r}};var y0=je(ei());var Fa=je(vt());function nd(t,e){let n=[];if(t.currentNode==null)return n;let r={start:{line:t.position.line,character:t.position.character-0},end:t.position};for(let i=0;i0&&(e+=` +`),e+="Blueprint: "+t.blueprintName),t.type!=null&&(n+=": "+t.type),{label:t.name,insertText:t.name,kind:ku.CompletionItemKind.Field,documentation:e,detail:n}}function ke(t,e,n,r){let i="**"+t+"** ";return i+=` `,i+=e+" ",i+="\n```antlers\n",i+=n,i+="\n```",r!=null&&(i+=` `,i+="[Documentation Reference]("+r+")"),i}function V(t,e,n){let r="**"+t+"** ";return r+=` `,r+=e+" ",n!=null&&(r+=` -`,r+="[Documentation Reference]("+n+")"),r}function Ma(t){let e=[];return t=="order"&&e.push("sort"),e}function yD(t){return{blueprintName:t.sourceName,displayName:t.name,instructionText:"",maxItems:-1,name:t.name,refFieldSetField:null,type:t.dataType,sets:null,import:null}}function Bu(t){let e=[];for(let n=0;n!t.includes(r));for(let r=0;r!t.includes(a));for(let a=0;a!t.includes(i));for(let i=0;ic.endPosition.char||s>((l=(o=c.endPosition)==null?void 0:o.line)!=null?l:0))&&r.push(c)}return r}static hasUnclosedTags(e,n){return this.unclosedNodes.has(e)==!1?!1:this.getUnclosedTags(e,n).length>0}};sd.unclosedNodes=new Map;function os(t){return[{name:"edit_url",dataType:"string",sourceName:"*internal.entry",sourceField:null,introducedBy:t},{name:"id",dataType:"string",sourceName:"*internal.entry",sourceField:null,introducedBy:t},{name:"last_modified",dataType:"string",sourceName:"*internal.entry",sourceField:null,introducedBy:t},{name:"permalink",dataType:"string",sourceName:"*internal.entry",sourceField:null,introducedBy:t},{name:"published",dataType:"boolean",sourceName:"*internal.entry",sourceField:null,introducedBy:t},{name:"slug",dataType:"string",sourceName:"*internal.entry",sourceField:null,introducedBy:t},{name:"template",dataType:"string",sourceName:"*internal.entry",sourceField:null,introducedBy:t},{name:"url",dataType:"string",sourceName:"*internal.entry",sourceField:null,introducedBy:t}]}var er=je(ei()),bD=[{label:"name",kind:er.CompletionItemKind.Property},{label:"description",kind:er.CompletionItemKind.Property},{label:"desc",kind:er.CompletionItemKind.Property},{label:"entry",kind:er.CompletionItemKind.Property},{label:"collection",kind:er.CompletionItemKind.Property},{label:"blueprint",kind:er.CompletionItemKind.Property},{label:"var",kind:er.CompletionItemKind.Property},{label:"set",kind:er.CompletionItemKind.Property},{label:"param",kind:er.CompletionItemKind.Property},{label:"param*",kind:er.CompletionItemKind.Property},{label:"front",kind:er.CompletionItemKind.Property},{label:"format",kind:er.CompletionItemKind.Property}];var ju=je(vt()),HB=[{label:"if",kind:ju.CompletionItemKind.Keyword},{label:"elseif",kind:ju.CompletionItemKind.Keyword},{label:"else",kind:ju.CompletionItemKind.Keyword}];var ad=je(ei()),TD=je(vt());var od=je(vt()),ll=[];ll.push({label:"true",kind:od.CompletionItemKind.Keyword});ll.push({label:"false",kind:od.CompletionItemKind.Keyword});function et(t){return[{sourceName:"*internal.array",sourceField:null,dataType:"*",name:"value",introducedBy:t},{sourceName:"*internal.array",sourceField:null,dataType:"*",name:"key",introducedBy:t}]}var vD={name:"array",augmentScope:(t,e)=>{e.addVariables(et(t)),e.addVariables(Xe(t))}},zy=vD;var ND={name:"bard",augmentScope:(t,e)=>{e.addVariable({name:"type",dataType:"string",sourceField:null,sourceName:"*internal.bard",introducedBy:t})},injectCompletions:(t,e,n)=>[]},Xy=ND;var CD={name:"form_multiple",augmentScope:(t,e)=>{e.addVariables(et(t)),e.addVariables(Xe(t))}},Qy=CD;var PD={name:"list",augmentScope:(t,e)=>{e.addVariables(et(t)),e.addVariables(Xe(t))}},Jy=PD;function Zy(t){return[{name:"type",dataType:"string",sourceName:"*internal.replicator",sourceField:null,introducedBy:t}]}var AD={name:"replicator",augmentScope:(t,e)=>{e.addVariables(Zy(t)),e.addVariables(Xe(t))},injectCompletions:(t,e,n)=>[]},eb=AD;var SD={name:"select_multiple",augmentScope:(t,e)=>{e.addVariables(et(t)),e.addVariables(Xe(t))}},tb=SD;var ED={name:"sites_multiple",augmentScope:(t,e)=>{e.addVariables(et(t)),e.addVariables(Xe(t))}},nb=ED;var ID={name:"structures_multiple",augmentScope:(t,e)=>{e.addVariables(et(t)),e.addVariables(Xe(t))}},rb=ID;var DD={name:"table",augmentScope:(t,e)=>{e.addVariable({name:"cells",dataType:"array",sourceName:"*internal.fieldtype.table",sourceField:null,introducedBy:t})}},ib=DD;var xD={name:"tags",augmentScope:(t,e)=>{e.addVariables(et(t)),e.addVariables(Xe(t))}},sb=xD;function Uu(t){return os(t).concat([{name:"entries_count",dataType:"number",sourceName:"*internal.term",sourceField:null,introducedBy:t},{name:"is_term",dataType:"boolean",sourceName:"*internal.term",sourceField:null,introducedBy:t},{name:"taxonomy",dataType:"string",sourceName:"*internal.term",sourceField:null,introducedBy:t}])}var RD={name:"taxonomies_multiple",augmentScope:(t,e)=>{e.addVariables(et(t)),e.addVariables(Xe(t)),e.addVariables(Uu(t))}},ab=RD;var wD={name:"terms_multiple",augmentScope:(t,e)=>{e.addVariables(et(t)),e.addVariables(Xe(t)),e.addVariables(Uu(t))}},ob=wD;var OD={name:"user_groups_multiple",augmentScope:(t,e)=>{e.addVariables(et(t)),e.addVariables(Xe(t))}},lb=OD;var LD={name:"user_roles_multiple",augmentScope:(t,e)=>{e.addVariables(et(t)),e.addVariables(Xe(t))}},ub=LD;var FD={name:"users_multiple",augmentScope:(t,e)=>{e.addVariables(et(t)),e.addVariables(Xe(t)),e.injectBlueprint(t,"user")}},cb=FD;var kD={name:"yaml",augmentScope:(t,e)=>{e.addVariables(et(t)),e.addVariables(Xe(t))}},fb=kD;var MD=[zy,Xy,Qy,Jy,eb,tb,nb,rb,fb,ib,ab,sb,ob,cb,lb,ub],pb=MD;var ls=class{constructor(){this.fieldTypes=new Map}getFieldTypes(){return this.fieldTypes}getFieldType(e){return this.fieldTypes.get(e)}registerFieldtypes(e){for(let n=0;n1?e[e.length-1]:e[0].trim()}function Yu(t){return t.includes(":")==!1?t:t.split(":")[0]}function db(t){var n;if(t.nodesInScope.length==0)return[];let e=t.nodesInScope[t.nodesInScope.length-1];return((n=t.context)==null?void 0:n.node)!=null&&(e=t.context.node),e.currentScope==null?[]:BD(t,e.currentScope)}function BD(t,e){let n=[];return e.values.forEach(r=>{var i;if(r.sourceField!=null?n.push({label:r.name,detail:r.sourceField.blueprintName,documentation:(i=r.sourceField.instructionText)!=null?i:"",kind:qs.CompletionItemKind.Field}):n.push(ka(r.name,"","")),r.dataType.trim().length>0&&r.dataType=="array"){let s=r.name+` }} +`,r+="[Documentation Reference]("+n+")"),r}function Ma(t){let e=[];return t=="order"&&e.push("sort"),e}function bD(t){return{blueprintName:t.sourceName,displayName:t.name,instructionText:"",maxItems:-1,name:t.name,refFieldSetField:null,type:t.dataType,sets:null,import:null}}function Bu(t){let e=[];for(let n=0;n!t.includes(r));for(let r=0;r!t.includes(a));for(let a=0;a!t.includes(i));for(let i=0;ic.endPosition.char||s>((l=(o=c.endPosition)==null?void 0:o.line)!=null?l:0))&&r.push(c)}return r}static hasUnclosedTags(e,n){return this.unclosedNodes.has(e)==!1?!1:this.getUnclosedTags(e,n).length>0}};sd.unclosedNodes=new Map;function os(t){return[{name:"edit_url",dataType:"string",sourceName:"*internal.entry",sourceField:null,introducedBy:t},{name:"id",dataType:"string",sourceName:"*internal.entry",sourceField:null,introducedBy:t},{name:"last_modified",dataType:"string",sourceName:"*internal.entry",sourceField:null,introducedBy:t},{name:"permalink",dataType:"string",sourceName:"*internal.entry",sourceField:null,introducedBy:t},{name:"published",dataType:"boolean",sourceName:"*internal.entry",sourceField:null,introducedBy:t},{name:"slug",dataType:"string",sourceName:"*internal.entry",sourceField:null,introducedBy:t},{name:"template",dataType:"string",sourceName:"*internal.entry",sourceField:null,introducedBy:t},{name:"url",dataType:"string",sourceName:"*internal.entry",sourceField:null,introducedBy:t}]}var er=je(ei()),TD=[{label:"name",kind:er.CompletionItemKind.Property},{label:"description",kind:er.CompletionItemKind.Property},{label:"desc",kind:er.CompletionItemKind.Property},{label:"entry",kind:er.CompletionItemKind.Property},{label:"collection",kind:er.CompletionItemKind.Property},{label:"blueprint",kind:er.CompletionItemKind.Property},{label:"var",kind:er.CompletionItemKind.Property},{label:"set",kind:er.CompletionItemKind.Property},{label:"param",kind:er.CompletionItemKind.Property},{label:"param*",kind:er.CompletionItemKind.Property},{label:"front",kind:er.CompletionItemKind.Property},{label:"format",kind:er.CompletionItemKind.Property}];var ju=je(vt()),KB=[{label:"if",kind:ju.CompletionItemKind.Keyword},{label:"elseif",kind:ju.CompletionItemKind.Keyword},{label:"else",kind:ju.CompletionItemKind.Keyword}];var ad=je(ei()),vD=je(vt());var od=je(vt()),ll=[];ll.push({label:"true",kind:od.CompletionItemKind.Keyword});ll.push({label:"false",kind:od.CompletionItemKind.Keyword});function et(t){return[{sourceName:"*internal.array",sourceField:null,dataType:"*",name:"value",introducedBy:t},{sourceName:"*internal.array",sourceField:null,dataType:"*",name:"key",introducedBy:t}]}var ND={name:"array",augmentScope:(t,e)=>{e.addVariables(et(t)),e.addVariables(Xe(t))}},zy=ND;var CD={name:"bard",augmentScope:(t,e)=>{e.addVariable({name:"type",dataType:"string",sourceField:null,sourceName:"*internal.bard",introducedBy:t})},injectCompletions:(t,e,n)=>[]},Xy=CD;var PD={name:"form_multiple",augmentScope:(t,e)=>{e.addVariables(et(t)),e.addVariables(Xe(t))}},Qy=PD;var SD={name:"list",augmentScope:(t,e)=>{e.addVariables(et(t)),e.addVariables(Xe(t))}},Jy=SD;function Zy(t){return[{name:"type",dataType:"string",sourceName:"*internal.replicator",sourceField:null,introducedBy:t}]}var AD={name:"replicator",augmentScope:(t,e)=>{e.addVariables(Zy(t)),e.addVariables(Xe(t))},injectCompletions:(t,e,n)=>[]},eb=AD;var ED={name:"select_multiple",augmentScope:(t,e)=>{e.addVariables(et(t)),e.addVariables(Xe(t))}},tb=ED;var ID={name:"sites_multiple",augmentScope:(t,e)=>{e.addVariables(et(t)),e.addVariables(Xe(t))}},nb=ID;var DD={name:"structures_multiple",augmentScope:(t,e)=>{e.addVariables(et(t)),e.addVariables(Xe(t))}},rb=DD;var xD={name:"table",augmentScope:(t,e)=>{e.addVariable({name:"cells",dataType:"array",sourceName:"*internal.fieldtype.table",sourceField:null,introducedBy:t})}},ib=xD;var RD={name:"tags",augmentScope:(t,e)=>{e.addVariables(et(t)),e.addVariables(Xe(t))}},sb=RD;function Uu(t){return os(t).concat([{name:"entries_count",dataType:"number",sourceName:"*internal.term",sourceField:null,introducedBy:t},{name:"is_term",dataType:"boolean",sourceName:"*internal.term",sourceField:null,introducedBy:t},{name:"taxonomy",dataType:"string",sourceName:"*internal.term",sourceField:null,introducedBy:t}])}var wD={name:"taxonomies_multiple",augmentScope:(t,e)=>{e.addVariables(et(t)),e.addVariables(Xe(t)),e.addVariables(Uu(t))}},ab=wD;var OD={name:"terms_multiple",augmentScope:(t,e)=>{e.addVariables(et(t)),e.addVariables(Xe(t)),e.addVariables(Uu(t))}},ob=OD;var LD={name:"user_groups_multiple",augmentScope:(t,e)=>{e.addVariables(et(t)),e.addVariables(Xe(t))}},lb=LD;var FD={name:"user_roles_multiple",augmentScope:(t,e)=>{e.addVariables(et(t)),e.addVariables(Xe(t))}},ub=FD;var kD={name:"users_multiple",augmentScope:(t,e)=>{e.addVariables(et(t)),e.addVariables(Xe(t)),e.injectBlueprint(t,"user")}},cb=kD;var MD={name:"yaml",augmentScope:(t,e)=>{e.addVariables(et(t)),e.addVariables(Xe(t))}},fb=MD;var BD=[zy,Xy,Qy,Jy,eb,tb,nb,rb,fb,ib,ab,sb,ob,cb,lb,ub],pb=BD;var ls=class{constructor(){this.fieldTypes=new Map}getFieldTypes(){return this.fieldTypes}getFieldType(e){return this.fieldTypes.get(e)}registerFieldtypes(e){for(let n=0;n1?e[e.length-1]:e[0].trim()}function Yu(t){return t.includes(":")==!1?t:t.split(":")[0]}function db(t){var n;if(t.nodesInScope.length==0)return[];let e=t.nodesInScope[t.nodesInScope.length-1];return((n=t.context)==null?void 0:n.node)!=null&&(e=t.context.node),e.currentScope==null?[]:qD(t,e.currentScope)}function qD(t,e){let n=[];return e.values.forEach(r=>{var i;if(r.sourceField!=null?n.push({label:r.name,detail:r.sourceField.blueprintName,documentation:(i=r.sourceField.instructionText)!=null?i:"",kind:qs.CompletionItemKind.Field}):n.push(ka(r.name,"","")),r.dataType.trim().length>0&&r.dataType=="array"){let s=r.name+` }} $1 -{{ /`+r.name+" ",a={start:{line:t.position.line,character:t.position.character-t.originalLeftWord.length},end:t.position};n.push({label:r.name+" loop",insertTextFormat:qs.InsertTextFormat.Snippet,kind:qs.CompletionItemKind.Snippet,textEdit:qs.TextEdit.replace(a,s),command:{title:"Suggest",command:"editor.action.triggerSuggest"}})}}),e.lists.forEach((r,i)=>{n.push(ka(i,"",""))}),n}var hb=je(ei());function xe(t){let e="";typeof t!="undefined"&&typeof t.resolveDocumentation!="undefined"&&t.resolveDocumentation!=null&&(e=t.resolveDocumentation());let n=t.tagName;if(n.includes(":")){let r=n.split(":");n=r[r.length-1]}return{label:n,kind:hb.CompletionItemKind.Text,sortText:"1",documentation:{kind:"markdown",value:e}}}var ld=je(vt());function mb(t,e,n){return{name:t,acceptsVariableInterpolation:!0,aliases:[],allowsVariableReference:!0,description:e,expectsTypes:["string"],isDynamic:!0,isRequired:!1,documentationLink:n,docLinkName:"MDN Reference"}}var gb=mb("class","A space-separated list of the classes of the element.","https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class"),_b=mb("style","Contains CSS styling declarations to be applied to the element. Note that it is recommended for styles to be defined in a separate file or files.","https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/style");function Hu(t){return t=="class"?gb:t=="style"?_b:{name:t,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,description:"",expectsTypes:["string","number","array"],isRequired:!1,isDynamic:!0}}function yb(t){let e=[];for(let n=0;n{n instanceof z&&n.manifestType==="array"&&(n.mustClose=!0)})}function VD(t){return t.findParameterValueOrNull("as")}var jD=["count","next","previous"];function UD(t,e){let n=[];if(t.hasMethodPart()){let o=t.getMethodNameValue();if(jD.includes(o)==!1)return n.push(o),n}let r=t.findAnyParameter(Uy),i=t.findAnyParameter(Wy),s=[],a=[];return typeof r!="undefined"&&r!==null&&(r.value.trim()==="*"?(s=e.getUniqueCollectionNames(),typeof i!="undefined"&&i!==null&&i.isVariableReference==!1&&i.hasInterpolations()==!1&&(a=i.getArrayValue())):r.isVariableReference==!1&&r.hasInterpolations()==!1&&(s=r.getArrayValue())),a.length>0?n=s.filter(function(o){return a.includes(o)==!1}):n=s,n}function us(t,e){var u,c,f,h,y,p;let n=UD(t,e),r=!1,i=!1,s=!1,a=null,o="";if(t.isClosingTag==!1){let d=VD(t),g=bb(t);d!=null&&(r=!0,o=d),g!=null&&(s=!0,a=g),i=t.hasParameter("paginate")}return{context:{collectionNames:n!=null?n:[],endPosition:(c=(u=t.endPosition)==null?void 0:u.char)!=null?c:0,aliasName:o,isAliased:r,isScoped:s,scopeName:a,isStartOfScope:!t.isClosingTag,line:(h=(f=t.startPosition)==null?void 0:f.line)!=null?h:0,startPosition:(p=(y=t.startPosition)==null?void 0:y.char)!=null?p:0,isPaginated:i,excludeCollections:[],includeCollections:[]},issues:[]}}function ja(t,e){if(t==null)return null;let n=Ei(e,":");return n.includes(":")&&(n=n.split(":")[0]),n=="status"||n=="taxonomy"||t.currentScope!=null&&t.currentScope.containsReference(n)?Hu(e):null}var WD=["from","folder","use","not_from","not_folder"],GD=["previous","next"],YD=["in","collection"];function cs(t,e){var n,r,i,s,a,o,l,u,c,f;if(t.isDynamic){let h=Yu(t.name);if(e.nodesInScope.length>0){let y=e.nodesInScope[e.nodesInScope.length-1];if(y!=null&&y.currentScope!=null){let p=Ba(y,y.currentScope),d=p.map(m=>m.name),g=Bi(e.leftWord);if(d.includes(g))return oe(as(e))}}if(h=="status"&&((n=e.context)==null?void 0:n.parameterContext)!=null)return oe(Hy((i=(r=e.context.parameterContext.parameter)==null?void 0:r.getArrayValue())!=null?i:[]));if(h=="taxonomy"){let y=Bi(t.name);if(e.project.hasTaxonomy(y)&&((s=e.context)==null?void 0:s.parameterContext)!=null)return oe($y((o=(a=e.context.parameterContext.parameter)==null?void 0:a.getArrayValue())!=null?o:[],y,e.project))}}if(t.name=="filter"||t.name=="query_scope")return oe(qu(e.project));if(e.nodesInScope.length>0){let h=e.nodesInScope[e.nodesInScope.length-1];if(h.hasMethodPart()&&GD.includes(h.getMethodNameValue())&&YD.includes(t.name))return oe(Ky(e.project))}return WD.includes(t.name)&&((l=e.context)==null?void 0:l.parameterContext)!=null?oe(qa((f=(c=(u=e.context)==null?void 0:u.parameterContext.parameter)==null?void 0:c.getArrayValue())!=null?f:[],e.project)):null}var HD={tagName:"collection:previous",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[...ss,{name:"in",aliases:["collection"],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"The collection to search in",expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"current",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Sets the current entry by ID",expectsTypes:["string"],isDynamic:!1,isRequired:!1}],augmentScope:Va,resolveDynamicParameter:ja,resolveSpecialType:us,suggestAlternativeParams:Ma,resovleParameterCompletionItems:cs,resolveCompletionItems:Ua,resolveDocumentation:t=>qe("collection:previous Tag","The `collection:previous` tag is used to show the entries that appear before the current entry, based on some entry order (publish date, alphabetical, or manual).",`{{# Retrieve the previous two entries, based on dates in ascending order. #}} +{{ /`+r.name+" ",a={start:{line:t.position.line,character:t.position.character-t.originalLeftWord.length},end:t.position};n.push({label:r.name+" loop",insertTextFormat:qs.InsertTextFormat.Snippet,kind:qs.CompletionItemKind.Snippet,textEdit:qs.TextEdit.replace(a,s),command:{title:"Suggest",command:"editor.action.triggerSuggest"}})}}),e.lists.forEach((r,i)=>{n.push(ka(i,"",""))}),n}var hb=je(ei());function xe(t){let e="";typeof t!="undefined"&&typeof t.resolveDocumentation!="undefined"&&t.resolveDocumentation!=null&&(e=t.resolveDocumentation());let n=t.tagName;if(n.includes(":")){let r=n.split(":");n=r[r.length-1]}return{label:n,kind:hb.CompletionItemKind.Text,sortText:"1",documentation:{kind:"markdown",value:e}}}var ld=je(vt());function mb(t,e,n){return{name:t,acceptsVariableInterpolation:!0,aliases:[],allowsVariableReference:!0,description:e,expectsTypes:["string"],isDynamic:!0,isRequired:!1,documentationLink:n,docLinkName:"MDN Reference"}}var gb=mb("class","A space-separated list of the classes of the element.","https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class"),_b=mb("style","Contains CSS styling declarations to be applied to the element. Note that it is recommended for styles to be defined in a separate file or files.","https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/style");function Hu(t){return t=="class"?gb:t=="style"?_b:{name:t,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,description:"",expectsTypes:["string","number","array"],isRequired:!1,isDynamic:!0}}function yb(t){let e=[];for(let n=0;n{n instanceof z&&n.manifestType==="array"&&(n.mustClose=!0)})}function jD(t){return t.findParameterValueOrNull("as")}var UD=["count","next","previous"];function WD(t,e){let n=[];if(t.hasMethodPart()){let o=t.getMethodNameValue();if(UD.includes(o)==!1)return n.push(o),n}let r=t.findAnyParameter(Uy),i=t.findAnyParameter(Wy),s=[],a=[];return typeof r!="undefined"&&r!==null&&(r.value.trim()==="*"?(s=e.getUniqueCollectionNames(),typeof i!="undefined"&&i!==null&&i.isVariableReference==!1&&i.hasInterpolations()==!1&&(a=i.getArrayValue())):r.isVariableReference==!1&&r.hasInterpolations()==!1&&(s=r.getArrayValue())),a.length>0?n=s.filter(function(o){return a.includes(o)==!1}):n=s,n}function us(t,e){var u,c,f,h,y,p;let n=WD(t,e),r=!1,i=!1,s=!1,a=null,o="";if(t.isClosingTag==!1){let d=jD(t),g=bb(t);d!=null&&(r=!0,o=d),g!=null&&(s=!0,a=g),i=t.hasParameter("paginate")}return{context:{collectionNames:n!=null?n:[],endPosition:(c=(u=t.endPosition)==null?void 0:u.char)!=null?c:0,aliasName:o,isAliased:r,isScoped:s,scopeName:a,isStartOfScope:!t.isClosingTag,line:(h=(f=t.startPosition)==null?void 0:f.line)!=null?h:0,startPosition:(p=(y=t.startPosition)==null?void 0:y.char)!=null?p:0,isPaginated:i,excludeCollections:[],includeCollections:[]},issues:[]}}function ja(t,e){if(t==null)return null;let n=Ei(e,":");return n.includes(":")&&(n=n.split(":")[0]),n=="status"||n=="taxonomy"||t.currentScope!=null&&t.currentScope.containsReference(n)?Hu(e):null}var GD=["from","folder","use","not_from","not_folder"],YD=["previous","next"],HD=["in","collection"];function cs(t,e){var n,r,i,s,a,o,l,u,c,f;if(t.isDynamic){let h=Yu(t.name);if(e.nodesInScope.length>0){let y=e.nodesInScope[e.nodesInScope.length-1];if(y!=null&&y.currentScope!=null){let p=Ba(y,y.currentScope),d=p.map(m=>m.name),g=Bi(e.leftWord);if(d.includes(g))return oe(as(e))}}if(h=="status"&&((n=e.context)==null?void 0:n.parameterContext)!=null)return oe(Hy((i=(r=e.context.parameterContext.parameter)==null?void 0:r.getArrayValue())!=null?i:[]));if(h=="taxonomy"){let y=Bi(t.name);if(e.project.hasTaxonomy(y)&&((s=e.context)==null?void 0:s.parameterContext)!=null)return oe($y((o=(a=e.context.parameterContext.parameter)==null?void 0:a.getArrayValue())!=null?o:[],y,e.project))}}if(t.name=="filter"||t.name=="query_scope")return oe(qu(e.project));if(e.nodesInScope.length>0){let h=e.nodesInScope[e.nodesInScope.length-1];if(h.hasMethodPart()&&YD.includes(h.getMethodNameValue())&&HD.includes(t.name))return oe(Ky(e.project))}return GD.includes(t.name)&&((l=e.context)==null?void 0:l.parameterContext)!=null?oe(qa((f=(c=(u=e.context)==null?void 0:u.parameterContext.parameter)==null?void 0:c.getArrayValue())!=null?f:[],e.project)):null}var $D={tagName:"collection:previous",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[...ss,{name:"in",aliases:["collection"],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"The collection to search in",expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"current",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Sets the current entry by ID",expectsTypes:["string"],isDynamic:!1,isRequired:!1}],augmentScope:Va,resolveDynamicParameter:ja,resolveSpecialType:us,suggestAlternativeParams:Ma,resovleParameterCompletionItems:cs,resolveCompletionItems:Ua,resolveDocumentation:t=>ke("collection:previous Tag","The `collection:previous` tag is used to show the entries that appear before the current entry, based on some entry order (publish date, alphabetical, or manual).",`{{# Retrieve the previous two entries, based on dates in ascending order. #}} {{ collection:previous in="articles" limit="2" sort="date:asc" }} -{{ /collection:previous }}`,"https://statamic.dev/tags/collection-previous")},Vs=HD;var $u=at(Vs,"collection:older"),Ku=at(Vs,"collection:newer");var $D={tagName:"collection:count",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[...ss,{isRequired:!0,name:"in",aliases:["from"],description:"The collection from which to count entries",acceptsVariableInterpolation:!0,allowsVariableReference:!0,expectsTypes:["string"],isDynamic:!1}],resolveSpecialType:us,resovleParameterCompletionItems:cs,resolveDocumentation:t=>qe("collection:count Tag","The `collection:count` tag returns the total number of entries in the specified collection(s). The collection count tag accepts the same parameters as the collection tag, allowing developers to count entries that meet specific conditions.",`Total entry count: {{ collection:count in="collection-name" }} -Draft count: {{ collection:count in="collection-name" status:in="draft" }}`,"https://statamic.dev/tags/collection-count")},zu=$D;var KD={tagName:"collection:next",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[...ss,{name:"in",aliases:["collection"],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"The collection to search in",expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"current",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Sets the current entry by ID",expectsTypes:["string"],isDynamic:!1,isRequired:!1}],augmentScope:Va,resolveDynamicParameter:ja,resolveSpecialType:us,suggestAlternativeParams:Ma,resovleParameterCompletionItems:cs,resolveCompletionItems:Ua,resolveDocumentation:t=>qe("collection:next Tag","The `collection:next` tag is used to show the entries that will appear after the current entry, based on some entry order (publish date, alphabetical, or manual).",`{{# Retrieve the next two entries, based on dates in ascending order. #}} +{{ /collection:previous }}`,"https://statamic.dev/tags/collection-previous")},Vs=$D;var $u=at(Vs,"collection:older"),Ku=at(Vs,"collection:newer");var KD={tagName:"collection:count",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[...ss,{isRequired:!0,name:"in",aliases:["from"],description:"The collection from which to count entries",acceptsVariableInterpolation:!0,allowsVariableReference:!0,expectsTypes:["string"],isDynamic:!1}],resolveSpecialType:us,resovleParameterCompletionItems:cs,resolveDocumentation:t=>ke("collection:count Tag","The `collection:count` tag returns the total number of entries in the specified collection(s). The collection count tag accepts the same parameters as the collection tag, allowing developers to count entries that meet specific conditions.",`Total entry count: {{ collection:count in="collection-name" }} +Draft count: {{ collection:count in="collection-name" status:in="draft" }}`,"https://statamic.dev/tags/collection-count")},zu=KD;var zD={tagName:"collection:next",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[...ss,{name:"in",aliases:["collection"],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"The collection to search in",expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"current",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Sets the current entry by ID",expectsTypes:["string"],isDynamic:!1,isRequired:!1}],augmentScope:Va,resolveDynamicParameter:ja,resolveSpecialType:us,suggestAlternativeParams:Ma,resovleParameterCompletionItems:cs,resolveCompletionItems:Ua,resolveDocumentation:t=>ke("collection:next Tag","The `collection:next` tag is used to show the entries that will appear after the current entry, based on some entry order (publish date, alphabetical, or manual).",`{{# Retrieve the next two entries, based on dates in ascending order. #}} {{ collection:next in="articles" limit="2" sort="date:asc" }} -{{ /collection:next }}`,"https://statamic.dev/tags/collection-next")},Xu=KD;function Ua(t){var n,r;let e=[];if(t.isPastTagPart==!1&&(t.leftWord=="collection"||t.leftWord=="/collection")&&t.leftChar==":"){let i=t.project.getCollectionNames();for(let s=0;so.name),a=Bi(t.leftWord);if(a==="taxonomy")return oe(Yy(t));if(s.includes(a))return e=as(t),oe(e);if(t.isCaretInTag&&!((n=t.context)==null?void 0:n.isInParameter)&&["collection","/collection"].includes(t.leftWord)==!1&&t.leftChar!=" "){let o=[];for(let l=0;l0)return _n(e)}}return Ae}var zD={tagName:"collection",hideFromCompletions:!1,introducedIn:null,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,parameters:ss,augmentScope:Va,resolveDynamicParameter:ja,resolveSpecialType:us,suggestAlternativeParams:Ma,resovleParameterCompletionItems:cs,resolveCompletionItems:Ua,resolveDocumentation:t=>qe("collection Tag","The `collection` tag provides access to entry data such as blog posts, products, etc.",`{{ collection:articles as="posts" }} +{{ /collection:next }}`,"https://statamic.dev/tags/collection-next")},Xu=zD;function Ua(t){var n,r;let e=[];if(t.isPastTagPart==!1&&(t.leftWord=="collection"||t.leftWord=="/collection")&&t.leftChar==":"){let i=t.project.getCollectionNames();for(let s=0;so.name),a=Bi(t.leftWord);if(a==="taxonomy")return oe(Yy(t));if(s.includes(a))return e=as(t),oe(e);if(t.isCaretInTag&&!((n=t.context)==null?void 0:n.isInParameter)&&["collection","/collection"].includes(t.leftWord)==!1&&t.leftChar!=" "){let o=[];for(let l=0;l0)return _n(e)}}return Se}var XD={tagName:"collection",hideFromCompletions:!1,introducedIn:null,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,parameters:ss,augmentScope:Va,resolveDynamicParameter:ja,resolveSpecialType:us,suggestAlternativeParams:Ma,resovleParameterCompletionItems:cs,resolveCompletionItems:Ua,resolveDocumentation:t=>ke("collection Tag","The `collection` tag provides access to entry data such as blog posts, products, etc.",`{{ collection:articles as="posts" }} {{ posts }} {{ title }} {{ /posts }} -{{ /collection:articles }}`,"https://statamic.dev/tags/collection")},vb=zD;var XD={tagName:"cache",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,introducedIn:null,allowsContentClose:!1,allowsArbitraryParameters:!1,resovleParameterCompletionItems:(t,e)=>t.name=="scope"?yt(["page","site"]):null,parameters:[{isRequired:!1,name:"for",description:"The duration the cache is valid for",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"key",description:"An arbitrary name the cache entry may be referenced by",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"scope",description:" The scope of the cached value. Either site or page.",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1}],resolveSpecialType:(t,e)=>{let n=t.findParameter("key"),r=null;if(n!=null){let i=n.value;i.trim().length>0&&(r={key:i,reference:t})}return{context:r,issues:[]}},resolveDocumentation:t=>qe("cache Tag","The `cache` tag can be used to save the results of an expensive template operation. The duration of the cache can be configured.",`{{ cache for="10 minutes" }} +{{ /collection:articles }}`,"https://statamic.dev/tags/collection")},vb=XD;var QD={tagName:"cache",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,introducedIn:null,allowsContentClose:!1,allowsArbitraryParameters:!1,resovleParameterCompletionItems:(t,e)=>t.name=="scope"?yt(["page","site"]):null,parameters:[{isRequired:!1,name:"for",description:"The duration the cache is valid for",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"key",description:"An arbitrary name the cache entry may be referenced by",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"scope",description:" The scope of the cached value. Either site or page.",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1}],resolveSpecialType:(t,e)=>{let n=t.findParameter("key"),r=null;if(n!=null){let i=n.value;i.trim().length>0&&(r={key:i,reference:t})}return{context:r,issues:[]}},resolveDocumentation:t=>ke("cache Tag","The `cache` tag can be used to save the results of an expensive template operation. The duration of the cache can be configured.",`{{ cache for="10 minutes" }} {{# Template code that won't be re-rendered for at least 10 minutes. #}} -{{ /cache }}`,"https://statamic.dev/tags/cache")},Nb=XD;var QD={tagName:"dump",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[],resolveCompletionItems:t=>t.leftWord=="dump"&&t.leftChar==":"?oe(db(t)):Ae,resolveDocumentation:t=>qe("dump Tag","The `dump` tag is a useful tag for debugging, and will display the raw data available at the point the tag is rendered.",`{{ collection:articles }} +{{ /cache }}`,"https://statamic.dev/tags/cache")},Nb=QD;var JD={tagName:"dump",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[],resolveCompletionItems:t=>t.leftWord=="dump"&&t.leftChar==":"?oe(db(t)):Se,resolveDocumentation:t=>ke("dump Tag","The `dump` tag is a useful tag for debugging, and will display the raw data available at the point the tag is rendered.",`{{ collection:articles }} {{# View all data available, for each entry. #}} {{ dump }} -{{ /collection:articles }}`,"https://statamic.dev/tags/dump")},Cb=QD;var JD={tagName:"404",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[],resolveDocumentation:t=>qe("404 (Not Found) Tag","The `404` (Not Found) tag will trigger a 404 status code, and display the 404 template to the site visitor.",`{{ unless logged_in }} +{{ /collection:articles }}`,"https://statamic.dev/tags/dump")},Cb=JD;var ZD={tagName:"404",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[],resolveDocumentation:t=>ke("404 (Not Found) Tag","The `404` (Not Found) tag will trigger a 404 status code, and display the 404 template to the site visitor.",`{{ unless logged_in }} {{# Display the 404 Not Found page. #}} {{ 404 }} -{{ /unless }}`,"https://statamic.dev/tags/404")},Pb=JD;var ZD={tagName:"link",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[{name:"to",description:"The relative path",expectsTypes:["string"],allowsVariableReference:!1,acceptsVariableInterpolation:!1,aliases:[],isRequired:!0,isDynamic:!1},{name:"absolute",description:"Whether to generate absolute URLs. Default false",expectsTypes:["boolean"],allowsVariableReference:!1,acceptsVariableInterpolation:!1,aliases:[],isRequired:!1,isDynamic:!1},{name:"id",description:"The ID of the entry to link to",expectsTypes:["string"],allowsVariableReference:!0,acceptsVariableInterpolation:!0,aliases:[],isDynamic:!1,isRequired:!1},{name:"in",description:"The handle of the site to link to.",expectsTypes:["string"],allowsVariableReference:!0,acceptsVariableInterpolation:!0,aliases:[],isDynamic:!1,isRequired:!1}],resolveDocumentation:t=>V("link Tag","The `link` tag accepts relative URLs or entry IDs and generates fully-qualified URLs to the desired content.","https://statamic.dev/tags/link")},Ab=ZD;var Sb={tagName:"loop",hideFromCompletions:!1,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,introducedIn:null,augmentScope:(t,e)=>(e.addVariable({name:"value",dataType:"*",sourceName:"*internal.loop.value",sourceField:null,introducedBy:t}),e),parameters:[{name:"times",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["number"],description:"The number of iterations",isRequired:!1,isDynamic:!1},{name:"from",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["number"],description:"The value to start iterating from. Default 1",isRequired:!1,isDynamic:!1},{name:"to",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["number"],description:"The value to stop iterating at",isRequired:!1,isDynamic:!1}],resolveDocumentation:t=>V("loop Tag","The `loop` tag is used to create an array of items between two values, and then iterate the created array. Alternatively, a max value can be set using the `times` parameter to loop that number of times.","https://statamic.dev/tags/loop")},Eb={tagName:"range",hideFromCompletions:!1,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,introducedIn:null,augmentScope:(t,e)=>(e.addVariable({name:"value",dataType:"*",sourceName:"*internal.loop.value",sourceField:null,introducedBy:t}),e),parameters:[{name:"times",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["number"],description:"The number of iterations",isRequired:!1,isDynamic:!1},{name:"from",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["number"],description:"The value to start iterating from. Default 1",isRequired:!1,isDynamic:!1},{name:"to",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["number"],description:"The value to stop iterating at",isRequired:!1,isDynamic:!1}],resolveDocumentation:t=>V("range Tag","The `range` tag is used to create an array of items between two values, and then iterate the created array. Alternatively, a max value can be set using the `times` parameter to loop that number of times.","https://statamic.dev/tags/loop")};var tr=je(ei());var js=class{constructor(){this.loadedDocuments=new Map;this.activeProject=null}getDocuments(){let e=[];return this.loadedDocuments.forEach(n=>{e.push(n)}),e}setProject(e){this.activeProject=e,this.loadedDocuments.forEach(n=>{this.activeProject!=null&&n.updateProject(this.activeProject)})}refreshDocumentState(){this.activeProject!=null&&this.setProject(this.activeProject)}hasDocument(e){return this.loadedDocuments.has(e)}createDocument(e){if(!this.loadedDocuments.has(e)){let n=new Kt;n.documentUri=e,this.loadedDocuments.set(e,n)}}loadDocument(e,n){this.loadedDocuments.set(e,Kt.fromText(n))}getDocument(e){return this.loadedDocuments.get(e)}updateDocument(e,n){var r,i;if(this.loadedDocuments.has(e)){let s=this.loadedDocuments.get(e);s.loadString(n);let a=(i=(r=cr.instance)==null?void 0:r.getStructure())==null?void 0:i.findView(e);a!=null&&(a.document=s)}}createOrUpdate(e,n){this.createDocument(e),this.updateDocument(e,n)}getDocumentErrors(e){return this.loadedDocuments.has(e)?this.loadedDocuments.get(e).errors.all():[]}};js.instance=null;(typeof js.instance=="undefined"||js.instance)&&(js.instance=new js);var Ib=js;var ud=new Ib;function $e(t,e){return e.trim().length>0?Hu(e):null}var Wa=[{isRequired:!1,name:"src",description:"The name of the partial view",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["string"],isDynamic:!1}];var cl=je(ei());function Ga(t,e){var n;if(t.isDynamic&&e.currentNode!=null&&e.currentNode.getTagName()=="partial"&&e.currentNode.hasMethodPart()){let r=e.currentNode.getMethodNameValue();if(r.trim().length>0&&((n=cr.instance)==null?void 0:n.hasStructure())){let i=cr.instance.getStructure().findRelativeView(r);if(i!=null&&i.varReferenceNames.has(t.name)){let s=i.varReferenceNames.get(t.name);if(i.document!=null&&i.document.hasFrontMatter()){let a=i.document.getFrontMatterScope();if(a!=null){let o=a.getList(s);if(o!=null)return yb(o.getVariableNames())}}}}}if(t.name=="src"){let r=e.project.getViews(),i=[];return r.forEach(s=>{if(ci.hasDetails(s.documentUri)){let a=ci.documentDetails.get(s.documentUri);i.push({label:a.documentName+"("+s.relativeDisplayName+")",insertText:s.relativeDisplayName,detail:a.documentName,documentation:{kind:cl.MarkupKind.Markdown,value:a.documentDescription},kind:cl.CompletionItemKind.File})}else i.push({label:s.relativeDisplayName,kind:cl.CompletionItemKind.File})}),oe(i)}return null}var ex={tagName:"partial:exists",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,parameters:Wa,introducedIn:"3.2.7",resovleParameterCompletionItems:Ga,resolveDocumentation:t=>V("partial:exists Tag","The `partial:exists` can be used within conditional statements to test if a partial exists.","https://statamic.dev/tags/partial-exists")},Qu=ex;var tx={tagName:"partial:if_exists",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,parameters:Wa,introducedIn:"3.2.7",resovleParameterCompletionItems:Ga,resolveDocumentation:t=>V("partial:if_exists Tag","The `partial:if_exists` can be used to output the contents of a partial if it exists.","https://statamic.dev/tags/partial-if-exists")},Ju=tx;function Db(t){if(t.getTagName()!="partial")return null;let e="";if(t.hasMethodPart())e=t.getMethodNameValue();else{let n=t.findParameter("src");n!=null&&(e=n.value)}return e}var nx=[xe(Qu),xe(Ju)],rx={tagName:"partial",hideFromCompletions:!1,injectParentScope:!1,allowsArbitraryParameters:!0,parameters:Wa,requiresClose:!1,allowsContentClose:!0,introducedIn:null,resolveDocumentation:t=>`**Partial Tag** +{{ /unless }}`,"https://statamic.dev/tags/404")},Pb=ZD;var ex={tagName:"link",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[{name:"to",description:"The relative path",expectsTypes:["string"],allowsVariableReference:!1,acceptsVariableInterpolation:!1,aliases:[],isRequired:!0,isDynamic:!1},{name:"absolute",description:"Whether to generate absolute URLs. Default false",expectsTypes:["boolean"],allowsVariableReference:!1,acceptsVariableInterpolation:!1,aliases:[],isRequired:!1,isDynamic:!1},{name:"id",description:"The ID of the entry to link to",expectsTypes:["string"],allowsVariableReference:!0,acceptsVariableInterpolation:!0,aliases:[],isDynamic:!1,isRequired:!1},{name:"in",description:"The handle of the site to link to.",expectsTypes:["string"],allowsVariableReference:!0,acceptsVariableInterpolation:!0,aliases:[],isDynamic:!1,isRequired:!1}],resolveDocumentation:t=>V("link Tag","The `link` tag accepts relative URLs or entry IDs and generates fully-qualified URLs to the desired content.","https://statamic.dev/tags/link")},Sb=ex;var Ab={tagName:"loop",hideFromCompletions:!1,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,introducedIn:null,augmentScope:(t,e)=>(e.addVariable({name:"value",dataType:"*",sourceName:"*internal.loop.value",sourceField:null,introducedBy:t}),e),parameters:[{name:"times",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["number"],description:"The number of iterations",isRequired:!1,isDynamic:!1},{name:"from",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["number"],description:"The value to start iterating from. Default 1",isRequired:!1,isDynamic:!1},{name:"to",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["number"],description:"The value to stop iterating at",isRequired:!1,isDynamic:!1}],resolveDocumentation:t=>V("loop Tag","The `loop` tag is used to create an array of items between two values, and then iterate the created array. Alternatively, a max value can be set using the `times` parameter to loop that number of times.","https://statamic.dev/tags/loop")},Eb={tagName:"range",hideFromCompletions:!1,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,introducedIn:null,augmentScope:(t,e)=>(e.addVariable({name:"value",dataType:"*",sourceName:"*internal.loop.value",sourceField:null,introducedBy:t}),e),parameters:[{name:"times",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["number"],description:"The number of iterations",isRequired:!1,isDynamic:!1},{name:"from",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["number"],description:"The value to start iterating from. Default 1",isRequired:!1,isDynamic:!1},{name:"to",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["number"],description:"The value to stop iterating at",isRequired:!1,isDynamic:!1}],resolveDocumentation:t=>V("range Tag","The `range` tag is used to create an array of items between two values, and then iterate the created array. Alternatively, a max value can be set using the `times` parameter to loop that number of times.","https://statamic.dev/tags/loop")};var tr=je(ei());var js=class{constructor(){this.loadedDocuments=new Map;this.activeProject=null}getDocuments(){let e=[];return this.loadedDocuments.forEach(n=>{e.push(n)}),e}setProject(e){this.activeProject=e,this.loadedDocuments.forEach(n=>{this.activeProject!=null&&n.updateProject(this.activeProject)})}refreshDocumentState(){this.activeProject!=null&&this.setProject(this.activeProject)}hasDocument(e){return this.loadedDocuments.has(e)}createDocument(e){if(!this.loadedDocuments.has(e)){let n=new Kt;n.documentUri=e,this.loadedDocuments.set(e,n)}}loadDocument(e,n){this.loadedDocuments.set(e,Kt.fromText(n))}getDocument(e){return this.loadedDocuments.get(e)}updateDocument(e,n){var r,i;if(this.loadedDocuments.has(e)){let s=this.loadedDocuments.get(e);s.loadString(n);let a=(i=(r=cr.instance)==null?void 0:r.getStructure())==null?void 0:i.findView(e);a!=null&&(a.document=s)}}createOrUpdate(e,n){this.createDocument(e),this.updateDocument(e,n)}getDocumentErrors(e){return this.loadedDocuments.has(e)?this.loadedDocuments.get(e).errors.all():[]}};js.instance=null;(typeof js.instance=="undefined"||js.instance)&&(js.instance=new js);var Ib=js;var ud=new Ib;function $e(t,e){return e.trim().length>0?Hu(e):null}var Wa=[{isRequired:!1,name:"src",description:"The name of the partial view",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["string"],isDynamic:!1}];var cl=je(ei());function Ga(t,e){var n;if(t.isDynamic&&e.currentNode!=null&&e.currentNode.getTagName()=="partial"&&e.currentNode.hasMethodPart()){let r=e.currentNode.getMethodNameValue();if(r.trim().length>0&&((n=cr.instance)==null?void 0:n.hasStructure())){let i=cr.instance.getStructure().findRelativeView(r);if(i!=null&&i.varReferenceNames.has(t.name)){let s=i.varReferenceNames.get(t.name);if(i.document!=null&&i.document.hasFrontMatter()){let a=i.document.getFrontMatterScope();if(a!=null){let o=a.getList(s);if(o!=null)return yb(o.getVariableNames())}}}}}if(t.name=="src"){let r=e.project.getViews(),i=[];return r.forEach(s=>{if(ci.hasDetails(s.documentUri)){let a=ci.documentDetails.get(s.documentUri);i.push({label:a.documentName+"("+s.relativeDisplayName+")",insertText:s.relativeDisplayName,detail:a.documentName,documentation:{kind:cl.MarkupKind.Markdown,value:a.documentDescription},kind:cl.CompletionItemKind.File})}else i.push({label:s.relativeDisplayName,kind:cl.CompletionItemKind.File})}),oe(i)}return null}var tx={tagName:"partial:exists",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,parameters:Wa,introducedIn:"3.2.7",resovleParameterCompletionItems:Ga,resolveDocumentation:t=>V("partial:exists Tag","The `partial:exists` can be used within conditional statements to test if a partial exists.","https://statamic.dev/tags/partial-exists")},Qu=tx;var nx={tagName:"partial:if_exists",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,parameters:Wa,introducedIn:"3.2.7",resovleParameterCompletionItems:Ga,resolveDocumentation:t=>V("partial:if_exists Tag","The `partial:if_exists` can be used to output the contents of a partial if it exists.","https://statamic.dev/tags/partial-if-exists")},Ju=nx;function Db(t){if(t.getTagName()!="partial")return null;let e="";if(t.hasMethodPart())e=t.getMethodNameValue();else{let n=t.findParameter("src");n!=null&&(e=n.value)}return e}var rx=[xe(Qu),xe(Ju)],ix={tagName:"partial",hideFromCompletions:!1,injectParentScope:!1,allowsArbitraryParameters:!0,parameters:Wa,requiresClose:!1,allowsContentClose:!0,introducedIn:null,resolveDocumentation:t=>`**Partial Tag** Includes another view into the current template. [Documentation Reference](https://statamic.dev/tags/partial) -`,resolveDynamicParameter:$e,resovleParameterCompletionItems:Ga,resolveCompletionItems:t=>{let e=[];if(t.leftChar=='"'&&t.leftWord==':src="')return{items:[],analyzeDefaults:!0,isExclusiveResult:!1};if((t.leftWord=="partial"||t.leftWord=="/partial")&&t.leftChar==":"||t.leftWord=='src="'&&t.leftChar=='"')return t.project.getViews().forEach(r=>{let i=decodeURIComponent(r.documentUri);if(ci.hasDetails(i)){let s=ci.documentDetails.get(i);e.push({label:s.documentName+"("+r.relativeDisplayName+")",insertText:r.relativeDisplayName,detail:s.documentName,documentation:{kind:tr.MarkupKind.Markdown,value:s.documentDescription},kind:tr.CompletionItemKind.File})}else e.push({label:r.relativeDisplayName,kind:tr.CompletionItemKind.File})}),t.leftWord!='src="'&&(e=e.concat(nx)),{analyzeDefaults:!1,isExclusiveResult:!0,items:e};if(t.currentNode!=null&&t.project!=null){let n=Db(t.currentNode);if(n!=null&&n.trim().length>0){let r=t.project.findRelativeView(n);if(r!=null&&ud.hasDocument(r.documentUri)){let i=ud.getDocument(r.documentUri);if(i!=null){let s=i.getAllAntlersNodes(),a=ix(s),o=[];r.varReferenceNames!=null&&r.varReferenceNames.forEach((u,c)=>{a.push(c)});let l=[];if(r.injectsParameters.length>0){let u={start:{line:t.position.line,character:t.position.character-0},end:t.position};r.injectsParameters.forEach(c=>{let f=c.name+'="$1"';o.includes(c.name)||(o.push(c.name),l.push({label:c.name,kind:tr.CompletionItemKind.Value,insertTextFormat:tr.InsertTextFormat.Snippet,textEdit:tr.TextEdit.replace(u,f),command:{title:"Suggest",command:"editor.action.triggerSuggest"}}))})}if(a.length>0){let u={start:{line:t.position.line,character:t.position.character-0},end:t.position};a.forEach(c=>{let f=c+'="$1"';o.includes(c)||(o.push(c),l.push({label:c,kind:tr.CompletionItemKind.Value,insertTextFormat:tr.InsertTextFormat.Snippet,textEdit:tr.TextEdit.replace(u,f),command:{title:"Suggest",command:"editor.action.triggerSuggest"}}))})}return _n(l)}}}}return{analyzeDefaults:!0,isExclusiveResult:!1,items:[]}}};function ix(t){let e=[];return t.forEach(n=>{if(n.isTagNode||n.isClosingTag||n.isComment||n.hasMethodPart()&&n.getMethodNameValue().length>0||n.name!=null&&n.name.content.includes("["))return;let r=n.getTagName();!e.includes(r)&&r!="#"&&r!="slot"&&e.push(r)}),e}var xb=rx;var sx={tagName:"increment:reset",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:"3.2.28",parameters:[{isRequired:!0,name:"counter",aliases:[],description:"The incrementing counter to reset",acceptsVariableInterpolation:!1,allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"to",aliases:[],description:"An optional value to reset the counter to before incrementing starts again",acceptsVariableInterpolation:!1,allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1}],resolveDocumentation:t=>qe("increment:reset Tag","The `increment:reset` tag can be used to reset the value of an incrementing counter.",`{{ array_variable }} +`,resolveDynamicParameter:$e,resovleParameterCompletionItems:Ga,resolveCompletionItems:t=>{let e=[];if(t.leftChar=='"'&&t.leftWord==':src="')return{items:[],analyzeDefaults:!0,isExclusiveResult:!1};if((t.leftWord=="partial"||t.leftWord=="/partial")&&t.leftChar==":"||t.leftWord=='src="'&&t.leftChar=='"')return t.project.getViews().forEach(r=>{let i=decodeURIComponent(r.documentUri);if(ci.hasDetails(i)){let s=ci.documentDetails.get(i);e.push({label:s.documentName+"("+r.relativeDisplayName+")",insertText:r.relativeDisplayName,detail:s.documentName,documentation:{kind:tr.MarkupKind.Markdown,value:s.documentDescription},kind:tr.CompletionItemKind.File})}else e.push({label:r.relativeDisplayName,kind:tr.CompletionItemKind.File})}),t.leftWord!='src="'&&(e=e.concat(rx)),{analyzeDefaults:!1,isExclusiveResult:!0,items:e};if(t.currentNode!=null&&t.project!=null){let n=Db(t.currentNode);if(n!=null&&n.trim().length>0){let r=t.project.findRelativeView(n);if(r!=null&&ud.hasDocument(r.documentUri)){let i=ud.getDocument(r.documentUri);if(i!=null){let s=i.getAllAntlersNodes(),a=sx(s),o=[];r.varReferenceNames!=null&&r.varReferenceNames.forEach((u,c)=>{a.push(c)});let l=[];if(r.injectsParameters.length>0){let u={start:{line:t.position.line,character:t.position.character-0},end:t.position};r.injectsParameters.forEach(c=>{let f=c.name+'="$1"';o.includes(c.name)||(o.push(c.name),l.push({label:c.name,kind:tr.CompletionItemKind.Value,insertTextFormat:tr.InsertTextFormat.Snippet,textEdit:tr.TextEdit.replace(u,f),command:{title:"Suggest",command:"editor.action.triggerSuggest"}}))})}if(a.length>0){let u={start:{line:t.position.line,character:t.position.character-0},end:t.position};a.forEach(c=>{let f=c+'="$1"';o.includes(c)||(o.push(c),l.push({label:c,kind:tr.CompletionItemKind.Value,insertTextFormat:tr.InsertTextFormat.Snippet,textEdit:tr.TextEdit.replace(u,f),command:{title:"Suggest",command:"editor.action.triggerSuggest"}}))})}return _n(l)}}}}return{analyzeDefaults:!0,isExclusiveResult:!1,items:[]}}};function sx(t){let e=[];return t.forEach(n=>{if(n.isTagNode||n.isClosingTag||n.isComment||n.hasMethodPart()&&n.getMethodNameValue().length>0||n.name!=null&&n.name.content.includes("["))return;let r=n.getTagName();!e.includes(r)&&r!="#"&&r!="slot"&&e.push(r)}),e}var xb=ix;var ax={tagName:"increment:reset",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:"3.2.28",parameters:[{isRequired:!0,name:"counter",aliases:[],description:"The incrementing counter to reset",acceptsVariableInterpolation:!1,allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"to",aliases:[],description:"An optional value to reset the counter to before incrementing starts again",acceptsVariableInterpolation:!1,allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1}],resolveDocumentation:t=>ke("increment:reset Tag","The `increment:reset` tag can be used to reset the value of an incrementing counter.",`{{ array_variable }} {{ increment:counter_name }} {{ /array_variable }} {{ increment:reset counter="counter_name" }} -`,null)},Zu=sx;var ax=[xe(Zu)],ox={tagName:"increment",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[{isRequired:!1,name:"from",aliases:[],description:"The number to start incrementing by",acceptsVariableInterpolation:!1,allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1},{isRequired:!1,name:"by",aliases:[],description:"The number to increment by",acceptsVariableInterpolation:!1,allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1}],resolveCompletionItems:t=>t.leftWord=="increment"||t.leftWord=="/increment"&&t.leftChar==":"?oe(ax):Ae,resolveDocumentation:t=>V("increment Tag","The `increment` tag can be used to increment a value each time the tag is encountered.","https://statamic.dev/tags/increment")},Rb=ox;var cd=class{constructor(e){this.node=e}},wb={tagName:"yields",hideFromCompletions:!1,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!0,parameters:[],introducedIn:null,requiresClose:!1,resolveSpecialType:(t,e)=>({context:new cd(t),issues:[]})},Ob={tagName:"yield",hideFromCompletions:!1,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!0,parameters:[],introducedIn:null,requiresClose:!1,resolveSpecialType:(t,e)=>({context:new cd(t),issues:[]}),resolveDocumentation:t=>V("yield Tag","The `yield` tag may be used to push rendered content to named regions within a template's structure.","https://statamic.dev/tags/yield")};var ec=je(vt());var Lb=[{handle:"access cp"},{handle:"configure collections"},{handle:"[view edit create delete publish reorder] {collection} entries"},{handle:"configure structures"},{handle:"[view edit] {structure} structure"},{handle:"edit {global} globals"},{handle:"[view upload edit move rename delete] {container} assets"},{handle:"[view perform] updates"},{handle:"[view edit create delete] users"},{handle:"change passwords"},{handle:"edit roles"},{handle:"configure forms"},{handle:"[view delete] {form} submissions"}];var fs=class{constructor(){this.contextItems=new Map;this.triggerNames=[];this.collectionTriggers=[];this.collectionTriggerCaps=[];this.globalTriggers=[];this.globalTriggerCaps=[];this.formTriggers=[];this.formTriggerCaps=[];this.structureTriggers=[];this.structureTriggerCaps=[];this.assetTriggers=[];this.assetTriggerCaps=[]}getCollectionTriggerCaps(){return this.collectionTriggerCaps}getGlobalTriggerCaps(){return this.globalTriggerCaps}getFormTriggerCaps(){return this.formTriggerCaps}getStructureTriggerCaps(){return this.structureTriggerCaps}getAssetTriggerCaps(){return this.assetTriggerCaps}loadCorePermissions(){this.registerPermissions(Lb)}getTriggerNames(){return this.triggerNames}isCollectionTrigger(e){return this.collectionTriggers.includes(e)}isGlobalTrigger(e){return this.globalTriggers.includes(e)}isFormTrigger(e){return this.formTriggers.includes(e)}isStructureTrigger(e){return this.structureTriggers.includes(e)}isAssetTrigger(e){return this.assetTriggers.includes(e)}getTriggerContextItems(e){return this.contextItems.has(e)?this.contextItems.get(e):[]}registerSpecialTrigger(e,n,r){n=="{collection}"?(this.collectionTriggerCaps.includes(r)==!1&&this.collectionTriggerCaps.push(r),this.collectionTriggers.includes(e)==!1&&this.collectionTriggers.push(e)):n=="{structure}"?(this.structureTriggerCaps.includes(r)==!1&&this.structureTriggerCaps.push(r),this.structureTriggers.includes(e)==!1&&this.structureTriggers.push(e)):n=="{container}"?(this.assetTriggerCaps.includes(r)==!1&&this.assetTriggerCaps.push(r),this.assetTriggers.includes(e)==!1&&this.assetTriggers.push(e)):n=="{global}"?(this.globalTriggerCaps.includes(r)==!1&&this.globalTriggerCaps.push(r),this.globalTriggers.includes(e)==!1&&this.globalTriggers.push(e)):n=="{form}"&&(this.formTriggerCaps.includes(r)==!1&&this.formTriggerCaps.push(r),this.formTriggers.includes(e)==!1&&this.formTriggers.push(e))}addContextToTrigger(e,n){var r;this.triggerNames.includes(e)==!1&&this.triggerNames.push(e),this.contextItems.has(e)==!1?this.contextItems.set(e,[n]):(r=this.contextItems.get(e))==null||r.push(n)}registerPermissions(e){for(let n=0;nh.trim().length>0),f=r.handle.substr(l+1).split(" ").filter(h=>h.trim().length>0);i=c,f.length==2?(s=f[0],a=f[1]):f.length==1&&(s="",a=f[0])}else{let o=r.handle.split(" ").filter(l=>l.trim().length>0);o.length==2&&(i=[o[0]],a=o[1])}for(let o=0;o0?this.registerSpecialTrigger(l,s,a):this.addContextToTrigger(l,a)}}}};fs.instance=null;(typeof fs.instance=="undefined"||fs.instance==null)&&(fs.instance=new fs,fs.instance.loadCorePermissions());var nr=fs;function Fb(t,e){var r,i,s,a,o,l,u,c,f,h,y,p,d,g,m,b,_,N,C;let n=[];if(t.trim().length==0){let G=(i=(r=nr.instance)==null?void 0:r.getTriggerNames())!=null?i:[];for(let L=0;Lae.trim().length>0),L=G[0],M=(a=(s=nr.instance)==null?void 0:s.getTriggerContextItems(L))!=null?a:[],$=(o=nr.instance)==null?void 0:o.isCollectionTrigger(L),K=(l=nr.instance)==null?void 0:l.isGlobalTrigger(L),ne=(u=nr.instance)==null?void 0:u.isFormTrigger(L),re=(c=nr.instance)==null?void 0:c.isStructureTrigger(L),ye=(f=nr.instance)==null?void 0:f.isAssetTrigger(L),Ce=[];if(G.length<=2){$?Ce=Ce.concat(e.project.getUniqueCollectionNames()):K?Ce=Ce.concat(e.project.getUniqueGlobalsNames()):ne?Ce=Ce.concat(e.project.getUniqueFormNames()):re?Ce=Ce.concat(e.project.getUniqueNavigationMenuNames()):ye&&(Ce=Ce.concat(e.project.getUniqueAssetNames())),M.length>0&&(Ce=Ce.concat(M)),Ce=[...new Set(Ce)];for(let ae=0;aeV("user:can Tag","The `user:can` tag is used to check if the currently authenticated user has a specific set of permissions. When used as a tag pair, the tag contents will only be rendered if the user has the specified permissions.","https://statamic.dev/tags/user-can")},Ya=lx;var ux={tagName:"user:logout",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[{name:"redirect",description:"An optional URL to redirect the user after being logged out",aliases:[],isRequired:!1,acceptsVariableInterpolation:!0,allowsVariableReference:!1,isDynamic:!1,expectsTypes:["string"]}],resolveDocumentation:t=>V("user:logout Tag","The `user:logout` tag will sign out the currently authenticated user. An optional `redirect` parameter may be used to redirect the visitor to a different page after being logged out.","https://statamic.dev/tags/user-logout")},Ha=ux;var cx={tagName:"user:logout_url",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[{name:"redirect",description:"An optional URL to redirect the user after being logged out",aliases:[],isRequired:!1,acceptsVariableInterpolation:!0,allowsVariableReference:!1,isDynamic:!1,expectsTypes:["string"]}],resolveDocumentation:t=>qe("user:logout_url","The `user:logout_url` tag can be used to retrieve the URL that will sign the current user out.",'Log out',"https://statamic.dev/tags/user-logout_url")},$a=cx;var kb={tagName:"switch",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[{name:"between",description:"A set of values to iterate over",aliases:[],isRequired:!1,acceptsVariableInterpolation:!0,allowsVariableReference:!1,isDynamic:!1,expectsTypes:["string","array"]},{name:"for",description:"A unique name for the switch instance",aliases:[],isRequired:!1,acceptsVariableInterpolation:!0,allowsVariableReference:!1,isDynamic:!1,expectsTypes:["string"]}],resolveDocumentation:t=>V("switch Tag","The `switch` tag can be used to alternate between a set of values each time the tag is evaluated.","https://statamic.dev/tags/switch")},Mb={tagName:"rotate",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,introducedIn:null,allowsArbitraryParameters:!1,allowsContentClose:!1,parameters:[{name:"between",description:"A set of values to iterate over",aliases:[],isRequired:!1,acceptsVariableInterpolation:!0,allowsVariableReference:!1,isDynamic:!1,expectsTypes:["string","array"]},{name:"for",description:"A unique name for the switch instance",aliases:[],isRequired:!1,acceptsVariableInterpolation:!0,allowsVariableReference:!1,isDynamic:!1,expectsTypes:["string"]}],resolveDocumentation:t=>V("rotate Tag","The `rotate` tag can be used to alternate between a set of values each time the tag is evaluated.","https://statamic.dev/tags/switch")};var fx={tagName:"oauth",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[{name:"provider",description:"The OAuth provider to be used",aliases:[],isRequired:!0,acceptsVariableInterpolation:!0,allowsVariableReference:!1,isDynamic:!1,expectsTypes:["string"]},{name:"redirect",description:"The URL to be taken to after authenticating",aliases:[],isRequired:!0,acceptsVariableInterpolation:!0,allowsVariableReference:!1,isDynamic:!1,expectsTypes:["string"]}],resovleParameterCompletionItems:(t,e)=>t.name=="provider"?yt(e.project.getOAuthProviders()):null,resolveDocumentation:t=>qe("oauth Tag","The `oauth` tag can be used to generate login URls for various third-party services.",'Sign In with Github',"https://statamic.dev/tags/oauth")},Bb=fx;var px={tagName:"session:dump",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,parameters:[],introducedIn:null,resolveDocumentation:t=>V("session:dump Tag","The `session:dump` tag will display the contents of the user's session to the browser. This tag behaves similarly to the `dd` helper functions, but returns just the session data.","https://statamic.dev/tags/session-dump")},nc=px;var fl=class{constructor(e){this.node=e}};var dx={tagName:"session:set",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!0,allowsContentClose:!0,parameters:[],introducedIn:null,resolveDynamicParameter:$e,resolveSpecialType:(t,e)=>({context:new fl(t),issues:[]}),resolveDocumentation:t=>V("session:set Tag","The `session:set` tag is used to add new data to the user's session.","https://statamic.dev/tags/session-set")},rc=dx;var Us=class{constructor(){this.knownVariables=new Map}registerDocumentSessionVariables(e,n){this.knownVariables.has(e)||this.knownVariables.set(e,new Map);let r=this.knownVariables.get(e);r.clear();for(let i=0;i{n.forEach((r,i)=>{e.includes(i)==!1&&e.push(i)})}),e}};Us.instance=null;(typeof Us.instance=="undefined"||Us.instance==null)&&(Us.instance=new Us);var pl=Us;var qb=je(vt());function Vb(t,e){let n=[],r=t.getArrayValue(),i=e.filter(s=>!r.includes(s));for(let s=0;s{var n,r,i;if(t.name=="keys"&&((n=e.context)==null?void 0:n.parameterContext)!=null){let s=(i=(r=pl.instance)==null?void 0:r.getKnownSessionVariableNames())!=null?i:[];if(e.context.parameterContext.parameter!=null)return Vb(e.context.parameterContext.parameter,s)}return null},resolveDocumentation:t=>V("session:forget Tag","The `session:forget` tag is used to remove variables from the user's session.","https://statamic.dev/tags/session-forget")},ic=hx;var mx={tagName:"session:flush",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,parameters:[],introducedIn:null,resolveDocumentation:t=>V("session:flush Tag","The `session:flush` tag will clear all values from the visitor's session. If the visitor is currently signed in they will also be signed out.","https://statamic.dev/tags/session-flush")},sc=mx;var gx={tagName:"session:flash",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!0,allowsContentClose:!1,parameters:[],introducedIn:null,resolveDynamicParameter:$e,resolveSpecialType:(t,e)=>({context:new fl(t),issues:[]}),resolveDocumentation:t=>V("session:flash Tag","The `session:flash` tag can be used to add a value to the user's session. Flashed values only persist for a single request, and are then removed.","https://statamic.dev/tags/session-flash")},ac=gx;var _x={tagName:"markdown:indent",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!0,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[],resolveDocumentation:t=>V("markdown:indent Tag","The `markdown:indent` tag is similar to the markdown tag, but will ignore leading whitepsace while rendering the tag's content as markdown.","https://statamic.dev/tags/markdown-indent")},oc=_x;var yx=[xe(oc)],bx={tagName:"markdown",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!0,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[],resolveCompletionItems:t=>t.isPastTagPart==!1&&(t.leftWord=="markdown"||t.leftWord=="/markdown")&&t.leftChar==":"?oe(yx):Ae,resolveDocumentation:t=>V("markdown Tag","The `markdown` tag can be used to render the tags contents as markdown.","https://statamic.dev/tags/markdown")},jb=bx;var Ub=je(ei());function lc(t,e){let n=[],r=e;if(t.trim().length>0&&t.includes(".")&&t.endsWith(".")){let i=t.substr(0,t.length-1);r=r.filter(s=>s.startsWith(i))}for(let i=0;i{if(t.leftMeaningfulWord=="route"){let e=Gu(t);return oe(Wb(e,t.project))}return Ae},resolveDocumentation:t=>V("route Tag","The `route` tag can be used to generate a full URL [to a named route](https://laravel.com/docs/8.x/routing#named-routes), including any defined route parameters.","https://statamic.dev/tags/route")},Gb=Tx;var uc=je(vt()),Yb=[{label:"301 Permanent",insertText:"301",kind:uc.CompletionItemKind.EnumMember},{label:"302 Temporary",insertText:"302",kind:uc.CompletionItemKind.EnumMember},{label:"404 Not Found",insertText:"404",kind:uc.CompletionItemKind.EnumMember}];var vx={tagName:"redirect",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[{name:"to",description:"The destination URL",aliases:["url"],allowsVariableReference:!1,acceptsVariableInterpolation:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!0},{name:"response",description:"The HTTP response code to use",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1,isRequired:!1}],resovleParameterCompletionItems:t=>t.name=="response"?oe(Yb):Ae,resolveDocumentation:t=>V("redirect Tag","The `redirect` tag can be used to redirect the site visitor to a URL or named route. An optional HTTP status code can also be specified on the response using the `response` parameter.","https://statamic.dev/tags/redirect")},Hb=vx;var Kb=je(vt());var Ws=class{constructor(){this.knownSections=new Map}registerDocumentSections(e,n){this.knownSections.has(e)||this.knownSections.set(e,new Map);let r=this.knownSections.get(e);r.clear();for(let i=0;i{n.forEach((r,i)=>{e.includes(i)==!1&&e.push(i)})}),e}};Ws.instance=null;(typeof Ws.instance=="undefined"||Ws.instance==null)&&(Ws.instance=new Ws);var $b=Ws;var Nx={tagName:"section",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!0,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[],resolveCompletionItems:t=>{var e,n;if((t.leftWord=="section"||t.leftWord=="/section")&&t.leftChar==":"){let r=[],i=(n=(e=$b.instance)==null?void 0:e.getKnownSectionNames())!=null?n:[];for(let s=0;sV("section Tag","The `section` tag is used to push content to a named region defined by the `yield` tag.","https://statamic.dev/tags/section")},zb=Nx;var Cx={tagName:"obfuscate",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[],resolveDocumentation:t=>V("obfuscate Tag","The `obfuscate` tag converts the tags's content into a format that is difficult for bots to read, but can easily be viewed by users within their browser.","https://statamic.dev/tags/obfuscate")},Xb=Cx;var Px={tagName:"parent",hideFromCompletions:!1,requiresClose:!1,allowsContentClose:!0,allowsArbitraryParameters:!1,injectParentScope:!0,introducedIn:null,parameters:[],resolveDocumentation:t=>V("parent Tag","The `parent` tag provides access to data from the current page's parent (the URL one level above the current page).","https://statamic.dev/tags/parent")},Qb=Px;function fd(t,e){return lc(t,e.getTranslationKeys())}var Ax=["translate","trans","trans_choice"],cc={tagName:"translate",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsContentClose:!1,introducedIn:null,allowsArbitraryParameters:!0,parameters:[{isRequired:!1,name:"key",description:"The key of the translation string to find",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"locale",description:"The locale to be used when translating",acceptsVariableInterpolation:!1,aliases:["site"],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"count",description:"The number of items to use for pluralization",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1}],resovleParameterCompletionItems:(t,e)=>{var n;if(t.name=="key"){let r="";return((n=e.context)==null?void 0:n.parameterContext)!=null&&e.context.parameterContext.parameter!=null&&(r=e.context.parameterContext.parameter.value),oe(fd(r,e.project))}return Ae},resolveDynamicParameter:$e,resolveCompletionItems:t=>{if(t.leftMeaningfulWord!=null&&Ax.includes(t.leftMeaningfulWord)){let e=Gu(t);return oe(fd(e,t.project))}return Ae},resolveDocumentation:t=>V("trans Tag","The `trans` tag can be used to retrieve a string for the current locale's language file.","https://statamic.dev/tags/trans")},Jb=at(cc,"trans"),pd=at(cc,"trans_choice");pd.resolveDocumentation=t=>V("trans_choice Tag","The `trans_choice` tag can be used to retrieve a pluralized string for the current locale's language file.","https://statamic.dev/tags/trans#pluralization");var Sx={tagName:"svg",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsArbitraryParameters:!0,allowsContentClose:!1,introducedIn:null,parameters:[{isRequired:!1,name:"src",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"The SVG filename relative to the project root",expectsTypes:["string"],isDynamic:!1}],resolveDynamicParameter:$e,resolveDocumentation:t=>V("svg Tag","The `svg` tag can be used to render inline SVGs, as well as set attributes on the rendered `` element.","https://statamic.dev/tags/svg")},Zb=Sx;function fc(t){return[{name:"basename",dataType:"string",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"extension",dataType:"string",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"filename",dataType:"string",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"focus",dataType:"string",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"focus_css",dataType:"string",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"height",dataType:"number",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"is_asset",dataType:"boolean",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"is_image",dataType:"boolean",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"path",dataType:"string",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"size",dataType:"string",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"size_bytes",dataType:"number",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"size_gigabytes",dataType:"number",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"size_kilobytes",dataType:"number",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"size_megabytes",dataType:"number",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"width",dataType:"number",sourceName:"*internal.asset",sourceField:null,introducedBy:t}]}var Ex={tagName:"asset",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[{isRequired:!0,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"The path to the file",expectsTypes:["string"],isDynamic:!1,name:"url"}],augmentScope:(t,e)=>(e.addVariables(fc(t)),e),resolveDocumentation:t=>qe("asset Tag","The `asset` tag can be used to retrive Assets by supplying a URL.",`{{ asset url="/url/for/asset.png" }} +`,null)},Zu=ax;var ox=[xe(Zu)],lx={tagName:"increment",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[{isRequired:!1,name:"from",aliases:[],description:"The number to start incrementing by",acceptsVariableInterpolation:!1,allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1},{isRequired:!1,name:"by",aliases:[],description:"The number to increment by",acceptsVariableInterpolation:!1,allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1}],resolveCompletionItems:t=>t.leftWord=="increment"||t.leftWord=="/increment"&&t.leftChar==":"?oe(ox):Se,resolveDocumentation:t=>V("increment Tag","The `increment` tag can be used to increment a value each time the tag is encountered.","https://statamic.dev/tags/increment")},Rb=lx;var cd=class{constructor(e){this.node=e}},wb={tagName:"yields",hideFromCompletions:!1,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!0,parameters:[],introducedIn:null,requiresClose:!1,resolveSpecialType:(t,e)=>({context:new cd(t),issues:[]})},Ob={tagName:"yield",hideFromCompletions:!1,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!0,parameters:[],introducedIn:null,requiresClose:!1,resolveSpecialType:(t,e)=>({context:new cd(t),issues:[]}),resolveDocumentation:t=>V("yield Tag","The `yield` tag may be used to push rendered content to named regions within a template's structure.","https://statamic.dev/tags/yield")};var ec=je(vt());var Lb=[{handle:"access cp"},{handle:"configure collections"},{handle:"[view edit create delete publish reorder] {collection} entries"},{handle:"configure structures"},{handle:"[view edit] {structure} structure"},{handle:"edit {global} globals"},{handle:"[view upload edit move rename delete] {container} assets"},{handle:"[view perform] updates"},{handle:"[view edit create delete] users"},{handle:"change passwords"},{handle:"edit roles"},{handle:"configure forms"},{handle:"[view delete] {form} submissions"}];var fs=class{constructor(){this.contextItems=new Map;this.triggerNames=[];this.collectionTriggers=[];this.collectionTriggerCaps=[];this.globalTriggers=[];this.globalTriggerCaps=[];this.formTriggers=[];this.formTriggerCaps=[];this.structureTriggers=[];this.structureTriggerCaps=[];this.assetTriggers=[];this.assetTriggerCaps=[]}getCollectionTriggerCaps(){return this.collectionTriggerCaps}getGlobalTriggerCaps(){return this.globalTriggerCaps}getFormTriggerCaps(){return this.formTriggerCaps}getStructureTriggerCaps(){return this.structureTriggerCaps}getAssetTriggerCaps(){return this.assetTriggerCaps}loadCorePermissions(){this.registerPermissions(Lb)}getTriggerNames(){return this.triggerNames}isCollectionTrigger(e){return this.collectionTriggers.includes(e)}isGlobalTrigger(e){return this.globalTriggers.includes(e)}isFormTrigger(e){return this.formTriggers.includes(e)}isStructureTrigger(e){return this.structureTriggers.includes(e)}isAssetTrigger(e){return this.assetTriggers.includes(e)}getTriggerContextItems(e){return this.contextItems.has(e)?this.contextItems.get(e):[]}registerSpecialTrigger(e,n,r){n=="{collection}"?(this.collectionTriggerCaps.includes(r)==!1&&this.collectionTriggerCaps.push(r),this.collectionTriggers.includes(e)==!1&&this.collectionTriggers.push(e)):n=="{structure}"?(this.structureTriggerCaps.includes(r)==!1&&this.structureTriggerCaps.push(r),this.structureTriggers.includes(e)==!1&&this.structureTriggers.push(e)):n=="{container}"?(this.assetTriggerCaps.includes(r)==!1&&this.assetTriggerCaps.push(r),this.assetTriggers.includes(e)==!1&&this.assetTriggers.push(e)):n=="{global}"?(this.globalTriggerCaps.includes(r)==!1&&this.globalTriggerCaps.push(r),this.globalTriggers.includes(e)==!1&&this.globalTriggers.push(e)):n=="{form}"&&(this.formTriggerCaps.includes(r)==!1&&this.formTriggerCaps.push(r),this.formTriggers.includes(e)==!1&&this.formTriggers.push(e))}addContextToTrigger(e,n){var r;this.triggerNames.includes(e)==!1&&this.triggerNames.push(e),this.contextItems.has(e)==!1?this.contextItems.set(e,[n]):(r=this.contextItems.get(e))==null||r.push(n)}registerPermissions(e){for(let n=0;nh.trim().length>0),f=r.handle.substr(l+1).split(" ").filter(h=>h.trim().length>0);i=c,f.length==2?(s=f[0],a=f[1]):f.length==1&&(s="",a=f[0])}else{let o=r.handle.split(" ").filter(l=>l.trim().length>0);o.length==2&&(i=[o[0]],a=o[1])}for(let o=0;o0?this.registerSpecialTrigger(l,s,a):this.addContextToTrigger(l,a)}}}};fs.instance=null;(typeof fs.instance=="undefined"||fs.instance==null)&&(fs.instance=new fs,fs.instance.loadCorePermissions());var nr=fs;function Fb(t,e){var r,i,s,a,o,l,u,c,f,h,y,p,d,g,m,b,_,N,C;let n=[];if(t.trim().length==0){let G=(i=(r=nr.instance)==null?void 0:r.getTriggerNames())!=null?i:[];for(let L=0;Lae.trim().length>0),L=G[0],M=(a=(s=nr.instance)==null?void 0:s.getTriggerContextItems(L))!=null?a:[],$=(o=nr.instance)==null?void 0:o.isCollectionTrigger(L),K=(l=nr.instance)==null?void 0:l.isGlobalTrigger(L),ne=(u=nr.instance)==null?void 0:u.isFormTrigger(L),re=(c=nr.instance)==null?void 0:c.isStructureTrigger(L),ye=(f=nr.instance)==null?void 0:f.isAssetTrigger(L),Ce=[];if(G.length<=2){$?Ce=Ce.concat(e.project.getUniqueCollectionNames()):K?Ce=Ce.concat(e.project.getUniqueGlobalsNames()):ne?Ce=Ce.concat(e.project.getUniqueFormNames()):re?Ce=Ce.concat(e.project.getUniqueNavigationMenuNames()):ye&&(Ce=Ce.concat(e.project.getUniqueAssetNames())),M.length>0&&(Ce=Ce.concat(M)),Ce=[...new Set(Ce)];for(let ae=0;aeV("user:can Tag","The `user:can` tag is used to check if the currently authenticated user has a specific set of permissions. When used as a tag pair, the tag contents will only be rendered if the user has the specified permissions.","https://statamic.dev/tags/user-can")},Ya=ux;var cx={tagName:"user:logout",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[{name:"redirect",description:"An optional URL to redirect the user after being logged out",aliases:[],isRequired:!1,acceptsVariableInterpolation:!0,allowsVariableReference:!1,isDynamic:!1,expectsTypes:["string"]}],resolveDocumentation:t=>V("user:logout Tag","The `user:logout` tag will sign out the currently authenticated user. An optional `redirect` parameter may be used to redirect the visitor to a different page after being logged out.","https://statamic.dev/tags/user-logout")},Ha=cx;var fx={tagName:"user:logout_url",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[{name:"redirect",description:"An optional URL to redirect the user after being logged out",aliases:[],isRequired:!1,acceptsVariableInterpolation:!0,allowsVariableReference:!1,isDynamic:!1,expectsTypes:["string"]}],resolveDocumentation:t=>ke("user:logout_url","The `user:logout_url` tag can be used to retrieve the URL that will sign the current user out.",'Log out',"https://statamic.dev/tags/user-logout_url")},$a=fx;var kb={tagName:"switch",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[{name:"between",description:"A set of values to iterate over",aliases:[],isRequired:!1,acceptsVariableInterpolation:!0,allowsVariableReference:!1,isDynamic:!1,expectsTypes:["string","array"]},{name:"for",description:"A unique name for the switch instance",aliases:[],isRequired:!1,acceptsVariableInterpolation:!0,allowsVariableReference:!1,isDynamic:!1,expectsTypes:["string"]}],resolveDocumentation:t=>V("switch Tag","The `switch` tag can be used to alternate between a set of values each time the tag is evaluated.","https://statamic.dev/tags/switch")},Mb={tagName:"rotate",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,introducedIn:null,allowsArbitraryParameters:!1,allowsContentClose:!1,parameters:[{name:"between",description:"A set of values to iterate over",aliases:[],isRequired:!1,acceptsVariableInterpolation:!0,allowsVariableReference:!1,isDynamic:!1,expectsTypes:["string","array"]},{name:"for",description:"A unique name for the switch instance",aliases:[],isRequired:!1,acceptsVariableInterpolation:!0,allowsVariableReference:!1,isDynamic:!1,expectsTypes:["string"]}],resolveDocumentation:t=>V("rotate Tag","The `rotate` tag can be used to alternate between a set of values each time the tag is evaluated.","https://statamic.dev/tags/switch")};var px={tagName:"oauth",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[{name:"provider",description:"The OAuth provider to be used",aliases:[],isRequired:!0,acceptsVariableInterpolation:!0,allowsVariableReference:!1,isDynamic:!1,expectsTypes:["string"]},{name:"redirect",description:"The URL to be taken to after authenticating",aliases:[],isRequired:!0,acceptsVariableInterpolation:!0,allowsVariableReference:!1,isDynamic:!1,expectsTypes:["string"]}],resovleParameterCompletionItems:(t,e)=>t.name=="provider"?yt(e.project.getOAuthProviders()):null,resolveDocumentation:t=>ke("oauth Tag","The `oauth` tag can be used to generate login URls for various third-party services.",'Sign In with Github',"https://statamic.dev/tags/oauth")},Bb=px;var dx={tagName:"session:dump",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,parameters:[],introducedIn:null,resolveDocumentation:t=>V("session:dump Tag","The `session:dump` tag will display the contents of the user's session to the browser. This tag behaves similarly to the `dd` helper functions, but returns just the session data.","https://statamic.dev/tags/session-dump")},nc=dx;var fl=class{constructor(e){this.node=e}};var hx={tagName:"session:set",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!0,allowsContentClose:!0,parameters:[],introducedIn:null,resolveDynamicParameter:$e,resolveSpecialType:(t,e)=>({context:new fl(t),issues:[]}),resolveDocumentation:t=>V("session:set Tag","The `session:set` tag is used to add new data to the user's session.","https://statamic.dev/tags/session-set")},rc=hx;var Us=class{constructor(){this.knownVariables=new Map}registerDocumentSessionVariables(e,n){this.knownVariables.has(e)||this.knownVariables.set(e,new Map);let r=this.knownVariables.get(e);r.clear();for(let i=0;i{n.forEach((r,i)=>{e.includes(i)==!1&&e.push(i)})}),e}};Us.instance=null;(typeof Us.instance=="undefined"||Us.instance==null)&&(Us.instance=new Us);var pl=Us;var qb=je(vt());function Vb(t,e){let n=[],r=t.getArrayValue(),i=e.filter(s=>!r.includes(s));for(let s=0;s{var n,r,i;if(t.name=="keys"&&((n=e.context)==null?void 0:n.parameterContext)!=null){let s=(i=(r=pl.instance)==null?void 0:r.getKnownSessionVariableNames())!=null?i:[];if(e.context.parameterContext.parameter!=null)return Vb(e.context.parameterContext.parameter,s)}return null},resolveDocumentation:t=>V("session:forget Tag","The `session:forget` tag is used to remove variables from the user's session.","https://statamic.dev/tags/session-forget")},ic=mx;var gx={tagName:"session:flush",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,parameters:[],introducedIn:null,resolveDocumentation:t=>V("session:flush Tag","The `session:flush` tag will clear all values from the visitor's session. If the visitor is currently signed in they will also be signed out.","https://statamic.dev/tags/session-flush")},sc=gx;var _x={tagName:"session:flash",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!0,allowsContentClose:!1,parameters:[],introducedIn:null,resolveDynamicParameter:$e,resolveSpecialType:(t,e)=>({context:new fl(t),issues:[]}),resolveDocumentation:t=>V("session:flash Tag","The `session:flash` tag can be used to add a value to the user's session. Flashed values only persist for a single request, and are then removed.","https://statamic.dev/tags/session-flash")},ac=_x;var yx={tagName:"markdown:indent",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!0,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[],resolveDocumentation:t=>V("markdown:indent Tag","The `markdown:indent` tag is similar to the markdown tag, but will ignore leading whitepsace while rendering the tag's content as markdown.","https://statamic.dev/tags/markdown-indent")},oc=yx;var bx=[xe(oc)],Tx={tagName:"markdown",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!0,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[],resolveCompletionItems:t=>t.isPastTagPart==!1&&(t.leftWord=="markdown"||t.leftWord=="/markdown")&&t.leftChar==":"?oe(bx):Se,resolveDocumentation:t=>V("markdown Tag","The `markdown` tag can be used to render the tags contents as markdown.","https://statamic.dev/tags/markdown")},jb=Tx;var Ub=je(ei());function lc(t,e){let n=[],r=e;if(t.trim().length>0&&t.includes(".")&&t.endsWith(".")){let i=t.substr(0,t.length-1);r=r.filter(s=>s.startsWith(i))}for(let i=0;i{if(t.leftMeaningfulWord=="route"){let e=Gu(t);return oe(Wb(e,t.project))}return Se},resolveDocumentation:t=>V("route Tag","The `route` tag can be used to generate a full URL [to a named route](https://laravel.com/docs/8.x/routing#named-routes), including any defined route parameters.","https://statamic.dev/tags/route")},Gb=vx;var uc=je(vt()),Yb=[{label:"301 Permanent",insertText:"301",kind:uc.CompletionItemKind.EnumMember},{label:"302 Temporary",insertText:"302",kind:uc.CompletionItemKind.EnumMember},{label:"404 Not Found",insertText:"404",kind:uc.CompletionItemKind.EnumMember}];var Nx={tagName:"redirect",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[{name:"to",description:"The destination URL",aliases:["url"],allowsVariableReference:!1,acceptsVariableInterpolation:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!0},{name:"response",description:"The HTTP response code to use",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1,isRequired:!1}],resovleParameterCompletionItems:t=>t.name=="response"?oe(Yb):Se,resolveDocumentation:t=>V("redirect Tag","The `redirect` tag can be used to redirect the site visitor to a URL or named route. An optional HTTP status code can also be specified on the response using the `response` parameter.","https://statamic.dev/tags/redirect")},Hb=Nx;var Kb=je(vt());var Ws=class{constructor(){this.knownSections=new Map}registerDocumentSections(e,n){this.knownSections.has(e)||this.knownSections.set(e,new Map);let r=this.knownSections.get(e);r.clear();for(let i=0;i{n.forEach((r,i)=>{e.includes(i)==!1&&e.push(i)})}),e}};Ws.instance=null;(typeof Ws.instance=="undefined"||Ws.instance==null)&&(Ws.instance=new Ws);var $b=Ws;var Cx={tagName:"section",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!0,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[],resolveCompletionItems:t=>{var e,n;if((t.leftWord=="section"||t.leftWord=="/section")&&t.leftChar==":"){let r=[],i=(n=(e=$b.instance)==null?void 0:e.getKnownSectionNames())!=null?n:[];for(let s=0;sV("section Tag","The `section` tag is used to push content to a named region defined by the `yield` tag.","https://statamic.dev/tags/section")},zb=Cx;var Px={tagName:"obfuscate",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[],resolveDocumentation:t=>V("obfuscate Tag","The `obfuscate` tag converts the tags's content into a format that is difficult for bots to read, but can easily be viewed by users within their browser.","https://statamic.dev/tags/obfuscate")},Xb=Px;var Sx={tagName:"parent",hideFromCompletions:!1,requiresClose:!1,allowsContentClose:!0,allowsArbitraryParameters:!1,injectParentScope:!0,introducedIn:null,parameters:[],resolveDocumentation:t=>V("parent Tag","The `parent` tag provides access to data from the current page's parent (the URL one level above the current page).","https://statamic.dev/tags/parent")},Qb=Sx;function fd(t,e){return lc(t,e.getTranslationKeys())}var Ax=["translate","trans","trans_choice"],cc={tagName:"translate",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsContentClose:!1,introducedIn:null,allowsArbitraryParameters:!0,parameters:[{isRequired:!1,name:"key",description:"The key of the translation string to find",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"locale",description:"The locale to be used when translating",acceptsVariableInterpolation:!1,aliases:["site"],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"count",description:"The number of items to use for pluralization",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1}],resovleParameterCompletionItems:(t,e)=>{var n;if(t.name=="key"){let r="";return((n=e.context)==null?void 0:n.parameterContext)!=null&&e.context.parameterContext.parameter!=null&&(r=e.context.parameterContext.parameter.value),oe(fd(r,e.project))}return Se},resolveDynamicParameter:$e,resolveCompletionItems:t=>{if(t.leftMeaningfulWord!=null&&Ax.includes(t.leftMeaningfulWord)){let e=Gu(t);return oe(fd(e,t.project))}return Se},resolveDocumentation:t=>V("trans Tag","The `trans` tag can be used to retrieve a string for the current locale's language file.","https://statamic.dev/tags/trans")},Jb=at(cc,"trans"),pd=at(cc,"trans_choice");pd.resolveDocumentation=t=>V("trans_choice Tag","The `trans_choice` tag can be used to retrieve a pluralized string for the current locale's language file.","https://statamic.dev/tags/trans#pluralization");var Ex={tagName:"svg",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsArbitraryParameters:!0,allowsContentClose:!1,introducedIn:null,parameters:[{isRequired:!1,name:"src",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"The SVG filename relative to the project root",expectsTypes:["string"],isDynamic:!1}],resolveDynamicParameter:$e,resolveDocumentation:t=>V("svg Tag","The `svg` tag can be used to render inline SVGs, as well as set attributes on the rendered `` element.","https://statamic.dev/tags/svg")},Zb=Ex;function fc(t){return[{name:"basename",dataType:"string",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"extension",dataType:"string",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"filename",dataType:"string",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"focus",dataType:"string",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"focus_css",dataType:"string",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"height",dataType:"number",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"is_asset",dataType:"boolean",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"is_image",dataType:"boolean",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"path",dataType:"string",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"size",dataType:"string",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"size_bytes",dataType:"number",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"size_gigabytes",dataType:"number",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"size_kilobytes",dataType:"number",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"size_megabytes",dataType:"number",sourceName:"*internal.asset",sourceField:null,introducedBy:t},{name:"width",dataType:"number",sourceName:"*internal.asset",sourceField:null,introducedBy:t}]}var Ix={tagName:"asset",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,introducedIn:null,parameters:[{isRequired:!0,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"The path to the file",expectsTypes:["string"],isDynamic:!1,name:"url"}],augmentScope:(t,e)=>(e.addVariables(fc(t)),e),resolveDocumentation:t=>ke("asset Tag","The `asset` tag can be used to retrive Assets by supplying a URL.",`{{ asset url="/url/for/asset.png" }} {{ alt }} -{{ /asset }}`,"https://statamic.dev/tags/asset")},eT=Ex;var tT=je(vt());function dd(t){let e=[],n=t.getUniqueAssetNames();for(let r=0;rnT.includes(t.name)?oe(dd(e.project)):Ae,augmentScope:(t,e)=>{e.addVariables(fc(t));let n="";if(t.name!=null&&t.name.getMethodName()!=null)n=t.name.getMethodName();else{let r=t.findAnyParameter(nT);r!=null&&r.containsSimpleValue()&&(n=r.value)}return n.length>0&&e.injectAssetContainer(t,n),e},resolveCompletionItems:t=>(t.leftWord=="assets"||t.leftWord=="/assets")&&t.leftChar==":"?oe(dd(t.project)):Ae,resolveDocumentation:t=>qe("assets Tag","The `assets` tag can be used to retrieve multiple Assets from an Asset container.",`{{ assets container="container-name" }} +{{ /asset }}`,"https://statamic.dev/tags/asset")},eT=Ix;var tT=je(vt());function dd(t){let e=[],n=t.getUniqueAssetNames();for(let r=0;rnT.includes(t.name)?oe(dd(e.project)):Se,augmentScope:(t,e)=>{e.addVariables(fc(t));let n="";if(t.name!=null&&t.name.getMethodName()!=null)n=t.name.getMethodName();else{let r=t.findAnyParameter(nT);r!=null&&r.containsSimpleValue()&&(n=r.value)}return n.length>0&&e.injectAssetContainer(t,n),e},resolveCompletionItems:t=>(t.leftWord=="assets"||t.leftWord=="/assets")&&t.leftChar==":"?oe(dd(t.project)):Se,resolveDocumentation:t=>ke("assets Tag","The `assets` tag can be used to retrieve multiple Assets from an Asset container.",`{{ assets container="container-name" }} {{# Loop over all assets in the container. #}} {{ alt }} -{{ /assets }}`,"https://statamic.dev/tags/assets")},rT=Ix;var Dx={tagName:"get_content",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,introducedIn:null,allowsArbitraryParameters:!1,parameters:[{isRequired:!1,name:"from",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,description:"The ID to retrieve data for",expectsTypes:["string","array"],isDynamic:!1},{isRequired:!1,name:"locale",aliases:["site"],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"The locale to show the content in",expectsTypes:["string"],isDynamic:!1}],resovleParameterCompletionItems:(t,e)=>t.name=="locale"||t.name=="site"?yt(e.project.getSiteNames()):null,resolveDocumentation:t=>qe("get_content Tag","The `get_content` tag can be used to retrieve content from other entries. This tag accepts the ID of another entry, and will return access to all data for that entry.",`{{ get_content from="the-entry-id" }} -{{ /get_content }}`,"https://statamic.dev/tags/get_content")},iT=Dx;function sT(t){return[{name:"basename",dataType:"string",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"extension",dataType:"string",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"filename",dataType:"string",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"is_image",dataType:"boolean",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"file",dataType:"string",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"file",dataType:"last_modified",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size",dataType:"string",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size_bytes",dataType:"number",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size_b",dataType:"number",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size_gigabytes",dataType:"number",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size_gb",dataType:"number",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size_kilobytes",dataType:"number",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size_kb",dataType:"number",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size_megabytes",dataType:"number",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size_mb",dataType:"number",sourceName:"*internal.file",sourceField:null,introducedBy:t}]}var xx={tagName:"get_files",hideFromCompletions:!1,requiresClose:!0,allowsArbitraryParameters:!1,allowsContentClose:!1,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!1,name:"in",aliases:["from"],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"The directory to find files in relative to the public directory",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"depth",aliases:[],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"The depth of the subdirectories",expectsTypes:["number"],isDynamic:!1},{isRequired:!1,name:"not_in",allowsVariableReference:!1,acceptsVariableInterpolation:!1,aliases:[],description:"The subdirectories or pattern to exclude",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"file_size",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["string"],description:"The file size filter to use",isDynamic:!1},{isRequired:!1,name:"ext",aliases:["extension"],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"The extension(s) to filter by",expectsTypes:["string","array"],isDynamic:!1},{isRequired:!1,name:"include",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:["match"],description:"Filter files by a regular expression",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"exclude",description:"Excludes files by a regular expression",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"file_date",description:"Filters files by last modified date",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"limit",description:"Limits the total number of results",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1},{isRequired:!1,name:"offset",description:"The number of entries the results should be offset by",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1},{isRequired:!1,name:"sort",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Sorts the listing by extension, size, last_modified, or random",expectsTypes:["string"],isDynamic:!1}],augmentScope:(t,e)=>(e.addVariables(sT(t)),e),resolveDocumentation:t=>V("get_files Tag","The `get_files` tag can be used to display information about files on the site's local filesystem.","https://statamic.dev/tags/get_files")},aT=xx;function pc(t){return[{name:"width",dataType:"number",sourceName:"*internal.glide",sourceField:null,introducedBy:t},{name:"height",dataType:"number",sourceName:"*internal.glide",sourceField:null,introducedBy:t},{name:"url",dataType:"string",sourceName:"*internal.glide",sourceField:null,introducedBy:t}]}var oT=je(vt());function ni(t,e,n){var r,i,s,a,o,l,u,c,f,h,y,p;return{endLine:(s=(i=(r=n.valuePosition)==null?void 0:r.end)==null?void 0:i.line)!=null?s:0,startLine:(l=(o=(a=n.namePosition)==null?void 0:a.start)==null?void 0:o.line)!=null?l:0,endPos:(f=(c=(u=n.valuePosition)==null?void 0:u.end)==null?void 0:c.char)!=null?f:0,startPos:(p=(y=(h=n.namePosition)==null?void 0:h.start)==null?void 0:y.char)!=null?p:0,message:t,severity:oT.DiagnosticSeverity.Error}}var hd=["greyscale","sepia"],md=["jpg","pjpg","png","gif","webp","avif","tif","bmp","psd"],lT=["auto","0","90","180","270"],dc=[{isRequired:!1,name:"src",aliases:["path","id"],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"The URL of the image when not using shorthand syntax",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"tag",aliases:[],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"Outputs an image tag when set to true",expectsTypes:["boolean"],isDynamic:!1},{isRequired:!1,name:"alt",description:"The alt attribute value to use when generating tags",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"absolute",description:"Whether to output full URLs",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["boolean"],isDynamic:!1},{name:"width",expectsTypes:["number"],isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"The width of the image, in pixels",isDynamic:!1},{name:"height",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],description:"The height of the image, in pixels",expectsTypes:["number"],isDynamic:!1,isRequired:!1},{name:"square",expectsTypes:["number"],acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Sets both then height and width of the iamge",isDynamic:!1,isRequired:!1},{name:"fit",expectsTypes:["string"],acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"How the image is fitted to its target dimensions",isDynamic:!1,isRequired:!1},{name:"crop",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Crops the image to the specific dimensions",expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"orient",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Rotates the image",expectsTypes:["*"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=[];return e.containsSimpleValue()&&e.value.trim().length>0&&!lT.includes(e.value)&&n.push(ni("Invalid orient value",t,e)),n}},{name:"quality",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Defines the quality of the image",expectsTypes:["number"],isDynamic:!1,isRequired:!1},{name:"dpr",allowsVariableReference:!1,acceptsVariableInterpolation:!1,aliases:[],description:"Defines the device pixel ratio",expectsTypes:["number"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=parseInt(e.value),r=[];return e.containsSimpleValue()&&(n<1||n>8)&&r.push(ni("dpr must be an integer between 1 and 8.",t,e)),r}},{name:"format",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Encodes the image to a specific format",expectsTypes:["string"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=[];return e.containsSimpleValue()&&e.value.trim().length>0&&!md.includes(e.value)&&n.push(ni("Format must be one of: "+md.join(","),t,e)),n}},{name:"bg",description:"Sets the background color for transparent images",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"blur",description:"Adds a blur effect to the image",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=parseInt(e.value),r=[];return e.containsSimpleValue()&&(n<0||n>100)&&r.push(ni("blur must be a value between 0 and 100.",t,e)),r}},{name:"brightness",description:"Adjusts the image brightness",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=parseInt(e.value),r=[];return e.containsSimpleValue()&&(n<-100||n>100)&&r.push(ni("brightness must be a value between -100 and 100.",t,e)),r}},{name:"contrast",description:"Adjusts the image contrast",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=parseInt(e.value),r=[];return e.containsSimpleValue()&&(n<-100||n>100)&&r.push(ni("contrast must be a value between -100 and 100.",t,e)),r}},{name:"gamma",description:"Adjusts the image gamma",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=parseFloat(e.value),r=[];return e.containsSimpleValue()&&(n<.1||n>9.99)&&r.push(ni("gamma must be a value between 0.1 and 9.99.",t,e)),r}},{name:"sharpen",description:"Sharpens the iamge",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=parseInt(e.value),r=[];return e.containsSimpleValue()&&(n<0||n>100)&&r.push(ni("sharpen must be a value between 0 and 100.",t,e)),r}},{name:"pixelate",description:"Applies a pixelation effect to the image",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=parseInt(e.value),r=[];return e.containsSimpleValue()&&(n<0||n>100)&&r.push(ni("pixelate must be a value between 0 and 100.",t,e)),r}},{name:"filter",description:"Applies a filter effect to the image",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=[];return e.containsSimpleValue()&&e.value.trim().length>0&&!hd.includes(e.value)&&n.push(ni("Filter must be one of: "+hd.join(","),t,e)),n}},{name:"preset",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,expectsTypes:["string"],description:"A collection of pre-configured image manipulation parameters.",isDynamic:!1,isRequired:!1}];function hc(t,e){return t.name=="orient"?yt(lT):t.name=="format"?yt(md):t.name=="filter"?yt(hd):t.name=="preset"?yt(e.project.getAssetPresets()):Ae}var Rx={tagName:"glide:batch",hideFromCompletions:!1,requiresClose:!0,allowsContentClose:!1,allowsArbitraryParameters:!1,injectParentScope:!1,parameters:dc,introducedIn:null,augmentScope:(t,e)=>(e.addVariables(pc(t)),e),resovleParameterCompletionItems:hc,resolveDocumentation:t=>V("glide:batch Tag","The `glide:batch` tag is similar to the glide tag, but can be used to apply image manipulations to multiple images within a piece of content.","https://statamic.dev/tags/glide-batch")},mc=Rx;var wx=[xe(mc)],Ox={tagName:"glide",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,injectParentScope:!1,requiresClose:!1,parameters:dc,introducedIn:null,augmentScope:(t,e)=>(e.addVariables(pc(t)),e),resovleParameterCompletionItems:hc,resolveCompletionItems:t=>t.isPastTagPart==!1&&(t.leftWord=="glide"||t.leftWord=="/glide")&&t.leftChar==":"?oe(wx):Ae,resolveDocumentation:t=>V("glide Tag","The `glide` tag is used to manipulate images on the fly. Image manipulations may include resizing, cropping, or adjusting sharpness and constrast, amongst many others.","https://statamic.dev/tags/glide")},uT=Ox;var cT={tagName:"iterate",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,injectParentScope:!1,introducedIn:null,parameters:[{name:"as",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Optionally rename the key/value variables",expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"array",acceptsVariableInterpolation:!0,aliases:[],allowsVariableReference:!0,description:"The array to iterate",expectsTypes:["array"],isDynamic:!1,isRequired:!1}],resolveDocumentation:t=>V("iterate Tag","The `iterate` tag can be used to iterate over arbitrary arrays.","https://statamic.dev/tags/foreach")},fT={tagName:"foreach",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,injectParentScope:!1,introducedIn:null,parameters:[{name:"as",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Optionally rename the key/value variables",expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"array",acceptsVariableInterpolation:!0,aliases:[],allowsVariableReference:!0,description:"The array to iterate",expectsTypes:["array"],isDynamic:!1,isRequired:!1}],resolveDocumentation:t=>V("foreach Tag","The `foreach` tag can be used to iterate over arbitrary arrays.","https://statamic.dev/tags/foreach")};function pT(t){return[{name:"url",dataType:"string",sourceField:null,sourceName:"*internal.locale",introducedBy:t},{name:"name",dataType:"string",sourceField:null,sourceName:"*internal.locale",introducedBy:t}]}var gc=[{isRequired:!1,name:"id",description:"The ID of the content to localize",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,name:"sort",description:"Sort by a sites key",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"current_first",description:"When true, ensures that the current locale is first",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["boolean"],isDynamic:!1},{isRequired:!1,name:"all",description:"When true, all locale data will be returned.",acceptsVariableInterpolation:!0,aliases:[],allowsVariableReference:!0,expectsTypes:["boolean"],isDynamic:!1},{isRequired:!0,name:"self",description:"When true, the current locale will be included.",acceptsVariableInterpolation:!0,aliases:[],allowsVariableReference:!0,expectsTypes:["boolean"],isDynamic:!1}];var Lx={tagName:"locales:count",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,injectParentScope:!1,requiresClose:!0,parameters:gc,introducedIn:"3.0.36",resolveDocumentation:t=>V("locales:count Tag","The `locales:count` tag can be used to count the number of locales the current content is available in.","https://statamic.dev/tags/locales-count")},_c=Lx;var Fx=[xe(_c)],kx={tagName:"locales",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,injectParentScope:!1,requiresClose:!0,parameters:gc,introducedIn:null,augmentScope:(t,e)=>(e.addVariableArray("locale",pT(t)),e.addVariable({name:"current",dataType:"string",sourceField:null,sourceName:"*internal.locale",introducedBy:t}),e.addVariable({name:"is_current",dataType:"boolean",sourceField:null,sourceName:"*internal.locale",introducedBy:t}),e.addVariable({name:"exists",dataType:"boolean",sourceField:null,sourceName:"*internal.locale",introducedBy:t}),e.addVariable({name:"permalink",dataType:"string",sourceField:null,sourceName:"*internal.locale",introducedBy:t}),e),resolveDocumentation:t=>V("locales Tag","The `locales` tag can be used to access all the locales the current content is available in.","https://statamic.dev/tags/locales"),resolveCompletionItems:t=>t.isPastTagPart==!1&&(t.leftWord=="locale"||t.leftWord=="/locale")&&t.leftChar==":"?oe(Fx):Ae},dT=kx;var Mx={tagName:"mix",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!1,name:"src",description:"The path to the versioned file, relative to the public directory",acceptsVariableInterpolation:!1,aliases:["path"],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"in",description:"The location of the mix manifest file",acceptsVariableInterpolation:!1,aliases:["from"],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1}],resolveDocumentation:t=>V("mix Tag","The `mix` tag is used to return the path of CSS and JavaScript files versioned with [Laravel Mix](https://laravel.com/docs/8.x/mix).","https://statamic.dev/tags/mix")},hT=Mx;var dl=je(vt());function mT(t){let e=[],n=t.getUniqueUserGroupNames();for(let r=0;r!t.includes(s));for(let s=0;s!t.includes(s));for(let s=0;s{var n,r,i;return(t.name=="groups"||t.name=="group")&&((n=e.context)==null?void 0:n.parameterContext)!=null?oe(Ka((i=(r=e.context.parameterContext.parameter)==null?void 0:r.getArrayValue())!=null?i:[],e.project)):null},resolveDocumentation:t=>V("user:in Tag","The `user:in` tag can be used to check if the currently authenticated user belongs to one or more user groups. When used as a tag pair, the tag contents will only be rendered if the user belongs to the specified groups.","https://statamic.dev/tags/user-in")},yc=Bx;var qx={tagName:"user:not_in",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!0,acceptsVariableInterpolation:!1,aliases:["groups"],allowsVariableReference:!1,name:"group",description:"The groups to check against",expectsTypes:["string","array"],isDynamic:!1}],resovleParameterCompletionItems:(t,e)=>{var n,r,i;return(t.name=="groups"||t.name=="group")&&((n=e.context)==null?void 0:n.parameterContext)!=null?oe(Ka((i=(r=e.context.parameterContext.parameter)==null?void 0:r.getArrayValue())!=null?i:[],e.project)):null},resolveDocumentation:t=>V("user:not_in Tag","The `user:not_in` tag can be used to check if the currently authenticated user does not belong to one or more user groups. When used as a tag pair, the tag contents will be rendered if the user does not belong to the specified groups.","https://statamic.dev/tags/user-in#not-in")},Xa=qx;var Vx={tagName:"user:is",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!0,acceptsVariableInterpolation:!1,aliases:["roles"],allowsVariableReference:!1,name:"role",description:"The roles to check against",expectsTypes:["string","array"],isDynamic:!1}],resovleParameterCompletionItems:(t,e)=>{var n,r,i;return(t.name=="roles"||t.name=="role")&&((n=e.context)==null?void 0:n.parameterContext)!=null?oe(za((i=(r=e.context.parameterContext.parameter)==null?void 0:r.getArrayValue())!=null?i:[],e.project)):null},resolveDocumentation:t=>V("user:is Tag","The `user:is` tag can be used to check whether the currently authenticated user has one or more roles.","https://statamic.dev/tags/user-is")},Qa=Vx;var jx={tagName:"user:isnt",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!0,acceptsVariableInterpolation:!1,aliases:["roles"],allowsVariableReference:!1,name:"role",description:"The roles to check against",expectsTypes:["string","array"],isDynamic:!1}],resovleParameterCompletionItems:(t,e)=>{var n,r,i;return(t.name=="roles"||t.name=="role")&&((n=e.context)==null?void 0:n.parameterContext)!=null?oe(za((i=(r=e.context.parameterContext.parameter)==null?void 0:r.getArrayValue())!=null?i:[],e.project)):null},resolveDocumentation:t=>V("user:isnt Tag","The `user:isnt` tag can be used to check whether the currently authenticated user does not have one or more roles.","https://statamic.dev/tags/user-is#isnt")},Ja=jx;var Ux={tagName:"in",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!0,acceptsVariableInterpolation:!1,aliases:["groups"],allowsVariableReference:!1,name:"group",description:"The groups to check against",expectsTypes:["string","array"],isDynamic:!1}],resovleParameterCompletionItems:(t,e)=>{var n,r,i;return(t.name=="groups"||t.name=="group")&&((n=e.context)==null?void 0:n.parameterContext)!=null?oe(Ka((i=(r=e.context.parameterContext.parameter)==null?void 0:r.getArrayValue())!=null?i:[],e.project)):null},resolveCompletionItems:t=>(t.leftWord=="in"||t.leftWord=="/in")&&t.leftChar==":"?oe(mT(t.project)):Ae,resolveDocumentation:t=>V("in Tag","The `in` tag can be used to check if the authenticated user belongs to one or more groups. This tag operates similarly to the `user:in` tag.","https://statamic.dev/tags/user-in")},_T=Ux;var Wx={tagName:"not_found",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,parameters:[],introducedIn:null,resolveDocumentation:t=>qe("404 (Not Found) Tag","The `not_found` tag will trigger a 404 status code, and display the 404 template to the site visitor.",`{{ unless logged_in }} +{{ /assets }}`,"https://statamic.dev/tags/assets")},rT=Dx;var xx={tagName:"get_content",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,introducedIn:null,allowsArbitraryParameters:!1,parameters:[{isRequired:!1,name:"from",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,description:"The ID to retrieve data for",expectsTypes:["string","array"],isDynamic:!1},{isRequired:!1,name:"locale",aliases:["site"],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"The locale to show the content in",expectsTypes:["string"],isDynamic:!1}],resovleParameterCompletionItems:(t,e)=>t.name=="locale"||t.name=="site"?yt(e.project.getSiteNames()):null,resolveDocumentation:t=>ke("get_content Tag","The `get_content` tag can be used to retrieve content from other entries. This tag accepts the ID of another entry, and will return access to all data for that entry.",`{{ get_content from="the-entry-id" }} +{{ /get_content }}`,"https://statamic.dev/tags/get_content")},iT=xx;function sT(t){return[{name:"basename",dataType:"string",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"extension",dataType:"string",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"filename",dataType:"string",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"is_image",dataType:"boolean",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"file",dataType:"string",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"file",dataType:"last_modified",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size",dataType:"string",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size_bytes",dataType:"number",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size_b",dataType:"number",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size_gigabytes",dataType:"number",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size_gb",dataType:"number",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size_kilobytes",dataType:"number",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size_kb",dataType:"number",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size_megabytes",dataType:"number",sourceName:"*internal.file",sourceField:null,introducedBy:t},{name:"size_mb",dataType:"number",sourceName:"*internal.file",sourceField:null,introducedBy:t}]}var Rx={tagName:"get_files",hideFromCompletions:!1,requiresClose:!0,allowsArbitraryParameters:!1,allowsContentClose:!1,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!1,name:"in",aliases:["from"],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"The directory to find files in relative to the public directory",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"depth",aliases:[],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"The depth of the subdirectories",expectsTypes:["number"],isDynamic:!1},{isRequired:!1,name:"not_in",allowsVariableReference:!1,acceptsVariableInterpolation:!1,aliases:[],description:"The subdirectories or pattern to exclude",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"file_size",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["string"],description:"The file size filter to use",isDynamic:!1},{isRequired:!1,name:"ext",aliases:["extension"],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"The extension(s) to filter by",expectsTypes:["string","array"],isDynamic:!1},{isRequired:!1,name:"include",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:["match"],description:"Filter files by a regular expression",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"exclude",description:"Excludes files by a regular expression",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"file_date",description:"Filters files by last modified date",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"limit",description:"Limits the total number of results",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1},{isRequired:!1,name:"offset",description:"The number of entries the results should be offset by",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1},{isRequired:!1,name:"sort",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Sorts the listing by extension, size, last_modified, or random",expectsTypes:["string"],isDynamic:!1}],augmentScope:(t,e)=>(e.addVariables(sT(t)),e),resolveDocumentation:t=>V("get_files Tag","The `get_files` tag can be used to display information about files on the site's local filesystem.","https://statamic.dev/tags/get_files")},aT=Rx;function pc(t){return[{name:"width",dataType:"number",sourceName:"*internal.glide",sourceField:null,introducedBy:t},{name:"height",dataType:"number",sourceName:"*internal.glide",sourceField:null,introducedBy:t},{name:"url",dataType:"string",sourceName:"*internal.glide",sourceField:null,introducedBy:t}]}var oT=je(vt());function ni(t,e,n){var r,i,s,a,o,l,u,c,f,h,y,p;return{endLine:(s=(i=(r=n.valuePosition)==null?void 0:r.end)==null?void 0:i.line)!=null?s:0,startLine:(l=(o=(a=n.namePosition)==null?void 0:a.start)==null?void 0:o.line)!=null?l:0,endPos:(f=(c=(u=n.valuePosition)==null?void 0:u.end)==null?void 0:c.char)!=null?f:0,startPos:(p=(y=(h=n.namePosition)==null?void 0:h.start)==null?void 0:y.char)!=null?p:0,message:t,severity:oT.DiagnosticSeverity.Error}}var hd=["greyscale","sepia"],md=["jpg","pjpg","png","gif","webp","avif","tif","bmp","psd"],lT=["auto","0","90","180","270"],dc=[{isRequired:!1,name:"src",aliases:["path","id"],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"The URL of the image when not using shorthand syntax",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"tag",aliases:[],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"Outputs an image tag when set to true",expectsTypes:["boolean"],isDynamic:!1},{isRequired:!1,name:"alt",description:"The alt attribute value to use when generating tags",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"absolute",description:"Whether to output full URLs",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["boolean"],isDynamic:!1},{name:"width",expectsTypes:["number"],isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"The width of the image, in pixels",isDynamic:!1},{name:"height",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],description:"The height of the image, in pixels",expectsTypes:["number"],isDynamic:!1,isRequired:!1},{name:"square",expectsTypes:["number"],acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Sets both then height and width of the iamge",isDynamic:!1,isRequired:!1},{name:"fit",expectsTypes:["string"],acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"How the image is fitted to its target dimensions",isDynamic:!1,isRequired:!1},{name:"crop",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Crops the image to the specific dimensions",expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"orient",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Rotates the image",expectsTypes:["*"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=[];return e.containsSimpleValue()&&e.value.trim().length>0&&!lT.includes(e.value)&&n.push(ni("Invalid orient value",t,e)),n}},{name:"quality",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Defines the quality of the image",expectsTypes:["number"],isDynamic:!1,isRequired:!1},{name:"dpr",allowsVariableReference:!1,acceptsVariableInterpolation:!1,aliases:[],description:"Defines the device pixel ratio",expectsTypes:["number"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=parseInt(e.value),r=[];return e.containsSimpleValue()&&(n<1||n>8)&&r.push(ni("dpr must be an integer between 1 and 8.",t,e)),r}},{name:"format",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Encodes the image to a specific format",expectsTypes:["string"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=[];return e.containsSimpleValue()&&e.value.trim().length>0&&!md.includes(e.value)&&n.push(ni("Format must be one of: "+md.join(","),t,e)),n}},{name:"bg",description:"Sets the background color for transparent images",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"blur",description:"Adds a blur effect to the image",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=parseInt(e.value),r=[];return e.containsSimpleValue()&&(n<0||n>100)&&r.push(ni("blur must be a value between 0 and 100.",t,e)),r}},{name:"brightness",description:"Adjusts the image brightness",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=parseInt(e.value),r=[];return e.containsSimpleValue()&&(n<-100||n>100)&&r.push(ni("brightness must be a value between -100 and 100.",t,e)),r}},{name:"contrast",description:"Adjusts the image contrast",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=parseInt(e.value),r=[];return e.containsSimpleValue()&&(n<-100||n>100)&&r.push(ni("contrast must be a value between -100 and 100.",t,e)),r}},{name:"gamma",description:"Adjusts the image gamma",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=parseFloat(e.value),r=[];return e.containsSimpleValue()&&(n<.1||n>9.99)&&r.push(ni("gamma must be a value between 0.1 and 9.99.",t,e)),r}},{name:"sharpen",description:"Sharpens the iamge",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=parseInt(e.value),r=[];return e.containsSimpleValue()&&(n<0||n>100)&&r.push(ni("sharpen must be a value between 0 and 100.",t,e)),r}},{name:"pixelate",description:"Applies a pixelation effect to the image",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=parseInt(e.value),r=[];return e.containsSimpleValue()&&(n<0||n>100)&&r.push(ni("pixelate must be a value between 0 and 100.",t,e)),r}},{name:"filter",description:"Applies a filter effect to the image",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1,validate:(t,e)=>{let n=[];return e.containsSimpleValue()&&e.value.trim().length>0&&!hd.includes(e.value)&&n.push(ni("Filter must be one of: "+hd.join(","),t,e)),n}},{name:"preset",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,expectsTypes:["string"],description:"A collection of pre-configured image manipulation parameters.",isDynamic:!1,isRequired:!1}];function hc(t,e){return t.name=="orient"?yt(lT):t.name=="format"?yt(md):t.name=="filter"?yt(hd):t.name=="preset"?yt(e.project.getAssetPresets()):Se}var wx={tagName:"glide:batch",hideFromCompletions:!1,requiresClose:!0,allowsContentClose:!1,allowsArbitraryParameters:!1,injectParentScope:!1,parameters:dc,introducedIn:null,augmentScope:(t,e)=>(e.addVariables(pc(t)),e),resovleParameterCompletionItems:hc,resolveDocumentation:t=>V("glide:batch Tag","The `glide:batch` tag is similar to the glide tag, but can be used to apply image manipulations to multiple images within a piece of content.","https://statamic.dev/tags/glide-batch")},mc=wx;var Ox=[xe(mc)],Lx={tagName:"glide",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,injectParentScope:!1,requiresClose:!1,parameters:dc,introducedIn:null,augmentScope:(t,e)=>(e.addVariables(pc(t)),e),resovleParameterCompletionItems:hc,resolveCompletionItems:t=>t.isPastTagPart==!1&&(t.leftWord=="glide"||t.leftWord=="/glide")&&t.leftChar==":"?oe(Ox):Se,resolveDocumentation:t=>V("glide Tag","The `glide` tag is used to manipulate images on the fly. Image manipulations may include resizing, cropping, or adjusting sharpness and constrast, amongst many others.","https://statamic.dev/tags/glide")},uT=Lx;var cT={tagName:"iterate",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,injectParentScope:!1,introducedIn:null,parameters:[{name:"as",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Optionally rename the key/value variables",expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"array",acceptsVariableInterpolation:!0,aliases:[],allowsVariableReference:!0,description:"The array to iterate",expectsTypes:["array"],isDynamic:!1,isRequired:!1}],resolveDocumentation:t=>V("iterate Tag","The `iterate` tag can be used to iterate over arbitrary arrays.","https://statamic.dev/tags/foreach")},fT={tagName:"foreach",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,injectParentScope:!1,introducedIn:null,parameters:[{name:"as",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"Optionally rename the key/value variables",expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"array",acceptsVariableInterpolation:!0,aliases:[],allowsVariableReference:!0,description:"The array to iterate",expectsTypes:["array"],isDynamic:!1,isRequired:!1}],resolveDocumentation:t=>V("foreach Tag","The `foreach` tag can be used to iterate over arbitrary arrays.","https://statamic.dev/tags/foreach")};function pT(t){return[{name:"url",dataType:"string",sourceField:null,sourceName:"*internal.locale",introducedBy:t},{name:"name",dataType:"string",sourceField:null,sourceName:"*internal.locale",introducedBy:t}]}var gc=[{isRequired:!1,name:"id",description:"The ID of the content to localize",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,name:"sort",description:"Sort by a sites key",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"current_first",description:"When true, ensures that the current locale is first",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["boolean"],isDynamic:!1},{isRequired:!1,name:"all",description:"When true, all locale data will be returned.",acceptsVariableInterpolation:!0,aliases:[],allowsVariableReference:!0,expectsTypes:["boolean"],isDynamic:!1},{isRequired:!0,name:"self",description:"When true, the current locale will be included.",acceptsVariableInterpolation:!0,aliases:[],allowsVariableReference:!0,expectsTypes:["boolean"],isDynamic:!1}];var Fx={tagName:"locales:count",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,injectParentScope:!1,requiresClose:!0,parameters:gc,introducedIn:"3.0.36",resolveDocumentation:t=>V("locales:count Tag","The `locales:count` tag can be used to count the number of locales the current content is available in.","https://statamic.dev/tags/locales-count")},_c=Fx;var kx=[xe(_c)],Mx={tagName:"locales",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,injectParentScope:!1,requiresClose:!0,parameters:gc,introducedIn:null,augmentScope:(t,e)=>(e.addVariableArray("locale",pT(t)),e.addVariable({name:"current",dataType:"string",sourceField:null,sourceName:"*internal.locale",introducedBy:t}),e.addVariable({name:"is_current",dataType:"boolean",sourceField:null,sourceName:"*internal.locale",introducedBy:t}),e.addVariable({name:"exists",dataType:"boolean",sourceField:null,sourceName:"*internal.locale",introducedBy:t}),e.addVariable({name:"permalink",dataType:"string",sourceField:null,sourceName:"*internal.locale",introducedBy:t}),e),resolveDocumentation:t=>V("locales Tag","The `locales` tag can be used to access all the locales the current content is available in.","https://statamic.dev/tags/locales"),resolveCompletionItems:t=>t.isPastTagPart==!1&&(t.leftWord=="locale"||t.leftWord=="/locale")&&t.leftChar==":"?oe(kx):Se},dT=Mx;var Bx={tagName:"mix",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!1,name:"src",description:"The path to the versioned file, relative to the public directory",acceptsVariableInterpolation:!1,aliases:["path"],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,name:"in",description:"The location of the mix manifest file",acceptsVariableInterpolation:!1,aliases:["from"],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1}],resolveDocumentation:t=>V("mix Tag","The `mix` tag is used to return the path of CSS and JavaScript files versioned with [Laravel Mix](https://laravel.com/docs/8.x/mix).","https://statamic.dev/tags/mix")},hT=Bx;var dl=je(vt());function mT(t){let e=[],n=t.getUniqueUserGroupNames();for(let r=0;r!t.includes(s));for(let s=0;s!t.includes(s));for(let s=0;s{var n,r,i;return(t.name=="groups"||t.name=="group")&&((n=e.context)==null?void 0:n.parameterContext)!=null?oe(Ka((i=(r=e.context.parameterContext.parameter)==null?void 0:r.getArrayValue())!=null?i:[],e.project)):null},resolveDocumentation:t=>V("user:in Tag","The `user:in` tag can be used to check if the currently authenticated user belongs to one or more user groups. When used as a tag pair, the tag contents will only be rendered if the user belongs to the specified groups.","https://statamic.dev/tags/user-in")},yc=qx;var Vx={tagName:"user:not_in",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!0,acceptsVariableInterpolation:!1,aliases:["groups"],allowsVariableReference:!1,name:"group",description:"The groups to check against",expectsTypes:["string","array"],isDynamic:!1}],resovleParameterCompletionItems:(t,e)=>{var n,r,i;return(t.name=="groups"||t.name=="group")&&((n=e.context)==null?void 0:n.parameterContext)!=null?oe(Ka((i=(r=e.context.parameterContext.parameter)==null?void 0:r.getArrayValue())!=null?i:[],e.project)):null},resolveDocumentation:t=>V("user:not_in Tag","The `user:not_in` tag can be used to check if the currently authenticated user does not belong to one or more user groups. When used as a tag pair, the tag contents will be rendered if the user does not belong to the specified groups.","https://statamic.dev/tags/user-in#not-in")},Xa=Vx;var jx={tagName:"user:is",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!0,acceptsVariableInterpolation:!1,aliases:["roles"],allowsVariableReference:!1,name:"role",description:"The roles to check against",expectsTypes:["string","array"],isDynamic:!1}],resovleParameterCompletionItems:(t,e)=>{var n,r,i;return(t.name=="roles"||t.name=="role")&&((n=e.context)==null?void 0:n.parameterContext)!=null?oe(za((i=(r=e.context.parameterContext.parameter)==null?void 0:r.getArrayValue())!=null?i:[],e.project)):null},resolveDocumentation:t=>V("user:is Tag","The `user:is` tag can be used to check whether the currently authenticated user has one or more roles.","https://statamic.dev/tags/user-is")},Qa=jx;var Ux={tagName:"user:isnt",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!0,acceptsVariableInterpolation:!1,aliases:["roles"],allowsVariableReference:!1,name:"role",description:"The roles to check against",expectsTypes:["string","array"],isDynamic:!1}],resovleParameterCompletionItems:(t,e)=>{var n,r,i;return(t.name=="roles"||t.name=="role")&&((n=e.context)==null?void 0:n.parameterContext)!=null?oe(za((i=(r=e.context.parameterContext.parameter)==null?void 0:r.getArrayValue())!=null?i:[],e.project)):null},resolveDocumentation:t=>V("user:isnt Tag","The `user:isnt` tag can be used to check whether the currently authenticated user does not have one or more roles.","https://statamic.dev/tags/user-is#isnt")},Ja=Ux;var Wx={tagName:"in",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!0,acceptsVariableInterpolation:!1,aliases:["groups"],allowsVariableReference:!1,name:"group",description:"The groups to check against",expectsTypes:["string","array"],isDynamic:!1}],resovleParameterCompletionItems:(t,e)=>{var n,r,i;return(t.name=="groups"||t.name=="group")&&((n=e.context)==null?void 0:n.parameterContext)!=null?oe(Ka((i=(r=e.context.parameterContext.parameter)==null?void 0:r.getArrayValue())!=null?i:[],e.project)):null},resolveCompletionItems:t=>(t.leftWord=="in"||t.leftWord=="/in")&&t.leftChar==":"?oe(mT(t.project)):Se,resolveDocumentation:t=>V("in Tag","The `in` tag can be used to check if the authenticated user belongs to one or more groups. This tag operates similarly to the `user:in` tag.","https://statamic.dev/tags/user-in")},_T=Wx;var Gx={tagName:"not_found",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,parameters:[],introducedIn:null,resolveDocumentation:t=>ke("404 (Not Found) Tag","The `not_found` tag will trigger a 404 status code, and display the 404 template to the site visitor.",`{{ unless logged_in }} {{# Display the 404 Not Found page. #}} {{ not_found }} -{{ /unless }}`,"https://statamic.dev/tags/404")},yT=Wx;var Gx={tagName:"is",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!0,acceptsVariableInterpolation:!1,aliases:["roles"],allowsVariableReference:!1,name:"role",description:"The roles to check against",expectsTypes:["string","array"],isDynamic:!1}],resovleParameterCompletionItems:(t,e)=>{var n,r,i;return(t.name=="roles"||t.name=="role")&&((n=e.context)==null?void 0:n.parameterContext)!=null?oe(za((i=(r=e.context.parameterContext.parameter)==null?void 0:r.getArrayValue())!=null?i:[],e.project)):null},resolveCompletionItems:t=>(t.leftWord=="is"||t.leftWord=="/is")&&t.leftChar==":"?oe(gT(t.project)):Ae,resolveDocumentation:t=>V("is Tag","The `is` tag can be used to check whether the currently authenticated user has one or more roles. This tag behaves the same as the `user:is` tag.","https://statamic.dev/tags/user-is")},bT=Gx;var Yx={tagName:"widont",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[],resolveDocumentation:t=>qe("widont Tag","The `widont` tag is similar to the [widont modifier](https://statamic.dev/modifiers/widont), and will attempt to prevent lines with a single word from appearing within the tags rendered output.",`{{ widont }} +{{ /unless }}`,"https://statamic.dev/tags/404")},yT=Gx;var Yx={tagName:"is",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!0,acceptsVariableInterpolation:!1,aliases:["roles"],allowsVariableReference:!1,name:"role",description:"The roles to check against",expectsTypes:["string","array"],isDynamic:!1}],resovleParameterCompletionItems:(t,e)=>{var n,r,i;return(t.name=="roles"||t.name=="role")&&((n=e.context)==null?void 0:n.parameterContext)!=null?oe(za((i=(r=e.context.parameterContext.parameter)==null?void 0:r.getArrayValue())!=null?i:[],e.project)):null},resolveCompletionItems:t=>(t.leftWord=="is"||t.leftWord=="/is")&&t.leftChar==":"?oe(gT(t.project)):Se,resolveDocumentation:t=>V("is Tag","The `is` tag can be used to check whether the currently authenticated user has one or more roles. This tag behaves the same as the `user:is` tag.","https://statamic.dev/tags/user-is")},bT=Yx;var Hx={tagName:"widont",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[],resolveDocumentation:t=>ke("widont Tag","The `widont` tag is similar to the [widont modifier](https://statamic.dev/modifiers/widont), and will attempt to prevent lines with a single word from appearing within the tags rendered output.",`{{ widont }} {{ content }} -{{ /widont }}`,null)},TT=Yx;var bc=[{isRequired:!1,acceptsVariableInterpolation:!1,allowsVariableReference:!0,aliases:[],name:"id",description:"The user ID to fetch",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,allowsVariableReference:!0,aliases:[],name:"email",description:"The email address to find the user by",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,allowsVariableReference:!0,aliases:[],name:"field",description:"The field to fetch the user by",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,allowsVariableReference:!0,aliases:[],name:"value",description:"The value to search for",expectsTypes:["string"],isDynamic:!1}];var Hx={tagName:"user:profile",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,parameters:bc,introducedIn:null,augmentScope:(t,e)=>(e.injectBlueprint(t,"user"),e),resovleParameterCompletionItems:(t,e)=>t.name=="field"?oe(Mu(e.project.getUserFields())):Ae,resolveDocumentation:t=>V("user:profile Tag","The `user:profile` tag provides access to the currently logged in user information, or for a specific user when using the `id`, `email`, or `field` parameter",null)},Za=Hx;var vT={tagName:"dd",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[],resolveDocumentation:t=>qe("dd Tag","The `dd` tag is a useful tag for debugging, and will display the raw data available at the point the tag is rendered. This tag will stop the template from rendering after it is encountered. If Ignition is available, this tag will use the [ddd](https://flareapp.io/blog/1-introducing-ddd-a-new-global-helper-for-laravel) method.",`{{ collection:articles }} +{{ /widont }}`,null)},TT=Hx;var bc=[{isRequired:!1,acceptsVariableInterpolation:!1,allowsVariableReference:!0,aliases:[],name:"id",description:"The user ID to fetch",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,allowsVariableReference:!0,aliases:[],name:"email",description:"The email address to find the user by",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,allowsVariableReference:!0,aliases:[],name:"field",description:"The field to fetch the user by",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,allowsVariableReference:!0,aliases:[],name:"value",description:"The value to search for",expectsTypes:["string"],isDynamic:!1}];var $x={tagName:"user:profile",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,parameters:bc,introducedIn:null,augmentScope:(t,e)=>(e.injectBlueprint(t,"user"),e),resovleParameterCompletionItems:(t,e)=>t.name=="field"?oe(Mu(e.project.getUserFields())):Se,resolveDocumentation:t=>V("user:profile Tag","The `user:profile` tag provides access to the currently logged in user information, or for a specific user when using the `id`, `email`, or `field` parameter",null)},Za=$x;var vT={tagName:"dd",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[],resolveDocumentation:t=>ke("dd Tag","The `dd` tag is a useful tag for debugging, and will display the raw data available at the point the tag is rendered. This tag will stop the template from rendering after it is encountered. If Ignition is available, this tag will use the [ddd](https://flareapp.io/blog/1-introducing-ddd-a-new-global-helper-for-laravel) method.",`{{ collection:articles }} {{# View all data available, for the first entry that renders the dd tag. #}} {{ dd }} -{{ /collection:articles }}`,null)},NT={tagName:"ddd",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[],resolveDocumentation:t=>qe("ddd Tag","The `ddd` tag is a useful tag for debugging, and will display the raw data available at the point the tag is rendered. This tag will stop the template from rendering after it is encountered. If Ignition is available, this tag will use the [ddd](https://flareapp.io/blog/1-introducing-ddd-a-new-global-helper-for-laravel) method.",`{{ collection:articles }} +{{ /collection:articles }}`,null)},NT={tagName:"ddd",hideFromCompletions:!1,requiresClose:!1,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,introducedIn:null,parameters:[],resolveDocumentation:t=>ke("ddd Tag","The `ddd` tag is a useful tag for debugging, and will display the raw data available at the point the tag is rendered. This tag will stop the template from rendering after it is encountered. If Ignition is available, this tag will use the [ddd](https://flareapp.io/blog/1-introducing-ddd-a-new-global-helper-for-laravel) method.",`{{ collection:articles }} {{# View all data available, for the first entry that renders the ddd tag. #}} {{ ddd }} -{{ /collection:articles }}`,null)};var $x={tagName:"path",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!1,acceptsVariableInterpolation:!1,aliases:["src"],allowsVariableReference:!0,description:"The path source",name:"to",isDynamic:!1,expectsTypes:["string"]},{isRequired:!1,allowsVariableReference:!0,acceptsVariableInterpolation:!1,aliases:[],description:"Whether to generate absolute paths",expectsTypes:["boolean"],isDynamic:!1,name:"absolute"}],resolveDocumentation:t=>V("path Tag","The `path` tag can be used to generate URLs from relative URLs, or an entry ID.",null)},CT=$x;var Kx={tagName:"user:cant",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!1,allowsContentClose:!0,introducedIn:null,resovleParameterCompletionItems:tc,parameters:[{name:"do",acceptsVariableInterpolation:!1,aliases:["permission"],allowsVariableReference:!1,description:"The permissions to check against",expectsTypes:["string"],isRequired:!0,isDynamic:!1}],resolveDocumentation:t=>V("user:cant Tag","The `user:cant` tag is used to check if the currently authenticated user does not have a specific set of permissions. When used as a tag pair, the tag contents will only be rendered if the user does not have the specified permissions.","https://statamic.dev/tags/user-can#cant")},Tc=Kx;var zx={tagName:"query",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!0,allowsArbitraryParameters:!1,allowsContentClose:!0,introducedIn:null,parameters:[{name:"builder",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"The query to evaluate",expectsTypes:["string"],isRequired:!0,isDynamic:!1}]},PT=zx;var Gs=je(vt());var yi=[{isRequired:!0,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,name:"src",description:"The relative path to the file",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,name:"cache_bust",description:"Whether to output the last modified date",expectsTypes:["boolean"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,name:"version",description:"Whether to check a versioning manifest to produce the final URL",expectsTypes:["boolean"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,name:"absolute",description:"Generate absolute URLs or not",expectsTypes:["boolean"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,name:"locale",description:"The locale the path should be generated in",expectsTypes:["string"],isDynamic:!1}];var Xx=[{label:"asset",kind:Gs.CompletionItemKind.Text},{label:"css",kind:Gs.CompletionItemKind.Text},{label:"img",kind:Gs.CompletionItemKind.Text},{label:"js",kind:Gs.CompletionItemKind.Text},{label:"output",kind:Gs.CompletionItemKind.Text},{label:"path",kind:Gs.CompletionItemKind.Text}],Qx={tagName:"theme",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,introducedIn:null,injectParentScope:!1,parameters:yi,resolveCompletionItems:t=>t.isPastTagPart==!1&&(t.leftWord=="theme"||t.leftWord=="/theme")&&t.leftChar==":"?oe(Xx):Ae},AT=Qx;var gd={tagName:"theme:path",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,introducedIn:null,parameters:yi,resolveDocumentation:t=>V("theme:path Tag","The `theme:path` tag may be used to generate URLs for public assets. This tag may also optionally add the current locale, generate relative URLs, or add cache busting URL parameters to the end of the generated URL.",null)},ST=at(gd,"theme:asset");var Jx={tagName:"theme:css",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,introducedIn:null,parameters:[...yi,{isRequired:!1,isDynamic:!1,aliases:[],acceptsVariableInterpolation:!1,allowsVariableReference:!0,name:"tag",description:"Whether to generate an HTML tag",expectsTypes:["boolean"]}],resolveDocumentation:t=>V("theme:css Tag","The `theme:css` tag may be used to generate a CSS path relative to a public `css/` directory for any arbitrary file path. This tag may also optionally create the HTML `link` tag.",null)},ET=Jx;var Zx={tagName:"theme:img",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,introducedIn:null,parameters:[...yi,{isRequired:!1,isDynamic:!1,aliases:[],acceptsVariableInterpolation:!1,allowsVariableReference:!0,name:"tag",description:"Whether to generate an HTML tag",expectsTypes:["boolean"]},{isRequired:!1,isDynamic:!1,aliases:[],acceptsVariableInterpolation:!1,allowsVariableReference:!0,name:"alt",description:"The alt text to use when generating the HTML tag",expectsTypes:["string"]}],resolveDocumentation:t=>V("theme:img Tag","The `theme:img` tag may be used to generate an image path relative to a public `img/` directory for any arbitrary file path. This tag may also optionally create the HTML `img` tag.",null)},IT=Zx;var eR={tagName:"theme:js",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,introducedIn:null,parameters:[...yi,{isRequired:!1,isDynamic:!1,aliases:[],acceptsVariableInterpolation:!1,allowsVariableReference:!0,name:"tag",description:"Whether to generate an HTML tag",expectsTypes:["boolean"]}],resolveDocumentation:t=>V("theme:js Tag","The `theme:js` tag may be used to generate a JavaScript path relative to a public `js/` directory for any arbitrary file path. This tag may also optionally create the HTML `script` tag.",null)},DT=eR;var tR={tagName:"theme:output",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!0,requiresClose:!1,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!0,allowsVariableReference:!0,acceptsVariableInterpolation:!1,aliases:[],name:"src",description:"The path to the file",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,allowsVariableReference:!0,acceptsVariableInterpolation:!1,aliases:[],name:"as",description:"An optional alias for the contents variable",expectsTypes:["string"],isDynamic:!1}],augmentScope:(t,e)=>{if(t.isClosedBy!=null){let n=t.findParameter("as");n!=null?e.addVariable({name:n.value,dataType:"string",sourceField:null,sourceName:"*internal.theme.context",introducedBy:t}):e.addVariable({name:"output_contents",dataType:"string",sourceField:null,sourceName:"*internal.theme.context",introducedBy:t})}return e},resolveDocumentation:t=>V("theme:output Tag","The `theme:output` tag may be used to output the contents of any arbitrary file, relative to the site's `resources/` directory.",null)},xT=tR;var nR={tagName:"scope",hideFromCompletions:!1,requiresClose:!0,allowsArbitraryParameters:!1,allowsContentClose:!1,injectParentScope:!1,introducedIn:null,parameters:[],resolveDocumentation:t=>qe("scope Tag","The `scope` tag creates a copy of all available variables, and saves them to a new *array* variable defined by the tag's method part.",`{{ scope:scope_name }} +{{ /collection:articles }}`,null)};var Kx={tagName:"path",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!1,acceptsVariableInterpolation:!1,aliases:["src"],allowsVariableReference:!0,description:"The path source",name:"to",isDynamic:!1,expectsTypes:["string"]},{isRequired:!1,allowsVariableReference:!0,acceptsVariableInterpolation:!1,aliases:[],description:"Whether to generate absolute paths",expectsTypes:["boolean"],isDynamic:!1,name:"absolute"}],resolveDocumentation:t=>V("path Tag","The `path` tag can be used to generate URLs from relative URLs, or an entry ID.",null)},CT=Kx;var zx={tagName:"user:cant",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!1,allowsContentClose:!0,introducedIn:null,resovleParameterCompletionItems:tc,parameters:[{name:"do",acceptsVariableInterpolation:!1,aliases:["permission"],allowsVariableReference:!1,description:"The permissions to check against",expectsTypes:["string"],isRequired:!0,isDynamic:!1}],resolveDocumentation:t=>V("user:cant Tag","The `user:cant` tag is used to check if the currently authenticated user does not have a specific set of permissions. When used as a tag pair, the tag contents will only be rendered if the user does not have the specified permissions.","https://statamic.dev/tags/user-can#cant")},Tc=zx;var Xx={tagName:"query",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!0,allowsArbitraryParameters:!1,allowsContentClose:!0,introducedIn:null,parameters:[{name:"builder",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,description:"The query to evaluate",expectsTypes:["string"],isRequired:!0,isDynamic:!1}]},PT=Xx;var Gs=je(vt());var yi=[{isRequired:!0,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,name:"src",description:"The relative path to the file",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,name:"cache_bust",description:"Whether to output the last modified date",expectsTypes:["boolean"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,name:"version",description:"Whether to check a versioning manifest to produce the final URL",expectsTypes:["boolean"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,name:"absolute",description:"Generate absolute URLs or not",expectsTypes:["boolean"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,name:"locale",description:"The locale the path should be generated in",expectsTypes:["string"],isDynamic:!1}];var Qx=[{label:"asset",kind:Gs.CompletionItemKind.Text},{label:"css",kind:Gs.CompletionItemKind.Text},{label:"img",kind:Gs.CompletionItemKind.Text},{label:"js",kind:Gs.CompletionItemKind.Text},{label:"output",kind:Gs.CompletionItemKind.Text},{label:"path",kind:Gs.CompletionItemKind.Text}],Jx={tagName:"theme",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,introducedIn:null,injectParentScope:!1,parameters:yi,resolveCompletionItems:t=>t.isPastTagPart==!1&&(t.leftWord=="theme"||t.leftWord=="/theme")&&t.leftChar==":"?oe(Qx):Se},ST=Jx;var gd={tagName:"theme:path",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,introducedIn:null,parameters:yi,resolveDocumentation:t=>V("theme:path Tag","The `theme:path` tag may be used to generate URLs for public assets. This tag may also optionally add the current locale, generate relative URLs, or add cache busting URL parameters to the end of the generated URL.",null)},AT=at(gd,"theme:asset");var Zx={tagName:"theme:css",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,introducedIn:null,parameters:[...yi,{isRequired:!1,isDynamic:!1,aliases:[],acceptsVariableInterpolation:!1,allowsVariableReference:!0,name:"tag",description:"Whether to generate an HTML tag",expectsTypes:["boolean"]}],resolveDocumentation:t=>V("theme:css Tag","The `theme:css` tag may be used to generate a CSS path relative to a public `css/` directory for any arbitrary file path. This tag may also optionally create the HTML `link` tag.",null)},ET=Zx;var eR={tagName:"theme:img",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,introducedIn:null,parameters:[...yi,{isRequired:!1,isDynamic:!1,aliases:[],acceptsVariableInterpolation:!1,allowsVariableReference:!0,name:"tag",description:"Whether to generate an HTML tag",expectsTypes:["boolean"]},{isRequired:!1,isDynamic:!1,aliases:[],acceptsVariableInterpolation:!1,allowsVariableReference:!0,name:"alt",description:"The alt text to use when generating the HTML tag",expectsTypes:["string"]}],resolveDocumentation:t=>V("theme:img Tag","The `theme:img` tag may be used to generate an image path relative to a public `img/` directory for any arbitrary file path. This tag may also optionally create the HTML `img` tag.",null)},IT=eR;var tR={tagName:"theme:js",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,introducedIn:null,parameters:[...yi,{isRequired:!1,isDynamic:!1,aliases:[],acceptsVariableInterpolation:!1,allowsVariableReference:!0,name:"tag",description:"Whether to generate an HTML tag",expectsTypes:["boolean"]}],resolveDocumentation:t=>V("theme:js Tag","The `theme:js` tag may be used to generate a JavaScript path relative to a public `js/` directory for any arbitrary file path. This tag may also optionally create the HTML `script` tag.",null)},DT=tR;var nR={tagName:"theme:output",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!0,requiresClose:!1,injectParentScope:!1,introducedIn:null,parameters:[{isRequired:!0,allowsVariableReference:!0,acceptsVariableInterpolation:!1,aliases:[],name:"src",description:"The path to the file",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,allowsVariableReference:!0,acceptsVariableInterpolation:!1,aliases:[],name:"as",description:"An optional alias for the contents variable",expectsTypes:["string"],isDynamic:!1}],augmentScope:(t,e)=>{if(t.isClosedBy!=null){let n=t.findParameter("as");n!=null?e.addVariable({name:n.value,dataType:"string",sourceField:null,sourceName:"*internal.theme.context",introducedBy:t}):e.addVariable({name:"output_contents",dataType:"string",sourceField:null,sourceName:"*internal.theme.context",introducedBy:t})}return e},resolveDocumentation:t=>V("theme:output Tag","The `theme:output` tag may be used to output the contents of any arbitrary file, relative to the site's `resources/` directory.",null)},xT=nR;var rR={tagName:"scope",hideFromCompletions:!1,requiresClose:!0,allowsArbitraryParameters:!1,allowsContentClose:!1,injectParentScope:!1,introducedIn:null,parameters:[],resolveDocumentation:t=>ke("scope Tag","The `scope` tag creates a copy of all available variables, and saves them to a new *array* variable defined by the tag's method part.",`{{ scope:scope_name }} {{ scope_name:title }} {{ /scope:scope_name }} -`,null)},RT=nR;var rR={tagName:"if",hideFromCompletions:!0,allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!0,injectParentScope:!0,introducedIn:null,parameters:[],resolveDynamicParameter:$e,resolveDocumentation:t=>V("if Conditional Control Structure","The contents of the `if` tag will be rendered when it's expression evaluates to `true`.","https://statamic.dev/antlers#conditions")},wT=rR;var iR={tagName:"elseif",hideFromCompletions:!0,allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!0,injectParentScope:!0,introducedIn:null,parameters:[],resolveDynamicParameter:$e,resolveDocumentation:t=>V("elseif Conditional Control Structure","The contents of the `elseif` tag will be rendered when it's expression evaluates to `true`.","https://statamic.dev/antlers#conditions")},OT=iR;var sR={tagName:"else",hideFromCompletions:!0,allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!0,injectParentScope:!0,introducedIn:null,parameters:[],resolveDocumentation:t=>V("else Conditional Control Structure","The contents of the `else` control structure will be evaluated when all previous conditional branch conditions were not met.","https://statamic.dev/antlers#conditions")},LT=sR;var FT=je(vt());var aR={tagName:"session:has",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!0,allowsContentClose:!0,parameters:[],introducedIn:"3.1.28",resolveDynamicParameter:$e,resolveDocumentation:t=>V("session:has Tag","The `session:has` tag can be used to determine of the user's session contains a specific variable.","https://statamic.dev/tags/session-has")},vc=aR;var oR=[xe(rc),xe(ac),xe(ic),xe(sc),xe(vc),xe(nc)],lR={tagName:"session",requiresClose:!1,allowsContentClose:!0,allowsArbitraryParameters:!1,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[{name:"as",description:"An optional alias for the session data",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1}],resolveCompletionItems:t=>{var e,n;if(t.isPastTagPart==!1&&(t.leftWord=="session"||t.leftWord=="/session")&&t.leftChar==":"){let r=(n=(e=pl.instance)==null?void 0:e.getKnownSessionVariableNames())!=null?n:[],i=[];i=i.concat(oR);for(let s=0;s{var s,a;let n=t.findParameter("as"),r=(a=(s=pl.instance)==null?void 0:s.getKnownSessionVariableNames())!=null?a:[],i=[];for(let o=0;o(e.addVariables([{name:"success",dataType:"boolean",sourceField:null,sourceName:"*internal.user.reset_password",introducedBy:t},{name:"url_invalid",dataType:"boolean",sourceField:null,sourceName:"*internal.user.reset_password",introducedBy:t},{name:"errors",dataType:"array",sourceField:null,sourceName:"*internal.user.reset_password",introducedBy:t}]),e),resolveDocumentation:t=>V("user:forgot_password_form Tag",'The `user:forgot_password_form` tag is used to quickly create a "forgot password" form for site users.',"https://statamic.dev/tags/user-forgot_password_form")},_d=at(hl,"member:forgot_password_form");_d.resolveDocumentation=t=>V("member:forgot_password_form Tag",'The `member:forgot_password_form` tag is used to quickly create a "forgot password" form for site users.',"https://statamic.dev/tags/user-forgot_password_form");var ml={tagName:"user:reset_password_form",allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!0,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[{name:"redirect",description:"Where the user should be taken after submitting the form",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,expectsTypes:["string"],isDynamic:!1,isRequired:!1}],resolveDynamicParameter:$e,augmentScope:(t,e)=>(e.addVariables([{name:"success",dataType:"boolean",sourceField:null,sourceName:"*internal.user.password_reset",introducedBy:t},{name:"url_invalid",dataType:"boolean",sourceField:null,sourceName:"*internal.user.password_reset",introducedBy:t},{name:"errors",dataType:"array",sourceField:null,sourceName:"*internal.user.password_reset",introducedBy:t}]),e),resolveDocumentation:t=>V("user:reset_password_form Tag","The `user:reset_password_form` tag is used to quickly create password reset forms. Forms created with this tag should be displayed after a user has received and clicked a password reset email link.","https://statamic.dev/tags/user-reset_password_form")},yd=at(ml,"member:reset_password_form");yd.resolveDocumentation=t=>V("member:reset_password_form Tag","The `member:reset_password_form` tag is used to quickly create password reset forms. Forms created with this tag should be displayed after a user has received and clicked a password reset email link.","https://statamic.dev/tags/user-reset_password_form");function MT(t,e){return{sourceName:e.blueprintName,dataType:e.type,name:e.name,sourceField:e,introducedBy:t}}function BT(t){let e=new Map;for(let n=0;n{e.addVariableArray("fields",Nc(t)),e.addVariable({name:"errors",dataType:"array",sourceName:"*internal.user.register_form",sourceField:null,introducedBy:t}),e.addVariable({name:"old",dataType:"array",sourceName:"*internal.user.register_form",sourceField:null,introducedBy:t}),e.addVariable({name:"error",dataType:"array",sourceName:"*internal.user.register_form",sourceField:null,introducedBy:t}),e.addVariable({name:"success",dataType:"string",sourceName:"*internal.user.register_form",sourceField:null,introducedBy:t});let n=e.statamicProject.getUserFields();if(n.length>0){let r=eo(t,n);e.addVariableArray("old",r),e.addVariableArray("error",r)}return e},resolveDocumentation:t=>V("user:register_form Form Tag","The `user:register_form` tag can be used to build out public registration forms for new users.","https://statamic.dev/tags/user-register_form")},bd=at(gl,"member:register_form");bd.resolveDocumentation=t=>V("member:register_form Tag","The `member:register_form` tag can be used to build out public registration forms for new users.","https://statamic.dev/tags/user-register_form");var uR=[xe(Qa),xe(Xa),xe(Ja),xe(Za),xe(Ya),xe(Tc),xe(hl),xe(Ha),xe($a),xe(gl),xe(ml)],cR={tagName:"user",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,parameters:bc,introducedIn:null,resovleParameterCompletionItems:(t,e)=>e.isPastTagPart==!1&&e.currentNode!=null&&e.currentNode.methodIsEmptyOrMatches("profile")&&t.name=="field"?oe(Mu(e.project.getUserFields())):Ae,augmentScope:(t,e)=>(t.methodIsEmptyOrMatches("profile")&&e.injectUserFields(t),e),resolveCompletionItems:t=>(t.leftWord=="user"||t.leftWord=="/user"||t.leftWord=="member"||t.leftWord=="/member")&&t.leftChar==":"?oe(uR):Ae,resolveDocumentation:t=>V("user Tag","The `user` tag provides access to the currently logged in user information, or for a specific user when using the `id`, `email`, or `field` parameter",null)},Cc=cR;var Pc=at(Cc,"member"),Td=at(Qa,"member:is"),vd=at(Ja,"member:isnt"),Nd=at(Za,"member:profile"),Cd=at(Ya,"member:can"),Pd=at(Ha,"member:logout"),Ad=at($a,"member:logout_url"),Sd=at(yc,"member:in"),Ed=at(Xa,"member:not_in");Pc.hideFromCompletions=!0;Pc.resolveDocumentation=t=>V("member Tag","The `member` tag provides access to the currently logged in user information, or for a specific user when using the `id`, `email`, or `field` parameter",null);Td.resolveDocumentation=t=>V("member:is Tag","The `member:is` tag can be used to check whether the currently authenticated user has one or more roles.","https://statamic.dev/tags/user-is");vd.resolveDocumentation=t=>V("member:isnt Tag","The `member:isnt` tag can be used to check whether the currently authenticated user does not have one or more roles.","https://statamic.dev/tags/user-is#isnt");Nd.resolveDocumentation=t=>V("member:profile Tag","The `member:profile` tag provides access to the currently logged in user information, or for a specific user when using the `id`, `email`, or `field` parameter",null);Cd.resolveDocumentation=t=>V("member:can Tag","The `member:can` tag is used to check if the currently authenticated user has a specific set of permissions. When used as a tag pair, the tag contents will only be rendered if the user has the specified permissions.","https://statamic.dev/tags/user-can");Pd.resolveDocumentation=t=>V("member:logout Tag","The `member:logout` tag will sign out the currently authenticated user. An optional `redirect` parameter may be used to redirect the visitor to a different page after being logged out.","https://statamic.dev/tags/user-logout");Ad.resolveDocumentation=t=>qe("member:logout_url","The `member:logout_url` tag can be used to retrieve the URL that will sign the current user out.",'Log out',"https://statamic.dev/tags/user-logout_url");Sd.resolveDocumentation=t=>V("member:in Tag","The `member:in` tag can be used to check if the currently authenticated user belongs to one or more user groups. When used as a tag pair, the tag contents will only be rendered if the user belongs to the specified groups.","https://statamic.dev/tags/user-in");Ed.resolveDocumentation=t=>V("member:not_in Tag","The `member:not_in` tag can be used to check if the currently authenticated user does not belong to one or more user groups. When used as a tag pair, the tag contents will be rendered if the user does not belong to the specified groups.","https://statamic.dev/tags/user-in#not-in");function ps(t){return[{name:"title",dataType:"string",sourceField:null,sourceName:"*internal.routeable",introducedBy:t},{name:"url",dataType:"string",sourceField:null,sourceName:"*internal.routeable",introducedBy:t}]}var jT=je(vt());var Id=["from","taxonomy","is","use","folder"],Dd=["not_from","not_in","dont_use","not_taxonomy"];var xd=Id;xd=xd.concat(Dd);function qT(t,e){var n,r,i,s,a,o,l,u;if(e.nodesInScope.length>0){let c=e.nodesInScope[e.nodesInScope.length-1];if(c!=null&&c.currentScope!=null){let f=to(c,e.project),h=e.project.getTaxonomyBlueprintFields(f),y=h.map(d=>d.name),p=Bi(e.leftWord);if(y.includes(p))return oe(as(e))}}return t.name=="collection"&&((n=e.context)==null?void 0:n.parameterContext)!=null?oe(qa((s=(i=(r=e.context)==null?void 0:r.parameterContext.parameter)==null?void 0:i.getArrayValue())!=null?s:[],e.project)):t.name=="filter"||t.name=="query_scope"?oe(qu(e.project)):xd.includes(t.name)&&((a=e.context)==null?void 0:a.parameterContext)!=null?oe(VT((u=(l=(o=e.context)==null?void 0:o.parameterContext.parameter)==null?void 0:l.getArrayValue())!=null?u:[],e.project)):null}function to(t,e){let n=[];if(t.hasMethodPart())return n.push(t.getMethodNameValue()),n;let r=t.findAnyParameter(Id),i=t.findAnyParameter(Dd),s=[],a=[];return typeof r!="undefined"&&r!==null&&(r.value.trim()==="*"?(s=e.getUniqueTaxonomyNames(),typeof i!="undefined"&&i!==null&&i.isVariableReference==!1&&i.hasInterpolations()==!1&&(a=i.getArrayValue())):r.isVariableReference==!1&&r.hasInterpolations()==!1&&(s=r.getArrayValue())),a.length>0?n=s.filter(function(o){return a.includes(o)==!1}):n=s,n}function VT(t,e){let n=[],r=e.getUniqueTaxonomyNames().filter(i=>!t.includes(i));for(let i=0;i0){let a=e.statamicProject.getBlueprintFields(s);e.introduceScopedAliasScope(t,"entries","entries",a).addVariables(os(t))}else e.addVariableArray("entries",ps(t).concat(os(t)))}else e.addVariableArray("entries",ps(t).concat(os(t)));return e}var fR=[{name:"from",description:"The taxonomy to use",aliases:["taxonomy","is","use","folder"],acceptsVariableInterpolation:!1,allowsVariableReference:!1,expectsTypes:["string","array"],isDynamic:!1,isRequired:!1},{name:"not_from",description:"Taxonomies to exclude",aliases:["not_in","not_folder","dont_use","not_taxonomy"],allowsVariableReference:!1,acceptsVariableInterpolation:!1,expectsTypes:["string","array"],isRequired:!1,isDynamic:!1},{name:"min_count",description:"The minimum number of entries a taxonomy term must have to be returned",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1,isRequired:!1},{name:"collection",description:"Filter the terms to those that appear in the specified collections",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["string","array"],isDynamic:!1,isRequired:!1},{name:"sort",description:"The field to sort terms by",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1},{isRequired:!1,name:"filter",aliases:["query_scope"],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"Specifies a custom query scope",expectsTypes:["string"],isDynamic:!1}],WT=fR;var Rd=je(vt());function GT(t){var n,r;let e=[];if(t.currentNode!=null&&t.currentNode.currentScope!=null){let i=to(t.currentNode,t.project),s=t.project.getTaxonomyBlueprintFields(i),a=s.map(l=>l.name),o=Bi(t.leftWord);if(a.includes(o))return oe(as(t));if(t.isCaretInTag&&!((n=t.context)==null?void 0:n.interpolatedContext)&&["taxonomy","/taxonomy"].includes(t.leftWord)==!1){let l=[];for(let u=0;u0)return _n(e)}}if((t.leftWord=="taxonomy"||t.leftWord=="/taxonomy")&&t.leftChar==":"){let i=t.project.getUniqueTaxonomyNames();for(let s=0;sV("taxonomy Tag","The `taxonomy` tag may be used to retrieve taxonomy entries. The taxonomy tag can also be used to access entries associated with any given taxonomy term.","https://statamic.dev/tags/taxonomy")},YT=pR;var wd=je(vt());function HT(t,e){e.addVariables([{name:"is_published",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"is_page",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"is_entry",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"has_entries",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"is_parent",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"is_current",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"is_external",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"depth",dataType:"number",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"children",dataType:"array",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"first",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"last",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"count",dataType:"integer",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"index",dataType:"integer",sourceField:null,sourceName:"*internal.nav",introducedBy:t}]);let n=e.statamicProject.getUniqueCollectionNames(),r=[],i=!1;if(t.hasMethodPart()){let s=t.getMethodNameValue().trim().toLowerCase();if(s.startsWith("collection:")){let a=s.split(":").pop();i=!0,r.push(a)}else s=="pages"?(i=!0,r.push("pages")):(i=!1,r.push(s))}else{let s=t.findParameter("handle");s!=null&&(n.includes(s.value)?i=!0:i=!1,r.push(s.value))}if(i){let s=e.statamicProject.getBlueprintFields(r);e.addBlueprintFields(t,s),e.expandScopedAliasScope(t,"page","page",s)}else{let s=Bu(ps(t));e.addBlueprintFields(t,s),e.expandScopedAliasScope(t,"page","page",s)}return e}var dR={tagName:"nav:breadcrumbs",allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,hideFromCompletions:!1,introducedIn:null,injectParentScope:!1,parameters:[{name:"include_home",description:"Whether to include the home page in the first level",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["boolean"],isDynamic:!1,isRequired:!1},{name:"reverse",description:"Whether to reverse the order of links",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["boolean"],isRequired:!1,isDynamic:!1},{name:"trim",description:"Whether to trim the whitespace after each iteration of the loop",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["boolean"],isDynamic:!1,isRequired:!1}],augmentScope:(t,e)=>(e.addVariables([{name:"is_current",dataType:"boolean",sourceName:"*internal.nav.breadcrumbs",sourceField:null,introducedBy:t}]),e.addVariables(ps(t)),e),resolveDocumentation:t=>V("nav:breadcrumbs Tag","The `nav:breadcrumbs` tag can be used to retrieve the URLs of all pages that make up the current URL back to the site's home page.","https://statamic.dev/tags/nav-breadcrumbs")},Ac=dR;function $T(t,e){if(t.name=="handle"){let n=e.project.getUniqueCollectionNames(),r=e.project.getUniqueNavigationMenuNames(),i=[];return i=n,i=i.concat(r),i=[...new Set(i)],yt(i)}return null}var hR=[{isRequired:!1,acceptsVariableInterpolation:!1,aliases:["handle"],allowsVariableReference:!1,name:"for",description:"The navigation or collection to use",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],name:"from",description:"The starting point for the navigation",allowsVariableReference:!0,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,name:"show_unpublished",description:"Whether to include unpublished content",expectsTypes:["boolean"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,name:"include_home",description:"Whether to include the home page in the tree",expectsTypes:["boolean"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,name:"max_depth",description:"The maximum depth of the navigation or structure",expectsTypes:["number"],isDynamic:!1}],KT=hR;var Od={tagName:"structure",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,introducedIn:null,injectParentScope:!1,parameters:KT,augmentScope:HT,resovleParameterCompletionItems:$T,resolveCompletionItems:t=>{let e=[];if(t.isPastTagPart==!1&&(t.leftWord=="nav"||t.leftWord=="/nav"||t.leftWord=="structure"||t.leftWord=="/structure")&&t.leftChar==":"){let n=t.project.getUniqueNavigationMenuNames();for(let r=0;rV("nav Tag","The `nav` tag can be used to iterate structured collections or navigation menus.","https://statamic.dev/tags/nav")},zT=at(Od,"nav");var JT=je(vt());function XT(t){return[{name:"success",dataType:"string",sourceField:null,sourceName:"*internal.forms",introducedBy:t},{name:"submission_created",dataType:"boolean",sourceField:null,sourceName:"*internal.forms",introducedBy:t}]}var mR={name:"in",description:"The form to use",acceptsVariableInterpolation:!0,aliases:["handle","is","form","formset"],allowsVariableReference:!0,expectsTypes:["string"],isDynamic:!1,isRequired:!1},bi=mR;var Ld=je(vt()),gR=[{label:"GET",kind:Ld.CompletionItemKind.EnumMember},{label:"POST",kind:Ld.CompletionItemKind.EnumMember}],QT=gR;var ri=["in","handle","is","form","formset"];function no(t,e){return ri.includes(t.name)?yt(e.project.getUniqueFormNames()):t.name=="method"?oe(QT):t.name=="files"?oe(ll):null}function Ti(t,e){let n=t.structure.findParentWithName("form:set");return n!=null?{context:n,issues:[]}:{context:null,issues:[]}}var _R=["set","create","errors","success","submissions","submission"];function Ys(t){if(t.reference!=null&&"tagPart"in t.reference){let r=t.reference;if(r.nameMatches("form:set"))return Ys(r)}let e=t.findAnyParameter(ri),n=t.getMethodNameValue();return n!=null&&_R.includes(n)==!1?n:typeof e!="undefined"&&e!==null&&e.containsSimpleValue()?e.value:""}var yR={tagName:"form:create",allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!0,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[bi,{name:"method",description:"The HTTP method to use",allowsVariableReference:!1,acceptsVariableInterpolation:!1,aliases:[],expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"files",description:"Indicates if the form sends file data",aliases:[],allowsVariableReference:!1,acceptsVariableInterpolation:!1,expectsTypes:["boolean"],isDynamic:!1,isRequired:!1},{name:"redirect",description:"The location to redirect users after a successful form submission",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"error_redirect",description:"The location to redirect users to after a failed form submission",allowsVariableReference:!1,acceptsVariableInterpolation:!1,aliases:[],expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"allow_request_redirect",description:"Indicates if query parameters can override redirect or error_redirect",aliases:[],acceptsVariableInterpolation:!1,allowsVariableReference:!1,expectsTypes:["boolean"],isDynamic:!1,isRequired:!1}],resolveSpecialType:Ti,resovleParameterCompletionItems:no,resolveDynamicParameter:$e,augmentScope:(t,e)=>{e.addVariables(XT(t)),e.addVariable({dataType:"array",name:"errors",sourceField:null,sourceName:"*internal.forms",introducedBy:t}),e.addVariableArray("fields",Nc(t));let n=Ys(t);if(n.length>0){let r=e.statamicProject.getFormBlueprintFields(n),i=eo(t,r);e.addVariableArray("old",i),e.addVariableArray("error",i)}return e},resolveDocumentation:t=>V("form:create Tag","The `form:create` tag can be used to access form data, generate field HTML markup, and handle form validation errors.","https://statamic.dev/tags/form-create")},Sc=yR;var bR={tagName:"form:errors",allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[bi],resolveSpecialType:Ti,resovleParameterCompletionItems:(t,e)=>ri.includes(t.name)?yt(e.project.getUniqueFormNames()):null,resolveDocumentation:t=>V("form:errors Tag","The `form:errors` tag can be used to retrieve validation errors after a user has submitted a form.","https://statamic.dev/tags/form-errors")},Ec=bR;var TR={tagName:"form:set",allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[{name:"in",description:"The form to use",acceptsVariableInterpolation:!0,aliases:["handle","is","form","formset"],allowsVariableReference:!0,expectsTypes:["string"],isDynamic:!1,isRequired:!0}],resovleParameterCompletionItems:no,resolveDocumentation:t=>V("form:set Tag","The `form:set` tag can be used to set the form handle on all nested form tags.","https://statamic.dev/tags/form-set")},Ic=TR;var vR={tagName:"form:submission",requiresClose:!0,allowsContentClose:!1,allowsArbitraryParameters:!1,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[bi],resolveSpecialType:Ti,resovleParameterCompletionItems:(t,e)=>ri.includes(t.name)?yt(e.project.getUniqueFormNames()):null,augmentScope:(t,e)=>{let n=Ys(t);if(n.length>0){let r=e.statamicProject.getFormBlueprintFields(n);e.addBlueprintFields(t,r)}return e},resolveDocumentation:t=>V("form:submission Tag","The `form:submission` tag can be used to access the form submission submitted by the current user.","https://statamic.dev/tags/form-submission")},Dc=vR;var NR={tagName:"form:submissions",allowsArbitraryParameters:!1,allowsContentClose:!1,hideFromCompletions:!1,injectParentScope:!1,requiresClose:!0,introducedIn:null,parameters:[bi],resolveSpecialType:Ti,resovleParameterCompletionItems:(t,e)=>ri.includes(t.name)?yt(e.project.getUniqueFormNames()):null,augmentScope:(t,e)=>{if(t.isClosingTag)return e;let n=Ys(t);if(n.length>0){let r=e.statamicProject.getFormBlueprintFields(n);e.addBlueprintFields(t,r)}return e.addVariable({name:"date",dataType:"date",sourceField:null,sourceName:"*internal.forms.submissions",introducedBy:t}),e.addVariable({name:"no_results",dataType:"boolean",sourceField:null,sourceName:"*internal.forms.submissions",introducedBy:t}),e.addVariable({name:"total_results",dataType:"number",sourceField:null,sourceName:"*internal.forms.submissions",introducedBy:t}),e},resolveDocumentation:t=>V("form:submissions Tag","The `form:submissions` tag can be used to fetch previously saved submissions for a form.","https://statamic.dev/tags/form-submissions")},xc=NR;var CR={tagName:"form:success",allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[bi],resolveSpecialType:Ti,resovleParameterCompletionItems:(t,e)=>ri.includes(t.name)?yt(e.project.getUniqueFormNames()):null,resolveDocumentation:t=>V("form:success Tag","The `form:success` tag can be used to check if a form submission was successful or not.","https://statamic.dev/tags/form-success")},Rc=CR;var PR=[xe(Ic),xe(Sc),xe(Ec),xe(Rc),xe(xc),xe(Dc)],AR={tagName:"form",allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[],resovleParameterCompletionItems:no,resolveCompletionItems:t=>{let e=[];if(t.isPastTagPart==!1&&(t.leftWord=="form"||t.leftWord=="/form")&&t.leftChar==":"){let n=t.project.getUniqueFormNames();e=e.concat(PR);for(let r=0;rt.name=="index"?yt(e.project.getSearchIndexes()):null,augmentScope:(t,e)=>{e.addVariables([{name:"no_results",dataType:"boolean",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"total_results",dataType:"number",sourceField:null,sourceName:"*internal.search.results",introducedBy:t}]);let n=t.findParameter("as");return n!=null&&n.value.trim().length>0?e.addVariableArray(n.value,e0(t)):e.addVariables(e0(t)),e},resolveDocumentation:t=>V("search:results Tag","The `search:results` tag provides access to all data that was returned as a result of a user's search.","https://statamic.dev/tags/search")},SR=[xe(Fd)];function e0(t){return[{name:"url",dataType:"string",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"title",dataType:"string",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"content",dataType:"string",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"first",dataType:"boolean",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"last",dataType:"boolean",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"is_entry",dataType:"boolean",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"is_term",dataType:"boolean",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"count",dataType:"number",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"index",dataType:"number",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"search_score",dataType:"number",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"_highlightResult",dataType:"array",sourceField:null,sourceName:"*internal.search.results",introducedBy:t}]}var t0={tagName:"search",allowsArbitraryParameters:!1,requiresClose:!0,allowsContentClose:!1,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[],resolveCompletionItems:t=>t.isPastTagPart==!1&&(t.leftWord=="search"||t.leftWord=="/search")&&t.leftChar==":"?_n(SR):Ae};function kd(t){return[{name:"email",dataType:"string",sourceName:"*internal.user.login",sourceField:null,introducedBy:t},{name:"password",dataType:"string",sourceName:"*internal.user.login",sourceField:null,introducedBy:t}]}var Md={tagName:"user:login_form",allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!0,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[{name:"redirect",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,description:"Where the user should be redirected after logging in",expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"error_redirect",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,description:"Where the user should be redirected after failed login attempts",expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"allow_request_redirect",description:"Indicates if query parameters can override the redirect and error_redirect parameters",acceptsVariableInterpolation:!1,allowsVariableReference:!0,aliases:[],expectsTypes:["boolean"],isDynamic:!1,isRequired:!1}],resolveDynamicParameter:$e,augmentScope:(t,e)=>(e.addVariables([{name:"errors",dataType:"array",sourceName:"*internal.user.login",sourceField:null,introducedBy:t},{name:"success",dataType:"string",sourceName:"*internal.user.login",sourceField:null,introducedBy:t}]),e.addVariables(kd(t)),e.addVariableArray("old",kd(t)),e.addVariableArray("error",kd(t)),e),resolveDocumentation:t=>V("user:login_form Tag","The `user:login_form` tag can be used to quickly create a form that users can use to authenticate with the site.","https://statamic.dev/tags/user-login_form")},n0=at(Md,"member:login_form");var ER={tagName:"noparse",requiresClose:!0,allowsArbitraryParameters:!1,allowsContentClose:!1,hideFromCompletions:!1,injectParentScope:!1,parameters:[],introducedIn:null,resolveDocumentation:t=>V("noparse Tag","The `noparse` tag is used prevent blocks of Antlers code from being parsed, removing the need to escape individual Antlers code regions.","https://statamic.dev/antlers#the-noparse-tag")},r0=ER;var IR={tagName:"unless",hideFromCompletions:!0,allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!0,injectParentScope:!0,introducedIn:null,parameters:[],resolveDynamicParameter:$e,resolveDocumentation:t=>V("unless Conditional Control Structure","The `unless` control structure operates the same as an `if` statement, but has it's logic inverted.","https://statamic.dev/antlers#conditions")},i0=IR;var DR={tagName:"elseunless",hideFromCompletions:!0,allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!0,injectParentScope:!0,introducedIn:null,parameters:[],resolveDynamicParameter:$e,resolveDocumentation:t=>V("elseunless Conditional Control Structure","The `elseunless` control structure operates the same as an `elseif` statement, but has it's logic inverted.","https://statamic.dev/antlers#conditions")},s0=DR;var a0=je(ei());var o0={tagName:"installed",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!0,introducedIn:"3.1.19",parameters:[],resolveCompletionItems:t=>{if(t.project!=null){let e=t.project.getComposerPackages(),n=[];return e.forEach((r,i)=>{n.push({label:r.name,kind:a0.CompletionItemKind.Text})}),oe(n)}return Ae},resolveDocumentation:t=>qe("installed Tag","The `installed` tag is used to check if the site has a specific Composer package available.",`{{ if {installed:composer/package-name} }} +`,null)},RT=rR;var iR={tagName:"if",hideFromCompletions:!0,allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!0,injectParentScope:!0,introducedIn:null,parameters:[],resolveDynamicParameter:$e,resolveDocumentation:t=>V("if Conditional Control Structure","The contents of the `if` tag will be rendered when it's expression evaluates to `true`.","https://statamic.dev/antlers#conditions")},wT=iR;var sR={tagName:"elseif",hideFromCompletions:!0,allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!0,injectParentScope:!0,introducedIn:null,parameters:[],resolveDynamicParameter:$e,resolveDocumentation:t=>V("elseif Conditional Control Structure","The contents of the `elseif` tag will be rendered when it's expression evaluates to `true`.","https://statamic.dev/antlers#conditions")},OT=sR;var aR={tagName:"else",hideFromCompletions:!0,allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!0,injectParentScope:!0,introducedIn:null,parameters:[],resolveDocumentation:t=>V("else Conditional Control Structure","The contents of the `else` control structure will be evaluated when all previous conditional branch conditions were not met.","https://statamic.dev/antlers#conditions")},LT=aR;var FT=je(vt());var oR={tagName:"session:has",hideFromCompletions:!1,injectParentScope:!1,requiresClose:!1,allowsArbitraryParameters:!0,allowsContentClose:!0,parameters:[],introducedIn:"3.1.28",resolveDynamicParameter:$e,resolveDocumentation:t=>V("session:has Tag","The `session:has` tag can be used to determine of the user's session contains a specific variable.","https://statamic.dev/tags/session-has")},vc=oR;var lR=[xe(rc),xe(ac),xe(ic),xe(sc),xe(vc),xe(nc)],uR={tagName:"session",requiresClose:!1,allowsContentClose:!0,allowsArbitraryParameters:!1,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[{name:"as",description:"An optional alias for the session data",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1}],resolveCompletionItems:t=>{var e,n;if(t.isPastTagPart==!1&&(t.leftWord=="session"||t.leftWord=="/session")&&t.leftChar==":"){let r=(n=(e=pl.instance)==null?void 0:e.getKnownSessionVariableNames())!=null?n:[],i=[];i=i.concat(lR);for(let s=0;s{var s,a;let n=t.findParameter("as"),r=(a=(s=pl.instance)==null?void 0:s.getKnownSessionVariableNames())!=null?a:[],i=[];for(let o=0;o(e.addVariables([{name:"success",dataType:"boolean",sourceField:null,sourceName:"*internal.user.reset_password",introducedBy:t},{name:"url_invalid",dataType:"boolean",sourceField:null,sourceName:"*internal.user.reset_password",introducedBy:t},{name:"errors",dataType:"array",sourceField:null,sourceName:"*internal.user.reset_password",introducedBy:t}]),e),resolveDocumentation:t=>V("user:forgot_password_form Tag",'The `user:forgot_password_form` tag is used to quickly create a "forgot password" form for site users.',"https://statamic.dev/tags/user-forgot_password_form")},_d=at(hl,"member:forgot_password_form");_d.resolveDocumentation=t=>V("member:forgot_password_form Tag",'The `member:forgot_password_form` tag is used to quickly create a "forgot password" form for site users.',"https://statamic.dev/tags/user-forgot_password_form");var ml={tagName:"user:reset_password_form",allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!0,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[{name:"redirect",description:"Where the user should be taken after submitting the form",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,expectsTypes:["string"],isDynamic:!1,isRequired:!1}],resolveDynamicParameter:$e,augmentScope:(t,e)=>(e.addVariables([{name:"success",dataType:"boolean",sourceField:null,sourceName:"*internal.user.password_reset",introducedBy:t},{name:"url_invalid",dataType:"boolean",sourceField:null,sourceName:"*internal.user.password_reset",introducedBy:t},{name:"errors",dataType:"array",sourceField:null,sourceName:"*internal.user.password_reset",introducedBy:t}]),e),resolveDocumentation:t=>V("user:reset_password_form Tag","The `user:reset_password_form` tag is used to quickly create password reset forms. Forms created with this tag should be displayed after a user has received and clicked a password reset email link.","https://statamic.dev/tags/user-reset_password_form")},yd=at(ml,"member:reset_password_form");yd.resolveDocumentation=t=>V("member:reset_password_form Tag","The `member:reset_password_form` tag is used to quickly create password reset forms. Forms created with this tag should be displayed after a user has received and clicked a password reset email link.","https://statamic.dev/tags/user-reset_password_form");function MT(t,e){return{sourceName:e.blueprintName,dataType:e.type,name:e.name,sourceField:e,introducedBy:t}}function BT(t){let e=new Map;for(let n=0;n{e.addVariableArray("fields",Nc(t)),e.addVariable({name:"errors",dataType:"array",sourceName:"*internal.user.register_form",sourceField:null,introducedBy:t}),e.addVariable({name:"old",dataType:"array",sourceName:"*internal.user.register_form",sourceField:null,introducedBy:t}),e.addVariable({name:"error",dataType:"array",sourceName:"*internal.user.register_form",sourceField:null,introducedBy:t}),e.addVariable({name:"success",dataType:"string",sourceName:"*internal.user.register_form",sourceField:null,introducedBy:t});let n=e.statamicProject.getUserFields();if(n.length>0){let r=eo(t,n);e.addVariableArray("old",r),e.addVariableArray("error",r)}return e},resolveDocumentation:t=>V("user:register_form Form Tag","The `user:register_form` tag can be used to build out public registration forms for new users.","https://statamic.dev/tags/user-register_form")},bd=at(gl,"member:register_form");bd.resolveDocumentation=t=>V("member:register_form Tag","The `member:register_form` tag can be used to build out public registration forms for new users.","https://statamic.dev/tags/user-register_form");var cR=[xe(Qa),xe(Xa),xe(Ja),xe(Za),xe(Ya),xe(Tc),xe(hl),xe(Ha),xe($a),xe(gl),xe(ml)],fR={tagName:"user",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!1,parameters:bc,introducedIn:null,resovleParameterCompletionItems:(t,e)=>e.isPastTagPart==!1&&e.currentNode!=null&&e.currentNode.methodIsEmptyOrMatches("profile")&&t.name=="field"?oe(Mu(e.project.getUserFields())):Se,augmentScope:(t,e)=>(t.methodIsEmptyOrMatches("profile")&&e.injectUserFields(t),e),resolveCompletionItems:t=>(t.leftWord=="user"||t.leftWord=="/user"||t.leftWord=="member"||t.leftWord=="/member")&&t.leftChar==":"?oe(cR):Se,resolveDocumentation:t=>V("user Tag","The `user` tag provides access to the currently logged in user information, or for a specific user when using the `id`, `email`, or `field` parameter",null)},Cc=fR;var Pc=at(Cc,"member"),Td=at(Qa,"member:is"),vd=at(Ja,"member:isnt"),Nd=at(Za,"member:profile"),Cd=at(Ya,"member:can"),Pd=at(Ha,"member:logout"),Sd=at($a,"member:logout_url"),Ad=at(yc,"member:in"),Ed=at(Xa,"member:not_in");Pc.hideFromCompletions=!0;Pc.resolveDocumentation=t=>V("member Tag","The `member` tag provides access to the currently logged in user information, or for a specific user when using the `id`, `email`, or `field` parameter",null);Td.resolveDocumentation=t=>V("member:is Tag","The `member:is` tag can be used to check whether the currently authenticated user has one or more roles.","https://statamic.dev/tags/user-is");vd.resolveDocumentation=t=>V("member:isnt Tag","The `member:isnt` tag can be used to check whether the currently authenticated user does not have one or more roles.","https://statamic.dev/tags/user-is#isnt");Nd.resolveDocumentation=t=>V("member:profile Tag","The `member:profile` tag provides access to the currently logged in user information, or for a specific user when using the `id`, `email`, or `field` parameter",null);Cd.resolveDocumentation=t=>V("member:can Tag","The `member:can` tag is used to check if the currently authenticated user has a specific set of permissions. When used as a tag pair, the tag contents will only be rendered if the user has the specified permissions.","https://statamic.dev/tags/user-can");Pd.resolveDocumentation=t=>V("member:logout Tag","The `member:logout` tag will sign out the currently authenticated user. An optional `redirect` parameter may be used to redirect the visitor to a different page after being logged out.","https://statamic.dev/tags/user-logout");Sd.resolveDocumentation=t=>ke("member:logout_url","The `member:logout_url` tag can be used to retrieve the URL that will sign the current user out.",'Log out',"https://statamic.dev/tags/user-logout_url");Ad.resolveDocumentation=t=>V("member:in Tag","The `member:in` tag can be used to check if the currently authenticated user belongs to one or more user groups. When used as a tag pair, the tag contents will only be rendered if the user belongs to the specified groups.","https://statamic.dev/tags/user-in");Ed.resolveDocumentation=t=>V("member:not_in Tag","The `member:not_in` tag can be used to check if the currently authenticated user does not belong to one or more user groups. When used as a tag pair, the tag contents will be rendered if the user does not belong to the specified groups.","https://statamic.dev/tags/user-in#not-in");function ps(t){return[{name:"title",dataType:"string",sourceField:null,sourceName:"*internal.routeable",introducedBy:t},{name:"url",dataType:"string",sourceField:null,sourceName:"*internal.routeable",introducedBy:t}]}var jT=je(vt());var Id=["from","taxonomy","is","use","folder"],Dd=["not_from","not_in","dont_use","not_taxonomy"];var xd=Id;xd=xd.concat(Dd);function qT(t,e){var n,r,i,s,a,o,l,u;if(e.nodesInScope.length>0){let c=e.nodesInScope[e.nodesInScope.length-1];if(c!=null&&c.currentScope!=null){let f=to(c,e.project),h=e.project.getTaxonomyBlueprintFields(f),y=h.map(d=>d.name),p=Bi(e.leftWord);if(y.includes(p))return oe(as(e))}}return t.name=="collection"&&((n=e.context)==null?void 0:n.parameterContext)!=null?oe(qa((s=(i=(r=e.context)==null?void 0:r.parameterContext.parameter)==null?void 0:i.getArrayValue())!=null?s:[],e.project)):t.name=="filter"||t.name=="query_scope"?oe(qu(e.project)):xd.includes(t.name)&&((a=e.context)==null?void 0:a.parameterContext)!=null?oe(VT((u=(l=(o=e.context)==null?void 0:o.parameterContext.parameter)==null?void 0:l.getArrayValue())!=null?u:[],e.project)):null}function to(t,e){let n=[];if(t.hasMethodPart())return n.push(t.getMethodNameValue()),n;let r=t.findAnyParameter(Id),i=t.findAnyParameter(Dd),s=[],a=[];return typeof r!="undefined"&&r!==null&&(r.value.trim()==="*"?(s=e.getUniqueTaxonomyNames(),typeof i!="undefined"&&i!==null&&i.isVariableReference==!1&&i.hasInterpolations()==!1&&(a=i.getArrayValue())):r.isVariableReference==!1&&r.hasInterpolations()==!1&&(s=r.getArrayValue())),a.length>0?n=s.filter(function(o){return a.includes(o)==!1}):n=s,n}function VT(t,e){let n=[],r=e.getUniqueTaxonomyNames().filter(i=>!t.includes(i));for(let i=0;i0){let a=e.statamicProject.getBlueprintFields(s);e.introduceScopedAliasScope(t,"entries","entries",a).addVariables(os(t))}else e.addVariableArray("entries",ps(t).concat(os(t)))}else e.addVariableArray("entries",ps(t).concat(os(t)));return e}var pR=[{name:"from",description:"The taxonomy to use",aliases:["taxonomy","is","use","folder"],acceptsVariableInterpolation:!1,allowsVariableReference:!1,expectsTypes:["string","array"],isDynamic:!1,isRequired:!1},{name:"not_from",description:"Taxonomies to exclude",aliases:["not_in","not_folder","dont_use","not_taxonomy"],allowsVariableReference:!1,acceptsVariableInterpolation:!1,expectsTypes:["string","array"],isRequired:!1,isDynamic:!1},{name:"min_count",description:"The minimum number of entries a taxonomy term must have to be returned",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["number"],isDynamic:!1,isRequired:!1},{name:"collection",description:"Filter the terms to those that appear in the specified collections",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["string","array"],isDynamic:!1,isRequired:!1},{name:"sort",description:"The field to sort terms by",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1},{isRequired:!1,name:"filter",aliases:["query_scope"],acceptsVariableInterpolation:!1,allowsVariableReference:!1,description:"Specifies a custom query scope",expectsTypes:["string"],isDynamic:!1}],WT=pR;var Rd=je(vt());function GT(t){var n,r;let e=[];if(t.currentNode!=null&&t.currentNode.currentScope!=null){let i=to(t.currentNode,t.project),s=t.project.getTaxonomyBlueprintFields(i),a=s.map(l=>l.name),o=Bi(t.leftWord);if(a.includes(o))return oe(as(t));if(t.isCaretInTag&&!((n=t.context)==null?void 0:n.interpolatedContext)&&["taxonomy","/taxonomy"].includes(t.leftWord)==!1){let l=[];for(let u=0;u0)return _n(e)}}if((t.leftWord=="taxonomy"||t.leftWord=="/taxonomy")&&t.leftChar==":"){let i=t.project.getUniqueTaxonomyNames();for(let s=0;sV("taxonomy Tag","The `taxonomy` tag may be used to retrieve taxonomy entries. The taxonomy tag can also be used to access entries associated with any given taxonomy term.","https://statamic.dev/tags/taxonomy")},YT=dR;var wd=je(vt());function HT(t,e){e.addVariables([{name:"is_published",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"is_page",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"is_entry",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"has_entries",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"is_parent",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"is_current",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"is_external",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"depth",dataType:"number",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"children",dataType:"array",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"first",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"last",dataType:"boolean",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"count",dataType:"integer",sourceField:null,sourceName:"*internal.nav",introducedBy:t},{name:"index",dataType:"integer",sourceField:null,sourceName:"*internal.nav",introducedBy:t}]);let n=e.statamicProject.getUniqueCollectionNames(),r=[],i=!1;if(t.hasMethodPart()){let s=t.getMethodNameValue().trim().toLowerCase();if(s.startsWith("collection:")){let a=s.split(":").pop();i=!0,r.push(a)}else s=="pages"?(i=!0,r.push("pages")):(i=!1,r.push(s))}else{let s=t.findParameter("handle");s!=null&&(n.includes(s.value)?i=!0:i=!1,r.push(s.value))}if(i){let s=e.statamicProject.getBlueprintFields(r);e.addBlueprintFields(t,s),e.expandScopedAliasScope(t,"page","page",s)}else{let s=Bu(ps(t));e.addBlueprintFields(t,s),e.expandScopedAliasScope(t,"page","page",s)}return e}var hR={tagName:"nav:breadcrumbs",allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,hideFromCompletions:!1,introducedIn:null,injectParentScope:!1,parameters:[{name:"include_home",description:"Whether to include the home page in the first level",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["boolean"],isDynamic:!1,isRequired:!1},{name:"reverse",description:"Whether to reverse the order of links",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["boolean"],isRequired:!1,isDynamic:!1},{name:"trim",description:"Whether to trim the whitespace after each iteration of the loop",acceptsVariableInterpolation:!1,allowsVariableReference:!1,aliases:[],expectsTypes:["boolean"],isDynamic:!1,isRequired:!1}],augmentScope:(t,e)=>(e.addVariables([{name:"is_current",dataType:"boolean",sourceName:"*internal.nav.breadcrumbs",sourceField:null,introducedBy:t}]),e.addVariables(ps(t)),e),resolveDocumentation:t=>V("nav:breadcrumbs Tag","The `nav:breadcrumbs` tag can be used to retrieve the URLs of all pages that make up the current URL back to the site's home page.","https://statamic.dev/tags/nav-breadcrumbs")},Sc=hR;function $T(t,e){if(t.name=="handle"){let n=e.project.getUniqueCollectionNames(),r=e.project.getUniqueNavigationMenuNames(),i=[];return i=n,i=i.concat(r),i=[...new Set(i)],yt(i)}return null}var mR=[{isRequired:!1,acceptsVariableInterpolation:!1,aliases:["handle"],allowsVariableReference:!1,name:"for",description:"The navigation or collection to use",expectsTypes:["string"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],name:"from",description:"The starting point for the navigation",allowsVariableReference:!0,expectsTypes:["string"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,name:"show_unpublished",description:"Whether to include unpublished content",expectsTypes:["boolean"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,name:"include_home",description:"Whether to include the home page in the tree",expectsTypes:["boolean"],isDynamic:!1},{isRequired:!1,acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,name:"max_depth",description:"The maximum depth of the navigation or structure",expectsTypes:["number"],isDynamic:!1}],KT=mR;var Od={tagName:"structure",hideFromCompletions:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,introducedIn:null,injectParentScope:!1,parameters:KT,augmentScope:HT,resovleParameterCompletionItems:$T,resolveCompletionItems:t=>{let e=[];if(t.isPastTagPart==!1&&(t.leftWord=="nav"||t.leftWord=="/nav"||t.leftWord=="structure"||t.leftWord=="/structure")&&t.leftChar==":"){let n=t.project.getUniqueNavigationMenuNames();for(let r=0;rV("nav Tag","The `nav` tag can be used to iterate structured collections or navigation menus.","https://statamic.dev/tags/nav")},zT=at(Od,"nav");var JT=je(vt());function XT(t){return[{name:"success",dataType:"string",sourceField:null,sourceName:"*internal.forms",introducedBy:t},{name:"submission_created",dataType:"boolean",sourceField:null,sourceName:"*internal.forms",introducedBy:t}]}var gR={name:"in",description:"The form to use",acceptsVariableInterpolation:!0,aliases:["handle","is","form","formset"],allowsVariableReference:!0,expectsTypes:["string"],isDynamic:!1,isRequired:!1},bi=gR;var Ld=je(vt()),_R=[{label:"GET",kind:Ld.CompletionItemKind.EnumMember},{label:"POST",kind:Ld.CompletionItemKind.EnumMember}],QT=_R;var ri=["in","handle","is","form","formset"];function no(t,e){return ri.includes(t.name)?yt(e.project.getUniqueFormNames()):t.name=="method"?oe(QT):t.name=="files"?oe(ll):null}function Ti(t,e){let n=t.structure.findParentWithName("form:set");return n!=null?{context:n,issues:[]}:{context:null,issues:[]}}var yR=["set","create","errors","success","submissions","submission"];function Ys(t){if(t.reference!=null&&"tagPart"in t.reference){let r=t.reference;if(r.nameMatches("form:set"))return Ys(r)}let e=t.findAnyParameter(ri),n=t.getMethodNameValue();return n!=null&&yR.includes(n)==!1?n:typeof e!="undefined"&&e!==null&&e.containsSimpleValue()?e.value:""}var bR={tagName:"form:create",allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!0,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[bi,{name:"method",description:"The HTTP method to use",allowsVariableReference:!1,acceptsVariableInterpolation:!1,aliases:[],expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"files",description:"Indicates if the form sends file data",aliases:[],allowsVariableReference:!1,acceptsVariableInterpolation:!1,expectsTypes:["boolean"],isDynamic:!1,isRequired:!1},{name:"redirect",description:"The location to redirect users after a successful form submission",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"error_redirect",description:"The location to redirect users to after a failed form submission",allowsVariableReference:!1,acceptsVariableInterpolation:!1,aliases:[],expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"allow_request_redirect",description:"Indicates if query parameters can override redirect or error_redirect",aliases:[],acceptsVariableInterpolation:!1,allowsVariableReference:!1,expectsTypes:["boolean"],isDynamic:!1,isRequired:!1}],resolveSpecialType:Ti,resovleParameterCompletionItems:no,resolveDynamicParameter:$e,augmentScope:(t,e)=>{e.addVariables(XT(t)),e.addVariable({dataType:"array",name:"errors",sourceField:null,sourceName:"*internal.forms",introducedBy:t}),e.addVariableArray("fields",Nc(t));let n=Ys(t);if(n.length>0){let r=e.statamicProject.getFormBlueprintFields(n),i=eo(t,r);e.addVariableArray("old",i),e.addVariableArray("error",i)}return e},resolveDocumentation:t=>V("form:create Tag","The `form:create` tag can be used to access form data, generate field HTML markup, and handle form validation errors.","https://statamic.dev/tags/form-create")},Ac=bR;var TR={tagName:"form:errors",allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[bi],resolveSpecialType:Ti,resovleParameterCompletionItems:(t,e)=>ri.includes(t.name)?yt(e.project.getUniqueFormNames()):null,resolveDocumentation:t=>V("form:errors Tag","The `form:errors` tag can be used to retrieve validation errors after a user has submitted a form.","https://statamic.dev/tags/form-errors")},Ec=TR;var vR={tagName:"form:set",allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[{name:"in",description:"The form to use",acceptsVariableInterpolation:!0,aliases:["handle","is","form","formset"],allowsVariableReference:!0,expectsTypes:["string"],isDynamic:!1,isRequired:!0}],resovleParameterCompletionItems:no,resolveDocumentation:t=>V("form:set Tag","The `form:set` tag can be used to set the form handle on all nested form tags.","https://statamic.dev/tags/form-set")},Ic=vR;var NR={tagName:"form:submission",requiresClose:!0,allowsContentClose:!1,allowsArbitraryParameters:!1,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[bi],resolveSpecialType:Ti,resovleParameterCompletionItems:(t,e)=>ri.includes(t.name)?yt(e.project.getUniqueFormNames()):null,augmentScope:(t,e)=>{let n=Ys(t);if(n.length>0){let r=e.statamicProject.getFormBlueprintFields(n);e.addBlueprintFields(t,r)}return e},resolveDocumentation:t=>V("form:submission Tag","The `form:submission` tag can be used to access the form submission submitted by the current user.","https://statamic.dev/tags/form-submission")},Dc=NR;var CR={tagName:"form:submissions",allowsArbitraryParameters:!1,allowsContentClose:!1,hideFromCompletions:!1,injectParentScope:!1,requiresClose:!0,introducedIn:null,parameters:[bi],resolveSpecialType:Ti,resovleParameterCompletionItems:(t,e)=>ri.includes(t.name)?yt(e.project.getUniqueFormNames()):null,augmentScope:(t,e)=>{if(t.isClosingTag)return e;let n=Ys(t);if(n.length>0){let r=e.statamicProject.getFormBlueprintFields(n);e.addBlueprintFields(t,r)}return e.addVariable({name:"date",dataType:"date",sourceField:null,sourceName:"*internal.forms.submissions",introducedBy:t}),e.addVariable({name:"no_results",dataType:"boolean",sourceField:null,sourceName:"*internal.forms.submissions",introducedBy:t}),e.addVariable({name:"total_results",dataType:"number",sourceField:null,sourceName:"*internal.forms.submissions",introducedBy:t}),e},resolveDocumentation:t=>V("form:submissions Tag","The `form:submissions` tag can be used to fetch previously saved submissions for a form.","https://statamic.dev/tags/form-submissions")},xc=CR;var PR={tagName:"form:success",allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[bi],resolveSpecialType:Ti,resovleParameterCompletionItems:(t,e)=>ri.includes(t.name)?yt(e.project.getUniqueFormNames()):null,resolveDocumentation:t=>V("form:success Tag","The `form:success` tag can be used to check if a form submission was successful or not.","https://statamic.dev/tags/form-success")},Rc=PR;var SR=[xe(Ic),xe(Ac),xe(Ec),xe(Rc),xe(xc),xe(Dc)],AR={tagName:"form",allowsArbitraryParameters:!1,allowsContentClose:!1,requiresClose:!0,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[],resovleParameterCompletionItems:no,resolveCompletionItems:t=>{let e=[];if(t.isPastTagPart==!1&&(t.leftWord=="form"||t.leftWord=="/form")&&t.leftChar==":"){let n=t.project.getUniqueFormNames();e=e.concat(SR);for(let r=0;rt.name=="index"?yt(e.project.getSearchIndexes()):null,augmentScope:(t,e)=>{e.addVariables([{name:"no_results",dataType:"boolean",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"total_results",dataType:"number",sourceField:null,sourceName:"*internal.search.results",introducedBy:t}]);let n=t.findParameter("as");return n!=null&&n.value.trim().length>0?e.addVariableArray(n.value,e0(t)):e.addVariables(e0(t)),e},resolveDocumentation:t=>V("search:results Tag","The `search:results` tag provides access to all data that was returned as a result of a user's search.","https://statamic.dev/tags/search")},ER=[xe(Fd)];function e0(t){return[{name:"url",dataType:"string",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"title",dataType:"string",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"content",dataType:"string",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"first",dataType:"boolean",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"last",dataType:"boolean",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"is_entry",dataType:"boolean",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"is_term",dataType:"boolean",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"count",dataType:"number",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"index",dataType:"number",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"search_score",dataType:"number",sourceField:null,sourceName:"*internal.search.results",introducedBy:t},{name:"_highlightResult",dataType:"array",sourceField:null,sourceName:"*internal.search.results",introducedBy:t}]}var t0={tagName:"search",allowsArbitraryParameters:!1,requiresClose:!0,allowsContentClose:!1,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[],resolveCompletionItems:t=>t.isPastTagPart==!1&&(t.leftWord=="search"||t.leftWord=="/search")&&t.leftChar==":"?_n(ER):Se};function kd(t){return[{name:"email",dataType:"string",sourceName:"*internal.user.login",sourceField:null,introducedBy:t},{name:"password",dataType:"string",sourceName:"*internal.user.login",sourceField:null,introducedBy:t}]}var Md={tagName:"user:login_form",allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!0,hideFromCompletions:!1,injectParentScope:!1,introducedIn:null,parameters:[{name:"redirect",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,description:"Where the user should be redirected after logging in",expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"error_redirect",acceptsVariableInterpolation:!1,aliases:[],allowsVariableReference:!0,description:"Where the user should be redirected after failed login attempts",expectsTypes:["string"],isDynamic:!1,isRequired:!1},{name:"allow_request_redirect",description:"Indicates if query parameters can override the redirect and error_redirect parameters",acceptsVariableInterpolation:!1,allowsVariableReference:!0,aliases:[],expectsTypes:["boolean"],isDynamic:!1,isRequired:!1}],resolveDynamicParameter:$e,augmentScope:(t,e)=>(e.addVariables([{name:"errors",dataType:"array",sourceName:"*internal.user.login",sourceField:null,introducedBy:t},{name:"success",dataType:"string",sourceName:"*internal.user.login",sourceField:null,introducedBy:t}]),e.addVariables(kd(t)),e.addVariableArray("old",kd(t)),e.addVariableArray("error",kd(t)),e),resolveDocumentation:t=>V("user:login_form Tag","The `user:login_form` tag can be used to quickly create a form that users can use to authenticate with the site.","https://statamic.dev/tags/user-login_form")},n0=at(Md,"member:login_form");var IR={tagName:"noparse",requiresClose:!0,allowsArbitraryParameters:!1,allowsContentClose:!1,hideFromCompletions:!1,injectParentScope:!1,parameters:[],introducedIn:null,resolveDocumentation:t=>V("noparse Tag","The `noparse` tag is used prevent blocks of Antlers code from being parsed, removing the need to escape individual Antlers code regions.","https://statamic.dev/antlers#the-noparse-tag")},r0=IR;var DR={tagName:"unless",hideFromCompletions:!0,allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!0,injectParentScope:!0,introducedIn:null,parameters:[],resolveDynamicParameter:$e,resolveDocumentation:t=>V("unless Conditional Control Structure","The `unless` control structure operates the same as an `if` statement, but has it's logic inverted.","https://statamic.dev/antlers#conditions")},i0=DR;var xR={tagName:"elseunless",hideFromCompletions:!0,allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!0,injectParentScope:!0,introducedIn:null,parameters:[],resolveDynamicParameter:$e,resolveDocumentation:t=>V("elseunless Conditional Control Structure","The `elseunless` control structure operates the same as an `elseif` statement, but has it's logic inverted.","https://statamic.dev/antlers#conditions")},s0=xR;var a0=je(ei());var o0={tagName:"installed",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsContentClose:!1,allowsArbitraryParameters:!0,introducedIn:"3.1.19",parameters:[],resolveCompletionItems:t=>{if(t.project!=null){let e=t.project.getComposerPackages(),n=[];return e.forEach((r,i)=>{n.push({label:r.name,kind:a0.CompletionItemKind.Text})}),oe(n)}return Se},resolveDocumentation:t=>ke("installed Tag","The `installed` tag is used to check if the site has a specific Composer package available.",`{{ if {installed:composer/package-name} }} {{# Package is availabl.e #}} {{ else }} {{# Something else. #}} -{{ /if }}`,"https://statamic.dev/tags/installed")};var xR={tagName:"relate",hideFromCompletions:!0,allowsArbitraryParameters:!1,allowsContentClose:!1,injectParentScope:!1,requiresClose:!0,introducedIn:null,parameters:[]},l0=xR;var ro=[{name:"bag",description:"The error message bag to retrieve errors from.",aliases:[],acceptsVariableInterpolation:!1,allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1}];var RR={tagName:"get_errors",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,parameters:ro,introducedIn:"3.2.23",augmentScope:(t,e)=>{var n;if(t.isClosingTag)return e;if(((n=t.name)==null?void 0:n.methodPart)==null){let r=e.copy();r.addVariable({dataType:"string",introducedBy:t,name:"field",sourceName:"*internal.tag.get_errors",sourceField:{blueprintName:"*internal.tag.get_errors",displayName:"get_errors",import:null,instructionText:null,maxItems:null,name:"field",refFieldSetField:null,sets:null,type:"string"}});let i=r.copy();i.addVariable({dataType:"string",introducedBy:t,name:"message",sourceName:"*internal.tag.get_errors",sourceField:{blueprintName:"*internal.tag.get_errors",displayName:"get_errors",import:null,instructionText:null,maxItems:null,name:"message",refFieldSetField:null,sets:null,type:"string"}}),r.addScopeList("messages",i),e.addScopeList("fields",r)}else{let r=e.copy();r.addVariable({dataType:"string",introducedBy:t,name:"message",sourceName:"*internal.tag.get_errors",sourceField:{blueprintName:"*internal.tag.get_errors",displayName:"get_errors",import:null,instructionText:null,maxItems:null,name:"message",refFieldSetField:null,sets:null,type:"string"}}),e.addScopeList("messages",r)}return e},resolveDocumentation:t=>V("get_errors Tag","The `get_errors` tag can be used to retrieve form validation errors.","https://statamic.dev/tags/get_errors")},u0=RR;var wR={tagName:"get_errors:all",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,parameters:ro,introducedIn:null,augmentScope:(t,e)=>{if(t.isClosingTag)return e;let n=e.copy();return n.addVariable({dataType:"string",introducedBy:t,name:"message",sourceName:"*internal.tag.get_errors.all",sourceField:{blueprintName:"*internal.tag.get_errors.all",displayName:"get_errors:all",import:null,instructionText:null,maxItems:null,name:"message",refFieldSetField:null,sets:null,type:"string"}}),e.addScopeList("messages",n),e},resolveDocumentation:t=>V("get_errors:all Tag","The `get_errors:all` tag can be used to retrieve all form validation errors.","https://statamic.dev/tags/get_errors#list-all-validation-errors")},c0=wR;var OR={tagName:"get_error",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,parameters:ro,introducedIn:null,augmentScope:(t,e)=>(t.isClosingTag||e.addVariable({dataType:"string",introducedBy:t,name:"message",sourceName:"*internal.tag.get_error",sourceField:{blueprintName:"*internal.tag.get_error",displayName:"get_error",import:null,instructionText:null,maxItems:null,name:"message",refFieldSetField:null,sets:null,type:"string"}}),e),resolveDocumentation:t=>V("get_error Tag","The `get_error` tag can be used to retrieve the first error message for a specific field.","https://statamic.dev/tags/get_errors#get-the-first-error-for-a-specific-field")},f0=OR;var LR={tagName:"set",hideFromCompletions:!0,allowsArbitraryParameters:!0,requiresClose:!1,allowsContentClose:!1,injectParentScope:!1,introducedIn:null,parameters:[]},p0=LR;var d0=je(ei());var FR={tagName:"mount_url",hideFromCompletions:!1,allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,introducedIn:"3.3.15",parameters:[{isRequired:!1,acceptsVariableInterpolation:!0,aliases:[],allowsVariableReference:!0,description:"The collection handle",name:"handle",isDynamic:!1,expectsTypes:["string"]}],resolveDocumentation:t=>V("mount Tag","The `mount` tag can be used to retrieve the mount URL for a given collection.",null),resovleParameterCompletionItems:(t,e)=>{var n,r,i,s;return t.name=="handle"&&((n=e.context)==null?void 0:n.parameterContext)!=null?oe(qa((s=(i=(r=e.context)==null?void 0:r.parameterContext.parameter)==null?void 0:i.getArrayValue())!=null?s:[],e.project)):null},resolveCompletionItems:t=>{let e=[];if(t.isPastTagPart==!1&&(t.leftWord=="mount_url"||t.leftWord=="/mount_url")&&t.leftChar==":"){let n=t.project.getCollectionNames();for(let r=0;rqe("vite Tag","Generates Vite tags for an entrypoint.",'{{ vite src="entry/point" }}',null)},m0=kR;var g0=[wT,OT,LT,i0,s0,eT,rT,vb,zu,Vs,Xu,Ku,$u,l0,ZT,Sc,Dc,xc,Ic,Rc,Ec,p0,u0,f0,c0,t0,Fd,xb,Qu,Ju,Pb,yT,Cb,NT,vT,Nb,iT,aT,uT,mc,Ab,Sb,Eb,cT,fT,Rb,Zu,dT,_c,hT,h0,zT,Od,Ac,Ob,wb,yc,_T,Xa,Qa,bT,o0,Cc,Ja,Ya,Tc,Ha,$a,Za,Md,ml,hl,gl,Pc,Td,vd,Nd,Cd,Pd,Ad,Sd,Ed,n0,yd,_d,bd,r0,kb,Mb,Bb,Xb,Qb,CT,Hb,Gb,RT,zb,kT,ac,sc,ic,rc,vc,nc,Zb,YT,AT,gd,ST,ET,IT,DT,xT,cc,Jb,pd,PT,jb,oc,TT,m0];var ds=class{constructor(){this.tags=new Map;this.parameters=new Map}reset(){this.tags.clear(),this.parameters.clear(),this.loadCoreTags()}getVisibleTagsWithDocumentation(){let e=[];return this.tags.forEach((n,r)=>{if(n.hideFromCompletions==!1){let i="";n.resolveDocumentation!=null&&(i=n.resolveDocumentation()),e.push({label:r,documentation:i})}}),e}getVisibleTagNames(){let e=[];return this.tags.forEach((n,r)=>{n.hideFromCompletions==!1&&e.push(r)}),[...new Set(e)]}getPossibleTagMethods(e){let n=[],r=e.length+1;return this.tags.forEach((i,s)=>{if(s.startsWith(e)){let a=s.substr(r).trim();a.length>0&&n.push(a)}}),[...new Set(n)]}getTagNames(){let e=[];return this.tags.forEach((n,r)=>{e.push(r)}),[...new Set(e)]}loadCoreTags(){this.registerTags(g0)}cleanTagName(e){return Ei(e,"/")}findTag(e){return this.tags.get(this.resolveTagName(e))}isKnownTag(e){return this.tags.has(this.resolveTagName(e))}isSymbolKnownTag(e){return this.isKnownTag(e.runtimeName())}resolveTagName(e){return e=this.cleanTagName(e.trim()),this.tags.has(e)||e.includes(":")&&(e=e.split(":")[0]),e}canResolveSpecialTypes(e){e=this.resolveTagName(e);let n=this.tags.get(e);return!(typeof n=="undefined"||n==null||n.resolveSpecialType==null)}resolveSpecialType(e,n,r){e=this.resolveTagName(e);let i=this.findTag(e);if(i.resolveSpecialType==null)throw new Error(e+" does not support special types.");return i.resolveSpecialType(n,r)}getCompletionItems(e){var s;let n=null,r=[],i=!0;if(e.nodesInScope.length>0&&(n=e.nodesInScope[e.nodesInScope.length-1]),e.currentNode!=null&&this.isKnownTag(e.currentNode.runtimeName())){let a=this.findTag(e.currentNode.runtimeName());if(typeof a=="undefined")return{isExclusive:!1,items:[]};let o=[];if(a.resolveCompletionItems!=null){let l=a.resolveCompletionItems(e);if(l.isExclusiveResult)return{isExclusive:!0,items:l.items};i=l.analyzeDefaults,r=r.concat(l.items)}if(e.isPastTagPart==!1){let l=this.getPossibleTagMethods(a.tagName);for(let u=0;u0&&(r=r.concat(nd(e,a.parameters)),a.tagName=="partial"&&(n==null?void 0:n.hasMethodPart()))){let l=n.getMethodNameValue();if(l.trim().length>0&&((s=cr.instance)==null?void 0:s.hasStructure())){let u=cr.instance.getStructure().findPartial(l);u!=null&&u.injectsParameters.length>0&&(r=r.concat(nd(e,u.injectsParameters)))}}for(let l=0;l0){let n=this.parameters.get(e.tagName);for(let r=0;r{e.push(r)}),e}getVariableNames(){let e=[];return this.values.forEach(n=>{e.push(n.name)}),e}getList(e){return this.lists.has(e)?this.lists.get(e):this.parentScope!=null&&this.parentScope!=this?this.parentScope.getList(e):null}hasValue(e){return this.values.has(e)}findAncestorWithList(e){return this.hasList(e)?this:this.parentScope!=null&&this.parentScope!=this?this.parentScope.findAncestorWithList(e):null}findReferenceNotIntroducedBy(e,n){if(this.hasValue(e)){let r=this.values.get(e);if(r.introducedBy!=null&&r.introducedBy!=n)return r}return this.parentScope!=null&&this.parentScope!=this?this.parentScope.findReferenceNotIntroducedBy(e,n):null}removeThroughIntroduction(e,n){if(this.values.delete(e),this.parentScope!=null){let r=this.findReferenceNotIntroducedBy(e,n);r!=null&&this.addVariable(r)}}wasIntroducedBySymbol(e,n){if(this.values.has(e)==!1)return!1;let r=this.values.get(e);return r.introducedBy!=null?r.introducedBy==n:!1}referencesArray(e){return this.values.has(e)==!1?!1:this.values.get(e).dataType=="array"}addScopeList(e,n){return this.lists.set(e,n),this}mergeAndList(e,n){let r=new Nr(this.statamicProject);return r.values=BT(n),this.lists.set(e,r),this.mergeVariableScope(n),this}mergeScope(e){return e==this||e==null?this:(typeof e.values!="undefined"&&e.values!==null&&e.values.forEach((n,r)=>{this.values.set(r,n)}),typeof e.lists!="undefined"&&e.lists!==null&&e.lists.forEach((n,r)=>{this.lists.set(r,n)}),this)}mergeVariableScope(e){for(let n=0;n0&&this.addBlueprintFields(e,r)}copy(){let e=new Nr(this.statamicProject);return e.pristine=new Map(this.pristine),e.values=new Map(this.values),e.lists=new Map(this.lists),e.parentScope=this,e}},rr=Nr;rr.generationCounter=0;function Bd(t){let e=new rr(t);return e.addVariable({dataType:"string",name:"handle",sourceField:null,sourceName:"*internal.system",introducedBy:null}),e.addVariable({dataType:"string",name:"name",sourceField:null,sourceName:"*internal.system",introducedBy:null}),e.addVariable({dataType:"string",name:"locale",sourceField:null,sourceName:"*internal.system",introducedBy:null}),e.addVariable({dataType:"string",name:"short_locale",sourceField:null,sourceName:"*internal.system",introducedBy:null}),e.addVariable({dataType:"string",name:"url",sourceField:null,sourceName:"*internal.system",introducedBy:null}),e}function y0(){let t=[];return t.push({dataType:"number",name:"response_code",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"csrf_field",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"csrf_token",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"environment",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"template",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"xml_header",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"last_segment",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"homepage",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"current_uri",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"current_url",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"amp_url",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"api_url",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"current_full_url",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"current_template",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"boolean",name:"logged_in",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"boolean",name:"logged_out",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"boolean",name:"is_homepage",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"date",name:"now",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"date",name:"today",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"date",name:"current_date",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"array",name:"get",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"array",name:"get_post",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"array",name:"post",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"array",name:"old",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t}function b0(t,e){let n=t.findParameter("paginate");if(n!=null&&(n.value.toLowerCase()=="true"||parseInt(n.value).toString()==n.value)){let r=e.makeNew(),i=e.makeNew(),s=e.makeNew(),a=e.makeNew();r.addVariable({name:"next_page",dataType:"string",sourceName:"*internal.pagination",sourceField:null,introducedBy:t}),r.addVariable({name:"prev_page",dataType:"string",sourceName:"*internal.pagination",sourceField:null,introducedBy:t}),r.addVariable({name:"total_items",dataType:"integer",sourceName:"*internal.pagination",sourceField:null,introducedBy:t}),r.addVariable({name:"total_pages",dataType:"integer",sourceName:"*internal.pagination",sourceField:null,introducedBy:t}),r.addVariable({name:"current_page",dataType:"integer",sourceName:"*internal.pagination",sourceField:null,introducedBy:t}),r.addVariable({name:"auto_links",dataType:"string",sourceName:"*internal.pagination",sourceField:null,introducedBy:t}),s.addVariable({name:"url",dataType:"string",sourceField:null,sourceName:"*internal.pagination.all",introducedBy:t}),s.addVariable({name:"page",dataType:"integer",sourceField:null,sourceName:"*internal.pagination.all",introducedBy:t}),a.addVariable({name:"first",dataType:"boolean",sourceName:"*internal.pagination.segments",sourceField:null,introducedBy:t}),a.addVariable({name:"last",dataType:"boolean",sourceName:"*internal.pagination.segments",sourceField:null,introducedBy:t}),a.addVariable({name:"slider",dataType:"boolean",sourceName:"*internal.pagination.segments",sourceField:null,introducedBy:t}),i.addScopeList("all",s),i.addScopeList("segments",a),r.addScopeList("links",i),e.addScopeList("paginate",r)}}var Hs=class{constructor(){this.fileInjections=new Map;this.project=null}updateProject(e){this.project=e}registerInjections(e,n){if(n.length==0)return;let r=[];for(let i=0;i0){let i=r[0].getMethodNameValue();if(i!=null&&this.project!=null){let s=this.project.findPartial(i);s!=null&&(this.fileInjections.has(s.documentUri)||this.fileInjections.set(s.documentUri,new Map),this.fileInjections.get(s.documentUri).set(e,r))}}}hasAvailableInjections(e){return this.fileInjections.has(e)}getScopeInjection(e,n){let r=new rr(n);return r.name="*injection*",this.fileInjections.get(e).forEach((s,a)=>{for(let o=0;o{r.addBlueprintField(null,_)}),n.addScopeList("current_user",r),((c=tg.instance)==null?void 0:c.pageScopeDisabled(this.documentUri))?this.viewDataVars!=null&&n.addScopeList("view",this.viewDataVars):this.viewDataVars!=null?n.mergeAndList("page",this.pageVars).addScopeList("view",this.viewDataVars):n.mergeAndList("page",this.pageVars);let i=null;e.length>0&&e[0].isComment&&(i=Bo(this.documentUri,e[0]));for(let _=0;_0&&(s=s.concat(i.collectionInjections)),i.blueprints.length>0&&(s=s.concat(i.blueprints)),i.variableHelper!=null&&i.variableHelper.variableName=="@page")){let _=this.statamicProject.getBlueprintField(i.variableHelper.collectionName,i.variableHelper.fieldHandle);if(_!=null)if(i.variableHelper.setHandle.length>0){if(_.sets!=null){for(let N=0;N<_.sets.length;N++)if(_.sets[N].handle==i.variableHelper.setHandle){n.addVariables(eo(e[0],_.sets[N].fields));break}}}else n.addBlueprintField(e[0],_)}if(s.length>0){for(let _=0;_0&&o.includes(N.id())&&(a.pop(),u.pop(),u.length==0&&u.push(n));let C=u[u.length-1];if(N.hasParameters){for(let L=0;L0)for(let M=0;M{ne instanceof z&&(ne.currentScope=C)})}}if(((y=wt.instance)==null?void 0:y.isKnownTag(N.getTagName()))==!1){if(N.scopeVariable=C.findReference(N.runtimeName()),_>0){let L=e[_-1];if(L.isComment&&this.ideHelperMap.has(L.id())&&!L.isClosingTag&&!N.isClosingTag){let M=this.ideHelperMap.get(L.id());if(M.variableName==N.getTagName()){let $=this.statamicProject.getBlueprintField(M.collectionName,M.fieldHandle);$!=null&&(N.scopeVariable=MT(N,$))}}}if(N.scopeVariable==null){let L=N.runtimeName().trim();if(C.hasList(L)||((p=N.currentScope)==null?void 0:p.hasListInHistory(L))){N.sourceType="array";let M=C.getList(L);if(M!=null&&M.values.size>0){let $=M.values.entries().next().value[1];N.scopeVariable={dataType:"array",introducedBy:$.introducedBy,name:L,sourceField:null,sourceName:$.sourceName}}}}else N.sourceType=lu(N.scopeVariable.dataType),N.scopeVariable.sourceField!=null&&((d=Wu.instance)==null?void 0:d.hasFieldtype(N.scopeVariable.sourceField.type))&&((g=Wu.instance)==null?void 0:g.getFieldType(N.scopeVariable.sourceField.type)).augmentScope(N,C)}if(N.hasParameters&&b0(N,C),N.modifiers!=null&&N.modifiers.hasModifiers()?N.manifestType=N.modifiers.getLastManifestedModifierRuntimeType():N.manifestType=N.sourceType,N.isClosedBy!=null&&(a.push(N.id()),o.push(N.isClosedBy.id()),C=C.copy(),u.push(C)),N.getTagName()=="scope"&&N.hasMethodPart()){let L=u[u.length-2].copy();C.addScopeList(N.getMethodNameValue(),L)}if(C.containsPath(N.runtimeName())&&(a.push(N.id()),N.isClosedBy!=null&&o.push(N.isClosedBy.id()),C=C.copy().bringListIntoMainScope(N.runtimeName()),u.push(C)),N.currentScope=C,N.getTagName()!="cache"){let L=N.findParameter("scope");L!=null&&C.canShiftScope(N.runtimeName())&&(C=C.shiftScope(N,N.runtimeName(),L.value),N.currentScope=C,u.pop(),u.push(C))}if((m=wt.instance)==null?void 0:m.isKnownTag(N.runtimeName())){let L=(b=wt.instance)==null?void 0:b.findTag(N.runtimeName());typeof L!="undefined"&&L.augmentScope!=null&&L.augmentScope(N,C)}if(N.modifierChain!=null&&N.modifierChain.modifierChain.length>0&&N.modifierChain.modifierChain.forEach(L=>{L.modifier!=null&&typeof L.modifier.augmentScope!="undefined"&&L.modifier.augmentScope!=null&&L.modifier.augmentScope(N,C)}),N.modifiers.hasParameterModifiers()&&N.modifiers.parameterModifiers.forEach(L=>{L.modifier!=null&&typeof L.modifier.augmentScope!="undefined"&&L.modifier.augmentScope!=null&&L.modifier.augmentScope(N,C)}),N.sourceType=="array"){let L=N.findParameter("chunk"),M=!0;if(N.parent!=null&&N.parent instanceof z&&MR.includes(N.parent.runtimeName())&&(M=!1),typeof L!="undefined"&&L!==null)if(N.currentScope.parentScope!=null&&(N.currentScope.parentScope.hasList(N.runtimeName())||C.referencesArray(N.runtimeName()))){let $=N.currentScope.parentScope.copy(),K=$.liftList(N.runtimeName());if(K==null&&C.referencesArray(N.runtimeName())){if(K=new rr(C.statamicProject),M){let ne=et(N);for(let re=0;re0&&N.runtimeNodes.forEach(L=>{var M;if(L instanceof Ne&&((M=N.currentScope)==null?void 0:M.hasValue(L.name))){let $=N.currentScope.findReferenceWithField(L.name);L.currentScope=N.currentScope,L.scopeName=N.scopeName,L.scopeVariable=$}}),BR.includes(N.runtimeName())&&N.runtimeNodes.length==3&&N.runtimeNodes[0]instanceof Ne&&N.runtimeNodes[1]instanceof kn&&N.runtimeNodes[2]instanceof Et&&N.runtimeNodes[0].scopeVariable!=null&&N.runtimeNodes[0].scopeVariable.sourceField!=null){let L=N.runtimeNodes[0].scopeVariable,M=N.runtimeNodes[2].value,$=L.sourceField;if($.sets!=null)for(let K=0;K<$.sets.length;K++){let ne=$.sets[K];if(ne.handle==M&&ne.fields!=null){C=C.copy(),C.addBlueprintFields(N,ne.fields),N.isClosedBy!=null&&!N.isSelfClosing&&(a.push(N.id()),o.push(N.isClosedBy.id()),u.push(C));break}}}this.lastSymbolId=N.id();let G=a.join("/");l.push(G)}}};var hs=class{};hs.globalTagEnterStack=[],hs.interpolatedVariables=[];var P0=je(uu());var qn=class{constructor(){this.name="";this.compound="";this.methodPart="";this.content="";this.cachedCompoundTagName=null}tagPartIs(e){return e=e.toLowerCase().trim(),this.name.toLowerCase().trim()==e}isCompound(){return this.methodPart==null?!1:this.methodPart.length>0}getMethodName(){return this.methodPart==""?"index":this.methodPart=="null"?"":this.methodPart}getRuntimeMethodName(){}getCompoundTagName(){if(this.cachedCompoundTagName==null){let e=this.getMethodName();this.cachedCompoundTagName=this.name,e!=null&&e!=""&&(this.cachedCompoundTagName=this.cachedCompoundTagName+":"+e)}return this.cachedCompoundTagName}};var jd=class{constructor(){this.tagNames=[];this.modifierNames=[]}getModifierNames(){var e,n;return this.modifierNames.concat((n=(e=xt.instance)==null?void 0:e.getModifierNames())!=null?n:[])}getTagNames(){var e,n;return this.tagNames.concat((n=(e=wt.instance)==null?void 0:e.getTagNames())!=null?n:[])}setTagNames(e){this.tagNames=e}setModifierNames(e){this.modifierNames=e}isTag(e){var n;return jd.alwaysLikeTag.includes(e)||((n=wt.instance)==null?void 0:n.isKnownTag(e))?!0:this.tagNames.includes(e)}isModifier(e){var n;return((n=xt.instance)==null?void 0:n.hasModifier(e))?!0:this.modifierNames.includes(e)}},io=jd;io.alwaysLikeTag=["if","endif","elseif","else","unless","elseunless"];var ao=class{static analyze(e,n){e.forEach(r=>{if(r instanceof z){if(r.pathReference!=null&&r.pathReference.isStrictVariableReference){r.isTagNode=!1;return}r.name!=null&&(r.isTagNode=n.isTag(r.name.name))}})}static analyzeNode(e){if(e.pathReference!=null&&e.pathReference.isStrictVariableReference){e.isTagNode=!1;return}ao.environmentDetails!=null&&e.name!=null&&(e.isTagNode=ao.environmentDetails.isTag(e.name.name)),e.name!=null&&(e.isConditionNode=io.alwaysLikeTag.includes(e.name.name))}static analyzeParametersForModifiers(e){e.parameters.forEach(n=>{ao.environmentDetails!=null&&(n.isModifierParameter=ao.environmentDetails.isModifier(n.name))})}},so=ao;so.environmentDetails=null;(typeof so.environmentDetails=="undefined"||so.environmentDetails==null)&&(so.environmentDetails=new io);var Ud=so;var Wd=class{static getIdentifier(e){var i;let n=new qn;n.content=e.trim();let r=e.split(":");if(r.length==1)n.name=r[0].trim(),n.methodPart=null,n.compound=n.name;else if(r.length>1){let s=(i=r.shift())!=null?i:"",a=r.join(":");n.name=s.trim(),n.methodPart=a.trim(),n.compound=n.name+":"+n.methodPart}else n.name=e.trim(),n.methodPart="";return n.name.startsWith("/")&&(n.name=n.name.substr(1),n.compound=n.compound.substr(1)),n}};var ue=class{static getPrettyTypeName(e){return e instanceof Gr?ue.TOKEN_LANG_OPERATOR:e instanceof Kn?ue.TOKEN_OP_A_ADD:e instanceof Ne?ue.TOKEN_VARIABLE:e instanceof Et?ue.TOKEN_STRING:e instanceof Bt?ue.TOKEN_NUMBER:e instanceof wr?ue.TOKEN_CONSTANT_FALSE:e instanceof hr?ue.TOKEN_CONSTANT_NULL:e instanceof Or?ue.TOKEN_CONSTANT_TRUE:e instanceof ba?ue.TOKEN_MODIFIER_NODE:e instanceof Uo?ue.TOKEN_MODIFIER_CHAIN:e instanceof Xf?ue.TOKEN_MODIFIER_PARAMETER:e instanceof zn?ue.TOKEN_OP_A_DIVIDE:e instanceof fi?ue.TOKEN_OP_A_EXPONENTIATION:e instanceof pi?ue.TOKEN_OP_A_MODULUS:e instanceof Xn?ue.TOKEN_OP_A_MULTIPLY:e instanceof Cn?ue.TOKEN_OP_A_SUBTRACT:e instanceof Lr?ue.TOKEN_ASG_ADD:e instanceof Fr?ue.TOKEN_ASG_DIVIDE:e instanceof kr?ue.TOKEN_ASG_MODULUS:e instanceof Mr?ue.TOKEN_ASG_MULTIPLY:e instanceof Qn?ue.TOKEN_ASG_ASSIGN:e instanceof di?ue.TOKEN_ASG_SUBTRACT:e instanceof kn?ue.TOKEN_CMP_EQUAL:e instanceof Wr?ue.TOKEN_CMP_SEQUAL:e instanceof mr?ue.TOKEN_CMP_GT:e instanceof Ii?ue.TOKEN_CMP_GTE:e instanceof Br?ue.TOKEN_CMP_LT:e instanceof qr?ue.TOKEN_CMP_LTE:e instanceof Vr?ue.TOKEN_CMP_NEQ:e instanceof jr?ue.TOKEN_CMP_SNEQ:e instanceof Ur?ue.TOKEN_CMP_SPACESHIP:e instanceof Di?ue.TOKEN_OP_VARIABLE_FALLBACK:e instanceof Qf?ue.TOKEN_COND_FALLBACK_GROUP:e instanceof St?ue.TOKEN_BRANCH_SEPARATOR:e instanceof Yr?ue.TOKEN_TERNARY_SEPARATOR:e instanceof en?ue.TOKEN_GROUP_BEGIN:e instanceof Ht?ue.TOKEN_GROUP_END:e instanceof Pn?ue.TOKEN_MODIFIER_SEPARATOR:e instanceof mn?ue.TOKEN_MODIFIER_NAME:e instanceof $t?ue.TOKEN_MODIFIER_VALUE:e instanceof An?ue.TOKEN_MODIFIER_VALUE_SEPARATOR:e instanceof Go?ue.TOKEN_NULL_COALESCE_GROUP:e instanceof Mt?ue.TOKEN_SEMANTIC_GROUP:e instanceof un?ue.TOKEN_STATEMENT_SEPARATOR:e instanceof Yo?ue.TOKEN_TERNARY_CONDITION:e instanceof gr?ue.TOKEN_OP_AND:e instanceof cn?ue.TOKEN_OP_LOGIC_NEGATION:e instanceof Hr?ue.TOKEN_OP_OR:e instanceof hi?ue.TOKEN_OP_XOR:e instanceof _r?ue.TOKEN_OP_NULL_COALESCE:e instanceof jo?ue.TOKEN_PARAM:e instanceof Yn?ue.TOKEN_PATH_ACCESSOR:e instanceof Xi?ue.TOKEN_OP_A_FACTORIAL:e instanceof dr?ue.TOKEN_RECURSIVE:e instanceof Na?ue.TOKEN_ARG_GROUP:e instanceof Rt?ue.TOKEN_ARG_SEPARATOR:e instanceof mi?ue.TOKEN_OP_STRING_CONCAT:e instanceof Sn?ue.TOKEN_OP_SCOPE_REASSIGNMENT:e instanceof va?ue.TOKEN_STRUCT_SWITCH_CASE:e instanceof Rs?ue.TOKEN_STRUCT_SWITCH_GROUP:e instanceof xs?ue.TOKEN_STRUCT_DIRECTION_GROUP:e instanceof yr?ue.TOKEN_STRUCT_SCOPED_LOGIC_GROUP:e instanceof We?ue.TOKEN_STRUCT_LOGIC_GROUP:e instanceof Wo?ue.TOKEN_STRUCT_VALUE_DIRECTION:e instanceof xi?ue.TOKEN_STRUCT_ARRAY:e instanceof $r?ue.TOKEN_STRUCT_T_LIST_START:e instanceof Jf?ue.TOKEN_STRUCT_TUPLE_LIST:e instanceof tn?ue.TOKEN_STRUCT_METHOD_CALL:typeof e}},ee=ue;ee.TOKEN_LANG_OPERATOR="T_LANG_OPERATOR",ee.TOKEN_VARIABLE="T_VAR",ee.TOKEN_NUMBER="T_NUMERIC",ee.TOKEN_STRING="T_STRING",ee.TOKEN_RECURSIVE="T_RECURSIVE",ee.TOKEN_CONSTANT_FALSE="T_FALSE",ee.TOKEN_CONSTANT_NULL="T_NULL",ee.TOKEN_CONSTANT_TRUE="T_TRUE",ee.TOKEN_MODIFIER_NODE="T_MODIFIER",ee.TOKEN_MODIFIER_CHAIN="T_MODIFIER_CHAIN",ee.TOKEN_MODIFIER_PARAMETER="T_MODIFIER_PARAM",ee.TOKEN_OP_A_ADD="T_AOP_ADD",ee.TOKEN_OP_A_DIVIDE="T_AOP_DIVIDE",ee.TOKEN_OP_A_EXPONENTIATION="T_AOP_EXP",ee.TOKEN_OP_A_MODULUS="T_AOP_MOD",ee.TOKEN_OP_A_MULTIPLY="T_AOP_MULTIPLY",ee.TOKEN_OP_A_SUBTRACT="T_AOP_SUBTRACT",ee.TOKEN_OP_A_FACTORIAL="T_AOP_FACTORIAL",ee.TOKEN_ASG_ADD="T_ASG_ADD",ee.TOKEN_ASG_DIVIDE="T_ASG_DIVIDE",ee.TOKEN_ASG_ASSIGN="T_ASG",ee.TOKEN_ASG_MODULUS="T_ASG_MODULUS",ee.TOKEN_ASG_MULTIPLY="T_ASG_MULTIPLY",ee.TOKEN_ASG_SUBTRACT="T_ASG_SUBTRACT",ee.TOKEN_CMP_EQUAL="T_CMP_EQ",ee.TOKEN_CMP_SEQUAL="T_CMP_SEQ",ee.TOKEN_CMP_GT="T_CMP_GT",ee.TOKEN_CMP_GTE="T_CMP_GTE",ee.TOKEN_CMP_LT="T_CMP_LT",ee.TOKEN_CMP_LTE="T_CMP_LTE",ee.TOKEN_CMP_NEQ="T_CMP_NEQ",ee.TOKEN_CMP_SNEQ="T_CMP_SNEQ",ee.TOKEN_CMP_SPACESHIP="T_CMP_SPSHP",ee.TOKEN_OP_VARIABLE_FALLBACK="T_VFBK",ee.TOKEN_COND_FALLBACK_GROUP="T_VFBK_GROUP",ee.TOKEN_BRANCH_SEPARATOR="T_BRANCH_SEPARATOR",ee.TOKEN_TERNARY_SEPARATOR="T_TERNARY_SEPARATOR",ee.TOKEN_GROUP_BEGIN="T_LOGIC_BEGIN",ee.TOKEN_GROUP_END="T_LOGIC_END",ee.TOKEN_MODIFIER_SEPARATOR="T_MODIFIER_SEPARATOR",ee.TOKEN_MODIFIER_NAME="T_MODIFIER_NAME",ee.TOKEN_MODIFIER_VALUE="T_MODIFIER_VALUE",ee.TOKEN_MODIFIER_VALUE_SEPARATOR="T_MODIFIER_VALUE_SEPARATOR",ee.TOKEN_NULL_COALESCE_GROUP="T_NULL_COALESCE_GROUP",ee.TOKEN_SEMANTIC_GROUP="T_SEMANTIC_GROUP",ee.TOKEN_STATEMENT_SEPARATOR="T_STATEMENT_SEPARATOR",ee.TOKEN_TERNARY_CONDITION="T_TERNARY_CONDITION",ee.TOKEN_OP_AND="T_AND",ee.TOKEN_OP_LOGIC_NEGATION="T_LOGIC_INVERSE",ee.TOKEN_OP_OR="T_OR",ee.TOKEN_OP_XOR="T_XOR",ee.TOKEN_OP_NULL_COALESCE="T_NULL_COALESCE",ee.TOKEN_PARAM="T_PARAM",ee.TOKEN_PATH_ACCESSOR="T_VAR_SEPARATOR",ee.TOKEN_ARG_GROUP="T_ARG_GROUP",ee.TOKEN_ARG_SEPARATOR="T_ARG_SEPARATOR",ee.TOKEN_OP_STRING_CONCAT="T_STR_CONCAT",ee.TOKEN_OP_SCOPE_REASSIGNMENT="T_SCOPE_ASSIGNMENT",ee.TOKEN_STRUCT_SWITCH_CASE="T_SWITCH_CASE",ee.TOKEN_STRUCT_SWITCH_GROUP="T_SWITCH_GROUP",ee.TOKEN_STRUCT_DIRECTION_GROUP="T_DIRECTION_GROUP",ee.TOKEN_STRUCT_VALUE_DIRECTION="T_ORDER_DIRECTION",ee.TOKEN_STRUCT_SCOPED_LOGIC_GROUP="T_SCOPED_LOGIC_GROUP",ee.TOKEN_STRUCT_LOGIC_GROUP="T_LOGIC_GROUP",ee.TOKEN_STRUCT_ARRAY="T_ARRAY",ee.TOKEN_STRUCT_T_LIST_START="T_LIST_START",ee.TOKEN_STRUCT_TUPLE_LIST="T_LIST",ee.TOKEN_STRUCT_METHOD_CALL="T_METHOD_CALL";var tt=class{static isLanguageLogicalKeyword(e){return e==this.LogicalAnd||e==this.LogicalNot||e==this.LogicalOr||e==this.LogicalXor}};tt.LogicalAnd="and",tt.LogicalNot="not",tt.LogicalOr="or",tt.LogicalXor="xor",tt.ConstTrue="true",tt.ConstFalse="false",tt.ConstNull="null",tt.ArrList="list",tt.ScopeAs="as";var Gd=class{constructor(){this.chars=[];this.inputLen=0;this.currentIndex=0;this.currentContent=[];this.rawContent=[];this.startIndex=0;this.cur=null;this.next=null;this.prev=null;this.isParsingString=!1;this.isParsingModifierName=!1;this.isInModifierParameterValue=!1;this.runtimeNodes=[];this.ignorePrevious=!1;this.lastNode=null;this.referenceParser=null;this.activeNode=null}reset(){this.ignorePrevious=!1,this.runtimeNodes=[],this.chars=[],this.inputLen=0,this.currentIndex=0,this.currentContent=[],this.rawContent=[],this.startIndex=0,this.cur=null,this.next=null,this.prev=null,this.isParsingString=!1,this.isParsingModifierName=!1,this.isInModifierParameterValue=!1,this.referenceParser=null,this.activeNode=null}checkCurrentOffsets(){this.cur=this.chars[this.currentIndex],this.prev=null,this.next=null,this.ignorePrevious?(this.prev="",this.ignorePrevious=!1):this.currentIndex>0&&(this.prev=this.chars[this.currentIndex-1]),this.currentIndex+10)||Z.ctypeAlpha(this.cur)||Z.ctypeDigit(this.cur))?!0:Z.ctypeSpace(e)?!1:this.isParsingModifierName&&(e==w.Punctuation_Minus||e==w.Punctuation_Underscore)?!0:!Z.ctypePunct(e)}isRightOfInterpolationRegion(){if(this.activeNode==null||this.referenceParser==null)return!1;let e=this.activeNode._lexerRelativeOffset(this.currentIndex);return this.referenceParser.bordersInterpolationRegion(e)}scanForwardTo(e,n=0){let r=[];for(let i=this.currentIndex+1+n;i0&&tt.isLanguageLogicalKeyword(l)&&(o=!0)}if(this.next==w.String_Terminator_SingleQuote||this.next==w.String_Terminator_DoubleQuote||this.next==null||o){this.appendContent(this.cur);let l=this.currentContent.join("");if(l.length>0){let u=l;if(this.currentContent=[],this.rawContent=[],u.trimRight().length==0){let f=this.nextNonWhitespace();if(f==w.String_Terminator_SingleQuote||f==w.String_Terminator_DoubleQuote){this.currentContent=[],this.rawContent=[];continue}}let c=new $t;c.isVirtual=!1,c.name=u,c.value=u.trimRight(),c.startPosition=e._lexerRelativeOffset(this.currentIndex-u.length),c.endPosition=e._lexerRelativeOffset(this.currentIndex),c.parent=this.activeNode,this.guardAgainstNeighboringTypesInModifier(c),this.runtimeNodes.push(c),this.lastNode=c}if(l.length==0)continue;this.currentContent=[],this.rawContent=[],this.isInModifierParameterValue=!1;continue}if(this.next==w.Punctuation_Pipe||this.next==w.Punctuation_Colon||this.next==w.RightParent){this.isInModifierParameterValue=!1,this.appendContent(this.cur);let l=0,u=!1;if(this.currentContent[0]==w.String_Terminator_SingleQuote||this.currentContent[0]==w.String_Terminator_DoubleQuote){let h=this.scanForwardTo(this.currentContent[0]);h.length>0&&(this.currentContent=this.currentContent.concat(h),l=h.length,u=!0)}let c=this.currentContent.join("");u&&(c=c.substr(1),c=c.slice(0,-1)),this.currentContent=[],this.rawContent=[];let f=new $t;f.isVirtual=!1,f.name=c,f.value=c,f.startPosition=e._lexerRelativeOffset(this.currentIndex-c.length),f.endPosition=e._lexerRelativeOffset(this.currentIndex),f.parent=this.activeNode,this.runtimeNodes.push(f),this.guardAgainstNeighboringTypesInModifier(f),this.lastNode=f,this.currentIndex+=l}else this.appendContent(this.cur);continue}if(this.isParsingString&&this.cur==i){if(this.prev==w.String_EscapeCharacter)this.appendContent(i);else{if(this.isInModifierParameterValue){let l=this.currentContent.join(""),u=new $t;u.isVirtual=!1,u.name=l,u.value=l,u.startPosition=e._lexerRelativeOffset(r!=null?r:0),u.endPosition=e._lexerRelativeOffset(this.currentIndex),u.parent=this.activeNode,this.runtimeNodes.push(u),this.guardAgainstNeighboringTypesInModifier(u),this.lastNode=u,this.currentContent=[],this.rawContent=[],this.isParsingString=!1,this.isInModifierParameterValue=!1;continue}let o=new Et;o.isVirtual=!1,o.startPosition=e._lexerRelativeOffset(r!=null?r:0),o.endPosition=e._lexerRelativeOffset(this.currentIndex),this.referenceParser!=null&&(o.sourceContent=this.referenceParser.getText(o.startPosition.index,o.endPosition.index+1)),o.parent=this.activeNode,i!=null&&(o.sourceTerminator=i),i=null,this.isParsingString=!1,o.value=this.currentContent.join(""),o.rawLexContent=this.rawContent.join("").trim(),this.currentContent=[],this.rawContent=[],this.guardAgainstNeighboringTypesInModifier(o),this.runtimeNodes.push(o),this.lastNode=o}continue}if(this.isParsingString&&this.cur==w.String_EscapeCharacter){if(this.next==w.String_EscapeCharacter){this.appendContent(w.String_EscapeCharacter),this.ignorePrevious=!0,this.currentIndex+=1;continue}else if(this.next==w.String_Terminator_SingleQuote){this.appendContent(w.String_Terminator_SingleQuote),this.currentIndex+=1;continue}else if(this.next==w.String_Terminator_DoubleQuote){this.appendContent(w.String_Terminator_DoubleQuote),this.currentIndex+=1;continue}else if(this.next=="n"){this.appendContent(` -`),this.currentIndex+=1;continue}else if(this.next=="t"){this.appendContent(" "),this.currentIndex+=1;continue}else if(this.next=="r"){this.appendContent("\r"),this.currentIndex+=1;continue}}if(this.isParsingString==!1){if(this.isValidChar(this.cur)&&this.isValidChar(this.next)==!1&&this.currentContent.length==0&&(this.appendContent(this.cur),a=!1),(this.next==null||this.isValidChar(this.next)==!1)&&this.currentContent.length>0){a&&this.appendContent(this.cur);let o=this.currentContent.join("").trim(),l=o.length,u=this.currentIndex-l,c=e._lexerRelativeOffset(u),f=e._lexerRelativeOffset(this.currentIndex);if(this.currentContent=[],this.rawContent=[],o==tt.LogicalAnd){let y=new gr;y.isVirtual=!1,y.content=tt.LogicalAnd,y.startPosition=c,y.endPosition=f,y.parent=this.activeNode,this.runtimeNodes.push(y),this.lastNode=y;continue}else if(o==tt.LogicalOr){let y=new Hr;y.isVirtual=!1,y.content=tt.LogicalOr,y.startPosition=c,y.endPosition=f,y.parent=this.activeNode,this.runtimeNodes.push(y),this.lastNode=y;continue}else if(o==tt.LogicalXor){let y=new hi;y.isVirtual=!1,y.content=tt.LogicalXor,y.startPosition=c,y.endPosition=f,y.parent=this.activeNode,this.runtimeNodes.push(y),this.lastNode=y;continue}else if(o==tt.ConstNull){let y=new hr;y.isVirtual=!1,y.content=tt.ConstNull,y.startPosition=c,y.endPosition=f,y.parent=this.activeNode,this.runtimeNodes.push(y),this.lastNode=y;continue}else if(o==tt.ConstTrue){let y=new Or;y.isVirtual=!1,y.content=tt.ConstTrue,y.startPosition=c,y.endPosition=f,y.parent=this.activeNode,this.runtimeNodes.push(y),this.lastNode=y;continue}else if(o==tt.ConstFalse){let y=new wr;y.isVirtual=!1,y.content=tt.ConstFalse,y.startPosition=c,y.endPosition=f,y.parent=this.activeNode,this.runtimeNodes.push(y),this.lastNode=y;continue}else if(o==tt.LogicalNot){let y=new cn;y.isVirtual=!1,y.content=tt.LogicalNot,y.startPosition=c,y.endPosition=f,y.parent=this.activeNode,this.runtimeNodes.push(y),this.lastNode=y;continue}else if(o==tt.ArrList&&this.next==w.LeftParen){let y=new $r;y.isVirtual=!1,y.content=tt.ArrList,y.startPosition=c,y.endPosition=f,y.parent=this.activeNode,this.runtimeNodes.push(y),this.lastNode=y;continue}if(Z.isNumeric(o)){let y=new Bt;y.isVirtual=!1,y.startPosition=c,y.endPosition=f,y.parent=this.activeNode,o.includes(".")?y.value=parseFloat(o):y.value=parseInt(o),y.rawLexContent=o,this.guardAgainstNeighboringTypesInModifier(y),this.runtimeNodes.push(y),this.lastNode=y;continue}if(this.runtimeNodes.length>0){let y=this.runtimeNodes[this.runtimeNodes.length-1];if(y instanceof Pn){let p=new mn;p.isVirtual=!1,p.name=o,p.content=o,p.startPosition=c,p.endPosition=f,p.parent=this.activeNode,this.runtimeNodes.push(p),this.lastNode=p;continue}else if(y instanceof An){let p=new $t;p.isVirtual=!1,p.name=o,p.value=o,p.startPosition=c,p.endPosition=f,p.parent=this.activeNode,this.runtimeNodes.push(p),this.lastNode=p,this.isParsingModifierName=!1;continue}}let h=new Ne;h.isVirtual=!1,h.name=o,h.startPosition=c,h.endPosition=f,h.parent=this.activeNode,this.runtimeNodes.push(h),this.lastNode=h;continue}}else{this.appendContent(this.cur);continue}if(!Z.ctypeSpace(this.cur)){if(this.isParsingString==!1){if(this.cur==w.Punctuation_Equals&&this.next==w.Punctuation_GreaterThan){let o=new Sn;o.isVirtual=!1,o.content="=>",o.startPosition=e._lexerRelativeOffset(this.currentIndex),o.endPosition=e._lexerRelativeOffset(this.currentIndex+1),o.parent=this.activeNode,this.runtimeNodes.push(o),this.lastNode=o,this.currentContent=[],this.rawContent=[],this.currentIndex+=1;continue}if(this.cur==w.Punctuation_Comma){let o=new Rt;o.isVirtual=!1,o.content=w.Punctuation_Comma,o.startPosition=e._lexerRelativeOffset(this.currentIndex),o.endPosition=e._lexerRelativeOffset(this.currentIndex+1),o.parent=this.activeNode,this.runtimeNodes.push(o),this.lastNode=o;continue}if(this.cur==w.Punctuation_Semicolon){let o=new un;o.isVirtual=!1,o.content=w.Punctuation_Semicolon,o.startPosition=e._lexerRelativeOffset(this.currentIndex),o.endPosition=e._lexerRelativeOffset(this.currentIndex+1),o.parent=this.activeNode,this.runtimeNodes.push(o),this.lastNode=o;continue}if(this.cur==w.Punctuation_Plus){if(this.next==w.Punctuation_Equals){let l=new Lr;l.isVirtual=!1,l.content="+=",l.startPosition=e._lexerRelativeOffset(this.currentIndex),l.endPosition=e._lexerRelativeOffset(this.currentIndex+2),l.parent=this.activeNode,this.runtimeNodes.push(l),this.lastNode=l,this.currentIndex+=1;continue}let o=new Kn;o.isVirtual=!1,o.content="+",o.startPosition=e._lexerRelativeOffset(this.currentIndex),o.endPosition=e._lexerRelativeOffset(this.currentIndex+1),o.parent=this.activeNode,this.runtimeNodes.push(o),this.lastNode=o;continue}if(this.isParsingModifierName==!1&&this.cur==w.Punctuation_Minus){if(Z.ctypeDigit(this.next)&&Z.ctypeDigit(this.prev)==!1&&this.prev!=w.RightParent&&this.isRightOfInterpolationRegion()==!1){this.appendContent(this.cur);continue}if(this.next==w.Punctuation_Equals){let l=new di;l.isVirtual=!1,l.content="-=",l.startPosition=e._lexerRelativeOffset(this.currentIndex),l.endPosition=e._lexerRelativeOffset(this.currentIndex+2),l.parent=this.activeNode,this.runtimeNodes.push(l),this.lastNode=l,this.currentIndex+=1;continue}else if(this.next==w.Punctuation_GreaterThan){let l=new tn;l.isVirtual=!1,l.content="->",l.startPosition=e._lexerRelativeOffset(this.currentIndex),l.endPosition=e._lexerRelativeOffset(this.currentIndex+2),l.parent=this.activeNode,this.runtimeNodes.push(l),this.lastNode=l,this.currentIndex+=1;continue}let o=new Cn;o.isVirtual=!1,o.content="-",o.startPosition=e._lexerRelativeOffset(this.currentIndex),o.endPosition=e._lexerRelativeOffset(this.currentIndex+1),o.parent=this.activeNode,this.runtimeNodes.push(o),this.lastNode=o;continue}if(this.cur==w.Punctuation_Asterisk){if(this.next==w.Punctuation_Asterisk){let l=new fi;l.isVirtual=!1,l.content="**",l.startPosition=e._lexerRelativeOffset(this.currentIndex),l.endPosition=e._lexerRelativeOffset(this.currentIndex+2),l.parent=this.activeNode,this.runtimeNodes.push(l),this.lastNode=l,this.currentIndex+=1;continue}else if(this.next==w.Punctuation_Equals){let l=new Mr;l.isVirtual=!1,l.content="*=",l.startPosition=e._lexerRelativeOffset(this.currentIndex),l.endPosition=e._lexerRelativeOffset(this.currentIndex+2),l.parent=this.activeNode,this.runtimeNodes.push(l),this.lastNode=l,this.currentIndex+=1;continue}let o=new Xn;o.isVirtual=!1,o.content="*",o.startPosition=e._lexerRelativeOffset(this.currentIndex),o.endPosition=e._lexerRelativeOffset(this.currentIndex+1),o.parent=this.activeNode,this.runtimeNodes.push(o),this.lastNode=o;continue}if(this.cur==w.Punctuation_ForwardSlash){if(this.next==w.Punctuation_Equals){let l=new Fr;l.isVirtual=!1,l.content="/=",l.startPosition=e._lexerRelativeOffset(this.currentIndex),l.endPosition=e._lexerRelativeOffset(this.currentIndex+2),l.parent=this.activeNode,this.runtimeNodes.push(l),this.lastNode=l,this.currentIndex+=1;continue}let o=new zn;o.isVirtual=!1,o.content="/",o.startPosition=e._lexerRelativeOffset(this.currentIndex),o.endPosition=e._lexerRelativeOffset(this.currentIndex+1),o.parent=this.activeNode,this.runtimeNodes.push(o),this.lastNode=o;continue}if(this.cur==w.Punctuation_Percent){if(this.next==w.Punctuation_Equals){let l=new kr;l.isVirtual=!1,l.content="%=",l.startPosition=e._lexerRelativeOffset(this.currentIndex),l.endPosition=e._lexerRelativeOffset(this.currentIndex+2),l.parent=this.activeNode,this.runtimeNodes.push(l),this.lastNode=l,this.currentIndex+=1;continue}let o=new pi;o.isVirtual=!1,o.content="%",o.startPosition=e._lexerRelativeOffset(this.currentIndex),o.endPosition=e._lexerRelativeOffset(this.currentIndex+1),o.parent=this.activeNode,this.runtimeNodes.push(o),this.lastNode=o;continue}if(this.cur==w.Punctuation_LessThan){if(this.next==w.Punctuation_Equals){let l=null;if(this.currentIndex+2",c.startPosition=e._lexerRelativeOffset(this.currentIndex),c.endPosition=e._lexerRelativeOffset(this.currentIndex+3),c.parent=this.activeNode,this.runtimeNodes.push(c),this.lastNode=c,this.currentIndex+=2;continue}let u=new qr;u.isVirtual=!1,u.content="<=",u.startPosition=e._lexerRelativeOffset(this.currentIndex),u.endPosition=e._lexerRelativeOffset(this.currentIndex+2),u.parent=this.activeNode,this.runtimeNodes.push(u),this.lastNode=u,this.currentIndex+=1;continue}let o=new Br;o.isVirtual=!1,o.content="<",o.startPosition=e._lexerRelativeOffset(this.currentIndex),o.endPosition=e._lexerRelativeOffset(this.currentIndex+1),o.parent=this.activeNode,this.runtimeNodes.push(o),this.lastNode=o;continue}if(this.cur==w.Punctuation_GreaterThan){if(this.next==w.Punctuation_Equals){let l=new mr;l.isVirtual=!1,l.content=">=",l.startPosition=e._lexerRelativeOffset(this.currentIndex),l.endPosition=e._lexerRelativeOffset(this.currentIndex+2),l.parent=this.activeNode,this.runtimeNodes.push(l),this.lastNode=l,this.currentIndex+=1;continue}let o=new mr;o.isVirtual=!1,o.content=">",o.startPosition=e._lexerRelativeOffset(this.currentIndex),o.endPosition=e._lexerRelativeOffset(this.currentIndex+1),o.parent=this.activeNode,this.runtimeNodes.push(o),this.lastNode=o;continue}if(this.cur==w.Punctuation_Equals&&this.next!=w.Punctuation_Equals){let o=new Qn;o.isVirtual=!1,o.content="=",o.startPosition=e._lexerRelativeOffset(this.currentIndex),o.endPosition=e._lexerRelativeOffset(this.currentIndex+1),o.parent=this.activeNode,this.runtimeNodes.push(o),this.lastNode=o;continue}if(this.cur==w.Punctuation_Equals&&this.next==w.Punctuation_Equals){let o=null;if(this.currentIndex+20&&this.runtimeNodes[this.runtimeNodes.length-1]instanceof mn){let u=new An;u.isVirtual=!1,u.content=":",u.startPosition=e._lexerRelativeOffset(this.currentIndex),u.endPosition=e._lexerRelativeOffset(this.currentIndex+1),u.parent=this.activeNode,this.runtimeNodes.push(u),this.isInModifierParameterValue==!1?this.isInModifierParameterValue=!0:this.isInModifierParameterValue=!1;continue}let o=new St;o.isVirtual=!1,o.content=":",o.startPosition=e._lexerRelativeOffset(this.currentIndex),o.endPosition=e._lexerRelativeOffset(this.currentIndex+1),o.parent=this.activeNode,this.runtimeNodes.push(o),this.lastNode=o,this.isParsingModifierName=!1;continue}}a&&this.appendContent(this.cur)}}let s=this.runtimeNodes.length-1;for(let a=0;a0&&(o=this.runtimeNodes[a-1]),a!=s&&(l=this.runtimeNodes[a+1]);let u=this.runtimeNodes[a];u.prev=o,u.next=l}return this.runtimeNodes}};var Ut=class{constructor(){this.chars=[];this.currentIndex=0;this.lastIndex=0;this.inputLength=0;this.prev=null;this.cur=null;this.next=null;this.isParsingString=!1;this.isStringKeyPath=!1;this.antlersErrors=[];this._recusriveEntryCheck=new Map}isValidChar(e){return!(this.isParsingString==!1&&Z.ctypeSpace(e)||this.isParsingString==!1&&e==Ut.LeftBracket||this.isParsingString==!1&&e==Ut.RightBracket)}normalizePath(e){return e=e.replace(":","_"),e=e.replace(".","_"),e=e.replace("[","_"),e=e.replace("]","_"),e.replace("]","_")}getAntlersErrors(){return this.antlersErrors}mergeErrors(e){e.forEach(n=>{this.antlersErrors.push(n)})}parse(e){this.antlersErrors=[],this._recusriveEntryCheck.clear();let n=e,r=!1,i=!1,s=!1,a=!1;e.startsWith(w.AtChar)&&(s=!0,e=e.substr(1)),e.startsWith(w.Punctuation_Caret)?(a=!0,e=e.substr(1)):(e.startsWith(w.Punctuation_Dollar)&&(r=!0,e=e.substr(1)),e.startsWith(w.Punctuation_Dollar)&&(i=!0,e=e.substr(1))),this.chars=[],this.currentIndex=0,this.lastIndex=0,this.inputLength=0,this.cur=null,this.prev=null,this.next=null,this.chars=e.split(""),this.inputLength=this.chars.length,this.lastIndex=this.inputLength-1;let o=[],l=!1,u=[],c=Ut.ColonSeparator,f=!1,h=null,y=!1,p=!0;if(this.isParsingString=!1,this.inputLength==0){let m=new Ji;return m._isFromEmptyFailState=!0,m}for(this.currentIndex;this.currentIndex0&&(this.prev=this.chars[this.currentIndex-1]),this.currentIndex+10){let _=new Yn;_.name=o.join(""),_.delimiter=c,u.push(_),o=[]}if(this.next==null||Z.ctypeSpace(this.next)){this.antlersErrors.push(W.makeSyntaxError(A.TYPE_ILLEGAL_VARPATH_SPACE_RIGHT,null,"Unexpected end of input or whitespace while parsing variable accessor path."));continue}let m=this.locateEndOfAccessor();this.currentIndex=m.foundOn;let b=new Ut;if(u.push(b.parse(m.nestedContent)),this.mergeErrors(b.getAntlersErrors()),l=!0,this.currentIndex==-1){this.antlersErrors.push(W.makeSyntaxError(A.PARSER_CANNOT_PARSE_PATH_RECURSIVE,null,"Cannot parse variable path.")),l=!1;break}continue}if(this.isParsingString==!1&&this.next==Ut.RightBracket&&l){p?o.push(this.cur):p=!0;let m=new Zf;m.name=o.join(""),u.push(m),o=[],c=Ut.ColonSeparator,this.currentIndex+=1,l=!1;continue}if(this.isParsingString==!1&&(this.cur==Ut.LeftBracket||this.cur==Ut.ColonSeparator||this.cur==Ut.DotPathSeparator||this.currentIndex==this.lastIndex)){if(this.next==null||Z.ctypeSpace(this.next)){if(this.cur==Ut.ColonSeparator){if(o.length==0){this.antlersErrors.push(W.makeSyntaxError(A.TYPE_UNEXPECTED_BRANCH_SEPARATOR,null,"Unexpected [T_BRANCH_SEPARATOR] while parsing input text."));continue}this.antlersErrors.push(W.makeSyntaxError(A.TYPE_ILLEGAL_VARPATH_RIGHT,null,'Variable paths cannot end with the ":" character.'));continue}if(this.cur==Ut.LeftBracket){this.antlersErrors.push(W.makeSyntaxError(A.TYPE_ILLEGAL_VARPATH_SUBPATH_START,null,"Illegal variable sub-path start."));continue}}this.currentIndex==this.lastIndex&&this.isValidChar(this.cur)&&(p?o.push(this.cur):p=!0);let m=new Yn;m.delimiter=c,m.name=o.join(""),y&&(m.isStringVar=y,m.name=n.substr(1),m.name=m.name.slice(0,-1),y=!1),u.push(m),o=[];continue}else{o.push(this.cur);continue}}let d=u.length;if(d>0){let m=u[d-1];(m instanceof Yn||m instanceof Ji)&&(m.isFinal=!0)}let g=new Ji;return g.isStrictTagReference=a,g.isStrictVariableReference=r,g.isExplicitVariableReference=i,g.pathParts=u,g.originalContent=e,g.isVariableVariable=s,g.normalizedReference=e.replace(":","."),g}locateEndOfAccessor(){let e=[],n=1,r=-1,i="",s=!1,a=null;if(this._recusriveEntryCheck.has(this.currentIndex+1)==!1)this._recusriveEntryCheck.set(this.currentIndex+1,!0);else return{foundOn:r,nestedContent:""};for(let o=this.currentIndex+1;o0&&(c=this.chars[o-1]),o+10&&(this.prev=this.chars[this.currentIndex-1]),r==!1){if(s==!1&&(this.cur==w.String_Terminator_DoubleQuote||this.cur==w.String_Terminator_SingleQuote)){a=this.cur,s=!0,n.push(this.cur);continue}if(s&&Z.ctypeSpace(this.cur)){n.push(this.cur);continue}if(s&&this.cur==a&&this.prev!=w.String_EscapeCharacter){a=null,s=!1,n.push(this.cur);continue}if(Z.ctypeSpace(this.cur)||this.currentIndex==this.inputLen-1||this.cur==w.Punctuation_Pipe){if(n.length==0)continue;Z.ctypeSpace(this.cur)||this.cur!=w.Punctuation_Pipe&&n.push(this.cur),i=n.join(""),r=!0;break}n.push(this.cur)}let o=e.getContentRelativeStartIndex();if(e.nameStartsOn=e.relativeOffset(o,o),e.nameStartsOn!=null&&(e.nameEndsOn=e.nameStartsOn.shiftRight(i.length-1),i.includes(w.Punctuation_Colon))){let p=i.indexOf(w.Punctuation_Colon);e.nameMethodPartStartsOn=e.nameStartsOn.shiftRight(p+1)}e.name=Wd.getIdentifier(i),Ud.analyzeNode(e),e.parameters=this.getParameters(e),e.hasParameters=e.parameters.length>0,e.hasParameters&&(Ud.analyzeParametersForModifiers(e),e.resetContentCache()),e.pathReference=this.pathParser.parse(i),e.mergeErrors(this.pathParser.getAntlersErrors()),e.pathReference!=null&&e.pathReference.isStrictTagReference&&(e.name.name=e.name.name.substr(1),e.name.content=e.name.content.substr(1)),e.isClosingTag=this.canBeClosingTag(e);let l=[];e.isClosingTag==!1&&(l=this.lexer.tokenize(e,e.getContent())),e.runtimeNodes=l;let u=e.content.trim();if(Hn.isConditionalStructure(e)&&e.name.name!="else"&&l.length==0&&u!="/if"&&u!="/unless"&&u!="/endunless"&&u!="endif"&&u!="endunless"&&u!="/endif"&&e.getContent().trim().length==0&&this.pushConditionWithoutExpression(e),e.name.name=="endif"){let p=e.copyBasicDetails(),d=e.getParser();return d!=null&&p.withParser(d),p.name=new qn,p.name.name="if",p.name.compound="if",p.isClosingTag=!0,p.content=" /if ",p.originalNode=e,p}if(e.name.name=="unless"){let p=e.copyBasicDetails(),d=e.getParser();if(d!=null&&p.withParser(d),p.name=new qn,p.name.name="if",p.name.compound="if",e.isClosingTag==!1){let g=(c=e.getContent())!=null?c:"",m=" if !("+g+") ";p.content=m,p.originalNode=e,p.resetContentCache(),p.runtimeNodes=this.lexer.tokenize(p,(f=p.getContent())!=null?f:""),this.testUnlessContent(p)}else p.originalNode=e,p.content=" /if ";return p}else if(e.name.name=="elseunless"){let p=e.copyBasicDetails(),d=e.getParser();d!=null&&p.withParser(d),p.name=new qn,p.name.name="elseif",p.name.compound="elseif";let g=(h=e.getContent())!=null?h:"",m=" elseif !("+g+") ";return p.content=m,p.originalNode=e,p.resetContentCache(),p.runtimeNodes=this.lexer.tokenize(p,(y=p.getContent())!=null?y:""),this.testUnlessContent(p),p}else if(e.name.name=="endunless"){let p=e.copyBasicDetails(),d=e.getParser();return d!=null&&p.withParser(d),p.name=new qn,p.name.name="if",p.name.compound="if",p.isClosingTag=!0,p.content=" /if ",p.originalNode=e,p}return e}pushError(e){this.activeNode!=null&&this.activeNode.pushError(e)}testUnlessContent(e){var r;let n=(r=e.getContent())!=null?r:"";if(n=n.replace("!",""),n=n.replace("(",""),n=n.replace(")","").trim(),n.length==0){this.pushConditionWithoutExpression(e);return}}pushConditionWithoutExpression(e){this.pushError(W.makeSyntaxError(A.TYPE_PARSE_EMPTY_CONDITIONAL,e,"Condition structure lacks comparison expression."))}getParameters(e){var G,L,M,$,K,ne,re,ye,Ce;let n=(G=e.getContent())!=null?G:"",r=n.split(""),i=[],s=[],a=r.length,o=0;if(e.name!=null){let ae=Z.trimLeft(e.content," "),Pe=e.content.length-ae.length,ct=e.name.content.length;Pe>0?o=Pe+ct:o=ct}let l=!1,u=[],c="",f=0,h=0,y=!1,p=null,d=-1,g=-1,m=-1,b=-1,_=-1,N=-1,C='"';for(let ae=0;ae0&&(ct=r[ae-1]),l==!1&&Z.ctypeSpace(Pe)){u=[],d=-1,g=-1,m=-1,b=-1,_=-1,N=-1;continue}if(l==!1&&Pe==w.Punctuation_Equals){if(u.length>0&&(Z.ctypeAlpha(u[0])||Z.ctypeDigit(u[0])||u[0]==w.Punctuation_Colon||u[0]==w.AtChar)==!1){u=[];continue}if(ae+1>=a){this.pushError(W.makeSyntaxError(A.TYPE_UNEXPECTED_END_OF_INPUT,e,"Unexpected end of input"));continue}let Je=null;if(ae+10&&(b=ae,_=ae,c=u.join(""),f=h,l=!0,u=[]),Jt==w.String_Terminator_DoubleQuote&&(p=w.String_Terminator_DoubleQuote,C=w.String_Terminator_DoubleQuote,ae+=1),Jt==w.String_Terminator_SingleQuote&&(p=w.String_Terminator_SingleQuote,C=w.String_Terminator_SingleQuote,ae+=1);continue}if(l&&Pe==w.String_EscapeCharacter){let Je=null;if(ae+1a){this.pushError(W.makeSyntaxError(A.TYPE_UNEXPECTED_EOI_WHILE_PARSING_NODE_PARAMETER,e,"Unexpected end of input while parsing parameter content.")),ft.parent=e,s.push(ft),c="";continue}ft.endPosition=(M=e.relativePositionFromOffset(ae+1,ae+1))!=null?M:null,ft.parent=e,ft.blockPosition={start:($=e.relativeOffset(d,d))!=null?$:null,end:(K=e.relativeOffset(g,g))!=null?K:null},ft.namePosition={start:(ne=e.relativeOffset(m,m))!=null?ne:null,end:(re=e.relativeOffset(b,b))!=null?re:null},ft.valuePosition={start:(ye=e.relativeOffset(_+2,_+2))!=null?ye:null,end:(Ce=e.relativeOffset(N,N))!=null?Ce:null},s.push(ft),c="",d=-1,g=-1,m=-1,b=-1,_=-1,N=-1;continue}if(l==!1&&(Pe==w.String_Terminator_DoubleQuote||Pe==w.String_Terminator_SingleQuote)&&ae>o)break;u.push(Pe),d==-1&&(d=ae),m==-1&&(m=ae),u.length==1&&(h=ae+1)}if(p!=null){let ae=e;if(i.length>0){let Pe=i[i.length-1],ct=e.content.indexOf(Pe);if(ct>=0){let Jt=new se;Jt.startPosition=e.relativeOffset(ct-2,ct-2),Jt.endPosition=e.relativeOffset(ct+Pe.length,ct+Pe.length),ae=Jt}}this.pushError(W.makeSyntaxError(A.TYPE_UNEXPECTED_END_OF_INPUT,ae,"Unexpected string literal while parsing parameters."))}return s}};function _l(t){return t.length==0?null:t[0].startPosition}var T0=je(uu()),wc=class{static regions(){return this.noParseRegions}static clear(){this.noParseRegions.clear()}static registerNoParseContent(e){let n=T0.Md5.hashStr(e);return this.noParseRegions.set(n,e),n}};wc.noParseRegions=new Map;function Hd(t,e){let n=new Set(t),r=new Set(e),i=new Set([...n].filter(s=>r.has(s)));return Array.from(i)}var $d=class{constructor(){this.closingTagIndex=new Map;this.closingTagIndexCount=new Map;this.openTagIndexCount=new Map;this.closingTagNames=new Map;this.parentNode=null;this.stackCount=0;this.createdExecutionBranches=[];this.document=null}getClosingCandidates(e){var n,r;if((e instanceof z||e instanceof mt)&&e.isClosingTag==!1){let i=(r=(n=e.name)==null?void 0:n.compound)!=null?r:"";return i=="if"?["if","elseif","else"]:i=="elseif"?["elseif","else","if"]:i=="else"?["if"]:[i]}return[]}buildCloseIndex(e){var n,r,i;e.forEach(s=>{var a,o,l,u,c,f,h,y,p,d;if(!(s instanceof dr)&&!((s instanceof z||s instanceof mt)&&s.isSelfClosing)&&(s instanceof z||s instanceof mt)&&s.isClosingTag){this.closingTagIndex.has(this.stackCount)==!1&&this.closingTagIndex.set(this.stackCount,new Map),this.closingTagIndexCount.has(this.stackCount)==!1&&this.closingTagIndexCount.set(this.stackCount,new Map);let g=(o=(a=s.name)==null?void 0:a.compound)!=null?o:"";((l=this.closingTagIndex.get(this.stackCount))==null?void 0:l.has(g))==!1&&((u=this.closingTagIndex.get(this.stackCount))==null||u.set(g,[]),(c=this.closingTagIndexCount.get(this.stackCount))==null||c.set(g,0)),(h=(f=this.closingTagIndex.get(this.stackCount))==null?void 0:f.get(g))==null||h.push(s);let m=(p=(y=this.closingTagIndexCount.get(this.stackCount))==null?void 0:y.get(g))!=null?p:0;(d=this.closingTagIndexCount.get(this.stackCount))==null||d.set(g,m+1)}}),this.closingTagNames.has(this.stackCount)==!1&&this.closingTagNames.set(this.stackCount,[]),this.closingTagIndex.has(this.stackCount)&&(this.closingTagNames.set(this.stackCount,Array.from((r=(n=this.closingTagIndex.get(this.stackCount))==null?void 0:n.keys())!=null?r:[])),(i=this.closingTagIndex.get(this.stackCount))==null||i.forEach((s,a)=>{var u,c,f,h,y,p,d;let o=s.length;if(o==0)return;let l=s[o-1];for(let g=0;g=l.index)break;let b=(c=(u=m.name)==null?void 0:u.compound)!=null?c:"";if(m.isClosingTag==!1&&a==b&&!m.isSelfClosing){this.openTagIndexCount.has(this.stackCount)==!1&&this.openTagIndexCount.set(this.stackCount,new Map),((f=this.openTagIndexCount.get(this.stackCount))==null?void 0:f.has(a))==!1&&((h=this.openTagIndexCount.get(this.stackCount))==null||h.set(a,0));let _=(p=(y=this.openTagIndexCount.get(this.stackCount))==null?void 0:y.get(a))!=null?p:0;(d=this.openTagIndexCount.get(this.stackCount))==null||d.set(a,_+1)}}}}))}getScanForList(e){var n;if(e instanceof z||e instanceof mt){let r=(n=e.name)==null?void 0:n.compound;if(r=="else")return["if"];if(r=="elseif")return["elseif","else","if"];if(e.isClosingTag==!1){let i=this.getClosingCandidates(e),s=this.closingTagNames.get(this.stackCount);return Hd(i,s)}}return[]}canPossiblyClose(e){var n,r;if(e instanceof dr)return!1;if(e instanceof mt||e instanceof z){if(e.isComment||e.isSelfClosing)return!1;let i=(r=(n=e.name)==null?void 0:n.compound)!=null?r:"";if(i=="else"||i=="elseif")return!0;if(e.isClosingTag==!1){let s=this.getClosingCandidates(e),a=this.closingTagNames.get(this.stackCount);return Hd(s,a).length>0}}return!1}findClosingPair(e,n,r){var o,l,u,c;let i=n.runtimeNodes.length,s=e.length,a=0;for(let f=0;f=i,a+=1}continue}if(r.includes(y)&&a>0){a-=1;continue}if(a==0&&r.includes(y)){h.isOpenedBy=n,n.isClosedBy=h;break}}}else continue}}associate(e,n){var s,a,o,l,u,c,f;this.document=n;let r=[{documentNodes:e,parent:null}],i=[];for(;r.length>0;){let h=r.pop();if(h==null)continue;let y=h.documentNodes;this.parentNode=h.parent,this.stackCount+=1,this.buildCloseIndex(y),y=Hn.pairConditionals(y),y.forEach(m=>{if((m instanceof z||m instanceof mt)&&this.canPossiblyClose(m)){if(Hn.isConditionalStructure(m))return;let b=this.getScanForList(m);this.findClosingPair(y,m,b)}});let p=y.length;for(let m=0;mb.isClosedBy.index)break;if(N.parent=b,b.children.push(N),N instanceof z&&N.index==b.index){N.parent=b;break}}}y.forEach(m=>{if((m instanceof z||m instanceof mt)&&m.children.length>0){let b=[];m.children.forEach(_=>{_.parent!=null&&_.parent.index==m.index&&(_.parent=m,b.push(_))}),r.push({documentNodes:b,parent:m})}});let d=[];y.forEach(m=>{this.parentNode==null?m.parent==null&&d.push(m):m.parent==this.parentNode&&d.push(m)}),d=this.reduceConditionals(d,n);let g=new Map;y.forEach(m=>{var b,_,N,C;if((m instanceof z||m instanceof mt)&&m.isClosedBy!=null&&this.document!=null){let G=this.document.getText(((_=(b=m.endPosition)==null?void 0:b.index)!=null?_:0)+1,(C=(N=m.isClosedBy.startPosition)==null?void 0:N.index)!=null?C:0);m.runtimeContent=G}});for(let m=0;m{var N;g.has((N=_.refId)!=null?N:"")==!1&&b.push(_)}),this.parentNode.parent.children=this.cleanNodes(b)}this.stackCount<=1&&(i=d)}return this.createdExecutionBranches.length>0&&this.createdExecutionBranches.forEach(h=>{h.head!=null&&(h.nodes=h.head.children)}),i}cleanNodes(e){let n=[],r=[];for(let i=0;i$d.ForceBreakLimit){M=!1;break}if(m instanceof z||m instanceof mt){let K=this.findEndOfBranch(e.slice(g+1),m,g),ne=new Kf,re=K.tail;ne.head=m,ne.tail=re,ne.nodes=this.cleanNodes(m.children);let ye=((f=(c=m.endPosition)==null?void 0:c.offset)!=null?f:0)+1,Ce=(p=(y=(h=m.isClosedBy)==null?void 0:h.startPosition)==null?void 0:y.offset)!=null?p:0,ae=n.getText(ye,Ce);if(ne.documentText=ae,n.shouldParseChildDocument()&&(ne.childDocument=Kt.childFromText(ne.documentText,_l(ne.nodes))),re==null&&(re=ne.head.isClosedBy),re!=null&&re.startPosition!=null&&(ne.startPosition=re.startPosition),re!=null&&(ne.index=re.index),ne.nodes.length>0){let Pe=ne.nodes[ne.nodes.length-1];Pe.endPosition!=null&&(ne.endPosition=Pe.endPosition)}else re!=null&&re.endPosition!=null&&(ne.endPosition=re.endPosition);if(this.createdExecutionBranches.push(ne),_.logicBranches.push(ne),(re==null?void 0:re.isClosingTag)&&((d=re.name)==null?void 0:d.compound)=="if"){L=K.offset,M=!1;break}else re!=null&&_.chain.push(re.index),g=K.offset,re instanceof z&&(m=re)}else M=!1}if(_.logicBranches.length>0){let K=_.logicBranches[0],ne=_.logicBranches[_.logicBranches.length-1];K.startPosition!=null&&(_.startPosition=K.startPosition),ne.endPosition!=null&&(_.endPosition=ne.endPosition)}if(r.push(_),L!=null&&L==e.length)break}else r.push(m);else r.push(m)}return r}},Oc=$d;Oc.ForceBreakLimit=1e5;var Kd=class{static associateRecursiveParent(e){var n,r;for(let i=0;i=0;l-=1){let u=e[l];if(!(u instanceof gt)&&u instanceof z&&u.isClosedBy!=null){if(s.isNestedRecursive){if(u.content.trim()==((r=s.name)==null?void 0:r.name)){o=u;break}}else if(u.runtimeContent.includes(a)&&Z.substringCount(s.runtimeContent,"*recursive")==1){o=u;continue}else if(o!=null)break}}if(o==null)continue;s.isNestedRecursive?(o.hasRecursiveNode=!0,s.recursiveParent=o,o.recursiveReference=s):o.parent!=null?o.parent instanceof z&&(o.parent.hasRecursiveNode=!0,o.parent.recursiveReference=s,s.recursiveParent=o.parent):(o.hasRecursiveNode=!0,s.recursiveParent=o,o.recursiveReference=s)}}}};var oo=class{static getNearText(e){var r,i,s,a;if(e instanceof Ne)return e.name;if(e instanceof Bt)return(i=(r=e.value)==null?void 0:r.toString())!=null?i:"";if(e instanceof Et)return e.value;if(e instanceof mn)return e.name;if(e instanceof $t)return e.value;if(e instanceof $r||e instanceof hi||e instanceof hr||e instanceof Or||e instanceof wr||e instanceof cn||e instanceof Gr||e instanceof Rt||e instanceof un||e instanceof Lr||e instanceof Kn||e instanceof di||e instanceof Cn||e instanceof fi||e instanceof Mr||e instanceof Xn||e instanceof Fr||e instanceof zn||e instanceof kr||e instanceof pi||e instanceof Ur||e instanceof qr||e instanceof Br||e instanceof Ii||e instanceof mr||e instanceof Qn||e instanceof Wr||e instanceof kn||e instanceof gr||e instanceof Pn||e instanceof Hr||e instanceof jr||e instanceof Vr||e instanceof Di||e instanceof _r||e instanceof Yr||e instanceof en||e instanceof Ht||e instanceof An||e instanceof St||e instanceof Xi||e instanceof Sn||e instanceof mi||e instanceof tn)return e.content;let n="";return e instanceof z?e.originalNode!=null?n=e.originalNode.getContent():n=(a=(s=e.startPosition)==null?void 0:s.line.toString())!=null?a:"":e.originalAbstractNode!=null?n=e.originalAbstractNode.rawContent():n=e.rawContent(),n.length>15&&(n=n.substr(0,-15)),n}};var lo=class{};lo.deferredCoreLibraries=["arr","array","str","string","method","math","sys","convert","scope","stopwatch","file","path","url","request","json","datetime"];var Nt=class{};Nt.ARR_PLUCK="pluck",Nt.ARR_TAKE="take",Nt.ARR_SKIP="skip",Nt.ARR_MAKE="arr",Nt.ARR_ORDERBY="orderby",Nt.ARR_GROUPBY="groupby",Nt.ARR_MERGE="merge",Nt.QUERY_WHERE="where",Nt.STRUCT_SWITCH="switch",Nt.BITWISE_AND="bwa",Nt.BITWISE_OR="bwo",Nt.BITWISE_XOR="bxor",Nt.BITWISE_NOT="bnot",Nt.BITWISE_SHIFT_LEFT="bsl",Nt.BITWISE_SHIFT_RIGHT="bsr",Nt.operators=["pluck","take","arr","skip","orderby","groupby","merge","where","switch","bwa","bwo","bxor","bsl","bsr"];var Ot=class{constructor(){this.pathParser=new qi;this.tokens=[];this.createdModifierChains=[];this.createdLanguageOperators=[];this.createdArrays=[];this.tracedAssignments=[];this.mergedVariablePaths=[];this.mergedComponents=new Map;this.modifierNameMapping=new Map;this.isRealModifierSeparator=new Map;this.isRoot=!0;this.retriggerNonVirtualGroupMembers=[]}hasModifierConstruct(e){return this.modifierNameMapping.has(e)}getModifierConstruct(e){return this.modifierNameMapping.get(e)}isActualModifierSeparator(e){return this.isRealModifierSeparator.has(e)}isMergedVariableComponent(e){return this.mergedComponents.has(e)}getMergedVariable(e){return this.mergedComponents.get(e)}getMergedVariablePaths(){return this.mergedVariablePaths}getCreatedModifierChains(){return this.createdModifierChains}getCreatedLangaugeOperators(){return this.createdLanguageOperators}getCreatedArrays(){return this.createdArrays}getRuntimeAssignments(){return this.tracedAssignments}getAssignedVariables(){let e=[],n=[];for(let r=0;r0&&this.retriggerNonVirtualGroupMembers.forEach(n=>{this.markAllNonVirtualAsListGroupMember(n)})),this.createSemanticGroups(this.tokens)}setIsRoot(e){return this.isRoot=e,this}validateNeighboringOperators(e){let n=e.length;for(let r=0;r=n){i.pushError(W.makeSyntaxError(A.TYPE_UNEXPECTED_OPERATOR,i,"Unexpected operator while parsing input text."));return}let s=e[r+1];if(Ot.isOperatorType(s)){s.pushError(W.makeSyntaxError(A.TYPE_OPERATOR_INVALID_ON_RIGHT,s,"Unexpected operator while parsing input text."));continue}}}}static isAssignmentOperator(e){return e instanceof Lr||e instanceof Fr||e instanceof Qn||e instanceof kr||e instanceof Mr||e instanceof di}static isOperatorType(e){return e instanceof Lr||e instanceof Fr||e instanceof Qn||e instanceof kr||e instanceof Mr||e instanceof di||e instanceof Di||e instanceof Gr||e instanceof gr||e instanceof cn||e instanceof Hr||e instanceof hi||e instanceof _r||e instanceof mi||e instanceof Kn||e instanceof zn||e instanceof fi||e instanceof pi||e instanceof Xn||e instanceof Cn||e instanceof kn||e instanceof mr||e instanceof Ii||e instanceof Br||e instanceof qr||e instanceof Vr||e instanceof jr||e instanceof Ur||e instanceof Wr}markAllNonVirtualAsListGroupMember(e){e.forEach(n=>{if(n instanceof We||n instanceof yr||n instanceof Ri){n.start!=null&&n.start.isVirtual==!1&&(n.start.isListGroupMember=!0),n.end!=null&&n.end.isVirtual==!1&&(n.end.isListGroupMember=!0),n.scopeOperator!=null&&(n.scopeOperator.isListGroupMember=!0),n.nodes.forEach(r=>{this.markAllNonVirtualAsListGroupMember([r])});return}else n instanceof Mt&&(n.separatorToken!=null&&n.separatorToken.isVirtual==!1&&(n.separatorToken.isListGroupMember=!0),this.markAllNonVirtualAsListGroupMember(n.nodes));n.isVirtual==!1&&(n.isListGroupMember=!0),n.originalAbstractNode!=null&&n.originalAbstractNode!=n&&this.markAllNonVirtualAsListGroupMember([n.originalAbstractNode])})}markAllNonVirtualAsSwitch(e){e.forEach(n=>{if(n instanceof We||n instanceof yr||n instanceof Ri){n.start!=null&&n.start.isVirtual==!1&&(n.start.isSwitchGroupMember=!0),n.end!=null&&n.end.isVirtual==!1&&(n.end.isSwitchGroupMember=!0),n.scopeOperator!=null&&(n.scopeOperator.isSwitchGroupMember=!0),n.nodes.forEach(r=>{this.markAllNonVirtualAsSwitch([r])});return}else n instanceof Mt&&(n.separatorToken!=null&&n.separatorToken.isVirtual==!1&&(n.separatorToken.isSwitchGroupMember=!0),this.markAllNonVirtualAsSwitch(n.nodes));n.isVirtual==!1&&(n.isSwitchGroupMember=!0),n.originalAbstractNode!=null&&n.originalAbstractNode!=n&&this.markAllNonVirtualAsSwitch([n.originalAbstractNode])})}validateNoDanglingLogicGroupEnds(e){e.forEach(n=>{n instanceof Ht&&n.pushError(W.makeSyntaxError(A.TYPE_LOGIC_GROUP_NO_START,n,"Unexpected [T_LOGIC_END] while parsing input text."))})}isValidModifierValue(e){return e instanceof $t||e instanceof Ne||e instanceof Or||e instanceof wr||e instanceof hr||e instanceof Bt||e instanceof Et}wrapNumberInVariable(e){var r,i,s,a;let n=new Ne;return n.startPosition=e.startPosition,n.endPosition=e.endPosition,n.name=(i=(r=e.value)==null?void 0:r.toString())!=null?i:"",n.content=(a=(s=e.value)==null?void 0:s.toString())!=null?a:"",n.originalAbstractNode=e,n.refId=e.refId,n.modifierChain=e.modifierChain,n.index=e.index,n}wrapArithmeticModifier(e,n){let r=new mn;return r.startPosition=e.startPosition,r.endPosition=e.endPosition,r.originalAbstractNode=e,r.content=n,r.name=n,r.index=e.index,r}combineVariablePaths(e){let n=[],r=e.length;for(let i=0;ir){let u="";if(i>0){let c=e[i-1];u=oo.getNearText(c)}s.pushError(W.makeSyntaxError(A.TYPE_UNEXPECTED_EOI_PARSING_BRANCH_GROUP,s,'Unexpected end of input while parsing input text near "'+u+oo.getNearText(s)+'".'));continue}let o=n[a-1],l=e[i+1];if(l instanceof Bt&<.distance(o,l)==1&&(l=this.wrapNumberInVariable(l)),o instanceof Ne&&l instanceof Ne&<.distance(o,l)==1){n.pop(),lt.mergeVarContentRight(":",s,l),lt.mergeVarRight(o,l),n.push(l),this.mergedVariablePaths.push(l),this.mergedComponents.set(s,l),this.mergedComponents.set(o,l),this.mergedComponents.set(l,l),i+=1;continue}else{n.push(s);continue}}else if(s instanceof Et&&a>0){if(i+1>=r){n.push(s);continue}let o=n[a-1],l=e[i+1];if(o instanceof Ne&&l instanceof Ne&<.distance(o,s)<=1&<.distance(s,l)<=1){n.pop(),lt.mergeVarContentLeft(s.sourceTerminator+s.value+s.sourceTerminator,s,o),lt.mergeVarContentLeft(l.name,l,o),n.push(o),this.mergedVariablePaths.push(o),this.mergedComponents.set(s,o),this.mergedComponents.set(o,o),this.mergedComponents.set(l,o),i+=1;continue}else n.push(s)}else if(s instanceof Cn&&a>0){let o=n[a-1],l=e[i+1];if(o instanceof Ne&&l instanceof Ne){let u=lt.distance(o,s),c=lt.distance(s,l);u<=1&&c<=1?(o.endPosition=l.endPosition,this.mergedComponents.set(s,o),this.mergedComponents.set(o,o),this.mergedComponents.set(l,o),i+=1):n.push(s)}else n.push(s)}else n.push(s)}return n.forEach(i=>{i instanceof Ne&&(i.variableReference=this.pathParser.parse(i.name),i.mergeErrors(this.pathParser.getAntlersErrors()))}),n}convertVarNodeToOperator(e){let n=new Gr;return n.content=e.name,n.startPosition=e.startPosition,n.endPosition=e.endPosition,n.originalAbstractNode=e,e.convertedToOperator=!0,this.createdLanguageOperators.push(n),n}convertOperatorToVarNode(e){let n=new Ne;return n.startPosition=e.startPosition,n.endPosition=e.endPosition,n.content=e.content,n.name=e.content,n.originalAbstractNode=e,n}createLanguageOperators(e){let n=e.length;for(let r=0;r=n){e[r]=this.convertOperatorToVarNode(i);continue}if(e[r+1]instanceof un){e[r]=this.convertOperatorToVarNode(i);continue}}}return e}createLogicalGroups(e){let n=[],r=e.length,i=[];for(let a=0;a0&&i.length>0){let f=i[i.length-1];if(f instanceof Bt||f instanceof Ht||f instanceof We){if(f instanceof We&&f.start instanceof cn){f.start.pushError(W.makeSyntaxError(A.TYPE_FACTORIAL_MATERIALIZED_BOOL_DETECTED,f.start,"[T_AOP_FACTORIAL] operand will always materialize boolean type."));continue}let h=new Xi;h.startPosition=o.startPosition,h.endPosition=o.endPosition,h.content="!".repeat(l),h.originalAbstractNode=o,h.repeat=l,i.push(h),l>0&&(a+=l-1);continue}}if(l%2==0){a+=l-1;continue}let u=e[a+l];if(u instanceof en){let f=a+l+1;if(f>=r){u.pushError(W.makeSyntaxError(A.TYPE_UNEXPECTED_EOI_WHILE_PARSING_LOGIC_GROUP_NEGATION_OFFSET,u,"Unexpected end of input while parsing input text."));continue}let h=this.findLogicalGroupEnd(e[a+l],e.slice(f));if(h.found){let y=h.logicalGroup,p=new We;p.start=o,p.end=y,p.nodes.push(o),p.nodes.push(y),p.startPosition=o.startPosition,p.endPosition=y.endPosition,i.push(p),a+=h.skipCount+l}continue}let c=this.resolveValueRight(e,a);c.value!=null&&i.push(c.value),a+=c.negationCount}else i.push(o)}let s=i.length;for(let a=0;a=s){o.pushError(W.makeSyntaxError(A.TYPE_UNEXPECTED_EOI_WHILE_PARSING_LOGIC_GROUP_END_DUE_TO_NEGATION,o,"Unexpected end of input while parsing input text."));continue}let l=this.findLogicalGroupEnd(o,i.slice(a+1));l.found&&l.logicalGroup!=null&&n.push(l.logicalGroup),a+=l.skipCount}else if(o instanceof Xi){if(n.length==0){o.pushError(W.makeSyntaxError(A.TYPE_UNEXPECTED_FACTORIAL_WHILE_CREATING_GROUPS,o,"Unexpected [T_AOP_FACTORIAL] while parsing input text."));continue}let l=n[n.length-1];if(!(l instanceof We)&&!(l instanceof Bt)){o.pushError(W.makeSyntaxError(A.TYPE_UNEXPECTED_FACTORIAL_OPERAND,o,"Unexpected left operand encountered for [T_AOP_FACTORIAL] while parsing input text."));continue}l=n.pop();let u=new We;u.startPosition=l.startPosition,u.endPosition=o.endPosition,u.originalAbstractNode=o,u.nodes.push(l),u.nodes.push(o),n.push(u)}else n.push(o)}return n}makeArgGroup(e){let n=new Na,r=e.length;for(let s=0;s=r){a.pushError(W.makeSyntaxError(A.TYPE_ARG_UNEXPECTED_NAMED_ARGUMENT,a,"Unexpected end of input while parsing named argument."));continue}let l=e[s+2],u=new fu;u.startPosition=a.startPosition,u.endPosition=l.endPosition,u.content=a.content+l.content,u.name=a,u.value=l,a instanceof Ne||a.pushError(W.makeSyntaxError(A.TYPE_INVALID_NAMED_ARG_IDENTIFIER,a,"Invalid type ["+ee.getPrettyTypeName(a)+"] supplied for named argument name.")),n.hasNamedArguments=!0,n.numberOfNamedArguments+=1,n.args.push(u),s+3{s instanceof fu?i=!0:i&&s.pushError(W.makeSyntaxError(A.TYPE_UNEXPECTED_UNNAMED_METHOD_ARGUMENT,s,"Unnamed arguments are not allowed to appear after a named argument."))}),n}cleanVariableForMethodInvocation(e){(e.name.startsWith(":")||e.name.startsWith("."))&&(e.name=e.name.substr(1),e.variableReference!=null&&(e.variableReference.originalContent=e.variableReference.originalContent.substr(1),e.variableReference.normalizedReference=e.variableReference.normalizedReference.substr(1)),e.startPosition!=null&&(e.startPosition.offset+=1,e.startPosition.char+=1))}reduceVariableReferenceForObjectAccessor(e){var s;let n=(s=e.variableReference)==null?void 0:s.pathParts.pop(),r=n.name,i=r.length+1;return e.name=e.name.substr(0,-i),e.variableReference!=null&&(e.variableReference.originalContent=e.variableReference.originalContent.substr(0,-i),e.variableReference.normalizedReference=e.variableReference.normalizedReference.substr(0,-i),e.variableReference.pathParts[e.variableReference.pathParts.length-1].isFinal=!0),e.endPosition!=null&&(e.endPosition.offset-=i,e.endPosition.char-=i),{accessor:r,accessorLen:i}}associateMethodCalls(e){var i,s;let n=[],r=e.length;for(let a=0;a0&&(l=n[n.length-1]),a+10&&(c.nodes[0]instanceof Mt?f=c.nodes[0].nodes:f=c.nodes);let h=new tn;if(h.startPosition=o.startPosition,l instanceof St){let y=n.pop();h.startPosition=y.startPosition}this.cleanVariableForMethodInvocation(o),h.endPosition=c.endPosition,h.args=this.makeArgGroup(f),h.method=o,l.methodTarget=h,l instanceof Ne&&l.mergeRefName.length>0&&(l.name=lt.getUnrefName(l.mergeRefName)),n.push(h),a+=1;continue}else if(o instanceof We&&l instanceof Ne&&l.variableReference!=null&&l.variableReference.pathParts.length>=2){let c=[];if(o.nodes.length>0&&(o.nodes[0]instanceof Mt?c=o.nodes[0].nodes:c=o.nodes),l.variableReference.pathParts[0]instanceof Yn&&lo.deferredCoreLibraries.includes(l.variableReference.pathParts[0].name)){let d=n.pop(),g=new Qi;g.startPosition=d.startPosition,g.endPosition=o.endPosition,g.content=d.content,g.originalAbstractNode=o;let b=((i=d.variableReference)==null?void 0:i.pathParts.shift()).name,_=(s=d.variableReference)==null?void 0:s.implodePaths();g.libraryName=b,g.methodName=_,g.arguments=this.makeArgGroup(c),n.push(g),a+=1;continue}let f=this.reduceVariableReferenceForObjectAccessor(l),h=new tn;h.startPosition=o.startPosition,h.endPosition=o.endPosition,l.methodTarget=h,l instanceof Ne&&l.mergeRefName.length>0&&(l.name=lt.getUnrefName(l.mergeRefName)),o.start!=null&&(o.start.isPartOfMethodChain=!0),o.end!=null&&(o.end.isPartOfMethodChain=!0);let y=new Ne;y.name=f.accessor,y.isPartOfMethodChain=!0;let p=this.makeArgGroup(c);if(h.startPosition!=null&&(h.startPosition.offset-=f.accessorLen,h.startPosition.char-=f.accessorLen),h.method=y,h.args=p,Z.isNumeric(l.name)){let d=n.pop();n.push(this.convertOperatorToVarNode(d))}n.push(h);continue}else if(o instanceof Ne&&l instanceof tn){if(this.cleanVariableForMethodInvocation(o),a+1>r){o.pushError(W.makeSyntaxError(A.TYPE_METHOD_CALL_MISSING_ARG_GROUP,o,"Unexpected end of input while parsing method call."));continue}let c=e[a+1];if(!(c instanceof We)){o.pushError(W.makeSyntaxError(A.TYPE_INVALID_METHOD_CALL_ARG_GROUP,o,"Unexpected ["+ee.getPrettyTypeName(c)+"] while parsing [T_METHOD_CALL]; expecting [T_ARG_GROUP]."));continue}let f=c,h=[];f.nodes.length>0&&(f.nodes[0]instanceof Mt?h=f.nodes[0].nodes:h=f.nodes);let y=new tn;y.startPosition=o.startPosition,y.endPosition=f.endPosition,y.args=this.makeArgGroup(h),y.method=o,l.methodTarget=y,n.push(y),a+=1;continue}else if(o instanceof St&&l instanceof tn){if(a+1>r){o.pushError(W.makeSyntaxError(A.TYPE_METHOD_CALL_MISSING_METHOD,o,"Unexpected end of input while parsing method call."));continue}let c=e[a+1];if(a+2>r){o.pushError(W.makeSyntaxError(A.TYPE_METHOD_CALL_MISSING_ARG_GROUP,o,"Unexpected end of input while parsing method call."));continue}let f=e[a+2];if(!(f instanceof We)){o.pushError(W.makeSyntaxError(A.TYPE_INVALID_METHOD_CALL_ARG_GROUP,o,"Unexpected ["+ee.getPrettyTypeName(f)+"] while parsing [T_METHOD_CALL]; expecting [T_ARG_GROUP]."));continue}let h=f,y=[];h.nodes.length>0&&(h.nodes[0]instanceof Mt?y=h.nodes[0].nodes:y=h.nodes);let p=new tn;p.startPosition=o.startPosition,p.endPosition=f.endPosition,p.args=this.makeArgGroup(y),p.method=c,l.methodTarget=p,n.push(p),a+=2;continue}else if(o instanceof tn){if(a+1>r){o.pushError(W.makeSyntaxError(A.TYPE_METHOD_CALL_MISSING_METHOD,o,"Unexpected end of input while parsing method call."));continue}let c=e[a+1];if(a+2>r){o.pushError(W.makeSyntaxError(A.TYPE_INVALID_METHOD_CALL_ARG_GROUP,o,"Unexpected end of input while parsing method call."));continue}let f=e[a+2];if(!(f instanceof We)){o.pushError(W.makeSyntaxError(A.TYPE_INVALID_METHOD_CALL_ARG_GROUP,o,"Unexpected ["+ee.getPrettyTypeName(f)+"] while parsing [T_METHOD_CALL]; expecting [T_ARG_GROUP]."));continue}let h=f,y=[];h.nodes.length>0&&(h.nodes[0]instanceof Mt?y=h.nodes[0].nodes:y=h.nodes);let p=this.makeArgGroup(y);if(l instanceof Ne&&lo.deferredCoreLibraries.includes(l.name)){let d=n.pop(),g=new Qi;g.startPosition=d.startPosition,g.endPosition=h.endPosition,g.libraryName=d.name,g.methodName=c.name,g.content=g.libraryName+"->"+g.methodName,g.arguments=p,l.libraryTarget=g,n.push(g),a+=2;continue}o.method=c,o.args=p,n.length>0&&(n[n.length-1].methodTarget=o),a+=2,n.push(o);continue}else n.push(o)}return n}convertVariableToStringNode(e){let n=new Et;return n.content=e.name,n.value=e.name,n.originalAbstractNode=e,n.startPosition=e.startPosition,n.endPosition=e.endPosition,n.index=e.index,n}createTupleLists(e){let n=e.length,r=[];for(let i=0;i=n){s.pushError(W.makeSyntaxError(A.TYPE_UNEXPECTED_EOI_PARSING_TUPLE_LIST,s,"Unexpected end of input while parsing tuple list."));continue}let a=e[i+1];if(!(a instanceof We)){a.pushError(W.makeSyntaxError(A.TYPE_UNEXPECTED_TYPE_FOR_TUPLE_LIST,a,"Unexpected ["+ee.getPrettyTypeName(a)+"] while parsing tuple list."));continue}let o=a;if(this.markAllNonVirtualAsListGroupMember([o]),this.retriggerNonVirtualGroupMembers.push([o]),o.nodes.length==0){o.pushError(W.makeSyntaxError(A.TYPE_MISSING_BODY_TUPLE_LIST,o,"Missing tuple list body while parsing tuple list."));continue}let u=o.nodes.shift(),c=u.nodes.length,f=[];for(let p=0;p1&&(g=!0),d.name.trim().length==0&&(g=!0)),g||!(d instanceof Ne)){o.pushError(W.makeSyntaxError(A.TYPE_INVALID_TUPLE_LIST_NAME_TYPE,o,"Invalid ["+ee.getPrettyTypeName(d)+"] name type found while parsing tuple list."));continue}let m=d;f.push(this.convertVariableToStringNode(m))}}let h=f.length;if(h==0){o.pushError(W.makeSyntaxError(A.TYPE_INVALID_MANIFESTED_NAME_GROUP,o,"Invalid Name expression produced an invalid name group while parsing tuple list."));continue}let y=new xi;this.createdArrays.push(y),y.startPosition=s.startPosition,y.endPosition=s.endPosition,o.nodes.forEach(p=>{if(!(p instanceof Mt)){p.pushError(W.makeSyntaxError(A.TYPE_INVALID_TUPLE_LIST_VALUE_TYPE_GROUP,p,"Invalid ["+ee.getPrettyTypeName(p)+"] name type found while parsing tuple list value expression."));return}let d=p,g=new xi;this.createdArrays.push(g),g.startPosition=d.startPosition;let m=[];for(let b=0;bm.length);b++){let _=m[b],N=new Ho;N.startPosition=_.startPosition,N.endPosition=_.endPosition,N.name=f[b],N.value=_,g.nodes.push(N),y.endPosition=_.endPosition,g.endPosition=_.endPosition}y.nodes.push(g)}),r.push(y),i+=1;continue}else r.push(s)}return e}makeOrderGroup(e){let n=[],r=e.length,i=0;for(let s=0;s0&&(o==null||o instanceof Rt)){i+=1;let l=new Wo;l.order=i,l.name=e[s-1],l.directionNode=a,this.isOperand(l.name)==!1&&l.name.pushError(W.makeSyntaxError(A.TYPE_INVALID_ORDER_BY_NAME_VALUE,l.name,"Invalid value or expression supplied for order by name.")),this.isOperand(l.directionNode)==!1&&l.directionNode.pushError(W.makeSyntaxError(A.TYPE_INVALID_ORDER_BY_SORT_VALUE,l.directionNode,"Invalid value or expression supplied for order by direction.")),l.startPosition=l.name.startPosition,l.endPosition=l.directionNode.endPosition,n.push(l),s+=1;continue}}return n}getValues(e){let n=new Ta,r=e.length,i=[];for(let s=0;s=r){s.pushError(W.makeSyntaxError(A.TYPE_UNEXPECTED_EOI_WHILE_PARSING_ARG_GROUP,s,"Unexpected end of input while parsing argument group."));continue}if(!(e[i+1]instanceof We)){s.pushError(W.makeSyntaxError(A.TYPE_EXPECTING_ARGUMENT_GROUP,s,"Unexpected token while parsing method call. Expecting [T_ARG_SEPARATOR] got ["+ee.getPrettyTypeName(s)+"]."));continue}let c=e[i+1],f=null;if(c.nodes.length>0){let h=c.nodes[0];f=this.makeArgGroup(h.nodes)}f==null&&(f=new Na,f.startPosition=c.startPosition,f.endPosition=c.endPosition,f.originalAbstractNode=c),u.arguments=f,n.push(u),i+=1;continue}else if(s.content==Nt.ARR_ORDERBY){if(i+1>=r){s.pushError(W.makeSyntaxError(A.TYPE_UNEXPECTED_EOI_PARSING_ORDER_GROUP,s,"Unexpected end of input while parsing order group."));continue}let a=e[i+1];if(!(a instanceof We)){a.pushError(W.makeSyntaxError(A.TYPE_EXPECTING_ORDER_GROUP_FOR_ORDER_BY_OPERAND,a,"Unexpected ["+ee.getPrettyTypeName(a)+"] while parsing order group."));continue}let l=a.nodes;l[0]instanceof Mt&&(l=l[0].nodes);let u=this.makeOrderGroup(l);u.length==0&&s.pushError(W.makeSyntaxError(A.TYPE_UNEXPECTED_EMPTY_DIRECTION_GROUP,s,"Unexpected empty [T_DIRECTION_GROUP]. Must have at least one order clause, and each property must have a direction specified."));let c=new xs;if(c.orderClauses=u,u.length>0){u[0].directionNode!=null&&(c.startPosition=u[0].directionNode.startPosition);let f=u[u.length-1].directionNode;f!=null&&(c.endPosition=f.endPosition)}n.push(s),n.push(c),i+=1;continue}else if(s.content==Nt.ARR_GROUPBY){if(i+1>=r){s.pushError(W.makeSyntaxError(A.TYPE_UNEXPECTED_EOI_WHILE_PARSING_GROUP_BY,s,"Unexpected end of input while parsing group by clause."));continue}let a=e[i+1];if(a instanceof Ri||a instanceof yr){a.pushError(W.makeSyntaxError(A.TYPE_GROUP_BY_SCOPED_GROUP_MUST_BE_ENCLOSED,a,"Type ["+ee.getPrettyTypeName(a)+"] must be enclosed with parenthesis to be used with groupby."));continue}if(!(a instanceof We)){a.pushError(W.makeSyntaxError(A.TYPE_UNEXPECTED_TOKEN_FOR_GROUP_BY,a,"Unexpected ["+ee.getPrettyTypeName(a)+"] while parsing group by."));continue}let l=a.nodes;l[0]instanceof Mt&&(l=l[0].nodes);let u=this.getValues(l);if(n.push(s),n.push(u),i+2=r){s.pushError(W.makeSyntaxError(A.TYPE_UNEXPECTED_EOI_WHILE_PARSING_SWITCH_GROUP,s,"Unexpected end of input while parsing [T_SWITCH_GROUP]."));continue}let a=e[i+1];if(!(a instanceof yr)){a.pushError(W.makeSyntaxError(A.TYPE_UNEXPECTED_TOKEN_FOR_SWITCH_GROUP,a,"Unexpected ["+ee.getPrettyTypeName(a)+"] while parsing [T_SWITCH_GROUP]."));continue}let o=a;if(this.markAllNonVirtualAsSwitch([a]),o.scope==null||!(o.scope instanceof We)){o.pushError(W.makeSyntaxError(A.TYPE_UNEXPECTED_SWITCH_START_VALUE,o,"Unexpected input while parsing [T_SWITCH_GROUP]."));continue}let l=o.scope;if(l.nodes.length==0||!(l.nodes[0]instanceof Mt)){o.pushError(W.makeSyntaxError(A.TYPE_UNEXPECTED_SWITCH_START_VALUE_NO_VALUE,o,"Unexpected input while parsing [T_SWITCH_GROUP]."));continue}let u=l.nodes[0];if(this.markAllNonVirtualAsSwitch([l]),u.nodes.length==0||!(u.nodes[0]instanceof We)){s.pushError(W.makeSyntaxError(A.TYPE_UNEXPECTED_SWITCH_START_VALUE_NO_VALUE,s,"Unexpected input while parsing [T_SWITCH_GROUP]."));continue}this.markAllNonVirtualAsSwitch([s]),this.markAllNonVirtualAsSwitch(u.nodes);let c=u.nodes;if(o.nodes.length==0&&s.pushError(W.makeSyntaxError(A.TYPE_UNEXPECTED_SWITCH_START_VALUE_NO_VALUE,s,"Unexpected input while parsing [T_SWITCH_GROUP].")),!(l.nodes[0]instanceof Mt)){s.pushError(W.makeSyntaxError(A.TYPE_UNEXPECTED_SWITCH_START_VALUE_NO_VALUE,s,"Unexpected input while parsing [T_SWITCH_GROUP]."));continue}let h=l.nodes[0];this.markAllNonVirtualAsSwitch(h.nodes);let y=h.nodes,p=new Rs,d=new We;d.nodes=c,d.startPosition=d.nodes[0].startPosition,d.endPosition=d.nodes[d.nodes.length-1].endPosition;let g=new va;g.condition=d;let m=new We;m.nodes.push(y.shift()),m.startPosition=m.nodes[0].startPosition,m.endPosition=m.nodes[m.nodes.length-1].endPosition,g.expression=m,g.startPosition=g.condition.startPosition,g.endPosition=g.expression.nodes[g.expression.nodes.length-1].endPosition,y.shift(),p.cases.push(g);let b=y.length;if(b>0){if(!(y[0]instanceof We)){s.pushError(W.makeSyntaxError(A.TYPE_PARSER_INVALID_SWITCH_TOKEN,s,"Invalid ["+ee.getPrettyTypeName(y[0])+"] while parsing case statement."));continue}for(let _=0;_=r){s.pushError(W.makeSyntaxError(A.TYPE_ARR_MAKE_MISSING_TARGET,s,"Missing target variable for arr operator."));continue}let a=e[i+1];if(!(a instanceof We)){a.pushError(W.makeSyntaxError(A.TYPE_ARR_MAKE_UNEXPECTED_TYPE,a,"Unexpected ["+ee.getPrettyTypeName(a)+"] while parsing array."));continue}let o=a instanceof yr,l=a,u=l.nodes;if(u[0]instanceof Mt&&(u=u[0].nodes),o){let y=a;u.unshift(new Sn),u.unshift(y.scope)}let c=this.getArrayValues(u),f=new xi;f.startPosition=s.startPosition;let h=c.values.length;h>0?f.endPosition=c.values[h-1].endPosition:f.endPosition=s.endPosition,l.end!=null&&(f.endPosition=l.end.endPosition),f.nodes=c.values,this.createdArrays.push(f),n.push(f),i+=1}else n.push(s);else n.push(s)}return n}getArrayValues(e){let n=new Ta,r=e.length,i=[];for(let s=0;s=r){o.pushError(W.makeSyntaxError(A.TYPE_ARR_MAKE_MISSING_ARR_KEY_PAIR_VALUE,o,"Missing key/pair value while parsing array."));continue}let l=e[s+2],u=new Ho;if(this.isValidArrayKeyNode(a)==!1){a.pushError(W.makeSyntaxError(A.TYPE_ARR_KEY_PAIR_INVALID_KEY_TYPE,a,"Invalid ["+ee.getPrettyTypeName(a)+"] type for key/value key."));continue}u.name=a,u.value=l,u.startPosition=a.startPosition,u.endPosition=l.endPosition,i.push(u),s+=3;continue}if(o==null||o instanceof Rt){let l=new Ho;l.value=a,l.startPosition=a.startPosition,l.endPosition=a.endPosition,i.push(l),s+=1;continue}}return n.values=i,n}isValidArrayKeyNode(e){return e instanceof Bt||e instanceof Et}associateModifiers(e){let n=[],r=e.length,i=null;for(let s=0;s=r){a.pushError(W.makeSyntaxError(A.TYPE_UNEXPECTED_EOI_WHILE_PARSING_MODIFIER_DETAILS,a,"Unexpected end of input while preparing to gather modifier details."));continue}let l=this.scanToEndOfModifier(e.slice(s+1)),u=l.length;if(u>1&&l[1]instanceof St){this.isRealModifierSeparator.set(l[1],!0);let f=l[0];f instanceof Kn?l[0]=this.wrapArithmeticModifier(f,"add"):f instanceof Cn?l[0]=this.wrapArithmeticModifier(f,"subtract"):f instanceof zn?l[0]=this.wrapArithmeticModifier(f,"divide"):f instanceof Xn?l[0]=this.wrapArithmeticModifier(f,"multiply"):f instanceof pi&&(l[0]=this.wrapArithmeticModifier(f,"mod"))}if(u==0){a.pushError(W.makeSyntaxError(A.TYPE_UNSET_MODIFIER_DETAILS,a,"Invalid or missing modifier details."));continue}if(!(l[0]instanceof mn)){a.pushError(W.makeSyntaxError(A.TYPE_MODIFIER_NAME_NOT_START_OF_DETAILS,a,"Invalid ["+ee.getPrettyTypeName(l[0])+"]; expecting [T_MODIFIER_NAME]"));continue}let c=this.createModifier(l);c.nameNode!=null&&this.modifierNameMapping.set(c.nameNode,c),s+=u,i.modifierChain.modifierChain.push(c),i.modifierChain.updateValues();continue}else n.push(a)}return n}createNullCoalescenceGroups(e){let n=[],r=e.length;for(let i=0;i=r){s.pushError(W.makeSyntaxError(A.TYPE_UNEXPECTED_EOI_WHILE_PARSING_NULL_COALESCENCE_GROUP,s,"Unexpected end of input while parsing input text."));continue}let o=e[i+1],l=new Go;l.left=a,l.right=o,n.push(l),i+=1;continue}else n.push(s)}return n}isOperand(e){return e instanceof Ne||e instanceof We||e instanceof Et||e instanceof Bt||e instanceof wr||e instanceof hr||e instanceof Or||e instanceof Qi||e instanceof xs||e instanceof Ta||e instanceof Rs||e instanceof xi}isProperMethodChainTargetStrict(e){return e instanceof We||e instanceof Et||e instanceof Bt||e instanceof wr||e instanceof hr||e instanceof Or||e instanceof Qi||e instanceof xs||e instanceof Ta||e instanceof Rs||e instanceof xi}assertOperandRight(e,n){if(n+1>e.length-1)return e[n].pushError(W.makeSyntaxError(A.TYPE_UNEXPECTED_END_OF_INPUT,e[n],"Unexpected end of input; expecting operand for operator "+ee.getPrettyTypeName(e[n])+' near "'+oo.getNearText(e[n])+'".')),!1;let r=e[n+1];return this.isOperand(r)?!0:(r.pushError(W.makeSyntaxError(A.TYPE_EXPECTING_OPERAND,e[n],"Expecting operand, found "+ee.getPrettyTypeName(r)+' near "'+oo.getNearText(e[n])+'".')),!1)}resolveValueRight(e,n){let r=null,i=0,s=null;if(e.length>0){let a=!0;for(;a;){let o=e[n];if(o instanceof cn){s=o,i+=1,n+=1,a=!1;continue}else if(this.isOperand(o)){r=o,a=!1;break}else{a=!1;break}}}if(i%2!=0){let a=new We;return a.nodes=[],s!=null&&r!=null&&(a.nodes.push(s),a.nodes.push(r)),{value:a,negationCount:i}}return{value:r,negationCount:i}}correctTypes(e){let n=[];return e.forEach(r=>{if(r instanceof An){let i=new St;i.startPosition=r.startPosition,i.endPosition=r.endPosition,i.originalAbstractNode=r,n.push(i)}else if(r instanceof $t){let i=new Ne;i.name=r.value,i.startPosition=r.startPosition,i.endPosition=r.endPosition,i.modifierChain=r.modifierChain,i.originalAbstractNode=r,n.push(i)}else n.push(r)}),n}createTernaryGroups(e){var i,s,a,o;let n=[],r=e.length;for(let l=0;l=r){u.pushError(W.makeSyntaxError(A.TYPE_UNEXPECTED_EOI_WHILE_PARSING_TERNARY_GROUP,u,"Unexpected end of input while parsing ternary group."));continue}let p=e.slice(l+1,y);if(p.length>1||p.length==0){u.pushError(W.makeSyntaxError(A.TYPE_TERNARY_UNEXPECTED_EXPRESSION_LENGTH,u,"Unexpected number of operations within ternary truth branch."));continue}let d=p[0],g=((a=c.foundAt)!=null?a:0)+1;if(g>=r){u.pushError(W.makeSyntaxError(A.TYPE_UNEXPECTED_EOI_WHILE_PARSING_TERNARY_GROUP_FALSE_BRANCH,u,"Unexpected end of input while parsing ternary false execution branch."));continue}let m=e[g],b=new Yo;b.head=h,b.truthBranch=d,b.falseBranch=m,n.push(b),l=((o=c.foundAt)!=null?o:0)+1;continue}else n.push(u)}return n}groupNodesByType(e,n){let r=[],i=e.length;for(let s=0;s0&&a instanceof n){let o=[],l=r.pop();if(o.push(l),!this.assertOperandRight(e,s))continue;if(s+1>=i){a.pushError(W.makeSyntaxError(A.TYPE_UNEXPECTED_EOI_WHILE_REDUCING_NEGATION_OPERATORS,a,"Unexpected end of input while parsing input text."));continue}let u=e[s+1];typeof u!="undefined"&&(u.isVirtualGroupMember=!0),typeof l!="undefined"&&(l.isVirtualGroupMember=!0),a.isVirtualGroupMember=!0;let c=new We;c.nodes=o,c.nodes.push(a),c.nodes.push(u),s+=1,r.push(c);continue}else r.push(a)}return r}flagNodeAsOperatorResolve(e){if(e instanceof We){if(e.nodes.length==0)return;this.flagNodeAsOperatorResolve(e.nodes[e.nodes.length-1])}e.isVirtualGroupOperatorResolve=!0,e.next instanceof un||(e.producesVirtualStatementTerminator=!0)}groupNodesByOperatorType(e){let n=[],r=e.length;for(let i=0;i0&&Ot.isOperatorType(s)){let a=[],o=n.pop();if(a.push(o),!this.assertOperandRight(e,i))continue;if(i+1>=r){s.pushError(W.makeSyntaxError(A.TYPE_UNEXPECTED_EOI_WHILE_REDUCING_NEGATION_OPERATORS,s,"Unexpected end of input while parsing input text."));continue}let l=e[i+1];this.flagNodeAsOperatorResolve(l),Ot.isAssignmentOperator(s)&&this.tracedAssignments.push(new ep(o,l,s)),typeof o!="undefined"&&(o.isVirtualGroupMember=!0),typeof l!="undefined"&&(l.isVirtualGroupMember=!0),s.isVirtualGroupMember=!0;let u=new We;u.nodes=a,u.nodes.push(s),u.nodes.push(l),i+=1,n.push(u);continue}else n.push(s)}return n}applyOperationOrder(e){return e=this.groupNodesByType(e,fi),e=this.groupNodesByType(e,Xn),e=this.groupNodesByType(e,zn),e=this.groupNodesByType(e,Kn),e=this.groupNodesByType(e,Cn),e}createLogicGroupsToRemoveMethodInvocationAmbiguity(e){let n=[],r=e.length,i=r-1;for(let s=0;s0&&e[0]instanceof We){let a=this.unpack(e[0].nodes),o=this.makeArgGroup(a),l=new ba;if(l.nameNode=n,l.methodStyleArguments=o,e.length>1)for(let u=1;u=i)return e[a].pushError(W.makeSyntaxError(A.TYPE_MODIFIER_UNEXPECTED_END_OF_VALUE_LIST,e[a],"Unexpected end of modifier value list while parsing modifier.")),e;let o=e[a+1];if(this.isValidModifierValue(o)){if(o instanceof Ne)if(o.variableReference!=null&&o.variableReference.pathParts.length>0)o.variableReference.pathParts.forEach(l=>{if(l instanceof Yn){let u=new $t;u.startPosition=l.startPosition,u.endPosition=l.endPosition,u.value=l.name,u.name=l.name,u.originalAbstractNode=l,u.endPosition==null&&u.startPosition==null&&(u.startPosition=o.startPosition,u.endPosition=o.endPosition),r.push(u)}});else{let l=new $t;l.startPosition=o.startPosition,l.endPosition=o.endPosition,l.value=o.name,l.name=o.name,l.originalAbstractNode=o,r.push(l)}else r.push(o);a+=1;continue}else return o.pushError(W.makeSyntaxError(A.TYPE_MODIFIER_UNEXPECTED_VALUE,o,"Unexpected ["+ee.getPrettyTypeName(o)+"] while parsing modifier value.")),e}let s=new ba;return s.nameNode=n,s.valueNodes=r,s.startPosition=s.nameNode.startPosition,s.valueNodes.length>0?s.endPosition=s.valueNodes[s.valueNodes.length-1].endPosition:s.endPosition=s.nameNode.endPosition,s}scanToEndOfModifier(e){let n=[],r=e.length;for(let i=0;i1)break}if(s instanceof Et||s instanceof Ne||s instanceof Bt){let a=n.length;if(a>0&&n[a-1]instanceof We)break}if(s instanceof Pn||s instanceof Ht||s instanceof en||s instanceof kn||s instanceof mr||s instanceof Ii||s instanceof Br||s instanceof qr||s instanceof Vr||s instanceof jr||s instanceof Ur||s instanceof Wr||s instanceof gr||s instanceof Hr||s instanceof hi||s instanceof _r||s instanceof mi||s instanceof Gr||s instanceof Qi||s instanceof tn||s instanceof cn)break;n.push(s)}return n}static isAssignmentOperatorNode(e){return e instanceof Lr||e instanceof Fr||e instanceof Qn||e instanceof kr||e instanceof Mr||e instanceof Cn}insertAutomaticStatementSeparators(e){let n=e.length,r=[];for(let i=0;i=r){let a=new Mt;a.nodes=i,n.push(a);break}return n}findLogicalGroupEnd(e,n){let r=[],i=n.length,s=null,a=0,o=0;for(o;o=i)return c.pushError(W.makeSyntaxError(A.TYPE_UNEXPECTED_EOI_WHILE_PARSING_LOGIC_GROUP_END,c,"Unexpected end of input while parsing input text.")),{found:!1,logicalGroup:null,skipCount:a};let f=this.findLogicalGroupEnd(c,n.slice(o+1));if(f.found){f.logicalGroup!=null&&r.push(f.logicalGroup),a+=f.skipCount,o+=f.skipCount;continue}else continue}else r.push(c)}if(s==null)return e.pushError(W.makeSyntaxError(A.TYPE_LOGIC_GROUP_NO_END,e,"Unexpected end of input while parsing logic group.")),{found:!1,logicalGroup:null,skipCount:a};let l=new Ot;l.setIsRoot(!1);let u=new We;if(r.length>=2&&r[1]instanceof Sn){if(u=new yr,u.scopeOperator=r[1],o+2=0&&!Ot.isAssignmentOperator(e[i]);i--){let s=e.pop();r.push(s)}if(r=r.reverse(),r.length>=3){let i=new Ot;return i.setIsRoot(!1),{collectedTokens:this.unpack(i.parse(r)),tokens:e}}return{collectedTokens:r,tokens:e}}seek(e,n){for(let r=n;r=0;s--){let a=n[s];if(Z.ctypeSpace(a)&&(i=!0),i&&(Z.ctypeAlpha(a)||Z.ctypeDigit(a)))return null;if(Z.ctypePunct(a))return a}return null}static findLeftNeighboringNextAlphaNumeric(e,n,r=4){n=n.replace(" "," ".repeat(r));let i=!1;for(let s=e-1;s>=0;s--){let a=n[s];if((Z.ctypeSpace(a)||Z.ctypePunct(a)&&a!=w.Punctuation_Underscore)&&(i=!0),i&&(Z.ctypeAlpha(a)||Z.ctypeDigit(a)))return s+1}return null}static scanWordAt(e,n,r=4){if(n=n.replace(" "," ".repeat(r)),e<0||e>n.length)return null;let i=[],s=[];for(let a=e-1;a>=0;a--){let o=n[a];if(Z.ctypePunct(o)&&o!=w.Punctuation_Underscore||Z.ctypeSpace(o))break;i.push(o)}for(let a=e;a{var l,u,c,f;o.isModifierParameter=(u=(l=xt.instance)==null?void 0:l.hasModifier(o.name))!=null?u:!1,o.isModifierParameter&&(e.modifiers.parameterModifiers.push(o),o.modifier=(f=(c=xt.instance)==null?void 0:c.getModifier(o.name))!=null?f:null,e.modifiers.modifierNames.includes(o.name)==!1&&e.modifiers.modifierNames.push(o.name))}),e.modifierChain!=null&&e.modifierChain.modifierChain.length>0){let o=null;e.modifierChain.modifierChain.forEach(l=>{var u,c;l.nameNode!=null&&(l.modifier=(c=(u=xt.instance)==null?void 0:u.getModifier(l.nameNode.content))!=null?c:null,e.modifiers.modifierNames.includes(l.nameNode.content)==!1&&e.modifiers.modifierNames.push(l.nameNode.content),l.modifier!=null&&(o=l.modifier,e.modifierChain!=null&&(e.modifierChain.lastManifestedModifier=l)))}),e.modifierChain.lastModifier=o,e.modifiers.parameterModifiers.length>0&&(e.modifiers.hasMixedModifierStyles=!0)}e.runtimeNodes.length>0&&e.runtimeNodes.forEach(o=>{if(o.modifierChain!=null&&o.modifierChain.modifierChain.length>0){let l=null;o.modifierChain.modifierChain.forEach(u=>{var c,f;u.nameNode!=null&&(u.modifier=(f=(c=xt.instance)==null?void 0:c.getModifier(u.nameNode.content))!=null?f:null,e.modifiers.modifierNames.includes(u.nameNode.content)==!1&&e.modifiers.modifierNames.push(u.nameNode.content),u.modifier!=null&&(l=u.modifier,e.modifierChain!=null&&(e.modifierChain.lastManifestedModifier=u)))}),e.modifierChain!=null&&(e.modifierChain.lastModifier=l),e.modifiers.parameterModifiers.length>0&&(e.modifiers.hasMixedModifierStyles=!0)}});let n=e.modifiers.getLastManifestedModifier();if(n!=null)if(n.name=="macro"){let o=e.modifiers.getLastManifestedModifierValue();e.manifestType=(i=(r=xt.instance)==null?void 0:r.getMacroManifestingType(o))!=null?i:""}else e.manifestType=(a=(s=xt.instance)==null?void 0:s.getProbableReturnType(n,e.isPaired()))!=null?a:""}};var v0={warnUnknownParameters:!1};var Qd=class{static validateInteger(e){return parseInt(e).toString()!==e?{isValid:!1,message:'"'+e+'" is not a valid integer.'}:{isValid:!0,message:""}}static validateBoolean(e){return e=="true"||e=="false"?{isValid:!0,message:""}:{isValid:!1,message:'"'+e+'" is not a valid value. Expecting true/false.'}}static validateParameters(e){var n,r,i,s,a;if(e.isTagNode&&((n=wt.instance)==null?void 0:n.isKnownTag(e.runtimeName()))){let o=(r=wt.instance)==null?void 0:r.findTag(e.runtimeName());if(e.hasParameters)for(let l=0;l1&&(y=". Try one of the following: "+d.join(", "))}let p='Unknown parameter name: "'+h+'"'+y;e.pushError(W.makeSyntaxError(A.LINT_UNKNOWN_PARAMETER,e,p,1))}}else if(c.validate!=null){let y=c.validate(e,u);y.length>0&&y.forEach(p=>{e.pushError(W.makeSyntaxError(A.LINT_GENERAL_INVALID_PARAMETER_CONTENTS,u,p.message,1))})}else{if(u.hasInterpolations())continue;for(let y=0;ye.index)return i}return null}getContentSubstring(e,n){return this.content.substr(e,n)}resetState(){return this.fragments=[],this.inputLen=0,this.fragmentStartIndex=[],this.fragmentOpeningIndex.clear(),this}resetIntermediateState(){this.chars=[],this.charLen=0,this.currentIndex=0,this.seedOffset=0,this.cur=null,this.next=null,this.prev=null}positionFromOffset(e,n,r=!1){let i=0,s=0;if(this.documentOffsets.has(e)){let o=this.documentOffsets.get(e);i=o.line,s=o.char}else if(this.documentOffsets.size==0)i=1,s=e+1;else{let o=null,l=null,u=null,c=null;for(let f of this.documentOffsets.keys()){if(f>=e){c!=null&&e>c?(o=u,l=c):(o=this.documentOffsets.get(f),l=f);break}u=this.documentOffsets.get(f),c=f}o==null&&(o=u,l=c),o!=null?(s=e-(l!=null?l:0),i=o.line,e<=(l!=null?l:0)?(i=o.line,s=e+1):i=o.line+1):this.lastDocumentOffsetKey!=null&&(i=this.documentOffsets.get(this.lastDocumentOffsetKey).line+1,s=e+this.lastDocumentOffsetKey)}let a=new Fn;return a.index=n,a.offset=e,a.line=i+this.shiftLine,a.char=s,a}getFragments(){return this.fragments}getFragmentsBetween(e,n){let r=[];return this.fragments.forEach(i=>{var o,l,u,c;let s=(l=(o=i.startPosition)==null?void 0:o.index)!=null?l:0,a=(c=(u=i.endPosition)==null?void 0:u.index)!=null?c:0;s>e&&ae.index)return o}return null}checkCurrentOffsets(){if(this.currentIndex>this.chars.length){this.cur=null,this.prev=null,this.next=null;return}if(this.cur=this.chars[this.currentIndex],this.prev=null,this.next=null,this.currentIndex>0&&(this.prev=this.chars[this.currentIndex-1]),this.currentIndex+1{this.chars.push(r),this.charLen+=1})}e&&this.currentIndex+1{var a;let s=(a=i.index)!=null?a:0;for(let o=0;o=l.start&&s<=l.end)return}r.push(s)}),this.fragmentStartIndex=r}setIndexRanges(e){return this.nodeIndex=e,this}fetchAt(e,n){return this.content.substr(e,n)}getFragmentsContainingStructures(){let e=[];return this.fragments.forEach(n=>{let r=n.name.toLowerCase();if(!(r!="script"&&r!="style")&&!n.isClosingFragment&&!n.isSelfClosing&&n.containsStructures){let i=this.getClosingFragmentAfter(n);i!=null&&e.push({start:n,end:i})}}),e}parse(e){if(this.resetState().processInputText(e),this.fragmentStartIndex.length==0)return[];for(let s=0;s{let a=s.name.toLowerCase();(a=="script"||a=="style")&&(s.embeddedIndex=i,this.embeddedIndexedFragments.set(i,s),i+=1),s.index=r,this.indexedFragments.set(r,s),r+=1}),this.fragments}getFragment(e){return this.indexedFragments.get(e)}getEmbeddedFragment(e){return this.embeddedIndexedFragments.has(e)?this.embeddedIndexedFragments.get(e):null}hasFragments(){return this.fragments.length>0}skipToEndOfPhp(){for(this.currentIndex;this.currentIndex0&&this.cur==w.Punctuation_LessThan||this.next==null&&this.cur!=w.Punctuation_GreaterThan)break;if(!i&&this.cur==w.Punctuation_LessThan&&this.next==w.Punctuation_ForwardSlash&&(s=!0),!i&&this.cur!=w.Punctuation_LessThan&&this.cur!=w.Punctuation_ForwardSlash&&this.cur!=w.Punctuation_GreaterThan&&r.push(this.cur),Jd(this.cur)){let a=this.currentIndex;Zd(this);let o=new $f;o.startPosition=this.positionFromOffset(a+this.seedOffset,a+this.seedOffset),o.endPosition=this.positionFromOffset(this.currentIndex+this.seedOffset,this.currentIndex+this.seedOffset),n.push(o);continue}if(this.cur==w.Punctuation_ForwardSlash&&this.next==w.Punctuation_GreaterThan){let a=new cu;a.startPosition=this.positionFromOffset(e+this.seedOffset,e+this.seedOffset),a.endPosition=this.positionFromOffset(this.currentIndex+this.seedOffset+1,this.currentIndex+this.seedOffset+1),a.parameters=n,a.isSelfClosing=!0,a.name=r.join(""),a.isClosingFragment=s,this.fragments.push(a),s?this.fragmentOpeningIndex.set(a.startPosition.index+1,1):this.fragmentOpeningIndex.set(a.startPosition.index,1);break}if(this.cur==w.Punctuation_GreaterThan){let a=new cu;a.startPosition=this.positionFromOffset(e+this.seedOffset,e+this.seedOffset),a.endPosition=this.positionFromOffset(this.currentIndex+this.seedOffset,this.currentIndex+this.seedOffset),a.parameters=n,a.name=r.join(""),a.isClosingFragment=s,this.fragments.push(a),s?this.fragmentOpeningIndex.set(a.startPosition.index+1,1):this.fragmentOpeningIndex.set(a.startPosition.index,1),a.name.toLowerCase()=="script"&&a.isClosingFragment==!1&&(this.isScript=!0);break}}}};var th=class{constructor(e,n){this.documentParser=e,this.fragmentsParser=n}doesContainFragments(e){var i,s,a,o,l;let n=(s=(i=e.endPosition)==null?void 0:i.index)!=null?s:0,r=(l=(o=(a=e.isClosedBy)==null?void 0:a.startPosition)==null?void 0:o.index)!=null?l:0;return this.fragmentsParser.getFragmentsBetween(n,r).length>0}analyze(){let e=this.documentParser.getNodes();!this.fragmentsParser.hasFragments()||(this.fragmentsParser.getFragments().forEach(n=>{let r=n.name.toLowerCase();if(n.isClosingFragment==!1&&n.isSelfClosing==!1&&(r=="script"||r=="style")){let i=this.fragmentsParser.getClosingFragmentAfter(n);if(i==null)return;n.endPosition!=null&&i.startPosition!=null&&this.documentParser.getNodesBetween(n.endPosition,i.startPosition).forEach(a=>{(a instanceof Nn||a instanceof z&&a.isClosedBy!=null)&&(n.containsStructures=!0),r=="style"?a.isInStyleTag=!0:a.isInScriptTag=!0})}}),e.forEach(n=>{var a,o,l,u,c,f;if(n instanceof gt||n.startPosition==null)return;n instanceof z&&(Hn.isConditionalStructure(n)||!n.isClosingTag)&&n.isClosedBy!=null&&(n.containsAnyFragments=this.doesContainFragments(n));let r=this.fragmentsParser.getFragmentContaining(n.startPosition);if(r==null)return;if(n.fragment=r,n.startPosition.index-((o=(a=r.startPosition)==null?void 0:a.index)!=null?o:0)<=3){n.fragmentPosition=0;return}if(r.parameters.length==0){n.fragmentPosition=2;return}let s=!1;for(let h=0;hn.startPosition.index){n.fragmentPosition=1,s=!0;break}}s||(n.fragmentPosition=2)}))}};var nh=class{static analyze(e){e.forEach(n=>{var r,i,s,a;if(n instanceof z){if(n.prev instanceof z&&n.isPaired()&&n.prev.isInlineAntlers==!0){n.isInlineAntlers=!1,n.isClosedBy!=null&&(n.isClosedBy.isInlineAntlers=!1);return}let o=!1,l=!1;if(n.next==null)o=!0;else if(n.next instanceof gt){let u=Z.getFirstLine(n.next.content);(n.next.next==null&&u.trim().length==0||Z.trimLeft(u," ").startsWith(` +{{ /if }}`,"https://statamic.dev/tags/installed")};var RR={tagName:"relate",hideFromCompletions:!0,allowsArbitraryParameters:!1,allowsContentClose:!1,injectParentScope:!1,requiresClose:!0,introducedIn:null,parameters:[]},l0=RR;var ro=[{name:"bag",description:"The error message bag to retrieve errors from.",aliases:[],acceptsVariableInterpolation:!1,allowsVariableReference:!1,expectsTypes:["string"],isDynamic:!1,isRequired:!1}];var wR={tagName:"get_errors",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,parameters:ro,introducedIn:"3.2.23",augmentScope:(t,e)=>{var n;if(t.isClosingTag)return e;if(((n=t.name)==null?void 0:n.methodPart)==null){let r=e.copy();r.addVariable({dataType:"string",introducedBy:t,name:"field",sourceName:"*internal.tag.get_errors",sourceField:{blueprintName:"*internal.tag.get_errors",displayName:"get_errors",import:null,instructionText:null,maxItems:null,name:"field",refFieldSetField:null,sets:null,type:"string"}});let i=r.copy();i.addVariable({dataType:"string",introducedBy:t,name:"message",sourceName:"*internal.tag.get_errors",sourceField:{blueprintName:"*internal.tag.get_errors",displayName:"get_errors",import:null,instructionText:null,maxItems:null,name:"message",refFieldSetField:null,sets:null,type:"string"}}),r.addScopeList("messages",i),e.addScopeList("fields",r)}else{let r=e.copy();r.addVariable({dataType:"string",introducedBy:t,name:"message",sourceName:"*internal.tag.get_errors",sourceField:{blueprintName:"*internal.tag.get_errors",displayName:"get_errors",import:null,instructionText:null,maxItems:null,name:"message",refFieldSetField:null,sets:null,type:"string"}}),e.addScopeList("messages",r)}return e},resolveDocumentation:t=>V("get_errors Tag","The `get_errors` tag can be used to retrieve form validation errors.","https://statamic.dev/tags/get_errors")},u0=wR;var OR={tagName:"get_errors:all",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,parameters:ro,introducedIn:null,augmentScope:(t,e)=>{if(t.isClosingTag)return e;let n=e.copy();return n.addVariable({dataType:"string",introducedBy:t,name:"message",sourceName:"*internal.tag.get_errors.all",sourceField:{blueprintName:"*internal.tag.get_errors.all",displayName:"get_errors:all",import:null,instructionText:null,maxItems:null,name:"message",refFieldSetField:null,sets:null,type:"string"}}),e.addScopeList("messages",n),e},resolveDocumentation:t=>V("get_errors:all Tag","The `get_errors:all` tag can be used to retrieve all form validation errors.","https://statamic.dev/tags/get_errors#list-all-validation-errors")},c0=OR;var LR={tagName:"get_error",hideFromCompletions:!1,requiresClose:!0,injectParentScope:!1,allowsArbitraryParameters:!1,allowsContentClose:!1,parameters:ro,introducedIn:null,augmentScope:(t,e)=>(t.isClosingTag||e.addVariable({dataType:"string",introducedBy:t,name:"message",sourceName:"*internal.tag.get_error",sourceField:{blueprintName:"*internal.tag.get_error",displayName:"get_error",import:null,instructionText:null,maxItems:null,name:"message",refFieldSetField:null,sets:null,type:"string"}}),e),resolveDocumentation:t=>V("get_error Tag","The `get_error` tag can be used to retrieve the first error message for a specific field.","https://statamic.dev/tags/get_errors#get-the-first-error-for-a-specific-field")},f0=LR;var FR={tagName:"set",hideFromCompletions:!0,allowsArbitraryParameters:!0,requiresClose:!1,allowsContentClose:!1,injectParentScope:!1,introducedIn:null,parameters:[]},p0=FR;var d0=je(ei());var kR={tagName:"mount_url",hideFromCompletions:!1,allowsArbitraryParameters:!0,allowsContentClose:!1,requiresClose:!1,injectParentScope:!1,introducedIn:"3.3.15",parameters:[{isRequired:!1,acceptsVariableInterpolation:!0,aliases:[],allowsVariableReference:!0,description:"The collection handle",name:"handle",isDynamic:!1,expectsTypes:["string"]}],resolveDocumentation:t=>V("mount Tag","The `mount` tag can be used to retrieve the mount URL for a given collection.",null),resovleParameterCompletionItems:(t,e)=>{var n,r,i,s;return t.name=="handle"&&((n=e.context)==null?void 0:n.parameterContext)!=null?oe(qa((s=(i=(r=e.context)==null?void 0:r.parameterContext.parameter)==null?void 0:i.getArrayValue())!=null?s:[],e.project)):null},resolveCompletionItems:t=>{let e=[];if(t.isPastTagPart==!1&&(t.leftWord=="mount_url"||t.leftWord=="/mount_url")&&t.leftChar==":"){let n=t.project.getCollectionNames();for(let r=0;rke("vite Tag","Generates Vite tags for an entrypoint.",'{{ vite src="entry/point" }}',null)},m0=MR;var BR={tagName:"nocache",requiresClose:!0,allowsArbitraryParameters:!1,allowsContentClose:!1,hideFromCompletions:!1,injectParentScope:!1,parameters:[],introducedIn:null,resolveDocumentation:t=>ke("nocache Tag","The `nocache` tag is used to mark regions of a template. These regions will continue to update even when using caching strategies such as the full or half-measure cache.",`{{ nocache }} + +{{ /nocache }}`,"https://statamic.dev/tags/nocache")},g0=BR;var _0=[wT,OT,LT,i0,s0,eT,rT,vb,zu,Vs,Xu,Ku,$u,l0,ZT,Ac,Dc,xc,Ic,Rc,Ec,p0,u0,f0,c0,t0,Fd,xb,Qu,Ju,Pb,yT,Cb,NT,vT,Nb,iT,aT,uT,mc,Sb,Ab,Eb,cT,fT,Rb,Zu,dT,_c,hT,h0,zT,Od,Sc,Ob,wb,yc,_T,Xa,Qa,bT,o0,Cc,Ja,Ya,Tc,Ha,$a,Za,Md,ml,hl,gl,Pc,Td,vd,Nd,Cd,Pd,Sd,Ad,Ed,n0,yd,_d,bd,r0,g0,kb,Mb,Bb,Xb,Qb,CT,Hb,Gb,RT,zb,kT,ac,sc,ic,rc,vc,nc,Zb,YT,ST,gd,AT,ET,IT,DT,xT,cc,Jb,pd,PT,jb,oc,TT,m0];var ds=class{constructor(){this.tags=new Map;this.parameters=new Map}reset(){this.tags.clear(),this.parameters.clear(),this.loadCoreTags()}getVisibleTagsWithDocumentation(){let e=[];return this.tags.forEach((n,r)=>{if(n.hideFromCompletions==!1){let i="";n.resolveDocumentation!=null&&(i=n.resolveDocumentation()),e.push({label:r,documentation:i})}}),e}getVisibleTagNames(){let e=[];return this.tags.forEach((n,r)=>{n.hideFromCompletions==!1&&e.push(r)}),[...new Set(e)]}getPossibleTagMethods(e){let n=[],r=e.length+1;return this.tags.forEach((i,s)=>{if(s.startsWith(e)){let a=s.substr(r).trim();a.length>0&&n.push(a)}}),[...new Set(n)]}getTagNames(){let e=[];return this.tags.forEach((n,r)=>{e.push(r)}),[...new Set(e)]}loadCoreTags(){this.registerTags(_0)}cleanTagName(e){return Ei(e,"/")}findTag(e){return this.tags.get(this.resolveTagName(e))}isKnownTag(e){return this.tags.has(this.resolveTagName(e))}isSymbolKnownTag(e){return this.isKnownTag(e.runtimeName())}resolveTagName(e){return e=this.cleanTagName(e.trim()),this.tags.has(e)||e.includes(":")&&(e=e.split(":")[0]),e}canResolveSpecialTypes(e){e=this.resolveTagName(e);let n=this.tags.get(e);return!(typeof n=="undefined"||n==null||n.resolveSpecialType==null)}resolveSpecialType(e,n,r){e=this.resolveTagName(e);let i=this.findTag(e);if(i.resolveSpecialType==null)throw new Error(e+" does not support special types.");return i.resolveSpecialType(n,r)}getCompletionItems(e){var s;let n=null,r=[],i=!0;if(e.nodesInScope.length>0&&(n=e.nodesInScope[e.nodesInScope.length-1]),e.currentNode!=null&&this.isKnownTag(e.currentNode.runtimeName())){let a=this.findTag(e.currentNode.runtimeName());if(typeof a=="undefined")return{isExclusive:!1,items:[]};let o=[];if(a.resolveCompletionItems!=null){let l=a.resolveCompletionItems(e);if(l.isExclusiveResult)return{isExclusive:!0,items:l.items};i=l.analyzeDefaults,r=r.concat(l.items)}if(e.isPastTagPart==!1){let l=this.getPossibleTagMethods(a.tagName);for(let u=0;u0&&(r=r.concat(nd(e,a.parameters)),a.tagName=="partial"&&(n==null?void 0:n.hasMethodPart()))){let l=n.getMethodNameValue();if(l.trim().length>0&&((s=cr.instance)==null?void 0:s.hasStructure())){let u=cr.instance.getStructure().findPartial(l);u!=null&&u.injectsParameters.length>0&&(r=r.concat(nd(e,u.injectsParameters)))}}for(let l=0;l0){let n=this.parameters.get(e.tagName);for(let r=0;r{e.push(r)}),e}getVariableNames(){let e=[];return this.values.forEach(n=>{e.push(n.name)}),e}getList(e){return this.lists.has(e)?this.lists.get(e):this.parentScope!=null&&this.parentScope!=this?this.parentScope.getList(e):null}hasValue(e){return this.values.has(e)}findAncestorWithList(e){return this.hasList(e)?this:this.parentScope!=null&&this.parentScope!=this?this.parentScope.findAncestorWithList(e):null}findReferenceNotIntroducedBy(e,n){if(this.hasValue(e)){let r=this.values.get(e);if(r.introducedBy!=null&&r.introducedBy!=n)return r}return this.parentScope!=null&&this.parentScope!=this?this.parentScope.findReferenceNotIntroducedBy(e,n):null}removeThroughIntroduction(e,n){if(this.values.delete(e),this.parentScope!=null){let r=this.findReferenceNotIntroducedBy(e,n);r!=null&&this.addVariable(r)}}wasIntroducedBySymbol(e,n){if(this.values.has(e)==!1)return!1;let r=this.values.get(e);return r.introducedBy!=null?r.introducedBy==n:!1}referencesArray(e){return this.values.has(e)==!1?!1:this.values.get(e).dataType=="array"}addScopeList(e,n){return this.lists.set(e,n),this}mergeAndList(e,n){let r=new Nr(this.statamicProject);return r.values=BT(n),this.lists.set(e,r),this.mergeVariableScope(n),this}mergeScope(e){return e==this||e==null?this:(typeof e.values!="undefined"&&e.values!==null&&e.values.forEach((n,r)=>{this.values.set(r,n)}),typeof e.lists!="undefined"&&e.lists!==null&&e.lists.forEach((n,r)=>{this.lists.set(r,n)}),this)}mergeVariableScope(e){for(let n=0;n0&&this.addBlueprintFields(e,r)}copy(){let e=new Nr(this.statamicProject);return e.pristine=new Map(this.pristine),e.values=new Map(this.values),e.lists=new Map(this.lists),e.parentScope=this,e}},rr=Nr;rr.generationCounter=0;function Bd(t){let e=new rr(t);return e.addVariable({dataType:"string",name:"handle",sourceField:null,sourceName:"*internal.system",introducedBy:null}),e.addVariable({dataType:"string",name:"name",sourceField:null,sourceName:"*internal.system",introducedBy:null}),e.addVariable({dataType:"string",name:"locale",sourceField:null,sourceName:"*internal.system",introducedBy:null}),e.addVariable({dataType:"string",name:"short_locale",sourceField:null,sourceName:"*internal.system",introducedBy:null}),e.addVariable({dataType:"string",name:"url",sourceField:null,sourceName:"*internal.system",introducedBy:null}),e}function b0(){let t=[];return t.push({dataType:"number",name:"response_code",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"csrf_field",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"csrf_token",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"environment",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"template",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"xml_header",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"last_segment",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"homepage",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"current_uri",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"current_url",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"amp_url",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"api_url",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"current_full_url",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"string",name:"current_template",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"boolean",name:"logged_in",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"boolean",name:"logged_out",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"boolean",name:"is_homepage",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"date",name:"now",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"date",name:"today",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"date",name:"current_date",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"array",name:"get",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"array",name:"get_post",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"array",name:"post",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t.push({dataType:"array",name:"old",sourceField:null,sourceName:"*internal.system",introducedBy:null}),t}function T0(t,e){let n=t.findParameter("paginate");if(n!=null&&(n.value.toLowerCase()=="true"||parseInt(n.value).toString()==n.value)){let r=e.makeNew(),i=e.makeNew(),s=e.makeNew(),a=e.makeNew();r.addVariable({name:"next_page",dataType:"string",sourceName:"*internal.pagination",sourceField:null,introducedBy:t}),r.addVariable({name:"prev_page",dataType:"string",sourceName:"*internal.pagination",sourceField:null,introducedBy:t}),r.addVariable({name:"total_items",dataType:"integer",sourceName:"*internal.pagination",sourceField:null,introducedBy:t}),r.addVariable({name:"total_pages",dataType:"integer",sourceName:"*internal.pagination",sourceField:null,introducedBy:t}),r.addVariable({name:"current_page",dataType:"integer",sourceName:"*internal.pagination",sourceField:null,introducedBy:t}),r.addVariable({name:"auto_links",dataType:"string",sourceName:"*internal.pagination",sourceField:null,introducedBy:t}),s.addVariable({name:"url",dataType:"string",sourceField:null,sourceName:"*internal.pagination.all",introducedBy:t}),s.addVariable({name:"page",dataType:"integer",sourceField:null,sourceName:"*internal.pagination.all",introducedBy:t}),a.addVariable({name:"first",dataType:"boolean",sourceName:"*internal.pagination.segments",sourceField:null,introducedBy:t}),a.addVariable({name:"last",dataType:"boolean",sourceName:"*internal.pagination.segments",sourceField:null,introducedBy:t}),a.addVariable({name:"slider",dataType:"boolean",sourceName:"*internal.pagination.segments",sourceField:null,introducedBy:t}),i.addScopeList("all",s),i.addScopeList("segments",a),r.addScopeList("links",i),e.addScopeList("paginate",r)}}var Hs=class{constructor(){this.fileInjections=new Map;this.project=null}updateProject(e){this.project=e}registerInjections(e,n){if(n.length==0)return;let r=[];for(let i=0;i0){let i=r[0].getMethodNameValue();if(i!=null&&this.project!=null){let s=this.project.findPartial(i);s!=null&&(this.fileInjections.has(s.documentUri)||this.fileInjections.set(s.documentUri,new Map),this.fileInjections.get(s.documentUri).set(e,r))}}}hasAvailableInjections(e){return this.fileInjections.has(e)}getScopeInjection(e,n){let r=new rr(n);return r.name="*injection*",this.fileInjections.get(e).forEach((s,a)=>{for(let o=0;o{r.addBlueprintField(null,_)}),n.addScopeList("current_user",r),((c=tg.instance)==null?void 0:c.pageScopeDisabled(this.documentUri))?this.viewDataVars!=null&&n.addScopeList("view",this.viewDataVars):this.viewDataVars!=null?n.mergeAndList("page",this.pageVars).addScopeList("view",this.viewDataVars):n.mergeAndList("page",this.pageVars);let i=null;e.length>0&&e[0].isComment&&(i=Bo(this.documentUri,e[0]));for(let _=0;_0&&(s=s.concat(i.collectionInjections)),i.blueprints.length>0&&(s=s.concat(i.blueprints)),i.variableHelper!=null&&i.variableHelper.variableName=="@page")){let _=this.statamicProject.getBlueprintField(i.variableHelper.collectionName,i.variableHelper.fieldHandle);if(_!=null)if(i.variableHelper.setHandle.length>0){if(_.sets!=null){for(let N=0;N<_.sets.length;N++)if(_.sets[N].handle==i.variableHelper.setHandle){n.addVariables(eo(e[0],_.sets[N].fields));break}}}else n.addBlueprintField(e[0],_)}if(s.length>0){for(let _=0;_0&&o.includes(N.id())&&(a.pop(),u.pop(),u.length==0&&u.push(n));let C=u[u.length-1];if(N.hasParameters){for(let L=0;L0)for(let M=0;M{ne instanceof z&&(ne.currentScope=C)})}}if(((y=wt.instance)==null?void 0:y.isKnownTag(N.getTagName()))==!1){if(N.scopeVariable=C.findReference(N.runtimeName()),_>0){let L=e[_-1];if(L.isComment&&this.ideHelperMap.has(L.id())&&!L.isClosingTag&&!N.isClosingTag){let M=this.ideHelperMap.get(L.id());if(M.variableName==N.getTagName()){let $=this.statamicProject.getBlueprintField(M.collectionName,M.fieldHandle);$!=null&&(N.scopeVariable=MT(N,$))}}}if(N.scopeVariable==null){let L=N.runtimeName().trim();if(C.hasList(L)||((p=N.currentScope)==null?void 0:p.hasListInHistory(L))){N.sourceType="array";let M=C.getList(L);if(M!=null&&M.values.size>0){let $=M.values.entries().next().value[1];N.scopeVariable={dataType:"array",introducedBy:$.introducedBy,name:L,sourceField:null,sourceName:$.sourceName}}}}else N.sourceType=lu(N.scopeVariable.dataType),N.scopeVariable.sourceField!=null&&((d=Wu.instance)==null?void 0:d.hasFieldtype(N.scopeVariable.sourceField.type))&&((g=Wu.instance)==null?void 0:g.getFieldType(N.scopeVariable.sourceField.type)).augmentScope(N,C)}if(N.hasParameters&&T0(N,C),N.modifiers!=null&&N.modifiers.hasModifiers()?N.manifestType=N.modifiers.getLastManifestedModifierRuntimeType():N.manifestType=N.sourceType,N.isClosedBy!=null&&(a.push(N.id()),o.push(N.isClosedBy.id()),C=C.copy(),u.push(C)),N.getTagName()=="scope"&&N.hasMethodPart()){let L=u[u.length-2].copy();C.addScopeList(N.getMethodNameValue(),L)}if(C.containsPath(N.runtimeName())&&(a.push(N.id()),N.isClosedBy!=null&&o.push(N.isClosedBy.id()),C=C.copy().bringListIntoMainScope(N.runtimeName()),u.push(C)),N.currentScope=C,N.getTagName()!="cache"){let L=N.findParameter("scope");L!=null&&C.canShiftScope(N.runtimeName())&&(C=C.shiftScope(N,N.runtimeName(),L.value),N.currentScope=C,u.pop(),u.push(C))}if((m=wt.instance)==null?void 0:m.isKnownTag(N.runtimeName())){let L=(b=wt.instance)==null?void 0:b.findTag(N.runtimeName());typeof L!="undefined"&&L.augmentScope!=null&&L.augmentScope(N,C)}if(N.modifierChain!=null&&N.modifierChain.modifierChain.length>0&&N.modifierChain.modifierChain.forEach(L=>{L.modifier!=null&&typeof L.modifier.augmentScope!="undefined"&&L.modifier.augmentScope!=null&&L.modifier.augmentScope(N,C)}),N.modifiers.hasParameterModifiers()&&N.modifiers.parameterModifiers.forEach(L=>{L.modifier!=null&&typeof L.modifier.augmentScope!="undefined"&&L.modifier.augmentScope!=null&&L.modifier.augmentScope(N,C)}),N.sourceType=="array"){let L=N.findParameter("chunk"),M=!0;if(N.parent!=null&&N.parent instanceof z&&qR.includes(N.parent.runtimeName())&&(M=!1),typeof L!="undefined"&&L!==null)if(N.currentScope.parentScope!=null&&(N.currentScope.parentScope.hasList(N.runtimeName())||C.referencesArray(N.runtimeName()))){let $=N.currentScope.parentScope.copy(),K=$.liftList(N.runtimeName());if(K==null&&C.referencesArray(N.runtimeName())){if(K=new rr(C.statamicProject),M){let ne=et(N);for(let re=0;re0&&N.runtimeNodes.forEach(L=>{var M;if(L instanceof Ne&&((M=N.currentScope)==null?void 0:M.hasValue(L.name))){let $=N.currentScope.findReferenceWithField(L.name);L.currentScope=N.currentScope,L.scopeName=N.scopeName,L.scopeVariable=$}}),VR.includes(N.runtimeName())&&N.runtimeNodes.length==3&&N.runtimeNodes[0]instanceof Ne&&N.runtimeNodes[1]instanceof kn&&N.runtimeNodes[2]instanceof Et&&N.runtimeNodes[0].scopeVariable!=null&&N.runtimeNodes[0].scopeVariable.sourceField!=null){let L=N.runtimeNodes[0].scopeVariable,M=N.runtimeNodes[2].value,$=L.sourceField;if($.sets!=null)for(let K=0;K<$.sets.length;K++){let ne=$.sets[K];if(ne.handle==M&&ne.fields!=null){C=C.copy(),C.addBlueprintFields(N,ne.fields),N.isClosedBy!=null&&!N.isSelfClosing&&(a.push(N.id()),o.push(N.isClosedBy.id()),u.push(C));break}}}this.lastSymbolId=N.id();let G=a.join("/");l.push(G)}}};var hs=class{};hs.globalTagEnterStack=[],hs.interpolatedVariables=[];var S0=je(uu());var qn=class{constructor(){this.name="";this.compound="";this.methodPart="";this.content="";this.cachedCompoundTagName=null}tagPartIs(e){return e=e.toLowerCase().trim(),this.name.toLowerCase().trim()==e}isCompound(){return this.methodPart==null?!1:this.methodPart.length>0}getMethodName(){return this.methodPart==""?"index":this.methodPart=="null"?"":this.methodPart}getRuntimeMethodName(){}getCompoundTagName(){if(this.cachedCompoundTagName==null){let e=this.getMethodName();this.cachedCompoundTagName=this.name,e!=null&&e!=""&&(this.cachedCompoundTagName=this.cachedCompoundTagName+":"+e)}return this.cachedCompoundTagName}};var jd=class{constructor(){this.tagNames=[];this.modifierNames=[]}getModifierNames(){var e,n;return this.modifierNames.concat((n=(e=xt.instance)==null?void 0:e.getModifierNames())!=null?n:[])}getTagNames(){var e,n;return this.tagNames.concat((n=(e=wt.instance)==null?void 0:e.getTagNames())!=null?n:[])}setTagNames(e){this.tagNames=e}setModifierNames(e){this.modifierNames=e}isTag(e){var n;return jd.alwaysLikeTag.includes(e)||((n=wt.instance)==null?void 0:n.isKnownTag(e))?!0:this.tagNames.includes(e)}isModifier(e){var n;return((n=xt.instance)==null?void 0:n.hasModifier(e))?!0:this.modifierNames.includes(e)}},io=jd;io.alwaysLikeTag=["if","endif","elseif","else","unless","elseunless"];var ao=class{static analyze(e,n){e.forEach(r=>{if(r instanceof z){if(r.pathReference!=null&&r.pathReference.isStrictVariableReference){r.isTagNode=!1;return}r.name!=null&&(r.isTagNode=n.isTag(r.name.name))}})}static analyzeNode(e){if(e.pathReference!=null&&e.pathReference.isStrictVariableReference){e.isTagNode=!1;return}ao.environmentDetails!=null&&e.name!=null&&(e.isTagNode=ao.environmentDetails.isTag(e.name.name)),e.name!=null&&(e.isConditionNode=io.alwaysLikeTag.includes(e.name.name))}static analyzeParametersForModifiers(e){e.parameters.forEach(n=>{ao.environmentDetails!=null&&(n.isModifierParameter=ao.environmentDetails.isModifier(n.name))})}},so=ao;so.environmentDetails=null;(typeof so.environmentDetails=="undefined"||so.environmentDetails==null)&&(so.environmentDetails=new io);var Ud=so;var Wd=class{static getIdentifier(e){var i;let n=new qn;n.content=e.trim();let r=e.split(":");if(r.length==1)n.name=r[0].trim(),n.methodPart=null,n.compound=n.name;else if(r.length>1){let s=(i=r.shift())!=null?i:"",a=r.join(":");n.name=s.trim(),n.methodPart=a.trim(),n.compound=n.name+":"+n.methodPart}else n.name=e.trim(),n.methodPart="";return n.name.startsWith("/")&&(n.name=n.name.substr(1),n.compound=n.compound.substr(1)),n}};var ue=class{static getPrettyTypeName(e){return e instanceof Gr?ue.TOKEN_LANG_OPERATOR:e instanceof Kn?ue.TOKEN_OP_A_ADD:e instanceof Ne?ue.TOKEN_VARIABLE:e instanceof Et?ue.TOKEN_STRING:e instanceof Bt?ue.TOKEN_NUMBER:e instanceof wr?ue.TOKEN_CONSTANT_FALSE:e instanceof hr?ue.TOKEN_CONSTANT_NULL:e instanceof Or?ue.TOKEN_CONSTANT_TRUE:e instanceof ba?ue.TOKEN_MODIFIER_NODE:e instanceof Uo?ue.TOKEN_MODIFIER_CHAIN:e instanceof Xf?ue.TOKEN_MODIFIER_PARAMETER:e instanceof zn?ue.TOKEN_OP_A_DIVIDE:e instanceof fi?ue.TOKEN_OP_A_EXPONENTIATION:e instanceof pi?ue.TOKEN_OP_A_MODULUS:e instanceof Xn?ue.TOKEN_OP_A_MULTIPLY:e instanceof Cn?ue.TOKEN_OP_A_SUBTRACT:e instanceof Lr?ue.TOKEN_ASG_ADD:e instanceof Fr?ue.TOKEN_ASG_DIVIDE:e instanceof kr?ue.TOKEN_ASG_MODULUS:e instanceof Mr?ue.TOKEN_ASG_MULTIPLY:e instanceof Qn?ue.TOKEN_ASG_ASSIGN:e instanceof di?ue.TOKEN_ASG_SUBTRACT:e instanceof kn?ue.TOKEN_CMP_EQUAL:e instanceof Wr?ue.TOKEN_CMP_SEQUAL:e instanceof mr?ue.TOKEN_CMP_GT:e instanceof Ii?ue.TOKEN_CMP_GTE:e instanceof Br?ue.TOKEN_CMP_LT:e instanceof qr?ue.TOKEN_CMP_LTE:e instanceof Vr?ue.TOKEN_CMP_NEQ:e instanceof jr?ue.TOKEN_CMP_SNEQ:e instanceof Ur?ue.TOKEN_CMP_SPACESHIP:e instanceof Di?ue.TOKEN_OP_VARIABLE_FALLBACK:e instanceof Qf?ue.TOKEN_COND_FALLBACK_GROUP:e instanceof At?ue.TOKEN_BRANCH_SEPARATOR:e instanceof Yr?ue.TOKEN_TERNARY_SEPARATOR:e instanceof en?ue.TOKEN_GROUP_BEGIN:e instanceof Ht?ue.TOKEN_GROUP_END:e instanceof Pn?ue.TOKEN_MODIFIER_SEPARATOR:e instanceof mn?ue.TOKEN_MODIFIER_NAME:e instanceof $t?ue.TOKEN_MODIFIER_VALUE:e instanceof Sn?ue.TOKEN_MODIFIER_VALUE_SEPARATOR:e instanceof Go?ue.TOKEN_NULL_COALESCE_GROUP:e instanceof Mt?ue.TOKEN_SEMANTIC_GROUP:e instanceof un?ue.TOKEN_STATEMENT_SEPARATOR:e instanceof Yo?ue.TOKEN_TERNARY_CONDITION:e instanceof gr?ue.TOKEN_OP_AND:e instanceof cn?ue.TOKEN_OP_LOGIC_NEGATION:e instanceof Hr?ue.TOKEN_OP_OR:e instanceof hi?ue.TOKEN_OP_XOR:e instanceof _r?ue.TOKEN_OP_NULL_COALESCE:e instanceof jo?ue.TOKEN_PARAM:e instanceof Yn?ue.TOKEN_PATH_ACCESSOR:e instanceof Xi?ue.TOKEN_OP_A_FACTORIAL:e instanceof dr?ue.TOKEN_RECURSIVE:e instanceof Na?ue.TOKEN_ARG_GROUP:e instanceof Rt?ue.TOKEN_ARG_SEPARATOR:e instanceof mi?ue.TOKEN_OP_STRING_CONCAT:e instanceof An?ue.TOKEN_OP_SCOPE_REASSIGNMENT:e instanceof va?ue.TOKEN_STRUCT_SWITCH_CASE:e instanceof Rs?ue.TOKEN_STRUCT_SWITCH_GROUP:e instanceof xs?ue.TOKEN_STRUCT_DIRECTION_GROUP:e instanceof yr?ue.TOKEN_STRUCT_SCOPED_LOGIC_GROUP:e instanceof We?ue.TOKEN_STRUCT_LOGIC_GROUP:e instanceof Wo?ue.TOKEN_STRUCT_VALUE_DIRECTION:e instanceof xi?ue.TOKEN_STRUCT_ARRAY:e instanceof $r?ue.TOKEN_STRUCT_T_LIST_START:e instanceof Jf?ue.TOKEN_STRUCT_TUPLE_LIST:e instanceof tn?ue.TOKEN_STRUCT_METHOD_CALL:typeof e}},ee=ue;ee.TOKEN_LANG_OPERATOR="T_LANG_OPERATOR",ee.TOKEN_VARIABLE="T_VAR",ee.TOKEN_NUMBER="T_NUMERIC",ee.TOKEN_STRING="T_STRING",ee.TOKEN_RECURSIVE="T_RECURSIVE",ee.TOKEN_CONSTANT_FALSE="T_FALSE",ee.TOKEN_CONSTANT_NULL="T_NULL",ee.TOKEN_CONSTANT_TRUE="T_TRUE",ee.TOKEN_MODIFIER_NODE="T_MODIFIER",ee.TOKEN_MODIFIER_CHAIN="T_MODIFIER_CHAIN",ee.TOKEN_MODIFIER_PARAMETER="T_MODIFIER_PARAM",ee.TOKEN_OP_A_ADD="T_AOP_ADD",ee.TOKEN_OP_A_DIVIDE="T_AOP_DIVIDE",ee.TOKEN_OP_A_EXPONENTIATION="T_AOP_EXP",ee.TOKEN_OP_A_MODULUS="T_AOP_MOD",ee.TOKEN_OP_A_MULTIPLY="T_AOP_MULTIPLY",ee.TOKEN_OP_A_SUBTRACT="T_AOP_SUBTRACT",ee.TOKEN_OP_A_FACTORIAL="T_AOP_FACTORIAL",ee.TOKEN_ASG_ADD="T_ASG_ADD",ee.TOKEN_ASG_DIVIDE="T_ASG_DIVIDE",ee.TOKEN_ASG_ASSIGN="T_ASG",ee.TOKEN_ASG_MODULUS="T_ASG_MODULUS",ee.TOKEN_ASG_MULTIPLY="T_ASG_MULTIPLY",ee.TOKEN_ASG_SUBTRACT="T_ASG_SUBTRACT",ee.TOKEN_CMP_EQUAL="T_CMP_EQ",ee.TOKEN_CMP_SEQUAL="T_CMP_SEQ",ee.TOKEN_CMP_GT="T_CMP_GT",ee.TOKEN_CMP_GTE="T_CMP_GTE",ee.TOKEN_CMP_LT="T_CMP_LT",ee.TOKEN_CMP_LTE="T_CMP_LTE",ee.TOKEN_CMP_NEQ="T_CMP_NEQ",ee.TOKEN_CMP_SNEQ="T_CMP_SNEQ",ee.TOKEN_CMP_SPACESHIP="T_CMP_SPSHP",ee.TOKEN_OP_VARIABLE_FALLBACK="T_VFBK",ee.TOKEN_COND_FALLBACK_GROUP="T_VFBK_GROUP",ee.TOKEN_BRANCH_SEPARATOR="T_BRANCH_SEPARATOR",ee.TOKEN_TERNARY_SEPARATOR="T_TERNARY_SEPARATOR",ee.TOKEN_GROUP_BEGIN="T_LOGIC_BEGIN",ee.TOKEN_GROUP_END="T_LOGIC_END",ee.TOKEN_MODIFIER_SEPARATOR="T_MODIFIER_SEPARATOR",ee.TOKEN_MODIFIER_NAME="T_MODIFIER_NAME",ee.TOKEN_MODIFIER_VALUE="T_MODIFIER_VALUE",ee.TOKEN_MODIFIER_VALUE_SEPARATOR="T_MODIFIER_VALUE_SEPARATOR",ee.TOKEN_NULL_COALESCE_GROUP="T_NULL_COALESCE_GROUP",ee.TOKEN_SEMANTIC_GROUP="T_SEMANTIC_GROUP",ee.TOKEN_STATEMENT_SEPARATOR="T_STATEMENT_SEPARATOR",ee.TOKEN_TERNARY_CONDITION="T_TERNARY_CONDITION",ee.TOKEN_OP_AND="T_AND",ee.TOKEN_OP_LOGIC_NEGATION="T_LOGIC_INVERSE",ee.TOKEN_OP_OR="T_OR",ee.TOKEN_OP_XOR="T_XOR",ee.TOKEN_OP_NULL_COALESCE="T_NULL_COALESCE",ee.TOKEN_PARAM="T_PARAM",ee.TOKEN_PATH_ACCESSOR="T_VAR_SEPARATOR",ee.TOKEN_ARG_GROUP="T_ARG_GROUP",ee.TOKEN_ARG_SEPARATOR="T_ARG_SEPARATOR",ee.TOKEN_OP_STRING_CONCAT="T_STR_CONCAT",ee.TOKEN_OP_SCOPE_REASSIGNMENT="T_SCOPE_ASSIGNMENT",ee.TOKEN_STRUCT_SWITCH_CASE="T_SWITCH_CASE",ee.TOKEN_STRUCT_SWITCH_GROUP="T_SWITCH_GROUP",ee.TOKEN_STRUCT_DIRECTION_GROUP="T_DIRECTION_GROUP",ee.TOKEN_STRUCT_VALUE_DIRECTION="T_ORDER_DIRECTION",ee.TOKEN_STRUCT_SCOPED_LOGIC_GROUP="T_SCOPED_LOGIC_GROUP",ee.TOKEN_STRUCT_LOGIC_GROUP="T_LOGIC_GROUP",ee.TOKEN_STRUCT_ARRAY="T_ARRAY",ee.TOKEN_STRUCT_T_LIST_START="T_LIST_START",ee.TOKEN_STRUCT_TUPLE_LIST="T_LIST",ee.TOKEN_STRUCT_METHOD_CALL="T_METHOD_CALL";var tt=class{static isLanguageLogicalKeyword(e){return e==this.LogicalAnd||e==this.LogicalNot||e==this.LogicalOr||e==this.LogicalXor}};tt.LogicalAnd="and",tt.LogicalNot="not",tt.LogicalOr="or",tt.LogicalXor="xor",tt.ConstTrue="true",tt.ConstFalse="false",tt.ConstNull="null",tt.ArrList="list",tt.ScopeAs="as";var Gd=class{constructor(){this.chars=[];this.inputLen=0;this.currentIndex=0;this.currentContent=[];this.rawContent=[];this.startIndex=0;this.cur=null;this.next=null;this.prev=null;this.isParsingString=!1;this.isParsingModifierName=!1;this.isInModifierParameterValue=!1;this.runtimeNodes=[];this.ignorePrevious=!1;this.lastNode=null;this.referenceParser=null;this.activeNode=null}reset(){this.ignorePrevious=!1,this.runtimeNodes=[],this.chars=[],this.inputLen=0,this.currentIndex=0,this.currentContent=[],this.rawContent=[],this.startIndex=0,this.cur=null,this.next=null,this.prev=null,this.isParsingString=!1,this.isParsingModifierName=!1,this.isInModifierParameterValue=!1,this.referenceParser=null,this.activeNode=null}checkCurrentOffsets(){this.cur=this.chars[this.currentIndex],this.prev=null,this.next=null,this.ignorePrevious?(this.prev="",this.ignorePrevious=!1):this.currentIndex>0&&(this.prev=this.chars[this.currentIndex-1]),this.currentIndex+10)||Z.ctypeAlpha(this.cur)||Z.ctypeDigit(this.cur))?!0:Z.ctypeSpace(e)?!1:this.isParsingModifierName&&(e==w.Punctuation_Minus||e==w.Punctuation_Underscore)?!0:!Z.ctypePunct(e)}isRightOfInterpolationRegion(){if(this.activeNode==null||this.referenceParser==null)return!1;let e=this.activeNode._lexerRelativeOffset(this.currentIndex);return this.referenceParser.bordersInterpolationRegion(e)}scanForwardTo(e,n=0){let r=[];for(let i=this.currentIndex+1+n;i0&&tt.isLanguageLogicalKeyword(l)&&(o=!0)}if(this.next==w.String_Terminator_SingleQuote||this.next==w.String_Terminator_DoubleQuote||this.next==null||o){this.appendContent(this.cur);let l=this.currentContent.join("");if(l.length>0){let u=l;if(this.currentContent=[],this.rawContent=[],u.trimRight().length==0){let f=this.nextNonWhitespace();if(f==w.String_Terminator_SingleQuote||f==w.String_Terminator_DoubleQuote){this.currentContent=[],this.rawContent=[];continue}}let c=new $t;c.isVirtual=!1,c.name=u,c.value=u.trimRight(),c.startPosition=e._lexerRelativeOffset(this.currentIndex-u.length),c.endPosition=e._lexerRelativeOffset(this.currentIndex),c.parent=this.activeNode,this.guardAgainstNeighboringTypesInModifier(c),this.runtimeNodes.push(c),this.lastNode=c}if(l.length==0)continue;this.currentContent=[],this.rawContent=[],this.isInModifierParameterValue=!1;continue}if(this.next==w.Punctuation_Pipe||this.next==w.Punctuation_Colon||this.next==w.RightParent){this.isInModifierParameterValue=!1,this.appendContent(this.cur);let l=0,u=!1;if(this.currentContent[0]==w.String_Terminator_SingleQuote||this.currentContent[0]==w.String_Terminator_DoubleQuote){let h=this.scanForwardTo(this.currentContent[0]);h.length>0&&(this.currentContent=this.currentContent.concat(h),l=h.length,u=!0)}let c=this.currentContent.join("");u&&(c=c.substr(1),c=c.slice(0,-1)),this.currentContent=[],this.rawContent=[];let f=new $t;f.isVirtual=!1,f.name=c,f.value=c,f.startPosition=e._lexerRelativeOffset(this.currentIndex-c.length),f.endPosition=e._lexerRelativeOffset(this.currentIndex),f.parent=this.activeNode,this.runtimeNodes.push(f),this.guardAgainstNeighboringTypesInModifier(f),this.lastNode=f,this.currentIndex+=l}else this.appendContent(this.cur);continue}if(this.isParsingString&&this.cur==i){if(this.prev==w.String_EscapeCharacter)this.appendContent(i);else{if(this.isInModifierParameterValue){let l=this.currentContent.join(""),u=new $t;u.isVirtual=!1,u.name=l,u.value=l,u.startPosition=e._lexerRelativeOffset(r!=null?r:0),u.endPosition=e._lexerRelativeOffset(this.currentIndex),u.parent=this.activeNode,this.runtimeNodes.push(u),this.guardAgainstNeighboringTypesInModifier(u),this.lastNode=u,this.currentContent=[],this.rawContent=[],this.isParsingString=!1,this.isInModifierParameterValue=!1;continue}let o=new Et;o.isVirtual=!1,o.startPosition=e._lexerRelativeOffset(r!=null?r:0),o.endPosition=e._lexerRelativeOffset(this.currentIndex),this.referenceParser!=null&&(o.sourceContent=this.referenceParser.getText(o.startPosition.index,o.endPosition.index+1)),o.parent=this.activeNode,i!=null&&(o.sourceTerminator=i),i=null,this.isParsingString=!1,o.value=this.currentContent.join(""),o.rawLexContent=this.rawContent.join("").trim(),this.currentContent=[],this.rawContent=[],this.guardAgainstNeighboringTypesInModifier(o),this.runtimeNodes.push(o),this.lastNode=o}continue}if(this.isParsingString&&this.cur==w.String_EscapeCharacter){if(this.next==w.String_EscapeCharacter){this.appendContent(w.String_EscapeCharacter),this.ignorePrevious=!0,this.currentIndex+=1;continue}else if(this.next==w.String_Terminator_SingleQuote){this.appendContent(w.String_Terminator_SingleQuote),this.currentIndex+=1;continue}else if(this.next==w.String_Terminator_DoubleQuote){this.appendContent(w.String_Terminator_DoubleQuote),this.currentIndex+=1;continue}else if(this.next=="n"){this.appendContent(` +`),this.currentIndex+=1;continue}else if(this.next=="t"){this.appendContent(" "),this.currentIndex+=1;continue}else if(this.next=="r"){this.appendContent("\r"),this.currentIndex+=1;continue}}if(this.isParsingString==!1){if(this.isValidChar(this.cur)&&this.isValidChar(this.next)==!1&&this.currentContent.length==0&&(this.appendContent(this.cur),a=!1),(this.next==null||this.isValidChar(this.next)==!1)&&this.currentContent.length>0){a&&this.appendContent(this.cur);let o=this.currentContent.join("").trim(),l=o.length,u=this.currentIndex-l,c=e._lexerRelativeOffset(u),f=e._lexerRelativeOffset(this.currentIndex);if(this.currentContent=[],this.rawContent=[],o==tt.LogicalAnd){let y=new gr;y.isVirtual=!1,y.content=tt.LogicalAnd,y.startPosition=c,y.endPosition=f,y.parent=this.activeNode,this.runtimeNodes.push(y),this.lastNode=y;continue}else if(o==tt.LogicalOr){let y=new Hr;y.isVirtual=!1,y.content=tt.LogicalOr,y.startPosition=c,y.endPosition=f,y.parent=this.activeNode,this.runtimeNodes.push(y),this.lastNode=y;continue}else if(o==tt.LogicalXor){let y=new hi;y.isVirtual=!1,y.content=tt.LogicalXor,y.startPosition=c,y.endPosition=f,y.parent=this.activeNode,this.runtimeNodes.push(y),this.lastNode=y;continue}else if(o==tt.ConstNull){let y=new hr;y.isVirtual=!1,y.content=tt.ConstNull,y.startPosition=c,y.endPosition=f,y.parent=this.activeNode,this.runtimeNodes.push(y),this.lastNode=y;continue}else if(o==tt.ConstTrue){let y=new Or;y.isVirtual=!1,y.content=tt.ConstTrue,y.startPosition=c,y.endPosition=f,y.parent=this.activeNode,this.runtimeNodes.push(y),this.lastNode=y;continue}else if(o==tt.ConstFalse){let y=new wr;y.isVirtual=!1,y.content=tt.ConstFalse,y.startPosition=c,y.endPosition=f,y.parent=this.activeNode,this.runtimeNodes.push(y),this.lastNode=y;continue}else if(o==tt.LogicalNot){let y=new cn;y.isVirtual=!1,y.content=tt.LogicalNot,y.startPosition=c,y.endPosition=f,y.parent=this.activeNode,this.runtimeNodes.push(y),this.lastNode=y;continue}else if(o==tt.ArrList&&this.next==w.LeftParen){let y=new $r;y.isVirtual=!1,y.content=tt.ArrList,y.startPosition=c,y.endPosition=f,y.parent=this.activeNode,this.runtimeNodes.push(y),this.lastNode=y;continue}if(Z.isNumeric(o)){let y=new Bt;y.isVirtual=!1,y.startPosition=c,y.endPosition=f,y.parent=this.activeNode,o.includes(".")?y.value=parseFloat(o):y.value=parseInt(o),y.rawLexContent=o,this.guardAgainstNeighboringTypesInModifier(y),this.runtimeNodes.push(y),this.lastNode=y;continue}if(this.runtimeNodes.length>0){let y=this.runtimeNodes[this.runtimeNodes.length-1];if(y instanceof Pn){let p=new mn;p.isVirtual=!1,p.name=o,p.content=o,p.startPosition=c,p.endPosition=f,p.parent=this.activeNode,this.runtimeNodes.push(p),this.lastNode=p;continue}else if(y instanceof Sn){let p=new $t;p.isVirtual=!1,p.name=o,p.value=o,p.startPosition=c,p.endPosition=f,p.parent=this.activeNode,this.runtimeNodes.push(p),this.lastNode=p,this.isParsingModifierName=!1;continue}}let h=new Ne;h.isVirtual=!1,h.name=o,h.startPosition=c,h.endPosition=f,h.parent=this.activeNode,this.runtimeNodes.push(h),this.lastNode=h;continue}}else{this.appendContent(this.cur);continue}if(!Z.ctypeSpace(this.cur)){if(this.isParsingString==!1){if(this.cur==w.Punctuation_Equals&&this.next==w.Punctuation_GreaterThan){let o=new An;o.isVirtual=!1,o.content="=>",o.startPosition=e._lexerRelativeOffset(this.currentIndex),o.endPosition=e._lexerRelativeOffset(this.currentIndex+1),o.parent=this.activeNode,this.runtimeNodes.push(o),this.lastNode=o,this.currentContent=[],this.rawContent=[],this.currentIndex+=1;continue}if(this.cur==w.Punctuation_Comma){let o=new Rt;o.isVirtual=!1,o.content=w.Punctuation_Comma,o.startPosition=e._lexerRelativeOffset(this.currentIndex),o.endPosition=e._lexerRelativeOffset(this.currentIndex+1),o.parent=this.activeNode,this.runtimeNodes.push(o),this.lastNode=o;continue}if(this.cur==w.Punctuation_Semicolon){let o=new un;o.isVirtual=!1,o.content=w.Punctuation_Semicolon,o.startPosition=e._lexerRelativeOffset(this.currentIndex),o.endPosition=e._lexerRelativeOffset(this.currentIndex+1),o.parent=this.activeNode,this.runtimeNodes.push(o),this.lastNode=o;continue}if(this.cur==w.Punctuation_Plus){if(this.next==w.Punctuation_Equals){let l=new Lr;l.isVirtual=!1,l.content="+=",l.startPosition=e._lexerRelativeOffset(this.currentIndex),l.endPosition=e._lexerRelativeOffset(this.currentIndex+2),l.parent=this.activeNode,this.runtimeNodes.push(l),this.lastNode=l,this.currentIndex+=1;continue}let o=new Kn;o.isVirtual=!1,o.content="+",o.startPosition=e._lexerRelativeOffset(this.currentIndex),o.endPosition=e._lexerRelativeOffset(this.currentIndex+1),o.parent=this.activeNode,this.runtimeNodes.push(o),this.lastNode=o;continue}if(this.isParsingModifierName==!1&&this.cur==w.Punctuation_Minus){if(Z.ctypeDigit(this.next)&&Z.ctypeDigit(this.prev)==!1&&this.prev!=w.RightParent&&this.isRightOfInterpolationRegion()==!1){this.appendContent(this.cur);continue}if(this.next==w.Punctuation_Equals){let l=new di;l.isVirtual=!1,l.content="-=",l.startPosition=e._lexerRelativeOffset(this.currentIndex),l.endPosition=e._lexerRelativeOffset(this.currentIndex+2),l.parent=this.activeNode,this.runtimeNodes.push(l),this.lastNode=l,this.currentIndex+=1;continue}else if(this.next==w.Punctuation_GreaterThan){let l=new tn;l.isVirtual=!1,l.content="->",l.startPosition=e._lexerRelativeOffset(this.currentIndex),l.endPosition=e._lexerRelativeOffset(this.currentIndex+2),l.parent=this.activeNode,this.runtimeNodes.push(l),this.lastNode=l,this.currentIndex+=1;continue}let o=new Cn;o.isVirtual=!1,o.content="-",o.startPosition=e._lexerRelativeOffset(this.currentIndex),o.endPosition=e._lexerRelativeOffset(this.currentIndex+1),o.parent=this.activeNode,this.runtimeNodes.push(o),this.lastNode=o;continue}if(this.cur==w.Punctuation_Asterisk){if(this.next==w.Punctuation_Asterisk){let l=new fi;l.isVirtual=!1,l.content="**",l.startPosition=e._lexerRelativeOffset(this.currentIndex),l.endPosition=e._lexerRelativeOffset(this.currentIndex+2),l.parent=this.activeNode,this.runtimeNodes.push(l),this.lastNode=l,this.currentIndex+=1;continue}else if(this.next==w.Punctuation_Equals){let l=new Mr;l.isVirtual=!1,l.content="*=",l.startPosition=e._lexerRelativeOffset(this.currentIndex),l.endPosition=e._lexerRelativeOffset(this.currentIndex+2),l.parent=this.activeNode,this.runtimeNodes.push(l),this.lastNode=l,this.currentIndex+=1;continue}let o=new Xn;o.isVirtual=!1,o.content="*",o.startPosition=e._lexerRelativeOffset(this.currentIndex),o.endPosition=e._lexerRelativeOffset(this.currentIndex+1),o.parent=this.activeNode,this.runtimeNodes.push(o),this.lastNode=o;continue}if(this.cur==w.Punctuation_ForwardSlash){if(this.next==w.Punctuation_Equals){let l=new Fr;l.isVirtual=!1,l.content="/=",l.startPosition=e._lexerRelativeOffset(this.currentIndex),l.endPosition=e._lexerRelativeOffset(this.currentIndex+2),l.parent=this.activeNode,this.runtimeNodes.push(l),this.lastNode=l,this.currentIndex+=1;continue}let o=new zn;o.isVirtual=!1,o.content="/",o.startPosition=e._lexerRelativeOffset(this.currentIndex),o.endPosition=e._lexerRelativeOffset(this.currentIndex+1),o.parent=this.activeNode,this.runtimeNodes.push(o),this.lastNode=o;continue}if(this.cur==w.Punctuation_Percent){if(this.next==w.Punctuation_Equals){let l=new kr;l.isVirtual=!1,l.content="%=",l.startPosition=e._lexerRelativeOffset(this.currentIndex),l.endPosition=e._lexerRelativeOffset(this.currentIndex+2),l.parent=this.activeNode,this.runtimeNodes.push(l),this.lastNode=l,this.currentIndex+=1;continue}let o=new pi;o.isVirtual=!1,o.content="%",o.startPosition=e._lexerRelativeOffset(this.currentIndex),o.endPosition=e._lexerRelativeOffset(this.currentIndex+1),o.parent=this.activeNode,this.runtimeNodes.push(o),this.lastNode=o;continue}if(this.cur==w.Punctuation_LessThan){if(this.next==w.Punctuation_Equals){let l=null;if(this.currentIndex+2",c.startPosition=e._lexerRelativeOffset(this.currentIndex),c.endPosition=e._lexerRelativeOffset(this.currentIndex+3),c.parent=this.activeNode,this.runtimeNodes.push(c),this.lastNode=c,this.currentIndex+=2;continue}let u=new qr;u.isVirtual=!1,u.content="<=",u.startPosition=e._lexerRelativeOffset(this.currentIndex),u.endPosition=e._lexerRelativeOffset(this.currentIndex+2),u.parent=this.activeNode,this.runtimeNodes.push(u),this.lastNode=u,this.currentIndex+=1;continue}let o=new Br;o.isVirtual=!1,o.content="<",o.startPosition=e._lexerRelativeOffset(this.currentIndex),o.endPosition=e._lexerRelativeOffset(this.currentIndex+1),o.parent=this.activeNode,this.runtimeNodes.push(o),this.lastNode=o;continue}if(this.cur==w.Punctuation_GreaterThan){if(this.next==w.Punctuation_Equals){let l=new mr;l.isVirtual=!1,l.content=">=",l.startPosition=e._lexerRelativeOffset(this.currentIndex),l.endPosition=e._lexerRelativeOffset(this.currentIndex+2),l.parent=this.activeNode,this.runtimeNodes.push(l),this.lastNode=l,this.currentIndex+=1;continue}let o=new mr;o.isVirtual=!1,o.content=">",o.startPosition=e._lexerRelativeOffset(this.currentIndex),o.endPosition=e._lexerRelativeOffset(this.currentIndex+1),o.parent=this.activeNode,this.runtimeNodes.push(o),this.lastNode=o;continue}if(this.cur==w.Punctuation_Equals&&this.next!=w.Punctuation_Equals){let o=new Qn;o.isVirtual=!1,o.content="=",o.startPosition=e._lexerRelativeOffset(this.currentIndex),o.endPosition=e._lexerRelativeOffset(this.currentIndex+1),o.parent=this.activeNode,this.runtimeNodes.push(o),this.lastNode=o;continue}if(this.cur==w.Punctuation_Equals&&this.next==w.Punctuation_Equals){let o=null;if(this.currentIndex+20&&this.runtimeNodes[this.runtimeNodes.length-1]instanceof mn){let u=new Sn;u.isVirtual=!1,u.content=":",u.startPosition=e._lexerRelativeOffset(this.currentIndex),u.endPosition=e._lexerRelativeOffset(this.currentIndex+1),u.parent=this.activeNode,this.runtimeNodes.push(u),this.isInModifierParameterValue==!1?this.isInModifierParameterValue=!0:this.isInModifierParameterValue=!1;continue}let o=new At;o.isVirtual=!1,o.content=":",o.startPosition=e._lexerRelativeOffset(this.currentIndex),o.endPosition=e._lexerRelativeOffset(this.currentIndex+1),o.parent=this.activeNode,this.runtimeNodes.push(o),this.lastNode=o,this.isParsingModifierName=!1;continue}}a&&this.appendContent(this.cur)}}let s=this.runtimeNodes.length-1;for(let a=0;a0&&(o=this.runtimeNodes[a-1]),a!=s&&(l=this.runtimeNodes[a+1]);let u=this.runtimeNodes[a];u.prev=o,u.next=l}return this.runtimeNodes}};var Ut=class{constructor(){this.chars=[];this.currentIndex=0;this.lastIndex=0;this.inputLength=0;this.prev=null;this.cur=null;this.next=null;this.isParsingString=!1;this.isStringKeyPath=!1;this.antlersErrors=[];this._recusriveEntryCheck=new Map}isValidChar(e){return!(this.isParsingString==!1&&Z.ctypeSpace(e)||this.isParsingString==!1&&e==Ut.LeftBracket||this.isParsingString==!1&&e==Ut.RightBracket)}normalizePath(e){return e=e.replace(":","_"),e=e.replace(".","_"),e=e.replace("[","_"),e=e.replace("]","_"),e.replace("]","_")}getAntlersErrors(){return this.antlersErrors}mergeErrors(e){e.forEach(n=>{this.antlersErrors.push(n)})}parse(e){this.antlersErrors=[],this._recusriveEntryCheck.clear();let n=e,r=!1,i=!1,s=!1,a=!1;e.startsWith(w.AtChar)&&(s=!0,e=e.substr(1)),e.startsWith(w.Punctuation_Caret)?(a=!0,e=e.substr(1)):(e.startsWith(w.Punctuation_Dollar)&&(r=!0,e=e.substr(1)),e.startsWith(w.Punctuation_Dollar)&&(i=!0,e=e.substr(1))),this.chars=[],this.currentIndex=0,this.lastIndex=0,this.inputLength=0,this.cur=null,this.prev=null,this.next=null,this.chars=e.split(""),this.inputLength=this.chars.length,this.lastIndex=this.inputLength-1;let o=[],l=!1,u=[],c=Ut.ColonSeparator,f=!1,h=null,y=!1,p=!0;if(this.isParsingString=!1,this.inputLength==0){let m=new Ji;return m._isFromEmptyFailState=!0,m}for(this.currentIndex;this.currentIndex0&&(this.prev=this.chars[this.currentIndex-1]),this.currentIndex+10){let _=new Yn;_.name=o.join(""),_.delimiter=c,u.push(_),o=[]}if(this.next==null||Z.ctypeSpace(this.next)){this.antlersErrors.push(W.makeSyntaxError(S.TYPE_ILLEGAL_VARPATH_SPACE_RIGHT,null,"Unexpected end of input or whitespace while parsing variable accessor path."));continue}let m=this.locateEndOfAccessor();this.currentIndex=m.foundOn;let b=new Ut;if(u.push(b.parse(m.nestedContent)),this.mergeErrors(b.getAntlersErrors()),l=!0,this.currentIndex==-1){this.antlersErrors.push(W.makeSyntaxError(S.PARSER_CANNOT_PARSE_PATH_RECURSIVE,null,"Cannot parse variable path.")),l=!1;break}continue}if(this.isParsingString==!1&&this.next==Ut.RightBracket&&l){p?o.push(this.cur):p=!0;let m=new Zf;m.name=o.join(""),u.push(m),o=[],c=Ut.ColonSeparator,this.currentIndex+=1,l=!1;continue}if(this.isParsingString==!1&&(this.cur==Ut.LeftBracket||this.cur==Ut.ColonSeparator||this.cur==Ut.DotPathSeparator||this.currentIndex==this.lastIndex)){if(this.next==null||Z.ctypeSpace(this.next)){if(this.cur==Ut.ColonSeparator){if(o.length==0){this.antlersErrors.push(W.makeSyntaxError(S.TYPE_UNEXPECTED_BRANCH_SEPARATOR,null,"Unexpected [T_BRANCH_SEPARATOR] while parsing input text."));continue}this.antlersErrors.push(W.makeSyntaxError(S.TYPE_ILLEGAL_VARPATH_RIGHT,null,'Variable paths cannot end with the ":" character.'));continue}if(this.cur==Ut.LeftBracket){this.antlersErrors.push(W.makeSyntaxError(S.TYPE_ILLEGAL_VARPATH_SUBPATH_START,null,"Illegal variable sub-path start."));continue}}this.currentIndex==this.lastIndex&&this.isValidChar(this.cur)&&(p?o.push(this.cur):p=!0);let m=new Yn;m.delimiter=c,m.name=o.join(""),y&&(m.isStringVar=y,m.name=n.substr(1),m.name=m.name.slice(0,-1),y=!1),u.push(m),o=[];continue}else{o.push(this.cur);continue}}let d=u.length;if(d>0){let m=u[d-1];(m instanceof Yn||m instanceof Ji)&&(m.isFinal=!0)}let g=new Ji;return g.isStrictTagReference=a,g.isStrictVariableReference=r,g.isExplicitVariableReference=i,g.pathParts=u,g.originalContent=e,g.isVariableVariable=s,g.normalizedReference=e.replace(":","."),g}locateEndOfAccessor(){let e=[],n=1,r=-1,i="",s=!1,a=null;if(this._recusriveEntryCheck.has(this.currentIndex+1)==!1)this._recusriveEntryCheck.set(this.currentIndex+1,!0);else return{foundOn:r,nestedContent:""};for(let o=this.currentIndex+1;o0&&(c=this.chars[o-1]),o+10&&(this.prev=this.chars[this.currentIndex-1]),r==!1){if(s==!1&&(this.cur==w.String_Terminator_DoubleQuote||this.cur==w.String_Terminator_SingleQuote)){a=this.cur,s=!0,n.push(this.cur);continue}if(s&&Z.ctypeSpace(this.cur)){n.push(this.cur);continue}if(s&&this.cur==a&&this.prev!=w.String_EscapeCharacter){a=null,s=!1,n.push(this.cur);continue}if(Z.ctypeSpace(this.cur)||this.currentIndex==this.inputLen-1||this.cur==w.Punctuation_Pipe){if(n.length==0)continue;Z.ctypeSpace(this.cur)||this.cur!=w.Punctuation_Pipe&&n.push(this.cur),i=n.join(""),r=!0;break}n.push(this.cur)}let o=e.getContentRelativeStartIndex();if(e.nameStartsOn=e.relativeOffset(o,o),e.nameStartsOn!=null&&(e.nameEndsOn=e.nameStartsOn.shiftRight(i.length-1),i.includes(w.Punctuation_Colon))){let p=i.indexOf(w.Punctuation_Colon);e.nameMethodPartStartsOn=e.nameStartsOn.shiftRight(p+1)}e.name=Wd.getIdentifier(i),Ud.analyzeNode(e),e.parameters=this.getParameters(e),e.hasParameters=e.parameters.length>0,e.hasParameters&&(Ud.analyzeParametersForModifiers(e),e.resetContentCache()),e.pathReference=this.pathParser.parse(i),e.mergeErrors(this.pathParser.getAntlersErrors()),e.pathReference!=null&&e.pathReference.isStrictTagReference&&(e.name.name=e.name.name.substr(1),e.name.content=e.name.content.substr(1)),e.isClosingTag=this.canBeClosingTag(e);let l=[];e.isClosingTag==!1&&(l=this.lexer.tokenize(e,e.getContent())),e.runtimeNodes=l;let u=e.content.trim();if(Hn.isConditionalStructure(e)&&e.name.name!="else"&&l.length==0&&u!="/if"&&u!="/unless"&&u!="/endunless"&&u!="endif"&&u!="endunless"&&u!="/endif"&&e.getContent().trim().length==0&&this.pushConditionWithoutExpression(e),e.name.name=="endif"){let p=e.copyBasicDetails(),d=e.getParser();return d!=null&&p.withParser(d),p.name=new qn,p.name.name="if",p.name.compound="if",p.isClosingTag=!0,p.content=" /if ",p.originalNode=e,p}if(e.name.name=="unless"){let p=e.copyBasicDetails(),d=e.getParser();if(d!=null&&p.withParser(d),p.name=new qn,p.name.name="if",p.name.compound="if",e.isClosingTag==!1){let g=(c=e.getContent())!=null?c:"",m=" if !("+g+") ";p.content=m,p.originalNode=e,p.resetContentCache(),p.runtimeNodes=this.lexer.tokenize(p,(f=p.getContent())!=null?f:""),this.testUnlessContent(p)}else p.originalNode=e,p.content=" /if ";return p}else if(e.name.name=="elseunless"){let p=e.copyBasicDetails(),d=e.getParser();d!=null&&p.withParser(d),p.name=new qn,p.name.name="elseif",p.name.compound="elseif";let g=(h=e.getContent())!=null?h:"",m=" elseif !("+g+") ";return p.content=m,p.originalNode=e,p.resetContentCache(),p.runtimeNodes=this.lexer.tokenize(p,(y=p.getContent())!=null?y:""),this.testUnlessContent(p),p}else if(e.name.name=="endunless"){let p=e.copyBasicDetails(),d=e.getParser();return d!=null&&p.withParser(d),p.name=new qn,p.name.name="if",p.name.compound="if",p.isClosingTag=!0,p.content=" /if ",p.originalNode=e,p}return e}pushError(e){this.activeNode!=null&&this.activeNode.pushError(e)}testUnlessContent(e){var r;let n=(r=e.getContent())!=null?r:"";if(n=n.replace("!",""),n=n.replace("(",""),n=n.replace(")","").trim(),n.length==0){this.pushConditionWithoutExpression(e);return}}pushConditionWithoutExpression(e){this.pushError(W.makeSyntaxError(S.TYPE_PARSE_EMPTY_CONDITIONAL,e,"Condition structure lacks comparison expression."))}getParameters(e){var G,L,M,$,K,ne,re,ye,Ce;let n=(G=e.getContent())!=null?G:"",r=n.split(""),i=[],s=[],a=r.length,o=0;if(e.name!=null){let ae=Z.trimLeft(e.content," "),Pe=e.content.length-ae.length,ct=e.name.content.length;Pe>0?o=Pe+ct:o=ct}let l=!1,u=[],c="",f=0,h=0,y=!1,p=null,d=-1,g=-1,m=-1,b=-1,_=-1,N=-1,C='"';for(let ae=0;ae0&&(ct=r[ae-1]),l==!1&&Z.ctypeSpace(Pe)){u=[],d=-1,g=-1,m=-1,b=-1,_=-1,N=-1;continue}if(l==!1&&Pe==w.Punctuation_Equals){if(u.length>0&&(Z.ctypeAlpha(u[0])||Z.ctypeDigit(u[0])||u[0]==w.Punctuation_Colon||u[0]==w.AtChar)==!1){u=[];continue}if(ae+1>=a){this.pushError(W.makeSyntaxError(S.TYPE_UNEXPECTED_END_OF_INPUT,e,"Unexpected end of input"));continue}let Je=null;if(ae+10&&(b=ae,_=ae,c=u.join(""),f=h,l=!0,u=[]),Jt==w.String_Terminator_DoubleQuote&&(p=w.String_Terminator_DoubleQuote,C=w.String_Terminator_DoubleQuote,ae+=1),Jt==w.String_Terminator_SingleQuote&&(p=w.String_Terminator_SingleQuote,C=w.String_Terminator_SingleQuote,ae+=1);continue}if(l&&Pe==w.String_EscapeCharacter){let Je=null;if(ae+1a){this.pushError(W.makeSyntaxError(S.TYPE_UNEXPECTED_EOI_WHILE_PARSING_NODE_PARAMETER,e,"Unexpected end of input while parsing parameter content.")),ft.parent=e,s.push(ft),c="";continue}ft.endPosition=(M=e.relativePositionFromOffset(ae+1,ae+1))!=null?M:null,ft.parent=e,ft.blockPosition={start:($=e.relativeOffset(d,d))!=null?$:null,end:(K=e.relativeOffset(g,g))!=null?K:null},ft.namePosition={start:(ne=e.relativeOffset(m,m))!=null?ne:null,end:(re=e.relativeOffset(b,b))!=null?re:null},ft.valuePosition={start:(ye=e.relativeOffset(_+2,_+2))!=null?ye:null,end:(Ce=e.relativeOffset(N,N))!=null?Ce:null},s.push(ft),c="",d=-1,g=-1,m=-1,b=-1,_=-1,N=-1;continue}if(l==!1&&(Pe==w.String_Terminator_DoubleQuote||Pe==w.String_Terminator_SingleQuote)&&ae>o)break;u.push(Pe),d==-1&&(d=ae),m==-1&&(m=ae),u.length==1&&(h=ae+1)}if(p!=null){let ae=e;if(i.length>0){let Pe=i[i.length-1],ct=e.content.indexOf(Pe);if(ct>=0){let Jt=new se;Jt.startPosition=e.relativeOffset(ct-2,ct-2),Jt.endPosition=e.relativeOffset(ct+Pe.length,ct+Pe.length),ae=Jt}}this.pushError(W.makeSyntaxError(S.TYPE_UNEXPECTED_END_OF_INPUT,ae,"Unexpected string literal while parsing parameters."))}return s}};function _l(t){return t.length==0?null:t[0].startPosition}var v0=je(uu()),wc=class{static regions(){return this.noParseRegions}static clear(){this.noParseRegions.clear()}static registerNoParseContent(e){let n=v0.Md5.hashStr(e);return this.noParseRegions.set(n,e),n}};wc.noParseRegions=new Map;function Hd(t,e){let n=new Set(t),r=new Set(e),i=new Set([...n].filter(s=>r.has(s)));return Array.from(i)}var $d=class{constructor(){this.closingTagIndex=new Map;this.closingTagIndexCount=new Map;this.openTagIndexCount=new Map;this.closingTagNames=new Map;this.parentNode=null;this.stackCount=0;this.createdExecutionBranches=[];this.document=null}getClosingCandidates(e){var n,r;if((e instanceof z||e instanceof mt)&&e.isClosingTag==!1){let i=(r=(n=e.name)==null?void 0:n.compound)!=null?r:"";return i=="if"?["if","elseif","else"]:i=="elseif"?["elseif","else","if"]:i=="else"?["if"]:[i]}return[]}buildCloseIndex(e){var n,r,i;e.forEach(s=>{var a,o,l,u,c,f,h,y,p,d;if(!(s instanceof dr)&&!((s instanceof z||s instanceof mt)&&s.isSelfClosing)&&(s instanceof z||s instanceof mt)&&s.isClosingTag){this.closingTagIndex.has(this.stackCount)==!1&&this.closingTagIndex.set(this.stackCount,new Map),this.closingTagIndexCount.has(this.stackCount)==!1&&this.closingTagIndexCount.set(this.stackCount,new Map);let g=(o=(a=s.name)==null?void 0:a.compound)!=null?o:"";((l=this.closingTagIndex.get(this.stackCount))==null?void 0:l.has(g))==!1&&((u=this.closingTagIndex.get(this.stackCount))==null||u.set(g,[]),(c=this.closingTagIndexCount.get(this.stackCount))==null||c.set(g,0)),(h=(f=this.closingTagIndex.get(this.stackCount))==null?void 0:f.get(g))==null||h.push(s);let m=(p=(y=this.closingTagIndexCount.get(this.stackCount))==null?void 0:y.get(g))!=null?p:0;(d=this.closingTagIndexCount.get(this.stackCount))==null||d.set(g,m+1)}}),this.closingTagNames.has(this.stackCount)==!1&&this.closingTagNames.set(this.stackCount,[]),this.closingTagIndex.has(this.stackCount)&&(this.closingTagNames.set(this.stackCount,Array.from((r=(n=this.closingTagIndex.get(this.stackCount))==null?void 0:n.keys())!=null?r:[])),(i=this.closingTagIndex.get(this.stackCount))==null||i.forEach((s,a)=>{var u,c,f,h,y,p,d;let o=s.length;if(o==0)return;let l=s[o-1];for(let g=0;g=l.index)break;let b=(c=(u=m.name)==null?void 0:u.compound)!=null?c:"";if(m.isClosingTag==!1&&a==b&&!m.isSelfClosing){this.openTagIndexCount.has(this.stackCount)==!1&&this.openTagIndexCount.set(this.stackCount,new Map),((f=this.openTagIndexCount.get(this.stackCount))==null?void 0:f.has(a))==!1&&((h=this.openTagIndexCount.get(this.stackCount))==null||h.set(a,0));let _=(p=(y=this.openTagIndexCount.get(this.stackCount))==null?void 0:y.get(a))!=null?p:0;(d=this.openTagIndexCount.get(this.stackCount))==null||d.set(a,_+1)}}}}))}getScanForList(e){var n;if(e instanceof z||e instanceof mt){let r=(n=e.name)==null?void 0:n.compound;if(r=="else")return["if"];if(r=="elseif")return["elseif","else","if"];if(e.isClosingTag==!1){let i=this.getClosingCandidates(e),s=this.closingTagNames.get(this.stackCount);return Hd(i,s)}}return[]}canPossiblyClose(e){var n,r;if(e instanceof dr)return!1;if(e instanceof mt||e instanceof z){if(e.isComment||e.isSelfClosing)return!1;let i=(r=(n=e.name)==null?void 0:n.compound)!=null?r:"";if(i=="else"||i=="elseif")return!0;if(e.isClosingTag==!1){let s=this.getClosingCandidates(e),a=this.closingTagNames.get(this.stackCount);return Hd(s,a).length>0}}return!1}findClosingPair(e,n,r){var o,l,u,c;let i=n.runtimeNodes.length,s=e.length,a=0;for(let f=0;f=i,a+=1}continue}if(r.includes(y)&&a>0){a-=1;continue}if(a==0&&r.includes(y)){h.isOpenedBy=n,n.isClosedBy=h;break}}}else continue}}associate(e,n){var s,a,o,l,u,c,f;this.document=n;let r=[{documentNodes:e,parent:null}],i=[];for(;r.length>0;){let h=r.pop();if(h==null)continue;let y=h.documentNodes;this.parentNode=h.parent,this.stackCount+=1,this.buildCloseIndex(y),y=Hn.pairConditionals(y),y.forEach(m=>{if((m instanceof z||m instanceof mt)&&this.canPossiblyClose(m)){if(Hn.isConditionalStructure(m))return;let b=this.getScanForList(m);this.findClosingPair(y,m,b)}});let p=y.length;for(let m=0;mb.isClosedBy.index)break;if(N.parent=b,b.children.push(N),N instanceof z&&N.index==b.index){N.parent=b;break}}}y.forEach(m=>{if((m instanceof z||m instanceof mt)&&m.children.length>0){let b=[];m.children.forEach(_=>{_.parent!=null&&_.parent.index==m.index&&(_.parent=m,b.push(_))}),r.push({documentNodes:b,parent:m})}});let d=[];y.forEach(m=>{this.parentNode==null?m.parent==null&&d.push(m):m.parent==this.parentNode&&d.push(m)}),d=this.reduceConditionals(d,n);let g=new Map;y.forEach(m=>{var b,_,N,C;if((m instanceof z||m instanceof mt)&&m.isClosedBy!=null&&this.document!=null){let G=this.document.getText(((_=(b=m.endPosition)==null?void 0:b.index)!=null?_:0)+1,(C=(N=m.isClosedBy.startPosition)==null?void 0:N.index)!=null?C:0);m.runtimeContent=G}});for(let m=0;m{var N;g.has((N=_.refId)!=null?N:"")==!1&&b.push(_)}),this.parentNode.parent.children=this.cleanNodes(b)}this.stackCount<=1&&(i=d)}return this.createdExecutionBranches.length>0&&this.createdExecutionBranches.forEach(h=>{h.head!=null&&(h.nodes=h.head.children)}),i}cleanNodes(e){let n=[],r=[];for(let i=0;i$d.ForceBreakLimit){M=!1;break}if(m instanceof z||m instanceof mt){let K=this.findEndOfBranch(e.slice(g+1),m,g),ne=new Kf,re=K.tail;ne.head=m,ne.tail=re,ne.nodes=this.cleanNodes(m.children);let ye=((f=(c=m.endPosition)==null?void 0:c.offset)!=null?f:0)+1,Ce=(p=(y=(h=m.isClosedBy)==null?void 0:h.startPosition)==null?void 0:y.offset)!=null?p:0,ae=n.getText(ye,Ce);if(ne.documentText=ae,n.shouldParseChildDocument()&&(ne.childDocument=Kt.childFromText(ne.documentText,_l(ne.nodes))),re==null&&(re=ne.head.isClosedBy),re!=null&&re.startPosition!=null&&(ne.startPosition=re.startPosition),re!=null&&(ne.index=re.index),ne.nodes.length>0){let Pe=ne.nodes[ne.nodes.length-1];Pe.endPosition!=null&&(ne.endPosition=Pe.endPosition)}else re!=null&&re.endPosition!=null&&(ne.endPosition=re.endPosition);if(this.createdExecutionBranches.push(ne),_.logicBranches.push(ne),(re==null?void 0:re.isClosingTag)&&((d=re.name)==null?void 0:d.compound)=="if"){L=K.offset,M=!1;break}else re!=null&&_.chain.push(re.index),g=K.offset,re instanceof z&&(m=re)}else M=!1}if(_.logicBranches.length>0){let K=_.logicBranches[0],ne=_.logicBranches[_.logicBranches.length-1];K.startPosition!=null&&(_.startPosition=K.startPosition),ne.endPosition!=null&&(_.endPosition=ne.endPosition)}if(r.push(_),L!=null&&L==e.length)break}else r.push(m);else r.push(m)}return r}},Oc=$d;Oc.ForceBreakLimit=1e5;var Kd=class{static associateRecursiveParent(e){var n,r;for(let i=0;i=0;l-=1){let u=e[l];if(!(u instanceof gt)&&u instanceof z&&u.isClosedBy!=null){if(s.isNestedRecursive){if(u.content.trim()==((r=s.name)==null?void 0:r.name)){o=u;break}}else if(u.runtimeContent.includes(a)&&Z.substringCount(s.runtimeContent,"*recursive")==1){o=u;continue}else if(o!=null)break}}if(o==null)continue;s.isNestedRecursive?(o.hasRecursiveNode=!0,s.recursiveParent=o,o.recursiveReference=s):o.parent!=null?o.parent instanceof z&&(o.parent.hasRecursiveNode=!0,o.parent.recursiveReference=s,s.recursiveParent=o.parent):(o.hasRecursiveNode=!0,s.recursiveParent=o,o.recursiveReference=s)}}}};var oo=class{static getNearText(e){var r,i,s,a;if(e instanceof Ne)return e.name;if(e instanceof Bt)return(i=(r=e.value)==null?void 0:r.toString())!=null?i:"";if(e instanceof Et)return e.value;if(e instanceof mn)return e.name;if(e instanceof $t)return e.value;if(e instanceof $r||e instanceof hi||e instanceof hr||e instanceof Or||e instanceof wr||e instanceof cn||e instanceof Gr||e instanceof Rt||e instanceof un||e instanceof Lr||e instanceof Kn||e instanceof di||e instanceof Cn||e instanceof fi||e instanceof Mr||e instanceof Xn||e instanceof Fr||e instanceof zn||e instanceof kr||e instanceof pi||e instanceof Ur||e instanceof qr||e instanceof Br||e instanceof Ii||e instanceof mr||e instanceof Qn||e instanceof Wr||e instanceof kn||e instanceof gr||e instanceof Pn||e instanceof Hr||e instanceof jr||e instanceof Vr||e instanceof Di||e instanceof _r||e instanceof Yr||e instanceof en||e instanceof Ht||e instanceof Sn||e instanceof At||e instanceof Xi||e instanceof An||e instanceof mi||e instanceof tn)return e.content;let n="";return e instanceof z?e.originalNode!=null?n=e.originalNode.getContent():n=(a=(s=e.startPosition)==null?void 0:s.line.toString())!=null?a:"":e.originalAbstractNode!=null?n=e.originalAbstractNode.rawContent():n=e.rawContent(),n.length>15&&(n=n.substr(0,-15)),n}};var lo=class{};lo.deferredCoreLibraries=["arr","array","str","string","method","math","sys","convert","scope","stopwatch","file","path","url","request","json","datetime"];var Nt=class{};Nt.ARR_PLUCK="pluck",Nt.ARR_TAKE="take",Nt.ARR_SKIP="skip",Nt.ARR_MAKE="arr",Nt.ARR_ORDERBY="orderby",Nt.ARR_GROUPBY="groupby",Nt.ARR_MERGE="merge",Nt.QUERY_WHERE="where",Nt.STRUCT_SWITCH="switch",Nt.BITWISE_AND="bwa",Nt.BITWISE_OR="bwo",Nt.BITWISE_XOR="bxor",Nt.BITWISE_NOT="bnot",Nt.BITWISE_SHIFT_LEFT="bsl",Nt.BITWISE_SHIFT_RIGHT="bsr",Nt.operators=["pluck","take","arr","skip","orderby","groupby","merge","where","switch","bwa","bwo","bxor","bsl","bsr"];var Ot=class{constructor(){this.pathParser=new qi;this.tokens=[];this.createdVariables=[];this.createdModifierChains=[];this.createdLanguageOperators=[];this.createdArrays=[];this.tracedAssignments=[];this.mergedVariablePaths=[];this.mergedComponents=new Map;this.modifierNameMapping=new Map;this.isRealModifierSeparator=new Map;this.isRoot=!0;this.retriggerNonVirtualGroupMembers=[]}hasModifierConstruct(e){return this.modifierNameMapping.has(e)}getModifierConstruct(e){return this.modifierNameMapping.get(e)}isActualModifierSeparator(e){return this.isRealModifierSeparator.has(e)}isMergedVariableComponent(e){return this.mergedComponents.has(e)}getMergedVariable(e){return this.mergedComponents.get(e)}getMergedVariablePaths(){return this.mergedVariablePaths}getCreatedModifierChains(){return this.createdModifierChains}getCreatedLangaugeOperators(){return this.createdLanguageOperators}getCreatedArrays(){return this.createdArrays}getCreatedVariables(){return this.createdVariables}getRuntimeAssignments(){return this.tracedAssignments}getAssignedVariables(){let e=[],n=[];for(let r=0;r0&&this.retriggerNonVirtualGroupMembers.forEach(n=>{this.markAllNonVirtualAsListGroupMember(n)})),this.createSemanticGroups(this.tokens)}setIsRoot(e){return this.isRoot=e,this}validateNeighboringOperators(e){let n=e.length;for(let r=0;r=n){i.pushError(W.makeSyntaxError(S.TYPE_UNEXPECTED_OPERATOR,i,"Unexpected operator while parsing input text."));return}let s=e[r+1];if(Ot.isOperatorType(s)){s.pushError(W.makeSyntaxError(S.TYPE_OPERATOR_INVALID_ON_RIGHT,s,"Unexpected operator while parsing input text."));continue}}}}static isAssignmentOperator(e){return e instanceof Lr||e instanceof Fr||e instanceof Qn||e instanceof kr||e instanceof Mr||e instanceof di}static isOperatorType(e){return e instanceof Lr||e instanceof Fr||e instanceof Qn||e instanceof kr||e instanceof Mr||e instanceof di||e instanceof Di||e instanceof Gr||e instanceof gr||e instanceof cn||e instanceof Hr||e instanceof hi||e instanceof _r||e instanceof mi||e instanceof Kn||e instanceof zn||e instanceof fi||e instanceof pi||e instanceof Xn||e instanceof Cn||e instanceof kn||e instanceof mr||e instanceof Ii||e instanceof Br||e instanceof qr||e instanceof Vr||e instanceof jr||e instanceof Ur||e instanceof Wr}markAllNonVirtualAsListGroupMember(e){e.forEach(n=>{if(n instanceof We||n instanceof yr||n instanceof Ri){n.start!=null&&n.start.isVirtual==!1&&(n.start.isListGroupMember=!0),n.end!=null&&n.end.isVirtual==!1&&(n.end.isListGroupMember=!0),n.scopeOperator!=null&&(n.scopeOperator.isListGroupMember=!0),n.nodes.forEach(r=>{this.markAllNonVirtualAsListGroupMember([r])});return}else n instanceof Mt&&(n.separatorToken!=null&&n.separatorToken.isVirtual==!1&&(n.separatorToken.isListGroupMember=!0),this.markAllNonVirtualAsListGroupMember(n.nodes));n.isVirtual==!1&&(n.isListGroupMember=!0),n.originalAbstractNode!=null&&n.originalAbstractNode!=n&&this.markAllNonVirtualAsListGroupMember([n.originalAbstractNode])})}markAllNonVirtualAsSwitch(e){e.forEach(n=>{if(n instanceof We||n instanceof yr||n instanceof Ri){n.start!=null&&n.start.isVirtual==!1&&(n.start.isSwitchGroupMember=!0),n.end!=null&&n.end.isVirtual==!1&&(n.end.isSwitchGroupMember=!0),n.scopeOperator!=null&&(n.scopeOperator.isSwitchGroupMember=!0),n.nodes.forEach(r=>{this.markAllNonVirtualAsSwitch([r])});return}else n instanceof Mt&&(n.separatorToken!=null&&n.separatorToken.isVirtual==!1&&(n.separatorToken.isSwitchGroupMember=!0),this.markAllNonVirtualAsSwitch(n.nodes));n.isVirtual==!1&&(n.isSwitchGroupMember=!0),n.originalAbstractNode!=null&&n.originalAbstractNode!=n&&this.markAllNonVirtualAsSwitch([n.originalAbstractNode])})}validateNoDanglingLogicGroupEnds(e){e.forEach(n=>{n instanceof Ht&&n.pushError(W.makeSyntaxError(S.TYPE_LOGIC_GROUP_NO_START,n,"Unexpected [T_LOGIC_END] while parsing input text."))})}isValidModifierValue(e){return e instanceof $t||e instanceof Ne||e instanceof Or||e instanceof wr||e instanceof hr||e instanceof Bt||e instanceof Et}wrapNumberInVariable(e){var r,i,s,a;let n=new Ne;return n.startPosition=e.startPosition,n.endPosition=e.endPosition,n.name=(i=(r=e.value)==null?void 0:r.toString())!=null?i:"",n.content=(a=(s=e.value)==null?void 0:s.toString())!=null?a:"",n.originalAbstractNode=e,n.refId=e.refId,n.modifierChain=e.modifierChain,n.index=e.index,this.createdVariables.push(n),n}wrapArithmeticModifier(e,n){let r=new mn;return r.startPosition=e.startPosition,r.endPosition=e.endPosition,r.originalAbstractNode=e,r.content=n,r.name=n,r.index=e.index,r}combineVariablePaths(e){let n=[],r=e.length;for(let i=0;ir){let u="";if(i>0){let c=e[i-1];u=oo.getNearText(c)}s.pushError(W.makeSyntaxError(S.TYPE_UNEXPECTED_EOI_PARSING_BRANCH_GROUP,s,'Unexpected end of input while parsing input text near "'+u+oo.getNearText(s)+'".'));continue}let o=n[a-1],l=e[i+1];if(l instanceof Bt&<.distance(o,l)==1&&(l=this.wrapNumberInVariable(l)),o instanceof Ne&&l instanceof Ne&<.distance(o,l)==1){n.pop(),lt.mergeVarContentRight(":",s,l),lt.mergeVarRight(o,l),n.push(l),this.createdVariables.push(l),this.mergedVariablePaths.push(l),this.mergedComponents.set(s,l),this.mergedComponents.set(o,l),this.mergedComponents.set(l,l),i+=1;continue}else{n.push(s);continue}}else if(s instanceof Et&&a>0){if(i+1>=r){n.push(s);continue}let o=n[a-1],l=e[i+1];if(o instanceof Ne&&l instanceof Ne&<.distance(o,s)<=1&<.distance(s,l)<=1){n.pop(),lt.mergeVarContentLeft(s.sourceTerminator+s.value+s.sourceTerminator,s,o),lt.mergeVarContentLeft(l.name,l,o),this.createdVariables.push(o),n.push(o),this.mergedVariablePaths.push(o),this.mergedComponents.set(s,o),this.mergedComponents.set(o,o),this.mergedComponents.set(l,o),i+=1;continue}else n.push(s)}else if(s instanceof Cn&&a>0){let o=n[a-1],l=e[i+1];if(o instanceof Ne&&l instanceof Ne){let u=lt.distance(o,s),c=lt.distance(s,l);u<=1&&c<=1?(o.endPosition=l.endPosition,this.mergedComponents.set(s,o),this.mergedComponents.set(o,o),this.mergedComponents.set(l,o),i+=1):n.push(s)}else n.push(s)}else n.push(s)}return n.forEach(i=>{i instanceof Ne&&(i.variableReference=this.pathParser.parse(i.name),i.mergeErrors(this.pathParser.getAntlersErrors()))}),n}convertVarNodeToOperator(e){let n=new Gr;return n.content=e.name,n.startPosition=e.startPosition,n.endPosition=e.endPosition,n.originalAbstractNode=e,e.convertedToOperator=!0,this.createdLanguageOperators.push(n),n}convertOperatorToVarNode(e){let n=new Ne;return n.startPosition=e.startPosition,n.endPosition=e.endPosition,n.content=e.content,n.name=e.content,n.originalAbstractNode=e,this.createdVariables.push(n),n}createLanguageOperators(e){let n=e.length;for(let r=0;r=n){e[r]=this.convertOperatorToVarNode(i);continue}if(e[r+1]instanceof un){e[r]=this.convertOperatorToVarNode(i);continue}}}return e}createLogicalGroups(e){let n=[],r=e.length,i=[];for(let a=0;a0&&i.length>0){let f=i[i.length-1];if(f instanceof Bt||f instanceof Ht||f instanceof We){if(f instanceof We&&f.start instanceof cn){f.start.pushError(W.makeSyntaxError(S.TYPE_FACTORIAL_MATERIALIZED_BOOL_DETECTED,f.start,"[T_AOP_FACTORIAL] operand will always materialize boolean type."));continue}let h=new Xi;h.startPosition=o.startPosition,h.endPosition=o.endPosition,h.content="!".repeat(l),h.originalAbstractNode=o,h.repeat=l,i.push(h),l>0&&(a+=l-1);continue}}if(l%2==0){a+=l-1;continue}let u=e[a+l];if(u instanceof en){let f=a+l+1;if(f>=r){u.pushError(W.makeSyntaxError(S.TYPE_UNEXPECTED_EOI_WHILE_PARSING_LOGIC_GROUP_NEGATION_OFFSET,u,"Unexpected end of input while parsing input text."));continue}let h=this.findLogicalGroupEnd(e[a+l],e.slice(f));if(h.found){let y=h.logicalGroup,p=new We;p.start=o,p.end=y,p.nodes.push(o),p.nodes.push(y),p.startPosition=o.startPosition,p.endPosition=y.endPosition,i.push(p),a+=h.skipCount+l}continue}let c=this.resolveValueRight(e,a);c.value!=null&&i.push(c.value),a+=c.negationCount}else i.push(o)}let s=i.length;for(let a=0;a=s){o.pushError(W.makeSyntaxError(S.TYPE_UNEXPECTED_EOI_WHILE_PARSING_LOGIC_GROUP_END_DUE_TO_NEGATION,o,"Unexpected end of input while parsing input text."));continue}let l=this.findLogicalGroupEnd(o,i.slice(a+1));l.found&&l.logicalGroup!=null&&n.push(l.logicalGroup),a+=l.skipCount}else if(o instanceof Xi){if(n.length==0){o.pushError(W.makeSyntaxError(S.TYPE_UNEXPECTED_FACTORIAL_WHILE_CREATING_GROUPS,o,"Unexpected [T_AOP_FACTORIAL] while parsing input text."));continue}let l=n[n.length-1];if(!(l instanceof We)&&!(l instanceof Bt)){o.pushError(W.makeSyntaxError(S.TYPE_UNEXPECTED_FACTORIAL_OPERAND,o,"Unexpected left operand encountered for [T_AOP_FACTORIAL] while parsing input text."));continue}l=n.pop();let u=new We;u.startPosition=l.startPosition,u.endPosition=o.endPosition,u.originalAbstractNode=o,u.nodes.push(l),u.nodes.push(o),n.push(u)}else n.push(o)}return n}makeArgGroup(e){let n=new Na,r=e.length;for(let s=0;s=r){a.pushError(W.makeSyntaxError(S.TYPE_ARG_UNEXPECTED_NAMED_ARGUMENT,a,"Unexpected end of input while parsing named argument."));continue}let l=e[s+2],u=new fu;u.startPosition=a.startPosition,u.endPosition=l.endPosition,u.content=a.content+l.content,u.name=a,u.value=l,a instanceof Ne||a.pushError(W.makeSyntaxError(S.TYPE_INVALID_NAMED_ARG_IDENTIFIER,a,"Invalid type ["+ee.getPrettyTypeName(a)+"] supplied for named argument name.")),n.hasNamedArguments=!0,n.numberOfNamedArguments+=1,n.args.push(u),s+3{s instanceof fu?i=!0:i&&s.pushError(W.makeSyntaxError(S.TYPE_UNEXPECTED_UNNAMED_METHOD_ARGUMENT,s,"Unnamed arguments are not allowed to appear after a named argument."))}),n}cleanVariableForMethodInvocation(e){(e.name.startsWith(":")||e.name.startsWith("."))&&(e.name=e.name.substr(1),e.variableReference!=null&&(e.variableReference.originalContent=e.variableReference.originalContent.substr(1),e.variableReference.normalizedReference=e.variableReference.normalizedReference.substr(1)),e.startPosition!=null&&(e.startPosition.offset+=1,e.startPosition.char+=1))}reduceVariableReferenceForObjectAccessor(e){var s;let n=(s=e.variableReference)==null?void 0:s.pathParts.pop(),r=n.name,i=r.length+1;return e.name=e.name.substr(0,-i),e.variableReference!=null&&(e.variableReference.originalContent=e.variableReference.originalContent.substr(0,-i),e.variableReference.normalizedReference=e.variableReference.normalizedReference.substr(0,-i),e.variableReference.pathParts[e.variableReference.pathParts.length-1].isFinal=!0),e.endPosition!=null&&(e.endPosition.offset-=i,e.endPosition.char-=i),{accessor:r,accessorLen:i}}associateMethodCalls(e){var i,s;let n=[],r=e.length;for(let a=0;a0&&(l=n[n.length-1]),a+10&&(c.nodes[0]instanceof Mt?f=c.nodes[0].nodes:f=c.nodes);let h=new tn;if(h.startPosition=o.startPosition,l instanceof At){let y=n.pop();h.startPosition=y.startPosition}this.cleanVariableForMethodInvocation(o),h.endPosition=c.endPosition,h.args=this.makeArgGroup(f),h.method=o,l.methodTarget=h,l instanceof Ne&&l.mergeRefName.length>0&&(l.name=lt.getUnrefName(l.mergeRefName)),n.push(h),a+=1;continue}else if(o instanceof We&&l instanceof Ne&&l.variableReference!=null&&l.variableReference.pathParts.length>=2){let c=[];if(o.nodes.length>0&&(o.nodes[0]instanceof Mt?c=o.nodes[0].nodes:c=o.nodes),l.variableReference.pathParts[0]instanceof Yn&&lo.deferredCoreLibraries.includes(l.variableReference.pathParts[0].name)){let d=n.pop(),g=new Qi;g.startPosition=d.startPosition,g.endPosition=o.endPosition,g.content=d.content,g.originalAbstractNode=o;let b=((i=d.variableReference)==null?void 0:i.pathParts.shift()).name,_=(s=d.variableReference)==null?void 0:s.implodePaths();g.libraryName=b,g.methodName=_,g.arguments=this.makeArgGroup(c),n.push(g),a+=1;continue}let f=this.reduceVariableReferenceForObjectAccessor(l),h=new tn;h.startPosition=o.startPosition,h.endPosition=o.endPosition,l.methodTarget=h,l instanceof Ne&&l.mergeRefName.length>0&&(l.name=lt.getUnrefName(l.mergeRefName)),o.start!=null&&(o.start.isPartOfMethodChain=!0),o.end!=null&&(o.end.isPartOfMethodChain=!0);let y=new Ne;y.name=f.accessor,y.isPartOfMethodChain=!0;let p=this.makeArgGroup(c);if(h.startPosition!=null&&(h.startPosition.offset-=f.accessorLen,h.startPosition.char-=f.accessorLen),h.method=y,h.args=p,Z.isNumeric(l.name)){let d=n.pop();n.push(this.convertOperatorToVarNode(d))}n.push(h);continue}else if(o instanceof Ne&&l instanceof tn){if(this.cleanVariableForMethodInvocation(o),a+1>r){o.pushError(W.makeSyntaxError(S.TYPE_METHOD_CALL_MISSING_ARG_GROUP,o,"Unexpected end of input while parsing method call."));continue}let c=e[a+1];if(!(c instanceof We)){o.pushError(W.makeSyntaxError(S.TYPE_INVALID_METHOD_CALL_ARG_GROUP,o,"Unexpected ["+ee.getPrettyTypeName(c)+"] while parsing [T_METHOD_CALL]; expecting [T_ARG_GROUP]."));continue}let f=c,h=[];f.nodes.length>0&&(f.nodes[0]instanceof Mt?h=f.nodes[0].nodes:h=f.nodes);let y=new tn;y.startPosition=o.startPosition,y.endPosition=f.endPosition,y.args=this.makeArgGroup(h),y.method=o,l.methodTarget=y,n.push(y),a+=1;continue}else if(o instanceof At&&l instanceof tn){if(a+1>r){o.pushError(W.makeSyntaxError(S.TYPE_METHOD_CALL_MISSING_METHOD,o,"Unexpected end of input while parsing method call."));continue}let c=e[a+1];if(a+2>r){o.pushError(W.makeSyntaxError(S.TYPE_METHOD_CALL_MISSING_ARG_GROUP,o,"Unexpected end of input while parsing method call."));continue}let f=e[a+2];if(!(f instanceof We)){o.pushError(W.makeSyntaxError(S.TYPE_INVALID_METHOD_CALL_ARG_GROUP,o,"Unexpected ["+ee.getPrettyTypeName(f)+"] while parsing [T_METHOD_CALL]; expecting [T_ARG_GROUP]."));continue}let h=f,y=[];h.nodes.length>0&&(h.nodes[0]instanceof Mt?y=h.nodes[0].nodes:y=h.nodes);let p=new tn;p.startPosition=o.startPosition,p.endPosition=f.endPosition,p.args=this.makeArgGroup(y),p.method=c,l.methodTarget=p,n.push(p),a+=2;continue}else if(o instanceof tn){if(a+1>r){o.pushError(W.makeSyntaxError(S.TYPE_METHOD_CALL_MISSING_METHOD,o,"Unexpected end of input while parsing method call."));continue}let c=e[a+1];if(a+2>r){o.pushError(W.makeSyntaxError(S.TYPE_INVALID_METHOD_CALL_ARG_GROUP,o,"Unexpected end of input while parsing method call."));continue}let f=e[a+2];if(!(f instanceof We)){o.pushError(W.makeSyntaxError(S.TYPE_INVALID_METHOD_CALL_ARG_GROUP,o,"Unexpected ["+ee.getPrettyTypeName(f)+"] while parsing [T_METHOD_CALL]; expecting [T_ARG_GROUP]."));continue}let h=f,y=[];h.nodes.length>0&&(h.nodes[0]instanceof Mt?y=h.nodes[0].nodes:y=h.nodes);let p=this.makeArgGroup(y);if(l instanceof Ne&&lo.deferredCoreLibraries.includes(l.name)){let d=n.pop(),g=new Qi;g.startPosition=d.startPosition,g.endPosition=h.endPosition,g.libraryName=d.name,g.methodName=c.name,g.content=g.libraryName+"->"+g.methodName,g.arguments=p,l.libraryTarget=g,n.push(g),a+=2;continue}o.method=c,o.args=p,n.length>0&&(n[n.length-1].methodTarget=o),a+=2,n.push(o);continue}else n.push(o)}return n}convertVariableToStringNode(e){let n=new Et;return n.content=e.name,n.value=e.name,n.originalAbstractNode=e,n.startPosition=e.startPosition,n.endPosition=e.endPosition,n.index=e.index,n}createTupleLists(e){let n=e.length,r=[];for(let i=0;i=n){s.pushError(W.makeSyntaxError(S.TYPE_UNEXPECTED_EOI_PARSING_TUPLE_LIST,s,"Unexpected end of input while parsing tuple list."));continue}let a=e[i+1];if(!(a instanceof We)){a.pushError(W.makeSyntaxError(S.TYPE_UNEXPECTED_TYPE_FOR_TUPLE_LIST,a,"Unexpected ["+ee.getPrettyTypeName(a)+"] while parsing tuple list."));continue}let o=a;if(this.markAllNonVirtualAsListGroupMember([o]),this.retriggerNonVirtualGroupMembers.push([o]),o.nodes.length==0){o.pushError(W.makeSyntaxError(S.TYPE_MISSING_BODY_TUPLE_LIST,o,"Missing tuple list body while parsing tuple list."));continue}let u=o.nodes.shift(),c=u.nodes.length,f=[];for(let p=0;p1&&(g=!0),d.name.trim().length==0&&(g=!0)),g||!(d instanceof Ne)){o.pushError(W.makeSyntaxError(S.TYPE_INVALID_TUPLE_LIST_NAME_TYPE,o,"Invalid ["+ee.getPrettyTypeName(d)+"] name type found while parsing tuple list."));continue}let m=d;f.push(this.convertVariableToStringNode(m))}}let h=f.length;if(h==0){o.pushError(W.makeSyntaxError(S.TYPE_INVALID_MANIFESTED_NAME_GROUP,o,"Invalid Name expression produced an invalid name group while parsing tuple list."));continue}let y=new xi;this.createdArrays.push(y),y.startPosition=s.startPosition,y.endPosition=s.endPosition,o.nodes.forEach(p=>{if(!(p instanceof Mt)){p.pushError(W.makeSyntaxError(S.TYPE_INVALID_TUPLE_LIST_VALUE_TYPE_GROUP,p,"Invalid ["+ee.getPrettyTypeName(p)+"] name type found while parsing tuple list value expression."));return}let d=p,g=new xi;this.createdArrays.push(g),g.startPosition=d.startPosition;let m=[];for(let b=0;bm.length);b++){let _=m[b],N=new Ho;N.startPosition=_.startPosition,N.endPosition=_.endPosition,N.name=f[b],N.value=_,g.nodes.push(N),y.endPosition=_.endPosition,g.endPosition=_.endPosition}y.nodes.push(g)}),r.push(y),i+=1;continue}else r.push(s)}return e}makeOrderGroup(e){let n=[],r=e.length,i=0;for(let s=0;s0&&(o==null||o instanceof Rt)){i+=1;let l=new Wo;l.order=i,l.name=e[s-1],l.directionNode=a,this.isOperand(l.name)==!1&&l.name.pushError(W.makeSyntaxError(S.TYPE_INVALID_ORDER_BY_NAME_VALUE,l.name,"Invalid value or expression supplied for order by name.")),this.isOperand(l.directionNode)==!1&&l.directionNode.pushError(W.makeSyntaxError(S.TYPE_INVALID_ORDER_BY_SORT_VALUE,l.directionNode,"Invalid value or expression supplied for order by direction.")),l.startPosition=l.name.startPosition,l.endPosition=l.directionNode.endPosition,n.push(l),s+=1;continue}}return n}getValues(e){let n=new Ta,r=e.length,i=[];for(let s=0;s=r){s.pushError(W.makeSyntaxError(S.TYPE_UNEXPECTED_EOI_WHILE_PARSING_ARG_GROUP,s,"Unexpected end of input while parsing argument group."));continue}if(!(e[i+1]instanceof We)){s.pushError(W.makeSyntaxError(S.TYPE_EXPECTING_ARGUMENT_GROUP,s,"Unexpected token while parsing method call. Expecting [T_ARG_SEPARATOR] got ["+ee.getPrettyTypeName(s)+"]."));continue}let c=e[i+1],f=null;if(c.nodes.length>0){let h=c.nodes[0];f=this.makeArgGroup(h.nodes)}f==null&&(f=new Na,f.startPosition=c.startPosition,f.endPosition=c.endPosition,f.originalAbstractNode=c),u.arguments=f,n.push(u),i+=1;continue}else if(s.content==Nt.ARR_ORDERBY){if(i+1>=r){s.pushError(W.makeSyntaxError(S.TYPE_UNEXPECTED_EOI_PARSING_ORDER_GROUP,s,"Unexpected end of input while parsing order group."));continue}let a=e[i+1];if(!(a instanceof We)){a.pushError(W.makeSyntaxError(S.TYPE_EXPECTING_ORDER_GROUP_FOR_ORDER_BY_OPERAND,a,"Unexpected ["+ee.getPrettyTypeName(a)+"] while parsing order group."));continue}let l=a.nodes;l[0]instanceof Mt&&(l=l[0].nodes);let u=this.makeOrderGroup(l);u.length==0&&s.pushError(W.makeSyntaxError(S.TYPE_UNEXPECTED_EMPTY_DIRECTION_GROUP,s,"Unexpected empty [T_DIRECTION_GROUP]. Must have at least one order clause, and each property must have a direction specified."));let c=new xs;if(c.orderClauses=u,u.length>0){u[0].directionNode!=null&&(c.startPosition=u[0].directionNode.startPosition);let f=u[u.length-1].directionNode;f!=null&&(c.endPosition=f.endPosition)}n.push(s),n.push(c),i+=1;continue}else if(s.content==Nt.ARR_GROUPBY){if(i+1>=r){s.pushError(W.makeSyntaxError(S.TYPE_UNEXPECTED_EOI_WHILE_PARSING_GROUP_BY,s,"Unexpected end of input while parsing group by clause."));continue}let a=e[i+1];if(a instanceof Ri||a instanceof yr){a.pushError(W.makeSyntaxError(S.TYPE_GROUP_BY_SCOPED_GROUP_MUST_BE_ENCLOSED,a,"Type ["+ee.getPrettyTypeName(a)+"] must be enclosed with parenthesis to be used with groupby."));continue}if(!(a instanceof We)){a.pushError(W.makeSyntaxError(S.TYPE_UNEXPECTED_TOKEN_FOR_GROUP_BY,a,"Unexpected ["+ee.getPrettyTypeName(a)+"] while parsing group by."));continue}let l=a.nodes;l[0]instanceof Mt&&(l=l[0].nodes);let u=this.getValues(l);if(n.push(s),n.push(u),i+2=r){s.pushError(W.makeSyntaxError(S.TYPE_UNEXPECTED_EOI_WHILE_PARSING_SWITCH_GROUP,s,"Unexpected end of input while parsing [T_SWITCH_GROUP]."));continue}let a=e[i+1];if(!(a instanceof yr)){a.pushError(W.makeSyntaxError(S.TYPE_UNEXPECTED_TOKEN_FOR_SWITCH_GROUP,a,"Unexpected ["+ee.getPrettyTypeName(a)+"] while parsing [T_SWITCH_GROUP]."));continue}let o=a;if(this.markAllNonVirtualAsSwitch([a]),o.scope==null||!(o.scope instanceof We)){o.pushError(W.makeSyntaxError(S.TYPE_UNEXPECTED_SWITCH_START_VALUE,o,"Unexpected input while parsing [T_SWITCH_GROUP]."));continue}let l=o.scope;if(l.nodes.length==0||!(l.nodes[0]instanceof Mt)){o.pushError(W.makeSyntaxError(S.TYPE_UNEXPECTED_SWITCH_START_VALUE_NO_VALUE,o,"Unexpected input while parsing [T_SWITCH_GROUP]."));continue}let u=l.nodes[0];if(this.markAllNonVirtualAsSwitch([l]),u.nodes.length==0||!(u.nodes[0]instanceof We)){s.pushError(W.makeSyntaxError(S.TYPE_UNEXPECTED_SWITCH_START_VALUE_NO_VALUE,s,"Unexpected input while parsing [T_SWITCH_GROUP]."));continue}this.markAllNonVirtualAsSwitch([s]),this.markAllNonVirtualAsSwitch(u.nodes);let c=u.nodes;if(o.nodes.length==0&&s.pushError(W.makeSyntaxError(S.TYPE_UNEXPECTED_SWITCH_START_VALUE_NO_VALUE,s,"Unexpected input while parsing [T_SWITCH_GROUP].")),!(l.nodes[0]instanceof Mt)){s.pushError(W.makeSyntaxError(S.TYPE_UNEXPECTED_SWITCH_START_VALUE_NO_VALUE,s,"Unexpected input while parsing [T_SWITCH_GROUP]."));continue}let h=l.nodes[0];this.markAllNonVirtualAsSwitch(h.nodes);let y=h.nodes,p=new Rs,d=new We;d.nodes=c,d.startPosition=d.nodes[0].startPosition,d.endPosition=d.nodes[d.nodes.length-1].endPosition;let g=new va;g.condition=d;let m=new We;m.nodes.push(y.shift()),m.startPosition=m.nodes[0].startPosition,m.endPosition=m.nodes[m.nodes.length-1].endPosition,g.expression=m,g.startPosition=g.condition.startPosition,g.endPosition=g.expression.nodes[g.expression.nodes.length-1].endPosition,y.shift(),p.cases.push(g);let b=y.length;if(b>0){if(!(y[0]instanceof We)){s.pushError(W.makeSyntaxError(S.TYPE_PARSER_INVALID_SWITCH_TOKEN,s,"Invalid ["+ee.getPrettyTypeName(y[0])+"] while parsing case statement."));continue}for(let _=0;_=r){s.pushError(W.makeSyntaxError(S.TYPE_ARR_MAKE_MISSING_TARGET,s,"Missing target variable for arr operator."));continue}let a=e[i+1];if(!(a instanceof We)){a.pushError(W.makeSyntaxError(S.TYPE_ARR_MAKE_UNEXPECTED_TYPE,a,"Unexpected ["+ee.getPrettyTypeName(a)+"] while parsing array."));continue}let o=a instanceof yr,l=a,u=l.nodes;if(u[0]instanceof Mt&&(u=u[0].nodes),o){let y=a;u.unshift(new An),u.unshift(y.scope)}let c=this.getArrayValues(u),f=new xi;f.startPosition=s.startPosition;let h=c.values.length;h>0?f.endPosition=c.values[h-1].endPosition:f.endPosition=s.endPosition,l.end!=null&&(f.endPosition=l.end.endPosition),f.nodes=c.values,this.createdArrays.push(f),n.push(f),i+=1}else n.push(s);else n.push(s)}return n}getArrayValues(e){let n=new Ta,r=e.length,i=[];for(let s=0;s=r){o.pushError(W.makeSyntaxError(S.TYPE_ARR_MAKE_MISSING_ARR_KEY_PAIR_VALUE,o,"Missing key/pair value while parsing array."));continue}let l=e[s+2],u=new Ho;if(this.isValidArrayKeyNode(a)==!1){a.pushError(W.makeSyntaxError(S.TYPE_ARR_KEY_PAIR_INVALID_KEY_TYPE,a,"Invalid ["+ee.getPrettyTypeName(a)+"] type for key/value key."));continue}u.name=a,u.value=l,u.startPosition=a.startPosition,u.endPosition=l.endPosition,i.push(u),s+=3;continue}if(o==null||o instanceof Rt){let l=new Ho;l.value=a,l.startPosition=a.startPosition,l.endPosition=a.endPosition,i.push(l),s+=1;continue}}return n.values=i,n}isValidArrayKeyNode(e){return e instanceof Bt||e instanceof Et}associateModifiers(e){let n=[],r=e.length,i=null;for(let s=0;s=r){a.pushError(W.makeSyntaxError(S.TYPE_UNEXPECTED_EOI_WHILE_PARSING_MODIFIER_DETAILS,a,"Unexpected end of input while preparing to gather modifier details."));continue}let l=this.scanToEndOfModifier(e.slice(s+1)),u=l.length;if(u>1&&l[1]instanceof At){this.isRealModifierSeparator.set(l[1],!0);let f=l[0];f instanceof Kn?l[0]=this.wrapArithmeticModifier(f,"add"):f instanceof Cn?l[0]=this.wrapArithmeticModifier(f,"subtract"):f instanceof zn?l[0]=this.wrapArithmeticModifier(f,"divide"):f instanceof Xn?l[0]=this.wrapArithmeticModifier(f,"multiply"):f instanceof pi&&(l[0]=this.wrapArithmeticModifier(f,"mod"))}if(u==0){a.pushError(W.makeSyntaxError(S.TYPE_UNSET_MODIFIER_DETAILS,a,"Invalid or missing modifier details."));continue}if(!(l[0]instanceof mn)){a.pushError(W.makeSyntaxError(S.TYPE_MODIFIER_NAME_NOT_START_OF_DETAILS,a,"Invalid ["+ee.getPrettyTypeName(l[0])+"]; expecting [T_MODIFIER_NAME]"));continue}let c=this.createModifier(l);c.nameNode!=null&&this.modifierNameMapping.set(c.nameNode,c),s+=u,i.modifierChain.modifierChain.push(c),i.modifierChain.updateValues();continue}else n.push(a)}return n}createNullCoalescenceGroups(e){let n=[],r=e.length;for(let i=0;i=r){s.pushError(W.makeSyntaxError(S.TYPE_UNEXPECTED_EOI_WHILE_PARSING_NULL_COALESCENCE_GROUP,s,"Unexpected end of input while parsing input text."));continue}let o=e[i+1],l=new Go;l.left=a,l.right=o,n.push(l),i+=1;continue}else n.push(s)}return n}isOperand(e){return e instanceof Ne||e instanceof We||e instanceof Et||e instanceof Bt||e instanceof wr||e instanceof hr||e instanceof Or||e instanceof Qi||e instanceof xs||e instanceof Ta||e instanceof Rs||e instanceof xi}isProperMethodChainTargetStrict(e){return e instanceof We||e instanceof Et||e instanceof Bt||e instanceof wr||e instanceof hr||e instanceof Or||e instanceof Qi||e instanceof xs||e instanceof Ta||e instanceof Rs||e instanceof xi}assertOperandRight(e,n){if(n+1>e.length-1)return e[n].pushError(W.makeSyntaxError(S.TYPE_UNEXPECTED_END_OF_INPUT,e[n],"Unexpected end of input; expecting operand for operator "+ee.getPrettyTypeName(e[n])+' near "'+oo.getNearText(e[n])+'".')),!1;let r=e[n+1];return this.isOperand(r)?!0:(r.pushError(W.makeSyntaxError(S.TYPE_EXPECTING_OPERAND,e[n],"Expecting operand, found "+ee.getPrettyTypeName(r)+' near "'+oo.getNearText(e[n])+'".')),!1)}resolveValueRight(e,n){let r=null,i=0,s=null;if(e.length>0){let a=!0;for(;a;){let o=e[n];if(o instanceof cn){s=o,i+=1,n+=1,a=!1;continue}else if(this.isOperand(o)){r=o,a=!1;break}else{a=!1;break}}}if(i%2!=0){let a=new We;return a.nodes=[],s!=null&&r!=null&&(a.nodes.push(s),a.nodes.push(r)),{value:a,negationCount:i}}return{value:r,negationCount:i}}correctTypes(e){let n=[];return e.forEach(r=>{if(r instanceof Sn){let i=new At;i.startPosition=r.startPosition,i.endPosition=r.endPosition,i.originalAbstractNode=r,n.push(i)}else if(r instanceof $t){let i=new Ne;i.name=r.value,i.startPosition=r.startPosition,i.endPosition=r.endPosition,i.modifierChain=r.modifierChain,i.originalAbstractNode=r,this.createdVariables.push(i),n.push(i)}else n.push(r)}),n}createTernaryGroups(e){var i,s,a,o;let n=[],r=e.length;for(let l=0;l=r){u.pushError(W.makeSyntaxError(S.TYPE_UNEXPECTED_EOI_WHILE_PARSING_TERNARY_GROUP,u,"Unexpected end of input while parsing ternary group."));continue}let p=e.slice(l+1,y);if(p.length>1||p.length==0){u.pushError(W.makeSyntaxError(S.TYPE_TERNARY_UNEXPECTED_EXPRESSION_LENGTH,u,"Unexpected number of operations within ternary truth branch."));continue}let d=p[0],g=((a=c.foundAt)!=null?a:0)+1;if(g>=r){u.pushError(W.makeSyntaxError(S.TYPE_UNEXPECTED_EOI_WHILE_PARSING_TERNARY_GROUP_FALSE_BRANCH,u,"Unexpected end of input while parsing ternary false execution branch."));continue}let m=e[g],b=new Yo;b.head=h,b.truthBranch=d,b.falseBranch=m,n.push(b),l=((o=c.foundAt)!=null?o:0)+1;continue}else n.push(u)}return n}groupNodesByType(e,n){let r=[],i=e.length;for(let s=0;s0&&a instanceof n){let o=[],l=r.pop();if(o.push(l),!this.assertOperandRight(e,s))continue;if(s+1>=i){a.pushError(W.makeSyntaxError(S.TYPE_UNEXPECTED_EOI_WHILE_REDUCING_NEGATION_OPERATORS,a,"Unexpected end of input while parsing input text."));continue}let u=e[s+1];typeof u!="undefined"&&(u.isVirtualGroupMember=!0),typeof l!="undefined"&&(l.isVirtualGroupMember=!0),a.isVirtualGroupMember=!0;let c=new We;c.nodes=o,c.nodes.push(a),c.nodes.push(u),s+=1,r.push(c);continue}else r.push(a)}return r}flagNodeAsOperatorResolve(e){if(e instanceof We){if(e.nodes.length==0)return;this.flagNodeAsOperatorResolve(e.nodes[e.nodes.length-1])}e.isVirtualGroupOperatorResolve=!0,e.next instanceof un||(e.producesVirtualStatementTerminator=!0)}groupNodesByOperatorType(e){let n=[],r=e.length;for(let i=0;i0&&Ot.isOperatorType(s)){let a=[],o=n.pop();if(a.push(o),!this.assertOperandRight(e,i))continue;if(i+1>=r){s.pushError(W.makeSyntaxError(S.TYPE_UNEXPECTED_EOI_WHILE_REDUCING_NEGATION_OPERATORS,s,"Unexpected end of input while parsing input text."));continue}let l=e[i+1];this.flagNodeAsOperatorResolve(l),Ot.isAssignmentOperator(s)&&this.tracedAssignments.push(new ep(o,l,s)),typeof o!="undefined"&&(o.isVirtualGroupMember=!0),typeof l!="undefined"&&(l.isVirtualGroupMember=!0),s.isVirtualGroupMember=!0;let u=new We;u.nodes=a,u.nodes.push(s),u.nodes.push(l),i+=1,n.push(u);continue}else n.push(s)}return n}applyOperationOrder(e){return e=this.groupNodesByType(e,fi),e=this.groupNodesByType(e,Xn),e=this.groupNodesByType(e,zn),e=this.groupNodesByType(e,Kn),e=this.groupNodesByType(e,Cn),e}createLogicGroupsToRemoveMethodInvocationAmbiguity(e){let n=[],r=e.length,i=r-1;for(let s=0;s0&&e[0]instanceof We){let a=this.unpack(e[0].nodes),o=this.makeArgGroup(a),l=new ba;if(l.nameNode=n,l.methodStyleArguments=o,e.length>1)for(let u=1;u=i)return e[a].pushError(W.makeSyntaxError(S.TYPE_MODIFIER_UNEXPECTED_END_OF_VALUE_LIST,e[a],"Unexpected end of modifier value list while parsing modifier.")),e;let o=e[a+1];if(this.isValidModifierValue(o)){if(o instanceof Ne)if(o.variableReference!=null&&o.variableReference.pathParts.length>0)o.variableReference.pathParts.forEach(l=>{if(l instanceof Yn){let u=new $t;u.startPosition=l.startPosition,u.endPosition=l.endPosition,u.value=l.name,u.name=l.name,u.originalAbstractNode=l,u.endPosition==null&&u.startPosition==null&&(u.startPosition=o.startPosition,u.endPosition=o.endPosition),r.push(u)}});else{let l=new $t;l.startPosition=o.startPosition,l.endPosition=o.endPosition,l.value=o.name,l.name=o.name,l.originalAbstractNode=o,r.push(l)}else r.push(o);a+=1;continue}else return o.pushError(W.makeSyntaxError(S.TYPE_MODIFIER_UNEXPECTED_VALUE,o,"Unexpected ["+ee.getPrettyTypeName(o)+"] while parsing modifier value.")),e}let s=new ba;return s.nameNode=n,s.valueNodes=r,s.startPosition=s.nameNode.startPosition,s.valueNodes.length>0?s.endPosition=s.valueNodes[s.valueNodes.length-1].endPosition:s.endPosition=s.nameNode.endPosition,s}scanToEndOfModifier(e){let n=[],r=e.length;for(let i=0;i1)break}if(s instanceof Et||s instanceof Ne||s instanceof Bt){let a=n.length;if(a>0&&n[a-1]instanceof We)break}if(s instanceof Pn||s instanceof Ht||s instanceof en||s instanceof kn||s instanceof mr||s instanceof Ii||s instanceof Br||s instanceof qr||s instanceof Vr||s instanceof jr||s instanceof Ur||s instanceof Wr||s instanceof gr||s instanceof Hr||s instanceof hi||s instanceof _r||s instanceof mi||s instanceof Gr||s instanceof Qi||s instanceof tn||s instanceof cn)break;n.push(s)}return n}static isAssignmentOperatorNode(e){return e instanceof Lr||e instanceof Fr||e instanceof Qn||e instanceof kr||e instanceof Mr||e instanceof Cn}insertAutomaticStatementSeparators(e){let n=e.length,r=[];for(let i=0;i=r){let a=new Mt;a.nodes=i,n.push(a);break}return n}findLogicalGroupEnd(e,n){let r=[],i=n.length,s=null,a=0,o=0;for(o;o=i)return c.pushError(W.makeSyntaxError(S.TYPE_UNEXPECTED_EOI_WHILE_PARSING_LOGIC_GROUP_END,c,"Unexpected end of input while parsing input text.")),{found:!1,logicalGroup:null,skipCount:a};let f=this.findLogicalGroupEnd(c,n.slice(o+1));if(f.found){f.logicalGroup!=null&&r.push(f.logicalGroup),a+=f.skipCount,o+=f.skipCount;continue}else continue}else r.push(c)}if(s==null)return e.pushError(W.makeSyntaxError(S.TYPE_LOGIC_GROUP_NO_END,e,"Unexpected end of input while parsing logic group.")),{found:!1,logicalGroup:null,skipCount:a};let l=new Ot;l.setIsRoot(!1);let u=new We;if(r.length>=2&&r[1]instanceof An){if(u=new yr,u.scopeOperator=r[1],o+2=0&&!Ot.isAssignmentOperator(e[i]);i--){let s=e.pop();r.push(s)}if(r=r.reverse(),r.length>=3){let i=new Ot;return i.setIsRoot(!1),{collectedTokens:this.unpack(i.parse(r)),tokens:e}}return{collectedTokens:r,tokens:e}}seek(e,n){for(let r=n;r=0;s--){let a=n[s];if(Z.ctypeSpace(a)&&(i=!0),i&&(Z.ctypeAlpha(a)||Z.ctypeDigit(a)))return null;if(Z.ctypePunct(a))return a}return null}static findLeftNeighboringNextAlphaNumeric(e,n,r=4){n=n.replace(" "," ".repeat(r));let i=!1;for(let s=e-1;s>=0;s--){let a=n[s];if((Z.ctypeSpace(a)||Z.ctypePunct(a)&&a!=w.Punctuation_Underscore)&&(i=!0),i&&(Z.ctypeAlpha(a)||Z.ctypeDigit(a)))return s+1}return null}static scanWordAt(e,n,r=4){if(n=n.replace(" "," ".repeat(r)),e<0||e>n.length)return null;let i=[],s=[];for(let a=e-1;a>=0;a--){let o=n[a];if(Z.ctypePunct(o)&&o!=w.Punctuation_Underscore||Z.ctypeSpace(o))break;i.push(o)}for(let a=e;a{var l,u,c,f;o.isModifierParameter=(u=(l=xt.instance)==null?void 0:l.hasModifier(o.name))!=null?u:!1,o.isModifierParameter&&(e.modifiers.parameterModifiers.push(o),o.modifier=(f=(c=xt.instance)==null?void 0:c.getModifier(o.name))!=null?f:null,e.modifiers.modifierNames.includes(o.name)==!1&&e.modifiers.modifierNames.push(o.name))}),e.modifierChain!=null&&e.modifierChain.modifierChain.length>0){let o=null;e.modifierChain.modifierChain.forEach(l=>{var u,c;l.nameNode!=null&&(l.modifier=(c=(u=xt.instance)==null?void 0:u.getModifier(l.nameNode.content))!=null?c:null,e.modifiers.modifierNames.includes(l.nameNode.content)==!1&&e.modifiers.modifierNames.push(l.nameNode.content),l.modifier!=null&&(o=l.modifier,e.modifierChain!=null&&(e.modifierChain.lastManifestedModifier=l)))}),e.modifierChain.lastModifier=o,e.modifiers.parameterModifiers.length>0&&(e.modifiers.hasMixedModifierStyles=!0)}e.runtimeNodes.length>0&&e.runtimeNodes.forEach(o=>{if(o.modifierChain!=null&&o.modifierChain.modifierChain.length>0){let l=null;o.modifierChain.modifierChain.forEach(u=>{var c,f;u.nameNode!=null&&(u.modifier=(f=(c=xt.instance)==null?void 0:c.getModifier(u.nameNode.content))!=null?f:null,e.modifiers.modifierNames.includes(u.nameNode.content)==!1&&e.modifiers.modifierNames.push(u.nameNode.content),u.modifier!=null&&(l=u.modifier,e.modifierChain!=null&&(e.modifierChain.lastManifestedModifier=u)))}),e.modifierChain!=null&&(e.modifierChain.lastModifier=l),e.modifiers.parameterModifiers.length>0&&(e.modifiers.hasMixedModifierStyles=!0)}});let n=e.modifiers.getLastManifestedModifier();if(n!=null)if(n.name=="macro"){let o=e.modifiers.getLastManifestedModifierValue();e.manifestType=(i=(r=xt.instance)==null?void 0:r.getMacroManifestingType(o))!=null?i:""}else e.manifestType=(a=(s=xt.instance)==null?void 0:s.getProbableReturnType(n,e.isPaired()))!=null?a:""}};var N0={warnUnknownParameters:!1};var Qd=class{static validateInteger(e){return parseInt(e).toString()!==e?{isValid:!1,message:'"'+e+'" is not a valid integer.'}:{isValid:!0,message:""}}static validateBoolean(e){return e=="true"||e=="false"?{isValid:!0,message:""}:{isValid:!1,message:'"'+e+'" is not a valid value. Expecting true/false.'}}static validateParameters(e){var n,r,i,s,a;if(e.isTagNode&&((n=wt.instance)==null?void 0:n.isKnownTag(e.runtimeName()))){let o=(r=wt.instance)==null?void 0:r.findTag(e.runtimeName());if(e.hasParameters)for(let l=0;l1&&(y=". Try one of the following: "+d.join(", "))}let p='Unknown parameter name: "'+h+'"'+y;e.pushError(W.makeSyntaxError(S.LINT_UNKNOWN_PARAMETER,e,p,1))}}else if(c.validate!=null){let y=c.validate(e,u);y.length>0&&y.forEach(p=>{e.pushError(W.makeSyntaxError(S.LINT_GENERAL_INVALID_PARAMETER_CONTENTS,u,p.message,1))})}else{if(u.hasInterpolations())continue;for(let y=0;ye.index)return i}return null}getContentSubstring(e,n){return this.content.substr(e,n)}resetState(){return this.fragments=[],this.inputLen=0,this.fragmentStartIndex=[],this.fragmentOpeningIndex.clear(),this}resetIntermediateState(){this.chars=[],this.charLen=0,this.currentIndex=0,this.seedOffset=0,this.cur=null,this.next=null,this.prev=null}positionFromOffset(e,n,r=!1){let i=0,s=0;if(this.documentOffsets.has(e)){let o=this.documentOffsets.get(e);i=o.line,s=o.char}else if(this.documentOffsets.size==0)i=1,s=e+1;else{let o=null,l=null,u=null,c=null;for(let f of this.documentOffsets.keys()){if(f>=e){c!=null&&e>c?(o=u,l=c):(o=this.documentOffsets.get(f),l=f);break}u=this.documentOffsets.get(f),c=f}o==null&&(o=u,l=c),o!=null?(s=e-(l!=null?l:0),i=o.line,e<=(l!=null?l:0)?(i=o.line,s=e+1):i=o.line+1):this.lastDocumentOffsetKey!=null&&(i=this.documentOffsets.get(this.lastDocumentOffsetKey).line+1,s=e+this.lastDocumentOffsetKey)}let a=new Fn;return a.index=n,a.offset=e,a.line=i+this.shiftLine,a.char=s,a}getFragments(){return this.fragments}getFragmentsBetween(e,n){let r=[];return this.fragments.forEach(i=>{var o,l,u,c;let s=(l=(o=i.startPosition)==null?void 0:o.index)!=null?l:0,a=(c=(u=i.endPosition)==null?void 0:u.index)!=null?c:0;s>e&&ae.index)return o}return null}checkCurrentOffsets(){if(this.currentIndex>this.chars.length){this.cur=null,this.prev=null,this.next=null;return}if(this.cur=this.chars[this.currentIndex],this.prev=null,this.next=null,this.currentIndex>0&&(this.prev=this.chars[this.currentIndex-1]),this.currentIndex+1{this.chars.push(r),this.charLen+=1})}e&&this.currentIndex+1{var a;let s=(a=i.index)!=null?a:0;for(let o=0;o=l.start&&s<=l.end)return}r.push(s)}),this.fragmentStartIndex=r}setIndexRanges(e){return this.nodeIndex=e,this}fetchAt(e,n){return this.content.substr(e,n)}getFragmentsContainingStructures(){let e=[];return this.fragments.forEach(n=>{let r=n.name.toLowerCase();if(!(r!="script"&&r!="style")&&!n.isClosingFragment&&!n.isSelfClosing&&n.containsStructures){let i=this.getClosingFragmentAfter(n);i!=null&&e.push({start:n,end:i})}}),e}parse(e){if(this.resetState().processInputText(e),this.fragmentStartIndex.length==0)return[];for(let s=0;s{let a=s.name.toLowerCase();(a=="script"||a=="style")&&(s.embeddedIndex=i,this.embeddedIndexedFragments.set(i,s),i+=1),s.index=r,this.indexedFragments.set(r,s),r+=1}),this.fragments}getFragment(e){return this.indexedFragments.get(e)}getEmbeddedFragment(e){return this.embeddedIndexedFragments.has(e)?this.embeddedIndexedFragments.get(e):null}hasFragments(){return this.fragments.length>0}skipToEndOfPhp(){for(this.currentIndex;this.currentIndex0&&this.cur==w.Punctuation_LessThan||this.next==null&&this.cur!=w.Punctuation_GreaterThan)break;if(!i&&this.cur==w.Punctuation_LessThan&&this.next==w.Punctuation_ForwardSlash&&(s=!0),!i&&this.cur!=w.Punctuation_LessThan&&this.cur!=w.Punctuation_ForwardSlash&&this.cur!=w.Punctuation_GreaterThan&&r.push(this.cur),Jd(this.cur)){let a=this.currentIndex;Zd(this);let o=new $f;o.startPosition=this.positionFromOffset(a+this.seedOffset,a+this.seedOffset),o.endPosition=this.positionFromOffset(this.currentIndex+this.seedOffset,this.currentIndex+this.seedOffset),n.push(o);continue}if(this.cur==w.Punctuation_ForwardSlash&&this.next==w.Punctuation_GreaterThan){let a=new cu;a.startPosition=this.positionFromOffset(e+this.seedOffset,e+this.seedOffset),a.endPosition=this.positionFromOffset(this.currentIndex+this.seedOffset+1,this.currentIndex+this.seedOffset+1),a.parameters=n,a.isSelfClosing=!0,a.name=r.join(""),a.isClosingFragment=s,this.fragments.push(a),s?this.fragmentOpeningIndex.set(a.startPosition.index+1,1):this.fragmentOpeningIndex.set(a.startPosition.index,1);break}if(this.cur==w.Punctuation_GreaterThan){let a=new cu;a.startPosition=this.positionFromOffset(e+this.seedOffset,e+this.seedOffset),a.endPosition=this.positionFromOffset(this.currentIndex+this.seedOffset,this.currentIndex+this.seedOffset),a.parameters=n,a.name=r.join(""),a.isClosingFragment=s,this.fragments.push(a),s?this.fragmentOpeningIndex.set(a.startPosition.index+1,1):this.fragmentOpeningIndex.set(a.startPosition.index,1),a.name.toLowerCase()=="script"&&a.isClosingFragment==!1&&(this.isScript=!0);break}}}};var th=class{constructor(e,n){this.documentParser=e,this.fragmentsParser=n}doesContainFragments(e){var i,s,a,o,l;let n=(s=(i=e.endPosition)==null?void 0:i.index)!=null?s:0,r=(l=(o=(a=e.isClosedBy)==null?void 0:a.startPosition)==null?void 0:o.index)!=null?l:0;return this.fragmentsParser.getFragmentsBetween(n,r).length>0}analyze(){let e=this.documentParser.getNodes();!this.fragmentsParser.hasFragments()||(this.fragmentsParser.getFragments().forEach(n=>{let r=n.name.toLowerCase();if(n.isClosingFragment==!1&&n.isSelfClosing==!1&&(r=="script"||r=="style")){let i=this.fragmentsParser.getClosingFragmentAfter(n);if(i==null)return;n.endPosition!=null&&i.startPosition!=null&&this.documentParser.getNodesBetween(n.endPosition,i.startPosition).forEach(a=>{(a instanceof Nn||a instanceof z&&a.isClosedBy!=null)&&(n.containsStructures=!0),r=="style"?a.isInStyleTag=!0:a.isInScriptTag=!0})}}),e.forEach(n=>{var a,o,l,u,c,f;if(n instanceof gt||n.startPosition==null)return;n instanceof z&&(Hn.isConditionalStructure(n)||!n.isClosingTag)&&n.isClosedBy!=null&&(n.containsAnyFragments=this.doesContainFragments(n));let r=this.fragmentsParser.getFragmentContaining(n.startPosition);if(r==null)return;if(n.fragment=r,n.startPosition.index-((o=(a=r.startPosition)==null?void 0:a.index)!=null?o:0)<=3){n.fragmentPosition=0;return}if(r.parameters.length==0){n.fragmentPosition=2;return}let s=!1;for(let h=0;hn.startPosition.index){n.fragmentPosition=1,s=!0;break}}s||(n.fragmentPosition=2)}))}};var nh=class{static analyze(e){e.forEach(n=>{var r,i,s,a;if(n instanceof z){if(n.prev instanceof z&&n.isPaired()&&n.prev.isInlineAntlers==!0){n.isInlineAntlers=!1,n.isClosedBy!=null&&(n.isClosedBy.isInlineAntlers=!1);return}let o=!1,l=!1;if(n.next==null)o=!0;else if(n.next instanceof gt){let u=Z.getFirstLine(n.next.content);(n.next.next==null&&u.trim().length==0||Z.trimLeft(u," ").startsWith(` `)==!1&&u.trim().length>0||n.next.next instanceof ln||n.next.next instanceof z&&(n.next.next.isPaired()==!1||((i=(r=n.next.next.startPosition)==null?void 0:r.line)!=null?i:0)!=((a=(s=n.startPosition)==null?void 0:s.line)!=null?a:0)))&&(o=!0)}else n.next instanceof z&&n.next.isPaired()&&(o=!0);if(n.prev==null)l=!0;else if(n.prev instanceof gt){let u=Z.getLastLine(n.prev.content);Z.trimRight(u," ").endsWith(` -`)==!1&&u.trim().length>0||n.prev.prev instanceof ln?l=!0:n.prev.prev instanceof z&&(n.prev.prev.isInlineAntlers?l=!0:n.prev.prev.isClosingTag&&n.prev.prev.isOpenedBy!=null&&(n.prev.prev.isOpenedBy instanceof ln||n.prev.prev.runtimeName()=="noparse")&&(n.prev.prev.isInlineAntlers=!0,l=!0))}else n.prev instanceof z&&n.prev.isPaired()&&(l=!0);n.isInlineAntlers=o&&l}})}};var Be=class{constructor(){this.interpolationRegions=new Map;this.nodeParser=new Yd;this.chars=[];this.charLen=0;this.lastAntlersNode=null;this.content="";this.originalContent="";this.currentIndex=0;this.currentContent=[];this.sourceContent=[];this.startIndex=0;this._recoveryStartIndex=0;this.cur=null;this.next=null;this.prev=null;this.nodes=[];this.renderNodes=[];this.isInterpolatedParser=!1;this.inputLen=0;this.documentOffsets=new Map;this.lineIndex=new Map;this.lastDocumentOffsetKey=null;this.isDoubleBrace=!1;this.interpolationEndOffsets=new Map;this.isScanningInterpolations=!1;this.seedStartLine=1;this.seedStartchar=1;this.frontMatterEndLine=-1;this.lastAntlersEndIndex=-1;this.seedOffset=0;this.antlersStartIndex=[];this.antlersStartPositionIndex=new Map;this.chunkSize=5;this.maxLine=1;this.currentChunkOffset=0;this.isNoParse=!1;this.antlersErrors=[];this.languageParser=new Ot;this.documentPath=null;this.pushedErrors=new Map;this.frontMatter="";this.shiftLine=0;this.doesHaveUncloseIfStructures=!1;this.doesHaveUnclosedStructures=!1;this.parseChildDocuments=!1;this.structure=new zd(this);this.fragmentsParser=new eh,this.fragmentsAnalyzer=new th(this,this.fragmentsParser)}withChildDocuments(e){return this.parseChildDocuments=e,this}shouldParseChildDocument(){return this.parseChildDocuments}hasUnclosedIfStructures(){return this.doesHaveUncloseIfStructures}hasUnclosedStructures(){return this.doesHaveUnclosedStructures}getFrontMatter(){return this.frontMatter}setDocumentPath(e){this.documentPath=e}getFrontMatterEndLine(){return this.frontMatterEndLine}pushError(e){(e.errorCode==A.TYPE_PARSE_UNCLOSED_CONDITIONAL||e.errorCode==A.TYPE_PARSE_UNPAIRED_CONDITIONAL)&&(this.doesHaveUncloseIfStructures=!0);let n=e.hash();this.pushedErrors.has(n)||(this.pushedErrors.set(n,e),this.antlersErrors.push(e))}getInterpolationRegions(){return this.interpolationRegions}getDocumentPath(){return this.documentPath}checkCurrentOffsets(){if(this.currentIndex>this.chars.length){this.cur=null,this.prev=null,this.next=null;return}if(this.cur=this.chars[this.currentIndex],this.prev=null,this.next=null,this.currentIndex>0&&(this.prev=this.chars[this.currentIndex-1]),this.currentIndex+1{this.chars.push(r),this.charLen+=1})}e&&this.currentIndex+10&&!this.isNoParse){let G=new gt;if(G.withParser(this),G.content=this.prepareLiteralContent(this.content.substr(0,N)),G.content.length>0){G.startPosition=this.positionFromOffset(0,0),G.endPosition=this.positionFromOffset(N,N-1);let L=(u=G.startPosition.index)!=null?u:0,M=G.endPosition.index+1;G.sourceContent=this.content.substr(L,M-L),this.nodes.push(G)}}if(Nthis.lastAntlersNode.endPosition.offset){L=M;break}if(L==null){let M=this.prepareLiteralContent(this.content.substr(this.lastAntlersNode.endPosition.offset+1));if(M.length>0&&!this.isNoParse){let $=new gt;$.withParser(this),$.content=M;let K=this.lastAntlersNode.endPosition.offset+1;$.startPosition=this.positionFromOffset(K,K),$.endPosition=this.positionFromOffset(this.inputLen,this.inputLen);let ne=(c=$.startPosition.index)!=null?c:0,re=$.endPosition.index+1;$.sourceContent=this.content.substr(ne,re-ne),this.nodes.push($)}break}else{let M=this.antlersStartIndex[L],$=M-this.lastAntlersNode.endPosition.offset-1;if($>0){let K=this.lastAntlersNode.endPosition.offset,ne=M-1;K+=1,ne-=1;let re=this.content.substr(K,$);if(re.length>0&&!this.isNoParse){let ye=new gt;ye.withParser(this),ye.content=re,ye.startPosition=this.positionFromOffset(K,K),ye.endPosition=this.positionFromOffset(ne,ne);let Ce=(f=ye.startPosition.index)!=null?f:0,ae=ye.endPosition.index+1;ye.sourceContent=this.content.substr(Ce,ae-Ce),this.nodes.push(ye)}continue}_=L-1;continue}}}let C=!1;if(this.antlersStartPositionIndex.has(this.currentChunkOffset)?this.lastAntlersEndIndexG)_+20){K.startPosition=this.positionFromOffset(M,M),K.endPosition=this.positionFromOffset(G,G-1);let ne=(h=K.startPosition.index)!=null?h:0,re=K.endPosition.index+1;K.sourceContent=this.content.substr(ne,re-ne),this.nodes.push(K)}break}else{let M=G-this.lastAntlersEndIndex-1;if(M==0||this.isNoParse)continue;let K=this.currentChunkOffset;this.lastAntlersNode instanceof Vo&&(L=((p=(y=this.lastAntlersNode.endPosition)==null?void 0:y.offset)!=null?p:0)+1,M-=((g=(d=this.lastAntlersNode.endPosition)==null?void 0:d.offset)!=null?g:0)+1,K=L),this.lastAntlersNode instanceof ya&&(L-=1,M+=1);let ne=this.content.substr(L,M),re=new gt;if(re.withParser(this),re.content=this.prepareLiteralContent(ne),re.content.length>0){re.startPosition=this.positionFromOffset(L,L),re.endPosition=this.positionFromOffset(G,G-1);let ye=(m=re.startPosition.index)!=null?m:0,Ce=re.endPosition.index+1;re.sourceContent=this.content.substr(ye,Ce-ye),this.nodes.push(re)}}continue}if(_!==r&&this.lastAntlersNode!=null&&this.lastAntlersNode.endPosition!=null&&this.positionFromOffset(N,N).isBefore(this.lastAntlersNode.endPosition)){if(_+10){L.startPosition=this.positionFromOffset(G,G),L.endPosition=this.positionFromOffset(this.inputLen-1,this.inputLen-1);let M=(b=L.startPosition.index)!=null?b:0,$=L.endPosition.index+1;L.sourceContent=this.content.substr(M,$-M),this.nodes.push(L)}break}}}}let i=0;this.nodes.forEach(_=>{_.index=i,i+=1}),this.nodes.length>500&&(this.parseChildDocuments=!1),this.nodes.forEach(_=>{_ instanceof z&&_.isComment||_ instanceof z&&_.interpolationRegions.size>0&&(_.interpolationRegions.forEach((N,C)=>{let G=new Be;G.withChildDocuments(this.parseChildDocuments),G.setIsInterpolatedParser(!0);let L=G.parse(N.parseContent);L.length>1&&L[1]instanceof z&&(L=[L[1]]),G.hasUnclosedIfStructures()&&(this.doesHaveUncloseIfStructures=!0),G.hasUnclosedStructures()&&(this.doesHaveUnclosedStructures=!0),_.processedInterpolationRegions.set(C,L),this.mergeErrors(G.getAntlersErrors())}),_.hasProcessedInterpolationRegions=!0)}),this.content.length>0&&this.fragmentsParser.setIndexRanges(this.getNodeIndexRanges()).parse(this.content);let s=new Oc;this.renderNodes=s.associate(this.nodes,this),this.createChildDocuments(this.renderNodes);let a=null,o=null;for(let _=0;_{if(_ instanceof z&&_.isClosedBy!=null){let N=_.getImmediateChildren();for(let C=0;C{if(_ instanceof z&&_.isClosingTag&&_.isOpenedBy==null){let N="Unpaired closing tag.";_.isInterpolationNode&&(N+=" Tag pairs are not supported within Antlers tags."),_.pushError(W.makeSyntaxError(A.TYPE_UNPAIRED_CLOSING_TAG,_,N))}}),Kd.associateRecursiveParent(this.nodes),this.nodes.forEach(_=>{var N;if(!(_ instanceof z&&_.isComment)&&((_ instanceof z||_ instanceof mt)&&(_.isInterpolationNode=this.isInterpolatedParser),(_ instanceof z||_ instanceof mt)&&_.interpolationRegions.size>0&&_.runtimeNodes.forEach(C=>{C instanceof Ne&&_.interpolationRegions.has(C.name)&&(C.isInterpolationReference=!0,C.interpolationNodes=_.processedInterpolationRegions.get(C.name))}),(_ instanceof z||_ instanceof mt)&&_.hasParameters&&_.interpolationRegions.size>0&&_.parameters.forEach(C=>{_.interpolationRegions.forEach((G,L)=>{C.value.includes(L)&&C.interpolations.push(L)})}),_ instanceof z&&_.runtimeNodes.length>0&&_.isClosingTag==!1&&!_.isComment&&(_.parsedRuntimeNodes=this.languageParser.parse(_.runtimeNodes),_.hasParsedRuntimeNodes=!0,!_.isTagNode&&_.parsedRuntimeNodes.length>0))){let C=_.nodeAtIndex(0);C!=null&&C instanceof Ne&&C.name==((N=_.name)==null?void 0:N.name)&&(_.modifierChain=C.modifierChain)}}),this.languageParser.getCreatedModifierChains().forEach(_=>{_.modifierChain.length>0&&_.modifierChain.forEach(N=>{var C,G;N.nameNode!=null&&xt.instance!=null&&xt.instance.hasModifier((C=N.nameNode)==null?void 0:C.name)&&(N.modifier=(G=xt.instance)==null?void 0:G.getModifier(N.nameNode.name))})});let l=1;return this.nodes.forEach(_=>{var N,C;if(_ instanceof z){if(_.isComment)return;_.isTagNode=(C=(N=wt.instance)==null?void 0:N.isKnownTag(_.runtimeName()))!=null?C:!1,_.scopeName=_.findParameterValue("scope",""),_.antlersNodeIndex=l,l+=1,Xd.analyzeModifierNodeParameters(_),Qd.validateParameters(_)}}),this.nodes.forEach(_=>{var N,C,G,L,M,$,K,ne;if(_ instanceof z&&_.isClosedBy!=null){let re=((C=(N=_.endPosition)==null?void 0:N.offset)!=null?C:0)+1,ye=(L=(G=_.isClosedBy.startPosition)==null?void 0:G.offset)!=null?L:0,Ce=($=(M=_.startPosition)==null?void 0:M.offset)!=null?$:0,ae=((ne=(K=_.isClosedBy.endPosition)==null?void 0:K.offset)!=null?ne:0)+1;_.documentText=this.content.substr(re,ye-re),_.nodeContent=this.content.substr(Ce,ae-Ce),this.parseChildDocuments&&(_.childDocument=Kt.childFromText(_.documentText,_l(_.children)))}}),this.renderNodes}createChildDocuments(e){e.forEach(n=>{var r,i,s,a,o,l,u,c;if(n instanceof z&&n.isClosedBy!=null){let f=n.isClosedBy,h=((i=(r=n.startPosition)==null?void 0:r.index)!=null?i:0)-1,y=((a=(s=f.endPosition)==null?void 0:s.index)!=null?a:0)-h;if(n.documentText=this.content.substr(h,y),this.parseChildDocuments){let p=(l=(o=n.endPosition)==null?void 0:o.index)!=null?l:0,d=((c=(u=f.startPosition)==null?void 0:u.index)!=null?c:0)-1-p,g=this.content.substr(p,d);n.childDocument=Kt.childFromText(g,_l(n.getChildren()))}}})}getNodeIndexRanges(){let e=[];return this.nodes.forEach(n=>{var r,i,s,a;n instanceof gt||e.push({start:(i=(r=n.startPosition)==null?void 0:r.index)!=null?i:0,end:(a=(s=n.endPosition)==null?void 0:s.index)!=null?a:0})}),e}positionFromOffset(e,n,r=!1){let i=0,s=0;if(this.documentOffsets.has(e)){let o=this.documentOffsets.get(e);i=o.line,s=o.char}else if(this.documentOffsets.size==0)i=1,s=e+1;else{let o=null,l=null,u=null,c=null;for(let f of this.documentOffsets.keys()){if(f>=e){c!=null&&e>c?(o=u,l=c):(o=this.documentOffsets.get(f),l=f);break}u=this.documentOffsets.get(f),c=f}if(o==null&&(o=u,l=c),o!=null)if(r){let f=this.content.split(""),h=e-(l!=null?l:0),y=o.char-(l!=null?l:0)+e;s=h,i=o.line,e<=(l!=null?l:0)?(i=o.line,s=e+1):i=o.line+1}else{let f=this.content.split(""),h=e-(l!=null?l:0),y=o.char-(l!=null?l:0)+e;s=h,i=o.line,e<=(l!=null?l:0)?(i=o.line,s=e+1):i=o.line+1}else this.lastDocumentOffsetKey!=null&&(i=this.documentOffsets.get(this.lastDocumentOffsetKey).line+1,s=e+this.lastDocumentOffsetKey)}let a=new Fn;return a.index=n,a.offset=e,a.line=i+this.shiftLine,a.char=s,a}getLanguageParser(){return this.languageParser}getText(e,n){return this.content.substr(e,n-e)}getOriginalContent(){return this.originalContent}getContent(){return this.content}getFragments(){return this.fragmentsParser.getFragments()}getFragmentsParser(){return this.fragmentsParser}getFragmentsContainingStructures(){return this.fragmentsParser.getFragmentsContainingStructures()}setIsInterpolatedParser(e){return this.isInterpolatedParser=e,this}setStartLineSeed(e){return this.seedStartLine=e,this}setSeedStartChar(e){return this.seedStartchar=e,this}resetIntermediateState(){this.chars=[],this.charLen=0,this.currentIndex=0,this.currentContent=[],this.sourceContent=[],this.cur=null,this.next=null,this.prev=null}setSeedPosition(e){return e==null?this.shiftLine=0:this.shiftLine=e.line,this}resetState(){if(this.languageParser.reset(),this.charLen=0,this.antlersStartIndex=[],this.antlersErrors=[],this.pushedErrors.clear(),this.antlersStartPositionIndex.clear(),this.lastAntlersEndIndex=-1,this.renderNodes=[],this.nodes=[],hs.globalTagEnterStack.length>0){let e=hs.globalTagEnterStack[hs.length-1];e!=null&&e.endPosition!=null&&this.setStartLineSeed(e.endPosition.line)}this.seedOffset=0,this.isScanningInterpolations=!1,this.content="",this.chars=[],this.currentIndex=0,this.startIndex=0,this._recoveryStartIndex=0,this.cur=null,this.next=null,this.prev=null,this.inputLen=0,this.documentOffsets.clear(),this.isDoubleBrace=!1,this.interpolationRegions.clear(),this.interpolationEndOffsets.clear()}fetch(e){let n=this.currentChunkOffset+this.chunkSize-this.chars.length;return Z.substring(this.content,n,e)}getParsedContent(){return this.content}peek(e){if(e==this.charLen){let n=Z.split(Z.substring(this.content,this.currentChunkOffset+this.chunkSize,this.chunkSize));this.currentChunkOffset+=this.chunkSize,n.forEach(r=>{this.chars.push(r),this.charLen+=1})}return this.chars[e]}parseIntermediateText(){for(this.currentContent=[],this.sourceContent=[],this.startIndex=0,this.chars=this.content.substr(this.currentChunkOffset,this.chunkSize).split(""),this.charLen=this.chars.length,this.currentIndex=0;this.currentIndex=this.inputLen){this.appendContent(this.next),this.dumpLiteralNode(this.currentIndex+1);break}let e=0;for(let n=this.currentIndex+1;n0&&this.dumpLiteralNode(this.currentIndex)}}getRenderNodes(){return this.renderNodes}processInputText(e){var f;if(this.originalContent=e,this.content=Z.normalizeLineEndings(e),this.inputLen=this.content.length,this.content.startsWith("---")){let h=this.content.split(` +`)==!1&&u.trim().length>0||n.prev.prev instanceof ln?l=!0:n.prev.prev instanceof z&&(n.prev.prev.isInlineAntlers?l=!0:n.prev.prev.isClosingTag&&n.prev.prev.isOpenedBy!=null&&(n.prev.prev.isOpenedBy instanceof ln||n.prev.prev.runtimeName()=="noparse")&&(n.prev.prev.isInlineAntlers=!0,l=!0))}else n.prev instanceof z&&n.prev.isPaired()&&(l=!0);n.isInlineAntlers=o&&l}})}};var qe=class{constructor(){this.interpolationRegions=new Map;this.nodeParser=new Yd;this.chars=[];this.charLen=0;this.lastAntlersNode=null;this.content="";this.originalContent="";this.currentIndex=0;this.currentContent=[];this.sourceContent=[];this.startIndex=0;this._recoveryStartIndex=0;this.cur=null;this.next=null;this.prev=null;this.nodes=[];this.renderNodes=[];this.isInterpolatedParser=!1;this.inputLen=0;this.documentOffsets=new Map;this.lineIndex=new Map;this.lastDocumentOffsetKey=null;this.isDoubleBrace=!1;this.interpolationEndOffsets=new Map;this.isScanningInterpolations=!1;this.seedStartLine=1;this.seedStartchar=1;this.frontMatterEndLine=-1;this.lastAntlersEndIndex=-1;this.seedOffset=0;this.antlersStartIndex=[];this.antlersStartPositionIndex=new Map;this.chunkSize=5;this.maxLine=1;this.currentChunkOffset=0;this.isNoParse=!1;this.antlersErrors=[];this.structureErrors=[];this.languageParser=new Ot;this.documentPath=null;this.pushedErrors=new Map;this.frontMatter="";this.shiftLine=0;this.doesHaveUncloseIfStructures=!1;this.doesHaveUnclosedStructures=!1;this.parseChildDocuments=!1;this.structuralErrorCodes=[S.TYPE_PARSE_UNCLOSED_CONDITIONAL,S.TYPE_PARSE_UNPAIRED_CONDITIONAL,S.TYPE_RECURSIVE_UNPAIRED_NODE,S.TYPE_RUNTIME_FATAL_UNPAIRED_LOOP_END,S.TYPE_UNPAIRED_CLOSING_TAG];this.structure=new zd(this);this.fragmentsParser=new eh,this.fragmentsAnalyzer=new th(this,this.fragmentsParser)}withChildDocuments(e){return this.parseChildDocuments=e,this}shouldParseChildDocument(){return this.parseChildDocuments}hasUnclosedIfStructures(){return this.doesHaveUncloseIfStructures}hasUnclosedStructures(){return this.doesHaveUnclosedStructures}getFrontMatter(){return this.frontMatter}setDocumentPath(e){this.documentPath=e}getFrontMatterEndLine(){return this.frontMatterEndLine}pushError(e){(e.errorCode==S.TYPE_PARSE_UNCLOSED_CONDITIONAL||e.errorCode==S.TYPE_PARSE_UNPAIRED_CONDITIONAL)&&(this.doesHaveUncloseIfStructures=!0);let n=e.hash();this.pushedErrors.has(n)||(this.pushedErrors.set(n,e),this.antlersErrors.push(e),this.structuralErrorCodes.includes(e.errorCode)&&this.structureErrors.push(e))}getInterpolationRegions(){return this.interpolationRegions}getDocumentPath(){return this.documentPath}checkCurrentOffsets(){if(this.currentIndex>this.chars.length){this.cur=null,this.prev=null,this.next=null;return}if(this.cur=this.chars[this.currentIndex],this.prev=null,this.next=null,this.currentIndex>0&&(this.prev=this.chars[this.currentIndex-1]),this.currentIndex+1{this.chars.push(r),this.charLen+=1})}e&&this.currentIndex+1this.maxLine&&(i=this.maxLine);for(let a=r;a<=i;a++)n.set(a,(s=this.getLineText(a))!=null?s:"");return n}charAtCursor(e,n){return this.charAt(this.positionFromCursor(e,n))}getLineIndex(e){if(e==this.maxLine){let r=this.lineIndex.get(e-1);if(r!=null){let i=r.endIndex+1;return{end:this.inputLen-1,start:i}}return null}let n=this.lineIndex.get(e);return n!=null?{start:n.startIndex,end:n.endIndex}:null}positionFromCursor(e,n){if(e==this.maxLine){let i=this.lineIndex.get(e-1);if(i!=null){let s=i.endIndex+1,a=s+(n-1),o=new Fn;return o.offset=a,o.line=e,o.char=n,o.index=a,o}return null}let r=this.lineIndex.get(e);if(r!=null){let i=new Fn;return i.offset=r.startIndex+(n-1),i.line=r.line,i.char=n,i.index=r.startIndex+(n-1),i}return null}parse(e){var u,c,f,h,y,p,d,g,m,b;if(this.resetState(),!this.processInputText(e))return[];let n=this.antlersStartIndex.length,r=n-1;if(n==0&&!this.isNoParse){let _=new gt;_.withParser(this),_.content=this.prepareLiteralContent(this.content),_.startPosition=this.positionFromOffset(0,0),_.endPosition=this.positionFromOffset(this.inputLen-1,this.inputLen-1),_.sourceContent=this.content,this.nodes.push(_)}else for(let _=0;_0&&!this.isNoParse){let G=new gt;if(G.withParser(this),G.content=this.prepareLiteralContent(this.content.substr(0,N)),G.content.length>0){G.startPosition=this.positionFromOffset(0,0),G.endPosition=this.positionFromOffset(N,N-1);let L=(u=G.startPosition.index)!=null?u:0,M=G.endPosition.index+1;G.sourceContent=this.content.substr(L,M-L),this.nodes.push(G)}}if(Nthis.lastAntlersNode.endPosition.offset){L=M;break}if(L==null){let M=this.prepareLiteralContent(this.content.substr(this.lastAntlersNode.endPosition.offset+1));if(M.length>0&&!this.isNoParse){let $=new gt;$.withParser(this),$.content=M;let K=this.lastAntlersNode.endPosition.offset+1;$.startPosition=this.positionFromOffset(K,K),$.endPosition=this.positionFromOffset(this.inputLen,this.inputLen);let ne=(c=$.startPosition.index)!=null?c:0,re=$.endPosition.index+1;$.sourceContent=this.content.substr(ne,re-ne),this.nodes.push($)}break}else{let M=this.antlersStartIndex[L],$=M-this.lastAntlersNode.endPosition.offset-1;if($>0){let K=this.lastAntlersNode.endPosition.offset,ne=M-1;K+=1,ne-=1;let re=this.content.substr(K,$);if(re.length>0&&!this.isNoParse){let ye=new gt;ye.withParser(this),ye.content=re,ye.startPosition=this.positionFromOffset(K,K),ye.endPosition=this.positionFromOffset(ne,ne);let Ce=(f=ye.startPosition.index)!=null?f:0,ae=ye.endPosition.index+1;ye.sourceContent=this.content.substr(Ce,ae-Ce),this.nodes.push(ye)}continue}_=L-1;continue}}}let C=!1;if(this.antlersStartPositionIndex.has(this.currentChunkOffset)?this.lastAntlersEndIndexG)_+20){K.startPosition=this.positionFromOffset(M,M),K.endPosition=this.positionFromOffset(G,G-1);let ne=(h=K.startPosition.index)!=null?h:0,re=K.endPosition.index+1;K.sourceContent=this.content.substr(ne,re-ne),this.nodes.push(K)}break}else{let M=G-this.lastAntlersEndIndex-1;if(M==0||this.isNoParse)continue;let K=this.currentChunkOffset;this.lastAntlersNode instanceof Vo&&(L=((p=(y=this.lastAntlersNode.endPosition)==null?void 0:y.offset)!=null?p:0)+1,M-=((g=(d=this.lastAntlersNode.endPosition)==null?void 0:d.offset)!=null?g:0)+1,K=L),this.lastAntlersNode instanceof ya&&(L-=1,M+=1);let ne=this.content.substr(L,M),re=new gt;if(re.withParser(this),re.content=this.prepareLiteralContent(ne),re.content.length>0){re.startPosition=this.positionFromOffset(L,L),re.endPosition=this.positionFromOffset(G,G-1);let ye=(m=re.startPosition.index)!=null?m:0,Ce=re.endPosition.index+1;re.sourceContent=this.content.substr(ye,Ce-ye),this.nodes.push(re)}}continue}if(_!==r&&this.lastAntlersNode!=null&&this.lastAntlersNode.endPosition!=null&&this.positionFromOffset(N,N).isBefore(this.lastAntlersNode.endPosition)){if(_+10){L.startPosition=this.positionFromOffset(G,G),L.endPosition=this.positionFromOffset(this.inputLen-1,this.inputLen-1);let M=(b=L.startPosition.index)!=null?b:0,$=L.endPosition.index+1;L.sourceContent=this.content.substr(M,$-M),this.nodes.push(L)}break}}}}let i=0;this.nodes.forEach(_=>{_.index=i,i+=1}),this.nodes.length>500&&(this.parseChildDocuments=!1),this.nodes.forEach(_=>{_ instanceof z&&_.isComment||_ instanceof z&&_.interpolationRegions.size>0&&(_.interpolationRegions.forEach((N,C)=>{let G=new qe;G.withChildDocuments(this.parseChildDocuments),G.setIsInterpolatedParser(!0);let L=G.parse(N.parseContent);L.length>1&&L[1]instanceof z&&(L=[L[1]]),G.hasUnclosedIfStructures()&&(this.doesHaveUncloseIfStructures=!0),G.hasUnclosedStructures()&&(this.doesHaveUnclosedStructures=!0),_.processedInterpolationRegions.set(C,L),this.mergeErrors(G.getAntlersErrors())}),_.hasProcessedInterpolationRegions=!0)}),this.content.length>0&&this.fragmentsParser.setIndexRanges(this.getNodeIndexRanges()).parse(this.content);let s=new Oc;this.renderNodes=s.associate(this.nodes,this),this.createChildDocuments(this.renderNodes);let a=null,o=null;for(let _=0;_{if(_ instanceof z&&_.isClosedBy!=null){let N=_.getImmediateChildren();for(let C=0;C{if(_ instanceof z&&_.isClosingTag&&_.isOpenedBy==null){let N="Unpaired closing tag.";_.isInterpolationNode&&(N+=" Tag pairs are not supported within Antlers tags."),_.pushError(W.makeSyntaxError(S.TYPE_UNPAIRED_CLOSING_TAG,_,N))}}),Kd.associateRecursiveParent(this.nodes),this.nodes.forEach(_=>{var N;if(!(_ instanceof z&&_.isComment)&&((_ instanceof z||_ instanceof mt)&&(_.isInterpolationNode=this.isInterpolatedParser),(_ instanceof z||_ instanceof mt)&&_.interpolationRegions.size>0&&_.runtimeNodes.forEach(C=>{C instanceof Ne&&_.interpolationRegions.has(C.name)&&(C.isInterpolationReference=!0,C.interpolationNodes=_.processedInterpolationRegions.get(C.name))}),(_ instanceof z||_ instanceof mt)&&_.hasParameters&&_.interpolationRegions.size>0&&_.parameters.forEach(C=>{_.interpolationRegions.forEach((G,L)=>{C.value.includes(L)&&C.interpolations.push(L)})}),_ instanceof z&&_.runtimeNodes.length>0&&_.isClosingTag==!1&&!_.isComment&&(_.parsedRuntimeNodes=this.languageParser.parse(_.runtimeNodes),_.hasParsedRuntimeNodes=!0,!_.isTagNode&&_.parsedRuntimeNodes.length>0))){let C=_.nodeAtIndex(0);C!=null&&C instanceof Ne&&C.name==((N=_.name)==null?void 0:N.name)&&(_.modifierChain=C.modifierChain)}}),this.languageParser.getCreatedModifierChains().forEach(_=>{_.modifierChain.length>0&&_.modifierChain.forEach(N=>{var C,G;N.nameNode!=null&&xt.instance!=null&&xt.instance.hasModifier((C=N.nameNode)==null?void 0:C.name)&&(N.modifier=(G=xt.instance)==null?void 0:G.getModifier(N.nameNode.name))})});let l=1;return this.nodes.forEach(_=>{var N,C;if(_ instanceof z){if(_.isComment)return;_.isTagNode=(C=(N=wt.instance)==null?void 0:N.isKnownTag(_.runtimeName()))!=null?C:!1,_.scopeName=_.findParameterValue("scope",""),_.antlersNodeIndex=l,l+=1,Xd.analyzeModifierNodeParameters(_),Qd.validateParameters(_)}}),this.nodes.forEach(_=>{var N,C,G,L,M,$,K,ne;if(_ instanceof z&&_.isClosedBy!=null){let re=((C=(N=_.endPosition)==null?void 0:N.offset)!=null?C:0)+1,ye=(L=(G=_.isClosedBy.startPosition)==null?void 0:G.offset)!=null?L:0,Ce=($=(M=_.startPosition)==null?void 0:M.offset)!=null?$:0,ae=((ne=(K=_.isClosedBy.endPosition)==null?void 0:K.offset)!=null?ne:0)+1;_.documentText=this.content.substr(re,ye-re),_.nodeContent=this.content.substr(Ce,ae-Ce),this.parseChildDocuments&&(_.childDocument=Kt.childFromText(_.documentText,_l(_.children)))}}),this.renderNodes}createChildDocuments(e){e.forEach(n=>{var r,i,s,a,o,l,u,c;if(n instanceof z&&n.isClosedBy!=null){let f=n.isClosedBy,h=((i=(r=n.startPosition)==null?void 0:r.index)!=null?i:0)-1,y=((a=(s=f.endPosition)==null?void 0:s.index)!=null?a:0)-h;if(n.documentText=this.content.substr(h,y),this.parseChildDocuments){let p=(l=(o=n.endPosition)==null?void 0:o.index)!=null?l:0,d=((c=(u=f.startPosition)==null?void 0:u.index)!=null?c:0)-1-p,g=this.content.substr(p,d);n.childDocument=Kt.childFromText(g,_l(n.getChildren()))}}})}getNodeIndexRanges(){let e=[];return this.nodes.forEach(n=>{var r,i,s,a;n instanceof gt||e.push({start:(i=(r=n.startPosition)==null?void 0:r.index)!=null?i:0,end:(a=(s=n.endPosition)==null?void 0:s.index)!=null?a:0})}),e}positionFromOffset(e,n,r=!1){let i=0,s=0;if(this.documentOffsets.has(e)){let o=this.documentOffsets.get(e);i=o.line,s=o.char}else if(this.documentOffsets.size==0)i=1,s=e+1;else{let o=null,l=null,u=null,c=null;for(let f of this.documentOffsets.keys()){if(f>=e){c!=null&&e>c?(o=u,l=c):(o=this.documentOffsets.get(f),l=f);break}u=this.documentOffsets.get(f),c=f}if(o==null&&(o=u,l=c),o!=null)if(r){let f=this.content.split(""),h=e-(l!=null?l:0),y=o.char-(l!=null?l:0)+e;s=h,i=o.line,e<=(l!=null?l:0)?(i=o.line,s=e+1):i=o.line+1}else{let f=this.content.split(""),h=e-(l!=null?l:0),y=o.char-(l!=null?l:0)+e;s=h,i=o.line,e<=(l!=null?l:0)?(i=o.line,s=e+1):i=o.line+1}else this.lastDocumentOffsetKey!=null&&(i=this.documentOffsets.get(this.lastDocumentOffsetKey).line+1,s=e+this.lastDocumentOffsetKey)}let a=new Fn;return a.index=n,a.offset=e,a.line=i+this.shiftLine,a.char=s,a}getLanguageParser(){return this.languageParser}getText(e,n){return this.content.substr(e,n-e)}getOriginalContent(){return this.originalContent}getContent(){return this.content}getFragments(){return this.fragmentsParser.getFragments()}getFragmentsParser(){return this.fragmentsParser}getFragmentsContainingStructures(){return this.fragmentsParser.getFragmentsContainingStructures()}setIsInterpolatedParser(e){return this.isInterpolatedParser=e,this}setStartLineSeed(e){return this.seedStartLine=e,this}setSeedStartChar(e){return this.seedStartchar=e,this}resetIntermediateState(){this.chars=[],this.charLen=0,this.currentIndex=0,this.currentContent=[],this.sourceContent=[],this.cur=null,this.next=null,this.prev=null}setSeedPosition(e){return e==null?this.shiftLine=0:this.shiftLine=e.line,this}resetState(){if(this.languageParser.reset(),this.charLen=0,this.antlersStartIndex=[],this.antlersErrors=[],this.pushedErrors.clear(),this.antlersStartPositionIndex.clear(),this.lastAntlersEndIndex=-1,this.renderNodes=[],this.nodes=[],hs.globalTagEnterStack.length>0){let e=hs.globalTagEnterStack[hs.length-1];e!=null&&e.endPosition!=null&&this.setStartLineSeed(e.endPosition.line)}this.seedOffset=0,this.isScanningInterpolations=!1,this.content="",this.chars=[],this.currentIndex=0,this.startIndex=0,this._recoveryStartIndex=0,this.cur=null,this.next=null,this.prev=null,this.inputLen=0,this.documentOffsets.clear(),this.isDoubleBrace=!1,this.interpolationRegions.clear(),this.interpolationEndOffsets.clear()}fetch(e){let n=this.currentChunkOffset+this.chunkSize-this.chars.length;return Z.substring(this.content,n,e)}getParsedContent(){return this.content}peek(e){if(e==this.charLen){let n=Z.split(Z.substring(this.content,this.currentChunkOffset+this.chunkSize,this.chunkSize));this.currentChunkOffset+=this.chunkSize,n.forEach(r=>{this.chars.push(r),this.charLen+=1})}return this.chars[e]}parseIntermediateText(){for(this.currentContent=[],this.sourceContent=[],this.startIndex=0,this.chars=this.content.substr(this.currentChunkOffset,this.chunkSize).split(""),this.charLen=this.chars.length,this.currentIndex=0;this.currentIndex=this.inputLen){this.appendContent(this.next),this.dumpLiteralNode(this.currentIndex+1);break}let e=0;for(let n=this.currentIndex+1;n0&&this.dumpLiteralNode(this.currentIndex)}}getRenderNodes(){return this.renderNodes}processInputText(e){var f;if(this.originalContent=e,this.content=Z.normalizeLineEndings(e),this.inputLen=this.content.length,this.content.startsWith("---")){let h=this.content.split(` `),y=[],p=[];p.push("");for(let d=1;d{let y=h[0];if(y.startsWith(Be.AtChar)){u=this.content.indexOf(y,u)+2,c=!0;return}let p=this.content.indexOf(y,u);if(c&&u==p){u=p;return}this.antlersStartIndex.push(p),this.antlersStartPositionIndex.set(p,1),u=p+2,c=!1}),!0}prepareLiteralContent(e){return e.replace("@{{","{{")}scanToEndOfPhpRegion(e){for(this.currentIndex==this.inputLen&&(this.doesHaveUnclosedStructures=!0),this.currentIndex;this.currentIndexthis.inputLen?(r.endPosition=this.positionFromOffset(this.inputLen,this.inputLen-1),this.doesHaveUnclosedStructures=!0,this.antlersErrors.push(W.makeSyntaxError(A.TYPE_UNEXPECTED_EOI_WHILE_MANIFESTING_ANTLERS_NODE,r,"Unexpected end of input while locating end of Antlers region.")),r):(this.lastAntlersEndIndex=e+3+this.seedOffset,r.endPosition=this.positionFromOffset(e+this.seedOffset,e+3+this.seedOffset),r)}makeAntlersPhpFailedNode(e){let n=new zf;n.rawStart="{{$",n.rawEnd="$}}",n._isEndVirtual=!0,n.content=this.currentContent.join(""),n.sourceContent=this.sourceContent.join(""),n.startPosition=this.positionFromOffset(this.startIndex+this.seedOffset,this.startIndex+this.seedOffset);let r=this.getLineText(n.startPosition.line),i=this.getLineIndex(n.startPosition.line);if(r!=null){let a=r.substr(this._recoveryStartIndex);n.content=a,n.sourceContent=a}let s=e+this.seedOffset;return i!=null&&(this.currentIndex=i.end,s=i.end),n.endPosition=this.positionFromOffset(s,s),n}makeAntlersCommentFailedNode(e){let n=new Vo;this.isDoubleBrace?(n.rawStart="{{",n.rawEnd="}}"):(n.rawStart="{",n.rawEnd="}"),n._isEndVirtual=!0;let r=!1,i=this.currentContent.length;i>0&&this.currentContent[i-1]==Be.Punctuation_ForwardSlash&&(this.currentContent.pop(),r=!0),n.isComment=!0,n.isSelfClosing=r,n.withParser(this),n.content=this.currentContent.join(""),n.sourceContent=this.sourceContent.join(""),n.startPosition=this.positionFromOffset(this.startIndex+this.seedOffset,this.startIndex+this.seedOffset);let s=this.getLineText(n.startPosition.line),a=this.getLineIndex(n.startPosition.line);if(s!=null){let l=s.substr(this._recoveryStartIndex);n.content=l,n.sourceContent=l}let o=e+this.seedOffset;return a!=null&&(this.currentIndex=a.end,o=a.end),n.endPosition=this.positionFromOffset(o,o),n.interpolationRegions=new Map,this.interpolationRegions.forEach((l,u)=>{n.content.includes(u)&&n.interpolationRegions.set(u,l)}),n}makeAntlersFailedNode(e,n){let r=new mt;this.isDoubleBrace?(r.rawStart="{{",r.rawEnd="}}"):(r.rawStart="{",r.rawEnd="}"),r._isEndVirtual=!0;let i=!1,s=this.currentContent.length;s>0&&this.currentContent[s-1]==Be.Punctuation_ForwardSlash&&(this.currentContent.pop(),i=!0),r.isComment=n,r.isSelfClosing=i,r.withParser(this),r.content=this.currentContent.join(""),r.sourceContent=this.sourceContent.join(""),r.startPosition=this.positionFromOffset(this.startIndex+this.seedOffset,this.startIndex+this.seedOffset);let a=this.getLineText(r.startPosition.line),o=this.getLineIndex(r.startPosition.line);if(a!=null){let c=Z.trimLeft(this.content.substring(r.startPosition.offset+r.rawStart.length-1,o==null?void 0:o.end),"{");r.content=c,r.sourceContent=c}let l=e+this.seedOffset;o!=null&&(this.currentIndex=o.end,l=o.end),r.endPosition=this.positionFromOffset(l,l),r.interpolationRegions=new Map,this.interpolationRegions.forEach((c,f)=>{r.content.includes(f)&&r.interpolationRegions.set(f,c)});let u=this.nodeParser.parseNode(r);return this.mergeErrors(u.getErrors()),u}makeAntlersTagNode(e,n){let r=new z;this.isDoubleBrace?(r.rawStart="{{",r.rawEnd="}}"):(r.rawStart="{",r.rawEnd="}");let i=!1,s=this.currentContent.length;if(s>0&&this.currentContent[s-1]==Be.Punctuation_ForwardSlash&&(this.currentContent.pop(),i=!0),r.isInterpolationNode=this.isInterpolatedParser,r.isComment=n,r.isSelfClosing=i,r.withParser(this),r.content=this.currentContent.join(""),r.sourceContent=this.sourceContent.join(""),r.startPosition=this.positionFromOffset(this.startIndex+this.seedOffset,this.startIndex+this.seedOffset),e+2>this.inputLen)return r.endPosition=this.positionFromOffset(this.inputLen,this.inputLen-1),this.doesHaveUnclosedStructures=!0,this.antlersErrors.push(W.makeSyntaxError(A.TYPE_UNEXPECTED_EOI_WHILE_MANIFESTING_ANTLERS_NODE,r,"Unexpected end of input while locating end of Antlers region.")),r;if(n?this.lastAntlersEndIndex=e+2+this.seedOffset:this.lastAntlersEndIndex=e+1+this.seedOffset,r.endPosition=this.positionFromOffset(this.lastAntlersEndIndex,this.lastAntlersEndIndex),r.interpolationRegions=new Map,this.interpolationRegions.forEach((o,l)=>{r.content.includes(l)&&r.interpolationRegions.set(l,o)}),r.isComment)return r;let a=this.nodeParser.parseNode(r);return this.mergeErrors(a.getErrors()),a}mergeErrors(e){e.forEach(n=>{this.antlersErrors.push(n)})}getNodes(){return this.nodes}getNodesBetween(e,n){let r=[];return this.nodes.forEach(i=>{var s,a,o,l;((a=(s=i.startPosition)==null?void 0:s.offset)!=null?a:0)>e.offset&&((l=(o=i.endPosition)==null?void 0:o.offset)!=null?l:0)0&&this.nodes.push(this.makeLiteralNode(this.currentContent,this.startIndex,e)),this.currentContent=[],this.sourceContent=[])}makeLiteralNode(e,n,r){let i=new gt;return i.content=e.join(""),i.sourceContent=this.sourceContent.join(""),i.startPosition=this.positionFromOffset(n,n),i.endPosition=this.positionFromOffset(r,r),i.sourceContent=this.content.substr(n,r),i.withParser(this),i}addAntlersError(e){this.antlersErrors.push(e)}getAntlersErrors(){return this.antlersErrors}},w=Be;w.K_CHAR="char",w.K_LINE="line",w.NewLine=` -`,w.AtChar="@",w.LeftBrace="{",w.RightBrace="}",w.LeftBracket="[",w.RightBracket="]",w.String_EscapeCharacter="\\",w.String_Terminator_DoubleQuote='"',w.String_Terminator_SingleQuote="'",w.Punctuation_Question="?",w.Punctuation_Equals="=",w.Punctuation_Comma=",",w.Punctuation_Colon=":",w.Punctuation_Semicolon=";",w.Punctuation_Exclamation="!",w.Punctuation_Pipe="|",w.Punctuation_Ampersand="&",w.Punctuation_LessThan="<",w.Punctuation_GreaterThan=">",w.Punctuation_Octothorp="#",w.Punctuation_Tilde="~",w.Punctuation_FullStop=".",w.Punctuation_Dollar="$",w.Punctuation_Asterisk="*",w.Punctuation_Percent="%",w.Punctuation_Plus="+",w.Punctuation_Minus="-",w.Punctuation_Underscore="_",w.Punctuation_ForwardSlash="/",w.Punctuation_Caret="^",w.LeftParen="(",w.RightParent=")";var Ct=class{static findAssignmentNodes(e){let n=[];for(let r=0;re.index)break;r.push(s)}}return r}static isBefore(e,n){return e.startPosition==null?!1:e.startPosition.indexn.index}static findNodesBeforePosition(e,n){let r=[];if(e==null)return r;for(let i=0;ie.index)break;r.push(s)}}return r}static findNodesAfterPosition(e,n){let r=[];if(e==null)return r;for(let i=0;ie.index&&r.push(s)}return r}static findNodeBeforePosition(e,n){if(e==null)return null;let r=null;for(let i=0;ie.index)break;r=s}}return r}static findNodeAfterPosition(e,n){if(e==null)return null;for(let r=0;re.index)return i}return null}static findNodeAtPosition(e,n){if(e==null)return null;for(let r=0;r=i.startPosition.index&&e.index<=i.endPosition.index)return i}return null}static isLiteralType(e){return e instanceof ln||e instanceof gt}};var yl=class{static isModifierLeftOf(e,n){return yl.isModifierLeftOfPosition(e.startPosition,n)}static isModifierLeftOfPosition(e,n){let r=Ct.findAbstractNodesBeforePosition(e,n);for(let i=r.length-1;i>=0;i--){let s=r[i];if(s instanceof en||s instanceof Ht)return!1;if(s instanceof Pn)return!0}return!1}};var bl=class{constructor(){this.isRightOfOperator=!1;this.isLeftOfOperator=!1}static resolveContext(e,n,r){let i=new bl;return r!=null&&(r.prev!=null&&Ot.isOperatorType(r.prev)&&(i.isRightOfOperator=!0),r.next!=null&&Ot.isOperatorType(r.next)&&(i.isLeftOfOperator=!0)),i}};var rh=class{constructor(){this.inTagPart=!1;this.inMethodPart=!1}};var Tl=class{constructor(){this.modifierChain=null;this.activeModifier=null;this.name="";this.inModifierName=!1;this.inModifierParameter=!1;this.valueCount=0;this.activeValueIndex=-1;this.activeValue=null}static resolveContext(e,n,r,i){let s=n.getParser(),a=new Tl,o=s.getLanguageParser().getCreatedModifierChains(),l=null;for(let u=0;u(a[a.Unknown=0]="Unknown",a[a.Variable=1]="Variable",a[a.Modifier=2]="Modifier",a[a.Parameter=3]="Parameter",a[a.General=4]="General",a[a.LanguageOperator=5]="LanguageOperator",a))(sh||{});var Nl=class{constructor(){this.variableNode=null;this.varPathText=""}static resolveContext(e,n,r,i){var f;if(r==null)return null;let s=r,a=i.getDocumentParser().getLanguageParser(),o=new Nl,l=(f=i.wordAt(e))!=null?f:"";r instanceof St&&a.isMergedVariableComponent(r)==!1&&r.prev instanceof Ne&&(s=r.prev);let u="";if(a.isMergedVariableComponent(s)){let h=a.getMergedVariable(s);h.startPosition!=null&&(u=i.getText(h.startPosition.index,e.index).trim()),o.variableNode=h}else s instanceof Ne&&(o.variableNode=s,u=s.name,s.variableReference!=null&&(u=s.variableReference.normalizedReference));u.length>0&&(u=pr(u,"\\.",":"));let c=u.split(":");return l.trim().length>0&&c.pop(),u=c.join(":"),u.endsWith(":")&&(u=Hf(u,":")),o.varPathText=u,o}};var ji=class{static resolveIdentifierContext(e,n){let r=new rh;return n.nameMethodPartStartsOn!=null?e.char=n.nameStartsOn.char&&(d=!0),n.nameEndsOn!=null&&e.char>n.nameEndsOn.char&&(d=!1),d&&(h.isCursorInIdentifier=!0,h.identifierContext=ji.resolveIdentifierContext(e,n))}n.addContext(h),s!=null&&s.addContext(h),h.interpolatedContext=i,h.node=n,h.position=e,h.root=s,h.leftPunctuation=r.punctuationLeftAt(e),h.rightPunctuation=r.punctuationRightAt(e),h.leftChar=r.charLeftAt(e),h.rightChar=r.charRightAt(e),h.word=r.wordAt(e),h.char=r.charAt(e),h.leftWord=r.wordLeftAt(e),h.rightWord=r.wordRightAt(e);let y=!1;if(n.parameters.length>0)for(let d=0;dg.blockPosition.start.char&&e.char<=g.blockPosition.end.char+1&&e.line>=((l=(o=(a=g.namePosition)==null?void 0:a.start)==null?void 0:o.line)!=null?l:g.blockPosition.start.line)&&e.line<=((f=(c=(u=g.valuePosition)==null?void 0:u.end)==null?void 0:c.line)!=null?f:g.blockPosition.end.line)){h.cursorContext=3,h.parameterContext=vl.resolveContext(e,g),h.isInParameter=!0,h.feature=g,y=!0;break}}if(y||n.runtimeNodes.forEach(d=>{d.startPosition!=null&&d.endPosition!=null&&e.isWithin(d.startPosition,d.endPosition,1)&&(h.feature=d)}),y&&n.interpolationRegions.size>0){let d=Array.from(n.interpolationRegions,([g,m])=>m);for(let g=0;g=m.startOffset&&e.index<=m.endOffset){let b=n.getInterpolationNode(m.varContent);return ji.resolveContext(e,b,r,!0,s)}}}return h.feature instanceof Ne&&h.feature.isInterpolationReference&&h.feature.parent!=null&&h.feature.parent instanceof z&&h.feature.parent.processedInterpolationRegions.has(h.feature.name)?ji.resolveContext(e,h.feature.parent.getInterpolationNode(h.feature.name),r,!0,s):(yl.isModifierLeftOfPosition(e,n.runtimeNodes)?(h.cursorContext=2,h.modifierContext=Tl.resolveContext(e,n,h.feature,r)):y||(h.cursorContext=4,h.generalContext=bl.resolveContext(e,n,h.feature)),h.variableContext=Nl.resolveContext(e,n,h.feature,r),h)}return null}};var $s=class{static isPairedNode(e){return e instanceof Nn?!0:e instanceof $n||e instanceof z?e.isClosedBy!=null:!1}static findAncestorsBeforePosition(e,n){var o,l,u,c,f,h;let r=[],i=[],s=-1,a=-1;for(let y=0;y-1&&p.endPosition!=null&&(p.endPosition.line-1&&p.endPosition.char{Ct.isBefore(a.target,s)&&i.push(a)}),i}getAssignmentsAfter(e,n){let r=this.doc.getDocumentParser().getLanguageParser().getRuntimeAssignments(),i=[],s=this.position(e,n);return s!=null&&r.forEach(a=>{Ct.isAfter(a.target,s)&&i.push(a)}),i}getNodesAfter(e,n){return Ct.findNodesAfterPosition(this.position(e,n),this.doc.getDocumentParser().getNodes())}getIsWithinPairedNode(e,n){let r=this.getNodeBefore(e,n);return r==null?!1:$s.isPairedNode(r)}position(e,n){return this.doc.getDocumentParser().positionFromCursor(e,n)}charLeftAt(e,n){return this.doc.getDocumentParser().charLeftAtCursor(e,n)}charAt(e,n){return this.doc.getDocumentParser().charAtCursor(e,n)}charRightAt(e,n){return this.doc.getDocumentParser().charRightAtCursor(e,n)}wordLeftAt(e,n,r=4){return this.doc.getDocumentParser().wordLeftAtCursor(e,n,r)}wordRightAt(e,n,r=4){return this.doc.getDocumentParser().wordRightAtCursor(e,n,r)}wordAt(e,n,r=4){return this.doc.getDocumentParser().wordAtCursor(e,n,r)}punctuationLeftAt(e,n,r=4){return this.doc.getDocumentParser().punctuationLeftAtCursor(e,n,r)}punctuationRightAt(e,n,r=4){return this.doc.getDocumentParser().punctuationRightAtCursor(e,n,r)}};var oh=class{constructor(e){this.doc=e}hasAny(){return this.all().length>0}all(){let e=[],n=[];return this.doc.getAllAntlersNodes().forEach(r=>{r.getErrors().forEach(i=>{e.includes(i.hash())==!1&&(e.push(i.hash()),n.push(i))})}),this.doc.getDocumentParser().getAntlersErrors().forEach(r=>{e.includes(r.hash())==!1&&(e.push(r.hash()),n.push(r))}),n}};var Tv=je(Nh());var Ln=je(yv(),1),xQ=Ln.default.binaryOptions,RQ=Ln.default.boolOptions,wQ=Ln.default.intOptions,OQ=Ln.default.nullOptions,LQ=Ln.default.strOptions,FQ=Ln.default.Schema,kQ=Ln.default.Alias,MQ=Ln.default.Collection,BQ=Ln.default.Merge,qQ=Ln.default.Node,bv=Ln.default.Pair,xl=Ln.default.Scalar,Rl=Ln.default.YAMLMap,To=Ln.default.YAMLSeq;var Ch=class{constructor(e){this.documentScope=null;this.project=e}getKeyValue(e){return e instanceof xl?e.value:""}getNodeValue(e){return e instanceof xl?e.value:e instanceof Rl?this.analyzeDocument(e.items):e instanceof To?this.analyzeDocument(e.items):""}getScalarRuntimeType(e){return parseFloat(e).toString()==e||parseInt(e).toString()==e?"number":"string"}analyzeDocument(e){let n=new rr(this.project);return e.forEach(r=>{if(r instanceof bv){let i=this.getKeyValue(r.key),s=this.getNodeValue(r.value);if(r.value instanceof xl)n.addVariable({dataType:this.getScalarRuntimeType(s),introducedBy:null,name:i,sourceField:null,sourceName:"*frontmatter"});else if(r.value instanceof To&&r.key instanceof xl){let a=new rr(this.project);r.value.items.forEach(o=>{let l=this.getNodeValue(o);a.addVariable({dataType:this.getScalarRuntimeType(l),introducedBy:null,name:o.value,sourceField:null,sourceName:"*frontmatter"})}),n.addScopeList(r.key.value,a)}else n.addScopeList(i,s)}}),n}parse(e){let n=Tv.parseDocument(e);try{n.contents instanceof Rl&&(this.documentScope=this.analyzeDocument(n.contents.items))}catch{this.documentScope=null}}hasScope(){return this.documentScope!=null}getScope(){return this.documentScope}};var Ph=class{constructor(e){this.doc=e}getAncestors(e){return $s.findAncestorsBeforePosition(e,this.doc.getAllAntlersNodes())}getNodeAt(e){return Ct.findNodeAtPosition(e,this.doc.getDocumentParser().getNodes())}getNodesBefore(e){return Ct.findNodesBeforePosition(e,this.doc.getDocumentParser().getNodes())}getNodeBefore(e){return Ct.findNodeBeforePosition(e,this.doc.getDocumentParser().getNodes())}getNodeAfter(e){return Ct.findNodeAfterPosition(e,this.doc.getDocumentParser().getNodes())}getNodesAfter(e){return Ct.findNodesAfterPosition(e,this.doc.getDocumentParser().getNodes())}getIsWithinPairedNode(e){let n=this.getNodeBefore(e);return n==null?!1:$s.isPairedNode(n)}filter(e){return this.doc.getDocumentParser().getNodes().filter(e)}getComments(){let e=[];return this.doc.getAllNodes().forEach(n=>{n instanceof z&&n.isComment&&e.push(n)}),e}getMultilineNodes(){let e=[];return this.doc.getAllNodes().forEach(n=>{var r,i;n instanceof z&&!n.isComment&&((r=n.startPosition)==null?void 0:r.line)!=((i=n.endPosition)==null?void 0:i.line)&&e.push(n)}),e}getMultiLineComments(){let e=[];return this.getComments().forEach(n=>{var r,i;((r=n.startPosition)==null?void 0:r.line)!=((i=n.endPosition)==null?void 0:i.line)&&e.push(n)}),e}getAllLiteralNodes(){let e=[];return this.doc.getAllNodes().forEach(n=>{(n instanceof gt||n instanceof ln)&&e.push(n)}),e}getStructuralNodes(){let e=[];return this.doc.getDocumentParser().getRenderNodes().forEach(n=>{n instanceof z?e.push(n):n instanceof Nn&&n.logicBranches.length>0&&n.logicBranches.forEach(r=>{if(r.head!=null){let i=r.head;i.originalNode!=null?e.push(i.originalNode):e.push(i)}})}),e}getAllRuntimeNodes(){let e=[];return this.doc.getAllNodes().forEach(n=>{(n instanceof $n||n instanceof z)&&n.runtimeNodes.length>0&&n.runtimeNodes.forEach(r=>{e.push(r)})}),e}getAllParameterNodes(){let e=[];return this.doc.getAllNodes().forEach(n=>{(n instanceof $n||n instanceof z)&&n.hasParameters&&n.parameters.forEach(r=>{e.push(r)})}),e}getAssignmentNodes(){return Ct.findAssignmentNodes(this.getAllRuntimeNodes())}};var Ah=class{constructor(e){this.doc=e}getAllSelfClosingNodes(){let e=[];return this.doc.getAllNodes().forEach(n=>{n instanceof z&&n.isSelfClosing&&e.push(n)}),e}getAllPairedNodes(){let e=[];return this.doc.getAllNodes().forEach(n=>{(n instanceof z||n instanceof mt)&&n.isClosedBy!=null&&!n.isSelfClosing&&e.push(n)}),e}};var nf=class{static printComment(e,n,r){let i=e.getContent(),s=i.trim();if(s.includes(` +`),this.frontMatterEndLine=d+1;break}else y.push(g),p.push("")}}let n=[...this.content.matchAll(/(\n)/gm)],r=n.length,i=this.seedStartLine,s=null,a=0,o=0;for(let h=0;h{let y=h[0];if(y.startsWith(qe.AtChar)){u=this.content.indexOf(y,u)+2,c=!0;return}let p=this.content.indexOf(y,u);if(c&&u==p){u=p;return}this.antlersStartIndex.push(p),this.antlersStartPositionIndex.set(p,1),u=p+2,c=!1}),!0}prepareLiteralContent(e){return e.replace("@{{","{{")}scanToEndOfPhpRegion(e){for(this.currentIndex==this.inputLen&&(this.doesHaveUnclosedStructures=!0),this.currentIndex;this.currentIndexthis.inputLen?(r.endPosition=this.positionFromOffset(this.inputLen,this.inputLen-1),this.doesHaveUnclosedStructures=!0,this.antlersErrors.push(W.makeSyntaxError(S.TYPE_UNEXPECTED_EOI_WHILE_MANIFESTING_ANTLERS_NODE,r,"Unexpected end of input while locating end of Antlers region.")),r):(this.lastAntlersEndIndex=e+3+this.seedOffset,r.endPosition=this.positionFromOffset(e+this.seedOffset,e+3+this.seedOffset),r)}makeAntlersPhpFailedNode(e){let n=new zf;n.rawStart="{{$",n.rawEnd="$}}",n._isEndVirtual=!0,n.content=this.currentContent.join(""),n.sourceContent=this.sourceContent.join(""),n.startPosition=this.positionFromOffset(this.startIndex+this.seedOffset,this.startIndex+this.seedOffset);let r=this.getLineText(n.startPosition.line),i=this.getLineIndex(n.startPosition.line);if(r!=null){let a=r.substr(this._recoveryStartIndex);n.content=a,n.sourceContent=a}let s=e+this.seedOffset;return i!=null&&(this.currentIndex=i.end,s=i.end),n.endPosition=this.positionFromOffset(s,s),n}makeAntlersCommentFailedNode(e){let n=new Vo;this.isDoubleBrace?(n.rawStart="{{",n.rawEnd="}}"):(n.rawStart="{",n.rawEnd="}"),n._isEndVirtual=!0;let r=!1,i=this.currentContent.length;i>0&&this.currentContent[i-1]==qe.Punctuation_ForwardSlash&&(this.currentContent.pop(),r=!0),n.isComment=!0,n.isSelfClosing=r,n.withParser(this),n.content=this.currentContent.join(""),n.sourceContent=this.sourceContent.join(""),n.startPosition=this.positionFromOffset(this.startIndex+this.seedOffset,this.startIndex+this.seedOffset);let s=this.getLineText(n.startPosition.line),a=this.getLineIndex(n.startPosition.line);if(s!=null){let l=s.substr(this._recoveryStartIndex);n.content=l,n.sourceContent=l}let o=e+this.seedOffset;return a!=null&&(this.currentIndex=a.end,o=a.end),n.endPosition=this.positionFromOffset(o,o),n.interpolationRegions=new Map,this.interpolationRegions.forEach((l,u)=>{n.content.includes(u)&&n.interpolationRegions.set(u,l)}),n}makeAntlersFailedNode(e,n){let r=new mt;this.isDoubleBrace?(r.rawStart="{{",r.rawEnd="}}"):(r.rawStart="{",r.rawEnd="}"),r._isEndVirtual=!0;let i=!1,s=this.currentContent.length;s>0&&this.currentContent[s-1]==qe.Punctuation_ForwardSlash&&(this.currentContent.pop(),i=!0),r.isComment=n,r.isSelfClosing=i,r.withParser(this),r.content=this.currentContent.join(""),r.sourceContent=this.sourceContent.join(""),r.startPosition=this.positionFromOffset(this.startIndex+this.seedOffset,this.startIndex+this.seedOffset);let a=this.getLineText(r.startPosition.line),o=this.getLineIndex(r.startPosition.line);if(a!=null){let c=Z.trimLeft(this.content.substring(r.startPosition.offset+r.rawStart.length-1,o==null?void 0:o.end),"{");r.content=c,r.sourceContent=c}let l=e+this.seedOffset;o!=null&&(this.currentIndex=o.end,l=o.end),r.endPosition=this.positionFromOffset(l,l),r.interpolationRegions=new Map,this.interpolationRegions.forEach((c,f)=>{r.content.includes(f)&&r.interpolationRegions.set(f,c)});let u=this.nodeParser.parseNode(r);return this.mergeErrors(u.getErrors()),u}makeAntlersTagNode(e,n){let r=new z;this.isDoubleBrace?(r.rawStart="{{",r.rawEnd="}}"):(r.rawStart="{",r.rawEnd="}");let i=!1,s=this.currentContent.length;if(s>0&&this.currentContent[s-1]==qe.Punctuation_ForwardSlash&&(this.currentContent.pop(),i=!0),r.isInterpolationNode=this.isInterpolatedParser,r.isComment=n,r.isSelfClosing=i,r.withParser(this),r.content=this.currentContent.join(""),r.sourceContent=this.sourceContent.join(""),r.startPosition=this.positionFromOffset(this.startIndex+this.seedOffset,this.startIndex+this.seedOffset),e+2>this.inputLen)return r.endPosition=this.positionFromOffset(this.inputLen,this.inputLen-1),this.doesHaveUnclosedStructures=!0,this.antlersErrors.push(W.makeSyntaxError(S.TYPE_UNEXPECTED_EOI_WHILE_MANIFESTING_ANTLERS_NODE,r,"Unexpected end of input while locating end of Antlers region.")),r;if(n?this.lastAntlersEndIndex=e+2+this.seedOffset:this.lastAntlersEndIndex=e+1+this.seedOffset,r.endPosition=this.positionFromOffset(this.lastAntlersEndIndex,this.lastAntlersEndIndex),r.interpolationRegions=new Map,this.interpolationRegions.forEach((o,l)=>{r.content.includes(l)&&r.interpolationRegions.set(l,o)}),r.isComment)return r;let a=this.nodeParser.parseNode(r);return this.mergeErrors(a.getErrors()),a}mergeErrors(e){e.forEach(n=>{this.antlersErrors.push(n)})}getNodes(){return this.nodes}getNodesBetween(e,n){let r=[];return this.nodes.forEach(i=>{var s,a,o,l;((a=(s=i.startPosition)==null?void 0:s.offset)!=null?a:0)>e.offset&&((l=(o=i.endPosition)==null?void 0:o.offset)!=null?l:0)0&&this.nodes.push(this.makeLiteralNode(this.currentContent,this.startIndex,e)),this.currentContent=[],this.sourceContent=[])}makeLiteralNode(e,n,r){let i=new gt;return i.content=e.join(""),i.sourceContent=this.sourceContent.join(""),i.startPosition=this.positionFromOffset(n,n),i.endPosition=this.positionFromOffset(r,r),i.sourceContent=this.content.substr(n,r),i.withParser(this),i}addAntlersError(e){this.antlersErrors.push(e)}getAntlersErrors(){return this.antlersErrors}getStructureErrors(){return this.structureErrors}},w=qe;w.K_CHAR="char",w.K_LINE="line",w.NewLine=` +`,w.AtChar="@",w.LeftBrace="{",w.RightBrace="}",w.LeftBracket="[",w.RightBracket="]",w.String_EscapeCharacter="\\",w.String_Terminator_DoubleQuote='"',w.String_Terminator_SingleQuote="'",w.Punctuation_Question="?",w.Punctuation_Equals="=",w.Punctuation_Comma=",",w.Punctuation_Colon=":",w.Punctuation_Semicolon=";",w.Punctuation_Exclamation="!",w.Punctuation_Pipe="|",w.Punctuation_Ampersand="&",w.Punctuation_LessThan="<",w.Punctuation_GreaterThan=">",w.Punctuation_Octothorp="#",w.Punctuation_Tilde="~",w.Punctuation_FullStop=".",w.Punctuation_Dollar="$",w.Punctuation_Asterisk="*",w.Punctuation_Percent="%",w.Punctuation_Plus="+",w.Punctuation_Minus="-",w.Punctuation_Underscore="_",w.Punctuation_ForwardSlash="/",w.Punctuation_Caret="^",w.LeftParen="(",w.RightParent=")";var Ct=class{static findAssignmentNodes(e){let n=[];for(let r=0;re.index)break;r.push(s)}}return r}static isBefore(e,n){return e.startPosition==null?!1:e.startPosition.indexn.index}static findNodesBeforePosition(e,n){let r=[];if(e==null)return r;for(let i=0;ie.index)break;r.push(s)}}return r}static findNodesAfterPosition(e,n){let r=[];if(e==null)return r;for(let i=0;ie.index&&r.push(s)}return r}static findNodeBeforePosition(e,n){if(e==null)return null;let r=null;for(let i=0;ie.index)break;r=s}}return r}static findNodeAfterPosition(e,n){if(e==null)return null;for(let r=0;re.index)return i}return null}static findNodeAtPosition(e,n){if(e==null)return null;for(let r=0;r=i.startPosition.index&&e.index<=i.endPosition.index)return i}return null}static isLiteralType(e){return e instanceof ln||e instanceof gt}};var yl=class{static isModifierLeftOf(e,n){return yl.isModifierLeftOfPosition(e.startPosition,n)}static isModifierLeftOfPosition(e,n){let r=Ct.findAbstractNodesBeforePosition(e,n);for(let i=r.length-1;i>=0;i--){let s=r[i];if(s instanceof en||s instanceof Ht)return!1;if(s instanceof Pn)return!0}return!1}};var bl=class{constructor(){this.isRightOfOperator=!1;this.isLeftOfOperator=!1}static resolveContext(e,n,r){let i=new bl;return r!=null&&(r.prev!=null&&Ot.isOperatorType(r.prev)&&(i.isRightOfOperator=!0),r.next!=null&&Ot.isOperatorType(r.next)&&(i.isLeftOfOperator=!0)),i}};var rh=class{constructor(){this.inTagPart=!1;this.inMethodPart=!1}};var Tl=class{constructor(){this.modifierChain=null;this.activeModifier=null;this.name="";this.inModifierName=!1;this.inModifierParameter=!1;this.valueCount=0;this.activeValueIndex=-1;this.activeValue=null}static resolveContext(e,n,r,i){let s=n.getParser(),a=new Tl,o=s.getLanguageParser().getCreatedModifierChains(),l=null;for(let u=0;u(a[a.Unknown=0]="Unknown",a[a.Variable=1]="Variable",a[a.Modifier=2]="Modifier",a[a.Parameter=3]="Parameter",a[a.General=4]="General",a[a.LanguageOperator=5]="LanguageOperator",a))(sh||{});var Nl=class{constructor(){this.variableNode=null;this.varPathText=""}static resolveContext(e,n,r,i){var f;if(r==null)return null;let s=r,a=i.getDocumentParser().getLanguageParser(),o=new Nl,l=(f=i.wordAt(e))!=null?f:"";r instanceof At&&a.isMergedVariableComponent(r)==!1&&r.prev instanceof Ne&&(s=r.prev);let u="";if(a.isMergedVariableComponent(s)){let h=a.getMergedVariable(s);h.startPosition!=null&&(u=i.getText(h.startPosition.index,e.index).trim()),o.variableNode=h}else s instanceof Ne&&(o.variableNode=s,u=s.name,s.variableReference!=null&&(u=s.variableReference.normalizedReference));u.length>0&&(u=pr(u,"\\.",":"));let c=u.split(":");return l.trim().length>0&&c.pop(),u=c.join(":"),u.endsWith(":")&&(u=Hf(u,":")),o.varPathText=u,o}};var ji=class{static resolveIdentifierContext(e,n){let r=new rh;return n.nameMethodPartStartsOn!=null?e.char=n.nameStartsOn.char&&(d=!0),n.nameEndsOn!=null&&e.char>n.nameEndsOn.char&&(d=!1),d&&(h.isCursorInIdentifier=!0,h.identifierContext=ji.resolveIdentifierContext(e,n))}n.addContext(h),s!=null&&s.addContext(h),h.interpolatedContext=i,h.node=n,h.position=e,h.root=s,h.leftPunctuation=r.punctuationLeftAt(e),h.rightPunctuation=r.punctuationRightAt(e),h.leftChar=r.charLeftAt(e),h.rightChar=r.charRightAt(e),h.word=r.wordAt(e),h.char=r.charAt(e),h.leftWord=r.wordLeftAt(e),h.rightWord=r.wordRightAt(e);let y=!1;if(n.parameters.length>0)for(let d=0;dg.blockPosition.start.char&&e.char<=g.blockPosition.end.char+1&&e.line>=((l=(o=(a=g.namePosition)==null?void 0:a.start)==null?void 0:o.line)!=null?l:g.blockPosition.start.line)&&e.line<=((f=(c=(u=g.valuePosition)==null?void 0:u.end)==null?void 0:c.line)!=null?f:g.blockPosition.end.line)){h.cursorContext=3,h.parameterContext=vl.resolveContext(e,g),h.isInParameter=!0,h.feature=g,y=!0;break}}if(y||n.runtimeNodes.forEach(d=>{d.startPosition!=null&&d.endPosition!=null&&e.isWithin(d.startPosition,d.endPosition,1)&&(h.feature=d)}),y&&n.interpolationRegions.size>0){let d=Array.from(n.interpolationRegions,([g,m])=>m);for(let g=0;g=m.startOffset&&e.index<=m.endOffset){let b=n.getInterpolationNode(m.varContent);return ji.resolveContext(e,b,r,!0,s)}}}return h.feature instanceof Ne&&h.feature.isInterpolationReference&&h.feature.parent!=null&&h.feature.parent instanceof z&&h.feature.parent.processedInterpolationRegions.has(h.feature.name)?ji.resolveContext(e,h.feature.parent.getInterpolationNode(h.feature.name),r,!0,s):(yl.isModifierLeftOfPosition(e,n.runtimeNodes)?(h.cursorContext=2,h.modifierContext=Tl.resolveContext(e,n,h.feature,r)):y||(h.cursorContext=4,h.generalContext=bl.resolveContext(e,n,h.feature)),h.variableContext=Nl.resolveContext(e,n,h.feature,r),h)}return null}};var $s=class{static isPairedNode(e){return e instanceof Nn?!0:e instanceof $n||e instanceof z?e.isClosedBy!=null:!1}static findAncestorsBeforePosition(e,n){var o,l,u,c,f,h;let r=[],i=[],s=-1,a=-1;for(let y=0;y-1&&p.endPosition!=null&&(p.endPosition.line-1&&p.endPosition.char{Ct.isBefore(a.target,s)&&i.push(a)}),i}getAssignmentsAfter(e,n){let r=this.doc.getDocumentParser().getLanguageParser().getRuntimeAssignments(),i=[],s=this.position(e,n);return s!=null&&r.forEach(a=>{Ct.isAfter(a.target,s)&&i.push(a)}),i}getNodesAfter(e,n){return Ct.findNodesAfterPosition(this.position(e,n),this.doc.getDocumentParser().getNodes())}getIsWithinPairedNode(e,n){let r=this.getNodeBefore(e,n);return r==null?!1:$s.isPairedNode(r)}position(e,n){return this.doc.getDocumentParser().positionFromCursor(e,n)}charLeftAt(e,n){return this.doc.getDocumentParser().charLeftAtCursor(e,n)}charAt(e,n){return this.doc.getDocumentParser().charAtCursor(e,n)}charRightAt(e,n){return this.doc.getDocumentParser().charRightAtCursor(e,n)}wordLeftAt(e,n,r=4){return this.doc.getDocumentParser().wordLeftAtCursor(e,n,r)}wordRightAt(e,n,r=4){return this.doc.getDocumentParser().wordRightAtCursor(e,n,r)}wordAt(e,n,r=4){return this.doc.getDocumentParser().wordAtCursor(e,n,r)}punctuationLeftAt(e,n,r=4){return this.doc.getDocumentParser().punctuationLeftAtCursor(e,n,r)}punctuationRightAt(e,n,r=4){return this.doc.getDocumentParser().punctuationRightAtCursor(e,n,r)}};var oh=class{constructor(e){this.doc=e}hasStructureErrors(){return this.doc.getDocumentParser().getStructureErrors().length>0}getFirstStructureError(){return this.doc.getDocumentParser().getStructureErrors()[0]}hasAny(){return this.all().length>0}all(){let e=[],n=[];return this.doc.getAllAntlersNodes().forEach(r=>{r.getErrors().forEach(i=>{e.includes(i.hash())==!1&&(e.push(i.hash()),n.push(i))})}),this.doc.getDocumentParser().getAntlersErrors().forEach(r=>{e.includes(r.hash())==!1&&(e.push(r.hash()),n.push(r))}),n}};var vv=je(Nh());var Ln=je(bv(),1),FQ=Ln.default.binaryOptions,kQ=Ln.default.boolOptions,MQ=Ln.default.intOptions,BQ=Ln.default.nullOptions,qQ=Ln.default.strOptions,VQ=Ln.default.Schema,jQ=Ln.default.Alias,UQ=Ln.default.Collection,WQ=Ln.default.Merge,GQ=Ln.default.Node,Tv=Ln.default.Pair,xl=Ln.default.Scalar,Rl=Ln.default.YAMLMap,To=Ln.default.YAMLSeq;var Ch=class{constructor(e){this.documentScope=null;this.project=e}getKeyValue(e){return e instanceof xl?e.value:""}getNodeValue(e){return e instanceof xl?e.value:e instanceof Rl?this.analyzeDocument(e.items):e instanceof To?this.analyzeDocument(e.items):""}getScalarRuntimeType(e){return parseFloat(e).toString()==e||parseInt(e).toString()==e?"number":"string"}analyzeDocument(e){let n=new rr(this.project);return e.forEach(r=>{if(r instanceof Tv){let i=this.getKeyValue(r.key),s=this.getNodeValue(r.value);if(r.value instanceof xl)n.addVariable({dataType:this.getScalarRuntimeType(s),introducedBy:null,name:i,sourceField:null,sourceName:"*frontmatter"});else if(r.value instanceof To&&r.key instanceof xl){let a=new rr(this.project);r.value.items.forEach(o=>{let l=this.getNodeValue(o);a.addVariable({dataType:this.getScalarRuntimeType(l),introducedBy:null,name:o.value,sourceField:null,sourceName:"*frontmatter"})}),n.addScopeList(r.key.value,a)}else n.addScopeList(i,s)}}),n}parse(e){let n=vv.parseDocument(e);try{n.contents instanceof Rl&&(this.documentScope=this.analyzeDocument(n.contents.items))}catch{this.documentScope=null}}hasScope(){return this.documentScope!=null}getScope(){return this.documentScope}};var Ph=class{constructor(e){this.doc=e}getAncestors(e){return $s.findAncestorsBeforePosition(e,this.doc.getAllAntlersNodes())}getNodeAt(e){return Ct.findNodeAtPosition(e,this.doc.getDocumentParser().getNodes())}getNodesBefore(e){return Ct.findNodesBeforePosition(e,this.doc.getDocumentParser().getNodes())}getNodeBefore(e){return Ct.findNodeBeforePosition(e,this.doc.getDocumentParser().getNodes())}getNodeAfter(e){return Ct.findNodeAfterPosition(e,this.doc.getDocumentParser().getNodes())}getNodesAfter(e){return Ct.findNodesAfterPosition(e,this.doc.getDocumentParser().getNodes())}getIsWithinPairedNode(e){let n=this.getNodeBefore(e);return n==null?!1:$s.isPairedNode(n)}filter(e){return this.doc.getDocumentParser().getNodes().filter(e)}getComments(){let e=[];return this.doc.getAllNodes().forEach(n=>{n instanceof z&&n.isComment&&e.push(n)}),e}getMultilineNodes(){let e=[];return this.doc.getAllNodes().forEach(n=>{var r,i;n instanceof z&&!n.isComment&&((r=n.startPosition)==null?void 0:r.line)!=((i=n.endPosition)==null?void 0:i.line)&&e.push(n)}),e}getMultiLineComments(){let e=[];return this.getComments().forEach(n=>{var r,i;((r=n.startPosition)==null?void 0:r.line)!=((i=n.endPosition)==null?void 0:i.line)&&e.push(n)}),e}getAllLiteralNodes(){let e=[];return this.doc.getAllNodes().forEach(n=>{(n instanceof gt||n instanceof ln)&&e.push(n)}),e}getStructuralNodes(){let e=[];return this.doc.getDocumentParser().getRenderNodes().forEach(n=>{n instanceof z?e.push(n):n instanceof Nn&&n.logicBranches.length>0&&n.logicBranches.forEach(r=>{if(r.head!=null){let i=r.head;i.originalNode!=null?e.push(i.originalNode):e.push(i)}})}),e}getAllRuntimeNodes(){let e=[];return this.doc.getAllNodes().forEach(n=>{(n instanceof $n||n instanceof z)&&n.runtimeNodes.length>0&&n.runtimeNodes.forEach(r=>{e.push(r)})}),e}getAllParameterNodes(){let e=[];return this.doc.getAllNodes().forEach(n=>{(n instanceof $n||n instanceof z)&&n.hasParameters&&n.parameters.forEach(r=>{e.push(r)})}),e}getAssignmentNodes(){return Ct.findAssignmentNodes(this.getAllRuntimeNodes())}};var Sh=class{constructor(e){this.doc=e}getAllSelfClosingNodes(){let e=[];return this.doc.getAllNodes().forEach(n=>{n instanceof z&&n.isSelfClosing&&e.push(n)}),e}getAllPairedNodes(){let e=[];return this.doc.getAllNodes().forEach(n=>{(n instanceof z||n instanceof mt)&&n.isClosedBy!=null&&!n.isSelfClosing&&e.push(n)}),e}};var nf=class{static printComment(e,n,r){let i=e.getContent(),s=i.trim();if(s.includes(` `)){let a=Z.breakByNewLine(i.trim()),o=[];a.forEach(c=>{o.push(" ".repeat(n+r)+c.trim())});let l=o.join(` `),u=`{{# `;return u+=l,u+=` @@ -374,19 +376,19 @@ Includes another view into the current template. `)}static shiftIndent(e,n,r=!1,i=4,s=!0){n<0&&(n=0);let a=Z.breakByNewLine(e.trim()),o=[];for(let u=0;u0&&n-i>i&&o[o.length-1].trim()==") }}"){a=Z.breakByNewLine(l.trim()),o=[];for(let u=0;u{o.trim().length>0&&(a=!0),!!a&&i.push(s+o)}),i.join(` -`)}static inferIndentLevel(e,n,r){let i=0,s=-1;for(let a=0;a0)for(let a=s-1;a>=0;a--){let o=e[a],l=o.trim(),u=o.trimLeft(),c=o.length-l.length;if(u.length!=0&&c!=i&&c0&&(this.buffer+=r+" ")}setIndentSeed(e){return this.indentSeed=e,this}close(){return this.closeString==" }}"?this.buffer.endsWith(" ")?this.buffer+="}}":this.buffer+=this.closeString:this.buffer+=this.closeString,this}appendT(e){return this.buffer.endsWith(" ")&&(this.buffer=this.buffer.trimEnd()),this.buffer+=e,this}appendTS(e){return this.buffer.endsWith(" ")&&(this.buffer=this.buffer.trimEnd()),this.buffer.endsWith("{")&&(e=e.trimStart()),this.buffer+=e,this}append(e){return this.buffer+=e,this}appendOS(e){return this.buffer.endsWith(" ")==!1&&this.buffer.endsWith("(")==!1&&this.buffer.endsWith("{")==!1&&this.buffer.endsWith("[")==!1&&this.buffer.endsWith(":")==!1&&(this.buffer+=" "),this.append(e)}appendS(e){let n="";return this.buffer.endsWith(" ")==!1&&(n+=" "),n+=e+" ",this.buffer+=n,this}indent(){let e=this.baseIndent;return e==0?e=1:e+=2,this.relativeIndentSize>0&&(e+=this.relativeIndentSize),this.buffer+=" ".repeat(e),this}addIndent(e){return e<=0?this:(this.buffer+=" ".repeat(e),this)}paramS(e){let n=" ";return e.isVariableReference&&(n+=":"),n+=e.name+"="+e.nameDelimiter+e.value+e.nameDelimiter,this.append(n),this}replace(e,n){return this.buffer=pr(this.buffer,e,n),this}relativeIndent(e){let n=this.buffer.split(` +`)}static inferIndentLevel(e,n,r){let i=0,s=-1;for(let a=0;a0)for(let a=s-1;a>=0;a--){let o=e[a],l=o.trim(),u=o.trimLeft(),c=o.length-l.length;if(u.length!=0&&c!=i&&c0&&(this.buffer+=r+" ")}setIndentSeed(e){return this.indentSeed=e,this}close(){return this.closeString==" }}"?this.buffer.endsWith(" ")?this.buffer+="}}":this.buffer+=this.closeString:this.buffer+=this.closeString,this}appendT(e){return this.buffer.endsWith(" ")&&(this.buffer=this.buffer.trimEnd()),this.buffer+=e,this}appendTS(e){return this.buffer.endsWith(" ")&&(this.buffer=this.buffer.trimEnd()),this.buffer.endsWith("{")&&(e=e.trimStart()),this.buffer+=e,this}append(e){return this.buffer+=e,this}appendOS(e){return this.buffer.endsWith(" ")==!1&&this.buffer.endsWith("(")==!1&&this.buffer.endsWith("{")==!1&&this.buffer.endsWith("[")==!1&&this.buffer.endsWith(":")==!1&&(this.buffer+=" "),this.append(e)}appendS(e){let n="";return this.buffer.endsWith(" ")==!1&&(n+=" "),n+=e+" ",this.buffer+=n,this}indent(){let e=this.baseIndent;return e==0?e=1:e+=2,this.relativeIndentSize>0&&(e+=this.relativeIndentSize),this.buffer+=" ".repeat(e),this}addIndent(e){return e<=0?this:(this.buffer+=" ".repeat(e),this)}paramS(e){let n=" ";return e.isVariableReference&&(n+=":"),n+=e.name+"="+e.nameDelimiter+e.value+e.nameDelimiter,this.append(n),this}replace(e,n){return this.buffer=pr(this.buffer,e,n),this}relativeIndent(e){let n=this.buffer.split(` `);if(n.length==0)return this;let r=n[n.length-1].trimEnd();return r.endsWith("(")&&(r=r.slice(0,-1)),r.endsWith(e)==!1?this:(this.relativeIndentSize=r.lastIndexOf(e),this)}newlineIndent(){return this.newLine(),this.indent(),this}newlineNDIndent(){return this.buffer=this.buffer.trimEnd(),this.newLine(),this.indent(),this}newLine(){return this.buffer+=` -`,this}getContent(){return this.buffer}endsWith(e){return this.buffer.endsWith(e)}};var wl=class{static prettyPrintNode(e,n,r,i,s,a){var c,f,h,y,p,d,g;let o=e.getTrueRuntimeNodes(),l=0,u=0;if(o.length>0){let m=new Sh(e,r,s);a!=null&&m.setIndentSeed(a);let b=null;for(let N=0;N1?m.newlineNDIndent().indent().addIndent(6).appendS(C.name):m.appendS(C.name);b=C;continue}C.mergeRefName!=null&&C.mergeRefName.trim().length>0&&C.mergeRefName!=C.name?m.append(C.mergeRefName.trim()):C.name=="as"?m.appendOS("as"):m.append(C.name.trim())}else if(C instanceof $r)if(m.appendTS(" list"),N+10&&(L=C.rawLexContent.trim()),m.append(L)}else if(C instanceof Qn)m.appendS("=");else if(C instanceof Sn)m.appendS("=>");else if(C instanceof Kn)m.appendS("+");else if(C instanceof Cn){if(n.getDocumentParser().getLanguageParser().isMergedVariableComponent(C)){m.append("-");continue}if(C.prev!=null&&C.next!=null&<.distance(C.prev,C)<=1&<.distance(C.next,C)<=1){C.next instanceof Bt&&C.prev instanceof Bt?m.appendS("-"):m.append("-"),b=C;continue}m.appendS("-")}else if(C instanceof Xn)m.appendS("*");else if(C instanceof zn){if(b=C,(g=C.startPosition)==null?void 0:g.isBefore(e.nameEndsOn)){m.append("/");continue}if(n.getDocumentParser().getLanguageParser().isMergedVariableComponent(C))continue;m.appendS("/");continue}else C instanceof un?C.isListGroupMember?(m.append(";").newlineIndent().indent().addIndent(7),N+1{m.paramS(N)}),m.close();let _=m.getContent();return e.processedInterpolationRegions.size>0&&e.processedInterpolationRegions.forEach((N,C)=>{let G=wl.prettyPrintNode(N[0],n,r,i,null,null);_=pr(_,C,G)}),_}return e.getTrueRawContent()}};var Ol=class{constructor(e){this.htmlFormatter=null;this.yamlFormatter=null;this.phpFormatter=null;this.slugs=[];this.removeLines=[];this.virtualStructureOpens=[];this.virtualStructureClose=[];this.structureLines=[];this.parentTransformer=null;this.tagPairs=new Map;this.conditions=[];this.inlineIfs=new Map;this.createExraStructuralPairs=!1;this.spanNodes=new Map;this.inlineNodes=new Map;this.virtualBlocks=[];this.inlineComments=new Map;this.blockComments=[];this.extractedEmbeddedDocuments=new Map;this.dynamicElementAntlers=new Map;this.dynamicElementAntlersNodes=new Map;this.dynamicElementPairedAntlers=new Map;this.dynamicElementPairedAntlersNodes=new Map;this.dynamicElementConditionAntlers=new Map;this.dynamicElementConditionAntlersNodes=new Map;this.noParses=new Map;this.forceBreaks=[];this.forceCleanLines=["{{ /if","{{ /unless","{{ /noparse","{{ else","{{ unless"];this.doc=e,this.options={tabSize:4,newlinesAfterFrontMatter:1,maxAntlersStatementsPerLine:3,endNewline:!0}}withHtmlFormatter(e){return this.htmlFormatter=e,this}withYamlFormatter(e){return this.yamlFormatter=e,this}withPhpFormatter(e){return this.phpFormatter=e,this}withOptions(e){return this.options=e,this.options.tabSize<=0&&(this.options.tabSize=4),this.options.newlinesAfterFrontMatter<0&&(this.options.newlinesAfterFrontMatter=1),this}setParentTransformer(e){return this.parentTransformer=e,this}close(e){return""}open(e){return"<"+e+">"}selfClosing(e){return"<"+e+" />"}pair(e,n=""){return"<"+e+">"+n+""}makeSlug(e){e<=2&&(e=7);let n="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=r.length;for(let a=0;a{n=n.replace(i,r.nodeContent)}),n}registerCondition(e){this.parentTransformer!=null?this.parentTransformer.registerCondition(e):this.conditions.push(e)}registerInlineCondition(e,n){this.parentTransformer!=null?this.parentTransformer.registerInlineCondition(e,n):this.inlineIfs.set(e,n)}registerVirtualBlock(e){this.parentTransformer!=null?this.parentTransformer.registerVirtualBlock(e):this.virtualBlocks.push(e)}registerNoParse(e,n){this.parentTransformer!=null?this.parentTransformer.registerNoParse(e,n):this.noParses.set(e,n)}prepareNoParse(e){let n=this.makeSlug(35);return this.registerNoParse(n,e),n}registerForcedBreak(){if(this.parentTransformer!=null)return this.parentTransformer.registerForcedBreak();{let e=this.makeSlug(15),n=this.makeSlug(10);return this.forceBreaks.push(e),this.forceBreaks.push(n),this.removeLines.push(this.open(e)),this.removeLines.push(this.close(e)),this.removeLines.push(this.selfClosing(n)),this.pair(e,this.selfClosing(n))}}transformVirtualStructures(e){let n=e;return this.virtualBlocks.forEach(r=>{var s;this.removeLines.push(r.pairClose);let i=this.indentLevel(r.pairOpen);if(r.virtualElement.length>0&&(this.removeLines.push(this.open(r.virtualElement)),this.removeLines.push(this.close(r.virtualElement))),r.node instanceof ln){let a="{{ noparse }}"+r.node.getInnerDocumentText();n=n.replace(r.pairOpen,a)}if(r.node instanceof z){let a=r.node;n=n.replace(r.pairClose,(s=a.isClosedBy)==null?void 0:s.getOriginalContent())}else this.removeLines.push(r.pairClose)}),this.noParses.forEach((r,i)=>{n=n.replace(i,`{{ noparse }}${r.getInnerDocumentText()}{{ /noparse }}`)}),n}printNode(e,n=null){let r=e.getTrueNode(),i=this.doc;e.childDocument!=null&&(i=e.childDocument.document);let s=null;if(Hn.isConditionalStructure(e)&&(s=r.runtimeName(),e.isClosingTag&&(s=="if"||s=="unless")))return`{{ /${s} }}`;if(e.isClosingTag)return r.runtimeName()=="endunless"?"{{ /unless }}":`{{ ${r.content.trim()} }}`;let a=wl.prettyPrintNode(r,i,0,this.options,s,null);return n!=null&&a.includes(` -`)&&(a=vo.shiftIndent(a,n-this.options.tabSize*2,!0)),a}transformConditions(e){let n=e;return this.conditions.forEach(r=>{r.structures.forEach(i=>{let s=i.branch.head;i.virtualBreakOpen.length>0&&this.removeLines.push(i.virtualBreakOpen),i.virtualBreakClose.length>0&&(n=n.replace(i.virtualBreakClose,i.virtualBreakClose+` -`),this.removeLines.push(i.virtualBreakClose)),this.virtualStructureOpens.push(i.virtualOpen),this.removeLines.push(i.virtualOpen),this.removeLines.push(i.virtualClose),i.isLast?(n=n.replace(i.pairOpen,this.printNode(s,this.indentLevel(i.pairOpen))),n=n.replace(i.pairClose,this.printNode(s.isClosedBy))):(this.removeLines.push(i.pairClose),n=n.replace(i.pairOpen,this.printNode(s,this.indentLevel(i.pairOpen))))})}),n}transformExtractedDocuments(e){let n=e;return this.extractedEmbeddedDocuments.forEach((r,i)=>{let s="",a=0;r.isScript?s="//"+i:s="/*"+i+"*/",a=this.indentLevel(s),n.includes(s)&&(n=n.replace(s,vo.indentRelative(r.content,a)))}),n}getAntlersChildDoc(e){return e.childDocument!=null?e.childDocument.document.transform().setParentTransformer(this).toStructure():this.clone().toStructure(e.getImmediateChildren())}prepareCondition(e){let n=e.logicBranches[0].head;if(n.fragmentPosition==2||n.fragmentPosition==1){let l=this.makeSlug(e.nodeContent.length);return this.registerInlineCondition(l,e),l}if(n.fragmentPosition==0)return this.prepareDynamicCondition(e);let r=[],i="";n.prev instanceof z&&n.prev.isInlineAntlers&&(i+=this.registerForcedBreak()),e.logicBranches.forEach((l,u)=>{var d,g,m,b;let c=l.head,f=this.getAntlersChildDoc(l),h=this.makeSlug(c.sourceContent.length),y=this.makeSlug(10),p={branch:l,slug:h,doc:f,pairOpen:this.open(h),pairClose:this.close(h),virtualOpen:this.open(y),virtualClose:this.close(y),isFirst:u==0,isLast:u==e.logicBranches.length-1,virtualBreakClose:"",virtualBreakOpen:""};if(((g=(d=l.head)==null?void 0:d.name)==null?void 0:g.getCompoundTagName())=="else"){i+=` -`+p.pairOpen;let _=this.makeSlug(25);this.createExraStructuralPairs&&l.head.containsChildStructures==!1&&l.head.containsAnyFragments==!1?(p.virtualBreakOpen=this.open(_),p.virtualBreakClose=this.close(_),i+=p.virtualBreakOpen+` +`,this}getContent(){return this.buffer}endsWith(e){return this.buffer.endsWith(e)}};var wl=class{static prettyPrintNode(e,n,r,i,s,a){var c,f,h,y,p,d,g;let o=e.getTrueRuntimeNodes(),l=0,u=0;if(o.length>0){let m=new Ah(e,r,s);a!=null&&m.setIndentSeed(a);let b=null;for(let N=0;N1?m.newlineNDIndent().indent().addIndent(6).appendS(C.name):m.appendS(C.name);b=C;continue}C.mergeRefName!=null&&C.mergeRefName.trim().length>0&&C.mergeRefName!=C.name?m.append(C.mergeRefName.trim()):C.name=="as"?m.appendOS("as"):m.append(C.name.trim())}else if(C instanceof $r)if(m.appendTS(" list"),N+10&&(L=C.rawLexContent.trim()),m.append(L)}else if(C instanceof Qn)m.appendS("=");else if(C instanceof An)m.appendS("=>");else if(C instanceof Kn)m.appendS("+");else if(C instanceof Cn){if(n.getDocumentParser().getLanguageParser().isMergedVariableComponent(C)){m.append("-");continue}if(C.prev!=null&&C.next!=null&<.distance(C.prev,C)<=1&<.distance(C.next,C)<=1){C.next instanceof Bt&&C.prev instanceof Bt?m.appendS("-"):m.append("-"),b=C;continue}m.appendS("-")}else if(C instanceof Xn)m.appendS("*");else if(C instanceof zn){if(b=C,(g=C.startPosition)==null?void 0:g.isBefore(e.nameEndsOn)){m.append("/");continue}if(n.getDocumentParser().getLanguageParser().isMergedVariableComponent(C))continue;m.appendS("/");continue}else C instanceof un?C.isListGroupMember?(m.append(";").newlineIndent().indent().addIndent(7),N+1{m.paramS(N)}),m.close();let _=m.getContent();return e.processedInterpolationRegions.size>0&&e.processedInterpolationRegions.forEach((N,C)=>{let G=wl.prettyPrintNode(N[0],n,r,i,null,null);_=pr(_,C,G)}),_}return e.getTrueRawContent()}};var Ol=class{constructor(e){this.htmlFormatter=null;this.yamlFormatter=null;this.phpFormatter=null;this.slugs=[];this.removeLines=[];this.virtualStructureOpens=[];this.virtualStructureClose=[];this.structureLines=[];this.parentTransformer=null;this.tagPairs=new Map;this.conditions=[];this.inlineIfs=new Map;this.createExraStructuralPairs=!1;this.spanNodes=new Map;this.inlineNodes=new Map;this.virtualBlocks=[];this.inlineComments=new Map;this.blockComments=[];this.extractedEmbeddedDocuments=new Map;this.dynamicElementAntlers=new Map;this.dynamicElementAntlersNodes=new Map;this.dynamicElementPairedAntlers=new Map;this.dynamicElementPairedAntlersNodes=new Map;this.dynamicElementConditionAntlers=new Map;this.dynamicElementConditionAntlersNodes=new Map;this.noParses=new Map;this.forceBreaks=[];this.forceCleanLines=["{{ if ","{{ /if","{{ /unless","{{ /noparse","{{ else","{{ unless"];this.doc=e,this.options={tabSize:4,newlinesAfterFrontMatter:1,maxAntlersStatementsPerLine:3,endNewline:!0}}produceExtraStructuralPairs(e){return this.createExraStructuralPairs=e,this}withHtmlFormatter(e){return this.htmlFormatter=e,this}withYamlFormatter(e){return this.yamlFormatter=e,this}withPhpFormatter(e){return this.phpFormatter=e,this}withOptions(e){return this.options=e,this.options.tabSize<=0&&(this.options.tabSize=4),this.options.newlinesAfterFrontMatter<0&&(this.options.newlinesAfterFrontMatter=1),this}setParentTransformer(e){return this.parentTransformer=e,this}close(e){return""}open(e){return"<"+e+">"}selfClosing(e){return"<"+e+" />"}pair(e,n=""){return"<"+e+">"+n+""}makeSlug(e){e<=2&&(e=7);let n="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=r.length;for(let a=0;a{n=n.replace(i,r.nodeContent)}),n}registerCondition(e){this.parentTransformer!=null?this.parentTransformer.registerCondition(e):this.conditions.push(e)}registerInlineCondition(e,n){this.parentTransformer!=null?this.parentTransformer.registerInlineCondition(e,n):this.inlineIfs.set(e,n)}registerVirtualBlock(e){this.parentTransformer!=null?this.parentTransformer.registerVirtualBlock(e):this.virtualBlocks.push(e)}registerNoParse(e,n){this.parentTransformer!=null?this.parentTransformer.registerNoParse(e,n):this.noParses.set(e,n)}prepareNoParse(e){let n=this.makeSlug(35);return this.registerNoParse(n,e),n}registerForcedBreak(){if(this.parentTransformer!=null)return this.parentTransformer.registerForcedBreak();{let e=this.makeSlug(15),n=this.makeSlug(10);return this.forceBreaks.push(e),this.forceBreaks.push(n),this.removeLines.push(this.open(e)),this.removeLines.push(this.close(e)),this.removeLines.push(this.selfClosing(n)),this.pair(e,this.selfClosing(n))}}transformVirtualStructures(e){let n=e;return this.virtualBlocks.forEach(r=>{var s;this.removeLines.push(r.pairClose);let i=this.indentLevel(r.pairOpen);if(r.virtualElement.length>0&&(this.removeLines.push(this.open(r.virtualElement)),this.removeLines.push(this.close(r.virtualElement))),r.node instanceof ln){let a="{{ noparse }}"+r.node.getInnerDocumentText();n=n.replace(r.pairOpen,a)}if(r.node instanceof z){let a=r.node;n=n.replace(r.pairClose,(s=a.isClosedBy)==null?void 0:s.getOriginalContent())}else this.removeLines.push(r.pairClose)}),this.noParses.forEach((r,i)=>{n=n.replace(i,`{{ noparse }}${r.getInnerDocumentText()}{{ /noparse }}`)}),n}printNode(e,n=null){let r=e.getTrueNode();if((r.rawStart=="{{?"||r.rawStart=="{{$")&&this.phpFormatter!=null)try{let o=this.phpFormatter(r.content);return`${r.rawStart} ${o} ${r.rawEnd}`}catch{}let i=this.doc;e.childDocument!=null&&(i=e.childDocument.document);let s=null;if(Hn.isConditionalStructure(e)&&(s=r.runtimeName(),e.isClosingTag&&(s=="if"||s=="unless")))return`{{ /${s} }}`;if(e.isClosingTag)return r.runtimeName()=="endunless"?"{{ /unless }}":`{{ ${r.content.trim()} }}`;let a=wl.prettyPrintNode(r,i,0,this.options,s,null);return n!=null&&a.includes(` +`)&&(a=vo.shiftIndent(a,n-this.options.tabSize*2,!0)),a}transformConditions(e){let n=e;return this.conditions.forEach(r=>{r.structures.forEach(i=>{let s=i.branch.head;if(i.virtualBreakOpen.length>0&&this.removeLines.push(i.virtualBreakOpen),i.virtualBreakClose.length>0&&(n=n.replace(i.virtualBreakClose,i.virtualBreakClose+` +`),this.removeLines.push(i.virtualBreakClose)),this.virtualStructureOpens.push(i.virtualOpen),this.removeLines.push(i.virtualOpen),this.removeLines.push(i.virtualClose),i.isLast){let a=this.selfClosing(i.virtualSlug);n.includes(a)&&(n=n.replace(a,i.doc.trim())),n=n.replace(i.pairOpen,this.printNode(s,this.indentLevel(i.pairOpen))),n=n.replace(i.pairClose,this.printNode(s.isClosedBy))}else{let a=this.selfClosing(i.virtualSlug);n.includes(a)&&(n=n.replace(a,i.doc.trim())),this.removeLines.push(i.pairClose),n=n.replace(i.pairOpen,this.printNode(s,this.indentLevel(i.pairOpen)))}})}),n}transformExtractedDocuments(e){let n=e;return this.extractedEmbeddedDocuments.forEach((r,i)=>{let s="",a=0;r.isScript?s="//"+i:s="/*"+i+"*/",a=this.indentLevel(s),n.includes(s)&&(n=n.replace(s,vo.indentRelative(r.content,a)))}),n}getAntlersChildDoc(e){return e.childDocument!=null?e.childDocument.document.transform().setParentTransformer(this).toStructure():this.clone().toStructure(e.getImmediateChildren())}prepareCondition(e){let n=e.logicBranches[0].head;if(n.fragmentPosition==2||n.fragmentPosition==1){let l=this.makeSlug(e.nodeContent.length);return this.registerInlineCondition(l,e),l}if(n.fragmentPosition==0)return this.prepareDynamicCondition(e);let r=[],i="";n.prev instanceof z&&n.prev.isInlineAntlers&&(i+=this.registerForcedBreak()),e.logicBranches.forEach((l,u)=>{var d,g,m,b;let c=l.head,f=this.getAntlersChildDoc(l),h=this.makeSlug(c.sourceContent.length),y=this.makeSlug(10),p={branch:l,slug:h,doc:f,pairOpen:this.open(h),pairClose:this.close(h),virtualOpen:this.open(y),virtualClose:this.close(y),virtualSlug:y,isFirst:u==0,isLast:u==e.logicBranches.length-1,virtualBreakClose:"",virtualBreakOpen:""};if(((g=(d=l.head)==null?void 0:d.name)==null?void 0:g.getCompoundTagName())=="else"){i+=` +`+p.pairOpen;let _=this.makeSlug(25);this.createExraStructuralPairs&&l.head.containsChildStructures==!1&&l.head.containsAnyFragments==!1?(p.virtualBreakOpen=this.open(_),p.virtualBreakClose=this.close(_),p.virtualSlug=_,i+=` +`+this.selfClosing(_),i+=p.pairClose+` +`):(p.virtualBreakOpen=this.selfClosing(_),i+=p.virtualBreakOpen+` `,i+=f,i+=` -`+p.virtualBreakClose+` -`+p.pairClose):(p.virtualBreakOpen=this.selfClosing(_),i+=p.virtualBreakOpen+` -`,i+=f,i+=` -`+p.pairClose)}else if(this.createExraStructuralPairs&&((m=l.head)==null?void 0:m.containsAnyFragments)==!1&&((b=l.head)==null?void 0:b.containsChildStructures)==!1){let _=this.makeSlug(25);p.virtualBreakOpen=this.open(_),p.virtualBreakClose=this.close(_),i+=p.pairOpen,i+=` -`+p.virtualBreakOpen,i+=f,i+=` -`+p.virtualBreakClose,i+=p.pairClose}else i+=p.pairOpen,i+=` +`+p.pairClose)}else if(this.createExraStructuralPairs&&((m=l.head)==null?void 0:m.containsAnyFragments)==!1&&((b=l.head)==null?void 0:b.containsChildStructures)==!1){let _=this.makeSlug(25);p.virtualBreakOpen=this.open(_),p.virtualBreakClose=this.close(_),p.virtualSlug=_,i+=` +`+p.pairOpen,i+=` +`+this.selfClosing(_),i+=p.pairClose+` +`}else i+=p.pairOpen,i+=` `,i+=f,i+=` `,i+=p.pairClose;r.push(p)});let s=r[0].pairOpen,a=r[r.length-1].pairClose,o={pairOpen:s,pairClose:a,structures:r,condition:e};return this.registerCondition(o),i}registerPairedAntlers(e,n){this.parentTransformer!=null?this.parentTransformer.registerPairedAntlers(e,n):this.tagPairs.set(e,n)}preparePairedAntlers(e){let n=this.makeSlug(e.getOriginalContent().length),r=this.getAntlersChildDoc(e);if(e.fragmentPosition!=0){let i="",s="";if(e.prev instanceof z&&e.prev.isPaired()==!1&&(s+=this.registerForcedBreak()),s+=`${this.open(n)} `,e.containsChildStructures==!1&&e.containsAnyFragments==!1){let a=!1,o=!0,l=!0,u=0;for(let f=0;f0){a=!0,o=!1;break}}e.children.length==2&&e.children[0]instanceof z&&(a=!0);let c=0;for(let f=0;f{this.processItem(n)})}processItem(e){if(e.type=="PAIR"){if(e.value instanceof Rl||e.value instanceof To){let s=e.key;if(s.range!=null){let a=this.positionFromOffset(s.range[0],s.range[0]),o=this.positionFromOffset(s.range[1],s.range[1]);this.ranges.push({start:a,end:o,length:o.char-a.char+1,content:"property"}),this.keys.push({start:a,end:o,length:o.char-a.char+1,content:s.value}),e.value instanceof To?this.processMap(e.value.items[0]):this.processMap(e.value);return}}let n=e,r=n.key,i=n.value;if(r.range!=null&&i.range!=null){let s=this.positionFromOffset(r.range[0],r.range[0]),a=this.positionFromOffset(r.range[1],r.range[1]),o=this.positionFromOffset(i.range[0],i.range[0]),l=this.positionFromOffset(i.range[1],i.range[1]),u="string";parseInt(i.value)==i.value&&(u="number"),this.ranges.push({start:s,end:a,length:a.char-s.char+1,content:"property"}),this.keys.push({start:s,end:a,length:a.char-s.char+1,content:r.value}),this.ranges.push({start:o,end:l,length:l.char-o.char+1,content:u}),this.values.push({start:o,end:l,length:l.char-o.char+1,content:i.value})}}}positionFromOffset(e,n,r=!1){let i=0,s=0;if(this.documentOffsets.has(e)){let o=this.documentOffsets.get(e);i=o.line,s=o.char}else if(this.documentOffsets.size==0)i=1,s=e+1;else{let o=null,l=null,u=null,c=null;for(let f of this.documentOffsets.keys()){if(f>=e){c!=null&&e>c?(o=u,l=c):(o=this.documentOffsets.get(f),l=f);break}u=this.documentOffsets.get(f),c=f}if(o==null&&(o=u,l=c),o!=null)if(r){let f=this.content.split(""),h=e-(l!=null?l:0),y=o.char-(l!=null?l:0)+e;s=h,i=o.line,e<=(l!=null?l:0)?(i=o.line,s=e+1):i=o.line+1}else{let f=this.content.split(""),h=e-(l!=null?l:0),y=o.char-(l!=null?l:0)+e;s=h,i=o.line,e<=(l!=null?l:0)?(i=o.line,s=e+1):i=o.line+1}else this.lastDocumentOffsetKey!=null&&(i=this.documentOffsets.get(this.lastDocumentOffsetKey).line+1,s=e+this.lastDocumentOffsetKey)}let a=new Fn;return a.index=n,a.offset=e,a.line=i,a.char=s,a}getRanges(){return this.ranges}getKeys(){return this.keys}getValues(){return this.values}};var Kt=class{constructor(){this.documentParser=new w;this.transformer=null;this.ranges=new Ah(this);this.nodes=new Ph(this);this.cursor=new ah(this);this.errors=new oh(this);this.project=null;this.documentUri=""}static fromText(e,n){let r=new Kt;return typeof n!="undefined"&&(r.project=n),r.loadString(e)}static childFromText(e,n=null){let r=new Kt;return n!=null&&r.getDocumentParser().setSeedPosition(n),r.getDocumentParser().withChildDocuments(!0),r.loadString(e),{renderNodes:r.getDocumentParser().getRenderNodes(),content:e,document:r}}isValid(){return!(this.hasInvalidControlFlowStructures()||this.hasUnclosedStructures())}getDocumentOptions(){let e=this.getAllNodes();if(e.length==0||!(e[0]instanceof z))return null;let n=e[0];return n.isComment==!1?null:Bo(this.documentUri,n)}isFormattingEnabled(){let e=this.getDocumentOptions();return e==null?!0:e.formatterEnabled}hasInvalidControlFlowStructures(){return this.documentParser.hasUnclosedIfStructures()}hasUnclosedStructures(){return this.documentParser.hasUnclosedStructures()}getFrontMatterDoc(){if(this.hasFrontMatter()){let e=new Eh;return e.loadString(this.getFrontMatter()),e}return null}hasFrontMatter(){return this.documentParser.getFrontMatter().trim().length>0}getFrontMatter(){return this.documentParser.getFrontMatter()}getFrontMatterScope(){if(this.project==null)return null;let e=new Ch(this.project);return e.parse(this.getFrontMatter()),e.getScope()}updateProject(e){this.project=e,this.updateProjectDetails()}updateProjectDetails(){try{if(this.project!=null){let e=new Vd(this.project,this.documentUri,this),n=this.documentParser.antlersNodes();n.forEach(r=>{var i,s;if(this.project!=null&&((i=wt.instance)==null?void 0:i.canResolveSpecialTypes(r.getTagName()))){let a=(s=wt.instance)==null?void 0:s.resolveSpecialType(r.getTagName(),r,this.project);a.context!=null&&(r.reference=a.context)}}),e.analyzeScope(n);for(let r=0;r{c instanceof z&&(c.currentScope=i.currentScope)})}}}Tb(this)}}catch(e){console.log(e)}}loadString(e){return this.documentParser.parse(e),this.updateProjectDetails(),this}getDocumentParser(){return this.documentParser}getParsedContent(){return this.documentParser.getParsedContent()}getAllNodes(){return this.documentParser.getNodes()}getAllAntlersNodes(){return this.documentParser.antlersNodes()}extractText(){let e=[];return this.nodes.getAllLiteralNodes().forEach(n=>{e.push(n.content)}),e.join("")}getNameAt(e){let n=this.nodes.getNodeAt(e);return n instanceof z?n.name:null}getContent(){return this.documentParser.getContent()}getOriginalContent(){return this.documentParser.getOriginalContent()}getFeaturesAt(e){let n=this.nodes.getNodeAt(e);return ji.resolveContext(e,n,this,!1,n)}getText(e,n){return this.documentParser.getText(e,n)}charLeftAt(e){return this.documentParser.charLeftAt(e)}charAt(e){return this.documentParser.charAt(e)}charRightAt(e){return this.documentParser.charRightAt(e)}getLineIndex(e){return this.documentParser.getLineIndex(e)}getLineText(e){return this.documentParser.getLineText(e)}wordAt(e,n=4){return this.documentParser.wordAt(e,n)}wordLeftAt(e,n=4){return this.documentParser.wordLeftAt(e,n)}wordRightAt(e,n=4){return this.documentParser.wordRightAt(e,n)}punctuationLeftAt(e,n=4){return this.documentParser.punctuationLeftAt(e,n)}punctuationRightAt(e,n=4){return this.documentParser.punctuationRightAt(e,n)}getLineChars(e){let n=this.getLineText(e);return n!=null?n.split(""):null}transform(){return this.transformer==null&&(this.transformer=new Ol(this)),this.transformer}};var aO={checkNode(t){var i;let e=[];if(t.isClosedBy==null||t.parent==null||!(t.parent instanceof z))return e;let n=t.parent;if(n.isClosedBy==null)return e;let r=t.runtimeName();return r=="if"||r=="if:index"||r=="else"||r=="else:index"||r=="elseif"||r=="elseif:index"||r=="elseunless"||r=="elseunless:index"||((i=n.isClosedBy.startPosition)==null?void 0:i.isBefore(t.isClosedBy.endPosition))&&(e.push(W.makeSyntaxError(A.LINT_INTERLEAVED_TAG_PAIRS,t,"Closing tag cannot appear after parent closing tag.")),e.push(W.makeSyntaxError(A.LINT_INTERLEAVED_TAG_PAIRS,t.isClosedBy,"Closing tag cannot appear after parent closing tag."))),e}},Nv=aO;var Ih=class{constructor(){this.htmlFormatter=null;this.yamlFormatter=null;this.phpFormatter=null;this.preFormatter=null;this.transformOptions=null}withTransformOptions(e){return this.transformOptions=e,this}withPreFormatter(e){return this.preFormatter=e,this}withHtmlFormatter(e){return this.htmlFormatter=e,this}withYamlFormatter(e){return this.yamlFormatter=e,this}withPhpFormatter(e){return this.phpFormatter=e,this}formatText(e){let n=new Kt;return n.getDocumentParser().withChildDocuments(!0),n.loadString(e),this.formatDocument(n)}formatDocument(e){if(!e.isFormattingEnabled())return e.getOriginalContent();if(this.preFormatter!=null){let s=this.preFormatter(e);if(s!=null)return s}let n=e.getAllAntlersNodes();for(let s=0;s0)return e.getOriginalContent();if(this.htmlFormatter==null||e.isValid()==!1)return e.getOriginalContent();e.transform().withHtmlFormatter(this.htmlFormatter).withPhpFormatter(this.phpFormatter).withYamlFormatter(this.yamlFormatter),this.transformOptions!=null&&e.transform().withOptions(this.transformOptions);let r=e.transform().toStructure(),i=this.htmlFormatter(r);return e.transform().fromStructure(i)}};function Cv(t){return typeof t=="undefined"||t===null}function oO(t){return typeof t=="object"&&t!==null}function lO(t){return Array.isArray(t)?t:Cv(t)?[]:[t]}function uO(t,e){var n,r,i,s;if(e)for(s=Object.keys(e),n=0,r=s.length;n{this.processItem(n)})}processItem(e){if(e.type=="PAIR"){if(e.value instanceof Rl||e.value instanceof To){let s=e.key;if(s.range!=null){let a=this.positionFromOffset(s.range[0],s.range[0]),o=this.positionFromOffset(s.range[1],s.range[1]);this.ranges.push({start:a,end:o,length:o.char-a.char+1,content:"property"}),this.keys.push({start:a,end:o,length:o.char-a.char+1,content:s.value}),e.value instanceof To?this.processMap(e.value.items[0]):this.processMap(e.value);return}}let n=e,r=n.key,i=n.value;if(r.range!=null&&i.range!=null){let s=this.positionFromOffset(r.range[0],r.range[0]),a=this.positionFromOffset(r.range[1],r.range[1]),o=this.positionFromOffset(i.range[0],i.range[0]),l=this.positionFromOffset(i.range[1],i.range[1]),u="string";parseInt(i.value)==i.value&&(u="number"),this.ranges.push({start:s,end:a,length:a.char-s.char+1,content:"property"}),this.keys.push({start:s,end:a,length:a.char-s.char+1,content:r.value}),this.ranges.push({start:o,end:l,length:l.char-o.char+1,content:u}),this.values.push({start:o,end:l,length:l.char-o.char+1,content:i.value})}}}positionFromOffset(e,n,r=!1){let i=0,s=0;if(this.documentOffsets.has(e)){let o=this.documentOffsets.get(e);i=o.line,s=o.char}else if(this.documentOffsets.size==0)i=1,s=e+1;else{let o=null,l=null,u=null,c=null;for(let f of this.documentOffsets.keys()){if(f>=e){c!=null&&e>c?(o=u,l=c):(o=this.documentOffsets.get(f),l=f);break}u=this.documentOffsets.get(f),c=f}if(o==null&&(o=u,l=c),o!=null)if(r){let f=this.content.split(""),h=e-(l!=null?l:0),y=o.char-(l!=null?l:0)+e;s=h,i=o.line,e<=(l!=null?l:0)?(i=o.line,s=e+1):i=o.line+1}else{let f=this.content.split(""),h=e-(l!=null?l:0),y=o.char-(l!=null?l:0)+e;s=h,i=o.line,e<=(l!=null?l:0)?(i=o.line,s=e+1):i=o.line+1}else this.lastDocumentOffsetKey!=null&&(i=this.documentOffsets.get(this.lastDocumentOffsetKey).line+1,s=e+this.lastDocumentOffsetKey)}let a=new Fn;return a.index=n,a.offset=e,a.line=i,a.char=s,a}getRanges(){return this.ranges}getKeys(){return this.keys}getValues(){return this.values}};var Kt=class{constructor(){this.documentParser=new w;this.transformer=null;this.ranges=new Sh(this);this.nodes=new Ph(this);this.cursor=new ah(this);this.errors=new oh(this);this.project=null;this.documentUri=""}static fromText(e,n){let r=new Kt;return typeof n!="undefined"&&(r.project=n),r.loadString(e)}static childFromText(e,n=null){let r=new Kt;return n!=null&&r.getDocumentParser().setSeedPosition(n),r.getDocumentParser().withChildDocuments(!0),r.loadString(e),{renderNodes:r.getDocumentParser().getRenderNodes(),content:e,document:r}}isValid(){return!(this.hasInvalidControlFlowStructures()||this.hasUnclosedStructures())}getDocumentOptions(){let e=this.getAllNodes();if(e.length==0||!(e[0]instanceof z))return null;let n=e[0];return n.isComment==!1?null:Bo(this.documentUri,n)}isFormattingEnabled(){let e=this.getDocumentOptions();return e==null?!0:e.formatterEnabled}hasInvalidControlFlowStructures(){return this.documentParser.hasUnclosedIfStructures()}hasUnclosedStructures(){return this.documentParser.hasUnclosedStructures()}getFrontMatterDoc(){if(this.hasFrontMatter()){let e=new Eh;return e.loadString(this.getFrontMatter()),e}return null}hasFrontMatter(){return this.documentParser.getFrontMatter().trim().length>0}getFrontMatter(){return this.documentParser.getFrontMatter()}getFrontMatterScope(){if(this.project==null)return null;let e=new Ch(this.project);return e.parse(this.getFrontMatter()),e.getScope()}updateProject(e){this.project=e,this.updateProjectDetails()}updateProjectDetails(){try{if(this.project!=null){let e=new Vd(this.project,this.documentUri,this),n=this.documentParser.antlersNodes();n.forEach(r=>{var i,s;if(this.project!=null&&((i=wt.instance)==null?void 0:i.canResolveSpecialTypes(r.getTagName()))){let a=(s=wt.instance)==null?void 0:s.resolveSpecialType(r.getTagName(),r,this.project);a.context!=null&&(r.reference=a.context)}}),e.analyzeScope(n);for(let r=0;r{c instanceof z&&(c.currentScope=i.currentScope)})}}}Tb(this)}}catch(e){console.log(e)}}loadString(e){return this.documentParser.parse(e),this.updateProjectDetails(),this}getDocumentParser(){return this.documentParser}getParsedContent(){return this.documentParser.getParsedContent()}getAllNodes(){return this.documentParser.getNodes()}getAllAntlersNodes(){return this.documentParser.antlersNodes()}extractText(){let e=[];return this.nodes.getAllLiteralNodes().forEach(n=>{e.push(n.content)}),e.join("")}getNameAt(e){let n=this.nodes.getNodeAt(e);return n instanceof z?n.name:null}getLinesAround(e){return this.documentParser.getLinesAround(e)}getContent(){return this.documentParser.getContent()}getOriginalContent(){return this.documentParser.getOriginalContent()}getFeaturesAt(e){let n=this.nodes.getNodeAt(e);return ji.resolveContext(e,n,this,!1,n)}getText(e,n){return this.documentParser.getText(e,n)}charLeftAt(e){return this.documentParser.charLeftAt(e)}charAt(e){return this.documentParser.charAt(e)}charRightAt(e){return this.documentParser.charRightAt(e)}getLineIndex(e){return this.documentParser.getLineIndex(e)}getLineText(e){return this.documentParser.getLineText(e)}wordAt(e,n=4){return this.documentParser.wordAt(e,n)}wordLeftAt(e,n=4){return this.documentParser.wordLeftAt(e,n)}wordRightAt(e,n=4){return this.documentParser.wordRightAt(e,n)}punctuationLeftAt(e,n=4){return this.documentParser.punctuationLeftAt(e,n)}punctuationRightAt(e,n=4){return this.documentParser.punctuationRightAt(e,n)}getLineChars(e){let n=this.getLineText(e);return n!=null?n.split(""):null}transform(){return this.transformer==null&&(this.transformer=new Ol(this)),this.transformer}};var lO={checkNode(t){var i;let e=[];if(t.isClosedBy==null||t.parent==null||!(t.parent instanceof z))return e;let n=t.parent;if(n.isClosedBy==null)return e;let r=t.runtimeName();return r=="if"||r=="if:index"||r=="else"||r=="else:index"||r=="elseif"||r=="elseif:index"||r=="elseunless"||r=="elseunless:index"||((i=n.isClosedBy.startPosition)==null?void 0:i.isBefore(t.isClosedBy.endPosition))&&(e.push(W.makeSyntaxError(S.LINT_INTERLEAVED_TAG_PAIRS,t,"Closing tag cannot appear after parent closing tag.")),e.push(W.makeSyntaxError(S.LINT_INTERLEAVED_TAG_PAIRS,t.isClosedBy,"Closing tag cannot appear after parent closing tag."))),e}},Cv=lO;var Ih=class{constructor(){this.htmlFormatter=null;this.yamlFormatter=null;this.phpFormatter=null;this.preFormatter=null;this.transformOptions=null;this.createExtraVirtualStructures=!1}withTransformOptions(e){return this.transformOptions=e,this}withPreFormatter(e){return this.preFormatter=e,this}withHtmlFormatter(e){return this.htmlFormatter=e,this}withYamlFormatter(e){return this.yamlFormatter=e,this}withPhpFormatter(e){return this.phpFormatter=e,this}formatText(e){let n=new Kt;return n.getDocumentParser().withChildDocuments(!0),n.loadString(e),this.formatDocument(n)}formatDocument(e){if(!e.isFormattingEnabled())return e.getOriginalContent();if(this.preFormatter!=null){let s=this.preFormatter(e);if(s!=null)return s}let n=e.getAllAntlersNodes();for(let s=0;s0)return e.getOriginalContent();if(this.htmlFormatter==null||e.isValid()==!1)return e.getOriginalContent();e.transform().produceExtraStructuralPairs(this.createExtraVirtualStructures).withHtmlFormatter(this.htmlFormatter).withPhpFormatter(this.phpFormatter).withYamlFormatter(this.yamlFormatter),this.transformOptions!=null&&e.transform().withOptions(this.transformOptions);let r=e.transform().toStructure(),i=this.htmlFormatter(r);return e.transform().fromStructure(i)}};function Pv(t){return typeof t=="undefined"||t===null}function uO(t){return typeof t=="object"&&t!==null}function cO(t){return Array.isArray(t)?t:Pv(t)?[]:[t]}function fO(t,e){var n,r,i,s;if(e)for(s=Object.keys(e),n=0,r=s.length;no&&(s=" ... ",e=r-o+s.length),n-r>o&&(a=" ...",n=r+o-a.length),{str:s+t.slice(e,n).replace(/\t/g,"\u2192")+a,pos:r-e+s.length}}function xh(t,e){return Xt.repeat(" ",e-t.length)+t}function yO(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var n=/\r?\n|\r|\0/g,r=[0],i=[],s,a=-1;s=n.exec(t.buffer);)i.push(s.index),r.push(s.index+s[0].length),t.position<=s.index&&a<0&&(a=r.length-2);a<0&&(a=r.length-1);var o="",l,u,c=Math.min(t.line+e.linesAfter,i.length).toString().length,f=e.maxLength-(e.indent+c+3);for(l=1;l<=e.linesBefore&&!(a-l<0);l++)u=Dh(t.buffer,r[a-l],i[a-l],t.position-(r[a]-r[a-l]),f),o=Xt.repeat(" ",e.indent)+xh((t.line-l+1).toString(),c)+" | "+u.str+` +`+t.mark.snippet),r+" "+n):r}function Ll(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=Sv(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Ll.prototype=Object.create(Error.prototype);Ll.prototype.constructor=Ll;Ll.prototype.toString=function(e){return this.name+": "+Sv(this,e)};var jn=Ll;function Dh(t,e,n,r,i){var s="",a="",o=Math.floor(i/2)-1;return r-e>o&&(s=" ... ",e=r-o+s.length),n-r>o&&(a=" ...",n=r+o-a.length),{str:s+t.slice(e,n).replace(/\t/g,"\u2192")+a,pos:r-e+s.length}}function xh(t,e){return Xt.repeat(" ",e-t.length)+t}function TO(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var n=/\r?\n|\r|\0/g,r=[0],i=[],s,a=-1;s=n.exec(t.buffer);)i.push(s.index),r.push(s.index+s[0].length),t.position<=s.index&&a<0&&(a=r.length-2);a<0&&(a=r.length-1);var o="",l,u,c=Math.min(t.line+e.linesAfter,i.length).toString().length,f=e.maxLength-(e.indent+c+3);for(l=1;l<=e.linesBefore&&!(a-l<0);l++)u=Dh(t.buffer,r[a-l],i[a-l],t.position-(r[a]-r[a-l]),f),o=Xt.repeat(" ",e.indent)+xh((t.line-l+1).toString(),c)+" | "+u.str+` `+o;for(u=Dh(t.buffer,r[a],i[a],t.position,f),o+=Xt.repeat(" ",e.indent)+xh((t.line+1).toString(),c)+" | "+u.str+` `,o+=Xt.repeat("-",e.indent+c+3+u.pos)+`^ `,l=1;l<=e.linesAfter&&!(a+l>=i.length);l++)u=Dh(t.buffer,r[a+l],i[a+l],t.position-(r[a]-r[a+l]),f),o+=Xt.repeat(" ",e.indent)+xh((t.line+l+1).toString(),c)+" | "+u.str+` -`;return o.replace(/\n$/,"")}var bO=yO,TO=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],vO=["scalar","sequence","mapping"];function NO(t){var e={};return t!==null&&Object.keys(t).forEach(function(n){t[n].forEach(function(r){e[String(r)]=n})}),e}function CO(t,e){if(e=e||{},Object.keys(e).forEach(function(n){if(TO.indexOf(n)===-1)throw new jn('Unknown option "'+n+'" is met in definition of "'+t+'" YAML type.')}),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(n){return n},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=NO(e.styleAliases||null),vO.indexOf(this.kind)===-1)throw new jn('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}var yn=CO;function Av(t,e){var n=[];return t[e].forEach(function(r){var i=n.length;n.forEach(function(s,a){s.tag===r.tag&&s.kind===r.kind&&s.multi===r.multi&&(i=a)}),n[i]=r}),n}function PO(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,n;function r(i){i.multi?(t.multi[i.kind].push(i),t.multi.fallback.push(i)):t[i.kind][i.tag]=t.fallback[i.tag]=i}for(e=0,n=arguments.length;e=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),YO=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function HO(t){return!(t===null||!YO.test(t)||t[t.length-1]==="_")}function $O(t){var e,n;return e=t.replace(/_/g,"").toLowerCase(),n=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:n*parseFloat(e,10)}var KO=/^[-+]?[0-9]+e/;function zO(t,e){var n;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Xt.isNegativeZero(t))return"-0.0";return n=t.toString(10),KO.test(n)?n.replace("e",".e"):n}function XO(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||Xt.isNegativeZero(t))}var QO=new yn("tag:yaml.org,2002:float",{kind:"scalar",resolve:HO,construct:$O,predicate:XO,represent:zO,defaultStyle:"lowercase"}),JO=DO.extend({implicit:[OO,MO,GO,QO]}),ZO=JO,Sv=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Ev=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function e1(t){return t===null?!1:Sv.exec(t)!==null||Ev.exec(t)!==null}function t1(t){var e,n,r,i,s,a,o,l=0,u=null,c,f,h;if(e=Sv.exec(t),e===null&&(e=Ev.exec(t)),e===null)throw new Error("Date resolve error");if(n=+e[1],r=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(n,r,i));if(s=+e[4],a=+e[5],o=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(c=+e[10],f=+(e[11]||0),u=(c*60+f)*6e4,e[9]==="-"&&(u=-u)),h=new Date(Date.UTC(n,r,i,s,a,o,l)),u&&h.setTime(h.getTime()-u),h}function n1(t){return t.toISOString()}var r1=new yn("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:e1,construct:t1,instanceOf:Date,represent:n1});function i1(t){return t==="<<"||t===null}var s1=new yn("tag:yaml.org,2002:merge",{kind:"scalar",resolve:i1}),wh=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= -\r`;function a1(t){if(t===null)return!1;var e,n,r=0,i=t.length,s=wh;for(n=0;n64)){if(e<0)return!1;r+=6}return r%8===0}function o1(t){var e,n,r=t.replace(/[\r\n=]/g,""),i=r.length,s=wh,a=0,o=[];for(e=0;e>16&255),o.push(a>>8&255),o.push(a&255)),a=a<<6|s.indexOf(r.charAt(e));return n=i%4*6,n===0?(o.push(a>>16&255),o.push(a>>8&255),o.push(a&255)):n===18?(o.push(a>>10&255),o.push(a>>2&255)):n===12&&o.push(a>>4&255),new Uint8Array(o)}function l1(t){var e="",n=0,r,i,s=t.length,a=wh;for(r=0;r>18&63],e+=a[n>>12&63],e+=a[n>>6&63],e+=a[n&63]),n=(n<<8)+t[r];return i=s%3,i===0?(e+=a[n>>18&63],e+=a[n>>12&63],e+=a[n>>6&63],e+=a[n&63]):i===2?(e+=a[n>>10&63],e+=a[n>>4&63],e+=a[n<<2&63],e+=a[64]):i===1&&(e+=a[n>>2&63],e+=a[n<<4&63],e+=a[64],e+=a[64]),e}function u1(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}var c1=new yn("tag:yaml.org,2002:binary",{kind:"scalar",resolve:a1,construct:o1,predicate:u1,represent:l1}),f1=Object.prototype.hasOwnProperty,p1=Object.prototype.toString;function d1(t){if(t===null)return!0;var e=[],n,r,i,s,a,o=t;for(n=0,r=o.length;n>10)+55296,(t-65536&1023)+56320)}var kv=new Array(256),Mv=new Array(256);for(na=0;na<256;na++)kv[na]=Fv(na)?1:0,Mv[na]=Fv(na);var na;function w1(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||Iv,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Bv(t,e){var n={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return n.snippet=bO(n),new jn(e,n)}function Te(t,e){throw Bv(t,e)}function af(t,e){t.onWarning&&t.onWarning.call(null,Bv(t,e))}var qv={YAML:function(e,n,r){var i,s,a;e.version!==null&&Te(e,"duplication of %YAML directive"),r.length!==1&&Te(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&Te(e,"ill-formed argument of the YAML directive"),s=parseInt(i[1],10),a=parseInt(i[2],10),s!==1&&Te(e,"unacceptable YAML version of the document"),e.version=r[0],e.checkLineBreaks=a<2,a!==1&&a!==2&&af(e,"unsupported YAML version of the document")},TAG:function(e,n,r){var i,s;r.length!==2&&Te(e,"TAG directive accepts exactly two arguments"),i=r[0],s=r[1],wv.test(i)||Te(e,"ill-formed tag handle (first argument) of the TAG directive"),Ts.call(e.tagMap,i)&&Te(e,'there is a previously declared suffix for "'+i+'" tag handle'),Ov.test(s)||Te(e,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{Te(e,"tag prefix is malformed: "+s)}e.tagMap[i]=s}};function vs(t,e,n,r){var i,s,a,o;if(e1&&(t.result+=Xt.repeat(` -`,e-1))}function O1(t,e,n){var r,i,s,a,o,l,u,c,f=t.kind,h=t.result,y;if(y=t.input.charCodeAt(t.position),Un(y)||No(y)||y===35||y===38||y===42||y===33||y===124||y===62||y===39||y===34||y===37||y===64||y===96||(y===63||y===45)&&(i=t.input.charCodeAt(t.position+1),Un(i)||n&&No(i)))return!1;for(t.kind="scalar",t.result="",s=a=t.position,o=!1;y!==0;){if(y===58){if(i=t.input.charCodeAt(t.position+1),Un(i)||n&&No(i))break}else if(y===35){if(r=t.input.charCodeAt(t.position-1),Un(r))break}else{if(t.position===t.lineStart&&of(t)||n&&No(y))break;if(vi(y))if(l=t.line,u=t.lineStart,c=t.lineIndent,Wt(t,!1,-1),t.lineIndent>=e){o=!0,y=t.input.charCodeAt(t.position);continue}else{t.position=a,t.line=l,t.lineStart=u,t.lineIndent=c;break}}o&&(vs(t,s,a,!1),Fh(t,t.line-l),s=a=t.position,o=!1),ta(y)||(a=t.position+1),y=t.input.charCodeAt(++t.position)}return vs(t,s,a,!1),t.result?!0:(t.kind=f,t.result=h,!1)}function L1(t,e){var n,r,i;if(n=t.input.charCodeAt(t.position),n!==39)return!1;for(t.kind="scalar",t.result="",t.position++,r=i=t.position;(n=t.input.charCodeAt(t.position))!==0;)if(n===39)if(vs(t,r,t.position,!0),n=t.input.charCodeAt(++t.position),n===39)r=t.position,t.position++,i=t.position;else return!0;else vi(n)?(vs(t,r,i,!0),Fh(t,Wt(t,!1,e)),r=i=t.position):t.position===t.lineStart&&of(t)?Te(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);Te(t,"unexpected end of the stream within a single quoted scalar")}function F1(t,e){var n,r,i,s,a,o;if(o=t.input.charCodeAt(t.position),o!==34)return!1;for(t.kind="scalar",t.result="",t.position++,n=r=t.position;(o=t.input.charCodeAt(t.position))!==0;){if(o===34)return vs(t,n,t.position,!0),t.position++,!0;if(o===92){if(vs(t,n,t.position,!0),o=t.input.charCodeAt(++t.position),vi(o))Wt(t,!1,e);else if(o<256&&kv[o])t.result+=Mv[o],t.position++;else if((a=D1(o))>0){for(i=a,s=0;i>0;i--)o=t.input.charCodeAt(++t.position),(a=I1(o))>=0?s=(s<<4)+a:Te(t,"expected hexadecimal character");t.result+=R1(s),t.position++}else Te(t,"unknown escape sequence");n=r=t.position}else vi(o)?(vs(t,n,r,!0),Fh(t,Wt(t,!1,e)),n=r=t.position):t.position===t.lineStart&&of(t)?Te(t,"unexpected end of the document within a double quoted scalar"):(t.position++,r=t.position)}Te(t,"unexpected end of the stream within a double quoted scalar")}function k1(t,e){var n=!0,r,i,s,a=t.tag,o,l=t.anchor,u,c,f,h,y,p=Object.create(null),d,g,m,b;if(b=t.input.charCodeAt(t.position),b===91)c=93,y=!1,o=[];else if(b===123)c=125,y=!0,o={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=o),b=t.input.charCodeAt(++t.position);b!==0;){if(Wt(t,!0,e),b=t.input.charCodeAt(t.position),b===c)return t.position++,t.tag=a,t.anchor=l,t.kind=y?"mapping":"sequence",t.result=o,!0;n?b===44&&Te(t,"expected the node content, but found ','"):Te(t,"missed comma between flow collection entries"),g=d=m=null,f=h=!1,b===63&&(u=t.input.charCodeAt(t.position+1),Un(u)&&(f=h=!0,t.position++,Wt(t,!0,e))),r=t.line,i=t.lineStart,s=t.position,Po(t,e,rf,!1,!0),g=t.tag,d=t.result,Wt(t,!0,e),b=t.input.charCodeAt(t.position),(h||t.line===r)&&b===58&&(f=!0,b=t.input.charCodeAt(++t.position),Wt(t,!0,e),Po(t,e,rf,!1,!0),m=t.result),y?Co(t,o,p,g,d,m,r,i,s):f?o.push(Co(t,null,p,g,d,m,r,i,s)):o.push(d),Wt(t,!0,e),b=t.input.charCodeAt(t.position),b===44?(n=!0,b=t.input.charCodeAt(++t.position)):n=!1}Te(t,"unexpected end of the stream within a flow collection")}function M1(t,e){var n,r,i=Oh,s=!1,a=!1,o=e,l=0,u=!1,c,f;if(f=t.input.charCodeAt(t.position),f===124)r=!1;else if(f===62)r=!0;else return!1;for(t.kind="scalar",t.result="";f!==0;)if(f=t.input.charCodeAt(++t.position),f===43||f===45)Oh===i?i=f===43?Rv:P1:Te(t,"repeat of a chomping mode identifier");else if((c=x1(f))>=0)c===0?Te(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?Te(t,"repeat of an indentation width identifier"):(o=e+c-1,a=!0);else break;if(ta(f)){do f=t.input.charCodeAt(++t.position);while(ta(f));if(f===35)do f=t.input.charCodeAt(++t.position);while(!vi(f)&&f!==0)}for(;f!==0;){for(Lh(t),t.lineIndent=0,f=t.input.charCodeAt(t.position);(!a||t.lineIndento&&(o=t.lineIndent),vi(f)){l++;continue}if(t.lineIndent=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),$O=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function KO(t){return!(t===null||!$O.test(t)||t[t.length-1]==="_")}function zO(t){var e,n;return e=t.replace(/_/g,"").toLowerCase(),n=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:n*parseFloat(e,10)}var XO=/^[-+]?[0-9]+e/;function QO(t,e){var n;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Xt.isNegativeZero(t))return"-0.0";return n=t.toString(10),XO.test(n)?n.replace("e",".e"):n}function JO(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||Xt.isNegativeZero(t))}var ZO=new yn("tag:yaml.org,2002:float",{kind:"scalar",resolve:KO,construct:zO,predicate:JO,represent:QO,defaultStyle:"lowercase"}),e1=RO.extend({implicit:[FO,qO,HO,ZO]}),t1=e1,Ev=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Iv=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function n1(t){return t===null?!1:Ev.exec(t)!==null||Iv.exec(t)!==null}function r1(t){var e,n,r,i,s,a,o,l=0,u=null,c,f,h;if(e=Ev.exec(t),e===null&&(e=Iv.exec(t)),e===null)throw new Error("Date resolve error");if(n=+e[1],r=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(n,r,i));if(s=+e[4],a=+e[5],o=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(c=+e[10],f=+(e[11]||0),u=(c*60+f)*6e4,e[9]==="-"&&(u=-u)),h=new Date(Date.UTC(n,r,i,s,a,o,l)),u&&h.setTime(h.getTime()-u),h}function i1(t){return t.toISOString()}var s1=new yn("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:n1,construct:r1,instanceOf:Date,represent:i1});function a1(t){return t==="<<"||t===null}var o1=new yn("tag:yaml.org,2002:merge",{kind:"scalar",resolve:a1}),wh=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= +\r`;function l1(t){if(t===null)return!1;var e,n,r=0,i=t.length,s=wh;for(n=0;n64)){if(e<0)return!1;r+=6}return r%8===0}function u1(t){var e,n,r=t.replace(/[\r\n=]/g,""),i=r.length,s=wh,a=0,o=[];for(e=0;e>16&255),o.push(a>>8&255),o.push(a&255)),a=a<<6|s.indexOf(r.charAt(e));return n=i%4*6,n===0?(o.push(a>>16&255),o.push(a>>8&255),o.push(a&255)):n===18?(o.push(a>>10&255),o.push(a>>2&255)):n===12&&o.push(a>>4&255),new Uint8Array(o)}function c1(t){var e="",n=0,r,i,s=t.length,a=wh;for(r=0;r>18&63],e+=a[n>>12&63],e+=a[n>>6&63],e+=a[n&63]),n=(n<<8)+t[r];return i=s%3,i===0?(e+=a[n>>18&63],e+=a[n>>12&63],e+=a[n>>6&63],e+=a[n&63]):i===2?(e+=a[n>>10&63],e+=a[n>>4&63],e+=a[n<<2&63],e+=a[64]):i===1&&(e+=a[n>>2&63],e+=a[n<<4&63],e+=a[64],e+=a[64]),e}function f1(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}var p1=new yn("tag:yaml.org,2002:binary",{kind:"scalar",resolve:l1,construct:u1,predicate:f1,represent:c1}),d1=Object.prototype.hasOwnProperty,h1=Object.prototype.toString;function m1(t){if(t===null)return!0;var e=[],n,r,i,s,a,o=t;for(n=0,r=o.length;n>10)+55296,(t-65536&1023)+56320)}var Mv=new Array(256),Bv=new Array(256);for(na=0;na<256;na++)Mv[na]=kv(na)?1:0,Bv[na]=kv(na);var na;function L1(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||Dv,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function qv(t,e){var n={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return n.snippet=vO(n),new jn(e,n)}function Te(t,e){throw qv(t,e)}function af(t,e){t.onWarning&&t.onWarning.call(null,qv(t,e))}var Vv={YAML:function(e,n,r){var i,s,a;e.version!==null&&Te(e,"duplication of %YAML directive"),r.length!==1&&Te(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&Te(e,"ill-formed argument of the YAML directive"),s=parseInt(i[1],10),a=parseInt(i[2],10),s!==1&&Te(e,"unacceptable YAML version of the document"),e.version=r[0],e.checkLineBreaks=a<2,a!==1&&a!==2&&af(e,"unsupported YAML version of the document")},TAG:function(e,n,r){var i,s;r.length!==2&&Te(e,"TAG directive accepts exactly two arguments"),i=r[0],s=r[1],Ov.test(i)||Te(e,"ill-formed tag handle (first argument) of the TAG directive"),Ts.call(e.tagMap,i)&&Te(e,'there is a previously declared suffix for "'+i+'" tag handle'),Lv.test(s)||Te(e,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{Te(e,"tag prefix is malformed: "+s)}e.tagMap[i]=s}};function vs(t,e,n,r){var i,s,a,o;if(e1&&(t.result+=Xt.repeat(` +`,e-1))}function F1(t,e,n){var r,i,s,a,o,l,u,c,f=t.kind,h=t.result,y;if(y=t.input.charCodeAt(t.position),Un(y)||No(y)||y===35||y===38||y===42||y===33||y===124||y===62||y===39||y===34||y===37||y===64||y===96||(y===63||y===45)&&(i=t.input.charCodeAt(t.position+1),Un(i)||n&&No(i)))return!1;for(t.kind="scalar",t.result="",s=a=t.position,o=!1;y!==0;){if(y===58){if(i=t.input.charCodeAt(t.position+1),Un(i)||n&&No(i))break}else if(y===35){if(r=t.input.charCodeAt(t.position-1),Un(r))break}else{if(t.position===t.lineStart&&of(t)||n&&No(y))break;if(vi(y))if(l=t.line,u=t.lineStart,c=t.lineIndent,Wt(t,!1,-1),t.lineIndent>=e){o=!0,y=t.input.charCodeAt(t.position);continue}else{t.position=a,t.line=l,t.lineStart=u,t.lineIndent=c;break}}o&&(vs(t,s,a,!1),Fh(t,t.line-l),s=a=t.position,o=!1),ta(y)||(a=t.position+1),y=t.input.charCodeAt(++t.position)}return vs(t,s,a,!1),t.result?!0:(t.kind=f,t.result=h,!1)}function k1(t,e){var n,r,i;if(n=t.input.charCodeAt(t.position),n!==39)return!1;for(t.kind="scalar",t.result="",t.position++,r=i=t.position;(n=t.input.charCodeAt(t.position))!==0;)if(n===39)if(vs(t,r,t.position,!0),n=t.input.charCodeAt(++t.position),n===39)r=t.position,t.position++,i=t.position;else return!0;else vi(n)?(vs(t,r,i,!0),Fh(t,Wt(t,!1,e)),r=i=t.position):t.position===t.lineStart&&of(t)?Te(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);Te(t,"unexpected end of the stream within a single quoted scalar")}function M1(t,e){var n,r,i,s,a,o;if(o=t.input.charCodeAt(t.position),o!==34)return!1;for(t.kind="scalar",t.result="",t.position++,n=r=t.position;(o=t.input.charCodeAt(t.position))!==0;){if(o===34)return vs(t,n,t.position,!0),t.position++,!0;if(o===92){if(vs(t,n,t.position,!0),o=t.input.charCodeAt(++t.position),vi(o))Wt(t,!1,e);else if(o<256&&Mv[o])t.result+=Bv[o],t.position++;else if((a=R1(o))>0){for(i=a,s=0;i>0;i--)o=t.input.charCodeAt(++t.position),(a=x1(o))>=0?s=(s<<4)+a:Te(t,"expected hexadecimal character");t.result+=O1(s),t.position++}else Te(t,"unknown escape sequence");n=r=t.position}else vi(o)?(vs(t,n,r,!0),Fh(t,Wt(t,!1,e)),n=r=t.position):t.position===t.lineStart&&of(t)?Te(t,"unexpected end of the document within a double quoted scalar"):(t.position++,r=t.position)}Te(t,"unexpected end of the stream within a double quoted scalar")}function B1(t,e){var n=!0,r,i,s,a=t.tag,o,l=t.anchor,u,c,f,h,y,p=Object.create(null),d,g,m,b;if(b=t.input.charCodeAt(t.position),b===91)c=93,y=!1,o=[];else if(b===123)c=125,y=!0,o={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=o),b=t.input.charCodeAt(++t.position);b!==0;){if(Wt(t,!0,e),b=t.input.charCodeAt(t.position),b===c)return t.position++,t.tag=a,t.anchor=l,t.kind=y?"mapping":"sequence",t.result=o,!0;n?b===44&&Te(t,"expected the node content, but found ','"):Te(t,"missed comma between flow collection entries"),g=d=m=null,f=h=!1,b===63&&(u=t.input.charCodeAt(t.position+1),Un(u)&&(f=h=!0,t.position++,Wt(t,!0,e))),r=t.line,i=t.lineStart,s=t.position,Po(t,e,rf,!1,!0),g=t.tag,d=t.result,Wt(t,!0,e),b=t.input.charCodeAt(t.position),(h||t.line===r)&&b===58&&(f=!0,b=t.input.charCodeAt(++t.position),Wt(t,!0,e),Po(t,e,rf,!1,!0),m=t.result),y?Co(t,o,p,g,d,m,r,i,s):f?o.push(Co(t,null,p,g,d,m,r,i,s)):o.push(d),Wt(t,!0,e),b=t.input.charCodeAt(t.position),b===44?(n=!0,b=t.input.charCodeAt(++t.position)):n=!1}Te(t,"unexpected end of the stream within a flow collection")}function q1(t,e){var n,r,i=Oh,s=!1,a=!1,o=e,l=0,u=!1,c,f;if(f=t.input.charCodeAt(t.position),f===124)r=!1;else if(f===62)r=!0;else return!1;for(t.kind="scalar",t.result="";f!==0;)if(f=t.input.charCodeAt(++t.position),f===43||f===45)Oh===i?i=f===43?wv:A1:Te(t,"repeat of a chomping mode identifier");else if((c=w1(f))>=0)c===0?Te(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?Te(t,"repeat of an indentation width identifier"):(o=e+c-1,a=!0);else break;if(ta(f)){do f=t.input.charCodeAt(++t.position);while(ta(f));if(f===35)do f=t.input.charCodeAt(++t.position);while(!vi(f)&&f!==0)}for(;f!==0;){for(Lh(t),t.lineIndent=0,f=t.input.charCodeAt(t.position);(!a||t.lineIndento&&(o=t.lineIndent),vi(f)){l++;continue}if(t.lineIndente)&&l!==0)Te(t,"bad indentation of a sequence entry");else if(t.lineIndente)&&(g&&(a=t.line,o=t.lineStart,l=t.position),Po(t,e,sf,!0,i)&&(g?p=t.result:d=t.result),g||(Co(t,f,h,y,p,d,a,o,l),y=p=d=null),Wt(t,!0,-1),b=t.input.charCodeAt(t.position)),(t.line===s||t.lineIndent>e)&&b!==0)Te(t,"bad indentation of a mapping entry");else if(t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndent tag; it should be "scalar", not "'+t.kind+'"'),f=0,h=t.implicitTypes.length;f"),t.result!==null&&p.kind!==t.kind&&Te(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+p.kind+'", not "'+t.kind+'"'),p.resolve(t.result,t.tag)?(t.result=p.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):Te(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||c}function U1(t){var e=t.position,n,r,i,s=!1,a;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(a=t.input.charCodeAt(t.position))!==0&&(Wt(t,!0,-1),a=t.input.charCodeAt(t.position),!(t.lineIndent>0||a!==37));){for(s=!0,a=t.input.charCodeAt(++t.position),n=t.position;a!==0&&!Un(a);)a=t.input.charCodeAt(++t.position);for(r=t.input.slice(n,t.position),i=[],r.length<1&&Te(t,"directive name must not be less than one character in length");a!==0;){for(;ta(a);)a=t.input.charCodeAt(++t.position);if(a===35){do a=t.input.charCodeAt(++t.position);while(a!==0&&!vi(a));break}if(vi(a))break;for(n=t.position;a!==0&&!Un(a);)a=t.input.charCodeAt(++t.position);i.push(t.input.slice(n,t.position))}a!==0&&Lh(t),Ts.call(qv,r)?qv[r](t,r,i):af(t,'unknown document directive "'+r+'"')}if(Wt(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,Wt(t,!0,-1)):s&&Te(t,"directives end mark is expected"),Po(t,t.lineIndent-1,sf,!1,!0),Wt(t,!0,-1),t.checkLineBreaks&&S1.test(t.input.slice(e,t.position))&&af(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&of(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,Wt(t,!0,-1));return}if(t.positione)&&l!==0)Te(t,"bad indentation of a sequence entry");else if(t.lineIndente)&&(g&&(a=t.line,o=t.lineStart,l=t.position),Po(t,e,sf,!0,i)&&(g?p=t.result:d=t.result),g||(Co(t,f,h,y,p,d,a,o,l),y=p=d=null),Wt(t,!0,-1),b=t.input.charCodeAt(t.position)),(t.line===s||t.lineIndent>e)&&b!==0)Te(t,"bad indentation of a mapping entry");else if(t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndent tag; it should be "scalar", not "'+t.kind+'"'),f=0,h=t.implicitTypes.length;f"),t.result!==null&&p.kind!==t.kind&&Te(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+p.kind+'", not "'+t.kind+'"'),p.resolve(t.result,t.tag)?(t.result=p.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):Te(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||c}function G1(t){var e=t.position,n,r,i,s=!1,a;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(a=t.input.charCodeAt(t.position))!==0&&(Wt(t,!0,-1),a=t.input.charCodeAt(t.position),!(t.lineIndent>0||a!==37));){for(s=!0,a=t.input.charCodeAt(++t.position),n=t.position;a!==0&&!Un(a);)a=t.input.charCodeAt(++t.position);for(r=t.input.slice(n,t.position),i=[],r.length<1&&Te(t,"directive name must not be less than one character in length");a!==0;){for(;ta(a);)a=t.input.charCodeAt(++t.position);if(a===35){do a=t.input.charCodeAt(++t.position);while(a!==0&&!vi(a));break}if(vi(a))break;for(n=t.position;a!==0&&!Un(a);)a=t.input.charCodeAt(++t.position);i.push(t.input.slice(n,t.position))}a!==0&&Lh(t),Ts.call(Vv,r)?Vv[r](t,r,i):af(t,'unknown document directive "'+r+'"')}if(Wt(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,Wt(t,!0,-1)):s&&Te(t,"directives end mark is expected"),Po(t,t.lineIndent-1,sf,!1,!0),Wt(t,!0,-1),t.checkLineBreaks&&I1.test(t.input.slice(e,t.position))&&af(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&of(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,Wt(t,!0,-1));return}if(t.position=55296&&n<=56319&&e+1=56320&&r<=57343)?(n-55296)*1024+r-56320+65536:n}function eN(t){var e=/^\n* /;return e.test(t)}var tN=1,qh=2,nN=3,rN=4,Ao=5;function yL(t,e,n,r,i,s,a,o){var l,u=0,c=null,f=!1,h=!1,y=r!==-1,p=-1,d=gL(Bl(t,0))&&_L(Bl(t,t.length-1));if(e||a)for(l=0;l=65536?l+=2:l++){if(u=Bl(t,l),!Ml(u))return Ao;d=d&&Zv(u,c,o),c=u}else{for(l=0;l=65536?l+=2:l++){if(u=Bl(t,l),u===Fl)f=!0,y&&(h=h||l-p-1>r&&t[p+1]!==" ",p=l);else if(!Ml(u))return Ao;d=d&&Zv(u,c,o),c=u}h=h||y&&l-p-1>r&&t[p+1]!==" "}return!f&&!h?d&&!a&&!i(t)?tN:s===kl?Ao:qh:n>9&&eN(t)?Ao:a?s===kl?Ao:qh:h?rN:nN}function bL(t,e,n,r,i){t.dump=function(){if(e.length===0)return t.quotingType===kl?'""':"''";if(!t.noCompatMode&&(uL.indexOf(e)!==-1||cL.test(e)))return t.quotingType===kl?'"'+e+'"':"'"+e+"'";var s=t.indent*Math.max(1,n),a=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-s),o=r||t.flowLevel>-1&&n>=t.flowLevel;function l(u){return mL(t,u)}switch(yL(e,o,t.indent,a,l,t.quotingType,t.forceQuotes&&!r,i)){case tN:return e;case qh:return"'"+e.replace(/'/g,"''")+"'";case nN:return"|"+iN(e,t.indent)+sN(Qv(e,s));case rN:return">"+iN(e,t.indent)+sN(Qv(TL(e,a),s));case Ao:return'"'+vL(e)+'"';default:throw new jn("impossible error: invalid scalar style")}}()}function iN(t,e){var n=eN(t)?String(e):"",r=t[t.length-1]===` +`+Xt.repeat(" ",t.indent*e)}function _L(t,e){var n,r,i;for(n=0,r=t.implicitTypes.length;n=55296&&n<=56319&&e+1=56320&&r<=57343)?(n-55296)*1024+r-56320+65536:n}function tN(t){var e=/^\n* /;return e.test(t)}var nN=1,qh=2,rN=3,iN=4,So=5;function TL(t,e,n,r,i,s,a,o){var l,u=0,c=null,f=!1,h=!1,y=r!==-1,p=-1,d=yL(Bl(t,0))&&bL(Bl(t,t.length-1));if(e||a)for(l=0;l=65536?l+=2:l++){if(u=Bl(t,l),!Ml(u))return So;d=d&&eN(u,c,o),c=u}else{for(l=0;l=65536?l+=2:l++){if(u=Bl(t,l),u===Fl)f=!0,y&&(h=h||l-p-1>r&&t[p+1]!==" ",p=l);else if(!Ml(u))return So;d=d&&eN(u,c,o),c=u}h=h||y&&l-p-1>r&&t[p+1]!==" "}return!f&&!h?d&&!a&&!i(t)?nN:s===kl?So:qh:n>9&&tN(t)?So:a?s===kl?So:qh:h?iN:rN}function vL(t,e,n,r,i){t.dump=function(){if(e.length===0)return t.quotingType===kl?'""':"''";if(!t.noCompatMode&&(fL.indexOf(e)!==-1||pL.test(e)))return t.quotingType===kl?'"'+e+'"':"'"+e+"'";var s=t.indent*Math.max(1,n),a=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-s),o=r||t.flowLevel>-1&&n>=t.flowLevel;function l(u){return _L(t,u)}switch(TL(e,o,t.indent,a,l,t.quotingType,t.forceQuotes&&!r,i)){case nN:return e;case qh:return"'"+e.replace(/'/g,"''")+"'";case rN:return"|"+sN(e,t.indent)+aN(Jv(e,s));case iN:return">"+sN(e,t.indent)+aN(Jv(NL(e,a),s));case So:return'"'+CL(e)+'"';default:throw new jn("impossible error: invalid scalar style")}}()}function sN(t,e){var n=tN(t)?String(e):"",r=t[t.length-1]===` `,i=r&&(t[t.length-2]===` `||t===` `),s=i?"+":r?"":"-";return n+s+` -`}function sN(t){return t[t.length-1]===` -`?t.slice(0,-1):t}function TL(t,e){for(var n=/(\n+)([^\n]*)/g,r=function(){var u=t.indexOf(` -`);return u=u!==-1?u:t.length,n.lastIndex=u,aN(t.slice(0,u),e)}(),i=t[0]===` +`}function aN(t){return t[t.length-1]===` +`?t.slice(0,-1):t}function NL(t,e){for(var n=/(\n+)([^\n]*)/g,r=function(){var u=t.indexOf(` +`);return u=u!==-1?u:t.length,n.lastIndex=u,oN(t.slice(0,u),e)}(),i=t[0]===` `||t[0]===" ",s,a;a=n.exec(t);){var o=a[1],l=a[2];s=l[0]===" ",r+=o+(!i&&!s&&l!==""?` -`:"")+aN(l,e),i=s}return r}function aN(t,e){if(t===""||t[0]===" ")return t;for(var n=/ [^ ]/g,r,i=0,s,a=0,o=0,l="";r=n.exec(t);)o=r.index,o-i>e&&(s=a>i?a:o,l+=` +`:"")+oN(l,e),i=s}return r}function oN(t,e){if(t===""||t[0]===" ")return t;for(var n=/ [^ ]/g,r,i=0,s,a=0,o=0,l="";r=n.exec(t);)o=r.index,o-i>e&&(s=a>i?a:o,l+=` `+t.slice(i,s),i=s+1),a=o;return l+=` `,t.length-i>e&&a>i?l+=t.slice(i,a)+` -`+t.slice(a+1):l+=t.slice(i),l.slice(1)}function vL(t){for(var e="",n=0,r,i=0;i=65536?i+=2:i++)n=Bl(t,i),r=bn[n],!r&&Ml(n)?(e+=t[i],n>=65536&&(e+=t[i+1])):e+=r||pL(n);return e}function NL(t,e,n){var r="",i=t.tag,s,a,o;for(s=0,a=n.length;s1024&&(c+="? "),c+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),!!Wi(t,e,u,!1,!1)&&(c+=t.dump,r+=c));t.tag=i,t.dump="{"+r+"}"}function PL(t,e,n,r){var i="",s=t.tag,a=Object.keys(n),o,l,u,c,f,h;if(t.sortKeys===!0)a.sort();else if(typeof t.sortKeys=="function")a.sort(t.sortKeys);else if(t.sortKeys)throw new jn("sortKeys must be a boolean or a function");for(o=0,l=a.length;o1024,f&&(t.dump&&Fl===t.dump.charCodeAt(0)?h+="?":h+="? "),h+=t.dump,f&&(h+=Bh(t,e)),!!Wi(t,e+1,c,!0,f)&&(t.dump&&Fl===t.dump.charCodeAt(0)?h+=":":h+=": ",h+=t.dump,i+=h));t.tag=s,t.dump=i||"{}"}function lN(t,e,n){var r,i,s,a,o,l;for(i=n?t.explicitTypes:t.implicitTypes,s=0,a=i.length;s tag resolver accepts not "'+l+'" style');t.dump=r}return!0}return!1}function Wi(t,e,n,r,i,s,a){t.tag=null,t.dump=n,lN(t,n,!1)||lN(t,n,!0);var o=Gv.call(t.dump),l=r,u;r&&(r=t.flowLevel<0||t.flowLevel>e);var c=o==="[object Object]"||o==="[object Array]",f,h;if(c&&(f=t.duplicates.indexOf(n),h=f!==-1),(t.tag!==null&&t.tag!=="?"||h||t.indent!==2&&e>0)&&(i=!1),h&&t.usedDuplicates[f])t.dump="*ref_"+f;else{if(c&&h&&!t.usedDuplicates[f]&&(t.usedDuplicates[f]=!0),o==="[object Object]")r&&Object.keys(t.dump).length!==0?(PL(t,e,t.dump,i),h&&(t.dump="&ref_"+f+t.dump)):(CL(t,e,t.dump),h&&(t.dump="&ref_"+f+" "+t.dump));else if(o==="[object Array]")r&&t.dump.length!==0?(t.noArrayIndent&&!a&&e>0?oN(t,e-1,t.dump,i):oN(t,e,t.dump,i),h&&(t.dump="&ref_"+f+t.dump)):(NL(t,e,t.dump),h&&(t.dump="&ref_"+f+" "+t.dump));else if(o==="[object String]")t.tag!=="?"&&bL(t,t.dump,e,s,l);else{if(o==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new jn("unacceptable kind of an object to dump "+o)}t.tag!==null&&t.tag!=="?"&&(u=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",t.dump=u+" "+t.dump)}return!0}function AL(t,e){var n=[],r=[],i,s;for(Vh(t,n,r),i=0,s=r.length;i0?r.split(",").map(i=>i.trim().toLowerCase()):[]:n}var OF=pC().html,Tf=class extends Ih{constructor(e){super();this.options=e,this.withHtmlFormatter(this.formatHtml).withYamlFormatter(Uh.formatFrontMatter).withTransformOptions({endNewline:Wn(e.htmlOptions,"endWithNewline",!1),maxAntlersStatementsPerLine:e.maxStatementsPerLine,newlinesAfterFrontMatter:1,tabSize:e.tabSize})}formatHtml(e){var n;return OF(e,{indent_size:this.options.tabSize,indent_char:this.options.insertSpaces?" ":" ",indent_empty_lines:Wn(this.options.htmlOptions,"indentEmptyLines",!1),wrap_line_length:Wn(this.options.htmlOptions,"wrapLineLength",120),unformatted:(n=fN(this.options.htmlOptions,"unformatted",[]))!=null?n:[],content_unformatted:[],indent_inner_html:Wn(this.options.htmlOptions,"indentInnerHtml",!1),preserve_newlines:Wn(this.options.htmlOptions,"preserveNewLines",!0),max_preserve_newlines:Wn(this.options.htmlOptions,"maxPreserveNewLines",32786),indent_handlebars:Wn(this.options.htmlOptions,"indentHandlebars",!1),end_with_newline:Wn(this.options.htmlOptions,"endWithNewline",!1),extra_liners:[],wrap_attributes:Wn(this.options.htmlOptions,"wrapAttributes","auto"),wrap_attributes_indent_size:Wn(this.options.htmlOptions,"wrapAttributesIndentSize",void 0),eol:` -`,indent_scripts:Wn(this.options.htmlOptions,"indentScripts","normal"),unformatted_content_delimiter:Wn(this.options.htmlOptions,"unformattedContentDelimiter","")})}};var Yk=KP(),au=require("path"),Bf=0,zP=3,Hk=1,jm=4,$k=".antlers.format.json",it=Yk.command("format","Formats a file and writes the changes to disk",{path:{description:"The file to format",alias:"f",type:"string"},dir:{description:"The directory to format",alias:"d",type:"string"},stdin:{description:"Indicates that the formatter should use stdin input",alias:"s",type:"boolean",default:!1},output:{description:"An optional output path",alias:"out",type:"string",default:null},dump:{description:"Optionally writes the formatted results to the output instead of saving",alias:"dd",type:"boolean",default:!1},options:{description:"An optional path to an Antlers format configuration file",alias:"o",type:"string"}}).help().alias("help","h").argv,qf=it._,Kk={htmlOptions:{},formatFrontMatter:!0,insertSpaces:!0,maxStatementsPerLine:3,tabSize:4,formatExtensions:[".antlers.html"]};function XP(t){if(nt.existsSync(t)){let e=nt.readFileSync(t,{encoding:"utf8"});try{return JSON.parse(e)}catch(n){console.error(n)}}return null}function QP(t,e,n){let r=nt.readdirSync(t);for(let i=0;i{QP(t,i,s=>{Um(s,s,r,e)})}),process.exit(Bf)}else process.exit(zP)}function Xk(t){let e=au.dirname(t);e=="."&&(e=process.cwd());let n=e.split(au.sep);for(;n.length>0;){let r=n.join(au.sep),i=au.join(r,$k);if(nt.existsSync(i))return i;n.pop()}return null}if(it._.includes("format")){let t=Kk;if(typeof it.options!="undefined"&&it.options!==null){let e=XP(it.options);e!=null&&(t=e)}else{let e="";qf.length==1?typeof it.dir!="undefined"&&it.dir!==null?e=it.dir:typeof it.path!="undefined"&&it.path!==null&&(e=it.path):e=qf[1];let n=Xk(e);if(n!=null){let r=XP(n);r!=null&&(t=r)}}if(qf.length==1){if(it.stdin===!0){let e=nt.readFileSync(0,"utf-8");zk(e,it.output,it.dump===!0,t),process.exit(Bf)}if(typeof it.dir!="undefined"&&it.dir!==null){let e=[".antlers.html"];t.formatExtensions.length>0&&(e=t.formatExtensions),JP(it.dir,t,e,it.dump===!0),process.exit(Bf)}if(typeof it.path!="undefined"&&it.path!==null){let e=it.path;it.output!==null&&(e=it.output),Um(it.path,e,it.dump===!0,t),process.exit(Bf)}}else{let e=qf[1];if(nt.existsSync(e)){try{nt.accessSync(e,nt.constants.R_OK|nt.constants.W_OK)}catch(r){console.error(r),process.exit(jm)}if(nt.lstatSync(e).isDirectory()){let r=[".antlers.html"];t.formatExtensions.length>0&&(r=t.formatExtensions),JP(e,t,r,it.dump===!0)}else{let r=e;it.output!==null&&(r=it.output),Um(e,r,it.dump===!0,t)}}}} +`+t.slice(a+1):l+=t.slice(i),l.slice(1)}function CL(t){for(var e="",n=0,r,i=0;i=65536?i+=2:i++)n=Bl(t,i),r=bn[n],!r&&Ml(n)?(e+=t[i],n>=65536&&(e+=t[i+1])):e+=r||hL(n);return e}function PL(t,e,n){var r="",i=t.tag,s,a,o;for(s=0,a=n.length;s1024&&(c+="? "),c+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),!!Wi(t,e,u,!1,!1)&&(c+=t.dump,r+=c));t.tag=i,t.dump="{"+r+"}"}function AL(t,e,n,r){var i="",s=t.tag,a=Object.keys(n),o,l,u,c,f,h;if(t.sortKeys===!0)a.sort();else if(typeof t.sortKeys=="function")a.sort(t.sortKeys);else if(t.sortKeys)throw new jn("sortKeys must be a boolean or a function");for(o=0,l=a.length;o1024,f&&(t.dump&&Fl===t.dump.charCodeAt(0)?h+="?":h+="? "),h+=t.dump,f&&(h+=Bh(t,e)),!!Wi(t,e+1,c,!0,f)&&(t.dump&&Fl===t.dump.charCodeAt(0)?h+=":":h+=": ",h+=t.dump,i+=h));t.tag=s,t.dump=i||"{}"}function uN(t,e,n){var r,i,s,a,o,l;for(i=n?t.explicitTypes:t.implicitTypes,s=0,a=i.length;s tag resolver accepts not "'+l+'" style');t.dump=r}return!0}return!1}function Wi(t,e,n,r,i,s,a){t.tag=null,t.dump=n,uN(t,n,!1)||uN(t,n,!0);var o=Yv.call(t.dump),l=r,u;r&&(r=t.flowLevel<0||t.flowLevel>e);var c=o==="[object Object]"||o==="[object Array]",f,h;if(c&&(f=t.duplicates.indexOf(n),h=f!==-1),(t.tag!==null&&t.tag!=="?"||h||t.indent!==2&&e>0)&&(i=!1),h&&t.usedDuplicates[f])t.dump="*ref_"+f;else{if(c&&h&&!t.usedDuplicates[f]&&(t.usedDuplicates[f]=!0),o==="[object Object]")r&&Object.keys(t.dump).length!==0?(AL(t,e,t.dump,i),h&&(t.dump="&ref_"+f+t.dump)):(SL(t,e,t.dump),h&&(t.dump="&ref_"+f+" "+t.dump));else if(o==="[object Array]")r&&t.dump.length!==0?(t.noArrayIndent&&!a&&e>0?lN(t,e-1,t.dump,i):lN(t,e,t.dump,i),h&&(t.dump="&ref_"+f+t.dump)):(PL(t,e,t.dump),h&&(t.dump="&ref_"+f+" "+t.dump));else if(o==="[object String]")t.tag!=="?"&&vL(t,t.dump,e,s,l);else{if(o==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new jn("unacceptable kind of an object to dump "+o)}t.tag!==null&&t.tag!=="?"&&(u=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",t.dump=u+" "+t.dump)}return!0}function EL(t,e){var n=[],r=[],i,s;for(Vh(t,n,r),i=0,s=r.length;i0?r.split(",").map(i=>i.trim().toLowerCase()):[]:n}var FF=dC().html,Tf=class extends Ih{constructor(e){super();this.options=e,this.withHtmlFormatter(this.formatHtml).withYamlFormatter(Uh.formatFrontMatter).withTransformOptions({endNewline:Wn(e.htmlOptions,"endWithNewline",!1),maxAntlersStatementsPerLine:e.maxStatementsPerLine,newlinesAfterFrontMatter:1,tabSize:e.tabSize})}formatHtml(e){var n;return FF(e,{indent_size:this.options.tabSize,indent_char:this.options.insertSpaces?" ":" ",indent_empty_lines:Wn(this.options.htmlOptions,"indentEmptyLines",!1),wrap_line_length:Wn(this.options.htmlOptions,"wrapLineLength",120),unformatted:(n=pN(this.options.htmlOptions,"unformatted",[]))!=null?n:[],content_unformatted:[],indent_inner_html:Wn(this.options.htmlOptions,"indentInnerHtml",!1),preserve_newlines:Wn(this.options.htmlOptions,"preserveNewLines",!0),max_preserve_newlines:Wn(this.options.htmlOptions,"maxPreserveNewLines",32786),indent_handlebars:Wn(this.options.htmlOptions,"indentHandlebars",!1),end_with_newline:Wn(this.options.htmlOptions,"endWithNewline",!1),extra_liners:[],wrap_attributes:Wn(this.options.htmlOptions,"wrapAttributes","auto"),wrap_attributes_indent_size:Wn(this.options.htmlOptions,"wrapAttributesIndentSize",void 0),eol:` +`,indent_scripts:Wn(this.options.htmlOptions,"indentScripts","normal"),unformatted_content_delimiter:Wn(this.options.htmlOptions,"unformattedContentDelimiter","")})}};var $k=zP(),au=require("path"),Bf=0,XP=3,Kk=1,jm=4,zk=".antlers.format.json",it=$k.command("format","Formats a file and writes the changes to disk",{path:{description:"The file to format",alias:"f",type:"string"},dir:{description:"The directory to format",alias:"d",type:"string"},stdin:{description:"Indicates that the formatter should use stdin input",alias:"s",type:"boolean",default:!1},output:{description:"An optional output path",alias:"out",type:"string",default:null},dump:{description:"Optionally writes the formatted results to the output instead of saving",alias:"dd",type:"boolean",default:!1},options:{description:"An optional path to an Antlers format configuration file",alias:"o",type:"string"}}).help().alias("help","h").argv,qf=it._,Xk={htmlOptions:{},formatFrontMatter:!0,insertSpaces:!0,maxStatementsPerLine:3,tabSize:4,formatExtensions:[".antlers.html"]};function QP(t){if(nt.existsSync(t)){let e=nt.readFileSync(t,{encoding:"utf8"});try{return JSON.parse(e)}catch(n){console.error(n)}}return null}function JP(t,e,n){let r=nt.readdirSync(t);for(let i=0;i{JP(t,i,s=>{Um(s,s,r,e)})}),process.exit(Bf)}else process.exit(XP)}function Jk(t){let e=au.dirname(t);e=="."&&(e=process.cwd());let n=e.split(au.sep);for(;n.length>0;){let r=n.join(au.sep),i=au.join(r,zk);if(nt.existsSync(i))return i;n.pop()}return null}if(it._.includes("format")){let t=Xk;if(typeof it.options!="undefined"&&it.options!==null){let e=QP(it.options);e!=null&&(t=e)}else{let e="";qf.length==1?typeof it.dir!="undefined"&&it.dir!==null?e=it.dir:typeof it.path!="undefined"&&it.path!==null&&(e=it.path):e=qf[1];let n=Jk(e);if(n!=null){let r=QP(n);r!=null&&(t=r)}}if(qf.length==1){if(it.stdin===!0){let e=nt.readFileSync(0,"utf-8");Qk(e,it.output,it.dump===!0,t),process.exit(Bf)}if(typeof it.dir!="undefined"&&it.dir!==null){let e=[".antlers.html"];t.formatExtensions.length>0&&(e=t.formatExtensions),ZP(it.dir,t,e,it.dump===!0),process.exit(Bf)}if(typeof it.path!="undefined"&&it.path!==null){let e=it.path;it.output!==null&&(e=it.output),Um(it.path,e,it.dump===!0,t),process.exit(Bf)}}else{let e=qf[1];if(nt.existsSync(e)){try{nt.accessSync(e,nt.constants.R_OK|nt.constants.W_OK)}catch(r){console.error(r),process.exit(jm)}if(nt.lstatSync(e).isDirectory()){let r=[".antlers.html"];t.formatExtensions.length>0&&(r=t.formatExtensions),ZP(e,t,r,it.dump===!0)}else{let r=e;it.output!==null&&(r=it.output),Um(e,r,it.dump===!0,t)}}}} /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */ diff --git a/formatcli/package/package.json b/formatcli/package/package.json index 88159ae..97adaf0 100644 --- a/formatcli/package/package.json +++ b/formatcli/package/package.json @@ -1,6 +1,6 @@ { "name": "antlers-formatter", - "version": "1.1.0", + "version": "1.1.1", "description": "Formats Antlers template files.", "main": "cli.js", "bin": { diff --git a/package.json b/package.json index 8a03727..4998014 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Provides Antlers syntax highlighting, formatting, error reporting, project-specific suggestions, and more.", "author": "John Koster", "license": "MIT", - "version": "2.1.6", + "version": "2.2.0", "repository": { "type": "git", "url": "https://github.com/Stillat/vscode-antlers-language-server" diff --git a/server/package.json b/server/package.json index a08ce2a..09ef551 100644 --- a/server/package.json +++ b/server/package.json @@ -1,7 +1,7 @@ { "name": "stillat-antlers-lsp", "description": "Language server for Antlers.", - "version": "1.1.66", + "version": "1.1.67", "author": "John Koster", "license": "MIT", "engines": {