@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,28 @@
1
+ import{ErrorCodes as e,ResponseError as t}from"vscode-jsonrpc/lib/common/api.js";var n=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports);const r=1024;let i=0;var a=class{constructor(e,t){this.from=e,this.to=t}},o=class{constructor(e={}){this.id=i++,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=l.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};o.closedBy=new o({deserialize:e=>e.split(` `)}),o.openedBy=new o({deserialize:e=>e.split(` `)}),o.group=new o({deserialize:e=>e.split(` `)}),o.isolate=new o({deserialize:e=>{if(e&&e!=`rtl`&&e!=`ltr`&&e!=`auto`)throw RangeError(`Invalid value for isolate: `+e);return e||`auto`}}),o.contextHash=new o({perNode:!0}),o.lookAhead=new o({perNode:!0}),o.mounted=new o({perNode:!0});var s=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[o.mounted.id]}};const c=Object.create(null);var l=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):c,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(o.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(o.group),r=-1;r<(n?n.length:0);r++){let i=t[r<0?e.name:n[r]];if(i)return i}}}};l.none=new l(``,Object.create(null),0,8);var u=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 l(e.name,r,e.id,e.flags):e)}return new e(n)}};const d=/* @__PURE__ */ new WeakMap,f=/* @__PURE__ */ new WeakMap;var p;(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`})(p||={});var m=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=s.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 O(this.topNode,e)}cursorAt(e,t=0,n=0){let r=new O(d.get(this)||this.topNode);return r.moveTo(e,t),d.set(this,r._tree),r}get topNode(){return new b(this,0,0,null)}resolve(e,t=0){let n=v(d.get(this)||this.topNode,e,t,!1);return d.set(this,n),n}resolveInner(e,t=0){let n=v(f.get(this)||this.topNode,e,t,!0);return f.set(this,n),n}resolveStack(e,t=0){return D(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:i=this.length}=e,a=e.mode||0,o=(a&p.IncludeAnonymous)>0;for(let e=this.cursor(a|p.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:ne(l.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(l.none,t,n,r)))}static build(e){return k(e)}};m.empty=new m(l.none,[],[],0);var h=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)}},g=class e{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return l.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&&!(_(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 _(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 v(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 b&&e.index<0?null:e.parent;if(!t)return e;e=t}let i=r?0:p.IgnoreOverlays;if(r)for(let r=e,a=r.parent;a;r=a,a=r.parent)r instanceof b&&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 y=class{cursor(e=0){return new O(this,e)}getChild(e,t=null,n=null){let r=x(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return x(this,e,t,n)}resolve(e,t=0){return v(this,e,t,!1)}resolveInner(e,t=0){return v(this,e,t,!0)}matchContext(e){return S(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}},b=class e extends y{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:c,positions:l}=o._tree,u=n>0?c.length:-1;t!=u;t+=n){let u=c[t],d=l[t]+o.from;if(a&p.EnterBracketed&&u instanceof m&&s.get(u)?.overlay===null&&(d>=r||d+u.length<=r)||_(i,r,d,d+u.length)){if(u instanceof g){if(a&p.ExcludeBuffers)continue;let e=u.findChild(0,u.buffer.length,n,r-d,i);if(e>-1)return new w(new C(o,u,t,d),null,e)}else if(a&p.IncludeAnonymous||!u.type.isAnonymous||ee(u)){let c;if(!(a&p.IgnoreMounts)&&(c=s.get(u))&&!c.overlay)return new e(c.tree,d,t,o);let l=new e(u,d,t,o);return a&p.IncludeAnonymous||!l.type.isAnonymous?l:l.nextChild(n<0?u.children.length-1:0,n,r,i,a)}}}if(a&p.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&p.IgnoreOverlays)&&(i=s.get(this._tree))&&i.overlay){let a=t-this.from,o=r&p.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 x(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 S(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 C=class{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}},w=class e extends y{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&p.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 m(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function T(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 b&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new E(i,n)}var E=class{constructor(e,t){this.heads=e,this.node=t}get next(){return T(this.heads)}};function D(e,t,n){let r=e.resolveInner(t,n),i=null;for(let e=r instanceof b?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=s.get(e.tree);if(a&&a.overlay&&a.overlay[0].from<=t&&a.overlay[a.overlay.length-1].to>=t){let o=new b(a.tree,a.overlay[0].from+e.from,-1,e);(i||=[r]).push(v(o,t,n,!1))}}return i?T(i):r}var O=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&~p.EnterBracketed,e instanceof b)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 b?(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&p.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&p.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&p.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&p.IncludeAnonymous||e instanceof g||!e.type.isAnonymous||ee(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 w(this.buffer,t,this.stack[e]);return this.bufferNode=new w(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 S(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 S(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 ee(e){return e.children.some(e=>e instanceof g||!e.type.isAnonymous||ee(e))}function k(e){let{buffer:t,nodeSet:n,maxBufferLength:i=r,reused:a=[],minRepeatType:s=n.types.length}=e,c=Array.isArray(t)?new h(t,t.length):t,l=n.types,u=0,d=0;function f(e,t,r,o,m,h){let{id:S,start:C,end:w,size:T}=c,E=d,D=u;if(T<0){if(c.next(),T==-1){let t=a[S];r.push(t),o.push(C-e);return}if(T==-3){u=S;return}if(T==-4){d=S;return}throw RangeError(`Unrecognized record size: ${T}`)}let O=l[S],ee,k,A=C-e;if(w-C<=i&&(k=b(c.pos-t,m))){let t=new Uint16Array(k.size-k.skip),r=c.pos-k.size,i=t.length;for(;c.pos>r;)i=x(k.start,t,i);ee=new g(t,w-k.start,n),A=k.start-e}else{let e=c.pos-T;c.next();let t=[],n=[],r=S>=s?S:-1,a=0,o=w;for(;c.pos>e;)r>=0&&c.id==r&&c.size>=0?(c.end<=o-i&&(v(t,n,C,a,c.end,o,r,E,D),a=t.length,o=c.end),c.next()):h>2500?p(C,e,t,n):f(C,e,t,n,r,h+1);if(r>=0&&a>0&&a<t.length&&v(t,n,C,a,C,o,r,E,D),t.reverse(),n.reverse(),r>-1&&a>0){let e=_(O,D);ee=ne(O,t,n,0,t.length,0,w-C,e,e)}else ee=y(O,t,n,w-C,E-w,D)}r.push(ee),o.push(A)}function p(e,t,r,a){let o=[],s=0,l=-1;for(;c.pos>t;){let{id:e,start:t,end:n,size:r}=c;if(r>4)c.next();else if(l>-1&&t<l)break;else l<0&&(l=n-i),o.push(e,t,n),s++,c.next()}if(s){let t=new Uint16Array(s*4),i=o[o.length-2];for(let e=o.length-3,n=0;e>=0;e-=3)t[n++]=o[e],t[n++]=o[e+1]-i,t[n++]=o[e+2]-i,t[n++]=n;r.push(new g(t,o[2]-i,n)),a.push(i-e)}}function _(e,t){return(n,r,i)=>{let a=0,s=n.length-1,c,l;if(s>=0&&(c=n[s])instanceof m){if(!s&&c.type==e&&c.length==i)return c;(l=c.prop(o.lookAhead))&&(a=r[s]+c.length+l)}return y(e,n,r,i,a,t)}}function v(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(y(n.types[s],u,d,o-a,c-o,l)),t.push(a-r)}function y(e,t,n,r,i,a,s){if(a){let e=[o.contextHash,a];s=s?[e].concat(s):[e]}if(i>25){let e=[o.lookAhead,i];s=s?[e].concat(s):[e]}return new m(e,t,n,r,s)}function b(e,t){let n=c.fork(),r=0,a=0,o=0,l=n.end-i,u={size:0,start:0,skip:0};e:for(let i=n.pos-e;n.pos>i;){let e=n.size;if(n.id==t&&e>=0){u.size=r,u.start=a,u.skip=o,o+=4,r+=4,n.next();continue}let c=n.pos-e;if(e<0||c<i||n.start<l)break;let d=n.id>=s?4:0,f=n.start;for(n.next();n.pos>c;){if(n.size<0){if(n.size==-3||n.size==-4)d+=4;else break e}else n.id>=s&&(d+=4);n.next()}a=f,r+=e,o+=d}return(t<0||r==e)&&(u.size=r,u.start=a,u.skip=o),u.size>4?u:void 0}function x(e,t,n){let{id:r,start:i,end:a,size:o}=c;if(c.next(),o>=0&&r<s){let s=n;if(o>4){let r=c.pos-(o-4);for(;c.pos>r;)n=x(e,t,n)}t[--n]=s,t[--n]=a-e,t[--n]=i-e,t[--n]=r}else o==-3?u=r:o==-4&&(d=r);return n}let S=[],C=[];for(;c.pos>0;)f(e.start||0,e.bufferStart||0,S,C,-1,0);let w=e.length??(S.length?C[0]+S[0].length:0);return new m(l[e.topID],S.reverse(),C.reverse(),w)}const A=/* @__PURE__ */ new WeakMap;function te(e,t){if(!e.isAnonymous||t instanceof g||t.type!=e)return 1;let n=A.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof m)){n=1;break}n+=te(e,r)}A.set(t,n)}return n}function ne(e,t,n,r,i,a,o,s,c){let l=0;for(let n=r;n<i;n++)l+=te(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=te(e,t[s]);for(s++;s<i;s++){let n=te(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(ne(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 j=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}},M=class{startParse(e,t,n){return typeof e==`string`&&(e=new N(e)),n=n?n.length?n.map(e=>new a(e.from,e.to)):[new a(0,0)]:[new a(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}}},N=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 o({perNode:!0});var re=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=L(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=ie(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=ie(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&&I(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}},P;(function(e){e.create=function(e,t,n,r){return new re(e,t,n,r)},e.update=function(e,t,n){if(e instanceof re)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=F(t.map(R),(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(``)}})(P||={});function F(e,t){if(e.length<=1)return e;let n=e.length/2|0,r=e.slice(0,n),i=e.slice(n);F(r,t),F(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 ie(e,t,n=0){let r=t?[n]:[];for(let t=0;t<e.length;t++){let i=e.charCodeAt(t);I(i)&&(i===13&&t+1<e.length&&e.charCodeAt(t+1)===10&&t++,r.push(n+t+1))}return r}function I(e){return e===13||e===10}function L(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 R(e){let t=L(e.range);return t===e.range?e:{newText:e.newText,range:t}}var ae;(function(e){e.is=function(e){return typeof e==`string`}})(ae||={});var z;(function(e){e.is=function(e){return typeof e==`string`}})(z||={});var oe;(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}})(oe||={});var se;(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}})(se||={});var B;(function(e){e.create=function(e,t){return e===Number.MAX_VALUE&&(e=se.MAX_VALUE),t===Number.MAX_VALUE&&(t=se.MAX_VALUE),{line:e,character:t}},e.is=function(e){let t=e;return G.objectLiteral(t)&&G.uinteger(t.line)&&G.uinteger(t.character)}})(B||={});var V;(function(e){e.create=function(e,t,n,r){if(G.uinteger(e)&&G.uinteger(t)&&G.uinteger(n)&&G.uinteger(r))return{start:B.create(e,t),end:B.create(n,r)};if(B.is(e)&&B.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 G.objectLiteral(t)&&B.is(t.start)&&B.is(t.end)}})(V||={});var ce;(function(e){e.create=function(e,t){return{uri:e,range:t}},e.is=function(e){let t=e;return G.objectLiteral(t)&&V.is(t.range)&&(G.string(t.uri)||G.undefined(t.uri))}})(ce||={});var le;(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 G.objectLiteral(t)&&V.is(t.targetRange)&&G.string(t.targetUri)&&V.is(t.targetSelectionRange)&&(V.is(t.originSelectionRange)||G.undefined(t.originSelectionRange))}})(le||={});var ue;(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 G.objectLiteral(t)&&G.numberRange(t.red,0,1)&&G.numberRange(t.green,0,1)&&G.numberRange(t.blue,0,1)&&G.numberRange(t.alpha,0,1)}})(ue||={});var H;(function(e){e.create=function(e,t){return{range:e,color:t}},e.is=function(e){let t=e;return G.objectLiteral(t)&&V.is(t.range)&&ue.is(t.color)}})(H||={});var de;(function(e){e.create=function(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}},e.is=function(e){let t=e;return G.objectLiteral(t)&&G.string(t.label)&&(G.undefined(t.textEdit)||ye.is(t))&&(G.undefined(t.additionalTextEdits)||G.typedArray(t.additionalTextEdits,ye.is))}})(de||={});var fe;(function(e){e.Comment=`comment`,e.Imports=`imports`,e.Region=`region`})(fe||={});var U;(function(e){e.create=function(e,t,n,r,i,a){let o={startLine:e,endLine:t};return G.defined(n)&&(o.startCharacter=n),G.defined(r)&&(o.endCharacter=r),G.defined(i)&&(o.kind=i),G.defined(a)&&(o.collapsedText=a),o},e.is=function(e){let t=e;return G.objectLiteral(t)&&G.uinteger(t.startLine)&&G.uinteger(t.startLine)&&(G.undefined(t.startCharacter)||G.uinteger(t.startCharacter))&&(G.undefined(t.endCharacter)||G.uinteger(t.endCharacter))&&(G.undefined(t.kind)||G.string(t.kind))}})(U||={});var pe;(function(e){e.create=function(e,t){return{location:e,message:t}},e.is=function(e){let t=e;return G.defined(t)&&ce.is(t.location)&&G.string(t.message)}})(pe||={});var me;(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(me||={});var he;(function(e){e.Unnecessary=1,e.Deprecated=2})(he||={});var ge;(function(e){e.is=function(e){let t=e;return G.objectLiteral(t)&&G.string(t.href)}})(ge||={});var _e;(function(e){e.create=function(e,t,n,r,i,a){let o={range:e,message:t};return G.defined(n)&&(o.severity=n),G.defined(r)&&(o.code=r),G.defined(i)&&(o.source=i),G.defined(a)&&(o.relatedInformation=a),o},e.is=function(e){let t=e;return G.defined(t)&&V.is(t.range)&&G.string(t.message)&&(G.number(t.severity)||G.undefined(t.severity))&&(G.integer(t.code)||G.string(t.code)||G.undefined(t.code))&&(G.undefined(t.codeDescription)||G.string(t.codeDescription?.href))&&(G.string(t.source)||G.undefined(t.source))&&(G.undefined(t.relatedInformation)||G.typedArray(t.relatedInformation,pe.is))}})(_e||={});var ve;(function(e){e.create=function(e,t,...n){let r={title:e,command:t};return G.defined(n)&&n.length>0&&(r.arguments=n),r},e.is=function(e){let t=e;return G.defined(t)&&G.string(t.title)&&G.string(t.command)}})(ve||={});var ye;(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 G.objectLiteral(t)&&G.string(t.newText)&&V.is(t.range)}})(ye||={});var be;(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 G.objectLiteral(t)&&G.string(t.label)&&(G.boolean(t.needsConfirmation)||t.needsConfirmation===void 0)&&(G.string(t.description)||t.description===void 0)}})(be||={});var W;(function(e){e.is=function(e){let t=e;return G.string(t)}})(W||={});var xe;(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 ye.is(t)&&(be.is(t.annotationId)||W.is(t.annotationId))}})(xe||={});var Se;(function(e){e.create=function(e,t){return{textDocument:e,edits:t}},e.is=function(e){let t=e;return G.defined(t)&&ke.is(t.textDocument)&&Array.isArray(t.edits)}})(Se||={});var Ce;(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`&&G.string(t.uri)&&(t.options===void 0||(t.options.overwrite===void 0||G.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||G.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||W.is(t.annotationId))}})(Ce||={});var we;(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`&&G.string(t.oldUri)&&G.string(t.newUri)&&(t.options===void 0||(t.options.overwrite===void 0||G.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||G.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||W.is(t.annotationId))}})(we||={});var Te;(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`&&G.string(t.uri)&&(t.options===void 0||(t.options.recursive===void 0||G.boolean(t.options.recursive))&&(t.options.ignoreIfNotExists===void 0||G.boolean(t.options.ignoreIfNotExists)))&&(t.annotationId===void 0||W.is(t.annotationId))}})(Te||={});var Ee;(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=>G.string(e.kind)?Ce.is(e)||we.is(e)||Te.is(e):Se.is(e)))}})(Ee||={});var De;(function(e){e.create=function(e){return{uri:e}},e.is=function(e){let t=e;return G.defined(t)&&G.string(t.uri)}})(De||={});var Oe;(function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){let t=e;return G.defined(t)&&G.string(t.uri)&&G.integer(t.version)}})(Oe||={});var ke;(function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){let t=e;return G.defined(t)&&G.string(t.uri)&&(t.version===null||G.integer(t.version))}})(ke||={});var Ae;(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 G.defined(t)&&G.string(t.uri)&&G.string(t.languageId)&&G.integer(t.version)&&G.string(t.text)}})(Ae||={});var je;(function(e){e.PlainText=`plaintext`,e.Markdown=`markdown`,e.is=function(t){let n=t;return n===e.PlainText||n===e.Markdown}})(je||={});var Me;(function(e){e.is=function(e){let t=e;return G.objectLiteral(e)&&je.is(t.kind)&&G.string(t.value)}})(Me||={});var Ne;(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})(Ne||={});var Pe;(function(e){e.PlainText=1,e.Snippet=2})(Pe||={});var Fe;(function(e){e.Deprecated=1})(Fe||={});var Ie;(function(e){e.create=function(e,t,n){return{newText:e,insert:t,replace:n}},e.is=function(e){let t=e;return t&&G.string(t.newText)&&V.is(t.insert)&&V.is(t.replace)}})(Ie||={});var Le;(function(e){e.asIs=1,e.adjustIndentation=2})(Le||={});var Re;(function(e){e.is=function(e){let t=e;return t&&(G.string(t.detail)||t.detail===void 0)&&(G.string(t.description)||t.description===void 0)}})(Re||={});var ze;(function(e){e.create=function(e){return{label:e}}})(ze||={});var Be;(function(e){e.create=function(e,t){return{items:e||[],isIncomplete:!!t}}})(Be||={});var Ve;(function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,`\\$&`)},e.is=function(e){let t=e;return G.string(t)||G.objectLiteral(t)&&G.string(t.language)&&G.string(t.value)}})(Ve||={});var He;(function(e){e.is=function(e){let t=e;return!!t&&G.objectLiteral(t)&&(Me.is(t.contents)||Ve.is(t.contents)||G.typedArray(t.contents,Ve.is))&&(e.range===void 0||V.is(e.range))}})(He||={});var Ue;(function(e){e.create=function(e,t){return t?{label:e,documentation:t}:{label:e}}})(Ue||={});var We;(function(e){e.create=function(e,t,...n){let r={label:e};return G.defined(t)&&(r.documentation=t),r.parameters=G.defined(n)?n:[],r}})(We||={});var Ge;(function(e){e.Text=1,e.Read=2,e.Write=3})(Ge||={});var Ke;(function(e){e.create=function(e,t){let n={range:e};return G.number(t)&&(n.kind=t),n}})(Ke||={});var qe;(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})(qe||={});var Je;(function(e){e.Deprecated=1})(Je||={});var Ye;(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}})(Ye||={});var Xe;(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}}}})(Xe||={});var Ze;(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&&G.string(t.name)&&G.number(t.kind)&&V.is(t.range)&&V.is(t.selectionRange)&&(t.detail===void 0||G.string(t.detail))&&(t.deprecated===void 0||G.boolean(t.deprecated))&&(t.children===void 0||Array.isArray(t.children))&&(t.tags===void 0||Array.isArray(t.tags))}})(Ze||={});var Qe;(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`})(Qe||={});var $e;(function(e){e.Invoked=1,e.Automatic=2})($e||={});var et;(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 G.defined(t)&&G.typedArray(t.diagnostics,_e.is)&&(t.only===void 0||G.typedArray(t.only,G.string))&&(t.triggerKind===void 0||t.triggerKind===$e.Invoked||t.triggerKind===$e.Automatic)}})(et||={});var tt;(function(e){e.create=function(e,t,n){let r={title:e},i=!0;return typeof t==`string`?(i=!1,r.kind=t):ve.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&&G.string(t.title)&&(t.diagnostics===void 0||G.typedArray(t.diagnostics,_e.is))&&(t.kind===void 0||G.string(t.kind))&&(t.edit!==void 0||t.command!==void 0)&&(t.command===void 0||ve.is(t.command))&&(t.isPreferred===void 0||G.boolean(t.isPreferred))&&(t.edit===void 0||Ee.is(t.edit))}})(tt||={});var nt;(function(e){e.create=function(e,t){let n={range:e};return G.defined(t)&&(n.data=t),n},e.is=function(e){let t=e;return G.defined(t)&&V.is(t.range)&&(G.undefined(t.command)||ve.is(t.command))}})(nt||={});var rt;(function(e){e.create=function(e,t){return{tabSize:e,insertSpaces:t}},e.is=function(e){let t=e;return G.defined(t)&&G.uinteger(t.tabSize)&&G.boolean(t.insertSpaces)}})(rt||={});var it;(function(e){e.create=function(e,t,n){return{range:e,target:t,data:n}},e.is=function(e){let t=e;return G.defined(t)&&V.is(t.range)&&(G.undefined(t.target)||G.string(t.target))}})(it||={});var at;(function(e){e.create=function(e,t){return{range:e,parent:t}},e.is=function(t){let n=t;return G.objectLiteral(n)&&V.is(n.range)&&(n.parent===void 0||e.is(n.parent))}})(at||={});var ot;(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`})(ot||={});var st;(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`})(st||={});var ct;(function(e){e.is=function(e){let t=e;return G.objectLiteral(t)&&(t.resultId===void 0||typeof t.resultId==`string`)&&Array.isArray(t.data)&&(t.data.length===0||typeof t.data[0]==`number`)}})(ct||={});var lt;(function(e){e.create=function(e,t){return{range:e,text:t}},e.is=function(e){let t=e;return t!=null&&V.is(t.range)&&G.string(t.text)}})(lt||={});var ut;(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&&V.is(t.range)&&G.boolean(t.caseSensitiveLookup)&&(G.string(t.variableName)||t.variableName===void 0)}})(ut||={});var dt;(function(e){e.create=function(e,t){return{range:e,expression:t}},e.is=function(e){let t=e;return t!=null&&V.is(t.range)&&(G.string(t.expression)||t.expression===void 0)}})(dt||={});var ft;(function(e){e.create=function(e,t){return{frameId:e,stoppedLocation:t}},e.is=function(e){let t=e;return G.defined(t)&&V.is(e.stoppedLocation)}})(ft||={});var pt;(function(e){e.Type=1,e.Parameter=2,e.is=function(e){return e===1||e===2}})(pt||={});var mt;(function(e){e.create=function(e){return{value:e}},e.is=function(e){let t=e;return G.objectLiteral(t)&&(t.tooltip===void 0||G.string(t.tooltip)||Me.is(t.tooltip))&&(t.location===void 0||ce.is(t.location))&&(t.command===void 0||ve.is(t.command))}})(mt||={});var ht;(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 G.objectLiteral(t)&&B.is(t.position)&&(G.string(t.label)||G.typedArray(t.label,mt.is))&&(t.kind===void 0||pt.is(t.kind))&&t.textEdits===void 0||G.typedArray(t.textEdits,ye.is)&&(t.tooltip===void 0||G.string(t.tooltip)||Me.is(t.tooltip))&&(t.paddingLeft===void 0||G.boolean(t.paddingLeft))&&(t.paddingRight===void 0||G.boolean(t.paddingRight))}})(ht||={});var gt;(function(e){e.createSnippet=function(e){return{kind:`snippet`,value:e}}})(gt||={});var _t;(function(e){e.create=function(e,t,n,r){return{insertText:e,filterText:t,range:n,command:r}}})(_t||={});var vt;(function(e){e.create=function(e){return{items:e}}})(vt||={});var yt;(function(e){e.Invoked=0,e.Automatic=1})(yt||={});var bt;(function(e){e.create=function(e,t){return{range:e,text:t}}})(bt||={});var xt;(function(e){e.create=function(e,t){return{triggerKind:e,selectedCompletionInfo:t}}})(xt||={});var St;(function(e){e.is=function(e){let t=e;return G.objectLiteral(t)&&z.is(t.uri)&&G.string(t.name)}})(St||={});var Ct;(function(e){e.create=function(e,t,n,r){return new wt(e,t,n,r)},e.is=function(e){let t=e;return!!(G.defined(t)&&G.string(t.uri)&&(G.undefined(t.languageId)||G.string(t.languageId))&&G.uinteger(t.lineCount)&&G.func(t.getText)&&G.func(t.positionAt)&&G.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}})(Ct||={});var wt=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===`
2
+ `,i===`\r`&&r+1<t.length&&t.charAt(r+1)===`
3
+ `&&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 B.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 B.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}},G;(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)}})(G||={});var Tt=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 Et(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 Dt(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 Et(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()}},Et=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},Dt=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}},Ot=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 kt(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 At=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}};const jt=new At;var Mt=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=jt,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=jt,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}},Nt=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;It(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};Nt.prototype.contextual=Nt.prototype.fallback=Nt.prototype.extend=!1;var Pt=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e==`string`?kt(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(It(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))}};Pt.prototype.contextual=Nt.prototype.fallback=Nt.prototype.extend=!1;var Ft=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};function It(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||Rt(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 Lt(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function Rt(e,t,n,r){let i=Lt(n,r,t);return i<0||Lt(n,r,e)<i}const K=typeof process<`u`&&process.env&&/\bparse\b/.test(process.env.LOG);let zt=null;function Bt(e,t,n){let r=e.cursor(p.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 Vt=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?Bt(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Bt(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 m){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(o.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}}},Ht=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new At)}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 At,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 At,{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=Yt(o,s+2);else{r==0&&o[s+1]==2&&(r=this.putAction(Yt(o,s+2),t,n,r));break}}o[s]==t&&(r=this.putAction(Yt(o,s+1),t,n,r))}return r}},Ut=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 Mt(t,r),this.tokens=new Ht(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[Tt.start(this,e.top[0],i)],this.fragments=n.length&&this.stream.end-i>e.bufferLength*4?new Vt(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&&Xt(r);if(e)return K&&console.log(`Finish with `+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw K&&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 K&&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 s=this.parser.nodeSet.types[n.type.id]==n.type?this.parser.getGoto(e.state,n.type.id):-1;if(s>-1&&n.length&&(!i||(n.prop(o.contextHash)||0)==a))return e.useNode(n,s,t),n;if(n.children.length==0||n.positions[0]>0)break;let c=n.children[0];if(c instanceof m&&(!r||c.type.id>=this.parser.minRepeatTerm))n=c;else break}return null}advanceStack(e,t,n){let r=e.pos,{parser:i}=this,a=K?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 K&&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),K&&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),K&&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 Wt(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=K?this.stackID(o)+` -> `:``;if(o.deadEnd&&(i||(i=!0,o.restart(),K&&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()&&(K&&console.log(d+this.stackID(u)+` (via force-reduce)`),!this.advanceFully(u,n));e++)K&&(d=this.stackID(u)+` -> `);for(let e of o.recoverByInsert(s))K&&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),K&&console.log(l+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),Wt(o,n)):(!r||r.score<u.score)&&(r=u)}return r}stackToTree(e){return e.close(),m.build({buffer:Ot.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=(zt||=/* @__PURE__ */ new WeakMap).get(e);return t||zt.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}};function Wt(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 Gt=class{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}};const Kt=e=>e;var qt=class{constructor(e){this.start=e.start,this.shift=e.shift||Kt,this.reduce=e.reduce||Kt,this.reuse=e.reuse||Kt,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},Jt=class e extends M{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]),i=[];for(let e=0;e<t.length;e++)i.push([]);function a(e,t,n){i[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];typeof e==`string`&&(e=o[e]);for(let n=1;n<t.length;){let r=t[n++];if(r>=0)a(r,e,t[n++]);else{let i=t[n+-r];for(let o=-r;o>0;o--)a(t[n++],e,i);n++}}}this.nodeSet=new u(t.map((t,r)=>l.define({name:r>=this.minRepeatTerm?void 0:t,id:r,props:i[r],top:n.indexOf(r)>-1,error:r==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(r)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=r;let s=kt(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(Zt),this.states=kt(e.states,Uint32Array),this.data=kt(e.stateData),this.goto=kt(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>typeof e==`number`?new Nt(s,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 Ut(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=Yt(n,i+2)];else if(n[i+1]==2)return Yt(n,i+2);else break}if(a==t||a==0)return Yt(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=Yt(this.data,n+2);else break}r=t(Yt(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=Yt(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]=Zt(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 Gt(e,n,r)}static deserialize(t){return new e(t)}};function Yt(e,t){return e[t]|e[t+1]<<16}function Xt(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 Zt(e){if(e.external){let t=+!!e.extend;return(n,r)=>e.external(n,r)<<1|t}return e.get}let Qt=0;var $t=class e{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=Qt++}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 tn(e);return e=>e.modified.indexOf(t)>-1?e:tn.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}};let en=0;var tn=class e{constructor(e){this.name=e,this.instances=[],this.id=en++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(e=>e.base==t&&nn(n,e.modified));if(r)return r;let i=[],a=new $t(t.name,i,t,n);for(let e of n)e.instances.push(a);let o=rn(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 nn(e,t){return e.length==t.length&&e.every((e,n)=>e==t[n])}function rn(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 an(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 sn(r,i,o>0?n.slice(0,o):null).sort(t[s])}}return on.add(t)}const on=new o({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 sn(i.tags,i.mode,i.context);n?n.next=a:r=a,n=a}return r}});var sn=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}};sn.empty=new sn([],2,null);function cn(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 q=$t.define,ln=q(),un=q(),dn=q(un),fn=q(un),pn=q(),mn=q(pn),hn=q(pn),gn=q(),_n=q(gn),vn=q(),yn=q(),bn=q(),xn=q(bn),Sn=q(),J={comment:ln,lineComment:q(ln),blockComment:q(ln),docComment:q(ln),name:un,variableName:q(un),typeName:dn,tagName:q(dn),propertyName:fn,attributeName:q(fn),className:q(un),labelName:q(un),namespace:q(un),macroName:q(un),literal:pn,string:mn,docString:q(mn),character:q(mn),attributeValue:q(mn),number:hn,integer:q(hn),float:q(hn),bool:q(pn),regexp:q(pn),escape:q(pn),color:q(pn),url:q(pn),keyword:vn,self:q(vn),null:q(vn),atom:q(vn),unit:q(vn),modifier:q(vn),operatorKeyword:q(vn),controlKeyword:q(vn),definitionKeyword:q(vn),moduleKeyword:q(vn),operator:yn,derefOperator:q(yn),arithmeticOperator:q(yn),logicOperator:q(yn),bitwiseOperator:q(yn),compareOperator:q(yn),updateOperator:q(yn),definitionOperator:q(yn),typeOperator:q(yn),controlOperator:q(yn),punctuation:bn,separator:q(bn),bracket:xn,angleBracket:q(xn),squareBracket:q(xn),paren:q(xn),brace:q(xn),content:gn,heading:_n,heading1:q(_n),heading2:q(_n),heading3:q(_n),heading4:q(_n),heading5:q(_n),heading6:q(_n),contentSeparator:q(gn),list:q(gn),quote:q(gn),emphasis:q(gn),strong:q(gn),link:q(gn),monospace:q(gn),strikethrough:q(gn),inserted:q(),deleted:q(),changed:q(),invalid:q(),meta:Sn,documentMeta:q(Sn),annotation:q(Sn),processingInstruction:q(Sn),definition:$t.defineModifier(`definition`),constant:$t.defineModifier(`constant`),function:$t.defineModifier(`function`),standard:$t.defineModifier(`standard`),local:$t.defineModifier(`local`),special:$t.defineModifier(`special`)};for(let e in J){let t=J[e];t instanceof $t&&(t.name=e)}cn([{tag:J.link,class:`tok-link`},{tag:J.heading,class:`tok-heading`},{tag:J.emphasis,class:`tok-emphasis`},{tag:J.strong,class:`tok-strong`},{tag:J.keyword,class:`tok-keyword`},{tag:J.atom,class:`tok-atom`},{tag:J.bool,class:`tok-bool`},{tag:J.url,class:`tok-url`},{tag:J.labelName,class:`tok-labelName`},{tag:J.inserted,class:`tok-inserted`},{tag:J.deleted,class:`tok-deleted`},{tag:J.literal,class:`tok-literal`},{tag:J.string,class:`tok-string`},{tag:J.number,class:`tok-number`},{tag:[J.regexp,J.escape,J.special(J.string)],class:`tok-string2`},{tag:J.variableName,class:`tok-variableName`},{tag:J.local(J.variableName),class:`tok-variableName tok-local`},{tag:J.definition(J.variableName),class:`tok-variableName tok-definition`},{tag:J.special(J.variableName),class:`tok-variableName2`},{tag:J.definition(J.propertyName),class:`tok-propertyName tok-definition`},{tag:J.typeName,class:`tok-typeName`},{tag:J.namespace,class:`tok-namespace`},{tag:J.className,class:`tok-className`},{tag:J.macroName,class:`tok-macroName`},{tag:J.propertyName,class:`tok-propertyName`},{tag:J.operator,class:`tok-operator`},{tag:J.comment,class:`tok-comment`},{tag:J.meta,class:`tok-meta`},{tag:J.invalid,class:`tok-invalid`},{tag:J.punctuation,class:`tok-punctuation`}]);function Cn(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function wn(e){return e==9||e==10||e==13||e==32}let Tn=null,En=null,Dn=0;function On(e,t){let n=e.pos+t;if(En==e&&Dn==n)return Tn;for(;wn(e.peek(t));)t++;let r=``;for(;;){let n=e.peek(t);if(!Cn(n))break;r+=String.fromCharCode(n),t++}return En=e,Dn=n,Tn=r||null}function kn(e,t){this.name=e,this.parent=t}const An=new qt({start:null,shift(e,t,n,r){return t==1?new kn(On(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 kn(On(r,1)||``,e):e},strict:!1}),jn=new Ft((e,t)=>{if(e.next==60){if(e.advance(),e.next==47){e.advance();let n=On(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 Mn(e,t){return new Ft(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 Nn=Mn(36,`-->`),Pn=Mn(37,`?>`),Fn=Mn(38,`]]>`),In=an({Text:J.content,"StartTag StartCloseTag EndTag SelfCloseEndTag":J.angleBracket,TagName:J.tagName,"MismatchedCloseTag/TagName":[J.tagName,J.invalid],AttributeName:J.attributeName,AttributeValue:J.attributeValue,Is:J.definitionOperator,"EntityReference CharacterReference":J.character,Comment:J.blockComment,ProcessingInst:J.processingInstruction,DoctypeDecl:J.documentMeta,Cdata:J.special(J.string)}),Ln=Jt.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:An,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:[In],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:[jn,Nn,Pn,Fn,0,1,2,3,4],topRules:{Document:[0,6]},tokenPrec:0}),Rn=/^[\u0009\u000A\u000D\u0020-\uD7FF\uE000-\uFFFD\u{10000}-\u{10FFFF}]$/u,zn=/[^\u0009\u000A\u000D\u0020-\uD7FF\uE000-\uFFFD\u{10000}-\u{10FFFF}]/u,Bn=e=>/[^\t\n\r ]/.test(e),Vn=/* @__PURE__ */ new Map([[`amp`,`&`],[`apos`,`'`],[`quot`,`"`],[`lt`,`<`],[`gt`,`>`]]);function Hn(e){let t=e.slice(1,-1);if(t[0]!==`#`)return Vn.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 Rn.test(r)?r:void 0}function Un(e){return e.replace(/&(?:#x[\da-fA-F]+|#\d+|[\w.:-]+);/g,e=>Hn(e)??e)}function Wn(e,t=[]){return e.length<=5242880?Ln.parse(e,t):void 0}function Gn(e,t,n){return e?{from:e.from,to:e.to,name:t.slice(e.from,e.to)}:{from:n,to:n,name:``}}function Kn(e,t){let n=Gn(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=Un(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 qn(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 Jn(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=>Kn(t,e)),o={name:Gn(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 qn(o,``)??``;let n=qn(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:Gn(c.getChild(`TagName`),e,u+2),complete:c.lastChild?.name===`EndTag`};else if(l===`MismatchedCloseTag`&&f){let t=Gn(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)&&Bn(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`)&&Hn(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:me.Warning}]};let c=zn.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 Yn(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 Xn=/* @__PURE__ */ n((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})),Zn=/* @__PURE__ */ n((e=>{var t=Xn();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})),Qn=/* @__PURE__ */ n((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(/"[^"]*"|'[^']*'/),ee=a(/^<\?/,`(`,g,`)`,o(f,`(?!`,u,`)(`,c,`*?)`),`?`,/\?>/),k=/[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/,A=o(`"`,k,`*"`,`|`,`'`,i(k,`'`),`*'`),te=`<!--`,ne=`-->`,j=a(te,o(i(c,`-`),`|`,a(`-`,i(c,`-`))),`*`,ne),M=`#PCDATA`,N=o(`EMPTY`,`|`,`ANY`,`|`,o(a(/\(/,p,M,o(p,/\|/,p,T),`*`,p,/\)\*/),`|`,a(/\(/,p,M,p,/\)/)),`|`,a(/\([^>]+\)/,/[?*+]?/)),re=a(`<!ELEMENT`,f,o(T,`|`,b),f,o(N,`|`,b),p,`>`),P=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,`>`),F=`about:legacy-compat`,ie=o(`"`+F+`"`,`|`,`'`+F+`'`),I=`SYSTEM`,L=`PUBLIC`,R=o(o(I,f,O),`|`,o(L,f,A,f,O)),ae=a(`^`,o(o(I,f,`(?<SystemLiteralOnly>`,O,`)`),`|`,o(L,f,`(?<PubidLiteral>`,A,`)`,f,`(?<SystemLiteral>`,O,`)`))),z=a(`^`,A,`$`),oe=a(`^`,O,`$`),se=o(x,`|`,o(R,o(f,`NDATA`,f,g),`?`)),B=`<!ENTITY`,V=o(a(B,f,g,f,se,p,`>`),`|`,a(B,f,`%`,f,g,f,o(x,`|`,R),p,`>`)),ce=a(`<!NOTATION`,f,g,f,o(R,`|`,a(L,f,A)),p,`>`),le=a(p,`=`,p),ue=/1[.]\d+/,H=a(f,`version`,le,o(`'`,ue,`'`,`|`,`"`,ue,`"`)),de=/[A-Za-z][-A-Za-z0-9._]*/,fe=a(/^<\?xml/,H,o(f,`encoding`,le,o(`"`,de,`"`,`|`,`'`,de,`'`)),`?`,o(f,`standalone`,le,o(`'`,o(`yes`,`|`,`no`),`'`,`|`,`"`,o(`yes`,`|`,`no`),`"`)),`?`,p,/\?>/),U=`<!DOCTYPE`,pe=`<![CDATA[`,me=`]]>`,he=a(/<!\[CDATA\[/,a(c,`*?`,/\]\]>/));e.chars=r,e.chars_without=i,e.detectUnicodeSupport=t,e.reg=a,e.regg=o,e.ABOUT_LEGACY_COMPAT=F,e.ABOUT_LEGACY_COMPAT_SystemLiteral=ie,e.AttlistDecl=P,e.CDATA_START=pe,e.CDATA_END=me,e.CDSect=he,e.Char=c,e.Comment=j,e.COMMENT_START=te,e.COMMENT_END=ne,e.DOCTYPE_DECL_START=U,e.elementdecl=re,e.EntityDecl=V,e.EntityValue=x,e.ExternalID=R,e.ExternalID_match=ae,e.Name=g,e.Name_exact=_,e.NCName_exact=w,e.NotationDecl=ce,e.Reference=y,e.PEReference=b,e.PI=ee,e.PUBLIC=L,e.PubidLiteral=A,e.PubidLiteral_match=z,e.QName=T,e.QName_exact=E,e.QName_group=D,e.S=f,e.SChar_s=d,e.S_OPT=p,e.SYSTEM=I,e.SystemLiteral=O,e.SystemLiteral_match=oe,e.InvalidChar=l,e.UNICODE_REPLACEMENT_CHARACTER=s,e.UNICODE_SUPPORT=n,e.XMLDecl=fe})),$n=/* @__PURE__ */ n((e=>{var t=Xn(),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=Zn(),f=d.DOMException,p=d.DOMExceptionName,m=Qn();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,ee=T.CDATA_SECTION_NODE=4,k=T.ENTITY_REFERENCE_NODE=5,A=T.ENTITY_NODE=6,te=T.PROCESSING_INSTRUCTION_NODE=7,ne=T.COMMENT_NODE=8,j=T.DOCUMENT_NODE=9,M=T.DOCUMENT_TYPE_NODE=10,N=T.DOCUMENT_FRAGMENT_NODE=11,re=T.NOTATION_NODE=12,P=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 F(e,t){if(t.length<e.length)return F(t,e);var n=null;for(var r in e){if(e[r]!==t[r])return n;n=e[r]}return n}function ie(e){return e.guid||=Math.random(),e.guid}function I(){}I.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++)We(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)}},I.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 L(e,t){this._node=e,this._refresh=t,R(this)}function R(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var n=e._refresh(e._node);if(qe(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}}L.prototype.item=function(e){return R(this),this[e]||null},w(L,I);function ae(){this._nsIndex=Object.create(null),this._noNsIndex=Object.create(null)}function z(e,t){for(var n=0;n<e.length;){if(e[n]===t)return n;n++}}function oe(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 se(e,t,n){var r=oe(e,t,!1);return r&&r[n]||null}function B(e,t){oe(e,t.namespaceURI,!0)[t.localName]=t}function V(e,t){var n=oe(e,t.namespaceURI,!1);n&&delete n[t.localName]}function ce(e,t,n,r){if(r?t[z(t,r)]=n:(t[t.length]=n,t.length++),B(t,n),e){n.ownerElement=e;var i=e.ownerDocument;i&&(r&&he(i,e,r),me(i,e,n))}}function le(e,t,n){var r=z(t,n);if(r>=0){for(var i=t.length-1;r<=i;)t[r]=t[++r];if(t.length=i,V(t,n),e){var a=e.ownerDocument;a&&he(a,e,n),n.ownerElement=null}}}ae.prototype={length:0,item:I.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=se(this,e.namespaceURI,e.localName);return n===e?e:(ce(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 le(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 le(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}},ae.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 ue(){}ue.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 pe(u,{contentType:r});if(i.implementation=this,i.childNodes=new I,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 Pe(u);return i.name=e,i.nodeName=e,i.publicId=t||``,i.systemId=n||``,i.internalSubset=r||``,i.childNodes=new I,i},createHTMLDocument:function(e){var t=new pe(u,{contentType:c.HTML});if(t.implementation=this,t.childNodes=new I,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 H(e){h(e)}H.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 De(this,e,t)},replaceChild:function(e,t){De(this,e,t,Ee),t&&this.removeChild(t)},removeChild:function(e){return _e(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(e){return Ke(this.ownerDocument||this,this,e)},normalize:function(){U(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(``)),ge(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 ke&&(r=t,t=r.ownerElement),n instanceof ke&&(i=n,n=i.ownerElement,r&&t&&n===t))for(var a=0,o;o=n.attributes[a];a++){if(o===r)return P.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+P.DOCUMENT_POSITION_PRECEDING;if(o===i)return P.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+P.DOCUMENT_POSITION_FOLLOWING}if(!t||!n||n.ownerDocument!==t.ownerDocument)return P.DOCUMENT_POSITION_DISCONNECTED+P.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+(ie(n.ownerDocument)>ie(t.ownerDocument)?P.DOCUMENT_POSITION_FOLLOWING:P.DOCUMENT_POSITION_PRECEDING);if(i&&t===n)return P.DOCUMENT_POSITION_CONTAINS+P.DOCUMENT_POSITION_PRECEDING;if(r&&t===n)return P.DOCUMENT_POSITION_CONTAINED_BY+P.DOCUMENT_POSITION_FOLLOWING;for(var s=[],c=t.parentNode;c;){if(!i&&c===n)return P.DOCUMENT_POSITION_CONTAINED_BY+P.DOCUMENT_POSITION_FOLLOWING;s.push(c),c=c.parentNode}s.reverse();for(var l=[],u=n.parentNode;u;){if(!r&&u===t)return P.DOCUMENT_POSITION_CONTAINS+P.DOCUMENT_POSITION_PRECEDING;l.push(u),u=u.parentNode}l.reverse();var d=F(s,l);for(var f in d.childNodes){var p=d.childNodes[f];if(p===n)return P.DOCUMENT_POSITION_FOLLOWING;if(p===t)return P.DOCUMENT_POSITION_PRECEDING;if(l.indexOf(p)>=0)return P.DOCUMENT_POSITION_FOLLOWING;if(s.indexOf(p)>=0)return P.DOCUMENT_POSITION_PRECEDING}return 0}};function de(e){return e==`<`&&`&lt;`||e==`>`&&`&gt;`||e==`&`&&`&amp;`||e==`"`&&`&quot;`||`&#`+e.charCodeAt()+`;`}C(T,H),C(T,H.prototype),C(P,H),C(P,H.prototype);function fe(e,t){U(e,null,{enter:function(e){return!t(e)||U.STOP}})}function U(e,t,n){for(var r=[{node:e,context:t,phase:U.ENTER}];r.length>0;){var i=r.pop();if(i.phase===U.ENTER){var a=n.enter(i.node,i.context);if(a===U.STOP)return U.STOP;if(r.push({node:i.node,context:a,phase:U.EXIT}),a==null)continue;for(var o=i.node.lastChild;o;)r.push({node:o,context:a,phase:U.ENTER}),o=o.previousSibling}else n.exit&&n.exit(i.node,i.context)}}U.STOP=Symbol(`walkDOM.STOP`),U.ENTER=0,U.EXIT=1;function pe(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 me(e,t,n){e&&e._inc++,n.namespaceURI===l.XMLNS&&(t._nsMap[n.prefix?n.localName:``]=n.value)}function he(e,t,n,r){e&&e._inc++,n.namespaceURI===l.XMLNS&&delete t._nsMap[n.prefix?n.localName:``]}function ge(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 _e(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,ge(e.ownerDocument,e),t.parentNode=null,t.previousSibling=null,t.nextSibling=null,t}function ve(e){return e&&(e.nodeType===H.DOCUMENT_NODE||e.nodeType===H.DOCUMENT_FRAGMENT_NODE||e.nodeType===H.ELEMENT_NODE)}function ye(e){return e&&(e.nodeType===H.CDATA_SECTION_NODE||e.nodeType===H.COMMENT_NODE||e.nodeType===H.DOCUMENT_FRAGMENT_NODE||e.nodeType===H.DOCUMENT_TYPE_NODE||e.nodeType===H.ELEMENT_NODE||e.nodeType===H.PROCESSING_INSTRUCTION_NODE||e.nodeType===H.TEXT_NODE)}function be(e){return e&&e.nodeType===H.DOCUMENT_TYPE_NODE}function W(e){return e&&e.nodeType===H.ELEMENT_NODE}function xe(e){return e&&e.nodeType===H.TEXT_NODE}function Se(e,t){var r=e.childNodes||[];if(n(r,W)||be(t))return!1;var i=n(r,be);return!(t&&i&&r.indexOf(i)>r.indexOf(t))}function Ce(e,t){var r=e.childNodes||[];function i(e){return W(e)&&e!==t}if(n(r,i))return!1;var a=n(r,be);return!(t&&a&&r.indexOf(a)>r.indexOf(t))}function we(e,t,n){if(!ve(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(!ye(t)||be(t)&&e.nodeType!==H.DOCUMENT_NODE)throw new f(f.HIERARCHY_REQUEST_ERR,`Unexpected node type `+t.nodeType+` for parent node type `+e.nodeType)}function Te(e,t,r){var i=e.childNodes||[],a=t.childNodes||[];if(t.nodeType===H.DOCUMENT_FRAGMENT_NODE){var o=a.filter(W);if(o.length>1||n(a,xe))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(W(t)&&!Se(e,r))throw new f(f.HIERARCHY_REQUEST_ERR,`Only one element can be added and only after doctype`);if(be(t)){if(n(i,be))throw new f(f.HIERARCHY_REQUEST_ERR,`Only one doctype is allowed`);var s=n(i,W);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 Ee(e,t,r){var i=e.childNodes||[],a=t.childNodes||[];if(t.nodeType===H.DOCUMENT_FRAGMENT_NODE){var o=a.filter(W);if(o.length>1||n(a,xe))throw new f(f.HIERARCHY_REQUEST_ERR,`More than one element or text in fragment`);if(o.length===1&&!Ce(e,r))throw new f(f.HIERARCHY_REQUEST_ERR,`Element in fragment can not be inserted before doctype`)}if(W(t)&&!Ce(e,r))throw new f(f.HIERARCHY_REQUEST_ERR,`Only one element can be added and only after doctype`);if(be(t)){function e(e){return be(e)&&e!==r}if(n(i,e))throw new f(f.HIERARCHY_REQUEST_ERR,`Only one doctype is allowed`);var s=n(i,W);if(r&&i.indexOf(s)<i.indexOf(r))throw new f(f.HIERARCHY_REQUEST_ERR,`Doctype can only be inserted before an element`)}}function De(e,t,n,r){we(e,t,n),e.nodeType===H.DOCUMENT_NODE&&(r||Te)(e,t,n);var i=t.parentNode;if(i&&i.removeChild(t),t.nodeType===N){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 ge(e.ownerDocument||e,e,t),t.nodeType==N&&(t.firstChild=t.lastChild=null),t}pe.prototype={implementation:null,nodeName:`#document`,nodeType:j,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType===N){for(var n=e.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,t),n=r}return e}return De(this,e,t),e.ownerDocument=this,this.documentElement===null&&e.nodeType===E&&(this.documentElement=e),e},removeChild:function(e){var t=_e(this,e);return t===this.documentElement&&(this.documentElement=null),t},replaceChild:function(e,t){De(this,e,t,Ee),e.ownerDocument=this,t&&this.removeChild(t),W(e)&&(this.documentElement=e)},importNode:function(e,t){return Ge(this,e,t)},getElementById:function(e){var t=null;return fe(this.documentElement,function(n){if(n.nodeType==E&&n.getAttribute(`id`)==e)return t=n,!0}),t},createElement:function(e){var t=new Oe(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 I;var n=t.attributes=new ae;return n._ownerElement=t,t},createDocumentFragment:function(){var e=new Re(u);return e.ownerDocument=this,e.childNodes=new I,e},createTextNode:function(e){var t=new je(u);return t.ownerDocument=this,t.childNodes=new I,t.appendData(e),t},createComment:function(e){var t=new Me(u);return t.ownerDocument=this,t.childNodes=new I,t.appendData(e),t},createCDATASection:function(e){if(e.indexOf(`]]>`)!==-1)throw new f(f.INVALID_CHARACTER_ERR,`data contains "]]>"`);var t=new Ne(u);return t.ownerDocument=this,t.childNodes=new I,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new ze(u);return n.ownerDocument=this,n.childNodes=new I,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 ke(u);return t.ownerDocument=this,t.childNodes=new I,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 Le(u);return t.ownerDocument=this,t.childNodes=new I,t.nodeName=e,t},createElementNS:function(e,t){var n=S(e,t),r=new Oe(u),i=r.attributes=new ae;return r.childNodes=new I,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 ke(u);return r.ownerDocument=this,r.childNodes=new I,r.nodeName=t,r.name=t,r.specified=!0,r.namespaceURI=n[0],r.prefix=n[1],r.localName=n[2],r}},w(pe,H);function Oe(e){h(e),this._nsMap=Object.create(null)}Oe.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 L(this,function(n){var r=[];return t.length>0&&fe(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===j?this:this.ownerDocument).type===`html`,n=e.toLowerCase();return new L(this,function(r){var i=[];return fe(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 L(this,function(n){var r=[];return fe(n,function(i){i===n||i.nodeType!==E||e!==`*`&&i.namespaceURI!==e||t!==`*`&&i.localName!=t||r.push(i)}),r})}},pe.prototype.getElementsByClassName=Oe.prototype.getElementsByClassName,pe.prototype.getElementsByTagName=Oe.prototype.getElementsByTagName,pe.prototype.getElementsByTagNameNS=Oe.prototype.getElementsByTagNameNS,w(Oe,H);function ke(e){h(e),this.namespaceURI=null,this.prefix=null,this.ownerElement=null}ke.prototype.nodeType=D,w(ke,H);function Ae(e){h(e)}Ae.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(Ae,H);function je(e){h(e)}je.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(je,Ae);function Me(e){h(e)}Me.prototype={nodeName:`#comment`,nodeType:ne},w(Me,Ae);function Ne(e){h(e)}Ne.prototype={nodeName:`#cdata-section`,nodeType:ee},w(Ne,je);function Pe(e){h(e)}Pe.prototype.nodeType=M,w(Pe,H);function Fe(e){h(e)}Fe.prototype.nodeType=re,w(Fe,H);function Ie(e){h(e)}Ie.prototype.nodeType=A,w(Ie,H);function Le(e){h(e)}Le.prototype.nodeType=k,w(Le,H);function Re(e){h(e)}Re.prototype.nodeName=`#document-fragment`,Re.prototype.nodeType=N,w(Re,H);function ze(e){h(e)}ze.prototype.nodeType=te,w(ze,Ae);function Be(){}Be.prototype.serializeToString=function(e,t){return Ve.call(e,t)},H.prototype.toString=Ve;function Ve(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===j&&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 We(this,n,o,t),n.join(``)}function He(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 Ue(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,de),`"`)}function We(e,t,n,r){n||=[];var i=r.nodeFilter,a=r.requireWellFormed,c=r.splitCDATASections,u=(e.nodeType===j?e:e.ownerDocument).type===`html`;U(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(He(T,u,C)){var A=T.prefix||``,re=T.namespaceURI;Ue(t,A?`xmlns:`+A:`xmlns`,re,a),C.push({prefix:A,namespace:re})}var P=i?i(T):T;P&&(typeof P==`string`?t.push(P):Ue(t,P.name,P.value,a))}if(_===v&&He(e,u,C)){var F=e.prefix||``,re=e.namespaceURI;Ue(t,F?`xmlns:`+F:`xmlns`,re,a),C.push({prefix:F,namespace:re})}var ie=!e.firstChild;if(ie&&(u||e.namespaceURI===l.HTML)&&(ie=s(_)),ie)return t.push(`/>`),null;if(t.push(`>`),u&&o(_)){for(var I=e.firstChild;I;)I.data?t.push(I.data):We(I,t,C.slice(),r),I=I.nextSibling;return t.push(`</`,v,`>`),null}return{ns:C,tag:v};case j:case N:if(a&&e.nodeType===j&&e.documentElement==null)throw new f(`The Document has no documentElement`,p.InvalidStateError);return{ns:d};case D:return Ue(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,de)),null;case ee: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 ne: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 M:var L=e.publicId,R=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(L&&!m.PubidLiteral_match.test(L))throw new f(`DocumentType publicId is not a valid PubidLiteral`,p.InvalidStateError);if(R&&R!==`.`&&!m.SystemLiteral_match.test(R))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),L?(t.push(` `,m.PUBLIC,` `,L),R&&R!==`.`&&t.push(` `,R)):R&&R!==`.`&&t.push(` `,m.SYSTEM,` `,R),e.internalSubset&&t.push(` [`,e.internalSubset,`]`),t.push(`>`),null;case te: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 k: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 Ge(e,t,n){var r;return U(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 Ke(e,t,n){var r;return U(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 I),o.ownerDocument=e;var l=n;switch(o.nodeType){case E:var d=t.attributes,f=o.attributes=new ae,p=d.length;f._ownerElement=o;for(var m=0;m<p;m++)o.setAttributeNode(Ke(e,d.item(m),!0));break;case D:l=!0}return a===null?r=o:a.appendChild(o),l?o:null}}),r}function qe(e,t,n){e[t]=n}function Je(e){for(var t=[],n=e.firstChild;n;)n.nodeType===E&&t.push(n),n=n.nextSibling;return t}try{Object.defineProperty&&(Object.defineProperty(L.prototype,"length",{get:function(){return R(this),this.$$length}}),Object.defineProperty(H.prototype,"textContent",{get:function(){if(this.nodeType===E||this.nodeType===N){var e=[];return U(this,null,{enter:function(t){if(t.nodeType===E||t.nodeType===N)return!0;if(t.nodeType===te||t.nodeType===ne)return null;e.push(t.nodeValue)}}),e.join(``)}return this.nodeValue},set:function(e){switch(this.nodeType){case E:case N: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(Ae.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(Ae.prototype,"nodeValue",{get:function(){return this.data},set:function(e){this.data=e},enumerable:!0,configurable:!0}),Object.defineProperty(Oe.prototype,"children",{get:function(){return new L(this,Je)}}),Object.defineProperty(pe.prototype,"children",{get:function(){return new L(this,Je)}}),Object.defineProperty(Re.prototype,"children",{get:function(){return new L(this,Je)}}),qe=function(e,t,n){e[`$$`+t]=n})}catch{}e._updateLiveList=R,e.Attr=ke,e.CDATASection=Ne,e.CharacterData=Ae,e.Comment=Me,e.Document=pe,e.DocumentFragment=Re,e.DocumentType=Pe,e.DOMImplementation=ue,e.Element=Oe,e.Entity=Ie,e.EntityReference=Le,e.LiveNodeList=L,e.NamedNodeMap=ae,e.Node=H,e.NodeList=I,e.Notation=Fe,e.Text=je,e.ProcessingInstruction=ze,e.walkDOM=U,e.XMLSerializer=Be})),er=/* @__PURE__ */ n((e=>{var t=Xn().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:`
4
+ `,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})),tr=/* @__PURE__ */ n((e=>{var t=Xn(),n=Qn(),r=Zn(),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 te=o.doc,ne=te.createTextNode(e.substring(D));if(te.documentElement)return c.error(`Extra content at the end of the document`);te.appendChild(ne),o.currentElement=ne}return}if(O>D){var j=e.substring(D,O);!d&&E.length===0&&(j=j.replace(new RegExp(n.S_OPT.source,`g`),``),j&&c.error(`Unexpected content outside root element: '`+j+`'`)),m(O)}switch(e.charAt(O+1)){case`/`:var M=e.indexOf(`>`,O+2),N=e.substring(O+2,M>0?M:void 0);if(!N)return c.fatalError(`end tag name missing`);var re=n.reg(`^`,n.QName_group,n.S_OPT,`$`),P=M>0&&re.exec(N);if(!P){var F=M>0&&n.reg(`^`,n.QName_group).exec(N);if(d&&F)c.warning(`end tag name contains invalid trailing characters: "`+N+`"`),P=F;else if(F&&new RegExp(re.source,re.flags+`m`).test(N))c.error(`end tag name is followed by a line break and trailing content: "`+N+`"`),P=F;else return c.fatalError(`end tag name contains invalid characters: "`+N+`"`)}if(!o.currentElement&&!o.doc.documentElement)return;var ie=E[E.length-1]||o.currentElement.tagName||o.doc.documentElement.tagName||``;if(ie!==P[1]){var I=P[1].toLowerCase();if(!d||ie.toLowerCase()!==I)return c.fatalError(`Opening and ending tag mismatch: "`+ie+`" != "`+N+`"`)}var L=x.pop();E.pop();var R=L.localNSMap;if(o.endElement(L.uri,L.localName,ie),R)for(var ae in R)s(R,ae)&&o.endPrefixMapping(ae);M++;break;case`?`:v&&y(O),M=k(e,O,o,c);break;case`!`:v&&y(O),M=ee(e,O,o,c,d);break;default:v&&y(O);var z=new A,oe=x[x.length-1].currentNSMap,M=C(e,O,z,oe,p,c,d),se=z.length;if(z.closed||(d&&t.isHTMLVoidElement(z.tagName)?z.closed=!0:E.push(z.tagName)),v&&se){for(var B=S(v,{}),V=0;V<se;V++){var ce=z[V];y(ce.offset),ce.locator=S(v,{})}o.locator=B,w(z,o,oe)&&x.push(z),o.locator=v}else w(z,o,oe)&&x.push(z);d&&!z.closed?M=T(e,M,z.tagName,p,o):M++}}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),M=-1}M>D?D=M: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!==`
5
+ `&&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 ee(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 k(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=ee})),nr=/* @__PURE__ */ n((e=>{var t=Xn(),n=$n(),r=Zn(),i=er(),a=tr(),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,`
6
+ `).replace(/[\r\u0085\u2028\u2029]/g,`
7
+ `)}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`
8
+ @#[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`}})),rr=(/* @__PURE__ */ n((e=>{var t=Xn();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=Zn();e.DOMException=n.DOMException,e.DOMExceptionName=n.DOMExceptionName,e.ExceptionCode=n.ExceptionCode,e.ParseError=n.ParseError;var r=$n();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=nr();e.DOMParser=i.DOMParser,e.normalizeLineEndings=i.normalizeLineEndings,e.onErrorStopParsing=i.onErrorStopParsing,e.onWarningStopParsing=i.onWarningStopParsing})))();const ir=/* @__PURE__ */ new WeakMap;function ar(e,t){let n=ir.get(e);return n&&ir.set(t,n),t}var Y=class extends Error{constructor(e){super(e),this.name=`XmlWikiConversionError`}};const or=Y,sr=/* @__PURE__ */ new Set([`none`,`row`,`col`,`both`]);function cr(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function lr(e){return e.blockType===`paragraph`}function ur(e){return e.blockType===`quote`}function dr(e){return e.blockType===`list`}function fr(e){return e.blockType===`image`}function pr(e){return e.blockType===`complexTable`}function mr(e){return e.inlineType===`text`}function hr(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 gr(e=[],t=`body`,n=`left`){return{blockType:`paragraph`,kind:t,align:n,inlines:e}}function _r(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 or(`Unsupported table header mode '${e}'.`)}function vr(e){return mr(e)?!!e.text:e.inlineType===`pronunciation`?!!e.content:e.inlineType===`link`?!!(e.text||e.href):e.inlineType===`emoji`||e.inlineType===`annotation`||!!e.targetId}function yr(e){return lr(e)&&e.kind===`body`&&!e.inlines.some(e=>vr(e))}function br(e){let t=[];for(let n of e){let e=t[t.length-1];e&&mr(e)&&mr(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 xr(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,`
9
+ `).split(`
10
+ `);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 Sr(e,t=!1){let n=[];for(let r of e)if(lr(r)){let e=xr(r.inlines.map(e=>e.inlineType===`annotation`?ar(e,{...e,title:br(e.title.map(e=>({...e}))),content:Sr(e.content)}):e)).map(br);for(let t of e){for(;t[0]&&mr(t[0])&&(t[0].text=t[0].text.trimStart(),!t[0].text);)t.shift();for(;t.length&&mr(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?gr(i,r.kind,r.align):gr();n.push(t===0?ar(r,e):e)}}else if(ur(r)){let e=Sr(r.children);e.length&&n.push(ar(r,{blockType:`quote`,children:e}))}else if(dr(r)){let e=[];for(let t of r.items){let n=Sr(t.blocks);n.length&&e.push(ar(t,{blocks:n}))}e.length&&n.push(ar(r,{blockType:`list`,ordered:r.ordered,items:e}))}else if(pr(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:Sr(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};Or(t),n.push(ar(r,t))}else n.push(r);if(!t){for(;n.length>0&&yr(n[0]);)n.shift();for(;n.length>0&&yr(n[n.length-1]);)n.pop()}return ar(e,n)}function Cr(e){let t=Sr(e,!0);return t.length||t.push(gr()),t}function*wr(e){for(let t of e)if(lr(t))for(let e of t.inlines)e.inlineType===`annotation`&&(yield*wr(e.content));else if(fr(t))yield t;else if(ur(t))yield*wr(t.children);else if(dr(t))for(let e of t.items)yield*wr(e.blocks);else if(pr(t))for(let e of t.cells)yield*wr(e.blocks)}function Tr(e,t){for(let n of e){if(!lr(n)||n.kind!==`body`||n.align!==`left`)throw new Y(`${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 Y(`${t} emoji must include a nonempty id.`)}else if(!mr(e)||e.bold||e.italic||e.underline||e.strike||e.color!==null)throw new Y(`${t} only supports unstyled text and emoji.`)}}function Er(e,t){if(e.type!==`message`||e.side!==`me`&&e.side!==`other`)throw new Y(`${t} must be a message with side 'me' or 'other'.`);if(typeof e.avatarUrl!=`string`||!e.avatarUrl.trim())throw new Y(`${t} must include a nonempty avatar.`);for(let[n,r]of e.contents.entries()){let e=`${t}.contents[${n}]`;if(r.type===`text`)Tr(r.blocks,e);else if(r.type===`image`){if(typeof r.src!=`string`||!r.src.trim())throw new Y(`${e} must include a nonempty image src.`)}else throw new Y(`${e} must be text or an image.`)}}function Dr(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 Y(`${t} cannot mix chapter modes.`);if(!Array.isArray(e.dialog)||!e.dialog.length)throw new Y(`${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`:Er(r,e);break;case`divider`:if(typeof r.kind!=`string`||!r.kind.trim())throw new Y(`${e} must include a nonempty divider kind.`);break;case`branches`:if(!r.branches.length)throw new Y(`${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())Er(t,`${r}.dialogList[${e}]`);let i=n.messages[0];if(i?.side!==`me`||n.messages.at(-1)?.side!==`other`)throw new Y(`${r} must start with 'me' and end with 'other'.`);if(i.contents.some(e=>e.type===`image`))throw new Y(`${r} first message cannot contain an image.`)}break;default:throw new Y(`${e} must be a message, a divider or a branch group.`)}}}function Or(e){if(!sr.has(e.headerMode))throw new or(`Unsupported table header mode '${e.headerMode}'.`);if(e.rowCount<=0||e.columnCount<=0)throw new or(`Complex tables must contain at least one row and one column.`);if(e.columnWidths.length!==e.columnCount)throw new or(`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 or(`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 or(`Complex table cell positions must be non-negative.`);if(n.rowSpan<1||n.colSpan<1)throw new or(`Complex table cell spans must be positive integers.`);if(n.rowIndex+n.rowSpan>e.rowCount)throw new or(`Complex table cell row span exceeds the table bounds.`);if(n.columnIndex+n.colSpan>e.columnCount)throw new or(`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 or(`Complex table contains uncovered grid positions.`)}for(let t of e.cells)for(let e of wr(t.blocks)){let t=Number.parseFloat(e.width);if(!Number.isFinite(t))throw new or(`Image width '${e.width}' is not numeric.`)}}const kr=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 Ar=/* @__PURE__ */ new Set([`b`,`i`,`u`,`s`,`color`,`pron`,`a`,`entry`,`emoji`,`annotation`,`br`]),jr=/* @__PURE__ */ new Set([`h1`,`h2`,`h3`,`quote`,`ul`,`ol`,`align`,`img`,`line`,`video`]),Mr=/* @__PURE__ */ new Set([`skland`,`bilibili`]),Nr={large:1160,middle:754.7,small:349.3};function Pr(e){return typeof structuredClone==`function`?structuredClone(e):JSON.parse(JSON.stringify(e))}function Fr(e){return cr(e)?Pr(e):{}}function Ir(){let e=globalThis.DOMParser;return typeof e==`function`?e:null}function Lr(e){let t=Ir();if(t)return new t().parseFromString(e,`application/xml`);let n=[],r=new rr.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 Rr(e){let t;try{t=Lr(e)}catch(e){throw new Y((e instanceof Error?e.message:String(e))||`Invalid XML.`)}let n=t.getElementsByTagName(`parsererror`)[0];if(n)throw new Y(Z(n.textContent,`Invalid XML.`));let r=t.documentElement;if(!r)throw new Y(`Invalid XML.`);return r}function zr(e){let t=[];for(let n of Array.from(e.childNodes))n.nodeType===1&&t.push(n);return t}function X(e){let t=``;for(let n of Array.from(e.childNodes))(n.nodeType===3||n.nodeType===4)&&(t+=n.nodeValue||``);return t}function Z(e,t=``){return e==null?t:e.replace(/\s+/g,` `).trim()}function Br(e){if(e==null)return``;let t=e.replace(/\r\n/g,`
11
+ `).replace(/\r/g,`
12
+ `).split(`
13
+ `).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(`
14
+ `)}function Vr(e){return X(e).trim()?!0:zr(e).length>0}function Q(e,t){for(let n of zr(e))if(n.tagName===t)return n;throw new Y(`Expected <${t}> inside <${e.tagName}>.`)}function $(e,t){return zr(e).filter(e=>e.tagName===t)}function Hr(e,t){for(let n of zr(e))if(n.tagName===t)return n;return null}function Ur(e){let t=Hr(e,`publicMeta`);if(!t)return{infoRoot:{},item:{},brief:{},documentExtraInfo:{}};let n=X(t).trim();if(!n)return{infoRoot:{},item:{},brief:{},documentExtraInfo:{}};let r;try{r=JSON.parse(n)}catch(e){throw new Y(`Invalid <publicMeta> JSON: ${e instanceof Error?e.message:String(e)}`)}if(!cr(r))throw new Y(`<publicMeta> must contain a JSON object.`);let i=Fr(r.item??r);return delete i.commitMsg,{infoRoot:Fr(r.infoRoot),item:i,brief:Fr(r.brief),documentExtraInfo:Fr(r.documentExtraInfo)}}function Wr(e){let t=Rr(e);if(t.tagName!==`sklandDocument`)throw new Y(`Expected root element <sklandDocument>.`);qr(t);let n=Ur(t),r=Hr(t,`commitMsg`),i=Q(t,`metainfo`),a=Q(i,`cover`),o=Q(i,`subTypes`),s=Q(t,`description`),c=[];for(let e of $(t,`chapters`)){let t=e.getAttribute(`name`);if(t==null)throw new Y(`Each <chapters> element must have a name attribute.`);let n=$(e,`chapter`).map(e=>Gr(e));c.push({title:t,chapters:n})}let l=$(o,`subType`).map(e=>{let t=e.getAttribute(`id`);if(t==null)throw new Y(`<subType> must include an id attribute.`);return{subTypeId:t,value:X(e)}});return[{itemId:Z(X(Q(t,`itemId`))),infoRootMeta:n.infoRoot,publicMeta:n.item,briefExtra:n.brief,documentExtraInfo:n.documentExtraInfo,name:X(Q(i,`name`)),cover:X(a),showInDetail:(a.getAttribute(`showInDetail`)||`false`).toLowerCase()===`true`,subTypes:l,descriptionWasNull:(s.getAttribute(`source`)||``).toLowerCase()===`null`,description:ni(s,{allowTables:!0}),chapterGroups:c,...r?{commitMsg:X(r)}:{}},[]]}function Gr(e){let t=e.getAttribute(`name`);if(t==null)throw new Y(`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 Y(`${r} cannot mix chapter modes.`);let i={title:t,size:n,chapterType:`dialog`,content:[],tabs:[],audios:[],tableRows:[],dialog:Jr(e,r).map((e,t)=>Xr(e,`${r}.dialogList[${t}]`))};return Dr(i),i}if(e.getAttribute(`table`)===`true`){let r=Q(e,`table`),i=[];for(let[e,n]of $(r,`row`).entries()){let r=$(n,`cell`);if(r.length!==2)throw new Y(`Simple table chapter '${t}' row ${e+1} must contain exactly 2 cells.`);i.push({cells:r.map(e=>[e.getAttribute(`label`)||``,di(e)])})}return{title:t,size:n,chapterType:`simple_table`,content:[],tabs:[],audios:[],tableRows:i}}if(e.getAttribute(`audio`)===`true`){let r=$(e,`tab`),i=$(e,`audios`);if(r.length&&i.length)throw new Y(`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=$(e,`audios`);if(r.length!==1)throw new Y(`Audio chapter '${t}' tab ${n+1} must contain exactly one <audios> element.`);return{title:e.getAttribute(`name`),icon:e.getAttribute(`icon`),audios:ei(r[0])}}),tableRows:[]}:{title:t,size:n,chapterType:`audio`,content:[],tabs:[],audios:ei(Q(e,`audios`)),tableRows:[]}}let r=$(e,`tab`);return r.length?{title:t,size:n,chapterType:`common`,content:[],tabs:r.map(e=>ti(e,n)),audios:[],tableRows:[]}:{title:t,size:n,chapterType:`common`,content:ni(e,{chapterSize:n,allowTables:!0}),tabs:[],audios:[],tableRows:[]}}const Kr=/* @__PURE__ */ new Set([`message`,`text`,`image`,`branches`,`branch`,`divider`]);function qr(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 Y(`A dialog <chapter> must be directly inside a top-level <chapters> element.`);t.add(n)}if(!Kr.has(n.tagName))continue;let r=n.parentElement;for(;r&&r.tagName!==`chapter`;)r=r.parentElement;if(!r||!t.has(r))throw new Y(`<${n.tagName}> must be inside a dialog chapter.`)}}function Jr(e,t){if(X(e).trim())throw new Y(`${t} cannot contain text directly inside <${e.tagName}>.`);return zr(e)}function Yr(e,t,n){for(let r of Array.from(e.attributes))if(!t.includes(r.name))throw new Y(`${n} has unsupported attribute '${r.name}' on <${e.tagName}>.`)}function Xr(e,t){switch(e.tagName){case`message`:return Zr(e,t);case`divider`:if(Yr(e,[`kind`],t),zr(e).length)throw new Y(`${t} <divider> only supports plain text.`);return{type:`divider`,kind:e.getAttribute(`kind`)||``,text:X(e)};case`branches`:return Yr(e,[],t),{type:`branches`,branches:Jr(e,t).map((e,n)=>{let r=`${t}.branchList[${n}]`;if(e.tagName!==`branch`||!e.hasAttribute(`name`))throw new Y(`${r} must be a <branch> with a name attribute.`);return Yr(e,[`name`],r),{title:e.getAttribute(`name`)||``,messages:Jr(e,r).map((e,t)=>Zr(e,`${r}.dialogList[${t}]`))}})};default:throw new Y(`${t} cannot contain <${e.tagName}>.`)}}function Zr(e,t){let n=e.getAttribute(`side`);if(e.tagName!==`message`||n!==`me`&&n!==`other`)throw new Y(`${t} must be a <message> with side 'me' or 'other'.`);return Yr(e,[`side`,`avatar`,`name`],t),{type:`message`,side:n,avatarUrl:e.getAttribute(`avatar`)||``,name:e.getAttribute(`name`)||``,contents:Jr(e,t).map((e,n)=>Qr(e,`${t}.contents[${n}]`))}}function Qr(e,t){if(e.tagName===`text`)return{type:`text`,blocks:$r(e,t)};if(e.tagName===`image`){if(Yr(e,[`src`],t),Vr(e))throw new Y(`${t} <image> cannot contain content.`);return{type:`image`,src:e.getAttribute(`src`)||``}}throw new Y(`${t} must be <text> or <image>.`)}function $r(e,t){Yr(e,[],t);let n=[],r=``,i=!0;function a(e){let t=i?r.trimStart():r,a=e?t.trimEnd():t;a&&n.push(hr(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 Y(`${t} cannot contain <${e.tagName}> inside <text>.`);a(r),n.push(...si(e)),i=r}return a(!0),Cr([gr(n)])}function ei(e){return $(e,`audio`).map(e=>({title:e.getAttribute(`name`)||``,profile:di(e,!0),resourceUrl:e.getAttribute(`src`)||``}))}function ti(e,t){let n=null,r=ni(e,{chapterSize:t,allowTables:!0,specialHandlers:{imgIntro:e=>{n={name:Z(X(Q(e,`name`))),introType:Z(X(Q(e,`type`))),imageUrl:Z(X(Q(e,`imgUrl`))),description:oi(Q(e,`description`),{preserveNewlines:!0})}}}});return{title:e.getAttribute(`name`),icon:e.getAttribute(`icon`),intro:n,content:r}}function ni(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(gr(br(o))),null)},u=e=>{if(!e)return;let t=e.replace(/\r\n|\r/g,`
15
+ `).split(`
16
+ `);for(let[e,n]of t.entries())e>0&&(o?l():s||a.push(gr()),s=!1),(n.trim()||o)&&c().push(hr(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(Ar.has(o))c().push(...si(e));else if(jr.has(o)||i&&o===`table`)l(),a.push(ri(e,{chapterSize:r,allowTables:i})),s=!0;else{if(o===`table`&&!i)throw new Y(`Nested tables are not supported inside table cells.`);if(Vr(e))throw new Y(`Unsupported XML tag <${o}> in content container.`)}}return l(),Sr(a)}function ri(e,t){if(e.tagName===`h1`)return{blockType:`paragraph`,kind:`heading1`,align:`left`,inlines:oi(e)};if(e.tagName===`h2`)return{blockType:`paragraph`,kind:`heading2`,align:`left`,inlines:oi(e)};if(e.tagName===`h3`)return{blockType:`paragraph`,kind:`heading3`,align:`left`,inlines:oi(e)};if(e.tagName===`quote`)return{blockType:`quote`,children:ni(e,{chapterSize:t.chapterSize,allowTables:t.allowTables})};if(e.tagName===`ul`)return ai(e,{ordered:!1,chapterSize:t.chapterSize,allowTables:t.allowTables});if(e.tagName===`ol`)return ai(e,{ordered:!0,chapterSize:t.chapterSize,allowTables:t.allowTables});if(e.tagName===`align`)return{blockType:`paragraph`,kind:`body`,align:e.getAttribute(`value`)||`left`,inlines:oi(e)};if(e.tagName===`img`){let t=Z(X(Q(e,`url`))),n=Hr(e,`id`),r=Hr(e,`format`),i=n&&r?null:fi(t);return{blockType:`image`,url:t,width:Z(X(Q(e,`width`))),height:Z(X(Q(e,`height`))),size:Z(X(Q(e,`size`))),imageId:n?Z(X(n)):i[0],imageFormat:r?Z(X(r)):i[1],description:di(Q(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 Y(`<video> must include a kind attribute.`);if(!Mr.has(t))throw new Y(`Unsupported external video kind '${t}'.`);let n=e.getAttribute(`id`);if(!n)throw new Y(`<video> must include an id attribute.`);return{blockType:`externalVideo`,videoKind:t,videoId:n}}if(e.tagName===`table`){if(!t.allowTables)throw new Y(`Nested tables are not supported inside table cells.`);return ii(e,t.chapterSize)}throw new Y(`Unsupported block tag <${e.tagName}>.`)}function ii(e,t){let n=(e.getAttribute(`header`)||`none`).trim()||`none`;if(!sr.has(n))throw new Y(`Unsupported table header mode '${n}'.`);let r=$(e,`tr`);if(!r.length)throw new Y(`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 Y(`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 Y(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(Vr(s))throw new Y(`Unsupported tag <${s.tagName}> inside <tr>.`);continue}for(;i.has(`${e}:${c}`);)c+=1;let l=s.getAttribute(`col`);l!==null&&(c=mi(l,`row ${e+1} col`)-1);let u=mi((s.getAttribute(`rowspan`)||`1`).trim(),`row ${e+1} rowspan`),d=mi((s.getAttribute(`colspan`)||`1`).trim(),`row ${e+1} colspan`),f=ni(s,{chapterSize:t,allowTables:!1});if(s.tagName===`th`!==_r(n,e,c))throw new Y(`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:pi(e.getAttribute(`widths`),t,o),cells:a,rowCount:r.length,columnCount:o};return Or(s),s}function ai(e,t){if(X(e).trim())throw new Y(`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 Y(`Unexpected trailing text after a list child element.`);continue}if(i.nodeType!==1)continue;let e=i;if(e.tagName===`li`){let i=ni(e,{chapterSize:t.chapterSize,allowTables:t.allowTables});i.length||(i=[gr()]),r={blocks:i},n.push(r)}else if(e.tagName===`ul`||e.tagName===`ol`){if(!r)throw new Y(`Nested list must follow a list item.`);r.blocks.push(ai(e,{ordered:e.tagName===`ol`,chapterSize:t.chapterSize,allowTables:t.allowTables}))}else if(Vr(e))throw new Y(`Unsupported tag <${e.tagName}> inside list.`)}return{blockType:`list`,ordered:t.ordered,items:n}}function oi(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?li(u,t.nodeValue,{bold:n,italic:r,underline:i,strike:a,color:o,preserveNewlines:s,preserveWhitespace:c,preserveBoundarySpaces:l}):t.nodeType===1&&u.push(...si(t,{bold:n,italic:r,underline:i,strike:a,color:o,preserveNewlines:s,preserveWhitespace:c,preserveBoundarySpaces:l}));return br(u)}function si(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 Y(`Emoji must include a nonempty id.`);if(zr(e).length||X(e).trim())throw new Y(`<emoji> must not contain content.`);if(Array.from(e.attributes).some(e=>e.name!==`id`))throw new Y(`<emoji> only supports the id attribute.`);return[{inlineType:`emoji`,id:t}]}if(e.tagName===`annotation`)return[ci(e)];if(e.tagName===`br`)return ui(e),[hr(`
17
+ `,{bold:n,italic:r,underline:i,strike:a,color:o})];if(e.tagName===`b`)return oi(e,{bold:!0,italic:r,underline:i,strike:a,color:o,preserveNewlines:s,preserveWhitespace:c,preserveBoundarySpaces:l});if(e.tagName===`i`)return oi(e,{bold:n,italic:!0,underline:i,strike:a,color:o,preserveNewlines:s,preserveWhitespace:c,preserveBoundarySpaces:l});if(e.tagName===`u`)return oi(e,{bold:n,italic:r,underline:!0,strike:a,color:o,preserveNewlines:s,preserveWhitespace:c,preserveBoundarySpaces:l});if(e.tagName===`s`)return oi(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 Y(`<color> must include a value attribute.`);if(!kr[t])throw new Y(`Unsupported XML color '${t}'.`);return oi(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:di(e)}];if(e.tagName===`a`)return[{inlineType:`link`,href:e.getAttribute(`href`)||``,text:di(e)}];if(e.tagName===`entry`){let t=e.getAttribute(`type`);if(!t)throw new Y(`<entry> must include a type attribute.`);return[{inlineType:`entry`,entryType:t,targetId:e.getAttribute(`id`)||``,count:e.getAttribute(`count`)||`0`}]}throw new Y(`Unsupported inline tag <${e.tagName}>.`)}function ci(e){if(e.getElementsByTagName(`annotation`).length)throw new Y(`Nested annotations are not supported.`);let t=zr(e),n=$(e,`title`),r=$(e,`content`);if(n.length!==1||r.length!==1||t.length!==2||X(e).trim())throw new Y(`<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 Y(`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:oi(n[0],{preserveWhitespace:!0}),content:ni(r[0],{allowTables:i,chapterSize:a})}}function li(e,t,n){if(!t)return;let r;n.preserveWhitespace?r=t.replace(/\r\n|\r/g,`
18
+ `):n.preserveNewlines?(r=t.replace(/\r\n/g,`
19
+ `).replace(/\r/g,`
20
+ `).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(hr(r,{bold:n.bold,italic:n.italic,underline:n.underline,strike:n.strike,color:n.color}))}function ui(e){if(Array.from(e.childNodes).some(e=>e.nodeType===1||!!e.nodeValue?.trim()))throw new Y(`<br> must not contain content.`)}function di(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 Y(`Unsupported <${t.tagName}> inside text-only <${e.tagName}>.`);t.tagName===`br`?(ui(t),n.push(``)):r(t)}}return r(e),n.map(e=>t?Br(e):Z(e)).join(`
21
+ `)}function fi(e){let t=e.split(`/`).pop()||``;if(!t.includes(`_`)||!t.includes(`.`))throw new Y(`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 pi(e,t,n){if(n<=0)throw new Y(`Complex tables must contain at least one column.`);let r;if(!e||!e.trim()){if(!t)throw new Y(`Complex tables require a chapter size to derive default widths.`);let e=Nr[t];if(e==null)throw new Y(`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 Y(`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 Y(`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 Y(`Table column ${e+1} width ${t} must be a positive number.`)}return r}function mi(e,t){let n=Number.parseInt(e,10);if(!Number.isInteger(n))throw new Y(`Expected integer for ${t}.`);if(n<1)throw new Y(`Expected positive integer for ${t}.`);return n}var hi=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 gi={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}}},_i=/* @__PURE__ */ new Map,vi=new hi,yi=new Map(gi.roots.map(e=>[e.name,e]));function bi(e){return Object.hasOwn(gi.complexTypes,e)?gi.complexTypes[e]:void 0}function xi(e){return Object.hasOwn(gi.simpleTypes,e)?gi.simpleTypes[e]:{base:e===`xs:token`?`token`:`string`}}function Si(e){let t=bi(e)?.content;if(!t)return vi;let n=_i.get(e);return n||(n=new hi(t),_i.set(e,n)),n}function Ci(e){if(e.namespace||!e.name.name)return;if(!e.parent)return yi.get(e.name.name);let t=Ci(e.parent);return t?Si(t.type).members.get(e.name.name):void 0}function wi(e,t){return t.base===`token`?e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``):e}function Ti(e,t){return(t.values===void 0||t.values.includes(e))&&(t.minLength===void 0||Array.from(e).length>=t.minLength)}function Ei(e){return e.fixed===void 0?xi(e.type).values??[]:[e.fixed]}function Di(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=bi(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=xi(i.type),a=wi(t.decoded,e);if(!Ti(a,e)||i.fixed!==void 0&&a!==wi(i.fixed,e)){let e=Ei(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=Si(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:Un(n)}];default:return[]}});if(o&&!o.mixed&&!o.text){let t=f.find(e=>Bn(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=xi(o?.text??a.type);(t.values||t.minLength)&&(Ti(wi(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&&yi.get(e);n?i(t,n):t.complete&&e&&r(`unexpected-root`,t.name,`Expected the unqualified root <${gi.roots[0]?.name}>.`)}}function Oi(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 ki(e){try{return new rr.DOMParser({onError(){throw Error(`Malformed XML`)}}).parseFromString(e,`application/xml`),!0}catch{return!1}}function Ai(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&&!ki(e)&&r.push({source:`syntax`,code:`strict-xml`,span:i,message:`The document fails strict XML parsing.`}),Di(t,e,r),r.length||!t.roots.length))return r;let a=Oi(n());if(a)return[{source:`semantic`,code:`table-resource-limit`,span:a,severity:me.Warning,message:`Skipped conversion validation because the expanded table exceeds the analysis budget.`}];try{let[,t]=Wr(e);for(let e of t.slice(0,100))r.push({source:`semantic`,code:`converter-warning`,message:e,span:i,severity:me.Warning})}catch(e){if(!(e instanceof Y))throw e;r.push({source:`semantic`,code:`conversion-error`,message:e.message,span:i})}return r}var ji=class{document;fragments=[];syntaxTree;projection;cachedElements;cachedIssues;constructor({uri:e,version:t,text:n}){this.document=P.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=j.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=j.applyChanges(this.fragments,[{fromA:t,toA:r,fromB:t,toB:t+n.text.length}]),P.update(this.document,[{range:n.range,text:n.text}],e)}else this.fragments=[],P.update(this.document,[{text:n.text}],e);return t.length||P.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=Wn(this.text,this.fragments),this.fragments=[],Jn(this.text,this.syntaxTree)),this.projection}get elements(){return this.cachedElements??=Yn(this.analysis.roots)}get issues(){return this.cachedIssues??=Ai(this.text,this.analysis,()=>this.elements)}offset(e){return this.document.offsetAt(e)}position(e){return this.document.positionAt(e)}range(e){return V.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}};function Mi(e,t){return{range:e.range(t.span),message:t.message,code:t.code,source:`skland-xml/`+t.source,severity:t.severity??me.Error,...t.related&&{relatedInformation:[{location:{uri:e.uri,range:e.range(t.related.span)},message:t.related.message}]}}}function Ni(e,t){return e.from<=t.to&&t.from<=e.to}function Pi(e,t){return{from:e.offset(t.start),to:e.offset(t.end)}}function Fi(e,t,n){if(e.issues.some(e=>e.source!==`semantic`))return[];let{text:r}=e,i=/\r\n|[\r\n]/.exec(r)?.[0]??`
22
+ `,a=Math.min(16,Math.max(1,t.tabSize||1)),o=t.insertSpaces?` `.repeat(a):` `,s=[],c=n&&Pi(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(Bn(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
23
+ `&&d--,f>0&&l.slice(l.length-f-1,l.length-f+1)===`\r
24
+ `&&f--,s.push(ye.replace(e.range({from:t+d,to:n-f}),u.slice(d,u.length-f)))}function u(e,t){let n=Ci(e),r=n&&bi(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 Ii(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:qe.Object,range:e.range(n.span),selectionRange:e.range(n.name),children:n.children.flatMap(t)}]}return e.analysis.roots.flatMap(t)}function Li(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 Ri(e,t){let n=e.offset(t),r=e.elementAt(n,!0),i=r?.close;return!r?.name.name||!i?.complete?null:Ni(r.name,{from:n,to:n})||Ni(i.name,{from:n,to:n})?{ranges:[e.range(r.name),e.range(i.name)]}:null}function zi(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 Bi(e){let t=[];for(let n of e.elements){if(!Ci(n))continue;for(let r of n.attributes){if(![`href`,`src`].includes(r.name.name)||!r.closed||!r.value)continue;let n=zi(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=zi(Un(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 Vi(e,t,n){let r=Pi(e,t),i=[];for(let t of e.issues){if(!t.fix||!Ni(r,t.span))continue;let a=Mi(e,t);if(!n.find(n=>n.source===a.source&&n.code===a.code&&Pi(e,n.range).from===t.span.from&&Pi(e,n.range).to===t.span.to))continue;let o={title:t.fix.title,kind:Qe.QuickFix,diagnostics:[a],edit:{documentChanges:[{textDocument:{uri:e.uri,version:e.version},edits:[ye.replace(e.range(t.fix.span),t.fix.text)]}]}};i.push(o)}return i}function Hi(e,t){return e.from<=t&&t<=e.to}function Ui(e,t,n){if(!e)return gi.roots;let r=Ci(e);if(!r)return[];let i=Si(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 Wi(e,t,n,r,i,a,o){return{label:n,kind:i,textEdit:ye.replace(e.range(t),r),...a&&{documentation:a},...o&&{insertTextFormat:Pe.Snippet}}}function Gi(e){return e.fixed??e.default??``}function Ki(e,t){return e.replaceAll(`&`,`&amp;`).replaceAll(`<`,`&lt;`).replaceAll(t,t===`"`?`&quot;`:`&apos;`)}const qi=e=>e.replace(/[\\$}]/g,`\\$&`);function Ji(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(Wi(e,{from:t,to:n},i,i+(/^[\t\r\n ]*>/.test(u)?``:`>`),Ne.Property)),l?.span.from===t-2&&l.complete))break}return o}let u=s&&Hi(s.open,r)&&(!s.complete||r<s.open.to);if(u&&s&&(Hi(s.name,r)||!s.name.name)){let t=s.attributes.length>0;for(let r of Ui(s.parent,s,s.span.from)){let i=bi(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)+`:`+qi(Ki(Gi(e),`"`))+`}"`).join(``):r.name;a.push(Wi(e,s.name,r.name,c,Ne.Property,r.documentation,o))}return o}if(u&&s){let t=Ci(s),i=t&&bi(t.type);if(!i)return o;let c=s.attributes.find(e=>Hi(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 Ei(t)){let i=Ki(r,c.quote??`"`),o=c.quote?i+(c.closed?``:c.quote):`"`+i+`"`;a.push(Wi(e,n,r||`""`,o,Ne.Value,t.documentation))}return o}let l=c&&Hi(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=Ki(Gi(t),`"`),i=!!n.snippets&&c?.equals===void 0,o=c?.equals===void 0?i?t.name+'="${1:'+qi(r)+`}"`:t.name+`="`+r+`"`:t.name;a.push(Wi(e,l,t.name,o,Ne.Field,t.documentation,i))}return o}if(s?.close&&Hi(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 Ui(d,void 0,r))a.push(Wi(e,{from:r,to:r},t.name,`<`+t.name,Ne.Property,t.documentation));return o}function Yi(e,t,n){let r=e.offset(t),i=e.elementAt(r,!0);if(!i)return null;let a=Ci(i);if(!a)return null;let o=bi(a.type),s=i.attributes.find(e=>Hi(e.name,r)||e.value&&Hi(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=xi(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&&Hi(s.value,r)?s.value:s.name),contents:{kind:c?je.Markdown:je.PlainText,value:i.filter(Boolean).join(`
25
+
26
+ `)}}}let d=i.close&&Hi(i.close.name,r)?i.close.name:i.name;if(!Hi(d,r))return null;let f=[...Si(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:gi.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 `+gi.version];return{range:e.range(d),contents:{kind:c?je.Markdown:je.PlainText,value:m.filter(Boolean).join(`
27
+
28
+ `)}}}Object.freeze({version:gi.version,hash:gi.hash,source:gi.source});function Xi(){let e=/* @__PURE__ */ new Map;return{openDocument(t){return!e.has(t.uri)&&(e.set(t.uri,new ji(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=>Mi(n,e)):[]},completion(t,n,r={}){let i=e.get(t);return i?Ji(i,n,r):{isIncomplete:!1,items:[]}},hover(t,n,r={}){let i=e.get(t);return i?Yi(i,n,r):null},formatting(t,n,r){let i=e.get(t);return i?Fi(i,n,r):[]},documentSymbols(t){let n=e.get(t);return n?Ii(n):[]},foldingRanges(t,n=!1){let r=e.get(t);return r?Li(r,n):[]},linkedEditing(t,n){let r=e.get(t);return r?Ri(r,n):null},documentLinks(t){let n=e.get(t);return n?Bi(n):[]},codeActions(t,n,r){let i=e.get(t);return i?Vi(i,n,r):[]},dispose:()=>e.clear()}}function Zi(e,t,n){return e.flatMap(e=>[{name:e.name,kind:e.kind,location:{uri:t,range:e.range},...n&&{containerName:n}},...Zi(e.children??[],t,e.name)])}function Qi(n,r={}){let i=Xi(),a=/* @__PURE__ */ new Map,o=/* @__PURE__ */ new Map,s=`created`,c=()=>s===`stopped`,l={snippets:!1,hoverMarkdown:!1,relatedDiagnostics:!1,diagnosticVersions:!1,hierarchicalSymbols:!1,lineOnlyFolding:!1,codeActions:!1,versionedEdits:!1},u=()=>{s=`stopped`;for(let e of a.values())clearTimeout(e);a.clear(),i.dispose(),o.clear()};function d(e){let t=a.get(e);t!==void 0&&clearTimeout(t),a.delete(e)}function f(e,t,r){n.sendDiagnostics({uri:e,diagnostics:l.relatedDiagnostics?r:r.map(e=>{let t={...e};return delete t.relatedInformation,t}),...l.diagnosticVersions&&t!==void 0&&{version:t}}).catch(()=>void 0)}function p(e,t){d(e),a.set(e,setTimeout(()=>{if(a.delete(e),s===`running`&&i.getVersion(e)===t)try{f(e,t,i.diagnostics(e))}catch{n.console.error(`SKLand XML diagnostics failed unexpectedly.`)}},r.diagnosticDelayMs??200))}async function m(n,r,a){if(s===`created`||s===`initializing`)throw new t(-32002,`Server not initialized`);if(s===`stopped`)throw new t(e.InvalidRequest,`Server has shut down`);let l=i.getVersion(n),u=o.get(n);if(await new Promise(e=>setTimeout(e,0)),r.isCancellationRequested)throw new t(-32800,`Request cancelled`);if(c())throw new t(e.InvalidRequest,`Server has shut down`);if(l!==i.getVersion(n)||u!==o.get(n))throw new t(-32801,`Document changed`);try{return a()}catch{throw new t(e.InternalError,`SKLand XML analysis failed`)}}return n.onInitialize(({capabilities:n})=>{if(s!==`created`)throw new t(e.InvalidRequest,`Already initialized`);s=`initializing`;let r=n.textDocument;return l={snippets:!!r?.completion?.completionItem?.snippetSupport,hoverMarkdown:r?.hover?.contentFormat?.[0]===`markdown`,relatedDiagnostics:!!r?.publishDiagnostics?.relatedInformation,diagnosticVersions:!!r?.publishDiagnostics?.versionSupport,hierarchicalSymbols:!!r?.documentSymbol?.hierarchicalDocumentSymbolSupport,lineOnlyFolding:!!r?.foldingRange?.lineFoldingOnly,codeActions:!!r?.codeAction?.codeActionLiteralSupport,versionedEdits:!!n.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},...l.codeActions&&{codeActionProvider:{codeActionKinds:[`quickfix`]}}}}}),n.onInitialized(()=>{s===`initializing`&&(s=`running`)}),n.onDidOpenTextDocument(({textDocument:e})=>{if(s!==`running`)return;let{uri:t,version:n}=e;i.openDocument(e)&&(o.set(t,{}),p(t,n))}),n.onDidChangeTextDocument(({textDocument:{uri:e,version:t},contentChanges:n})=>{s===`running`&&i.updateDocument(e,t,n)&&p(e,t)}),n.onDidCloseTextDocument(({textDocument:{uri:e}})=>{if(s!==`running`)return;let t=i.closeDocument(e);o.delete(e),d(e),t&&f(e,void 0,[])}),n.onCompletion(({textDocument:{uri:e},position:t},n)=>m(e,n,()=>i.completion(e,t,{snippets:l.snippets}))),n.onHover(({textDocument:{uri:e},position:t},n)=>m(e,n,()=>i.hover(e,t,{markdown:l.hoverMarkdown}))),n.onDocumentFormatting(({textDocument:{uri:e},options:t},n)=>m(e,n,()=>i.formatting(e,t))),n.onDocumentRangeFormatting(({textDocument:{uri:e},range:t,options:n},r)=>m(e,r,()=>i.formatting(e,n,t))),n.onDocumentSymbol(({textDocument:{uri:e}},t)=>m(e,t,()=>{let t=i.documentSymbols(e);return l.hierarchicalSymbols?t:Zi(t,e)})),n.onFoldingRanges(({textDocument:{uri:e}},t)=>m(e,t,()=>i.foldingRanges(e,l.lineOnlyFolding))),n.onDocumentLinks(({textDocument:{uri:e}},t)=>m(e,t,()=>i.documentLinks(e))),n.onRequest(`textDocument/linkedEditingRange`,({textDocument:{uri:e},position:t},n)=>m(e,n,()=>i.linkedEditing(e,t))),n.onCodeAction(({textDocument:{uri:e},range:t,context:n},r)=>m(e,r,()=>{if(!l.codeActions||n.only&&!n.only.includes(`quickfix`))return[];let r=i.codeActions(e,t,n.diagnostics);return l.versionedEdits?r:r.map(t=>{let n=t.edit?.documentChanges?.[0];return n&&`edits`in n?{...t,edit:{changes:{[e]:n.edits}}}:t})})),n.onShutdown(u),n.onExit(()=>{u(),r.onExit?.()}),{dispose:u}}export{Qi as registerServer};