@adia-ai/web-modules 0.8.6 → 0.8.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog — @adia-ai/web-modules
2
2
 
3
+ ## [0.8.8] — 2026-07-19
4
+
5
+ ### Maintenance
6
+ - **README CDN pins un-drifted**: `@0.7` → `@0.8` (9 pins across the install/CDN examples) — they had shipped a full minor stale for the entire 0.8 line (caught by the newly-wired repo cut-hygiene gate). No source change; the type-scale change this cycle lives in `@adia-ai/web-components` (`styles/type/roles.css`) and flows through the tokens web-modules composites consume.
7
+
8
+ ## [0.8.7] — 2026-07-19
9
+
10
+ ### Changed
11
+ - **`dist/chat/chat-shell.min.js`, `dist/everything.min.js` rebuilt** (`npm run build:bundle-js`) — both had drifted stale relative to source; regenerated as part of 0.8.7 release pre-flight. No source change.
12
+
3
13
  ## [0.8.6] — 2026-07-18
4
14
 
5
15
  ### Maintenance
package/README.md CHANGED
@@ -19,11 +19,11 @@ Since **v0.6.30**, both this package and `@adia-ai/web-components` ship pre-flat
19
19
 
20
20
  ```html
21
21
  <!-- CSS: all primitives + the shell tier you use -->
22
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@adia-ai/web-components@0.7/dist/web-components.min.css">
23
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@adia-ai/web-modules@0.7/dist/shell/admin-shell.min.css">
22
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@adia-ai/web-components@0.8/dist/web-components.min.css">
23
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@adia-ai/web-modules@0.8/dist/shell/admin-shell.min.css">
24
24
 
25
25
  <!-- JS: everything in one bundle (primitives + all 4 shells + a2ui-runtime; ~190 KB gzipped) -->
26
- <script type="module" src="https://cdn.jsdelivr.net/npm/@adia-ai/web-modules@0.7/dist/everything.min.js"></script>
26
+ <script type="module" src="https://cdn.jsdelivr.net/npm/@adia-ai/web-modules@0.8/dist/everything.min.js"></script>
27
27
 
28
28
  <admin-shell mode="rounded borderless">
29
29
  <admin-sidebar slot="leading" resizable collapsible>
@@ -81,8 +81,8 @@ Since **v0.6.30**, both this package and `@adia-ai/web-components` ship pre-flat
81
81
  **Per-shell setup (advanced — only one shell tier loaded):**
82
82
 
83
83
  ```html
84
- <script type="module" src="https://cdn.jsdelivr.net/npm/@adia-ai/web-components@0.7/dist/web-components.min.js"></script>
85
- <script type="module" src="https://cdn.jsdelivr.net/npm/@adia-ai/web-modules@0.7/dist/shell/admin-shell.min.js"></script>
84
+ <script type="module" src="https://cdn.jsdelivr.net/npm/@adia-ai/web-components@0.8/dist/web-components.min.js"></script>
85
+ <script type="module" src="https://cdn.jsdelivr.net/npm/@adia-ai/web-modules@0.8/dist/shell/admin-shell.min.js"></script>
86
86
  ```
87
87
 
88
88
  | Bundle | Path | Gzipped | Contents | When to use |
@@ -96,10 +96,10 @@ Since **v0.6.30**, both this package and `@adia-ai/web-components` ship pre-flat
96
96
  **Each shell needs its matching CSS** (the kitchen-sink example above loads only `admin-shell.min.css`). Mirror the JS path — swap the shell tier:
97
97
 
98
98
  ```html
