@eihrteam/xml-lsp 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +47 -2
  3. package/dist/npm/LICENSE +201 -0
  4. package/dist/npm/ThirdPartyNotices.txt +384 -0
  5. package/dist/npm/ace-client/index.d.ts +12 -0
  6. package/dist/npm/ace-client/index.js +15 -0
  7. package/dist/npm/browser-client/index.d.ts +33 -0
  8. package/dist/npm/browser-client/index.js +12 -0
  9. package/dist/npm/cli.js +3 -0
  10. package/dist/npm/language-server/browser.d.ts +2 -0
  11. package/dist/npm/language-server/browser.js +41 -0
  12. package/dist/npm/language-server/index.d.ts +1 -0
  13. package/dist/npm/language-server/index.js +28 -0
  14. package/dist/npm/language-server/node-api.d.ts +2 -0
  15. package/dist/npm/language-server/node-api.js +43 -0
  16. package/dist/npm/language-server/server.d.ts +9 -0
  17. package/dist/npm/language-server/worker.d.ts +1 -0
  18. package/dist/npm/language-server/worker.js +41 -0
  19. package/dist/npm/language-service/content-model.d.ts +18 -0
  20. package/dist/npm/language-service/document.d.ts +32 -0
  21. package/dist/npm/language-service/edits.d.ts +14 -0
  22. package/dist/npm/language-service/index.d.ts +24 -0
  23. package/dist/npm/language-service/index.js +28 -0
  24. package/dist/npm/language-service/intelligence.d.ts +8 -0
  25. package/dist/npm/language-service/parser.d.ts +68 -0
  26. package/dist/npm/language-service/schema-model.d.ts +43 -0
  27. package/dist/npm/language-service/schema.generated.d.ts +2 -0
  28. package/dist/npm/language-service/validation.d.ts +9 -0
  29. package/dist/npm/monaco-client/index.d.ts +7 -0
  30. package/dist/npm/monaco-client/index.js +14 -0
  31. package/docs/api.md +48 -0
  32. package/docs/architecture.md +45 -0
  33. package/docs/editor-integration.md +51 -0
  34. package/docs/implementation.md +57 -0
  35. package/docs/releasing.md +30 -0
  36. package/package.json +128 -4
@@ -0,0 +1,41 @@
1
+ var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,i=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},a=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),o=(t,n)=>{let r=Object.setPrototypeOf({},null);for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n&1||e(r,Symbol.toStringTag,{value:`Module`}),n&2?r:Object.preventExtensions(r)},s=(i,a,o,s)=>{if(a&&typeof a==`object`||typeof a==`function`)for(var c=n(a),l=0,u=c.length,d;l<u;l++)d=c[l],!r.call(i,d)&&d!==o&&e(i,d,{get:(e=>a[e]).bind(null,d),enumerable:!(s=t(a,d))||s.enumerable});return i},c=t=>r.call(t,`module.exports`)?t[`module.exports`]:s(e({},`__esModule`,{value:!0}),t),l=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0,e.boolean=function(e){return e===!0||e===!1};function t(e){return typeof e==`string`||e instanceof String}e.string=t,e.number=function(e){return typeof e==`number`||e instanceof Number},e.error=function(e){return e instanceof Error},e.func=function(e){return typeof e==`function`};function n(e){return Array.isArray(e)}e.array=n,e.stringArray=function(e){return n(e)&&e.every(e=>t(e))}})),u=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Message=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType=e.RequestType0=e.AbstractMessageSignature=e.ParameterStructures=e.ResponseError=e.ErrorCodes=void 0;let t=l();var n;(function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.jsonrpcReservedErrorRangeStart=-32099,e.serverErrorStart=-32099,e.MessageWriteError=-32099,e.MessageReadError=-32098,e.PendingResponseRejected=-32097,e.ConnectionInactive=-32096,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.jsonrpcReservedErrorRangeEnd=-32e3,e.serverErrorEnd=-32e3})(n||(e.ErrorCodes=n={})),e.ResponseError=class e extends Error{constructor(r,i,a){super(i),this.code=t.number(r)?r:n.UnknownErrorCode,this.data=a,Object.setPrototypeOf(this,e.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};var r=class e{constructor(e){this.kind=e}static is(t){return t===e.auto||t===e.byName||t===e.byPosition}toString(){return this.kind}};e.ParameterStructures=r,r.auto=new r(`auto`),r.byPosition=new r(`byPosition`),r.byName=new r(`byName`);var i=class{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return r.auto}};e.AbstractMessageSignature=i,e.RequestType0=class extends i{constructor(e){super(e,0)}},e.RequestType=class extends i{constructor(e,t=r.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},e.RequestType1=class extends i{constructor(e,t=r.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},e.RequestType2=class extends i{constructor(e){super(e,2)}},e.RequestType3=class extends i{constructor(e){super(e,3)}},e.RequestType4=class extends i{constructor(e){super(e,4)}},e.RequestType5=class extends i{constructor(e){super(e,5)}},e.RequestType6=class extends i{constructor(e){super(e,6)}},e.RequestType7=class extends i{constructor(e){super(e,7)}},e.RequestType8=class extends i{constructor(e){super(e,8)}},e.RequestType9=class extends i{constructor(e){super(e,9)}},e.NotificationType=class extends i{constructor(e,t=r.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},e.NotificationType0=class extends i{constructor(e){super(e,0)}},e.NotificationType1=class extends i{constructor(e,t=r.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},e.NotificationType2=class extends i{constructor(e){super(e,2)}},e.NotificationType3=class extends i{constructor(e){super(e,3)}},e.NotificationType4=class extends i{constructor(e){super(e,4)}},e.NotificationType5=class extends i{constructor(e){super(e,5)}},e.NotificationType6=class extends i{constructor(e){super(e,6)}},e.NotificationType7=class extends i{constructor(e){super(e,7)}},e.NotificationType8=class extends i{constructor(e){super(e,8)}},e.NotificationType9=class extends i{constructor(e){super(e,9)}};var a;(function(e){e.isRequest=function(e){let n=e;return n&&t.string(n.method)&&(t.string(n.id)||t.number(n.id))},e.isNotification=function(e){let n=e;return n&&t.string(n.method)&&e.id===void 0},e.isResponse=function(e){let n=e;return n&&(n.result!==void 0||!!n.error)&&(t.string(n.id)||t.number(n.id)||n.id===null)}})(a||(e.Message=a={}))})),d=/* @__PURE__ */ a((e=>{var t;Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=e.LinkedMap=e.Touch=void 0;var n;(function(e){e.None=0,e.First=1,e.AsOld=e.First,e.Last=2,e.AsNew=e.Last})(n||(e.Touch=n={}));var r=class{constructor(){this[t]=`LinkedMap`,this._map=/* @__PURE__ */ new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=n.None){let r=this._map.get(e);if(r)return t!==n.None&&this.touch(r,t),r.value}set(e,t,r=n.None){let i=this._map.get(e);if(i)i.value=t,r!==n.None&&this.touch(i,r);else{switch(i={key:e,value:t,next:void 0,previous:void 0},r){case n.None:this.addItemLast(i);break;case n.First:this.addItemFirst(i);break;case n.Last:default:this.addItemLast(i)}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw Error(`Invalid list`);let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let n=this._state,r=this._head;for(;r;){if(t?e.bind(t)(r.value,r.key,this):e(r.value,r.key,this),this._state!==n)throw Error(`LinkedMap got modified during iteration.`);r=r.next}}keys(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw Error(`LinkedMap got modified during iteration.`);if(t){let e={value:t.key,done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}values(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw Error(`LinkedMap got modified during iteration.`);if(t){let e={value:t.value,done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}entries(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw Error(`LinkedMap got modified during iteration.`);if(t){let e={value:[t.key,t.value],done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}[(t=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.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 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 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 Error(`Invalid list`);e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw Error(`Invalid list`);e.previous.next=void 0,this._tail=e.previous}else{let t=e.next,n=e.previous;if(!t||!n)throw Error(`Invalid list`);t.previous=n,n.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw Error(`Invalid list`);if(t===n.First||t===n.Last){if(t===n.First){if(e===this._head)return;let t=e.next,n=e.previous;e===this._tail?(n.next=void 0,this._tail=n):(t.previous=n,n.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===n.Last){if(e===this._tail)return;let t=e.next,n=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=n,n.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((t,n)=>{e.push([n,t])}),e}fromJSON(e){this.clear();for(let[t,n]of e)this.set(t,n)}};e.LinkedMap=r,e.LRUCache=class extends r{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),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,t=n.AsNew){return super.get(e,t)}peek(e){return super.get(e,n.None)}set(e,t){return super.set(e,t,n.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}})),f=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Disposable=void 0;var t;(function(e){e.create=function(e){return{dispose:e}}})(t||(e.Disposable=t={}))})),p=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t;function n(){if(t===void 0)throw Error(`No runtime abstraction layer installed`);return t}(function(e){e.install=function(e){if(e===void 0)throw Error(`No runtime abstraction layer provided`);t=e}})(n||={}),e.default=n})),m=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Emitter=e.Event=void 0;let t=p();var n;(function(e){let t={dispose(){}};e.None=function(){return t}})(n||(e.Event=n={}));var r=class{add(e,t=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let n=!1;for(let r=0,i=this._callbacks.length;r<i;r++)if(this._callbacks[r]===e){if(this._contexts[r]===t){this._callbacks.splice(r,1),this._contexts.splice(r,1);return}n=!0}if(n)throw Error(`When adding a listener with a context, you should remove it with the same context`)}invoke(...e){if(!this._callbacks)return[];let n=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let a=0,o=r.length;a<o;a++)try{n.push(r[a].apply(i[a],e))}catch(e){(0,t.default)().console.error(e)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},i=class e{constructor(e){this._options=e}get event(){return this._event||=(t,n,i)=>{this._callbacks||=new r,this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(t,n);let a={dispose:()=>{this._callbacks&&(this._callbacks.remove(t,n),a.dispose=e._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(i)&&i.push(a),a},this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&=(this._callbacks.dispose(),void 0)}};e.Emitter=i,i._noop=function(){}})),h=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CancellationTokenSource=e.CancellationToken=void 0;let t=p(),n=l(),r=m();var i;(function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:r.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:r.Event.None}),e.is=function(t){let r=t;return r&&(r===e.None||r===e.Cancelled||n.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}})(i||(e.CancellationToken=i={}));let a=Object.freeze(function(e,n){let r=(0,t.default)().timer.setTimeout(e.bind(n),0);return{dispose(){r.dispose()}}});var o=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?a:(this._emitter||=new r.Emitter,this._emitter.event)}dispose(){this._emitter&&=(this._emitter.dispose(),void 0)}};e.CancellationTokenSource=class{get token(){return this._token||=new o,this._token}cancel(){this._token?this._token.cancel():this._token=i.Cancelled}dispose(){this._token?this._token instanceof o&&this._token.dispose():this._token=i.None}}})),g=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=void 0;let t=h();var n;(function(e){e.Continue=0,e.Cancelled=1})(n||={}),e.SharedArraySenderStrategy=class{constructor(){this.buffers=/* @__PURE__ */ new Map}enableCancellation(e){if(e.id===null)return;let t=new SharedArrayBuffer(4),r=new Int32Array(t,0,1);r[0]=n.Continue,this.buffers.set(e.id,t),e.$cancellationData=t}async sendCancellation(e,t){let r=this.buffers.get(t);if(r===void 0)return;let i=new Int32Array(r,0,1);Atomics.store(i,0,n.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};var r=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===n.Cancelled}get onCancellationRequested(){throw Error(`Cancellation over SharedArrayBuffer doesn't support cancellation events`)}},i=class{constructor(e){this.token=new r(e)}cancel(){}dispose(){}};e.SharedArrayReceiverStrategy=class{constructor(){this.kind=`request`}createCancellationTokenSource(e){let n=e.$cancellationData;return n===void 0?new t.CancellationTokenSource:new i(n)}}})),_=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Semaphore=void 0;let t=p();e.Semaphore=class{constructor(e=1){if(e<=0)throw Error(`Capacity must be greater than 0`);this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((t,n)=>{this._waiting.push({thunk:e,resolve:t,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length!==0&&this._active!==this._capacity&&(0,t.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 Error(`To many thunks active`);try{let t=e.thunk();t instanceof Promise?t.then(t=>{this._active--,e.resolve(t),this.runNext()},t=>{this._active--,e.reject(t),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}}})),v=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=void 0;let t=p(),n=l(),r=m(),i=_();var a;(function(e){e.is=function(e){let t=e;return t&&n.func(t.listen)&&n.func(t.dispose)&&n.func(t.onError)&&n.func(t.onClose)&&n.func(t.onPartialMessage)}})(a||(e.MessageReader=a={}));var o=class{constructor(){this.errorEmitter=new r.Emitter,this.closeEmitter=new r.Emitter,this.partialMessageEmitter=new r.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:/* @__PURE__ */ Error(`Reader received error. Reason: ${n.string(e.message)?e.message:`unknown`}`)}};e.AbstractMessageReader=o;var s;(function(e){e.fromOptions=function(e){let n,r,i=/* @__PURE__ */ new Map,a,o=/* @__PURE__ */ new Map;if(e===void 0||typeof e==`string`)n=e??`utf-8`;else{if(n=e.charset??`utf-8`,e.contentDecoder!==void 0&&(r=e.contentDecoder,i.set(r.name,r)),e.contentDecoders!==void 0)for(let t of e.contentDecoders)i.set(t.name,t);if(e.contentTypeDecoder!==void 0&&(a=e.contentTypeDecoder,o.set(a.name,a)),e.contentTypeDecoders!==void 0)for(let t of e.contentTypeDecoders)o.set(t.name,t)}return a===void 0&&(a=(0,t.default)().applicationJson.decoder,o.set(a.name,a)),{charset:n,contentDecoder:r,contentDecoders:i,contentTypeDecoder:a,contentTypeDecoders:o}}})(s||={}),e.ReadableStreamMessageReader=class extends o{constructor(e,n){super(),this.readable=e,this.options=s.fromOptions(n),this.buffer=(0,t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new i.Semaphore(1)}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 t=this.readable.onData(e=>{this.onData(e)});return this.readable.onError(e=>this.fireError(e)),this.readable.onClose(()=>this.fireClose()),t}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let e=this.buffer.tryReadHeaders(!0);if(!e)return;let t=e.get(`content-length`);if(!t){this.fireError(/* @__PURE__ */ Error(`Header must provide a Content-Length property.\n${JSON.stringify(Object.fromEntries(e))}`));return}let n=parseInt(t);if(isNaN(n)){this.fireError(/* @__PURE__ */ Error(`Content-Length value must be a number. Got ${t}`));return}this.nextMessageLength=n}let e=this.buffer.tryReadBody(this.nextMessageLength);if(e===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let t=this.options.contentDecoder===void 0?e:await this.options.contentDecoder.decode(e),n=await this.options.contentTypeDecoder.decode(t,this.options);this.callback(n)}).catch(e=>{this.fireError(e)})}}catch(e){this.fireError(e)}}clearPartialMessageTimer(){this.partialMessageTimer&&=(this.partialMessageTimer.dispose(),void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),this._partialMessageTimeout<=0||(this.partialMessageTimer=(0,t.default)().timer.setTimeout((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}})),y=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=void 0;let t=p(),n=l(),r=_(),i=m();var a;(function(e){e.is=function(e){let t=e;return t&&n.func(t.dispose)&&n.func(t.onClose)&&n.func(t.onError)&&n.func(t.write)}})(a||(e.MessageWriter=a={}));var o=class{constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,n){this.errorEmitter.fire([this.asError(e),t,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:/* @__PURE__ */ Error(`Writer received error. Reason: ${n.string(e.message)?e.message:`unknown`}`)}};e.AbstractMessageWriter=o;var s;(function(e){e.fromOptions=function(e){return e===void 0||typeof e==`string`?{charset:e??`utf-8`,contentTypeEncoder:(0,t.default)().applicationJson.encoder}:{charset:e.charset??`utf-8`,contentEncoder:e.contentEncoder,contentTypeEncoder:e.contentTypeEncoder??(0,t.default)().applicationJson.encoder}}})(s||={}),e.WriteableStreamMessageWriter=class extends o{constructor(e,t){super(),this.writable=e,this.options=s.fromOptions(t),this.errorCount=0,this.writeSemaphore=new r.Semaphore(1),this.writable.onError(e=>this.fireError(e)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(e=>this.options.contentEncoder===void 0?e:this.options.contentEncoder.encode(e)).then(t=>{let n=[];return n.push(`Content-Length: `,t.byteLength.toString(),`\r
2
+ `),n.push(`\r
3
+ `),this.doWrite(e,n,t)},e=>{throw this.fireError(e),e}))}async doWrite(e,t,n){try{return await this.writable.write(t.join(``),`ascii`),this.writable.write(n)}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){this.writable.end()}}})),b=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractMessageBuffer=void 0,e.AbstractMessageBuffer=class{constructor(e=`utf-8`){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let t=typeof e==`string`?this.fromString(e,this._encoding):e;this._chunks.push(t),this._totalLength+=t.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let t=0,n=0,r=0,i=0;e:for(;n<this._chunks.length;){let e=this._chunks[n];for(r=0;r<e.length;){switch(e[r]){case 13:switch(t){case 0:t=1;break;case 2:t=3;break;default:t=0}break;case 10:switch(t){case 1:t=2;break;case 3:t=4,r++;break e;default:t=0}break;default:t=0}r++}i+=e.byteLength,n++}if(t!==4)return;let a=this._read(i+r),o=/* @__PURE__ */ new Map,s=this.toString(a,`ascii`).split(`\r
4
+ `);if(s.length<2)return o;for(let t=0;t<s.length-2;t++){let n=s[t],r=n.indexOf(`:`);if(r===-1)throw Error(`Message header must separate key and value using ':'\n${n}`);let i=n.substr(0,r),a=n.substr(r+1).trim();o.set(e?i.toLowerCase():i,a)}return o}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw Error(`Cannot read so many bytes!`);if(this._chunks[0].byteLength===e){let t=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(t)}if(this._chunks[0].byteLength>e){let t=this._chunks[0],n=this.asNative(t,e);return this._chunks[0]=t.slice(e),this._totalLength-=e,n}let t=this.allocNative(e),n=0;for(;e>0;){let r=this._chunks[0];if(r.byteLength>e){let i=r.slice(0,e);t.set(i,n),n+=e,this._chunks[0]=r.slice(e),this._totalLength-=e,e-=e}else t.set(r,n),n+=r.byteLength,this._chunks.shift(),this._totalLength-=r.byteLength,e-=r.byteLength}return t}}})),x=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.ConnectionOptions=e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.RequestCancellationReceiverStrategy=e.IdCancellationReceiverStrategy=e.ConnectionStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=e.NullLogger=e.ProgressType=e.ProgressToken=void 0;let t=p(),n=l(),r=u(),i=d(),a=m(),o=h();var s;(function(e){e.type=new r.NotificationType(`$/cancelRequest`)})(s||={});var c;(function(e){e.is=function(e){return typeof e==`string`||typeof e==`number`}})(c||(e.ProgressToken=c={}));var f;(function(e){e.type=new r.NotificationType(`$/progress`)})(f||={}),e.ProgressType=class{constructor(){}};var g;(function(e){e.is=function(e){return n.func(e)}})(g||={}),e.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var _;(function(e){e[e.Off=0]=`Off`,e[e.Messages=1]=`Messages`,e[e.Compact=2]=`Compact`,e[e.Verbose=3]=`Verbose`})(_||(e.Trace=_={}));var v;(function(e){e.Off=`off`,e.Messages=`messages`,e.Compact=`compact`,e.Verbose=`verbose`})(v||(e.TraceValues=v={})),(function(e){e.fromString=function(t){if(!n.string(t))return e.Off;switch(t=t.toLowerCase(),t){case`off`:return e.Off;case`messages`:return e.Messages;case`compact`:return e.Compact;case`verbose`:return e.Verbose;default:return e.Off}},e.toString=function(t){switch(t){case e.Off:return`off`;case e.Messages:return`messages`;case e.Compact:return`compact`;case e.Verbose:return`verbose`;default:return`off`}}})(_||(e.Trace=_={}));var y;(function(e){e.Text=`text`,e.JSON=`json`})(y||(e.TraceFormat=y={})),(function(e){e.fromString=function(t){return n.string(t)?(t=t.toLowerCase(),t===`json`?e.JSON:e.Text):e.Text}})(y||(e.TraceFormat=y={}));var b;(function(e){e.type=new r.NotificationType(`$/setTrace`)})(b||(e.SetTraceNotification=b={}));var x;(function(e){e.type=new r.NotificationType(`$/logTrace`)})(x||(e.LogTraceNotification=x={}));var S;(function(e){e[e.Closed=1]=`Closed`,e[e.Disposed=2]=`Disposed`,e[e.AlreadyListening=3]=`AlreadyListening`})(S||(e.ConnectionErrors=S={}));var C=class e extends Error{constructor(t,n){super(n),this.code=t,Object.setPrototypeOf(this,e.prototype)}};e.ConnectionError=C;var w;(function(e){e.is=function(e){let t=e;return t&&n.func(t.cancelUndispatched)}})(w||(e.ConnectionStrategy=w={}));var T;(function(e){e.is=function(e){let t=e;return t&&(t.kind===void 0||t.kind===`id`)&&n.func(t.createCancellationTokenSource)&&(t.dispose===void 0||n.func(t.dispose))}})(T||(e.IdCancellationReceiverStrategy=T={}));var E;(function(e){e.is=function(e){let t=e;return t&&t.kind===`request`&&n.func(t.createCancellationTokenSource)&&(t.dispose===void 0||n.func(t.dispose))}})(E||(e.RequestCancellationReceiverStrategy=E={}));var D;(function(e){e.Message=Object.freeze({createCancellationTokenSource(e){return new o.CancellationTokenSource}}),e.is=function(e){return T.is(e)||E.is(e)}})(D||(e.CancellationReceiverStrategy=D={}));var O;(function(e){e.Message=Object.freeze({sendCancellation(e,t){return e.sendNotification(s.type,{id:t})},cleanup(e){}}),e.is=function(e){let t=e;return t&&n.func(t.sendCancellation)&&n.func(t.cleanup)}})(O||(e.CancellationSenderStrategy=O={}));var k;(function(e){e.Message=Object.freeze({receiver:D.Message,sender:O.Message}),e.is=function(e){let t=e;return t&&D.is(t.receiver)&&O.is(t.sender)}})(k||(e.CancellationStrategy=k={}));var ee;(function(e){e.is=function(e){let t=e;return t&&n.func(t.handleMessage)}})(ee||(e.MessageStrategy=ee={}));var A;(function(e){e.is=function(e){let t=e;return t&&(k.is(t.cancellationStrategy)||w.is(t.connectionStrategy)||ee.is(t.messageStrategy))}})(A||(e.ConnectionOptions=A={}));var j;(function(e){e[e.New=1]=`New`,e[e.Listening=2]=`Listening`,e[e.Closed=3]=`Closed`,e[e.Disposed=4]=`Disposed`})(j||={}),e.createMessageConnection=function(l,u,d,p){let m=d===void 0?e.NullLogger:d,h=0,v=0,w=0,E,D=/* @__PURE__ */ new Map,O,A=/* @__PURE__ */ new Map,te=/* @__PURE__ */ new Map,M,N=new i.LinkedMap,P=/* @__PURE__ */ new Map,ne=/* @__PURE__ */ new Set,F=/* @__PURE__ */ new Map,I=_.Off,L=y.Text,R,z=j.New,B=new a.Emitter,re=new a.Emitter,V=new a.Emitter,H=new a.Emitter,ie=new a.Emitter,U=p&&p.cancellationStrategy?p.cancellationStrategy:k.Message;function ae(e){if(e===null)throw Error(`Can't send requests with id null since the response can't be correlated.`);return`req-`+e.toString()}function oe(e){return e===null?`res-unknown-`+(++w).toString():`res-`+e.toString()}function se(){return`not-`+(++v).toString()}function ce(e,t){r.Message.isRequest(t)?e.set(ae(t.id),t):r.Message.isResponse(t)?e.set(oe(t.id),t):e.set(se(),t)}function W(e){}function le(){return z===j.Listening}function ue(){return z===j.Closed}function G(){return z===j.Disposed}function de(){(z===j.New||z===j.Listening)&&(z=j.Closed,re.fire(void 0))}function fe(e){B.fire([e,void 0,void 0])}function pe(e){B.fire(e)}l.onClose(de),l.onError(fe),u.onClose(de),u.onError(pe);function me(){M||N.size===0||(M=(0,t.default)().timer.setImmediate(()=>{M=void 0,ge()}))}function he(e){r.Message.isRequest(e)?ve(e):r.Message.isNotification(e)?be(e):r.Message.isResponse(e)?ye(e):xe(e)}function ge(){if(N.size===0)return;let e=N.shift();try{let t=p?.messageStrategy;ee.is(t)?t.handleMessage(e,he):he(e)}finally{me()}}let _e=e=>{try{if(r.Message.isNotification(e)&&e.method===s.type.method){let t=e.params.id,n=ae(t),i=N.get(n);if(r.Message.isRequest(i)){let r=p?.connectionStrategy,a=r&&r.cancelUndispatched?r.cancelUndispatched(i,W):void 0;if(a&&(a.error!==void 0||a.result!==void 0)){N.delete(n),F.delete(t),a.id=i.id,Te(a,e.method,Date.now()),u.write(a).catch(()=>m.error(`Sending response for canceled message failed.`));return}}let a=F.get(t);if(a!==void 0){a.cancel(),De(e);return}ne.add(t)}ce(N,e)}finally{me()}};function ve(e){if(G())return;function t(t,n,i){let a={jsonrpc:`2.0`,id:e.id};t instanceof r.ResponseError?a.error=t.toJson():a.result=t===void 0?null:t,Te(a,n,i),u.write(a).catch(()=>m.error(`Sending response failed.`))}function i(t,n,r){let i={jsonrpc:`2.0`,id:e.id,error:t.toJson()};Te(i,n,r),u.write(i).catch(()=>m.error(`Sending response failed.`))}function a(t,n,r){t===void 0&&(t=null);let i={jsonrpc:`2.0`,id:e.id,result:t};Te(i,n,r),u.write(i).catch(()=>m.error(`Sending response failed.`))}Ee(e);let o=D.get(e.method),s,c;o&&(s=o.type,c=o.handler);let l=Date.now();if(c||E){let o=e.id??String(Date.now()),u=T.is(U.receiver)?U.receiver.createCancellationTokenSource(o):U.receiver.createCancellationTokenSource(e);e.id!==null&&ne.has(e.id)&&u.cancel(),e.id!==null&&F.set(o,u);try{let d;if(c){if(e.params===void 0){if(s!==void 0&&s.numberOfParams!==0){i(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${e.method} defines ${s.numberOfParams} params but received none.`),e.method,l);return}d=c(u.token)}else if(Array.isArray(e.params)){if(s!==void 0&&s.parameterStructures===r.ParameterStructures.byName){i(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${e.method} defines parameters by name but received parameters by position`),e.method,l);return}d=c(...e.params,u.token)}else{if(s!==void 0&&s.parameterStructures===r.ParameterStructures.byPosition){i(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${e.method} defines parameters by position but received parameters by name`),e.method,l);return}d=c(e.params,u.token)}}else E&&(d=E(e.method,e.params,u.token));let f=d;d?f.then?f.then(n=>{F.delete(o),t(n,e.method,l)},t=>{F.delete(o),t instanceof r.ResponseError?i(t,e.method,l):t&&n.string(t.message)?i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${t.message}`),e.method,l):i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,l)}):(F.delete(o),t(d,e.method,l)):(F.delete(o),a(d,e.method,l))}catch(a){F.delete(o),a instanceof r.ResponseError?t(a,e.method,l):a&&n.string(a.message)?i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${a.message}`),e.method,l):i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,l)}}else i(new r.ResponseError(r.ErrorCodes.MethodNotFound,`Unhandled method ${e.method}`),e.method,l)}function ye(e){if(!G()){if(e.id===null)e.error?m.error(`Received response message without id: Error is: \n${JSON.stringify(e.error,void 0,4)}`):m.error(`Received response message without id. No further error information provided.`);else{let t=e.id,n=P.get(t);if(Oe(e,n),n!==void 0){P.delete(t);try{if(e.error){let t=e.error;n.reject(new r.ResponseError(t.code,t.message,t.data))}else if(e.result!==void 0)n.resolve(e.result);else throw Error(`Should never happen.`)}catch(e){e.message?m.error(`Response handler '${n.method}' failed with message: ${e.message}`):m.error(`Response handler '${n.method}' failed unexpectedly.`)}}}}}function be(e){if(G())return;let t,n;if(e.method===s.type.method){let t=e.params.id;ne.delete(t),De(e)}else{{let r=A.get(e.method);r&&(n=r.handler,t=r.type)}if(n||O)try{if(De(e),n){if(e.params===void 0)t!==void 0&&t.numberOfParams!==0&&t.parameterStructures!==r.ParameterStructures.byName&&m.error(`Notification ${e.method} defines ${t.numberOfParams} params but received none.`),n();else if(Array.isArray(e.params)){let i=e.params;e.method===f.type.method&&i.length===2&&c.is(i[0])?n({token:i[0],value:i[1]}):(t!==void 0&&(t.parameterStructures===r.ParameterStructures.byName&&m.error(`Notification ${e.method} defines parameters by name but received parameters by position`),t.numberOfParams!==e.params.length&&m.error(`Notification ${e.method} defines ${t.numberOfParams} params but received ${i.length} arguments`)),n(...i))}else t!==void 0&&t.parameterStructures===r.ParameterStructures.byPosition&&m.error(`Notification ${e.method} defines parameters by position but received parameters by name`),n(e.params)}else O&&O(e.method,e.params)}catch(t){t.message?m.error(`Notification handler '${e.method}' failed with message: ${t.message}`):m.error(`Notification handler '${e.method}' failed unexpectedly.`)}else V.fire(e)}}function xe(e){if(!e){m.error(`Received empty message.`);return}m.error(`Received message which is neither a response nor a notification message:\n${JSON.stringify(e,null,4)}`);let t=e;if(n.string(t.id)||n.number(t.id)){let e=t.id,n=P.get(e);n&&n.reject(/* @__PURE__ */ Error(`The received response has neither a result nor an error property.`))}}function Se(e){if(e!=null)switch(I){case _.Verbose:return JSON.stringify(e,null,4);case _.Compact:return JSON.stringify(e);default:return}}function Ce(e){if(I!==_.Off&&R){if(L===y.Text){let t;(I===_.Verbose||I===_.Compact)&&e.params&&(t=`Params: ${Se(e.params)}\n\n`),R.log(`Sending request '${e.method} - (${e.id})'.`,t)}else ke(`send-request`,e)}}function we(e){if(I!==_.Off&&R){if(L===y.Text){let t;(I===_.Verbose||I===_.Compact)&&(t=e.params?`Params: ${Se(e.params)}\n\n`:`No parameters provided.
5
+
6
+ `),R.log(`Sending notification '${e.method}'.`,t)}else ke(`send-notification`,e)}}function Te(e,t,n){if(I!==_.Off&&R){if(L===y.Text){let r;(I===_.Verbose||I===_.Compact)&&(e.error&&e.error.data?r=`Error data: ${Se(e.error.data)}\n\n`:e.result?r=`Result: ${Se(e.result)}\n\n`:e.error===void 0&&(r=`No result returned.
7
+
8
+ `)),R.log(`Sending response '${t} - (${e.id})'. Processing request took ${Date.now()-n}ms`,r)}else ke(`send-response`,e)}}function Ee(e){if(I!==_.Off&&R){if(L===y.Text){let t;(I===_.Verbose||I===_.Compact)&&e.params&&(t=`Params: ${Se(e.params)}\n\n`),R.log(`Received request '${e.method} - (${e.id})'.`,t)}else ke(`receive-request`,e)}}function De(e){if(I!==_.Off&&R&&e.method!==x.type.method){if(L===y.Text){let t;(I===_.Verbose||I===_.Compact)&&(t=e.params?`Params: ${Se(e.params)}\n\n`:`No parameters provided.
9
+
10
+ `),R.log(`Received notification '${e.method}'.`,t)}else ke(`receive-notification`,e)}}function Oe(e,t){if(I!==_.Off&&R){if(L===y.Text){let n;if((I===_.Verbose||I===_.Compact)&&(e.error&&e.error.data?n=`Error data: ${Se(e.error.data)}\n\n`:e.result?n=`Result: ${Se(e.result)}\n\n`:e.error===void 0&&(n=`No result returned.
11
+
12
+ `)),t){let r=e.error?` Request failed: ${e.error.message} (${e.error.code}).`:``;R.log(`Received response '${t.method} - (${e.id})' in ${Date.now()-t.timerStart}ms.${r}`,n)}else R.log(`Received response ${e.id} without active response promise.`,n)}else ke(`receive-response`,e)}}function ke(e,t){if(!R||I===_.Off)return;let n={isLSPMessage:!0,type:e,message:t,timestamp:Date.now()};R.log(n)}function Ae(){if(ue())throw new C(S.Closed,`Connection is closed.`);if(G())throw new C(S.Disposed,`Connection is disposed.`)}function je(){if(le())throw new C(S.AlreadyListening,`Connection is already listening`)}function Me(){if(!le())throw Error(`Call listen() first.`)}function Ne(e){return e===void 0?null:e}function Pe(e){if(e!==null)return e}function Fe(e){return e!=null&&!Array.isArray(e)&&typeof e==`object`}function Ie(e,t){switch(e){case r.ParameterStructures.auto:return Fe(t)?Pe(t):[Ne(t)];case r.ParameterStructures.byName:if(!Fe(t))throw Error(`Received parameters by name but param is not an object literal.`);return Pe(t);case r.ParameterStructures.byPosition:return[Ne(t)];default:throw Error(`Unknown parameter structure ${e.toString()}`)}}function Le(e,t){let n,r=e.numberOfParams;switch(r){case 0:n=void 0;break;case 1:n=Ie(e.parameterStructures,t[0]);break;default:n=[];for(let e=0;e<t.length&&e<r;e++)n.push(Ne(t[e]));if(t.length<r)for(let e=t.length;e<r;e++)n.push(null)}return n}let Re={sendNotification:(e,...t)=>{Ae();let i,a;if(n.string(e)){i=e;let n=t[0],o=0,s=r.ParameterStructures.auto;r.ParameterStructures.is(n)&&(o=1,s=n);let c=t.length,l=c-o;switch(l){case 0:a=void 0;break;case 1:a=Ie(s,t[o]);break;default:if(s===r.ParameterStructures.byName)throw Error(`Received ${l} parameters for 'by Name' notification parameter structure.`);a=t.slice(o,c).map(e=>Ne(e))}}else{let n=t;i=e.method,a=Le(e,n)}let o={jsonrpc:`2.0`,method:i,params:a};return we(o),u.write(o).catch(e=>{throw m.error(`Sending notification failed.`),e})},onNotification:(e,t)=>{Ae();let r;return n.func(e)?O=e:t&&(n.string(e)?(r=e,A.set(e,{type:void 0,handler:t})):(r=e.method,A.set(e.method,{type:e,handler:t}))),{dispose:()=>{r===void 0?O=void 0:A.delete(r)}}},onProgress:(e,t,n)=>{if(te.has(t))throw Error(`Progress handler for token ${t} already registered`);return te.set(t,n),{dispose:()=>{te.delete(t)}}},sendProgress:(e,t,n)=>Re.sendNotification(f.type,{token:t,value:n}),onUnhandledProgress:H.event,sendRequest:(e,...t)=>{Ae(),Me();let i,a,s;if(n.string(e)){i=e;let n=t[0],c=t[t.length-1],l=0,u=r.ParameterStructures.auto;r.ParameterStructures.is(n)&&(l=1,u=n);let d=t.length;o.CancellationToken.is(c)&&(--d,s=c);let f=d-l;switch(f){case 0:a=void 0;break;case 1:a=Ie(u,t[l]);break;default:if(u===r.ParameterStructures.byName)throw Error(`Received ${f} parameters for 'by Name' request parameter structure.`);a=t.slice(l,d).map(e=>Ne(e))}}else{let n=t;i=e.method,a=Le(e,n);let r=e.numberOfParams;s=o.CancellationToken.is(n[r])?n[r]:void 0}let c=h++,l;s&&(l=s.onCancellationRequested(()=>{let e=U.sender.sendCancellation(Re,c);return e===void 0?(m.log(`Received no promise from cancellation strategy when cancelling id ${c}`),Promise.resolve()):e.catch(()=>{m.log(`Sending cancellation messages for id ${c} failed`)})}));let d={jsonrpc:`2.0`,id:c,method:i,params:a};return Ce(d),typeof U.sender.enableCancellation==`function`&&U.sender.enableCancellation(d),new Promise(async(e,t)=>{let n={method:i,timerStart:Date.now(),resolve:t=>{e(t),U.sender.cleanup(c),l?.dispose()},reject:e=>{t(e),U.sender.cleanup(c),l?.dispose()}};try{await u.write(d),P.set(c,n)}catch(e){throw m.error(`Sending request failed.`),n.reject(new r.ResponseError(r.ErrorCodes.MessageWriteError,e.message?e.message:`Unknown reason`)),e}})},onRequest:(e,t)=>{Ae();let r=null;return g.is(e)?(r=void 0,E=e):n.string(e)?(r=null,t!==void 0&&(r=e,D.set(e,{handler:t,type:void 0}))):t!==void 0&&(r=e.method,D.set(e.method,{type:e,handler:t})),{dispose:()=>{r!==null&&(r===void 0?E=void 0:D.delete(r))}}},hasPendingResponse:()=>P.size>0,trace:async(e,t,r)=>{let i=!1,a=y.Text;r!==void 0&&(n.boolean(r)?i=r:(i=r.sendNotification||!1,a=r.traceFormat||y.Text)),I=e,L=a,R=I===_.Off?void 0:t,i&&!ue()&&!G()&&await Re.sendNotification(b.type,{value:_.toString(e)})},onError:B.event,onClose:re.event,onUnhandledNotification:V.event,onDispose:ie.event,end:()=>{u.end()},dispose:()=>{if(G())return;z=j.Disposed,ie.fire(void 0);let e=new r.ResponseError(r.ErrorCodes.PendingResponseRejected,`Pending response rejected since connection got disposed`);for(let t of P.values())t.reject(e);P=/* @__PURE__ */ new Map,F=/* @__PURE__ */ new Map,ne=/* @__PURE__ */ new Set,N=new i.LinkedMap,n.func(u.dispose)&&u.dispose(),n.func(l.dispose)&&l.dispose()},listen:()=>{Ae(),je(),z=j.Listening,l.listen(_e)},inspect:()=>{(0,t.default)().console.log(`inspect`)}};return Re.onNotification(x.type,e=>{if(I===_.Off||!R)return;let t=I===_.Verbose||I===_.Compact;R.log(e.message,t?e.verbose:void 0)}),Re.onNotification(f.type,e=>{let t=te.get(e.token);t?t(e.value):H.fire(e)}),Re}})),S=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProgressType=e.ProgressToken=e.createMessageConnection=e.NullLogger=e.ConnectionOptions=e.ConnectionStrategy=e.AbstractMessageBuffer=e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=e.CancellationToken=e.CancellationTokenSource=e.Emitter=e.Event=e.Disposable=e.LRUCache=e.Touch=e.LinkedMap=e.ParameterStructures=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.ErrorCodes=e.ResponseError=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType0=e.RequestType=e.Message=e.RAL=void 0,e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=void 0;let t=u();Object.defineProperty(e,"Message",{enumerable:!0,get:function(){return t.Message}}),Object.defineProperty(e,"RequestType",{enumerable:!0,get:function(){return t.RequestType}}),Object.defineProperty(e,"RequestType0",{enumerable:!0,get:function(){return t.RequestType0}}),Object.defineProperty(e,"RequestType1",{enumerable:!0,get:function(){return t.RequestType1}}),Object.defineProperty(e,"RequestType2",{enumerable:!0,get:function(){return t.RequestType2}}),Object.defineProperty(e,"RequestType3",{enumerable:!0,get:function(){return t.RequestType3}}),Object.defineProperty(e,"RequestType4",{enumerable:!0,get:function(){return t.RequestType4}}),Object.defineProperty(e,"RequestType5",{enumerable:!0,get:function(){return t.RequestType5}}),Object.defineProperty(e,"RequestType6",{enumerable:!0,get:function(){return t.RequestType6}}),Object.defineProperty(e,"RequestType7",{enumerable:!0,get:function(){return t.RequestType7}}),Object.defineProperty(e,"RequestType8",{enumerable:!0,get:function(){return t.RequestType8}}),Object.defineProperty(e,"RequestType9",{enumerable:!0,get:function(){return t.RequestType9}}),Object.defineProperty(e,"ResponseError",{enumerable:!0,get:function(){return t.ResponseError}}),Object.defineProperty(e,"ErrorCodes",{enumerable:!0,get:function(){return t.ErrorCodes}}),Object.defineProperty(e,"NotificationType",{enumerable:!0,get:function(){return t.NotificationType}}),Object.defineProperty(e,"NotificationType0",{enumerable:!0,get:function(){return t.NotificationType0}}),Object.defineProperty(e,"NotificationType1",{enumerable:!0,get:function(){return t.NotificationType1}}),Object.defineProperty(e,"NotificationType2",{enumerable:!0,get:function(){return t.NotificationType2}}),Object.defineProperty(e,"NotificationType3",{enumerable:!0,get:function(){return t.NotificationType3}}),Object.defineProperty(e,"NotificationType4",{enumerable:!0,get:function(){return t.NotificationType4}}),Object.defineProperty(e,"NotificationType5",{enumerable:!0,get:function(){return t.NotificationType5}}),Object.defineProperty(e,"NotificationType6",{enumerable:!0,get:function(){return t.NotificationType6}}),Object.defineProperty(e,"NotificationType7",{enumerable:!0,get:function(){return t.NotificationType7}}),Object.defineProperty(e,"NotificationType8",{enumerable:!0,get:function(){return t.NotificationType8}}),Object.defineProperty(e,"NotificationType9",{enumerable:!0,get:function(){return t.NotificationType9}}),Object.defineProperty(e,"ParameterStructures",{enumerable:!0,get:function(){return t.ParameterStructures}});let n=d();Object.defineProperty(e,"LinkedMap",{enumerable:!0,get:function(){return n.LinkedMap}}),Object.defineProperty(e,"LRUCache",{enumerable:!0,get:function(){return n.LRUCache}}),Object.defineProperty(e,"Touch",{enumerable:!0,get:function(){return n.Touch}});let r=f();Object.defineProperty(e,"Disposable",{enumerable:!0,get:function(){return r.Disposable}});let i=m();Object.defineProperty(e,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(e,"Emitter",{enumerable:!0,get:function(){return i.Emitter}});let a=h();Object.defineProperty(e,"CancellationTokenSource",{enumerable:!0,get:function(){return a.CancellationTokenSource}}),Object.defineProperty(e,"CancellationToken",{enumerable:!0,get:function(){return a.CancellationToken}});let o=g();Object.defineProperty(e,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return o.SharedArraySenderStrategy}}),Object.defineProperty(e,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return o.SharedArrayReceiverStrategy}});let s=v();Object.defineProperty(e,"MessageReader",{enumerable:!0,get:function(){return s.MessageReader}}),Object.defineProperty(e,"AbstractMessageReader",{enumerable:!0,get:function(){return s.AbstractMessageReader}}),Object.defineProperty(e,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return s.ReadableStreamMessageReader}});let c=y();Object.defineProperty(e,"MessageWriter",{enumerable:!0,get:function(){return c.MessageWriter}}),Object.defineProperty(e,"AbstractMessageWriter",{enumerable:!0,get:function(){return c.AbstractMessageWriter}}),Object.defineProperty(e,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return c.WriteableStreamMessageWriter}});let l=b();Object.defineProperty(e,"AbstractMessageBuffer",{enumerable:!0,get:function(){return l.AbstractMessageBuffer}});let _=x();Object.defineProperty(e,"ConnectionStrategy",{enumerable:!0,get:function(){return _.ConnectionStrategy}}),Object.defineProperty(e,"ConnectionOptions",{enumerable:!0,get:function(){return _.ConnectionOptions}}),Object.defineProperty(e,"NullLogger",{enumerable:!0,get:function(){return _.NullLogger}}),Object.defineProperty(e,"createMessageConnection",{enumerable:!0,get:function(){return _.createMessageConnection}}),Object.defineProperty(e,"ProgressToken",{enumerable:!0,get:function(){return _.ProgressToken}}),Object.defineProperty(e,"ProgressType",{enumerable:!0,get:function(){return _.ProgressType}}),Object.defineProperty(e,"Trace",{enumerable:!0,get:function(){return _.Trace}}),Object.defineProperty(e,"TraceValues",{enumerable:!0,get:function(){return _.TraceValues}}),Object.defineProperty(e,"TraceFormat",{enumerable:!0,get:function(){return _.TraceFormat}}),Object.defineProperty(e,"SetTraceNotification",{enumerable:!0,get:function(){return _.SetTraceNotification}}),Object.defineProperty(e,"LogTraceNotification",{enumerable:!0,get:function(){return _.LogTraceNotification}}),Object.defineProperty(e,"ConnectionErrors",{enumerable:!0,get:function(){return _.ConnectionErrors}}),Object.defineProperty(e,"ConnectionError",{enumerable:!0,get:function(){return _.ConnectionError}}),Object.defineProperty(e,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return _.CancellationReceiverStrategy}}),Object.defineProperty(e,"CancellationSenderStrategy",{enumerable:!0,get:function(){return _.CancellationSenderStrategy}}),Object.defineProperty(e,"CancellationStrategy",{enumerable:!0,get:function(){return _.CancellationStrategy}}),Object.defineProperty(e,"MessageStrategy",{enumerable:!0,get:function(){return _.MessageStrategy}}),e.RAL=p().default})),C=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=S();var n=class e extends t.AbstractMessageBuffer{constructor(e=`utf-8`){super(e),this.asciiDecoder=new TextDecoder(`ascii`)}emptyBuffer(){return e.emptyBuffer}fromString(e,t){return new TextEncoder().encode(e)}toString(e,t){return t===`ascii`?this.asciiDecoder.decode(e):new TextDecoder(t).decode(e)}asNative(e,t){return t===void 0?e:e.slice(0,t)}allocNative(e){return new Uint8Array(e)}};n.emptyBuffer=/* @__PURE__ */ new Uint8Array;var r=class{constructor(e){this.socket=e,this._onData=new t.Emitter,this._messageListener=e=>{e.data.arrayBuffer().then(e=>{this._onData.fire(new Uint8Array(e))},()=>{(0,t.RAL)().console.error(`Converting blob to array buffer failed.`)})},this.socket.addEventListener(`message`,this._messageListener)}onClose(e){return this.socket.addEventListener(`close`,e),t.Disposable.create(()=>this.socket.removeEventListener(`close`,e))}onError(e){return this.socket.addEventListener(`error`,e),t.Disposable.create(()=>this.socket.removeEventListener(`error`,e))}onEnd(e){return this.socket.addEventListener(`end`,e),t.Disposable.create(()=>this.socket.removeEventListener(`end`,e))}onData(e){return this._onData.event(e)}},i=class{constructor(e){this.socket=e}onClose(e){return this.socket.addEventListener(`close`,e),t.Disposable.create(()=>this.socket.removeEventListener(`close`,e))}onError(e){return this.socket.addEventListener(`error`,e),t.Disposable.create(()=>this.socket.removeEventListener(`error`,e))}onEnd(e){return this.socket.addEventListener(`end`,e),t.Disposable.create(()=>this.socket.removeEventListener(`end`,e))}write(e,t){if(typeof e==`string`){if(t!==void 0&&t!==`utf-8`)throw Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${t}`);this.socket.send(e)}else this.socket.send(e);return Promise.resolve()}end(){this.socket.close()}};let a=new TextEncoder,o=Object.freeze({messageBuffer:Object.freeze({create:e=>new n(e)}),applicationJson:Object.freeze({encoder:Object.freeze({name:`application/json`,encode:(e,t)=>{if(t.charset!==`utf-8`)throw Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${t.charset}`);return Promise.resolve(a.encode(JSON.stringify(e,void 0,0)))}}),decoder:Object.freeze({name:`application/json`,decode:(e,t)=>{if(!(e instanceof Uint8Array))throw Error(`In a Browser environments only Uint8Arrays are supported.`);return Promise.resolve(JSON.parse(new TextDecoder(t.charset).decode(e)))}})}),stream:Object.freeze({asReadableStream:e=>new r(e),asWritableStream:e=>new i(e)}),console,timer:Object.freeze({setTimeout(e,t,...n){let r=setTimeout(e,t,...n);return{dispose:()=>clearTimeout(r)}},setImmediate(e,...t){let n=setTimeout(e,0,...t);return{dispose:()=>clearTimeout(n)}},setInterval(e,t,...n){let r=setInterval(e,t,...n);return{dispose:()=>clearInterval(r)}}})});function s(){return o}(function(e){e.install=function(){t.RAL.install(o)}})(s||={}),e.default=s})),w=/* @__PURE__ */ a(((e,t,n)=>{var r=n&&n.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),i=n&&n.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.BrowserMessageWriter=e.BrowserMessageReader=void 0,C().default.install();let a=S();i(S(),e),e.BrowserMessageReader=class extends a.AbstractMessageReader{constructor(e){super(),this._onData=new a.Emitter,this._messageListener=e=>{this._onData.fire(e.data)},e.addEventListener(`error`,e=>this.fireError(e)),e.onmessage=this._messageListener}listen(e){return this._onData.event(e)}},e.BrowserMessageWriter=class extends a.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.addEventListener(`error`,e=>this.fireError(e))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}},e.createMessageConnection=function(e,t,n,r){return n===void 0&&(n=a.NullLogger),a.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,a.createMessageConnection)(e,t,n,r)}})),T=/* @__PURE__ */ a(((e,t)=>{t.exports=w()})),E=/* @__PURE__ */ o({AnnotatedTextEdit:()=>ae,ChangeAnnotation:()=>ie,ChangeAnnotationIdentifier:()=>U,CodeAction:()=>Be,CodeActionContext:()=>ze,CodeActionKind:()=>Le,CodeActionTriggerKind:()=>Re,CodeDescription:()=>B,CodeLens:()=>Ve,Color:()=>N,ColorInformation:()=>P,ColorPresentation:()=>ne,Command:()=>V,CompletionItem:()=>we,CompletionItemKind:()=>ve,CompletionItemLabelDetails:()=>Ce,CompletionItemTag:()=>be,CompletionList:()=>Te,CreateFile:()=>se,DeleteFile:()=>W,Diagnostic:()=>re,DiagnosticRelatedInformation:()=>L,DiagnosticSeverity:()=>R,DiagnosticTag:()=>z,DocumentHighlight:()=>je,DocumentHighlightKind:()=>Ae,DocumentLink:()=>Ue,DocumentSymbol:()=>Ie,DocumentUri:()=>D,EOL:()=>ct,FoldingRange:()=>I,FoldingRangeKind:()=>F,FormattingOptions:()=>He,Hover:()=>De,InlayHint:()=>et,InlayHintKind:()=>Qe,InlayHintLabelPart:()=>$e,InlineCompletionContext:()=>ot,InlineCompletionItem:()=>nt,InlineCompletionList:()=>rt,InlineCompletionTriggerKind:()=>it,InlineValueContext:()=>Ze,InlineValueEvaluatableExpression:()=>Xe,InlineValueText:()=>Je,InlineValueVariableLookup:()=>Ye,InsertReplaceEdit:()=>xe,InsertTextFormat:()=>ye,InsertTextMode:()=>Se,Location:()=>te,LocationLink:()=>M,MarkedString:()=>Ee,MarkupContent:()=>_e,MarkupKind:()=>ge,OptionalVersionedTextDocumentIdentifier:()=>me,ParameterInformation:()=>Oe,Position:()=>A,Range:()=>j,RenameFile:()=>ce,SelectedCompletionInfo:()=>at,SelectionRange:()=>We,SemanticTokenModifiers:()=>Ke,SemanticTokenTypes:()=>Ge,SemanticTokens:()=>qe,SignatureInformation:()=>ke,StringValue:()=>tt,SymbolInformation:()=>Pe,SymbolKind:()=>Me,SymbolTag:()=>Ne,TextDocument:()=>lt,TextDocumentEdit:()=>oe,TextDocumentIdentifier:()=>fe,TextDocumentItem:()=>he,TextEdit:()=>H,URI:()=>O,VersionedTextDocumentIdentifier:()=>pe,WorkspaceChange:()=>de,WorkspaceEdit:()=>le,WorkspaceFolder:()=>st,WorkspaceSymbol:()=>Fe,integer:()=>k,uinteger:()=>ee}),D,O,k,ee,A,j,te,M,N,P,ne,F,I,L,R,z,B,re,V,H,ie,U,ae,oe,se,ce,W,le,ue,G,de,fe,pe,me,he,ge,_e,ve,ye,be,xe,Se,Ce,we,Te,Ee,De,Oe,ke,Ae,je,Me,Ne,Pe,Fe,Ie,Le,Re,ze,Be,Ve,He,Ue,We,Ge,Ke,qe,Je,Ye,Xe,Ze,Qe,$e,et,tt,nt,rt,it,at,ot,st,ct,lt,ut,K,dt=i((()=>{(function(e){e.is=function(e){return typeof e==`string`}})(D||={}),(function(e){e.is=function(e){return typeof e==`string`}})(O||={}),(function(e){e.MIN_VALUE=-0x80000000,e.MAX_VALUE=0x7fffffff,e.is=function(t){return typeof t==`number`&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}})(k||={}),(function(e){e.MIN_VALUE=0,e.MAX_VALUE=0x7fffffff,e.is=function(t){return typeof t==`number`&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}})(ee||={}),(function(e){e.create=function(e,t){return e===Number.MAX_VALUE&&(e=ee.MAX_VALUE),t===Number.MAX_VALUE&&(t=ee.MAX_VALUE),{line:e,character:t}},e.is=function(e){let t=e;return K.objectLiteral(t)&&K.uinteger(t.line)&&K.uinteger(t.character)}})(A||={}),(function(e){e.create=function(e,t,n,r){if(K.uinteger(e)&&K.uinteger(t)&&K.uinteger(n)&&K.uinteger(r))return{start:A.create(e,t),end:A.create(n,r)};if(A.is(e)&&A.is(t))return{start:e,end:t};throw Error(`Range#create called with invalid arguments[${e}, ${t}, ${n}, ${r}]`)},e.is=function(e){let t=e;return K.objectLiteral(t)&&A.is(t.start)&&A.is(t.end)}})(j||={}),(function(e){e.create=function(e,t){return{uri:e,range:t}},e.is=function(e){let t=e;return K.objectLiteral(t)&&j.is(t.range)&&(K.string(t.uri)||K.undefined(t.uri))}})(te||={}),(function(e){e.create=function(e,t,n,r){return{targetUri:e,targetRange:t,targetSelectionRange:n,originSelectionRange:r}},e.is=function(e){let t=e;return K.objectLiteral(t)&&j.is(t.targetRange)&&K.string(t.targetUri)&&j.is(t.targetSelectionRange)&&(j.is(t.originSelectionRange)||K.undefined(t.originSelectionRange))}})(M||={}),(function(e){e.create=function(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}},e.is=function(e){let t=e;return K.objectLiteral(t)&&K.numberRange(t.red,0,1)&&K.numberRange(t.green,0,1)&&K.numberRange(t.blue,0,1)&&K.numberRange(t.alpha,0,1)}})(N||={}),(function(e){e.create=function(e,t){return{range:e,color:t}},e.is=function(e){let t=e;return K.objectLiteral(t)&&j.is(t.range)&&N.is(t.color)}})(P||={}),(function(e){e.create=function(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}},e.is=function(e){let t=e;return K.objectLiteral(t)&&K.string(t.label)&&(K.undefined(t.textEdit)||H.is(t))&&(K.undefined(t.additionalTextEdits)||K.typedArray(t.additionalTextEdits,H.is))}})(ne||={}),(function(e){e.Comment=`comment`,e.Imports=`imports`,e.Region=`region`})(F||={}),(function(e){e.create=function(e,t,n,r,i,a){let o={startLine:e,endLine:t};return K.defined(n)&&(o.startCharacter=n),K.defined(r)&&(o.endCharacter=r),K.defined(i)&&(o.kind=i),K.defined(a)&&(o.collapsedText=a),o},e.is=function(e){let t=e;return K.objectLiteral(t)&&K.uinteger(t.startLine)&&K.uinteger(t.startLine)&&(K.undefined(t.startCharacter)||K.uinteger(t.startCharacter))&&(K.undefined(t.endCharacter)||K.uinteger(t.endCharacter))&&(K.undefined(t.kind)||K.string(t.kind))}})(I||={}),(function(e){e.create=function(e,t){return{location:e,message:t}},e.is=function(e){let t=e;return K.defined(t)&&te.is(t.location)&&K.string(t.message)}})(L||={}),(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(R||={}),(function(e){e.Unnecessary=1,e.Deprecated=2})(z||={}),(function(e){e.is=function(e){let t=e;return K.objectLiteral(t)&&K.string(t.href)}})(B||={}),(function(e){e.create=function(e,t,n,r,i,a){let o={range:e,message:t};return K.defined(n)&&(o.severity=n),K.defined(r)&&(o.code=r),K.defined(i)&&(o.source=i),K.defined(a)&&(o.relatedInformation=a),o},e.is=function(e){let t=e;return K.defined(t)&&j.is(t.range)&&K.string(t.message)&&(K.number(t.severity)||K.undefined(t.severity))&&(K.integer(t.code)||K.string(t.code)||K.undefined(t.code))&&(K.undefined(t.codeDescription)||K.string(t.codeDescription?.href))&&(K.string(t.source)||K.undefined(t.source))&&(K.undefined(t.relatedInformation)||K.typedArray(t.relatedInformation,L.is))}})(re||={}),(function(e){e.create=function(e,t,...n){let r={title:e,command:t};return K.defined(n)&&n.length>0&&(r.arguments=n),r},e.is=function(e){let t=e;return K.defined(t)&&K.string(t.title)&&K.string(t.command)}})(V||={}),(function(e){e.replace=function(e,t){return{range:e,newText:t}},e.insert=function(e,t){return{range:{start:e,end:e},newText:t}},e.del=function(e){return{range:e,newText:``}},e.is=function(e){let t=e;return K.objectLiteral(t)&&K.string(t.newText)&&j.is(t.range)}})(H||={}),(function(e){e.create=function(e,t,n){let r={label:e};return t!==void 0&&(r.needsConfirmation=t),n!==void 0&&(r.description=n),r},e.is=function(e){let t=e;return K.objectLiteral(t)&&K.string(t.label)&&(K.boolean(t.needsConfirmation)||t.needsConfirmation===void 0)&&(K.string(t.description)||t.description===void 0)}})(ie||={}),(function(e){e.is=function(e){let t=e;return K.string(t)}})(U||={}),(function(e){e.replace=function(e,t,n){return{range:e,newText:t,annotationId:n}},e.insert=function(e,t,n){return{range:{start:e,end:e},newText:t,annotationId:n}},e.del=function(e,t){return{range:e,newText:``,annotationId:t}},e.is=function(e){let t=e;return H.is(t)&&(ie.is(t.annotationId)||U.is(t.annotationId))}})(ae||={}),(function(e){e.create=function(e,t){return{textDocument:e,edits:t}},e.is=function(e){let t=e;return K.defined(t)&&me.is(t.textDocument)&&Array.isArray(t.edits)}})(oe||={}),(function(e){e.create=function(e,t,n){let r={kind:`create`,uri:e};return t!==void 0&&(t.overwrite!==void 0||t.ignoreIfExists!==void 0)&&(r.options=t),n!==void 0&&(r.annotationId=n),r},e.is=function(e){let t=e;return t&&t.kind===`create`&&K.string(t.uri)&&(t.options===void 0||(t.options.overwrite===void 0||K.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||K.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||U.is(t.annotationId))}})(se||={}),(function(e){e.create=function(e,t,n,r){let i={kind:`rename`,oldUri:e,newUri:t};return n!==void 0&&(n.overwrite!==void 0||n.ignoreIfExists!==void 0)&&(i.options=n),r!==void 0&&(i.annotationId=r),i},e.is=function(e){let t=e;return t&&t.kind===`rename`&&K.string(t.oldUri)&&K.string(t.newUri)&&(t.options===void 0||(t.options.overwrite===void 0||K.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||K.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||U.is(t.annotationId))}})(ce||={}),(function(e){e.create=function(e,t,n){let r={kind:`delete`,uri:e};return t!==void 0&&(t.recursive!==void 0||t.ignoreIfNotExists!==void 0)&&(r.options=t),n!==void 0&&(r.annotationId=n),r},e.is=function(e){let t=e;return t&&t.kind===`delete`&&K.string(t.uri)&&(t.options===void 0||(t.options.recursive===void 0||K.boolean(t.options.recursive))&&(t.options.ignoreIfNotExists===void 0||K.boolean(t.options.ignoreIfNotExists)))&&(t.annotationId===void 0||U.is(t.annotationId))}})(W||={}),(function(e){e.is=function(e){let t=e;return t&&(t.changes!==void 0||t.documentChanges!==void 0)&&(t.documentChanges===void 0||t.documentChanges.every(e=>K.string(e.kind)?se.is(e)||ce.is(e)||W.is(e):oe.is(e)))}})(le||={}),ue=class{constructor(e,t){this.edits=e,this.changeAnnotations=t}insert(e,t,n){let r,i;if(n===void 0?r=H.insert(e,t):U.is(n)?(i=n,r=ae.insert(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=ae.insert(e,t,i)),this.edits.push(r),i!==void 0)return i}replace(e,t,n){let r,i;if(n===void 0?r=H.replace(e,t):U.is(n)?(i=n,r=ae.replace(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=ae.replace(e,t,i)),this.edits.push(r),i!==void 0)return i}delete(e,t){let n,r;if(t===void 0?n=H.del(e):U.is(t)?(r=t,n=ae.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),r=this.changeAnnotations.manage(t),n=ae.del(e,r)),this.edits.push(n),r!==void 0)return r}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw Error(`Text edit change is not configured to manage change annotations.`)}},G=class{constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,t){let n;if(U.is(e)?n=e:(n=this.nextId(),t=e),this._annotations[n]!==void 0)throw Error(`Id ${n} is already in use.`);if(t===void 0)throw Error(`No annotation provided for id ${n}`);return this._annotations[n]=t,this._size++,n}nextId(){return this._counter++,this._counter.toString()}},de=class{constructor(e){this._textEditChanges=Object.create(null),e===void 0?this._workspaceEdit={}:(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new G(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(e=>{if(oe.is(e)){let t=new ue(e.edits,this._changeAnnotations);this._textEditChanges[e.textDocument.uri]=t}})):e.changes&&Object.keys(e.changes).forEach(t=>{let n=new ue(e.changes[t]);this._textEditChanges[t]=n}))}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(me.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw Error(`Workspace edit is not configured for document changes.`);let t={uri:e.uri,version:e.version},n=this._textEditChanges[t.uri];if(!n){let e=[],r={textDocument:t,edits:e};this._workspaceEdit.documentChanges.push(r),n=new ue(e,this._changeAnnotations),this._textEditChanges[t.uri]=n}return n}{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw Error(`Workspace edit is not configured for normal text edit changes.`);let t=this._textEditChanges[e];if(!t){let n=[];this._workspaceEdit.changes[e]=n,t=new ue(n),this._textEditChanges[e]=t}return t}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new G,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,t,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw Error(`Workspace edit is not configured for document changes.`);let r;ie.is(t)||U.is(t)?r=t:n=t;let i,a;if(r===void 0?i=se.create(e,n):(a=U.is(r)?r:this._changeAnnotations.manage(r),i=se.create(e,n,a)),this._workspaceEdit.documentChanges.push(i),a!==void 0)return a}renameFile(e,t,n,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw Error(`Workspace edit is not configured for document changes.`);let i;ie.is(n)||U.is(n)?i=n:r=n;let a,o;if(i===void 0?a=ce.create(e,t,r):(o=U.is(i)?i:this._changeAnnotations.manage(i),a=ce.create(e,t,r,o)),this._workspaceEdit.documentChanges.push(a),o!==void 0)return o}deleteFile(e,t,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw Error(`Workspace edit is not configured for document changes.`);let r;ie.is(t)||U.is(t)?r=t:n=t;let i,a;if(r===void 0?i=W.create(e,n):(a=U.is(r)?r:this._changeAnnotations.manage(r),i=W.create(e,n,a)),this._workspaceEdit.documentChanges.push(i),a!==void 0)return a}},(function(e){e.create=function(e){return{uri:e}},e.is=function(e){let t=e;return K.defined(t)&&K.string(t.uri)}})(fe||={}),(function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){let t=e;return K.defined(t)&&K.string(t.uri)&&K.integer(t.version)}})(pe||={}),(function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){let t=e;return K.defined(t)&&K.string(t.uri)&&(t.version===null||K.integer(t.version))}})(me||={}),(function(e){e.create=function(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}},e.is=function(e){let t=e;return K.defined(t)&&K.string(t.uri)&&K.string(t.languageId)&&K.integer(t.version)&&K.string(t.text)}})(he||={}),(function(e){e.PlainText=`plaintext`,e.Markdown=`markdown`,e.is=function(t){let n=t;return n===e.PlainText||n===e.Markdown}})(ge||={}),(function(e){e.is=function(e){let t=e;return K.objectLiteral(e)&&ge.is(t.kind)&&K.string(t.value)}})(_e||={}),(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(ve||={}),(function(e){e.PlainText=1,e.Snippet=2})(ye||={}),(function(e){e.Deprecated=1})(be||={}),(function(e){e.create=function(e,t,n){return{newText:e,insert:t,replace:n}},e.is=function(e){let t=e;return t&&K.string(t.newText)&&j.is(t.insert)&&j.is(t.replace)}})(xe||={}),(function(e){e.asIs=1,e.adjustIndentation=2})(Se||={}),(function(e){e.is=function(e){let t=e;return t&&(K.string(t.detail)||t.detail===void 0)&&(K.string(t.description)||t.description===void 0)}})(Ce||={}),(function(e){e.create=function(e){return{label:e}}})(we||={}),(function(e){e.create=function(e,t){return{items:e||[],isIncomplete:!!t}}})(Te||={}),(function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,`\\$&`)},e.is=function(e){let t=e;return K.string(t)||K.objectLiteral(t)&&K.string(t.language)&&K.string(t.value)}})(Ee||={}),(function(e){e.is=function(e){let t=e;return!!t&&K.objectLiteral(t)&&(_e.is(t.contents)||Ee.is(t.contents)||K.typedArray(t.contents,Ee.is))&&(e.range===void 0||j.is(e.range))}})(De||={}),(function(e){e.create=function(e,t){return t?{label:e,documentation:t}:{label:e}}})(Oe||={}),(function(e){e.create=function(e,t,...n){let r={label:e};return K.defined(t)&&(r.documentation=t),r.parameters=K.defined(n)?n:[],r}})(ke||={}),(function(e){e.Text=1,e.Read=2,e.Write=3})(Ae||={}),(function(e){e.create=function(e,t){let n={range:e};return K.number(t)&&(n.kind=t),n}})(je||={}),(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(Me||={}),(function(e){e.Deprecated=1})(Ne||={}),(function(e){e.create=function(e,t,n,r,i){let a={name:e,kind:t,location:{uri:r,range:n}};return i&&(a.containerName=i),a}})(Pe||={}),(function(e){e.create=function(e,t,n,r){return r===void 0?{name:e,kind:t,location:{uri:n}}:{name:e,kind:t,location:{uri:n,range:r}}}})(Fe||={}),(function(e){e.create=function(e,t,n,r,i,a){let o={name:e,detail:t,kind:n,range:r,selectionRange:i};return a!==void 0&&(o.children=a),o},e.is=function(e){let t=e;return t&&K.string(t.name)&&K.number(t.kind)&&j.is(t.range)&&j.is(t.selectionRange)&&(t.detail===void 0||K.string(t.detail))&&(t.deprecated===void 0||K.boolean(t.deprecated))&&(t.children===void 0||Array.isArray(t.children))&&(t.tags===void 0||Array.isArray(t.tags))}})(Ie||={}),(function(e){e.Empty=``,e.QuickFix=`quickfix`,e.Refactor=`refactor`,e.RefactorExtract=`refactor.extract`,e.RefactorInline=`refactor.inline`,e.RefactorRewrite=`refactor.rewrite`,e.Source=`source`,e.SourceOrganizeImports=`source.organizeImports`,e.SourceFixAll=`source.fixAll`})(Le||={}),(function(e){e.Invoked=1,e.Automatic=2})(Re||={}),(function(e){e.create=function(e,t,n){let r={diagnostics:e};return t!=null&&(r.only=t),n!=null&&(r.triggerKind=n),r},e.is=function(e){let t=e;return K.defined(t)&&K.typedArray(t.diagnostics,re.is)&&(t.only===void 0||K.typedArray(t.only,K.string))&&(t.triggerKind===void 0||t.triggerKind===Re.Invoked||t.triggerKind===Re.Automatic)}})(ze||={}),(function(e){e.create=function(e,t,n){let r={title:e},i=!0;return typeof t==`string`?(i=!1,r.kind=t):V.is(t)?r.command=t:r.edit=t,i&&n!==void 0&&(r.kind=n),r},e.is=function(e){let t=e;return t&&K.string(t.title)&&(t.diagnostics===void 0||K.typedArray(t.diagnostics,re.is))&&(t.kind===void 0||K.string(t.kind))&&(t.edit!==void 0||t.command!==void 0)&&(t.command===void 0||V.is(t.command))&&(t.isPreferred===void 0||K.boolean(t.isPreferred))&&(t.edit===void 0||le.is(t.edit))}})(Be||={}),(function(e){e.create=function(e,t){let n={range:e};return K.defined(t)&&(n.data=t),n},e.is=function(e){let t=e;return K.defined(t)&&j.is(t.range)&&(K.undefined(t.command)||V.is(t.command))}})(Ve||={}),(function(e){e.create=function(e,t){return{tabSize:e,insertSpaces:t}},e.is=function(e){let t=e;return K.defined(t)&&K.uinteger(t.tabSize)&&K.boolean(t.insertSpaces)}})(He||={}),(function(e){e.create=function(e,t,n){return{range:e,target:t,data:n}},e.is=function(e){let t=e;return K.defined(t)&&j.is(t.range)&&(K.undefined(t.target)||K.string(t.target))}})(Ue||={}),(function(e){e.create=function(e,t){return{range:e,parent:t}},e.is=function(t){let n=t;return K.objectLiteral(n)&&j.is(n.range)&&(n.parent===void 0||e.is(n.parent))}})(We||={}),(function(e){e.namespace=`namespace`,e.type=`type`,e.class=`class`,e.enum=`enum`,e.interface=`interface`,e.struct=`struct`,e.typeParameter=`typeParameter`,e.parameter=`parameter`,e.variable=`variable`,e.property=`property`,e.enumMember=`enumMember`,e.event=`event`,e.function=`function`,e.method=`method`,e.macro=`macro`,e.keyword=`keyword`,e.modifier=`modifier`,e.comment=`comment`,e.string=`string`,e.number=`number`,e.regexp=`regexp`,e.operator=`operator`,e.decorator=`decorator`})(Ge||={}),(function(e){e.declaration=`declaration`,e.definition=`definition`,e.readonly=`readonly`,e.static=`static`,e.deprecated=`deprecated`,e.abstract=`abstract`,e.async=`async`,e.modification=`modification`,e.documentation=`documentation`,e.defaultLibrary=`defaultLibrary`})(Ke||={}),(function(e){e.is=function(e){let t=e;return K.objectLiteral(t)&&(t.resultId===void 0||typeof t.resultId==`string`)&&Array.isArray(t.data)&&(t.data.length===0||typeof t.data[0]==`number`)}})(qe||={}),(function(e){e.create=function(e,t){return{range:e,text:t}},e.is=function(e){let t=e;return t!=null&&j.is(t.range)&&K.string(t.text)}})(Je||={}),(function(e){e.create=function(e,t,n){return{range:e,variableName:t,caseSensitiveLookup:n}},e.is=function(e){let t=e;return t!=null&&j.is(t.range)&&K.boolean(t.caseSensitiveLookup)&&(K.string(t.variableName)||t.variableName===void 0)}})(Ye||={}),(function(e){e.create=function(e,t){return{range:e,expression:t}},e.is=function(e){let t=e;return t!=null&&j.is(t.range)&&(K.string(t.expression)||t.expression===void 0)}})(Xe||={}),(function(e){e.create=function(e,t){return{frameId:e,stoppedLocation:t}},e.is=function(e){let t=e;return K.defined(t)&&j.is(e.stoppedLocation)}})(Ze||={}),(function(e){e.Type=1,e.Parameter=2,e.is=function(e){return e===1||e===2}})(Qe||={}),(function(e){e.create=function(e){return{value:e}},e.is=function(e){let t=e;return K.objectLiteral(t)&&(t.tooltip===void 0||K.string(t.tooltip)||_e.is(t.tooltip))&&(t.location===void 0||te.is(t.location))&&(t.command===void 0||V.is(t.command))}})($e||={}),(function(e){e.create=function(e,t,n){let r={position:e,label:t};return n!==void 0&&(r.kind=n),r},e.is=function(e){let t=e;return K.objectLiteral(t)&&A.is(t.position)&&(K.string(t.label)||K.typedArray(t.label,$e.is))&&(t.kind===void 0||Qe.is(t.kind))&&t.textEdits===void 0||K.typedArray(t.textEdits,H.is)&&(t.tooltip===void 0||K.string(t.tooltip)||_e.is(t.tooltip))&&(t.paddingLeft===void 0||K.boolean(t.paddingLeft))&&(t.paddingRight===void 0||K.boolean(t.paddingRight))}})(et||={}),(function(e){e.createSnippet=function(e){return{kind:`snippet`,value:e}}})(tt||={}),(function(e){e.create=function(e,t,n,r){return{insertText:e,filterText:t,range:n,command:r}}})(nt||={}),(function(e){e.create=function(e){return{items:e}}})(rt||={}),(function(e){e.Invoked=0,e.Automatic=1})(it||={}),(function(e){e.create=function(e,t){return{range:e,text:t}}})(at||={}),(function(e){e.create=function(e,t){return{triggerKind:e,selectedCompletionInfo:t}}})(ot||={}),(function(e){e.is=function(e){let t=e;return K.objectLiteral(t)&&O.is(t.uri)&&K.string(t.name)}})(st||={}),ct=[`
13
+ `,`\r
14
+ `,`\r`],(function(e){e.create=function(e,t,n,r){return new ut(e,t,n,r)},e.is=function(e){let t=e;return!!(K.defined(t)&&K.string(t.uri)&&(K.undefined(t.languageId)||K.string(t.languageId))&&K.uinteger(t.lineCount)&&K.func(t.getText)&&K.func(t.positionAt)&&K.func(t.offsetAt))},e.applyEdits=function(e,n){let r=e.getText(),i=t(n,(e,t)=>{let n=e.range.start.line-t.range.start.line;return n===0?e.range.start.character-t.range.start.character:n}),a=r.length;for(let t=i.length-1;t>=0;t--){let n=i[t],o=e.offsetAt(n.range.start),s=e.offsetAt(n.range.end);if(s<=a)r=r.substring(0,o)+n.newText+r.substring(s,r.length);else throw Error(`Overlapping edit`);a=o}return r};function t(e,n){if(e.length<=1)return e;let r=e.length/2|0,i=e.slice(0,r),a=e.slice(r);t(i,n),t(a,n);let o=0,s=0,c=0;for(;o<i.length&&s<a.length;)n(i[o],a[s])<=0?e[c++]=i[o++]:e[c++]=a[s++];for(;o<i.length;)e[c++]=i[o++];for(;s<a.length;)e[c++]=a[s++];return e}})(lt||={}),ut=class{constructor(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],t=this._content,n=!0;for(let r=0;r<t.length;r++){n&&=(e.push(r),!1);let i=t.charAt(r);n=i===`\r`||i===`
15
+ `,i===`\r`&&r+1<t.length&&t.charAt(r+1)===`
16
+ `&&r++}n&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),n=0,r=t.length;if(r===0)return A.create(0,e);for(;n<r;){let i=Math.floor((n+r)/2);t[i]>e?r=i:n=i+1}let i=n-1;return A.create(i,e-t[i])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let n=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,r),n)}get lineCount(){return this.getLineOffsets().length}},(function(e){let t=Object.prototype.toString;e.defined=function(e){return e!==void 0},e.undefined=function(e){return e===void 0},e.boolean=function(e){return e===!0||e===!1},e.string=function(e){return t.call(e)===`[object String]`},e.number=function(e){return t.call(e)===`[object Number]`},e.numberRange=function(e,n,r){return t.call(e)===`[object Number]`&&n<=e&&e<=r},e.integer=function(e){return t.call(e)===`[object Number]`&&-0x80000000<=e&&e<=0x7fffffff},e.uinteger=function(e){return t.call(e)===`[object Number]`&&0<=e&&e<=0x7fffffff},e.func=function(e){return t.call(e)===`[object Function]`},e.objectLiteral=function(e){return typeof e==`object`&&!!e},e.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)}})(K||={})})),q=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProtocolNotificationType=e.ProtocolNotificationType0=e.ProtocolRequestType=e.ProtocolRequestType0=e.RegistrationType=e.MessageDirection=void 0;let t=w();var n;(function(e){e.clientToServer=`clientToServer`,e.serverToClient=`serverToClient`,e.both=`both`})(n||(e.MessageDirection=n={})),e.RegistrationType=class{constructor(e){this.method=e}},e.ProtocolRequestType0=class extends t.RequestType0{constructor(e){super(e)}},e.ProtocolRequestType=class extends t.RequestType{constructor(e){super(e,t.ParameterStructures.byName)}},e.ProtocolNotificationType0=class extends t.NotificationType0{constructor(e){super(e)}},e.ProtocolNotificationType=class extends t.NotificationType{constructor(e){super(e,t.ParameterStructures.byName)}}})),ft=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.objectLiteral=e.typedArray=e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0,e.boolean=function(e){return e===!0||e===!1};function t(e){return typeof e==`string`||e instanceof String}e.string=t,e.number=function(e){return typeof e==`number`||e instanceof Number},e.error=function(e){return e instanceof Error},e.func=function(e){return typeof e==`function`};function n(e){return Array.isArray(e)}e.array=n,e.stringArray=function(e){return n(e)&&e.every(e=>t(e))},e.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)},e.objectLiteral=function(e){return typeof e==`object`&&!!e}})),pt=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ImplementationRequest=void 0;let t=q();var n;(function(e){e.method=`textDocument/implementation`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.ImplementationRequest=n={}))})),mt=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeDefinitionRequest=void 0;let t=q();var n;(function(e){e.method=`textDocument/typeDefinition`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.TypeDefinitionRequest=n={}))})),ht=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=void 0;let t=q();var n;(function(e){e.method=`workspace/workspaceFolders`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method)})(n||(e.WorkspaceFoldersRequest=n={}));var r;(function(e){e.method=`workspace/didChangeWorkspaceFolders`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(r||(e.DidChangeWorkspaceFoldersNotification=r={}))})),gt=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigurationRequest=void 0;let t=q();var n;(function(e){e.method=`workspace/configuration`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(e.method)})(n||(e.ConfigurationRequest=n={}))})),_t=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ColorPresentationRequest=e.DocumentColorRequest=void 0;let t=q();var n;(function(e){e.method=`textDocument/documentColor`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.DocumentColorRequest=n={}));var r;(function(e){e.method=`textDocument/colorPresentation`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(r||(e.ColorPresentationRequest=r={}))})),vt=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=void 0;let t=q();var n;(function(e){e.method=`textDocument/foldingRange`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.FoldingRangeRequest=n={}));var r;(function(e){e.method=`workspace/foldingRange/refresh`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method)})(r||(e.FoldingRangeRefreshRequest=r={}))})),yt=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DeclarationRequest=void 0;let t=q();var n;(function(e){e.method=`textDocument/declaration`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.DeclarationRequest=n={}))})),bt=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionRangeRequest=void 0;let t=q();var n;(function(e){e.method=`textDocument/selectionRange`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.SelectionRangeRequest=n={}))})),xt=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=void 0;let t=w(),n=q();var r;(function(e){e.type=new t.ProgressType,e.is=function(t){return t===e.type}})(r||(e.WorkDoneProgress=r={}));var i;(function(e){e.method=`window/workDoneProgress/create`,e.messageDirection=n.MessageDirection.serverToClient,e.type=new n.ProtocolRequestType(e.method)})(i||(e.WorkDoneProgressCreateRequest=i={}));var a;(function(e){e.method=`window/workDoneProgress/cancel`,e.messageDirection=n.MessageDirection.clientToServer,e.type=new n.ProtocolNotificationType(e.method)})(a||(e.WorkDoneProgressCancelNotification=a={}))})),St=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.CallHierarchyPrepareRequest=void 0;let t=q();var n;(function(e){e.method=`textDocument/prepareCallHierarchy`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.CallHierarchyPrepareRequest=n={}));var r;(function(e){e.method=`callHierarchy/incomingCalls`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(r||(e.CallHierarchyIncomingCallsRequest=r={}));var i;(function(e){e.method=`callHierarchy/outgoingCalls`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(i||(e.CallHierarchyOutgoingCallsRequest=i={}))})),Ct=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.SemanticTokensRegistrationType=e.TokenFormat=void 0;let t=q();var n;(function(e){e.Relative=`relative`})(n||(e.TokenFormat=n={}));var r;(function(e){e.method=`textDocument/semanticTokens`,e.type=new t.RegistrationType(e.method)})(r||(e.SemanticTokensRegistrationType=r={}));var i;(function(e){e.method=`textDocument/semanticTokens/full`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.registrationMethod=r.method})(i||(e.SemanticTokensRequest=i={}));var a;(function(e){e.method=`textDocument/semanticTokens/full/delta`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.registrationMethod=r.method})(a||(e.SemanticTokensDeltaRequest=a={}));var o;(function(e){e.method=`textDocument/semanticTokens/range`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.registrationMethod=r.method})(o||(e.SemanticTokensRangeRequest=o={}));var s;(function(e){e.method=`workspace/semanticTokens/refresh`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method)})(s||(e.SemanticTokensRefreshRequest=s={}))})),wt=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShowDocumentRequest=void 0;let t=q();var n;(function(e){e.method=`window/showDocument`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(e.method)})(n||(e.ShowDocumentRequest=n={}))})),Tt=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LinkedEditingRangeRequest=void 0;let t=q();var n;(function(e){e.method=`textDocument/linkedEditingRange`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.LinkedEditingRangeRequest=n={}))})),Et=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.DidRenameFilesNotification=e.WillRenameFilesRequest=e.DidCreateFilesNotification=e.WillCreateFilesRequest=e.FileOperationPatternKind=void 0;let t=q();var n;(function(e){e.file=`file`,e.folder=`folder`})(n||(e.FileOperationPatternKind=n={}));var r;(function(e){e.method=`workspace/willCreateFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(r||(e.WillCreateFilesRequest=r={}));var i;(function(e){e.method=`workspace/didCreateFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(i||(e.DidCreateFilesNotification=i={}));var a;(function(e){e.method=`workspace/willRenameFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(a||(e.WillRenameFilesRequest=a={}));var o;(function(e){e.method=`workspace/didRenameFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(o||(e.DidRenameFilesNotification=o={}));var s;(function(e){e.method=`workspace/didDeleteFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(s||(e.DidDeleteFilesNotification=s={}));var c;(function(e){e.method=`workspace/willDeleteFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(c||(e.WillDeleteFilesRequest=c={}))})),Dt=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=void 0;let t=q();var n;(function(e){e.document=`document`,e.project=`project`,e.group=`group`,e.scheme=`scheme`,e.global=`global`})(n||(e.UniquenessLevel=n={}));var r;(function(e){e.$import=`import`,e.$export=`export`,e.local=`local`})(r||(e.MonikerKind=r={}));var i;(function(e){e.method=`textDocument/moniker`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(i||(e.MonikerRequest=i={}))})),Ot=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHierarchySubtypesRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchyPrepareRequest=void 0;let t=q();var n;(function(e){e.method=`textDocument/prepareTypeHierarchy`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.TypeHierarchyPrepareRequest=n={}));var r;(function(e){e.method=`typeHierarchy/supertypes`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(r||(e.TypeHierarchySupertypesRequest=r={}));var i;(function(e){e.method=`typeHierarchy/subtypes`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(i||(e.TypeHierarchySubtypesRequest=i={}))})),kt=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlineValueRefreshRequest=e.InlineValueRequest=void 0;let t=q();var n;(function(e){e.method=`textDocument/inlineValue`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.InlineValueRequest=n={}));var r;(function(e){e.method=`workspace/inlineValue/refresh`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method)})(r||(e.InlineValueRefreshRequest=r={}))})),At=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=void 0;let t=q();var n;(function(e){e.method=`textDocument/inlayHint`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.InlayHintRequest=n={}));var r;(function(e){e.method=`inlayHint/resolve`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(r||(e.InlayHintResolveRequest=r={}));var i;(function(e){e.method=`workspace/inlayHint/refresh`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method)})(i||(e.InlayHintRefreshRequest=i={}))})),jt=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=void 0;let t=w(),n=ft(),r=q();var i;(function(e){e.is=function(e){let t=e;return t&&n.boolean(t.retriggerRequest)}})(i||(e.DiagnosticServerCancellationData=i={}));var a;(function(e){e.Full=`full`,e.Unchanged=`unchanged`})(a||(e.DocumentDiagnosticReportKind=a={}));var o;(function(e){e.method=`textDocument/diagnostic`,e.messageDirection=r.MessageDirection.clientToServer,e.type=new r.ProtocolRequestType(e.method),e.partialResult=new t.ProgressType})(o||(e.DocumentDiagnosticRequest=o={}));var s;(function(e){e.method=`workspace/diagnostic`,e.messageDirection=r.MessageDirection.clientToServer,e.type=new r.ProtocolRequestType(e.method),e.partialResult=new t.ProgressType})(s||(e.WorkspaceDiagnosticRequest=s={}));var c;(function(e){e.method=`workspace/diagnostic/refresh`,e.messageDirection=r.MessageDirection.serverToClient,e.type=new r.ProtocolRequestType0(e.method)})(c||(e.DiagnosticRefreshRequest=c={}))})),Mt=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=void 0;let t=(dt(),c(E)),n=ft(),r=q();var i;(function(e){e.Markup=1,e.Code=2,e.is=function(e){return e===1||e===2}})(i||(e.NotebookCellKind=i={}));var a;(function(e){e.create=function(e,t){let n={executionOrder:e};return(t===!0||t===!1)&&(n.success=t),n},e.is=function(e){let r=e;return n.objectLiteral(r)&&t.uinteger.is(r.executionOrder)&&(r.success===void 0||n.boolean(r.success))},e.equals=function(e,t){return e===t?!0:e==null||t==null?!1:e.executionOrder===t.executionOrder&&e.success===t.success}})(a||(e.ExecutionSummary=a={}));var o;(function(e){e.create=function(e,t){return{kind:e,document:t}},e.is=function(e){let r=e;return n.objectLiteral(r)&&i.is(r.kind)&&t.DocumentUri.is(r.document)&&(r.metadata===void 0||n.objectLiteral(r.metadata))},e.diff=function(e,t){let n=/* @__PURE__ */ new Set;return e.document!==t.document&&n.add(`document`),e.kind!==t.kind&&n.add(`kind`),e.executionSummary!==t.executionSummary&&n.add(`executionSummary`),e.metadata===void 0&&t.metadata===void 0||r(e.metadata,t.metadata)||n.add(`metadata`),e.executionSummary===void 0&&t.executionSummary===void 0||a.equals(e.executionSummary,t.executionSummary)||n.add(`executionSummary`),n};function r(e,t){if(e===t)return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!=`object`)return!1;let i=Array.isArray(e),a=Array.isArray(t);if(i!==a)return!1;if(i&&a){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!r(e[n],t[n]))return!1}if(n.objectLiteral(e)&&n.objectLiteral(t)){let n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length||(n.sort(),i.sort(),!r(n,i)))return!1;for(let i=0;i<n.length;i++){let a=n[i];if(!r(e[a],t[a]))return!1}}return!0}})(o||(e.NotebookCell=o={}));var s;(function(e){e.create=function(e,t,n,r){return{uri:e,notebookType:t,version:n,cells:r}},e.is=function(e){let r=e;return n.objectLiteral(r)&&n.string(r.uri)&&t.integer.is(r.version)&&n.typedArray(r.cells,o.is)}})(s||(e.NotebookDocument=s={}));var l;(function(e){e.method=`notebookDocument/sync`,e.messageDirection=r.MessageDirection.clientToServer,e.type=new r.RegistrationType(e.method)})(l||(e.NotebookDocumentSyncRegistrationType=l={}));var u;(function(e){e.method=`notebookDocument/didOpen`,e.messageDirection=r.MessageDirection.clientToServer,e.type=new r.ProtocolNotificationType(e.method),e.registrationMethod=l.method})(u||(e.DidOpenNotebookDocumentNotification=u={}));var d;(function(e){e.is=function(e){let r=e;return n.objectLiteral(r)&&t.uinteger.is(r.start)&&t.uinteger.is(r.deleteCount)&&(r.cells===void 0||n.typedArray(r.cells,o.is))},e.create=function(e,t,n){let r={start:e,deleteCount:t};return n!==void 0&&(r.cells=n),r}})(d||(e.NotebookCellArrayChange=d={}));var f;(function(e){e.method=`notebookDocument/didChange`,e.messageDirection=r.MessageDirection.clientToServer,e.type=new r.ProtocolNotificationType(e.method),e.registrationMethod=l.method})(f||(e.DidChangeNotebookDocumentNotification=f={}));var p;(function(e){e.method=`notebookDocument/didSave`,e.messageDirection=r.MessageDirection.clientToServer,e.type=new r.ProtocolNotificationType(e.method),e.registrationMethod=l.method})(p||(e.DidSaveNotebookDocumentNotification=p={}));var m;(function(e){e.method=`notebookDocument/didClose`,e.messageDirection=r.MessageDirection.clientToServer,e.type=new r.ProtocolNotificationType(e.method),e.registrationMethod=l.method})(m||(e.DidCloseNotebookDocumentNotification=m={}))})),Nt=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlineCompletionRequest=void 0;let t=q();var n;(function(e){e.method=`textDocument/inlineCompletion`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.InlineCompletionRequest=n={}))})),Pt=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),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.RelativePattern=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.InitializeErrorCodes=e.InitializeRequest=e.WorkDoneProgressOptions=e.TextDocumentRegistrationOptions=e.StaticRegistrationOptions=e.PositionEncodingKind=e.FailureHandlingKind=e.ResourceOperationKind=e.UnregistrationRequest=e.RegistrationRequest=e.DocumentSelector=e.NotebookCellTextDocumentFilter=e.NotebookDocumentFilter=e.TextDocumentFilter=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.CallHierarchyPrepareRequest=e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=e.SelectionRangeRequest=e.DeclarationRequest=e.FoldingRangeRefreshRequest=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.DocumentRangesFormattingRequest=e.DocumentRangeFormattingRequest=e.DocumentFormattingRequest=e.DocumentLinkResolveRequest=e.DocumentLinkRequest=e.CodeLensRefreshRequest=e.CodeLensResolveRequest=e.CodeLensRequest=e.WorkspaceSymbolResolveRequest=void 0,e.InlineCompletionRequest=e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=e.InlineValueRefreshRequest=e.InlineValueRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchySubtypesRequest=e.TypeHierarchyPrepareRequest=void 0;let t=q(),n=(dt(),c(E)),r=ft(),i=pt();Object.defineProperty(e,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});let a=mt();Object.defineProperty(e,"TypeDefinitionRequest",{enumerable:!0,get:function(){return a.TypeDefinitionRequest}});let o=ht();Object.defineProperty(e,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return o.WorkspaceFoldersRequest}}),Object.defineProperty(e,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return o.DidChangeWorkspaceFoldersNotification}});let s=gt();Object.defineProperty(e,"ConfigurationRequest",{enumerable:!0,get:function(){return s.ConfigurationRequest}});let l=_t();Object.defineProperty(e,"DocumentColorRequest",{enumerable:!0,get:function(){return l.DocumentColorRequest}}),Object.defineProperty(e,"ColorPresentationRequest",{enumerable:!0,get:function(){return l.ColorPresentationRequest}});let u=vt();Object.defineProperty(e,"FoldingRangeRequest",{enumerable:!0,get:function(){return u.FoldingRangeRequest}}),Object.defineProperty(e,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return u.FoldingRangeRefreshRequest}});let d=yt();Object.defineProperty(e,"DeclarationRequest",{enumerable:!0,get:function(){return d.DeclarationRequest}});let f=bt();Object.defineProperty(e,"SelectionRangeRequest",{enumerable:!0,get:function(){return f.SelectionRangeRequest}});let p=xt();Object.defineProperty(e,"WorkDoneProgress",{enumerable:!0,get:function(){return p.WorkDoneProgress}}),Object.defineProperty(e,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return p.WorkDoneProgressCreateRequest}}),Object.defineProperty(e,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return p.WorkDoneProgressCancelNotification}});let m=St();Object.defineProperty(e,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return m.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(e,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return m.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(e,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return m.CallHierarchyPrepareRequest}});let h=Ct();Object.defineProperty(e,"TokenFormat",{enumerable:!0,get:function(){return h.TokenFormat}}),Object.defineProperty(e,"SemanticTokensRequest",{enumerable:!0,get:function(){return h.SemanticTokensRequest}}),Object.defineProperty(e,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return h.SemanticTokensDeltaRequest}}),Object.defineProperty(e,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return h.SemanticTokensRangeRequest}}),Object.defineProperty(e,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return h.SemanticTokensRefreshRequest}}),Object.defineProperty(e,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return h.SemanticTokensRegistrationType}});let g=wt();Object.defineProperty(e,"ShowDocumentRequest",{enumerable:!0,get:function(){return g.ShowDocumentRequest}});let _=Tt();Object.defineProperty(e,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return _.LinkedEditingRangeRequest}});let v=Et();Object.defineProperty(e,"FileOperationPatternKind",{enumerable:!0,get:function(){return v.FileOperationPatternKind}}),Object.defineProperty(e,"DidCreateFilesNotification",{enumerable:!0,get:function(){return v.DidCreateFilesNotification}}),Object.defineProperty(e,"WillCreateFilesRequest",{enumerable:!0,get:function(){return v.WillCreateFilesRequest}}),Object.defineProperty(e,"DidRenameFilesNotification",{enumerable:!0,get:function(){return v.DidRenameFilesNotification}}),Object.defineProperty(e,"WillRenameFilesRequest",{enumerable:!0,get:function(){return v.WillRenameFilesRequest}}),Object.defineProperty(e,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return v.DidDeleteFilesNotification}}),Object.defineProperty(e,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return v.WillDeleteFilesRequest}});let y=Dt();Object.defineProperty(e,"UniquenessLevel",{enumerable:!0,get:function(){return y.UniquenessLevel}}),Object.defineProperty(e,"MonikerKind",{enumerable:!0,get:function(){return y.MonikerKind}}),Object.defineProperty(e,"MonikerRequest",{enumerable:!0,get:function(){return y.MonikerRequest}});let b=Ot();Object.defineProperty(e,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return b.TypeHierarchyPrepareRequest}}),Object.defineProperty(e,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return b.TypeHierarchySubtypesRequest}}),Object.defineProperty(e,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return b.TypeHierarchySupertypesRequest}});let x=kt();Object.defineProperty(e,"InlineValueRequest",{enumerable:!0,get:function(){return x.InlineValueRequest}}),Object.defineProperty(e,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return x.InlineValueRefreshRequest}});let S=At();Object.defineProperty(e,"InlayHintRequest",{enumerable:!0,get:function(){return S.InlayHintRequest}}),Object.defineProperty(e,"InlayHintResolveRequest",{enumerable:!0,get:function(){return S.InlayHintResolveRequest}}),Object.defineProperty(e,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return S.InlayHintRefreshRequest}});let C=jt();Object.defineProperty(e,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return C.DiagnosticServerCancellationData}}),Object.defineProperty(e,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return C.DocumentDiagnosticReportKind}}),Object.defineProperty(e,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return C.DocumentDiagnosticRequest}}),Object.defineProperty(e,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return C.WorkspaceDiagnosticRequest}}),Object.defineProperty(e,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return C.DiagnosticRefreshRequest}});let w=Mt();Object.defineProperty(e,"NotebookCellKind",{enumerable:!0,get:function(){return w.NotebookCellKind}}),Object.defineProperty(e,"ExecutionSummary",{enumerable:!0,get:function(){return w.ExecutionSummary}}),Object.defineProperty(e,"NotebookCell",{enumerable:!0,get:function(){return w.NotebookCell}}),Object.defineProperty(e,"NotebookDocument",{enumerable:!0,get:function(){return w.NotebookDocument}}),Object.defineProperty(e,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return w.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(e,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return w.DidOpenNotebookDocumentNotification}}),Object.defineProperty(e,"NotebookCellArrayChange",{enumerable:!0,get:function(){return w.NotebookCellArrayChange}}),Object.defineProperty(e,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return w.DidChangeNotebookDocumentNotification}}),Object.defineProperty(e,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return w.DidSaveNotebookDocumentNotification}}),Object.defineProperty(e,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return w.DidCloseNotebookDocumentNotification}});let T=Nt();Object.defineProperty(e,"InlineCompletionRequest",{enumerable:!0,get:function(){return T.InlineCompletionRequest}});var D;(function(e){e.is=function(e){let t=e;return r.string(t)||r.string(t.language)||r.string(t.scheme)||r.string(t.pattern)}})(D||(e.TextDocumentFilter=D={}));var O;(function(e){e.is=function(e){let t=e;return r.objectLiteral(t)&&(r.string(t.notebookType)||r.string(t.scheme)||r.string(t.pattern))}})(O||(e.NotebookDocumentFilter=O={}));var k;(function(e){e.is=function(e){let t=e;return r.objectLiteral(t)&&(r.string(t.notebook)||O.is(t.notebook))&&(t.language===void 0||r.string(t.language))}})(k||(e.NotebookCellTextDocumentFilter=k={}));var ee;(function(e){e.is=function(e){if(!Array.isArray(e))return!1;for(let t of e)if(!r.string(t)&&!D.is(t)&&!k.is(t))return!1;return!0}})(ee||(e.DocumentSelector=ee={}));var A;(function(e){e.method=`client/registerCapability`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(e.method)})(A||(e.RegistrationRequest=A={}));var j;(function(e){e.method=`client/unregisterCapability`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(e.method)})(j||(e.UnregistrationRequest=j={}));var te;(function(e){e.Create=`create`,e.Rename=`rename`,e.Delete=`delete`})(te||(e.ResourceOperationKind=te={}));var M;(function(e){e.Abort=`abort`,e.Transactional=`transactional`,e.TextOnlyTransactional=`textOnlyTransactional`,e.Undo=`undo`})(M||(e.FailureHandlingKind=M={}));var N;(function(e){e.UTF8=`utf-8`,e.UTF16=`utf-16`,e.UTF32=`utf-32`})(N||(e.PositionEncodingKind=N={}));var P;(function(e){e.hasId=function(e){let t=e;return t&&r.string(t.id)&&t.id.length>0}})(P||(e.StaticRegistrationOptions=P={}));var ne;(function(e){e.is=function(e){let t=e;return t&&(t.documentSelector===null||ee.is(t.documentSelector))}})(ne||(e.TextDocumentRegistrationOptions=ne={}));var F;(function(e){e.is=function(e){let t=e;return r.objectLiteral(t)&&(t.workDoneProgress===void 0||r.boolean(t.workDoneProgress))},e.hasWorkDoneProgress=function(e){let t=e;return t&&r.boolean(t.workDoneProgress)}})(F||(e.WorkDoneProgressOptions=F={}));var I;(function(e){e.method=`initialize`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(I||(e.InitializeRequest=I={}));var L;(function(e){e.unknownProtocolVersion=1})(L||(e.InitializeErrorCodes=L={}));var R;(function(e){e.method=`initialized`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(R||(e.InitializedNotification=R={}));var z;(function(e){e.method=`shutdown`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType0(e.method)})(z||(e.ShutdownRequest=z={}));var B;(function(e){e.method=`exit`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType0(e.method)})(B||(e.ExitNotification=B={}));var re;(function(e){e.method=`workspace/didChangeConfiguration`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(re||(e.DidChangeConfigurationNotification=re={}));var V;(function(e){e.Error=1,e.Warning=2,e.Info=3,e.Log=4,e.Debug=5})(V||(e.MessageType=V={}));var H;(function(e){e.method=`window/showMessage`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolNotificationType(e.method)})(H||(e.ShowMessageNotification=H={}));var ie;(function(e){e.method=`window/showMessageRequest`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(e.method)})(ie||(e.ShowMessageRequest=ie={}));var U;(function(e){e.method=`window/logMessage`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolNotificationType(e.method)})(U||(e.LogMessageNotification=U={}));var ae;(function(e){e.method=`telemetry/event`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolNotificationType(e.method)})(ae||(e.TelemetryEventNotification=ae={}));var oe;(function(e){e.None=0,e.Full=1,e.Incremental=2})(oe||(e.TextDocumentSyncKind=oe={}));var se;(function(e){e.method=`textDocument/didOpen`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(se||(e.DidOpenTextDocumentNotification=se={}));var ce;(function(e){e.isIncremental=function(e){let t=e;return t!=null&&typeof t.text==`string`&&t.range!==void 0&&(t.rangeLength===void 0||typeof t.rangeLength==`number`)},e.isFull=function(e){let t=e;return t!=null&&typeof t.text==`string`&&t.range===void 0&&t.rangeLength===void 0}})(ce||(e.TextDocumentContentChangeEvent=ce={}));var W;(function(e){e.method=`textDocument/didChange`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(W||(e.DidChangeTextDocumentNotification=W={}));var le;(function(e){e.method=`textDocument/didClose`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(le||(e.DidCloseTextDocumentNotification=le={}));var ue;(function(e){e.method=`textDocument/didSave`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(ue||(e.DidSaveTextDocumentNotification=ue={}));var G;(function(e){e.Manual=1,e.AfterDelay=2,e.FocusOut=3})(G||(e.TextDocumentSaveReason=G={}));var de;(function(e){e.method=`textDocument/willSave`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(de||(e.WillSaveTextDocumentNotification=de={}));var fe;(function(e){e.method=`textDocument/willSaveWaitUntil`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(fe||(e.WillSaveTextDocumentWaitUntilRequest=fe={}));var pe;(function(e){e.method=`workspace/didChangeWatchedFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(pe||(e.DidChangeWatchedFilesNotification=pe={}));var me;(function(e){e.Created=1,e.Changed=2,e.Deleted=3})(me||(e.FileChangeType=me={}));var he;(function(e){e.is=function(e){let t=e;return r.objectLiteral(t)&&(n.URI.is(t.baseUri)||n.WorkspaceFolder.is(t.baseUri))&&r.string(t.pattern)}})(he||(e.RelativePattern=he={}));var ge;(function(e){e.Create=1,e.Change=2,e.Delete=4})(ge||(e.WatchKind=ge={}));var _e;(function(e){e.method=`textDocument/publishDiagnostics`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolNotificationType(e.method)})(_e||(e.PublishDiagnosticsNotification=_e={}));var ve;(function(e){e.Invoked=1,e.TriggerCharacter=2,e.TriggerForIncompleteCompletions=3})(ve||(e.CompletionTriggerKind=ve={}));var ye;(function(e){e.method=`textDocument/completion`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(ye||(e.CompletionRequest=ye={}));var be;(function(e){e.method=`completionItem/resolve`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(be||(e.CompletionResolveRequest=be={}));var xe;(function(e){e.method=`textDocument/hover`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(xe||(e.HoverRequest=xe={}));var Se;(function(e){e.Invoked=1,e.TriggerCharacter=2,e.ContentChange=3})(Se||(e.SignatureHelpTriggerKind=Se={}));var Ce;(function(e){e.method=`textDocument/signatureHelp`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ce||(e.SignatureHelpRequest=Ce={}));var we;(function(e){e.method=`textDocument/definition`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(we||(e.DefinitionRequest=we={}));var Te;(function(e){e.method=`textDocument/references`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Te||(e.ReferencesRequest=Te={}));var Ee;(function(e){e.method=`textDocument/documentHighlight`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ee||(e.DocumentHighlightRequest=Ee={}));var De;(function(e){e.method=`textDocument/documentSymbol`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(De||(e.DocumentSymbolRequest=De={}));var Oe;(function(e){e.method=`textDocument/codeAction`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Oe||(e.CodeActionRequest=Oe={}));var ke;(function(e){e.method=`codeAction/resolve`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(ke||(e.CodeActionResolveRequest=ke={}));var Ae;(function(e){e.method=`workspace/symbol`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ae||(e.WorkspaceSymbolRequest=Ae={}));var je;(function(e){e.method=`workspaceSymbol/resolve`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(je||(e.WorkspaceSymbolResolveRequest=je={}));var Me;(function(e){e.method=`textDocument/codeLens`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Me||(e.CodeLensRequest=Me={}));var Ne;(function(e){e.method=`codeLens/resolve`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ne||(e.CodeLensResolveRequest=Ne={}));var Pe;(function(e){e.method=`workspace/codeLens/refresh`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method)})(Pe||(e.CodeLensRefreshRequest=Pe={}));var Fe;(function(e){e.method=`textDocument/documentLink`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Fe||(e.DocumentLinkRequest=Fe={}));var Ie;(function(e){e.method=`documentLink/resolve`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ie||(e.DocumentLinkResolveRequest=Ie={}));var Le;(function(e){e.method=`textDocument/formatting`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Le||(e.DocumentFormattingRequest=Le={}));var Re;(function(e){e.method=`textDocument/rangeFormatting`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Re||(e.DocumentRangeFormattingRequest=Re={}));var ze;(function(e){e.method=`textDocument/rangesFormatting`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(ze||(e.DocumentRangesFormattingRequest=ze={}));var Be;(function(e){e.method=`textDocument/onTypeFormatting`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Be||(e.DocumentOnTypeFormattingRequest=Be={}));var Ve;(function(e){e.Identifier=1})(Ve||(e.PrepareSupportDefaultBehavior=Ve={}));var He;(function(e){e.method=`textDocument/rename`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(He||(e.RenameRequest=He={}));var Ue;(function(e){e.method=`textDocument/prepareRename`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ue||(e.PrepareRenameRequest=Ue={}));var We;(function(e){e.method=`workspace/executeCommand`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(We||(e.ExecuteCommandRequest=We={}));var Ge;(function(e){e.method=`workspace/applyEdit`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(`workspace/applyEdit`)})(Ge||(e.ApplyWorkspaceEditRequest=Ge={}))})),Ft=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;let t=w();e.createProtocolConnection=function(e,n,r,i){return t.ConnectionStrategy.is(i)&&(i={connectionStrategy:i}),(0,t.createMessageConnection)(e,n,r,i)}})),It=/* @__PURE__ */ a(((e,t,n)=>{var r=n&&n.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),i=n&&n.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.LSPErrorCodes=e.createProtocolConnection=void 0,i(w(),e),i((dt(),c(E)),e),i(q(),e),i(Pt(),e);var a=Ft();Object.defineProperty(e,"createProtocolConnection",{enumerable:!0,get:function(){return a.createProtocolConnection}});var o;(function(e){e.lspReservedErrorRangeStart=-32899,e.RequestFailed=-32803,e.ServerCancelled=-32802,e.ContentModified=-32801,e.RequestCancelled=-32800,e.lspReservedErrorRangeEnd=-32800})(o||(e.LSPErrorCodes=o={}))})),J=/* @__PURE__ */ a(((e,t,n)=>{var r=n&&n.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),i=n&&n.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;let a=T();i(T(),e),i(It(),e),e.createProtocolConnection=function(e,t,n,r){return(0,a.createMessageConnection)(e,t,n,r)}})),Lt=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SemanticTokensBuilder=e.SemanticTokensDiff=e.SemanticTokensFeature=void 0;let t=J();e.SemanticTokensFeature=e=>class extends e{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(t.SemanticTokensRefreshRequest.type),on:e=>{let n=t.SemanticTokensRequest.type;return this.connection.onRequest(n,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(n,t)))},onDelta:e=>{let n=t.SemanticTokensDeltaRequest.type;return this.connection.onRequest(n,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(n,t)))},onRange:e=>{let n=t.SemanticTokensRangeRequest.type;return this.connection.onRequest(n,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(n,t)))}}}};var n=class{constructor(e,t){this.originalSequence=e,this.modifiedSequence=t}computeDiff(){let e=this.originalSequence.length,t=this.modifiedSequence.length,n=0;for(;n<t&&n<e&&this.originalSequence[n]===this.modifiedSequence[n];)n++;if(n<t&&n<e){let r=e-1,i=t-1;for(;r>=n&&i>=n&&this.originalSequence[r]===this.modifiedSequence[i];)r--,i--;(r<n||i<n)&&(r++,i++);let a=r-n+1,o=this.modifiedSequence.slice(n,i+1);return o.length===1&&o[0]===this.originalSequence[r]?[{start:n,deleteCount:a-1}]:[{start:n,deleteCount:a,data:o}]}return n<t?[{start:n,deleteCount:0,data:this.modifiedSequence.slice(n)}]:n<e?[{start:n,deleteCount:e-n}]:[]}};e.SemanticTokensDiff=n,e.SemanticTokensBuilder=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,t,n,r,i){let a=e,o=t;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++]=n,this._data[this._dataLen++]=r,this._data[this._dataLen++]=i,this._prevLine=e,this._prevChar=t}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(){return this._prevData===void 0?this.build():{resultId:this.id,edits:new n(this._prevData,this._data).computeDiff()}}}})),Rt=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlineCompletionFeature=void 0;let t=J();e.InlineCompletionFeature=e=>class extends e{get inlineCompletion(){return{on:e=>this.connection.onRequest(t.InlineCompletionRequest.type,(t,n)=>e(t,n,this.attachWorkDoneProgress(t)))}}}})),zt=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocuments=void 0;let t=J();e.TextDocuments=class{constructor(e){this._configuration=e,this._syncedDocuments=/* @__PURE__ */ new Map,this._onDidChangeContent=new t.Emitter,this._onDidOpen=new t.Emitter,this._onDidClose=new t.Emitter,this._onDidSave=new t.Emitter,this._onWillSave=new t.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.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._syncedDocuments.get(e)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=t.TextDocumentSyncKind.Incremental;let n=[];return n.push(e.onDidOpenTextDocument(e=>{let t=e.textDocument,n=this._configuration.create(t.uri,t.languageId,t.version,t.text);this._syncedDocuments.set(t.uri,n);let r=Object.freeze({document:n});this._onDidOpen.fire(r),this._onDidChangeContent.fire(r)})),n.push(e.onDidChangeTextDocument(e=>{let t=e.textDocument,n=e.contentChanges;if(n.length===0)return;let{version:r}=t;if(r==null)throw Error(`Received document change event for ${t.uri} without valid version identifier`);let i=this._syncedDocuments.get(t.uri);i!==void 0&&(i=this._configuration.update(i,n,r),this._syncedDocuments.set(t.uri,i),this._onDidChangeContent.fire(Object.freeze({document:i})))})),n.push(e.onDidCloseTextDocument(e=>{let t=this._syncedDocuments.get(e.textDocument.uri);t!==void 0&&(this._syncedDocuments.delete(e.textDocument.uri),this._onDidClose.fire(Object.freeze({document:t})))})),n.push(e.onWillSaveTextDocument(e=>{let t=this._syncedDocuments.get(e.textDocument.uri);t!==void 0&&this._onWillSave.fire(Object.freeze({document:t,reason:e.reason}))})),n.push(e.onWillSaveTextDocumentWaitUntil((e,t)=>{let n=this._syncedDocuments.get(e.textDocument.uri);return n!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:n,reason:e.reason}),t):[]})),n.push(e.onDidSaveTextDocument(e=>{let t=this._syncedDocuments.get(e.textDocument.uri);t!==void 0&&this._onDidSave.fire(Object.freeze({document:t}))})),t.Disposable.create(()=>{n.forEach(e=>e.dispose())})}}})),Bt=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NotebookDocuments=e.NotebookSyncFeature=void 0;let t=J(),n=zt();e.NotebookSyncFeature=e=>class extends e{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(t.DidOpenNotebookDocumentNotification.type,t=>{e(t)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(t.DidChangeNotebookDocumentNotification.type,t=>{e(t)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(t.DidSaveNotebookDocumentNotification.type,t=>{e(t)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(t.DidCloseNotebookDocumentNotification.type,t=>{e(t)})}}};var r=class e{onDidOpenTextDocument(e){return this.openHandler=e,t.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,t.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,t.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return e.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return e.NULL_DISPOSE}onDidSaveTextDocument(){return e.NULL_DISPOSE}};r.NULL_DISPOSE=Object.freeze({dispose:()=>{}}),e.NotebookDocuments=class{constructor(e){this._cellTextDocuments=e instanceof n.TextDocuments?e:new n.TextDocuments(e),this.notebookDocuments=/* @__PURE__ */ new Map,this.notebookCellMap=/* @__PURE__ */ new Map,this._onDidOpen=new t.Emitter,this._onDidChange=new t.Emitter,this._onDidSave=new t.Emitter,this._onDidClose=new t.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let t=this.notebookCellMap.get(e);return t&&t[0]}findNotebookDocumentForCell(e){let t=typeof e==`string`?e:e.document,n=this.notebookCellMap.get(t);return n&&n[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){let n=new r,i=[];return i.push(this.cellTextDocuments.listen(n)),i.push(e.notebooks.synchronization.onDidOpenNotebookDocument(e=>{this.notebookDocuments.set(e.notebookDocument.uri,e.notebookDocument);for(let t of e.cellTextDocuments)n.openTextDocument({textDocument:t});this.updateCellMap(e.notebookDocument),this._onDidOpen.fire(e.notebookDocument)})),i.push(e.notebooks.synchronization.onDidChangeNotebookDocument(e=>{let t=this.notebookDocuments.get(e.notebookDocument.uri);if(t===void 0)return;t.version=e.notebookDocument.version;let r=t.metadata,i=!1,a=e.change;a.metadata!==void 0&&(i=!0,t.metadata=a.metadata);let o=[],s=[],c=[],l=[];if(a.cells!==void 0){let e=a.cells;if(e.structure!==void 0){let r=e.structure.array;if(t.cells.splice(r.start,r.deleteCount,...r.cells===void 0?[]:r.cells),e.structure.didOpen!==void 0)for(let t of e.structure.didOpen)n.openTextDocument({textDocument:t}),o.push(t.uri);if(e.structure.didClose)for(let t of e.structure.didClose)n.closeTextDocument({textDocument:t}),s.push(t.uri)}if(e.data!==void 0){let n=new Map(e.data.map(e=>[e.document,e]));for(let e=0;e<=t.cells.length;e++){let r=n.get(t.cells[e].document);if(r!==void 0){let i=t.cells.splice(e,1,r);if(c.push({old:i[0],new:r}),n.delete(r.document),n.size===0)break}}}if(e.textContent!==void 0)for(let t of e.textContent)n.changeTextDocument({textDocument:t.document,contentChanges:t.changes}),l.push(t.document.uri)}this.updateCellMap(t);let u={notebookDocument:t};i&&(u.metadata={old:r,new:t.metadata});let d=[];for(let e of o)d.push(this.getNotebookCell(e));let f=[];for(let e of s)f.push(this.getNotebookCell(e));let p=[];for(let e of l)p.push(this.getNotebookCell(e));(d.length>0||f.length>0||c.length>0||p.length>0)&&(u.cells={added:d,removed:f,changed:{data:c,textContent:p}}),(u.metadata!==void 0||u.cells!==void 0)&&this._onDidChange.fire(u)})),i.push(e.notebooks.synchronization.onDidSaveNotebookDocument(e=>{let t=this.notebookDocuments.get(e.notebookDocument.uri);t!==void 0&&this._onDidSave.fire(t)})),i.push(e.notebooks.synchronization.onDidCloseNotebookDocument(e=>{let t=this.notebookDocuments.get(e.notebookDocument.uri);if(t!==void 0){this._onDidClose.fire(t);for(let t of e.cellTextDocuments)n.closeTextDocument({textDocument:t});this.notebookDocuments.delete(e.notebookDocument.uri);for(let e of t.cells)this.notebookCellMap.delete(e.document)}})),t.Disposable.create(()=>{i.forEach(e=>e.dispose())})}updateCellMap(e){for(let t of e.cells)this.notebookCellMap.set(t.document,[t,e])}}})),Vt=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.thenable=e.typedArray=e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0,e.boolean=function(e){return e===!0||e===!1};function t(e){return typeof e==`string`||e instanceof String}e.string=t,e.number=function(e){return typeof e==`number`||e instanceof Number},e.error=function(e){return e instanceof Error};function n(e){return typeof e==`function`}e.func=n;function r(e){return Array.isArray(e)}e.array=r,e.stringArray=function(e){return r(e)&&e.every(e=>t(e))},e.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)},e.thenable=function(e){return e&&n(e.then)}})),Ht=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.generateUuid=e.parse=e.isUUID=e.v4=e.empty=void 0;var t=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},n=class e extends t{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return e._oneOf(e._chars)}constructor(){super([e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),`-`,e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),`-`,`4`,e._randomHex(),e._randomHex(),e._randomHex(),`-`,e._oneOf(e._timeHighBits),e._randomHex(),e._randomHex(),e._randomHex(),`-`,e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex()].join(``))}};n._chars=[`0`,`1`,`2`,`3`,`4`,`5`,`6`,`6`,`7`,`8`,`9`,`a`,`b`,`c`,`d`,`e`,`f`],n._timeHighBits=[`8`,`9`,`a`,`b`],e.empty=new t(`00000000-0000-0000-0000-000000000000`);function r(){return new n}e.v4=r;let i=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function a(e){return i.test(e)}e.isUUID=a,e.parse=function(e){if(!a(e))throw Error(`invalid uuid`);return new t(e)},e.generateUuid=function(){return r().asHex()}})),Ut=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.attachPartialResult=e.ProgressFeature=e.attachWorkDone=void 0;let t=J(),n=Ht();var r=class e{constructor(t,n){this._connection=t,this._token=n,e.Instances.set(this._token,this)}begin(e,n,r,i){let a={kind:`begin`,title:e,percentage:n,message:r,cancellable:i};this._connection.sendProgress(t.WorkDoneProgress.type,this._token,a)}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(t.WorkDoneProgress.type,this._token,r)}done(){e.Instances.delete(this._token),this._connection.sendProgress(t.WorkDoneProgress.type,this._token,{kind:`end`})}};r.Instances=/* @__PURE__ */ new Map;var i=class extends r{constructor(e,n){super(e,n),this._source=new t.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},a=class{constructor(){}begin(){}report(){}done(){}},o=class extends a{constructor(){super(),this._source=new t.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};e.attachWorkDone=function(e,t){if(t===void 0||t.workDoneToken===void 0)return new a;let n=t.workDoneToken;return delete t.workDoneToken,new r(e,n)},e.ProgressFeature=e=>class extends e{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(t.WorkDoneProgressCancelNotification.type,e=>{let t=r.Instances.get(e.token);(t instanceof i||t instanceof o)&&t.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new a:new r(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,n.generateUuid)();return this.connection.sendRequest(t.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new i(this.connection,e))}return Promise.resolve(new o)}};var s;(function(e){e.type=new t.ProgressType})(s||={});var c=class{constructor(e,t){this._connection=e,this._token=t}report(e){this._connection.sendProgress(s.type,this._token,e)}};e.attachPartialResult=function(e,t){if(t===void 0||t.partialResultToken===void 0)return;let n=t.partialResultToken;return delete t.partialResultToken,new c(e,n)}})),Wt=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigurationFeature=void 0;let t=J(),n=Vt();e.ConfigurationFeature=e=>class extends e{getConfiguration(e){return e?n.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(t.ConfigurationRequest.type,n).then(t=>Array.isArray(t)?Array.isArray(e)?t:t[0]:Array.isArray(e)?[]:null)}}})),Gt=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceFoldersFeature=void 0;let t=J();e.WorkspaceFoldersFeature=e=>class extends e{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let n=e.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new t.Emitter,this.connection.onNotification(t.DidChangeWorkspaceFoldersNotification.type,e=>{this._onDidChangeWorkspaceFolders.fire(e.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let t=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=t===!0||typeof t==`string`}getWorkspaceFolders(){return this.connection.sendRequest(t.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw Error(`Client doesn't support sending workspace folder change events.`);return!this._notificationIsAutoRegistered&&!this._unregistration&&(this._unregistration=this.connection.client.register(t.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}}})),Kt=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CallHierarchyFeature=void 0;let t=J();e.CallHierarchyFeature=e=>class extends e{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(t.CallHierarchyPrepareRequest.type,(t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0)),onIncomingCalls:e=>{let n=t.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(n,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(n,t)))},onOutgoingCalls:e=>{let n=t.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(n,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(n,t)))}}}}})),qt=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShowDocumentFeature=void 0;let t=J();e.ShowDocumentFeature=e=>class extends e{showDocument(e){return this.connection.sendRequest(t.ShowDocumentRequest.type,e)}}})),Jt=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FileOperationsFeature=void 0;let t=J();e.FileOperationsFeature=e=>class extends e{onDidCreateFiles(e){return this.connection.onNotification(t.DidCreateFilesNotification.type,t=>{e(t)})}onDidRenameFiles(e){return this.connection.onNotification(t.DidRenameFilesNotification.type,t=>{e(t)})}onDidDeleteFiles(e){return this.connection.onNotification(t.DidDeleteFilesNotification.type,t=>{e(t)})}onWillCreateFiles(e){return this.connection.onRequest(t.WillCreateFilesRequest.type,(t,n)=>e(t,n))}onWillRenameFiles(e){return this.connection.onRequest(t.WillRenameFilesRequest.type,(t,n)=>e(t,n))}onWillDeleteFiles(e){return this.connection.onRequest(t.WillDeleteFilesRequest.type,(t,n)=>e(t,n))}}})),Yt=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LinkedEditingRangeFeature=void 0;let t=J();e.LinkedEditingRangeFeature=e=>class extends e{onLinkedEditingRange(e){return this.connection.onRequest(t.LinkedEditingRangeRequest.type,(t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0))}}})),Xt=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHierarchyFeature=void 0;let t=J();e.TypeHierarchyFeature=e=>class extends e{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(t.TypeHierarchyPrepareRequest.type,(t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0)),onSupertypes:e=>{let n=t.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(n,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(n,t)))},onSubtypes:e=>{let n=t.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(n,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(n,t)))}}}}})),Zt=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlineValueFeature=void 0;let t=J();e.InlineValueFeature=e=>class extends e{get inlineValue(){return{refresh:()=>this.connection.sendRequest(t.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(t.InlineValueRequest.type,(t,n)=>e(t,n,this.attachWorkDoneProgress(t)))}}}})),Qt=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FoldingRangeFeature=void 0;let t=J();e.FoldingRangeFeature=e=>class extends e{get foldingRange(){return{refresh:()=>this.connection.sendRequest(t.FoldingRangeRefreshRequest.type),on:e=>{let n=t.FoldingRangeRequest.type;return this.connection.onRequest(n,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(n,t)))}}}}})),$t=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlayHintFeature=void 0;let t=J();e.InlayHintFeature=e=>class extends e{get inlayHint(){return{refresh:()=>this.connection.sendRequest(t.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(t.InlayHintRequest.type,(t,n)=>e(t,n,this.attachWorkDoneProgress(t))),resolve:e=>this.connection.onRequest(t.InlayHintResolveRequest.type,(t,n)=>e(t,n))}}}})),en=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiagnosticFeature=void 0;let t=J();e.DiagnosticFeature=e=>class extends e{get diagnostics(){return{refresh:()=>this.connection.sendRequest(t.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(t.DocumentDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t.DocumentDiagnosticRequest.partialResult,n))),onWorkspace:e=>this.connection.onRequest(t.WorkspaceDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t.WorkspaceDiagnosticRequest.partialResult,n)))}}}})),tn=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MonikerFeature=void 0;let t=J();e.MonikerFeature=e=>class extends e{get moniker(){return{on:e=>{let n=t.MonikerRequest.type;return this.connection.onRequest(n,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(n,t)))}}}}})),nn=/* @__PURE__ */ a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createConnection=e.combineFeatures=e.combineNotebooksFeatures=e.combineLanguagesFeatures=e.combineWorkspaceFeatures=e.combineWindowFeatures=e.combineClientFeatures=e.combineTracerFeatures=e.combineTelemetryFeatures=e.combineConsoleFeatures=e._NotebooksImpl=e._LanguagesImpl=e.BulkUnregistration=e.BulkRegistration=e.ErrorMessageTracker=void 0;let t=J(),n=Vt(),r=Ht(),i=Ut(),a=Wt(),o=Gt(),s=Kt(),c=Lt(),l=qt(),u=Jt(),d=Yt(),f=Xt(),p=Zt(),m=Qt(),h=$t(),g=en(),_=Bt(),v=tn();function y(e){if(e!==null)return e}e.ErrorMessageTracker=class{constructor(){this._messages=Object.create(null)}add(e){let t=this._messages[e];t||=0,t++,this._messages[e]=t}sendErrors(e){Object.keys(this._messages).forEach(t=>{e.window.showErrorMessage(t)})}};var b=class{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw Error(`Remote is not attached to a connection yet.`);return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(t.MessageType.Error,e)}warn(e){this.send(t.MessageType.Warning,e)}info(e){this.send(t.MessageType.Info,e)}log(e){this.send(t.MessageType.Log,e)}debug(e){this.send(t.MessageType.Debug,e)}send(e,n){this._rawConnection&&this._rawConnection.sendNotification(t.LogMessageNotification.type,{type:e,message:n}).catch(()=>{(0,t.RAL)().console.error(`Sending log message failed`)})}},x=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw Error(`Remote is not attached to a connection yet.`);return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...n){let r={type:t.MessageType.Error,message:e,actions:n};return this.connection.sendRequest(t.ShowMessageRequest.type,r).then(y)}showWarningMessage(e,...n){let r={type:t.MessageType.Warning,message:e,actions:n};return this.connection.sendRequest(t.ShowMessageRequest.type,r).then(y)}showInformationMessage(e,...n){let r={type:t.MessageType.Info,message:e,actions:n};return this.connection.sendRequest(t.ShowMessageRequest.type,r).then(y)}};let S=(0,l.ShowDocumentFeature)((0,i.ProgressFeature)(x));var C;(function(e){e.create=function(){return new w}})(C||(e.BulkRegistration=C={}));var w=class{constructor(){this._registrations=[],this._registered=/* @__PURE__ */ new Set}add(e,t){let i=n.string(e)?e:e.method;if(this._registered.has(i))throw Error(`${i} is already added to this registration`);let a=r.generateUuid();this._registrations.push({id:a,method:i,registerOptions:t||{}}),this._registered.add(i)}asRegistrationParams(){return{registrations:this._registrations}}},T;(function(e){e.create=function(){return new E(void 0,[])}})(T||(e.BulkUnregistration=T={}));var E=class{constructor(e,t){this._connection=e,this._unregistrations=/* @__PURE__ */ new Map,t.forEach(e=>{this._unregistrations.set(e.method,e)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let t of this._unregistrations.values())e.push(t);let n={unregisterations:e};this._connection.sendRequest(t.UnregistrationRequest.type,n).catch(()=>{this._connection.console.info(`Bulk unregistration failed.`)})}disposeSingle(e){let r=n.string(e)?e:e.method,i=this._unregistrations.get(r);if(!i)return!1;let a={unregisterations:[i]};return this._connection.sendRequest(t.UnregistrationRequest.type,a).then(()=>{this._unregistrations.delete(r)},e=>{this._connection.console.info(`Un-registering request handler for ${i.id} failed.`)}),!0}},D=class{attach(e){this._connection=e}get connection(){if(!this._connection)throw Error(`Remote is not attached to a connection yet.`);return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,t,n){return e instanceof w?this.registerMany(e):e instanceof E?this.registerSingle1(e,t,n):this.registerSingle2(e,t)}registerSingle1(e,i,a){let o=n.string(i)?i:i.method,s=r.generateUuid(),c={registrations:[{id:s,method:o,registerOptions:a||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(t.RegistrationRequest.type,c).then(t=>(e.add({id:s,method:o}),e),e=>(this.connection.console.info(`Registering request handler for ${o} failed.`),Promise.reject(e)))}registerSingle2(e,i){let a=n.string(e)?e:e.method,o=r.generateUuid(),s={registrations:[{id:o,method:a,registerOptions:i||{}}]};return this.connection.sendRequest(t.RegistrationRequest.type,s).then(e=>t.Disposable.create(()=>{this.unregisterSingle(o,a).catch(()=>{this.connection.console.info(`Un-registering capability with id ${o} failed.`)})}),e=>(this.connection.console.info(`Registering request handler for ${a} failed.`),Promise.reject(e)))}unregisterSingle(e,n){let r={unregisterations:[{id:e,method:n}]};return this.connection.sendRequest(t.UnregistrationRequest.type,r).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let n=e.asRegistrationParams();return this.connection.sendRequest(t.RegistrationRequest.type,n).then(()=>new E(this._connection,n.registrations.map(e=>({id:e.id,method:e.method}))),e=>(this.connection.console.info(`Bulk registration failed.`),Promise.reject(e)))}},O=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw Error(`Remote is not attached to a connection yet.`);return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function n(e){return e&&!!e.edit}let r=n(e)?e:{edit:e};return this.connection.sendRequest(t.ApplyWorkspaceEditRequest.type,r)}};let k=(0,u.FileOperationsFeature)((0,o.WorkspaceFoldersFeature)((0,a.ConfigurationFeature)(O)));var ee=class{constructor(){this._trace=t.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw 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!==t.Trace.Off&&this.connection.sendNotification(t.LogTraceNotification.type,{message:e,verbose:this._trace===t.Trace.Verbose?n:void 0}).catch(()=>{})}},A=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw Error(`Remote is not attached to a connection yet.`);return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(t.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log(`Sending TelemetryEventNotification failed`)})}},j=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw Error(`Remote is not attached to a connection yet.`);return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,i.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,i.attachPartialResult)(this.connection,t)}};e._LanguagesImpl=j;let te=(0,m.FoldingRangeFeature)((0,v.MonikerFeature)((0,g.DiagnosticFeature)((0,h.InlayHintFeature)((0,p.InlineValueFeature)((0,f.TypeHierarchyFeature)((0,d.LinkedEditingRangeFeature)((0,c.SemanticTokensFeature)((0,s.CallHierarchyFeature)(j)))))))));var M=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw Error(`Remote is not attached to a connection yet.`);return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,i.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,i.attachPartialResult)(this.connection,t)}};e._NotebooksImpl=M;let N=(0,_.NotebookSyncFeature)(M);function P(e,t){return function(n){return t(e(n))}}e.combineConsoleFeatures=P;function ne(e,t){return function(n){return t(e(n))}}e.combineTelemetryFeatures=ne;function F(e,t){return function(n){return t(e(n))}}e.combineTracerFeatures=F;function I(e,t){return function(n){return t(e(n))}}e.combineClientFeatures=I;function L(e,t){return function(n){return t(e(n))}}e.combineWindowFeatures=L;function R(e,t){return function(n){return t(e(n))}}e.combineWorkspaceFeatures=R;function z(e,t){return function(n){return t(e(n))}}e.combineLanguagesFeatures=z;function B(e,t){return function(n){return t(e(n))}}e.combineNotebooksFeatures=B,e.combineFeatures=function(e,t){function n(e,t,n){return e&&t?n(e,t):e||t}return{__brand:`features`,console:n(e.console,t.console,P),tracer:n(e.tracer,t.tracer,F),telemetry:n(e.telemetry,t.telemetry,ne),client:n(e.client,t.client,I),window:n(e.window,t.window,L),workspace:n(e.workspace,t.workspace,R),languages:n(e.languages,t.languages,z),notebooks:n(e.notebooks,t.notebooks,B)}},e.createConnection=function(e,r,a){let o=a&&a.console?new(a.console(b)):new b,s=e(o);o.rawAttach(s);let c=a&&a.tracer?new(a.tracer(ee)):new ee,l=a&&a.telemetry?new(a.telemetry(A)):new A,u=a&&a.client?new(a.client(D)):new D,d=a&&a.window?new(a.window(S)):new S,f=a&&a.workspace?new(a.workspace(k)):new k,p=a&&a.languages?new(a.languages(te)):new te,m=a&&a.notebooks?new(a.notebooks(N)):new N,h=[o,c,l,u,d,f,p,m];function g(e){return e instanceof Promise?e:n.thenable(e)?new Promise((t,n)=>{e.then(e=>t(e),e=>n(e))}):Promise.resolve(e)}let _,v,y,x={listen:()=>s.listen(),sendRequest:(e,...t)=>s.sendRequest(n.string(e)?e:e.method,...t),onRequest:(e,t)=>s.onRequest(e,t),sendNotification:(e,t)=>{let r=n.string(e)?e:e.method;return s.sendNotification(r,t)},onNotification:(e,t)=>s.onNotification(e,t),onProgress:s.onProgress,sendProgress:s.sendProgress,onInitialize:e=>(v=e,{dispose:()=>{v=void 0}}),onInitialized:e=>s.onNotification(t.InitializedNotification.type,e),onShutdown:e=>(_=e,{dispose:()=>{_=void 0}}),onExit:e=>(y=e,{dispose:()=>{y=void 0}}),get console(){return o},get telemetry(){return l},get tracer(){return c},get client(){return u},get window(){return d},get workspace(){return f},get languages(){return p},get notebooks(){return m},onDidChangeConfiguration:e=>s.onNotification(t.DidChangeConfigurationNotification.type,e),onDidChangeWatchedFiles:e=>s.onNotification(t.DidChangeWatchedFilesNotification.type,e),__textDocumentSync:void 0,onDidOpenTextDocument:e=>s.onNotification(t.DidOpenTextDocumentNotification.type,e),onDidChangeTextDocument:e=>s.onNotification(t.DidChangeTextDocumentNotification.type,e),onDidCloseTextDocument:e=>s.onNotification(t.DidCloseTextDocumentNotification.type,e),onWillSaveTextDocument:e=>s.onNotification(t.WillSaveTextDocumentNotification.type,e),onWillSaveTextDocumentWaitUntil:e=>s.onRequest(t.WillSaveTextDocumentWaitUntilRequest.type,e),onDidSaveTextDocument:e=>s.onNotification(t.DidSaveTextDocumentNotification.type,e),sendDiagnostics:e=>s.sendNotification(t.PublishDiagnosticsNotification.type,e),onHover:e=>s.onRequest(t.HoverRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),void 0)),onCompletion:e=>s.onRequest(t.CompletionRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),(0,i.attachPartialResult)(s,t))),onCompletionResolve:e=>s.onRequest(t.CompletionResolveRequest.type,e),onSignatureHelp:e=>s.onRequest(t.SignatureHelpRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),void 0)),onDeclaration:e=>s.onRequest(t.DeclarationRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),(0,i.attachPartialResult)(s,t))),onDefinition:e=>s.onRequest(t.DefinitionRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),(0,i.attachPartialResult)(s,t))),onTypeDefinition:e=>s.onRequest(t.TypeDefinitionRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),(0,i.attachPartialResult)(s,t))),onImplementation:e=>s.onRequest(t.ImplementationRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),(0,i.attachPartialResult)(s,t))),onReferences:e=>s.onRequest(t.ReferencesRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),(0,i.attachPartialResult)(s,t))),onDocumentHighlight:e=>s.onRequest(t.DocumentHighlightRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),(0,i.attachPartialResult)(s,t))),onDocumentSymbol:e=>s.onRequest(t.DocumentSymbolRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),(0,i.attachPartialResult)(s,t))),onWorkspaceSymbol:e=>s.onRequest(t.WorkspaceSymbolRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),(0,i.attachPartialResult)(s,t))),onWorkspaceSymbolResolve:e=>s.onRequest(t.WorkspaceSymbolResolveRequest.type,e),onCodeAction:e=>s.onRequest(t.CodeActionRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),(0,i.attachPartialResult)(s,t))),onCodeActionResolve:e=>s.onRequest(t.CodeActionResolveRequest.type,(t,n)=>e(t,n)),onCodeLens:e=>s.onRequest(t.CodeLensRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),(0,i.attachPartialResult)(s,t))),onCodeLensResolve:e=>s.onRequest(t.CodeLensResolveRequest.type,(t,n)=>e(t,n)),onDocumentFormatting:e=>s.onRequest(t.DocumentFormattingRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),void 0)),onDocumentRangeFormatting:e=>s.onRequest(t.DocumentRangeFormattingRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),void 0)),onDocumentOnTypeFormatting:e=>s.onRequest(t.DocumentOnTypeFormattingRequest.type,(t,n)=>e(t,n)),onRenameRequest:e=>s.onRequest(t.RenameRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),void 0)),onPrepareRename:e=>s.onRequest(t.PrepareRenameRequest.type,(t,n)=>e(t,n)),onDocumentLinks:e=>s.onRequest(t.DocumentLinkRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),(0,i.attachPartialResult)(s,t))),onDocumentLinkResolve:e=>s.onRequest(t.DocumentLinkResolveRequest.type,(t,n)=>e(t,n)),onDocumentColor:e=>s.onRequest(t.DocumentColorRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),(0,i.attachPartialResult)(s,t))),onColorPresentation:e=>s.onRequest(t.ColorPresentationRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),(0,i.attachPartialResult)(s,t))),onFoldingRanges:e=>s.onRequest(t.FoldingRangeRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),(0,i.attachPartialResult)(s,t))),onSelectionRanges:e=>s.onRequest(t.SelectionRangeRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),(0,i.attachPartialResult)(s,t))),onExecuteCommand:e=>s.onRequest(t.ExecuteCommandRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),void 0)),dispose:()=>s.dispose()};for(let e of h)e.attach(x);return s.onRequest(t.InitializeRequest.type,e=>{r.initialize(e),n.string(e.trace)&&(c.trace=t.Trace.fromString(e.trace));for(let t of h)t.initialize(e.capabilities);if(v)return g(v(e,new t.CancellationTokenSource().token,(0,i.attachWorkDone)(s,e),void 0)).then(e=>{if(e instanceof t.ResponseError)return e;let r=e;r||={capabilities:{}};let i=r.capabilities;i||(i={},r.capabilities=i),i.textDocumentSync===void 0||i.textDocumentSync===null?i.textDocumentSync=n.number(x.__textDocumentSync)?x.__textDocumentSync:t.TextDocumentSyncKind.None:!n.number(i.textDocumentSync)&&!n.number(i.textDocumentSync.change)&&(i.textDocumentSync.change=n.number(x.__textDocumentSync)?x.__textDocumentSync:t.TextDocumentSyncKind.None);for(let e of h)e.fillServerCapabilities(i);return r});{let e={capabilities:{textDocumentSync:t.TextDocumentSyncKind.None}};for(let t of h)t.fillServerCapabilities(e.capabilities);return e}}),s.onRequest(t.ShutdownRequest.type,()=>{if(r.shutdownReceived=!0,_)return _(new t.CancellationTokenSource().token)}),s.onNotification(t.ExitNotification.type,()=>{try{y&&y()}finally{r.shutdownReceived?r.exit(0):r.exit(1)}}),s.onNotification(t.SetTraceNotification.type,e=>{c.trace=t.Trace.fromString(e.value)}),x}})),rn=/* @__PURE__ */ a(((e,t,n)=>{var r=n&&n.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),i=n&&n.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.ProposedFeatures=e.NotebookDocuments=e.TextDocuments=e.SemanticTokensBuilder=void 0;let a=Lt();Object.defineProperty(e,"SemanticTokensBuilder",{enumerable:!0,get:function(){return a.SemanticTokensBuilder}});let o=Rt();i(J(),e);let s=zt();Object.defineProperty(e,"TextDocuments",{enumerable:!0,get:function(){return s.TextDocuments}});let c=Bt();Object.defineProperty(e,"NotebookDocuments",{enumerable:!0,get:function(){return c.NotebookDocuments}}),i(nn(),e);var l;(function(e){e.all={__brand:`features`,languages:o.InlineCompletionFeature}})(l||(e.ProposedFeatures=l={}))})),an=/* @__PURE__ */ a(((e,t)=>{t.exports=J()})),on=/* @__PURE__ */ a(((e,t,n)=>{var r=n&&n.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),i=n&&n.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.createConnection=void 0;let a=rn();i(an(),e),i(rn(),e);let o=!1,s={initialize:e=>{},get shutdownReceived(){return o},set shutdownReceived(e){o=e},exit:e=>{}};e.createConnection=function(e,t,n,r){let i,o,c,l;return e!==void 0&&e.__brand===`features`&&(i=e,e=t,t=n,n=r),a.ConnectionStrategy.is(e)||a.ConnectionOptions.is(e)?l=e:(o=e,c=t,l=n),(0,a.createConnection)(e=>(0,a.createProtocolConnection)(o,c,e,l),s,i)}})),sn=(/* @__PURE__ */ a(((e,t)=>{t.exports=on()})))();const cn=1024;let ln=0;var un=class{constructor(e,t){this.from=e,this.to=t}},Y=class{constructor(e={}){this.id=ln++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error(`This node type doesn't define a deserialize function`)}),this.combine=e.combine||null}add(e){if(this.perNode)throw RangeError(`Can't add per-node props to node types`);return typeof e!=`function`&&(e=pn.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};Y.closedBy=new Y({deserialize:e=>e.split(` `)}),Y.openedBy=new Y({deserialize:e=>e.split(` `)}),Y.group=new Y({deserialize:e=>e.split(` `)}),Y.isolate=new Y({deserialize:e=>{if(e&&e!=`rtl`&&e!=`ltr`&&e!=`auto`)throw RangeError(`Invalid value for isolate: `+e);return e||`auto`}}),Y.contextHash=new Y({perNode:!0}),Y.lookAhead=new Y({perNode:!0}),Y.mounted=new Y({perNode:!0});var dn=class{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[Y.mounted.id]}};const fn=Object.create(null);var pn=class e{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):fn,r=+!!t.top|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new e(t.name||``,n,t.id,r);if(t.props){for(let e of t.props)if(Array.isArray(e)||(e=e(i)),e){if(e[0].perNode)throw RangeError(`Can't store a per-node prop on a node type`);n[e[0].id]=e[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e==`string`){if(this.name==e)return!0;let t=this.prop(Y.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(` `))t[r]=e[n];return e=>{for(let n=e.prop(Y.group),r=-1;r<(n?n.length:0);r++){let i=t[r<0?e.name:n[r]];if(i)return i}}}};pn.none=new pn(``,Object.create(null),0,8);var mn=class e{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw RangeError(`Node type ids should correspond to array positions when creating a node set`)}extend(...t){let n=[];for(let e of this.types){let r=null;for(let n of t){let t=n(e);if(t){r||=Object.assign({},e.props);let n=t[1],i=t[0];i.combine&&i.id in r&&(n=i.combine(r[i.id],n)),r[i.id]=n}}n.push(r?new pn(e.name,r,e.id,e.flags):e)}return new e(n)}};const hn=/* @__PURE__ */ new WeakMap,gn=/* @__PURE__ */ new WeakMap;var _n;(function(e){e[e.ExcludeBuffers=1]=`ExcludeBuffers`,e[e.IncludeAnonymous=2]=`IncludeAnonymous`,e[e.IgnoreMounts=4]=`IgnoreMounts`,e[e.IgnoreOverlays=8]=`IgnoreOverlays`,e[e.EnterBracketed=16]=`EnterBracketed`})(_n||={});var vn=class e{constructor(e,t,n,r,i){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,i&&i.length){this.props=Object.create(null);for(let[e,t]of i)this.props[typeof e==`number`?e:e.id]=t}}toString(){let e=dn.get(this);if(e&&!e.overlay)return e.tree.toString();let t=``;for(let e of this.children){let n=e.toString();n&&(t&&(t+=`,`),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?`(`+t+`)`:``):t}cursor(e=0){return new Mn(this.topNode,e)}cursorAt(e,t=0,n=0){let r=new Mn(hn.get(this)||this.topNode);return r.moveTo(e,t),hn.set(this,r._tree),r}get topNode(){return new wn(this,0,0,null)}resolve(e,t=0){let n=Sn(hn.get(this)||this.topNode,e,t,!1);return hn.set(this,n),n}resolveInner(e,t=0){let n=Sn(gn.get(this)||this.topNode,e,t,!0);return gn.set(this,n),n}resolveStack(e,t=0){return jn(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:i=this.length}=e,a=e.mode||0,o=(a&_n.IncludeAnonymous)>0;for(let e=this.cursor(a|_n.IncludeAnonymous);;){let a=!1;if(e.from<=i&&e.to>=r&&(!o&&e.type.isAnonymous||t(e)!==!1)){if(e.firstChild())continue;a=!0}for(;a&&n&&(o||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;a=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(t={}){return this.children.length<=8?this:Ln(pn.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new e(this.type,t,n,r,this.propValues),t.makeTree||((t,n,r)=>new e(pn.none,t,n,r)))}static build(e){return Pn(e)}};vn.empty=new vn(pn.none,[],[],0);var yn=class e{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new e(this.buffer,this.index)}},bn=class e{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return pn.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(`,`)}childString(e){let t=this.buffer[e],n=this.buffer[e+3],r=this.set.types[t],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),e+=4,n==e)return i;let a=[];for(;e<n;)a.push(this.childString(e)),e=this.buffer[e+3];return i+`(`+a.join(`,`)+`)`}findChild(e,t,n,r,i){let{buffer:a}=this,o=-1;for(let s=e;s!=t&&!(xn(i,r,a[s+1],a[s+2])&&(o=s,n>0));s=a[s+3]);return o}slice(t,n,r){let i=this.buffer,a=new Uint16Array(n-t),o=0;for(let e=t,s=0;e<n;){a[s++]=i[e++],a[s++]=i[e++]-r;let n=a[s++]=i[e++]-r;a[s++]=i[e++]-t,o=Math.max(o,n)}return new e(a,o,this.set)}};function xn(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function Sn(e,t,n,r){for(;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!r&&e instanceof wn&&e.index<0?null:e.parent;if(!t)return e;e=t}let i=r?0:_n.IgnoreOverlays;if(r)for(let r=e,a=r.parent;a;r=a,a=r.parent)r instanceof wn&&r.index<0&&a.enter(t,n,i)?.from!=r.from&&(e=a);for(;;){let r=e.enter(t,n,i);if(!r)return e;e=r}}var Cn=class{cursor(e=0){return new Mn(this,e)}getChild(e,t=null,n=null){let r=Tn(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return Tn(this,e,t,n)}resolve(e,t=0){return Sn(this,e,t,!1)}resolveInner(e,t=0){return Sn(this,e,t,!0)}matchContext(e){return En(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}},wn=class e extends Cn{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,n,r,i,a=0){for(let o=this;;){for(let{children:s,positions:c}=o._tree,l=n>0?s.length:-1;t!=l;t+=n){let l=s[t],u=c[t]+o.from;if(a&_n.EnterBracketed&&l instanceof vn&&dn.get(l)?.overlay===null&&(u>=r||u+l.length<=r)||xn(i,r,u,u+l.length)){if(l instanceof bn){if(a&_n.ExcludeBuffers)continue;let e=l.findChild(0,l.buffer.length,n,r-u,i);if(e>-1)return new On(new Dn(o,l,t,u),null,e)}else if(a&_n.IncludeAnonymous||!l.type.isAnonymous||Nn(l)){let s;if(!(a&_n.IgnoreMounts)&&(s=dn.get(l))&&!s.overlay)return new e(s.tree,u,t,o);let c=new e(l,u,t,o);return a&_n.IncludeAnonymous||!c.type.isAnonymous?c:c.nextChild(n<0?l.children.length-1:0,n,r,i,a)}}}if(a&_n.IncludeAnonymous||!o.type.isAnonymous||(t=o.index>=0?o.index+n:n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(t,n,r=0){let i;if(!(r&_n.IgnoreOverlays)&&(i=dn.get(this._tree))&&i.overlay){let a=t-this.from,o=r&_n.EnterBracketed&&i.bracketed;for(let{from:t,to:r}of i.overlay)if((n>0||o?t<=a:t<a)&&(n<0||o?r>=a:r>a))return new e(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function Tn(e,t,n,r){let i=e.cursor(),a=[];if(!i.firstChild())return a;if(n!=null){for(let e=!1;!e;)if(e=i.type.is(n),!i.nextSibling())return a}for(;;){if(r!=null&&i.type.is(r))return a;if(i.type.is(t)&&a.push(i.node),!i.nextSibling())return r==null?a:[]}}function En(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}var Dn=class{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}},On=class e extends Cn{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(t,n,r){let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return a<0?null:new e(this.context,this,a)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(t,n,r=0){if(r&_n.ExcludeBuffers)return null;let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return a<0?null:new e(this.context,this,a)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new e(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new e(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,i=n.buffer[this.index+3];if(i>r){let a=n.buffer[this.index+1];e.push(n.slice(r,i,a)),t.push(0)}return new vn(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function kn(e){if(!e.length)return null;let t=0,n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(i.from>n.from||i.to<n.to)&&(n=i,t=r)}let r=n instanceof wn&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new An(i,n)}var An=class{constructor(e,t){this.heads=e,this.node=t}get next(){return kn(this.heads)}};function jn(e,t,n){let r=e.resolveInner(t,n),i=null;for(let e=r instanceof wn?r:r.context.parent;e;e=e.parent)if(e.index<0){let a=e.parent;(i||=[r]).push(a.resolve(t,n)),e=a}else{let a=dn.get(e.tree);if(a&&a.overlay&&a.overlay[0].from<=t&&a.overlay[a.overlay.length-1].to>=t){let o=new wn(a.tree,a.overlay[0].from+e.from,-1,e);(i||=[r]).push(Sn(o,t,n,!1))}}return i?kn(i):r}var Mn=class{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~_n.EnterBracketed,e instanceof wn)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof wn?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&_n.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&_n.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&_n.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(r.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=r)}else({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let r=t+e,i=e<0?-1:n._tree.children.length;r!=i;r+=e){let e=n._tree.children[r];if(this.mode&_n.IncludeAnonymous||e instanceof bn||!e.type.isAnonymous||Nn(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)e:for(let r=this.index,i=this.stack.length;i>=0;){for(let a=e;a;a=a._parent)if(a.index==r){if(r==this.index)return a;t=a,n=i+1;break e}r=this.stack[--i]}for(let e=n;e<this.stack.length;e++)t=new On(this.buffer,t,this.stack[e]);return this.bufferNode=new On(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return En(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,i=this.stack.length-1;r>=0;i--){if(i<0)return En(this._tree,e,r);let a=n[t.buffer[this.stack[i]]];if(!a.isAnonymous){if(e[r]&&e[r]!=a.name)return!1;r--}}return!0}};function Nn(e){return e.children.some(e=>e instanceof bn||!e.type.isAnonymous||Nn(e))}function Pn(e){let{buffer:t,nodeSet:n,maxBufferLength:r=cn,reused:i=[],minRepeatType:a=n.types.length}=e,o=Array.isArray(t)?new yn(t,t.length):t,s=n.types,c=0,l=0;function u(e,t,_,v,y,b){let{id:x,start:S,end:C,size:w}=o,T=l,E=c;if(w<0){if(o.next(),w==-1){let t=i[x];_.push(t),v.push(S-e);return}if(w==-3){c=x;return}if(w==-4){l=x;return}throw RangeError(`Unrecognized record size: ${w}`)}let D=s[x],O,k,ee=S-e;if(C-S<=r&&(k=h(o.pos-t,y))){let t=new Uint16Array(k.size-k.skip),r=o.pos-k.size,i=t.length;for(;o.pos>r;)i=g(k.start,t,i);O=new bn(t,C-k.start,n),ee=k.start-e}else{let e=o.pos-w;o.next();let t=[],n=[],i=x>=a?x:-1,s=0,c=C;for(;o.pos>e;)i>=0&&o.id==i&&o.size>=0?(o.end<=c-r&&(p(t,n,S,s,o.end,c,i,T,E),s=t.length,c=o.end),o.next()):b>2500?d(S,e,t,n):u(S,e,t,n,i,b+1);if(i>=0&&s>0&&s<t.length&&p(t,n,S,s,S,c,i,T,E),t.reverse(),n.reverse(),i>-1&&s>0){let e=f(D,E);O=Ln(D,t,n,0,t.length,0,C-S,e,e)}else O=m(D,t,n,C-S,T-C,E)}_.push(O),v.push(ee)}function d(e,t,i,a){let s=[],c=0,l=-1;for(;o.pos>t;){let{id:e,start:t,end:n,size:i}=o;if(i>4)o.next();else if(l>-1&&t<l)break;else l<0&&(l=n-r),s.push(e,t,n),c++,o.next()}if(c){let t=new Uint16Array(c*4),r=s[s.length-2];for(let e=s.length-3,n=0;e>=0;e-=3)t[n++]=s[e],t[n++]=s[e+1]-r,t[n++]=s[e+2]-r,t[n++]=n;i.push(new bn(t,s[2]-r,n)),a.push(r-e)}}function f(e,t){return(n,r,i)=>{let a=0,o=n.length-1,s,c;if(o>=0&&(s=n[o])instanceof vn){if(!o&&s.type==e&&s.length==i)return s;(c=s.prop(Y.lookAhead))&&(a=r[o]+s.length+c)}return m(e,n,r,i,a,t)}}function p(e,t,r,i,a,o,s,c,l){let u=[],d=[];for(;e.length>i;)u.push(e.pop()),d.push(t.pop()+r-a);e.push(m(n.types[s],u,d,o-a,c-o,l)),t.push(a-r)}function m(e,t,n,r,i,a,o){if(a){let e=[Y.contextHash,a];o=o?[e].concat(o):[e]}if(i>25){let e=[Y.lookAhead,i];o=o?[e].concat(o):[e]}return new vn(e,t,n,r,o)}function h(e,t){let n=o.fork(),i=0,s=0,c=0,l=n.end-r,u={size:0,start:0,skip:0};e:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){u.size=i,u.start=s,u.skip=c,c+=4,i+=4,n.next();continue}let o=n.pos-e;if(e<0||o<r||n.start<l)break;let d=n.id>=a?4:0,f=n.start;for(n.next();n.pos>o;){if(n.size<0){if(n.size==-3||n.size==-4)d+=4;else break e}else n.id>=a&&(d+=4);n.next()}s=f,i+=e,c+=d}return(t<0||i==e)&&(u.size=i,u.start=s,u.skip=c),u.size>4?u:void 0}function g(e,t,n){let{id:r,start:i,end:s,size:u}=o;if(o.next(),u>=0&&r<a){let a=n;if(u>4){let r=o.pos-(u-4);for(;o.pos>r;)n=g(e,t,n)}t[--n]=a,t[--n]=s-e,t[--n]=i-e,t[--n]=r}else u==-3?c=r:u==-4&&(l=r);return n}let _=[],v=[];for(;o.pos>0;)u(e.start||0,e.bufferStart||0,_,v,-1,0);let y=e.length??(_.length?v[0]+_[0].length:0);return new vn(s[e.topID],_.reverse(),v.reverse(),y)}const Fn=/* @__PURE__ */ new WeakMap;function In(e,t){if(!e.isAnonymous||t instanceof bn||t.type!=e)return 1;let n=Fn.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof vn)){n=1;break}n+=In(e,r)}Fn.set(t,n)}return n}function Ln(e,t,n,r,i,a,o,s,c){let l=0;for(let n=r;n<i;n++)l+=In(e,t[n]);let u=Math.ceil(l*1.5/8),d=[],f=[];function p(t,n,r,i,o){for(let s=r;s<i;){let r=s,l=n[s],m=In(e,t[s]);for(s++;s<i;s++){let n=In(e,t[s]);if(m+n>=u)break;m+=n}if(s==r+1){if(m>u){let e=t[r];p(e.children,e.positions,0,e.children.length,n[r]+o);continue}d.push(t[r])}else{let i=n[s-1]+t[s-1].length-l;d.push(Ln(e,t,n,r,s,l,i,null,c))}f.push(l+o-a)}}return p(t,n,r,i,0),(s||c)(d,f,o)}var Rn=class e{constructor(e,t,n,r,i=!1,a=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=!!i|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],r=!1){let i=[new e(0,t.length,t,0,!1,r)];for(let e of n)e.to>t.length&&i.push(e);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],a=1,o=t.length?t[0]:null;for(let s=0,c=0,l=0;;s++){let u=s<n.length?n[s]:null,d=u?u.fromA:1e9;if(d-c>=r)for(;o&&o.from<d;){let n=o;if(c>=n.from||d<=n.to||l){let t=Math.max(n.from,c)-l,r=Math.min(n.to,d)-l;n=t>=r?null:new e(t,r,n.tree,n.offset+l,s>0,!!u)}if(n&&i.push(n),o.to>d)break;o=a<t.length?t[a++]:null}if(!u)break;c=u.toA,l=u.toA-u.toB}return i}},zn=class{startParse(e,t,n){return typeof e==`string`&&(e=new Bn(e)),n=n?n.length?n.map(e=>new un(e.from,e.to)):[new un(0,0)]:[new un(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}},Bn=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}};new Y({perNode:!0});var Vn=class e{constructor(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(t,n){for(let n of t)if(e.isIncremental(n)){let e=Kn(n.range),t=this.offsetAt(e.start),r=this.offsetAt(e.end);this._content=this._content.substring(0,t)+n.text+this._content.substring(r,this._content.length);let i=Math.max(e.start.line,0),a=Math.max(e.end.line,0),o=this._lineOffsets,s=Wn(n.text,!1,t);if(a-i===s.length)for(let e=0,t=s.length;e<t;e++)o[e+i+1]=s[e];else s.length<1e4?o.splice(i+1,a-i,...s):this._lineOffsets=o=o.slice(0,i+1).concat(s,o.slice(a+1));let c=n.text.length-(r-t);if(c!==0)for(let e=i+1+s.length,t=o.length;e<t;e++)o[e]=o[e]+c}else if(e.isFull(n))this._content=n.text,this._lineOffsets=void 0;else throw Error(`Unknown change event received`);this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=Wn(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),n=0,r=t.length;if(r===0)return{line:0,character:e};for(;n<r;){let i=Math.floor((n+r)/2);t[i]>e?r=i:n=i+1}let i=n-1;return e=this.ensureBeforeEOL(e,t[i]),{line:i,character:e-t[i]}}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let n=t[e.line];if(e.character<=0)return n;let r=e.line+1<t.length?t[e.line+1]:this._content.length,i=Math.min(n+e.character,r);return this.ensureBeforeEOL(i,n)}ensureBeforeEOL(e,t){for(;e>t&&Gn(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let t=e;return t!=null&&typeof t.text==`string`&&t.range!==void 0&&(t.rangeLength===void 0||typeof t.rangeLength==`number`)}static isFull(e){let t=e;return t!=null&&typeof t.text==`string`&&t.range===void 0&&t.rangeLength===void 0}},Hn;(function(e){e.create=function(e,t,n,r){return new Vn(e,t,n,r)},e.update=function(e,t,n){if(e instanceof Vn)return e.update(t,n),e;throw Error(`TextDocument.update: document must be created by TextDocument.create`)},e.applyEdits=function(e,t){let n=e.getText(),r=Un(t.map(qn),(e,t)=>{let n=e.range.start.line-t.range.start.line;return n===0?e.range.start.character-t.range.start.character:n}),i=0,a=[];for(let t of r){let r=e.offsetAt(t.range.start);if(r<i)throw Error(`Overlapping edit`);r>i&&a.push(n.substring(i,r)),t.newText.length&&a.push(t.newText),i=e.offsetAt(t.range.end)}return a.push(n.substr(i)),a.join(``)}})(Hn||={});function Un(e,t){if(e.length<=1)return e;let n=e.length/2|0,r=e.slice(0,n),i=e.slice(n);Un(r,t),Un(i,t);let a=0,o=0,s=0;for(;a<r.length&&o<i.length;)t(r[a],i[o])<=0?e[s++]=r[a++]:e[s++]=i[o++];for(;a<r.length;)e[s++]=r[a++];for(;o<i.length;)e[s++]=i[o++];return e}function Wn(e,t,n=0){let r=t?[n]:[];for(let t=0;t<e.length;t++){let i=e.charCodeAt(t);Gn(i)&&(i===13&&t+1<e.length&&e.charCodeAt(t+1)===10&&t++,r.push(n+t+1))}return r}function Gn(e){return e===13||e===10}function Kn(e){let t=e.start,n=e.end;return t.line>n.line||t.line===n.line&&t.character>n.character?{start:n,end:t}:e}function qn(e){let t=Kn(e.range);return t===e.range?e:{newText:e.newText,range:t}}dt();var Jn=class e{constructor(e,t,n,r,i,a,o,s,c,l=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=a,this.buffer=o,this.bufferBase=s,this.curContext=c,this.lookAhead=l,this.parent=u}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?`!`+this.score:``}`}static start(t,n,r=0){let i=t.parser.context;return new e(t,[],n,r,r,0,[],0,i?new Yn(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,n=e&65535,{parser:r}=this.p,i=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=r.dynamicPrecedence(n);if(a&&(this.score+=a),t==0){n<r.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(r.getGoto(this.state,n,!0),this.reducePos),n<r.minRepeatTerm&&this.storeNode(n,this.reducePos,this.reducePos,i?8:4,!0),this.reduceContext(n,this.reducePos);return}let o=this.stack.length-(t-1)*3-(e&262144?6:0),s=o?this.stack[o-2]:this.p.ranges[0].from;n<r.minRepeatTerm&&s==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let c=this.reducePos-s;c>=2e3&&!this.p.parser.nodeSet.types[n]?.isAnonymous&&(s==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=s,this.p.lastBigReductionSize=c));let l=o?this.stack[o-1]:0,u=this.bufferBase+this.buffer.length-l;if(n<r.minRepeatTerm||e&131072){let e=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(n,s,e,u+4,!0)}if(e&262144)this.state=this.stack[o];else{let e=this.stack[o-3];this.state=r.getGoto(e,n,!0)}for(;this.stack.length>o;)this.stack.pop();this.reduceContext(n,s)}storeNode(e,t,n,r=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this.buffer.length;if(e>0&&this.buffer[e-4]==0&&this.buffer[e-1]>-1){if(t==n)return;if(this.buffer[e-2]>=t){this.buffer[e-2]=n;return}}}if(!i||this.pos==n)this.buffer.push(e,t,n,r);else{let i=this.buffer.length;if(i>0&&(this.buffer[i-4]!=0||this.buffer[i-1]<0)){let e=!1;for(let t=i;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let i=e,{parser:a}=this.p;this.pos=r;let o=a.stateFlag(i,1);!o&&(r>n||t<=a.maxNode)&&(this.reducePos=r),this.pushState(i,o?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=a.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.reducePos=this.pos=n+e.length;this.pushState(t,n),this.buffer.push(r,n,i,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new e(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new Xn(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let r=0,i;r<t.length;r+=2)(i=t[r+1])!=this.state&&this.p.parser.hasAction(i,e)&&n.push(t[r],i);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let r=t[e+1];n.some((e,t)=>t&1&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let r=t[e+1];if(r==this.state)continue;let i=this.split();i.pushState(r,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(t[e],this.pos),i.reducePos=this.pos,i.score-=200,n.push(i)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(t&65536))return!1;if(!e.validAction(this.state,t)){let n=t>>19,r=t&65535,i=this.stack.length-n*3;if(i<0||e.getGoto(this.stack[i],r,!1)<0){let e=this.findForcedReduction();if(e==null)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,i)=>{if(!t.includes(r))return t.push(r),e.allActions(r,t=>{if(!(t&393216)){if(t&65536){let n=(t>>19)-i;if(n>1){let r=t&65535,i=this.stack.length-n*3;if(i>=0&&e.getGoto(this.stack[i],r,!1)>=0)return n<<19|65536|r}}else{let e=n(t,i+1);if(e!=null)return e}}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.storeNode(this.curContext.hash,this.reducePos,this.reducePos,-3,!0)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new Yn(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},Yn=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},Xn=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}},Zn=class e{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new e(t,n,n-t.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new e(this.stack,this.pos,this.index)}};function Qn(e,t=Uint16Array){if(typeof e!=`string`)return e;let n=null;for(let r=0,i=0;r<e.length;){let a=0;for(;;){let t=e.charCodeAt(r++),n=!1;if(t==126){a=65535;break}t>=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),a+=i,n)break;a*=46}n?n[i++]=a:n=new t(a)}return n}var $n=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}};const er=new $n;var tr=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk=``,this.chunkOff=0,this.chunk2=``,this.chunk2Pos=0,this.next=-1,this.token=er,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,i=this.pos+e;for(;i<n.from;){if(!r)return null;let e=this.ranges[--r];i-=n.from-e.to,n=e}for(;t<0?i>n.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t<this.chunk.length)n=this.pos+e,r=this.chunk.charCodeAt(t);else{let t=this.resolveOffset(e,1);if(t==null)return-1;if(n=t,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let e=this.rangeIndex,t=this.range;for(;t.to<=n;)t=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>t.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n<this.token.start)throw RangeError(`Token end out of bounds`);this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.next=this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?-1:this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk=``,this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=er,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk=``,this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n=``;for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}},nr=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;ar(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};nr.prototype.contextual=nr.prototype.fallback=nr.prototype.extend=!1;var rr=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e==`string`?Qn(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(ar(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(n||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}};rr.prototype.contextual=nr.prototype.fallback=nr.prototype.extend=!1;var ir=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};function ar(e,t,n,r,i,a){let o=0,s=1<<r,{dialect:c}=n.p.parser;e:for(;(s&e[o])!=0;){let n=e[o+1];for(let r=o+3;r<n;r+=2)if((e[r+1]&s)>0){let n=e[r];if(c.allows(n)&&(t.token.value==-1||t.token.value==n||sr(n,t.token.value,i,a))){t.acceptToken(n);break}}let r=t.next,l=0,u=e[o+2];if(t.next<0&&u>l&&e[n+u*3-3]==65535)o=e[n+u*3-1];else{for(;l<u;){let i=l+u>>1,a=n+i+(i<<1),s=e[a],c=e[a+1]||65536;if(r<s)u=i;else if(r>=c)l=i+1;else{o=e[a+2],t.advance();continue e}}break}}}function or(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function sr(e,t,n,r){let i=or(n,r,t);return i<0||or(n,r,e)<i}const cr=typeof process<`u`&&process.env&&/\bparse\b/.test(process.env.LOG);let lr=null;function ur(e,t,n){let r=e.cursor(_n.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}var dr=class{constructor(e,t){this.fragments=e,this.minRepeat=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.lastRepeat=null,this.lastRepeatPos=-1,this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?ur(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?ur(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;if(e<this.safeFrom)return null;let n=this.trees[t],r=this.index[t];if(r==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=n.children[r],a=this.start[t]+n.positions[r];if(a>e)return this.nextStart=a,null;if(i instanceof vn){let n=a>this.lastRepeatPos&&i.type.id>=this.minRepeat;if(a==e||n){let t=a+i.length,r;if(a>=this.safeFrom&&t<=this.safeTo&&(!(r=i.prop(Y.lookAhead))||t+r<this.fragment.to)&&(n&&(this.lastRepeat=i,this.lastRepeatPos=a),a==e))return i}this.index[t]++,a+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(a),this.index.push(0))}else this.index[t]++,this.nextStart=a+i.length}}},fr=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new $n)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,a=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,s=0;for(let r=0;r<i.length;r++){if(!(1<<r&a))continue;let c=i[r],l=this.tokens[r];if((!n||c.fallback)&&((c.contextual||l.start!=e.pos||l.mask!=a||l.context!=o)&&(this.updateCachedToken(l,c,e),l.mask=a,l.context=o),l.lookAhead>l.end+25&&(s=Math.max(l.lookAhead,s)),l.value!=0)){let r=t;if(l.extended>-1&&(t=this.addActions(e,l.extended,l.end,t)),t=this.addActions(e,l.value,l.end,t),!c.extend&&(n=l,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return s&&e.setLookAhead(s),!n&&e.pos==this.stream.end&&(n=new $n,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new $n,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r<t.specialized.length;r++)if(t.specialized[r]==e.value){let i=t.specializers[r](this.stream.read(e.start,e.end),n);if(i>=0&&n.p.parser.dialect.allows(i>>1)){i&1?e.extended=i>>1:e.value=i>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;t<r;t+=3)if(this.actions[t]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:i}=e,{parser:a}=e.p,{data:o}=a;for(let e=0;e<2;e++)for(let s=a.stateSlot(i,e?2:1);;s+=3){if(o[s]==65535){if(o[s+1]==1)s=yr(o,s+2);else{r==0&&o[s+1]==2&&(r=this.putAction(yr(o,s+2),t,n,r));break}}o[s]==t&&(r=this.putAction(yr(o,s+1),t,n,r))}return r}},pr=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new tr(t,r),this.tokens=new fr(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[Jn.start(this,e.top[0],i)],this.fragments=n.length&&this.stream.end-i>e.bufferLength*4?new dr(n,e.minRepeatTerm):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,i;if(this.bigReductionCount>300&&e.length==1){let[t]=e;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let o=e[a];for(;;){if(this.tokens.mainToken=null,o.pos>t)n.push(o);else if(this.advanceStack(o,n,e))continue;else{r||(r=[],i=[]),r.push(o);let e=this.tokens.getMainToken(o);i.push(e.value,e.end)}break}}if(!n.length){let e=r&&br(r);if(e)return cr&&console.log(`Finish with `+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw cr&&r&&console.log(`Stuck with token `+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):`none`)),SyntaxError(`No parse at `+t);this.recovering||=5}if(this.recovering&&r){let e=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,i,n);if(e)return cr&&console.log(`Force-finish `+this.stackID(e)),this.stackToTree(e.forceAll())}if(this.recovering){let e=this.recovering==1?1:this.recovering*3;if(n.length>e)for(n.sort((e,t)=>t.score-e.score);n.length>e;)n.pop();n.some(e=>e.reducePos>t)&&this.recovering--}else if(n.length>1){e:for(let e=0;e<n.length-1;e++){let t=n[e];for(let r=e+1;r<n.length;r++){let i=n[r];if(t.sameState(i)||t.buffer.length>500&&i.buffer.length>500){if((t.score-i.score||t.buffer.length-i.buffer.length)>0)n.splice(r--,1);else{n.splice(e--,1);continue e}}}}n.length>12&&(n.sort((e,t)=>t.score-e.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let e=1;e<n.length;e++)n[e].pos<this.minStackPos&&(this.minStackPos=n[e].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}tryReuse(e,t,n,r){if(!n)return null;let i=e.curContext&&e.curContext.tracker.strict,a=i?e.curContext.hash:0;for(;n;){let o=this.parser.nodeSet.types[n.type.id]==n.type?this.parser.getGoto(e.state,n.type.id):-1;if(o>-1&&n.length&&(!i||(n.prop(Y.contextHash)||0)==a))return e.useNode(n,o,t),n;if(n.children.length==0||n.positions[0]>0)break;let s=n.children[0];if(s instanceof vn&&(!r||s.type.id>=this.parser.minRepeatTerm))n=s;else break}return null}advanceStack(e,t,n){let r=e.pos,{parser:i}=this,a=cr?this.stackID(e)+` -> `:``;if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.reducePos<r&&e.buffer.length&&e.buffer[e.buffer.length-2]<=e.reducePos&&this.fragments.lastRepeatPos==e.reducePos&&this.tryReuse(e,e.reducePos,this.fragments.lastRepeat,!0)||this.tryReuse(e,r,this.fragments.nodeAt(r),!1);if(t)return cr&&console.log(a+this.stackID(e)+` (via reuse of ${i.getName(t.type.id)})`),!0}let o=i.stateSlot(e.state,4);if(o>0)return e.reduce(o),cr&&console.log(a+this.stackID(e)+` (via always-reduce ${i.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let o=0;o<s.length;){let c=s[o++],l=s[o++],u=s[o++],d=o==s.length||!n,f=d?e:e.split(),p=this.tokens.mainToken;if(f.apply(c,l,p?p.start:f.pos,u),cr&&console.log(a+this.stackID(f)+` (via ${c&65536?`reduce of ${i.getName(c&65535)}`:`shift`} for ${i.getName(l)} @ ${r}${f==e?``:`, split`})`),d)return!0;f.pos>r?t.push(f):n.push(f)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return mr(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let a=0;a<e.length;a++){let o=e[a],s=t[a<<1],c=t[(a<<1)+1],l=cr?this.stackID(o)+` -> `:``;if(o.deadEnd&&(i||(i=!0,o.restart(),cr&&console.log(l+this.stackID(o)+` (restarted)`),this.advanceFully(o,n))))continue;let u=o.split(),d=l;for(let e=0;e<10&&u.forceReduce()&&(cr&&console.log(d+this.stackID(u)+` (via force-reduce)`),!this.advanceFully(u,n));e++)cr&&(d=this.stackID(u)+` -> `);for(let e of o.recoverByInsert(s))cr&&console.log(l+this.stackID(e)+` (via recover-insert)`),this.advanceFully(e,n);this.stream.end>o.pos?(c==o.pos&&(c++,s=0),o.recoverByDelete(s,c),cr&&console.log(l+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),mr(o,n)):(!r||r.score<u.score)&&(r=u)}return r}stackToTree(e){return e.close(),vn.build({buffer:Zn.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(lr||=/* @__PURE__ */ new WeakMap).get(e);return t||lr.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}};function mr(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}var hr=class{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}};const gr=e=>e;var _r=class{constructor(e){this.start=e.start,this.shift=e.shift||gr,this.reduce=e.reduce||gr,this.reuse=e.reuse||gr,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},vr=class e extends zn{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(` `);this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push(``);let n=Object.keys(e.topRules).map(t=>e.topRules[t][1]),r=[];for(let e=0;e<t.length;e++)r.push([]);function i(e,t,n){r[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];typeof e==`string`&&(e=Y[e]);for(let n=1;n<t.length;){let r=t[n++];if(r>=0)i(r,e,t[n++]);else{let a=t[n+-r];for(let o=-r;o>0;o--)i(t[n++],e,a);n++}}}this.nodeSet=new mn(t.map((t,i)=>pn.define({name:i>=this.minRepeatTerm?void 0:t,id:i,props:r[i],top:n.indexOf(i)>-1,error:i==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(i)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=cn;let a=Qn(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(xr),this.states=Qn(e.states,Uint32Array),this.data=Qn(e.stateData),this.goto=Qn(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>typeof e==`number`?new nr(a,e):e),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new pr(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let i=r[t+1];;){let t=r[i++],a=t&1,o=r[i++];if(a&&n)return o;for(let n=i+(t>>1);i<n;i++)if(r[i]==e)return o;if(a)return-1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let i=this.stateSlot(e,r?2:1),a;;i+=3){if((a=n[i])==65535){if(n[i+1]==1)a=n[i=yr(n,i+2)];else if(n[i+1]==2)return yr(n,i+2);else break}if(a==t||a==0)return yr(n,i+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t||null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);r==null;n+=3){if(this.data[n]==65535){if(this.data[n+1]==1)n=yr(this.data,n+2);else break}r=t(yr(this.data,n+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535){if(this.data[n+1]==1)n=yr(this.data,n+2);else break}if(!(this.data[n+2]&1)){let e=this.data[n+1];t.some((t,n)=>n&1&&t==e)||t.push(this.data[n],e)}}return t}configure(t){let n=Object.assign(Object.create(e.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let e=this.topRules[t.top];if(!e)throw RangeError(`Invalid top rule name ${t.top}`);n.top=e}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(e=>{let n=t.tokenizers.find(t=>t.from==e);return n?n.to:e})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((e,r)=>{let i=t.specializers.find(t=>t.from==e.external);if(!i)return e;let a=Object.assign(Object.assign({},e),{external:i.to});return n.specializers[r]=xr(a),a})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let r of e.split(` `)){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],i;(i=this.data[n++])!=65535;)(r||=new Uint8Array(this.maxTerm+1))[i]=1;return new hr(e,n,r)}static deserialize(t){return new e(t)}};function yr(e,t){return e[t]|e[t+1]<<16}function br(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||e!=null&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}function xr(e){if(e.external){let t=+!!e.extend;return(n,r)=>e.external(n,r)<<1|t}return e.get}let Sr=0;var Cr=class e{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=Sr++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(t,n){let r=typeof t==`string`?t:`?`;if(t instanceof e&&(n=t),n?.base)throw Error(`Can not derive from a modified tag`);let i=new e(r,[],null,[]);if(i.set.push(i),n)for(let e of n.set)i.set.push(e);return i}static defineModifier(e){let t=new Tr(e);return e=>e.modified.indexOf(t)>-1?e:Tr.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}};let wr=0;var Tr=class e{constructor(e){this.name=e,this.instances=[],this.id=wr++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(e=>e.base==t&&Er(n,e.modified));if(r)return r;let i=[],a=new Cr(t.name,i,t,n);for(let e of n)e.instances.push(a);let o=Dr(n);for(let n of t.set)if(!n.modified.length)for(let t of o)i.push(e.get(n,t));return a}};function Er(e,t){return e.length==t.length&&e.every((e,n)=>e==t[n])}function Dr(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}function Or(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let e of n.split(` `))if(e){let n=[],i=2,a=e;for(let t=0;;){if(a==`...`&&t>0&&t+3==e.length){i=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!r)throw RangeError(`Invalid path: `+e);if(n.push(r[0]==`*`?``:r[0][0]==`"`?JSON.parse(r[0]):r[0]),t+=r[0].length,t==e.length)break;let o=e[t++];if(t==e.length&&o==`!`){i=0;break}if(o!=`/`)throw RangeError(`Invalid path: `+e);a=e.slice(t)}let o=n.length-1,s=n[o];if(!s)throw RangeError(`Invalid path: `+e);t[s]=new Ar(r,i,o>0?n.slice(0,o):null).sort(t[s])}}return kr.add(t)}const kr=new Y({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth<=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let a=new Ar(i.tags,i.mode,i.context);n?n.next=a:r=a,n=a}return r}});var Ar=class{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}};Ar.empty=new Ar([],2,null);function jr(e,t){let n=Object.create(null);for(let t of e)if(!Array.isArray(t.tag))n[t.tag.id]=t.class;else for(let e of t.tag)n[e.id]=t.class;let{scope:r,all:i=null}=t||{};return{style:e=>{let t=i;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+` `+r:r;break}}return t},scope:r}}const X=Cr.define,Mr=X(),Nr=X(),Pr=X(Nr),Fr=X(Nr),Ir=X(),Lr=X(Ir),Rr=X(Ir),zr=X(),Br=X(zr),Vr=X(),Hr=X(),Ur=X(),Wr=X(Ur),Gr=X(),Z={comment:Mr,lineComment:X(Mr),blockComment:X(Mr),docComment:X(Mr),name:Nr,variableName:X(Nr),typeName:Pr,tagName:X(Pr),propertyName:Fr,attributeName:X(Fr),className:X(Nr),labelName:X(Nr),namespace:X(Nr),macroName:X(Nr),literal:Ir,string:Lr,docString:X(Lr),character:X(Lr),attributeValue:X(Lr),number:Rr,integer:X(Rr),float:X(Rr),bool:X(Ir),regexp:X(Ir),escape:X(Ir),color:X(Ir),url:X(Ir),keyword:Vr,self:X(Vr),null:X(Vr),atom:X(Vr),unit:X(Vr),modifier:X(Vr),operatorKeyword:X(Vr),controlKeyword:X(Vr),definitionKeyword:X(Vr),moduleKeyword:X(Vr),operator:Hr,derefOperator:X(Hr),arithmeticOperator:X(Hr),logicOperator:X(Hr),bitwiseOperator:X(Hr),compareOperator:X(Hr),updateOperator:X(Hr),definitionOperator:X(Hr),typeOperator:X(Hr),controlOperator:X(Hr),punctuation:Ur,separator:X(Ur),bracket:Wr,angleBracket:X(Wr),squareBracket:X(Wr),paren:X(Wr),brace:X(Wr),content:zr,heading:Br,heading1:X(Br),heading2:X(Br),heading3:X(Br),heading4:X(Br),heading5:X(Br),heading6:X(Br),contentSeparator:X(zr),list:X(zr),quote:X(zr),emphasis:X(zr),strong:X(zr),link:X(zr),monospace:X(zr),strikethrough:X(zr),inserted:X(),deleted:X(),changed:X(),invalid:X(),meta:Gr,documentMeta:X(Gr),annotation:X(Gr),processingInstruction:X(Gr),definition:Cr.defineModifier(`definition`),constant:Cr.defineModifier(`constant`),function:Cr.defineModifier(`function`),standard:Cr.defineModifier(`standard`),local:Cr.defineModifier(`local`),special:Cr.defineModifier(`special`)};for(let e in Z){let t=Z[e];t instanceof Cr&&(t.name=e)}jr([{tag:Z.link,class:`tok-link`},{tag:Z.heading,class:`tok-heading`},{tag:Z.emphasis,class:`tok-emphasis`},{tag:Z.strong,class:`tok-strong`},{tag:Z.keyword,class:`tok-keyword`},{tag:Z.atom,class:`tok-atom`},{tag:Z.bool,class:`tok-bool`},{tag:Z.url,class:`tok-url`},{tag:Z.labelName,class:`tok-labelName`},{tag:Z.inserted,class:`tok-inserted`},{tag:Z.deleted,class:`tok-deleted`},{tag:Z.literal,class:`tok-literal`},{tag:Z.string,class:`tok-string`},{tag:Z.number,class:`tok-number`},{tag:[Z.regexp,Z.escape,Z.special(Z.string)],class:`tok-string2`},{tag:Z.variableName,class:`tok-variableName`},{tag:Z.local(Z.variableName),class:`tok-variableName tok-local`},{tag:Z.definition(Z.variableName),class:`tok-variableName tok-definition`},{tag:Z.special(Z.variableName),class:`tok-variableName2`},{tag:Z.definition(Z.propertyName),class:`tok-propertyName tok-definition`},{tag:Z.typeName,class:`tok-typeName`},{tag:Z.namespace,class:`tok-namespace`},{tag:Z.className,class:`tok-className`},{tag:Z.macroName,class:`tok-macroName`},{tag:Z.propertyName,class:`tok-propertyName`},{tag:Z.operator,class:`tok-operator`},{tag:Z.comment,class:`tok-comment`},{tag:Z.meta,class:`tok-meta`},{tag:Z.invalid,class:`tok-invalid`},{tag:Z.punctuation,class:`tok-punctuation`}]);function Kr(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function qr(e){return e==9||e==10||e==13||e==32}let Jr=null,Yr=null,Xr=0;function Zr(e,t){let n=e.pos+t;if(Yr==e&&Xr==n)return Jr;for(;qr(e.peek(t));)t++;let r=``;for(;;){let n=e.peek(t);if(!Kr(n))break;r+=String.fromCharCode(n),t++}return Yr=e,Xr=n,Jr=r||null}function Qr(e,t){this.name=e,this.parent=t}const $r=new _r({start:null,shift(e,t,n,r){return t==1?new Qr(Zr(r,1)||``,e):e},reduce(e,t){return t==11&&e?e.parent:e},reuse(e,t,n,r){let i=t.type.id;return i==1||i==13?new Qr(Zr(r,1)||``,e):e},strict:!1}),ei=new ir((e,t)=>{if(e.next==60){if(e.advance(),e.next==47){e.advance();let n=Zr(e,0);if(!n)return e.acceptToken(5);if(t.context&&n==t.context.name)return e.acceptToken(2);for(let r=t.context;r;r=r.parent)if(r.name==n)return e.acceptToken(3,-2);e.acceptToken(4)}else if(e.next!=33&&e.next!=63)return e.acceptToken(1)}},{contextual:!0});function ti(e,t){return new ir(n=>{let r=0,i=t.charCodeAt(0);e:for(;!(n.next<0);n.advance(),r++)if(n.next==i){for(let e=1;e<t.length;e++)if(n.peek(e)!=t.charCodeAt(e))continue e;break}r&&n.acceptToken(e)})}const ni=ti(36,`-->`),ri=ti(37,`?>`),ii=ti(38,`]]>`),ai=Or({Text:Z.content,"StartTag StartCloseTag EndTag SelfCloseEndTag":Z.angleBracket,TagName:Z.tagName,"MismatchedCloseTag/TagName":[Z.tagName,Z.invalid],AttributeName:Z.attributeName,AttributeValue:Z.attributeValue,Is:Z.definitionOperator,"EntityReference CharacterReference":Z.character,Comment:Z.blockComment,ProcessingInst:Z.processingInstruction,DoctypeDecl:Z.documentMeta,Cdata:Z.special(Z.string)}),oi=vr.deserialize({version:14,states:",lOQOaOOOrOxO'#CfOzOpO'#CiO!tOaO'#CgOOOP'#Cg'#CgO!{OrO'#CrO#TOtO'#CsO#]OpO'#CtOOOP'#DT'#DTOOOP'#Cv'#CvQQOaOOOOOW'#Cw'#CwO#eOxO,59QOOOP,59Q,59QOOOO'#Cx'#CxO#mOpO,59TO#uO!bO,59TOOOP'#C|'#C|O$TOaO,59RO$[OpO'#CoOOOP,59R,59ROOOQ'#C}'#C}O$dOrO,59^OOOP,59^,59^OOOS'#DO'#DOO$lOtO,59_OOOP,59_,59_O$tOpO,59`O$|OpO,59`OOOP-E6t-E6tOOOW-E6u-E6uOOOP1G.l1G.lOOOO-E6v-E6vO%UO!bO1G.oO%UO!bO1G.oO%dOpO'#CkO%lO!bO'#CyO%zO!bO1G.oOOOP1G.o1G.oOOOP1G.w1G.wOOOP-E6z-E6zOOOP1G.m1G.mO&VOpO,59ZO&_OpO,59ZOOOQ-E6{-E6{OOOP1G.x1G.xOOOS-E6|-E6|OOOP1G.y1G.yO&gOpO1G.zO&gOpO1G.zOOOP1G.z1G.zO&oO!bO7+$ZO&}O!bO7+$ZOOOP7+$Z7+$ZOOOP7+$c7+$cO'YOpO,59VO'bOpO,59VO'mO!bO,59eOOOO-E6w-E6wO'{OpO1G.uO'{OpO1G.uOOOP1G.u1G.uO(TOpO7+$fOOOP7+$f7+$fO(]O!bO<<GuOOOP<<Gu<<GuOOOP<<G}<<G}O'bOpO1G.qO'bOpO1G.qO(hO#tO'#CnO(vO&jO'#CnOOOO1G.q1G.qO)UOpO7+$aOOOP7+$a7+$aOOOP<<HQ<<HQOOOPAN=aAN=aOOOPAN=iAN=iO'bOpO7+$]OOOO7+$]7+$]OOOO'#Cz'#CzO)^O#tO,59YOOOO,59Y,59YOOOO'#C{'#C{O)lO&jO,59YOOOP<<G{<<G{OOOO<<Gw<<GwOOOO-E6x-E6xOOOO1G.t1G.tOOOO-E6y-E6y",stateData:")z~OPQOSVOTWOVWOWWOXWOiXOyPO!QTO!SUO~OvZOx]O~O^`Oz^O~OPQOQcOSVOTWOVWOWWOXWOyPO!QTO!SUO~ORdO~P!SOteO!PgO~OuhO!RjO~O^lOz^O~OvZOxoO~O^qOz^O~O[vO`sOdwOz^O~ORyO~P!SO^{Oz^O~OteO!P}O~OuhO!R!PO~O^!QOz^O~O[!SOz^O~O[!VO`sOd!WOz^O~Oa!YOz^O~Oz^O[mX`mXdmX~O[!VO`sOd!WO~O^!]Oz^O~O[!_Oz^O~O[!aOz^O~O[!cO`sOd!dOz^O~O[!cO`sOd!dO~Oa!eOz^O~Oz^O{!gO}!hO~Oz^O[ma`madma~O[!kOz^O~O[!lOz^O~O[!mO`sOd!nO~OW!qOX!qO{!sO|!qO~OW!tOX!tO}!sO!O!tO~O[!vOz^O~OW!qOX!qO{!yO|!qO~OW!tOX!tO}!yO!O!tO~O",goto:"%cxPPPPPPPPPPyyP!PP!VPP!`!jP!pyyyP!v!|#S$[$k$q$w$}%TPPPP%ZXWORYbXRORYb_t`qru!T!U!bQ!i!YS!p!e!fR!w!oQdRRybXSORYbQYORmYQ[PRn[Q_QQkVjp_krz!R!T!X!Z!^!`!f!j!oQr`QzcQ!RlQ!TqQ!XsQ!ZtQ!^{Q!`!QQ!f!YQ!j!]R!o!eQu`S!UqrU![u!U!bR!b!TQ!r!gR!x!rQ!u!hR!z!uQbRRxbQfTR|fQiUR!OiSXOYTaRb",nodeNames:`⚠ StartTag StartCloseTag MissingCloseTag StartCloseTag StartCloseTag Document Text EntityReference CharacterReference Cdata Element EndTag OpenTag TagName Attribute AttributeName Is AttributeValue CloseTag SelfCloseEndTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag DoctypeDecl`,maxTerm:50,context:$r,nodeProps:[[`closedBy`,1,`SelfCloseEndTag EndTag`,13,`CloseTag MissingCloseTag`],[`openedBy`,12,`StartTag StartCloseTag`,19,`OpenTag`,20,`StartTag`],[`isolate`,-6,13,18,19,21,22,24,``]],propSources:[ai],skippedNodes:[0],repeatNodeCount:9,tokenData:"!)v~R!YOX$qXY)iYZ)iZ]$q]^)i^p$qpq)iqr$qrs*vsv$qvw+fwx/ix}$q}!O0[!O!P$q!P!Q2z!Q![$q![!]4n!]!^$q!^!_8U!_!`!#t!`!a!$l!a!b!%d!b!c$q!c!}4n!}#P$q#P#Q!'W#Q#R$q#R#S4n#S#T$q#T#o4n#o%W$q%W%o4n%o%p$q%p&a4n&a&b$q&b1p4n1p4U$q4U4d4n4d4e$q4e$IS4n$IS$I`$q$I`$Ib4n$Ib$Kh$q$Kh%#t4n%#t&/x$q&/x&Et4n&Et&FV$q&FV;'S4n;'S;:j8O;:j;=`)c<%l?&r$q?&r?Ah4n?Ah?BY$q?BY?Mn4n?MnO$qi$zXVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qa%nVVP!O`Ov%gwx&Tx!^%g!^!_&o!_;'S%g;'S;=`'W<%lO%gP&YTVPOv&Tw!^&T!_;'S&T;'S;=`&i<%lO&TP&lP;=`<%l&T`&tS!O`Ov&ox;'S&o;'S;=`'Q<%lO&o`'TP;=`<%l&oa'ZP;=`<%l%gX'eWVP|WOr'^rs&Tsv'^w!^'^!^!_'}!_;'S'^;'S;=`(i<%lO'^W(ST|WOr'}sv'}w;'S'};'S;=`(c<%lO'}W(fP;=`<%l'}X(lP;=`<%l'^h(vV|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(oh)`P;=`<%l(oi)fP;=`<%l$qo)t`VP|W!O`zUOX$qXY)iYZ)iZ]$q]^)i^p$qpq)iqr$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk+PV{YVP!O`Ov%gwx&Tx!^%g!^!_&o!_;'S%g;'S;=`'W<%lO%g~+iast,n![!]-r!c!}-r#R#S-r#T#o-r%W%o-r%p&a-r&b1p-r4U4d-r4e$IS-r$I`$Ib-r$Kh%#t-r&/x&Et-r&FV;'S-r;'S;:j/c?&r?Ah-r?BY?Mn-r~,qQ!Q![,w#l#m-V~,zQ!Q![,w!]!^-Q~-VOX~~-YR!Q![-c!c!i-c#T#Z-c~-fS!Q![-c!]!^-Q!c!i-c#T#Z-c~-ug}!O-r!O!P-r!Q![-r![!]-r!]!^/^!c!}-r#R#S-r#T#o-r$}%O-r%W%o-r%p&a-r&b1p-r1p4U-r4U4d-r4e$IS-r$I`$Ib-r$Je$Jg-r$Kh%#t-r&/x&Et-r&FV;'S-r;'S;:j/c?&r?Ah-r?BY?Mn-r~/cOW~~/fP;=`<%l-rk/rW}bVP|WOr'^rs&Tsv'^w!^'^!^!_'}!_;'S'^;'S;=`(i<%lO'^k0eZVP|W!O`Or$qrs%gsv$qwx'^x}$q}!O1W!O!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk1aZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a2S!a;'S$q;'S;=`)c<%lO$qk2_X!PQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qm3TZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a3v!a;'S$q;'S;=`)c<%lO$qm4RXdSVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qo4{!P`S^QVP|W!O`Or$qrs%gsv$qwx'^x}$q}!O4n!O!P4n!P!Q$q!Q![4n![!]4n!]!^$q!^!_(o!_!c$q!c!}4n!}#R$q#R#S4n#S#T$q#T#o4n#o$}$q$}%O4n%O%W$q%W%o4n%o%p$q%p&a4n&a&b$q&b1p4n1p4U4n4U4d4n4d4e$q4e$IS4n$IS$I`$q$I`$Ib4n$Ib$Je$q$Je$Jg4n$Jg$Kh$q$Kh%#t4n%#t&/x$q&/x&Et4n&Et&FV$q&FV;'S4n;'S;:j8O;:j;=`)c<%l?&r$q?&r?Ah4n?Ah?BY$q?BY?Mn4n?MnO$qo8RP;=`<%l4ni8]Y|W!O`Oq(oqr8{rs&osv(owx'}x!a(o!a!b!#U!b;'S(o;'S;=`)]<%lO(oi9S_|W!O`Or(ors&osv(owx'}x}(o}!O:R!O!f(o!f!g;e!g!}(o!}#ODh#O#W(o#W#XLp#X;'S(o;'S;=`)]<%lO(oi:YX|W!O`Or(ors&osv(owx'}x}(o}!O:u!O;'S(o;'S;=`)]<%lO(oi;OV!QP|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(oi;lX|W!O`Or(ors&osv(owx'}x!q(o!q!r<X!r;'S(o;'S;=`)]<%lO(oi<`X|W!O`Or(ors&osv(owx'}x!e(o!e!f<{!f;'S(o;'S;=`)]<%lO(oi=SX|W!O`Or(ors&osv(owx'}x!v(o!v!w=o!w;'S(o;'S;=`)]<%lO(oi=vX|W!O`Or(ors&osv(owx'}x!{(o!{!|>c!|;'S(o;'S;=`)]<%lO(oi>jX|W!O`Or(ors&osv(owx'}x!r(o!r!s?V!s;'S(o;'S;=`)]<%lO(oi?^X|W!O`Or(ors&osv(owx'}x!g(o!g!h?y!h;'S(o;'S;=`)]<%lO(oi@QY|W!O`Or?yrs@psv?yvwA[wxBdx!`?y!`!aCr!a;'S?y;'S;=`Db<%lO?ya@uV!O`Ov@pvxA[x!`@p!`!aAy!a;'S@p;'S;=`B^<%lO@pPA_TO!`A[!`!aAn!a;'SA[;'S;=`As<%lOA[PAsOiPPAvP;=`<%lA[aBQSiP!O`Ov&ox;'S&o;'S;=`'Q<%lO&oaBaP;=`<%l@pXBiX|WOrBdrsA[svBdvwA[w!`Bd!`!aCU!a;'SBd;'S;=`Cl<%lOBdXC]TiP|WOr'}sv'}w;'S'};'S;=`(c<%lO'}XCoP;=`<%lBdiC{ViP|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(oiDeP;=`<%l?yiDoZ|W!O`Or(ors&osv(owx'}x!e(o!e!fEb!f#V(o#V#WIr#W;'S(o;'S;=`)]<%lO(oiEiX|W!O`Or(ors&osv(owx'}x!f(o!f!gFU!g;'S(o;'S;=`)]<%lO(oiF]X|W!O`Or(ors&osv(owx'}x!c(o!c!dFx!d;'S(o;'S;=`)]<%lO(oiGPX|W!O`Or(ors&osv(owx'}x!v(o!v!wGl!w;'S(o;'S;=`)]<%lO(oiGsX|W!O`Or(ors&osv(owx'}x!c(o!c!dH`!d;'S(o;'S;=`)]<%lO(oiHgX|W!O`Or(ors&osv(owx'}x!}(o!}#OIS#O;'S(o;'S;=`)]<%lO(oiI]V|W!O`yPOr(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(oiIyX|W!O`Or(ors&osv(owx'}x#W(o#W#XJf#X;'S(o;'S;=`)]<%lO(oiJmX|W!O`Or(ors&osv(owx'}x#T(o#T#UKY#U;'S(o;'S;=`)]<%lO(oiKaX|W!O`Or(ors&osv(owx'}x#h(o#h#iK|#i;'S(o;'S;=`)]<%lO(oiLTX|W!O`Or(ors&osv(owx'}x#T(o#T#UH`#U;'S(o;'S;=`)]<%lO(oiLwX|W!O`Or(ors&osv(owx'}x#c(o#c#dMd#d;'S(o;'S;=`)]<%lO(oiMkX|W!O`Or(ors&osv(owx'}x#V(o#V#WNW#W;'S(o;'S;=`)]<%lO(oiN_X|W!O`Or(ors&osv(owx'}x#h(o#h#iNz#i;'S(o;'S;=`)]<%lO(oi! RX|W!O`Or(ors&osv(owx'}x#m(o#m#n! n#n;'S(o;'S;=`)]<%lO(oi! uX|W!O`Or(ors&osv(owx'}x#d(o#d#e!!b#e;'S(o;'S;=`)]<%lO(oi!!iX|W!O`Or(ors&osv(owx'}x#X(o#X#Y?y#Y;'S(o;'S;=`)]<%lO(oi!#_V!SP|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(ok!$PXaQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qo!$wX[UVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!%mZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!&`!a;'S$q;'S;=`)c<%lO$qk!&kX!RQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!'aZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_#P$q#P#Q!(S#Q;'S$q;'S;=`)c<%lO$qk!(]ZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!)O!a;'S$q;'S;=`)c<%lO$qk!)ZXxQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$q",tokenizers:[ei,ni,ri,ii,0,1,2,3,4],topRules:{Document:[0,6]},tokenPrec:0}),si=/^[\u0009\u000A\u000D\u0020-\uD7FF\uE000-\uFFFD\u{10000}-\u{10FFFF}]$/u,ci=/[^\u0009\u000A\u000D\u0020-\uD7FF\uE000-\uFFFD\u{10000}-\u{10FFFF}]/u,li=e=>/[^\t\n\r ]/.test(e),ui=/* @__PURE__ */ new Map([[`amp`,`&`],[`apos`,`'`],[`quot`,`"`],[`lt`,`<`],[`gt`,`>`]]);function di(e){let t=e.slice(1,-1);if(t[0]!==`#`)return ui.get(t);let n=t[1]===`x`?Number.parseInt(t.slice(2),16):Number(t.slice(1));if(!Number.isInteger(n)||n<0||n>1114111)return;let r=String.fromCodePoint(n);return si.test(r)?r:void 0}function fi(e){return e.replace(/&(?:#x[\da-fA-F]+|#\d+|[\w.:-]+);/g,e=>di(e)??e)}function pi(e,t=[]){return e.length<=5242880?oi.parse(e,t):void 0}function mi(e,t,n){return e?{from:e.from,to:e.to,name:t.slice(e.from,e.to)}:{from:n,to:n,name:``}}function hi(e,t){let n=mi(e.getChild(`AttributeName`),t,e.from),r=e.getChild(`Is`)?.to,i=e.getChild(`AttributeValue`),a={from:e.from,to:e.to};if(!i)return{name:n,span:a,equals:r,closed:!1};let o=t[i.from],s=o===`"`||o===`'`?o:void 0,c=!!s&&i.to>i.from+1&&t[i.to-1]===s&&!i.lastChild?.type.isError,l=i.from+ +!!s,u=i.to-+!!c,d=fi(t.slice(l,u).replace(/\r\n|[\t\r\n]/g,` `));return{name:n,span:a,equals:r,quote:s,closed:c,value:{from:l,to:u},decoded:d}}function gi(e,t){if(t===`xml`)return`http://www.w3.org/XML/1998/namespace`;if(t===`xmlns`)return`http://www.w3.org/2000/xmlns/`;for(let n=e;n;n=n.parent){let e=n.attributes.find(e=>e.name.name===(t?`xmlns:`+t:`xmlns`));if(e?.closed)return e.decoded}return t?void 0:``}function _i(e,t){let n=[],r=[],i=[],a=!t,o=0,s=(t,n,i,a)=>{if(r.length>=100)return;let o={from:n.from,to:n.to};o.to===o.from&&!a?.fix&&o.to<e.length&&o.to++,r.push({source:`syntax`,code:t,span:o,message:i,...a})};if(t&&t.iterate({enter(t){if(a)return!1;let c=t.node,{name:l,from:u,to:d}=c;if(++o>5e5||i.length>=128)return a=!0,!1;let f=i.at(-1);if(l===`Element`){let t=c.firstChild;if(!t)return!1;let r=t.lastChild,a=t.getChildren(`Attribute`).map(t=>hi(t,e)),o={name:mi(t.getChild(`TagName`),e,u+1),span:{from:u,to:d},open:{from:t.from,to:t.to},parent:f,attributes:a,children:[],content:[],complete:r?.name===`EndTag`||r?.name===`SelfCloseEndTag`,selfClosing:r?.name===`SelfCloseEndTag`,namespace:``,preserveSpace:f?.preserveSpace??!1},l=a.find(e=>e.name.name===`xml:space`)?.decoded;(l===`preserve`||l==="default")&&(o.preserveSpace=l===`preserve`);let p=e=>{let t=e.name.split(`:`);if(t.length===1)return gi(o,``)??``;let n=gi(o,t[0]);return t.length===2&&t[1]&&n||s(`invalid-namespace`,e,`Invalid or unbound XML namespace prefix.`),n||`?`};o.namespace=p(o.name);let m=/* @__PURE__ */ new Map;for(let t of a){let n=t.name.name.split(`:`).at(-1),r=t.name.name.includes(`:`)?`${p(t.name)}:${n}`:`:`+n,i=m.get(r);i?s(`duplicate-attribute`,t.name,`Duplicate XML attribute.`,{related:{span:i,message:`First occurrence.`}}):m.set(r,t.name),t.value&&e.slice(t.value.from,t.value.to).includes(`<`)&&s(`invalid-attribute-value`,t.value,`Escape “<” as &lt; in attribute values.`)}f?f.children.push(o):(n.length&&o.name.name&&s(`multiple-roots`,o.name,`An XML document has one root element.`),n.push(o)),i.push(o)}else if(l===`CloseTag`&&f)f.close={span:{from:u,to:d},name:mi(c.getChild(`TagName`),e,u+2),complete:c.lastChild?.name===`EndTag`};else if(l===`MismatchedCloseTag`&&f){let t=mi(c.getChild(`TagName`),e,u+2),n=f.name.name;s(`mismatched-close-tag`,t,`Expected </${n}>.`,{fix:{span:t,text:n,title:`Change closing tag to </${n}>`},related:{span:f.name,message:`Opening tag.`}})}else if(l===`MissingCloseTag`&&f){let e=f.name.name;s(`missing-close-tag`,{from:u,to:d},`Missing </${e}>.`,{fix:{span:{from:u,to:u},text:`</${e}>`,title:`Insert </${e}>`},related:{span:f.name,message:`Opening tag.`}})}else if(l===`DoctypeDecl`)return s(`doctype-disabled`,{from:u,to:d},`Document type declarations are disabled.`),!1;else if(t.type.isError){if(c.parent?.name===`Element`&&f?.complete&&!f.selfClosing&&!f.close&&!f.content.some(e=>e.kind===`MismatchedCloseTag`))s(`unclosed-element`,f.name,`Missing closing tag for <${f.name.name}>.`);else if(c.parent?.name!==`Element`){let e=r.at(-1);(e?.span.from!==u||e.code!==`invalid-xml`)&&s(`invalid-xml`,{from:u,to:d},`Incomplete or invalid XML syntax.`)}}(c.parent?.name===`Element`||c.parent?.name===`Document`)&&[`Text`,`CharacterReference`,`EntityReference`,`Cdata`,`Comment`,`ProcessingInst`,`MismatchedCloseTag`].includes(l)&&(f?f.content.push({span:{from:u,to:d},kind:l}):[`Text`,`CharacterReference`,`EntityReference`,`Cdata`].includes(l)&&li(e.slice(u,d).replace(/^\uFEFF/,``))&&s(`text-outside-root`,{from:u,to:d},`Text must be inside the root element.`)),(l===`EntityReference`||l===`CharacterReference`)&&di(e.slice(u,d))===void 0&&s(`invalid-reference`,{from:u,to:d},`Unknown entity or invalid XML character reference.`)},leave(e){e.name===`Element`&&i.pop()}}),a)return{roots:[],limited:!0,issues:[{source:`syntax`,code:`resource-limit`,span:{from:0,to:0},message:`The XML document exceeds the analysis size, nesting, or syntax-node budget.`,severity:R.Warning}]};let c=ci.exec(e);return c&&s(`invalid-character`,{from:c.index,to:c.index+c[0].length},`Character is invalid in XML 1.0.`),!n.length&&!r.length&&s(`missing-root`,{from:e.length,to:e.length},`Expected a root element.`),{roots:n,issues:r,limited:a}}function vi(e){let t=[],n=[...e].reverse();for(;n.length;){let e=n.pop();t.push(e);for(let t=e.children.length-1;t>=0;t--)n.push(e.children[t])}return t}var yi=/* @__PURE__ */ a((e=>{function t(e,t){return t===void 0&&(t=Object),t&&typeof t.getOwnPropertyDescriptors==`function`&&(e=t.create(null,t.getOwnPropertyDescriptors(e))),t&&typeof t.freeze==`function`?t.freeze(e):e}function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var r=t({allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0}),i=t({area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),a=t({script:!1,style:!1,textarea:!0,title:!0});function o(e){return e===s.HTML}var s=t({HTML:`text/html`,XML_APPLICATION:`application/xml`,XML_TEXT:`text/xml`,XML_XHTML_APPLICATION:`application/xhtml+xml`,XML_SVG_IMAGE:`image/svg+xml`}),c=Object.keys(s).map(function(e){return s[e]}),l=t({HTML:`http://www.w3.org/1999/xhtml`,SVG:`http://www.w3.org/2000/svg`,XML:`http://www.w3.org/XML/1998/namespace`,XMLNS:`http://www.w3.org/2000/xmlns/`});e.assign=function(e,t){if(typeof e!=`object`||!e)throw TypeError(`target is not an object`);for(var r in t)n(t,r)&&(e[r]=t[r]);return e},e.find=function(e,t,r){if(r===void 0&&(r=Array.prototype),e&&typeof r.find==`function`)return r.find.call(e,t);for(var i=0;i<e.length;i++)if(n(e,i)){var a=e[i];if(t.call(void 0,a,i,e))return a}},e.freeze=t,e.HTML_BOOLEAN_ATTRIBUTES=r,e.HTML_RAW_TEXT_ELEMENTS=a,e.HTML_VOID_ELEMENTS=i,e.hasDefaultHTMLNamespace=function(e){return o(e)||e===s.XML_XHTML_APPLICATION},e.hasOwn=n,e.isHTMLBooleanAttribute=function(e){return n(r,e.toLowerCase())},e.isHTMLRawTextElement=function(e){var t=e.toLowerCase();return n(a,t)&&!a[t]},e.isHTMLEscapableRawTextElement=function(e){var t=e.toLowerCase();return n(a,t)&&a[t]},e.isHTMLMimeType=o,e.isHTMLVoidElement=function(e){return n(i,e.toLowerCase())},e.isValidMimeType=function(e){return c.indexOf(e)>-1},e.MIME_TYPE=s,e.NAMESPACE=l})),bi=/* @__PURE__ */ a((e=>{var t=yi();function n(e,t){e.prototype=Object.create(Error.prototype,{constructor:{value:e},name:{value:e.name,enumerable:!0,writable:t}})}var r=t.freeze({Error:`Error`,IndexSizeError:`IndexSizeError`,DomstringSizeError:`DomstringSizeError`,HierarchyRequestError:`HierarchyRequestError`,WrongDocumentError:`WrongDocumentError`,InvalidCharacterError:`InvalidCharacterError`,NoDataAllowedError:`NoDataAllowedError`,NoModificationAllowedError:`NoModificationAllowedError`,NotFoundError:`NotFoundError`,NotSupportedError:`NotSupportedError`,InUseAttributeError:`InUseAttributeError`,InvalidStateError:`InvalidStateError`,SyntaxError:`SyntaxError`,InvalidModificationError:`InvalidModificationError`,NamespaceError:`NamespaceError`,InvalidAccessError:`InvalidAccessError`,ValidationError:`ValidationError`,TypeMismatchError:`TypeMismatchError`,SecurityError:`SecurityError`,NetworkError:`NetworkError`,AbortError:`AbortError`,URLMismatchError:`URLMismatchError`,QuotaExceededError:`QuotaExceededError`,TimeoutError:`TimeoutError`,InvalidNodeTypeError:`InvalidNodeTypeError`,DataCloneError:`DataCloneError`,EncodingError:`EncodingError`,NotReadableError:`NotReadableError`,UnknownError:`UnknownError`,ConstraintError:`ConstraintError`,DataError:`DataError`,TransactionInactiveError:`TransactionInactiveError`,ReadOnlyError:`ReadOnlyError`,VersionError:`VersionError`,OperationError:`OperationError`,NotAllowedError:`NotAllowedError`,OptOutError:`OptOutError`}),i=Object.keys(r);function a(e){return typeof e==`number`&&e>=1&&e<=25}function o(e){return typeof e==`string`&&e.substring(e.length-r.Error.length)===r.Error}function s(e,t){a(e)?(this.name=i[e],this.message=t||``):(this.message=e,this.name=o(t)?t:r.Error),Error.captureStackTrace&&Error.captureStackTrace(this,s)}n(s,!0),Object.defineProperties(s.prototype,{code:{enumerable:!0,get:function(){var e=i.indexOf(this.name);return a(e)?e:0}}});for(var c={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25},l=Object.entries(c),u=0;u<l.length;u++){var d=l[u][0];s[d]=l[u][1]}function f(e,t,n){this.message=e,this.locator=t,this.cause=n,Error.captureStackTrace&&Error.captureStackTrace(this,f)}n(f),e.DOMException=s,e.DOMExceptionName=r,e.ExceptionCode=c,e.ParseError=f})),xi=/* @__PURE__ */ a((e=>{function t(e){try{typeof e!=`function`&&(e=RegExp);var t=new e(`𝌆`,`u`).exec(`𝌆`);return!!t&&t[0].length===2}catch{}return!1}var n=t();function r(e){if(e.source[0]!==`[`)throw Error(e+` can not be used with chars`);return e.source.slice(1,e.source.lastIndexOf(`]`))}function i(e,t){if(e.source[0]!==`[`)throw Error(`/`+e.source+`/ can not be used with chars_without`);if(!t||typeof t!=`string`)throw Error(JSON.stringify(t)+` is not a valid search`);if(e.source.indexOf(t)===-1)throw Error(`"`+t+`" is not is /`+e.source+`/`);if(t===`-`&&e.source.indexOf(t)!==1)throw Error(`"`+t+`" is not at the first postion of /`+e.source+`/`);return new RegExp(e.source.replace(t,``),n?`u`:``)}function a(e){var t=this;return new RegExp(Array.prototype.slice.call(arguments).map(function(e){var n=typeof e==`string`;if(n&&t===void 0&&e===`|`)throw Error("use regg instead of reg to wrap expressions with `|`!");return n?e:e.source}).join(``),n?`u`:``)}function o(e){if(arguments.length===0)throw Error(`no parameters provided`);return a.apply(o,[`(?:`].concat(Array.prototype.slice.call(arguments),[`)`]))}var s=`�`,c=/[-\x09\x0A\x0D\x20-\x2C\x2E-\uD7FF\uE000-\uFFFD]/;n&&(c=a(`[`,r(c),`\\u{10000}-\\u{10FFFF}`,`]`));var l=RegExp(`[^`+r(c)+`]`,n?`u`:``),u=/[\x20\x09\x0D\x0A]/,d=r(u),f=a(u,`+`),p=a(u,`*`),m=/[:_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;n&&(m=a(`[`,r(m),`\\u{10000}-\\u{10FFFF}`,`]`));var h=a(`[`,r(m),r(/[-.0-9\xB7]/),r(/[\u0300-\u036F\u203F-\u2040]/),`]`),g=a(m,h,`*`),_=a(`^`,g,`$`),v=a(h,`+`),y=o(a(`&`,g,`;`),`|`,o(/&#[0-9]+;|&#x[0-9a-fA-F]+;/)),b=a(`%`,g,`;`),x=o(a(`"`,o(/[^%&"]/,`|`,b,`|`,y),`*`,`"`),`|`,a(`'`,o(/[^%&']/,`|`,b,`|`,y),`*`,`'`)),S=o(`"`,o(/[^<&"]/,`|`,y),`*`,`"`,`|`,`'`,o(/[^<&']/,`|`,y),`*`,`'`),C=a(i(m,`:`),i(h,`:`),`*`),w=a(`^`,C,`$`),T=a(C,o(`:`,C),`?`),E=a(`^`,T,`$`),D=a(`(`,T,`)`),O=o(/"[^"]*"|'[^']*'/),k=a(/^<\?/,`(`,g,`)`,o(f,`(?!`,u,`)(`,c,`*?)`),`?`,/\?>/),ee=/[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/,A=o(`"`,ee,`*"`,`|`,`'`,i(ee,`'`),`*'`),j=`<!--`,te=`-->`,M=a(j,o(i(c,`-`),`|`,a(`-`,i(c,`-`))),`*`,te),N=`#PCDATA`,P=o(`EMPTY`,`|`,`ANY`,`|`,o(a(/\(/,p,N,o(p,/\|/,p,T),`*`,p,/\)\*/),`|`,a(/\(/,p,N,p,/\)/)),`|`,a(/\([^>]+\)/,/[?*+]?/)),ne=a(`<!ELEMENT`,f,o(T,`|`,b),f,o(P,`|`,b),p,`>`),F=a(`<!ATTLIST`,f,g,o(f,g,f,o(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/,`|`,o(a(`NOTATION`,f,/\(/,p,g,o(p,/\|/,p,g),`*`,p,/\)/),`|`,a(/\(/,p,v,o(p,/\|/,p,v),`*`,p,/\)/))),f,o(/#REQUIRED|#IMPLIED/,`|`,o(o(`#FIXED`,f),`?`,S))),`*`,p,`>`),I=`about:legacy-compat`,L=o(`"`+I+`"`,`|`,`'`+I+`'`),R=`SYSTEM`,z=`PUBLIC`,B=o(o(R,f,O),`|`,o(z,f,A,f,O)),re=a(`^`,o(o(R,f,`(?<SystemLiteralOnly>`,O,`)`),`|`,o(z,f,`(?<PubidLiteral>`,A,`)`,f,`(?<SystemLiteral>`,O,`)`))),V=a(`^`,A,`$`),H=a(`^`,O,`$`),ie=o(x,`|`,o(B,o(f,`NDATA`,f,g),`?`)),U=`<!ENTITY`,ae=o(a(U,f,g,f,ie,p,`>`),`|`,a(U,f,`%`,f,g,f,o(x,`|`,B),p,`>`)),oe=a(`<!NOTATION`,f,g,f,o(B,`|`,a(z,f,A)),p,`>`),se=a(p,`=`,p),ce=/1[.]\d+/,W=a(f,`version`,se,o(`'`,ce,`'`,`|`,`"`,ce,`"`)),le=/[A-Za-z][-A-Za-z0-9._]*/,ue=a(/^<\?xml/,W,o(f,`encoding`,se,o(`"`,le,`"`,`|`,`'`,le,`'`)),`?`,o(f,`standalone`,se,o(`'`,o(`yes`,`|`,`no`),`'`,`|`,`"`,o(`yes`,`|`,`no`),`"`)),`?`,p,/\?>/),G=`<!DOCTYPE`,de=`<![CDATA[`,fe=`]]>`,pe=a(/<!\[CDATA\[/,a(c,`*?`,/\]\]>/));e.chars=r,e.chars_without=i,e.detectUnicodeSupport=t,e.reg=a,e.regg=o,e.ABOUT_LEGACY_COMPAT=I,e.ABOUT_LEGACY_COMPAT_SystemLiteral=L,e.AttlistDecl=F,e.CDATA_START=de,e.CDATA_END=fe,e.CDSect=pe,e.Char=c,e.Comment=M,e.COMMENT_START=j,e.COMMENT_END=te,e.DOCTYPE_DECL_START=G,e.elementdecl=ne,e.EntityDecl=ae,e.EntityValue=x,e.ExternalID=B,e.ExternalID_match=re,e.Name=g,e.Name_exact=_,e.NCName_exact=w,e.NotationDecl=oe,e.Reference=y,e.PEReference=b,e.PI=k,e.PUBLIC=z,e.PubidLiteral=A,e.PubidLiteral_match=V,e.QName=T,e.QName_exact=E,e.QName_group=D,e.S=f,e.SChar_s=d,e.S_OPT=p,e.SYSTEM=R,e.SystemLiteral=O,e.SystemLiteral_match=H,e.InvalidChar=l,e.UNICODE_REPLACEMENT_CHARACTER=s,e.UNICODE_SUPPORT=n,e.XMLDecl=ue})),Si=/* @__PURE__ */ a((e=>{var t=yi(),n=t.find,r=t.hasDefaultHTMLNamespace,i=t.hasOwn,a=t.isHTMLMimeType,o=t.isHTMLRawTextElement,s=t.isHTMLVoidElement,c=t.MIME_TYPE,l=t.NAMESPACE,u=Symbol(),d=bi(),f=d.DOMException,p=d.DOMExceptionName,m=xi();function h(e){if(e!==u)throw TypeError(`Illegal constructor`)}function g(e){return e!==``}function _(e){return e?e.split(/[\t\n\f\r ]+/).filter(g):[]}function v(e,t){return i(e,t)||(e[t]=!0),e}function y(e){if(!e)return[];var t=_(e);return Object.keys(t.reduce(v,{}))}function b(e){return function(t){return e&&e.indexOf(t)!==-1}}function x(e){if(!m.QName_exact.test(e))throw new f(f.INVALID_CHARACTER_ERR,`invalid character in qualified name "`+e+`"`)}function S(e,n){x(n),e||=null;var r=null,i=n;if(n.indexOf(`:`)>=0){var a=n.split(`:`);r=a[0],i=a[1]}if(r!==null&&e===null)throw new f(f.NAMESPACE_ERR,`prefix is non-null and namespace is null`);if(r===`xml`&&e!==t.NAMESPACE.XML)throw new f(f.NAMESPACE_ERR,`prefix is "xml" and namespace is not the XML namespace`);if((r===`xmlns`||n===`xmlns`)&&e!==t.NAMESPACE.XMLNS)throw new f(f.NAMESPACE_ERR,`either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace`);if(e===t.NAMESPACE.XMLNS&&r!==`xmlns`&&n!==`xmlns`)throw new f(f.NAMESPACE_ERR,`namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns"`);return[e,r,i]}function C(e,t){for(var n in e)i(e,n)&&(t[n]=e[n])}function w(e,t){var n=e.prototype;if(!(n instanceof t)){function r(){}r.prototype=t.prototype,r=new r,C(n,r),e.prototype=n=r}n.constructor!=e&&(typeof e!=`function`&&console.error(`unknown Class:`+e),n.constructor=e)}var T={},E=T.ELEMENT_NODE=1,D=T.ATTRIBUTE_NODE=2,O=T.TEXT_NODE=3,k=T.CDATA_SECTION_NODE=4,ee=T.ENTITY_REFERENCE_NODE=5,A=T.ENTITY_NODE=6,j=T.PROCESSING_INSTRUCTION_NODE=7,te=T.COMMENT_NODE=8,M=T.DOCUMENT_NODE=9,N=T.DOCUMENT_TYPE_NODE=10,P=T.DOCUMENT_FRAGMENT_NODE=11,ne=T.NOTATION_NODE=12,F=t.freeze({DOCUMENT_POSITION_DISCONNECTED:1,DOCUMENT_POSITION_PRECEDING:2,DOCUMENT_POSITION_FOLLOWING:4,DOCUMENT_POSITION_CONTAINS:8,DOCUMENT_POSITION_CONTAINED_BY:16,DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32});function I(e,t){if(t.length<e.length)return I(t,e);var n=null;for(var r in e){if(e[r]!==t[r])return n;n=e[r]}return n}function L(e){return e.guid||=Math.random(),e.guid}function R(){}R.prototype={length:0,item:function(e){return e>=0&&e<this.length?this[e]:null},toString:function(e){for(var t=typeof e==`function`?{requireWellFormed:!1,splitCDATASections:!0,nodeFilter:e}:e?{requireWellFormed:!!e.requireWellFormed,splitCDATASections:e.splitCDATASections!==!1,nodeFilter:e.nodeFilter||null}:{requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null},n=[],r=0;r<this.length;r++)Ue(this[r],n,null,t);return n.join(``)},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}},R.prototype[Symbol.iterator]=function(){var e=this,t=0;return{next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0}},return:function(){return{done:!0}}}};function z(e,t){this._node=e,this._refresh=t,B(this)}function B(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var n=e._refresh(e._node);if(Ke(e,`length`,n.length),!e.$$length||n.length<e.$$length)for(var r=n.length;r in e;r++)i(e,r)&&delete e[r];C(n,e),e._inc=t}}z.prototype.item=function(e){return B(this),this[e]||null},w(z,R);function re(){this._nsIndex=Object.create(null),this._noNsIndex=Object.create(null)}function V(e,t){for(var n=0;n<e.length;){if(e[n]===t)return n;n++}}function H(e,t,n){if(!t)return e._noNsIndex;var r=e._nsIndex[t];return!r&&n&&(r=e._nsIndex[t]=Object.create(null)),r}function ie(e,t,n){var r=H(e,t,!1);return r&&r[n]||null}function U(e,t){H(e,t.namespaceURI,!0)[t.localName]=t}function ae(e,t){var n=H(e,t.namespaceURI,!1);n&&delete n[t.localName]}function oe(e,t,n,r){if(r?t[V(t,r)]=n:(t[t.length]=n,t.length++),U(t,n),e){n.ownerElement=e;var i=e.ownerDocument;i&&(r&&pe(i,e,r),fe(i,e,n))}}function se(e,t,n){var r=V(t,n);if(r>=0){for(var i=t.length-1;r<=i;)t[r]=t[++r];if(t.length=i,ae(t,n),e){var a=e.ownerDocument;a&&pe(a,e,n),n.ownerElement=null}}}re.prototype={length:0,item:R.prototype.item,getNamedItem:function(e){this._ownerElement&&this._ownerElement._isInHTMLDocumentAndNamespace()&&(e=e.toLowerCase());for(var t=0;t<this.length;){var n=this[t];if(n.nodeName===e)return n;t++}return null},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!==this._ownerElement)throw new f(f.INUSE_ATTRIBUTE_ERR);var n=ie(this,e.namespaceURI,e.localName);return n===e?e:(oe(this._ownerElement,this,e,n),n)},setNamedItemNS:function(e){return this.setNamedItem(e)},removeNamedItem:function(e){var t=this.getNamedItem(e);if(!t)throw new f(f.NOT_FOUND_ERR,e);return se(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var n=this.getNamedItemNS(e,t);if(!n)throw new f(f.NOT_FOUND_ERR,e?e+` : `+t:t);return se(this._ownerElement,this,n),n},getNamedItemNS:function(e,t){e||=null;for(var n=0;n<this.length;){var r=this[n];if(r.localName===t&&r.namespaceURI===e)return r;n++}return null}},re.prototype[Symbol.iterator]=function(){var e=this,t=0;return{next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0}},return:function(){return{done:!0}}}};function ce(){}ce.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,n){var r=c.XML_APPLICATION;e===l.HTML?r=c.XML_XHTML_APPLICATION:e===l.SVG&&(r=c.XML_SVG_IMAGE);var i=new de(u,{contentType:r});if(i.implementation=this,i.childNodes=new R,i.doctype=n||null,n&&i.appendChild(n),t){var a=i.createElementNS(e,t);i.appendChild(a)}return i},createDocumentType:function(e,t,n,r){x(e);var i=new Ne(u);return i.name=e,i.nodeName=e,i.publicId=t||``,i.systemId=n||``,i.internalSubset=r||``,i.childNodes=new R,i},createHTMLDocument:function(e){var t=new de(u,{contentType:c.HTML});if(t.implementation=this,t.childNodes=new R,e!==!1){t.doctype=this.createDocumentType(`html`),t.doctype.ownerDocument=t,t.appendChild(t.doctype);var n=t.createElement(`html`);t.appendChild(n);var r=t.createElement(`head`);if(n.appendChild(r),typeof e==`string`){var i=t.createElement(`title`);i.appendChild(t.createTextNode(e)),r.appendChild(i)}n.appendChild(t.createElement(`body`))}return t}};function W(e){h(e)}W.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,parentNode:null,get parentElement(){return this.parentNode&&this.parentNode.nodeType===this.ELEMENT_NODE?this.parentNode:null},childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,baseURI:`about:blank`,get isConnected(){var e=this.getRootNode();return e&&e.nodeType===e.DOCUMENT_NODE},contains:function(e){if(!e)return!1;var t=e;do{if(this===t)return!0;t=t.parentNode}while(t);return!1},getRootNode:function(e){var t=this;do{if(!t.parentNode)return t;t=t.parentNode}while(t)},isEqualNode:function(e){if(!e)return!1;for(var t=[{node:this,other:e}];t.length>0;){var n=t.pop(),r=n.node,i=n.other;if(r.nodeType!==i.nodeType)return!1;switch(r.nodeType){case r.DOCUMENT_TYPE_NODE:if(r.name!==i.name||r.publicId!==i.publicId||r.systemId!==i.systemId)return!1;break;case r.ELEMENT_NODE:if(r.namespaceURI!==i.namespaceURI||r.prefix!==i.prefix||r.localName!==i.localName||r.attributes.length!==i.attributes.length)return!1;for(var a=0;a<r.attributes.length;a++){var o=r.attributes.item(a),s=i.getAttributeNodeNS(o.namespaceURI,o.localName);if(!s)return!1;t.push({node:o,other:s})}break;case r.ATTRIBUTE_NODE:if(r.namespaceURI!==i.namespaceURI||r.localName!==i.localName||r.value!==i.value)return!1;break;case r.PROCESSING_INSTRUCTION_NODE:if(r.target!==i.target||r.data!==i.data)return!1;break;case r.TEXT_NODE:case r.CDATA_SECTION_NODE:case r.COMMENT_NODE:if(r.data!==i.data)return!1}if(r.childNodes.length!==i.childNodes.length)return!1;for(var a=r.childNodes.length-1;a>=0;a--)t.push({node:r.childNodes[a],other:i.childNodes[a]})}return!0},isSameNode:function(e){return this===e},insertBefore:function(e,t){return Ee(this,e,t)},replaceChild:function(e,t){Ee(this,e,t,Te),t&&this.removeChild(t)},removeChild:function(e){return he(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(e){return Ge(this.ownerDocument||this,this,e)},normalize:function(){G(this,null,{enter:function(e){for(var t=e.firstChild;t;){var n=t.nextSibling;if(n!==null&&n.nodeType===O&&t.nodeType===O){for(var r=[],i=n;i!==null&&i.nodeType===O;)r.push(i.data),i=i.nextSibling;for(var a=t.nextSibling;a!==i;){var o=a.nextSibling;a.parentNode=null,a.previousSibling=null,a.nextSibling=null,a=o}t.nextSibling=i,i===null?e.lastChild=t:i.previousSibling=t,t.appendData(r.join(``)),me(e.ownerDocument,e),t=i}else t=n}return!0}})},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n){for(var r in n)if(i(n,r)&&n[r]===e)return r}t=t.nodeType==D?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&i(n,e))return n[e];t=t.nodeType==D?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return this.lookupPrefix(e)==null},compareDocumentPosition:function(e){if(this===e)return 0;var t=e,n=this,r=null,i=null;if(t instanceof Oe&&(r=t,t=r.ownerElement),n instanceof Oe&&(i=n,n=i.ownerElement,r&&t&&n===t))for(var a=0,o;o=n.attributes[a];a++){if(o===r)return F.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+F.DOCUMENT_POSITION_PRECEDING;if(o===i)return F.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+F.DOCUMENT_POSITION_FOLLOWING}if(!t||!n||n.ownerDocument!==t.ownerDocument)return F.DOCUMENT_POSITION_DISCONNECTED+F.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+(L(n.ownerDocument)>L(t.ownerDocument)?F.DOCUMENT_POSITION_FOLLOWING:F.DOCUMENT_POSITION_PRECEDING);if(i&&t===n)return F.DOCUMENT_POSITION_CONTAINS+F.DOCUMENT_POSITION_PRECEDING;if(r&&t===n)return F.DOCUMENT_POSITION_CONTAINED_BY+F.DOCUMENT_POSITION_FOLLOWING;for(var s=[],c=t.parentNode;c;){if(!i&&c===n)return F.DOCUMENT_POSITION_CONTAINED_BY+F.DOCUMENT_POSITION_FOLLOWING;s.push(c),c=c.parentNode}s.reverse();for(var l=[],u=n.parentNode;u;){if(!r&&u===t)return F.DOCUMENT_POSITION_CONTAINS+F.DOCUMENT_POSITION_PRECEDING;l.push(u),u=u.parentNode}l.reverse();var d=I(s,l);for(var f in d.childNodes){var p=d.childNodes[f];if(p===n)return F.DOCUMENT_POSITION_FOLLOWING;if(p===t)return F.DOCUMENT_POSITION_PRECEDING;if(l.indexOf(p)>=0)return F.DOCUMENT_POSITION_FOLLOWING;if(s.indexOf(p)>=0)return F.DOCUMENT_POSITION_PRECEDING}return 0}};function le(e){return e==`<`&&`&lt;`||e==`>`&&`&gt;`||e==`&`&&`&amp;`||e==`"`&&`&quot;`||`&#`+e.charCodeAt()+`;`}C(T,W),C(T,W.prototype),C(F,W),C(F,W.prototype);function ue(e,t){G(e,null,{enter:function(e){return!t(e)||G.STOP}})}function G(e,t,n){for(var r=[{node:e,context:t,phase:G.ENTER}];r.length>0;){var i=r.pop();if(i.phase===G.ENTER){var a=n.enter(i.node,i.context);if(a===G.STOP)return G.STOP;if(r.push({node:i.node,context:a,phase:G.EXIT}),a==null)continue;for(var o=i.node.lastChild;o;)r.push({node:o,context:a,phase:G.ENTER}),o=o.previousSibling}else n.exit&&n.exit(i.node,i.context)}}G.STOP=Symbol(`walkDOM.STOP`),G.ENTER=0,G.EXIT=1;function de(e,t){h(e);var n=t||{};this.ownerDocument=this,this.contentType=n.contentType||c.XML_APPLICATION,this.type=a(this.contentType)?`html`:`xml`}function fe(e,t,n){e&&e._inc++,n.namespaceURI===l.XMLNS&&(t._nsMap[n.prefix?n.localName:``]=n.value)}function pe(e,t,n,r){e&&e._inc++,n.namespaceURI===l.XMLNS&&delete t._nsMap[n.prefix?n.localName:``]}function me(e,t,n){if(e&&e._inc){e._inc++;var r=t.childNodes;if(n&&!n.nextSibling)r[r.length++]=n;else{for(var i=t.firstChild,a=0;i;)r[a++]=i,i=i.nextSibling;r.length=a,delete r[r.length]}}}function he(e,t){if(e!==t.parentNode)throw new f(f.NOT_FOUND_ERR,`child's parent is not parent`);var n=t.previousSibling,r=t.nextSibling;return n?n.nextSibling=r:e.firstChild=r,r?r.previousSibling=n:e.lastChild=n,me(e.ownerDocument,e),t.parentNode=null,t.previousSibling=null,t.nextSibling=null,t}function ge(e){return e&&(e.nodeType===W.DOCUMENT_NODE||e.nodeType===W.DOCUMENT_FRAGMENT_NODE||e.nodeType===W.ELEMENT_NODE)}function _e(e){return e&&(e.nodeType===W.CDATA_SECTION_NODE||e.nodeType===W.COMMENT_NODE||e.nodeType===W.DOCUMENT_FRAGMENT_NODE||e.nodeType===W.DOCUMENT_TYPE_NODE||e.nodeType===W.ELEMENT_NODE||e.nodeType===W.PROCESSING_INSTRUCTION_NODE||e.nodeType===W.TEXT_NODE)}function ve(e){return e&&e.nodeType===W.DOCUMENT_TYPE_NODE}function ye(e){return e&&e.nodeType===W.ELEMENT_NODE}function be(e){return e&&e.nodeType===W.TEXT_NODE}function xe(e,t){var r=e.childNodes||[];if(n(r,ye)||ve(t))return!1;var i=n(r,ve);return!(t&&i&&r.indexOf(i)>r.indexOf(t))}function Se(e,t){var r=e.childNodes||[];function i(e){return ye(e)&&e!==t}if(n(r,i))return!1;var a=n(r,ve);return!(t&&a&&r.indexOf(a)>r.indexOf(t))}function Ce(e,t,n){if(!ge(e))throw new f(f.HIERARCHY_REQUEST_ERR,`Unexpected parent node type `+e.nodeType);if(n&&n.parentNode!==e)throw new f(f.NOT_FOUND_ERR,`child not in parent`);if(!_e(t)||ve(t)&&e.nodeType!==W.DOCUMENT_NODE)throw new f(f.HIERARCHY_REQUEST_ERR,`Unexpected node type `+t.nodeType+` for parent node type `+e.nodeType)}function we(e,t,r){var i=e.childNodes||[],a=t.childNodes||[];if(t.nodeType===W.DOCUMENT_FRAGMENT_NODE){var o=a.filter(ye);if(o.length>1||n(a,be))throw new f(f.HIERARCHY_REQUEST_ERR,`More than one element or text in fragment`);if(o.length===1&&!xe(e,r))throw new f(f.HIERARCHY_REQUEST_ERR,`Element in fragment can not be inserted before doctype`)}if(ye(t)&&!xe(e,r))throw new f(f.HIERARCHY_REQUEST_ERR,`Only one element can be added and only after doctype`);if(ve(t)){if(n(i,ve))throw new f(f.HIERARCHY_REQUEST_ERR,`Only one doctype is allowed`);var s=n(i,ye);if(r&&i.indexOf(s)<i.indexOf(r))throw new f(f.HIERARCHY_REQUEST_ERR,`Doctype can only be inserted before an element`);if(!r&&s)throw new f(f.HIERARCHY_REQUEST_ERR,`Doctype can not be appended since element is present`)}}function Te(e,t,r){var i=e.childNodes||[],a=t.childNodes||[];if(t.nodeType===W.DOCUMENT_FRAGMENT_NODE){var o=a.filter(ye);if(o.length>1||n(a,be))throw new f(f.HIERARCHY_REQUEST_ERR,`More than one element or text in fragment`);if(o.length===1&&!Se(e,r))throw new f(f.HIERARCHY_REQUEST_ERR,`Element in fragment can not be inserted before doctype`)}if(ye(t)&&!Se(e,r))throw new f(f.HIERARCHY_REQUEST_ERR,`Only one element can be added and only after doctype`);if(ve(t)){function e(e){return ve(e)&&e!==r}if(n(i,e))throw new f(f.HIERARCHY_REQUEST_ERR,`Only one doctype is allowed`);var s=n(i,ye);if(r&&i.indexOf(s)<i.indexOf(r))throw new f(f.HIERARCHY_REQUEST_ERR,`Doctype can only be inserted before an element`)}}function Ee(e,t,n,r){Ce(e,t,n),e.nodeType===W.DOCUMENT_NODE&&(r||we)(e,t,n);var i=t.parentNode;if(i&&i.removeChild(t),t.nodeType===P){var a=t.firstChild;if(a==null)return t;var o=t.lastChild}else a=o=t;var s=n?n.previousSibling:e.lastChild;a.previousSibling=s,o.nextSibling=n,s?s.nextSibling=a:e.firstChild=a,n==null?e.lastChild=o:n.previousSibling=o;do a.parentNode=e;while(a!==o&&(a=a.nextSibling));return me(e.ownerDocument||e,e,t),t.nodeType==P&&(t.firstChild=t.lastChild=null),t}de.prototype={implementation:null,nodeName:`#document`,nodeType:M,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType===P){for(var n=e.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,t),n=r}return e}return Ee(this,e,t),e.ownerDocument=this,this.documentElement===null&&e.nodeType===E&&(this.documentElement=e),e},removeChild:function(e){var t=he(this,e);return t===this.documentElement&&(this.documentElement=null),t},replaceChild:function(e,t){Ee(this,e,t,Te),e.ownerDocument=this,t&&this.removeChild(t),ye(e)&&(this.documentElement=e)},importNode:function(e,t){return We(this,e,t)},getElementById:function(e){var t=null;return ue(this.documentElement,function(n){if(n.nodeType==E&&n.getAttribute(`id`)==e)return t=n,!0}),t},createElement:function(e){var t=new De(u);t.ownerDocument=this,this.type===`html`&&(e=e.toLowerCase()),r(this.contentType)&&(t.namespaceURI=l.HTML),t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new R;var n=t.attributes=new re;return n._ownerElement=t,t},createDocumentFragment:function(){var e=new Le(u);return e.ownerDocument=this,e.childNodes=new R,e},createTextNode:function(e){var t=new Ae(u);return t.ownerDocument=this,t.childNodes=new R,t.appendData(e),t},createComment:function(e){var t=new je(u);return t.ownerDocument=this,t.childNodes=new R,t.appendData(e),t},createCDATASection:function(e){if(e.indexOf(`]]>`)!==-1)throw new f(f.INVALID_CHARACTER_ERR,`data contains "]]>"`);var t=new Me(u);return t.ownerDocument=this,t.childNodes=new R,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new Re(u);return n.ownerDocument=this,n.childNodes=new R,n.nodeName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){if(!m.QName_exact.test(e))throw new f(f.INVALID_CHARACTER_ERR,`invalid character in name "`+e+`"`);return this.type===`html`&&(e=e.toLowerCase()),this._createAttribute(e)},_createAttribute:function(e){var t=new Oe(u);return t.ownerDocument=this,t.childNodes=new R,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){if(!m.Name_exact.test(e))throw new f(f.INVALID_CHARACTER_ERR,`not a valid xml name "`+e+`"`);if(this.type===`html`)throw new f(`document is an html document`,p.NotSupportedError);var t=new Ie(u);return t.ownerDocument=this,t.childNodes=new R,t.nodeName=e,t},createElementNS:function(e,t){var n=S(e,t),r=new De(u),i=r.attributes=new re;return r.childNodes=new R,r.ownerDocument=this,r.nodeName=t,r.tagName=t,r.namespaceURI=n[0],r.prefix=n[1],r.localName=n[2],i._ownerElement=r,r},createAttributeNS:function(e,t){var n=S(e,t),r=new Oe(u);return r.ownerDocument=this,r.childNodes=new R,r.nodeName=t,r.name=t,r.specified=!0,r.namespaceURI=n[0],r.prefix=n[1],r.localName=n[2],r}},w(de,W);function De(e){h(e),this._nsMap=Object.create(null)}De.prototype={nodeType:E,attributes:null,getQualifiedName:function(){return this.prefix?this.prefix+`:`+this.localName:this.localName},_isInHTMLDocumentAndNamespace:function(){return this.ownerDocument.type===`html`&&this.namespaceURI===l.HTML},hasAttributes:function(){return!!(this.attributes&&this.attributes.length)},hasAttribute:function(e){return!!this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t?t.value:null},getAttributeNode:function(e){return this._isInHTMLDocumentAndNamespace()&&(e=e.toLowerCase()),this.attributes.getNamedItem(e)},setAttribute:function(e,t){this._isInHTMLDocumentAndNamespace()&&(e=e.toLowerCase());var n=this.getAttributeNode(e);n?n.value=n.nodeValue=``+t:(n=this.ownerDocument._createAttribute(e),n.value=n.nodeValue=``+t,this.setAttributeNode(n))},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return this.getAttributeNodeNS(e,t)!=null},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n?n.value:null},setAttributeNS:function(e,t,n){var r=S(e,t)[2],i=this.getAttributeNodeNS(e,r);i?i.value=i.nodeValue=``+n:(i=this.ownerDocument.createAttributeNS(e,t),i.value=i.nodeValue=``+n,this.setAttributeNode(i))},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByClassName:function(e){var t=y(e);return new z(this,function(n){var r=[];return t.length>0&&ue(n,function(i){if(i!==n&&i.nodeType===E){var a=i.getAttribute(`class`);if(a){var o=e===a;if(!o){var s=y(a);o=t.every(b(s))}o&&r.push(i)}}}),r})},getElementsByTagName:function(e){var t=(this.nodeType===M?this:this.ownerDocument).type===`html`,n=e.toLowerCase();return new z(this,function(r){var i=[];return ue(r,function(a){a!==r&&a.nodeType===E&&(e===`*`||a.getQualifiedName()===(t&&a.namespaceURI===l.HTML?n:e))&&i.push(a)}),i})},getElementsByTagNameNS:function(e,t){return new z(this,function(n){var r=[];return ue(n,function(i){i===n||i.nodeType!==E||e!==`*`&&i.namespaceURI!==e||t!==`*`&&i.localName!=t||r.push(i)}),r})}},de.prototype.getElementsByClassName=De.prototype.getElementsByClassName,de.prototype.getElementsByTagName=De.prototype.getElementsByTagName,de.prototype.getElementsByTagNameNS=De.prototype.getElementsByTagNameNS,w(De,W);function Oe(e){h(e),this.namespaceURI=null,this.prefix=null,this.ownerElement=null}Oe.prototype.nodeType=D,w(Oe,W);function ke(e){h(e)}ke.prototype={data:``,substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},deleteData:function(e,t){this.replaceData(e,t,``)},replaceData:function(e,t,n){var r=this.data.substring(0,e),i=this.data.substring(e+t);n=r+n+i,this.nodeValue=this.data=n,this.length=n.length}},w(ke,W);function Ae(e){h(e)}Ae.prototype={nodeName:`#text`,nodeType:O,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var r=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}},w(Ae,ke);function je(e){h(e)}je.prototype={nodeName:`#comment`,nodeType:te},w(je,ke);function Me(e){h(e)}Me.prototype={nodeName:`#cdata-section`,nodeType:k},w(Me,Ae);function Ne(e){h(e)}Ne.prototype.nodeType=N,w(Ne,W);function Pe(e){h(e)}Pe.prototype.nodeType=ne,w(Pe,W);function Fe(e){h(e)}Fe.prototype.nodeType=A,w(Fe,W);function Ie(e){h(e)}Ie.prototype.nodeType=ee,w(Ie,W);function Le(e){h(e)}Le.prototype.nodeName=`#document-fragment`,Le.prototype.nodeType=P,w(Le,W);function Re(e){h(e)}Re.prototype.nodeType=j,w(Re,ke);function ze(){}ze.prototype.serializeToString=function(e,t){return Be.call(e,t)},W.prototype.toString=Be;function Be(e){var t=typeof e==`function`?{requireWellFormed:!1,splitCDATASections:!0,nodeFilter:e}:e==null?{requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null}:{requireWellFormed:!!e.requireWellFormed,splitCDATASections:e.splitCDATASections!==!1,nodeFilter:e.nodeFilter||null},n=[],r=this.nodeType===M&&this.documentElement||this,i=r.prefix,a=r.namespaceURI;if(a&&i==null){var i=r.lookupPrefix(a);if(i==null)var o=[{namespace:a,prefix:null}]}return Ue(this,n,o,t),n.join(``)}function Ve(e,t,n){var r=e.prefix||``,i=e.namespaceURI;if(!i||r===`xml`&&i===l.XML||i===l.XMLNS)return!1;for(var a=n.length;a--;){var o=n[a];if(o.prefix===r)return o.namespace!==i}return!0}function He(e,t,n,r){if(r&&!m.QName_exact.test(t))throw new f(`The attribute name "`+t+`" is not a valid XML QName`,p.InvalidStateError);e.push(` `,t,`="`,n.replace(/[<>&"\t\n\r]/g,le),`"`)}function Ue(e,t,n,r){n||=[];var i=r.nodeFilter,a=r.requireWellFormed,c=r.splitCDATASections,u=(e.nodeType===M?e:e.ownerDocument).type===`html`;G(e,{ns:n},{enter:function(e,n){var d=n.ns;if(i){if(e=i(e),e){if(typeof e==`string`)return t.push(e),null}else return null}switch(e.nodeType){case E:var h=e.attributes,g=h.length,_=e.tagName,v=_;if(!u&&!e.prefix&&e.namespaceURI){for(var y,b=0;b<h.length;b++)if(h.item(b).name===`xmlns`){y=h.item(b).value;break}if(!y)for(var x=d.length-1;x>=0;x--){var S=d[x];if(S.prefix===``&&S.namespace===e.namespaceURI){y=S.namespace;break}}if(y!==e.namespaceURI)for(var x=d.length-1;x>=0;x--){var S=d[x];if(S.namespace===e.namespaceURI){S.prefix&&(v=S.prefix+`:`+_);break}}}if(a&&!m.QName_exact.test(v))throw new f(`The element name "`+v+`" is not a valid XML QName`,p.InvalidStateError);t.push(`<`,v);for(var C=d.slice(),w=0;w<g;w++){var T=h.item(w);T.prefix==`xmlns`?C.push({prefix:T.localName,namespace:T.value}):T.nodeName==`xmlns`&&C.push({prefix:``,namespace:T.value})}for(var w=0;w<g;w++){var T=h.item(w);if(Ve(T,u,C)){var A=T.prefix||``,ne=T.namespaceURI;He(t,A?`xmlns:`+A:`xmlns`,ne,a),C.push({prefix:A,namespace:ne})}var F=i?i(T):T;F&&(typeof F==`string`?t.push(F):He(t,F.name,F.value,a))}if(_===v&&Ve(e,u,C)){var I=e.prefix||``,ne=e.namespaceURI;He(t,I?`xmlns:`+I:`xmlns`,ne,a),C.push({prefix:I,namespace:ne})}var L=!e.firstChild;if(L&&(u||e.namespaceURI===l.HTML)&&(L=s(_)),L)return t.push(`/>`),null;if(t.push(`>`),u&&o(_)){for(var R=e.firstChild;R;)R.data?t.push(R.data):Ue(R,t,C.slice(),r),R=R.nextSibling;return t.push(`</`,v,`>`),null}return{ns:C,tag:v};case M:case P:if(a&&e.nodeType===M&&e.documentElement==null)throw new f(`The Document has no documentElement`,p.InvalidStateError);return{ns:d};case D:return He(t,e.name,e.value,a),null;case O:if(a&&m.InvalidChar.test(e.data))throw new f(`The Text node data contains characters outside the XML Char production`,p.InvalidStateError);return t.push(e.data.replace(/[<&>]/g,le)),null;case k:if(a&&e.data.indexOf(`]]>`)!==-1)throw new f(`The CDATASection data contains "]]>"`,p.InvalidStateError);return c?t.push(m.CDATA_START,e.data.replace(/]]>/g,`]]]]><![CDATA[>`),m.CDATA_END):t.push(m.CDATA_START,e.data,m.CDATA_END),null;case te:if(a){if(m.InvalidChar.test(e.data))throw new f(`The comment node data contains characters outside the XML Char production`,p.InvalidStateError);if(e.data.indexOf(`--`)!==-1||e.data[e.data.length-1]===`-`)throw new f(`The comment node data contains "--" or ends with "-"`,p.InvalidStateError)}return t.push(m.COMMENT_START,e.data,m.COMMENT_END),null;case N:var z=e.publicId,B=e.systemId;if(a){if(!m.Name_exact.test(e.name))throw new f(`The doctype name "`+e.name+`" is not a valid XML Name`,p.InvalidStateError);if(z&&!m.PubidLiteral_match.test(z))throw new f(`DocumentType publicId is not a valid PubidLiteral`,p.InvalidStateError);if(B&&B!==`.`&&!m.SystemLiteral_match.test(B))throw new f(`DocumentType systemId is not a valid SystemLiteral`,p.InvalidStateError);if(e.internalSubset&&e.internalSubset.indexOf(`]>`)!==-1)throw new f(`DocumentType internalSubset contains "]>"`,p.InvalidStateError)}return t.push(m.DOCTYPE_DECL_START,` `,e.name),z?(t.push(` `,m.PUBLIC,` `,z),B&&B!==`.`&&t.push(` `,B)):B&&B!==`.`&&t.push(` `,m.SYSTEM,` `,B),e.internalSubset&&t.push(` [`,e.internalSubset,`]`),t.push(`>`),null;case j:if(a){if(!m.NCName_exact.test(e.target)||e.target.toLowerCase()===`xml`)throw new f(`The processing instruction target "`+e.target+`" is not a valid XML NCName or is reserved`,p.InvalidStateError);if(m.InvalidChar.test(e.data))throw new f(`The ProcessingInstruction data contains characters outside the XML Char production`,p.InvalidStateError);if(e.data.indexOf(`?>`)!==-1)throw new f(`The ProcessingInstruction data contains "?>"`,p.InvalidStateError)}return t.push(`<?`,e.target,` `,e.data,`?>`),null;case ee:if(a&&!m.Name_exact.test(e.nodeName))throw new f(`The entity reference name "`+e.nodeName+`" is not a valid XML Name`,p.InvalidStateError);return t.push(`&`,e.nodeName,`;`),null;default:return t.push(`??`,e.nodeName),null}},exit:function(e,n){n&&n.tag&&t.push(`</`,n.tag,`>`)}})}function We(e,t,n){var r;return G(t,null,{enter:function(t,i){var a=t.cloneNode(!1);return a.ownerDocument=e,a.parentNode=null,i===null?r=a:i.appendChild(a),t.nodeType===D||n?a:null}}),r}function Ge(e,t,n){var r;return G(t,null,{enter:function(t,a){var o=new t.constructor(u);for(var s in t)if(i(t,s)){var c=t[s];typeof c!=`object`&&c!=o[s]&&(o[s]=c)}t.childNodes&&(o.childNodes=new R),o.ownerDocument=e;var l=n;switch(o.nodeType){case E:var d=t.attributes,f=o.attributes=new re,p=d.length;f._ownerElement=o;for(var m=0;m<p;m++)o.setAttributeNode(Ge(e,d.item(m),!0));break;case D:l=!0}return a===null?r=o:a.appendChild(o),l?o:null}}),r}function Ke(e,t,n){e[t]=n}function qe(e){for(var t=[],n=e.firstChild;n;)n.nodeType===E&&t.push(n),n=n.nextSibling;return t}try{Object.defineProperty&&(Object.defineProperty(z.prototype,"length",{get:function(){return B(this),this.$$length}}),Object.defineProperty(W.prototype,"textContent",{get:function(){if(this.nodeType===E||this.nodeType===P){var e=[];return G(this,null,{enter:function(t){if(t.nodeType===E||t.nodeType===P)return!0;if(t.nodeType===j||t.nodeType===te)return null;e.push(t.nodeValue)}}),e.join(``)}return this.nodeValue},set:function(e){switch(this.nodeType){case E:case P:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),Object.defineProperty(ke.prototype,"data",{get:function(){return this._data==null?``:this._data},set:function(e){this._data=e,this.length=typeof e==`string`?e.length:0}}),Object.defineProperty(ke.prototype,"nodeValue",{get:function(){return this.data},set:function(e){this.data=e},enumerable:!0,configurable:!0}),Object.defineProperty(De.prototype,"children",{get:function(){return new z(this,qe)}}),Object.defineProperty(de.prototype,"children",{get:function(){return new z(this,qe)}}),Object.defineProperty(Le.prototype,"children",{get:function(){return new z(this,qe)}}),Ke=function(e,t,n){e[`$$`+t]=n})}catch{}e._updateLiveList=B,e.Attr=Oe,e.CDATASection=Me,e.CharacterData=ke,e.Comment=je,e.Document=de,e.DocumentFragment=Le,e.DocumentType=Ne,e.DOMImplementation=ce,e.Element=De,e.Entity=Fe,e.EntityReference=Ie,e.LiveNodeList=z,e.NamedNodeMap=re,e.Node=W,e.NodeList=R,e.Notation=Pe,e.Text=Ae,e.ProcessingInstruction=Re,e.walkDOM=G,e.XMLSerializer=ze})),Ci=/* @__PURE__ */ a((e=>{var t=yi().freeze;e.XML_ENTITIES=t({amp:`&`,apos:`'`,gt:`>`,lt:`<`,quot:`"`}),e.HTML_ENTITIES=t({Aacute:`Á`,aacute:`á`,Abreve:`Ă`,abreve:`ă`,ac:`∾`,acd:`∿`,acE:`∾̳`,Acirc:`Â`,acirc:`â`,acute:`´`,Acy:`А`,acy:`а`,AElig:`Æ`,aelig:`æ`,af:`⁡`,Afr:`𝔄`,afr:`𝔞`,Agrave:`À`,agrave:`à`,alefsym:`ℵ`,aleph:`ℵ`,Alpha:`Α`,alpha:`α`,Amacr:`Ā`,amacr:`ā`,amalg:`⨿`,AMP:`&`,amp:`&`,And:`⩓`,and:`∧`,andand:`⩕`,andd:`⩜`,andslope:`⩘`,andv:`⩚`,ang:`∠`,ange:`⦤`,angle:`∠`,angmsd:`∡`,angmsdaa:`⦨`,angmsdab:`⦩`,angmsdac:`⦪`,angmsdad:`⦫`,angmsdae:`⦬`,angmsdaf:`⦭`,angmsdag:`⦮`,angmsdah:`⦯`,angrt:`∟`,angrtvb:`⊾`,angrtvbd:`⦝`,angsph:`∢`,angst:`Å`,angzarr:`⍼`,Aogon:`Ą`,aogon:`ą`,Aopf:`𝔸`,aopf:`𝕒`,ap:`≈`,apacir:`⩯`,apE:`⩰`,ape:`≊`,apid:`≋`,apos:`'`,ApplyFunction:`⁡`,approx:`≈`,approxeq:`≊`,Aring:`Å`,aring:`å`,Ascr:`𝒜`,ascr:`𝒶`,Assign:`≔`,ast:`*`,asymp:`≈`,asympeq:`≍`,Atilde:`Ã`,atilde:`ã`,Auml:`Ä`,auml:`ä`,awconint:`∳`,awint:`⨑`,backcong:`≌`,backepsilon:`϶`,backprime:`‵`,backsim:`∽`,backsimeq:`⋍`,Backslash:`∖`,Barv:`⫧`,barvee:`⊽`,Barwed:`⌆`,barwed:`⌅`,barwedge:`⌅`,bbrk:`⎵`,bbrktbrk:`⎶`,bcong:`≌`,Bcy:`Б`,bcy:`б`,bdquo:`„`,becaus:`∵`,Because:`∵`,because:`∵`,bemptyv:`⦰`,bepsi:`϶`,bernou:`ℬ`,Bernoullis:`ℬ`,Beta:`Β`,beta:`β`,beth:`ℶ`,between:`≬`,Bfr:`𝔅`,bfr:`𝔟`,bigcap:`⋂`,bigcirc:`◯`,bigcup:`⋃`,bigodot:`⨀`,bigoplus:`⨁`,bigotimes:`⨂`,bigsqcup:`⨆`,bigstar:`★`,bigtriangledown:`▽`,bigtriangleup:`△`,biguplus:`⨄`,bigvee:`⋁`,bigwedge:`⋀`,bkarow:`⤍`,blacklozenge:`⧫`,blacksquare:`▪`,blacktriangle:`▴`,blacktriangledown:`▾`,blacktriangleleft:`◂`,blacktriangleright:`▸`,blank:`␣`,blk12:`▒`,blk14:`░`,blk34:`▓`,block:`█`,bne:`=⃥`,bnequiv:`≡⃥`,bNot:`⫭`,bnot:`⌐`,Bopf:`𝔹`,bopf:`𝕓`,bot:`⊥`,bottom:`⊥`,bowtie:`⋈`,boxbox:`⧉`,boxDL:`╗`,boxDl:`╖`,boxdL:`╕`,boxdl:`┐`,boxDR:`╔`,boxDr:`╓`,boxdR:`╒`,boxdr:`┌`,boxH:`═`,boxh:`─`,boxHD:`╦`,boxHd:`╤`,boxhD:`╥`,boxhd:`┬`,boxHU:`╩`,boxHu:`╧`,boxhU:`╨`,boxhu:`┴`,boxminus:`⊟`,boxplus:`⊞`,boxtimes:`⊠`,boxUL:`╝`,boxUl:`╜`,boxuL:`╛`,boxul:`┘`,boxUR:`╚`,boxUr:`╙`,boxuR:`╘`,boxur:`└`,boxV:`║`,boxv:`│`,boxVH:`╬`,boxVh:`╫`,boxvH:`╪`,boxvh:`┼`,boxVL:`╣`,boxVl:`╢`,boxvL:`╡`,boxvl:`┤`,boxVR:`╠`,boxVr:`╟`,boxvR:`╞`,boxvr:`├`,bprime:`‵`,Breve:`˘`,breve:`˘`,brvbar:`¦`,Bscr:`ℬ`,bscr:`𝒷`,bsemi:`⁏`,bsim:`∽`,bsime:`⋍`,bsol:`\\`,bsolb:`⧅`,bsolhsub:`⟈`,bull:`•`,bullet:`•`,bump:`≎`,bumpE:`⪮`,bumpe:`≏`,Bumpeq:`≎`,bumpeq:`≏`,Cacute:`Ć`,cacute:`ć`,Cap:`⋒`,cap:`∩`,capand:`⩄`,capbrcup:`⩉`,capcap:`⩋`,capcup:`⩇`,capdot:`⩀`,CapitalDifferentialD:`ⅅ`,caps:`∩︀`,caret:`⁁`,caron:`ˇ`,Cayleys:`ℭ`,ccaps:`⩍`,Ccaron:`Č`,ccaron:`č`,Ccedil:`Ç`,ccedil:`ç`,Ccirc:`Ĉ`,ccirc:`ĉ`,Cconint:`∰`,ccups:`⩌`,ccupssm:`⩐`,Cdot:`Ċ`,cdot:`ċ`,cedil:`¸`,Cedilla:`¸`,cemptyv:`⦲`,cent:`¢`,CenterDot:`·`,centerdot:`·`,Cfr:`ℭ`,cfr:`𝔠`,CHcy:`Ч`,chcy:`ч`,check:`✓`,checkmark:`✓`,Chi:`Χ`,chi:`χ`,cir:`○`,circ:`ˆ`,circeq:`≗`,circlearrowleft:`↺`,circlearrowright:`↻`,circledast:`⊛`,circledcirc:`⊚`,circleddash:`⊝`,CircleDot:`⊙`,circledR:`®`,circledS:`Ⓢ`,CircleMinus:`⊖`,CirclePlus:`⊕`,CircleTimes:`⊗`,cirE:`⧃`,cire:`≗`,cirfnint:`⨐`,cirmid:`⫯`,cirscir:`⧂`,ClockwiseContourIntegral:`∲`,CloseCurlyDoubleQuote:`”`,CloseCurlyQuote:`’`,clubs:`♣`,clubsuit:`♣`,Colon:`∷`,colon:`:`,Colone:`⩴`,colone:`≔`,coloneq:`≔`,comma:`,`,commat:`@`,comp:`∁`,compfn:`∘`,complement:`∁`,complexes:`ℂ`,cong:`≅`,congdot:`⩭`,Congruent:`≡`,Conint:`∯`,conint:`∮`,ContourIntegral:`∮`,Copf:`ℂ`,copf:`𝕔`,coprod:`∐`,Coproduct:`∐`,COPY:`©`,copy:`©`,copysr:`℗`,CounterClockwiseContourIntegral:`∳`,crarr:`↵`,Cross:`⨯`,cross:`✗`,Cscr:`𝒞`,cscr:`𝒸`,csub:`⫏`,csube:`⫑`,csup:`⫐`,csupe:`⫒`,ctdot:`⋯`,cudarrl:`⤸`,cudarrr:`⤵`,cuepr:`⋞`,cuesc:`⋟`,cularr:`↶`,cularrp:`⤽`,Cup:`⋓`,cup:`∪`,cupbrcap:`⩈`,CupCap:`≍`,cupcap:`⩆`,cupcup:`⩊`,cupdot:`⊍`,cupor:`⩅`,cups:`∪︀`,curarr:`↷`,curarrm:`⤼`,curlyeqprec:`⋞`,curlyeqsucc:`⋟`,curlyvee:`⋎`,curlywedge:`⋏`,curren:`¤`,curvearrowleft:`↶`,curvearrowright:`↷`,cuvee:`⋎`,cuwed:`⋏`,cwconint:`∲`,cwint:`∱`,cylcty:`⌭`,Dagger:`‡`,dagger:`†`,daleth:`ℸ`,Darr:`↡`,dArr:`⇓`,darr:`↓`,dash:`‐`,Dashv:`⫤`,dashv:`⊣`,dbkarow:`⤏`,dblac:`˝`,Dcaron:`Ď`,dcaron:`ď`,Dcy:`Д`,dcy:`д`,DD:`ⅅ`,dd:`ⅆ`,ddagger:`‡`,ddarr:`⇊`,DDotrahd:`⤑`,ddotseq:`⩷`,deg:`°`,Del:`∇`,Delta:`Δ`,delta:`δ`,demptyv:`⦱`,dfisht:`⥿`,Dfr:`𝔇`,dfr:`𝔡`,dHar:`⥥`,dharl:`⇃`,dharr:`⇂`,DiacriticalAcute:`´`,DiacriticalDot:`˙`,DiacriticalDoubleAcute:`˝`,DiacriticalGrave:"`",DiacriticalTilde:`˜`,diam:`⋄`,Diamond:`⋄`,diamond:`⋄`,diamondsuit:`♦`,diams:`♦`,die:`¨`,DifferentialD:`ⅆ`,digamma:`ϝ`,disin:`⋲`,div:`÷`,divide:`÷`,divideontimes:`⋇`,divonx:`⋇`,DJcy:`Ђ`,djcy:`ђ`,dlcorn:`⌞`,dlcrop:`⌍`,dollar:`$`,Dopf:`𝔻`,dopf:`𝕕`,Dot:`¨`,dot:`˙`,DotDot:`⃜`,doteq:`≐`,doteqdot:`≑`,DotEqual:`≐`,dotminus:`∸`,dotplus:`∔`,dotsquare:`⊡`,doublebarwedge:`⌆`,DoubleContourIntegral:`∯`,DoubleDot:`¨`,DoubleDownArrow:`⇓`,DoubleLeftArrow:`⇐`,DoubleLeftRightArrow:`⇔`,DoubleLeftTee:`⫤`,DoubleLongLeftArrow:`⟸`,DoubleLongLeftRightArrow:`⟺`,DoubleLongRightArrow:`⟹`,DoubleRightArrow:`⇒`,DoubleRightTee:`⊨`,DoubleUpArrow:`⇑`,DoubleUpDownArrow:`⇕`,DoubleVerticalBar:`∥`,DownArrow:`↓`,Downarrow:`⇓`,downarrow:`↓`,DownArrowBar:`⤓`,DownArrowUpArrow:`⇵`,DownBreve:`̑`,downdownarrows:`⇊`,downharpoonleft:`⇃`,downharpoonright:`⇂`,DownLeftRightVector:`⥐`,DownLeftTeeVector:`⥞`,DownLeftVector:`↽`,DownLeftVectorBar:`⥖`,DownRightTeeVector:`⥟`,DownRightVector:`⇁`,DownRightVectorBar:`⥗`,DownTee:`⊤`,DownTeeArrow:`↧`,drbkarow:`⤐`,drcorn:`⌟`,drcrop:`⌌`,Dscr:`𝒟`,dscr:`𝒹`,DScy:`Ѕ`,dscy:`ѕ`,dsol:`⧶`,Dstrok:`Đ`,dstrok:`đ`,dtdot:`⋱`,dtri:`▿`,dtrif:`▾`,duarr:`⇵`,duhar:`⥯`,dwangle:`⦦`,DZcy:`Џ`,dzcy:`џ`,dzigrarr:`⟿`,Eacute:`É`,eacute:`é`,easter:`⩮`,Ecaron:`Ě`,ecaron:`ě`,ecir:`≖`,Ecirc:`Ê`,ecirc:`ê`,ecolon:`≕`,Ecy:`Э`,ecy:`э`,eDDot:`⩷`,Edot:`Ė`,eDot:`≑`,edot:`ė`,ee:`ⅇ`,efDot:`≒`,Efr:`𝔈`,efr:`𝔢`,eg:`⪚`,Egrave:`È`,egrave:`è`,egs:`⪖`,egsdot:`⪘`,el:`⪙`,Element:`∈`,elinters:`⏧`,ell:`ℓ`,els:`⪕`,elsdot:`⪗`,Emacr:`Ē`,emacr:`ē`,empty:`∅`,emptyset:`∅`,EmptySmallSquare:`◻`,emptyv:`∅`,EmptyVerySmallSquare:`▫`,emsp:` `,emsp13:` `,emsp14:` `,ENG:`Ŋ`,eng:`ŋ`,ensp:` `,Eogon:`Ę`,eogon:`ę`,Eopf:`𝔼`,eopf:`𝕖`,epar:`⋕`,eparsl:`⧣`,eplus:`⩱`,epsi:`ε`,Epsilon:`Ε`,epsilon:`ε`,epsiv:`ϵ`,eqcirc:`≖`,eqcolon:`≕`,eqsim:`≂`,eqslantgtr:`⪖`,eqslantless:`⪕`,Equal:`⩵`,equals:`=`,EqualTilde:`≂`,equest:`≟`,Equilibrium:`⇌`,equiv:`≡`,equivDD:`⩸`,eqvparsl:`⧥`,erarr:`⥱`,erDot:`≓`,Escr:`ℰ`,escr:`ℯ`,esdot:`≐`,Esim:`⩳`,esim:`≂`,Eta:`Η`,eta:`η`,ETH:`Ð`,eth:`ð`,Euml:`Ë`,euml:`ë`,euro:`€`,excl:`!`,exist:`∃`,Exists:`∃`,expectation:`ℰ`,ExponentialE:`ⅇ`,exponentiale:`ⅇ`,fallingdotseq:`≒`,Fcy:`Ф`,fcy:`ф`,female:`♀`,ffilig:`ffi`,fflig:`ff`,ffllig:`ffl`,Ffr:`𝔉`,ffr:`𝔣`,filig:`fi`,FilledSmallSquare:`◼`,FilledVerySmallSquare:`▪`,fjlig:`fj`,flat:`♭`,fllig:`fl`,fltns:`▱`,fnof:`ƒ`,Fopf:`𝔽`,fopf:`𝕗`,ForAll:`∀`,forall:`∀`,fork:`⋔`,forkv:`⫙`,Fouriertrf:`ℱ`,fpartint:`⨍`,frac12:`½`,frac13:`⅓`,frac14:`¼`,frac15:`⅕`,frac16:`⅙`,frac18:`⅛`,frac23:`⅔`,frac25:`⅖`,frac34:`¾`,frac35:`⅗`,frac38:`⅜`,frac45:`⅘`,frac56:`⅚`,frac58:`⅝`,frac78:`⅞`,frasl:`⁄`,frown:`⌢`,Fscr:`ℱ`,fscr:`𝒻`,gacute:`ǵ`,Gamma:`Γ`,gamma:`γ`,Gammad:`Ϝ`,gammad:`ϝ`,gap:`⪆`,Gbreve:`Ğ`,gbreve:`ğ`,Gcedil:`Ģ`,Gcirc:`Ĝ`,gcirc:`ĝ`,Gcy:`Г`,gcy:`г`,Gdot:`Ġ`,gdot:`ġ`,gE:`≧`,ge:`≥`,gEl:`⪌`,gel:`⋛`,geq:`≥`,geqq:`≧`,geqslant:`⩾`,ges:`⩾`,gescc:`⪩`,gesdot:`⪀`,gesdoto:`⪂`,gesdotol:`⪄`,gesl:`⋛︀`,gesles:`⪔`,Gfr:`𝔊`,gfr:`𝔤`,Gg:`⋙`,gg:`≫`,ggg:`⋙`,gimel:`ℷ`,GJcy:`Ѓ`,gjcy:`ѓ`,gl:`≷`,gla:`⪥`,glE:`⪒`,glj:`⪤`,gnap:`⪊`,gnapprox:`⪊`,gnE:`≩`,gne:`⪈`,gneq:`⪈`,gneqq:`≩`,gnsim:`⋧`,Gopf:`𝔾`,gopf:`𝕘`,grave:"`",GreaterEqual:`≥`,GreaterEqualLess:`⋛`,GreaterFullEqual:`≧`,GreaterGreater:`⪢`,GreaterLess:`≷`,GreaterSlantEqual:`⩾`,GreaterTilde:`≳`,Gscr:`𝒢`,gscr:`ℊ`,gsim:`≳`,gsime:`⪎`,gsiml:`⪐`,Gt:`≫`,GT:`>`,gt:`>`,gtcc:`⪧`,gtcir:`⩺`,gtdot:`⋗`,gtlPar:`⦕`,gtquest:`⩼`,gtrapprox:`⪆`,gtrarr:`⥸`,gtrdot:`⋗`,gtreqless:`⋛`,gtreqqless:`⪌`,gtrless:`≷`,gtrsim:`≳`,gvertneqq:`≩︀`,gvnE:`≩︀`,Hacek:`ˇ`,hairsp:` `,half:`½`,hamilt:`ℋ`,HARDcy:`Ъ`,hardcy:`ъ`,hArr:`⇔`,harr:`↔`,harrcir:`⥈`,harrw:`↭`,Hat:`^`,hbar:`ℏ`,Hcirc:`Ĥ`,hcirc:`ĥ`,hearts:`♥`,heartsuit:`♥`,hellip:`…`,hercon:`⊹`,Hfr:`ℌ`,hfr:`𝔥`,HilbertSpace:`ℋ`,hksearow:`⤥`,hkswarow:`⤦`,hoarr:`⇿`,homtht:`∻`,hookleftarrow:`↩`,hookrightarrow:`↪`,Hopf:`ℍ`,hopf:`𝕙`,horbar:`―`,HorizontalLine:`─`,Hscr:`ℋ`,hscr:`𝒽`,hslash:`ℏ`,Hstrok:`Ħ`,hstrok:`ħ`,HumpDownHump:`≎`,HumpEqual:`≏`,hybull:`⁃`,hyphen:`‐`,Iacute:`Í`,iacute:`í`,ic:`⁣`,Icirc:`Î`,icirc:`î`,Icy:`И`,icy:`и`,Idot:`İ`,IEcy:`Е`,iecy:`е`,iexcl:`¡`,iff:`⇔`,Ifr:`ℑ`,ifr:`𝔦`,Igrave:`Ì`,igrave:`ì`,ii:`ⅈ`,iiiint:`⨌`,iiint:`∭`,iinfin:`⧜`,iiota:`℩`,IJlig:`IJ`,ijlig:`ij`,Im:`ℑ`,Imacr:`Ī`,imacr:`ī`,image:`ℑ`,ImaginaryI:`ⅈ`,imagline:`ℐ`,imagpart:`ℑ`,imath:`ı`,imof:`⊷`,imped:`Ƶ`,Implies:`⇒`,in:`∈`,incare:`℅`,infin:`∞`,infintie:`⧝`,inodot:`ı`,Int:`∬`,int:`∫`,intcal:`⊺`,integers:`ℤ`,Integral:`∫`,intercal:`⊺`,Intersection:`⋂`,intlarhk:`⨗`,intprod:`⨼`,InvisibleComma:`⁣`,InvisibleTimes:`⁢`,IOcy:`Ё`,iocy:`ё`,Iogon:`Į`,iogon:`į`,Iopf:`𝕀`,iopf:`𝕚`,Iota:`Ι`,iota:`ι`,iprod:`⨼`,iquest:`¿`,Iscr:`ℐ`,iscr:`𝒾`,isin:`∈`,isindot:`⋵`,isinE:`⋹`,isins:`⋴`,isinsv:`⋳`,isinv:`∈`,it:`⁢`,Itilde:`Ĩ`,itilde:`ĩ`,Iukcy:`І`,iukcy:`і`,Iuml:`Ï`,iuml:`ï`,Jcirc:`Ĵ`,jcirc:`ĵ`,Jcy:`Й`,jcy:`й`,Jfr:`𝔍`,jfr:`𝔧`,jmath:`ȷ`,Jopf:`𝕁`,jopf:`𝕛`,Jscr:`𝒥`,jscr:`𝒿`,Jsercy:`Ј`,jsercy:`ј`,Jukcy:`Є`,jukcy:`є`,Kappa:`Κ`,kappa:`κ`,kappav:`ϰ`,Kcedil:`Ķ`,kcedil:`ķ`,Kcy:`К`,kcy:`к`,Kfr:`𝔎`,kfr:`𝔨`,kgreen:`ĸ`,KHcy:`Х`,khcy:`х`,KJcy:`Ќ`,kjcy:`ќ`,Kopf:`𝕂`,kopf:`𝕜`,Kscr:`𝒦`,kscr:`𝓀`,lAarr:`⇚`,Lacute:`Ĺ`,lacute:`ĺ`,laemptyv:`⦴`,lagran:`ℒ`,Lambda:`Λ`,lambda:`λ`,Lang:`⟪`,lang:`⟨`,langd:`⦑`,langle:`⟨`,lap:`⪅`,Laplacetrf:`ℒ`,laquo:`«`,Larr:`↞`,lArr:`⇐`,larr:`←`,larrb:`⇤`,larrbfs:`⤟`,larrfs:`⤝`,larrhk:`↩`,larrlp:`↫`,larrpl:`⤹`,larrsim:`⥳`,larrtl:`↢`,lat:`⪫`,lAtail:`⤛`,latail:`⤙`,late:`⪭`,lates:`⪭︀`,lBarr:`⤎`,lbarr:`⤌`,lbbrk:`❲`,lbrace:`{`,lbrack:`[`,lbrke:`⦋`,lbrksld:`⦏`,lbrkslu:`⦍`,Lcaron:`Ľ`,lcaron:`ľ`,Lcedil:`Ļ`,lcedil:`ļ`,lceil:`⌈`,lcub:`{`,Lcy:`Л`,lcy:`л`,ldca:`⤶`,ldquo:`“`,ldquor:`„`,ldrdhar:`⥧`,ldrushar:`⥋`,ldsh:`↲`,lE:`≦`,le:`≤`,LeftAngleBracket:`⟨`,LeftArrow:`←`,Leftarrow:`⇐`,leftarrow:`←`,LeftArrowBar:`⇤`,LeftArrowRightArrow:`⇆`,leftarrowtail:`↢`,LeftCeiling:`⌈`,LeftDoubleBracket:`⟦`,LeftDownTeeVector:`⥡`,LeftDownVector:`⇃`,LeftDownVectorBar:`⥙`,LeftFloor:`⌊`,leftharpoondown:`↽`,leftharpoonup:`↼`,leftleftarrows:`⇇`,LeftRightArrow:`↔`,Leftrightarrow:`⇔`,leftrightarrow:`↔`,leftrightarrows:`⇆`,leftrightharpoons:`⇋`,leftrightsquigarrow:`↭`,LeftRightVector:`⥎`,LeftTee:`⊣`,LeftTeeArrow:`↤`,LeftTeeVector:`⥚`,leftthreetimes:`⋋`,LeftTriangle:`⊲`,LeftTriangleBar:`⧏`,LeftTriangleEqual:`⊴`,LeftUpDownVector:`⥑`,LeftUpTeeVector:`⥠`,LeftUpVector:`↿`,LeftUpVectorBar:`⥘`,LeftVector:`↼`,LeftVectorBar:`⥒`,lEg:`⪋`,leg:`⋚`,leq:`≤`,leqq:`≦`,leqslant:`⩽`,les:`⩽`,lescc:`⪨`,lesdot:`⩿`,lesdoto:`⪁`,lesdotor:`⪃`,lesg:`⋚︀`,lesges:`⪓`,lessapprox:`⪅`,lessdot:`⋖`,lesseqgtr:`⋚`,lesseqqgtr:`⪋`,LessEqualGreater:`⋚`,LessFullEqual:`≦`,LessGreater:`≶`,lessgtr:`≶`,LessLess:`⪡`,lesssim:`≲`,LessSlantEqual:`⩽`,LessTilde:`≲`,lfisht:`⥼`,lfloor:`⌊`,Lfr:`𝔏`,lfr:`𝔩`,lg:`≶`,lgE:`⪑`,lHar:`⥢`,lhard:`↽`,lharu:`↼`,lharul:`⥪`,lhblk:`▄`,LJcy:`Љ`,ljcy:`љ`,Ll:`⋘`,ll:`≪`,llarr:`⇇`,llcorner:`⌞`,Lleftarrow:`⇚`,llhard:`⥫`,lltri:`◺`,Lmidot:`Ŀ`,lmidot:`ŀ`,lmoust:`⎰`,lmoustache:`⎰`,lnap:`⪉`,lnapprox:`⪉`,lnE:`≨`,lne:`⪇`,lneq:`⪇`,lneqq:`≨`,lnsim:`⋦`,loang:`⟬`,loarr:`⇽`,lobrk:`⟦`,LongLeftArrow:`⟵`,Longleftarrow:`⟸`,longleftarrow:`⟵`,LongLeftRightArrow:`⟷`,Longleftrightarrow:`⟺`,longleftrightarrow:`⟷`,longmapsto:`⟼`,LongRightArrow:`⟶`,Longrightarrow:`⟹`,longrightarrow:`⟶`,looparrowleft:`↫`,looparrowright:`↬`,lopar:`⦅`,Lopf:`𝕃`,lopf:`𝕝`,loplus:`⨭`,lotimes:`⨴`,lowast:`∗`,lowbar:`_`,LowerLeftArrow:`↙`,LowerRightArrow:`↘`,loz:`◊`,lozenge:`◊`,lozf:`⧫`,lpar:`(`,lparlt:`⦓`,lrarr:`⇆`,lrcorner:`⌟`,lrhar:`⇋`,lrhard:`⥭`,lrm:`‎`,lrtri:`⊿`,lsaquo:`‹`,Lscr:`ℒ`,lscr:`𝓁`,Lsh:`↰`,lsh:`↰`,lsim:`≲`,lsime:`⪍`,lsimg:`⪏`,lsqb:`[`,lsquo:`‘`,lsquor:`‚`,Lstrok:`Ł`,lstrok:`ł`,Lt:`≪`,LT:`<`,lt:`<`,ltcc:`⪦`,ltcir:`⩹`,ltdot:`⋖`,lthree:`⋋`,ltimes:`⋉`,ltlarr:`⥶`,ltquest:`⩻`,ltri:`◃`,ltrie:`⊴`,ltrif:`◂`,ltrPar:`⦖`,lurdshar:`⥊`,luruhar:`⥦`,lvertneqq:`≨︀`,lvnE:`≨︀`,macr:`¯`,male:`♂`,malt:`✠`,maltese:`✠`,Map:`⤅`,map:`↦`,mapsto:`↦`,mapstodown:`↧`,mapstoleft:`↤`,mapstoup:`↥`,marker:`▮`,mcomma:`⨩`,Mcy:`М`,mcy:`м`,mdash:`—`,mDDot:`∺`,measuredangle:`∡`,MediumSpace:` `,Mellintrf:`ℳ`,Mfr:`𝔐`,mfr:`𝔪`,mho:`℧`,micro:`µ`,mid:`∣`,midast:`*`,midcir:`⫰`,middot:`·`,minus:`−`,minusb:`⊟`,minusd:`∸`,minusdu:`⨪`,MinusPlus:`∓`,mlcp:`⫛`,mldr:`…`,mnplus:`∓`,models:`⊧`,Mopf:`𝕄`,mopf:`𝕞`,mp:`∓`,Mscr:`ℳ`,mscr:`𝓂`,mstpos:`∾`,Mu:`Μ`,mu:`μ`,multimap:`⊸`,mumap:`⊸`,nabla:`∇`,Nacute:`Ń`,nacute:`ń`,nang:`∠⃒`,nap:`≉`,napE:`⩰̸`,napid:`≋̸`,napos:`ʼn`,napprox:`≉`,natur:`♮`,natural:`♮`,naturals:`ℕ`,nbsp:`\xA0`,nbump:`≎̸`,nbumpe:`≏̸`,ncap:`⩃`,Ncaron:`Ň`,ncaron:`ň`,Ncedil:`Ņ`,ncedil:`ņ`,ncong:`≇`,ncongdot:`⩭̸`,ncup:`⩂`,Ncy:`Н`,ncy:`н`,ndash:`–`,ne:`≠`,nearhk:`⤤`,neArr:`⇗`,nearr:`↗`,nearrow:`↗`,nedot:`≐̸`,NegativeMediumSpace:`​`,NegativeThickSpace:`​`,NegativeThinSpace:`​`,NegativeVeryThinSpace:`​`,nequiv:`≢`,nesear:`⤨`,nesim:`≂̸`,NestedGreaterGreater:`≫`,NestedLessLess:`≪`,NewLine:`
17
+ `,nexist:`∄`,nexists:`∄`,Nfr:`𝔑`,nfr:`𝔫`,ngE:`≧̸`,nge:`≱`,ngeq:`≱`,ngeqq:`≧̸`,ngeqslant:`⩾̸`,nges:`⩾̸`,nGg:`⋙̸`,ngsim:`≵`,nGt:`≫⃒`,ngt:`≯`,ngtr:`≯`,nGtv:`≫̸`,nhArr:`⇎`,nharr:`↮`,nhpar:`⫲`,ni:`∋`,nis:`⋼`,nisd:`⋺`,niv:`∋`,NJcy:`Њ`,njcy:`њ`,nlArr:`⇍`,nlarr:`↚`,nldr:`‥`,nlE:`≦̸`,nle:`≰`,nLeftarrow:`⇍`,nleftarrow:`↚`,nLeftrightarrow:`⇎`,nleftrightarrow:`↮`,nleq:`≰`,nleqq:`≦̸`,nleqslant:`⩽̸`,nles:`⩽̸`,nless:`≮`,nLl:`⋘̸`,nlsim:`≴`,nLt:`≪⃒`,nlt:`≮`,nltri:`⋪`,nltrie:`⋬`,nLtv:`≪̸`,nmid:`∤`,NoBreak:`⁠`,NonBreakingSpace:`\xA0`,Nopf:`ℕ`,nopf:`𝕟`,Not:`⫬`,not:`¬`,NotCongruent:`≢`,NotCupCap:`≭`,NotDoubleVerticalBar:`∦`,NotElement:`∉`,NotEqual:`≠`,NotEqualTilde:`≂̸`,NotExists:`∄`,NotGreater:`≯`,NotGreaterEqual:`≱`,NotGreaterFullEqual:`≧̸`,NotGreaterGreater:`≫̸`,NotGreaterLess:`≹`,NotGreaterSlantEqual:`⩾̸`,NotGreaterTilde:`≵`,NotHumpDownHump:`≎̸`,NotHumpEqual:`≏̸`,notin:`∉`,notindot:`⋵̸`,notinE:`⋹̸`,notinva:`∉`,notinvb:`⋷`,notinvc:`⋶`,NotLeftTriangle:`⋪`,NotLeftTriangleBar:`⧏̸`,NotLeftTriangleEqual:`⋬`,NotLess:`≮`,NotLessEqual:`≰`,NotLessGreater:`≸`,NotLessLess:`≪̸`,NotLessSlantEqual:`⩽̸`,NotLessTilde:`≴`,NotNestedGreaterGreater:`⪢̸`,NotNestedLessLess:`⪡̸`,notni:`∌`,notniva:`∌`,notnivb:`⋾`,notnivc:`⋽`,NotPrecedes:`⊀`,NotPrecedesEqual:`⪯̸`,NotPrecedesSlantEqual:`⋠`,NotReverseElement:`∌`,NotRightTriangle:`⋫`,NotRightTriangleBar:`⧐̸`,NotRightTriangleEqual:`⋭`,NotSquareSubset:`⊏̸`,NotSquareSubsetEqual:`⋢`,NotSquareSuperset:`⊐̸`,NotSquareSupersetEqual:`⋣`,NotSubset:`⊂⃒`,NotSubsetEqual:`⊈`,NotSucceeds:`⊁`,NotSucceedsEqual:`⪰̸`,NotSucceedsSlantEqual:`⋡`,NotSucceedsTilde:`≿̸`,NotSuperset:`⊃⃒`,NotSupersetEqual:`⊉`,NotTilde:`≁`,NotTildeEqual:`≄`,NotTildeFullEqual:`≇`,NotTildeTilde:`≉`,NotVerticalBar:`∤`,npar:`∦`,nparallel:`∦`,nparsl:`⫽⃥`,npart:`∂̸`,npolint:`⨔`,npr:`⊀`,nprcue:`⋠`,npre:`⪯̸`,nprec:`⊀`,npreceq:`⪯̸`,nrArr:`⇏`,nrarr:`↛`,nrarrc:`⤳̸`,nrarrw:`↝̸`,nRightarrow:`⇏`,nrightarrow:`↛`,nrtri:`⋫`,nrtrie:`⋭`,nsc:`⊁`,nsccue:`⋡`,nsce:`⪰̸`,Nscr:`𝒩`,nscr:`𝓃`,nshortmid:`∤`,nshortparallel:`∦`,nsim:`≁`,nsime:`≄`,nsimeq:`≄`,nsmid:`∤`,nspar:`∦`,nsqsube:`⋢`,nsqsupe:`⋣`,nsub:`⊄`,nsubE:`⫅̸`,nsube:`⊈`,nsubset:`⊂⃒`,nsubseteq:`⊈`,nsubseteqq:`⫅̸`,nsucc:`⊁`,nsucceq:`⪰̸`,nsup:`⊅`,nsupE:`⫆̸`,nsupe:`⊉`,nsupset:`⊃⃒`,nsupseteq:`⊉`,nsupseteqq:`⫆̸`,ntgl:`≹`,Ntilde:`Ñ`,ntilde:`ñ`,ntlg:`≸`,ntriangleleft:`⋪`,ntrianglelefteq:`⋬`,ntriangleright:`⋫`,ntrianglerighteq:`⋭`,Nu:`Ν`,nu:`ν`,num:`#`,numero:`№`,numsp:` `,nvap:`≍⃒`,nVDash:`⊯`,nVdash:`⊮`,nvDash:`⊭`,nvdash:`⊬`,nvge:`≥⃒`,nvgt:`>⃒`,nvHarr:`⤄`,nvinfin:`⧞`,nvlArr:`⤂`,nvle:`≤⃒`,nvlt:`<⃒`,nvltrie:`⊴⃒`,nvrArr:`⤃`,nvrtrie:`⊵⃒`,nvsim:`∼⃒`,nwarhk:`⤣`,nwArr:`⇖`,nwarr:`↖`,nwarrow:`↖`,nwnear:`⤧`,Oacute:`Ó`,oacute:`ó`,oast:`⊛`,ocir:`⊚`,Ocirc:`Ô`,ocirc:`ô`,Ocy:`О`,ocy:`о`,odash:`⊝`,Odblac:`Ő`,odblac:`ő`,odiv:`⨸`,odot:`⊙`,odsold:`⦼`,OElig:`Œ`,oelig:`œ`,ofcir:`⦿`,Ofr:`𝔒`,ofr:`𝔬`,ogon:`˛`,Ograve:`Ò`,ograve:`ò`,ogt:`⧁`,ohbar:`⦵`,ohm:`Ω`,oint:`∮`,olarr:`↺`,olcir:`⦾`,olcross:`⦻`,oline:`‾`,olt:`⧀`,Omacr:`Ō`,omacr:`ō`,Omega:`Ω`,omega:`ω`,Omicron:`Ο`,omicron:`ο`,omid:`⦶`,ominus:`⊖`,Oopf:`𝕆`,oopf:`𝕠`,opar:`⦷`,OpenCurlyDoubleQuote:`“`,OpenCurlyQuote:`‘`,operp:`⦹`,oplus:`⊕`,Or:`⩔`,or:`∨`,orarr:`↻`,ord:`⩝`,order:`ℴ`,orderof:`ℴ`,ordf:`ª`,ordm:`º`,origof:`⊶`,oror:`⩖`,orslope:`⩗`,orv:`⩛`,oS:`Ⓢ`,Oscr:`𝒪`,oscr:`ℴ`,Oslash:`Ø`,oslash:`ø`,osol:`⊘`,Otilde:`Õ`,otilde:`õ`,Otimes:`⨷`,otimes:`⊗`,otimesas:`⨶`,Ouml:`Ö`,ouml:`ö`,ovbar:`⌽`,OverBar:`‾`,OverBrace:`⏞`,OverBracket:`⎴`,OverParenthesis:`⏜`,par:`∥`,para:`¶`,parallel:`∥`,parsim:`⫳`,parsl:`⫽`,part:`∂`,PartialD:`∂`,Pcy:`П`,pcy:`п`,percnt:`%`,period:`.`,permil:`‰`,perp:`⊥`,pertenk:`‱`,Pfr:`𝔓`,pfr:`𝔭`,Phi:`Φ`,phi:`φ`,phiv:`ϕ`,phmmat:`ℳ`,phone:`☎`,Pi:`Π`,pi:`π`,pitchfork:`⋔`,piv:`ϖ`,planck:`ℏ`,planckh:`ℎ`,plankv:`ℏ`,plus:`+`,plusacir:`⨣`,plusb:`⊞`,pluscir:`⨢`,plusdo:`∔`,plusdu:`⨥`,pluse:`⩲`,PlusMinus:`±`,plusmn:`±`,plussim:`⨦`,plustwo:`⨧`,pm:`±`,Poincareplane:`ℌ`,pointint:`⨕`,Popf:`ℙ`,popf:`𝕡`,pound:`£`,Pr:`⪻`,pr:`≺`,prap:`⪷`,prcue:`≼`,prE:`⪳`,pre:`⪯`,prec:`≺`,precapprox:`⪷`,preccurlyeq:`≼`,Precedes:`≺`,PrecedesEqual:`⪯`,PrecedesSlantEqual:`≼`,PrecedesTilde:`≾`,preceq:`⪯`,precnapprox:`⪹`,precneqq:`⪵`,precnsim:`⋨`,precsim:`≾`,Prime:`″`,prime:`′`,primes:`ℙ`,prnap:`⪹`,prnE:`⪵`,prnsim:`⋨`,prod:`∏`,Product:`∏`,profalar:`⌮`,profline:`⌒`,profsurf:`⌓`,prop:`∝`,Proportion:`∷`,Proportional:`∝`,propto:`∝`,prsim:`≾`,prurel:`⊰`,Pscr:`𝒫`,pscr:`𝓅`,Psi:`Ψ`,psi:`ψ`,puncsp:` `,Qfr:`𝔔`,qfr:`𝔮`,qint:`⨌`,Qopf:`ℚ`,qopf:`𝕢`,qprime:`⁗`,Qscr:`𝒬`,qscr:`𝓆`,quaternions:`ℍ`,quatint:`⨖`,quest:`?`,questeq:`≟`,QUOT:`"`,quot:`"`,rAarr:`⇛`,race:`∽̱`,Racute:`Ŕ`,racute:`ŕ`,radic:`√`,raemptyv:`⦳`,Rang:`⟫`,rang:`⟩`,rangd:`⦒`,range:`⦥`,rangle:`⟩`,raquo:`»`,Rarr:`↠`,rArr:`⇒`,rarr:`→`,rarrap:`⥵`,rarrb:`⇥`,rarrbfs:`⤠`,rarrc:`⤳`,rarrfs:`⤞`,rarrhk:`↪`,rarrlp:`↬`,rarrpl:`⥅`,rarrsim:`⥴`,Rarrtl:`⤖`,rarrtl:`↣`,rarrw:`↝`,rAtail:`⤜`,ratail:`⤚`,ratio:`∶`,rationals:`ℚ`,RBarr:`⤐`,rBarr:`⤏`,rbarr:`⤍`,rbbrk:`❳`,rbrace:`}`,rbrack:`]`,rbrke:`⦌`,rbrksld:`⦎`,rbrkslu:`⦐`,Rcaron:`Ř`,rcaron:`ř`,Rcedil:`Ŗ`,rcedil:`ŗ`,rceil:`⌉`,rcub:`}`,Rcy:`Р`,rcy:`р`,rdca:`⤷`,rdldhar:`⥩`,rdquo:`”`,rdquor:`”`,rdsh:`↳`,Re:`ℜ`,real:`ℜ`,realine:`ℛ`,realpart:`ℜ`,reals:`ℝ`,rect:`▭`,REG:`®`,reg:`®`,ReverseElement:`∋`,ReverseEquilibrium:`⇋`,ReverseUpEquilibrium:`⥯`,rfisht:`⥽`,rfloor:`⌋`,Rfr:`ℜ`,rfr:`𝔯`,rHar:`⥤`,rhard:`⇁`,rharu:`⇀`,rharul:`⥬`,Rho:`Ρ`,rho:`ρ`,rhov:`ϱ`,RightAngleBracket:`⟩`,RightArrow:`→`,Rightarrow:`⇒`,rightarrow:`→`,RightArrowBar:`⇥`,RightArrowLeftArrow:`⇄`,rightarrowtail:`↣`,RightCeiling:`⌉`,RightDoubleBracket:`⟧`,RightDownTeeVector:`⥝`,RightDownVector:`⇂`,RightDownVectorBar:`⥕`,RightFloor:`⌋`,rightharpoondown:`⇁`,rightharpoonup:`⇀`,rightleftarrows:`⇄`,rightleftharpoons:`⇌`,rightrightarrows:`⇉`,rightsquigarrow:`↝`,RightTee:`⊢`,RightTeeArrow:`↦`,RightTeeVector:`⥛`,rightthreetimes:`⋌`,RightTriangle:`⊳`,RightTriangleBar:`⧐`,RightTriangleEqual:`⊵`,RightUpDownVector:`⥏`,RightUpTeeVector:`⥜`,RightUpVector:`↾`,RightUpVectorBar:`⥔`,RightVector:`⇀`,RightVectorBar:`⥓`,ring:`˚`,risingdotseq:`≓`,rlarr:`⇄`,rlhar:`⇌`,rlm:`‏`,rmoust:`⎱`,rmoustache:`⎱`,rnmid:`⫮`,roang:`⟭`,roarr:`⇾`,robrk:`⟧`,ropar:`⦆`,Ropf:`ℝ`,ropf:`𝕣`,roplus:`⨮`,rotimes:`⨵`,RoundImplies:`⥰`,rpar:`)`,rpargt:`⦔`,rppolint:`⨒`,rrarr:`⇉`,Rrightarrow:`⇛`,rsaquo:`›`,Rscr:`ℛ`,rscr:`𝓇`,Rsh:`↱`,rsh:`↱`,rsqb:`]`,rsquo:`’`,rsquor:`’`,rthree:`⋌`,rtimes:`⋊`,rtri:`▹`,rtrie:`⊵`,rtrif:`▸`,rtriltri:`⧎`,RuleDelayed:`⧴`,ruluhar:`⥨`,rx:`℞`,Sacute:`Ś`,sacute:`ś`,sbquo:`‚`,Sc:`⪼`,sc:`≻`,scap:`⪸`,Scaron:`Š`,scaron:`š`,sccue:`≽`,scE:`⪴`,sce:`⪰`,Scedil:`Ş`,scedil:`ş`,Scirc:`Ŝ`,scirc:`ŝ`,scnap:`⪺`,scnE:`⪶`,scnsim:`⋩`,scpolint:`⨓`,scsim:`≿`,Scy:`С`,scy:`с`,sdot:`⋅`,sdotb:`⊡`,sdote:`⩦`,searhk:`⤥`,seArr:`⇘`,searr:`↘`,searrow:`↘`,sect:`§`,semi:`;`,seswar:`⤩`,setminus:`∖`,setmn:`∖`,sext:`✶`,Sfr:`𝔖`,sfr:`𝔰`,sfrown:`⌢`,sharp:`♯`,SHCHcy:`Щ`,shchcy:`щ`,SHcy:`Ш`,shcy:`ш`,ShortDownArrow:`↓`,ShortLeftArrow:`←`,shortmid:`∣`,shortparallel:`∥`,ShortRightArrow:`→`,ShortUpArrow:`↑`,shy:`­`,Sigma:`Σ`,sigma:`σ`,sigmaf:`ς`,sigmav:`ς`,sim:`∼`,simdot:`⩪`,sime:`≃`,simeq:`≃`,simg:`⪞`,simgE:`⪠`,siml:`⪝`,simlE:`⪟`,simne:`≆`,simplus:`⨤`,simrarr:`⥲`,slarr:`←`,SmallCircle:`∘`,smallsetminus:`∖`,smashp:`⨳`,smeparsl:`⧤`,smid:`∣`,smile:`⌣`,smt:`⪪`,smte:`⪬`,smtes:`⪬︀`,SOFTcy:`Ь`,softcy:`ь`,sol:`/`,solb:`⧄`,solbar:`⌿`,Sopf:`𝕊`,sopf:`𝕤`,spades:`♠`,spadesuit:`♠`,spar:`∥`,sqcap:`⊓`,sqcaps:`⊓︀`,sqcup:`⊔`,sqcups:`⊔︀`,Sqrt:`√`,sqsub:`⊏`,sqsube:`⊑`,sqsubset:`⊏`,sqsubseteq:`⊑`,sqsup:`⊐`,sqsupe:`⊒`,sqsupset:`⊐`,sqsupseteq:`⊒`,squ:`□`,Square:`□`,square:`□`,SquareIntersection:`⊓`,SquareSubset:`⊏`,SquareSubsetEqual:`⊑`,SquareSuperset:`⊐`,SquareSupersetEqual:`⊒`,SquareUnion:`⊔`,squarf:`▪`,squf:`▪`,srarr:`→`,Sscr:`𝒮`,sscr:`𝓈`,ssetmn:`∖`,ssmile:`⌣`,sstarf:`⋆`,Star:`⋆`,star:`☆`,starf:`★`,straightepsilon:`ϵ`,straightphi:`ϕ`,strns:`¯`,Sub:`⋐`,sub:`⊂`,subdot:`⪽`,subE:`⫅`,sube:`⊆`,subedot:`⫃`,submult:`⫁`,subnE:`⫋`,subne:`⊊`,subplus:`⪿`,subrarr:`⥹`,Subset:`⋐`,subset:`⊂`,subseteq:`⊆`,subseteqq:`⫅`,SubsetEqual:`⊆`,subsetneq:`⊊`,subsetneqq:`⫋`,subsim:`⫇`,subsub:`⫕`,subsup:`⫓`,succ:`≻`,succapprox:`⪸`,succcurlyeq:`≽`,Succeeds:`≻`,SucceedsEqual:`⪰`,SucceedsSlantEqual:`≽`,SucceedsTilde:`≿`,succeq:`⪰`,succnapprox:`⪺`,succneqq:`⪶`,succnsim:`⋩`,succsim:`≿`,SuchThat:`∋`,Sum:`∑`,sum:`∑`,sung:`♪`,Sup:`⋑`,sup:`⊃`,sup1:`¹`,sup2:`²`,sup3:`³`,supdot:`⪾`,supdsub:`⫘`,supE:`⫆`,supe:`⊇`,supedot:`⫄`,Superset:`⊃`,SupersetEqual:`⊇`,suphsol:`⟉`,suphsub:`⫗`,suplarr:`⥻`,supmult:`⫂`,supnE:`⫌`,supne:`⊋`,supplus:`⫀`,Supset:`⋑`,supset:`⊃`,supseteq:`⊇`,supseteqq:`⫆`,supsetneq:`⊋`,supsetneqq:`⫌`,supsim:`⫈`,supsub:`⫔`,supsup:`⫖`,swarhk:`⤦`,swArr:`⇙`,swarr:`↙`,swarrow:`↙`,swnwar:`⤪`,szlig:`ß`,Tab:` `,target:`⌖`,Tau:`Τ`,tau:`τ`,tbrk:`⎴`,Tcaron:`Ť`,tcaron:`ť`,Tcedil:`Ţ`,tcedil:`ţ`,Tcy:`Т`,tcy:`т`,tdot:`⃛`,telrec:`⌕`,Tfr:`𝔗`,tfr:`𝔱`,there4:`∴`,Therefore:`∴`,therefore:`∴`,Theta:`Θ`,theta:`θ`,thetasym:`ϑ`,thetav:`ϑ`,thickapprox:`≈`,thicksim:`∼`,ThickSpace:`  `,thinsp:` `,ThinSpace:` `,thkap:`≈`,thksim:`∼`,THORN:`Þ`,thorn:`þ`,Tilde:`∼`,tilde:`˜`,TildeEqual:`≃`,TildeFullEqual:`≅`,TildeTilde:`≈`,times:`×`,timesb:`⊠`,timesbar:`⨱`,timesd:`⨰`,tint:`∭`,toea:`⤨`,top:`⊤`,topbot:`⌶`,topcir:`⫱`,Topf:`𝕋`,topf:`𝕥`,topfork:`⫚`,tosa:`⤩`,tprime:`‴`,TRADE:`™`,trade:`™`,triangle:`▵`,triangledown:`▿`,triangleleft:`◃`,trianglelefteq:`⊴`,triangleq:`≜`,triangleright:`▹`,trianglerighteq:`⊵`,tridot:`◬`,trie:`≜`,triminus:`⨺`,TripleDot:`⃛`,triplus:`⨹`,trisb:`⧍`,tritime:`⨻`,trpezium:`⏢`,Tscr:`𝒯`,tscr:`𝓉`,TScy:`Ц`,tscy:`ц`,TSHcy:`Ћ`,tshcy:`ћ`,Tstrok:`Ŧ`,tstrok:`ŧ`,twixt:`≬`,twoheadleftarrow:`↞`,twoheadrightarrow:`↠`,Uacute:`Ú`,uacute:`ú`,Uarr:`↟`,uArr:`⇑`,uarr:`↑`,Uarrocir:`⥉`,Ubrcy:`Ў`,ubrcy:`ў`,Ubreve:`Ŭ`,ubreve:`ŭ`,Ucirc:`Û`,ucirc:`û`,Ucy:`У`,ucy:`у`,udarr:`⇅`,Udblac:`Ű`,udblac:`ű`,udhar:`⥮`,ufisht:`⥾`,Ufr:`𝔘`,ufr:`𝔲`,Ugrave:`Ù`,ugrave:`ù`,uHar:`⥣`,uharl:`↿`,uharr:`↾`,uhblk:`▀`,ulcorn:`⌜`,ulcorner:`⌜`,ulcrop:`⌏`,ultri:`◸`,Umacr:`Ū`,umacr:`ū`,uml:`¨`,UnderBar:`_`,UnderBrace:`⏟`,UnderBracket:`⎵`,UnderParenthesis:`⏝`,Union:`⋃`,UnionPlus:`⊎`,Uogon:`Ų`,uogon:`ų`,Uopf:`𝕌`,uopf:`𝕦`,UpArrow:`↑`,Uparrow:`⇑`,uparrow:`↑`,UpArrowBar:`⤒`,UpArrowDownArrow:`⇅`,UpDownArrow:`↕`,Updownarrow:`⇕`,updownarrow:`↕`,UpEquilibrium:`⥮`,upharpoonleft:`↿`,upharpoonright:`↾`,uplus:`⊎`,UpperLeftArrow:`↖`,UpperRightArrow:`↗`,Upsi:`ϒ`,upsi:`υ`,upsih:`ϒ`,Upsilon:`Υ`,upsilon:`υ`,UpTee:`⊥`,UpTeeArrow:`↥`,upuparrows:`⇈`,urcorn:`⌝`,urcorner:`⌝`,urcrop:`⌎`,Uring:`Ů`,uring:`ů`,urtri:`◹`,Uscr:`𝒰`,uscr:`𝓊`,utdot:`⋰`,Utilde:`Ũ`,utilde:`ũ`,utri:`▵`,utrif:`▴`,uuarr:`⇈`,Uuml:`Ü`,uuml:`ü`,uwangle:`⦧`,vangrt:`⦜`,varepsilon:`ϵ`,varkappa:`ϰ`,varnothing:`∅`,varphi:`ϕ`,varpi:`ϖ`,varpropto:`∝`,vArr:`⇕`,varr:`↕`,varrho:`ϱ`,varsigma:`ς`,varsubsetneq:`⊊︀`,varsubsetneqq:`⫋︀`,varsupsetneq:`⊋︀`,varsupsetneqq:`⫌︀`,vartheta:`ϑ`,vartriangleleft:`⊲`,vartriangleright:`⊳`,Vbar:`⫫`,vBar:`⫨`,vBarv:`⫩`,Vcy:`В`,vcy:`в`,VDash:`⊫`,Vdash:`⊩`,vDash:`⊨`,vdash:`⊢`,Vdashl:`⫦`,Vee:`⋁`,vee:`∨`,veebar:`⊻`,veeeq:`≚`,vellip:`⋮`,Verbar:`‖`,verbar:`|`,Vert:`‖`,vert:`|`,VerticalBar:`∣`,VerticalLine:`|`,VerticalSeparator:`❘`,VerticalTilde:`≀`,VeryThinSpace:` `,Vfr:`𝔙`,vfr:`𝔳`,vltri:`⊲`,vnsub:`⊂⃒`,vnsup:`⊃⃒`,Vopf:`𝕍`,vopf:`𝕧`,vprop:`∝`,vrtri:`⊳`,Vscr:`𝒱`,vscr:`𝓋`,vsubnE:`⫋︀`,vsubne:`⊊︀`,vsupnE:`⫌︀`,vsupne:`⊋︀`,Vvdash:`⊪`,vzigzag:`⦚`,Wcirc:`Ŵ`,wcirc:`ŵ`,wedbar:`⩟`,Wedge:`⋀`,wedge:`∧`,wedgeq:`≙`,weierp:`℘`,Wfr:`𝔚`,wfr:`𝔴`,Wopf:`𝕎`,wopf:`𝕨`,wp:`℘`,wr:`≀`,wreath:`≀`,Wscr:`𝒲`,wscr:`𝓌`,xcap:`⋂`,xcirc:`◯`,xcup:`⋃`,xdtri:`▽`,Xfr:`𝔛`,xfr:`𝔵`,xhArr:`⟺`,xharr:`⟷`,Xi:`Ξ`,xi:`ξ`,xlArr:`⟸`,xlarr:`⟵`,xmap:`⟼`,xnis:`⋻`,xodot:`⨀`,Xopf:`𝕏`,xopf:`𝕩`,xoplus:`⨁`,xotime:`⨂`,xrArr:`⟹`,xrarr:`⟶`,Xscr:`𝒳`,xscr:`𝓍`,xsqcup:`⨆`,xuplus:`⨄`,xutri:`△`,xvee:`⋁`,xwedge:`⋀`,Yacute:`Ý`,yacute:`ý`,YAcy:`Я`,yacy:`я`,Ycirc:`Ŷ`,ycirc:`ŷ`,Ycy:`Ы`,ycy:`ы`,yen:`¥`,Yfr:`𝔜`,yfr:`𝔶`,YIcy:`Ї`,yicy:`ї`,Yopf:`𝕐`,yopf:`𝕪`,Yscr:`𝒴`,yscr:`𝓎`,YUcy:`Ю`,yucy:`ю`,Yuml:`Ÿ`,yuml:`ÿ`,Zacute:`Ź`,zacute:`ź`,Zcaron:`Ž`,zcaron:`ž`,Zcy:`З`,zcy:`з`,Zdot:`Ż`,zdot:`ż`,zeetrf:`ℨ`,ZeroWidthSpace:`​`,Zeta:`Ζ`,zeta:`ζ`,Zfr:`ℨ`,zfr:`𝔷`,ZHcy:`Ж`,zhcy:`ж`,zigrarr:`⇝`,Zopf:`ℤ`,zopf:`𝕫`,Zscr:`𝒵`,zscr:`𝓏`,zwj:`‍`,zwnj:`‌`}),e.entityMap=e.HTML_ENTITIES})),wi=/* @__PURE__ */ a((e=>{var t=yi(),n=xi(),r=bi(),i=t.isHTMLEscapableRawTextElement,a=t.isHTMLMimeType,o=t.isHTMLRawTextElement,s=t.hasOwn,c=t.NAMESPACE,l=r.ParseError,u=r.DOMException,d=0,f=1,p=2,m=3,h=4,g=5,_=6,v=7;function y(){}y.prototype={parse:function(e,t,n){var r=this.domBuilder;r.startDocument(),E(t,t=Object.create(null)),x(e,t,n,r,this.errorHandler),r.endDocument()}};var b=/&#?\w+;?/g;function x(e,r,i,o,c){var d=a(o.mimeType);e.indexOf(n.UNICODE_REPLACEMENT_CHARACTER)>=0&&c.warning(`Unicode replacement character detected, source encoding issues?`);function f(e){if(e>65535){e-=65536;var t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}function p(e){var t=e[e.length-1]===`;`?e:e+`;`;if(!d&&t!==e)return c.error(`EntityRef: expecting ;`),e;var r=n.Reference.exec(t);if(!r||r[0].length!==t.length)return c.error(`entity not matching Reference production: `+e),e;var a=t.slice(1,-1);return s(i,a)?i[a]:a.charAt(0)===`#`?f(parseInt(a.substring(1).replace(`x`,`0x`))):(c.error(`entity not found:`+e),e)}function m(t){if(t>D){var n=e.substring(D,t).replace(b,p);v&&y(D),o.characters(n,0,t-D),D=t}}var h=0,g=0,_=/\r\n?|\n|$/g,v=o.locator;function y(t,n){for(;t>=g&&(n=_.exec(e));)h=g,g=n.index+n[0].length,v.lineNumber++;v.columnNumber=t-h+1}for(var x=[{currentNSMap:r}],E=[],D=0;;){try{var O=e.indexOf(`<`,D);if(O<0){if(!d&&E.length>0)return c.fatalError(`unclosed xml tag(s): `+E.join(`, `));if(!e.substring(D).match(/^\s*$/)){var j=o.doc,te=j.createTextNode(e.substring(D));if(j.documentElement)return c.error(`Extra content at the end of the document`);j.appendChild(te),o.currentElement=te}return}if(O>D){var M=e.substring(D,O);!d&&E.length===0&&(M=M.replace(new RegExp(n.S_OPT.source,`g`),``),M&&c.error(`Unexpected content outside root element: '`+M+`'`)),m(O)}switch(e.charAt(O+1)){case`/`:var N=e.indexOf(`>`,O+2),P=e.substring(O+2,N>0?N:void 0);if(!P)return c.fatalError(`end tag name missing`);var ne=n.reg(`^`,n.QName_group,n.S_OPT,`$`),F=N>0&&ne.exec(P);if(!F){var I=N>0&&n.reg(`^`,n.QName_group).exec(P);if(d&&I)c.warning(`end tag name contains invalid trailing characters: "`+P+`"`),F=I;else if(I&&new RegExp(ne.source,ne.flags+`m`).test(P))c.error(`end tag name is followed by a line break and trailing content: "`+P+`"`),F=I;else return c.fatalError(`end tag name contains invalid characters: "`+P+`"`)}if(!o.currentElement&&!o.doc.documentElement)return;var L=E[E.length-1]||o.currentElement.tagName||o.doc.documentElement.tagName||``;if(L!==F[1]){var R=F[1].toLowerCase();if(!d||L.toLowerCase()!==R)return c.fatalError(`Opening and ending tag mismatch: "`+L+`" != "`+P+`"`)}var z=x.pop();E.pop();var B=z.localNSMap;if(o.endElement(z.uri,z.localName,L),B)for(var re in B)s(B,re)&&o.endPrefixMapping(re);N++;break;case`?`:v&&y(O),N=ee(e,O,o,c);break;case`!`:v&&y(O),N=k(e,O,o,c,d);break;default:v&&y(O);var V=new A,H=x[x.length-1].currentNSMap,N=C(e,O,V,H,p,c,d),ie=V.length;if(V.closed||(d&&t.isHTMLVoidElement(V.tagName)?V.closed=!0:E.push(V.tagName)),v&&ie){for(var U=S(v,{}),ae=0;ae<ie;ae++){var oe=V[ae];y(oe.offset),oe.locator=S(v,{})}o.locator=U,w(V,o,H)&&x.push(V),o.locator=v}else w(V,o,H)&&x.push(V);d&&!V.closed?N=T(e,N,V.tagName,p,o):N++}}catch(e){if(e instanceof l)throw e;if(e instanceof u)return c.fatalError(`Error constructing the DOM: `+e.name+`: `+e.message,e);c.error(`element parse error: `+e),N=-1}N>D?D=N:m(Math.max(O,D)+1)}}function S(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function C(e,t,n,r,i,a,o){function c(e,t,r){if(s(n.attributeNames,e))return a.fatalError(`Attribute `+e+` redefined`);if(!o&&t.indexOf(`<`)>=0)return a.fatalError(`Unescaped '<' not allowed in attributes values`);n.addValue(e,t.replace(/[\t\n\r]/g,` `).replace(b,i),r)}for(var l,u,y=++t,x=d;;){var S=e.charAt(y);if(x===d&&S===`<`)throw Error(`unexpected < in tag name: `+e.slice(t,y));switch(S){case`=`:if(x===f)l=e.slice(t,y),x=m;else if(x===p)x=m;else throw Error(`attribute equal must after attrName`);break;case`'`:case`"`:if(x===m||x===f){if(x===f&&(a.warning(`attribute value must after "="`),l=e.slice(t,y)),t=y+1,y=e.indexOf(S,t),y>0)u=e.slice(t,y),c(l,u,t-1),x=g;else throw Error(`attribute value no end '`+S+`' match`)}else if(x==h)u=e.slice(t,y),c(l,u,t),a.warning(`attribute "`+l+`" missed start quot(`+S+`)!!`),t=y+1,x=g;else throw Error(`attribute value must after "="`);break;case`/`:switch(x){case d:n.setTagName(e.slice(t,y));case g:case _:case v:x=v,n.closed=!0;case h:case f:break;case p:n.closed=!0;break;default:throw Error(`attribute invalid close char('/')`)}break;case``:return a.error(`unexpected end of input`),x==d&&n.setTagName(e.slice(t,y)),y;case`>`:switch(x){case d:n.setTagName(e.slice(t,y));case g:case _:case v:break;case h:case f:u=e.slice(t,y),u.slice(-1)===`/`&&(n.closed=!0,u=u.slice(0,-1));case p:x===p&&(u=l),x==h?(a.warning(`attribute "`+u+`" missed quot(")!`),c(l,u,t)):(o||a.warning(`attribute "`+u+`" missed value!! "`+u+`" instead!!`),c(u,u,t));break;case m:if(!o)return a.fatalError(`AttValue: ' or " expected`)}return y;case`€`:S=` `;default:if(S<=` `)switch(x){case d:n.setTagName(e.slice(t,y)),x=_;break;case f:l=e.slice(t,y),x=p;break;case h:var u=e.slice(t,y);a.warning(`attribute "`+u+`" missed quot(")!!`),c(l,u,t);case g:x=_}else switch(x){case p:o||a.warning(`attribute "`+l+`" missed value!! "`+l+`" instead2!!`),c(l,l,t),t=y,x=f;break;case g:a.warning(`attribute space is required"`+l+`"!!`);case _:x=f,t=y;break;case m:x=h,t=y;break;case v:throw Error(`elements closed character '/' and '>' must be connected to`)}}y++}}function w(e,t,n){for(var r=e.tagName,i=null,a=e.length;a--;){var o=e[a],l=o.qName,u=o.value,d=l.indexOf(`:`);if(d>0)var f=o.prefix=l.slice(0,d),p=l.slice(d+1),m=f===`xmlns`&&p;else p=l,f=null,m=l===`xmlns`&&``;o.localName=p,m!==!1&&(i??(i=Object.create(null),n=Object.create(n)),n[m]=i[m]=u,o.uri=c.XMLNS,t.startPrefixMapping(m,u))}for(var a=e.length;a--;)o=e[a],o.prefix&&(o.prefix===`xml`&&(o.uri=c.XML),o.prefix!==`xmlns`&&(o.uri=n[o.prefix]));var d=r.indexOf(`:`);d>0?(f=e.prefix=r.slice(0,d),p=e.localName=r.slice(d+1)):(f=null,p=e.localName=r);var h=e.uri=n[f||``];if(t.startElement(h,p,r,e),e.closed){if(t.endElement(h,p,r),i)for(f in i)s(i,f)&&t.endPrefixMapping(f)}else return e.currentNSMap=n,e.localNSMap=i,!0}function T(e,t,n,r,a){var s=i(n);if(s||o(n)){var c=RegExp(`</`+n.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)+`>`,`ig`);c.lastIndex=t;var l=c.exec(e),u=l?l.index:-1;if(u<0)return t+1;var d=e.substring(t+1,u);return s&&(d=d.replace(b,r)),a.characters(d,0,d.length),u}return t+1}function E(e,t){for(var n in e)s(e,n)&&(t[n]=e[n])}function D(e,t){var r=t;function i(t){return t||=0,e.charAt(r+t)}function a(e){e||=1,r+=e}function o(){for(var t=0;r<e.length;){var n=i();if(n!==` `&&n!==`
18
+ `&&n!==` `&&n!==`\r`)return t;t++,a()}return-1}function s(){return e.substring(r)}function c(t){return e.substring(r,r+t.length)===t}function l(t){return e.substring(r,r+t.length).toUpperCase()===t.toUpperCase()}function u(e){var t=n.reg(`^`,e).exec(s());return t?(a(t[0].length),t[0]):null}return{char:i,getIndex:function(){return r},getMatch:u,getSource:function(){return e},skip:a,skipBlanks:o,substringFromIndex:s,substringStartsWith:c,substringStartsWithCaseInsensitive:l}}function O(e,t){function r(e,t){var r=n.PI.exec(e.substringFromIndex());return r?r[1].toLowerCase()===`xml`?t.fatalError(`xml declaration is only allowed at the start of the document, but found at position `+e.getIndex()):(e.skip(r[0].length),r[0]):t.fatalError(`processing instruction is not well-formed at position `+e.getIndex())}var i=e.getSource();if(e.char()===`[`){e.skip(1);for(var a=e.getIndex();e.getIndex()<i.length;){if(e.skipBlanks(),e.char()===`]`){var o=i.substring(a,e.getIndex());return e.skip(1),o}var s=null;if(e.char()===`<`&&e.char(1)===`!`)switch(e.char(2)){case`E`:e.char(3)===`L`?s=e.getMatch(n.elementdecl):e.char(3)===`N`&&(s=e.getMatch(n.EntityDecl));break;case`A`:s=e.getMatch(n.AttlistDecl);break;case`N`:s=e.getMatch(n.NotationDecl);break;case`-`:s=e.getMatch(n.Comment)}else if(e.char()===`<`&&e.char(1)===`?`)s=r(e,t);else if(e.char()===`%`)s=e.getMatch(n.PEReference);else return t.fatalError(`Error detected in Markup declaration`);if(!s)return t.fatalError(`Error in internal subset at position `+e.getIndex())}return t.fatalError(`doctype internal subset is not well-formed, missing ]`)}}function k(e,t,r,i,a){var o=D(e,t);switch(a?o.char(2).toUpperCase():o.char(2)){case`-`:var s=o.getMatch(n.Comment);return s?(r.comment(s,n.COMMENT_START.length,s.length-n.COMMENT_START.length-n.COMMENT_END.length),o.getIndex()):i.fatalError(`comment is not well-formed at position `+o.getIndex());case`[`:var c=o.getMatch(n.CDSect);return c?!a&&!r.currentElement?i.fatalError(`CDATA outside of element`):(r.startCDATA(),r.characters(c,n.CDATA_START.length,c.length-n.CDATA_START.length-n.CDATA_END.length),r.endCDATA(),o.getIndex()):i.fatalError(`Invalid CDATA starting at position `+t);case`D`:if(r.doc&&r.doc.documentElement)return i.fatalError(`Doctype not allowed inside or after documentElement at position `+o.getIndex());if(a?!o.substringStartsWithCaseInsensitive(n.DOCTYPE_DECL_START):!o.substringStartsWith(n.DOCTYPE_DECL_START))return i.fatalError(`Expected `+n.DOCTYPE_DECL_START+` at position `+o.getIndex());if(o.skip(n.DOCTYPE_DECL_START.length),o.skipBlanks()<1)return i.fatalError(`Expected whitespace after `+n.DOCTYPE_DECL_START+` at position `+o.getIndex());var l={name:void 0,publicId:void 0,systemId:void 0,internalSubset:void 0};if(l.name=o.getMatch(n.Name),!l.name)return i.fatalError(`doctype name missing or contains unexpected characters at position `+o.getIndex());if(a&&l.name.toLowerCase()!==`html`&&i.warning(`Unexpected DOCTYPE in HTML document at position `+o.getIndex()),o.skipBlanks(),o.substringStartsWith(n.PUBLIC)||o.substringStartsWith(n.SYSTEM)){var u=n.ExternalID_match.exec(o.substringFromIndex());if(!u)return i.fatalError(`doctype external id is not well-formed at position `+o.getIndex());u.groups.SystemLiteralOnly===void 0?(l.systemId=u.groups.SystemLiteral,l.publicId=u.groups.PubidLiteral):l.systemId=u.groups.SystemLiteralOnly,o.skip(u[0].length)}else if(a&&o.substringStartsWithCaseInsensitive(n.SYSTEM)){if(o.skip(n.SYSTEM.length),o.skipBlanks()<1)return i.fatalError(`Expected whitespace after `+n.SYSTEM+` at position `+o.getIndex());if(l.systemId=o.getMatch(n.ABOUT_LEGACY_COMPAT_SystemLiteral),!l.systemId)return i.fatalError(`Expected `+n.ABOUT_LEGACY_COMPAT+` in single or double quotes after `+n.SYSTEM+` at position `+o.getIndex())}return a&&l.systemId&&!n.ABOUT_LEGACY_COMPAT_SystemLiteral.test(l.systemId)&&i.warning(`Unexpected doctype.systemId in HTML document at position `+o.getIndex()),a||(o.skipBlanks(),l.internalSubset=O(o,i)),o.skipBlanks(),o.char()===`>`?(o.skip(1),r.startDTD(l.name,l.publicId,l.systemId,l.internalSubset),r.endDTD(),o.getIndex()):i.fatalError(`doctype not terminated with > at position `+o.getIndex());default:return i.fatalError(`Not well-formed XML starting with "<!" at position `+t)}}function ee(e,t,r,i){var a=e.substring(t).match(n.PI);if(!a)return i.fatalError(`Invalid processing instruction starting at position `+t);if(a[1].toLowerCase()===`xml`){if(t>0)return i.fatalError(`processing instruction at position `+t+` is an xml declaration which is only at the start of the document`);if(!n.XMLDecl.test(e.substring(t)))return i.fatalError(`xml declaration is not well-formed`)}return r.processingInstruction(a[1],a[2]),t+a[0].length}function A(){this.attributeNames=Object.create(null)}A.prototype={setTagName:function(e){if(!n.QName_exact.test(e))throw Error(`invalid tagName:`+e);this.tagName=e},addValue:function(e,t,r){if(!n.QName_exact.test(e))throw Error(`invalid attribute:`+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:r}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},e.XMLReader=y,e.parseUtils=D,e.parseDoctypeCommentOrCData=k})),Ti=/* @__PURE__ */ a((e=>{var t=yi(),n=Si(),r=bi(),i=Ci(),a=wi(),o=n.DOMImplementation,s=t.hasDefaultHTMLNamespace,c=t.isHTMLMimeType,l=t.isValidMimeType,u=t.MIME_TYPE,d=t.NAMESPACE,f=r.ParseError,p=a.XMLReader;function m(e){return e.replace(/\r[\n\u0085]/g,`
19
+ `).replace(/[\r\u0085\u2028\u2029]/g,`
20
+ `)}function h(e){if(e||={},e.locator===void 0&&(e.locator=!0),this.assign=e.assign||t.assign,this.domHandler=e.domHandler||g,this.onError=e.onError||e.errorHandler,e.errorHandler&&typeof e.errorHandler!=`function`)throw TypeError(`errorHandler object is no longer supported, switch to onError!`);e.errorHandler&&e.errorHandler(`warning`,"The `errorHandler` option has been deprecated, use `onError` instead!",this),this.normalizeLineEndings=e.normalizeLineEndings||m,this.locator=!!e.locator,this.xmlns=this.assign(Object.create(null),e.xmlns)}h.prototype.parseFromString=function(e,n){if(!l(n))throw TypeError(`DOMParser.parseFromString: the provided mimeType "`+n+`" is not valid.`);var r=this.assign(Object.create(null),this.xmlns),a=i.XML_ENTITIES,o=r[``]||null;s(n)?(a=i.HTML_ENTITIES,o=d.HTML):n===u.XML_SVG_IMAGE&&(o=d.SVG),r[``]=o,r.xml=r.xml||d.XML;var c=new this.domHandler({mimeType:n,defaultNamespace:o,onError:this.onError}),f=this.locator?{}:void 0;this.locator&&c.setDocumentLocator(f);var m=new p;return m.errorHandler=c,m.domBuilder=c,!t.isHTMLMimeType(n)&&typeof e!=`string`&&m.errorHandler.fatalError(`source is not a string`),m.parse(this.normalizeLineEndings(String(e)),r,a),c.doc.documentElement||m.errorHandler.fatalError(`missing root element`),c.doc};function g(e){var t=e||{};this.mimeType=t.mimeType||u.XML_APPLICATION,this.defaultNamespace=t.defaultNamespace||null,this.cdata=!1,this.currentElement=void 0,this.doc=void 0,this.locator=void 0,this.onError=t.onError}function _(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}g.prototype={startDocument:function(){var e=new o;this.doc=c(this.mimeType)?e.createHTMLDocument(!1):e.createDocument(this.defaultNamespace,``)},startElement:function(e,t,n,r){var i=this.doc,a=i.createElementNS(e,n||t),o=r.length;b(this,a),this.currentElement=a,this.locator&&_(this.locator,a);for(var s=0;s<o;s++){var e=r.getURI(s),c=r.getValue(s),n=r.getQName(s),l=i.createAttributeNS(e,n);this.locator&&_(r.getLocator(s),l),l.value=l.nodeValue=c,a.setAttributeNode(l)}},endElement:function(e,t,n){this.currentElement=this.currentElement.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var n=this.doc.createProcessingInstruction(e,t);this.locator&&_(this.locator,n),b(this,n)},ignorableWhitespace:function(e,t,n){},characters:function(e,t,n){if(e=y.apply(this,arguments),e){if(this.cdata)var r=this.doc.createCDATASection(e);else var r=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(r):/^\s*$/.test(e)&&this.doc.appendChild(r),this.locator&&_(this.locator,r)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){e&&(e.lineNumber=0),this.locator=e},comment:function(e,t,n){e=y.apply(this,arguments);var r=this.doc.createComment(e);this.locator&&_(this.locator,r),b(this,r)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,n,r){var i=this.doc.implementation;if(i&&i.createDocumentType){var a=i.createDocumentType(e,t,n,r);this.locator&&_(this.locator,a),b(this,a),this.doc.doctype=a}},reportError:function(e,t){if(typeof this.onError==`function`)try{this.onError(e,t,this)}catch(n){throw new f(`Reporting `+e+` "`+t+`" caused `+n,this.locator)}else console.error(`[xmldom `+e+`] `+t,v(this.locator))},warning:function(e){this.reportError(`warning`,e)},error:function(e){this.reportError(`error`,e)},fatalError:function(e,t){throw this.reportError(`fatalError`,e),new f(e,this.locator,t)}};function v(e){if(e)return`
21
+ @#[line:`+e.lineNumber+`,col:`+e.columnNumber+`]`}function y(e,t,n){return typeof e==`string`?e.substr(t,n):e.length>=t+n||t?new java.lang.String(e,t,n)+``:e}`endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl`.replace(/\w+/g,function(e){g.prototype[e]=function(){return null}});function b(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}e.__DOMHandler=g,e.DOMParser=h,e.normalizeLineEndings=m,e.onErrorStopParsing=function(e){if(e===`error`)throw`onErrorStopParsing`},e.onWarningStopParsing=function(){throw`onWarningStopParsing`}})),Ei=(/* @__PURE__ */ a((e=>{var t=yi();e.assign=t.assign,e.hasDefaultHTMLNamespace=t.hasDefaultHTMLNamespace,e.isHTMLMimeType=t.isHTMLMimeType,e.isValidMimeType=t.isValidMimeType,e.MIME_TYPE=t.MIME_TYPE,e.NAMESPACE=t.NAMESPACE;var n=bi();e.DOMException=n.DOMException,e.DOMExceptionName=n.DOMExceptionName,e.ExceptionCode=n.ExceptionCode,e.ParseError=n.ParseError;var r=Si();e.Attr=r.Attr,e.CDATASection=r.CDATASection,e.CharacterData=r.CharacterData,e.Comment=r.Comment,e.Document=r.Document,e.DocumentFragment=r.DocumentFragment,e.DocumentType=r.DocumentType,e.DOMImplementation=r.DOMImplementation,e.Element=r.Element,e.Entity=r.Entity,e.EntityReference=r.EntityReference,e.LiveNodeList=r.LiveNodeList,e.NamedNodeMap=r.NamedNodeMap,e.Node=r.Node,e.NodeList=r.NodeList,e.Notation=r.Notation,e.ProcessingInstruction=r.ProcessingInstruction,e.Text=r.Text,e.XMLSerializer=r.XMLSerializer;var i=Ti();e.DOMParser=i.DOMParser,e.normalizeLineEndings=i.normalizeLineEndings,e.onErrorStopParsing=i.onErrorStopParsing,e.onWarningStopParsing=i.onWarningStopParsing})))();const Di=/* @__PURE__ */ new WeakMap;function Oi(e,t){let n=Di.get(e);return n&&Di.set(t,n),t}var Q=class extends Error{constructor(e){super(e),this.name=`XmlWikiConversionError`}};const ki=Q,Ai=/* @__PURE__ */ new Set([`none`,`row`,`col`,`both`]);function ji(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Mi(e){return e.blockType===`paragraph`}function Ni(e){return e.blockType===`quote`}function Pi(e){return e.blockType===`list`}function Fi(e){return e.blockType===`image`}function Ii(e){return e.blockType===`complexTable`}function Li(e){return e.inlineType===`text`}function Ri(e,t){return{inlineType:`text`,text:e,bold:t?.bold??!1,italic:t?.italic??!1,underline:t?.underline??!1,strike:t?.strike??!1,color:t?.color??null}}function zi(e=[],t=`body`,n=`left`){return{blockType:`paragraph`,kind:t,align:n,inlines:e}}function Bi(e,t,n){if(e===`none`)return!1;if(e===`row`)return t===0;if(e===`col`)return n===0;if(e===`both`)return t===0||n===0;throw new ki(`Unsupported table header mode '${e}'.`)}function Vi(e){return Li(e)?!!e.text:e.inlineType===`pronunciation`?!!e.content:e.inlineType===`link`?!!(e.text||e.href):e.inlineType===`emoji`||e.inlineType===`annotation`||!!e.targetId}function Hi(e){return Mi(e)&&e.kind===`body`&&!e.inlines.some(e=>Vi(e))}function Ui(e){let t=[];for(let n of e){let e=t[t.length-1];e&&Li(e)&&Li(n)&&e.bold===n.bold&&e.italic===n.italic&&e.underline===n.underline&&e.strike===n.strike&&e.color===n.color?e.text+=n.text:t.push(n)}return t}function Wi(e){let t=[[]];for(let n of e){if(n.inlineType===`entry`||n.inlineType===`emoji`||n.inlineType===`annotation`){t[t.length-1].push(n);continue}let e=(n.inlineType===`pronunciation`?n.content:n.text).replace(/\r\n|\r/g,`
22
+ `).split(`
23
+ `);for(let[r,i]of e.entries())r>0&&t.push([]),i&&t[t.length-1].push(n.inlineType===`pronunciation`?{...n,content:i}:{...n,text:i})}return t}function Gi(e,t=!1){let n=[];for(let r of e)if(Mi(r)){let e=Wi(r.inlines.map(e=>e.inlineType===`annotation`?Oi(e,{...e,title:Ui(e.title.map(e=>({...e}))),content:Gi(e.content)}):e)).map(Ui);for(let t of e){for(;t[0]&&Li(t[0])&&(t[0].text=t[0].text.trimStart(),!t[0].text);)t.shift();for(;t.length&&Li(t[t.length-1]);){let e=t[t.length-1];if(e.text=e.text.trimEnd(),e.text)break;t.pop()}}if(!t&&e.length>1){for(;e.length&&!e[0].length;)e.shift();for(;e.length&&!e[e.length-1].length;)e.pop()}for(let[t,i]of e.entries()){let e=i.length?zi(i,r.kind,r.align):zi();n.push(t===0?Oi(r,e):e)}}else if(Ni(r)){let e=Gi(r.children);e.length&&n.push(Oi(r,{blockType:`quote`,children:e}))}else if(Pi(r)){let e=[];for(let t of r.items){let n=Gi(t.blocks);n.length&&e.push(Oi(t,{blocks:n}))}e.length&&n.push(Oi(r,{blockType:`list`,ordered:r.ordered,items:e}))}else if(Ii(r)){let e=[...r.cells].sort((e,t)=>e.rowIndex===t.rowIndex?e.columnIndex-t.columnIndex:e.rowIndex-t.rowIndex).map(e=>({rowIndex:e.rowIndex,columnIndex:e.columnIndex,blocks:Gi(e.blocks),rowSpan:e.rowSpan,colSpan:e.colSpan})),t={blockType:`complexTable`,headerMode:r.headerMode,columnWidths:[...r.columnWidths],cells:e,rowCount:r.rowCount,columnCount:r.columnCount};Zi(t),n.push(Oi(r,t))}else n.push(r);if(!t){for(;n.length>0&&Hi(n[0]);)n.shift();for(;n.length>0&&Hi(n[n.length-1]);)n.pop()}return Oi(e,n)}function Ki(e){let t=Gi(e,!0);return t.length||t.push(zi()),t}function*qi(e){for(let t of e)if(Mi(t))for(let e of t.inlines)e.inlineType===`annotation`&&(yield*qi(e.content));else if(Fi(t))yield t;else if(Ni(t))yield*qi(t.children);else if(Pi(t))for(let e of t.items)yield*qi(e.blocks);else if(Ii(t))for(let e of t.cells)yield*qi(e.blocks)}function Ji(e,t){for(let n of e){if(!Mi(n)||n.kind!==`body`||n.align!==`left`)throw new Q(`${t} only supports left-aligned body paragraphs.`);for(let e of n.inlines)if(e.inlineType===`emoji`){if(typeof e.id!=`string`||!e.id.trim())throw new Q(`${t} emoji must include a nonempty id.`)}else if(!Li(e)||e.bold||e.italic||e.underline||e.strike||e.color!==null)throw new Q(`${t} only supports unstyled text and emoji.`)}}function Yi(e,t){if(e.type!==`message`||e.side!==`me`&&e.side!==`other`)throw new Q(`${t} must be a message with side 'me' or 'other'.`);if(typeof e.avatarUrl!=`string`||!e.avatarUrl.trim())throw new Q(`${t} must include a nonempty avatar.`);for(let[n,r]of e.contents.entries()){let e=`${t}.contents[${n}]`;if(r.type===`text`)Ji(r.blocks,e);else if(r.type===`image`){if(typeof r.src!=`string`||!r.src.trim())throw new Q(`${e} must include a nonempty image src.`)}else throw new Q(`${e} must be text or an image.`)}}function Xi(e){let t=`Dialog chapter '${e.title}'`;if(e.chapterType!==`dialog`||e.content.length||e.tabs.length||e.audios.length||e.audioTabs?.length||e.tableRows.length)throw new Q(`${t} cannot mix chapter modes.`);if(!Array.isArray(e.dialog)||!e.dialog.length)throw new Q(`${t} must contain at least one dialog entry.`);for(let[n,r]of e.dialog.entries()){let e=`${t}.dialogList[${n}]`;switch(r.type){case`message`:Yi(r,e);break;case`divider`:if(typeof r.kind!=`string`||!r.kind.trim())throw new Q(`${e} must include a nonempty divider kind.`);break;case`branches`:if(!r.branches.length)throw new Q(`${e} must contain at least one branch.`);for(let[t,n]of r.branches.entries()){let r=`${e}.branchList[${t}]`;for(let[e,t]of n.messages.entries())Yi(t,`${r}.dialogList[${e}]`);let i=n.messages[0];if(i?.side!==`me`||n.messages.at(-1)?.side!==`other`)throw new Q(`${r} must start with 'me' and end with 'other'.`);if(i.contents.some(e=>e.type===`image`))throw new Q(`${r} first message cannot contain an image.`)}break;default:throw new Q(`${e} must be a message, a divider or a branch group.`)}}}function Zi(e){if(!Ai.has(e.headerMode))throw new ki(`Unsupported table header mode '${e.headerMode}'.`);if(e.rowCount<=0||e.columnCount<=0)throw new ki(`Complex tables must contain at least one row and one column.`);if(e.columnWidths.length!==e.columnCount)throw new ki(`Complex table column widths length ${e.columnWidths.length} does not match column count ${e.columnCount}.`);for(let t=0;t<e.columnWidths.length;t+=1){let n=e.columnWidths[t];if(!Number.isFinite(n)||n<=0)throw new ki(`Complex table column ${t+1} width ${n} must be a positive number.`)}let t=/* @__PURE__ */ new Map;for(let n of e.cells){if(n.rowIndex<0||n.columnIndex<0)throw new ki(`Complex table cell positions must be non-negative.`);if(n.rowSpan<1||n.colSpan<1)throw new ki(`Complex table cell spans must be positive integers.`);if(n.rowIndex+n.rowSpan>e.rowCount)throw new ki(`Complex table cell row span exceeds the table bounds.`);if(n.columnIndex+n.colSpan>e.columnCount)throw new ki(`Complex table cell column span exceeds the table bounds.`);for(let e=n.rowIndex;e<n.rowIndex+n.rowSpan;e+=1)for(let r=n.columnIndex;r<n.columnIndex+n.colSpan;r+=1){let i=`${e}:${r}`;t.set(i,n)}}for(let n=0;n<e.rowCount;n+=1)for(let r=0;r<e.columnCount;r+=1){let e=`${n}:${r}`;if(!t.has(e))throw new ki(`Complex table contains uncovered grid positions.`)}for(let t of e.cells)for(let e of qi(t.blocks)){let t=Number.parseFloat(e.width);if(!Number.isFinite(t))throw new ki(`Image width '${e.width}' is not numeric.`)}}const Qi=Object.fromEntries(Object.entries({light_text_primary:`s_1`,light_text_secondary:`s_2`,light_text_tertiary:`s_3`,light_text_quaternary:`s_4`,light_rank_gray:`r_1`,light_rank_green:`r_2`,light_rank_blue:`r_3`,light_rank_purple:`r_4`,light_rank_yellow:`r_5`,light_rank_orange:`r_6`,light_function_orange:`f_orange`,light_function_turquoise:`f_turquoise`,light_function_green:`f_green`,light_function_sandstone:`f_sandstone`,light_function_yellow:`f_yellow`,light_function_red:`f_red`,light_function_blue:`f_blue`,light_function_brown:`f_brown`,light_function_violet:`f_violet`,light_function_blueness:`f_blueness`}).map(([e,t])=>[t,e]));Object.fromEntries(Object.entries({"card-big":`card-big`,"link-img":`link-imgText`,"link-txt":`link-text`}).map(([e,t])=>[t,e]));const $i=/* @__PURE__ */ new Set([`b`,`i`,`u`,`s`,`color`,`pron`,`a`,`entry`,`emoji`,`annotation`,`br`]),ea=/* @__PURE__ */ new Set([`h1`,`h2`,`h3`,`quote`,`ul`,`ol`,`align`,`img`,`line`,`video`]),ta=/* @__PURE__ */ new Set([`skland`,`bilibili`]),na={large:1160,middle:754.7,small:349.3};function ra(e){return typeof structuredClone==`function`?structuredClone(e):JSON.parse(JSON.stringify(e))}function ia(e){return ji(e)?ra(e):{}}function aa(){let e=globalThis.DOMParser;return typeof e==`function`?e:null}function oa(e){let t=aa();if(t)return new t().parseFromString(e,`application/xml`);let n=[],r=new Ei.DOMParser({errorHandler(e,t){e!==`warning`&&n.push(t)}}).parseFromString(e,`application/xml`);if(n.length){let e=r.createElement(`parsererror`);e.appendChild(r.createTextNode(n[0])),r.documentElement?.appendChild(e)}return r}function sa(e){let t;try{t=oa(e)}catch(e){throw new Q((e instanceof Error?e.message:String(e))||`Invalid XML.`)}let n=t.getElementsByTagName(`parsererror`)[0];if(n)throw new Q(la(n.textContent,`Invalid XML.`));let r=t.documentElement;if(!r)throw new Q(`Invalid XML.`);return r}function ca(e){let t=[];for(let n of Array.from(e.childNodes))n.nodeType===1&&t.push(n);return t}function $(e){let t=``;for(let n of Array.from(e.childNodes))(n.nodeType===3||n.nodeType===4)&&(t+=n.nodeValue||``);return t}function la(e,t=``){return e==null?t:e.replace(/\s+/g,` `).trim()}function ua(e){if(e==null)return``;let t=e.replace(/\r\n/g,`
24
+ `).replace(/\r/g,`
25
+ `).split(`
26
+ `).map(e=>e.trim());for(;t.length>0&&!t[0];)t.shift();for(;t.length>0&&!t[t.length-1];)t.pop();return t.join(`
27
+ `)}function da(e){return $(e).trim()?!0:ca(e).length>0}function fa(e,t){for(let n of ca(e))if(n.tagName===t)return n;throw new Q(`Expected <${t}> inside <${e.tagName}>.`)}function pa(e,t){return ca(e).filter(e=>e.tagName===t)}function ma(e,t){for(let n of ca(e))if(n.tagName===t)return n;return null}function ha(e){let t=ma(e,`publicMeta`);if(!t)return{infoRoot:{},item:{},brief:{},documentExtraInfo:{}};let n=$(t).trim();if(!n)return{infoRoot:{},item:{},brief:{},documentExtraInfo:{}};let r;try{r=JSON.parse(n)}catch(e){throw new Q(`Invalid <publicMeta> JSON: ${e instanceof Error?e.message:String(e)}`)}if(!ji(r))throw new Q(`<publicMeta> must contain a JSON object.`);let i=ia(r.item??r);return delete i.commitMsg,{infoRoot:ia(r.infoRoot),item:i,brief:ia(r.brief),documentExtraInfo:ia(r.documentExtraInfo)}}function ga(e){let t=sa(e);if(t.tagName!==`sklandDocument`)throw new Q(`Expected root element <sklandDocument>.`);ya(t);let n=ha(t),r=ma(t,`commitMsg`),i=fa(t,`metainfo`),a=fa(i,`cover`),o=fa(i,`subTypes`),s=fa(t,`description`),c=[];for(let e of pa(t,`chapters`)){let t=e.getAttribute(`name`);if(t==null)throw new Q(`Each <chapters> element must have a name attribute.`);let n=pa(e,`chapter`).map(e=>_a(e));c.push({title:t,chapters:n})}let l=pa(o,`subType`).map(e=>{let t=e.getAttribute(`id`);if(t==null)throw new Q(`<subType> must include an id attribute.`);return{subTypeId:t,value:$(e)}});return[{itemId:la($(fa(t,`itemId`))),infoRootMeta:n.infoRoot,publicMeta:n.item,briefExtra:n.brief,documentExtraInfo:n.documentExtraInfo,name:$(fa(i,`name`)),cover:$(a),showInDetail:(a.getAttribute(`showInDetail`)||`false`).toLowerCase()===`true`,subTypes:l,descriptionWasNull:(s.getAttribute(`source`)||``).toLowerCase()===`null`,description:Oa(s,{allowTables:!0}),chapterGroups:c,...r?{commitMsg:$(r)}:{}},[]]}function _a(e){let t=e.getAttribute(`name`);if(t==null)throw new Q(`Each <chapter> element must have a name attribute.`);let n=e.getAttribute(`size`)||``;if(e.getAttribute(`dialog`)===`true`){let r=`Dialog chapter '${t}'`;if(e.getAttribute(`table`)===`true`||e.getAttribute(`audio`)===`true`)throw new Q(`${r} cannot mix chapter modes.`);let i={title:t,size:n,chapterType:`dialog`,content:[],tabs:[],audios:[],tableRows:[],dialog:ba(e,r).map((e,t)=>Sa(e,`${r}.dialogList[${t}]`))};return Xi(i),i}if(e.getAttribute(`table`)===`true`){let r=fa(e,`table`),i=[];for(let[e,n]of pa(r,`row`).entries()){let r=pa(n,`cell`);if(r.length!==2)throw new Q(`Simple table chapter '${t}' row ${e+1} must contain exactly 2 cells.`);i.push({cells:r.map(e=>[e.getAttribute(`label`)||``,La(e)])})}return{title:t,size:n,chapterType:`simple_table`,content:[],tabs:[],audios:[],tableRows:i}}if(e.getAttribute(`audio`)===`true`){let r=pa(e,`tab`),i=pa(e,`audios`);if(r.length&&i.length)throw new Q(`Audio chapter '${t}' cannot contain both direct <audios> and <tab> elements.`);return r.length?{title:t,size:n,chapterType:`audio`,content:[],tabs:[],audios:[],audioTabs:r.map((e,n)=>{let r=pa(e,`audios`);if(r.length!==1)throw new Q(`Audio chapter '${t}' tab ${n+1} must contain exactly one <audios> element.`);return{title:e.getAttribute(`name`),icon:e.getAttribute(`icon`),audios:Ea(r[0])}}),tableRows:[]}:{title:t,size:n,chapterType:`audio`,content:[],tabs:[],audios:Ea(fa(e,`audios`)),tableRows:[]}}let r=pa(e,`tab`);return r.length?{title:t,size:n,chapterType:`common`,content:[],tabs:r.map(e=>Da(e,n)),audios:[],tableRows:[]}:{title:t,size:n,chapterType:`common`,content:Oa(e,{chapterSize:n,allowTables:!0}),tabs:[],audios:[],tableRows:[]}}const va=/* @__PURE__ */ new Set([`message`,`text`,`image`,`branches`,`branch`,`divider`]);function ya(e){let t=/* @__PURE__ */ new Set;for(let n of Array.from(e.getElementsByTagName(`*`))){if(n.tagName===`chapter`&&n.getAttribute(`dialog`)===`true`){let r=n.parentElement;if(r?.tagName!==`chapters`||r.parentElement!==e)throw new Q(`A dialog <chapter> must be directly inside a top-level <chapters> element.`);t.add(n)}if(!va.has(n.tagName))continue;let r=n.parentElement;for(;r&&r.tagName!==`chapter`;)r=r.parentElement;if(!r||!t.has(r))throw new Q(`<${n.tagName}> must be inside a dialog chapter.`)}}function ba(e,t){if($(e).trim())throw new Q(`${t} cannot contain text directly inside <${e.tagName}>.`);return ca(e)}function xa(e,t,n){for(let r of Array.from(e.attributes))if(!t.includes(r.name))throw new Q(`${n} has unsupported attribute '${r.name}' on <${e.tagName}>.`)}function Sa(e,t){switch(e.tagName){case`message`:return Ca(e,t);case`divider`:if(xa(e,[`kind`],t),ca(e).length)throw new Q(`${t} <divider> only supports plain text.`);return{type:`divider`,kind:e.getAttribute(`kind`)||``,text:$(e)};case`branches`:return xa(e,[],t),{type:`branches`,branches:ba(e,t).map((e,n)=>{let r=`${t}.branchList[${n}]`;if(e.tagName!==`branch`||!e.hasAttribute(`name`))throw new Q(`${r} must be a <branch> with a name attribute.`);return xa(e,[`name`],r),{title:e.getAttribute(`name`)||``,messages:ba(e,r).map((e,t)=>Ca(e,`${r}.dialogList[${t}]`))}})};default:throw new Q(`${t} cannot contain <${e.tagName}>.`)}}function Ca(e,t){let n=e.getAttribute(`side`);if(e.tagName!==`message`||n!==`me`&&n!==`other`)throw new Q(`${t} must be a <message> with side 'me' or 'other'.`);return xa(e,[`side`,`avatar`,`name`],t),{type:`message`,side:n,avatarUrl:e.getAttribute(`avatar`)||``,name:e.getAttribute(`name`)||``,contents:ba(e,t).map((e,n)=>wa(e,`${t}.contents[${n}]`))}}function wa(e,t){if(e.tagName===`text`)return{type:`text`,blocks:Ta(e,t)};if(e.tagName===`image`){if(xa(e,[`src`],t),da(e))throw new Q(`${t} <image> cannot contain content.`);return{type:`image`,src:e.getAttribute(`src`)||``}}throw new Q(`${t} must be <text> or <image>.`)}function Ta(e,t){xa(e,[],t);let n=[],r=``,i=!0;function a(e){let t=i?r.trimStart():r,a=e?t.trimEnd():t;a&&n.push(Ri(a)),r=``}for(let o of Array.from(e.childNodes))if(o.nodeType===3||o.nodeType===4)r+=o.nodeValue??``;else if(o.nodeType===1){let e=o,r=e.tagName===`br`;if(!r&&e.tagName!==`emoji`)throw new Q(`${t} cannot contain <${e.tagName}> inside <text>.`);a(r),n.push(...Na(e)),i=r}return a(!0),Ki([zi(n)])}function Ea(e){return pa(e,`audio`).map(e=>({title:e.getAttribute(`name`)||``,profile:La(e,!0),resourceUrl:e.getAttribute(`src`)||``}))}function Da(e,t){let n=null,r=Oa(e,{chapterSize:t,allowTables:!0,specialHandlers:{imgIntro:e=>{n={name:la($(fa(e,`name`))),introType:la($(fa(e,`type`))),imageUrl:la($(fa(e,`imgUrl`))),description:Ma(fa(e,`description`),{preserveNewlines:!0})}}}});return{title:e.getAttribute(`name`),icon:e.getAttribute(`icon`),intro:n,content:r}}function Oa(e,t){let n=t?.specialHandlers||{},r=t?.chapterSize,i=t?.allowTables??!0,a=[],o=null,s=!1,c=()=>(o||=[],o),l=()=>{o&&=(a.push(zi(Ui(o))),null)},u=e=>{if(!e)return;let t=e.replace(/\r\n|\r/g,`
28
+ `).split(`
29
+ `);for(let[e,n]of t.entries())e>0&&(o?l():s||a.push(zi()),s=!1),(n.trim()||o)&&c().push(Ri(n))};for(let t of Array.from(e.childNodes)){if(t.nodeType===3||t.nodeType===4){u(t.nodeValue);continue}if(t.nodeType!==1)continue;let e=t,o=e.tagName;if(n[o])l(),n[o](e),s=!0;else if($i.has(o))c().push(...Na(e));else if(ea.has(o)||i&&o===`table`)l(),a.push(ka(e,{chapterSize:r,allowTables:i})),s=!0;else{if(o===`table`&&!i)throw new Q(`Nested tables are not supported inside table cells.`);if(da(e))throw new Q(`Unsupported XML tag <${o}> in content container.`)}}return l(),Gi(a)}function ka(e,t){if(e.tagName===`h1`)return{blockType:`paragraph`,kind:`heading1`,align:`left`,inlines:Ma(e)};if(e.tagName===`h2`)return{blockType:`paragraph`,kind:`heading2`,align:`left`,inlines:Ma(e)};if(e.tagName===`h3`)return{blockType:`paragraph`,kind:`heading3`,align:`left`,inlines:Ma(e)};if(e.tagName===`quote`)return{blockType:`quote`,children:Oa(e,{chapterSize:t.chapterSize,allowTables:t.allowTables})};if(e.tagName===`ul`)return ja(e,{ordered:!1,chapterSize:t.chapterSize,allowTables:t.allowTables});if(e.tagName===`ol`)return ja(e,{ordered:!0,chapterSize:t.chapterSize,allowTables:t.allowTables});if(e.tagName===`align`)return{blockType:`paragraph`,kind:`body`,align:e.getAttribute(`value`)||`left`,inlines:Ma(e)};if(e.tagName===`img`){let t=la($(fa(e,`url`))),n=ma(e,`id`),r=ma(e,`format`),i=n&&r?null:Ra(t);return{blockType:`image`,url:t,width:la($(fa(e,`width`))),height:la($(fa(e,`height`))),size:la($(fa(e,`size`))),imageId:n?la($(n)):i[0],imageFormat:r?la($(r)):i[1],description:La(fa(e,`description`))}}if(e.tagName===`line`)return{blockType:`horizontalLine`,kind:e.getAttribute(`kind`)||``};if(e.tagName===`video`){let t=e.getAttribute(`kind`);if(!t)throw new Q(`<video> must include a kind attribute.`);if(!ta.has(t))throw new Q(`Unsupported external video kind '${t}'.`);let n=e.getAttribute(`id`);if(!n)throw new Q(`<video> must include an id attribute.`);return{blockType:`externalVideo`,videoKind:t,videoId:n}}if(e.tagName===`table`){if(!t.allowTables)throw new Q(`Nested tables are not supported inside table cells.`);return Aa(e,t.chapterSize)}throw new Q(`Unsupported block tag <${e.tagName}>.`)}function Aa(e,t){let n=(e.getAttribute(`header`)||`none`).trim()||`none`;if(!Ai.has(n))throw new Q(`Unsupported table header mode '${n}'.`);let r=pa(e,`tr`);if(!r.length)throw new Q(`Complex tables must contain at least one <tr>.`);let i=/* @__PURE__ */ new Map,a=[],o=0;for(let[e,s]of r.entries()){if((s.getAttribute(`width`)||``).trim())throw new Q(`Row-level width is not supported; use the table widths attribute instead.`);let r=!1,c=0;for(let o of Array.from(s.childNodes)){if(o.nodeType===3||o.nodeType===4){if((o.nodeValue||``).trim())throw new Q(r?`Unexpected trailing text inside a table row.`:`Unexpected text directly inside a table row.`);continue}if(o.nodeType!==1)continue;r=!0;let s=o;if(s.tagName!==`td`&&s.tagName!==`th`){if(da(s))throw new Q(`Unsupported tag <${s.tagName}> inside <tr>.`);continue}for(;i.has(`${e}:${c}`);)c+=1;let l=s.getAttribute(`col`);l!==null&&(c=Ba(l,`row ${e+1} col`)-1);let u=Ba((s.getAttribute(`rowspan`)||`1`).trim(),`row ${e+1} rowspan`),d=Ba((s.getAttribute(`colspan`)||`1`).trim(),`row ${e+1} colspan`),f=Oa(s,{chapterSize:t,allowTables:!1});if(s.tagName===`th`!==Bi(n,e,c))throw new Q(`Table header mode '${n}' conflicts with cell at row ${e+1}, column ${c+1}.`);a.push({rowIndex:e,columnIndex:c,rowSpan:u,colSpan:d,blocks:f});for(let t=0;t<u;t+=1)for(let n=0;n<d;n+=1){let r=`${e+t}:${c+n}`;i.set(r,{rowIndex:e,columnIndex:c})}c+=d}for(;i.has(`${e}:${c}`);)c+=1;o=Math.max(o,c)}let s={blockType:`complexTable`,headerMode:n,columnWidths:za(e.getAttribute(`widths`),t,o),cells:a,rowCount:r.length,columnCount:o};return Zi(s),s}function ja(e,t){if($(e).trim())throw new Q(`Unexpected text directly inside a list container.`);let n=[],r=null;for(let i of Array.from(e.childNodes)){if(i.nodeType===3||i.nodeType===4){if((i.nodeValue||``).trim())throw new Q(`Unexpected trailing text after a list child element.`);continue}if(i.nodeType!==1)continue;let e=i;if(e.tagName===`li`){let i=Oa(e,{chapterSize:t.chapterSize,allowTables:t.allowTables});i.length||(i=[zi()]),r={blocks:i},n.push(r)}else if(e.tagName===`ul`||e.tagName===`ol`){if(!r)throw new Q(`Nested list must follow a list item.`);r.blocks.push(ja(e,{ordered:e.tagName===`ol`,chapterSize:t.chapterSize,allowTables:t.allowTables}))}else if(da(e))throw new Q(`Unsupported tag <${e.tagName}> inside list.`)}return{blockType:`list`,ordered:t.ordered,items:n}}function Ma(e,t){let n=t?.bold??!1,r=t?.italic??!1,i=t?.underline??!1,a=t?.strike??!1,o=t?.color??null,s=t?.preserveNewlines??!1,c=t?.preserveWhitespace??!1,l=t?.preserveBoundarySpaces??!!(e.getElementsByTagName(`emoji`).length||e.getElementsByTagName(`annotation`).length),u=[];for(let t of Array.from(e.childNodes))t.nodeType===3||t.nodeType===4?Fa(u,t.nodeValue,{bold:n,italic:r,underline:i,strike:a,color:o,preserveNewlines:s,preserveWhitespace:c,preserveBoundarySpaces:l}):t.nodeType===1&&u.push(...Na(t,{bold:n,italic:r,underline:i,strike:a,color:o,preserveNewlines:s,preserveWhitespace:c,preserveBoundarySpaces:l}));return Ui(u)}function Na(e,t){let n=t?.bold??!1,r=t?.italic??!1,i=t?.underline??!1,a=t?.strike??!1,o=t?.color??null,s=t?.preserveNewlines??!1,c=t?.preserveWhitespace??!1,l=t?.preserveBoundarySpaces??!!(e.getElementsByTagName(`emoji`).length||e.getElementsByTagName(`annotation`).length);if(e.tagName===`emoji`){let t=e.getAttribute(`id`);if(!t?.trim())throw new Q(`Emoji must include a nonempty id.`);if(ca(e).length||$(e).trim())throw new Q(`<emoji> must not contain content.`);if(Array.from(e.attributes).some(e=>e.name!==`id`))throw new Q(`<emoji> only supports the id attribute.`);return[{inlineType:`emoji`,id:t}]}if(e.tagName===`annotation`)return[Pa(e)];if(e.tagName===`br`)return Ia(e),[Ri(`
30
+ `,{bold:n,italic:r,underline:i,strike:a,color:o})];if(e.tagName===`b`)return Ma(e,{bold:!0,italic:r,underline:i,strike:a,color:o,preserveNewlines:s,preserveWhitespace:c,preserveBoundarySpaces:l});if(e.tagName===`i`)return Ma(e,{bold:n,italic:!0,underline:i,strike:a,color:o,preserveNewlines:s,preserveWhitespace:c,preserveBoundarySpaces:l});if(e.tagName===`u`)return Ma(e,{bold:n,italic:r,underline:!0,strike:a,color:o,preserveNewlines:s,preserveWhitespace:c,preserveBoundarySpaces:l});if(e.tagName===`s`)return Ma(e,{bold:n,italic:r,underline:i,strike:!0,color:o,preserveNewlines:s,preserveWhitespace:c,preserveBoundarySpaces:l});if(e.tagName===`color`){let t=e.getAttribute(`value`);if(!t)throw new Q(`<color> must include a value attribute.`);if(!Qi[t])throw new Q(`Unsupported XML color '${t}'.`);return Ma(e,{bold:n,italic:r,underline:i,strike:a,color:t,preserveNewlines:s,preserveWhitespace:c,preserveBoundarySpaces:l})}if(e.tagName===`pron`)return[{inlineType:`pronunciation`,content:La(e)}];if(e.tagName===`a`)return[{inlineType:`link`,href:e.getAttribute(`href`)||``,text:La(e)}];if(e.tagName===`entry`){let t=e.getAttribute(`type`);if(!t)throw new Q(`<entry> must include a type attribute.`);return[{inlineType:`entry`,entryType:t,targetId:e.getAttribute(`id`)||``,count:e.getAttribute(`count`)||`0`}]}throw new Q(`Unsupported inline tag <${e.tagName}>.`)}function Pa(e){if(e.getElementsByTagName(`annotation`).length)throw new Q(`Nested annotations are not supported.`);let t=ca(e),n=pa(e,`title`),r=pa(e,`content`);if(n.length!==1||r.length!==1||t.length!==2||$(e).trim())throw new Q(`<annotation> must contain exactly one <title> and one <content>.`);let i=!0,a;for(let t=e.parentNode;t;t=t.parentNode){if(t.nodeType!==1)continue;let e=t;if(e.tagName===`annotation`)throw new Q(`Nested annotations are not supported.`);(e.tagName===`td`||e.tagName===`th`)&&(i=!1),e.tagName===`chapter`&&(a=e.getAttribute(`size`)||void 0)}return{inlineType:`annotation`,title:Ma(n[0],{preserveWhitespace:!0}),content:Oa(r[0],{allowTables:i,chapterSize:a})}}function Fa(e,t,n){if(!t)return;let r;n.preserveWhitespace?r=t.replace(/\r\n|\r/g,`
31
+ `):n.preserveNewlines?(r=t.replace(/\r\n/g,`
32
+ `).replace(/\r/g,`
33
+ `).replace(/[^\S\n]+/g,` `),n.preserveBoundarySpaces||(r=r.replace(/^[^\S\n]+/,``).replace(/[^\S\n]+$/,``))):(r=t.replace(/\s+/g,` `),n.preserveBoundarySpaces||(r=r.trim())),r&&e.push(Ri(r,{bold:n.bold,italic:n.italic,underline:n.underline,strike:n.strike,color:n.color}))}function Ia(e){if(Array.from(e.childNodes).some(e=>e.nodeType===1||!!e.nodeValue?.trim()))throw new Q(`<br> must not contain content.`)}function La(e,t=!1){let n=[``];function r(t){for(let i of Array.from(t.childNodes))if(i.nodeType===3||i.nodeType===4)n[n.length-1]+=i.nodeValue??``;else if(i.nodeType===1){let t=i;if(t.tagName===`emoji`||t.tagName===`annotation`)throw new Q(`Unsupported <${t.tagName}> inside text-only <${e.tagName}>.`);t.tagName===`br`?(Ia(t),n.push(``)):r(t)}}return r(e),n.map(e=>t?ua(e):la(e)).join(`
34
+ `)}function Ra(e){let t=e.split(`/`).pop()||``;if(!t.includes(`_`)||!t.includes(`.`))throw new Q(`Could not infer image id and format from url '${e}'.`);let n=t.indexOf(`_`),r=t.lastIndexOf(`.`);return[t.slice(0,n),t.slice(r+1)]}function za(e,t,n){if(n<=0)throw new Q(`Complex tables must contain at least one column.`);let r;if(!e||!e.trim()){if(!t)throw new Q(`Complex tables require a chapter size to derive default widths.`);let e=na[t];if(e==null)throw new Q(`Unsupported chapter size '${t}' for default table widths.`);let i=e/n;r=Array.from({length:n},()=>i)}else{let t=e.split(`,`).map(e=>e.trim());if(t.length!==n)throw new Q(`Table widths count ${t.length} does not match logical column count ${n}.`);r=t.map((e,t)=>{let n=Number.parseFloat(e);if(!Number.isFinite(n))throw new Q(`Table width '${e}' for column ${t+1} is not numeric.`);return n})}for(let e=0;e<r.length;e+=1){let t=r[e];if(!Number.isFinite(t)||t<=0)throw new Q(`Table column ${e+1} width ${t} must be a positive number.`)}return r}function Ba(e,t){let n=Number.parseInt(e,10);if(!Number.isInteger(n))throw new Q(`Expected integer for ${t}.`);if(n<1)throw new Q(`Expected positive integer for ${t}.`);return n}var Va=class{graph=[];end;start;members;constructor(e){let t=this.node();this.end=this.node(),e?this.particle(e,t,this.end):this.connect(t,this.end),this.start=this.closure([t]),this.members=new Map(this.graph.flatMap(e=>e.flatMap(({element:e})=>e?[[e.name,e]]:[])))}node(){return this.graph.push([])-1}connect(e,t,n){this.graph[e].push({to:t,element:n})}particle(e,t,n){let r=t;for(let t=0;t<e.min;t++){let t=this.node();this.unit(e,r,t),r=t}if(e.max===null){this.connect(r,n);let t=this.node();this.unit(e,r,t),this.connect(t,r)}else{for(let t=e.min;t<e.max;t++){this.connect(r,n);let t=this.node();this.unit(e,r,t),r=t}this.connect(r,n)}}unit(e,t,n){if(e.kind===`element`)this.connect(t,n,e.element);else if(e.kind===`choice`)for(let r of e.children)this.particle(r,t,n);else if(e.kind===`all`){let r=[t,...Array.from({length:(1<<e.children.length)-1},()=>this.node())],i=e.children.reduce((e,t,n)=>e|(t.min>0?1<<n:0),0);for(let[t,a]of r.entries()){(t&i)===i&&this.connect(a,n);for(let[n,i]of e.children.entries())!(t&1<<n)&&i.kind===`element`&&this.connect(a,r[t|1<<n],i.element)}}else{let r=t;for(let t of e.children){let e=this.node();this.particle(t,r,e),r=e}this.connect(r,n)}}closure(e){let t=new Set(e);for(let e of t)for(let n of this.graph[e])n.element||t.add(n.to);return[...t]}advance(e,t){let n=[];for(let r of e)for(let e of this.graph[r])e.element?.name===t&&n.push(e.to);return this.closure(n)}candidates(e){let t=/* @__PURE__ */ new Map;for(let n of e)for(let e of this.graph[n])e.element&&t.set(e.element.name,e.element);return[...t.values()]}accepts(e){return e.includes(this.end)}};const Ha={source:`reference/skland-wiki-v1.xsd`,version:`1.0`,hash:`bbade900644352de2c11db2b44ba5534c4654f60e37cb1d333f40b6369c6d121`,documentation:`SKLAND Wiki XML, based on @eihrteam/xml 1.0.0. Use the converter to check chapter modes, table geometry, and other conversion rules.`,roots:[{name:`sklandDocument`,type:`#12`}],simpleTypes:{ColorValue:{base:`string`,values:[`s_1`,`s_2`,`s_3`,`s_4`,`r_1`,`r_2`,`r_3`,`r_4`,`r_5`,`r_6`,`f_orange`,`f_turquoise`,`f_green`,`f_sandstone`,`f_yellow`,`f_red`,`f_blue`,`f_brown`,`f_violet`,`f_blueness`]},EntryType:{base:`string`,values:[`card-big`,`link-img`,`link-txt`]},VideoKind:{base:`string`,values:[`skland`,`bilibili`]},TableHeader:{base:`token`,values:[``,`none`,`row`,`col`,`both`]},DialogSide:{base:`string`,values:[`me`,`other`]},NonEmptyString:{base:`string`,minLength:1},NonBlankText:{base:`token`,minLength:1}},complexTypes:{PlainText:{text:`xs:string`,mixed:!1,attributes:[],anyAttribute:!0},Break:{mixed:!1,attributes:[],anyAttribute:!0},TextWithBreaks:{content:{kind:`sequence`,min:1,max:1,children:[{kind:`element`,min:0,max:null,element:{name:`br`,type:`Break`}}]},mixed:!0,attributes:[],anyAttribute:!1},Emoji:{mixed:!1,attributes:[{name:`id`,type:`NonBlankText`,required:!0}],anyAttribute:!1},"#1":{content:{kind:`sequence`,min:1,max:1,children:[{kind:`element`,min:0,max:null,element:{name:`br`,type:`Break`}}]},mixed:!0,attributes:[],anyAttribute:!0},"#2":{content:{kind:`sequence`,min:1,max:1,children:[{kind:`element`,min:0,max:null,element:{name:`br`,type:`Break`}}]},mixed:!0,attributes:[{name:`href`,type:`xs:string`,required:!1}],anyAttribute:!0},"#3":{mixed:!1,attributes:[{name:`type`,type:`EntryType`,required:!0},{name:`id`,type:`xs:string`,required:!1},{name:`count`,type:`xs:string`,required:!1}],anyAttribute:!0},InlineContent:{content:{kind:`sequence`,min:0,max:null,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`ColorContent`}},{kind:`element`,min:1,max:1,element:{name:`annotation`,type:`Annotation`}}]}]},mixed:!0,attributes:[],anyAttribute:!0},CellInlineContent:{content:{kind:`sequence`,min:0,max:null,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`CellColorContent`}},{kind:`element`,min:1,max:1,element:{name:`annotation`,type:`CellAnnotation`}}]}]},mixed:!0,attributes:[],anyAttribute:!0},AnnotationInlineContent:{content:{kind:`sequence`,min:0,max:null,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`AnnotationColorContent`}}]}]},mixed:!0,attributes:[],anyAttribute:!0},ColorContent:{content:{kind:`sequence`,min:0,max:null,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`ColorContent`}},{kind:`element`,min:1,max:1,element:{name:`annotation`,type:`Annotation`}}]}]},mixed:!0,attributes:[{name:`value`,type:`ColorValue`,required:!0}],anyAttribute:!0},CellColorContent:{content:{kind:`sequence`,min:0,max:null,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`CellColorContent`}},{kind:`element`,min:1,max:1,element:{name:`annotation`,type:`CellAnnotation`}}]}]},mixed:!0,attributes:[{name:`value`,type:`ColorValue`,required:!0}],anyAttribute:!0},AnnotationColorContent:{content:{kind:`sequence`,min:0,max:null,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`AnnotationColorContent`}}]}]},mixed:!0,attributes:[{name:`value`,type:`ColorValue`,required:!0}],anyAttribute:!0},Annotation:{content:{kind:`all`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`title`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`content`,type:`AnnotationContent`}}]},mixed:!1,attributes:[],anyAttribute:!0},CellAnnotation:{content:{kind:`all`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`title`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`content`,type:`CellAnnotationContent`}}]},mixed:!1,attributes:[],anyAttribute:!0},"#4":{mixed:!1,attributes:[{name:`kind`,type:`xs:string`,required:!1}],anyAttribute:!0},"#5":{mixed:!1,attributes:[{name:`kind`,type:`VideoKind`,required:!0},{name:`id`,type:`NonEmptyString`,required:!0}],anyAttribute:!0},Align:{content:{kind:`sequence`,min:0,max:null,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`ColorContent`}},{kind:`element`,min:1,max:1,element:{name:`annotation`,type:`Annotation`}}]}]},mixed:!0,attributes:[{name:`value`,type:`xs:string`,required:!1}],anyAttribute:!0},CellAlign:{content:{kind:`sequence`,min:0,max:null,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`CellColorContent`}},{kind:`element`,min:1,max:1,element:{name:`annotation`,type:`CellAnnotation`}}]}]},mixed:!0,attributes:[{name:`value`,type:`xs:string`,required:!1}],anyAttribute:!0},AnnotationAlign:{content:{kind:`sequence`,min:0,max:null,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`AnnotationColorContent`}}]}]},mixed:!0,attributes:[{name:`value`,type:`xs:string`,required:!1}],anyAttribute:!0},BodyContent:{content:{kind:`sequence`,min:0,max:null,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`ColorContent`}},{kind:`element`,min:1,max:1,element:{name:`annotation`,type:`Annotation`}}]}]},{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`img`,type:`ImageBlock`}},{kind:`element`,min:1,max:1,element:{name:`line`,type:`#4`}},{kind:`element`,min:1,max:1,element:{name:`video`,type:`#5`}}]}]},{kind:`element`,min:1,max:1,element:{name:`h1`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h2`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h3`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`align`,type:`Align`}},{kind:`element`,min:1,max:1,element:{name:`quote`,type:`BodyContent`}},{kind:`element`,min:1,max:1,element:{name:`ul`,type:`List`}},{kind:`element`,min:1,max:1,element:{name:`ol`,type:`List`}}]}]},{kind:`element`,min:1,max:1,element:{name:`table`,type:`ComplexTable`}}]}]},mixed:!0,attributes:[],anyAttribute:!0},CellContent:{content:{kind:`choice`,min:0,max:null,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`CellColorContent`}},{kind:`element`,min:1,max:1,element:{name:`annotation`,type:`CellAnnotation`}}]}]},{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`img`,type:`ImageBlock`}},{kind:`element`,min:1,max:1,element:{name:`line`,type:`#4`}},{kind:`element`,min:1,max:1,element:{name:`video`,type:`#5`}}]}]},{kind:`element`,min:1,max:1,element:{name:`h1`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h2`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h3`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`align`,type:`CellAlign`}},{kind:`element`,min:1,max:1,element:{name:`quote`,type:`CellContent`}},{kind:`element`,min:1,max:1,element:{name:`ul`,type:`CellList`}},{kind:`element`,min:1,max:1,element:{name:`ol`,type:`CellList`}}]},mixed:!0,attributes:[],anyAttribute:!0},AnnotationContent:{content:{kind:`choice`,min:0,max:null,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`AnnotationColorContent`}}]}]},{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`img`,type:`ImageBlock`}},{kind:`element`,min:1,max:1,element:{name:`line`,type:`#4`}},{kind:`element`,min:1,max:1,element:{name:`video`,type:`#5`}}]}]},{kind:`element`,min:1,max:1,element:{name:`h1`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h2`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h3`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`align`,type:`AnnotationAlign`}}]}]},{kind:`element`,min:1,max:1,element:{name:`quote`,type:`AnnotationContent`}},{kind:`element`,min:1,max:1,element:{name:`ul`,type:`AnnotationList`}},{kind:`element`,min:1,max:1,element:{name:`ol`,type:`AnnotationList`}},{kind:`element`,min:1,max:1,element:{name:`table`,type:`AnnotationTable`}}]},mixed:!0,attributes:[],anyAttribute:!0},CellAnnotationContent:{content:{kind:`choice`,min:0,max:null,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`AnnotationColorContent`}}]}]},{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`img`,type:`ImageBlock`}},{kind:`element`,min:1,max:1,element:{name:`line`,type:`#4`}},{kind:`element`,min:1,max:1,element:{name:`video`,type:`#5`}}]}]},{kind:`element`,min:1,max:1,element:{name:`h1`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h2`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h3`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`align`,type:`AnnotationAlign`}}]}]},{kind:`element`,min:1,max:1,element:{name:`quote`,type:`CellAnnotationContent`}},{kind:`element`,min:1,max:1,element:{name:`ul`,type:`CellAnnotationList`}},{kind:`element`,min:1,max:1,element:{name:`ol`,type:`CellAnnotationList`}}]},mixed:!0,attributes:[],anyAttribute:!0},List:{content:{kind:`sequence`,min:0,max:null,children:[{kind:`element`,min:1,max:1,element:{name:`li`,type:`BodyContent`}},{kind:`choice`,min:0,max:null,children:[{kind:`element`,min:1,max:1,element:{name:`ul`,type:`List`}},{kind:`element`,min:1,max:1,element:{name:`ol`,type:`List`}}]}]},mixed:!1,attributes:[],anyAttribute:!0},CellList:{content:{kind:`sequence`,min:0,max:null,children:[{kind:`element`,min:1,max:1,element:{name:`li`,type:`CellContent`}},{kind:`choice`,min:0,max:null,children:[{kind:`element`,min:1,max:1,element:{name:`ul`,type:`CellList`}},{kind:`element`,min:1,max:1,element:{name:`ol`,type:`CellList`}}]}]},mixed:!1,attributes:[],anyAttribute:!0},AnnotationList:{content:{kind:`sequence`,min:0,max:null,children:[{kind:`element`,min:1,max:1,element:{name:`li`,type:`AnnotationContent`}},{kind:`choice`,min:0,max:null,children:[{kind:`element`,min:1,max:1,element:{name:`ul`,type:`AnnotationList`}},{kind:`element`,min:1,max:1,element:{name:`ol`,type:`AnnotationList`}}]}]},mixed:!1,attributes:[],anyAttribute:!0},CellAnnotationList:{content:{kind:`sequence`,min:0,max:null,children:[{kind:`element`,min:1,max:1,element:{name:`li`,type:`CellAnnotationContent`}},{kind:`choice`,min:0,max:null,children:[{kind:`element`,min:1,max:1,element:{name:`ul`,type:`CellAnnotationList`}},{kind:`element`,min:1,max:1,element:{name:`ol`,type:`CellAnnotationList`}}]}]},mixed:!1,attributes:[],anyAttribute:!0},ImageBlock:{content:{kind:`all`,min:1,max:1,children:[{kind:`element`,min:0,max:1,element:{name:`id`,type:`PlainText`}},{kind:`element`,min:0,max:1,element:{name:`format`,type:`PlainText`}},{kind:`element`,min:1,max:1,element:{name:`width`,type:`PlainText`}},{kind:`element`,min:1,max:1,element:{name:`height`,type:`PlainText`}},{kind:`element`,min:1,max:1,element:{name:`size`,type:`PlainText`}},{kind:`element`,min:1,max:1,element:{name:`url`,type:`PlainText`}},{kind:`element`,min:1,max:1,element:{name:`description`,type:`TextWithBreaks`}}]},mixed:!1,attributes:[],anyAttribute:!0},ComplexCell:{content:{kind:`choice`,min:0,max:null,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`CellColorContent`}},{kind:`element`,min:1,max:1,element:{name:`annotation`,type:`CellAnnotation`}}]}]},{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`img`,type:`ImageBlock`}},{kind:`element`,min:1,max:1,element:{name:`line`,type:`#4`}},{kind:`element`,min:1,max:1,element:{name:`video`,type:`#5`}}]}]},{kind:`element`,min:1,max:1,element:{name:`h1`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h2`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h3`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`align`,type:`CellAlign`}},{kind:`element`,min:1,max:1,element:{name:`quote`,type:`CellContent`}},{kind:`element`,min:1,max:1,element:{name:`ul`,type:`CellList`}},{kind:`element`,min:1,max:1,element:{name:`ol`,type:`CellList`}}]},mixed:!0,attributes:[{name:`col`,type:`xs:string`,required:!1},{name:`rowspan`,type:`xs:string`,required:!1},{name:`colspan`,type:`xs:string`,required:!1}],anyAttribute:!0},AnnotationTableCell:{content:{kind:`choice`,min:0,max:null,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`AnnotationColorContent`}}]}]},{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`img`,type:`ImageBlock`}},{kind:`element`,min:1,max:1,element:{name:`line`,type:`#4`}},{kind:`element`,min:1,max:1,element:{name:`video`,type:`#5`}}]}]},{kind:`element`,min:1,max:1,element:{name:`h1`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h2`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h3`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`align`,type:`AnnotationAlign`}}]}]},{kind:`element`,min:1,max:1,element:{name:`quote`,type:`CellAnnotationContent`}},{kind:`element`,min:1,max:1,element:{name:`ul`,type:`CellAnnotationList`}},{kind:`element`,min:1,max:1,element:{name:`ol`,type:`CellAnnotationList`}}]},mixed:!0,attributes:[{name:`col`,type:`xs:string`,required:!1},{name:`rowspan`,type:`xs:string`,required:!1},{name:`colspan`,type:`xs:string`,required:!1}],anyAttribute:!0},ComplexRow:{content:{kind:`choice`,min:0,max:null,children:[{kind:`element`,min:1,max:1,element:{name:`td`,type:`ComplexCell`}},{kind:`element`,min:1,max:1,element:{name:`th`,type:`ComplexCell`}}]},mixed:!1,attributes:[],anyAttribute:!0},AnnotationTableRow:{content:{kind:`choice`,min:0,max:null,children:[{kind:`element`,min:1,max:1,element:{name:`td`,type:`AnnotationTableCell`}},{kind:`element`,min:1,max:1,element:{name:`th`,type:`AnnotationTableCell`}}]},mixed:!1,attributes:[],anyAttribute:!0},ComplexTable:{content:{kind:`sequence`,min:1,max:1,children:[{kind:`element`,min:1,max:null,element:{name:`tr`,type:`ComplexRow`}}]},mixed:!1,attributes:[{name:`header`,type:`TableHeader`,required:!1},{name:`widths`,type:`xs:string`,required:!1}],anyAttribute:!0},AnnotationTable:{content:{kind:`sequence`,min:1,max:1,children:[{kind:`element`,min:1,max:null,element:{name:`tr`,type:`AnnotationTableRow`}}]},mixed:!1,attributes:[{name:`header`,type:`TableHeader`,required:!1},{name:`widths`,type:`xs:string`,required:!1}],anyAttribute:!0},"#6":{content:{kind:`sequence`,min:1,max:1,children:[{kind:`element`,min:0,max:null,element:{name:`br`,type:`Break`}}]},mixed:!0,attributes:[{name:`label`,type:`xs:string`,required:!1}],anyAttribute:!0},SimpleRow:{content:{kind:`sequence`,min:1,max:1,children:[{kind:`element`,min:2,max:2,element:{name:`cell`,type:`#6`}}]},mixed:!1,attributes:[],anyAttribute:!0},ChapterTable:{content:{kind:`choice`,min:0,max:1,children:[{kind:`element`,min:1,max:null,element:{name:`row`,type:`SimpleRow`}},{kind:`element`,min:1,max:null,element:{name:`tr`,type:`ComplexRow`}}]},mixed:!1,attributes:[{name:`header`,type:`TableHeader`,required:!1},{name:`widths`,type:`xs:string`,required:!1}],anyAttribute:!0},AudioItem:{content:{kind:`sequence`,min:1,max:1,children:[{kind:`element`,min:0,max:null,element:{name:`br`,type:`Break`}}]},mixed:!0,attributes:[{name:`name`,type:`xs:string`,required:!1},{name:`src`,type:`xs:string`,required:!1}],anyAttribute:!0},Audios:{content:{kind:`sequence`,min:1,max:1,children:[{kind:`element`,min:0,max:null,element:{name:`audio`,type:`AudioItem`}}]},mixed:!1,attributes:[],anyAttribute:!0},ImageIntro:{content:{kind:`all`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`name`,type:`PlainText`}},{kind:`element`,min:1,max:1,element:{name:`type`,type:`PlainText`}},{kind:`element`,min:1,max:1,element:{name:`imgUrl`,type:`PlainText`}},{kind:`element`,min:1,max:1,element:{name:`description`,type:`InlineContent`}}]},mixed:!1,attributes:[],anyAttribute:!0},Tab:{content:{kind:`choice`,min:0,max:null,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`ColorContent`}},{kind:`element`,min:1,max:1,element:{name:`annotation`,type:`Annotation`}}]}]},{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`img`,type:`ImageBlock`}},{kind:`element`,min:1,max:1,element:{name:`line`,type:`#4`}},{kind:`element`,min:1,max:1,element:{name:`video`,type:`#5`}}]}]},{kind:`element`,min:1,max:1,element:{name:`h1`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h2`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h3`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`align`,type:`Align`}},{kind:`element`,min:1,max:1,element:{name:`quote`,type:`BodyContent`}},{kind:`element`,min:1,max:1,element:{name:`ul`,type:`List`}},{kind:`element`,min:1,max:1,element:{name:`ol`,type:`List`}}]}]},{kind:`element`,min:1,max:1,element:{name:`table`,type:`ComplexTable`}}]}]},{kind:`element`,min:1,max:1,element:{name:`imgIntro`,type:`ImageIntro`}},{kind:`element`,min:1,max:1,element:{name:`audios`,type:`Audios`}}]},mixed:!0,attributes:[{name:`name`,type:`xs:string`,required:!1},{name:`icon`,type:`xs:string`,required:!1}],anyAttribute:!0},DialogText:{content:{kind:`choice`,min:0,max:null,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}}]},mixed:!0,attributes:[],anyAttribute:!1},"#7":{mixed:!1,attributes:[{name:`src`,type:`NonBlankText`,required:!0}],anyAttribute:!1},DialogMessage:{content:{kind:`choice`,min:0,max:null,children:[{kind:`element`,min:1,max:1,element:{name:`text`,type:`DialogText`}},{kind:`element`,min:1,max:1,element:{name:`image`,type:`#7`}}]},mixed:!1,attributes:[{name:`side`,type:`DialogSide`,required:!0},{name:`avatar`,type:`NonBlankText`,required:!0},{name:`name`,type:`xs:string`,required:!1}],anyAttribute:!1},"#8":{content:{kind:`sequence`,min:1,max:1,children:[{kind:`element`,min:2,max:null,element:{name:`message`,type:`DialogMessage`}}]},mixed:!1,attributes:[{name:`name`,type:`xs:string`,required:!0}],anyAttribute:!1},DialogBranches:{content:{kind:`sequence`,min:1,max:1,children:[{kind:`element`,min:1,max:null,element:{name:`branch`,type:`#8`}}]},mixed:!1,attributes:[],anyAttribute:!1},DialogDivider:{text:`xs:string`,mixed:!1,attributes:[{name:`kind`,type:`NonBlankText`,required:!0}],anyAttribute:!1},Chapter:{content:{kind:`choice`,min:0,max:null,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`ColorContent`}},{kind:`element`,min:1,max:1,element:{name:`annotation`,type:`Annotation`}}]}]},{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`img`,type:`ImageBlock`}},{kind:`element`,min:1,max:1,element:{name:`line`,type:`#4`}},{kind:`element`,min:1,max:1,element:{name:`video`,type:`#5`}}]}]},{kind:`element`,min:1,max:1,element:{name:`h1`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h2`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h3`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`align`,type:`Align`}},{kind:`element`,min:1,max:1,element:{name:`quote`,type:`BodyContent`}},{kind:`element`,min:1,max:1,element:{name:`ul`,type:`List`}},{kind:`element`,min:1,max:1,element:{name:`ol`,type:`List`}}]}]},{kind:`element`,min:1,max:1,element:{name:`table`,type:`ChapterTable`}},{kind:`element`,min:1,max:1,element:{name:`tab`,type:`Tab`}},{kind:`element`,min:1,max:1,element:{name:`audios`,type:`Audios`}},{kind:`element`,min:1,max:1,element:{name:`message`,type:`DialogMessage`}},{kind:`element`,min:1,max:1,element:{name:`branches`,type:`DialogBranches`}},{kind:`element`,min:1,max:1,element:{name:`divider`,type:`DialogDivider`}}]},mixed:!0,attributes:[{name:`name`,type:`xs:string`,required:!0},{name:`size`,type:`xs:string`,required:!1},{name:`table`,type:`xs:string`,required:!1},{name:`audio`,type:`xs:string`,required:!1},{name:`dialog`,type:`xs:string`,required:!1}],anyAttribute:!0},ChapterGroup:{content:{kind:`sequence`,min:1,max:1,children:[{kind:`element`,min:0,max:null,element:{name:`chapter`,type:`Chapter`}}]},mixed:!1,attributes:[{name:`name`,type:`xs:string`,required:!0}],anyAttribute:!0},"#9":{text:`xs:string`,mixed:!1,attributes:[{name:`showInDetail`,type:`xs:string`,required:!1}],anyAttribute:!0},"#11":{text:`xs:string`,mixed:!1,attributes:[{name:`id`,type:`xs:string`,required:!0}],anyAttribute:!0},"#10":{content:{kind:`sequence`,min:1,max:1,children:[{kind:`element`,min:0,max:null,element:{name:`subType`,type:`#11`}}]},mixed:!1,attributes:[],anyAttribute:!0},MetaInfo:{content:{kind:`all`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`name`,type:`PlainText`}},{kind:`element`,min:1,max:1,element:{name:`cover`,type:`#9`}},{kind:`element`,min:1,max:1,element:{name:`subTypes`,type:`#10`}}]},mixed:!1,attributes:[],anyAttribute:!0},"#13":{content:{kind:`sequence`,min:0,max:null,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`ColorContent`}},{kind:`element`,min:1,max:1,element:{name:`annotation`,type:`Annotation`}}]}]},{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`img`,type:`ImageBlock`}},{kind:`element`,min:1,max:1,element:{name:`line`,type:`#4`}},{kind:`element`,min:1,max:1,element:{name:`video`,type:`#5`}}]}]},{kind:`element`,min:1,max:1,element:{name:`h1`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h2`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h3`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`align`,type:`Align`}},{kind:`element`,min:1,max:1,element:{name:`quote`,type:`BodyContent`}},{kind:`element`,min:1,max:1,element:{name:`ul`,type:`List`}},{kind:`element`,min:1,max:1,element:{name:`ol`,type:`List`}}]}]},{kind:`element`,min:1,max:1,element:{name:`table`,type:`ComplexTable`}}]}]},mixed:!0,attributes:[{name:`source`,type:`xs:string`,required:!1}],anyAttribute:!0},"#12":{content:{kind:`choice`,min:0,max:null,children:[{kind:`element`,min:1,max:1,element:{name:`itemId`,type:`PlainText`}},{kind:`element`,min:1,max:1,element:{name:`commitMsg`,type:`PlainText`}},{kind:`element`,min:1,max:1,element:{name:`publicMeta`,type:`PlainText`}},{kind:`element`,min:1,max:1,element:{name:`metainfo`,type:`MetaInfo`}},{kind:`element`,min:1,max:1,element:{name:`description`,type:`#13`}},{kind:`element`,min:1,max:1,element:{name:`chapters`,type:`ChapterGroup`}}]},mixed:!1,attributes:[],anyAttribute:!0}}};dt();const Ua=/* @__PURE__ */ new Map,Wa=new Va,Ga=new Map(Ha.roots.map(e=>[e.name,e]));function Ka(e){return Object.hasOwn(Ha.complexTypes,e)?Ha.complexTypes[e]:void 0}function qa(e){return Object.hasOwn(Ha.simpleTypes,e)?Ha.simpleTypes[e]:{base:e===`xs:token`?`token`:`string`}}function Ja(e){let t=Ka(e)?.content;if(!t)return Wa;let n=Ua.get(e);return n||(n=new Va(t),Ua.set(e,n)),n}function Ya(e){if(e.namespace||!e.name.name)return;if(!e.parent)return Ga.get(e.name.name);let t=Ya(e.parent);return t?Ja(t.type).members.get(e.name.name):void 0}function Xa(e,t){return t.base===`token`?e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``):e}function Za(e,t){return(t.values===void 0||t.values.includes(e))&&(t.minLength===void 0||Array.from(e).length>=t.minLength)}function Qa(e){return e.fixed===void 0?qa(e.type).values??[]:[e.fixed]}function $a(e,t,n){let r=(e,t,r)=>{n.length<100&&n.push({source:`schema`,code:e,span:t,message:r})};function i(e,a){if(n.length>=100)return;let o=Ka(a.type),s=new Map(o?.attributes.map(e=>[e.name,e])),c=/* @__PURE__ */ new Set;for(let t of e.attributes){let n=t.name.name;c.add(n);let i=s.get(n);if(!i)o?.anyAttribute||n===`xmlns`||n.startsWith(`xmlns:`)||n===`xsi:schemaLocation`||n===`xsi:noNamespaceSchemaLocation`||n===`xml:space`&&e.namespace!==`http://www.w3.org/XML/1998/namespace`||r(`unknown-attribute`,t.name,`Attribute “${n}” is unsupported on <${e.name.name}>.`);else if(t.closed&&t.decoded!==void 0){let e=qa(i.type),a=Xa(t.decoded,e);if(!Za(a,e)||i.fixed!==void 0&&a!==Xa(i.fixed,e)){let e=Qa(i);r(`invalid-attribute-value`,t.value??t.name,e.length?`Expected one of: ${e.map(e=>JSON.stringify(e)).join(`, `)}.`:`Attribute “${n}” must contain text.`)}}}if(e.complete)for(let t of s.values())t.required&&!c.has(t.name)&&r(`required-attribute`,e.name,`Missing required attribute “${t.name}”.`);let l=Ja(a.type),u=l.start,d=!1;for(let t of e.children){if(n.length>=100)break;let a=t.name.name;if(!a||!t.complete){d=!0;continue}let o=!t.namespace&&l.members.get(a);if(!o){r(`unexpected-element`,t.name,`<${a}> is unsupported inside <${e.name.name}>.`),d=!0;continue}let s=l.advance(u,a);s.length?u=s:(d||r(`child-order-or-occurrence`,t.name,`<${a}> cannot occur here inside <${e.name.name}>.`),d=!0),i(t,o)}if(!d&&(e.selfClosing||e.close?.complete)&&!l.accepts(u)){let t=l.candidates(u).map(e=>`<${e.name}>`).join(`, `);r(`missing-child`,e.close?.name??e.name,`Incomplete content for <${e.name.name}>. Expected ${t}.`)}let f=e.content.flatMap(e=>{let n=t.slice(e.span.from,e.span.to);switch(e.kind){case`Text`:return[{span:e.span,value:n}];case`Cdata`:return[{span:e.span,value:n.slice(9,-3)}];case`EntityReference`:case`CharacterReference`:return[{span:e.span,value:fi(n)}];default:return[]}});if(o&&!o.mixed&&!o.text){let t=f.find(e=>li(e.value));t&&r(`unexpected-text`,t.span,`Text is unsupported inside <${e.name.name}>.`)}else if((!o||o.text)&&(e.selfClosing||e.close?.complete)){let t=qa(o?.text??a.type);(t.values||t.minLength)&&(Za(Xa(f.map(e=>e.value).join(``),t),t)||r(`invalid-element-value`,e.name,`Invalid value for <${e.name.name}> (${o?.text??a.type}).`))}}for(let t of e.roots){let e=t.name.name,n=!t.namespace&&Ga.get(e);n?i(t,n):t.complete&&e&&r(`unexpected-root`,t.name,`Expected the unqualified root <${Ha.roots[0]?.name}>.`)}}function eo(e){let t=0;for(let n of e){if(![`td`,`th`].includes(n.name.name))continue;let e=e=>{let t=n.attributes.find(t=>t.name.name===e)?.decoded;return t?Number.parseInt(t,10):1},r=e(`rowspan`),i=e(`colspan`),a=e(`col`);if(r>1e4||i>1e4||a>1e4||(t+=(r>0?r:1)*(i>0?i:1),t>25e4))return n.name}}function to(e){try{return new Ei.DOMParser({onError(){throw Error(`Malformed XML`)}}).parseFromString(e,`application/xml`),!0}catch{return!1}}function no(e,t,n){let r=[...t.issues],i=t.roots[0]?.name??{from:0,to:0};if(t.limited||r.some(e=>e.code===`doctype-disabled`)||(r.length===0&&!to(e)&&r.push({source:`syntax`,code:`strict-xml`,span:i,message:`The document fails strict XML parsing.`}),$a(t,e,r),r.length||!t.roots.length))return r;let a=eo(n());if(a)return[{source:`semantic`,code:`table-resource-limit`,span:a,severity:R.Warning,message:`Skipped conversion validation because the expanded table exceeds the analysis budget.`}];try{let[,t]=ga(e);for(let e of t.slice(0,100))r.push({source:`semantic`,code:`converter-warning`,message:e,span:i,severity:R.Warning})}catch(e){if(!(e instanceof Q))throw e;r.push({source:`semantic`,code:`conversion-error`,message:e.message,span:i})}return r}dt();var ro=class{document;fragments=[];syntaxTree;projection;cachedElements;cachedIssues;constructor({uri:e,version:t,text:n}){this.document=Hn.create(e,`skland-xml`,t,n)}get version(){return this.document.version}get text(){return this.document.getText()}get uri(){return this.document.uri}update(e,t){if(e<=this.version)return!1;this.syntaxTree&&(this.fragments=Rn.addTree(this.syntaxTree,this.fragments));for(let n of t)if(n.range){let t=this.offset(n.range.start),r=Math.max(t,this.offset(n.range.end));this.fragments=Rn.applyChanges(this.fragments,[{fromA:t,toA:r,fromB:t,toB:t+n.text.length}]),Hn.update(this.document,[{range:n.range,text:n.text}],e)}else this.fragments=[],Hn.update(this.document,[{text:n.text}],e);return t.length||Hn.update(this.document,[],e),this.syntaxTree=void 0,this.projection=void 0,this.cachedElements=void 0,this.cachedIssues=void 0,!0}get analysis(){return this.projection||=(this.syntaxTree=pi(this.text,this.fragments),this.fragments=[],_i(this.text,this.syntaxTree)),this.projection}get elements(){return this.cachedElements??=vi(this.analysis.roots)}get issues(){return this.cachedIssues??=no(this.text,this.analysis,()=>this.elements)}offset(e){return this.document.offsetAt(e)}position(e){return this.document.positionAt(e)}range(e){return j.create(this.position(e.from),this.position(e.to))}elementAt(e,t=!1){let n,r=this.analysis.roots;for(;r.length;){let i=0,a=r.length-1;for(;i<=a;){let t=i+a>>>1;r[t].span.from<=e?i=t+1:a=t-1}let o=r[a];if(!o||(t?o.span.to<e:o.span.to<=e))break;n=o,r=o.children}return n}opaqueAt(e){if(this.analysis.limited)return!0;for(let t=this.syntaxTree?.resolveInner(e,-1);t;t=t.parent??void 0)if([`Comment`,`Cdata`,`ProcessingInst`,`DoctypeDecl`].includes(t.name)){let n=t.name===`Comment`?`-->`:t.name===`Cdata`?`]]>`:t.name===`ProcessingInst`?`?>`:`>`;return t.to>e||this.text.slice(t.to-n.length,t.to)!==n}return!1}};dt();function io(e,t){return{range:e.range(t.span),message:t.message,code:t.code,source:`skland-xml/`+t.source,severity:t.severity??R.Error,...t.related&&{relatedInformation:[{location:{uri:e.uri,range:e.range(t.related.span)},message:t.related.message}]}}}function ao(e,t){return e.from<=t.to&&t.from<=e.to}function oo(e,t){return{from:e.offset(t.start),to:e.offset(t.end)}}function so(e,t,n){if(e.issues.some(e=>e.source!==`semantic`))return[];let{text:r}=e,i=/\r\n|[\r\n]/.exec(r)?.[0]??`
35
+ `,a=Math.min(16,Math.max(1,t.tabSize||1)),o=t.insertSpaces?` `.repeat(a):` `,s=[],c=n&&oo(e,n);function l(t,n,a){if(c&&(t<c.from||n>c.to||t===n&&(t===c.from||n===c.to)))return;let l=r.slice(t,n);if(li(l))return;let u=i+o.repeat(a);if(l===u)return;let d=0,f=0;for(;d<l.length&&l[d]===u[d];)d++;for(;f<Math.min(l.length,u.length)-d&&l[l.length-f-1]===u[u.length-f-1];)f++;d>0&&l.slice(d-1,d+1)===`\r
36
+ `&&d--,f>0&&l.slice(l.length-f-1,l.length-f+1)===`\r
37
+ `&&f--,s.push(H.replace(e.range({from:t+d,to:n-f}),u.slice(d,u.length-f)))}function u(e,t){let n=Ya(e),r=n&&Ka(n.type);if(!r||r.mixed||r.text||e.preserveSpace||!e.close?.complete)return;let i=[...e.children.map(e=>e.span),...e.content.filter(e=>e.kind!==`Text`).map(e=>e.span)].sort((e,t)=>e.from-t.from);if(i.length){let n=e.open.to;for(let e of i)l(n,e.from,t+1),n=e.to;l(n,e.close.span.from,t)}for(let n of e.children)u(n,t+1)}for(let t of e.analysis.roots)u(t,0);return s.sort((t,n)=>e.offset(t.range.start)-e.offset(n.range.start))}function co(e){function t(n){if(!n.name.name)return[];let r=n.attributes.find(e=>e.name.name===`name`)?.decoded,{name:i}=n.name;return[{name:r?`${i} · ${r}`:i,kind:Me.Object,range:e.range(n.span),selectionRange:e.range(n.name),children:n.children.flatMap(t)}]}return e.analysis.roots.flatMap(t)}function lo(e,t){let n=[];function r(r,i){let a=e.position(r.from),o=e.position(r.to),s=t&&!i?o.line-1:o.line;s<=a.line||n.push({startLine:a.line,endLine:s,...!t&&{startCharacter:a.character,endCharacter:o.character},...i&&{kind:i}})}for(let t of e.elements){t.close?.complete&&r({from:t.open.to,to:t.close.span.from});for(let e of t.content)e.kind===`Comment`&&r(e.span,`comment`)}return n.sort((e,t)=>e.startLine-t.startLine||t.endLine-e.endLine)}function uo(e,t){let n=e.offset(t),r=e.elementAt(n,!0),i=r?.close;return!r?.name.name||!i?.complete?null:ao(r.name,{from:n,to:n})||ao(i.name,{from:n,to:n})?{ranges:[e.range(r.name),e.range(i.name)]}:null}function fo(e){if(/^https?:\/\//i.test(e)&&!/[\u0000-\u0020]/.test(e))try{let t=new URL(e);if(!t.username&&!t.password)return t.href}catch{return}}function po(e){let t=[];for(let n of e.elements){if(!Ya(n))continue;for(let r of n.attributes){if(![`href`,`src`].includes(r.name.name)||!r.closed||!r.value)continue;let n=fo(r.decoded??``);n&&t.push({target:n,range:e.range(r.value)})}if(![`url`,`imgUrl`,`cover`].includes(n.name.name)||!n.close?.complete)continue;let r={from:n.open.to,to:n.close.span.from},i=e.text.slice(r.from,r.to),a=i.trim(),o=fo(fi(a));if(o&&!/[<>]/.test(a)){let n=r.from+i.indexOf(a);t.push({target:o,range:e.range({from:n,to:n+a.length})})}}return t}function mo(e,t,n){let r=oo(e,t),i=[];for(let t of e.issues){if(!t.fix||!ao(r,t.span))continue;let a=io(e,t);if(!n.find(n=>n.source===a.source&&n.code===a.code&&oo(e,n.range).from===t.span.from&&oo(e,n.range).to===t.span.to))continue;let o={title:t.fix.title,kind:Le.QuickFix,diagnostics:[a],edit:{documentChanges:[{textDocument:{uri:e.uri,version:e.version},edits:[H.replace(e.range(t.fix.span),t.fix.text)]}]}};i.push(o)}return i}dt();function ho(e,t){return e.from<=t&&t<=e.to}function go(e,t,n){if(!e)return Ha.roots;let r=Ya(e);if(!r)return[];let i=Ja(r.type),a=i.start,o=[];for(let r of e.children)if(r!==t&&r.name.name&&!r.namespace){if(r.span.from>=n){if(o.push(r.name.name),o.length>128)break}else if(r.span.to<=n){let e=i.advance(a,r.name.name);e.length&&(a=e)}}let s=i.candidates(a);if(o.length&&o.length<=128){let e=s.filter(e=>{let t=i.advance(a,e.name);for(let e of o)if(t=i.advance(t,e),!t.length)return!1;return!0});if(e.length)return e;let t=a;for(let e of o)t=i.advance(t,e);if(t.length&&i.accepts(t))return[]}return s}function _o(e,t,n,r,i,a,o){return{label:n,kind:i,textEdit:H.replace(e.range(t),r),...a&&{documentation:a},...o&&{insertTextFormat:ye.Snippet}}}function vo(e){return e.fixed??e.default??``}function yo(e,t){return e.replaceAll(`&`,`&amp;`).replaceAll(`<`,`&lt;`).replaceAll(t,t===`"`?`&quot;`:`&apos;`)}const bo=e=>e.replace(/[\\$}]/g,`\\$&`);function xo(e,t,n){let r=e.offset(t),{text:i}=e,a=[],o={isIncomplete:!1,items:a};if(e.analysis.limited||e.opaqueAt(r))return o;let s=e.elementAt(r,!0),c=/<\/([\w.:-]*)$/.exec(i.slice(Math.max(0,r-256),r)),l=s?.close;if(c&&!(s&&r<s.open.to)&&!s?.selfClosing){let t=r-c[1].length,n=t;for(;n<i.length&&/[\w.:-]/.test(i[n]);)n++;let u=i.slice(n,n+256),d=/* @__PURE__ */ new Set;for(let r=s;r;r=r.parent){let i=r.name.name;if(!(!i||d.has(i)||r.close&&r.close.span.from<t-2)&&(d.add(i),a.push(_o(e,{from:t,to:n},i,i+(/^[\t\r\n ]*>/.test(u)?``:`>`),ve.Property)),l?.span.from===t-2&&l.complete))break}return o}let u=s&&ho(s.open,r)&&(!s.complete||r<s.open.to);if(u&&s&&(ho(s.name,r)||!s.name.name)){let t=s.attributes.length>0;for(let r of go(s.parent,s,s.span.from)){let i=Ka(r.type)?.attributes.filter(e=>e.required)??[],o=n.snippets&&!s.complete&&!t&&i.length>0,c=o?r.name+i.map((e,t)=>` `+e.name+'="${'+(t+1)+`:`+bo(yo(vo(e),`"`))+`}"`).join(``):r.name;a.push(_o(e,s.name,r.name,c,ve.Property,r.documentation,o))}return o}if(u&&s){let t=Ya(s),i=t&&Ka(t.type);if(!i)return o;let c=s.attributes.find(e=>ho(e.span,r));if(c?.equals!==void 0&&r>=c.equals){if(c.closed&&c.value&&r>c.value.to)return o;let t=i.attributes.find(e=>e.name===c.name.name);if(!t)return o;let n=c.value??{from:r,to:r};for(let r of Qa(t)){let i=yo(r,c.quote??`"`),o=c.quote?i+(c.closed?``:c.quote):`"`+i+`"`;a.push(_o(e,n,r||`""`,o,ve.Value,t.documentation))}return o}let l=c&&ho(c.name,r)?c.name:{from:r,to:r};if(c&&l!==c.name)return o;for(let t of i.attributes){if(s.attributes.some(e=>e!==c&&e.name.name===t.name))continue;let r=yo(vo(t),`"`),i=!!n.snippets&&c?.equals===void 0,o=c?.equals===void 0?i?t.name+'="${1:'+bo(r)+`}"`:t.name+`="`+r+`"`:t.name;a.push(_o(e,l,t.name,o,ve.Field,t.documentation,i))}return o}if(s?.close&&ho(s.close.span,r))return o;let d=s?.span.to===r&&(s.selfClosing||s.close?.complete)?s.parent:s;if(!d&&e.analysis.roots.some(e=>e.complete))return o;for(let t of go(d,void 0,r))a.push(_o(e,{from:r,to:r},t.name,`<`+t.name,ve.Property,t.documentation));return o}function So(e,t,n){let r=e.offset(t),i=e.elementAt(r,!0);if(!i)return null;let a=Ya(i);if(!a)return null;let o=Ka(a.type),s=i.attributes.find(e=>ho(e.name,r)||e.value&&ho(e.value,r)),c=n.markdown!==!1,l=e=>c?"`"+e+"`":e,u=e=>l(e.startsWith(`#`)?`anonymous type`:e);if(s){let t=o?.attributes.find(e=>e.name===s.name.name);if(!t)return null;let n=qa(t.type),i=[l(t.name)+` · `+u(t.type)+(t.required?` · Required`:``),t.documentation??n.documentation,n.values&&`Allowed values: `+n.values.map(e=>l(JSON.stringify(e))).join(`, `),t.default!==void 0&&`Default: `+l(JSON.stringify(t.default)),t.fixed!==void 0&&`Fixed: `+l(JSON.stringify(t.fixed)),n.minLength!==void 0&&`Minimum length: `+n.minLength];return{range:e.range(s.value&&ho(s.value,r)?s.value:s.name),contents:{kind:c?ge.Markdown:ge.PlainText,value:i.filter(Boolean).join(`
38
+
39
+ `)}}}let d=i.close&&ho(i.close.name,r)?i.close.name:i.name;if(!ho(d,r))return null;let f=[...Ja(a.type).members.keys()],p=o?.attributes.filter(e=>e.required).map(e=>e.name)??[],m=[l(`<`+a.name+`>`)+` · `+u(a.type),a.documentation??o?.documentation??(i.parent?void 0:Ha.documentation),p.length&&`Required attributes: `+p.map(l).join(`, `),f.length&&`Children: `+f.map(e=>l(`<`+e+`>`)).join(`, `),o?.mixed&&`Supports mixed text and child elements.`,`SKLand Wiki XML schema `+Ha.version];return{range:e.range(d),contents:{kind:c?ge.Markdown:ge.PlainText,value:m.filter(Boolean).join(`
40
+
41
+ `)}}}Object.freeze({version:Ha.version,hash:Ha.hash,source:Ha.source});function Co(){let e=/* @__PURE__ */ new Map;return{openDocument(t){return!e.has(t.uri)&&(e.set(t.uri,new ro(t)),!0)},updateDocument:(t,n,r)=>e.get(t)?.update(n,r)??!1,closeDocument:t=>e.delete(t),getVersion:t=>e.get(t)?.version,diagnostics(t){let n=e.get(t);return n?n.issues.map(e=>io(n,e)):[]},completion(t,n,r={}){let i=e.get(t);return i?xo(i,n,r):{isIncomplete:!1,items:[]}},hover(t,n,r={}){let i=e.get(t);return i?So(i,n,r):null},formatting(t,n,r){let i=e.get(t);return i?so(i,n,r):[]},documentSymbols(t){let n=e.get(t);return n?co(n):[]},foldingRanges(t,n=!1){let r=e.get(t);return r?lo(r,n):[]},linkedEditing(t,n){let r=e.get(t);return r?uo(r,n):null},documentLinks(t){let n=e.get(t);return n?po(n):[]},codeActions(t,n,r){let i=e.get(t);return i?mo(i,n,r):[]},dispose:()=>e.clear()}}var wo=S();function To(e,t,n){return e.flatMap(e=>[{name:e.name,kind:e.kind,location:{uri:t,range:e.range},...n&&{containerName:n}},...To(e.children??[],t,e.name)])}function Eo(e,t={}){let n=Co(),r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Map,a=`created`,o=()=>a===`stopped`,s={snippets:!1,hoverMarkdown:!1,relatedDiagnostics:!1,diagnosticVersions:!1,hierarchicalSymbols:!1,lineOnlyFolding:!1,codeActions:!1,versionedEdits:!1},c=()=>{a=`stopped`;for(let e of r.values())clearTimeout(e);r.clear(),n.dispose(),i.clear()};function l(e){let t=r.get(e);t!==void 0&&clearTimeout(t),r.delete(e)}function u(t,n,r){e.sendDiagnostics({uri:t,diagnostics:s.relatedDiagnostics?r:r.map(e=>{let t={...e};return delete t.relatedInformation,t}),...s.diagnosticVersions&&n!==void 0&&{version:n}}).catch(()=>void 0)}function d(i,o){l(i),r.set(i,setTimeout(()=>{if(r.delete(i),a===`running`&&n.getVersion(i)===o)try{u(i,o,n.diagnostics(i))}catch{e.console.error(`SKLand XML diagnostics failed unexpectedly.`)}},t.diagnosticDelayMs??200))}async function f(e,t,r){if(a===`created`||a===`initializing`)throw new wo.ResponseError(-32002,`Server not initialized`);if(a===`stopped`)throw new wo.ResponseError(wo.ErrorCodes.InvalidRequest,`Server has shut down`);let s=n.getVersion(e),c=i.get(e);if(await new Promise(e=>setTimeout(e,0)),t.isCancellationRequested)throw new wo.ResponseError(-32800,`Request cancelled`);if(o())throw new wo.ResponseError(wo.ErrorCodes.InvalidRequest,`Server has shut down`);if(s!==n.getVersion(e)||c!==i.get(e))throw new wo.ResponseError(-32801,`Document changed`);try{return r()}catch{throw new wo.ResponseError(wo.ErrorCodes.InternalError,`SKLand XML analysis failed`)}}return e.onInitialize(({capabilities:e})=>{if(a!==`created`)throw new wo.ResponseError(wo.ErrorCodes.InvalidRequest,`Already initialized`);a=`initializing`;let t=e.textDocument;return s={snippets:!!t?.completion?.completionItem?.snippetSupport,hoverMarkdown:t?.hover?.contentFormat?.[0]===`markdown`,relatedDiagnostics:!!t?.publishDiagnostics?.relatedInformation,diagnosticVersions:!!t?.publishDiagnostics?.versionSupport,hierarchicalSymbols:!!t?.documentSymbol?.hierarchicalDocumentSymbolSupport,lineOnlyFolding:!!t?.foldingRange?.lineFoldingOnly,codeActions:!!t?.codeAction?.codeActionLiteralSupport,versionedEdits:!!e.workspace?.workspaceEdit?.documentChanges},{serverInfo:{name:`SKLand XML Language Server`,version:`0.1.0`},capabilities:{positionEncoding:`utf-16`,textDocumentSync:{openClose:!0,change:2},completionProvider:{triggerCharacters:[`<`,`/`,` `,`=`,`"`,`'`]},hoverProvider:!0,documentSymbolProvider:!0,documentFormattingProvider:!0,documentRangeFormattingProvider:!0,foldingRangeProvider:!0,linkedEditingRangeProvider:!0,documentLinkProvider:{resolveProvider:!1},...s.codeActions&&{codeActionProvider:{codeActionKinds:[`quickfix`]}}}}}),e.onInitialized(()=>{a===`initializing`&&(a=`running`)}),e.onDidOpenTextDocument(({textDocument:e})=>{if(a!==`running`)return;let{uri:t,version:r}=e;n.openDocument(e)&&(i.set(t,{}),d(t,r))}),e.onDidChangeTextDocument(({textDocument:{uri:e,version:t},contentChanges:r})=>{a===`running`&&n.updateDocument(e,t,r)&&d(e,t)}),e.onDidCloseTextDocument(({textDocument:{uri:e}})=>{if(a!==`running`)return;let t=n.closeDocument(e);i.delete(e),l(e),t&&u(e,void 0,[])}),e.onCompletion(({textDocument:{uri:e},position:t},r)=>f(e,r,()=>n.completion(e,t,{snippets:s.snippets}))),e.onHover(({textDocument:{uri:e},position:t},r)=>f(e,r,()=>n.hover(e,t,{markdown:s.hoverMarkdown}))),e.onDocumentFormatting(({textDocument:{uri:e},options:t},r)=>f(e,r,()=>n.formatting(e,t))),e.onDocumentRangeFormatting(({textDocument:{uri:e},range:t,options:r},i)=>f(e,i,()=>n.formatting(e,r,t))),e.onDocumentSymbol(({textDocument:{uri:e}},t)=>f(e,t,()=>{let t=n.documentSymbols(e);return s.hierarchicalSymbols?t:To(t,e)})),e.onFoldingRanges(({textDocument:{uri:e}},t)=>f(e,t,()=>n.foldingRanges(e,s.lineOnlyFolding))),e.onDocumentLinks(({textDocument:{uri:e}},t)=>f(e,t,()=>n.documentLinks(e))),e.onRequest(`textDocument/linkedEditingRange`,({textDocument:{uri:e},position:t},r)=>f(e,r,()=>n.linkedEditing(e,t))),e.onCodeAction(({textDocument:{uri:e},range:t,context:r},i)=>f(e,i,()=>{if(!s.codeActions||r.only&&!r.only.includes(`quickfix`))return[];let i=n.codeActions(e,t,r.diagnostics);return s.versionedEdits?i:i.map(t=>{let n=t.edit?.documentChanges?.[0];return n&&`edits`in n?{...t,edit:{changes:{[e]:n.edits}}}:t})})),e.onShutdown(c),e.onExit(()=>{c(),t.onExit?.()}),{dispose:c}}function Do(e,t={}){let n=(0,sn.createConnection)(new sn.BrowserMessageReader(e),new sn.BrowserMessageWriter(e)),r=Eo(n,{...t,onExit:()=>{t.onExit?.(),e.close()}});return n.listen(),{dispose(){r.dispose(),n.dispose()}}}Do(self);