99
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@adia-ai/web-modules@0.7/dist/shell/admin-shell.min.css">
100
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@adia-ai/web-modules@0.7/dist/chat/chat-shell.min.css">
101
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@adia-ai/web-modules@0.7/dist/editor/editor-shell.min.css">
102
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@adia-ai/web-modules@0.7/dist/simple/simple-shell.min.css">
99
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@adia-ai/web-modules@0.8/dist/shell/admin-shell.min.css">
100
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@adia-ai/web-modules@0.8/dist/chat/chat-shell.min.css">
101
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@adia-ai/web-modules@0.8/dist/editor/editor-shell.min.css">
102
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@adia-ai/web-modules@0.8/dist/simple/simple-shell.min.css">
103
103
  ```
104
104
 
105
105
  The `@0.7` range tracks the latest `0.6.x` patch (won't jump to a breaking `0.8`); pin an exact version (e.g. `@0.7.13`) for reproducible builds.
@@ -1,4 +1,4 @@
1
- var HS=Object.defineProperty;var N=(i,e)=>()=>(i&&(e=i(i=0)),e);var Si=(i,e)=>{for(var t in e)HS(i,t,{get:e[t],enumerable:!0})};async function*hn(i){let e=i.getReader(),t=new TextDecoder,n="";try{for(;;){let{done:r,value:s}=await e.read();if(r)break;n+=t.decode(s,{stream:!0});let{events:o,remainder:l}=id(n);n=l;for(let a of o)yield a}if(n.trim()){let{events:r}=id(n+`
1
+ var HS=Object.defineProperty;var N=(i,e,t)=>()=>{if(t)throw t[0];try{return i&&(e=i(i=0)),e}catch(n){throw t=[n],n}};var Si=(i,e)=>{for(var t in e)HS(i,t,{get:e[t],enumerable:!0})};async function*hn(i){let e=i.getReader(),t=new TextDecoder,n="";try{for(;;){let{done:r,value:s}=await e.read();if(r)break;n+=t.decode(s,{stream:!0});let{events:o,remainder:l}=id(n);n=l;for(let a of o)yield a}if(n.trim()){let{events:r}=id(n+`
2
2
 
3
3
  `);for(let s of r)yield s}}finally{e.releaseLock()}}function id(i){let e=[],t=i.split(/\n\n|\r\n\r\n/),n=t.pop()??"";for(let r of t){let s=r.trim();if(!s)continue;let o,l=[];for(let h of s.split(/\r?\n/))if(!h.startsWith(":")){if(h.startsWith("event:"))o=h.slice(6).trim();else if(h.startsWith("data:")){let c=h.slice(5);l.push(c.startsWith(" ")?c.slice(1):c)}}if(!l.length)continue;let a=l.join(`
4
4
  `);e.push({event:o,data:a,done:a==="[DONE]"})}return{events:e,remainder:n}}var hs=N(()=>{"use strict"});var my,gy,by,Gl,nd=N(()=>{"use strict";hs();my="https://api.anthropic.com/v1/messages",gy="2023-06-01",by=32768,Gl={name:"anthropic",buildRequest(i){let e={model:i.model,max_tokens:i.maxTokens??by,messages:i.messages,stream:!!i.stream};return i.system!=null&&(e.system=i.cache?[{type:"text",text:i.system,cache_control:{type:"ephemeral"}}]:i.system),i.temperature!=null&&(e.temperature=i.temperature),i.thinking&&(e.thinking={type:"enabled",budget_tokens:i.thinkingBudget??1e4}),{url:my,headers:{"content-type":"application/json","x-api-key":i.apiKey,"anthropic-version":gy},body:e}},parseResponse(i){return{text:i.content?.find(t=>t.type==="text")?.text??"",usage:{input:i.usage?.input_tokens??0,output:i.usage?.output_tokens??0,cacheCreation:i.usage?.cache_creation_input_tokens??0,cacheRead:i.usage?.cache_read_input_tokens??0},stopReason:i.stop_reason??"end"}},async*parseStream(i){if(!i.body)throw new Error("Response body is null");let e="",t={input:0,output:0,cacheCreation:0,cacheRead:0},n="end";for await(let r of hn(i.body)){if(r.done)break;let s;try{s=JSON.parse(r.data)}catch{continue}switch(r.event??s.type){case"message_start":s.message?.usage&&(t.input=s.message.usage.input_tokens??0,t.cacheCreation=s.message.usage.cache_creation_input_tokens??0,t.cacheRead=s.message.usage.cache_read_input_tokens??0);break;case"content_block_delta":{let l=s.delta;l?.type==="text_delta"&&l.text!=null?(e+=l.text,yield{type:"text",text:l.text,snapshot:e}):l?.type==="thinking_delta"&&l.thinking!=null&&(yield{type:"thinking",text:l.thinking});break}case"message_delta":s.delta?.stop_reason&&(n=s.delta.stop_reason),s.usage&&(t.output=s.usage.output_tokens??0);break;case"message_stop":yield{type:"done",text:e,usage:t,stopReason:n};break;case"error":yield{type:"error",error:new Error(s.error?.message??"Stream error")};break}}}}});var Sy,Ul,rd=N(()=>{"use strict";hs();Sy="https://api.openai.com/v1/chat/completions",Ul={name:"openai",buildRequest(i){let e=[];i.system&&e.push({role:"system",content:i.system});for(let n of i.messages)e.push({role:n.role,content:n.content});let t={model:i.model,messages:e,stream:!!i.stream};return i.maxTokens&&(t.max_tokens=i.maxTokens),i.temperature!=null&&(t.temperature=i.temperature),i.stream&&(t.stream_options={include_usage:!0}),{url:Sy,headers:{"content-type":"application/json",authorization:`Bearer ${i.apiKey}`},body:t}},parseResponse(i){let e=i.choices?.[0];return{text:e?.message?.content??"",usage:{input:i.usage?.prompt_tokens??0,output:i.usage?.completion_tokens??0},stopReason:e?.finish_reason==="stop"?"end":e?.finish_reason??"end"}},async*parseStream(i){if(!i.body)throw new Error("Response body is null");let e="",t={input:0,output:0},n="end";for await(let r of hn(i.body)){if(r.done)break;let s;try{s=JSON.parse(r.data)}catch{continue}s.usage&&(t.input=s.usage.prompt_tokens??0,t.output=s.usage.completion_tokens??0);let o=s.choices?.[0];if(!o)continue;o.finish_reason&&(n=o.finish_reason==="stop"?"end":o.finish_reason);let l=o.delta;l?.content&&(e+=l.content,yield{type:"text",text:l.content,snapshot:e}),l?.reasoning_content&&(yield{type:"thinking",text:l.reasoning_content})}yield{type:"done",text:e,usage:t,stopReason:n}}}});var yy,Qy,Fl,sd=N(()=>{"use strict";hs();yy="https://generativelanguage.googleapis.com/v1beta/models",Qy=32768,Fl={name:"gemini",buildRequest(i){let e=i.model,n={contents:i.messages.map(o=>({role:o.role==="assistant"?"model":"user",parts:[{text:o.content}]}))};i.system!=null&&(n.systemInstruction={parts:[{text:i.system}]});let r={maxOutputTokens:i.maxTokens??Qy};i.temperature!=null&&(r.temperature=i.temperature),n.generationConfig=r;let s=i.stream?"streamGenerateContent?alt=sse":"generateContent";return{url:`${yy}/${e}:${s}`,headers:{"content-type":"application/json","x-goog-api-key":i.apiKey},body:n}},parseResponse(i){return{text:(i.candidates?.[0]?.content?.parts??[]).map(n=>n.text??"").join(""),usage:{input:i.usageMetadata?.promptTokenCount??0,output:i.usageMetadata?.candidatesTokenCount??0},stopReason:i.candidates?.[0]?.finishReason??"end"}},async*parseStream(i){if(!i.body)throw new Error("Response body is null");let e="",t={input:0,output:0},n="end";for await(let r of hn(i.body)){if(r.done)break;let s;try{s=JSON.parse(r.data)}catch{continue}s.usageMetadata&&(t.input=s.usageMetadata.promptTokenCount??0,t.output=s.usageMetadata.candidatesTokenCount??0);let o=s.candidates?.[0];if(!o)continue;o.finishReason&&(n=o.finishReason);let l=o.content?.parts;if(l?.length)for(let a of l)a.text!=null&&(e+=a.text,yield{type:"text",text:a.text,snapshot:e})}yield{type:"done",text:e,usage:t,stopReason:n}}}});function VT(i){return Hl(i)}function Hl(i){if(!i)return null;let e=i.toLowerCase();return e.includes("claude")||e.startsWith("anthropic/")?"anthropic":e.includes("gpt")||e.includes("o1")||e.includes("o3")||e.includes("o4")||e.startsWith("openai/")?"openai":e.includes("gemini")||e.startsWith("google/")?"gemini":null}function Kl(i){let e=i.provider||Hl(i.model);if(!e)throw new Error(`Cannot detect provider for model "${i.model}". Set provider explicitly.`);let t=od[e];if(!t)throw new Error(`Unknown provider "${e}". Available: ${Object.keys(od).join(", ")}`);return t}function ld(i){return typeof i=="string"&&xy.test(i)}function ad(i,e){let n={provider:i.provider||Hl(i.model),model:i.model,messages:i.messages,stream:e};return i.system!=null&&(n.system=i.system),i.maxTokens!=null&&(n.maxTokens=i.maxTokens),i.temperature!=null&&(n.temperature=i.temperature),i.thinking!=null&&(n.thinking=i.thinking),{url:i.proxyUrl,headers:{"content-type":"application/json"},body:n}}function hd(i,e){let n=Kl(i).buildRequest({...i,stream:e}),r=i.proxyUrl.match(/^.*?\/api\/llm\/[a-z]+/)?.[0]??i.proxyUrl,s=new URL(n.url);return{...n,url:`${r}${s.pathname}${s.search}`}}async function cd(i){let e=Kl(i),{url:t,headers:n,body:r}=i.proxyUrl?ld(i.proxyUrl)?hd(i,!1):ad(i,!1):e.buildRequest({...i,stream:!1}),s=await fetch(t,{method:"POST",headers:n,body:JSON.stringify(r),signal:i.signal??null});if(!s.ok){let o=await s.json().catch(()=>({}));throw new Error(o?.error?.message||`${e.name} API error ${s.status}`)}return e.parseResponse(await s.json())}async function*cs(i){let e=Kl(i),{url:t,headers:n,body:r}=i.proxyUrl?ld(i.proxyUrl)?hd(i,!0):ad(i,!0):e.buildRequest({...i,stream:!0}),s;try{s=await fetch(t,{method:"POST",headers:n,body:JSON.stringify(r),signal:i.signal??null})}catch(o){yield{type:"error",error:o};return}if(!s.ok){let o=await s.json().catch(()=>({}));yield{type:"error",error:new Error(o?.error?.message||`${e.name} API error ${s.status}`)};return}yield*e.parseStream(s)}function ky(i={}){return{chat:e=>cd({...i,...e}),stream:e=>cs({...i,...e})}}var od,xy,fd=N(()=>{"use strict";nd();rd();sd();od={anthropic:Gl,openai:Ul,gemini:Fl};xy=/\/api\/llm\/[a-z]+(\/|$)/});function Od(i,e,t,n){switch(i){case-2:return t<e;case-1:return n>=e&&t<e;case 0:return t<e&&n>e;case 1:return t<=e&&n>e;case 2:return n>e;case 4:return!0}}function Gn(i,e,t,n){for(var r;i.from==i.to||(t<1?i.from>=e:i.from>e)||(t>-1?i.to<=e:i.to<e);){let o=!n&&i instanceof je&&i.index<0?null:i.parent;if(!o)return i;i=o}let s=n?0:W.IgnoreOverlays;if(n)for(let o=i,l=o.parent;l;o=l,l=o.parent)o instanceof je&&o.index<0&&((r=l.enter(e,t,s))===null||r===void 0?void 0:r.from)!=o.from&&(i=l);for(;;){let o=i.enter(e,t,s);if(!o)return i;i=o}}function pd(i,e,t,n){let r=i.cursor(),s=[];if(!r.firstChild())return s;if(t!=null){for(let o=!1;!o;)if(o=r.type.is(t),!r.nextSibling())return s}for(;;){if(n!=null&&r.type.is(n))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return n==null?s:[]}}function ea(i,e,t=e.length-1){for(let n=i;t>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[t]&&e[t]!=n.name)return!1;t--}}return!0}function md(i){if(!i.length)return null;let e=0,t=i[0];for(let s=1;s<i.length;s++){let o=i[s];(o.from>t.from||o.to<t.to)&&(t=o,e=s)}let n=t instanceof je&&t.index<0?null:t.parent,r=i.slice();return n?r[e]=n:r.splice(e,1),new ia(r,t)}function $y(i,e,t){let n=i.resolveInner(e,t),r=null;for(let s=n instanceof je?n:n.context.parent;s;s=s.parent)if(s.index<0){let o=s.parent;(r||(r=[n])).push(o.resolve(e,t)),s=o}else{let o=Et.get(s.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let l=new je(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[n])).push(Gn(l,e,t,!1))}}return r?md(r):n}function na(i){return i.children.some(e=>e instanceof Lt||!e.type.isAnonymous||na(e))}function vy(i){var e;let{buffer:t,nodeSet:n,maxBufferLength:r=1024,reused:s=[],minRepeatType:o=n.types.length}=i,l=Array.isArray(t)?new Jl(t,t.length):t,a=n.types,h=0,c=0;function f(x,k,w,E,_,G){let{id:D,start:L,end:U,size:I}=l,ee=c,Te=h;if(I<0)if(l.next(),I==-1){let Mt=s[D];w.push(Mt),E.push(L-x);return}else if(I==-3){h=D;return}else if(I==-4){c=D;return}else throw new RangeError(`Unrecognized record size: ${I}`);let Ne=a[D],mt,be,tt=L-x;if(U-L<=r&&(be=g(l.pos-k,_))){let Mt=new Uint16Array(be.size-be.skip),it=l.pos-be.size,gt=Mt.length;for(;l.pos>it;)gt=b(be.start,Mt,gt);mt=new Lt(Mt,U-be.start,n),tt=be.start-x}else{let Mt=l.pos-I;l.next();let it=[],gt=[],bi=D>=o?D:-1,rn=0,is=U;for(;l.pos>Mt;)bi>=0&&l.id==bi&&l.size>=0?(l.end<=is-r&&(O(it,gt,L,rn,l.end,is,bi,ee,Te),rn=it.length,is=l.end),l.next()):G>2500?u(L,Mt,it,gt):f(L,Mt,it,gt,bi,G+1);if(bi>=0&&rn>0&&rn<it.length&&O(it,gt,L,rn,L,is,bi,ee,Te),it.reverse(),gt.reverse(),bi>-1&&rn>0){let Yu=d(Ne,Te);mt=ra(Ne,it,gt,0,it.length,0,U-L,Yu,Yu)}else mt=m(Ne,it,gt,U-L,ee-U,Te)}w.push(mt),E.push(tt)}function u(x,k,w,E){let _=[],G=0,D=-1;for(;l.pos>k;){let{id:L,start:U,end:I,size:ee}=l;if(ee>4)l.next();else{if(D>-1&&U<D)break;D<0&&(D=I-r),_.push(L,U,I),G++,l.next()}}if(G){let L=new Uint16Array(G*4),U=_[_.length-2];for(let I=_.length-3,ee=0;I>=0;I-=3)L[ee++]=_[I],L[ee++]=_[I+1]-U,L[ee++]=_[I+2]-U,L[ee++]=ee;w.push(new Lt(L,_[2]-U,n)),E.push(U-x)}}function d(x,k){return(w,E,_)=>{let G=0,D=w.length-1,L,U;if(D>=0&&(L=w[D])instanceof j){if(!D&&L.type==x&&L.length==_)return L;(U=L.prop(R.lookAhead))&&(G=E[D]+L.length+U)}return m(x,w,E,_,G,k)}}function O(x,k,w,E,_,G,D,L,U){let I=[],ee=[];for(;x.length>E;)I.push(x.pop()),ee.push(k.pop()+w-_);x.push(m(n.types[D],I,ee,G-_,L-G,U)),k.push(_-w)}function m(x,k,w,E,_,G,D){if(G){let L=[R.contextHash,G];D=D?[L].concat(D):[L]}if(_>25){let L=[R.lookAhead,_];D=D?[L].concat(D):[L]}return new j(x,k,w,E,D)}function g(x,k){let w=l.fork(),E=0,_=0,G=0,D=w.end-r,L={size:0,start:0,skip:0};e:for(let U=w.pos-x;w.pos>U;){let I=w.size;if(w.id==k&&I>=0){L.size=E,L.start=_,L.skip=G,G+=4,E+=4,w.next();continue}let ee=w.pos-I;if(I<0||ee<U||w.start<D)break;let Te=w.id>=o?4:0,Ne=w.start;for(w.next();w.pos>ee;){if(w.size<0)if(w.size==-3||w.size==-4)Te+=4;else break e;else w.id>=o&&(Te+=4);w.next()}_=Ne,E+=I,G+=Te}return(k<0||E==x)&&(L.size=E,L.start=_,L.skip=G),L.size>4?L:void 0}function b(x,k,w){let{id:E,start:_,end:G,size:D}=l;if(l.next(),D>=0&&E<o){let L=w;if(D>4){let U=l.pos-(D-4);for(;l.pos>U;)w=b(x,k,w)}k[--w]=L,k[--w]=G-x,k[--w]=_-x,k[--w]=E}else D==-3?h=E:D==-4&&(c=E);return w}let S=[],y=[];for(;l.pos>0;)f(i.start||0,i.bufferStart||0,S,y,-1,0);let C=(e=i.length)!==null&&e!==void 0?e:S.length?y[0]+S[0].length:0;return new j(a[i.topID],S.reverse(),y.reverse(),C)}function ds(i,e){if(!i.isAnonymous||e instanceof Lt||e.type!=i)return 1;let t=gd.get(e);if(t==null){t=1;for(let n of e.children){if(n.type!=i||!(n instanceof j)){t=1;break}t+=ds(i,n)}gd.set(e,t)}return t}function ra(i,e,t,n,r,s,o,l,a){let h=0;for(let O=n;O<r;O++)h+=ds(i,e[O]);let c=Math.ceil(h*1.5/8),f=[],u=[];function d(O,m,g,b,S){for(let y=g;y<b;){let C=y,x=m[y],k=ds(i,O[y]);for(y++;y<b;y++){let w=ds(i,O[y]);if(k+w>=c)break;k+=w}if(y==C+1){if(k>c){let w=O[C];d(w.children,w.positions,0,w.children.length,m[C]+S);continue}f.push(O[C])}else{let w=m[y-1]+O[y-1].length-x;f.push(ra(i,O,m,C,y,x,w,null,a))}u.push(x+S-s)}}return d(e,t,n,r,0),(l||a)(f,u,o)}function Pi(i){return(e,t,n,r)=>new aa(e,i,t,n,r)}function bd(i){if(!i.length||i.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(i))}function Ty(i,e,t){for(let n of i){if(n.from>=t)break;if(n.to>e)return n.from<=e&&n.to>=t?2:1}return 0}function Sd(i,e,t,n,r,s){if(e<t){let o=i.buffer[e+1];n.push(i.slice(e,t,o)),r.push(o-s)}}function Cy(i){let{node:e}=i,t=[],n=e.context.buffer;do t.push(i.index),i.parent();while(!i.tree);let r=i.tree,s=r.children.indexOf(n),o=r.children[s],l=o.buffer,a=[s];function h(c,f,u,d,O,m){let g=t[m],b=[],S=[];Sd(o,c,g,b,S,d);let y=l[g+1],C=l[g+2];a.push(b.length);let x=m?h(g+4,l[g+3],o.set.types[l[g]],y,C-y,m-1):e.toTree();return b.push(x),S.push(y-d),Sd(o,l[g+3],f,b,S,d),new j(u,b,S,O)}r.children[s]=h(0,l.length,te.none,0,o.length,t.length-1);for(let c of a){let f=i.tree.children[c],u=i.tree.positions[c];i.yield(new je(f,u+i.from,c,i._tree))}}function yd(i,e){let t=null,n=e;for(let r=1,s=0;r<i.length;r++){let o=i[r-1].to,l=i[r].from;for(;s<n.length;s++){let a=n[s];if(a.from>=l)break;a.to<=o||(t||(n=t=e.slice()),a.from<o?(t[s]=new _e(a.from,o),a.to>l&&t.splice(s+1,0,new _e(l,a.to))):a.to>l?t[s--]=new _e(l,a.to):t.splice(s--,1))}}return n}function Xy(i,e,t,n){let r=0,s=0,o=!1,l=!1,a=-1e9,h=[];for(;;){let c=r==i.length?1e9:o?i[r].to:i[r].from,f=s==e.length?1e9:l?e[s].to:e[s].from;if(o!=l){let u=Math.max(a,t),d=Math.min(c,f,n);u<d&&h.push(new _e(u,d))}if(a=Math.min(c,f),a==1e9)break;c==a&&(o?(o=!1,r++):o=!0),f==a&&(l?(l=!1,s++):l=!0)}return h}function Qd(i,e){let t=[];for(let{pos:n,mount:r,frag:s}of i){let o=n+(r.overlay?r.overlay[0].from:0),l=o+r.tree.length,a=Math.max(s.from,o),h=Math.min(s.to,l);if(r.overlay){let c=r.overlay.map(u=>new _e(u.from+n,u.to+n)),f=Xy(e,c,a,h);for(let u=0,d=a;;u++){let O=u==f.length,m=O?h:f[u].from;if(m>d&&t.push(new bt(d,m,r.tree,-o,s.from>=d||s.openStart,s.to<=m||s.openEnd)),O)break;d=f[u].to}}else t.push(new bt(a,h,r.tree,-o,s.from>=o||s.openStart,s.to<=l||s.openEnd))}return t}var ca,wy,_e,R,Et,Py,te,St,fs,dd,W,j,Jl,Lt,us,je,ta,xi,ia,ki,gd,wi,bt,yt,sa,Os,oa,la,aa,ps,ha,ut=N(()=>{ca=1024,wy=0,_e=class{constructor(e,t){this.from=e,this.to=t}},R=class{constructor(e={}){this.id=wy++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=te.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};R.closedBy=new R({deserialize:i=>i.split(" ")}),R.openedBy=new R({deserialize:i=>i.split(" ")}),R.group=new R({deserialize:i=>i.split(" ")}),R.isolate=new R({deserialize:i=>{if(i&&i!="rtl"&&i!="ltr"&&i!="auto")throw new RangeError("Invalid value for isolate: "+i);return i||"auto"}}),R.contextHash=new R({perNode:!0}),R.lookAhead=new R({perNode:!0}),R.mounted=new R({perNode:!0});Et=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[R.mounted.id]}},Py=Object.create(null),te=class i{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):Py,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new i(e.name||"",t,e.id,n);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return r}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(R.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 n=>{for(let r=n.prop(R.group),s=-1;s<(r?r.length:0);s++){let o=t[s<0?n.name:r[s]];if(o)return o}}}};te.none=new te("",Object.create(null),0,8);St=class i{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let n of this.types){let r=null;for(let s of e){let o=s(n);if(o){r||(r=Object.assign({},n.props));let l=o[1],a=o[0];a.combine&&a.id in r&&(l=a.combine(r[a.id],l)),r[a.id]=l}}t.push(r?new te(n.name,r,n.id,n.flags):n)}return new i(t)}},fs=new WeakMap,dd=new WeakMap;(function(i){i[i.ExcludeBuffers=1]="ExcludeBuffers",i[i.IncludeAnonymous=2]="IncludeAnonymous",i[i.IgnoreMounts=4]="IgnoreMounts",i[i.IgnoreOverlays=8]="IgnoreOverlays",i[i.EnterBracketed=16]="EnterBracketed"})(W||(W={}));j=class i{constructor(e,t,n,r,s){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,s&&s.length){this.props=Object.create(null);for(let[o,l]of s)this.props[typeof o=="number"?o:o.id]=l}}toString(){let e=Et.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let n of this.children){let r=n.toString();r&&(t&&(t+=","),t+=r)}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 ki(this.topNode,e)}cursorAt(e,t=0,n=0){let r=fs.get(this)||this.topNode,s=new ki(r);return s.moveTo(e,t),fs.set(this,s._tree),s}get topNode(){return new je(this,0,0,null)}resolve(e,t=0){let n=Gn(fs.get(this)||this.topNode,e,t,!1);return fs.set(this,n),n}resolveInner(e,t=0){let n=Gn(dd.get(this)||this.topNode,e,t,!0);return dd.set(this,n),n}resolveStack(e,t=0){return $y(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:s=this.length}=e,o=e.mode||0,l=(o&W.IncludeAnonymous)>0;for(let a=this.cursor(o|W.IncludeAnonymous);;){let h=!1;if(a.from<=s&&a.to>=r&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&n&&(l||!a.type.isAnonymous)&&n(a),!a.nextSibling();){if(!a.parent())return;h=!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(e={}){return this.children.length<=8?this:ra(te.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new i(this.type,t,n,r,this.propValues),e.makeTree||((t,n,r)=>new i(te.none,t,n,r)))}static build(e){return vy(e)}};j.empty=new j(te.none,[],[],0);Jl=class i{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 i(this.buffer,this.index)}},Lt=class i{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return te.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],s=r.name;if(/\W/.test(s)&&!r.isError&&(s=JSON.stringify(s)),e+=4,n==e)return s;let o=[];for(;e<n;)o.push(this.childString(e)),e=this.buffer[e+3];return s+"("+o.join(",")+")"}findChild(e,t,n,r,s){let{buffer:o}=this,l=-1;for(let a=e;a!=t&&!(Od(s,r,o[a+1],o[a+2])&&(l=a,n>0));a=o[a+3]);return l}slice(e,t,n){let r=this.buffer,s=new Uint16Array(t-e),o=0;for(let l=e,a=0;l<t;){s[a++]=r[l++],s[a++]=r[l++]-n;let h=s[a++]=r[l++]-n;s[a++]=r[l++]-e,o=Math.max(o,h)}return new i(s,o,this.set)}};us=class{cursor(e=0){return new ki(this,e)}getChild(e,t=null,n=null){let r=pd(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return pd(this,e,t,n)}resolve(e,t=0){return Gn(this,e,t,!1)}resolveInner(e,t=0){return Gn(this,e,t,!0)}matchContext(e){return ea(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let r=t.lastChild;if(!r||r.to!=t.to)break;r.type.isError&&r.from==r.to?(n=t,t=r.prevSibling):t=r}return n}get node(){return this}get next(){return this.parent}},je=class i extends us{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(e,t,n,r,s=0){for(let o=this;;){for(let{children:l,positions:a}=o._tree,h=t>0?l.length:-1;e!=h;e+=t){let c=l[e],f=a[e]+o.from,u;if(!(!(s&W.EnterBracketed&&c instanceof j&&(u=Et.get(c))&&!u.overlay&&u.bracketed&&n>=f&&n<=f+c.length)&&!Od(r,n,f,f+c.length))){if(c instanceof Lt){if(s&W.ExcludeBuffers)continue;let d=c.findChild(0,c.buffer.length,t,n-f,r);if(d>-1)return new xi(new ta(o,c,e,f),null,d)}else if(s&W.IncludeAnonymous||!c.type.isAnonymous||na(c)){let d;if(!(s&W.IgnoreMounts)&&(d=Et.get(c))&&!d.overlay)return new i(d.tree,f,e,o);let O=new i(c,f,e,o);return s&W.IncludeAnonymous||!O.type.isAnonymous?O:O.nextChild(t<0?c.children.length-1:0,t,n,r,s)}}}if(s&W.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<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(e,t,n=0){let r;if(!(n&W.IgnoreOverlays)&&(r=Et.get(this._tree))&&r.overlay){let s=e-this.from,o=n&W.EnterBracketed&&r.bracketed;for(let{from:l,to:a}of r.overlay)if((t>0||o?l<=s:l<s)&&(t<0||o?a>=s:a>s))return new i(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}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()}};ta=class{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}},xi=class i extends us{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(e,t,n){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,n);return s<0?null:new i(this.context,this,s)}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(e,t,n=0){if(n&W.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new i(this.context,this,s)}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:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new i(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new i(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,s=n.buffer[this.index+3];if(s>r){let o=n.buffer[this.index+1];e.push(n.slice(r,s,o)),t.push(0)}return new j(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};ia=class{constructor(e,t){this.heads=e,this.node=t}get next(){return md(this.heads)}};ki=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&~W.EnterBracketed,e instanceof je)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.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 je?(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,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}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&W.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&W.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&W.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 r=n<0?0:this.stack[n]+4;if(this.index!=r)return this.yieldBuf(t.findChild(r,this.index,-1,0,4))}else{let r=t.buffer[this.index+3];if(r<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(r)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}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 s=0;s<this.index;s++)if(r.buffer.buffer[s+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 s=t+e,o=e<0?-1:n._tree.children.length;s!=o;s+=e){let l=n._tree.children[s];if(this.mode&W.IncludeAnonymous||l instanceof Lt||!l.type.isAnonymous||na(l))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,s=this.stack.length;s>=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;t=o,n=s+1;break e}r=this.stack[--s]}for(let r=n;r<this.stack.length;r++)t=new xi(this.buffer,t,this.stack[r]);return this.bufferNode=new xi(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 ea(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,s=this.stack.length-1;r>=0;s--){if(s<0)return ea(this._tree,e,r);let o=n[t.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}};gd=new WeakMap;wi=class{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof xi?this.setBuffer(e.context.buffer,e.index,t):e instanceof je&&this.map.set(e.tree,t)}get(e){return e instanceof xi?this.getBuffer(e.context.buffer,e.index):e instanceof je?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}},bt=class i{constructor(e,t,n,r,s=!1,o=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],n=!1){let r=[new i(0,e.length,e,0,!1,n)];for(let s of t)s.to>e.length&&r.push(s);return r}static applyChanges(e,t,n=128){if(!t.length)return e;let r=[],s=1,o=e.length?e[0]:null;for(let l=0,a=0,h=0;;l++){let c=l<t.length?t[l]:null,f=c?c.fromA:1e9;if(f-a>=n)for(;o&&o.from<f;){let u=o;if(a>=u.from||f<=u.to||h){let d=Math.max(u.from,a)-h,O=Math.min(u.to,f)-h;u=d>=O?null:new i(d,O,u.tree,u.offset+h,l>0,!!c)}if(u&&r.push(u),o.to>f)break;o=s<e.length?e[s++]:null}if(!c)break;a=c.toA,h=c.toA-c.toB}return r}},yt=class{startParse(e,t,n){return typeof e=="string"&&(e=new sa(e)),n=n?n.length?n.map(r=>new _e(r.from,r.to)):[new _e(0,0)]:[new _e(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let s=r.advance();if(s)return s}}},sa=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)}};Os=class{constructor(e,t,n,r,s,o){this.parser=e,this.parse=t,this.overlay=n,this.bracketed=r,this.target=s,this.from=o}};oa=class{constructor(e,t,n,r,s,o,l,a){this.parser=e,this.predicate=t,this.mounts=n,this.index=r,this.start=s,this.bracketed=o,this.target=l,this.prev=a,this.depth=0,this.ranges=[]}},la=new R({perNode:!0}),aa=class{constructor(e,t,n,r,s){this.nest=t,this.input=n,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let n=this.baseParse.advance();if(!n)return null;if(this.baseParse=null,this.baseTree=n,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return this.stoppedAt!=null&&(n=new j(n.type,n.children,n.positions,n.length,n.propValues.concat([[la,this.stoppedAt]]))),n}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[R.mounted.id]=new Et(t,e.overlay,e.parser,e.bracketed),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].from<e&&(e=Math.min(e,this.inner[t].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].parse.stopAt(e)}startInner(){let e=new ha(this.fragments),t=null,n=null,r=new ki(new je(this.baseTree,this.ranges[0].from,0,null),W.IncludeAnonymous|W.IgnoreMounts);e:for(let s,o;;){let l=!0,a;if(this.stoppedAt!=null&&r.from>=this.stoppedAt)l=!1;else if(e.hasNode(r)){if(t){let h=t.mounts.find(c=>c.frag.from<=r.from&&c.frag.to>=r.to&&c.mount.overlay);if(h)for(let c of h.mount.overlay){let f=c.from+h.pos,u=c.to+h.pos;f>=r.from&&u<=r.to&&!t.ranges.some(d=>d.from<u&&d.to>f)&&t.ranges.push({from:f,to:u})}}l=!1}else if(n&&(o=Ty(n.ranges,r.from,r.to)))l=o!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.from<r.to||!s.overlay)){r.tree||(Cy(r),t&&t.depth++,n&&n.depth++);let h=e.findMounts(r.from,s.parser);if(typeof s.overlay=="function")t=new oa(s.parser,s.overlay,h,this.inner.length,r.from,!!s.bracketed,r.tree,t);else{let c=yd(this.ranges,s.overlay||(r.from<r.to?[new _e(r.from,r.to)]:[]));c.length&&bd(c),(c.length||!s.overlay)&&this.inner.push(new Os(s.parser,c.length?s.parser.startParse(this.input,Qd(h,c),c):s.parser.startParse(""),s.overlay?s.overlay.map(f=>new _e(f.from-r.from,f.to-r.from)):null,!!s.bracketed,r.tree,c.length?c[0].from:r.from)),s.overlay?c.length&&(n={ranges:c,depth:0,prev:n}):l=!1}}else if(t&&(a=t.predicate(r))&&(a===!0&&(a=new _e(r.from,r.to)),a.from<a.to)){let h=t.ranges.length-1;h>=0&&t.ranges[h].to==a.from?t.ranges[h]={from:t.ranges[h].from,to:a.to}:t.ranges.push(a)}if(l&&r.firstChild())t&&t.depth++,n&&n.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(t&&!--t.depth){let h=yd(this.ranges,t.ranges);h.length&&(bd(h),this.inner.splice(t.index,0,new Os(t.parser,t.parser.startParse(this.input,Qd(t.mounts,h),h),t.ranges.map(c=>new _e(c.from-t.start,c.to-t.start)),t.bracketed,t.target,h[0].from))),t=t.prev}n&&!--n.depth&&(n=n.prev)}}}};ps=class{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(W.IncludeAnonymous|W.IgnoreMounts)}moveTo(e){let{cursor:t}=this,n=e-this.offset;for(;!this.done&&t.from<n;)if(!(t.to>=e&&t.enter(n,1,W.IgnoreOverlays|W.ExcludeBuffers)))if(t.to<=e)t.next(!1)||(this.done=!0);else break}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof j)t=t.children[0];else break}return!1}},ha=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=(t=n.tree.prop(la))!==null&&t!==void 0?t:n.to,this.inner=new ps(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(la))!==null&&e!==void 0?e:t.to,this.inner=new ps(t.tree,-t.offset)}}findMounts(e,t){var n;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(n=s.tree)===null||n===void 0?void 0:n.prop(R.mounted);if(o&&o.parser==t)for(let l=this.fragI;l<this.fragments.length;l++){let a=this.fragments[l];if(a.from>=s.to)break;a.tree==this.curFrag.tree&&r.push({frag:a,pos:s.from-a.offset,mount:o})}}}return r}}});function Un(i,e=Uint16Array){if(typeof i!="string")return i;let t=null;for(let n=0,r=0;n<i.length;){let s=0;for(;;){let o=i.charCodeAt(n++),l=!1;if(o==126){s=65535;break}o>=92&&o--,o>=34&&o--;let a=o-32;if(a>=46&&(a-=46,l=!0),s+=a,l)break;s*=46}t?t[r++]=s:t=new e(s)}return t}function kd(i,e,t,n,r,s){let o=0,l=1<<n,{dialect:a}=t.p.parser;e:for(;(l&i[o])!=0;){let h=i[o+1];for(let d=o+3;d<h;d+=2)if((i[d+1]&l)>0){let O=i[d];if(a.allows(O)&&(e.token.value==-1||e.token.value==O||Ay(O,e.token.value,r,s))){e.acceptToken(O);break}}let c=e.next,f=0,u=i[o+2];if(e.next<0&&u>f&&i[h+u*3-3]==65535){o=i[h+u*3-1];continue e}for(;f<u;){let d=f+u>>1,O=h+d+(d<<1),m=i[O],g=i[O+1]||65536;if(c<m)u=d;else if(c>=g)f=d+1;else{o=i[O+2],e.advance();continue e}}break}}function wd(i,e,t){for(let n=e,r;(r=i[n])!=65535;n++)if(r==t)return n-e;return-1}function Ay(i,e,t,n){let r=wd(t,n,e);return r<0||wd(t,n,i)<r}function Pd(i,e,t){let n=i.cursor(W.IncludeAnonymous);for(n.moveTo(e);;)if(!(t<0?n.childBefore(e):n.childAfter(e)))for(;;){if((t<0?n.to<e:n.from>e)&&!n.type.isError)return t<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(i.length,Math.max(n.from+1,e+25));if(t<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return t<0?0:i.length}}function $d(i,e){for(let t=0;t<e.length;t++){let n=e[t];if(n.pos==i.pos&&n.sameState(i)){e[t].score<i.score&&(e[t]=i);return}}e.push(i)}function _t(i,e){return i[e]|i[e+1]<<16}function Ry(i){let e=null;for(let t of i){let n=t.p.stoppedAt;(t.pos==t.p.stream.end||n!=null&&t.pos>n)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.score<t.score)&&(e=t)}return e}function vd(i){if(i.external){let e=i.extend?1:0;return(t,n)=>i.external(t,n)<<1|e}return i.get}var ms,gs,fa,ua,cn,xd,bs,ii,jt,ie,Ue,da,Oa,pa,ma,ga,ba,zt,Ce,$i=N(()=>{ut();ms=class i{constructor(e,t,n,r,s,o,l,a,h,c=0,f){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=s,this.score=o,this.buffer=l,this.bufferBase=a,this.curContext=h,this.lookAhead=c,this.parent=f}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let r=e.parser.context;return new i(e,[],t,n,n,0,[],0,r?new gs(r,r.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){var t;let n=e>>19,r=e&65535,{parser:s}=this.p,o=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),l=s.dynamicPrecedence(r);if(l&&(this.score+=l),n==0){r<s.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(s.getGoto(this.state,r,!0),this.reducePos),r<s.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(r,this.reducePos);return}let a=this.stack.length-(n-1)*3-(e&262144?6:0),h=a?this.stack[a-2]:this.p.ranges[0].from;r<s.minRepeatTerm&&h==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let c=this.reducePos-h;c>=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(h==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=h,this.p.lastBigReductionSize=c));let f=a?this.stack[a-1]:0,u=this.bufferBase+this.buffer.length-f;if(r<s.minRepeatTerm||e&131072){let d=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,h,d,u+4,!0)}if(e&262144)this.state=this.stack[a];else{let d=this.stack[a-3];this.state=s.getGoto(d,r,!0)}for(;this.stack.length>a;)this.stack.pop();this.reduceContext(r,h)}storeNode(e,t,n,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let o=this.buffer.length;if(o>0&&this.buffer[o-4]==0&&this.buffer[o-1]>-1){if(t==n)return;if(this.buffer[o-2]>=t){this.buffer[o-2]=n;return}}}if(!s||this.pos==n)this.buffer.push(e,t,n,r);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let a=o;a>0&&this.buffer[a-2]>n;a-=4)if(this.buffer[a-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>n;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=n,this.buffer[o+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:o}=this.p;this.pos=r;let l=o.stateFlag(s,1);!l&&(r>n||t<=o.maxNode)&&(this.reducePos=r),this.pushState(s,l?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=o.maxNode&&this.buffer.push(t,n,r,4)}else this.pos=r,this.shiftContext(t,n),t<=this.p.parser.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){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(t&&e.buffer[t-4]==0&&(t-=4);t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new i(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,r,this.curContext,this.lookAhead,e)}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 fa(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)==0)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 r=[];for(let s=0,o;s<t.length;s+=2)(o=t[s+1])!=this.state&&this.p.parser.hasAction(o,e)&&r.push(t[s],o);if(this.stack.length<120)for(let s=0;r.length<8&&s<t.length;s+=2){let o=t[s+1];r.some((l,a)=>a&1&&l==o)||r.push(t[s],o)}t=r}let n=[];for(let r=0;r<t.length&&n.length<4;r+=2){let s=t[r+1];if(s==this.state)continue;let o=this.split();o.pushState(s,this.pos),o.storeNode(0,o.pos,o.pos,4,!0),o.shiftContext(t[r],this.pos),o.reducePos=this.pos,o.score-=200,n.push(o)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if((t&65536)==0)return!1;if(!e.validAction(this.state,t)){let n=t>>19,r=t&65535,s=this.stack.length-n*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;t=o}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,s)=>{if(!t.includes(r))return t.push(r),e.allActions(r,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-s;if(l>1){let a=o&65535,h=this.stack.length-l*3;if(h>=0&&e.getGoto(this.stack[h],a,!1)>=0)return l<<19|65536|a}}else{let l=n(o,s+1);if(l!=null)return l}})};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.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}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 gs(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()}},gs=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},fa=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}},ua=class i{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new i(e,t,t-e.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 i(this.stack,this.pos,this.index)}};cn=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},xd=new cn,bs=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=xd,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,s=this.pos+e;for(;s<n.from;){if(!r)return null;let o=this.ranges[--r];s-=n.from-o.to,n=o}for(;t<0?s>n.to:s>=n.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];s+=o.from-n.to,n=o}return s}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 s=this.resolveOffset(e,1);if(s==null)return-1;if(n=s,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let o=this.rangeIndex,l=this.range;for(;l.to<=n;)l=this.ranges[++o];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>l.to&&(this.chunk2=this.chunk2.slice(0,l.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 new 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.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=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=xd,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}},ii=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;kd(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};ii.prototype.contextual=ii.prototype.fallback=ii.prototype.extend=!1;jt=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e=="string"?Un(e):e}token(e,t){let n=e.pos,r=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if(kd(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;e.reset(o,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}};jt.prototype.contextual=ii.prototype.fallback=ii.prototype.extend=!1;ie=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};Ue=typeof process<"u"&&process.env&&/\bparse\b/.test(process.env.LOG),da=null;Oa=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Pd(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Pd(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;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 s=n.children[r],o=this.start[t]+n.positions[r];if(o>e)return this.nextStart=o,null;if(s instanceof j){if(o==e){if(o<this.safeFrom)return null;let l=o+s.length;if(l<=this.safeTo){let a=s.prop(R.lookAhead);if(!a||l+a<this.fragment.to)return s}}this.index[t]++,o+s.length>=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+s.length}}},pa=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new cn)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:s}=r,o=r.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let h=0;h<s.length;h++){if((1<<h&o)==0)continue;let c=s[h],f=this.tokens[h];if(!(n&&!c.fallback)&&((c.contextual||f.start!=e.pos||f.mask!=o||f.context!=l)&&(this.updateCachedToken(f,c,e),f.mask=o,f.context=l),f.lookAhead>f.end+25&&(a=Math.max(f.lookAhead,a)),f.value!=0)){let u=t;if(f.extended>-1&&(t=this.addActions(e,f.extended,f.end,t)),t=this.addActions(e,f.value,f.end,t),!c.extend&&(n=f,t>u))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),!n&&e.pos==this.stream.end&&(n=new cn,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 cn,{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:s}=n.p;for(let o=0;o<s.specialized.length;o++)if(s.specialized[o]==e.value){let l=s.specializers[o](this.stream.read(e.start,e.end),n);if(l>=0&&n.p.parser.dialect.allows(l>>1)){(l&1)==0?e.value=l>>1:e.extended=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let s=0;s<r;s+=3)if(this.actions[s]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:s}=e,{parser:o}=e.p,{data:l}=o;for(let a=0;a<2;a++)for(let h=o.stateSlot(s,a?2:1);;h+=3){if(l[h]==65535)if(l[h+1]==1)h=_t(l,h+2);else{r==0&&l[h+1]==2&&(r=this.putAction(_t(l,h+2),t,n,r));break}l[h]==t&&(r=this.putAction(_t(l,h+1),t,n,r))}return r}},ma=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 bs(t,r),this.tokens=new pa(e,this.stream),this.topTerm=e.top[1];let{from:s}=r[0];this.stacks=[ms.start(this,e.top[0],s)],this.fragments=n.length&&this.stream.end-s>e.bufferLength*4?new Oa(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<e.length;o++){let l=e[o];for(;;){if(this.tokens.mainToken=null,l.pos>t)n.push(l);else{if(this.advanceStack(l,n,e))continue;{r||(r=[],s=[]),r.push(l);let a=this.tokens.getMainToken(l);s.push(a.value,a.end)}}break}}if(!n.length){let o=r&&Ry(r);if(o)return Ue&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw Ue&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,n);if(o)return Ue&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(n.length>o)for(n.sort((l,a)=>a.score-l.score);n.length>o;)n.pop();n.some(l=>l.reducePos>t)&&this.recovering--}else if(n.length>1){e:for(let o=0;o<n.length-1;o++){let l=n[o];for(let a=o+1;a<n.length;a++){let h=n[a];if(l.sameState(h)||l.buffer.length>500&&h.buffer.length>500)if((l.score-h.score||l.buffer.length-h.buffer.length)>0)n.splice(a--,1);else{n.splice(o--,1);continue e}}}n.length>12&&(n.sort((o,l)=>l.score-o.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let o=1;o<n.length;o++)n[o].pos<this.minStackPos&&(this.minStackPos=n[o].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,n){let r=e.pos,{parser:s}=this,o=Ue?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let h=e.curContext&&e.curContext.tracker.strict,c=h?e.curContext.hash:0;for(let f=this.fragments.nodeAt(r);f;){let u=this.parser.nodeSet.types[f.type.id]==f.type?s.getGoto(e.state,f.type.id):-1;if(u>-1&&f.length&&(!h||(f.prop(R.contextHash)||0)==c))return e.useNode(f,u),Ue&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(f.type.id)})`),!0;if(!(f instanceof j)||f.children.length==0||f.positions[0]>0)break;let d=f.children[0];if(d instanceof j&&f.positions[0]==0)f=d;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),Ue&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let h=0;h<a.length;){let c=a[h++],f=a[h++],u=a[h++],d=h==a.length||!n,O=d?e:e.split(),m=this.tokens.mainToken;if(O.apply(c,f,m?m.start:O.pos,u),Ue&&console.log(o+this.stackID(O)+` (via ${(c&65536)==0?"shift":`reduce of ${s.getName(c&65535)}`} for ${s.getName(f)} @ ${r}${O==e?"":", split"})`),d)return!0;O.pos>r?t.push(O):n.push(O)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return $d(e,t),!0}}runRecovery(e,t,n){let r=null,s=!1;for(let o=0;o<e.length;o++){let l=e[o],a=t[o<<1],h=t[(o<<1)+1],c=Ue?this.stackID(l)+" -> ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),Ue&&console.log(c+this.stackID(l)+" (restarted)"),this.advanceFully(l,n))))continue;let f=l.split(),u=c;for(let d=0;d<10&&f.forceReduce()&&(Ue&&console.log(u+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,n));d++)Ue&&(u=this.stackID(f)+" -> ");for(let d of l.recoverByInsert(a))Ue&&console.log(c+this.stackID(d)+" (via recover-insert)"),this.advanceFully(d,n);this.stream.end>l.pos?(h==l.pos&&(h++,a=0),l.recoverByDelete(a,h),Ue&&console.log(c+this.stackID(l)+` (via recover-delete ${this.parser.getName(a)})`),$d(l,n)):(!r||r.score<f.score)&&(r=f)}return r}stackToTree(e){return e.close(),j.build({buffer:ua.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=(da||(da=new WeakMap)).get(e);return t||da.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}};ga=class{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}},ba=i=>i,zt=class{constructor(e){this.start=e.start,this.shift=e.shift||ba,this.reduce=e.reduce||ba,this.reuse=e.reuse||ba,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},Ce=class i extends yt{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let l=0;l<e.repeatNodeCount;l++)t.push("");let n=Object.keys(e.topRules).map(l=>e.topRules[l][1]),r=[];for(let l=0;l<t.length;l++)r.push([]);function s(l,a,h){r[l].push([a,a.deserialize(String(h))])}if(e.nodeProps)for(let l of e.nodeProps){let a=l[0];typeof a=="string"&&(a=R[a]);for(let h=1;h<l.length;){let c=l[h++];if(c>=0)s(c,a,l[h++]);else{let f=l[h+-c];for(let u=-c;u>0;u--)s(l[h++],a,f);h++}}}this.nodeSet=new St(t.map((l,a)=>te.define({name:a>=this.minRepeatTerm?void 0:l,id:a,props:r[a],top:n.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=1024;let o=Un(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;l<this.specializerSpecs.length;l++)this.specialized[l]=this.specializerSpecs[l].term;this.specializers=this.specializerSpecs.map(vd),this.states=Un(e.states,Uint32Array),this.data=Un(e.stateData),this.goto=Un(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(l=>typeof l=="number"?new ii(o,l):l),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 ma(this,e,t,n);for(let s of this.wrappers)r=s(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let o=r[s++],l=o&1,a=r[s++];if(l&&n)return a;for(let h=s+(o>>1);s<h;s++)if(r[s]==e)return a;if(l)return-1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let s=this.stateSlot(e,r?2:1),o;;s+=3){if((o=n[s])==65535)if(n[s+1]==1)o=n[s=_t(n,s+2)];else{if(n[s+1]==2)return _t(n,s+2);break}if(o==t||o==0)return _t(n,s+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,n=>n==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=_t(this.data,s+2);else break;r=t(_t(this.data,s+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=_t(this.data,n+2);else break;if((this.data[n+2]&1)==0){let r=this.data[n+1];t.some((s,o)=>o&1&&s==r)||t.push(this.data[n],r)}}return t}configure(e){let t=Object.assign(Object.create(i.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(n=>{let r=e.tokenizers.find(s=>s.from==n);return r?r.to:n})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,r)=>{let s=e.specializers.find(l=>l.from==n.external);if(!s)return n;let o=Object.assign(Object.assign({},n),{external:s.to});return t.specializers[r]=vd(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}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 s of e.split(" ")){let o=t.indexOf(s);o>=0&&(n[o]=!0)}let r=null;for(let s=0;s<t.length;s++)if(!n[s])for(let o=this.dialects[t[s]],l;(l=this.data[o++])!=65535;)(r||(r=new Uint8Array(this.maxTerm+1)))[l]=1;return new ga(e,n,r)}static deserialize(e){return new i(e)}}});function Ey(i,e){return i.length==e.length&&i.every((t,n)=>t==e[n])}function Ly(i){let e=[[]];for(let t=0;t<i.length;t++)for(let n=0,r=e.length;n<r;n++)e.push(e[n].concat(i[t]));return e.sort((t,n)=>n.length-t.length)}function Oe(i){let e=Object.create(null);for(let t in i){let n=i[t];Array.isArray(n)||(n=[n]);for(let r of t.split(" "))if(r){let s=[],o=2,l=r;for(let f=0;;){if(l=="..."&&f>0&&f+3==r.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw new RangeError("Invalid path: "+r);if(s.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==r.length)break;let d=r[f++];if(f==r.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+r);l=r.slice(f)}let a=s.length-1,h=s[a];if(!h)throw new RangeError("Invalid path: "+r);let c=new vi(n,o,a>0?s.slice(0,a):null);e[h]=c.sort(e[h])}}return Td.add(e)}function ks(i,e){let t=Object.create(null);for(let s of i)if(!Array.isArray(s.tag))t[s.tag.id]=s.class;else for(let o of s.tag)t[o.id]=s.class;let{scope:n,all:r=null}=e||{};return{style:s=>{let o=r;for(let l of s)for(let a of l.set){let h=t[a.id];if(h){o=o?o+" "+h:h;break}}return o},scope:n}}function _y(i,e){let t=null;for(let n of i){let r=n.style(e);r&&(t=t?t+" "+r:r)}return t}function ws(i,e,t,n=0,r=i.length){let s=new Sa(n,Array.isArray(e)?e:[e],t);s.highlightRange(i.cursor(),n,r,"",s.highlighters),s.flush(r)}function jy(i,e,t,n,r,s=0,o=i.length){let l=s;function a(h,c){if(!(h<=l)){for(let f=i.slice(l,h),u=0;;){let d=f.indexOf(`
@@ -1,4 +1,4 @@
1
- var ZE=Object.defineProperty;var Z=(s,t)=>()=>(s&&(t=s(s=0)),t);var Ht=(s,t)=>{for(var e in t)ZE(s,e,{get:t[e],enumerable:!0})};function _O(s){for(let t of s){if(t.disposed){s.delete(t);continue}t.dirty=!0,as||(as=new Set,kh||queueMicrotask(VO)),as.add(t)}}function VO(){let s,t=0;for(;s=as;){if(++t>100){as=null,console.error("signals: drain loop exceeded 100 iterations");break}as=null;for(let e of s)if(!e.disposed&&e.dirty){e.dirty=!1;try{e.run()}catch(i){e.onError?e.onError(i):(e.disposed=!0,queueMicrotask(()=>{throw i}))}}}}function WE(s){if(kh){s();return}kh=!0;try{s()}finally{kh=!1,as&&VO()}}function F(s){let t=xe;xe=null;try{return s()}finally{xe=t}}function Ni(s){let t=new Set;return{[wh]:!0,get value(){return xe&&t.add(xe),s},set value(e){Object.is(s,e)||(s=e,_O(t))},peek(){return s}}}function Rd(s){let t=new Set,e,i=!0,r={dirty:!1,disposed:!1,run(){i=!0,_O(t)}};return{[wh]:!0,get value(){if(xe&&t.add(xe),i){let n=xe;xe=r;try{e=s(),i=!1}finally{xe=n}}return e},peek(){return e}}}function ls(s,t){let e={dirty:!1,disposed:!1,host:t?.host??null,onError:t?.onError??null,run(){let i=xe;xe=e;try{s()}finally{xe=i}}};return e.run(),()=>{e.disposed=!0}}function Id(s){return s!=null&&typeof s=="object"&&s[wh]===!0}var wh,xe,as,kh,$t=Z(()=>{"use strict";wh=Symbol("signal"),xe=null,as=null,kh=!1});function tt(s,...t){return{strings:s,values:t}}function UE(s,...t){let e="";for(let r=0;r<s.length;r++)e+=s[r],r<t.length&&(e+=t[r]);let i=new CSSStyleSheet;return i.replaceSync(e),i}function FE(s){let t=0,e=0,i=0;for(;i<s.length;){if(t===0&&s.charCodeAt(i)===60&&s.charCodeAt(i+1)===33&&s.charCodeAt(i+2)===45&&s.charCodeAt(i+3)===45){let n=s.indexOf("-->",i+4);if(n===-1){e=0;break}i=n+3,e=0;continue}let r=s.charCodeAt(i);t?r===(t===1?39:34)&&(t=0):r===39?t=1:r===34?t=2:r===60?e=1:r===62&&(e=0),i++}return e===1}function YE(s){let t=jO.get(s);if(t)return t;let e="";for(let i=0;i<s.length;i++)e+=s[i],i<s.length-1&&(e+=FE(e)?`{{p:${i}}}`:`<!--p:${i}-->`);return t=document.createElement("template"),t.innerHTML=e,jO.set(s,t),t}function UO(s,t){if(WO[t])return WO[t];let e=Object.getOwnPropertyNames(s);for(let r=0;r<e.length;r++){let n=e[r];if(n!==t&&n.toLowerCase()===t)return n}let i=Object.getPrototypeOf(s);for(;i&&i!==Object.prototype;){let r=Object.getOwnPropertyNames(i);for(let n=0;n<r.length;n++){let o=r[n];if(o!==t&&o.toLowerCase()===t)return o}i=Object.getPrototypeOf(i)}return t}function ir(s,t){let e=t._i;(!e||e.s!==s.strings)&&(e&&Eh(e.p),e=HE(s,t),t._i=e),tC(e.p,s.values)}function HE(s,t){let{strings:e}=s,r=YE(e).content.cloneNode(!0),n=GE(t);n&&(r=KE(r,n));let o=JE(r,s.values.length);return t.replaceChildren(r),{s:e,p:o}}function GE(s){if(!s||s.nodeType!==1)return null;if(s.namespaceURI===Ah)return Ah;if(s.namespaceURI===$a)return $a;if(typeof s.closest!="function")return null;let t=s.closest("svg, math, foreignObject, annotation-xml");if(!t)return null;let e=t.localName;if(e==="foreignobject"||e==="foreignObject")return null;if(e==="annotation-xml"){let i=(t.getAttribute("encoding")||"").toLowerCase();return i==="text/html"||i==="application/xhtml+xml"?null:$a}return e==="svg"?Ah:e==="math"?$a:null}function KE(s,t){let e=document.createDocumentFragment();return YO(s,e,t),e}function YO(s,t,e){for(let i of[...s.childNodes])if(i.nodeType===1){let n=document.createElementNS(e,i.localName);for(let l of i.attributes)l.namespaceURI?n.setAttributeNS(l.namespaceURI,l.name,l.value):n.setAttribute(l.name,l.value);t.appendChild(n);let o=i.localName,a=e;if(e===Ah&&(o==="foreignObject"||o==="foreignobject"))a=FO;else if(e===$a&&o==="annotation-xml"){let l=(i.getAttribute("encoding")||"").toLowerCase();(l==="text/html"||l==="application/xhtml+xml")&&(a=FO)}YO(i,n,a)}else t.appendChild(i.cloneNode(!0))}function JE(s,t){let e=new Array(t),i=document.createTreeWalker(s,129),r;for(;r=i.nextNode();)if(r.nodeType===8){let n=r.data.match(/^p:(\d+)$/);if(n){let o=document.createTextNode("");r.replaceWith(o),i.currentNode=o,e[+n[1]]={t:"n",n:o,c:void 0,_fx:null}}}else if(r.nodeType===1)for(let n of[...r.attributes]){let o=n.value.match(/^\{\{p:(\d+)\}\}$/);if(!o){if(n.value.includes("{{p:")){let h=n.name,c=h==="class"?' class="${expression}" \u2190 full replacement (whole class string is the expression)\n .className=${expression} \u2190 writes to the className property (resolved camelCase since FB-55 fix)\n':h==="style"?' style="${expression}" \u2190 full replacement of the style string\n .style.cssText=${expression} \u2190 write CSS text via the style.cssText accessor\n':` ${h}="\${expression}" \u2190 full replacement (whole attr is the placeholder)
1
+ var ZE=Object.defineProperty;var Z=(s,t,e)=>()=>{if(e)throw e[0];try{return s&&(t=s(s=0)),t}catch(i){throw e=[i],i}};var Ht=(s,t)=>{for(var e in t)ZE(s,e,{get:t[e],enumerable:!0})};function _O(s){for(let t of s){if(t.disposed){s.delete(t);continue}t.dirty=!0,as||(as=new Set,kh||queueMicrotask(VO)),as.add(t)}}function VO(){let s,t=0;for(;s=as;){if(++t>100){as=null,console.error("signals: drain loop exceeded 100 iterations");break}as=null;for(let e of s)if(!e.disposed&&e.dirty){e.dirty=!1;try{e.run()}catch(i){e.onError?e.onError(i):(e.disposed=!0,queueMicrotask(()=>{throw i}))}}}}function WE(s){if(kh){s();return}kh=!0;try{s()}finally{kh=!1,as&&VO()}}function F(s){let t=xe;xe=null;try{return s()}finally{xe=t}}function Ni(s){let t=new Set;return{[wh]:!0,get value(){return xe&&t.add(xe),s},set value(e){Object.is(s,e)||(s=e,_O(t))},peek(){return s}}}function Rd(s){let t=new Set,e,i=!0,r={dirty:!1,disposed:!1,run(){i=!0,_O(t)}};return{[wh]:!0,get value(){if(xe&&t.add(xe),i){let n=xe;xe=r;try{e=s(),i=!1}finally{xe=n}}return e},peek(){return e}}}function ls(s,t){let e={dirty:!1,disposed:!1,host:t?.host??null,onError:t?.onError??null,run(){let i=xe;xe=e;try{s()}finally{xe=i}}};return e.run(),()=>{e.disposed=!0}}function Id(s){return s!=null&&typeof s=="object"&&s[wh]===!0}var wh,xe,as,kh,$t=Z(()=>{"use strict";wh=Symbol("signal"),xe=null,as=null,kh=!1});function tt(s,...t){return{strings:s,values:t}}function UE(s,...t){let e="";for(let r=0;r<s.length;r++)e+=s[r],r<t.length&&(e+=t[r]);let i=new CSSStyleSheet;return i.replaceSync(e),i}function FE(s){let t=0,e=0,i=0;for(;i<s.length;){if(t===0&&s.charCodeAt(i)===60&&s.charCodeAt(i+1)===33&&s.charCodeAt(i+2)===45&&s.charCodeAt(i+3)===45){let n=s.indexOf("-->",i+4);if(n===-1){e=0;break}i=n+3,e=0;continue}let r=s.charCodeAt(i);t?r===(t===1?39:34)&&(t=0):r===39?t=1:r===34?t=2:r===60?e=1:r===62&&(e=0),i++}return e===1}function YE(s){let t=jO.get(s);if(t)return t;let e="";for(let i=0;i<s.length;i++)e+=s[i],i<s.length-1&&(e+=FE(e)?`{{p:${i}}}`:`<!--p:${i}-->`);return t=document.createElement("template"),t.innerHTML=e,jO.set(s,t),t}function UO(s,t){if(WO[t])return WO[t];let e=Object.getOwnPropertyNames(s);for(let r=0;r<e.length;r++){let n=e[r];if(n!==t&&n.toLowerCase()===t)return n}let i=Object.getPrototypeOf(s);for(;i&&i!==Object.prototype;){let r=Object.getOwnPropertyNames(i);for(let n=0;n<r.length;n++){let o=r[n];if(o!==t&&o.toLowerCase()===t)return o}i=Object.getPrototypeOf(i)}return t}function ir(s,t){let e=t._i;(!e||e.s!==s.strings)&&(e&&Eh(e.p),e=HE(s,t),t._i=e),tC(e.p,s.values)}function HE(s,t){let{strings:e}=s,r=YE(e).content.cloneNode(!0),n=GE(t);n&&(r=KE(r,n));let o=JE(r,s.values.length);return t.replaceChildren(r),{s:e,p:o}}function GE(s){if(!s||s.nodeType!==1)return null;if(s.namespaceURI===Ah)return Ah;if(s.namespaceURI===$a)return $a;if(typeof s.closest!="function")return null;let t=s.closest("svg, math, foreignObject, annotation-xml");if(!t)return null;let e=t.localName;if(e==="foreignobject"||e==="foreignObject")return null;if(e==="annotation-xml"){let i=(t.getAttribute("encoding")||"").toLowerCase();return i==="text/html"||i==="application/xhtml+xml"?null:$a}return e==="svg"?Ah:e==="math"?$a:null}function KE(s,t){let e=document.createDocumentFragment();return YO(s,e,t),e}function YO(s,t,e){for(let i of[...s.childNodes])if(i.nodeType===1){let n=document.createElementNS(e,i.localName);for(let l of i.attributes)l.namespaceURI?n.setAttributeNS(l.namespaceURI,l.name,l.value):n.setAttribute(l.name,l.value);t.appendChild(n);let o=i.localName,a=e;if(e===Ah&&(o==="foreignObject"||o==="foreignobject"))a=FO;else if(e===$a&&o==="annotation-xml"){let l=(i.getAttribute("encoding")||"").toLowerCase();(l==="text/html"||l==="application/xhtml+xml")&&(a=FO)}YO(i,n,a)}else t.appendChild(i.cloneNode(!0))}function JE(s,t){let e=new Array(t),i=document.createTreeWalker(s,129),r;for(;r=i.nextNode();)if(r.nodeType===8){let n=r.data.match(/^p:(\d+)$/);if(n){let o=document.createTextNode("");r.replaceWith(o),i.currentNode=o,e[+n[1]]={t:"n",n:o,c:void 0,_fx:null}}}else if(r.nodeType===1)for(let n of[...r.attributes]){let o=n.value.match(/^\{\{p:(\d+)\}\}$/);if(!o){if(n.value.includes("{{p:")){let h=n.name,c=h==="class"?' class="${expression}" \u2190 full replacement (whole class string is the expression)\n .className=${expression} \u2190 writes to the className property (resolved camelCase since FB-55 fix)\n':h==="style"?' style="${expression}" \u2190 full replacement of the style string\n .style.cssText=${expression} \u2190 write CSS text via the style.cssText accessor\n':` ${h}="\${expression}" \u2190 full replacement (whole attr is the placeholder)
2
2
  .${h}=\${expression} \u2190 property assignment (preferred for objects/functions)
3
3
  `;console.warn(`[template] Partial attribute interpolation is not supported.
4
4
  Element: <${r.tagName.toLowerCase()}>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adia-ai/web-modules",
3
- "version": "0.8.6",
3
+ "version": "0.8.8",
4
4
  "description": "AdiaUI composite custom elements \u2014 shell, chat, editor, runtime clusters built from @adia-ai/web-components primitives. Subpath exports per cluster.",
5
5
  "type": "module",
6
6
  "exports": {